{"version":3,"sources":["webpack:///./scripts/Components/ProductCarousel/styles|lazy|/^\\.\\/.*\\.scss$/|groupOptions: {}|namespace object","webpack:///./scripts/Components/ProductCarousel/ProductCarousel.js","webpack:///./styles/exports/wtg.module.scss","webpack:///./scripts/Hooks/useIsMobile.js","webpack:///./scripts/Hooks/useWindowSize.js"],"names":["map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","id","keys","Object","module","exports","window","__litium","themeName","withSize","ProductCarousel","elements","title","url","urlTitle","productsRef","useRef","canScrollPrev","setCanScrollPrev","useState","canScrollNext","setCanScrollNext","hasScroll","currentSlide","setCurrentSlide","isFirstSlide","current","scrollLeft","isLastSlide","scrollWidth","clientWidth","onScroll","i","children","length","elm","num","offsetLeft","Math","ceil","useEffect","isMobile","useIsMobile","showMoreLinkMobile","React","className","href","onClick","prev","scrollTo","left","behavior","Icon","iconCode","next","ref","ProductCard","_extends","key","forceWidth","fromCarousel","breakpoint","parseInt","breakpoints","replace","windowWidth","initialWidth","innerWidth","initialHeight","innerHeight","size","setSize","useLayoutEffect","updateSize","addEventListener","removeEventListener","useWindowSize","setIsMobile"],"mappings":"wEAAA,IAAIA,EAAM,CACT,aAAc,CACb,MACA,MAED,cAAe,CACd,MACA,MAED,kBAAmB,CAClB,MACA,MAED,iBAAkB,CACjB,MACA,MAED,aAAc,CACb,MACA,OAGF,SAASC,EAAoBC,GAC5B,IAAIC,EAAoBC,EAAEJ,EAAKE,GAC9B,OAAOG,QAAQC,UAAUC,MAAK,KAC7B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBP,EAAM,KAEjD,MADAM,EAAEE,KAAO,mBACHF,CAAC,IAIT,IAAIG,EAAMX,EAAIE,GAAMU,EAAKD,EAAI,GAC7B,OAAOR,EAAoBK,EAAEG,EAAI,IAAIJ,MAAK,IAClCJ,EAAoBS,IAE7B,CACAX,EAAoBY,KAAO,IAAOC,OAAOD,KAAKb,GAC9CC,EAAoBW,GAAK,MACzBG,EAAO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AShD,OARAI,sBAAgB,KACd,SAASC,IACPF,EAAQ,CAACjE,OAAO6D,WAAY7D,OAAO+D,aACrC,CAGA,OAFA/D,OAAOoE,iBAAiB,SAAUD,GAClCA,IACO,IAAMnE,OAAOqE,oBAAoB,SAAUF,EAAW,GAC5D,IACIH,CACT,CDNwBM,IACfnC,EAAUoC,GAAejC,WAAeqB,GAAeJ,EAAa,GAM3E,OAJArB,gBAAU,KACRqC,EAAYZ,GAAeJ,EAAa,EAAE,GACzC,CAACI,EAAaJ,IAEVpB,CAAQ,C","file":"8369.f84ba0cf1479780d89a1.js","sourcesContent":["var map = {\n\t\"./alf.scss\": [\n\t\t94723,\n\t\t4723\n\t],\n\t\"./main.scss\": [\n\t\t97161,\n\t\t7161\n\t],\n\t\"./oh-poppy.scss\": [\n\t\t76882,\n\t\t6882\n\t],\n\t\"./vincent.scss\": [\n\t\t59889,\n\t\t9889\n\t],\n\t\"./wtg.scss\": [\n\t\t44922,\n\t\t4922\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(() => {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = () => (Object.keys(map));\nwebpackAsyncContext.id = 78363;\nmodule.exports = webpackAsyncContext;","import React, { useRef, useState, useLayoutEffect, useEffect } from 'react';\nimport useIsMobile from '../../Hooks/useIsMobile';\nimport Icon from '../IconBase/Icon';\nimport ProductCard from '../ProductCard/ProductCard';\nimport { withSize } from 'react-sizeme';\nimport(`./styles/${window.__litium.themeName}.scss`);\n\nconst roundUpNearest10 = (num) => {\n return Math.ceil(num / 10) * 10;\n};\n\nconst ProductCarousel = ({ elements, title, url, urlTitle }) => {\n const itemsToScroll = 2;\n const productsRef = useRef();\n const [canScrollPrev, setCanScrollPrev] = useState(false);\n const [canScrollNext, setCanScrollNext] = useState(true);\n const hasScroll = canScrollPrev || canScrollNext;\n const [currentSlide, setCurrentSlide] = useState(0);\n const isFirstSlide = () =>\n typeof productsRef.current !== 'undefined' &&\n productsRef.current.scrollLeft < 1;\n const isLastSlide = () =>\n typeof productsRef.current !== 'undefined' &&\n productsRef.current.scrollWidth <=\n productsRef.current.clientWidth + productsRef.current.scrollLeft;\n const next = () => {\n if (isLastSlide()) {\n return;\n }\n const scrollTo = currentSlide + itemsToScroll;\n if (scrollTo > elements.length) {\n productsRef.current.scrollTo({\n left: productsRef.current.children[elements.length].offsetLeft,\n behavior: 'smooth',\n });\n } else {\n productsRef.current.scrollTo({\n left: productsRef.current.children[scrollTo].offsetLeft,\n behavior: 'smooth',\n });\n }\n };\n const prev = () => {\n if (isFirstSlide()) {\n return;\n }\n const scrollTo = currentSlide - itemsToScroll;\n if (scrollTo <= 0) {\n productsRef.current.scrollTo({ left: 0, behavior: 'smooth' });\n } else {\n productsRef.current.scrollTo({\n left: productsRef.current.children[scrollTo].offsetLeft,\n behavior: 'smooth',\n });\n }\n };\n\n const onScroll = () => {\n setCanScrollPrev(!isFirstSlide());\n setCanScrollNext(!isLastSlide());\n for (let i = 0; i < productsRef.current.children.length - 1; i++) {\n const elm = productsRef.current.children[i];\n if (productsRef.current.scrollLeft <= roundUpNearest10(elm.offsetLeft)) {\n setCurrentSlide(i);\n break;\n }\n }\n };\n\n useEffect(() => {\n onScroll();\n });\n\n var isMobile = useIsMobile('medium');\n var showMoreLinkMobile = isMobile && url !== '' && urlTitle !== '';\n\n return (\n