@fiddle-digital/string-tune 1.1.19 → 1.1.21

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.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Nt=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Zt=Object.prototype.hasOwnProperty;var te=(l,e)=>{for(var t in e)Nt(l,t,{get:e[t],enumerable:!0})},ee=(l,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Jt(e))!Zt.call(l,i)&&i!==t&&Nt(l,i,{get:()=>e[i],enumerable:!(r=Gt(e,i))||r.enumerable});return l};var re=l=>ee(Nt({},"__esModule",{value:!0}),l);var pe={};te(pe,{StringAnchor:()=>bt,StringCursor:()=>dt,StringData:()=>R,StringDelayLerpTracker:()=>Ct,StringFPSTracker:()=>wt,StringForm:()=>Dt,StringGlide:()=>vt,StringLazy:()=>mt,StringLerp:()=>yt,StringLerpTracker:()=>Lt,StringLoading:()=>ht,StringMagnetic:()=>ut,StringModule:()=>g,StringObject:()=>O,StringParallax:()=>St,StringPositionTracker:()=>Pt,StringProgress:()=>D,StringResponsive:()=>ft,StringScrollbar:()=>Et,StringSequence:()=>kt,StringSplit:()=>Tt,StringTune:()=>Wt,StringVideoAutoplay:()=>Ot,default:()=>Wt});module.exports=re(pe);var Q=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=e,this.context=t,this.onSettingsChange()}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),n=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),a=this.getStepDistance(o,n);this.isSettled(a)?this.snapToTarget():this.applyStep(o,n)}onSettingsChange(){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}setLerpFactor(e){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:e,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(e,t){return Math.hypot(e,t)}isSettled(e){return e<this.SETTLE_THRESHOLD}snapToTarget(){this.context.data.cursor.smoothedX=this.context.data.cursor.targetX,this.context.data.cursor.smoothedY=this.context.data.cursor.targetY,this.context.data.cursor.stepX=0,this.context.data.cursor.stepY=0}applyStep(e,t){this.context.data.cursor.smoothedX+=e,this.context.data.cursor.smoothedY+=t,this.context.data.cursor.stepX=e,this.context.data.cursor.stepY=t}};var I=class{constructor(){this.listeners={};this.stateEvents=new Set;this.lastPayloads={};this.stateEvents.add("screen:mobile"),this.stateEvents.add("screen:tablet"),this.stateEvents.add("screen:laptop"),this.stateEvents.add("screen:desktop"),this.stateEvents.add("start")}on(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&t(this.lastPayloads[i])}off(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(e,t){this.stateEvents.has(e)&&(this.lastPayloads[e]=t);let r=this.listeners[e];if(r)for(let i of r)i(t)}onProgress(e,t){this.on(`progress:${e}`,t)}emitProgress(e,t){this.emit(`progress:${e}`,t)}onInview(e,t){this.on(`object:inview:${e}`,t)}emitInview(e,t){this.emit(`object:inview:${e}`,t)}onScroll(e){this.on("scroll",e)}emitScroll(e){this.emit("scroll",e)}onUpdate(e){this.on("update",e)}emitUpdate(){this.emit("update")}clear(e){delete this.listeners[e]}clearAll(){this.listeners={}}};var G=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[]}register(e){e.type===1&&this.modules.push(e),e.type===2&&this.uiModules.push(e)}find(e){return this.modules.find(t=>t instanceof e)}onInit(){[...this.modules,...this.uiModules].forEach(e=>e.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(e=>e.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(e=>e.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(e=>e.onResize())}onMouseMove(e){[...this.modules,...this.uiModules].forEach(t=>t.onMouseMove(e))}onWheel(e){[...this.modules,...this.uiModules].forEach(t=>t.onWheel(e))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(e=>e.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(e,t){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(e,t))}destroy(){[...this.modules,...this.uiModules].forEach(e=>e.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var O=class{constructor(e,t){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new I;this.htmlElement=t,this.id=e}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(e=>{e.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(e=>{e.exitObject(this.id)})}remove(){this.modules.forEach(e=>{e.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(e){this.modules.includes(e)||this.modules.push(e)}};var J=class{constructor(e,t,r){this.data=e;this.modules=t;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(e){let t=`string-${this.globalId++}`,r="string-id";e.getAttribute("string-id")&&(t=e.getAttribute("string-id"),r="string-id"),e.getAttribute("data-string-id")&&(t=e.getAttribute("data-string-id"),r="data-string-id");let i=t&&this.objects.has(t)?this.objects.get(t):new O(t,e);e.setAttribute(r,i.id);let o=e.getAttribute("string")??e.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let n=this.getAllAttributes(e);this.modules.core.forEach(s=>{"setupCoreProperties"in s&&typeof s.setupCoreProperties=="function"&&s.setupCoreProperties(i,e,n)}),this.modules.core.forEach(s=>{s.canConnect(i)&&(s.initializeObject(this.globalId,i,e,n),s.calculatePositions(i,this.data.viewport.windowHeight),s.connectObject(i),s.addObject(i.id,i))}),this.connectQueue.filter(s=>s.id===i.id).forEach(s=>i.connects.push(s.element)),this.connectQueue=this.connectQueue.filter(s=>s.id!==i.id),this.initObservers(i,e),this.checkInviewForObject(i)}remove(e){let t=this.objects.get(e);t&&(t.events.clearAll(),t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect(),t.htmlElement.removeAttribute("string-inited"),t.leave(),t.remove(),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.push({id:e,element:t}),console.log(this.connectQueue.length)}getAllAttributes(e){let t={};return Array.from(e.attributes).forEach(r=>{t[r.name]=r.value}),t}initObservers(e,t){let r=e.getProperty("offset-top")??0,i=e.getProperty("offset-bottom")??0;e.getProperty("observer-progress")?.disconnect();let o=a=>{a.forEach(s=>{this.events.emit(`object:activate:${e.id}`,s.isIntersecting),s.isIntersecting?e.enter():e.leave()})},n=new IntersectionObserver(o,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});n.observe(t),e.setProperty("observer-progress",n)}observeDOM(){new MutationObserver(t=>{t.forEach(r=>{r.type==="childList"&&(r.removedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;this.isFixed(o)||(o.hasAttribute("string")&&this.handleRemoved(o),o.querySelectorAll("[string],[data-string]").forEach(n=>{this.isFixed(n)||this.handleRemoved(n)}))}),r.addedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;if(this.isFixed(o))return;o.hasAttribute("string")&&!o.hasAttribute("string-inited")&&this.add(o),o.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])").forEach(a=>this.add(a));let n=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");n&&(this.objects.has(n)?this.objects.get(n).connects.push(o):this.enqueueConnection(n,o))}),this.modules.all.forEach(i=>i.onDOMRebuild()))})}).observe(document.body,{childList:!0,subtree:!0})}handleRemoved(e){let t=e.getAttribute("string-id")??e.getAttribute("data-string-id");if(!t)return;let r=e.getAttribute("string-copy-from")??e.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(t)}onSettingsChange(){this.objects.forEach(e=>{this.modules.core.forEach(t=>{if(t.canConnect(e)){let r=this.getAllAttributes(e.htmlElement);t.initializeObject(this.globalId,e,e.htmlElement,r),t.calculatePositions(e,this.data.viewport.windowHeight),t.connectObject(e)}})})}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(e=>{this.checkInviewForObject(e)})}checkInviewForObject(e){let t=this.data.scroll.transformedCurrent,r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),o=e.getProperty("is-inview")??!1,n=t>=r&&t<=i,a=null;!o&&n?a=t<r?"enter-bottom":"enter-top":o&&!n&&(a=t<r?"exit-top":"exit-bottom"),n!==o&&(e.setProperty("is-inview",n),this.events.emit(`object:inview:${e.id}`,{inView:n,direction:a}),n?e.show():e.hide())}};var T=class{constructor(e){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()};this.document=document,this.context=e}set scrollDirection(e){this._scrollDirection=e,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(e){}onScroll(e){}disableScrollEvents(){}enableScrollEvents(){}triggerScrollRules(){this.scrollTriggerRules.forEach(e=>{(e.direction==="any"||this.isLastBottomScrollDirection&&e.direction==="forward")&&this.context.data.scroll.current>=e.offset?(e.onEnter?.(),e.toggleClass&&e.toggleClass.target.classList.add(e.toggleClass.className)):(e.onLeave?.(),e.toggleClass&&e.toggleClass.target.classList.remove(e.toggleClass.className))})}addScrollMark(e){this.scrollTriggerRules.push(e)}removeScrollMark(e){this.scrollTriggerRules=this.scrollTriggerRules.filter(t=>t.id!==e)}};var Z=class extends T{constructor(t){super(t);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let t=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=t,this.context.data.scroll.lerped=t,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(t){let r=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=r,this.context.data.scroll.target=r,this.context.data.scroll.transformedCurrent=r}onWheel(t){if(t.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=t.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,t.deltaY)),this.context.data.scroll.delta+=r}}};var tt=class extends T{constructor(t){super(t);this.name="disable";this.preventScroll=t=>{t.preventDefault()};this.preventKeyScroll=t=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(t.key)&&t.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}disableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}enableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var w={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var et=class extends T{constructor(t){super(t);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1}updateScrollDirection(t){if(this.isLastBottomScrollDirection=t,this.isBottomScrollDirection===null){this.isBottomScrollDirection=t;return}this.context.data.scroll.isScrollingDown=t,this.onChangeDirection(),document.documentElement.classList.toggle(w.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(w.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(w.SCROLL_FORWARD,t),document.documentElement.classList.toggle(w.SCROLL_BACKWARD,!t)}stopScroll(){this.context.data.scroll.lerped=0,this.context.data.scroll.delta=0,this.context.data.scroll.target=this.context.data.scroll.current,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(w.SCROLLING_BACKWARD,w.SCROLLING_FORWARD),this.isBottomScrollDirection=null}onFrame(){if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.context.data.scroll.current=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.target=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;return}if(this.context.data.scroll.delta!==0){this.scrollForce=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate,this.context.data.scroll.target=Math.min(Math.max(0,this.context.data.scroll.target+this.scrollForce),this.context.data.scroll.bottomPosition),this.context.data.scroll.delta-=this.scrollForce,this.context.data.scroll.lerped=(this.context.data.scroll.target-this.context.data.scroll.current)*this.context.data.scroll.speed;let t=Math.abs(this.context.data.scroll.lerped);this.context.data.scroll.lerped>0?this.context.data.scroll.current=Math.ceil(this.context.data.scroll.current+this.context.data.scroll.lerped):this.context.data.scroll.current=Math.floor(this.context.data.scroll.current+this.context.data.scroll.lerped),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),t<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate()))}}onWheel(t){if(t.deltaY!==0&&t.preventDefault(),this.wheelImpulse=t.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let r=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&r<0,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(t){this.isProg||(this.isScrollbarManipulation=!0)}};var rt=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new et(e)),this.modes.set("default",new Z(e)),this.modes.set("disable",new tt(e)),this.updateResponsiveMode()}setMobileMode(e){this.context.data.scroll.modeMobile=e,this.updateResponsiveMode()}setDesktopMode(e){this.context.data.scroll.modeDesktop=e,this.updateResponsiveMode()}updateResponsiveMode(){let t=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(t)}updatePosition(){this.modes.forEach(e=>{e.onCalcUpdate()})}setMode(e){if(!this.modes.has(e)){console.warn(`[ScrollManager] Unknown scroll mode: ${e}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=e,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(e){this.get().onScroll(e)}onWheel(e){this.get().onWheel(e)}bindEvents(e){this.modes.forEach(t=>{t.onScrollStart=e.onScrollStart,t.onScrollStop=e.onScrollStop,t.onChangeDirection=e.onDirectionChange})}addScrollMark(e){this.modes.forEach(t=>{t.addScrollMark(e)})}removeScrollMark(e){this.modes.forEach(t=>{t.removeScrollMark(e)})}};var it=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var ot=class{constructor(){this.threeInstance=null}};var st=class{constructor(){this.target=0;this.current=0;this.transformedCurrent=0;this.delta=0;this.lerped=0;this.displacement=0;this.isScrollingDown=!1;this.topPosition=0;this.bottomPosition=0;this.direction="vertical";this.elementContainer=document.documentElement;this.scrollContainer=window;this.container=document.body;this.mode="smooth";this.modeMobile="smooth";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var nt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var at=class{constructor(){this.windowWidth=0;this.windowHeight=0;this.contentWidth=0;this.contentHeight=0;this.scaleWidth=1;this.scaleHeight=1;this.transformScale=1;this.baseRem=16}};var R=class{constructor(){this.scroll=new st;this.viewport=new at;this.cursor=new it;this.render=new ot;this.time=new nt}};var g=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.events,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(t,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let o=i.top,n=i.height;return o+n-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(t,r,i)=>i.height},{key:"half-width",type:"number",fallback:(t,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(t,r,i)=>i.height/2},{key:"enter-el",type:"string",fallback:this.settings["enter-el"]},{key:"enter-vp",type:"string",fallback:this.settings["enter-vp"]},{key:"exit-el",type:"string",fallback:this.settings["exit-el"]},{key:"exit-vp",type:"string",fallback:this.settings["exit-vp"]}]}get type(){return this._type}initializeObject(e,t,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:n,type:a,fallback:s,transform:c}of this.attributesToMap){let u=typeof s=="function"?s(r,t,o):s,p=this.tools.domAttribute.process({element:r,key:n,fallback:i[n]??this.settings[n]??u}),d=this.parseAttribute(p,a,{element:r,boundingRect:o,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});c&&(d=c(d)),t.setProperty(n,d)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),o=e.getProperty("offset-bottom"),n=e.getProperty("offset-top"),a=e.getProperty("enter-el"),s=e.getProperty("enter-vp"),c=e.getProperty("exit-el"),u=e.getProperty("exit-vp"),p=0,d=0,h=0,b=0;a==="top"&&s==="top"||a==="left"&&s==="left"?(h=-t+1,p=r-o):a==="top"&&s==="bottom"||a==="left"&&s==="right"?p=r-t-o:a==="bottom"&&s==="top"||a==="right"&&s==="left"?(h=-t-i+1,p=r+i-o):(a==="bottom"&&s==="bottom"||a==="right"&&s==="right")&&(h=-i+1,p=r-t+i-o),c==="top"&&u==="top"||c==="left"&&u==="left"?(b=-i+1,d=r+n):c==="top"&&u==="bottom"||c==="left"&&u==="right"?(b=-t-i+1,d=r-t+n):c==="bottom"&&u==="top"||c==="right"&&u==="left"?d=r+i+n:(c==="bottom"&&u==="bottom"||c==="right"&&u==="right")&&(b=-t+1,d=r-t+i+n),e.setProperty("start-bias",h),e.setProperty("end-bias",b),e.setProperty("start-position",p-this.data.scroll.topPosition),e.setProperty("end-position",d-this.data.scroll.topPosition),e.setProperty("difference-position",d-p);let m=e.getProperty("inview-top")??0,f=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",e.getProperty("start-position")+m),e.setProperty("inview-end-position",e.getProperty("end-position")+f)}parseAttribute(e,t,r={}){if(e==null)return null;if(typeof t=="object"&&t.type==="enum")return t.values.includes(e)?e:t.values[0];switch(t){case"number":return parseFloat(e);case"boolean":return e===""||e==="true";case"json":try{return JSON.parse(e)}catch{return null}case"tuple":return e.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:e});case"color":return this.tools.colorParser.process({value:e});case"dimension":return e=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem}):0;default:return e}}canConnect(e){return e.keys.includes(this.htmlKey)}connectObject(e){e.connect(this),this.onObjectConnected(e)}enterObject(e,t){this.objectMap.has(e)||(this.objectMap.set(e,t),this.objects.push(t))}exitObject(e){let t=this.objectMap.get(e);if(!t)return;this.objectMap.delete(e);let r=this.objects.indexOf(t);r!==-1&&this.objects.splice(r,1)}addObject(e,t){this.objectMapOnPage.has(e)||(this.objectMapOnPage.set(e,t),this.objectsOnPage.push(t))}removeObject(e){let t=this.objectMapOnPage.get(e);if(!t)return;this.objectMapOnPage.delete(e);let r=this.objectsOnPage.indexOf(t);r!==-1&&this.objectsOnPage.splice(r,1)}onObjectConnected(e){}applyToElementAndConnects(e,t){e.getProperty("self-disable")==!1&&t(e.htmlElement),e.connects.forEach(t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onResize(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var A=class{process({element:e}){return e.getBoundingClientRect()}};var H=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var F=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var L=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,n,a,s,c,u]=i,p=o*s-n*a;return{width:t.width/(o||1),height:t.height/(s||1),left:(t.left*s-t.top*a+a*u-c*s)/p,top:(-t.left*n+t.top*o+c*n-o*u)/p}}return t}};var N=class{constructor(e=new L){this.transformTool=e}process({element:e,container:t=document.body}){let r;try{r=t.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:e});return{top:i.top-r.top,left:i.left-r.left}}};var B=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var V=class{process({value:e,element:t,viewportHeight:r,baseRem:i,boundingRect:o}){let n=e.split("|").map(s=>s.trim()).filter(Boolean),a=0;for(let s of n){let c=s,u=!1;c.startsWith("-")&&(u=!0,c=c.slice(1));let p=0;if(c==="selfHeight")p=t.offsetHeight;else if(c.endsWith("px"))p=parseFloat(c);else if(c.endsWith("%"))p=parseFloat(c)/100*r;else if(c.endsWith("rem"))p=parseFloat(c)*i;else if(c.endsWith("sh"))p=parseFloat(c)*o.height/100;else continue;a+=u?-p:p}return a}};var W=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(e<t)return o;if(e>1&&(e=1),e<=r){let n=(e-t)/(r-t);return o-n*(o-i)}return i}};var $=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var q=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let o=t.slice(1);o.length===3&&(o=o.split("").map(u=>u+u).join(""));let n=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),s=parseInt(o.slice(4,6),16),c=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:n,g:a,b:s,a:c}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[o,n,a,s=1]=r[1].split(",").map(c=>parseFloat(c.trim()));return{r:o,g:n,b:a,a:s}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[o,n,a,s="1"]=i[1].split(",").map(d=>d.trim()),[c,u,p]=this.hslToRgb(parseFloat(o),parseFloat(n),parseFloat(a));return{r:c,g:u,b:p,a:parseFloat(s)}}return{r:0,g:0,b:0,a:0}}hslToRgb(e,t,r){e=e/360,t=parseFloat(t.toString())/100,r=parseFloat(r.toString())/100;let i=(u,p,d)=>(d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(p-u)*6*d:d<1/2?p:d<2/3?u+(p-u)*(2/3-d)*6:u),o=r<.5?r*(1+t):r+t-r*t,n=2*r-o,a=Math.round(i(n,o,e+1/3)*255),s=Math.round(i(n,o,e)*255),c=Math.round(i(n,o,e-1/3)*255);return[a,s,c]}};var z=class{constructor(){this.namedCurves={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}}process({easing:e}){let t=e.trim();if(this.namedCurves[t])return this.cubicBezier(...this.namedCurves[t]);let r=t.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(r){let[i,o,n,a]=r.slice(1).map(Number);return this.cubicBezier(i,o,n,a)}return i=>i}cubicBezier(e,t,r,i){let o=3*e,n=3*(r-e)-o,a=1-o-n,s=3*t,c=3*(i-t)-s,u=1-s-c;function p(m){return((a*m+n)*m+o)*m}function d(m){return((u*m+c)*m+s)*m}function h(m){return(3*a*m+2*n)*m+o}function b(m,f=1e-5){let v,M,y=m,S,x,C;for(C=0;C<8;C++){if(S=p(y)-m,Math.abs(S)<f)return y;if(x=h(y),Math.abs(x)<1e-6)break;y=y-S/x}for(v=0,M=1,y=m;v<M;){if(S=p(y)-m,Math.abs(S)<f)return y;S>0?M=y:v=y,y=(M+v)/2}return y}return function(m){return d(b(m))}}};var _=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var Y=class{process({from:e,to:t,progress:r}){return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:e.a+(t.a-e.a)*r}}};var U=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var X=class{process({value:e}){let r=e?.trim();if(!r||r==="none")return 1;try{if(r.startsWith("matrix(")){let i=r.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let o=parseFloat(i[1].trim());if(!isNaN(o))return o}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var lt=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let o=i.trim();if(!o)return;let n=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(n){let a=n[1]||"",s=n[2],c=a+s,p=(n[4]||"").split(";").map(h=>h.trim()).filter(h=>h.length>0),d=this.parseParamsArray(p);switch(c){case"line":t.line.push(d);break;case"word":t.word.push(d);break;case"char":t.char.push(d);break;case"charLine":t.charLine.push(d);break;case"charWord":t.charWord.push(d);break;case"wordLine":t.wordLine.push(d);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${c}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),t}parseParamsArray(e){let t={align:"start"};return e.forEach(r=>{if(r==="abs")t.abs=!0;else if(r.startsWith("random")){t.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(t.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(t.align=r)}),t}};var j=class{process({value:e}){let t=[],r="",i=0;for(let o=0;o<e.length;o++){let n=e[o];n==="("&&i++,n===")"&&i--,n==="|"&&i===0?(r.trim()&&t.push(r.trim()),r=""):r+=n}return r.trim()&&t.push(r.trim()),t.map(o=>{let n=o.match(/^(\w+)(?:\((.*)\))?$/);if(!n)return{key:o};let[,a,s]=n;return s?{key:a,params:s.split(",").map(c=>c.trim())}:{key:a}})}};var ct=class{constructor(){this.validators={required:e=>e!=null&&String(e).trim()!=="",email:e=>typeof e=="string"&&/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e),min:(e,t)=>typeof e=="string"&&e.length>=Number(t),max:(e,t)=>typeof e=="string"&&e.length<=Number(t),phone:e=>typeof e=="string"&&/^(\+?\d{1,3}[-.\s]?)?(\(?\d{1,4}\)?[-.\s]?)?[\d\-.\s]{5,15}$/.test(e),number:e=>typeof e=="string"&&/^-?\d+(\.\d+)?$/.test(e),checked:e=>e===!0||e==="true"||e===1||e==="1",url:e=>typeof e=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?$/.test(e)}}process({rules:e,value:t}){let r=[];for(let i of e){let o=this.validators[i.key];if(!o)continue;o(t,...i.params||[])||r.push(this.getErrorMessage(i.key,i.params))}return{valid:r.length===0,errors:r}}getErrorMessage(e,t){switch(e){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${t?.[0]} characters`;case"max":return`Maximum ${t?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";default:return"Invalid value"}}};var pt=class{constructor(){this.domAttribute=new H;this.recordAttribute=new F;this.transformNullify=new L;this.boundingClientRect=new A;this.relativePosition=new N(this.transformNullify);this.unitParser=new V;this.lerp=new B;this.adaptiveLerp=new W;this.originParser=new $;this.colorParser=new q;this.validation=new ct;this.easingFunction=new z;this.magneticPull=new _;this.lerpColor=new Y;this.lerpVector=new U;this.transformScaleParser=new X;this.optionsParser=new lt;this.ruleParser=new j}};var dt=class extends g{constructor(t){super(t);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",this.cursor=document.querySelector("[string-cursor],[data-string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content],[data-string-cursor-content]"),this.attributesToMap=[...this.attributesToMap,{key:"target-disable",type:"boolean",fallback:this.settings["target-disable"]},{key:"target-style-disable",type:"boolean",fallback:this.settings["target-style-disable"]},{key:"target-class",type:"string",fallback:this.settings["target-class"]},{key:"cursor-class",type:"string",fallback:this.settings["cursor-class"]},{key:"alignment",type:{type:"enum",values:["start","center","end"]},fallback:this.settings.alignment},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}]}initializeObject(t,r,i,o){super.initializeObject(t,r,i,o),r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0),r.setProperty("is-mouse-over",!1),r.setProperty("is-mouse-move",!1)}onFrame(t){requestAnimationFrame(()=>{this.objects.forEach(a=>{let s=a.getProperty("is-mouse-over"),c=a.getProperty("cursor-target-disable"),u=a.getProperty("lerp")??.15;if(s&&!c){let p=a.htmlElement.getBoundingClientRect(),d=this.data.cursor.targetX,h=this.data.cursor.targetY,b=d-p.left,m=h-p.top,f=a.getProperty("mouse-pixel-x")??0,v=a.getProperty("mouse-pixel-y")??0,M=f-b,y=v-m;if(M*M+y*y>1e-4){(a.getProperty("is-mouse-move")??!1)||(a.setProperty("is-mouse-move",!0),a.setProperty("mouse-pixel-x",b),a.setProperty("mouse-pixel-y",m),a.setProperty("mouse-x",b),a.setProperty("mouse-y",m),f=b,v=m,this.events.emit(`cursor:start:${a.id}`,null));let C=this.tools.lerp.process({from:f,to:b,progress:u}),Qt=this.tools.lerp.process({from:v,to:m,progress:u}),Rt=f+C,At=v+Qt;a.setProperty("mouse-pixel-x",Rt),a.setProperty("mouse-pixel-y",At);let $t=a.getProperty("alignment")??"center",Ht=this.calculateOffset($t,Rt,p.width),Ft=this.calculateOffset($t,At,p.height);a.setProperty("mouse-x",Ht),a.setProperty("mouse-y",Ft),this.setMouseCoordinates(a,Ht,Ft),this.events.emit(`cursor:move:${a.id}`,{x:Ht,y:Ft}),this.events.emit(`cursor:pixel:${a.id}`,{x:Rt,y:At})}else a.setProperty("mouse-pixel-x",b),a.setProperty("mouse-pixel-y",m),this.events.emit(`cursor:end:${a.id}`,null)}else{let p=a.getProperty("mouse-x")??0,d=a.getProperty("mouse-y")??0;if(p!==0||d!==0){a.setProperty("is-mouse-move",!1);let h=a.htmlElement.getBoundingClientRect(),b=a.getProperty("half-width")??h.width/2,m=a.getProperty("half-height")??h.height/2,f=this.calculateOffset("center",b,h.width),v=this.calculateOffset("center",m,h.height),M=p+this.tools.lerp.process({from:p,to:f,progress:u}),y=d+this.tools.lerp.process({from:d,to:v,progress:u});a.setProperty("mouse-x",M),a.setProperty("mouse-y",y),Math.abs(M)<.001&&Math.abs(y)<.001&&(a.setProperty("mouse-x",0),a.setProperty("mouse-y",0),a.setProperty("mouse-pixel-x",0),a.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(a,M,y)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:n}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:n}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",n.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))})}onObjectConnected(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(t)}),t.setProperty("onEnterEvent",this.onEnterObject.bind(this)),t.events.on("enter",t.getProperty("onEnterEvent")),t.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),t.events.on("leave",t.getProperty("onLeaveEvent"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){this.overCount--,t.setProperty("is-mouse-over",!1),t.getProperty("timeoutId")&&(clearTimeout(t.getProperty("timeoutId")),t.setProperty("timeoutId",null));let r=this.getCursorClass(t);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}setMouseCoordinates(t,r,i){t.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(t,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}calculateOffset(t,r,i){switch(t){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var ut=class extends g{constructor(e){super(e),this.htmlKey="magnetic",this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.setProperty("is-magneting",!1),t.setProperty("magnetic-target-x",0),t.setProperty("magnetic-target-y",0),t.setProperty("magnetic-x",0),t.setProperty("magnetic-y",0),t.setProperty("lerp",.1)}onMouseMove(e){this.objects.forEach(t=>{let i=t.htmlElement.getBoundingClientRect(),o=i.left+(t.getProperty("half-width")??0),n=i.top+(t.getProperty("half-height")??0),a=e.clientX-o,s=e.clientY-n,c=Math.sqrt(a**2+s**2),u=t.getProperty("radius")??0,p=t.getProperty("strength")??0,d=this.tools.magneticPull.process({distance:c,radius:u,strength:p});t.setProperty("magnetic-target-x",a*d),t.setProperty("magnetic-target-y",s*d),d>0&&t.setProperty("is-magneting",!0)})}onFrame(e){this.objects.forEach(t=>{if(t.getProperty("is-magneting")){let r=t.getProperty("magnetic-x")??0,i=t.getProperty("magnetic-y")??0,o=t.getProperty("lerp")??0,n=t.getProperty("magnetic-target-x")??0,a=t.getProperty("magnetic-target-y")??0,s=this.tools.lerp.process({from:r,to:n,progress:o}),c=this.tools.lerp.process({from:i,to:a,progress:o});s>-.01&&s<.01&&(s=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),c>-.01&&c<.01&&(c=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=s,i+=c,t.setProperty("magnetic-x",r),t.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${t.id}`,{x:r,y:i}),this.applyToElementAndConnects(t,u=>{u.style.setProperty("--magnetic-x",r.toString()),u.style.setProperty("--magnetic-y",i.toString())}),(t.getProperty("magnetic-target-x")==r||t.getProperty("magnetic-target-y")==i)&&t.setProperty("is-magneting",!1)}})}};var mt=class extends g{constructor(t){super(t);this.isStartLoaded=!1;this.loadingCount=0;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.loadImage(r)),this.isStartLoaded=!0}onObjectConnected(t){if(this.loadingCount++,this.isStartLoaded){let r=t.htmlElement;this.loadImage(r)}}async loadImage(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});if(r)try{t.classList.add("lazyLoad"),t.src=r,t.addEventListener("load",()=>{t.classList.add("-loaded")}),await this.setAspectRatio(t,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(t,r){return new Promise((i,o)=>{let n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.setRequestHeader("Range","bytes=0-"),n.onload=()=>{if(n.status===200||n.status===206){let a=new Blob([n.response]),s=new Image;s.onload=()=>{t.style.aspectRatio=`${s.width} / ${s.height}`,URL.revokeObjectURL(s.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},s.onerror=()=>{URL.revokeObjectURL(s.src),this.loadingCount--,o(new Error("Image failed to decode"))},s.src=URL.createObjectURL(a)}else o(new Error("Image request failed"))},n.onerror=()=>o(new Error("XHR error")),n.send()})}};var ht=class extends g{constructor(t){super(t);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var gt=class extends g{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var k=class{constructor(e){this.min=void 0;this.max=void 0;this.enable=!0;this.min=e?.min,this.max=e?.max,this.enable=e?.enable??!0}setEnable(e=!0){this.enable=e}setRange(e,t){this.min=e??void 0,this.max=t??void 0}get mediaQuery(){let e="screen";return this.min&&(e+=` and (min-width: ${this.min}px)`),this.max&&(e+=` and (max-width: ${this.max}px)`),e}},ft=class extends g{constructor(t){super(t);this.queries={0:new k({max:359}),1:new k({min:360,max:1079}),2:new k({min:1080,max:1365}),3:new k({min:1366})};this.isMobileMedia=!1;this.isTabletMedia=!1;this.isLaptopMedia=!1;this.isDesktopMedia=!1;this.matchMedias={0:window.matchMedia(this.queries[0].mediaQuery),1:window.matchMedia(this.queries[1].mediaQuery),2:window.matchMedia(this.queries[2].mediaQuery),3:window.matchMedia(this.queries[3].mediaQuery)};this._type=2}onConnect(){}onInit(){if(this.settings!=null&&this.settings.settings!=null){let t=this.settings.settings;t.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,t.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(t.tablet.min==null?null:t.tablet.min,t.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.laptop.min==null?null:t.laptop.min,t.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.desktop.min==null?null:t.desktop.min,t.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let t=this.matchMedias[0].matches&&this.queries[0].enable,r=this.matchMedias[1].matches&&this.queries[1].enable,i=this.matchMedias[2].matches&&this.queries[2].enable,o=this.matchMedias[3].matches&&this.queries[3].enable;this.isMobileMedia!=t&&this.events.emit("screen:mobile",t),this.isTabletMedia!=r&&this.events.emit("screen:tablet",r),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=o&&this.events.emit("screen:desktop",o),this.isMobileMedia=t,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=o,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(a=>{let s=!1;a.hasAttribute("string-mobile")&&t&&(s=!0),a.hasAttribute("string-tablet")&&r&&(s=!0),a.hasAttribute("string-laptop")&&i&&(s=!0),a.hasAttribute("string-desktop")&&o&&(s=!0),s?a.style.display=null:a.style.display="none"})}};var bt=class extends g{constructor(e){super(e),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:t=>{let[r,i]=t,o=this.tools.originParser.process({value:r}),n=this.tools.originParser.process({value:i});return{x:o,y:n}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var ie=.05,oe=.01,qt=1,se=-1,ne=1,vt=class extends g{constructor(t){super(t);this.previousLerp=0;this.displacement=0;this.acceleration=0;this.velocityMultiplier=.00125;this.isInitialScroll=!0;this.baseVelocityMultiplier=.00125;this.reducedVelocityMultiplier=this.baseVelocityMultiplier/20;this.negativeVelocityMultiplier=-1e-4;this.maxDisplacementValue=0;this.setupItem=t=>{let r=t.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${t.id}`,i);let o=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=o};this.onUpdateDesktopEvent=()=>{for(let t=0;t<this.objects.length;t++){let r=this.objects[t];this.setupItem(r)}};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;this.htmlKey="glide",this.baseVelocityMultiplier=this.settings["glide-base-velocity"]??this.baseVelocityMultiplier,this.reducedVelocityMultiplier=this.settings["glide-reduce-velocity"]??this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=this.settings["glide-negative-velocity"]??this.negativeVelocityMultiplier,this.attributesToMap=[...this.attributesToMap,{key:"glide",type:"number",fallback:this.settings.glide}]}calcExpanderFactor(t){let r=t?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.viewport.windowHeight*.1,this.onUpdateEvent=this.onUpdateDesktopEvent):(this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState(),this.objects.forEach(t=>{this.setupItem(t)}))}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0;for(let t=0;t<this.objects.length;t++){let r=this.objects[t],i="translate3d(0, 0px, 0)";r.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(qt,this.acceleration+ie),this.displacement=Math.max(oe,Math.min(qt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(ne,Math.max(se,this.data.scroll.lerped*this.displacement*this.acceleration)),this.objects.forEach(r=>{this.applyToElementAndConnects(r,i=>{i.style.setProperty("--glide",this.data.scroll.displacement.toString())})}),this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}};var yt=class extends g{constructor(e){super(e),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(e=>{this.setLerpValue(e,0)})}onFrame(e){let t=e.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,t)})}setLerpValue(e,t){this.events.emit(`object:lerp:${e.id}`,t),e.htmlElement.style.setProperty("--lerp",t.toString())}};var D=class extends g{constructor(e){super(e),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i)}onScroll(e){super.onScroll(e),this.objects.forEach(t=>{this.setUpObject(t)})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("setUpObject",this.setUpObject.bind(this)),e.events.on("enter",e.getProperty("setUpObject"))}setUpObject(e){let t=e.getProperty("start-position"),r=e.getProperty("difference-position"),i=e.getProperty("key"),o=e.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-t)/r)));if(e.getProperty("progress")!==o){this.events.emit(`object:progress:${e.id}`,o),e.setProperty("progress",o);let n=o.toString();this.applyToElementAndConnects(e,a=>{a.style.setProperty(i,n)})}}};var St=class extends D{constructor(t){super(t);this.handleScrollDesktop=()=>{this.objects.forEach(t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,o=t.getProperty("parallax-position-start")??0,n=t.getProperty("parallax-position-end")??1,a=t.getProperty("parallax-sign")??1,s=this.data.viewport.windowHeight,c=a*i*(s*o+r*s*n);this.events.emit(`object:parallax:${t.id}`,c);let u=`translate3d(0, ${c}px, 0)`;this.applyToElementAndConnects(t,p=>{p.style.transform=u})})};this.handleScrollMobile=()=>{};this.scrollHandler=this.handleScrollDesktop;this.htmlKey="parallax",this.attributesToMap=[...this.attributesToMap,{key:"parallax",type:"number",fallback:this.settings.parallax},{key:"parallax-bias",type:"number",fallback:this.settings["parallax-bias"]}]}initializeObject(t,r,i,o){super.initializeObject(t,r,i,o);let n=r.getProperty("parallax-bias")??0,a=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",a),r.setProperty("parallax-position-start",-.5+.5*n),r.setProperty("parallax-position-end",.5+.5*(1-n));let s=this.data.viewport.windowHeight;r.setProperty("offset-top",a*s),r.setProperty("offset-bottom",a*s)}onScroll(t){super.onScroll(t),this.scrollHandler()}onResize(){let t=window.innerWidth>1080;this.scrollHandler=t?this.handleScrollDesktop:this.handleScrollMobile,t?this.handleScrollDesktop():this.objects.forEach(r=>{let i="translate3d(0, 0px, 0)";this.applyToElementAndConnects(r,o=>{o.style.transform=i})})}};var Mt=class{constructor(e,t,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth,r=t/e*t;this.thumb.style.setProperty("--size",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startY=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startY,r=this.startScrollPosition+t/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=r,this.data.scroll.target=r,window.scrollTo(0,r),this.updateThumb()}};var xt=class{constructor(e,t,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight,r=t/e*t;this.thumb.style.setProperty("--height",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startCoordinate=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startCoordinate,r=this.startScrollPosition+t/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,o=Math.max(0,Math.min(r,i));this.data.scroll.current=o,this.data.scroll.target=o,window.scrollTo(0,o),this.updateThumb()}};var Et=class extends g{constructor(t){super(t);this.isDragging=!1;this.scrollMode="smooth";this.mouseUpEventBind=this.mouseUpEvent.bind(this),this.mouseDownEventBind=this.mouseDownEvent.bind(this),this.mouseMoveEventBind=this.mouseMoveEvent.bind(this)}destructor(){document.removeEventListener("mouseup",this.mouseUpEventBind),this.thumb.removeEventListener("mousedown",this.mouseDownEventBind),document.removeEventListener("mousemove",this.mouseMoveEventBind)}onInit(){this.createScrollbar(),this.updateThumb(),this.addCustomStyles(),document.addEventListener("mouseup",this.mouseUpEventBind),this.thumb.addEventListener("mousedown",this.mouseDownEventBind),document.addEventListener("mousemove",this.mouseMoveEventBind),document.documentElement.classList.add("-no-scrollbar")}onScroll(t){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let t=document.createElement("style");t.textContent=`
1
+ "use strict";var Vt=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Jt=Object.prototype.hasOwnProperty;var te=(c,e)=>{for(var t in e)Vt(c,t,{get:e[t],enumerable:!0})},ee=(c,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zt(e))!Jt.call(c,i)&&i!==t&&Vt(c,i,{get:()=>e[i],enumerable:!(r=Gt(e,i))||r.enumerable});return c};var re=c=>ee(Vt({},"__esModule",{value:!0}),c);var pe={};te(pe,{StringAnchor:()=>Mt,StringCursor:()=>gt,StringData:()=>N,StringDelayLerpTracker:()=>It,StringFPSTracker:()=>Ot,StringForm:()=>Ft,StringGlide:()=>xt,StringLazy:()=>bt,StringLerp:()=>Et,StringLerpTracker:()=>kt,StringLoading:()=>vt,StringMagnetic:()=>ft,StringModule:()=>g,StringObject:()=>R,StringParallax:()=>Tt,StringPositionTracker:()=>Dt,StringProgress:()=>H,StringResponsive:()=>St,StringScrollbar:()=>Lt,StringSequence:()=>Ht,StringSplit:()=>Pt,StringTune:()=>zt,StringVideoAutoplay:()=>At,default:()=>zt});module.exports=re(pe);var tt=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=e,this.context=t,this.onSettingsChange()}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),s=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),a=this.getStepDistance(o,s);this.isSettled(a)?this.snapToTarget():this.applyStep(o,s)}onSettingsChange(){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}setLerpFactor(e){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:e,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(e,t){return Math.hypot(e,t)}isSettled(e){return e<this.SETTLE_THRESHOLD}snapToTarget(){this.context.data.cursor.smoothedX=this.context.data.cursor.targetX,this.context.data.cursor.smoothedY=this.context.data.cursor.targetY,this.context.data.cursor.stepX=0,this.context.data.cursor.stepY=0}applyStep(e,t){this.context.data.cursor.smoothedX+=e,this.context.data.cursor.smoothedY+=t,this.context.data.cursor.stepX=e,this.context.data.cursor.stepY=t}};var D=class{constructor(){this.listeners={};this.stateEvents=new Set;this.lastPayloads={};this.stateEvents.add("screen:mobile"),this.stateEvents.add("screen:tablet"),this.stateEvents.add("screen:laptop"),this.stateEvents.add("screen:desktop"),this.stateEvents.add("start")}on(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&t(this.lastPayloads[i])}off(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(e,t){this.stateEvents.has(e)&&(this.lastPayloads[e]=t);let r=this.listeners[e];if(r)for(let i of r)i(t)}onProgress(e,t){this.on(`progress:${e}`,t)}emitProgress(e,t){this.emit(`progress:${e}`,t)}onInview(e,t){this.on(`object:inview:${e}`,t)}emitInview(e,t){this.emit(`object:inview:${e}`,t)}onScroll(e){this.on("scroll",e)}emitScroll(e){this.emit("scroll",e)}onUpdate(e){this.on("update",e)}emitUpdate(){this.emit("update")}clear(e){delete this.listeners[e]}clearAll(){this.listeners={}}};var et=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[]}register(e){e.type===1&&this.modules.push(e),e.type===2&&this.uiModules.push(e)}find(e){return this.modules.find(t=>t instanceof e)}onInit(){[...this.modules,...this.uiModules].forEach(e=>e.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(e=>e.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(e=>e.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(e=>e.onResize())}onMouseMove(e){[...this.modules,...this.uiModules].forEach(t=>t.onMouseMove(e))}onWheel(e){[...this.modules,...this.uiModules].forEach(t=>t.onWheel(e))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(e=>e.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(e,t){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(e,t))}destroy(){[...this.modules,...this.uiModules].forEach(e=>e.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var R=class{constructor(e,t){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new D;this.htmlElement=t,this.id=e}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(e=>{e.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(e=>{e.exitObject(this.id)})}remove(){this.modules.forEach(e=>{e.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(e){this.modules.includes(e)||this.modules.push(e)}};var rt=class{constructor(e,t,r){this.data=e;this.modules=t;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(e){let t=`string-${this.globalId++}`,r="string-id";e.getAttribute("string-id")&&(t=e.getAttribute("string-id"),r="string-id"),e.getAttribute("data-string-id")&&(t=e.getAttribute("data-string-id"),r="data-string-id");let i=t&&this.objects.has(t)?this.objects.get(t):new R(t,e);e.setAttribute(r,i.id);let o=e.getAttribute("string")??e.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(e);this.modules.core.forEach(n=>{"setupCoreProperties"in n&&typeof n.setupCoreProperties=="function"&&n.setupCoreProperties(i,e,s)}),this.modules.core.forEach(n=>{n.canConnect(i)&&(n.initializeObject(this.globalId,i,e,s),n.calculatePositions(i,this.data.viewport.windowHeight),n.connectObject(i),n.addObject(i.id,i))}),this.connectQueue.filter(n=>n.id===i.id).forEach(n=>i.connects.push(n.element)),this.connectQueue=this.connectQueue.filter(n=>n.id!==i.id),this.initObservers(i,e),this.checkInviewForObject(i)}remove(e){let t=this.objects.get(e);t&&(t.events.clearAll(),t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect(),t.htmlElement.removeAttribute("string-inited"),t.leave(),t.remove(),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.push({id:e,element:t}),console.log(this.connectQueue.length)}getAllAttributes(e){let t={};return Array.from(e.attributes).forEach(r=>{t[r.name]=r.value}),t}initObservers(e,t){let r=e.getProperty("offset-top")??0,i=e.getProperty("offset-bottom")??0;e.getProperty("observer-progress")?.disconnect();let o=a=>{a.forEach(n=>{this.events.emit(`object:activate:${e.id}`,n.isIntersecting),n.isIntersecting?e.enter():e.leave()})},s=new IntersectionObserver(o,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});s.observe(t),e.setProperty("observer-progress",s)}observeDOM(){new MutationObserver(t=>{t.forEach(r=>{r.type==="childList"&&(r.removedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;this.isFixed(o)||(o.hasAttribute("string")&&this.handleRemoved(o),o.querySelectorAll("[string],[data-string]").forEach(s=>{this.isFixed(s)||this.handleRemoved(s)}))}),r.addedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;if(this.isFixed(o))return;o.hasAttribute("string")&&!o.hasAttribute("string-inited")&&this.add(o),o.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])").forEach(a=>this.add(a));let s=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");s&&(this.objects.has(s)?this.objects.get(s).connects.push(o):this.enqueueConnection(s,o))}),this.modules.all.forEach(i=>i.onDOMRebuild()))})}).observe(document.body,{childList:!0,subtree:!0})}handleRemoved(e){let t=e.getAttribute("string-id")??e.getAttribute("data-string-id");if(!t)return;let r=e.getAttribute("string-copy-from")??e.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(t)}onSettingsChange(){this.objects.forEach(e=>{this.modules.core.forEach(t=>{if(t.canConnect(e)){let r=this.getAllAttributes(e.htmlElement);t.initializeObject(this.globalId,e,e.htmlElement,r),t.calculatePositions(e,this.data.viewport.windowHeight),t.connectObject(e)}})})}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(e=>{this.checkInviewForObject(e)})}checkInviewForObject(e){let t=this.data.scroll.transformedCurrent,r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),o=e.getProperty("is-inview")??!1,s=t>=r&&t<=i,a=null;!o&&s?a=t<r?"enter-bottom":"enter-top":o&&!s&&(a=t<r?"exit-top":"exit-bottom"),s!==o&&(e.setProperty("is-inview",s),this.events.emit(`object:inview:${e.id}`,{inView:s,direction:a}),s?e.show():e.hide())}};var L=class{constructor(e){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()};this.document=document,this.context=e}set scrollDirection(e){this._scrollDirection=e,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(e){}onScroll(e){}disableScrollEvents(){}enableScrollEvents(){}triggerScrollRules(){this.scrollTriggerRules.forEach(e=>{(e.direction==="any"||this.isLastBottomScrollDirection&&e.direction==="forward")&&this.context.data.scroll.current>=e.offset?(e.onEnter?.(),e.toggleClass&&e.toggleClass.target.classList.add(e.toggleClass.className)):(e.onLeave?.(),e.toggleClass&&e.toggleClass.target.classList.remove(e.toggleClass.className))})}addScrollMark(e){this.scrollTriggerRules.push(e)}removeScrollMark(e){this.scrollTriggerRules=this.scrollTriggerRules.filter(t=>t.id!==e)}};var it=class extends L{constructor(t){super(t);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let t=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=t,this.context.data.scroll.lerped=t,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(t){let r=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=r,this.context.data.scroll.target=r,this.context.data.scroll.transformedCurrent=r}onWheel(t){if(t.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=t.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,t.deltaY)),this.context.data.scroll.delta+=r}}};var ot=class extends L{constructor(t){super(t);this.name="disable";this.preventScroll=t=>{t.preventDefault()};this.preventKeyScroll=t=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(t.key)&&t.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}disableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}enableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var I={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var st=class extends L{constructor(t){super(t);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1}updateScrollDirection(t){if(this.isLastBottomScrollDirection=t,this.isBottomScrollDirection===null){this.isBottomScrollDirection=t;return}this.context.data.scroll.isScrollingDown=t,this.onChangeDirection(),document.documentElement.classList.toggle(I.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(I.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(I.SCROLL_FORWARD,t),document.documentElement.classList.toggle(I.SCROLL_BACKWARD,!t)}stopScroll(){this.context.data.scroll.lerped=0,this.context.data.scroll.delta=0,this.context.data.scroll.target=this.context.data.scroll.current,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(I.SCROLLING_BACKWARD,I.SCROLLING_FORWARD),this.isBottomScrollDirection=null}onFrame(){if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.context.data.scroll.current=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.target=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;return}if(this.context.data.scroll.delta!==0){this.scrollForce=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate,this.context.data.scroll.target=Math.min(Math.max(0,this.context.data.scroll.target+this.scrollForce),this.context.data.scroll.bottomPosition),this.context.data.scroll.delta-=this.scrollForce,this.context.data.scroll.lerped=(this.context.data.scroll.target-this.context.data.scroll.current)*this.context.data.scroll.speed;let t=Math.abs(this.context.data.scroll.lerped);this.context.data.scroll.lerped>0?this.context.data.scroll.current=Math.ceil(this.context.data.scroll.current+this.context.data.scroll.lerped):this.context.data.scroll.current=Math.floor(this.context.data.scroll.current+this.context.data.scroll.lerped),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),t<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate()))}}onWheel(t){if(t.deltaY!==0&&t.preventDefault(),this.wheelImpulse=t.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let r=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&r<0,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(t){this.isProg||(this.isScrollbarManipulation=!0)}};var nt=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new st(e)),this.modes.set("default",new it(e)),this.modes.set("disable",new ot(e)),this.updateResponsiveMode()}setMobileMode(e){this.context.data.scroll.modeMobile=e,this.updateResponsiveMode()}setDesktopMode(e){this.context.data.scroll.modeDesktop=e,this.updateResponsiveMode()}updateResponsiveMode(){let t=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(t)}updatePosition(){this.modes.forEach(e=>{e.onCalcUpdate()})}setMode(e){if(!this.modes.has(e)){console.warn(`[ScrollManager] Unknown scroll mode: ${e}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=e,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(e){this.get().onScroll(e)}onWheel(e){this.get().onWheel(e)}bindEvents(e){this.modes.forEach(t=>{t.onScrollStart=e.onScrollStart,t.onScrollStop=e.onScrollStop,t.onChangeDirection=e.onDirectionChange})}addScrollMark(e){this.modes.forEach(t=>{t.addScrollMark(e)})}removeScrollMark(e){this.modes.forEach(t=>{t.removeScrollMark(e)})}};var at=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var lt=class{constructor(){this.threeInstance=null}};var ct=class{constructor(){this.target=0;this.current=0;this.transformedCurrent=0;this.delta=0;this.lerped=0;this.displacement=0;this.isScrollingDown=!1;this.topPosition=0;this.bottomPosition=0;this.direction="vertical";this.elementContainer=document.documentElement;this.scrollContainer=window;this.container=document.body;this.mode="smooth";this.modeMobile="smooth";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var pt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var dt=class{constructor(){this.windowWidth=0;this.windowHeight=0;this.contentWidth=0;this.contentHeight=0;this.scaleWidth=1;this.scaleHeight=1;this.transformScale=1;this.baseRem=16}};var N=class{constructor(){this.scroll=new ct;this.viewport=new dt;this.cursor=new at;this.render=new lt;this.time=new pt}};var g=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.events,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(t,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let o=i.top,s=i.height;return o+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(t,r,i)=>i.height},{key:"half-width",type:"number",fallback:(t,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(t,r,i)=>i.height/2},{key:"enter-el",type:"string",fallback:this.settings["enter-el"]},{key:"enter-vp",type:"string",fallback:this.settings["enter-vp"]},{key:"exit-el",type:"string",fallback:this.settings["exit-el"]},{key:"exit-vp",type:"string",fallback:this.settings["exit-vp"]}]}get type(){return this._type}initializeObject(e,t,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:s,type:a,fallback:n,transform:l}of this.attributesToMap){let m=typeof n=="function"?n(r,t,o):n,d=this.tools.domAttribute.process({element:r,key:s,fallback:i[s]??this.settings[s]??m}),p=this.parseAttribute(d,a,{element:r,boundingRect:o,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(p=l(p)),t.setProperty(s,p)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),o=e.getProperty("offset-bottom"),s=e.getProperty("offset-top"),a=e.getProperty("enter-el"),n=e.getProperty("enter-vp"),l=e.getProperty("exit-el"),m=e.getProperty("exit-vp"),d=0,p=0,h=0,v=0;a==="top"&&n==="top"||a==="left"&&n==="left"?(h=-t+1,d=r-o):a==="top"&&n==="bottom"||a==="left"&&n==="right"?d=r-t-o:a==="bottom"&&n==="top"||a==="right"&&n==="left"?(h=-t-i+1,d=r+i-o):(a==="bottom"&&n==="bottom"||a==="right"&&n==="right")&&(h=-i+1,d=r-t+i-o),l==="top"&&m==="top"||l==="left"&&m==="left"?(v=-i+1,p=r+s):l==="top"&&m==="bottom"||l==="left"&&m==="right"?(v=-t-i+1,p=r-t+s):l==="bottom"&&m==="top"||l==="right"&&m==="left"?p=r+i+s:(l==="bottom"&&m==="bottom"||l==="right"&&m==="right")&&(v=-t+1,p=r-t+i+s),e.setProperty("start-bias",h),e.setProperty("end-bias",v),e.setProperty("start-position",d-this.data.scroll.topPosition),e.setProperty("end-position",p-this.data.scroll.topPosition),e.setProperty("difference-position",p-d);let u=e.getProperty("inview-top")??0,b=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",e.getProperty("start-position")+u),e.setProperty("inview-end-position",e.getProperty("end-position")+b)}parseAttribute(e,t,r={}){if(e==null)return null;if(typeof t=="object"&&t.type==="enum")return t.values.includes(e)?e:t.values[0];switch(t){case"number":return parseFloat(e);case"boolean":return e===""||e==="true";case"json":try{return JSON.parse(e)}catch{return null}case"tuple":return e.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:e});case"color":return this.tools.colorParser.process({value:e});case"dimension":return e=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem}):0;default:return e}}canConnect(e){return e.keys.includes(this.htmlKey)}connectObject(e){e.connect(this),this.onObjectConnected(e)}enterObject(e,t){this.objectMap.has(e)||(this.objectMap.set(e,t),this.objects.push(t))}exitObject(e){let t=this.objectMap.get(e);if(!t)return;this.objectMap.delete(e);let r=this.objects.indexOf(t);r!==-1&&this.objects.splice(r,1)}addObject(e,t){this.objectMapOnPage.has(e)||(this.objectMapOnPage.set(e,t),this.objectsOnPage.push(t))}removeObject(e){let t=this.objectMapOnPage.get(e);if(!t)return;this.objectMapOnPage.delete(e);let r=this.objectsOnPage.indexOf(t);r!==-1&&this.objectsOnPage.splice(r,1)}onObjectConnected(e){}applyToElementAndConnects(e,t){e.getProperty("self-disable")==!1&&t(e.htmlElement),e.connects.forEach(t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onResize(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var B=class{process({element:e}){return e.getBoundingClientRect()}};var V=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var W=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var O=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,s,a,n,l,m]=i,d=o*n-s*a;return{width:t.width/(o||1),height:t.height/(n||1),left:(t.left*n-t.top*a+a*m-l*n)/d,top:(-t.left*s+t.top*o+l*s-o*m)/d}}return t}};var $=class{constructor(e=new O){this.transformTool=e}process({element:e,container:t=document.body}){let r;try{r=t.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:e});return{top:i.top-r.top,left:i.left-r.left}}};var z=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var q=class{process({value:e,element:t,viewportHeight:r,baseRem:i,boundingRect:o}){let s=e.split("|").map(n=>n.trim()).filter(Boolean),a=0;for(let n of s){let l=n,m=!1;l.startsWith("-")&&(m=!0,l=l.slice(1));let d=0;if(l==="selfHeight")d=t.offsetHeight;else if(l.endsWith("px"))d=parseFloat(l);else if(l.endsWith("%"))d=parseFloat(l)/100*r;else if(l.endsWith("rem"))d=parseFloat(l)*i;else if(l.endsWith("sh"))d=parseFloat(l)*o.height/100;else continue;a+=m?-d:d}return a}};var _=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(e<t)return o;if(e>1&&(e=1),e<=r){let s=(e-t)/(r-t);return o-s*(o-i)}return i}};var Y=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var U=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let o=t.slice(1);o.length===3&&(o=o.split("").map(m=>m+m).join(""));let s=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),n=parseInt(o.slice(4,6),16),l=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:s,g:a,b:n,a:l}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[o,s,a,n=1]=r[1].split(",").map(l=>parseFloat(l.trim()));return{r:o,g:s,b:a,a:n}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[o,s,a,n="1"]=i[1].split(",").map(p=>p.trim()),[l,m,d]=this.hslToRgb(parseFloat(o),parseFloat(s),parseFloat(a));return{r:l,g:m,b:d,a:parseFloat(n)}}return{r:0,g:0,b:0,a:0}}hslToRgb(e,t,r){e=e/360,t=parseFloat(t.toString())/100,r=parseFloat(r.toString())/100;let i=(m,d,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?m+(d-m)*6*p:p<1/2?d:p<2/3?m+(d-m)*(2/3-p)*6:m),o=r<.5?r*(1+t):r+t-r*t,s=2*r-o,a=Math.round(i(s,o,e+1/3)*255),n=Math.round(i(s,o,e)*255),l=Math.round(i(s,o,e-1/3)*255);return[a,n,l]}};var X=class{constructor(){this.namedCurves={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}}process({easing:e}){let t=e.trim();if(this.namedCurves[t])return this.cubicBezier(...this.namedCurves[t]);let r=t.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(r){let[i,o,s,a]=r.slice(1).map(Number);return this.cubicBezier(i,o,s,a)}return i=>i}cubicBezier(e,t,r,i){let o=3*e,s=3*(r-e)-o,a=1-o-s,n=3*t,l=3*(i-t)-n,m=1-n-l;function d(u){return((a*u+s)*u+o)*u}function p(u){return((m*u+l)*u+n)*u}function h(u){return(3*a*u+2*s)*u+o}function v(u,b=1e-5){let S,M,f=u,x,y,E;for(E=0;E<8;E++){if(x=d(f)-u,Math.abs(x)<b)return f;if(y=h(f),Math.abs(y)<1e-6)break;f=f-x/y}for(S=0,M=1,f=u;S<M;){if(x=d(f)-u,Math.abs(x)<b)return f;x>0?M=f:S=f,f=(M+S)/2}return f}return function(u){return p(v(u))}}};var j=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var K=class{process({from:e,to:t,progress:r}){return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:e.a+(t.a-e.a)*r}}};var Q=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var G=class{process({value:e}){let r=e?.trim();if(!r||r==="none")return 1;try{if(r.startsWith("matrix(")){let i=r.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let o=parseFloat(i[1].trim());if(!isNaN(o))return o}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var ut=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let o=i.trim();if(!o)return;let s=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let a=s[1]||"",n=s[2],l=a+n,d=(s[4]||"").split(";").map(h=>h.trim()).filter(h=>h.length>0),p=this.parseParamsArray(d);switch(l){case"line":t.line.push(p);break;case"word":t.word.push(p);break;case"char":t.char.push(p);break;case"charLine":t.charLine.push(p);break;case"charWord":t.charWord.push(p);break;case"wordLine":t.wordLine.push(p);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),t}parseParamsArray(e){let t={align:"start"};return e.forEach(r=>{if(r==="abs")t.abs=!0;else if(r.startsWith("random")){t.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(t.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(t.align=r)}),t}};var Z=class{process({value:e}){let t=[],r="",i=0;for(let o=0;o<e.length;o++){let s=e[o];s==="("&&i++,s===")"&&i--,s==="|"&&i===0?(r.trim()&&t.push(r.trim()),r=""):r+=s}return r.trim()&&t.push(r.trim()),t.map(o=>{let s=o.match(/^(\w+)(?:\((.*)\))?$/);if(!s)return{key:o};let[,a,n]=s;return n?{key:a,params:n.split(",").map(l=>l.trim())}:{key:a}})}};var mt=class{constructor(){this.inputValidators={required:e=>e!=null&&String(e).trim()!=="",min:(e,t)=>typeof e=="string"&&e.length>=Number(t),checked:e=>e===!0||e==="true"||e===1||e==="1",email:e=>typeof e=="string"&&/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e),max:(e,t)=>typeof e=="string"&&e.length<=Number(t),phone:e=>typeof e=="string"&&/^(\+?\d{1,3}[-.\s]?)?(\(?\d{1,4}\)?[-.\s]?)?[\d\-.\s]{5,15}$/.test(e),number:e=>typeof e=="string"&&/^-?\d+(\.\d+)?$/.test(e),url:e=>typeof e=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?$/.test(e)};this.beforeInputValidators={number:e=>/^-?\d*\.?\d*$/.test(e),integer:e=>/^-?\d*$/.test(e),email:e=>/^[\w@.\-+]*$/.test(e),phone:e=>/^(\+)?[\d\-() ]*$/.test(e)&&(e.match(/\+/g)?.length??0)<=1&&(!e.includes("+")||e.indexOf("+")===0),letters:e=>/^[a-zA-Z]*$/.test(e),lettersSpaces:e=>/^[a-zA-Z\s]*$/.test(e),lettersNumbers:e=>/^[a-zA-Z0-9]*$/.test(e),url:e=>/^[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]*$/.test(e),pattern:(e,t)=>{try{return new RegExp(t||"").test(e)}catch{return!0}}}}process({rules:e,value:t,type:r="input"}){let i=[];for(let l of e){var o=null,s=null,a=!0,n=!0;r=="input"&&(s=this.inputValidators[l.key],!s)||r=="beforeinput"&&(o=this.beforeInputValidators[l.key],!o)||(s&&(a=s(t,...l.params||[])),o&&(n=o(t,...l.params||[])),n||i.push(this.getErrorMessage(l.key,l.params)),a||i.push(this.getErrorMessage(l.key,l.params)))}return{valid:i.length===0,errors:i}}getErrorMessage(e,t){switch(e){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${t?.[0]} characters`;case"max":return`Maximum ${t?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";default:return"Invalid value"}}};var ht=class{constructor(){this.domAttribute=new V;this.recordAttribute=new W;this.transformNullify=new O;this.boundingClientRect=new B;this.relativePosition=new $(this.transformNullify);this.unitParser=new q;this.lerp=new z;this.adaptiveLerp=new _;this.originParser=new Y;this.colorParser=new U;this.validation=new mt;this.easingFunction=new X;this.magneticPull=new j;this.lerpColor=new K;this.lerpVector=new Q;this.transformScaleParser=new G;this.optionsParser=new ut;this.ruleParser=new Z}};var gt=class extends g{constructor(t){super(t);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",this.cursor=document.querySelector("[string-cursor],[data-string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content],[data-string-cursor-content]"),this.attributesToMap=[...this.attributesToMap,{key:"target-disable",type:"boolean",fallback:this.settings["target-disable"]},{key:"target-style-disable",type:"boolean",fallback:this.settings["target-style-disable"]},{key:"target-class",type:"string",fallback:this.settings["target-class"]},{key:"cursor-class",type:"string",fallback:this.settings["cursor-class"]},{key:"alignment",type:{type:"enum",values:["start","center","end"]},fallback:this.settings.alignment},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}]}initializeObject(t,r,i,o){super.initializeObject(t,r,i,o),r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0),r.setProperty("is-mouse-over",!1),r.setProperty("is-mouse-move",!1)}onFrame(t){requestAnimationFrame(()=>{this.objects.forEach(a=>{let n=a.getProperty("is-mouse-over"),l=a.getProperty("cursor-target-disable"),m=a.getProperty("lerp")??.15;if(n&&!l){let d=a.htmlElement.getBoundingClientRect(),p=this.data.cursor.targetX,h=this.data.cursor.targetY,v=p-d.left,u=h-d.top,b=a.getProperty("mouse-pixel-x")??0,S=a.getProperty("mouse-pixel-y")??0,M=b-v,f=S-u;if(M*M+f*f>1e-4){(a.getProperty("is-mouse-move")??!1)||(a.setProperty("is-mouse-move",!0),a.setProperty("mouse-pixel-x",v),a.setProperty("mouse-pixel-y",u),a.setProperty("mouse-x",v),a.setProperty("mouse-y",u),b=v,S=u,this.events.emit(`cursor:start:${a.id}`,null));let E=this.tools.lerp.process({from:b,to:v,progress:m}),C=this.tools.lerp.process({from:S,to:u,progress:m}),T=b+E,P=S+C;a.setProperty("mouse-pixel-x",T),a.setProperty("mouse-pixel-y",P);let F=a.getProperty("alignment")??"center",Nt=this.calculateOffset(F,T,d.width),Bt=this.calculateOffset(F,P,d.height);a.setProperty("mouse-x",Nt),a.setProperty("mouse-y",Bt),this.setMouseCoordinates(a,Nt,Bt),this.events.emit(`cursor:move:${a.id}`,{x:Nt,y:Bt}),this.events.emit(`cursor:pixel:${a.id}`,{x:T,y:P})}else a.setProperty("mouse-pixel-x",v),a.setProperty("mouse-pixel-y",u),this.events.emit(`cursor:end:${a.id}`,null)}else{let d=a.getProperty("mouse-x")??0,p=a.getProperty("mouse-y")??0;if(d!==0||p!==0){a.setProperty("is-mouse-move",!1);let h=a.htmlElement.getBoundingClientRect(),v=a.getProperty("half-width")??h.width/2,u=a.getProperty("half-height")??h.height/2,b=this.calculateOffset("center",v,h.width),S=this.calculateOffset("center",u,h.height),M=d+this.tools.lerp.process({from:d,to:b,progress:m}),f=p+this.tools.lerp.process({from:p,to:S,progress:m});a.setProperty("mouse-x",M),a.setProperty("mouse-y",f),Math.abs(M)<.001&&Math.abs(f)<.001&&(a.setProperty("mouse-x",0),a.setProperty("mouse-y",0),a.setProperty("mouse-pixel-x",0),a.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(a,M,f)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:s}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:s}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",s.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))})}onObjectConnected(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(t)}),t.setProperty("onEnterEvent",this.onEnterObject.bind(this)),t.events.on("enter",t.getProperty("onEnterEvent")),t.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),t.events.on("leave",t.getProperty("onLeaveEvent"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){this.overCount--,t.setProperty("is-mouse-over",!1),t.getProperty("timeoutId")&&(clearTimeout(t.getProperty("timeoutId")),t.setProperty("timeoutId",null));let r=this.getCursorClass(t);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}setMouseCoordinates(t,r,i){t.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(t,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}calculateOffset(t,r,i){switch(t){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var ft=class extends g{constructor(e){super(e),this.htmlKey="magnetic",this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.setProperty("is-magneting",!1),t.setProperty("magnetic-target-x",0),t.setProperty("magnetic-target-y",0),t.setProperty("magnetic-x",0),t.setProperty("magnetic-y",0),t.setProperty("lerp",.1)}onMouseMove(e){this.objects.forEach(t=>{let i=t.htmlElement.getBoundingClientRect(),o=i.left+(t.getProperty("half-width")??0),s=i.top+(t.getProperty("half-height")??0),a=e.clientX-o,n=e.clientY-s,l=Math.sqrt(a**2+n**2),m=t.getProperty("radius")??0,d=t.getProperty("strength")??0,p=this.tools.magneticPull.process({distance:l,radius:m,strength:d});t.setProperty("magnetic-target-x",a*p),t.setProperty("magnetic-target-y",n*p),p>0&&t.setProperty("is-magneting",!0)})}onFrame(e){this.objects.forEach(t=>{if(t.getProperty("is-magneting")){let r=t.getProperty("magnetic-x")??0,i=t.getProperty("magnetic-y")??0,o=t.getProperty("lerp")??0,s=t.getProperty("magnetic-target-x")??0,a=t.getProperty("magnetic-target-y")??0,n=this.tools.lerp.process({from:r,to:s,progress:o}),l=this.tools.lerp.process({from:i,to:a,progress:o});n>-.01&&n<.01&&(n=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),l>-.01&&l<.01&&(l=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=n,i+=l,t.setProperty("magnetic-x",r),t.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${t.id}`,{x:r,y:i}),this.applyToElementAndConnects(t,m=>{m.style.setProperty("--magnetic-x",r.toString()),m.style.setProperty("--magnetic-y",i.toString())}),(t.getProperty("magnetic-target-x")==r||t.getProperty("magnetic-target-y")==i)&&t.setProperty("is-magneting",!1)}})}};var bt=class extends g{constructor(t){super(t);this.isStartLoaded=!1;this.loadingCount=0;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.loadImage(r)),this.isStartLoaded=!0}onObjectConnected(t){if(this.loadingCount++,this.isStartLoaded){let r=t.htmlElement;this.loadImage(r)}}async loadImage(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});if(r)try{t.classList.add("lazyLoad"),t.src=r,t.addEventListener("load",()=>{t.classList.add("-loaded")}),await this.setAspectRatio(t,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(t,r){return new Promise((i,o)=>{let s=new XMLHttpRequest;s.open("GET",r,!0),s.responseType="arraybuffer",s.setRequestHeader("Range","bytes=0-"),s.onload=()=>{if(s.status===200||s.status===206){let a=new Blob([s.response]),n=new Image;n.onload=()=>{t.style.aspectRatio=`${n.width} / ${n.height}`,URL.revokeObjectURL(n.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},n.onerror=()=>{URL.revokeObjectURL(n.src),this.loadingCount--,o(new Error("Image failed to decode"))},n.src=URL.createObjectURL(a)}else o(new Error("Image request failed"))},s.onerror=()=>o(new Error("XHR error")),s.send()})}};var vt=class extends g{constructor(t){super(t);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var yt=class extends g{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var A=class{constructor(e){this.min=void 0;this.max=void 0;this.enable=!0;this.min=e?.min,this.max=e?.max,this.enable=e?.enable??!0}setEnable(e=!0){this.enable=e}setRange(e,t){this.min=e??void 0,this.max=t??void 0}get mediaQuery(){let e="screen";return this.min&&(e+=` and (min-width: ${this.min}px)`),this.max&&(e+=` and (max-width: ${this.max}px)`),e}},St=class extends g{constructor(t){super(t);this.queries={0:new A({max:359}),1:new A({min:360,max:1079}),2:new A({min:1080,max:1365}),3:new A({min:1366})};this.isMobileMedia=!1;this.isTabletMedia=!1;this.isLaptopMedia=!1;this.isDesktopMedia=!1;this.matchMedias={0:window.matchMedia(this.queries[0].mediaQuery),1:window.matchMedia(this.queries[1].mediaQuery),2:window.matchMedia(this.queries[2].mediaQuery),3:window.matchMedia(this.queries[3].mediaQuery)};this._type=2}onConnect(){}onInit(){if(this.settings!=null&&this.settings.settings!=null){let t=this.settings.settings;t.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,t.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(t.tablet.min==null?null:t.tablet.min,t.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.laptop.min==null?null:t.laptop.min,t.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.desktop.min==null?null:t.desktop.min,t.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let t=this.matchMedias[0].matches&&this.queries[0].enable,r=this.matchMedias[1].matches&&this.queries[1].enable,i=this.matchMedias[2].matches&&this.queries[2].enable,o=this.matchMedias[3].matches&&this.queries[3].enable;this.isMobileMedia!=t&&this.events.emit("screen:mobile",t),this.isTabletMedia!=r&&this.events.emit("screen:tablet",r),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=o&&this.events.emit("screen:desktop",o),this.isMobileMedia=t,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=o,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(a=>{let n=!1;a.hasAttribute("string-mobile")&&t&&(n=!0),a.hasAttribute("string-tablet")&&r&&(n=!0),a.hasAttribute("string-laptop")&&i&&(n=!0),a.hasAttribute("string-desktop")&&o&&(n=!0),n?a.style.display=null:a.style.display="none"})}};var Mt=class extends g{constructor(e){super(e),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:t=>{let[r,i]=t,o=this.tools.originParser.process({value:r}),s=this.tools.originParser.process({value:i});return{x:o,y:s}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var ie=.05,oe=.01,qt=1,se=-1,ne=1,xt=class extends g{constructor(t){super(t);this.previousLerp=0;this.displacement=0;this.acceleration=0;this.velocityMultiplier=.00125;this.isInitialScroll=!0;this.baseVelocityMultiplier=.00125;this.reducedVelocityMultiplier=this.baseVelocityMultiplier/20;this.negativeVelocityMultiplier=-1e-4;this.maxDisplacementValue=0;this.setupItem=t=>{let r=t.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${t.id}`,i);let o=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=o};this.onUpdateDesktopEvent=()=>{for(let t=0;t<this.objects.length;t++){let r=this.objects[t];this.setupItem(r)}};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;this.htmlKey="glide",this.baseVelocityMultiplier=this.settings["glide-base-velocity"]??this.baseVelocityMultiplier,this.reducedVelocityMultiplier=this.settings["glide-reduce-velocity"]??this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=this.settings["glide-negative-velocity"]??this.negativeVelocityMultiplier,this.attributesToMap=[...this.attributesToMap,{key:"glide",type:"number",fallback:this.settings.glide}]}calcExpanderFactor(t){let r=t?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.viewport.windowHeight*.1,this.onUpdateEvent=this.onUpdateDesktopEvent):(this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState(),this.objects.forEach(t=>{this.setupItem(t)}))}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0;for(let t=0;t<this.objects.length;t++){let r=this.objects[t],i="translate3d(0, 0px, 0)";r.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(qt,this.acceleration+ie),this.displacement=Math.max(oe,Math.min(qt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(ne,Math.max(se,this.data.scroll.lerped*this.displacement*this.acceleration)),this.objects.forEach(r=>{this.applyToElementAndConnects(r,i=>{i.style.setProperty("--glide",this.data.scroll.displacement.toString())})}),this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}};var Et=class extends g{constructor(e){super(e),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(e=>{this.setLerpValue(e,0)})}onFrame(e){let t=e.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,t)})}setLerpValue(e,t){this.events.emit(`object:lerp:${e.id}`,t),e.htmlElement.style.setProperty("--lerp",t.toString())}};var H=class extends g{constructor(e){super(e),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i)}onScroll(e){super.onScroll(e),this.objects.forEach(t=>{this.setUpObject(t)})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("setUpObject",this.setUpObject.bind(this)),e.events.on("enter",e.getProperty("setUpObject"))}setUpObject(e){let t=e.getProperty("start-position"),r=e.getProperty("difference-position"),i=e.getProperty("key"),o=e.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-t)/r)));if(e.getProperty("progress")!==o){this.events.emit(`object:progress:${e.id}`,o),e.setProperty("progress",o);let s=o.toString();this.applyToElementAndConnects(e,a=>{a.style.setProperty(i,s)})}}};var Tt=class extends H{constructor(t){super(t);this.handleScrollDesktop=()=>{this.objects.forEach(t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,o=t.getProperty("parallax-position-start")??0,s=t.getProperty("parallax-position-end")??1,a=t.getProperty("parallax-sign")??1,n=this.data.viewport.windowHeight,l=a*i*(n*o+r*n*s);this.events.emit(`object:parallax:${t.id}`,l);let m=`translate3d(0, ${l}px, 0)`;this.applyToElementAndConnects(t,d=>{d.style.transform=m})})};this.handleScrollMobile=()=>{};this.scrollHandler=this.handleScrollDesktop;this.htmlKey="parallax",this.attributesToMap=[...this.attributesToMap,{key:"parallax",type:"number",fallback:this.settings.parallax},{key:"parallax-bias",type:"number",fallback:this.settings["parallax-bias"]}]}initializeObject(t,r,i,o){super.initializeObject(t,r,i,o);let s=r.getProperty("parallax-bias")??0,a=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",a),r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s));let n=this.data.viewport.windowHeight;r.setProperty("offset-top",a*n),r.setProperty("offset-bottom",a*n)}onScroll(t){super.onScroll(t),this.scrollHandler()}onResize(){let t=window.innerWidth>1080;this.scrollHandler=t?this.handleScrollDesktop:this.handleScrollMobile,t?this.handleScrollDesktop():this.objects.forEach(r=>{let i="translate3d(0, 0px, 0)";this.applyToElementAndConnects(r,o=>{o.style.transform=i})})}};var Ct=class{constructor(e,t,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth,r=t/e*t;this.thumb.style.setProperty("--size",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startY=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startY,r=this.startScrollPosition+t/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=r,this.data.scroll.target=r,window.scrollTo(0,r),this.updateThumb()}};var wt=class{constructor(e,t,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight,r=t/e*t;this.thumb.style.setProperty("--height",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startCoordinate=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startCoordinate,r=this.startScrollPosition+t/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,o=Math.max(0,Math.min(r,i));this.data.scroll.current=o,this.data.scroll.target=o,window.scrollTo(0,o),this.updateThumb()}};var Lt=class extends g{constructor(t){super(t);this.isDragging=!1;this.scrollMode="smooth";this.mouseUpEventBind=this.mouseUpEvent.bind(this),this.mouseDownEventBind=this.mouseDownEvent.bind(this),this.mouseMoveEventBind=this.mouseMoveEvent.bind(this)}destructor(){document.removeEventListener("mouseup",this.mouseUpEventBind),this.thumb.removeEventListener("mousedown",this.mouseDownEventBind),document.removeEventListener("mousemove",this.mouseMoveEventBind)}onInit(){this.createScrollbar(),this.updateThumb(),this.addCustomStyles(),document.addEventListener("mouseup",this.mouseUpEventBind),this.thumb.addEventListener("mousedown",this.mouseDownEventBind),document.addEventListener("mousemove",this.mouseMoveEventBind),document.documentElement.classList.add("-no-scrollbar")}onScroll(t){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let t=document.createElement("style");t.textContent=`
2
2
  ::-webkit-scrollbar {
3
3
  display: none;
4
4
  width: 0;
@@ -16,9 +16,9 @@
16
16
  -ms-overflow-style: none; /* IE and Edge */
17
17
  scrollbar-width: none; /* Firefox */
18
18
  }
19
- `,document.head.appendChild(t)}createScrollbar(){this.scrollbar=document.createElement("div"),this.scrollbar.classList.add("scrollbar"),this.thumb=document.createElement("div"),this.thumb.classList.add("thumb"),this.scrollbar.appendChild(this.thumb),document.body.appendChild(this.scrollbar),this.scrollbarStateHorizontal=new Mt(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new xt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(t){this.isDragging=!0,this.scrollbarState.mouseDownEvent(t),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(t){this.isDragging&&this.scrollbarState.mouseMoveEvent(t)}mouseUpEvent(){this.isDragging=!1,document.body.style.userSelect="",this.hideScrollbar(),this.scrollbar.classList.remove("-touch")}showScrollbar(){this.scrollbar.classList.add("-scroll")}hideScrollbar(){this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollbar.classList.remove("-scroll")},1e3)}};var P={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function zt(l,e){let t=document.createDocumentFragment(),r=0,i=E(e,"line")||E(e,"charLine")||E(e,"wordLine");return l.forEach((o,n)=>{let a=n===l.length-1,s=t;i&&(s=document.createElement("span"),s.classList.add("-s-line"),o.isBeforeElement&&s.classList.add(P.BEFORE_ELEMENT),o.isAfterElement&&s.classList.add(P.AFTER_ELEMENT),s.style.setProperty("--line-index",String(o.lineIndex)),s.style.setProperty("--word-total",String(o.words.length)),Bt(s,o.calculatedValues,e)),o.words.forEach((c,u)=>{let p=u===o.words.length-1;if(c.chars.length===1&&c.chars[0].token.type==="element"){let m=c.chars[0].token.node.cloneNode(!0);s.appendChild(m),p||s.appendChild(document.createTextNode("\xA0"));return}let d=E(e,"word")||E(e,"charWord")||E(e,"wordLine"),h=d?document.createElement("span"):s;if(d&&(h.classList.add("-s-word"),c.isBeforeElement&&h.classList.add(P.BEFORE_ELEMENT),c.isAfterElement&&h.classList.add(P.AFTER_ELEMENT),h.style.setProperty("--word-index",String(c.wordIndexGlobal)),h.style.setProperty("--char-total",String(c.chars.length)),Bt(h,c.calculatedValues,e)),E(e,"char")||E(e,"charLine")||E(e,"charWord"))c.chars.forEach(m=>{if(m.char===" "||m.char===" ")return;let f=document.createElement("span"),v=f;v.classList.add("-s-char"),m.isBeforeElement&&v.classList.add(P.BEFORE_ELEMENT),m.isAfterElement&&v.classList.add(P.AFTER_ELEMENT),v.textContent=m.char,v.style.setProperty("--char-index",String(r++)),Bt(v,m.calculatedValues,e),h.appendChild(f)});else{let m=document.createTextNode(c.chars.map(f=>f.char).join(""));h.appendChild(m)}d&&s.appendChild(h),i?p?s.appendChild(document.createElement("br")):h.appendChild(document.createTextNode("\xA0")):a||h.appendChild(document.createTextNode("\xA0"))}),i&&t.appendChild(s)}),t}function Bt(l,e,t){if(e)for(let r of e){if(!ae(r.type,r.align,t))continue;let i=le(r.type,r.align);l.style.setProperty(i,String(r.value))}}function ae(l,e,t){let r=t[l]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function le(l,e){let t=e.startsWith("random")?"random":e;return`--${l}-${t}`}function E(l,e){return Array.isArray(l[e])&&l[e].length>0}var K=0;function _t(l){K=0;let e=[];return l.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){let r=t;if(r.tagName.toLowerCase()==="br"){e.push({type:"br",id:`br_${K++}`,node:r,tagName:"br"});return}e.push({type:"element",id:`el_${K++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(t.nodeType===Node.TEXT_NODE){let r=t.nodeValue??"",i=`text_${K++}`;r.trim()?e.push({type:"text",id:i,node:t,content:r}):e.push({type:"space",id:i,node:t,content:r})}else e.push({type:"other",id:`node_${K++}`,node:t})}),e}function ce(l){let e=[],t=[];for(let r of l)r.type==="br"?(t.length&&e.push(t),e.push([r]),t=[]):t.push(r);return t.length&&e.push(t),e}function Yt(l,e){let t=document.createElement("div"),r=window.getComputedStyle(e);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=e.clientWidth+"px",t.style.padding=r.padding,t.style.font=r.font,t.style.letterSpacing=r.letterSpacing,t.style.lineHeight=r.lineHeight,t.style.fontVariant=r.fontVariant,t.style.fontStretch=r.fontStretch,e.appendChild(t);let i=[],o=ce(l),n=!1;for(let a of o){if(a.length===1&&a[0].type==="br"){i.push({token:a[0],rect:new DOMRect(0,0,0,0)});continue}if(a.length===0)continue;let s=document.createElement("div");s.style.position="absolute",s.style.visibility="hidden",s.style.pointerEvents="none",s.style.width=e.clientWidth+"px",s.style.padding=r.padding,s.style.font=r.font,s.style.letterSpacing=r.letterSpacing,s.style.lineHeight=r.lineHeight,s.style.fontVariant=r.fontVariant,s.style.fontStretch=r.fontStretch,e.appendChild(s),a.forEach((c,u)=>{let p,d,h;switch(c.type){case"text":c.content.trim().split(/\s+/).filter(f=>f.length>0).forEach((f,v)=>{p=document.createTextNode(f),d=document.createElement("span"),d.style.display="inline-block",d.appendChild(p);let M=document.createTextNode("\xA0");d.appendChild(M),s.appendChild(d),h=d.getBoundingClientRect();let y={token:{type:"text",id:"",node:p,content:f},rect:h};n&&(n=!1,y.token.meta={...y.token.meta||{},isAfterElement:!0}),i.push(y)});break;case"element":p=c.node.cloneNode(!0),d=document.createElement("span"),d.style.display="inline-block",d.appendChild(p),s.appendChild(d),h=d.getBoundingClientRect(),i.push({token:c,rect:h});let m=i[i.length-2];m?.token.type==="text"&&(m.token.meta={...m.token.meta||{},isBeforeElement:!0}),n=!0;break;case"space":case"other":break}}),e.removeChild(s)}return i}var Ut=1;function jt(l){let e=[],t=null,r=0,i=0,o=0;return l.forEach(n=>{let a=n.token,s=a.meta?.isBeforeElement??!1,c=a.meta?.isAfterElement??!1;if(a.type==="br"){t=null;return}if(a.type==="text"){let u=a.content.match(/(\s+|\S+)/g);if(!u)return;let p=n.rect.left,d=a.content.length,h=d>0?n.rect.width/d:0;u.forEach(b=>{if(/^\s+$/.test(b)){p+=h*b.length;return}let m=[];if(b.split("").forEach((S,x)=>{let C=new DOMRect(p,n.rect.top,h,n.rect.height);m.push({char:S,rect:C,token:a,charIndexInWord:x,charIndexInLine:0,charIndexGlobal:i++}),p+=h}),m.length>0){let S=m[m.length-1];s&&(S.isBeforeElement=!0),c&&(S.isAfterElement=!0)}if((!t||Math.abs(n.rect.top-r)>Ut)&&(r=n.rect.top,t={words:[],rect:n.rect,lineIndex:e.length},e.push(t)),!t)return;let v=t.words.length,M=t.words.reduce((S,x)=>S+x.chars.length,0);m.forEach((S,x)=>S.charIndexInLine=M+x);let y={chars:m,rect:n.rect,wordIndexGlobal:o++,wordIndexInLine:v,isBeforeElement:s,isAfterElement:c};t.words.push(y),t.rect=Xt(t.words.map(S=>S.rect)),s&&(t.isBeforeElement=!0),c&&(t.isAfterElement=!0)})}else if(a.type==="element"){let u=n.rect;if((!t||Math.abs(u.top-r)>Ut)&&(r=u.top,t={words:[],rect:u,lineIndex:e.length},e.push(t)),!t)return;let d=t.words.length,h=t.words.reduce((f,v)=>f+v.chars.length,0),m={chars:[{char:"[E]",rect:u,token:a,charIndexInWord:0,charIndexInLine:h,charIndexGlobal:i++}],rect:u,wordIndexGlobal:o++,wordIndexInLine:d,isBeforeElement:!1,isAfterElement:!1};t.words.push(m),t.rect=Xt(t.words.map(f=>f.rect))}}),e}function Xt(l){let e=Math.min(...l.map(o=>o.left)),t=Math.min(...l.map(o=>o.top)),r=Math.max(...l.map(o=>o.right)),i=Math.max(...l.map(o=>o.bottom));return new DOMRect(e,t,r-e,i-t)}var Tt=class extends g{constructor(e){super(e),this.htmlKey="split"}onResize(){this.objectsOnPage.forEach(e=>{this.onObjectConnected(e)})}onObjectConnected(e){let t=e.htmlElement;if(!t)return;let r=t.classList.contains("-splitted"),i=t.getAttribute("string-split-original");(!r||i===null)&&(i=this.escapeAttribute(t.innerHTML),t.setAttribute("string-split-original",i),t.classList.add("-splitted")),e.htmlElement.innerHTML=i;let o=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",n=this.tools.optionsParser.process({attributeValue:o}),{fragment:a,result:s}=this.split(t,n);e.setProperty("nodes",a.childNodes),t.innerHTML="",t.appendChild(s);let c=t.getAttribute("string-split-restore-after");c&&!isNaN(Number(c))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(c))}split(e,t){let r=document.createDocumentFragment();e.childNodes.forEach(s=>r.appendChild(s.cloneNode(!0)));let i=_t(r.childNodes),o=Yt(i,e),n=jt(o);this.applyCalculatedValues(n,t);let a=zt(n,t);return{fragment:r,result:a}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,o=e.random?.max??r-1;return Math.floor(Math.random()*(o-i+1))+i}switch(e.align){case"start":return t;case"end":return r-t-1;case"center":{let i=Math.floor((r-1)/2);return Math.abs(t-i)}default:return t}}applyCalculatedValues(e,t){let r=n=>n.words.reduce((a,s)=>a+s.chars.length,0),i=e.reduce((n,a)=>n+a.words.length,0),o=e.reduce((n,a)=>n+a.words.reduce((s,c)=>s+c.chars.length,0),0);e.forEach((n,a)=>{t.line&&(n.calculatedValues=t.line.map(s=>({type:"line",align:s.align,value:this.computeValue(s,a,e.length)}))),n.words.forEach((s,c)=>{t.word&&(s.calculatedValues=t.word.map(p=>({type:"word",align:p.align,value:this.computeValue(p,s.wordIndexGlobal,i)}))),t.wordLine&&(s.calculatedValues??(s.calculatedValues=[]),s.calculatedValues.push(...t.wordLine.map(p=>({type:"wordLine",align:p.align,value:this.computeValue(p,s.wordIndexInLine,n.words.length)}))));let u=r(n);s.chars.forEach(p=>{let d=[];t.char&&d.push(...t.char.map(h=>({type:"char",align:h.align,value:this.computeValue(h,p.charIndexGlobal,o)}))),t.charWord&&d.push(...t.charWord.map(h=>({type:"charWord",align:h.align,value:this.computeValue(h,p.charIndexInWord,s.chars.length)}))),t.charLine&&d.push(...t.charLine.map(h=>({type:"charLine",align:h.align,value:this.computeValue(h,p.charIndexInLine,u)}))),p.calculatedValues=d})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var Ct=class extends g{constructor(t){super(t);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(t){let r=Math.abs(t.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="red",t.lineWidth=2,t.beginPath(),this.history.forEach((o,n)=>{let a=n,s=i-o*this.height;n===0?t.moveTo(a,s):t.lineTo(a,s)}),t.stroke()}initCanvas(){let t=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,t.width=r,t.height=this.height,Object.assign(t.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=t,this.context=t.getContext("2d"),document.body.appendChild(t)}setTarget(t){this.target=t}clear(){this.canvas.remove(),this.history=[]}};var wt=class extends g{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(t){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),t.textContent="FPS: 0",document.body.appendChild(t),this.displayElement=t}};var Lt=class extends g{constructor(t){super(t);this.history=[];this.maxPoints=0;this.canvasHeight=0;this.currentValue=0;this.targetValue=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(t){let r=Math.abs(t.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="#007bff",t.lineWidth=2,t.beginPath(),this.history.forEach((o,n)=>{let a=n,s=i-o/2;n===0?t.moveTo(a,s):t.lineTo(a,s)}),t.stroke()}initCanvas(){this.canvas=document.createElement("canvas"),this.canvasHeight=window.innerHeight/15-20,this.canvas.width=window.innerWidth*.5,this.canvas.height=this.canvasHeight,Object.assign(this.canvas.style,{position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#000",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas)}setTarget(t){this.targetValue=t}clear(){this.canvas.remove(),this.history=[]}};var Pt=class extends g{constructor(e){super(e),this._type=2}onInit(){this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target,i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(t)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),e.setAttribute("data-dir","-"),e.setAttribute("data-val","0"),document.body.appendChild(e);let t=document.createElement("style");t.innerHTML=`
19
+ `,document.head.appendChild(t)}createScrollbar(){this.scrollbar=document.createElement("div"),this.scrollbar.classList.add("scrollbar"),this.thumb=document.createElement("div"),this.thumb.classList.add("thumb"),this.scrollbar.appendChild(this.thumb),document.body.appendChild(this.scrollbar),this.scrollbarStateHorizontal=new Ct(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new wt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(t){this.isDragging=!0,this.scrollbarState.mouseDownEvent(t),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(t){this.isDragging&&this.scrollbarState.mouseMoveEvent(t)}mouseUpEvent(){this.isDragging=!1,document.body.style.userSelect="",this.hideScrollbar(),this.scrollbar.classList.remove("-touch")}showScrollbar(){this.scrollbar.classList.add("-scroll")}hideScrollbar(){this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollbar.classList.remove("-scroll")},1e3)}};var k={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function _t(c,e){let t=document.createDocumentFragment(),r=0,i=w(e,"line")||w(e,"charLine")||w(e,"wordLine");return c.forEach((o,s)=>{let a=s===c.length-1,n=t;i&&(n=document.createElement("span"),n.classList.add("-s-line"),o.isBeforeElement&&n.classList.add(k.BEFORE_ELEMENT),o.isAfterElement&&n.classList.add(k.AFTER_ELEMENT),n.style.setProperty("--line-index",String(o.lineIndex)),n.style.setProperty("--word-total",String(o.words.length)),Wt(n,o.calculatedValues,e)),o.words.forEach((l,m)=>{let d=m===o.words.length-1;if(l.chars.length===1&&l.chars[0].token.type==="element"){let u=l.chars[0].token.node.cloneNode(!0);n.appendChild(u),d||n.appendChild(document.createTextNode("\xA0"));return}let p=w(e,"word")||w(e,"charWord")||w(e,"wordLine"),h=p?document.createElement("span"):n;if(p&&(h.classList.add("-s-word"),l.isBeforeElement&&h.classList.add(k.BEFORE_ELEMENT),l.isAfterElement&&h.classList.add(k.AFTER_ELEMENT),h.style.setProperty("--word-index",String(l.wordIndexGlobal)),h.style.setProperty("--char-total",String(l.chars.length)),Wt(h,l.calculatedValues,e)),w(e,"char")||w(e,"charLine")||w(e,"charWord"))l.chars.forEach(u=>{if(u.char===" "||u.char===" ")return;let b=document.createElement("span"),S=b;S.classList.add("-s-char"),u.isBeforeElement&&S.classList.add(k.BEFORE_ELEMENT),u.isAfterElement&&S.classList.add(k.AFTER_ELEMENT),S.textContent=u.char,S.style.setProperty("--char-index",String(r++)),Wt(S,u.calculatedValues,e),h.appendChild(b)});else{let u=document.createTextNode(l.chars.map(b=>b.char).join(""));h.appendChild(u)}p&&n.appendChild(h),console.log(l.chars.map(u=>u.char).join("")),i?d?a||n.appendChild(document.createElement("br")):h.appendChild(document.createTextNode("\xA0")):d||h.appendChild(document.createTextNode("\xA0"))}),i&&t.appendChild(n)}),t}function Wt(c,e,t){if(e)for(let r of e){if(!ae(r.type,r.align,t))continue;let i=le(r.type,r.align);c.style.setProperty(i,String(r.value))}}function ae(c,e,t){let r=t[c]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function le(c,e){let t=e.startsWith("random")?"random":e;return`--${c}-${t}`}function w(c,e){return Array.isArray(c[e])&&c[e].length>0}var J=0;function Yt(c){J=0;let e=[];return c.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){let r=t;if(r.tagName.toLowerCase()==="br"){e.push({type:"br",id:`br_${J++}`,node:r,tagName:"br"});return}e.push({type:"element",id:`el_${J++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(t.nodeType===Node.TEXT_NODE){let r=t.nodeValue??"",i=`text_${J++}`;r.trim()?e.push({type:"text",id:i,node:t,content:r}):e.push({type:"space",id:i,node:t,content:r})}else e.push({type:"other",id:`node_${J++}`,node:t})}),e}function ce(c){let e=[],t=[];for(let r of c)r.type==="br"?(t.length&&e.push(t),e.push([r]),t=[]):t.push(r);return t.length&&e.push(t),e}function Ut(c,e){let t=document.createElement("div"),r=window.getComputedStyle(e);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=e.clientWidth+"px",t.style.padding=r.padding,t.style.font=r.font,t.style.letterSpacing=r.letterSpacing,t.style.lineHeight=r.lineHeight,t.style.fontVariant=r.fontVariant,t.style.fontStretch=r.fontStretch,e.appendChild(t);let i=[],o=ce(c),s=!1;for(let a of o){if(a.length===1&&a[0].type==="br"){i.push({token:a[0],rect:new DOMRect(0,0,0,0)});continue}if(a.length===0)continue;let n=document.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.pointerEvents="none",n.style.width=e.clientWidth+"px",n.style.padding=r.padding,n.style.font=r.font,n.style.letterSpacing=r.letterSpacing,n.style.lineHeight=r.lineHeight,n.style.fontVariant=r.fontVariant,n.style.fontStretch=r.fontStretch,e.appendChild(n),a.forEach((l,m)=>{let d,p,h;switch(l.type){case"text":l.content.trim().split(/\s+/).filter(b=>b.length>0).forEach((b,S)=>{d=document.createTextNode(b),p=document.createElement("span"),p.style.display="inline-block",p.appendChild(d);let M=document.createTextNode("\xA0");p.appendChild(M),n.appendChild(p),h=p.getBoundingClientRect();let f={token:{type:"text",id:"",node:d,content:b},rect:h};s&&(s=!1,f.token.meta={...f.token.meta||{},isAfterElement:!0}),i.push(f)});break;case"element":d=l.node.cloneNode(!0),p=document.createElement("span"),p.style.display="inline-block",p.appendChild(d),n.appendChild(p),h=p.getBoundingClientRect(),i.push({token:l,rect:h});let u=i[i.length-2];u?.token.type==="text"&&(u.token.meta={...u.token.meta||{},isBeforeElement:!0}),s=!0;break;case"space":case"other":break}}),e.removeChild(n)}return i}var Xt=1;function Kt(c){let e=[],t=null,r=0,i=0,o=0;return c.forEach(s=>{let a=s.token,n=a.meta?.isBeforeElement??!1,l=a.meta?.isAfterElement??!1;if(a.type==="br"){t=null;return}if(a.type==="text"){let m=a.content.match(/(\s+|\S+)/g);if(!m)return;let d=s.rect.left,p=a.content.length,h=p>0?s.rect.width/p:0;m.forEach(v=>{if(/^\s+$/.test(v)){d+=h*v.length;return}let u=[];if(v.split("").forEach((x,y)=>{let E=new DOMRect(d,s.rect.top,h,s.rect.height);u.push({char:x,rect:E,token:a,charIndexInWord:y,charIndexInLine:0,charIndexGlobal:i++}),d+=h}),u.length>0){let x=u[u.length-1];n&&(x.isBeforeElement=!0),l&&(x.isAfterElement=!0)}if((!t||Math.abs(s.rect.top-r)>Xt)&&(r=s.rect.top,t={words:[],rect:s.rect,lineIndex:e.length},e.push(t)),!t)return;let S=t.words.length,M=t.words.reduce((x,y)=>x+y.chars.length,0);u.forEach((x,y)=>x.charIndexInLine=M+y);let f={chars:u,rect:s.rect,wordIndexGlobal:o++,wordIndexInLine:S,isBeforeElement:n,isAfterElement:l};t.words.push(f),t.rect=jt(t.words.map(x=>x.rect)),n&&(t.isBeforeElement=!0),l&&(t.isAfterElement=!0)})}else if(a.type==="element"){let m=s.rect;if((!t||Math.abs(m.top-r)>Xt)&&(r=m.top,t={words:[],rect:m,lineIndex:e.length},e.push(t)),!t)return;let p=t.words.length,h=t.words.reduce((b,S)=>b+S.chars.length,0),u={chars:[{char:"[E]",rect:m,token:a,charIndexInWord:0,charIndexInLine:h,charIndexGlobal:i++}],rect:m,wordIndexGlobal:o++,wordIndexInLine:p,isBeforeElement:!1,isAfterElement:!1};t.words.push(u),t.rect=jt(t.words.map(b=>b.rect))}}),e}function jt(c){let e=Math.min(...c.map(o=>o.left)),t=Math.min(...c.map(o=>o.top)),r=Math.max(...c.map(o=>o.right)),i=Math.max(...c.map(o=>o.bottom));return new DOMRect(e,t,r-e,i-t)}var Pt=class extends g{constructor(e){super(e),this.htmlKey="split"}onResize(){this.objectsOnPage.forEach(e=>{this.onObjectConnected(e)})}onObjectConnected(e){let t=e.htmlElement;if(!t)return;let r=t.classList.contains("-splitted"),i=t.getAttribute("string-split-original");(!r||i===null)&&(i=this.escapeAttribute(t.innerHTML),t.setAttribute("string-split-original",i),t.classList.add("-splitted")),e.htmlElement.innerHTML=i;let o=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",s=this.tools.optionsParser.process({attributeValue:o}),{fragment:a,result:n}=this.split(t,s);e.setProperty("nodes",a.childNodes),t.innerHTML="",t.appendChild(n);let l=t.getAttribute("string-split-restore-after");l&&!isNaN(Number(l))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(l))}split(e,t){let r=document.createDocumentFragment();e.childNodes.forEach(n=>r.appendChild(n.cloneNode(!0)));let i=Yt(r.childNodes),o=Ut(i,e),s=Kt(o);this.applyCalculatedValues(s,t);let a=_t(s,t);return{fragment:r,result:a}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,o=e.random?.max??r-1;return Math.floor(Math.random()*(o-i+1))+i}switch(e.align){case"start":return t;case"end":return r-t-1;case"center":{let i=Math.floor((r-1)/2);return Math.abs(t-i)}default:return t}}applyCalculatedValues(e,t){let r=s=>s.words.reduce((a,n)=>a+n.chars.length,0),i=e.reduce((s,a)=>s+a.words.length,0),o=e.reduce((s,a)=>s+a.words.reduce((n,l)=>n+l.chars.length,0),0);e.forEach((s,a)=>{t.line&&(s.calculatedValues=t.line.map(n=>({type:"line",align:n.align,value:this.computeValue(n,a,e.length)}))),s.words.forEach((n,l)=>{t.word&&(n.calculatedValues=t.word.map(d=>({type:"word",align:d.align,value:this.computeValue(d,n.wordIndexGlobal,i)}))),t.wordLine&&(n.calculatedValues??(n.calculatedValues=[]),n.calculatedValues.push(...t.wordLine.map(d=>({type:"wordLine",align:d.align,value:this.computeValue(d,n.wordIndexInLine,s.words.length)}))));let m=r(s);n.chars.forEach(d=>{let p=[];t.char&&p.push(...t.char.map(h=>({type:"char",align:h.align,value:this.computeValue(h,d.charIndexGlobal,o)}))),t.charWord&&p.push(...t.charWord.map(h=>({type:"charWord",align:h.align,value:this.computeValue(h,d.charIndexInWord,n.chars.length)}))),t.charLine&&p.push(...t.charLine.map(h=>({type:"charLine",align:h.align,value:this.computeValue(h,d.charIndexInLine,m)}))),d.calculatedValues=p})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var It=class extends g{constructor(t){super(t);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(t){let r=Math.abs(t.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="red",t.lineWidth=2,t.beginPath(),this.history.forEach((o,s)=>{let a=s,n=i-o*this.height;s===0?t.moveTo(a,n):t.lineTo(a,n)}),t.stroke()}initCanvas(){let t=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,t.width=r,t.height=this.height,Object.assign(t.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=t,this.context=t.getContext("2d"),document.body.appendChild(t)}setTarget(t){this.target=t}clear(){this.canvas.remove(),this.history=[]}};var Ot=class extends g{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(t){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),t.textContent="FPS: 0",document.body.appendChild(t),this.displayElement=t}};var kt=class extends g{constructor(t){super(t);this.history=[];this.maxPoints=0;this.canvasHeight=0;this.currentValue=0;this.targetValue=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(t){let r=Math.abs(t.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="#007bff",t.lineWidth=2,t.beginPath(),this.history.forEach((o,s)=>{let a=s,n=i-o/2;s===0?t.moveTo(a,n):t.lineTo(a,n)}),t.stroke()}initCanvas(){this.canvas=document.createElement("canvas"),this.canvasHeight=window.innerHeight/15-20,this.canvas.width=window.innerWidth*.5,this.canvas.height=this.canvasHeight,Object.assign(this.canvas.style,{position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#000",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas)}setTarget(t){this.targetValue=t}clear(){this.canvas.remove(),this.history=[]}};var Dt=class extends g{constructor(e){super(e),this._type=2}onInit(){this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target,i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(t)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),e.setAttribute("data-dir","-"),e.setAttribute("data-val","0"),document.body.appendChild(e);let t=document.createElement("style");t.innerHTML=`
20
20
  div[data-dir][data-val]::before {
21
21
  content: attr(data-dir) ' Top: ' attr(data-val) 'px';
22
22
  }
23
- `,document.head.appendChild(t),this.displayElement=e}};function Kt(l,e){let t=null;return function(...r){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{l.apply(i,r),t=null},e)}}var It=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=e=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(e){this.fps=e,!this.isAnimationStarted&&(this.fpsInterval=1e3/e,this.then=performance.now(),this.isAnimationStarted=!0,e===0?this.animate=()=>{let t=performance.now();this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback(t)}:this.animate=()=>{let t=performance.now(),r=t-this.then;r>this.fpsInterval&&(this.then=t-r%this.fpsInterval,this.onFrameCallback(t)),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(e){this.onFrameCallback=e}destructor(){this.stop()}};var Ot=class extends g{constructor(e){super(e),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(e){e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"));let t=e.htmlElement,r=this.tools.domAttribute.process({element:t,key:"string-started",fallback:null})!==null;t.tagName.toLowerCase()==="video"&&!r&&(t.setAttribute("string-started",""),t.muted=!0,t.setAttribute("muted","muted"),t.setAttribute("playsinline",""),t.setAttribute("loop",""),t.setAttribute("autoplay",""),t.src=e.getProperty("src"),t.load(),t.addEventListener("canplay",()=>{}))}onEnterObject(e){let t=e.htmlElement;this.tryPlay(t)}onLeaveObject(e){e.htmlElement.pause()}tryPlay(e){e.play().catch(t=>console.warn("[StringVideoAutoplay] Autoplay failed:",t))}};var Vt=(r=>(r.ACTIVE="-active",r.HIDE="-hide",r.DISABLE="-disable",r))(Vt||{});var kt=class extends g{constructor(t){super(t);this.activeStepForSlides=new Map;this.hideStepForSlides=new Map;this.htmlKey="sequence",this.attributesToMap=[...this.attributesToMap,{key:"sequence",type:"string",fallback:"string[0]"}]}onInit(){super.onInit(),this.events.on("sequence",({slider:t,step:r})=>{this.objectsOnPage.forEach(o=>{let n=o.getProperty("sequence");n==`${t}[${this.hideStepForSlides.get(t)}]`&&n!=`${t}[${r}]`&&this.setSequenceState(o,"-disable"),n==`${t}[${this.activeStepForSlides.get(t)}]`&&this.setSequenceState(o,"-hide"),n==`${t}[${r}]`&&this.setSequenceState(o,"-active")});let i=this.activeStepForSlides.get(t);i!=null&&this.hideStepForSlides.set(t,i),this.activeStepForSlides.set(t,r)})}onObjectConnected(t){super.onObjectConnected(t),this.setSequenceState(t,"-disable")}setSequenceState(t,r){requestAnimationFrame(()=>{t.htmlElement.classList.remove(...Object.values(Vt)),t.htmlElement.classList.add(r)})}};var Dt=class extends g{constructor(e){super(e),this.htmlKey="form"}onObjectConnected(e){super.onObjectConnected(e);let t=e.htmlElement,r=["error","group"],i=a=>r.some(s=>a.startsWith(s+"[")),o=Array.from(t.querySelectorAll("[string-input]")).filter(a=>!i(a.getAttribute("string-input")||"")),n={};for(let a=0;a<o.length;a++){let s=o[a],c=this.getInputKey(s,a),u=this.tools.domAttribute.process({element:s,key:"input"})??"";if(n[c]=this.tools.ruleParser.process({value:u}),!s.classList.contains("-inited")){let p=s instanceof HTMLSelectElement||s instanceof HTMLInputElement&&(s.type==="checkbox"||s.type==="radio")?"change":"input";s.addEventListener(p,()=>{if(!s.classList.contains("-error"))return;let d=this.getInputKey(s,a),h=n[d],b=this.getFieldValue(s),{valid:m,errors:f}=this.tools.validation.process({rules:h,value:b}),v=t.querySelector(`[string-input="error[${d}]"]`),M=t.querySelector(`[string-input="group[${d}]"]`);if(v){v.innerHTML="";for(let y of f){let S=document.createElement("span");S.textContent=y,v.appendChild(S)}}s.classList.toggle("-error",!m),s.classList.toggle("-valid",m),M&&(M.classList.toggle("-error",!m),M.classList.toggle("-valid",m))}),s.classList.add("-inited")}}t.addEventListener("submit",a=>{a.preventDefault();let s=!0,c={};for(let u=0;u<o.length;u++){let p=o[u];if(p.disabled||p instanceof HTMLInputElement&&p.type==="hidden")continue;let d=this.getInputKey(p,u),h=n[d],b=this.getFieldValue(p);c[d]=b;let{valid:m,errors:f}=this.tools.validation.process({rules:h,value:b}),v=t.querySelector(`[string-input="error[${d}]"]`),M=t.querySelector(`[string-input="group[${d}]"]`);if(v){v.innerHTML="";for(let y of f){let S=document.createElement("span");S.textContent=y,v.appendChild(S)}}p.classList.toggle("-error",!m),p.classList.toggle("-valid",m),M&&(M.classList.toggle("-error",!m),M.classList.toggle("-valid",m)),m||(s=!1)}if(s)this.events.emit(`form:submit:${e.id}`,c);else{let u=o.find((p,d)=>{let h=this.getInputKey(p,d),b=n[h],m=this.getFieldValue(p),{valid:f}=this.tools.validation.process({rules:b,value:m});return!f});u&&typeof u.focus=="function"&&u.focus(),this.events.emit(`form:invalid:${e.id}`)}})}getInputKey(e,t){return this.tools.domAttribute.process({element:e,key:"id"})||e.getAttribute("name")||e.getAttribute("id")||`input-${t}`}getFieldValue(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){if(e.name){let t=e.form||e.closest("form"),r=t?Array.from(t.querySelectorAll(`input[type="checkbox"][name="${e.name}"]:checked`)):[e];return r.length>1?r.map(i=>i.value):r.length===1?r[0].value:""}return e.checked}if(e.type==="radio"){if(e.name){let r=(e.form||e.closest("form"))?.querySelector(`input[type="radio"][name="${e.name}"]:checked`);return r?r.value:""}return e.checked?e.value:""}return e.value}return e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value:e instanceof HTMLTextAreaElement?e.value:""}};var Wt=class l{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new It;this.debouncedResize=Kt(this.onResize,30);this.root=document.body,this.window=window,this.tools=new pt,this.data=new R,this.eventManager=new I,this.moduleManager=new G(this.data),this.objectManager=new J(this.data,this.moduleManager,this.eventManager),this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{}},this.cursorController=new Q(1,this.context),this.scrollManager=new rt(this.context),this.setupSettings({"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4}),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(e=>{this.data.time.delta=e-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=e,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(e){this.data.scroll.current=e,this.data.scroll.target=e,this.data.scroll.transformedCurrent=this.data.scroll.current*this.data.viewport.transformScale,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition(),this.moduleManager.onScroll(),this.objectManager.checkInview()}set scrollContainer(e){e instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e):e instanceof HTMLElement?(this.data.scroll.container=e,this.data.scroll.elementContainer=e,this.data.scroll.scrollContainer=e):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e),this.debouncedResize()}get speed(){return this.data.scroll.current}set speed(e){this.data.scroll.speed=e}set speedAccelerate(e){this.data.scroll.speedAccelerate=.1+(.5-.1)*e}set scrollDesktopMode(e){this.scrollManager.setDesktopMode(e)}set scrollMobileMode(e){this.scrollManager.setMobileMode(e)}static getInstance(){return l.i||(l.i=new l),l.i}reuse(e){return this.moduleManager.find(e)}use(e,t=null){let r={...this.context.settings,...t},i=new e({events:this.eventManager,data:this.data,tools:this.tools,settings:r});this.moduleManager.register(i)}on(e,t,r=""){this.eventManager.on(e,t,r)}emit(e,t){this.eventManager.emit(e,t)}off(e,t,r=""){this.eventManager.off(e,t,r)}addScrollMark(e){this.scrollManager.addScrollMark(e)}removeScrollMark(e){this.scrollManager.removeScrollMark(e)}start(e){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((a,s)=>{for(let c of a)c.type==="attributes"&&(c.attributeName==="style"||c.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(gt);let o=window.getComputedStyle(document.documentElement).fontSize,n=parseFloat(o);this.context.data.viewport.baseRem=n,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(e),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(e=>{this.objectManager.add(e)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(e=>{let t=this.tools.domAttribute.process({element:e,key:"copy-from",fallback:""});t&&t.length>0&&(this.objectManager.all.has(t)?this.objectManager.all.get(t).connects.push(e):this.objectManager.enqueueConnection(t,e))}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(e){this.context.settings={...this.context.settings,...e},this.onSettingsChange()}onMouseMoveEvent(e){this.cursorController.onMouseMove(e),this.moduleManager.onMouseMove(e)}onWheelEvent(e){e.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(e),this.moduleManager.onWheel(e))}onScrollStart(){this.moduleManager.onScrollStart(),this.eventManager.emit("scroll:start",null)}onScrollStop(){this.moduleManager.onScrollStop(),this.eventManager.emit("scroll:stop",null)}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(){this.cursorController.onSettingsChange(),this.objectManager.onSettingsChange(),this.moduleManager.onSettingsChange()}onScrollEvent(e){return e.preventDefault(),this.scrollManager.get().onScroll(e),this.moduleManager.onScroll(),this.objectManager.checkInview(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),this.eventManager.emit("update",null)}onResize(){let e=this.data.scroll.container,t=this.context.data.scroll,r=0,i=0;var o,n=0;let a=e.getBoundingClientRect();e.tagName=="BODY"?(r=window.innerWidth,i=window.innerHeight):(r=a.width,i=a.height),n=a.top,o=t.container.scrollHeight;let s=this.tools.transformScaleParser.process({value:window.getComputedStyle(e).transform});this.context.data.viewport.transformScale=s;let c=r>1080,u=this.prevWidth!==r,p=this.prevHeight!==i,d=this.context.data.viewport.contentHeight!==o,h=u||c&&p||d;this.context.data.scroll.topPosition=n,this.context.data.viewport.contentWidth=r,this.context.data.viewport.contentHeight=o,this.prevWidth=r,this.prevHeight=i,this.context.data.viewport.windowWidth=r,this.context.data.viewport.windowHeight=i;let b=window.getComputedStyle(document.documentElement).fontSize,m=parseFloat(b);this.context.data.viewport.baseRem=m*s,t.bottomPosition=this.context.data.viewport.contentHeight-i,h&&(this.context.data.scroll.container.scrollTop>0&&(this.context.data.scroll.current=this.context.data.scroll.container.scrollTop,this.context.data.scroll.target=this.context.data.scroll.container.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale),this.scrollManager.updateResponsiveMode(),this.moduleManager.onResize(),this.onSettingsChange(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}scrollToElement(e,t=0){let r=document.querySelector(e);if(r){let o=r.getBoundingClientRect().top+window.pageYOffset-this.data.scroll.container.clientTop-t;this.context.data.scroll.delta=o-this.data.scroll.current}else console.warn(`Element not found: ${e}`)}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringForm,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringScrollbar,StringSequence,StringSplit,StringTune,StringVideoAutoplay});
23
+ `,document.head.appendChild(t),this.displayElement=e}};function Qt(c,e){let t=null;return function(...r){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{c.apply(i,r),t=null},e)}}var Rt=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=e=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(e){this.fps=e,!this.isAnimationStarted&&(this.fpsInterval=1e3/e,this.then=performance.now(),this.isAnimationStarted=!0,e===0?this.animate=()=>{let t=performance.now();this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback(t)}:this.animate=()=>{let t=performance.now(),r=t-this.then;r>this.fpsInterval&&(this.then=t-r%this.fpsInterval,this.onFrameCallback(t)),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(e){this.onFrameCallback=e}destructor(){this.stop()}};var At=class extends g{constructor(e){super(e),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(e){e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"));let t=e.htmlElement,r=this.tools.domAttribute.process({element:t,key:"string-started",fallback:null})!==null;t.tagName.toLowerCase()==="video"&&!r&&(t.setAttribute("string-started",""),t.muted=!0,t.setAttribute("muted","muted"),t.setAttribute("playsinline",""),t.setAttribute("loop",""),t.setAttribute("autoplay",""),t.src=e.getProperty("src"),t.load(),t.addEventListener("canplay",()=>{}))}onEnterObject(e){let t=e.htmlElement;this.tryPlay(t)}onLeaveObject(e){e.htmlElement.pause()}tryPlay(e){e.play().catch(t=>console.warn("[StringVideoAutoplay] Autoplay failed:",t))}};var $t=(r=>(r.ACTIVE="-active",r.HIDE="-hide",r.DISABLE="-disable",r))($t||{});var Ht=class extends g{constructor(t){super(t);this.activeStepForSlides=new Map;this.hideStepForSlides=new Map;this.htmlKey="sequence",this.attributesToMap=[...this.attributesToMap,{key:"sequence",type:"string",fallback:"string[0]"}]}onInit(){super.onInit(),this.events.on("sequence",({slider:t,step:r})=>{this.objectsOnPage.forEach(o=>{let s=o.getProperty("sequence");s==`${t}[${this.hideStepForSlides.get(t)}]`&&s!=`${t}[${r}]`&&this.setSequenceState(o,"-disable"),s==`${t}[${this.activeStepForSlides.get(t)}]`&&this.setSequenceState(o,"-hide"),s==`${t}[${r}]`&&this.setSequenceState(o,"-active")});let i=this.activeStepForSlides.get(t);i!=null&&this.hideStepForSlides.set(t,i),this.activeStepForSlides.set(t,r)})}onObjectConnected(t){super.onObjectConnected(t),this.setSequenceState(t,"-disable")}setSequenceState(t,r){requestAnimationFrame(()=>{t.htmlElement.classList.remove(...Object.values($t)),t.htmlElement.classList.add(r)})}};var Ft=class extends g{constructor(e){super(e),this.htmlKey="form"}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.getProperty("form-events")?.forEach(d=>{d.eventElement.addEventListener("beforeinput",d.eventCallback),d.eventElement.removeEventListener(d.eventType,d.eventCallback)}),t.setProperty("form-events",[]),super.onObjectConnected(t);let o=t.htmlElement,s=["error","group"],a=d=>s.some(p=>d.startsWith(p+"[")),n=Array.from(o.querySelectorAll("[string-input]")).filter(d=>!a(d.getAttribute("string-input")||"")),l={};for(let d=0;d<n.length;d++){let p=n[d],h=this.getInputKey(p,d),v=this.tools.domAttribute.process({element:p,key:"input"})??"";l[h]=this.tools.ruleParser.process({value:v});let u=p instanceof HTMLSelectElement||p instanceof HTMLInputElement&&(p.type==="checkbox"||p.type==="radio")?"change":"input",b=()=>{if(!p.classList.contains("-error"))return;let M=this.getInputKey(p,d),f=l[M],x=this.getFieldValue(p),{valid:y,errors:E}=this.tools.validation.process({rules:f,value:x}),C=o.querySelector(`[string-input="error[${M}]"]`),T=o.querySelector(`[string-input="group[${M}]"]`);if(C){C.innerHTML="";for(let P of E){let F=document.createElement("span");F.textContent=P,C.appendChild(F)}}p.classList.toggle("-error",!y),p.classList.toggle("-valid",y),T&&(T.classList.toggle("-error",!y),T.classList.toggle("-valid",y))},S=M=>{let f=this.getInputKey(p,d),x=l[f],y=p.value,E=p.selectionStart??0,C=p.selectionEnd??0,T=y;switch(M.inputType){case"deleteContentBackward":T=E===C&&E>0?y.slice(0,E-1)+y.slice(C):y.slice(0,E)+y.slice(C);break;case"deleteContentForward":T=E===C&&E<y.length?y.slice(0,E)+y.slice(E+1):y.slice(0,E)+y.slice(C);break;case"insertFromPaste":case"insertFromDrop":case"insertReplacementText":T=y.slice(0,E)+(M.data||"")+y.slice(C);break;default:typeof M.data=="string"&&(T=y.slice(0,E)+M.data+y.slice(C))}let{errors:P}=this.tools.validation.process({rules:x,value:T,type:"beforeinput"});P.length>0&&M.preventDefault()};t.getProperty("form-events").push({eventElement:p,eventType:u,eventCallback:b}),console.log(typeof p),t.getProperty("form-events").push({eventElement:p,eventType:"beforeinput",eventCallback:S}),p.addEventListener("beforeinput",S),p.addEventListener(u,b),p.classList.add("-inited")}let m=d=>{d.preventDefault();let p=!0,h={};for(let v=0;v<n.length;v++){let u=n[v];if(u.disabled||u instanceof HTMLInputElement&&u.type==="hidden")continue;let b=this.getInputKey(u,v),S=l[b],M=this.getFieldValue(u);h[b]=M;let{valid:f,errors:x}=this.tools.validation.process({rules:S,value:M}),y=o.querySelector(`[string-input="error[${b}]"]`),E=o.querySelector(`[string-input="group[${b}]"]`);if(y){y.innerHTML="";for(let C of x){let T=document.createElement("span");T.textContent=C,y.appendChild(T)}}u.classList.toggle("-error",!f),u.classList.toggle("-valid",f),E&&(E.classList.toggle("-error",!f),E.classList.toggle("-valid",f)),f||(p=!1)}if(p)this.events.emit(`form:submit:${t.id}`,h);else{let v=n.find((u,b)=>{let S=this.getInputKey(u,b),M=l[S],f=this.getFieldValue(u),{valid:x}=this.tools.validation.process({rules:M,value:f});return!x});v&&typeof v.focus=="function"&&v.focus(),this.events.emit(`form:invalid:${t.id}`)}};t.getProperty("form-events").push({eventElement:o,eventType:"submit",eventCallback:m}),o.addEventListener("submit",m)}onObjectConnected(e){}getInputKey(e,t){return this.tools.domAttribute.process({element:e,key:"id"})||e.getAttribute("name")||e.getAttribute("id")||`input-${t}`}getFieldValue(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){if(e.name){let t=e.form||e.closest("form"),r=t?Array.from(t.querySelectorAll(`input[type="checkbox"][name="${e.name}"]:checked`)):[e];return r.length>1?r.map(i=>i.value):r.length===1?r[0].value:""}return e.checked}if(e.type==="radio"){if(e.name){let r=(e.form||e.closest("form"))?.querySelector(`input[type="radio"][name="${e.name}"]:checked`);return r?r.value:""}return e.checked?e.value:""}return e.value}return e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value:e instanceof HTMLTextAreaElement?e.value:""}};var zt=class c{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Rt;this.debouncedResize=Qt(this.onResize,30);this.root=document.body,this.window=window,this.tools=new ht,this.data=new N,this.eventManager=new D,this.moduleManager=new et(this.data),this.objectManager=new rt(this.data,this.moduleManager,this.eventManager),this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{}},this.cursorController=new tt(1,this.context),this.scrollManager=new nt(this.context),this.setupSettings({"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4}),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(e=>{this.data.time.delta=e-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=e,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(e){this.data.scroll.current=e,this.data.scroll.target=e,this.data.scroll.transformedCurrent=this.data.scroll.current*this.data.viewport.transformScale,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition(),this.moduleManager.onScroll(),this.objectManager.checkInview()}set scrollContainer(e){e instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e):e instanceof HTMLElement?(this.data.scroll.container=e,this.data.scroll.elementContainer=e,this.data.scroll.scrollContainer=e):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e),this.debouncedResize()}get speed(){return this.data.scroll.current}set speed(e){this.data.scroll.speed=e}set speedAccelerate(e){this.data.scroll.speedAccelerate=.1+(.5-.1)*e}set scrollDesktopMode(e){this.scrollManager.setDesktopMode(e)}set scrollMobileMode(e){this.scrollManager.setMobileMode(e)}static getInstance(){return c.i||(c.i=new c),c.i}reuse(e){return this.moduleManager.find(e)}use(e,t=null){let r={...this.context.settings,...t},i=new e({events:this.eventManager,data:this.data,tools:this.tools,settings:r});this.moduleManager.register(i)}on(e,t,r=""){this.eventManager.on(e,t,r)}emit(e,t){this.eventManager.emit(e,t)}off(e,t,r=""){this.eventManager.off(e,t,r)}addScrollMark(e){this.scrollManager.addScrollMark(e)}removeScrollMark(e){this.scrollManager.removeScrollMark(e)}start(e){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((a,n)=>{for(let l of a)l.type==="attributes"&&(l.attributeName==="style"||l.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(yt);let o=window.getComputedStyle(document.documentElement).fontSize,s=parseFloat(o);this.context.data.viewport.baseRem=s,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(e),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(e=>{this.objectManager.add(e)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(e=>{let t=this.tools.domAttribute.process({element:e,key:"copy-from",fallback:""});t&&t.length>0&&(this.objectManager.all.has(t)?this.objectManager.all.get(t).connects.push(e):this.objectManager.enqueueConnection(t,e))}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(e){this.context.settings={...this.context.settings,...e},this.onSettingsChange()}onMouseMoveEvent(e){this.cursorController.onMouseMove(e),this.moduleManager.onMouseMove(e)}onWheelEvent(e){e.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(e),this.moduleManager.onWheel(e))}onScrollStart(){this.moduleManager.onScrollStart(),this.eventManager.emit("scroll:start",null)}onScrollStop(){this.moduleManager.onScrollStop(),this.eventManager.emit("scroll:stop",null)}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(){this.cursorController.onSettingsChange(),this.objectManager.onSettingsChange(),this.moduleManager.onSettingsChange()}onScrollEvent(e){return e.preventDefault(),this.scrollManager.get().onScroll(e),this.moduleManager.onScroll(),this.objectManager.checkInview(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),this.eventManager.emit("update",null)}onResize(){let e=this.data.scroll.container,t=this.context.data.scroll,r=0,i=0;var o,s=0;let a=e.getBoundingClientRect();e.tagName=="BODY"?(r=window.innerWidth,i=window.innerHeight):(r=a.width,i=a.height),s=a.top,o=t.container.scrollHeight;let n=this.tools.transformScaleParser.process({value:window.getComputedStyle(e).transform});this.context.data.viewport.transformScale=n;let l=r>1080,m=this.prevWidth!==r,d=this.prevHeight!==i,p=this.context.data.viewport.contentHeight!==o,h=m||l&&d||p;this.context.data.scroll.topPosition=s,this.context.data.viewport.contentWidth=r,this.context.data.viewport.contentHeight=o,this.prevWidth=r,this.prevHeight=i,this.context.data.viewport.windowWidth=r,this.context.data.viewport.windowHeight=i;let v=window.getComputedStyle(document.documentElement).fontSize,u=parseFloat(v);this.context.data.viewport.baseRem=u*n,t.bottomPosition=this.context.data.viewport.contentHeight-i,h&&(this.context.data.scroll.container.scrollTop>0&&(this.context.data.scroll.current=this.context.data.scroll.container.scrollTop,this.context.data.scroll.target=this.context.data.scroll.container.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale),this.scrollManager.updateResponsiveMode(),this.moduleManager.onResize(),this.onSettingsChange(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}scrollToElement(e,t=0){let r=document.querySelector(e);if(r){let o=r.getBoundingClientRect().top+window.pageYOffset-this.data.scroll.container.clientTop-t;this.context.data.scroll.delta=o-this.data.scroll.current}else console.warn(`Element not found: ${e}`)}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringForm,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringScrollbar,StringSequence,StringSplit,StringTune,StringVideoAutoplay});
24
24
  //# sourceMappingURL=index.cjs.map