{"version":3,"sources":["webpack:///./Scripts/Actions/LightboxImages.action.js","webpack:///./Scripts/Components/LightboxImages.js"],"names":["props","dispatch","useDispatch","visible","index","useSelector","state","lightboxImages","useCallback","type","LIGHTBOX_IMAGES_SHOW","payload","show","imageIndex","setImageIndex","useState","swapImage","i","images","length","React","Fragment","className","onClick","style","transform","width","height","viewBox","fill","xmlns","d","dangerouslySetInnerHTML","__html","html","map","image","key","e"],"mappings":"4JAKO,MCkJP,EAhGwBA,IACpB,MAAMC,GAAWC,WACX,QAAEC,EAAO,MAAEC,IAAUC,SAAaC,GAAUA,EAAMC,kBACxCC,kBAAY,IAAMP,ED9CjBE,KAAO,CACxBM,KAAMC,KACNC,QAAS,CACLR,aC2CuCS,EAAK,KAAS,CAACX,IAE1D,IAAKY,EAAYC,IAAiBC,cAAS,GAC3C,MAAMC,EAAaC,IACXA,IAAMjB,EAAMkB,OAAOC,SACnBF,EAAI,GAEJA,EAAI,IACJA,EAAIjB,EAAMkB,OAAOC,OAAS,GAE9BL,EAAcG,EAAE,EAGpB,OAAQjB,EAAMkB,QAAUlB,EAAMkB,OAAOC,OAAS,EAC1CC,gBAACC,WAAQ,MAETD,gBAACC,WAAQ,KACLD,gBAAA,OAAKE,UAAU,kBACXF,gBAAA,WAASE,UAAU,yBACfF,gBAAA,UAAQE,UAAU,oBAAoBC,QAASA,KAAQP,EAAUH,EAAa,EAAE,GAC5EO,gBAAA,OAAKI,MAAO,CAAEC,UAAW,kBAAmBC,MAAM,IAAIC,OAAO,KAAKC,QAAQ,WAAWC,KAAK,OAAOC,MAAM,8BACnGV,gBAAA,QAAMW,EAAE,4MAA4MF,KAAK,cAGjOT,gBAAA,UACIE,UAAU,qBACVU,wBAAyB,CACrBC,OAAQjC,EAAMkB,OAAOL,GAAYqB,QAIzCd,gBAAA,UAAQE,UAAU,oBAAoBC,QAASA,KAAQP,EAAUH,EAAa,EAAE,GAC5EO,gBAAA,OAAKM,MAAM,IAAIC,OAAO,KAAKC,QAAQ,WAAWC,KAAK,OAAOC,MAAM,8BAC5DV,gBAAA,QAAMW,EAAE,4MAA4MF,KAAK,eAKrOT,gBAAA,OAAKE,UAAU,sBACVtB,EAAMkB,OAAOiB,KACV,CAACC,EAAOhC,IAEAgB,gBAAA,UACIE,UAAY,sBAAoBlB,IAAUS,EAAa,SAAW,IAClEwB,IAAKjC,EACL4B,wBAAyB,CACrBC,OACIG,EAAMF,MAEdX,QAAUe,IACNtB,EAAUZ,EAAM,OAOpCgB,gBAAA,OAAKE,UAAU,eAAeT,EAAa,EAAE,IAAGb,EAAMkB,OAAOC,SAiC5E,C","file":"496.c85f7028ed3ac332804e.js","sourcesContent":["import {\r\n LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\r\n LIGHTBOX_IMAGES_SHOW,\r\n} from '../constants';\r\n\r\nexport const setCurrentIndex = (index) => ({\r\n type: LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\r\n payload: {\r\n index,\r\n },\r\n});\r\n\r\nexport const show = (visible) => ({\r\n type: LIGHTBOX_IMAGES_SHOW,\r\n payload: {\r\n visible,\r\n },\r\n});\r\n","import React, { Fragment, useCallback, useState } from 'react';\r\n//import Modal from 'react-modal';\r\nimport 'react-responsive-carousel/lib/styles/carousel.min.css';\r\n//import { Carousel as Lightbox } from 'react-responsive-carousel';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { show, setCurrentIndex } from '../Actions/LightboxImages.action';\r\n\r\nconst customStyles = {\r\n content: {\r\n background: 'none',\r\n padding: 0,\r\n border: 'none',\r\n },\r\n overlay: {\r\n background: 'rgba(0, 0, 0, 0.8)',\r\n zIndex: 2003,\r\n },\r\n};\r\nconst LightboxSettings = {\r\n showStatus: false,\r\n showIndicators: false,\r\n useKeyboardArrows: true,\r\n thumbWidth: 50,\r\n autoPlay: false,\r\n autoFocus: true,\r\n};\r\n\r\nconst renderThumbnails = (children) => {\r\n const images = children.map((item, index) => {\r\n if (!item || !item.props || !item.props.children) {\r\n return undefined;\r\n }\r\n\r\n // find img to get source\r\n const imageElement = item.props.children.find(\r\n (ele) => ele.type === 'img'\r\n );\r\n if (!imageElement || !imageElement.props || !imageElement.props.src) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n );\r\n });\r\n\r\n return images;\r\n};\r\n\r\nconst LightboxImages = (props) => {\r\n const dispatch = useDispatch();\r\n const { visible, index } = useSelector((state) => state.lightboxImages);\r\n const onClose = useCallback(() => dispatch(show(false)), [dispatch]);\r\n\r\n let [imageIndex, setImageIndex] = useState(0)\r\n const swapImage = (i) => {\r\n if (i === props.images.length) {\r\n i = 0\r\n }\r\n if (i < 0) {\r\n i = props.images.length - 1\r\n }\r\n setImageIndex(i)\r\n }\r\n\r\n return !props.images || props.images.length < 1 ? (\r\n \r\n ) : (\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n {props.images.map(\r\n (image, index) =>\r\n (\r\n {\r\n swapImage(index);\r\n }}\r\n >\r\n \r\n )\r\n )}\r\n
\r\n
{imageIndex + 1}/{ props.images.length }
\r\n
\r\n {/**/}\r\n {/* */}\r\n {/* {images.map((value, index) => (*/}\r\n {/* */}\r\n {/* */}\r\n {/* ×*/}\r\n {/* */}\r\n {/* */}\r\n {/* */}\r\n {/* ))}*/}\r\n {/* */}\r\n {/**/}\r\n
\r\n );\r\n};\r\n\r\nexport default LightboxImages;\r\n"],"sourceRoot":""}