{"version":3,"sources":["webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-zone-cru/client/js/components.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-zone-cru/client/js/index.js"],"names":["COMPONENTS","loader","name","module","exports","resolveComponents","getClickToCall","getSearcherCruises","require","elementExist","_require2","selector","arguments","length","undefined","element","document","querySelector","config","_objectSpread","dataset","result","JSON","parse","publicPath","__webpack_public_path__","components","map","component","concat","filter","observer","IntersectionObserver","entries","forEach","entry","intersectionRatio","target","reduce","acc","then","default","unobserve","root","rootMargin","threshold","observe"],"mappings":";iIAGA,IA4IMA,EAAa,CACf,CACIC,OA1HoB,WACxB,OAAO,6DA0HHC,KAAM,oBAEV,CACID,OAxIgB,WACpB,OAAO,4DAwIHC,KAAM,gBAEV,CACID,OA1FmB,WACvB,OAAO,6DA0FHC,KAAM,mBAEV,CACID,OAxGmB,WACvB,OAAO,6DAwGHC,KAAM,mBAEV,CACID,OAhIa,WACjB,OAAO,oEAgIHC,KAAM,aAEV,CACID,OA1HyB,WAC7B,OAAO,oEA0HHC,KAAM,yBAEV,CACID,OA5E+B,WACnC,OAAO,6DA4EHC,KAAM,+BAEV,CACID,OAtEkB,WACtB,OAAO,4DAsEHC,KAAM,kBAEV,CACID,OAxGkB,WACtB,OAAO,4DAwGHC,KAAM,kBAEV,CACID,OAlGqB,WACzB,OAAO,6DAkGHC,KAAM,qBAEV,CACID,OApDe,WACnB,OAAO,oEAoDHC,KAAM,eAEV,CACID,OA5EmB,WACvB,OAAO,4DA4EHC,KAAM,oBAWdC,EAAOC,QAAU,CACbC,kBALJ,WACI,OAAOL,GAKPM,eAxMmB,WACnB,OAAO,4DAwMPC,mBAjFuB,WACvB,OAAO,+D,wsBCvHXC,EAAQ,QAER,IAAQC,EAAiBD,EAAQ,QAAzBC,aAERC,EAAkEF,EAAQ,QAAlEH,EAAiBK,EAAjBL,kBAAmBE,EAAkBG,EAAlBH,mBAAoBD,EAAcI,EAAdJ,eAM/CH,EAAOC,QAAU,WAAkE,IAA7CO,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,iCAC7C,GAAIH,EAAaE,GAAW,CACxB,IAAMI,EAAUC,SAASC,cAAcN,GAEjCO,EAAMC,EAAA,GACJ,WACA,IAAKJ,EAAQK,QAAQF,OAAQ,MAAO,GAEpC,IAAMG,EAASC,KAAKC,MAAMR,EAAQK,QAAQF,QAE1C,OADAH,EAAQK,QAAQF,OAAS,GAClBG,EALP,IAaJH,EAAOM,aAAYC,IAA0BP,EAAOM,YAGxD,IAAME,EAAarB,IACdsB,KAAI,SAAAC,GAAS,MAAK,CACf3B,OAAQ2B,EAAU3B,OAClBc,QAASC,SAASC,cAAc,oBAADY,OAAqBD,EAAU1B,KAAI,WAErE4B,QAAO,SAAAF,GAAS,OAAIA,EAAUb,WAM7BgB,EAAW,IAAIC,sBACjB,SAAAC,GACIA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BnC,EAVmByB,EACdI,QAAO,SAAAF,GAAS,OAAIA,EAAUb,UAAYoB,EAAME,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXtC,UAUCuC,MAAK,SAAArC,GACVA,EAAOsC,UAEPV,EAASW,UAAUP,EAAME,gBAKzC,CACIM,KAAM,KACNC,WAAY,MACZC,UAAW,MAInBnB,EAAWQ,SAAQ,SAAAN,GACfG,EAASe,QAAQlB,EAAUb,YAI/BR,IAAqBiC,MAAK,SAAArC,GAAM,OAAIA,EAAOsC,aAG3CnC,IAAiBkC,MAAK,SAAArC,GAAM,OAAIA,EAAOsC","file":"main-zone-cru.7bb4cc890314266a8afa.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 * HeaderBanner\n */\nconst getHeaderBanner = () => {\n return import(\n /* webpackChunkName: \"header-banner\" */\n '../../../header-banner/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 * TextMedia\n */\nconst getTextMedia = () => {\n return import(\n /* webpackChunkName: \"text-media\" */\n '../../../text-media/client/js'\n );\n};\n\n/**\n * ProductCardListFilter\n */\nconst getProductCardListFilter = () => {\n return import(\n /* webpackChunkName: \"product-card-list-filter\" */\n '../../../product-card-list-filter/client/js'\n );\n};\n\n/**\n * MasonryCarousel\n */\nconst getMasonryCarousel = () => {\n return import(\n /* webpackChunkName: \"masonry-carousel\" */\n '../../../masonry-carousel/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 * CarouselBanner\n */\nconst getCarouselBanner = () => {\n return import(\n /* webpackChunkName: \"carousel-banner\" */\n '../../../carousel-banner/client/js'\n );\n};\n\n/**\n * ProductListSorter\n */\nconst getProductListSorter = () => {\n return import(\n /* webpackChunkName: \"product-list-sorter\" */\n '../../../product-list-sorter/client/js'\n );\n};\n\n/**\n * RecommendedDestinations\n */\nconst getRecommendedDestinationsRxjs = () => {\n return import(\n /* webpackChunkName: \"recommended-destinations-rxjs\" */\n '../../../recommended-destinations-rxjs/client/js'\n );\n};\n\n/**\n * AdviceCarousel\n */\nconst getAdviceCarousel = () => {\n return import(\n /* webpackChunkName: \"advice-carousel\" */\n '../../../advice-carousel/client/js'\n );\n};\n\n/**\n * CalendarOptions\n */\nconst getCalendarOptions = () => {\n return import(\n /* webpackChunkName: \"calendar-options\" */\n '../../../calendar-options/client/js'\n );\n};\n\n/**\n * SearcherCruises\n */\nconst getSearcherCruises = () => {\n return import(\n /* webpackChunkName: \"searcher-cruises\" */\n '../../../searcher-cruises/client/js'\n );\n};\n\n/**\n * SearcherCru\n */\nconst getSearcherCru = () => {\n return import(\n /* webpackChunkName: \"searcher-cru\" */\n '../../../searcher-cru/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: getNewsletterAgent,\n name: 'NewsletterAgent'\n },\n {\n loader: getMasonryCarousel,\n name: 'MasonryCarousel'\n },\n {\n loader: getTextMedia,\n name: 'TextMedia'\n },\n {\n loader: getProductCardListFilter,\n name: 'ProductCardListFilter'\n },\n {\n loader: getRecommendedDestinationsRxjs,\n name: 'RecommendedDestinationsRxjs'\n },\n {\n loader: getAdviceCarousel,\n name: 'AdviceCarousel'\n },\n {\n loader: getCarouselBanner,\n name: 'CarouselBanner'\n },\n {\n loader: getProductListSorter,\n name: 'ProductListSorter'\n },\n {\n loader: getSearcherCru,\n name: 'SearcherCru'\n },\n {\n loader: getCalendarOptions,\n name: 'CalendarOptions'\n }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\nmodule.exports = {\n resolveComponents,\n getClickToCall,\n getSearcherCruises\n};\n","/* ==========================================================================\n MainZoneCru > Client\n ========================================================================== */\n\n/* Modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst { resolveComponents, getSearcherCruises, getClickToCall } = require('./components');\n\n/**\n * MainZoneCru component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function MainZoneCru(selector = '[data-component=\"MainZoneCru\"]') {\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 .map(component => ({\n loader: component.loader,\n element: document.querySelector(`[data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n /**\n * Observer to lazy load modules based on\n * currently viewed components in the viewport\n */\n const observer = new IntersectionObserver(\n 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 },\n {\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 components.forEach(component => {\n observer.observe(component.element);\n });\n\n /* SearcherCruises */\n getSearcherCruises().then(module => module.default());\n\n /* ClickToCall */\n getClickToCall().then(module => module.default());\n }\n};\n"],"sourceRoot":""}