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,EAAkB,CAAElG,GAAIvC,EAAMuC,GAAIgE,KAAM,OAAQwC,WAAY/I,EAAM+I,aACtF,gBAAoBN,EAAkB,CAAElG,GAAIvC,EAAMuC,GAAIgE,KAAM,OAAQwC,WAAY/I,EAAM+I,aAAe/I,aAAqC,EAC1IA,EAAMsJ,cAElBlG,EAAmBmG,aAAe,CAC9BH,kBAAkB,GAEtB,K","sources":["webpack:///./assets/common/src/components/utils/ThronVideo.tsx","webpack:///./assets/common/src/utils/regions.ts","webpack:///./assets/stone/src/components/gallery/GallerySimple.tsx","webpack:///./assets/stone/src/components/gallery/Gallery.tsx","webpack:///./assets/stone/src/components/gallery/GallerySlide.tsx","webpack:///./assets/stone/src/hooks/useSwiperColGap.tsx","webpack:///./assets/stone/src/ui/button/CarouselNavigation.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { useEffect, useRef, useState } from 'react';\nimport ThronIntegrationComponent from './../../scripts/components/thronIntegrationComponent';\nconst ThronVideo = (props) => {\n const videoRef = useRef();\n const [thronComponent, setThronComponent] = useState(null);\n useEffect(() => {\n if (videoRef.current) {\n if (thronComponent) {\n thronComponent.changeContent(props.thronID);\n }\n else {\n const options = {};\n props.onPauseCallback && (options.onPauseCallback = props.onPauseCallback);\n props.onPlayCallback && (options.onPlayCallback = props.onPlayCallback);\n props.onCompleteCallback && (options.onCompleteCallback = props.onCompleteCallback);\n props.onInitCallback && (options.onInitCallback = props.onInitCallback);\n props.onTimeUpdate && (options.onTimeUpdate = props.onTimeUpdate);\n typeof props.loopTimes === 'number' && (options.loopTimes = props.loopTimes);\n const newThronComponent = new ThronIntegrationComponent(videoRef.current, 'video', options);\n setThronComponent(newThronComponent);\n }\n }\n }, [props.thronID]);\n return (React.createElement(\"div\", { ref: videoRef, \"aria-hidden\": \"true\", className: classNames('video-wrapper', props.className), \"data-option-id\": props.thronID, \"data-option-mobile-id\": props === null || props === void 0 ? void 0 : props.thronMobileID, \"data-option-muted\": props.muted, \"data-option-autoplay\": props.autoplay, \"data-option-loop\": props.loop, \"data-option-lock-bitrate\": props.lockBitrate, \"data-option-no-skin\": props.noskin, \"data-option-sess-id\": props.sessionId }));\n};\nexport default ThronVideo;\n","export function isRegionPopulate(region, key) {\n var _a, _b;\n console.log('regions', region === null || region === void 0 ? void 0 : region.regions);\n return !!((_b = (_a = region === null || region === void 0 ? void 0 : region.regions[key]) === null || _a === void 0 ? void 0 : _a.components) === null || _b === void 0 ? void 0 : _b.length);\n}\nexport function extractNativeComponent(page, id) {\n var _a;\n let _component;\n if ((_a = page === null || page === void 0 ? void 0 : page.regions) === null || _a === void 0 ? void 0 : _a.length) {\n page.regions.forEach((region) => {\n var _a;\n if ((_a = region === null || region === void 0 ? void 0 : region.components) === null || _a === void 0 ? void 0 : _a.length) {\n region.components.forEach((component) => {\n if (component.id === id) {\n _component = component;\n }\n });\n }\n });\n }\n return _component;\n}\nexport function extractNativeRegionComponents(component, id) {\n var _a;\n let _components;\n if ((_a = component === null || component === void 0 ? void 0 : component.regions) === null || _a === void 0 ? void 0 : _a.length) {\n component.regions.forEach((region) => {\n var _a;\n if (region.id === id && ((_a = region === null || region === void 0 ? void 0 : region.components) === null || _a === void 0 ? void 0 : _a.length)) {\n _components = region.components;\n }\n });\n }\n return _components;\n}\n// const isRegionsPopulate = (region: Region, key: string) => {\n// return !!region.regions[key]\n// };\n","import React, { useRef } from 'react';\nimport SwiperCore, { A11y, Keyboard, Navigation, Pagination, FreeMode } from 'swiper';\nimport { Swiper, SwiperSlide } from 'swiper/react';\nimport useSwiperColGap from '@stone/hooks/useSwiperColGap';\nimport GallerySlide from './GallerySlide';\nimport classNames from 'classnames';\nimport CarouselNavigation from '@stone/ui/button/CarouselNavigation';\nSwiperCore.use([Keyboard, Navigation, A11y, Pagination, FreeMode]);\nconst GallerySimple = (props) => {\n const { slides, mediaQueries } = props;\n const { isDesktop } = mediaQueries;\n const swiperRef = useRef(null);\n const gap = useSwiperColGap(swiperRef, 2, props.isIndented ? 20 : 24);\n const renderNavigation = () => (React.createElement(\"div\", { className: \"gallery__carousel-pagination--simple\" },\n React.createElement(CarouselNavigation, { id: `gallery-${props.id}`, right: true })));\n const renderCarousel = () => {\n var _a;\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: classNames('col-24', { 'col-lg-20 offset-lg-2': props.isIndented }) },\n React.createElement(\"div\", { className: \"gallery__carousel gallery__carousel--simple\" }, !!(slides === null || slides === void 0 ? void 0 : slides.length) && (React.createElement(Swiper, { onSwiper: (swiper) => (swiperRef.current = swiper), spaceBetween: isDesktop ? gap : 12, slidesPerView: \"auto\", watchSlidesProgress: true, className: (_a = props.alignement) === null || _a === void 0 ? void 0 : _a.toLowerCase(), freeMode: true, navigation: {\n nextEl: `.gallery-${props.id}-navigation--next`,\n prevEl: `.gallery-${props.id}-navigation--prev`,\n } }, props.slides.map((slide) => (React.createElement(SwiperSlide, { className: \"gallery__carousel-slide\", key: slide.id }, ({ isVisible }) => React.createElement(GallerySlide, { slide: slide, isVisible: isVisible, ratio: props.ratio, isDesktop: props.mediaQueries.isDesktop }))))))))));\n };\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"container\" },\n React.createElement(\"div\", { className: \"row\" }, renderNavigation()),\n React.createElement(\"div\", { className: \"row\" }, renderCarousel()))));\n};\nexport default GallerySimple;\n","import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport api from '@common/utils/api';\nimport { extractNativeComponent, extractNativeRegionComponents } from '@common/utils/regions';\nimport '@stone/scss/components/gallery/_gallery.scss';\nimport useMediaQueries from '@stone/hooks/useMediaQueries';\nimport SwiperCore, { Navigation, A11y, Keyboard, Pagination } from 'swiper';\nimport GallerySimple from './GallerySimple';\nSwiperCore.use([Keyboard, Navigation, A11y, Pagination]);\nconst GalleryUniform = React.lazy(() => import('./GalleryUniform'));\nconst Gallery = (props) => {\n // ANCHOR - HOOKS --------------------------------------------------------------------\n const containerRef = useRef(null);\n const mediaQueries = useMediaQueries();\n const { isDesktop, isTouch, isWideDesktop } = mediaQueries;\n // ANCHOR - STATES --------------------------------------------------------------------\n const [gallery, setGallery] = useState(null);\n const [slides, setSlides] = useState([]);\n // ANCHOR - MEMO --------------------------------------------------------------------\n const isCarouselTouch = useMemo(() => !isDesktop || (isTouch && !isWideDesktop), [isDesktop, isWideDesktop, isTouch]);\n const uniformProps = useMemo(() => {\n return {\n slides,\n id: gallery === null || gallery === void 0 ? void 0 : gallery.id,\n mediaQueries,\n ratio: gallery === null || gallery === void 0 ? void 0 : gallery.data.ratio,\n };\n }, [slides, gallery, mediaQueries]);\n const asymmetricProps = useMemo(() => {\n return {\n slides,\n id: gallery === null || gallery === void 0 ? void 0 : gallery.id,\n mediaQueries,\n alignement: gallery === null || gallery === void 0 ? void 0 : gallery.data.alignement,\n isIndented: gallery === null || gallery === void 0 ? void 0 : gallery.data.indented,\n };\n }, [slides, gallery, mediaQueries]);\n // ANCHOR - USEFFECTS --------------------------------------------------------------------\n useEffect(() => {\n api.getPageJson(props.pageId, true).then((res) => {\n if (res) {\n const gallery = extractNativeComponent(res, props.componentId);\n if (gallery) {\n setGallery(gallery);\n const slides = extractNativeRegionComponents(gallery, 'images');\n if (slides === null || slides === void 0 ? void 0 : slides.length) {\n setSlides(slides);\n }\n }\n }\n });\n }, []);\n useEffect(() => {\n if (containerRef.current && isDesktop) {\n const observer = new ResizeObserver(() => {\n let maxHeight = 0;\n const videoStatusbar = containerRef.current.querySelectorAll('.editorial-video-statusbar');\n const labels = containerRef.current.querySelectorAll('.gallery-slide__labels');\n const _elements = [...videoStatusbar, ...labels];\n _elements.forEach((entry) => {\n if (entry.clientHeight > maxHeight) {\n maxHeight = entry.clientHeight;\n }\n });\n const height = `${maxHeight / 10 + 1.6}rem`;\n const parentId = 'gallery-' + props.componentId;\n const parent = document.getElementById(parentId);\n parent.style.setProperty('--label-height', height);\n });\n observer.observe(containerRef.current);\n return () => {\n observer.disconnect();\n };\n }\n }, [isDesktop]);\n return (React.createElement(\"div\", { ref: containerRef }, gallery && (slides === null || slides === void 0 ? void 0 : slides.length) && (React.createElement(\"div\", { className: `gallery gallery--${props.type.toLowerCase()}` },\n props.type === 'UNIFORM' && (!isCarouselTouch ? React.createElement(GalleryUniform, Object.assign({}, uniformProps)) : React.createElement(GallerySimple, Object.assign({}, uniformProps))),\n props.type === 'ASYMMETRIC' && React.createElement(GallerySimple, Object.assign({}, asymmetricProps))))));\n};\nexport default Gallery;\n","import React from 'react';\nimport Image from '@stone/ui/image/Image';\nimport EditorialVideo from '../editorial/EditorialVideo';\nconst GallerySlide = (props) => {\n var _a, _b, _c, _d;\n const { slide } = props;\n const ratioClass = (_a = props === null || props === void 0 ? void 0 : props.ratio) === null || _a === void 0 ? void 0 : _a.replace('/', '-');\n const renderLabels = () => (React.createElement(React.Fragment, null, (slide.data.firstLabel || slide.data.secondLabel) && (React.createElement(\"div\", { className: \"gallery-slide__labels\" },\n React.createElement(\"div\", { className: \"row\" },\n slide.data.firstLabel && (React.createElement(\"div\", { className: `inner-col-lg-${slide.data.secondLabel ? 3 : 9}` },\n React.createElement(\"span\", { className: \"font__subtitle\" }, slide.data.firstLabel))),\n slide.data.secondLabel && props.isDesktop && (React.createElement(\"div\", { className: `inner-col-lg-${slide.data.firstLabel ? 6 : 9}` },\n React.createElement(\"span\", { className: \"font__subtitle\" }, slide.data.secondLabel))))))));\n if (slide.type_id === 'component_editorial_video')\n return (React.createElement(EditorialVideo, { caption1: slide.data.caption1, caption2: slide.data.caption2, thronId: slide.data.thronId, thronMobileId: slide.data.thronMobileId, lockBitrate: slide.data.lockBitrate, inGallery: true }));\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: `gallery-image--wrapper ${(props === null || props === void 0 ? void 0 : props.ratio) ? `relative aspect-ratio--${ratioClass}` : ''}` },\n React.createElement(Image, { src: (_b = props.slide.custom) === null || _b === void 0 ? void 0 : _b.image, srcMobile: (_c = props.slide.custom) === null || _c === void 0 ? void 0 : _c.imageMobile, alt: (_d = props.slide.data) === null || _d === void 0 ? void 0 : _d.imgAlt })),\n renderLabels()));\n};\nexport default GallerySlide;\n","import { useEffect, useState } from 'react';\nimport { debounce } from 'lodash';\nconst useSwiperColGap = (swiperRef, cols, totalsCols) => {\n const [gap, setGap] = useState(0);\n const totals = totalsCols || 24;\n useEffect(() => {\n const listenGap = debounce(() => {\n if (swiperRef.current) {\n const { width } = swiperRef.current.el.getBoundingClientRect();\n const oneCol = (width - 12 * (totals - 1)) / totals;\n const gap = oneCol * cols + 12 * (cols + 1);\n setGap(gap);\n }\n }, 200);\n listenGap();\n window.addEventListener('resize', listenGap);\n return () => window.removeEventListener('resize', listenGap);\n }, []);\n return gap;\n};\nexport default useSwiperColGap;\n","import React from 'react';\nimport Icon from '../icon/Icon';\nimport { useTranslation } from 'react-i18next';\nimport classNames from 'classnames';\nexport const ButtonNavigation = (props) => {\n const { t } = useTranslation();\n const labelMap = {\n next: t('carousel.nextslidemessage'),\n prev: t('carousel.prevslidemessage'),\n };\n const textMap = {\n next: t('label.next'),\n prev: t('label.prev'),\n };\n const iconMap = {\n next: 'right-chevron',\n prev: 'left-chevron',\n };\n return (React.createElement(\"button\", { className: `button button-navigation--${props.type} ${props.id}-navigation--${props.type}`, \"aria-label\": labelMap[props.type] }, props.isExtended ? (React.createElement(React.Fragment, null,\n props.type === 'prev' && '<',\n React.createElement(\"span\", null, textMap[props.type]),\n props.type === 'next' && '>')) : (React.createElement(React.Fragment, null,\n React.createElement(Icon, { name: iconMap[props.type], family: \"10\" })))));\n};\nconst CarouselNavigation = (props) => {\n return (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: classNames(`navigation ${props.id}-navigation`, { inverted: props.inverted }, { opacityOnDisabled: props.opacityOnDisable }, { 'justify-end': props.right }) }, props === null || props === void 0 ? void 0 :\n props.prevContent,\n React.createElement(ButtonNavigation, { id: props.id, type: \"prev\", isExtended: props.isExtended }),\n React.createElement(ButtonNavigation, { id: props.id, type: \"next\", isExtended: props.isExtended }), props === null || props === void 0 ? void 0 :\n props.nextContent)));\n};\nCarouselNavigation.defaultProps = {\n opacityOnDisable: true,\n};\nexport default CarouselNavigation;\n"],"names":["props","videoRef","useRef","thronComponent","setThronComponent","useState","useEffect","current","changeContent","thronID","options","onPauseCallback","onPlayCallback","onCompleteCallback","onInitCallback","onTimeUpdate","loopTimes","newThronComponent","ref","className","thronMobileID","muted","autoplay","loop","lockBitrate","noskin","sessionId","isRegionPopulate","region","key","_a","_b","console","log","regions","components","length","extractNativeComponent","page","id","_component","forEach","component","extractNativeRegionComponents","_components","slides","mediaQueries","isDesktop","swiperRef","gap","useSwiperColGap","isIndented","CarouselNavigation","right","onSwiper","swiper","spaceBetween","slidesPerView","watchSlidesProgress","alignement","toLowerCase","freeMode","navigation","nextEl","prevEl","map","slide","isVisible","GallerySlide","ratio","GalleryUniform","containerRef","useMediaQueries","isTouch","isWideDesktop","gallery","setGallery","setSlides","isCarouselTouch","useMemo","uniformProps","data","asymmetricProps","indented","api","pageId","then","res","componentId","observer","ResizeObserver","maxHeight","querySelectorAll","entry","clientHeight","height","parentId","document","getElementById","style","setProperty","observe","disconnect","type","Object","assign","_c","_d","ratioClass","replace","type_id","caption1","caption2","thronId","thronMobileId","inGallery","src","custom","image","srcMobile","imageMobile","alt","imgAlt","firstLabel","secondLabel","cols","totalsCols","setGap","totals","listenGap","debounce","width","el","getBoundingClientRect","window","addEventListener","removeEventListener","ButtonNavigation","t","labelMap","next","prev","textMap","isExtended","name","family","inverted","opacityOnDisabled","opacityOnDisable","prevContent","nextContent","defaultProps"],"sourceRoot":""}