{"version":3,"sources":["webpack:///./Scripts/Components/LightboxImages.js"],"names":["customStyles","content","background","padding","border","overlay","zIndex","LightboxSettings","showStatus","showIndicators","useKeyboardArrows","thumbWidth","autoPlay","autoFocus","renderThumbnails","children","map","item","index","props","imageElement","find","ele","type","src","key","style","backgroundImage","className","dispatch","useDispatch","visible","useSelector","state","lightboxImages","onClose","useCallback","show","onClickThumbnail","setCurrentIndex","images","length","Fragment","data-src","itemProp","onClick","thumbnails","image","ariaHideApp","preventScroll","isOpen","onRequestClose","shouldCloseOnOverlayClick","selectedItem","renderThumbs","value"],"mappings":"yYAOA,MAAMA,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,SAASM,MACpCC,GAAqB,QAAbA,EAAIC,OAEjB,OAAKH,GAAiBA,EAAaD,OAAUC,EAAaD,MAAMK,IAK5D,uBACIC,IAAKP,EACLQ,MAAO,CACHC,gBAAiB,OAASP,EAAaD,MAAMK,IAAM,KAEvDI,UAAU,0BAVlB,KAiHR,EA/FwBT,IACpB,MAAMU,GAAWC,WACX,QAAEC,EAAF,MAAWb,IAAUc,SAAaC,GAAUA,EAAMC,iBAClDC,GAAUC,kBAAY,IAAMP,GAASQ,SAAK,KAAS,CAACR,IACpDS,EAAoBpB,IACtBW,GAASQ,SAAK,IACdR,GAASU,QAAgBrB,KAG7B,OAAQC,EAAMqB,QAAUrB,EAAMqB,OAAOC,OAAS,EAC1C,gBAAC,EAAAC,SAAD,MAEA,gBAAC,EAAAA,SAAD,KACI,uBAAKd,UAAU,sBACX,uBAAKA,UAAU,2CACX,0BAAQA,UAAU,mCACd,qBACIe,WAAUxB,EAAMqB,OAAO,GAAGhB,IAC1BoB,SAAS,MACTC,QAAS,IAAMP,EAAiB,GAChCV,UAAU,iBAEV,uBACIA,UAAU,8BACVgB,SAAS,QACTpB,IAAKL,EAAM2B,WAAW,GAAGtB,SAKzC,uBAAKI,UAAU,mDACX,uBAAKA,UAAU,OACVT,EAAMqB,OAAOxB,KACV,CAAC+B,EAAO7B,IACJA,EAAQ,GACJ,uBACIU,UAAU,mDACVH,IAAKP,GAEL,qBACIyB,WAAUI,EAAMvB,IAChBoB,SAAS,MACTC,QAAS,IACLP,EAAiBpB,GAErBU,UAAU,iBAEV,uBACIA,UAAU,+BACVgB,SAAS,QACTpB,IACIL,EAAM2B,WAAW5B,GAAOM,aAUhE,gBAAC,IAAD,CACIwB,aAAa,EACbC,eAAe,EACfC,OAAQnB,EACRoB,eAAgBhB,EAChBT,MAAO1B,EACPoD,2BAA2B,GAE3B,gBAAC,KAAD,KACQ7C,EADR,CAEI8C,aAAcnC,EACdU,UAAU,YACV0B,aAAcxC,IAEbK,EAAMqB,OAAOxB,KAAI,CAACuC,EAAOrC,IACtB,uBACIO,IAAM,SAAQP,IACdU,UAAU,wBAEV,0BACIiB,QAASV,EACTP,UAAU,wBAFd,KAMA,uBAAKJ,IAAK+B,EAAM/B,IAAKI,UAAU","file":"277.dcc3cbff2a65b2883b75.js","sourcesContent":["import React, { Fragment, useCallback } 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';\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.find(\n (ele) => ele.type === 'img'\n );\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\n return !props.images || props.images.length < 1 ? (\n \n ) : (\n \n
\n
\n
\n onClickThumbnail(0)}\n className=\"product-image\"\n >\n \n \n
\n
\n
\n
\n {props.images.map(\n (image, index) =>\n index > 0 && (\n \n \n onClickThumbnail(index)\n }\n className=\"product-image\"\n >\n \n \n
\n )\n )}\n
\n
\n \n \n \n {props.images.map((value, index) => (\n \n \n ×\n \n \n \n ))}\n \n \n
\n );\n};\n\nexport default LightboxImages;\n"],"sourceRoot":""}