opencami 1.8.8 → 1.8.13

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 (104) hide show
  1. package/dist/client/assets/{CSPContext-nHSyQniZ.js → CSPContext-DATmz4sz.js} +1 -1
  2. package/dist/client/assets/{DirectionContext-B1cuzwIr.js → DirectionContext-FHFKdJq_.js} +1 -1
  3. package/dist/client/assets/_sessionKey-D2ZMdqJ0.js +23 -0
  4. package/dist/client/assets/agents-9A0buuwT.js +2 -0
  5. package/dist/client/assets/agents-screen-C58VLjES.js +1 -0
  6. package/dist/client/assets/bots-Lqt92ma0.js +2 -0
  7. package/dist/client/assets/{bots-screen-Qh_IK9hC.js → bots-screen-B8h4Y1VL.js} +1 -1
  8. package/dist/client/assets/{button-DdG8c-XQ.js → button-BcUmP7JL.js} +1 -1
  9. package/dist/client/assets/{composite-Cx-QHT9o.js → composite--BBbKdxm.js} +1 -1
  10. package/dist/client/assets/{connect-CSbeSBTn.js → connect-BmwKnEFP.js} +1 -1
  11. package/dist/client/assets/dashboard-BWQl_-2-.js +1 -0
  12. package/dist/client/assets/event-BxzjTPjG.js +1 -0
  13. package/dist/client/assets/file-explorer-screen-BAbbb_R4.js +1 -0
  14. package/dist/client/assets/files-DvIFms9G.js +2 -0
  15. package/dist/client/assets/follow-up-suggestions-Bq-xR5GV.js +5 -0
  16. package/dist/client/assets/{index-BxsgifDH.js → index-BTtT4Vbb.js} +1 -1
  17. package/dist/client/assets/{index-B551ln24.js → index-rOr2i8gW.js} +1 -1
  18. package/dist/client/assets/keyboard-shortcuts-dialog-BA8cBwWm.js +1 -0
  19. package/dist/client/assets/main-_1IghVZn.js +212 -0
  20. package/dist/client/assets/markdown-CqIcraPO.js +87 -0
  21. package/dist/client/assets/memory-B3LyVZwO.js +2 -0
  22. package/dist/client/assets/memory-screen-GBzowsnE.js +1 -0
  23. package/dist/client/assets/menu--FXN_JCl.js +1 -0
  24. package/dist/client/assets/{opencami-logo-BV1uPYe6.js → opencami-logo-BFo87CeM.js} +1 -1
  25. package/dist/client/assets/proxy-CJ6-TEKD.js +9 -0
  26. package/dist/client/assets/{react-dSDkXQu6.js → react-BRYbnjMp.js} +1 -1
  27. package/dist/client/assets/search-dialog-CJS2GUnE.js +1 -0
  28. package/dist/client/assets/{search-sources-badge-CTd0gLuz.js → search-sources-badge-D0YArqfp.js} +1 -1
  29. package/dist/client/assets/session-export-dialog-Bc9YEPLs.js +1 -0
  30. package/dist/client/assets/settings-dialog-SDzqDXsx.js +1 -0
  31. package/dist/client/assets/skills-BVLjvrPU.js +2 -0
  32. package/dist/client/assets/{skills-panel-Cj7yHGbX.js → skills-panel-DIalYvpW.js} +1 -1
  33. package/dist/client/assets/styles-b2XYKZYx.css +1 -0
  34. package/dist/client/assets/switch-BwmDNR0d.js +1 -0
  35. package/dist/client/assets/tabs-T1fJbUsm.js +1 -0
  36. package/dist/client/assets/thinking-DUdE6Iej.js +1 -0
  37. package/dist/client/assets/tooltip-DexBPu8g.js +1 -0
  38. package/dist/client/assets/use-file-explorer-state-eXs92yKN.js +12 -0
  39. package/dist/client/assets/{useBaseUiId-Ckx_aJky.js → useBaseUiId-DN9cOflS.js} +1 -1
  40. package/dist/client/assets/{useCompositeItem-CkvfeGmG.js → useCompositeItem-B_J-cnZX.js} +1 -1
  41. package/dist/client/assets/{useControlled-8D4PSDAL.js → useControlled-DeDLOsPR.js} +1 -1
  42. package/dist/client/assets/{useMutation-DckvFKPC.js → useMutation-TzgejsE_.js} +1 -1
  43. package/dist/client/assets/useOnFirstRender-S4-xcV93.js +1 -0
  44. package/dist/client/assets/{useQuery-CtUiG53w.js → useQuery-BdjM5kzn.js} +1 -1
  45. package/dist/server/assets/{_sessionKey-LV6xK9IM.js → _sessionKey-DBzlGMo3.js} +484 -381
  46. package/dist/server/assets/{_tanstack-start-manifest_v-qVhiIEVc.js → _tanstack-start-manifest_v-CX4xb59U.js} +1 -1
  47. package/dist/server/assets/{agents-CmQ4vvXm.js → agents-BuE0Yum3.js} +1 -1
  48. package/dist/server/assets/{agents-screen-bmrIyFbk.js → agents-screen-CEQhbEwf.js} +3 -3
  49. package/dist/server/assets/{bots-Byt6jv0a.js → bots-BDHeSvSQ.js} +1 -1
  50. package/dist/server/assets/{bots-screen-C2TGFv42.js → bots-screen-C0NRS526.js} +2 -2
  51. package/dist/server/assets/{button-CwY2OHFj.js → button-kI8fEIZQ.js} +1 -1
  52. package/dist/server/assets/{connect-BNabuqpW.js → connect-CTVBm0Vc.js} +2 -2
  53. package/dist/server/assets/{dashboard-GCKodTiJ.js → dashboard-UYRCu_mQ.js} +19 -3
  54. package/dist/server/assets/{file-explorer-screen-DH4UFK03.js → file-explorer-screen-FU_NhZmS.js} +4 -4
  55. package/dist/server/assets/{files-DYdXlQDr.js → files-DLxqp-h5.js} +1 -1
  56. package/dist/server/assets/{follow-up-suggestions-CSSc4PDe.js → follow-up-suggestions-BmSFSY87.js} +8 -8
  57. package/dist/server/assets/{index-BEWnDAH6.js → index-B_F4DTUu.js} +1 -1
  58. package/dist/server/assets/{index-DMKS4aeI.js → index-C1dylvu-.js} +1 -1
  59. package/dist/server/assets/{keyboard-shortcuts-dialog-Cr6fOqHz.js → keyboard-shortcuts-dialog-Cp3ECNNi.js} +2 -2
  60. package/dist/server/assets/{markdown-DoX5Q7qh.js → markdown-CFdYXCRQ.js} +3 -3
  61. package/dist/server/assets/{memory-Cxu7i8ej.js → memory-rBB015W-.js} +1 -1
  62. package/dist/server/assets/{memory-screen-B5l1NZRY.js → memory-screen-vqXczcVo.js} +4 -4
  63. package/dist/server/assets/{menu-D90CDTi2.js → menu-D8cKTpmN.js} +1 -1
  64. package/dist/server/assets/{router-Cr2xCvGA.js → router-CL6A11qi.js} +306 -86
  65. package/dist/server/assets/{search-dialog-DR6zBnui.js → search-dialog-D8DvpPZw.js} +8 -8
  66. package/dist/server/assets/{search-sources-badge-B0rAEDs_.js → search-sources-badge-B0t8Qffy.js} +1 -1
  67. package/dist/server/assets/{session-export-dialog-C53RRAah.js → session-export-dialog-CgtlOnwf.js} +2 -2
  68. package/dist/server/assets/{settings-dialog-DEMlCMCP.js → settings-dialog-CeP-J_NJ.js} +35 -18
  69. package/dist/server/assets/{skills-Cy8xclXY.js → skills-BXUivxuo.js} +1 -1
  70. package/dist/server/assets/{skills-panel-BnRNb7u9.js → skills-panel-CDUp4jvw.js} +2 -2
  71. package/dist/server/assets/{switch-BbkUeVDV.js → switch-BZzwkgAQ.js} +1 -1
  72. package/dist/server/assets/{tabs-DDFZob0m.js → tabs-CWbp3mT4.js} +1 -1
  73. package/dist/server/assets/{thinking-BpAc3itF.js → thinking-ClIWjSbx.js} +8 -8
  74. package/dist/server/assets/{tooltip-DgsSPocE.js → tooltip-DOvOrSSS.js} +1 -1
  75. package/dist/server/assets/{use-file-explorer-state-s7CS50ho.js → use-file-explorer-state-E6cUvMva.js} +1 -1
  76. package/dist/server/server.js +195 -38
  77. package/package.json +2 -2
  78. package/dist/client/assets/_sessionKey-CNw4O2rY.js +0 -19
  79. package/dist/client/assets/agents-C6Ev94B1.js +0 -2
  80. package/dist/client/assets/agents-screen-DpNSh5Ok.js +0 -1
  81. package/dist/client/assets/bots-B2_u-OmP.js +0 -2
  82. package/dist/client/assets/dashboard-DA1fTRcH.js +0 -1
  83. package/dist/client/assets/event-Dwf9IDxK.js +0 -1
  84. package/dist/client/assets/file-explorer-screen-DzDX4HcB.js +0 -1
  85. package/dist/client/assets/files-PsZnGOUx.js +0 -2
  86. package/dist/client/assets/follow-up-suggestions-BYWq-d8P.js +0 -5
  87. package/dist/client/assets/keyboard-shortcuts-dialog-BX-hH4Wf.js +0 -1
  88. package/dist/client/assets/main-DBmooBKx.js +0 -210
  89. package/dist/client/assets/markdown-Bpat4kTr.js +0 -87
  90. package/dist/client/assets/memory-Bs8hOoEv.js +0 -2
  91. package/dist/client/assets/memory-screen-1DgDLyZf.js +0 -1
  92. package/dist/client/assets/menu-ByR1BVmq.js +0 -1
  93. package/dist/client/assets/popupStateMapping-CGDLUl5Y.js +0 -1
  94. package/dist/client/assets/proxy-DYrSkM35.js +0 -9
  95. package/dist/client/assets/search-dialog-B3XJLq-O.js +0 -1
  96. package/dist/client/assets/session-export-dialog-Cib97JLm.js +0 -1
  97. package/dist/client/assets/settings-dialog-B4NLq1ZS.js +0 -1
  98. package/dist/client/assets/skills-pueagQNc.js +0 -2
  99. package/dist/client/assets/styles-Ce2xZzc4.css +0 -1
  100. package/dist/client/assets/switch-kXs1I0oW.js +0 -1
  101. package/dist/client/assets/tabs-B6GW7TBf.js +0 -1
  102. package/dist/client/assets/thinking-DTP9JDQl.js +0 -1
  103. package/dist/client/assets/tooltip-CtHpm-sQ.js +0 -1
  104. package/dist/client/assets/use-file-explorer-state-C-D2CShe.js +0 -12
@@ -1 +0,0 @@
1
- import{j as e,r as h,u as N,L as R}from"./main-DBmooBKx.js";import{u as g}from"./useQuery-CtUiG53w.js";import{u as S}from"./useMutation-DckvFKPC.js";import{c as M,B as f,b as k}from"./button-DdG8c-XQ.js";import{M as C}from"./markdown-Bpat4kTr.js";import"./index-BxsgifDH.js";import"./react-dSDkXQu6.js";import"./use-file-explorer-state-C-D2CShe.js";import"./useBaseUiId-Ckx_aJky.js";import"./event-Dwf9IDxK.js";import"./popupStateMapping-CGDLUl5Y.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-Cx-QHT9o.js";import"./index-T4TOjvD0.js";const w=/\/(\d{4}-\d{2}-\d{2})/;function j({path:r,label:n,selected:o,onSelect:m}){return e.jsx("button",{type:"button",onClick:()=>m(r),className:M("w-full text-left px-2.5 py-1.5 rounded-md text-sm transition-colors",o?"text-primary-900":"text-primary-600 hover:text-primary-900 hover:bg-primary-50"),style:o?{backgroundColor:"var(--opencami-accent-light)"}:void 0,children:n})}function b(r){return r==="/MEMORY.md"?"📋 MEMORY.md":r.match(w)?`📅 ${r.replace(/^\/?memory\//,"")}`:`📄 ${r.replace(/^\/?memory\//,"")}`}function F({files:r,selectedPath:n,onSelect:o,loading:m}){const i=r.filter(t=>t==="/MEMORY.md"),s=r.filter(t=>t!=="/MEMORY.md"&&w.test(t)),l=r.filter(t=>t!=="/MEMORY.md"&&!w.test(t));return e.jsxs("aside",{className:"border-r border-primary-200 bg-primary-100 md:w-72 w-full md:h-full h-auto overflow-y-auto",children:[e.jsx("div",{className:"px-4 py-3 border-b border-primary-200",children:e.jsx("h2",{className:"text-sm font-semibold text-primary-800",children:"Memory Files"})}),e.jsx("div",{className:"p-2 space-y-0.5",children:m?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"Loading files…"}):r.length===0?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"No memory files found."}):e.jsxs(e.Fragment,{children:[i.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t)),s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Daily"}),s.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Notes"}),l.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]})]})})]})}function O({filePath:r,content:n,isLoading:o,onSave:m,onBack:i}){const[s,l]=h.useState(!1),[t,x]=h.useState(n),[u,p]=h.useState(!1);h.useEffect(()=>{x(n),l(!1)},[r,n]);const a=async()=>{p(!0);try{await m(t),l(!1)}finally{p(!1)}};return e.jsxs("section",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs("header",{className:"border-b border-primary-100 px-4 py-3 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i?e.jsx(f,{size:"sm",variant:"ghost",onClick:i,children:"Back"}):null,e.jsx("h1",{className:"text-sm font-semibold text-primary-800 truncate",children:r})]}),!o&&e.jsx("div",{className:"flex items-center gap-2",children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(f,{size:"sm",onClick:()=>{a()},disabled:u,children:u?"Saving…":"Save"})]}):e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!0),children:"Edit"})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-4",children:o?e.jsx("div",{className:"text-sm text-primary-500",children:"Loading content…"}):s?e.jsx("textarea",{value:t,onChange:c=>x(c.target.value),className:"w-full min-h-[60vh] rounded-md border border-primary-200 bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}):e.jsx(C,{className:"prose prose-invert max-w-none",children:n||"_Empty file_"})})]})}const Y=/\/(\d{4}-\d{2}-\d{2})/;function z(r){const n=r.includes("/MEMORY.md")?["/MEMORY.md"]:[],o=r.filter(s=>s!=="/MEMORY.md"&&(s.startsWith("memory/")||s.startsWith("/memory/"))&&s.endsWith(".md")),m=[],i=[];for(const s of o)Y.test(s)?m.push(s):i.push(s);return m.sort((s,l)=>l.localeCompare(s)),i.sort((s,l)=>s.localeCompare(l)),[...n,...m,...i]}function J(){const r=N(),[n,o]=h.useState("/MEMORY.md"),m=g({queryKey:["memory","files"],queryFn:async({signal:a})=>{const[c,d]=await Promise.all([fetch("/api/files/read?path=/MEMORY.md",{signal:a}),fetch("/api/files/list?path=/memory",{signal:a})]),y=[];if(c.ok&&y.push("/MEMORY.md"),d.ok){const E=await d.json();for(const v of E.items)!v.isDir&&v.path.endsWith(".md")&&y.push(v.path)}return z(y)},staleTime:3e4}),i=n??m.data?.[0]??null,s=g({queryKey:["memory","content",i],queryFn:async({signal:a})=>{const c=i.startsWith("/")?i:`/${i}`,d=await fetch(`/api/files/read?path=${encodeURIComponent(c)}`,{signal:a});if(!d.ok)throw new Error("Failed to read memory file");return d.json()},enabled:!!i}),l=S({mutationFn:async a=>{const c=a.path.startsWith("/")?a.path:`/${a.path}`,d=await fetch("/api/files/save",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...a,path:c})});if(!d.ok)throw new Error("Failed to save memory file");return d.json()},onSuccess:async(a,c)=>{await r.invalidateQueries({queryKey:["memory","content",c.path]}),await r.invalidateQueries({queryKey:["memory","files"]})}}),[t,x]=h.useState(()=>typeof window<"u"?window.innerWidth<768:!1);h.useEffect(()=>{if(typeof window>"u")return;const a=()=>x(window.innerWidth<768);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const u=t&&!i,p=h.useCallback(a=>{o(a)},[]);return e.jsxs("div",{className:"h-screen bg-surface text-primary-900",children:[e.jsxs("div",{className:"h-12 border-b border-primary-100 px-3 flex items-center justify-between",children:[e.jsx("h1",{className:"text-sm font-semibold",children:"Memory Viewer"}),e.jsx(R,{to:"/chat/$sessionKey",params:{sessionKey:"main"},className:M(k({variant:"ghost",size:"sm"})),children:"Back to Chat"})]}),e.jsxs("div",{className:"h-[calc(100vh-48px)] md:grid md:grid-cols-[18rem_1fr]",children:[(!t||u)&&e.jsx(F,{files:m.data??[],selectedPath:i,onSelect:p,loading:m.isLoading}),i&&(!t||!u)?e.jsx(O,{filePath:i,content:s.data?.content??"",isLoading:s.isLoading,onBack:t?()=>o(null):void 0,onSave:async a=>{await l.mutateAsync({path:i,content:a})}}):e.jsx("div",{className:"p-4 text-sm text-primary-500",children:"Select a file to view."})]}),(m.isError||s.isError||l.isError)&&e.jsxs("div",{className:"fixed bottom-4 right-4 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:["Something went wrong. ",e.jsx(f,{size:"sm",variant:"ghost",onClick:()=>{m.refetch()},children:"Retry"})]})]})}export{J as MemoryScreen};
@@ -1 +0,0 @@
1
- import{r as n,j as V,w as Qe}from"./main-DBmooBKx.js";import{ab as Fe,ah as Ge,ac as Ne,ad as Ze,E as Nt,ag as Ae,C as At,c as nt}from"./button-DdG8c-XQ.js";import{u as mt,a as Ee,b as Te,c as ot,d as xt,e as Dt,p as ht,t as Lt,F as Ht,D as Kt,P as Ut,f as jt,R as Bt,g as Vt,h as _t,i as X,j as yt,k as Gt,l as bt,m as Wt,n as zt,o as qt,q as Yt,r as Rt,s as $t,T as Xt,v as Jt,w as Qt,x as Zt,y as en,z as tn,A as ut,B as ct,C as nn}from"./popupStateMapping-CGDLUl5Y.js";import{g as re,t as Ve,u as fe,a as xe,l as _e,i as et,j as We,f as vt,k as It,d as Ct,o as on,m as we,s as Se,p as rn,q as lt,r as sn,v as an,w as un,x as cn,b as ln,y as fn}from"./useBaseUiId-Ckx_aJky.js";import{e as dn,F as pn,I as gn,i as mn,f as xn,g as hn,h as yn}from"./use-file-explorer-state-C-D2CShe.js";import{u as bn}from"./DirectionContext-B1cuzwIr.js";import{i as ft,f as Rn,g as vn,h as In,j as Cn,d as dt,k as Mn,e as ke,s as me,a as ze,b as De,c as Le,l as Tn,m as En,n as Pn,A as Mt,o as tt}from"./event-Dwf9IDxK.js";import{h as pt,g as $e,a as gt,c as On,i as Xe,b as Sn,d as wn,e as kn,f as Ue,j as Fn,C as Nn,u as An}from"./useCompositeItem-CkvfeGmG.js";import{u as Dn,e as Ln,f as Hn,h as Kn,i as Un,j as jn}from"./tooltip-CtHpm-sQ.js";import{C as Bn}from"./composite-Cx-QHT9o.js";function Vn(e,o={}){const r="rootStore"in e?e.rootStore:e,u=r.context.dataRef,{enabled:d=!0,event:x="click",toggle:N=!0,ignoreMouse:s=!1,stickIfOpen:I=!0,touchOpenDelay:E=0}=o,h=n.useRef(void 0),T=mt(),S=Ee(),K=n.useMemo(()=>({onPointerDown(b){h.current=b.pointerType},onMouseDown(b){const i=h.current,l=b.nativeEvent,g=r.select("open");if(b.button!==0||x==="click"||ft(i,!0)&&s)return;const a=u.current.openEvent,y=a?.type,M=r.select("domReferenceElement")!==b.currentTarget,t=g&&M||!(g&&N&&(!(a&&I)||y==="click"||y==="mousedown"));if(vn(l.target)){const v=re(Ve,l,l.target);t&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,v)}):r.setOpen(t,v);return}const R=b.currentTarget;T.request(()=>{const v=re(Ve,l,R);t&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,v)}):r.setOpen(t,v)})},onClick(b){if(x==="mousedown-only")return;const i=h.current;if(x==="mousedown"&&i){h.current=void 0;return}if(ft(i,!0)&&s)return;const l=r.select("open"),g=u.current.openEvent,a=r.select("domReferenceElement")!==b.currentTarget,y=l&&a||!(l&&N&&(!(g&&I)||Rn(g))),M=re(Ve,b.nativeEvent,b.currentTarget);y&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,M)}):r.setOpen(y,M)},onKeyDown(){h.current=void 0}}),[u,x,s,r,I,N,T,S,E]);return n.useMemo(()=>d?{reference:K}:Fe,[d,K])}const _n="Escape";function qe(e,o,r){switch(e){case"vertical":return o;case"horizontal":return r;default:return o||r}}function je(e,o){return qe(o,e===Mt||e===ze,e===De||e===Le)}function Je(e,o,r){return qe(o,e===ze,r?e===De:e===Le)||e==="Enter"||e===" "||e===""}function Gn(e,o,r){return qe(o,r?e===De:e===Le,e===ze)}function Wn(e,o,r,u){const d=r?e===Le:e===De,x=e===Mt;return o==="both"||o==="horizontal"&&u&&u>1?e===_n:qe(o,d,x)}function zn(e,o){const r="rootStore"in e?e.rootStore:e,u=r.useState("open"),d=r.useState("floatingElement"),x=r.useState("domReferenceElement"),N=r.context.dataRef,{listRef:s,activeIndex:I,onNavigate:E=()=>{},enabled:h=!0,selectedIndex:T=null,allowEscape:S=!1,loopFocus:K=!1,nested:b=!1,rtl:i=!1,virtual:l=!1,focusItemOnOpen:g="auto",focusItemOnHover:a=!0,openOnArrowKeyDown:y=!0,disabledIndices:M=void 0,orientation:t="vertical",parentOrientation:R,cols:v=1,scrollItemIntoView:k=!0,itemSizes:F,dense:se=!1,id:G,resetOnPointerLeave:J=!0,externalTree:w}=o,q=In(d),L=Te(q),P=ot(),Y=xt(w);fe(()=>{N.current.orientation=t},[N,t]);const Q=Cn(x),ee=n.useRef(g),p=n.useRef(T??-1),B=n.useRef(null),Z=n.useRef(!0),m=xe(c=>{E(p.current===-1?null:p.current,c)}),ue=n.useRef(m),ce=n.useRef(!!d),pe=n.useRef(u),$=n.useRef(!1),ae=n.useRef(!1),te=Te(M),U=Te(u),A=Te(k),ie=Te(T),he=Te(J),ge=xe(()=>{function c(_){l?Y?.events.emit("virtualfocus",_):dn(_,{sync:$.current,preventScroll:!0})}const O=s.current[p.current],f=ae.current;O&&c(O),($.current?_=>_():requestAnimationFrame)(()=>{const _=s.current[p.current]||O;if(!_)return;O||c(_);const ne=A.current;ne&&ye&&(f||!Z.current)&&_.scrollIntoView?.(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne)})});fe(()=>{h&&(u&&d?(p.current=T??-1,ee.current&&T!=null&&(ae.current=!0,m())):ce.current&&(p.current=-1,ue.current()))},[h,u,d,T,m]),fe(()=>{if(h){if(!u){$.current=!1;return}if(d)if(I==null){if($.current=!1,ie.current!=null)return;if(ce.current&&(p.current=-1,ge()),(!pe.current||!ce.current)&&ee.current&&(B.current!=null||ee.current===!0&&B.current==null)){let c=0;const O=()=>{s.current[0]==null?(c<2&&(c?requestAnimationFrame:queueMicrotask)(O),c+=1):(p.current=B.current==null||Je(B.current,t,i)||b?$e(s):gt(s),B.current=null,m())};O()}}else pt(s,I)||(p.current=I,ge(),ae.current=!1)}},[h,u,d,I,ie,b,s,t,i,m,ge,te]),fe(()=>{if(!h||d||!Y||l||!ce.current)return;const c=Y.nodesRef.current,O=c.find(_=>_.id===P)?.context?.elements.floating,f=dt(Mn(d)),H=c.some(_=>_.context&&ke(_.context.elements.floating,f));O&&!H&&Z.current&&O.focus({preventScroll:!0})},[h,d,Y,P,l]),fe(()=>{ue.current=m,pe.current=u,ce.current=!!d}),fe(()=>{u||(B.current=null,ee.current=g)},[u,g]);const le=I!=null,ye=n.useMemo(()=>{function c(f){if(!U.current)return;const H=s.current.indexOf(f.currentTarget);H!==-1&&p.current!==H&&(p.current=H,m(f))}return{onFocus(f){$.current=!0,c(f)},onClick:({currentTarget:f})=>f.focus({preventScroll:!0}),onMouseMove(f){$.current=!0,ae.current=!1,a&&c(f)},onPointerLeave(f){if(!U.current||!Z.current||f.pointerType==="touch")return;$.current=!0;const H=f.relatedTarget;!a||s.current.includes(H)||he.current&&(p.current=-1,m(f),l||L.current?.focus({preventScroll:!0}))}}},[U,L,a,s,m,he,l]),j=n.useCallback(()=>R??Y?.nodesRef.current.find(c=>c.id===P)?.context?.dataRef?.current.orientation,[P,Y,R]),W=xe(c=>{if(Z.current=!1,$.current=!0,c.which===229||!U.current&&c.currentTarget===L.current)return;if(b&&Wn(c.key,t,i,v)){je(c.key,j())||me(c),r.setOpen(!1,re(_e,c.nativeEvent)),et(x)&&(l?Y?.events.emit("virtualfocus",x):x.focus());return}const O=p.current,f=$e(s,M),H=gt(s,M);if(Q||(c.key==="Home"&&(me(c),p.current=f,m(c)),c.key==="End"&&(me(c),p.current=H,m(c))),v>1){const _=F||Array.from({length:s.current.length},()=>({width:1,height:1})),ne=On(_,v,se),be=ne.findIndex(de=>de!=null&&!Xe(s,de,M)),Pe=ne.reduce((de,Re,C)=>Re!=null&&!Xe(s,Re,M)?C:de,-1),Me=ne[Sn({current:ne.map(de=>de!=null?s.current[de]:null)},{event:c,orientation:t,loopFocus:K,rtl:i,cols:v,disabledIndices:kn([...(typeof M!="function"?M:null)||s.current.map((de,Re)=>Xe(s,Re,M)?Re:void 0),void 0],ne),minIndex:be,maxIndex:Pe,prevIndex:wn(p.current>H?f:p.current,_,ne,v,c.key===ze?"bl":c.key===(i?De:Le)?"tr":"tl"),stopEvent:!0})];if(Me!=null&&(p.current=Me,m(c)),t==="both")return}if(je(c.key,t)){if(me(c),u&&!l&&dt(c.currentTarget.ownerDocument)===c.currentTarget){p.current=Je(c.key,t,i)?f:H,m(c);return}Je(c.key,t,i)?K?O>=H?S&&O!==s.current.length?p.current=-1:($.current=!1,p.current=f):p.current=Ue(s,{startingIndex:O,disabledIndices:M}):p.current=Math.min(H,Ue(s,{startingIndex:O,disabledIndices:M})):K?O<=f?S&&O!==-1?p.current=s.current.length:($.current=!1,p.current=H):p.current=Ue(s,{startingIndex:O,decrement:!0,disabledIndices:M}):p.current=Math.max(f,Ue(s,{startingIndex:O,decrement:!0,disabledIndices:M})),pt(s,p.current)&&(p.current=-1),m(c)}}),z=n.useMemo(()=>l&&u&&le&&{"aria-activedescendant":`${G}-${I}`},[l,u,le,G,I]),Ie=n.useMemo(()=>({"aria-orientation":t==="both"?void 0:t,...Q?{}:z,onKeyDown(c){if(c.key==="Tab"&&c.shiftKey&&u&&!l){const O=Tn(c.nativeEvent);if(O&&!ke(L.current,O))return;me(c),r.setOpen(!1,re(We,c.nativeEvent)),et(x)&&x.focus();return}W(c)},onPointerMove(){Z.current=!0}}),[z,W,L,t,Q,r,u,l,x]),Ce=n.useMemo(()=>{function c(f){g==="auto"&&En(f.nativeEvent)&&(ee.current=!l)}function O(f){ee.current=g,g==="auto"&&Pn(f.nativeEvent)&&(ee.current=!0)}return{onKeyDown(f){const H=r.select("open");Z.current=!1;const _=f.key.startsWith("Arrow"),ne=Gn(f.key,j(),i),be=je(f.key,t),Pe=(b?ne:be)||f.key==="Enter"||f.key.trim()==="";if(l&&H)return W(f);if(!(!H&&!y&&_)){if(Pe){const Me=je(f.key,j());B.current=b&&Me?null:f.key}if(b){ne&&(me(f),H?(p.current=$e(s,te.current),m(f)):r.setOpen(!0,re(_e,f.nativeEvent,f.currentTarget)));return}be&&(ie.current!=null&&(p.current=ie.current),me(f),!H&&y?r.setOpen(!0,re(_e,f.nativeEvent,f.currentTarget)):W(f),H&&m(f))}},onFocus(f){r.select("open")&&!l&&(p.current=-1,m(f))},onPointerDown:O,onPointerEnter:O,onMouseDown:c,onClick:c}},[W,te,g,s,b,m,r,y,t,j,i,ie,l]),He=n.useMemo(()=>({...z,...Ce}),[z,Ce]);return n.useMemo(()=>h?{reference:He,floating:Ie,item:ye,trigger:Ce}:{},[h,He,Ie,Ce,ye])}function qn(e,o){const r="rootStore"in e?e.rootStore:e,u=r.useState("open"),d=r.context.dataRef,{listRef:x,activeIndex:N,onMatch:s,onTypingChange:I,enabled:E=!0,findMatch:h=null,resetMs:T=750,ignoreKeys:S=Ge,selectedIndex:K=null}=o,b=Ee(),i=n.useRef(""),l=n.useRef(K??N??-1),g=n.useRef(null);fe(()=>{u&&(b.clear(),g.current=null,i.current="")},[u,b]),fe(()=>{u&&i.current===""&&(l.current=K??N??-1)},[u,K,N]);const a=xe(R=>{R?d.current.typing||(d.current.typing=R,I?.(R)):d.current.typing&&(d.current.typing=R,I?.(R))}),y=xe(R=>{function v(J,w,q){const L=h?h(w,q):w.find(P=>P?.toLocaleLowerCase().indexOf(q.toLocaleLowerCase())===0);return L?J.indexOf(L):-1}const k=x.current;if(i.current.length>0&&i.current[0]!==" "&&(v(k,k,i.current)===-1?a(!1):R.key===" "&&me(R)),k==null||S.includes(R.key)||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;u&&R.key!==" "&&(me(R),a(!0)),k.every(J=>J?J[0]?.toLocaleLowerCase()!==J[1]?.toLocaleLowerCase():!0)&&i.current===R.key&&(i.current="",l.current=g.current),i.current+=R.key,b.start(T,()=>{i.current="",l.current=g.current,a(!1)});const se=l.current,G=v(k,[...k.slice((se||0)+1),...k.slice(0,(se||0)+1)],i.current);G!==-1?(s?.(G),g.current=G):R.key!==" "&&(i.current="",a(!1))}),M=n.useMemo(()=>({onKeyDown:y}),[y]),t=n.useMemo(()=>({onKeyDown:y,onKeyUp(R){R.key===" "&&a(!1)}}),[y,a]);return n.useMemo(()=>E?{reference:M,floating:t}:{},[E,M,t])}const Tt=n.createContext(void 0);function Et(e){const o=n.useContext(Tt);if(o===void 0&&!e)throw new Error(Ne(33));return o}const Pt=n.createContext(void 0);function ve(e){const o=n.useContext(Pt);if(o===void 0&&!e)throw new Error(Ne(36));return o}const Yn=n.createContext(void 0);function Ye(e=!0){const o=n.useContext(Yn);if(o===void 0&&!e)throw new Error(Ne(25));return o}const $n={type:"regular-item"};function Xn(e){const{closeOnClick:o,disabled:r=!1,highlighted:u,id:d,store:x,nativeButton:N,itemMetadata:s,nodeId:I}=e,E=n.useRef(null),h=Ye(!0),T=h!==void 0,{events:S}=x.useState("floatingTreeRoot"),{getButtonProps:K,buttonRef:b}=vt({disabled:r,focusableWhenDisabled:!0,native:N}),i=n.useCallback(g=>Ze({id:d,role:"menuitem",tabIndex:u?0:-1,onMouseMove(a){I&&S.emit("itemhover",{nodeId:I,target:a.currentTarget})},onMouseEnter(){s.type==="submenu-trigger"&&s.setActive()},onKeyUp(a){a.key===" "&&x.context.typingRef.current&&a.preventBaseUIHandler()},onClick(a){o&&S.emit("close",{domEvent:a,reason:It})},onMouseUp(a){if(h){const y=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,T&&y&&Math.abs(a.clientX-y.x)<=1&&Math.abs(a.clientY-y.y)<=1)return}E.current&&x.context.allowMouseUpTriggerRef.current&&(!T||a.button===2)&&s.type==="regular-item"&&E.current.click()}},g,K),[d,u,K,o,S,x,T,h,s,I]),l=Nt(E,b);return n.useMemo(()=>({getItemProps:i,itemRef:l}),[i,l])}const Jn=n.forwardRef(function(o,r){const{render:u,className:d,id:x,label:N,nativeButton:s=!1,disabled:I=!1,closeOnClick:E=!0,...h}=o,T=Fn({label:N}),S=Et(!0),K=Ct(x),{store:b}=ve(),i=b.useState("isActive",T.index),l=b.useState("itemProps"),{getItemProps:g,itemRef:a}=Xn({closeOnClick:E,disabled:I,highlighted:i,id:K,store:b,nativeButton:s,nodeId:S?.nodeId,itemMetadata:$n}),y=n.useMemo(()=>({disabled:I,highlighted:i}),[I,i]);return Ae("div",o,{state:y,props:[l,h,g],ref:[a,r,T.ref]})}),Qn=n.createContext(void 0);function Zn(e){return n.useContext(Qn)}const eo={...ht,...Lt},to=n.forwardRef(function(o,r){const{render:u,className:d,finalFocus:x,...N}=o,{store:s}=ve(),{side:I,align:E}=Et(),h=Zn()!=null,T=s.useState("open"),S=s.useState("transitionStatus"),K=s.useState("popupProps"),b=s.useState("mounted"),i=s.useState("instantType"),l=s.useState("activeTriggerElement"),g=s.useState("parent"),a=s.useState("lastOpenChangeReason"),y=s.useState("rootId"),M=s.useState("floatingRootContext"),t=s.useState("floatingTreeRoot"),R=s.useState("closeDelay"),v=s.useState("activeTriggerElement"),k=g.type==="context-menu";Dt({open:T,ref:s.context.popupRef,onComplete(){T&&s.context.onOpenChangeComplete?.(!0)}}),n.useEffect(()=>{function q(L){s.setOpen(!1,re(L.reason,L.domEvent))}return t.events.on("close",q),()=>{t.events.off("close",q)}},[t.events,s]);const F=s.useState("hoverEnabled"),se=s.useState("disabled");Dn(M,{enabled:F&&!se&&!k&&g.type!=="menubar",closeDelay:R});const G=n.useMemo(()=>({transitionStatus:S,side:I,align:E,open:T,nested:g.type==="menu",instant:i}),[S,I,E,T,g.type,i]),J=Ae("div",o,{state:G,ref:[r,s.context.popupRef],stateAttributesMapping:eo,props:[K,{onKeyDown(q){h&&Bn.has(q.key)&&q.stopPropagation()}},Ln(S),N,{"data-rootownerid":y}]});let w=g.type===void 0||k;return(l||g.type==="menubar"&&a!==on)&&(w=!0),V.jsx(pn,{context:M,modal:k,disabled:!b,returnFocus:x===void 0?w:x,initialFocus:g.type!=="menu",restoreFocus:!0,externalTree:g.type!=="menubar"?t:void 0,previousFocusableElement:v,nextFocusableElement:g.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:J})}),Ot=n.createContext(void 0);function no(){const e=n.useContext(Ot);if(e===void 0)throw new Error(Ne(32));return e}const oo=n.forwardRef(function(o,r){const{keepMounted:u=!1,...d}=o,{store:x}=ve();return x.useState("mounted")||u?V.jsx(Ot.Provider,{value:u,children:V.jsx(Ht,{ref:r,...d})}):null}),ro=n.forwardRef(function(o,r){const{anchor:u,positionMethod:d="absolute",className:x,render:N,side:s,align:I,sideOffset:E=0,alignOffset:h=0,collisionBoundary:T="clipping-ancestors",collisionPadding:S=5,arrowPadding:K=5,sticky:b=!1,disableAnchorTracking:i=!1,collisionAvoidance:l=Kt,...g}=o,{store:a}=ve(),y=no(),M=Ye(!0),t=a.useState("parent"),R=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),k=a.useState("mounted"),F=a.useState("open"),se=a.useState("modal"),G=a.useState("activeTriggerElement"),J=a.useState("lastOpenChangeReason"),w=a.useState("floatingNodeId"),q=a.useState("floatingParentNodeId");let L=u,P=E,Y=h,Q=I,ee=l;t.type==="context-menu"&&(L=u??t.context?.anchor,Q=Q??"start",!s&&Q!=="center"&&(Y=o.alignOffset??2,P=o.sideOffset??-5));let p=s,B=Q;t.type==="menu"?(p=p??"inline-end",B=B??"start",ee=o.collisionAvoidance??Ut):t.type==="menubar"&&(p=p??"bottom",B=B??"start");const Z=t.type==="context-menu",m=Hn({anchor:L,floatingRootContext:R,positionMethod:M?"fixed":d,mounted:k,side:p,sideOffset:P,align:B,alignOffset:Y,arrowPadding:Z?0:K,collisionBoundary:T,collisionPadding:S,sticky:b,nodeId:w,keepMounted:y,disableAnchorTracking:i,collisionAvoidance:ee,shiftCrossAxis:Z,externalTree:v}),ue=n.useMemo(()=>{const U={};return F||(U.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...m.positionerStyles,...U}}},[F,k,m.positionerStyles]);n.useEffect(()=>{function U(A){A.open?(A.parentNodeId===w&&a.set("hoverEnabled",!1),A.nodeId!==w&&A.parentNodeId===a.select("floatingParentNodeId")&&a.setOpen(!1,re(Se))):A.parentNodeId===w&&A.reason!==Se&&a.set("hoverEnabled",!0)}return v.events.on("menuopenchange",U),()=>{v.events.off("menuopenchange",U)}},[a,v.events,w]),n.useEffect(()=>{if(a.select("floatingParentNodeId")==null)return;function U(A){if(A.open||A.nodeId!==a.select("floatingParentNodeId"))return;const ie=A.reason??Se;a.setOpen(!1,re(ie))}return v.events.on("menuopenchange",U),()=>{v.events.off("menuopenchange",U)}},[v.events,a]),n.useEffect(()=>{function U(A){!F||A.nodeId!==a.select("floatingParentNodeId")||A.target&&G&&G!==A.target&&a.setOpen(!1,re(Se))}return v.events.on("itemhover",U),()=>{v.events.off("itemhover",U)}},[v.events,F,G,a]),n.useEffect(()=>{const U={open:F,nodeId:w,parentNodeId:q,reason:a.select("lastOpenChangeReason")};v.events.emit("menuopenchange",U)},[v.events,F,a,w,q]);const ce=n.useMemo(()=>({open:F,side:m.side,align:m.align,anchorHidden:m.anchorHidden,nested:t.type==="menu"}),[F,m.side,m.align,m.anchorHidden,t.type]),pe=n.useMemo(()=>({side:m.side,align:m.align,arrowRef:m.arrowRef,arrowUncentered:m.arrowUncentered,arrowStyles:m.arrowStyles,nodeId:m.context.nodeId}),[m.side,m.align,m.arrowRef,m.arrowUncentered,m.arrowStyles,m.context.nodeId]),$=Ae("div",o,{state:ce,stateAttributesMapping:ht,ref:[r,a.useStateSetter("positionerElement")],props:[ue,g]}),ae=k&&t.type!=="menu"&&(t.type!=="menubar"&&se&&J!==we||t.type==="menubar"&&t.context.modal);let te=null;return t.type==="menubar"?te=t.context.contentElement:t.type===void 0&&(te=G),V.jsxs(Tt.Provider,{value:pe,children:[ae&&V.jsx(gn,{ref:t.type==="context-menu"||t.type==="nested-context-menu"?t.context.internalBackdropRef:null,inert:mn(!F),cutout:te}),V.jsx(jt,{id:w,children:V.jsx(Nn,{elementsRef:a.context.itemDomElements,labelsRef:a.context.itemLabels,children:$})})]})}),so=n.createContext(null);function St(e){return n.useContext(so)}const io={..._t,disabled:X(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:X(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:X(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:X(e=>e.stickIfOpen),parent:X(e=>e.parent),rootId:X(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:X(e=>e.activeIndex),isActive:X((e,o)=>e.activeIndex===o),hoverEnabled:X(e=>e.hoverEnabled),instantType:X(e=>e.instantType),lastOpenChangeReason:X(e=>e.openChangeReason),floatingTreeRoot:X(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:X(e=>e.floatingNodeId),floatingParentNodeId:X(e=>e.floatingParentNodeId),itemProps:X(e=>e.itemProps),closeDelay:X(e=>e.closeDelay),keyboardEventRelay:X(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class rt extends Bt{constructor(o){super({...ao(),...o},{positionerRef:n.createRef(),popupRef:n.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),onOpenChangeComplete:void 0,triggerElements:new Vt},io),this.observe(X(r=>r.allowMouseEnter),(r,u)=>{this.state.parent.type==="menu"&&r!==u&&this.state.parent.store.set("allowMouseEnter",r)}),this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(o,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:o,eventDetails:r})}static useStore(o,r){const u=At(()=>new rt(r)).current;return o??u}unsubscribeParentListener=null}function ao(){return{...Gt(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new yt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Fe,keyboardEventRelay:void 0,closeDelay:0}}const uo=n.createContext(void 0);function co(){return n.useContext(uo)}function lo(e){const{children:o,open:r,onOpenChange:u,onOpenChangeComplete:d,defaultOpen:x=!1,disabled:N=!1,modal:s,loopFocus:I=!0,orientation:E="vertical",actionsRef:h,closeParentOnEsc:T=!1,handle:S,triggerId:K,defaultTriggerId:b=null,highlightItemOnHover:i=!0}=e,l=Ye(!0),g=ve(!0),a=St(),y=co(),M=n.useMemo(()=>y&&g?{type:"menu",store:g.store}:a?{type:"menubar",context:a}:l&&!g?{type:"context-menu",context:l}:{type:void 0},[l,g,a,y]),t=rt.useStore(S?.store,{parent:M}),R=t.useState("floatingTreeRoot"),v=bt(R),k=ot();fe(()=>{l&&!g?t.update({parent:{type:"context-menu",context:l},floatingNodeId:v,floatingParentNodeId:k}):g&&t.update({floatingNodeId:v,floatingParentNodeId:k})},[l,g,v,k,t]),t.useControlledProp("open",r,x),t.useControlledProp("activeTriggerId",K,b),t.useContextCallback("onOpenChangeComplete",d);const F=t.useState("open"),se=t.useState("activeTriggerElement"),G=t.useState("positionerElement"),J=t.useState("hoverEnabled"),w=t.useState("modal"),q=t.useState("disabled"),L=t.useState("lastOpenChangeReason"),P=t.useState("parent"),Y=t.useState("activeIndex"),Q=t.useState("payload"),ee=t.useState("floatingParentNodeId"),p=n.useRef(null),B=ee!=null;let Z;t.useSyncedValues({disabled:N,modal:P.type===void 0?s:void 0,rootId:rn()});const{openMethod:m,triggerProps:ue,reset:ce}=xn(F);Wt(t);const{forceUnmount:pe}=zt(F,t,()=>{t.update({allowMouseEnter:!1,stickIfOpen:!0}),ce()}),$=n.useRef(P.type!=="context-menu"),ae=Ee();n.useEffect(()=>{if(F||(p.current=null),P.type==="context-menu"){if(!F){ae.clear(),$.current=!1;return}ae.start(500,()=>{$.current=!0})}},[ae,F,P.type]),hn(F&&w&&L!==we&&m!=="touch",G),fe(()=>{!F&&!J&&t.set("hoverEnabled",!0)},[F,J,t]);const te=n.useRef(!0),U=Ee(),A=xe((C,D)=>{const oe=D.reason;if(F===C&&D.trigger===se&&L===oe||(D.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},!C&&D.trigger==null&&(D.trigger=se??void 0),u?.(C,D),D.isCanceled))return;const kt={open:C,nativeEvent:D.event,reason:D.reason,nested:B};Z?.emit("openchange",kt);const Ke=D.event;if(C===!1&&Ke?.type==="click"&&Ke.pointerType==="touch"&&!te.current)return;if(!C&&Y!==null){const Oe=t.context.itemDomElements.current[Y];queueMicrotask(()=>{Oe?.setAttribute("tabindex","-1")})}C&&oe===lt?(te.current=!1,U.start(300,()=>{te.current=!0})):(te.current=!0,U.clear());const st=(oe===Ve||oe===It)&&Ke.detail===0&&Ke?.isTrusted,Ft=!C&&(oe===sn||oe==null);function it(){const Oe={open:C,openChangeReason:oe};p.current=D.event??null;const at=D.trigger?.id??null;(at||C)&&(Oe.activeTriggerId=at,Oe.activeTriggerElement=D.trigger??null),t.update(Oe)}oe===we?Qe.flushSync(it):it(),P.type==="menubar"&&(oe===lt||oe===We||oe===we||oe===_e||oe===Se)?t.set("instantType","group"):st||Ft?t.set("instantType",st?"click":"dismiss"):t.set("instantType",void 0)}),ie=n.useCallback(C=>{const D=re(C);return D.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},D},[t]),he=n.useCallback(()=>{t.setOpen(!1,ie(an))},[t,ie]);n.useImperativeHandle(h,()=>({unmount:pe,close:he}),[pe,he]);let ge;P.type==="context-menu"&&(ge=P.context),n.useImperativeHandle(ge?.positionerRef,()=>G,[G]),n.useImperativeHandle(ge?.actionsRef,()=>({setOpen:A}),[A]);const le=qt({popupStore:t,onOpenChange:A});Z=le.context.events,n.useEffect(()=>{const C=({open:D,eventDetails:oe})=>A(D,oe);return Z.on("setOpen",C),()=>{Z?.off("setOpen",C)}},[Z,A]);const ye=Yt(le,{enabled:!q,bubbles:{escapeKey:T&&P.type==="menu"},outsidePress(){return P.type!=="context-menu"||p.current?.type==="contextmenu"?!0:$.current},externalTree:B?R:void 0}),j=yn(le,{role:"menu"}),W=bn(),z=n.useCallback(C=>{t.select("activeIndex")!==C&&t.set("activeIndex",C)},[t]),Ie=zn(le,{enabled:!q,listRef:t.context.itemDomElements,activeIndex:Y,nested:P.type!==void 0,loopFocus:I,orientation:E,parentOrientation:P.type==="menubar"?P.context.orientation:void 0,rtl:W==="rtl",disabledIndices:Ge,onNavigate:z,openOnArrowKeyDown:P.type!=="context-menu",externalTree:B?R:void 0,focusItemOnHover:i}),Ce=n.useCallback(C=>{t.context.typingRef.current=C},[t]),He=qn(le,{listRef:t.context.itemLabels,activeIndex:Y,resetMs:Xt,onMatch:C=>{F&&C!==Y&&t.set("activeIndex",C)},onTypingChange:Ce}),{getReferenceProps:c,getFloatingProps:O,getItemProps:f,getTriggerProps:H}=Rt([ye,j,Ie,He]),_=n.useMemo(()=>{const C=Ze(c(),{onMouseEnter(){t.set("hoverEnabled",!0)},onMouseMove(){t.set("allowMouseEnter",!0)}},ue);return delete C.role,C},[c,t,ue]),ne=n.useMemo(()=>{const C=H();if(!C)return C;const D=Ze(C,ue);return delete D.role,delete D["aria-controls"],D},[H,ue]),be=mt(),Pe=n.useMemo(()=>O({onMouseEnter(){P.type==="menu"&&be.request(()=>t.set("hoverEnabled",!1))},onMouseMove(){t.set("allowMouseEnter",!0)},onClick(){t.select("hoverEnabled")&&t.set("hoverEnabled",!1)},onKeyDown(C){const D=t.select("keyboardEventRelay");D&&!C.isPropagationStopped()&&D(C)}}),[O,P.type,be,t]),Me=n.useMemo(()=>f(),[f]);t.useSyncedValues({floatingRootContext:le,activeTriggerProps:_,inactiveTriggerProps:ne,popupProps:Pe,itemProps:Me});const de=n.useMemo(()=>({store:t,parent:M}),[t,M]),Re=V.jsx(Pt.Provider,{value:de,children:typeof o=="function"?o({payload:Q}):o});return P.type===void 0||P.type==="context-menu"?V.jsx($t,{externalTree:R,children:Re}):Re}function fo(e){const o=e.getBoundingClientRect(),r=window.getComputedStyle(e,"::before"),u=window.getComputedStyle(e,"::after");if(!(r.content!=="none"||u.content!=="none"))return o;const x=parseFloat(r.width)||0,N=parseFloat(r.height)||0,s=parseFloat(u.width)||0,I=parseFloat(u.height)||0,E=Math.max(o.width,x,s),h=Math.max(o.height,N,I),T=E-o.width,S=h-o.height;return{left:o.left-T/2,right:o.right+T/2,top:o.top-S/2,bottom:o.bottom+S/2}}function po(e){const{render:o,className:r,state:u=Fe,props:d=Ge,refs:x=Ge,metadata:N,stateAttributesMapping:s,tag:I="div",...E}=e,{compositeProps:h,compositeRef:T}=An({metadata:N});return Ae(I,e,{state:u,ref:[...x,T],props:[h,...d,E],stateAttributesMapping:s})}function wt(e){if(et(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!un(e))return wt(cn(e))}function go(e){const{enabled:o=!0,mouseDownAction:r,open:u}=e,d=n.useRef(!1);return n.useMemo(()=>o?{onMouseDown:x=>{(r==="open"&&!u||r==="close"&&u)&&(d.current=!0,tt(x.currentTarget).addEventListener("click",()=>{d.current=!1},{once:!0}))},onClick:x=>{d.current&&(d.current=!1,x.preventBaseUIHandler())}}:Fe,[o,r,u])}const Be=2,mo=n.forwardRef(function(o,r){const{render:u,className:d,disabled:x=!1,nativeButton:N=!0,id:s,openOnHover:I,delay:E=100,closeDelay:h=0,handle:T,payload:S,...K}=o,b=ve(!0),i=T?.store??b?.store;if(!i)throw new Error(Ne(85));const l=Ct(s),g=i.useState("isTriggerActive",l),a=i.useState("floatingRootContext"),y=i.useState("isOpenedByTrigger",l),M=n.useRef(null),t=ho(),R=ln(!0),v=xt(),k=n.useMemo(()=>v??new yt,[v]),F=bt(k),se=ot(),{registerTrigger:G,isMountedByThisTrigger:J}=Jt(l,M,i,{payload:S,closeDelay:h,parent:t,floatingTreeRoot:k,floatingNodeId:F,floatingParentNodeId:se,keyboardEventRelay:R?.relayKeyboardEvent}),w=t.type==="menubar",q=i.useState("disabled"),L=x||q||w&&t.context.disabled,{getButtonProps:P,buttonRef:Y}=vt({disabled:L,native:N});n.useEffect(()=>{!y&&t.type===void 0&&(i.context.allowMouseUpTriggerRef.current=!1)},[i,y,t.type]);const Q=n.useRef(null),ee=Ee(),p=xe(j=>{if(!Q.current)return;ee.clear(),i.context.allowMouseUpTriggerRef.current=!1;const W=j.target;if(ke(Q.current,W)||ke(i.select("positionerElement"),W)||W===Q.current||W!=null&&wt(W)===i.select("rootId"))return;const z=fo(Q.current);j.clientX>=z.left-Be&&j.clientX<=z.right+Be&&j.clientY>=z.top-Be&&j.clientY<=z.bottom+Be||k.events.emit("close",{domEvent:j,reason:fn})});n.useEffect(()=>{y&&i.select("lastOpenChangeReason")===we&&tt(Q.current).addEventListener("mouseup",p,{once:!0})},[y,p,i]);const B=w&&t.context.hasSubmenuOpen,m=Kn(a,{enabled:(I??B)&&!L&&t.type!=="context-menu"&&(!w||B&&!J),handleClose:Un({blockPointerEvents:!w}),mouseOnly:!0,move:!1,restMs:t.type===void 0?E:void 0,delay:{close:h},triggerElementRef:M,externalTree:k,isActiveTrigger:g}),ue=xo(y,i.select("lastOpenChangeReason")),ce=Vn(a,{enabled:!L&&t.type!=="context-menu",event:y&&w?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:t.type===void 0?ue:!1}),pe=jn(a,{enabled:!L&&B}),$=go({open:y,enabled:w,mouseDownAction:"open"}),ae=Rt([ce,pe]),te=n.useMemo(()=>({disabled:L,open:y}),[L,y]),U=i.useState("triggerProps",J),A=[Q,r,Y,G,M],ie=[ae.getReferenceProps(),m??Fe,U,{"aria-haspopup":"menu",id:l,onMouseDown:j=>{if(i.select("open"))return;ee.start(200,()=>{i.context.allowMouseUpTriggerRef.current=!0}),tt(j.currentTarget).addEventListener("mouseup",p,{once:!0})}},w?{role:"menuitem"}:{},$,K,P],he=n.useRef(null),ge=xe(j=>{Qe.flushSync(()=>{i.setOpen(!1,re(We,j.nativeEvent,j.currentTarget))}),Qt(he.current)?.focus()}),le=xe(j=>{const W=i.select("positionerElement");if(W&&Zt(j,W))i.context.beforeContentFocusGuardRef.current?.focus();else{Qe.flushSync(()=>{i.setOpen(!1,re(We,j.nativeEvent,j.currentTarget))});let z=en(i.context.triggerFocusTargetRef.current||M.current);for(;z!==null&&ke(W,z);){const Ie=z;if(z=tn(z),z===Ie)break}z?.focus()}}),ye=Ae("button",o,{enabled:!w,stateAttributesMapping:ut,state:te,ref:A,props:ie});return w?V.jsx(po,{tag:"button",render:u,className:d,state:te,refs:A,props:ie,stateAttributesMapping:ut}):y?V.jsxs(n.Fragment,{children:[V.jsx(ct,{ref:he,onFocus:ge},`${l}-pre-focus-guard`),V.jsx(n.Fragment,{children:ye},l),V.jsx(ct,{ref:i.context.triggerFocusTargetRef,onFocus:le},`${l}-post-focus-guard`)]}):V.jsx(n.Fragment,{children:ye},l)});function xo(e,o){const r=Ee(),[u,d]=n.useState(!1);return fe(()=>{e&&o==="trigger-hover"?(d(!0),r.start(nn,()=>{d(!1)})):e||(r.clear(),d(!1))},[e,o,r]),u}function ho(){const e=Ye(!0),o=ve(!0),r=St();return n.useMemo(()=>r?{type:"menubar",context:r}:e&&!o?{type:"context-menu",context:e}:{type:void 0},[e,o,r])}function Oo({children:e,...o}){return V.jsx(lo,{...o,children:e})}function So({className:e,...o}){return V.jsx(mo,{className:nt(e),...o})}function wo({className:e,side:o="bottom",align:r="end",children:u}){return V.jsx(oo,{children:V.jsx(ro,{side:o,align:r,children:V.jsx(to,{className:nt("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:u})})})}function ko({className:e,...o}){return V.jsx(Jn,{className:nt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...o})}export{Oo as M,So as a,wo as b,ko as c};
@@ -1 +0,0 @@
1
- import{u as P,p as Ne,g as Y,j as Pt,a as y,O as Nt,r as Mt,e as B,w as Ce,x as At,i as kt,h as Ft,o as Lt,E as xe,t as We,H as Dt,n as Vt}from"./useBaseUiId-Ckx_aJky.js";import{C as ne,ab as ue,ag as jt,ac as _t,ai as qt,af as Bt}from"./button-DdG8c-XQ.js";import{r as f,j as D,w as Me,x as Kt,y as Wt}from"./main-DBmooBKx.js";import{u as Ze,e as Q,k as G,d as Ht,v as Ut,w as zt,l as z,x as Yt,y as k,f as Gt,F as $t,z as Je,S as Qe}from"./event-Dwf9IDxK.js";import{a as Xt}from"./visuallyHidden-COI6QeQH.js";const pr=500,gr=500,hr={style:{transition:"none"}},mr="data-base-ui-click-trigger",br={fallbackAxisSide:"none"},vr={fallbackAxisSide:"end"},Zt={clipPath:"inset(50%)",position:"fixed",top:0,left:0},J=0;class me{static create(){return new me}currentId=J;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=J,t()},e)}isStarted(){return this.currentId!==J}clear=()=>{this.currentId!==J&&(clearTimeout(this.currentId),this.currentId=J)};disposeEffect=()=>this.clear}function He(){const n=ne(me.create).current;return Ze(n.disposeEffect),n}const ie=null;class Jt{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const t=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<t.length;s+=1)t[s]?.(e)};request(e){const t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}}const oe=new Jt;class L{static create(){return new L}static request(e){return oe.request(e)}static cancel(e){return oe.cancel(e)}currentId=ie;request(e){this.cancel(),this.currentId=oe.request(()=>{this.currentId=ie,e()})}cancel=()=>{this.currentId!==ie&&(oe.cancel(this.currentId),this.currentId=ie)};disposeEffect=()=>this.cancel}function Qt(){const n=ne(L.create).current;return Ze(n.disposeEffect),n}function Er(n){const e=ne(en,n).current;return e.next=n,P(e.effect),e}function en(n){const e={current:n,next:n,effect:()=>{e.current=e.next}};return e}function le(n,e,t=!0){return n.filter(s=>s.parentId===e&&(!t||s.context?.open)).flatMap(s=>[s,...le(n,s.id,t)])}function yr(n,e){let t=[],r=n.find(s=>s.id===e)?.parentId;for(;r;){const s=n.find(i=>i.id===r);r=s?.parentId,s&&(t=t.concat(s))}return t}var tn=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],fe=tn.join(","),et=typeof Element>"u",$=et?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!et&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},pe=function(e,t){var r;t===void 0&&(t=!0);var s=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),i=s===""||s==="true",o=i||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):pe(e.parentNode));return o},nn=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},tt=function(e,t,r){if(pe(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(fe));return t&&$.call(e,fe)&&s.unshift(e),s=s.filter(r),s},ge=function(e,t,r){for(var s=[],i=Array.from(e);i.length;){var o=i.shift();if(!pe(o,!1))if(o.tagName==="SLOT"){var c=o.assignedElements(),l=c.length?c:o.children,a=ge(l,!0,r);r.flatten?s.push.apply(s,a):s.push({scopeParent:o,candidates:a})}else{var p=$.call(o,fe);p&&r.filter(o)&&(t||!e.includes(o))&&s.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!pe(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var S=ge(d===!0?o.children:d.children,!0,r);r.flatten?s.push.apply(s,S):s.push({scopeParent:o,candidates:S})}else i.unshift.apply(i,o.children)}}return s},nt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},rt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||nn(e))&&!nt(e)?0:e.tabIndex},rn=function(e,t){var r=rt(e);return r<0&&t&&!nt(e)?0:r},sn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},st=function(e){return e.tagName==="INPUT"},on=function(e){return st(e)&&e.type==="hidden"},an=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},cn=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},un=function(e){if(!e.name)return!0;var t=e.form||de(e),r=function(c){return t.querySelectorAll('input[type="radio"][name="'+c+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(e.name));else try{s=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=cn(s,e.form);return!i||i===e},ln=function(e){return st(e)&&e.type==="radio"},fn=function(e){return ln(e)&&!un(e)},dn=function(e){var t,r=e&&de(e),s=(t=r)===null||t===void 0?void 0:t.host,i=!1;if(r&&r!==e){var o,c,l;for(i=!!((o=s)!==null&&o!==void 0&&(c=o.ownerDocument)!==null&&c!==void 0&&c.contains(s)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!i&&s;){var a,p,d;r=de(s),s=(a=r)===null||a===void 0?void 0:a.host,i=!!((p=s)!==null&&p!==void 0&&(d=p.ownerDocument)!==null&&d!==void 0&&d.contains(s))}}return i},Ue=function(e){var t=e.getBoundingClientRect(),r=t.width,s=t.height;return r===0&&s===0},pn=function(e,t){var r=t.displayCheck,s=t.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var i=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(e).visibility==="hidden")return!0;var o=$.call(e,"details>summary:first-of-type"),c=o?e.parentElement:e;if($.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var l=e;e;){var a=e.parentElement,p=de(e);if(a&&!a.shadowRoot&&s(a)===!0)return Ue(e);e.assignedSlot?e=e.assignedSlot:!a&&p!==e.ownerDocument?e=p.host:e=a}e=l}if(dn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ue(e);return!1},gn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var s=t.children.item(r);if(s.tagName==="LEGEND")return $.call(t,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}t=t.parentElement}return!1},Oe=function(e,t){return!(t.disabled||on(t)||pn(t,e)||an(t)||gn(t))},we=function(e,t){return!(fn(t)||rt(t)<0||!Oe(e,t))},hn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},it=function(e){var t=[],r=[];return e.forEach(function(s,i){var o=!!s.scopeParent,c=o?s.scopeParent:s,l=rn(c,o),a=o?it(s.candidates):c;l===0?o?t.push.apply(t,a):t.push(c):r.push({documentOrder:i,tabIndex:l,item:s,isScope:o,content:a})}),r.sort(sn).reduce(function(s,i){return i.isScope?s.push.apply(s,i.content):s.push(i.content),s},[]).concat(t)},Ae=function(e,t){t=t||{};var r;return t.getShadowRoot?r=ge([e],t.includeContainer,{filter:we.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:hn}):r=tt(e,t.includeContainer,we.bind(null,t)),it(r)},Sr=function(e,t){t=t||{};var r;return t.getShadowRoot?r=ge([e],t.includeContainer,{filter:Oe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=tt(e,t.includeContainer,Oe.bind(null,t)),r},Tr=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return $.call(e,fe)===!1?!1:we(t,e)};const ke=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ot(n,e){const t=Ae(n,ke()),r=t.length;if(r===0)return;const s=Ht(G(n)),i=t.indexOf(s),o=i===-1?e===1?0:r-1:i+e;return t[o]}function mn(n){return ot(G(n).body,1)||n}function bn(n){return ot(G(n).body,-1)||n}function at(n,e){if(!n)return null;const t=Ae(G(n).body,ke()),r=t.length;if(r===0)return null;const s=t.indexOf(n);if(s===-1)return null;const i=(s+e+r)%r;return t[i]}function Rr(n){return at(n,1)}function Cr(n){return at(n,-1)}function Ie(n,e){const t=e||n.currentTarget,r=n.relatedTarget;return!r||!Q(t,r)}function vn(n){Ae(n,ke()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function ze(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const r=t.dataset.tabindex;delete t.dataset.tabindex,r?t.setAttribute("tabindex",r):t.removeAttribute("tabindex")})}function ct(){const n=new Map;return{emit(e,t){n.get(e)?.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){n.get(e)?.delete(t)}}}class En{nodesRef={current:[]};events=ct();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const t=this.nodesRef.current.findIndex(r=>r===e);t!==-1&&this.nodesRef.current.splice(t,1)}}const ut=f.createContext(null),lt=f.createContext(null),Fe=()=>f.useContext(ut)?.id||null,ft=n=>{const e=f.useContext(lt);return n??e};function xr(n){const e=Ne(),t=ft(n),r=Fe();return P(()=>{if(!e)return;const s={id:e,parentId:r};return t?.addNode(s),()=>{t?.removeNode(s)}},[t,e,r]),e}function Ir(n){const{children:e,id:t}=n,r=Fe();return D.jsx(ut.Provider,{value:f.useMemo(()=>({id:t,parentId:r}),[t,r]),children:e})}function Or(n){const{children:e,externalTree:t}=n,r=ne(()=>t??new En).current;return D.jsx(lt.Provider,{value:r,children:e})}function dt(n){return`data-base-ui-${n}`}const Ye=f.forwardRef(function(e,t){const[r,s]=f.useState();P(()=>{Ut&&s("button")},[]);const i={tabIndex:0,role:r};return D.jsx("span",{...e,ref:t,style:Xt,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})}),pt=f.createContext(null),yn=()=>f.useContext(pt),Sn=dt("portal");function Tn(n={}){const{ref:e,container:t,componentProps:r=ue,elementProps:s,elementState:i}=n,o=Ne(),l=yn()?.portalNode,[a,p]=f.useState(null),[d,h]=f.useState(null),S=y(x=>{x!==null&&h(x)}),v=f.useRef(null);P(()=>{if(t===null){v.current&&(v.current=null,h(null),p(null));return}if(o==null)return;const x=(t&&(Nt(t)?t:t.current))??l??document.body;if(x==null){v.current&&(v.current=null,h(null),p(null));return}v.current!==x&&(v.current=x,h(null),p(x))},[t,l,o]);const E=jt("div",r,{ref:[e,S],state:i,props:[{id:o,[Sn]:""},s]});return{portalNode:d,portalSubtree:a&&E?Me.createPortal(E,a):null}}const wr=f.forwardRef(function(e,t){const{children:r,container:s,className:i,render:o,renderGuards:c,...l}=e,{portalNode:a,portalSubtree:p}=Tn({container:s,ref:t,componentProps:e,elementProps:l}),d=f.useRef(null),h=f.useRef(null),S=f.useRef(null),v=f.useRef(null),[E,K]=f.useState(null),x=E?.modal,N=E?.open,V=typeof c=="boolean"?c:!!E&&!E.modal&&E.open&&!!a;f.useEffect(()=>{if(!a||x)return;function R(M){a&&M.relatedTarget&&Ie(M)&&(M.type==="focusin"?ze:vn)(a)}return a.addEventListener("focusin",R,!0),a.addEventListener("focusout",R,!0),()=>{a.removeEventListener("focusin",R,!0),a.removeEventListener("focusout",R,!0)}},[a,x]),f.useEffect(()=>{!a||N||ze(a)},[N,a]);const F=f.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:h,beforeInsideRef:S,afterInsideRef:v,portalNode:a,setFocusManagerState:K}),[a]);return D.jsxs(f.Fragment,{children:[p,D.jsxs(pt.Provider,{value:F,children:[V&&a&&D.jsx(Ye,{"data-type":"outside",ref:d,onFocus:R=>{if(Ie(R,a))S.current?.focus();else{const M=E?E.domReference:null;bn(M)?.focus()}}}),V&&a&&D.jsx("span",{"aria-owns":a.id,style:Zt}),a&&Me.createPortal(r,a),V&&a&&D.jsx(Ye,{"data-type":"outside",ref:h,onFocus:R=>{if(Ie(R,a))v.current?.focus();else{const M=E?E.domReference:null;mn(M)?.focus(),E?.closeOnFocusOut&&E?.onOpenChange(!1,Y(Pt,R.nativeEvent))}}})]})]})});function Rn(n){return n==null?n:"current"in n?n.current:n}const Cn={intentional:"onClick",sloppy:"onPointerDown"};function xn(n){return{escapeKey:typeof n=="boolean"?n:n?.escapeKey??!1,outsidePress:typeof n=="boolean"?n:n?.outsidePress??!0}}function Pr(n,e={}){const t="rootStore"in n?n.rootStore:n,r=t.useState("open"),s=t.useState("floatingElement"),i=t.useState("referenceElement"),o=t.useState("domReferenceElement"),{onOpenChange:c,dataRef:l}=t.context,{enabled:a=!0,escapeKey:p=!0,outsidePress:d=!0,outsidePressEvent:h="sloppy",referencePress:S=!1,referencePressEvent:v="sloppy",ancestorScroll:E=!1,bubbles:K,externalTree:x}=e,N=ft(x),V=y(typeof d=="function"?d:()=>!1),F=typeof d=="function"?V:d,R=f.useRef(!1),{escapeKey:M,outsidePress:X}=xn(K),I=f.useRef(null),re=He(),De=He(),W=y(()=>{De.clear(),l.current.insideReactTree=!1}),be=f.useRef(!1),Ve=f.useRef(""),ve=y(u=>{Ve.current=u.pointerType}),H=y(()=>{const u=Ve.current,m=u==="pen"||!u?"mouse":u,g=typeof h=="function"?h():h;return typeof g=="string"?g:g[m]}),j=y(u=>{if(!r||!a||!p||u.key!=="Escape"||be.current)return;const m=l.current.floatingContext?.nodeId,g=N?le(N.nodesRef.current,m):[];if(!M&&g.length>0){let O=!0;if(g.forEach(C=>{C.context?.open&&!C.context.dataRef.current.__escapeKeyBubbles&&(O=!1)}),!O)return}const A=zt(u)?u.nativeEvent:u,b=Y(Mt,A);t.setOpen(!1,b),!M&&!b.isPropagationAllowed&&u.stopPropagation()}),bt=y(u=>{const m=H();return m==="intentional"&&u.type!=="click"||m==="sloppy"&&u.type==="click"}),_=y(()=>{l.current.insideReactTree=!0,De.start(0,W)}),Z=y((u,m=!1)=>{if(bt(u)){W();return}if(l.current.insideReactTree){W();return}if(H()==="intentional"&&m||typeof F=="function"&&!F(u))return;const g=z(u),A=`[${dt("inert")}]`,b=G(t.select("floatingElement")).querySelectorAll(A),O=t.context.triggerElements;if(g&&(O.hasElement(g)||O.hasMatchingElement(w=>Q(w,g))))return;let C=B(g)?g:null;for(;C&&!Ce(C);){const w=At(C);if(Ce(w)||!B(w))break;C=w}if(b.length&&B(g)&&!Yt(g)&&!Q(g,t.select("floatingElement"))&&Array.from(b).every(w=>!Q(C,w)))return;if(kt(g)&&!("touches"in u)){const w=Ce(g),U=Ft(g),Ke=/auto|scroll/,Tt=w||Ke.test(U.overflowX),Rt=w||Ke.test(U.overflowY),Ct=Tt&&g.clientWidth>0&&g.scrollWidth>g.clientWidth,xt=Rt&&g.clientHeight>0&&g.scrollHeight>g.clientHeight,It=U.direction==="rtl",Ot=xt&&(It?u.offsetX<=g.offsetWidth-g.clientWidth:u.offsetX>g.clientWidth),wt=Ct&&u.offsetY>g.clientHeight;if(Ot||wt)return}const qe=l.current.floatingContext?.nodeId,St=N&&le(N.nodesRef.current,qe).some(w=>k(u,w.context?.elements.floating));if(k(u,t.select("floatingElement"))||k(u,t.select("domReferenceElement"))||St)return;const Be=N?le(N.nodesRef.current,qe):[];if(Be.length>0){let w=!0;if(Be.forEach(U=>{U.context?.open&&!U.context.dataRef.current.__outsidePressBubbles&&(w=!1)}),!w)return}t.setOpen(!1,Y(Lt,u)),W()}),je=y(u=>{H()!=="sloppy"||u.pointerType==="touch"||!t.select("open")||!a||k(u,t.select("floatingElement"))||k(u,t.select("domReferenceElement"))||Z(u)}),vt=y(u=>{if(H()!=="sloppy"||!t.select("open")||!a||k(u,t.select("floatingElement"))||k(u,t.select("domReferenceElement")))return;const m=u.touches[0];m&&(I.current={startTime:Date.now(),startX:m.clientX,startY:m.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},re.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),Ee=y(u=>{const m=z(u);function g(){vt(u),m?.removeEventListener(u.type,g)}m?.addEventListener(u.type,g)}),q=y(u=>{const m=R.current;if(R.current=!1,re.clear(),u.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const g=z(u);function A(){u.type==="pointerdown"?je(u):Z(u,m),g?.removeEventListener(u.type,A)}g?.addEventListener(u.type,A)}),Et=y(u=>{if(H()!=="sloppy"||!I.current||k(u,t.select("floatingElement"))||k(u,t.select("domReferenceElement")))return;const m=u.touches[0];if(!m)return;const g=Math.abs(m.clientX-I.current.startX),A=Math.abs(m.clientY-I.current.startY),b=Math.sqrt(g*g+A*A);b>5&&(I.current.dismissOnTouchEnd=!0),b>10&&(Z(u),re.clear(),I.current=null)}),ye=y(u=>{const m=z(u);function g(){Et(u),m?.removeEventListener(u.type,g)}m?.addEventListener(u.type,g)}),yt=y(u=>{H()!=="sloppy"||!I.current||k(u,t.select("floatingElement"))||k(u,t.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&Z(u),re.clear(),I.current=null)}),Se=y(u=>{const m=z(u);function g(){yt(u),m?.removeEventListener(u.type,g)}m?.addEventListener(u.type,g)});f.useEffect(()=>{if(!r||!a)return;l.current.__escapeKeyBubbles=M,l.current.__outsidePressBubbles=X;const u=new me;function m(C){t.setOpen(!1,Y(Vt,C))}function g(){u.clear(),be.current=!0}function A(){u.start(Dt()?5:0,()=>{be.current=!1})}const b=G(s);b.addEventListener("pointerdown",ve,!0),p&&(b.addEventListener("keydown",j),b.addEventListener("compositionstart",g),b.addEventListener("compositionend",A)),F&&(b.addEventListener("click",q,!0),b.addEventListener("pointerdown",q,!0),b.addEventListener("touchstart",Ee,!0),b.addEventListener("touchmove",ye,!0),b.addEventListener("touchend",Se,!0),b.addEventListener("mousedown",q,!0));let O=[];return E&&(B(o)&&(O=xe(o)),B(s)&&(O=O.concat(xe(s))),!B(i)&&i&&i.contextElement&&(O=O.concat(xe(i.contextElement)))),O=O.filter(C=>C!==b.defaultView?.visualViewport),O.forEach(C=>{C.addEventListener("scroll",m,{passive:!0})}),()=>{b.removeEventListener("pointerdown",ve,!0),p&&(b.removeEventListener("keydown",j),b.removeEventListener("compositionstart",g),b.removeEventListener("compositionend",A)),F&&(b.removeEventListener("click",q,!0),b.removeEventListener("pointerdown",q,!0),b.removeEventListener("touchstart",Ee,!0),b.removeEventListener("touchmove",ye,!0),b.removeEventListener("touchend",Se,!0),b.removeEventListener("mousedown",q,!0)),O.forEach(C=>{C.removeEventListener("scroll",m)}),u.clear(),R.current=!1}},[l,s,i,o,p,F,r,c,E,a,M,X,j,Z,q,je,Ee,ye,Se,ve,t]),f.useEffect(W,[F,W]);const Te=f.useMemo(()=>({onKeyDown:j,...S&&{[Cn[v]]:u=>{t.setOpen(!1,Y(We,u.nativeEvent))},...v!=="intentional"&&{onClick(u){t.setOpen(!1,Y(We,u.nativeEvent))}}}}),[j,t,S,v]),se=y(u=>{const m=z(u.nativeEvent);!Q(t.select("floatingElement"),m)||u.button!==0||(R.current=!0)}),Re=y(u=>{!r||!a||u.button!==0||(R.current=!0)}),_e=f.useMemo(()=>({onKeyDown:j,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:_,onMouseDownCapture(u){_(),Re(u)},onPointerDownCapture(u){_(),Re(u)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[j,se,_,Re]);return f.useMemo(()=>a?{reference:Te,floating:_e,trigger:Te}:{},[a,Te,_e])}var he=Symbol("NOT_FOUND");function In(n,e=`expected a function, instead received ${typeof n}`){if(typeof n!="function")throw new TypeError(e)}function On(n,e=`expected an object, instead received ${typeof n}`){if(typeof n!="object")throw new TypeError(e)}function wn(n,e="expected all items to be functions, instead received the following types: "){if(!n.every(t=>typeof t=="function")){const t=n.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${t}]`)}}var Ge=n=>Array.isArray(n)?n:[n];function Pn(n){const e=Array.isArray(n[0])?n[0]:n;return wn(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function Nn(n,e){const t=[],{length:r}=n;for(let s=0;s<r;s++)t.push(n[s].apply(null,e));return t}function Mn(n){let e;return{get(t){return e&&n(e.key,t)?e.value:he},put(t,r){e={key:t,value:r}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function An(n,e){let t=[];function r(c){const l=t.findIndex(a=>e(c,a.key));if(l>-1){const a=t[l];return l>0&&(t.splice(l,1),t.unshift(a)),a.value}return he}function s(c,l){r(c)===he&&(t.unshift({key:c,value:l}),t.length>n&&t.pop())}function i(){return t}function o(){t=[]}return{get:r,put:s,getEntries:i,clear:o}}var kn=(n,e)=>n===e;function Fn(n){return function(t,r){if(t===null||r===null||t.length!==r.length)return!1;const{length:s}=t;for(let i=0;i<s;i++)if(!n(t[i],r[i]))return!1;return!0}}function Ln(n,e){const t=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:r=kn,maxSize:s=1,resultEqualityCheck:i}=t,o=Fn(r);let c=0;const l=s<=1?Mn(o):An(s,o);function a(){let p=l.get(arguments);if(p===he){if(p=n.apply(null,arguments),c++,i){const h=l.getEntries().find(S=>i(S.value,p));h&&(p=h.value,c!==0&&c--)}l.put(arguments,p)}return p}return a.clearCache=()=>{l.clear(),a.resetResultsCount()},a.resultsCount=()=>c,a.resetResultsCount=()=>{c=0},a}var Dn=class{constructor(n){this.value=n}deref(){return this.value}},Vn=typeof WeakRef<"u"?WeakRef:Dn,jn=0,$e=1;function ae(){return{s:jn,v:void 0,o:null,p:null}}function gt(n,e={}){let t=ae();const{resultEqualityCheck:r}=e;let s,i=0;function o(){let c=t;const{length:l}=arguments;for(let d=0,h=l;d<h;d++){const S=arguments[d];if(typeof S=="function"||typeof S=="object"&&S!==null){let v=c.o;v===null&&(c.o=v=new WeakMap);const E=v.get(S);E===void 0?(c=ae(),v.set(S,c)):c=E}else{let v=c.p;v===null&&(c.p=v=new Map);const E=v.get(S);E===void 0?(c=ae(),v.set(S,c)):c=E}}const a=c;let p;if(c.s===$e)p=c.v;else if(p=n.apply(null,arguments),i++,r){const d=s?.deref?.()??s;d!=null&&r(d,p)&&(p=d,i!==0&&i--),s=typeof p=="object"&&p!==null||typeof p=="function"?new Vn(p):p}return a.s=$e,a.v=p,p}return o.clearCache=()=>{t=ae(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function ht(n,...e){const t=typeof n=="function"?{memoize:n,memoizeOptions:e}:n,r=(...s)=>{let i=0,o=0,c,l={},a=s.pop();typeof a=="object"&&(l=a,a=s.pop()),In(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const p={...t,...l},{memoize:d,memoizeOptions:h=[],argsMemoize:S=gt,argsMemoizeOptions:v=[]}=p,E=Ge(h),K=Ge(v),x=Pn(s),N=d(function(){return i++,a.apply(null,arguments)},...E),V=S(function(){o++;const R=Nn(x,arguments);return c=N.apply(null,R),c},...K);return Object.assign(V,{resultFunc:a,memoizedResultFunc:N,dependencies:x,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>c,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:d,argsMemoize:S})};return Object.assign(r,{withTypes:()=>r}),r}var _n=ht(gt),qn=Object.assign((n,e=_n)=>{On(n,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof n}`);const t=Object.keys(n),r=t.map(i=>n[i]);return e(r,(...i)=>i.reduce((o,c,l)=>(o[t[l]]=c,o),{}))},{withTypes:()=>qn});ht({memoize:Ln,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const T=(n,e,t,r,s,i,...o)=>{if(o.length>0)throw new Error(_t(1));let c;if(n)c=n;else throw new Error("Missing arguments");return c};var Bn=Kt();const Kn=qt(19),Wn=Kn?Un:zn;function Hn(n,e,t,r,s){return Wn(n,e,t,r,s)}function Un(n,e,t,r,s){const i=f.useCallback(()=>e(n.getSnapshot(),t,r,s),[n,e,t,r,s]);return Bn.useSyncExternalStore(n.subscribe,i,i)}function zn(n,e,t,r,s){return Wt.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getSnapshot,i=>e(i,t,r,s))}class ee{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const t=this.updateTick;for(const r of this.listeners){if(t!==this.updateTick)return;r(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t])){ee.prototype.setState.call(this,{...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||ee.prototype.setState.call(this,{...this.state,[e]:t})}notifyAll(){const e={...this.state};ee.prototype.setState.call(this,e)}}class Yn extends ee{constructor(e,t={},r){super(e),this.context=t,this.selectors=r}controlledValues=new Map;useSyncedValue(e,t){f.useDebugValue(e),P(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){const r=this;P(()=>(r.state[e]!==t&&r.set(e,t),()=>{r.set(e,void 0)}),[r,e,t])}useSyncedValues(e){const t=this,r=Object.values(e);P(()=>{t.update(e)},[t,...r])}useControlledProp(e,t,r){f.useDebugValue(e);const s=this,i=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,i),!i&&!Object.is(this.state[e],r)&&super.setState({...this.state,[e]:r})),P(()=>{i&&!Object.is(s.state[e],t)&&super.setState({...s.state,[e]:t})},[s,e,t,r,i])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){const t={...e};for(const r in t)if(Object.hasOwn(t,r)&&this.controlledValues.get(r)===!0){delete t[r];continue}super.update(t)}setState(e){const t={...e};for(const r in t)if(Object.hasOwn(t,r)&&this.controlledValues.get(r)===!0){delete t[r];continue}super.setState({...this.state,...t})}select=(e,t,r,s)=>{const i=this.selectors[e];return i(this.state,t,r,s)};useState=(e,t,r,s)=>{f.useDebugValue(e);const i=this.selectors[e];return Hn(this,i,t,r,s)};useContextCallback(e,t){f.useDebugValue(e);const r=y(t??Bt);this.context[e]=r}useStateSetter(e){const t=f.useRef(void 0);return t.current===void 0&&(t.current=r=>{this.set(e,r)}),t.current}observe(e,t){let r;typeof e=="function"?r=e:r=this.selectors[e];let s=r(this.state);return t(s,s,this),this.subscribe(i=>{const o=r(i);if(!Object.is(s,o)){const c=s;s=o,t(o,c,this)}})}}const Gn={open:T(n=>n.open),domReferenceElement:T(n=>n.domReferenceElement),referenceElement:T(n=>n.positionReference??n.referenceElement),floatingElement:T(n=>n.floatingElement),floatingId:T(n=>n.floatingId)};class mt extends Yn{constructor(e){const{nested:t,noEmit:r,onOpenChange:s,triggerElements:i,...o}=e;super({...o,positionReference:o.referenceElement,domReferenceElement:o.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:ct(),nested:t,noEmit:r,triggerElements:i},Gn)}setOpen=(e,t)=>{if((!e||!this.state.open||Gt(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){const r={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(e,t)}}function $n(n,e=!1,t=!1){const[r,s]=f.useState(n&&e?"idle":void 0),[i,o]=f.useState(n);return n&&!i&&(o(!0),s("starting")),!n&&i&&r!=="ending"&&!t&&s("ending"),!n&&!i&&r==="ending"&&s(void 0),P(()=>{if(!n&&i&&r!=="ending"&&t){const c=L.request(()=>{s("ending")});return()=>{L.cancel(c)}}},[n,i,r,t]),P(()=>{if(!n||e)return;const c=L.request(()=>{s(void 0)});return()=>{L.cancel(c)}},[e,n]),P(()=>{if(!n||!e)return;n&&i&&r!=="idle"&&s("starting");const c=L.request(()=>{s("idle")});return()=>{L.cancel(c)}},[e,n,i,s,r]),f.useMemo(()=>({mounted:i,setMounted:o,transitionStatus:r}),[i,r])}let te=(function(n){return n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n})({});const Xn={[te.startingStyle]:""},Zn={[te.endingStyle]:""},Nr={transitionStatus(n){return n==="starting"?Xn:n==="ending"?Zn:null}};function Jn(n,e=!1,t=!0){const r=Qt();return y((s,i=null)=>{r.cancel();function o(){Me.flushSync(s)}const c=Rn(n);if(c==null)return;const l=c;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let a=function(){const d=te.startingStyle;if(!l.hasAttribute(d)){r.request(p);return}const h=new MutationObserver(()=>{l.hasAttribute(d)||(h.disconnect(),p())});h.observe(l,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>h.disconnect(),{once:!0})},p=function(){Promise.all(l.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||o()}).catch(()=>{const d=l.getAnimations();if(t){if(i?.aborted)return;o()}else d.length>0&&d.some(h=>h.pending||h.playState!=="finished")&&p()})};if(e){a();return}r.request(p)}})}function Qn(n){const{enabled:e=!0,open:t,ref:r,onComplete:s}=n,i=y(s),o=Jn(r,t,!1);f.useEffect(()=>{if(!e)return;const c=new AbortController;return o(i,c.signal),()=>{c.abort()}},[e,t,i,o])}function er(n,e){const t=f.useRef(null),r=f.useRef(null);return f.useCallback(s=>{if(n!==void 0){if(t.current!==null){const i=t.current,o=r.current,c=e.context.triggerElements.getById(i);o&&c===o&&e.context.triggerElements.delete(i),t.current=null,r.current=null}s!==null&&(t.current=n,r.current=s,e.context.triggerElements.add(n,s))}},[e,n])}function Mr(n,e,t,r){const s=t.useState("isMountedByTrigger",n),i=er(n,t),o=y(c=>{if(i(c),!c||!t.select("open"))return;const l=t.select("activeTriggerId");if(l===n){t.update({activeTriggerElement:c,...r});return}l==null&&t.update({activeTriggerId:n,activeTriggerElement:c,...r})});return P(()=>{s&&t.update({activeTriggerElement:e.current,...r})},[s,t,e,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:s}}function Ar(n){const e=n.useState("open");P(()=>{if(e&&!n.select("activeTriggerId")&&n.context.triggerElements.size===1){const t=n.context.triggerElements.entries().next();if(!t.done){const[r,s]=t.value;n.update({activeTriggerId:r,activeTriggerElement:s})}}},[e,n])}function kr(n,e,t){const{mounted:r,setMounted:s,transitionStatus:i}=$n(n);e.useSyncedValues({mounted:r,transitionStatus:i});const o=y(()=>{s(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t?.(),e.context.onOpenChangeComplete?.(!1)}),c=e.useState("preventUnmountingOnClose");return Qn({enabled:!c,open:n,ref:e.context.popupRef,onComplete(){n||o()}}),{forceUnmount:o,transitionStatus:i}}class tr{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){const r=this.idMap.get(e);r!==t&&(r!==void 0&&this.elements.delete(r),this.elements.add(t),this.idMap.set(e,t))}delete(e){const t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(const t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function nr(){return new mt({open:!1,floatingElement:null,referenceElement:null,triggerElements:new tr,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Fr(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:nr(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:ue,inactiveTriggerProps:ue,popupProps:ue}}const Lr={open:T(n=>n.open),mounted:T(n=>n.mounted),transitionStatus:T(n=>n.transitionStatus),floatingRootContext:T(n=>n.floatingRootContext),preventUnmountingOnClose:T(n=>n.preventUnmountingOnClose),payload:T(n=>n.payload),activeTriggerId:T(n=>n.activeTriggerId),activeTriggerElement:T(n=>n.mounted?n.activeTriggerElement:null),isTriggerActive:T((n,e)=>e!==void 0&&n.activeTriggerId===e),isOpenedByTrigger:T((n,e)=>e!==void 0&&n.activeTriggerId===e&&n.open),isMountedByTrigger:T((n,e)=>e!==void 0&&n.activeTriggerId===e&&n.mounted),triggerProps:T((n,e)=>e?n.activeTriggerProps:n.inactiveTriggerProps),popupProps:T(n=>n.popupProps),popupElement:T(n=>n.popupElement),positionerElement:T(n=>n.positionerElement)};function Dr(n){const{popupStore:e,noEmit:t=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:s}=n,i=Ne(),o=Fe()!=null,c=e.useState("open"),l=e.useState("activeTriggerElement"),a=e.useState(r?"popupElement":"positionerElement"),p=e.context.triggerElements,d=ne(()=>new mt({open:c,referenceElement:l,floatingElement:a,triggerElements:p,onOpenChange:s,floatingId:i,nested:o,noEmit:t})).current;return P(()=>{const h={open:c,floatingId:i,referenceElement:l,floatingElement:a};B(l)&&(h.domReferenceElement=l),d.state.positionReference===d.state.referenceElement&&(h.positionReference=l),d.update(h)},[c,i,l,a,d]),d.context.onOpenChange=s,d.context.nested=o,d.context.noEmit=t,d}function Vr(n=[]){const e=n.map(a=>a?.reference),t=n.map(a=>a?.floating),r=n.map(a=>a?.item),s=n.map(a=>a?.trigger),i=f.useCallback(a=>ce(a,n,"reference"),e),o=f.useCallback(a=>ce(a,n,"floating"),t),c=f.useCallback(a=>ce(a,n,"item"),r),l=f.useCallback(a=>ce(a,n,"trigger"),s);return f.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:c,getTriggerProps:l}),[i,o,c,l])}function ce(n,e,t){const r=new Map,s=t==="item",i={};t==="floating"&&(i.tabIndex=-1,i[$t]="");for(const o in n)s&&n&&(o===Je||o===Qe)||(i[o]=n[o]);for(let o=0;o<e.length;o+=1){let c;const l=e[o]?.[t];typeof l=="function"?c=n?l(n):null:c=l,c&&Xe(i,c,s,r)}return Xe(i,n,s,r),i}function Xe(n,e,t,r){for(const s in e){const i=e[s];t&&(s===Je||s===Qe)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof i=="function"&&(r.get(s)?.push(i),n[s]=(...o)=>r.get(s)?.map(c=>c(...o)).find(c=>c!==void 0))):n[s]=i)}}let Le=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=te.startingStyle]="startingStyle",n[n.endingStyle=te.endingStyle]="endingStyle",n.anchorHidden="data-anchor-hidden",n})({}),Pe=(function(n){return n.popupOpen="data-popup-open",n.pressed="data-pressed",n})({});const rr={[Pe.popupOpen]:""},sr={[Pe.popupOpen]:"",[Pe.pressed]:""},ir={[Le.open]:""},or={[Le.closed]:""},ar={[Le.anchorHidden]:""},jr={open(n){return n?rr:null}},_r={open(n){return n?sr:null}},qr={open(n){return n?ir:or},anchorHidden(n){return n?ar:null}};export{Jn as $,_r as A,Ye as B,gr as C,br as D,me as E,wr as F,L as G,yn as H,Ae as I,ke as J,dt as K,yr as L,Rn as M,le as N,bn as O,vr as P,Tr as Q,Yn as R,mr as S,pr as T,Sr as U,Le as V,mt as W,hr as X,jr as Y,Tn as Z,$n as _,He as a,te as a0,Er as b,Fe as c,ft as d,Qn as e,Ir as f,tr as g,Lr as h,T as i,En as j,Fr as k,xr as l,Ar as m,kr as n,Dr as o,qr as p,Pr as q,Vr as r,Or as s,Nr as t,Qt as u,Mr as v,Cr as w,Ie as x,Rr as y,mn as z};
@@ -1,9 +0,0 @@
1
- import{r as x,j as X}from"./main-DBmooBKx.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
- [data-motion-pop-id="${r}"] {
3
- position: absolute !important;
4
- width: ${h}px !important;
5
- height: ${f}px !important;
6
- ${v}px !important;
7
- ${P}px !important;
8
- }
9
- `),()=>{w.contains(p)&&w.removeChild(p)}},[e]),X.jsx(Hl,{isPresent:e,childRef:o,sizeRef:a,children:x.cloneElement(t,{ref:u})})}const _l=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=We(Xl),h=x.useId();let f=!0,d=x.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;s&&s()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,s]);return r&&f&&(d={...d}),x.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),x.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),o==="popLayout"&&(t=X.jsx(zl,{isPresent:n,anchorX:a,anchorY:l,root:c,children:t})),X.jsx(qt.Provider,{value:d,children:t})};function Xl(){return new Map}function oo(t=!0){const e=x.useContext(qt);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const jt=t=>t.key||"";function Ss(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const ic=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,h]=oo(o),f=x.useMemo(()=>Ss(t),[t]),d=o&&!u?[]:f.map(jt),m=x.useRef(!0),g=x.useRef(f),y=We(()=>new Map),v=x.useRef(new Set),[P,p]=x.useState(f),[w,S]=x.useState(f);js(()=>{m.current=!1,g.current=f;for(let b=0;b<w.length;b++){const A=jt(w[b]);d.includes(A)?(y.delete(A),v.current.delete(A)):y.get(A)!==!0&&y.set(A,!1)}},[w,d.length,d.join("-")]);const V=[];if(f!==P){let b=[...f];for(let A=0;A<w.length;A++){const L=w[A],H=jt(L);d.includes(H)||(b.splice(A,0,L),V.push(L))}return r==="wait"&&V.length&&(b=V),S(Ss(b)),p(f),null}const{forceRender:E}=x.useContext(Ue);return X.jsx(X.Fragment,{children:w.map(b=>{const A=jt(b),L=o&&!u?!1:f===w||d.includes(A),H=()=>{if(v.current.has(A))return;if(v.current.add(A),y.has(A))y.set(A,!0);else return;let vt=!0;y.forEach(te=>{te||(vt=!1)}),vt&&(E?.(),S(g.current),o&&h?.(),s&&s())};return X.jsx(_l,{isPresent:L,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:L?void 0:H,anchorX:a,anchorY:l,children:b},A)})})},ro=x.createContext({strict:!1}),ws={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let bs=!1;function Yl(){if(bs)return;const t={};for(const e in ws)t[e]={isEnabled:n=>ws[e].some(s=>!!n[s])};Ii(t),bs=!0}function ao(){return Yl(),Ia()}function ql(t){const e=ao();for(const n in t)e[n]={...e[n],...t[n]};Ii(e)}const Zl=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Yt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Zl.has(t)}let lo=t=>!Yt(t);function Jl(t){typeof t=="function"&&(lo=e=>e.startsWith("on")?!Yt(e):t(e))}try{Jl(require("@emotion/is-prop-valid").default)}catch{}function Ql(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(lo(i)||n===!0&&Yt(i)||!e&&!Yt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const Qt=x.createContext({});function tu(t,e){if(Jt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Dt(n)?n:void 0,animate:Dt(s)?s:void 0}}return t.inherit!==!1?e:{}}function eu(t){const{initial:e,animate:n}=tu(t,x.useContext(Qt));return x.useMemo(()=>({initial:e,animate:n}),[As(e),As(n)])}function As(t){return Array.isArray(t)?t.join(" "):t}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uo(t,e,n){for(const s in e)!B(e[s])&&!Ki(s,n)&&(t[s]=e[s])}function nu({transformTemplate:t},e){return x.useMemo(()=>{const n=yn();return mn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function su(t,e){const n=t.style||{},s={};return uo(s,n,t),Object.assign(s,nu(t,e)),s}function iu(t,e){const n={},s=su(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const co=()=>({...yn(),attrs:{}});function ou(t,e,n,s){const i=x.useMemo(()=>{const r=co();return $i(r,e,Hi(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};uo(r,t.style,t),i.style={...r,...i.style}}return i}const ru=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vn(t){return typeof t!="string"||t.includes("-")?!1:!!(ru.indexOf(t)>-1||/[A-Z]/u.test(t))}function au(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??vn(t)?ou:iu)(e,s,i,t),c=Ql(e,typeof t=="string",r),u=t!==x.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=x.useMemo(()=>B(h)?h.get():h,[h]);return x.createElement(t,{...u,children:f})}function lu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:uu(n,s,i,t),renderState:e()}}function uu(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=Wt(r[f]);let{initial:o,animate:a}=t;const l=Jt(t),c=Fi(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!Zt(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const m=an(t,f[d]);if(m){const{transitionEnd:g,transition:y,...v}=m;for(const P in v){let p=v[P];if(Array.isArray(p)){const w=u?p.length-1:0;p=p[w]}p!==null&&(i[P]=p)}for(const P in g)i[P]=g[P]}}}return i}const ho=t=>(e,n)=>{const s=x.useContext(Qt),i=x.useContext(qt),r=()=>lu(t,e,s,i);return n?r():We(r)},cu=ho({scrapeMotionValuesFromProps:pn,createRenderState:yn}),hu=ho({scrapeMotionValuesFromProps:zi,createRenderState:co}),fu=Symbol.for("motionComponentSymbol");function du(t,e,n){const s=x.useRef(n);x.useInsertionEffect(()=>{s.current=n});const i=x.useRef(null);return x.useCallback(r=>{r&&t.onMount?.(r),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const fo=x.createContext({});function Pt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function mu(t,e,n,s,i,r){const{visualElement:o}=x.useContext(Qt),a=x.useContext(ro),l=x.useContext(qt),c=x.useContext(gn).reducedMotion,u=x.useRef(null),h=x.useRef(!1);s=s||a.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,isSVG:r}),h.current&&u.current&&(u.current.manuallyAnimateOnMount=!0));const f=u.current,d=x.useContext(fo);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&pu(u.current,n,i,d);const m=x.useRef(!1);x.useInsertionEffect(()=>{f&&m.current&&f.update(n,l)});const g=n[Ti],y=x.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return js(()=>{h.current=!0,f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),y.current&&f.animationState&&f.animationState.animateChanges())}),x.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),y.current=!1),f.enteringChildren=void 0)}),f}function pu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:mo(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Pt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:l,layoutRoot:c})}function mo(t){if(t)return t.options.allowProjection!==!1?t.projection:mo(t.parent)}function fe(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&ql(s);const r=n?n==="svg":vn(t),o=r?hu:cu;function a(c,u){let h;const f={...x.useContext(gn),...c,layoutId:gu(c)},{isStatic:d}=f,m=eu(c),g=o(c,d);if(!d&&Bs){yu();const y=vu(f);h=y.MeasureLayout,m.visualElement=mu(t,g,f,i,y.ProjectionNode,r)}return X.jsxs(Qt.Provider,{value:m,children:[h&&m.visualElement?X.jsx(h,{visualElement:m.visualElement,...f}):null,au(t,c,du(g,m.visualElement,u),g,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=x.forwardRef(a);return l[fu]=t,l}function gu({layoutId:t}){const e=x.useContext(Ue).id;return e&&t!==void 0?e+"-"+t:t}function yu(t,e){x.useContext(ro).strict}function vu(t){const e=ao(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function xu(t,e){if(typeof Proxy>"u")return fe;const n=new Map,s=(r,o)=>fe(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,fe(o,void 0,t,e)),n.get(o))})}const Tu=(t,e)=>e.isSVG??vn(t)?new Ja(e):new za(e,{allowProjection:t!==x.Fragment});class Pu extends et{constructor(e){super(e),e.animationState||(e.animationState=sl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Zt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Su=0;class wu extends et{constructor(){super(...arguments),this.id=Su++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const bu={animation:{Feature:Pu},exit:{Feature:wu}};function Ft(t){return{point:{x:t.pageX,y:t.pageY}}}const Au=t=>e=>hn(e)&&t(e,Ft(e));function At(t,e,n,s){return Et(t,e,Au(n),s)}const po=({current:t})=>t?t.ownerDocument.defaultView:null,Vs=(t,e)=>Math.abs(t-e);function Vu(t,e){const n=Vs(t.x,e.x),s=Vs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Cs=new Set(["auto","scroll"]);class go{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=me(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Vu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:y}=d,{timestamp:v}=I;this.history.push({...y,timestamp:v});const{onStart:P,onMove:p}=this.handlers;m||(P&&P(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),p&&p(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=de(m,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=me(d.type==="pointercancel"?this.lastMoveEventInfo:de(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,P),y&&y(d,P)},!hn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=Ft(e),c=de(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=I;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,me(c,this.history)),this.removeListeners=Rt(At(this.contextWindow,"pointermove",this.handlePointerMove),At(this.contextWindow,"pointerup",this.handlePointerUp),At(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Cs.has(s.overflowX)||Cs.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),C.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Q(this.updatePoint)}}function de(t,e){return e?{point:e(t.point)}:t}function Ms(t,e){return{x:t.x-e.x,y:t.y-e.y}}function me({point:t},e){return{point:t,delta:Ms(t,yo(e)),offset:Ms(t,Cu(e)),velocity:Mu(e,.1)}}function Cu(t){return t[0]}function yo(t){return t[t.length-1]}function Mu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=yo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Y(e)));)n--;if(!s)return{x:0,y:0};const r=W(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Du(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?M(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function Ds(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Eu(t,{top:e,left:n,bottom:s,right:i}){return{x:Ds(t.x,n,i),y:Ds(t.y,e,s)}}function Es(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Ru(t,e){return{x:Es(t.x,e.x),y:Es(t.y,e.y)}}function Lu(t,e){let n=.5;const s=O(t),i=O(e);return i>s?n=Vt(e.min,e.max-s,t.min):s>i&&(n=Vt(t.min,t.max-i,e.min)),_(0,1,n)}function ku(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Oe=.35;function Fu(t=Oe){return t===!1?t=0:t===!0&&(t=Oe),{x:Rs(t,"left","right"),y:Rs(t,"top","bottom")}}function Rs(t,e,n){return{min:Ls(t,e),max:Ls(t,n)}}function Ls(t,e){return typeof t=="number"?t:t[e]||0}const Iu=new WeakMap;class Bu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=k(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n?(this.stopAnimation(),this.snapToCursor(Ft(h).point)):this.pauseAnimation()},o=(h,f)=>{this.stopAnimation();const{drag:d,dragPropagation:m,onDragStart:g}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wa(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),U(v=>{let P=this.getAxisMotionValue(v).get()||0;if(z.test(P)){const{projection:p}=this.visualElement;if(p&&p.layout){const w=p.layout.layoutBox[v];w&&(P=O(w)*(parseFloat(P)/100))}}this.originPoint[v]=P}),g&&C.postRender(()=>g(h,f)),Ee(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=ju(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&y(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>U(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new go(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:po(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&C.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ot(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=Du(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Pt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Eu(s.layoutBox,e):this.constraints=!1,this.elastic=Fu(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&U(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=ku(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Pt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=Ua(s,i.root,this.visualElement.getTransformPagePoint());let o=Ru(i.layout.layoutBox,r);if(n){const a=n(ja(o));this.hasMutatedConstraints=!!a,a&&(o=ji(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=U(u=>{if(!Ot(u,n,this.currentDirection))return;let h=l&&l[u]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ee(this.visualElement,e),s.start(rn(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!Ot(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-M(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Pt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Lu({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(o=>{if(!Ot(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(M(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;Iu.set(this.visualElement,this);const e=this.visualElement.current,n=At(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps(),h=l.target,f=h!==e&&Ri(h);c&&u&&!f&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Pt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),C.read(s);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(U(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Oe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ot(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function ju(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ou extends et{constructor(e){super(e),this.removeGroupControls=K,this.removeListeners=K,this.controls=new Bu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||K}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ks=t=>(e,n)=>{t&&C.postRender(()=>t(e,n))};class Nu extends et{constructor(){super(...arguments),this.removePointerDownListener=K}onPointerDown(e){this.session=new go(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:po(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:ks(e),onStart:ks(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&C.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=At(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let pe=!1;class Uu extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),pe&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Kt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),pe=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||C.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),cn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;pe=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vo(t){const[e,n]=oo(),s=x.useContext(Ue);return X.jsx(Uu,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(fo),isPresent:e,safeToRemove:n})}const Wu={pan:{Feature:Nu},drag:{Feature:Ou,ProjectionNode:io,MeasureLayout:vo}};function Fs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&C.postRender(()=>r(e,Ft(e)))}class Ku extends et{mount(){const{current:e}=this.node;e&&(this.unmount=ba(e,(n,s)=>(Fs(this.node,s,"Start"),i=>Fs(this.node,i,"End"))))}unmount(){}}class $u extends et{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Rt(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Is(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&C.postRender(()=>r(e,Ft(e)))}class Gu extends et{mount(){const{current:e}=this.node;e&&(this.unmount=Ca(e,(n,s)=>(Is(this.node,s,"Start"),(i,{success:r})=>Is(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ne=new WeakMap,ge=new WeakMap,Hu=t=>{const e=Ne.get(t.target);e&&e(t)},zu=t=>{t.forEach(Hu)};function _u({root:t,...e}){const n=t||document;ge.has(n)||ge.set(n,{});const s=ge.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(zu,{root:t,...e})),s[i]}function Xu(t,e,n){const s=_u(e);return Ne.set(t,n),s.observe(t),()=>{Ne.delete(t),s.unobserve(t)}}const Yu={some:0,all:1};class qu extends et{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Yu[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=c?u:h;f&&f(l)};return Xu(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Zu(e,n))&&this.startObserver()}unmount(){}}function Zu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Ju={inView:{Feature:qu},tap:{Feature:Gu},focus:{Feature:$u},hover:{Feature:Ku}},Qu={layout:{ProjectionNode:io,MeasureLayout:vo}},tc={...bu,...Ju,...Wu,...Qu},oc=xu(tc,Tu);export{ic as A,oc as m};
@@ -1 +0,0 @@
1
- import{u as H,r as o,d as O,j as t}from"./main-DBmooBKx.js";import{H as A,A as _,V as $,p as B,c as Q}from"./button-DdG8c-XQ.js";import{D as P,a as U}from"./use-file-explorer-state-C-D2CShe.js";import{c as M}from"./_sessionKey-CNw4O2rY.js";import"./useBaseUiId-Ckx_aJky.js";import"./event-Dwf9IDxK.js";import"./popupStateMapping-CGDLUl5Y.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-Cx-QHT9o.js";import"./react-dSDkXQu6.js";import"./useQuery-CtUiG53w.js";import"./tooltip-CtHpm-sQ.js";import"./DirectionContext-B1cuzwIr.js";import"./useMutation-DckvFKPC.js";import"./useControlled-8D4PSDAL.js";import"./CSPContext-nHSyQniZ.js";import"./menu-ByR1BVmq.js";import"./useCompositeItem-CkvfeGmG.js";import"./opencami-logo-BV1uPYe6.js";import"./proxy-DYrSkM35.js";import"./markdown-Bpat4kTr.js";import"./index-BxsgifDH.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};
@@ -1 +0,0 @@
1
- import{r as d,j as e}from"./main-DBmooBKx.js";import{D as x,a as p,b as h,c as u,d as j}from"./use-file-explorer-state-C-D2CShe.js";import{B as v}from"./button-DdG8c-XQ.js";import"./useBaseUiId-Ckx_aJky.js";import"./event-Dwf9IDxK.js";import"./popupStateMapping-CGDLUl5Y.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-Cx-QHT9o.js";import"./react-dSDkXQu6.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};