5 lines
40 KiB
JavaScript
5 lines
40 KiB
JavaScript
|
|
import{b as gt,d as Jt,N as Re,s as ke,e as Qt,f as qt,m as en,r as Z,h as tn,n as nn,j as w,k as I,t as Xe,l as yt,o as bt,M as re,p as wt,q as sn,u as vt,v as $,w as At,x as we,y as rn,z as St,A as _,B as W,C as D,J as on,D as oe,E as B,F as an,G as cn,H as un,I as Pe,K as pe,L as ln,O as fn,P as dn,a as mn,c as pn,Q as h,R as xt,S as hn,T as Vt,U as gn,V as S,W as De,X as Ye,Y as he,Z as yn,_ as bn,$ as wn,a0 as Et,a1 as Tt,a2 as Ct,a3 as vn,a4 as An,a5 as Sn,a6 as Mt,a7 as Ot,a8 as xn,a9 as Vn,aa as En,ab as fe,ac as Tn,ad as Cn,ae as Mn,af as It,ag as On,ah as In,ai as Rn,aj as Rt,ak as ae,al as xe,am as Pn,an as Dn,ao as _e,ap as Ln,aq as Wn,ar as de,as as Bn,at as jn,au as Fn,av as Pt}from"./index-BOPTKBra.js";import{aw as Lo,bg as Wo,bt as Bo,aT as jo,bu as Fo,aR as zo,az as Ho,aA as $o,bi as Ko,ax as Go,ay as No,b1 as Uo,aS as ko,aJ as Xo,bz as Yo,aC as _o,aD as Zo,aO as Jo,aX as Qo,cc as qo,c5 as ea,bh as ta,b3 as na,b4 as sa,b5 as ra,b6 as oa,aP as aa,br as ia,aE as ca,bC as ua,b7 as la,b8 as fa,b9 as da,b$ as ma,c6 as pa,bw as ha,bB as ga,ba as ya,bx as ba,bp as wa,bL as va,c9 as Aa,cf as Sa,aU as xa,c7 as Va,aV as Ea,aW as Ta,bb as Ca,bc as Ma,bd as Oa,aF as Ia,c8 as Ra,cm as Pa,bv as Da,cn as La,bA as Wa,cl as Ba,ca as ja,bT as Fa,bj as za,c0 as Ha,bH as $a,c1 as Ka,c2 as Ga,bo as Na,bY as Ua,aG as ka,bl as Xa,bm as Ya,bE as _a,bF as Za,bJ as Ja,aZ as Qa,a_ as qa,bK as ei,aN as ti,a$ as ni,bq as si,aB as ri,bn as oi,bs as ai,b2 as ii,be as ci,bQ as ui,bU as li,bR as fi,bV as di,bX as mi,bS as pi,bW as hi,bZ as gi,cd as yi,aQ as bi,bk as wi,bM as vi,cg as Ai,b0 as Si,bP as xi,bI as Vi,ch as Ei,bN as Ti,aK as Ci,bf as Mi,c3 as Oi,c4 as Ii,ce as Ri,bG as Pi,bO as Di,by as Li,b_ as Wi,ck as Bi,bD as ji,cb as Fi,aH as zi,aL as Hi,aM as $i,aI as Ki,ci as Gi,cj as Ni,aY as Ui}from"./index-BOPTKBra.js";import{d as zn}from"./features-animation-dlBJ5TCC.js";function Hn(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}const Ve=new Set;function $r(e){return Ve.has(e)}function Kr(e,t,n){e||Ve.has(t)||(console.warn(Hn(t,n)),Ve.add(t))}const Dt=(e,t,n)=>{const s=t-e;return((n-e)%s+s)%s+e};function Gr(e,t="end"){return n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const s=n*e,r=t==="end"?Math.floor(s):Math.ceil(s);return gt(0,1,r/e)}}function Lt(e,t){return Jt(e)?e[Dt(0,e.length,t)]:e}class Ee{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t){const n=this.animations.map(s=>s.attachTimeline(t));return()=>{n.forEach((s,r)=>{s&&s(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ze(this.animations,"duration")}get iterationDuration(){return Ze(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Ze(e,t){let n=0;for(let s=0;s<e.length;s++){const r=e[s][t];r!==null&&r>n&&(n=r)}return n}class Wt extends Ee{then(t,n){return this.finished.finally(t).then(()=>{})}}class Je extends Re{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Qe=new WeakMap,$n=(e,t="")=>`${e}:${t}`;function Kn(e){const t=Qe.get(e)||new Map;return Qe.set(e,t),t}const Gn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom"
|
||
|
|
`;for(const[s,r]of Object.entries(n))e+=` ${s}: ${r};
|
||
|
|
`;e+=`}
|
||
|
|
`}M.textContent=e,document.head.appendChild(M),ee={}},remove:()=>{M&&M.parentElement&&M.parentElement.removeChild(M)}};function gs(e){const t=e.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function ys(e){const{effect:t}=e;return t?t.target===document.documentElement&&t.pseudoElement?.startsWith("::view-transition"):!1}function bs(){return document.getAnimations().filter(ys)}function ws(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}const vs=["layout","enter","exit","new","old"];function As(e){const{update:t,targets:n,options:s}=e;if(!document.startViewTransition)return new Promise(async o=>{await t(),o(new Ee([]))});ws("root",n)||te.set(":root",{"view-transition-name":"none"}),te.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),te.commit();const r=document.startViewTransition(async()=>{await t()});return r.finished.finally(()=>{te.remove()}),new Promise(o=>{r.ready.then(()=>{const a=bs(),c=[];n.forEach((i,u)=>{for(const l of vs){if(!i[l])continue;const{keyframes:f,options:d}=i[l];for(let[m,p]of Object.entries(f)){if(!p)continue;const g={...oe(s,m),...oe(d,m)},y=hs(l);m==="opacity"&&!Array.isArray(p)&&(p=[y==="new"?0:1,p]),typeof g.delay=="function"&&(g.delay=g.delay(0,1)),g.duration&&(g.duration=B(g.duration)),g.delay&&(g.delay=B(g.delay));const b=new Re({...g,element:document.documentElement,name:m,pseudoElement:`::view-transition-${y}(${u})`,keyframes:p});c.push(b)}}});for(const i of a){if(i.playState==="finished")continue;const{effect:u}=i;if(!u||!(u instanceof KeyframeEffect))continue;const{pseudoElement:l}=u;if(!l)continue;const f=gs(l);if(!f)continue;const d=n.get(f.layer);if(d)nt(d,"enter")&&nt(d,"exit")&&u.getKeyframes().some(m=>m.mixBlendMode)?c.push(new Je(i)):i.cancel();else{const m=f.type==="group"?"layout":"";let p={...oe(s,m)};p.duration&&(p.duration=B(p.duration)),p=an(p);const g=cn(p.ease,p.duration);u.updateTiming({delay:B(p.delay??0),duration:p.duration,easing:g}),c.push(new Je(i))}}o(new Ee(c))})})}function nt(e,t){return e?.[t]?.keyframes.opacity}let O=[],je=null;function $t(){je=null;const[e]=O;e&&Ss(e)}function Ss(e){Pe(O,e),je=e,As(e).then(t=>{e.notifyReady(t),t.finished.finally($t)})}function xs(){for(let e=O.length-1;e>=0;e--){const t=O[e],{interrupt:n}=t.options;if(n==="immediate"){const s=O.slice(0,e+1).map(o=>o.update),r=O.slice(e+1);t.update=()=>{s.forEach(o=>o())},O=[t,...r];break}}(!je||O[0]?.options.interrupt==="immediate")&&$t()}function Vs(e){O.push(e),un.render(xs)}class Es{constructor(t,n={}){this.currentSubject="root",this.targets=new Map,this.notifyReady=pe,this.readyPromise=new Promise(s=>{this.notifyReady=s}),this.update=t,this.options={interrupt:"wait",...n},Vs(this)}get(t){return this.currentSubject=t,this}layout(t,n){return this.updateTarget("layout",t,n),this}new(t,n){return this.updateTarget("new",t,n),this}old(t,n){return this.updateTarget("old",t,n),this}enter(t,n){return this.updateTarget("enter",t,n),this}exit(t,n){return this.updateTarget("exit",t,n),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,n,s={}){const{currentSubject:r,targets:o}=this;o.has(r)||o.set(r,{});const a=o.get(r);a[t]={keyframes:n,options:s}}then(t,n){return this.readyPromise.then(t,n)}}function qr(e,t={}){return new Es(e,t)}const eo=w,to=ln.reduce((e,t)=>(e[t]=n=>I(n),e),{}),no={...zn,...dn,...fn},so={renderer:pn,...mn};function Ts(e,t,n){h.useInsertionEffect(()=>e.on(t,n),[e,t,n])}const Cs=50,st=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Ms=()=>({time:0,x:st(),y:st()}),Os={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function rt(e,t,n,s){const r=n[t],{length:o,position:a}=Os[t],c=r.current,i=n.time;r.current=e[`scroll${a}`],r.scrollLength=e[`scroll${o}`]-e[`client${o}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=xt(0,r.scrollLength,r.current);const u=s-i;r.v
|