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,KAAKF,SAASQ,KAAKN,KAAKC,KAAKP,gBAAgBqB,GAAG,SAAS,IAAMf,KAAKmB,SAGpEnB,KAAKC,KAAKN,oBAAqB,CAC/B,MAAMyB,UAAYpB,KAAKF,SAASQ,KAAKN,KAAKC,KAAKN,qBACzC0B,cAAgBD,UAAUE,OAEhCtB,KAAKK,cAAcU,GAAG,wBAAyBQ,GAAMvB,KAAKoB,UAAUG,EAAGH,UAAWC,gBACtF,CACJ,CAEAH,WACIlB,KAAKK,cAAcY,QAAQ,oBAC/B,CAEAE,OACInB,KAAKK,cAAcY,QAAQ,oBAC/B,CAEAG,UAAUG,EAAGH,UAAWE,MACpB,IAAIE,YAAcF,KAClBE,YAAcA,YAAYC,QAAQ,sBAAuBF,EAAEG,KAAKC,MAAQ,GACxEH,YAAcA,YAAYC,QAAQ,oBAAqBF,EAAEK,KAAKC,OAE9DT,UAAUE,KAAKE,YACnB,EASF,aAEa,CAAEd,KARJ,CAACoB,KAAM/B,UAChB+B,KAAKC,SAASjC,WACVA,SAASA,SAAW,IAAIF,SAASE,SAAUC,OAAO,IAGtDiC,WAAAA,QAAUC,UAAU,gBAAiB,CAAEC,QAAS,wBAAyB,GAGtD,wB","sources":["webpack://seges/./Seges.Website/scripts/core/components/carousel/index.js"],"sourcesContent":["import $ from 'jquery';\r\nimport 'owl.carousel/src/js/owl.carousel';\r\nimport 'owl.carousel/src/js/owl.autoplay';\r\nimport 'owl.carousel/src/js/owl.navigation';\r\nimport 'owl.carousel/src/js/owl.support';\r\nimport analytics from '../../analytics';\r\n\r\nconst defaults = {\r\n margin: 20,\r\n autoWidth: true,\r\n loop: document.documentElement.clientWidth < 1024 ? false : true, // Enable looping only for desktop\r\n dots: true, // Needed to show page no.\r\n video: true,\r\n refreshClass: 'carousel-refresh',\r\n loadedClass: 'carousel-loaded',\r\n loadingClass: 'carousel-loading',\r\n rtlClass: 'carousel-rtl',\r\n responsiveClass: 'carousel-responsive',\r\n dragClass: 'carousel-drag',\r\n itemClass: 'carousel-item',\r\n stageClass: 'carousel-stage',\r\n stageOuterClass: 'carousel-stage-outer',\r\n grabClass: 'carousel-grab',\r\n carouselEventClass: '.js-carousel-items',\r\n carouselNavigationClass: '.js-carousel-nav',\r\n prevEventClass: null,\r\n nextEventClass: null,\r\n indicatorEventClass: null\r\n};\r\n\r\nclass Carousel {\r\n constructor(carousel, option) {\r\n this.opts = Object.assign({}, defaults, option);\r\n this.carousel = $(carousel);\r\n this.carouselItems = this.carousel.find(this.opts.carouselEventClass);\r\n\r\n // Extend from data attributes\r\n this.opts = Object.assign({}, this.opts, this.carousel.data('carousel'));\r\n\r\n // Don't initialize if option is set\r\n if (this.carouselItems[0].children.length <= 1 || this.opts.init === false) {\r\n this.carouselItems.addClass(this.opts.loadedClass);\r\n this.carousel.find(this.opts.carouselNavigationClass).hide();\r\n return;\r\n }\r\n\r\n this.eventProxy();\r\n\r\n this.carouselItems.owlCarousel(this.opts);\r\n }\r\n\r\n eventProxy() {\r\n this.carouselItems.on('initialized.owl.carousel', () => {\r\n this.carousel.addClass(this.opts.loadedClass);\r\n\r\n setTimeout(() => {\r\n this.carouselItems.trigger('refresh.owl.carousel'); // items aligning bug fix\r\n }, 100);\r\n });\r\n\r\n if (this.opts.prevEventClass) {\r\n this.carousel.find(this.opts.prevEventClass).on('click', () => this.previous());\r\n }\r\n\r\n if (this.opts.nextEventClass) {\r\n this.carousel.find(this.opts.nextEventClass).on('click', () => this.next());\r\n }\r\n\r\n if (this.opts.indicatorEventClass) {\r\n const indicator = this.carousel.find(this.opts.indicatorEventClass);\r\n const indicatorText = indicator.text();\r\n\r\n this.carouselItems.on('changed.owl.carousel', (e) => this.indicator(e, indicator, indicatorText));\r\n }\r\n }\r\n\r\n previous() {\r\n this.carouselItems.trigger('prev.owl.carousel');\r\n }\r\n\r\n next() {\r\n this.carouselItems.trigger('next.owl.carousel');\r\n }\r\n\r\n indicator(e, indicator, text) {\r\n let textUpdated = text;\r\n textUpdated = textUpdated.replace('{{carouselCurrent}}', e.page.index + 1);\r\n textUpdated = textUpdated.replace('{{carouselTotal}}', e.item.count);\r\n\r\n indicator.text(textUpdated);\r\n }\r\n}\r\n\r\nconst init = (elms, option) => {\r\n elms.forEach((carousel) => {\r\n carousel.carousel = new Carousel(carousel, option);\r\n });\r\n\r\n analytics.broadcast('carousel.init', { message: 'carousel initialized' });\r\n};\r\n\r\nexport default { init };\r\n"],"names":["defaults","margin","autoWidth","loop","document","documentElement","clientWidth","dots","video","refreshClass","loadedClass","loadingClass","rtlClass","responsiveClass","dragClass","itemClass","stageClass","stageOuterClass","grabClass","carouselEventClass","carouselNavigationClass","prevEventClass","nextEventClass","indicatorEventClass","Carousel","constructor","carousel","option","this","opts","Object","assign","$","carouselItems","find","data","children","length","init","addClass","hide","eventProxy","owlCarousel","on","setTimeout","trigger","previous","next","indicator","indicatorText","text","e","textUpdated","replace","page","index","item","count","elms","forEach","analytics","broadcast","message"],"sourceRoot":""}