OwlCyberSecurity - MANAGER
Edit File: n-carousel.min.js
!function(e,t){"use strict";class i extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{swiperContainer:`.swiper-container-${this.getID()}`,swiperWrapper:`.swiper-wrapper-${this.getID()}`,slideContent:".swiper-slide",swiperArrow:`.lakit-carousel__prev-arrow-${this.getID()}`,paginationBullet:".swiper-pagination-bullet",paginationBulletWrapper:`.lakit-carousel__dots_${this.getID()}`}}}getDefaultElements(){const e=this.getSettings("selectors"),t={$swiperContainer:this.$element.find(e.swiperContainer),$swiperWrapper:this.$element.find(e.swiperWrapper),$swiperArrows:this.$element.find(e.swiperArrow),$paginationBullets:this.$element.find(e.paginationBullet),$paginationBulletWrapper:this.$element.find(e.paginationBulletWrapper),$carousel:this.$element.find(".lakit-carousel").first()};return t.$slides=t.$swiperContainer.find(e.slideContent),t}wrapSlideContent(){if(!t.isEditMode())return;const e=this.getSettings(),i=e.selectors.slideContent.replace(".",""),s=this.$element;let n=1;this.findElement(`${e.selectors.swiperWrapper} > .e-con`).each((function(){const t=jQuery(this),r=t.closest("div").hasClass(i),o=s.find(`${e.selectors.swiperWrapper} > .${i}:nth-child(${n})`);r||o.append(t),n++}))}async initSwiper(){const t=this.$element;await LaStudioKits.initCarousel(t);const i=this.getSettings(),s=e(i.selectors.swiperContainer);this.swiper=s.data("swiper")}async onInit(){this.wrapSlideContent(),super.onInit(...arguments),await this.initSwiper()}onEditSettingsChange(e){"activeItemIndex"===e&&(this.swiper.destroyed||this.swiper.slideToLoop(this.getEditSettings("activeItemIndex")-1))}updateListeners(){this.swiper.destroyed||(this.swiper.initialized=!1,this.swiper.init())}async linkContainer(e){const{container:t,index:i,targetContainer:s,action:{type:n}}=e.detail,r=t.view.$el;if(t.model.get("id")===this.$element.data("id")){const{$slides:e}=this.getDefaultElements();let t,o;switch(n){case"move":[t,o]=this.move(r,i,s,e);break;case"duplicate":[t,o]=this.duplicate(r,i,s,e)}void 0!==t&&t.appendChild(o),this.updateIndexValues(e);const a=this.swiper&&!this.swiper.destroyed,l=e.length>1;!a&&l?await this.initSwiper():a&&!l&&this.destroySwiper(),this.updateListeners()}}move(e,t,i,s){return[s[t],i.view.$el[0]]}duplicate(e,t,i,s){return[s[t+1],i.view.$el[0]]}updateIndexValues(e){e.each(((e,t)=>{const i=e+1;t.setAttribute("data-slide",i)}))}bindEvents(){super.bindEvents(),t.elements.$window.on("elementor/nested-container/atomic-repeater",this.linkContainer.bind(this))}getResponsiveValue(e,i){const s=Object.keys(t.config.responsive.activeBreakpoints);return s.push("desktop"),s.reduce((function(s,n){return s[n]=t.getDeviceSetting(n,i,e),s}),{})}destroySwiper(){this.elements.$carousel.removeClass("inited"),this.elements.$swiperWrapper.removeAttr("aria-live"),this.swiper.destroy(!0)}async onElementChange(e){if(e.startsWith("carousel_columns")||e.startsWith("carousel_to_scroll")||e.startsWith("carousel_rows")){const e=this.getElementSettings(),t=this.getResponsiveValue("carousel_columns",e),i=this.getResponsiveValue("carousel_to_scroll",e),s=this.getResponsiveValue("carousel_rows",e),n=this.getResponsiveValue("carousel_direction",e);const r={...this.elements.$carousel.data("slider_options"),slidesToScroll:i,slidesToShow:t,rows:s,directionbkp:n};this.elements.$carousel.data("slider_options",r),this.destroySwiper(),await this.initSwiper()}}}e(window).on("elementor/frontend/init",(()=>{t.hooks.addAction("frontend/element_ready/lakit-nested-carousel.default",(e=>{t.elementsHandler.addHandler(i,{$element:e})}))}))}(jQuery,window.elementorFrontend);