@agentstep/agent-sdk 0.5.10 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/middleware.js +8 -8
- package/dist/backends/claude/args.js +6 -6
- package/dist/backends/claude/index.js +12 -12
- package/dist/backends/claude/wrapper-script.js +1 -1
- package/dist/backends/codex/auth.js +6 -6
- package/dist/backends/codex/index.js +14 -14
- package/dist/backends/codex/setup.js +2 -2
- package/dist/backends/codex/wrapper-script.js +1 -1
- package/dist/backends/factory/auth.js +6 -6
- package/dist/backends/factory/index.js +16 -16
- package/dist/backends/factory/setup.js +2 -2
- package/dist/backends/factory/wrapper-script.js +1 -1
- package/dist/backends/gemini/auth.js +6 -6
- package/dist/backends/gemini/index.js +12 -12
- package/dist/backends/gemini/setup.js +2 -2
- package/dist/backends/gemini/wrapper-script.js +1 -1
- package/dist/backends/opencode/auth.js +6 -6
- package/dist/backends/opencode/index.js +14 -14
- package/dist/backends/opencode/setup.js +2 -2
- package/dist/backends/opencode/wrapper-script.js +1 -1
- package/dist/backends/pi/auth.js +6 -6
- package/dist/backends/pi/index.js +14 -14
- package/dist/backends/pi/setup.js +2 -2
- package/dist/backends/pi/wrapper-script.js +1 -1
- package/dist/backends/registry.js +36 -36
- package/dist/{chunk-ZEDULYKX.js → chunk-2IISXUVF.js} +1 -1
- package/dist/{chunk-34Q6WMIT.js → chunk-2Z56TPBL.js} +3 -3
- package/dist/{chunk-WCLMAQR4.js → chunk-3DRK36FB.js} +5 -5
- package/dist/{chunk-2PTWIZX6.js → chunk-3NNU7TQ4.js} +8 -8
- package/dist/{chunk-NFGCFN57.js → chunk-3UK3IF27.js} +6 -6
- package/dist/chunk-4ANV3AH3.js +65 -0
- package/dist/{chunk-RNU253MD.js → chunk-4ENK7S24.js} +21 -2
- package/dist/{chunk-IFZ7EXMG.js → chunk-4EVT4MFD.js} +1 -1
- package/dist/{chunk-7POF237O.js → chunk-4MKJB6U2.js} +1 -1
- package/dist/{chunk-WKPUTJGD.js → chunk-5LDBCBOR.js} +1 -1
- package/dist/{chunk-ZIMK4TPI.js → chunk-6PIL2RJD.js} +2 -2
- package/dist/{chunk-6TRWB7CE.js → chunk-6X3G5SAS.js} +41 -18
- package/dist/{chunk-LVSQULRG.js → chunk-7ASUTNKE.js} +2 -2
- package/dist/{chunk-KJENLSJT.js → chunk-7BT6V4CH.js} +20 -18
- package/dist/{chunk-5COWXLGO.js → chunk-7D55V4XP.js} +1 -1
- package/dist/{chunk-KYDOZBD5.js → chunk-7NZ46LIO.js} +29 -28
- package/dist/{chunk-4QBWHZKQ.js → chunk-7SO7O6RV.js} +2 -2
- package/dist/{chunk-4JPJ3ZIV.js → chunk-7Z6LTBYQ.js} +5 -5
- package/dist/{chunk-NVTDXBGV.js → chunk-APKELBCA.js} +1 -1
- package/dist/{chunk-YSUPRYX2.js → chunk-AQHYCRTO.js} +1 -1
- package/dist/{chunk-GUD3MOP7.js → chunk-B3UOTIOI.js} +9 -9
- package/dist/{chunk-2OFGWHZB.js → chunk-B5JUCPYW.js} +1 -1
- package/dist/{chunk-LJSD6G6K.js → chunk-BQ5MWNWN.js} +3 -3
- package/dist/{chunk-SKRIZPPF.js → chunk-BYJRL4IQ.js} +6 -6
- package/dist/{chunk-56KP3SAI.js → chunk-C3ZPWUDE.js} +2 -2
- package/dist/{chunk-LSXVCZN7.js → chunk-CD2FQVQR.js} +1 -1
- package/dist/{chunk-6BOOQV4Q.js → chunk-CFLMIJ2C.js} +3 -3
- package/dist/{chunk-6BRG2NJL.js → chunk-CGGGCKSK.js} +4 -4
- package/dist/{chunk-QYSDP6V5.js → chunk-CMOU2OFW.js} +1 -1
- package/dist/chunk-D2GADI73.js +253 -0
- package/dist/{chunk-75C3KFST.js → chunk-D3TY7PMJ.js} +5 -5
- package/dist/{chunk-RTZNJDEL.js → chunk-DAIEVD4O.js} +4 -4
- package/dist/{chunk-BGNQXT4T.js → chunk-DDF2CRA3.js} +2 -2
- package/dist/{chunk-DQ5VMD3Z.js → chunk-FCKUWBUL.js} +2 -2
- package/dist/{chunk-YFGBTXID.js → chunk-FV2XE3DX.js} +2 -2
- package/dist/{chunk-73BYGQWA.js → chunk-G7Y5YGLE.js} +1 -1
- package/dist/{chunk-PXOL34HI.js → chunk-HE3IEIKM.js} +3 -3
- package/dist/{chunk-WKMRBRJQ.js → chunk-HH23DOBB.js} +1 -1
- package/dist/{chunk-HCORTMQH.js → chunk-HHS6EHSG.js} +4 -4
- package/dist/{chunk-6T4DKZYW.js → chunk-ISXWS5Y4.js} +8 -8
- package/dist/{chunk-QBJOYOVF.js → chunk-J6T3W6RY.js} +15 -0
- package/dist/{chunk-CXDNTVCM.js → chunk-JK2GXKOQ.js} +5 -5
- package/dist/{chunk-A4BGGHRC.js → chunk-JXU6SA6S.js} +42 -1
- package/dist/{chunk-37Y556D5.js → chunk-KHICXOTH.js} +3 -3
- package/dist/chunk-KJ2GJLPQ.js +39 -0
- package/dist/{chunk-BUQATYS7.js → chunk-KNWM237Q.js} +2 -2
- package/dist/{chunk-RNDLMMKI.js → chunk-LOWHDHDD.js} +3 -3
- package/dist/{chunk-6SVZD3UA.js → chunk-M4OF5D4K.js} +4 -4
- package/dist/{chunk-CZPWZ5A5.js → chunk-M7SYXJBT.js} +1 -1
- package/dist/{chunk-IBO36HUU.js → chunk-MQBNN4KH.js} +1 -1
- package/dist/{chunk-32RP2UX6.js → chunk-MTB7SCZ5.js} +5 -5
- package/dist/{chunk-LEVIKSPQ.js → chunk-MTRTBT7L.js} +1 -1
- package/dist/{chunk-TARFRZ44.js → chunk-N5F5OUUZ.js} +3 -3
- package/dist/{chunk-M2LUXIXU.js → chunk-NMZMRH3E.js} +1 -1
- package/dist/{chunk-KGTWD46T.js → chunk-NWIMPG4M.js} +1 -1
- package/dist/chunk-OGA7KDQZ.js +37 -0
- package/dist/chunk-ONEKY3CM.js +146 -0
- package/dist/{chunk-SUFGP47L.js → chunk-ONS32E65.js} +28 -20
- package/dist/{chunk-XG4UIGDH.js → chunk-PAQ2JFVD.js} +1 -1
- package/dist/{chunk-N5C3WQWD.js → chunk-PDUQCDIO.js} +1 -1
- package/dist/{chunk-DSNNEER4.js → chunk-PJTGQVKB.js} +1 -1
- package/dist/{chunk-SAUR463Z.js → chunk-PLSXDJT4.js} +6 -5
- package/dist/{chunk-NL4EKSFA.js → chunk-PPI76YVT.js} +2 -2
- package/dist/{chunk-N33MOUCH.js → chunk-PRWWTLPR.js} +3 -3
- package/dist/{chunk-T75UYYMI.js → chunk-PVFGDKXO.js} +2 -2
- package/dist/{chunk-PIJJXKMK.js → chunk-PXMTLKUJ.js} +3 -3
- package/dist/chunk-PZ5EGY64.js +37 -0
- package/dist/{chunk-6ERUVF2Y.js → chunk-QB7JAMWG.js} +1 -1
- package/dist/{chunk-IY3KO2BC.js → chunk-QS544PN6.js} +4 -4
- package/dist/{chunk-GBGXSRZX.js → chunk-R5LXEIOJ.js} +9 -9
- package/dist/{chunk-OJUDLJOG.js → chunk-REY2YZ5X.js} +3 -3
- package/dist/{chunk-4IEDAORR.js → chunk-RFK4W5PZ.js} +1 -1
- package/dist/{chunk-NOG7ZJJA.js → chunk-RLLVP37Q.js} +1 -1
- package/dist/{chunk-HV7M7UUY.js → chunk-S5NB47IR.js} +6 -6
- package/dist/{chunk-3XGUMXGR.js → chunk-SXR4HQZY.js} +2 -2
- package/dist/{chunk-YN2F26NN.js → chunk-T3CXZ2BE.js} +2 -2
- package/dist/{chunk-MF3J7WTR.js → chunk-TN34IN7S.js} +16 -13
- package/dist/{chunk-XUODI55L.js → chunk-U3QU5AVC.js} +1 -1
- package/dist/{chunk-PNJRIMKJ.js → chunk-UB5WVCY4.js} +3 -3
- package/dist/{chunk-P7P2NWZD.js → chunk-URNG7ZX2.js} +1 -1
- package/dist/{chunk-3TF3YLM2.js → chunk-UROFA6OZ.js} +2 -2
- package/dist/{chunk-T5P54I7S.js → chunk-UTQRPXTL.js} +9 -8
- package/dist/{chunk-Y3EUEPGQ.js → chunk-UWHV7EJG.js} +2 -2
- package/dist/chunk-UY3VT3HQ.js +39 -0
- package/dist/{chunk-5LXMEHQX.js → chunk-VG2TYPZ4.js} +18 -2
- package/dist/{chunk-EZBJEV6F.js → chunk-VTH56ERA.js} +4 -4
- package/dist/{chunk-Z4DZMNDE.js → chunk-W6QYWXOZ.js} +2 -2
- package/dist/{chunk-3WZGFAV4.js → chunk-WKGJQIRC.js} +4 -3
- package/dist/{chunk-EGN4TPN5.js → chunk-WT3SEE34.js} +3 -3
- package/dist/{chunk-CZ4IOIWV.js → chunk-X23OAFFE.js} +4 -4
- package/dist/{chunk-E4FQRMHV.js → chunk-XJYR5HE3.js} +18 -0
- package/dist/{chunk-X3IXLDWQ.js → chunk-XSRIFWHR.js} +2 -2
- package/dist/{chunk-SS5IC3XV.js → chunk-Y6BFKPNB.js} +1 -1
- package/dist/{chunk-EFSLGRY2.js → chunk-YCL5RHEC.js} +2 -2
- package/dist/{chunk-LGVD2IGL.js → chunk-YD67W6DW.js} +9 -9
- package/dist/{chunk-J3XIGC3L.js → chunk-YE47YUGE.js} +6 -6
- package/dist/{chunk-F6DCNXO5.js → chunk-YEJFXJHR.js} +2 -2
- package/dist/{chunk-ZV6Y5VOD.js → chunk-YUVQQCT4.js} +15 -15
- package/dist/{chunk-T64ECODW.js → chunk-YUZFNAG6.js} +21 -0
- package/dist/{chunk-OWG6UV4S.js → chunk-YWAMRRAX.js} +10 -10
- package/dist/config/index.js +5 -5
- package/dist/containers/client.js +6 -6
- package/dist/containers/exec.js +6 -6
- package/dist/containers/lifecycle.js +48 -48
- package/dist/containers/setup.js +10 -9
- package/dist/db/agents.js +6 -6
- package/dist/db/api_keys.js +5 -5
- package/dist/db/audit.js +3 -3
- package/dist/db/batch.js +10 -10
- package/dist/db/client.js +2 -2
- package/dist/db/credentials.js +3 -3
- package/dist/db/drizzle.js +4 -4
- package/dist/db/environments.js +6 -6
- package/dist/db/events.js +5 -5
- package/dist/db/files.js +5 -5
- package/dist/db/memory.js +5 -5
- package/dist/db/migrations.js +1 -1
- package/dist/db/proxy.js +5 -5
- package/dist/db/schema.js +5 -3
- package/dist/db/session-resources.js +5 -5
- package/dist/db/sessions.js +8 -8
- package/dist/db/skills.js +5 -5
- package/dist/db/sync.js +5 -5
- package/dist/db/tenants.js +3 -3
- package/dist/db/threads.js +7 -7
- package/dist/db/traces.js +5 -5
- package/dist/db/upstream_keys.js +3 -3
- package/dist/db/vaults.js +6 -6
- package/dist/db/work.js +33 -0
- package/dist/dreaming/review.js +11 -11
- package/dist/handlers/agents.js +64 -64
- package/dist/handlers/api_keys.js +65 -65
- package/dist/handlers/audit.js +65 -65
- package/dist/handlers/batch.js +65 -65
- package/dist/handlers/credentials.js +65 -65
- package/dist/handlers/environments.js +65 -65
- package/dist/handlers/events.js +68 -68
- package/dist/handlers/files.js +65 -65
- package/dist/handlers/index.js +141 -120
- package/dist/handlers/license.js +64 -64
- package/dist/handlers/memory.js +66 -66
- package/dist/handlers/metrics.js +64 -64
- package/dist/handlers/models.js +65 -65
- package/dist/handlers/providers.js +64 -64
- package/dist/handlers/resources.js +64 -64
- package/dist/handlers/sessions.js +68 -68
- package/dist/handlers/settings.js +64 -64
- package/dist/handlers/skills-write.js +67 -65
- package/dist/handlers/skills.js +65 -65
- package/dist/handlers/stream.js +64 -64
- package/dist/handlers/tenants.js +65 -65
- package/dist/handlers/threads.js +65 -65
- package/dist/handlers/traces.js +65 -65
- package/dist/handlers/ui.d.ts +6 -0
- package/dist/handlers/ui.d.ts.map +1 -0
- package/dist/handlers/ui.js +1 -1
- package/dist/handlers/upstream_keys.js +67 -67
- package/dist/handlers/vaults.js +64 -64
- package/dist/handlers/whoami.js +64 -64
- package/dist/handlers/work.js +114 -0
- package/dist/http.js +63 -63
- package/dist/index.js +84 -73
- package/dist/init.js +60 -60
- package/dist/lib/model-registry.js +6 -6
- package/dist/lib/skills-cache.js +6 -6
- package/dist/observability/otlp.js +12 -12
- package/dist/observability/redactor.js +8 -8
- package/dist/providers/daytona.js +1 -1
- package/dist/providers/fly.js +7 -6
- package/dist/providers/modal.js +5 -5
- package/dist/providers/registry.js +15 -3
- package/dist/providers/resolve-secrets.js +7 -7
- package/dist/providers/sprites.js +7 -7
- package/dist/providers/upstream-keys.js +12 -12
- package/dist/providers/vercel.js +5 -5
- package/dist/proxy/forward.js +6 -6
- package/dist/queue/index.js +6 -6
- package/dist/sessions/bus.js +10 -10
- package/dist/sessions/driver.js +53 -53
- package/dist/sessions/grader.js +5 -5
- package/dist/sessions/secrets.js +8 -8
- package/dist/sessions/sweeper.js +49 -49
- package/dist/sessions/threads.js +54 -54
- package/dist/shutdown.js +50 -50
- package/dist/sync/anthropic.js +10 -10
- package/dist/sync/container-file-sync.js +6 -6
- package/dist/sync/file-sync.js +17 -17
- package/dist/workers/runner.js +85 -0
- package/package.json +1 -1
- package/dist/chunk-3W6KEDQE.js +0 -20
- package/dist/chunk-JDBXIJKG.js +0 -20
- package/dist/chunk-QQDSHL27.js +0 -22
- package/dist/chunk-SWIP7JBQ.js +0 -22
|
@@ -409,7 +409,7 @@ Url: \${Xx(e)}\`),!0}return!1}function Pee(e,t){return t?.length?p6(e).some(n=>j
|
|
|
409
409
|
*
|
|
410
410
|
* This source code is licensed under the ISC license.
|
|
411
411
|
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/const Afe=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Nfe=it("zap",Afe),Rfe=({...e})=>{const{theme:t="system"}=wce();return m.jsx(Wce,{theme:t,className:"toaster group",icons:{success:m.jsx(Sue,{className:"size-4"}),info:m.jsx(HT,{className:"size-4"}),warning:m.jsx(a8,{className:"size-4"}),error:m.jsx(que,{className:"size-4"}),loading:m.jsx(rw,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})};function VT(e){return vt(e.defaultTagName??"div",e,e)}const GL=e=>typeof e=="boolean"?\`\${e}\`:e===0?"0":e,XL=ln,Rg=(e,t)=>n=>{var r;if(t?.variants==null)return XL(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(f=>{const d=n?.[f],h=o?.[f];if(d===null)return null;const g=GL(d)||GL(h);return i[f][g]}),l=n&&Object.entries(n).reduce((f,d)=>{let[h,g]=d;return g===void 0||(f[h]=g),f},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,d)=>{let{class:h,className:g,...v}=d;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...o,...l}[w]):{...o,...l}[w]===S})?[...f,h,g]:f},[]);return XL(e,a,u,n?.class,n?.className)},hC=768;function Pfe(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(\`(max-width: \${hC-1}px)\`),r=()=>{t(window.innerWidth<hC)};return n.addEventListener("change",r),t(window.innerWidth<hC),()=>n.removeEventListener("change",r)},[]),!!e}const s8=x.createContext(void 0);function KT(e=!1){const t=x.useContext(s8);if(t===void 0&&!e)throw new Error(Xt(16));return t}function Mfe(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,a=r&&t!==!1,l=r&&t===!1;return{props:x.useMemo(()=>{const f={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(f.tabIndex=i,!o&&n&&(f.tabIndex=t?i:-1)),(o&&(t||a)||!o&&n)&&(f["aria-disabled"]=n),o&&(!t||l)&&(f.disabled=n),f},[r,n,t,a,l,o,i])}}function Zo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:o}=e,a=x.useRef(null),l=KT(!0),u=o??l!==void 0,{props:f}=Mfe({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:i}),d=x.useCallback(()=>{const v=a.current;pC(v)&&u&&t&&f.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,f.disabled,u]);Pe(d,[d]);const h=x.useCallback((v={})=>{const{onClick:b,onMouseDown:w,onKeyUp:S,onKeyDown:E,onPointerDown:k,...O}=v;return Mo({type:i?"button":void 0,onClick(A){if(t){A.preventDefault();return}b?.(A)},onMouseDown(A){t||w?.(A)},onKeyDown(A){if(t||(cb(A),E?.(A),A.baseUIHandlerPrevented))return;const T=A.target===A.currentTarget,N=A.currentTarget,P=pC(N),F=!i&&Ife(N),D=T&&(i?P:!F),q=A.key==="Enter",L=A.key===" ",U=N.getAttribute("role"),H=U?.startsWith("menuitem")||U==="option"||U==="gridcell";if(T&&u&&L){if(A.defaultPrevented&&H)return;A.preventDefault(),F||i&&P?(N.click(),A.preventBaseUIHandler()):D&&(b?.(A),A.preventBaseUIHandler());return}D&&(!i&&(L||q)&&A.preventDefault(),!i&&q&&b?.(A))},onKeyUp(A){if(!t){if(cb(A),S?.(A),A.target===A.currentTarget&&i&&u&&pC(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!u&&A.key===" "&&b?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}k?.(A)}},i?void 0:{role:"button"},f,O)},[t,f,u,i]),g=Le(v=>{a.current=v,d()});return{getButtonProps:h,buttonRef:g}}function pC(e){return fn(e)&&e.tagName==="BUTTON"}function Ife(e){return!!(e?.tagName==="A"&&e?.href)}const Dfe=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,focusableWhenDisabled:a=!1,nativeButton:l=!0,style:u,...f}=t,{getButtonProps:d,buttonRef:h}=Zo({disabled:o,focusableWhenDisabled:a,native:l});return vt("button",t,{state:{disabled:o},ref:[n,h],props:[f,d]})}),Lfe=Rg("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Fe({className:e,variant:t="default",size:n="default",...r}){return m.jsx(Dfe,{"data-slot":"button",className:Ne(Lfe({variant:t,size:n,className:e})),...r})}let QL=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const zfe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},um={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ffe={disabled:!1,...um},YT={valid(e){return e===null?null:e?{[QL.valid]:""}:{[QL.invalid]:""}}},Bfe=x.createContext({invalid:void 0,name:void 0,validityData:{state:zfe,errors:[],error:"",value:"",initialValue:null},setValidityData:Yr,disabled:void 0,touched:um.touched,setTouched:Yr,dirty:um.dirty,setDirty:Yr,filled:um.filled,setFilled:Yr,focused:um.focused,setFocused:Yr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Ffe,markedDirtyRef:{current:!1},registerFieldControl:Yr,validation:{getValidationProps:(e=Wn)=>e,getInputValidationProps:(e=Wn)=>e,inputRef:{current:null},commit:async()=>{}}});function gh(e=!0){const t=x.useContext(Bfe);if(t.setValidityData===Yr&&!e)throw new Error(Xt(28));return t}const $fe=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Yr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function l8(){return x.useContext($fe)}const Ufe=x.createContext({controlId:void 0,registerControlId:Yr,labelId:void 0,setLabelId:Yr,messageIds:[],setMessageIds:Yr,getDescriptionProps:e=>e});function sw(){return x.useContext(Ufe)}function zu({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=x.useRef(e!==void 0),[o,a]=x.useState(t),l=i?e:o,u=x.useCallback(f=>{i||a(f)},[]);return[l,u]}function WT(e,t){const{enabled:n=!0,getValue:r,id:i,value:o}=t,{registerFieldControl:a}=gh(),l=x.useRef(null);l.current||(l.current=Symbol()),Pe(()=>{const u=l.current;if(!(!u||!n))return a(u,{controlRef:e,getValue:r,id:i,value:o}),()=>{a(u,void 0)}},[e,n,r,i,a,o])}function lw(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=sw(),a=Br(t),l=n?i:void 0,u=pr(()=>Symbol("labelable-control")),f=x.useRef(!1),d=x.useRef(t!=null),h=Le(()=>{!f.current||o===Yr||(f.current=!1,o(u.current,void 0))});return Pe(()=>{if(o===Yr)return;let g;if(n){const v=r?.current;Dt(v)&&v.closest("label")!=null?g=t??null:g=l??a}else if(t!=null)d.current=!0,g=t;else if(d.current)g=a;else{h();return}if(g===void 0){h();return}f.current=!0,o(u.current,g)},[t,r,l,o,n,a,u,h]),x.useEffect(()=>h,[h]),i??a}const Hfe=x.forwardRef(function(t,n){const{render:r,className:i,id:o,name:a,value:l,disabled:u=!1,onValueChange:f,defaultValue:d,autoFocus:h=!1,style:g,...v}=t,{state:b,name:w,disabled:S,setTouched:E,setDirty:k,validityData:O,setFocused:j,setFilled:A,validationMode:T,validation:N}=gh(),P=S||u,F=w??a,D={...b,disabled:P},{labelId:q}=sw(),L=lw({id:o});Pe(()=>{const G=l!=null;N.inputRef.current?.value||G&&l!==""?A(!0):G&&l===""&&A(!1)},[N.inputRef,A,l]);const U=x.useRef(null);Pe(()=>{h&&U.current===Oi(jt(U.current))&&j(!0)},[h,j]);const[H]=zu({controlled:l,default:d,name:"FieldControl",state:"value"}),B=l!==void 0,z=B?H:void 0,V=Le(()=>N.inputRef.current?.value);return WT(N.inputRef,{id:L,value:z,getValue:V}),vt("input",t,{ref:[n,U],state:D,props:[{id:L,disabled:P,name:F,ref:N.inputRef,"aria-labelledby":q,autoFocus:h,...B?{value:z}:{defaultValue:d},onChange(G){const I=G.currentTarget.value;f?.(I,ct(Wo,G.nativeEvent)),k(I!==O.initialValue),A(I!=="")},onFocus(){j(!0)},onBlur(G){E(!0),j(!1),T==="onBlur"&&N.commit(G.currentTarget.value)},onKeyDown(G){G.currentTarget.tagName==="INPUT"&&G.key==="Enter"&&(E(!0),N.commit(G.currentTarget.value))}},N.getInputValidationProps(),v],stateAttributesMapping:YT})}),qfe=x.forwardRef(function(t,n){return m.jsx(Hfe,{ref:n,...t})});function en({className:e,type:t,...n}){return m.jsx(qfe,{type:t,"data-slot":"input",className:Ne("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}const Vfe=x.forwardRef(function(t,n){const{className:r,render:i,orientation:o="horizontal",style:a,...l}=t;return vt("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},l]})});function Kfe({className:e,orientation:t="horizontal",...n}){return m.jsx(Vfe,{"data-slot":"separator",orientation:t,className:Ne("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const GT=x.createContext(void 0);function Us(e){const t=x.useContext(GT);if(e===!1&&t===void 0)throw new Error(Xt(27));return t}const Yfe={...yc,...$s},XT=x.forwardRef(function(t,n){const{render:r,className:i,style:o,forceRender:a=!1,...l}=t,{store:u}=Us(),f=u.useState("open"),d=u.useState("nested"),h=u.useState("mounted"),g=u.useState("transitionStatus");return vt("div",t,{state:{open:f,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:Yfe,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!d})}),cw=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,style:l,...u}=t,{store:f}=Us(),d=f.useState("open");function h(w){d&&f.setOpen(!1,ct(Roe,w.nativeEvent))}const{getButtonProps:g,buttonRef:v}=Zo({disabled:o,native:a});return vt("button",t,{state:{disabled:o},ref:[n,v],props:[{onClick:h},u,g]})}),c8=x.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...l}=t,{store:u}=Us(),f=Br(a);return u.useSyncedValueWithCleanup("descriptionElementId",f),vt("p",t,{ref:n,props:[{id:f},l]})});let Wfe=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Gfe=(function(e){return e[e.open=fu.open]="open",e[e.closed=fu.closed]="closed",e[e.startingStyle=fu.startingStyle]="startingStyle",e[e.endingStyle=fu.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const u8=x.createContext(void 0);function Xfe(){const e=x.useContext(u8);if(e===void 0)throw new Error(Xt(26));return e}const Jl="ArrowUp",vs="ArrowDown",Fu="ArrowLeft",ec="ArrowRight",vh="Home",yh="End",f8=new Set([Fu,ec]),Qfe=new Set([Fu,ec,vh,yh]),d8=new Set([Jl,vs]),Zfe=new Set([Jl,vs,vh,yh]),h8=new Set([...f8,...d8]),Jfe=new Set([...h8,vh,yh]),uw=new Set([Jl,vs,Fu,ec,vh,yh]),ede="Shift",tde="Control",nde="Alt",rde="Meta",ide=new Set([ede,tde,nde,rde]);function ode(e){return fn(e)&&e.tagName==="INPUT"}function ZL(e){return!!(ode(e)&&e.selectionStart!=null||fn(e)&&e.tagName==="TEXTAREA")}function JL(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,o=e.scrollTop;const a=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=ez(e,t,"left"),f=Uy(e),d=Uy(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight?i=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+f.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+f.scrollPaddingLeft&&(i=u-d.scrollMarginLeft-f.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginRight<e.scrollLeft+f.scrollPaddingLeft?i=u-d.scrollMarginLeft-f.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight&&(i=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+f.scrollPaddingRight))}if(l&&r!=="horizontal"){const u=ez(e,t,"top"),f=Uy(e),d=Uy(t);u-d.scrollMarginTop<e.scrollTop+f.scrollPaddingTop?o=u-d.scrollMarginTop-f.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-f.scrollPaddingBottom&&(o=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+f.scrollPaddingBottom)}e.scrollTo({left:i,top:o,behavior:"auto"})}function ez(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Uy(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const ade={...yc,...$s,nestedDialogOpen(e){return e?{[Gfe.nestedDialogOpen]:""}:null}},QT=x.forwardRef(function(t,n){const{className:r,finalFocus:i,initialFocus:o,render:a,style:l,...u}=t,{store:f}=Us(),d=f.useState("descriptionElementId"),h=f.useState("disablePointerDismissal"),g=f.useState("floatingRootContext"),v=f.useState("popupProps"),b=f.useState("modal"),w=f.useState("mounted"),S=f.useState("nested"),E=f.useState("nestedOpenDialogCount"),k=f.useState("open"),O=f.useState("openMethod"),j=f.useState("titleElementId"),A=f.useState("transitionStatus"),T=f.useState("role");Xfe(),Qo({open:k,ref:f.context.popupRef,onComplete(){k&&f.context.onOpenChangeComplete?.(!0)}});function N(L){return L==="touch"?f.context.popupRef.current:!0}const P=o===void 0?N:o,F=E>0,q=vt("div",t,{state:{open:k,nested:S,transitionStatus:A,nestedDialogOpen:F},props:[v,{"aria-labelledby":j??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!w,onKeyDown(L){uw.has(L.key)&&L.stopPropagation()},style:{[Wfe.nestedDialogs]:E}},u],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:ade});return m.jsx(U0,{context:g,openInteractionType:O,disabled:!w,closeOnFocusOut:!h,initialFocus:P,returnFocus:i,modal:b!==!1,restoreFocus:"popup",children:q})}),fw=x.forwardRef(function(t,n){const{cutout:r,...i}=t;let o;if(r){const a=r.getBoundingClientRect();o=\`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,\${a.left}px \${a.top}px,\${a.left}px \${a.bottom}px,\${a.right}px \${a.bottom}px,\${a.right}px \${a.top}px,\${a.left}px \${a.top}px)\`}return m.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),ZT=x.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=Us(),a=o.useState("mounted"),l=o.useState("modal"),u=o.useState("open");return a||r?m.jsx(u8.Provider,{value:r,children:m.jsxs($0,{ref:n,...i,children:[a&&l===!0&&m.jsx(fw,{ref:o.context.internalBackdropRef,inert:Ag(!u)}),t.children]})}):null});let tz={},nz={},rz="";function sde(e){if(typeof document>"u")return!1;const t=jt(e);return In(t).innerWidth-t.documentElement.clientWidth>0}function lde(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=jt(e),r=n.documentElement,i=n.body,o=pc(r)?r:i,a=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const u=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=a,r.style.scrollbarGutter=l,u===f}function cde(e){const t=jt(e),n=t.documentElement,r=t.body,i=pc(n)?n:r,o={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,o)}}function ude(e){const t=jt(e),n=t.documentElement,r=t.body,i=In(n);let o=0,a=0,l=!1;const u=Vn.create();if(R0&&(i.visualViewport?.scale??1)!==1)return()=>{};function f(){const v=i.getComputedStyle(n),b=i.getComputedStyle(r),E=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,a=n.scrollLeft,tz={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},rz=n.style.scrollBehavior,nz={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const k=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,j=v.overflowY==="scroll"||b.overflowY==="scroll",A=v.overflowX==="scroll"||b.overflowX==="scroll",T=Math.max(0,i.innerWidth-r.clientWidth),N=Math.max(0,i.innerHeight-r.clientHeight),P=parseFloat(b.marginTop)+parseFloat(b.marginBottom),F=parseFloat(b.marginLeft)+parseFloat(b.marginRight),D=pc(n)?n:r;if(l=lde(e),l){n.style.scrollbarGutter=E,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(k||j)&&(n.style.overflowY="scroll"),(O||A)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||N?\`calc(100dvh - \${P+N}px)\`:"100dvh",width:F||T?\`calc(100vw - \${F+T}px)\`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,tz),Object.assign(r.style,nz),l||(n.scrollTop=o,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=rz)}function h(){d(),u.request(f)}f();const g=kt(i,"resize",h);return()=>{u.cancel(),d(),typeof i.removeEventListener=="function"&&g()}}class fde{constructor(){qt(this,"lockCount",0);qt(this,"restore",null);qt(this,"timeoutLock",Ro.create());qt(this,"timeoutUnlock",Ro.create());qt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});qt(this,"unlock",()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=jt(t).documentElement,i=In(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Yr;return}const o=vU||!sde(t);this.restore=o?cde(t):ude(t)}}const dde=new fde;function p8(e=!0,t=null){Pe(()=>{if(e)return dde.acquire(t)},[e,t])}function hde(e){const t=x.useRef(""),n=x.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:x.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function JT(e,t){const n=x.useRef(e),r=Le(t);Pe(()=>{n.current!==e&&r(n.current)},[e,r]),Pe(()=>{n.current=e},[e])}function dw(e){const[t,n]=x.useState(null),r=Le((a,l)=>{e||n(l||(vU?"touch":""))});JT(e,a=>{a&&!e&&n(null)});const{onClick:i,onPointerDown:o}=hde(r);return x.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:o}}),[t,i,o])}function m8(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,o=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),u=t.useState("popupElement"),{openMethod:f,triggerProps:d}=dw(o);Y0(t);const{forceUnmount:h}=W0(o,t),g=Le(L=>{const U=ct(L);return U.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},U}),v=x.useCallback(()=>{t.setOpen(!1,g(M0))},[t,g]);x.useImperativeHandle(r,()=>({unmount:h,close:v}),[h,v]);const b=Q0({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[w,S]=x.useState(0),[E,k]=x.useState(0),O=w===0,j=NT(b),A=Og(b,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(L){if(!t.context.outsidePressEnabledRef.current||"button"in L&&L.button!==0||"touches"in L&&L.touches.length!==1)return!1;const U=Sr(L);if(O&&!a){const H=U;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===H||t.context.backdropRef.current===H||lt(H,u)&&!H?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:O});p8(o&&l===!0,u);const{getReferenceProps:T,getFloatingProps:N,getTriggerProps:P}=vc([j,A]);t.useContextCallback("onNestedDialogOpen",(L,U)=>{S(L),k(U)}),t.useContextCallback("onNestedDialogClose",()=>{S(0),k(0)}),x.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w+1,E+(i?1:0)),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[i,o,w,E,n]);const F=x.useMemo(()=>T(d),[T,d]),D=x.useMemo(()=>P(d),[P,d]),q=x.useMemo(()=>N(),[N]);t.useSyncedValues({openMethod:f,activeTriggerProps:F,inactiveTriggerProps:D,popupProps:q,floatingRootContext:b,nestedOpenDialogCount:w,nestedOpenDrawerCount:E})}const pde={...X0,modal:Te(e=>e.modal),nested:Te(e=>e.nested),nestedOpenDialogCount:Te(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Te(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Te(e=>e.disablePointerDismissal),openMethod:Te(e=>e.openMethod),descriptionElementId:Te(e=>e.descriptionElementId),titleElementId:Te(e=>e.titleElementId),viewportElement:Te(e=>e.viewportElement),role:Te(e=>e.role)};class hw extends jg{constructor(n){super(mde(n),{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new mh,onOpenChange:void 0,onOpenChangeComplete:void 0},pde);qt(this,"setOpen",(n,r)=>{if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const i={open:n},o=r.trigger?.id??null;(o||n)&&(i.activeTriggerId=o,i.activeTriggerElement=r.trigger??null),this.update(i)})}static useStore(n,r){const i=pr(()=>new hw(r)).current;return n??i}}function mde(e={}){return{...G0(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}const hO=x.createContext(!1);function g8(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,disablePointerDismissal:a=!1,modal:l=!0,actionsRef:u,handle:f,triggerId:d,defaultTriggerId:h=null}=e,g=Us(!0),v=x.useContext(hO),b=!!g,w=hw.useStore(f?.store,{open:r,openProp:n,activeTriggerId:h,triggerIdProp:d,modal:l,disablePointerDismissal:a,nested:b});bg(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:h})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",d),w.useSyncedValues({disablePointerDismissal:a,nested:b,modal:l}),w.useContextCallback("onOpenChange",i),w.useContextCallback("onOpenChangeComplete",o);const S=w.useState("payload");m8({store:w,actionsRef:u,parentContext:g?.store.context,isDrawer:v});const E=x.useMemo(()=>({store:w}),[w]);return m.jsx(hO.Provider,{value:!1,children:m.jsx(GT.Provider,{value:E,children:typeof t=="function"?t({payload:S}):t})})}const eA=x.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...l}=t,{store:u}=Us(),f=Br(a);return u.useSyncedValueWithCleanup("titleElementId",f),vt("h2",t,{ref:n,props:[{id:f},l]})}),gde=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,id:l,payload:u,handle:f,style:d,...h}=t,g=Us(!0),v=f?.store??g?.store;if(!v)throw new Error(Xt(79));const b=Br(l),w=v.useState("floatingRootContext"),S=v.useState("isOpenedByTrigger",b),E=x.useRef(null),{registerTrigger:k,isMountedByThisTrigger:O}=K0(b,E,v,{payload:u}),{getButtonProps:j,buttonRef:A}=Zo({disabled:o,native:a}),T=H0(w,{enabled:w!=null}),N=vc([T]),P={disabled:o,open:S},F=v.useState("triggerProps",O);return vt("button",t,{state:P,ref:[A,n,k,E],props:[N.getReferenceProps(),F,{[cT]:"",id:b},h,j],stateAttributesMapping:J0})});function vde({...e}){return m.jsx(g8,{"data-slot":"sheet",...e})}function yde({...e}){return m.jsx(ZT,{"data-slot":"sheet-portal",...e})}function xde({className:e,...t}){return m.jsx(XT,{"data-slot":"sheet-overlay",className:Ne("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function bde({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return m.jsxs(yde,{children:[m.jsx(xde,{}),m.jsxs(QT,{"data-slot":"sheet-content","data-side":n,className:Ne("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...i,children:[t,r&&m.jsxs(cw,{"data-slot":"sheet-close",render:m.jsx(Fe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[m.jsx(uc,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wde({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-header",className:Ne("flex flex-col gap-0.5 p-4",e),...t})}function Sde({className:e,...t}){return m.jsx(eA,{"data-slot":"sheet-title",className:Ne("font-heading text-base font-medium text-foreground",e),...t})}function Ede({className:e,...t}){return m.jsx(c8,{"data-slot":"sheet-description",className:Ne("text-sm text-muted-foreground",e),...t})}const Cde="sidebar_state",_de=3600*24*7,kde="16rem",Ode="18rem",jde="3rem",Tde="b",v8=x.createContext(null);function pw(){const e=x.useContext(v8);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Ade({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:o,...a}){const l=Pfe(),[u,f]=x.useState(!1),[d,h]=x.useState(e),g=t??d,v=x.useCallback(E=>{const k=typeof E=="function"?E(g):E;n?n(k):h(k),document.cookie=\`\${Cde}=\${k}; path=/; max-age=\${_de}\`},[n,g]),b=x.useCallback(()=>l?f(E=>!E):v(E=>!E),[l,v,f]);x.useEffect(()=>{const E=k=>{k.key===Tde&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),b())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[b]);const w=g?"expanded":"collapsed",S=x.useMemo(()=>({state:w,open:g,setOpen:v,isMobile:l,openMobile:u,setOpenMobile:f,toggleSidebar:b}),[w,g,v,l,u,f,b]);return m.jsx(v8.Provider,{value:S,children:m.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":kde,"--sidebar-width-icon":jde,...i},className:Ne("group/sidebar-wrapper flex h-svh w-full overflow-hidden has-data-[variant=inset]:bg-sidebar",r),...a,children:o})})}function Nde({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,dir:o,...a}){const{isMobile:l,state:u,openMobile:f,setOpenMobile:d}=pw();return n==="none"?m.jsx("div",{"data-slot":"sidebar",className:Ne("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...a,children:i}):l?m.jsx(vde,{open:f,onOpenChange:d,...a,children:m.jsxs(bde,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ode},side:e,children:[m.jsxs(wde,{className:"sr-only",children:[m.jsx(Sde,{children:"Sidebar"}),m.jsx(Ede,{children:"Displays the mobile sidebar."})]}),m.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):m.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[m.jsx("div",{"data-slot":"sidebar-gap",className:Ne("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),m.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Ne("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:m.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:i})})]})}function Rde({className:e,onClick:t,...n}){const{toggleSidebar:r}=pw();return m.jsxs(Fe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Ne(e),onClick:i=>{t?.(i),r()},...n,children:[m.jsx(Xue,{}),m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Pde({className:e,...t}){const{toggleSidebar:n}=pw();return m.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:Ne("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function Mde({className:e,...t}){return m.jsx("main",{"data-slot":"sidebar-inset",className:Ne("relative flex w-full flex-1 flex-col min-h-0 bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Ide({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Ne("flex flex-col gap-2 p-2",e),...t})}function Dde({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Ne("flex flex-col gap-2 p-2",e),...t})}function Lde({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Ne("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function zde({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Ne("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Fde({className:e,render:t,...n}){return VT({defaultTagName:"div",props:Mo({className:Ne("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e)},n),render:t,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function y8({className:e,...t}){return m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Ne("flex w-full min-w-0 flex-col gap-0",e),...t})}function x8({className:e,...t}){return m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Ne("group/menu-item relative",e),...t})}const Bde=Rg("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function b8({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:o,...a}){const{isMobile:l,state:u}=pw(),f=VT({defaultTagName:"button",props:Mo({className:Ne(Bde({variant:n,size:r}),o)},a),render:i?m.jsx(zT,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return i?(typeof i=="string"&&(i={children:i}),m.jsxs(LT,{children:[f,m.jsx(FT,{side:"right",align:"center",hidden:u!=="collapsed"||l,...i})]})):f}const iz=e=>{let t;const n=new Set,r=(f,d)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const g=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(v=>v(t,g))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,i,l);return l},$de=(e=>e?iz(e):iz),Ude=e=>e;function Hde(e,t=Ude){const n=Ie.useSyncExternalStore(e.subscribe,Ie.useCallback(()=>t(e.getState()),[e,t]),Ie.useCallback(()=>t(e.getInitialState()),[e,t]));return Ie.useDebugValue(n),n}const oz=e=>{const t=$de(e),n=r=>Hde(t,r);return Object.assign(n,t),n},qde=(e=>e?oz(e):oz),gm=(window.__BASE_PATH__||"").replace(/\\/$/,"");function tu(e){return gm?\`\${gm}\${e}\`:e}function Vde(e){return gm&&e.startsWith(gm)?e.slice(gm.length)||"/":e}function w8(){const e=Vde(window.location.pathname);if(e==="/analytics")return{sessionId:null,settingsOpen:!1,selectedAgentId:null,dashboardOpen:!0};const t=e.match(/^\\/agents\\/(.+)$/);if(t)return{sessionId:null,settingsOpen:!0,selectedAgentId:t[1],dashboardOpen:!1};if(e==="/settings")return{sessionId:null,settingsOpen:!0,selectedAgentId:null,dashboardOpen:!1};const n=e.match(/^\\/playground\\/(.+)$/);if(n)return{sessionId:n[1],settingsOpen:!1,selectedAgentId:null,dashboardOpen:!1};const r=e.match(/^\\/sessions\\/(.+)$/);return r?{sessionId:r[1],settingsOpen:!1,selectedAgentId:null,dashboardOpen:!1}:{sessionId:null,settingsOpen:!1,selectedAgentId:null,dashboardOpen:!1}}const Hy=w8(),bn=qde(e=>({apiKey:window.__MA_API_KEY__||localStorage.getItem("ma-api-key")||"",setApiKey:t=>{localStorage.setItem("ma-api-key",t),e({apiKey:t})},activeSessionId:Hy.sessionId,setActiveSessionId:t=>{t?window.history.pushState(null,"",tu(\`/sessions/\${t}\`)):window.history.pushState(null,"",tu("/")),e({activeSessionId:t,settingsOpen:!1})},debugOpen:!1,toggleDebug:()=>e(t=>({debugOpen:!t.debugOpen})),selectedAgentId:Hy.selectedAgentId,setSelectedAgentId:t=>e({selectedAgentId:t}),settingsOpen:Hy.settingsOpen,setSettingsOpen:t=>{if(t)window.history.pushState(null,"",tu("/settings"));else{const n=bn.getState().activeSessionId;window.history.pushState(null,"",tu(n?\`/sessions/\${n}\`:"/"))}e({settingsOpen:t,dashboardOpen:t?!1:bn.getState().dashboardOpen})},sidebarOpen:!0,setSidebarOpen:t=>e({sidebarOpen:t}),commandOpen:!1,setCommandOpen:t=>e({commandOpen:t}),dashboardOpen:Hy.dashboardOpen,setDashboardOpen:t=>{if(t)window.history.pushState(null,"",tu("/analytics"));else{const n=bn.getState().activeSessionId;window.history.pushState(null,"",tu(n?\`/sessions/\${n}\`:"/"))}e({dashboardOpen:t,settingsOpen:t?!1:bn.getState().settingsOpen})},dashboardWindowMinutes:60,setDashboardWindowMinutes:t=>e({dashboardWindowMinutes:t})}));window.addEventListener("popstate",()=>{const{sessionId:e,settingsOpen:t,selectedAgentId:n,dashboardOpen:r}=w8();bn.setState({activeSessionId:e,settingsOpen:t,selectedAgentId:n,dashboardOpen:r})});const Kde="/v1";class Yde extends Error{constructor(t,n){super(\`API error \${t}\`),this.status=t,this.body=n}}async function Xe(e,t={}){const r={"x-api-key":bn.getState().apiKey,...t.headers};t.body&&(r["Content-Type"]="application/json");const i=await fetch(\`\${Kde}\${e}\`,{...t,headers:r});if(!i.ok){const o=await i.json().catch(()=>null);throw new Yde(i.status,o)}if(i.status!==204)return i.json()}function Hs(){return Bn({queryKey:["agents"],queryFn:()=>Xe("/agents?limit=50"),select:e=>e.data})}function tA(e){return Bn({queryKey:["agents",e],queryFn:()=>Xe(\`/agents/\${e}\`),enabled:!!e})}function S8(){const e=hn();return Nn({mutationFn:t=>{const n={...t};return t.engine==="claude"&&(n.tools=[{type:"agent_toolset_20260401"}]),Xe("/agents",{method:"POST",body:JSON.stringify(n)})},onSuccess:()=>e.invalidateQueries({queryKey:["agents"]})})}function Pg(){const e=hn();return Nn({mutationFn:({id:t,...n})=>Xe(\`/agents/\${t}\`,{method:"POST",body:JSON.stringify(n)}),onSuccess:()=>e.invalidateQueries({queryKey:["agents"]})})}function Wde(){const e=hn();return Nn({mutationFn:t=>Xe(\`/agents/\${t}\`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:["agents"]})})}function rf(){return Bn({queryKey:["environments"],queryFn:()=>Xe("/environments?limit=50"),select:e=>e.data})}function E8(){const e=hn();return Nn({mutationFn:({name:t,config:n})=>Xe("/environments",{method:"POST",body:JSON.stringify({name:t,config:{type:"cloud",provider:n?.provider,packages:{}}})}),onSuccess:()=>e.invalidateQueries({queryKey:["environments"]})})}function Gde(){const e=hn();return Nn({mutationFn:t=>Xe(\`/environments/\${t}\`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:["environments"]})})}function mw(){return Bn({queryKey:["sessions"],queryFn:()=>Xe("/sessions?limit=50&order=desc"),select:e=>e.data})}function xh(e){return Bn({queryKey:["sessions",e],queryFn:()=>Xe(\`/sessions/\${e}\`),enabled:!!e})}function C8(){const e=hn();return Nn({mutationFn:({agent_id:t,environment_id:n,vault_ids:r})=>Xe("/sessions",{method:"POST",body:JSON.stringify({agent:t,environment_id:n,vault_ids:r})}),onSuccess:()=>e.invalidateQueries({queryKey:["sessions"]})})}function Xde({className:e,...t}){return m.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:Ne(e),...t})}function Qde({className:e,...t}){return m.jsx("ol",{"data-slot":"breadcrumb-list",className:Ne("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",e),...t})}function Zde({className:e,...t}){return m.jsx("li",{"data-slot":"breadcrumb-item",className:Ne("inline-flex items-center gap-1",e),...t})}function Jde({className:e,...t}){return m.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Ne("font-normal text-foreground",e),...t})}function nA(){return Bn({queryKey:["whoami"],queryFn:async()=>{try{return await Xe("/whoami")}catch(e){if(e?.status===404)return;throw e}},staleTime:6e4})}function rA(){return Bn({queryKey:["license"],queryFn:async()=>{try{return await Xe("/license")}catch{return{plan:"community",features:[],limits:{maxKeys:20,auditRetentionMs:10080*60*1e3}}}},staleTime:6e4})}const ehe="0.4.16",az=[{label:"Home",to:"/",icon:Pue,exact:!0},{label:"API Keys",to:"/api-keys",icon:qT}],the={label:"Tenants",to:"/tenants",icon:t8},nhe=[{label:"Agents",to:"/agents",icon:JH},{label:"Environments",to:"/environments",icon:aw},{label:"Sessions",to:"/sessions",icon:Bue},{label:"Secrets",to:"/secrets",icon:zue},{label:"Files",to:"/files",icon:Tue},{label:"Skills",to:"/skills",icon:vfe},{label:"Memory",to:"/memory",icon:e8}],rhe=[{label:"Playground",to:"/playground",icon:iw},{label:"Analytics",to:"/analytics",icon:hue},{label:"API Docs",to:"/docs",icon:ZH}];function pO({title:e,items:t}){const r=Ju().location.pathname;return m.jsxs(zde,{children:[m.jsx(Fde,{children:e}),m.jsx(y8,{children:t.map(i=>{const o=i.icon,a=i.exact?r===i.to:r===i.to||r.startsWith(i.to+"/");return m.jsx(x8,{children:m.jsxs(b8,{render:m.jsx(ki,{to:i.to}),isActive:a,children:[m.jsx(o,{className:"size-4"}),m.jsx("span",{children:i.label})]})},i.to)})})]})}function ihe(){const{data:e}=nA(),{data:t}=rA(),n=t?.features.includes("tenancy"),r=e?.is_global_admin&&n?[...az,the]:az;return m.jsx(pO,{title:"Overview",items:r})}function ohe(){const{data:e}=nA();if(!e)return null;const t=e.is_global_admin?"global":e.tenant_id??"unscoped";return m.jsxs("div",{className:"flex items-center gap-2 px-2 pt-1 pb-0.5 text-[11px] text-sidebar-foreground/60",children:[m.jsx(t8,{className:"size-3"}),m.jsx("span",{className:"truncate font-mono",children:t})]})}function ahe(){const[e,t]=x.useState(()=>document.documentElement.classList.contains("dark"));return x.useEffect(()=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),m.jsx("button",{onClick:()=>{const n=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",n?"dark":"light"),t(n)},className:"rounded-md p-1.5 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","aria-label":"Toggle theme",children:e?m.jsx(wfe,{className:"size-3.5"}):m.jsx(Uue,{className:"size-3.5"})})}function she({...e}){return m.jsxs(Nde,{...e,children:[m.jsx(Ide,{children:m.jsx(y8,{children:m.jsx(x8,{children:m.jsxs(b8,{size:"lg",render:m.jsx(ki,{to:"/"}),children:[m.jsx("span",{className:"size-2.5 rounded-full bg-lime-500 shrink-0"}),m.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight",children:"agentstep"})]})})})}),m.jsxs(Lde,{children:[m.jsx(ihe,{}),m.jsx(pO,{title:"Resources",items:nhe}),m.jsx(pO,{title:"Tools",items:rhe})]}),m.jsxs(Dde,{children:[m.jsx(ohe,{}),m.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[m.jsxs("span",{className:"font-mono text-[11px] text-sidebar-foreground/50",children:["v",ehe]}),m.jsx(ahe,{})]})]}),m.jsx(Pde,{})]})}const lhe=Rg("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function an({className:e,variant:t="default",render:n,...r}){return VT({defaultTagName:"span",props:Mo({className:Ne(lhe({variant:t}),e)},r),render:n,state:{slot:"badge",variant:t}})}function eo({className:e,...t}){return m.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:m.jsx("table",{"data-slot":"table",className:Ne("w-full caption-bottom text-sm",e),...t})})}function Jo({className:e,...t}){return m.jsx("thead",{"data-slot":"table-header",className:Ne("[&_tr]:border-b",e),...t})}function to({className:e,...t}){return m.jsx("tbody",{"data-slot":"table-body",className:Ne("[&_tr:last-child]:border-0",e),...t})}function yn({className:e,...t}){return m.jsx("tr",{"data-slot":"table-row",className:Ne("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function et({className:e,...t}){return m.jsx("th",{"data-slot":"table-head",className:Ne("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function Ue({className:e,...t}){return m.jsx("td",{"data-slot":"table-cell",className:Ne("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}const _8=x.createContext(void 0);function k8(e){const t=x.useContext(_8);if(t===void 0&&!e)throw new Error(Xt(33));return t}const O8=x.createContext(void 0);function of(e){const t=x.useContext(O8);if(t===void 0&&!e)throw new Error(Xt(36));return t}const che=x.createContext(void 0);function gw(e=!0){const t=x.useContext(che);if(t===void 0&&!e)throw new Error(Xt(25));return t}function uhe(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:o,typingRef:a,itemRef:l,itemMetadata:u}=e,{events:f}=o.useState("floatingTreeRoot"),d=gw(!0),h=d!==void 0;return x.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onKeyDown(g){g.key===" "&&a?.current&&g.preventDefault()},onMouseMove(g){i&&f.emit("itemhover",{nodeId:i,target:g.currentTarget})},onClick(g){t&&f.emit("close",{domEvent:g,reason:mm})},onMouseUp(g){if(d){const v=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,h&&v&&Math.abs(g.clientX-v.x)<=1&&Math.abs(g.clientY-v.y)<=1||h&&!xU&&g.button===2)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!h||g.button===2)&&(!u||u.type==="regular-item")&&l.current.click()}}),[t,n,r,f,i,o,a,l,d,h,u])}const fhe={type:"regular-item"};function dhe(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:o,typingRef:a=o.context.typingRef,nativeButton:l,itemMetadata:u,nodeId:f}=e,d=x.useRef(null),{getButtonProps:h,buttonRef:g}=Zo({disabled:n,focusableWhenDisabled:!0,native:l,composite:!0}),v=uhe({closeOnClick:t,highlighted:r,id:i,nodeId:f,store:o,typingRef:a,itemRef:d,itemMetadata:u}),b=x.useCallback(S=>Mo(v,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},S,h),[v,h,u]),w=Po(d,g);return x.useMemo(()=>({getItemProps:b,itemRef:w}),[b,w])}const j8=x.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function hhe(){return x.useContext(j8)}let T8=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Mg(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:o}=e,{register:a,unregister:l,subscribeMapChange:u,elementsRef:f,labelsRef:d,nextIndexRef:h}=hhe(),g=x.useRef(-1),[v,b]=x.useState(o??(i===T8.GuessFromOrder?()=>{if(g.current===-1){const E=h.current;h.current+=1,g.current=E}return g.current}:-1)),w=x.useRef(null),S=x.useCallback(E=>{if(w.current=E,v!==-1&&E!==null&&(f.current[v]=E,d)){const k=t!==void 0;d.current[v]=k?t:r?.current?.textContent??E.textContent}},[v,f,d,t,r]);return Pe(()=>{if(o!=null)return;const E=w.current;if(E)return a(E,n),()=>{l(E)}},[o,a,l,n]),Pe(()=>{if(o==null)return u(E=>{const k=w.current?E.get(w.current)?.index:null;k!=null&&b(k)})},[o,u,b]),x.useMemo(()=>({ref:S,index:v}),[v,S])}const phe=x.forwardRef(function(t,n){const{render:r,className:i,id:o,label:a,nativeButton:l=!1,disabled:u=!1,closeOnClick:f=!0,style:d,...h}=t,g=Mg({label:a}),v=k8(!0),b=Br(o),{store:w}=of(),S=w.useState("isActive",g.index),E=w.useState("itemProps"),{getItemProps:k,itemRef:O}=dhe({closeOnClick:f,disabled:u,highlighted:S,id:b,store:w,nativeButton:l,nodeId:v?.context.nodeId,itemMetadata:fhe});return vt("div",t,{state:{disabled:u,highlighted:S},props:[E,h,k],ref:[O,n,g.ref]})}),mhe=x.createContext(void 0);function iA(e){return x.useContext(mhe)}const ghe={...yc,...$s},vhe=x.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,...l}=t,{store:u}=of(),{side:f,align:d}=k8(),h=iA()!=null,g=u.useState("open"),v=u.useState("transitionStatus"),b=u.useState("popupProps"),w=u.useState("mounted"),S=u.useState("instantType"),E=u.useState("activeTriggerElement"),k=u.useState("parent"),O=u.useState("lastOpenChangeReason"),j=u.useState("rootId"),A=u.useState("floatingRootContext"),T=u.useState("floatingTreeRoot"),N=u.useState("closeDelay"),P=u.useState("activeTriggerElement"),F=k.type==="context-menu";Qo({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),x.useEffect(()=>{function z(V){u.setOpen(!1,ct(V.reason,V.domEvent))}return T.events.on("close",z),()=>{T.events.off("close",z)}},[T.events,u]);const D=u.useState("hoverEnabled"),q=u.useState("disabled");TT(A,{enabled:D&&!q&&!F&&k.type!=="menubar",closeDelay:N});const L={transitionStatus:v,side:f,align:d,open:g,nested:k.type==="menu",instant:S},U=x.useCallback(z=>{u.set("popupElement",z)},[u]),H=vt("div",t,{state:L,ref:[n,u.context.popupRef,U],stateAttributesMapping:ghe,props:[b,{onKeyDown(z){h&&uw.has(z.key)&&z.stopPropagation()}},Tg(v),l,{"data-rootownerid":j}]});let B=k.type===void 0||F;return(E||k.type==="menubar"&&O!==P0)&&(B=!0),m.jsx(U0,{context:A,modal:F,disabled:!w,returnFocus:a===void 0?B:a,initialFocus:k.type!=="menu",restoreFocus:!0,externalTree:k.type!=="menubar"?T:void 0,previousFocusableElement:P,nextFocusableElement:k.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:k.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:H})}),A8=x.createContext(void 0);function yhe(){const e=x.useContext(A8);if(e===void 0)throw new Error(Xt(32));return e}const xhe=x.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=of();return o.useState("mounted")||r?m.jsx(A8.Provider,{value:r,children:m.jsx($0,{ref:n,...i})}):null});function Ig(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=Le(i),a=x.useRef(0),l=pr(whe).current,u=pr(bhe).current,[f,d]=x.useState(0),h=x.useRef(f),g=Le((E,k)=>{u.set(E,k??null),h.current+=1,d(h.current)}),v=Le(E=>{u.delete(E),h.current+=1,d(h.current)}),b=x.useMemo(()=>{const E=new Map;return Array.from(u.keys()).filter(O=>O.isConnected).sort(She).forEach((O,j)=>{const A=u.get(O)??{};E.set(O,{...A,index:j})}),E},[u,f]);Pe(()=>{if(typeof MutationObserver!="function"||b.size===0)return;const E=new MutationObserver(k=>{const O=new Set,j=A=>O.has(A)?O.delete(A):O.add(A);k.forEach(A=>{A.removedNodes.forEach(j),A.addedNodes.forEach(j)}),O.size===0&&(h.current+=1,d(h.current))});return b.forEach((k,O)=>{O.parentElement&&E.observe(O.parentElement,{childList:!0})}),()=>{E.disconnect()}},[b]),Pe(()=>{h.current===f&&(n.current.length!==b.size&&(n.current.length=b.size),r&&r.current.length!==b.size&&(r.current.length=b.size),a.current=b.size),o(b)},[o,b,n,r,f]),Pe(()=>()=>{n.current=[]},[n]),Pe(()=>()=>{r&&(r.current=[])},[r]);const w=Le(E=>(l.add(E),()=>{l.delete(E)}));Pe(()=>{l.forEach(E=>E(b))},[l,b]);const S=x.useMemo(()=>({register:g,unregister:v,subscribeMapChange:w,elementsRef:n,labelsRef:r,nextIndexRef:a}),[g,v,w,n,r,a]);return m.jsx(j8.Provider,{value:S,children:t})}function bhe(){return new Map}function whe(){return new Set}function She(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ehe=20;function oA(e,t,n,r){const[i,o]=x.useState(!1);Pe(()=>{if(!e||!t||n==null){o(!1);return}const a=jt(n).documentElement.clientWidth,l=n.offsetWidth;o(a>0&&l>0&&l>=a-Ehe)},[e,t,n]),p8(e&&(!t||i),r)}const Che=x.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:o,render:a,side:l,align:u,sideOffset:f=0,alignOffset:d=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:S=kU,style:E,...k}=t,{store:O}=of(),j=yhe(),A=gw(!0),T=O.useState("parent"),N=O.useState("floatingRootContext"),P=O.useState("floatingTreeRoot"),F=O.useState("mounted"),D=O.useState("open"),q=O.useState("modal"),L=O.useState("openMethod"),U=O.useState("activeTriggerElement"),H=O.useState("transitionStatus"),B=O.useState("positionerElement"),z=O.useState("instantType"),V=O.useState("hasViewport"),Q=O.useState("lastOpenChangeReason"),G=O.useState("floatingNodeId"),I=O.useState("floatingParentNodeId"),K=N.useState("domReferenceElement"),$=x.useRef(null),R=V0(B,!1,!1);let X=r,W=f,Z=d,oe=u,ie=S;T.type==="context-menu"&&(X=r??T.context?.anchor,oe=oe??"start",!l&&oe!=="center"&&(Z=t.alignOffset??2,W=t.sideOffset??-5));let J=l,se=oe;T.type==="menu"?(J=J??"inline-end",se=se??"start",ie=t.collisionAvoidance??uT):T.type==="menubar"&&(J=J??"bottom",se=se??"start");const xe=T.type==="context-menu",ne=ew({anchor:X,floatingRootContext:N,positionMethod:A?"fixed":i,mounted:F,side:J,sideOffset:W,align:se,alignOffset:Z,arrowPadding:xe?0:v,collisionBoundary:h,collisionPadding:g,sticky:b,nodeId:G,keepMounted:j,disableAnchorTracking:w,collisionAvoidance:ie,shiftCrossAxis:xe&&!("side"in ie&&ie.side==="flip"),externalTree:P,adaptiveOrigin:V?MT:void 0});x.useEffect(()=>{function _e(de){de.open&&(de.parentNodeId===G&&O.set("hoverEnabled",!1),de.nodeId!==G&&de.parentNodeId===O.select("floatingParentNodeId")&&O.setOpen(!1,ct(lm)))}return P.events.on("menuopenchange",_e),()=>{P.events.off("menuopenchange",_e)}},[O,P.events,G]),x.useEffect(()=>{if(O.select("floatingParentNodeId")==null)return;function _e(de){if(de.open||de.nodeId!==O.select("floatingParentNodeId"))return;const be=de.reason??lm;O.setOpen(!1,ct(be))}return P.events.on("menuopenchange",_e),()=>{P.events.off("menuopenchange",_e)}},[P.events,O]);const ke=Fn();x.useEffect(()=>{D||ke.clear()},[D,ke]),x.useEffect(()=>{function _e(de){if(!(!D||de.nodeId!==O.select("floatingParentNodeId")))if(de.target&&U&&U!==de.target){const be=O.select("closeDelay");be>0?ke.isStarted()||ke.start(be,()=>{O.setOpen(!1,ct(lm))}):O.setOpen(!1,ct(lm))}else ke.clear()}return P.events.on("itemhover",_e),()=>{P.events.off("itemhover",_e)}},[P.events,D,U,O,ke]),x.useEffect(()=>{const _e={open:D,nodeId:G,parentNodeId:I,reason:O.select("lastOpenChangeReason")};P.events.emit("menuopenchange",_e)},[P.events,D,O,G,I]),Pe(()=>{const _e=K,de=$.current;if(_e&&($.current=_e),de&&_e&&_e!==de){O.set("instantType",void 0);const be=new AbortController;return R(()=>{O.set("instantType","trigger-change")},be.signal),()=>{be.abort()}}},[K,R,O]);const Ce={open:D,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:T.type==="menu",instant:z},Be=T.type==="menubar"&&T.context.modal;oA(D&&(Be||q&&Q!==or),L==="touch",B,U);const Oe=tw(t,Ce,{styles:ne.positionerStyles,transitionStatus:H,props:k,refs:[n,O.useStateSetter("positionerElement")],hidden:!F,inert:!D}),Re=F&&T.type!=="menu"&&(T.type!=="menubar"&&q&&Q!==or||T.type==="menubar"&&T.context.modal);let je=null;return T.type==="menubar"?je=T.context.contentElement:T.type===void 0&&(je=U),m.jsxs(_8.Provider,{value:ne,children:[Re&&m.jsx(fw,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:Ag(!D),cutout:je}),m.jsx(uH,{id:G,children:m.jsx(Ig,{elementsRef:O.context.itemDomElements,labelsRef:O.context.itemLabels,children:Oe})})]})}),_he=x.createContext(null);function N8(e){return x.useContext(_he)}const khe={...X0,disabled:Te(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Te(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:Te(e=>e.openMethod),allowMouseEnter:Te(e=>e.allowMouseEnter),stickIfOpen:Te(e=>e.stickIfOpen),parent:Te(e=>e.parent),rootId:Te(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Te(e=>e.activeIndex),isActive:Te((e,t)=>e.activeIndex===t),hoverEnabled:Te(e=>e.hoverEnabled),instantType:Te(e=>e.instantType),lastOpenChangeReason:Te(e=>e.openChangeReason),floatingTreeRoot:Te(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Te(e=>e.floatingNodeId),floatingParentNodeId:Te(e=>e.floatingParentNodeId),itemProps:Te(e=>e.itemProps),closeDelay:Te(e=>e.closeDelay),hasViewport:Te(e=>e.hasViewport),keyboardEventRelay:Te(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class aA extends jg{constructor(n){super({...Ohe(),...n},{positionerRef:x.createRef(),popupRef:x.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),onOpenChangeComplete:void 0,triggerElements:new mh},khe);qt(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){let i=r.store.select("rootId"),o=r.store.select("floatingTreeRoot"),a=r.store.select("keyboardEventRelay");this.unsubscribeParentListener=r.store.subscribe(()=>{const l=r.store.select("rootId"),u=r.store.select("floatingTreeRoot"),f=r.store.select("keyboardEventRelay");i===l&&o===u&&a===f||(i=l,o=u,a=f,this.notifyAll())}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const i=pr(()=>new aA(r)).current;return n??i}}function Ohe(){return{...G0(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ET,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Wn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const jhe=x.createContext(void 0);function The(){return x.useContext(jhe)}const Ahe=lT(function(t){const{children:n,open:r,onOpenChange:i,onOpenChangeComplete:o,defaultOpen:a=!1,disabled:l=!1,modal:u,loopFocus:f=!0,orientation:d="vertical",actionsRef:h,closeParentOnEsc:g=!1,handle:v,triggerId:b,defaultTriggerId:w=null,highlightItemOnHover:S=!0}=t,E=gw(!0),k=of(!0),O=N8(!0),j=The(),A=x.useMemo(()=>j&&k?{type:"menu",store:k.store}:O?{type:"menubar",context:O}:E&&!k?{type:"context-menu",context:E}:{type:void 0},[E,k,O,j]),T=aA.useStore(v?.store,{open:a,openProp:r,activeTriggerId:w,triggerIdProp:b,parent:A});bg(()=>{r===void 0&&T.state.open===!1&&a===!0&&T.update({open:!0,activeTriggerId:w})}),T.useControlledProp("openProp",r),T.useControlledProp("triggerIdProp",b),T.useContextCallback("onOpenChangeComplete",o);const N=T.useState("floatingTreeRoot"),P=CT(N),F=La();Pe(()=>{E&&!k?T.update({parent:{type:"context-menu",context:E},floatingNodeId:P,floatingParentNodeId:F}):k&&T.update({floatingNodeId:P,floatingParentNodeId:F})},[E,k,P,F,T]);const D=T.useState("open"),q=T.useState("activeTriggerElement"),L=T.useState("positionerElement"),U=T.useState("hoverEnabled"),H=T.useState("disabled"),B=T.useState("lastOpenChangeReason"),z=T.useState("parent"),V=T.useState("activeIndex"),Q=T.useState("payload"),G=T.useState("floatingParentNodeId"),I=x.useRef(null),K=G!=null,{openMethod:$,triggerProps:R}=dw(D);T.useSyncedValues({disabled:l,modal:z.type===void 0?u:void 0,openMethod:$,rootId:ef()}),Y0(T);const{forceUnmount:X}=W0(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0})}),W=x.useRef(z.type!=="context-menu"),Z=Fn();x.useEffect(()=>{if(D||(I.current=null),z.type==="context-menu"){if(!D){Z.clear(),W.current=!1;return}Z.start(500,()=>{W.current=!0})}},[Z,D,z.type]),Pe(()=>{!D&&!U&&T.set("hoverEnabled",!0)},[D,U,T]);const oe=x.useRef(!0),ie=Fn(),J=Le((ze,Ke)=>{const tt=Ke.reason;if(D===ze&&Ke.trigger===q&&B===tt||(Ke.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!ze&&Ke.trigger==null&&(Ke.trigger=q??void 0),i?.(ze,Ke),Ke.isCanceled))return;T.state.floatingRootContext.dispatchOpenChange(ze,Ke);const Tt=Ke.event;if(ze===!1&&Tt?.type==="click"&&Tt.pointerType==="touch"&&!oe.current)return;if(!ze&&V!==null){const zt=T.context.itemDomElements.current[V];queueMicrotask(()=>{zt?.setAttribute("tabindex","-1")})}ze&&tt===yd?(oe.current=!1,ie.start(300,()=>{oe.current=!0})):(oe.current=!0,ie.clear());const yt=(tt===ja||tt===mm)&&Tt.detail===0&&Tt?.isTrusted,Wt=!ze&&(tt===Eg||tt==null),nt={open:ze,openChangeReason:tt};I.current=Ke.event??null;const Rt=Ke.trigger?.id??null;(Rt||ze)&&(nt.activeTriggerId=Rt,nt.activeTriggerElement=Ke.trigger??null),T.update(nt),z.type==="menubar"&&(tt===yd||tt===lc||tt===or||tt===Ix||tt===lm)?T.set("instantType","group"):yt||Wt?T.set("instantType",yt?"click":"dismiss"):T.set("instantType",void 0)}),se=x.useCallback(ze=>{const Ke=ct(ze);return Ke.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},Ke},[T]),xe=x.useCallback(()=>{T.setOpen(!1,se(M0))},[T,se]);x.useImperativeHandle(h,()=>({unmount:X,close:xe}),[X,xe]);let ne;z.type==="context-menu"&&(ne=z.context),x.useImperativeHandle(ne?.positionerRef,()=>L,[L]),x.useImperativeHandle(ne?.actionsRef,()=>({setOpen:J}),[J]);const ke=Q0({popupStore:T,onOpenChange:J}),Ce=ke.context.events;x.useEffect(()=>{const ze=({open:Ke,eventDetails:tt})=>J(Ke,tt);return Ce.on("setOpen",ze),()=>{Ce?.off("setOpen",ze)}},[Ce,J]);const Be=Og(ke,{enabled:!H,bubbles:{escapeKey:g&&z.type==="menu"},outsidePress(){return z.type!=="context-menu"||I.current?.type==="contextmenu"?!0:W.current},externalTree:K?N:void 0}),Ee=NT(ke,{role:"menu"}),Oe=tf(),Re=x.useCallback(ze=>{T.select("activeIndex")!==ze&&T.set("activeIndex",ze)},[T]),je=jH(ke,{enabled:!H,listRef:T.context.itemDomElements,activeIndex:V,nested:z.type!==void 0,loopFocus:f,orientation:d,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:Oe==="rtl",disabledIndices:sc,onNavigate:Re,openOnArrowKeyDown:z.type!=="context-menu",externalTree:K?N:void 0,focusItemOnHover:S}),_e=x.useCallback(ze=>{T.context.typingRef.current=ze},[T]),de=TH(ke,{listRef:T.context.itemLabels,elementsRef:T.context.itemDomElements,activeIndex:V,resetMs:Toe,onMatch:ze=>{D&&ze!==V&&T.set("activeIndex",ze)},onTypingChange:_e}),{getReferenceProps:be,getFloatingProps:ve,getItemProps:pe,getTriggerProps:Ae}=vc([Be,Ee,je,de]),ae=x.useMemo(()=>{const ze=Mo(be(),{onMouseMove(){T.set("allowMouseEnter",!0)}},R);return delete ze.role,ze},[be,T,R]),me=x.useMemo(()=>{const ze=Ae();if(!ze)return ze;const Ke=Mo(ze,R);return delete Ke.role,delete Ke["aria-controls"],Ke},[Ae,R]),De=x.useMemo(()=>ve({onMouseMove(){T.set("allowMouseEnter",!0),z.type==="menu"&&T.set("hoverEnabled",!1)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(ze){const Ke=T.select("keyboardEventRelay");Ke&&!ze.isPropagationStopped()&&Ke(ze)}}),[ve,z.type,T]),$e=x.useMemo(()=>pe(),[pe]);T.useSyncedValues({floatingRootContext:ke,activeTriggerProps:ae,inactiveTriggerProps:me,popupProps:De,itemProps:$e});const Ve=x.useMemo(()=>({store:T,parent:A}),[T,A]),dt=m.jsx(O8.Provider,{value:Ve,children:typeof n=="function"?n({payload:Q}):n});return z.type===void 0||z.type==="context-menu"?m.jsx(fH,{externalTree:N,children:dt}):dt});function R8(e){const t=e.getBoundingClientRect(),n=In(e),r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=parseFloat(i.width)||0,f=parseFloat(i.height)||0,d=Math.max(t.width,a,u),h=Math.max(t.height,l,f),g=d-t.width,v=h-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-v/2,bottom:t.bottom+v/2}}function P8(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=KT(),{ref:i,index:o}=Mg(e),a=n===o,l=x.useRef(null),u=Po(i,l);return{compositeProps:x.useMemo(()=>({tabIndex:a?0:-1,onFocus(){r(o)},onMouseMove(){const d=l.current;if(!t||!d)return;const h=d.hasAttribute("disabled")||d.ariaDisabled==="true";!a&&!h&&d.focus()}}),[a,r,o,t]),compositeRef:u,index:o}}function Nhe(e){const{render:t,className:n,style:r,state:i=Wn,props:o=sc,refs:a=sc,metadata:l,stateAttributesMapping:u,tag:f="div",...d}=e,{compositeProps:h,compositeRef:g}=P8({metadata:l});return vt(f,e,{state:i,ref:[...a,g],props:[h,...o,d],stateAttributesMapping:u})}function M8(e){if(fn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!wa(e))return M8(Ta(e))}function I8(e,t){const n=x.useRef(null),r=Le(o=>{Fr.flushSync(()=>{e.setOpen(!1,ct(lc,o.nativeEvent,o.currentTarget))}),dae(n.current)?.focus()}),i=Le(o=>{const a=e.select("positionerElement");if(a&&xd(o,a))e.context.beforeContentFocusGuardRef.current?.focus();else{Fr.flushSync(()=>{e.setOpen(!1,ct(lc,o.nativeEvent,o.currentTarget))});let l=fae(e.context.triggerFocusTargetRef.current||t.current);for(;l!==null&<(a,l);){const u=l;if(l=xT(l),l===u)break}l?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Rhe(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=x.useRef(!1);return x.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,jt(o.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:o=>{i.current&&(i.current=!1,o.preventBaseUIHandler())}}:Wn,[t,n,r])}const qy=2,Phe=hU(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,id:l,openOnHover:u,delay:f=100,closeDelay:d=0,handle:h,payload:g,style:v,...b}=t,w=of(!0),S=h?.store??w?.store;if(!S)throw new Error(Xt(85));const E=Br(l),k=S.useState("isTriggerActive",E),O=S.useState("floatingRootContext"),j=S.useState("isOpenedByTrigger",E),A=x.useRef(null),T=Ihe(),N=KT(!0),P=gc(),F=x.useMemo(()=>P??new ET,[P]),D=CT(F),q=La(),{registerTrigger:L,isMountedByThisTrigger:U}=K0(E,A,S,{payload:g,closeDelay:d,parent:T,floatingTreeRoot:F,floatingNodeId:D,floatingParentNodeId:q,keyboardEventRelay:N?.relayKeyboardEvent}),H=T.type==="menubar",B=S.useState("disabled"),z=o||B||H&&T.context.disabled,{getButtonProps:V,buttonRef:Q}=Zo({disabled:z,native:a});x.useEffect(()=>{!j&&T.type===void 0&&(S.context.allowMouseUpTriggerRef.current=!1)},[S,j,T.type]);const G=x.useRef(null),I=Fn(),K=Le(Re=>{if(!G.current)return;I.clear(),S.context.allowMouseUpTriggerRef.current=!1;const je=Re.target;if(lt(G.current,je)||lt(S.select("positionerElement"),je)||je===G.current||je!=null&&M8(je)===S.select("rootId"))return;const _e=R8(G.current);Re.clientX>=_e.left-qy&&Re.clientX<=_e.right+qy&&Re.clientY>=_e.top-qy&&Re.clientY<=_e.bottom+qy||F.events.emit("close",{domEvent:Re,reason:OU})});x.useEffect(()=>{j&&S.select("lastOpenChangeReason")===or&&jt(G.current).addEventListener("mouseup",K,{once:!0})},[j,K,S]);const $=H&&T.context.hasSubmenuOpen,X=AT(O,{enabled:(u??$)&&!z&&T.type!=="context-menu"&&(!H||$&&!U),handleClose:RT({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:T.type===void 0?f:void 0,delay:{close:d},triggerElementRef:A,externalTree:F,isActiveTrigger:k,isClosing:()=>S.select("transitionStatus")==="ending"}),W=Mhe(j,S.select("lastOpenChangeReason")),Z=H0(O,{enabled:!z&&T.type!=="context-menu",event:j&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?W:!1}),oe=_H(O,{enabled:!z&&$}),ie=Rhe({open:j,enabled:H,mouseDownAction:"open"}),J=vc([Z,oe]),se={disabled:z,open:j},xe=S.useState("triggerProps",U),ne=[G,n,Q,L,A],ke=[J.getReferenceProps(),X??Wn,xe,{"aria-haspopup":"menu",id:E,onMouseDown:Re=>{if(S.select("open"))return;I.start(200,()=>{S.context.allowMouseUpTriggerRef.current=!0}),jt(Re.currentTarget).addEventListener("mouseup",K,{once:!0})}},H?{role:"menuitem"}:{},ie,b,V],{preFocusGuardRef:Ce,handlePreFocusGuardFocus:Be,handleFocusTargetFocus:Ee}=I8(S,A),Oe=vt("button",t,{enabled:!H,stateAttributesMapping:pb,state:se,ref:ne,props:ke});return H?m.jsx(Nhe,{tag:"button",render:r,className:i,style:v,state:se,refs:ne,props:ke,stateAttributesMapping:pb}):j?m.jsxs(x.Fragment,{children:[m.jsx(cc,{ref:Ce,onFocus:Be},\`\${E}-pre-focus-guard\`),m.jsx(x.Fragment,{children:Oe},E),m.jsx(cc,{ref:S.context.triggerFocusTargetRef,onFocus:Ee},\`\${E}-post-focus-guard\`)]}):m.jsx(x.Fragment,{children:Oe},E)});function Mhe(e,t){const n=Fn(),[r,i]=x.useState(!1);return Pe(()=>{e&&t==="trigger-hover"?(i(!0),n.start(_U,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Ihe(){const e=gw(!0),t=of(!0),n=N8();return x.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function mO(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function D8({...e}){return m.jsx(Ahe,{"data-slot":"dropdown-menu",...e})}function L8({...e}){return m.jsx(Phe,{"data-slot":"dropdown-menu-trigger",...e})}function z8({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...o}){return m.jsx(xhe,{children:m.jsx(Che,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:m.jsx(vhe,{"data-slot":"dropdown-menu-content",className:Ne("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...o})})})}function gO({className:e,inset:t,variant:n="default",...r}){return m.jsx(phe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ne("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function Dhe(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,actionsRef:a,handle:l,triggerId:u,defaultTriggerId:f=null}=e,d=Us(!0),h=!!d,g=hw.useStore(l?.store,{open:r,openProp:n,activeTriggerId:f,triggerIdProp:u,modal:!0,disablePointerDismissal:!0,nested:h,role:"alertdialog"});g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",u),g.useSyncedValue("nested",h),g.useContextCallback("onOpenChange",i),g.useContextCallback("onOpenChangeComplete",o);const v=g.useState("payload");m8({store:g,actionsRef:a,parentContext:d?.store.context,isDrawer:!1});const b=x.useMemo(()=>({store:g}),[g]);return m.jsx(hO.Provider,{value:!1,children:m.jsx(GT.Provider,{value:b,children:typeof t=="function"?t({payload:v}):t})})}function bh({...e}){return m.jsx(Dhe,{"data-slot":"alert-dialog",...e})}function Lhe({...e}){return m.jsx(ZT,{"data-slot":"alert-dialog-portal",...e})}function zhe({className:e,...t}){return m.jsx(XT,{"data-slot":"alert-dialog-overlay",className:Ne("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function wh({className:e,size:t="default",...n}){return m.jsxs(Lhe,{children:[m.jsx(zhe,{}),m.jsx(QT,{"data-slot":"alert-dialog-content","data-size":t,className:Ne("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n})]})}function Sh({className:e,...t}){return m.jsx("div",{"data-slot":"alert-dialog-header",className:Ne("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Eh({className:e,...t}){return m.jsx("div",{"data-slot":"alert-dialog-footer",className:Ne("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Ch({className:e,...t}){return m.jsx(eA,{"data-slot":"alert-dialog-title",className:Ne("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function _h({className:e,...t}){return m.jsx(c8,{"data-slot":"alert-dialog-description",className:Ne("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function kh({className:e,...t}){return m.jsx(Fe,{"data-slot":"alert-dialog-action",className:Ne(e),...t})}function Oh({className:e,variant:t="outline",size:n="default",...r}){return m.jsx(cw,{"data-slot":"alert-dialog-cancel",className:Ne(e),render:m.jsx(Fe,{variant:t,size:n}),...r})}function ea({...e}){return m.jsx(g8,{"data-slot":"dialog",...e})}function Fhe({...e}){return m.jsx(gde,{"data-slot":"dialog-trigger",...e})}function Bhe({...e}){return m.jsx(ZT,{"data-slot":"dialog-portal",...e})}function $he({className:e,...t}){return m.jsx(XT,{"data-slot":"dialog-overlay",className:Ne("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function za({className:e,children:t,showCloseButton:n=!0,...r}){return m.jsxs(Bhe,{children:[m.jsx($he,{}),m.jsxs(QT,{"data-slot":"dialog-content",className:Ne("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&m.jsxs(cw,{"data-slot":"dialog-close",render:m.jsx(Fe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[m.jsx(uc,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Fa({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:Ne("flex flex-col gap-2",e),...t})}function vb({className:e,showCloseButton:t=!1,children:n,...r}){return m.jsxs("div",{"data-slot":"dialog-footer",className:Ne("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&m.jsx(cw,{render:m.jsx(Fe,{variant:"outline"}),children:"Close"})]})}function Ba({className:e,...t}){return m.jsx(eA,{"data-slot":"dialog-title",className:Ne("font-heading text-base leading-none font-medium",e),...t})}function wt({className:e,...t}){return m.jsx("label",{"data-slot":"label",className:Ne("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const F8=x.createContext(null),B8=x.createContext(null);function $a(){const e=x.useContext(F8);if(e===null)throw new Error(Xt(60));return e}function $8(){const e=x.useContext(B8);if(e===null)throw new Error(Xt(61));return e}const Uhe=(e,t)=>Object.is(e,t);function Gd(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Hhe(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Gd(t,r,n))}function vm(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Gd(r,t,n))}function qhe(e,t,n){return e.filter(r=>!Gd(t,r,n))}function vO(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function U8(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Vhe(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(U8(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function H8(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return vO(e)}function ud(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?vO(e.value):vO(e)}function q8(e,t,n){function r(){return H8(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const i=t,o=U8(i)?i.flatMap(a=>a.items):i;if(e==null||typeof e!="object"){const a=o.find(l=>l.value===e);return a&&a.label!=null?a.label:r()}if("value"in e){const a=o.find(l=>l&&l.value===e.value);if(a&&a.label!=null)return a.label}}return r()}function Khe(e,t,n){return e.reduce((r,i,o)=>(o>0&&r.push(", "),r.push(m.jsx(x.Fragment,{children:q8(i,t,n)},o)),r),[])}const mt={id:Te(e=>e.id),labelId:Te(e=>e.labelId),modal:Te(e=>e.modal),multiple:Te(e=>e.multiple),items:Te(e=>e.items),itemToStringLabel:Te(e=>e.itemToStringLabel),itemToStringValue:Te(e=>e.itemToStringValue),isItemEqualToValue:Te(e=>e.isItemEqualToValue),value:Te(e=>e.value),hasSelectedValue:Te(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:ud(t,r)!==""}),hasNullItemLabel:Te((e,t)=>t?Vhe(e.items):!1),open:Te(e=>e.open),mounted:Te(e=>e.mounted),forceMount:Te(e=>e.forceMount),transitionStatus:Te(e=>e.transitionStatus),openMethod:Te(e=>e.openMethod),activeIndex:Te(e=>e.activeIndex),selectedIndex:Te(e=>e.selectedIndex),isActive:Te((e,t)=>e.activeIndex===t),isSelected:Te((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(o=>Gd(n,o,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Gd(n,i,r)}),isSelectedByFocus:Te((e,t)=>e.selectedIndex===t),popupProps:Te(e=>e.popupProps),triggerProps:Te(e=>e.triggerProps),triggerElement:Te(e=>e.triggerElement),positionerElement:Te(e=>e.positionerElement),listElement:Te(e=>e.listElement),scrollUpArrowVisible:Te(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Te(e=>e.scrollDownArrowVisible),hasScrollArrows:Te(e=>e.hasScrollArrows)};function va(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Uo=1;function sA(e,t){return Math.max(0,e-t)}function Xd(e,t){if(t<=0)return 0;const n=va(e,0,t),r=n,i=t-n,o=r<=Uo,a=i<=Uo;return o&&a?r<=i?0:t:o?0:a?t:n}function Yhe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:a=!1,onOpenChange:l,name:u,form:f,autoComplete:d,disabled:h=!1,readOnly:g=!1,required:v=!1,modal:b=!0,actionsRef:w,inputRef:S,onOpenChangeComplete:E,items:k,multiple:O=!1,itemToStringLabel:j,itemToStringValue:A,isItemEqualToValue:T=Uhe,highlightItemOnHover:N=!0,children:P}=e,{clearErrors:F}=l8(),{setDirty:D,setTouched:q,setFocused:L,shouldValidateOnChange:U,validityData:H,setFilled:B,name:z,disabled:V,validation:Q,validationMode:G}=gh(),I=lw({id:t}),K=V||h,$=z??u,[R,X]=zu({controlled:n,default:O?r??sc:r,name:"Select",state:"value"}),[W,Z]=zu({controlled:o,default:a,name:"Select",state:"open"}),oe=x.useRef([]),ie=x.useRef([]),J=x.useRef(null),se=x.useRef(null),xe=x.useRef(0),ne=x.useRef(null),ke=x.useRef([]),Ce=x.useRef(!1),Be=x.useRef(!1),Ee=x.useRef(null),Oe=x.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Re=x.useRef(!1),{mounted:je,setMounted:_e,transitionStatus:de}=ph(W),{openMethod:be,triggerProps:ve}=dw(W),pe=pr(()=>new EH({id:I,labelId:void 0,modal:b,multiple:O,itemToStringLabel:j,itemToStringValue:A,isItemEqualToValue:T,value:R,open:W,mounted:je,transitionStatus:de,items:k,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ae=gt(pe,mt.activeIndex),ae=gt(pe,mt.selectedIndex),me=gt(pe,mt.triggerElement),De=gt(pe,mt.positionerElement),$e=Ole(be),Ve=be??$e,dt=x.useMemo(()=>O&&Array.isArray(R)&&R.length===0?"":ud(R,A),[O,R,A]),ze=x.useMemo(()=>O&&Array.isArray(R)?R.map(Ot=>ud(Ot,A)):ud(R,A),[O,R,A]),Ke=ar(pe.state.triggerElement),tt=Le(()=>ze);WT(Ke,{id:I,value:R,getValue:tt});const Tt=x.useRef(R);Pe(()=>{R!==Tt.current&&pe.set("forceMount",!0)},[pe,R]),Pe(()=>{B(O?Array.isArray(R)&&R.length>0:R!=null)},[O,R,B]),Pe(function(){if(W)return;const Pt=ke.current;if(O){const Li=Array.isArray(R)?R:[];if(Li.length===0){pe.set("selectedIndex",null);return}const Jn=Li[Li.length-1],zn=vm(Pt,Jn,T);pe.set("selectedIndex",zn===-1?null:zn);return}const ti=vm(Pt,R,T);pe.set("selectedIndex",ti===-1?null:ti)},[O,W,R,ke,T,pe]),JT(R,()=>{F($),D(R!==H.initialValue),U()?Q.commit(R):Q.commit(R,!0)});const yt=Le((Ot,Pt)=>{if(l?.(Ot,Pt),!Pt.isCanceled&&(Z(Ot),!Ot&&(Pt.reason===lc||Pt.reason===P0)&&(q(!0),L(!1),G==="onBlur"&&Q.commit(R)),!Ot&&pe.state.activeIndex!==null)){const ti=oe.current[pe.state.activeIndex];queueMicrotask(()=>{ti?.setAttribute("tabindex","-1")})}}),Wt=Le(()=>{_e(!1),pe.update({activeIndex:null,openMethod:null}),E?.(!1)});Qo({enabled:!w,open:W,ref:J,onComplete(){W||Wt()}}),x.useImperativeHandle(w,()=>({unmount:Wt}),[Wt]);const nt=Le((Ot,Pt)=>{i?.(Ot,Pt),!Pt.isCanceled&&X(Ot)}),Rt=Le(()=>{const Ot=pe.state.listElement||J.current;if(!Ot)return;const Pt=sA(Ot.scrollHeight,Ot.clientHeight),ti=Xd(Ot.scrollTop,Pt),Li=ti>0,Jn=ti<Pt;pe.state.scrollUpArrowVisible!==Li&&pe.set("scrollUpArrowVisible",Li),pe.state.scrollDownArrowVisible!==Jn&&pe.set("scrollDownArrowVisible",Jn)}),zt=CH({open:W,onOpenChange:yt,elements:{reference:me,floating:De}}),Gt=H0(zt,{enabled:!g&&!K,event:"mousedown"}),Dn=Og(zt,{bubbles:!1}),Qt=jH(zt,{enabled:!g&&!K,listRef:oe,activeIndex:Ae,selectedIndex:ae,disabledIndices:sc,onNavigate(Ot){Ot===null&&!W||pe.set("activeIndex",Ot)},focusItemOnHover:N}),Ze=TH(zt,{enabled:!g&&!K&&(W||!O),listRef:ie,activeIndex:Ae,selectedIndex:ae,onMatch(Ot){W?pe.set("activeIndex",Ot):nt(ke.current[Ot],ct("none"))},onTypingChange(Ot){Ce.current=Ot}}),{getReferenceProps:At,getFloatingProps:Ft,getItemProps:ht}=vc([Gt,Dn,Qt,Ze]),En=x.useMemo(()=>Mo(At(),ve,I?{id:I}:Wn),[At,ve,I]);bg(()=>{pe.update({popupProps:Ft(),triggerProps:En})}),Pe(()=>{pe.update({id:I,modal:b,multiple:O,value:R,open:W,mounted:je,transitionStatus:de,popupProps:Ft(),triggerProps:En,items:k,itemToStringLabel:j,itemToStringValue:A,isItemEqualToValue:T,openMethod:Ve})},[pe,I,b,O,R,W,je,de,Ft,En,k,j,A,T,Ve]);const Bt=x.useMemo(()=>({store:pe,name:$,required:v,disabled:K,readOnly:g,multiple:O,itemToStringLabel:j,itemToStringValue:A,highlightItemOnHover:N,setValue:nt,setOpen:yt,listRef:oe,popupRef:J,scrollHandlerRef:se,handleScrollArrowVisibility:Rt,scrollArrowsMountedCountRef:xe,getItemProps:ht,events:zt.context.events,valueRef:ne,valuesRef:ke,labelsRef:ie,typingRef:Ce,selectionRef:Oe,selectedItemTextRef:Ee,validation:Q,onOpenChangeComplete:E,keyboardActiveRef:Be,alignItemWithTriggerActiveRef:Re,initialValueRef:Tt}),[pe,$,v,K,g,O,j,A,N,nt,yt,ht,zt.context.events,Q,E,Rt]),rn=Po(S,Q.inputRef),vr=O&&Array.isArray(R)&&R.length>0,Ln=O?void 0:$,Zn=x.useMemo(()=>!O||!Array.isArray(R)||!$?null:R.map(Ot=>{const Pt=ud(Ot,A);return m.jsx("input",{type:"hidden",form:f,name:$,value:Pt},Pt)}),[O,R,f,$,A]);return m.jsx(F8.Provider,{value:Bt,children:m.jsxs(B8.Provider,{value:zt,children:[P,m.jsx("input",{...Q.getInputValidationProps({onFocus(){pe.state.triggerElement?.focus({focusVisible:!0})},onChange(Ot){if(Ot.nativeEvent.defaultPrevented)return;const Pt=Ot.currentTarget.value,ti=ct(Wo,Ot.nativeEvent);function Li(){if(O)return;const Jn=ke.current.find(zn=>ud(zn,A).toLowerCase()===Pt.toLowerCase()||H8(zn,j).toLowerCase()===Pt.toLowerCase());Jn!=null&&(D(Jn!==H.initialValue),nt(Jn,ti),U()&&Q.commit(Jn))}pe.set("forceMount",!0),queueMicrotask(Li)}}),id:I&&Ln==null?\`\${I}-hidden-input\`:void 0,form:f,name:Ln,autoComplete:d,value:dt,disabled:K,required:v&&!vr,readOnly:g,ref:rn,style:$?PU:hT,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Zn]})})}function Whe(e,t){return e??t}const Vy=2,Ghe=400,sz=200,Xhe={...pb,...YT,value:()=>null},Qhe=x.forwardRef(function(t,n){const{render:r,className:i,id:o,disabled:a=!1,nativeButton:l=!0,style:u,...f}=t,{setTouched:d,setFocused:h,validationMode:g,state:v,disabled:b}=gh(),{labelId:w}=sw(),{store:S,setOpen:E,selectionRef:k,validation:O,readOnly:j,required:A,alignItemWithTriggerActiveRef:T,disabled:N,keyboardActiveRef:P}=$a(),F=b||N||a,D=gt(S,mt.open),q=gt(S,mt.value),L=gt(S,mt.triggerProps),U=gt(S,mt.positionerElement),H=gt(S,mt.listElement),B=gt(S,mt.id),z=gt(S,mt.labelId),V=gt(S,mt.hasSelectedValue),Q=!V&&D,G=gt(S,mt.hasNullItemLabel,Q),I=o??B,K=Whe(w,z);lw({id:I});const $=ar(U),R=x.useRef(null),{getButtonProps:X,buttonRef:W}=Zo({disabled:F,native:l}),Z=Le(Be=>{S.set("triggerElement",Be)}),oe=Po(n,R,W,Z),ie=Fn(),J=Fn(),se=Fn(),xe=Fn();x.useEffect(()=>{if(D)return!(V||G)?se.start(Ghe,()=>{k.current.allowUnselectedMouseUp=!0,k.current.allowSelectedMouseUp=!0}):xe.start(sz,()=>{k.current.allowUnselectedMouseUp=!0,se.start(sz,()=>{k.current.allowSelectedMouseUp=!0})}),()=>{se.clear(),xe.clear()};k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},J.clear()},[D,V,G,k,J,se,xe]);const ne=x.useMemo(()=>H?.id??Dm(U)?.id,[H,U]),ke=Mo(L,{id:I,role:"combobox","aria-expanded":D?"true":"false","aria-haspopup":"listbox","aria-controls":D?ne:void 0,"aria-labelledby":K,"aria-readonly":j||void 0,"aria-required":A||void 0,tabIndex:F?-1:0,ref:oe,onFocus(Be){h(!0),D&&T.current&&E(!1,ct(Wo,Be.nativeEvent)),ie.start(0,()=>{S.set("forceMount",!0)})},onBlur(Be){lt(U,Be.relatedTarget)||(d(!0),h(!1),g==="onBlur"&&O.commit(q))},onPointerMove(){P.current=!1},onKeyDown(){P.current=!0},onMouseDown(Be){if(D)return;const Ee=jt(Be.currentTarget);function Oe(Re){if(!R.current)return;const je=Re.target;if(lt(R.current,je)||lt($.current,je)||je===R.current)return;const _e=R8(R.current);Re.clientX>=_e.left-Vy&&Re.clientX<=_e.right+Vy&&Re.clientY>=_e.top-Vy&&Re.clientY<=_e.bottom+Vy||E(!1,ct(OU,Re))}J.start(0,()=>{Ee.addEventListener("mouseup",Oe,{once:!0})})}},O.getValidationProps,f,X);ke.role="combobox";const Ce={...v,open:D,disabled:F,value:q,readOnly:j,placeholder:!V};return vt("button",t,{ref:[n,R],state:Ce,stateAttributesMapping:Xhe,props:ke})}),Zhe={value:()=>null},Jhe=x.forwardRef(function(t,n){const{className:r,render:i,children:o,placeholder:a,style:l,...u}=t,{store:f,valueRef:d}=$a(),h=gt(f,mt.value),g=gt(f,mt.items),v=gt(f,mt.itemToStringLabel),b=gt(f,mt.hasSelectedValue),w=!b&&a!=null&&o==null,S=gt(f,mt.hasNullItemLabel,w),E={value:h,placeholder:!b};let k=null;return typeof o=="function"?k=o(h):o!=null?k=o:!b&&a!=null&&!S?k=a:Array.isArray(h)?k=Khe(h,g,v):k=q8(h,g,v),vt("span",t,{state:E,ref:[n,d],props:[{children:k},u],stateAttributesMapping:Zhe})}),epe=x.forwardRef(function(t,n){const{className:r,render:i,style:o,...a}=t,{store:l}=$a(),f={open:gt(l,mt.open)};return vt("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"\u25BC"},a],stateAttributesMapping:J0})}),tpe=x.createContext(void 0),npe=x.forwardRef(function(t,n){const{store:r}=$a(),i=gt(r,mt.mounted),o=gt(r,mt.forceMount);return i||o?m.jsx(tpe.Provider,{value:!0,children:m.jsx($0,{ref:n,...t})}):null}),V8=x.createContext(void 0);function lA(){const e=x.useContext(V8);if(!e)throw new Error(Xt(59));return e}function yb(e,t){e&&Object.assign(e.style,t)}const K8={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},rpe={position:"fixed"},ipe=x.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:o,render:a,side:l="bottom",align:u="center",sideOffset:f=0,alignOffset:d=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:w,alignItemWithTrigger:S=!0,collisionAvoidance:E=kU,style:k,...O}=t,{store:j,listRef:A,labelsRef:T,alignItemWithTriggerActiveRef:N,selectedItemTextRef:P,valuesRef:F,initialValueRef:D,popupRef:q,setValue:L}=$a(),U=$8(),H=gt(j,mt.open),B=gt(j,mt.mounted),z=gt(j,mt.modal),V=gt(j,mt.value),Q=gt(j,mt.openMethod),G=gt(j,mt.positionerElement),I=gt(j,mt.triggerElement),K=gt(j,mt.isItemEqualToValue),$=gt(j,mt.transitionStatus),R=x.useRef(null),X=x.useRef(null),[W,Z]=x.useState(S),oe=B&&W&&Q!=="touch";!B&&W!==S&&Z(S),Pe(()=>{B||(mt.scrollUpArrowVisible(j.state)&&j.set("scrollUpArrowVisible",!1),mt.scrollDownArrowVisible(j.state)&&j.set("scrollDownArrowVisible",!1))},[j,B]),x.useImperativeHandle(N,()=>oe),oA((oe||z)&&H,Q==="touch",G,I);const ie=ew({anchor:r,floatingRootContext:U,positionMethod:i,mounted:B,side:l,sideOffset:f,align:u,alignOffset:d,arrowPadding:v,collisionBoundary:h,collisionPadding:g,sticky:b,disableAnchorTracking:w??oe,collisionAvoidance:E,keepMounted:!0}),J=oe?"none":ie.side,se=oe?rpe:ie.positionerStyles,xe={open:H,side:J,align:ie.align,anchorHidden:ie.anchorHidden},ne=Le(Oe=>{j.set("positionerElement",Oe)}),ke=tw(t,xe,{styles:se,transitionStatus:$,props:O,refs:[n,ne],hidden:!B,inert:!H}),Ce=x.useRef(0),Be=Le(Oe=>{if(Oe.size===0&&Ce.current===0||F.current.length===0)return;const Re=Ce.current;if(Ce.current=Oe.size,Oe.size===Re)return;const je=ct(Wo);if(Re!==0&&!j.state.multiple&&V!==null&&vm(F.current,V,K)===-1){const de=D.current,ve=de!=null&&vm(F.current,de,K)!==-1?de:null;L(ve,je),ve===null&&(j.set("selectedIndex",null),P.current=null)}if(Re!==0&&j.state.multiple&&Array.isArray(V)){const _e=be=>vm(F.current,be,K)!==-1,de=V.filter(be=>_e(be));(de.length!==V.length||de.some(be=>!Hhe(V,be,K)))&&(L(de,je),de.length===0&&(j.set("selectedIndex",null),P.current=null))}if(H&&oe){j.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const _e={height:""};yb(G,_e),yb(q.current,_e)}}),Ee=x.useMemo(()=>({...ie,side:J,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:Z,scrollUpArrowRef:R,scrollDownArrowRef:X}),[ie,J,oe,Z]);return m.jsx(Ig,{elementsRef:A,labelsRef:T,onMapChange:Be,children:m.jsxs(V8.Provider,{value:Ee,children:[B&&z&&m.jsx(fw,{inert:Ag(!H),cutout:I}),ke]})})}),Ky="base-ui-disable-scrollbar",Bm={className:Ky,getElement(e){return m.jsx("style",{nonce:e,href:Ky,precedence:"base-ui:low",children:\`.\${Ky}{scrollbar-width:none}.\${Ky}::-webkit-scrollbar{display:none}\`})}},ope=x.createContext(void 0),ape={disableStyleElements:!1};function Y8(){return x.useContext(ope)??ape}const spe={...yc,...$s},lpe=x.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,...l}=t,{store:u,popupRef:f,onOpenChangeComplete:d,setOpen:h,valueRef:g,selectedItemTextRef:v,keyboardActiveRef:b,multiple:w,handleScrollArrowVisibility:S,scrollHandlerRef:E,listRef:k,highlightItemOnHover:O}=$a(),{side:j,align:A,alignItemWithTriggerActive:T,isPositioned:N,setControlledAlignItemWithTrigger:P,scrollDownArrowRef:F,scrollUpArrowRef:D}=lA(),q=iA()!=null,L=$8(),U=tf(),{nonce:H,disableStyleElements:B}=Y8(),z=gt(u,mt.id),V=gt(u,mt.open),Q=gt(u,mt.mounted),G=gt(u,mt.popupProps),I=gt(u,mt.transitionStatus),K=gt(u,mt.triggerElement),$=gt(u,mt.positionerElement),R=gt(u,mt.listElement),X=x.useRef(!1),W=x.useRef(!1),Z=x.useRef({}),oe=Cg(),ie=Le(ne=>{if(!$||!f.current||!W.current)return;if(X.current||!T){S();return}const ke=$.style.top==="0px",Ce=$.style.bottom==="0px";if(!ke&&!Ce){S();return}const Be=cz($),Ee=fm($.getBoundingClientRect().height,"y",Be),Oe=jt($),Re=getComputedStyle($),je=parseFloat(Re.marginTop),_e=parseFloat(Re.marginBottom),de=lz(getComputedStyle(f.current)),be=Math.min(Oe.documentElement.clientHeight-je-_e,de),ve=ne.scrollTop,pe=Yy(ne);let Ae=0,ae=null,me=!1,De=!1;const $e=Ke=>{$.style.height=\`\${Ke}px\`},Ve=(Ke,tt)=>{const Tt=va(Ke,0,be-Ee);Tt>0&&$e(Ee+Tt),ne.scrollTop=tt,be-(Ee+Tt)<=Uo&&(X.current=!0),S()},dt=ke?pe-ve:ve,ze=Math.min(Ee+dt,be);if(Ae=ze,dt<=Uo){Ve(dt,ke?pe:0);return}if(be-ze>Uo)ke?De=!0:ae=0;else if(me=!0,Ce&&ve<pe){const Ke=Ee+dt-be;ae=ve-(dt-Ke)}if(Ae=Math.ceil(Ae),Ae!==0&&$e(Ae),De||ae!=null){const Ke=Yy(ne),tt=De?Ke:va(ae,0,Ke);Math.abs(ne.scrollTop-tt)>Uo&&(ne.scrollTop=tt)}(me||Ae>=be-Uo)&&(X.current=!0),S()});x.useImperativeHandle(E,()=>ie,[ie]),Qo({open:V,ref:f,onComplete(){V&&d?.(!0)}});const J={open:V,transitionStatus:I,side:j,align:A};Pe(()=>{!$||!f.current||Object.keys(Z.current).length||(Z.current={top:$.style.top||"0",left:$.style.left||"0",right:$.style.right,height:$.style.height,bottom:$.style.bottom,minHeight:$.style.minHeight,maxHeight:$.style.maxHeight,marginTop:$.style.marginTop,marginBottom:$.style.marginBottom})},[f,$]),Pe(()=>{V||T||(W.current=!1,X.current=!1,yb($,Z.current))},[V,T,$,f]),Pe(()=>{const ne=f.current;if(!V||!K||!$||!ne||T&&!N||u.state.transitionStatus==="ending")return;if(!T){W.current=!0,oe.request(S),ne.style.removeProperty("--transform-origin");return}const ke=cpe(ne);ne.style.removeProperty("--transform-origin");try{const Ce=v.current,Be=g.current,Ee=getComputedStyle($),Oe=getComputedStyle(ne),Re=jt(K),je=In($),_e=cz(K),de=Wy(K.getBoundingClientRect(),_e),be=Wy($.getBoundingClientRect(),_e),ve=de.height,pe=R||ne,Ae=pe.scrollHeight,ae=parseFloat(Oe.borderBottomWidth),me=parseFloat(Ee.marginTop)||10,De=parseFloat(Ee.marginBottom)||10,$e=parseFloat(Ee.minHeight)||100,Ve=lz(Oe),dt=5,ze=5,Ke=20,tt=Re.documentElement.clientHeight-me-De,Tt=Re.documentElement.clientWidth,yt=tt-de.bottom+ve;let Wt,nt=U==="rtl"?de.right-be.width:de.left,Rt=0;if(Ce&&Be){const rn=Wy(Be.getBoundingClientRect(),_e);Wt=Wy(Ce.getBoundingClientRect(),_e),nt=be.left+(U==="rtl"?rn.right-Wt.right:rn.left-Wt.left);const vr=rn.top-de.top+rn.height/2;Rt=Wt.top-be.top+Wt.height/2-vr}const zt=yt+Rt+De+ae;let Gt=Math.min(tt,zt);const Dn=tt-me-De,Qt=zt-Gt,Ze=Tt-ze;$.style.left=\`\${va(nt,dt,Ze-be.width)}px\`,$.style.height=\`\${Gt}px\`,$.style.maxHeight="auto",$.style.marginTop=\`\${me}px\`,$.style.marginBottom=\`\${De}px\`,ne.style.height="100%";const At=Yy(pe),Ft=Qt>=At-Uo;Ft&&(Gt=Math.min(tt,be.height)-(Qt-At));const ht=de.top<Ke||de.bottom>tt-Ke||Math.ceil(Gt)+Uo<Math.min(Ae,$e),En=(je.visualViewport?.scale??1)!==1&&R0;if(ht||En){W.current=!0,yb($,Z.current),P(!1);return}const Bt=Math.max($e,Gt);if(Ft){const rn=Math.max(0,tt-zt);$.style.top=be.height>=Dn?"0":\`\${rn}px\`,$.style.height=\`\${Gt}px\`,pe.scrollTop=Yy(pe)}else $.style.bottom="0",pe.scrollTop=Qt;if(Wt){const rn=be.top,vr=be.height,Ln=Wt.top+Wt.height/2,Zn=vr>0?(Ln-rn)/vr*100:50,Ot=va(Zn,0,100);ne.style.setProperty("--transform-origin",\`50% \${Ot}%\`)}(Bt===tt||Gt>=Ve)&&(X.current=!0),S(),O&&u.state.selectedIndex===null&&u.state.activeIndex===null&&k.current[0]!=null&&u.set("activeIndex",0),W.current=!0}finally{ke()}},[u,V,$,K,g,v,f,S,T,P,oe,F,D,R,k,O,U,N]),x.useEffect(()=>{if(!T||!$||!V)return;const ne=In($);function ke(Ce){h(!1,ct(Moe,Ce))}return kt(ne,"resize",ke)},[h,T,$,V]);const se={...R?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:\`\${z}-list\`},onKeyDown(ne){b.current=!0,q&&uw.has(ne.key)&&ne.stopPropagation()},onMouseMove(){b.current=!1},onScroll(ne){R||ie(ne.currentTarget)},...T&&{style:R?{height:"100%"}:K8}},xe=vt("div",t,{ref:[n,f],state:J,stateAttributesMapping:spe,props:[G,se,Tg(I),{className:!R&&T?Bm.className:void 0},l]});return m.jsxs(x.Fragment,{children:[!B&&Bm.getElement(H),m.jsx(U0,{context:L,modal:!1,disabled:!Q,returnFocus:a,restoreFocus:!0,children:xe})]})});function lz(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Yy(e){return sA(e.scrollHeight,e.clientHeight)}function cz(e){return yH.getScale(e)}function fm(e,t,n){return e/n[t]}function Wy(e,t){return Lm({x:fm(e.x,"x",t),y:fm(e.y,"y",t),width:fm(e.width,"x",t),height:fm(e.height,"y",t)})}const uz=[["transform","none"],["scale","1"],["translate","0 0"]];function cpe(e){const{style:t}=e,n={};for(const[r,i]of uz)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of uz){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}const upe=x.forwardRef(function(t,n){const{className:r,render:i,style:o,...a}=t,{store:l,scrollHandlerRef:u}=$a(),{alignItemWithTriggerActive:f}=lA(),d=gt(l,mt.hasScrollArrows),h=gt(l,mt.openMethod),g=gt(l,mt.multiple),b={id:\`\${gt(l,mt.id)}-list\`,role:"listbox","aria-multiselectable":g||void 0,onScroll(S){u.current?.(S.currentTarget)},...f&&{style:K8},className:d&&h!=="touch"?Bm.className:void 0},w=Le(S=>{l.set("listElement",S)});return vt("div",t,{ref:[n,w],props:[b,a]})}),W8=x.createContext(void 0);function cA(){const e=x.useContext(W8);if(!e)throw new Error(Xt(57));return e}const fpe=x.memo(x.forwardRef(function(t,n){const{render:r,className:i,value:o=null,label:a,disabled:l=!1,nativeButton:u=!1,style:f,...d}=t,h=x.useRef(null),g=Mg({label:a,textRef:h,indexGuessBehavior:T8.GuessFromOrder}),{store:v,getItemProps:b,setOpen:w,setValue:S,selectionRef:E,typingRef:k,valuesRef:O,multiple:j,selectedItemTextRef:A}=$a(),T=gt(v,mt.isActive,g.index),N=gt(v,mt.isSelected,g.index,o),P=gt(v,mt.isSelectedByFocus,g.index),F=gt(v,mt.isItemEqualToValue),D=g.index,q=D!==-1,L=x.useRef(null),U=ar(D);Pe(()=>{if(!q)return;const W=O.current;return W[D]=o,()=>{delete W[D]}},[q,D,o,O]),Pe(()=>{if(!q)return;const W=v.state.value;let Z=W;j&&Array.isArray(W)&&W.length>0&&(Z=W[W.length-1]),Z!==void 0&&Gd(o,Z,F)&&(v.set("selectedIndex",D),h.current&&(A.current=h.current))},[q,D,j,F,v,o,A]);const H={disabled:l,selected:N,highlighted:T},B=b({active:T,selected:N});B.id=void 0;const z=x.useRef(null),V=x.useRef("mouse"),Q=x.useRef(!1),{getButtonProps:G,buttonRef:I}=Zo({disabled:l,focusableWhenDisabled:!0,native:u,composite:!0});function K(W){const Z=v.state.value;if(j){const oe=Array.isArray(Z)?Z:[],ie=N?qhe(oe,o,F):[...oe,o];S(ie,ct(mm,W))}else S(o,ct(mm,W)),w(!1,ct(mm,W))}const $={role:"option","aria-selected":N,tabIndex:T?0:-1,onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(W){z.current=W.key,v.set("activeIndex",D),W.key===" "&&k.current&&W.preventDefault()},onClick(W){Q.current=!1,!(W.type==="keydown"&&z.current===null)&&(l||W.type==="keydown"&&z.current===" "&&k.current||V.current!=="touch"&&!T||(z.current=null,K(W.nativeEvent)))},onPointerEnter(W){V.current=W.pointerType},onPointerDown(W){V.current=W.pointerType,Q.current=!0},onMouseUp(){if(l)return;if(Q.current){Q.current=!1;return}const W=!E.current.allowSelectedMouseUp&&N,Z=!E.current.allowUnselectedMouseUp&&!N;W||Z||V.current!=="touch"&&!T||L.current?.click()}},R=vt("div",t,{ref:[I,n,g.ref,L],state:H,props:[B,$,d,G]}),X=x.useMemo(()=>({selected:N,indexRef:U,textRef:h,selectedByFocus:P,hasRegistered:q}),[N,U,h,P,q]);return m.jsx(W8.Provider,{value:X,children:R})})),dpe=x.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=cA();return r||i?m.jsx(hpe,{...t,ref:n}):null}),hpe=x.memo(x.forwardRef((e,t)=>{const{render:n,className:r,style:i,keepMounted:o,...a}=e,{selected:l}=cA(),u=x.useRef(null),{transitionStatus:f,setMounted:d}=ph(l),g=vt("span",e,{ref:[t,u],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},a],stateAttributesMapping:$s});return Qo({open:l,ref:u,onComplete(){l||d(!1)}}),g})),ppe=x.memo(x.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:o,hasRegistered:a}=cA(),{selectedItemTextRef:l}=$a(),{className:u,render:f,style:d,...h}=t,g=x.useCallback(b=>{if(!b||!a)return;const w=l.current===null||!l.current.isConnected;(o||w&&r.current===0)&&(l.current=b)},[l,r,o,a]);return vt("div",t,{ref:[g,n,i],props:h})})),G8=x.forwardRef(function(t,n){const{render:r,className:i,style:o,direction:a,keepMounted:l=!1,...u}=t,f=a==="up",{store:d,popupRef:h,listRef:g,handleScrollArrowVisibility:v,scrollArrowsMountedCountRef:b}=$a(),{side:w,scrollDownArrowRef:S,scrollUpArrowRef:E}=lA(),k=f?mt.scrollUpArrowVisible:mt.scrollDownArrowVisible,O=gt(d,k),j=gt(d,mt.openMethod),A=O&&j!=="touch",T=Fn(),N=f?E:S,{transitionStatus:P,setMounted:F}=ph(A);Pe(()=>(b.current+=1,d.state.hasScrollArrows||d.set("hasScrollArrows",!0),()=>{b.current=Math.max(0,b.current-1),b.current===0&&d.state.hasScrollArrows&&d.set("hasScrollArrows",!1)}),[d,b]),Qo({open:A,ref:N,onComplete(){A||F(!1)}});const L=vt("div",t,{ref:[n,N],state:{direction:a,visible:A,side:w,transitionStatus:P},props:[{"aria-hidden":!0,children:f?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(H){if(H.movementX===0&&H.movementY===0||T.isStarted())return;d.set("activeIndex",null);function B(){const z=d.state.listElement??h.current;if(!z)return;d.set("activeIndex",null),v();const V=sA(z.scrollHeight,z.clientHeight),Q=Xd(z.scrollTop,V),G=Q===(f?0:V),I=g.current;if(Q!==z.scrollTop&&(z.scrollTop=Q),I.length===0&&d.set(f?"scrollUpArrowVisible":"scrollDownArrowVisible",!G),G){T.clear();return}if(I.length>0){const K=N.current?.offsetHeight||0;z.scrollTop=mpe(I,f,Q,z.clientHeight,K,V)}T.start(40,B)}T.start(40,B)},onMouseLeave(){T.clear()}},u]});return A||l?L:null});function mpe(e,t,n,r,i,o){if(t){let d=0;const h=n+i-Uo;for(let b=0;b<e.length;b+=1){const w=e[b];if(w&&w.offsetTop>=h){d=b;break}}const g=Math.max(0,d-1),v=e[g];return g<d&&v?Xd(v.offsetTop-i,o):0}let a=e.length-1;const l=n+r-i+Uo;for(let d=0;d<e.length;d+=1){const h=e[d];if(h&&h.offsetTop+h.offsetHeight>l){a=Math.max(0,d-1);break}}const u=Math.min(e.length-1,a+1),f=e[u];return u>a&&f?Xd(f.offsetTop+f.offsetHeight-r+i,o):o}const gpe=x.forwardRef(function(t,n){return m.jsx(G8,{...t,ref:n,direction:"down"})}),vpe=x.forwardRef(function(t,n){return m.jsx(G8,{...t,ref:n,direction:"up"})}),X8=x.createContext(void 0);function ype(){const e=x.useContext(X8);if(e===void 0)throw new Error(Xt(56));return e}const xpe=x.forwardRef(function(t,n){const{className:r,render:i,style:o,...a}=t,[l,u]=x.useState(),f=x.useMemo(()=>({labelId:l,setLabelId:u}),[l,u]),d=vt("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},a]});return m.jsx(X8.Provider,{value:f,children:d})}),bpe=x.forwardRef(function(t,n){const{className:r,render:i,id:o,style:a,...l}=t,{setLabelId:u}=ype(),f=Br(o);return Pe(()=>{u(f)},[f,u]),vt("div",t,{ref:n,props:[{id:f},l]})}),To=Yhe;function fz({className:e,...t}){return m.jsx(xpe,{"data-slot":"select-group",className:Ne("scroll-my-1 p-1",e),...t})}function jh({className:e,...t}){return m.jsx(Jhe,{"data-slot":"select-value",className:Ne("flex flex-1 text-left",e),...t})}function Ao({className:e,size:t="default",children:n,...r}){return m.jsxs(Qhe,{"data-slot":"select-trigger","data-size":t,className:Ne("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,m.jsx(epe,{render:m.jsx(Ng,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function No({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:o=0,alignItemWithTrigger:a=!0,...l}){return m.jsx(npe,{children:m.jsx(ipe,{side:n,sideOffset:r,align:i,alignOffset:o,alignItemWithTrigger:a,className:"isolate z-50",children:m.jsxs(lpe,{"data-slot":"select-content","data-align-trigger":a,className:Ne("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l,children:[m.jsx(wpe,{}),m.jsx(upe,{children:t}),m.jsx(Spe,{})]})})})}function dz({className:e,...t}){return m.jsx(bpe,{"data-slot":"select-label",className:Ne("px-1.5 py-1 text-xs text-muted-foreground",e),...t})}function ai({className:e,children:t,...n}){return m.jsxs(fpe,{"data-slot":"select-item",className:Ne("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[m.jsx(ppe,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),m.jsx(dpe,{render:m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:m.jsx(Aa,{className:"pointer-events-none"})})]})}function wpe({className:e,...t}){return m.jsx(vpe,{"data-slot":"select-scroll-up-button",className:Ne("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:m.jsx(n8,{})})}function Spe({className:e,...t}){return m.jsx(gpe,{"data-slot":"select-scroll-down-button",className:Ne("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:m.jsx(Ng,{})})}const Qd={claude:["claude-sonnet-4-6","claude-opus-4-6","claude-haiku-4-5"],opencode:["anthropic/claude-sonnet-4-6","anthropic/claude-opus-4-6","openai/gpt-5.4","openai/gpt-5.4-mini"],codex:["gpt-5.4-mini","gpt-5.4","gpt-5.3-codex"],gemini:["gemini-3.1-pro-preview","gemini-3.1-flash-preview","gemini-2.5-pro","gemini-2.5-flash"],factory:["claude-sonnet-4-6","claude-opus-4-6","gpt-5.4","gemini-3.1-pro-preview"],pi:["anthropic/claude-sonnet-4-6","anthropic/claude-opus-4-6","openai/gpt-5.4","google/gemini-2.5-flash"]},uA=Object.keys(Qd),$m=["docker","apple-container","podman"],Tu=["anthropic","sprites","e2b","vercel","daytona","fly","modal"];[...$m,...Tu];const Q8={anthropic:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key",placeholder:"sk-ant-..."},sprites:{key:"SPRITE_TOKEN",label:"Sprites.dev Token",placeholder:"user/org/.../token"},e2b:{key:"E2B_API_KEY",label:"E2B API Key",placeholder:"e2b_..."},vercel:{key:"VERCEL_TOKEN",label:"Vercel Token",placeholder:"..."},daytona:{key:"DAYTONA_API_KEY",label:"Daytona API Key",placeholder:"..."},fly:{key:"FLY_API_TOKEN",label:"Fly.io API Token",placeholder:"fo1_..."},modal:{key:"MODAL_TOKEN_ID",label:"Modal Token ID",placeholder:"..."}},Epe={claude:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key or OAuth Token"},codex:{key:"OPENAI_API_KEY",label:"OpenAI API Key"},gemini:{key:"GEMINI_API_KEY",label:"Gemini API Key"},factory:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key"},pi:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key"}};function yO(e){return e.includes("/")?!1:!["claude-","gpt-","o1-","o3-","o4-","codex-","chatgpt-","gemini-"].some(n=>e.startsWith(n))}function Cpe(e,t){if(!yO(t))return e==="opencode"||e==="pi"?t.startsWith("openai/")?{key:"OPENAI_API_KEY",label:"OpenAI API Key"}:t.startsWith("google/")||t.startsWith("gemini/")?{key:"GEMINI_API_KEY",label:"Gemini API Key"}:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key"}:Epe[e]}const Z8=x.createContext(void 0);function Dg(e){const t=x.useContext(Z8);if(t===void 0&&!e)throw new Error(Xt(47));return t}function _pe(){return{...G0(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const kpe={...X0,disabled:Te(e=>e.disabled),instantType:Te(e=>e.instantType),openMethod:Te(e=>e.openMethod),openChangeReason:Te(e=>e.openChangeReason),modal:Te(e=>e.modal),focusManagerModal:Te(e=>e.focusManagerModal),stickIfOpen:Te(e=>e.stickIfOpen),titleElementId:Te(e=>e.titleElementId),descriptionElementId:Te(e=>e.descriptionElementId),openOnHover:Te(e=>e.openOnHover),closeDelay:Te(e=>e.closeDelay),hasViewport:Te(e=>e.hasViewport)};class fA extends jg{constructor(n){const r={..._pe(),...n};r.open&&n?.mounted===void 0&&(r.mounted=!0);super(r,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new Ro,triggerElements:new mh},kpe);qt(this,"setOpen",(n,r)=>{const i=r.reason===or,o=r.reason===ja&&r.event.detail===0,a=!n&&(r.reason===Eg||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const l=()=>{const u={open:n,openChangeReason:r.reason},f=r.trigger?.id??null;(f||n)&&(u.activeTriggerId=f,u.activeTriggerElement=r.trigger??null),this.update(u)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(_U,()=>{this.set("stickIfOpen",!1)}),Fr.flushSync(l)):l(),o||a?this.set("instantType",o?"click":"dismiss"):r.reason===lc?this.set("instantType","focus"):this.set("instantType",void 0)});qt(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const i=pr(()=>new fA(r)).current,o=n??i;return Sg(i.disposeEffect),o}}function hz({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,modal:a=!1,handle:l,triggerId:u,defaultTriggerId:f=null}=e,d=fA.useStore(l?.store,{modal:a,open:r,openProp:n,activeTriggerId:f,triggerIdProp:u});bg(()=>{n===void 0&&d.state.open===!1&&r===!0&&d.update({open:!0,activeTriggerId:f})}),d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",u);const h=d.useState("open"),g=d.useState("payload");d.useContextCallback("onOpenChange",i),d.useContextCallback("onOpenChangeComplete",o);const{openMethod:v,triggerProps:b}=dw(h);Y0(d);const{forceUnmount:w}=W0(h,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});x.useEffect(()=>{h||d.context.stickIfOpenTimeout.clear()},[d,h]);const S=x.useCallback(L=>{const U=ct(L);return U.preventUnmountOnClose=()=>{d.set("preventUnmountingOnClose",!0)},U},[d]),E=x.useCallback(()=>{d.setOpen(!1,S(M0))},[d,S]);x.useImperativeHandle(e.actionsRef,()=>({unmount:w,close:E}),[w,E]);const k=Q0({popupStore:d,onOpenChange:d.setOpen}),O=Og(k,{outsidePressEvent:{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),j=NT(k),{getReferenceProps:A,getFloatingProps:T,getTriggerProps:N}=vc([O,j]),P=x.useMemo(()=>A(b),[A,b]),F=x.useMemo(()=>N(b),[N,b]),D=x.useMemo(()=>T(),[T]);d.useSyncedValues({modal:a,openMethod:v,activeTriggerProps:P,inactiveTriggerProps:F,popupProps:D,floatingRootContext:k,nested:La()!=null});const q=x.useMemo(()=>({store:d}),[d]);return m.jsx(Z8.Provider,{value:q,children:typeof t=="function"?t({payload:g}):t})}function Ope(e){return Dg(!0)?m.jsx(hz,{props:e}):m.jsx(fH,{children:m.jsx(hz,{props:e})})}const jpe=300,Tpe=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,handle:l,payload:u,openOnHover:f=!1,delay:d=jpe,closeDelay:h=0,id:g,style:v,...b}=t,w=Dg(!0),S=l?.store??w?.store;if(!S)throw new Error(Xt(74));const E=Br(g),k=S.useState("isTriggerActive",E),O=S.useState("floatingRootContext"),j=S.useState("isOpenedByTrigger",E),A=x.useRef(null),{registerTrigger:T,isMountedByThisTrigger:N}=K0(E,A,S,{payload:u,disabled:o,openOnHover:f,closeDelay:h}),P=S.useState("openChangeReason"),F=S.useState("stickIfOpen"),D=S.useState("openMethod"),q=S.useState("focusManagerModal"),L=AT(O,{enabled:O!=null&&f&&(D!=="touch"||P!==ja),mouseOnly:!0,move:!1,handleClose:RT(),restMs:d,delay:{close:h},triggerElementRef:A,isActiveTrigger:k,isClosing:()=>S.select("transitionStatus")==="ending"}),U=H0(O,{enabled:O!=null,stickIfOpen:F}),H=vc([U]),B=S.useState("triggerProps",N),z={disabled:o,open:j},{getButtonProps:V,buttonRef:Q}=Zo({disabled:o,native:a}),G=x.useMemo(()=>({open(X){return X&&P===ja?pb.open(X):J0.open(X)}}),[P]),I=vt("button",t,{state:z,ref:[Q,n,T,A],props:[H.getReferenceProps(),L,B,{[cT]:"",id:E},b,V],stateAttributesMapping:G}),{preFocusGuardRef:K,handlePreFocusGuardFocus:$,handleFocusTargetFocus:R}=I8(S,A);return k&&!q?m.jsxs(x.Fragment,{children:[m.jsx(cc,{ref:K,onFocus:$}),m.jsx(x.Fragment,{children:I},E),m.jsx(cc,{ref:S.context.triggerFocusTargetRef,onFocus:R})]}):m.jsx(x.Fragment,{children:I},E)}),J8=x.createContext(void 0);function Ape(){const e=x.useContext(J8);if(e===void 0)throw new Error(Xt(45));return e}const Npe=x.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=Dg();return o.useState("mounted")||r?m.jsx(J8.Provider,{value:r,children:m.jsx($0,{ref:n,...i})}):null}),eq=x.createContext(void 0);function Rpe(){const e=x.useContext(eq);if(!e)throw new Error(Xt(46));return e}const Ppe=x.forwardRef(function(t,n){const{render:r,className:i,anchor:o,positionMethod:a="absolute",side:l="bottom",align:u="center",sideOffset:f=0,alignOffset:d=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:S=uT,style:E,...k}=t,{store:O}=Dg(),j=Ape(),A=CT(),T=O.useState("floatingRootContext"),N=O.useState("mounted"),P=O.useState("open"),F=O.useState("openChangeReason"),D=O.useState("activeTriggerElement"),q=O.useState("modal"),L=O.useState("openMethod"),U=O.useState("positionerElement"),H=O.useState("instantType"),B=O.useState("transitionStatus"),z=O.useState("hasViewport"),V=x.useRef(null),Q=V0(U,!1,!1),G=ew({anchor:o,floatingRootContext:T,positionMethod:a,mounted:N,side:l,sideOffset:f,align:u,alignOffset:d,arrowPadding:v,collisionBoundary:h,collisionPadding:g,sticky:b,disableAnchorTracking:w,keepMounted:j,nodeId:A,collisionAvoidance:S,adaptiveOrigin:z?MT:void 0}),I=T.useState("domReferenceElement");Pe(()=>{const X=I,W=V.current;if(X&&(V.current=X),W&&X&&X!==W){O.set("instantType",void 0);const Z=new AbortController;return Q(()=>{O.set("instantType","trigger-change")},Z.signal),()=>{Z.abort()}}},[I,Q,O]);const K={open:P,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:H};oA(P&&q===!0&&F!==or,L==="touch",U,D);const $=x.useCallback(X=>{O.set("positionerElement",X)},[O]),R=tw(t,K,{styles:G.positionerStyles,transitionStatus:B,props:k,refs:[n,$],hidden:!N,inert:!P});return m.jsxs(eq.Provider,{value:G,children:[N&&q===!0&&F!==or&&m.jsx(fw,{ref:O.context.internalBackdropRef,inert:Ag(!P),cutout:D}),m.jsx(uH,{id:A,children:R})]})}),Mpe=x.createContext(void 0);function Ipe(){const[e,t]=x.useState(0),n=Le(()=>(t(i=>i+1),()=>{t(i=>Math.max(0,i-1))}));return{context:x.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Dpe(e){const{value:t,children:n}=e;return m.jsx(Mpe.Provider,{value:t,children:n})}const Lpe={...yc,...$s},zpe=x.forwardRef(function(t,n){const{className:r,render:i,initialFocus:o,finalFocus:a,style:l,...u}=t,{store:f}=Dg(),d=Rpe(),h=iA()!=null,{context:g,hasClosePart:v}=Ipe(),b=f.useState("open"),w=f.useState("openMethod"),S=f.useState("instantType"),E=f.useState("transitionStatus"),k=f.useState("popupProps"),O=f.useState("titleElementId"),j=f.useState("descriptionElementId"),A=f.useState("modal"),T=f.useState("mounted"),N=f.useState("openChangeReason"),P=f.useState("activeTriggerElement"),F=f.useState("floatingRootContext");Qo({open:b,ref:f.context.popupRef,onComplete(){b&&f.context.onOpenChangeComplete?.(!0)}});const D=f.useState("disabled"),q=f.useState("openOnHover"),L=f.useState("closeDelay");TT(F,{enabled:q&&!D,closeDelay:L});function U(G){return G==="touch"?f.context.popupRef.current:!0}const H=o===void 0?U:o,B={open:b,side:d.side,align:d.align,instant:S,transitionStatus:E},z=A!==!1&&v;f.useSyncedValue("focusManagerModal",z);const V=x.useCallback(G=>{f.set("popupElement",G)},[f]),Q=vt("div",t,{state:B,ref:[n,f.context.popupRef,V],props:[k,{"aria-labelledby":O,"aria-describedby":j,onKeyDown(G){h&&uw.has(G.key)&&G.stopPropagation()}},Tg(E),u],stateAttributesMapping:Lpe});return m.jsx(U0,{context:F,openInteractionType:w,modal:z,disabled:!T||N===or,initialFocus:H,returnFocus:a,restoreFocus:"popup",previousFocusableElement:fn(P)?P:void 0,nextFocusableElement:f.context.triggerFocusTargetRef,beforeContentFocusGuardRef:f.context.beforeContentFocusGuardRef,children:m.jsx(Dpe,{value:g,children:Q})})});function Fpe({...e}){return m.jsx(Ope,{"data-slot":"popover",...e})}function Bpe({...e}){return m.jsx(Tpe,{"data-slot":"popover-trigger",...e})}function $pe({className:e,align:t="center",alignOffset:n=0,side:r="bottom",sideOffset:i=4,...o}){return m.jsx(Npe,{children:m.jsx(Ppe,{align:t,alignOffset:n,side:r,sideOffset:i,className:"isolate z-50",children:m.jsx(zpe,{"data-slot":"popover-content",className:Ne("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o})})})}var pz=1,Upe=.9,Hpe=.8,qpe=.17,mC=.1,gC=.999,Vpe=.9999,Kpe=.99,Ype=/[\\\\\\/_+.#"@\\[\\(\\{&]/,Wpe=/[\\\\\\/_+.#"@\\[\\(\\{&]/g,Gpe=/[\\s-]/,tq=/[\\s-]/g;function xO(e,t,n,r,i,o,a){if(o===t.length)return i===e.length?pz:Kpe;var l=\`\${i},\${o}\`;if(a[l]!==void 0)return a[l];for(var u=r.charAt(o),f=n.indexOf(u,i),d=0,h,g,v,b;f>=0;)h=xO(e,t,n,r,f+1,o+1,a),h>d&&(f===i?h*=pz:Ype.test(e.charAt(f-1))?(h*=Hpe,v=e.slice(i,f-1).match(Wpe),v&&i>0&&(h*=Math.pow(gC,v.length))):Gpe.test(e.charAt(f-1))?(h*=Upe,b=e.slice(i,f-1).match(tq),b&&i>0&&(h*=Math.pow(gC,b.length))):(h*=qpe,i>0&&(h*=Math.pow(gC,f-i))),e.charAt(f)!==t.charAt(o)&&(h*=Vpe)),(h<mC&&n.charAt(f-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(f-1)!==r.charAt(o))&&(g=xO(e,t,n,r,f+1,o+2,a),g*mC>h&&(h=g*mC)),h>d&&(d=h),f=n.indexOf(u,f+1);return a[l]=d,d}function mz(e){return e.toLowerCase().replace(tq," ")}function Xpe(e,t,n){return e=n&&n.length>0?\`\${e+" "+n.join(" ")}\`:e,xO(e,t,mz(e),mz(t),0,0,{})}function tc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function gz(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fc(...e){return t=>{let n=!1;const r=e.map(i=>{const o=gz(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():gz(e[i],null)}}}}function af(...e){return x.useCallback(fc(...e),e)}function Qpe(e,t){const n=x.createContext(t),r=o=>{const{children:a,...l}=o,u=x.useMemo(()=>l,Object.values(l));return m.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(\`\\\`\${o}\\\` must be used within \\\`\${e}\\\`\`)}return[r,i]}function Zpe(e,t=[]){let n=[];function r(o,a){const l=x.createContext(a),u=n.length;n=[...n,a];const f=h=>{const{scope:g,children:v,...b}=h,w=g?.[e]?.[u]||l,S=x.useMemo(()=>b,Object.values(b));return m.jsx(w.Provider,{value:S,children:v})};f.displayName=o+"Provider";function d(h,g){const v=g?.[e]?.[u]||l,b=x.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(\`\\\`\${h}\\\` must be used within \\\`\${o}\\\`\`)}return[f,d]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(l){const u=l?.[e]||o;return x.useMemo(()=>({[\`__scope\${e}\`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,Jpe(i,...t)]}function Jpe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((l,{useScope:u,scopeName:f})=>{const h=u(o)[\`__scope\${f}\`];return{...l,...h}},{});return x.useMemo(()=>({[\`__scope\${t.scopeName}\`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Um=globalThis?.document?x.useLayoutEffect:()=>{},eme=ah[" useId ".trim().toString()]||(()=>{}),tme=0;function Cs(e){const[t,n]=x.useState(eme());return Um(()=>{n(r=>r??String(tme++))},[e]),t?\`radix-\${t}\`:""}var nme=ah[" useInsertionEffect ".trim().toString()]||Um;function rme({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=ime({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const h=d.current;h!==l&&console.warn(\`\${r} is changing from \${h?"controlled":"uncontrolled"} to \${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.\`),d.current=l},[l,r])}const f=x.useCallback(d=>{if(l){const h=ome(d)?d(e):d;h!==e&&a.current?.(h)}else o(d)},[l,e,o,a]);return[u,f]}function ime({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return nme(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function ome(e){return typeof e=="function"}function Lg(e){const t=ame(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,l=x.Children.toArray(o),u=l.find(lme);if(u){const f=u.props.children,d=l.map(h=>h===u?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return m.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,d):null})}return m.jsx(t,{...a,ref:i,children:o})});return n.displayName=\`\${e}.Slot\`,n}function ame(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=ume(i),l=cme(o,i.props);return i.type!==x.Fragment&&(l.ref=r?fc(r,a):a),x.cloneElement(i,l)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=\`\${e}.SlotClone\`,t}var sme=Symbol("radix.slottable");function lme(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sme}function cme(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ume(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nq=fme.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{});function dme(e,t){e&&Fr.flushSync(()=>e.dispatchEvent(t))}function Hm(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function hme(e,t=globalThis?.document){const n=Hm(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pme="DismissableLayer",bO="dismissableLayer.update",mme="dismissableLayer.pointerDownOutside",gme="dismissableLayer.focusOutside",vz,rq=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iq=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=e,f=x.useContext(rq),[d,h]=x.useState(null),g=d?.ownerDocument??globalThis?.document,[,v]=x.useState({}),b=af(t,N=>h(N)),w=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(S),k=d?w.indexOf(d):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,j=k>=E,A=xme(N=>{const P=N.target,F=[...f.branches].some(D=>D.contains(P));!j||F||(i?.(N),a?.(N),N.defaultPrevented||l?.())},g),T=bme(N=>{const P=N.target;[...f.branches].some(D=>D.contains(P))||(o?.(N),a?.(N),N.defaultPrevented||l?.())},g);return hme(N=>{k===f.layers.size-1&&(r?.(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},g),x.useEffect(()=>{if(d)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(vz=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),yz(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=vz)}},[d,g,n,f]),x.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),yz())},[d,f]),x.useEffect(()=>{const N=()=>v({});return document.addEventListener(bO,N),()=>document.removeEventListener(bO,N)},[]),m.jsx(nq.div,{...u,ref:b,style:{pointerEvents:O?j?"auto":"none":void 0,...e.style},onFocusCapture:tc(e.onFocusCapture,T.onFocusCapture),onBlurCapture:tc(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:tc(e.onPointerDownCapture,A.onPointerDownCapture)})});iq.displayName=pme;var vme="DismissableLayerBranch",yme=x.forwardRef((e,t)=>{const n=x.useContext(rq),r=x.useRef(null),i=af(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),m.jsx(nq.div,{...e,ref:i})});yme.displayName=vme;function xme(e,t=globalThis?.document){const n=Hm(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){oq(mme,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function bme(e,t=globalThis?.document){const n=Hm(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&oq(gme,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yz(){const e=new CustomEvent(bO);document.dispatchEvent(e)}function oq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dme(i,o):i.dispatchEvent(o)}var wme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sme=wme.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{}),vC="focusScope.autoFocusOnMount",yC="focusScope.autoFocusOnUnmount",xz={bubbles:!1,cancelable:!0},Eme="FocusScope",aq=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,u]=x.useState(null),f=Hm(i),d=Hm(o),h=x.useRef(null),g=af(t,w=>u(w)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(O){if(v.paused||!l)return;const j=O.target;l.contains(j)?h.current=j:jl(h.current,{select:!0})},S=function(O){if(v.paused||!l)return;const j=O.relatedTarget;j!==null&&(l.contains(j)||jl(h.current,{select:!0}))},E=function(O){if(document.activeElement===document.body)for(const A of O)A.removedNodes.length>0&&jl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const k=new MutationObserver(E);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),k.disconnect()}}},[r,l,v.paused]),x.useEffect(()=>{if(l){wz.add(v);const w=document.activeElement;if(!l.contains(w)){const E=new CustomEvent(vC,xz);l.addEventListener(vC,f),l.dispatchEvent(E),E.defaultPrevented||(Cme(Tme(sq(l)),{select:!0}),document.activeElement===w&&jl(l))}return()=>{l.removeEventListener(vC,f),setTimeout(()=>{const E=new CustomEvent(yC,xz);l.addEventListener(yC,d),l.dispatchEvent(E),E.defaultPrevented||jl(w??document.body,{select:!0}),l.removeEventListener(yC,d),wz.remove(v)},0)}}},[l,f,d,v]);const b=x.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(S&&E){const k=w.currentTarget,[O,j]=_me(k);O&&j?!w.shiftKey&&E===j?(w.preventDefault(),n&&jl(O,{select:!0})):w.shiftKey&&E===O&&(w.preventDefault(),n&&jl(j,{select:!0})):E===k&&w.preventDefault()}},[n,r,v.paused]);return m.jsx(Sme.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});aq.displayName=Eme;function Cme(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jl(r,{select:t}),document.activeElement!==n)return}function _me(e){const t=sq(e),n=bz(t,e),r=bz(t.reverse(),e);return[n,r]}function sq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bz(e,t){for(const n of e)if(!kme(n,{upTo:t}))return n}function kme(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ome(e){return e instanceof HTMLInputElement&&"select"in e}function jl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ome(e)&&t&&e.select()}}var wz=jme();function jme(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Sz(e,t),e.unshift(t)},remove(t){e=Sz(e,t),e[0]?.resume()}}}function Sz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tme(e){return e.filter(t=>t.tagName!=="A")}var Ame=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nme=Ame.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{}),Rme="Portal",lq=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);Um(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?cU.createPortal(m.jsx(Nme.div,{...r,ref:t}),a):null});lq.displayName=Rme;function Pme(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var vw=e=>{const{present:t,children:n}=e,r=Mme(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=af(r.ref,Ime(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};vw.displayName="Presence";function Mme(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[l,u]=Pme(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Gy(r.current);o.current=l==="mounted"?f:"none"},[l]),Um(()=>{const f=r.current,d=i.current;if(d!==e){const g=o.current,v=Gy(f);e?u("MOUNT"):v==="none"||f?.display==="none"?u("UNMOUNT"):u(d&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Um(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,h=v=>{const w=Gy(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(o.current=Gy(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Gy(e){return e?.animationName||"none"}function Ime(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zg=Dme.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{}),xC=0;function Lme(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ez()),document.body.insertAdjacentElement("beforeend",e[1]??Ez()),xC++,()=>{xC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xC--}},[])}function Ez(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ya=function(){return ya=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ya.apply(this,arguments)};function cq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zme(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Bx="right-scroll-bar-position",$x="width-before-scroll-bar",Fme="with-scroll-bars-hidden",Bme="--removed-body-scroll-bar-size";function bC(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $me(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Ume=typeof window<"u"?x.useLayoutEffect:x.useEffect,Cz=new WeakMap;function Hme(e,t){var n=$me(null,function(r){return e.forEach(function(i){return bC(i,r)})});return Ume(function(){var r=Cz.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(l){o.has(l)||bC(l,null)}),o.forEach(function(l){i.has(l)||bC(l,a)})}Cz.set(n,e)},[e]),n}function qme(e){return e}function Vme(e,t){t===void 0&&(t=qme);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not \`read\` from an \`assigned\` medium. \`read\` could be used only with \`useMedium\`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var u=function(){var d=a;a=[],d.forEach(o)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(d){a.push(d),f()},filter:function(d){return a=a.filter(d),n}}}};return i}function Kme(e){e===void 0&&(e={});var t=Vme(null);return t.options=ya({async:!0,ssr:!1},e),t}var uq=function(e){var t=e.sideCar,n=cq(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide \`sideCar\` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,ya({},n))};uq.isSideCarExport=!0;function Yme(e,t){return e.useMedium(t),uq}var fq=Kme(),wC=function(){},yw=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:wC,onWheelCapture:wC,onTouchMoveCapture:wC}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,u=e.className,f=e.removeScrollBar,d=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,E=e.as,k=E===void 0?"div":E,O=e.gapMode,j=cq(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,T=Hme([n,t]),N=ya(ya({},j),i);return x.createElement(x.Fragment,null,d&&x.createElement(A,{sideCar:fq,removeScrollBar:f,shards:h,noRelative:v,noIsolation:b,inert:w,setCallbacks:o,allowPinchZoom:!!S,lockRef:n,gapMode:O}),a?x.cloneElement(x.Children.only(l),ya(ya({},N),{ref:T})):x.createElement(k,ya({},N,{className:u,ref:T}),l))});yw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yw.classNames={fullWidth:$x,zeroRight:Bx};var Wme=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gme(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wme();return t&&e.setAttribute("nonce",t),e}function Xme(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qme(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Zme=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gme())&&(Xme(t,n),Qme(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jme=function(){var e=Zme();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dq=function(){var e=Jme(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},ege={left:0,top:0,right:0,gap:0},SC=function(e){return parseInt(e||"",10)||0},tge=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[SC(n),SC(r),SC(i)]},nge=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ege;var t=tge(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rge=dq(),wd="data-scroll-locked",ige=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),\`
|
|
412
|
+
*/const Afe=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Nfe=it("zap",Afe),Rfe=({...e})=>{const{theme:t="system"}=wce();return m.jsx(Wce,{theme:t,className:"toaster group",icons:{success:m.jsx(Sue,{className:"size-4"}),info:m.jsx(HT,{className:"size-4"}),warning:m.jsx(a8,{className:"size-4"}),error:m.jsx(que,{className:"size-4"}),loading:m.jsx(rw,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})};function VT(e){return vt(e.defaultTagName??"div",e,e)}const GL=e=>typeof e=="boolean"?\`\${e}\`:e===0?"0":e,XL=ln,Rg=(e,t)=>n=>{var r;if(t?.variants==null)return XL(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(f=>{const d=n?.[f],h=o?.[f];if(d===null)return null;const g=GL(d)||GL(h);return i[f][g]}),l=n&&Object.entries(n).reduce((f,d)=>{let[h,g]=d;return g===void 0||(f[h]=g),f},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,d)=>{let{class:h,className:g,...v}=d;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...o,...l}[w]):{...o,...l}[w]===S})?[...f,h,g]:f},[]);return XL(e,a,u,n?.class,n?.className)},hC=768;function Pfe(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(\`(max-width: \${hC-1}px)\`),r=()=>{t(window.innerWidth<hC)};return n.addEventListener("change",r),t(window.innerWidth<hC),()=>n.removeEventListener("change",r)},[]),!!e}const s8=x.createContext(void 0);function KT(e=!1){const t=x.useContext(s8);if(t===void 0&&!e)throw new Error(Xt(16));return t}function Mfe(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,a=r&&t!==!1,l=r&&t===!1;return{props:x.useMemo(()=>{const f={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(f.tabIndex=i,!o&&n&&(f.tabIndex=t?i:-1)),(o&&(t||a)||!o&&n)&&(f["aria-disabled"]=n),o&&(!t||l)&&(f.disabled=n),f},[r,n,t,a,l,o,i])}}function Zo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:o}=e,a=x.useRef(null),l=KT(!0),u=o??l!==void 0,{props:f}=Mfe({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:i}),d=x.useCallback(()=>{const v=a.current;pC(v)&&u&&t&&f.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,f.disabled,u]);Pe(d,[d]);const h=x.useCallback((v={})=>{const{onClick:b,onMouseDown:w,onKeyUp:S,onKeyDown:E,onPointerDown:k,...O}=v;return Mo({type:i?"button":void 0,onClick(A){if(t){A.preventDefault();return}b?.(A)},onMouseDown(A){t||w?.(A)},onKeyDown(A){if(t||(cb(A),E?.(A),A.baseUIHandlerPrevented))return;const T=A.target===A.currentTarget,N=A.currentTarget,P=pC(N),F=!i&&Ife(N),D=T&&(i?P:!F),q=A.key==="Enter",L=A.key===" ",U=N.getAttribute("role"),H=U?.startsWith("menuitem")||U==="option"||U==="gridcell";if(T&&u&&L){if(A.defaultPrevented&&H)return;A.preventDefault(),F||i&&P?(N.click(),A.preventBaseUIHandler()):D&&(b?.(A),A.preventBaseUIHandler());return}D&&(!i&&(L||q)&&A.preventDefault(),!i&&q&&b?.(A))},onKeyUp(A){if(!t){if(cb(A),S?.(A),A.target===A.currentTarget&&i&&u&&pC(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!u&&A.key===" "&&b?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}k?.(A)}},i?void 0:{role:"button"},f,O)},[t,f,u,i]),g=Le(v=>{a.current=v,d()});return{getButtonProps:h,buttonRef:g}}function pC(e){return fn(e)&&e.tagName==="BUTTON"}function Ife(e){return!!(e?.tagName==="A"&&e?.href)}const Dfe=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,focusableWhenDisabled:a=!1,nativeButton:l=!0,style:u,...f}=t,{getButtonProps:d,buttonRef:h}=Zo({disabled:o,focusableWhenDisabled:a,native:l});return vt("button",t,{state:{disabled:o},ref:[n,h],props:[f,d]})}),Lfe=Rg("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Fe({className:e,variant:t="default",size:n="default",...r}){return m.jsx(Dfe,{"data-slot":"button",className:Ne(Lfe({variant:t,size:n,className:e})),...r})}let QL=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const zfe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},um={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ffe={disabled:!1,...um},YT={valid(e){return e===null?null:e?{[QL.valid]:""}:{[QL.invalid]:""}}},Bfe=x.createContext({invalid:void 0,name:void 0,validityData:{state:zfe,errors:[],error:"",value:"",initialValue:null},setValidityData:Yr,disabled:void 0,touched:um.touched,setTouched:Yr,dirty:um.dirty,setDirty:Yr,filled:um.filled,setFilled:Yr,focused:um.focused,setFocused:Yr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Ffe,markedDirtyRef:{current:!1},registerFieldControl:Yr,validation:{getValidationProps:(e=Wn)=>e,getInputValidationProps:(e=Wn)=>e,inputRef:{current:null},commit:async()=>{}}});function gh(e=!0){const t=x.useContext(Bfe);if(t.setValidityData===Yr&&!e)throw new Error(Xt(28));return t}const $fe=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Yr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function l8(){return x.useContext($fe)}const Ufe=x.createContext({controlId:void 0,registerControlId:Yr,labelId:void 0,setLabelId:Yr,messageIds:[],setMessageIds:Yr,getDescriptionProps:e=>e});function sw(){return x.useContext(Ufe)}function zu({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=x.useRef(e!==void 0),[o,a]=x.useState(t),l=i?e:o,u=x.useCallback(f=>{i||a(f)},[]);return[l,u]}function WT(e,t){const{enabled:n=!0,getValue:r,id:i,value:o}=t,{registerFieldControl:a}=gh(),l=x.useRef(null);l.current||(l.current=Symbol()),Pe(()=>{const u=l.current;if(!(!u||!n))return a(u,{controlRef:e,getValue:r,id:i,value:o}),()=>{a(u,void 0)}},[e,n,r,i,a,o])}function lw(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=sw(),a=Br(t),l=n?i:void 0,u=pr(()=>Symbol("labelable-control")),f=x.useRef(!1),d=x.useRef(t!=null),h=Le(()=>{!f.current||o===Yr||(f.current=!1,o(u.current,void 0))});return Pe(()=>{if(o===Yr)return;let g;if(n){const v=r?.current;Dt(v)&&v.closest("label")!=null?g=t??null:g=l??a}else if(t!=null)d.current=!0,g=t;else if(d.current)g=a;else{h();return}if(g===void 0){h();return}f.current=!0,o(u.current,g)},[t,r,l,o,n,a,u,h]),x.useEffect(()=>h,[h]),i??a}const Hfe=x.forwardRef(function(t,n){const{render:r,className:i,id:o,name:a,value:l,disabled:u=!1,onValueChange:f,defaultValue:d,autoFocus:h=!1,style:g,...v}=t,{state:b,name:w,disabled:S,setTouched:E,setDirty:k,validityData:O,setFocused:j,setFilled:A,validationMode:T,validation:N}=gh(),P=S||u,F=w??a,D={...b,disabled:P},{labelId:q}=sw(),L=lw({id:o});Pe(()=>{const G=l!=null;N.inputRef.current?.value||G&&l!==""?A(!0):G&&l===""&&A(!1)},[N.inputRef,A,l]);const U=x.useRef(null);Pe(()=>{h&&U.current===Oi(jt(U.current))&&j(!0)},[h,j]);const[H]=zu({controlled:l,default:d,name:"FieldControl",state:"value"}),B=l!==void 0,z=B?H:void 0,V=Le(()=>N.inputRef.current?.value);return WT(N.inputRef,{id:L,value:z,getValue:V}),vt("input",t,{ref:[n,U],state:D,props:[{id:L,disabled:P,name:F,ref:N.inputRef,"aria-labelledby":q,autoFocus:h,...B?{value:z}:{defaultValue:d},onChange(G){const I=G.currentTarget.value;f?.(I,ct(Wo,G.nativeEvent)),k(I!==O.initialValue),A(I!=="")},onFocus(){j(!0)},onBlur(G){E(!0),j(!1),T==="onBlur"&&N.commit(G.currentTarget.value)},onKeyDown(G){G.currentTarget.tagName==="INPUT"&&G.key==="Enter"&&(E(!0),N.commit(G.currentTarget.value))}},N.getInputValidationProps(),v],stateAttributesMapping:YT})}),qfe=x.forwardRef(function(t,n){return m.jsx(Hfe,{ref:n,...t})});function en({className:e,type:t,...n}){return m.jsx(qfe,{type:t,"data-slot":"input",className:Ne("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}const Vfe=x.forwardRef(function(t,n){const{className:r,render:i,orientation:o="horizontal",style:a,...l}=t;return vt("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},l]})});function Kfe({className:e,orientation:t="horizontal",...n}){return m.jsx(Vfe,{"data-slot":"separator",orientation:t,className:Ne("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const GT=x.createContext(void 0);function Us(e){const t=x.useContext(GT);if(e===!1&&t===void 0)throw new Error(Xt(27));return t}const Yfe={...yc,...$s},XT=x.forwardRef(function(t,n){const{render:r,className:i,style:o,forceRender:a=!1,...l}=t,{store:u}=Us(),f=u.useState("open"),d=u.useState("nested"),h=u.useState("mounted"),g=u.useState("transitionStatus");return vt("div",t,{state:{open:f,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:Yfe,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!d})}),cw=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,style:l,...u}=t,{store:f}=Us(),d=f.useState("open");function h(w){d&&f.setOpen(!1,ct(Roe,w.nativeEvent))}const{getButtonProps:g,buttonRef:v}=Zo({disabled:o,native:a});return vt("button",t,{state:{disabled:o},ref:[n,v],props:[{onClick:h},u,g]})}),c8=x.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...l}=t,{store:u}=Us(),f=Br(a);return u.useSyncedValueWithCleanup("descriptionElementId",f),vt("p",t,{ref:n,props:[{id:f},l]})});let Wfe=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Gfe=(function(e){return e[e.open=fu.open]="open",e[e.closed=fu.closed]="closed",e[e.startingStyle=fu.startingStyle]="startingStyle",e[e.endingStyle=fu.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const u8=x.createContext(void 0);function Xfe(){const e=x.useContext(u8);if(e===void 0)throw new Error(Xt(26));return e}const Jl="ArrowUp",vs="ArrowDown",Fu="ArrowLeft",ec="ArrowRight",vh="Home",yh="End",f8=new Set([Fu,ec]),Qfe=new Set([Fu,ec,vh,yh]),d8=new Set([Jl,vs]),Zfe=new Set([Jl,vs,vh,yh]),h8=new Set([...f8,...d8]),Jfe=new Set([...h8,vh,yh]),uw=new Set([Jl,vs,Fu,ec,vh,yh]),ede="Shift",tde="Control",nde="Alt",rde="Meta",ide=new Set([ede,tde,nde,rde]);function ode(e){return fn(e)&&e.tagName==="INPUT"}function ZL(e){return!!(ode(e)&&e.selectionStart!=null||fn(e)&&e.tagName==="TEXTAREA")}function JL(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,o=e.scrollTop;const a=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=ez(e,t,"left"),f=Uy(e),d=Uy(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight?i=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+f.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+f.scrollPaddingLeft&&(i=u-d.scrollMarginLeft-f.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginRight<e.scrollLeft+f.scrollPaddingLeft?i=u-d.scrollMarginLeft-f.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight&&(i=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+f.scrollPaddingRight))}if(l&&r!=="horizontal"){const u=ez(e,t,"top"),f=Uy(e),d=Uy(t);u-d.scrollMarginTop<e.scrollTop+f.scrollPaddingTop?o=u-d.scrollMarginTop-f.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-f.scrollPaddingBottom&&(o=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+f.scrollPaddingBottom)}e.scrollTo({left:i,top:o,behavior:"auto"})}function ez(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Uy(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const ade={...yc,...$s,nestedDialogOpen(e){return e?{[Gfe.nestedDialogOpen]:""}:null}},QT=x.forwardRef(function(t,n){const{className:r,finalFocus:i,initialFocus:o,render:a,style:l,...u}=t,{store:f}=Us(),d=f.useState("descriptionElementId"),h=f.useState("disablePointerDismissal"),g=f.useState("floatingRootContext"),v=f.useState("popupProps"),b=f.useState("modal"),w=f.useState("mounted"),S=f.useState("nested"),E=f.useState("nestedOpenDialogCount"),k=f.useState("open"),O=f.useState("openMethod"),j=f.useState("titleElementId"),A=f.useState("transitionStatus"),T=f.useState("role");Xfe(),Qo({open:k,ref:f.context.popupRef,onComplete(){k&&f.context.onOpenChangeComplete?.(!0)}});function N(L){return L==="touch"?f.context.popupRef.current:!0}const P=o===void 0?N:o,F=E>0,q=vt("div",t,{state:{open:k,nested:S,transitionStatus:A,nestedDialogOpen:F},props:[v,{"aria-labelledby":j??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!w,onKeyDown(L){uw.has(L.key)&&L.stopPropagation()},style:{[Wfe.nestedDialogs]:E}},u],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:ade});return m.jsx(U0,{context:g,openInteractionType:O,disabled:!w,closeOnFocusOut:!h,initialFocus:P,returnFocus:i,modal:b!==!1,restoreFocus:"popup",children:q})}),fw=x.forwardRef(function(t,n){const{cutout:r,...i}=t;let o;if(r){const a=r.getBoundingClientRect();o=\`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,\${a.left}px \${a.top}px,\${a.left}px \${a.bottom}px,\${a.right}px \${a.bottom}px,\${a.right}px \${a.top}px,\${a.left}px \${a.top}px)\`}return m.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),ZT=x.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=Us(),a=o.useState("mounted"),l=o.useState("modal"),u=o.useState("open");return a||r?m.jsx(u8.Provider,{value:r,children:m.jsxs($0,{ref:n,...i,children:[a&&l===!0&&m.jsx(fw,{ref:o.context.internalBackdropRef,inert:Ag(!u)}),t.children]})}):null});let tz={},nz={},rz="";function sde(e){if(typeof document>"u")return!1;const t=jt(e);return In(t).innerWidth-t.documentElement.clientWidth>0}function lde(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=jt(e),r=n.documentElement,i=n.body,o=pc(r)?r:i,a=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const u=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=a,r.style.scrollbarGutter=l,u===f}function cde(e){const t=jt(e),n=t.documentElement,r=t.body,i=pc(n)?n:r,o={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,o)}}function ude(e){const t=jt(e),n=t.documentElement,r=t.body,i=In(n);let o=0,a=0,l=!1;const u=Vn.create();if(R0&&(i.visualViewport?.scale??1)!==1)return()=>{};function f(){const v=i.getComputedStyle(n),b=i.getComputedStyle(r),E=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,a=n.scrollLeft,tz={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},rz=n.style.scrollBehavior,nz={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const k=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,j=v.overflowY==="scroll"||b.overflowY==="scroll",A=v.overflowX==="scroll"||b.overflowX==="scroll",T=Math.max(0,i.innerWidth-r.clientWidth),N=Math.max(0,i.innerHeight-r.clientHeight),P=parseFloat(b.marginTop)+parseFloat(b.marginBottom),F=parseFloat(b.marginLeft)+parseFloat(b.marginRight),D=pc(n)?n:r;if(l=lde(e),l){n.style.scrollbarGutter=E,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(k||j)&&(n.style.overflowY="scroll"),(O||A)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||N?\`calc(100dvh - \${P+N}px)\`:"100dvh",width:F||T?\`calc(100vw - \${F+T}px)\`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,tz),Object.assign(r.style,nz),l||(n.scrollTop=o,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=rz)}function h(){d(),u.request(f)}f();const g=kt(i,"resize",h);return()=>{u.cancel(),d(),typeof i.removeEventListener=="function"&&g()}}class fde{constructor(){qt(this,"lockCount",0);qt(this,"restore",null);qt(this,"timeoutLock",Ro.create());qt(this,"timeoutUnlock",Ro.create());qt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});qt(this,"unlock",()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=jt(t).documentElement,i=In(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Yr;return}const o=vU||!sde(t);this.restore=o?cde(t):ude(t)}}const dde=new fde;function p8(e=!0,t=null){Pe(()=>{if(e)return dde.acquire(t)},[e,t])}function hde(e){const t=x.useRef(""),n=x.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:x.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function JT(e,t){const n=x.useRef(e),r=Le(t);Pe(()=>{n.current!==e&&r(n.current)},[e,r]),Pe(()=>{n.current=e},[e])}function dw(e){const[t,n]=x.useState(null),r=Le((a,l)=>{e||n(l||(vU?"touch":""))});JT(e,a=>{a&&!e&&n(null)});const{onClick:i,onPointerDown:o}=hde(r);return x.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:o}}),[t,i,o])}function m8(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,o=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),u=t.useState("popupElement"),{openMethod:f,triggerProps:d}=dw(o);Y0(t);const{forceUnmount:h}=W0(o,t),g=Le(L=>{const U=ct(L);return U.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},U}),v=x.useCallback(()=>{t.setOpen(!1,g(M0))},[t,g]);x.useImperativeHandle(r,()=>({unmount:h,close:v}),[h,v]);const b=Q0({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[w,S]=x.useState(0),[E,k]=x.useState(0),O=w===0,j=NT(b),A=Og(b,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(L){if(!t.context.outsidePressEnabledRef.current||"button"in L&&L.button!==0||"touches"in L&&L.touches.length!==1)return!1;const U=Sr(L);if(O&&!a){const H=U;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===H||t.context.backdropRef.current===H||lt(H,u)&&!H?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:O});p8(o&&l===!0,u);const{getReferenceProps:T,getFloatingProps:N,getTriggerProps:P}=vc([j,A]);t.useContextCallback("onNestedDialogOpen",(L,U)=>{S(L),k(U)}),t.useContextCallback("onNestedDialogClose",()=>{S(0),k(0)}),x.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w+1,E+(i?1:0)),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[i,o,w,E,n]);const F=x.useMemo(()=>T(d),[T,d]),D=x.useMemo(()=>P(d),[P,d]),q=x.useMemo(()=>N(),[N]);t.useSyncedValues({openMethod:f,activeTriggerProps:F,inactiveTriggerProps:D,popupProps:q,floatingRootContext:b,nestedOpenDialogCount:w,nestedOpenDrawerCount:E})}const pde={...X0,modal:Te(e=>e.modal),nested:Te(e=>e.nested),nestedOpenDialogCount:Te(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Te(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Te(e=>e.disablePointerDismissal),openMethod:Te(e=>e.openMethod),descriptionElementId:Te(e=>e.descriptionElementId),titleElementId:Te(e=>e.titleElementId),viewportElement:Te(e=>e.viewportElement),role:Te(e=>e.role)};class hw extends jg{constructor(n){super(mde(n),{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new mh,onOpenChange:void 0,onOpenChangeComplete:void 0},pde);qt(this,"setOpen",(n,r)=>{if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const i={open:n},o=r.trigger?.id??null;(o||n)&&(i.activeTriggerId=o,i.activeTriggerElement=r.trigger??null),this.update(i)})}static useStore(n,r){const i=pr(()=>new hw(r)).current;return n??i}}function mde(e={}){return{...G0(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}const hO=x.createContext(!1);function g8(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,disablePointerDismissal:a=!1,modal:l=!0,actionsRef:u,handle:f,triggerId:d,defaultTriggerId:h=null}=e,g=Us(!0),v=x.useContext(hO),b=!!g,w=hw.useStore(f?.store,{open:r,openProp:n,activeTriggerId:h,triggerIdProp:d,modal:l,disablePointerDismissal:a,nested:b});bg(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:h})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",d),w.useSyncedValues({disablePointerDismissal:a,nested:b,modal:l}),w.useContextCallback("onOpenChange",i),w.useContextCallback("onOpenChangeComplete",o);const S=w.useState("payload");m8({store:w,actionsRef:u,parentContext:g?.store.context,isDrawer:v});const E=x.useMemo(()=>({store:w}),[w]);return m.jsx(hO.Provider,{value:!1,children:m.jsx(GT.Provider,{value:E,children:typeof t=="function"?t({payload:S}):t})})}const eA=x.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...l}=t,{store:u}=Us(),f=Br(a);return u.useSyncedValueWithCleanup("titleElementId",f),vt("h2",t,{ref:n,props:[{id:f},l]})}),gde=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,id:l,payload:u,handle:f,style:d,...h}=t,g=Us(!0),v=f?.store??g?.store;if(!v)throw new Error(Xt(79));const b=Br(l),w=v.useState("floatingRootContext"),S=v.useState("isOpenedByTrigger",b),E=x.useRef(null),{registerTrigger:k,isMountedByThisTrigger:O}=K0(b,E,v,{payload:u}),{getButtonProps:j,buttonRef:A}=Zo({disabled:o,native:a}),T=H0(w,{enabled:w!=null}),N=vc([T]),P={disabled:o,open:S},F=v.useState("triggerProps",O);return vt("button",t,{state:P,ref:[A,n,k,E],props:[N.getReferenceProps(),F,{[cT]:"",id:b},h,j],stateAttributesMapping:J0})});function vde({...e}){return m.jsx(g8,{"data-slot":"sheet",...e})}function yde({...e}){return m.jsx(ZT,{"data-slot":"sheet-portal",...e})}function xde({className:e,...t}){return m.jsx(XT,{"data-slot":"sheet-overlay",className:Ne("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function bde({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return m.jsxs(yde,{children:[m.jsx(xde,{}),m.jsxs(QT,{"data-slot":"sheet-content","data-side":n,className:Ne("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...i,children:[t,r&&m.jsxs(cw,{"data-slot":"sheet-close",render:m.jsx(Fe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[m.jsx(uc,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wde({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-header",className:Ne("flex flex-col gap-0.5 p-4",e),...t})}function Sde({className:e,...t}){return m.jsx(eA,{"data-slot":"sheet-title",className:Ne("font-heading text-base font-medium text-foreground",e),...t})}function Ede({className:e,...t}){return m.jsx(c8,{"data-slot":"sheet-description",className:Ne("text-sm text-muted-foreground",e),...t})}const Cde="sidebar_state",_de=3600*24*7,kde="16rem",Ode="18rem",jde="3rem",Tde="b",v8=x.createContext(null);function pw(){const e=x.useContext(v8);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Ade({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:o,...a}){const l=Pfe(),[u,f]=x.useState(!1),[d,h]=x.useState(e),g=t??d,v=x.useCallback(E=>{const k=typeof E=="function"?E(g):E;n?n(k):h(k),document.cookie=\`\${Cde}=\${k}; path=/; max-age=\${_de}\`},[n,g]),b=x.useCallback(()=>l?f(E=>!E):v(E=>!E),[l,v,f]);x.useEffect(()=>{const E=k=>{k.key===Tde&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),b())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[b]);const w=g?"expanded":"collapsed",S=x.useMemo(()=>({state:w,open:g,setOpen:v,isMobile:l,openMobile:u,setOpenMobile:f,toggleSidebar:b}),[w,g,v,l,u,f,b]);return m.jsx(v8.Provider,{value:S,children:m.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":kde,"--sidebar-width-icon":jde,...i},className:Ne("group/sidebar-wrapper flex h-svh w-full overflow-hidden has-data-[variant=inset]:bg-sidebar",r),...a,children:o})})}function Nde({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,dir:o,...a}){const{isMobile:l,state:u,openMobile:f,setOpenMobile:d}=pw();return n==="none"?m.jsx("div",{"data-slot":"sidebar",className:Ne("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...a,children:i}):l?m.jsx(vde,{open:f,onOpenChange:d,...a,children:m.jsxs(bde,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ode},side:e,children:[m.jsxs(wde,{className:"sr-only",children:[m.jsx(Sde,{children:"Sidebar"}),m.jsx(Ede,{children:"Displays the mobile sidebar."})]}),m.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):m.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[m.jsx("div",{"data-slot":"sidebar-gap",className:Ne("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),m.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Ne("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:m.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:i})})]})}function Rde({className:e,onClick:t,...n}){const{toggleSidebar:r}=pw();return m.jsxs(Fe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Ne(e),onClick:i=>{t?.(i),r()},...n,children:[m.jsx(Xue,{}),m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Pde({className:e,...t}){const{toggleSidebar:n}=pw();return m.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:Ne("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function Mde({className:e,...t}){return m.jsx("main",{"data-slot":"sidebar-inset",className:Ne("relative flex w-full flex-1 flex-col min-h-0 bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Ide({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Ne("flex flex-col gap-2 p-2",e),...t})}function Dde({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Ne("flex flex-col gap-2 p-2",e),...t})}function Lde({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Ne("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function zde({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Ne("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Fde({className:e,render:t,...n}){return VT({defaultTagName:"div",props:Mo({className:Ne("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e)},n),render:t,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function y8({className:e,...t}){return m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Ne("flex w-full min-w-0 flex-col gap-0",e),...t})}function x8({className:e,...t}){return m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Ne("group/menu-item relative",e),...t})}const Bde=Rg("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function b8({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:o,...a}){const{isMobile:l,state:u}=pw(),f=VT({defaultTagName:"button",props:Mo({className:Ne(Bde({variant:n,size:r}),o)},a),render:i?m.jsx(zT,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return i?(typeof i=="string"&&(i={children:i}),m.jsxs(LT,{children:[f,m.jsx(FT,{side:"right",align:"center",hidden:u!=="collapsed"||l,...i})]})):f}const iz=e=>{let t;const n=new Set,r=(f,d)=>{const h=typeof f=="function"?f(t):f;if(!Object.is(h,t)){const g=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(v=>v(t,g))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,i,l);return l},$de=(e=>e?iz(e):iz),Ude=e=>e;function Hde(e,t=Ude){const n=Ie.useSyncExternalStore(e.subscribe,Ie.useCallback(()=>t(e.getState()),[e,t]),Ie.useCallback(()=>t(e.getInitialState()),[e,t]));return Ie.useDebugValue(n),n}const oz=e=>{const t=$de(e),n=r=>Hde(t,r);return Object.assign(n,t),n},qde=(e=>e?oz(e):oz),gm=(window.__BASE_PATH__||"").replace(/\\/$/,"");function tu(e){return gm?\`\${gm}\${e}\`:e}function Vde(e){return gm&&e.startsWith(gm)?e.slice(gm.length)||"/":e}function w8(){const e=Vde(window.location.pathname);if(e==="/analytics")return{sessionId:null,settingsOpen:!1,selectedAgentId:null,dashboardOpen:!0};const t=e.match(/^\\/agents\\/(.+)$/);if(t)return{sessionId:null,settingsOpen:!0,selectedAgentId:t[1],dashboardOpen:!1};if(e==="/settings")return{sessionId:null,settingsOpen:!0,selectedAgentId:null,dashboardOpen:!1};const n=e.match(/^\\/playground\\/(.+)$/);if(n)return{sessionId:n[1],settingsOpen:!1,selectedAgentId:null,dashboardOpen:!1};const r=e.match(/^\\/sessions\\/(.+)$/);return r?{sessionId:r[1],settingsOpen:!1,selectedAgentId:null,dashboardOpen:!1}:{sessionId:null,settingsOpen:!1,selectedAgentId:null,dashboardOpen:!1}}const Hy=w8(),bn=qde(e=>({apiKey:window.__MA_API_KEY__||localStorage.getItem("ma-api-key")||"",setApiKey:t=>{localStorage.setItem("ma-api-key",t),e({apiKey:t})},activeSessionId:Hy.sessionId,setActiveSessionId:t=>{t?window.history.pushState(null,"",tu(\`/sessions/\${t}\`)):window.history.pushState(null,"",tu("/")),e({activeSessionId:t,settingsOpen:!1})},debugOpen:!1,toggleDebug:()=>e(t=>({debugOpen:!t.debugOpen})),selectedAgentId:Hy.selectedAgentId,setSelectedAgentId:t=>e({selectedAgentId:t}),settingsOpen:Hy.settingsOpen,setSettingsOpen:t=>{if(t)window.history.pushState(null,"",tu("/settings"));else{const n=bn.getState().activeSessionId;window.history.pushState(null,"",tu(n?\`/sessions/\${n}\`:"/"))}e({settingsOpen:t,dashboardOpen:t?!1:bn.getState().dashboardOpen})},sidebarOpen:!0,setSidebarOpen:t=>e({sidebarOpen:t}),commandOpen:!1,setCommandOpen:t=>e({commandOpen:t}),dashboardOpen:Hy.dashboardOpen,setDashboardOpen:t=>{if(t)window.history.pushState(null,"",tu("/analytics"));else{const n=bn.getState().activeSessionId;window.history.pushState(null,"",tu(n?\`/sessions/\${n}\`:"/"))}e({dashboardOpen:t,settingsOpen:t?!1:bn.getState().settingsOpen})},dashboardWindowMinutes:60,setDashboardWindowMinutes:t=>e({dashboardWindowMinutes:t})}));window.addEventListener("popstate",()=>{const{sessionId:e,settingsOpen:t,selectedAgentId:n,dashboardOpen:r}=w8();bn.setState({activeSessionId:e,settingsOpen:t,selectedAgentId:n,dashboardOpen:r})});const Kde="/v1";class Yde extends Error{constructor(t,n){super(\`API error \${t}\`),this.status=t,this.body=n}}async function Xe(e,t={}){const r={"x-api-key":bn.getState().apiKey,...t.headers};t.body&&(r["Content-Type"]="application/json");const i=await fetch(\`\${Kde}\${e}\`,{...t,headers:r});if(!i.ok){const o=await i.json().catch(()=>null);throw new Yde(i.status,o)}if(i.status!==204)return i.json()}function Hs(){return Bn({queryKey:["agents"],queryFn:()=>Xe("/agents?limit=50"),select:e=>e.data})}function tA(e){return Bn({queryKey:["agents",e],queryFn:()=>Xe(\`/agents/\${e}\`),enabled:!!e})}function S8(){const e=hn();return Nn({mutationFn:t=>{const n={...t};return t.engine==="claude"&&(n.tools=[{type:"agent_toolset_20260401"}]),Xe("/agents",{method:"POST",body:JSON.stringify(n)})},onSuccess:()=>e.invalidateQueries({queryKey:["agents"]})})}function Pg(){const e=hn();return Nn({mutationFn:({id:t,...n})=>Xe(\`/agents/\${t}\`,{method:"POST",body:JSON.stringify(n)}),onSuccess:()=>e.invalidateQueries({queryKey:["agents"]})})}function Wde(){const e=hn();return Nn({mutationFn:t=>Xe(\`/agents/\${t}\`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:["agents"]})})}function rf(){return Bn({queryKey:["environments"],queryFn:()=>Xe("/environments?limit=50"),select:e=>e.data})}function E8(){const e=hn();return Nn({mutationFn:({name:t,config:n})=>Xe("/environments",{method:"POST",body:JSON.stringify({name:t,config:{type:"self_hosted",provider:n?.provider,packages:{}}})}),onSuccess:()=>e.invalidateQueries({queryKey:["environments"]})})}function Gde(){const e=hn();return Nn({mutationFn:t=>Xe(\`/environments/\${t}\`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:["environments"]})})}function mw(){return Bn({queryKey:["sessions"],queryFn:()=>Xe("/sessions?limit=50&order=desc"),select:e=>e.data})}function xh(e){return Bn({queryKey:["sessions",e],queryFn:()=>Xe(\`/sessions/\${e}\`),enabled:!!e})}function C8(){const e=hn();return Nn({mutationFn:({agent_id:t,environment_id:n,vault_ids:r})=>Xe("/sessions",{method:"POST",body:JSON.stringify({agent:t,environment_id:n,vault_ids:r})}),onSuccess:()=>e.invalidateQueries({queryKey:["sessions"]})})}function Xde({className:e,...t}){return m.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:Ne(e),...t})}function Qde({className:e,...t}){return m.jsx("ol",{"data-slot":"breadcrumb-list",className:Ne("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",e),...t})}function Zde({className:e,...t}){return m.jsx("li",{"data-slot":"breadcrumb-item",className:Ne("inline-flex items-center gap-1",e),...t})}function Jde({className:e,...t}){return m.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Ne("font-normal text-foreground",e),...t})}function nA(){return Bn({queryKey:["whoami"],queryFn:async()=>{try{return await Xe("/whoami")}catch(e){if(e?.status===404)return;throw e}},staleTime:6e4})}function rA(){return Bn({queryKey:["license"],queryFn:async()=>{try{return await Xe("/license")}catch{return{plan:"community",features:[],limits:{maxKeys:20,auditRetentionMs:10080*60*1e3}}}},staleTime:6e4})}const ehe="0.4.16",az=[{label:"Home",to:"/",icon:Pue,exact:!0},{label:"API Keys",to:"/api-keys",icon:qT}],the={label:"Tenants",to:"/tenants",icon:t8},nhe=[{label:"Agents",to:"/agents",icon:JH},{label:"Environments",to:"/environments",icon:aw},{label:"Sessions",to:"/sessions",icon:Bue},{label:"Secrets",to:"/secrets",icon:zue},{label:"Files",to:"/files",icon:Tue},{label:"Skills",to:"/skills",icon:vfe},{label:"Memory",to:"/memory",icon:e8}],rhe=[{label:"Playground",to:"/playground",icon:iw},{label:"Analytics",to:"/analytics",icon:hue},{label:"API Docs",to:"/docs",icon:ZH}];function pO({title:e,items:t}){const r=Ju().location.pathname;return m.jsxs(zde,{children:[m.jsx(Fde,{children:e}),m.jsx(y8,{children:t.map(i=>{const o=i.icon,a=i.exact?r===i.to:r===i.to||r.startsWith(i.to+"/");return m.jsx(x8,{children:m.jsxs(b8,{render:m.jsx(ki,{to:i.to}),isActive:a,children:[m.jsx(o,{className:"size-4"}),m.jsx("span",{children:i.label})]})},i.to)})})]})}function ihe(){const{data:e}=nA(),{data:t}=rA(),n=t?.features.includes("tenancy"),r=e?.is_global_admin&&n?[...az,the]:az;return m.jsx(pO,{title:"Overview",items:r})}function ohe(){const{data:e}=nA();if(!e)return null;const t=e.is_global_admin?"global":e.tenant_id??"unscoped";return m.jsxs("div",{className:"flex items-center gap-2 px-2 pt-1 pb-0.5 text-[11px] text-sidebar-foreground/60",children:[m.jsx(t8,{className:"size-3"}),m.jsx("span",{className:"truncate font-mono",children:t})]})}function ahe(){const[e,t]=x.useState(()=>document.documentElement.classList.contains("dark"));return x.useEffect(()=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),m.jsx("button",{onClick:()=>{const n=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",n?"dark":"light"),t(n)},className:"rounded-md p-1.5 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","aria-label":"Toggle theme",children:e?m.jsx(wfe,{className:"size-3.5"}):m.jsx(Uue,{className:"size-3.5"})})}function she({...e}){return m.jsxs(Nde,{...e,children:[m.jsx(Ide,{children:m.jsx(y8,{children:m.jsx(x8,{children:m.jsxs(b8,{size:"lg",render:m.jsx(ki,{to:"/"}),children:[m.jsx("span",{className:"size-2.5 rounded-full bg-lime-500 shrink-0"}),m.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight",children:"agentstep"})]})})})}),m.jsxs(Lde,{children:[m.jsx(ihe,{}),m.jsx(pO,{title:"Resources",items:nhe}),m.jsx(pO,{title:"Tools",items:rhe})]}),m.jsxs(Dde,{children:[m.jsx(ohe,{}),m.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[m.jsxs("span",{className:"font-mono text-[11px] text-sidebar-foreground/50",children:["v",ehe]}),m.jsx(ahe,{})]})]}),m.jsx(Pde,{})]})}const lhe=Rg("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function an({className:e,variant:t="default",render:n,...r}){return VT({defaultTagName:"span",props:Mo({className:Ne(lhe({variant:t}),e)},r),render:n,state:{slot:"badge",variant:t}})}function eo({className:e,...t}){return m.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:m.jsx("table",{"data-slot":"table",className:Ne("w-full caption-bottom text-sm",e),...t})})}function Jo({className:e,...t}){return m.jsx("thead",{"data-slot":"table-header",className:Ne("[&_tr]:border-b",e),...t})}function to({className:e,...t}){return m.jsx("tbody",{"data-slot":"table-body",className:Ne("[&_tr:last-child]:border-0",e),...t})}function yn({className:e,...t}){return m.jsx("tr",{"data-slot":"table-row",className:Ne("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function et({className:e,...t}){return m.jsx("th",{"data-slot":"table-head",className:Ne("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function Ue({className:e,...t}){return m.jsx("td",{"data-slot":"table-cell",className:Ne("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}const _8=x.createContext(void 0);function k8(e){const t=x.useContext(_8);if(t===void 0&&!e)throw new Error(Xt(33));return t}const O8=x.createContext(void 0);function of(e){const t=x.useContext(O8);if(t===void 0&&!e)throw new Error(Xt(36));return t}const che=x.createContext(void 0);function gw(e=!0){const t=x.useContext(che);if(t===void 0&&!e)throw new Error(Xt(25));return t}function uhe(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:o,typingRef:a,itemRef:l,itemMetadata:u}=e,{events:f}=o.useState("floatingTreeRoot"),d=gw(!0),h=d!==void 0;return x.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onKeyDown(g){g.key===" "&&a?.current&&g.preventDefault()},onMouseMove(g){i&&f.emit("itemhover",{nodeId:i,target:g.currentTarget})},onClick(g){t&&f.emit("close",{domEvent:g,reason:mm})},onMouseUp(g){if(d){const v=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,h&&v&&Math.abs(g.clientX-v.x)<=1&&Math.abs(g.clientY-v.y)<=1||h&&!xU&&g.button===2)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!h||g.button===2)&&(!u||u.type==="regular-item")&&l.current.click()}}),[t,n,r,f,i,o,a,l,d,h,u])}const fhe={type:"regular-item"};function dhe(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:o,typingRef:a=o.context.typingRef,nativeButton:l,itemMetadata:u,nodeId:f}=e,d=x.useRef(null),{getButtonProps:h,buttonRef:g}=Zo({disabled:n,focusableWhenDisabled:!0,native:l,composite:!0}),v=uhe({closeOnClick:t,highlighted:r,id:i,nodeId:f,store:o,typingRef:a,itemRef:d,itemMetadata:u}),b=x.useCallback(S=>Mo(v,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},S,h),[v,h,u]),w=Po(d,g);return x.useMemo(()=>({getItemProps:b,itemRef:w}),[b,w])}const j8=x.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function hhe(){return x.useContext(j8)}let T8=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Mg(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:o}=e,{register:a,unregister:l,subscribeMapChange:u,elementsRef:f,labelsRef:d,nextIndexRef:h}=hhe(),g=x.useRef(-1),[v,b]=x.useState(o??(i===T8.GuessFromOrder?()=>{if(g.current===-1){const E=h.current;h.current+=1,g.current=E}return g.current}:-1)),w=x.useRef(null),S=x.useCallback(E=>{if(w.current=E,v!==-1&&E!==null&&(f.current[v]=E,d)){const k=t!==void 0;d.current[v]=k?t:r?.current?.textContent??E.textContent}},[v,f,d,t,r]);return Pe(()=>{if(o!=null)return;const E=w.current;if(E)return a(E,n),()=>{l(E)}},[o,a,l,n]),Pe(()=>{if(o==null)return u(E=>{const k=w.current?E.get(w.current)?.index:null;k!=null&&b(k)})},[o,u,b]),x.useMemo(()=>({ref:S,index:v}),[v,S])}const phe=x.forwardRef(function(t,n){const{render:r,className:i,id:o,label:a,nativeButton:l=!1,disabled:u=!1,closeOnClick:f=!0,style:d,...h}=t,g=Mg({label:a}),v=k8(!0),b=Br(o),{store:w}=of(),S=w.useState("isActive",g.index),E=w.useState("itemProps"),{getItemProps:k,itemRef:O}=dhe({closeOnClick:f,disabled:u,highlighted:S,id:b,store:w,nativeButton:l,nodeId:v?.context.nodeId,itemMetadata:fhe});return vt("div",t,{state:{disabled:u,highlighted:S},props:[E,h,k],ref:[O,n,g.ref]})}),mhe=x.createContext(void 0);function iA(e){return x.useContext(mhe)}const ghe={...yc,...$s},vhe=x.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,...l}=t,{store:u}=of(),{side:f,align:d}=k8(),h=iA()!=null,g=u.useState("open"),v=u.useState("transitionStatus"),b=u.useState("popupProps"),w=u.useState("mounted"),S=u.useState("instantType"),E=u.useState("activeTriggerElement"),k=u.useState("parent"),O=u.useState("lastOpenChangeReason"),j=u.useState("rootId"),A=u.useState("floatingRootContext"),T=u.useState("floatingTreeRoot"),N=u.useState("closeDelay"),P=u.useState("activeTriggerElement"),F=k.type==="context-menu";Qo({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),x.useEffect(()=>{function z(V){u.setOpen(!1,ct(V.reason,V.domEvent))}return T.events.on("close",z),()=>{T.events.off("close",z)}},[T.events,u]);const D=u.useState("hoverEnabled"),q=u.useState("disabled");TT(A,{enabled:D&&!q&&!F&&k.type!=="menubar",closeDelay:N});const L={transitionStatus:v,side:f,align:d,open:g,nested:k.type==="menu",instant:S},U=x.useCallback(z=>{u.set("popupElement",z)},[u]),H=vt("div",t,{state:L,ref:[n,u.context.popupRef,U],stateAttributesMapping:ghe,props:[b,{onKeyDown(z){h&&uw.has(z.key)&&z.stopPropagation()}},Tg(v),l,{"data-rootownerid":j}]});let B=k.type===void 0||F;return(E||k.type==="menubar"&&O!==P0)&&(B=!0),m.jsx(U0,{context:A,modal:F,disabled:!w,returnFocus:a===void 0?B:a,initialFocus:k.type!=="menu",restoreFocus:!0,externalTree:k.type!=="menubar"?T:void 0,previousFocusableElement:P,nextFocusableElement:k.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:k.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:H})}),A8=x.createContext(void 0);function yhe(){const e=x.useContext(A8);if(e===void 0)throw new Error(Xt(32));return e}const xhe=x.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=of();return o.useState("mounted")||r?m.jsx(A8.Provider,{value:r,children:m.jsx($0,{ref:n,...i})}):null});function Ig(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=Le(i),a=x.useRef(0),l=pr(whe).current,u=pr(bhe).current,[f,d]=x.useState(0),h=x.useRef(f),g=Le((E,k)=>{u.set(E,k??null),h.current+=1,d(h.current)}),v=Le(E=>{u.delete(E),h.current+=1,d(h.current)}),b=x.useMemo(()=>{const E=new Map;return Array.from(u.keys()).filter(O=>O.isConnected).sort(She).forEach((O,j)=>{const A=u.get(O)??{};E.set(O,{...A,index:j})}),E},[u,f]);Pe(()=>{if(typeof MutationObserver!="function"||b.size===0)return;const E=new MutationObserver(k=>{const O=new Set,j=A=>O.has(A)?O.delete(A):O.add(A);k.forEach(A=>{A.removedNodes.forEach(j),A.addedNodes.forEach(j)}),O.size===0&&(h.current+=1,d(h.current))});return b.forEach((k,O)=>{O.parentElement&&E.observe(O.parentElement,{childList:!0})}),()=>{E.disconnect()}},[b]),Pe(()=>{h.current===f&&(n.current.length!==b.size&&(n.current.length=b.size),r&&r.current.length!==b.size&&(r.current.length=b.size),a.current=b.size),o(b)},[o,b,n,r,f]),Pe(()=>()=>{n.current=[]},[n]),Pe(()=>()=>{r&&(r.current=[])},[r]);const w=Le(E=>(l.add(E),()=>{l.delete(E)}));Pe(()=>{l.forEach(E=>E(b))},[l,b]);const S=x.useMemo(()=>({register:g,unregister:v,subscribeMapChange:w,elementsRef:n,labelsRef:r,nextIndexRef:a}),[g,v,w,n,r,a]);return m.jsx(j8.Provider,{value:S,children:t})}function bhe(){return new Map}function whe(){return new Set}function She(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ehe=20;function oA(e,t,n,r){const[i,o]=x.useState(!1);Pe(()=>{if(!e||!t||n==null){o(!1);return}const a=jt(n).documentElement.clientWidth,l=n.offsetWidth;o(a>0&&l>0&&l>=a-Ehe)},[e,t,n]),p8(e&&(!t||i),r)}const Che=x.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:o,render:a,side:l,align:u,sideOffset:f=0,alignOffset:d=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:S=kU,style:E,...k}=t,{store:O}=of(),j=yhe(),A=gw(!0),T=O.useState("parent"),N=O.useState("floatingRootContext"),P=O.useState("floatingTreeRoot"),F=O.useState("mounted"),D=O.useState("open"),q=O.useState("modal"),L=O.useState("openMethod"),U=O.useState("activeTriggerElement"),H=O.useState("transitionStatus"),B=O.useState("positionerElement"),z=O.useState("instantType"),V=O.useState("hasViewport"),Q=O.useState("lastOpenChangeReason"),G=O.useState("floatingNodeId"),I=O.useState("floatingParentNodeId"),K=N.useState("domReferenceElement"),$=x.useRef(null),R=V0(B,!1,!1);let X=r,W=f,Z=d,oe=u,ie=S;T.type==="context-menu"&&(X=r??T.context?.anchor,oe=oe??"start",!l&&oe!=="center"&&(Z=t.alignOffset??2,W=t.sideOffset??-5));let J=l,se=oe;T.type==="menu"?(J=J??"inline-end",se=se??"start",ie=t.collisionAvoidance??uT):T.type==="menubar"&&(J=J??"bottom",se=se??"start");const xe=T.type==="context-menu",ne=ew({anchor:X,floatingRootContext:N,positionMethod:A?"fixed":i,mounted:F,side:J,sideOffset:W,align:se,alignOffset:Z,arrowPadding:xe?0:v,collisionBoundary:h,collisionPadding:g,sticky:b,nodeId:G,keepMounted:j,disableAnchorTracking:w,collisionAvoidance:ie,shiftCrossAxis:xe&&!("side"in ie&&ie.side==="flip"),externalTree:P,adaptiveOrigin:V?MT:void 0});x.useEffect(()=>{function _e(de){de.open&&(de.parentNodeId===G&&O.set("hoverEnabled",!1),de.nodeId!==G&&de.parentNodeId===O.select("floatingParentNodeId")&&O.setOpen(!1,ct(lm)))}return P.events.on("menuopenchange",_e),()=>{P.events.off("menuopenchange",_e)}},[O,P.events,G]),x.useEffect(()=>{if(O.select("floatingParentNodeId")==null)return;function _e(de){if(de.open||de.nodeId!==O.select("floatingParentNodeId"))return;const be=de.reason??lm;O.setOpen(!1,ct(be))}return P.events.on("menuopenchange",_e),()=>{P.events.off("menuopenchange",_e)}},[P.events,O]);const ke=Fn();x.useEffect(()=>{D||ke.clear()},[D,ke]),x.useEffect(()=>{function _e(de){if(!(!D||de.nodeId!==O.select("floatingParentNodeId")))if(de.target&&U&&U!==de.target){const be=O.select("closeDelay");be>0?ke.isStarted()||ke.start(be,()=>{O.setOpen(!1,ct(lm))}):O.setOpen(!1,ct(lm))}else ke.clear()}return P.events.on("itemhover",_e),()=>{P.events.off("itemhover",_e)}},[P.events,D,U,O,ke]),x.useEffect(()=>{const _e={open:D,nodeId:G,parentNodeId:I,reason:O.select("lastOpenChangeReason")};P.events.emit("menuopenchange",_e)},[P.events,D,O,G,I]),Pe(()=>{const _e=K,de=$.current;if(_e&&($.current=_e),de&&_e&&_e!==de){O.set("instantType",void 0);const be=new AbortController;return R(()=>{O.set("instantType","trigger-change")},be.signal),()=>{be.abort()}}},[K,R,O]);const Ce={open:D,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:T.type==="menu",instant:z},Be=T.type==="menubar"&&T.context.modal;oA(D&&(Be||q&&Q!==or),L==="touch",B,U);const Oe=tw(t,Ce,{styles:ne.positionerStyles,transitionStatus:H,props:k,refs:[n,O.useStateSetter("positionerElement")],hidden:!F,inert:!D}),Re=F&&T.type!=="menu"&&(T.type!=="menubar"&&q&&Q!==or||T.type==="menubar"&&T.context.modal);let je=null;return T.type==="menubar"?je=T.context.contentElement:T.type===void 0&&(je=U),m.jsxs(_8.Provider,{value:ne,children:[Re&&m.jsx(fw,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:Ag(!D),cutout:je}),m.jsx(uH,{id:G,children:m.jsx(Ig,{elementsRef:O.context.itemDomElements,labelsRef:O.context.itemLabels,children:Oe})})]})}),_he=x.createContext(null);function N8(e){return x.useContext(_he)}const khe={...X0,disabled:Te(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Te(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:Te(e=>e.openMethod),allowMouseEnter:Te(e=>e.allowMouseEnter),stickIfOpen:Te(e=>e.stickIfOpen),parent:Te(e=>e.parent),rootId:Te(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Te(e=>e.activeIndex),isActive:Te((e,t)=>e.activeIndex===t),hoverEnabled:Te(e=>e.hoverEnabled),instantType:Te(e=>e.instantType),lastOpenChangeReason:Te(e=>e.openChangeReason),floatingTreeRoot:Te(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Te(e=>e.floatingNodeId),floatingParentNodeId:Te(e=>e.floatingParentNodeId),itemProps:Te(e=>e.itemProps),closeDelay:Te(e=>e.closeDelay),hasViewport:Te(e=>e.hasViewport),keyboardEventRelay:Te(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class aA extends jg{constructor(n){super({...Ohe(),...n},{positionerRef:x.createRef(),popupRef:x.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),onOpenChangeComplete:void 0,triggerElements:new mh},khe);qt(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){let i=r.store.select("rootId"),o=r.store.select("floatingTreeRoot"),a=r.store.select("keyboardEventRelay");this.unsubscribeParentListener=r.store.subscribe(()=>{const l=r.store.select("rootId"),u=r.store.select("floatingTreeRoot"),f=r.store.select("keyboardEventRelay");i===l&&o===u&&a===f||(i=l,o=u,a=f,this.notifyAll())}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const i=pr(()=>new aA(r)).current;return n??i}}function Ohe(){return{...G0(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ET,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Wn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const jhe=x.createContext(void 0);function The(){return x.useContext(jhe)}const Ahe=lT(function(t){const{children:n,open:r,onOpenChange:i,onOpenChangeComplete:o,defaultOpen:a=!1,disabled:l=!1,modal:u,loopFocus:f=!0,orientation:d="vertical",actionsRef:h,closeParentOnEsc:g=!1,handle:v,triggerId:b,defaultTriggerId:w=null,highlightItemOnHover:S=!0}=t,E=gw(!0),k=of(!0),O=N8(!0),j=The(),A=x.useMemo(()=>j&&k?{type:"menu",store:k.store}:O?{type:"menubar",context:O}:E&&!k?{type:"context-menu",context:E}:{type:void 0},[E,k,O,j]),T=aA.useStore(v?.store,{open:a,openProp:r,activeTriggerId:w,triggerIdProp:b,parent:A});bg(()=>{r===void 0&&T.state.open===!1&&a===!0&&T.update({open:!0,activeTriggerId:w})}),T.useControlledProp("openProp",r),T.useControlledProp("triggerIdProp",b),T.useContextCallback("onOpenChangeComplete",o);const N=T.useState("floatingTreeRoot"),P=CT(N),F=La();Pe(()=>{E&&!k?T.update({parent:{type:"context-menu",context:E},floatingNodeId:P,floatingParentNodeId:F}):k&&T.update({floatingNodeId:P,floatingParentNodeId:F})},[E,k,P,F,T]);const D=T.useState("open"),q=T.useState("activeTriggerElement"),L=T.useState("positionerElement"),U=T.useState("hoverEnabled"),H=T.useState("disabled"),B=T.useState("lastOpenChangeReason"),z=T.useState("parent"),V=T.useState("activeIndex"),Q=T.useState("payload"),G=T.useState("floatingParentNodeId"),I=x.useRef(null),K=G!=null,{openMethod:$,triggerProps:R}=dw(D);T.useSyncedValues({disabled:l,modal:z.type===void 0?u:void 0,openMethod:$,rootId:ef()}),Y0(T);const{forceUnmount:X}=W0(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0})}),W=x.useRef(z.type!=="context-menu"),Z=Fn();x.useEffect(()=>{if(D||(I.current=null),z.type==="context-menu"){if(!D){Z.clear(),W.current=!1;return}Z.start(500,()=>{W.current=!0})}},[Z,D,z.type]),Pe(()=>{!D&&!U&&T.set("hoverEnabled",!0)},[D,U,T]);const oe=x.useRef(!0),ie=Fn(),J=Le((ze,Ke)=>{const tt=Ke.reason;if(D===ze&&Ke.trigger===q&&B===tt||(Ke.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!ze&&Ke.trigger==null&&(Ke.trigger=q??void 0),i?.(ze,Ke),Ke.isCanceled))return;T.state.floatingRootContext.dispatchOpenChange(ze,Ke);const Tt=Ke.event;if(ze===!1&&Tt?.type==="click"&&Tt.pointerType==="touch"&&!oe.current)return;if(!ze&&V!==null){const zt=T.context.itemDomElements.current[V];queueMicrotask(()=>{zt?.setAttribute("tabindex","-1")})}ze&&tt===yd?(oe.current=!1,ie.start(300,()=>{oe.current=!0})):(oe.current=!0,ie.clear());const yt=(tt===ja||tt===mm)&&Tt.detail===0&&Tt?.isTrusted,Wt=!ze&&(tt===Eg||tt==null),nt={open:ze,openChangeReason:tt};I.current=Ke.event??null;const Rt=Ke.trigger?.id??null;(Rt||ze)&&(nt.activeTriggerId=Rt,nt.activeTriggerElement=Ke.trigger??null),T.update(nt),z.type==="menubar"&&(tt===yd||tt===lc||tt===or||tt===Ix||tt===lm)?T.set("instantType","group"):yt||Wt?T.set("instantType",yt?"click":"dismiss"):T.set("instantType",void 0)}),se=x.useCallback(ze=>{const Ke=ct(ze);return Ke.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},Ke},[T]),xe=x.useCallback(()=>{T.setOpen(!1,se(M0))},[T,se]);x.useImperativeHandle(h,()=>({unmount:X,close:xe}),[X,xe]);let ne;z.type==="context-menu"&&(ne=z.context),x.useImperativeHandle(ne?.positionerRef,()=>L,[L]),x.useImperativeHandle(ne?.actionsRef,()=>({setOpen:J}),[J]);const ke=Q0({popupStore:T,onOpenChange:J}),Ce=ke.context.events;x.useEffect(()=>{const ze=({open:Ke,eventDetails:tt})=>J(Ke,tt);return Ce.on("setOpen",ze),()=>{Ce?.off("setOpen",ze)}},[Ce,J]);const Be=Og(ke,{enabled:!H,bubbles:{escapeKey:g&&z.type==="menu"},outsidePress(){return z.type!=="context-menu"||I.current?.type==="contextmenu"?!0:W.current},externalTree:K?N:void 0}),Ee=NT(ke,{role:"menu"}),Oe=tf(),Re=x.useCallback(ze=>{T.select("activeIndex")!==ze&&T.set("activeIndex",ze)},[T]),je=jH(ke,{enabled:!H,listRef:T.context.itemDomElements,activeIndex:V,nested:z.type!==void 0,loopFocus:f,orientation:d,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:Oe==="rtl",disabledIndices:sc,onNavigate:Re,openOnArrowKeyDown:z.type!=="context-menu",externalTree:K?N:void 0,focusItemOnHover:S}),_e=x.useCallback(ze=>{T.context.typingRef.current=ze},[T]),de=TH(ke,{listRef:T.context.itemLabels,elementsRef:T.context.itemDomElements,activeIndex:V,resetMs:Toe,onMatch:ze=>{D&&ze!==V&&T.set("activeIndex",ze)},onTypingChange:_e}),{getReferenceProps:be,getFloatingProps:ve,getItemProps:pe,getTriggerProps:Ae}=vc([Be,Ee,je,de]),ae=x.useMemo(()=>{const ze=Mo(be(),{onMouseMove(){T.set("allowMouseEnter",!0)}},R);return delete ze.role,ze},[be,T,R]),me=x.useMemo(()=>{const ze=Ae();if(!ze)return ze;const Ke=Mo(ze,R);return delete Ke.role,delete Ke["aria-controls"],Ke},[Ae,R]),De=x.useMemo(()=>ve({onMouseMove(){T.set("allowMouseEnter",!0),z.type==="menu"&&T.set("hoverEnabled",!1)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(ze){const Ke=T.select("keyboardEventRelay");Ke&&!ze.isPropagationStopped()&&Ke(ze)}}),[ve,z.type,T]),$e=x.useMemo(()=>pe(),[pe]);T.useSyncedValues({floatingRootContext:ke,activeTriggerProps:ae,inactiveTriggerProps:me,popupProps:De,itemProps:$e});const Ve=x.useMemo(()=>({store:T,parent:A}),[T,A]),dt=m.jsx(O8.Provider,{value:Ve,children:typeof n=="function"?n({payload:Q}):n});return z.type===void 0||z.type==="context-menu"?m.jsx(fH,{externalTree:N,children:dt}):dt});function R8(e){const t=e.getBoundingClientRect(),n=In(e),r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=parseFloat(i.width)||0,f=parseFloat(i.height)||0,d=Math.max(t.width,a,u),h=Math.max(t.height,l,f),g=d-t.width,v=h-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-v/2,bottom:t.bottom+v/2}}function P8(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=KT(),{ref:i,index:o}=Mg(e),a=n===o,l=x.useRef(null),u=Po(i,l);return{compositeProps:x.useMemo(()=>({tabIndex:a?0:-1,onFocus(){r(o)},onMouseMove(){const d=l.current;if(!t||!d)return;const h=d.hasAttribute("disabled")||d.ariaDisabled==="true";!a&&!h&&d.focus()}}),[a,r,o,t]),compositeRef:u,index:o}}function Nhe(e){const{render:t,className:n,style:r,state:i=Wn,props:o=sc,refs:a=sc,metadata:l,stateAttributesMapping:u,tag:f="div",...d}=e,{compositeProps:h,compositeRef:g}=P8({metadata:l});return vt(f,e,{state:i,ref:[...a,g],props:[h,...o,d],stateAttributesMapping:u})}function M8(e){if(fn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!wa(e))return M8(Ta(e))}function I8(e,t){const n=x.useRef(null),r=Le(o=>{Fr.flushSync(()=>{e.setOpen(!1,ct(lc,o.nativeEvent,o.currentTarget))}),dae(n.current)?.focus()}),i=Le(o=>{const a=e.select("positionerElement");if(a&&xd(o,a))e.context.beforeContentFocusGuardRef.current?.focus();else{Fr.flushSync(()=>{e.setOpen(!1,ct(lc,o.nativeEvent,o.currentTarget))});let l=fae(e.context.triggerFocusTargetRef.current||t.current);for(;l!==null&<(a,l);){const u=l;if(l=xT(l),l===u)break}l?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Rhe(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=x.useRef(!1);return x.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,jt(o.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:o=>{i.current&&(i.current=!1,o.preventBaseUIHandler())}}:Wn,[t,n,r])}const qy=2,Phe=hU(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,id:l,openOnHover:u,delay:f=100,closeDelay:d=0,handle:h,payload:g,style:v,...b}=t,w=of(!0),S=h?.store??w?.store;if(!S)throw new Error(Xt(85));const E=Br(l),k=S.useState("isTriggerActive",E),O=S.useState("floatingRootContext"),j=S.useState("isOpenedByTrigger",E),A=x.useRef(null),T=Ihe(),N=KT(!0),P=gc(),F=x.useMemo(()=>P??new ET,[P]),D=CT(F),q=La(),{registerTrigger:L,isMountedByThisTrigger:U}=K0(E,A,S,{payload:g,closeDelay:d,parent:T,floatingTreeRoot:F,floatingNodeId:D,floatingParentNodeId:q,keyboardEventRelay:N?.relayKeyboardEvent}),H=T.type==="menubar",B=S.useState("disabled"),z=o||B||H&&T.context.disabled,{getButtonProps:V,buttonRef:Q}=Zo({disabled:z,native:a});x.useEffect(()=>{!j&&T.type===void 0&&(S.context.allowMouseUpTriggerRef.current=!1)},[S,j,T.type]);const G=x.useRef(null),I=Fn(),K=Le(Re=>{if(!G.current)return;I.clear(),S.context.allowMouseUpTriggerRef.current=!1;const je=Re.target;if(lt(G.current,je)||lt(S.select("positionerElement"),je)||je===G.current||je!=null&&M8(je)===S.select("rootId"))return;const _e=R8(G.current);Re.clientX>=_e.left-qy&&Re.clientX<=_e.right+qy&&Re.clientY>=_e.top-qy&&Re.clientY<=_e.bottom+qy||F.events.emit("close",{domEvent:Re,reason:OU})});x.useEffect(()=>{j&&S.select("lastOpenChangeReason")===or&&jt(G.current).addEventListener("mouseup",K,{once:!0})},[j,K,S]);const $=H&&T.context.hasSubmenuOpen,X=AT(O,{enabled:(u??$)&&!z&&T.type!=="context-menu"&&(!H||$&&!U),handleClose:RT({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:T.type===void 0?f:void 0,delay:{close:d},triggerElementRef:A,externalTree:F,isActiveTrigger:k,isClosing:()=>S.select("transitionStatus")==="ending"}),W=Mhe(j,S.select("lastOpenChangeReason")),Z=H0(O,{enabled:!z&&T.type!=="context-menu",event:j&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?W:!1}),oe=_H(O,{enabled:!z&&$}),ie=Rhe({open:j,enabled:H,mouseDownAction:"open"}),J=vc([Z,oe]),se={disabled:z,open:j},xe=S.useState("triggerProps",U),ne=[G,n,Q,L,A],ke=[J.getReferenceProps(),X??Wn,xe,{"aria-haspopup":"menu",id:E,onMouseDown:Re=>{if(S.select("open"))return;I.start(200,()=>{S.context.allowMouseUpTriggerRef.current=!0}),jt(Re.currentTarget).addEventListener("mouseup",K,{once:!0})}},H?{role:"menuitem"}:{},ie,b,V],{preFocusGuardRef:Ce,handlePreFocusGuardFocus:Be,handleFocusTargetFocus:Ee}=I8(S,A),Oe=vt("button",t,{enabled:!H,stateAttributesMapping:pb,state:se,ref:ne,props:ke});return H?m.jsx(Nhe,{tag:"button",render:r,className:i,style:v,state:se,refs:ne,props:ke,stateAttributesMapping:pb}):j?m.jsxs(x.Fragment,{children:[m.jsx(cc,{ref:Ce,onFocus:Be},\`\${E}-pre-focus-guard\`),m.jsx(x.Fragment,{children:Oe},E),m.jsx(cc,{ref:S.context.triggerFocusTargetRef,onFocus:Ee},\`\${E}-post-focus-guard\`)]}):m.jsx(x.Fragment,{children:Oe},E)});function Mhe(e,t){const n=Fn(),[r,i]=x.useState(!1);return Pe(()=>{e&&t==="trigger-hover"?(i(!0),n.start(_U,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Ihe(){const e=gw(!0),t=of(!0),n=N8();return x.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function mO(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function D8({...e}){return m.jsx(Ahe,{"data-slot":"dropdown-menu",...e})}function L8({...e}){return m.jsx(Phe,{"data-slot":"dropdown-menu-trigger",...e})}function z8({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...o}){return m.jsx(xhe,{children:m.jsx(Che,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:m.jsx(vhe,{"data-slot":"dropdown-menu-content",className:Ne("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...o})})})}function gO({className:e,inset:t,variant:n="default",...r}){return m.jsx(phe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ne("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function Dhe(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,actionsRef:a,handle:l,triggerId:u,defaultTriggerId:f=null}=e,d=Us(!0),h=!!d,g=hw.useStore(l?.store,{open:r,openProp:n,activeTriggerId:f,triggerIdProp:u,modal:!0,disablePointerDismissal:!0,nested:h,role:"alertdialog"});g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",u),g.useSyncedValue("nested",h),g.useContextCallback("onOpenChange",i),g.useContextCallback("onOpenChangeComplete",o);const v=g.useState("payload");m8({store:g,actionsRef:a,parentContext:d?.store.context,isDrawer:!1});const b=x.useMemo(()=>({store:g}),[g]);return m.jsx(hO.Provider,{value:!1,children:m.jsx(GT.Provider,{value:b,children:typeof t=="function"?t({payload:v}):t})})}function bh({...e}){return m.jsx(Dhe,{"data-slot":"alert-dialog",...e})}function Lhe({...e}){return m.jsx(ZT,{"data-slot":"alert-dialog-portal",...e})}function zhe({className:e,...t}){return m.jsx(XT,{"data-slot":"alert-dialog-overlay",className:Ne("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function wh({className:e,size:t="default",...n}){return m.jsxs(Lhe,{children:[m.jsx(zhe,{}),m.jsx(QT,{"data-slot":"alert-dialog-content","data-size":t,className:Ne("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n})]})}function Sh({className:e,...t}){return m.jsx("div",{"data-slot":"alert-dialog-header",className:Ne("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Eh({className:e,...t}){return m.jsx("div",{"data-slot":"alert-dialog-footer",className:Ne("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Ch({className:e,...t}){return m.jsx(eA,{"data-slot":"alert-dialog-title",className:Ne("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function _h({className:e,...t}){return m.jsx(c8,{"data-slot":"alert-dialog-description",className:Ne("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function kh({className:e,...t}){return m.jsx(Fe,{"data-slot":"alert-dialog-action",className:Ne(e),...t})}function Oh({className:e,variant:t="outline",size:n="default",...r}){return m.jsx(cw,{"data-slot":"alert-dialog-cancel",className:Ne(e),render:m.jsx(Fe,{variant:t,size:n}),...r})}function ea({...e}){return m.jsx(g8,{"data-slot":"dialog",...e})}function Fhe({...e}){return m.jsx(gde,{"data-slot":"dialog-trigger",...e})}function Bhe({...e}){return m.jsx(ZT,{"data-slot":"dialog-portal",...e})}function $he({className:e,...t}){return m.jsx(XT,{"data-slot":"dialog-overlay",className:Ne("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function za({className:e,children:t,showCloseButton:n=!0,...r}){return m.jsxs(Bhe,{children:[m.jsx($he,{}),m.jsxs(QT,{"data-slot":"dialog-content",className:Ne("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&m.jsxs(cw,{"data-slot":"dialog-close",render:m.jsx(Fe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[m.jsx(uc,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Fa({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:Ne("flex flex-col gap-2",e),...t})}function vb({className:e,showCloseButton:t=!1,children:n,...r}){return m.jsxs("div",{"data-slot":"dialog-footer",className:Ne("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&m.jsx(cw,{render:m.jsx(Fe,{variant:"outline"}),children:"Close"})]})}function Ba({className:e,...t}){return m.jsx(eA,{"data-slot":"dialog-title",className:Ne("font-heading text-base leading-none font-medium",e),...t})}function wt({className:e,...t}){return m.jsx("label",{"data-slot":"label",className:Ne("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const F8=x.createContext(null),B8=x.createContext(null);function $a(){const e=x.useContext(F8);if(e===null)throw new Error(Xt(60));return e}function $8(){const e=x.useContext(B8);if(e===null)throw new Error(Xt(61));return e}const Uhe=(e,t)=>Object.is(e,t);function Gd(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Hhe(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Gd(t,r,n))}function vm(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Gd(r,t,n))}function qhe(e,t,n){return e.filter(r=>!Gd(t,r,n))}function vO(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function U8(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Vhe(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(U8(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function H8(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return vO(e)}function ud(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?vO(e.value):vO(e)}function q8(e,t,n){function r(){return H8(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const i=t,o=U8(i)?i.flatMap(a=>a.items):i;if(e==null||typeof e!="object"){const a=o.find(l=>l.value===e);return a&&a.label!=null?a.label:r()}if("value"in e){const a=o.find(l=>l&&l.value===e.value);if(a&&a.label!=null)return a.label}}return r()}function Khe(e,t,n){return e.reduce((r,i,o)=>(o>0&&r.push(", "),r.push(m.jsx(x.Fragment,{children:q8(i,t,n)},o)),r),[])}const mt={id:Te(e=>e.id),labelId:Te(e=>e.labelId),modal:Te(e=>e.modal),multiple:Te(e=>e.multiple),items:Te(e=>e.items),itemToStringLabel:Te(e=>e.itemToStringLabel),itemToStringValue:Te(e=>e.itemToStringValue),isItemEqualToValue:Te(e=>e.isItemEqualToValue),value:Te(e=>e.value),hasSelectedValue:Te(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:ud(t,r)!==""}),hasNullItemLabel:Te((e,t)=>t?Vhe(e.items):!1),open:Te(e=>e.open),mounted:Te(e=>e.mounted),forceMount:Te(e=>e.forceMount),transitionStatus:Te(e=>e.transitionStatus),openMethod:Te(e=>e.openMethod),activeIndex:Te(e=>e.activeIndex),selectedIndex:Te(e=>e.selectedIndex),isActive:Te((e,t)=>e.activeIndex===t),isSelected:Te((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(o=>Gd(n,o,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Gd(n,i,r)}),isSelectedByFocus:Te((e,t)=>e.selectedIndex===t),popupProps:Te(e=>e.popupProps),triggerProps:Te(e=>e.triggerProps),triggerElement:Te(e=>e.triggerElement),positionerElement:Te(e=>e.positionerElement),listElement:Te(e=>e.listElement),scrollUpArrowVisible:Te(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Te(e=>e.scrollDownArrowVisible),hasScrollArrows:Te(e=>e.hasScrollArrows)};function va(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Uo=1;function sA(e,t){return Math.max(0,e-t)}function Xd(e,t){if(t<=0)return 0;const n=va(e,0,t),r=n,i=t-n,o=r<=Uo,a=i<=Uo;return o&&a?r<=i?0:t:o?0:a?t:n}function Yhe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:a=!1,onOpenChange:l,name:u,form:f,autoComplete:d,disabled:h=!1,readOnly:g=!1,required:v=!1,modal:b=!0,actionsRef:w,inputRef:S,onOpenChangeComplete:E,items:k,multiple:O=!1,itemToStringLabel:j,itemToStringValue:A,isItemEqualToValue:T=Uhe,highlightItemOnHover:N=!0,children:P}=e,{clearErrors:F}=l8(),{setDirty:D,setTouched:q,setFocused:L,shouldValidateOnChange:U,validityData:H,setFilled:B,name:z,disabled:V,validation:Q,validationMode:G}=gh(),I=lw({id:t}),K=V||h,$=z??u,[R,X]=zu({controlled:n,default:O?r??sc:r,name:"Select",state:"value"}),[W,Z]=zu({controlled:o,default:a,name:"Select",state:"open"}),oe=x.useRef([]),ie=x.useRef([]),J=x.useRef(null),se=x.useRef(null),xe=x.useRef(0),ne=x.useRef(null),ke=x.useRef([]),Ce=x.useRef(!1),Be=x.useRef(!1),Ee=x.useRef(null),Oe=x.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Re=x.useRef(!1),{mounted:je,setMounted:_e,transitionStatus:de}=ph(W),{openMethod:be,triggerProps:ve}=dw(W),pe=pr(()=>new EH({id:I,labelId:void 0,modal:b,multiple:O,itemToStringLabel:j,itemToStringValue:A,isItemEqualToValue:T,value:R,open:W,mounted:je,transitionStatus:de,items:k,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ae=gt(pe,mt.activeIndex),ae=gt(pe,mt.selectedIndex),me=gt(pe,mt.triggerElement),De=gt(pe,mt.positionerElement),$e=Ole(be),Ve=be??$e,dt=x.useMemo(()=>O&&Array.isArray(R)&&R.length===0?"":ud(R,A),[O,R,A]),ze=x.useMemo(()=>O&&Array.isArray(R)?R.map(Ot=>ud(Ot,A)):ud(R,A),[O,R,A]),Ke=ar(pe.state.triggerElement),tt=Le(()=>ze);WT(Ke,{id:I,value:R,getValue:tt});const Tt=x.useRef(R);Pe(()=>{R!==Tt.current&&pe.set("forceMount",!0)},[pe,R]),Pe(()=>{B(O?Array.isArray(R)&&R.length>0:R!=null)},[O,R,B]),Pe(function(){if(W)return;const Pt=ke.current;if(O){const Li=Array.isArray(R)?R:[];if(Li.length===0){pe.set("selectedIndex",null);return}const Jn=Li[Li.length-1],zn=vm(Pt,Jn,T);pe.set("selectedIndex",zn===-1?null:zn);return}const ti=vm(Pt,R,T);pe.set("selectedIndex",ti===-1?null:ti)},[O,W,R,ke,T,pe]),JT(R,()=>{F($),D(R!==H.initialValue),U()?Q.commit(R):Q.commit(R,!0)});const yt=Le((Ot,Pt)=>{if(l?.(Ot,Pt),!Pt.isCanceled&&(Z(Ot),!Ot&&(Pt.reason===lc||Pt.reason===P0)&&(q(!0),L(!1),G==="onBlur"&&Q.commit(R)),!Ot&&pe.state.activeIndex!==null)){const ti=oe.current[pe.state.activeIndex];queueMicrotask(()=>{ti?.setAttribute("tabindex","-1")})}}),Wt=Le(()=>{_e(!1),pe.update({activeIndex:null,openMethod:null}),E?.(!1)});Qo({enabled:!w,open:W,ref:J,onComplete(){W||Wt()}}),x.useImperativeHandle(w,()=>({unmount:Wt}),[Wt]);const nt=Le((Ot,Pt)=>{i?.(Ot,Pt),!Pt.isCanceled&&X(Ot)}),Rt=Le(()=>{const Ot=pe.state.listElement||J.current;if(!Ot)return;const Pt=sA(Ot.scrollHeight,Ot.clientHeight),ti=Xd(Ot.scrollTop,Pt),Li=ti>0,Jn=ti<Pt;pe.state.scrollUpArrowVisible!==Li&&pe.set("scrollUpArrowVisible",Li),pe.state.scrollDownArrowVisible!==Jn&&pe.set("scrollDownArrowVisible",Jn)}),zt=CH({open:W,onOpenChange:yt,elements:{reference:me,floating:De}}),Gt=H0(zt,{enabled:!g&&!K,event:"mousedown"}),Dn=Og(zt,{bubbles:!1}),Qt=jH(zt,{enabled:!g&&!K,listRef:oe,activeIndex:Ae,selectedIndex:ae,disabledIndices:sc,onNavigate(Ot){Ot===null&&!W||pe.set("activeIndex",Ot)},focusItemOnHover:N}),Ze=TH(zt,{enabled:!g&&!K&&(W||!O),listRef:ie,activeIndex:Ae,selectedIndex:ae,onMatch(Ot){W?pe.set("activeIndex",Ot):nt(ke.current[Ot],ct("none"))},onTypingChange(Ot){Ce.current=Ot}}),{getReferenceProps:At,getFloatingProps:Ft,getItemProps:ht}=vc([Gt,Dn,Qt,Ze]),En=x.useMemo(()=>Mo(At(),ve,I?{id:I}:Wn),[At,ve,I]);bg(()=>{pe.update({popupProps:Ft(),triggerProps:En})}),Pe(()=>{pe.update({id:I,modal:b,multiple:O,value:R,open:W,mounted:je,transitionStatus:de,popupProps:Ft(),triggerProps:En,items:k,itemToStringLabel:j,itemToStringValue:A,isItemEqualToValue:T,openMethod:Ve})},[pe,I,b,O,R,W,je,de,Ft,En,k,j,A,T,Ve]);const Bt=x.useMemo(()=>({store:pe,name:$,required:v,disabled:K,readOnly:g,multiple:O,itemToStringLabel:j,itemToStringValue:A,highlightItemOnHover:N,setValue:nt,setOpen:yt,listRef:oe,popupRef:J,scrollHandlerRef:se,handleScrollArrowVisibility:Rt,scrollArrowsMountedCountRef:xe,getItemProps:ht,events:zt.context.events,valueRef:ne,valuesRef:ke,labelsRef:ie,typingRef:Ce,selectionRef:Oe,selectedItemTextRef:Ee,validation:Q,onOpenChangeComplete:E,keyboardActiveRef:Be,alignItemWithTriggerActiveRef:Re,initialValueRef:Tt}),[pe,$,v,K,g,O,j,A,N,nt,yt,ht,zt.context.events,Q,E,Rt]),rn=Po(S,Q.inputRef),vr=O&&Array.isArray(R)&&R.length>0,Ln=O?void 0:$,Zn=x.useMemo(()=>!O||!Array.isArray(R)||!$?null:R.map(Ot=>{const Pt=ud(Ot,A);return m.jsx("input",{type:"hidden",form:f,name:$,value:Pt},Pt)}),[O,R,f,$,A]);return m.jsx(F8.Provider,{value:Bt,children:m.jsxs(B8.Provider,{value:zt,children:[P,m.jsx("input",{...Q.getInputValidationProps({onFocus(){pe.state.triggerElement?.focus({focusVisible:!0})},onChange(Ot){if(Ot.nativeEvent.defaultPrevented)return;const Pt=Ot.currentTarget.value,ti=ct(Wo,Ot.nativeEvent);function Li(){if(O)return;const Jn=ke.current.find(zn=>ud(zn,A).toLowerCase()===Pt.toLowerCase()||H8(zn,j).toLowerCase()===Pt.toLowerCase());Jn!=null&&(D(Jn!==H.initialValue),nt(Jn,ti),U()&&Q.commit(Jn))}pe.set("forceMount",!0),queueMicrotask(Li)}}),id:I&&Ln==null?\`\${I}-hidden-input\`:void 0,form:f,name:Ln,autoComplete:d,value:dt,disabled:K,required:v&&!vr,readOnly:g,ref:rn,style:$?PU:hT,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Zn]})})}function Whe(e,t){return e??t}const Vy=2,Ghe=400,sz=200,Xhe={...pb,...YT,value:()=>null},Qhe=x.forwardRef(function(t,n){const{render:r,className:i,id:o,disabled:a=!1,nativeButton:l=!0,style:u,...f}=t,{setTouched:d,setFocused:h,validationMode:g,state:v,disabled:b}=gh(),{labelId:w}=sw(),{store:S,setOpen:E,selectionRef:k,validation:O,readOnly:j,required:A,alignItemWithTriggerActiveRef:T,disabled:N,keyboardActiveRef:P}=$a(),F=b||N||a,D=gt(S,mt.open),q=gt(S,mt.value),L=gt(S,mt.triggerProps),U=gt(S,mt.positionerElement),H=gt(S,mt.listElement),B=gt(S,mt.id),z=gt(S,mt.labelId),V=gt(S,mt.hasSelectedValue),Q=!V&&D,G=gt(S,mt.hasNullItemLabel,Q),I=o??B,K=Whe(w,z);lw({id:I});const $=ar(U),R=x.useRef(null),{getButtonProps:X,buttonRef:W}=Zo({disabled:F,native:l}),Z=Le(Be=>{S.set("triggerElement",Be)}),oe=Po(n,R,W,Z),ie=Fn(),J=Fn(),se=Fn(),xe=Fn();x.useEffect(()=>{if(D)return!(V||G)?se.start(Ghe,()=>{k.current.allowUnselectedMouseUp=!0,k.current.allowSelectedMouseUp=!0}):xe.start(sz,()=>{k.current.allowUnselectedMouseUp=!0,se.start(sz,()=>{k.current.allowSelectedMouseUp=!0})}),()=>{se.clear(),xe.clear()};k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},J.clear()},[D,V,G,k,J,se,xe]);const ne=x.useMemo(()=>H?.id??Dm(U)?.id,[H,U]),ke=Mo(L,{id:I,role:"combobox","aria-expanded":D?"true":"false","aria-haspopup":"listbox","aria-controls":D?ne:void 0,"aria-labelledby":K,"aria-readonly":j||void 0,"aria-required":A||void 0,tabIndex:F?-1:0,ref:oe,onFocus(Be){h(!0),D&&T.current&&E(!1,ct(Wo,Be.nativeEvent)),ie.start(0,()=>{S.set("forceMount",!0)})},onBlur(Be){lt(U,Be.relatedTarget)||(d(!0),h(!1),g==="onBlur"&&O.commit(q))},onPointerMove(){P.current=!1},onKeyDown(){P.current=!0},onMouseDown(Be){if(D)return;const Ee=jt(Be.currentTarget);function Oe(Re){if(!R.current)return;const je=Re.target;if(lt(R.current,je)||lt($.current,je)||je===R.current)return;const _e=R8(R.current);Re.clientX>=_e.left-Vy&&Re.clientX<=_e.right+Vy&&Re.clientY>=_e.top-Vy&&Re.clientY<=_e.bottom+Vy||E(!1,ct(OU,Re))}J.start(0,()=>{Ee.addEventListener("mouseup",Oe,{once:!0})})}},O.getValidationProps,f,X);ke.role="combobox";const Ce={...v,open:D,disabled:F,value:q,readOnly:j,placeholder:!V};return vt("button",t,{ref:[n,R],state:Ce,stateAttributesMapping:Xhe,props:ke})}),Zhe={value:()=>null},Jhe=x.forwardRef(function(t,n){const{className:r,render:i,children:o,placeholder:a,style:l,...u}=t,{store:f,valueRef:d}=$a(),h=gt(f,mt.value),g=gt(f,mt.items),v=gt(f,mt.itemToStringLabel),b=gt(f,mt.hasSelectedValue),w=!b&&a!=null&&o==null,S=gt(f,mt.hasNullItemLabel,w),E={value:h,placeholder:!b};let k=null;return typeof o=="function"?k=o(h):o!=null?k=o:!b&&a!=null&&!S?k=a:Array.isArray(h)?k=Khe(h,g,v):k=q8(h,g,v),vt("span",t,{state:E,ref:[n,d],props:[{children:k},u],stateAttributesMapping:Zhe})}),epe=x.forwardRef(function(t,n){const{className:r,render:i,style:o,...a}=t,{store:l}=$a(),f={open:gt(l,mt.open)};return vt("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"\u25BC"},a],stateAttributesMapping:J0})}),tpe=x.createContext(void 0),npe=x.forwardRef(function(t,n){const{store:r}=$a(),i=gt(r,mt.mounted),o=gt(r,mt.forceMount);return i||o?m.jsx(tpe.Provider,{value:!0,children:m.jsx($0,{ref:n,...t})}):null}),V8=x.createContext(void 0);function lA(){const e=x.useContext(V8);if(!e)throw new Error(Xt(59));return e}function yb(e,t){e&&Object.assign(e.style,t)}const K8={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},rpe={position:"fixed"},ipe=x.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:o,render:a,side:l="bottom",align:u="center",sideOffset:f=0,alignOffset:d=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:w,alignItemWithTrigger:S=!0,collisionAvoidance:E=kU,style:k,...O}=t,{store:j,listRef:A,labelsRef:T,alignItemWithTriggerActiveRef:N,selectedItemTextRef:P,valuesRef:F,initialValueRef:D,popupRef:q,setValue:L}=$a(),U=$8(),H=gt(j,mt.open),B=gt(j,mt.mounted),z=gt(j,mt.modal),V=gt(j,mt.value),Q=gt(j,mt.openMethod),G=gt(j,mt.positionerElement),I=gt(j,mt.triggerElement),K=gt(j,mt.isItemEqualToValue),$=gt(j,mt.transitionStatus),R=x.useRef(null),X=x.useRef(null),[W,Z]=x.useState(S),oe=B&&W&&Q!=="touch";!B&&W!==S&&Z(S),Pe(()=>{B||(mt.scrollUpArrowVisible(j.state)&&j.set("scrollUpArrowVisible",!1),mt.scrollDownArrowVisible(j.state)&&j.set("scrollDownArrowVisible",!1))},[j,B]),x.useImperativeHandle(N,()=>oe),oA((oe||z)&&H,Q==="touch",G,I);const ie=ew({anchor:r,floatingRootContext:U,positionMethod:i,mounted:B,side:l,sideOffset:f,align:u,alignOffset:d,arrowPadding:v,collisionBoundary:h,collisionPadding:g,sticky:b,disableAnchorTracking:w??oe,collisionAvoidance:E,keepMounted:!0}),J=oe?"none":ie.side,se=oe?rpe:ie.positionerStyles,xe={open:H,side:J,align:ie.align,anchorHidden:ie.anchorHidden},ne=Le(Oe=>{j.set("positionerElement",Oe)}),ke=tw(t,xe,{styles:se,transitionStatus:$,props:O,refs:[n,ne],hidden:!B,inert:!H}),Ce=x.useRef(0),Be=Le(Oe=>{if(Oe.size===0&&Ce.current===0||F.current.length===0)return;const Re=Ce.current;if(Ce.current=Oe.size,Oe.size===Re)return;const je=ct(Wo);if(Re!==0&&!j.state.multiple&&V!==null&&vm(F.current,V,K)===-1){const de=D.current,ve=de!=null&&vm(F.current,de,K)!==-1?de:null;L(ve,je),ve===null&&(j.set("selectedIndex",null),P.current=null)}if(Re!==0&&j.state.multiple&&Array.isArray(V)){const _e=be=>vm(F.current,be,K)!==-1,de=V.filter(be=>_e(be));(de.length!==V.length||de.some(be=>!Hhe(V,be,K)))&&(L(de,je),de.length===0&&(j.set("selectedIndex",null),P.current=null))}if(H&&oe){j.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const _e={height:""};yb(G,_e),yb(q.current,_e)}}),Ee=x.useMemo(()=>({...ie,side:J,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:Z,scrollUpArrowRef:R,scrollDownArrowRef:X}),[ie,J,oe,Z]);return m.jsx(Ig,{elementsRef:A,labelsRef:T,onMapChange:Be,children:m.jsxs(V8.Provider,{value:Ee,children:[B&&z&&m.jsx(fw,{inert:Ag(!H),cutout:I}),ke]})})}),Ky="base-ui-disable-scrollbar",Bm={className:Ky,getElement(e){return m.jsx("style",{nonce:e,href:Ky,precedence:"base-ui:low",children:\`.\${Ky}{scrollbar-width:none}.\${Ky}::-webkit-scrollbar{display:none}\`})}},ope=x.createContext(void 0),ape={disableStyleElements:!1};function Y8(){return x.useContext(ope)??ape}const spe={...yc,...$s},lpe=x.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,...l}=t,{store:u,popupRef:f,onOpenChangeComplete:d,setOpen:h,valueRef:g,selectedItemTextRef:v,keyboardActiveRef:b,multiple:w,handleScrollArrowVisibility:S,scrollHandlerRef:E,listRef:k,highlightItemOnHover:O}=$a(),{side:j,align:A,alignItemWithTriggerActive:T,isPositioned:N,setControlledAlignItemWithTrigger:P,scrollDownArrowRef:F,scrollUpArrowRef:D}=lA(),q=iA()!=null,L=$8(),U=tf(),{nonce:H,disableStyleElements:B}=Y8(),z=gt(u,mt.id),V=gt(u,mt.open),Q=gt(u,mt.mounted),G=gt(u,mt.popupProps),I=gt(u,mt.transitionStatus),K=gt(u,mt.triggerElement),$=gt(u,mt.positionerElement),R=gt(u,mt.listElement),X=x.useRef(!1),W=x.useRef(!1),Z=x.useRef({}),oe=Cg(),ie=Le(ne=>{if(!$||!f.current||!W.current)return;if(X.current||!T){S();return}const ke=$.style.top==="0px",Ce=$.style.bottom==="0px";if(!ke&&!Ce){S();return}const Be=cz($),Ee=fm($.getBoundingClientRect().height,"y",Be),Oe=jt($),Re=getComputedStyle($),je=parseFloat(Re.marginTop),_e=parseFloat(Re.marginBottom),de=lz(getComputedStyle(f.current)),be=Math.min(Oe.documentElement.clientHeight-je-_e,de),ve=ne.scrollTop,pe=Yy(ne);let Ae=0,ae=null,me=!1,De=!1;const $e=Ke=>{$.style.height=\`\${Ke}px\`},Ve=(Ke,tt)=>{const Tt=va(Ke,0,be-Ee);Tt>0&&$e(Ee+Tt),ne.scrollTop=tt,be-(Ee+Tt)<=Uo&&(X.current=!0),S()},dt=ke?pe-ve:ve,ze=Math.min(Ee+dt,be);if(Ae=ze,dt<=Uo){Ve(dt,ke?pe:0);return}if(be-ze>Uo)ke?De=!0:ae=0;else if(me=!0,Ce&&ve<pe){const Ke=Ee+dt-be;ae=ve-(dt-Ke)}if(Ae=Math.ceil(Ae),Ae!==0&&$e(Ae),De||ae!=null){const Ke=Yy(ne),tt=De?Ke:va(ae,0,Ke);Math.abs(ne.scrollTop-tt)>Uo&&(ne.scrollTop=tt)}(me||Ae>=be-Uo)&&(X.current=!0),S()});x.useImperativeHandle(E,()=>ie,[ie]),Qo({open:V,ref:f,onComplete(){V&&d?.(!0)}});const J={open:V,transitionStatus:I,side:j,align:A};Pe(()=>{!$||!f.current||Object.keys(Z.current).length||(Z.current={top:$.style.top||"0",left:$.style.left||"0",right:$.style.right,height:$.style.height,bottom:$.style.bottom,minHeight:$.style.minHeight,maxHeight:$.style.maxHeight,marginTop:$.style.marginTop,marginBottom:$.style.marginBottom})},[f,$]),Pe(()=>{V||T||(W.current=!1,X.current=!1,yb($,Z.current))},[V,T,$,f]),Pe(()=>{const ne=f.current;if(!V||!K||!$||!ne||T&&!N||u.state.transitionStatus==="ending")return;if(!T){W.current=!0,oe.request(S),ne.style.removeProperty("--transform-origin");return}const ke=cpe(ne);ne.style.removeProperty("--transform-origin");try{const Ce=v.current,Be=g.current,Ee=getComputedStyle($),Oe=getComputedStyle(ne),Re=jt(K),je=In($),_e=cz(K),de=Wy(K.getBoundingClientRect(),_e),be=Wy($.getBoundingClientRect(),_e),ve=de.height,pe=R||ne,Ae=pe.scrollHeight,ae=parseFloat(Oe.borderBottomWidth),me=parseFloat(Ee.marginTop)||10,De=parseFloat(Ee.marginBottom)||10,$e=parseFloat(Ee.minHeight)||100,Ve=lz(Oe),dt=5,ze=5,Ke=20,tt=Re.documentElement.clientHeight-me-De,Tt=Re.documentElement.clientWidth,yt=tt-de.bottom+ve;let Wt,nt=U==="rtl"?de.right-be.width:de.left,Rt=0;if(Ce&&Be){const rn=Wy(Be.getBoundingClientRect(),_e);Wt=Wy(Ce.getBoundingClientRect(),_e),nt=be.left+(U==="rtl"?rn.right-Wt.right:rn.left-Wt.left);const vr=rn.top-de.top+rn.height/2;Rt=Wt.top-be.top+Wt.height/2-vr}const zt=yt+Rt+De+ae;let Gt=Math.min(tt,zt);const Dn=tt-me-De,Qt=zt-Gt,Ze=Tt-ze;$.style.left=\`\${va(nt,dt,Ze-be.width)}px\`,$.style.height=\`\${Gt}px\`,$.style.maxHeight="auto",$.style.marginTop=\`\${me}px\`,$.style.marginBottom=\`\${De}px\`,ne.style.height="100%";const At=Yy(pe),Ft=Qt>=At-Uo;Ft&&(Gt=Math.min(tt,be.height)-(Qt-At));const ht=de.top<Ke||de.bottom>tt-Ke||Math.ceil(Gt)+Uo<Math.min(Ae,$e),En=(je.visualViewport?.scale??1)!==1&&R0;if(ht||En){W.current=!0,yb($,Z.current),P(!1);return}const Bt=Math.max($e,Gt);if(Ft){const rn=Math.max(0,tt-zt);$.style.top=be.height>=Dn?"0":\`\${rn}px\`,$.style.height=\`\${Gt}px\`,pe.scrollTop=Yy(pe)}else $.style.bottom="0",pe.scrollTop=Qt;if(Wt){const rn=be.top,vr=be.height,Ln=Wt.top+Wt.height/2,Zn=vr>0?(Ln-rn)/vr*100:50,Ot=va(Zn,0,100);ne.style.setProperty("--transform-origin",\`50% \${Ot}%\`)}(Bt===tt||Gt>=Ve)&&(X.current=!0),S(),O&&u.state.selectedIndex===null&&u.state.activeIndex===null&&k.current[0]!=null&&u.set("activeIndex",0),W.current=!0}finally{ke()}},[u,V,$,K,g,v,f,S,T,P,oe,F,D,R,k,O,U,N]),x.useEffect(()=>{if(!T||!$||!V)return;const ne=In($);function ke(Ce){h(!1,ct(Moe,Ce))}return kt(ne,"resize",ke)},[h,T,$,V]);const se={...R?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:\`\${z}-list\`},onKeyDown(ne){b.current=!0,q&&uw.has(ne.key)&&ne.stopPropagation()},onMouseMove(){b.current=!1},onScroll(ne){R||ie(ne.currentTarget)},...T&&{style:R?{height:"100%"}:K8}},xe=vt("div",t,{ref:[n,f],state:J,stateAttributesMapping:spe,props:[G,se,Tg(I),{className:!R&&T?Bm.className:void 0},l]});return m.jsxs(x.Fragment,{children:[!B&&Bm.getElement(H),m.jsx(U0,{context:L,modal:!1,disabled:!Q,returnFocus:a,restoreFocus:!0,children:xe})]})});function lz(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Yy(e){return sA(e.scrollHeight,e.clientHeight)}function cz(e){return yH.getScale(e)}function fm(e,t,n){return e/n[t]}function Wy(e,t){return Lm({x:fm(e.x,"x",t),y:fm(e.y,"y",t),width:fm(e.width,"x",t),height:fm(e.height,"y",t)})}const uz=[["transform","none"],["scale","1"],["translate","0 0"]];function cpe(e){const{style:t}=e,n={};for(const[r,i]of uz)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of uz){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}const upe=x.forwardRef(function(t,n){const{className:r,render:i,style:o,...a}=t,{store:l,scrollHandlerRef:u}=$a(),{alignItemWithTriggerActive:f}=lA(),d=gt(l,mt.hasScrollArrows),h=gt(l,mt.openMethod),g=gt(l,mt.multiple),b={id:\`\${gt(l,mt.id)}-list\`,role:"listbox","aria-multiselectable":g||void 0,onScroll(S){u.current?.(S.currentTarget)},...f&&{style:K8},className:d&&h!=="touch"?Bm.className:void 0},w=Le(S=>{l.set("listElement",S)});return vt("div",t,{ref:[n,w],props:[b,a]})}),W8=x.createContext(void 0);function cA(){const e=x.useContext(W8);if(!e)throw new Error(Xt(57));return e}const fpe=x.memo(x.forwardRef(function(t,n){const{render:r,className:i,value:o=null,label:a,disabled:l=!1,nativeButton:u=!1,style:f,...d}=t,h=x.useRef(null),g=Mg({label:a,textRef:h,indexGuessBehavior:T8.GuessFromOrder}),{store:v,getItemProps:b,setOpen:w,setValue:S,selectionRef:E,typingRef:k,valuesRef:O,multiple:j,selectedItemTextRef:A}=$a(),T=gt(v,mt.isActive,g.index),N=gt(v,mt.isSelected,g.index,o),P=gt(v,mt.isSelectedByFocus,g.index),F=gt(v,mt.isItemEqualToValue),D=g.index,q=D!==-1,L=x.useRef(null),U=ar(D);Pe(()=>{if(!q)return;const W=O.current;return W[D]=o,()=>{delete W[D]}},[q,D,o,O]),Pe(()=>{if(!q)return;const W=v.state.value;let Z=W;j&&Array.isArray(W)&&W.length>0&&(Z=W[W.length-1]),Z!==void 0&&Gd(o,Z,F)&&(v.set("selectedIndex",D),h.current&&(A.current=h.current))},[q,D,j,F,v,o,A]);const H={disabled:l,selected:N,highlighted:T},B=b({active:T,selected:N});B.id=void 0;const z=x.useRef(null),V=x.useRef("mouse"),Q=x.useRef(!1),{getButtonProps:G,buttonRef:I}=Zo({disabled:l,focusableWhenDisabled:!0,native:u,composite:!0});function K(W){const Z=v.state.value;if(j){const oe=Array.isArray(Z)?Z:[],ie=N?qhe(oe,o,F):[...oe,o];S(ie,ct(mm,W))}else S(o,ct(mm,W)),w(!1,ct(mm,W))}const $={role:"option","aria-selected":N,tabIndex:T?0:-1,onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(W){z.current=W.key,v.set("activeIndex",D),W.key===" "&&k.current&&W.preventDefault()},onClick(W){Q.current=!1,!(W.type==="keydown"&&z.current===null)&&(l||W.type==="keydown"&&z.current===" "&&k.current||V.current!=="touch"&&!T||(z.current=null,K(W.nativeEvent)))},onPointerEnter(W){V.current=W.pointerType},onPointerDown(W){V.current=W.pointerType,Q.current=!0},onMouseUp(){if(l)return;if(Q.current){Q.current=!1;return}const W=!E.current.allowSelectedMouseUp&&N,Z=!E.current.allowUnselectedMouseUp&&!N;W||Z||V.current!=="touch"&&!T||L.current?.click()}},R=vt("div",t,{ref:[I,n,g.ref,L],state:H,props:[B,$,d,G]}),X=x.useMemo(()=>({selected:N,indexRef:U,textRef:h,selectedByFocus:P,hasRegistered:q}),[N,U,h,P,q]);return m.jsx(W8.Provider,{value:X,children:R})})),dpe=x.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=cA();return r||i?m.jsx(hpe,{...t,ref:n}):null}),hpe=x.memo(x.forwardRef((e,t)=>{const{render:n,className:r,style:i,keepMounted:o,...a}=e,{selected:l}=cA(),u=x.useRef(null),{transitionStatus:f,setMounted:d}=ph(l),g=vt("span",e,{ref:[t,u],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},a],stateAttributesMapping:$s});return Qo({open:l,ref:u,onComplete(){l||d(!1)}}),g})),ppe=x.memo(x.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:o,hasRegistered:a}=cA(),{selectedItemTextRef:l}=$a(),{className:u,render:f,style:d,...h}=t,g=x.useCallback(b=>{if(!b||!a)return;const w=l.current===null||!l.current.isConnected;(o||w&&r.current===0)&&(l.current=b)},[l,r,o,a]);return vt("div",t,{ref:[g,n,i],props:h})})),G8=x.forwardRef(function(t,n){const{render:r,className:i,style:o,direction:a,keepMounted:l=!1,...u}=t,f=a==="up",{store:d,popupRef:h,listRef:g,handleScrollArrowVisibility:v,scrollArrowsMountedCountRef:b}=$a(),{side:w,scrollDownArrowRef:S,scrollUpArrowRef:E}=lA(),k=f?mt.scrollUpArrowVisible:mt.scrollDownArrowVisible,O=gt(d,k),j=gt(d,mt.openMethod),A=O&&j!=="touch",T=Fn(),N=f?E:S,{transitionStatus:P,setMounted:F}=ph(A);Pe(()=>(b.current+=1,d.state.hasScrollArrows||d.set("hasScrollArrows",!0),()=>{b.current=Math.max(0,b.current-1),b.current===0&&d.state.hasScrollArrows&&d.set("hasScrollArrows",!1)}),[d,b]),Qo({open:A,ref:N,onComplete(){A||F(!1)}});const L=vt("div",t,{ref:[n,N],state:{direction:a,visible:A,side:w,transitionStatus:P},props:[{"aria-hidden":!0,children:f?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(H){if(H.movementX===0&&H.movementY===0||T.isStarted())return;d.set("activeIndex",null);function B(){const z=d.state.listElement??h.current;if(!z)return;d.set("activeIndex",null),v();const V=sA(z.scrollHeight,z.clientHeight),Q=Xd(z.scrollTop,V),G=Q===(f?0:V),I=g.current;if(Q!==z.scrollTop&&(z.scrollTop=Q),I.length===0&&d.set(f?"scrollUpArrowVisible":"scrollDownArrowVisible",!G),G){T.clear();return}if(I.length>0){const K=N.current?.offsetHeight||0;z.scrollTop=mpe(I,f,Q,z.clientHeight,K,V)}T.start(40,B)}T.start(40,B)},onMouseLeave(){T.clear()}},u]});return A||l?L:null});function mpe(e,t,n,r,i,o){if(t){let d=0;const h=n+i-Uo;for(let b=0;b<e.length;b+=1){const w=e[b];if(w&&w.offsetTop>=h){d=b;break}}const g=Math.max(0,d-1),v=e[g];return g<d&&v?Xd(v.offsetTop-i,o):0}let a=e.length-1;const l=n+r-i+Uo;for(let d=0;d<e.length;d+=1){const h=e[d];if(h&&h.offsetTop+h.offsetHeight>l){a=Math.max(0,d-1);break}}const u=Math.min(e.length-1,a+1),f=e[u];return u>a&&f?Xd(f.offsetTop+f.offsetHeight-r+i,o):o}const gpe=x.forwardRef(function(t,n){return m.jsx(G8,{...t,ref:n,direction:"down"})}),vpe=x.forwardRef(function(t,n){return m.jsx(G8,{...t,ref:n,direction:"up"})}),X8=x.createContext(void 0);function ype(){const e=x.useContext(X8);if(e===void 0)throw new Error(Xt(56));return e}const xpe=x.forwardRef(function(t,n){const{className:r,render:i,style:o,...a}=t,[l,u]=x.useState(),f=x.useMemo(()=>({labelId:l,setLabelId:u}),[l,u]),d=vt("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},a]});return m.jsx(X8.Provider,{value:f,children:d})}),bpe=x.forwardRef(function(t,n){const{className:r,render:i,id:o,style:a,...l}=t,{setLabelId:u}=ype(),f=Br(o);return Pe(()=>{u(f)},[f,u]),vt("div",t,{ref:n,props:[{id:f},l]})}),To=Yhe;function fz({className:e,...t}){return m.jsx(xpe,{"data-slot":"select-group",className:Ne("scroll-my-1 p-1",e),...t})}function jh({className:e,...t}){return m.jsx(Jhe,{"data-slot":"select-value",className:Ne("flex flex-1 text-left",e),...t})}function Ao({className:e,size:t="default",children:n,...r}){return m.jsxs(Qhe,{"data-slot":"select-trigger","data-size":t,className:Ne("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,m.jsx(epe,{render:m.jsx(Ng,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function No({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:o=0,alignItemWithTrigger:a=!0,...l}){return m.jsx(npe,{children:m.jsx(ipe,{side:n,sideOffset:r,align:i,alignOffset:o,alignItemWithTrigger:a,className:"isolate z-50",children:m.jsxs(lpe,{"data-slot":"select-content","data-align-trigger":a,className:Ne("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l,children:[m.jsx(wpe,{}),m.jsx(upe,{children:t}),m.jsx(Spe,{})]})})})}function dz({className:e,...t}){return m.jsx(bpe,{"data-slot":"select-label",className:Ne("px-1.5 py-1 text-xs text-muted-foreground",e),...t})}function ai({className:e,children:t,...n}){return m.jsxs(fpe,{"data-slot":"select-item",className:Ne("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[m.jsx(ppe,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),m.jsx(dpe,{render:m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:m.jsx(Aa,{className:"pointer-events-none"})})]})}function wpe({className:e,...t}){return m.jsx(vpe,{"data-slot":"select-scroll-up-button",className:Ne("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:m.jsx(n8,{})})}function Spe({className:e,...t}){return m.jsx(gpe,{"data-slot":"select-scroll-down-button",className:Ne("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:m.jsx(Ng,{})})}const Qd={claude:["claude-sonnet-4-6","claude-opus-4-6","claude-haiku-4-5"],opencode:["anthropic/claude-sonnet-4-6","anthropic/claude-opus-4-6","openai/gpt-5.4","openai/gpt-5.4-mini"],codex:["gpt-5.4-mini","gpt-5.4","gpt-5.3-codex"],gemini:["gemini-3.1-pro-preview","gemini-3.1-flash-preview","gemini-2.5-pro","gemini-2.5-flash"],factory:["claude-sonnet-4-6","claude-opus-4-6","gpt-5.4","gemini-3.1-pro-preview"],pi:["anthropic/claude-sonnet-4-6","anthropic/claude-opus-4-6","openai/gpt-5.4","google/gemini-2.5-flash"]},uA=Object.keys(Qd),$m=["docker","apple-container","podman"],Tu=["anthropic","sprites","e2b","vercel","daytona","fly","modal"];[...$m,...Tu];const Q8={anthropic:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key",placeholder:"sk-ant-..."},sprites:{key:"SPRITE_TOKEN",label:"Sprites.dev Token",placeholder:"user/org/.../token"},e2b:{key:"E2B_API_KEY",label:"E2B API Key",placeholder:"e2b_..."},vercel:{key:"VERCEL_TOKEN",label:"Vercel Token",placeholder:"..."},daytona:{key:"DAYTONA_API_KEY",label:"Daytona API Key",placeholder:"..."},fly:{key:"FLY_API_TOKEN",label:"Fly.io API Token",placeholder:"fo1_..."},modal:{key:"MODAL_TOKEN_ID",label:"Modal Token ID",placeholder:"..."}},Epe={claude:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key or OAuth Token"},codex:{key:"OPENAI_API_KEY",label:"OpenAI API Key"},gemini:{key:"GEMINI_API_KEY",label:"Gemini API Key"},factory:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key"},pi:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key"}};function yO(e){return e.includes("/")?!1:!["claude-","gpt-","o1-","o3-","o4-","codex-","chatgpt-","gemini-"].some(n=>e.startsWith(n))}function Cpe(e,t){if(!yO(t))return e==="opencode"||e==="pi"?t.startsWith("openai/")?{key:"OPENAI_API_KEY",label:"OpenAI API Key"}:t.startsWith("google/")||t.startsWith("gemini/")?{key:"GEMINI_API_KEY",label:"Gemini API Key"}:{key:"ANTHROPIC_API_KEY",label:"Anthropic API Key"}:Epe[e]}const Z8=x.createContext(void 0);function Dg(e){const t=x.useContext(Z8);if(t===void 0&&!e)throw new Error(Xt(47));return t}function _pe(){return{...G0(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const kpe={...X0,disabled:Te(e=>e.disabled),instantType:Te(e=>e.instantType),openMethod:Te(e=>e.openMethod),openChangeReason:Te(e=>e.openChangeReason),modal:Te(e=>e.modal),focusManagerModal:Te(e=>e.focusManagerModal),stickIfOpen:Te(e=>e.stickIfOpen),titleElementId:Te(e=>e.titleElementId),descriptionElementId:Te(e=>e.descriptionElementId),openOnHover:Te(e=>e.openOnHover),closeDelay:Te(e=>e.closeDelay),hasViewport:Te(e=>e.hasViewport)};class fA extends jg{constructor(n){const r={..._pe(),...n};r.open&&n?.mounted===void 0&&(r.mounted=!0);super(r,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new Ro,triggerElements:new mh},kpe);qt(this,"setOpen",(n,r)=>{const i=r.reason===or,o=r.reason===ja&&r.event.detail===0,a=!n&&(r.reason===Eg||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const l=()=>{const u={open:n,openChangeReason:r.reason},f=r.trigger?.id??null;(f||n)&&(u.activeTriggerId=f,u.activeTriggerElement=r.trigger??null),this.update(u)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(_U,()=>{this.set("stickIfOpen",!1)}),Fr.flushSync(l)):l(),o||a?this.set("instantType",o?"click":"dismiss"):r.reason===lc?this.set("instantType","focus"):this.set("instantType",void 0)});qt(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const i=pr(()=>new fA(r)).current,o=n??i;return Sg(i.disposeEffect),o}}function hz({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,modal:a=!1,handle:l,triggerId:u,defaultTriggerId:f=null}=e,d=fA.useStore(l?.store,{modal:a,open:r,openProp:n,activeTriggerId:f,triggerIdProp:u});bg(()=>{n===void 0&&d.state.open===!1&&r===!0&&d.update({open:!0,activeTriggerId:f})}),d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",u);const h=d.useState("open"),g=d.useState("payload");d.useContextCallback("onOpenChange",i),d.useContextCallback("onOpenChangeComplete",o);const{openMethod:v,triggerProps:b}=dw(h);Y0(d);const{forceUnmount:w}=W0(h,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});x.useEffect(()=>{h||d.context.stickIfOpenTimeout.clear()},[d,h]);const S=x.useCallback(L=>{const U=ct(L);return U.preventUnmountOnClose=()=>{d.set("preventUnmountingOnClose",!0)},U},[d]),E=x.useCallback(()=>{d.setOpen(!1,S(M0))},[d,S]);x.useImperativeHandle(e.actionsRef,()=>({unmount:w,close:E}),[w,E]);const k=Q0({popupStore:d,onOpenChange:d.setOpen}),O=Og(k,{outsidePressEvent:{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),j=NT(k),{getReferenceProps:A,getFloatingProps:T,getTriggerProps:N}=vc([O,j]),P=x.useMemo(()=>A(b),[A,b]),F=x.useMemo(()=>N(b),[N,b]),D=x.useMemo(()=>T(),[T]);d.useSyncedValues({modal:a,openMethod:v,activeTriggerProps:P,inactiveTriggerProps:F,popupProps:D,floatingRootContext:k,nested:La()!=null});const q=x.useMemo(()=>({store:d}),[d]);return m.jsx(Z8.Provider,{value:q,children:typeof t=="function"?t({payload:g}):t})}function Ope(e){return Dg(!0)?m.jsx(hz,{props:e}):m.jsx(fH,{children:m.jsx(hz,{props:e})})}const jpe=300,Tpe=x.forwardRef(function(t,n){const{render:r,className:i,disabled:o=!1,nativeButton:a=!0,handle:l,payload:u,openOnHover:f=!1,delay:d=jpe,closeDelay:h=0,id:g,style:v,...b}=t,w=Dg(!0),S=l?.store??w?.store;if(!S)throw new Error(Xt(74));const E=Br(g),k=S.useState("isTriggerActive",E),O=S.useState("floatingRootContext"),j=S.useState("isOpenedByTrigger",E),A=x.useRef(null),{registerTrigger:T,isMountedByThisTrigger:N}=K0(E,A,S,{payload:u,disabled:o,openOnHover:f,closeDelay:h}),P=S.useState("openChangeReason"),F=S.useState("stickIfOpen"),D=S.useState("openMethod"),q=S.useState("focusManagerModal"),L=AT(O,{enabled:O!=null&&f&&(D!=="touch"||P!==ja),mouseOnly:!0,move:!1,handleClose:RT(),restMs:d,delay:{close:h},triggerElementRef:A,isActiveTrigger:k,isClosing:()=>S.select("transitionStatus")==="ending"}),U=H0(O,{enabled:O!=null,stickIfOpen:F}),H=vc([U]),B=S.useState("triggerProps",N),z={disabled:o,open:j},{getButtonProps:V,buttonRef:Q}=Zo({disabled:o,native:a}),G=x.useMemo(()=>({open(X){return X&&P===ja?pb.open(X):J0.open(X)}}),[P]),I=vt("button",t,{state:z,ref:[Q,n,T,A],props:[H.getReferenceProps(),L,B,{[cT]:"",id:E},b,V],stateAttributesMapping:G}),{preFocusGuardRef:K,handlePreFocusGuardFocus:$,handleFocusTargetFocus:R}=I8(S,A);return k&&!q?m.jsxs(x.Fragment,{children:[m.jsx(cc,{ref:K,onFocus:$}),m.jsx(x.Fragment,{children:I},E),m.jsx(cc,{ref:S.context.triggerFocusTargetRef,onFocus:R})]}):m.jsx(x.Fragment,{children:I},E)}),J8=x.createContext(void 0);function Ape(){const e=x.useContext(J8);if(e===void 0)throw new Error(Xt(45));return e}const Npe=x.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:o}=Dg();return o.useState("mounted")||r?m.jsx(J8.Provider,{value:r,children:m.jsx($0,{ref:n,...i})}):null}),eq=x.createContext(void 0);function Rpe(){const e=x.useContext(eq);if(!e)throw new Error(Xt(46));return e}const Ppe=x.forwardRef(function(t,n){const{render:r,className:i,anchor:o,positionMethod:a="absolute",side:l="bottom",align:u="center",sideOffset:f=0,alignOffset:d=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:w=!1,collisionAvoidance:S=uT,style:E,...k}=t,{store:O}=Dg(),j=Ape(),A=CT(),T=O.useState("floatingRootContext"),N=O.useState("mounted"),P=O.useState("open"),F=O.useState("openChangeReason"),D=O.useState("activeTriggerElement"),q=O.useState("modal"),L=O.useState("openMethod"),U=O.useState("positionerElement"),H=O.useState("instantType"),B=O.useState("transitionStatus"),z=O.useState("hasViewport"),V=x.useRef(null),Q=V0(U,!1,!1),G=ew({anchor:o,floatingRootContext:T,positionMethod:a,mounted:N,side:l,sideOffset:f,align:u,alignOffset:d,arrowPadding:v,collisionBoundary:h,collisionPadding:g,sticky:b,disableAnchorTracking:w,keepMounted:j,nodeId:A,collisionAvoidance:S,adaptiveOrigin:z?MT:void 0}),I=T.useState("domReferenceElement");Pe(()=>{const X=I,W=V.current;if(X&&(V.current=X),W&&X&&X!==W){O.set("instantType",void 0);const Z=new AbortController;return Q(()=>{O.set("instantType","trigger-change")},Z.signal),()=>{Z.abort()}}},[I,Q,O]);const K={open:P,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:H};oA(P&&q===!0&&F!==or,L==="touch",U,D);const $=x.useCallback(X=>{O.set("positionerElement",X)},[O]),R=tw(t,K,{styles:G.positionerStyles,transitionStatus:B,props:k,refs:[n,$],hidden:!N,inert:!P});return m.jsxs(eq.Provider,{value:G,children:[N&&q===!0&&F!==or&&m.jsx(fw,{ref:O.context.internalBackdropRef,inert:Ag(!P),cutout:D}),m.jsx(uH,{id:A,children:R})]})}),Mpe=x.createContext(void 0);function Ipe(){const[e,t]=x.useState(0),n=Le(()=>(t(i=>i+1),()=>{t(i=>Math.max(0,i-1))}));return{context:x.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Dpe(e){const{value:t,children:n}=e;return m.jsx(Mpe.Provider,{value:t,children:n})}const Lpe={...yc,...$s},zpe=x.forwardRef(function(t,n){const{className:r,render:i,initialFocus:o,finalFocus:a,style:l,...u}=t,{store:f}=Dg(),d=Rpe(),h=iA()!=null,{context:g,hasClosePart:v}=Ipe(),b=f.useState("open"),w=f.useState("openMethod"),S=f.useState("instantType"),E=f.useState("transitionStatus"),k=f.useState("popupProps"),O=f.useState("titleElementId"),j=f.useState("descriptionElementId"),A=f.useState("modal"),T=f.useState("mounted"),N=f.useState("openChangeReason"),P=f.useState("activeTriggerElement"),F=f.useState("floatingRootContext");Qo({open:b,ref:f.context.popupRef,onComplete(){b&&f.context.onOpenChangeComplete?.(!0)}});const D=f.useState("disabled"),q=f.useState("openOnHover"),L=f.useState("closeDelay");TT(F,{enabled:q&&!D,closeDelay:L});function U(G){return G==="touch"?f.context.popupRef.current:!0}const H=o===void 0?U:o,B={open:b,side:d.side,align:d.align,instant:S,transitionStatus:E},z=A!==!1&&v;f.useSyncedValue("focusManagerModal",z);const V=x.useCallback(G=>{f.set("popupElement",G)},[f]),Q=vt("div",t,{state:B,ref:[n,f.context.popupRef,V],props:[k,{"aria-labelledby":O,"aria-describedby":j,onKeyDown(G){h&&uw.has(G.key)&&G.stopPropagation()}},Tg(E),u],stateAttributesMapping:Lpe});return m.jsx(U0,{context:F,openInteractionType:w,modal:z,disabled:!T||N===or,initialFocus:H,returnFocus:a,restoreFocus:"popup",previousFocusableElement:fn(P)?P:void 0,nextFocusableElement:f.context.triggerFocusTargetRef,beforeContentFocusGuardRef:f.context.beforeContentFocusGuardRef,children:m.jsx(Dpe,{value:g,children:Q})})});function Fpe({...e}){return m.jsx(Ope,{"data-slot":"popover",...e})}function Bpe({...e}){return m.jsx(Tpe,{"data-slot":"popover-trigger",...e})}function $pe({className:e,align:t="center",alignOffset:n=0,side:r="bottom",sideOffset:i=4,...o}){return m.jsx(Npe,{children:m.jsx(Ppe,{align:t,alignOffset:n,side:r,sideOffset:i,className:"isolate z-50",children:m.jsx(zpe,{"data-slot":"popover-content",className:Ne("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o})})})}var pz=1,Upe=.9,Hpe=.8,qpe=.17,mC=.1,gC=.999,Vpe=.9999,Kpe=.99,Ype=/[\\\\\\/_+.#"@\\[\\(\\{&]/,Wpe=/[\\\\\\/_+.#"@\\[\\(\\{&]/g,Gpe=/[\\s-]/,tq=/[\\s-]/g;function xO(e,t,n,r,i,o,a){if(o===t.length)return i===e.length?pz:Kpe;var l=\`\${i},\${o}\`;if(a[l]!==void 0)return a[l];for(var u=r.charAt(o),f=n.indexOf(u,i),d=0,h,g,v,b;f>=0;)h=xO(e,t,n,r,f+1,o+1,a),h>d&&(f===i?h*=pz:Ype.test(e.charAt(f-1))?(h*=Hpe,v=e.slice(i,f-1).match(Wpe),v&&i>0&&(h*=Math.pow(gC,v.length))):Gpe.test(e.charAt(f-1))?(h*=Upe,b=e.slice(i,f-1).match(tq),b&&i>0&&(h*=Math.pow(gC,b.length))):(h*=qpe,i>0&&(h*=Math.pow(gC,f-i))),e.charAt(f)!==t.charAt(o)&&(h*=Vpe)),(h<mC&&n.charAt(f-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(f-1)!==r.charAt(o))&&(g=xO(e,t,n,r,f+1,o+2,a),g*mC>h&&(h=g*mC)),h>d&&(d=h),f=n.indexOf(u,f+1);return a[l]=d,d}function mz(e){return e.toLowerCase().replace(tq," ")}function Xpe(e,t,n){return e=n&&n.length>0?\`\${e+" "+n.join(" ")}\`:e,xO(e,t,mz(e),mz(t),0,0,{})}function tc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function gz(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fc(...e){return t=>{let n=!1;const r=e.map(i=>{const o=gz(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():gz(e[i],null)}}}}function af(...e){return x.useCallback(fc(...e),e)}function Qpe(e,t){const n=x.createContext(t),r=o=>{const{children:a,...l}=o,u=x.useMemo(()=>l,Object.values(l));return m.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(\`\\\`\${o}\\\` must be used within \\\`\${e}\\\`\`)}return[r,i]}function Zpe(e,t=[]){let n=[];function r(o,a){const l=x.createContext(a),u=n.length;n=[...n,a];const f=h=>{const{scope:g,children:v,...b}=h,w=g?.[e]?.[u]||l,S=x.useMemo(()=>b,Object.values(b));return m.jsx(w.Provider,{value:S,children:v})};f.displayName=o+"Provider";function d(h,g){const v=g?.[e]?.[u]||l,b=x.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(\`\\\`\${h}\\\` must be used within \\\`\${o}\\\`\`)}return[f,d]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(l){const u=l?.[e]||o;return x.useMemo(()=>({[\`__scope\${e}\`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,Jpe(i,...t)]}function Jpe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((l,{useScope:u,scopeName:f})=>{const h=u(o)[\`__scope\${f}\`];return{...l,...h}},{});return x.useMemo(()=>({[\`__scope\${t.scopeName}\`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Um=globalThis?.document?x.useLayoutEffect:()=>{},eme=ah[" useId ".trim().toString()]||(()=>{}),tme=0;function Cs(e){const[t,n]=x.useState(eme());return Um(()=>{n(r=>r??String(tme++))},[e]),t?\`radix-\${t}\`:""}var nme=ah[" useInsertionEffect ".trim().toString()]||Um;function rme({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=ime({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const h=d.current;h!==l&&console.warn(\`\${r} is changing from \${h?"controlled":"uncontrolled"} to \${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.\`),d.current=l},[l,r])}const f=x.useCallback(d=>{if(l){const h=ome(d)?d(e):d;h!==e&&a.current?.(h)}else o(d)},[l,e,o,a]);return[u,f]}function ime({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return nme(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function ome(e){return typeof e=="function"}function Lg(e){const t=ame(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,l=x.Children.toArray(o),u=l.find(lme);if(u){const f=u.props.children,d=l.map(h=>h===u?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return m.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,d):null})}return m.jsx(t,{...a,ref:i,children:o})});return n.displayName=\`\${e}.Slot\`,n}function ame(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=ume(i),l=cme(o,i.props);return i.type!==x.Fragment&&(l.ref=r?fc(r,a):a),x.cloneElement(i,l)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=\`\${e}.SlotClone\`,t}var sme=Symbol("radix.slottable");function lme(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sme}function cme(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ume(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nq=fme.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{});function dme(e,t){e&&Fr.flushSync(()=>e.dispatchEvent(t))}function Hm(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function hme(e,t=globalThis?.document){const n=Hm(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pme="DismissableLayer",bO="dismissableLayer.update",mme="dismissableLayer.pointerDownOutside",gme="dismissableLayer.focusOutside",vz,rq=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iq=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=e,f=x.useContext(rq),[d,h]=x.useState(null),g=d?.ownerDocument??globalThis?.document,[,v]=x.useState({}),b=af(t,N=>h(N)),w=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(S),k=d?w.indexOf(d):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,j=k>=E,A=xme(N=>{const P=N.target,F=[...f.branches].some(D=>D.contains(P));!j||F||(i?.(N),a?.(N),N.defaultPrevented||l?.())},g),T=bme(N=>{const P=N.target;[...f.branches].some(D=>D.contains(P))||(o?.(N),a?.(N),N.defaultPrevented||l?.())},g);return hme(N=>{k===f.layers.size-1&&(r?.(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},g),x.useEffect(()=>{if(d)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(vz=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),yz(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=vz)}},[d,g,n,f]),x.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),yz())},[d,f]),x.useEffect(()=>{const N=()=>v({});return document.addEventListener(bO,N),()=>document.removeEventListener(bO,N)},[]),m.jsx(nq.div,{...u,ref:b,style:{pointerEvents:O?j?"auto":"none":void 0,...e.style},onFocusCapture:tc(e.onFocusCapture,T.onFocusCapture),onBlurCapture:tc(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:tc(e.onPointerDownCapture,A.onPointerDownCapture)})});iq.displayName=pme;var vme="DismissableLayerBranch",yme=x.forwardRef((e,t)=>{const n=x.useContext(rq),r=x.useRef(null),i=af(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),m.jsx(nq.div,{...e,ref:i})});yme.displayName=vme;function xme(e,t=globalThis?.document){const n=Hm(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){oq(mme,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function bme(e,t=globalThis?.document){const n=Hm(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&oq(gme,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yz(){const e=new CustomEvent(bO);document.dispatchEvent(e)}function oq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?dme(i,o):i.dispatchEvent(o)}var wme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sme=wme.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{}),vC="focusScope.autoFocusOnMount",yC="focusScope.autoFocusOnUnmount",xz={bubbles:!1,cancelable:!0},Eme="FocusScope",aq=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,u]=x.useState(null),f=Hm(i),d=Hm(o),h=x.useRef(null),g=af(t,w=>u(w)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(O){if(v.paused||!l)return;const j=O.target;l.contains(j)?h.current=j:jl(h.current,{select:!0})},S=function(O){if(v.paused||!l)return;const j=O.relatedTarget;j!==null&&(l.contains(j)||jl(h.current,{select:!0}))},E=function(O){if(document.activeElement===document.body)for(const A of O)A.removedNodes.length>0&&jl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const k=new MutationObserver(E);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),k.disconnect()}}},[r,l,v.paused]),x.useEffect(()=>{if(l){wz.add(v);const w=document.activeElement;if(!l.contains(w)){const E=new CustomEvent(vC,xz);l.addEventListener(vC,f),l.dispatchEvent(E),E.defaultPrevented||(Cme(Tme(sq(l)),{select:!0}),document.activeElement===w&&jl(l))}return()=>{l.removeEventListener(vC,f),setTimeout(()=>{const E=new CustomEvent(yC,xz);l.addEventListener(yC,d),l.dispatchEvent(E),E.defaultPrevented||jl(w??document.body,{select:!0}),l.removeEventListener(yC,d),wz.remove(v)},0)}}},[l,f,d,v]);const b=x.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(S&&E){const k=w.currentTarget,[O,j]=_me(k);O&&j?!w.shiftKey&&E===j?(w.preventDefault(),n&&jl(O,{select:!0})):w.shiftKey&&E===O&&(w.preventDefault(),n&&jl(j,{select:!0})):E===k&&w.preventDefault()}},[n,r,v.paused]);return m.jsx(Sme.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});aq.displayName=Eme;function Cme(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jl(r,{select:t}),document.activeElement!==n)return}function _me(e){const t=sq(e),n=bz(t,e),r=bz(t.reverse(),e);return[n,r]}function sq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bz(e,t){for(const n of e)if(!kme(n,{upTo:t}))return n}function kme(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ome(e){return e instanceof HTMLInputElement&&"select"in e}function jl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ome(e)&&t&&e.select()}}var wz=jme();function jme(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Sz(e,t),e.unshift(t)},remove(t){e=Sz(e,t),e[0]?.resume()}}}function Sz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tme(e){return e.filter(t=>t.tagName!=="A")}var Ame=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nme=Ame.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{}),Rme="Portal",lq=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);Um(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?cU.createPortal(m.jsx(Nme.div,{...r,ref:t}),a):null});lq.displayName=Rme;function Pme(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var vw=e=>{const{present:t,children:n}=e,r=Mme(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=af(r.ref,Ime(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};vw.displayName="Presence";function Mme(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[l,u]=Pme(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Gy(r.current);o.current=l==="mounted"?f:"none"},[l]),Um(()=>{const f=r.current,d=i.current;if(d!==e){const g=o.current,v=Gy(f);e?u("MOUNT"):v==="none"||f?.display==="none"?u("UNMOUNT"):u(d&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Um(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,h=v=>{const w=Gy(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(o.current=Gy(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Gy(e){return e?.animationName||"none"}function Ime(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zg=Dme.reduce((e,t)=>{const n=Lg(\`Primitive.\${t}\`),r=x.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:o})});return r.displayName=\`Primitive.\${t}\`,{...e,[t]:r}},{}),xC=0;function Lme(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ez()),document.body.insertAdjacentElement("beforeend",e[1]??Ez()),xC++,()=>{xC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xC--}},[])}function Ez(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ya=function(){return ya=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ya.apply(this,arguments)};function cq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zme(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Bx="right-scroll-bar-position",$x="width-before-scroll-bar",Fme="with-scroll-bars-hidden",Bme="--removed-body-scroll-bar-size";function bC(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $me(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Ume=typeof window<"u"?x.useLayoutEffect:x.useEffect,Cz=new WeakMap;function Hme(e,t){var n=$me(null,function(r){return e.forEach(function(i){return bC(i,r)})});return Ume(function(){var r=Cz.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(l){o.has(l)||bC(l,null)}),o.forEach(function(l){i.has(l)||bC(l,a)})}Cz.set(n,e)},[e]),n}function qme(e){return e}function Vme(e,t){t===void 0&&(t=qme);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not \`read\` from an \`assigned\` medium. \`read\` could be used only with \`useMedium\`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var u=function(){var d=a;a=[],d.forEach(o)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(d){a.push(d),f()},filter:function(d){return a=a.filter(d),n}}}};return i}function Kme(e){e===void 0&&(e={});var t=Vme(null);return t.options=ya({async:!0,ssr:!1},e),t}var uq=function(e){var t=e.sideCar,n=cq(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide \`sideCar\` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,ya({},n))};uq.isSideCarExport=!0;function Yme(e,t){return e.useMedium(t),uq}var fq=Kme(),wC=function(){},yw=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:wC,onWheelCapture:wC,onTouchMoveCapture:wC}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,u=e.className,f=e.removeScrollBar,d=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,E=e.as,k=E===void 0?"div":E,O=e.gapMode,j=cq(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,T=Hme([n,t]),N=ya(ya({},j),i);return x.createElement(x.Fragment,null,d&&x.createElement(A,{sideCar:fq,removeScrollBar:f,shards:h,noRelative:v,noIsolation:b,inert:w,setCallbacks:o,allowPinchZoom:!!S,lockRef:n,gapMode:O}),a?x.cloneElement(x.Children.only(l),ya(ya({},N),{ref:T})):x.createElement(k,ya({},N,{className:u,ref:T}),l))});yw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yw.classNames={fullWidth:$x,zeroRight:Bx};var Wme=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gme(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wme();return t&&e.setAttribute("nonce",t),e}function Xme(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qme(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Zme=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gme())&&(Xme(t,n),Qme(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jme=function(){var e=Zme();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dq=function(){var e=Jme(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},ege={left:0,top:0,right:0,gap:0},SC=function(e){return parseInt(e||"",10)||0},tge=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[SC(n),SC(r),SC(i)]},nge=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ege;var t=tge(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rge=dq(),wd="data-scroll-locked",ige=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),\`
|
|
413
413
|
.\`.concat(Fme,\` {
|
|
414
414
|
overflow: hidden \`).concat(r,\`;
|
|
415
415
|
padding-right: \`).concat(l,"px ").concat(r,\`;
|
|
@@ -543,7 +543,7 @@ agentstep skills install \${n}
|
|
|
543
543
|
</body>
|
|
544
544
|
</html>
|
|
545
545
|
`;
|
|
546
|
-
var UI_VERSION = "
|
|
546
|
+
var UI_VERSION = "dab29b3c";
|
|
547
547
|
async function handleGetUI(opts) {
|
|
548
548
|
let body = HTML_TEMPLATE;
|
|
549
549
|
const scripts = [];
|