@wix/interact 2.5.20 → 2.5.22

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,26 @@
1
+ "use strict";function Kt(e){return[...e.matchAll(/\[([^\]]+)]/g)].map(([t,n])=>n)}function q(e,t){const n=Kt(t);let s=0;return n.length?e.replace(/\[]/g,()=>{const i=n[s++];return i!==void 0?`[${i}]`:"[]"}):e}function Yt(e,t){return e.trigger==="viewEnter"&&t.triggerType==="once"&&V(e)===V(t)}function V(e){const{key:t,listContainer:n,listItemSelector:s,selector:i}=e;return`${t}\0${n||""}\0${s||""}\0${i||""}`}const ot="$";class ee{animations;options;ready;isCSS;longestAnimation;constructor(t,n){this.animations=t,this.options=n,this.ready=n?.measured||Promise.resolve(),this.isCSS=t[0]instanceof CSSAnimation,this.longestAnimation=this._getAnimationWithLongestEndTime()}_getAnimationWithLongestEndTime(){return this.animations.reduce((t,n)=>{const s=t.effect?.getComputedTiming().endTime??0,i=n.effect?.getComputedTiming().endTime??0;return s>i?t:n},this.animations[0])}getProgress(){return this.longestAnimation?.effect?.getComputedTiming().progress||0}async play(t){await this.ready;for(const n of this.animations)n.play();await Promise.all(this.animations.map(n=>n.ready)),t&&t()}pause(){for(const t of this.animations)t.pause()}async reverse(t){await this.ready;for(const n of this.animations)n.reverse();await Promise.all(this.animations.map(n=>n.ready)),t&&t()}progress(t){for(const n of this.animations){const{delay:s,duration:i,iterations:o}=n.effect.getTiming(),r=(Number.isFinite(i)?i:0)*(Number.isFinite(o)?o:1);n.currentTime=((s||0)+r)*t}}cancel(){for(const t of this.animations)t.cancel()}setPlaybackRate(t){for(const n of this.animations)n.playbackRate=t}async onFinish(t){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 i=this.options?.effectId||n.id,o=new CustomEvent("animationend",{detail:{effectId:i}});s.dispatchEvent(o)}}t()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}async onAbort(t){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 i=s.effect?.target;if(i){const o=new Event("animationcancel");i.dispatchEvent(o)}}t()}}}get finished(){return Promise.all(this.animations.map(t=>t.finished))}get playState(){return this.animations.some(t=>t.playState==="running")?"running":this.animations[0]?.playState}hasAnimationName(t){return this.animations.some(n=>n.animationName===t)}hasAnimationId(t){return this.animations.some(n=>n.id===t)}getTimingOptions(){return this.animations.map(t=>{const n=t.effect?.getTiming(),s=n?.delay??0,i=Number(n?.duration)||0,o=n?.iterations??1;return{delay:s,duration:i,iterations:o}})}}const rt=e=>e,Bt=e=>1-Math.cos(e*Math.PI/2),Ut=e=>Math.sin(e*Math.PI/2),Qt=e=>-(Math.cos(Math.PI*e)-1)/2,Xt=e=>e**2,Zt=e=>1-(1-e)**2,Jt=e=>e<.5?2*e**2:1-(-2*e+2)**2/2,en=e=>e**3,tn=e=>1-(1-e)**3,nn=e=>e<.5?4*e**3:1-(-2*e+2)**3/2,sn=e=>e**4,on=e=>1-(1-e)**4,rn=e=>e<.5?8*e**4:1-(-2*e+2)**4/2,an=e=>e**5,cn=e=>1-(1-e)**5,ln=e=>e<.5?16*e**5:1-(-2*e+2)**5/2,un=e=>e===0?0:2**(10*e-10),fn=e=>e===1?1:1-2**(-10*e),dn=e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,hn=e=>1-Math.sqrt(1-e**2),mn=e=>Math.sqrt(1-(e-1)**2),pn=e=>e<.5?(1-Math.sqrt(1-4*e**2))/2:(Math.sqrt(-(2*e-3)*(2*e-1))+1)/2,gn=e=>2.70158*e**3-1.70158*e**2,vn=e=>1+2.70158*(e-1)**3+1.70158*(e-1)**2,yn=(e,t=1.70158*1.525)=>e<.5?(2*e)**2*((t+1)*2*e-t)/2:((2*e-2)**2*((t+1)*(e*2-2)+t)+2)/2,De={linear:rt,sineIn:Bt,sineOut:Ut,sineInOut:Qt,quadIn:Xt,quadOut:Zt,quadInOut:Jt,cubicIn:en,cubicOut:tn,cubicInOut:nn,quartIn:sn,quartOut:on,quartInOut:rn,quintIn:an,quintOut:cn,quintInOut:ln,expoIn:un,expoOut:fn,expoInOut:dn,circIn:hn,circOut:mn,circInOut:pn,backIn:gn,backOut:vn,backInOut:yn},K=(e,t,n,s,i)=>{const o=3*t,r=3*(s-2*t),a=1-3*s+3*t,c=3*n,u=3*(i-2*n),l=1-3*i+3*n;let f;if(a===0)f=r===0?`(${e} / ${o})`:`((sqrt(max(0, ${o*o} + ${4*r} * ${e})) - ${o}) / ${2*r})`;else{const d=r/(3*a),h=2*Math.pow(r,3)-9*o*r*a,m=54*Math.pow(a,3),p=(3*a*o-r*r)/(9*a*a),v=`((${h} - ${27*a*a} * ${e}) / ${m})`;if(p<0){const y=2*Math.sqrt(-p);let g=0;for(const w of[0,1,2])[0,.25,.5,.75,1].every(S=>{const T=Math.min(Math.max(2*(h-27*a*a*S)/(m*p*y),-1),1),C=y*Math.cos((Math.acos(T)-w*2*Math.PI)/3)-d;return C>=-1e-6&&C<=1.000001})&&(g=w);const E=`(acos(clamp(-1, ${2/(p*y)} * ${v}, 1)) - ${360*g}deg) / 3`;f=`(${y} * cos(${E}) - ${d})`}else{const y=`sqrt(pow(${v}, 2) + ${Math.pow(p,3)})`;f=`(pow(${y} - ${v}, 1 / 3) - pow(${y} + ${v}, 1 / 3) - ${d})`}}return`(${l} * pow(${f}, 3) + ${u} * pow(${f}, 2) + ${c} * ${f})`},Ge={linear:e=>e,ease:e=>K(e,.25,.1,.25,1),easeIn:e=>K(e,.42,0,1,1),easeOut:e=>K(e,0,0,.58,1),easeInOut:e=>K(e,.42,0,.58,1),sineIn:e=>`(1 - cos(${e} * 90deg))`,sineOut:e=>`(sin(${e} * 90deg))`,sineInOut:e=>`((1 - cos(${e} * 180deg)) / 2)`,quadIn:e=>`(${e} * ${e})`,quadOut:e=>`(1 - (1 - ${e}) * (1 - ${e}))`,quadInOut:e=>`(round(${e}) * (1 - (-2 * ${e} + 2) * (-2 * ${e} + 2) / 2) + (1 - round(${e})) * 2 * ${e} * ${e})`,cubicIn:e=>`pow(${e}, 3)`,cubicOut:e=>`(1 - pow(1 - ${e}, 3))`,cubicInOut:e=>`(round(${e}) * (1 - pow(-2 * ${e} + 2, 3) / 2) + (1 - round(${e})) * 4 * pow(${e}, 3))`,quartIn:e=>`pow(${e}, 4)`,quartOut:e=>`(1 - pow(1 - ${e}, 4))`,quartInOut:e=>`(round(${e}) * (1 - pow(-2 * ${e} + 2, 4) / 2) + (1 - round(${e})) * 8 * pow(${e}, 4))`,quintIn:e=>`pow(${e}, 5)`,quintOut:e=>`(1 - pow(1 - ${e}, 5))`,quintInOut:e=>`(round(${e}) * (1 - pow(-2 * ${e} + 2, 5) / 2) + (1 - round(${e})) * 16 * pow(${e}, 5))`,expoIn:e=>`(pow(2, 10 * ${e} - 10) - pow(2, -10) * (1 - ${e}))`,expoOut:e=>`(1 - pow(2, -10 * ${e}) + pow(2, -10) * ${e})`,expoInOut:e=>`((round(${e}) * (2 - pow(2, -20 * ${e} + 10)) + (1 - round(${e})) * pow(2, 20 * ${e} - 10)) / 2)`,circIn:e=>`(1 - sqrt(1 - ${e} * ${e}))`,circOut:e=>`sqrt(1 - (${e} - 1) * (${e} - 1))`,circInOut:e=>`((round(${e}) * (sqrt(max(0, (3 - 2 * ${e}) * (2 * ${e} - 1))) + 1) + (1 - round(${e})) * (1 - sqrt(max(0, 1 - 4 * ${e} * ${e})))) / 2)`,backIn:e=>`(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,backOut:e=>`(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,backInOut:e=>`((round(${e}) * (2 + (2 * ${e} - 2) * (2 * ${e} - 2) * (2.5949095 + 3.5949095 * (2 * ${e} - 2))) + (1 - round(${e})) * 4 * ${e} * ${e} * (3.5949095 * 2 * ${e} - 2.5949095)) / 2)`},We={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 En(e){return e==="percentage"?"%":e||"px"}const wn=/^(webkit|moz|ms|o)(?=[A-Z])/,$n=Object.assign(Object.create(null),{float:"cssFloat","animation-timing-function":"easing","animation-composition":"composite"});function me(e){return e.startsWith("--")?e:(wn.test(e)?`-${e}`:e).replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function bn(e){return e.startsWith("--")||!e.includes("-")?e:e.replace(/^-/,"").replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function at(e){return $n[e]||bn(e)}function Sn(e){for(const t in e)if(Object.hasOwn(e,t)&&at(t)!==t)return!0;return!1}function In(e){if(!Array.isArray(e))return e;let t;return e.forEach((n,s)=>{if(!n||typeof n!="object"||!Sn(n))return;t??=e.slice();const i={};for(const o in n)Object.hasOwn(n,o)&&(i[at(o)]=n[o]);t[s]=i}),t||e}function ue(e){return e?We[e]||e:We.linear}function Tn(e,t,n,s){const i=3*e,o=3*(n-e)-i,r=1-i-o,a=3*t,c=3*(s-t)-a,u=1-a-c,l=m=>((r*m+o)*m+i)*m,f=m=>((u*m+c)*m+a)*m,d=m=>(3*r*m+2*o)*m+i;function h(m){let p=m;for(let g=0;g<8;g++){const E=l(p)-m;if(Math.abs(E)<1e-7)return p;const w=d(p);if(Math.abs(w)<1e-6)break;p-=E/w}let v=0,y=1;for(p=(v+y)/2;y-v>1e-7;){const g=l(p);if(Math.abs(g-m)<1e-7)return p;m>g?v=p:y=p,p=(v+y)/2}return p}return m=>m<=0?0:m>=1?1:f(h(m))}function ct(e){const t=e.match(/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/);if(!t)return;const n=parseFloat(t[1]),s=parseFloat(t[2]),i=parseFloat(t[3]),o=parseFloat(t[4]);if(![n,s,i,o].some(isNaN))return[n,s,i,o]}function Cn(e){const t=ct(e);if(!(!t||t.some(isNaN)))return Tn(...t)}function On(e){const t=ct(e);if(!(!t||t.some(isNaN)))return n=>K(n,...t)}function lt(e){const t=e.match(/^linear\((.+)\)$/);if(!t)return;const n=t[1].split(",").map(o=>o.trim()).filter(Boolean);if(n.length===0)return;const s=[];for(const o of n){const r=o.split(/\s+/),a=parseFloat(r[0]);if(isNaN(a))return;const c=[];for(let u=1;u<r.length;u++)if(r[u].endsWith("%")){const l=parseFloat(r[u])/100;if(isNaN(l))return;c.push(l)}c.length===0?s.push({output:a,pos:null}):c.length===1?s.push({output:a,pos:c[0]}):(s.push({output:a,pos:c[0]}),s.push({output:a,pos:c[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 i=0;for(;i<s.length;)if(s[i].pos===null){const o=i-1;let r=i;for(;r<s.length&&s[r].pos===null;)r++;const a=s[o].pos,c=s[r].pos,u=r-o;for(let l=o+1;l<r;l++)s[l].pos=a+(c-a)*(l-o)/u;i=r+1}else i++;for(let o=1;o<s.length;o++)s[o].pos<s[o-1].pos&&(s[o].pos=s[o-1].pos);return s}function _n(e){const t=lt(e);if(t)return n=>{if(n<=t[0].pos)return t[0].output;const s=t[t.length-1];if(n>=s.pos)return s.output;let i=0,o=t.length-1;for(;i<o-1;){const c=i+o>>>1;t[c].pos<=n?i=c:o=c}const r=t[i],a=t[o];return a.pos===r.pos?a.output:r.output+(a.output-r.output)*(n-r.pos)/(a.pos-r.pos)}}function kn(e){const t=lt(e);if(t)return n=>{const s=[`${t[0].output}`];for(let i=1;i<t.length;i++){const o=t[i].pos-t[i-1].pos,r=t[i].output-t[i-1].output;if(o===0&&t[i-1].pos===0)s.push(`${r}`);else{const a=o===0?`round(${n} / ${2*t[i-1].pos})`:`(${n} - ${t[i-1].pos}) / ${o}`;s.push(`clamp(0, ${a}, 1) * ${r}`)}}return`(${s.join(" + ")})`}}function ut(e){if(!e)return;const t=De[e];return t||(Cn(e)??_n(e)??De.linear)}function An(e){if(!e)return;const t=Ge[e];return t||(On(e)??kn(e)??Ge.linear)}class Mn extends ee{animationGroups;delay;offset;offsetEasing;sequenceId;timingOptions;constructor(t,n={}){const s=t.flatMap(i=>[...i.animations]);super(s),this.animationGroups=t,this.delay=n.delay??0,this.offset=n.offset??0,this.sequenceId=n.sequenceId,this.offsetEasing=typeof n.offsetEasing=="function"?n.offsetEasing:ut(n.offsetEasing)??rt,this.timingOptions=this.animationGroups.map(i=>i.getTimingOptions().map(({delay:o,duration:r,iterations:a})=>({delay:o,duration:Number.isFinite(r)?r:0,iterations:Number.isFinite(a)?a:1}))),this.applyOffsets(),this.ready=Promise.all(t.map(i=>i.ready)).then(()=>{})}calculateOffsets(){const t=this.animationGroups.length;if(t<=1)return[0];const n=t-1;return Array.from({length:t},(s,i)=>this.offsetEasing(i/n)*n*this.offset|0)}applyOffsets(){if(this.animationGroups.length===0||this.animations.length===0)return;const t=this.calculateOffsets(),n=this.getSequenceActiveDuration(t),s=this.animationGroups.length-1;this.animationGroups.forEach((i,o)=>{i.animations.forEach((r,a)=>{const c=r.effect;if(!c)return;const{delay:u,duration:l,iterations:f}=this.timingOptions[o][a],d=u+t[o],h=n-(d+l*f);if(i.isCSS&&this.sequenceId){const{target:m}=c;m instanceof HTMLElement&&(m.style.setProperty(`--motion-${this.sequenceId}-index`,`${o}`),m.style.setProperty(`--motion-${this.sequenceId}-last`,`${s}`)),c.updateTiming({endDelay:h})}else c.updateTiming({delay:d+this.delay,endDelay:h})})})}getSequenceActiveDuration(t){const n=[];for(let s=0;s<this.timingOptions.length;s++){const i=this.timingOptions[s].reduce((o,r)=>{if(!r)return o;const{delay:a,duration:c,iterations:u}=r;return Math.max(o,a+c*u)},0);n.push(t[s]+i)}return Math.max(...n)}addGroups(t){if(t.length===0)return;const n=[...t].sort((s,i)=>i.index-s.index);for(const{index:s,group:i}of n){const o=Math.min(s,this.animationGroups.length);this.animationGroups.splice(o,0,i),this.timingOptions.splice(o,0,i.getTimingOptions());const r=[...i.animations],a=this.animationGroups.slice(0,o).reduce((c,u)=>c+u.animations.length,0);this.animations.splice(a,0,...r)}this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(s=>s.ready)).then(()=>{})}removeGroups(t){const n=[],s=[],i=[];for(let o=0;o<this.animationGroups.length;o++)t(this.animationGroups[o])?n.push(this.animationGroups[o]):(s.push(this.animationGroups[o]),i.push(this.timingOptions[o]));if(n.length===0)return n;for(const o of n)o.cancel();return this.animationGroups=s,this.timingOptions=i,this.animations=s.flatMap(o=>[...o.animations]),this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(o=>o.ready)).then(()=>{}),n}async onFinish(t){try{await Promise.all(this.animationGroups.map(n=>n.finished)),t()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}}class qn{_animation;customEffect;progress;_tickCbId;_finishHandler;constructor(t,n,s,i){const o=new KeyframeEffect(n,[],{...s,composite:"add"}),{timeline:r}=i;this._animation=new Animation(o,r),this._tickCbId=null,this.progress=null,this.customEffect=a=>t(o.target,a),this._finishHandler=a=>{this.effect.target?.getAnimations().find(c=>c===this._animation)||this.cancel()},this.addEventListener("finish",this._finishHandler),this.addEventListener("remove",this._finishHandler)}_tick(){try{const t=this.effect?.getComputedTiming().progress??null;t!==this.progress&&(this.customEffect?.(t),this.progress=t),this._tickCbId=requestAnimationFrame(()=>{this._tick()})}catch(t){this._tickCbId=null,console.error(`failed to run customEffect! effectId: ${this.id}, error: ${t instanceof Error?t.message:t}`)}}get currentTime(){return this._animation.currentTime}set currentTime(t){this._animation.currentTime=t}get startTime(){return this._animation.startTime}set startTime(t){this._animation.startTime=t}get playbackRate(){return this._animation.playbackRate}set playbackRate(t){this._animation.playbackRate=t}get id(){return this._animation.id}set id(t){this._animation.id=t}get effect(){return this._animation.effect}set effect(t){this._animation.effect=t}get timeline(){return this._animation.timeline}set timeline(t){this._animation.timeline=t}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(t){this._animation.oncancel=t}get onfinish(){return this._animation.onfinish}set onfinish(t){this._animation.onfinish=t}get onremove(){return this._animation.onremove}set onremove(t){this._animation.onremove=t}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(t){this._animation.updatePlaybackRate(t)}addEventListener(t,n,s){this._animation.addEventListener(t,n,s)}removeEventListener(t,n,s){this._animation.removeEventListener(t,n,s)}dispatchEvent(t){return this._animation.dispatchEvent(t)}}function Pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fe={exports:{}},Ve=fe.exports,Ke;function Ln(){return Ke||(Ke=1,(function(e){(function(t){var n=function(){},s=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(l){return setTimeout(l,16)};function i(){var l=this;l.reads=[],l.writes=[],l.raf=s.bind(t)}i.prototype={constructor:i,runTasks:function(l){for(var f;f=l.shift();)f()},measure:function(l,f){var d=f?l.bind(f):l;return this.reads.push(d),o(this),d},mutate:function(l,f){var d=f?l.bind(f):l;return this.writes.push(d),o(this),d},clear:function(l){return a(this.reads,l)||a(this.writes,l)},extend:function(l){if(typeof l!="object")throw new Error("expected object");var f=Object.create(this);return c(f,l),f.fastdom=this,f.initialize&&f.initialize(),f},catch:null};function o(l){l.scheduled||(l.scheduled=!0,l.raf(r.bind(null,l)))}function r(l){var f=l.writes,d=l.reads,h;try{n("flushing reads",d.length),l.runTasks(d),n("flushing writes",f.length),l.runTasks(f)}catch(m){h=m}if(l.scheduled=!1,(d.length||f.length)&&o(l),h)if(n("task errored",h.message),l.catch)l.catch(h);else throw h}function a(l,f){var d=l.indexOf(f);return!!~d&&!!l.splice(d,1)}function c(l,f){for(var d in f)f.hasOwnProperty(d)&&(l[d]=f[d])}var u=t.fastdom=t.fastdom||new i;e.exports=u})(typeof window<"u"?window:typeof Ve<"u"?Ve:globalThis)})(fe)),fe.exports}var xn=Ln();const O=Pn(xn),_e={};function Fn(e){Object.assign(_e,e)}function je(e,t=!0){return e in _e?_e[e]:(t&&console.warn(`${e} not found in registry. Please make sure to import and register the preset.`),null)}function X(e,t){return e?(t||document).getElementById(e):null}function ft(e,t){return e?.matches(`[data-motion-part~="${t}"]`)?e:e?.querySelector(`[data-motion-part~="${t}"]`)}function dt(e,t){const n=typeof e=="string"?X(e):e;return t?.length?t.map(s=>ft(n,s)).filter(Boolean):n?[n]:[]}function Rn(e){const t=e.alternate?"alternate":"";return e.reversed?`${t?`${t}-`:""}reverse`:t||"normal"}function Ie(e){return`${e.value}${En(e.unit)}`}function Ye(e,t,n){return`${e.name||"cover"} ${n&&e.offset.unit!=="percentage"?`calc(100% + ${Ie(e.offset)}${t?` + ${t}`:""})`:t?`calc(${Ie(e.offset)} + ${t})`:Ie(e.offset)}`}function ht(e){return{start:Ye(e.startOffset,e.startOffsetAdd),end:Ye(e.endOffset,e.endOffsetAdd,!0)}}function mt(e){return t=>O.measure(()=>t(e))}function pt(e){return t=>O.mutate(()=>t(e))}function Z(e){if(e.namedEffect){const t=e.namedEffect.type;return typeof t=="string"?je(t):null}else if(e.keyframeEffect){const t=s=>{const{name:i,keyframes:o}=s.keyframeEffect;return[{...s,name:i,keyframes:o}]};return{web:t,style:t,getNames:s=>{const{effectId:i}=s,{name:o}=s.keyframeEffect,r=o||i;return r?[r]:[]}}}else if(e.customEffect)return t=>[{...t,keyframes:[]}];return null}function gt(e,t,n,s){return e.map((i,o)=>{const r={fill:i.fill,easing:ue(i.easing),iterations:i.iterations===0?1/0:i.iterations||1,composite:i.composite,direction:Rn(i)};ze(t)?(r.duration=i.duration,r.delay=i.delay||0):t?.trigger==="view-progress"&&(s||window.ViewTimeline)?r.duration="auto":(r.duration=99.99,r.delay=.01);const a=In(i.keyframes);return{effect:a===i.keyframes?i:{...i,keyframes:a},options:r,id:n&&`${n}-${o+1}`,part:i.part}})}function ze(e){return!e||e.trigger!=="pointer-move"&&e.trigger!=="view-progress"}function Be(e,t,n,s,i){if(e){if(ze(s)&&(t.duration=t.duration||1,i?.reducedMotion))if(t.iterations===1||t.iterations==null)t={...t,duration:1};else return[];let o;return n instanceof HTMLElement&&(o={measure:mt(n),mutate:pt(n)}),e.web?e.web(t,o,i):e(t,o,i)}return[]}function vt(e,t,n,s,i){const o=typeof e=="string"?X(e,i):e;if(n?.trigger==="pointer-move"&&!t.keyframeEffect){let d=t;t.customEffect&&(d={...t,namedEffect:{id:"",type:"CustomMouse"}});const h=Z(d),m=Be(h,t,o,n,s);return typeof m!="function"?null:m(o)}const r=Z(t),a=Be(r,t,o,n,s);if(!a||a.length===0)return null;const c=gt(a,n,t.effectId);let u;const l=n?.trigger==="view-progress";l&&window.ViewTimeline&&(u=new ViewTimeline({subject:n.element||X(n.componentId)}));const f=c.map(({effect:d,options:h,id:m,part:p})=>{const v=p?ft(o,p):o,y=new KeyframeEffect(v||null,[],h);O.mutate(()=>{"timing"in d&&y.updateTiming(d.timing),y.setKeyframes(d.keyframes)});const g=l&&u?{timeline:u}:{},E=typeof d.customEffect=="function"?new qn(d.customEffect,v||null,h,g):new Animation(y,g.timeline);if(l)if(u)O.mutate(()=>{const{start:w,end:b}=ht(d);E.rangeStart=w,E.rangeEnd=b,E.play()});else{const{startOffset:w,endOffset:b}=t;O.mutate(()=>{const S=d.startOffset||w,T=d.endOffset||b;Object.assign(E,{start:{name:S.name,offset:S.offset?.value,add:d.startOffsetAdd},end:{name:T.name,offset:T.offset?.value,add:d.endOffsetAdd}})})}return m&&(E.id=m),E});return new ee(f,{...t,trigger:{...n||{}},measured:new Promise(d=>O.mutate(d))})}function Nn(e,t,n){const{duration:s,delay:i,iterations:o=1,fill:r,easing:a="linear",direction:c}=e.options,u=e.effect.name,l=s==="auto",{sequenceId:f,delay:d,offset:h,offsetEasing:m="linear"}=n||{};let p=`${i??0}ms`;if(f&&typeof m=="string"){const v=An(m);if(v){const y=(i??0)+(d??0);if(h){const g=v(`(var(--motion-${f}-index, 0) / var(--motion-${f}-last, 1))`);p=`calc(${`(${y} + ${g} * ${h} * var(--motion-${f}-last, 1))`} * 1ms)`}else p=`${y}ms`}}return`${u} ${l?"auto":`${s}ms`}${l?" ":` ${p} `}${a}${r&&r!=="none"?` ${r}`:""} ${!o||o===1/0?"infinite":o}${c==="normal"?"":` ${c}`} ${t?"":"paused"}`}function jn(e,t,n){return e?.style?(ze(n)&&(t.duration=t.duration||1),e.style(t)):[]}function zn(e,t,n,s){const i=Z(t),o=jn(i,t),r=gt(o,n,t.effectId,!0),a=n?.trigger==="view-progress";return r.map((c,u)=>{const{start:l,end:f}=a?ht(c.effect):{};return{part:c.part,animation:Nn(c,a,s),composition:c.options.composite,custom:c.effect.custom,name:c.effect.name,keyframes:c.effect.keyframes,id:c.id&&`${c.id}-${u+1}`,animationTimeline:a?`--${n?.id}`:"",animationRange:l||f?`${l} ${f}`:""}})}function Hn(e,t,n){const s=Z(t),i=e instanceof HTMLElement?e:X(e);if(s&&s.prepare&&i){const o={measure:mt(i),mutate:pt(i)};s.prepare(t,o)}n&&O.mutate(n)}function yt(e,t){const n=Z(t);if(!n)return null;if(!n.style)return t.effectId&&e?Dn(e,t.effectId,n.parts):null;const s=n.getNames(t),o=dt(e,n.parts)?.flatMap(c=>c.getAnimations()),r=o?.map(c=>c.animationName)||[],a=[];return s.forEach(c=>{r.includes(c)&&a.push(o?.find(u=>u.animationName===c))}),a?.length?new ee(a):null}function Dn(e,t,n){const i=dt(e,n)?.flatMap(o=>o.getAnimations()).filter(o=>{const r=o.id||o.animationName;return r?r.startsWith(t):!0});return i?.length?new ee(i):null}function Et(e,t,n,s={}){const{disabled:i,allowActiveEvent:o,...r}=s,a=vt(e,t,n,r);if(!a)return null;let c={};if(n.trigger==="view-progress"&&!window.ViewTimeline){const u=n.element||X(n.componentId),{ready:l}=a;return a.animations.map(f=>({get start(){return f.start},get end(){return f.end},viewSource:u,ready:l,getProgress(){return a.getProgress()},effect(d,h){const{activeDuration:m}=f.effect.getComputedTiming(),{delay:p}=f.effect.getTiming();f.currentTime=((p||0)+(m||0))*h},disabled:i,destroy(){f.cancel()}}))}else if(n.trigger==="pointer-move"){const u=t,{centeredToTarget:l,transitionDuration:f,transitionEasing:d}=u,h=n.axis;if(u.keyframeEffect){const m=a;return m.animations?.length===0?null:{target:void 0,centeredToTarget:l,ready:m.ready,_currentProgress:0,getProgress(){return this._currentProgress},effect(v,y){const g=h==="x"?y.x:y.y;this._currentProgress=g,m.progress(g)},disabled:i??!1,destroy(){m.cancel()}}}c={centeredToTarget:l,allowActiveEvent:o},t.customEffect&&f&&(c.transitionDuration=f,c.transitionEasing=ut(d)),c.target=a.target}return{...c,getProgress(){return a.getProgress()},effect(u,l,f,d){a.progress(f?{...l,v:f,active:d}:l)},disabled:i,destroy(){a.cancel()}}}function te(e,t,n,s=!1){const i=yt(e,t);return i?(i.ready=new Promise(o=>{Hn(e,t,o)}),i):vt(e,t,n,{reducedMotion:s})}function Gn(e){return e===null?[null]:typeof e=="string"?Array.from(document.querySelectorAll(e)):Array.isArray(e)?e:[e]}function wt(e,t){const n=[];for(const{target:s,options:i}of e){const o=Gn(s);for(const r of o){const a=te(r,i,void 0,t?.reducedMotion);a instanceof ee&&n.push(a)}}return n}function Wn(e,t,n){const s=wt(t,n);return new Mn(s,e)}function Vn(e,t=2){return parseFloat(e.toFixed(t))}function Kn(e){return/\[]/g.test(e)}function Yn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function de(e,t){return t.includes("&")?t.replace(/&/g,e):`${e}${t}`}function J(){return"wi-12343210".replace(/\d/g,e=>String.fromCharCode((+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4)+97))}function $t(e){const{transition:t,transitionProperties:n}=e;return(t?.styleProperties||n||[]).map(i=>({...i,name:me(i.name)}))}function bt(e){let{transition:t,transitionProperties:n}=e,s=[];if(t?.styleProperties){const{duration:i,easing:o,delay:r}=t;i&&(t.styleProperties.some(c=>c.name.startsWith("--"))?s=[`all ${i}ms ${ue(o||"ease")}${r?` ${r}ms`:""}`,"visibility 0s"]:s=t.styleProperties.map(c=>`${me(c.name)} ${i}ms ${ue(o||"ease")}${r?` ${r}ms`:""}`))}else s=n?.filter(i=>i.duration).map(i=>`${me(i.name)} ${i.duration}ms ${ue(i.easing)||"ease"}${i.delay?` ${i.delay}ms`:""}`)||[];return s}function Bn({key:e,effectId:t,transition:n,transitionProperties:s,childSelector:i="> :first-child",selectorCondition:o}){const r=bt({transition:n,transitionProperties:s}),a=$t({transition:n,transitionProperties:s}).map(m=>`${m.name}: ${m.value};`),c=e.replace(/"/g,"'"),u=`:is(:state(${t}), :--${t}) ${i}`,l=`[data-interact-effect~="${t}"] ${i}`,f=o?de(u,o):u,d=o?de(l,o):l,h=[`${f},
2
+ ${d} {
3
+ ${a.join(`
4
+ `)}
5
+ }`];if(r.length){const m=`[data-interact-key="${c}"] ${i}`,p=o?de(m,o):m;h.push(`@media (prefers-reduced-motion: no-preference) { ${p} {
6
+ transition: ${r.join(", ")};
7
+ } }`)}return h}function ne(e,t,n){const s=(e||[]).filter(i=>t[i]?.type===n&&t[i].predicate).map(i=>t[i].predicate).join(") and (");return s&&`(${s})`}function L(e,t){const n=ne(e,t,"media");return n&&window.matchMedia(n)}function x(e,t){return(e||[]).filter(n=>t[n]?.type==="selector"&&t[n].predicate).map(n=>`:is(${t[n].predicate})`).join("")}const St=new Map([["viewEnter","once"],["animationEnd","once"],["hover","alternate"],["click","alternate"],["activate","alternate"],["interest","alternate"]]);function It(e,t,n,s){const{effects:i={},conditions:o={}}=n,{key:r,trigger:a}=t,c=a==="pointerMove";e.effectId||(e.effectId=s||J());const{effectId:u}=e,l={...i[u]||{},...e};let{key:f,conditions:d,triggerType:h}=l;if(!f){if(!r)return null;f=r}if(Kn(f))return null;d=[...new Set((d||[]).filter(b=>o[b]))],h||(h=St.get(a));const{namedEffect:m,customEffect:p,keyframeEffect:v,transition:y,transitionProperties:g,...E}={...l,key:f,conditions:d,effectId:u,triggerType:h},w=Yt(t,E);if(m)return c||!m.type?null:{namedEffect:m,initial:w,...E};if(v){if(!v.name){const b=u&&!(i[u]&&"keyframeEffect"in e);v.name=b?u:J()}return{keyframeEffect:v,initial:w,...E}}else return p?c?null:{initial:w,...E}:y?{transition:y,initial:w,...E}:g?{transitionProperties:g,initial:w,...E}:{initial:w,...E}}function Un(e,t,n,s,i){const{sequences:o={},conditions:r={}}=n;e.sequenceId||(e.sequenceId=s||J());const{sequenceId:a}=e,c={...o[a]||{},...e};let{effects:u,conditions:l,triggerType:f,delay:d=0,offset:h=0,offsetEasing:m="linear"}=c;if(typeof m=="function"||!u)return null;f||(f=St.get(t.trigger)),l=[...new Set((l||[]).filter(y=>r[y]))];const v=u.map((y,g)=>{const E=It({...y,triggerType:f,conditions:[...y.conditions||[],...l]},t,n,`${a}-eff-${g}`);return E&&Object.assign(E,{slotKey:i?.(g)})}).filter(y=>y!==null);return v.length?{sequenceId:a,triggerType:f,conditions:l,delay:d,offset:h,offsetEasing:m,effects:v}:null}function Qn(e){return e==="cssFloat"?"float":e==="easing"?"animation-timing-function":e==="cssOffset"?"offset":e==="composite"?"animation-composition":me(e)}function Xn(e){if(!e.length)return[];const t=e.map(i=>({...i}));t[0].offset===void 0&&(t[0].offset=0),t.length===1?e[0].offset===void 0&&(t[0].offset=1):t[t.length-1].offset===void 0&&(t[t.length-1].offset=1);let n=0,s=t[0].offset;for(let i=1;i<t.length;i++)if(t[i].offset!==void 0){const o=t[i].offset;if(o<s)return console.error("Offsets must be monotonically non-decreasing"),[];if(o>1)return console.error("Offsets must be in the range [0,1]"),[];const r=i-n;for(let a=n+1;a<i;a++){const c=(a-n)/r;t[a].offset=s+(o-s)*c}n=i,s=o}return t}function Zn(e,t){const n=Object.entries(e).filter(([s,i])=>s!=="offset"&&i!==void 0&&i!==null).map(([s,i])=>`${Qn(s)}: ${i};`).join(`
8
+ `);return`${t}% {
9
+ ${n}
10
+ }`}function Jn(e,t){const n=Xn(t);if(!n.length)return"";let s=n.map(i=>{const o=i.offset,r=Vn(o*100);return Zn(i,r)}).join(`
11
+ `);return`@keyframes ${e} {
12
+ ${s}
13
+ }`}function es(e){const{key:t,childSelector:n,declarations:s,media:i,states:o,selectorCondition:r,selectorSuffix:a}=e;if(!s.length)return"";let c=`[data-interact-key="${t}"]`;if(o&&o.length){const f=o.map(d=>`:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");c=`${c}:is(${f})`}n&&(c=`${c} ${n}`),a&&(c=`${c}${a}`),r&&(c=de(c,r));const u=s.map(({name:f,value:d,important:h})=>`${f}: ${d}${h?" !important":""};`).join(`
14
+ `),l=`${c} {
15
+ ${u}
16
+ }`;return i?`@media ${i} {
17
+ ${l}
18
+ }`:l}const ke=["animation","animation-composition","animation-timeline","animation-range"],we=[...ke,"transition","view-timeline"],He=["animation","transition","timeline"];function N(e){return e==="transition"?"transition":e==="view-timeline"?"timeline":"animation"}const H={transition:"_",animation:"none","animation-composition":"replace","animation-timeline":"auto","animation-range":"normal","view-timeline":"none"};function j(e,t,n=!1){return`--${e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)","g"),"")}${n?"-slot":""}-${t}`}function ts(e,t,n,s,i=0){const o={animation:e,transition:t,timeline:i},r={animation:n,transition:s,timeline:0};return we.flatMap(a=>[...Array.from({length:o[N(a)]},(c,u)=>`@property ${j(a,u)} { syntax: "*"; inherits: false; initial-value: ${H[a]}; }`),...Array.from({length:r[N(a)]},(c,u)=>`@property ${j(a,u,!0)} { syntax: "*"; inherits: false; initial-value: ${H[a]}; }`)])}function ns(e,t,n){const s=we.filter(r=>e[N(r)].slotsInSequence>0);if(s.length===0)return null;const i=s.map(r=>{const{listIndex:a,slotCursor:c,slotsInSequence:u}=e[N(r)];return{name:j(r,a),value:Array.from({length:u},(l,f)=>`var(${j(r,c+f,!0)})`).join(", ")}}),o={key:e.key,childSelector:e.childSelector,declarations:i};return t&&(o.media=ne(t,n||{},"media"),o.selectorCondition=x(t,n||{})),o}function ss(e,t,n,s=0){if(e.length===0)return"";const i={animation:t,transition:n,timeline:s},o=we.filter(c=>i[N(c)]>0);if(o.length===0)return"";const r=o.map(c=>({name:c,value:Array.from({length:i[N(c)]},(u,l)=>`var(${j(c,l)})`).join(", ")}));return`${e.map(({key:c,childSelector:u})=>`[data-interact-key="${c}"]${u?` ${u}`:""}`).join(", ")} {
19
+ ${r.map(({name:c,value:u})=>` ${c}: ${u};`).join(`
20
+ `)}
21
+ }`}const oe={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function is(e,t){const n=e?.name??oe.rangeStart.name,s=t?.name??e?.name??oe.rangeEnd.name,i={name:n,offset:e?.offset||oe.rangeStart.offset},o={name:s,offset:t?.offset||oe.rangeEnd.offset};return{startOffset:i,endOffset:o}}function F(e){if("keyframeEffect"in e&&!e.keyframeEffect.name&&"effectId"in e&&(e.keyframeEffect.name=e.effectId),"duration"in e)return{id:"",...e};const{rangeStart:t,rangeEnd:n,...s}=e,{startOffset:i,endOffset:o}=is(t,n);return{id:"",startOffset:i,endOffset:o,...s}}function M(e,t,n){let s=e.get(t);s||(s=new Set,e.set(t,s)),s.add(n)}function se(e,t){e.get(t)?.forEach(s=>{const{source:i,target:o,cleanup:r}=s;r();const a=i===t?o:i;e.get(a)?.delete(s)}),e.delete(t)}const os=[{name:"visibility",value:"hidden"},{name:"clip-path",value:"none",important:!0},{name:"transform",value:"none",important:!0},{name:"translate",value:"none",important:!0},{name:"scale",value:"none",important:!0},{name:"rotate",value:"none",important:!0}],Ae={animation:!1,transition:!1,timeline:!1};function Tt(e,t){const n=()=>({listIndex:0,slotCursor:0,slotsInInteraction:0,slotsInSequence:0,touched:!1});return{key:e,childSelector:t,partSelectors:new Set,assigned:new Set,animation:n(),transition:n(),timeline:n(),keyframeEntries:new Map}}function Ct(e,t){return Object.fromEntries(we.map(n=>{const s=N(n),{listIndex:i,slotCursor:o,slotsInSequence:r}=e[s];return[n,t[s]?j(n,o+r,!0):j(n,i)]}))}function Me(e,t,n){He.forEach(s=>{t[s]&&(e[s].touched=!0,n[s]&&(e[s].slotsInSequence+=1))})}function Ot(e){const{namedEffect:t,keyframeEffect:n,transition:s,transitionProperties:i}=e;return t||n?"animation":s||i?"transition":null}function rs(e){const t=new Map;return e.effects.forEach(n=>{const s=Ot(n);if(!s)return;const i=V(n),o=t.get(i)||{animation:0,transition:0,timeline:0};o[s]+=1,t.set(i,o)}),new Map([...t].map(([n,{animation:s,transition:i}])=>[n,{animation:s>1,transition:i>1,timeline:!1}]))}function as(e){He.forEach(t=>{const n=e[t];n.slotsInInteraction=Math.max(n.slotsInInteraction,n.slotsInSequence),n.slotsInSequence=0})}function cs(e){He.forEach(t=>{const n=e[t];n.listIndex+=n.touched?1:0,n.slotCursor+=n.slotsInInteraction,n.slotsInInteraction=0,n.touched=!1})}const ls={animation:"animation","animation-composition":"composition","animation-timeline":"animationTimeline","animation-range":"animationRange"};function us(e,t,n,s){const{key:i,conditions:o}=t,r=ne(o,e.configConditions,"media"),a=x(o,e.configConditions),c=W(t,{asCombinator:!0,useFirstChild:e.useFirstChild,addItemFilter:!0}),u=V(t),l=e.targetsMap.get(u)||Tt(i,c),f=Ct(l,Ae)["view-timeline"];return Me(l,{animation:!1,transition:!1,timeline:!0},Ae),e.targetsMap.set(u,l),s.add(u),{key:i,media:r,selectorCondition:a,childSelector:c,declarations:[{name:f,value:`--${n}`}]}}function _t(e,t,n,s,i){const o=[];for(const r of Object.keys(i)){const a=`${ot}${r}`;a in t&&o.push(...i[r](t[a],{key:n,scope:e,config:t}).map(c=>({...c,key:n,media:s})))}return o}function fs(e,t,n,s,i,o){const{assigned:r,childSelector:a,partSelectors:c}=n,u={animation:!1,transition:!1,timeline:!1},{key:l,effectId:f,conditions:d,namedEffect:h,keyframeEffect:m,transition:p,transitionProperties:v,initial:y}=t,g=ne(d,e.configConditions,"media"),E=x(d,e.configConditions),w=[{key:l,media:g,selectorCondition:E,childSelector:a,declarations:[]}];let b=[];const{declarations:S}=w[0];if(e.plugins&&w.push(..._t("effect",t,l,g,e.plugins)),h||m){const T=F(t),C=zn(null,T,s,o).filter(I=>I.name),_=C.length?{}:{"":[]};C.forEach(I=>{const k=I.part||"";(_[k]||=[]).push(I)}),b=C.map(I=>({name:I.name,keyframes:I.keyframes})),S.push(...C.flatMap(({custom:I})=>Object.entries(I||{}).filter(([k,A])=>A!==void 0).map(([k,A])=>({name:k,value:A})))),Object.entries(_).forEach(([I,k])=>{const A=ke.map(P=>({_listPropertyName:P,name:i[P],value:k.map(be=>{const Se=ls[P];return be[Se]||H[P]}).join(", ")})).filter(({_listPropertyName:P,name:be,value:Se})=>Se!==H[P]||r.has(be));A.forEach(({name:P})=>r.add(P)),u.animation=u.animation||A.length>0;const ie=I?`[data-motion-part~="${I}"]`:a;I&&A.length&&c.add(ie),y?(w.push({key:l,media:g,selectorCondition:E,childSelector:ie,declarations:os,selectorSuffix:":not([data-interact-enter])"}),w.push({key:l,media:g,selectorCondition:E,childSelector:ie,declarations:A,selectorSuffix:':not([data-interact-enter="done"])'})):I?w.push({key:l,media:g,selectorCondition:E,childSelector:ie,declarations:A}):S.push(...A)})}else if(p||v){const T=$t(t),C=bt(t);(C.length||r.has(i.transition))&&(S.push({name:i.transition,value:C.join(", ")||H.transition}),r.add(i.transition),u.transition=!0),w.push({key:l,media:g,selectorCondition:E,childSelector:a,states:[f],declarations:T})}else S.push(...ke.filter(T=>r.has(i[T])).map(T=>({name:i[T],value:H[T]})));return{rules:w.filter(T=>T.declarations.length),keyframes:b,wrote:u}}function ds(e,t,n){const s=t.namedEffect&&je(t.namedEffect.type,!1);if(!s?.getNames)return;const i=r=>s.getNames({...t,suffix:r});if(i("-1").join()===i().join())return;const o=e.keyframeEntries.get(n)||[];e.keyframeEntries.set(n,[...o,{slotKey:t.slotKey,getNames:i}])}function kt(e,t,n,s,i,o){const r=V(t),a=e.targetsMap.get(r)||Tt(t.key,W(t,{asCombinator:!0,useFirstChild:e.useFirstChild,addItemFilter:!0}));s.add(r);const c=o?.get(r)||Ae,u=Ct(a,c);if(e.collectSlots){ds(a,t,u.animation);const h=Ot(t);return Me(a,{animation:h==="animation",transition:h==="transition",timeline:!1},c),e.targetsMap.set(r,a),[]}t.namedEffect&&(t.suffix=e.keyframeSlots.get(t.slotKey));const{rules:l,keyframes:f,wrote:d}=fs(e,t,a,n,u,i);return f.forEach(({name:h,keyframes:m})=>e.keyframesMap.set(h,m)),Me(a,d,c),e.targetsMap.set(r,a),l}function hs(e,t,n,s){const i=[],o=new Set,r=rs(t);i.push(...t.effects.flatMap(c=>kt(e,c,n,o,t,r)));const{conditions:a}=t;return o.forEach(c=>{s.add(c);const u=e.targetsMap.get(c),l=ns(u,a,e.configConditions);l&&(l.declarations.forEach(({name:f})=>u.assigned.add(f)),i.push(l)),as(u)}),i}function ms(e,t,n){const{key:s,conditions:i,effects:o=[],sequences:r=[]}=t,a=e.plugins?_t("interaction",t,s,ne(i,e.configConditions,"media"),e.plugins):[],{trigger:c}=t,u={trigger:Yn(c),id:["trigger",n].join("-")},l=new Set;c==="viewProgress"&&a.push(us(e,t,u.id,l));const f=o.map((h,m)=>{const p=It(h,t,e.config,`eff-${n}-${m}`);return p&&Object.assign(p,{slotKey:pe(n,m)})}).filter(h=>h!==null);a.push(...f.flatMap(h=>kt(e,h,u,l)));const d=r.map((h,m)=>Un(h,t,e.config,`seq-${n}-${m}`,p=>pe(n,p,m))).filter(h=>h!==null);return a.push(...d.flatMap(h=>hs(e,h,u,l))),c==="viewProgress"&&l.size>1&&e.scopedTimelines.push(`--${u.id}`),l.forEach(h=>cs(e.targetsMap.get(h))),a}function ps(e={}){const{useFirstChild:t=!0,plugins:n}=typeof e=="boolean"?{useFirstChild:e,plugins:void 0}:e;return{useFirstChild:t,plugins:n}}function At(e,t){const{useFirstChild:n=!0,plugins:s,collectSlots:i=!1}=t,o={config:e,configConditions:e.conditions||{},targetsMap:new Map,keyframesMap:new Map,keyframeSlots:i?new Map:Mt(e),scopedTimelines:[],collectSlots:i,useFirstChild:n,plugins:s},r=e.interactions.flatMap((a,c)=>ms(o,a,c));return{ctx:o,cssRules:r}}function pe(e,t,n){return[e,n,t].filter(s=>s!==void 0).join(":")}function Mt(e){const{ctx:t}=At(e,{collectSlots:!0}),n=new Map,s=i=>i?`-${i}`:void 0;return t.targetsMap.forEach(({keyframeEntries:i})=>{const o=new Set;i.forEach(r=>{const a=l=>r.flatMap(({getNames:f})=>f(s(l)));let c=0,u=a(c);for(;u.some(l=>o.has(l));)u=a(++c);u.forEach(l=>o.add(l)),c&&r.forEach(({slotKey:l})=>n.set(l,s(c)))})}),n}function gs(e,t){const{ctx:n,cssRules:s}=At(e,ps(t)),i=[...n.targetsMap.values()],o=Math.max(0,...i.map(({animation:h})=>h.listIndex)),r=Math.max(0,...i.map(({transition:h})=>h.listIndex)),a=Math.max(0,...i.map(({timeline:h})=>h.listIndex)),c=ss(i.flatMap(h=>[h,...[...h.partSelectors].map(m=>({key:h.key,childSelector:m}))]),o,r,a),u=Math.max(0,...i.map(({animation:h})=>h.slotCursor)),l=Math.max(0,...i.map(({transition:h})=>h.slotCursor)),f=ts(o,r,u,l,a),d=n.scopedTimelines.length?`:root {
22
+ timeline-scope: ${n.scopedTimelines.join(", ")};
23
+ }`:"";return{keyframes:n.keyframesMap,atProperty:f,cssRules:s,listsRule:c,timelineScopeRule:d}}function vs(e,t){const{cssRules:n,keyframes:s,atProperty:i,listsRule:o,timelineScopeRule:r}=gs(e,t);return[...i,...[...s.entries()].map(([c,u])=>Jn(c,u)),...n.map(es),o,r].filter(c=>c).join(`
24
+ `)}const ys={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},Es={root:null,rootMargin:"0px",threshold:[0]},ws=.2;function $s(e){const t=e.trim().split(/\s+/),n=t[0],s=t.length>1?t[1]:t[0],i=o=>o.startsWith("-")?o.slice(1):parseFloat(o)?`-${o}`:o;return`${i(n)} 0px ${i(s)}`}const Q={},R=new WeakMap,ge=new WeakSet,Y=new WeakMap;let qt={},B=null;function bs(e){qt=e}function Pt(e,t,n){R.get(e)?.forEach(({source:i,handler:o})=>{i===e&&o(t,n)})}function Ue(){return B||(B=new IntersectionObserver(e=>{e.forEach(t=>{const n=t.target;t.isIntersecting||Pt(n,!1,!0)})},Es),B)}function Lt(e,t=!1){const n=JSON.stringify({...e,isSafeMode:t});if(Q[n])return Q[n];const s=e.threshold??ws,i=t?ys:{root:null,rootMargin:e.inset?$s(e.inset):"0px",threshold:s},o=new IntersectionObserver(r=>{r.forEach(a=>{const c=a.target,u=!ge.has(c);if(u&&(ge.add(c),e.useSafeViewEnter&&!a.isIntersecting)){O.measure(()=>{const l=a.boundingClientRect.height,f=a.rootBounds?.height;if(!f)return;const d=Array.isArray(e.threshold)?Math.min(...e.threshold):e.threshold;d&&l*d>f&&O.mutate(()=>{o.unobserve(c);const m=Lt(e,!0);Y.set(c,m),m.observe(c)})});return}(a.isIntersecting||!u)&&Pt(c,a.isIntersecting)})},i);return Q[n]=o,o}function Ss(e,t,n,s={},{reducedMotion:i,selectorCondition:o,animation:r}={}){const a={...qt,...s},c=n.triggerType||"once",u=r||te(t,F(n),void 0,i);if(!u)return;const l=Lt(a);c!=="once"&&u.persist?.();let f=!0,d=!1,h;h={source:e,target:t,handler:(v,y)=>{if(!(o&&!t.matches(o)))if(c==="once"){if(v&&!d){d=!0;const g=R.get(e);(!g||g.size===0||g.size===1&&g.has(h))&&((Y.get(e)||l).unobserve(e),ge.delete(e)),u.onFinish(()=>{R.get(e)?.delete(h),R.get(t)?.delete(h)}),u.play(()=>{const E=()=>{t.dataset.interactEnter="start"};if(u.isCSS){O.mutate(()=>{requestAnimationFrame(E)});const w=()=>{O.mutate(()=>{t.dataset.interactEnter="done"})};u.onFinish(w),u.onAbort(w)}else O.mutate(E)})}}else c==="alternate"?f&&v?(f=!1,u.play()):f||u.reverse():c==="repeat"?v?(u.progress(0),u.play()):y&&(u.pause(),u.progress(0)):c==="state"&&(v?u.play():y&&u.pause())},cleanup:()=>{(Y.get(e)||l).unobserve(e),(c==="repeat"||c==="state")&&Ue().unobserve(e),u.cancel(),ge.delete(e),Y.delete(e)}},M(R,e,h),M(R,t,h),Y.set(e,l),l.observe(e),(c==="repeat"||c==="state")&&Ue().observe(e)}function Is(e){se(R,e)}function Ts(){B=null,Object.keys(Q).forEach(e=>delete Q[e])}const Cs={add:Ss,remove:Is,setOptions:bs,reset:Ts};function xt(e,t){return Object.assign(Object.create(t),e)}function Os(e,t,n,s){let i=e*(1-n)+t*n;if(s){const o=i-e;Math.abs(o)<s&&(i=e+s*Math.sign(o));const r=t-i;if(Math.abs(r)<s)return t}return i}function _s(e){let t=!1;return function(){t||(t=!0,window.requestAnimationFrame(()=>{t=!1,e()}))}}function Qe(e,t){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,e()},t)}}function ks(e,t){const n=e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);return ve(n[1],t)+ve(n[6],t)}function ve(e,t){return e?/^-?\d+px$/.test(e)?parseInt(e):/^-?\d+[lsd]?vh$/.test(e)?parseInt(e)*t.viewportHeight/100:/^-?\d+[lsd]?vw$/.test(e)?parseInt(e)*t.viewportWidth/100:/^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e)?ks(e,t):parseInt(e)||0:0}function z(e,t,n){const{name:s,offset:i=0}=e,{start:o,end:r}=n,a=r-o,c=i/100;let u,l;return s==="entry"?(u=o-t,l=Math.min(t,a)):s==="entry-crossing"?(u=o-t,l=a):s==="contain"?(u=Math.min(r-t,o),l=Math.abs(t-a)):s==="exit"?(u=Math.max(o,r-t),l=Math.min(t,a)):s==="exit-crossing"?(u=o,l=a):s==="cover"&&(u=o-t,l=a+t),u+c*l|0}function Te(e,t,n,s,i){let o=0;const r={start:t,end:n};return e.forEach((a,c)=>{o+=a.offset;const u=a.sticky;if(u){if("end"in u&&e[c-1]?.element){const d=((i?a.element.offsetWidth:a.element.offsetHeight)||0)+u.end-s,h=o+d-a.offset,m=h<r.start,p=!m&&h<=n;let v=0;(m||p)&&(v=a.offset,r.end+=v),m&&(r.start+=v)}if("start"in u){const l=o-u.start,f=l<r.start,d=!f&&l<=r.end;let h=0;const m=e[c-1]?.element;if(m){if(f||d){const p=(i?m.offsetWidth:m.offsetHeight)||0,v=a.offset,y=(i?a.element.offsetWidth:a.element.offsetHeight)||0;h=p-(v+y),o+=h,r.end+=h}f&&(r.start+=h)}}}}),r}function As(e,t,n,s,i,o){const{start:r,end:a,duration:c}=e;let u=r,l=a,f=e.startRange,d=e.endRange,h;if(typeof c=="string"){f={name:c,offset:0},d={name:c,offset:100},u=z(f,n,t),l=z(d,n,t),h=l-u;const m=Te(o,u,l,n,s);u=m.start,l=m.end}else{if(f||r?.name){f=f||r;const m=ve(f.add,i),p=z({...f,offset:0},n,t),v=z({...f,offset:100},n,t),y=Te(o,p,v,n,s);u=y.start+f.offset/100*(y.end-y.start)+m}if(d||a?.name){d=d||a;const m=ve(d.add,i),p=z({...d,offset:0},n,t),v=z({...d,offset:100},n,t),y=Te(o,p,v,n,s);l=y.start+d.offset/100*(y.end-y.start)+m}else typeof c=="number"&&(l=u+c)}return!h&&!c&&(h=l-u),{...e,start:u,end:l,startRange:f,endRange:d,duration:h||c}}function Ms(e){return e.position==="sticky"}function qs(e,t,n){return e.position==="fixed"&&(!t||t===window.document.body||t===n)}function Ps(e,t){return parseInt(t?e.left:e.top)}function Ls(e,t){return parseInt(t?e.right:e.bottom)}function xs(e,t,n){n&&(e.style.position="static");const s=(t?e.offsetLeft:e.offsetTop)||0;return n&&(e.style.position=null),s}function Fs(e,t){let n;const s=Ps(e,t),i=Ls(e,t),o=!isNaN(s),r=!isNaN(i);return(o||r)&&(n={},o&&(n.start=s),r&&(n.end=i)),n}function re(e,t,n,s,i){const o=e[0].viewSource,r=[];let a=(s?o.offsetWidth:o.offsetHeight)||0,c=0,u=o;for(;u;){const f=window.getComputedStyle(u),d=Ms(f),h=d?Fs(f,s):void 0,m=xs(u,s,d);if((!h||!("end"in h))&&(c+=m),r.push({element:u,offset:m,sticky:h}),u=u.offsetParent,qs(f,u,t))break;if(u===t){r.push({element:u,offset:0});break}}return r.reverse(),e.map(f=>({...As(f,{start:c,end:c+a},n,s,i,r)}))}const Xe=100,Rs={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function Ns(e,t,n,s){let i=0;return e>=t&&e<=n?i=s?(e-t)/s:1:e>n&&(i=1),i}function Ze(e,t){return e===window?t?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:t?e.clientWidth:e.clientHeight}function js(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function zs(e){const t=xt(e,Rs),n=t.root,s=t.horizontal,i=new WeakMap;let o=Ze(n,s),r,a,c,u,l;const f=[],d=js();if(t.scenes=Object.values(e.scenes.reduce((p,v,y)=>{const g=v.groupId?`group-${v.groupId}`:String(y);return p[g]?p[g].push(v):p[g]=[v],p},{})).flatMap(p=>(p.every(v=>v.viewSource&&(typeof v.duration=="string"||v.start?.name))?(p=re(p,n,o,s,d),(t.observeSourcesResize||t.observeContentResize)&&f.push(p)):p.forEach(v=>{v.end==null&&(v.end=v.start+v.duration),v.duration==null&&(v.duration=v.end-v.start)}),p)),t.scenes.forEach((p,v)=>{p.index=v}),f.length){const p=new Map;window.ResizeObserver&&(c=new window.ResizeObserver(function(v){v.forEach(y=>{const g=p.get(y.target),E=re(g,n,o,s,d);E.forEach((w,b)=>{t.scenes[w.index]=E[b]}),f.splice(f.indexOf(g),1,E)})}),f.forEach(v=>{c.observe(v[0].viewSource,{box:"border-box"}),p.set(v[0].viewSource,v)}),t.observeContentResize&&t.contentRoot&&new window.ResizeObserver(Qe(()=>{const y=f.map(g=>{const E=re(g,n,o,s,d);return E.forEach((w,b)=>{t.scenes[w.index]=E[b]}),E});f.length=0,f.push(...y),f.forEach(g=>{p.set(g[0].viewSource,g)})},Xe)).observe(t.contentRoot,{box:"border-box"})),t.observeViewportResize&&(u=Qe(function(){o=Ze(n,s);const v=f.map(y=>{const g=re(y,n,o,s,d);return g.forEach((E,w)=>{t.scenes[E.index]=g[w]}),g});f.length=0,f.push(...v),f.forEach(y=>{p.set(y[0].viewSource,y)})},Xe),n===window?window.addEventListener("resize",u):window.ResizeObserver&&(l=new window.ResizeObserver(u),l.observe(n,{box:"border-box"})))}t.observeViewportEntry&&window.IntersectionObserver&&(a=new window.IntersectionObserver(function(p){p.forEach(v=>{(i.get(v.target)||[]).forEach(y=>{y.disabled=!v.isIntersecting})})},{root:n===window?window.document:n,rootMargin:t.viewportRootMargin,threshold:0}),t.scenes.forEach(p=>{if(p.viewSource){let v=i.get(p.viewSource);v||(v=[],i.set(p.viewSource,v),a.observe(p.viewSource)),v.push(p)}}));function h({p,vp:v}){p=+p.toFixed(1);const y=+v.toFixed(4);if(p!==r){for(let g of t.scenes)if(!g.disabled){const{start:E,end:w,duration:b}=g,S=Ns(p,E,w,b);g.effect(g,S,y)}r=p}}function m(){t.scenes.forEach(p=>p.destroy?.()),a&&(a.disconnect(),a=null),c&&(c.disconnect(),c=null),u&&(l?(l.disconnect(),l=null):window.removeEventListener("resize",u))}return{tick:h,destroy:m}}const Hs={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class Ds{constructor(t={}){this.config=xt(t,Hs),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=_s(()=>{this._measure?.(),this.tick(!0)})}start(){this.setupEffect(),this.setupEvent(),this.resetProgress(),this.tick()}pause(){this.removeEvent()}resetProgress(t={}){const n=this.config.root,s=t.x||t.x===0?t.x:n.scrollX||n.scrollLeft||0,i=t.y||t.y===0?t.y:n.scrollY||n.scrollTop||0,o=this.config.horizontal?s:i;this.progress.p=o,this.progress.prevP=o,this.progress.vp=0,this.config.transitionActive&&(this.currentProgress.p=o,this.currentProgress.prevP=o,this.currentProgress.vp=0),t&&this.config.root.scrollTo(s,i)}tick(t){const n=this.config.transitionActive;n&&this.lerp();const s=n?this.currentProgress:this.progress;if(this.config.velocityActive){const i=s.p-s.prevP,o=i<0?-1:1;s.vp=Math.min(this.config.velocityMax,Math.abs(i))/this.config.velocityMax*o}this.effect.tick(s),n&&s.p!==this.progress.p&&(t&&this._lerpFrameId&&window.cancelAnimationFrame(this._lerpFrameId),this._lerpFrameId=window.requestAnimationFrame(()=>this.tick())),s.prevP=s.p}lerp(){this.currentProgress.p=Os(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=zs(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const qe=new WeakMap;let Ft=()=>({});function Gs(e){Ft=e}function Ws(e,t,n,s,{reducedMotion:i,selectorCondition:o}){if(i||o&&!t.matches(o))return;const r={trigger:"view-progress",element:e},a=F(n);let c;if("ViewTimeline"in window){const l=te(t,a,r);l&&!l.isCSS&&(l.play(),c=()=>{l.ready.then(()=>{l.cancel()})})}else{const l=Et(t,a,r);if(l){const f=Array.isArray(l)?l:[l],d=new Ds({viewSource:e,scenes:f,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...Ft()});c=()=>{d.destroy()},Promise.all(f.map(h=>h.ready||Promise.resolve())).then(()=>{d.start()})}}if(!c)return;const u={source:e,target:t,cleanup:c};M(qe,e,u),M(qe,t,u)}function Vs(e){se(qe,e)}const Ks={add:Ws,remove:Vs,registerOptionsGetter:Gs};function Je(e,t,n){return Math.min(Math.max(e,n),t)}function et(e){let t=!1;return function(){if(!t)return t=!0,window.requestAnimationFrame(()=>{t=!1,e()})}}function Ys(e){let t=e,n=0,s=0;if(t.offsetParent)do n+=t.offsetLeft,s+=t.offsetTop,t=t.offsetParent;while(t);return{left:n,top:s,width:e.offsetWidth,height:e.offsetHeight}}function Bs(){const e=window.devicePixelRatio;let t=!1;if(e===1)return!1;document.body.addEventListener("pointerdown",s=>{t=s.offsetX!==10},{once:!0});const n=new PointerEvent("pointerdown",{clientX:10});return document.body.dispatchEvent(n),t}function Us(){return new Promise(e=>{const t=window.scrollY;let n=!1,s;function i(){document.body.addEventListener("pointerdown",a=>{s===void 0?s=a.offsetY:n=a.offsetY===s},{once:!0});const r=new PointerEvent("pointerdown",{clientY:500});document.body.dispatchEvent(r)}function o(){window.scrollY!==t&&(window.removeEventListener("scroll",o),i(),e(n))}i(),window.addEventListener("scroll",o),window.scrollY>0&&window.scrollBy(0,-1)})}function Qs(e){Us().then(t=>{e.fixRequired=t,t&&(window.addEventListener("scroll",e.scrollHandler),e.scrollHandler())})}let ae=0;const he=new Set;function Xs(){const e=n=>{for(let s of n.changedTouches)he.add(s.identifier)},t=n=>{for(let s of n.changedTouches)he.delete(s.identifier)};return document.addEventListener("touchstart",e,{passive:!0}),document.addEventListener("touchend",t,{passive:!0}),function(){he.clear(),document.removeEventListener("touchstart",e),document.removeEventListener("touchend",t)}}function Zs(e,t){if("onscrollend"in window)return e.addEventListener("scrollend",t),function(){e.removeEventListener("scrollend",t)};let n=0,s;ae||(s=Xs()),ae+=1;function i(o){clearTimeout(n),n=setTimeout(()=>{he.size?setTimeout(i,100):(t(o),n=0)},100)}return e.addEventListener("scroll",i),function(){e.removeEventListener("scroll",i),ae-=1,ae||s()}}function Js(e,t,n){return{x(s){const i=e.left-n.x+e.width/2,o=i>=t.width/2,r=(o?i:t.width-i)*2,a=o?0:i-r/2;return(s-a)/r},y(s){const i=e.top-n.y+e.height/2,o=i>=t.height/2,r=(o?i:t.height-i)*2,a=o?0:i-r/2;return(s-a)/r}}}function ei(e,t){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>e&&e(t))}function ti(e){e.rect.width=window.document.documentElement.clientWidth,e.rect.height=window.document.documentElement.clientHeight}function ni(e){const t=new ResizeObserver(n=>{n.forEach(s=>{e.rect.width=s.borderBoxSize[0].inlineSize,e.rect.height=s.borderBoxSize[0].blockSize})});return t.observe(e.root,{box:"border-box"}),t}function si(e){let t=!1,n={x:e.rect.width/2,y:e.rect.height/2,vx:0,vy:0},s,i,o,r,a;const c={x:0,y:0};e.scenes.forEach(l=>{l.target&&l.centeredToTarget&&(l.transform=Js(Ys(l.target),e.rect,c),t=!0),e.root?i=ni(e):(o=ti.bind(null,e),window.addEventListener("resize",o))}),s=function(l){for(let f of e.scenes)if(!f.disabled){const d=f.transform?.x(l.x)||l.x/e.rect.width,h=f.transform?.y(l.y)||l.y/e.rect.height,m=+Je(0,1,d).toPrecision(4),p=+Je(0,1,h).toPrecision(4),v={x:l.vx,y:l.vy};e.allowActiveEvent&&(l.active=d<=1&&h<=1&&d>=0&&h>=0),f.effect(f,{x:m,y:p},v,l.active)}Object.assign(n,l)},t&&(r=ei.bind(c,s,n),a=Zs(document,r));function u(){e.scenes.forEach(l=>l.destroy?.()),a?.(),i?(i.disconnect(),i=null):(window.removeEventListener("resize",o),o=null),s=null,n=null}return{tick:s,destroy:u}}const ii=1e3/60*3;let ce;function oi(){D.x=window.scrollX,D.y=window.scrollY}const D={x:0,y:0,scrollHandler:oi,fixRequired:void 0};class ri{constructor(t={}){this.config={...t},this.effect=null,this._nextTick=null,this._nextTransitionTick=null,this._startTime=0;let n;this.config.transitionDuration?n=this.config.noThrottle?()=>this.transition():et(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):et(()=>{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=i=>{const o=this.config.root?i.offsetX:i.x,r=this.config.root?i.offsetY:i.y;this.progress.vx=o-this.progress.x,this.progress.vy=r-this.progress.y,this.progress.x=o,this.progress.y=r,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){ce=typeof ce=="boolean"?ce:Bs();const i=ce?window.devicePixelRatio:1;typeof D.fixRequired>"u"&&Qs(D),this._measure=o=>{if(o.target!==this.config.root){const r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:o.x*i+D.x,clientY:o.y*i+D.y});o.stopPropagation(),this.config.root.dispatchEvent(r)}else s(o)}}else this._measure=s}start(){this.setupEffect(),this.setupEvent()}pause(){this.removeEvent()}tick(){this.effect.tick(this.progress)}transition(){const t=this.config.transitionDuration,n=this.config.transitionEasing||(r=>r),s=performance.now();let i=!1;const o=r=>{const a=(r-this._startTime)/t,c=n(Math.min(1,a));i&&(this.progress.vx=0,this.progress.vy=0,i=!1),this.currentProgress=Object.entries(this.progress).reduce((u,[l,f])=>(l==="active"?u[l]=f:u[l]=this.previousProgress[l]+(f-this.previousProgress[l])*c,u),this.currentProgress||{}),a<1&&(this._nextTransitionTick=requestAnimationFrame(o),i=r-this._startTime>ii),this.effect.tick(this.currentProgress)};return this._startTime?(this._nextTransitionTick&&cancelAnimationFrame(this._nextTransitionTick),Object.assign(this.previousProgress,this.currentProgress),this._startTime=s,o(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 t=this.config.root||window;t.addEventListener("pointermove",this._measure,{passive:!0}),this.config.eventSource&&this.config.eventSource.addEventListener("pointermove",this._measure,{passive:!0}),this.config.allowActiveEvent&&(t.addEventListener("pointerleave",this._pointerLeave,{passive:!0}),t.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 t=this.config.root||window;t.removeEventListener("pointermove",this._measure),this.config.eventSource&&this.config.eventSource.removeEventListener("pointermove",this._measure),this.config.allowActiveEvent&&(t.removeEventListener("pointerleave",this._pointerLeave),t.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=si(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const Pe=new WeakMap;let Rt=()=>({});function ai(e){Rt=e}function ci(e,t,n,s={},{reducedMotion:i,selectorCondition:o}){if(i||o&&!t.matches(o))return;const r={trigger:"pointer-move",element:e,axis:s.axis??"y"},a=Et(t,F(n),r);if(a){const c=Array.isArray(a)?a:[a],u=new ri({root:s.hitArea==="self"?e:void 0,scenes:c,...Rt()}),f={source:e,target:t,cleanup:()=>{u.destroy()}};M(Pe,e,f),M(Pe,t,f),Promise.all(c.map(d=>d.ready||Promise.resolve())).then(()=>{u.start()})}}function li(e){se(Pe,e)}const ui={add:ci,remove:li,registerOptionsGetter:ai},Le=new WeakMap;function fi(e,t,n,s,{reducedMotion:i,selectorCondition:o,animation:r,sourceAnimationOptions:a}){const c=r||te(t,F(n),void 0,i);if(!c)return;const{effectId:u}=s,l=h=>{if(o&&!t.matches(o))return;const m=h.animationName,p=h.detail?.effectId,v=a?yt(e,a):null;if(v){if(v.playState==="running"||m&&!v.hasAnimationName(m))return;if(p&&p!==u&&!v.hasAnimationId(p))return}c.play()},d={source:e,target:t,cleanup:()=>{c.cancel(),e.removeEventListener("animationend",l)}};M(Le,e,d),M(Le,t,d),e.addEventListener("animationend",l)}function di(e){se(Le,e)}const hi={add:fi,remove:di};function mi(e,t,n=!1,s,i,o){const r=o||te(e,F(t),void 0,n);if(!r)return null;let a=!0;const c=t.triggerType||"alternate";return u=>{if(s&&!e.matches(s))return;const l=!i,f=i?.enter?.includes(u.type),d=i?.leave?.includes(u.type);if(f||l){if(c==="alternate"||c==="state")a?(a=!1,r.play()):c==="alternate"?r.reverse():c==="state"&&(r.playState==="running"?r.pause():r.playState!=="finished"&&r.play());else{if(r.progress(0),delete e.dataset.interactEnter,r.isCSS){const h=()=>{O.mutate(()=>{e.dataset.interactEnter="done"})};r.onFinish(h),r.onAbort(h)}r.play()}return}d&&(c==="alternate"?r.reverse():c==="repeat"?(r.cancel(),O.mutate(()=>{delete e.dataset.interactEnter})):c==="state"&&r.playState==="running"&&r.pause())}}function pi(e,t,{effectId:n,listContainer:s,listItemSelector:i,stateAction:o},r,a){const c=!!s,u=o??"toggle",l=u==="toggle";return f=>{if(r&&!e.matches(r))return;const d=c?e.closest(`${s} > ${i||""}:has(:scope)`):void 0,h=!a,m=a?.enter?.includes(f.type),p=a?.leave?.includes(f.type);h?t.toggleEffect(n,u,d):(m&&t.toggleEffect(n,l?"add":u,d),p&&l&&t.toggleEffect(n,"remove",d))}}const xe=new WeakMap;function tt(e,t){return n=>{const s=n;e.contains(s.relatedTarget)||t(s)}}function gi(e){return t=>{const n=t;n.pointerType&&e(n)}}function vi(e){return t=>{const n=t;n.code==="Space"?(n.preventDefault(),e(n)):n.code==="Enter"&&e(n)}}const yi={focusin:(e,t)=>tt(e,t),focusout:(e,t)=>tt(e,t),click:(e,t)=>gi(t),keydown:(e,t)=>vi(t)};function Ei(e,t,n){const s=yi[e];return s?s(t,n):i=>n(i)}function wi(e){return typeof e=="object"&&!Array.isArray(e)&&("enter"in e||"leave"in e)}function $i(e){if(typeof e=="string")return{toggle:[e]};if(Array.isArray(e))return{toggle:[...e]};if(wi(e)){const t=e.enter?[...e.enter]:[],n=e.leave?[...e.leave]:[];return{enter:t,leave:n}}return{}}function bi(e){return!!(e.enter?.length||e.leave?.length)}function Si(e){return bi(e)?{enter:e.enter??[],leave:e.leave??[]}:void 0}function Ii(e,t,n,s,{reducedMotion:i,targetController:o,selectorCondition:r,animation:a}){const c=$i(s.eventConfig),u=n.transition||n.transitionProperties,l=Si(c);let f,d=!1;if(u?f=pi(t,o,n,r,l):(f=mi(t,n,i,r,l,a),d=n.triggerType==="once"),!f)return;const h=f,m=new AbortController;function p(g,E,w){const b=Ei(E,e,h);g.addEventListener(E,b,{...w,signal:m.signal})}const y={source:e,target:t,cleanup:()=>{m.abort()}};if(M(xe,e,y),M(xe,t,y),l){const g=c.enter,E=c.leave;g.forEach(S=>{S==="focusin"&&(e.tabIndex=0),p(e,S,{passive:!0,once:d})});const w=!n.stateAction||n.stateAction==="toggle";(u?w:n.triggerType!=="once")&&E.forEach(S=>{if(S==="focusout"){p(e,S,{once:d});return}p(e,S,{passive:!0})})}else(c.toggle??[]).forEach(E=>{p(e,E,{once:d,passive:E!=="keydown"})})}function Ti(e){se(xe,e)}const U={add:Ii,remove:Ti},Fe={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},nt={click:Fe.activate,hover:Fe.interest};function le(e){const t=Fe[e];return(n,s,i,o,r)=>{const a=r?.allowA11yTriggers&&e in nt?nt[e]:t;U.add(n,s,i,{eventConfig:a},r??{})}}const G={viewEnter:Cs,hover:{add:le("hover"),remove:U.remove},click:{add:le("click"),remove:U.remove},animationEnd:hi,viewProgress:Ks,pointerMove:ui,activate:{add:le("activate"),remove:U.remove},interest:{add:le("interest"),remove:U.remove}};function Ci(e){return e.replace(/\[[^\]]+]/g,"[]")}class ${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;static plugins=new Map;constructor(){this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},this.addedInteractions={},this.mediaQueryListeners=new Map,this.listInteractionsCache={},this.controllers=new Set}init(t,n){if(typeof window>"u"||!window.customElements)return;const s=n?.useCustomElement??!!$.defineInteractElement;this.dataCache=ki(t,s);const i=$.defineInteractElement?.();s&&i===!1?document.querySelectorAll("interact-element").forEach(o=>{o.connect()}):$.controllerCache.forEach((o,r)=>o.connect(r))}destroy({clearCache:t=!1}={}){for(const n of this.controllers)n.disconnect({removeFromCache:t});for(const[,n]of this.mediaQueryListeners.entries())n.mql.removeEventListener("change",n.handler);this.mediaQueryListeners.clear(),this.addedInteractions={},this.listInteractionsCache={},this.controllers.clear(),this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},$.instances.splice($.instances.indexOf(this),1)}setController(t,n){this.controllers.add(n),$.setController(t,n)}deleteController(t,n=!1){const s=$.controllerCache.get(t);this.clearInteractionStateForKey(t),this.clearMediaQueryListenersForKey(t),s&&n&&(this.controllers.delete(s),$.deleteController(t))}has(t){return!!this.get(t)}get(t){const n=Ci(t);return this.dataCache.interactions[n]}clearMediaQueryListenersForKey(t){for(const[n,s]of this.mediaQueryListeners.entries())s.key===t&&(s.mql.removeEventListener("change",s.handler),this.mediaQueryListeners.delete(n))}clearInteractionStateForKey(t){(this.get(t)?.interactionIds||[]).forEach(i=>{const o=q(i,t);delete this.addedInteractions[o]});const s=`${t}::seq::`;for(const i of $.sequenceCache.keys())i.startsWith(s)&&($.sequenceCache.delete(i),delete this.addedInteractions[i])}setupMediaQueryListener(t,n,s,i){this.mediaQueryListeners.has(t)||(n.addEventListener("change",i),this.mediaQueryListeners.set(t,{mql:n,handler:i,key:s}))}static create(t,n){const s=new $;return $.instances.push(s),s.init(t,n),s}static destroy(){$.controllerCache.forEach(t=>{t.disconnect()}),$.instances.length=0,$.controllerCache.clear(),$.sequenceCache.clear(),$.elementSequenceMap=new WeakMap}static setup(t){t.scrollOptionsGetter&&G.viewProgress.registerOptionsGetter?.(t.scrollOptionsGetter),t.pointerOptionsGetter&&G.pointerMove.registerOptionsGetter?.(t.pointerOptionsGetter),t.viewEnter&&G.viewEnter.setOptions(t.viewEnter),t.allowA11yTriggers!==void 0&&($.allowA11yTriggers=t.allowA11yTriggers)}static getInstance(t){const n=$.instances.find(s=>s.has(t));return n||console.warn(`Interact: Instance for key "${t}" not found`),n}static getController(t){const n=t?$.controllerCache.get(t):void 0;return n||console.warn(`Interact: Controller for key "${t}" not found`),n}static setController(t,n){$.controllerCache.set(t,n)}static deleteController(t){$.controllerCache.delete(t)}static registerEffects=Fn;static getRegisteredEffect=je;static use(t,n){$.plugins.set(t,n)}static getPlugin(t){return $.plugins.get(t)}static getPluginsNames(){return new Set($.plugins.keys())}static getSequence(t,n,s,i){const o=$.sequenceCache.get(t);if(o)return o;const r=Wn(n,s,i);return $.sequenceCache.set(t,r),$._registerSequenceElements(s,r),r}static addToSequence(t,n,s,i){const o=$.sequenceCache.get(t);if(!o)return!1;const a=wt(n,i).map((c,u)=>({index:s[u]??o.animationGroups.length,group:c}));return o.addGroups(a),$._registerSequenceElements(n,o),!0}static _registerSequenceElements(t,n){for(const{target:s}of t){const i=Array.isArray(s)?s:s instanceof HTMLElement?[s]:[];for(const o of i){let r=$.elementSequenceMap.get(o);r||(r=new Set,$.elementSequenceMap.set(o,r)),r.add(n)}}}static removeFromSequences(t){for(const n of t){const s=$.elementSequenceMap.get(n);if(s){for(const i of s)i.removeGroups(o=>o.animations.some(r=>r.effect?.target===n));$.elementSequenceMap.delete(n)}}}}let Oi=0;function W(e,{asCombinator:t=!1,addItemFilter:n=!1,useFirstChild:s=!1}={}){if(e.listContainer){const i=`${n&&e.listItemSelector?` > ${e.listItemSelector}`:""}`;return e.selector?`${e.listContainer}${i} ${e.selector}`:`${e.listContainer}${i||" > *"}`}else if(e.selector)return e.selector;return s?t?"> :first-child":":scope > :first-child":""}function st(e){return"sequenceId"in e&&!("effects"in e)}function Ce(e,t){return e[t]||(e[t]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),e[t]}function _i(e,t,n){const{effects:s=[]}=e;return s.some((i,o)=>n.has(t(o)))?{...e,effects:s.map((i,o)=>{const r=n.get(t(o));return r?{...i,suffix:r}:i})}:e}function ki(e,t=!1){const{effects:n={},sequences:s={},conditions:i={}}=e,o={},r=e.interactions?Mt(e):new Map;return e.interactions?.forEach((a,c)=>{const u=a.key,l=++Oi,{effects:f,sequences:d,...h}=a;if(!u){console.error(`Interaction ${l} is missing a key for source element.`);return}Ce(o,u);const m=f?Array.from(f):[];m.reverse();const p=d?.map((g,E)=>{if(st(g)){const b=s[g.sequenceId];return b?{...b,...g}:(console.warn(`Interact: Sequence "${g.sequenceId}" not found in config`),g)}const w=g;return w.sequenceId||(w.sequenceId=`seq-${c}-${E}`),w}),v={...h,effects:m.length>0?m:void 0,sequences:p?.map((g,E)=>_i(g,w=>pe(c,w,E),r))};o[u].triggers.push(v),o[u].selectors.add(W(v,{useFirstChild:t}));const y=v.listContainer;m.forEach((g,E)=>{const w=g.effectId?n[g.effectId]:void 0;let b=g.key||w?.key;const S=m.length-1-E;g.effectId||(g.effectId=`eff-${c}-${S}`);const T=r.get(pe(c,S));if(T&&(g.suffix=T),b=b||u,g.key=b,y&&g.listContainer&&(b!==u||g.listContainer!==y))return;const C=V({...w,...g,key:b}),_=`${u}::${C}::${l}`;if(g.interactionId=_,o[u].interactionIds.add(_),b===u)return;const I=Ce(o,b);I.effects[_]||(I.effects[_]=[],I.interactionIds.add(_)),I.effects[_].push({...h,effect:g}),I.selectors.add(W(g,{useFirstChild:t}))}),p?.forEach(g=>{if(!g||st(g))return;const E=g,w=E.sequenceId;E.effects.forEach((S,T)=>{S.effectId||(S.effectId=`eff-${w}-${T}`);let C=S.key;if(!C&&S.effectId){const I=n[S.effectId];I&&(C=I.key)}C=C||u;const _=W(S,{useFirstChild:t});if(_&&o[u].selectors.add(_),C!==u){const I=Ce(o,C),k=`${C}::seq::${w}::${l}`;I.sequences[k]||(I.sequences[k]=[],I.interactionIds.add(k)),I.sequences[k].push({...h,sequence:E}),I.selectors.add(_)}})})}),{effects:n,sequences:s,conditions:i,interactions:o}}function $e(e,t,n,s,i){const o=$.getPluginsNames();for(const r of o){const a=`${ot}${r}`;if(!(a in n))continue;const c=n[a];if(c!==null&&typeof c=="object"){if(e._appliedPlugins.has(c))continue;e._appliedPlugins.add(c)}const l=$.getPlugin(r)(c,{root:t,key:s,scope:i,config:n});typeof l=="function"&&e._pluginCleanups.push(l)}}function ye(e,t,n){if(e.listContainer){const s=t.querySelector(e.listContainer);return s?e.selector?Array.from(s.querySelectorAll(e.selector)):Array.from(s.children):(console.warn(`Interact: No container found for list container "${e.listContainer}"`),[])}if(e.selector){const s=t.querySelectorAll(e.selector);if(s.length>0)return Array.from(s);console.warn(`Interact: No elements found for selector "${e.selector}"`)}return n?t.firstElementChild:t}function Ee(e,t){return t.map(n=>e.selector?n.querySelector(e.selector):n).filter(Boolean)}function Nt(e,t,n,s,i,o,r,a){return[r?Ee(e,r):ye(e,n,s),a?Ee(t,a):ye(t,i,o)]}function jt(e,t,n,s,i,o,r,a){const c=Array.isArray(s),u=Array.isArray(i);c?s.forEach((l,f)=>{const d=u?i[f]:i;d&&it(e,l,t.trigger,d,n,t.params,o,r,a)}):(u?i:[i]).forEach(f=>{it(e,s,t.trigger,f,n,t.params,o,r,a)})}function zt(e,t,n,s,i){const o={},r=[];(s.effects||[]).forEach((a,c)=>{const u=a.effectId,l={...n.dataCache.effects[u]||{},...a,effectId:u},f=l.key,d=q(a.interactionId,e);if(o[d]||n.addedInteractions[d]&&!i)return;const h=L(l.conditions||[],n.dataCache.conditions);if(h&&n.setupMediaQueryListener(`${d}::${c}`,h,e,()=>{t.update()}),!h||h.matches){o[d]=!0;const m=f&&q(f,e);let p;if(m){if(p=$.getController(m),!p)return;l.listContainer&&p.watchChildList(l.listContainer)}else p=t;$e(p,p.element,l,m||s.key,"effect");const[v,y]=Nt(s,l,t.element,t.useFirstChild,p.element,p.useFirstChild,i);if(!v||!y)return;n.addedInteractions[d]=!0;const g=m||s.key,E=x(l.conditions||[],n.dataCache.conditions);r.push([g,s,l,v,y,E,p.useFirstChild,e])}}),r.reverse().forEach(a=>{jt(...a)}),Mi(e,t,n,s,i)}function Ai(e){return"sequenceId"in e&&!("effects"in e)}function Ht(e,t,n,s,i,o,r){const a=L(e.conditions||[],i.dataCache.conditions);if(a&&i.setupMediaQueryListener(t,a,o.updateKey,o.onUpdate),a&&!a.matches)return null;const c=e.effects||[],u=[];let l=!1;for(const f of c){const d=f.effectId,m={...d?i.dataCache.effects[d]||{}:{},...f},p=L(m.conditions||[],i.dataCache.conditions);if(p){const S=`${t}::${d||"eff"}`;i.setupMediaQueryListener(S,p,o.updateKey,o.onUpdate)}if(p&&!p.matches)continue;const v=m.key,y=v&&q(v,n);let g;if(y){if(g=$.getController(y),!g)return null}else g=s;const E=y||n;$e(g,g.element,m,E,"effect");let w;if(r&&E===r.controllerKey&&m.listContainer===r.listContainer?(w=Ee(m,r.elements),w.length>0&&(l=!0)):w=ye(m,g.element,g.useFirstChild),!w||Array.isArray(w)&&w.length===0)return null;const b=F(m);u.push({target:w,options:b})}return r&&!l?null:u.length>0?u:null}function Re(e,t,n){const s=n?Ee(e,n):ye(e,t.element,t.useFirstChild);return Array.isArray(s)&&s.length===0?null:s}function Ne(e,t,n,s,i){(Array.isArray(n)?n:[n]).forEach(r=>{G[e.trigger]?.add(r,r,{triggerType:t.triggerType},e.params||{},{reducedMotion:$.forceReducedMotion,selectorCondition:i,animation:s,allowA11yTriggers:$.allowA11yTriggers})})}function Dt(e,t,n){const o=(e.useFirstChild?e.element.firstElementChild:e.element)?.querySelector(t);if(!o)return n.map((a,c)=>c);const r=Array.from(o.children);return n.map(a=>{const c=r.indexOf(a);return c>=0?c:r.length})}function Mi(e,t,n,s,i){s.sequences?.forEach(o=>{let r;if(Ai(o)){const m=n.dataCache.sequences[o.sequenceId];if(!m){console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);return}r={...m,...o}}else r=o;const a=r.sequenceId||J(),c=q(`${e}::seq::${a}`,e);if(n.addedInteractions[c]&&!i)return;const u=i&&s.listContainer?{controllerKey:e,listContainer:s.listContainer,elements:i}:void 0,l=Ht(r,c,e,t,n,{updateKey:e,onUpdate:()=>t.update()},u);if(!l)return;if(i&&n.addedInteractions[c]){const m=Dt(t,s.listContainer,i);$.addToSequence(c,l,m,{reducedMotion:$.forceReducedMotion});const p=$.getSequence(c,r,l,{reducedMotion:$.forceReducedMotion}),v=x(s.conditions||[],n.dataCache.conditions),y=Re(s,t,i);y&&Ne(s,r,y,p,v);return}const f=$.getSequence(c,r,l,{reducedMotion:$.forceReducedMotion}),d=x(s.conditions||[],n.dataCache.conditions),h=Re(s,t,i);h&&(n.addedInteractions[c]=!0,Ne(s,r,h,f,d))})}function qi(e,t,n,s,i){const o=n.get(e)?.sequences||{};Object.keys(o).forEach(a=>{o[a].some(({sequence:u,...l})=>{const f=L(l.conditions||[],n.dataCache.conditions);if(f&&!f.matches)return!1;const d=l.key&&q(l.key,e),h=$.getController(d);if(!h)return!0;const m=u.sequenceId||J(),p=q(`${d}::seq::${m}`,d);if(n.addedInteractions[p]&&!i)return!0;const y=Ht(u,p,d,h,n,{updateKey:e,onUpdate:()=>t.update()},i&&s?{controllerKey:e,listContainer:s,elements:i}:void 0);if(!y)return!0;if(i&&n.addedInteractions[p]){const b=Dt(t,s,i);return $.addToSequence(p,y,b,{reducedMotion:$.forceReducedMotion}),!0}const g=$.getSequence(p,u,y,{reducedMotion:$.forceReducedMotion}),E=x(l.conditions||[],n.dataCache.conditions),w=Re(l,h);return w&&(n.addedInteractions[p]=!0,Ne(l,u,w,g,E)),!0})})}function Gt(e,t,n,s,i){const o=n.get(e),r=o?.effects||{},a=Object.keys(r),c=[];a.forEach(l=>{const f=q(l,e);if(n.addedInteractions[f]&&!i)return;r[l].some(({effect:h,...m},p)=>{const v=L(m.conditions||[],n.dataCache.conditions);if(v&&!v.matches)return!1;const y=h.effectId,g={...n.dataCache.effects[y]||{},...h,effectId:y};if(s&&g.listContainer!==s)return!1;const E=L(g.conditions||[],n.dataCache.conditions);if(E&&n.setupMediaQueryListener(`${f}::${p}`,E,e,()=>{t.update()}),!E||E.matches){const w=m.key&&q(m.key,e),b=$.getController(w);if(!b)return!0;$e(t,t.element,g,e,"effect"),g.listContainer&&t.watchChildList(g.listContainer);const[S,T]=Nt(m,g,b.element,b.useFirstChild,t.element,t.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[f]=!0;const C=x(g.conditions||[],n.dataCache.conditions);return c.push([e,m,g,S,T,C,t.useFirstChild,w||void 0]),!0}return!1})}),c.reverse().forEach(l=>{jt(...l)}),qi(e,t,n,s,i);const u=Object.keys(o?.sequences||{}).length>0;return a.length>0||u}function it(e,t,n,s,i,o,r,a,c){let u;if(i.transition||i.transitionProperties){const f={key:e,effectId:i.effectId,transition:i.transition,transitionProperties:i.transitionProperties,childSelector:W(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:a}),selectorCondition:r};if(u=$.getController(e),!u)return;u.renderStyle(Bn(f))}let l;if(n==="animationEnd"){const f=o.effectId,h=(c?$.getInstance(c):void 0)?.dataCache.effects[f];h&&(l=F(h))}G[n]?.add(t,s,i,o,{reducedMotion:$.forceReducedMotion,targetController:u,selectorCondition:r,allowA11yTriggers:$.allowA11yTriggers,sourceAnimationOptions:l})}function Pi(e){const t=e.key,n=$.getInstance(t);if(!n)return console.warn(`No instance found for key: ${t}`),$.setController(t,e),!1;const{triggers:s=[]}=n?.get(t)||{},i=s.length>0;n.setController(t,e),s.forEach((r,a)=>{const c=L(r.conditions,n.dataCache.conditions);if(c){const u=`${t}::trigger::${a}`;n.setupMediaQueryListener(u,c,t,()=>{e.update()})}(!c||c.matches)&&($e(e,e.element,r,t,"interaction"),r.listContainer&&e.watchChildList(r.listContainer),zt(t,e,n,r))});let o=!1;return n&&(o=Gt(t,e,n)),i||o}function Li(e,t,n){const s=e.key,i=$.getInstance(s);if(i){const{triggers:o=[]}=i?.get(s)||{};o.forEach((r,a)=>{if(r.listContainer!==t)return;const c=L(r.conditions,i.dataCache.conditions);if(c){const u=`${s}::listTrigger::${t}::${a}`;i.setupMediaQueryListener(u,c,s,()=>{e.update()})}(!c||c.matches)&&zt(s,e,i,r,n)}),Gt(s,e,i,t,n)}}function xi(e,t=!1){const n=e.key,s=$.getInstance(n);if(!s)return;const i=[...s.get(n)?.selectors.values()||[]].filter(Boolean).join(",");let o;i?(o=[...e.element.querySelectorAll(i)],e.useFirstChild||o.push(e.element)):o=[e.element],Wt(o),s.deleteController(n,t)}function Wt(e){const t=Object.values(G);for(const n of e)for(const s of t)s.remove(n);$.removeFromSequences(e)}const Oe="interactEffect";class Vt{element;key;connected;sheet;useFirstChild;_observers;_pluginCleanups;_appliedPlugins;constructor(t,n,s){this.element=t,this.key=n,this.connected=!1,this.sheet=null,this._observers=new WeakMap,this._pluginCleanups=[],this._appliedPlugins=new WeakSet,this.useFirstChild=s?.useFirstChild??!1}connect(t){if(this.connected)return;const n=this.element.dataset.interactKey;if(t=t||this.key||n,!t){console.warn("Interact: No key provided");return}n!==t&&(n&&console.warn(`Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`),this.element.dataset.interactKey=t),this.key=t,this.connected=Pi(this)}disconnect({removeFromCache:t=!1}={}){if((this.key||this.element.dataset.interactKey)&&xi(this,t),this._pluginCleanups.length){for(const s of this._pluginCleanups)try{s()}catch(i){console.error(i)}this._pluginCleanups.length=0}if(this._appliedPlugins=new WeakSet,this.sheet){const s=this.element?.getRootNode(),i=s.host?s:document;i.adoptedStyleSheets.indexOf(this.sheet)!==-1&&(i.adoptedStyleSheets=i.adoptedStyleSheets.filter(r=>r!==this.sheet))}this._observers=new WeakMap,this.sheet=null,this.connected=!1}update(){this.disconnect(),this.connect()}renderStyle(t){const n=this.element?.getRootNode(),s=n.host?n:document;if(!this.sheet)this.sheet=new CSSStyleSheet,this.sheet.replaceSync(t.join(`
25
+ `)),s.adoptedStyleSheets=[...s.adoptedStyleSheets||[],this.sheet];else{let i=this.sheet.cssRules.length;for(const o of t)try{this.sheet.insertRule(o,i),i++}catch(r){console.error(r)}}}toggleEffect(t,n,s,i){if(s===null)return;if(!i&&this.element.toggleEffect){this.element.toggleEffect(t,n,s);return}const o=new Set(this.element.dataset[Oe]?.split(" ")||[]);n==="toggle"?o.has(t)?o.delete(t):o.add(t):n==="add"?o.add(t):n==="remove"?o.delete(t):n==="clear"&&o.clear(),(s||this.element).dataset[Oe]=Array.from(o).join(" ")}getActiveEffects(){const n=(this.element.dataset[Oe]||"").trim();return n?n.split(/\s+/):[]}watchChildList(t){const n=this.element.querySelector(t);if(n){let s=this._observers.get(n);s||(s=new MutationObserver(this._childListChangeHandler.bind(this,t)),this._observers.set(n,s),s.observe(n,{childList:!0}))}}_childListChangeHandler(t,n){const s=this.key||this.element.dataset.interactKey,i=[],o=[];n.forEach(r=>{r.removedNodes.forEach(a=>{a instanceof HTMLElement&&i.push(a)}),r.addedNodes.forEach(a=>{a instanceof HTMLElement&&o.push(a)})}),Wt(i),s&&Li(this,t,o)}}function Fi(e,t){new Vt(e,t).connect()}function Ri(e){const t=$.getController(e);t&&t.disconnect({removeFromCache:!0})}exports.I=Vt;exports.a=$;exports.b=Fi;exports.g=vs;exports.r=Ri;
26
+ //# sourceMappingURL=index-DzjSnJ2D.js.map