{"version":3,"sources":["webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/config.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery-carousel/client/js/carousel/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/store/actions.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery-carousel/client/js/cards/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/store/reducer.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery-carousel/client/js/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery-carousel/client/js/config.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/prototype.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery-carousel/client/js/prototype.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/image/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/ship-card-gallery/client/js/gallery/index.js"],"names":["config","init","component","type","gallery","image","css","imgConfig","width","height","module","exports","Carousel","require","initCarousel","instance","panel","selector","carousel","concat","hasPagination","hasNavigation","swiper","slidesPerView","slidesPerGroup","spaceBetween","breakpoints","600","1100","1450","elementExist","RatingStars","prototype","arguments","length","undefined","configuration","Object","create","element","document","querySelector","hooks","_objectSpread","dataset","result","JSON","parse","ratingStars","DESTROY","types","DISPLAY_GALLERY","HIDE_GALLERY","actions","destroy","displayGallery","hideGallery","ShipCard","initCards","cardsEls","_toConsumableArray","querySelectorAll","cards","map","card","index","initCard","initialState","reducer","state","action","Store","fromEvent","_require3","initImage","addGallery","setupStore","this","store","setupActions","_this","dispatch","setupReactions","_this2","reactions","subscribe","unsubscribe","parentNode","removeChild","keys","forEach","key","_this3","subscriptions","items","clickImage","_this4","Image","inst","html","toNode","sanitizeObject","GalActions","GalleryTempalte","Gallery","node","_instance$config","context","template","createGallery","body","appendChild"],"mappings":";+EAOA,IAAMA,EAAS,CACXC,MAAM,EACNC,UAAW,kBACXC,KAAM,CACFC,QAAS,eACTC,MAAO,cAEXC,IAAK,CACDD,MAAO,4BAEXE,UAAW,CACPC,MAAO,IACPC,OAAQ,MAIhBC,EAAOC,QAAU,kBAAMX,I,uBClBvB,IAAMY,EAAWC,EAAQ,QA2CzBH,EAAOC,QAAU,CACbG,aAzCJ,SAAsBC,GAClB,IAAMC,EAAQD,EAGNE,EAAaF,EAAbE,SAGRD,EAAME,SAAWN,EAAS,GAADO,OAAIF,EAAQ,oCAAoC,CACrEG,eAAe,EACfC,eAAe,EACfC,OAAQ,CACJrB,MAAM,EAENsB,cAAe,EACfC,eAAgB,EAChBC,aAAc,GAGdC,YAAa,CAETC,IAAK,CACDJ,cAAe,EACfC,eAAgB,GAGpBI,KAAM,CACFL,cAAe,EACfC,eAAgB,GAGpBK,KAAM,CACFN,cAAe,EACfC,eAAgB,U,4qBCnCpC,IAAQM,EAAiBjB,EAAQ,QAAzBiB,aAEFC,EAAclB,EAAQ,QAEtBb,EAASa,EAAQ,QACjBmB,EAAYnB,EAAQ,QAM1BH,EAAOC,QAAU,WAA4F,IAAnEM,EAAQgB,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,mCAAoCG,EAAaH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GACrG,GAAIH,EAAab,GAAW,CACxB,IAAMF,EAAWsB,OAAOC,OAAON,GA+B/B,OA5BAjB,EAASwB,QAAUC,SAASC,cAAcxB,GAG1CF,EAASE,SAAWA,EAGpBF,EAAS2B,MAAQ,CACbtC,QAASW,EAASwB,QAAQE,cAAc,GAADtB,OAAIF,EAAQ,6BAIvDF,EAASf,OAAM2C,MAAA,GACR3C,KACAoC,GACC,WACA,IAAKrB,EAASwB,QAAQK,QAAQ5C,OAAQ,MAAO,GAE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,QAAtB6C,UAGF1B,EAAY,CACd/B,KAAI,WACA,OAAK4E,KAAK7E,OAAOC,MAGjByD,EAAUmB,MAGV/D,EAAa+D,MAENA,MARuBA,OAatCnE,EAAOC,QAAUqB,G,+BCpBjB,IAAMiE,EAAQpF,EAAQ,QAEhBb,EAASa,EAAQ,QAYvBH,EAAOC,QAAU,CACb+D,UAVJ,SAAmB3D,GACf,IAAMmF,EAAOnF,EACLE,EAAaF,EAAbE,SACAZ,EAAUL,IAASG,KAAnBE,MAER6F,EAAK7F,MAAQ4F,EAAM,GAAD9E,OAAIF,EAAQ,6CAAAE,OAA4Cd,EAAK,U,0qBCVnF,IAAQ8F,EAAStF,EAAQ,QAAjBsF,KACAC,EAAWvF,EAAQ,QAAnBuF,OACAC,EAAmBxF,EAAQ,QAA3BwF,eAEFC,EAAazF,EAAQ,QACrB0F,EAAkB1F,EAAQ,QAC1B2F,EAAU3F,EAAQ,QA0CxBH,EAAOC,QAAU,CACbgE,WAzBJ,SAAoB5D,GAChB,IAAMC,EAAQD,EAGR0F,EAnBV,SAAuB1F,GAEnB,IAAA2F,EAA2B3F,EAASf,OAA5B8F,EAAKY,EAALZ,MAAOa,EAAOD,EAAPC,QAGTC,EAAWT,EAAKI,EAAgBF,EAAe,CAAEP,UAAUa,IAMjE,OAHaP,EAAOQ,GAAU,GAWjBC,CAAc9F,GAG3ByB,SAASsE,KAAKC,YAAYN,GAG1BzF,EAAMZ,QAAUoG,IAGhBxF,EAAMoE,UAASzC,IAAA,GACR3B,EAAMoE,WAAS,IAClB5B,YAAaxC,EAAMZ,QAAQ0E,MAAMO,WAAU,SAAChB,EAAOC,GAC3CA,EAAOnE,OAASmG,EAAWpD,MAAMD,iBAC9BjC,EAAMZ,QACbW,EAASsC,QAAQG","file":"ship-card-gallery-carousel.d87046c2a658fe2d7a6a.bundle.js","sourcesContent":["/* ==========================================================================\n ShipCardGallery > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n init: true,\n component: 'ShipCardGallery',\n type: {\n gallery: 'ship-gallery',\n image: 'ship-image'\n },\n css: {\n image: 'ship-card-gallery__image'\n },\n imgConfig: {\n width: 467,\n height: 250\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n ShipCardGalleryCarousel > Client > Carousel\n ========================================================================== */\n\n/* Modules */\nconst Carousel = require('@bluekiri/alexandria-contrib-components/components/carousel-rxjs/client/js');\n\n/* Init */\nfunction initCarousel(instance) {\n const panel = instance;\n\n /* Selector */\n const { selector } = instance;\n\n /* Reference */\n panel.carousel = Carousel(`${selector} [data-component=\"CarouselRxjs\"]`, {\n hasPagination: true,\n hasNavigation: true,\n swiper: {\n init: true,\n // Default parameters\n slidesPerView: 3,\n slidesPerGroup: 3,\n spaceBetween: 12,\n\n // Responsive breakpoints\n breakpoints: {\n // when window width is <= 600px\n 600: {\n slidesPerView: 1,\n slidesPerGroup: 1\n },\n // when window width is <= 1100px\n 1100: {\n slidesPerView: 2,\n slidesPerGroup: 2\n },\n // when window width is <= 1450px\n 1450: {\n slidesPerView: 3,\n slidesPerGroup: 3\n }\n }\n }\n });\n}\n\n/* Exports */\nmodule.exports = {\n initCarousel\n};\n","/* ==========================================================================\n ShipCardGallery > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst RatingStars = require('../../../rating-stars/client/js');\n\nconst config = require('./config');\nconst prototype = require('./prototype');\n\n/**\n * ShipCardGallery component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function ShipCardGallery(selector = '[data-component=ShipCardGallery]', configuration = {}) {\n if (elementExist(selector)) {\n const instance = Object.create(prototype);\n\n /* Element */\n instance.element = document.querySelector(selector);\n\n /* Selector */\n instance.selector = selector;\n\n /* Hooks */\n instance.hooks = {\n gallery: instance.element.querySelector(`${selector} [data-trigger-gallery]`)\n };\n\n /* Config */\n instance.config = {\n ...config(),\n ...configuration,\n ...(function getConfig() {\n if (!instance.element.dataset.config) return '';\n\n const result = JSON.parse(instance.element.dataset.config);\n instance.element.dataset.config = '';\n return result;\n })()\n };\n\n instance.ratingStars = RatingStars(`${selector} [data-component='RatingStars']`);\n\n /* Init */\n if (instance.config.init) instance.init();\n\n return instance;\n }\n};\n","/* ==========================================================================\n ShipCardGallery > Client > Store > Actions\n ========================================================================== */\n\n/* Types */\nconst DESTROY = 'SHIP_CARD_GALLERY::DESTROY';\n\nconst DISPLAY_GALLERY = 'SHIP_CARD_GALLERY::DISPLAY_GALLERY';\nconst HIDE_GALLERY = 'SHIP_CARD_GALLERY::HIDE_GALLERY';\n\n/* Actions */\nconst destroy = () => ({ type: DESTROY });\nconst displayGallery = () => ({ type: DISPLAY_GALLERY });\nconst hideGallery = () => ({ type: HIDE_GALLERY });\n\n/* Exports */\nmodule.exports = {\n types: {\n DESTROY,\n DISPLAY_GALLERY,\n HIDE_GALLERY\n },\n actions: {\n destroy,\n displayGallery,\n hideGallery\n }\n};\n","/* ==========================================================================\n ShipCardGalleryCarousel > Client > Cards\n ========================================================================== */\n\n/* Modules */\nconst ShipCard = require('../../../../ship-card-gallery/client/js');\n\nconst configuration = require('../config');\n\nconst initCard = (selector, index) => {\n return ShipCard(\n `${selector} [data-component=\"ShipCardGallery\"][data-type=\"${configuration().type.card}-${index}\"]`\n );\n};\n\n/* Init */\nfunction initCards(instance) {\n const panel = instance;\n\n /* Selector */\n const { selector } = instance;\n\n /* Cards El */\n const cardsEls = [...instance.element.querySelectorAll(`${selector} [data-component=\"ShipCardGallery\"]`)];\n\n /* Reference */\n panel.cards = cardsEls.map((card, index) => initCard(selector, index));\n}\n\n/* Exports */\nmodule.exports = {\n initCards\n};\n","/* ==========================================================================\n ShipCardGallery > Client > Store > Reducer\n ========================================================================== */\n\n/* Modules */\nconst { types } = require('./actions');\n\n/* Initial state */\nconst initialState = {\n gallery: false\n};\n\n/* Reducer */\nfunction reducer(state = initialState, action) {\n switch (action.type) {\n case types.DESTROY:\n return null;\n case types.DISPLAY_GALLERY:\n return {\n ...state,\n gallery: true\n };\n case types.HIDE_GALLERY:\n return {\n ...state,\n gallery: false\n };\n default:\n return state;\n }\n}\n\n/* Exports */\nmodule.exports = {\n reducer\n};\n","/* ==========================================================================\n ShipCardGalleryCarousel > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst prototype = require('./prototype');\n\nconst config = require('./config');\n\n/**\n * ShipCardGalleryCarousel component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function ShipCardGalleryCarousel(\n selector = '[data-component=ShipCardGalleryCarousel]',\n configuration = {}\n) {\n if (elementExist(selector)) {\n /* Instance */\n const instance = Object.create(prototype);\n\n /* Selector */\n instance.selector = selector;\n\n /* Element */\n instance.element = document.querySelector(selector);\n\n /* Config */\n instance.config = {\n ...config(),\n ...configuration,\n ...(function getConfig() {\n if (!instance.element.dataset.config) return '';\n\n const result = JSON.parse(instance.element.dataset.config);\n instance.element.dataset.config = '';\n return result;\n })()\n };\n\n /* Init */\n instance.init();\n\n /* Return */\n return instance;\n }\n};\n","/* ==========================================================================\n ShipCardGalleryCarousel > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'ShipCardGalleryCarousel',\n init: true,\n type: {\n card: 'ship-card'\n }\n};\n\nmodule.exports = () => config;\n","/* ==========================================================================\n ShipCardGallery > Client > Prototype\n ========================================================================= */\n\n/* Modules */\nconst { Store } = require('@bluekiri/alexandria/helpers/state');\n\nconst { fromEvent } = require('rxjs');\n\nconst { actions, types } = require('./store/actions');\nconst { reducer } = require('./store/reducer');\n\nconst { initImage } = require('./image');\nconst { addGallery } = require('./gallery');\n\nconst prototype = {\n /* Setup store */\n setupStore() {\n if (this.store) return this;\n\n this.store = new Store({\n card: reducer\n });\n\n return this;\n },\n /* Setup actions */\n setupActions() {\n if (this.actions) return this;\n\n this.actions = {\n destroy: () => {\n return this.store.dispatch(actions.destroy());\n },\n displayGallery: () => {\n return this.store.dispatch(actions.displayGallery());\n },\n hideGallery: () => {\n return this.store.dispatch(actions.hideGallery());\n }\n };\n\n return this;\n },\n /* Setup reactions */\n setupReactions() {\n if (this.reactions) return this;\n\n this.reactions = {\n destroy: this.store.subscribe((state, action) => {\n if (action.type !== types.DESTROY) return;\n\n /* Unsubscribe */\n this.unsubscribe();\n\n /* Remove from DOM */\n this.element.parentNode.removeChild(this.element);\n\n /* Clean instance */\n [...Object.keys(this)].forEach(key => delete this[key]);\n }),\n displayGallery: this.store.subscribe((state, action) => {\n if (action.type !== types.DISPLAY_GALLERY) return;\n\n /* Add gallery */\n addGallery(this);\n })\n };\n\n return this;\n },\n /* Subscribe */\n subscribe() {\n if (this.subscriptions) this.unsubscribe();\n\n this.subscriptions = {};\n\n if (this.config.items.length) {\n this.subscriptions = {\n ...this.subscriptions,\n clickImage: fromEvent(this.hooks.gallery, 'click').subscribe(() => {\n this.actions.displayGallery();\n })\n };\n }\n\n return this;\n },\n /* Unsubscribe */\n unsubscribe() {\n if (!this.subscriptions) return this;\n\n [...Object.keys(this.subscriptions)].forEach(key => this.subscriptions[key].unsubscribe());\n\n return this;\n },\n /* Init */\n init() {\n /* Setup store */\n this.setupStore();\n\n /* Setup actions */\n this.setupActions();\n\n /* Setup reactions */\n this.setupReactions();\n\n /* Init images */\n initImage(this);\n\n /* Subscribe */\n this.subscribe();\n }\n};\n\n// Exports\nmodule.exports = prototype;\n","/* ==========================================================================\n ShipCardGalleryCarousel > Client > Prototype\n ========================================================================== */\n\n/* Modules */\n\nconst { initCarousel } = require('./carousel');\nconst { initCards } = require('./cards');\n\n/* Prototype */\nconst prototype = {\n init() {\n if (!this.config.init) return this;\n\n /* Cards */\n initCards(this);\n\n /* Carousel */\n initCarousel(this);\n\n return this;\n }\n};\n\n/* Exports */\nmodule.exports = prototype;\n","/* ==========================================================================\n ShipCardGallery > Client > Image\n ========================================================================= */\n\n/* Import modules */\nconst Image = require('@bluekiri/alexandria-contrib-components/components/image-rxjs/client/js');\n\nconst config = require('../config');\n\n/* Init images */\nfunction initImage(instance) {\n const inst = instance;\n const { selector } = instance;\n const { image } = config().type;\n\n inst.image = Image(`${selector} [data-component=\"ImageRxjs\"][data-type=\"${image}\"]`);\n}\n\n/* Module exports */\nmodule.exports = {\n initImage\n};\n","/* ==========================================================================\n ShipCardGallery > Client > Gallery\n ========================================================================== */\n\n/* Modules */\nconst { html } = require('common-tags');\nconst { toNode } = require('@bluekiri/alexandria/helpers/domHelpers');\nconst { sanitizeObject } = require('@bluekiri/alexandria/helpers/sanitize');\n\nconst GalActions = require('@bluekiri/alexandria-contrib-components/components/gallery-rxjs/client/js/store/actions');\nconst GalleryTempalte = require('@bluekiri/alexandria-contrib-components/components/gallery-rxjs/template');\nconst Gallery = require('@bluekiri/alexandria-contrib-components/components/gallery-rxjs/client/js');\n\n/* Create gallery */\nfunction createGallery(instance) {\n /* Data */\n const { items, context } = instance.config;\n\n /* Template */\n const template = html(GalleryTempalte(sanitizeObject({ items }), context));\n\n /* Node */\n const node = toNode(template)[0];\n\n /* Return */\n return node;\n}\n\n/* Add gallery */\nfunction addGallery(instance) {\n const panel = instance;\n\n /* Node */\n const node = createGallery(instance);\n\n /* Add to DOM */\n document.body.appendChild(node);\n\n /* Update reference */\n panel.gallery = Gallery();\n\n /* Update */\n panel.reactions = {\n ...panel.reactions,\n hideGallery: panel.gallery.store.subscribe((state, action) => {\n if (action.type !== GalActions.types.DESTROY) return;\n delete panel.gallery;\n instance.actions.hideGallery();\n })\n };\n}\n\n/* Exports */\nmodule.exports = {\n addGallery\n};\n"],"sourceRoot":""}