opencami 1.7.0 → 1.8.3

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.
Files changed (83) hide show
  1. package/README.md +167 -7
  2. package/bin/opencami.js +15 -6
  3. package/dist/client/assets/{CSPContext-a-MQmQQt.js → CSPContext-DeJH85nm.js} +1 -1
  4. package/dist/client/assets/{DirectionContext-DRcND-Cm.js → DirectionContext-CxhRpXkm.js} +1 -1
  5. package/dist/client/assets/_sessionKey-CQE0brGK.js +23 -0
  6. package/dist/client/assets/agents-CMTFd_sG.js +2 -0
  7. package/dist/client/assets/agents-screen-BNQGEqcW.js +1 -0
  8. package/dist/client/assets/bots-B6oGzCxP.js +2 -0
  9. package/dist/client/assets/bots-screen-Be3cfGgq.js +1 -0
  10. package/dist/client/assets/button-D9Plv7hu.js +1 -0
  11. package/dist/client/assets/composite-B2KCZKKL.js +1 -0
  12. package/dist/client/assets/{connect-BX1MWO82.js → connect-DuJfnyNK.js} +1 -1
  13. package/dist/client/assets/dashboard-00GpXm5V.js +1 -0
  14. package/dist/client/assets/event-DD8Cz4O9.js +1 -0
  15. package/dist/client/assets/file-explorer-screen-CxwemBES.js +1 -0
  16. package/dist/client/assets/files-DyBJVXBu.js +2 -0
  17. package/dist/client/assets/{index-BlC2sH55.js → index-DtGzE-ea.js} +1 -1
  18. package/dist/client/assets/{index-Dg0mbvtv.js → index-Yo5UhdZV.js} +1 -1
  19. package/dist/client/assets/keyboard-shortcuts-dialog-BZwd-iyV.js +1 -0
  20. package/dist/client/assets/{main-CEuT8-Qi.js → main-CgwdHc9W.js} +16 -8
  21. package/dist/client/assets/{markdown-DKD6ZLRJ.js → markdown-DtWnt4NA.js} +1 -1
  22. package/dist/client/assets/memory-l756yiNq.js +2 -0
  23. package/dist/client/assets/memory-screen-BQtVRuzE.js +1 -0
  24. package/dist/client/assets/menu-BsS6CDf_.js +1 -0
  25. package/dist/client/assets/{opencami-logo-DA69yVKc.js → opencami-logo-Bmge6-FB.js} +1 -1
  26. package/dist/client/assets/popupStateMapping-D0ZbJR_o.js +1 -0
  27. package/dist/client/assets/{proxy-Cawf6X0W.js → proxy-CYZeDXoy.js} +1 -1
  28. package/dist/client/assets/{react-K9goXsVv.js → react-DODKNyyU.js} +1 -1
  29. package/dist/client/assets/search-dialog-DW91SK30.js +1 -0
  30. package/dist/client/assets/session-export-dialog-CliO9Ob-.js +1 -0
  31. package/dist/client/assets/settings-dialog-C1u52aju.js +1 -0
  32. package/dist/client/assets/skills-8T_avaVb.js +2 -0
  33. package/dist/client/assets/{skills-panel-DFL-3BRH.js → skills-panel-DSiH-DLs.js} +1 -1
  34. package/dist/client/assets/styles-DvaLh0o1.css +1 -0
  35. package/dist/client/assets/switch-DbgQPO6i.js +1 -0
  36. package/dist/client/assets/tabs-BsAvZnlD.js +1 -0
  37. package/dist/client/assets/tooltip-DLmutB5C.js +1 -0
  38. package/dist/client/assets/use-file-explorer-state-Cg_yDYJl.js +12 -0
  39. package/dist/client/assets/useBaseUiId-KQTzRPLp.js +1 -0
  40. package/dist/client/assets/useCompositeItem-BPY2_hF_.js +1 -0
  41. package/dist/client/assets/{useControlled-Cl9XA2_f.js → useControlled-B5pEEz2V.js} +1 -1
  42. package/dist/client/assets/{useMutation-C5bTdeC1.js → useMutation-BsQD6FKe.js} +1 -1
  43. package/dist/client/assets/useQuery-CmAJuY2W.js +1 -0
  44. package/dist/client/assets/visuallyHidden-COI6QeQH.js +1 -0
  45. package/dist/client/sw.js +5 -164
  46. package/dist/server/assets/{_sessionKey-BBG3ZUlo.js → _sessionKey-C9o7YfxA.js} +878 -755
  47. package/dist/server/assets/_tanstack-start-manifest_v-BMCAWon2.js +4 -0
  48. package/dist/server/assets/dashboard-GCKodTiJ.js +214 -0
  49. package/dist/server/assets/{index-BgMPaOsU.js → index-Bw-bA_2M.js} +4 -3
  50. package/dist/server/assets/{router-Bl2uabfY.js → router-DCjikH21.js} +704 -207
  51. package/dist/server/assets/{search-dialog-BtSQW9SR.js → search-dialog-BnwiXpdA.js} +5 -4
  52. package/dist/server/assets/settings-dialog-ClKFnZ1x.js +1511 -0
  53. package/dist/server/server.js +2 -2
  54. package/package.json +1 -1
  55. package/dist/client/assets/_sessionKey-BAmpzUOP.js +0 -23
  56. package/dist/client/assets/agents-BkeWu_3a.js +0 -2
  57. package/dist/client/assets/agents-screen-Cb76bcxn.js +0 -1
  58. package/dist/client/assets/bots-CyJwr-JU.js +0 -2
  59. package/dist/client/assets/bots-screen-CzNjLsQH.js +0 -1
  60. package/dist/client/assets/button-DNC5N25i.js +0 -1
  61. package/dist/client/assets/composite-Bliqcmg4.js +0 -1
  62. package/dist/client/assets/file-explorer-screen-CpY1O_ag.js +0 -1
  63. package/dist/client/assets/files-HiN5rXWq.js +0 -2
  64. package/dist/client/assets/keyboard-shortcuts-dialog-C2Hq19LN.js +0 -1
  65. package/dist/client/assets/memory-lhzf-8Q4.js +0 -2
  66. package/dist/client/assets/memory-screen-Zq9qfnJK.js +0 -1
  67. package/dist/client/assets/menu-47ooFeSm.js +0 -1
  68. package/dist/client/assets/owner-CFRNz_Tp.js +0 -1
  69. package/dist/client/assets/popupStateMapping-D5k-jOeY.js +0 -1
  70. package/dist/client/assets/search-dialog-C5Yae9rb.js +0 -1
  71. package/dist/client/assets/session-export-dialog-CBeTfbll.js +0 -1
  72. package/dist/client/assets/settings-dialog-CoeG9M1b.js +0 -1
  73. package/dist/client/assets/skills-BEkw619A.js +0 -2
  74. package/dist/client/assets/styles-D4EBtWYc.css +0 -1
  75. package/dist/client/assets/switch-DAFvLxNX.js +0 -1
  76. package/dist/client/assets/tabs-B2Y_7MvG.js +0 -1
  77. package/dist/client/assets/tooltip-D57Pal0B.js +0 -1
  78. package/dist/client/assets/use-file-explorer-state-DppKEjcl.js +0 -12
  79. package/dist/client/assets/useButton-DVAfkehQ.js +0 -1
  80. package/dist/client/assets/useCompositeItem-CzdGhGcj.js +0 -1
  81. package/dist/client/assets/visuallyHidden-CO3ZD5AQ.js +0 -1
  82. package/dist/server/assets/_tanstack-start-manifest_v-DmMFarHb.js +0 -4
  83. package/dist/server/assets/settings-dialog-D3fOAswX.js +0 -1173
@@ -1,4 +1,4 @@
1
- import{r as x,j as X}from"./main-CEuT8-Qi.js";const Ue=x.createContext({});function We(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Bs=typeof window<"u",js=Bs?x.useLayoutEffect:x.useEffect,qt=x.createContext(null);function Ke(t,e){t.indexOf(e)===-1&&t.push(e)}function $e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const _=(t,e,n)=>n>e?e:n<t?t:n;let Ge=()=>{};const q={},Os=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Ns(t){return typeof t=="object"&&t!==null}const Us=t=>/^0[^.\s]+$/u.test(t);function He(t){let e;return()=>(e===void 0&&(e=t()),e)}const K=t=>t,To=(t,e)=>n=>e(t(n)),Rt=(...t)=>t.reduce(To),Vt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class ze{constructor(){this.subscriptions=[]}add(e){return Ke(this.subscriptions,e),()=>$e(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Y=t=>t*1e3,W=t=>t/1e3;function Ws(t,e){return e?t*(1e3/e):0}const Ks=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Po=1e-7,So=12;function wo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Ks(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Po&&++a<So);return o}function Lt(t,e,n,s){if(t===e&&n===s)return K;const i=r=>wo(r,0,1,t,n);return r=>r===0||r===1?r:Ks(i(r),e,s)}const $s=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Gs=t=>e=>1-t(1-e),Hs=Lt(.33,1.53,.69,.99),_e=Gs(Hs),zs=$s(_e),_s=t=>(t*=2)<1?.5*_e(t):.5*(2-Math.pow(2,-10*(t-1))),Xe=t=>1-Math.sin(Math.acos(t)),Xs=Gs(Xe),Ys=$s(Xe),bo=Lt(.42,0,1,1),Ao=Lt(0,0,.58,1),qs=Lt(.42,0,.58,1),Vo=t=>Array.isArray(t)&&typeof t[0]!="number",Zs=t=>Array.isArray(t)&&typeof t[0]=="number",Co={linear:K,easeIn:bo,easeInOut:qs,easeOut:Ao,circIn:Xe,circInOut:Ys,circOut:Xs,backIn:_e,backInOut:zs,backOut:Hs,anticipate:_s},Mo=t=>typeof t=="string",Pn=t=>{if(Zs(t)){Ge(t.length===4);const[e,n,s,i]=t;return Lt(e,n,s,i)}else if(Mo(t))return Co[t];return t},It=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Do(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),t()),u(a)}const c={schedule:(u,h=!1,f=!1)=>{const m=f&&i?n:s;return h&&o.add(u),m.has(u)||m.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Eo=40;function Js(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=It.reduce((p,w)=>(p[w]=Do(r),p),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:m}=o,g=()=>{const p=q.useManualTiming?i.timestamp:performance.now();n=!1,q.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(p-i.timestamp,Eo),1)),i.timestamp=p,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},y=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:It.reduce((p,w)=>{const S=o[w];return p[w]=(V,E=!1,b=!1)=>(n||y(),S.schedule(V,E,b)),p},{}),cancel:p=>{for(let w=0;w<It.length;w++)o[It[w]].cancel(p)},state:i,steps:o}}const{schedule:C,cancel:Q,state:I,steps:ee}=Js(typeof requestAnimationFrame<"u"?requestAnimationFrame:K,!0);let Nt;function Ro(){Nt=void 0}const j={now:()=>(Nt===void 0&&j.set(I.isProcessing||q.useManualTiming?I.timestamp:performance.now()),Nt),set:t=>{Nt=t,queueMicrotask(Ro)}},Qs=t=>e=>typeof e=="string"&&e.startsWith(t),ti=Qs("--"),Lo=Qs("var(--"),Ye=t=>Lo(t)?ko.test(t.split("/*")[0].trim()):!1,ko=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ct={...pt,transform:t=>_(0,1,t)},Bt={...pt,default:1},St=t=>Math.round(t*1e5)/1e5,qe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Fo(t){return t==null}const Io=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ze=(t,e)=>n=>!!(typeof n=="string"&&Io.test(n)&&n.startsWith(t)||e&&!Fo(n)&&Object.prototype.hasOwnProperty.call(n,e)),ei=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(qe);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Bo=t=>_(0,255,t),ne={...pt,transform:t=>Math.round(Bo(t))},ot={test:Ze("rgb","red"),parse:ei("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ne.transform(t)+", "+ne.transform(e)+", "+ne.transform(n)+", "+St(Ct.transform(s))+")"};function jo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ye={test:Ze("#"),parse:jo,transform:ot.transform},kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Z=kt("deg"),z=kt("%"),T=kt("px"),Oo=kt("vh"),No=kt("vw"),wn={...z,parse:t=>z.parse(t)/100,transform:t=>z.transform(t*100)},ut={test:Ze("hsl","hue"),parse:ei("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+z.transform(St(e))+", "+z.transform(St(n))+", "+St(Ct.transform(s))+")"},R={test:t=>ot.test(t)||ye.test(t)||ut.test(t),parse:t=>ot.test(t)?ot.parse(t):ut.test(t)?ut.parse(t):ye.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ot.transform(t):ut.transform(t),getAnimatableNone:t=>{const e=R.parse(t);return e.alpha=0,R.transform(e)}},Uo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wo(t){return isNaN(t)&&typeof t=="string"&&(t.match(qe)?.length||0)+(t.match(Uo)?.length||0)>0}const ni="number",si="color",Ko="var",$o="var(",bn="${}",Go=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Go,l=>(R.test(l)?(s.color.push(r),i.push(si),n.push(R.parse(l))):l.startsWith($o)?(s.var.push(r),i.push(Ko),n.push(l)):(s.number.push(r),i.push(ni),n.push(parseFloat(l))),++r,bn)).split(bn);return{values:n,split:a,indexes:s,types:i}}function ii(t){return Mt(t).values}function oi(t){const{split:e,types:n}=Mt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===ni?r+=St(i[o]):a===si?r+=R.transform(i[o]):r+=i[o]}return r}}const Ho=t=>typeof t=="number"?0:R.test(t)?R.getAnimatableNone(t):t;function zo(t){const e=ii(t);return oi(t)(e.map(Ho))}const tt={test:Wo,parse:ii,createTransformer:oi,getAnimatableNone:zo};function se(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _o({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=se(l,a,t+1/3),r=se(l,a,t),o=se(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function $t(t,e){return n=>n>0?e:t}const M=(t,e,n)=>t+(e-t)*n,ie=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Xo=[ye,ot,ut],Yo=t=>Xo.find(e=>e.test(t));function An(t){const e=Yo(t);if(!e)return!1;let n=e.parse(t);return e===ut&&(n=_o(n)),n}const Vn=(t,e)=>{const n=An(t),s=An(e);if(!n||!s)return $t(t,e);const i={...n};return r=>(i.red=ie(n.red,s.red,r),i.green=ie(n.green,s.green,r),i.blue=ie(n.blue,s.blue,r),i.alpha=M(n.alpha,s.alpha,r),ot.transform(i))},ve=new Set(["none","hidden"]);function qo(t,e){return ve.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Zo(t,e){return n=>M(t,e,n)}function Je(t){return typeof t=="number"?Zo:typeof t=="string"?Ye(t)?$t:R.test(t)?Vn:tr:Array.isArray(t)?ri:typeof t=="object"?R.test(t)?Vn:Jo:$t}function ri(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Je(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Jo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Je(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Qo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const tr=(t,e)=>{const n=tt.createTransformer(e),s=Mt(t),i=Mt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ve.has(t)&&!i.values.length||ve.has(e)&&!s.values.length?qo(t,e):Rt(ri(Qo(s,i),i.values),n):$t(t,e)};function ai(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):Je(t)(t,e)}const er=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>Q(e),now:()=>I.isProcessing?I.timestamp:j.now()}},li=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Gt=2e4;function Qe(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Gt;)e+=n,s=t.next(e);return e>=Gt?1/0:e}function nr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Qe(s),Gt);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:W(i)}}const sr=5;function ui(t,e,n){const s=Math.max(e-sr,0);return Ws(n-t(s),e-s)}const D={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},oe=.001;function ir({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,r,o=1-e;o=_(D.minDamping,D.maxDamping,o),t=_(D.minDuration,D.maxDuration,W(t)),o<1?(i=c=>{const u=c*o,h=u*t,f=u-n,d=xe(c,o),m=Math.exp(-h);return oe-f/d*m},r=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,m=Math.exp(-h),g=xe(Math.pow(c,2),o);return(-i(c)+oe>0?-1:1)*((f-d)*m)/g}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-oe+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=rr(i,r,a);if(t=Y(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:t}}}const or=12;function rr(t,e,n){let s=n;for(let i=1;i<or;i++)s=s-t(s)/e(s);return s}function xe(t,e){return t*Math.sqrt(1-e*e)}const ar=["duration","bounce"],lr=["stiffness","damping","mass"];function Cn(t,e){return e.some(n=>t[n]!==void 0)}function ur(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!Cn(t,lr)&&Cn(t,ar))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*_(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:r}}else{const n=ir(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function Ht(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=ur({...n,velocity:-W(n.velocity||0)}),m=f||0,g=c/(2*Math.sqrt(l*u)),y=o-r,v=W(Math.sqrt(l/u)),P=Math.abs(y)<5;s||(s=P?D.restSpeed.granular:D.restSpeed.default),i||(i=P?D.restDelta.granular:D.restDelta.default);let p;if(g<1){const S=xe(v,g);p=V=>{const E=Math.exp(-g*v*V);return o-E*((m+g*v*y)/S*Math.sin(S*V)+y*Math.cos(S*V))}}else if(g===1)p=S=>o-Math.exp(-v*S)*(y+(m+v*y)*S);else{const S=v*Math.sqrt(g*g-1);p=V=>{const E=Math.exp(-g*v*V),b=Math.min(S*V,300);return o-E*((m+g*v*y)*Math.sinh(b)+S*y*Math.cosh(b))/S}}const w={calculatedDuration:d&&h||null,next:S=>{const V=p(S);if(d)a.done=S>=h;else{let E=S===0?m:0;g<1&&(E=S===0?Y(m):ui(p,S,V));const b=Math.abs(E)<=s,A=Math.abs(o-V)<=i;a.done=b&&A}return a.value=a.done?o:V,a},toString:()=>{const S=Math.min(Qe(w),Gt),V=li(E=>w.next(S*E).value,S,30);return S+"ms "+V},toTransition:()=>{}};return w}Ht.applyToOptions=t=>{const e=nr(t,100,Ht);return t.ease=e.ease,t.duration=Y(e.duration),t.type="keyframes",t};function Te({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||l!==void 0&&b>l,m=b=>a===void 0?l:l===void 0||Math.abs(a-b)<Math.abs(l-b)?a:l;let g=n*e;const y=h+g,v=o===void 0?y:o(y);v!==y&&(g=v-h);const P=b=>-g*Math.exp(-b/s),p=b=>v+P(b),w=b=>{const A=P(b),L=p(b);f.done=Math.abs(A)<=c,f.value=f.done?v:L};let S,V;const E=b=>{d(f.value)&&(S=b,V=Ht({keyframes:[f.value,m(f.value)],velocity:ui(p,b,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:b=>{let A=!1;return!V&&S===void 0&&(A=!0,w(b),E(b)),S!==void 0&&b>=S?V.next(b-S):(!A&&w(b),f)}}}function cr(t,e,n){const s=[],i=n||q.mix||ai,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||K:e;a=Rt(l,a)}s.push(a)}return s}function hr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Ge(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=cr(e,s,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Vt(t[h],t[h+1],u);return a[h](f)};return n?u=>c(_(t[0],t[r-1],u)):c}function fr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Vt(0,e,s);t.push(M(n,1,i))}}function dr(t){const e=[0];return fr(e,t.length-1),e}function mr(t,e){return t.map(n=>n*e)}function pr(t,e){return t.map(()=>e||qs).splice(0,t.length-1)}function wt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Vo(s)?s.map(Pn):Pn(s),r={done:!1,value:e[0]},o=mr(n&&n.length===e.length?n:dr(e),t),a=hr(o,e,{ease:Array.isArray(i)?i:pr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const gr=t=>t!==null;function tn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(gr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const yr={decay:Te,inertia:Te,tween:wt,keyframes:wt,spring:Ht};function ci(t){typeof t.type=="string"&&(t.type=yr[t.type])}class en{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const vr=t=>t/100;class nn extends en{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;ci(e);const{type:n=wt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||wt;l!==wt&&typeof a[0]!="number"&&(this.mixKeyframes=Rt(vr,ai(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Qe(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let p=this.currentTime,w=s;if(h){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),L=b%1;!L&&b>=1&&(L=1),L===1&&A--,A=Math.min(A,h+1),A%2&&(f==="reverse"?(L=1-L,d&&(L-=d/a)):f==="mirror"&&(w=o)),p=_(0,1,L)*a}const S=P?{done:!1,value:u[0]}:w.next(p);r&&(S.value=r(S.value));let{done:V}=S;!P&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return E&&m!==Te&&(S.value=tn(u,this.options,y,this.speed)),g&&g(S.value),E&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(this.currentTime)}set time(e){e=Y(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(j.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=W(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=er,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(j.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.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}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)}}function xr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const rt=t=>t*180/Math.PI,Pe=t=>{const e=rt(Math.atan2(t[1],t[0]));return Se(e)},Tr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Pe,rotateZ:Pe,skewX:t=>rt(Math.atan(t[1])),skewY:t=>rt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Se=t=>(t=t%360,t<0&&(t+=360),t),Mn=Pe,Dn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),En=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Pr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Dn,scaleY:En,scale:t=>(Dn(t)+En(t))/2,rotateX:t=>Se(rt(Math.atan2(t[6],t[5]))),rotateY:t=>Se(rt(Math.atan2(-t[2],t[0]))),rotateZ:Mn,rotate:Mn,skewX:t=>rt(Math.atan(t[4])),skewY:t=>rt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function we(t){return t.includes("scale")?1:0}function be(t,e){if(!t||t==="none")return we(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Pr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Tr,i=a}if(!i)return we(e);const r=s[e],o=i[1].split(",").map(wr);return typeof r=="function"?r(o):o[r]}const Sr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return be(n,e)};function wr(t){return parseFloat(t.trim())}const gt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yt=new Set(gt),Rn=t=>t===pt||t===T,br=new Set(["x","y","z"]),Ar=gt.filter(t=>!br.has(t));function Vr(t){const e=[];return Ar.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const J={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>be(e,"x"),y:(t,{transform:e})=>be(e,"y")};J.translateX=J.x;J.translateY=J.y;const at=new Set;let Ae=!1,Ve=!1,Ce=!1;function hi(){if(Ve){const t=Array.from(at).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Vr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ve=!1,Ae=!1,at.forEach(t=>t.complete(Ce)),at.clear()}function fi(){at.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ve=!0)})}function Cr(){Ce=!0,fi(),hi(),Ce=!1}class sn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(at.add(this),Ae||(Ae=!0,C.read(fi),C.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}xr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),at.delete(this)}cancel(){this.state==="scheduled"&&(at.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Mr=t=>t.startsWith("--");function Dr(t,e,n){Mr(e)?t.style.setProperty(e,n):t.style[e]=n}const Er=He(()=>window.ScrollTimeline!==void 0),Rr={};function Lr(t,e){const n=He(t);return()=>Rr[e]??n()}const di=Lr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Tt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ln={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tt([0,.65,.55,1]),circOut:Tt([.55,0,1,.45]),backIn:Tt([.31,.01,.66,-.59]),backOut:Tt([.33,1.53,.69,.99])};function mi(t,e){if(t)return typeof t=="function"?di()?li(t,e):"ease-out":Zs(t)?Tt(t):Array.isArray(t)?t.map(n=>mi(n,e)||Ln.easeOut):Ln[t]}function kr(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=mi(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function pi(t){return typeof t=="function"&&"applyToOptions"in t}function Fr({type:t,...e}){return pi(t)&&di()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ir extends en{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Ge(typeof e.type!="string");const c=Fr(e);this.animation=kr(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=tn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Dr(n,s,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return W(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Y(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Er()?(this.animation.timeline=e,K):n(this)}}const gi={anticipate:_s,backInOut:zs,circInOut:Ys};function Br(t){return t in gi}function jr(t){typeof t.ease=="string"&&Br(t.ease)&&(t.ease=gi[t.ease])}const re=10;class Or extends Ir{constructor(e){jr(e),ci(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new nn({...o,autoplay:!1}),l=Math.max(re,j.now()-this.startTime),c=_(0,re,l-re);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const kn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(tt.test(t)||t==="0")&&!t.startsWith("url("));function Nr(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ur(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=kn(i,e),a=kn(r,e);return!o||!a?!1:Nr(t)||(n==="spring"||pi(n))&&s}function Me(t){t.duration=0,t.type="keyframes"}const Wr=new Set(["opacity","clipPath","filter","transform"]),Kr=He(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function $r(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Kr()&&n&&Wr.has(n)&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const Gr=40;class Hr extends en{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=j.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=u?.KeyframeResolver||sn;this.keyframeResolver=new d(a,(m,g,y)=>this.onKeyframesResolved(m,g,f,!y),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=j.now(),Ur(e,r,o,a)||((q.instantAnimations||!l)&&u?.(tn(e,s,n)),e[0]=e[e.length-1],Me(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Gr?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!c&&$r(f),m=f.motionValue?.owner?.current,g=d?new Or({...f,element:m}):new nn(f);g.finished.then(()=>{this.notifyFinished()}).catch(K),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Cr()),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&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function yi(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const zr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _r(t){const e=zr.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function vi(t,e,n=1){const[s,i]=_r(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Os(o)?parseFloat(o):o}return Ye(i)?vi(i,e,n+1):i}const Xr={type:"spring",stiffness:500,damping:25,restSpeed:10},Yr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),qr={type:"keyframes",duration:.8},Zr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Jr=(t,{keyframes:e})=>e.length>2?qr:yt.has(t)?t.startsWith("scale")?Yr(e[1]):Xr:Zr,Qr=t=>t!==null;function ta(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Qr),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function on(t,e){return t?.[e]??t?.default??t}function ea({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const rn=(t,e,n,s={},i,r)=>o=>{const a=on(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-Y(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};ea(a)||Object.assign(u,Jr(t,u)),u.duration&&(u.duration=Y(u.duration)),u.repeatDelay&&(u.repeatDelay=Y(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Me(u),u.delay===0&&(h=!0)),(q.instantAnimations||q.skipAnimations)&&(h=!0,Me(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=ta(u.keyframes,a);if(f!==void 0){C.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new nn(u):new Hr(u)};function Fn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function an(t,e,n,s){if(typeof e=="function"){const[i,r]=Fn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Fn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function dt(t,e,n){const s=t.getProps();return an(s,e,n!==void 0?n:s.custom,t)}const xi=new Set(["width","height","top","left","right","bottom",...gt]),In=30,na=t=>!isNaN(parseFloat(t));class sa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=j.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=j.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=na(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ze);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>In)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,In);return Ws(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function mt(t,e){return new sa(t,e)}const De=t=>Array.isArray(t);function ia(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,mt(n))}function oa(t){return De(t)?t[t.length-1]||0:t}function ra(t,e){const n=dt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=oa(r[o]);ia(t,o,a)}}const B=t=>!!(t&&t.getVelocity);function aa(t){return!!(B(t)&&t.add)}function Ee(t,e){const n=t.getValue("willChange");if(aa(n))return n.add(e);if(!n&&q.WillChange){const s=new q.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ln(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const la="framerAppearId",Ti="data-"+ln(la);function Pi(t){return t.props[Ti]}function ua({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Si(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;const l=r?.reduceMotion;s&&(r=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const f=t.getValue(h,t.latestValues[h]??null),d=a[h];if(d===void 0||u&&ua(u,h))continue;const m={delay:n,...on(r||{},h)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!m.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const p=Pi(t);if(p){const w=window.MotionHandoffAnimation(p,h,C);w!==null&&(m.startTime=w,y=!0)}}Ee(t,h);const v=l??t.shouldReduceMotion;f.start(rn(h,f,d,v&&xi.has(h)?{type:!1}:m,t,y));const P=f.animation;P&&c.push(P)}return o&&Promise.all(c).then(()=>{C.update(()=>{o&&ra(t,o)})}),c}function Re(t,e,n={}){const s=dt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Si(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:h}=i;return ca(t,e,l,c,u,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function ca(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Re(l,e,{...o,delay:n+(typeof s=="function"?0:s)+yi(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function ha(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Re(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Re(t,e,n);else{const i=typeof e=="function"?dt(t,e,n.custom):e;s=Promise.all(Si(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const fa={test:t=>t==="auto",parse:t=>t},wi=t=>e=>e.test(t),bi=[pt,T,z,Z,No,Oo,fa],Bn=t=>bi.find(wi(t));function da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Us(t):!0}const ma=new Set(["brightness","contrast","saturate","opacity"]);function pa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(qe)||[];if(!s)return t;const i=n.replace(s,"");let r=ma.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ga=/\b([a-z-]*)\(.*?\)/gu,Le={...tt,getAnimatableNone:t=>{const e=t.match(ga);return e?e.map(pa).join(" "):t}},jn={...pt,transform:Math.round},ya={rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:Bt,scaleX:Bt,scaleY:Bt,scaleZ:Bt,skew:Z,skewX:Z,skewY:Z,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ct,originX:wn,originY:wn,originZ:T},un={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,fontSize:T,backgroundPositionX:T,backgroundPositionY:T,...ya,zIndex:jn,fillOpacity:Ct,strokeOpacity:Ct,numOctaves:jn},va={...un,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:Le,WebkitFilter:Le},Ai=t=>va[t];function Vi(t,e){let n=Ai(t);return n!==Le&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const xa=new Set(["auto","none","0"]);function Ta(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!xa.has(r)&&Mt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Vi(n,i)}class Pa extends sn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),Ye(h))){const f=vi(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!xi.has(s)||e.length!==2)return;const[i,r]=e,o=Bn(i),a=Bn(r),l=Sn(i),c=Sn(r);if(l!==c&&J[s]){this.needsMeasurement=!0;return}if(o!==a)if(Rn(o)&&Rn(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else J[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||da(e[i]))&&s.push(i);s.length&&Ta(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=J[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=J[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function Sa(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Ci=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ke(t){return Ns(t)&&"offsetHeight"in t}const{schedule:cn}=Js(queueMicrotask,!1),G={x:!1,y:!1};function Mi(){return G.x||G.y}function wa(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function Di(t,e){const n=Sa(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function On(t){return!(t.pointerType==="touch"||Mi())}function ba(t,e,n={}){const[s,i,r]=Di(t,n),o=a=>{if(!On(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=h=>{On(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const Ei=(t,e)=>e?t===e?!0:Ei(t,e.parentElement):!1,hn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Aa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ri(t){return Aa.has(t.tagName)||t.isContentEditable===!0}const Ut=new WeakSet;function Nn(t){return e=>{e.key==="Enter"&&t(e)}}function ae(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Va=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Nn(()=>{if(Ut.has(n))return;ae(n,"down");const i=Nn(()=>{ae(n,"up")}),r=()=>ae(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Un(t){return hn(t)&&!Mi()}function Ca(t,e,n={}){const[s,i,r]=Di(t,n),o=a=>{const l=a.currentTarget;if(!Un(a))return;Ut.add(l);const c=e(l,a),u=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Ut.has(l)&&Ut.delete(l),Un(d)&&typeof c=="function"&&c(d,{success:m})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||Ei(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),ke(a)&&(a.addEventListener("focus",c=>Va(c,i)),!Ri(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Li(t){return Ns(t)&&"ownerSVGElement"in t}function Ma(t){return Li(t)&&t.tagName==="svg"}const Da=[...bi,R,tt],Ea=t=>Da.find(wi(t)),Wn=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:Wn(),y:Wn()}),Kn=()=>({min:0,max:0}),k=()=>({x:Kn(),y:Kn()}),Fe={current:null},ki={current:!1},Ra=typeof window<"u";function La(){if(ki.current=!0,!!Ra)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fe.current=t.matches;t.addEventListener("change",e),e()}else Fe.current=!1}const ka=new WeakMap;function Zt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Dt(t){return typeof t=="string"||Array.isArray(t)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Jt(t){return Zt(t.animate)||dn.some(e=>Dt(t[e]))}function Fi(t){return!!(Jt(t)||t.variants)}function Fa(t,e,n){for(const s in e){const i=e[s],r=n[s];if(B(i))t.addValue(s,i);else if(B(r))t.addValue(s,mt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,mt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const $n=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let zt={};function Ii(t){zt=t}function Ia(){return zt}class Ba{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=j.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,C.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Jt(n),this.isVariantNode=Fi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&B(d)&&d.set(l[f])}}mount(e){this.current=e,ka.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ki.current||La(),this.shouldReduceMotion=Fe.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Q(this.notifyUpdate),Q(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=yt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&C.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in zt){const n=zt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<$n.length;s++){const i=$n[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Fa(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=mt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Os(s)||Us(s))?s=parseFloat(s):!Ea(s)&&tt.test(n)&&(s=Vi(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=an(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ze),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){cn.render(this.render)}}class Bi extends Ba{constructor(){super(...arguments),this.KeyframeResolver=Pa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class et{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ji({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ja({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Oa(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function le(t){return t===void 0||t===1}function Ie({scale:t,scaleX:e,scaleY:n}){return!le(t)||!le(e)||!le(n)}function it(t){return Ie(t)||Oi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Oi(t){return Gn(t.x)||Gn(t.y)}function Gn(t){return t&&t!=="0%"}function _t(t,e,n){const s=t-n,i=e*s;return n+i}function Hn(t,e,n,s,i){return i!==void 0&&(t=_t(t,i,s)),_t(t,n,s)+e}function Be(t,e=0,n=1,s,i){t.min=Hn(t.min,e,n,s,i),t.max=Hn(t.max,e,n,s,i)}function Ni(t,{x:e,y:n}){Be(t.x,e.translate,e.scale,e.originPoint),Be(t.y,n.translate,n.scale,n.originPoint)}const zn=.999999999999,_n=1.0000000000001;function Na(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ft(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ni(t,o)),s&&it(r.latestValues)&&ft(t,r.latestValues))}e.x<_n&&e.x>zn&&(e.x=1),e.y<_n&&e.y>zn&&(e.y=1)}function ht(t,e){t.min=t.min+e,t.max=t.max+e}function Xn(t,e,n,s,i=.5){const r=M(t.min,t.max,i);Be(t,e,n,r,s)}function ft(t,e){Xn(t.x,e.x,e.scaleX,e.scale,e.originX),Xn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ui(t,e){return ji(Oa(t.getBoundingClientRect(),e))}function Ua(t,e,n){const s=Ui(t,n),{scroll:i}=e;return i&&(ht(s.x,i.offset.x),ht(s.y,i.offset.y)),s}const Wa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ka=gt.length;function $a(t,e,n){let s="",i=!0;for(let r=0;r<Ka;r++){const o=gt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=Ci(a,un[o]);if(!l){i=!1;const u=Wa[o]||o;s+=`${u}(${c}) `}n&&(e[o]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function mn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(yt.has(l)){o=!0;continue}else if(ti(l)){i[l]=c;continue}else{const u=Ci(c,un[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(e.transform||(o||n?s.transform=$a(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}function Wi(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function Yn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const xt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Yn(t,e.target.x),s=Yn(t,e.target.y);return`${n}% ${s}%`}},Ga={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=tt.parse(t);if(i.length>5)return s;const r=tt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=M(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),r(i)}},je={borderRadius:{...xt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xt,borderTopRightRadius:xt,borderBottomLeftRadius:xt,borderBottomRightRadius:xt,boxShadow:Ga};function Ki(t,{layout:e,layoutId:n}){return yt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!je[t]||t==="opacity")}function pn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(B(s[o])||i&&B(i[o])||Ki(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Ha(t){return window.getComputedStyle(t)}class za extends Bi{constructor(){super(...arguments),this.type="html",this.renderInstance=Wi}readValueFromInstance(e,n){if(yt.has(n))return this.projection?.isProjecting?we(n):Sr(e,n);{const s=Ha(e),i=(ti(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ui(e,n)}build(e,n,s){mn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return pn(e,n,s)}}const _a={offset:"stroke-dashoffset",array:"stroke-dasharray"},Xa={offset:"strokeDashoffset",array:"strokeDasharray"};function Ya(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?_a:Xa;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const qa=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function $i(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(mn(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const d of qa)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Ya(h,i,r,o,!1)}const Gi=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"]),Hi=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Za(t,e,n,s){Wi(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Gi.has(i)?i:ln(i),e.attrs[i])}function zi(t,e,n){const s=pn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const r=gt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Ja extends Bi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(yt.has(n)){const s=Ai(n);return s&&s.default||0}return n=Gi.has(n)?n:ln(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return zi(e,n,s)}build(e,n,s){$i(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Za(e,n,s,i)}mount(e){this.isSVGTag=Hi(e.tagName),super.mount(e)}}const Qa=dn.length;function _i(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?_i(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Qa;n++){const s=dn[n],i=t.props[s];(Dt(i)||i===!1)&&(e[s]=i)}return e}function Xi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const tl=[...fn].reverse(),el=fn.length;function nl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ha(t,n,s)))}function sl(t){let e=nl(t),n=qn(),s=!0;const i=l=>(c,u)=>{const h=dt(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...m}=h;c={...c,...m,...d}}return c};function r(l){e=l(t)}function o(l){const{props:c}=t,u=_i(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let y=0;y<el;y++){const v=tl[y],P=n[v],p=c[v]!==void 0?c[v]:u[v],w=Dt(p),S=v===l?P.isActive:null;S===!1&&(m=y);let V=p===u[v]&&p!==c[v]&&w;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),P.protectedKeys={...d},!P.isActive&&S===null||!p&&!P.prevProp||Zt(p)||typeof p=="boolean")continue;const E=il(P.prevProp,p);let b=E||v===l&&P.isActive&&!V&&w||y>m&&w,A=!1;const L=Array.isArray(p)?p:[p];let H=L.reduce(i(v),{});S===!1&&(H={});const{prevResolvedValues:vt={}}=P,te={...vt,...H},xn=F=>{b=!0,f.has(F)&&(A=!0,f.delete(F)),P.needsAnimating[F]=!0;const N=t.getValue(F);N&&(N.liveStyle=!1)};for(const F in te){const N=H[F],nt=vt[F];if(d.hasOwnProperty(F))continue;let lt=!1;De(N)&&De(nt)?lt=!Xi(N,nt):lt=N!==nt,lt?N!=null?xn(F):f.add(F):N!==void 0&&f.has(F)?xn(F):P.protectedKeys[F]=!0}P.prevProp=p,P.prevResolvedValues=H,P.isActive&&(d={...d,...H}),s&&t.blockInitialAnimation&&(b=!1);const Tn=V&&E;b&&(!Tn||A)&&h.push(...L.map(F=>{const N={type:v};if(typeof F=="string"&&s&&!Tn&&t.manuallyAnimateOnMount&&t.parent){const{parent:nt}=t,lt=dt(nt,F);if(nt.enteringChildren&&lt){const{delayChildren:xo}=lt.transition||{};N.delay=yi(nt.enteringChildren,t,xo)}}return{animation:F,options:N}}))}if(f.size){const y={};if(typeof c.initial!="boolean"){const v=dt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(y.transition=v.transition)}f.forEach(v=>{const P=t.getBaseTarget(v),p=t.getValue(v);p&&(p.liveStyle=!0),y[v]=P??null}),h.push({animation:y})}let g=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,c)),n[l].isActive=c;const u=o(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=qn()}}}function il(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Xi(e,t):!1}function st(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qn(){return{animate:st(!0),whileInView:st(),whileHover:st(),whileTap:st(),whileDrag:st(),whileFocus:st(),exit:st()}}function Zn(t,e){t.min=e.min,t.max=e.max}function $(t,e){Zn(t.x,e.x),Zn(t.y,e.y)}function Jn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Yi=1e-4,ol=1-Yi,rl=1+Yi,qi=.01,al=0-qi,ll=0+qi;function O(t){return t.max-t.min}function ul(t,e,n){return Math.abs(t-e)<=n}function Qn(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=O(n)/O(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ol&&t.scale<=rl||isNaN(t.scale))&&(t.scale=1),(t.translate>=al&&t.translate<=ll||isNaN(t.translate))&&(t.translate=0)}function bt(t,e,n,s){Qn(t.x,e.x,n.x,s?s.originX:void 0),Qn(t.y,e.y,n.y,s?s.originY:void 0)}function ts(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function cl(t,e,n){ts(t.x,e.x,n.x),ts(t.y,e.y,n.y)}function es(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function Xt(t,e,n){es(t.x,e.x,n.x),es(t.y,e.y,n.y)}function ns(t,e,n,s,i){return t-=e,t=_t(t,1/n,s),i!==void 0&&(t=_t(t,1/i,s)),t}function hl(t,e=0,n=1,s=.5,i,r=t,o=t){if(z.test(e)&&(e=parseFloat(e),e=M(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=M(r.min,r.max,s);t===r&&(a-=e),t.min=ns(t.min,e,n,a,i),t.max=ns(t.max,e,n,a,i)}function ss(t,e,[n,s,i],r,o){hl(t,e[n],e[s],e[i],e.scale,r,o)}const fl=["x","scaleX","originX"],dl=["y","scaleY","originY"];function is(t,e,n,s){ss(t.x,e,fl,n?n.x:void 0,s?s.x:void 0),ss(t.y,e,dl,n?n.y:void 0,s?s.y:void 0)}function os(t){return t.translate===0&&t.scale===1}function Zi(t){return os(t.x)&&os(t.y)}function rs(t,e){return t.min===e.min&&t.max===e.max}function ml(t,e){return rs(t.x,e.x)&&rs(t.y,e.y)}function as(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ji(t,e){return as(t.x,e.x)&&as(t.y,e.y)}function ls(t){return O(t.x)/O(t.y)}function us(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function U(t){return[t("x"),t("y")]}function pl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Qi=["TopLeft","TopRight","BottomLeft","BottomRight"],gl=Qi.length,cs=t=>typeof t=="string"?parseFloat(t):t,hs=t=>typeof t=="number"||T.test(t);function yl(t,e,n,s,i,r){i?(t.opacity=M(0,n.opacity??1,vl(s)),t.opacityExit=M(e.opacity??1,0,xl(s))):r&&(t.opacity=M(e.opacity??1,n.opacity??1,s));for(let o=0;o<gl;o++){const a=`border${Qi[o]}Radius`;let l=fs(e,a),c=fs(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||hs(l)===hs(c)?(t[a]=Math.max(M(cs(l),cs(c),s),0),(z.test(c)||z.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function fs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const vl=to(0,.5,Xs),xl=to(.5,.95,K);function to(t,e,n){return s=>s<t?0:s>e?1:n(Vt(t,e,s))}function Tl(t,e,n){const s=B(t)?t:mt(t);return s.start(rn("",s,e,n)),s.animation}function Et(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Pl=(t,e)=>t.depth-e.depth;class Sl{constructor(){this.children=[],this.isDirty=!1}add(e){Ke(this.children,e),this.isDirty=!0}remove(e){$e(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Pl),this.isDirty=!1,this.children.forEach(e)}}function wl(t,e){const n=j.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Q(s),t(r-e))};return C.setup(s,!0),()=>Q(s)}function Wt(t){return B(t)?t.get():t}class bl{constructor(){this.members=[]}add(e){Ke(this.members,e),e.scheduleRender()}remove(e){if($e(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();const i=s.options.layoutDependency,r=e.options.layoutDependency;i!==void 0&&r!==void 0&&i===r||(e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));const{crossfade:a}=e.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Kt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ue=["","X","Y","Z"],Al=1e3;let Vl=0;function ce(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function eo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Pi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&eo(s)}function no({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Vl++,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.layoutVersion=0,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(Dl),this.nodes.forEach(kl),this.nodes.forEach(Fl),this.nodes.forEach(El)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ze),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Li(o)&&!Ma(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;C.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=wl(f,250),Kt.hasAnimatedSinceResize&&(Kt.hasAnimatedSinceResize=!1,this.nodes.forEach(ps)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Nl,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!Ji(this.targetLayout,d),P=!h&&f;if(this.options.layoutRoot||this.resumeFrom||P||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const p={...on(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(p.delay=0,p.type=!1),this.startAnimation(p),this.setAnimationOrigin(u,P)}else h||ps(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Q(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Il),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&eo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ds);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ms);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ll),this.nodes.forEach(Cl),this.nodes.forEach(Ml)):this.nodes.forEach(ms),this.clearAllSnapshots();const a=j.now();I.delta=_(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,ee.update.process(I),ee.preRender.process(I),ee.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Rl),this.sharedNodes.forEach(Bl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!O(this.snapshot.measuredBox.x)&&!O(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=k(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Zi(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||it(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Ul(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return k();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Wl))){const{scroll:c}=this.root;c&&(ht(a.x,c.offset.x),ht(a.y,c.offset.y))}return a}removeElementScroll(o){const a=k();if($(a,o),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:h}=c;c!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&$(a,o),ht(a.x,u.offset.x),ht(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=k();$(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ft(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),it(u.latestValues)&&ft(l,u.latestValues)}return it(this.latestValues)&&ft(l,this.latestValues),l}removeTransform(o){const a=k();$(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!it(c.latestValues))continue;Ie(c.latestValues)&&c.updateSnapshot();const u=k(),h=c.measurePageBox();$(u,h),is(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return it(this.latestValues)&&is(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=I.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),Ni(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ie(this.parent.latestValues)||Oi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),Xt(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===I.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Na(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=k());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Jn(this.prevProjectionDelta.x,this.projectionDelta.x),Jn(this.prevProjectionDelta.y,this.projectionDelta.y)),bt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!us(this.projectionDelta.x,this.prevProjectionDelta.x)||!us(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ct(),this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=k(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=d!==m,y=this.getStack(),v=!y||y.members.length<=1,P=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Ol));this.animationProgress=0;let p;this.mixTargetDelta=w=>{const S=w/1e3;gs(h.x,o.x,S),gs(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jl(this.relativeTarget,this.relativeTargetOrigin,f,S),p&&ml(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||(p=k()),$(p,this.relativeTarget)),g&&(this.animationValues=u,yl(u,c,this.latestValues,S,P,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Q(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{Kt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=mt(0)),this.currentAnimation=Tl(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Al),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&so(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||k();const h=O(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=O(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}$(a,l),ft(a,u),bt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new bl),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ce("z",o,c,this.animationValues);for(let u=0;u<ue.length;u++)ce(`rotate${ue[u]}`,o,c,this.animationValues),ce(`skew${ue[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Wt(a?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Wt(a?.pointerEvents)||""),this.hasProjected&&!it(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=pl(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in je){if(u[m]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:v}=je[m],P=h==="none"?u[m]:g(u[m],c);if(y){const p=y.length;for(let w=0;w<p;w++)o[y[w]]=P}else v?this.options.visualElement.renderState.vars[m]=P:o[m]=P}this.options.layoutId&&(o.pointerEvents=c===this?Wt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(ds),this.root.sharedNodes.clear()}}}function Cl(t){t.updateLayout()}function Ml(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;i==="size"?U(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],f=O(h);h.min=n[u].min,h.max=h.min+f}):so(i,e.layoutBox,n)&&U(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],f=O(n[u]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+f)});const o=ct();bt(o,n,e.layoutBox);const a=ct();r?bt(a,t.applyTransform(s,!0),e.measuredBox):bt(a,n,e.layoutBox);const l=!Zi(o);let c=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:f}=u;if(h&&f){const d=k();Xt(d,e.layoutBox,h.layoutBox);const m=k();Xt(m,n,f.layoutBox),Ji(d,m)||(c=!0),u.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Dl(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function El(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Rl(t){t.clearSnapshot()}function ds(t){t.clearMeasurements()}function ms(t){t.isLayoutDirty=!1}function Ll(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ps(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function kl(t){t.resolveTargetDelta()}function Fl(t){t.calcProjection()}function Il(t){t.resetSkewAndRotation()}function Bl(t){t.removeLeadSnapshot()}function gs(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ys(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function jl(t,e,n,s){ys(t.x,e.x,n.x,s),ys(t.y,e.y,n.y,s)}function Ol(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Nl={duration:.45,ease:[.4,0,.1,1]},vs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xs=vs("applewebkit/")&&!vs("chrome/")?Math.round:K;function Ts(t){t.min=xs(t.min),t.max=xs(t.max)}function Ul(t){Ts(t.x),Ts(t.y)}function so(t,e,n){return t==="position"||t==="preserve-aspect"&&!ul(ls(e),ls(n),.2)}function Wl(t){return t!==t.root&&t.scroll?.wasRoot}const Kl=no({attachResizeListener:(t,e)=>Et(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),he={current:void 0},io=no({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!he.current){const t=new Kl({});t.mount(window),t.setOptions({layoutScroll:!0}),he.current=t}return he.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),gn=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ps(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $l(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ps(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Ps(t[i],null)}}}}function Gl(...t){return x.useCallback($l(...t),t)}class Hl extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=ke(s)&&s.offsetWidth||0,r=ke(s)&&s.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=r-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function zl({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const r=x.useId(),o=x.useRef(null),a=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=x.useContext(gn),c=t.props?.ref??t?.ref,u=Gl(o,c);return x.useInsertionEffect(()=>{const{width:h,height:f,top:d,left:m,right:g,bottom:y}=a.current;if(e||!o.current||!h||!f)return;const v=n==="left"?`left: ${m}`:`right: ${g}`,P=s==="bottom"?`bottom: ${y}`:`top: ${d}`;o.current.dataset.motionPopId=r;const p=document.createElement("style");l&&(p.nonce=l);const w=i??document.head;return w.appendChild(p),p.sheet&&p.sheet.insertRule(`
1
+ import{r as x,j as X}from"./main-CgwdHc9W.js";const Ue=x.createContext({});function We(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Bs=typeof window<"u",js=Bs?x.useLayoutEffect:x.useEffect,qt=x.createContext(null);function Ke(t,e){t.indexOf(e)===-1&&t.push(e)}function $e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const _=(t,e,n)=>n>e?e:n<t?t:n;let Ge=()=>{};const q={},Os=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Ns(t){return typeof t=="object"&&t!==null}const Us=t=>/^0[^.\s]+$/u.test(t);function He(t){let e;return()=>(e===void 0&&(e=t()),e)}const K=t=>t,To=(t,e)=>n=>e(t(n)),Rt=(...t)=>t.reduce(To),Vt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class ze{constructor(){this.subscriptions=[]}add(e){return Ke(this.subscriptions,e),()=>$e(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Y=t=>t*1e3,W=t=>t/1e3;function Ws(t,e){return e?t*(1e3/e):0}const Ks=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Po=1e-7,So=12;function wo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Ks(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Po&&++a<So);return o}function Lt(t,e,n,s){if(t===e&&n===s)return K;const i=r=>wo(r,0,1,t,n);return r=>r===0||r===1?r:Ks(i(r),e,s)}const $s=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Gs=t=>e=>1-t(1-e),Hs=Lt(.33,1.53,.69,.99),_e=Gs(Hs),zs=$s(_e),_s=t=>(t*=2)<1?.5*_e(t):.5*(2-Math.pow(2,-10*(t-1))),Xe=t=>1-Math.sin(Math.acos(t)),Xs=Gs(Xe),Ys=$s(Xe),bo=Lt(.42,0,1,1),Ao=Lt(0,0,.58,1),qs=Lt(.42,0,.58,1),Vo=t=>Array.isArray(t)&&typeof t[0]!="number",Zs=t=>Array.isArray(t)&&typeof t[0]=="number",Co={linear:K,easeIn:bo,easeInOut:qs,easeOut:Ao,circIn:Xe,circInOut:Ys,circOut:Xs,backIn:_e,backInOut:zs,backOut:Hs,anticipate:_s},Mo=t=>typeof t=="string",Pn=t=>{if(Zs(t)){Ge(t.length===4);const[e,n,s,i]=t;return Lt(e,n,s,i)}else if(Mo(t))return Co[t];return t},It=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Do(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),t()),u(a)}const c={schedule:(u,h=!1,f=!1)=>{const m=f&&i?n:s;return h&&o.add(u),m.has(u)||m.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Eo=40;function Js(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=It.reduce((p,w)=>(p[w]=Do(r),p),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:m}=o,g=()=>{const p=q.useManualTiming?i.timestamp:performance.now();n=!1,q.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(p-i.timestamp,Eo),1)),i.timestamp=p,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},y=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:It.reduce((p,w)=>{const S=o[w];return p[w]=(V,E=!1,b=!1)=>(n||y(),S.schedule(V,E,b)),p},{}),cancel:p=>{for(let w=0;w<It.length;w++)o[It[w]].cancel(p)},state:i,steps:o}}const{schedule:C,cancel:Q,state:I,steps:ee}=Js(typeof requestAnimationFrame<"u"?requestAnimationFrame:K,!0);let Nt;function Ro(){Nt=void 0}const j={now:()=>(Nt===void 0&&j.set(I.isProcessing||q.useManualTiming?I.timestamp:performance.now()),Nt),set:t=>{Nt=t,queueMicrotask(Ro)}},Qs=t=>e=>typeof e=="string"&&e.startsWith(t),ti=Qs("--"),Lo=Qs("var(--"),Ye=t=>Lo(t)?ko.test(t.split("/*")[0].trim()):!1,ko=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ct={...pt,transform:t=>_(0,1,t)},Bt={...pt,default:1},St=t=>Math.round(t*1e5)/1e5,qe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Fo(t){return t==null}const Io=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ze=(t,e)=>n=>!!(typeof n=="string"&&Io.test(n)&&n.startsWith(t)||e&&!Fo(n)&&Object.prototype.hasOwnProperty.call(n,e)),ei=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(qe);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Bo=t=>_(0,255,t),ne={...pt,transform:t=>Math.round(Bo(t))},ot={test:Ze("rgb","red"),parse:ei("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ne.transform(t)+", "+ne.transform(e)+", "+ne.transform(n)+", "+St(Ct.transform(s))+")"};function jo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ye={test:Ze("#"),parse:jo,transform:ot.transform},kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Z=kt("deg"),z=kt("%"),T=kt("px"),Oo=kt("vh"),No=kt("vw"),wn={...z,parse:t=>z.parse(t)/100,transform:t=>z.transform(t*100)},ut={test:Ze("hsl","hue"),parse:ei("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+z.transform(St(e))+", "+z.transform(St(n))+", "+St(Ct.transform(s))+")"},R={test:t=>ot.test(t)||ye.test(t)||ut.test(t),parse:t=>ot.test(t)?ot.parse(t):ut.test(t)?ut.parse(t):ye.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ot.transform(t):ut.transform(t),getAnimatableNone:t=>{const e=R.parse(t);return e.alpha=0,R.transform(e)}},Uo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wo(t){return isNaN(t)&&typeof t=="string"&&(t.match(qe)?.length||0)+(t.match(Uo)?.length||0)>0}const ni="number",si="color",Ko="var",$o="var(",bn="${}",Go=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Go,l=>(R.test(l)?(s.color.push(r),i.push(si),n.push(R.parse(l))):l.startsWith($o)?(s.var.push(r),i.push(Ko),n.push(l)):(s.number.push(r),i.push(ni),n.push(parseFloat(l))),++r,bn)).split(bn);return{values:n,split:a,indexes:s,types:i}}function ii(t){return Mt(t).values}function oi(t){const{split:e,types:n}=Mt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===ni?r+=St(i[o]):a===si?r+=R.transform(i[o]):r+=i[o]}return r}}const Ho=t=>typeof t=="number"?0:R.test(t)?R.getAnimatableNone(t):t;function zo(t){const e=ii(t);return oi(t)(e.map(Ho))}const tt={test:Wo,parse:ii,createTransformer:oi,getAnimatableNone:zo};function se(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _o({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=se(l,a,t+1/3),r=se(l,a,t),o=se(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function $t(t,e){return n=>n>0?e:t}const M=(t,e,n)=>t+(e-t)*n,ie=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Xo=[ye,ot,ut],Yo=t=>Xo.find(e=>e.test(t));function An(t){const e=Yo(t);if(!e)return!1;let n=e.parse(t);return e===ut&&(n=_o(n)),n}const Vn=(t,e)=>{const n=An(t),s=An(e);if(!n||!s)return $t(t,e);const i={...n};return r=>(i.red=ie(n.red,s.red,r),i.green=ie(n.green,s.green,r),i.blue=ie(n.blue,s.blue,r),i.alpha=M(n.alpha,s.alpha,r),ot.transform(i))},ve=new Set(["none","hidden"]);function qo(t,e){return ve.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Zo(t,e){return n=>M(t,e,n)}function Je(t){return typeof t=="number"?Zo:typeof t=="string"?Ye(t)?$t:R.test(t)?Vn:tr:Array.isArray(t)?ri:typeof t=="object"?R.test(t)?Vn:Jo:$t}function ri(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Je(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Jo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Je(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Qo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const tr=(t,e)=>{const n=tt.createTransformer(e),s=Mt(t),i=Mt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ve.has(t)&&!i.values.length||ve.has(e)&&!s.values.length?qo(t,e):Rt(ri(Qo(s,i),i.values),n):$t(t,e)};function ai(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):Je(t)(t,e)}const er=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>Q(e),now:()=>I.isProcessing?I.timestamp:j.now()}},li=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Gt=2e4;function Qe(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Gt;)e+=n,s=t.next(e);return e>=Gt?1/0:e}function nr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Qe(s),Gt);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:W(i)}}const sr=5;function ui(t,e,n){const s=Math.max(e-sr,0);return Ws(n-t(s),e-s)}const D={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},oe=.001;function ir({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,r,o=1-e;o=_(D.minDamping,D.maxDamping,o),t=_(D.minDuration,D.maxDuration,W(t)),o<1?(i=c=>{const u=c*o,h=u*t,f=u-n,d=xe(c,o),m=Math.exp(-h);return oe-f/d*m},r=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,m=Math.exp(-h),g=xe(Math.pow(c,2),o);return(-i(c)+oe>0?-1:1)*((f-d)*m)/g}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-oe+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=rr(i,r,a);if(t=Y(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:t}}}const or=12;function rr(t,e,n){let s=n;for(let i=1;i<or;i++)s=s-t(s)/e(s);return s}function xe(t,e){return t*Math.sqrt(1-e*e)}const ar=["duration","bounce"],lr=["stiffness","damping","mass"];function Cn(t,e){return e.some(n=>t[n]!==void 0)}function ur(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!Cn(t,lr)&&Cn(t,ar))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*_(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:r}}else{const n=ir(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function Ht(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=ur({...n,velocity:-W(n.velocity||0)}),m=f||0,g=c/(2*Math.sqrt(l*u)),y=o-r,v=W(Math.sqrt(l/u)),P=Math.abs(y)<5;s||(s=P?D.restSpeed.granular:D.restSpeed.default),i||(i=P?D.restDelta.granular:D.restDelta.default);let p;if(g<1){const S=xe(v,g);p=V=>{const E=Math.exp(-g*v*V);return o-E*((m+g*v*y)/S*Math.sin(S*V)+y*Math.cos(S*V))}}else if(g===1)p=S=>o-Math.exp(-v*S)*(y+(m+v*y)*S);else{const S=v*Math.sqrt(g*g-1);p=V=>{const E=Math.exp(-g*v*V),b=Math.min(S*V,300);return o-E*((m+g*v*y)*Math.sinh(b)+S*y*Math.cosh(b))/S}}const w={calculatedDuration:d&&h||null,next:S=>{const V=p(S);if(d)a.done=S>=h;else{let E=S===0?m:0;g<1&&(E=S===0?Y(m):ui(p,S,V));const b=Math.abs(E)<=s,A=Math.abs(o-V)<=i;a.done=b&&A}return a.value=a.done?o:V,a},toString:()=>{const S=Math.min(Qe(w),Gt),V=li(E=>w.next(S*E).value,S,30);return S+"ms "+V},toTransition:()=>{}};return w}Ht.applyToOptions=t=>{const e=nr(t,100,Ht);return t.ease=e.ease,t.duration=Y(e.duration),t.type="keyframes",t};function Te({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||l!==void 0&&b>l,m=b=>a===void 0?l:l===void 0||Math.abs(a-b)<Math.abs(l-b)?a:l;let g=n*e;const y=h+g,v=o===void 0?y:o(y);v!==y&&(g=v-h);const P=b=>-g*Math.exp(-b/s),p=b=>v+P(b),w=b=>{const A=P(b),L=p(b);f.done=Math.abs(A)<=c,f.value=f.done?v:L};let S,V;const E=b=>{d(f.value)&&(S=b,V=Ht({keyframes:[f.value,m(f.value)],velocity:ui(p,b,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:b=>{let A=!1;return!V&&S===void 0&&(A=!0,w(b),E(b)),S!==void 0&&b>=S?V.next(b-S):(!A&&w(b),f)}}}function cr(t,e,n){const s=[],i=n||q.mix||ai,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||K:e;a=Rt(l,a)}s.push(a)}return s}function hr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Ge(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=cr(e,s,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Vt(t[h],t[h+1],u);return a[h](f)};return n?u=>c(_(t[0],t[r-1],u)):c}function fr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Vt(0,e,s);t.push(M(n,1,i))}}function dr(t){const e=[0];return fr(e,t.length-1),e}function mr(t,e){return t.map(n=>n*e)}function pr(t,e){return t.map(()=>e||qs).splice(0,t.length-1)}function wt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Vo(s)?s.map(Pn):Pn(s),r={done:!1,value:e[0]},o=mr(n&&n.length===e.length?n:dr(e),t),a=hr(o,e,{ease:Array.isArray(i)?i:pr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const gr=t=>t!==null;function tn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(gr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const yr={decay:Te,inertia:Te,tween:wt,keyframes:wt,spring:Ht};function ci(t){typeof t.type=="string"&&(t.type=yr[t.type])}class en{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const vr=t=>t/100;class nn extends en{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;ci(e);const{type:n=wt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||wt;l!==wt&&typeof a[0]!="number"&&(this.mixKeyframes=Rt(vr,ai(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Qe(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let p=this.currentTime,w=s;if(h){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),L=b%1;!L&&b>=1&&(L=1),L===1&&A--,A=Math.min(A,h+1),A%2&&(f==="reverse"?(L=1-L,d&&(L-=d/a)):f==="mirror"&&(w=o)),p=_(0,1,L)*a}const S=P?{done:!1,value:u[0]}:w.next(p);r&&(S.value=r(S.value));let{done:V}=S;!P&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return E&&m!==Te&&(S.value=tn(u,this.options,y,this.speed)),g&&g(S.value),E&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(this.currentTime)}set time(e){e=Y(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(j.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=W(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=er,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(j.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.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}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)}}function xr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const rt=t=>t*180/Math.PI,Pe=t=>{const e=rt(Math.atan2(t[1],t[0]));return Se(e)},Tr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Pe,rotateZ:Pe,skewX:t=>rt(Math.atan(t[1])),skewY:t=>rt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Se=t=>(t=t%360,t<0&&(t+=360),t),Mn=Pe,Dn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),En=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Pr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Dn,scaleY:En,scale:t=>(Dn(t)+En(t))/2,rotateX:t=>Se(rt(Math.atan2(t[6],t[5]))),rotateY:t=>Se(rt(Math.atan2(-t[2],t[0]))),rotateZ:Mn,rotate:Mn,skewX:t=>rt(Math.atan(t[4])),skewY:t=>rt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function we(t){return t.includes("scale")?1:0}function be(t,e){if(!t||t==="none")return we(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Pr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Tr,i=a}if(!i)return we(e);const r=s[e],o=i[1].split(",").map(wr);return typeof r=="function"?r(o):o[r]}const Sr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return be(n,e)};function wr(t){return parseFloat(t.trim())}const gt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yt=new Set(gt),Rn=t=>t===pt||t===T,br=new Set(["x","y","z"]),Ar=gt.filter(t=>!br.has(t));function Vr(t){const e=[];return Ar.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const J={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>be(e,"x"),y:(t,{transform:e})=>be(e,"y")};J.translateX=J.x;J.translateY=J.y;const at=new Set;let Ae=!1,Ve=!1,Ce=!1;function hi(){if(Ve){const t=Array.from(at).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Vr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ve=!1,Ae=!1,at.forEach(t=>t.complete(Ce)),at.clear()}function fi(){at.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ve=!0)})}function Cr(){Ce=!0,fi(),hi(),Ce=!1}class sn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(at.add(this),Ae||(Ae=!0,C.read(fi),C.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}xr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),at.delete(this)}cancel(){this.state==="scheduled"&&(at.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Mr=t=>t.startsWith("--");function Dr(t,e,n){Mr(e)?t.style.setProperty(e,n):t.style[e]=n}const Er=He(()=>window.ScrollTimeline!==void 0),Rr={};function Lr(t,e){const n=He(t);return()=>Rr[e]??n()}const di=Lr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Tt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ln={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tt([0,.65,.55,1]),circOut:Tt([.55,0,1,.45]),backIn:Tt([.31,.01,.66,-.59]),backOut:Tt([.33,1.53,.69,.99])};function mi(t,e){if(t)return typeof t=="function"?di()?li(t,e):"ease-out":Zs(t)?Tt(t):Array.isArray(t)?t.map(n=>mi(n,e)||Ln.easeOut):Ln[t]}function kr(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=mi(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function pi(t){return typeof t=="function"&&"applyToOptions"in t}function Fr({type:t,...e}){return pi(t)&&di()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ir extends en{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Ge(typeof e.type!="string");const c=Fr(e);this.animation=kr(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=tn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Dr(n,s,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return W(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Y(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Er()?(this.animation.timeline=e,K):n(this)}}const gi={anticipate:_s,backInOut:zs,circInOut:Ys};function Br(t){return t in gi}function jr(t){typeof t.ease=="string"&&Br(t.ease)&&(t.ease=gi[t.ease])}const re=10;class Or extends Ir{constructor(e){jr(e),ci(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new nn({...o,autoplay:!1}),l=Math.max(re,j.now()-this.startTime),c=_(0,re,l-re);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const kn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(tt.test(t)||t==="0")&&!t.startsWith("url("));function Nr(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ur(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=kn(i,e),a=kn(r,e);return!o||!a?!1:Nr(t)||(n==="spring"||pi(n))&&s}function Me(t){t.duration=0,t.type="keyframes"}const Wr=new Set(["opacity","clipPath","filter","transform"]),Kr=He(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function $r(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Kr()&&n&&Wr.has(n)&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const Gr=40;class Hr extends en{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=j.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=u?.KeyframeResolver||sn;this.keyframeResolver=new d(a,(m,g,y)=>this.onKeyframesResolved(m,g,f,!y),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=j.now(),Ur(e,r,o,a)||((q.instantAnimations||!l)&&u?.(tn(e,s,n)),e[0]=e[e.length-1],Me(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Gr?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!c&&$r(f),m=f.motionValue?.owner?.current,g=d?new Or({...f,element:m}):new nn(f);g.finished.then(()=>{this.notifyFinished()}).catch(K),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Cr()),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&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function yi(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const zr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _r(t){const e=zr.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function vi(t,e,n=1){const[s,i]=_r(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Os(o)?parseFloat(o):o}return Ye(i)?vi(i,e,n+1):i}const Xr={type:"spring",stiffness:500,damping:25,restSpeed:10},Yr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),qr={type:"keyframes",duration:.8},Zr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Jr=(t,{keyframes:e})=>e.length>2?qr:yt.has(t)?t.startsWith("scale")?Yr(e[1]):Xr:Zr,Qr=t=>t!==null;function ta(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Qr),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function on(t,e){return t?.[e]??t?.default??t}function ea({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const rn=(t,e,n,s={},i,r)=>o=>{const a=on(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-Y(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};ea(a)||Object.assign(u,Jr(t,u)),u.duration&&(u.duration=Y(u.duration)),u.repeatDelay&&(u.repeatDelay=Y(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Me(u),u.delay===0&&(h=!0)),(q.instantAnimations||q.skipAnimations)&&(h=!0,Me(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=ta(u.keyframes,a);if(f!==void 0){C.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new nn(u):new Hr(u)};function Fn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function an(t,e,n,s){if(typeof e=="function"){const[i,r]=Fn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Fn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function dt(t,e,n){const s=t.getProps();return an(s,e,n!==void 0?n:s.custom,t)}const xi=new Set(["width","height","top","left","right","bottom",...gt]),In=30,na=t=>!isNaN(parseFloat(t));class sa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=j.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=j.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=na(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ze);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>In)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,In);return Ws(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function mt(t,e){return new sa(t,e)}const De=t=>Array.isArray(t);function ia(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,mt(n))}function oa(t){return De(t)?t[t.length-1]||0:t}function ra(t,e){const n=dt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=oa(r[o]);ia(t,o,a)}}const B=t=>!!(t&&t.getVelocity);function aa(t){return!!(B(t)&&t.add)}function Ee(t,e){const n=t.getValue("willChange");if(aa(n))return n.add(e);if(!n&&q.WillChange){const s=new q.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ln(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const la="framerAppearId",Ti="data-"+ln(la);function Pi(t){return t.props[Ti]}function ua({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Si(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;const l=r?.reduceMotion;s&&(r=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const f=t.getValue(h,t.latestValues[h]??null),d=a[h];if(d===void 0||u&&ua(u,h))continue;const m={delay:n,...on(r||{},h)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!m.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const p=Pi(t);if(p){const w=window.MotionHandoffAnimation(p,h,C);w!==null&&(m.startTime=w,y=!0)}}Ee(t,h);const v=l??t.shouldReduceMotion;f.start(rn(h,f,d,v&&xi.has(h)?{type:!1}:m,t,y));const P=f.animation;P&&c.push(P)}return o&&Promise.all(c).then(()=>{C.update(()=>{o&&ra(t,o)})}),c}function Re(t,e,n={}){const s=dt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Si(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:h}=i;return ca(t,e,l,c,u,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function ca(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Re(l,e,{...o,delay:n+(typeof s=="function"?0:s)+yi(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function ha(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Re(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Re(t,e,n);else{const i=typeof e=="function"?dt(t,e,n.custom):e;s=Promise.all(Si(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const fa={test:t=>t==="auto",parse:t=>t},wi=t=>e=>e.test(t),bi=[pt,T,z,Z,No,Oo,fa],Bn=t=>bi.find(wi(t));function da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Us(t):!0}const ma=new Set(["brightness","contrast","saturate","opacity"]);function pa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(qe)||[];if(!s)return t;const i=n.replace(s,"");let r=ma.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ga=/\b([a-z-]*)\(.*?\)/gu,Le={...tt,getAnimatableNone:t=>{const e=t.match(ga);return e?e.map(pa).join(" "):t}},jn={...pt,transform:Math.round},ya={rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:Bt,scaleX:Bt,scaleY:Bt,scaleZ:Bt,skew:Z,skewX:Z,skewY:Z,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ct,originX:wn,originY:wn,originZ:T},un={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,fontSize:T,backgroundPositionX:T,backgroundPositionY:T,...ya,zIndex:jn,fillOpacity:Ct,strokeOpacity:Ct,numOctaves:jn},va={...un,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:Le,WebkitFilter:Le},Ai=t=>va[t];function Vi(t,e){let n=Ai(t);return n!==Le&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const xa=new Set(["auto","none","0"]);function Ta(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!xa.has(r)&&Mt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Vi(n,i)}class Pa extends sn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),Ye(h))){const f=vi(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!xi.has(s)||e.length!==2)return;const[i,r]=e,o=Bn(i),a=Bn(r),l=Sn(i),c=Sn(r);if(l!==c&&J[s]){this.needsMeasurement=!0;return}if(o!==a)if(Rn(o)&&Rn(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else J[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||da(e[i]))&&s.push(i);s.length&&Ta(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=J[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=J[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function Sa(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Ci=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ke(t){return Ns(t)&&"offsetHeight"in t}const{schedule:cn}=Js(queueMicrotask,!1),G={x:!1,y:!1};function Mi(){return G.x||G.y}function wa(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function Di(t,e){const n=Sa(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function On(t){return!(t.pointerType==="touch"||Mi())}function ba(t,e,n={}){const[s,i,r]=Di(t,n),o=a=>{if(!On(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=h=>{On(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const Ei=(t,e)=>e?t===e?!0:Ei(t,e.parentElement):!1,hn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Aa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ri(t){return Aa.has(t.tagName)||t.isContentEditable===!0}const Ut=new WeakSet;function Nn(t){return e=>{e.key==="Enter"&&t(e)}}function ae(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Va=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Nn(()=>{if(Ut.has(n))return;ae(n,"down");const i=Nn(()=>{ae(n,"up")}),r=()=>ae(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Un(t){return hn(t)&&!Mi()}function Ca(t,e,n={}){const[s,i,r]=Di(t,n),o=a=>{const l=a.currentTarget;if(!Un(a))return;Ut.add(l);const c=e(l,a),u=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Ut.has(l)&&Ut.delete(l),Un(d)&&typeof c=="function"&&c(d,{success:m})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||Ei(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),ke(a)&&(a.addEventListener("focus",c=>Va(c,i)),!Ri(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Li(t){return Ns(t)&&"ownerSVGElement"in t}function Ma(t){return Li(t)&&t.tagName==="svg"}const Da=[...bi,R,tt],Ea=t=>Da.find(wi(t)),Wn=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:Wn(),y:Wn()}),Kn=()=>({min:0,max:0}),k=()=>({x:Kn(),y:Kn()}),Fe={current:null},ki={current:!1},Ra=typeof window<"u";function La(){if(ki.current=!0,!!Ra)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fe.current=t.matches;t.addEventListener("change",e),e()}else Fe.current=!1}const ka=new WeakMap;function Zt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Dt(t){return typeof t=="string"||Array.isArray(t)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Jt(t){return Zt(t.animate)||dn.some(e=>Dt(t[e]))}function Fi(t){return!!(Jt(t)||t.variants)}function Fa(t,e,n){for(const s in e){const i=e[s],r=n[s];if(B(i))t.addValue(s,i);else if(B(r))t.addValue(s,mt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,mt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const $n=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let zt={};function Ii(t){zt=t}function Ia(){return zt}class Ba{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=j.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,C.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Jt(n),this.isVariantNode=Fi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&B(d)&&d.set(l[f])}}mount(e){this.current=e,ka.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ki.current||La(),this.shouldReduceMotion=Fe.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Q(this.notifyUpdate),Q(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=yt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&C.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in zt){const n=zt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<$n.length;s++){const i=$n[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Fa(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=mt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Os(s)||Us(s))?s=parseFloat(s):!Ea(s)&&tt.test(n)&&(s=Vi(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=an(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ze),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){cn.render(this.render)}}class Bi extends Ba{constructor(){super(...arguments),this.KeyframeResolver=Pa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class et{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ji({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ja({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Oa(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function le(t){return t===void 0||t===1}function Ie({scale:t,scaleX:e,scaleY:n}){return!le(t)||!le(e)||!le(n)}function it(t){return Ie(t)||Oi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Oi(t){return Gn(t.x)||Gn(t.y)}function Gn(t){return t&&t!=="0%"}function _t(t,e,n){const s=t-n,i=e*s;return n+i}function Hn(t,e,n,s,i){return i!==void 0&&(t=_t(t,i,s)),_t(t,n,s)+e}function Be(t,e=0,n=1,s,i){t.min=Hn(t.min,e,n,s,i),t.max=Hn(t.max,e,n,s,i)}function Ni(t,{x:e,y:n}){Be(t.x,e.translate,e.scale,e.originPoint),Be(t.y,n.translate,n.scale,n.originPoint)}const zn=.999999999999,_n=1.0000000000001;function Na(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ft(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ni(t,o)),s&&it(r.latestValues)&&ft(t,r.latestValues))}e.x<_n&&e.x>zn&&(e.x=1),e.y<_n&&e.y>zn&&(e.y=1)}function ht(t,e){t.min=t.min+e,t.max=t.max+e}function Xn(t,e,n,s,i=.5){const r=M(t.min,t.max,i);Be(t,e,n,r,s)}function ft(t,e){Xn(t.x,e.x,e.scaleX,e.scale,e.originX),Xn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ui(t,e){return ji(Oa(t.getBoundingClientRect(),e))}function Ua(t,e,n){const s=Ui(t,n),{scroll:i}=e;return i&&(ht(s.x,i.offset.x),ht(s.y,i.offset.y)),s}const Wa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ka=gt.length;function $a(t,e,n){let s="",i=!0;for(let r=0;r<Ka;r++){const o=gt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=Ci(a,un[o]);if(!l){i=!1;const u=Wa[o]||o;s+=`${u}(${c}) `}n&&(e[o]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function mn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(yt.has(l)){o=!0;continue}else if(ti(l)){i[l]=c;continue}else{const u=Ci(c,un[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(e.transform||(o||n?s.transform=$a(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}function Wi(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function Yn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const xt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Yn(t,e.target.x),s=Yn(t,e.target.y);return`${n}% ${s}%`}},Ga={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=tt.parse(t);if(i.length>5)return s;const r=tt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=M(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),r(i)}},je={borderRadius:{...xt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xt,borderTopRightRadius:xt,borderBottomLeftRadius:xt,borderBottomRightRadius:xt,boxShadow:Ga};function Ki(t,{layout:e,layoutId:n}){return yt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!je[t]||t==="opacity")}function pn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(B(s[o])||i&&B(i[o])||Ki(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Ha(t){return window.getComputedStyle(t)}class za extends Bi{constructor(){super(...arguments),this.type="html",this.renderInstance=Wi}readValueFromInstance(e,n){if(yt.has(n))return this.projection?.isProjecting?we(n):Sr(e,n);{const s=Ha(e),i=(ti(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ui(e,n)}build(e,n,s){mn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return pn(e,n,s)}}const _a={offset:"stroke-dashoffset",array:"stroke-dasharray"},Xa={offset:"strokeDashoffset",array:"strokeDasharray"};function Ya(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?_a:Xa;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const qa=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function $i(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(mn(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const d of qa)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Ya(h,i,r,o,!1)}const Gi=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"]),Hi=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Za(t,e,n,s){Wi(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Gi.has(i)?i:ln(i),e.attrs[i])}function zi(t,e,n){const s=pn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const r=gt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Ja extends Bi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(yt.has(n)){const s=Ai(n);return s&&s.default||0}return n=Gi.has(n)?n:ln(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return zi(e,n,s)}build(e,n,s){$i(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Za(e,n,s,i)}mount(e){this.isSVGTag=Hi(e.tagName),super.mount(e)}}const Qa=dn.length;function _i(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?_i(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Qa;n++){const s=dn[n],i=t.props[s];(Dt(i)||i===!1)&&(e[s]=i)}return e}function Xi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const tl=[...fn].reverse(),el=fn.length;function nl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ha(t,n,s)))}function sl(t){let e=nl(t),n=qn(),s=!0;const i=l=>(c,u)=>{const h=dt(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...m}=h;c={...c,...m,...d}}return c};function r(l){e=l(t)}function o(l){const{props:c}=t,u=_i(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let y=0;y<el;y++){const v=tl[y],P=n[v],p=c[v]!==void 0?c[v]:u[v],w=Dt(p),S=v===l?P.isActive:null;S===!1&&(m=y);let V=p===u[v]&&p!==c[v]&&w;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),P.protectedKeys={...d},!P.isActive&&S===null||!p&&!P.prevProp||Zt(p)||typeof p=="boolean")continue;const E=il(P.prevProp,p);let b=E||v===l&&P.isActive&&!V&&w||y>m&&w,A=!1;const L=Array.isArray(p)?p:[p];let H=L.reduce(i(v),{});S===!1&&(H={});const{prevResolvedValues:vt={}}=P,te={...vt,...H},xn=F=>{b=!0,f.has(F)&&(A=!0,f.delete(F)),P.needsAnimating[F]=!0;const N=t.getValue(F);N&&(N.liveStyle=!1)};for(const F in te){const N=H[F],nt=vt[F];if(d.hasOwnProperty(F))continue;let lt=!1;De(N)&&De(nt)?lt=!Xi(N,nt):lt=N!==nt,lt?N!=null?xn(F):f.add(F):N!==void 0&&f.has(F)?xn(F):P.protectedKeys[F]=!0}P.prevProp=p,P.prevResolvedValues=H,P.isActive&&(d={...d,...H}),s&&t.blockInitialAnimation&&(b=!1);const Tn=V&&E;b&&(!Tn||A)&&h.push(...L.map(F=>{const N={type:v};if(typeof F=="string"&&s&&!Tn&&t.manuallyAnimateOnMount&&t.parent){const{parent:nt}=t,lt=dt(nt,F);if(nt.enteringChildren&&lt){const{delayChildren:xo}=lt.transition||{};N.delay=yi(nt.enteringChildren,t,xo)}}return{animation:F,options:N}}))}if(f.size){const y={};if(typeof c.initial!="boolean"){const v=dt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(y.transition=v.transition)}f.forEach(v=>{const P=t.getBaseTarget(v),p=t.getValue(v);p&&(p.liveStyle=!0),y[v]=P??null}),h.push({animation:y})}let g=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,c)),n[l].isActive=c;const u=o(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=qn()}}}function il(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Xi(e,t):!1}function st(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qn(){return{animate:st(!0),whileInView:st(),whileHover:st(),whileTap:st(),whileDrag:st(),whileFocus:st(),exit:st()}}function Zn(t,e){t.min=e.min,t.max=e.max}function $(t,e){Zn(t.x,e.x),Zn(t.y,e.y)}function Jn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Yi=1e-4,ol=1-Yi,rl=1+Yi,qi=.01,al=0-qi,ll=0+qi;function O(t){return t.max-t.min}function ul(t,e,n){return Math.abs(t-e)<=n}function Qn(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=O(n)/O(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ol&&t.scale<=rl||isNaN(t.scale))&&(t.scale=1),(t.translate>=al&&t.translate<=ll||isNaN(t.translate))&&(t.translate=0)}function bt(t,e,n,s){Qn(t.x,e.x,n.x,s?s.originX:void 0),Qn(t.y,e.y,n.y,s?s.originY:void 0)}function ts(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function cl(t,e,n){ts(t.x,e.x,n.x),ts(t.y,e.y,n.y)}function es(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function Xt(t,e,n){es(t.x,e.x,n.x),es(t.y,e.y,n.y)}function ns(t,e,n,s,i){return t-=e,t=_t(t,1/n,s),i!==void 0&&(t=_t(t,1/i,s)),t}function hl(t,e=0,n=1,s=.5,i,r=t,o=t){if(z.test(e)&&(e=parseFloat(e),e=M(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=M(r.min,r.max,s);t===r&&(a-=e),t.min=ns(t.min,e,n,a,i),t.max=ns(t.max,e,n,a,i)}function ss(t,e,[n,s,i],r,o){hl(t,e[n],e[s],e[i],e.scale,r,o)}const fl=["x","scaleX","originX"],dl=["y","scaleY","originY"];function is(t,e,n,s){ss(t.x,e,fl,n?n.x:void 0,s?s.x:void 0),ss(t.y,e,dl,n?n.y:void 0,s?s.y:void 0)}function os(t){return t.translate===0&&t.scale===1}function Zi(t){return os(t.x)&&os(t.y)}function rs(t,e){return t.min===e.min&&t.max===e.max}function ml(t,e){return rs(t.x,e.x)&&rs(t.y,e.y)}function as(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ji(t,e){return as(t.x,e.x)&&as(t.y,e.y)}function ls(t){return O(t.x)/O(t.y)}function us(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function U(t){return[t("x"),t("y")]}function pl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Qi=["TopLeft","TopRight","BottomLeft","BottomRight"],gl=Qi.length,cs=t=>typeof t=="string"?parseFloat(t):t,hs=t=>typeof t=="number"||T.test(t);function yl(t,e,n,s,i,r){i?(t.opacity=M(0,n.opacity??1,vl(s)),t.opacityExit=M(e.opacity??1,0,xl(s))):r&&(t.opacity=M(e.opacity??1,n.opacity??1,s));for(let o=0;o<gl;o++){const a=`border${Qi[o]}Radius`;let l=fs(e,a),c=fs(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||hs(l)===hs(c)?(t[a]=Math.max(M(cs(l),cs(c),s),0),(z.test(c)||z.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function fs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const vl=to(0,.5,Xs),xl=to(.5,.95,K);function to(t,e,n){return s=>s<t?0:s>e?1:n(Vt(t,e,s))}function Tl(t,e,n){const s=B(t)?t:mt(t);return s.start(rn("",s,e,n)),s.animation}function Et(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Pl=(t,e)=>t.depth-e.depth;class Sl{constructor(){this.children=[],this.isDirty=!1}add(e){Ke(this.children,e),this.isDirty=!0}remove(e){$e(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Pl),this.isDirty=!1,this.children.forEach(e)}}function wl(t,e){const n=j.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Q(s),t(r-e))};return C.setup(s,!0),()=>Q(s)}function Wt(t){return B(t)?t.get():t}class bl{constructor(){this.members=[]}add(e){Ke(this.members,e),e.scheduleRender()}remove(e){if($e(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();const i=s.options.layoutDependency,r=e.options.layoutDependency;i!==void 0&&r!==void 0&&i===r||(e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));const{crossfade:a}=e.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Kt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ue=["","X","Y","Z"],Al=1e3;let Vl=0;function ce(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function eo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Pi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&eo(s)}function no({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Vl++,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.layoutVersion=0,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(Dl),this.nodes.forEach(kl),this.nodes.forEach(Fl),this.nodes.forEach(El)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ze),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Li(o)&&!Ma(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;C.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=wl(f,250),Kt.hasAnimatedSinceResize&&(Kt.hasAnimatedSinceResize=!1,this.nodes.forEach(ps)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Nl,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!Ji(this.targetLayout,d),P=!h&&f;if(this.options.layoutRoot||this.resumeFrom||P||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const p={...on(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(p.delay=0,p.type=!1),this.startAnimation(p),this.setAnimationOrigin(u,P)}else h||ps(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Q(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Il),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&eo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ds);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ms);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ll),this.nodes.forEach(Cl),this.nodes.forEach(Ml)):this.nodes.forEach(ms),this.clearAllSnapshots();const a=j.now();I.delta=_(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,ee.update.process(I),ee.preRender.process(I),ee.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Rl),this.sharedNodes.forEach(Bl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!O(this.snapshot.measuredBox.x)&&!O(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=k(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Zi(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||it(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Ul(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return k();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Wl))){const{scroll:c}=this.root;c&&(ht(a.x,c.offset.x),ht(a.y,c.offset.y))}return a}removeElementScroll(o){const a=k();if($(a,o),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:h}=c;c!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&$(a,o),ht(a.x,u.offset.x),ht(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=k();$(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ft(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),it(u.latestValues)&&ft(l,u.latestValues)}return it(this.latestValues)&&ft(l,this.latestValues),l}removeTransform(o){const a=k();$(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!it(c.latestValues))continue;Ie(c.latestValues)&&c.updateSnapshot();const u=k(),h=c.measurePageBox();$(u,h),is(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return it(this.latestValues)&&is(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=I.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),Ni(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ie(this.parent.latestValues)||Oi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),Xt(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===I.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Na(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=k());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Jn(this.prevProjectionDelta.x,this.projectionDelta.x),Jn(this.prevProjectionDelta.y,this.projectionDelta.y)),bt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!us(this.projectionDelta.x,this.prevProjectionDelta.x)||!us(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ct(),this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=k(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=d!==m,y=this.getStack(),v=!y||y.members.length<=1,P=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Ol));this.animationProgress=0;let p;this.mixTargetDelta=w=>{const S=w/1e3;gs(h.x,o.x,S),gs(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jl(this.relativeTarget,this.relativeTargetOrigin,f,S),p&&ml(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||(p=k()),$(p,this.relativeTarget)),g&&(this.animationValues=u,yl(u,c,this.latestValues,S,P,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Q(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{Kt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=mt(0)),this.currentAnimation=Tl(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Al),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&so(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||k();const h=O(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=O(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}$(a,l),ft(a,u),bt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new bl),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ce("z",o,c,this.animationValues);for(let u=0;u<ue.length;u++)ce(`rotate${ue[u]}`,o,c,this.animationValues),ce(`skew${ue[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Wt(a?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Wt(a?.pointerEvents)||""),this.hasProjected&&!it(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=pl(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in je){if(u[m]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:v}=je[m],P=h==="none"?u[m]:g(u[m],c);if(y){const p=y.length;for(let w=0;w<p;w++)o[y[w]]=P}else v?this.options.visualElement.renderState.vars[m]=P:o[m]=P}this.options.layoutId&&(o.pointerEvents=c===this?Wt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(ds),this.root.sharedNodes.clear()}}}function Cl(t){t.updateLayout()}function Ml(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;i==="size"?U(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],f=O(h);h.min=n[u].min,h.max=h.min+f}):so(i,e.layoutBox,n)&&U(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],f=O(n[u]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+f)});const o=ct();bt(o,n,e.layoutBox);const a=ct();r?bt(a,t.applyTransform(s,!0),e.measuredBox):bt(a,n,e.layoutBox);const l=!Zi(o);let c=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:f}=u;if(h&&f){const d=k();Xt(d,e.layoutBox,h.layoutBox);const m=k();Xt(m,n,f.layoutBox),Ji(d,m)||(c=!0),u.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Dl(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function El(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Rl(t){t.clearSnapshot()}function ds(t){t.clearMeasurements()}function ms(t){t.isLayoutDirty=!1}function Ll(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ps(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function kl(t){t.resolveTargetDelta()}function Fl(t){t.calcProjection()}function Il(t){t.resetSkewAndRotation()}function Bl(t){t.removeLeadSnapshot()}function gs(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ys(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function jl(t,e,n,s){ys(t.x,e.x,n.x,s),ys(t.y,e.y,n.y,s)}function Ol(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Nl={duration:.45,ease:[.4,0,.1,1]},vs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xs=vs("applewebkit/")&&!vs("chrome/")?Math.round:K;function Ts(t){t.min=xs(t.min),t.max=xs(t.max)}function Ul(t){Ts(t.x),Ts(t.y)}function so(t,e,n){return t==="position"||t==="preserve-aspect"&&!ul(ls(e),ls(n),.2)}function Wl(t){return t!==t.root&&t.scroll?.wasRoot}const Kl=no({attachResizeListener:(t,e)=>Et(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),he={current:void 0},io=no({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!he.current){const t=new Kl({});t.mount(window),t.setOptions({layoutScroll:!0}),he.current=t}return he.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),gn=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ps(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $l(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ps(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Ps(t[i],null)}}}}function Gl(...t){return x.useCallback($l(...t),t)}class Hl extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=ke(s)&&s.offsetWidth||0,r=ke(s)&&s.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=r-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function zl({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const r=x.useId(),o=x.useRef(null),a=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=x.useContext(gn),c=t.props?.ref??t?.ref,u=Gl(o,c);return x.useInsertionEffect(()=>{const{width:h,height:f,top:d,left:m,right:g,bottom:y}=a.current;if(e||!o.current||!h||!f)return;const v=n==="left"?`left: ${m}`:`right: ${g}`,P=s==="bottom"?`bottom: ${y}`:`top: ${d}`;o.current.dataset.motionPopId=r;const p=document.createElement("style");l&&(p.nonce=l);const w=i??document.head;return w.appendChild(p),p.sheet&&p.sheet.insertRule(`
2
2
  [data-motion-pop-id="${r}"] {
3
3
  position: absolute !important;
4
4
  width: ${h}px !important;
@@ -1 +1 @@
1
- import{a}from"./main-CEuT8-Qi.js";const S=t=>{let e;const n=new Set,o=(s,r)=>{const c=typeof s=="function"?s(e):s;if(!Object.is(c,e)){const g=e;e=r??(typeof c!="object"||c===null)?c:Object.assign({},e,c),n.forEach(f=>f(e,g))}},u=()=>e,i={setState:o,getState:u,getInitialState:()=>l,subscribe:s=>(n.add(s),()=>n.delete(s))},l=e=t(o,u,i);return i},d=(t=>t?S(t):S),I=t=>t;function j(t,e=I){const n=a.useSyncExternalStore(t.subscribe,a.useCallback(()=>e(t.getState()),[t,e]),a.useCallback(()=>e(t.getInitialState()),[t,e]));return a.useDebugValue(n),n}const b=t=>{const e=d(t),n=o=>j(e,o);return Object.assign(n,e),n},O=(t=>t?b(t):b);export{O as c};
1
+ import{a}from"./main-CgwdHc9W.js";const S=t=>{let e;const n=new Set,o=(s,r)=>{const c=typeof s=="function"?s(e):s;if(!Object.is(c,e)){const g=e;e=r??(typeof c!="object"||c===null)?c:Object.assign({},e,c),n.forEach(f=>f(e,g))}},u=()=>e,i={setState:o,getState:u,getInitialState:()=>l,subscribe:s=>(n.add(s),()=>n.delete(s))},l=e=t(o,u,i);return i},d=(t=>t?S(t):S),I=t=>t;function j(t,e=I){const n=a.useSyncExternalStore(t.subscribe,a.useCallback(()=>e(t.getState()),[t,e]),a.useCallback(()=>e(t.getInitialState()),[t,e]));return a.useDebugValue(n),n}const b=t=>{const e=d(t),n=o=>j(e,o);return Object.assign(n,e),n},O=(t=>t?b(t):b);export{O as c};
@@ -0,0 +1 @@
1
+ import{u as H,r as o,d as O,j as t}from"./main-CgwdHc9W.js";import{H as A,e as _,V as $,p as B,c as Q}from"./button-D9Plv7hu.js";import{D as P,a as U}from"./use-file-explorer-state-Cg_yDYJl.js";import{c as M}from"./_sessionKey-CQE0brGK.js";import"./useBaseUiId-KQTzRPLp.js";import"./event-DD8Cz4O9.js";import"./popupStateMapping-D0ZbJR_o.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-B2KCZKKL.js";import"./react-DODKNyyU.js";import"./useQuery-CmAJuY2W.js";import"./tooltip-DLmutB5C.js";import"./DirectionContext-CxhRpXkm.js";import"./useMutation-BsQD6FKe.js";import"./useControlled-B5pEEz2V.js";import"./CSPContext-DeJH85nm.js";import"./menu-BsS6CDf_.js";import"./useCompositeItem-BPY2_hF_.js";import"./opencami-logo-Bmge6-FB.js";import"./proxy-CYZeDXoy.js";import"./markdown-DtWnt4NA.js";import"./index-DtGzE-ea.js";import"./index-T4TOjvD0.js";function V(e){return Array.isArray(e)?e.map(s=>s?.type==="text"&&typeof s.text=="string"?s.text:"").filter(Boolean).join(" "):""}function K(e){const s=V(e.content);return s||(typeof e.text=="string"?e.text:"")}function G({sessions:e,currentFriendlyId:s,currentSessionKey:y}){const g=H(),[u,i]=o.useState(""),[h,f]=o.useState(!1),[b,l]=o.useState([]),c=o.useRef(null);o.useEffect(()=>()=>{c.current?.abort(),c.current=null},[]);const j=o.useCallback(v=>{if(!v.trim()||!s||!y)return[];const I=M.history(s,y),w=g.getQueryData(I);if(!w?.messages)return[];const k=v.toLowerCase(),p=[],S=e.find(x=>x.friendlyId===s),n=S?.label||S?.title||S?.derivedTitle||s;return w.messages.forEach((x,R)=>{const a=K(x);if(!a)return;const m=a.toLowerCase().indexOf(k);m!==-1&&p.push({sessionKey:y,friendlyId:s,sessionTitle:n,messageIndex:R,messageId:typeof x.id=="string"?x.id:void 0,messageRole:x.role||"unknown",messageText:a,matchStart:m,matchEnd:m+v.length,timestamp:x.timestamp})}),p},[s,y,g,e]),d=o.useCallback(async v=>{const I=v.trim();if(!I)return c.current?.abort(),c.current=null,l([]),[];c.current?.abort();const w=new AbortController;c.current=w,f(!0),l([]);const k=I.toLowerCase(),p=[],S=10;try{for(let n=0;n<e.length;n+=S){if(w.signal.aborted)throw new DOMException("Search aborted","AbortError");const x=e.slice(n,n+S),R=await Promise.allSettled(x.map(async a=>{const r=M.history(a.friendlyId,a.key);let m=g.getQueryData(r);if(!m){const N=new URLSearchParams({sessionKey:a.key,friendlyId:a.friendlyId,limit:"200"}),T=await fetch(`/api/history?${N.toString()}`,{signal:w.signal});T.ok&&(m=await T.json(),g.setQueryData(r,m))}if(!m?.messages)return[];const z=a.label||a.title||a.derivedTitle||a.friendlyId,L=[];return m.messages.forEach((N,T)=>{const C=K(N);if(!C)return;const D=C.toLowerCase().indexOf(k);D!==-1&&L.push({sessionKey:a.key,friendlyId:a.friendlyId,sessionTitle:z,messageIndex:T,messageId:typeof N.id=="string"?N.id:void 0,messageRole:N.role||"unknown",messageText:C,matchStart:D,matchEnd:D+I.length,timestamp:N.timestamp})}),L}));for(const a of R)a.status==="fulfilled"&&p.push(...a.value);p.sort((a,r)=>(r.timestamp||0)-(a.timestamp||0)),l([...p])}return p}catch(n){if(!(n instanceof DOMException&&n.name==="AbortError"))throw n;return[]}finally{c.current===w&&(c.current=null,f(!1))}},[e,g]),E=o.useCallback(()=>{c.current?.abort(),c.current=null,f(!1),i(""),l([])},[]);return{query:u,setQuery:i,isSearching:h,globalResults:b,searchCurrentConversation:j,searchAllSessions:d,clearSearch:E}}function Y(e,s){if(!s.trim())return null;const y=e.toLowerCase(),g=s.toLowerCase(),u=y.indexOf(g);if(u===-1)return null;const i=40,h=80;let f=Math.max(0,u-i),b=Math.min(e.length,u+s.length+h);if(f>0){const d=e.indexOf(" ",f);d!==-1&&d<u&&(f=d+1)}if(b<e.length){const d=e.lastIndexOf(" ",b);d>u+s.length&&(b=d)}const l=(f>0?"...":"")+e.slice(f,u),c=e.slice(u,u+s.length),j=e.slice(u+s.length,b)+(b<e.length?"...":"");return{before:l,match:c,after:j}}const Z="opencami-search-jump-target";function we({open:e,onOpenChange:s,sessions:y,currentFriendlyId:g,currentSessionKey:u,mode:i,onJumpToMessage:h}){const f=O(),b=o.useRef(null),[l,c]=o.useState(""),[j,d]=o.useState(0),E=o.useRef(null),{isSearching:v,globalResults:I,searchCurrentConversation:w,searchAllSessions:k,clearSearch:p}=G({sessions:y,currentFriendlyId:g,currentSessionKey:u}),S=o.useMemo(()=>i!=="current"?[]:w(l),[i,l,w]),n=i==="global"?I:S;o.useEffect(()=>{if(i!=="global")return;if(!l.trim()){p();return}const r=setTimeout(()=>{k(l)},300);return()=>clearTimeout(r)},[l,i,k,p]),o.useEffect(()=>{if(!e){p();return}c(""),d(0),p(),setTimeout(()=>{b.current?.focus()},50)},[e,p]),o.useEffect(()=>{d(0)},[n]),o.useEffect(()=>{if(!E.current)return;const r=E.current.querySelector('[data-selected="true"]');r&&r.scrollIntoView({block:"nearest"})},[j]);const x=o.useCallback(r=>{if(s(!1),i==="current"&&h)h(r);else{if(r.messageId&&typeof window<"u")try{sessionStorage.setItem(Z,JSON.stringify({friendlyId:r.friendlyId,messageId:r.messageId,at:Date.now()}))}catch{}f({to:"/chat/$sessionKey",params:{sessionKey:r.friendlyId}})}},[i,f,h,s]),R=o.useCallback(r=>{switch(r.key){case"ArrowDown":r.preventDefault(),d(m=>Math.min(m+1,n.length-1));break;case"ArrowUp":r.preventDefault(),d(m=>Math.max(m-1,0));break;case"Enter":r.preventDefault(),n[j]&&x(n[j]);break;case"Escape":r.preventDefault(),s(!1);break}},[n,j,x,s]),a=i==="global"?"Search across all conversations...":"Search in this conversation...";return t.jsx(P,{open:e,onOpenChange:s,children:t.jsxs(U,{className:"w-[min(600px,92vw)] max-h-[80vh] flex flex-col overflow-hidden",children:[t.jsxs("div",{className:"flex items-center gap-3 p-4 border-b border-primary-200",children:[t.jsx(A,{icon:_,size:20,className:"text-primary-500 shrink-0"}),t.jsx("input",{ref:b,type:"text",value:l,onChange:r=>c(r.target.value),onKeyDown:R,placeholder:a,className:"flex-1 bg-transparent text-primary-900 placeholder:text-primary-400 outline-none text-base"}),l&&t.jsx("button",{type:"button",onClick:()=>{c(""),p()},className:"p-1 hover:bg-primary-200 rounded transition-colors",children:t.jsx(A,{icon:$,size:16,className:"text-primary-500"})}),v&&t.jsx(A,{icon:B,size:20,className:"text-primary-500 animate-spin"})]}),t.jsx("div",{ref:E,className:"flex-1 overflow-y-auto p-2 min-h-0",children:l.trim()?n.length===0&&!v?t.jsxs("div",{className:"text-center text-primary-500 py-8 text-sm",children:['No results found for "',l,'"']}):t.jsx("div",{className:"flex flex-col gap-1",children:n.map((r,m)=>t.jsx(J,{result:r,query:l,isSelected:m===j,showSessionTitle:i==="global",onClick:()=>x(r),onMouseEnter:()=>d(m)},`${r.friendlyId}-${r.messageIndex}`))}):t.jsx("div",{className:"text-center text-primary-500 py-8 text-sm",children:i==="global"?"Type to search across all your conversations":"Type to search within this conversation"})}),t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-primary-200 text-xs text-primary-500",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-primary-100 rounded text-[10px]",children:"↑"}),t.jsx("kbd",{className:"px-1.5 py-0.5 bg-primary-100 rounded text-[10px]",children:"↓"}),"to navigate"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-primary-100 rounded text-[10px]",children:"Enter"}),"to select"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-primary-100 rounded text-[10px]",children:"Esc"}),"to close"]})]}),n.length>0&&t.jsxs("span",{children:[n.length," result",n.length!==1?"s":""]})]})]})})}function J({result:e,query:s,isSelected:y,showSessionTitle:g,onClick:u,onMouseEnter:i}){const h=Y(e.messageText,s),f=e.messageRole==="assistant"?"Assistant":"You";return t.jsxs("button",{type:"button",onClick:u,onMouseEnter:i,"data-selected":y,className:Q("w-full text-left px-3 py-2 rounded-lg transition-colors",y?"bg-primary-200":"hover:bg-primary-100"),children:[g&&t.jsx("div",{className:"text-xs font-medium text-primary-600 mb-1 truncate",children:e.sessionTitle}),t.jsx("div",{className:"flex items-center gap-2 mb-0.5",children:t.jsx("span",{className:Q("text-[10px] font-medium px-1.5 py-0.5 rounded",e.messageRole==="assistant"?"bg-blue-100 text-blue-700":"bg-green-100 text-green-700"),children:f})}),h&&t.jsxs("div",{className:"text-sm text-primary-700 line-clamp-2",children:[t.jsx("span",{children:h.before}),t.jsx("mark",{className:"bg-yellow-200 text-primary-900 rounded px-0.5",children:h.match}),t.jsx("span",{children:h.after})]})]})}export{we as SearchDialog};
@@ -0,0 +1 @@
1
+ import{r as d,j as e}from"./main-CgwdHc9W.js";import{D as x,a as p,b as h,c as u,d as j}from"./use-file-explorer-state-Cg_yDYJl.js";import{B as v}from"./button-D9Plv7hu.js";import"./useBaseUiId-KQTzRPLp.js";import"./event-DD8Cz4O9.js";import"./popupStateMapping-D0ZbJR_o.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-B2KCZKKL.js";import"./react-DODKNyyU.js";const f=[{value:"markdown",label:"Markdown (.md)",description:"Nicely formatted with headers and sections"},{value:"json",label:"JSON (.json)",description:"Full data with metadata"},{value:"txt",label:"Plain Text (.txt)",description:"Simple text format"}];function S({open:t,onOpenChange:s,sessionTitle:i,onExport:l,onCancel:o}){const[r,n]=d.useState("markdown"),m=()=>{l(r)};return e.jsx(x,{open:t,onOpenChange:s,children:e.jsx(p,{children:e.jsxs("div",{className:"p-4",children:[e.jsx(h,{className:"mb-1",children:"Export Conversation"}),e.jsxs(u,{className:"mb-4",children:['Export "',i,'" in your preferred format']}),e.jsx("div",{className:"space-y-2 mb-4",children:f.map(a=>e.jsxs("label",{className:"flex items-start gap-3 p-3 rounded-lg border border-primary-200 cursor-pointer hover:bg-primary-100 transition-colors",children:[e.jsx("input",{type:"radio",name:"export-format",value:a.value,checked:r===a.value,onChange:c=>n(c.target.value),className:"mt-1"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm text-primary-900",children:a.label}),e.jsx("div",{className:"text-xs text-primary-600",children:a.description})]})]},a.value))}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{onClick:o,children:"Cancel"}),e.jsx(v,{onClick:m,children:"Export"})]})]})})})}export{S as SessionExportDialog};
@@ -0,0 +1 @@
1
+ import{r as o,j as t}from"./main-CgwdHc9W.js";import{c as Fe}from"./react-DODKNyyU.js";import{B as O,H as C,V as Ke,z as ze,f as Be,P as Re,S as Me,g as De,R as _e,s as Ue,T as Ye,c as L,o as Ge,v as He,j as qe,k as Je,l as Xe,h as $e,J as Y,m as Qe}from"./button-D9Plv7hu.js";import{D as Ze,a as et,b as tt,c as at,d as G}from"./use-file-explorer-state-Cg_yDYJl.js";import{S as m}from"./switch-DbgQPO6i.js";import{T as y,a as v,b as j}from"./tabs-BsAvZnlD.js";import{u as rt}from"./index-DtGzE-ea.js";import{u as st,g as H}from"./_sessionKey-CQE0brGK.js";import"./useBaseUiId-KQTzRPLp.js";import"./event-DD8Cz4O9.js";import"./popupStateMapping-D0ZbJR_o.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-B2KCZKKL.js";import"./useControlled-B5pEEz2V.js";import"./useCompositeItem-BPY2_hF_.js";import"./DirectionContext-CxhRpXkm.js";import"./CSPContext-DeJH85nm.js";import"./useQuery-CmAJuY2W.js";import"./tooltip-DLmutB5C.js";import"./useMutation-BsQD6FKe.js";import"./menu-BsS6CDf_.js";import"./opencami-logo-Bmge6-FB.js";import"./proxy-CYZeDXoy.js";import"./markdown-DtWnt4NA.js";import"./index-T4TOjvD0.js";function lt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem("feature_artifacts")==="true"}catch{return!1}}const nt=Fe()(n=>({isEnabled:lt(),isPanelOpen:!1,content:"",type:null,setArtifact:function(h,a){n({content:h,type:a,isPanelOpen:!0})},clearArtifact:function(){n({content:"",type:null})},openPanel:function(){n({isPanelOpen:!0})},closePanel:function(){n({isPanelOpen:!1})},setEnabled:function(h){if(typeof window<"u")try{window.localStorage.setItem("feature_artifacts",String(h))}catch{}n({isEnabled:h})}}));function b({title:n,tabId:l,activeTab:h,children:a}){const c=l&&h&&l!==h;return t.jsxs("div",{className:L("border-b border-primary-200 py-2 last:border-0",c&&"md:hidden"),children:[t.jsx("h3",{className:"mb-1.5 text-sm font-semibold text-primary-700",children:n}),t.jsx("div",{className:"space-y-1.5",children:a})]})}function s({label:n,description:l,inline:h,children:a}){return h?t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex-1 select-none",children:[t.jsx("div",{className:"text-[13px] font-medium text-primary-800",children:n}),l&&t.jsx("div",{className:"text-xs text-primary-500",children:l})]}),t.jsx("div",{className:"flex items-center gap-2",children:a})]}):t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"select-none",children:[t.jsx("div",{className:"text-[13px] font-medium text-primary-800",children:n}),l&&t.jsx("div",{className:"text-xs text-primary-500",children:l})]}),t.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:a})]})}const te=[{value:"14px",label:"S"},{value:"16px",label:"M"},{value:"18px",label:"L"},{value:"20px",label:"XL"}],W=[{value:"system",label:"System",cssValue:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',previewClass:"font-sans"},{value:"inter",label:"Inter",cssValue:'"Inter", sans-serif',previewClass:'font-["Inter",sans-serif]'},{value:"roboto",label:"Roboto",cssValue:'"Roboto", sans-serif',previewClass:'font-["Roboto",sans-serif]'}],ae=[{value:"compact",label:"Compact"},{value:"comfortable",label:"Comfortable"},{value:"spacious",label:"Spacious"}],F=[{value:"green",label:"Green",accent:"#22c55e",hover:"#16a34a",light:"rgba(34, 197, 94, 0.10)"},{value:"blue",label:"Blue",accent:"#3b82f6",hover:"#2563eb",light:"rgba(59, 130, 246, 0.10)"},{value:"purple",label:"Purple",accent:"#8b5cf6",hover:"#7c3aed",light:"rgba(139, 92, 246, 0.10)"},{value:"orange",label:"Orange",accent:"#f97316",hover:"#ea580c",light:"rgba(249, 115, 22, 0.10)"},{value:"pink",label:"Pink",accent:"#ec4899",hover:"#db2777",light:"rgba(236, 72, 153, 0.10)"},{value:"red",label:"Red",accent:"#ef4444",hover:"#dc2626",light:"rgba(239, 68, 68, 0.10)"},{value:"cyan",label:"Cyan",accent:"#06b6d4",hover:"#0891b2",light:"rgba(6, 182, 212, 0.10)"},{value:"yellow",label:"Yellow",accent:"#eab308",hover:"#ca8a04",light:"rgba(234, 179, 8, 0.10)"}],K=[{value:"narrow",label:"Narrow",cssValue:"640px"},{value:"medium",label:"Medium",cssValue:"800px"},{value:"wide",label:"Wide",cssValue:"1000px"},{value:"full",label:"Full",cssValue:"100%"}],z=[{value:"compact",label:"Compact",cssValue:"200px"},{value:"normal",label:"Normal",cssValue:"260px"},{value:"wide",label:"Wide",cssValue:"320px"},{value:"xl",label:"XL",cssValue:"400px"}],re=[{value:"default",label:"Default"},{value:"bubbles",label:"Bubbles"},{value:"minimal",label:"Minimal"}];function q(n){return te.some(l=>l.value===n)}function J(n){return W.some(l=>l.value===n)}function X(n){return ae.some(l=>l.value===n)}function $(n){return F.some(l=>l.value===n)}function Q(n){return K.some(l=>l.value===n)}function Z(n){return z.some(l=>l.value===n)}function ee(n){return re.some(l=>l.value===n)}function Vt({open:n,onOpenChange:l,onClose:h}){const{settings:a,updateSettings:c}=rt(),{settings:u,updateSettings:f,status:w,testApiKey:se}=st(),[p,le]=o.useState("appearance"),[g,R]=o.useState(u.llmApiKey),[M,D]=o.useState(!1),[S,k]=o.useState(null),[ne,ie]=o.useState(()=>{if(typeof window>"u")return"16px";try{const e=localStorage.getItem("opencami-text-size");if(e&&q(e))return e}catch{}return"16px"}),[oe,ce]=o.useState(()=>{if(typeof window>"u")return!0;try{const e=localStorage.getItem("opencami-tts-enabled");return e===null?!0:e==="true"}catch{return!0}}),[_,de]=o.useState(()=>{if(typeof window>"u")return"auto";try{return localStorage.getItem("opencami-tts-provider")||"auto"}catch{return"auto"}}),[ue,me]=o.useState(()=>{if(typeof window>"u")return"nova";try{return localStorage.getItem("opencami-tts-voice")||"nova"}catch{return"nova"}}),[he,pe]=o.useState(()=>{if(typeof window>"u")return"auto";try{return localStorage.getItem("opencami-stt-provider")||"auto"}catch{return"auto"}});o.useEffect(()=>{if(!(typeof window>"u"))try{const e=localStorage.getItem("opencami-font-family");e&&J(e)?(I(e),a.fontFamily!==e&&c({fontFamily:e})):I(a.fontFamily);const r=localStorage.getItem("opencami-density");r&&X(r)?(N(r),a.density!==r&&c({density:r})):N(a.density);const i=localStorage.getItem("opencami-accent-color");i&&$(i)?(P(i),a.accentColor!==i&&c({accentColor:i})):P(a.accentColor);const d=localStorage.getItem("opencami-chat-width");d&&Q(d)?(A(d),a.chatWidth!==d&&c({chatWidth:d})):A(a.chatWidth);const x=localStorage.getItem("opencami-sidebar-width");x&&Z(x)?(E(x),a.sidebarWidth!==x&&c({sidebarWidth:x})):E(a.sidebarWidth);const V=localStorage.getItem("opencami-bubble-style");V&&ee(V)?(T(V),a.bubbleStyle!==V&&c({bubbleStyle:V})):T(a.bubbleStyle)}catch{I(a.fontFamily),N(a.density),P(a.accentColor),A(a.chatWidth),E(a.sidebarWidth),T(a.bubbleStyle)}},[]),o.useEffect(()=>{I(a.fontFamily)},[a.fontFamily]),o.useEffect(()=>{N(a.density)},[a.density]),o.useEffect(()=>{P(a.accentColor)},[a.accentColor]),o.useEffect(()=>{A(a.chatWidth)},[a.chatWidth]),o.useEffect(()=>{E(a.sidebarWidth)},[a.sidebarWidth]),o.useEffect(()=>{T(a.bubbleStyle)},[a.bubbleStyle]);const xe=e=>{de(e);try{localStorage.setItem("opencami-tts-provider",e)}catch{}},be=e=>{me(e);try{localStorage.setItem("opencami-tts-voice",e)}catch{}},fe=e=>{pe(e);try{localStorage.setItem("opencami-stt-provider",e)}catch{}};function ge(e){typeof document>"u"||document.documentElement.style.setProperty("--opencami-text-size",e)}function I(e){if(typeof document>"u")return;const i=W.find(d=>d.value===e)?.cssValue??W[0].cssValue;document.documentElement.style.setProperty("--opencami-font-family",i)}function N(e){if(typeof document>"u")return;const r=document.documentElement;if(r.style.setProperty("--opencami-density",e),e==="compact"){r.style.setProperty("--opencami-msg-padding-y","0.25rem"),r.style.setProperty("--opencami-msg-gap","0.25rem"),r.style.setProperty("--opencami-user-bubble-py","0.4rem");return}if(e==="spacious"){r.style.setProperty("--opencami-msg-padding-y","1.25rem"),r.style.setProperty("--opencami-msg-gap","1rem"),r.style.setProperty("--opencami-user-bubble-py","1rem");return}r.style.setProperty("--opencami-msg-padding-y","0.75rem"),r.style.setProperty("--opencami-msg-gap","0.5rem"),r.style.setProperty("--opencami-user-bubble-py","0.625rem")}function P(e){if(typeof document>"u")return;const r=F.find(d=>d.value===e)??F[0],i=document.documentElement;i.style.setProperty("--opencami-accent",r.accent),i.style.setProperty("--opencami-accent-hover",r.hover),i.style.setProperty("--opencami-accent-light",r.light)}function A(e){if(typeof document>"u")return;const r=K.find(i=>i.value===e)??K[2];document.documentElement.style.setProperty("--opencami-chat-width",r.cssValue)}function E(e){if(typeof document>"u")return;const r=z.find(i=>i.value===e)??z[1];document.documentElement.style.setProperty("--opencami-sidebar-width",r.cssValue)}function T(e){typeof document>"u"||document.documentElement.setAttribute("data-opencami-bubble-style",e)}const ye=e=>{if(q(e)){ie(e),ge(e);try{localStorage.setItem("opencami-text-size",e)}catch{}}},ve=e=>{if(J(e)){I(e),c({fontFamily:e});try{localStorage.setItem("opencami-font-family",e)}catch{}}},je=e=>{if(X(e)){N(e),c({density:e});try{localStorage.setItem("opencami-density",e)}catch{}}},we=e=>{if($(e)){P(e),c({accentColor:e});try{localStorage.setItem("opencami-accent-color",e)}catch{}}},Se=e=>{if(Q(e)){A(e),c({chatWidth:e});try{localStorage.setItem("opencami-chat-width",e)}catch{}}},Ce=e=>{if(Z(e)){E(e),c({sidebarWidth:e});try{localStorage.setItem("opencami-sidebar-width",e)}catch{}}},ke=e=>{if(ee(e)){T(e),c({bubbleStyle:e});try{localStorage.setItem("opencami-bubble-style",e)}catch{}}},Ie=e=>{ce(e);try{localStorage.setItem("opencami-tts-enabled",String(e))}catch{}window.dispatchEvent(new StorageEvent("storage",{key:"opencami-tts-enabled",newValue:String(e)}))},[U,Ne]=o.useState(!1),B=o.useRef(null),[Pe,Ae]=o.useState(()=>{if(typeof window>"u")return!0;try{const e=localStorage.getItem("opencami-personas-enabled");return e===null?!0:e==="true"}catch{return!0}});o.useEffect(()=>{let e=!0;async function r(){B.current?.abort();const i=new AbortController;B.current=i;try{const d=await fetch("/api/personas",{signal:i.signal});if(!d.ok)return;const x=await d.json();e&&x.ok&&Ne(x.available)}catch(d){if(d instanceof Error&&d.name==="AbortError")return}}return r(),()=>{e=!1,B.current?.abort()}},[]);const Ee=e=>{Ae(e);try{localStorage.setItem("opencami-personas-enabled",String(e))}catch{}window.dispatchEvent(new StorageEvent("storage",{key:"opencami-personas-enabled",newValue:String(e)}))},Te=async()=>{if(g.trim()){D(!0),k(null);try{const e=await se(g.trim());k(e),e.valid&&f({llmApiKey:g.trim()})}finally{D(!1)}}},Ve=()=>{f({llmApiKey:g.trim()}),k(null)},Oe=()=>{R(""),f({llmApiKey:""}),k(null)},Le=[{value:"system",label:"Auto",icon:Ge},{value:"light",label:"Light",icon:He},{value:"dark",label:"Dark",icon:qe},{value:"chameleon",label:"Cham",icon:Je},{value:"frost-light",label:"Ice",icon:Xe}];function We(e){if(typeof document>"u")return;const r=document.documentElement,i=window.matchMedia("(prefers-color-scheme: dark)");r.classList.remove("light","dark","system","chameleon","frost","frost-light","frost-dark"),r.style.colorScheme="",r.classList.add(e);const d=e==="frost-light",x=e==="frost-dark";(d||x)&&r.classList.add("frost"),x&&r.classList.add("dark"),e==="system"&&i.matches&&r.classList.add("dark"),d&&(r.classList.remove("dark"),r.style.colorScheme="light")}return t.jsx(Ze,{open:n,onOpenChange:l,children:t.jsx(et,{className:"w-[min(680px,92vw)] max-h-[85vh] overflow-y-auto",children:t.jsxs("div",{className:"p-3",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{children:[t.jsx(tt,{className:"mb-1",children:"Settings"}),t.jsx(at,{className:"hidden",children:"Configure OpenCami"})]}),t.jsx(G,{render:t.jsx(O,{size:"icon-sm",variant:"ghost",className:"text-primary-500 hover:bg-primary-100 hover:text-primary-700","aria-label":"Close",children:t.jsx(C,{icon:Ke,size:20,strokeWidth:1.5})})})]}),t.jsxs("div",{className:"mt-2 flex md:flex-row flex-col md:gap-3 gap-0 md:min-h-[400px]",children:[t.jsx("nav",{className:"hidden md:flex flex-col gap-0.5 min-w-[160px] border-r border-primary-200 pr-3",children:[{id:"connection",label:"Connection",icon:ze},{id:"appearance",label:"Appearance",icon:Be},{id:"chat",label:"Chat",icon:Re},{id:"workspace",label:"Workspace",icon:Me},{id:"personas",label:"Personas",icon:De},{id:"voice",label:"Voice",icon:_e},{id:"llm",label:"LLM Features",icon:Ue},{id:"about",label:"About",icon:Ye}].map(e=>t.jsxs("button",{onClick:()=>le(e.id),className:L("flex items-center gap-2 px-2.5 py-1.5 rounded-md text-sm text-left transition-colors",p===e.id?"text-primary-900 font-medium":"text-primary-600 hover:text-primary-900 hover:bg-primary-50"),style:p===e.id?{backgroundColor:"var(--opencami-accent-light)"}:void 0,children:[t.jsx(C,{icon:e.icon,size:16,strokeWidth:1.5}),e.label]},e.id))}),t.jsxs("div",{className:"flex-1 overflow-y-auto md:max-h-[calc(85vh-90px)] max-h-none",children:[t.jsx(b,{title:"Connection",tabId:"connection",activeTab:p,children:t.jsx(s,{inline:!0,label:"Status",children:t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-green-600",children:[t.jsx("span",{className:"size-2 rounded-full bg-green-500"}),"Connected"]})})}),t.jsxs(b,{title:"Appearance",tabId:"appearance",activeTab:p,children:[t.jsx(s,{label:"Theme",children:t.jsx(y,{value:a.theme,onValueChange:e=>{const r=e;We(r),c({theme:r})},children:t.jsx(v,{variant:"default",className:"gap-1.5 flex-wrap *:data-[slot=tab-indicator]:duration-0",children:Le.map(e=>t.jsxs(j,{value:e.value,className:"text-[11px] px-1 py-0.5 gap-0.5",children:[e.icon&&t.jsx(C,{icon:e.icon,size:13,strokeWidth:1.5}),t.jsx("span",{children:e.label})]},e.value))})})}),t.jsx(s,{label:"Accent Color",children:t.jsx("div",{className:"flex gap-0.5 flex-wrap",children:F.map(e=>{const r=a.accentColor===e.value;return t.jsx("button",{type:"button",onClick:()=>we(e.value),className:L("flex items-center justify-center rounded-md p-1 transition-all duration-150",r?"scale-110":"hover:bg-primary-50 hover:scale-105"),children:t.jsx("span",{className:L("size-6 rounded-full transition-shadow duration-150",r?"ring-2 ring-offset-2":"border-2 border-primary-200"),style:{backgroundColor:e.accent,...r?{"--tw-ring-color":e.accent}:{}}})},e.value)})})}),t.jsx(s,{label:"Text Size",children:t.jsx(y,{value:ne,onValueChange:ye,children:t.jsx(v,{variant:"default",className:"gap-2 *:data-[slot=tab-indicator]:duration-0",children:te.map(e=>t.jsx(j,{value:e.value,children:t.jsx("span",{className:"tabular-nums text-xs",children:e.label})},e.value))})})}),t.jsx(s,{inline:!0,label:"Font",children:t.jsx(y,{value:a.fontFamily,onValueChange:ve,children:t.jsx(v,{variant:"default",className:"gap-1 *:data-[slot=tab-indicator]:duration-0",children:W.map(e=>t.jsx(j,{value:e.value,children:t.jsx("span",{className:"text-xs",style:{fontFamily:e.cssValue},children:e.label})},e.value))})})}),t.jsx(s,{inline:!0,label:"Density",children:t.jsx(y,{value:a.density,onValueChange:je,children:t.jsx(v,{variant:"default",className:"gap-1 *:data-[slot=tab-indicator]:duration-0",children:ae.map(e=>t.jsx(j,{value:e.value,children:t.jsx("span",{className:"text-xs",children:e.label})},e.value))})})}),t.jsx(s,{inline:!0,label:"Bubbles",children:t.jsx(y,{value:a.bubbleStyle,onValueChange:ke,children:t.jsx(v,{variant:"default",className:"gap-1 *:data-[slot=tab-indicator]:duration-0",children:re.map(e=>t.jsx(j,{value:e.value,children:t.jsx("span",{className:"text-xs",children:e.label})},e.value))})})}),t.jsx(s,{inline:!0,label:"Chat Width",children:t.jsx(y,{value:a.chatWidth,onValueChange:Se,children:t.jsx(v,{variant:"default",className:"gap-1 *:data-[slot=tab-indicator]:duration-0",children:K.map(e=>t.jsx(j,{value:e.value,children:t.jsx("span",{className:"text-xs",children:e.label})},e.value))})})}),t.jsx(s,{inline:!0,label:"Sidebar",children:t.jsx(y,{value:a.sidebarWidth,onValueChange:Ce,children:t.jsx(v,{variant:"default",className:"gap-1 *:data-[slot=tab-indicator]:duration-0",children:z.map(e=>t.jsx(j,{value:e.value,children:t.jsx("span",{className:"text-xs",children:e.label})},e.value))})})})]}),t.jsxs(b,{title:"Chat",tabId:"chat",activeTab:p,children:[t.jsx(s,{inline:!0,label:"Show tool messages",children:t.jsx(m,{checked:a.showToolMessages,onCheckedChange:e=>c({showToolMessages:e})})}),t.jsx(s,{inline:!0,label:"Show reasoning blocks",children:t.jsx(m,{checked:a.showReasoningBlocks,onCheckedChange:e=>c({showReasoningBlocks:e})})}),t.jsx(s,{inline:!0,label:"Show search sources",children:t.jsx(m,{checked:a.showSearchSources,onCheckedChange:e=>c({showSearchSources:e})})}),t.jsx(s,{inline:!0,label:"Inline File Preview",description:"Make file paths in messages clickable to preview file contents",children:t.jsx(m,{checked:a.inlineFilePreview,onCheckedChange:e=>c({inlineFilePreview:e})})})]}),t.jsxs(b,{title:"Workspace",tabId:"workspace",activeTab:p,children:[t.jsx(s,{inline:!0,label:"File Explorer",description:"Browse and edit workspace files from the sidebar",children:t.jsx(m,{checked:(()=>{try{const e=localStorage.getItem("opencami-file-explorer");return e===null?!0:e==="true"}catch{return!0}})(),onCheckedChange:e=>{localStorage.setItem("opencami-file-explorer",String(e)),window.location.reload()}})}),t.jsx(s,{inline:!0,label:"Memory Viewer",description:"Browse and edit MEMORY.md and daily memory files",children:t.jsx(m,{checked:(()=>{try{const e=localStorage.getItem("opencami-memory-viewer");return e===null?!0:e==="true"}catch{return!0}})(),onCheckedChange:e=>{localStorage.setItem("opencami-memory-viewer",String(e)),window.location.reload()}})}),t.jsx(s,{inline:!0,label:"Agent Manager (Beta)",description:"Show Agent Manager in sidebar for creating and managing agents",children:t.jsx(m,{checked:(()=>{try{return localStorage.getItem("opencami-agent-manager")==="true"}catch{return!1}})(),onCheckedChange:e=>{localStorage.setItem("opencami-agent-manager",String(e)),window.location.reload()}})}),t.jsx(s,{inline:!0,label:"Skills Browser (Beta)",description:"Browse and install skills from ClawHub",children:t.jsx(m,{checked:(()=>{try{return localStorage.getItem("opencami-skills-browser")==="true"}catch{return!1}})(),onCheckedChange:e=>{localStorage.setItem("opencami-skills-browser",String(e)),window.location.reload()}})}),t.jsx(s,{inline:!0,label:"Cron Jobs Panel (Beta)",description:"Show Cron Jobs in sidebar for managing OpenClaw cron schedules",children:t.jsx(m,{checked:(()=>{try{return localStorage.getItem("opencami-cron-manager")==="true"}catch{return!1}})(),onCheckedChange:e=>{localStorage.setItem("opencami-cron-manager",String(e)),window.location.reload()}})}),t.jsx(s,{inline:!0,label:"Dashboard (Beta)",description:"Show Dashboard in sidebar with system and gateway widgets",children:t.jsx(m,{checked:(()=>{try{return localStorage.getItem("feature_dashboard")==="true"}catch{return!1}})(),onCheckedChange:e=>{localStorage.setItem("feature_dashboard",String(e)),window.location.reload()}})}),t.jsx(s,{inline:!0,label:"Artifacts Preview (Beta)",description:"Show live HTML/SVG preview panel when AI generates code",children:t.jsx(m,{checked:(()=>{try{return localStorage.getItem("feature_artifacts")==="true"}catch{return!1}})(),onCheckedChange:e=>{localStorage.setItem("feature_artifacts",String(e)),nt.getState().setEnabled(e)}})})]}),t.jsxs(b,{title:"Personas",tabId:"personas",activeTab:p,children:[U?t.jsx(s,{inline:!0,label:"Persona Picker",description:"Show persona picker in chat (20 personalities)",children:t.jsx(m,{checked:Pe,onCheckedChange:Ee})}):t.jsx(s,{inline:!0,label:"Persona Picker",description:"Install the Personas skill to unlock 20 AI personalities",children:t.jsx(m,{checked:!1,disabled:!0})}),!U&&t.jsx("div",{className:"pt-1",children:t.jsx("a",{href:"https://www.clawhub.ai/robbyczgw-cla/personas",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary-600 hover:text-primary-900 hover:underline",children:"Get it on ClawHub →"})})]}),t.jsxs(b,{title:"Text-to-Speech",tabId:"voice",activeTab:p,children:[t.jsx(s,{inline:!0,label:"Voice Playback",description:"Add a 🔊 button to AI messages for text-to-speech",children:t.jsx(m,{checked:oe,onCheckedChange:Ie})}),t.jsx(s,{inline:!0,label:"TTS Provider",description:"Choose which service generates speech",children:t.jsxs("select",{value:_,onChange:e=>xe(e.target.value),className:"rounded-md border border-primary-200 bg-surface px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[t.jsx("option",{value:"auto",children:"Auto"}),t.jsx("option",{value:"elevenlabs",children:"ElevenLabs"}),t.jsx("option",{value:"openai",children:"OpenAI"}),t.jsx("option",{value:"edge",children:"Edge TTS (free)"})]})}),_==="openai"&&t.jsx(s,{inline:!0,label:"Voice",description:"OpenAI voice selection",children:t.jsx("select",{value:ue,onChange:e=>be(e.target.value),className:"rounded-md border border-primary-200 bg-surface px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:["alloy","echo","fable","onyx","nova","shimmer"].map(e=>t.jsx("option",{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})})]}),t.jsx(b,{title:"Speech-to-Text",tabId:"voice",activeTab:p,children:t.jsx(s,{inline:!0,label:"STT Provider",description:"Choose which service transcribes your voice",children:t.jsxs("select",{value:he,onChange:e=>fe(e.target.value),className:"rounded-md border border-primary-200 bg-surface px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[t.jsx("option",{value:"auto",children:"Auto"}),t.jsx("option",{value:"elevenlabs",children:"ElevenLabs"}),t.jsx("option",{value:"openai",children:"OpenAI"}),t.jsx("option",{value:"browser",children:"Browser (free)"})]})})}),t.jsxs(b,{title:"LLM Features",tabId:"llm",activeTab:p,children:[t.jsxs("div",{className:"text-xs text-primary-500 mb-3",children:["Enhance session titles and follow-up suggestions using an LLM provider.",w.hasEnvKey&&t.jsx("span",{className:"block mt-1 text-green-600",children:"✓ Server has OPENAI_API_KEY configured"}),w.hasOpenRouterKey&&t.jsx("span",{className:"block mt-1 text-green-600",children:"✓ Server has OPENROUTER_API_KEY configured"}),w.hasKilocodeKey&&t.jsx("span",{className:"block mt-1 text-green-600",children:"✓ Server has KILOCODE_API_KEY configured"})]}),t.jsx(s,{inline:!0,label:"Provider",description:"Choose LLM provider for titles & follow-ups",children:t.jsxs("select",{value:u.llmProvider,onChange:e=>{const r=e.target.value;f({llmProvider:r,llmBaseUrl:"",llmModel:""})},className:"px-2 py-1 text-sm rounded-md border border-primary-200 bg-surface focus:outline-none focus:ring-2 focus:ring-primary-500",children:[t.jsx("option",{value:"openai",children:"OpenAI"}),t.jsx("option",{value:"openrouter",children:"OpenRouter"}),t.jsx("option",{value:"kilocode",children:"Kilo Gateway"}),t.jsx("option",{value:"ollama",children:"Ollama (local)"}),t.jsx("option",{value:"custom",children:"Custom"})]})}),t.jsx(s,{inline:!0,label:"Smart session titles",description:"Generate concise titles using AI",children:t.jsx(m,{checked:u.useLlmTitles,onCheckedChange:e=>f({useLlmTitles:e}),disabled:!w.isAvailable})}),t.jsx(s,{inline:!0,label:"Smart follow-up suggestions",description:"AI-generated contextual follow-ups",children:t.jsx(m,{checked:u.useLlmFollowUps,onCheckedChange:e=>f({useLlmFollowUps:e}),disabled:!w.isAvailable})}),t.jsxs("div",{className:"mt-2 space-y-2",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-primary-500 mb-1",children:"Model"}),t.jsx("input",{type:"text",value:u.llmModel,onChange:e=>f({llmModel:e.target.value}),placeholder:H(u.llmProvider).model||"model-name",className:"w-full px-3 py-1.5 text-sm rounded-md border border-primary-200 bg-surface focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),(u.llmProvider==="custom"||u.llmProvider==="ollama")&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-primary-500 mb-1",children:"Base URL"}),t.jsx("input",{type:"text",value:u.llmBaseUrl,onChange:e=>f({llmBaseUrl:e.target.value}),placeholder:H(u.llmProvider).baseUrl||"https://...",className:"w-full px-3 py-1.5 text-sm rounded-md border border-primary-200 bg-surface focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]}),t.jsxs("div",{className:"mt-4 pt-3 border-t border-primary-100",children:[t.jsx("div",{className:"text-sm text-primary-800 mb-2",children:u.llmProvider==="ollama"?"API Key (optional)":"API Key"}),t.jsx("div",{className:"text-xs text-primary-500 mb-2",children:u.llmProvider==="ollama"?"Not required for local Ollama":w.hasEnvKey&&u.llmProvider==="openai"?"Optional: Override server key with your own":`Required for ${u.llmProvider==="openrouter"?"OpenRouter":u.llmProvider==="kilocode"?"Kilo Gateway":"LLM features"} (stored locally)`}),t.jsxs("div",{className:"text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded-md px-2 py-1.5 mb-2",children:["⚠️ ",t.jsx("strong",{children:"Security Note:"})," API keys are stored in your browser's localStorage. This is convenient but not secure for shared computers. For production use, configure keys server-side via environment variables (OPENAI_API_KEY, OPENROUTER_API_KEY, KILOCODE_API_KEY)."]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"password",value:g,onChange:e=>{R(e.target.value),k(null)},placeholder:"sk-...",className:"flex-1 px-3 py-1.5 text-sm rounded-md border border-primary-200 bg-surface focus:outline-none focus:ring-2 focus:ring-primary-500"}),t.jsx(O,{size:"sm",variant:"outline",onClick:Te,disabled:!g.trim()||M,className:"min-w-[60px]",children:M?t.jsx(C,{icon:$e,size:16,className:"animate-spin"}):"Test"})]}),S&&t.jsxs("div",{className:`mt-2 flex items-center gap-1.5 text-xs ${S.valid?"text-green-600":"text-red-600"}`,children:[t.jsx(C,{icon:S.valid?Y:Qe,size:14}),S.valid?"API key is valid":S.error||"Invalid API key"]}),u.llmApiKey&&t.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-green-600 flex items-center gap-1",children:[t.jsx(C,{icon:Y,size:14}),"Key saved"]}),t.jsx(O,{size:"sm",variant:"ghost",onClick:Oe,className:"text-xs text-red-600 hover:text-red-700 hover:bg-red-50",children:"Clear"})]}),g&&g!==u.llmApiKey&&!S?.valid&&t.jsx(O,{size:"sm",variant:"outline",onClick:Ve,className:"mt-2 w-full",children:"Save without testing"})]})]}),t.jsxs(b,{title:"About",tabId:"about",activeTab:p,children:[t.jsx("div",{className:"text-sm text-primary-800",children:"OpenCami"}),t.jsxs("div",{className:"flex gap-4 pt-2",children:[t.jsx("a",{href:"https://github.com/robbyczgw-cla/opencami",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary-600 hover:text-primary-900 hover:underline",children:"GitHub"}),t.jsx("a",{href:"https://docs.openclaw.ai",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary-600 hover:text-primary-900 hover:underline",children:"OpenClaw docs"})]})]})]})]}),t.jsx("div",{className:"mt-2 flex justify-end",children:t.jsx(G,{onClick:h,children:"Close"})})]})})})}export{Vt as SettingsDialog};