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