{"version":3,"sources":["webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-companies-cru/client/js/components.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-companies-cru/client/js/config.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-companies-cru/client/js/index.js"],"names":["COMPONENTS","loader","name","module","exports","resolveComponents","getClickToCall","getCarouselCardSimple","config","component","cardSimpleConfig","resize","width","height","carousel","swiper","slidesPerView","slidesPerGroup","breakpoints","767","992","1200","require","elementExist","_require2","configuration","getCarouselCardSimpleObserver","observerConfig","element","carouselCardSimple","_toConsumableArray","querySelectorAll","map","item","carouselCardSimpleObserver","IntersectionObserver","entries","forEach","entry","intersectionRatio","filter","target","reduce","acc","then","default","unobserve","observe","selector","arguments","length","undefined","document","querySelector","_objectSpread","dataset","result","JSON","parse","publicPath","__webpack_public_path__","components","concat","root","rootMargin","threshold","observer"],"mappings":";gIAGA,IAgFMA,EAAa,CACf,CACIC,OA9DoB,WACxB,OAAO,6DA8DHC,KAAM,oBAEV,CACID,OAxDgB,WACpB,OAAO,4DAwDHC,KAAM,gBAEV,CACID,OAxCwB,WAC5B,OAAO,oEAwCHC,KAAM,wBAEV,CACID,OApFmB,WACvB,OAAO,6DAoFHC,KAAM,mBAEV,CACID,OAtCmB,WACvB,OAAO,oEAsCHC,KAAM,mBAEV,CACID,OAhCmB,WACvB,OAAO,6DAgCHC,KAAM,oBAWdC,EAAOC,QAAU,CACbC,kBALJ,WACI,OAAOL,GAKPM,eApHmB,WACnB,OAAO,4DAoHPC,sBA7E0B,WAC1B,OAAO,8D,mBCrCX,IAAMC,EAAS,CACXC,UAAW,mBACXC,iBAAkB,CACdC,OAAQ,CACJC,MAAO,IACPC,OAAQ,MAGhBC,SAAU,CACNC,OAAQ,CACJC,cAAe,EACfC,eAAgB,EAGhBC,YAAa,CAETC,IAAK,CACDH,cAAe,EACfC,eAAgB,GAGpBG,IAAK,CACDJ,cAAe,EACfC,eAAgB,GAGpBI,KAAM,CACFL,cA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9B8B,KAAI,SAAAvB,GAAS,MAAK,CACfR,OAAQQ,EAAUR,OAClB2B,QAASwB,SAASC,cAAc,oBAADS,OAAqBrD,EAAUP,KAAI,WAErEsC,QAAO,SAAA/B,GAAS,OAAIA,EAAUmB,WAG7BD,EAAiB,CACnBoC,KAAM,KACNC,WAAY,MACZC,UAAW,KAOTC,EAAW,IAAI/B,sBAAqB,SAAAC,GACtCA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BtC,EAVmB4D,EACdrB,QAAO,SAAA/B,GAAS,OAAIA,EAAUmB,UAAYU,EAAMG,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFX1C,UAUC2C,MAAK,SAAAzC,GACVA,EAAO0C,UAEPqB,EAASpB,UAAUR,EAAMG,gBAItCd,GAEHkC,EAAWxB,SAAQ,SAAA5B,GACfyD,EAASnB,QAAQtC,EAAUmB,YAI/BF,EAA8BC,EAAgBC,GAG9CtB,IAAiBsC,MAAK,SAAAzC,GAAM,OAAIA,EAAO0C","file":"main-companies-cru.d405f4ae5a8a9caca336.bundle.js","sourcesContent":["/**\n * ClickToCall\n */\nconst getClickToCall = () => {\n return import(\n /* webpackChunkName: \"click-to-call\" */\n '@bluekiri/alexandria-contrib-components/components/click-to-call/client/js'\n );\n};\n\n/**\n * MasonryCarousel\n */\nconst getMasonryCarousel = () => {\n return import(\n /* webpackChunkName: \"masonry-carousel\" */\n '@bluekiri/alexandria-contrib-components/components/masonry-carousel/client/js'\n );\n};\n\n/**\n * BreadcrumbsIdCru\n */\nconst getBreadcrumbsIdCru = () => {\n return import(\n /* webpackChunkName: \"breadcrumbs-id-cru\" */\n '../../../breadcrumbs-id-cru/client/js'\n );\n};\n\n/**\n * HeaderBanner\n */\nconst getHeaderBanner = () => {\n return import(\n /* webpackChunkName: \"header-banner\" */\n '../../../header-banner/client/js'\n );\n};\n\n/**\n * CarouselCardSimple\n */\nconst getCarouselCardSimple = () => {\n return import(\n /* webpackChunkName: \"carousel-card-simple\" */\n '@bluekiri/alexandria-logitravel/components/carousel-card-simple/client/js'\n );\n};\n\n/**\n * CardInfoCarouselList\n */\nconst getCardInfoCarouselList = () => {\n return import(\n /* webpackChunkName: \"card-info-carousel-list\" */\n '../../../card-info-carousel-list/client/js'\n );\n};\n\n/**\n * SearcherCruises\n */\nconst getSearcherCruises = () => {\n return import(\n /* webpackChunkName: \"searcher-section\" */\n '../../../searcher-section/client/js'\n );\n};\n\n/**\n * NewsletterAgent\n */\nconst getNewsletterAgent = () => {\n return import(\n /* webpackChunkName: \"newsletter-agent\" */\n '../../../newsletter-agent/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getBreadcrumbsIdCru,\n name: 'BreadcrumbsIdCru'\n },\n {\n loader: getHeaderBanner,\n name: 'HeaderBanner'\n },\n {\n loader: getCardInfoCarouselList,\n name: 'CardInfoCarouselList'\n },\n {\n loader: getMasonryCarousel,\n name: 'MasonryCarousel'\n },\n {\n loader: getSearcherCruises,\n name: 'SearcherSection'\n },\n {\n loader: getNewsletterAgent,\n name: 'NewsletterAgent'\n }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\nmodule.exports = {\n resolveComponents,\n getClickToCall,\n getCarouselCardSimple\n};\n","/* ==========================================================================\n MainCompaniesCru > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'MainCompaniesCru',\n cardSimpleConfig: {\n resize: {\n width: 272,\n height: 225\n }\n },\n carousel: {\n swiper: {\n slidesPerView: 5,\n slidesPerGroup: 5,\n\n /* Breakpoints config */\n breakpoints: {\n // when window width is <= 767px\n 767: {\n slidesPerView: 2,\n slidesPerGroup: 2\n },\n // when window width is <= 992px\n 992: {\n slidesPerView: 3,\n slidesPerGroup: 3\n },\n // when window width is <= 1200px\n 1200: {\n slidesPerView: 4,\n slidesPerGroup: 4\n }\n }\n }\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n MainCompaniesCru > Client\n ========================================================================== */\n\n/* Import modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst { resolveComponents, getClickToCall, getCarouselCardSimple } = require('./components');\n\nconst configuration = require('./config');\n\n/**\n * MainCompaniesCru component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function MainCompaniesCru(selector = '[data-component=MainCompaniesCru]') {\n if (elementExist(selector)) {\n const element = document.querySelector(selector);\n\n const config = {\n ...(function getConfig() {\n if (!element.dataset.config) return '';\n\n const result = JSON.parse(element.dataset.config);\n element.dataset.config = '';\n return result;\n })()\n };\n\n /**\n * Setting public path to the webpack exposed variable\n */\n /* eslint-disable */\n if (config.publicPath) __webpack_public_path__ = config.publicPath;\n /* eslint-enable */\n\n const components = resolveComponents()\n .filter(component => component.name !== 'CarouselCardSimple')\n .map(component => ({\n loader: component.loader,\n element: document.querySelector(`[data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n /* Observer Config */\n const observerConfig = {\n root: null, // avoiding 'root' or setting it to 'null' sets it to default value: viewport\n rootMargin: '0px',\n threshold: 0.15\n };\n\n /**\n * Observer to lazy load modules based on\n * currently viewed components in the viewport\n */\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = components\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n /**\n * Init component with its loader and then\n * unobserve from this entry so we dont\n * call the init of the component more\n * than once\n */\n loader().then(module => {\n module.default();\n\n observer.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n components.forEach(component => {\n observer.observe(component.element);\n });\n\n /* CarouselCardSimple init */\n getCarouselCardSimpleObserver(observerConfig, element);\n\n /* ClickToCall */\n getClickToCall().then(module => module.default());\n }\n};\n\nfunction getCarouselCardSimpleObserver(observerConfig, element) {\n const carouselCardSimple = [...element.querySelectorAll('[data-component=\"CarouselCardSimple\"]')].map(item => ({\n loader: getCarouselCardSimple,\n element: item\n }));\n\n /**\n * Since we have multiple of the same component, in this\n * layout the CarouselCardSimple component will have its own\n * observer part to handle its dynamic init\n */\n const carouselCardSimpleObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = carouselCardSimple\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n /**\n * Init component with its loader and then\n * unobserve from this entry so we dont\n * call the init of the component more\n * than once\n */\n loader().then(module => {\n module.default(`[data-component=\"CarouselCardSimple\"]`, {\n carousel: configuration().carousel\n });\n carouselCardSimpleObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n carouselCardSimple.forEach(component => {\n carouselCardSimpleObserver.observe(component.element);\n });\n}\n"],"sourceRoot":""}