@wix/interact 2.1.2 → 2.1.4

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.
@@ -0,0 +1,18 @@
1
+ "use strict";function it(t){return[...t.matchAll(/\[([-\w]+)]/g)].map(([e,n])=>n)}function C(t,e){const n=it(e);let s=0;return n.length?t.replace(/\[]/g,()=>{const r=n[s++];return r!==void 0?`[${r}]`:"[]"}):t}class G{animations;options;ready;isCSS;constructor(e,n){this.animations=e,this.options=n,this.ready=n?.measured||Promise.resolve(),this.isCSS=e[0]instanceof CSSAnimation}getProgress(){return this.animations[0]?.effect?.getComputedTiming().progress||0}async play(e){await this.ready;for(const n of this.animations)n.play();await Promise.all(this.animations.map(n=>n.ready)),e&&e()}pause(){for(const e of this.animations)e.pause()}async reverse(e){await this.ready;for(const n of this.animations)n.reverse();await Promise.all(this.animations.map(n=>n.ready)),e&&e()}progress(e){for(const n of this.animations){const{delay:s,duration:r,iterations:i}=n.effect.getTiming(),o=(Number.isFinite(r)?r:0)*(Number.isFinite(i)?i:1);n.currentTime=((s||0)+o)*e}}cancel(){for(const e of this.animations)e.cancel()}setPlaybackRate(e){for(const n of this.animations)n.playbackRate=e}async onFinish(e){try{await Promise.all(this.animations.map(s=>s.finished));const n=this.animations[0];if(n&&!this.isCSS){const s=n.effect?.target;if(s){const r=new Event("animationend");s.dispatchEvent(r)}}e()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}async onAbort(e){try{await Promise.all(this.animations.map(n=>n.finished))}catch(n){if(n.name==="AbortError"){const s=this.animations[0];if(s&&!this.isCSS){const r=s.effect?.target;if(r){const i=new Event("animationcancel");r.dispatchEvent(i)}}e()}}}get finished(){return Promise.all(this.animations.map(e=>e.finished))}get playState(){return this.animations[0]?.playState}getTimingOptions(){return this.animations.map(e=>{const n=e.effect?.getTiming(),s=n?.delay??0,r=Number(n?.duration)||0,i=n?.iterations??1;return{delay:s,duration:r,iterations:i}})}}const Re=t=>t,rt=t=>1-Math.cos(t*Math.PI/2),ot=t=>Math.sin(t*Math.PI/2),ct=t=>-(Math.cos(Math.PI*t)-1)/2,at=t=>t**2,ft=t=>1-(1-t)**2,lt=t=>t<.5?2*t**2:1-(-2*t+2)**2/2,ut=t=>t**3,dt=t=>1-(1-t)**3,ht=t=>t<.5?4*t**3:1-(-2*t+2)**3/2,mt=t=>t**4,pt=t=>1-(1-t)**4,gt=t=>t<.5?8*t**4:1-(-2*t+2)**4/2,vt=t=>t**5,yt=t=>1-(1-t)**5,Et=t=>t<.5?16*t**5:1-(-2*t+2)**5/2,wt=t=>t===0?0:2**(10*t-10),bt=t=>t===1?1:1-2**(-10*t),St=t=>t===0?0:t===1?1:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,It=t=>1-Math.sqrt(1-t**2),Tt=t=>Math.sqrt(1-(t-1)**2),Ot=t=>t<.5?(1-Math.sqrt(1-4*t**2))/2:(Math.sqrt(-(2*t-3)*(2*t-1))+1)/2,Ct=t=>2.70158*t**3-1.70158*t**2,kt=t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,At=(t,e=1.70158*1.525)=>t<.5?(2*t)**2*((e+1)*2*t-e)/2:((2*t-2)**2*((e+1)*(t*2-2)+e)+2)/2,we={linear:Re,sineIn:rt,sineOut:ot,sineInOut:ct,quadIn:at,quadOut:ft,quadInOut:lt,cubicIn:ut,cubicOut:dt,cubicInOut:ht,quartIn:mt,quartOut:pt,quartInOut:gt,quintIn:vt,quintOut:yt,quintInOut:Et,expoIn:wt,expoOut:bt,expoInOut:St,circIn:It,circOut:Tt,circInOut:Ot,backIn:Ct,backOut:kt,backInOut:At},be={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",sineIn:"cubic-bezier(0.47, 0, 0.745, 0.715)",sineOut:"cubic-bezier(0.39, 0.575, 0.565, 1)",sineInOut:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",quadIn:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",quadOut:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",quadInOut:"cubic-bezier(0.455, 0.03, 0.515, 0.955)",cubicIn:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",cubicOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",cubicInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",quartIn:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",quartOut:"cubic-bezier(0.165, 0.84, 0.44, 1)",quartInOut:"cubic-bezier(0.77, 0, 0.175, 1)",quintIn:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",quintOut:"cubic-bezier(0.23, 1, 0.32, 1)",quintInOut:"cubic-bezier(0.86, 0, 0.07, 1)",expoIn:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",expoOut:"cubic-bezier(0.19, 1, 0.22, 1)",expoInOut:"cubic-bezier(1, 0, 0, 1)",circIn:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",circOut:"cubic-bezier(0.075, 0.82, 0.165, 1)",circInOut:"cubic-bezier(0.785, 0.135, 0.15, 0.86)",backIn:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",backOut:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",backInOut:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"};function qt(t){return t==="percentage"?"%":t||"px"}function B(t){return t?be[t]||t:be.linear}function _t(t,e,n,s){const r=3*t,i=3*(n-t)-r,o=1-r-i,c=3*e,l=3*(s-e)-c,f=1-c-l,a=d=>((o*d+i)*d+r)*d,u=d=>((f*d+l)*d+c)*d,m=d=>(3*o*d+2*i)*d+r;function g(d){let h=d;for(let y=0;y<8;y++){const w=a(h)-d;if(Math.abs(w)<1e-7)return h;const b=m(h);if(Math.abs(b)<1e-6)break;h-=w/b}let p=0,v=1;for(h=(p+v)/2;v-p>1e-7;){const y=a(h);if(Math.abs(y-d)<1e-7)return h;d>y?p=h:v=h,h=(p+v)/2}return h}return d=>d<=0?0:d>=1?1:u(g(d))}function xt(t){const e=t.match(/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/);if(!e)return;const n=parseFloat(e[1]),s=parseFloat(e[2]),r=parseFloat(e[3]),i=parseFloat(e[4]);if(![n,s,r,i].some(isNaN))return _t(n,s,r,i)}function Mt(t){const e=t.match(/^linear\((.+)\)$/);if(!e)return;const n=e[1].split(",").map(o=>o.trim()).filter(Boolean);if(n.length===0)return;const s=[];for(const o of n){const c=o.split(/\s+/),l=parseFloat(c[0]);if(isNaN(l))return;const f=[];for(let a=1;a<c.length;a++)if(c[a].endsWith("%")){const u=parseFloat(c[a])/100;if(isNaN(u))return;f.push(u)}f.length===0?s.push({output:l,pos:null}):f.length===1?s.push({output:l,pos:f[0]}):(s.push({output:l,pos:f[0]}),s.push({output:l,pos:f[1]}))}if(s.length===0)return;s[0].pos===null&&(s[0].pos=0),s[s.length-1].pos===null&&(s[s.length-1].pos=1);let r=0;for(;r<s.length;)if(s[r].pos===null){const o=r-1;let c=r;for(;c<s.length&&s[c].pos===null;)c++;const l=s[o].pos,f=s[c].pos,a=c-o;for(let u=o+1;u<c;u++)s[u].pos=l+(f-l)*(u-o)/a;r=c+1}else r++;for(let o=1;o<s.length;o++)s[o].pos<s[o-1].pos&&(s[o].pos=s[o-1].pos);const i=s;return o=>{if(o<=i[0].pos)return i[0].output;const c=i[i.length-1];if(o>=c.pos)return c.output;let l=0,f=i.length-1;for(;l<f-1;){const m=l+f>>>1;i[m].pos<=o?l=m:f=m}const a=i[l],u=i[f];return u.pos===a.pos?u.output:a.output+(u.output-a.output)*(o-a.pos)/(u.pos-a.pos)}}function He(t){if(!t)return;const e=we[t];return e||(xt(t)??Mt(t)??we.linear)}class Lt extends G{animationGroups;delay;offset;offsetEasing;timingOptions;constructor(e,n={}){const s=e.flatMap(r=>[...r.animations]);super(s),this.animationGroups=e,this.delay=n.delay??0,this.offset=n.offset??0,this.offsetEasing=typeof n.offsetEasing=="function"?n.offsetEasing:He(n.offsetEasing)??Re,this.timingOptions=this.animationGroups.map(r=>r.getTimingOptions().map(({delay:i,duration:o,iterations:c})=>({delay:i,duration:Number.isFinite(o)?o:0,iterations:Number.isFinite(c)?c:1}))),this.applyOffsets(),this.ready=Promise.all(e.map(r=>r.ready)).then(()=>{})}calculateOffsets(){const e=this.animationGroups.length;if(e<=1)return[0];const n=e-1;return Array.from({length:e},(s,r)=>this.offsetEasing(r/n)*n*this.offset|0)}applyOffsets(){if(this.animationGroups.length===0||this.animations.length===0)return;const e=this.calculateOffsets(),n=this.getSequenceActiveDuration(e);this.animationGroups.forEach((s,r)=>{s.animations.forEach((i,o)=>{const c=i.effect;if(!c)return;const{delay:l,duration:f,iterations:a}=this.timingOptions[r][o],u=l+e[r],m=n-(u+f*a);c.updateTiming({delay:u+this.delay,endDelay:m})})})}getSequenceActiveDuration(e){const n=[];for(let s=0;s<this.timingOptions.length;s++){const r=this.timingOptions[s].reduce((i,o)=>{if(!o)return i;const{delay:c,duration:l,iterations:f}=o;return Math.max(i,c+l*f)},0);n.push(e[s]+r)}return Math.max(...n)}addGroups(e){if(e.length===0)return;const n=[...e].sort((s,r)=>r.index-s.index);for(const{index:s,group:r}of n){const i=Math.min(s,this.animationGroups.length);this.animationGroups.splice(i,0,r),this.timingOptions.splice(i,0,r.getTimingOptions());const o=[...r.animations],c=this.animationGroups.slice(0,i).reduce((l,f)=>l+f.animations.length,0);this.animations.splice(c,0,...o)}this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(s=>s.ready)).then(()=>{})}removeGroups(e){const n=[],s=[],r=[];for(let i=0;i<this.animationGroups.length;i++)e(this.animationGroups[i])?n.push(this.animationGroups[i]):(s.push(this.animationGroups[i]),r.push(this.timingOptions[i]));if(n.length===0)return n;for(const i of n)i.cancel();return this.animationGroups=s,this.timingOptions=r,this.animations=s.flatMap(i=>[...i.animations]),this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(i=>i.ready)).then(()=>{}),n}async onFinish(e){try{await Promise.all(this.animationGroups.map(n=>n.finished)),e()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}}class Pt{_animation;customEffect;progress;_tickCbId;_finishHandler;constructor(e,n,s,r){const i=new KeyframeEffect(n,[],{...s,composite:"add"}),{timeline:o}=r;this._animation=new Animation(i,o),this._tickCbId=null,this.progress=null,this.customEffect=c=>e(i.target,c),this._finishHandler=c=>{this.effect.target?.getAnimations().find(l=>l===this._animation)||this.cancel()},this.addEventListener("finish",this._finishHandler),this.addEventListener("remove",this._finishHandler)}_tick(){try{const e=this.effect?.getComputedTiming().progress??null;e!==this.progress&&(this.customEffect?.(e),this.progress=e),this._tickCbId=requestAnimationFrame(()=>{this._tick()})}catch(e){this._tickCbId=null,console.error(`failed to run customEffect! effectId: ${this.id}, error: ${e instanceof Error?e.message:e}`)}}get currentTime(){return this._animation.currentTime}set currentTime(e){this._animation.currentTime=e}get startTime(){return this._animation.startTime}set startTime(e){this._animation.startTime=e}get playbackRate(){return this._animation.playbackRate}set playbackRate(e){this._animation.playbackRate=e}get id(){return this._animation.id}set id(e){this._animation.id=e}get effect(){return this._animation.effect}set effect(e){this._animation.effect=e}get timeline(){return this._animation.timeline}set timeline(e){this._animation.timeline=e}get finished(){return this._animation.finished}get pending(){return this._animation.pending}get playState(){return this._animation.playState}get ready(){return this._animation.ready}get replaceState(){return this._animation.replaceState}get oncancel(){return this._animation.oncancel}set oncancel(e){this._animation.oncancel=e}get onfinish(){return this._animation.onfinish}set onfinish(e){this._animation.onfinish=e}get onremove(){return this._animation.onremove}set onremove(e){this._animation.onremove=e}play(){this._animation.play(),cancelAnimationFrame(this._tickCbId),this._tickCbId=requestAnimationFrame(()=>this._tick())}pause(){this._animation.pause(),cancelAnimationFrame(this._tickCbId),this._tickCbId=null}cancel(){this.removeEventListener("finish",this._finishHandler),this.removeEventListener("remove",this._finishHandler),this._animation.cancel(),this.customEffect(null),cancelAnimationFrame(this._tickCbId),this._tickCbId=null}commitStyles(){console.warn("CustomEffect animations do not support commitStyles method as they have no style to commit")}finish(){this._animation.finish()}persist(){this._animation.persist()}reverse(){this._animation.reverse()}updatePlaybackRate(e){this._animation.updatePlaybackRate(e)}addEventListener(e,n,s){this._animation.addEventListener(e,n,s)}removeEventListener(e,n,s){this._animation.removeEventListener(e,n,s)}dispatchEvent(e){return this._animation.dispatchEvent(e)}}function $t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K={exports:{}},Se=K.exports,Ie;function Ft(){return Ie||(Ie=1,(function(t){(function(e){var n=function(){},s=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(a){return setTimeout(a,16)};function r(){var a=this;a.reads=[],a.writes=[],a.raf=s.bind(e)}r.prototype={constructor:r,runTasks:function(a){for(var u;u=a.shift();)u()},measure:function(a,u){var m=u?a.bind(u):a;return this.reads.push(m),i(this),m},mutate:function(a,u){var m=u?a.bind(u):a;return this.writes.push(m),i(this),m},clear:function(a){return c(this.reads,a)||c(this.writes,a)},extend:function(a){if(typeof a!="object")throw new Error("expected object");var u=Object.create(this);return l(u,a),u.fastdom=this,u.initialize&&u.initialize(),u},catch:null};function i(a){a.scheduled||(a.scheduled=!0,a.raf(o.bind(null,a)))}function o(a){var u=a.writes,m=a.reads,g;try{n("flushing reads",m.length),a.runTasks(m),n("flushing writes",u.length),a.runTasks(u)}catch(d){g=d}if(a.scheduled=!1,(m.length||u.length)&&i(a),g)if(n("task errored",g.message),a.catch)a.catch(g);else throw g}function c(a,u){var m=a.indexOf(u);return!!~m&&!!a.splice(m,1)}function l(a,u){for(var m in u)u.hasOwnProperty(m)&&(a[m]=u[m])}var f=e.fastdom=e.fastdom||new r;t.exports=f})(typeof window<"u"?window:typeof Se<"u"?Se:globalThis)})(K)),K.exports}var Rt=Ft();const T=$t(Rt),fe={};function Ht(t){Object.assign(fe,t)}function zt(t){return t in fe?fe[t]:(console.warn(`${t} not found in registry. Please make sure to import and register the preset.`),null)}function M(t,e){return t?document.getElementById(t):null}function Gt(t,e){return t?.matches(`[data-motion-part~="${e}"]`)?t:t?.querySelector(`[data-motion-part~="${e}"]`)}function Dt(t){const e=t.alternate?"alternate":"";return t.reversed?`${e?`${e}-`:""}reverse`:e||"normal"}function re(t){return`${t.value}${qt(t.unit)}`}function Te(t,e,n){return`${t.name||"cover"} ${n&&t.offset.unit!=="percentage"?`calc(100% + ${re(t.offset)}${e?` + ${e}`:""})`:e?`calc(${re(t.offset)} + ${e})`:re(t.offset)}`}function Nt(t){return{start:Te(t.startOffset,t.startOffsetAdd),end:Te(t.endOffset,t.endOffsetAdd,!0)}}function ze(t){return e=>T.measure(()=>e(t))}function Ge(t){return e=>T.mutate(()=>e(t))}function Z(t){if(t.namedEffect){const e=t.namedEffect.type;return typeof e=="string"?zt(e):null}else if(t.keyframeEffect){const e=s=>{const{name:r,keyframes:i}=s.keyframeEffect;return[{...s,name:r,keyframes:i}]};return{web:e,style:e,getNames:s=>{const{effectId:r}=s,{name:i}=s.keyframeEffect,o=i||r;return o?[o]:[]}}}else if(t.customEffect)return e=>[{...e,keyframes:[]}];return null}function Vt(t,e,n){return t.map((s,r)=>{const i={fill:s.fill,easing:B(s.easing),iterations:s.iterations===0?1/0:s.iterations||1,composite:s.composite,direction:Dt(s)};return De(e)?(i.duration=s.duration,i.delay=s.delay||0):window.ViewTimeline&&e?.trigger==="view-progress"?i.duration="auto":(i.duration=99.99,i.delay=.01),{effect:s,options:i,id:n&&`${n}-${r+1}`,part:s.part}})}function De(t){return!t||t.trigger!=="pointer-move"&&t.trigger!=="view-progress"}function Oe(t,e,n,s,r){if(t){if(De(s)&&(e.duration=e.duration||1,r?.reducedMotion))if(e.iterations===1||e.iterations==null)e={...e,duration:1};else return[];let i;return n instanceof HTMLElement&&(i={measure:ze(n),mutate:Ge(n)}),t.web?t.web(e,i,r):t(e,i,r)}return[]}function ve(t,e,n,s,r){const i=t instanceof HTMLElement?t:M(t);if(n?.trigger==="pointer-move"&&!e.keyframeEffect){let m=e;e.customEffect&&(m={...e,namedEffect:{id:"",type:"CustomMouse"}});const g=Z(m),d=Oe(g,e,i,n,s);return typeof d!="function"?null:d(i)}const o=Z(e),c=Oe(o,e,i,n,s);if(!c||c.length===0)return null;const l=Vt(c,n,e.effectId);let f;const a=n?.trigger==="view-progress";a&&window.ViewTimeline&&(f=new ViewTimeline({subject:n.element||M(n.componentId)}));const u=l.map(({effect:m,options:g,id:d,part:h})=>{const p=h?Gt(i,h):i,v=new KeyframeEffect(p||null,[],g);T.mutate(()=>{"timing"in m&&v.updateTiming(m.timing),v.setKeyframes(m.keyframes)});const y=a&&f?{timeline:f}:{},w=typeof m.customEffect=="function"?new Pt(m.customEffect,p||null,g,y):new Animation(v,y.timeline);if(a)if(f)T.mutate(()=>{const{start:b,end:S}=Nt(m);w.rangeStart=b,w.rangeEnd=S,w.play()});else{const{startOffset:b,endOffset:S}=e;T.mutate(()=>{const I=m.startOffset||b,$=m.endOffset||S;Object.assign(w,{start:{name:I.name,offset:I.offset?.value,add:m.startOffsetAdd},end:{name:$.name,offset:$.offset?.value,add:m.endOffsetAdd}})})}return d&&(w.id=d),w});return new G(u,{...e,trigger:{...n||{}},measured:new Promise(m=>T.mutate(m))})}function Wt(t,e,n){const s=Z(e),r=t instanceof HTMLElement?t:M(t);if(s&&s.prepare&&r){const i={measure:ze(r),mutate:Ge(r)};s.prepare(e,i)}n&&T.mutate(n)}function jt(t,e){const n=Z(e);if(!n)return null;if(!n.style)return e.effectId&&t?Yt(t,e.effectId):null;const s=n.getNames(e),i=(typeof t=="string"?M(t):t)?.getAnimations(),o=i?.map(l=>l.animationName)||[],c=[];return s.forEach(l=>{o.includes(l)&&c.push(i?.find(f=>f.animationName===l))}),c?.length?new G(c):null}function Yt(t,e){const s=(typeof t=="string"?M(t):t)?.getAnimations().filter(r=>{const i=r.id||r.animationName;return i?i.startsWith(e):!0});return s?.length?new G(s):null}function Ne(t,e,n,s={}){const{disabled:r,allowActiveEvent:i,...o}=s,c=ve(t,e,n,o);if(!c)return null;let l={};if(n.trigger==="view-progress"&&!window.ViewTimeline){const f=n.element||M(n.componentId),{ready:a}=c;return c.animations.map(u=>({get start(){return u.start},get end(){return u.end},viewSource:f,ready:a,getProgress(){return c.getProgress()},effect(m,g){const{activeDuration:d}=u.effect.getComputedTiming(),{delay:h}=u.effect.getTiming();u.currentTime=((h||0)+(d||0))*g},disabled:r,destroy(){u.cancel()}}))}else if(n.trigger==="pointer-move"){const f=e,{centeredToTarget:a,transitionDuration:u,transitionEasing:m}=f,g=n.axis;if(f.keyframeEffect){const d=c;return d.animations?.length===0?null:{target:void 0,centeredToTarget:a,ready:d.ready,_currentProgress:0,getProgress(){return this._currentProgress},effect(p,v){const y=g==="x"?v.x:v.y;this._currentProgress=y,d.progress(y)},disabled:r??!1,destroy(){d.cancel()}}}l={centeredToTarget:a,allowActiveEvent:i},e.customEffect&&u&&(l.transitionDuration=u,l.transitionEasing=He(m)),l.target=c.target}return{...l,getProgress(){return c.getProgress()},effect(f,a,u,m){c.progress(u?{...a,v:u,active:m}:a)},disabled:r,destroy(){c.cancel()}}}function ne(t,e,n,s=!1){const r=jt(t,e);return r?(r.ready=new Promise(i=>{Wt(t,e,i)}),r):ve(t,e,n,{reducedMotion:s})}function Bt(t){return t===null?[null]:typeof t=="string"?Array.from(document.querySelectorAll(t)):Array.isArray(t)?t:[t]}function Ve(t,e){const n=[];for(const{target:s,options:r}of t){const i=Bt(s);for(const o of i){const c=ne(o,r,void 0,e?.reducedMotion);c instanceof G&&n.push(c)}}return n}function Kt(t,e,n){const s=Ve(e,n);return new Lt(s,t)}function Q(t,e){return e.includes("&")?e.replace(/&/g,t):`${t}${e}`}function _(){return"wi-12343210".replace(/\d/g,t=>String.fromCharCode((+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4)+97))}function Qt({key:t,effectId:e,transition:n,properties:s,childSelector:r="> :first-child",selectorCondition:i}){let o=[];if(n?.styleProperties){const{duration:d,easing:h,delay:p}=n;d&&(n.styleProperties.some(y=>y.name.startsWith("--"))?o=[`all ${d}ms ${B(h||"ease")}${p?` ${p}ms`:""}`,"visibility 0s"]:o=n.styleProperties.map(y=>`${y.name} ${d}ms ${B(h||"ease")}${p?` ${p}ms`:""}`)),s=n.styleProperties}else o=s?.filter(d=>d.duration).map(d=>`${d.name} ${d.duration}ms ${B(d.easing)||"ease"}${d.delay?` ${d.delay}ms`:""}`)||[];const c=s?.map(d=>`${d.name}: ${d.value};`)||[],l=t.replace(/"/g,"'"),f=`:is(:state(${e}), :--${e}) ${r}`,a=`[data-interact-effect~="${e}"] ${r}`,u=i?Q(f,i):f,m=i?Q(a,i):a,g=[`${u},
2
+ ${m} {
3
+ ${c.join(`
4
+ `)}
5
+ }`];if(o.length){const d=`[data-interact-key="${l}"] ${r}`,h=i?Q(d,i):d;g.push(`@media (prefers-reduced-motion: no-preference) { ${h} {
6
+ transition: ${o.join(", ")};
7
+ } }`)}return g}function k(t,e){const n=(t||[]).filter(i=>e[i]?.type==="media"&&e[i].predicate).map(i=>e[i].predicate).join(") and ("),s=n&&`(${n})`;return s&&window.matchMedia(s)}function L(t,e){for(const n of t||[]){const s=e[n];if(s?.type==="selector"&&s.predicate)return s.predicate}}const N={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function Xt(t,e){const n=t?.name??N.rangeStart.name,s=e?.name??t?.name??N.rangeEnd.name,r={name:n,offset:t?.offset||N.rangeStart.offset},i={name:s,offset:e?.offset||N.rangeEnd.offset};return{startOffset:r,endOffset:i}}function P(t){if("keyframeEffect"in t&&!t.keyframeEffect.name&&"effectId"in t&&(t.keyframeEffect.name=t.effectId),"duration"in t)return{id:"",...t};const{rangeStart:e,rangeEnd:n,...s}=t,{startOffset:r,endOffset:i}=Xt(e,n);return{id:"",startOffset:r,endOffset:i,...s}}function O(t,e,n){let s=t.get(e);s||(s=new Set,t.set(e,s)),s.add(n)}function D(t,e){t.get(e)?.forEach(s=>{const{source:r,target:i,cleanup:o}=s;o();const c=r===e?i:r;t.get(c)?.delete(s)}),t.delete(e)}const Ut={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},Jt={root:null,rootMargin:"0px",threshold:[0]},Zt=.2;function en(t){const e=t.trim().split(/\s+/),n=e[0],s=e.length>1?e[1]:e[0],r=i=>i.startsWith("-")?i.slice(1):parseFloat(i)?`-${i}`:i;return`${r(n)} 0px ${r(s)}`}const H={},ee=new WeakMap,X=new WeakSet,U=new WeakMap;let We={},F=null;function tn(t){We=t}function je(t,e){ee.get(t)?.forEach(({source:s,handler:r})=>{s===t&&r(e)})}function Ce(){return F||(F=new IntersectionObserver(t=>{t.forEach(e=>{const n=e.target;e.isIntersecting||je(n,!1)})},Jt),F)}function Ye(t,e=!1){const n=JSON.stringify({...t,isSafeMode:e});if(H[n])return H[n];const s=t.threshold??Zt,r=e?Ut:{root:null,rootMargin:t.inset?en(t.inset):"0px",threshold:s},i=new IntersectionObserver(o=>{o.forEach(c=>{const l=c.target,f=!X.has(l);if(f&&(X.add(l),t.useSafeViewEnter&&!c.isIntersecting)){T.measure(()=>{const u=c.boundingClientRect.height,m=c.rootBounds?.height;if(!m)return;const g=Array.isArray(t.threshold)?Math.min(...t.threshold):t.threshold;g&&u*g>m&&T.mutate(()=>{i.unobserve(l);const h=Ye(t,!0);U.set(l,h),h.observe(l)})});return}const a=t.type||"once";(c.isIntersecting||a==="alternate"&&!f)&&(je(l,c.isIntersecting),a==="once"&&(i.unobserve(c.target),X.delete(l)))})},r);return H[n]=i,i}function nn(t,e,n,s={},{reducedMotion:r,selectorCondition:i,animation:o}={}){const c={...We,...s},l=c.type||"once",f=o||ne(e,P(n),void 0,r);if(!f)return;const a=Ye(c);l!=="once"&&f.persist?.();let u=!0;const d={source:t,target:e,handler:h=>{i&&!e.matches(i)||(l==="once"?h&&f.play(()=>{const p=()=>{e.dataset.interactEnter="start"};if(f.isCSS){T.mutate(()=>{requestAnimationFrame(p)});const v=()=>{T.mutate(()=>{e.dataset.interactEnter="done"})};f.onFinish(v),f.onAbort(v)}else T.mutate(p)}):l==="alternate"?u&&h?(u=!1,f.play()):u||f.reverse():l==="repeat"?h?(f.progress(0),f.play()):(f.pause(),f.progress(0)):l==="state"&&(h?f.play():f.pause()))},cleanup:()=>{(U.get(t)||a).unobserve(t),(l==="repeat"||l==="state")&&Ce().unobserve(t),f.cancel(),X.delete(t),U.delete(t)}};O(ee,t,d),O(ee,e,d),U.set(t,a),a.observe(t),(l==="repeat"||l==="state")&&Ce().observe(t)}function sn(t){D(ee,t)}function rn(){F=null,Object.keys(H).forEach(t=>delete H[t])}const ke={add:nn,remove:sn,setOptions:tn,reset:rn};function Be(t,e){return Object.assign(Object.create(e),t)}function on(t,e,n,s){let r=t*(1-n)+e*n;if(s){const i=r-t;Math.abs(i)<s&&(r=t+s*Math.sign(i));const o=e-r;if(Math.abs(o)<s)return e}return r}function cn(t){let e=!1;return function(){e||(e=!0,window.requestAnimationFrame(()=>{e=!1,t()}))}}function Ae(t,e){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,t()},e)}}function an(t,e){const n=t.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);return te(n[1],e)+te(n[6],e)}function te(t,e){return t?/^-?\d+px$/.test(t)?parseInt(t):/^-?\d+[lsd]?vh$/.test(t)?parseInt(t)*e.viewportHeight/100:/^-?\d+[lsd]?vw$/.test(t)?parseInt(t)*e.viewportWidth/100:/^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(t)?an(t,e):parseInt(t)||0:0}function q(t,e,n){const{name:s,offset:r=0}=t,{start:i,end:o}=n,c=o-i,l=r/100;let f,a;return s==="entry"?(f=i-e,a=Math.min(e,c)):s==="entry-crossing"?(f=i-e,a=c):s==="contain"?(f=Math.min(o-e,i),a=Math.abs(e-c)):s==="exit"?(f=Math.max(i,o-e),a=Math.min(e,c)):s==="exit-crossing"?(f=i,a=c):s==="cover"&&(f=i-e,a=c+e),f+l*a|0}function oe(t,e,n,s,r){let i=0;const o={start:e,end:n};return t.forEach((c,l)=>{i+=c.offset;const f=c.sticky;if(f){if("end"in f&&t[l-1]?.element){const m=((r?c.element.offsetWidth:c.element.offsetHeight)||0)+f.end-s,g=i+m-c.offset,d=g<o.start,h=!d&&g<=n;let p=0;(d||h)&&(p=c.offset,o.end+=p),d&&(o.start+=p)}if("start"in f){const a=i-f.start,u=a<o.start,m=!u&&a<=o.end;let g=0;const d=t[l-1]?.element;if(d){if(u||m){const h=(r?d.offsetWidth:d.offsetHeight)||0,p=c.offset,v=(r?c.element.offsetWidth:c.element.offsetHeight)||0;g=h-(p+v),i+=g,o.end+=g}u&&(o.start+=g)}}}}),o}function fn(t,e,n,s,r,i){const{start:o,end:c,duration:l}=t;let f=o,a=c,u=t.startRange,m=t.endRange,g;if(typeof l=="string"){u={name:l,offset:0},m={name:l,offset:100},f=q(u,n,e),a=q(m,n,e),g=a-f;const d=oe(i,f,a,n,s);f=d.start,a=d.end}else{if(u||o?.name){u=u||o;const d=te(u.add,r),h=q({...u,offset:0},n,e),p=q({...u,offset:100},n,e),v=oe(i,h,p,n,s);f=v.start+u.offset/100*(v.end-v.start)+d}if(m||c?.name){m=m||c;const d=te(m.add,r),h=q({...m,offset:0},n,e),p=q({...m,offset:100},n,e),v=oe(i,h,p,n,s);a=v.start+m.offset/100*(v.end-v.start)+d}else typeof l=="number"&&(a=f+l)}return!g&&!l&&(g=a-f),{...t,start:f,end:a,startRange:u,endRange:m,duration:g||l}}function ln(t){return t.position==="sticky"}function un(t,e,n){return t.position==="fixed"&&(!e||e===window.document.body||e===n)}function dn(t,e){return parseInt(e?t.left:t.top)}function hn(t,e){return parseInt(e?t.right:t.bottom)}function mn(t,e,n){n&&(t.style.position="static");const s=(e?t.offsetLeft:t.offsetTop)||0;return n&&(t.style.position=null),s}function pn(t,e){let n;const s=dn(t,e),r=hn(t,e),i=!isNaN(s),o=!isNaN(r);return(i||o)&&(n={},i&&(n.start=s),o&&(n.end=r)),n}function V(t,e,n,s,r){const i=t[0].viewSource,o=[];let c=(s?i.offsetWidth:i.offsetHeight)||0,l=0,f=i;for(;f;){const u=window.getComputedStyle(f),m=ln(u),g=m?pn(u,s):void 0,d=mn(f,s,m);if((!g||!("end"in g))&&(l+=d),o.push({element:f,offset:d,sticky:g}),f=f.offsetParent,un(u,f,e))break;if(f===e){o.push({element:f,offset:0});break}}return o.reverse(),t.map(u=>({...fn(u,{start:l,end:l+c},n,s,r,o)}))}const qe=100,gn={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function vn(t,e,n,s){let r=0;return t>=e&&t<=n?r=s?(t-e)/s:1:t>n&&(r=1),r}function _e(t,e){return t===window?e?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:e?t.clientWidth:t.clientHeight}function yn(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function En(t){const e=Be(t,gn),n=e.root,s=e.horizontal,r=new WeakMap;let i=_e(n,s),o,c,l,f,a;const u=[],m=yn();if(e.scenes=Object.values(t.scenes.reduce((h,p,v)=>{const y=p.groupId?`group-${p.groupId}`:String(v);return h[y]?h[y].push(p):h[y]=[p],h},{})).flatMap(h=>(h.every(p=>p.viewSource&&(typeof p.duration=="string"||p.start?.name))?(h=V(h,n,i,s,m),(e.observeSourcesResize||e.observeContentResize)&&u.push(h)):h.forEach(p=>{p.end==null&&(p.end=p.start+p.duration),p.duration==null&&(p.duration=p.end-p.start)}),h)),e.scenes.forEach((h,p)=>{h.index=p}),u.length){const h=new Map;window.ResizeObserver&&(l=new window.ResizeObserver(function(p){p.forEach(v=>{const y=h.get(v.target),w=V(y,n,i,s,m);w.forEach((b,S)=>{e.scenes[b.index]=w[S]}),u.splice(u.indexOf(y),1,w)})}),u.forEach(p=>{l.observe(p[0].viewSource,{box:"border-box"}),h.set(p[0].viewSource,p)}),e.observeContentResize&&e.contentRoot&&new window.ResizeObserver(Ae(()=>{const v=u.map(y=>{const w=V(y,n,i,s,m);return w.forEach((b,S)=>{e.scenes[b.index]=w[S]}),w});u.length=0,u.push(...v),u.forEach(y=>{h.set(y[0].viewSource,y)})},qe)).observe(e.contentRoot,{box:"border-box"})),e.observeViewportResize&&(f=Ae(function(){i=_e(n,s);const p=u.map(v=>{const y=V(v,n,i,s,m);return y.forEach((w,b)=>{e.scenes[w.index]=y[b]}),y});u.length=0,u.push(...p),u.forEach(v=>{h.set(v[0].viewSource,v)})},qe),n===window?window.addEventListener("resize",f):window.ResizeObserver&&(a=new window.ResizeObserver(f),a.observe(n,{box:"border-box"})))}e.observeViewportEntry&&window.IntersectionObserver&&(c=new window.IntersectionObserver(function(h){h.forEach(p=>{(r.get(p.target)||[]).forEach(v=>{v.disabled=!p.isIntersecting})})},{root:n===window?window.document:n,rootMargin:e.viewportRootMargin,threshold:0}),e.scenes.forEach(h=>{if(h.viewSource){let p=r.get(h.viewSource);p||(p=[],r.set(h.viewSource,p),c.observe(h.viewSource)),p.push(h)}}));function g({p:h,vp:p}){h=+h.toFixed(1);const v=+p.toFixed(4);if(h!==o){for(let y of e.scenes)if(!y.disabled){const{start:w,end:b,duration:S}=y,I=vn(h,w,b,S);y.effect(y,I,v)}o=h}}function d(){e.scenes.forEach(h=>h.destroy?.()),c&&(c.disconnect(),c=null),l&&(l.disconnect(),l=null),f&&(a?(a.disconnect(),a=null):window.removeEventListener("resize",f))}return{tick:g,destroy:d}}const wn={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class bn{constructor(e={}){this.config=Be(e,wn),this.progress={p:0,prevP:0,vp:0},this.currentProgress={p:0,prevP:0,vp:0},this._lerpFrameId=0,this.effect=null;const n=!this.config.root||this.config.root===window.document.body;this.config.root=n?window:this.config.root,this.config.contentRoot=this.config.contentRoot||(n?window.document.body:this.config.root.firstElementChild),this.config.resetProgress=this.config.resetProgress||this.resetProgress.bind(this),this._measure=this.config.measure||(()=>{const s=this.config.root;this.progress.p=this.config.horizontal?s.scrollX||s.scrollLeft||0:s.scrollY||s.scrollTop||0}),this._trigger=cn(()=>{this._measure?.(),this.tick(!0)})}start(){this.setupEffect(),this.setupEvent(),this.resetProgress(),this.tick()}pause(){this.removeEvent()}resetProgress(e={}){const n=this.config.root,s=e.x||e.x===0?e.x:n.scrollX||n.scrollLeft||0,r=e.y||e.y===0?e.y:n.scrollY||n.scrollTop||0,i=this.config.horizontal?s:r;this.progress.p=i,this.progress.prevP=i,this.progress.vp=0,this.config.transitionActive&&(this.currentProgress.p=i,this.currentProgress.prevP=i,this.currentProgress.vp=0),e&&this.config.root.scrollTo(s,r)}tick(e){const n=this.config.transitionActive;n&&this.lerp();const s=n?this.currentProgress:this.progress;if(this.config.velocityActive){const r=s.p-s.prevP,i=r<0?-1:1;s.vp=Math.min(this.config.velocityMax,Math.abs(r))/this.config.velocityMax*i}this.effect.tick(s),n&&s.p!==this.progress.p&&(e&&this._lerpFrameId&&window.cancelAnimationFrame(this._lerpFrameId),this._lerpFrameId=window.requestAnimationFrame(()=>this.tick())),s.prevP=s.p}lerp(){this.currentProgress.p=on(this.currentProgress.p,this.progress.p,+(1-this.config.transitionFriction).toFixed(3),this.config.transitionEpsilon)}destroy(){this.pause(),this.removeEffect()}setupEvent(){this.removeEvent(),this.config.root.addEventListener("scroll",this._trigger)}removeEvent(){this.config.root.removeEventListener("scroll",this._trigger)}setupEffect(){this.removeEffect(),this.effect=En(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const le=new WeakMap;let Ke=()=>({});function Sn(t){Ke=t}function In(t,e,n,s,{reducedMotion:r}){if(r)return;const i={trigger:"view-progress",element:t},o=P(n);let c;if("ViewTimeline"in window){const f=ve(e,o,i);f&&(f.play(),c=()=>{f.ready.then(()=>{f.cancel()})})}else{const f=Ne(e,o,i);if(f){const a=Array.isArray(f)?f:[f],u=new bn({viewSource:t,scenes:a,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...Ke()});c=()=>{u.destroy()},Promise.all(a.map(m=>m.ready||Promise.resolve())).then(()=>{u.start()})}}if(!c)return;const l={source:t,target:e,cleanup:c};O(le,t,l),O(le,e,l)}function Tn(t){D(le,t)}const On={add:In,remove:Tn,registerOptionsGetter:Sn};function xe(t,e,n){return Math.min(Math.max(t,n),e)}function Me(t){let e=!1;return function(){if(!e)return e=!0,window.requestAnimationFrame(()=>{e=!1,t()})}}function Cn(t){let e=t,n=0,s=0;if(e.offsetParent)do n+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;while(e);return{left:n,top:s,width:t.offsetWidth,height:t.offsetHeight}}function kn(){const t=window.devicePixelRatio;let e=!1;if(t===1)return!1;document.body.addEventListener("pointerdown",s=>{e=s.offsetX!==10},{once:!0});const n=new PointerEvent("pointerdown",{clientX:10});return document.body.dispatchEvent(n),e}function An(){return new Promise(t=>{const e=window.scrollY;let n=!1,s;function r(){document.body.addEventListener("pointerdown",c=>{s===void 0?s=c.offsetY:n=c.offsetY===s},{once:!0});const o=new PointerEvent("pointerdown",{clientY:500});document.body.dispatchEvent(o)}function i(){window.scrollY!==e&&(window.removeEventListener("scroll",i),r(),t(n))}r(),window.addEventListener("scroll",i),window.scrollY>0&&window.scrollBy(0,-1)})}function qn(t){An().then(e=>{t.fixRequired=e,e&&(window.addEventListener("scroll",t.scrollHandler),t.scrollHandler())})}let W=0;const J=new Set;function _n(){const t=n=>{for(let s of n.changedTouches)J.add(s.identifier)},e=n=>{for(let s of n.changedTouches)J.delete(s.identifier)};return document.addEventListener("touchstart",t,{passive:!0}),document.addEventListener("touchend",e,{passive:!0}),function(){J.clear(),document.removeEventListener("touchstart",t),document.removeEventListener("touchend",e)}}function xn(t,e){if("onscrollend"in window)return t.addEventListener("scrollend",e),function(){t.removeEventListener("scrollend",e)};let n=0,s;W||(s=_n()),W+=1;function r(i){clearTimeout(n),n=setTimeout(()=>{J.size?setTimeout(r,100):(e(i),n=0)},100)}return t.addEventListener("scroll",r),function(){t.removeEventListener("scroll",r),W-=1,W||s()}}function Mn(t,e,n){return{x(s){const r=t.left-n.x+t.width/2,i=r>=e.width/2,o=(i?r:e.width-r)*2,c=i?0:r-o/2;return(s-c)/o},y(s){const r=t.top-n.y+t.height/2,i=r>=e.height/2,o=(i?r:e.height-r)*2,c=i?0:r-o/2;return(s-c)/o}}}function Ln(t,e){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>t&&t(e))}function Pn(t){t.rect.width=window.document.documentElement.clientWidth,t.rect.height=window.document.documentElement.clientHeight}function $n(t){const e=new ResizeObserver(n=>{n.forEach(s=>{t.rect.width=s.borderBoxSize[0].inlineSize,t.rect.height=s.borderBoxSize[0].blockSize})});return e.observe(t.root,{box:"border-box"}),e}function Fn(t){let e=!1,n={x:t.rect.width/2,y:t.rect.height/2,vx:0,vy:0},s,r,i,o,c;const l={x:0,y:0};t.scenes.forEach(a=>{a.target&&a.centeredToTarget&&(a.transform=Mn(Cn(a.target),t.rect,l),e=!0),t.root?r=$n(t):(i=Pn.bind(null,t),window.addEventListener("resize",i))}),s=function(a){for(let u of t.scenes)if(!u.disabled){const m=u.transform?.x(a.x)||a.x/t.rect.width,g=u.transform?.y(a.y)||a.y/t.rect.height,d=+xe(0,1,m).toPrecision(4),h=+xe(0,1,g).toPrecision(4),p={x:a.vx,y:a.vy};t.allowActiveEvent&&(a.active=m<=1&&g<=1&&m>=0&&g>=0),u.effect(u,{x:d,y:h},p,a.active)}Object.assign(n,a)},e&&(o=Ln.bind(l,s,n),c=xn(document,o));function f(){t.scenes.forEach(a=>a.destroy?.()),c?.(),r?(r.disconnect(),r=null):(window.removeEventListener("resize",i),i=null),s=null,n=null}return{tick:s,destroy:f}}const Rn=1e3/60*3;let j;function Hn(){x.x=window.scrollX,x.y=window.scrollY}const x={x:0,y:0,scrollHandler:Hn,fixRequired:void 0};class zn{constructor(e={}){this.config={...e},this.effect=null,this._nextTick=null,this._nextTransitionTick=null,this._startTime=0;let n;this.config.transitionDuration?n=this.config.noThrottle?()=>this.transition():Me(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):Me(()=>{this.tick()}),this.config.rect=this.config.root?{width:this.config.root.offsetWidth,height:this.config.root.offsetHeight}:{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight},this.progress={x:this.config.rect.width/2,y:this.config.rect.height/2,vx:0,vy:0},this.previousProgress={...this.progress},this.currentProgress=null;const s=r=>{const i=this.config.root?r.offsetX:r.x,o=this.config.root?r.offsetY:r.y;this.progress.vx=i-this.progress.x,this.progress.vy=o-this.progress.y,this.progress.x=i,this.progress.y=o,this._nextTick=n()};if(this._pointerLeave=()=>{this.progress.active=!1,this.progress.vx=0,this.progress.vy=0,this._nextTick=n()},this._pointerEnter=()=>{this.progress.active=!0,this._nextTick=n()},this.config.root){j=typeof j=="boolean"?j:kn();const r=j?window.devicePixelRatio:1;typeof x.fixRequired>"u"&&qn(x),this._measure=i=>{if(i.target!==this.config.root){const o=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:i.x*r+x.x,clientY:i.y*r+x.y});i.stopPropagation(),this.config.root.dispatchEvent(o)}else s(i)}}else this._measure=s}start(){this.setupEffect(),this.setupEvent()}pause(){this.removeEvent()}tick(){this.effect.tick(this.progress)}transition(){const e=this.config.transitionDuration,n=this.config.transitionEasing||(o=>o),s=performance.now();let r=!1;const i=o=>{const c=(o-this._startTime)/e,l=n(Math.min(1,c));r&&(this.progress.vx=0,this.progress.vy=0,r=!1),this.currentProgress=Object.entries(this.progress).reduce((f,[a,u])=>(a==="active"?f[a]=u:f[a]=this.previousProgress[a]+(u-this.previousProgress[a])*l,f),this.currentProgress||{}),c<1&&(this._nextTransitionTick=requestAnimationFrame(i),r=o-this._startTime>Rn),this.effect.tick(this.currentProgress)};return this._startTime?(this._nextTransitionTick&&cancelAnimationFrame(this._nextTransitionTick),Object.assign(this.previousProgress,this.currentProgress),this._startTime=s,i(s)):this._startTime=s,this._nextTransitionTick}destroy(){this.pause(),this.removeEffect(),this._nextTick&&cancelAnimationFrame(this._nextTick),this._nextTransitionTick&&cancelAnimationFrame(this._nextTransitionTick)}setupEvent(){this.removeEvent();const e=this.config.root||window;e.addEventListener("pointermove",this._measure,{passive:!0}),this.config.eventSource&&this.config.eventSource.addEventListener("pointermove",this._measure,{passive:!0}),this.config.allowActiveEvent&&(e.addEventListener("pointerleave",this._pointerLeave,{passive:!0}),e.addEventListener("pointerenter",this._pointerEnter,{passive:!0}),this.config.eventSource&&(this.config.eventSource.addEventListener("pointerleave",this._pointerLeave,{passive:!0}),this.config.eventSource.addEventListener("pointerenter",this._pointerEnter,{passive:!0})))}removeEvent(){const e=this.config.root||window;e.removeEventListener("pointermove",this._measure),this.config.eventSource&&this.config.eventSource.removeEventListener("pointermove",this._measure),this.config.allowActiveEvent&&(e.removeEventListener("pointerleave",this._pointerLeave),e.removeEventListener("pointerenter",this._pointerEnter),this.config.eventSource&&(this.config.eventSource.removeEventListener("pointerleave",this._pointerLeave),this.config.eventSource.removeEventListener("pointerenter",this._pointerEnter)))}setupEffect(){this.removeEffect(),this.effect=Fn(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const ue=new WeakMap;let Qe=()=>({});function Gn(t){Qe=t}function Dn(t,e,n,s={},{reducedMotion:r}){if(r)return;const i={trigger:"pointer-move",element:t,axis:s.axis??"y"},o=Ne(e,P(n),i);if(o){const c=Array.isArray(o)?o:[o],l=new zn({root:s.hitArea==="self"?t:void 0,scenes:c,...Qe()}),a={source:t,target:e,cleanup:()=>{l.destroy()}};O(ue,t,a),O(ue,e,a),Promise.all(c.map(u=>u.ready||Promise.resolve())).then(()=>{l.start()})}}function Nn(t){D(ue,t)}const Vn={add:Dn,remove:Nn,registerOptionsGetter:Gn},de=new WeakMap;function Wn(t,e,n,s,{reducedMotion:r,selectorCondition:i,animation:o}){const c=o||ne(e,P(n),void 0,r);if(!c)return;const l=()=>{i&&!e.matches(i)||c.play()},a={source:t,target:e,cleanup:()=>{c.cancel(),t.removeEventListener("animationend",l)}};O(de,t,a),O(de,e,a),t.addEventListener("animationend",l)}function jn(t){D(de,t)}const Yn={add:Wn,remove:jn};function Bn(t,e,n,s=!1,r,i,o){const c=o||ne(t,P(e),void 0,s);if(!c)return null;let l=!0;const f=n.type||"alternate";return a=>{if(r&&!t.matches(r))return;const u=!i,m=i?.enter?.includes(a.type),g=i?.leave?.includes(a.type);if(m||u){if(f==="alternate"||f==="state")l?(l=!1,c.play()):f==="alternate"?c.reverse():f==="state"&&(c.playState==="running"?c.pause():c.playState!=="finished"&&c.play());else{if(c.progress(0),delete t.dataset.interactEnter,c.isCSS){const d=()=>{T.mutate(()=>{t.dataset.interactEnter="done"})};c.onFinish(d),c.onAbort(d)}c.play()}return}g&&(f==="alternate"?c.reverse():f==="repeat"?(c.cancel(),T.mutate(()=>{delete t.dataset.interactEnter})):f==="state"&&c.playState==="running"&&c.pause())}}function Kn(t,e,{effectId:n,listContainer:s,listItemSelector:r},i,o,c){const l=!!s,f=i.method||"toggle",a=f==="toggle";return u=>{if(o&&!t.matches(o))return;const m=l?t.closest(`${s} > ${r||""}:has(:scope)`):void 0,g=!c,d=c?.enter?.includes(u.type),h=c?.leave?.includes(u.type);g?e.toggleEffect(n,f,m):(d&&e.toggleEffect(n,a?"add":f,m),h&&a&&e.toggleEffect(n,"remove",m))}}const he=new WeakMap;function Le(t,e){return n=>{const s=n;t.contains(s.relatedTarget)||e(s)}}function Qn(t){return e=>{const n=e;n.pointerType&&t(n)}}function Xn(t){return e=>{const n=e;n.code==="Space"?(n.preventDefault(),t(n)):n.code==="Enter"&&t(n)}}const Un={focusin:(t,e)=>Le(t,e),focusout:(t,e)=>Le(t,e),click:(t,e)=>Qn(e),keydown:(t,e)=>Xn(e)};function Jn(t,e,n){const s=Un[t];return s?s(e,n):r=>n(r)}function Zn(t){return typeof t=="object"&&!Array.isArray(t)&&("enter"in t||"leave"in t)}function es(t){if(typeof t=="string")return{toggle:[t]};if(Array.isArray(t))return{toggle:[...t]};if(Zn(t)){const e=t.enter?[...t.enter]:[],n=t.leave?[...t.leave]:[];return{enter:e,leave:n}}return{}}function ts(t){return!!(t.enter?.length||t.leave?.length)}function ns(t){return ts(t)?{enter:t.enter??[],leave:t.leave??[]}:void 0}function ss(t,e,n,s,{reducedMotion:r,targetController:i,selectorCondition:o,animation:c}){const l=es(s.eventConfig),f=n.transition||n.transitionProperties,a=ns(l);let u,m=!1;if(f?u=Kn(e,i,n,s,o,a):(u=Bn(e,n,s,r,o,a,c),m=s.type==="once"),!u)return;const g=u,d=new AbortController;function h(y,w,b){const S=Jn(w,t,g);y.addEventListener(w,S,{...b,signal:d.signal})}const v={source:t,target:e,cleanup:()=>{d.abort()}};if(O(he,t,v),O(he,e,v),a){const y=l.enter,w=l.leave;y.forEach(I=>{I==="focusin"&&(t.tabIndex=0),h(t,I,{passive:!0,once:m})});const b=!s.method||s.method==="toggle";(f?b:s.type!=="once")&&w.forEach(I=>{if(I==="focusout"){h(t,I,{once:m});return}h(t,I,{passive:!0})})}else(l.toggle??[]).forEach(w=>{h(t,w,{once:m,passive:w!=="keydown"})})}function is(t){D(he,t)}const R={add:ss,remove:is},me={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},Pe={click:me.activate,hover:me.interest};function Y(t){const e=me[t];return(n,s,r,i,o)=>{const c=o?.allowA11yTriggers&&t in Pe?Pe[t]:e;R.add(n,s,r,{...i,eventConfig:c},o??{})}}const A={viewEnter:ke,hover:{add:Y("hover"),remove:R.remove},click:{add:Y("click"),remove:R.remove},pageVisible:ke,animationEnd:Yn,viewProgress:On,pointerMove:Vn,activate:{add:Y("activate"),remove:R.remove},interest:{add:Y("interest"),remove:R.remove}};function rs(t){return t.replace(/\[([-\w]+)]/g,"[]")}class E{static defineInteractElement;dataCache;addedInteractions;mediaQueryListeners;listInteractionsCache;controllers;static forceReducedMotion=!1;static allowA11yTriggers=!0;static instances=[];static controllerCache=new Map;static sequenceCache=new Map;static elementSequenceMap=new WeakMap;constructor(){this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},this.addedInteractions={},this.mediaQueryListeners=new Map,this.listInteractionsCache={},this.controllers=new Set}init(e,n){if(typeof window>"u"||!window.customElements)return;const s=n?.useCutsomElement??!!E.defineInteractElement;this.dataCache=cs(e,s);const r=E.defineInteractElement?.();s&&r===!1?document.querySelectorAll("interact-element").forEach(i=>{i.connect()}):E.controllerCache.forEach((i,o)=>i.connect(o))}destroy(){for(const e of this.controllers)e.disconnect();for(const[,e]of this.mediaQueryListeners.entries())e.mql.removeEventListener("change",e.handler);this.mediaQueryListeners.clear(),this.addedInteractions={},this.listInteractionsCache={},this.controllers.clear(),this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},E.instances.splice(E.instances.indexOf(this),1)}setController(e,n){this.controllers.add(n),E.setController(e,n)}deleteController(e,n=!1){const s=E.controllerCache.get(e);this.clearInteractionStateForKey(e),this.clearMediaQueryListenersForKey(e),s&&n&&(this.controllers.delete(s),E.deleteController(e))}has(e){return!!this.get(e)}get(e){const n=rs(e);return this.dataCache.interactions[n]}clearMediaQueryListenersForKey(e){for(const[n,s]of this.mediaQueryListeners.entries())s.key===e&&(s.mql.removeEventListener("change",s.handler),this.mediaQueryListeners.delete(n))}clearInteractionStateForKey(e){(this.get(e)?.interactionIds||[]).forEach(r=>{const i=C(r,e);delete this.addedInteractions[i]});const s=`${e}::seq::`;for(const r of E.sequenceCache.keys())r.startsWith(s)&&(E.sequenceCache.delete(r),delete this.addedInteractions[r])}setupMediaQueryListener(e,n,s,r){this.mediaQueryListeners.has(e)||(n.addEventListener("change",r),this.mediaQueryListeners.set(e,{mql:n,handler:r,key:s}))}static create(e,n){const s=new E;return E.instances.push(s),s.init(e,n),s}static destroy(){E.controllerCache.forEach(e=>{e.disconnect()}),E.instances.length=0,E.controllerCache.clear(),E.sequenceCache.clear(),E.elementSequenceMap=new WeakMap}static setup(e){e.scrollOptionsGetter&&A.viewProgress.registerOptionsGetter?.(e.scrollOptionsGetter),e.pointerOptionsGetter&&A.pointerMove.registerOptionsGetter?.(e.pointerOptionsGetter),e.viewEnter&&A.viewEnter.setOptions(e.viewEnter),e.allowA11yTriggers!==void 0&&(E.allowA11yTriggers=e.allowA11yTriggers)}static getInstance(e){return E.instances.find(n=>n.has(e))}static getController(e){return e?E.controllerCache.get(e):void 0}static setController(e,n){E.controllerCache.set(e,n)}static deleteController(e){E.controllerCache.delete(e)}static registerEffects=Ht;static getSequence(e,n,s,r){const i=E.sequenceCache.get(e);if(i)return i;const o=Kt(n,s,r);return E.sequenceCache.set(e,o),E._registerSequenceElements(s,o),o}static addToSequence(e,n,s,r){const i=E.sequenceCache.get(e);if(!i)return!1;const c=Ve(n,r).map((l,f)=>({index:s[f]??i.animationGroups.length,group:l}));return i.addGroups(c),E._registerSequenceElements(n,i),!0}static _registerSequenceElements(e,n){for(const{target:s}of e){const r=Array.isArray(s)?s:s instanceof HTMLElement?[s]:[];for(const i of r){let o=E.elementSequenceMap.get(i);o||(o=new Set,E.elementSequenceMap.set(i,o)),o.add(n)}}}static removeFromSequences(e){for(const n of e){const s=E.elementSequenceMap.get(n);if(s){for(const r of s)r.removeGroups(i=>i.animations.some(o=>o.effect?.target===n));E.elementSequenceMap.delete(n)}}}}let os=0;function z(t,{asCombinator:e=!1,addItemFilter:n=!1,useFirstChild:s=!1}={}){if(t.listContainer){const r=`${n&&t.listItemSelector?` > ${t.listItemSelector}`:""}`;return t.selector?`${t.listContainer}${r} ${t.selector}`:`${t.listContainer}${r||" > *"}`}else if(t.selector)return t.selector;return s?e?"> :first-child":":scope > :first-child":""}function $e(t){return"sequenceId"in t&&!("effects"in t)}function ce(t,e){return t[e]||(t[e]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),t[e]}function cs(t,e=!1){const n=t.conditions||{},s={};return t.interactions?.forEach(r=>{const i=r.key,o=++os,{effects:c,sequences:l,...f}=r;if(!i){console.error(`Interaction ${o} is missing a key for source element.`);return}ce(s,i);const a=c?Array.from(c):[];a.reverse();const u=l?.map(d=>{if($e(d)){const p=t.sequences?.[d.sequenceId];return p?{...p,...d}:(console.warn(`Interact: Sequence "${d.sequenceId}" not found in config`),d)}const h=d;return h.sequenceId||(h.sequenceId=_()),h}),m={...f,effects:a.length>0?a:void 0,sequences:u};s[i].triggers.push(m),s[i].selectors.add(z(m,{useFirstChild:e}));const g=m.listContainer;a.forEach(d=>{let h=d.key;if(!h&&d.effectId){const w=t.effects[d.effectId];w&&(h=w.key)}d.effectId||(d.effectId=_()),h=h||i,d.key=h;const p=d.effectId;if(g&&d.listContainer&&(h!==i||d.listContainer!==g))return;const v=`${i}::${h}::${p}::${o}`;if(d.interactionId=v,s[i].interactionIds.add(v),h===i)return;const y=ce(s,h);y.effects[v]||(y.effects[v]=[],y.interactionIds.add(v)),y.effects[v].push({...f,effect:d}),y.selectors.add(z(d,{useFirstChild:e}))}),u?.forEach(d=>{if(!d||$e(d))return;const h=d,p=h.sequenceId||_(),v=h.effects;for(const y of v){y.effectId||(y.effectId=_());let w=y.key;if(!w&&y.effectId){const b=t.effects[y.effectId];b&&(w=b.key)}if(w=w||i,w!==i){const b=ce(s,w),S=`${w}::seq::${p}::${o}`;b.sequences[S]||(b.sequences[S]=[],b.interactionIds.add(S)),b.sequences[S].push({...f,sequence:h}),b.selectors.add(z(y,{useFirstChild:e}))}}})}),{effects:t.effects||{},sequences:t.sequences||{},conditions:n,interactions:s}}function pe(t,e,n){if(t.listContainer){const s=e.querySelector(t.listContainer);return s?t.selector?Array.from(s.querySelectorAll(t.selector)):Array.from(s.children):(console.warn(`Interact: No container found for list container "${t.listContainer}"`),[])}if(t.selector){const s=e.querySelectorAll(t.selector);if(s.length>0)return Array.from(s);console.warn(`Interact: No elements found for selector "${t.selector}"`)}return n?e.firstElementChild:e}function ge(t,e){return e.map(n=>t.selector?n.querySelector(t.selector):n).filter(Boolean)}function Xe(t,e,n,s,r,i,o,c){return[o?ge(t,o):pe(t,n,s),c?ge(e,c):pe(e,r,i)]}function Ue(t,e,n,s,r,i,o){const c=Array.isArray(s),l=Array.isArray(r);c?s.forEach((f,a)=>{const u=l?r[a]:r;u&&Fe(t,f,e.trigger,u,n,e.params,i,o)}):(l?r:[r]).forEach(a=>{Fe(t,s,e.trigger,a,n,e.params,i,o)})}function Je(t,e,n,s,r){const i={},o=[];(s.effects||[]).forEach(c=>{const l=c.effectId,f={...n.dataCache.effects[l]||{},...c,effectId:l},a=f.key,u=C(c.interactionId,t);if(i[u]||n.addedInteractions[u]&&!r)return;const m=k(f.conditions||[],n.dataCache.conditions);if(m&&n.setupMediaQueryListener(u,m,t,()=>{e.update()}),!m||m.matches){i[u]=!0;const g=a&&C(a,t);let d;if(g){if(d=E.getController(g),!d)return;f.listContainer&&d.watchChildList(f.listContainer)}else d=e;const[h,p]=Xe(s,f,e.element,e.useFirstChild,d.element,d.useFirstChild,r);if(!h||!p)return;n.addedInteractions[u]=!0;const v=g||s.key,y=L(f.conditions||[],n.dataCache.conditions);o.push([v,s,f,h,p,y,d.useFirstChild])}}),o.reverse().forEach(c=>{Ue(...c)}),fs(t,e,n,s,r)}function as(t){return"sequenceId"in t&&!("effects"in t)}function Ze(t,e,n,s,r,i,o){const c=k(t.conditions||[],r.dataCache.conditions);if(c&&r.setupMediaQueryListener(e,c,i.updateKey,i.onUpdate),c&&!c.matches)return null;const l=t.effects||[],f=[];let a=!1;for(const u of l){const m=u.effectId,d={...m?r.dataCache.effects[m]||{}:{},...u},h=k(d.conditions||[],r.dataCache.conditions);if(h){const I=`${e}::${m||"eff"}`;r.setupMediaQueryListener(I,h,i.updateKey,i.onUpdate)}if(h&&!h.matches)continue;const p=d.key,v=p&&C(p,n);let y;if(v){if(y=E.getController(v),!y)return null}else y=s;const w=v||n;let b;if(o&&w===o.controllerKey&&d.listContainer===o.listContainer?(b=ge(d,o.elements),b.length>0&&(a=!0)):b=pe(d,y.element,y.useFirstChild),!b||Array.isArray(b)&&b.length===0)return null;const S=P(d);f.push({target:b,options:S})}return o&&!a?null:f.length>0?f:null}function et(t,e,n){const i=(t.useFirstChild?t.element.firstElementChild:t.element)?.querySelector(e);if(!i)return n.map((c,l)=>l);const o=Array.from(i.children);return n.map(c=>{const l=o.indexOf(c);return l>=0?l:o.length})}function fs(t,e,n,s,r){s.sequences?.forEach(i=>{let o;if(as(i)){const g=n.dataCache.sequences[i.sequenceId];if(!g){console.warn(`Interact: Sequence "${i.sequenceId}" not found in cache`);return}o={...g,...i}}else o=i;const c=o.sequenceId||_(),l=C(`${t}::seq::${c}`,t);if(n.addedInteractions[l]&&!r)return;const f=r&&s.listContainer?{controllerKey:t,listContainer:s.listContainer,elements:r}:void 0,a=Ze(o,l,t,e,n,{updateKey:t,onUpdate:()=>e.update()},f);if(!a)return;if(r&&n.addedInteractions[l]){const g=et(e,s.listContainer,r);E.addToSequence(l,a,g,{reducedMotion:E.forceReducedMotion});return}const u=E.getSequence(l,o,a,{reducedMotion:E.forceReducedMotion});n.addedInteractions[l]=!0;const m=L(s.conditions||[],n.dataCache.conditions);A[s.trigger]?.add(e.element,e.element,{},s.params||{},{reducedMotion:E.forceReducedMotion,selectorCondition:m,animation:u,allowA11yTriggers:E.allowA11yTriggers})})}function ls(t,e,n,s,r){const i=n.get(t)?.sequences||{};Object.keys(i).forEach(c=>{i[c].some(({sequence:f,...a})=>{const u=k(a.conditions||[],n.dataCache.conditions);if(u&&!u.matches)return!1;const m=a.key&&C(a.key,t),g=E.getController(m);if(!g)return!0;const d=f.sequenceId||_(),h=C(`${m}::seq::${d}`,m);if(n.addedInteractions[h]&&!r)return!0;const v=Ze(f,h,m,g,n,{updateKey:t,onUpdate:()=>e.update()},r&&s?{controllerKey:t,listContainer:s,elements:r}:void 0);if(!v)return!0;if(r&&n.addedInteractions[h]){const b=et(e,s,r);return E.addToSequence(h,v,b,{reducedMotion:E.forceReducedMotion}),!0}const y=E.getSequence(h,f,v,{reducedMotion:E.forceReducedMotion});n.addedInteractions[h]=!0;const w=L(a.conditions||[],n.dataCache.conditions);return A[a.trigger]?.add(g.element,g.element,{},a.params||{},{reducedMotion:E.forceReducedMotion,selectorCondition:w,animation:y,allowA11yTriggers:E.allowA11yTriggers}),!0})})}function tt(t,e,n,s,r){const i=n.get(t),o=i?.effects||{},c=Object.keys(o),l=[];c.forEach(a=>{const u=C(a,t);if(n.addedInteractions[u]&&!r)return;o[a].some(({effect:g,...d})=>{const h=k(d.conditions||[],n.dataCache.conditions);if(h&&!h.matches)return!1;const p=g.effectId,v={...n.dataCache.effects[p]||{},...g,effectId:p};if(s&&v.listContainer!==s)return!1;const y=k(v.conditions||[],n.dataCache.conditions);if(y&&n.setupMediaQueryListener(u,y,t,()=>{e.update()}),!y||y.matches){const w=d.key&&C(d.key,t),b=E.getController(w);if(!b)return!0;v.listContainer&&e.watchChildList(v.listContainer);const[S,I]=Xe(d,v,b.element,b.useFirstChild,e.element,e.useFirstChild,void 0,r);if(!S||!I)return!0;n.addedInteractions[u]=!0;const $=L(v.conditions||[],n.dataCache.conditions);return l.push([t,d,v,S,I,$,e.useFirstChild]),!0}return!1})}),l.reverse().forEach(a=>{Ue(...a)}),ls(t,e,n,s,r);const f=Object.keys(i?.sequences||{}).length>0;return c.length>0||f}function Fe(t,e,n,s,r,i,o,c){let l;if(r.transition||r.transitionProperties){const f={key:t,effectId:r.effectId,transition:r.transition,properties:r.transitionProperties,childSelector:z(r,{asCombinator:!0,addItemFilter:!0,useFirstChild:c}),selectorCondition:o};if(l=E.getController(t),!l)return;l.renderStyle(Qt(f))}A[n]?.add(e,s,r,i,{reducedMotion:E.forceReducedMotion,targetController:l,selectorCondition:o,allowA11yTriggers:E.allowA11yTriggers})}function us(t){const e=t.key,n=E.getInstance(e);if(!n)return console.warn(`No instance found for key: ${e}`),E.setController(e,t),!1;const{triggers:s=[]}=n?.get(e)||{},r=s.length>0;n.setController(e,t),s.forEach((o,c)=>{const l=k(o.conditions,n.dataCache.conditions);if(l){const f=`${e}::trigger::${c}`;n.setupMediaQueryListener(f,l,e,()=>{t.update()})}(!l||l.matches)&&(o.listContainer&&t.watchChildList(o.listContainer),Je(e,t,n,o))});let i=!1;return n&&(i=tt(e,t,n)),r||i}function ds(t,e,n){const s=t.key,r=E.getInstance(s);if(r){const{triggers:i=[]}=r?.get(s)||{};i.forEach((o,c)=>{if(o.listContainer!==e)return;const l=k(o.conditions,r.dataCache.conditions);if(l){const f=`${s}::listTrigger::${e}::${c}`;r.setupMediaQueryListener(f,l,s,()=>{t.update()})}(!l||l.matches)&&Je(s,t,r,o,n)}),tt(s,t,r,e,n)}}function hs(t,e=!1){const n=t.key,s=E.getInstance(n);if(!s)return;const r=[...s.get(n)?.selectors.values()||[]].filter(Boolean).join(",");let i;r?(i=[...t.element.querySelectorAll(r)],t.useFirstChild||i.push(t.element)):i=[t.element],nt(i),s.deleteController(n,e)}function nt(t){const e=Object.values(A);for(const n of t)for(const s of e)s.remove(n);E.removeFromSequences(t)}const ae="interactEffect";class st{element;key;connected;sheet;useFirstChild;_observers;constructor(e,n,s){this.element=e,this.key=n,this.connected=!1,this.sheet=null,this._observers=new WeakMap,this.useFirstChild=s?.useFirstChild??!1}connect(e){if(this.connected)return;const n=this.element.dataset.interactKey;if(e=e||this.key||n,!e){console.warn("Interact: No key provided");return}n!==e&&(n&&console.warn(`Interact: Key mismatch between element ${n} and parameter ${e}, updating element key`),this.element.dataset.interactKey=e),this.key=e,this.connected=us(this)}disconnect({removeFromCache:e=!1}={}){if((this.key||this.element.dataset.interactKey)&&hs(this,e),this.sheet){const s=document.adoptedStyleSheets.indexOf(this.sheet);document.adoptedStyleSheets.splice(s,1)}this._observers=new WeakMap,this.sheet=null,this.connected=!1}update(){this.disconnect(),this.connect()}renderStyle(e){if(!this.sheet)this.sheet=new CSSStyleSheet,this.sheet.replaceSync(e.join(`
8
+ `)),document.adoptedStyleSheets.push(this.sheet);else{let n=this.sheet.cssRules.length;for(const s of e)try{this.sheet.insertRule(s,n),n++}catch(r){console.error(r)}}}toggleEffect(e,n,s,r){if(s===null)return;if(!r&&this.element.toggleEffect){this.element.toggleEffect(e,n,s);return}const i=new Set(this.element.dataset[ae]?.split(" ")||[]);n==="toggle"?i.has(e)?i.delete(e):i.add(e):n==="add"?i.add(e):n==="remove"?i.delete(e):n==="clear"&&i.clear(),(s||this.element).dataset[ae]=Array.from(i).join(" ")}getActiveEffects(){const n=(this.element.dataset[ae]||"").trim();return n?n.split(/\s+/):[]}watchChildList(e){const n=this.element.querySelector(e);if(n){let s=this._observers.get(n);s||(s=new MutationObserver(this._childListChangeHandler.bind(this,e)),this._observers.set(n,s),s.observe(n,{childList:!0}))}}_childListChangeHandler(e,n){const s=this.key||this.element.dataset.interactKey,r=[],i=[];n.forEach(o=>{o.removedNodes.forEach(c=>{c instanceof HTMLElement&&r.push(c)}),o.addedNodes.forEach(c=>{c instanceof HTMLElement&&i.push(c)})}),nt(r),s&&ds(this,e,i)}}function ms(t,e){new st(t,e).connect()}function ps(t){const e=E.getController(t);e&&e.disconnect({removeFromCache:!0})}const gs=(t,e,n,s)=>{let i=`[data-interact-key="${t.replace(/"/g,"'")}"]`;const o=z(e,{asCombinator:!0,useFirstChild:s});return o&&(i=`${i} ${o}`),n&&(i=Q(i,n)),i};function vs(t,e=!1){const n=[],s=new Set;return t.interactions.forEach(({key:r,selector:i,listContainer:o,listItemSelector:c,trigger:l,params:f,effects:a,conditions:u})=>{if(l==="viewEnter"){const g=f;(!g?.type||g.type==="once")&&a?.forEach(h=>{const p=h?.effectId&&t.effects[h.effectId]||h,{key:v,selector:y,listContainer:w,listItemSelector:b,conditions:S}=p;if(!(!v||v===r)||!(!y&&!i||y===i)||!(!w&&!o||w===o)||!(!b&&!c||b===c))return;const ye=t.conditions||{},Ee=L(S,ye),se=L(u,ye);if(!(!Ee&&!se||Ee===se))return;const ie=gs(r,p,se,e);s.has(ie)||(s.add(ie),n.push(`@media (prefers-reduced-motion: no-preference) {
9
+ ${ie}:not([data-interact-enter]) {
10
+ visibility: hidden;
11
+ transform: none;
12
+ translate: none;
13
+ scale: none;
14
+ rotate: none;
15
+ }
16
+ }`))})}}),n.join(`
17
+ `)}exports.I=st;exports.a=E;exports.b=ms;exports.g=vs;exports.r=ps;
18
+ //# sourceMappingURL=index-DYEvpIGz.js.map