@wix/interact 2.8.2 → 2.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,6 @@ ${a.map(({name:u,value:c})=>` ${u}: ${c};`).join(`
24
24
  ${se("timeline-scope",t)}: ${e.join(", ")};
25
25
  timeline-scope: ${n};
26
26
  }`}const le={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function As(e,t){const n=e?.name??le.rangeStart.name,s=t?.name??e?.name??le.rangeEnd.name,i={name:n,offset:e?.offset||le.rangeStart.offset},o={name:s,offset:t?.offset||le.rangeEnd.offset};return{startOffset:i,endOffset:o}}function N(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}=As(t,n);return{id:"",startOffset:i,endOffset:o,...s}}function q(e,t,n){let s=e.get(t);s||(s=new Set,e.set(t,s)),s.add(n)}function ae(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 lt=[{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}],De={animation:!1,transition:!1,timeline:!1};function Vt(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 Bt(e,t,n){return Object.fromEntries(Oe.map(s=>{const i=L(s),{listIndex:o,slotCursor:r,slotsInSequence:a}=e[i];return[s,t[i]?j(s,r+a,!0,n):j(s,o,!1,n)]}))}function je(e,t,n){Ce.forEach(s=>{t[s]&&(e[s].touched=!0,n[s]&&(e[s].slotsInSequence+=1))})}function qs(e){const{namedEffect:t,keyframeEffect:n,transition:s,transitionProperties:i}=e;return t||n?"animation":s||i?"transition":null}function Yt(e){return(e.variants||[e]).map(qs).find(Boolean)||null}function Rs(e){const t=new Map;return e.effects.forEach(n=>{const s=Yt(n);if(!s)return;const i=B(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 Ls(e){Ce.forEach(t=>{const n=e[t];n.slotsInInteraction=Math.max(n.slotsInInteraction,n.slotsInSequence),n.slotsInSequence=0})}function Fs(e){Ce.forEach(t=>{const n=e[t];n.listIndex+=n.touched?1:0,n.slotCursor+=n.slotsInInteraction,n.slotsInInteraction=0,n.touched=!1})}const xs={animation:"animation","animation-composition":"composition","animation-timeline":"animationTimeline","animation-range":"animationRange"};function Ns(e,t,n,s){const{key:i,conditions:o}=t,r=re(o,e.configConditions,"media"),a=x(o,e.configConditions),l=V(t,{asCombinator:!0,useFirstChild:e.useFirstChild,addItemFilter:!0}),u=B(t),c=e.targetsMap.get(u)||Vt(i,l),f=Bt(c,De,e.configIndex)["view-timeline"];return je(c,{animation:!1,transition:!1,timeline:!0},De),e.targetsMap.set(u,c),s.add(u),{key:i,media:r,selectorCondition:a,childSelector:l,declarations:[{name:f,value:`--${n}`}]}}function Ut(e,t,n,s,i){const o=[];for(const r of Object.keys(i)){const a=`${Ke}${r}`;a in t&&o.push(...i[r](t[a],{key:n,scope:e,config:t}).map(l=>({...l,key:n,media:s})))}return o}function Ds(e,t,n,s,i,o){const{assigned:r,childSelector:a,partSelectors:l}=n,u={animation:!1,transition:!1,timeline:!1},{key:c,effectId:f,conditions:d,namedEffect:m,keyframeEffect:p,transition:h,transitionProperties:g,initial:v}=t,y=re(d,e.configConditions,"media"),$=x(d,e.configConditions),E=[{key:c,media:y,selectorCondition:$,childSelector:a,declarations:[]}];let b=[];const{declarations:S}=E[0];e.plugins&&E.push(...Ut("effect",t,c,y,e.plugins));const T=v&&t.duration===0;if((m||p)&&!T){const I=N(t),P=rs(null,I,s,o).filter(O=>O.name),k=P.length?{}:{"":[]};P.forEach(O=>{const C=O.part||"";(k[C]||=[]).push(O)}),b=P.map(O=>({name:O.name,keyframes:O.keyframes})),S.push(...P.flatMap(({custom:O})=>Object.entries(O||{}).filter(([C,M])=>M!==void 0).map(([C,M])=>({name:C,value:M})))),Object.entries(k).forEach(([O,C])=>{const M=Ne.map(R=>({_listPropertyName:R,name:i[R],value:C.map(Pe=>{const ke=xs[R];return Pe[ke]||K[R]}).join(", ")})).filter(({_listPropertyName:R,name:Pe,value:ke})=>ke!==K[R]||r.has(Pe));M.forEach(({name:R})=>r.add(R)),u.animation=u.animation||M.length>0;const ce=O?`[data-motion-part~="${O}"]`:a;O&&M.length&&l.add(ce),v?(E.push({key:c,media:y,selectorCondition:$,childSelector:ce,declarations:lt,selectorSuffix:":not([data-interact-enter])"}),E.push({key:c,media:y,selectorCondition:$,childSelector:ce,declarations:M,selectorSuffix:':not([data-interact-enter="done"])'})):O?E.push({key:c,media:y,selectorCondition:$,childSelector:ce,declarations:M}):S.push(...M)})}else if(h||g){const I=xt(t),P=Nt(t);(P.length||r.has(i.transition))&&(S.push({name:i.transition,value:P.join(", ")||K.transition}),r.add(i.transition),u.transition=!0),E.push({key:c,media:y,selectorCondition:$,childSelector:a,states:[f],declarations:I})}else T&&E.push({key:c,media:y,selectorCondition:$,childSelector:a,declarations:lt,selectorSuffix:":not([data-interact-enter])"}),S.push(...Ne.filter(I=>r.has(i[I])).map(I=>({name:i[I],value:K[I]})));return{rules:E.filter(I=>I.declarations.length),keyframes:b,wrote:u}}function js(e,t,n,s){const i=t.namedEffect&&Qe(t.namedEffect.type,!1);if(!i?.getNames)return;const o=a=>i.getNames({...t,suffix:a});if(o("-1").join()===o().join())return;const r=e.keyframeEntries.get(n)||[];e.keyframeEntries.set(n,[...r,{slotKey:s,getNames:o}])}function zs(e,t,n){const s=e.forceReducedMotion||Es(t);return n&&s&&n.reducedMotionPolicy!=="ignore"?{...n,offset:0}:n}function Kt(e,t,n,s,i,o){const r=B(t),a=e.targetsMap.get(r)||Vt(t.key,V(t,{asCombinator:!0,useFirstChild:e.useFirstChild,addItemFilter:!0}));s.add(r);const l=o?.get(r)||De,u=Bt(a,l,e.configIndex),c=t.variants||[t],f=Yt(t);if(e.collectSlots)return c.forEach(h=>js(a,h,u.animation,t.slotKey)),je(a,{animation:f==="animation",transition:f==="transition",timeline:!1},l),e.targetsMap.set(r,a),[];const d=a.assigned,m=c.map(h=>(h.namedEffect&&(h.suffix=e.keyframeSlots.get(t.slotKey)),a.assigned=new Set(d),{...Ds(e,h,a,n,u,zs(e,h,i)),assigned:a.assigned}));a.assigned=new Set(m.flatMap(h=>[...h.assigned])),m.forEach(({keyframes:h})=>h.forEach(({name:g,keyframes:v})=>e.keyframesMap.set(g,v)));const p=Object.fromEntries(Ce.map(h=>[h,m.some(g=>g.wrote[h])]));return je(a,p,l),e.targetsMap.set(r,a),m.flatMap(({rules:h})=>h)}function Hs(e,t,n,s){const i=[],o=new Set,r=Rs(t);i.push(...t.effects.flatMap(l=>Kt(e,l,n,o,t,r)));const{conditions:a}=t;return o.forEach(l=>{s.add(l);const u=e.targetsMap.get(l),c=_s(u,a,e.configConditions,e.configIndex);c&&(c.declarations.forEach(({name:f})=>u.assigned.add(f)),i.push(c)),Ls(u)}),i}function Gs(e,t,n){const{key:s,conditions:i,effects:o=[],sequences:r=[]}=t,a=e.plugins?Ut("interaction",t,s,re(i,e.configConditions,"media"),e.plugins):[],{trigger:l}=t,u={trigger:hs(l),id:J("trigger",[n],e.configIndex)},c=new Set;l==="viewProgress"&&a.push(Ns(e,t,u.id,c));const f=o.map((m,p)=>{const h=Gt(m,t,e.config,J("eff",[n,p],e.configIndex),{force:e.forceReducedMotion,defaultPolicy:e.reducedMotionPolicy});return h&&Object.assign(h,{slotKey:Ee(n,p)})}).filter(m=>m!==null);a.push(...f.flatMap(m=>Kt(e,m,u,c)));const d=r.map((m,p)=>$s(m,t,e.config,J("seq",[n,p],e.configIndex),h=>Ee(n,h,p),{force:e.forceReducedMotion,defaultPolicy:e.reducedMotionPolicy})).filter(m=>m!==null);return a.push(...d.flatMap(m=>Hs(e,m,u,c))),l==="viewProgress"&&c.size>1&&e.scopedTimelines.push(`--${u.id}`),c.forEach(m=>Fs(e.targetsMap.get(m))),a}function Ws(e={}){return typeof e=="boolean"?{useFirstChild:e}:e}function Xt(e,t){const{useFirstChild:n=!0,plugins:s,configIndex:i,collectSlots:o=!1,forceReducedMotion:r=w.forceReducedMotion,reducedMotionPolicy:a=w.reducedMotionPolicy}=t,l={config:e,configConditions:jt(e.conditions),targetsMap:new Map,keyframesMap:new Map,keyframeSlots:o?new Map:Qt(e,{configIndex:i,forceReducedMotion:r,reducedMotionPolicy:a}),scopedTimelines:[],collectSlots:o,useFirstChild:n,forceReducedMotion:r,reducedMotionPolicy:a,plugins:s,configIndex:i},u=e.interactions.flatMap((c,f)=>Gs(l,c,f));return{ctx:l,cssRules:u}}function J(e,t,n){return[e,...n===void 0?[]:[`c${n}`],...t].join("-")}function Ee(e,t,n){return[e,n,t].filter(s=>s!==void 0).join(":")}function Qt(e,t={}){const{ctx:n}=Xt(e,{...t,collectSlots:!0}),s=new Map,i=o=>o?`-${o}`:void 0;return n.targetsMap.forEach(({keyframeEntries:o})=>{const r=new Set;o.forEach(a=>{const l=f=>a.flatMap(({getNames:d})=>d(i(f)));let u=0,c=l(u);for(;c.some(f=>r.has(f));)c=l(++u);c.forEach(f=>r.add(f)),u&&a.forEach(({slotKey:f})=>s.set(f,i(u)))})}),s}function Vs(e,t){const{ctx:n,cssRules:s}=Xt(e,Ws(t)),i=[...n.targetsMap.values()],o=Math.max(0,...i.map(({animation:m})=>m.listIndex)),r=Math.max(0,...i.map(({transition:m})=>m.listIndex)),a=Math.max(0,...i.map(({timeline:m})=>m.listIndex)),l=Ps(i.flatMap(m=>[m,...[...m.partSelectors].map(p=>({key:m.key,childSelector:p}))]),o,r,a,n.configIndex),u=Math.max(0,...i.map(({animation:m})=>m.slotCursor)),c=Math.max(0,...i.map(({transition:m})=>m.slotCursor)),f=Ms(o,r,u,c,a,n.configIndex),d=ks(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}=Vs(e,t);return[...i,...[...s.entries()].map(([l,u])=>Ts(l,u)),...n.map(Os),o,r].filter(l=>l).join(`
27
- `)}const Ys={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},Us={root:null,rootMargin:"0px",threshold:[0]},Ks=.2;function Xs(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 ee={},D=new WeakMap,we=new WeakSet,X=new WeakMap;let Zt={},Q=null;function Qs(e){Zt=e}function Jt(e,t,n){D.get(e)?.forEach(({source:i,handler:o})=>{i===e&&o(t,n)})}function ut(){return Q||(Q=new IntersectionObserver(e=>{e.forEach(t=>{const n=t.target;t.isIntersecting||Jt(n,!1,!0)})},Us),Q)}function en(e,t=!1){const n=JSON.stringify({...e,isSafeMode:t});if(ee[n])return ee[n];const s=e.threshold??Ks,i=t?Ys:{root:null,rootMargin:e.inset?Xs(e.inset):"0px",threshold:s},o=new IntersectionObserver(r=>{r.forEach(a=>{const l=a.target,u=!we.has(l);if(u&&(we.add(l),e.useSafeViewEnter&&!a.isIntersecting)){_.measure(()=>{const c=a.boundingClientRect.height,f=a.rootBounds?.height;if(!f)return;const d=Array.isArray(e.threshold)?Math.min(...e.threshold):e.threshold;d&&c*d>f&&_.mutate(()=>{o.unobserve(l);const p=en(e,!0);X.set(l,p),p.observe(l)})});return}(a.isIntersecting||!u)&&Jt(l,a.isIntersecting)})},i);return ee[n]=o,o}function Zs(e,t,n,s={},{selectorCondition:i,animation:o}={}){const r={...Zt,...s},a=n.triggerType||"once",l=o||oe(t,N(n));if(!l)return;const u=en(r);a!=="once"&&l.persist?.();let c=!0,f=!1,d;d={source:e,target:t,handler:(h,g)=>{if(!(i&&!t.matches(i)))if(a==="once"){if(h&&!f){f=!0;const v=D.get(e);(!v||v.size===0||v.size===1&&v.has(d))&&((X.get(e)||u).unobserve(e),we.delete(e)),l.onFinish(()=>{D.get(e)?.delete(d),D.get(t)?.delete(d)}),l.play(()=>{const y=()=>{t.dataset.interactEnter="start"},$=()=>{_.mutate(()=>{t.dataset.interactEnter="done"})};l.isCSS?(_.mutate(()=>{requestAnimationFrame(y)}),l.onFinish($),l.onAbort($)):(_.mutate(y),l.onFinish($))})}}else a==="alternate"?c&&h?(c=!1,l.play()):c||l.reverse():a==="repeat"?h?(l.progress(0),l.play()):g&&(l.pause(),l.progress(0)):a==="state"&&(h?l.play():g&&l.pause())},cleanup:()=>{(X.get(e)||u).unobserve(e),(a==="repeat"||a==="state")&&ut().unobserve(e),l.cancel(),we.delete(e),X.delete(e)}},q(D,e,d),q(D,t,d),X.set(e,u),u.observe(e),(a==="repeat"||a==="state")&&ut().observe(e)}function Js(e){ae(D,e)}function ei(){Q=null,Object.keys(ee).forEach(e=>delete ee[e])}const ti={add:Zs,remove:Js,setOptions:Qs,reset:ei};function tn(e,t){return Object.assign(Object.create(t),e)}function ni(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 si(e){let t=!1;return function(){t||(t=!0,window.requestAnimationFrame(()=>{t=!1,e()}))}}function ft(e,t){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,e()},t)}}function ii(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 $e(n[1],t)+$e(n[6],t)}function $e(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)?ii(e,t):parseInt(e)||0:0}function H(e,t,n){const{name:s,offset:i=0}=e,{start:o,end:r}=n,a=r-o,l=i/100;let u,c;return s==="entry"?(u=o-t,c=Math.min(t,a)):s==="entry-crossing"?(u=o-t,c=a):s==="contain"?(u=Math.min(r-t,o),c=Math.abs(t-a)):s==="exit"?(u=Math.max(o,r-t),c=Math.min(t,a)):s==="exit-crossing"?(u=o,c=a):s==="cover"&&(u=o-t,c=a+t),u+l*c|0}function qe(e,t,n,s,i){let o=0;const r={start:t,end:n};return e.forEach((a,l)=>{o+=a.offset;const u=a.sticky;if(u){if("end"in u&&e[l-1]?.element){const d=((i?a.element.offsetWidth:a.element.offsetHeight)||0)+u.end-s,m=o+d-a.offset,p=m<r.start,h=!p&&m<=n;let g=0;(p||h)&&(g=a.offset,r.end+=g),p&&(r.start+=g)}if("start"in u){const c=o-u.start,f=c<r.start,d=!f&&c<=r.end;let m=0;const p=e[l-1]?.element;if(p){if(f||d){const h=(i?p.offsetWidth:p.offsetHeight)||0,g=a.offset,v=(i?a.element.offsetWidth:a.element.offsetHeight)||0;m=h-(g+v),o+=m,r.end+=m}f&&(r.start+=m)}}}}),r}function oi(e,t,n,s,i,o){const{start:r,end:a,duration:l}=e;let u=r,c=a,f=e.startRange,d=e.endRange,m;if(typeof l=="string"){f={name:l,offset:0},d={name:l,offset:100},u=H(f,n,t),c=H(d,n,t),m=c-u;const p=qe(o,u,c,n,s);u=p.start,c=p.end}else{if(f||r?.name){f=f||r;const p=$e(f.add,i),h=H({...f,offset:0},n,t),g=H({...f,offset:100},n,t),v=qe(o,h,g,n,s);u=v.start+f.offset/100*(v.end-v.start)+p}if(d||a?.name){d=d||a;const p=$e(d.add,i),h=H({...d,offset:0},n,t),g=H({...d,offset:100},n,t),v=qe(o,h,g,n,s);c=v.start+d.offset/100*(v.end-v.start)+p}else typeof l=="number"&&(c=u+l)}return!m&&!l&&(m=c-u),{...e,start:u,end:c,startRange:f,endRange:d,duration:m||l}}function ri(e){return e.position==="sticky"}function ai(e,t,n){return e.position==="fixed"&&(!t||t===window.document.body||t===n)}function ci(e,t){return parseInt(t?e.left:e.top)}function li(e,t){return parseInt(t?e.right:e.bottom)}function ui(e,t,n){n&&(e.style.position="static");const s=(t?e.offsetLeft:e.offsetTop)||0;return n&&(e.style.position=null),s}function fi(e,t){let n;const s=ci(e,t),i=li(e,t),o=!isNaN(s),r=!isNaN(i);return(o||r)&&(n={},o&&(n.start=s),r&&(n.end=i)),n}function ue(e,t,n,s,i){const o=e[0].viewSource,r=[];let a=(s?o.offsetWidth:o.offsetHeight)||0,l=0,u=o;for(;u;){const f=window.getComputedStyle(u),d=ri(f),m=d?fi(f,s):void 0,p=ui(u,s,d);if((!m||!("end"in m))&&(l+=p),r.push({element:u,offset:p,sticky:m}),u=u.offsetParent,ai(f,u,t))break;if(u===t){r.push({element:u,offset:0});break}}return r.reverse(),e.map(f=>({...oi(f,{start:l,end:l+a},n,s,i,r)}))}const dt=100,di={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function hi(e,t,n,s){let i=0;return e>=t&&e<=n?i=s?(e-t)/s:1:e>n&&(i=1),i}function ht(e,t){return e===window?t?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:t?e.clientWidth:e.clientHeight}function mi(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function pi(e){const t=tn(e,di),n=t.root,s=t.horizontal,i=new WeakMap;let o=ht(n,s),r,a,l,u,c;const f=[],d=mi();if(t.scenes=Object.values(e.scenes.reduce((h,g,v)=>{const y=g.groupId?`group-${g.groupId}`:String(v);return h[y]?h[y].push(g):h[y]=[g],h},{})).flatMap(h=>(h.every(g=>g.viewSource&&(typeof g.duration=="string"||g.start?.name))?(h=ue(h,n,o,s,d),(t.observeSourcesResize||t.observeContentResize)&&f.push(h)):h.forEach(g=>{g.end==null&&(g.end=g.start+g.duration),g.duration==null&&(g.duration=g.end-g.start)}),h)),t.scenes.forEach((h,g)=>{h.index=g}),f.length){const h=new Map;window.ResizeObserver&&(l=new window.ResizeObserver(function(g){g.forEach(v=>{const y=h.get(v.target),$=ue(y,n,o,s,d);$.forEach((E,b)=>{t.scenes[E.index]=$[b]}),f.splice(f.indexOf(y),1,$)})}),f.forEach(g=>{l.observe(g[0].viewSource,{box:"border-box"}),h.set(g[0].viewSource,g)}),t.observeContentResize&&t.contentRoot&&new window.ResizeObserver(ft(()=>{const v=f.map(y=>{const $=ue(y,n,o,s,d);return $.forEach((E,b)=>{t.scenes[E.index]=$[b]}),$});f.length=0,f.push(...v),f.forEach(y=>{h.set(y[0].viewSource,y)})},dt)).observe(t.contentRoot,{box:"border-box"})),t.observeViewportResize&&(u=ft(function(){o=ht(n,s);const g=f.map(v=>{const y=ue(v,n,o,s,d);return y.forEach(($,E)=>{t.scenes[$.index]=y[E]}),y});f.length=0,f.push(...g),f.forEach(v=>{h.set(v[0].viewSource,v)})},dt),n===window?window.addEventListener("resize",u):window.ResizeObserver&&(c=new window.ResizeObserver(u),c.observe(n,{box:"border-box"})))}t.observeViewportEntry&&window.IntersectionObserver&&(a=new window.IntersectionObserver(function(h){h.forEach(g=>{(i.get(g.target)||[]).forEach(v=>{v.disabled=!g.isIntersecting})})},{root:n===window?window.document:n,rootMargin:t.viewportRootMargin,threshold:0}),t.scenes.forEach(h=>{if(h.viewSource){let g=i.get(h.viewSource);g||(g=[],i.set(h.viewSource,g),a.observe(h.viewSource)),g.push(h)}}));function m({p:h,vp:g}){h=+h.toFixed(1);const v=+g.toFixed(4);if(h!==r){for(let y of t.scenes)if(!y.disabled){const{start:$,end:E,duration:b}=y,S=hi(h,$,E,b);y.effect(y,S,v)}r=h}}function p(){t.scenes.forEach(h=>h.destroy?.()),a&&(a.disconnect(),a=null),l&&(l.disconnect(),l=null),u&&(c?(c.disconnect(),c=null):window.removeEventListener("resize",u))}return{tick:m,destroy:p}}const gi={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class vi{constructor(t={}){this.config=tn(t,gi),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=si(()=>{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=ni(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=pi(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const ze=new WeakMap;let nn=()=>({});function yi(e){nn=e}function Ei(e,t,n,s,{selectorCondition:i}){if(i&&!t.matches(i))return;const o={trigger:"view-progress",element:e},r=N(n);let a;if("ViewTimeline"in window){const u=oe(t,r,o);u&&!u.isCSS&&(u.play(),a=()=>{u.ready.then(()=>{u.cancel()})})}else{const u=Rt(t,r,o);if(u){const c=Array.isArray(u)?u:[u],f=new vi({viewSource:e,scenes:c,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...nn()});a=()=>{f.destroy()},Promise.all(c.map(d=>d.ready||Promise.resolve())).then(()=>{f.start()})}}if(!a)return;const l={source:e,target:t,cleanup:a};q(ze,e,l),q(ze,t,l)}function wi(e){ae(ze,e)}const $i={add:Ei,remove:wi,registerOptionsGetter:yi};function mt(e,t,n){return Math.min(Math.max(e,n),t)}function pt(e){let t=!1;return function(){if(!t)return t=!0,window.requestAnimationFrame(()=>{t=!1,e()})}}function Si(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 bi(){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 Ii(){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 Ti(e){Ii().then(t=>{e.fixRequired=t,t&&(window.addEventListener("scroll",e.scrollHandler),e.scrollHandler())})}let fe=0;const ve=new Set;function Oi(){const e=n=>{for(let s of n.changedTouches)ve.add(s.identifier)},t=n=>{for(let s of n.changedTouches)ve.delete(s.identifier)};return document.addEventListener("touchstart",e,{passive:!0}),document.addEventListener("touchend",t,{passive:!0}),function(){ve.clear(),document.removeEventListener("touchstart",e),document.removeEventListener("touchend",t)}}function Ci(e,t){if("onscrollend"in window)return e.addEventListener("scrollend",t),function(){e.removeEventListener("scrollend",t)};let n=0,s;fe||(s=Oi()),fe+=1;function i(o){clearTimeout(n),n=setTimeout(()=>{ve.size?setTimeout(i,100):(t(o),n=0)},100)}return e.addEventListener("scroll",i),function(){e.removeEventListener("scroll",i),fe-=1,fe||s()}}function Mi(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 _i(e,t){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>e&&e(t))}function Pi(e){e.rect.width=window.document.documentElement.clientWidth,e.rect.height=window.document.documentElement.clientHeight}function ki(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 Ai(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 l={x:0,y:0};e.scenes.forEach(c=>{c.target&&c.centeredToTarget&&(c.transform=Mi(Si(c.target),e.rect,l),t=!0),e.root?i=ki(e):(o=Pi.bind(null,e),window.addEventListener("resize",o))}),s=function(c){for(let f of e.scenes)if(!f.disabled){const d=f.transform?.x(c.x)||c.x/e.rect.width,m=f.transform?.y(c.y)||c.y/e.rect.height,p=+mt(0,1,d).toPrecision(4),h=+mt(0,1,m).toPrecision(4),g={x:c.vx,y:c.vy};e.allowActiveEvent&&(c.active=d<=1&&m<=1&&d>=0&&m>=0),f.effect(f,{x:p,y:h},g,c.active)}Object.assign(n,c)},t&&(r=_i.bind(l,s,n),a=Ci(document,r));function u(){e.scenes.forEach(c=>c.destroy?.()),a?.(),i?(i.disconnect(),i=null):(window.removeEventListener("resize",o),o=null),s=null,n=null}return{tick:s,destroy:u}}const qi=1e3/60*3;let de;function Ri(){G.x=window.scrollX,G.y=window.scrollY}const G={x:0,y:0,scrollHandler:Ri,fixRequired:void 0};class Li{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():pt(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):pt(()=>{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){de=typeof de=="boolean"?de:bi();const i=de?window.devicePixelRatio:1;typeof G.fixRequired>"u"&&Ti(G),this._measure=o=>{if(o.target!==this.config.root){const r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:o.x*i+G.x,clientY:o.y*i+G.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,l=n(Math.min(1,a));i&&(this.progress.vx=0,this.progress.vy=0,i=!1),this.currentProgress=Object.entries(this.progress).reduce((u,[c,f])=>(c==="active"?u[c]=f:u[c]=this.previousProgress[c]+(f-this.previousProgress[c])*l,u),this.currentProgress||{}),a<1&&(this._nextTransitionTick=requestAnimationFrame(o),i=r-this._startTime>qi),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=Ai(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const He=new WeakMap;let sn=()=>({});function Fi(e){sn=e}function xi(e){return!("keyframeEffect"in e||"customEffect"in e)||!e.transitionDuration?{}:{transitionDuration:e.transitionDuration,transitionEasing:Xe(e.transitionEasing)}}function Ni(e,t,n,s={},{selectorCondition:i}){if(i&&!t.matches(i))return;const o={trigger:"pointer-move",element:e,axis:s.axis??"y"},r=Rt(t,N(n),o);if(r){const a=Array.isArray(r)?r:[r],l=new Li({root:s.hitArea==="self"?e:void 0,scenes:a,...sn(),...xi(n)}),c={source:e,target:t,cleanup:()=>{l.destroy()}};q(He,e,c),q(He,t,c),Promise.all(a.map(f=>f.ready||Promise.resolve())).then(()=>{l.start()})}}function Di(e){ae(He,e)}const ji={add:Ni,remove:Di,registerOptionsGetter:Fi},Ge=new WeakMap;function zi(e,t,n,s,{selectorCondition:i,animation:o,sourceAnimationOptions:r}){const a=o||oe(t,N(n));if(!a)return;const{effectId:l}=s,u=d=>{if(i&&!t.matches(i))return;const m=d.animationName,p=d.detail?.effectId,h=r?qt(e,r):null;if(h){if(h.playState==="running"||m&&!h.hasAnimationName(m))return;if(p&&p!==l&&!h.hasAnimationId(p))return}a.play()},f={source:e,target:t,cleanup:()=>{a.cancel(),e.removeEventListener("animationend",u)}};q(Ge,e,f),q(Ge,t,f),e.addEventListener("animationend",u)}function Hi(e){ae(Ge,e)}const Gi={add:zi,remove:Hi};function Wi(e,t,n,s,i){const o=i||oe(e,N(t));if(!o)return null;let r=!0;const a=t.triggerType||"alternate";return{handler:u=>{if(n&&!e.matches(n))return;const c=!s,f=s?.enter?.includes(u.type),d=s?.leave?.includes(u.type);if(f||c){if(a==="alternate"||a==="state")r?(r=!1,o.play()):a==="alternate"?o.reverse():a==="state"&&(o.playState==="running"?o.pause():o.playState!=="finished"&&o.play());else{if(o.progress(0),delete e.dataset.interactEnter,o.isCSS){const m=()=>{_.mutate(()=>{e.dataset.interactEnter="done"})};o.onFinish(m),o.onAbort(m)}o.play()}return}d&&(a==="alternate"?o.reverse():a==="repeat"?(o.cancel(),_.mutate(()=>{delete e.dataset.interactEnter})):a==="state"&&o.playState==="running"&&o.pause())},cleanup:()=>o.cancel()}}function Vi(e,t,{effectId:n,listContainer:s,listItemSelector:i,stateAction:o},r,a){const l=!!s,u=o??"toggle",c=u==="toggle";return f=>{if(r&&!e.matches(r))return;const d=l?e.closest(`${s} > ${i||""}:has(:scope)`):void 0,m=!a,p=a?.enter?.includes(f.type),h=a?.leave?.includes(f.type);m?t.toggleEffect(n,u,d):(p&&t.toggleEffect(n,c?"add":u,d),h&&c&&t.toggleEffect(n,"remove",d))}}const We=new WeakMap;function gt(e,t){return n=>{const s=n;e.contains(s.relatedTarget)||t(s)}}function Bi(e){return t=>{const n=t;(n.pointerType||n.detail>0)&&e(n)}}function Yi(e){return t=>{const n=t;n.code==="Space"?(n.preventDefault(),e(n)):n.code==="Enter"&&e(n)}}const Ui={focusin:(e,t)=>gt(e,t),focusout:(e,t)=>gt(e,t),click:(e,t)=>Bi(t),keydown:(e,t)=>Yi(t)};function Ki(e,t,n){const s=Ui[e];return s?s(t,n):i=>n(i)}function Xi(e){return typeof e=="object"&&!Array.isArray(e)&&("enter"in e||"leave"in e)}function Qi(e){if(typeof e=="string")return{toggle:[e]};if(Array.isArray(e))return{toggle:[...e]};if(Xi(e)){const t=e.enter?[...e.enter]:[],n=e.leave?[...e.leave]:[];return{enter:t,leave:n}}return{}}function Zi(e){return!!(e.enter?.length||e.leave?.length)}function Ji(e){return Zi(e)?{enter:e.enter??[],leave:e.leave??[]}:void 0}function eo(e,t,n,s,{targetController:i,selectorCondition:o,animation:r}){const a=Qi(s.eventConfig),l=n.transition||n.transitionProperties,u=Ji(a);let c,f,d=!1;if(l)c=Vi(t,i,n,o,u);else{const y=Wi(t,n,o,u,r);c=y?.handler??null,f=y?.cleanup,d=n.triggerType==="once"}if(!c)return;const m=c,p=new AbortController;function h(y,$,E){const b=Ki($,e,m);y.addEventListener($,b,{...E,signal:p.signal})}const v={source:e,target:t,cleanup:()=>{p.abort(),f?.()}};if(q(We,e,v),q(We,t,v),u){const y=a.enter,$=a.leave;y.forEach(S=>{S==="focusin"&&(e.tabIndex=0),h(e,S,{passive:!0,once:d})});const E=!n.stateAction||n.stateAction==="toggle";(l?E:n.triggerType!=="once")&&$.forEach(S=>{if(S==="focusout"){h(e,S,{once:d});return}h(e,S,{passive:!0})})}else(a.toggle??[]).forEach($=>{h(e,$,{once:d,passive:$!=="keydown"})})}function to(e){ae(We,e)}const Z={add:eo,remove:to},Ve={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},vt={click:Ve.activate,hover:Ve.interest};function he(e){const t=Ve[e];return(n,s,i,o,r)=>{const a=r?.allowA11yTriggers&&e in vt?vt[e]:t;Z.add(n,s,i,{eventConfig:a},r??{})}}const W={viewEnter:ti,hover:{add:he("hover"),remove:Z.remove},click:{add:he("click"),remove:Z.remove},animationEnd:Gi,viewProgress:$i,pointerMove:ji,activate:{add:he("activate"),remove:Z.remove},interest:{add:he("interest"),remove:Z.remove}};function no(e){return e.replace(/\[[^\]]+]/g,"[]")}class w{static defineInteractElement;dataCache;addedInteractions;mediaQueryListeners;listInteractionsCache;controllers;static forceReducedMotion=!1;static reducedMotionPolicy="collapse";static allowA11yTriggers=!0;static instances=[];static controllerCache=new Map;static sequenceCache=new Map;static elementSequenceMap=new WeakMap;static plugins=new Map;static pluginDefers=new Map;static _released=new Set;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=oo(t,s,{configIndex:n?.configIndex,forceReducedMotion:n?.forceReducedMotion??w.forceReducedMotion,reducedMotionPolicy:n?.reducedMotionPolicy??w.reducedMotionPolicy});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=no(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=A(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,w._released.clear()}static setup(t){t.scrollOptionsGetter&&W.viewProgress.registerOptionsGetter?.(t.scrollOptionsGetter),t.pointerOptionsGetter&&W.pointerMove.registerOptionsGetter?.(t.pointerOptionsGetter),t.viewEnter&&W.viewEnter.setOptions(t.viewEnter),t.allowA11yTriggers!==void 0&&(w.allowA11yTriggers=t.allowA11yTriggers),t.forceReducedMotion!==void 0&&(w.forceReducedMotion=t.forceReducedMotion),t.reducedMotionPolicy!==void 0&&(w.reducedMotionPolicy=t.reducedMotionPolicy)}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=ns;static getRegisteredEffect=Qe;static use(t,n,s){w.plugins.set(t,n);const i=s?.defer;i&&i.length?w.pluginDefers.set(t,Array.isArray(i)?i:[i]):w.pluginDefers.delete(t)}static ready(t,n){w._released.add(n?`${t}::${n}`:t),n?w.controllerCache.get(n)?.resume():w.controllerCache.forEach(s=>s.resume())}static _isPluginReleased(t,n){const s=w.pluginDefers.get(t);return s?s.every(i=>w._released.has(i)||w._released.has(`${i}::${n}`)):!0}static getPlugin(t){return w.plugins.get(t)}static getPluginsNames(){return new Set(w.plugins.keys())}static getSequence(t,n,s){const i=w.sequenceCache.get(t);if(i)return i;const o=us(n,s);return w.sequenceCache.set(t,o),w._registerSequenceElements(s,o),o}static addToSequence(t,n,s){const i=w.sequenceCache.get(t);if(!i)return!1;const r=Lt(n).map((a,l)=>({index:s[l]??i.animationGroups.length,group:a}));return i.addGroups(r),w._registerSequenceElements(n,i),!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 so=0;function V(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 yt(e){return"sequenceId"in e&&!("effects"in e)}function Re(e,t){return e[t]||(e[t]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),e[t]}function io(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 oo(e,t,n){const{configIndex:s}=n,{effects:i={},sequences:o={},conditions:r={}}=e,a={},l=e.interactions?Qt(e,n):new Map;return e.interactions?.forEach((u,c)=>{const f=u.key,d=++so,{effects:m,sequences:p,...h}=u;if(!f){console.error(`Interaction ${d} is missing a key for source element.`);return}Re(a,f);const g=m?Array.from(m):[];g.reverse();const v=p?.map((E,b)=>{if(yt(E)){const T=o[E.sequenceId];return T?{...T,...E}:(console.warn(`Interact: Sequence "${E.sequenceId}" not found in config`),E)}const S=E;return S.sequenceId||(S.sequenceId=J("seq",[c,b],s)),S}),y={...h,effects:g.length>0?g:void 0,sequences:v?.map((E,b)=>io(E,S=>Ee(c,S,b),l))};a[f].triggers.push(y),a[f].selectors.add(V(y,{useFirstChild:t}));const $=y.listContainer;g.forEach((E,b)=>{const S=E.effectId?i[E.effectId]:void 0;let T=E.key||S?.key;const I=g.length-1-b;E.effectId||(E.effectId=J("eff",[c,I],s));const P=l.get(Ee(c,I));if(P&&(E.suffix=P),T=T||f,E.key=T,$&&E.listContainer&&(T!==f||E.listContainer!==$))return;const k=B({...S,...E,key:T}),O=`${f}::${k}::${d}`;if(E.interactionId=O,a[f].interactionIds.add(O),T===f)return;const C=Re(a,T);C.effects[O]||(C.effects[O]=[],C.interactionIds.add(O)),C.effects[O].push({...h,effect:E}),C.selectors.add(V(E,{useFirstChild:t}))}),v?.forEach(E=>{if(!E||yt(E))return;const b=E,S=b.sequenceId;b.effects.forEach((I,P)=>{I.effectId||(I.effectId=`eff-${S}-${P}`);let k=I.key;if(!k&&I.effectId){const C=i[I.effectId];C&&(k=C.key)}k=k||f;const O=V(I,{useFirstChild:t});if(O&&a[f].selectors.add(O),k!==f){const C=Re(a,k),M=`${k}::seq::${S}::${d}`;C.sequences[M]||(C.sequences[M]=[],C.interactionIds.add(M)),C.sequences[M].push({...h,sequence:b}),C.selectors.add(O)}})})}),{effects:i,sequences:o,conditions:jt(r),reducedMotionPolicy:n.reducedMotionPolicy,forceReducedMotion:n.forceReducedMotion,interactions:a}}function Me(e,t,n,s,i){const o=w.getPluginsNames();for(const r of o){const a=`${Ke}${r}`;if(!(a in n))continue;const l=n[a];if(l!==null&&typeof l=="object"){if(e._appliedPlugins.has(l))continue;e._appliedPlugins.add(l)}const c=w.getPlugin(r)(l,{root:t,key:s,scope:i,config:n});typeof c=="function"&&e._pluginCleanups.push(c)}}function z(e,t){for(const n of w.getPluginsNames())if(`${Ke}${n}`in t&&!w._isPluginReleased(n,e))return!0;return!1}function Se(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 be(e,t){return t.map(n=>e.selector?n.querySelector(e.selector):n).filter(Boolean)}function _e(e,t,n,s={}){const{effects:i,conditions:o,reducedMotionPolicy:r,forceReducedMotion:a}=t.dataCache,l=zt(e,Te(e.reducedMotionPolicy,s.policy,r),{effects:i,force:a,collapsesStagger:s.collapsesStagger});let u;return l.forEach((c,f)=>{const d=F(c.conditions||[],o);d&&t.setupMediaQueryListener(f?`${n.id}::rm${f}`:n.id,d,n.key,n.onUpdate),!u&&(!d||d.matches)&&(u=c)}),u}function on(e,t,n,s,i,o,r,a){return[r?be(e,r):Se(e,n,s),a?be(t,a):Se(t,i,o)]}function rn(e,t,n,s,i,o,r,a){const l=Array.isArray(s),u=Array.isArray(i);l?s.forEach((c,f)=>{const d=u?i[f]:i;d&&Et(e,c,t.trigger,d,n,t.params,o,r,a)}):(u?i:[i]).forEach(f=>{Et(e,s,t.trigger,f,n,t.params,o,r,a)})}function an(e,t,n,s,i){const o={},r=[];(s.effects||[]).forEach((a,l)=>{const u=a.effectId,c={...n.dataCache.effects[u]||{},...a,effectId:u},f=c.key,d=A(a.interactionId,e);if(o[d]||n.addedInteractions[d]&&!i)return;const m=_e(c,n,{id:`${d}::${l}`,key:e,onUpdate:()=>{t.update()}},{policy:s.reducedMotionPolicy});if(m){o[d]=!0;const p=f&&A(f,e);let h;if(p){if(h=w.getController(p),!h)return;m.listContainer&&h.watchChildList(m.listContainer)}else h=t;if(z(p||s.key,m))return;Me(h,h.element,m,p||s.key,"effect");const[g,v]=on(s,m,t.element,t.useFirstChild,h.element,h.useFirstChild,i);if(!g||!v)return;n.addedInteractions[d]=!0;const y=p||s.key,$=x(m.conditions||[],n.dataCache.conditions);r.push([y,s,m,g,v,$,h.useFirstChild,e])}}),r.reverse().forEach(a=>{rn(...a)}),ao(e,t,n,s,i)}function cn(e,t,n){return Te(e.reducedMotionPolicy,t.reducedMotionPolicy,n.dataCache.reducedMotionPolicy)}function Be(e,t,n){const{forceReducedMotion:s,conditions:i}=n.dataCache,o=F([Ie],i);return(s||!!(o&&o.matches))&&cn(e,t,n)!=="ignore"?{...e,offset:0}:e}function ro(e){return"sequenceId"in e&&!("effects"in e)}function ln(e,t,n,s,i,o,r,a){const l=F(e.conditions||[],o.dataCache.conditions);if(l&&o.setupMediaQueryListener(n,l,r.updateKey,r.onUpdate),l&&!l.matches)return null;const u=e.effects||[],c=h=>{const g=h.effectId;return{...g?o.dataCache.effects[g]||{}:{},...h}};if(u.some(h=>{const g=c(h),v=F(g.conditions||[],o.dataCache.conditions);if(v&&!v.matches)return!1;const y=g.key&&A(g.key,s);return z(y||s,g)}))return null;const d=[],m=cn(e,t,o);let p=!1;for(const h of u){const g=h.effectId,v=_e(c(h),o,{id:`${n}::${g||"eff"}`,key:r.updateKey,onUpdate:r.onUpdate},{policy:m,collapsesStagger:m!=="ignore"});if(!v)continue;const y=v.key,$=y&&A(y,s);let E;if($){if(E=w.getController($),!E)return null}else E=i;const b=$||s;Me(E,E.element,v,b,"effect");let S;if(a&&b===a.controllerKey&&v.listContainer===a.listContainer?(S=be(v,a.elements),S.length>0&&(p=!0)):S=Se(v,E.element,E.useFirstChild),!S||Array.isArray(S)&&S.length===0)return null;const T=N(v);d.push({target:S,options:T})}return a&&!p?null:d.length>0?d:null}function Ye(e,t,n){const s=n?be(e,n):Se(e,t.element,t.useFirstChild);return Array.isArray(s)&&s.length===0?null:s}function Ue(e,t,n,s,i){(Array.isArray(n)?n:[n]).forEach(r=>{W[e.trigger]?.add(r,r,{triggerType:t.triggerType},e.params||{},{selectorCondition:i,animation:s,allowA11yTriggers:w.allowA11yTriggers})})}function un(e,t,n){const o=(e.useFirstChild?e.element.firstElementChild:e.element)?.querySelector(t);if(!o)return n.map((a,l)=>l);const r=Array.from(o.children);return n.map(a=>{const l=r.indexOf(a);return l>=0?l:r.length})}function ao(e,t,n,s,i){s.sequences?.forEach(o=>{let r;if(ro(o)){const p=n.dataCache.sequences[o.sequenceId];if(!p){console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);return}r={...p,...o}}else r=o;const a=r.sequenceId||ne(),l=A(`${e}::seq::${a}`,e);if(n.addedInteractions[l]&&!i)return;const u=i&&s.listContainer?{controllerKey:e,listContainer:s.listContainer,elements:i}:void 0,c=ln(r,s,l,e,t,n,{updateKey:e,onUpdate:()=>t.update()},u);if(!c)return;if(i&&n.addedInteractions[l]){const p=un(t,s.listContainer,i);w.addToSequence(l,c,p);const h=w.getSequence(l,Be(r,s,n),c),g=x(s.conditions||[],n.dataCache.conditions),v=Ye(s,t,i);v&&Ue(s,r,v,h,g);return}const f=w.getSequence(l,Be(r,s,n),c),d=x(s.conditions||[],n.dataCache.conditions),m=Ye(s,t,i);m&&(n.addedInteractions[l]=!0,Ue(s,r,m,f,d))})}function co(e,t,n,s,i){const o=n.get(e)?.sequences||{};Object.keys(o).forEach(a=>{o[a].some(({sequence:u,...c})=>{const f=F(c.conditions||[],n.dataCache.conditions);if(f&&!f.matches)return!1;const d=c.key&&A(c.key,e),m=w.getController(d);if(!m)return!0;const p=u.sequenceId||ne(),h=A(`${d}::seq::${p}`,d);if(n.addedInteractions[h]&&!i||z(d,c))return!0;const v=ln(u,c,h,d,m,n,{updateKey:e,onUpdate:()=>t.update()},i&&s?{controllerKey:e,listContainer:s,elements:i}:void 0);if(!v)return!0;if(i&&n.addedInteractions[h]){const b=un(t,s,i);return w.addToSequence(h,v,b),!0}const y=w.getSequence(h,Be(u,c,n),v),$=x(c.conditions||[],n.dataCache.conditions),E=Ye(c,m);return E&&(n.addedInteractions[h]=!0,Ue(c,u,E,y,$)),!0})})}function fn(e,t,n,s,i){const o=n.get(e),r=o?.effects||{},a=Object.keys(r),l=[];a.forEach(c=>{const f=A(c,e);if(n.addedInteractions[f]&&!i)return;r[c].some(({effect:m,...p},h)=>{const g=F(p.conditions||[],n.dataCache.conditions);if(g&&!g.matches)return!1;const v=m.effectId,y={...n.dataCache.effects[v]||{},...m,effectId:v};if(s&&y.listContainer!==s)return!1;const $=_e(y,n,{id:`${f}::${h}`,key:e,onUpdate:()=>{t.update()}},{policy:p.reducedMotionPolicy});if($){const E=p.key&&A(p.key,e),b=w.getController(E);if(!b||z(E,p)||z(e,$))return!0;Me(t,t.element,$,e,"effect"),$.listContainer&&t.watchChildList($.listContainer);const[S,T]=on(p,$,b.element,b.useFirstChild,t.element,t.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[f]=!0;const I=x($.conditions||[],n.dataCache.conditions);return l.push([e,p,$,S,T,I,t.useFirstChild,E||void 0]),!0}return!1})}),l.reverse().forEach(c=>{rn(...c)}),co(e,t,n,s,i);const u=Object.keys(o?.sequences||{}).length>0;return a.length>0||u}function Et(e,t,n,s,i,o,r,a,l){let u;if(Ft(i)){const f={key:e,effectId:i.effectId,transition:i.transition,transitionProperties:i.transitionProperties,childSelector:V(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:a}),selectorCondition:r};if(u=w.getController(e),!u)return;u.renderStyle(ms(f))}let c;if(n==="animationEnd"){const f=o.effectId,d=l?w.getInstance(l):void 0,m=d?.dataCache.effects[f],p=m&&_e(m,d,{id:`${l}::animationEnd::${f}`,key:l,onUpdate:()=>{w.getController(l)?.update()}});p&&(c=N(p))}W[n]?.add(t,s,i,o,{targetController:u,selectorCondition:r,allowA11yTriggers:w.allowA11yTriggers,sourceAnimationOptions:c})}function wt(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 l=F(r.conditions,n.dataCache.conditions);if(l){const u=`${t}::trigger::${a}`;n.setupMediaQueryListener(u,l,t,()=>{e.update()})}if(!l||l.matches){if(z(t,r))return;Me(e,e.element,r,t,"interaction"),r.listContainer&&e.watchChildList(r.listContainer),an(t,e,n,r)}});let o=!1;return n&&(o=fn(t,e,n)),i||o}function lo(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 l=F(r.conditions,i.dataCache.conditions);if(l){const u=`${s}::listTrigger::${t}::${a}`;i.setupMediaQueryListener(u,l,s,()=>{e.update()})}if(!l||l.matches){if(z(s,r))return;an(s,e,i,r,n)}}),fn(s,e,i,t,n)}}function uo(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],dn(o),s.deleteController(n,t)}function dn(e){const t=Object.values(W);for(const n of e)for(const s of t)s.remove(n);w.removeFromSequences(e)}const Le="interactEffect";class hn{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=wt(this)}disconnect({removeFromCache:t=!1}={}){if((this.key||this.element.dataset.interactKey)&&uo(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()}resume(){this.connected&&wt(this)}renderStyle(t){const n=this.element?.getRootNode(),s=n.host?n:document;if(!this.sheet)this.sheet=new CSSStyleSheet,this.sheet.replaceSync(t.join(`
27
+ `)}const Ys={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},Us={root:null,rootMargin:"0px",threshold:[0]},Ks=.2;function Xs(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 ee={},D=new WeakMap,we=new WeakSet,X=new WeakMap;let Zt={},Q=null;function Qs(e){Zt=e}function Jt(e,t,n){D.get(e)?.forEach(({source:i,handler:o})=>{i===e&&o(t,n)})}function ut(){return Q||(Q=new IntersectionObserver(e=>{e.forEach(t=>{const n=t.target;t.isIntersecting||Jt(n,!1,!0)})},Us),Q)}function en(e,t=!1){const n=JSON.stringify({...e,isSafeMode:t});if(ee[n])return ee[n];const s=e.threshold??Ks,i=t?Ys:{root:null,rootMargin:e.inset?Xs(e.inset):"0px",threshold:s},o=new IntersectionObserver(r=>{r.forEach(a=>{const l=a.target,u=!we.has(l);if(u&&(we.add(l),e.useSafeViewEnter&&!a.isIntersecting)){_.measure(()=>{const c=a.boundingClientRect.height,f=a.rootBounds?.height;if(!f)return;const d=Array.isArray(e.threshold)?Math.min(...e.threshold):e.threshold;d&&c*d>f&&_.mutate(()=>{o.unobserve(l);const p=en(e,!0);X.set(l,p),p.observe(l)})});return}(a.isIntersecting||!u)&&Jt(l,a.isIntersecting)})},i);return ee[n]=o,o}function Zs(e,t,n,s={},{selectorCondition:i,animation:o}={}){const r={...Zt,...s},a=n.triggerType||"once",l=o||oe(t,N(n));if(!l)return;const u=en(r);a!=="once"&&l.persist?.();let c=!0,f=!1,d;d={source:e,target:t,handler:(h,g)=>{if(!(i&&!t.matches(i)))if(a==="once"){if(h&&!f){f=!0;const v=D.get(e);(!v||v.size===0||v.size===1&&v.has(d))&&((X.get(e)||u).unobserve(e),we.delete(e)),l.onFinish(()=>{D.get(e)?.delete(d),D.get(t)?.delete(d)}),l.play(()=>{const y=()=>{t.dataset.interactEnter="start"},$=()=>{_.mutate(()=>{t.dataset.interactEnter="done"})};l.isCSS?(_.mutate(()=>{requestAnimationFrame(y)}),l.onFinish($),l.onAbort($)):(_.mutate(y),l.onFinish($))})}}else a==="alternate"?c&&h?(c=!1,l.play()):c||l.reverse():a==="repeat"?h?(l.progress(0),l.play()):g&&(l.pause(),l.progress(0)):a==="state"&&(h?l.play():g&&l.pause())},cleanup:()=>{(X.get(e)||u).unobserve(e),(a==="repeat"||a==="state")&&ut().unobserve(e),l.cancel(),we.delete(e),X.delete(e)}},q(D,e,d),q(D,t,d),X.set(e,u),u.observe(e),(a==="repeat"||a==="state")&&ut().observe(e)}function Js(e){ae(D,e)}function ei(){Q=null,Object.keys(ee).forEach(e=>delete ee[e])}const ti={add:Zs,remove:Js,setOptions:Qs,reset:ei};function tn(e,t){return Object.assign(Object.create(t),e)}function ni(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 si(e){let t=!1;return function(){t||(t=!0,window.requestAnimationFrame(()=>{t=!1,e()}))}}function ft(e,t){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,e()},t)}}function ii(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 $e(n[1],t)+$e(n[6],t)}function $e(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)?ii(e,t):parseInt(e)||0:0}function H(e,t,n){const{name:s,offset:i=0}=e,{start:o,end:r}=n,a=r-o,l=i/100;let u,c;return s==="entry"?(u=o-t,c=Math.min(t,a)):s==="entry-crossing"?(u=o-t,c=a):s==="contain"?(u=Math.min(r-t,o),c=Math.abs(t-a)):s==="exit"?(u=Math.max(o,r-t),c=Math.min(t,a)):s==="exit-crossing"?(u=o,c=a):s==="cover"&&(u=o-t,c=a+t),u+l*c|0}function qe(e,t,n,s,i){let o=0;const r={start:t,end:n};return e.forEach((a,l)=>{o+=a.offset;const u=a.sticky;if(u){if("end"in u&&e[l-1]?.element){const d=((i?a.element.offsetWidth:a.element.offsetHeight)||0)+u.end-s,m=o+d-a.offset,p=m<r.start,h=!p&&m<=n;let g=0;(p||h)&&(g=a.offset,r.end+=g),p&&(r.start+=g)}if("start"in u){const c=o-u.start,f=c<r.start,d=!f&&c<=r.end;let m=0;const p=e[l-1]?.element;if(p){if(f||d){const h=(i?p.offsetWidth:p.offsetHeight)||0,g=a.offset,v=(i?a.element.offsetWidth:a.element.offsetHeight)||0;m=h-(g+v),o+=m,r.end+=m}f&&(r.start+=m)}}}}),r}function oi(e,t,n,s,i,o){const{start:r,end:a,duration:l}=e;let u=r,c=a,f=e.startRange,d=e.endRange,m;if(typeof l=="string"){f={name:l,offset:0},d={name:l,offset:100},u=H(f,n,t),c=H(d,n,t),m=c-u;const p=qe(o,u,c,n,s);u=p.start,c=p.end}else{if(f||r?.name){f=f||r;const p=$e(f.add,i),h=H({...f,offset:0},n,t),g=H({...f,offset:100},n,t),v=qe(o,h,g,n,s);u=v.start+f.offset/100*(v.end-v.start)+p}if(d||a?.name){d=d||a;const p=$e(d.add,i),h=H({...d,offset:0},n,t),g=H({...d,offset:100},n,t),v=qe(o,h,g,n,s);c=v.start+d.offset/100*(v.end-v.start)+p}else typeof l=="number"&&(c=u+l)}return!m&&!l&&(m=c-u),{...e,start:u,end:c,startRange:f,endRange:d,duration:m||l}}function ri(e){return e.position==="sticky"}function ai(e,t,n){return e.position==="fixed"&&(!t||t===window.document.body||t===n)}function ci(e,t){return parseInt(t?e.left:e.top)}function li(e,t){return parseInt(t?e.right:e.bottom)}function ui(e,t,n){n&&(e.style.position="static");const s=(t?e.offsetLeft:e.offsetTop)||0;return n&&(e.style.position=null),s}function fi(e,t){let n;const s=ci(e,t),i=li(e,t),o=!isNaN(s),r=!isNaN(i);return(o||r)&&(n={},o&&(n.start=s),r&&(n.end=i)),n}function ue(e,t,n,s,i){const o=e[0].viewSource,r=[];let a=(s?o.offsetWidth:o.offsetHeight)||0,l=0,u=o;for(;u;){const f=window.getComputedStyle(u),d=ri(f),m=d?fi(f,s):void 0,p=ui(u,s,d);if((!m||!("end"in m))&&(l+=p),r.push({element:u,offset:p,sticky:m}),u=u.offsetParent,ai(f,u,t))break;if(u===t){r.push({element:u,offset:0});break}}return r.reverse(),e.map(f=>({...oi(f,{start:l,end:l+a},n,s,i,r)}))}const dt=100,di={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function hi(e,t,n,s){let i=0;return e>=t&&e<=n?i=s?(e-t)/s:1:e>n&&(i=1),i}function ht(e,t){return e===window?t?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:t?e.clientWidth:e.clientHeight}function mi(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function pi(e){const t=tn(e,di),n=t.root,s=t.horizontal,i=new WeakMap;let o=ht(n,s),r,a,l,u,c;const f=[],d=mi();if(t.scenes=Object.values(e.scenes.reduce((h,g,v)=>{const y=g.groupId?`group-${g.groupId}`:String(v);return h[y]?h[y].push(g):h[y]=[g],h},{})).flatMap(h=>(h.every(g=>g.viewSource&&(typeof g.duration=="string"||g.start?.name))?(h=ue(h,n,o,s,d),(t.observeSourcesResize||t.observeContentResize)&&f.push(h)):h.forEach(g=>{g.end==null&&(g.end=g.start+g.duration),g.duration==null&&(g.duration=g.end-g.start)}),h)),t.scenes.forEach((h,g)=>{h.index=g}),f.length){const h=new Map;window.ResizeObserver&&(l=new window.ResizeObserver(function(g){g.forEach(v=>{const y=h.get(v.target),$=ue(y,n,o,s,d);$.forEach((E,b)=>{t.scenes[E.index]=$[b]}),f.splice(f.indexOf(y),1,$)})}),f.forEach(g=>{l.observe(g[0].viewSource,{box:"border-box"}),h.set(g[0].viewSource,g)}),t.observeContentResize&&t.contentRoot&&new window.ResizeObserver(ft(()=>{const v=f.map(y=>{const $=ue(y,n,o,s,d);return $.forEach((E,b)=>{t.scenes[E.index]=$[b]}),$});f.length=0,f.push(...v),f.forEach(y=>{h.set(y[0].viewSource,y)})},dt)).observe(t.contentRoot,{box:"border-box"})),t.observeViewportResize&&(u=ft(function(){o=ht(n,s);const g=f.map(v=>{const y=ue(v,n,o,s,d);return y.forEach(($,E)=>{t.scenes[$.index]=y[E]}),y});f.length=0,f.push(...g),f.forEach(v=>{h.set(v[0].viewSource,v)})},dt),n===window?window.addEventListener("resize",u):window.ResizeObserver&&(c=new window.ResizeObserver(u),c.observe(n,{box:"border-box"})))}t.observeViewportEntry&&window.IntersectionObserver&&(a=new window.IntersectionObserver(function(h){h.forEach(g=>{(i.get(g.target)||[]).forEach(v=>{v.disabled=!g.isIntersecting})})},{root:n===window?window.document:n,rootMargin:t.viewportRootMargin,threshold:0}),t.scenes.forEach(h=>{if(h.viewSource){let g=i.get(h.viewSource);g||(g=[],i.set(h.viewSource,g),a.observe(h.viewSource)),g.push(h)}}));function m({p:h,vp:g}){h=+h.toFixed(1);const v=+g.toFixed(4);if(h!==r){for(let y of t.scenes)if(!y.disabled){const{start:$,end:E,duration:b}=y,S=hi(h,$,E,b);y.effect(y,S,v)}r=h}}function p(){t.scenes.forEach(h=>h.destroy?.()),a&&(a.disconnect(),a=null),l&&(l.disconnect(),l=null),u&&(c?(c.disconnect(),c=null):window.removeEventListener("resize",u))}return{tick:m,destroy:p}}const gi={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class vi{constructor(t={}){this.config=tn(t,gi),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=si(()=>{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=ni(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=pi(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const ze=new WeakMap;let nn=()=>({});function yi(e){nn=e}function Ei(e,t,n,s,{selectorCondition:i}){if(i&&!t.matches(i))return;const o={trigger:"view-progress",element:e},r=N(n);let a;if("ViewTimeline"in window){const u=oe(t,r,o);u&&!u.isCSS&&(u.play(),a=()=>{u.ready.then(()=>{u.cancel()})})}else{const u=Rt(t,r,o);if(u){const c=Array.isArray(u)?u:[u],f=new vi({viewSource:e,scenes:c,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...nn()});a=()=>{f.destroy()},Promise.all(c.map(d=>d.ready||Promise.resolve())).then(()=>{f.start()})}}if(!a)return;const l={source:e,target:t,cleanup:a};q(ze,e,l),q(ze,t,l)}function wi(e){ae(ze,e)}const $i={add:Ei,remove:wi,registerOptionsGetter:yi};function mt(e,t,n){return Math.min(Math.max(e,n),t)}function pt(e){let t=!1;return function(){if(!t)return t=!0,window.requestAnimationFrame(()=>{t=!1,e()})}}function Si(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 bi(){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 Ii(){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 Ti(e){Ii().then(t=>{e.fixRequired=t,t&&(window.addEventListener("scroll",e.scrollHandler),e.scrollHandler())})}let fe=0;const ve=new Set;function Oi(){const e=n=>{for(let s of n.changedTouches)ve.add(s.identifier)},t=n=>{for(let s of n.changedTouches)ve.delete(s.identifier)};return document.addEventListener("touchstart",e,{passive:!0}),document.addEventListener("touchend",t,{passive:!0}),function(){ve.clear(),document.removeEventListener("touchstart",e),document.removeEventListener("touchend",t)}}function Ci(e,t){if("onscrollend"in window)return e.addEventListener("scrollend",t),function(){e.removeEventListener("scrollend",t)};let n=0,s;fe||(s=Oi()),fe+=1;function i(o){clearTimeout(n),n=setTimeout(()=>{ve.size?setTimeout(i,100):(t(o),n=0)},100)}return e.addEventListener("scroll",i),function(){e.removeEventListener("scroll",i),fe-=1,fe||s()}}function Mi(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 _i(e,t){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>e&&e(t))}function Pi(e){e.rect.width=window.document.documentElement.clientWidth,e.rect.height=window.document.documentElement.clientHeight}function ki(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 Ai(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 l={x:0,y:0};e.scenes.forEach(c=>{c.target&&c.centeredToTarget&&(c.transform=Mi(Si(c.target),e.rect,l),t=!0),e.root?i=ki(e):(o=Pi.bind(null,e),window.addEventListener("resize",o))}),s=function(c){for(let f of e.scenes)if(!f.disabled){const d=f.transform?.x(c.x)||c.x/e.rect.width,m=f.transform?.y(c.y)||c.y/e.rect.height,p=+mt(0,1,d).toPrecision(4),h=+mt(0,1,m).toPrecision(4),g={x:c.vx,y:c.vy};e.allowActiveEvent&&(c.active=d<=1&&m<=1&&d>=0&&m>=0),f.effect(f,{x:p,y:h},g,c.active)}Object.assign(n,c)},t&&(r=_i.bind(l,s,n),a=Ci(document,r));function u(){e.scenes.forEach(c=>c.destroy?.()),a?.(),i?(i.disconnect(),i=null):(window.removeEventListener("resize",o),o=null),s=null,n=null}return{tick:s,destroy:u}}const qi=1e3/60*3;let de;function Ri(){G.x=window.scrollX,G.y=window.scrollY}const G={x:0,y:0,scrollHandler:Ri,fixRequired:void 0};class Li{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():pt(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):pt(()=>{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){de=typeof de=="boolean"?de:bi();const i=de?window.devicePixelRatio:1;typeof G.fixRequired>"u"&&Ti(G),this._measure=o=>{if(o.target!==this.config.root){const r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:o.x*i+G.x,clientY:o.y*i+G.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,l=n(Math.min(1,a));i&&(this.progress.vx=0,this.progress.vy=0,i=!1),this.currentProgress=Object.entries(this.progress).reduce((u,[c,f])=>(c==="active"?u[c]=f:u[c]=this.previousProgress[c]+(f-this.previousProgress[c])*l,u),this.currentProgress||{}),a<1&&(this._nextTransitionTick=requestAnimationFrame(o),i=r-this._startTime>qi),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=Ai(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const He=new WeakMap;let sn=()=>({});function Fi(e){sn=e}function xi(e){return!("keyframeEffect"in e||"customEffect"in e)||!e.transitionDuration?{}:{transitionDuration:e.transitionDuration,transitionEasing:Xe(e.transitionEasing)}}function Ni(e,t,n,s={},{selectorCondition:i}){if(i&&!t.matches(i))return;const o={trigger:"pointer-move",element:e,axis:s.axis??"y"},r=Rt(t,N(n),o);if(r){const a=Array.isArray(r)?r:[r],l=new Li({root:s.hitArea==="self"?e:void 0,scenes:a,...sn(),...xi(n)}),c={source:e,target:t,cleanup:()=>{l.destroy()}};q(He,e,c),q(He,t,c),Promise.all(a.map(f=>f.ready||Promise.resolve())).then(()=>{l.start()})}}function Di(e){ae(He,e)}const ji={add:Ni,remove:Di,registerOptionsGetter:Fi},Ge=new WeakMap;function zi(e,t,n,s,{selectorCondition:i,animation:o,sourceAnimationOptions:r}){const a=o||oe(t,N(n));if(!a)return;const{effectId:l}=s,u=d=>{if(i&&!t.matches(i))return;const m=d.animationName,p=d.detail?.effectId,h=r?qt(e,r):null;if(h){if(h.playState==="running"||m&&!h.hasAnimationName(m))return;if(p&&p!==l&&!h.hasAnimationId(p))return}a.play()},f={source:e,target:t,cleanup:()=>{a.cancel(),e.removeEventListener("animationend",u)}};q(Ge,e,f),q(Ge,t,f),e.addEventListener("animationend",u)}function Hi(e){ae(Ge,e)}const Gi={add:zi,remove:Hi};function Wi(e,t,n,s,i){const o=i||oe(e,N(t));if(!o)return null;let r=!0;const a=t.triggerType||"alternate";return{handler:u=>{if(n&&!e.matches(n))return;const c=!s,f=s?.enter?.includes(u.type),d=s?.leave?.includes(u.type);if(f||c){if(a==="alternate"||a==="state")r?(r=!1,o.play()):a==="alternate"?o.reverse():a==="state"&&(o.playState==="running"?o.pause():o.playState!=="finished"&&o.play());else{if(o.progress(0),delete e.dataset.interactEnter,o.isCSS){const m=()=>{_.mutate(()=>{e.dataset.interactEnter="done"})};o.onFinish(m),o.onAbort(m)}o.play()}return}d&&(a==="alternate"?o.reverse():a==="repeat"?(o.cancel(),_.mutate(()=>{delete e.dataset.interactEnter})):a==="state"&&o.playState==="running"&&o.pause())},cleanup:()=>o.cancel()}}function Vi(e,t,{effectId:n,listContainer:s,listItemSelector:i,stateAction:o},r,a){const l=!!s,u=o??"toggle",c=u==="toggle";return f=>{if(r&&!e.matches(r))return;const d=l?e.closest(`${s} > ${i||""}:has(:scope)`):void 0,m=!a,p=a?.enter?.includes(f.type),h=a?.leave?.includes(f.type);m?t.toggleEffect(n,u,d):(p&&t.toggleEffect(n,c?"add":u,d),h&&c&&t.toggleEffect(n,"remove",d))}}const We=new WeakMap;function gt(e,t){return n=>{const s=n;e.contains(s.relatedTarget)||t(s)}}function Bi(e){return t=>{const n=t;(n.pointerType||n.detail>0)&&e(n)}}function Yi(e){return t=>{const n=t;n.code==="Space"?(n.preventDefault(),e(n)):n.code==="Enter"&&e(n)}}const Ui={focusin:(e,t)=>gt(e,t),focusout:(e,t)=>gt(e,t),click:(e,t)=>Bi(t),keydown:(e,t)=>Yi(t)};function Ki(e,t,n){const s=Ui[e];return s?s(t,n):i=>n(i)}function Xi(e){return typeof e=="object"&&!Array.isArray(e)&&("enter"in e||"leave"in e)}function Qi(e){if(typeof e=="string")return{toggle:[e]};if(Array.isArray(e))return{toggle:[...e]};if(Xi(e)){const t=e.enter?[...e.enter]:[],n=e.leave?[...e.leave]:[];return{enter:t,leave:n}}return{}}function Zi(e){return!!(e.enter?.length||e.leave?.length)}function Ji(e){return Zi(e)?{enter:e.enter??[],leave:e.leave??[]}:void 0}function eo(e,t,n,s,{targetController:i,selectorCondition:o,animation:r}){const a=Qi(s.eventConfig),l=n.transition||n.transitionProperties,u=Ji(a);let c,f,d=!1;if(l)c=Vi(t,i,n,o,u);else{const y=Wi(t,n,o,u,r);c=y?.handler??null,f=y?.cleanup,d=n.triggerType==="once"}if(!c)return;const m=c,p=new AbortController;function h(y,$,E){const b=Ki($,e,m);y.addEventListener($,b,{...E,signal:p.signal})}const v={source:e,target:t,cleanup:()=>{p.abort(),f?.()}};if(q(We,e,v),q(We,t,v),u){const y=a.enter,$=a.leave;y.forEach(S=>{S==="focusin"&&(e.tabIndex=0),h(e,S,{passive:!0,once:d})});const E=!n.stateAction||n.stateAction==="toggle";(l?E:n.triggerType!=="once")&&$.forEach(S=>{if(S==="focusout"){h(e,S,{once:d});return}h(e,S,{passive:!0})})}else(a.toggle??[]).forEach($=>{h(e,$,{once:d,passive:$!=="keydown"})})}function to(e){ae(We,e)}const Z={add:eo,remove:to},Ve={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},vt={click:Ve.activate,hover:Ve.interest};function he(e){const t=Ve[e];return(n,s,i,o,r)=>{const a=r?.allowA11yTriggers&&e in vt?vt[e]:t;Z.add(n,s,i,{eventConfig:a},r??{})}}const W={viewEnter:ti,hover:{add:he("hover"),remove:Z.remove},click:{add:he("click"),remove:Z.remove},animationEnd:Gi,viewProgress:$i,pointerMove:ji,activate:{add:he("activate"),remove:Z.remove},interest:{add:he("interest"),remove:Z.remove}};function no(e){return e.replace(/\[[^\]]+]/g,"[]")}class w{static defineInteractElement;dataCache;addedInteractions;mediaQueryListeners;listInteractionsCache;controllers;static forceReducedMotion=!1;static reducedMotionPolicy="collapse";static allowA11yTriggers=!0;static instances=[];static controllerCache=new Map;static sequenceCache=new Map;static elementSequenceMap=new WeakMap;static plugins=new Map;static pluginDefers=new Map;static _released=new Set;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=oo(t,s,{configIndex:n?.configIndex,forceReducedMotion:n?.forceReducedMotion??w.forceReducedMotion,reducedMotionPolicy:n?.reducedMotionPolicy??w.reducedMotionPolicy});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=no(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=A(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,w._released.clear()}static setup(t){t.scrollOptionsGetter&&W.viewProgress.registerOptionsGetter?.(t.scrollOptionsGetter),t.pointerOptionsGetter&&W.pointerMove.registerOptionsGetter?.(t.pointerOptionsGetter),t.viewEnter&&W.viewEnter.setOptions(t.viewEnter),t.allowA11yTriggers!==void 0&&(w.allowA11yTriggers=t.allowA11yTriggers),t.forceReducedMotion!==void 0&&(w.forceReducedMotion=t.forceReducedMotion),t.reducedMotionPolicy!==void 0&&(w.reducedMotionPolicy=t.reducedMotionPolicy)}static getInstance(t){return w.instances.find(n=>n.has(t))}static getController(t){return t?w.controllerCache.get(t):void 0}static setController(t,n){w.controllerCache.set(t,n)}static deleteController(t){w.controllerCache.delete(t)}static registerEffects=ns;static getRegisteredEffect=Qe;static use(t,n,s){w.plugins.set(t,n);const i=s?.defer;i&&i.length?w.pluginDefers.set(t,Array.isArray(i)?i:[i]):w.pluginDefers.delete(t)}static ready(t,n){w._released.add(n?`${t}::${n}`:t),n?w.controllerCache.get(n)?.resume():w.controllerCache.forEach(s=>s.resume())}static _isPluginReleased(t,n){const s=w.pluginDefers.get(t);return s?s.every(i=>w._released.has(i)||w._released.has(`${i}::${n}`)):!0}static getPlugin(t){return w.plugins.get(t)}static getPluginsNames(){return new Set(w.plugins.keys())}static getSequence(t,n,s){const i=w.sequenceCache.get(t);if(i)return i;const o=us(n,s);return w.sequenceCache.set(t,o),w._registerSequenceElements(s,o),o}static addToSequence(t,n,s){const i=w.sequenceCache.get(t);if(!i)return!1;const r=Lt(n).map((a,l)=>({index:s[l]??i.animationGroups.length,group:a}));return i.addGroups(r),w._registerSequenceElements(n,i),!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 so=0;function V(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 yt(e){return"sequenceId"in e&&!("effects"in e)}function Re(e,t){return e[t]||(e[t]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),e[t]}function io(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 oo(e,t,n){const{configIndex:s}=n,{effects:i={},sequences:o={},conditions:r={}}=e,a={},l=e.interactions?Qt(e,n):new Map;return e.interactions?.forEach((u,c)=>{const f=u.key,d=++so,{effects:m,sequences:p,...h}=u;if(!f){console.error(`Interaction ${d} is missing a key for source element.`);return}Re(a,f);const g=m?Array.from(m):[];g.reverse();const v=p?.map((E,b)=>{if(yt(E)){const T=o[E.sequenceId];return T?{...T,...E}:(console.warn(`Interact: Sequence "${E.sequenceId}" not found in config`),E)}const S=E;return S.sequenceId||(S.sequenceId=J("seq",[c,b],s)),S}),y={...h,effects:g.length>0?g:void 0,sequences:v?.map((E,b)=>io(E,S=>Ee(c,S,b),l))};a[f].triggers.push(y),a[f].selectors.add(V(y,{useFirstChild:t}));const $=y.listContainer;g.forEach((E,b)=>{const S=E.effectId?i[E.effectId]:void 0;let T=E.key||S?.key;const I=g.length-1-b;E.effectId||(E.effectId=J("eff",[c,I],s));const P=l.get(Ee(c,I));if(P&&(E.suffix=P),T=T||f,E.key=T,$&&E.listContainer&&(T!==f||E.listContainer!==$))return;const k=B({...S,...E,key:T}),O=`${f}::${k}::${d}`;if(E.interactionId=O,a[f].interactionIds.add(O),T===f)return;const C=Re(a,T);C.effects[O]||(C.effects[O]=[],C.interactionIds.add(O)),C.effects[O].push({...h,effect:E}),C.selectors.add(V(E,{useFirstChild:t}))}),v?.forEach(E=>{if(!E||yt(E))return;const b=E,S=b.sequenceId;b.effects.forEach((I,P)=>{I.effectId||(I.effectId=`eff-${S}-${P}`);let k=I.key;if(!k&&I.effectId){const C=i[I.effectId];C&&(k=C.key)}k=k||f;const O=V(I,{useFirstChild:t});if(O&&a[f].selectors.add(O),k!==f){const C=Re(a,k),M=`${k}::seq::${S}::${d}`;C.sequences[M]||(C.sequences[M]=[],C.interactionIds.add(M)),C.sequences[M].push({...h,sequence:b}),C.selectors.add(O)}})})}),{effects:i,sequences:o,conditions:jt(r),reducedMotionPolicy:n.reducedMotionPolicy,forceReducedMotion:n.forceReducedMotion,interactions:a}}function Me(e,t,n,s,i){const o=w.getPluginsNames();for(const r of o){const a=`${Ke}${r}`;if(!(a in n))continue;const l=n[a];if(l!==null&&typeof l=="object"){if(e._appliedPlugins.has(l))continue;e._appliedPlugins.add(l)}const c=w.getPlugin(r)(l,{root:t,key:s,scope:i,config:n});typeof c=="function"&&e._pluginCleanups.push(c)}}function z(e,t){for(const n of w.getPluginsNames())if(`${Ke}${n}`in t&&!w._isPluginReleased(n,e))return!0;return!1}function Se(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 be(e,t){return t.map(n=>e.selector?n.querySelector(e.selector):n).filter(Boolean)}function _e(e,t,n,s={}){const{effects:i,conditions:o,reducedMotionPolicy:r,forceReducedMotion:a}=t.dataCache,l=zt(e,Te(e.reducedMotionPolicy,s.policy,r),{effects:i,force:a,collapsesStagger:s.collapsesStagger});let u;return l.forEach((c,f)=>{const d=F(c.conditions||[],o);d&&t.setupMediaQueryListener(f?`${n.id}::rm${f}`:n.id,d,n.key,n.onUpdate),!u&&(!d||d.matches)&&(u=c)}),u}function on(e,t,n,s,i,o,r,a){return[r?be(e,r):Se(e,n,s),a?be(t,a):Se(t,i,o)]}function rn(e,t,n,s,i,o,r,a){const l=Array.isArray(s),u=Array.isArray(i);l?s.forEach((c,f)=>{const d=u?i[f]:i;d&&Et(e,c,t.trigger,d,n,t.params,o,r,a)}):(u?i:[i]).forEach(f=>{Et(e,s,t.trigger,f,n,t.params,o,r,a)})}function an(e,t,n,s,i){const o={},r=[];(s.effects||[]).forEach((a,l)=>{const u=a.effectId,c={...n.dataCache.effects[u]||{},...a,effectId:u},f=c.key,d=A(a.interactionId,e);if(o[d]||n.addedInteractions[d]&&!i)return;const m=_e(c,n,{id:`${d}::${l}`,key:e,onUpdate:()=>{t.update()}},{policy:s.reducedMotionPolicy});if(m){o[d]=!0;const p=f&&A(f,e);let h;if(p){if(h=w.getController(p),!h)return;m.listContainer&&h.watchChildList(m.listContainer)}else h=t;if(z(p||s.key,m))return;Me(h,h.element,m,p||s.key,"effect");const[g,v]=on(s,m,t.element,t.useFirstChild,h.element,h.useFirstChild,i);if(!g||!v)return;n.addedInteractions[d]=!0;const y=p||s.key,$=x(m.conditions||[],n.dataCache.conditions);r.push([y,s,m,g,v,$,h.useFirstChild,e])}}),r.reverse().forEach(a=>{rn(...a)}),ao(e,t,n,s,i)}function cn(e,t,n){return Te(e.reducedMotionPolicy,t.reducedMotionPolicy,n.dataCache.reducedMotionPolicy)}function Be(e,t,n){const{forceReducedMotion:s,conditions:i}=n.dataCache,o=F([Ie],i);return(s||!!(o&&o.matches))&&cn(e,t,n)!=="ignore"?{...e,offset:0}:e}function ro(e){return"sequenceId"in e&&!("effects"in e)}function ln(e,t,n,s,i,o,r,a){const l=F(e.conditions||[],o.dataCache.conditions);if(l&&o.setupMediaQueryListener(n,l,r.updateKey,r.onUpdate),l&&!l.matches)return null;const u=e.effects||[],c=h=>{const g=h.effectId;return{...g?o.dataCache.effects[g]||{}:{},...h}};if(u.some(h=>{const g=c(h),v=F(g.conditions||[],o.dataCache.conditions);if(v&&!v.matches)return!1;const y=g.key&&A(g.key,s);return z(y||s,g)}))return null;const d=[],m=cn(e,t,o);let p=!1;for(const h of u){const g=h.effectId,v=_e(c(h),o,{id:`${n}::${g||"eff"}`,key:r.updateKey,onUpdate:r.onUpdate},{policy:m,collapsesStagger:m!=="ignore"});if(!v)continue;const y=v.key,$=y&&A(y,s);let E;if($){if(E=w.getController($),!E)return null}else E=i;const b=$||s;Me(E,E.element,v,b,"effect");let S;if(a&&b===a.controllerKey&&v.listContainer===a.listContainer?(S=be(v,a.elements),S.length>0&&(p=!0)):S=Se(v,E.element,E.useFirstChild),!S||Array.isArray(S)&&S.length===0)return null;const T=N(v);d.push({target:S,options:T})}return a&&!p?null:d.length>0?d:null}function Ye(e,t,n){const s=n?be(e,n):Se(e,t.element,t.useFirstChild);return Array.isArray(s)&&s.length===0?null:s}function Ue(e,t,n,s,i){(Array.isArray(n)?n:[n]).forEach(r=>{W[e.trigger]?.add(r,r,{triggerType:t.triggerType},e.params||{},{selectorCondition:i,animation:s,allowA11yTriggers:w.allowA11yTriggers})})}function un(e,t,n){const o=(e.useFirstChild?e.element.firstElementChild:e.element)?.querySelector(t);if(!o)return n.map((a,l)=>l);const r=Array.from(o.children);return n.map(a=>{const l=r.indexOf(a);return l>=0?l:r.length})}function ao(e,t,n,s,i){s.sequences?.forEach(o=>{let r;if(ro(o)){const p=n.dataCache.sequences[o.sequenceId];if(!p){console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);return}r={...p,...o}}else r=o;const a=r.sequenceId||ne(),l=A(`${e}::seq::${a}`,e);if(n.addedInteractions[l]&&!i)return;const u=i&&s.listContainer?{controllerKey:e,listContainer:s.listContainer,elements:i}:void 0,c=ln(r,s,l,e,t,n,{updateKey:e,onUpdate:()=>t.update()},u);if(!c)return;if(i&&n.addedInteractions[l]){const p=un(t,s.listContainer,i);w.addToSequence(l,c,p);const h=w.getSequence(l,Be(r,s,n),c),g=x(s.conditions||[],n.dataCache.conditions),v=Ye(s,t,i);v&&Ue(s,r,v,h,g);return}const f=w.getSequence(l,Be(r,s,n),c),d=x(s.conditions||[],n.dataCache.conditions),m=Ye(s,t,i);m&&(n.addedInteractions[l]=!0,Ue(s,r,m,f,d))})}function co(e,t,n,s,i){const o=n.get(e)?.sequences||{};Object.keys(o).forEach(a=>{o[a].some(({sequence:u,...c})=>{const f=F(c.conditions||[],n.dataCache.conditions);if(f&&!f.matches)return!1;const d=c.key&&A(c.key,e),m=w.getController(d);if(!m)return!0;const p=u.sequenceId||ne(),h=A(`${d}::seq::${p}`,d);if(n.addedInteractions[h]&&!i||z(d,c))return!0;const v=ln(u,c,h,d,m,n,{updateKey:e,onUpdate:()=>t.update()},i&&s?{controllerKey:e,listContainer:s,elements:i}:void 0);if(!v)return!0;if(i&&n.addedInteractions[h]){const b=un(t,s,i);return w.addToSequence(h,v,b),!0}const y=w.getSequence(h,Be(u,c,n),v),$=x(c.conditions||[],n.dataCache.conditions),E=Ye(c,m);return E&&(n.addedInteractions[h]=!0,Ue(c,u,E,y,$)),!0})})}function fn(e,t,n,s,i){const o=n.get(e),r=o?.effects||{},a=Object.keys(r),l=[];a.forEach(c=>{const f=A(c,e);if(n.addedInteractions[f]&&!i)return;r[c].some(({effect:m,...p},h)=>{const g=F(p.conditions||[],n.dataCache.conditions);if(g&&!g.matches)return!1;const v=m.effectId,y={...n.dataCache.effects[v]||{},...m,effectId:v};if(s&&y.listContainer!==s)return!1;const $=_e(y,n,{id:`${f}::${h}`,key:e,onUpdate:()=>{t.update()}},{policy:p.reducedMotionPolicy});if($){const E=p.key&&A(p.key,e),b=w.getController(E);if(!b||z(E,p)||z(e,$))return!0;Me(t,t.element,$,e,"effect"),$.listContainer&&t.watchChildList($.listContainer);const[S,T]=on(p,$,b.element,b.useFirstChild,t.element,t.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[f]=!0;const I=x($.conditions||[],n.dataCache.conditions);return l.push([e,p,$,S,T,I,t.useFirstChild,E||void 0]),!0}return!1})}),l.reverse().forEach(c=>{rn(...c)}),co(e,t,n,s,i);const u=Object.keys(o?.sequences||{}).length>0;return a.length>0||u}function Et(e,t,n,s,i,o,r,a,l){let u;if(Ft(i)){const f={key:e,effectId:i.effectId,transition:i.transition,transitionProperties:i.transitionProperties,childSelector:V(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:a}),selectorCondition:r};if(u=w.getController(e),!u)return;u.renderStyle(ms(f))}let c;if(n==="animationEnd"){const f=o.effectId,d=l?w.getInstance(l):void 0,m=d?.dataCache.effects[f],p=m&&_e(m,d,{id:`${l}::animationEnd::${f}`,key:l,onUpdate:()=>{w.getController(l)?.update()}});p&&(c=N(p))}W[n]?.add(t,s,i,o,{targetController:u,selectorCondition:r,allowA11yTriggers:w.allowA11yTriggers,sourceAnimationOptions:c})}function wt(e){const t=e.key,n=w.getInstance(t);if(!n)return w.setController(t,e),!1;const{triggers:s=[]}=n?.get(t)||{},i=s.length>0;n.setController(t,e),s.forEach((r,a)=>{const l=F(r.conditions,n.dataCache.conditions);if(l){const u=`${t}::trigger::${a}`;n.setupMediaQueryListener(u,l,t,()=>{e.update()})}if(!l||l.matches){if(z(t,r))return;Me(e,e.element,r,t,"interaction"),r.listContainer&&e.watchChildList(r.listContainer),an(t,e,n,r)}});let o=!1;return n&&(o=fn(t,e,n)),i||o}function lo(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 l=F(r.conditions,i.dataCache.conditions);if(l){const u=`${s}::listTrigger::${t}::${a}`;i.setupMediaQueryListener(u,l,s,()=>{e.update()})}if(!l||l.matches){if(z(s,r))return;an(s,e,i,r,n)}}),fn(s,e,i,t,n)}}function uo(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],dn(o),s.deleteController(n,t)}function dn(e){const t=Object.values(W);for(const n of e)for(const s of t)s.remove(n);w.removeFromSequences(e)}const Le="interactEffect";class hn{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=wt(this)}disconnect({removeFromCache:t=!1}={}){if((this.key||this.element.dataset.interactKey)&&uo(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()}resume(){this.connected&&wt(this)}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
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[Le]?.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[Le]=Array.from(o).join(" ")}getActiveEffects(){const n=(this.element.dataset[Le]||"").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)})}),dn(i),s&&lo(this,t,o)}}function fo(e,t){new hn(e,t).connect()}function ho(e){const t=w.getController(e);t&&t.disconnect({removeFromCache:!0})}exports.I=hn;exports.a=w;exports.b=fo;exports.g=Bs;exports.r=ho;
29
- //# sourceMappingURL=index-CeIuoLxG.js.map
29
+ //# sourceMappingURL=index-OM5ScKV3.js.map