{"version":3,"sources":["webpack:///./Scripts/Actions/LightboxImages.action.js","webpack:///./Scripts/_Solution/Components/LightboxImages.js"],"names":["show","visible","type","LIGHTBOX_IMAGES_SHOW","payload","customStyles","content","background","padding","border","overlay","zIndex","LightboxSettings","showStatus","showIndicators","useKeyboardArrows","thumbWidth","autoPlay","autoFocus","renderThumbnails","children","map","item","index","props","imageElement","src","key","style","backgroundImage","className","dispatch","useDispatch","useSelector","state","lightboxImages","onClose","useCallback","onClickThumbnail","LIGHTBOX_IMAGES_SET_CURRENT_IMAGE","setCurrentIndex","scrollContainerRef","handleScroll","scrollTo","isAtStart","isAtEnd","useSmoothHorizontalScroll","images","length","Fragment","data-src","href","itemProp","onClick","e","preventDefault","rel","dangerouslySetInnerHTML","__html","html","disabled","ref","onScroll","overflowX","image","ariaHideApp","preventScroll","isOpen","onRequestClose","shouldCloseOnOverlayClick","translate","selectedItem","renderThumbs","value"],"mappings":"0LAKO,MAOMA,EAAQC,IAAD,CAChBC,KAAMC,KACNC,QAAS,CACLH,a,uOCNR,MAAMI,EAAe,CACjBC,QAAS,CACLC,WAAY,OACZC,QAAS,EACTC,OAAQ,QAEZC,QAAS,CACLH,WAAY,qBACZI,OAAQ,OAGVC,EAAmB,CACrBC,YAAY,EACZC,gBAAgB,EAChBC,mBAAmB,EACnBC,WAAY,GACZC,UAAU,EACVC,WAAW,GAGTC,EAAoBC,GACPA,EAASC,KAAI,CAACC,EAAMC,KAC/B,IAAKD,IAASA,EAAKE,QAAUF,EAAKE,MAAMJ,SACpC,OAIJ,MAAMK,EAAeH,EAAKE,MAAMJ,SAChC,OAAKK,GAAiBA,EAAaD,OAAUC,EAAaD,MAAME,IAK5D,uBACIC,IAAKJ,EACLK,MAAO,CACHC,gBAAiB,OAASJ,EAAaD,MAAME,IAAM,KAEvDI,UAAU,0BAVlB,KA8HR,EA5GwBN,IACpB,MAAMO,GAAWC,WACX,QAAE/B,EAAF,MAAWsB,IAAUU,SAAaC,GAAUA,EAAMC,iBAClD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aAAa,EACbC,eAAe,EACfC,OAAQlE,EACRmE,eAAgBhC,EAChBR,MAAOvB,EACPgE,2BAA2B,GAE3B,0BACIhB,QAASjB,EACTN,UAAU,yBAETwC,OAAU,wBAEf,gBAAC,KAAD,KACQ1D,EADR,CAEI2D,aAAchD,EACdO,UAAU,YACV0C,aAAcrD,IAEbK,EAAMuB,OAAO1B,KAAI,CAACoD,EAAOlD,IACtB,uBACII,IAAM,SAAQJ,IACdO,UAAU,wBAEV,uBAAKJ,IAAK+C,EAAM/C,IAAKI,UAAU","file":"536.9df06fb73271bd05fd3c.js","sourcesContent":["import {\n LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\n LIGHTBOX_IMAGES_SHOW,\n} from '../constants';\n\nexport const setCurrentIndex = (index) => ({\n type: LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\n payload: {\n index,\n },\n});\n\nexport const show = (visible) => ({\n type: LIGHTBOX_IMAGES_SHOW,\n payload: {\n visible,\n },\n});\n","import React, { Fragment, useCallback, useRef } from 'react';\nimport Modal from 'react-modal';\nimport 'react-responsive-carousel/lib/styles/carousel.min.css';\nimport { Carousel as Lightbox } from 'react-responsive-carousel';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { show, setCurrentIndex } from '../../Actions/LightboxImages.action';\nimport { translate } from '../../Services/translation';\nimport useSmoothHorizontalScroll from 'use-smooth-horizontal-scroll';\n\nconst customStyles = {\n content: {\n background: 'none',\n padding: 0,\n border: 'none',\n },\n overlay: {\n background: 'rgba(0, 0, 0, 0.8)',\n zIndex: 2003,\n },\n};\nconst LightboxSettings = {\n showStatus: false,\n showIndicators: false,\n useKeyboardArrows: true,\n thumbWidth: 50,\n autoPlay: false,\n autoFocus: true,\n};\n\nconst renderThumbnails = (children) => {\n const images = children.map((item, index) => {\n if (!item || !item.props || !item.props.children) {\n return undefined;\n }\n\n // find img to get source\n const imageElement = item.props.children;\n if (!imageElement || !imageElement.props || !imageElement.props.src) {\n return undefined;\n }\n\n return (\n \n );\n });\n\n return images;\n};\n\nconst LightboxImages = (props) => {\n const dispatch = useDispatch();\n const { visible, index } = useSelector((state) => state.lightboxImages);\n const onClose = useCallback(() => dispatch(show(false)), [dispatch]);\n const onClickThumbnail = (index) => {\n dispatch(show(true));\n dispatch(setCurrentIndex(index));\n };\n const { scrollContainerRef, handleScroll, scrollTo, isAtStart, isAtEnd } = useSmoothHorizontalScroll();\n\n return !props.images || props.images.length < 1 ? (\n \n ) : (\n \n
\n
\n
\n {\n e.preventDefault();\n onClickThumbnail(0);\n }}\n className=\"product-image\"\n rel=\"nofollow\"\n dangerouslySetInnerHTML={{\n __html: props.images[0].html,\n }}\n >\n
\n
\n {props.images?.length > 1 &&\n
\n \n
\n {props.images.map(\n (image, index) =>\n index > 0 && (\n \n
\n {\n e.preventDefault();\n onClickThumbnail(index);\n }}\n className=\"product-image\"\n rel=\"nofollow\"\n dangerouslySetInnerHTML={{\n __html:\n props.images[index].html,\n }}\n >
\n
\n )\n )}\n
\n \n\n
\n }\n\n \n \n \n {translate('common.button.close')}\n \n \n {props.images.map((value, index) => (\n \n \n \n ))}\n \n \n
\n );\n};\n\nexport default LightboxImages;\n"],"sourceRoot":""}