@bitkyc08/opencodex 2.100.1 → 2.100.2
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.
- package/gui/dist/assets/App-BpJOzw4F.js +59 -0
- package/gui/dist/assets/Tray-BcaI-VCr.js +1 -0
- package/gui/dist/assets/{brand-mark-nr3ziR-T.js → brand-mark-DU-0Vdkr.js} +1 -1
- package/gui/dist/assets/index-Bbor_y80.js +94 -0
- package/gui/dist/assets/index-DJEkIDAi.css +2 -0
- package/gui/dist/assets/{segment-thumb-features-DKCVUUTi.js → segment-thumb-features-e9A_FogJ.js} +1 -1
- package/gui/dist/classic/assets/{App-CgPBKUP-.js → App-BrIlUiLc.js} +18 -18
- package/gui/dist/classic/assets/{Tray-BedmOsE7.js → Tray-DT146AhS.js} +1 -1
- package/gui/dist/classic/assets/index-DyJHagvT.js +94 -0
- package/gui/dist/classic/assets/quota-summary-CakPe9Ni.js +1 -0
- package/gui/dist/classic/index.html +1 -1
- package/gui/dist/index.html +2 -2
- package/package.json +2 -2
- package/src/adapters/client-fingerprint.ts +5 -3
- package/src/adapters/cursor/native-exec.ts +3 -2
- package/src/adapters/cursor/tool-guidance.ts +3 -3
- package/src/adapters/cursor/tool-wording.ts +10 -1
- package/src/adapters/devin/cloud-direct/tool-schema.ts +20 -2
- package/src/adapters/google-antigravity-wire.ts +13 -6
- package/src/adapters/google-truncation.ts +4 -2
- package/src/adapters/google.ts +8 -2
- package/src/adapters/openai-chat/tool-schema.ts +9 -0
- package/src/adapters/openai-responses/tool-schema.ts +18 -4
- package/src/adapters/run-turn-queue.ts +139 -5
- package/src/adapters/upstream-http-error.ts +4 -2
- package/src/bridge/sse.ts +8 -1
- package/src/claude/chat-tool-dispatch.ts +233 -0
- package/src/claude/inbound-tool-loading.ts +42 -17
- package/src/cli/account-api.ts +6 -0
- package/src/cli/account-extended.ts +60 -6
- package/src/cli/account-key-quota.ts +22 -2
- package/src/cli/account.ts +1 -1
- package/src/cli/capabilities-access-remote.ts +10 -0
- package/src/cli/capabilities-agents-routing.ts +2 -2
- package/src/cli/capabilities-base.ts +2 -2
- package/src/cli/claude.ts +19 -14
- package/src/cli/config-command.ts +24 -1
- package/src/cli/connect.ts +36 -3
- package/src/cli/gui-pair-client.ts +23 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/hub.ts +18 -1
- package/src/cli/link-child-ops.ts +136 -0
- package/src/cli/link-status-child.ts +94 -0
- package/src/cli/link.ts +22 -9
- package/src/cli/registry.ts +3 -2
- package/src/cli/sync-command.ts +3 -1
- package/src/cli/sync-fanout.ts +8 -81
- package/src/client/link-readiness.ts +16 -6
- package/src/client/link-tunnel-status.ts +76 -0
- package/src/clients/config-export.ts +14 -1
- package/src/codex/account-resume-health.ts +41 -0
- package/src/codex/auth-api/login-flow.ts +6 -0
- package/src/codex/auth-api/routes.ts +35 -2
- package/src/codex/catalog/gather-capture.ts +2 -0
- package/src/codex/catalog/provider-models.ts +13 -8
- package/src/codex/convergence-types.ts +2 -0
- package/src/codex/quota.ts +111 -6
- package/src/combos/cooldown-store.ts +208 -0
- package/src/combos/failover.ts +432 -35
- package/src/config/salvage.ts +1 -0
- package/src/config/schema/config-schema.ts +6 -3
- package/src/config/schema/leaf-validators.ts +34 -12
- package/src/generated/compatibility-version.json +213 -121
- package/src/lib/catalog-etag.ts +10 -0
- package/src/lib/client-error-body.ts +15 -0
- package/src/lib/context-overflow-verdict.ts +266 -9
- package/src/lib/failure-detail.ts +72 -3
- package/src/lib/hard-refusal.ts +259 -0
- package/src/link/child-activity.ts +57 -0
- package/src/link/child-catalog-freshness.ts +149 -0
- package/src/link/child-gated-ocx.ts +117 -0
- package/src/link/child-observations.ts +205 -0
- package/src/link/child-observe.ts +121 -0
- package/src/link/child-ops-engine.ts +162 -0
- package/src/link/child-update-contract.ts +165 -0
- package/src/link/paths.ts +5 -0
- package/src/link/remote-windows.ts +42 -6
- package/src/link/ssh-argv.ts +126 -32
- package/src/link/status-projection.ts +73 -0
- package/src/link/sync-fanout-classify.ts +98 -0
- package/src/link/tunnel-state.ts +10 -4
- package/src/messaging/mcp-queue-rpc.ts +2 -1
- package/src/messaging/mcp-queue-server.ts +5 -0
- package/src/messaging/mcp-reply-tools.ts +24 -9
- package/src/messaging/mcp-reply-wait.ts +70 -0
- package/src/oauth/account-resume-health.ts +60 -0
- package/src/oauth/index.ts +1 -0
- package/src/oauth/store.ts +44 -1
- package/src/providers/api-key-pause-state.ts +23 -0
- package/src/providers/api-key-pause.ts +68 -10
- package/src/providers/api-key-selection-capture.ts +3 -1
- package/src/providers/api-key-selection.ts +3 -2
- package/src/providers/api-keys.ts +18 -5
- package/src/providers/claude-cli-usage-state.ts +11 -6
- package/src/providers/claude-cli-usage.ts +27 -9
- package/src/providers/codex-capacity.ts +11 -2
- package/src/providers/key-failover.ts +13 -6
- package/src/providers/model-discovery-config.ts +31 -0
- package/src/providers/model-discovery-diagnostic.ts +34 -3
- package/src/providers/model-discovery.ts +43 -7
- package/src/providers/model-rename-fields.ts +2 -0
- package/src/providers/openai-sidecar.ts +15 -2
- package/src/providers/provider-id-rewrite.ts +3 -0
- package/src/providers/quota/account-cache.ts +52 -34
- package/src/providers/quota/anthropic-usage-windows.ts +19 -9
- package/src/providers/quota/report-cache.ts +53 -5
- package/src/providers/quota/vendor-probes-key.ts +73 -0
- package/src/providers/quota/vendor-probes-oauth.ts +57 -3
- package/src/providers/quota-key-accounts.ts +12 -5
- package/src/providers/quota-mistral-budget.ts +18 -0
- package/src/providers/quota-types.ts +25 -0
- package/src/providers/quota.ts +22 -22
- package/src/providers/reasoning-metadata.ts +1051 -12
- package/src/quota/reset-observer.ts +4 -2
- package/src/quota/reset-seen-store.ts +9 -0
- package/src/quota/window-mapping.ts +1 -0
- package/src/quota-pool/assemble.ts +4 -1
- package/src/responses/hosted-tool-policy.ts +56 -12
- package/src/router.ts +2 -0
- package/src/server/auth-cors.ts +11 -8
- package/src/server/catalog-download.ts +3 -5
- package/src/server/chat-native.ts +11 -2
- package/src/server/claude-messages.ts +2 -1
- package/src/server/images.ts +41 -13
- package/src/server/index/link-listener.ts +16 -2
- package/src/server/index/link-relay-sessions.ts +43 -2
- package/src/server/index/optional-listeners.ts +18 -0
- package/src/server/management/config-routes.ts +7 -1
- package/src/server/management/context.ts +1 -1
- package/src/server/management/link-child-ops-routes.ts +116 -0
- package/src/server/management/link-route-state.ts +10 -0
- package/src/server/management/link-routes.ts +10 -0
- package/src/server/management/oauth-account-routes.ts +33 -4
- package/src/server/management/provider-overwrite-carry.ts +28 -3
- package/src/server/management/provider-routes.ts +16 -11
- package/src/server/management/route-registry.ts +3 -0
- package/src/server/messages-native.ts +5 -0
- package/src/server/request-log-failure-detail.ts +59 -1
- package/src/server/responses/adapter-dispatch.ts +35 -44
- package/src/server/responses/combo-stream-preflight.ts +146 -29
- package/src/server/responses/compact.ts +16 -5
- package/src/server/responses/context-overflow.ts +58 -2
- package/src/server/responses/core-combo-failure.ts +29 -4
- package/src/server/responses/core-combo-native.ts +3 -1
- package/src/server/responses/core-combo.ts +30 -3
- package/src/server/responses/core-errors.ts +3 -1
- package/src/server/responses/core-opaque-recovery.ts +45 -2
- package/src/server/responses/core-options.ts +12 -0
- package/src/server/responses/passthrough-dispatch.ts +30 -38
- package/src/server/responses/request-transport.ts +43 -14
- package/src/server/responses/reset-replay.ts +58 -2
- package/src/server/responses/run-turn-execution.ts +56 -30
- package/src/types/claude-tool-loading.ts +48 -0
- package/src/types/config.ts +5 -35
- package/src/types/provider.ts +21 -0
- package/src/types.ts +1 -0
- package/src/web-search/parse.ts +21 -2
- package/gui/dist/assets/App-g3Cm2xhZ.js +0 -59
- package/gui/dist/assets/Tray-BMDkAiXy.js +0 -1
- package/gui/dist/assets/index-Bziu8gTy.css +0 -2
- package/gui/dist/assets/index-OYzhQUNP.js +0 -94
- package/gui/dist/classic/assets/index-BR-HhNrp.js +0 -94
- package/gui/dist/classic/assets/quota-summary-CXKhvSmQ.js +0 -1
package/gui/dist/assets/{segment-thumb-features-DKCVUUTi.js → segment-thumb-features-e9A_FogJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as e,Z as t,r as n}from"./index-OYzhQUNP.js";import{$ as r,A as i,At as a,B as o,C as s,Ct as c,D as l,Dt as u,E as d,Et as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,Ot as C,P as ee,Q as w,R as T,S as E,St as te,T as ne,Tt as re,U as ie,V as ae,W as D,X as O,Y as k,Z as oe,_ as se,_t as A,a as ce,at as le,b as ue,bt as j,c as de,ct as fe,d as pe,dt as me,et as he,f as M,ft as ge,g as _e,gt as N,h as ve,ht as ye,i as be,it as xe,j as Se,jt as Ce,k as we,kt as Te,l as Ee,lt as De,m as Oe,mt as ke,n as Ae,nt as je,o as Me,ot as Ne,p as P,pt as Pe,q as Fe,r as Ie,rt as Le,s as Re,st as ze,tt as Be,u as Ve,ut as He,v as Ue,vt as We,w as Ge,wt as Ke,x as qe,xt as F,y as Je,yt as Ye,z as Xe}from"./App-g3Cm2xhZ.js";var Ze=e=>typeof e==`object`&&!!e,I=(...e)=>e.reduce((e,t)=>n=>t(e(n))),L=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Qe=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function $e(e,t,n,r){return e===t&&n===r?c:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Qe(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Qe(s+1e-7,e,n)-i-r)}return Qe(s,t,r)}}var et=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tt=e=>t=>1-e(1-t),nt=$e(.33,1.53,.69,.99),rt=tt(nt),it=et(rt),at=e=>e>=1?1:(e*=2)<1?.5*rt(e):.5*(2-2**(-10*(e-1))),ot=e=>1-Math.sin(Math.acos(e)),st=tt(ot),ct=et(ot),lt=$e(.42,0,1,1),ut=$e(0,0,.58,1),dt=$e(.42,0,.58,1),ft=e=>Array.isArray(e)&&typeof e[0]!=`number`,pt={linear:c,easeIn:lt,easeInOut:dt,easeOut:ut,circIn:ot,circInOut:ct,circOut:st,backIn:rt,backInOut:it,backOut:nt,anticipate:at},mt=e=>typeof e==`string`,ht=e=>{if(We(e)){let[t,n,r,i]=e;return $e(t,n,r,i)}return mt(e)?pt[e]:e};function gt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _t({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=gt(s,r,e+1/3),a=gt(s,r,e),o=gt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function vt(e,t){return n=>n>0?t:e}var R=(e,t,n)=>e+(t-e)*n,yt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},bt=[De,He,Le],xt=e=>bt.find(t=>t.test(e));function St(e){let t=xt(e);if(!t)return!1;let n=t.parse(e);return t===Le&&(n=_t(n)),n}var Ct=(e,t)=>{let n=St(e),r=St(t);if(!n||!r)return vt(e,t);let i={...n};return e=>(i.red=yt(n.red,r.red,e),i.green=yt(n.green,r.green,e),i.blue=yt(n.blue,r.blue,e),i.alpha=R(n.alpha,r.alpha,e),He.transform(i))},wt=new Set([`none`,`hidden`]);function Tt(e,t){return wt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Et(e,t){return n=>R(e,t,n)}function Dt(e){return typeof e==`number`?Et:typeof e==`string`?ke(e)?vt:je.test(e)?Ct:jt:Array.isArray(e)?Ot:typeof e==`object`?je.test(e)?Ct:kt:vt}function Ot(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Dt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function kt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Dt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function At(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var jt=(e,t)=>{let n=w(e),i=w(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?wt.has(e)&&!i.values.length||wt.has(t)&&!n.values.length?Tt(e,t):I(Ot(At(n,i),i.values),r(i)):vt(e,t)},Mt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Nt(e,t){let n=Mt.exec(e);if(!n)return;let r=Mt.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>ye(R(a,o,e))+i}function Pt(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return R(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Nt(e,t);if(n)return n}return Dt(e)(e,t)}var Ft=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>O.update(t,e),stop:()=>k(t),now:()=>A.isProcessing?A.timestamp:N.now()}},It=2e4;function Lt(e,t=50,n=It,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Rt(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Lt(o),It);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:j(s)}}var zt=100,Bt=10,Vt=1,Ht=800,Ut=.3,Wt=.3,Gt=.01,Kt=2,qt=.005,Jt=.5,Yt=.01,Xt=10,Zt=.05,Qt=e=>e<0?1/Math.max(1+e,Zt):Math.max(1-e,Zt);function $t(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return nn(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function en(e,t){return e*Math.sqrt(1-t*t)}var tn=12;function nn(e,t,n){let r=n;for(let n=1;n<tn;n++)r-=e(r)/t(r);return r}var rn=.001;function an({duration:e=Ht,bounce:t=Ut}){let n,r,i=Qt(t);e=u(Yt,Xt,j(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=en(t,i),o=Math.exp(-r);return rn-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=en(t*t,i);return(-n(t)+rn>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=nn(n,r,a),s=o*$t(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:F(e)}}var on=(e,t)=>(t?e>=0:e>0)&&e<1/0;function sn(e,t){if(on(e,t))return e}function cn(e){let t=sn(e.stiffness),n=sn(e.damping,!0),r=sn(e.mass),i={...e,stiffness:t??zt,damping:n??Bt,mass:r??Vt,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Qt(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*$t(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,an(i)),i.isResolvedFromDuration=!0;(!on(i.stiffness)||!on(i.damping,!0))&&(i.stiffness=zt,i.damping=Bt)}return i}function ln(e=Wt,t=Ut){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=cn({...n}),f=e=>d?0:-j(e),p=s/(2*Math.sqrt(o*c)),m=j(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},v=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Gt:Kt),g.restDelta=n.restDelta||(e?qt:Jt)};v();let y,b,x;if(p<1){let e=en(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};x=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};y=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),b=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){y=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};x=()=>{e.C=g.velocity+m*g.delta},b=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};x=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},y=e=>g.target-a.S*i(t,e)-a.F*i(n,e),b=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}x();let S=u&&l||null,C={calculatedDuration:S,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||v(),C.calculatedDuration=S,a.done=!1,x()},velocity:e=>F(b(e)),next:e=>{let t=y(e);if(u)a.done=e>=l;else{let n=F(b(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Lt(C),It),t=_(t=>C.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return C}var un=Object.assign(ln,{applyToOptions:e=>{let t=Rt(e,100,ln);return e.ease=t.ease,e.duration=F(t.duration),e.type=`keyframes`,e}});function dn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=un({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function fn(e,t,n){let r=[],i=f.mix||Pt,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=I(Array.isArray(t)?t[o]||c:t,a)),r.push(a)}return r}function pn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=fn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=L(e[r],e[r+1],n);return s[r](i)};return n?t=>l(u(e[0],e[a-1],t)):l}function mn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=L(0,t,r);e.push(R(n,1,i))}}function hn(e){let t=[0];return mn(t,e.length-1),t}function gn(e,t){return e.map(e=>e*t)}function _n(e,t){return e.map(()=>t||dt).splice(0,e.length-1)}function z({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=ft(r)?r.map(ht):ht(r)||dt,s={done:!1,value:t[0]};if(!a&&t.length===2&&!Array.isArray(o)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,i=n===r?void 0:(f.mix||Pt)(n,r);return{calculatedDuration:e,next:t=>(s.value=i?i(o(e>0?u(0,1,t/e):1)):r,s.done=t>=e,s)}}let c=pn(gn(n&&n.length===t.length?n:hn(t),e),t,{ease:Array.isArray(o)?o:_n(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=c(t),s.done=t>=e,s)}}var vn=5;function yn(e,t,n){let r=Math.max(t-vn,0);return Ye(n-e(r),t-r)}function bn(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):yn(t=>e.next(t).value,t,e.next(t).value)}var xn={decay:dn,inertia:dn,tween:z,keyframes:z,spring:un};function Sn(e){typeof e.type==`string`&&(e.type=xn[e.type])}var Cn=40,wn=(e,t)=>t-e>Cn&&!f.useManualTiming?t:e,Tn=e=>e/100,En=e=>Math.round(e*1e4)/1e4,Dn=class extends D{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),m(this,this.options)}initAnimation(){let{options:e}=this;Sn(e);let{type:t=z,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||z;this.mixKeyframes=void 0,s!==z&&typeof o[0]!=`number`&&(this.mixKeyframes=I(Tn,e.mixer?.(o[0],o[1])||Pt(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Lt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=wn(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==dn&&(f.value=Fe(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??En((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==dn?Fe(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:d}=this.options,f=e,p=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,d&&(i-=d/o)):l===`mirror`&&(p=a)),f=u(0,1,i)*o}let m;return t?(this.delayState.value=s[0],m=this.delayState):m=p.next(f),i&&!t&&(m.value=i(m.value)),m}get duration(){return j(this.calculatedDuration)}get iterationDuration(){return this.duration+j(this.options.delay??0)}get time(){return j(this.currentTime)}set time(e){e=F(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return bn(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=j(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ft,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},On={anticipate:at,backInOut:it,circInOut:ct};function kn(e){return e in On}function An(e){typeof e.ease==`string`&&kn(e.ease)&&(e.ease=On[e.ease])}var jn=class extends S{constructor(e){An(e),Sn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(N.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new Dn({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?u(0,10,a):0,s=this.sample(a);n&&r&&x(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},Mn=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(he.test(e)||e===`0`)&&!e.startsWith(`url(`));function Nn(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Pn(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Mn(i,t),s=Mn(a,t);return!o||!s?!1:Nn(e)||(n===`spring`||we(n))&&r}function Fn(e){e.duration=0,e.type=`keyframes`}var In=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Ln(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&In.test(e[t]))return!0;return!1}var Rn=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),zn=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Bn=()=>!f.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Vn(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(l.has(n)||zn.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:d}=t.owner.getProps();return Bn()&&(l.has(n)||zn.has(n)&&Ln(s))&&(n!==`transform`||!d)&&!u&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!Rn(e)}var Hn=200,Un=.001,Wn=.1,Gn=.001,Kn=100,qn=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Jn=(e,t)=>Math.abs(e-t)<=Un,Yn=(e,t)=>e-t,Xn=(e,t,n)=>hn(Array(n+1)).map(n=>R(e,t,n)),Zn=e=>e.motionValue.owner,Qn=e=>Ge.get(e),$n=({state:e})=>e===`idle`||e===`finished`,B=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),er=({name:e,motionValue:t})=>e&&T.includes(e)&&t?.owner?.current instanceof HTMLElement&&Bn()&&b();function tr(e){let t=Zn(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(B(t,`transform`)||`none`)===`none`&&!B(t,`pathRotation`)&&!t.projection?.isProjecting()&&!Rn(e)}var nr=class extends Dn{constructor(e){let t=Zn(e).current,{driver:n=Ft}=e,r,i=tr(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Qn(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Qn(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Qn(Zn(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(N.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:a,delay:o=0}=this.options,s=We(n)?Se(n):qn(n)&&i[n];if(s&&!a&&!r&&e.length===2&&t===z&&this.holdTime===null){let e=this.startTime+o/this.speed;return[e,e+this.resolvedDuration/this.speed,s]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||z)===z?u||hn(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=N.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||rr(Zn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(N.now())}get time(){return this.isAccelerated()?j(u(0,this.totalDuration,this.at(N.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function rr(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,f=!1,p=-1/0,m=e=>{for(let t of n)if(t.name===e)return!0},h=(t,n)=>{let o={};for(let s of t===void 0?T:a){let a=r.get(s),c=t===void 0?B(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},g=(e,t)=>{let n=``;for(let r in e){let i=e[r];(!t||!ne(r,i))&&(n+=d(r,i)+` `)}return(t?n.trim():n)||`none`},_=(e,t)=>g(h(e,t)),v=(e=h())=>{t.style.transform=g(e,!0)},y=(e=!0)=>{e&&v(),s.forEach(({animation:e})=>e.cancel()),s=[]},b=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),x=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=N.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),D.schedule(!1)}),e.oncancel=()=>s.includes(r)&&D.demote(),s.push(r)},S=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},C=(e,t,n,r)=>{let i=Math.min(Hn,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Xn(t,n,i).concat(r).sort(Yn),o=e=>L(t,n,e),s,c;for(let n of e){let e=n.numberAt(t),r=a.map(t=>n.numberAt(t)-e),i=r[r.length-1],o=r.some(e=>Math.abs(e)*Un>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(o&&!s)s=l,c=t=>(n.numberAt(t)-e)/o;else if(l.some((e,t)=>!Jn(e,o&&s[t])))return}if(!s||s.every((e,t)=>Jn(e,o(a[t]))))return`linear`;let l=[],u=(e,t=c(e))=>l.push(En(t)+` `+En(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&S(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},ee=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?Gn:Wn))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...S(e=>r.numberAt(e),t,n));i.push(n)}},s=Xn(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Yn))e>c&&o(c,e,0),c=e;return i.sort(Yn)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},E=(e,t,n,r,i={fill:`both`},a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=r||C(e,t,n,o),c=s?[t,n]:ee(e,t,n,o),l=c.map(e=>_(e,a)),u={transform:l};return s||(u.offset=c.map(e=>L(t,n,e))),l.every(e=>e===l[0])&&(v(h(t,a)),u=null),b(u,{...i,duration:n-t,easing:s||`linear`})},te=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=T.filter(t=>{if(r.has(t))return!0;let n=i[t]=B(e,t);return n!==void 0&&!ne(t,n)}),y(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;x(E(d,e,n,r),e-t,n-e)}else c>t&&(x(E(d,t,c),0,c-t),p.forEach(e=>e<c-1&&x(b(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;x(E(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||y(),!0},re=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},ie=()=>!n.size&&(u=!0,Qn(t)===D&&Ge.delete(t),D.isJS||y(),!0),ae=()=>{let t=N.now();if(D.isJS||(D.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=B(e,n.name),o.has(n)||(c=!0))}),D.isFinishing=!1),l=!1,u||(n.forEach(e=>$n(e)&&n.delete(e)),ie()))return;for(let e of n)if(!e.canAccelerate)return D.demote(!0);D.isJS&&(D.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=f;if(c=f=!1,r||!re(t)){if(a){if(t-p<Kn)return D.demote();p=t}if(!te(t))return D.demote()}},D={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,f||=!!t,l||(l=!0,A.isProcessing?O.render(ae,!1,!0):queueMicrotask(ae)))},release(e){$n(e)&&n.delete(e),ie()||D.schedule(!0)},check(){if(!D.isJS){for(let t in i)if(B(e,t)!==i[t]&&!m(t))return D.schedule(!0,!0)}},demote(e){if(!(D.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),D.isJS=!0,o=new Map,y(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Ge.set(t,D),D}var ir=class extends D{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||ee;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=N.now();let u=Pn(e,i,a,o);u||((f.instantAnimations||!s)&&l?.(Fe(e,n,t)),e[0]=e[e.length-1],Fn(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let p=u&&!c&&Vn(n),m=!p&&er(n);r&&(p||m||this.resolvedAt!==this.createdAt)&&(n.startTime??=wn(this.createdAt,this.resolvedAt));let h;if(p){n.element=n.motionValue?.owner?.current;try{h=new jn(n)}catch{h=new Dn(n)}}else h=m?new nr(n):new Dn(n);this.pendingTimeline&&=(this.stopTimeline=h.attachTimeline(this.pendingTimeline),void 0),this._animation=h}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),p()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}};function ar(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function or(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function sr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:or(n,e)}var cr={type:`spring`,stiffness:500,damping:25,restSpeed:10},lr=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ur={type:`keyframes`,duration:.8},dr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},fr=(e,{keyframes:t})=>t.length>2?ur:Xe.has(e)?e.startsWith(`scale`)?lr(t[1]):cr:dr,pr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function mr(e){for(let t in e)if(!pr.has(t))return!0;return!1}var hr=(e,t,n,r={},i,a)=>o=>{let s=sr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=F(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};mr(s)||Object.assign(u,fr(e,u)),u.duration&&=F(u.duration),u.repeatDelay&&=F(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Fn(u),u.delay===0&&(d=!0)),(f.instantAnimations||f.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Fn(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Fe(u.keyframes,s);if(e!==void 0){O.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Dn(u):new ir(u)},gr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _r(e){let t=gr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function vr(e,t,n=1){let[r,i]=_r(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return re(e)?parseFloat(e):e}return ke(i)?vr(i,t,n+1):i}function V(e,t,n){return E(e.getProps(),t,n,e)}var yr=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,br=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...T]),xr=e=>Array.isArray(e);function Sr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,s(n))}function Cr(e){return xr(e)?e[e.length-1]||0:e}function wr(e,t){let{transitionEnd:n={},transition:r={},...i}=V(e,t)||{};i={...i,...n};for(let t in i)Sr(e,t,Cr(i[t]))}function Tr(e){return!!(qe(e)&&e.add)}function Er(e,t){let n=e.getValue(`willChange`);if(Tr(n))return n.add(t);if(!n&&f.WillChange){let n=new f.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Dr(e){return e.props[ue]}var Or=typeof window<`u`;function kr({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Ar(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?or(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&kr(f,t))continue;let o={delay:n,...sr(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){O.update(()=>r.set(i));continue}let p=!1;if(Or&&window.MotionHandoffAnimation){let n=Dr(e);if(n){let e=window.MotionHandoffAnimation(n,t,O);e!==null&&(o.startTime=e,p=!0)}}Er(e,t);let m=l??e.shouldReduceMotion;r.start(hr(t,r,i,m&&br.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>O.update(()=>{o&&wr(e,o)});d.length?Promise.all(d).then(t):t()}return d}function jr(e,t,n={}){let r=V(e,t,yr(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Ar(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(jr(e,t,{...n,delay:r+(typeof o==`function`?0:o)+ar(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Mr(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>jr(e,t,n))):typeof t==`string`?jr(e,t,n):Promise.all(Ar(e,V(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Nr={test:e=>e===`auto`,parse:e=>e},Pr=e=>t=>t.test(e),Fr=[me,Ne,le,xe,fe,ze,Nr],Ir=e=>Fr.find(Pr(e));function Lr(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Ke(e)}var Rr=new Set([`auto`,`none`,`0`]);function zr(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Rr.has(t)&&Be(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=h(n,i))}var Br=class extends ee{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(ge(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ke(r))){let i=vr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!br.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Ir(r),o=Ir(i);if(ge(r)!==ge(i)&&y[n])this.needsMeasurement=!0;else if(a!==o){if(g(a)&&g(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else y[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Lr(e[t]))&&n.push(t);n.length&&zr(e,n,t)}measure(){let{element:e,name:t}=this;return y[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Vr=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Hr(e){return Ze(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Ur(e){return Ze(e)&&`ownerSVGElement`in e}var Wr={};function Gr(e){return Wr.current?.add(e),e}var Kr=e=>Wr.current?Wr.current.bind(e):e;function qr(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Wr.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function Jr(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Yr({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Xr({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Zr(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Qr(e){return e===void 0||e===1}function $r({scale:e,scaleX:t,scaleY:n}){return!Qr(e)||!Qr(t)||!Qr(n)}var H=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function U(e){return $r(e)||ti(e)||ei(e)}function ei(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function ti(e){return ni(e.x)||ni(e.y)}function ni(e){return e&&e!==`0%`}function ri(e,t,n){return n+t*(e-n)}function ii(e,t,n,r,i){return i!==void 0&&(e=ri(e,i,r)),ri(e,n,r)+t}function ai(e,t=0,n=1,r,i){e.min=ii(e.min,t,n,r,i),e.max=ii(e.max,t,n,r,i)}function oi(e,{x:t,y:n}){ai(e.x,t.translate,t.scale,t.originPoint),ai(e.y,n.translate,n.scale,n.originPoint)}var si=.999999999999,ci=1.0000000000001;function li(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(W(e.x,-a.scroll.offset.x),W(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,oi(e,o)),r&&(r.path?.[s]||r)!==a&&U(a.latestValues)&&fi(e,a.latestValues,a.layout?.layoutBox));t.x<ci&&t.x>si&&(t.x=1),t.y<ci&&t.y>si&&(t.y=1)}function W(e,t){e.min+=t,e.max+=t}function ui(e,t,n,r,i=.5){ai(e,t,n,R(e.min,e.max,i),r)}function di(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function fi(e,t,n){let r=n??e;ui(e.x,di(t.x,r.x),t.scaleX,t.scale,t.originX),ui(e.y,di(t.y,r.y),t.scaleY,t.scale,t.originY)}function pi(e,t){return Yr(Zr(e.getBoundingClientRect(),t))}function mi(e,t,n){let r=pi(e,n),{scroll:i}=t;return i&&(W(r.x,i.offset.x),W(r.y,i.offset.y)),r}var hi=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0});function gi(e,t,n){let r=qe(e)?e:s(e);return r.start(hr(``,r,t,n)),r.animation}var _i={value:null,addProjectionMetrics:null,countProjection:void 0};function vi(e,t){let n=N.now();e=Kr(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(k(r),e(a-t))};return O.setup(r,!0),Gr(()=>k(r))}function yi(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function bi(e){return Ur(e)&&e.tagName===`svg`}var xi=e=>typeof e==`number`?e:parseFloat(e),Si=Vr.length,Ci=e=>typeof e==`number`||Ne.test(e);function wi(e,t,n,r,i,a){i?(e.opacity=R(0,n.opacity??1,Ei(r)),e.opacityExit=R(t.opacity??1,0,Di(r))):a&&(e.opacity=R(t.opacity??1,n.opacity??1,r));for(let i=0;i<Si;i++){let a=Vr[i],o=Ti(t,a),s=Ti(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ci(o)===Ci(s)?(e[a]=Math.max(R(xi(o),xi(s),r),0),(le.test(s)||le.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<H.length;i++){let a=H[i];(t[a]||n[a])&&(e[a]=R(t[a]||0,n[a]||0,r))}}function Ti(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ei=Oi(0,.5,st),Di=Oi(.5,.95,c);function Oi(e,t,n){return r=>r<e?0:r>t?1:n(L(e,t,r))}function ki(e,t){e.min=t.min,e.max=t.max}function G(e,t){ki(e.x,t.x),ki(e.y,t.y)}function Ai(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var ji=.9999,Mi=1.0001,Ni=-.01,Pi=.01;function K(e){return e.max-e.min}function Fi(e,t,n){return Math.abs(e-t)<=n}function Ii(e,t,n,r=.5){e.origin=r,e.originPoint=R(t.min,t.max,e.origin),e.scale=K(n)/K(t),e.translate=R(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ji&&e.scale<=Mi||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ni&&e.translate<=Pi||isNaN(e.translate))&&(e.translate=0)}function Li(e,t,n,r){Ii(e.x,t.x,n.x,r?.originX),Ii(e.y,t.y,n.y,r?.originY)}function Ri(e,t,n,r=0){e.min=(r?R(n.min,n.max,r):n.min)+t.min,e.max=e.min+K(t)}function zi(e,t,n,r){Ri(e.x,t.x,n.x,r?.x),Ri(e.y,t.y,n.y,r?.y)}function Bi(e,t,n,r=0){let i=r?R(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+K(t)}function Vi(e,t,n,r){Bi(e.x,t.x,n.x,r?.x),Bi(e.y,t.y,n.y,r?.y)}function Hi(e,t,n,r,i){return e-=t,e=ri(e,1/n,r),i!==void 0&&(e=ri(e,1/i,r)),e}function Ui(e,t=0,n=1,r=.5,i,a=e,o=e){if(le.test(t)&&(t=parseFloat(t),t=R(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=R(a.min,a.max,r);e===a&&(s-=t),e.min=Hi(e.min,t,n,s,i),e.max=Hi(e.max,t,n,s,i)}function Wi(e,t,[n,r,i],a,o){Ui(e,t[n],t[r],t[i],t.scale,a,o)}var Gi=[`x`,`scaleX`,`originX`],Ki=[`y`,`scaleY`,`originY`];function qi(e,t,n,r){Wi(e.x,t,Gi,n?.x,r?.x),Wi(e.y,t,Ki,n?.y,r?.y)}var Ji=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yi=Ji(`applewebkit/`)&&!Ji(`chrome/`)?Math.round:c;function Xi(e){e.min=Yi(e.min),e.max=Yi(e.max)}function Zi(e){Xi(e.x),Xi(e.y)}function Qi(e){return e.translate===0&&e.scale===1}function $i(e){return Qi(e.x)&&Qi(e.y)}function ea(e,t){return e.min===t.min&&e.max===t.max}function ta(e,t){return ea(e.x,t.x)&&ea(e.y,t.y)}function na(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ra(e,t){return na(e.x,t.x)&&na(e.y,t.y)}function ia(e){return K(e.x)/K(e.y)}function aa(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var oa=class{constructor(){this.members=[]}add(e){C(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Te(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Te(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function sa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Ne.test(e))e=parseFloat(e);else return e}return`${sa(e,t.target.x)}% ${sa(e,t.target.y)}%`}},la={borderRadius:Object.assign({},ca,{applyTo:Vr.slice()}),borderTopLeftRadius:ca,borderTopRightRadius:ca,borderBottomLeftRadius:ca,borderBottomRightRadius:ca,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=he.parse(e);if(i.length>5)return r;let a=he.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=R(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function ua(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<H.length;e++){let t=H[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function q(e){return[e(`x`),e(`y`)]}var da=(e,t)=>e.depth-t.depth,fa=class{constructor(){this.children=[],this.isDirty=!1}add(e){C(this.children,e),this.isDirty=!0}remove(e){Te(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(da),this.isDirty=!1,this.children.forEach(e)}},pa={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ma=[`z`,`skew`,`skewZ`],ha=1e3,ga=0;function _a(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var va=e=>e.instance&&Ge.get(e.instance)?.demote()&&e.resetSkewAndRotation();function ya(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Dr(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,O,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ya(r)}function ba(e){if(e)return e.options.allowProjection===!1?ba(e.parent):e.projection}function xa({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(ve,{...la,...ve}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:ba(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&yi(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=ga++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(wa),this.nodes.forEach(Fa),this.nodes.forEach(Ia),this.nodes.forEach(Ta),_i.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new fa)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new te),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Ur(t)&&!bi(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;O.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=vi(i,250),pa.hasAnimatedSinceResize&&(pa.hasAnimatedSinceResize=!1,this.nodes.forEach(Pa)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||Ha,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!ra(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...sr(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Pa(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,k(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(La),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ya(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;va(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,va(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Oa),this.nodes.forEach(Da);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ka);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ja),this.nodes.forEach(Ma),this.nodes.forEach(Na),this.nodes.forEach(Sa),this.nodes.forEach(Ca)):this.nodes.forEach(ka),this.clearAllSnapshots();let e=N.now();A.delta=u(0,1e3/60,e-A.timestamp),A.timestamp=e,A.isProcessing=!0,oe.update.process(A),oe.preRender.process(A),oe.render.process(A),A.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_e.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ea),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,O.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){O.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!K(this.snapshot.measuredBox.x)&&!K(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=M(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&va(this);let t=this.projectionDelta&&!$i(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||U(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Zi(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return M();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ga))){let{scroll:e}=this.root;e&&(W(t.x,e.offset.x),W(t.y,e.offset.y))}return t}removeElementScroll(e){let t=M();if(G(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&G(t,e),W(t.x,i.offset.x),W(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||M();G(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(W(a.x,-n.scroll.offset.x),W(a.y,-n.scroll.offset.y)),U(n.latestValues)&&fi(a,n.latestValues,n.layout?.layoutBox)}return!r&&U(this.latestValues)&&fi(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=M();G(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!U(n.latestValues))continue;let r;n.instance&&($r(n.latestValues)&&n.updateSnapshot(),r=M(),G(r,n.measurePageBox())),qi(t,n.latestValues,n.snapshot?.layoutBox,r)}return U(this.latestValues)&&qi(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==A.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=A.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=M(),this.targetWithTransforms=M()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zi(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):G(this.target,this.layout.layoutBox),oi(this.target,this.targetDelta)):G(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),_i.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||$r(this.parent.latestValues)||ti(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=M(),this.relativeTargetOrigin=M(),Vi(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),G(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===A.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;G(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;li(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=M());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ai(this.prevProjectionDelta.x,this.projectionDelta.x),Ai(this.prevProjectionDelta.y,this.projectionDelta.y)),Li(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!aa(this.projectionDelta.x,this.prevProjectionDelta.x)||!aa(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_i.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=P(),this.projectionDelta=P(),this.projectionDeltaWithTransform=P()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=P();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=M(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Va));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);Ra(o.x,e.x,n),Ra(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vi(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ba(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&ta(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=M(),G(f,this.relativeTarget)),c&&(this.animationValues=a,wi(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(k(this.pendingAnimation),void 0),this.pendingAnimation=O.update(()=>{pa.hasAnimatedSinceResize=!0,this.motionValue||=s(0),this.motionValue.jump(0,!1),this.currentAnimation=gi(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),v(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(ha),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Wa(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||M(),Ua(i.x,t.x,e.x),Ua(i.y,t.y,e.y)}G(t,i),fi(t,r),Li(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new oa),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!ei(t))return;let n={};for(let t=0;t<ma.length;t++)_a(ma[t],e,n,this.animationValues);for(let t=0;t<H.length;t++)_a(H[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Oe(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Oe(t?.pointerEvents)||``),this.hasProjected&&!U(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=ua(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in ve){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=ve[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Oe(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Da),this.root.sharedNodes.clear()}}}function Sa(e){e.updateLayout(),Aa(e)}function Ca(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)q(e=>{let t=K(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ki(r[e],a[e])}else Wa(i,t.layoutBox,n)&&q(t=>{let n=K(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=P();Li(c,n,t.layoutBox);let l=P();Li(l,a?e.applyTransform(r,!0):n,s);let u=!$i(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=M();Vi(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=M();Vi(l,n,i.layoutBox,s),a&&o(c,l),ra(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function wa(e){_i.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ta(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ea(e){e.clearSnapshot()}function Da(e){e.clearMeasurements()}function Oa(e){e.isLayoutDirty=!0,e.updateLayout()}function ka(e){e.isLayoutDirty=!1}function Aa(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;q(e=>W(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function ja(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Ma(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Na(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Pa(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Fa(e){e.resolveTargetDelta()}function Ia(e){e.calcProjection()}function La(e){e.resetSkewAndRotation()}function Ra(e,t,n){e.translate=R(t.translate,0,n),e.scale=R(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function za(e,t,n,r){e.min=R(t.min,n.min,r),e.max=R(t.max,n.max,r)}function Ba(e,t,n,r){za(e.x,t.x,n.x,r),za(e.y,t.y,n.y,r)}function Va(e){return e.animationValues?.opacityExit!==void 0}var Ha={duration:.45,ease:[.4,0,.1,1]};function Ua(e,t,n){e.max=K(n)+(e.min=t.min)}function Wa(e,t,n){return e===`position`||e===`preserve-aspect`&&!Fi(ia(t),ia(n),.2)}function Ga(e){return e!==e.root&&e.scroll?.wasRoot}function J(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Ka=xa({attachResizeListener:(e,t)=>J(e,`resize`,t),measureScroll:hi,checkIsScrollRoot:()=>!0}),qa=xa({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pe.current){let e=new Ka({});e.mount(window),e.setOptions({layoutScroll:!0}),pe.current=e}return pe.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Ja=class extends Re{constructor(){super(...arguments),this.KeyframeResolver=Br}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;qe(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ya(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Xa(e){return window.getComputedStyle(e)}var Za=class extends Ja{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ya}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Xe.has(t))return this.projection?.isProjecting?o(t):ae(e,t);{let n=Xa(e),r=(Pe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return pi(e,t)}build(e,t,n){Je(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Me(e,t,n)}},Qa=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function $a(e){return{point:{x:e.pageX,y:e.pageY}}}var eo=e=>t=>Qa(t)&&e(t,$a(t));function to(e,t,n,r){return J(e,t,eo(n),r)}var no=new WeakMap,ro,io=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Ur(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ao=io(`inline`,`width`,`offsetWidth`),oo=io(`block`,`height`,`offsetHeight`);function so({target:e,borderBoxSize:t}){no.get(e)?.forEach(n=>{n(e,{get width(){return ao(e,t)},get height(){return oo(e,t)}})})}function co(e){e.forEach(so)}function lo(){typeof ResizeObserver<`u`&&(ro=new ResizeObserver(co))}function uo(e,t){ro||lo();let n=qr(e);return n.forEach(e=>{let n=no.get(e);n||(n=new Set,no.set(e,n)),n.add(t),ro?.observe(e)}),()=>{n.forEach(e=>{let n=no.get(e);n?.delete(t),n?.size||ro?.unobserve(e)})}}var fo=new Set,Y;function po(){Y=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fo.forEach(t=>t(e))},window.addEventListener(`resize`,Y)}function mo(e){return fo.add(e),Y||po(),()=>{fo.delete(e),!fo.size&&typeof Y==`function`&&(window.removeEventListener(`resize`,Y),Y=void 0)}}function ho(e,t){return Gr(typeof e==`function`?mo(e):uo(e,t))}var go=(e,t)=>Math.abs(e-t);function _o(e,t){let n=go(e.x,t.x),r=go(e.y,t.y);return Math.sqrt(n**2+r**2)}var vo=new Set([`auto`,`scroll`]),yo=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xo(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Co(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=_o(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:N.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xo(t,this.transformPagePoint),this.hasPendingMove=!0,O.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Co(e.type===`pointercancel`?this.lastMoveEventInfo:xo(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Qa(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xo($a(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:N.now()}];let{onSessionStart:l}=t;l&&l(e,Co(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=I(to(this.contextWindow,`pointermove`,this.handlePointerMove,u),to(this.contextWindow,`pointerup`,this.handlePointerUp,u),to(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(vo.has(e.overflowX)||vo.has(e.overflowY))&&this.scrollPositions.set(t,bo(t)),t=t.parentElement}this.scrollPositions.set(window,bo(window)),this.removeScrollListeners=I(J(window,`scroll`,this.onElementScroll,{capture:!0}),J(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=bo(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),O.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),k(this.updatePoint)}},bo=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function xo(e,t){return t?{point:t(e.point)}:e}function So(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Co({point:e},t){return{point:e,delta:So(e,To(t)),offset:So(e,wo(t)),velocity:Eo(t,.1)}}function wo(e){return e[0]}function To(e){return e[e.length-1]}function Eo(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=To(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>F(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>F(t)*2&&(r=e[1]);let a=j(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Do=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Oo(e){return Do.has(e.tagName)||e.isContentEditable===!0}var ko=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Ao(e){return ko.has(e.tagName)||e.isContentEditable===!0}var X={x:!1,y:!1};function jo(){return X.x||X.y}function Mo(e){return e===`x`||e===`y`?X[e]?null:(X[e]=!0,()=>{X[e]=!1}):X.x||X.y?null:(X.x=X.y=!0,()=>{X.x=X.y=!1})}function No(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?R(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?R(n,e,r.max):Math.min(e,n)),e}function Po(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Fo(e,{top:t,left:n,bottom:r,right:i}){return{x:Po(e.x,n,i),y:Po(e.y,t,r)}}function Io(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Lo(e,t){return{x:Io(e.x,t.x),y:Io(e.y,t.y)}}function Ro(e,t){let n=.5,r=K(e),i=K(t);return i>r?n=L(t.min,t.max-r,e.min):r>i&&(n=L(e.min,e.max-i,t.min)),u(0,1,n)}function zo(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Bo=.35;function Vo(e=Bo){return e===!1?e=0:e===!0&&(e=Bo),{x:Ho(e,`left`,`right`),y:Ho(e,`top`,`bottom`)}}function Ho(e,t,n){return{min:Uo(e,t),max:Uo(e,n)}}function Uo(e,t){return typeof e==`number`?e:e[t]||0}function Wo(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Go=new WeakMap,Ko=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=M(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=Mo(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),q(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ke(t)&&(t=vr(t,this.visualElement.current)||0),Ne.test(t))t=parseFloat(t);else if(le.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=K(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&O.update(()=>a(e,t),!1,!0),Er(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Zo(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&O.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new yo(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&O.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Z(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=No(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;qo(e)?(!this.constraints||this.scroll!==Wo(n))&&(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Fo(r.layoutBox,e):!1,this.elastic=Vo(t),i!==this.constraints&&!qo(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&q(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=zo(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!qo(e))return!1;let n=Jo(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Wo(r);let i=mi(n,r.root,this.visualElement.getTransformPagePoint()),a=Lo(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(Xr(a));this.hasMutatedConstraints=!!e,e&&(a=Yr(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&Z(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=q(e=>{if(!Z(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Er(this.visualElement,e),n.start(hr(e,n,0,t,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();q(e=>{if(!Z(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-R(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!qo(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};q(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Ro({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(t=>{let n=this.getAxisMotionValue(t);if(!Z(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(R(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Go.set(this.visualElement,this);let e=this.visualElement.current,t=to(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Ao(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=qo(t)&&Jo(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Xo(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),O.read(r);let o=J(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(q(t=>{if(!Z(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Bo,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function qo(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Jo=e=>`current`in e?e.current:e;function Yo(e){let t=!0;return()=>{t?t=!1:e()}}function Xo(e,t,n){let r=ho(e,Yo(n)),i=ho(t,Yo(n));return()=>{r(),i()}}function Z(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Zo(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Qo(e,t){let n=qr(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Gr(()=>r.abort())]}function $o(e){return!(e.pointerType===`touch`||jo())}function es(e,t,n={}){t=Kr(t);let[r,i,a]=Qo(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!$o(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var ts=(e,t)=>t?e===t||ts(e,t.parentElement):!1,ns=new WeakSet;function rs(e){return t=>{t.key===`Enter`&&e(t)}}function is(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var as=(e,t)=>{let n=!1,r=rs(()=>{ns.has(e)||(n=!0,is(e,`down`))}),i=rs(()=>{n&&(n=!1,is(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&is(e,`cancel`)},{...t,once:!0})};function os(e){return Qa(e)&&!jo()}var ss=new WeakSet;function cs(e,t,n={}){t=Kr(t);let[r,i,a]=Qo(e,n),o=e=>{let r=e.currentTarget;if(!os(e)||ss.has(e))return;ns.add(r),n.stopPropagation&&ss.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ns.has(r)&&ns.delete(r),os(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||ts(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Hr(e)&&(e.addEventListener(`focus`,()=>as(e,i),i),!Oo(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Q=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ls=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function us(e,t,n,r){Ya(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ls.has(n)?n:Jr(n),t.attrs[n])}var ds=class extends Ja{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=M}getBaseTargetFromProps(e,t){return Xe.has(t)?super.getBaseTargetFromProps(e,t)??o(t):e[t]}getDefaultValue(e){return Xe.has(e)?this.latestValues[e]??o(e):void 0}readValueFromInstance(e,t){if(Xe.has(t)){let e=ie(t);return e&&e.default||0}if(Ue.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=ls.has(t)?t:Jr(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return be(e,t,n)}build(e,t,n){se(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){us(e,t,n,r)}mount(e){this.isSVGTag=ce(e.tagName),super.mount(e)}};function fs(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ps=[...de].reverse(),ms=e=>e?.out===!0?e:e?.out;function hs(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Mr(e,t,n))),n=_s(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&V(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&ms(f(l??(g&&g.props.initial))?.transition);if(ps.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?Ee(f)||f===!1?f:void 0:l,y=Ee(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||Ve(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=gs(i.prevProp,v),C=S||y&&(b&&!x||r>h),ee=!1,w=Array.isArray(v)?v:[v],T={},E;if(b!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=V(e,n,yr(e,t))||{};T={...T,...a,...i},E=ms(r)||E}let{prevResolvedValues:te}=i;for(let t in{...te,...T}){if(t in m)continue;let n=T[t],r=te[t],a=Array.isArray(n)&&Array.isArray(r)?!fs(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(ee=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=T,i.prevOut=E,i.isActive&&(m={...m,...T}),C&&(!(x&&S)||ee))for(let n of w){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=V(s,n)?.transition?.delayChildren;r.delay=ar(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!qe(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=_s(),i=!0}}}function gs(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fs(t,e):!1}function _s(){let e={};for(let t of de)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var $=t(e(),1);function vs(e=!0){let t=(0,$.useContext)(a);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,o=(0,$.useId)();(0,$.useEffect)(()=>{if(e)return i(o)},[e]);let s=(0,$.useCallback)(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}var ys=(e,t)=>t.isSVG??Ie(e)?new ds(t):new Za(t,{allowProjection:e!==$.Fragment}),bs=class extends Q{constructor(e){super(e),e.animationState||=hs(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ve(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},xs=0,Ss={animation:{Feature:bs},exit:{Feature:class extends Q{constructor(){super(...arguments),this.id=xs++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=V(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Cs=class extends Q{constructor(e){super(e),this.removeGroupControls=c,this.removeListeners=c,this.controls=new Ko(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||c}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ws=e=>(t,n)=>{e&&O.update(()=>e(t,n),!1,!0)},Ts=class extends Q{constructor(){super(...arguments),this.removePointerDownListener=c}onPointerDown(e){this.session=new yo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ws(e),onStart:ws(t),onMove:ws(n),onEnd:(e,t)=>{delete this.session,r&&O.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=to(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},Es=n(),Ds=!1,Os=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),ks=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},As=class extends $.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),Ds&&i.root.didUpdate(),i.options.layoutId!==r&&ks(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Os(this.props),onExitComplete:()=>this.safeToRemove()})),pa.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),ks(o,n)),o.setOptions({...o.options,...Os(this.props)}),Ds=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||O.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),_e.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ds=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function js(e){let[t,n]=vs(),r=(0,$.useContext)(Ce);return(0,Es.jsx)(As,{...e,layoutGroup:r,switchLayoutGroup:(0,$.useContext)(Ae),isPresent:t,safeToRemove:n})}var Ms={pan:{Feature:Ts},drag:{Feature:Cs,ProjectionNode:qa,MeasureLayout:js}};function Ns(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&O.postRender(()=>o(t,$a(t)))}var Ps=class extends Q{mount(){let{current:e}=this.node;e&&(this.unmount=es(e,(e,t)=>(Ns(this.node,t,`Hover`,`Start`),e=>Ns(this.node,e,`Hover`,`End`))))}unmount(){}},Fs=class extends Q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=I(J(this.node.current,`focus`,()=>this.onFocus()),J(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Is(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Ns(e,t,`Tap`,n)}var Ls=class extends Q{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=cs(e,(e,t)=>(Is(this.node,t,`Start`),(e,{success:t})=>Is(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Rs=new WeakMap,zs=new WeakMap,Bs=e=>{let t=Rs.get(e.target);t&&t(e)},Vs=e=>{e.forEach(Bs)};function Hs({root:e,...t}){let n=e||document;zs.has(n)||zs.set(n,{});let r=zs.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Vs,{root:e,...t})),r[i]}function Us(e,t,n){let r=Hs(t);return Rs.set(e,n),r.observe(e),()=>{Rs.delete(e),r.unobserve(e)}}var Ws={some:0,all:1},Gs=class extends Q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ws[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Us(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Ks(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ks({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var qs=Object.assign({},Object.assign({renderer:ys},Ss,{inView:{Feature:Gs},tap:{Feature:Ls},focus:{Feature:Fs},hover:{Feature:Ps}}),Ms,{layout:{ProjectionNode:qa,MeasureLayout:js}});export{qs as default};
|
|
1
|
+
import{Y as e,Z as t,r as n}from"./index-Bbor_y80.js";import{$ as r,A as i,At as a,B as o,C as s,Ct as c,D as l,Dt as u,E as d,Et as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,Ot as C,P as ee,Q as w,R as T,S as E,St as te,T as ne,Tt as re,U as ie,V as ae,W as D,X as O,Y as k,Z as oe,_ as se,_t as A,a as ce,at as le,b as ue,bt as j,c as de,ct as fe,d as pe,dt as me,et as he,f as M,ft as ge,g as _e,gt as N,h as ve,ht as ye,i as be,it as xe,j as Se,jt as Ce,k as we,kt as Te,l as Ee,lt as De,m as Oe,mt as ke,n as Ae,nt as je,o as Me,ot as Ne,p as P,pt as Pe,q as Fe,r as Ie,rt as Le,s as Re,st as ze,tt as Be,u as Ve,ut as He,v as Ue,vt as We,w as Ge,wt as Ke,x as qe,xt as F,y as Je,yt as Ye,z as Xe}from"./App-BpJOzw4F.js";var Ze=e=>typeof e==`object`&&!!e,I=(...e)=>e.reduce((e,t)=>n=>t(e(n))),L=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Qe=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function $e(e,t,n,r){return e===t&&n===r?c:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Qe(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Qe(s+1e-7,e,n)-i-r)}return Qe(s,t,r)}}var et=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tt=e=>t=>1-e(1-t),nt=$e(.33,1.53,.69,.99),rt=tt(nt),it=et(rt),at=e=>e>=1?1:(e*=2)<1?.5*rt(e):.5*(2-2**(-10*(e-1))),ot=e=>1-Math.sin(Math.acos(e)),st=tt(ot),ct=et(ot),lt=$e(.42,0,1,1),ut=$e(0,0,.58,1),dt=$e(.42,0,.58,1),ft=e=>Array.isArray(e)&&typeof e[0]!=`number`,pt={linear:c,easeIn:lt,easeInOut:dt,easeOut:ut,circIn:ot,circInOut:ct,circOut:st,backIn:rt,backInOut:it,backOut:nt,anticipate:at},mt=e=>typeof e==`string`,ht=e=>{if(We(e)){let[t,n,r,i]=e;return $e(t,n,r,i)}return mt(e)?pt[e]:e};function gt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _t({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=gt(s,r,e+1/3),a=gt(s,r,e),o=gt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function vt(e,t){return n=>n>0?t:e}var R=(e,t,n)=>e+(t-e)*n,yt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},bt=[De,He,Le],xt=e=>bt.find(t=>t.test(e));function St(e){let t=xt(e);if(!t)return!1;let n=t.parse(e);return t===Le&&(n=_t(n)),n}var Ct=(e,t)=>{let n=St(e),r=St(t);if(!n||!r)return vt(e,t);let i={...n};return e=>(i.red=yt(n.red,r.red,e),i.green=yt(n.green,r.green,e),i.blue=yt(n.blue,r.blue,e),i.alpha=R(n.alpha,r.alpha,e),He.transform(i))},wt=new Set([`none`,`hidden`]);function Tt(e,t){return wt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Et(e,t){return n=>R(e,t,n)}function Dt(e){return typeof e==`number`?Et:typeof e==`string`?ke(e)?vt:je.test(e)?Ct:jt:Array.isArray(e)?Ot:typeof e==`object`?je.test(e)?Ct:kt:vt}function Ot(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Dt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function kt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Dt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function At(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var jt=(e,t)=>{let n=w(e),i=w(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?wt.has(e)&&!i.values.length||wt.has(t)&&!n.values.length?Tt(e,t):I(Ot(At(n,i),i.values),r(i)):vt(e,t)},Mt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Nt(e,t){let n=Mt.exec(e);if(!n)return;let r=Mt.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>ye(R(a,o,e))+i}function Pt(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return R(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Nt(e,t);if(n)return n}return Dt(e)(e,t)}var Ft=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>O.update(t,e),stop:()=>k(t),now:()=>A.isProcessing?A.timestamp:N.now()}},It=2e4;function Lt(e,t=50,n=It,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Rt(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Lt(o),It);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:j(s)}}var zt=100,Bt=10,Vt=1,Ht=800,Ut=.3,Wt=.3,Gt=.01,Kt=2,qt=.005,Jt=.5,Yt=.01,Xt=10,Zt=.05,Qt=e=>e<0?1/Math.max(1+e,Zt):Math.max(1-e,Zt);function $t(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return nn(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function en(e,t){return e*Math.sqrt(1-t*t)}var tn=12;function nn(e,t,n){let r=n;for(let n=1;n<tn;n++)r-=e(r)/t(r);return r}var rn=.001;function an({duration:e=Ht,bounce:t=Ut}){let n,r,i=Qt(t);e=u(Yt,Xt,j(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=en(t,i),o=Math.exp(-r);return rn-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=en(t*t,i);return(-n(t)+rn>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=nn(n,r,a),s=o*$t(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:F(e)}}var on=(e,t)=>(t?e>=0:e>0)&&e<1/0;function sn(e,t){if(on(e,t))return e}function cn(e){let t=sn(e.stiffness),n=sn(e.damping,!0),r=sn(e.mass),i={...e,stiffness:t??zt,damping:n??Bt,mass:r??Vt,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Qt(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*$t(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,an(i)),i.isResolvedFromDuration=!0;(!on(i.stiffness)||!on(i.damping,!0))&&(i.stiffness=zt,i.damping=Bt)}return i}function ln(e=Wt,t=Ut){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=cn({...n}),f=e=>d?0:-j(e),p=s/(2*Math.sqrt(o*c)),m=j(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},v=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Gt:Kt),g.restDelta=n.restDelta||(e?qt:Jt)};v();let y,b,x;if(p<1){let e=en(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};x=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};y=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),b=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){y=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};x=()=>{e.C=g.velocity+m*g.delta},b=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};x=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},y=e=>g.target-a.S*i(t,e)-a.F*i(n,e),b=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}x();let S=u&&l||null,C={calculatedDuration:S,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||v(),C.calculatedDuration=S,a.done=!1,x()},velocity:e=>F(b(e)),next:e=>{let t=y(e);if(u)a.done=e>=l;else{let n=F(b(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Lt(C),It),t=_(t=>C.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return C}var un=Object.assign(ln,{applyToOptions:e=>{let t=Rt(e,100,ln);return e.ease=t.ease,e.duration=F(t.duration),e.type=`keyframes`,e}});function dn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=un({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function fn(e,t,n){let r=[],i=f.mix||Pt,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=I(Array.isArray(t)?t[o]||c:t,a)),r.push(a)}return r}function pn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=fn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=L(e[r],e[r+1],n);return s[r](i)};return n?t=>l(u(e[0],e[a-1],t)):l}function mn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=L(0,t,r);e.push(R(n,1,i))}}function hn(e){let t=[0];return mn(t,e.length-1),t}function gn(e,t){return e.map(e=>e*t)}function _n(e,t){return e.map(()=>t||dt).splice(0,e.length-1)}function z({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=ft(r)?r.map(ht):ht(r)||dt,s={done:!1,value:t[0]};if(!a&&t.length===2&&!Array.isArray(o)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,i=n===r?void 0:(f.mix||Pt)(n,r);return{calculatedDuration:e,next:t=>(s.value=i?i(o(e>0?u(0,1,t/e):1)):r,s.done=t>=e,s)}}let c=pn(gn(n&&n.length===t.length?n:hn(t),e),t,{ease:Array.isArray(o)?o:_n(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=c(t),s.done=t>=e,s)}}var vn=5;function yn(e,t,n){let r=Math.max(t-vn,0);return Ye(n-e(r),t-r)}function bn(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):yn(t=>e.next(t).value,t,e.next(t).value)}var xn={decay:dn,inertia:dn,tween:z,keyframes:z,spring:un};function Sn(e){typeof e.type==`string`&&(e.type=xn[e.type])}var Cn=40,wn=(e,t)=>t-e>Cn&&!f.useManualTiming?t:e,Tn=e=>e/100,En=e=>Math.round(e*1e4)/1e4,Dn=class extends D{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),m(this,this.options)}initAnimation(){let{options:e}=this;Sn(e);let{type:t=z,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||z;this.mixKeyframes=void 0,s!==z&&typeof o[0]!=`number`&&(this.mixKeyframes=I(Tn,e.mixer?.(o[0],o[1])||Pt(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Lt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=wn(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==dn&&(f.value=Fe(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??En((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==dn?Fe(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:d}=this.options,f=e,p=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,d&&(i-=d/o)):l===`mirror`&&(p=a)),f=u(0,1,i)*o}let m;return t?(this.delayState.value=s[0],m=this.delayState):m=p.next(f),i&&!t&&(m.value=i(m.value)),m}get duration(){return j(this.calculatedDuration)}get iterationDuration(){return this.duration+j(this.options.delay??0)}get time(){return j(this.currentTime)}set time(e){e=F(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return bn(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=j(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ft,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},On={anticipate:at,backInOut:it,circInOut:ct};function kn(e){return e in On}function An(e){typeof e.ease==`string`&&kn(e.ease)&&(e.ease=On[e.ease])}var jn=class extends S{constructor(e){An(e),Sn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(N.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new Dn({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?u(0,10,a):0,s=this.sample(a);n&&r&&x(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},Mn=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(he.test(e)||e===`0`)&&!e.startsWith(`url(`));function Nn(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Pn(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Mn(i,t),s=Mn(a,t);return!o||!s?!1:Nn(e)||(n===`spring`||we(n))&&r}function Fn(e){e.duration=0,e.type=`keyframes`}var In=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Ln(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&In.test(e[t]))return!0;return!1}var Rn=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),zn=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Bn=()=>!f.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Vn(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(l.has(n)||zn.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:d}=t.owner.getProps();return Bn()&&(l.has(n)||zn.has(n)&&Ln(s))&&(n!==`transform`||!d)&&!u&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!Rn(e)}var Hn=200,Un=.001,Wn=.1,Gn=.001,Kn=100,qn=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Jn=(e,t)=>Math.abs(e-t)<=Un,Yn=(e,t)=>e-t,Xn=(e,t,n)=>hn(Array(n+1)).map(n=>R(e,t,n)),Zn=e=>e.motionValue.owner,Qn=e=>Ge.get(e),$n=({state:e})=>e===`idle`||e===`finished`,B=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),er=({name:e,motionValue:t})=>e&&T.includes(e)&&t?.owner?.current instanceof HTMLElement&&Bn()&&b();function tr(e){let t=Zn(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(B(t,`transform`)||`none`)===`none`&&!B(t,`pathRotation`)&&!t.projection?.isProjecting()&&!Rn(e)}var nr=class extends Dn{constructor(e){let t=Zn(e).current,{driver:n=Ft}=e,r,i=tr(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Qn(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Qn(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Qn(Zn(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(N.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:a,delay:o=0}=this.options,s=We(n)?Se(n):qn(n)&&i[n];if(s&&!a&&!r&&e.length===2&&t===z&&this.holdTime===null){let e=this.startTime+o/this.speed;return[e,e+this.resolvedDuration/this.speed,s]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||z)===z?u||hn(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=N.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||rr(Zn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(N.now())}get time(){return this.isAccelerated()?j(u(0,this.totalDuration,this.at(N.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function rr(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,f=!1,p=-1/0,m=e=>{for(let t of n)if(t.name===e)return!0},h=(t,n)=>{let o={};for(let s of t===void 0?T:a){let a=r.get(s),c=t===void 0?B(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},g=(e,t)=>{let n=``;for(let r in e){let i=e[r];(!t||!ne(r,i))&&(n+=d(r,i)+` `)}return(t?n.trim():n)||`none`},_=(e,t)=>g(h(e,t)),v=(e=h())=>{t.style.transform=g(e,!0)},y=(e=!0)=>{e&&v(),s.forEach(({animation:e})=>e.cancel()),s=[]},b=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),x=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=N.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),D.schedule(!1)}),e.oncancel=()=>s.includes(r)&&D.demote(),s.push(r)},S=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},C=(e,t,n,r)=>{let i=Math.min(Hn,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Xn(t,n,i).concat(r).sort(Yn),o=e=>L(t,n,e),s,c;for(let n of e){let e=n.numberAt(t),r=a.map(t=>n.numberAt(t)-e),i=r[r.length-1],o=r.some(e=>Math.abs(e)*Un>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(o&&!s)s=l,c=t=>(n.numberAt(t)-e)/o;else if(l.some((e,t)=>!Jn(e,o&&s[t])))return}if(!s||s.every((e,t)=>Jn(e,o(a[t]))))return`linear`;let l=[],u=(e,t=c(e))=>l.push(En(t)+` `+En(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&S(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},ee=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?Gn:Wn))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...S(e=>r.numberAt(e),t,n));i.push(n)}},s=Xn(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Yn))e>c&&o(c,e,0),c=e;return i.sort(Yn)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},E=(e,t,n,r,i={fill:`both`},a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=r||C(e,t,n,o),c=s?[t,n]:ee(e,t,n,o),l=c.map(e=>_(e,a)),u={transform:l};return s||(u.offset=c.map(e=>L(t,n,e))),l.every(e=>e===l[0])&&(v(h(t,a)),u=null),b(u,{...i,duration:n-t,easing:s||`linear`})},te=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=T.filter(t=>{if(r.has(t))return!0;let n=i[t]=B(e,t);return n!==void 0&&!ne(t,n)}),y(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;x(E(d,e,n,r),e-t,n-e)}else c>t&&(x(E(d,t,c),0,c-t),p.forEach(e=>e<c-1&&x(b(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;x(E(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||y(),!0},re=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},ie=()=>!n.size&&(u=!0,Qn(t)===D&&Ge.delete(t),D.isJS||y(),!0),ae=()=>{let t=N.now();if(D.isJS||(D.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=B(e,n.name),o.has(n)||(c=!0))}),D.isFinishing=!1),l=!1,u||(n.forEach(e=>$n(e)&&n.delete(e)),ie()))return;for(let e of n)if(!e.canAccelerate)return D.demote(!0);D.isJS&&(D.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=f;if(c=f=!1,r||!re(t)){if(a){if(t-p<Kn)return D.demote();p=t}if(!te(t))return D.demote()}},D={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,f||=!!t,l||(l=!0,A.isProcessing?O.render(ae,!1,!0):queueMicrotask(ae)))},release(e){$n(e)&&n.delete(e),ie()||D.schedule(!0)},check(){if(!D.isJS){for(let t in i)if(B(e,t)!==i[t]&&!m(t))return D.schedule(!0,!0)}},demote(e){if(!(D.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),D.isJS=!0,o=new Map,y(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Ge.set(t,D),D}var ir=class extends D{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||ee;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=N.now();let u=Pn(e,i,a,o);u||((f.instantAnimations||!s)&&l?.(Fe(e,n,t)),e[0]=e[e.length-1],Fn(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let p=u&&!c&&Vn(n),m=!p&&er(n);r&&(p||m||this.resolvedAt!==this.createdAt)&&(n.startTime??=wn(this.createdAt,this.resolvedAt));let h;if(p){n.element=n.motionValue?.owner?.current;try{h=new jn(n)}catch{h=new Dn(n)}}else h=m?new nr(n):new Dn(n);this.pendingTimeline&&=(this.stopTimeline=h.attachTimeline(this.pendingTimeline),void 0),this._animation=h}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),p()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}};function ar(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function or(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function sr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:or(n,e)}var cr={type:`spring`,stiffness:500,damping:25,restSpeed:10},lr=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ur={type:`keyframes`,duration:.8},dr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},fr=(e,{keyframes:t})=>t.length>2?ur:Xe.has(e)?e.startsWith(`scale`)?lr(t[1]):cr:dr,pr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function mr(e){for(let t in e)if(!pr.has(t))return!0;return!1}var hr=(e,t,n,r={},i,a)=>o=>{let s=sr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=F(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};mr(s)||Object.assign(u,fr(e,u)),u.duration&&=F(u.duration),u.repeatDelay&&=F(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Fn(u),u.delay===0&&(d=!0)),(f.instantAnimations||f.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Fn(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Fe(u.keyframes,s);if(e!==void 0){O.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Dn(u):new ir(u)},gr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _r(e){let t=gr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function vr(e,t,n=1){let[r,i]=_r(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return re(e)?parseFloat(e):e}return ke(i)?vr(i,t,n+1):i}function V(e,t,n){return E(e.getProps(),t,n,e)}var yr=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,br=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...T]),xr=e=>Array.isArray(e);function Sr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,s(n))}function Cr(e){return xr(e)?e[e.length-1]||0:e}function wr(e,t){let{transitionEnd:n={},transition:r={},...i}=V(e,t)||{};i={...i,...n};for(let t in i)Sr(e,t,Cr(i[t]))}function Tr(e){return!!(qe(e)&&e.add)}function Er(e,t){let n=e.getValue(`willChange`);if(Tr(n))return n.add(t);if(!n&&f.WillChange){let n=new f.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Dr(e){return e.props[ue]}var Or=typeof window<`u`;function kr({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Ar(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?or(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&kr(f,t))continue;let o={delay:n,...sr(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){O.update(()=>r.set(i));continue}let p=!1;if(Or&&window.MotionHandoffAnimation){let n=Dr(e);if(n){let e=window.MotionHandoffAnimation(n,t,O);e!==null&&(o.startTime=e,p=!0)}}Er(e,t);let m=l??e.shouldReduceMotion;r.start(hr(t,r,i,m&&br.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>O.update(()=>{o&&wr(e,o)});d.length?Promise.all(d).then(t):t()}return d}function jr(e,t,n={}){let r=V(e,t,yr(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Ar(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(jr(e,t,{...n,delay:r+(typeof o==`function`?0:o)+ar(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function Mr(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>jr(e,t,n))):typeof t==`string`?jr(e,t,n):Promise.all(Ar(e,V(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Nr={test:e=>e===`auto`,parse:e=>e},Pr=e=>t=>t.test(e),Fr=[me,Ne,le,xe,fe,ze,Nr],Ir=e=>Fr.find(Pr(e));function Lr(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Ke(e)}var Rr=new Set([`auto`,`none`,`0`]);function zr(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Rr.has(t)&&Be(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=h(n,i))}var Br=class extends ee{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(ge(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ke(r))){let i=vr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!br.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Ir(r),o=Ir(i);if(ge(r)!==ge(i)&&y[n])this.needsMeasurement=!0;else if(a!==o){if(g(a)&&g(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else y[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Lr(e[t]))&&n.push(t);n.length&&zr(e,n,t)}measure(){let{element:e,name:t}=this;return y[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Vr=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Hr(e){return Ze(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Ur(e){return Ze(e)&&`ownerSVGElement`in e}var Wr={};function Gr(e){return Wr.current?.add(e),e}var Kr=e=>Wr.current?Wr.current.bind(e):e;function qr(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Wr.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function Jr(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Yr({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Xr({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Zr(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Qr(e){return e===void 0||e===1}function $r({scale:e,scaleX:t,scaleY:n}){return!Qr(e)||!Qr(t)||!Qr(n)}var H=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function U(e){return $r(e)||ti(e)||ei(e)}function ei(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function ti(e){return ni(e.x)||ni(e.y)}function ni(e){return e&&e!==`0%`}function ri(e,t,n){return n+t*(e-n)}function ii(e,t,n,r,i){return i!==void 0&&(e=ri(e,i,r)),ri(e,n,r)+t}function ai(e,t=0,n=1,r,i){e.min=ii(e.min,t,n,r,i),e.max=ii(e.max,t,n,r,i)}function oi(e,{x:t,y:n}){ai(e.x,t.translate,t.scale,t.originPoint),ai(e.y,n.translate,n.scale,n.originPoint)}var si=.999999999999,ci=1.0000000000001;function li(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(W(e.x,-a.scroll.offset.x),W(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,oi(e,o)),r&&(r.path?.[s]||r)!==a&&U(a.latestValues)&&fi(e,a.latestValues,a.layout?.layoutBox));t.x<ci&&t.x>si&&(t.x=1),t.y<ci&&t.y>si&&(t.y=1)}function W(e,t){e.min+=t,e.max+=t}function ui(e,t,n,r,i=.5){ai(e,t,n,R(e.min,e.max,i),r)}function di(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function fi(e,t,n){let r=n??e;ui(e.x,di(t.x,r.x),t.scaleX,t.scale,t.originX),ui(e.y,di(t.y,r.y),t.scaleY,t.scale,t.originY)}function pi(e,t){return Yr(Zr(e.getBoundingClientRect(),t))}function mi(e,t,n){let r=pi(e,n),{scroll:i}=t;return i&&(W(r.x,i.offset.x),W(r.y,i.offset.y)),r}var hi=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0});function gi(e,t,n){let r=qe(e)?e:s(e);return r.start(hr(``,r,t,n)),r.animation}var _i={value:null,addProjectionMetrics:null,countProjection:void 0};function vi(e,t){let n=N.now();e=Kr(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(k(r),e(a-t))};return O.setup(r,!0),Gr(()=>k(r))}function yi(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function bi(e){return Ur(e)&&e.tagName===`svg`}var xi=e=>typeof e==`number`?e:parseFloat(e),Si=Vr.length,Ci=e=>typeof e==`number`||Ne.test(e);function wi(e,t,n,r,i,a){i?(e.opacity=R(0,n.opacity??1,Ei(r)),e.opacityExit=R(t.opacity??1,0,Di(r))):a&&(e.opacity=R(t.opacity??1,n.opacity??1,r));for(let i=0;i<Si;i++){let a=Vr[i],o=Ti(t,a),s=Ti(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ci(o)===Ci(s)?(e[a]=Math.max(R(xi(o),xi(s),r),0),(le.test(s)||le.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<H.length;i++){let a=H[i];(t[a]||n[a])&&(e[a]=R(t[a]||0,n[a]||0,r))}}function Ti(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Ei=Oi(0,.5,st),Di=Oi(.5,.95,c);function Oi(e,t,n){return r=>r<e?0:r>t?1:n(L(e,t,r))}function ki(e,t){e.min=t.min,e.max=t.max}function G(e,t){ki(e.x,t.x),ki(e.y,t.y)}function Ai(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var ji=.9999,Mi=1.0001,Ni=-.01,Pi=.01;function K(e){return e.max-e.min}function Fi(e,t,n){return Math.abs(e-t)<=n}function Ii(e,t,n,r=.5){e.origin=r,e.originPoint=R(t.min,t.max,e.origin),e.scale=K(n)/K(t),e.translate=R(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ji&&e.scale<=Mi||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ni&&e.translate<=Pi||isNaN(e.translate))&&(e.translate=0)}function Li(e,t,n,r){Ii(e.x,t.x,n.x,r?.originX),Ii(e.y,t.y,n.y,r?.originY)}function Ri(e,t,n,r=0){e.min=(r?R(n.min,n.max,r):n.min)+t.min,e.max=e.min+K(t)}function zi(e,t,n,r){Ri(e.x,t.x,n.x,r?.x),Ri(e.y,t.y,n.y,r?.y)}function Bi(e,t,n,r=0){let i=r?R(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+K(t)}function Vi(e,t,n,r){Bi(e.x,t.x,n.x,r?.x),Bi(e.y,t.y,n.y,r?.y)}function Hi(e,t,n,r,i){return e-=t,e=ri(e,1/n,r),i!==void 0&&(e=ri(e,1/i,r)),e}function Ui(e,t=0,n=1,r=.5,i,a=e,o=e){if(le.test(t)&&(t=parseFloat(t),t=R(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=R(a.min,a.max,r);e===a&&(s-=t),e.min=Hi(e.min,t,n,s,i),e.max=Hi(e.max,t,n,s,i)}function Wi(e,t,[n,r,i],a,o){Ui(e,t[n],t[r],t[i],t.scale,a,o)}var Gi=[`x`,`scaleX`,`originX`],Ki=[`y`,`scaleY`,`originY`];function qi(e,t,n,r){Wi(e.x,t,Gi,n?.x,r?.x),Wi(e.y,t,Ki,n?.y,r?.y)}var Ji=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yi=Ji(`applewebkit/`)&&!Ji(`chrome/`)?Math.round:c;function Xi(e){e.min=Yi(e.min),e.max=Yi(e.max)}function Zi(e){Xi(e.x),Xi(e.y)}function Qi(e){return e.translate===0&&e.scale===1}function $i(e){return Qi(e.x)&&Qi(e.y)}function ea(e,t){return e.min===t.min&&e.max===t.max}function ta(e,t){return ea(e.x,t.x)&&ea(e.y,t.y)}function na(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ra(e,t){return na(e.x,t.x)&&na(e.y,t.y)}function ia(e){return K(e.x)/K(e.y)}function aa(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var oa=class{constructor(){this.members=[]}add(e){C(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Te(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Te(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function sa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Ne.test(e))e=parseFloat(e);else return e}return`${sa(e,t.target.x)}% ${sa(e,t.target.y)}%`}},la={borderRadius:Object.assign({},ca,{applyTo:Vr.slice()}),borderTopLeftRadius:ca,borderTopRightRadius:ca,borderBottomLeftRadius:ca,borderBottomRightRadius:ca,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=he.parse(e);if(i.length>5)return r;let a=he.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=R(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function ua(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<H.length;e++){let t=H[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function q(e){return[e(`x`),e(`y`)]}var da=(e,t)=>e.depth-t.depth,fa=class{constructor(){this.children=[],this.isDirty=!1}add(e){C(this.children,e),this.isDirty=!0}remove(e){Te(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(da),this.isDirty=!1,this.children.forEach(e)}},pa={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ma=[`z`,`skew`,`skewZ`],ha=1e3,ga=0;function _a(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var va=e=>e.instance&&Ge.get(e.instance)?.demote()&&e.resetSkewAndRotation();function ya(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Dr(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,O,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ya(r)}function ba(e){if(e)return e.options.allowProjection===!1?ba(e.parent):e.projection}function xa({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(ve,{...la,...ve}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:ba(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&yi(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=ga++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(wa),this.nodes.forEach(Fa),this.nodes.forEach(Ia),this.nodes.forEach(Ta),_i.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new fa)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new te),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Ur(t)&&!bi(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;O.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=vi(i,250),pa.hasAnimatedSinceResize&&(pa.hasAnimatedSinceResize=!1,this.nodes.forEach(Pa)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||Ha,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!ra(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...sr(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Pa(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,k(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(La),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ya(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;va(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,va(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Oa),this.nodes.forEach(Da);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ka);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ja),this.nodes.forEach(Ma),this.nodes.forEach(Na),this.nodes.forEach(Sa),this.nodes.forEach(Ca)):this.nodes.forEach(ka),this.clearAllSnapshots();let e=N.now();A.delta=u(0,1e3/60,e-A.timestamp),A.timestamp=e,A.isProcessing=!0,oe.update.process(A),oe.preRender.process(A),oe.render.process(A),A.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_e.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ea),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,O.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){O.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!K(this.snapshot.measuredBox.x)&&!K(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=M(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&va(this);let t=this.projectionDelta&&!$i(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||U(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Zi(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return M();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ga))){let{scroll:e}=this.root;e&&(W(t.x,e.offset.x),W(t.y,e.offset.y))}return t}removeElementScroll(e){let t=M();if(G(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&G(t,e),W(t.x,i.offset.x),W(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||M();G(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(W(a.x,-n.scroll.offset.x),W(a.y,-n.scroll.offset.y)),U(n.latestValues)&&fi(a,n.latestValues,n.layout?.layoutBox)}return!r&&U(this.latestValues)&&fi(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=M();G(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!U(n.latestValues))continue;let r;n.instance&&($r(n.latestValues)&&n.updateSnapshot(),r=M(),G(r,n.measurePageBox())),qi(t,n.latestValues,n.snapshot?.layoutBox,r)}return U(this.latestValues)&&qi(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==A.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=A.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=M(),this.targetWithTransforms=M()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zi(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):G(this.target,this.layout.layoutBox),oi(this.target,this.targetDelta)):G(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),_i.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||$r(this.parent.latestValues)||ti(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=M(),this.relativeTargetOrigin=M(),Vi(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),G(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===A.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;G(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;li(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=M());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ai(this.prevProjectionDelta.x,this.projectionDelta.x),Ai(this.prevProjectionDelta.y,this.projectionDelta.y)),Li(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!aa(this.projectionDelta.x,this.prevProjectionDelta.x)||!aa(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_i.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=P(),this.projectionDelta=P(),this.projectionDeltaWithTransform=P()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=P();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=M(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Va));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);Ra(o.x,e.x,n),Ra(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vi(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ba(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&ta(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=M(),G(f,this.relativeTarget)),c&&(this.animationValues=a,wi(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(k(this.pendingAnimation),void 0),this.pendingAnimation=O.update(()=>{pa.hasAnimatedSinceResize=!0,this.motionValue||=s(0),this.motionValue.jump(0,!1),this.currentAnimation=gi(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),v(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(ha),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Wa(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||M(),Ua(i.x,t.x,e.x),Ua(i.y,t.y,e.y)}G(t,i),fi(t,r),Li(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new oa),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!ei(t))return;let n={};for(let t=0;t<ma.length;t++)_a(ma[t],e,n,this.animationValues);for(let t=0;t<H.length;t++)_a(H[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Oe(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Oe(t?.pointerEvents)||``),this.hasProjected&&!U(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=ua(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in ve){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=ve[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Oe(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Da),this.root.sharedNodes.clear()}}}function Sa(e){e.updateLayout(),Aa(e)}function Ca(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)q(e=>{let t=K(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ki(r[e],a[e])}else Wa(i,t.layoutBox,n)&&q(t=>{let n=K(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=P();Li(c,n,t.layoutBox);let l=P();Li(l,a?e.applyTransform(r,!0):n,s);let u=!$i(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=M();Vi(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=M();Vi(l,n,i.layoutBox,s),a&&o(c,l),ra(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function wa(e){_i.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ta(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ea(e){e.clearSnapshot()}function Da(e){e.clearMeasurements()}function Oa(e){e.isLayoutDirty=!0,e.updateLayout()}function ka(e){e.isLayoutDirty=!1}function Aa(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;q(e=>W(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function ja(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Ma(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Na(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Pa(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Fa(e){e.resolveTargetDelta()}function Ia(e){e.calcProjection()}function La(e){e.resetSkewAndRotation()}function Ra(e,t,n){e.translate=R(t.translate,0,n),e.scale=R(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function za(e,t,n,r){e.min=R(t.min,n.min,r),e.max=R(t.max,n.max,r)}function Ba(e,t,n,r){za(e.x,t.x,n.x,r),za(e.y,t.y,n.y,r)}function Va(e){return e.animationValues?.opacityExit!==void 0}var Ha={duration:.45,ease:[.4,0,.1,1]};function Ua(e,t,n){e.max=K(n)+(e.min=t.min)}function Wa(e,t,n){return e===`position`||e===`preserve-aspect`&&!Fi(ia(t),ia(n),.2)}function Ga(e){return e!==e.root&&e.scroll?.wasRoot}function J(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Ka=xa({attachResizeListener:(e,t)=>J(e,`resize`,t),measureScroll:hi,checkIsScrollRoot:()=>!0}),qa=xa({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pe.current){let e=new Ka({});e.mount(window),e.setOptions({layoutScroll:!0}),pe.current=e}return pe.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Ja=class extends Re{constructor(){super(...arguments),this.KeyframeResolver=Br}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;qe(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ya(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Xa(e){return window.getComputedStyle(e)}var Za=class extends Ja{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ya}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Xe.has(t))return this.projection?.isProjecting?o(t):ae(e,t);{let n=Xa(e),r=(Pe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return pi(e,t)}build(e,t,n){Je(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Me(e,t,n)}},Qa=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function $a(e){return{point:{x:e.pageX,y:e.pageY}}}var eo=e=>t=>Qa(t)&&e(t,$a(t));function to(e,t,n,r){return J(e,t,eo(n),r)}var no=new WeakMap,ro,io=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Ur(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ao=io(`inline`,`width`,`offsetWidth`),oo=io(`block`,`height`,`offsetHeight`);function so({target:e,borderBoxSize:t}){no.get(e)?.forEach(n=>{n(e,{get width(){return ao(e,t)},get height(){return oo(e,t)}})})}function co(e){e.forEach(so)}function lo(){typeof ResizeObserver<`u`&&(ro=new ResizeObserver(co))}function uo(e,t){ro||lo();let n=qr(e);return n.forEach(e=>{let n=no.get(e);n||(n=new Set,no.set(e,n)),n.add(t),ro?.observe(e)}),()=>{n.forEach(e=>{let n=no.get(e);n?.delete(t),n?.size||ro?.unobserve(e)})}}var fo=new Set,Y;function po(){Y=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fo.forEach(t=>t(e))},window.addEventListener(`resize`,Y)}function mo(e){return fo.add(e),Y||po(),()=>{fo.delete(e),!fo.size&&typeof Y==`function`&&(window.removeEventListener(`resize`,Y),Y=void 0)}}function ho(e,t){return Gr(typeof e==`function`?mo(e):uo(e,t))}var go=(e,t)=>Math.abs(e-t);function _o(e,t){let n=go(e.x,t.x),r=go(e.y,t.y);return Math.sqrt(n**2+r**2)}var vo=new Set([`auto`,`scroll`]),yo=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xo(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Co(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=_o(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:N.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xo(t,this.transformPagePoint),this.hasPendingMove=!0,O.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Co(e.type===`pointercancel`?this.lastMoveEventInfo:xo(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Qa(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xo($a(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:N.now()}];let{onSessionStart:l}=t;l&&l(e,Co(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=I(to(this.contextWindow,`pointermove`,this.handlePointerMove,u),to(this.contextWindow,`pointerup`,this.handlePointerUp,u),to(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(vo.has(e.overflowX)||vo.has(e.overflowY))&&this.scrollPositions.set(t,bo(t)),t=t.parentElement}this.scrollPositions.set(window,bo(window)),this.removeScrollListeners=I(J(window,`scroll`,this.onElementScroll,{capture:!0}),J(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=bo(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),O.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),k(this.updatePoint)}},bo=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function xo(e,t){return t?{point:t(e.point)}:e}function So(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Co({point:e},t){return{point:e,delta:So(e,To(t)),offset:So(e,wo(t)),velocity:Eo(t,.1)}}function wo(e){return e[0]}function To(e){return e[e.length-1]}function Eo(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=To(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>F(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>F(t)*2&&(r=e[1]);let a=j(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Do=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Oo(e){return Do.has(e.tagName)||e.isContentEditable===!0}var ko=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Ao(e){return ko.has(e.tagName)||e.isContentEditable===!0}var X={x:!1,y:!1};function jo(){return X.x||X.y}function Mo(e){return e===`x`||e===`y`?X[e]?null:(X[e]=!0,()=>{X[e]=!1}):X.x||X.y?null:(X.x=X.y=!0,()=>{X.x=X.y=!1})}function No(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?R(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?R(n,e,r.max):Math.min(e,n)),e}function Po(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Fo(e,{top:t,left:n,bottom:r,right:i}){return{x:Po(e.x,n,i),y:Po(e.y,t,r)}}function Io(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Lo(e,t){return{x:Io(e.x,t.x),y:Io(e.y,t.y)}}function Ro(e,t){let n=.5,r=K(e),i=K(t);return i>r?n=L(t.min,t.max-r,e.min):r>i&&(n=L(e.min,e.max-i,t.min)),u(0,1,n)}function zo(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Bo=.35;function Vo(e=Bo){return e===!1?e=0:e===!0&&(e=Bo),{x:Ho(e,`left`,`right`),y:Ho(e,`top`,`bottom`)}}function Ho(e,t,n){return{min:Uo(e,t),max:Uo(e,n)}}function Uo(e,t){return typeof e==`number`?e:e[t]||0}function Wo(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Go=new WeakMap,Ko=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=M(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=Mo(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),q(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ke(t)&&(t=vr(t,this.visualElement.current)||0),Ne.test(t))t=parseFloat(t);else if(le.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=K(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&O.update(()=>a(e,t),!1,!0),Er(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Zo(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&O.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new yo(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&O.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Z(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=No(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;qo(e)?(!this.constraints||this.scroll!==Wo(n))&&(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Fo(r.layoutBox,e):!1,this.elastic=Vo(t),i!==this.constraints&&!qo(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&q(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=zo(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!qo(e))return!1;let n=Jo(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Wo(r);let i=mi(n,r.root,this.visualElement.getTransformPagePoint()),a=Lo(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(Xr(a));this.hasMutatedConstraints=!!e,e&&(a=Yr(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&Z(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=q(e=>{if(!Z(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Er(this.visualElement,e),n.start(hr(e,n,0,t,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();q(e=>{if(!Z(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-R(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!qo(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};q(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Ro({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(t=>{let n=this.getAxisMotionValue(t);if(!Z(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(R(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Go.set(this.visualElement,this);let e=this.visualElement.current,t=to(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Ao(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=qo(t)&&Jo(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Xo(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),O.read(r);let o=J(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(q(t=>{if(!Z(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Bo,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function qo(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Jo=e=>`current`in e?e.current:e;function Yo(e){let t=!0;return()=>{t?t=!1:e()}}function Xo(e,t,n){let r=ho(e,Yo(n)),i=ho(t,Yo(n));return()=>{r(),i()}}function Z(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Zo(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Qo(e,t){let n=qr(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Gr(()=>r.abort())]}function $o(e){return!(e.pointerType===`touch`||jo())}function es(e,t,n={}){t=Kr(t);let[r,i,a]=Qo(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!$o(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var ts=(e,t)=>t?e===t||ts(e,t.parentElement):!1,ns=new WeakSet;function rs(e){return t=>{t.key===`Enter`&&e(t)}}function is(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var as=(e,t)=>{let n=!1,r=rs(()=>{ns.has(e)||(n=!0,is(e,`down`))}),i=rs(()=>{n&&(n=!1,is(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&is(e,`cancel`)},{...t,once:!0})};function os(e){return Qa(e)&&!jo()}var ss=new WeakSet;function cs(e,t,n={}){t=Kr(t);let[r,i,a]=Qo(e,n),o=e=>{let r=e.currentTarget;if(!os(e)||ss.has(e))return;ns.add(r),n.stopPropagation&&ss.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ns.has(r)&&ns.delete(r),os(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||ts(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Hr(e)&&(e.addEventListener(`focus`,()=>as(e,i),i),!Oo(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Q=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ls=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function us(e,t,n,r){Ya(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ls.has(n)?n:Jr(n),t.attrs[n])}var ds=class extends Ja{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=M}getBaseTargetFromProps(e,t){return Xe.has(t)?super.getBaseTargetFromProps(e,t)??o(t):e[t]}getDefaultValue(e){return Xe.has(e)?this.latestValues[e]??o(e):void 0}readValueFromInstance(e,t){if(Xe.has(t)){let e=ie(t);return e&&e.default||0}if(Ue.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=ls.has(t)?t:Jr(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return be(e,t,n)}build(e,t,n){se(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){us(e,t,n,r)}mount(e){this.isSVGTag=ce(e.tagName),super.mount(e)}};function fs(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ps=[...de].reverse(),ms=e=>e?.out===!0?e:e?.out;function hs(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>Mr(e,t,n))),n=_s(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&V(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&ms(f(l??(g&&g.props.initial))?.transition);if(ps.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?Ee(f)||f===!1?f:void 0:l,y=Ee(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||Ve(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=gs(i.prevProp,v),C=S||y&&(b&&!x||r>h),ee=!1,w=Array.isArray(v)?v:[v],T={},E;if(b!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=V(e,n,yr(e,t))||{};T={...T,...a,...i},E=ms(r)||E}let{prevResolvedValues:te}=i;for(let t in{...te,...T}){if(t in m)continue;let n=T[t],r=te[t],a=Array.isArray(n)&&Array.isArray(r)?!fs(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(ee=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=T,i.prevOut=E,i.isActive&&(m={...m,...T}),C&&(!(x&&S)||ee))for(let n of w){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=V(s,n)?.transition?.delayChildren;r.delay=ar(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!qe(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=_s(),i=!0}}}function gs(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fs(t,e):!1}function _s(){let e={};for(let t of de)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var $=t(e(),1);function vs(e=!0){let t=(0,$.useContext)(a);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,o=(0,$.useId)();(0,$.useEffect)(()=>{if(e)return i(o)},[e]);let s=(0,$.useCallback)(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}var ys=(e,t)=>t.isSVG??Ie(e)?new ds(t):new Za(t,{allowProjection:e!==$.Fragment}),bs=class extends Q{constructor(e){super(e),e.animationState||=hs(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ve(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},xs=0,Ss={animation:{Feature:bs},exit:{Feature:class extends Q{constructor(){super(...arguments),this.id=xs++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=V(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},Cs=class extends Q{constructor(e){super(e),this.removeGroupControls=c,this.removeListeners=c,this.controls=new Ko(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||c}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ws=e=>(t,n)=>{e&&O.update(()=>e(t,n),!1,!0)},Ts=class extends Q{constructor(){super(...arguments),this.removePointerDownListener=c}onPointerDown(e){this.session=new yo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ws(e),onStart:ws(t),onMove:ws(n),onEnd:(e,t)=>{delete this.session,r&&O.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=to(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},Es=n(),Ds=!1,Os=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),ks=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},As=class extends $.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),Ds&&i.root.didUpdate(),i.options.layoutId!==r&&ks(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Os(this.props),onExitComplete:()=>this.safeToRemove()})),pa.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),ks(o,n)),o.setOptions({...o.options,...Os(this.props)}),Ds=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||O.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),_e.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ds=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function js(e){let[t,n]=vs(),r=(0,$.useContext)(Ce);return(0,Es.jsx)(As,{...e,layoutGroup:r,switchLayoutGroup:(0,$.useContext)(Ae),isPresent:t,safeToRemove:n})}var Ms={pan:{Feature:Ts},drag:{Feature:Cs,ProjectionNode:qa,MeasureLayout:js}};function Ns(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&O.postRender(()=>o(t,$a(t)))}var Ps=class extends Q{mount(){let{current:e}=this.node;e&&(this.unmount=es(e,(e,t)=>(Ns(this.node,t,`Hover`,`Start`),e=>Ns(this.node,e,`Hover`,`End`))))}unmount(){}},Fs=class extends Q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=I(J(this.node.current,`focus`,()=>this.onFocus()),J(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Is(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Ns(e,t,`Tap`,n)}var Ls=class extends Q{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=cs(e,(e,t)=>(Is(this.node,t,`Start`),(e,{success:t})=>Is(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Rs=new WeakMap,zs=new WeakMap,Bs=e=>{let t=Rs.get(e.target);t&&t(e)},Vs=e=>{e.forEach(Bs)};function Hs({root:e,...t}){let n=e||document;zs.has(n)||zs.set(n,{});let r=zs.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Vs,{root:e,...t})),r[i]}function Us(e,t,n){let r=Hs(t);return Rs.set(e,n),r.observe(e),()=>{Rs.delete(e),r.unobserve(e)}}var Ws={some:0,all:1},Gs=class extends Q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ws[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Us(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Ks(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ks({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var qs=Object.assign({},Object.assign({renderer:ys},Ss,{inView:{Feature:Gs},tap:{Feature:Ls},focus:{Feature:Fs},hover:{Feature:Ps}}),Ms,{layout:{ProjectionNode:qa,MeasureLayout:js}});export{qs as default};
|