@innovastudio/contentbox-runtime-base 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3501,8 +3501,8 @@ class Yi {
|
|
|
3501
3501
|
}
|
|
3502
3502
|
n.preventDefault(), n.stopImmediatePropagation();
|
|
3503
3503
|
});
|
|
3504
|
-
}), t && (t.classList.contains("is-edit") || t.querySelectorAll("a").forEach(
|
|
3505
|
-
n.addEventListener("click",
|
|
3504
|
+
}), t && (t.classList.contains("is-edit") || t.querySelectorAll("a").forEach((n) => {
|
|
3505
|
+
n.addEventListener("click", (h) => {
|
|
3506
3506
|
let d = n.getAttribute("href");
|
|
3507
3507
|
if (d && d.indexOf("#") === 0)
|
|
3508
3508
|
if (d.indexOf("#section") === 0) {
|
|
@@ -3511,12 +3511,12 @@ class Yi {
|
|
|
3511
3511
|
let p = document.querySelectorAll(".is-section"), b, C = 0;
|
|
3512
3512
|
p.forEach(function(k) {
|
|
3513
3513
|
k.classList.contains("is-section-navbar") || (C === u - 1 && (b = k), C++);
|
|
3514
|
-
}), b && scrollIt(b, 1e3, "easeInQuad"), h.preventDefault();
|
|
3514
|
+
}), b && this.scrollIt(b, 1e3, "easeInQuad"), h.preventDefault();
|
|
3515
3515
|
}
|
|
3516
3516
|
} else
|
|
3517
3517
|
try {
|
|
3518
3518
|
let u = document.querySelector(d);
|
|
3519
|
-
u && (scrollIt(u, 1e3, "easeInQuad"), h.preventDefault());
|
|
3519
|
+
u && (this.scrollIt(u, 1e3, "easeInQuad"), h.preventDefault());
|
|
3520
3520
|
} catch {
|
|
3521
3521
|
}
|
|
3522
3522
|
});
|
|
@@ -3565,7 +3565,7 @@ class Yi {
|
|
|
3565
3565
|
window.scrollTo({ top: s, behavior: "smooth" });
|
|
3566
3566
|
}
|
|
3567
3567
|
scrollIt(t, i = 200, s = "linear", e) {
|
|
3568
|
-
_scrollTo(t);
|
|
3568
|
+
this._scrollTo(t);
|
|
3569
3569
|
}
|
|
3570
3570
|
skrollrSetup() {
|
|
3571
3571
|
document.querySelectorAll(".pin-wrap").forEach((n) => {
|
|
@@ -45,4 +45,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
<button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
|
|
46
46
|
<button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
|
|
47
47
|
</div>
|
|
48
|
-
</div>`;class Ze{constructor(t={}){this.customOptions=t,this.settings=$t(ke,t),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}init(){const t=this.getSelector();t&&(this.baseEvents=Xt("click",{onElement:t,withCallback:(i,s)=>{i.preventDefault(),this.open(s)}})),this.elements=this.getElements()}open(t=null,i=null){if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;let s=re(i)?i:this.settings.startAt;if(Rt(t)){const n=t.getAttribute("data-gallery");n&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,n)),zt(s)&&(s=this.getElementIndex(t),s<0&&(s=0))}re(s)||(s=0),this.build(),Qt(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);const e=document.body,a=window.innerWidth-document.documentElement.clientWidth;if(a>0){var r=document.createElement("style");r.type="text/css",r.className="gcss-styles",r.innerText=`.gscrollbar-fixer {margin-right: ${a}px}`,document.head.appendChild(r),Y(e,"gscrollbar-fixer")}Y(e,"glightbox-open"),Y(Le,"glightbox-open"),Fe&&(Y(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(s,!0),this.elements.length===1?(Y(this.prevButton,"glightbox-button-hidden"),Y(this.nextButton,"glightbox-button-hidden")):(ft(this.prevButton,"glightbox-button-hidden"),ft(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),D(this.settings.onOpen)&&this.settings.onOpen(),Ue&&this.settings.touchNavigation&&xi(this),this.settings.keyboardNavigation&&gi(this)}openAt(t=0){this.open(null,t)}showSlide(t=0,i=!1){De(this.loader),this.index=parseInt(t);let s=this.slidesContainer.querySelector(".current");s&&ft(s,"current"),this.slideAnimateOut();let e=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(e,"loaded"))this.slideAnimateIn(e,i),Ee(this.loader);else{De(this.loader);const a=this.elements[t],r={index:this.index,slide:e,slideNode:e,slideConfig:a.slideConfig,slideIndex:this.index,trigger:a.node,player:null};this.trigger("slide_before_load",r),a.instance.setContent(e,()=>{Ee(this.loader),this.resize(),this.slideAnimateIn(e,i),this.trigger("slide_after_load",r)})}this.slideDescription=e.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&_t(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(t+1),this.preloadSlide(t-1)),this.updateNavigationClasses(),this.activeSlide=e}preloadSlide(t){if(t<0||t>this.elements.length-1||zt(this.elements[t]))return!1;let i=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(i,"loaded"))return!1;const s=this.elements[t],e=s.type,a={index:t,slide:i,slideNode:i,slideConfig:s.slideConfig,slideIndex:t,trigger:s.node,player:null};this.trigger("slide_before_load",a),e==="video"||e==="external"?setTimeout(()=>{s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})},200):s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})}prevSlide(){this.goToSlide(this.index-1)}nextSlide(){this.goToSlide(this.index+1)}goToSlide(t=!1){if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(t<0||t>this.elements.length-1))return!1;t<0?t=this.elements.length-1:t>=this.elements.length&&(t=0),this.showSlide(t)}insertSlide(t={},i=-1){i<0&&(i=this.elements.length);const s=new le(t,this,i),e=s.getConfig(),a=$t({},e),r=s.create(),n=this.elements.length-1;a.index=i,a.node=!1,a.instance=s,a.slideConfig=e,this.elements.splice(i,0,a);let h=null,d=null;if(this.slidesContainer){if(i>n)this.slidesContainer.appendChild(r);else{let u=this.slidesContainer.querySelectorAll(".gslide")[i];this.slidesContainer.insertBefore(r,u)}(this.settings.preload&&this.index==0&&i==0||this.index-1==i||this.index+1==i)&&this.preloadSlide(i),this.index===0&&i===0&&(this.index=1),this.updateNavigationClasses(),h=this.slidesContainer.querySelectorAll(".gslide")[i],d=this.getSlidePlayerInstance(i),a.slideNode=h}this.trigger("slide_inserted",{index:i,slide:h,slideNode:h,slideConfig:e,slideIndex:i,trigger:null,player:d}),D(this.settings.slideInserted)&&this.settings.slideInserted({index:i,slide:h,player:d})}removeSlide(t=-1){if(t<0||t>this.elements.length-1)return!1;const i=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[t];i&&(this.getActiveSlideIndex()==t&&(t==this.elements.length-1?this.prevSlide():this.nextSlide()),i.parentNode.removeChild(i)),this.elements.splice(t,1),this.trigger("slide_removed",t),D(this.settings.slideRemoved)&&this.settings.slideRemoved(t)}slideAnimateIn(t,i){let s=t.querySelector(".gslide-media"),e=t.querySelector(".gslide-description"),a={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},r={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(s.offsetWidth>0&&e&&(Ee(e),e.style.display=""),ft(t,this.effectsClasses),i)Qt(t,this.settings.cssEfects[this.settings.openEffect].in,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])});else{let n=this.settings.slideEffect,h=n!=="none"?this.settings.cssEfects[n].in:n;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(h=this.settings.cssEfects.slideBack.in),Qt(t,h,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])})}setTimeout(()=>{this.resize(t)},100),Y(t,"current")}slideAnimateOut(){if(!this.prevActiveSlide)return!1;let t=this.prevActiveSlide;ft(t,this.effectsClasses),Y(t,"prev");let i=this.settings.slideEffect,s=i!=="none"?this.settings.cssEfects[i].out:i;this.slidePlayerPause(t),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),D(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(s=this.settings.cssEfects.slideBack.out),Qt(t,s,()=>{let e=t.querySelector(".ginner-container"),a=t.querySelector(".gslide-media"),r=t.querySelector(".gslide-description");e.style.transform="",a.style.transform="",ft(a,"greset"),a.style.opacity="",r&&(r.style.opacity=""),ft(t,"prev")})}getAllPlayers(){return this.videoPlayers}getSlidePlayerInstance(t){const i="gvideo"+t,s=this.getAllPlayers();return gt(s,i)&&s[i]?s[i]:!1}stopSlideVideo(t){if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}slidePlayerPause(t){if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}playSlideVideo(t){if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");const i=this.getSlidePlayerInstance(t);i&&!i.playing&&i.play()}slidePlayerPlay(t){if(Fe&&!this.settings.plyr.config?.muted)return;if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&!i.playing&&(i.play(),this.settings.autofocusVideos&&i.elements.container.focus())}setElements(t){this.settings.elements=!1;const i=[];t&&t.length&&J(t,(s,e)=>{const a=new le(s,this,e),r=a.getConfig(),n=$t({},r);n.slideConfig=r,n.instance=a,n.index=e,i.push(n)}),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(J(this.elements,()=>{let s=Ft(this.settings.slideHTML);this.slidesContainer.appendChild(s)}),this.showSlide(0,!0)))}getElementIndex(t){let i=!1;return J(this.elements,(s,e)=>{if(gt(s,"node")&&s.node==t)return i=e,!0}),i}getElements(){let t=[];this.elements=this.elements?this.elements:[],!zt(this.settings.elements)&&Xe(this.settings.elements)&&this.settings.elements.length&&J(this.settings.elements,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=$t({},n);h.node=!1,h.index=a,h.instance=r,h.slideConfig=n,t.push(h)});let i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i&&J(i,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=$t({},n);h.node=e,h.index=a,h.instance=r,h.slideConfig=n,h.gallery=e.getAttribute("data-gallery"),t.push(h)}),t}getGalleryElements(t,i){return t.filter(s=>s.gallery==i)}getSelector(){return this.settings.elements?!1:this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?`*[${this.settings.selector}]`:this.settings.selector}getActiveSlide(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}getActiveSlideIndex(){return this.index}getAnimationClasses(){let t=[];for(let i in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(i)){let s=this.settings.cssEfects[i];t.push(`g${s.in}`),t.push(`g${s.out}`)}return t.join(" ")}build(){if(this.built)return!1;const t=document.body.childNodes,i=[];J(t,d=>{d.parentNode==document.body&&d.nodeName.charAt(0)!=="#"&&d.hasAttribute&&!d.hasAttribute("aria-hidden")&&(i.push(d),d.setAttribute("aria-hidden","true"))});const s=gt(this.settings.svg,"next")?this.settings.svg.next:"",e=gt(this.settings.svg,"prev")?this.settings.svg.prev:"",a=gt(this.settings.svg,"close")?this.settings.svg.close:"";let r=this.settings.lightboxHTML;r=r.replace(/{nextSVG}/g,s),r=r.replace(/{prevSVG}/g,e),r=r.replace(/{closeSVG}/g,a),r=Ft(r),document.body.appendChild(r);const n=document.getElementById("glightbox-body");this.modal=n;let h=n.querySelector(".gclose");this.prevButton=n.querySelector(".gprev"),this.nextButton=n.querySelector(".gnext"),this.overlay=n.querySelector(".goverlay"),this.loader=n.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=i,this.events={},Y(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&h&&(this.events.close=Xt("click",{onElement:h,withCallback:(d,u)=>{d.preventDefault(),this.close()}})),h&&!this.settings.closeButton&&h.parentNode.removeChild(h),this.nextButton&&(this.events.next=Xt("click",{onElement:this.nextButton,withCallback:(d,u)=>{d.preventDefault(),this.nextSlide()}})),this.prevButton&&(this.events.prev=Xt("click",{onElement:this.prevButton,withCallback:(d,u)=>{d.preventDefault(),this.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=Xt("click",{onElement:n,withCallback:(d,u)=>{!this.preventOutsideClick&&!_t(document.body,"glightbox-mobile")&&!Wt(d.target,".ginner-container")&&!Wt(d.target,".gbtn")&&!_t(d.target,"gnext")&&!_t(d.target,"gprev")&&this.close()}})),J(this.elements,(d,u)=>{this.slidesContainer.appendChild(d.instance.create()),d.slideNode=this.slidesContainer.querySelectorAll(".gslide")[u]}),Ue&&Y(document.body,"glightbox-touch"),this.events.resize=Xt("resize",{onElement:window,withCallback:()=>{this.resize()}}),this.built=!0}resize(t=null){if(t=t||this.activeSlide,!t||_t(t,"zoomed"))return;const i=ze(),s=t.querySelector(".gvideo-wrapper"),e=t.querySelector(".gslide-image"),a=this.slideDescription;let r=i.width,n=i.height;if(r<=768?Y(document.body,"glightbox-mobile"):ft(document.body,"glightbox-mobile"),!s&&!e)return;let h=!1;if(a&&(_t(a,"description-bottom")||_t(a,"description-top"))&&!_t(a,"gabsolute")&&(h=!0),e){if(r<=768)e.querySelector("img");else if(h){let d=a.offsetHeight,u=e.querySelector("img");const b=this.elements[this.index].node.getAttribute("data-height")??"100vh";u.setAttribute("style",`max-height: calc(${b} - ${d}px)`),a.setAttribute("style",`max-width: ${u.offsetWidth}px;`)}}if(s){let d=gt(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!d){const k=s.clientWidth,L=s.clientHeight,at=k/L;d=`${k/at}:${L/at}`}let u=d.split(":"),p=this.settings.videosWidth,b=this.settings.videosWidth;re(p)||p.indexOf("px")!==-1?b=parseInt(p):p.indexOf("vw")!==-1?b=r*parseInt(p)/100:p.indexOf("vh")!==-1?b=n*parseInt(p)/100:p.indexOf("%")!==-1?b=r*parseInt(p)/100:b=parseInt(s.clientWidth);let C=b/(parseInt(u[0])/parseInt(u[1]));if(C=Math.floor(C),h&&(n=n-a.offsetHeight),b>r||C>n||n<C&&r>b){let k=s.offsetWidth,L=s.offsetHeight,at=n/L,pt={width:k*at};s.parentNode.setAttribute("style",`max-width: ${pt.width}px`),h&&a.setAttribute("style",`max-width: ${pt.width}px;`)}else s.parentNode.style.maxWidth=`${p}`,h&&a.setAttribute("style",`max-width: ${p};`)}}reload(){this.init()}updateNavigationClasses(){const t=this.loop();ft(this.nextButton,"disabled"),ft(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(Y(this.prevButton,"disabled"),Y(this.nextButton,"disabled")):this.index===0&&!t?Y(this.prevButton,"disabled"):this.index===this.elements.length-1&&!t&&Y(this.nextButton,"disabled")}loop(){let t=gt(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return t=gt(this.settings,"loop")?this.settings.loop:t,t}close(){if(!this.lightboxOpen){if(this.events){for(let t in this.events)this.events.hasOwnProperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&J(this.bodyHiddenChildElms,t=>{t.removeAttribute("aria-hidden")}),Y(this.modal,"glightbox-closing"),Qt(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),Qt(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,()=>{if(this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null,this.built=!1,this.events){for(let s in this.events)this.events.hasOwnProperty(s)&&this.events[s].destroy();this.events=null}const t=document.body;ft(Le,"glightbox-open"),ft(t,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),this.modal.parentNode.removeChild(this.modal),this.trigger("close"),D(this.settings.onClose)&&this.settings.onClose();const i=document.querySelector(".gcss-styles");i&&i.parentNode.removeChild(i),this.lightboxOpen=!1,this.closing=null})}destroy(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}on(t,i,s=!1){if(!t||!D(i))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:t,once:s,callback:i})}once(t,i){this.on(t,i,!0)}trigger(t,i=null){const s=[];J(this.apiEvents,(e,a)=>{const{evt:r,once:n,callback:h}=e;r==t&&(h(i),n&&s.push(a))}),s.length&&J(s,e=>this.apiEvents.splice(e,1))}clearAllEvents(){this.apiEvents.splice(0,this.apiEvents.length)}version(){return ji}}class Ci{constructor(t={}){this.animationTime=t.animationTime??800,this.frameRate=t.frameRate??150,this.stepSize=t.stepSize??120,this.accelerationDelta=t.accelerationDelta??300,this.accelerationMax=t.accelerationMax??2,this.pulseScale=t.pulseScale??4,this.pulseNormalize=1,this.keyboardSupport=t.keyboardSupport??!0,this.arrowScroll=t.arrowScroll??50,this.fixedBackground=t.fixedBackground??!1,this.queue=[],this.pending=!1,this.lastScrollTime=Date.now(),this.direction={x:0,y:0},this.activeElement=null,this.deltaBuffer=[],this.deltaBufferTimer=null,this.isMac=/^Mac/.test(navigator.platform),this.scrollBehaviorCache=new WeakMap,this.pulseNormalize=1/this._pulseRaw(1),this._init()}_init(){const t="onwheel"in document.createElement("div")?"wheel":"mousewheel";window.addEventListener(t,this._onWheel.bind(this),{passive:!1}),this.keyboardSupport&&window.addEventListener("keydown",this._onKeydown.bind(this),!1),window.addEventListener("mousedown",this._onMousedown.bind(this),!1),this.fixedBackground||(document.body.style.backgroundAttachment="scroll",document.documentElement.style.backgroundAttachment="scroll")}destroy(){const t="onwheel"in document.createElement("div")?"wheel":"mousewheel";window.removeEventListener(t,this._onWheel.bind(this)),window.removeEventListener("keydown",this._onKeydown.bind(this)),window.removeEventListener("mousedown",this._onMousedown.bind(this)),this.queue=[],this.pending=!1}_onMousedown(t){this.activeElement=t.target}_onKeydown(t){const i=t.target,s=t.ctrlKey||t.altKey||t.metaKey||t.shiftKey&&t.code!=="Space",e=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(t.defaultPrevented||e.test(i.nodeName)||i.nodeName==="INPUT"&&!a.test(i.type)||i.isContentEditable||s)return!0;let r=0,n=0;const h=this._findScrollableAncestor(this.activeElement||document.activeElement);if(!h)return;const d=h===document.body?window.innerHeight:h.clientHeight;switch(t.code){case"ArrowUp":n=-this.arrowScroll;break;case"ArrowDown":n=this.arrowScroll;break;case"Space":n=-(t.shiftKey?1:-1)*d*.9;break;case"PageUp":n=-d*.9;break;case"PageDown":n=d*.9;break;case"Home":n=-h.scrollTop;break;case"End":const p=h.scrollHeight-h.scrollTop-d;n=p>0?p+10:0;break;case"ArrowLeft":r=-this.arrowScroll;break;case"ArrowRight":r=this.arrowScroll;break;default:return!0}this._enqueueScroll(h,r,n),t.preventDefault()}_onWheel(t){if(t.ctrlKey||t.defaultPrevented)return;let i=-t.wheelDeltaX||t.deltaX||0,s=-t.wheelDeltaY||t.deltaY||0;if(this.isMac&&(t.wheelDeltaX&&this._isDivisible(t.wheelDeltaX,120)&&(i=-120*(t.wheelDeltaX/Math.abs(t.wheelDeltaX))),t.wheelDeltaY&&this._isDivisible(t.wheelDeltaY,120)&&(s=-120*(t.wheelDeltaY/Math.abs(t.wheelDeltaY)))),!i&&!s&&(s=-t.wheelDelta||0),t.deltaMode===1&&(i*=40,s*=40),this._isTouchpad(s))return!0;Math.abs(i)>1.2&&(i*=this.stepSize/120),Math.abs(s)>1.2&&(s*=this.stepSize/120);const e=t.target,a=this._findScrollableAncestor(e);if(!a)return;const r=Math.sign(i),n=Math.sign(s);(r!==this.direction.x||n!==this.direction.y)&&(this.direction={x:r,y:n},this.queue=[],this.lastScrollTime=0);const h=Date.now(),d=h-this.lastScrollTime;if(d<this.accelerationDelta){const u=(1+50/d)/2;if(u>1){const p=Math.min(u,this.accelerationMax);i*=p,s*=p}}this.lastScrollTime=h,this._enqueueScroll(a,i,s),t.preventDefault()}_isDivisible(t,i){return Math.floor(t/i)===t/i}_isTouchpad(t){if(!t)return!1;this.deltaBuffer.length||(this.deltaBuffer=[t,t,t]);const i=Math.abs(t);this.deltaBuffer.push(i),this.deltaBuffer.shift(),clearTimeout(this.deltaBufferTimer),this.deltaBufferTimer=setTimeout(()=>{this.deltaBuffer=[]},1e3);const s=this.deltaBuffer.every(n=>this._isDivisible(n,120)),e=this.deltaBuffer.every(n=>this._isDivisible(n,100)),a=i>120&&this.deltaBuffer.every(n=>this._isDivisible(n,i)),r=!s&&!e&&!a;return i<50?!0:r}_findScrollableAncestor(t){const i=document.scrollingElement||document.documentElement;let s=t;for(;s&&s!==document.body;){const e=window.getComputedStyle(s),a=e.overflowY,r=e.overflowX,n=["auto","scroll"].includes(a),h=["auto","scroll"].includes(r),d=s.scrollHeight>s.clientHeight,u=s.scrollWidth>s.clientWidth;if(n&&d||h&&u)return s;if(s===i)return i;s=s.parentElement}return i}_enqueueScroll(t,i,s){if(!this.scrollBehaviorCache.has(t)){const e=window.getComputedStyle(t).scrollBehavior;e==="smooth"&&(this.scrollBehaviorCache.set(t,e),t.style.scrollBehavior="auto")}this.queue.push({element:t,x:i,y:s,lastX:i<0?.99:-.99,lastY:s<0?.99:-.99,start:Date.now()}),this.pending||(this._animate(t),this.pending=!0)}_animate(t){const i=()=>{const s=Date.now();let e=0,a=0;for(let n=this.queue.length-1;n>=0;n--){const h=this.queue[n],d=s-h.start,u=d>=this.animationTime,p=u?1:d/this.animationTime,b=this._pulse(p),C=h.x*b-h.lastX>>0,k=h.y*b-h.lastY>>0;e+=C,a+=k,h.lastX+=C,h.lastY+=k,u&&this.queue.splice(n,1)}if(t===document.scrollingElement||t===document.documentElement||t===document.body?window.scrollBy(e,a):(e&&(t.scrollLeft+=e),a&&(t.scrollTop+=a)),this.queue.length>0)requestAnimationFrame(i);else if(this.pending=!1,this.scrollBehaviorCache.has(t)){const n=this.scrollBehaviorCache.get(t);t.style.scrollBehavior=n,this.scrollBehaviorCache.delete(t)}};requestAnimationFrame(i)}_pulseRaw(t){if(t*=this.pulseScale,t<1)return t-(1-Math.exp(-t));{const i=Math.exp(-1);t-=1;const s=1-Math.exp(-t);return i+s*(1-i)}}_pulse(t){return t>=1?1:t<=0?0:this._pulseRaw(t)*this.pulseNormalize}}class Li{constructor(t={}){this.config={plugins:{},autoLoad:!0,pluginBaseUrl:"",allowExternalPlugins:!0,trustedDomains:[],...t},this.plugins=new Map,this.loadedStyles=new Set,this.components=new Map,this.externalPlugins=new Map}async autoLoadPlugins(){const i=this.detectComponentTypes().filter(s=>this.config.plugins[s]&&!this.plugins.has(s));return i.length>0&&await Promise.all(i.map(s=>this.loadPlugin(s))),i}detectComponentTypes(){const t=new Set;return document.querySelectorAll("[data-cb-type]").forEach(i=>{t.add(i.dataset.cbType)}),document.querySelectorAll('[class*="cb-"]').forEach(i=>{i.classList.forEach(s=>{if(s.startsWith("cb-")){const e=s.replace("cb-","");t.add(e)}})}),Array.from(t)}async loadPlugin(t){if(this.plugins.has(t))return this.plugins.get(t);const i=this.config.plugins[t];if(!i)return console.warn(`[PluginManager] Plugin "${t}" not found in registry`),null;try{i.css&&this.loadCSS(this.resolveUrl(i.css));const s=this.resolveUrl(i.url),e=await this.importModule(s),a=e.default||e;return this.plugins.set(t,a),typeof a.init=="function"&&await a.init(this),this.emit("plugin-loaded",{name:t,plugin:a}),a}catch(s){return console.error(`[PluginManager] Failed to load plugin "${t}":`,s),null}}async importModule(t){return import(t)}loadCSS(t){if(this.loadedStyles.has(t))return;const i=document.createElement("link");i.rel="stylesheet",i.href=t,i.onload=()=>{this.emit("css-loaded",{url:t})},i.onerror=()=>{console.error(`[PluginManager] Failed to load CSS: ${t}`)},document.head.appendChild(i),this.loadedStyles.add(t)}resolveUrl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")?t:this.config.pluginBaseUrl+t}initializeComponents(){return document.querySelectorAll("[data-cb-type]").forEach(i=>{const s=i.dataset.cbType,e=this.plugins.get(s);if(e&&typeof e.mount=="function")try{const a=this.parseOptions(i);i.hasAttribute("data-cb-original-content")||i.setAttribute("data-cb-original-content",i.innerHTML);const r=e.mount(i,a);this.components.set(i,r),i.setAttribute("data-cb-loaded","true")}catch(a){console.error(`[PluginManager] Failed to mount component "${s}":`,a)}}),this.components.size}parseOptions(t){const i={};return Array.from(t.attributes).forEach(s=>{if(s.name.startsWith("data-cb-")){const e=s.name.replace("data-cb-","").replace(/-([a-z])/g,(a,r)=>r.toUpperCase());i[e]=this.parseValue(s.value)}}),i}parseValue(t){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(t)&&t!=="")return Number(t);try{return JSON.parse(t)}catch{return t}}async use(t){return await this.loadPlugin(t)}getPlugin(t){return this.plugins.get(t)}getAllPlugins(){return Array.from(this.plugins.entries())}hasPlugin(t){return this.plugins.has(t)}getComponent(t){return this.components.get(t)}async reinitialize(t=document){if(this.reinitializeInProgress)return clearTimeout(this.pendingReinitialize),new Promise(i=>{this.pendingReinitialize=setTimeout(async()=>{this.pendingReinitialize=null;const s=await this.reinitialize(t);i(s)},100)});this.reinitializeInProgress=!0;try{const i=[];this.components.forEach((n,h)=>{(t===document||t.contains(h))&&i.push({element:h,instance:n})}),i.forEach(({element:n,instance:h})=>{const d=n.dataset.cbType,u=this.plugins.get(d);u&&typeof u.unmount=="function"&&u.unmount(n,h),this.components.delete(n)});const e=this.detectComponentTypesInContainer(t).filter(n=>this.config.plugins[n]&&!this.plugins.has(n));e.length>0&&await Promise.all(e.map(n=>this.loadPlugin(n)));const a=t.querySelectorAll("[data-cb-type]");let r=0;for(const n of a){const h=n.dataset.cbType,d=this.plugins.get(h);if(d&&typeof d.mount=="function")try{const u=this.parseOptions(n);n.hasAttribute("data-cb-original-content")?n.innerHTML=n.getAttribute("data-cb-original-content"):n.setAttribute("data-cb-original-content",n.innerHTML);const p=await d.mount(n,u);this.components.set(n,p),n.setAttribute("data-cb-loaded","true"),r++}catch(u){console.error(`[PluginManager] Failed to mount component "${h}":`,u)}}return this.emit("reinitialized",{container:t,count:r}),r}finally{this.reinitializeInProgress=!1}}detectComponentTypesInContainer(t){const i=new Set;return t.querySelectorAll("[data-cb-type]").forEach(e=>{i.add(e.dataset.cbType)}),Array.from(i)}async loadExternalPlugin(t,i){if(!t||typeof t!="string")throw new Error("Plugin ID is required and must be a string");if(!i.url)throw new Error("Plugin URL is required");if(this.plugins.has(t))return console.warn(`[PluginManager] Plugin "${t}" is already loaded`),this.plugins.get(t);const s=this.validatePluginSource(i.url);if(!s.allowed)throw new Error(`Security: ${s.reason}`);s.warning&&(console.warn(`[PluginManager] ${s.warning}`),this.emit("plugin-security-warning",{pluginId:t,url:i.url,warning:s.warning}));try{this.config.plugins[t]={url:i.url,css:i.css||null,source:"external",loadedAt:new Date().toISOString()},this.externalPlugins.set(t,this.config.plugins[t]);const e=await this.loadPlugin(t);return this.emit("external-plugin-loaded",{pluginId:t,url:i.url}),e}catch(e){throw delete this.config.plugins[t],this.externalPlugins.delete(t),console.error(`[PluginManager] Failed to load external plugin "${t}":`,e),e}}validatePluginSource(t){const i=t.includes("localhost")||t.includes("127.0.0.1");if(!t.startsWith("https://")&&!i)return{allowed:!1,reason:"Only HTTPS URLs are allowed (except localhost for development)"};if(!this.config.allowExternalPlugins)return{allowed:!1,reason:"External plugins are disabled. Enable allowExternalPlugins in configuration."};if(this.config.trustedDomains.length>0){const e=new URL(t).hostname;if(!this.config.trustedDomains.some(r=>{if(r.startsWith("*.")){const n=r.slice(2);return e===n||e.endsWith("."+n)}return e===r}))return{allowed:!0,warning:`Loading plugin from external domain: ${e}. Only add plugins from sources you trust.`}}else return{allowed:!0,warning:`Loading external plugin from: ${new URL(t).hostname}. This plugin will have full access to your page.`};return{allowed:!0}}async loadExternalPlugins(t){const i=[];for(const[s,e]of Object.entries(t))try{const a=await this.loadExternalPlugin(s,e);i.push({pluginId:s,success:!0,plugin:a})}catch(a){i.push({pluginId:s,success:!1,error:a.message}),console.error(`[PluginManager] Failed to load external plugin "${s}":`,a)}return i}unregisterPlugin(t){if(!this.externalPlugins.has(t))return console.warn(`[PluginManager] Plugin "${t}" is not an external plugin`),!1;const i=this.plugins.get(t),s=[];return this.components.forEach((e,a)=>{a.dataset.cbType===t&&s.push({element:a,instance:e})}),s.forEach(({element:e,instance:a})=>{i&&typeof i.unmount=="function"&&i.unmount(e,a),this.components.delete(e)}),i&&typeof i.destroy=="function"&&i.destroy(this),this.plugins.delete(t),this.externalPlugins.delete(t),delete this.config.plugins[t],this.emit("plugin-unregistered",{pluginId:t}),!0}getExternalPlugins(){return Array.from(this.externalPlugins.entries()).map(([t,i])=>({id:t,...i}))}isExternalPlugin(t){return this.externalPlugins.has(t)}destroy(){this.components.forEach((t,i)=>{const s=i.dataset.cbType,e=this.plugins.get(s);e&&typeof e.unmount=="function"&&e.unmount(i,t)}),this.plugins.forEach((t,i)=>{typeof t.destroy=="function"&&t.destroy(this)}),this.components.clear(),this.plugins.clear()}emit(t,i){if(this.runtime&&typeof this.runtime.emit=="function")this.runtime.emit(t,i);else{const s=new CustomEvent(`contentbox:${t}`,{detail:i});document.dispatchEvent(s)}}setRuntime(t){this.runtime=t}}class ki{constructor(t={}){const i={skin:"light",smoothScroll:!0,plugins:{},autoLoadPlugins:!0,pluginBaseUrl:"",allowExternalPlugins:!0,trustedDomains:[]};this.settings={...i,...t},this.initialized=!1,this.pluginManager=new Li({plugins:this.settings.plugins,autoLoad:this.settings.autoLoadPlugins,pluginBaseUrl:this.settings.pluginBaseUrl,allowExternalPlugins:this.settings.allowExternalPlugins,trustedDomains:this.settings.trustedDomains}),this.pluginManager.setRuntime(this),window.pageReRender=()=>{this.pageReRender()}}async use(t){return await this.pluginManager.use(t)}getPlugin(t){return this.pluginManager.getPlugin(t)}getPlugins(){return this.pluginManager.getAllPlugins()}hasPlugin(t){return this.pluginManager.hasPlugin(t)}getComponent(t){return this.pluginManager.getComponent(t)}getComponents(){return this.pluginManager.components}async reinitialize(t){return await this.pluginManager.reinitialize(t)}async loadExternalPlugin(t,i){return await this.pluginManager.loadExternalPlugin(t,i)}async loadExternalPlugins(t){return await this.pluginManager.loadExternalPlugins(t)}unregisterPlugin(t){return this.pluginManager.unregisterPlugin(t)}emit(t,i){const s=new CustomEvent(`contentbox:${t}`,{detail:i});document.dispatchEvent(s)}on(t,i){document.addEventListener(`contentbox:${t}`,i)}off(t,i){document.removeEventListener(`contentbox:${t}`,i)}async init(){this.initialized||(this.initCore(),this.initPlugins(),this.initialized=!0,this.emit("init"))}async initPlugins(){this.settings.autoLoadPlugins&&await this.pluginManager.autoLoadPlugins(),this.pluginManager.initializeComponents()}initCore(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{Je.init({duration:1200})},300),this.settings.smoothScroll&&new Ci}prepareContent(){const t=document.querySelector(".is-wrapper");t.classList.add("box-v2");const i=function(r){let n=r.nextElementSibling;return n?n.classList.contains("is-section")?n:i(n):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(n){let h=n.target.closest(".is-section");if(h){let d=i(h);d&&this.scrollIt(d,1e3,"easeInQuad")}n.preventDefault(),n.stopImmediatePropagation()})}),t&&(t.classList.contains("is-edit")||t.querySelectorAll("a").forEach(function(n){n.addEventListener("click",function(h){let d=n.getAttribute("href");if(d&&d.indexOf("#")===0)if(d.indexOf("#section")===0){let u=d.replace("#section","");if(!isNaN(parseInt(u))){let p=document.querySelectorAll(".is-section"),b,C=0;p.forEach(function(k){k.classList.contains("is-section-navbar")||(C===u-1&&(b=k),C++)}),b&&scrollIt(b,1e3,"easeInQuad"),h.preventDefault()}}else try{let u=document.querySelector(d);u&&(scrollIt(u,1e3,"easeInQuad"),h.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let a=document.querySelectorAll(".is-animated,.is-scale-animated");a.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),a=document.querySelectorAll(".is-container > div"),a.forEach(function(r){let n=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),h=0;n.length>1&&n.forEach(function(d){d.className.indexOf("delay-")===-1&&(h>0&&(d.style.transitionDelay=h+"s",d.style.animationDelay=h+"s"),h=h+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function t(s){var e;return function(a){e&&clearTimeout(e),e=setTimeout(s,100,a)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",t(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var t=document.querySelectorAll(".is-overlay-bg");t.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new ii({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(t,i=0){const s=t.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(t,i=200,s="linear",e){_scrollTo(t)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(n=>{const h=n.firstElementChild;n.after(h),n.parentNode.removeChild(n)}),document.querySelectorAll(".is-section").forEach(n=>{n.hasAttribute("data-section-clone")&&n.parentNode.removeChild(n),n.hasAttribute("data-section-original")&&(n.style.display="",n.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(h=>{h.outerHTML=h.innerHTML});const e=window.self!==window.top;let a;e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.length>0&&window.scrollTo(0,0),a.forEach(function(n){s<=970&&n.querySelector(".is-box")&&(n.querySelectorAll(".is-box").forEach(d=>{const u=n.cloneNode(!1);d.getAttributeNames().map(p=>{p.indexOf("data-")!==-1&&u.setAttribute(p,d.getAttribute(p))}),u.classList.add("is-box"),d.classList.forEach(p=>{(p.indexOf("is-box-")!==-1||p.indexOf("is-content-")!==-1||p.indexOf("box-autofit")!==-1||p.indexOf("is-light-text")!==-1||p.indexOf("is-dark-text")!==-1||p.indexOf("is-align-")!==-1||p.indexOf("type-")!==-1||p.indexOf("block-click")!==-1||p.indexOf("hover-zoom")!==-1)&&u.classList.add(p)}),u.setAttribute("data-section-clone",""),u.innerHTML=d.innerHTML,n.parentNode.insertBefore(u,n)}),n.setAttribute("data-section-original",""),n.style.display="none")}),e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.forEach(function(n){if(n.parentNode.closest(".section-wrap")||s<=970&&n.hasAttribute("data-section-original"))return;const h=document.createElement("div");h.classList.add("pin-wrap"),n.classList.contains("m-skrollrr-off")&&h.classList.add("m-skrollrr-off"),n.classList.contains("pin-space-lg")&&h.classList.add("pin-space-lg"),n.classList.contains("pin-space-xl")&&h.classList.add("pin-space-xl"),n.classList.contains("xs-hidden")&&h.classList.add("xs-hidden"),n.classList.contains("sm-hidden")&&h.classList.add("sm-hidden"),n.classList.contains("desktop-hidden")&&h.classList.add("desktop-hidden"),n.after(h),h.appendChild(n)});const r=n=>{document.querySelectorAll(".is-section").forEach(d=>{const u=d.getBoundingClientRect().top;let p,b;d.parentNode.classList.contains("pin-wrap")?(p=d.parentNode.nextElementSibling,b=d.parentNode.previousElementSibling):(p=d.nextElementSibling,b=d.previousElementSibling),p&&p.classList.contains("pin-wrap")&&(p=p.querySelector(".is-section")),b&&b.classList.contains("pin-wrap")&&(b=b.querySelector(".is-section")),u<=0&&((d.classList.contains("no-spacing")||d.classList.contains("pin-overlap"))&&d.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(k=>{k!==d&&k.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||e)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const t=a=>{const r=document.createElement("div");r.style.backgroundPositionX=a.style.backgroundPositionX,r.style.backgroundPositionY=a.style.backgroundPositionY,r.style.backgroundSize=a.style.backgroundSize,a.hasAttribute("data-bg-ori")||a.setAttribute("data-bg-ori",r.style.cssText)},i=a=>{if(a.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=a.getAttribute("data-bg-ori"),a.style.backgroundPositionX=r.style.backgroundPositionX,a.style.backgroundPositionY=r.style.backgroundPositionY,a.style.backgroundSize=r.style.backgroundSize,a.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(a=>{t(a),s<=760&&(a.hasAttribute("data-bg-xs")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-xs"):i(a)),s>760&&s<=970&&(a.hasAttribute("data-bg-sm")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-sm"):i(a)),s>970&&s<=1280&&(a.hasAttribute("data-bg-md")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-md"):i(a)),s>1280&&(a.hasAttribute("data-bg-lg")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-lg"):i(a))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(e=>{e.querySelector("video.is-video-bg")&&e.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(e=>{e.parentNode.setAttribute("data-scroll","")});const s=new di({trigger:{once:!0,offset:{element:{x:0,y:(e,a,r)=>.1},viewport:{x:0,y:(e,a,r)=>e.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:e=>{e.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let n=r.parentNode.querySelector(".video-bg-play");r.autoplay?n?n.innerHTML.indexOf("play")===-1&&r.play():r.play():n&&n.innerHTML.indexOf("play")===-1&&r.play()})},out:e=>{e.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let t;window.contentbox?t=window.contentbox.onRender:parent.contentbox&&(t=parent.contentbox.onRender);const i=()=>{t.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(e){e.classList.contains("once")?(e.removeAttribute("data-scroll",""),e.setAttribute("data-scroll-once","")):(e.removeAttribute("data-scroll-once",""),e.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(e){let a=e.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;a.length>1&&a.forEach(function(n){n.className.indexOf("delay-")===-1&&(r>0&&(n.style.transitionDelay=r+"s",n.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const t={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(t),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const e=a=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,t),a.preventDefault(),a.stopImmediatePropagation()};s.addEventListener("click",e),s._lightboxHandler=e})}refreshLightbox(t){this.glightbox&&this.glightbox.destroy(),this.glightbox=new Ze(t),window.GLightbox=Ze.default}openLightbox(t,i,s){let e=[],a=0;if(i){const n=i.closest("[data-gallery]");let h=[];n?h=n.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(u=>{u.closest("[data-gallery]")||h.push(u)}),h.forEach((d,u)=>{let p=d.getAttribute("href");p||(p=d.getAttribute("data-modal-url")),e.push({href:p}),t===p&&(a=u)})}const r=document.activeElement;r?.blur(),e.length>0?(this.glightbox.setElements(e),this.glightbox.openAt(a)):(this.glightbox.setElements([{href:t}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s),r?.focus()})}blockInit(){const t={start:()=>{document.querySelectorAll(".is-block").forEach(e=>{e.hasAttribute("data--t")||e.setAttribute("data--t",e.style.top),e.hasAttribute("data--l")||e.setAttribute("data--l",e.style.left),e.hasAttribute("data--b")||e.setAttribute("data--b",e.style.bottom),e.hasAttribute("data--r")||e.setAttribute("data--r",e.style.right),e.hasAttribute("data--w")||e.setAttribute("data--w",e.style.width),e.hasAttribute("data--h")||e.setAttribute("data--h",e.style.height),e.removeAttribute("data-prev"),e.removeAttribute("data-fluid"),e.removeAttribute("data-fluid-val"),e.classList.remove("fluid"),e.style.transition=""})},apply:(e,a,r)=>{if(a&&e.getAttribute("data-prev")!==a+""){if(r||(e.style.transition="all 0.35s ease"),a!==1e4){if(e.setAttribute("data-breakpoint",a),e.hasAttribute("data--t-"+a)){let n=e.getAttribute("data--t-"+a);e.style.top=n}if(e.hasAttribute("data--l-"+a)){let n=e.getAttribute("data--l-"+a);e.style.left=n}if(e.hasAttribute("data--b-"+a)){let n=e.getAttribute("data--b-"+a);e.style.bottom=n}if(e.hasAttribute("data--r-"+a)){let n=e.getAttribute("data--r-"+a);e.style.right=n}if(e.hasAttribute("data--w-"+a)){let n=e.getAttribute("data--w-"+a);e.style.width=n}if(e.hasAttribute("data--h-"+a)){let n=e.getAttribute("data--h-"+a);e.style.height=n}if(e.hasAttribute("data--transform-"+a)){let n=e.getAttribute("data--transform-"+a);e.style.transform=n,e.setAttribute("data--transform-val",a)}}else{if(e.removeAttribute("data-breakpoint"),e.hasAttribute("data--t")){let n=e.getAttribute("data--t");e.style.top=n}if(e.hasAttribute("data--l")){let n=e.getAttribute("data--l");e.style.left=n}if(e.hasAttribute("data--b")){let n=e.getAttribute("data--b");e.style.bottom=n}if(e.hasAttribute("data--r")){let n=e.getAttribute("data--r");e.style.right=n}if(e.hasAttribute("data--w")){let n=e.getAttribute("data--w");e.style.width=n}if(e.hasAttribute("data--h")){let n=e.getAttribute("data--h");e.style.height=n}if(e.hasAttribute("data--transform")){let n=e.getAttribute("data--transform");e.style.transform=n,e.setAttribute("data--transform-val","")}}e.setAttribute("data-prev",a),setTimeout(()=>{r||(e.style.transition="")},400)}},applyFluid:(e,a)=>{e.classList.toggle("fluid",a==="yes"),e.setAttribute("data-fluid",a)},resize:e=>{const a=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){let p=h[d].name.match(/^data--h-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,u)=>u-d);for(let d=0;d<n.length;d++){const u=n[d];if(d===0){if(a>u){let p=r.getAttribute("data--h");p?r.style.height=p:r.style.height=""}}else{const p=n[d-1];if(p>=a&&a>u){let b=r.getAttribute("data--h-"+p);b&&(r.style.height=b)}}}if(n.length>0&&n[n.length-1]>=a){const u=n[n.length-1];let p=r.getAttribute("data--h-"+u);p&&(r.style.height=p)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>a&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),t.applyFluid(r,"yes"));let d=r.getAttribute("data-fluid-val");d&&parseInt(d)+0<=a&&r.classList.contains("fluid")&&t.applyFluid(r,"no")}let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){const u=h[d].name;let p=u.match(/^data--t-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}if(p=u.match(/^data--w-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}if(p=u.match(/^data--transform-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,u)=>u-d);for(let d=0;d<n.length;d++){const u=n[d];if(d===0)a>u&&t.apply(r,1e4,e);else{const p=n[d-1];p>=a&&a>u&&t.apply(r,p,e)}}if(n.length>0){const d=n[n.length-1];d>=a&&t.apply(r,d,e)}})},render:()=>{t.start(),t.resize(!0)}},s=((e,a)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>e(...n),a)}})(()=>{t.resize()},0);window.addEventListener("resize",s),t.start(),t.resize(!0),this.Block=t}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)}),this.pluginManager.destroy(),this.initialized=!1,this.emit("destroy")}}return ki})();
|
|
48
|
+
</div>`;class Ze{constructor(t={}){this.customOptions=t,this.settings=$t(ke,t),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}init(){const t=this.getSelector();t&&(this.baseEvents=Xt("click",{onElement:t,withCallback:(i,s)=>{i.preventDefault(),this.open(s)}})),this.elements=this.getElements()}open(t=null,i=null){if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;let s=re(i)?i:this.settings.startAt;if(Rt(t)){const n=t.getAttribute("data-gallery");n&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,n)),zt(s)&&(s=this.getElementIndex(t),s<0&&(s=0))}re(s)||(s=0),this.build(),Qt(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);const e=document.body,a=window.innerWidth-document.documentElement.clientWidth;if(a>0){var r=document.createElement("style");r.type="text/css",r.className="gcss-styles",r.innerText=`.gscrollbar-fixer {margin-right: ${a}px}`,document.head.appendChild(r),Y(e,"gscrollbar-fixer")}Y(e,"glightbox-open"),Y(Le,"glightbox-open"),Fe&&(Y(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(s,!0),this.elements.length===1?(Y(this.prevButton,"glightbox-button-hidden"),Y(this.nextButton,"glightbox-button-hidden")):(ft(this.prevButton,"glightbox-button-hidden"),ft(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),D(this.settings.onOpen)&&this.settings.onOpen(),Ue&&this.settings.touchNavigation&&xi(this),this.settings.keyboardNavigation&&gi(this)}openAt(t=0){this.open(null,t)}showSlide(t=0,i=!1){De(this.loader),this.index=parseInt(t);let s=this.slidesContainer.querySelector(".current");s&&ft(s,"current"),this.slideAnimateOut();let e=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(e,"loaded"))this.slideAnimateIn(e,i),Ee(this.loader);else{De(this.loader);const a=this.elements[t],r={index:this.index,slide:e,slideNode:e,slideConfig:a.slideConfig,slideIndex:this.index,trigger:a.node,player:null};this.trigger("slide_before_load",r),a.instance.setContent(e,()=>{Ee(this.loader),this.resize(),this.slideAnimateIn(e,i),this.trigger("slide_after_load",r)})}this.slideDescription=e.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&_t(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(t+1),this.preloadSlide(t-1)),this.updateNavigationClasses(),this.activeSlide=e}preloadSlide(t){if(t<0||t>this.elements.length-1||zt(this.elements[t]))return!1;let i=this.slidesContainer.querySelectorAll(".gslide")[t];if(_t(i,"loaded"))return!1;const s=this.elements[t],e=s.type,a={index:t,slide:i,slideNode:i,slideConfig:s.slideConfig,slideIndex:t,trigger:s.node,player:null};this.trigger("slide_before_load",a),e==="video"||e==="external"?setTimeout(()=>{s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})},200):s.instance.setContent(i,()=>{this.trigger("slide_after_load",a)})}prevSlide(){this.goToSlide(this.index-1)}nextSlide(){this.goToSlide(this.index+1)}goToSlide(t=!1){if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(t<0||t>this.elements.length-1))return!1;t<0?t=this.elements.length-1:t>=this.elements.length&&(t=0),this.showSlide(t)}insertSlide(t={},i=-1){i<0&&(i=this.elements.length);const s=new le(t,this,i),e=s.getConfig(),a=$t({},e),r=s.create(),n=this.elements.length-1;a.index=i,a.node=!1,a.instance=s,a.slideConfig=e,this.elements.splice(i,0,a);let h=null,d=null;if(this.slidesContainer){if(i>n)this.slidesContainer.appendChild(r);else{let u=this.slidesContainer.querySelectorAll(".gslide")[i];this.slidesContainer.insertBefore(r,u)}(this.settings.preload&&this.index==0&&i==0||this.index-1==i||this.index+1==i)&&this.preloadSlide(i),this.index===0&&i===0&&(this.index=1),this.updateNavigationClasses(),h=this.slidesContainer.querySelectorAll(".gslide")[i],d=this.getSlidePlayerInstance(i),a.slideNode=h}this.trigger("slide_inserted",{index:i,slide:h,slideNode:h,slideConfig:e,slideIndex:i,trigger:null,player:d}),D(this.settings.slideInserted)&&this.settings.slideInserted({index:i,slide:h,player:d})}removeSlide(t=-1){if(t<0||t>this.elements.length-1)return!1;const i=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[t];i&&(this.getActiveSlideIndex()==t&&(t==this.elements.length-1?this.prevSlide():this.nextSlide()),i.parentNode.removeChild(i)),this.elements.splice(t,1),this.trigger("slide_removed",t),D(this.settings.slideRemoved)&&this.settings.slideRemoved(t)}slideAnimateIn(t,i){let s=t.querySelector(".gslide-media"),e=t.querySelector(".gslide-description"),a={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},r={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(s.offsetWidth>0&&e&&(Ee(e),e.style.display=""),ft(t,this.effectsClasses),i)Qt(t,this.settings.cssEfects[this.settings.openEffect].in,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])});else{let n=this.settings.slideEffect,h=n!=="none"?this.settings.cssEfects[n].in:n;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(h=this.settings.cssEfects.slideBack.in),Qt(t,h,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(t),this.trigger("slide_changed",{prev:a,current:r}),D(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[a,r])})}setTimeout(()=>{this.resize(t)},100),Y(t,"current")}slideAnimateOut(){if(!this.prevActiveSlide)return!1;let t=this.prevActiveSlide;ft(t,this.effectsClasses),Y(t,"prev");let i=this.settings.slideEffect,s=i!=="none"?this.settings.cssEfects[i].out:i;this.slidePlayerPause(t),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:zt(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),D(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(s=this.settings.cssEfects.slideBack.out),Qt(t,s,()=>{let e=t.querySelector(".ginner-container"),a=t.querySelector(".gslide-media"),r=t.querySelector(".gslide-description");e.style.transform="",a.style.transform="",ft(a,"greset"),a.style.opacity="",r&&(r.style.opacity=""),ft(t,"prev")})}getAllPlayers(){return this.videoPlayers}getSlidePlayerInstance(t){const i="gvideo"+t,s=this.getAllPlayers();return gt(s,i)&&s[i]?s[i]:!1}stopSlideVideo(t){if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}slidePlayerPause(t){if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&i.playing&&i.pause()}playSlideVideo(t){if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");const i=this.getSlidePlayerInstance(t);i&&!i.playing&&i.play()}slidePlayerPlay(t){if(Fe&&!this.settings.plyr.config?.muted)return;if(Rt(t)){let s=t.querySelector(".gvideo-wrapper");s&&(t=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(t);i&&!i.playing&&(i.play(),this.settings.autofocusVideos&&i.elements.container.focus())}setElements(t){this.settings.elements=!1;const i=[];t&&t.length&&J(t,(s,e)=>{const a=new le(s,this,e),r=a.getConfig(),n=$t({},r);n.slideConfig=r,n.instance=a,n.index=e,i.push(n)}),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(J(this.elements,()=>{let s=Ft(this.settings.slideHTML);this.slidesContainer.appendChild(s)}),this.showSlide(0,!0)))}getElementIndex(t){let i=!1;return J(this.elements,(s,e)=>{if(gt(s,"node")&&s.node==t)return i=e,!0}),i}getElements(){let t=[];this.elements=this.elements?this.elements:[],!zt(this.settings.elements)&&Xe(this.settings.elements)&&this.settings.elements.length&&J(this.settings.elements,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=$t({},n);h.node=!1,h.index=a,h.instance=r,h.slideConfig=n,t.push(h)});let i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i&&J(i,(e,a)=>{const r=new le(e,this,a),n=r.getConfig(),h=$t({},n);h.node=e,h.index=a,h.instance=r,h.slideConfig=n,h.gallery=e.getAttribute("data-gallery"),t.push(h)}),t}getGalleryElements(t,i){return t.filter(s=>s.gallery==i)}getSelector(){return this.settings.elements?!1:this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?`*[${this.settings.selector}]`:this.settings.selector}getActiveSlide(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}getActiveSlideIndex(){return this.index}getAnimationClasses(){let t=[];for(let i in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(i)){let s=this.settings.cssEfects[i];t.push(`g${s.in}`),t.push(`g${s.out}`)}return t.join(" ")}build(){if(this.built)return!1;const t=document.body.childNodes,i=[];J(t,d=>{d.parentNode==document.body&&d.nodeName.charAt(0)!=="#"&&d.hasAttribute&&!d.hasAttribute("aria-hidden")&&(i.push(d),d.setAttribute("aria-hidden","true"))});const s=gt(this.settings.svg,"next")?this.settings.svg.next:"",e=gt(this.settings.svg,"prev")?this.settings.svg.prev:"",a=gt(this.settings.svg,"close")?this.settings.svg.close:"";let r=this.settings.lightboxHTML;r=r.replace(/{nextSVG}/g,s),r=r.replace(/{prevSVG}/g,e),r=r.replace(/{closeSVG}/g,a),r=Ft(r),document.body.appendChild(r);const n=document.getElementById("glightbox-body");this.modal=n;let h=n.querySelector(".gclose");this.prevButton=n.querySelector(".gprev"),this.nextButton=n.querySelector(".gnext"),this.overlay=n.querySelector(".goverlay"),this.loader=n.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=i,this.events={},Y(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&h&&(this.events.close=Xt("click",{onElement:h,withCallback:(d,u)=>{d.preventDefault(),this.close()}})),h&&!this.settings.closeButton&&h.parentNode.removeChild(h),this.nextButton&&(this.events.next=Xt("click",{onElement:this.nextButton,withCallback:(d,u)=>{d.preventDefault(),this.nextSlide()}})),this.prevButton&&(this.events.prev=Xt("click",{onElement:this.prevButton,withCallback:(d,u)=>{d.preventDefault(),this.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=Xt("click",{onElement:n,withCallback:(d,u)=>{!this.preventOutsideClick&&!_t(document.body,"glightbox-mobile")&&!Wt(d.target,".ginner-container")&&!Wt(d.target,".gbtn")&&!_t(d.target,"gnext")&&!_t(d.target,"gprev")&&this.close()}})),J(this.elements,(d,u)=>{this.slidesContainer.appendChild(d.instance.create()),d.slideNode=this.slidesContainer.querySelectorAll(".gslide")[u]}),Ue&&Y(document.body,"glightbox-touch"),this.events.resize=Xt("resize",{onElement:window,withCallback:()=>{this.resize()}}),this.built=!0}resize(t=null){if(t=t||this.activeSlide,!t||_t(t,"zoomed"))return;const i=ze(),s=t.querySelector(".gvideo-wrapper"),e=t.querySelector(".gslide-image"),a=this.slideDescription;let r=i.width,n=i.height;if(r<=768?Y(document.body,"glightbox-mobile"):ft(document.body,"glightbox-mobile"),!s&&!e)return;let h=!1;if(a&&(_t(a,"description-bottom")||_t(a,"description-top"))&&!_t(a,"gabsolute")&&(h=!0),e){if(r<=768)e.querySelector("img");else if(h){let d=a.offsetHeight,u=e.querySelector("img");const b=this.elements[this.index].node.getAttribute("data-height")??"100vh";u.setAttribute("style",`max-height: calc(${b} - ${d}px)`),a.setAttribute("style",`max-width: ${u.offsetWidth}px;`)}}if(s){let d=gt(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!d){const k=s.clientWidth,L=s.clientHeight,at=k/L;d=`${k/at}:${L/at}`}let u=d.split(":"),p=this.settings.videosWidth,b=this.settings.videosWidth;re(p)||p.indexOf("px")!==-1?b=parseInt(p):p.indexOf("vw")!==-1?b=r*parseInt(p)/100:p.indexOf("vh")!==-1?b=n*parseInt(p)/100:p.indexOf("%")!==-1?b=r*parseInt(p)/100:b=parseInt(s.clientWidth);let C=b/(parseInt(u[0])/parseInt(u[1]));if(C=Math.floor(C),h&&(n=n-a.offsetHeight),b>r||C>n||n<C&&r>b){let k=s.offsetWidth,L=s.offsetHeight,at=n/L,pt={width:k*at};s.parentNode.setAttribute("style",`max-width: ${pt.width}px`),h&&a.setAttribute("style",`max-width: ${pt.width}px;`)}else s.parentNode.style.maxWidth=`${p}`,h&&a.setAttribute("style",`max-width: ${p};`)}}reload(){this.init()}updateNavigationClasses(){const t=this.loop();ft(this.nextButton,"disabled"),ft(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(Y(this.prevButton,"disabled"),Y(this.nextButton,"disabled")):this.index===0&&!t?Y(this.prevButton,"disabled"):this.index===this.elements.length-1&&!t&&Y(this.nextButton,"disabled")}loop(){let t=gt(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return t=gt(this.settings,"loop")?this.settings.loop:t,t}close(){if(!this.lightboxOpen){if(this.events){for(let t in this.events)this.events.hasOwnProperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&J(this.bodyHiddenChildElms,t=>{t.removeAttribute("aria-hidden")}),Y(this.modal,"glightbox-closing"),Qt(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),Qt(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,()=>{if(this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null,this.built=!1,this.events){for(let s in this.events)this.events.hasOwnProperty(s)&&this.events[s].destroy();this.events=null}const t=document.body;ft(Le,"glightbox-open"),ft(t,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),this.modal.parentNode.removeChild(this.modal),this.trigger("close"),D(this.settings.onClose)&&this.settings.onClose();const i=document.querySelector(".gcss-styles");i&&i.parentNode.removeChild(i),this.lightboxOpen=!1,this.closing=null})}destroy(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}on(t,i,s=!1){if(!t||!D(i))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:t,once:s,callback:i})}once(t,i){this.on(t,i,!0)}trigger(t,i=null){const s=[];J(this.apiEvents,(e,a)=>{const{evt:r,once:n,callback:h}=e;r==t&&(h(i),n&&s.push(a))}),s.length&&J(s,e=>this.apiEvents.splice(e,1))}clearAllEvents(){this.apiEvents.splice(0,this.apiEvents.length)}version(){return ji}}class Ci{constructor(t={}){this.animationTime=t.animationTime??800,this.frameRate=t.frameRate??150,this.stepSize=t.stepSize??120,this.accelerationDelta=t.accelerationDelta??300,this.accelerationMax=t.accelerationMax??2,this.pulseScale=t.pulseScale??4,this.pulseNormalize=1,this.keyboardSupport=t.keyboardSupport??!0,this.arrowScroll=t.arrowScroll??50,this.fixedBackground=t.fixedBackground??!1,this.queue=[],this.pending=!1,this.lastScrollTime=Date.now(),this.direction={x:0,y:0},this.activeElement=null,this.deltaBuffer=[],this.deltaBufferTimer=null,this.isMac=/^Mac/.test(navigator.platform),this.scrollBehaviorCache=new WeakMap,this.pulseNormalize=1/this._pulseRaw(1),this._init()}_init(){const t="onwheel"in document.createElement("div")?"wheel":"mousewheel";window.addEventListener(t,this._onWheel.bind(this),{passive:!1}),this.keyboardSupport&&window.addEventListener("keydown",this._onKeydown.bind(this),!1),window.addEventListener("mousedown",this._onMousedown.bind(this),!1),this.fixedBackground||(document.body.style.backgroundAttachment="scroll",document.documentElement.style.backgroundAttachment="scroll")}destroy(){const t="onwheel"in document.createElement("div")?"wheel":"mousewheel";window.removeEventListener(t,this._onWheel.bind(this)),window.removeEventListener("keydown",this._onKeydown.bind(this)),window.removeEventListener("mousedown",this._onMousedown.bind(this)),this.queue=[],this.pending=!1}_onMousedown(t){this.activeElement=t.target}_onKeydown(t){const i=t.target,s=t.ctrlKey||t.altKey||t.metaKey||t.shiftKey&&t.code!=="Space",e=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(t.defaultPrevented||e.test(i.nodeName)||i.nodeName==="INPUT"&&!a.test(i.type)||i.isContentEditable||s)return!0;let r=0,n=0;const h=this._findScrollableAncestor(this.activeElement||document.activeElement);if(!h)return;const d=h===document.body?window.innerHeight:h.clientHeight;switch(t.code){case"ArrowUp":n=-this.arrowScroll;break;case"ArrowDown":n=this.arrowScroll;break;case"Space":n=-(t.shiftKey?1:-1)*d*.9;break;case"PageUp":n=-d*.9;break;case"PageDown":n=d*.9;break;case"Home":n=-h.scrollTop;break;case"End":const p=h.scrollHeight-h.scrollTop-d;n=p>0?p+10:0;break;case"ArrowLeft":r=-this.arrowScroll;break;case"ArrowRight":r=this.arrowScroll;break;default:return!0}this._enqueueScroll(h,r,n),t.preventDefault()}_onWheel(t){if(t.ctrlKey||t.defaultPrevented)return;let i=-t.wheelDeltaX||t.deltaX||0,s=-t.wheelDeltaY||t.deltaY||0;if(this.isMac&&(t.wheelDeltaX&&this._isDivisible(t.wheelDeltaX,120)&&(i=-120*(t.wheelDeltaX/Math.abs(t.wheelDeltaX))),t.wheelDeltaY&&this._isDivisible(t.wheelDeltaY,120)&&(s=-120*(t.wheelDeltaY/Math.abs(t.wheelDeltaY)))),!i&&!s&&(s=-t.wheelDelta||0),t.deltaMode===1&&(i*=40,s*=40),this._isTouchpad(s))return!0;Math.abs(i)>1.2&&(i*=this.stepSize/120),Math.abs(s)>1.2&&(s*=this.stepSize/120);const e=t.target,a=this._findScrollableAncestor(e);if(!a)return;const r=Math.sign(i),n=Math.sign(s);(r!==this.direction.x||n!==this.direction.y)&&(this.direction={x:r,y:n},this.queue=[],this.lastScrollTime=0);const h=Date.now(),d=h-this.lastScrollTime;if(d<this.accelerationDelta){const u=(1+50/d)/2;if(u>1){const p=Math.min(u,this.accelerationMax);i*=p,s*=p}}this.lastScrollTime=h,this._enqueueScroll(a,i,s),t.preventDefault()}_isDivisible(t,i){return Math.floor(t/i)===t/i}_isTouchpad(t){if(!t)return!1;this.deltaBuffer.length||(this.deltaBuffer=[t,t,t]);const i=Math.abs(t);this.deltaBuffer.push(i),this.deltaBuffer.shift(),clearTimeout(this.deltaBufferTimer),this.deltaBufferTimer=setTimeout(()=>{this.deltaBuffer=[]},1e3);const s=this.deltaBuffer.every(n=>this._isDivisible(n,120)),e=this.deltaBuffer.every(n=>this._isDivisible(n,100)),a=i>120&&this.deltaBuffer.every(n=>this._isDivisible(n,i)),r=!s&&!e&&!a;return i<50?!0:r}_findScrollableAncestor(t){const i=document.scrollingElement||document.documentElement;let s=t;for(;s&&s!==document.body;){const e=window.getComputedStyle(s),a=e.overflowY,r=e.overflowX,n=["auto","scroll"].includes(a),h=["auto","scroll"].includes(r),d=s.scrollHeight>s.clientHeight,u=s.scrollWidth>s.clientWidth;if(n&&d||h&&u)return s;if(s===i)return i;s=s.parentElement}return i}_enqueueScroll(t,i,s){if(!this.scrollBehaviorCache.has(t)){const e=window.getComputedStyle(t).scrollBehavior;e==="smooth"&&(this.scrollBehaviorCache.set(t,e),t.style.scrollBehavior="auto")}this.queue.push({element:t,x:i,y:s,lastX:i<0?.99:-.99,lastY:s<0?.99:-.99,start:Date.now()}),this.pending||(this._animate(t),this.pending=!0)}_animate(t){const i=()=>{const s=Date.now();let e=0,a=0;for(let n=this.queue.length-1;n>=0;n--){const h=this.queue[n],d=s-h.start,u=d>=this.animationTime,p=u?1:d/this.animationTime,b=this._pulse(p),C=h.x*b-h.lastX>>0,k=h.y*b-h.lastY>>0;e+=C,a+=k,h.lastX+=C,h.lastY+=k,u&&this.queue.splice(n,1)}if(t===document.scrollingElement||t===document.documentElement||t===document.body?window.scrollBy(e,a):(e&&(t.scrollLeft+=e),a&&(t.scrollTop+=a)),this.queue.length>0)requestAnimationFrame(i);else if(this.pending=!1,this.scrollBehaviorCache.has(t)){const n=this.scrollBehaviorCache.get(t);t.style.scrollBehavior=n,this.scrollBehaviorCache.delete(t)}};requestAnimationFrame(i)}_pulseRaw(t){if(t*=this.pulseScale,t<1)return t-(1-Math.exp(-t));{const i=Math.exp(-1);t-=1;const s=1-Math.exp(-t);return i+s*(1-i)}}_pulse(t){return t>=1?1:t<=0?0:this._pulseRaw(t)*this.pulseNormalize}}class Li{constructor(t={}){this.config={plugins:{},autoLoad:!0,pluginBaseUrl:"",allowExternalPlugins:!0,trustedDomains:[],...t},this.plugins=new Map,this.loadedStyles=new Set,this.components=new Map,this.externalPlugins=new Map}async autoLoadPlugins(){const i=this.detectComponentTypes().filter(s=>this.config.plugins[s]&&!this.plugins.has(s));return i.length>0&&await Promise.all(i.map(s=>this.loadPlugin(s))),i}detectComponentTypes(){const t=new Set;return document.querySelectorAll("[data-cb-type]").forEach(i=>{t.add(i.dataset.cbType)}),document.querySelectorAll('[class*="cb-"]').forEach(i=>{i.classList.forEach(s=>{if(s.startsWith("cb-")){const e=s.replace("cb-","");t.add(e)}})}),Array.from(t)}async loadPlugin(t){if(this.plugins.has(t))return this.plugins.get(t);const i=this.config.plugins[t];if(!i)return console.warn(`[PluginManager] Plugin "${t}" not found in registry`),null;try{i.css&&this.loadCSS(this.resolveUrl(i.css));const s=this.resolveUrl(i.url),e=await this.importModule(s),a=e.default||e;return this.plugins.set(t,a),typeof a.init=="function"&&await a.init(this),this.emit("plugin-loaded",{name:t,plugin:a}),a}catch(s){return console.error(`[PluginManager] Failed to load plugin "${t}":`,s),null}}async importModule(t){return import(t)}loadCSS(t){if(this.loadedStyles.has(t))return;const i=document.createElement("link");i.rel="stylesheet",i.href=t,i.onload=()=>{this.emit("css-loaded",{url:t})},i.onerror=()=>{console.error(`[PluginManager] Failed to load CSS: ${t}`)},document.head.appendChild(i),this.loadedStyles.add(t)}resolveUrl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")?t:this.config.pluginBaseUrl+t}initializeComponents(){return document.querySelectorAll("[data-cb-type]").forEach(i=>{const s=i.dataset.cbType,e=this.plugins.get(s);if(e&&typeof e.mount=="function")try{const a=this.parseOptions(i);i.hasAttribute("data-cb-original-content")||i.setAttribute("data-cb-original-content",i.innerHTML);const r=e.mount(i,a);this.components.set(i,r),i.setAttribute("data-cb-loaded","true")}catch(a){console.error(`[PluginManager] Failed to mount component "${s}":`,a)}}),this.components.size}parseOptions(t){const i={};return Array.from(t.attributes).forEach(s=>{if(s.name.startsWith("data-cb-")){const e=s.name.replace("data-cb-","").replace(/-([a-z])/g,(a,r)=>r.toUpperCase());i[e]=this.parseValue(s.value)}}),i}parseValue(t){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(t)&&t!=="")return Number(t);try{return JSON.parse(t)}catch{return t}}async use(t){return await this.loadPlugin(t)}getPlugin(t){return this.plugins.get(t)}getAllPlugins(){return Array.from(this.plugins.entries())}hasPlugin(t){return this.plugins.has(t)}getComponent(t){return this.components.get(t)}async reinitialize(t=document){if(this.reinitializeInProgress)return clearTimeout(this.pendingReinitialize),new Promise(i=>{this.pendingReinitialize=setTimeout(async()=>{this.pendingReinitialize=null;const s=await this.reinitialize(t);i(s)},100)});this.reinitializeInProgress=!0;try{const i=[];this.components.forEach((n,h)=>{(t===document||t.contains(h))&&i.push({element:h,instance:n})}),i.forEach(({element:n,instance:h})=>{const d=n.dataset.cbType,u=this.plugins.get(d);u&&typeof u.unmount=="function"&&u.unmount(n,h),this.components.delete(n)});const e=this.detectComponentTypesInContainer(t).filter(n=>this.config.plugins[n]&&!this.plugins.has(n));e.length>0&&await Promise.all(e.map(n=>this.loadPlugin(n)));const a=t.querySelectorAll("[data-cb-type]");let r=0;for(const n of a){const h=n.dataset.cbType,d=this.plugins.get(h);if(d&&typeof d.mount=="function")try{const u=this.parseOptions(n);n.hasAttribute("data-cb-original-content")?n.innerHTML=n.getAttribute("data-cb-original-content"):n.setAttribute("data-cb-original-content",n.innerHTML);const p=await d.mount(n,u);this.components.set(n,p),n.setAttribute("data-cb-loaded","true"),r++}catch(u){console.error(`[PluginManager] Failed to mount component "${h}":`,u)}}return this.emit("reinitialized",{container:t,count:r}),r}finally{this.reinitializeInProgress=!1}}detectComponentTypesInContainer(t){const i=new Set;return t.querySelectorAll("[data-cb-type]").forEach(e=>{i.add(e.dataset.cbType)}),Array.from(i)}async loadExternalPlugin(t,i){if(!t||typeof t!="string")throw new Error("Plugin ID is required and must be a string");if(!i.url)throw new Error("Plugin URL is required");if(this.plugins.has(t))return console.warn(`[PluginManager] Plugin "${t}" is already loaded`),this.plugins.get(t);const s=this.validatePluginSource(i.url);if(!s.allowed)throw new Error(`Security: ${s.reason}`);s.warning&&(console.warn(`[PluginManager] ${s.warning}`),this.emit("plugin-security-warning",{pluginId:t,url:i.url,warning:s.warning}));try{this.config.plugins[t]={url:i.url,css:i.css||null,source:"external",loadedAt:new Date().toISOString()},this.externalPlugins.set(t,this.config.plugins[t]);const e=await this.loadPlugin(t);return this.emit("external-plugin-loaded",{pluginId:t,url:i.url}),e}catch(e){throw delete this.config.plugins[t],this.externalPlugins.delete(t),console.error(`[PluginManager] Failed to load external plugin "${t}":`,e),e}}validatePluginSource(t){const i=t.includes("localhost")||t.includes("127.0.0.1");if(!t.startsWith("https://")&&!i)return{allowed:!1,reason:"Only HTTPS URLs are allowed (except localhost for development)"};if(!this.config.allowExternalPlugins)return{allowed:!1,reason:"External plugins are disabled. Enable allowExternalPlugins in configuration."};if(this.config.trustedDomains.length>0){const e=new URL(t).hostname;if(!this.config.trustedDomains.some(r=>{if(r.startsWith("*.")){const n=r.slice(2);return e===n||e.endsWith("."+n)}return e===r}))return{allowed:!0,warning:`Loading plugin from external domain: ${e}. Only add plugins from sources you trust.`}}else return{allowed:!0,warning:`Loading external plugin from: ${new URL(t).hostname}. This plugin will have full access to your page.`};return{allowed:!0}}async loadExternalPlugins(t){const i=[];for(const[s,e]of Object.entries(t))try{const a=await this.loadExternalPlugin(s,e);i.push({pluginId:s,success:!0,plugin:a})}catch(a){i.push({pluginId:s,success:!1,error:a.message}),console.error(`[PluginManager] Failed to load external plugin "${s}":`,a)}return i}unregisterPlugin(t){if(!this.externalPlugins.has(t))return console.warn(`[PluginManager] Plugin "${t}" is not an external plugin`),!1;const i=this.plugins.get(t),s=[];return this.components.forEach((e,a)=>{a.dataset.cbType===t&&s.push({element:a,instance:e})}),s.forEach(({element:e,instance:a})=>{i&&typeof i.unmount=="function"&&i.unmount(e,a),this.components.delete(e)}),i&&typeof i.destroy=="function"&&i.destroy(this),this.plugins.delete(t),this.externalPlugins.delete(t),delete this.config.plugins[t],this.emit("plugin-unregistered",{pluginId:t}),!0}getExternalPlugins(){return Array.from(this.externalPlugins.entries()).map(([t,i])=>({id:t,...i}))}isExternalPlugin(t){return this.externalPlugins.has(t)}destroy(){this.components.forEach((t,i)=>{const s=i.dataset.cbType,e=this.plugins.get(s);e&&typeof e.unmount=="function"&&e.unmount(i,t)}),this.plugins.forEach((t,i)=>{typeof t.destroy=="function"&&t.destroy(this)}),this.components.clear(),this.plugins.clear()}emit(t,i){if(this.runtime&&typeof this.runtime.emit=="function")this.runtime.emit(t,i);else{const s=new CustomEvent(`contentbox:${t}`,{detail:i});document.dispatchEvent(s)}}setRuntime(t){this.runtime=t}}class ki{constructor(t={}){const i={skin:"light",smoothScroll:!0,plugins:{},autoLoadPlugins:!0,pluginBaseUrl:"",allowExternalPlugins:!0,trustedDomains:[]};this.settings={...i,...t},this.initialized=!1,this.pluginManager=new Li({plugins:this.settings.plugins,autoLoad:this.settings.autoLoadPlugins,pluginBaseUrl:this.settings.pluginBaseUrl,allowExternalPlugins:this.settings.allowExternalPlugins,trustedDomains:this.settings.trustedDomains}),this.pluginManager.setRuntime(this),window.pageReRender=()=>{this.pageReRender()}}async use(t){return await this.pluginManager.use(t)}getPlugin(t){return this.pluginManager.getPlugin(t)}getPlugins(){return this.pluginManager.getAllPlugins()}hasPlugin(t){return this.pluginManager.hasPlugin(t)}getComponent(t){return this.pluginManager.getComponent(t)}getComponents(){return this.pluginManager.components}async reinitialize(t){return await this.pluginManager.reinitialize(t)}async loadExternalPlugin(t,i){return await this.pluginManager.loadExternalPlugin(t,i)}async loadExternalPlugins(t){return await this.pluginManager.loadExternalPlugins(t)}unregisterPlugin(t){return this.pluginManager.unregisterPlugin(t)}emit(t,i){const s=new CustomEvent(`contentbox:${t}`,{detail:i});document.dispatchEvent(s)}on(t,i){document.addEventListener(`contentbox:${t}`,i)}off(t,i){document.removeEventListener(`contentbox:${t}`,i)}async init(){this.initialized||(this.initCore(),this.initPlugins(),this.initialized=!0,this.emit("init"))}async initPlugins(){this.settings.autoLoadPlugins&&await this.pluginManager.autoLoadPlugins(),this.pluginManager.initializeComponents()}initCore(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{Je.init({duration:1200})},300),this.settings.smoothScroll&&new Ci}prepareContent(){const t=document.querySelector(".is-wrapper");t.classList.add("box-v2");const i=function(r){let n=r.nextElementSibling;return n?n.classList.contains("is-section")?n:i(n):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(n){let h=n.target.closest(".is-section");if(h){let d=i(h);d&&this.scrollIt(d,1e3,"easeInQuad")}n.preventDefault(),n.stopImmediatePropagation()})}),t&&(t.classList.contains("is-edit")||t.querySelectorAll("a").forEach(n=>{n.addEventListener("click",h=>{let d=n.getAttribute("href");if(d&&d.indexOf("#")===0)if(d.indexOf("#section")===0){let u=d.replace("#section","");if(!isNaN(parseInt(u))){let p=document.querySelectorAll(".is-section"),b,C=0;p.forEach(function(k){k.classList.contains("is-section-navbar")||(C===u-1&&(b=k),C++)}),b&&this.scrollIt(b,1e3,"easeInQuad"),h.preventDefault()}}else try{let u=document.querySelector(d);u&&(this.scrollIt(u,1e3,"easeInQuad"),h.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let a=document.querySelectorAll(".is-animated,.is-scale-animated");a.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),a=document.querySelectorAll(".is-container > div"),a.forEach(function(r){let n=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),h=0;n.length>1&&n.forEach(function(d){d.className.indexOf("delay-")===-1&&(h>0&&(d.style.transitionDelay=h+"s",d.style.animationDelay=h+"s"),h=h+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function t(s){var e;return function(a){e&&clearTimeout(e),e=setTimeout(s,100,a)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",t(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var t=document.querySelectorAll(".is-overlay-bg");t.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new ii({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(t,i=0){const s=t.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(t,i=200,s="linear",e){this._scrollTo(t)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(n=>{const h=n.firstElementChild;n.after(h),n.parentNode.removeChild(n)}),document.querySelectorAll(".is-section").forEach(n=>{n.hasAttribute("data-section-clone")&&n.parentNode.removeChild(n),n.hasAttribute("data-section-original")&&(n.style.display="",n.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(h=>{h.outerHTML=h.innerHTML});const e=window.self!==window.top;let a;e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.length>0&&window.scrollTo(0,0),a.forEach(function(n){s<=970&&n.querySelector(".is-box")&&(n.querySelectorAll(".is-box").forEach(d=>{const u=n.cloneNode(!1);d.getAttributeNames().map(p=>{p.indexOf("data-")!==-1&&u.setAttribute(p,d.getAttribute(p))}),u.classList.add("is-box"),d.classList.forEach(p=>{(p.indexOf("is-box-")!==-1||p.indexOf("is-content-")!==-1||p.indexOf("box-autofit")!==-1||p.indexOf("is-light-text")!==-1||p.indexOf("is-dark-text")!==-1||p.indexOf("is-align-")!==-1||p.indexOf("type-")!==-1||p.indexOf("block-click")!==-1||p.indexOf("hover-zoom")!==-1)&&u.classList.add(p)}),u.setAttribute("data-section-clone",""),u.innerHTML=d.innerHTML,n.parentNode.insertBefore(u,n)}),n.setAttribute("data-section-original",""),n.style.display="none")}),e?a=document.querySelectorAll(".is-wrapper .section-pin"):a=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),a.forEach(function(n){if(n.parentNode.closest(".section-wrap")||s<=970&&n.hasAttribute("data-section-original"))return;const h=document.createElement("div");h.classList.add("pin-wrap"),n.classList.contains("m-skrollrr-off")&&h.classList.add("m-skrollrr-off"),n.classList.contains("pin-space-lg")&&h.classList.add("pin-space-lg"),n.classList.contains("pin-space-xl")&&h.classList.add("pin-space-xl"),n.classList.contains("xs-hidden")&&h.classList.add("xs-hidden"),n.classList.contains("sm-hidden")&&h.classList.add("sm-hidden"),n.classList.contains("desktop-hidden")&&h.classList.add("desktop-hidden"),n.after(h),h.appendChild(n)});const r=n=>{document.querySelectorAll(".is-section").forEach(d=>{const u=d.getBoundingClientRect().top;let p,b;d.parentNode.classList.contains("pin-wrap")?(p=d.parentNode.nextElementSibling,b=d.parentNode.previousElementSibling):(p=d.nextElementSibling,b=d.previousElementSibling),p&&p.classList.contains("pin-wrap")&&(p=p.querySelector(".is-section")),b&&b.classList.contains("pin-wrap")&&(b=b.querySelector(".is-section")),u<=0&&((d.classList.contains("no-spacing")||d.classList.contains("pin-overlap"))&&d.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(k=>{k!==d&&k.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||e)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const t=a=>{const r=document.createElement("div");r.style.backgroundPositionX=a.style.backgroundPositionX,r.style.backgroundPositionY=a.style.backgroundPositionY,r.style.backgroundSize=a.style.backgroundSize,a.hasAttribute("data-bg-ori")||a.setAttribute("data-bg-ori",r.style.cssText)},i=a=>{if(a.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=a.getAttribute("data-bg-ori"),a.style.backgroundPositionX=r.style.backgroundPositionX,a.style.backgroundPositionY=r.style.backgroundPositionY,a.style.backgroundSize=r.style.backgroundSize,a.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(a=>{t(a),s<=760&&(a.hasAttribute("data-bg-xs")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-xs"):i(a)),s>760&&s<=970&&(a.hasAttribute("data-bg-sm")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-sm"):i(a)),s>970&&s<=1280&&(a.hasAttribute("data-bg-md")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-md"):i(a)),s>1280&&(a.hasAttribute("data-bg-lg")?a.style.cssText=a.style.cssText+";"+a.getAttribute("data-bg-lg"):i(a))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(e=>{e.querySelector("video.is-video-bg")&&e.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(e=>{e.parentNode.setAttribute("data-scroll","")});const s=new di({trigger:{once:!0,offset:{element:{x:0,y:(e,a,r)=>.1},viewport:{x:0,y:(e,a,r)=>e.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:e=>{e.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let n=r.parentNode.querySelector(".video-bg-play");r.autoplay?n?n.innerHTML.indexOf("play")===-1&&r.play():r.play():n&&n.innerHTML.indexOf("play")===-1&&r.play()})},out:e=>{e.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let t;window.contentbox?t=window.contentbox.onRender:parent.contentbox&&(t=parent.contentbox.onRender);const i=()=>{t.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(e){e.classList.contains("once")?(e.removeAttribute("data-scroll",""),e.setAttribute("data-scroll-once","")):(e.removeAttribute("data-scroll-once",""),e.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(e){let a=e.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;a.length>1&&a.forEach(function(n){n.className.indexOf("delay-")===-1&&(r>0&&(n.style.transitionDelay=r+"s",n.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const t={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(t),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const e=a=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,t),a.preventDefault(),a.stopImmediatePropagation()};s.addEventListener("click",e),s._lightboxHandler=e})}refreshLightbox(t){this.glightbox&&this.glightbox.destroy(),this.glightbox=new Ze(t),window.GLightbox=Ze.default}openLightbox(t,i,s){let e=[],a=0;if(i){const n=i.closest("[data-gallery]");let h=[];n?h=n.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(u=>{u.closest("[data-gallery]")||h.push(u)}),h.forEach((d,u)=>{let p=d.getAttribute("href");p||(p=d.getAttribute("data-modal-url")),e.push({href:p}),t===p&&(a=u)})}const r=document.activeElement;r?.blur(),e.length>0?(this.glightbox.setElements(e),this.glightbox.openAt(a)):(this.glightbox.setElements([{href:t}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s),r?.focus()})}blockInit(){const t={start:()=>{document.querySelectorAll(".is-block").forEach(e=>{e.hasAttribute("data--t")||e.setAttribute("data--t",e.style.top),e.hasAttribute("data--l")||e.setAttribute("data--l",e.style.left),e.hasAttribute("data--b")||e.setAttribute("data--b",e.style.bottom),e.hasAttribute("data--r")||e.setAttribute("data--r",e.style.right),e.hasAttribute("data--w")||e.setAttribute("data--w",e.style.width),e.hasAttribute("data--h")||e.setAttribute("data--h",e.style.height),e.removeAttribute("data-prev"),e.removeAttribute("data-fluid"),e.removeAttribute("data-fluid-val"),e.classList.remove("fluid"),e.style.transition=""})},apply:(e,a,r)=>{if(a&&e.getAttribute("data-prev")!==a+""){if(r||(e.style.transition="all 0.35s ease"),a!==1e4){if(e.setAttribute("data-breakpoint",a),e.hasAttribute("data--t-"+a)){let n=e.getAttribute("data--t-"+a);e.style.top=n}if(e.hasAttribute("data--l-"+a)){let n=e.getAttribute("data--l-"+a);e.style.left=n}if(e.hasAttribute("data--b-"+a)){let n=e.getAttribute("data--b-"+a);e.style.bottom=n}if(e.hasAttribute("data--r-"+a)){let n=e.getAttribute("data--r-"+a);e.style.right=n}if(e.hasAttribute("data--w-"+a)){let n=e.getAttribute("data--w-"+a);e.style.width=n}if(e.hasAttribute("data--h-"+a)){let n=e.getAttribute("data--h-"+a);e.style.height=n}if(e.hasAttribute("data--transform-"+a)){let n=e.getAttribute("data--transform-"+a);e.style.transform=n,e.setAttribute("data--transform-val",a)}}else{if(e.removeAttribute("data-breakpoint"),e.hasAttribute("data--t")){let n=e.getAttribute("data--t");e.style.top=n}if(e.hasAttribute("data--l")){let n=e.getAttribute("data--l");e.style.left=n}if(e.hasAttribute("data--b")){let n=e.getAttribute("data--b");e.style.bottom=n}if(e.hasAttribute("data--r")){let n=e.getAttribute("data--r");e.style.right=n}if(e.hasAttribute("data--w")){let n=e.getAttribute("data--w");e.style.width=n}if(e.hasAttribute("data--h")){let n=e.getAttribute("data--h");e.style.height=n}if(e.hasAttribute("data--transform")){let n=e.getAttribute("data--transform");e.style.transform=n,e.setAttribute("data--transform-val","")}}e.setAttribute("data-prev",a),setTimeout(()=>{r||(e.style.transition="")},400)}},applyFluid:(e,a)=>{e.classList.toggle("fluid",a==="yes"),e.setAttribute("data-fluid",a)},resize:e=>{const a=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){let p=h[d].name.match(/^data--h-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,u)=>u-d);for(let d=0;d<n.length;d++){const u=n[d];if(d===0){if(a>u){let p=r.getAttribute("data--h");p?r.style.height=p:r.style.height=""}}else{const p=n[d-1];if(p>=a&&a>u){let b=r.getAttribute("data--h-"+p);b&&(r.style.height=b)}}}if(n.length>0&&n[n.length-1]>=a){const u=n[n.length-1];let p=r.getAttribute("data--h-"+u);p&&(r.style.height=p)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>a&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),t.applyFluid(r,"yes"));let d=r.getAttribute("data-fluid-val");d&&parseInt(d)+0<=a&&r.classList.contains("fluid")&&t.applyFluid(r,"no")}let n=[];const h=r.attributes;for(let d=0;d<h.length;d++){const u=h[d].name;let p=u.match(/^data--t-(\d+)$/);if(p){const b=parseInt(p[1],10);n.push(b)}if(p=u.match(/^data--w-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}if(p=u.match(/^data--transform-(\d+)$/),p){const b=parseInt(p[1],10);n.push(b)}}n=[...new Set(n)],n.sort((d,u)=>u-d);for(let d=0;d<n.length;d++){const u=n[d];if(d===0)a>u&&t.apply(r,1e4,e);else{const p=n[d-1];p>=a&&a>u&&t.apply(r,p,e)}}if(n.length>0){const d=n[n.length-1];d>=a&&t.apply(r,d,e)}})},render:()=>{t.start(),t.resize(!0)}},s=((e,a)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>e(...n),a)}})(()=>{t.resize()},0);window.addEventListener("resize",s),t.start(),t.resize(!0),this.Block=t}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)}),this.pluginManager.destroy(),this.initialized=!1,this.emit("destroy")}}return ki})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovastudio/contentbox-runtime-base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"description": "Runtime libraries (base) for ContentBox generated content",
|
|
6
6
|
"main": "dist/contentbox-runtime-base.esm.js",
|
|
7
7
|
"module": "dist/contentbox-runtime-base.esm.js",
|