@lunora/studio 1.0.0-alpha.30 → 1.0.0-alpha.32
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/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +3 -2
- package/dist/packem_chunks/ApiTab.js +3 -3
- package/dist/packem_chunks/AuditPanel.js +7 -7
- package/dist/packem_chunks/ExportImportPanel.js +5 -4
- package/dist/packem_chunks/FileBrowser.js +2 -2
- package/dist/packem_chunks/FunctionRunner.js +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.js +72 -70
- package/dist/packem_chunks/HealthPanel.js +3 -3
- package/dist/packem_chunks/InsightsPanel.js +4 -3
- package/dist/packem_chunks/LogsPanel.js +6 -6
- package/dist/packem_chunks/MailPanel.js +8 -7
- package/dist/packem_chunks/MetricsPanel.js +3 -3
- package/dist/packem_chunks/MigrationsPanel.js +7 -7
- package/dist/packem_chunks/PitrPanel.js +1 -1
- package/dist/packem_chunks/SchemaViewer.js +3 -2
- package/dist/packem_chunks/SecurityAdvisorPanel.js +11 -8
- package/dist/packem_chunks/SettingsPanel.js +50 -49
- package/dist/packem_chunks/SqlEditorPanel.js +5 -4
- package/dist/packem_chunks/TableEditor.js +3 -3
- package/dist/packem_chunks/analytics-panel.js +1 -1
- package/dist/packem_chunks/auth-config-panel.js +1 -1
- package/dist/packem_chunks/auth-sessions-panel.js +2 -2
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/dashboards-panel.js +3 -2
- package/dist/packem_chunks/fanout-panel.js +31 -30
- package/dist/packem_chunks/flags-panel.js +6 -6
- package/dist/packem_chunks/kv-browser.js +2 -2
- package/dist/packem_chunks/log-drains-panel.js +1 -1
- package/dist/packem_chunks/organizations-panel.js +3 -3
- package/dist/packem_chunks/payments-panel.js +6 -5
- package/dist/packem_chunks/permissions-panel.js +12 -11
- package/dist/packem_chunks/queues-panel.js +32 -31
- package/dist/packem_chunks/rls-panel.js +86 -84
- package/dist/packem_chunks/schedule-panel.js +3 -3
- package/dist/packem_chunks/sparkline.js +1 -1
- package/dist/packem_chunks/storage-rules-panel.js +27 -25
- package/dist/packem_chunks/subscriptions-panel.js +33 -31
- package/dist/packem_chunks/users-panel.js +3 -3
- package/dist/packem_chunks/vector-browser.js +1 -1
- package/dist/packem_chunks/workflows-panel.js +2 -2
- package/dist/packem_shared/{ApiDocsPanel-B6u_wnz-.js → ApiDocsPanel-Cu6mD4u7.js} +1 -1
- package/dist/packem_shared/{ApiReferencePanel-Drz4UO0a.js → ApiReferencePanel-Co_wpRF2.js} +1 -1
- package/dist/packem_shared/{CommandPalette-B5BertvU.js → CommandPalette-BUPpbpMc.js} +1 -1
- package/dist/packem_shared/{DataBrowser-ANTHLWWh.js → DataBrowser-DSNK1tPg.js} +5 -5
- package/dist/packem_shared/{GlobalDataBrowser-CjgTG_wa.js → GlobalDataBrowser-ErfvIs1S.js} +3 -3
- package/dist/packem_shared/{HomePanel-c2FodE9t.js → HomePanel-DQk3P8xX.js} +3 -3
- package/dist/packem_shared/{OpenRpcReferencePanel-CspFdbUT.js → OpenRpcReferencePanel-DLWzrIx9.js} +1 -1
- package/dist/packem_shared/{ScheduledJobs-BEJXtsBn.js → ScheduledJobs-ClaNpZsg.js} +2 -2
- package/dist/packem_shared/{Studio-CVTtA_sB.js → Studio-CFTYGEUt.js} +4 -4
- package/dist/packem_shared/{StudioApp-BSYV2fz6.js → StudioApp-Cy9vUwVl.js} +1 -1
- package/dist/packem_shared/{advisor-view-DzqyvUU3.js → advisor-view-D3-U4kRR.js} +5 -5
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- package/dist/packem_shared/{app.d-B6MyY_al.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-Bb__F5-u.js → bar-chart-DSwcWIRy.js} +4 -3
- package/dist/packem_shared/{browser-storage-d03UsV7v.js → browser-storage-tLOxkIHd.js} +3 -67
- package/dist/packem_shared/{data-grid-Dsg6nRjo.js → data-grid-Jz8FqQ2C.js} +1 -1
- package/dist/packem_shared/error-alert-BBT6D22d.js +114 -0
- package/dist/packem_shared/{grid-features-D7nNzBYm.js → grid-features-CUr8Z1_O.js} +1 -1
- package/dist/packem_shared/{home-panel-aOR_drVv.js → home-panel-Bo-Mgrkn.js} +4 -2
- package/dist/packem_shared/{internal-FcNZ3beb.js → internal-DTsYVn-g.js} +30 -1
- package/dist/packem_shared/{reference-view-Doy1XlQq.js → reference-view-CSKyUyPl.js} +3 -2
- package/dist/packem_shared/{sparkline-KgMPHS4u.js → sparkline-BnA1kC9X.js} +1 -1
- package/dist/packem_shared/{studio-dMTJ-kRR.js → studio-Dg2e-dsR.js} +587 -560
- package/dist/packem_shared/{table-list-sidebar-VMo0ftxD.js → table-list-sidebar-B5psdSV1.js} +1 -1
- package/dist/packem_shared/{use-admin-query-BViPA3US.js → use-admin-query-BHPKmPuj.js} +2 -1
- package/dist/packem_shared/{use-auth-capabilities-BHkoBnbZ.js → use-auth-capabilities-C-VH0oJJ.js} +1 -1
- package/dist/standalone/{chunk-N4JI6VQD.js → chunk-25VHPD2I.js} +1 -1
- package/dist/standalone/chunk-2GGMGPEP.js +1 -0
- package/dist/standalone/{chunk-BHTPZS7L.js → chunk-3CJW6NWG.js} +1 -1
- package/dist/standalone/chunk-4H2OJBXO.js +1 -0
- package/dist/standalone/chunk-4MLAVZP4.js +1 -0
- package/dist/standalone/chunk-55YA7ZZI.js +76 -0
- package/dist/standalone/chunk-5OH3VPZF.js +1 -0
- package/dist/standalone/chunk-6GFEVKJP.js +1 -0
- package/dist/standalone/{chunk-ITLLHEVG.js → chunk-764T6X6X.js} +1 -1
- package/dist/standalone/chunk-7M3F6U4L.js +1 -0
- package/dist/standalone/{chunk-KGS7KM4A.js → chunk-7VF3IAAW.js} +1 -1
- package/dist/standalone/chunk-AJIUI7DD.js +1 -0
- package/dist/standalone/{chunk-5NSZVXCS.js → chunk-BACPICH6.js} +1 -1
- package/dist/standalone/chunk-BET2625I.js +1 -0
- package/dist/standalone/chunk-BQUQS7QN.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-DCECRP45.js +1 -0
- package/dist/standalone/chunk-DFP2DADO.js +1 -0
- package/dist/standalone/chunk-DORBUITF.js +1 -0
- package/dist/standalone/chunk-DVKPRFIJ.js +1 -0
- package/dist/standalone/chunk-E6WUCLSI.js +1 -0
- package/dist/standalone/chunk-E7WLF6IU.js +1 -0
- package/dist/standalone/chunk-EVPLBWUT.js +8 -0
- package/dist/standalone/chunk-FCSPAJW4.js +1 -0
- package/dist/standalone/chunk-G2ICR3DL.js +1 -0
- package/dist/standalone/{chunk-2DS7JLWL.js → chunk-GJ6PGSES.js} +5 -5
- package/dist/standalone/chunk-GMSGZDDH.js +13 -0
- package/dist/standalone/chunk-GVRM4U6W.js +2 -0
- package/dist/standalone/chunk-GZDWDDXN.js +1 -0
- package/dist/standalone/chunk-ISJAJWYI.js +1 -0
- package/dist/standalone/{chunk-G2TFEWEQ.js → chunk-JIDZFLTB.js} +1 -1
- package/dist/standalone/{chunk-RMYA7NAH.js → chunk-K3GNLVYK.js} +1 -1
- package/dist/standalone/chunk-K4ZDRTQM.js +1 -0
- package/dist/standalone/{chunk-ASLGNHAX.js → chunk-LI43EKM6.js} +1 -1
- package/dist/standalone/chunk-MFPTVCJ6.js +1 -0
- package/dist/standalone/chunk-MPYFGAOW.js +1 -0
- package/dist/standalone/{chunk-TICVNLPM.js → chunk-O3NAGRTR.js} +1 -1
- package/dist/standalone/chunk-OV2WFAJX.js +1 -0
- package/dist/standalone/chunk-PA3LN4XJ.js +1 -0
- package/dist/standalone/chunk-PD6WPVYU.js +1 -0
- package/dist/standalone/{chunk-7PBZKXYA.js → chunk-PN5NCZDX.js} +1 -1
- package/dist/standalone/{chunk-YJGANMU7.js → chunk-PVZI3CXP.js} +10 -9
- package/dist/standalone/chunk-PZ7HD5T2.js +1 -0
- package/dist/standalone/{chunk-UGMRUEBU.js → chunk-QAFAJBAW.js} +1 -1
- package/dist/standalone/{chunk-6VTGE3WJ.js → chunk-QBAT52GB.js} +1 -1
- package/dist/standalone/chunk-QHIIRFG7.js +1 -0
- package/dist/standalone/chunk-RSEEHNFI.js +1 -0
- package/dist/standalone/chunk-SFJ5F4DX.js +1 -0
- package/dist/standalone/{chunk-3BP4BTLR.js → chunk-SGDQIWAR.js} +3 -3
- package/dist/standalone/chunk-SYEIXTEU.js +1 -0
- package/dist/standalone/chunk-T5HRXUSY.js +1 -0
- package/dist/standalone/{chunk-OD2POGPJ.js → chunk-TDL7NEWA.js} +1 -1
- package/dist/standalone/chunk-TM7CMA7X.js +1 -0
- package/dist/standalone/chunk-U4OAQPBT.js +1 -0
- package/dist/standalone/chunk-UDSVXA42.js +1 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-VEZO7G5Q.js +3 -0
- package/dist/standalone/chunk-VSHUSN6T.js +1 -0
- package/dist/standalone/chunk-VYMCCC6O.js +1 -0
- package/dist/standalone/{chunk-7RYIQKZA.js → chunk-WXPWVBIY.js} +1 -1
- package/dist/standalone/chunk-X72PYOEW.js +1 -0
- package/dist/standalone/chunk-X7MMBSNW.js +1 -0
- package/dist/standalone/{chunk-6RC6L33K.js → chunk-XIGIWZLO.js} +3 -3
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/{chunk-NNISYDNI.js → chunk-XUGSA2NG.js} +1 -1
- package/dist/standalone/{chunk-VXBZQIGY.js → chunk-Y2ZPNDL7.js} +1 -1
- package/dist/standalone/chunk-YM6BBZDN.js +1 -0
- package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
- package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
- package/dist/standalone/studio.js +30 -30
- package/dist/styles.css +1 -1
- package/package.json +6 -5
- package/dist/standalone/chunk-2PDQ4KZ6.js +0 -1
- package/dist/standalone/chunk-57LYXHXH.js +0 -1
- package/dist/standalone/chunk-63XKJQTQ.js +0 -1
- package/dist/standalone/chunk-7POIIWC5.js +0 -3
- package/dist/standalone/chunk-AB6QGMBF.js +0 -1
- package/dist/standalone/chunk-D7HKX4DI.js +0 -1
- package/dist/standalone/chunk-DGWTR4G7.js +0 -1
- package/dist/standalone/chunk-DSX53PBM.js +0 -1
- package/dist/standalone/chunk-DV2MNASX.js +0 -1
- package/dist/standalone/chunk-E7AVZZKO.js +0 -1
- package/dist/standalone/chunk-EGJX34WM.js +0 -1
- package/dist/standalone/chunk-FCR3HKFV.js +0 -1
- package/dist/standalone/chunk-FQKNJSRA.js +0 -76
- package/dist/standalone/chunk-GABMIICA.js +0 -1
- package/dist/standalone/chunk-GZXPPJVK.js +0 -1
- package/dist/standalone/chunk-HFBRE65A.js +0 -1
- package/dist/standalone/chunk-HFMQNUBC.js +0 -1
- package/dist/standalone/chunk-HG7Q5B3H.js +0 -1
- package/dist/standalone/chunk-HTQL7AXU.js +0 -1
- package/dist/standalone/chunk-KG3QTFWE.js +0 -1
- package/dist/standalone/chunk-KODWGUAB.js +0 -1
- package/dist/standalone/chunk-MGFEVTRI.js +0 -1
- package/dist/standalone/chunk-N2QDG3MW.js +0 -1
- package/dist/standalone/chunk-O4PXDNR3.js +0 -1
- package/dist/standalone/chunk-OXCK3ZUG.js +0 -1
- package/dist/standalone/chunk-P7DSVO4U.js +0 -1
- package/dist/standalone/chunk-PKAM3N5C.js +0 -1
- package/dist/standalone/chunk-QGXGBHQO.js +0 -1
- package/dist/standalone/chunk-QHA3TAEJ.js +0 -1
- package/dist/standalone/chunk-QQWC62X7.js +0 -1
- package/dist/standalone/chunk-S53RUBW5.js +0 -1
- package/dist/standalone/chunk-SB4GT6PK.js +0 -1
- package/dist/standalone/chunk-SHIOUDOT.js +0 -1
- package/dist/standalone/chunk-SIDRSX7Y.js +0 -1
- package/dist/standalone/chunk-VJPQUBN6.js +0 -8
- package/dist/standalone/chunk-VMJKJWG6.js +0 -1
- package/dist/standalone/chunk-VPDPN5RR.js +0 -2
- package/dist/standalone/chunk-VSEGZA3J.js +0 -1
- package/dist/standalone/chunk-W7PCVQTE.js +0 -1
- package/dist/standalone/chunk-XLILSHPE.js +0 -1
- package/dist/standalone/chunk-XURNGQSS.js +0 -1
- package/dist/standalone/chunk-YQQJ4N6U.js +0 -1
- package/dist/standalone/chunk-ZH7UES4T.js +0 -2
- package/dist/standalone/chunk-ZQCVDXDL.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as pe,c as fn,d as gn,e as xn}from"./chunk-6VTGE3WJ.js";import{a as Rn}from"./chunk-UGMRUEBU.js";import{a as $o,c as Ko,d as Qo,e as dn}from"./chunk-ITLLHEVG.js";import{A as it,C as To,F as U,G as wo,H as ko,K as _o,M as Do,N as Ao,Q as Vo,R as Bo,S as Fo,U as Lo,V as Uo,W as Go,X as Ho,Y as jo,_ as Yo,aa as zo,ca as Jo,da as at,ea as Wo,fa as Xo,ga as ut,ja as qo,ka as Gt,la as Ge,n as Ut,oa as Zo,p as Eo,pa as en,q as Io,qa as on,ra as nn,s as yo,sa as rn,t as nt,ta as sn,u as rt,ua as an,v as Po,w as st,wa as un,x as So,xa as cn,y as No,ya as pn,z as Oo}from"./chunk-NNISYDNI.js";import{b as tn}from"./chunk-5OIBXYZM.js";import{i as ln,k as mn}from"./chunk-4QHKBC77.js";import{C as Se,I as Fe,J as vo,K as Le,L as tt,M as ot,O as y,P as J,d as Ft,e as ee,h as We,i as Co,p as Lt}from"./chunk-BHTPZS7L.js";import{a as ct,b as Ue}from"./chunk-YQQJ4N6U.js";import{a as me,b as xo,c as Be,i as Mo,q as ho,t as bo}from"./chunk-TICVNLPM.js";import{a as he,c as go,d as et,f as Ro,h as Je,i as ce,j as E}from"./chunk-ZH7UES4T.js";import{a as Me}from"./chunk-3OA7PECS.js";import{a as n,d as Xn,e as f,f as C,g as qn,h as Qn,j as Ve}from"./chunk-RRCPZMC2.js";var ke=f(qn(),1),Oc=f(C(),1);var te={};Xn(te,{Arrow:()=>Ht,Backdrop:()=>jt,CheckboxItem:()=>$t,CheckboxItemIndicator:()=>Kt,Group:()=>zt,GroupLabel:()=>Jt,Handle:()=>Qe,Item:()=>Wt,LinkItem:()=>Xt,Popup:()=>qt,Portal:()=>Zt,Positioner:()=>eo,RadioGroup:()=>oo,RadioItem:()=>no,RadioItemIndicator:()=>ro,Root:()=>qe,Separator:()=>Rn,SubmenuRoot:()=>Vn,SubmenuTrigger:()=>po,Trigger:()=>uo,Viewport:()=>co,createHandle:()=>jn});var Mn=f(C(),1);var pt=f(C(),1);var dt=pt.createContext(void 0);dt.displayName="MenuPositionerContext";function W(t){let e=pt.useContext(dt);if(e===void 0&&!t)throw new Error("Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.");return e}n(W,"useMenuPositionerContext");var lt=f(C(),1);var mt=lt.createContext(void 0);mt.displayName="MenuRootContext";function O(t){let e=lt.useContext(mt);if(e===void 0&&!t)throw new Error("Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.");return e}n(O,"useMenuRootContext");var Ht=Mn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,...d}=e,{store:l}=O(),{arrowRef:r,side:m,align:R,arrowUncentered:g,arrowStyles:x}=W(),v={open:l.useState("open"),side:m,align:R,uncentered:g};return E("div",e,{ref:[r,o],stateAttributesMapping:Ge,state:v,props:{style:x,"aria-hidden":!0,...d}})},"MenuArrow"));Ht.displayName="MenuArrow";var bn=f(C(),1);var ft=f(C(),1);var hn=ft.createContext(void 0);hn.displayName="ContextMenuRootContext";function be(t=!0){let e=ft.useContext(hn);if(e===void 0&&!t)throw new Error("Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.");return e}n(be,"useContextMenuRootContext");var Zn={...Ge,...Fe},jt=bn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,...d}=e,{store:l}=O(),r=l.useState("open"),m=l.useState("mounted"),R=l.useState("transitionStatus"),g=l.useState("lastOpenChangeReason"),x=be(),M={open:r,transitionStatus:R};return E("div",e,{ref:x?.backdropRef?[o,x.backdropRef]:o,state:M,stateAttributesMapping:Zn,props:[{role:"presentation",hidden:!m,style:{pointerEvents:g===y.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},d]})},"MenuBackdrop"));jt.displayName="MenuBackdrop";var Mt=f(C(),1);var gt=f(C(),1);var Rt=gt.createContext(void 0);Rt.displayName="MenuCheckboxItemContext";function Cn(){let t=gt.useContext(Rt);if(t===void 0)throw new Error("Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.");return t}n(Cn,"useMenuCheckboxItemContext");var He=f(C(),1);var vn=f(C(),1);function xt(t){let{closeOnClick:e,highlighted:o,id:i,nodeId:u,store:a,typingRef:d,itemRef:l,itemMetadata:r}=t,{events:m}=a.useState("floatingTreeRoot"),R=a.useState("open"),g=be(!0),x=g!==void 0;return vn.useMemo(()=>({id:i,role:"menuitem",tabIndex:R&&o?0:-1,onKeyDown(M){M.key===" "&&d?.current&&M.preventDefault()},onMouseMove(M){u&&m.emit("itemhover",{nodeId:u,target:M.currentTarget})},onClick(M){e&&m.emit("close",{domEvent:M,reason:y.itemPress})},onMouseUp(M){if(g){let v=g.initialCursorPointRef.current;if(g.initialCursorPointRef.current=null,x&&v&&Math.abs(M.clientX-v.x)<=1&&Math.abs(M.clientY-v.y)<=1||x&&!Co.os.mac&&M.button===2)return}l.current&&a.context.allowMouseUpTriggerRef.current&&(!x||M.button===2)&&(!r||r.type==="regular-item")&&l.current.click()}}),[e,o,i,m,u,R,a,d,l,g,x,r])}n(xt,"useMenuItemCommonProps");var je={type:"regular-item"};function Ne(t){let{closeOnClick:e,disabled:o=!1,highlighted:i,id:u,store:a,typingRef:d=a.context.typingRef,nativeButton:l,itemMetadata:r,nodeId:m}=t,R=a.useState("disabled"),g=o||R,x=He.useRef(null),{getButtonProps:M,buttonRef:v}=Ue({disabled:g,focusableWhenDisabled:!0,native:l,composite:!0}),S=xt({closeOnClick:e,highlighted:i,id:u,nodeId:m,store:a,typingRef:d,itemRef:x,itemMetadata:r}),c=He.useCallback(b=>he(S,{onMouseEnter(){r.type==="submenu-trigger"&&r.setActive()}},b,M),[S,M,r]),h=et(x,v);return He.useMemo(()=>({getItemProps:c,itemRef:h}),[c,h])}n(Ne,"useMenuItem");var Yt=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.highlighted="data-highlighted",t})({});var Oe={checked(t){return t?{[Yt.checked]:""}:{[Yt.unchecked]:""}},...Fe};var En=f(Me(),1);var $t=Mt.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,nativeButton:l=!1,disabled:r=!1,closeOnClick:m=!1,checked:R,defaultChecked:g,onCheckedChange:x,style:M,...v}=e,S=pe({label:d}),c=W(!0),h=ee(a),{store:b}=O(),p=b.useState("isActive",S.index),T=b.useState("itemProps"),[V,s]=ot({controlled:R,default:g??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:k,itemRef:P}=Ne({closeOnClick:m,disabled:r,highlighted:p,id:h,store:b,nativeButton:l,nodeId:c?.context.nodeId,itemMetadata:je}),H=Mt.useMemo(()=>({disabled:r,highlighted:p,checked:V}),[r,p,V]);function N(D){let F=J(y.itemPress,D.nativeEvent,void 0,{preventUnmountOnClose(){}});x?.(!V,F),!F.isCanceled&&s(Y=>!Y)}n(N,"handleClick");let _=E("div",e,{state:H,stateAttributesMapping:Oe,props:[T,{role:"menuitemcheckbox","aria-checked":V,onClick:N},v,k],ref:[P,o,S.ref]});return(0,En.jsx)(Rt.Provider,{value:H,children:_})},"MenuCheckboxItem"));$t.displayName="MenuCheckboxItem";var ht=f(C(),1);var Kt=ht.forwardRef(n(function(e,o){let{render:i,className:u,style:a,keepMounted:d=!1,...l}=e,r=Cn(),m=ht.useRef(null),{transitionStatus:R,setMounted:g}=tt(r.checked);Le({open:r.checked,ref:m,onComplete(){r.checked||g(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:R};return E("span",e,{state:x,ref:[o,m],stateAttributesMapping:Oe,props:{"aria-hidden":!0,...l},enabled:d||r.checked})},"MenuCheckboxItemIndicator"));Kt.displayName="MenuCheckboxItemIndicator";var Ct=f(C(),1);var bt=f(C(),1);var Ye=bt.createContext(void 0);Ye.displayName="MenuGroupContext";function In(){let t=bt.useContext(Ye);if(t===void 0)throw new Error("Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.");return t}n(In,"useMenuGroupRootContext");var yn=f(Me(),1);var zt=Ct.forwardRef(n(function(e,o){let{render:i,className:u,style:a,...d}=e,[l,r]=Ct.useState(void 0),m=E("div",e,{ref:o,props:{role:"group","aria-labelledby":l,...d}});return(0,yn.jsx)(Ye.Provider,{value:r,children:m})},"MenuGroup"));zt.displayName="MenuGroup";var Pn=f(C(),1);var Jt=Pn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,id:d,...l}=e,r=ee(d),m=In();return me(()=>(m(r),()=>{m(void 0)}),[m,r]),E("div",e,{ref:o,props:{id:r,role:"presentation",...l}})},"MenuGroupLabel"));Jt.displayName="MenuGroupLabel";var Sn=f(C(),1);var Wt=Sn.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,nativeButton:l=!1,disabled:r=!1,closeOnClick:m=!0,style:R,...g}=e,x=pe({label:d}),M=W(!0),v=ee(a),{store:S}=O(),c=S.useState("isActive",x.index),h=S.useState("itemProps"),{getItemProps:b,itemRef:p}=Ne({closeOnClick:m,disabled:r,highlighted:c,id:v,store:S,nativeButton:l,nodeId:M?.context.nodeId,itemMetadata:je});return E("div",e,{state:{disabled:r,highlighted:c},props:[h,g,b],ref:[p,o,x.ref]})},"MenuItem"));Wt.displayName="MenuItem";var vt=f(C(),1);var Xt=vt.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,closeOnClick:l=!1,style:r,...m}=e,R=vt.useRef(null),g=pe({label:d}),M=W(!0)?.context.nodeId,v=ee(a),{store:S}=O(),c=S.useState("isActive",g.index),h=S.useState("itemProps"),b=S.context.typingRef,{getButtonProps:p,buttonRef:T}=Ue({native:!1,composite:!0}),V=xt({closeOnClick:l,highlighted:c,id:v,nodeId:M,store:S,typingRef:b,itemRef:R});function s(P){return he(V,P,p)}return n(s,"getItemProps"),E("a",e,{state:{highlighted:c},props:[h,m,s],ref:[R,T,o,g.ref]})},"MenuLinkItem"));Xt.displayName="MenuLinkItem";var $e=f(C(),1);var Nn=f(Me(),1);var er={...Ge,...Fe},qt=$e.forwardRef(n(function(e,o){let{render:i,className:u,style:a,finalFocus:d,...l}=e,{store:r}=O(),{side:m,align:R}=W(),g=pn(!0)!=null,x=r.useState("open"),M=r.useState("transitionStatus"),v=r.useState("popupProps"),S=r.useState("mounted"),c=r.useState("instantType"),h=r.useState("activeTriggerElement"),b=r.useState("parent"),p=r.useState("lastOpenChangeReason"),T=r.useState("rootId"),V=r.useState("floatingRootContext"),s=r.useState("floatingTreeRoot"),k=r.useState("closeDelay"),P=r.useState("activeTriggerElement"),H=r.useState("hoverEnabled"),N=r.useState("disabled"),_=r.useState("openMethod"),D=b.type==="context-menu";Le({open:x,ref:r.context.popupRef,onComplete(){x&&r.context.onOpenChangeComplete?.(!0)}}),$e.useEffect(()=>{function K(w){r.setOpen(!1,J(w.reason,w.domEvent))}return n(K,"handleClose"),s.events.on("close",K),()=>{s.events.off("close",K)}},[s.events,r]),Jo(V,{enabled:H&&!N&&!D&&b.type!=="menubar",closeDelay:k});let F=$e.useCallback(K=>{r.set("popupElement",K)},[r]),Y={transitionStatus:M,side:m,align:R,open:x,nested:b.type==="menu",instant:c},$=E("div",e,{state:Y,ref:[o,r.context.popupRef,F],stateAttributesMapping:er,props:[v,{onKeyDown(K){g&&cn.has(K.key)&&K.stopPropagation()}},sn(M),l,{"data-rootownerid":T}]}),q=b.type===void 0||D;return(h||b.type==="menubar"&&p!==y.outsidePress)&&(q=!0),(0,Nn.jsx)(Oo,{context:V,openInteractionType:_,modal:D,disabled:!S,returnFocus:d===void 0?q:d,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?s:void 0,previousFocusableElement:P,nextFocusableElement:b.type===void 0?r.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?r.context.beforeContentFocusGuardRef:void 0,children:$})},"MenuPopup"));qt.displayName="MenuPopup";var Tn=f(C(),1);var Et=f(C(),1);var It=Et.createContext(void 0);It.displayName="MenuPortalContext";function On(){let t=Et.useContext(It);if(t===void 0)throw new Error("Base UI: <Menu.Portal> is missing.");return t}n(On,"useMenuPortalContext");var Qt=f(Me(),1);var Zt=Tn.forwardRef(n(function(e,o){let{keepMounted:i=!1,...u}=e,{store:a}=O();return a.useState("mounted")||i?(0,Qt.jsx)(It.Provider,{value:i,children:(0,Qt.jsx)(yo,{ref:o,...u})}):null},"MenuPortal"));Zt.displayName="MenuPortal";var Ce=f(C(),1);var Ke=f(Me(),1);var eo=Ce.forwardRef(n(function(e,o){let{anchor:i,positionMethod:u="absolute",className:a,render:d,side:l,align:r,sideOffset:m=0,alignOffset:R=0,collisionBoundary:g="clipping-ancestors",collisionPadding:x=5,arrowPadding:M=5,sticky:v=!1,disableAnchorTracking:S=!1,collisionAvoidance:c=Eo,style:h,...b}=e,{store:p}=O(),T=On(),V=be(!0),s=p.useState("parent"),k=p.useState("floatingRootContext"),P=p.useState("floatingTreeRoot"),H=p.useState("mounted"),N=p.useState("open"),_=p.useState("modal"),D=p.useState("openMethod"),F=p.useState("activeTriggerElement"),Y=p.useState("transitionStatus"),$=p.useState("positionerElement"),q=p.useState("instantType"),K=p.useState("hasViewport"),w=p.useState("lastOpenChangeReason"),Q=p.useState("floatingNodeId"),ne=p.useState("floatingParentNodeId"),ve=k.useState("domReferenceElement"),de=Ce.useRef(null),ie=vo($,!1,!1),fe=i,ge=m,ye=R,j=r,re=c;s.type==="context-menu"&&(fe=i??s.context?.anchor,j=j??"start",!l&&j!=="center"&&(ye=e.alignOffset??2,ge=e.sideOffset??-5));let ae=l,Re=j;s.type==="menu"?(ae=ae??"inline-end",Re=Re??"start",re=e.collisionAvoidance??Io):s.type==="menubar"&&(ae=ae??(s.context.orientation==="vertical"?"inline-end":"bottom"),Re=Re??"start");let xe=s.type==="context-menu",se=nn({anchor:fe,floatingRootContext:k,positionMethod:V?"fixed":u,mounted:H,side:ae,sideOffset:ge,align:Re,alignOffset:ye,arrowPadding:xe?0:M,collisionBoundary:g,collisionPadding:x,sticky:v,nodeId:Q,keepMounted:T,disableAnchorTracking:S,collisionAvoidance:re,shiftCrossAxis:xe&&!("side"in re&&re.side==="flip"),externalTree:P,adaptiveOrigin:K?on:void 0});Ce.useEffect(()=>{function B(A){A.open&&(A.parentNodeId===Q&&p.set("hoverEnabled",!1),A.nodeId!==Q&&A.parentNodeId===p.select("floatingParentNodeId")&&p.setOpen(!1,J(y.siblingOpen)))}return n(B,"onMenuOpenChange"),P.events.on("menuopenchange",B),()=>{P.events.off("menuopenchange",B)}},[p,P.events,Q]),Ce.useEffect(()=>{if(p.select("floatingParentNodeId")==null)return;function B(A){if(A.open||A.nodeId!==p.select("floatingParentNodeId"))return;let Ee=A.reason??y.siblingOpen;p.setOpen(!1,J(Ee))}return n(B,"onParentClose"),P.events.on("menuopenchange",B),()=>{P.events.off("menuopenchange",B)}},[P.events,p]);let ue=Se();Ce.useEffect(()=>{N||ue.clear()},[N,ue]),Ce.useEffect(()=>{function B(A){if(!(!N||A.nodeId!==p.select("floatingParentNodeId")))if(A.target&&F&&F!==A.target){let Ee=p.select("closeDelay");Ee>0?ue.isStarted()||ue.start(Ee,()=>{p.setOpen(!1,J(y.siblingOpen))}):p.setOpen(!1,J(y.siblingOpen))}else ue.clear()}return n(B,"onItemHover"),P.events.on("itemhover",B),()=>{P.events.off("itemhover",B)}},[P.events,N,F,p,ue]),Ce.useEffect(()=>{let B={open:N,nodeId:Q,parentNodeId:ne,reason:p.select("lastOpenChangeReason")};P.events.emit("menuopenchange",B)},[P.events,N,p,Q,ne]),me(()=>{let B=ve,A=de.current;if(B&&(de.current=B),A&&B&&B!==A){p.set("instantType",void 0);let Ee=new AbortController;return ie(()=>{p.set("instantType","trigger-change")},Ee.signal),()=>{Ee.abort()}}},[ve,ie,p]);let _e={open:N,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:s.type==="menu",instant:q},Pe=s.type==="menubar"&&s.context.modal,le=_&&w!==y.triggerHover;un(N&&(Pe||le),D==="touch",$,F);let De=an(e,_e,{styles:se.positionerStyles,transitionStatus:Y,props:b,refs:[o,p.useStateSetter("positionerElement")],hidden:!H,inert:!N}),Ae=H&&s.type!=="menu"&&(s.type!=="menubar"&&_&&w!==y.triggerHover||s.type==="menubar"&&s.context.modal),L=null;return s.type==="menubar"?L=s.context.contentElement:s.type===void 0&&(L=F),(0,Ke.jsxs)(dt.Provider,{value:se,children:[Ae&&(0,Ke.jsx)(rn,{ref:s.type==="context-menu"||s.type==="nested-context-menu"?s.context.internalBackdropRef:null,inert:en(!N),cutout:L}),(0,Ke.jsx)(So,{id:Q,children:(0,Ke.jsx)(fn,{elementsRef:p.context.itemDomElements,labelsRef:p.context.itemLabels,children:De})})]})},"MenuPositioner"));eo.displayName="MenuPositioner";var Te=f(C(),1);var yt=f(C(),1);var Pt=yt.createContext(void 0);Pt.displayName="MenuRadioGroupContext";function wn(){let t=yt.useContext(Pt);if(t===void 0)throw new Error("Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.");return t}n(wn,"useMenuRadioGroupContext");var to=f(Me(),1);var oo=Te.memo(Te.forwardRef(n(function(e,o){let{render:i,className:u,value:a,defaultValue:d,onValueChange:l,disabled:r=!1,style:m,"aria-labelledby":R,...g}=e,[x,M]=Te.useState(void 0),[v,S]=ot({controlled:a,default:d,name:"MenuRadioGroup"}),c=Be((T,V)=>{l?.(T,V),!V.isCanceled&&S(T)}),b=E("div",e,{state:{disabled:r},ref:o,props:{role:"group","aria-labelledby":R??x,"aria-disabled":r||void 0,...g}}),p=Te.useMemo(()=>({value:v,setValue:c,disabled:r}),[v,c,r]);return(0,to.jsx)(Ye.Provider,{value:M,children:(0,to.jsx)(Pt.Provider,{value:p,children:b})})},"MenuRadioGroup")));oo.displayName="MenuRadioGroup";var Ot=f(C(),1);var St=f(C(),1);var Nt=St.createContext(void 0);Nt.displayName="MenuRadioItemContext";function kn(){let t=St.useContext(Nt);if(t===void 0)throw new Error("Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.");return t}n(kn,"useMenuRadioItemContext");var _n=f(Me(),1);var no=Ot.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,nativeButton:l=!1,disabled:r=!1,closeOnClick:m=!1,value:R,style:g,...x}=e,M=pe({label:d}),v=W(!0),S=ee(a),{store:c}=O(),h=c.useState("isActive",M.index),b=c.useState("itemProps"),{value:p,setValue:T,disabled:V}=wn(),s=V||r,k=p===R,{getItemProps:P,itemRef:H}=Ne({closeOnClick:m,disabled:s,highlighted:h,id:S,store:c,nativeButton:l,nodeId:v?.context.nodeId,itemMetadata:je}),N=Ot.useMemo(()=>({disabled:s,highlighted:h,checked:k}),[s,h,k]);function _(F){let Y=J(y.itemPress,F.nativeEvent,void 0,{preventUnmountOnClose(){}});T(R,Y)}n(_,"handleClick");let D=E("div",e,{state:N,stateAttributesMapping:Oe,props:[b,{role:"menuitemradio","aria-checked":k,onClick:_},x,P],ref:[H,o,M.ref]});return(0,_n.jsx)(Nt.Provider,{value:N,children:D})},"MenuRadioItem"));no.displayName="MenuRadioItem";var Tt=f(C(),1);var ro=Tt.forwardRef(n(function(e,o){let{render:i,className:u,style:a,keepMounted:d=!1,...l}=e,r=kn(),m=Tt.useRef(null),{transitionStatus:R,setMounted:g}=tt(r.checked);Le({open:r.checked,ref:m,onComplete(){r.checked||g(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:R};return E("span",e,{state:x,stateAttributesMapping:Oe,ref:[o,m],props:{"aria-hidden":!0,...l},enabled:d||r.checked})},"MenuRadioItemIndicator"));ro.displayName="MenuRadioItemIndicator";var G=f(C(),1);var wt=f(C(),1);var Dn=wt.createContext(null);Dn.displayName="MenubarContext";function kt(t){let e=wt.useContext(Dn);if(e===null&&!t)throw new Error("Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.");return e}n(kt,"useMenubarContext");var Xe=f(C(),1);var tr={...Ko,disabled:U(t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled),modal:U(t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0)),openMethod:U(t=>t.openMethod),allowMouseEnter:U(t=>t.allowMouseEnter),highlightItemOnHover:U(t=>t.highlightItemOnHover),stickIfOpen:U(t=>t.stickIfOpen),parent:U(t=>t.parent),rootId:U(t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId),activeIndex:U(t=>t.activeIndex),isActive:U((t,e)=>t.activeIndex===e),hoverEnabled:U(t=>t.hoverEnabled),instantType:U(t=>t.instantType),lastOpenChangeReason:U(t=>t.openChangeReason),floatingTreeRoot:U(t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot),floatingNodeId:U(t=>t.floatingNodeId),floatingParentNodeId:U(t=>t.floatingParentNodeId),itemProps:U(t=>t.itemProps),closeDelay:U(t=>t.closeDelay),hasViewport:U(t=>t.hasViewport),keyboardEventRelay:U(t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")})},ze=class t extends _o{static{n(this,"MenuStore")}constructor(e){super({...or(),...e},{positionerRef:Xe.createRef(),popupRef:Xe.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Xe.createRef(),beforeContentFocusGuardRef:Xe.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yo},tr),this.unsubscribeParentListener=this.observe("parent",o=>{if(this.unsubscribeParentListener?.(),o.type==="menu"){let i=o.store.select("rootId"),u=o.store.select("floatingTreeRoot"),a=o.store.select("keyboardEventRelay");this.unsubscribeParentListener=o.store.subscribe(()=>{let d=o.store.select("rootId"),l=o.store.select("floatingTreeRoot"),r=o.store.select("keyboardEventRelay");i===d&&u===l&&a===r||(i=d,u=l,a=r,this.notifyAll())}),this.context.allowMouseUpTriggerRef=o.store.context.allowMouseUpTriggerRef;return}o.type!==void 0&&(this.context.allowMouseUpTriggerRef=o.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,o){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:o})}static useStore(e,o){let i=go(()=>new t(o)).current;return e??i}unsubscribeParentListener=null};function or(){return{...$o(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new nt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ce,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}n(or,"createInitialState");var _t=f(C(),1);var Dt=_t.createContext(void 0);Dt.displayName="MenuSubmenuRootContext";function At(){return _t.useContext(Dt)}n(At,"useMenuSubmenuRootContext");var so=f(Me(),1);var qe=wo(n(function(e){let{children:o,open:i,onOpenChange:u,onOpenChangeComplete:a,defaultOpen:d=!1,disabled:l=!1,modal:r,loopFocus:m=!0,orientation:R="vertical",actionsRef:g,closeParentOnEsc:x=!1,handle:M,triggerId:v,defaultTriggerId:S=null,highlightItemOnHover:c=!0}=e,h=be(!0),b=O(!0),p=kt(!0),T=At(),V=G.useMemo(()=>T&&b?{type:"menu",store:b.store}:p?{type:"menubar",context:p}:h&&!b?{type:"context-menu",context:h}:{type:void 0},[h,b,p,T]),s=ze.useStore(M?.store,{open:d,openProp:i,activeTriggerId:S,triggerIdProp:v,parent:V});Lo(s,i,d,S),s.useControlledProp("openProp",i),s.useControlledProp("triggerIdProp",v),s.useContextCallback("onOpenChangeComplete",a);let k=Ft(),P=Ft(),H=s.useState("floatingTreeRoot"),N=st(H),_=rt(),D=s.useState("open"),F=s.useState("activeTriggerElement"),Y=s.useState("positionerElement"),$=s.useState("hoverEnabled"),q=s.useState("disabled"),K=s.useState("lastOpenChangeReason"),w=s.useState("parent"),Q=s.useState("activeIndex"),ne=s.useState("payload"),ve=s.useState("floatingParentNodeId"),de=G.useRef(null),ie=G.useRef(w.type!=="context-menu"),fe=Se(),ge=G.useRef(!0),ye=Se(),j=ve!=null;w.type!==void 0&&r!==void 0&&console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");let{openMethod:re,triggerProps:ae}=Zo(D);s.useSyncedValues({disabled:l,highlightItemOnHover:c,modal:w.type===void 0?r:void 0,openMethod:re,rootId:k}),Go(s);let{forceUnmount:Re}=Ho(D,s,()=>{s.update({allowMouseEnter:!1,stickIfOpen:!0})});me(()=>{h&&!b?s.update({parent:{type:"context-menu",context:h},floatingNodeId:N,floatingParentNodeId:_}):b&&s.update({floatingNodeId:N,floatingParentNodeId:_})},[h,b,N,_,s]),G.useEffect(()=>{if(D||(de.current=null),w.type==="context-menu"){if(!D){fe.clear(),ie.current=!1;return}fe.start(500,()=>{ie.current=!0})}},[fe,D,w.type]),me(()=>{!D&&!$&&s.set("hoverEnabled",!0)},[D,$,s]);let xe=Be((I,z)=>{let Z=z.reason;if(D===I&&z.trigger===F&&K===Z)return;let Jn=Fo(z);if(!I&&z.trigger==null&&(z.trigger=F??void 0),u?.(I,z),z.isCanceled)return;s.state.floatingRootContext.dispatchOpenChange(I,z);let Ze=z.event;if(I===!1&&Ze?.type==="click"&&Ze.pointerType==="touch"&&!ge.current)return;I&&Z===y.triggerFocus?(ge.current=!1,ye.start(300,()=>{ge.current=!0})):(ge.current=!0,ye.clear());let mo=(Z===y.triggerPress||Z===y.itemPress)&&Ze.detail===0&&Ze?.isTrusted,Wn=!I&&(Z===y.escapeKey||Z==null),fo={open:I,openChangeReason:Z};de.current=z.event??null,Bo(fo,I,z.trigger,Jn()),s.update(fo),w.type==="menubar"&&(Z===y.triggerFocus||Z===y.focusOut||Z===y.triggerHover||Z===y.listNavigation||Z===y.siblingOpen)?s.set("instantType","group"):mo||Wn?s.set("instantType",mo?"click":"dismiss"):s.set("instantType",void 0)}),se=Do({popupStore:s,floatingId:P,nested:_!=null,onOpenChange:xe}),ue=se.context.events;G.useEffect(()=>{let I=n(({open:z,eventDetails:Z})=>xe(z,Z),"handleSetOpenEvent");return ue.on("setOpen",I),()=>{ue?.off("setOpen",I)}},[ue,xe]);let _e=G.useCallback(()=>{s.setOpen(!1,J(y.imperativeAction))},[s]);G.useImperativeHandle(g,()=>({unmount:Re,close:_e}),[Re,_e]);let Pe;w.type==="context-menu"&&(Pe=w.context),G.useImperativeHandle(Pe?.positionerRef,()=>Y,[Y]),G.useImperativeHandle(Pe?.actionsRef,()=>({setOpen:xe}),[xe]);let le=To(se,{enabled:!q,bubbles:{escapeKey:x&&w.type==="menu"},outsidePress(){return w.type!=="context-menu"||de.current?.type==="contextmenu"?!0:ie.current},externalTree:j?H:void 0}),De=tn(),Ae=G.useCallback(I=>{s.select("activeIndex")!==I&&s.set("activeIndex",I)},[s]),L=Wo(se,{enabled:!q,listRef:s.context.itemDomElements,activeIndex:Q,nested:w.type!==void 0,loopFocus:m,orientation:R,parentOrientation:w.type==="menubar"?w.context.orientation:void 0,rtl:De==="rtl",disabledIndices:Je,onNavigate:Ae,openOnArrowKeyDown:w.type!=="context-menu",externalTree:j?H:void 0,focusItemOnHover:c}),B=G.useCallback(I=>{s.context.typingRef.current=I},[s]),A=Xo(se,{enabled:!q,listRef:s.context.itemLabels,elementsRef:s.context.itemDomElements,activeIndex:Q,resetMs:500,onMatch:n(I=>{D&&I!==Q&&s.set("activeIndex",I)},"onMatch"),onTyping:B}),Ee=G.useMemo(()=>{let I=he(A.reference,L.reference,le.reference,{onMouseMove(){s.set("allowMouseEnter",!0)}},ae);return I["aria-haspopup"]="menu",I["aria-expanded"]=D,I},[s,A.reference,L.reference,le.reference,ae,D]),Yn=G.useMemo(()=>{let I=he(L.trigger,le.trigger,ae);return I["aria-haspopup"]="menu",I["aria-expanded"]=!1,I},[L.trigger,le.trigger,ae]),$n=G.useMemo(()=>he(Ao,{id:P,role:"menu","aria-labelledby":F?.id,onMouseMove(){s.set("allowMouseEnter",!0),w.type==="menu"&&s.set("hoverEnabled",!1)},onClick(){s.select("hoverEnabled")&&s.set("hoverEnabled",!1)},onKeyDown(I){let z=s.select("keyboardEventRelay");z&&!I.isPropagationStopped()&&z(I)}},A.floating,L.floating,le.floating),[F,P,w.type,s,A.floating,L.floating,le.floating]),Kn=L.item??ce;jo(s,{floatingRootContext:se,activeTriggerProps:Ee,inactiveTriggerProps:Yn,popupProps:$n,itemProps:Kn});let zn=G.useMemo(()=>({store:s,parent:V}),[s,V]),lo=(0,so.jsx)(mt.Provider,{value:zn,children:typeof o=="function"?o({payload:ne}):o});return w.type===void 0||w.type==="context-menu"?(0,so.jsx)(No,{externalTree:H,children:lo}):lo},"MenuRoot"));qe.displayName="MenuRoot";var An=f(C(),1);var io=f(Me(),1);function Vn(t){let e=O().store,o=An.useMemo(()=>({parentMenu:e}),[e]);return(0,io.jsx)(Dt.Provider,{value:o,children:(0,io.jsx)(qe,{...t})})}n(Vn,"MenuSubmenuRoot");var X=f(C(),1);var Bn=f(C(),1);function Fn(t={}){let{highlightItemOnHover:e,highlightedIndex:o,onHighlightedIndexChange:i}=ct(),{ref:u,index:a}=pe(t),d=o===a,l=Bn.useRef(null),r=et(u,l);return{compositeProps:{tabIndex:d?0:-1,onFocus(){i(a)},onMouseMove(){let R=l.current;if(!e||!R)return;let g=R.hasAttribute("disabled")||R.ariaDisabled==="true";!d&&!g&&R.focus()}},compositeRef:r,index:a}}n(Fn,"useCompositeItem");function Ln(t){let{render:e,className:o,style:i,state:u=ce,props:a=Je,refs:d=Je,metadata:l,stateAttributesMapping:r,tag:m="div",...R}=t,{compositeProps:g,compositeRef:x}=Fn({metadata:l});return E(m,t,{state:u,ref:[...d,x],props:[g,...a,R],stateAttributesMapping:r})}n(Ln,"CompositeItem");function ao(t){if(Mo(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid")??void 0;if(!ho(t))return ao(bo(t))}n(ao,"findRootOwnerId");var Vt=f(C(),1);function Un(t){let{enabled:e=!0,mouseDownAction:o,open:i}=t,u=Vt.useRef(!1);return Vt.useMemo(()=>e?{onMouseDown:n(a=>{(o==="open"&&!i||o==="close"&&i)&&(u.current=!0,We(a.currentTarget).addEventListener("click",()=>{u.current=!1},{once:!0}))},"onMouseDown"),onClick:n(a=>{u.current&&(u.current=!1,a.preventBaseUIHandler())},"onClick")}:ce,[e,o,i])}n(Un,"useMixedToggleClickHandler");var we=f(Me(),1);var Bt=2,uo=ko(n(function(e,o){let{render:i,className:u,style:a,disabled:d=!1,nativeButton:l=!0,id:r,openOnHover:m,delay:R=100,closeDelay:g=0,handle:x,payload:M,...v}=e,S=O(!0),c=x?.store??S?.store;if(!c)throw new Error("Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.");let h=ee(r),b=c.useState("isTriggerActive",h),p=c.useState("floatingRootContext"),T=c.useState("isOpenedByTrigger",h),V=c.useState("triggerPopupId",h),s=X.useRef(null),k=rr(),P=ct(!0),H=Po(),N=X.useMemo(()=>H??new nt,[H]),_=st(N),D=rt(),{registerTrigger:F,isMountedByThisTrigger:Y}=Uo(h,s,c,{payload:M,closeDelay:g,parent:k,floatingTreeRoot:N,floatingNodeId:_,floatingParentNodeId:D,keyboardEventRelay:P?.relayKeyboardEvent}),$=k.type==="menubar",q=c.useState("disabled"),K=d||q||$&&k.context.disabled,{getButtonProps:w,buttonRef:Q}=Ue({disabled:K,native:l});X.useEffect(()=>{!T&&k.type===void 0&&(c.context.allowMouseUpTriggerRef.current=!1)},[c,T,k.type]);let ne=X.useRef(null),ve=Se(),de=Be(L=>{if(!ne.current)return;ve.clear(),c.context.allowMouseUpTriggerRef.current=!1;let B=L.target;if(Lt(ne.current,B)||Lt(c.select("positionerElement"),B)||B===ne.current||B!=null&&ao(B)===c.select("rootId"))return;let A=gn(ne.current);L.clientX>=A.left-Bt&&L.clientX<=A.right+Bt&&L.clientY>=A.top-Bt&&L.clientY<=A.bottom+Bt||N.events.emit("close",{domEvent:L,reason:y.cancelOpen})});X.useEffect(()=>{T&&c.select("lastOpenChangeReason")===y.triggerHover&&We(ne.current).addEventListener("mouseup",de,{once:!0})},[T,de,c]);let ie=$&&k.context.hasSubmenuOpen,ge=at(p,{enabled:(m??ie)&&!K&&k.type!=="context-menu"&&(!$||ie&&!Y),handleClose:ut({blockPointerEvents:!$}),mouseOnly:!0,move:!1,restMs:k.type===void 0?R:void 0,delay:{close:g},triggerElementRef:s,externalTree:N,isActiveTrigger:b,isClosing:n(()=>c.select("transitionStatus")==="ending","isClosing")}),ye=nr(T,c.select("lastOpenChangeReason")),j=it(p,{enabled:!K&&k.type!=="context-menu",event:T&&$?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:k.type===void 0?ye:!1}),re=zo(p,{enabled:!K&&ie}),ae=Un({open:T,enabled:$,mouseDownAction:"open"}),Re=X.useMemo(()=>he(re.reference,j.reference),[re.reference,j.reference]),xe=c.useState("triggerProps",Y),{preFocusGuardRef:se,handlePreFocusGuardFocus:ue,handleFocusTargetFocus:_e}=Qo(c,s),Pe={disabled:K,open:T},le=[ne,o,Q,F,s],De=[Re,ge??ce,xe,{"aria-haspopup":"menu","aria-controls":V,id:h,onMouseDown:n(L=>{if(c.select("open"))return;ve.start(200,()=>{c.context.allowMouseUpTriggerRef.current=!0}),We(L.currentTarget).addEventListener("mouseup",de,{once:!0})},"onMouseDown")},$?{role:"menuitem"}:{},ae,v,w],Ae=E("button",e,{enabled:!$,stateAttributesMapping:Gt,state:Pe,ref:le,props:De});return $?(0,we.jsx)(Ln,{tag:"button",render:i,className:u,style:a,state:Pe,refs:le,props:De,stateAttributesMapping:Gt}):T?(0,we.jsxs)(X.Fragment,{children:[(0,we.jsx)(Ut,{ref:se,onFocus:ue},`${h}-pre-focus-guard`),(0,we.jsx)(X.Fragment,{children:Ae},h),(0,we.jsx)(Ut,{ref:c.context.triggerFocusTargetRef,onFocus:_e},`${h}-post-focus-guard`)]}):(0,we.jsx)(X.Fragment,{children:Ae},h)},"MenuTrigger"));uo.displayName="MenuTrigger";function nr(t,e){let o=Se(),[i,u]=X.useState(!1);return me(()=>{t&&e==="trigger-hover"?(u(!0),o.start(500,()=>{u(!1)})):t||(o.clear(),u(!1))},[t,e,o]),i}n(nr,"useStickIfOpen");function rr(){let t=be(!0),e=O(!0),o=kt(!0);return X.useMemo(()=>o?{type:"menubar",context:o}:t&&!e?{type:"context-menu",context:t}:{type:void 0},[t,e,o])}n(rr,"useMenuParent");var Hn=f(C(),1);var Gn=(function(t){return t.popupWidth="--popup-width",t.popupHeight="--popup-height",t})({});var sr={activationDirection:n(t=>t?{"data-activation-direction":t}:null,"activationDirection")},co=Hn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,children:d,...l}=e,{store:r}=O(),{side:m}=W(),R=r.useState("instantType"),{children:g,state:x}=dn({store:r,side:m,cssVars:Gn,children:d}),M={activationDirection:x.activationDirection,transitioning:x.transitioning,instant:R};return E("div",e,{state:M,ref:o,props:[l,{children:g}],stateAttributesMapping:sr})},"MenuViewport"));co.displayName="MenuViewport";var Ie=f(C(),1);var po=Ie.forwardRef(n(function(e,o){let{render:i,className:u,style:a,label:d,id:l,nativeButton:r=!1,openOnHover:m=!0,delay:R=100,closeDelay:g=0,disabled:x=!1,...M}=e,v=pe({label:d}),S=W(),{store:c}=O(),h=ee(l),b=c.useState("open"),p=c.useState("floatingRootContext"),T=c.useState("floatingTreeRoot"),V=c.useState("triggerPopupId",h),s=Vo(h,c),k=Ie.useCallback(j=>{let re=s(j);return j!==null&&c.select("open")&&c.select("activeTriggerId")==null&&c.update({activeTriggerId:h,activeTriggerElement:j,closeDelay:g}),re},[s,g,c,h]),P=Ie.useRef(null),H=Ie.useCallback(j=>{P.current=j,c.set("activeTriggerElement",j)},[c]),N=At();if(!N?.parentMenu)throw new Error("Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");c.useSyncedValue("closeDelay",g);let _=N.parentMenu,D=c.useState("disabled"),F=_.useState("disabled"),Y=x||D||F;me(()=>{let j=P.current;if(j&&xn(j)&&!Y){let re=xo.captureOwnerStack?.()||"";Ro(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${re}`)}});let $=_.useState("itemProps"),q=_.useState("isActive",v.index),K=Ie.useMemo(()=>({type:"submenu-trigger",setActive(){_.select("highlightItemOnHover")&&_.set("activeIndex",v.index)}}),[_,v.index]),{getItemProps:w,itemRef:Q}=Ne({closeOnClick:!1,disabled:Y,highlighted:q,id:h,store:c,typingRef:_.context.typingRef,nativeButton:r,itemMetadata:K,nodeId:S?.context.nodeId}),ne=c.useState("hoverEnabled"),ve=at(p,{enabled:ne&&m&&!Y,handleClose:ut({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:R,delay:{open:R,close:g},shouldOpen:R>0?()=>_.select("allowMouseEnter"):void 0,triggerElementRef:P,externalTree:T,isClosing:n(()=>c.select("transitionStatus")==="ending","isClosing")}),ie=it(p,{enabled:!Y,event:"mousedown",toggle:!m,ignoreMouse:m,stickIfOpen:!1}).reference??ce,fe=c.useState("triggerProps",!0);return delete fe.id,E("div",e,{state:{disabled:Y,highlighted:q,open:b},stateAttributesMapping:qo,props:[ie,ve,fe,$,{"aria-controls":V,tabIndex:b||q?0:-1,onBlur(){q&&_.set("activeIndex",null)}},M,w],ref:[o,v.ref,Q,k,H]})},"MenuSubmenuTrigger"));po.displayName="MenuSubmenuTrigger";var Qe=class{static{n(this,"MenuHandle")}constructor(){this.store=new ze}open(e){let o=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!o)throw new Error(`Base UI: MenuHandle.open: No trigger found with id "${e}".`);this.store.setOpen(!0,J("imperative-action",void 0,o))}close(){this.store.setOpen(!1,J("imperative-action",void 0,void 0))}get isOpen(){return this.store.select("open")}};function jn(){return new Qe}n(jn,"createMenuHandle");var oe=f(Qn(),1);function Dc(t){let e=(0,ke.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=(0,oe.jsxDEV)(te.Root,{"data-slot":"dropdown-menu",...o},void 0,!1),e[2]=o,e[3]=i):i=e[3],i}n(Dc,"DropdownMenu");function Ac(t){let e=(0,ke.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=(0,oe.jsxDEV)(te.Trigger,{"data-slot":"dropdown-menu-trigger",...o},void 0,!1),e[2]=o,e[3]=i):i=e[3],i}n(Ac,"DropdownMenuTrigger");function Vc({align:t="start",alignOffset:e=0,side:o="bottom",sideOffset:i=4,className:u,...a}){return(0,oe.jsxDEV)(te.Portal,{children:(0,oe.jsxDEV)(te.Positioner,{className:"isolate z-50 outline-none",align:t,alignOffset:e,side:o,sideOffset:i,children:(0,oe.jsxDEV)(te.Popup,{"data-slot":"dropdown-menu-content",className:Ve("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md 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-start-2 data-[side=inline-start]:slide-in-from-end-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 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",u),...a},void 0,!1)},void 0,!1)},void 0,!1)}n(Vc,"DropdownMenuContent");function Bc(t){let e=(0,ke.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=(0,oe.jsxDEV)(te.Group,{"data-slot":"dropdown-menu-group",...o},void 0,!1),e[2]=o,e[3]=i):i=e[3],i}n(Bc,"DropdownMenuGroup");function Fc(t){let e=(0,ke.c)(10),o,i,u;e[0]!==t?({className:o,inset:i,...u}=t,e[0]=t,e[1]=o,e[2]=i,e[3]=u):(o=e[1],i=e[2],u=e[3]);let a;e[4]!==o?(a=Ve("px-2 py-2 text-xs text-muted-foreground data-inset:ps-7",o),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==i||e[7]!==u||e[8]!==a?(d=(0,oe.jsxDEV)(te.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":i,className:a,...u},void 0,!1),e[6]=i,e[7]=u,e[8]=a,e[9]=d):d=e[9],d}n(Fc,"DropdownMenuLabel");function Lc({className:t,inset:e,variant:o="default",...i}){return(0,oe.jsxDEV)(te.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":o,className:Ve("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-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",t),...i},void 0,!1)}n(Lc,"DropdownMenuItem");function Uc(t){let e=(0,ke.c)(15),o,i,u,a,d;e[0]!==t?({className:u,children:i,checked:o,inset:a,...d}=t,e[0]=t,e[1]=o,e[2]=i,e[3]=u,e[4]=a,e[5]=d):(o=e[1],i=e[2],u=e[3],a=e[4],d=e[5]);let l;e[6]!==u?(l=Ve("relative flex cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",u),e[6]=u,e[7]=l):l=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=(0,oe.jsxDEV)("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:(0,oe.jsxDEV)(te.CheckboxItemIndicator,{children:(0,oe.jsxDEV)(mn,{icon:ln,strokeWidth:2},void 0,!1)},void 0,!1)},void 0,!1),e[8]=r):r=e[8];let m;return e[9]!==o||e[10]!==i||e[11]!==a||e[12]!==d||e[13]!==l?(m=(0,oe.jsxDEV)(te.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":a,className:l,checked:o,...d,children:[r,i]},void 0,!0),e[9]=o,e[10]=i,e[11]=a,e[12]=d,e[13]=l,e[14]=m):m=e[14],m}n(Uc,"DropdownMenuCheckboxItem");function Gc(t){let e=(0,ke.c)(8),o,i;e[0]!==t?({className:o,...i}=t,e[0]=t,e[1]=o,e[2]=i):(o=e[1],i=e[2]);let u;e[3]!==o?(u=Ve("-mx-1 h-px bg-border",o),e[3]=o,e[4]=u):u=e[4];let a;return e[5]!==i||e[6]!==u?(a=(0,oe.jsxDEV)(te.Separator,{"data-slot":"dropdown-menu-separator",className:u,...i},void 0,!1),e[5]=i,e[6]=u,e[7]=a):a=e[7],a}n(Gc,"DropdownMenuSeparator");export{Dc as a,Ac as b,Vc as c,Bc as d,Fc as e,Lc as f,Uc as g,Gc as h};
|
|
1
|
+
import{b as pe,c as fn,d as gn,e as xn}from"./chunk-QBAT52GB.js";import{a as Rn}from"./chunk-QAFAJBAW.js";import{a as $o,c as Ko,d as Qo,e as dn}from"./chunk-764T6X6X.js";import{A as it,C as To,F as U,G as wo,H as ko,K as _o,M as Do,N as Ao,Q as Vo,R as Bo,S as Fo,U as Lo,V as Uo,W as Go,X as Ho,Y as jo,_ as Yo,aa as zo,ca as Jo,da as at,ea as Wo,fa as Xo,ga as ut,ja as qo,ka as Gt,la as Ge,n as Ut,oa as Zo,p as Eo,pa as en,q as Io,qa as on,ra as nn,s as yo,sa as rn,t as nt,ta as sn,u as rt,ua as an,v as Po,w as st,wa as un,x as So,xa as cn,y as No,ya as pn,z as Oo}from"./chunk-XUGSA2NG.js";import{b as tn}from"./chunk-5OIBXYZM.js";import{i as ln,k as mn}from"./chunk-4QHKBC77.js";import{C as Se,I as Fe,J as vo,K as Le,L as tt,M as ot,O as y,P as J,d as Ft,e as ee,h as We,i as Co,p as Lt}from"./chunk-3CJW6NWG.js";import{a as ct,b as Ue}from"./chunk-UK64ZSUW.js";import{a as me,b as xo,c as Be,i as Mo,q as ho,t as bo}from"./chunk-O3NAGRTR.js";import{a as he,c as go,d as et,f as Ro,h as Je,i as ce,j as E}from"./chunk-CKSHCYGC.js";import{a as Me}from"./chunk-3OA7PECS.js";import{a as n,d as Xn,e as f,f as C,g as qn,h as Qn,j as Ve}from"./chunk-RRCPZMC2.js";var ke=f(qn(),1),Oc=f(C(),1);var te={};Xn(te,{Arrow:()=>Ht,Backdrop:()=>jt,CheckboxItem:()=>$t,CheckboxItemIndicator:()=>Kt,Group:()=>zt,GroupLabel:()=>Jt,Handle:()=>Qe,Item:()=>Wt,LinkItem:()=>Xt,Popup:()=>qt,Portal:()=>Zt,Positioner:()=>eo,RadioGroup:()=>oo,RadioItem:()=>no,RadioItemIndicator:()=>ro,Root:()=>qe,Separator:()=>Rn,SubmenuRoot:()=>Vn,SubmenuTrigger:()=>po,Trigger:()=>uo,Viewport:()=>co,createHandle:()=>jn});var Mn=f(C(),1);var pt=f(C(),1);var dt=pt.createContext(void 0);dt.displayName="MenuPositionerContext";function W(t){let e=pt.useContext(dt);if(e===void 0&&!t)throw new Error("Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.");return e}n(W,"useMenuPositionerContext");var lt=f(C(),1);var mt=lt.createContext(void 0);mt.displayName="MenuRootContext";function O(t){let e=lt.useContext(mt);if(e===void 0&&!t)throw new Error("Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.");return e}n(O,"useMenuRootContext");var Ht=Mn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,...d}=e,{store:l}=O(),{arrowRef:r,side:m,align:R,arrowUncentered:g,arrowStyles:x}=W(),v={open:l.useState("open"),side:m,align:R,uncentered:g};return E("div",e,{ref:[r,o],stateAttributesMapping:Ge,state:v,props:{style:x,"aria-hidden":!0,...d}})},"MenuArrow"));Ht.displayName="MenuArrow";var bn=f(C(),1);var ft=f(C(),1);var hn=ft.createContext(void 0);hn.displayName="ContextMenuRootContext";function be(t=!0){let e=ft.useContext(hn);if(e===void 0&&!t)throw new Error("Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.");return e}n(be,"useContextMenuRootContext");var Zn={...Ge,...Fe},jt=bn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,...d}=e,{store:l}=O(),r=l.useState("open"),m=l.useState("mounted"),R=l.useState("transitionStatus"),g=l.useState("lastOpenChangeReason"),x=be(),M={open:r,transitionStatus:R};return E("div",e,{ref:x?.backdropRef?[o,x.backdropRef]:o,state:M,stateAttributesMapping:Zn,props:[{role:"presentation",hidden:!m,style:{pointerEvents:g===y.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},d]})},"MenuBackdrop"));jt.displayName="MenuBackdrop";var Mt=f(C(),1);var gt=f(C(),1);var Rt=gt.createContext(void 0);Rt.displayName="MenuCheckboxItemContext";function Cn(){let t=gt.useContext(Rt);if(t===void 0)throw new Error("Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.");return t}n(Cn,"useMenuCheckboxItemContext");var He=f(C(),1);var vn=f(C(),1);function xt(t){let{closeOnClick:e,highlighted:o,id:i,nodeId:u,store:a,typingRef:d,itemRef:l,itemMetadata:r}=t,{events:m}=a.useState("floatingTreeRoot"),R=a.useState("open"),g=be(!0),x=g!==void 0;return vn.useMemo(()=>({id:i,role:"menuitem",tabIndex:R&&o?0:-1,onKeyDown(M){M.key===" "&&d?.current&&M.preventDefault()},onMouseMove(M){u&&m.emit("itemhover",{nodeId:u,target:M.currentTarget})},onClick(M){e&&m.emit("close",{domEvent:M,reason:y.itemPress})},onMouseUp(M){if(g){let v=g.initialCursorPointRef.current;if(g.initialCursorPointRef.current=null,x&&v&&Math.abs(M.clientX-v.x)<=1&&Math.abs(M.clientY-v.y)<=1||x&&!Co.os.mac&&M.button===2)return}l.current&&a.context.allowMouseUpTriggerRef.current&&(!x||M.button===2)&&(!r||r.type==="regular-item")&&l.current.click()}}),[e,o,i,m,u,R,a,d,l,g,x,r])}n(xt,"useMenuItemCommonProps");var je={type:"regular-item"};function Ne(t){let{closeOnClick:e,disabled:o=!1,highlighted:i,id:u,store:a,typingRef:d=a.context.typingRef,nativeButton:l,itemMetadata:r,nodeId:m}=t,R=a.useState("disabled"),g=o||R,x=He.useRef(null),{getButtonProps:M,buttonRef:v}=Ue({disabled:g,focusableWhenDisabled:!0,native:l,composite:!0}),S=xt({closeOnClick:e,highlighted:i,id:u,nodeId:m,store:a,typingRef:d,itemRef:x,itemMetadata:r}),c=He.useCallback(b=>he(S,{onMouseEnter(){r.type==="submenu-trigger"&&r.setActive()}},b,M),[S,M,r]),h=et(x,v);return He.useMemo(()=>({getItemProps:c,itemRef:h}),[c,h])}n(Ne,"useMenuItem");var Yt=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.highlighted="data-highlighted",t})({});var Oe={checked(t){return t?{[Yt.checked]:""}:{[Yt.unchecked]:""}},...Fe};var En=f(Me(),1);var $t=Mt.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,nativeButton:l=!1,disabled:r=!1,closeOnClick:m=!1,checked:R,defaultChecked:g,onCheckedChange:x,style:M,...v}=e,S=pe({label:d}),c=W(!0),h=ee(a),{store:b}=O(),p=b.useState("isActive",S.index),T=b.useState("itemProps"),[V,s]=ot({controlled:R,default:g??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:k,itemRef:P}=Ne({closeOnClick:m,disabled:r,highlighted:p,id:h,store:b,nativeButton:l,nodeId:c?.context.nodeId,itemMetadata:je}),H=Mt.useMemo(()=>({disabled:r,highlighted:p,checked:V}),[r,p,V]);function N(D){let F=J(y.itemPress,D.nativeEvent,void 0,{preventUnmountOnClose(){}});x?.(!V,F),!F.isCanceled&&s(Y=>!Y)}n(N,"handleClick");let _=E("div",e,{state:H,stateAttributesMapping:Oe,props:[T,{role:"menuitemcheckbox","aria-checked":V,onClick:N},v,k],ref:[P,o,S.ref]});return(0,En.jsx)(Rt.Provider,{value:H,children:_})},"MenuCheckboxItem"));$t.displayName="MenuCheckboxItem";var ht=f(C(),1);var Kt=ht.forwardRef(n(function(e,o){let{render:i,className:u,style:a,keepMounted:d=!1,...l}=e,r=Cn(),m=ht.useRef(null),{transitionStatus:R,setMounted:g}=tt(r.checked);Le({open:r.checked,ref:m,onComplete(){r.checked||g(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:R};return E("span",e,{state:x,ref:[o,m],stateAttributesMapping:Oe,props:{"aria-hidden":!0,...l},enabled:d||r.checked})},"MenuCheckboxItemIndicator"));Kt.displayName="MenuCheckboxItemIndicator";var Ct=f(C(),1);var bt=f(C(),1);var Ye=bt.createContext(void 0);Ye.displayName="MenuGroupContext";function In(){let t=bt.useContext(Ye);if(t===void 0)throw new Error("Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.");return t}n(In,"useMenuGroupRootContext");var yn=f(Me(),1);var zt=Ct.forwardRef(n(function(e,o){let{render:i,className:u,style:a,...d}=e,[l,r]=Ct.useState(void 0),m=E("div",e,{ref:o,props:{role:"group","aria-labelledby":l,...d}});return(0,yn.jsx)(Ye.Provider,{value:r,children:m})},"MenuGroup"));zt.displayName="MenuGroup";var Pn=f(C(),1);var Jt=Pn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,id:d,...l}=e,r=ee(d),m=In();return me(()=>(m(r),()=>{m(void 0)}),[m,r]),E("div",e,{ref:o,props:{id:r,role:"presentation",...l}})},"MenuGroupLabel"));Jt.displayName="MenuGroupLabel";var Sn=f(C(),1);var Wt=Sn.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,nativeButton:l=!1,disabled:r=!1,closeOnClick:m=!0,style:R,...g}=e,x=pe({label:d}),M=W(!0),v=ee(a),{store:S}=O(),c=S.useState("isActive",x.index),h=S.useState("itemProps"),{getItemProps:b,itemRef:p}=Ne({closeOnClick:m,disabled:r,highlighted:c,id:v,store:S,nativeButton:l,nodeId:M?.context.nodeId,itemMetadata:je});return E("div",e,{state:{disabled:r,highlighted:c},props:[h,g,b],ref:[p,o,x.ref]})},"MenuItem"));Wt.displayName="MenuItem";var vt=f(C(),1);var Xt=vt.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,closeOnClick:l=!1,style:r,...m}=e,R=vt.useRef(null),g=pe({label:d}),M=W(!0)?.context.nodeId,v=ee(a),{store:S}=O(),c=S.useState("isActive",g.index),h=S.useState("itemProps"),b=S.context.typingRef,{getButtonProps:p,buttonRef:T}=Ue({native:!1,composite:!0}),V=xt({closeOnClick:l,highlighted:c,id:v,nodeId:M,store:S,typingRef:b,itemRef:R});function s(P){return he(V,P,p)}return n(s,"getItemProps"),E("a",e,{state:{highlighted:c},props:[h,m,s],ref:[R,T,o,g.ref]})},"MenuLinkItem"));Xt.displayName="MenuLinkItem";var $e=f(C(),1);var Nn=f(Me(),1);var er={...Ge,...Fe},qt=$e.forwardRef(n(function(e,o){let{render:i,className:u,style:a,finalFocus:d,...l}=e,{store:r}=O(),{side:m,align:R}=W(),g=pn(!0)!=null,x=r.useState("open"),M=r.useState("transitionStatus"),v=r.useState("popupProps"),S=r.useState("mounted"),c=r.useState("instantType"),h=r.useState("activeTriggerElement"),b=r.useState("parent"),p=r.useState("lastOpenChangeReason"),T=r.useState("rootId"),V=r.useState("floatingRootContext"),s=r.useState("floatingTreeRoot"),k=r.useState("closeDelay"),P=r.useState("activeTriggerElement"),H=r.useState("hoverEnabled"),N=r.useState("disabled"),_=r.useState("openMethod"),D=b.type==="context-menu";Le({open:x,ref:r.context.popupRef,onComplete(){x&&r.context.onOpenChangeComplete?.(!0)}}),$e.useEffect(()=>{function K(w){r.setOpen(!1,J(w.reason,w.domEvent))}return n(K,"handleClose"),s.events.on("close",K),()=>{s.events.off("close",K)}},[s.events,r]),Jo(V,{enabled:H&&!N&&!D&&b.type!=="menubar",closeDelay:k});let F=$e.useCallback(K=>{r.set("popupElement",K)},[r]),Y={transitionStatus:M,side:m,align:R,open:x,nested:b.type==="menu",instant:c},$=E("div",e,{state:Y,ref:[o,r.context.popupRef,F],stateAttributesMapping:er,props:[v,{onKeyDown(K){g&&cn.has(K.key)&&K.stopPropagation()}},sn(M),l,{"data-rootownerid":T}]}),q=b.type===void 0||D;return(h||b.type==="menubar"&&p!==y.outsidePress)&&(q=!0),(0,Nn.jsx)(Oo,{context:V,openInteractionType:_,modal:D,disabled:!S,returnFocus:d===void 0?q:d,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?s:void 0,previousFocusableElement:P,nextFocusableElement:b.type===void 0?r.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?r.context.beforeContentFocusGuardRef:void 0,children:$})},"MenuPopup"));qt.displayName="MenuPopup";var Tn=f(C(),1);var Et=f(C(),1);var It=Et.createContext(void 0);It.displayName="MenuPortalContext";function On(){let t=Et.useContext(It);if(t===void 0)throw new Error("Base UI: <Menu.Portal> is missing.");return t}n(On,"useMenuPortalContext");var Qt=f(Me(),1);var Zt=Tn.forwardRef(n(function(e,o){let{keepMounted:i=!1,...u}=e,{store:a}=O();return a.useState("mounted")||i?(0,Qt.jsx)(It.Provider,{value:i,children:(0,Qt.jsx)(yo,{ref:o,...u})}):null},"MenuPortal"));Zt.displayName="MenuPortal";var Ce=f(C(),1);var Ke=f(Me(),1);var eo=Ce.forwardRef(n(function(e,o){let{anchor:i,positionMethod:u="absolute",className:a,render:d,side:l,align:r,sideOffset:m=0,alignOffset:R=0,collisionBoundary:g="clipping-ancestors",collisionPadding:x=5,arrowPadding:M=5,sticky:v=!1,disableAnchorTracking:S=!1,collisionAvoidance:c=Eo,style:h,...b}=e,{store:p}=O(),T=On(),V=be(!0),s=p.useState("parent"),k=p.useState("floatingRootContext"),P=p.useState("floatingTreeRoot"),H=p.useState("mounted"),N=p.useState("open"),_=p.useState("modal"),D=p.useState("openMethod"),F=p.useState("activeTriggerElement"),Y=p.useState("transitionStatus"),$=p.useState("positionerElement"),q=p.useState("instantType"),K=p.useState("hasViewport"),w=p.useState("lastOpenChangeReason"),Q=p.useState("floatingNodeId"),ne=p.useState("floatingParentNodeId"),ve=k.useState("domReferenceElement"),de=Ce.useRef(null),ie=vo($,!1,!1),fe=i,ge=m,ye=R,j=r,re=c;s.type==="context-menu"&&(fe=i??s.context?.anchor,j=j??"start",!l&&j!=="center"&&(ye=e.alignOffset??2,ge=e.sideOffset??-5));let ae=l,Re=j;s.type==="menu"?(ae=ae??"inline-end",Re=Re??"start",re=e.collisionAvoidance??Io):s.type==="menubar"&&(ae=ae??(s.context.orientation==="vertical"?"inline-end":"bottom"),Re=Re??"start");let xe=s.type==="context-menu",se=nn({anchor:fe,floatingRootContext:k,positionMethod:V?"fixed":u,mounted:H,side:ae,sideOffset:ge,align:Re,alignOffset:ye,arrowPadding:xe?0:M,collisionBoundary:g,collisionPadding:x,sticky:v,nodeId:Q,keepMounted:T,disableAnchorTracking:S,collisionAvoidance:re,shiftCrossAxis:xe&&!("side"in re&&re.side==="flip"),externalTree:P,adaptiveOrigin:K?on:void 0});Ce.useEffect(()=>{function B(A){A.open&&(A.parentNodeId===Q&&p.set("hoverEnabled",!1),A.nodeId!==Q&&A.parentNodeId===p.select("floatingParentNodeId")&&p.setOpen(!1,J(y.siblingOpen)))}return n(B,"onMenuOpenChange"),P.events.on("menuopenchange",B),()=>{P.events.off("menuopenchange",B)}},[p,P.events,Q]),Ce.useEffect(()=>{if(p.select("floatingParentNodeId")==null)return;function B(A){if(A.open||A.nodeId!==p.select("floatingParentNodeId"))return;let Ee=A.reason??y.siblingOpen;p.setOpen(!1,J(Ee))}return n(B,"onParentClose"),P.events.on("menuopenchange",B),()=>{P.events.off("menuopenchange",B)}},[P.events,p]);let ue=Se();Ce.useEffect(()=>{N||ue.clear()},[N,ue]),Ce.useEffect(()=>{function B(A){if(!(!N||A.nodeId!==p.select("floatingParentNodeId")))if(A.target&&F&&F!==A.target){let Ee=p.select("closeDelay");Ee>0?ue.isStarted()||ue.start(Ee,()=>{p.setOpen(!1,J(y.siblingOpen))}):p.setOpen(!1,J(y.siblingOpen))}else ue.clear()}return n(B,"onItemHover"),P.events.on("itemhover",B),()=>{P.events.off("itemhover",B)}},[P.events,N,F,p,ue]),Ce.useEffect(()=>{let B={open:N,nodeId:Q,parentNodeId:ne,reason:p.select("lastOpenChangeReason")};P.events.emit("menuopenchange",B)},[P.events,N,p,Q,ne]),me(()=>{let B=ve,A=de.current;if(B&&(de.current=B),A&&B&&B!==A){p.set("instantType",void 0);let Ee=new AbortController;return ie(()=>{p.set("instantType","trigger-change")},Ee.signal),()=>{Ee.abort()}}},[ve,ie,p]);let _e={open:N,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:s.type==="menu",instant:q},Pe=s.type==="menubar"&&s.context.modal,le=_&&w!==y.triggerHover;un(N&&(Pe||le),D==="touch",$,F);let De=an(e,_e,{styles:se.positionerStyles,transitionStatus:Y,props:b,refs:[o,p.useStateSetter("positionerElement")],hidden:!H,inert:!N}),Ae=H&&s.type!=="menu"&&(s.type!=="menubar"&&_&&w!==y.triggerHover||s.type==="menubar"&&s.context.modal),L=null;return s.type==="menubar"?L=s.context.contentElement:s.type===void 0&&(L=F),(0,Ke.jsxs)(dt.Provider,{value:se,children:[Ae&&(0,Ke.jsx)(rn,{ref:s.type==="context-menu"||s.type==="nested-context-menu"?s.context.internalBackdropRef:null,inert:en(!N),cutout:L}),(0,Ke.jsx)(So,{id:Q,children:(0,Ke.jsx)(fn,{elementsRef:p.context.itemDomElements,labelsRef:p.context.itemLabels,children:De})})]})},"MenuPositioner"));eo.displayName="MenuPositioner";var Te=f(C(),1);var yt=f(C(),1);var Pt=yt.createContext(void 0);Pt.displayName="MenuRadioGroupContext";function wn(){let t=yt.useContext(Pt);if(t===void 0)throw new Error("Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.");return t}n(wn,"useMenuRadioGroupContext");var to=f(Me(),1);var oo=Te.memo(Te.forwardRef(n(function(e,o){let{render:i,className:u,value:a,defaultValue:d,onValueChange:l,disabled:r=!1,style:m,"aria-labelledby":R,...g}=e,[x,M]=Te.useState(void 0),[v,S]=ot({controlled:a,default:d,name:"MenuRadioGroup"}),c=Be((T,V)=>{l?.(T,V),!V.isCanceled&&S(T)}),b=E("div",e,{state:{disabled:r},ref:o,props:{role:"group","aria-labelledby":R??x,"aria-disabled":r||void 0,...g}}),p=Te.useMemo(()=>({value:v,setValue:c,disabled:r}),[v,c,r]);return(0,to.jsx)(Ye.Provider,{value:M,children:(0,to.jsx)(Pt.Provider,{value:p,children:b})})},"MenuRadioGroup")));oo.displayName="MenuRadioGroup";var Ot=f(C(),1);var St=f(C(),1);var Nt=St.createContext(void 0);Nt.displayName="MenuRadioItemContext";function kn(){let t=St.useContext(Nt);if(t===void 0)throw new Error("Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.");return t}n(kn,"useMenuRadioItemContext");var _n=f(Me(),1);var no=Ot.forwardRef(n(function(e,o){let{render:i,className:u,id:a,label:d,nativeButton:l=!1,disabled:r=!1,closeOnClick:m=!1,value:R,style:g,...x}=e,M=pe({label:d}),v=W(!0),S=ee(a),{store:c}=O(),h=c.useState("isActive",M.index),b=c.useState("itemProps"),{value:p,setValue:T,disabled:V}=wn(),s=V||r,k=p===R,{getItemProps:P,itemRef:H}=Ne({closeOnClick:m,disabled:s,highlighted:h,id:S,store:c,nativeButton:l,nodeId:v?.context.nodeId,itemMetadata:je}),N=Ot.useMemo(()=>({disabled:s,highlighted:h,checked:k}),[s,h,k]);function _(F){let Y=J(y.itemPress,F.nativeEvent,void 0,{preventUnmountOnClose(){}});T(R,Y)}n(_,"handleClick");let D=E("div",e,{state:N,stateAttributesMapping:Oe,props:[b,{role:"menuitemradio","aria-checked":k,onClick:_},x,P],ref:[H,o,M.ref]});return(0,_n.jsx)(Nt.Provider,{value:N,children:D})},"MenuRadioItem"));no.displayName="MenuRadioItem";var Tt=f(C(),1);var ro=Tt.forwardRef(n(function(e,o){let{render:i,className:u,style:a,keepMounted:d=!1,...l}=e,r=kn(),m=Tt.useRef(null),{transitionStatus:R,setMounted:g}=tt(r.checked);Le({open:r.checked,ref:m,onComplete(){r.checked||g(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:R};return E("span",e,{state:x,stateAttributesMapping:Oe,ref:[o,m],props:{"aria-hidden":!0,...l},enabled:d||r.checked})},"MenuRadioItemIndicator"));ro.displayName="MenuRadioItemIndicator";var G=f(C(),1);var wt=f(C(),1);var Dn=wt.createContext(null);Dn.displayName="MenubarContext";function kt(t){let e=wt.useContext(Dn);if(e===null&&!t)throw new Error("Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.");return e}n(kt,"useMenubarContext");var Xe=f(C(),1);var tr={...Ko,disabled:U(t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled),modal:U(t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0)),openMethod:U(t=>t.openMethod),allowMouseEnter:U(t=>t.allowMouseEnter),highlightItemOnHover:U(t=>t.highlightItemOnHover),stickIfOpen:U(t=>t.stickIfOpen),parent:U(t=>t.parent),rootId:U(t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId),activeIndex:U(t=>t.activeIndex),isActive:U((t,e)=>t.activeIndex===e),hoverEnabled:U(t=>t.hoverEnabled),instantType:U(t=>t.instantType),lastOpenChangeReason:U(t=>t.openChangeReason),floatingTreeRoot:U(t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot),floatingNodeId:U(t=>t.floatingNodeId),floatingParentNodeId:U(t=>t.floatingParentNodeId),itemProps:U(t=>t.itemProps),closeDelay:U(t=>t.closeDelay),hasViewport:U(t=>t.hasViewport),keyboardEventRelay:U(t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")})},ze=class t extends _o{static{n(this,"MenuStore")}constructor(e){super({...or(),...e},{positionerRef:Xe.createRef(),popupRef:Xe.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Xe.createRef(),beforeContentFocusGuardRef:Xe.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yo},tr),this.unsubscribeParentListener=this.observe("parent",o=>{if(this.unsubscribeParentListener?.(),o.type==="menu"){let i=o.store.select("rootId"),u=o.store.select("floatingTreeRoot"),a=o.store.select("keyboardEventRelay");this.unsubscribeParentListener=o.store.subscribe(()=>{let d=o.store.select("rootId"),l=o.store.select("floatingTreeRoot"),r=o.store.select("keyboardEventRelay");i===d&&u===l&&a===r||(i=d,u=l,a=r,this.notifyAll())}),this.context.allowMouseUpTriggerRef=o.store.context.allowMouseUpTriggerRef;return}o.type!==void 0&&(this.context.allowMouseUpTriggerRef=o.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,o){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:o})}static useStore(e,o){let i=go(()=>new t(o)).current;return e??i}unsubscribeParentListener=null};function or(){return{...$o(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new nt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ce,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}n(or,"createInitialState");var _t=f(C(),1);var Dt=_t.createContext(void 0);Dt.displayName="MenuSubmenuRootContext";function At(){return _t.useContext(Dt)}n(At,"useMenuSubmenuRootContext");var so=f(Me(),1);var qe=wo(n(function(e){let{children:o,open:i,onOpenChange:u,onOpenChangeComplete:a,defaultOpen:d=!1,disabled:l=!1,modal:r,loopFocus:m=!0,orientation:R="vertical",actionsRef:g,closeParentOnEsc:x=!1,handle:M,triggerId:v,defaultTriggerId:S=null,highlightItemOnHover:c=!0}=e,h=be(!0),b=O(!0),p=kt(!0),T=At(),V=G.useMemo(()=>T&&b?{type:"menu",store:b.store}:p?{type:"menubar",context:p}:h&&!b?{type:"context-menu",context:h}:{type:void 0},[h,b,p,T]),s=ze.useStore(M?.store,{open:d,openProp:i,activeTriggerId:S,triggerIdProp:v,parent:V});Lo(s,i,d,S),s.useControlledProp("openProp",i),s.useControlledProp("triggerIdProp",v),s.useContextCallback("onOpenChangeComplete",a);let k=Ft(),P=Ft(),H=s.useState("floatingTreeRoot"),N=st(H),_=rt(),D=s.useState("open"),F=s.useState("activeTriggerElement"),Y=s.useState("positionerElement"),$=s.useState("hoverEnabled"),q=s.useState("disabled"),K=s.useState("lastOpenChangeReason"),w=s.useState("parent"),Q=s.useState("activeIndex"),ne=s.useState("payload"),ve=s.useState("floatingParentNodeId"),de=G.useRef(null),ie=G.useRef(w.type!=="context-menu"),fe=Se(),ge=G.useRef(!0),ye=Se(),j=ve!=null;w.type!==void 0&&r!==void 0&&console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");let{openMethod:re,triggerProps:ae}=Zo(D);s.useSyncedValues({disabled:l,highlightItemOnHover:c,modal:w.type===void 0?r:void 0,openMethod:re,rootId:k}),Go(s);let{forceUnmount:Re}=Ho(D,s,()=>{s.update({allowMouseEnter:!1,stickIfOpen:!0})});me(()=>{h&&!b?s.update({parent:{type:"context-menu",context:h},floatingNodeId:N,floatingParentNodeId:_}):b&&s.update({floatingNodeId:N,floatingParentNodeId:_})},[h,b,N,_,s]),G.useEffect(()=>{if(D||(de.current=null),w.type==="context-menu"){if(!D){fe.clear(),ie.current=!1;return}fe.start(500,()=>{ie.current=!0})}},[fe,D,w.type]),me(()=>{!D&&!$&&s.set("hoverEnabled",!0)},[D,$,s]);let xe=Be((I,z)=>{let Z=z.reason;if(D===I&&z.trigger===F&&K===Z)return;let Jn=Fo(z);if(!I&&z.trigger==null&&(z.trigger=F??void 0),u?.(I,z),z.isCanceled)return;s.state.floatingRootContext.dispatchOpenChange(I,z);let Ze=z.event;if(I===!1&&Ze?.type==="click"&&Ze.pointerType==="touch"&&!ge.current)return;I&&Z===y.triggerFocus?(ge.current=!1,ye.start(300,()=>{ge.current=!0})):(ge.current=!0,ye.clear());let mo=(Z===y.triggerPress||Z===y.itemPress)&&Ze.detail===0&&Ze?.isTrusted,Wn=!I&&(Z===y.escapeKey||Z==null),fo={open:I,openChangeReason:Z};de.current=z.event??null,Bo(fo,I,z.trigger,Jn()),s.update(fo),w.type==="menubar"&&(Z===y.triggerFocus||Z===y.focusOut||Z===y.triggerHover||Z===y.listNavigation||Z===y.siblingOpen)?s.set("instantType","group"):mo||Wn?s.set("instantType",mo?"click":"dismiss"):s.set("instantType",void 0)}),se=Do({popupStore:s,floatingId:P,nested:_!=null,onOpenChange:xe}),ue=se.context.events;G.useEffect(()=>{let I=n(({open:z,eventDetails:Z})=>xe(z,Z),"handleSetOpenEvent");return ue.on("setOpen",I),()=>{ue?.off("setOpen",I)}},[ue,xe]);let _e=G.useCallback(()=>{s.setOpen(!1,J(y.imperativeAction))},[s]);G.useImperativeHandle(g,()=>({unmount:Re,close:_e}),[Re,_e]);let Pe;w.type==="context-menu"&&(Pe=w.context),G.useImperativeHandle(Pe?.positionerRef,()=>Y,[Y]),G.useImperativeHandle(Pe?.actionsRef,()=>({setOpen:xe}),[xe]);let le=To(se,{enabled:!q,bubbles:{escapeKey:x&&w.type==="menu"},outsidePress(){return w.type!=="context-menu"||de.current?.type==="contextmenu"?!0:ie.current},externalTree:j?H:void 0}),De=tn(),Ae=G.useCallback(I=>{s.select("activeIndex")!==I&&s.set("activeIndex",I)},[s]),L=Wo(se,{enabled:!q,listRef:s.context.itemDomElements,activeIndex:Q,nested:w.type!==void 0,loopFocus:m,orientation:R,parentOrientation:w.type==="menubar"?w.context.orientation:void 0,rtl:De==="rtl",disabledIndices:Je,onNavigate:Ae,openOnArrowKeyDown:w.type!=="context-menu",externalTree:j?H:void 0,focusItemOnHover:c}),B=G.useCallback(I=>{s.context.typingRef.current=I},[s]),A=Xo(se,{enabled:!q,listRef:s.context.itemLabels,elementsRef:s.context.itemDomElements,activeIndex:Q,resetMs:500,onMatch:n(I=>{D&&I!==Q&&s.set("activeIndex",I)},"onMatch"),onTyping:B}),Ee=G.useMemo(()=>{let I=he(A.reference,L.reference,le.reference,{onMouseMove(){s.set("allowMouseEnter",!0)}},ae);return I["aria-haspopup"]="menu",I["aria-expanded"]=D,I},[s,A.reference,L.reference,le.reference,ae,D]),Yn=G.useMemo(()=>{let I=he(L.trigger,le.trigger,ae);return I["aria-haspopup"]="menu",I["aria-expanded"]=!1,I},[L.trigger,le.trigger,ae]),$n=G.useMemo(()=>he(Ao,{id:P,role:"menu","aria-labelledby":F?.id,onMouseMove(){s.set("allowMouseEnter",!0),w.type==="menu"&&s.set("hoverEnabled",!1)},onClick(){s.select("hoverEnabled")&&s.set("hoverEnabled",!1)},onKeyDown(I){let z=s.select("keyboardEventRelay");z&&!I.isPropagationStopped()&&z(I)}},A.floating,L.floating,le.floating),[F,P,w.type,s,A.floating,L.floating,le.floating]),Kn=L.item??ce;jo(s,{floatingRootContext:se,activeTriggerProps:Ee,inactiveTriggerProps:Yn,popupProps:$n,itemProps:Kn});let zn=G.useMemo(()=>({store:s,parent:V}),[s,V]),lo=(0,so.jsx)(mt.Provider,{value:zn,children:typeof o=="function"?o({payload:ne}):o});return w.type===void 0||w.type==="context-menu"?(0,so.jsx)(No,{externalTree:H,children:lo}):lo},"MenuRoot"));qe.displayName="MenuRoot";var An=f(C(),1);var io=f(Me(),1);function Vn(t){let e=O().store,o=An.useMemo(()=>({parentMenu:e}),[e]);return(0,io.jsx)(Dt.Provider,{value:o,children:(0,io.jsx)(qe,{...t})})}n(Vn,"MenuSubmenuRoot");var X=f(C(),1);var Bn=f(C(),1);function Fn(t={}){let{highlightItemOnHover:e,highlightedIndex:o,onHighlightedIndexChange:i}=ct(),{ref:u,index:a}=pe(t),d=o===a,l=Bn.useRef(null),r=et(u,l);return{compositeProps:{tabIndex:d?0:-1,onFocus(){i(a)},onMouseMove(){let R=l.current;if(!e||!R)return;let g=R.hasAttribute("disabled")||R.ariaDisabled==="true";!d&&!g&&R.focus()}},compositeRef:r,index:a}}n(Fn,"useCompositeItem");function Ln(t){let{render:e,className:o,style:i,state:u=ce,props:a=Je,refs:d=Je,metadata:l,stateAttributesMapping:r,tag:m="div",...R}=t,{compositeProps:g,compositeRef:x}=Fn({metadata:l});return E(m,t,{state:u,ref:[...d,x],props:[g,...a,R],stateAttributesMapping:r})}n(Ln,"CompositeItem");function ao(t){if(Mo(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid")??void 0;if(!ho(t))return ao(bo(t))}n(ao,"findRootOwnerId");var Vt=f(C(),1);function Un(t){let{enabled:e=!0,mouseDownAction:o,open:i}=t,u=Vt.useRef(!1);return Vt.useMemo(()=>e?{onMouseDown:n(a=>{(o==="open"&&!i||o==="close"&&i)&&(u.current=!0,We(a.currentTarget).addEventListener("click",()=>{u.current=!1},{once:!0}))},"onMouseDown"),onClick:n(a=>{u.current&&(u.current=!1,a.preventBaseUIHandler())},"onClick")}:ce,[e,o,i])}n(Un,"useMixedToggleClickHandler");var we=f(Me(),1);var Bt=2,uo=ko(n(function(e,o){let{render:i,className:u,style:a,disabled:d=!1,nativeButton:l=!0,id:r,openOnHover:m,delay:R=100,closeDelay:g=0,handle:x,payload:M,...v}=e,S=O(!0),c=x?.store??S?.store;if(!c)throw new Error("Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.");let h=ee(r),b=c.useState("isTriggerActive",h),p=c.useState("floatingRootContext"),T=c.useState("isOpenedByTrigger",h),V=c.useState("triggerPopupId",h),s=X.useRef(null),k=rr(),P=ct(!0),H=Po(),N=X.useMemo(()=>H??new nt,[H]),_=st(N),D=rt(),{registerTrigger:F,isMountedByThisTrigger:Y}=Uo(h,s,c,{payload:M,closeDelay:g,parent:k,floatingTreeRoot:N,floatingNodeId:_,floatingParentNodeId:D,keyboardEventRelay:P?.relayKeyboardEvent}),$=k.type==="menubar",q=c.useState("disabled"),K=d||q||$&&k.context.disabled,{getButtonProps:w,buttonRef:Q}=Ue({disabled:K,native:l});X.useEffect(()=>{!T&&k.type===void 0&&(c.context.allowMouseUpTriggerRef.current=!1)},[c,T,k.type]);let ne=X.useRef(null),ve=Se(),de=Be(L=>{if(!ne.current)return;ve.clear(),c.context.allowMouseUpTriggerRef.current=!1;let B=L.target;if(Lt(ne.current,B)||Lt(c.select("positionerElement"),B)||B===ne.current||B!=null&&ao(B)===c.select("rootId"))return;let A=gn(ne.current);L.clientX>=A.left-Bt&&L.clientX<=A.right+Bt&&L.clientY>=A.top-Bt&&L.clientY<=A.bottom+Bt||N.events.emit("close",{domEvent:L,reason:y.cancelOpen})});X.useEffect(()=>{T&&c.select("lastOpenChangeReason")===y.triggerHover&&We(ne.current).addEventListener("mouseup",de,{once:!0})},[T,de,c]);let ie=$&&k.context.hasSubmenuOpen,ge=at(p,{enabled:(m??ie)&&!K&&k.type!=="context-menu"&&(!$||ie&&!Y),handleClose:ut({blockPointerEvents:!$}),mouseOnly:!0,move:!1,restMs:k.type===void 0?R:void 0,delay:{close:g},triggerElementRef:s,externalTree:N,isActiveTrigger:b,isClosing:n(()=>c.select("transitionStatus")==="ending","isClosing")}),ye=nr(T,c.select("lastOpenChangeReason")),j=it(p,{enabled:!K&&k.type!=="context-menu",event:T&&$?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:k.type===void 0?ye:!1}),re=zo(p,{enabled:!K&&ie}),ae=Un({open:T,enabled:$,mouseDownAction:"open"}),Re=X.useMemo(()=>he(re.reference,j.reference),[re.reference,j.reference]),xe=c.useState("triggerProps",Y),{preFocusGuardRef:se,handlePreFocusGuardFocus:ue,handleFocusTargetFocus:_e}=Qo(c,s),Pe={disabled:K,open:T},le=[ne,o,Q,F,s],De=[Re,ge??ce,xe,{"aria-haspopup":"menu","aria-controls":V,id:h,onMouseDown:n(L=>{if(c.select("open"))return;ve.start(200,()=>{c.context.allowMouseUpTriggerRef.current=!0}),We(L.currentTarget).addEventListener("mouseup",de,{once:!0})},"onMouseDown")},$?{role:"menuitem"}:{},ae,v,w],Ae=E("button",e,{enabled:!$,stateAttributesMapping:Gt,state:Pe,ref:le,props:De});return $?(0,we.jsx)(Ln,{tag:"button",render:i,className:u,style:a,state:Pe,refs:le,props:De,stateAttributesMapping:Gt}):T?(0,we.jsxs)(X.Fragment,{children:[(0,we.jsx)(Ut,{ref:se,onFocus:ue},`${h}-pre-focus-guard`),(0,we.jsx)(X.Fragment,{children:Ae},h),(0,we.jsx)(Ut,{ref:c.context.triggerFocusTargetRef,onFocus:_e},`${h}-post-focus-guard`)]}):(0,we.jsx)(X.Fragment,{children:Ae},h)},"MenuTrigger"));uo.displayName="MenuTrigger";function nr(t,e){let o=Se(),[i,u]=X.useState(!1);return me(()=>{t&&e==="trigger-hover"?(u(!0),o.start(500,()=>{u(!1)})):t||(o.clear(),u(!1))},[t,e,o]),i}n(nr,"useStickIfOpen");function rr(){let t=be(!0),e=O(!0),o=kt(!0);return X.useMemo(()=>o?{type:"menubar",context:o}:t&&!e?{type:"context-menu",context:t}:{type:void 0},[t,e,o])}n(rr,"useMenuParent");var Hn=f(C(),1);var Gn=(function(t){return t.popupWidth="--popup-width",t.popupHeight="--popup-height",t})({});var sr={activationDirection:n(t=>t?{"data-activation-direction":t}:null,"activationDirection")},co=Hn.forwardRef(n(function(e,o){let{render:i,className:u,style:a,children:d,...l}=e,{store:r}=O(),{side:m}=W(),R=r.useState("instantType"),{children:g,state:x}=dn({store:r,side:m,cssVars:Gn,children:d}),M={activationDirection:x.activationDirection,transitioning:x.transitioning,instant:R};return E("div",e,{state:M,ref:o,props:[l,{children:g}],stateAttributesMapping:sr})},"MenuViewport"));co.displayName="MenuViewport";var Ie=f(C(),1);var po=Ie.forwardRef(n(function(e,o){let{render:i,className:u,style:a,label:d,id:l,nativeButton:r=!1,openOnHover:m=!0,delay:R=100,closeDelay:g=0,disabled:x=!1,...M}=e,v=pe({label:d}),S=W(),{store:c}=O(),h=ee(l),b=c.useState("open"),p=c.useState("floatingRootContext"),T=c.useState("floatingTreeRoot"),V=c.useState("triggerPopupId",h),s=Vo(h,c),k=Ie.useCallback(j=>{let re=s(j);return j!==null&&c.select("open")&&c.select("activeTriggerId")==null&&c.update({activeTriggerId:h,activeTriggerElement:j,closeDelay:g}),re},[s,g,c,h]),P=Ie.useRef(null),H=Ie.useCallback(j=>{P.current=j,c.set("activeTriggerElement",j)},[c]),N=At();if(!N?.parentMenu)throw new Error("Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");c.useSyncedValue("closeDelay",g);let _=N.parentMenu,D=c.useState("disabled"),F=_.useState("disabled"),Y=x||D||F;me(()=>{let j=P.current;if(j&&xn(j)&&!Y){let re=xo.captureOwnerStack?.()||"";Ro(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${re}`)}});let $=_.useState("itemProps"),q=_.useState("isActive",v.index),K=Ie.useMemo(()=>({type:"submenu-trigger",setActive(){_.select("highlightItemOnHover")&&_.set("activeIndex",v.index)}}),[_,v.index]),{getItemProps:w,itemRef:Q}=Ne({closeOnClick:!1,disabled:Y,highlighted:q,id:h,store:c,typingRef:_.context.typingRef,nativeButton:r,itemMetadata:K,nodeId:S?.context.nodeId}),ne=c.useState("hoverEnabled"),ve=at(p,{enabled:ne&&m&&!Y,handleClose:ut({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:R,delay:{open:R,close:g},shouldOpen:R>0?()=>_.select("allowMouseEnter"):void 0,triggerElementRef:P,externalTree:T,isClosing:n(()=>c.select("transitionStatus")==="ending","isClosing")}),ie=it(p,{enabled:!Y,event:"mousedown",toggle:!m,ignoreMouse:m,stickIfOpen:!1}).reference??ce,fe=c.useState("triggerProps",!0);return delete fe.id,E("div",e,{state:{disabled:Y,highlighted:q,open:b},stateAttributesMapping:qo,props:[ie,ve,fe,$,{"aria-controls":V,tabIndex:b||q?0:-1,onBlur(){q&&_.set("activeIndex",null)}},M,w],ref:[o,v.ref,Q,k,H]})},"MenuSubmenuTrigger"));po.displayName="MenuSubmenuTrigger";var Qe=class{static{n(this,"MenuHandle")}constructor(){this.store=new ze}open(e){let o=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!o)throw new Error(`Base UI: MenuHandle.open: No trigger found with id "${e}".`);this.store.setOpen(!0,J("imperative-action",void 0,o))}close(){this.store.setOpen(!1,J("imperative-action",void 0,void 0))}get isOpen(){return this.store.select("open")}};function jn(){return new Qe}n(jn,"createMenuHandle");var oe=f(Qn(),1);function Dc(t){let e=(0,ke.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=(0,oe.jsxDEV)(te.Root,{"data-slot":"dropdown-menu",...o},void 0,!1),e[2]=o,e[3]=i):i=e[3],i}n(Dc,"DropdownMenu");function Ac(t){let e=(0,ke.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=(0,oe.jsxDEV)(te.Trigger,{"data-slot":"dropdown-menu-trigger",...o},void 0,!1),e[2]=o,e[3]=i):i=e[3],i}n(Ac,"DropdownMenuTrigger");function Vc({align:t="start",alignOffset:e=0,side:o="bottom",sideOffset:i=4,className:u,...a}){return(0,oe.jsxDEV)(te.Portal,{children:(0,oe.jsxDEV)(te.Positioner,{className:"isolate z-50 outline-none",align:t,alignOffset:e,side:o,sideOffset:i,children:(0,oe.jsxDEV)(te.Popup,{"data-slot":"dropdown-menu-content",className:Ve("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md 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-start-2 data-[side=inline-start]:slide-in-from-end-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 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",u),...a},void 0,!1)},void 0,!1)},void 0,!1)}n(Vc,"DropdownMenuContent");function Bc(t){let e=(0,ke.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let i;return e[2]!==o?(i=(0,oe.jsxDEV)(te.Group,{"data-slot":"dropdown-menu-group",...o},void 0,!1),e[2]=o,e[3]=i):i=e[3],i}n(Bc,"DropdownMenuGroup");function Fc(t){let e=(0,ke.c)(10),o,i,u;e[0]!==t?({className:o,inset:i,...u}=t,e[0]=t,e[1]=o,e[2]=i,e[3]=u):(o=e[1],i=e[2],u=e[3]);let a;e[4]!==o?(a=Ve("px-2 py-2 text-xs text-muted-foreground data-inset:ps-7",o),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==i||e[7]!==u||e[8]!==a?(d=(0,oe.jsxDEV)(te.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":i,className:a,...u},void 0,!1),e[6]=i,e[7]=u,e[8]=a,e[9]=d):d=e[9],d}n(Fc,"DropdownMenuLabel");function Lc({className:t,inset:e,variant:o="default",...i}){return(0,oe.jsxDEV)(te.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":o,className:Ve("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-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",t),...i},void 0,!1)}n(Lc,"DropdownMenuItem");function Uc(t){let e=(0,ke.c)(15),o,i,u,a,d;e[0]!==t?({className:u,children:i,checked:o,inset:a,...d}=t,e[0]=t,e[1]=o,e[2]=i,e[3]=u,e[4]=a,e[5]=d):(o=e[1],i=e[2],u=e[3],a=e[4],d=e[5]);let l;e[6]!==u?(l=Ve("relative flex cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",u),e[6]=u,e[7]=l):l=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=(0,oe.jsxDEV)("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:(0,oe.jsxDEV)(te.CheckboxItemIndicator,{children:(0,oe.jsxDEV)(mn,{icon:ln,strokeWidth:2},void 0,!1)},void 0,!1)},void 0,!1),e[8]=r):r=e[8];let m;return e[9]!==o||e[10]!==i||e[11]!==a||e[12]!==d||e[13]!==l?(m=(0,oe.jsxDEV)(te.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":a,className:l,checked:o,...d,children:[r,i]},void 0,!0),e[9]=o,e[10]=i,e[11]=a,e[12]=d,e[13]=l,e[14]=m):m=e[14],m}n(Uc,"DropdownMenuCheckboxItem");function Gc(t){let e=(0,ke.c)(8),o,i;e[0]!==t?({className:o,...i}=t,e[0]=t,e[1]=o,e[2]=i):(o=e[1],i=e[2]);let u;e[3]!==o?(u=Ve("-mx-1 h-px bg-border",o),e[3]=o,e[4]=u):u=e[4];let a;return e[5]!==i||e[6]!==u?(a=(0,oe.jsxDEV)(te.Separator,{"data-slot":"dropdown-menu-separator",className:u,...i},void 0,!1),e[5]=i,e[6]=u,e[7]=a):a=e[7],a}n(Gc,"DropdownMenuSeparator");export{Dc as a,Ac as b,Vc as c,Bc as d,Fc as e,Lc as f,Uc as g,Gc as h};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import{a,c as te,e as de,f as qe}from"./chunk-RRCPZMC2.js";var pe=te((he,W)=>{(function(
|
|
1
|
+
import{a,c as te,e as de,f as qe}from"./chunk-RRCPZMC2.js";var pe=te((he,W)=>{(function(e,r){typeof define=="function"&&define.amd?define([],r):typeof W=="object"&&W.exports?W.exports=r():e.moo=r()})(he,function(){"use strict";var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function s(n){return n&&r.call(n)==="[object RegExp]"}a(s,"isRegExp");function i(n){return n&&typeof n=="object"&&!s(n)&&!Array.isArray(n)}a(i,"isObject");function l(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,function(o){return o==="-"?"\\x2d":"\\"+o})}a(l,"reEscape");function c(n){var o=new RegExp("|"+n);return o.exec("").length-1}a(c,"reGroups");function h(n){return"("+n+")"}a(h,"reCapture");function v(n){if(!n.length)return"(?!)";var o=n.map(function(u){return"(?:"+u+")"}).join("|");return"(?:"+o+")"}a(v,"reUnion");function S(n){if(typeof n=="string")return"(?:"+l(n)+")";if(s(n)){if(n.ignoreCase)throw new Error("RegExp /i flag not allowed");if(n.global)throw new Error("RegExp /g flag is implied");if(n.sticky)throw new Error("RegExp /y flag is implied");if(n.multiline)throw new Error("RegExp /m flag is implied");return n.source}else throw new Error("Not a pattern: "+n)}a(S,"regexpOrLiteral");function b(n,o){return n.length>o?n:Array(o-n.length+1).join(" ")+n}a(b,"pad");function M(n,o){for(var u=n.length,f=0;;){var g=n.lastIndexOf(`
|
|
2
2
|
`,u-1);if(g===-1||(f++,u=g,f===o)||u===0)break}var d=f<o?0:u+1;return n.substring(d).split(`
|
|
3
|
-
`)}a(M,"lastNLines");function K(n){for(var o=Object.getOwnPropertyNames(n),u=[],f=0;f<o.length;f++){var g=o[f],d=n[g],m=[].concat(d);if(g==="include"){for(var
|
|
3
|
+
`)}a(M,"lastNLines");function K(n){for(var o=Object.getOwnPropertyNames(n),u=[],f=0;f<o.length;f++){var g=o[f],d=n[g],m=[].concat(d);if(g==="include"){for(var w=0;w<m.length;w++)u.push({include:m[w]});continue}var y=[];m.forEach(function(p){i(p)?(y.length&&u.push($(g,y)),u.push($(g,p)),y=[]):y.push(p)}),y.length&&u.push($(g,y))}return u}a(K,"objectToRules");function O(n){for(var o=[],u=0;u<n.length;u++){var f=n[u];if(f.include){for(var g=[].concat(f.include),d=0;d<g.length;d++)o.push({include:g[d]});continue}if(!f.type)throw new Error("Rule has no type: "+JSON.stringify(f));o.push($(f.type,f))}return o}a(O,"arrayToRules");function $(n,o){if(i(o)||(o={match:o}),o.include)throw new Error("Matching rules cannot also include states");var u={defaultType:n,lineBreaks:!!o.error||!!o.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var f in o)e.call(o,f)&&(u[f]=o[f]);if(typeof u.type=="string"&&n!==u.type)throw new Error("Type transform cannot be a string (type '"+u.type+"' for token '"+n+"')");var g=u.match;return u.match=Array.isArray(g)?g:g?[g]:[],u.match.sort(function(d,m){return s(d)&&s(m)?0:s(m)?-1:s(d)?1:m.length-d.length}),u}a($,"ruleOptions");function C(n){return Array.isArray(n)?O(n):K(n)}a(C,"toRules");var N=$("error",{lineBreaks:!0,shouldThrow:!0});function F(n,o){for(var u=null,f=Object.create(null),g=!0,d=null,m=[],w=[],y=0;y<n.length;y++)n[y].fallback&&(g=!1);for(var y=0;y<n.length;y++){var p=n[y];if(p.include)throw new Error("Inheritance is not allowed in stateless lexers");if(p.error||p.fallback){if(u)throw!p.fallback==!u.fallback?new Error("Multiple "+(p.fallback?"fallback":"error")+" rules not allowed (for token '"+p.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+p.defaultType+"')");u=p}var _=p.match.slice();if(g)for(;_.length&&typeof _[0]=="string"&&_[0].length===1;){var D=_.shift();f[D.charCodeAt(0)]=p}if(p.pop||p.push||p.next){if(!o)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+p.defaultType+"')");if(p.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+p.defaultType+"')")}if(_.length!==0){g=!1,m.push(p);for(var P=0;P<_.length;P++){var q=_[P];if(s(q)){if(d===null)d=q.unicode;else if(d!==q.unicode&&p.fallback===!1)throw new Error("If one rule is /u then all must be")}}var I=v(_.map(S)),T=new RegExp(I);if(T.test(""))throw new Error("RegExp matches empty string: "+T);var U=c(I);if(U>0)throw new Error("RegExp has capture groups: "+T+`
|
|
4
4
|
Use (?: \u2026 ) instead`);if(!p.lineBreaks&&T.test(`
|
|
5
|
-
`))throw new Error("Rule should declare lineBreaks: "+T);
|
|
6
|
-
`)f=1;else for(;g.exec(o);)f++,d=g.lastIndex}var m={type:typeof n.type=="function"&&n.type(o)||n.defaultType,value:typeof n.value=="function"?n.value(o):o,text:o,toString:De,offset:u,lineBreaks:f,line:this.line,col:this.col},
|
|
7
|
-
`)===-1?0:1,line:this.line,col:this.col};var f=2,g=Math.max(n.line-f,1),d=n.line+f,m=String(d).length,
|
|
8
|
-
`)},k.prototype.clone=function(){return new k(this.states,this.state)},k.prototype.has=function(n){return!0},{compile:X,states:$e,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:Be}})});var ge=te(A=>{"use strict";var Ne=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A,"__esModule",{value:!0});A.lexer=A.states=void 0;var Fe=Ne(pe());A.states={body:{doubleapos:{match:"''",value:a(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:a(t=>t.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:a(t=>t.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:a(t=>t.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:a(t=>t.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:a(t=>t.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:a(t=>t.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:a(t=>t.substring(0,t.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};A.lexer=Fe.default.states(A.states)});var we=te(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.ParseError=void 0;z.parse=Le;var ye=ge(),Z=a(t=>({offset:t.offset,line:t.line,col:t.col,text:t.text,lineBreaks:t.lineBreaks}),"getContext"),re=a(t=>t==="plural"||t==="select"||t==="selectordinal","isSelectType");function Ie(t,r){let e="",s="";for(let l of r){let c=l.ctx.text;switch(s+=c,l.type){case"content":e+=l.value;break;case"argument":case"function":case"octothorpe":e+=c;break;default:throw new x(t,`Unsupported part in strict mode function arg style: ${c}`)}}return[{type:"content",value:e.trim(),ctx:Object.assign({},r[0].ctx,{text:s})}]}a(Ie,"strictArgStyleParam");var Re=["number","date","time","spellout","ordinal","duration"],me=["zero","one","two","few","many","other"],x=class extends Error{static{a(this,"ParseError")}constructor(r,e){super(ye.lexer.formatError(r,e))}};z.ParseError=x;var ne=class{static{a(this,"Parser")}constructor(r,e){var s,i,l,c;this.lexer=ye.lexer.reset(r),this.cardinalKeys=(s=e?.cardinal)!==null&&s!==void 0?s:me,this.ordinalKeys=(i=e?.ordinal)!==null&&i!==void 0?i:me,this.strict=(l=e?.strict)!==null&&l!==void 0?l:!1,this.strictPluralKeys=(c=e?.strictPluralKeys)!==null&&c!==void 0?c:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(r,e,s){if(s[0]==="="){if(e==="select")throw new x(r,`The case ${s} is not valid with select`)}else if(e!=="select"){let i=e==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&i.length>0&&!i.includes(s)){let l=`The ${e} case ${s} is not valid in this locale`;throw new x(r,l)}}}parseSelect({value:r},e,s,i){let l={type:i,arg:r,cases:[],ctx:s};i==="plural"||i==="selectordinal"?e=!0:this.strict&&(e=!1);for(let c of this.lexer)switch(c.type){case"offset":if(i==="select")throw new x(c,"Unexpected plural offset for select");if(l.cases.length>0)throw new x(c,"Plural offset must be set before cases");l.pluralOffset=Number(c.value),s.text+=c.text,s.lineBreaks+=c.lineBreaks;break;case"case":{this.checkSelectKey(c,i,c.value),l.cases.push({key:c.value,tokens:this.parseBody(e),ctx:Z(c)});break}case"end":return l;default:throw new x(c,`Unexpected lexer token: ${c.type}`)}throw new x(null,"Unexpected message end")}parseArgToken(r,e){let s=Z(r),i=this.lexer.next();if(!i)throw new x(null,"Unexpected message end");if(s.text+=i.text,s.lineBreaks+=i.lineBreaks,this.strict&&(i.type==="func-simple"||i.type==="func-args")&&!Re.includes(i.value)){let l=`Invalid strict mode function arg type: ${i.value}`;throw new x(r,l)}switch(i.type){case"end":return{type:"argument",arg:r.value,ctx:s};case"func-simple":{let l=this.lexer.next();if(!l)throw new x(null,"Unexpected message end");if(l.type!=="end")throw new x(l,`Unexpected lexer token: ${l.type}`);if(s.text+=l.text,re(i.value.toLowerCase()))throw new x(i,`Invalid type identifier: ${i.value}`);return{type:"function",arg:r.value,key:i.value,ctx:s}}case"func-args":{if(re(i.value.toLowerCase())){let c=`Invalid type identifier: ${i.value}`;throw new x(i,c)}let l=this.parseBody(this.strict?!1:e);return this.strict&&l.length>0&&(l=Ie(r,l)),{type:"function",arg:r.value,key:i.value,param:l,ctx:s}}case"select":if(re(i.value))return this.parseSelect(r,e,s,i.value);throw new x(i,`Unexpected select type ${i.value}`);default:throw new x(i,`Unexpected lexer token: ${i.type}`)}}parseBody(r,e){let s=[],i=null;for(let l of this.lexer)if(l.type==="argument")i&&(i=null),s.push(this.parseArgToken(l,r));else if(l.type==="octothorpe"&&r)i&&(i=null),s.push({type:"octothorpe",ctx:Z(l)});else{if(l.type==="end"&&!e)return s;{let c=l.value;if(!r&&l.type==="quoted"&&c[0]==="#"){if(c.includes("{")){let h=`Unsupported escape pattern: ${c}`;throw new x(l,h)}c=l.text}i?(i.value+=c,i.ctx.text+=l.text,i.ctx.lineBreaks+=l.lineBreaks):(i={type:"content",value:c,ctx:Z(l)},s.push(i))}}if(e)return s;throw new x(null,"Unexpected message end")}};function Le(t,r={}){return new ne(t,r).parse()}a(Le,"parse")});var _e=de(we(),1);var E=class extends Error{static{a(this,"DateFormatError")}constructor(r,e,s){super(r),this.token=e,this.type=s||"error"}},ve=a(t=>t<4?"short":t===4?"long":"narrow","alpha"),G=a(t=>t%2===0?"2-digit":"numeric","numeric");function Ue(t,r){switch(t.char){case"y":return{year:G(t.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return r(`${t.desc} is not supported; falling back to year:numeric`,E.WARNING),{year:"numeric"}}}a(Ue,"yearOptions");function ze(t,r){switch(t.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:r(`${t.desc} is not supported with width ${t.width}`);return}}a(ze,"monthStyle");function Ge(t,r){let{char:e,desc:s,width:i}=t;if(e==="d")return G(i);r(`${s} is not supported`)}a(Ge,"dayStyle");function Ke(t,r){let{char:e,desc:s,width:i}=t;if((e==="c"||e==="e")&&i<3){let l=`Numeric value is not supported for ${s}; falling back to weekday:short`;r(l,E.WARNING)}return ve(i)}a(Ke,"weekdayStyle");function He(t){let r=G(t.width),e;switch(t.char){case"h":e="h12";break;case"H":e="h23";break;case"k":e="h24";break;case"K":e="h11";break}return e?{hour:r,hourCycle:e}:{hour:r}}a(He,"hourOptions");function We(t,r){let{char:e,desc:s,width:i}=t;switch(e){case"v":case"z":return i===4?"long":"short";case"V":if(i===4)return"long";r(`${s} is not supported with width ${i}`);return;case"X":r(`${s} is not supported`);return}return"short"}a(We,"timeZoneNameStyle");function Ze(t,r){switch(t.field){case"era":return{era:ve(t.width)};case"year":return Ue(t,r);case"month":return{month:ze(t,r)};case"day":return{day:Ge(t,r)};case"weekday":return{weekday:Ke(t,r)};case"period":return;case"hour":return He(t);case"min":return{minute:G(t.width)};case"sec":return{second:G(t.width)};case"tz":return{timeZoneName:We(t,r)};case"quarter":case"week":case"sec-frac":case"ms":r(`${t.desc} is not supported`)}}a(Ze,"compileOptions");function se(t,r,e=s=>{throw s}){let s={timeZone:r},i=[];for(let l of t){let{error:c,field:h,str:w}=l;if(c){let b=new E(c.message,l);b.stack=c.stack,e(b)}if(w){let b=`Ignoring string part: ${w}`;e(new E(b,l,E.WARNING))}h&&(i.indexOf(h)===-1?i.push(h):e(new E(`Duplicate ${h} token`,l)));let S=Ze(l,(b,M)=>e(new E(b,l,M)));S&&Object.assign(s,S)}return s}a(se,"getDateFormatOptions");var Je={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},xe=a(t=>t>="A"&&t<="Z"||t>="a"&&t<="z","isLetter");function je(t,r){let e=t[r],s=1;for(;t[++r]===e;)++s;let i=Je[e];if(!i){let l=`The letter ${e} is not a valid field identifier`;return{char:e,error:new Error(l),width:s}}return{char:e,field:i.field,desc:i.desc,width:s}}a(je,"readFieldToken");function Ye(t,r){let e=t[++r],s=2;if(e==="'")return{char:"'",str:e,width:s};for(;;){let i=t[++r];if(++s,i===void 0){let l=`Unterminated quoted literal in pattern: ${e||t}`;return{char:"'",error:new Error(l),str:e,width:s}}else if(i==="'"){if(t[++r]!=="'")return{char:"'",str:e,width:s};++s}e+=i}}a(Ye,"readQuotedToken");function Qe(t,r){let e=t[r];if(!e)return null;if(xe(e))return je(t,r);if(e==="'")return Ye(t,r);let s=e,i=1;for(;;){let l=t[++r];if(!l||xe(l)||l==="'")return{char:e,str:s,width:i};s+=l,i+=1}}a(Qe,"readToken");function J(t){let r=[],e=0;for(;;){let s=Qe(t,e);if(!s)return r;r.push(s),e+=s.width}}a(J,"parseDateTokens");function ke(t,r){return t.filter(e=>e.type!=="content").length?t.map(e=>{if(e.type==="content")return r(e.value);if(e.type==="octothorpe")return"#";if(e.type==="argument")return[e.arg];if(e.type==="function"){let l=e?.param?.[0];if(e.key==="date"&&l){let c=Ve(l.value.trim(),h=>{throw new Error(`Unable to compile date expression: ${h.message}`)});return[e.arg,e.key,c]}return l?[e.arg,e.key,l.value.trim()]:[e.arg,e.key]}let s=e.pluralOffset,i={};return e.cases.forEach(({key:l,tokens:c})=>{let h=l[0]==="="?l.slice(1):l;i[h]=ke(c,r)}),[e.arg,e.type,{offset:s,...i}]}):t.map(e=>r(e.value))}a(ke,"processTokens");function Ve(t,r){if(/^::/.test(t)){let e=J(t.substring(2));return se(e,void 0,r)}return t}a(Ve,"compileDateExpression");function Xe(t,r=e=>e){return ke((0,_e.parse)(t),r)}a(Xe,"compileMessageOrThrow");function j(t,r=e=>e){try{return Xe(t,r)}catch(e){return console.error(`${e.message}
|
|
5
|
+
`))throw new Error("Rule should declare lineBreaks: "+T);w.push(h(I))}}var R=u&&u.fallback,L=t&&!R?"ym":"gm",H=t||R?"":"|";d===!0&&(L+="u");var Pe=new RegExp(v(w)+H,L);return{regexp:Pe,groups:m,fast:f,error:u||N}}a(F,"compileRules");function X(n){var o=F(C(n));return new k({start:o},"start")}a(X,"compile");function fe(n,o,u){var f=n&&(n.push||n.next);if(f&&!u[f])throw new Error("Missing state '"+f+"' (in token '"+n.defaultType+"' of state '"+o+"')");if(n&&n.pop&&+n.pop!=1)throw new Error("pop must be 1 (in token '"+n.defaultType+"' of state '"+o+"')")}a(fe,"checkStateGroup");function $e(n,o){var u=n.$all?C(n.$all):[];delete n.$all;var f=Object.getOwnPropertyNames(n);o||(o=f[0]);for(var g=Object.create(null),d=0;d<f.length;d++){var m=f[d];g[m]=C(n[m]).concat(u)}for(var d=0;d<f.length;d++)for(var m=f[d],w=g[m],y=Object.create(null),p=0;p<w.length;p++){var _=w[p];if(_.include){var D=[p,1];if(_.include!==m&&!y[_.include]){y[_.include]=!0;var P=g[_.include];if(!P)throw new Error("Cannot include nonexistent state '"+_.include+"' (in state '"+m+"')");for(var q=0;q<P.length;q++){var I=P[q];w.indexOf(I)===-1&&D.push(I)}}w.splice.apply(w,D),p--}}for(var T=Object.create(null),d=0;d<f.length;d++){var m=f[d];T[m]=F(g[m],!0)}for(var d=0;d<f.length;d++){for(var U=f[d],R=T[U],L=R.groups,p=0;p<L.length;p++)fe(L[p],U,T);for(var H=Object.getOwnPropertyNames(R.fast),p=0;p<H.length;p++)fe(R.fast[H[p]],U,T)}return new k(T,o)}a($e,"compileStates");function Be(n){for(var o=typeof Map<"u",u=o?new Map:Object.create(null),f=Object.getOwnPropertyNames(n),g=0;g<f.length;g++){var d=f[g],m=n[d],w=Array.isArray(m)?m:[m];w.forEach(function(y){if(typeof y!="string")throw new Error("keyword must be string (in keyword '"+d+"')");o?u.set(y,d):u[y]=d})}return function(y){return o?u.get(y):u[y]}}a(Be,"keywordTransform");var k=a(function(n,o){this.startState=o,this.states=n,this.buffer="",this.stack=[],this.reset()},"Lexer");k.prototype.reset=function(n,o){return this.buffer=n||"",this.index=0,this.line=o?o.line:1,this.col=o?o.col:1,this.queuedToken=o?o.queuedToken:null,this.queuedText=o?o.queuedText:"",this.queuedThrow=o?o.queuedThrow:null,this.setState(o?o.state:this.startState),this.stack=o&&o.stack?o.stack.slice():[],this},k.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},k.prototype.setState=function(n){if(!(!n||this.state===n)){this.state=n;var o=this.states[n];this.groups=o.groups,this.error=o.error,this.re=o.regexp,this.fast=o.fast}},k.prototype.popState=function(){this.setState(this.stack.pop())},k.prototype.pushState=function(n){this.stack.push(this.state),this.setState(n)};var Ce=t?function(n,o){return n.exec(o)}:function(n,o){var u=n.exec(o);return u[0].length===0?null:u};k.prototype._getGroup=function(n){for(var o=this.groups.length,u=0;u<o;u++)if(n[u+1]!==void 0)return this.groups[u];throw new Error("Cannot find token type for matched text")};function De(){return this.value}if(a(De,"tokenToString"),k.prototype.next=function(){var n=this.index;if(this.queuedGroup){var o=this._token(this.queuedGroup,this.queuedText,n);return this.queuedGroup=null,this.queuedText="",o}var u=this.buffer;if(n!==u.length){var m=this.fast[u.charCodeAt(n)];if(m)return this._token(m,u.charAt(n),n);var f=this.re;f.lastIndex=n;var g=Ce(f,u),d=this.error;if(g==null)return this._token(d,u.slice(n,u.length),n);var m=this._getGroup(g),w=g[0];return d.fallback&&g.index!==n?(this.queuedGroup=m,this.queuedText=w,this._token(d,u.slice(n,g.index),n)):this._token(m,w,n)}},k.prototype._token=function(n,o,u){var f=0;if(n.lineBreaks){var g=/\n/g,d=1;if(o===`
|
|
6
|
+
`)f=1;else for(;g.exec(o);)f++,d=g.lastIndex}var m={type:typeof n.type=="function"&&n.type(o)||n.defaultType,value:typeof n.value=="function"?n.value(o):o,text:o,toString:De,offset:u,lineBreaks:f,line:this.line,col:this.col},w=o.length;if(this.index+=w,this.line+=f,f!==0?this.col=w-d+1:this.col+=w,n.shouldThrow){var y=new Error(this.formatError(m,"invalid syntax"));throw y}return n.pop?this.popState():n.push?this.pushState(n.push):n.next&&this.setState(n.next),m},typeof Symbol<"u"&&Symbol.iterator){var ee=a(function(n){this.lexer=n},"LexerIterator");ee.prototype.next=function(){var n=this.lexer.next();return{value:n,done:!n}},ee.prototype[Symbol.iterator]=function(){return this},k.prototype[Symbol.iterator]=function(){return new ee(this)}}return k.prototype.formatError=function(n,o){if(n==null)var u=this.buffer.slice(this.index),n={text:u,offset:this.index,lineBreaks:u.indexOf(`
|
|
7
|
+
`)===-1?0:1,line:this.line,col:this.col};var f=2,g=Math.max(n.line-f,1),d=n.line+f,m=String(d).length,w=M(this.buffer,this.line-n.line+f+1).slice(0,5),y=[];y.push(o+" at line "+n.line+" col "+n.col+":"),y.push("");for(var p=0;p<w.length;p++){var _=w[p],D=g+p;y.push(b(String(D),m)+" "+_),D===n.line&&y.push(b("",m+n.col+1)+"^")}return y.join(`
|
|
8
|
+
`)},k.prototype.clone=function(){return new k(this.states,this.state)},k.prototype.has=function(n){return!0},{compile:X,states:$e,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:Be}})});var ge=te(A=>{"use strict";var Ne=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0});A.lexer=A.states=void 0;var Fe=Ne(pe());A.states={body:{doubleapos:{match:"''",value:a(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:a(e=>e.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:a(e=>e.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:a(e=>e.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:a(e=>e.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:a(e=>e.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:a(e=>e.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:a(e=>e.substring(0,e.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};A.lexer=Fe.default.states(A.states)});var ve=te(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.ParseError=void 0;z.parse=Ue;var ye=ge(),j=a(e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),"getContext"),re=a(e=>e==="plural"||e==="select"||e==="selectordinal","isSelectType");function Ie(e,r){let t="",s="";for(let l of r){let c=l.ctx.text;switch(s+=c,l.type){case"content":t+=l.value;break;case"argument":case"function":case"octothorpe":t+=c;break;default:throw new x(e,`Unsupported part in strict mode function arg style: ${c}`)}}return[{type:"content",value:t.trim(),ctx:Object.assign({},r[0].ctx,{text:s})}]}a(Ie,"strictArgStyleParam");var Re=["number","date","time","spellout","ordinal","duration"],me=["zero","one","two","few","many","other"],x=class extends Error{static{a(this,"ParseError")}constructor(r,t){super(ye.lexer.formatError(r,t))}};z.ParseError=x;var ne=class{static{a(this,"Parser")}constructor(r,t){var s,i,l,c;this.lexer=ye.lexer.reset(r),this.cardinalKeys=(s=t?.cardinal)!==null&&s!==void 0?s:me,this.ordinalKeys=(i=t?.ordinal)!==null&&i!==void 0?i:me,this.strict=(l=t?.strict)!==null&&l!==void 0?l:!1,this.strictPluralKeys=(c=t?.strictPluralKeys)!==null&&c!==void 0?c:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(r,t,s){if(s[0]==="="){if(t==="select")throw new x(r,`The case ${s} is not valid with select`)}else if(t!=="select"){let i=t==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&i.length>0&&!i.includes(s)){let l=`The ${t} case ${s} is not valid in this locale`;throw new x(r,l)}}}parseSelect({value:r},t,s,i){let l={type:i,arg:r,cases:[],ctx:s};i==="plural"||i==="selectordinal"?t=!0:this.strict&&(t=!1);for(let c of this.lexer)switch(c.type){case"offset":if(i==="select")throw new x(c,"Unexpected plural offset for select");if(l.cases.length>0)throw new x(c,"Plural offset must be set before cases");l.pluralOffset=Number(c.value),s.text+=c.text,s.lineBreaks+=c.lineBreaks;break;case"case":{this.checkSelectKey(c,i,c.value),l.cases.push({key:c.value,tokens:this.parseBody(t),ctx:j(c)});break}case"end":return l;default:throw new x(c,`Unexpected lexer token: ${c.type}`)}throw new x(null,"Unexpected message end")}parseArgToken(r,t){let s=j(r),i=this.lexer.next();if(!i)throw new x(null,"Unexpected message end");if(s.text+=i.text,s.lineBreaks+=i.lineBreaks,this.strict&&(i.type==="func-simple"||i.type==="func-args")&&!Re.includes(i.value)){let l=`Invalid strict mode function arg type: ${i.value}`;throw new x(r,l)}switch(i.type){case"end":return{type:"argument",arg:r.value,ctx:s};case"func-simple":{let l=this.lexer.next();if(!l)throw new x(null,"Unexpected message end");if(l.type!=="end")throw new x(l,`Unexpected lexer token: ${l.type}`);if(s.text+=l.text,re(i.value.toLowerCase()))throw new x(i,`Invalid type identifier: ${i.value}`);return{type:"function",arg:r.value,key:i.value,ctx:s}}case"func-args":{if(re(i.value.toLowerCase())){let c=`Invalid type identifier: ${i.value}`;throw new x(i,c)}let l=this.parseBody(this.strict?!1:t);return this.strict&&l.length>0&&(l=Ie(r,l)),{type:"function",arg:r.value,key:i.value,param:l,ctx:s}}case"select":if(re(i.value))return this.parseSelect(r,t,s,i.value);throw new x(i,`Unexpected select type ${i.value}`);default:throw new x(i,`Unexpected lexer token: ${i.type}`)}}parseBody(r,t){let s=[],i=null;for(let l of this.lexer)if(l.type==="argument")i&&(i=null),s.push(this.parseArgToken(l,r));else if(l.type==="octothorpe"&&r)i&&(i=null),s.push({type:"octothorpe",ctx:j(l)});else{if(l.type==="end"&&!t)return s;{let c=l.value;if(!r&&l.type==="quoted"&&c[0]==="#"){if(c.includes("{")){let h=`Unsupported escape pattern: ${c}`;throw new x(l,h)}c=l.text}i?(i.value+=c,i.ctx.text+=l.text,i.ctx.lineBreaks+=l.lineBreaks):(i={type:"content",value:c,ctx:j(l)},s.push(i))}}if(t)return s;throw new x(null,"Unexpected message end")}};function Ue(e,r={}){return new ne(e,r).parse()}a(Ue,"parse")});var _e=de(ve(),1);var E=class extends Error{static{a(this,"DateFormatError")}constructor(r,t,s){super(r),this.token=t,this.type=s||"error"}},we=a(e=>e<4?"short":e===4?"long":"narrow","alpha"),G=a(e=>e%2===0?"2-digit":"numeric","numeric");function Le(e,r){switch(e.char){case"y":return{year:G(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return r(`${e.desc} is not supported; falling back to year:numeric`,E.WARNING),{year:"numeric"}}}a(Le,"yearOptions");function ze(e,r){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:r(`${e.desc} is not supported with width ${e.width}`);return}}a(ze,"monthStyle");function Ge(e,r){let{char:t,desc:s,width:i}=e;if(t==="d")return G(i);r(`${s} is not supported`)}a(Ge,"dayStyle");function Ke(e,r){let{char:t,desc:s,width:i}=e;if((t==="c"||t==="e")&&i<3){let l=`Numeric value is not supported for ${s}; falling back to weekday:short`;r(l,E.WARNING)}return we(i)}a(Ke,"weekdayStyle");function He(e){let r=G(e.width),t;switch(e.char){case"h":t="h12";break;case"H":t="h23";break;case"k":t="h24";break;case"K":t="h11";break}return t?{hour:r,hourCycle:t}:{hour:r}}a(He,"hourOptions");function We(e,r){let{char:t,desc:s,width:i}=e;switch(t){case"v":case"z":return i===4?"long":"short";case"V":if(i===4)return"long";r(`${s} is not supported with width ${i}`);return;case"X":r(`${s} is not supported`);return}return"short"}a(We,"timeZoneNameStyle");function je(e,r){switch(e.field){case"era":return{era:we(e.width)};case"year":return Le(e,r);case"month":return{month:ze(e,r)};case"day":return{day:Ge(e,r)};case"weekday":return{weekday:Ke(e,r)};case"period":return;case"hour":return He(e);case"min":return{minute:G(e.width)};case"sec":return{second:G(e.width)};case"tz":return{timeZoneName:We(e,r)};case"quarter":case"week":case"sec-frac":case"ms":r(`${e.desc} is not supported`)}}a(je,"compileOptions");function se(e,r,t=s=>{throw s}){let s={timeZone:r},i=[];for(let l of e){let{error:c,field:h,str:v}=l;if(c){let b=new E(c.message,l);b.stack=c.stack,t(b)}if(v){let b=`Ignoring string part: ${v}`;t(new E(b,l,E.WARNING))}h&&(i.indexOf(h)===-1?i.push(h):t(new E(`Duplicate ${h} token`,l)));let S=je(l,(b,M)=>t(new E(b,l,M)));S&&Object.assign(s,S)}return s}a(se,"getDateFormatOptions");var Ze={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},xe=a(e=>e>="A"&&e<="Z"||e>="a"&&e<="z","isLetter");function Je(e,r){let t=e[r],s=1;for(;e[++r]===t;)++s;let i=Ze[t];if(!i){let l=`The letter ${t} is not a valid field identifier`;return{char:t,error:new Error(l),width:s}}return{char:t,field:i.field,desc:i.desc,width:s}}a(Je,"readFieldToken");function Ye(e,r){let t=e[++r],s=2;if(t==="'")return{char:"'",str:t,width:s};for(;;){let i=e[++r];if(++s,i===void 0){let l=`Unterminated quoted literal in pattern: ${t||e}`;return{char:"'",error:new Error(l),str:t,width:s}}else if(i==="'"){if(e[++r]!=="'")return{char:"'",str:t,width:s};++s}t+=i}}a(Ye,"readQuotedToken");function Qe(e,r){let t=e[r];if(!t)return null;if(xe(t))return Je(e,r);if(t==="'")return Ye(e,r);let s=t,i=1;for(;;){let l=e[++r];if(!l||xe(l)||l==="'")return{char:t,str:s,width:i};s+=l,i+=1}}a(Qe,"readToken");function Z(e){let r=[],t=0;for(;;){let s=Qe(e,t);if(!s)return r;r.push(s),t+=s.width}}a(Z,"parseDateTokens");function ke(e,r){return e.filter(t=>t.type!=="content").length?e.map(t=>{if(t.type==="content")return r(t.value);if(t.type==="octothorpe")return"#";if(t.type==="argument")return[t.arg];if(t.type==="function"){let l=t?.param?.[0];if(t.key==="date"&&l){let c=Ve(l.value.trim(),h=>{throw new Error(`Unable to compile date expression: ${h.message}`)});return[t.arg,t.key,c]}return l?[t.arg,t.key,l.value.trim()]:[t.arg,t.key]}let s=t.pluralOffset,i={};return t.cases.forEach(({key:l,tokens:c})=>{let h=l[0]==="="?l.slice(1):l;i[h]=ke(c,r)}),[t.arg,t.type,{offset:s,...i}]}):e.map(t=>r(t.value))}a(ke,"processTokens");function Ve(e,r){if(/^::/.test(e)){let t=Z(e.substring(2));return se(t,void 0,r)}return e}a(Ve,"compileDateExpression");function Xe(e,r=t=>t){return ke((0,_e.parse)(e),r)}a(Xe,"compileMessageOrThrow");function J(e,r=t=>t){try{return Xe(e,r)}catch(t){return console.error(`${t.message}
|
|
9
9
|
|
|
10
|
-
Message: ${
|
|
10
|
+
Message: ${e}`),[e]}}a(J,"compileMessage");var B=a(e=>typeof e=="string","isString"),et=a(e=>typeof e=="function","isFunction"),be=new Map,Te="en";function le(e){return[...Array.isArray(e)?e:[e],Te]}a(le,"normalizeLocales");function ce(e,r,t){let s=le(e);t||(t="default");let i;if(typeof t=="string")switch(i={day:"numeric",month:"short",year:"numeric"},t){case"full":i.weekday="long";case"long":i.month="long";break;case"short":i.month="numeric";break}else i=t;return Y(()=>Q("date",s,t),()=>new Intl.DateTimeFormat(s,i)).format(B(r)?new Date(r):r)}a(ce,"date");function tt(e,r,t){let s;if(t||(t="default"),typeof t=="string")switch(s={second:"numeric",minute:"numeric",hour:"numeric"},t){case"full":case"long":s.timeZoneName="short";break;case"short":delete s.second}else s=t;return ce(e,r,s)}a(tt,"time");function ie(e,r,t){let s=le(e);return Y(()=>Q("number",s,t),()=>new Intl.NumberFormat(s,t)).format(r)}a(ie,"number");function Se(e,r,t,{offset:s=0,...i}){let l=le(e),c=r?Y(()=>Q("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):Y(()=>Q("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return i[t]??i[c.select(t-s)]??i.other}a(Se,"plural");function Y(e,r){let t=e(),s=be.get(t);return s||(s=r(),be.set(t,s)),s}a(Y,"getMemoized");function Q(e,r,t){let s=r.join("-");return`${e}-${s}-${JSON.stringify(t)}`}a(Q,"cacheKey");var Ee=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Oe=a(e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(r,t,s)=>{if(t){let i=parseInt(t,16);return String.fromCharCode(i)}else{let i=parseInt(s,16);return String.fromCharCode(i)}}),"decodeEscapeSequences"),Ae="%__lingui_octothorpe__%",rt=a((e,r,t={})=>{let s=r||e,i=a(c=>typeof c=="object"?c:t[c],"style"),l=a((c,h)=>{let v=Object.keys(t).length?i("number"):void 0,S=ie(s,c,v);return h.replace(new RegExp(Ae,"g"),S)},"replaceOctothorpe");return{plural:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!1,c,h);return l(c-v,S)},"plural"),selectordinal:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!0,c,h);return l(c-v,S)},"selectordinal"),select:nt,number:a((c,h)=>ie(s,c,i(h)||{style:h}),"number"),date:a((c,h)=>ce(s,c,i(h)||h),"date"),time:a((c,h)=>tt(s,c,i(h)||h),"time")}},"getDefaultFormats"),nt=a((e,r)=>r[e]??r.other,"selectFormatter");function st(e,r,t){return(s={},i)=>{let l=rt(r,t,i),c=a((v,S=!1)=>Array.isArray(v)?v.reduce((b,M)=>{if(M==="#"&&S)return b+Ae;if(B(M))return b+M;let[K,O,$]=M,C={};O==="plural"||O==="selectordinal"||O==="select"?Object.entries($).forEach(([F,X])=>{C[F]=c(X,O==="plural"||O==="selectordinal")}):C=$;let N;if(O){let F=l[O];N=F(s[K],C)}else N=s[K];return N==null?b:b+N},""):v,"formatMessage"),h=c(e);return B(h)&&Ee.test(h)?Oe(h):B(h)?h:h?String(h):""}}a(st,"interpolate");var ae=class{static{a(this,"EventEmitter")}_events={};on(r,t){return this._events[r]??=new Set,this._events[r].add(t),()=>this.removeListener(r,t)}removeListener(r,t){let s=this._events[r];s?.delete(t),s?.size===0&&delete this._events[r]}emit(r,...t){let s=this._events[r];if(s)for(let i of[...s])i.apply(this,t)}},oe=class extends ae{static{a(this,"I18n")}_locale="";_locales;_messages={};_missing;_messageCompiler;constructor(r){super(),this.setMessagesCompiler(J),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),(typeof r.locale=="string"||r.locales)&&this.activate(r.locale??Te,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(r){return this._messageCompiler=r,this}_load(r,t){let s=this._messages[r];s?Object.assign(s,t):this._messages[r]=t}load(r,t){typeof r=="string"&&typeof t=="object"?this._load(r,t):Object.entries(r).forEach(([s,i])=>this._load(s,i)),this.emit("change")}loadAndActivate({locale:r,locales:t,messages:s}){this._locale=r,this._locales=t||void 0,this._messages[this._locale]=s,this.emit("change")}activate(r,t){this._messages[r]||console.warn(`Messages for locale "${r}" not loaded.`),this._locale=r,this._locales=t,this.emit("change")}_(r,t,s){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let i=s?.message;r||(r=""),B(r)||(t=r.values||t,i=r.message,r=r.id);let l=this.messages[r],c=l===void 0,h=this._missing;if(h&&c)return et(h)?h(this._locale,r):h;c&&this.emit("missing",{id:r,locale:this._locale});let v=l||i||r;return B(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
|
|
11
11
|
|
|
12
|
-
> ${
|
|
12
|
+
> ${v}
|
|
13
13
|
|
|
14
14
|
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
15
15
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
16
16
|
|
|
17
17
|
Please compile your catalog first.
|
|
18
|
-
`)),B(
|
|
18
|
+
`)),B(v)&&Ee.test(v)?Oe(v):B(v)?v:st(v,this._locale,this._locales)(t,s?.formats)}t=this._.bind(this);date(r,t){return ce(this._locales||this._locale,r,t)}number(r,t){return ie(this._locales||this._locale,r,t)}};function ue(e={}){return new oe(e)}a(ue,"setupI18n");var qt=ue();var V=de(qe(),1);var it={},Me="en",at={en:it},ot=a((e=Me,r=at)=>{let t=ue();t.setMessagesCompiler(J);for(let[s,i]of Object.entries(r))t.load(s,i);return t.activate(r[e]===void 0?Me:e),t},"createStudioI18n"),lt=ot(),ct=(0,V.createContext)(lt),Ut=a(()=>{let e=(0,V.use)(ct);return(r,t)=>e._(r,t)},"useT");var Gt=a(e=>({__lunoraRef:e}),"adminRef"),Kt=a(e=>{let r=e.trim();return r===""?{}:{shardKey:r}},"callOptions"),Ht=a(e=>e instanceof Error?e.message:String(e),"errorMessage"),Wt=a(e=>{if(e===null||typeof e!="object"||!("hint"in e))return;let{hint:r}=e;return typeof r=="string"?r:Array.isArray(r)?r.filter(t=>typeof t=="string").join(`
|
|
19
|
+
`):void 0},"errorHint"),jt=a(e=>{if(e===null||typeof e!="object"||!("docsUrl"in e))return;let r=e.docsUrl;if(typeof r=="string")try{let{protocol:t}=new URL(r);return t==="http:"||t==="https:"?r:void 0}catch{return}},"errorDocumentationUrl"),Zt=a(e=>{if(e==null)return"";switch(typeof e){case"bigint":case"boolean":case"number":return e.toString();case"string":return e;case"symbol":return e.toString();default:return JSON.stringify(e)}},"formatCell"),ut=a((e,r)=>{e.catch(t=>{})},"fireAndForget"),Jt=a(e=>{let r="navigator"in globalThis?globalThis.navigator.clipboard:void 0;r!==void 0&&ut(r.writeText(e))},"copyToClipboard"),Yt=a(e=>{if(e==null)return"\u2014";if(e<1024)return`${e.toString()} B`;let r=["KB","MB","GB","TB"],t=e/1024,s=0;for(;t>=1024&&s<r.length-1;)t/=1024,s+=1;return`${t.toFixed(1)} ${r[s]??"TB"}`},"formatBytes"),Qt=a((e,r="")=>{if(e==null||e==="")return r;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString()},"formatTimestamp");export{ot as a,lt as b,ct as c,Ut as d,Gt as e,Kt as f,Ht as g,Wt as h,jt as i,Zt as j,ut as k,Jt as l,Yt as m,Qt as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-AJIUI7DD.js";import{a as y,b as T,c as E,d,e as c,f as n}from"./chunk-GTM65MVX.js";import{a as g,e as x}from"./chunk-SEU5V7I6.js";import{d as h}from"./chunk-PVZI3CXP.js";import{a as i,e as v,f as A,h as V,j as b}from"./chunk-RRCPZMC2.js";var m=v(A(),1);var e=v(V(),1);var $={ERROR:"error",INFO:"info",WARN:"warning"},F=i(r=>{let o=typeof r.metadata.table=="string"?r.metadata.table:void 0;return{description:`${r.detail} ${r.remediation}`,entity:o,issueType:r.title,key:r.cacheKey,level:$[r.level]}},"advisoryRow"),k=["error","warning","info"],D={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},O=i((r,o)=>({error:r("Errors"),info:r("Info"),warning:r("Warnings")})[o],"levelLabel"),S=i((r,o,a)=>({error:r("{count} errors",{count:a}),info:r("{count} suggestions",{count:a}),warning:r("{count} warnings",{count:a})})[o],"levelCount"),H=i((r,o)=>({error:r("No errors detected"),info:r("No suggestions"),warning:r("No warnings detected")})[o],"emptyTitle"),K=i(({error:r=null,errorSource:o,rows:a,testId:l,toolbar:u})=>{let s=h(),[f,w]=(0,m.useState)("error"),C=(0,m.useMemo)(()=>{let t={error:0,info:0,warning:0};for(let R of a??[])t[R.level]+=1;return t},[a]),p=(a??[]).filter(t=>t.level===f),L=i(t=>{w(t.currentTarget.dataset.level)},"selectTab");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":l,children:[(0,e.jsxDEV)("div",{className:"flex border-b border-border",role:"tablist",children:k.map(t=>(0,e.jsxDEV)("button",{"aria-selected":f===t,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":t,"data-testid":`${l}-tab-${t}`,onClick:L,role:"tab",type:"button",children:[(0,e.jsxDEV)("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,e.jsxDEV)("span",{"aria-hidden":"true",className:b("size-2 rounded-sm",D[t])},void 0,!1),O(s,t)]},void 0,!0),(0,e.jsxDEV)("span",{className:"ps-4 text-xs text-muted-foreground",children:S(s,t,C[t])},void 0,!1)]},t,!0))},void 0,!1),u!==void 0&&(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:u},void 0,!1),r!==null&&(0,e.jsxDEV)(N,{error:o??r,testId:`${l}-error`},void 0,!1),(0,e.jsxDEV)(g,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(x,{className:"px-0",children:(0,e.jsxDEV)(y,{children:[(0,e.jsxDEV)(T,{children:(0,e.jsxDEV)(d,{children:[(0,e.jsxDEV)(c,{children:s("Issue type")},void 0,!1),(0,e.jsxDEV)(c,{children:s("Entity/item")},void 0,!1),(0,e.jsxDEV)(c,{children:s("Description")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(E,{children:p.length===0?(0,e.jsxDEV)(d,{children:(0,e.jsxDEV)(n,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${l}-empty`,children:[(0,e.jsxDEV)("span",{className:"block text-sm font-medium text-foreground",children:H(s,f)},void 0,!1),(0,e.jsxDEV)("span",{className:"block text-sm",children:s("Nothing to report for this deployment.")},void 0,!1)]},void 0,!0)},void 0,!1):p.map(t=>(0,e.jsxDEV)(d,{children:[(0,e.jsxDEV)(n,{className:"font-medium text-foreground",children:t.issueType},void 0,!1),(0,e.jsxDEV)(n,{className:"font-mono text-xs text-muted-foreground",children:t.entity??"\u2014"},void 0,!1),(0,e.jsxDEV)(n,{className:"text-muted-foreground",children:[(0,e.jsxDEV)("span",{children:t.description},void 0,!1),t.action!==void 0&&(0,e.jsxDEV)("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:t.action},void 0,!1)]},void 0,!0)]},t.key,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"AdvisorView");export{F as a,K as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./chunk-
|
|
1
|
+
import{j as o}from"./chunk-CKSHCYGC.js";import{a as r,e as i,f as p}from"./chunk-RRCPZMC2.js";var a=i(p(),1);var c=a.forwardRef(r(function(e,n){let{className:m,render:f,orientation:t="horizontal",style:d,...s}=e;return o("div",e,{state:{orientation:t},ref:n,props:[{role:"separator","aria-orientation":t},s]})},"SeparatorComponent"));c.displayName="Separator";export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as y}from"./chunk-
|
|
1
|
+
import{i as y}from"./chunk-3CJW6NWG.js";import{a as C,c as M,e as P}from"./chunk-O3NAGRTR.js";import{c as _}from"./chunk-CKSHCYGC.js";import{a as z}from"./chunk-3OA7PECS.js";import{a as o,e as L,f as T}from"./chunk-RRCPZMC2.js";var O=L(T(),1);var w=L(T(),1);var D=w.createContext({register:o(()=>{},"register"),unregister:o(()=>{},"unregister"),subscribeMapChange:o(()=>()=>{},"subscribeMapChange"),elementsRef:{current:[]},nextIndexRef:{current:0}});D.displayName="CompositeListContext";function F(){return w.useContext(D)}o(F,"useCompositeListContext");var W=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function V(t={}){let{label:n,metadata:r,textRef:s,indexGuessBehavior:N,index:m}=t,{register:x,unregister:p,subscribeMapChange:f,elementsRef:d,labelsRef:h,nextIndexRef:c}=F(),g=O.useRef(-1),[a,i]=O.useState(m??(N===W.GuessFromOrder?()=>{if(g.current===-1){let e=c.current;c.current+=1,g.current=e}return g.current}:-1)),E=O.useRef(null),S=O.useCallback(e=>{if(E.current=e,a!==-1&&e!==null&&(d.current[a]=e,h)){let l=n!==void 0;h.current[a]=l?n:s?.current?.textContent??e.textContent}},[a,d,h,n,s]);return C(()=>{if(m!=null)return;let e=E.current;if(e)return x(e,r),()=>{p(e)}},[m,x,p,r]),C(()=>{if(m==null)return f(e=>{let l=E.current?e.get(E.current)?.index:null;l!=null&&i(l)})},[m,f,i]),{ref:S,index:a}}o(V,"useCompositeListItem");var b=L(T(),1);var v=L(z(),1);function Z(t){let{children:n,elementsRef:r,labelsRef:s,onMapChange:N}=t,m=M(N),x=b.useRef(0),p=_(U).current,f=_(k).current,[d,h]=b.useState(0),c=b.useRef(d),g=M((e,l)=>{f.set(e,l??null),c.current+=1,h(c.current)}),a=M(e=>{f.delete(e),c.current+=1,h(c.current)}),i=b.useMemo(()=>{let e=new Map;return Array.from(f.keys()).filter(u=>u.isConnected).sort(A).forEach((u,I)=>{let R=f.get(u)??{};e.set(u,{...R,index:I})}),e},[f,d]);C(()=>{if(typeof MutationObserver!="function"||i.size===0)return;let e=new MutationObserver(l=>{let u=new Set,I=o(R=>u.has(R)?u.delete(R):u.add(R),"updateDiff");l.forEach(R=>{R.removedNodes.forEach(I),R.addedNodes.forEach(I)}),u.size===0&&(c.current+=1,h(c.current))});return i.forEach((l,u)=>{u.parentElement&&e.observe(u.parentElement,{childList:!0})}),()=>{e.disconnect()}},[i]),C(()=>{c.current===d&&(r.current.length!==i.size&&(r.current.length=i.size),s&&s.current.length!==i.size&&(s.current.length=i.size),x.current=i.size),m(i)},[m,i,r,s,d]),C(()=>()=>{r.current=[]},[r]),C(()=>()=>{s&&(s.current=[])},[s]);let E=M(e=>(p.add(e),()=>{p.delete(e)}));C(()=>{p.forEach(e=>e(i))},[p,i]);let S=b.useMemo(()=>({register:g,unregister:a,subscribeMapChange:E,elementsRef:r,labelsRef:s,nextIndexRef:x}),[g,a,E,r,s,x]);return(0,v.jsx)(D.Provider,{value:S,children:n})}o(Z,"CompositeList");function k(){return new Map}o(k,"createMap");function U(){return new Set}o(U,"createListeners");function A(t,n){let r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}o(A,"sortByDocumentPosition");function re(t){let n=t.getBoundingClientRect(),r=P(t);if(y.env.jsdom)return n;let s=r.getComputedStyle(t,"::before"),N=r.getComputedStyle(t,"::after");if(!(s.content!=="none"||N.content!=="none"))return n;let x=parseFloat(s.width)||0,p=parseFloat(s.height)||0,f=parseFloat(N.width)||0,d=parseFloat(N.height)||0,h=Math.max(n.width,x,f),c=Math.max(n.height,p,d),g=h-n.width,a=c-n.height;return{left:n.left-g/2,right:n.right+g/2,top:n.top-a/2,bottom:n.bottom+a/2}}o(re,"getPseudoElementBounds");function ie(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}o(ie,"isElementDisabled");export{W as a,V as b,Z as c,re as d,ie as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $,b as F,c as D,d as p,e as l,f as i}from"./chunk-GTM65MVX.js";import{a as se}from"./chunk-VLXV72QE.js";import{R as te}from"./chunk-3CJW6NWG.js";import{c as T}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as K}from"./chunk-AQGOX5DK.js";import{a as B}from"./chunk-TAD43CG5.js";import{b as ae}from"./chunk-DVKPRFIJ.js";import{a as R,e as _}from"./chunk-SEU5V7I6.js";import"./chunk-CKSHCYGC.js";import{f as Q}from"./chunk-X7MMBSNW.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as V,e as X,f as Y,g as E,k as W}from"./chunk-PVZI3CXP.js";import"./chunk-GMSGZDDH.js";import{a as r,e as ee,f as re,h as le}from"./chunk-RRCPZMC2.js";var n=ee(re(),1);var e=ee(le(),1);var ie=["queued","running","paused","waiting","complete","errored","terminated"],ne=["pause","resume","terminate"],de="WORKFLOWS_NOT_CONFIGURED",ce=r(c=>typeof c=="object"&&c!==null&&c.code===de,"isNotConfigured"),fe=r(c=>{let s=c.error??c.output;if(s===void 0)return"\u2014";try{return JSON.stringify(s)}catch{return"(unserializable)"}},"formatStepPayload"),ue=r(({loadDetail:c,loadInstances:s,readOnly:y,runAction:L,workflowName:v})=>{let A=Q(),o=V(),[x,N]=(0,n.useState)(null),[k,I]=(0,n.useState)(null),[w,P]=(0,n.useState)(""),[g,h]=(0,n.useState)(null),[U,S]=(0,n.useState)(!1),[z,J]=(0,n.useState)(null),m=c??(a=>A.getWorkflowInstance(a)),O=y?void 0:L??(s===void 0?a=>A.setWorkflowInstanceStatus(a):void 0),j=r(async()=>{h(null),S(!1);let a=w===""?void 0:w;try{if(s===void 0){let d=await A.listWorkflowInstances({name:v,status:a});if(d.configured===!1){N(null),S(!0);return}N(d.instances);return}N(await s({name:v,status:a}))}catch(d){N(null),ce(d)?S(!0):h(E(d))}},"load");(0,n.useEffect)(()=>{I(null),W(j())},[v,w]);let G=r(async a=>{h(null);try{I(await m({id:a,name:v}))}catch(d){h(E(d))}},"openDetail"),H=r(async(a,d)=>{if(O!==void 0){J(a),h(null);try{await O({action:d,id:a,name:v}),await j()}catch(M){h(E(M))}finally{J(null)}}},"act");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxDEV)("h3",{className:"text-sm font-medium",children:o("Instance history")},void 0,!1),(0,e.jsxDEV)("select",{"aria-label":o("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:r(a=>{P(a.target.value)},"onChange"),value:w,children:[(0,e.jsxDEV)("option",{value:"",children:o("All statuses")},void 0,!1),ie.map(a=>(0,e.jsxDEV)("option",{value:a,children:a},a,!1))]},void 0,!0)]},void 0,!0),g!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:g},void 0,!1),U&&(0,e.jsxDEV)(B,{description:o("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:o("Workflow inspection not configured")},void 0,!1),!U&&x!==null&&x.length===0&&(0,e.jsxDEV)(B,{description:o("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:o("No instances")},void 0,!1),x!==null&&x.length>0&&(0,e.jsxDEV)(R,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(_,{className:"px-0",children:(0,e.jsxDEV)($,{"data-testid":"workflow-instances-table",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:o("Instance id")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Status")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Created")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Ended")},void 0,!1),(0,e.jsxDEV)(l,{"aria-label":o("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:x.map(a=>(0,e.jsxDEV)(p,{"data-testid":`workflow-instance-${a.id}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:a.id},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:a.status},void 0,!1),(0,e.jsxDEV)(i,{className:"text-muted-foreground tabular-nums",children:a.createdOn??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"text-muted-foreground tabular-nums",children:a.endedOn??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"text-right",children:(0,e.jsxDEV)("div",{className:"flex justify-end gap-1.5",children:[(0,e.jsxDEV)(T,{"data-testid":`workflow-instance-steps-${a.id}`,onClick:r(()=>{W(G(a.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Steps")},void 0,!1),O!==void 0&&ne.map(d=>(0,e.jsxDEV)(T,{"data-testid":`workflow-instance-${d}-${a.id}`,disabled:z===a.id,onClick:r(()=>{W(H(a.id,d))},"onClick"),size:"sm",type:"button",variant:"ghost",children:o(d)},d,!1))]},void 0,!0)},void 0,!1)]},a.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),k!==null&&(0,e.jsxDEV)(R,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,e.jsxDEV)(_,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between",children:[(0,e.jsxDEV)("span",{className:"font-mono text-xs",children:[o("Steps")," \xB7 ",k.id]},void 0,!0),(0,e.jsxDEV)(T,{"data-testid":"workflow-instance-detail-close",onClick:r(()=>{I(null)},"onClick"),size:"xs",type:"button",variant:"ghost",children:o("Close")},void 0,!1)]},void 0,!0),k.steps.length===0?(0,e.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:o("This instance has no recorded steps yet.")},void 0,!1):(0,e.jsxDEV)($,{"data-testid":"workflow-instance-steps",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:o("Step")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Type")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Attempts")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Started")},void 0,!1),(0,e.jsxDEV)(l,{children:o("Output")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:k.steps.map((a,d)=>(0,e.jsxDEV)(p,{"data-testid":`workflow-step-${String(d)}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:a.name},void 0,!1),(0,e.jsxDEV)(i,{className:"text-xs text-muted-foreground",children:a.type??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"tabular-nums",children:a.attempts??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"text-muted-foreground tabular-nums",children:a.start??"\u2014"},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:fe(a)},void 0,!1)]},`${a.name}:${String(d)}`,!0))},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1)]},void 0,!0)},"WorkflowInstanceHistory"),me=X(K.createWorkflowInstance),ve=X(K.getWorkflowInstanceStatus),he=r(c=>{if(c.error)return`${c.error.name}: ${c.error.message}`;if(c.output===void 0)return"\u2014";try{return JSON.stringify(c.output)}catch{return"(unserializable)"}},"formatPayload"),Oe=r(()=>{let c=Q(),s=V(),{data:y,error:L}=ae(K.listWorkflows,{}),[v,A]=(0,n.useState)(""),[o,x]=(0,n.useState)(""),[N,k]=(0,n.useState)(""),[I,w]=(0,n.useState)(!1),[P,g]=(0,n.useState)(null),[h,U]=(0,n.useState)([]),[S,z]=(0,n.useState)(null),J=y!==void 0,m=(0,n.useMemo)(()=>Array.isArray(y?.workflows)?[...y.workflows].toSorted((t,u)=>t.exportName.localeCompare(u.exportName)):[],[y]),C=(0,n.useMemo)(()=>m.some(t=>t.exportName===v)?v:m[0]?.exportName??"",[m,v]),q=(0,n.useMemo)(()=>m.find(t=>t.exportName===C),[m,C]),O=r(t=>{U(u=>{let f=u.filter(b=>!(b.exportName===t.exportName&&b.id===t.id));return[t,...f]})},"upsertInstance"),j=r(async()=>{let t=C;if(t==="")return;let u,f=N.trim();if(f!=="")try{u=JSON.parse(f)}catch{g(s("Params must be valid JSON"));return}w(!0),g(null);try{let b=o.trim(),Z=await c.query(me,{exportName:t,id:b===""?void 0:b,params:u},Y(""));O({exportName:t,id:Z.id,status:Z.status}),x("")}catch(b){g(E(b))}finally{w(!1)}},"start"),G=r(()=>{W(j())},"startInstance"),H=r(async(t,u)=>{z(u);try{let f=await c.query(ve,{exportName:t,id:u},Y(""));O({error:f.error,exportName:t,id:f.id,output:f.output,status:f.status})}catch(f){g(E(f))}finally{z(null)}},"refreshInstance"),a=r(t=>{A(t.target.value)},"onSelectedExportChange"),d=r(t=>{x(t.target.value)},"onInstanceIdChange"),M=r(t=>{k(t.target.value)},"onParamsChange"),oe=r(t=>{let{export:u,id:f}=t.currentTarget.dataset;u!==void 0&&f!==void 0&&W(H(u,f))},"onRefreshClick");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[L!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:L},void 0,!1),(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:s("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")},void 0,!1),J&&m.length===0?(0,e.jsxDEV)(B,{description:s("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:s("No workflows defined")},void 0,!1):(0,e.jsxDEV)(R,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(_,{className:"px-0",children:(0,e.jsxDEV)($,{"data-testid":"workflows-table",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:s("Export")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Name")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Class")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Binding")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:m.map(t=>(0,e.jsxDEV)(p,{"data-testid":`workflows-row-${t.exportName}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:t.exportName},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.name},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.className},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.binding},void 0,!1)]},t.exportName,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),m.length>0&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,e.jsxDEV)("h3",{className:"text-sm font-medium",children:s("Start instance")},void 0,!1),P!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:P},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)("select",{"aria-label":s("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:a,value:C,children:m.map(t=>(0,e.jsxDEV)("option",{value:t.exportName,children:t.exportName},t.exportName,!1))},void 0,!1),(0,e.jsxDEV)(te,{"aria-label":s("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:d,placeholder:s("Instance id (optional)"),value:o},void 0,!1),(0,e.jsxDEV)(T,{"data-testid":"workflows-start-button",disabled:I||C==="",onClick:G,children:s(I?"Starting\u2026":"Start instance")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(se,{"aria-label":s("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:M,placeholder:s("Params (JSON, optional)"),value:N},void 0,!1)]},void 0,!0),h.length>0&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,e.jsxDEV)("h3",{className:"text-sm font-medium",children:s("Instances")},void 0,!1),(0,e.jsxDEV)(R,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(_,{className:"px-0",children:(0,e.jsxDEV)($,{"data-testid":"workflows-instances-table",children:[(0,e.jsxDEV)(F,{children:(0,e.jsxDEV)(p,{children:[(0,e.jsxDEV)(l,{children:s("Workflow")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Instance id")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Status")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Output")},void 0,!1),(0,e.jsxDEV)(l,{},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(D,{children:h.map(t=>(0,e.jsxDEV)(p,{"data-testid":`workflows-instance-${t.id}`,children:[(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:t.exportName},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:t.id},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs",children:t.status},void 0,!1),(0,e.jsxDEV)(i,{className:"font-mono text-xs text-muted-foreground",children:he(t)},void 0,!1),(0,e.jsxDEV)(i,{children:(0,e.jsxDEV)(T,{"data-export":t.exportName,"data-id":t.id,"data-testid":`workflows-instance-refresh-${t.id}`,disabled:S===t.id,onClick:oe,size:"xs",variant:"outline",children:S===t.id?s("Refreshing\u2026"):s("Refresh")},void 0,!1)},void 0,!1)]},`${t.exportName}:${t.id}`,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),q!==void 0&&(0,e.jsxDEV)(ue,{workflowName:q.name},void 0,!1)]},void 0,!0)},"WorkflowsPanel");export{Oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-DVKPRFIJ.js";import{a as y,e as B}from"./chunk-SEU5V7I6.js";import{b as A}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as k}from"./chunk-X7MMBSNW.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as C}from"./chunk-PVZI3CXP.js";import"./chunk-GMSGZDDH.js";import{a as x,e as N,g as O,h as P}from"./chunk-RRCPZMC2.js";var L=N(O(),1);var a=N(P(),1);var S=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],D=x(()=>{let e=(0,L.c)(29),g=k(),t=C(),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=["lunora-auth-capabilities"],e[0]=p):p=e[0];let u;e[1]!==g?(u=x(()=>g.getAuthCapabilities(),"t1"),e[1]=g,e[2]=u):u=e[2];let{data:i,error:l}=E(p,u),s;e[3]!==t?(s=t("Enabled capabilities"),e[3]=t,e[4]=s):s=e[4];let r;e[5]!==s?(r=(0,a.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s},void 0,!1)},void 0,!1),e[5]=s,e[6]=r):r=e[6];let o;e[7]!==l?(o=l!==null&&(0,a.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:l},void 0,!1),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==i||e[10]!==l||e[11]!==t?(d=l===null&&i===void 0&&(0,a.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")},void 0,!1),e[9]=i,e[10]=l,e[11]=t,e[12]=d):d=e[12];let n;e[13]!==i||e[14]!==l||e[15]!==t?(n=l===null&&i!==void 0&&(0,a.jsxDEV)(B,{className:"p-3",children:(0,a.jsxDEV)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:S.map(b=>{let v=i[b.key];return(0,a.jsxDEV)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${b.key}`,children:[(0,a.jsxDEV)("span",{className:"text-sm",children:t(b.label)},void 0,!1),(0,a.jsxDEV)(A,{variant:v?"success":"outline",children:t(v?"Enabled":"Disabled")},void 0,!1)]},b.key,!0)})},void 0,!1)},void 0,!1),e[13]=i,e[14]=l,e[15]=t,e[16]=n):n=e[16];let c;e[17]!==r||e[18]!==o||e[19]!==d||e[20]!==n?(c=(0,a.jsxDEV)(y,{className:"gap-0 py-0",children:[r,o,d,n]},void 0,!0),e[17]=r,e[18]=o,e[19]=d,e[20]=n,e[21]=c):c=e[21];let f;e[22]!==t?(f=t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output."),e[22]=t,e[23]=f):f=e[23];let m;e[24]!==f?(m=(0,a.jsxDEV)(y,{className:"gap-0 py-0",children:(0,a.jsxDEV)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:f},void 0,!1)},void 0,!1),e[24]=f,e[25]=m):m=e[25];let h;return e[26]!==c||e[27]!==m?(h=(0,a.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[c,m]},void 0,!0),e[26]=c,e[27]=m,e[28]=h):h=e[28],h},"AuthConfigPanel");export{D as AuthConfigPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as be,b as ge,c as xe,d as Ne,e as Ce}from"./chunk-LI43EKM6.js";import"./chunk-DWDILV2E.js";import{a as ue}from"./chunk-BACPICH6.js";import"./chunk-QBAT52GB.js";import"./chunk-QAFAJBAW.js";import{g as me,h as ve,i as fe,j as pe}from"./chunk-OV2WFAJX.js";import"./chunk-ZPUO7FNI.js";import"./chunk-764T6X6X.js";import"./chunk-XUGSA2NG.js";import"./chunk-5OIBXYZM.js";import"./chunk-UII66UVF.js";import"./chunk-7TJJXVSE.js";import"./chunk-SVR644RF.js";import"./chunk-KEGAWN6Y.js";import{a as de,b as ne,c as oe,d as q,e as Q,f as X}from"./chunk-GTM65MVX.js";import{a as ce}from"./chunk-VLXV72QE.js";import{a as W}from"./chunk-JSEXCW5Q.js";import"./chunk-KZ6INM5M.js";import"./chunk-4QHKBC77.js";import{R as le}from"./chunk-3CJW6NWG.js";import{c as $}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import"./chunk-AQGOX5DK.js";import{a as ye}from"./chunk-TAD43CG5.js";import"./chunk-DVKPRFIJ.js";import{a as re,e as se}from"./chunk-SEU5V7I6.js";import{b as he}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as Y}from"./chunk-X7MMBSNW.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as U,g as z,k as H,l as ie,m as ke}from"./chunk-PVZI3CXP.js";import"./chunk-GMSGZDDH.js";import{a as n,e as ae,f as Me,g as Le,h as Be}from"./chunk-RRCPZMC2.js";var J=ae(Me(),1);var ee=ae(Le(),1);var l=ae(Be(),1);var De=n(r=>{let e=r.trim();if(e==="")return;let s=Number(e);return Number.isFinite(s)&&s>0?Math.floor(s):void 0},"parseTtl"),Oe=n(r=>r===void 0?"\u2014":new Date(r*1e3).toISOString(),"formatExpiration"),Ae=n(r=>new TextEncoder().encode(r).length,"byteLength"),Te=n(r=>{if(r.trim()!=="")try{return JSON.stringify(JSON.parse(r),void 0,2)}catch{return}},"tryFormatJson"),Ee=n(r=>{if(r.trim()==="")return!0;try{return JSON.parse(r),!0}catch{return!1}},"isJsonOrEmpty"),Fe=[{key:"seconds",seconds:1},{key:"minutes",seconds:60},{key:"hours",seconds:3600},{key:"days",seconds:86400}],Se=n((r,e)=>{let s=r.trim();if(s==="")return"";let u=Number(s),d=Fe.find(f=>f.key===e)?.seconds??1;return Number.isFinite(u)&&u>0?String(Math.round(u*d)):s},"ttlToSeconds"),Ke=n(r=>{let e=r.trim();if(e==="")return!0;let s=Number(e);return Number.isInteger(s)&&s>=60},"isTtlValid"),Ve=n((r,e,s,u)=>{let d=De(r.ttl);return{expiration:d===void 0?u:void 0,expirationTtl:d,key:e,metadata:r.metadata.trim()===""?void 0:JSON.parse(r.metadata),namespace:s,value:r.value}},"buildKvPutOptions"),Ie=n(r=>{let e=(0,ee.c)(60),{helper:s,id:u,invalid:d,onChange:f,testId:o}=r,t=U(),[a,p]=(0,J.useState)(""),[c,x]=(0,J.useState)("seconds"),b;e[0]!==f||e[1]!==c?(b=n(g=>{p(g.target.value),f(Se(g.target.value,c))},"t1"),e[0]=f,e[1]=c,e[2]=b):b=e[2];let M=b,V;e[3]!==a||e[4]!==f?(V=n(g=>{g!==null&&(x(g),f(Se(a,g)))},"t2"),e[3]=a,e[4]=f,e[5]=V):V=e[5];let L=V,h;e[6]!==t?(h=t("days"),e[6]=t,e[7]=h):h=e[7];let v;e[8]!==t?(v=t("hours"),e[8]=t,e[9]=v):v=e[9];let y;e[10]!==t?(y=t("minutes"),e[10]=t,e[11]=y):y=e[11];let N;e[12]!==t?(N=t("seconds"),e[12]=t,e[13]=N):N=e[13];let C;e[14]!==h||e[15]!==v||e[16]!==y||e[17]!==N?(C={days:h,hours:v,minutes:y,seconds:N},e[14]=h,e[15]=v,e[16]=y,e[17]=N,e[18]=C):C=e[18];let S=C,k;e[19]!==t?(k=t("Expires after"),e[19]=t,e[20]=k):k=e[20];let w;e[21]!==u||e[22]!==k?(w=(0,l.jsxDEV)(W,{className:"text-xs",htmlFor:u,children:k},void 0,!1),e[21]=u,e[22]=k,e[23]=w):w=e[23];let E;e[24]!==t?(E=t("No expiration"),e[24]=t,e[25]=E):E=e[25];let B;e[26]!==a||e[27]!==u||e[28]!==d||e[29]!==M||e[30]!==E||e[31]!==o?(B=(0,l.jsxDEV)(le,{"aria-invalid":d,className:"flex-1","data-testid":o,id:u,inputMode:"numeric",onChange:M,placeholder:E,value:a},void 0,!1),e[26]=a,e[27]=u,e[28]=d,e[29]=M,e[30]=E,e[31]=o,e[32]=B):B=e[32];let I;e[33]!==t?(I=t("TTL unit"),e[33]=t,e[34]=I):I=e[34];let O=`${o}-unit`,D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=(0,l.jsxDEV)(ge,{},void 0,!1),e[35]=D):D=e[35];let i;e[36]!==I||e[37]!==O?(i=(0,l.jsxDEV)(xe,{"aria-label":I,className:"w-[7.5rem]","data-testid":O,children:D},void 0,!1),e[36]=I,e[37]=O,e[38]=i):i=e[38];let m;e[39]!==S?(m=Fe.map(g=>(0,l.jsxDEV)(Ce,{value:g.key,children:S[g.key]},g.key,!1)),e[39]=S,e[40]=m):m=e[40];let K;e[41]!==m?(K=(0,l.jsxDEV)(Ne,{children:m},void 0,!1),e[41]=m,e[42]=K):K=e[42];let T;e[43]!==L||e[44]!==i||e[45]!==K||e[46]!==c?(T=(0,l.jsxDEV)(be,{onValueChange:L,value:c,children:[i,K]},void 0,!0),e[43]=L,e[44]=i,e[45]=K,e[46]=c,e[47]=T):T=e[47];let _;e[48]!==B||e[49]!==T?(_=(0,l.jsxDEV)("div",{className:"flex gap-2",children:[B,T]},void 0,!0),e[48]=B,e[49]=T,e[50]=_):_=e[50];let F;e[51]!==s||e[52]!==d||e[53]!==t||e[54]!==o?(F=d?(0,l.jsxDEV)("p",{className:"text-xs text-destructive","data-testid":`${o}-invalid`,children:t("TTL must be at least 60 seconds.")},void 0,!1):s!==void 0&&(0,l.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:s},void 0,!1),e[51]=s,e[52]=d,e[53]=t,e[54]=o,e[55]=F):F=e[55];let A;return e[56]!==_||e[57]!==F||e[58]!==w?(A=(0,l.jsxDEV)("div",{className:"mb-3 grid gap-1",children:[w,_,F]},void 0,!0),e[56]=_,e[57]=F,e[58]=w,e[59]=A):A=e[59],A},"TtlField"),_e=n(r=>{let e=(0,ee.c)(36),{id:s,invalidTestId:u,onChange:d,testId:f,valid:o,value:t}=r,a=U(),p;e[0]!==t?(p=Te(t),e[0]=t,e[1]=p):p=e[1];let c=p,x;e[2]!==a?(x=a("Metadata (JSON)"),e[2]=a,e[3]=x):x=e[3];let b;e[4]!==s||e[5]!==x?(b=(0,l.jsxDEV)(W,{className:"text-xs",htmlFor:s,children:x},void 0,!1),e[4]=s,e[5]=x,e[6]=b):b=e[6];let M=`${f}-format`,V=c===void 0,L;e[7]!==c||e[8]!==d?(L=n(()=>{c!==void 0&&d(c)},"t6"),e[7]=c,e[8]=d,e[9]=L):L=e[9];let h;e[10]!==a?(h=a("Format JSON"),e[10]=a,e[11]=h):h=e[11];let v;e[12]!==M||e[13]!==V||e[14]!==L||e[15]!==h?(v=(0,l.jsxDEV)($,{"data-testid":M,disabled:V,onClick:L,size:"sm",variant:"outline",children:h},void 0,!1),e[12]=M,e[13]=V,e[14]=L,e[15]=h,e[16]=v):v=e[16];let y;e[17]!==b||e[18]!==v?(y=(0,l.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[b,v]},void 0,!0),e[17]=b,e[18]=v,e[19]=y):y=e[19];let N=!o,C;e[20]!==d?(C=n(E=>{d(E.target.value)},"t11"),e[20]=d,e[21]=C):C=e[21];let S;e[22]!==s||e[23]!==N||e[24]!==C||e[25]!==f||e[26]!==t?(S=(0,l.jsxDEV)(ce,{"aria-invalid":N,className:"min-h-[4rem] font-mono text-xs","data-testid":f,id:s,onChange:C,value:t},void 0,!1),e[22]=s,e[23]=N,e[24]=C,e[25]=f,e[26]=t,e[27]=S):S=e[27];let k;e[28]!==u||e[29]!==a||e[30]!==o?(k=!o&&(0,l.jsxDEV)("p",{className:"text-xs text-destructive","data-testid":u,children:a("Metadata must be valid JSON.")},void 0,!1),e[28]=u,e[29]=a,e[30]=o,e[31]=k):k=e[31];let w;return e[32]!==S||e[33]!==k||e[34]!==y?(w=(0,l.jsxDEV)("div",{className:"mb-3 grid gap-1",children:[y,S,k]},void 0,!0),e[32]=S,e[33]=k,e[34]=y,e[35]=w):w=e[35],w},"MetadataField"),Je={busy:!1,error:null,metadata:"",name:"",ttl:"",value:""},Pe=n((r,e)=>{switch(e.type){case"setField":return{...r,[e.field]:e.value};case"submitFailed":return{...r,busy:!1,error:e.error};case"submitStart":return{...r,busy:!0,error:null};default:return r}},"createReducer"),$e=n(r=>{let e=(0,ee.c)(73),{namespace:s,onCancel:u,onCreated:d}=r,f=Y(),o=U(),[t,a]=(0,J.useReducer)(Pe,Je),p;e[0]!==t.metadata?(p=Ee(t.metadata),e[0]=t.metadata,e[1]=p):p=e[1];let c=p,x;e[2]!==t.ttl?(x=Ke(t.ttl),e[2]=t.ttl,e[3]=x):x=e[3];let b=x,M;e[4]!==c||e[5]!==t.busy||e[6]!==t.name||e[7]!==b?(M=t.name.trim()!==""&&c&&b&&!t.busy,e[4]=c,e[5]=t.busy,e[6]=t.name,e[7]=b,e[8]=M):M=e[8];let V=M,L;e[9]!==V||e[10]!==f||e[11]!==s||e[12]!==d||e[13]!==t.metadata||e[14]!==t.name||e[15]!==t.ttl||e[16]!==t.value?(L=n(()=>{V&&(a({type:"submitStart"}),H((async()=>{try{await f.putKvValue(Ve({metadata:t.metadata,ttl:t.ttl,value:t.value},t.name,s)),d()}catch(j){a({error:z(j),type:"submitFailed"})}})()))},"t4"),e[9]=V,e[10]=f,e[11]=s,e[12]=d,e[13]=t.metadata,e[14]=t.name,e[15]=t.ttl,e[16]=t.value,e[17]=L):L=e[17];let h=L,v;e[18]!==o?(v=o("Key name"),e[18]=o,e[19]=v):v=e[19];let y;e[20]!==v?(y=(0,l.jsxDEV)(W,{className:"text-xs",htmlFor:"kv-create-name",children:v},void 0,!1),e[20]=v,e[21]=y):y=e[21];let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=n(j=>{a({field:"name",type:"setField",value:j.target.value})},"t7"),e[22]=N):N=e[22];let C;e[23]!==o?(C=o("Key name"),e[23]=o,e[24]=C):C=e[24];let S;e[25]!==t.name||e[26]!==C?(S=(0,l.jsxDEV)(le,{autoFocus:!0,"data-testid":"kv-create-name",id:"kv-create-name",onChange:N,placeholder:C,value:t.name},void 0,!1),e[25]=t.name,e[26]=C,e[27]=S):S=e[27];let k;e[28]!==y||e[29]!==S?(k=(0,l.jsxDEV)("div",{className:"grid gap-1",children:[y,S]},void 0,!0),e[28]=y,e[29]=S,e[30]=k):k=e[30];let w;e[31]!==o?(w=o("Value"),e[31]=o,e[32]=w):w=e[32];let E;e[33]!==w?(E=(0,l.jsxDEV)(W,{className:"text-xs",htmlFor:"kv-create-value",children:w},void 0,!1),e[33]=w,e[34]=E):E=e[34];let B;e[35]===Symbol.for("react.memo_cache_sentinel")?(B=n(j=>{a({field:"value",type:"setField",value:j.target.value})},"t13"),e[35]=B):B=e[35];let I;e[36]!==t.value?(I=(0,l.jsxDEV)(ce,{className:"min-h-[6rem] font-mono text-xs","data-testid":"kv-create-value",id:"kv-create-value",onChange:B,value:t.value},void 0,!1),e[36]=t.value,e[37]=I):I=e[37];let O;e[38]!==E||e[39]!==I?(O=(0,l.jsxDEV)("div",{className:"grid gap-1",children:[E,I]},void 0,!0),e[38]=E,e[39]=I,e[40]=O):O=e[40];let D=!b,i;e[41]===Symbol.for("react.memo_cache_sentinel")?(i=n(j=>{a({field:"ttl",type:"setField",value:j})},"t17"),e[41]=i):i=e[41];let m;e[42]!==D?(m=(0,l.jsxDEV)(Ie,{id:"kv-create-ttl",invalid:D,onChange:i,testId:"kv-create-ttl"},void 0,!1),e[42]=D,e[43]=m):m=e[43];let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=n(j=>{a({field:"metadata",type:"setField",value:j})},"t19"),e[44]=K):K=e[44];let T;e[45]!==c||e[46]!==t.metadata?(T=(0,l.jsxDEV)(_e,{id:"kv-create-metadata",invalidTestId:"kv-create-metadata-invalid",onChange:K,testId:"kv-create-metadata",valid:c,value:t.metadata},void 0,!1),e[45]=c,e[46]=t.metadata,e[47]=T):T=e[47];let _=!V,F;e[48]!==t.busy||e[49]!==o?(F=t.busy?o("Creating\u2026"):o("Create key"),e[48]=t.busy,e[49]=o,e[50]=F):F=e[50];let A;e[51]!==h||e[52]!==_||e[53]!==F?(A=(0,l.jsxDEV)($,{"data-testid":"kv-create-submit",disabled:_,onClick:h,children:F},void 0,!1),e[51]=h,e[52]=_,e[53]=F,e[54]=A):A=e[54];let g=t.busy,P;e[55]!==o?(P=o("Cancel"),e[55]=o,e[56]=P):P=e[56];let R;e[57]!==u||e[58]!==t.busy||e[59]!==P?(R=(0,l.jsxDEV)($,{"data-testid":"kv-create-cancel",disabled:g,onClick:u,variant:"outline",children:P},void 0,!1),e[57]=u,e[58]=t.busy,e[59]=P,e[60]=R):R=e[60];let Z;e[61]!==A||e[62]!==R?(Z=(0,l.jsxDEV)("div",{className:"flex flex-wrap gap-2",children:[A,R]},void 0,!0),e[61]=A,e[62]=R,e[63]=Z):Z=e[63];let G;e[64]!==t.error?(G=t.error!==null&&(0,l.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"kv-create-error",role:"alert",children:t.error},void 0,!1),e[64]=t.error,e[65]=G):G=e[65];let te;return e[66]!==k||e[67]!==O||e[68]!==m||e[69]!==T||e[70]!==Z||e[71]!==G?(te=(0,l.jsxDEV)("div",{className:"grid gap-3 px-4 pb-4","data-testid":"kv-create-form",children:[k,O,m,T,Z,G]},void 0,!0),e[66]=k,e[67]=O,e[68]=m,e[69]=T,e[70]=Z,e[71]=G,e[72]=te):te=e[72],te},"KvCreateForm"),je={busy:"",editedMetadata:"",editedTtl:"",editedValue:"",loadError:null,loading:!0,value:null,writeError:null},He=n((r,e)=>{switch(e.type){case"deleteStart":return{...r,busy:"deleting",writeError:null};case"editMetadata":return{...r,editedMetadata:e.value};case"editTtl":return{...r,editedTtl:e.value};case"editValue":return{...r,editedValue:e.value};case"loaded":return{...r,editedMetadata:e.metadata===null||e.metadata===void 0?"":JSON.stringify(e.metadata,null,2),editedValue:e.value??"",loading:!1,value:e.value};case"loadFailed":return{...r,loadError:e.error,loading:!1};case"saveOk":return{...r,busy:"",value:r.editedValue};case"saveStart":return{...r,busy:"saving",writeError:null};case"writeFailed":return{...r,busy:"",writeError:e.error};default:return r}},"valueReducer"),Re=n(r=>{let e=(0,ee.c)(67),{expiration:s,keyName:u,namespace:d,onDeleted:f}=r,o=Y(),t=U(),[a,p]=(0,J.useReducer)(He,je),c,x;e[0]!==o||e[1]!==u||e[2]!==d?(c=n(()=>{let g={cancelled:!1};return H((async()=>{try{let P=await o.getKvValue({key:u,namespace:d});g.cancelled||p({metadata:P.metadata,type:"loaded",value:P.value})}catch(P){let R=P;g.cancelled||p({error:z(R),type:"loadFailed"})}})()),()=>{g.cancelled=!0}},"t1"),x=[o,d,u],e[0]=o,e[1]=u,e[2]=d,e[3]=c,e[4]=x):(c=e[3],x=e[4]),(0,J.useEffect)(c,x);let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n(g=>{p({type:"editValue",value:g.target.value})},"t3"),e[5]=b):b=e[5];let M=b,V;e[6]===Symbol.for("react.memo_cache_sentinel")?(V=n(g=>{p({type:"editMetadata",value:g})},"t4"),e[6]=V):V=e[6];let L=V,h;e[7]!==a.editedValue?(h=Te(a.editedValue),e[7]=a.editedValue,e[8]=h):h=e[8];let v=h,y;e[9]!==a.editedMetadata?(y=Ee(a.editedMetadata),e[9]=a.editedMetadata,e[10]=y):y=e[10];let N=y,C;e[11]!==a.editedTtl?(C=Ke(a.editedTtl),e[11]=a.editedTtl,e[12]=C):C=e[12];let S=C,k;e[13]!==v?(k=n(()=>{v!==void 0&&p({type:"editValue",value:v})},"t8"),e[13]=v,e[14]=k):k=e[14];let w=k,E;e[15]!==o||e[16]!==s||e[17]!==u||e[18]!==N||e[19]!==d||e[20]!==a.editedMetadata||e[21]!==a.editedTtl||e[22]!==a.editedValue||e[23]!==t?(E=n(()=>{if(!N){p({error:t("Metadata must be valid JSON."),type:"writeFailed"});return}p({type:"saveStart"}),H((async()=>{try{await o.putKvValue(Ve({metadata:a.editedMetadata,ttl:a.editedTtl,value:a.editedValue},u,d,s)),p({type:"saveOk"})}catch(g){p({error:z(g),type:"writeFailed"})}})())},"t9"),e[15]=o,e[16]=s,e[17]=u,e[18]=N,e[19]=d,e[20]=a.editedMetadata,e[21]=a.editedTtl,e[22]=a.editedValue,e[23]=t,e[24]=E):E=e[24];let B=E,I;e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==f?(I=n(()=>{p({type:"deleteStart"}),H((async()=>{try{await o.deleteKvKey({key:u,namespace:d}),f(u)}catch(g){p({error:z(g),type:"writeFailed"})}})())},"t10"),e[25]=o,e[26]=u,e[27]=d,e[28]=f,e[29]=I):I=e[29];let O=I,D;e[30]!==u?(D=n(()=>{ie(u)},"t11"),e[30]=u,e[31]=D):D=e[31];let i;e[32]!==t?(i=t("Copy key"),e[32]=t,e[33]=i):i=e[33];let m;e[34]!==D||e[35]!==i?(m=(0,l.jsxDEV)("div",{className:"mb-2 flex justify-end",children:(0,l.jsxDEV)($,{"data-testid":"kv-copy-key-btn",onClick:D,size:"sm",variant:"outline",children:i},void 0,!1)},void 0,!1),e[34]=D,e[35]=i,e[36]=m):m=e[36];let K;e[37]!==a.loadError?(K=a.loadError!==null&&(0,l.jsxDEV)("p",{className:"mb-2 text-sm text-destructive","data-testid":"kv-value-error",role:"alert",children:a.loadError},void 0,!1),e[37]=a.loadError,e[38]=K):K=e[38];let T;e[39]!==a.loading||e[40]!==t?(T=a.loading&&(0,l.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-value-loading",children:t("Loading\u2026")},void 0,!1),e[39]=a.loading,e[40]=t,e[41]=T):T=e[41];let _;e[42]!==v||e[43]!==N||e[44]!==O||e[45]!==w||e[46]!==B||e[47]!==a.busy||e[48]!==a.editedMetadata||e[49]!==a.editedValue||e[50]!==a.loading||e[51]!==a.value||e[52]!==a.writeError||e[53]!==t||e[54]!==S?(_=!a.loading&&a.value!==null&&(0,l.jsxDEV)(l.Fragment,{children:[(0,l.jsxDEV)("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[(0,l.jsxDEV)(W,{className:"text-xs",htmlFor:"kv-value-editor",children:t("Value")},void 0,!1),v!==void 0&&(0,l.jsxDEV)(he,{variant:"secondary",children:t("JSON")},void 0,!1),(0,l.jsxDEV)("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground","data-testid":"kv-value-size",children:ke(Ae(a.editedValue))},void 0,!1)]},void 0,!0),(0,l.jsxDEV)("textarea",{"aria-label":t("KV value"),className:"mb-2 min-h-[8rem] w-full rounded border border-border bg-muted/30 p-2 font-mono text-xs","data-testid":"kv-value-editor",id:"kv-value-editor",onChange:M,value:a.editedValue},void 0,!1),(0,l.jsxDEV)("div",{className:"mb-3 flex flex-wrap gap-2",children:[(0,l.jsxDEV)($,{"data-testid":"kv-format-btn",disabled:v===void 0,onClick:w,size:"sm",variant:"outline",children:t("Format JSON")},void 0,!1),(0,l.jsxDEV)($,{"data-testid":"kv-copy-value-btn",onClick:n(()=>{ie(a.editedValue)},"onClick"),size:"sm",variant:"outline",children:t("Copy value")},void 0,!1)]},void 0,!0),(0,l.jsxDEV)(Ie,{helper:t("Leave blank to keep the current expiration."),id:"kv-ttl-input",invalid:!S,onChange:n(g=>{p({type:"editTtl",value:g})},"onChange"),testId:"kv-ttl-input"},void 0,!1),(0,l.jsxDEV)(_e,{id:"kv-metadata-editor",invalidTestId:"kv-metadata-invalid",onChange:L,testId:"kv-metadata-editor",valid:N,value:a.editedMetadata},void 0,!1),(0,l.jsxDEV)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsxDEV)($,{"data-testid":"kv-save-btn",disabled:a.busy!==""||!N||!S,onClick:B,children:a.busy==="saving"?t("Saving\u2026"):t("Save")},void 0,!1),(0,l.jsxDEV)($,{"data-testid":"kv-delete-btn",disabled:a.busy!=="",onClick:O,variant:"destructive",children:a.busy==="deleting"?t("Deleting\u2026"):t("Delete")},void 0,!1)]},void 0,!0),a.writeError!==null&&(0,l.jsxDEV)("p",{className:"mt-2 text-sm text-destructive","data-testid":"kv-save-error",role:"alert",children:a.writeError},void 0,!1)]},void 0,!0),e[42]=v,e[43]=N,e[44]=O,e[45]=w,e[46]=B,e[47]=a.busy,e[48]=a.editedMetadata,e[49]=a.editedValue,e[50]=a.loading,e[51]=a.value,e[52]=a.writeError,e[53]=t,e[54]=S,e[55]=_):_=e[55];let F;e[56]!==a.loadError||e[57]!==a.loading||e[58]!==a.value||e[59]!==t?(F=!a.loading&&a.value===null&&a.loadError===null&&(0,l.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-absent",children:t("Key is absent or has no value.")},void 0,!1),e[56]=a.loadError,e[57]=a.loading,e[58]=a.value,e[59]=t,e[60]=F):F=e[60];let A;return e[61]!==m||e[62]!==K||e[63]!==T||e[64]!==_||e[65]!==F?(A=(0,l.jsxDEV)("div",{className:"px-4 pb-4","data-testid":"kv-value-section",children:[m,K,T,_,F]},void 0,!0),e[61]=m,e[62]=K,e[63]=T,e[64]=_,e[65]=F,e[66]=A):A=e[66],A},"KvValueEditor"),we=100,ze={appliedPrefix:"",bulk:[],bulkBusy:!1,bulkError:null,cursor:null,keys:null,listComplete:!1,loadError:null,loading:!1,prefixInput:"",reloadNonce:0,selectedKey:null},Ue=n((r,e)=>{switch(e.type){case"appendPage":return{...r,cursor:e.cursor,keys:[...r.keys??[],...e.keys],listComplete:e.listComplete,loading:!1};case"applyFilter":return{...r,appliedPrefix:r.prefixInput,bulk:[],bulkError:null,cursor:null,keys:null,listComplete:!1,selectedKey:null};case"bulkDeleted":{let s=new Set(e.deleted);return{...r,bulk:r.bulk.filter(u=>!s.has(u)),bulkBusy:!1,bulkError:e.error,keys:r.keys===null?null:r.keys.filter(u=>!s.has(u.name)),selectedKey:r.selectedKey!==null&&s.has(r.selectedKey)?null:r.selectedKey}}case"bulkDeleteStart":return{...r,bulkBusy:!0,bulkError:null};case"firstPage":return{...r,cursor:e.cursor,keys:e.keys,listComplete:e.listComplete,loading:!1};case"keyDeleted":return{...r,bulk:r.bulk.filter(s=>s!==e.name),keys:r.keys===null?null:r.keys.filter(s=>s.name!==e.name),selectedKey:null};case"loadFailed":return{...r,loadError:e.error,loading:!1};case"loadStart":return{...r,loadError:null,loading:!0};case"prefixInput":return{...r,prefixInput:e.value};case"reload":return{...r,bulk:[],bulkError:null,reloadNonce:r.reloadNonce+1,selectedKey:null};case"selectKey":return{...r,selectedKey:e.name};case"toggleAllBulk":return{...r,bulk:e.names};case"toggleBulk":return{...r,bulk:r.bulk.includes(e.name)?r.bulk.filter(s=>s!==e.name):[...r.bulk,e.name]};default:return r}},"keyListReducer"),Ze=n(({namespace:r})=>{let e=Y(),s=U(),[u,d]=(0,J.useReducer)(Ue,ze),{appliedPrefix:f,bulk:o,bulkBusy:t,bulkError:a,cursor:p,keys:c,listComplete:x,loadError:b,loading:M,prefixInput:V,reloadNonce:L,selectedKey:h}=u,[v,y]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let i={cancelled:!1};return H((async()=>{d({type:"loadStart"});try{let m=await e.listKvKeys({limit:we,namespace:r,prefix:f===""?void 0:f});i.cancelled||d({cursor:m.cursor??null,keys:m.keys,listComplete:m.listComplete,type:"firstPage"})}catch(m){i.cancelled||d({error:z(m),type:"loadFailed"})}})()),()=>{i.cancelled=!0}},[e,r,f,L]);let N=n(i=>{d({type:"prefixInput",value:i.target.value})},"onPrefixChange"),C=n(()=>{d({type:"applyFilter"})},"onFilter"),S=n(i=>{d({name:i.currentTarget.dataset.key??null,type:"selectKey"})},"onSelectKey"),k=n(()=>{p!==null&&(d({type:"loadStart"}),H((async()=>{try{let i=await e.listKvKeys({cursor:p,limit:we,namespace:r,prefix:f===""?void 0:f});d({cursor:i.cursor??null,keys:i.keys,listComplete:i.listComplete,type:"appendPage"})}catch(i){d({error:z(i),type:"loadFailed"})}})()))},"onLoadMore"),w=n(i=>{d({name:i,type:"keyDeleted"})},"onKeyDeleted"),E=n(i=>{d({name:i,type:"toggleBulk"})},"onToggleBulk"),B=n(i=>{d({names:i&&c!==null?c.map(m=>m.name):[],type:"toggleAllBulk"})},"onToggleAll"),I=n(()=>{if(o.length===0)return;let i=[...o];d({type:"bulkDeleteStart"}),H((async()=>{let m=await Promise.allSettled(i.map(_=>e.deleteKvKey({key:_,namespace:r}))),K=i.filter((_,F)=>m[F]?.status==="fulfilled"),T=i.length-K.length;d({deleted:K,error:T>0?s("Failed to delete {count} keys.",{count:T}):null,type:"bulkDeleted"})})())},"onBulkDelete"),O=n(()=>{y(!1),d({type:"reload"})},"onCreated"),D=c!==null&&c.length>0&&o.length===c.length;return(0,l.jsxDEV)(l.Fragment,{children:[(0,l.jsxDEV)("section",{className:"border border-border bg-card p-3","data-testid":"kv-keys-section",children:[(0,l.jsxDEV)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,l.jsxDEV)(le,{"aria-label":s("Filter keys by prefix"),className:"min-w-[16rem] flex-1","data-testid":"kv-prefix-input",onChange:N,placeholder:s("Filter by prefix\u2026"),value:V},void 0,!1),(0,l.jsxDEV)($,{"data-testid":"kv-filter-btn",disabled:M,onClick:C,children:s("Filter")},void 0,!1),(0,l.jsxDEV)($,{"data-testid":"kv-new-key-btn",onClick:n(()=>{y(i=>!i)},"onClick"),variant:"outline",children:s("New key")},void 0,!1),o.length>0&&(0,l.jsxDEV)($,{"data-testid":"kv-bulk-delete-btn",disabled:t,onClick:I,variant:"destructive",children:t?s("Deleting\u2026"):s("Delete {count}",{count:o.length})},void 0,!1)]},void 0,!0),a!==null&&(0,l.jsxDEV)("p",{className:"mb-2 text-sm text-destructive","data-testid":"kv-bulk-error",role:"alert",children:a},void 0,!1),b!==null&&(0,l.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"kv-keys-error",role:"alert",children:b},void 0,!1),c!==null&&c.length===0&&!M&&(0,l.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-no-keys",children:s("No keys.")},void 0,!1),c!==null&&c.length>0&&(0,l.jsxDEV)(re,{className:"overflow-hidden py-0",children:(0,l.jsxDEV)(se,{className:"px-0",children:(0,l.jsxDEV)(de,{"data-testid":"kv-key-table",children:[(0,l.jsxDEV)(ne,{children:(0,l.jsxDEV)(q,{children:[(0,l.jsxDEV)(Q,{className:"w-10",children:(0,l.jsxDEV)(ue,{"aria-label":s("Select all"),checked:D,"data-testid":"kv-select-all",onCheckedChange:B},void 0,!1)},void 0,!1),(0,l.jsxDEV)(Q,{children:s("Key")},void 0,!1),(0,l.jsxDEV)(Q,{children:s("Expiration")},void 0,!1)]},void 0,!0)},void 0,!1),(0,l.jsxDEV)(oe,{children:c.map(i=>(0,l.jsxDEV)(q,{className:i.name===h?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-key":i.name,"data-testid":`kv-key-row-${i.name}`,onClick:S,children:[(0,l.jsxDEV)(X,{onClick:n(m=>{m.stopPropagation()},"onClick"),children:(0,l.jsxDEV)(ue,{"aria-label":s("Select {name}",{name:i.name}),checked:o.includes(i.name),"data-testid":`kv-select-${i.name}`,onCheckedChange:n(()=>{E(i.name)},"onCheckedChange")},void 0,!1)},void 0,!1),(0,l.jsxDEV)(X,{className:"font-mono text-xs",children:i.name},void 0,!1),(0,l.jsxDEV)(X,{className:"tabular-nums text-xs",children:Oe(i.expiration)},void 0,!1)]},i.name,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),!x&&p!==null&&(0,l.jsxDEV)("div",{className:"mt-2",children:(0,l.jsxDEV)($,{"data-testid":"kv-load-more",disabled:M,onClick:k,variant:"outline",children:s(M?"Loading\u2026":"Load more")},void 0,!1)},void 0,!1)]},void 0,!0),(0,l.jsxDEV)(me,{onOpenChange:n(i=>{i||y(!1)},"onOpenChange"),open:v,children:(0,l.jsxDEV)(ve,{className:"w-full gap-0 overflow-y-auto sm:max-w-md","data-testid":"kv-create-sheet",side:"right",children:[(0,l.jsxDEV)(fe,{children:(0,l.jsxDEV)(pe,{children:s("New key")},void 0,!1)},void 0,!1),(0,l.jsxDEV)($e,{namespace:r,onCancel:n(()=>{y(!1)},"onCancel"),onCreated:O},void 0,!1)]},void 0,!0)},void 0,!1),(0,l.jsxDEV)(me,{onOpenChange:n(i=>{i||d({name:null,type:"selectKey"})},"onOpenChange"),open:h!==null,children:(0,l.jsxDEV)(ve,{className:"w-full gap-0 overflow-y-auto sm:max-w-md","data-testid":"kv-editor-sheet",side:"right",children:[(0,l.jsxDEV)(fe,{children:(0,l.jsxDEV)(pe,{className:"truncate font-mono text-xs",children:h},void 0,!1)},void 0,!1),h!==null&&(0,l.jsxDEV)(Re,{expiration:c?.find(i=>i.name===h)?.expiration,keyName:h,namespace:r,onDeleted:w},`${r}:${h}`,!1)]},void 0,!0)},void 0,!1)]},void 0,!0)},"KvKeyList"),ot=n(({loadNamespaces:r}={})=>{let e=Y(),s=U(),[u,d]=(0,J.useState)(null),[f,o]=(0,J.useState)(null),[t,a]=(0,J.useState)(null);(0,J.useEffect)(()=>{let c={cancelled:!1};return H((async()=>{try{let x=await(r??(()=>e.listKvNamespaces()))();c.cancelled||(d(x),o(null),a(b=>b??x[0]?.binding??null))}catch(x){c.cancelled||(d(null),o(z(x)))}})()),()=>{c.cancelled=!0}},[e,r]);let p=n(c=>{a(c.currentTarget.dataset.ns??null)},"onSelectNs");return(0,l.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-kv-browser",children:[f!==null&&(0,l.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"kv-ns-error",role:"alert",children:f},void 0,!1),u!==null&&u.length===0&&(0,l.jsxDEV)(ye,{description:s("Add a kv_namespaces binding to wrangler.jsonc \u2014 it appears here automatically, no wiring needed."),icon:(0,l.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"},void 0,!1)},void 0,!1),testId:"kv-empty",title:s("No KV namespaces.")},void 0,!1),u!==null&&u.length>0&&(0,l.jsxDEV)(re,{className:"overflow-hidden py-0",children:(0,l.jsxDEV)(se,{className:"px-0",children:(0,l.jsxDEV)(de,{"data-testid":"kv-namespace-table",children:[(0,l.jsxDEV)(ne,{children:(0,l.jsxDEV)(q,{children:(0,l.jsxDEV)(Q,{children:s("Namespace")},void 0,!1)},void 0,!1)},void 0,!1),(0,l.jsxDEV)(oe,{children:u.map(c=>(0,l.jsxDEV)(q,{className:c.binding===t?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-ns":c.binding,"data-testid":`kv-ns-row-${c.binding}`,onClick:p,children:(0,l.jsxDEV)(X,{className:"font-mono text-xs",children:c.binding},void 0,!1)},c.binding,!1))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),t!==null&&(0,l.jsxDEV)(Ze,{namespace:t},t,!1)]},void 0,!0)},"KvBrowser");export{ot as KvBrowser};
|