@wix/interact 2.5.23 → 2.5.25

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