@lunora/studio 1.0.0-alpha.104 → 1.0.0-alpha.105
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 +2 -2
- package/dist/index.js +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/LogsPanel.js +1 -1
- package/dist/packem_chunks/MetricsPanel.js +1 -1
- package/dist/packem_chunks/agents-panel.js +1 -1
- package/dist/packem_chunks/evals-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -1
- package/dist/packem_chunks/traces-panel.js +1 -1
- package/dist/packem_shared/{Studio-DG_n-8Pc.js → Studio-CD66AkL1.js} +1 -1
- package/dist/packem_shared/{StudioApp-bavavhpe.js → StudioApp-0Vaayv2I.js} +1 -1
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/log-line-BDI826X-.js +1 -0
- package/dist/packem_shared/studio-CUXq5VSB.js +2 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/{use-open-trace-D9XDDHHS.js → use-open-trace-CniEgUdp.js} +1 -1
- package/dist/standalone/{chunk-GY66QQZJ.js → chunk-246BLG4I.js} +1 -1
- package/dist/standalone/{chunk-WEOEKMJN.js → chunk-3CSOMPVV.js} +1 -1
- package/dist/standalone/{chunk-FCSU7IHH.js → chunk-3CXC27LL.js} +1 -1
- package/dist/standalone/{chunk-K5463KGW.js → chunk-46ZHPP3M.js} +1 -1
- package/dist/standalone/{chunk-WXALMQCU.js → chunk-4TLSANPE.js} +1 -1
- package/dist/standalone/{chunk-BR5GIQWK.js → chunk-5DVJR52Z.js} +1 -1
- package/dist/standalone/chunk-5MD62MWO.js +1 -0
- package/dist/standalone/chunk-744YTKHP.js +1 -0
- package/dist/standalone/chunk-7CZI2HNL.js +1 -0
- package/dist/standalone/{chunk-YPQISHBM.js → chunk-AI62XFW6.js} +1 -1
- package/dist/standalone/chunk-AXQU7ULF.js +1 -0
- package/dist/standalone/{chunk-EAGPIRHK.js → chunk-CGKML4NC.js} +1 -1
- package/dist/standalone/{chunk-3JJIZ5GZ.js → chunk-CMQJI7AJ.js} +1 -1
- package/dist/standalone/{chunk-LFYM72CD.js → chunk-CTR7LLJB.js} +1 -1
- package/dist/standalone/{chunk-WVXS24SB.js → chunk-CV2ZHCSQ.js} +1 -1
- package/dist/standalone/{chunk-P6U7JNSA.js → chunk-DYH6W3L5.js} +1 -1
- package/dist/standalone/{chunk-GPXYZOOF.js → chunk-FCLMIH4N.js} +1 -1
- package/dist/standalone/{chunk-76XT6OKR.js → chunk-G4YBB2WW.js} +1 -1
- package/dist/standalone/chunk-GLCJSRZU.js +1 -0
- package/dist/standalone/{chunk-KMGVTPH2.js → chunk-GRGQK4AX.js} +1 -1
- package/dist/standalone/{chunk-REJA4WG5.js → chunk-GXXEKXMR.js} +1 -1
- package/dist/standalone/{chunk-GCIAXZBG.js → chunk-HBSEWNIR.js} +1 -1
- package/dist/standalone/{chunk-OJDJMESX.js → chunk-HFP4PBM5.js} +1 -1
- package/dist/standalone/{chunk-EVPGUJH7.js → chunk-HFRJMPXJ.js} +1 -1
- package/dist/standalone/{chunk-KHZFULUH.js → chunk-HKRRKZPX.js} +1 -1
- package/dist/standalone/{chunk-AAU2LQP2.js → chunk-IRNX35LY.js} +1 -1
- package/dist/standalone/{chunk-TWF72RNA.js → chunk-JGTKRQVM.js} +1 -1
- package/dist/standalone/{chunk-42JIUZ5A.js → chunk-JISQYNVU.js} +1 -1
- package/dist/standalone/{chunk-5BKFMQKO.js → chunk-KAVRYX7T.js} +1 -1
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/{chunk-VA5RUELS.js → chunk-L54MRHOE.js} +1 -1
- package/dist/standalone/{chunk-Q5LK5ZBG.js → chunk-LBORO43W.js} +1 -1
- package/dist/standalone/{chunk-6VTX32BC.js → chunk-LCMKFBA4.js} +1 -1
- package/dist/standalone/{chunk-C2W6YSI7.js → chunk-MUSKZL5Y.js} +1 -1
- package/dist/standalone/{chunk-XOIXFWZS.js → chunk-MVUIIDB7.js} +1 -1
- package/dist/standalone/chunk-MWLD5STA.js +1 -0
- package/dist/standalone/{chunk-RPGUPO5I.js → chunk-NCD4PEEZ.js} +1 -1
- package/dist/standalone/{chunk-ZKDSO2VL.js → chunk-NGENUSFE.js} +1 -1
- package/dist/standalone/{chunk-WWOB5XZT.js → chunk-NM6OOA4L.js} +1 -1
- package/dist/standalone/{chunk-56Q3NCCQ.js → chunk-NQVE5YON.js} +1 -1
- package/dist/standalone/{chunk-AI5UNHBF.js → chunk-NXF4Z5ZP.js} +1 -1
- package/dist/standalone/{chunk-LZFOZFYW.js → chunk-OBMNLQWG.js} +1 -1
- package/dist/standalone/{chunk-2POO335F.js → chunk-OENUM3OW.js} +1 -1
- package/dist/standalone/{chunk-ZBVGZ4YA.js → chunk-OKIEDUHL.js} +1 -1
- package/dist/standalone/{chunk-QM4IZJHK.js → chunk-OKQ3NJOW.js} +1 -1
- package/dist/standalone/{chunk-FSPXSK4F.js → chunk-PA7BSM5T.js} +1 -1
- package/dist/standalone/{chunk-44W6IDID.js → chunk-QOP32XAE.js} +1 -1
- package/dist/standalone/{chunk-OXGSORBK.js → chunk-QT47YQFN.js} +1 -1
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-RGFVM2UG.js +1 -0
- package/dist/standalone/{chunk-WE4LGWB4.js → chunk-U2DFU5HO.js} +1 -1
- package/dist/standalone/{chunk-KMT6UDR7.js → chunk-UDOOZJO5.js} +1 -1
- package/dist/standalone/{chunk-NLANS7IB.js → chunk-UEZXG35P.js} +1 -1
- package/dist/standalone/{chunk-LFOT3KUL.js → chunk-UF6SDOXD.js} +1 -1
- package/dist/standalone/{chunk-ILQLRPP6.js → chunk-UPQGD6JY.js} +1 -1
- package/dist/standalone/{chunk-WVU7GHTG.js → chunk-UQV7Q5S4.js} +2 -2
- package/dist/standalone/{chunk-EP5VOTNC.js → chunk-V4XO5TAT.js} +1 -1
- package/dist/standalone/chunk-VM4RE2MS.js +1 -0
- package/dist/standalone/{chunk-6ZVSFYWY.js → chunk-VU27DLBM.js} +2 -2
- package/dist/standalone/chunk-VU6IQL5Z.js +1 -0
- package/dist/standalone/{chunk-LMZCWLYL.js → chunk-X3CR2UJK.js} +1 -1
- package/dist/standalone/{chunk-L6ZL7C6I.js → chunk-XCNNKMME.js} +1 -1
- package/dist/standalone/{chunk-5VYZCZNH.js → chunk-XDDXCDKW.js} +1 -1
- package/dist/standalone/{chunk-VITTPKH5.js → chunk-XFGE43TZ.js} +1 -1
- package/dist/standalone/{chunk-DUFBHFX6.js → chunk-XJTTJ57C.js} +1 -1
- package/dist/standalone/{chunk-ZU6JSCBE.js → chunk-Z2IF3TEX.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +6 -6
- package/dist/packem_shared/log-line-CmtmbZNE.js +0 -1
- package/dist/packem_shared/studio-C9Qvg13j.js +0 -2
- package/dist/packem_shared/trace-handoff-D7j9TjUT.js +0 -1
- package/dist/standalone/chunk-IN6NPKXV.js +0 -1
- package/dist/standalone/chunk-J6IUJLIJ.js +0 -1
- package/dist/standalone/chunk-K2E4OECF.js +0 -1
- package/dist/standalone/chunk-MX46UN6V.js +0 -1
- package/dist/standalone/chunk-WNCBCYI4.js +0 -1
- package/dist/standalone/chunk-X3W5GATZ.js +0 -1
- package/dist/standalone/chunk-ZD3CL42S.js +0 -1
- package/dist/standalone/chunk-ZMNCF2DE.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as In,b as _n}from"./chunk-6ZVSFYWY.js";import{a as An,d as Vn}from"./chunk-3C3CG7ZK.js";import{a as $t,b as qt,c as Gt,d as Nn,e as Bo}from"./chunk-I6A5C46N.js";import{$ as Pn,A as Bt,C as hn,D as U,E as vn,F as bn,I as Ft,L as _e,M as So,N as jt,P as No,Q as xn,R as yn,S as To,T as Kt,U as zt,V as Ut,W as Zt,X as wo,Y as Wt,_ as Cn,aa as Eo,b as on,ba as ko,ea as Oo,fa as Pe,ga as Rn,ha as Yt,i as sn,ia as Sn,j as ln,ja as de,k as cn,ka as Mo,l as fr,m as xo,ma as Do,na as Io,o as yo,oa as _o,p as dn,pa as Ao,q as Co,qa as Vo,ra as Lo,s as pn,sa as Tn,ta as wn,u as un,ua as Ho,v as mn,va as En,w as fn,x as Po,y as Ro,z as gn}from"./chunk-2QSHLBCO.js";import{c as kn,h as On,k as gr}from"./chunk-QBWRC5YX.js";import{a as Fo}from"./chunk-HPFLBYRI.js";import{b as Dn}from"./chunk-CZZWYUTR.js";import{a as Br,b as Fr,d as jr,e as no,f as pr,g as Kr,h as zr,i as Ur,j as Zr,k as Wr}from"./chunk-SMIESS7P.js";import{B as rn,C as nn,I as ve,J as an,K as Ht,O as H,P as G,R as mr,e as fe,p as ao,q as tn}from"./chunk-CFPZYHPY.js";import{a as Hr}from"./chunk-7QIFDWQV.js";import{a as hr}from"./chunk-MWIKAR7F.js";import{b as Ae}from"./chunk-DJZYD5I5.js";import{a as Ie,c as Xr,h as bo,i as en}from"./chunk-2OUPA2WJ.js";import{a as ur,b as Lt}from"./chunk-THIXMMZD.js";import{a as Ee,c as q,i as je,j}from"./chunk-6ST5ECQA.js";import{a as $r,b as qr}from"./chunk-QLQADHFE.js";import{a as so}from"./chunk-KMT6UDR7.js";import{a as Qr}from"./chunk-XBDKZZ67.js";import{a as Gr,b as Yr,c as Jr,d as ge,o as Jt,q as Mn}from"./chunk-IUYFXK4X.js";import{c as cr}from"./chunk-BR5GIQWK.js";import{a as i,d as lr,e as R,f as D,g as dr,h as se,j as W}from"./chunk-3XIESWL4.js";var _=R(dr(),1);var ye=R(D(),1),M=R(D(),1);var a=R(se(),1);var Ln=R(D(),1),ke=R(se(),1);var Os={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},Ms={overflow:"auto",whiteSpace:"pre-wrap"},jo=class extends Ln.Component{static{i(this,"g")}static getDerivedStateFromError(e){return{error:e}}state={error:null};componentDidCatch(e,o){console.error("[lunora-studio] panel error",e,o.componentStack)}reset=i(()=>{this.setState({error:null})},"reset");render(){let{children:e,fallbackTitle:o,label:r,retryLabel:n}=this.props,{error:s}=this.state;if(s===null)return(0,ke.jsx)(ke.Fragment,{children:e});let l=o??(r===void 0?"Something went wrong":`${r} failed`);return(0,ke.jsxs)("div",{"data-testid":"dash-error-boundary",role:"alert",style:Os,children:[(0,ke.jsx)("strong",{children:l}),(0,ke.jsx)("pre",{"data-testid":"dash-error-message",style:Ms,children:s.message}),(0,ke.jsx)("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:n??"Try again"})]})}};var Be={};lr(Be,{Arrow:()=>Xn,Backdrop:()=>ta,Close:()=>ia,Description:()=>aa,Handle:()=>lo,Popup:()=>Jn,Portal:()=>Un,Positioner:()=>Zn,Root:()=>Fn,Title:()=>ra,Trigger:()=>jn,Viewport:()=>da,createHandle:()=>pa});var Oe=R(D(),1);var Ko=R(D(),1);var vr=Ko.createContext(void 0);function Q(t){let e=Ko.useContext(vr);if(e===void 0&&!t)throw new Error(q(47));return e}i(Q,"usePopoverRootContext");var Ve=R(D(),1),Hn=R(Hr(),1);function Ds(){return{...$t(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}i(Ds,"createInitialState");var Is={...Gt,disabled:U(t=>t.disabled),instantType:U(t=>t.instantType),openMethod:U(t=>t.openMethod),openChangeReason:U(t=>t.openChangeReason),modal:U(t=>t.modal),focusManagerModal:U(t=>t.focusManagerModal),stickIfOpen:U(t=>t.stickIfOpen),titleElementId:U(t=>t.titleElementId),descriptionElementId:U(t=>t.descriptionElementId),openOnHover:U(t=>t.openOnHover),closeDelay:U(t=>t.closeDelay),hasViewport:U(t=>t.hasViewport)},Qt=class t extends Ft{static{i(this,"PopoverStore")}constructor(e,o,r=!1){let n={...Ds(),...e},s=new Wt;n.open&&e?.mounted===void 0&&(n.mounted=!0),n.floatingRootContext=qt(s,o,r),super(n,{popupRef:Ve.createRef(),backdropRef:Ve.createRef(),internalBackdropRef:Ve.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:Ve.createRef(),beforeContentFocusGuardRef:Ve.createRef(),stickIfOpenTimeout:new rn,triggerElements:s},Is)}setOpen=i((e,o)=>{let r=o.reason===H.triggerHover,n=o.reason===H.triggerPress&&o.event.detail===0,s=!e&&(o.reason===H.escapeKey||o.reason==null),l=xn(o),d=this.select("activeTriggerId");if(!e&&o.reason===H.closePress&&o.trigger==null&&d!=null&&(o.trigger=this.context.triggerElements.getById(d)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,o);let p=i(()=>{let c={open:e,openChangeReason:o.reason};No(c,e,o.trigger,l()),this.update(c)},"changeState");r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set("stickIfOpen",!1)}),Hn.flushSync(p)):p(),n||s?this.set("instantType",n?"click":"dismiss"):o.reason===H.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)},"setOpen");static useStore(e,o){let{store:r,internalStore:n}=jt(e,(s,l)=>new t(o,s,l));return Ve.useEffect(()=>n?.disposeEffect(),[n]),r}disposeEffect=i(()=>this.context.stickIfOpenTimeout.disposeEffect(),"disposeEffect")};var Ke=R(se(),1);function Bn({props:t}){let{children:e,open:o,defaultOpen:r=!1,onOpenChange:n,onOpenChangeComplete:s,modal:l=!1,handle:d,triggerId:p,defaultTriggerId:c=null}=t,u=Qt.useStore(d?.store,{modal:l,open:r,openProp:o,activeTriggerId:c,triggerIdProp:p});To(u,o,r,c),u.useControlledProp("openProp",o),u.useControlledProp("triggerIdProp",p);let h=u.useState("open"),v=u.useState("mounted"),f=u.useState("payload"),m=pn()!=null;u.useContextCallback("onOpenChange",n),u.useContextCallback("onOpenChangeComplete",s),wo(u,h),zt(u);let{forceUnmount:g}=Ut(h,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:l,nested:m}),Oe.useEffect(()=>{h||u.context.stickIfOpenTimeout.clear()},[u,h]);let b=Oe.useCallback(()=>{u.setOpen(!1,G(H.imperativeAction))},[u]);Oe.useImperativeHandle(t.actionsRef,()=>({unmount:g,close:b}),[g,b]);let x=h||v,C=Oe.useMemo(()=>({store:u}),[u]);return(0,Ke.jsxs)(vr.Provider,{value:C,children:[x&&(0,Ke.jsx)(_s,{store:u,modal:l}),typeof e=="function"?e({payload:f}):e]})}i(Bn,"PopoverRootComponent");function Fn(t){return Q(!0)?(0,Ke.jsx)(Bn,{props:t}):(0,Ke.jsx)(fn,{children:(0,Ke.jsx)(Bn,{props:t})})}i(Fn,"PopoverRoot");function _s({store:t,modal:e}){let o=t.useState("floatingRootContext"),r=Bt(o,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),n=r.reference??je,s=r.trigger??je,l=Oe.useMemo(()=>Ee(_e,r.floating),[r.floating]);return Zt(t,{activeTriggerProps:n,inactiveTriggerProps:s,popupProps:l}),null}i(_s,"PopoverInteractions");var Le=R(D(),1);var ze=R(se(),1);var jn=Le.forwardRef(i(function(e,o){let{render:r,className:n,style:s,disabled:l=!1,nativeButton:d=!0,handle:p,payload:c,openOnHover:u=!1,delay:h=300,closeDelay:v=0,id:f,...m}=e,g=Q(!0),b=p?.store??g?.store;if(!b)throw new Error(q(74));let x=fe(f),C=b.useState("isTriggerActive",x),y=b.useState("floatingRootContext"),S=b.useState("isOpenedByTrigger",x),P=b.useState("triggerPopupId",x),w=Le.useRef(null),{registerTrigger:N,isMountedByThisTrigger:E}=Kt(x,w,b,{payload:c,disabled:l,openOnHover:u,closeDelay:v}),T=b.useState("openChangeReason"),k=b.useState("stickIfOpen"),O=b.useState("openMethod"),F=b.useState("focusManagerModal"),I=ko(y,{enabled:!l&&y!=null&&u&&(O!=="touch"||T!==H.triggerPress),mouseOnly:!0,move:!1,handleClose:Oo(),restMs:h,delay:{close:v},triggerElementRef:w,isActiveTrigger:C,isClosing:i(()=>b.select("transitionStatus")==="ending","isClosing")}),K=Ro(y,{enabled:y!=null,stickIfOpen:k}),B=Mo(()=>b.select("open"),J=>{b.set("openMethod",J)}),z=b.useState("triggerProps",E),{getButtonProps:Z,buttonRef:A}=Ae({disabled:l,native:d}),V={open(J){return J&&T===H.triggerPress?Sn.open(J):Yt.open(J)}},{preFocusGuardRef:L,handlePreFocusGuardFocus:oe,handleFocusTargetFocus:te}=Nn(b,w),Y=j("button",e,{state:{disabled:l,open:S},ref:[A,o,N,w],props:[K.reference,I,z,B,{[xo]:"",id:x,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":P},m,Z],stateAttributesMapping:V});return E&&!F?(0,ze.jsxs)(Le.Fragment,{children:[(0,ze.jsx)(fr,{ref:L,onFocus:oe}),(0,ze.jsx)(Le.Fragment,{children:Y},x),(0,ze.jsx)(fr,{ref:b.context.triggerFocusTargetRef,onFocus:te})]}):(0,ze.jsx)(Le.Fragment,{children:Y},x)},"PopoverTrigger"));var zn=R(D(),1);var zo=R(D(),1);var br=zo.createContext(void 0);function Kn(){let t=zo.useContext(br);if(t===void 0)throw new Error(q(45));return t}i(Kn,"usePopoverPortalContext");var xr=R(se(),1);var Un=zn.forwardRef(i(function(e,o){let{keepMounted:r=!1,...n}=e,{store:s}=Q();return s.useState("mounted")||r?(0,xr.jsx)(br.Provider,{value:r,children:(0,xr.jsx)(Co,{ref:o,...n})}):null},"PopoverPortal"));var eo=R(D(),1);var Uo=R(D(),1);var yr=Uo.createContext(void 0);function Xt(){let t=Uo.useContext(yr);if(!t)throw new Error(q(46));return t}i(Xt,"usePopoverPositionerContext");var io=R(se(),1);var Zn=eo.forwardRef(i(function(e,o){let{render:r,className:n,style:s,anchor:l,positionMethod:d="absolute",side:p="bottom",align:c="center",sideOffset:u=0,alignOffset:h=0,collisionBoundary:v="clipping-ancestors",collisionPadding:f=5,arrowPadding:m=5,sticky:g=!1,disableAnchorTracking:b=!1,collisionAvoidance:x=yo,...C}=e,{store:y}=Q(),S=Kn(),P=un(),w=y.useState("floatingRootContext"),N=y.useState("mounted"),E=y.useState("open"),T=y.useState("openChangeReason"),k=y.useState("activeTriggerElement"),O=y.useState("modal"),F=y.useState("openMethod"),I=y.useState("positionerElement"),K=y.useState("instantType"),B=y.useState("transitionStatus"),z=y.useState("hasViewport"),Z=eo.useRef(null),A=an(I,!1,!1),V=_o({anchor:l,floatingRootContext:w,positionMethod:d,mounted:N,side:p,sideOffset:u,align:c,alignOffset:h,arrowPadding:m,collisionBoundary:v,collisionPadding:f,sticky:g,disableAnchorTracking:b,keepMounted:S,nodeId:P,collisionAvoidance:x,adaptiveOrigin:z?Io:void 0}),L=w.useState("domReferenceElement");Ie(()=>{let Y=L,J=Z.current;if(Y&&(Z.current=Y),J&&Y&&Y!==J){y.set("instantType",void 0);let ne=new AbortController;return A(()=>{y.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[L,A,y]),wn(E&&O===!0&&T!==H.triggerHover,F==="touch",I,k);let oe=eo.useCallback(Y=>{y.set("positionerElement",Y)},[y]),te={open:E,side:V.side,align:V.align,anchorHidden:V.anchorHidden,instant:K},le=Lo(e,te,{styles:V.positionerStyles,transitionStatus:B,props:C,refs:[o,oe],hidden:!N,inert:!E});return(0,io.jsxs)(yr.Provider,{value:V,children:[N&&O===!0&&T!==H.triggerHover&&(0,io.jsx)(Ao,{ref:y.context.internalBackdropRef,inert:Do(!E),cutout:k}),(0,io.jsx)(mn,{id:P,children:le})]})},"PopoverPositioner"));var Zo=R(D(),1);var He=R(D(),1);var Wn=R(se(),1);var $n=He.createContext(void 0);function qn(){let[t,e]=He.useState(0),o=Xr(()=>(e(n=>n+1),()=>{e(n=>Math.max(0,n-1))}));return{context:He.useMemo(()=>({register:o}),[o]),hasClosePart:t>0}}i(qn,"useClosePartCount");function Gn(t){let{value:e,children:o}=t;return(0,Wn.jsx)($n.Provider,{value:e,children:o})}i(Gn,"ClosePartProvider");function Yn(){let t=He.useContext($n);Ie(()=>t?.register(),[t])}i(Yn,"useClosePartRegistration");var Cr=R(se(),1);var As={...de,...ve},Jn=Zo.forwardRef(i(function(e,o){let{render:r,className:n,style:s,initialFocus:l,finalFocus:d,...p}=e,{store:c}=Q(),u=Xt(),h=En(!0)!=null,{context:v,hasClosePart:f}=qn(),m=c.useState("open"),g=c.useState("openMethod"),b=c.useState("instantType"),x=c.useState("transitionStatus"),C=c.useState("popupProps"),y=c.useState("titleElementId"),S=c.useState("descriptionElementId"),P=c.useState("modal"),w=c.useState("mounted"),N=c.useState("openChangeReason"),E=c.useState("activeTriggerElement"),T=c.useState("floatingRootContext"),k=T.useState("floatingId"),O=c.useState("disabled"),F=c.useState("openOnHover"),I=c.useState("closeDelay"),K=p.id??k;Ht({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),Eo(T,{enabled:F&&!O,closeDelay:I});let B=l===void 0?So(c.context.popupRef):l,z=P!==!1&&f;c.useSyncedValue("focusManagerModal",z);let Z=Zo.useCallback(L=>{c.set("popupElement",L)},[c]),A={open:m,side:u.side,align:u.align,instant:b,transitionStatus:x},V=j("div",e,{state:A,ref:[o,c.context.popupRef,Z],props:[C,{id:K,role:"dialog",..._e,"aria-labelledby":y,"aria-describedby":S,onKeyDown(L){h&&Ho.has(L.key)&&L.stopPropagation()}},Vo(x),p],stateAttributesMapping:As});return(0,Cr.jsx)(Po,{context:T,openInteractionType:g,modal:z,disabled:!w||N===H.triggerHover,initialFocus:B,returnFocus:d,restoreFocus:"popup",previousFocusableElement:en(E)?E:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Cr.jsx)(Gn,{value:v,children:V})})},"PopoverPopup"));var Qn=R(D(),1);var Xn=Qn.forwardRef(i(function(e,o){let{render:r,className:n,style:s,...l}=e,{store:d}=Q(),p=d.useState("open"),{arrowRef:c,side:u,align:h,arrowUncentered:v,arrowStyles:f}=Xt();return j("div",e,{state:{open:p,side:u,align:h,uncentered:v},ref:[o,c],props:[{style:f,"aria-hidden":!0},l],stateAttributesMapping:de})},"PopoverArrow"));var ea=R(D(),1);var Vs={...de,...ve},ta=ea.forwardRef(i(function(e,o){let{render:r,className:n,style:s,...l}=e,{store:d}=Q(),p=d.useState("open"),c=d.useState("mounted"),u=d.useState("transitionStatus"),h=d.useState("openChangeReason");return j("div",e,{state:{open:p,transitionStatus:u},ref:[d.context.backdropRef,o],props:[{role:"presentation",hidden:!c,style:{pointerEvents:h===H.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},l],stateAttributesMapping:Vs})},"PopoverBackdrop"));var oa=R(D(),1);var ra=oa.forwardRef(i(function(e,o){let{render:r,className:n,style:s,...l}=e,{store:d}=Q(),p=fe(l.id);return d.useSyncedValueWithCleanup("titleElementId",p),j("h2",e,{ref:o,props:[{id:p},l]})},"PopoverTitle"));var na=R(D(),1);var aa=na.forwardRef(i(function(e,o){let{render:r,className:n,style:s,...l}=e,{store:d}=Q(),p=fe(l.id);return d.useSyncedValueWithCleanup("descriptionElementId",p),j("p",e,{ref:o,props:[{id:p},l]})},"PopoverDescription"));var sa=R(D(),1);var ia=sa.forwardRef(i(function(e,o){let{render:r,className:n,style:s,disabled:l=!1,nativeButton:d=!0,...p}=e,{buttonRef:c,getButtonProps:u}=Ae({disabled:l,focusableWhenDisabled:!1,native:d}),{store:h}=Q();return Yn(),j("button",e,{ref:[o,c],props:[{onClick(f){h.setOpen(!1,G(H.closePress,f.nativeEvent))}},p,u]})},"PopoverClose"));var ca=R(D(),1);var la=(function(t){return t.popupWidth="--popup-width",t.popupHeight="--popup-height",t})({});var Ls={activationDirection:i(t=>t?{"data-activation-direction":t}:null,"activationDirection")},da=ca.forwardRef(i(function(e,o){let{render:r,className:n,style:s,children:l,...d}=e,{store:p}=Q(),{side:c}=Xt(),u=p.useState("instantType"),{children:h,state:v}=Bo({store:p,side:c,cssVars:la,children:l}),f={activationDirection:v.activationDirection,transitioning:v.transitioning,instant:u};return j("div",e,{state:f,ref:o,props:[d,{children:h}],stateAttributesMapping:Ls})},"PopoverViewport"));var lo=class{static{i(this,"PopoverHandle")}constructor(){this.store=new Qt}open(e){let o=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!o)throw new Error(q(80,e));this.store.setOpen(!0,G(H.imperativeAction,void 0,o))}close(){this.store.setOpen(!1,G(H.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function pa(){return new lo}i(pa,"createPopoverHandle");var pe={};lr(pe,{Backdrop:()=>ma,Close:()=>ga,Description:()=>va,Handle:()=>mo,Popup:()=>Pa,Portal:()=>Sa,Root:()=>Oa,Title:()=>_a,Trigger:()=>Aa,Viewport:()=>Da,createHandle:()=>Va});var ua=R(D(),1);var co=R(D(),1);var Wo=co.createContext(!1),Pr=co.createContext(void 0);function ie(t){let e=co.useContext(Pr);if(t===!1&&e===void 0)throw new Error(q(27));return e}i(ie,"useDialogRootContext");var Hs={...de,...ve},ma=ua.forwardRef(i(function(e,o){let{render:r,className:n,style:s,forceRender:l=!1,...d}=e,{store:p}=ie(),c=p.useState("open"),u=p.useState("nested"),h=p.useState("mounted"),v=p.useState("transitionStatus");return j("div",e,{state:{open:c,transitionStatus:v},ref:[p.context.backdropRef,o],stateAttributesMapping:Hs,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:l||!u})},"DialogBackdrop"));var fa=R(D(),1);var ga=fa.forwardRef(i(function(e,o){let{render:r,className:n,style:s,disabled:l=!1,nativeButton:d=!0,...p}=e,{store:c}=ie(),u=c.useState("open"),{getButtonProps:h,buttonRef:v}=Ae({disabled:l,native:d}),f={disabled:l};function m(g){u&&c.setOpen(!1,G(H.closePress,g.nativeEvent))}return i(m,"handleClick"),j("button",e,{state:f,ref:[o,v],props:[{onClick:m},p,h]})},"DialogClose"));var ha=R(D(),1);var va=ha.forwardRef(i(function(e,o){let{render:r,className:n,style:s,id:l,...d}=e,{store:p}=ie(),c=fe(l);return p.useSyncedValueWithCleanup("descriptionElementId",c),j("p",e,{ref:o,props:[{id:c},d]})},"DialogDescription"));var ya=R(D(),1);var ba=(function(t){return t.nestedDialogs="--nested-dialogs",t})({});var xa=(function(t){return t[t.open=Pe.open]="open",t[t.closed=Pe.closed]="closed",t[t.startingStyle=Pe.startingStyle]="startingStyle",t[t.endingStyle=Pe.endingStyle]="endingStyle",t.nested="data-nested",t.nestedDialogOpen="data-nested-dialog-open",t})({});var $o=R(D(),1);var Rr=$o.createContext(void 0);function qo(){let t=$o.useContext(Rr);if(t===void 0)throw new Error(q(26));return t}i(qo,"useDialogPortalContext");var Ca=R(se(),1);var Bs={...de,...ve,nestedDialogOpen(t){return t?{[xa.nestedDialogOpen]:""}:null}},Pa=ya.forwardRef(i(function(e,o){let{render:r,className:n,style:s,finalFocus:l,initialFocus:d,...p}=e,{store:c}=ie(),u=c.useState("descriptionElementId"),h=c.useState("disablePointerDismissal"),v=c.useState("floatingRootContext"),f=c.useState("popupProps"),m=c.useState("modal"),g=c.useState("mounted"),b=c.useState("nested"),x=c.useState("nestedOpenDialogCount"),C=c.useState("open"),y=c.useState("openMethod"),S=c.useState("titleElementId"),P=c.useState("transitionStatus"),w=c.useState("role"),N=v.useState("floatingId"),E=p.id??N;qo(),Ht({open:C,ref:c.context.popupRef,onComplete(){C&&c.context.onOpenChangeComplete?.(!0)}});let T=d===void 0?So(c.context.popupRef):d,k=x>0,O=c.useStateSetter("popupElement"),I=j("div",e,{state:{open:C,nested:b,transitionStatus:P,nestedDialogOpen:k},props:[f,{id:E,"aria-labelledby":S??void 0,"aria-describedby":u??void 0,role:w,..._e,hidden:!g,onKeyDown(K){Ho.has(K.key)&&K.stopPropagation()},style:{[ba.nestedDialogs]:x}},p],ref:[o,c.context.popupRef,O],stateAttributesMapping:Bs});return(0,Ca.jsx)(Po,{context:v,openInteractionType:y,disabled:!g,closeOnFocusOut:!h,initialFocus:T,returnFocus:l,modal:m!==!1,restoreFocus:"popup",children:I})},"DialogPopup"));var Ra=R(D(),1);var po=R(se(),1);var Sa=Ra.forwardRef(i(function(e,o){let{keepMounted:r=!1,...n}=e,{store:s}=ie(),l=s.useState("mounted"),d=s.useState("modal"),p=s.useState("open");return l||r?(0,po.jsx)(Rr.Provider,{value:r,children:(0,po.jsxs)(Co,{ref:o,...n,children:[l&&d===!0&&(0,po.jsx)(Ao,{ref:s.context.internalBackdropRef,inert:Do(!p)}),e.children]})}):null},"DialogPortal"));var ka=R(D(),1);var wa=R(D(),1);var Me=R(D(),1);function Na(t){let{store:e,actionsRef:o}=t,r=e.useState("open");wo(e,r),zt(e);let{forceUnmount:n}=Ut(r,e),s=Me.useCallback(()=>{e.setOpen(!1,G(H.imperativeAction))},[e]);Me.useImperativeHandle(o,()=>({unmount:n,close:s}),[n,s])}i(Na,"useDialogRoot");function Ta({store:t,parentContext:e,isDrawer:o}){let r=t.useState("open"),n=t.useState("disablePointerDismissal"),s=t.useState("modal"),l=t.useState("popupElement"),d=t.useState("floatingRootContext"),[p,c]=Me.useState(0),[u,h]=Me.useState(0),v=p===0,f=Bt(d,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(x){if(!t.context.outsidePressEnabledRef.current||"button"in x&&x.button!==0||"touches"in x&&x.touches.length!==1)return!1;let C=tn(x);return v&&!n?s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===C||t.context.backdropRef.current===C||ao(C,l)&&!C?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:v});Tn(r&&s===!0,l),t.useContextCallback("onNestedDialogOpen",(x,C)=>{c(x),h(C)}),t.useContextCallback("onNestedDialogClose",()=>{c(0),h(0)}),Me.useEffect(()=>(e?.onNestedDialogOpen&&r&&e.onNestedDialogOpen(p+1,u+(o?1:0)),e?.onNestedDialogClose&&!r&&e.onNestedDialogClose(),()=>{e?.onNestedDialogClose&&r&&e.onNestedDialogClose()}),[o,r,p,u,e]);let m=f.reference??je,g=f.trigger??je,b=f.floating??je;return Zt(t,{activeTriggerProps:m,inactiveTriggerProps:g,popupProps:b,nestedOpenDialogCount:p,nestedOpenDrawerCount:u}),null}i(Ta,"DialogInteractions");var Go=R(D(),1);var Fs={...Gt,modal:U(t=>t.modal),nested:U(t=>t.nested),nestedOpenDialogCount:U(t=>t.nestedOpenDialogCount),nestedOpenDrawerCount:U(t=>t.nestedOpenDrawerCount),disablePointerDismissal:U(t=>t.disablePointerDismissal),openMethod:U(t=>t.openMethod),descriptionElementId:U(t=>t.descriptionElementId),titleElementId:U(t=>t.titleElementId),viewportElement:U(t=>t.viewportElement),role:U(t=>t.role)},to=class t extends Ft{static{i(this,"DialogStore")}constructor(e,o,r=!1){let n=new Wt,s=js(e);s.floatingRootContext=qt(n,o,r),super(s,{popupRef:Go.createRef(),backdropRef:Go.createRef(),internalBackdropRef:Go.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:n,onOpenChange:void 0,onOpenChangeComplete:void 0},Fs)}setOpen=i((e,o)=>{if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,o);let r={open:e};No(r,e,o.trigger),this.update(r)},"setOpen");static useStore(e,o){return jt(e,(n,s)=>new t(o,n,s),!0).store}};function js(t={}){return{...$t(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}i(js,"createInitialState");var uo=R(se(),1);function Ea(t,e="dialog"){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:s,onOpenChangeComplete:l,disablePointerDismissal:d=!1,modal:p=!0,actionsRef:c,handle:u,triggerId:h,defaultTriggerId:v=null}=t,f=e==="drawer",m=e==="alert-dialog",g=m?!0:p,b=m||d,x=m?"alertdialog":"dialog",C=ie(!0),S={modal:g,disablePointerDismissal:b,nested:!!C,role:x},P=to.useStore(u?.store,{open:n,openProp:r,activeTriggerId:v,triggerIdProp:h,...S});hn(()=>{let O=r===void 0&&P.state.open===!1&&n===!0?{open:!0,activeTriggerId:v}:null;m?P.update(O?{...S,...O}:S):O&&P.update(O)}),P.useControlledProp("openProp",r),P.useControlledProp("triggerIdProp",h),P.useSyncedValues(S),P.useContextCallback("onOpenChange",s),P.useContextCallback("onOpenChangeComplete",l);let w=P.useState("open"),N=P.useState("mounted"),E=P.useState("payload");Na({store:P,actionsRef:c});let T=w||N,k=wa.useMemo(()=>({store:P}),[P]);return(0,uo.jsx)(Wo.Provider,{value:!1,children:(0,uo.jsxs)(Pr.Provider,{value:k,children:[T&&(0,uo.jsx)(Ta,{store:P,parentContext:C?.store.context,isDrawer:f}),typeof o=="function"?o({payload:E}):o]})})}i(Ea,"useRenderDialogRoot");function Oa(t){let e=ka.useContext(Wo)?"drawer":"dialog";return Ea(t,e)}i(Oa,"DialogRoot");var Ma=R(D(),1);var Sr=(function(t){return t[t.open=Pe.open]="open",t[t.closed=Pe.closed]="closed",t[t.startingStyle=Pe.startingStyle]="startingStyle",t[t.endingStyle=Pe.endingStyle]="endingStyle",t.nested="data-nested",t.nestedDialogOpen="data-nested-dialog-open",t})({});var Ks={...de,...ve,nested(t){return t?{[Sr.nested]:""}:null},nestedDialogOpen(t){return t?{[Sr.nestedDialogOpen]:""}:null}},Da=Ma.forwardRef(i(function(e,o){let{render:r,className:n,style:s,children:l,...d}=e,p=qo(),{store:c}=ie(),u=c.useState("open"),h=c.useState("nested"),v=c.useState("transitionStatus"),f=c.useState("nestedOpenDialogCount"),m=c.useState("mounted"),g=c.useStateSetter("viewportElement"),b=f>0;return j("div",e,{enabled:p||m,state:{open:u,nested:h,transitionStatus:v,nestedDialogOpen:b},ref:[o,g],stateAttributesMapping:Ks,props:[{role:"presentation",hidden:!m,style:{pointerEvents:u?void 0:"none"},children:l},d]})},"DialogViewport"));var Ia=R(D(),1);var _a=Ia.forwardRef(i(function(e,o){let{render:r,className:n,style:s,id:l,...d}=e,{store:p}=ie(),c=fe(l);return p.useSyncedValueWithCleanup("titleElementId",c),j("h2",e,{ref:o,props:[{id:c},d]})},"DialogTitle"));var Yo=R(D(),1);var Aa=Yo.forwardRef(i(function(e,o){let{render:r,className:n,style:s,disabled:l=!1,nativeButton:d=!0,id:p,payload:c,handle:u,...h}=e,v=ie(!0),f=u?.store??v?.store;if(!f)throw new Error(q(79));let m=fe(p),g=f.useState("floatingRootContext"),b=f.useState("isOpenedByTrigger",m),x=f.useState("triggerPopupId",m),C=Yo.useRef(null),{registerTrigger:y,isMountedByThisTrigger:S}=Kt(m,C,f,{payload:c}),{getButtonProps:P,buttonRef:w}=Ae({disabled:l,native:d}),N=Ro(g,{enabled:g!=null}),E=Mo(()=>f.select("open"),O=>{f.set("openMethod",O)}),T={disabled:l,open:b},k=f.useState("triggerProps",S);return j("button",e,{state:T,ref:[w,o,y,C],props:[N.reference,k,E,{[xo]:"",id:m,"aria-haspopup":"dialog","aria-expanded":b,"aria-controls":x},h,P],stateAttributesMapping:Yt})},"DialogTrigger"));var mo=class{static{i(this,"DialogHandle")}constructor(e){this.store=e??new to}open(e){let o=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,G(H.imperativeAction,void 0,o))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,G(H.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,G(H.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function Va(){return new mo}i(Va,"createDialogHandle");var Se={};lr(Se,{Arrow:()=>ts,Handle:()=>fo,Popup:()=>Xa,Portal:()=>Ga,Positioner:()=>Ja,Provider:()=>os,Root:()=>Ha,Trigger:()=>za,Viewport:()=>as,createHandle:()=>ss});var Re=R(D(),1);var Jo=R(D(),1);var Nr=Jo.createContext(void 0);function be(t){let e=Jo.useContext(Nr);if(e===void 0&&!t)throw new Error(q(72));return e}i(be,"useTooltipRootContext");var La=R(D(),1);var zs={...Gt,disabled:U(t=>t.disabled),instantType:U(t=>t.instantType),isInstantPhase:U(t=>t.isInstantPhase),trackCursorAxis:U(t=>t.trackCursorAxis),disableHoverablePopup:U(t=>t.disableHoverablePopup),lastOpenChangeReason:U(t=>t.openChangeReason),closeOnClick:U(t=>t.closeOnClick),closeDelay:U(t=>t.closeDelay),hasViewport:U(t=>t.hasViewport)},oo=class t extends Ft{static{i(this,"TooltipStore")}constructor(e,o,r=!1){let n=new Wt,s={...Us(),...e};s.floatingRootContext=qt(n,o,r),super(s,{popupRef:La.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:n},zs)}setOpen=i((e,o)=>{yn(this,e,o,{extraState:{openChangeReason:o.reason}})},"setOpen");cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,G(H.triggerPress,e))}static useStore(e,o){return jt(e,(n,s)=>new t(o,n,s)).store}};function Us(){return{...$t(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}i(Us,"createInitialState");var Qo=R(se(),1);var Ha=vn(i(function(e){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:s=!1,trackCursorAxis:l="none",actionsRef:d,onOpenChange:p,onOpenChangeComplete:c,handle:u,triggerId:h,defaultTriggerId:v=null,children:f}=e,m=oo.useStore(u?.store,{open:r,openProp:n,activeTriggerId:v,triggerIdProp:h});To(m,n,r,v),m.useControlledProp("openProp",n),m.useControlledProp("triggerIdProp",h),m.useContextCallback("onOpenChange",p),m.useContextCallback("onOpenChangeComplete",c);let g=m.useState("open"),b=!o&&g,x=m.useState("activeTriggerId"),C=m.useState("mounted"),y=m.useState("payload");m.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:s}),m.useSyncedValue("disabled",o),zt(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:S,transitionStatus:P}=Ut(b,m),w=m.useState("isInstantPhase"),N=m.useState("instantType"),E=m.useState("lastOpenChangeReason"),T=Re.useRef(null);Ie(()=>{g&&o&&m.setOpen(!1,G(H.disabled))},[g,o,m]),Ie(()=>{P==="ending"&&E===H.none||P!=="ending"&&w?(N!=="delay"&&(T.current=N),m.set("instantType","delay")):T.current!==null&&(m.set("instantType",T.current),T.current=null)},[P,w,E,N,m]),Ie(()=>{b&&x==null&&m.set("payload",void 0)},[m,x,b]);let k=Re.useCallback(()=>{m.setOpen(!1,G(H.imperativeAction))},[m]);Re.useImperativeHandle(d,()=>({unmount:S,close:k}),[S,k]);let O=b||C||!o&&l!=="none";return(0,Qo.jsxs)(Nr.Provider,{value:m,children:[O&&(0,Qo.jsx)(Zs,{store:m,disabled:o,trackCursorAxis:l}),typeof f=="function"?f({payload:y}):f]})},"TooltipRoot"));function Zs({store:t,disabled:e,trackCursorAxis:o}){let r=t.useState("floatingRootContext"),n=Bt(r,{enabled:!e,referencePress:i(()=>t.select("closeOnClick"),"referencePress")}),s=gn(r,{enabled:!e&&o!=="none",axis:o==="none"?void 0:o}),l=Re.useMemo(()=>Ee(s.reference,n.reference),[s.reference,n.reference]),d=Re.useMemo(()=>Ee(s.trigger,n.trigger),[s.trigger,n.trigger]),p=Re.useMemo(()=>Ee(_e,s.floating,n.floating),[s.floating,n.floating]);return Zt(t,{activeTriggerProps:l,inactiveTriggerProps:d,popupProps:p}),null}i(Zs,"TooltipInteractions");var er=R(D(),1);var Xo=R(D(),1);var Tr=Xo.createContext(void 0);function Ba(){return Xo.useContext(Tr)}i(Ba,"useTooltipProviderContext");var Fa=(function(t){return t[t.popupOpen=Rn.popupOpen]="popupOpen",t.triggerDisabled="data-trigger-disabled",t})({});var Ka="data-base-ui-tooltip-trigger";function ja(t){if("composedPath"in t){let o=t.composedPath();for(let r=0;r<o.length;r+=1){let n=o[r];if(bo(n))return n}}let e=t.target;return bo(e)?e:null}i(ja,"getTargetElement");function Ws(t){let e=t;for(;e;){if(e.hasAttribute(Ka))return e;let o=e.parentElement;if(o){e=o;continue}let r=e.getRootNode();e="host"in r&&bo(r.host)?r.host:null}return null}i(Ws,"closestEnabledTooltipTrigger");var za=bn(i(function(e,o){let{render:r,className:n,style:s,handle:l,payload:d,disabled:p,delay:c,closeOnClick:u=!0,closeDelay:h,id:v,...f}=e,m=be(!0),g=l?.store??m;if(!g)throw new Error(q(82));let b=fe(v),x=g.useState("isTriggerActive",b),C=g.useState("isOpenedByTrigger",b),y=g.useState("floatingRootContext"),S=er.useRef(null),P=c??600,w=h??0,{registerTrigger:N,isMountedByThisTrigger:E}=Kt(b,S,g,{payload:d,closeOnClick:u,closeDelay:w}),T=Ba(),{delayRef:k,isInstantPhase:O,hasProvider:F}=ln(y,{open:C}),I=Pn(y);g.useSyncedValue("isInstantPhase",O);let K=g.useState("disabled"),B=p??K,z=cn(B),Z=g.useState("trackCursorAxis"),A=g.useState("disableHoverablePopup"),V=er.useRef(!1),L=nn(),oe=er.useRef(void 0);function te(){let $=T?.delay,ee=typeof k.current=="object"?k.current.open:void 0,ae=P;return F&&(ee!==0?ae=c??$??P:ae=0),ae}i(te,"getOpenDelay");function le($){let ee=S.current;if(!ee||!$)return!1;let ae=Ws($);return ae!==null&&ae!==ee&&ao(ee,ae)}i(le,"isEnabledNestedTriggerTarget");function Y($){let ee=le($);return V.current=ee,ee&&(I.openChangeTimeout.clear(),I.restTimeout.clear(),I.restTimeoutPending=!1,L.clear()),ee}i(Y,"detectNestedTriggerHover");let J=ko(y,{enabled:!B,mouseOnly:!0,move:!1,handleClose:!A&&Z!=="both"?Oo():null,restMs:te,delay(){let $=typeof k.current=="object"?k.current.close:void 0,ee=w;return h==null&&F&&(ee=$),{close:ee}},triggerElementRef:S,isActiveTrigger:x,isClosing:i(()=>g.select("transitionStatus")==="ending","isClosing"),shouldOpen(){return!V.current}}),ne=Cn(y,{enabled:!B}).reference,ue=i($=>{let ee=V.current,ae=ja($),Ne=Y(ae),xe=S.current,De=xe&&ae&&ao(xe,ae);if(Ne&&g.select("open")&&g.select("lastOpenChangeReason")===H.triggerHover){g.setOpen(!1,G(H.triggerHover,$));return}if(ee&&!Ne&&De&&!z.current&&!g.select("open")&&xe&&on(oe.current)){let Te=i(()=>{!V.current&&!z.current&&!g.select("open")&&g.setOpen(!0,G(H.triggerHover,$,xe))},"open"),we=te();we===0?(L.clear(),Te()):L.start(we,Te)}},"handleNestedTriggerHover"),me=g.useState("triggerProps",E);return j("button",e,{state:{open:C},ref:[o,N,S],props:[J,ne,E||Z!=="none"?me:void 0,{onMouseOver($){ue($.nativeEvent)},onFocus($){le(ja($.nativeEvent))&&$.preventBaseUIHandler()},onMouseLeave(){V.current=!1,L.clear(),oe.current=void 0},onPointerEnter($){oe.current=$.pointerType},onPointerDown($){oe.current=$.pointerType,g.set("closeOnClick",u),u&&!g.select("open")&&g.cancelPendingOpen($.nativeEvent)},onClick($){u&&!g.select("open")&&g.cancelPendingOpen($.nativeEvent)},id:b,[Fa.triggerDisabled]:B?"":void 0,[Ka]:B?void 0:""},f],stateAttributesMapping:Yt})},"TooltipTrigger"));var qa=R(D(),1);var tr=R(D(),1);var wr=tr.createContext(void 0);function Ua(){let t=tr.useContext(wr);if(t===void 0)throw new Error(q(70));return t}i(Ua,"useTooltipPortalContext");var or=R(D(),1),Za=R(Hr(),1);var Wa=R(se(),1);var $a=or.forwardRef(i(function(e,o){let{children:r,container:n,className:s,render:l,style:d,...p}=e,{portalNode:c,portalSubtree:u}=dn({container:n,ref:o,componentProps:e,elementProps:p});return!u&&!c?null:(0,Wa.jsxs)(or.Fragment,{children:[u,c&&Za.createPortal(r,c)]})},"FloatingPortalLite"));var Er=R(se(),1);var Ga=qa.forwardRef(i(function(e,o){let{keepMounted:r=!1,...n}=e;return be().useState("mounted")||r?(0,Er.jsx)(wr.Provider,{value:r,children:(0,Er.jsx)($a,{ref:o,...n})}):null},"TooltipPortal"));var nr=R(D(),1);var rr=R(D(),1);var kr=rr.createContext(void 0);function ro(){let t=rr.useContext(kr);if(t===void 0)throw new Error(q(71));return t}i(ro,"useTooltipPositionerContext");var Ya=R(se(),1);var Ja=nr.forwardRef(i(function(e,o){let{render:r,className:n,anchor:s,positionMethod:l="absolute",side:d="top",align:p="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:h="clipping-ancestors",collisionPadding:v=5,arrowPadding:f=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:b=yo,style:x,...C}=e,y=be(),S=Ua(),P=y.useState("open"),w=y.useState("mounted"),N=y.useState("trackCursorAxis"),E=y.useState("disableHoverablePopup"),T=y.useState("floatingRootContext"),k=y.useState("instantType"),O=y.useState("transitionStatus"),F=y.useState("hasViewport"),I=_o({anchor:s,positionMethod:l,floatingRootContext:T,mounted:w,side:d,sideOffset:c,align:p,alignOffset:u,collisionBoundary:h,collisionPadding:v,sticky:m,arrowPadding:f,disableAnchorTracking:g,keepMounted:S,collisionAvoidance:b,adaptiveOrigin:F?Io:void 0}),K=nr.useMemo(()=>({open:P,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:N!=="none"?"tracking-cursor":k}),[P,I.side,I.align,I.anchorHidden,N,k]),B=Lo(e,K,{styles:I.positionerStyles,transitionStatus:O,props:C,refs:[o,y.useStateSetter("positionerElement")],hidden:!w,inert:!P||N==="both"||E});return(0,Ya.jsx)(kr.Provider,{value:I,children:B})},"TooltipPositioner"));var Qa=R(D(),1);var $s={...de,...ve},Xa=Qa.forwardRef(i(function(e,o){let{render:r,className:n,style:s,...l}=e,d=be(),{side:p,align:c}=ro(),u=d.useState("open"),h=d.useState("instantType"),v=d.useState("transitionStatus"),f=d.useState("popupProps"),m=d.useState("floatingRootContext"),g=d.useState("disabled"),b=d.useState("closeDelay");Ht({open:u,ref:d.context.popupRef,onComplete(){u&&d.context.onOpenChangeComplete?.(!0)}}),Eo(m,{enabled:!g,closeDelay:b});let x=d.useStateSetter("popupElement");return j("div",e,{state:{open:u,side:p,align:c,instant:h,transitionStatus:v},ref:[o,d.context.popupRef,x],props:[f,Vo(v),l],stateAttributesMapping:$s})},"TooltipPopup"));var es=R(D(),1);var ts=es.forwardRef(i(function(e,o){let{render:r,className:n,style:s,...l}=e,d=be(),{arrowRef:p,side:c,align:u,arrowUncentered:h,arrowStyles:v}=ro(),f=d.useState("open"),m=d.useState("instantType");return j("div",e,{state:{open:f,side:c,align:u,uncentered:h,instant:m},ref:[o,p],props:[{style:v,"aria-hidden":!0},l],stateAttributesMapping:de})},"TooltipArrow"));var Or=R(D(),1);var Mr=R(se(),1);var os=i(function(e){let{delay:o,closeDelay:r,timeout:n=400}=e,s=Or.useMemo(()=>({delay:o,closeDelay:r}),[o,r]),l=Or.useMemo(()=>({open:o,close:r}),[o,r]);return(0,Mr.jsx)(Tr.Provider,{value:s,children:(0,Mr.jsx)(sn,{delay:l,timeoutMs:n,children:e.children})})},"TooltipProvider");var ns=R(D(),1);var rs=(function(t){return t.popupWidth="--popup-width",t.popupHeight="--popup-height",t})({});var qs={activationDirection:i(t=>t?{"data-activation-direction":t}:null,"activationDirection")},as=ns.forwardRef(i(function(e,o){let{render:r,className:n,style:s,children:l,...d}=e,p=be(),c=ro(),u=p.useState("instantType"),{children:h,state:v}=Bo({store:p,side:c.side,cssVars:rs,children:l}),f={activationDirection:v.activationDirection,transitioning:v.transitioning,instant:u};return j("div",e,{state:f,ref:o,props:[d,{children:h}],stateAttributesMapping:qs})},"TooltipViewport"));var fo=class{static{i(this,"TooltipHandle")}constructor(){this.store=new oo}open(e){let o=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!o)throw new Error(q(81,e));this.store.setOpen(!0,G(H.imperativeAction,void 0,o))}close(){this.store.setOpen(!1,G(H.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function ss(){return new fo}i(ss,"createTooltipHandle");var is=R(dr(),1);var ls=R(se(),1);var Gs=i((t,e,o)=>t!==void 0?t:e===void 0&&o===void 0?Yr:Gr(e,o),"p"),cs=i(t=>{let e=(0,is.c)(7),{catalogs:o,children:r,i18n:n,locale:s}=t,l;e[0]!==o||e[1]!==n||e[2]!==s?(l=Gs(n,s,o),e[0]=o,e[1]=n,e[2]=s,e[3]=l):l=e[3];let d=l,p;return e[4]!==r||e[5]!==d?(p=(0,ls.jsx)(Jr,{value:d,children:r}),e[4]=r,e[5]=d,e[6]=p):p=e[6],p},"S");var Ir=R(dr(),1);var Fe=R(D(),1);var re=R(se(),1);var Dr="lunora:command-palette",ds=i(()=>{"window"in globalThis&&globalThis.dispatchEvent(new Event(Dr))},"re"),Ys=i(t=>{let e=(0,Ir.c)(18),{active:o,index:r,item:n,onActivate:s,onSelect:l}=t,d;e[0]!==n||e[1]!==l?(d=i(()=>{l(n)},"s"),e[0]=n,e[1]=l,e[2]=d):d=e[2];let p=d,c;e[3]!==r||e[4]!==s?(c=i(()=>{s(r)},"c"),e[3]=r,e[4]=s,e[5]=c):c=e[5];let u=c,h=o?"bg-accent text-accent-foreground":"text-foreground",v;e[6]!==h?(v=W("flex w-full items-center justify-between gap-3 rounded-md px-3 py-2 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground",h),e[6]=h,e[7]=v):v=e[7];let f;e[8]!==n.label?(f=(0,re.jsx)("span",{children:n.label}),e[8]=n.label,e[9]=f):f=e[9];let m;e[10]!==n.group?(m=(0,re.jsx)("span",{className:"text-xs text-muted-foreground",children:n.group}),e[10]=n.group,e[11]=m):m=e[11];let g;return e[12]!==p||e[13]!==u||e[14]!==v||e[15]!==f||e[16]!==m?(g=(0,re.jsx)("li",{children:(0,re.jsxs)("button",{className:v,onClick:p,onMouseEnter:u,type:"button",children:[f,m]})}),e[12]=p,e[13]=u,e[14]=v,e[15]=f,e[16]=m,e[17]=g):g=e[17],g},"q"),Js=i((t,e)=>{let o=e.trim().toLowerCase();return o===""?t:t.filter(r=>r.label.toLowerCase().includes(o)||r.group.toLowerCase().includes(o))},"G"),ps=i(t=>{let e=(0,Ir.c)(39),{items:o}=t,r=ge(),n=no(),[s,l]=(0,Fe.useState)(!1),[d,p]=(0,Fe.useState)(""),[c,u]=(0,Fe.useState)(0),h=(0,Fe.useRef)(null),v,f;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=i(()=>{let A=i(L=>{(L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="k"&&(L.preventDefault(),l(!0))},"o"),V=i(()=>{l(!0)},"r");return globalThis.addEventListener("keydown",A),globalThis.addEventListener(Dr,V),()=>{globalThis.removeEventListener("keydown",A),globalThis.removeEventListener(Dr,V)}},"i"),f=[],e[0]=v,e[1]=f):(v=e[0],f=e[1]),(0,Fe.useEffect)(v,f);let m;e[2]!==o||e[3]!==d?(m=Js(o,d),e[2]=o,e[3]=d,e[4]=m):m=e[4];let g=m,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=i(A=>{l(A),A||(p(""),u(0))},"T"),e[5]=b):b=e[5];let x=b,C;e[6]!==n?(C=i(A=>{x(!1),Jt(n({to:A.to}))},"D"),e[6]=n,e[7]=C):C=e[7];let y=C,S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=i(A=>{p(A.target.value),u(0)},"A"),e[8]=S):S=e[8];let P=S,w;e[9]!==c||e[10]!==g||e[11]!==y?(w=i(A=>{e:switch(A.key){case"ArrowDown":{A.preventDefault(),u(V=>g.length===0?0:(V+1)%g.length);break e}case"ArrowUp":{A.preventDefault(),u(V=>g.length===0?0:(V-1+g.length)%g.length);break e}case"Enter":{A.preventDefault();let V=g[c];V!==void 0&&y(V);break e}}},"j"),e[9]=c,e[10]=g,e[11]=y,e[12]=w):w=e[12];let N=w,E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=(0,re.jsx)(pe.Backdrop,{className:"fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),e[13]=E):E=e[13];let T;e[14]!==r?(T=r("Command palette"),e[14]=r,e[15]=T):T=e[15];let k;e[16]!==T?(k=(0,re.jsx)(pe.Title,{className:"sr-only",children:T}),e[16]=T,e[17]=k):k=e[17];let O;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=(0,re.jsxs)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,re.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,re.jsx)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[18]=O):O=e[18];let F;e[19]!==r?(F=r("Search\u2026"),e[19]=r,e[20]=F):F=e[20];let I;e[21]!==N||e[22]!==d||e[23]!==F?(I=(0,re.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[O,(0,re.jsx)("input",{className:"h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-testid":"dash-command-input",onChange:P,onKeyDown:N,placeholder:F,ref:h,type:"text",value:d})]}),e[21]=N,e[22]=d,e[23]=F,e[24]=I):I=e[24];let K;e[25]!==c||e[26]!==g||e[27]!==y||e[28]!==r?(K=g.length===0?(0,re.jsx)("li",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:r("No results.")}):g.map((A,V)=>(0,re.jsx)(Ys,{active:V===c,index:V,item:A,onActivate:u,onSelect:y},A.to)),e[25]=c,e[26]=g,e[27]=y,e[28]=r,e[29]=K):K=e[29];let B;e[30]!==K?(B=(0,re.jsx)("ul",{className:"max-h-80 overflow-y-auto p-1.5","data-testid":"dash-command-list",children:K}),e[30]=K,e[31]=B):B=e[31];let z;e[32]!==k||e[33]!==I||e[34]!==B?(z=(0,re.jsxs)(pe.Portal,{children:[E,(0,re.jsxs)(pe.Popup,{className:"fixed start-1/2 top-24 z-50 w-[36rem] max-w-[90vw] -translate-x-1/2 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","data-testid":"dash-command-palette",initialFocus:h,children:[k,I,B]})]}),e[32]=k,e[33]=I,e[34]=B,e[35]=z):z=e[35];let Z;return e[36]!==s||e[37]!==z?(Z=(0,re.jsx)(pe.Root,{onOpenChange:x,open:s,children:z}),e[36]=s,e[37]=z,e[38]=Z):Z=e[38],Z},"le");var vs="(prefers-color-scheme: dark)",bs=i(()=>{try{return globalThis.localStorage}catch{return}},"Vt"),Qs=i(t=>t==="system"||t==="light"||t==="dark","ka"),xs=i(()=>globalThis.matchMedia,"Zt"),ys="lunora-studio-theme",_r=["system","light","dark"],Xs=i((t="system")=>{try{let e=bs()?.getItem(ys);return Qs(e)?e:t}catch{return t}},"Na"),us=i(t=>{let e=bs();if(e!==void 0)try{e.setItem(ys,t)}catch{}},"Mt"),ei=i(()=>{try{return xs()?.(vs).matches?"dark":"light"}catch{return"light"}},"Ma"),ti=i((t,e)=>t==="system"?e:t,"Sa"),oi=i(t=>{let e;try{e=xs()?.(vs)}catch{e=void 0}if(e===void 0)return()=>{};let o=i(r=>{t(r.matches?"dark":"light")},"a");return e.addEventListener("change",o),()=>{e.removeEventListener("change",o)}},"Ca"),Lr=(0,M.createContext)(null),ri=i(({children:t,defaultTheme:e="system"})=>{let[o,r]=(0,M.useState)(()=>Xs(e)),[n,s]=(0,M.useState)(()=>ei());(0,M.useEffect)(()=>oi(s),[]);let l=i(p=>{us(p),r(p)},"i"),d={cycleTheme:i(()=>{r(p=>{let c=_r[(_r.indexOf(p)+1)%_r.length]??p;return us(c),c})},"cycleTheme"),resolvedTheme:ti(o,n),setTheme:l,systemTheme:n,theme:o};return(0,a.jsx)(Lr,{value:d,children:t})},"_a"),ni=i(t=>{let e=(0,_.c)(3),{children:o}=t,r=(0,M.use)(Lr),n;return e[0]!==o||e[1]!==r?(n=r===null?(0,a.jsx)(ri,{children:o}):o,e[0]=o,e[1]=r,e[2]=n):n=e[2],n},"La"),ai=i(()=>{let t=(0,M.use)(Lr);if(t===null)throw new cr("INTERNAL","useTheme must be used within a <ThemeProvider>");return t},"$a");function Vg({delay:t=0,...e}){return(0,a.jsx)(Se.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}i(Vg,"dn");function si(t){let e=(0,_.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Se.Root,{"data-slot":"tooltip",...o}),e[2]=o,e[3]=r):r=e[3],r}i(si,"Pa");function ii(t){let e=(0,_.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Se.Trigger,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}i(ii,"Ta");function li({className:t,side:e="top",sideOffset:o=4,align:r="center",alignOffset:n=0,children:s,...l}){return(0,a.jsx)(Se.Portal,{children:(0,a.jsx)(Se.Positioner,{align:r,alignOffset:n,side:e,sideOffset:o,className:"isolate z-50",children:(0,a.jsxs)(Se.Popup,{"data-slot":"tooltip-content",className:W("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...l,children:[s,(0,a.jsx)(Se.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}i(li,"Aa");var ci=i(t=>{let e=(0,_.c)(5),{className:o}=t,r;e[0]!==o?(r=W("h-full w-full text-foreground",o),e[0]=o,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"}),e[2]=n):n=e[2];let s;return e[3]!==r?(s=(0,a.jsx)("svg",{"aria-hidden":"true",className:r,fill:"currentColor",viewBox:"0 0 543 446",children:n}),e[3]=r,e[4]=s):s=e[4],s},"za"),Cs="lunora.studio.rulesBannerDismissed",di=i(()=>{try{return globalThis.localStorage.getItem(Cs)==="1"}catch{return!1}},"Ea"),pi=i(()=>{try{globalThis.localStorage.setItem(Cs,"1")}catch{}},"Ra"),ui=i(()=>{let t=(0,_.c)(18),e=ge(),[o,r]=(0,M.useState)(mi),n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i(()=>{r(!0),pi()},"n"),t[0]=n):n=t[0];let s=n;if(o)return null;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"}),t[1]=l):l=t[1];let d;t[2]!==e?(d=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=d):d=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=p):p=t[4];let c;t[5]!==e?(c=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=c):c=t[6];let u;t[7]!==d||t[8]!==c?(u=(0,a.jsxs)("span",{children:[d," ",p," ",c]}),t[7]=d,t[8]=c,t[9]=u):u=t[9];let h;t[10]!==e?(h=e("Dismiss"),t[10]=e,t[11]=h):h=t[11];let v;t[12]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=v):v=t[12];let f;t[13]!==h?(f=(0,a.jsx)("button",{"aria-label":h,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:s,type:"button",children:v}),t[13]=h,t[14]=f):f=t[14];let m;return t[15]!==u||t[16]!==f?(m=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[l,u,f]}),t[15]=u,t[16]=f,t[17]=m):m=t[17],m},"Ha");function mi(){return di()}i(mi,"Ia");function Ps(t){let e=(0,_.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Be.Root,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Ps,"Bt");function Rs(t){let e=(0,_.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Be.Trigger,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Rs,"Dt");function Ss({align:t="end",alignOffset:e=0,className:o,keepMounted:r=!1,side:n="bottom",sideOffset:s=6,...l}){return(0,a.jsx)(Be.Portal,{keepMounted:r,children:(0,a.jsx)(Be.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:n,sideOffset:s,children:(0,a.jsx)(Be.Popup,{className:W("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",o),"data-slot":"popover-content",...l})})})}i(Ss,"Wt");var Ar=768;function fi(){let t=(0,_.c)(2),[e,o]=(0,M.useState)(void 0),r,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i(()=>{let s=globalThis.matchMedia(`(max-width: ${Ar-1}px)`),l=i(()=>{o(globalThis.innerWidth<Ar)},"i");return s.addEventListener("change",l),o(globalThis.innerWidth<Ar),()=>{s.removeEventListener("change",l)}},"r"),n=[],t[0]=r,t[1]=n):(r=t[0],n=t[1]),(0,M.useEffect)(r,n),!!e}i(fi,"Ka");function gi(t){let e=(0,_.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(pe.Root,{"data-slot":"sheet",...o}),e[2]=o,e[3]=r):r=e[3],r}i(gi,"Va");function hi(t){let e=(0,_.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(pe.Portal,{"data-slot":"sheet-portal",...o}),e[2]=o,e[3]=r):r=e[3],r}i(hi,"Za");function vi(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)(pe.Backdrop,{"data-slot":"sheet-overlay",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(vi,"Oa");function bi({className:t,children:e,side:o="right",showCloseButton:r=!0,...n}){return(0,a.jsxs)(hi,{children:[(0,a.jsx)(vi,{}),(0,a.jsxs)(pe.Popup,{"data-slot":"sheet-content","data-side":o,className:W("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...n,children:[e,r&&(0,a.jsxs)(pe.Close,{"data-slot":"sheet-close",render:(0,a.jsx)(hr,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[(0,a.jsx)(gr,{icon:kn,strokeWidth:2}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}i(bi,"qa");function xi(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("flex flex-col gap-0.5 p-4",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("div",{"data-slot":"sheet-header",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(xi,"Ba");function yi(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("text-sm font-medium text-foreground",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)(pe.Title,{"data-slot":"sheet-title",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(yi,"Da");function Ci(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("text-xs/relaxed text-muted-foreground",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)(pe.Description,{"data-slot":"sheet-description",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(Ci,"Wa");var Pi="sidebar_state",Ri=3600*24*7,Si="16rem",Ni="18rem",Ti="3rem",wi="b",Ns=ye.createContext(null);function ar(){let t=ye.useContext(Ns);if(!t)throw new cr("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}i(ar,"ht");function Ei({defaultOpen:t=!0,open:e,onOpenChange:o,className:r,style:n,children:s,...l}){let d=fi(),[p,c]=ye.useState(!1),[u,h]=ye.useState(t),v=e??u,f=i(x=>{let C=typeof x=="function"?x(v):x;o?o(C):h(C),document.cookie=`${Pi}=${C}; path=/; max-age=${Ri}`},"h"),m=i(()=>d?c(x=>!x):f(x=>!x),"f"),g=ye.useEffectEvent(()=>{m()});ye.useEffect(()=>{let x=i(C=>{C.key===wi&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())},"m");return globalThis.addEventListener("keydown",x),()=>globalThis.removeEventListener("keydown",x)},[]);let b={state:v?"expanded":"collapsed",open:v,setOpen:f,isMobile:d,openMobile:p,setOpenMobile:c,toggleSidebar:m};return(0,a.jsx)(Ns.Provider,{value:b,children:(0,a.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Si,"--sidebar-width-icon":Ti,...n},className:W("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...l,children:s})})}i(Ei,"Ya");function ki({side:t="left",variant:e="sidebar",collapsible:o="offcanvas",className:r,children:n,dir:s,...l}){let{isMobile:d,state:p,openMobile:c,setOpenMobile:u}=ar();return o==="none"?(0,a.jsx)("div",{"data-slot":"sidebar",className:W("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...l,children:n}):d?(0,a.jsx)(gi,{open:c,onOpenChange:u,...l,children:(0,a.jsxs)(bi,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ni},side:t,children:[(0,a.jsxs)(xi,{className:"sr-only",children:[(0,a.jsx)(yi,{children:"Sidebar"}),(0,a.jsx)(Ci,{children:"Displays the mobile sidebar."})]}),(0,a.jsx)("div",{className:"flex h-full w-full flex-col",children:n})]})}):(0,a.jsxs)("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":p==="collapsed"?o:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[(0,a.jsx)("div",{"data-slot":"sidebar-gap",className:W("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,a.jsx)("div",{"data-slot":"sidebar-container","data-side":t,className:W("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",r),...l,children:(0,a.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n})})]})}i(ki,"Ga");function Oi(t){let e=(0,_.c)(15),o,r,n;e[0]!==t?({className:o,onClick:r,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n):(o=e[1],r=e[2],n=e[3]);let{toggleSidebar:s}=ar(),l;e[4]!==o?(l=W(o),e[4]=o,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==s?(d=i(h=>{r?.(h),s()},"l"),e[6]=r,e[7]=s,e[8]=d):d=e[8];let p,c;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(gr,{icon:On,strokeWidth:2,className:"rtl:rotate-180"}),c=(0,a.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=p,e[10]=c):(p=e[9],c=e[10]);let u;return e[11]!==n||e[12]!==l||e[13]!==d?(u=(0,a.jsxs)(hr,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:l,onClick:d,...n,children:[p,c]}),e[11]=n,e[12]=l,e[13]=d,e[14]=u):u=e[14],u}i(Oi,"er");function Mi(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("main",{"data-slot":"sidebar-inset",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(Mi,"tr");function Di(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(Di,"ar");function Ii(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(Ii,"rr");function _i(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(_i,"sr");function Ai(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("relative flex w-full min-w-0 flex-col p-2",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(Ai,"nr");function Vi(t){let e=(0,_.c)(10),o,r,n,s;if(e[0]!==t){let{className:p,render:c,...u}=t;o=c,s=ur,r="div",n=Ee({className:W("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",p)},u),e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s}else o=e[1],r=e[2],n=e[3],s=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=l):l=e[5];let d;return e[6]!==o||e[7]!==r||e[8]!==n?(d={defaultTagName:r,props:n,render:o,state:l},e[6]=o,e[7]=r,e[8]=n,e[9]=d):d=e[9],s(d)}i(Vi,"or");function Li(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("w-full text-xs",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(Li,"ir");function ms(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("flex w-full min-w-0 flex-col gap-0",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(ms,"St");function fs(t){let e=(0,_.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=W("group/menu-item relative",o),e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==r||e[6]!==n?(s=(0,a.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...r}),e[5]=r,e[6]=n,e[7]=s):s=e[7],s}i(fs,"Ct");var Hi=Qr("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ts({render:t,isActive:e=!1,variant:o="default",size:r="default",tooltip:n,className:s,...l}){let{isMobile:d,state:p}=ar(),c=ur({defaultTagName:"button",props:Ee({className:W(Hi({variant:o,size:r}),s)},l),render:n?(0,a.jsx)(ii,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:e}});return n?(typeof n=="string"&&(n={children:n}),(0,a.jsxs)(si,{children:[c,(0,a.jsx)(li,{side:"right",align:"center",hidden:p!=="collapsed"||d,...n})]})):c}i(Ts,"Ft");var Bi=i(t=>t.replace("__lunora_admin__:",""),"dr"),Fi=i(()=>(0,M.useSyncExternalStore)(so.subscribe,so.getSnapshot,so.getSnapshot),"cr"),ji=i(t=>t==="error"?"destructive":t==="pending"?"secondary":"default","ur"),Ki=i(t=>{let e=(0,_.c)(56),{entry:o,focused:r}=t,n=ge(),s;e[0]!==r?(s=i(F=>{F!==null&&r&&F.scrollIntoView({block:"nearest"})},"o"),e[0]=r,e[1]=s):s=e[1];let l=s,d;e[2]!==o.functionPath||e[3]!==o.shardKey||e[4]!==o.summary?(d=i(()=>{Mn(`${o.functionPath} ${o.summary}${o.shardKey===""?"":` (shard ${o.shardKey})`}`)},"l"),e[2]=o.functionPath,e[3]=o.shardKey,e[4]=o.summary,e[5]=d):d=e[5];let p=d,c=r&&"bg-accent ring-1 ring-inset ring-primary/40",u;e[6]!==c?(u=W("border-b border-border/60 last:border-b-0",c),e[6]=c,e[7]=u):u=e[7];let h;e[8]!==o.status?(h=ji(o.status),e[8]=o.status,e[9]=h):h=e[9];let v=o.status==="pending"?"\u2026":o.status,f;e[10]!==h||e[11]!==v?(f=(0,a.jsx)(Lt,{className:"mt-px shrink-0",variant:h,children:v}),e[10]=h,e[11]=v,e[12]=f):f=e[12];let m;e[13]!==o.functionPath?(m=Bi(o.functionPath),e[13]=o.functionPath,e[14]=m):m=e[14];let g;e[15]!==m?(g=(0,a.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:m}),e[15]=m,e[16]=g):g=e[16];let b;e[17]!==o.kind||e[18]!==n?(b=o.kind==="subscription"&&(0,a.jsx)(Lt,{className:"shrink-0",variant:"outline",children:n("live")}),e[17]=o.kind,e[18]=n,e[19]=b):b=e[19];let x;e[20]!==o.summary?(x=o.summary!==""&&(0,a.jsx)("span",{className:"min-w-0 truncate text-muted-foreground",children:o.summary}),e[20]=o.summary,e[21]=x):x=e[21];let C;e[22]!==o.shardKey?(C=o.shardKey!==""&&(0,a.jsx)("span",{className:"font-mono",children:o.shardKey}),e[22]=o.shardKey,e[23]=C):C=e[23];let y;e[24]!==o.resultCount||e[25]!==n?(y=o.resultCount!==void 0&&(0,a.jsx)("span",{children:n("{count} rows",{count:o.resultCount})}),e[24]=o.resultCount,e[25]=n,e[26]=y):y=e[26];let S;e[27]!==o.pushes||e[28]!==n?(S=o.pushes!==void 0&&o.pushes>0&&(0,a.jsx)("span",{children:n("{count} pushes",{count:o.pushes})}),e[27]=o.pushes,e[28]=n,e[29]=S):S=e[29];let P;e[30]!==o.durationMs?(P=o.durationMs!==void 0&&(0,a.jsxs)("span",{children:[o.durationMs,"ms"]}),e[30]=o.durationMs,e[31]=P):P=e[31];let w;e[32]!==n?(w=n("Copy"),e[32]=n,e[33]=w):w=e[33];let N;e[34]!==p||e[35]!==w?(N=(0,a.jsx)("button",{"aria-label":w,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:p,type:"button",children:"\u29C9"}),e[34]=p,e[35]=w,e[36]=N):N=e[36];let E;e[37]!==C||e[38]!==y||e[39]!==S||e[40]!==P||e[41]!==N?(E=(0,a.jsxs)("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[C,y,S,P,N]}),e[37]=C,e[38]=y,e[39]=S,e[40]=P,e[41]=N,e[42]=E):E=e[42];let T;e[43]!==b||e[44]!==x||e[45]!==E||e[46]!==f||e[47]!==g?(T=(0,a.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[f,g,b,x,E]}),e[43]=b,e[44]=x,e[45]=E,e[46]=f,e[47]=g,e[48]=T):T=e[48];let k;e[49]!==o.error?(k=o.error!==void 0&&(0,a.jsx)("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:o.error}),e[49]=o.error,e[50]=k):k=e[50];let O;return e[51]!==l||e[52]!==T||e[53]!==k||e[54]!==u?(O=(0,a.jsxs)("li",{className:u,"data-testid":"oc-row",ref:l,children:[T,k]}),e[51]=l,e[52]=T,e[53]=k,e[54]=u,e[55]=O):O=e[55],O},"hr"),zi=i(t=>{let e=(0,_.c)(62),{focusSeq:o,onClose:r,onShownChange:n,shown:s}=t,l=ge(),d=Fi(),[p,c]=(0,M.useState)(""),u;if(e[0]!==d||e[1]!==o||e[2]!==p||e[3]!==r||e[4]!==n||e[5]!==s||e[6]!==l){let h=p.trim().toLowerCase(),v=d.filter(L=>(s==="errors"?L.status==="error":!0)&&(h===""||`${L.functionPath} ${L.summary} ${L.shardKey}`.toLowerCase().includes(h))).toReversed(),f;e[8]!==d?(f=d.filter(Ui),e[8]=d,e[9]=f):f=e[9];let m=f.length,g;e[10]!==l?(g=l("Operation console"),e[10]=l,e[11]=g):g=e[11];let b;e[12]!==l?(b=l("Operation console"),e[12]=l,e[13]=b):b=e[13];let x;e[14]!==b?(x=(0,a.jsx)("span",{className:"text-xs font-medium",children:b}),e[14]=b,e[15]=x):x=e[15];let C;e[16]!==d.length||e[17]!==l?(C=l("{count} calls",{count:d.length}),e[16]=d.length,e[17]=l,e[18]=C):C=e[18];let y;e[19]!==C?(y=(0,a.jsx)(Lt,{variant:"secondary",children:C}),e[19]=C,e[20]=y):y=e[20];let S;e[21]!==m||e[22]!==l?(S=m>0&&(0,a.jsx)(Lt,{variant:"destructive",children:l("{count} failed",{count:m})}),e[21]=m,e[22]=l,e[23]=S):S=e[23];let P=s==="errors",w=s==="errors"&&"bg-accent",N;e[24]!==w?(N=W("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",w),e[24]=w,e[25]=N):N=e[25];let E;e[26]!==n||e[27]!==s?(E=i(()=>{n(s==="errors"?"all":"errors")},"L"),e[26]=n,e[27]=s,e[28]=E):E=e[28];let T;e[29]!==l?(T=l("Errors"),e[29]=l,e[30]=T):T=e[30];let k;e[31]!==N||e[32]!==E||e[33]!==T||e[34]!==P?(k=(0,a.jsx)("button",{"aria-pressed":P,className:N,"data-testid":"oc-filter-errors",onClick:E,type:"button",children:T}),e[31]=N,e[32]=E,e[33]=T,e[34]=P,e[35]=k):k=e[35];let O;e[36]!==l?(O=l("Filter"),e[36]=l,e[37]=O):O=e[37];let F;e[38]===Symbol.for("react.memo_cache_sentinel")?(F=i(L=>{c(L.target.value)},"R"),e[38]=F):F=e[38];let I;e[39]!==l?(I=l("Filter"),e[39]=l,e[40]=I):I=e[40];let K;e[41]!==p||e[42]!==O||e[43]!==I?(K=(0,a.jsx)(mr,{"aria-label":O,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:F,placeholder:I,value:p}),e[41]=p,e[42]=O,e[43]=I,e[44]=K):K=e[44];let B;e[45]!==l?(B=l("Clear"),e[45]=l,e[46]=B):B=e[46];let z;e[47]!==B?(z=(0,a.jsx)("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:Zi,type:"button",children:B}),e[47]=B,e[48]=z):z=e[48];let Z;e[49]!==l?(Z=l("Hide"),e[49]=l,e[50]=Z):Z=e[50];let A;e[51]!==r||e[52]!==Z?(A=(0,a.jsx)("button",{"aria-label":Z,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:r,type:"button",children:"\u2715"}),e[51]=r,e[52]=Z,e[53]=A):A=e[53];let V;e[54]!==k||e[55]!==K||e[56]!==z||e[57]!==A||e[58]!==x||e[59]!==y||e[60]!==S?(V=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[x,y,S,k,K,z,A]}),e[54]=k,e[55]=K,e[56]=z,e[57]=A,e[58]=x,e[59]=y,e[60]=S,e[61]=V):V=e[61],u=(0,a.jsxs)("section",{"aria-label":g,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[V,v.length===0?(0,a.jsx)("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:l("Every admin call this studio makes is recorded here.")}):(0,a.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:v.map(L=>(0,a.jsx)(Ki,{entry:L,focused:L.seq===o},L.seq))})]}),e[0]=d,e[1]=o,e[2]=p,e[3]=r,e[4]=n,e[5]=s,e[6]=l,e[7]=u}else u=e[7];return u},"mr");function Ui(t){return t.status==="error"}i(Ui,"pr");function Zi(){so.clear()}i(Zi,"fr");var Wi=i(()=>{let t=(0,_.c)(304),e=ge(),o;t[0]!==e?(o=e("Health score"),t[0]=e,t[1]=o):o=t[1];let r;t[2]!==e?(r=e("Agents"),t[2]=e,t[3]=r):r=t[3];let n;t[4]!==e?(n=e("Analytics"),t[4]=e,t[5]=n):n=t[5];let s;t[6]!==e?(s=e("API"),t[6]=e,t[7]=s):s=t[7];let l;t[8]!==e?(l=e("Audit"),t[8]=e,t[9]=l):l=t[9];let d;t[10]!==e?(d=e("Auth audit"),t[10]=e,t[11]=d):d=t[11];let p;t[12]!==e?(p=e("Configuration"),t[12]=e,t[13]=p):p=t[13];let c;t[14]!==e?(c=e("Sessions"),t[14]=e,t[15]=c):c=t[15];let u;t[16]!==e?(u=e("Containers"),t[16]=e,t[17]=u):u=t[17];let h;t[18]!==e?(h=e("Dashboards"),t[18]=e,t[19]=h):h=t[19];let v;t[20]!==e?(v=e("Data"),t[20]=e,t[21]=v):v=t[21];let f;t[22]!==e?(f=e("Deployment health"),t[22]=e,t[23]=f):f=t[23];let m;t[24]!==e?(m=e("Log drains"),t[24]=e,t[25]=m):m=t[25];let g;t[26]!==e?(g=e("Export / Import"),t[26]=e,t[27]=g):g=t[27];let b;t[28]!==e?(b=e("Fan-out"),t[28]=e,t[29]=b):b=t[29];let x;t[30]!==e?(x=e("Files"),t[30]=e,t[31]=x):x=t[31];let C;t[32]!==e?(C=e("Flags"),t[32]=e,t[33]=C):C=t[33];let y;t[34]!==e?(y=e("Functions"),t[34]=e,t[35]=y):y=t[35];let S;t[36]!==e?(S=e("Health"),t[36]=e,t[37]=S):S=t[37];let P;t[38]!==e?(P=e("Home"),t[38]=e,t[39]=P):P=t[39];let w;t[40]!==e?(w=e("Performance"),t[40]=e,t[41]=w):w=t[41];let N;t[42]!==e?(N=e("Issues"),t[42]=e,t[43]=N):N=t[43];let E;t[44]!==e?(E=e("KV"),t[44]=e,t[45]=E):E=t[45];let T;t[46]!==e?(T=e("Logs"),t[46]=e,t[47]=T):T=t[47];let k;t[48]!==e?(k=e("Metrics"),t[48]=e,t[49]=k):k=t[49];let O;t[50]!==e?(O=e("Migrations"),t[50]=e,t[51]=O):O=t[51];let F;t[52]!==e?(F=e("Notifications"),t[52]=e,t[53]=F):F=t[53];let I;t[54]!==e?(I=e("Organizations"),t[54]=e,t[55]=I):I=t[55];let K;t[56]!==e?(K=e("Time Travel"),t[56]=e,t[57]=K):K=t[57];let B;t[58]!==e?(B=e("Mail"),t[58]=e,t[59]=B):B=t[59];let z;t[60]!==e?(z=e("Payments"),t[60]=e,t[61]=z):z=t[61];let Z;t[62]!==e?(Z=e("Permissions"),t[62]=e,t[63]=Z):Z=t[63];let A;t[64]!==e?(A=e("Queues"),t[64]=e,t[65]=A):A=t[65];let V;t[66]!==e?(V=e("Realtime"),t[66]=e,t[67]=V):V=t[67];let L;t[68]!==e?(L=e("RLS Policies"),t[68]=e,t[69]=L):L=t[69];let oe;t[70]!==e?(oe=e("Scheduled"),t[70]=e,t[71]=oe):oe=t[71];let te;t[72]!==e?(te=e("Schema"),t[72]=e,t[73]=te):te=t[73];let le;t[74]!==e?(le=e("Security"),t[74]=e,t[75]=le):le=t[75];let Y;t[76]!==e?(Y=e("Settings"),t[76]=e,t[77]=Y):Y=t[77];let J;t[78]!==e?(J=e("SQL editor"),t[78]=e,t[79]=J):J=t[79];let ne;t[80]!==e?(ne=e("Traces"),t[80]=e,t[81]=ne):ne=t[81];let ue;t[82]!==e?(ue=e("Access Rules"),t[82]=e,t[83]=ue):ue=t[83];let me;t[84]!==e?(me=e("Users"),t[84]=e,t[85]=me):me=t[85];let he;t[86]!==e?(he=e("Vectors"),t[86]=e,t[87]=he):he=t[87];let ce;t[88]!==e?(ce=e("Workflows"),t[88]=e,t[89]=ce):ce=t[89];let Ce;t[90]!==o||t[91]!==r||t[92]!==v||t[93]!==f||t[94]!==m||t[95]!==g||t[96]!==b||t[97]!==x||t[98]!==C||t[99]!==y||t[100]!==S||t[101]!==P||t[102]!==n||t[103]!==w||t[104]!==N||t[105]!==E||t[106]!==T||t[107]!==k||t[108]!==O||t[109]!==F||t[110]!==I||t[111]!==K||t[112]!==B||t[113]!==s||t[114]!==z||t[115]!==Z||t[116]!==A||t[117]!==V||t[118]!==L||t[119]!==oe||t[120]!==te||t[121]!==le||t[122]!==Y||t[123]!==J||t[124]!==l||t[125]!==ne||t[126]!==ue||t[127]!==me||t[128]!==he||t[129]!==ce||t[130]!==d||t[131]!==p||t[132]!==c||t[133]!==u||t[134]!==h?(Ce={advisorHealth:o,agents:r,analytics:n,api:s,audit:l,authAudit:d,authConfig:p,authSessions:c,containers:u,dashboards:h,data:v,deploymentHealth:f,drains:m,export:g,fanout:b,files:x,flags:C,functions:y,health:S,home:P,insights:w,issues:N,kv:E,logs:T,metrics:k,migrations:O,notifications:F,organizations:I,pitr:K,mail:B,payments:z,permissions:Z,queues:A,realtime:V,rls:L,schedule:oe,schema:te,security:le,settings:Y,sql:J,traces:ne,storageRules:ue,users:me,vectors:he,workflows:ce},t[90]=o,t[91]=r,t[92]=v,t[93]=f,t[94]=m,t[95]=g,t[96]=b,t[97]=x,t[98]=C,t[99]=y,t[100]=S,t[101]=P,t[102]=n,t[103]=w,t[104]=N,t[105]=E,t[106]=T,t[107]=k,t[108]=O,t[109]=F,t[110]=I,t[111]=K,t[112]=B,t[113]=s,t[114]=z,t[115]=Z,t[116]=A,t[117]=V,t[118]=L,t[119]=oe,t[120]=te,t[121]=le,t[122]=Y,t[123]=J,t[124]=l,t[125]=ne,t[126]=ue,t[127]=me,t[128]=he,t[129]=ce,t[130]=d,t[131]=p,t[132]=c,t[133]=u,t[134]=h,t[135]=Ce):Ce=t[135];let $=Ce,ee;t[136]!==e?(ee=e("Advisors"),t[136]=e,t[137]=ee):ee=t[137];let ae;t[138]!==e?(ae=e("Auth"),t[138]=e,t[139]=ae):ae=t[139];let Ne;t[140]!==e?(Ne=e("Database"),t[140]=e,t[141]=Ne):Ne=t[141];let xe;t[142]!==e?(xe=e("Functions"),t[142]=e,t[143]=xe):xe=t[143];let De;t[144]!==e?(De=e("Observability"),t[144]=e,t[145]=De):De=t[145];let Te;t[146]!==e?(Te=e("Operations"),t[146]=e,t[147]=Te):Te=t[147];let we;t[148]!==e?(we=e("Overview"),t[148]=e,t[149]=we):we=t[149];let Ue;t[150]!==e?(Ue=e("Settings"),t[150]=e,t[151]=Ue):Ue=t[151];let Ze;t[152]!==e?(Ze=e("Storage"),t[152]=e,t[153]=Ze):Ze=t[153];let go;t[154]!==ee||t[155]!==ae||t[156]!==Ne||t[157]!==xe||t[158]!==De||t[159]!==Te||t[160]!==we||t[161]!==Ue||t[162]!==Ze?(go={advisors:ee,auth:ae,database:Ne,functions:xe,observability:De,operations:Te,overview:we,settings:Ue,storage:Ze},t[154]=ee,t[155]=ae,t[156]=Ne,t[157]=xe,t[158]=De,t[159]=Te,t[160]=we,t[161]=Ue,t[162]=Ze,t[163]=go):go=t[163];let sr=go,We;t[164]!==e?(We=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[164]=e,t[165]=We):We=t[165];let $e;t[166]!==e?($e=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[166]=e,t[167]=$e):$e=t[167];let qe;t[168]!==e?(qe=e("Usage and latency from Analytics Engine \u2014 request volume, p50/p95, and hot shards."),t[168]=e,t[169]=qe):qe=t[169];let Ge;t[170]!==e?(Ge=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[170]=e,t[171]=Ge):Ge=t[171];let Ye;t[172]!==e?(Ye=e("A durable log of admin state-changing operations."),t[172]=e,t[173]=Ye):Ye=t[173];let Je;t[174]!==e?(Je=e("Authentication and security events \u2014 sign-ins, MFA, and session changes."),t[174]=e,t[175]=Je):Je=t[175];let Qe;t[176]!==e?(Qe=e("Enabled plugins and session config (read-only)."),t[176]=e,t[177]=Qe):Qe=t[177];let Xe;t[178]!==e?(Xe=e("Browse and revoke active sessions across all users."),t[178]=e,t[179]=Xe):Xe=t[179];let et;t[180]!==e?(et=e("Live Cloudflare Containers \u2014 current lifecycle state per instance from the log stream."),t[180]=e,t[181]=et):et=t[181];let tt;t[182]!==e?(tt=e("Chart widgets backed by saved read-only SQL queries."),t[182]=e,t[183]=tt):tt=t[183];let ot;t[184]!==e?(ot=e("Browse and edit rows across your shard and global tables."),t[184]=e,t[185]=ot):ot=t[185];let rt;t[186]!==e?(rt=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[186]=e,t[187]=rt):rt=t[187];let nt;t[188]!==e?(nt=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[188]=e,t[189]=nt):nt=t[189];let at;t[190]!==e?(at=e("Export a shard to NDJSON, or import rows from it."),t[190]=e,t[191]=at):at=t[191];let st;t[192]!==e?(st=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[192]=e,t[193]=st):st=t[193];let it;t[194]!==e?(it=e("Browse objects in your R2 storage buckets."),t[194]=e,t[195]=it):it=t[195];let lt;t[196]!==e?(lt=e("Inspect feature flags and their live evaluation under a targeting context."),t[196]=e,t[197]=lt):lt=t[197];let ct;t[198]!==e?(ct=e("Run registered queries, mutations, and actions."),t[198]=e,t[199]=ct):ct=t[199];let dt;t[200]!==e?(dt=e("At-a-glance connection, error, and shard signals."),t[200]=e,t[201]=dt):dt=t[201];let pt;t[202]!==e?(pt=e("Connection, health, and advisor summary for your deployment."),t[202]=e,t[203]=pt):pt=t[203];let ut;t[204]!==e?(ut=e("Surface slow functions, error spikes, and cache problems."),t[204]=e,t[205]=ut):ut=t[205];let mt;t[206]!==e?(mt=e("Grouped error triage \u2014 Worker throws and container crashes folded by fingerprint."),t[206]=e,t[207]=mt):mt=t[207];let ft;t[208]!==e?(ft=e("A live stream of recent function logs."),t[208]=e,t[209]=ft):ft=t[209];let gt;t[210]!==e?(gt=e("Per-shard health and aggregate metrics."),t[210]=e,t[211]=gt):gt=t[211];let ht;t[212]!==e?(ht=e("Review migration status and run them."),t[212]=e,t[213]=ht):ht=t[213];let vt;t[214]!==e?(vt=e("Registered push devices \u2014 endpoint, kind, last-send status, and delivery errors."),t[214]=e,t[215]=vt):vt=t[215];let bt;t[216]!==e?(bt=e("Browse and manage organizations, members, and invitations."),t[216]=e,t[217]=bt):bt=t[217];let xt;t[218]!==e?(xt=e("Restore a shard to a point in the last 30 days."),t[218]=e,t[219]=xt):xt=t[219];let yt;t[220]!==e?(yt=e("Email your app sent, captured in dev."),t[220]=e,t[221]=yt):yt=t[221];let Ct;t[222]!==e?(Ct=e("Synced customers, subscriptions, and webhook events."),t[222]=e,t[223]=Ct):Ct=t[223];let Pt;t[224]!==e?(Pt=e("Inspect access policies per table, and probe a function as any identity."),t[224]=e,t[225]=Pt):Pt=t[225];let Rt;t[226]!==e?(Rt=e("Inspect declared Cloudflare Queues \u2014 their producer bindings, consumer mode, and dead-letter queue."),t[226]=e,t[227]=Rt):Rt=t[227];let St;t[228]!==e?(St=e("Active WebSocket subscriptions on this shard."),t[228]=e,t[229]=St):St=t[229];let Nt;t[230]!==e?(Nt=e("Inspect row-level-security policies and roles, per table."),t[230]=e,t[231]=Nt):Nt=t[231];let Tt;t[232]!==e?(Tt=e("Inspect and cancel scheduled jobs."),t[232]=e,t[233]=Tt):Tt=t[233];let wt;t[234]!==e?(wt=e("Inspect each table and its columns."),t[234]=e,t[235]=wt):wt=t[235];let Et;t[236]!==e?(Et=e("Review admin gates, credentials, and log redaction."),t[236]=e,t[237]=Et):Et=t[237];let kt;t[238]!==e?(kt=e("Read-only deployment config \u2014 vars, secrets, and bindings."),t[238]=e,t[239]=kt):kt=t[239];let Ot;t[240]!==e?(Ot=e("Run read-only SQL against a shard."),t[240]=e,t[241]=Ot):Ot=t[241];let Mt;t[242]!==e?(Mt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[242]=e,t[243]=Mt):Mt=t[243];let Dt;t[244]!==e?(Dt=e("Inspect storage access rules \u2014 per bucket, operation, and key prefix."),t[244]=e,t[245]=Dt):Dt=t[245];let It;t[246]!==e?(It=e("Recent ctx.trace waterfalls for this shard \u2014 the drill-down from a log line."),t[246]=e,t[247]=It):It=t[247];let _t;t[248]!==e?(_t=e("Manage auth users \u2014 roles, bans, sessions, and identity."),t[248]=e,t[249]=_t):_t=t[249];let At;t[250]!==e?(At=e("Browse Vectorize indexes and run similarity searches."),t[250]=e,t[251]=At):At=t[251];let Vt;t[252]!==e?(Vt=e("Inspect declared Cloudflare Workflows and their bindings."),t[252]=e,t[253]=Vt):Vt=t[253];let ho;t[254]!==Vt||t[255]!==We||t[256]!==$e||t[257]!==qe||t[258]!==Ge||t[259]!==Ye||t[260]!==Je||t[261]!==Qe||t[262]!==Xe||t[263]!==et||t[264]!==tt||t[265]!==ot||t[266]!==rt||t[267]!==nt||t[268]!==at||t[269]!==st||t[270]!==it||t[271]!==lt||t[272]!==ct||t[273]!==dt||t[274]!==pt||t[275]!==ut||t[276]!==mt||t[277]!==ft||t[278]!==gt||t[279]!==ht||t[280]!==vt||t[281]!==bt||t[282]!==xt||t[283]!==yt||t[284]!==Ct||t[285]!==Pt||t[286]!==Rt||t[287]!==St||t[288]!==Nt||t[289]!==Tt||t[290]!==wt||t[291]!==Et||t[292]!==kt||t[293]!==Ot||t[294]!==Mt||t[295]!==Dt||t[296]!==It||t[297]!==_t||t[298]!==At?(ho={advisorHealth:We,agents:$e,analytics:qe,api:Ge,audit:Ye,authAudit:Je,authConfig:Qe,authSessions:Xe,containers:et,dashboards:tt,data:ot,deploymentHealth:rt,drains:nt,export:at,fanout:st,files:it,flags:lt,functions:ct,health:dt,home:pt,insights:ut,issues:mt,logs:ft,metrics:gt,migrations:ht,notifications:vt,organizations:bt,pitr:xt,mail:yt,payments:Ct,permissions:Pt,queues:Rt,realtime:St,rls:Nt,schedule:Tt,schema:wt,security:Et,settings:kt,sql:Ot,kv:Mt,storageRules:Dt,traces:It,users:_t,vectors:At,workflows:Vt},t[254]=Vt,t[255]=We,t[256]=$e,t[257]=qe,t[258]=Ge,t[259]=Ye,t[260]=Je,t[261]=Qe,t[262]=Xe,t[263]=et,t[264]=tt,t[265]=ot,t[266]=rt,t[267]=nt,t[268]=at,t[269]=st,t[270]=it,t[271]=lt,t[272]=ct,t[273]=dt,t[274]=pt,t[275]=ut,t[276]=mt,t[277]=ft,t[278]=gt,t[279]=ht,t[280]=vt,t[281]=bt,t[282]=xt,t[283]=yt,t[284]=Ct,t[285]=Pt,t[286]=Rt,t[287]=St,t[288]=Nt,t[289]=Tt,t[290]=wt,t[291]=Et,t[292]=kt,t[293]=Ot,t[294]=Mt,t[295]=Dt,t[296]=It,t[297]=_t,t[298]=At,t[299]=ho):ho=t[299];let ir=ho,vo;return t[300]!==sr||t[301]!==ir||t[302]!==$?(vo={groupLabel:sr,tabDescription:ir,tabLabel:$},t[300]=sr,t[301]=ir,t[302]=$,t[303]=vo):vo=t[303],vo},"gr"),$i=i(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),(0,a.jsx)("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},"br"),qi=i(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,a.jsx)("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),t[0]=e):e=t[0],e},"vr"),Gi=i(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},"yr"),Yi=[{Icon:$i,value:"system"},{Icon:qi,value:"light"},{Icon:Gi,value:"dark"}],Ji=i(()=>{let t=(0,_.c)(19),{theme:e,setTheme:o}=ai(),r=ge(),n;t[0]!==r?(n=r("Dark theme"),t[0]=r,t[1]=n):n=t[1];let s;t[2]!==r?(s=r("Light theme"),t[2]=r,t[3]=s):s=t[3];let l;t[4]!==r?(l=r("System theme"),t[4]=r,t[5]=l):l=t[5];let d;t[6]!==n||t[7]!==s||t[8]!==l?(d={dark:n,light:s,system:l},t[6]=n,t[7]=s,t[8]=l,t[9]=d):d=t[9];let p=d,c;t[10]!==r?(c=r("Theme"),t[10]=r,t[11]=c):c=t[11];let u;t[12]!==p||t[13]!==o||t[14]!==e?(u=Yi.map(v=>{let{Icon:f,value:m}=v,g=e===m;return(0,a.jsxs)("button",{"aria-checked":g,"aria-label":p[m],className:W("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",g?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${m}`,onClick:i(()=>{o(m)},"onClick"),role:"radio",title:p[m],type:"button",children:[g&&(0,a.jsx)(Dn.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}}),(0,a.jsx)("span",{className:"relative",children:(0,a.jsx)(f,{})})]},m)}),t[12]=p,t[13]=o,t[14]=e,t[15]=u):u=t[15];let h;return t[16]!==c||t[17]!==u?(h=(0,a.jsx)("div",{"aria-label":c,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:u}),t[16]=c,t[17]=u,t[18]=h):h=t[18],h},"wr"),Qi=i(t=>{let e=(0,_.c)(23),{domain:o,onOpenCommandPalette:r,page:n}=t,s=ge(),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Oi,{className:"-ms-1"}),e[0]=l):l=e[0];let d;e[1]!==s?(d=s("Breadcrumb"),e[1]=s,e[2]=d):d=e[2];let p;e[3]!==o?(p=(0,a.jsx)("span",{className:"text-muted-foreground",children:o}),e[3]=o,e[4]=p):p=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=c):c=e[5];let u;e[6]!==n?(u=(0,a.jsx)("span",{className:"font-medium text-foreground",children:n}),e[6]=n,e[7]=u):u=e[7];let h;e[8]!==d||e[9]!==p||e[10]!==u?(h=(0,a.jsxs)("nav",{"aria-label":d,className:"flex items-center gap-1.5 text-[13px]",children:[p,c,u]}),e[8]=d,e[9]=p,e[10]=u,e[11]=h):h=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,a.jsx)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=v):v=e[12];let f;e[13]!==s?(f=s("Search\u2026"),e[13]=s,e[14]=f):f=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"\u2318K"}),e[15]=m):m=e[15];let g;e[16]!==r||e[17]!==f?(g=(0,a.jsxs)("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:r,type:"button",children:[v,f,m]}),e[16]=r,e[17]=f,e[18]=g):g=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=(0,a.jsx)("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:(0,a.jsx)(Ji,{})}),e[19]=b):b=e[19];let x;return e[20]!==g||e[21]!==h?(x=(0,a.jsxs)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[l,h,g,b]}),e[20]=g,e[21]=h,e[22]=x):x=e[22],x},"kr"),Xi=i(t=>{let e=(0,_.c)(3),o,r;e[0]!==t?(o=i(()=>{if(t===void 0)return;let n=i(s=>{if(!s.ctrlKey||s.metaKey||s.altKey||s.shiftKey||s.repeat||s.key!=="`")return;let{target:l}=s;l instanceof HTMLElement&&(l.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(l.tagName))||(s.preventDefault(),t())},"n");return globalThis.addEventListener("keydown",n),()=>{globalThis.removeEventListener("keydown",n)}},"a"),r=[t],e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]),(0,M.useEffect)(o,r)},"Nr"),X=i((t,e)=>(0,M.lazy)(()=>t().then(o=>({default:o[e]}))),"E"),el=X(()=>import("./chunk-REJA4WG5.js"),"InsightsPanel"),tl=(0,M.lazy)(()=>import("./chunk-VA5RUELS.js")),ol=(0,M.lazy)(()=>import("./chunk-FCSU7IHH.js")),rl=(0,M.lazy)(()=>import("./chunk-KHZFULUH.js")),nl=(0,M.lazy)(()=>import("./chunk-X3W5GATZ.js")),al=X(()=>import("./chunk-2POO335F.js"),"AnalyticsPanel"),sl=(0,M.lazy)(()=>import("./chunk-OJDJMESX.js")),il=(0,M.lazy)(()=>import("./chunk-5VYZCZNH.js")),ll=(0,M.lazy)(()=>import("./chunk-YPQISHBM.js")),cl=(0,M.lazy)(()=>import("./chunk-AAU2LQP2.js")),dl=(0,M.lazy)(()=>import("./chunk-ILQLRPP6.js")),pl=X(()=>import("./chunk-RPGUPO5I.js"),"UsersPanel"),ul=(0,M.lazy)(()=>import("./chunk-TWF72RNA.js")),ml=X(()=>import("./chunk-5BKFMQKO.js"),"DeploymentHealthPanel"),fl=X(()=>import("./chunk-DUFBHFX6.js"),"TableEditor"),gl=X(()=>import("./chunk-FSPXSK4F.js"),"ExportImportPanel"),hl=(0,M.lazy)(()=>import("./chunk-76XT6OKR.js")),vl={data:An,migrations:Vn},bl=X(()=>import("./chunk-P6U7JNSA.js"),"PitrPanel"),xl=(0,M.lazy)(()=>import("./chunk-WWOB5XZT.js")),yl=X(()=>import("./chunk-ZKDSO2VL.js"),"FunctionRunner"),Cl=X(()=>import("./chunk-OXGSORBK.js"),"FunctionStatsPanel"),Pl=(0,M.lazy)(()=>import("./chunk-Q5LK5ZBG.js")),Rl=X(()=>import("./chunk-LMZCWLYL.js"),"AuditPanel"),Sl=(0,M.lazy)(()=>import("./chunk-SBZXUGZ7.js")),Nl=(0,M.lazy)(()=>import("./chunk-IN6NPKXV.js").then(t=>({default:t.LogsPanel}))),Tl=X(()=>import("./chunk-6VTX32BC.js"),"MailPanel"),wl=X(()=>import("./chunk-L6ZL7C6I.js"),"SchedulePanel"),El=(0,M.lazy)(()=>import("./chunk-AI5UNHBF.js")),kl=(0,M.lazy)(()=>import("./chunk-K5463KGW.js")),Ol=X(()=>import("./chunk-42JIUZ5A.js"),"KvBrowser"),Ml=(0,M.lazy)(()=>import("./chunk-LFYM72CD.js")),Dl=X(()=>import("./chunk-C2W6YSI7.js"),"PaymentsPanel"),Il=X(()=>import("./chunk-KMGVTPH2.js"),"PermissionsPanel"),_l=(0,M.lazy)(()=>import("./chunk-WXALMQCU.js")),Al=(0,M.lazy)(()=>import("./chunk-NLANS7IB.js")),Vl=(0,M.lazy)(()=>import("./chunk-WVXS24SB.js")),Ll=X(()=>import("./chunk-WNCBCYI4.js"),"HealthPanel"),Hl=X(()=>import("./chunk-ZD3CL42S.js"),"MetricsPanel"),Bl=X(()=>import("./chunk-3JJIZ5GZ.js"),"SchemaViewer"),Fl=X(()=>import("./chunk-XOIXFWZS.js"),"SettingsPanel"),jl=X(()=>import("./chunk-GY66QQZJ.js"),"SqlEditorPanel"),Kl=X(()=>import("./chunk-EAGPIRHK.js"),"FileBrowser"),zl=(0,M.lazy)(()=>import("./chunk-EP5VOTNC.js")),Ul=(0,M.lazy)(()=>import("./chunk-ZMNCF2DE.js")),Zl=X(()=>import("./chunk-LFOT3KUL.js"),"VectorBrowser"),Wl=(0,M.lazy)(()=>import("./chunk-WE4LGWB4.js")),ws=(0,M.createContext)(null),$l={analytics:(0,a.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:(0,a.jsx)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:(0,a.jsx)("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"}),authAudit:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:(0,a.jsx)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),agents:(0,a.jsx)("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:(0,a.jsx)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:(0,a.jsx)("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:(0,a.jsx)("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2 3 4-5"}),drains:(0,a.jsx)("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:(0,a.jsx)("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"}),export:(0,a.jsx)("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:(0,a.jsx)("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"}),files:(0,a.jsx)("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"}),flags:(0,a.jsx)("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:(0,a.jsx)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),health:(0,a.jsx)("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:(0,a.jsx)("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:(0,a.jsx)("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"}),issues:(0,a.jsx)("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:(0,a.jsx)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:(0,a.jsx)("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:(0,a.jsx)("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:(0,a.jsx)("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:(0,a.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:(0,a.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"}),notifications:(0,a.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:(0,a.jsx)("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"}),pitr:(0,a.jsx)("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:(0,a.jsx)("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),realtime:(0,a.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),rls:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"}),schedule:(0,a.jsx)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:(0,a.jsx)("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:(0,a.jsx)("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:(0,a.jsx)("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"}),advisorHealth:(0,a.jsx)("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"}),traces:(0,a.jsx)("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:(0,a.jsx)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),users:(0,a.jsx)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"}),vectors:(0,a.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:(0,a.jsx)("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},gs=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","audit","realtime","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags"]},{key:"settings",tabs:["settings"]}],ql={analytics:"analytics",authAudit:"auth",authConfig:"auth",authSessions:"auth",containers:"containers",files:"storage",flags:"flags",kv:"kv",mail:"mail",notifications:"notifications",organizations:"auth",payments:"payments",queues:"queues",schedule:"scheduler",storageRules:"storage",users:"auth",vectors:"vectors",workflows:"workflows"},hs=i((t,e)=>{let o=ql[t];return o===void 0||e[o]},"Lt"),Vr=i(t=>{let e=(0,_.c)(2),{tab:o}=t,r=$l[o],n;return e[0]!==r?(n=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r}),e[0]=r,e[1]=n):n=e[1],n},"xt"),Gl=i(t=>t,"ys"),Es=Gl(["home","data","sql","functions","api","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),Yl=new Set(["api","data","migrations","sql"]),Jl=i(t=>{let e=t.split("/").findLast(Boolean)??"";return Es.includes(e)?e:"home"},"ws"),Ql=i(t=>{let e=(0,_.c)(19),{chrome:o,connected:r}=t,n=ge(),s;e[0]!==n?(s=n("admin token"),e[0]=n,e[1]=s):s=e[1];let l;e[2]!==s?(l=(0,a.jsx)("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:s}),e[2]=s,e[3]=l):l=e[3];let d;e[4]!==o.onTokenChange||e[5]!==o.token?(d=(0,a.jsx)(mr,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:o.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:o.token}),e[4]=o.onTokenChange,e[5]=o.token,e[6]=d):d=e[6];let p;e[7]!==r||e[8]!==n?(p=r&&(0,a.jsxs)("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"}),n("Token rides the WebSocket URL \u2014 it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=r,e[8]=n,e[9]=p):p=e[9];let c;e[10]!==o.clearToken||e[11]!==r||e[12]!==n?(c=r&&(0,a.jsx)("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:o.clearToken,type:"button",children:n("Clear")}),e[10]=o.clearToken,e[11]=r,e[12]=n,e[13]=c):c=e[13];let u;return e[14]!==l||e[15]!==d||e[16]!==p||e[17]!==c?(u=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[l,d,p,c]}),e[14]=l,e[15]=d,e[16]=p,e[17]=c,e[18]=u):u=e[18],u},"ks"),Xl=i(t=>{let e=(0,_.c)(25),{current:o,group:r,groupLabel:n,selectTab:s,tabDescription:l,tabLabel:d}=t,p=r.tabs.includes(o)?"page":void 0,c=n[r.key],u=r.tabs[0],h;e[0]!==u?(h=(0,a.jsx)(Vr,{tab:u}),e[0]=u,e[1]=h):h=e[1];let v;e[2]!==p||e[3]!==c||e[4]!==h?(v=(0,a.jsx)(Rs,{"aria-current":p,"aria-label":c,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:h}),e[2]=p,e[3]=c,e[4]=h,e[5]=v):v=e[5];let f=n[r.key],m;e[6]!==f?(m=(0,a.jsx)("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:f}),e[6]=f,e[7]=m):m=e[7];let g;if(e[8]!==o||e[9]!==r.tabs||e[10]!==s||e[11]!==l||e[12]!==d){let C;e[14]!==o||e[15]!==s||e[16]!==l||e[17]!==d?(C=i(y=>(0,a.jsxs)("button",{"aria-current":o===y?"page":void 0,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100","data-tab":y,"data-testid":`dash-tab-${y}`,onClick:s,title:l[y],type:"button",children:[(0,a.jsx)(Vr,{tab:y}),(0,a.jsx)("span",{children:d[y]})]},y),"y"),e[14]=o,e[15]=s,e[16]=l,e[17]=d,e[18]=C):C=e[18],g=r.tabs.map(C),e[8]=o,e[9]=r.tabs,e[10]=s,e[11]=l,e[12]=d,e[13]=g}else g=e[13];let b;e[19]!==m||e[20]!==g?(b=(0,a.jsxs)(Ss,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[m,g]}),e[19]=m,e[20]=g,e[21]=b):b=e[21];let x;return e[22]!==v||e[23]!==b?(x=(0,a.jsxs)(Ps,{children:[v,b]}),e[22]=v,e[23]=b,e[24]=x):x=e[24],x},"Ns"),ec=i(t=>{let e=(0,_.c)(45),{chrome:o,collapsed:r,connected:n}=t,s=ge();if(o===null){let y;e[0]!==s?(y=s("Admin"),e[0]=s,e[1]=y):y=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=(0,a.jsx)("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=S):S=e[2];let P;e[3]!==s?(P=s("Admin"),e[3]=s,e[4]=P):P=e[4];let w;e[5]!==P?(w=(0,a.jsx)("span",{className:"truncate text-[13px] font-medium",children:P}),e[5]=P,e[6]=w):w=e[6];let N;e[7]!==s?(N=s("Studio"),e[7]=s,e[8]=N):N=e[8];let E;e[9]!==N?(E=(0,a.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:N}),e[9]=N,e[10]=E):E=e[10];let T;e[11]!==w||e[12]!==E?(T=(0,a.jsxs)("span",{className:"grid flex-1 text-start leading-tight",children:[w,E]}),e[11]=w,e[12]=E,e[13]=T):T=e[13];let k;return e[14]!==y||e[15]!==T?(k=(0,a.jsxs)(Ts,{className:"data-active:bg-transparent",size:"lg",tooltip:y,children:[S,T]}),e[14]=y,e[15]=T,e[16]=k):k=e[16],k}let l=r?"mx-auto size-8 justify-center":"w-full p-2",d;e[17]!==l?(d=W("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",l),e[17]=l,e[18]=d):d=e[18];let p;e[19]!==n||e[20]!==s?(p=s(n?"Connected":"Not connected"),e[19]=n,e[20]=s,e[21]=p):p=e[21];let c=n?"bg-success":"bg-muted-foreground/50",u;e[22]!==c?(u=W("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",c),e[22]=c,e[23]=u):u=e[23];let h;e[24]!==u?(h=(0,a.jsxs)("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",(0,a.jsx)("span",{"aria-hidden":"true",className:u})]}),e[24]=u,e[25]=h):h=e[25];let v;e[26]!==r||e[27]!==n||e[28]!==s?(v=!r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"grid flex-1 text-start leading-tight",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium",children:s("Admin")}),(0,a.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:s(n?"Connected":"Not connected")})]}),(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=r,e[27]=n,e[28]=s,e[29]=v):v=e[29];let f;e[30]!==d||e[31]!==p||e[32]!==h||e[33]!==v?(f=(0,a.jsxs)(Rs,{className:d,"data-testid":"dash-app-connect",title:p,children:[h,v]}),e[30]=d,e[31]=p,e[32]=h,e[33]=v,e[34]=f):f=e[34];let m=r?"end":"start",g=r?"right":"top",b;e[35]!==o||e[36]!==n?(b=(0,a.jsx)(Ql,{chrome:o,connected:n}),e[35]=o,e[36]=n,e[37]=b):b=e[37];let x;e[38]!==g||e[39]!==b||e[40]!==m?(x=(0,a.jsx)(Ss,{align:m,keepMounted:!0,side:g,children:b}),e[38]=g,e[39]=b,e[40]=m,e[41]=x):x=e[41];let C;return e[42]!==x||e[43]!==f?(C=(0,a.jsxs)(Ps,{children:[f,x]}),e[42]=x,e[43]=f,e[44]=C):C=e[44],C},"Ms"),tc=i(t=>{let e=(0,_.c)(28),{chrome:o,connected:r,current:n,groupLabel:s,groups:l,selectTab:d,tabDescription:p,tabLabel:c}=t,u=ge(),{state:h}=ar(),v=h==="collapsed",f=v&&"justify-center px-0",m;e[0]!==f?(m=W("flex items-center gap-2.5 px-1.5 py-1",f),e[0]=f,e[1]=m):m=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsx)(ci,{className:"size-9 shrink-0 text-foreground"}),e[2]=g):g=e[2];let b;e[3]!==v||e[4]!==r||e[5]!==u?(b=!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"grid flex-1 leading-tight",children:[(0,a.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),(0,a.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:u("Studio")})]}),(0,a.jsx)(Lt,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:u(r?"Live":"Local")})]}),e[3]=v,e[4]=r,e[5]=u,e[6]=b):b=e[6];let x;e[7]!==m||e[8]!==b?(x=(0,a.jsx)(Di,{children:(0,a.jsxs)("div",{className:m,children:[g,b]})}),e[7]=m,e[8]=b,e[9]=x):x=e[9];let C;e[10]!==v||e[11]!==n||e[12]!==s||e[13]!==l||e[14]!==d||e[15]!==p||e[16]!==c?(C=v?l.map(w=>(0,a.jsx)(Xl,{current:n,group:w,groupLabel:s,selectTab:d,tabDescription:p,tabLabel:c},w.key)):l.map(w=>(0,a.jsxs)(Ai,{children:[(0,a.jsx)(Vi,{className:"text-[11px] font-medium tracking-wider uppercase",children:s[w.key]}),(0,a.jsx)(Li,{children:(0,a.jsx)(ms,{children:w.tabs.map(N=>(0,a.jsx)(fs,{children:(0,a.jsxs)(Ts,{className:"data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]","data-tab":N,"data-testid":`dash-tab-${N}`,isActive:n===N,onClick:d,title:p[N],tooltip:p[N],children:[(0,a.jsx)(Vr,{tab:N}),(0,a.jsx)("span",{children:c[N]})]})},N))})})]},w.key)),e[10]=v,e[11]=n,e[12]=s,e[13]=l,e[14]=d,e[15]=p,e[16]=c,e[17]=C):C=e[17];let y;e[18]!==C?(y=(0,a.jsx)(_i,{children:C}),e[18]=C,e[19]=y):y=e[19];let S;e[20]!==o||e[21]!==v||e[22]!==r?(S=(0,a.jsx)(Ii,{children:(0,a.jsx)(ms,{children:(0,a.jsx)(fs,{children:(0,a.jsx)(ec,{chrome:o,collapsed:v,connected:r})})})}),e[20]=o,e[21]=v,e[22]=r,e[23]=S):S=e[23];let P;return e[24]!==x||e[25]!==y||e[26]!==S?(P=(0,a.jsxs)(ki,{collapsible:"icon",variant:"inset",children:[x,y,S]}),e[24]=x,e[25]=y,e[26]=S,e[27]=P):P=e[27],P},"Ss"),ks=i(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Fo,{className:"h-8 w-40"}),(0,a.jsx)(Fo,{className:"h-8 w-24"})]}),(0,a.jsx)(Fo,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},"Jt"),oc=i(()=>{let t=(0,_.c)(64),e=ge(),o=no(),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={select:lc},t[0]=r):r=t[0];let n=Wr(r),s,l;t[1]!==n?(s=Jl(n),l=Yl.has(s),t[1]=n,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let d=l,p=qr(),c=p?.toggle;Xi(c);let u=In(),{groupLabel:h,tabDescription:v,tabLabel:f}=Wi(),m;t[4]!==u?(m=i(ce=>({...ce,tabs:ce.tabs.filter(Ce=>hs(Ce,u))}),"f"),t[4]=u,t[5]=m):m=t[5];let g=gs.map(m).filter(cc),b,x;t[6]!==s||t[7]!==u||t[8]!==o?(b=i(()=>{hs(s,u)||Jt(o({replace:!0,to:"/home"}))},"b"),x=[s,u,o],t[6]=s,t[7]=u,t[8]=o,t[9]=b,t[10]=x):(b=t[9],x=t[10]),(0,M.useEffect)(b,x);let C;t[11]!==o?(C=i(ce=>{Jt(o({to:`/${ce.currentTarget.dataset.tab??""}`}))},"y"),t[11]=o,t[12]=C):C=t[12];let y=C,S,P;t[13]!==s||t[14]!==f?(S=i(()=>{typeof document<"u"&&(document.title=`${f[s]} \xB7 lunora`)},"M"),P=[s,f],t[13]=s,t[14]=f,t[15]=S,t[16]=P):(S=t[15],P=t[16]),(0,M.useEffect)(S,P);let w=g.find(ce=>ce.tabs.includes(s))??gs[0],N;t[17]!==h||t[18]!==f?(N=i(ce=>ce.tabs.map(Ce=>({group:h[ce.key],label:f[Ce],to:`/${Ce}`})),"N"),t[17]=h,t[18]=f,t[19]=N):N=t[19];let E=g.flatMap(N),T=(0,M.use)(ws),k=T!==null&&T.token!=="",O;t[20]!==E?(O=(0,a.jsx)(ps,{items:E}),t[20]=E,t[21]=O):O=t[21];let F;t[22]!==T||t[23]!==k||t[24]!==s||t[25]!==h||t[26]!==y||t[27]!==v||t[28]!==f||t[29]!==g?(F=(0,a.jsx)(tc,{chrome:T,connected:k,current:s,groupLabel:h,groups:g,selectTab:y,tabDescription:v,tabLabel:f}),t[22]=T,t[23]=k,t[24]=s,t[25]=h,t[26]=y,t[27]=v,t[28]=f,t[29]=g,t[30]=F):F=t[30];let I=h[w.key],K=f[s],B;t[31]!==I||t[32]!==K?(B=(0,a.jsx)(Qi,{domain:I,onOpenCommandPalette:ds,page:K}),t[31]=I,t[32]=K,t[33]=B):B=t[33];let z;t[34]!==T?.rulesInstalled?(z=T?.rulesInstalled===!1&&(0,a.jsx)(ui,{}),t[34]=T?.rulesInstalled,t[35]=z):z=t[35];let Z=`dash-tab-${s}`,A=d?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",V=f[s],L;t[36]!==e||t[37]!==V?(L=e("{title} failed",{title:V}),t[36]=e,t[37]=V,t[38]=L):L=t[38];let oe=f[s],te;t[39]!==e?(te=e("Try again"),t[39]=e,t[40]=te):te=t[40];let le;t[41]===Symbol.for("react.memo_cache_sentinel")?(le=(0,a.jsx)(M.Suspense,{fallback:(0,a.jsx)(ks,{}),children:(0,a.jsx)(zr,{})}),t[41]=le):le=t[41];let Y;t[42]!==s||t[43]!==L||t[44]!==oe||t[45]!==te?(Y=(0,a.jsx)(jo,{fallbackTitle:L,label:oe,retryLabel:te,children:le},s),t[42]=s,t[43]=L,t[44]=oe,t[45]=te,t[46]=Y):Y=t[46];let J;t[47]!==A||t[48]!==Y?(J=(0,a.jsx)("div",{className:A,children:Y}),t[47]=A,t[48]=Y,t[49]=J):J=t[49];let ne;t[50]!==p?(ne=p?.open===!0&&(0,a.jsx)(zi,{focusSeq:p.focusSeq,onClose:p.close,onShownChange:p.setShown,shown:p.shown}),t[50]=p,t[51]=ne):ne=t[51];let ue;t[52]!==Z||t[53]!==J||t[54]!==ne?(ue=(0,a.jsxs)("div",{"aria-labelledby":Z,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[J,ne]}),t[52]=Z,t[53]=J,t[54]=ne,t[55]=ue):ue=t[55];let me;t[56]!==B||t[57]!==z||t[58]!==ue?(me=(0,a.jsxs)(Mi,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[B,z,ue]}),t[56]=B,t[57]=z,t[58]=ue,t[59]=me):me=t[59];let he;return t[60]!==F||t[61]!==me||t[62]!==O?(he=(0,a.jsxs)(Ei,{className:"min-h-0 flex-1","data-testid":"lunora-studio",children:[O,F,me]}),t[60]=F,t[61]=me,t[62]=O,t[63]=he):he=t[63],he},"Cs"),rc=i(()=>{let t=(0,_.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)($r,{children:(0,a.jsx)(oc,{})}),t[0]=e):e=t[0],e},"_s"),nc=i(t=>{let e=(0,_.c)(5),{initialShardKey:o,schemaEditable:r}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];let s=jr(n),{table:l}=s,d=typeof l=="string"?l:void 0,p;return e[1]!==o||e[2]!==d||e[3]!==r?(p=(0,a.jsx)(Bl,{initialShardKey:o,initialTable:d,schemaEditable:r}),e[1]=o,e[2]=d,e[3]=r,e[4]=p):p=e[4],p},"Ls"),ac=i(()=>{let t=(0,_.c)(3),e=no(),o,r;return t[0]!==e?(o=i(()=>{Jt(e({replace:!0,to:"/home"}))},"a"),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),(0,M.useEffect)(o,r),null},"$s"),sc=i(({basePath:t,dataEditable:e=!1,functions:o,initialShardKey:r,openApiSpec:n,openRpcSpec:s,runAsIdentity:l=!1,schemaEditable:d=!1,scheduledCancel:p,scheduledCron:c,scheduledLoad:u})=>{let h=Kr({component:rc}),v={agents:(0,a.jsx)(nl,{initialShardKey:r}),analytics:(0,a.jsx)(al,{}),api:(0,a.jsx)(sl,{functions:o,initialShardKey:r,openApiSpec:n,openRpcSpec:s}),audit:(0,a.jsx)(Rl,{initialShardKey:r}),authAudit:(0,a.jsx)(il,{}),authConfig:(0,a.jsx)(ll,{}),authSessions:(0,a.jsx)(cl,{}),containers:(0,a.jsx)(ul,{}),dashboards:(0,a.jsx)(Al,{initialShardKey:r}),data:(0,a.jsx)(fl,{editable:e,initialShardKey:r}),deploymentHealth:(0,a.jsx)(ml,{}),drains:(0,a.jsx)(Sl,{}),export:(0,a.jsx)(gl,{initialShardKey:r}),fanout:(0,a.jsx)(Vl,{initialShardKey:r}),files:(0,a.jsx)(Kl,{}),kv:(0,a.jsx)(Ol,{}),flags:(0,a.jsx)(xl,{initialShardKey:r}),functions:(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(Cl,{functions:o,initialShardKey:r}),(0,a.jsx)(yl,{functions:o,runAsIdentity:l})]}),health:(0,a.jsx)(Ll,{initialShardKey:r}),home:(0,a.jsx)(_n,{initialShardKey:r}),insights:(0,a.jsx)(el,{initialShardKey:r}),issues:(0,a.jsx)(Pl,{initialShardKey:r}),logs:(0,a.jsx)(Nl,{initialShardKey:r}),traces:(0,a.jsx)(Ul,{initialShardKey:r}),metrics:(0,a.jsx)(Hl,{initialShardKey:r}),migrations:(0,a.jsx)(hl,{initialShardKey:r}),notifications:(0,a.jsx)(Ml,{}),organizations:(0,a.jsx)(dl,{}),permissions:(0,a.jsx)(Il,{functions:o,runAsIdentity:l,schemaEditable:d}),pitr:(0,a.jsx)(bl,{initialShardKey:r}),mail:(0,a.jsx)(Tl,{}),payments:(0,a.jsx)(Dl,{}),queues:(0,a.jsx)(_l,{}),realtime:(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(El,{initialShardKey:r}),(0,a.jsx)(kl,{})]}),rls:(0,a.jsx)(tl,{}),schedule:(0,a.jsx)(wl,{loadCronJobs:c,scheduledCancel:p,scheduledLoad:u}),schema:(0,a.jsx)(nc,{initialShardKey:r,schemaEditable:d}),advisorHealth:(0,a.jsx)(ol,{}),security:(0,a.jsx)(rl,{}),settings:(0,a.jsx)(Fl,{initialShardKey:r}),sql:(0,a.jsx)(jl,{initialShardKey:r}),storageRules:(0,a.jsx)(zl,{}),users:(0,a.jsx)(pl,{}),vectors:(0,a.jsx)(Zl,{}),workflows:(0,a.jsx)(Wl,{})},f=pr({component:i(()=>v.home,"component"),getParentRoute:i(()=>h,"getParentRoute"),path:"/"}),m=Es.map(x=>pr({component:i(()=>v[x],"component"),getParentRoute:i(()=>h,"getParentRoute"),path:`/${x}`,validateSearch:vl[x]})),g=h.addChildren([f,...m]),b="window"in globalThis?Br():Fr({initialEntries:["/home"]});return Ur({...t===void 0||t==="/"?{}:{basepath:t},defaultNotFoundComponent:ac,defaultPendingComponent:ks,defaultPendingMinMs:0,defaultPendingMs:0,history:b,routeTree:g})},"Ps"),ic=i(t=>{let e=(0,_.c)(17),{basePath:o,chrome:r,dataEditable:n,functions:s,initialShardKey:l,openApiSpec:d,openRpcSpec:p,runAsIdentity:c,schemaEditable:u,scheduledCancel:h,scheduledCron:v,scheduledLoad:f}=t,m;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==l||e[4]!==d||e[5]!==p||e[6]!==c||e[7]!==h||e[8]!==v||e[9]!==f||e[10]!==u?(m=sc({basePath:o,dataEditable:n,functions:s,initialShardKey:l,openApiSpec:d,openRpcSpec:p,runAsIdentity:c,schemaEditable:u,scheduledCancel:h,scheduledCron:v,scheduledLoad:f}),e[0]=o,e[1]=n,e[2]=s,e[3]=l,e[4]=d,e[5]=p,e[6]=c,e[7]=h,e[8]=v,e[9]=f,e[10]=u,e[11]=m):m=e[11];let g=m,b=r??null,x;e[12]!==g?(x=(0,a.jsx)(Zr,{router:g}),e[12]=g,e[13]=x):x=e[13];let C;return e[14]!==b||e[15]!==x?(C=(0,a.jsx)(ws,{value:b,children:x}),e[14]=b,e[15]=x,e[16]=C):C=e[16],C},"Ts"),Lg=i(t=>{let e=(0,_.c)(17),{basePath:o,chrome:r,dataEditable:n,functions:s,i18n:l,initialShardKey:d,locale:p,openApiSpec:c,openRpcSpec:u,runAsIdentity:h,schemaEditable:v,scheduledCancel:f,scheduledCron:m,scheduledLoad:g}=t,b;e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==s||e[4]!==d||e[5]!==c||e[6]!==u||e[7]!==h||e[8]!==f||e[9]!==m||e[10]!==g||e[11]!==v?(b=(0,a.jsx)(ni,{children:(0,a.jsx)(ic,{basePath:o,chrome:r,dataEditable:n,functions:s,initialShardKey:d,openApiSpec:c,openRpcSpec:u,runAsIdentity:h,scheduledCancel:f,scheduledCron:m,scheduledLoad:g,schemaEditable:v})}),e[0]=o,e[1]=r,e[2]=n,e[3]=s,e[4]=d,e[5]=c,e[6]=u,e[7]=h,e[8]=f,e[9]=m,e[10]=g,e[11]=v,e[12]=b):b=e[12];let x=b;if(l===void 0&&p===void 0)return x;let C;return e[13]!==l||e[14]!==p||e[15]!==x?(C=(0,a.jsx)(cs,{i18n:l,locale:p,children:x}),e[13]=l,e[14]=p,e[15]=x,e[16]=C):C=e[16],C},"cn");function lc(t){return t.location.pathname}i(lc,"As");function cc(t){return t.tabs.length>0}i(cc,"zs");export{jo as a,cs as b,ri as c,ai as d,Vg as e,ci as f,gi as g,bi as h,xi as i,yi as j,Lg as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as me,e as _}from"./chunk-J6IUJLIJ.js";import{a as ue}from"./chunk-IGCNMZSB.js";import"./chunk-EVPGUJH7.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import{a as de}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{b as T}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-VDW32UET.js";import{c as ce}from"./chunk-KMT6UDR7.js";import{f as ne,g as oe}from"./chunk-WVU7GHTG.js";import"./chunk-XBDKZZ67.js";import{a as A}from"./chunk-WQH3LT2P.js";import{d as D,f as j,g as W,h as X,o as K,r as ie}from"./chunk-IUYFXK4X.js";import"./chunk-BR5GIQWK.js";import{a as p,e as I,f as Ee,g as ae,h as le,j as E}from"./chunk-3XIESWL4.js";var Z=I(ae(),1);var f=I(Ee(),1);var fe=I(ae(),1);var $=I(le(),1);var Me={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},he=p(()=>{let t=(0,fe.c)(16),e=D(),a=oe(),s;e:switch(a){case"connected":{let o;t[0]!==e?(o=e("Connected"),t[0]=e,t[1]=o):o=t[1],s=o;break e}case"connecting":{let o;t[2]!==e?(o=e("Connecting\u2026"),t[2]=e,t[3]=o):o=t[3],s=o;break e}case"idle":{let o;t[4]!==e?(o=e("Idle"),t[4]=e,t[5]=o):o=t[5],s=o;break e}case"offline":{let o;t[6]!==e?(o=e("Offline"),t[6]=e,t[7]=o):o=t[7],s=o;break e}default:s=a}let l=Me[a],c;t[8]!==l?(c=E("size-2 rounded-full",l),t[8]=l,t[9]=c):c=t[9];let i;t[10]!==c?(i=(0,$.jsx)("span",{"aria-hidden":"true",className:c}),t[10]=c,t[11]=i):i=t[11];let n;return t[12]!==a||t[13]!==i||t[14]!==s?(n=(0,$.jsxs)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[i,s]}),t[12]=a,t[13]=i,t[14]=s,t[15]=n):n=t[15],n},"j");var r=I(le(),1);var Ae={crit:"destructive",ok:"secondary",warn:"default"},U=p((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"_"),Y=p((t,e,a)=>Number.isNaN(t)?"ok":t>=a?"crit":t>=e?"warn":"ok","V"),xe=.01,ve=.05,je=p(t=>{let e=(0,Z.c)(36),{errorCount:a,logsError:s,topErrors:l,worstFunctions:c}=t,i=D(),n;e[0]!==i?(n=i("Functions by error rate"),e[0]=i,e[1]=n):n=e[1];let o;e[2]!==n?(o=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n})}),e[2]=n,e[3]=o):o=e[3];let h;e[4]!==i||e[5]!==c?(h=c.length===0?(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:i("No function activity yet.")}):(0,r.jsx)("ul",{className:"divide-y divide-border",children:c.map(y=>(0,r.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:y.path}),(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)("span",{className:"tabular-nums text-muted-foreground",children:i("{count} calls",{count:y.calls.toString()})}),(0,r.jsx)(T,{variant:Ae[Y(y.errors/y.calls,xe,ve)],children:U(y.errors,y.calls)})]})]},y.path))}),e[4]=i,e[5]=c,e[6]=h):h=e[6];let g;e[7]!==o||e[8]!==h?(g=(0,r.jsxs)(A,{className:"gap-0 py-0","data-testid":"hl-functions",children:[o,h]}),e[7]=o,e[8]=h,e[9]=g):g=e[9];let b;e[10]!==i?(b=i("Recent errors"),e[10]=i,e[11]=b):b=e[11];let d;e[12]!==b?(d=(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b}),e[12]=b,e[13]=d):d=e[13];let u=a>0?"destructive":"outline",x;e[14]!==a||e[15]!==u?(x=(0,r.jsx)(T,{"data-testid":"hl-error-count",variant:u,children:a}),e[14]=a,e[15]=u,e[16]=x):x=e[16];let v;e[17]!==d||e[18]!==x?(v=(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[d,x]}),e[17]=d,e[18]=x,e[19]=v):v=e[19];let k;e[20]!==s?(k=s!==null&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:s}),e[20]=s,e[21]=k):k=e[21];let S;e[22]!==s||e[23]!==i||e[24]!==l.length?(S=s===null&&l.length===0&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:i("No recent errors.")}),e[22]=s,e[23]=i,e[24]=l.length,e[25]=S):S=e[25];let q;e[26]!==l?(q=l.length>0&&(0,r.jsx)("ul",{className:"divide-y divide-border",children:l.map(Ce)}),e[26]=l,e[27]=q):q=e[27];let N;e[28]!==k||e[29]!==S||e[30]!==q||e[31]!==v?(N=(0,r.jsxs)(A,{className:"gap-0 py-0",children:[v,k,S,q]}),e[28]=k,e[29]=S,e[30]=q,e[31]=v,e[32]=N):N=e[32];let w;return e[33]!==N||e[34]!==g?(w=(0,r.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[g,N]}),e[33]=N,e[34]=g,e[35]=w):w=e[35],w},"Se");function Ce(t,e){return(0,r.jsxs)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("time",{className:"shrink-0 text-muted-foreground",children:ie(t.timestamp)}),t.functionPath!==void 0&&(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:t.functionPath})]}),(0,r.jsx)("span",{className:"text-destructive",children:t.message})]},`${t.timestamp.toString()}-${e.toString()}`)}p(Ce,"qe");var pe={completed:0,failed:2,in_progress:1},Ie=p(t=>{let e=0,a=0,s=0,l=0,c=!1,i=[];for(let{metrics:n}of t){if(n===null){l+=1;continue}s+=1,e+=n.requests,a+=n.errors,i.push(...n.history??[]),c||=n.historyTruncated===!0}return{errors:a,failed:l,history:i,historyTruncated:c,reachable:s,requests:e}},"Ee"),De=p(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"Me"),Te=p(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let c=pe[s.status]-pe[l.status];(c>0||c===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"$e"),Pe=j(M.getAuthMetrics),Fe=j(M.getFunctionStats),Le=j(M.getLogs),Re=j(M.getMetrics),ze=j(M.migrationStatus),Oe=5,ge=2e3,Ke=5,_e=.1,$e=.3,He=1,Ue=50,Ge=p((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","_e"),Qe=p(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"ze"),Je=p(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"Ke"),Ve=p((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"He"),be={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Ne={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},We={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Xe=p(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","Be"),H=p(t=>{let e=(0,Z.c)(19),{chart:a,label:s,level:l,testId:c,value:i}=t,n=be[l],o;e[0]!==n?(o=E("size-1.5 shrink-0 rounded-full",n),e[0]=n,e[1]=o):o=e[1];let h;e[2]!==o?(h=(0,r.jsx)("span",{"aria-hidden":"true",className:o}),e[2]=o,e[3]=h):h=e[3];let g;e[4]!==s||e[5]!==h?(g=(0,r.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[h,s]}),e[4]=s,e[5]=h,e[6]=g):g=e[6];let b=Ne[l],d;e[7]!==b?(d=E("truncate text-2xl font-semibold tabular-nums",b),e[7]=b,e[8]=d):d=e[8];let u;e[9]!==d||e[10]!==c||e[11]!==i?(u=(0,r.jsx)("span",{className:d,"data-testid":c,children:i}),e[9]=d,e[10]=c,e[11]=i,e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==u?(x=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[u,a]}),e[13]=a,e[14]=u,e[15]=x):x=e[15];let v;return e[16]!==g||e[17]!==x?(v=(0,r.jsx)(A,{className:"gap-0 py-0",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,x]})}),e[16]=g,e[17]=x,e[18]=v):v=e[18],v},"O"),Ye=p(async(t,e,a)=>{let s=await Promise.all(a.map(d=>{let u=W(d);return Promise.allSettled([t.query(Re,{},u),t.query(Fe,{},u),t.query(ze,{},u)])})),l=W(e),c=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[i,n,o]=await Promise.allSettled([t.query(Le,{},l),t.query(Pe,{},l),c]),h=s.map(([d,u,x])=>({functions:u.status==="fulfilled"?u.value.functions:[],metrics:d.status==="fulfilled"?d.value:null,migrations:x.status==="fulfilled"?x.value.migrations:[]})),g=Ie(h),b=s[0]?.[0];return{auth:n.status==="fulfilled"?n.value:null,entries:i.status==="fulfilled"?i.value.entries:[],functions:De(h.map(d=>d.functions)),logsError:i.status==="rejected"?X(i.reason):null,metricsError:g.reachable===0&&b?.status==="rejected"?X(b.reason):null,migrations:Te(h.map(d=>d.migrations)),scheduler:o.status==="fulfilled"?o.value:null,totals:g}},"Ge"),Ze=p(t=>{let e=t?.history??[];return{attempts:e.map(a=>a.attempts),failures:e.map(a=>a.failures)}},"Qe"),xt=p(({initialShardKey:t})=>{let e=ne(),a=D(),[s,l]=(0,f.useState)([]),[c,i]=(0,f.useState)(null),[n,o]=(0,f.useState)(null),[h,g]=(0,f.useState)(null),[b,d]=(0,f.useState)([]),[u,x]=(0,f.useState)(null),[v,k]=(0,f.useState)(null),[S,q]=(0,f.useState)([]),[N]=(0,f.useState)(de),w=(0,f.useRef)(!1),y=(0,f.useRef)(!0);(0,f.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let P=t??"",F=(0,f.useCallback)(async()=>{if(w.current)return;w.current=!0;let m=await Ye(e,P,me(P,N));if(!y.current){w.current=!1;return}o(m.totals),g(m.metricsError),d(m.functions),q(m.migrations),l(m.entries),i(m.logsError),x(m.auth),k(m.scheduler),w.current=!1},[e,N,P]);(0,f.useEffect)(()=>{K(F())},[F]);let G=(0,f.useRef)(0),C=(0,f.useRef)(null),ye=p(()=>{let m=Date.now()-G.current;if(m>=ge){G.current=Date.now(),K(F());return}C.current===null&&(C.current=setTimeout(()=>{C.current=null,G.current=Date.now(),K(F())},ge-m))},"de");(0,f.useEffect)(()=>()=>{C.current!==null&&clearTimeout(C.current)},[]);let{data:B,liveError:we}=ce(M.getMetrics,{},{live:!0,shardKey:P});(0,f.useEffect)(()=>{B!==void 0&&ye()},[B]);let ee=s.filter(m=>m.level==="error"),ke=ee.slice(0,Oe),L=Qe(n?.history),te=Ze(u),Se=b.filter(m=>m.calls>0).toSorted((m,V)=>V.errors/V.calls-m.errors/m.calls||V.calls-m.calls).slice(0,Ke),Q=Je(S),qe=n===null||n.requests===0?0:n.errors/n.requests,J=Y(qe,xe,ve),re=u===null?"ok":Y(u.failureRate,_e,$e),se=v===null?"ok":Ge(v.backlog,He,Ue),R=Xe([J,re,se,Q.level]),z,O;return R==="crit"?(z=a("Critical"),O=a("One or more service levels are breached.")):R==="warn"?(z=a("Degraded"),O=a("Some service levels need attention.")):(z=a("All systems healthy"),O=a("All service levels are within target.")),(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxs)(A,{className:"gap-0 py-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:E("flex size-10 shrink-0 items-center justify-center rounded-full",We[R]),children:(0,r.jsx)("span",{className:E("size-3 rounded-full",be[R])})}),(0,r.jsxs)("div",{className:"grid leading-tight",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:z}),(0,r.jsx)("span",{className:"text-[13px] text-muted-foreground",children:O})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[L.requests.length>=2&&(0,r.jsx)(_,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:L.requests,testId:"hl-spark-requests"}),(0,r.jsx)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(n?.requests??0).toString()})]})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")}),(0,r.jsx)("div",{className:E("text-lg font-semibold tabular-nums",Ne[J]),"data-testid":"hl-error-rate",children:n===null?"\u2014":U(n.errors,n.requests)})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(he,{}),(0,r.jsx)(ue,{message:we,prefix:"hl"})]})]})]}),h!==null&&(0,r.jsx)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:h}),h===null&&n?.historyTruncated===!0&&(0,r.jsx)("div",{className:"border-t border-border bg-warning/5 px-4 py-2 text-sm text-muted-foreground","data-testid":"hl-history-truncated",children:a("Showing a partial request/error history \u2014 one or more shards have more data than the trend chart can display.")})]}),(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsx)(H,{chart:L.errors.length>=2?(0,r.jsx)(_,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:L.errors,testId:"hl-spark-errors"}):void 0,label:a("Error rate"),level:J,testId:"hl-slo-errorrate",value:n===null?"\u2014":U(n.errors,n.requests)}),(0,r.jsx)(H,{chart:te.failures.length>=2?(0,r.jsx)(_,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:te.failures,testId:"hl-spark-auth"}):void 0,label:a("Auth failures"),level:re,testId:"hl-slo-auth",value:u===null?"\u2014":U(u.failures,u.attempts)}),(0,r.jsx)(H,{label:a("Scheduler backlog"),level:se,testId:"hl-slo-backlog",value:v===null?"\u2014":v.backlog.toString()}),(0,r.jsx)(H,{label:a("Migrations"),level:Q.level,testId:"hl-slo-migrations",value:Ve(Q,a)})]}),(0,r.jsx)(je,{errorCount:ee.length,logsError:c,topErrors:ke,worstFunctions:Se}),(0,r.jsxs)(A,{className:"gap-0 py-0",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")}),(0,r.jsx)(T,{"data-testid":"hl-shard-count",variant:"outline",children:N.length})]}),N.length>0&&(0,r.jsx)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:N.map(m=>(0,r.jsx)("li",{"data-testid":"hl-shard",children:(0,r.jsx)(T,{variant:"secondary",children:m})},m))})]})]})},"dt");export{xt as HealthPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as w}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as S}from"./chunk-ZBVGZ4YA.js";import"./chunk-XXQUMVWH.js";import"./chunk-56Q3NCCQ.js";import"./chunk-QLQADHFE.js";import{a as f}from"./chunk-VDW32UET.js";import{c as p}from"./chunk-KMT6UDR7.js";import"./chunk-WVU7GHTG.js";import"./chunk-XBDKZZ67.js";import{a as T}from"./chunk-XQCVZAGU.js";import{a as C,b as j,c as I,d as m,e as n,f as o}from"./chunk-WJQLNYGX.js";import{a as A,e as k}from"./chunk-WQH3LT2P.js";import{d as B,r as M}from"./chunk-IUYFXK4X.js";import"./chunk-BR5GIQWK.js";import{a as i,e as z,f as W,h as X}from"./chunk-3XIESWL4.js";var D=z(W(),1);var e=z(X(),1);var F="agent_threads",Y="agent_messages",Z=100,ee=250,te={},ae={filters:[],limit:Z,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:F},l=i((s,t)=>{let a=s[t];return typeof a=="string"?a:void 0},"l"),K=i((s,t)=>{let a=s[t];return typeof a=="number"?a:void 0},"b"),P=i(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:a}=t;return typeof a=="number"?a:void 0},"z"),re=i(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(a=>a!==null&&typeof a=="object"?a.name:void 0).filter(a=>typeof a=="string"):[]},"ee"),se=i(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"te"),ne=i(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"ae"),fe=i(({initialShardKey:s=""})=>{let t=B(),[a,$]=(0,D.useState)(void 0),{data:x}=p(f.listTables,te,{live:!0,shardKey:s}),L=x!==void 0,u=Array.isArray(x)&&x.some(r=>r.name===F),{data:U,error:O,errorSource:R,liveError:G}=p(f.readTablePage,ae,{enabled:u,live:!0,shardKey:s}),H={filters:[{column:"threadKey",operator:"eq",value:a??""}],limit:ee,offset:0,orderBy:{column:"seq",direction:"asc"},skipCount:!0,table:Y},{data:_,error:J,errorSource:Q}=p(f.readTablePage,H,{enabled:u&&a!==void 0,live:!0,shardKey:s}),v=Array.isArray(U?.rows)?U.rows:[],q=Array.isArray(_?.rows)?_.rows:[],E=v.find(r=>l(r,"key")===a),h;return L&&!u?h=(0,e.jsx)(T,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):u&&v.length===0?h=(0,e.jsx)(T,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):h=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(A,{className:"overflow-hidden py-0",children:(0,e.jsx)(k,{className:"px-0",children:(0,e.jsxs)(C,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(j,{children:(0,e.jsxs)(m,{children:[(0,e.jsx)(n,{children:t("Agent")}),(0,e.jsx)(n,{children:t("Key")}),(0,e.jsx)(n,{children:t("Status")}),(0,e.jsx)(n,{children:t("Messages")}),(0,e.jsx)(n,{children:t("Tokens")}),(0,e.jsx)(n,{children:t("Updated")}),(0,e.jsx)(n,{"aria-label":t("Actions")})]})}),(0,e.jsx)(I,{children:v.map(r=>{let d=l(r,"key")??"",c=l(r,"status"),g=P(r);return(0,e.jsxs)(m,{"data-active":d===a?"":void 0,"data-testid":`agents-thread-${d}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:l(r,"agent")??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:d}),(0,e.jsx)(o,{children:(0,e.jsx)(b,{"data-testid":`agents-thread-status-${d}`,variant:se(c),children:c??"\u2014"})}),(0,e.jsx)(o,{className:"tabular-nums",children:K(r,"messageCount")??"\u2014"}),(0,e.jsx)(o,{className:"tabular-nums text-muted-foreground",children:g??"\u2014"}),(0,e.jsx)(o,{className:"text-muted-foreground tabular-nums",children:M(K(r,"updatedAt"),"\u2014")}),(0,e.jsx)(o,{className:"text-right",children:(0,e.jsx)(w,{"data-testid":`agents-thread-open-${d}`,onClick:i(()=>{$(d)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},d)})})]})})}),J!==null&&(0,e.jsx)(S,{error:Q,testId:"agents-messages-error"}),a!==void 0&&(0,e.jsx)(A,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(k,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",a,E!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",P(E)??0," ",t("Tokens")]})]}),(0,e.jsx)(w,{"data-testid":"agents-thread-detail-close",onClick:i(()=>{$(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),q.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(C,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(j,{children:(0,e.jsxs)(m,{children:[(0,e.jsx)(n,{children:t("Role")}),(0,e.jsx)(n,{children:t("Content")}),(0,e.jsx)(n,{children:t("Tool")}),(0,e.jsx)(n,{children:t("Approval")})]})}),(0,e.jsx)(I,{children:q.map((r,d)=>{let c=l(r,"role")??"\u2014",g=re(r),V=l(r,"toolName"),y=l(r,"status"),N=K(r,"seq")??d;return(0,e.jsxs)(m,{"data-testid":`agents-message-${String(N)}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs align-top text-muted-foreground",children:c}),(0,e.jsx)(o,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:l(r,"content")??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs align-top text-muted-foreground",children:V??(g.length>0?g.join(", "):"\u2014")}),(0,e.jsx)(o,{className:"align-top",children:y===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(b,{"data-testid":`agents-message-approval-${String(N)}`,variant:ne(y),children:y})})]},l(r,"messageKey")??`${c}:${String(N)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[O!==null&&(0,e.jsx)(S,{error:R,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),G!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),h]})},"pe");export{fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as me}from"./chunk-TMGHRD6W.js";import{a as Kt,b as Lt,c as At,d as Tt,e as it}from"./chunk-J6IUJLIJ.js";import{a as Ot}from"./chunk-VITTPKH5.js";import{a as zt}from"./chunk-K2E4OECF.js";import{e as _t}from"./chunk-XF2B7P5A.js";import{a as Dt,b as It,c as Ct,d as Rt,e as je}from"./chunk-RA5DW5MU.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as Mt}from"./chunk-IGCNMZSB.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as Ze,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-EVPGUJH7.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import{a as $t}from"./chunk-3CWGJYBB.js";import{a as kt}from"./chunk-RMN2JN4S.js";import{a as wt,b as qt}from"./chunk-GRL5MG3Z.js";import"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{a as Ye}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as We}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as Le}from"./chunk-VDW32UET.js";import{c as Ee}from"./chunk-KMT6UDR7.js";import{f as ct}from"./chunk-WVU7GHTG.js";import"./chunk-XBDKZZ67.js";import{a as ht}from"./chunk-XQCVZAGU.js";import{a as st,b as lt,c as nt,d as Pe,e as ce,f as H}from"./chunk-WJQLNYGX.js";import{a as fe,b as Ae,c as Te,d as ut,e as pe}from"./chunk-WQH3LT2P.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as Ge,o as bt}from"./chunk-IUYFXK4X.js";import"./chunk-BR5GIQWK.js";import{a as o,e as Xe,f as Qt,g as Ut,h as Ft,j as mt}from"./chunk-3XIESWL4.js";var j=Xe(Qt(),1);var xe=Xe(Ut(),1);var t=Xe(Ft(),1);var Jt=o((s,e)=>s<e?-1:s>e?1:0,"Bt"),dt=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s))return`[${s.map(c=>dt(c)).join(",")}]`;let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let c=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${c} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).toSorted(Jt),r=[];for(let c of a){let i=l[c];i!==void 0&&r.push(`${JSON.stringify(c)}:${dt(i)}`)}return`{${r.join(",")}}`},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"ht"),jt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Ht=o((s,e)=>jt(s,e),"Jt"),Wt=o(s=>jt(s.kind,s),"Ht"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"Xe"),Gt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Bt="FUNCTION_NOT_FOUND",Vt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Xt={counter:"secondary",gauge:"default",histogram:"outline"},Yt=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,c=ge();if(r===void 0){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let m=`mt-instrument-trace-${l}`,g;return e[3]!==n||e[4]!==m||e[5]!==r?(g=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":m,title:r,children:n}),e[3]=n,e[4]=m,e[5]=r,e[6]=g):g=e[6],g}let S=`mt-instrument-trace-${l}`,v;e[7]!==a||e[8]!==r?(v=o(()=>{a(r)},"v"),e[7]=a,e[8]=r,e[9]=v):v=e[9];let w;e[10]!==c||e[11]!==r?(w=c("Open the exemplar trace {trace}",{trace:r}),e[10]=c,e[11]=r,e[12]=w):w=e[12];let h;return e[13]!==n||e[14]!==S||e[15]!==v||e[16]!==w?(h=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":S,onClick:v,title:w,type:"button",children:n}),e[13]=n,e[14]=S,e[15]=v,e[16]=w,e[17]=h):h=e[17],h},"Vt"),Zt=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:S,errorSource:v}=Ee(Le.getMetricSeries,c,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let h;e[4]!==a?(h={live:!0,shardKey:a},e[4]=a,e[5]=h):h=e[5];let{data:m}=Ee(Le.getMetricHistory,w,h),g,y,q,M,d,p,f,x,k,_,N,I,D;if(e[6]!==n||e[7]!==S||e[8]!==v||e[9]!==m||e[10]!==l||e[11]!==r){x=Symbol.for("react.early_return_sentinel");e:{let L=Gt(n),T=xt(v)===Bt;if(S!==null&&!T){let u;e[25]!==r?(u=r("Instruments"),e[25]=r,e[26]=u):u=e[26];let P;e[27]!==u?(P=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[27]=u,e[28]=P):P=e[28];let U;e[29]!==S||e[30]!==r?(U=r("Instruments unavailable: {error}",{error:S}),e[29]=S,e[30]=r,e[31]=U):U=e[31];let F;e[32]!==U?(F=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:U}),e[32]=U,e[33]=F):F=e[33];let de;e[34]!==P||e[35]!==F?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[P,F]}),e[34]=P,e[35]=F,e[36]=de):de=e[36],x=de;break e}if(L.length===0){x=null;break e}let K=Vt(m),E;e[37]!==r?(E=o(u=>r(u==="counter"?"Counter":u==="gauge"?"Gauge":"Histogram"),"K"),e[37]=r,e[38]=E):E=e[38];let Q=E;d="flex flex-col gap-2",p="mt-instruments";let A;e[39]!==r?(A=r("Instruments"),e[39]=r,e[40]=A):A=e[40],e[41]!==A?(f=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:A}),e[41]=A,e[42]=f):f=e[42],M=fe,D="overflow-hidden py-0",q=pe,I="px-0",y=st,_="mt-instruments-table";let W;e[43]!==r?(W=r("name"),e[43]=r,e[44]=W):W=e[44];let G;e[45]!==W?(G=(0,t.jsx)(ce,{children:W}),e[45]=W,e[46]=G):G=e[46];let B;e[47]!==r?(B=r("kind"),e[47]=r,e[48]=B):B=e[48];let V;e[49]!==B?(V=(0,t.jsx)(ce,{children:B}),e[49]=B,e[50]=V):V=e[50];let X;e[51]!==r?(X=r("value"),e[51]=r,e[52]=X):X=e[52];let Y;e[53]!==X?(Y=(0,t.jsx)(ce,{className:"text-right",children:X}),e[53]=X,e[54]=Y):Y=e[54];let Z;e[55]!==r?(Z=r("count"),e[55]=r,e[56]=Z):Z=e[56];let ee;e[57]!==Z?(ee=(0,t.jsx)(ce,{className:"text-right",children:Z}),e[57]=Z,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==V||e[77]!==Y||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(N=(0,t.jsx)(lt,{children:(0,t.jsxs)(Pe,{children:[G,V,Y,ee,re,se,ne,oe]})}),e[75]=G,e[76]=V,e[77]=Y,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=N):N=e[83],g=nt,k=L.map(u=>{let P=zt(u.attributes),U=Pt(u.kind,u.name,u.attributes),F=(K.get(U)??[]).map(de=>Ht(u.kind,de));return(0,t.jsxs)(Pe,{"data-testid":`mt-instrument-${u.name}`,children:[(0,t.jsx)(H,{className:"font-mono text-xs",title:u.functionPath,children:u.name}),(0,t.jsx)(H,{children:(0,t.jsx)(We,{variant:Xt[u.kind],children:Q(u.kind)})}),(0,t.jsx)(H,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${u.name}`,children:ot(Wt(u))}),(0,t.jsx)(H,{className:"text-right tabular-nums text-muted-foreground",children:u.count.toLocaleString()}),(0,t.jsx)(H,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:u.min===u.max?"\u2014":`${ot(u.min)}\u2013${ot(u.max)}`}),(0,t.jsx)(H,{children:F.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:u.name}),className:"h-6 w-24 text-foreground",series:F,testId:`mt-instrument-trend-${u.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(H,{className:"font-mono text-xs",children:(0,t.jsx)(Yt,{name:u.name,onOpenTrace:l,traceId:u.exemplarTraceId})}),(0,t.jsx)(H,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:P,children:P===""?"\u2014":P})]},U)})}e[6]=n,e[7]=S,e[8]=v,e[9]=m,e[10]=l,e[11]=r,e[12]=g,e[13]=y,e[14]=q,e[15]=M,e[16]=d,e[17]=p,e[18]=f,e[19]=x,e[20]=k,e[21]=_,e[22]=N,e[23]=I,e[24]=D}else g=e[12],y=e[13],q=e[14],M=e[15],d=e[16],p=e[17],f=e[18],x=e[19],k=e[20],_=e[21],N=e[22],I=e[23],D=e[24];if(x!==Symbol.for("react.early_return_sentinel"))return x;let C;e[84]!==g||e[85]!==k?(C=(0,t.jsx)(g,{children:k}),e[84]=g,e[85]=k,e[86]=C):C=e[86];let $;e[87]!==y||e[88]!==C||e[89]!==_||e[90]!==N?($=(0,t.jsxs)(y,{"data-testid":_,children:[N,C]}),e[87]=y,e[88]=C,e[89]=_,e[90]=N,e[91]=$):$=e[91];let b;e[92]!==q||e[93]!==$||e[94]!==I?(b=(0,t.jsx)(q,{className:I,children:$}),e[92]=q,e[93]=$,e[94]=I,e[95]=b):b=e[95];let R;e[96]!==M||e[97]!==b||e[98]!==D?(R=(0,t.jsx)(M,{className:D,children:b}),e[96]=M,e[97]=b,e[98]=D,e[99]=R):R=e[99];let O;return e[100]!==d||e[101]!==p||e[102]!==f||e[103]!==R?(O=(0,t.jsxs)("section",{className:d,"data-testid":p,children:[f,R]}),e[100]=d,e[101]=p,e[102]=f,e[103]=R,e[104]=O):O=e[104],O},"Zt"),er=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),c;e[0]!==r?(c=r("Shards"),e[0]=r,e[1]=c):c=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==c||e[7]!==i?(n=(0,t.jsx)(me,{label:c,testId:"mt-agg-shards",value:i}),e[6]=c,e[7]=i,e[8]=n):n=e[8];let S;e[9]!==r?(S=r("Total requests"),e[9]=r,e[10]=S):S=e[10];let v;e[11]!==l.totalRequests||e[12]!==S?(v=(0,t.jsx)(me,{label:S,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=S,e[13]=v):v=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let h;e[16]!==l.totalErrors||e[17]!==w?(h=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=h):h=e[18];let m;e[19]!==r?(m=r("Total database size"),e[19]=r,e[20]=m):m=e[20];let g;e[21]!==l.totalDatabaseSize?(g=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=(0,t.jsx)(me,{label:m,testId:"mt-agg-db-size",value:g}),e[23]=m,e[24]=g,e[25]=y):y=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let M;e[28]!==l.hitRate||e[29]!==r?(M=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=M):M=e[30];let d;e[31]!==q||e[32]!==M?(d=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:M}),e[31]=q,e[32]=M,e[33]=d):d=e[33];let p;e[34]!==y||e[35]!==d||e[36]!==n||e[37]!==v||e[38]!==h?(p=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,v,h,y,d]}),e[34]=y,e[35]=d,e[36]=n,e[37]=v,e[38]=h,e[39]=p):p=e[39];let f;e[40]!==r?(f=r("shard"),e[40]=r,e[41]=f):f=e[41];let x;e[42]!==f?(x=(0,t.jsx)(ce,{children:f}),e[42]=f,e[43]=x):x=e[43];let k;e[44]!==r?(k=r("requests"),e[44]=r,e[45]=k):k=e[45];let _;e[46]!==k?(_=(0,t.jsx)(ce,{children:k}),e[46]=k,e[47]=_):_=e[47];let N;e[48]!==r?(N=r("errors"),e[48]=r,e[49]=N):N=e[49];let I;e[50]!==N?(I=(0,t.jsx)(ce,{children:N}),e[50]=N,e[51]=I):I=e[51];let D;e[52]!==r?(D=r("db size"),e[52]=r,e[53]=D):D=e[53];let C;e[54]!==D?(C=(0,t.jsx)(ce,{children:D}),e[54]=D,e[55]=C):C=e[55];let $;e[56]!==x||e[57]!==_||e[58]!==I||e[59]!==C?($=(0,t.jsx)(lt,{children:(0,t.jsxs)(Pe,{children:[x,_,I,C]})}),e[56]=x,e[57]=_,e[58]=I,e[59]=C,e[60]=$):$=e[60];let b;if(e[61]!==a||e[62]!==r){let T;e[64]!==r?(T=o(K=>(0,t.jsxs)(Pe,{"data-testid":`mt-agg-row-${K.shard}`,children:[(0,t.jsx)(H,{children:K.shard}),K.metrics===null?(0,t.jsx)(H,{className:"text-destructive",colSpan:3,children:K.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H,{className:"tabular-nums",children:K.metrics.requests}),(0,t.jsx)(H,{className:"tabular-nums",children:K.metrics.errors}),(0,t.jsx)(H,{className:"tabular-nums",children:Ge(K.metrics.databaseSize)})]})]},K.shard),"A"),e[64]=r,e[65]=T):T=e[65],b=a.map(T),e[61]=a,e[62]=r,e[63]=b}else b=e[63];let R;e[66]!==b?(R=(0,t.jsx)(nt,{children:b}),e[66]=b,e[67]=R):R=e[67];let O;e[68]!==$||e[69]!==R?(O=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[$,R]})})}),e[68]=$,e[69]=R,e[70]=O):O=e[70];let L;return e[71]!==p||e[72]!==O?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[p,O]}),e[71]=p,e[72]=O,e[73]=L):L=e[73],L},"er"),tr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"tr"),rr=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"rr"),Et=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ot"),ar=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:c,metrics:i}=s,n=ge(),S;e[0]!==r||e[1]!==n?(S=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=S):S=e[2];let v;e[3]!==l||e[4]!==r.length||e[5]!==n?(v=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=v):v=e[6];let w;e[7]!==n?(w=n("Requests"),e[7]=n,e[8]=w):w=e[8];let h;e[9]!==i.requests||e[10]!==S||e[11]!==v||e[12]!==w?(h=(0,t.jsx)(me,{chart:S,footer:v,label:w,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=S,e[11]=v,e[12]=w,e[13]=h):h=e[13];let m;e[14]!==a||e[15]!==n?(m=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=m):m=e[16];let g;e[17]!==n?(g=n("Errors"),e[17]=n,e[18]=g):g=e[18];let y;e[19]!==a||e[20]!==i.errors?(y=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=y):y=e[21];let q;e[22]!==m||e[23]!==g||e[24]!==y?(q=(0,t.jsx)(me,{footer:m,label:g,testId:"mt-errors",value:y}),e[22]=m,e[23]=g,e[24]=y,e[25]=q):q=e[25];let M;e[26]!==c.p90?(M=c.p90>0?`P90 ${Et(c.p90)}`:void 0,e[26]=c.p90,e[27]=M):M=e[27];let d;e[28]!==n?(d=n("P95 latency"),e[28]=n,e[29]=d):d=e[29];let p;e[30]!==c.p95?(p=c.p95>0?Et(c.p95):"\u2014",e[30]=c.p95,e[31]=p):p=e[31];let f;e[32]!==d||e[33]!==p||e[34]!==M?(f=(0,t.jsx)(me,{footer:M,label:d,testId:"mt-p95",value:p}),e[32]=d,e[33]=p,e[34]=M,e[35]=f):f=e[35];let x;e[36]!==i.cache||e[37]!==n?(x=i.cache===null?void 0:`${i.cache.entries.toLocaleString()} ${n("cache entries")}`,e[36]=i.cache,e[37]=n,e[38]=x):x=e[38];let k;e[39]!==n?(k=n("Database size"),e[39]=n,e[40]=k):k=e[40];let _;e[41]!==i.databaseSize?(_=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=_):_=e[42];let N;e[43]!==x||e[44]!==k||e[45]!==_?(N=(0,t.jsx)(me,{footer:x,label:k,testId:"mt-db-size",value:_}),e[43]=x,e[44]=k,e[45]=_,e[46]=N):N=e[46];let I;e[47]!==n?(I=n("Shard"),e[47]=n,e[48]=I):I=e[48];let D;e[49]!==i.shard||e[50]!==I?(D=(0,t.jsx)(me,{label:I,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=I,e[51]=D):D=e[51];let C;e[52]!==n?(C=n("Uptime"),e[52]=n,e[53]=C):C=e[53];let $;e[54]!==i.uptimeMs?($=tr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=$):$=e[55];let b;e[56]!==C||e[57]!==$?(b=(0,t.jsx)(me,{label:C,testId:"mt-uptime",value:$}),e[56]=C,e[57]=$,e[58]=b):b=e[58];let R;e[59]!==n?(R=n("Cache hit rate"),e[59]=n,e[60]=R):R=e[60];let O;e[61]!==i.cache||e[62]!==n?(O=i.cache===null?n("no cache configured"):n("{rate} ({count} entries)",{count:i.cache.entries,rate:rr(i.cache.hits,i.cache.misses)}),e[61]=i.cache,e[62]=n,e[63]=O):O=e[63];let L;e[64]!==R||e[65]!==O?(L=(0,t.jsx)(me,{label:R,testId:"mt-cache",value:O}),e[64]=R,e[65]=O,e[66]=L):L=e[66];let T;return e[67]!==f||e[68]!==N||e[69]!==D||e[70]!==b||e[71]!==L||e[72]!==h||e[73]!==q?(T=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[h,q,f,N,D,b,L]}),e[67]=f,e[68]=N,e[69]=D,e[70]=b,e[71]=L,e[72]=h,e[73]=q,e[74]=T):T=e[74],T},"ar"),Ve=o(s=>s>=100?"critical":s>=50?"warning":"good","Ge"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Oe"),Be=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"Be"),sr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"lr"),lr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"sr"),nr=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,c]=(0,j.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,S]=(0,j.useState)(i),v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=o(D=>{D!==null&&c(D)},"v"),e[1]=v):v=e[1];let w=v,h,m,g,y,q,M,d,p,f,x;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){g=Symbol.for("react.early_return_sentinel");e:{let D=lr(l,r),C;e[16]!==l?(C=l.filter(ir),e[16]=l,e[17]=C):C=e[17];let $=C.length,b;e[18]!==l?(b=l.filter(or),e[18]=l,e[19]=b):b=e[19];let R=b.length,O;e[20]!==l?(O=l.filter(dr),e[20]=l,e[21]=O):O=e[21];let L=O.length,T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=o(z=>{S(ue=>{let J=new Set(ue);return J.has(z)?J.delete(z):J.add(z),J})},"A"),e[22]=T):T=e[22];let K=T;if(l.length===0){let z;e[23]!==a?(z=a("No query insights yet"),e[23]=a,e[24]=z):z=e[24];let ue;e[25]!==z?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:z}),e[25]=z,e[26]=ue):ue=e[26];let J;e[27]!==a?(J=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=J):J=e[28];let he;e[29]!==J?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:J}),e[29]=J,e[30]=he):he=e[30];let He;e[31]!==ue||e[32]!==he?(He=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=He):He=e[33],g=He;break e}d="space-y-4",p="qi-root";let E;e[34]!==a?(E=a("Critical queries"),e[34]=a,e[35]=E):E=e[35];let Q;e[36]!==E?(Q=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Te,{className:"text-sm font-medium",children:E})}),e[36]=E,e[37]=Q):Q=e[37];let A;e[38]!==$?(A=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:$}),e[38]=$,e[39]=A):A=e[39];let W;e[40]!==a?(W=a(">100ms avg execution"),e[40]=a,e[41]=W):W=e[41];let G;e[42]!==W?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:W}),e[42]=W,e[43]=G):G=e[43];let B;e[44]!==A||e[45]!==G?(B=(0,t.jsxs)(pe,{children:[A,G]}),e[44]=A,e[45]=G,e[46]=B):B=e[46];let V;e[47]!==Q||e[48]!==B?(V=(0,t.jsxs)(fe,{children:[Q,B]}),e[47]=Q,e[48]=B,e[49]=V):V=e[49];let X;e[50]!==a?(X=a("Moderate queries"),e[50]=a,e[51]=X):X=e[51];let Y;e[52]!==X?(Y=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Te,{className:"text-sm font-medium",children:X})}),e[52]=X,e[53]=Y):Y=e[53];let Z;e[54]!==R?(Z=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:R}),e[54]=R,e[55]=Z):Z=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==Z||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[Z,te]}),e[60]=Z,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Y||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Y,re]}),e[63]=Y,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Te,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==L?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:L}),e[70]=L,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let u;e[76]!==ne||e[77]!==oe?(u=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=u):u=e[78];let P;e[79]!==le||e[80]!==u?(P=(0,t.jsxs)(fe,{children:[le,u]}),e[79]=le,e[80]=u,e[81]=P):P=e[81],e[82]!==V||e[83]!==ae||e[84]!==P?(f=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[V,ae,P]}),e[82]=V,e[83]=ae,e[84]=P,e[85]=f):f=e[85];let U;e[86]!==a?(U=a("Query leaderboard"),e[86]=a,e[87]=U):U=e[87];let F;e[88]!==U?(F=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:U}),e[88]=U,e[89]=F):F=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==F||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[F,be]}),e[95]=F,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Ue;e[104]===Symbol.for("react.memo_cache_sentinel")?(Ue=(0,t.jsx)(It,{}),e[104]=Ue):Ue=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(Ct,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Ue}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let ke;e[109]!==qe?(ke=(0,t.jsx)(je,{value:"totalTime",children:qe}),e[109]=qe,e[110]=ke):ke=e[110];let $e;e[111]!==a?($e=a("Avg time"),e[111]=a,e[112]=$e):$e=e[112];let Me;e[113]!==$e?(Me=(0,t.jsx)(je,{value:"avgTime",children:$e}),e[113]=$e,e[114]=Me):Me=e[114];let _e;e[115]!==a?(_e=a("Execution count"),e[115]=a,e[116]=_e):_e=e[116];let De;e[117]!==_e?(De=(0,t.jsx)(je,{value:"execCount",children:_e}),e[117]=_e,e[118]=De):De=e[118];let Ie;e[119]!==a?(Ie=a("Rows read"),e[119]=a,e[120]=Ie):Ie=e[120];let Ce;e[121]!==Ie?(Ce=(0,t.jsx)(je,{value:"rowsRead",children:Ie}),e[121]=Ie,e[122]=Ce):Ce=e[122];let Re;e[123]!==ke||e[124]!==Me||e[125]!==De||e[126]!==Ce?(Re=(0,t.jsxs)(Rt,{children:[ke,Me,De,Ce]}),e[123]=ke,e[124]=Me,e[125]=De,e[126]=Ce,e[127]=Re):Re=e[127];let ze;e[128]!==r||e[129]!==we||e[130]!==Re?(ze=(0,t.jsxs)(Dt,{onValueChange:w,value:r,children:[we,Re]}),e[128]=r,e[129]=we,e[130]=Re,e[131]=ze):ze=e[131];let Oe;e[132]!==Ne||e[133]!==ze?(Oe=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,ze]}),e[132]=Ne,e[133]=ze,e[134]=Oe):Oe=e[134],e[135]!==ve||e[136]!==Oe?(x=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Oe]}),e[135]=ve,e[136]=Oe,e[137]=x):x=e[137],m=fe;let Ke;e[138]!==a?(Ke=a("Statements"),e[138]=a,e[139]=Ke):Ke=e[139];let Fe;e[140]!==Ke?(Fe=(0,t.jsx)(Te,{children:Ke}),e[140]=Ke,e[141]=Fe):Fe=e[141],M=(0,t.jsxs)(Ae,{children:[Fe,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:D.length})})]}),h=pe,y="space-y-2";let Je;e[142]!==n||e[143]!==a?(Je=o(z=>{let ue=z.normalizedSql,J=n.has(ue),he=Ve(z.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":J,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{K(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(sr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:z.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(z.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(z.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),z.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(z.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Be(z.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),J&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:z.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[z.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(z.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(z.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(z.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(z.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(z.rowsWritten)})]})]})]})]},ue)},"Ee"),e[142]=n,e[143]=a,e[144]=Je):Je=e[144],q=D.map(Je)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=h,e[7]=m,e[8]=g,e[9]=y,e[10]=q,e[11]=M,e[12]=d,e[13]=p,e[14]=f,e[15]=x}else h=e[6],m=e[7],g=e[8],y=e[9],q=e[10],M=e[11],d=e[12],p=e[13],f=e[14],x=e[15];if(g!==Symbol.for("react.early_return_sentinel"))return g;let k;e[145]!==y||e[146]!==q?(k=(0,t.jsx)("div",{className:y,children:q}),e[145]=y,e[146]=q,e[147]=k):k=e[147];let _;e[148]!==h||e[149]!==k?(_=(0,t.jsx)(h,{children:k}),e[148]=h,e[149]=k,e[150]=_):_=e[150];let N;e[151]!==m||e[152]!==_||e[153]!==M?(N=(0,t.jsxs)(m,{children:[M,_]}),e[151]=m,e[152]=_,e[153]=M,e[154]=N):N=e[154];let I;return e[155]!==N||e[156]!==d||e[157]!==p||e[158]!==f||e[159]!==x?(I=(0,t.jsxs)("div",{className:d,"data-testid":p,children:[f,x,N]}),e[155]=N,e[156]=d,e[157]=p,e[158]=f,e[159]=x,e[160]=I):I=e[160],I},"nr");function ir(s){return Ve(s.avgDurationMs)==="critical"}o(ir,"ir");function or(s){return Ve(s.avgDurationMs)==="warning"}o(or,"or");function dr(s){return Ve(s.avgDurationMs)==="good"}o(dr,"cr");var cr=["1m","5m","15m","1h"],mr=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"mr"),ur=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:mr(e.bucketMs)})),"ur"),hr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,j.useState)("15m"),r=Ee(Le.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,c=ur(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:cr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),c.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ze,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:c,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ze,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:c,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(nr,{queryStats:r?.entries??[]})]})},"hr"),gr=gt(Le.getMetrics),fr=o((s,e)=>s?e:"overview","fr"),Er=o(({initialShardKey:s})=>{let e=ct(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:c}=$t(s),[i,n]=(0,j.useState)("overview"),[S,v]=(0,j.useState)([]),w=(0,j.useRef)(null),h=(0,j.useRef)(null),m=(0,j.useRef)(!0);(0,j.useEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]);let g=Ot(a),{data:y,error:q,liveError:M}=Ee(Le.getMetrics,{},{live:!0,shardKey:a}),d=y??null;(0,j.useEffect)(()=>{if(y===void 0)return;qt(a);let K=y,E=w.current,Q=h.current!==null&&h.current!==K.shard;if(h.current=K.shard,w.current=K.requests,Q){v([]);return}E!==null&&K.requests>=E&&v(A=>[...A,K.requests-E].slice(-30))},[y,a]);let[p,f]=(0,j.useState)(null),[x,k]=(0,j.useState)(!1),_=o(async()=>{k(!0);let K=Lt(c,wt());try{let E=await Promise.all(K.map(async Q=>{try{let A=await e.query(gr,{},ft(Q));return{error:null,metrics:A,shard:Q===""?A.shard:Q}}catch(A){return{error:pt(A),metrics:null,shard:Q===""?"__root__":Q}}}));m.current&&f(E)}finally{m.current&&k(!1)}},"_"),N=p===null?null:Kt(p),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,D=S.length>0?S.at(-1):0,C=d?At(d):{p90:0,p95:0},$=(0,j.useMemo)(()=>{if(!d||!("queryStats"in d))return;let K=d.queryStats;if(!(!K||!Array.isArray(K)))return Tt(K)},[d]),b=fr($!==void 0,i),R=o(()=>{bt(_())},"D"),O=o(()=>{f(null)},"L"),L=o(()=>{n("overview")},"O"),T=o(()=>{n("query-insights")},"A");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(kt,{onChange:r,testId:"mt-shard-input",value:c}),(0,t.jsx)(Mt,{message:M,prefix:"mt"}),(0,t.jsx)(Ye,{"data-testid":"mt-aggregate",disabled:x,onClick:R,size:"sm",type:"button",variant:"secondary",children:l(x?"Aggregating\u2026":"All shards")}),p!==null&&(0,t.jsx)(Ye,{"data-testid":"mt-aggregate-clear",onClick:O,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:_t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),$!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${b==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:L,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${b==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:T,type:"button",children:[l("Query insights"),$.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:$.length})]})]}),b==="query-insights"&&$!==void 0&&(0,t.jsx)(hr,{shardKey:a}),b==="overview"&&d!==null&&(0,t.jsx)(ar,{currentDelta:D,errorRate:I,history:S,latencyPercentiles:C,metrics:d}),b==="overview"&&d===null&&null,b==="overview"&&(0,t.jsx)(Zt,{onOpenTrace:g,shardKey:a}),b==="overview"&&N!==null&&p!==null&&(0,t.jsx)(er,{aggregate:N,shardResults:p})]})},"Ur");export{Er as MetricsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as we}from"./chunk-LZFOZFYW.js";import{a as Ne,c as ve,d as ye}from"./chunk-K2E4OECF.js";import{a as ge}from"./chunk-3DH35OZ5.js";import{a as xe}from"./chunk-IGCNMZSB.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as fe}from"./chunk-3CWGJYBB.js";import{a as pe}from"./chunk-RMN2JN4S.js";import{b as he}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as me}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as oe}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as be}from"./chunk-ZBVGZ4YA.js";import"./chunk-XXQUMVWH.js";import"./chunk-56Q3NCCQ.js";import"./chunk-QLQADHFE.js";import{a as ce}from"./chunk-VDW32UET.js";import{c as ie}from"./chunk-KMT6UDR7.js";import"./chunk-WVU7GHTG.js";import"./chunk-XBDKZZ67.js";import{a as ue}from"./chunk-XQCVZAGU.js";import{d as W,r as de}from"./chunk-IUYFXK4X.js";import"./chunk-BR5GIQWK.js";import{a as m,e as le,f as _e,g as $e,h as Ce,j as te}from"./chunk-3XIESWL4.js";var B=le($e(),1),O=le(_e(),1);var s=le(Ce(),1);var Me=m(n=>Math.min(100,Math.max(0,n)),"ie"),Le=m((n,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=Me(n.offsetMs/e*100),a=n.durationMs/e*100,l=Math.max(.5,Math.min(Me(a),100-t));return{leftPercent:t,widthPercent:l}},"_e"),Te=m((n,e,t=!1)=>{let a=e.trim().toLowerCase(),l=t?n.filter(r=>!r.ok):n;return a===""?[...l]:l.filter(r=>r.rootName.toLowerCase().includes(a)||r.functionPath.toLowerCase().includes(a)||r.traceId.toLowerCase().includes(a)||r.spans.some(o=>o.name.toLowerCase().includes(a)||o.spanId.toLowerCase().includes(a)))},"Te"),j=m(n=>Number.isFinite(n)?n>0&&n<1?`${n.toFixed(2)}ms`:`${String(Math.round(n))}ms`:"\u2014","U"),Pe=m(n=>!Number.isFinite(n)||n<=0?[]:Array.from({length:4},(e,t)=>{let a=(t+1)/4;return{label:j(n*a),percent:a*100}}),"Le"),Ie=m(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}},"ue"),ee=m(n=>{let e=(0,B.c)(7),{label:t,value:a}=n,l;e[0]!==t?(l=(0,s.jsx)("dt",{className:"w-40 shrink-0 text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1];let r;e[2]!==a?(r=(0,s.jsx)("dd",{className:"min-w-0 break-all",children:a}),e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==r?(o=(0,s.jsxs)("div",{className:"flex gap-2",children:[l,r]}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o},"V"),Ke=m(n=>{let e=(0,B.c)(68),{span:t}=n,a=W(),l,r,o,d,i,u;if(e[0]!==t.attributes||e[1]!==t.durationMs||e[2]!==t.error||e[3]!==t.events||e[4]!==t.kind||e[5]!==t.offsetMs||e[6]!==t.parentSpanId||e[7]!==t.spanId||e[8]!==a){let $=Object.entries(t.attributes??{}),_;e[15]!==t.events?(_=t.events??[],e[15]=t.events,e[16]=_):_=e[16],l=_,r="border-t border-border bg-background/60 px-3 py-2 font-mono text-xs",o="tr-span-detail";let y;e[17]!==a?(y=a("Span ID"),e[17]=a,e[18]=y):y=e[18];let w;e[19]!==t.spanId||e[20]!==y?(w=(0,s.jsx)(ee,{label:y,value:t.spanId}),e[19]=t.spanId,e[20]=y,e[21]=w):w=e[21];let M;e[22]!==a?(M=a("Parent span ID"),e[22]=a,e[23]=M):M=e[23];let h;e[24]!==t.parentSpanId||e[25]!==a?(h=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=h):h=e[26];let p;e[27]!==h||e[28]!==M?(p=(0,s.jsx)(ee,{label:M,value:h}),e[27]=h,e[28]=M,e[29]=p):p=e[29];let b;e[30]!==a?(b=a("Kind"),e[30]=a,e[31]=b):b=e[31];let C=t.kind??"internal",S;e[32]!==b||e[33]!==C?(S=(0,s.jsx)(ee,{label:b,value:C}),e[32]=b,e[33]=C,e[34]=S):S=e[34];let I;e[35]!==a?(I=a("Started at"),e[35]=a,e[36]=I):I=e[36];let g;e[37]!==t.offsetMs||e[38]!==a?(g=a("+{offset}",{offset:j(t.offsetMs)}),e[37]=t.offsetMs,e[38]=a,e[39]=g):g=e[39];let x;e[40]!==I||e[41]!==g?(x=(0,s.jsx)(ee,{label:I,value:g}),e[40]=I,e[41]=g,e[42]=x):x=e[42];let k;e[43]!==a?(k=a("Duration"),e[43]=a,e[44]=k):k=e[44];let f;e[45]!==t.durationMs?(f=j(t.durationMs),e[45]=t.durationMs,e[46]=f):f=e[46];let N;e[47]!==k||e[48]!==f?(N=(0,s.jsx)(ee,{label:k,value:f}),e[47]=k,e[48]=f,e[49]=N):N=e[49],e[50]!==p||e[51]!==S||e[52]!==x||e[53]!==N||e[54]!==w?(d=(0,s.jsxs)("dl",{className:"flex flex-col gap-1",children:[w,p,S,x,N]}),e[50]=p,e[51]=S,e[52]=x,e[53]=N,e[54]=w,e[55]=d):d=e[55],e[56]!==t.error?(i=t.error!==void 0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1.5","data-testid":"tr-detail-error",children:[(0,s.jsx)("span",{className:"font-semibold text-destructive",children:t.error.type}),(0,s.jsx)("p",{className:"whitespace-pre-wrap break-all text-destructive",children:t.error.message})]}),e[56]=t.error,e[57]=i):i=e[57],u=$.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-attributes",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Attributes")}),(0,s.jsx)("dl",{className:"flex flex-col gap-1",children:$.map(De)})]}),e[0]=t.attributes,e[1]=t.durationMs,e[2]=t.error,e[3]=t.events,e[4]=t.kind,e[5]=t.offsetMs,e[6]=t.parentSpanId,e[7]=t.spanId,e[8]=a,e[9]=l,e[10]=r,e[11]=o,e[12]=d,e[13]=i,e[14]=u}else l=e[9],r=e[10],o=e[11],d=e[12],i=e[13],u=e[14];let c;e[58]!==l||e[59]!==a?(c=l.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-events",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Events")}),(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:l.map(Ee)})]}),e[58]=l,e[59]=a,e[60]=c):c=e[60];let v;return e[61]!==r||e[62]!==o||e[63]!==d||e[64]!==i||e[65]!==u||e[66]!==c?(v=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,i,u,c]}),e[61]=r,e[62]=o,e[63]=d,e[64]=i,e[65]=u,e[66]=c,e[67]=v):v=e[67],v},"Pe");function De(n){let[e,t]=n;return(0,s.jsx)(ee,{label:e,value:Ie(t)},e)}m(De,"Ce");function Fe(n){let[e,t]=n;return`${e}=${Ie(t)}`}m(Fe,"Fe");function Ee(n){return(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:de(n.ts)}),(0,s.jsx)(oe,{variant:"secondary",children:n.name}),(0,s.jsx)("span",{className:"min-w-0 break-all text-muted-foreground",children:Object.entries(n.attributes??{}).map(Fe).join(" ")})]},`${n.name}:${String(n.ts)}`)}m(Ee,"Ke");var Ae=14,Se="grid grid-cols-[14rem_1fr_4rem_16rem_16rem] items-center gap-2 px-3",Oe=m(n=>{let e=(0,B.c)(17),{traceDurationMs:t}=n,a,l,r,o,d,i;if(e[0]!==t){i=Symbol.for("react.early_return_sentinel");e:{let v=Pe(t);if(v.length===0){i=null;break e}e[7]===Symbol.for("react.memo_cache_sentinel")?(r=te(Se,"border-b border-border py-1 font-mono text-[10px] text-muted-foreground"),e[7]=r):r=e[7],o="tr-ruler",e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("span",{}),e[8]=d):d=e[8],a="relative h-3",l=v.map(Je)}e[0]=t,e[1]=a,e[2]=l,e[3]=r,e[4]=o,e[5]=d,e[6]=i}else a=e[1],l=e[2],r=e[3],o=e[4],d=e[5],i=e[6];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;e[9]!==a||e[10]!==l?(u=(0,s.jsx)("span",{className:a,children:l}),e[9]=a,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==o||e[14]!==d||e[15]!==u?(c=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,u]}),e[12]=r,e[13]=o,e[14]=d,e[15]=u,e[16]=c):c=e[16],c},"je"),Be=m(n=>{let e=(0,B.c)(60),{span:t,traceDurationMs:a}=n,l=W(),[r,o]=(0,O.useState)(!1),d;e[0]!==t||e[1]!==a?(d=Le(t,a),e[0]=t,e[1]=a,e[2]=d):d=e[2];let{leftPercent:i,widthPercent:u}=d,c;e[3]!==t.attributes?(c=Ne(t.attributes),e[3]=t.attributes,e[4]=c):c=e[4];let v=c,$=t.depth*Ae,_;e[5]!==$?(_={paddingLeft:$},e[5]=$,e[6]=_):_=e[6];let y=_,w=`${String(i)}%`,M=`${String(u)}%`,h;e[7]!==w||e[8]!==M?(h={left:w,width:M},e[7]=w,e[8]=M,e[9]=h):h=e[9];let p=h,b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m(()=>{o(Ue)},"h"),e[10]=b):b=e[10];let C=b,S=t.depth,I=`tr-span-detail-${t.spanId}`,g;e[11]!==t.durationMs||e[12]!==t.error||e[13]!==t.name||e[14]!==t.offsetMs||e[15]!==l?(g=l("{name}, {duration}, starts {offset} in{failure}",{duration:j(t.durationMs),failure:t.error===void 0?"":l(", failed: {message}",{message:t.error.message}),name:t.name,offset:j(t.offsetMs)}),e[11]=t.durationMs,e[12]=t.error,e[13]=t.name,e[14]=t.offsetMs,e[15]=l,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=te(Se,"w-full border-b border-border py-1.5 text-left font-mono text-xs hover:bg-muted/50"),e[17]=x):x=e[17];let k=`tr-span-toggle-${t.spanId}`,f;e[18]!==t.ok?(f=t.ok?null:(0,s.jsx)("span",{"aria-hidden":"true",className:"mr-1 text-destructive","data-testid":"tr-span-error",children:"\u25CF"}),e[18]=t.ok,e[19]=f):f=e[19];let N;e[20]!==y||e[21]!==t.name||e[22]!==f?(N=(0,s.jsxs)("span",{className:"truncate",style:y,title:t.name,children:[f,t.name]}),e[20]=y,e[21]=t.name,e[22]=f,e[23]=N):N=e[23];let R=t.ok?"bg-primary/70":"bg-destructive",L;e[24]!==R?(L=te("absolute inset-y-0 rounded-sm",R),e[24]=R,e[25]=L):L=e[25];let A;e[26]!==p||e[27]!==i||e[28]!==L||e[29]!==u?(A=(0,s.jsx)("span",{"aria-hidden":"true",className:"relative h-3 overflow-hidden rounded-sm bg-muted",children:(0,s.jsx)("span",{className:L,"data-left":i,"data-testid":"tr-span-bar","data-width":u,style:p})}),e[26]=p,e[27]=i,e[28]=L,e[29]=u,e[30]=A):A=e[30];let J;e[31]!==t.durationMs?(J=j(t.durationMs),e[31]=t.durationMs,e[32]=J):J=e[32];let D;e[33]!==J?(D=(0,s.jsx)("span",{className:"text-right tabular-nums text-muted-foreground",children:J}),e[33]=J,e[34]=D):D=e[34];let U;e[35]!==t.error?(U=t.error===void 0?null:(0,s.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=U):U=e[36];let T;e[37]!==U?(T=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:U}),e[37]=U,e[38]=T):T=e[38];let q;e[39]!==v?(q=v===""?null:(0,s.jsx)("span",{"data-testid":"tr-span-attributes",title:v,children:v}),e[39]=v,e[40]=q):q=e[40];let P;e[41]!==q?(P=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:q}),e[41]=q,e[42]=P):P=e[42];let z;e[43]!==r||e[44]!==I||e[45]!==g||e[46]!==k||e[47]!==N||e[48]!==A||e[49]!==D||e[50]!==T||e[51]!==P?(z=(0,s.jsxs)("button",{"aria-controls":I,"aria-expanded":r,"aria-label":g,className:x,"data-testid":k,onClick:C,type:"button",children:[N,A,D,T,P]}),e[43]=r,e[44]=I,e[45]=g,e[46]=k,e[47]=N,e[48]=A,e[49]=D,e[50]=T,e[51]=P,e[52]=z):z=e[52];let F;e[53]!==r||e[54]!==t?(F=r&&(0,s.jsx)("div",{id:`tr-span-detail-${t.spanId}`,children:(0,s.jsx)(Ke,{span:t})}),e[53]=r,e[54]=t,e[55]=F):F=e[55];let K;return e[56]!==t.depth||e[57]!==z||e[58]!==F?(K=(0,s.jsxs)("li",{"data-depth":S,"data-testid":"tr-span-row",children:[z,F]}),e[56]=t.depth,e[57]=z,e[58]=F,e[59]=K):K=e[59],K},"Ee"),Re=m(n=>{let e=(0,B.c)(15),{durationMs:t,spans:a}=n,l=W(),r;e[0]!==t?(r=(0,s.jsx)(Oe,{traceDurationMs:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==l?(o=l("Trace waterfall"),e[2]=l,e[3]=o):o=e[3];let d;if(e[4]!==t||e[5]!==a){let c;e[7]!==t?(c=m(v=>(0,s.jsx)(Be,{span:v,traceDurationMs:t},v.spanId),"c"),e[7]=t,e[8]=c):c=e[8],d=a.map(c),e[4]=t,e[5]=a,e[6]=d}else d=e[6];let i;e[9]!==o||e[10]!==d?(i=(0,s.jsx)("ul",{"aria-label":o,children:d}),e[9]=o,e[10]=d,e[11]=i):i=e[11];let u;return e[12]!==r||e[13]!==i?(u=(0,s.jsxs)(s.Fragment,{children:[r,i]}),e[12]=r,e[13]=i,e[14]=u):u=e[14],u},"Ae");function Je(n){return(0,s.jsx)("span",{className:te("absolute inset-y-0 border-l border-border/70",n.percent===100?"-translate-x-full pr-1":"pl-1"),style:{left:`${String(n.percent)}%`},children:n.label},n.percent)}m(Je,"Be");function Ue(n){return!n}m(Ue,"Oe");var qe=m(n=>Array.isArray(n?.traces)?n.traces:[],"Re"),ze=m(n=>{let e=(0,B.c)(12),{entries:t}=n,a=W(),l;e[0]!==t.length||e[1]!==a?(l=a("Logs ({count})",{count:t.length}),e[0]=t.length,e[1]=a,e[2]=l):l=e[2];let r;e[3]!==l?(r=(0,s.jsx)("p",{className:"mb-1 font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==t?(o=t.map(je),e[5]=t,e[6]=o):o=e[6];let d;e[7]!==o?(d=(0,s.jsx)("div",{role:"grid",children:o}),e[7]=o,e[8]=d):d=e[8];let i;return e[9]!==r||e[10]!==d?(i=(0,s.jsxs)("div",{className:"border-t border-border px-3 py-2","data-testid":"tr-logs",children:[r,d]}),e[9]=r,e[10]=d,e[11]=i):i=e[11],i},"Je"),We=m(n=>{let e=(0,B.c)(50),{expanded:t,logs:a,onToggle:l,trace:r}=n,o=W(),d;e[0]!==l||e[1]!==r.traceId?(d=m(()=>{l(r.traceId)},"d"),e[0]=l,e[1]=r.traceId,e[2]=d):d=e[2];let i=d,u=`tr-row-${r.traceId}`,c=`tr-waterfall-${r.traceId}`,v=`tr-toggle-${r.traceId}`,$=t?"\u25BE":"\u25B8",_;e[3]!==$?(_=(0,s.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:$}),e[3]=$,e[4]=_):_=e[4];let y;e[5]!==r.rootName?(y=(0,s.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=y):y=e[6];let w;e[7]!==r.functionPath?(w=(0,s.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let M;e[9]!==r.durationMs?(M=j(r.durationMs),e[9]=r.durationMs,e[10]=M):M=e[10];let h;e[11]!==M?(h=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:M}),e[11]=M,e[12]=h):h=e[12];let p;e[13]!==o||e[14]!==r.spans.length?(p=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=p):p=e[15];let b;e[16]!==p?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:p}),e[16]=p,e[17]=b):b=e[17];let C=r.ok?"secondary":"destructive",S;e[18]!==o||e[19]!==r.ok?(S=r.ok?o("ok"):o("error"),e[18]=o,e[19]=r.ok,e[20]=S):S=e[20];let I;e[21]!==C||e[22]!==S?(I=(0,s.jsx)("span",{className:"shrink-0",children:(0,s.jsx)(oe,{variant:C,children:S})}),e[21]=C,e[22]=S,e[23]=I):I=e[23];let g;e[24]!==r.startTs?(g=de(r.startTs),e[24]=r.startTs,e[25]=g):g=e[25];let x;e[26]!==g?(x=(0,s.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let k;e[28]!==t||e[29]!==i||e[30]!==h||e[31]!==b||e[32]!==I||e[33]!==x||e[34]!==c||e[35]!==v||e[36]!==_||e[37]!==y||e[38]!==w?(k=(0,s.jsxs)("button",{"aria-controls":c,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":v,onClick:i,type:"button",children:[_,y,w,h,b,I,x]}),e[28]=t,e[29]=i,e[30]=h,e[31]=b,e[32]=I,e[33]=x,e[34]=c,e[35]=v,e[36]=_,e[37]=y,e[38]=w,e[39]=k):k=e[39];let f;e[40]!==t||e[41]!==a||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(f=t&&(0,s.jsxs)("div",{className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,children:[(0,s.jsx)(Re,{durationMs:r.durationMs,spans:r.spans}),a.length>0&&(0,s.jsx)(ze,{entries:a})]}),e[40]=t,e[41]=a,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=f):f=e[45];let N;return e[46]!==k||e[47]!==f||e[48]!==u?(N=(0,s.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":u,children:[k,f]}),e[46]=k,e[47]=f,e[48]=u,e[49]=N):N=e[49],N},"ze"),ut=m(n=>{let e=(0,B.c)(58),{initialShardKey:t}=n,a=W(),[l]=(0,O.useState)(ve),{queryShardKey:r,setShardKey:o,shardKey:d}=fe(l?.shardKey!==void 0&&l.shardKey!==""?l.shardKey:t??""),[i,u]=(0,O.useState)(l?.traceId??""),[c,v]=(0,O.useState)(!1),[$,_]=(0,O.useState)(He),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,O.useEffect)(Ge,y);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={},e[1]=w):w=e[1];let M;e[2]!==r?(M={live:!0,shardKey:r},e[2]=r,e[3]=M):M=e[3];let{data:h,error:p,errorSource:b,isLoading:C,liveError:S}=ie(ce.getTraces,w,M),I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={},e[4]=I):I=e[4];let g=$.size>0,x;e[5]!==r||e[6]!==g?(x={enabled:g,live:!0,shardKey:r},e[5]=r,e[6]=g,e[7]=x):x=e[7];let{data:k}=ie(ce.getLogs,I,x),f,N;e[8]!==h||e[9]!==r?(f=m(()=>{h!==void 0&&he(r)},"p"),N=[h,r],e[8]=h,e[9]=r,e[10]=f,e[11]=N):(f=e[10],N=e[11]),(0,O.useEffect)(f,N);let R;if(e[12]!==h||e[13]!==p||e[14]!==b||e[15]!==$||e[16]!==C||e[17]!==S||e[18]!==k?.entries||e[19]!==c||e[20]!==i||e[21]!==o||e[22]!==d||e[23]!==a){let L=qe(h),A=h?.total??L.length,J=A>L.length,D=Te(L,i,c),U=Map.groupBy((k?.entries??[]).toReversed(),Qe),T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=m(E=>{u(E.target.value)},"P"),e[25]=T):T=e[25];let q=T,P;e[26]===Symbol.for("react.memo_cache_sentinel")?(P=m(E=>{_(ke=>{let ne=new Set(ke);return ne.has(E)?ne.delete(E):ne.add(E),ne})},"C"),e[26]=P):P=e[26];let z=P,F=p===null&&D.length===0&&!C,K;e[27]!==o||e[28]!==d?(K=(0,s.jsx)(pe,{onChange:o,testId:"tr-shard-input",value:d}),e[27]=o,e[28]=d,e[29]=K):K=e[29];let H;e[30]!==a?(H=a("Search traces"),e[30]=a,e[31]=H):H=e[31];let G;e[32]!==a?(G=a("search trace, span, or function"),e[32]=a,e[33]=G):G=e[33];let Q;e[34]!==i||e[35]!==H||e[36]!==G?(Q=(0,s.jsx)(me,{"aria-label":H,className:"h-8 w-56","data-testid":"tr-search",onChange:q,placeholder:G,value:i}),e[34]=i,e[35]=H,e[36]=G,e[37]=Q):Q=e[37];let V;e[38]!==c?(V=(0,s.jsx)(ge,{checked:c,"data-testid":"tr-only-errors",id:"tr-only-errors",onCheckedChange:v}),e[38]=c,e[39]=V):V=e[39];let X;e[40]!==a?(X=a("Errors only"),e[40]=a,e[41]=X):X=e[41];let Y;e[42]!==V||e[43]!==X?(Y=(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",htmlFor:"tr-only-errors",children:[V,X]}),e[42]=V,e[43]=X,e[44]=Y):Y=e[44];let Z;e[45]!==S?(Z=(0,s.jsx)(xe,{message:S,prefix:"tr"}),e[45]=S,e[46]=Z):Z=e[46];let re;e[47]!==K||e[48]!==Q||e[49]!==Y||e[50]!==Z?(re=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K,Q,Y,Z]}),e[47]=K,e[48]=Q,e[49]=Y,e[50]=Z,e[51]=re):re=e[51];let ae;e[52]!==p||e[53]!==b?(ae=p!==null&&(0,s.jsx)(be,{error:b,testId:"tr-error"}),e[52]=p,e[53]=b,e[54]=ae):ae=e[54];let se;e[55]!==F||e[56]!==a?(se=F&&(0,s.jsx)(ue,{description:a("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:a("No traces")}),e[55]=F,e[56]=a,e[57]=se):se=e[57],R=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[re,ae,se,p===null&&J&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:a("Showing the {shown} most recent of {total} traces in the buffer.",{shown:L.length,total:A})}),p===null&&D.length>0&&(0,s.jsx)("div",{"aria-label":a("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:D.map(E=>(0,s.jsx)(We,{expanded:$.has(E.traceId),logs:U.get(E.traceId)??[],onToggle:z,trace:E},E.traceId))})]}),e[12]=h,e[13]=p,e[14]=b,e[15]=$,e[16]=C,e[17]=S,e[18]=k?.entries,e[19]=c,e[20]=i,e[21]=o,e[22]=d,e[23]=a,e[24]=R}else R=e[24];return R},"ft");function je(n,e){return(0,s.jsx)("div",{className:"flex items-center border-b border-border py-1 font-mono text-xs last:border-b-0","data-testid":"tr-log-row",role:"row",children:(0,s.jsx)(we,{entry:n})},`${String(e)}:${String(n.timestamp)}`)}m(je,"Ue");function He(){return new Set}m(He,"We");function Ge(){ye()}m(Ge,"qe");function Qe(n){return n.traceId}m(Qe,"He");export{ut as default};
|