@lunora/studio 1.0.0-alpha.103 → 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-NVY2U3IB.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-CJQ2534J.js +1 -0
- 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-ICUATQ6I.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-FGMDIASJ.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-AB5HDI3T.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-PLFTCTMX.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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as k}from"react/compiler-runtime";import{RouterProvider as Gt,createRootRoute as ea,createRoute as Mt,createBrowserHistory as ta,createMemoryHistory as aa,createRouter as ra,useSearch as sa,useNavigate as Tt,useRouterState as na,Outlet as oa}from"@tanstack/react-router";import*as st from"react";import{useState as it,useEffect as nt,use as Nt,createContext as At,useSyncExternalStore as ia,lazy as T,Suspense as la}from"react";import{c as P}from"./utils-bhneXptQ.js";import{jsx as s,jsxs as x,Fragment as zt}from"react/jsx-runtime";import{ErrorBoundary as da}from"./ErrorBoundary-DvzYskH7.js";import{O as ca,u as ua}from"./operation-console-provider-BMJNtiyB.js";import{useT as ee}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{LunoraError as Et}from"@lunora/errors";import{g as lt}from"./badge-BbuuAio7.js";import{u as Rt}from"./input-JHu63lTv.js";import{Popover as ot}from"@base-ui/react/popover";import{Cancel01Icon as ha,SidebarLeftIcon as ma}from"@hugeicons/core-free-icons";import{HugeiconsIcon as Ht}from"@hugeicons/react";import{mergeProps as It}from"@base-ui/react/merge-props";import{useRender as Kt}from"@base-ui/react/use-render";import{cva as pa}from"class-variance-authority";import{u as Vt}from"./button-BkCrNcAs.js";import{Dialog as ae}from"@base-ui/react/dialog";import{Tooltip as te}from"@base-ui/react/tooltip";import{n as vt}from"./skeleton-C1wQ9M5t.js";import{H as fa,S as ga}from"./home-panel-Ir3YHReO.js";import{c as ba,f as wt}from"./internal-zkEvTqy8.js";import{y as mt}from"./use-admin-query-CnnyWJXM.js";import{StudioI18nProvider as va}from"./StudioI18nProvider-CZ5h4nrV.js";import{v as ya,a as xa}from"./data-view-params-ClrV7XgF.js";import{CommandPalette as wa,openCommandPalette as ka}from"./CommandPalette-mPR8-vIm.js";import{motion as Na}from"motion/react";const Zt="(prefers-color-scheme: dark)",Ot=()=>{try{return globalThis.localStorage}catch{return}},Sa=t=>t==="system"||t==="light"||t==="dark",qt=()=>globalThis.matchMedia,Bt="lunora-studio-theme",yt=["system","light","dark"],Ma=(t="system")=>{try{const e=Ot()?.getItem(Bt);return Sa(e)?e:t}catch{return t}},Ct=t=>{const e=Ot();if(e!==void 0)try{e.setItem(Bt,t)}catch{}},Ca=()=>{try{return qt()?.(Zt).matches?"dark":"light"}catch{return"light"}},_a=(t,e)=>t==="system"?e:t,La=t=>{let e;try{e=qt()?.(Zt)}catch{e=void 0}if(e===void 0)return()=>{};const a=r=>{t(r.matches?"dark":"light")};return e.addEventListener("change",a),()=>{e.removeEventListener("change",a)}},St=At(null),$a=({children:t,defaultTheme:e="system"})=>{const[a,r]=it(()=>Ma(e)),[n,o]=it(()=>Ca());nt(()=>La(o),[]);const i=d=>{Ct(d),r(d)},l={cycleTheme:()=>{r(d=>{const u=yt[(yt.indexOf(d)+1)%yt.length]??d;return Ct(u),u})},resolvedTheme:_a(a,n),setTheme:i,systemTheme:n,theme:a};return s(St,{value:l,children:t})},Pa=t=>{const e=k(3),{children:a}=t,r=Nt(St);let n;return e[0]!==a||e[1]!==r?(n=r===null?s($a,{children:a}):a,e[0]=a,e[1]=r,e[2]=n):n=e[2],n},Ta=()=>{const t=Nt(St);if(t===null)throw new Et("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function hn({delay:t=0,...e}){return s(te.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function Aa(t){const e=k(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(te.Root,{"data-slot":"tooltip",...a}),e[2]=a,e[3]=r):r=e[3],r}function za(t){const e=k(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(te.Trigger,{"data-slot":"tooltip-trigger",...a}),e[2]=a,e[3]=r):r=e[3],r}function Ea({className:t,side:e="top",sideOffset:a=4,align:r="center",alignOffset:n=0,children:o,...i}){return s(te.Portal,{children:s(te.Positioner,{align:r,alignOffset:n,side:e,sideOffset:a,className:"isolate z-50",children:x(te.Popup,{"data-slot":"tooltip-content",className:P("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),...i,children:[o,s(te.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"})]})})})}const Ra=t=>{const e=k(5),{className:a}=t;let r;e[0]!==a?(r=P("h-full w-full text-foreground",a),e[0]=a,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s("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 o;return e[3]!==r?(o=s("svg",{"aria-hidden":"true",className:r,fill:"currentColor",viewBox:"0 0 543 446",children:n}),e[3]=r,e[4]=o):o=e[4],o},Dt="lunora.studio.rulesBannerDismissed",Ha=()=>{try{return globalThis.localStorage.getItem(Dt)==="1"}catch{return!1}},Ia=()=>{try{globalThis.localStorage.setItem(Dt,"1")}catch{}},Ka=()=>{const t=k(18),e=ee(),[a,r]=it(Va);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{r(!0),Ia()},t[0]=n):n=t[0];const o=n;if(a)return null;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),t[1]=i):i=t[1];let l;t[2]!==e?(l=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=l):l=t[3];let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=s("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=d):d=t[4];let u;t[5]!==e?(u=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==l||t[8]!==u?(c=x("span",{children:[l," ",d," ",u]}),t[7]=l,t[8]=u,t[9]=c):c=t[9];let p;t[10]!==e?(p=e("Dismiss"),t[10]=e,t[11]=p):p=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:s("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=g):g=t[12];let h;t[13]!==p?(h=s("button",{"aria-label":p,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:o,type:"button",children:g}),t[13]=p,t[14]=h):h=t[14];let f;return t[15]!==c||t[16]!==h?(f=x("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:[i,c,h]}),t[15]=c,t[16]=h,t[17]=f):f=t[17],f};function Va(){return Ha()}function Wt(t){const e=k(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(ot.Root,{"data-slot":"popover",...a}),e[2]=a,e[3]=r):r=e[3],r}function jt(t){const e=k(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(ot.Trigger,{"data-slot":"popover-trigger",...a}),e[2]=a,e[3]=r):r=e[3],r}function Ft({align:t="end",alignOffset:e=0,className:a,keepMounted:r=!1,side:n="bottom",sideOffset:o=6,...i}){return s(ot.Portal,{keepMounted:r,children:s(ot.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:n,sideOffset:o,children:s(ot.Popup,{className:P("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",a),"data-slot":"popover-content",...i})})})}const xt=768;function Za(){const t=k(2),[e,a]=it(void 0);let r,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=globalThis.matchMedia(`(max-width: ${xt-1}px)`),i=()=>{a(globalThis.innerWidth<xt)};return o.addEventListener("change",i),a(globalThis.innerWidth<xt),()=>{o.removeEventListener("change",i)}},n=[],t[0]=r,t[1]=n):(r=t[0],n=t[1]),nt(r,n),!!e}function Oa(t){const e=k(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(ae.Root,{"data-slot":"sheet",...a}),e[2]=a,e[3]=r):r=e[3],r}function qa(t){const e=k(4);let a;e[0]!==t?({...a}=t,e[0]=t,e[1]=a):a=e[1];let r;return e[2]!==a?(r=s(ae.Portal,{"data-slot":"sheet-portal",...a}),e[2]=a,e[3]=r):r=e[3],r}function Ba(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("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:",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s(ae.Backdrop,{"data-slot":"sheet-overlay",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function Da({className:t,children:e,side:a="right",showCloseButton:r=!0,...n}){return x(qa,{children:[s(Ba,{}),x(ae.Popup,{"data-slot":"sheet-content","data-side":a,className:P("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&&x(ae.Close,{"data-slot":"sheet-close",render:s(Vt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[s(Ht,{icon:ha,strokeWidth:2}),s("span",{className:"sr-only",children:"Close"})]})]})]})}function Wa(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("flex flex-col gap-0.5 p-4",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sheet-header",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function ja(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("text-sm font-medium text-foreground",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s(ae.Title,{"data-slot":"sheet-title",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function Fa(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("text-xs/relaxed text-muted-foreground",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s(ae.Description,{"data-slot":"sheet-description",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}const Ua="sidebar_state",Qa=3600*24*7,Ja="16rem",Xa="18rem",Ya="3rem",Ga="b",Ut=st.createContext(null);function pt(){const t=st.useContext(Ut);if(!t)throw new Et("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function er({defaultOpen:t=!0,open:e,onOpenChange:a,className:r,style:n,children:o,...i}){const l=Za(),[d,u]=st.useState(!1),[c,p]=st.useState(t),g=e??c,h=m=>{const y=typeof m=="function"?m(g):m;a?a(y):p(y),document.cookie=`${Ua}=${y}; path=/; max-age=${Qa}`},f=()=>l?u(m=>!m):h(m=>!m),v=st.useEffectEvent(()=>{f()});st.useEffect(()=>{const m=y=>{y.key===Ga&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),v())};return globalThis.addEventListener("keydown",m),()=>globalThis.removeEventListener("keydown",m)},[]);const b={state:g?"expanded":"collapsed",open:g,setOpen:h,isMobile:l,openMobile:d,setOpenMobile:u,toggleSidebar:f};return s(Ut.Provider,{value:b,children:s("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ja,"--sidebar-width-icon":Ya,...n},className:P("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...i,children:o})})}function tr({side:t="left",variant:e="sidebar",collapsible:a="offcanvas",className:r,children:n,dir:o,...i}){const{isMobile:l,state:d,openMobile:u,setOpenMobile:c}=pt();return a==="none"?s("div",{"data-slot":"sidebar",className:P("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...i,children:n}):l?s(Oa,{open:u,onOpenChange:c,...i,children:x(Da,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Xa},side:t,children:[x(Wa,{className:"sr-only",children:[s(ja,{children:"Sidebar"}),s(Fa,{children:"Displays the mobile sidebar."})]}),s("div",{className:"flex h-full w-full flex-col",children:n})]})}):x("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?a:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[s("div",{"data-slot":"sidebar-gap",className:P("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)")}),s("div",{"data-slot":"sidebar-container","data-side":t,className:P("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),...i,children:s("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})})]})}function ar(t){const e=k(15);let a,r,n;e[0]!==t?({className:a,onClick:r,...n}=t,e[0]=t,e[1]=a,e[2]=r,e[3]=n):(a=e[1],r=e[2],n=e[3]);const{toggleSidebar:o}=pt();let i;e[4]!==a?(i=P(a),e[4]=a,e[5]=i):i=e[5];let l;e[6]!==r||e[7]!==o?(l=p=>{r?.(p),o()},e[6]=r,e[7]=o,e[8]=l):l=e[8];let d,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s(Ht,{icon:ma,strokeWidth:2,className:"rtl:rotate-180"}),u=s("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=d,e[10]=u):(d=e[9],u=e[10]);let c;return e[11]!==n||e[12]!==i||e[13]!==l?(c=x(Vt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:i,onClick:l,...n,children:[d,u]}),e[11]=n,e[12]=i,e[13]=l,e[14]=c):c=e[14],c}function rr(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("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",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("main",{"data-slot":"sidebar-inset",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function sr(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("flex flex-col gap-2 p-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function nr(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("flex flex-col gap-2 p-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function or(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("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",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function ir(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("relative flex w-full min-w-0 flex-col p-2",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function lr(t){const e=k(10);let a,r,n,o;if(e[0]!==t){const{className:d,render:u,...c}=t;a=u,o=Kt,r="div",n=It({className:P("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",d)},c),e[0]=t,e[1]=a,e[2]=r,e[3]=n,e[4]=o}else a=e[1],r=e[2],n=e[3],o=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=i):i=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l={defaultTagName:r,props:n,render:a,state:i},e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],o(l)}function dr(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("w-full text-xs",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function _t(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("flex w-full min-w-0 flex-col gap-0",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}function Lt(t){const e=k(8);let a,r;e[0]!==t?({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]);let n;e[3]!==a?(n=P("group/menu-item relative",a),e[3]=a,e[4]=n):n=e[4];let o;return e[5]!==r||e[6]!==n?(o=s("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...r}),e[5]=r,e[6]=n,e[7]=o):o=e[7],o}const cr=pa("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 Qt({render:t,isActive:e=!1,variant:a="default",size:r="default",tooltip:n,className:o,...i}){const{isMobile:l,state:d}=pt(),u=Kt({defaultTagName:"button",props:It({className:P(cr({variant:a,size:r}),o)},i),render:n?s(za,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:e}});return n?(typeof n=="string"&&(n={children:n}),x(Aa,{children:[u,s(Ea,{side:"right",align:"center",hidden:d!=="collapsed"||l,...n})]})):u}const ur=t=>t.replace("__lunora_admin__:",""),hr=()=>ia(mt.subscribe,mt.getSnapshot,mt.getSnapshot),mr=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",pr=t=>{const e=k(56),{entry:a,focused:r}=t,n=ee();let o;e[0]!==r?(o=R=>{R!==null&&r&&R.scrollIntoView({block:"nearest"})},e[0]=r,e[1]=o):o=e[1];const i=o;let l;e[2]!==a.functionPath||e[3]!==a.shardKey||e[4]!==a.summary?(l=()=>{ba(`${a.functionPath} ${a.summary}${a.shardKey===""?"":` (shard ${a.shardKey})`}`)},e[2]=a.functionPath,e[3]=a.shardKey,e[4]=a.summary,e[5]=l):l=e[5];const d=l,u=r&&"bg-accent ring-1 ring-inset ring-primary/40";let c;e[6]!==u?(c=P("border-b border-border/60 last:border-b-0",u),e[6]=u,e[7]=c):c=e[7];let p;e[8]!==a.status?(p=mr(a.status),e[8]=a.status,e[9]=p):p=e[9];const g=a.status==="pending"?"…":a.status;let h;e[10]!==p||e[11]!==g?(h=s(lt,{className:"mt-px shrink-0",variant:p,children:g}),e[10]=p,e[11]=g,e[12]=h):h=e[12];let f;e[13]!==a.functionPath?(f=ur(a.functionPath),e[13]=a.functionPath,e[14]=f):f=e[14];let v;e[15]!==f?(v=s("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:f}),e[15]=f,e[16]=v):v=e[16];let b;e[17]!==a.kind||e[18]!==n?(b=a.kind==="subscription"&&s(lt,{className:"shrink-0",variant:"outline",children:n("live")}),e[17]=a.kind,e[18]=n,e[19]=b):b=e[19];let m;e[20]!==a.summary?(m=a.summary!==""&&s("span",{className:"min-w-0 truncate text-muted-foreground",children:a.summary}),e[20]=a.summary,e[21]=m):m=e[21];let y;e[22]!==a.shardKey?(y=a.shardKey!==""&&s("span",{className:"font-mono",children:a.shardKey}),e[22]=a.shardKey,e[23]=y):y=e[23];let w;e[24]!==a.resultCount||e[25]!==n?(w=a.resultCount!==void 0&&s("span",{children:n("{count} rows",{count:a.resultCount})}),e[24]=a.resultCount,e[25]=n,e[26]=w):w=e[26];let S;e[27]!==a.pushes||e[28]!==n?(S=a.pushes!==void 0&&a.pushes>0&&s("span",{children:n("{count} pushes",{count:a.pushes})}),e[27]=a.pushes,e[28]=n,e[29]=S):S=e[29];let C;e[30]!==a.durationMs?(C=a.durationMs!==void 0&&x("span",{children:[a.durationMs,"ms"]}),e[30]=a.durationMs,e[31]=C):C=e[31];let _;e[32]!==n?(_=n("Copy"),e[32]=n,e[33]=_):_=e[33];let N;e[34]!==d||e[35]!==_?(N=s("button",{"aria-label":_,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:d,type:"button",children:"⧉"}),e[34]=d,e[35]=_,e[36]=N):N=e[36];let L;e[37]!==y||e[38]!==w||e[39]!==S||e[40]!==C||e[41]!==N?(L=x("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[y,w,S,C,N]}),e[37]=y,e[38]=w,e[39]=S,e[40]=C,e[41]=N,e[42]=L):L=e[42];let M;e[43]!==b||e[44]!==m||e[45]!==L||e[46]!==h||e[47]!==v?(M=x("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[h,v,b,m,L]}),e[43]=b,e[44]=m,e[45]=L,e[46]=h,e[47]=v,e[48]=M):M=e[48];let $;e[49]!==a.error?($=a.error!==void 0&&s("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:a.error}),e[49]=a.error,e[50]=$):$=e[50];let A;return e[51]!==i||e[52]!==M||e[53]!==$||e[54]!==c?(A=x("li",{className:c,"data-testid":"oc-row",ref:i,children:[M,$]}),e[51]=i,e[52]=M,e[53]=$,e[54]=c,e[55]=A):A=e[55],A},fr=t=>{const e=k(62),{focusSeq:a,onClose:r,onShownChange:n,shown:o}=t,i=ee(),l=hr(),[d,u]=it("");let c;if(e[0]!==l||e[1]!==a||e[2]!==d||e[3]!==r||e[4]!==n||e[5]!==o||e[6]!==i){const p=d.trim().toLowerCase(),g=l.filter(z=>(o==="errors"?z.status==="error":!0)&&(p===""||`${z.functionPath} ${z.summary} ${z.shardKey}`.toLowerCase().includes(p))).toReversed();let h;e[8]!==l?(h=l.filter(gr),e[8]=l,e[9]=h):h=e[9];const f=h.length;let v;e[10]!==i?(v=i("Operation console"),e[10]=i,e[11]=v):v=e[11];let b;e[12]!==i?(b=i("Operation console"),e[12]=i,e[13]=b):b=e[13];let m;e[14]!==b?(m=s("span",{className:"text-xs font-medium",children:b}),e[14]=b,e[15]=m):m=e[15];let y;e[16]!==l.length||e[17]!==i?(y=i("{count} calls",{count:l.length}),e[16]=l.length,e[17]=i,e[18]=y):y=e[18];let w;e[19]!==y?(w=s(lt,{variant:"secondary",children:y}),e[19]=y,e[20]=w):w=e[20];let S;e[21]!==f||e[22]!==i?(S=f>0&&s(lt,{variant:"destructive",children:i("{count} failed",{count:f})}),e[21]=f,e[22]=i,e[23]=S):S=e[23];const C=o==="errors",_=o==="errors"&&"bg-accent";let N;e[24]!==_?(N=P("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",_),e[24]=_,e[25]=N):N=e[25];let L;e[26]!==n||e[27]!==o?(L=()=>{n(o==="errors"?"all":"errors")},e[26]=n,e[27]=o,e[28]=L):L=e[28];let M;e[29]!==i?(M=i("Errors"),e[29]=i,e[30]=M):M=e[30];let $;e[31]!==N||e[32]!==L||e[33]!==M||e[34]!==C?($=s("button",{"aria-pressed":C,className:N,"data-testid":"oc-filter-errors",onClick:L,type:"button",children:M}),e[31]=N,e[32]=L,e[33]=M,e[34]=C,e[35]=$):$=e[35];let A;e[36]!==i?(A=i("Filter"),e[36]=i,e[37]=A):A=e[37];let R;e[38]===Symbol.for("react.memo_cache_sentinel")?(R=z=>{u(z.target.value)},e[38]=R):R=e[38];let K;e[39]!==i?(K=i("Filter"),e[39]=i,e[40]=K):K=e[40];let V;e[41]!==d||e[42]!==A||e[43]!==K?(V=s(Rt,{"aria-label":A,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:R,placeholder:K,value:d}),e[41]=d,e[42]=A,e[43]=K,e[44]=V):V=e[44];let H;e[45]!==i?(H=i("Clear"),e[45]=i,e[46]=H):H=e[46];let I;e[47]!==H?(I=s("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:br,type:"button",children:H}),e[47]=H,e[48]=I):I=e[48];let Z;e[49]!==i?(Z=i("Hide"),e[49]=i,e[50]=Z):Z=e[50];let O;e[51]!==r||e[52]!==Z?(O=s("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:"✕"}),e[51]=r,e[52]=Z,e[53]=O):O=e[53];let B;e[54]!==$||e[55]!==V||e[56]!==I||e[57]!==O||e[58]!==m||e[59]!==w||e[60]!==S?(B=x("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[m,w,S,$,V,I,O]}),e[54]=$,e[55]=V,e[56]=I,e[57]=O,e[58]=m,e[59]=w,e[60]=S,e[61]=B):B=e[61],c=x("section",{"aria-label":v,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[B,g.length===0?s("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:i("Every admin call this studio makes is recorded here.")}):s("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:g.map(z=>s(pr,{entry:z,focused:z.seq===a},z.seq))})]}),e[0]=l,e[1]=a,e[2]=d,e[3]=r,e[4]=n,e[5]=o,e[6]=i,e[7]=c}else c=e[7];return c};function gr(t){return t.status==="error"}function br(){mt.clear()}const vr=()=>{const t=k(310),e=ee();let a;t[0]!==e?(a=e("Health score"),t[0]=e,t[1]=a):a=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("Evals"),t[4]=e,t[5]=n):n=t[5];let o;t[6]!==e?(o=e("Analytics"),t[6]=e,t[7]=o):o=t[7];let i;t[8]!==e?(i=e("API"),t[8]=e,t[9]=i):i=t[9];let l;t[10]!==e?(l=e("Audit"),t[10]=e,t[11]=l):l=t[11];let d;t[12]!==e?(d=e("Auth audit"),t[12]=e,t[13]=d):d=t[13];let u;t[14]!==e?(u=e("Configuration"),t[14]=e,t[15]=u):u=t[15];let c;t[16]!==e?(c=e("Sessions"),t[16]=e,t[17]=c):c=t[17];let p;t[18]!==e?(p=e("Containers"),t[18]=e,t[19]=p):p=t[19];let g;t[20]!==e?(g=e("Dashboards"),t[20]=e,t[21]=g):g=t[21];let h;t[22]!==e?(h=e("Data"),t[22]=e,t[23]=h):h=t[23];let f;t[24]!==e?(f=e("Deployment health"),t[24]=e,t[25]=f):f=t[25];let v;t[26]!==e?(v=e("Log drains"),t[26]=e,t[27]=v):v=t[27];let b;t[28]!==e?(b=e("Export / Import"),t[28]=e,t[29]=b):b=t[29];let m;t[30]!==e?(m=e("Fan-out"),t[30]=e,t[31]=m):m=t[31];let y;t[32]!==e?(y=e("Files"),t[32]=e,t[33]=y):y=t[33];let w;t[34]!==e?(w=e("Flags"),t[34]=e,t[35]=w):w=t[35];let S;t[36]!==e?(S=e("Functions"),t[36]=e,t[37]=S):S=t[37];let C;t[38]!==e?(C=e("Health"),t[38]=e,t[39]=C):C=t[39];let _;t[40]!==e?(_=e("Home"),t[40]=e,t[41]=_):_=t[41];let N;t[42]!==e?(N=e("Performance"),t[42]=e,t[43]=N):N=t[43];let L;t[44]!==e?(L=e("Issues"),t[44]=e,t[45]=L):L=t[45];let M;t[46]!==e?(M=e("KV"),t[46]=e,t[47]=M):M=t[47];let $;t[48]!==e?($=e("Logs"),t[48]=e,t[49]=$):$=t[49];let A;t[50]!==e?(A=e("Metrics"),t[50]=e,t[51]=A):A=t[51];let R;t[52]!==e?(R=e("Migrations"),t[52]=e,t[53]=R):R=t[53];let K;t[54]!==e?(K=e("Notifications"),t[54]=e,t[55]=K):K=t[55];let V;t[56]!==e?(V=e("Organizations"),t[56]=e,t[57]=V):V=t[57];let H;t[58]!==e?(H=e("Time Travel"),t[58]=e,t[59]=H):H=t[59];let I;t[60]!==e?(I=e("Mail"),t[60]=e,t[61]=I):I=t[61];let Z;t[62]!==e?(Z=e("Payments"),t[62]=e,t[63]=Z):Z=t[63];let O;t[64]!==e?(O=e("Permissions"),t[64]=e,t[65]=O):O=t[65];let B;t[66]!==e?(B=e("Queues"),t[66]=e,t[67]=B):B=t[67];let z;t[68]!==e?(z=e("Realtime"),t[68]=e,t[69]=z):z=t[69];let G;t[70]!==e?(G=e("RLS Policies"),t[70]=e,t[71]=G):G=t[71];let D;t[72]!==e?(D=e("Scheduled"),t[72]=e,t[73]=D):D=t[73];let J;t[74]!==e?(J=e("Schema"),t[74]=e,t[75]=J):J=t[75];let W;t[76]!==e?(W=e("Security"),t[76]=e,t[77]=W):W=t[77];let j;t[78]!==e?(j=e("Settings"),t[78]=e,t[79]=j):j=t[79];let F;t[80]!==e?(F=e("SQL editor"),t[80]=e,t[81]=F):F=t[81];let U;t[82]!==e?(U=e("Traces"),t[82]=e,t[83]=U):U=t[83];let Q;t[84]!==e?(Q=e("Access Rules"),t[84]=e,t[85]=Q):Q=t[85];let X;t[86]!==e?(X=e("Users"),t[86]=e,t[87]=X):X=t[87];let q;t[88]!==e?(q=e("Vectors"),t[88]=e,t[89]=q):q=t[89];let Y;t[90]!==e?(Y=e("Workflows"),t[90]=e,t[91]=Y):Y=t[91];let dt;t[92]!==a||t[93]!==r||t[94]!==g||t[95]!==h||t[96]!==f||t[97]!==v||t[98]!==b||t[99]!==m||t[100]!==y||t[101]!==w||t[102]!==S||t[103]!==C||t[104]!==n||t[105]!==_||t[106]!==N||t[107]!==L||t[108]!==M||t[109]!==$||t[110]!==A||t[111]!==R||t[112]!==K||t[113]!==V||t[114]!==H||t[115]!==o||t[116]!==I||t[117]!==Z||t[118]!==O||t[119]!==B||t[120]!==z||t[121]!==G||t[122]!==D||t[123]!==J||t[124]!==W||t[125]!==j||t[126]!==i||t[127]!==F||t[128]!==U||t[129]!==Q||t[130]!==X||t[131]!==q||t[132]!==Y||t[133]!==l||t[134]!==d||t[135]!==u||t[136]!==c||t[137]!==p?(dt={advisorHealth:a,agents:r,evals:n,analytics:o,api:i,audit:l,authAudit:d,authConfig:u,authSessions:c,containers:p,dashboards:g,data:h,deploymentHealth:f,drains:v,export:b,fanout:m,files:y,flags:w,functions:S,health:C,home:_,insights:N,issues:L,kv:M,logs:$,metrics:A,migrations:R,notifications:K,organizations:V,pitr:H,mail:I,payments:Z,permissions:O,queues:B,realtime:z,rls:G,schedule:D,schema:J,security:W,settings:j,sql:F,traces:U,storageRules:Q,users:X,vectors:q,workflows:Y},t[92]=a,t[93]=r,t[94]=g,t[95]=h,t[96]=f,t[97]=v,t[98]=b,t[99]=m,t[100]=y,t[101]=w,t[102]=S,t[103]=C,t[104]=n,t[105]=_,t[106]=N,t[107]=L,t[108]=M,t[109]=$,t[110]=A,t[111]=R,t[112]=K,t[113]=V,t[114]=H,t[115]=o,t[116]=I,t[117]=Z,t[118]=O,t[119]=B,t[120]=z,t[121]=G,t[122]=D,t[123]=J,t[124]=W,t[125]=j,t[126]=i,t[127]=F,t[128]=U,t[129]=Q,t[130]=X,t[131]=q,t[132]=Y,t[133]=l,t[134]=d,t[135]=u,t[136]=c,t[137]=p,t[138]=dt):dt=t[138];const ft=dt;let re;t[139]!==e?(re=e("Advisors"),t[139]=e,t[140]=re):re=t[140];let se;t[141]!==e?(se=e("Auth"),t[141]=e,t[142]=se):se=t[142];let ne;t[143]!==e?(ne=e("Database"),t[143]=e,t[144]=ne):ne=t[144];let oe;t[145]!==e?(oe=e("Functions"),t[145]=e,t[146]=oe):oe=t[146];let ie;t[147]!==e?(ie=e("Observability"),t[147]=e,t[148]=ie):ie=t[148];let le;t[149]!==e?(le=e("Operations"),t[149]=e,t[150]=le):le=t[150];let de;t[151]!==e?(de=e("Overview"),t[151]=e,t[152]=de):de=t[152];let ce;t[153]!==e?(ce=e("Settings"),t[153]=e,t[154]=ce):ce=t[154];let ue;t[155]!==e?(ue=e("Storage"),t[155]=e,t[156]=ue):ue=t[156];let ct;t[157]!==re||t[158]!==se||t[159]!==ne||t[160]!==oe||t[161]!==ie||t[162]!==le||t[163]!==de||t[164]!==ce||t[165]!==ue?(ct={advisors:re,auth:se,database:ne,functions:oe,observability:ie,operations:le,overview:de,settings:ce,storage:ue},t[157]=re,t[158]=se,t[159]=ne,t[160]=oe,t[161]=ie,t[162]=le,t[163]=de,t[164]=ce,t[165]=ue,t[166]=ct):ct=t[166];const gt=ct;let he;t[167]!==e?(he=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[167]=e,t[168]=he):he=t[168];let me;t[169]!==e?(me=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[169]=e,t[170]=me):me=t[170];let pe;t[171]!==e?(pe=e("Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it."),t[171]=e,t[172]=pe):pe=t[172];let fe;t[173]!==e?(fe=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[173]=e,t[174]=fe):fe=t[174];let ge;t[175]!==e?(ge=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[175]=e,t[176]=ge):ge=t[176];let be;t[177]!==e?(be=e("A durable log of admin state-changing operations."),t[177]=e,t[178]=be):be=t[178];let ve;t[179]!==e?(ve=e("Authentication and security events — sign-ins, MFA, and session changes."),t[179]=e,t[180]=ve):ve=t[180];let ye;t[181]!==e?(ye=e("Enabled plugins and session config (read-only)."),t[181]=e,t[182]=ye):ye=t[182];let xe;t[183]!==e?(xe=e("Browse and revoke active sessions across all users."),t[183]=e,t[184]=xe):xe=t[184];let we;t[185]!==e?(we=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[185]=e,t[186]=we):we=t[186];let ke;t[187]!==e?(ke=e("Chart widgets backed by saved read-only SQL queries."),t[187]=e,t[188]=ke):ke=t[188];let Ne;t[189]!==e?(Ne=e("Browse and edit rows across your shard and global tables."),t[189]=e,t[190]=Ne):Ne=t[190];let Se;t[191]!==e?(Se=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[191]=e,t[192]=Se):Se=t[192];let Me;t[193]!==e?(Me=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[193]=e,t[194]=Me):Me=t[194];let Ce;t[195]!==e?(Ce=e("Export a shard to NDJSON, or import rows from it."),t[195]=e,t[196]=Ce):Ce=t[196];let _e;t[197]!==e?(_e=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[197]=e,t[198]=_e):_e=t[198];let Le;t[199]!==e?(Le=e("Browse objects in your R2 storage buckets."),t[199]=e,t[200]=Le):Le=t[200];let $e;t[201]!==e?($e=e("Inspect feature flags and their live evaluation under a targeting context."),t[201]=e,t[202]=$e):$e=t[202];let Pe;t[203]!==e?(Pe=e("Run registered queries, mutations, and actions."),t[203]=e,t[204]=Pe):Pe=t[204];let Te;t[205]!==e?(Te=e("At-a-glance connection, error, and shard signals."),t[205]=e,t[206]=Te):Te=t[206];let Ae;t[207]!==e?(Ae=e("Connection, health, and advisor summary for your deployment."),t[207]=e,t[208]=Ae):Ae=t[208];let ze;t[209]!==e?(ze=e("Surface slow functions, error spikes, and cache problems."),t[209]=e,t[210]=ze):ze=t[210];let Ee;t[211]!==e?(Ee=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[211]=e,t[212]=Ee):Ee=t[212];let Re;t[213]!==e?(Re=e("A live stream of recent function logs."),t[213]=e,t[214]=Re):Re=t[214];let He;t[215]!==e?(He=e("Per-shard health and aggregate metrics."),t[215]=e,t[216]=He):He=t[216];let Ie;t[217]!==e?(Ie=e("Review migration status and run them."),t[217]=e,t[218]=Ie):Ie=t[218];let Ke;t[219]!==e?(Ke=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[219]=e,t[220]=Ke):Ke=t[220];let Ve;t[221]!==e?(Ve=e("Browse and manage organizations, members, and invitations."),t[221]=e,t[222]=Ve):Ve=t[222];let Ze;t[223]!==e?(Ze=e("Restore a shard to a point in the last 30 days."),t[223]=e,t[224]=Ze):Ze=t[224];let Oe;t[225]!==e?(Oe=e("Email your app sent, captured in dev."),t[225]=e,t[226]=Oe):Oe=t[226];let qe;t[227]!==e?(qe=e("Synced customers, subscriptions, and webhook events."),t[227]=e,t[228]=qe):qe=t[228];let Be;t[229]!==e?(Be=e("Inspect access policies per table, and probe a function as any identity."),t[229]=e,t[230]=Be):Be=t[230];let De;t[231]!==e?(De=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[231]=e,t[232]=De):De=t[232];let We;t[233]!==e?(We=e("Active WebSocket subscriptions on this shard."),t[233]=e,t[234]=We):We=t[234];let je;t[235]!==e?(je=e("Inspect row-level-security policies and roles, per table."),t[235]=e,t[236]=je):je=t[236];let Fe;t[237]!==e?(Fe=e("Inspect and cancel scheduled jobs."),t[237]=e,t[238]=Fe):Fe=t[238];let Ue;t[239]!==e?(Ue=e("Inspect each table and its columns."),t[239]=e,t[240]=Ue):Ue=t[240];let Qe;t[241]!==e?(Qe=e("Review admin gates, credentials, and log redaction."),t[241]=e,t[242]=Qe):Qe=t[242];let Je;t[243]!==e?(Je=e("Read-only deployment config — vars, secrets, and bindings."),t[243]=e,t[244]=Je):Je=t[244];let Xe;t[245]!==e?(Xe=e("Run read-only SQL against a shard."),t[245]=e,t[246]=Xe):Xe=t[246];let Ye;t[247]!==e?(Ye=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[247]=e,t[248]=Ye):Ye=t[248];let Ge;t[249]!==e?(Ge=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[249]=e,t[250]=Ge):Ge=t[250];let et;t[251]!==e?(et=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[251]=e,t[252]=et):et=t[252];let tt;t[253]!==e?(tt=e("Manage auth users — roles, bans, sessions, and identity."),t[253]=e,t[254]=tt):tt=t[254];let at;t[255]!==e?(at=e("Browse Vectorize indexes and run similarity searches."),t[255]=e,t[256]=at):at=t[256];let rt;t[257]!==e?(rt=e("Inspect declared Cloudflare Workflows and their bindings."),t[257]=e,t[258]=rt):rt=t[258];let ut;t[259]!==tt||t[260]!==at||t[261]!==rt||t[262]!==he||t[263]!==me||t[264]!==pe||t[265]!==fe||t[266]!==ge||t[267]!==be||t[268]!==ve||t[269]!==ye||t[270]!==xe||t[271]!==we||t[272]!==ke||t[273]!==Ne||t[274]!==Se||t[275]!==Me||t[276]!==Ce||t[277]!==_e||t[278]!==Le||t[279]!==$e||t[280]!==Pe||t[281]!==Te||t[282]!==Ae||t[283]!==ze||t[284]!==Ee||t[285]!==Re||t[286]!==He||t[287]!==Ie||t[288]!==Ke||t[289]!==Ve||t[290]!==Ze||t[291]!==Oe||t[292]!==qe||t[293]!==Be||t[294]!==De||t[295]!==We||t[296]!==je||t[297]!==Fe||t[298]!==Ue||t[299]!==Qe||t[300]!==Je||t[301]!==Xe||t[302]!==Ye||t[303]!==Ge||t[304]!==et?(ut={advisorHealth:he,agents:me,evals:pe,analytics:fe,api:ge,audit:be,authAudit:ve,authConfig:ye,authSessions:xe,containers:we,dashboards:ke,data:Ne,deploymentHealth:Se,drains:Me,export:Ce,fanout:_e,files:Le,flags:$e,functions:Pe,health:Te,home:Ae,insights:ze,issues:Ee,logs:Re,metrics:He,migrations:Ie,notifications:Ke,organizations:Ve,pitr:Ze,mail:Oe,payments:qe,permissions:Be,queues:De,realtime:We,rls:je,schedule:Fe,schema:Ue,security:Qe,settings:Je,sql:Xe,kv:Ye,storageRules:Ge,traces:et,users:tt,vectors:at,workflows:rt},t[259]=tt,t[260]=at,t[261]=rt,t[262]=he,t[263]=me,t[264]=pe,t[265]=fe,t[266]=ge,t[267]=be,t[268]=ve,t[269]=ye,t[270]=xe,t[271]=we,t[272]=ke,t[273]=Ne,t[274]=Se,t[275]=Me,t[276]=Ce,t[277]=_e,t[278]=Le,t[279]=$e,t[280]=Pe,t[281]=Te,t[282]=Ae,t[283]=ze,t[284]=Ee,t[285]=Re,t[286]=He,t[287]=Ie,t[288]=Ke,t[289]=Ve,t[290]=Ze,t[291]=Oe,t[292]=qe,t[293]=Be,t[294]=De,t[295]=We,t[296]=je,t[297]=Fe,t[298]=Ue,t[299]=Qe,t[300]=Je,t[301]=Xe,t[302]=Ye,t[303]=Ge,t[304]=et,t[305]=ut):ut=t[305];const bt=ut;let ht;return t[306]!==gt||t[307]!==bt||t[308]!==ft?(ht={groupLabel:gt,tabDescription:bt,tabLabel:ft},t[306]=gt,t[307]=bt,t[308]=ft,t[309]=ht):ht=t[309],ht},yr=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x("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:[s("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),s("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},xr=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x("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:[s("circle",{cx:"12",cy:"12",r:"4"}),s("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},wr=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s("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:s("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},kr=[{Icon:yr,value:"system"},{Icon:xr,value:"light"},{Icon:wr,value:"dark"}],Nr=()=>{const t=k(19),{theme:e,setTheme:a}=Ta(),r=ee();let n;t[0]!==r?(n=r("Dark theme"),t[0]=r,t[1]=n):n=t[1];let o;t[2]!==r?(o=r("Light theme"),t[2]=r,t[3]=o):o=t[3];let i;t[4]!==r?(i=r("System theme"),t[4]=r,t[5]=i):i=t[5];let l;t[6]!==n||t[7]!==o||t[8]!==i?(l={dark:n,light:o,system:i},t[6]=n,t[7]=o,t[8]=i,t[9]=l):l=t[9];const d=l;let u;t[10]!==r?(u=r("Theme"),t[10]=r,t[11]=u):u=t[11];let c;t[12]!==d||t[13]!==a||t[14]!==e?(c=kr.map(g=>{const{Icon:h,value:f}=g,v=e===f;return x("button",{"aria-checked":v,"aria-label":d[f],className:P("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",v?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${f}`,onClick:()=>{a(f)},role:"radio",title:d[f],type:"button",children:[v&&s(Na.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"}}),s("span",{className:"relative",children:s(h,{})})]},f)}),t[12]=d,t[13]=a,t[14]=e,t[15]=c):c=t[15];let p;return t[16]!==u||t[17]!==c?(p=s("div",{"aria-label":u,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:c}),t[16]=u,t[17]=c,t[18]=p):p=t[18],p},Sr=t=>{const e=k(23),{domain:a,onOpenCommandPalette:r,page:n}=t,o=ee();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s(ar,{className:"-ms-1"}),e[0]=i):i=e[0];let l;e[1]!==o?(l=o("Breadcrumb"),e[1]=o,e[2]=l):l=e[2];let d;e[3]!==a?(d=s("span",{className:"text-muted-foreground",children:a}),e[3]=a,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s("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:s("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=u):u=e[5];let c;e[6]!==n?(c=s("span",{className:"font-medium text-foreground",children:n}),e[6]=n,e[7]=c):c=e[7];let p;e[8]!==l||e[9]!==d||e[10]!==c?(p=x("nav",{"aria-label":l,className:"flex items-center gap-1.5 text-[13px]",children:[d,u,c]}),e[8]=l,e[9]=d,e[10]=c,e[11]=p):p=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=x("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[s("circle",{cx:"11",cy:"11",r:"7"}),s("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=g):g=e[12];let h;e[13]!==o?(h=o("Search…"),e[13]=o,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=f):f=e[15];let v;e[16]!==r||e[17]!==h?(v=x("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:[g,h,f]}),e[16]=r,e[17]=h,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:s(Nr,{})}),e[19]=b):b=e[19];let m;return e[20]!==v||e[21]!==p?(m=x("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[i,p,v,b]}),e[20]=v,e[21]=p,e[22]=m):m=e[22],m},Mr=t=>{const e=k(3);let a,r;e[0]!==t?(a=()=>{if(t===void 0)return;const n=o=>{if(!o.ctrlKey||o.metaKey||o.altKey||o.shiftKey||o.repeat||o.key!=="`")return;const{target:i}=o;i instanceof HTMLElement&&(i.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(i.tagName))||(o.preventDefault(),t())};return globalThis.addEventListener("keydown",n),()=>{globalThis.removeEventListener("keydown",n)}},r=[t],e[0]=t,e[1]=a,e[2]=r):(a=e[1],r=e[2]),nt(a,r)},E=(t,e)=>T(()=>t().then(a=>({default:a[e]}))),Cr=E(()=>import("../packem_chunks/InsightsPanel.js"),"InsightsPanel"),_r=T(()=>import("../packem_chunks/rls-panel.js")),Lr=T(()=>import("../packem_chunks/AdvisorHealthPanel.js")),$r=T(()=>import("../packem_chunks/SecurityAdvisorPanel.js")),Pr=T(()=>import("../packem_chunks/agents-panel.js")),Tr=E(()=>import("../packem_chunks/analytics-panel.js"),"AnalyticsPanel"),Ar=T(()=>import("../packem_chunks/ApiTab.js")),zr=T(()=>import("../packem_chunks/auth-audit-panel.js")),Er=T(()=>import("../packem_chunks/auth-config-panel.js")),Rr=T(()=>import("../packem_chunks/auth-sessions-panel.js")),Hr=T(()=>import("../packem_chunks/organizations-panel.js")),Ir=E(()=>import("../packem_chunks/users-panel.js"),"UsersPanel"),Kr=T(()=>import("../packem_chunks/containers-panel.js")),Vr=E(()=>import("../packem_chunks/DeploymentHealthPanel.js"),"DeploymentHealthPanel"),Zr=E(()=>import("../packem_chunks/TableEditor.js"),"TableEditor"),Or=E(()=>import("../packem_chunks/ExportImportPanel.js"),"ExportImportPanel"),qr=T(()=>import("../packem_chunks/migrations-route.js")),Br={data:xa,migrations:ya},Dr=E(()=>import("../packem_chunks/PitrPanel.js"),"PitrPanel"),Wr=T(()=>import("../packem_chunks/flags-panel.js")),jr=E(()=>import("../packem_chunks/FunctionRunner.js"),"FunctionRunner"),Fr=E(()=>import("../packem_chunks/FunctionStatsPanel.js"),"FunctionStatsPanel"),Ur=T(()=>import("../packem_chunks/issues-panel.js")),Qr=E(()=>import("../packem_chunks/AuditPanel.js"),"AuditPanel"),Jr=T(()=>import("../packem_chunks/log-drains-panel.js")),Xr=T(()=>import("../packem_chunks/LogsPanel.js").then(t=>({default:t.LogsPanel}))),Yr=E(()=>import("../packem_chunks/MailPanel.js"),"MailPanel"),Gr=E(()=>import("../packem_chunks/schedule-panel.js"),"SchedulePanel"),es=T(()=>import("../packem_chunks/subscriptions-panel.js")),ts=T(()=>import("../packem_chunks/sync-client-panel.js")),as=E(()=>import("../packem_chunks/kv-browser.js"),"KvBrowser"),rs=T(()=>import("../packem_chunks/NotificationsPanel.js")),ss=E(()=>import("../packem_chunks/payments-panel.js"),"PaymentsPanel"),ns=E(()=>import("../packem_chunks/permissions-panel.js"),"PermissionsPanel"),os=T(()=>import("../packem_chunks/queues-panel.js")),is=T(()=>import("../packem_chunks/dashboards-panel.js")),ls=T(()=>import("../packem_chunks/fanout-panel.js")),ds=E(()=>import("../packem_chunks/HealthPanel.js"),"HealthPanel"),cs=E(()=>import("../packem_chunks/MetricsPanel.js"),"MetricsPanel"),us=E(()=>import("../packem_chunks/SchemaViewer.js"),"SchemaViewer"),hs=E(()=>import("../packem_chunks/SettingsPanel.js"),"SettingsPanel"),ms=E(()=>import("../packem_chunks/SqlEditorPanel.js"),"SqlEditorPanel"),ps=E(()=>import("../packem_chunks/FileBrowser.js"),"FileBrowser"),fs=T(()=>import("../packem_chunks/storage-rules-panel.js")),gs=T(()=>import("../packem_chunks/traces-panel.js")),bs=T(()=>import("../packem_chunks/evals-panel.js")),vs=E(()=>import("../packem_chunks/vector-browser.js"),"VectorBrowser"),ys=T(()=>import("../packem_chunks/workflows-panel.js")),Jt=At(null),xs={analytics:s("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:s("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:s("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:s("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:s("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:s("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:s("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:s("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:s("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:s("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:s("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:s("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:s("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:s("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:s("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:s("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:s("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:s("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),health:s("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:s("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:s("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:s("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:s("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:s("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:s("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:s("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:s("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:s("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:s("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:s("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:s("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:s("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:s("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),realtime:s("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:s("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:s("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:s("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:s("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:s("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:s("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:s("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:s("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:s("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:s("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:s("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:s("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},$t=[{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","evals","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"]}],ws={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"},Pt=(t,e)=>{const a=ws[t];return a===void 0||e[a]},kt=t=>{const e=k(2),{tab:a}=t,r=xs[a];let n;return e[0]!==r?(n=s("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},ks=t=>t,Xt=ks(["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","evals","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),Ns=new Set(["api","data","migrations","sql"]),Ss=t=>{const e=t.split("/").findLast(Boolean)??"";return Xt.includes(e)?e:"home"},Ms=t=>{const e=k(19),{chrome:a,connected:r}=t,n=ee();let o;e[0]!==n?(o=n("admin token"),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==o?(i=s("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:o}),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==a.onTokenChange||e[5]!==a.token?(l=s(Rt,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:a.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:a.token}),e[4]=a.onTokenChange,e[5]=a.token,e[6]=l):l=e[6];let d;e[7]!==r||e[8]!==n?(d=r&&x("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[s("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),n("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=r,e[8]=n,e[9]=d):d=e[9];let u;e[10]!==a.clearToken||e[11]!==r||e[12]!==n?(u=r&&s("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:a.clearToken,type:"button",children:n("Clear")}),e[10]=a.clearToken,e[11]=r,e[12]=n,e[13]=u):u=e[13];let c;return e[14]!==i||e[15]!==l||e[16]!==d||e[17]!==u?(c=x("div",{className:"flex flex-col gap-2",children:[i,l,d,u]}),e[14]=i,e[15]=l,e[16]=d,e[17]=u,e[18]=c):c=e[18],c},Cs=t=>{const e=k(25),{current:a,group:r,groupLabel:n,selectTab:o,tabDescription:i,tabLabel:l}=t,d=r.tabs.includes(a)?"page":void 0,u=n[r.key],c=r.tabs[0];let p;e[0]!==c?(p=s(kt,{tab:c}),e[0]=c,e[1]=p):p=e[1];let g;e[2]!==d||e[3]!==u||e[4]!==p?(g=s(jt,{"aria-current":d,"aria-label":u,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:p}),e[2]=d,e[3]=u,e[4]=p,e[5]=g):g=e[5];const h=n[r.key];let f;e[6]!==h?(f=s("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:h}),e[6]=h,e[7]=f):f=e[7];let v;if(e[8]!==a||e[9]!==r.tabs||e[10]!==o||e[11]!==i||e[12]!==l){let y;e[14]!==a||e[15]!==o||e[16]!==i||e[17]!==l?(y=w=>x("button",{"aria-current":a===w?"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":w,"data-testid":`dash-tab-${w}`,onClick:o,title:i[w],type:"button",children:[s(kt,{tab:w}),s("span",{children:l[w]})]},w),e[14]=a,e[15]=o,e[16]=i,e[17]=l,e[18]=y):y=e[18],v=r.tabs.map(y),e[8]=a,e[9]=r.tabs,e[10]=o,e[11]=i,e[12]=l,e[13]=v}else v=e[13];let b;e[19]!==f||e[20]!==v?(b=x(Ft,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[f,v]}),e[19]=f,e[20]=v,e[21]=b):b=e[21];let m;return e[22]!==g||e[23]!==b?(m=x(Wt,{children:[g,b]}),e[22]=g,e[23]=b,e[24]=m):m=e[24],m},_s=t=>{const e=k(45),{chrome:a,collapsed:r,connected:n}=t,o=ee();if(a===null){let w;e[0]!==o?(w=o("Admin"),e[0]=o,e[1]=w):w=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=s("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 C;e[3]!==o?(C=o("Admin"),e[3]=o,e[4]=C):C=e[4];let _;e[5]!==C?(_=s("span",{className:"truncate text-[13px] font-medium",children:C}),e[5]=C,e[6]=_):_=e[6];let N;e[7]!==o?(N=o("Studio"),e[7]=o,e[8]=N):N=e[8];let L;e[9]!==N?(L=s("span",{className:"truncate text-[11px] text-muted-foreground",children:N}),e[9]=N,e[10]=L):L=e[10];let M;e[11]!==_||e[12]!==L?(M=x("span",{className:"grid flex-1 text-start leading-tight",children:[_,L]}),e[11]=_,e[12]=L,e[13]=M):M=e[13];let $;return e[14]!==w||e[15]!==M?($=x(Qt,{className:"data-active:bg-transparent",size:"lg",tooltip:w,children:[S,M]}),e[14]=w,e[15]=M,e[16]=$):$=e[16],$}const i=r?"mx-auto size-8 justify-center":"w-full p-2";let l;e[17]!==i?(l=P("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",i),e[17]=i,e[18]=l):l=e[18];let d;e[19]!==n||e[20]!==o?(d=o(n?"Connected":"Not connected"),e[19]=n,e[20]=o,e[21]=d):d=e[21];const u=n?"bg-success":"bg-muted-foreground/50";let c;e[22]!==u?(c=P("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",u),e[22]=u,e[23]=c):c=e[23];let p;e[24]!==c?(p=x("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",s("span",{"aria-hidden":"true",className:c})]}),e[24]=c,e[25]=p):p=e[25];let g;e[26]!==r||e[27]!==n||e[28]!==o?(g=!r&&x(zt,{children:[x("span",{className:"grid flex-1 text-start leading-tight",children:[s("span",{className:"truncate text-[13px] font-medium",children:o("Admin")}),s("span",{className:"truncate text-[11px] text-muted-foreground",children:o(n?"Connected":"Not connected")})]}),s("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:s("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=r,e[27]=n,e[28]=o,e[29]=g):g=e[29];let h;e[30]!==l||e[31]!==d||e[32]!==p||e[33]!==g?(h=x(jt,{className:l,"data-testid":"dash-app-connect",title:d,children:[p,g]}),e[30]=l,e[31]=d,e[32]=p,e[33]=g,e[34]=h):h=e[34];const f=r?"end":"start",v=r?"right":"top";let b;e[35]!==a||e[36]!==n?(b=s(Ms,{chrome:a,connected:n}),e[35]=a,e[36]=n,e[37]=b):b=e[37];let m;e[38]!==v||e[39]!==b||e[40]!==f?(m=s(Ft,{align:f,keepMounted:!0,side:v,children:b}),e[38]=v,e[39]=b,e[40]=f,e[41]=m):m=e[41];let y;return e[42]!==m||e[43]!==h?(y=x(Wt,{children:[h,m]}),e[42]=m,e[43]=h,e[44]=y):y=e[44],y},Ls=t=>{const e=k(28),{chrome:a,connected:r,current:n,groupLabel:o,groups:i,selectTab:l,tabDescription:d,tabLabel:u}=t,c=ee(),{state:p}=pt(),g=p==="collapsed",h=g&&"justify-center px-0";let f;e[0]!==h?(f=P("flex items-center gap-2.5 px-1.5 py-1",h),e[0]=h,e[1]=f):f=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=s(Ra,{className:"size-9 shrink-0 text-foreground"}),e[2]=v):v=e[2];let b;e[3]!==g||e[4]!==r||e[5]!==c?(b=!g&&x(zt,{children:[x("span",{className:"grid flex-1 leading-tight",children:[s("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),s("span",{className:"truncate text-[11px] text-muted-foreground",children:c("Studio")})]}),s(lt,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:c(r?"Live":"Local")})]}),e[3]=g,e[4]=r,e[5]=c,e[6]=b):b=e[6];let m;e[7]!==f||e[8]!==b?(m=s(sr,{children:x("div",{className:f,children:[v,b]})}),e[7]=f,e[8]=b,e[9]=m):m=e[9];let y;e[10]!==g||e[11]!==n||e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==d||e[16]!==u?(y=g?i.map(_=>s(Cs,{current:n,group:_,groupLabel:o,selectTab:l,tabDescription:d,tabLabel:u},_.key)):i.map(_=>x(ir,{children:[s(lr,{className:"text-[11px] font-medium tracking-wider uppercase",children:o[_.key]}),s(dr,{children:s(_t,{children:_.tabs.map(N=>s(Lt,{children:x(Qt,{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:l,title:d[N],tooltip:d[N],children:[s(kt,{tab:N}),s("span",{children:u[N]})]})},N))})})]},_.key)),e[10]=g,e[11]=n,e[12]=o,e[13]=i,e[14]=l,e[15]=d,e[16]=u,e[17]=y):y=e[17];let w;e[18]!==y?(w=s(or,{children:y}),e[18]=y,e[19]=w):w=e[19];let S;e[20]!==a||e[21]!==g||e[22]!==r?(S=s(nr,{children:s(_t,{children:s(Lt,{children:s(_s,{chrome:a,collapsed:g,connected:r})})})}),e[20]=a,e[21]=g,e[22]=r,e[23]=S):S=e[23];let C;return e[24]!==m||e[25]!==w||e[26]!==S?(C=x(tr,{collapsible:"icon",variant:"inset",children:[m,w,S]}),e[24]=m,e[25]=w,e[26]=S,e[27]=C):C=e[27],C},Yt=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[x("div",{className:"flex items-center gap-2",children:[s(vt,{className:"h-8 w-40"}),s(vt,{className:"h-8 w-24"})]}),s(vt,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},$s=()=>{const t=k(64),e=ee(),a=Tt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={select:Rs},t[0]=r):r=t[0];const n=na(r);let o,i;t[1]!==n?(o=Ss(n),i=Ns.has(o),t[1]=n,t[2]=o,t[3]=i):(o=t[2],i=t[3]);const l=i,d=ua(),u=d?.toggle;Mr(u);const c=ga(),{groupLabel:p,tabDescription:g,tabLabel:h}=vr();let f;t[4]!==c?(f=q=>({...q,tabs:q.tabs.filter(Y=>Pt(Y,c))}),t[4]=c,t[5]=f):f=t[5];const v=$t.map(f).filter(Hs);let b,m;t[6]!==o||t[7]!==c||t[8]!==a?(b=()=>{Pt(o,c)||wt(a({replace:!0,to:"/home"}))},m=[o,c,a],t[6]=o,t[7]=c,t[8]=a,t[9]=b,t[10]=m):(b=t[9],m=t[10]),nt(b,m);let y;t[11]!==a?(y=q=>{wt(a({to:`/${q.currentTarget.dataset.tab??""}`}))},t[11]=a,t[12]=y):y=t[12];const w=y;let S,C;t[13]!==o||t[14]!==h?(S=()=>{typeof document<"u"&&(document.title=`${h[o]} · lunora`)},C=[o,h],t[13]=o,t[14]=h,t[15]=S,t[16]=C):(S=t[15],C=t[16]),nt(S,C);const _=v.find(q=>q.tabs.includes(o))??$t[0];let N;t[17]!==p||t[18]!==h?(N=q=>q.tabs.map(Y=>({group:p[q.key],label:h[Y],to:`/${Y}`})),t[17]=p,t[18]=h,t[19]=N):N=t[19];const L=v.flatMap(N),M=Nt(Jt),$=M!==null&&M.token!=="";let A;t[20]!==L?(A=s(wa,{items:L}),t[20]=L,t[21]=A):A=t[21];let R;t[22]!==M||t[23]!==$||t[24]!==o||t[25]!==p||t[26]!==w||t[27]!==g||t[28]!==h||t[29]!==v?(R=s(Ls,{chrome:M,connected:$,current:o,groupLabel:p,groups:v,selectTab:w,tabDescription:g,tabLabel:h}),t[22]=M,t[23]=$,t[24]=o,t[25]=p,t[26]=w,t[27]=g,t[28]=h,t[29]=v,t[30]=R):R=t[30];const K=p[_.key],V=h[o];let H;t[31]!==K||t[32]!==V?(H=s(Sr,{domain:K,onOpenCommandPalette:ka,page:V}),t[31]=K,t[32]=V,t[33]=H):H=t[33];let I;t[34]!==M?.rulesInstalled?(I=M?.rulesInstalled===!1&&s(Ka,{}),t[34]=M?.rulesInstalled,t[35]=I):I=t[35];const Z=`dash-tab-${o}`,O=l?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",B=h[o];let z;t[36]!==e||t[37]!==B?(z=e("{title} failed",{title:B}),t[36]=e,t[37]=B,t[38]=z):z=t[38];const G=h[o];let D;t[39]!==e?(D=e("Try again"),t[39]=e,t[40]=D):D=t[40];let J;t[41]===Symbol.for("react.memo_cache_sentinel")?(J=s(la,{fallback:s(Yt,{}),children:s(oa,{})}),t[41]=J):J=t[41];let W;t[42]!==o||t[43]!==z||t[44]!==G||t[45]!==D?(W=s(da,{fallbackTitle:z,label:G,retryLabel:D,children:J},o),t[42]=o,t[43]=z,t[44]=G,t[45]=D,t[46]=W):W=t[46];let j;t[47]!==O||t[48]!==W?(j=s("div",{className:O,children:W}),t[47]=O,t[48]=W,t[49]=j):j=t[49];let F;t[50]!==d?(F=d?.open===!0&&s(fr,{focusSeq:d.focusSeq,onClose:d.close,onShownChange:d.setShown,shown:d.shown}),t[50]=d,t[51]=F):F=t[51];let U;t[52]!==Z||t[53]!==j||t[54]!==F?(U=x("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,F]}),t[52]=Z,t[53]=j,t[54]=F,t[55]=U):U=t[55];let Q;t[56]!==H||t[57]!==I||t[58]!==U?(Q=x(rr,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[H,I,U]}),t[56]=H,t[57]=I,t[58]=U,t[59]=Q):Q=t[59];let X;return t[60]!==R||t[61]!==Q||t[62]!==A?(X=x(er,{className:"min-h-0 flex-1","data-testid":"lunora-studio",children:[A,R,Q]}),t[60]=R,t[61]=Q,t[62]=A,t[63]=X):X=t[63],X},Ps=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s(ca,{children:s($s,{})}),t[0]=e):e=t[0],e},Ts=t=>{const e=k(5),{initialShardKey:a,schemaEditable:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const o=sa(n),{table:i}=o,l=typeof i=="string"?i:void 0;let d;return e[1]!==a||e[2]!==l||e[3]!==r?(d=s(us,{initialShardKey:a,initialTable:l,schemaEditable:r}),e[1]=a,e[2]=l,e[3]=r,e[4]=d):d=e[4],d},As=()=>{const t=k(3),e=Tt();let a,r;return t[0]!==e?(a=()=>{wt(e({replace:!0,to:"/home"}))},r=[e],t[0]=e,t[1]=a,t[2]=r):(a=t[1],r=t[2]),nt(a,r),null},zs=({basePath:t,dataEditable:e=!1,functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:o,runAsIdentity:i=!1,schemaEditable:l=!1,scheduledCancel:d,scheduledCron:u,scheduledLoad:c})=>{const p=ea({component:Ps}),g={agents:s(Pr,{initialShardKey:r}),analytics:s(Tr,{}),api:s(Ar,{functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:o}),audit:s(Qr,{initialShardKey:r}),authAudit:s(zr,{}),authConfig:s(Er,{}),authSessions:s(Rr,{}),containers:s(Kr,{}),dashboards:s(is,{initialShardKey:r}),data:s(Zr,{editable:e,initialShardKey:r}),deploymentHealth:s(Vr,{}),drains:s(Jr,{}),export:s(Or,{initialShardKey:r}),fanout:s(ls,{initialShardKey:r}),files:s(ps,{}),kv:s(as,{}),flags:s(Wr,{initialShardKey:r}),functions:x("div",{className:"flex flex-col gap-8",children:[s(Fr,{functions:a,initialShardKey:r}),s(jr,{functions:a,runAsIdentity:i})]}),health:s(ds,{initialShardKey:r}),home:s(fa,{initialShardKey:r}),insights:s(Cr,{initialShardKey:r}),issues:s(Ur,{initialShardKey:r}),logs:s(Xr,{initialShardKey:r}),traces:s(gs,{initialShardKey:r}),evals:s(bs,{initialShardKey:r}),metrics:s(cs,{initialShardKey:r}),migrations:s(qr,{initialShardKey:r}),notifications:s(rs,{}),organizations:s(Hr,{}),permissions:s(ns,{functions:a,runAsIdentity:i,schemaEditable:l}),pitr:s(Dr,{initialShardKey:r}),mail:s(Yr,{}),payments:s(ss,{}),queues:s(os,{}),realtime:x("div",{className:"flex flex-col gap-8",children:[s(es,{initialShardKey:r}),s(ts,{})]}),rls:s(_r,{}),schedule:s(Gr,{loadCronJobs:u,scheduledCancel:d,scheduledLoad:c}),schema:s(Ts,{initialShardKey:r,schemaEditable:l}),advisorHealth:s(Lr,{}),security:s($r,{}),settings:s(hs,{initialShardKey:r}),sql:s(ms,{initialShardKey:r}),storageRules:s(fs,{}),users:s(Ir,{}),vectors:s(vs,{}),workflows:s(ys,{})},h=Mt({component:()=>g.home,getParentRoute:()=>p,path:"/"}),f=Xt.map(m=>Mt({component:()=>g[m],getParentRoute:()=>p,path:`/${m}`,validateSearch:Br[m]})),v=p.addChildren([h,...f]),b="window"in globalThis?ta():aa({initialEntries:["/home"]});return ra({...t===void 0||t==="/"?{}:{basepath:t},defaultNotFoundComponent:As,defaultPendingComponent:Yt,defaultPendingMinMs:0,defaultPendingMs:0,history:b,routeTree:v})},Es=t=>{const e=k(17),{basePath:a,chrome:r,dataEditable:n,functions:o,initialShardKey:i,openApiSpec:l,openRpcSpec:d,runAsIdentity:u,schemaEditable:c,scheduledCancel:p,scheduledCron:g,scheduledLoad:h}=t;let f;e[0]!==a||e[1]!==n||e[2]!==o||e[3]!==i||e[4]!==l||e[5]!==d||e[6]!==u||e[7]!==p||e[8]!==g||e[9]!==h||e[10]!==c?(f=zs({basePath:a,dataEditable:n,functions:o,initialShardKey:i,openApiSpec:l,openRpcSpec:d,runAsIdentity:u,schemaEditable:c,scheduledCancel:p,scheduledCron:g,scheduledLoad:h}),e[0]=a,e[1]=n,e[2]=o,e[3]=i,e[4]=l,e[5]=d,e[6]=u,e[7]=p,e[8]=g,e[9]=h,e[10]=c,e[11]=f):f=e[11];const v=f,b=r??null;let m;e[12]!==v?(m=s(Gt,{router:v}),e[12]=v,e[13]=m):m=e[13];let y;return e[14]!==b||e[15]!==m?(y=s(Jt,{value:b,children:m}),e[14]=b,e[15]=m,e[16]=y):y=e[16],y},mn=t=>{const e=k(17),{basePath:a,chrome:r,dataEditable:n,functions:o,i18n:i,initialShardKey:l,locale:d,openApiSpec:u,openRpcSpec:c,runAsIdentity:p,schemaEditable:g,scheduledCancel:h,scheduledCron:f,scheduledLoad:v}=t;let b;e[0]!==a||e[1]!==r||e[2]!==n||e[3]!==o||e[4]!==l||e[5]!==u||e[6]!==c||e[7]!==p||e[8]!==h||e[9]!==f||e[10]!==v||e[11]!==g?(b=s(Pa,{children:s(Es,{basePath:a,chrome:r,dataEditable:n,functions:o,initialShardKey:l,openApiSpec:u,openRpcSpec:c,runAsIdentity:p,scheduledCancel:h,scheduledCron:f,scheduledLoad:v,schemaEditable:g})}),e[0]=a,e[1]=r,e[2]=n,e[3]=o,e[4]=l,e[5]=u,e[6]=c,e[7]=p,e[8]=h,e[9]=f,e[10]=v,e[11]=g,e[12]=b):b=e[12];const m=b;if(i===void 0&&d===void 0)return m;let y;return e[13]!==i||e[14]!==d||e[15]!==m?(y=s(va,{i18n:i,locale:d,children:m}),e[13]=i,e[14]=d,e[15]=m,e[16]=y):y=e[16],y};function Rs(t){return t.location.pathname}function Hs(t){return t.tabs.length>0}export{mn as S,$a as a,Ta as b,ja as c,Ra as f,Oa as h,hn as m,Da as u,Wa as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a,a as n}from"./browser-storage-xjTyMKY0.js";const t="lunora:traces:pending-filter",o=e=>{a(t,e,"session")},c=()=>{const e=n("session");if(e!==void 0)try{const s=e.getItem(t);if(s===null)return;const r=JSON.parse(s);return typeof r.traceId!="string"?void 0:{traceId:r.traceId,...typeof r.shardKey=="string"?{shardKey:r.shardKey}:{}}}catch{return}},d=()=>{try{n("session")?.removeItem(t)}catch{}};export{d as c,c as p,o as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"react/compiler-runtime";import{useNavigate as m}from"@tanstack/react-router";import{f}from"./internal-zkEvTqy8.js";import{w as s}from"./trace-handoff-
|
|
1
|
+
import{c as a}from"react/compiler-runtime";import{useNavigate as m}from"@tanstack/react-router";import{f}from"./internal-zkEvTqy8.js";import{w as s}from"./trace-handoff-Dw7mwjxu.js";const g=e=>{const r=a(3),o=m();let t;return r[0]!==o||r[1]!==e?(t=i=>{s({shardKey:e,traceId:i}),f(o({to:"/traces"}))},r[0]=o,r[1]=e,r[2]=t):t=r[2],t};export{g as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ze}from"./chunk-
|
|
1
|
+
import{a as Ze}from"./chunk-HBSEWNIR.js";import{a as Je,b as Ve}from"./chunk-FCLMIH4N.js";import{a as Xe}from"./chunk-WPK2Q33V.js";import"./chunk-GG6PIGQO.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-ESVP44Y3.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import{a as Ge}from"./chunk-FURI47Z2.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import"./chunk-HFRJMPXJ.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import"./chunk-Y32QIKBS.js";import{a as Qe}from"./chunk-RMN2JN4S.js";import{b as Pe}from"./chunk-GRL5MG3Z.js";import{d as Ce,e as Oe,f as Me}from"./chunk-7T7UOTYK.js";import{R as Fe}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as We}from"./chunk-XXQUMVWH.js";import{a as we}from"./chunk-VDW32UET.js";import"./chunk-UDOOZJO5.js";import{f as ke}from"./chunk-UQV7Q5S4.js";import"./chunk-XBDKZZ67.js";import{a as He,b as je,c as Ke,d as De,e as Ye,f as Ue}from"./chunk-WJQLNYGX.js";import{d as oe,f as ve,g as ye,h as _e,o as ie}from"./chunk-IUYFXK4X.js";import"./chunk-5DVJR52Z.js";import{a as i,e as Ee,f as dt,g as ut,h as mt,j as ue}from"./chunk-3XIESWL4.js";var K=Ee(ut(),1);var P=Ee(dt(),1);var c=Ee(mt(),1);var ht=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],ft=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],Ie=String.fromCodePoint(0),pt=new RegExp(`${Ie}${String.raw`(\d+)`}${Ie}`,"gu"),bt=ht.map(l=>({pattern:new RegExp(String.raw`\b${l.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:l})),gt=ft.map(l=>({pattern:new RegExp(String.raw`\s+${l.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
2
2
|
${l}`})),xt=i(l=>{let e=[],t=l.replaceAll(/'(?:[^']|'')*'/gu,n=>(e.push(n),`${Ie}${(e.length-1).toString()}${Ie}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:n,replacement:r}of bt)t=t.replaceAll(n,r);for(let{pattern:n,replacement:r}of gt)t=t.replaceAll(n,r);return t=t.replaceAll(pt,(n,r)=>e[Number(r)]??""),t},"yt"),vt=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,yt=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|replace|truncate|update|vacuum)\b/iu,wt=/^\w+/u,St=/;\s*$/u,Nt=/\s/u,kt=i((l,e)=>{let t=e+2;for(;t<l.length&&l[t]!==`
|
|
3
3
|
`;)t+=1;return t},"$t"),Ct=i((l,e)=>{let t=l.indexOf("*/",e+2);return t===-1?-1:t+2},"qt"),qt=i(l=>{let e=0;for(;e<l.length;){let t=l[e];if(t!==void 0&&Nt.test(t))e+=1;else if(t==="-"&&l[e+1]==="-")e=kt(l,e);else if(t==="/"&&l[e+1]==="*"){let n=Ct(l,e);if(n===-1)break;e=n}else break}return e},"Tt"),Tt=i(l=>{let e=qt(l),t=l.slice(e).trimEnd();if(t==="")return{code:"SQL_EMPTY",message:"the query is empty"};let n=t.replace(St,""),r=n.indexOf(";");if(r!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+r};let o="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!vt.test(n))return{code:"SQL_NOT_READONLY",length:wt.exec(n)?.[0].length??1,message:o,offset:e};let s=yt.exec(n);if(s!==null)return{code:"SQL_NOT_READONLY",length:s[0].length,message:`${o} (\`${s[0].toUpperCase()}\` is not allowed)`,offset:e+s.index}},"Rt"),It=/\b(?:from|join)\s+([a-z_][\w$]*)(?:\s+(?:as\s+)?([a-z_][\w$]*))?/giu,Rt=/(?:\bwith\s+(?:recursive\s+)?|,\s*)([a-z_][\w$]*)\s+as\s*\(/giu,Lt=new Set(["cross","full","group","having","inner","join","left","limit","offset","on","order","right","union","using","where","window"]),Et=/[^\n]/gu,_t=i((l,e)=>{let t=l[e];if(t==="'"){let n=e+1;for(;n<l.length&&l[n]!=="'";)n+=1;return Math.min(n+1,l.length)}if(t==="-"&&l[e+1]==="-"){let n=l.indexOf(`
|
|
4
4
|
`,e);return n===-1?l.length:n}if(t==="/"&&l[e+1]==="*"){let n=l.indexOf("*/",e+2);return n===-1?l.length:n+2}return-1},"Ot"),Ot=i(l=>{let e="",t=0;for(;t<l.length;){let n=_t(l,t);n===-1?(e+=l.slice(t,t+1),t+=1):(e+=l.slice(t,n).replaceAll(Et," "),t=n)}return e},"Mt"),Mt=i(l=>{let e=new Set;for(let t of l.matchAll(Rt))e.add((t[1]??"").toLowerCase());return e},"Dt"),Dt=i((l,e)=>{let t=new Map;for(let n of l.matchAll(It)){let r=(n[1]??"").toLowerCase(),o=(n[2]??"").toLowerCase();e.has(r)&&(t.set(r,r),o!==""&&!Lt.has(o)&&t.set(o,r))}return t},"At"),ot=i((l,e)=>{let t=Ot(l),n=new Set(e.map(r=>r.toLowerCase()));return{ctes:Mt(t),masked:t,targets:Dt(t,n)}},"Ke"),At=/^(?:__lunora|sqlite_)/iu,$t=/\b(?:from|join)\s+([a-z_][\w$]*)/giu,Bt=/\b([a-z_][\w$]*)\.([a-z_][\w$]*)/giu,zt=new Set(["cross","full","group","having","inner","join","lateral","left","limit","offset","order","right","select","union","where","window"]),Ft=i((l,e,t)=>{let n=[];for(let r of l.matchAll($t)){let o=r[1]??"",s=o.toLowerCase();!e.has(s)&&!t.has(s)&&!zt.has(s)&&!At.test(o)&&n.push({length:o.length,message:`unknown table \`${o}\``,offset:r.index+r[0].length-o.length,severity:"error",source:"schema"})}return n},"Ft"),Pt=i((l,e,t)=>{let n=[],r=new Map;for(let[o,s]of Object.entries(e.columns))r.set(o.toLowerCase(),new Set(s.map(m=>m.toLowerCase())));for(let o of l.matchAll(Bt)){let s=(o[1]??"").toLowerCase(),m=o[2]??"",a=t.get(s),d=a===void 0?void 0:r.get(a);d!==void 0&&!d.has(m.toLowerCase())&&n.push({length:m.length,message:`\`${a??""}\` has no column \`${m}\``,offset:o.index+o[0].length-m.length,severity:"error",source:"schema"})}return n},"Qt"),Qt=i((l,e)=>{if(l.trim()==="")return[];let t=Tt(l);if(t!==void 0)return t.code==="SQL_EMPTY"?[]:[{length:t.length,message:t.message,offset:t.offset,severity:"error",source:"gate"}];let{ctes:n,masked:r,targets:o}=ot(l,e.tables),s=new Set(e.tables.map(m=>m.toLowerCase()));return[...Ft(r,s,n),...Pt(r,e,o)]},"jt"),Wt=ve(we.lintSql),Ht=600,jt=i((l,e,t)=>{let n=ke(),[r,o]=(0,P.useState)([]),s=(0,P.useMemo)(()=>Qt(l,e),[l,e]),m=Ge(l,Ht),a=s.some(p=>p.source==="gate")||m.trim()==="",d=(0,P.useCallback)(async p=>{try{let b=await n.query(Wt,{sql:m},ye(t));p.cancelled||o(b.diagnostics??[])}catch{p.cancelled||o([])}},[n,m,t]);(0,P.useEffect)(()=>{if(a){o([]);return}let p={cancelled:!1};return ie(d(p)),()=>{p.cancelled=!0}},[d,a]);let f=m===l;return(0,P.useMemo)(()=>f?[...s,...r]:s,[s,r,f])},"Ut"),qe=8,Kt=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],Yt=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),Ut=/[\w$]/,rt=i(l=>l!==void 0&&Ut.test(l),"Ue"),lt=i(l=>{let e=l.length;for(;e>0&&rt(l[e-1]);)e-=1;return l.slice(e)},"Ye"),st=i((l,e)=>{let t=e;for(;t>0&&rt(l[t-1]);)t-=1;return{end:e,start:t,text:l.slice(t,e)}},"Je"),et=i((l,e)=>{let t=l.slice(0,e).trimEnd();return t.endsWith(".")||Yt.has(lt(t).toUpperCase())},"Pe"),Gt=i((l,e,t)=>{let n=l.slice(0,e);if(!n.endsWith("."))return;let r=lt(n.slice(0,-1));if(r!=="")return ot(l,t).targets.get(r.toLowerCase())??r},"Vt"),$e=i((l,e)=>l.toLowerCase().startsWith(e.toLowerCase()),"Me"),tt=i((l,e,t,n)=>{let r=[];for(let o of l)if($e(o,e)&&(r.push(n(o)),r.length>=t))break;return r},"Fe"),Jt=i((l,e,t)=>{let n=new Map;for(let[r,o]of Object.entries(l.columns))for(let s of o)if($e(s,e)&&!n.has(s)&&(n.set(s,r),n.size>=t))return[...n].map(([m,a])=>({detail:a,kind:"column",label:m}));return[...n].map(([r,o])=>({detail:o,kind:"column",label:r}))},"Xt"),Vt=i((l,e,t)=>{let n=st(l,e),r=Gt(l,n.start,t.tables);if(r!==void 0){let a=t.columns[r]??t.columns[r.toLowerCase()]??[];return tt(a,n.text,qe,d=>({detail:r,kind:"column",label:d}))}if(n.text===""&&!et(l,n.start))return[];let o=tt(t.tables,n.text,qe,a=>({kind:"table",label:a})),s=Jt(t,n.text,qe),m=Kt.flatMap(a=>n.text!==""&&$e(a,n.text)&&a.toLowerCase()!==n.text.toLowerCase()?[{kind:"keyword",label:a}]:[]);return(et(l,n.start)?[...s,...o,...m]:[...o,...s,...m]).slice(0,qe)},"Zt"),Xt=i((l,e,t)=>{let n=st(l,e),r=l.slice(0,n.start)+t.label+l.slice(n.end);return{caret:n.start+t.label.length,value:r}},"en"),Zt=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],en=i((l,e)=>{let t=globalThis.getComputedStyle(l),n=globalThis.document.createElement("div"),{style:r}=n;r.position="absolute",r.visibility="hidden",r.whiteSpace="pre-wrap",r.overflowWrap="break-word";for(let a of Zt)r[a]=t[a];n.textContent=l.value.slice(0,Math.max(0,e));let o=globalThis.document.createElement("span");o.textContent=l.value.slice(Math.max(0,e))||".",n.append(o),globalThis.document.body.append(n);let s=o.offsetLeft-l.scrollLeft,m=o.offsetTop-l.scrollTop;return n.remove(),{left:s,top:m}},"nn"),tn=i((l,e,t)=>{let n=(0,K.c)(16),[r,o]=(0,P.useState)(null),s;n[0]!==l||n[1]!==e?(s=i((w,g)=>{let h=Vt(w,g,l);if(h.length===0){o(null);return}let S=e.current,{left:k,top:N}=S===null?{left:0,top:0}:en(S,g);o(C=>C!==null&&C.active===0&&C.left===k&&C.top===N&&C.suggestions.length===h.length&&C.suggestions.every((L,R)=>{let E=h.at(R);return L.kind===E?.kind&&L.label===E.label&&L.detail===E.detail})?C:{active:0,left:k,suggestions:h,top:N})},"s"),n[0]=l,n[1]=e,n[2]=s):s=n[2];let m=s,a;n[3]===Symbol.for("react.memo_cache_sentinel")?(a=i(()=>{o(null)},"a"),n[3]=a):a=n[3];let d=a,f;n[4]===Symbol.for("react.memo_cache_sentinel")?(f=i(w=>{o(g=>{if(g===null)return g;let h=g.suggestions.length,S=(g.active+w+h)%h;return{...g,active:S}})},"f"),n[4]=f):f=n[4];let p=f,b;n[5]!==t||n[6]!==r||n[7]!==e?(b=i(w=>{let g=e.current;if(r===null||g===null)return!1;let h=r.suggestions[w??r.active];if(h===void 0)return!1;let S=Xt(g.value,g.selectionStart,h);return t(S.value),o(null),requestAnimationFrame(()=>{let k=e.current;k!==null&&(k.focus(),k.setSelectionRange(S.caret,S.caret))}),!0},"p"),n[5]=t,n[6]=r,n[7]=e,n[8]=b):b=n[8];let v=b,u;n[9]!==v?(u=i(()=>v(),"c"),n[9]=v,n[10]=u):u=n[10];let x=u,y;return n[11]!==x||n[12]!==v||n[13]!==m||n[14]!==r?(y={close:d,commit:x,commitAt:v,move:p,refresh:m,state:r},n[11]=x,n[12]=v,n[13]=m,n[14]=r,n[15]=y):y=n[15],y},"on"),nn={column:"column",keyword:"keyword",table:"table"},on=20,rn=i(l=>{let e=(0,K.c)(17),{listboxId:t,onPick:n,state:r}=l,o=oe(),s;e[0]!==r?(s=r===null?void 0:{left:r.left,top:r.top+on},e[0]=r,e[1]=s):s=e[1];let m=s;if(r===null)return null;let a;if(e[2]!==t||e[3]!==n||e[4]!==r.active||e[5]!==r.suggestions||e[6]!==o){let f;e[8]!==t||e[9]!==n||e[10]!==r.active||e[11]!==o?(f=i((p,b)=>(0,c.jsxs)("li",{"aria-selected":b===r.active,className:ue("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",b===r.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${t}-opt-${b.toString()}`,onMouseDown:i(v=>{v.preventDefault(),n(b)},"onMouseDown"),role:"option",children:[(0,c.jsx)("span",{className:"truncate font-mono",children:p.label}),p.detail!==void 0&&(0,c.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:p.detail}),(0,c.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:o(nn[p.kind])})]},`${p.kind}:${p.label}`),"f"),e[8]=t,e[9]=n,e[10]=r.active,e[11]=o,e[12]=f):f=e[12],a=r.suggestions.map(f),e[2]=t,e[3]=n,e[4]=r.active,e[5]=r.suggestions,e[6]=o,e[7]=a}else a=e[7];let d;return e[13]!==t||e[14]!==m||e[15]!==a?(d=(0,c.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:t,role:"listbox",style:m,children:a}),e[13]=t,e[14]=m,e[15]=a,e[16]=d):d=e[16],d},"sn"),ln=ve(we.listTables),sn=ve(we.readTablePage),an=i(l=>{let e=(0,K.c)(16),t=ke(),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,o]=(0,P.useState)(n),s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={},e[1]=s):s=e[1];let[m,a]=(0,P.useState)(s),d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=new Set,e[2]=d):d=e[2];let f=(0,P.useRef)(d),p,b;e[3]!==t||e[4]!==l?(p=i(()=>{let g={cancelled:!1};return ie((async()=>{try{let h=await t.query(ln,{},ye(l));g.cancelled||(o(h.map(dn)),a({}),f.current=new Set)}catch{g.cancelled||(o([]),a({}),f.current=new Set)}})()),()=>{g.cancelled=!0}},"h"),b=[t,l],e[3]=t,e[4]=l,e[5]=p,e[6]=b):(p=e[5],b=e[6]),(0,P.useEffect)(p,b);let v;e[7]!==t||e[8]!==l?(v=i(g=>{f.current.has(g)||(f.current.add(g),ie((async()=>{try{let h=await t.query(sn,{limit:1,offset:0,table:g},ye(l));a(S=>({...S,[g]:h.columns}))}catch{f.current.delete(g)}})()))},"x"),e[7]=t,e[8]=l,e[9]=v):v=e[9];let u=v,x;e[10]!==m||e[11]!==r?(x={columns:m,tables:r},e[10]=m,e[11]=r,e[12]=x):x=e[12];let y=x,w;return e[13]!==u||e[14]!==y?(w={probe:u,schema:y},e[13]=u,e[14]=y,e[15]=w):w=e[15],w},"dn"),Ae=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,cn=i(l=>{let e=new Set;Ae.lastIndex=0;let t=Ae.exec(l);for(;t!==null;)e.add(t[1]??t[2]),t=Ae.exec(l);return[...e]},"un");function dn(l){return l.name}i(dn,"mn");var un=i(l=>{let e=(0,K.c)(34),{onSubmit:t,probe:n,schema:r,setDraft:o}=l,s=(0,P.useId)(),m=(0,P.useRef)(null),a=(0,P.useRef)(null),d=(0,P.useRef)(null),f=tn(r,d,o),{close:p,commit:b,commitAt:v,move:u,refresh:x,state:y}=f,w;e[0]!==v?(w=i(I=>{v(I)},"y"),e[0]=v,e[1]=w):w=e[1];let g=w,h;e[2]!==x?(h=i(()=>{let I=d.current;I!==null&&I===document.activeElement&&x(I.value,I.selectionStart)},"m"),e[2]=x,e[3]=h):h=e[3];let S;e[4]!==x||e[5]!==r?(S=[x,r],e[4]=x,e[5]=r,e[6]=S):S=e[6],(0,P.useEffect)(h,S);let k;e[7]!==n||e[8]!==x||e[9]!==o?(k=i(I=>{let{selectionStart:B,value:W}=I.target;o(W);for(let Q of cn(W))n(Q);x(W,B)},"N"),e[7]=n,e[8]=x,e[9]=o,e[10]=k):k=e[10];let N=k,C;e[11]!==x?(C=i(I=>{let B=I.currentTarget;x(B.value,B.selectionStart)},"k"),e[11]=x,e[12]=C):C=e[12];let L=C,R;e[13]!==y||e[14]!==p||e[15]!==b||e[16]!==u||e[17]!==t?(R=i(I=>{if(y!==null){if(I.key==="ArrowDown"){I.preventDefault(),u(1);return}if(I.key==="ArrowUp"){I.preventDefault(),u(-1);return}if(I.key==="Escape"){I.preventDefault(),p();return}if((I.key==="Enter"||I.key==="Tab")&&!I.metaKey&&!I.ctrlKey&&b()){I.preventDefault();return}}(I.metaKey||I.ctrlKey)&&I.key==="Enter"&&(I.preventDefault(),t())},"T"),e[13]=y,e[14]=p,e[15]=b,e[16]=u,e[17]=t,e[18]=R):R=e[18];let E=R,q;e[19]!==p?(q=i(()=>{requestAnimationFrame(()=>{p()})},"C"),e[19]=p,e[20]=q):q=e[20];let O=q,M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=i(I=>{let{scrollLeft:B,scrollTop:W}=I.currentTarget;m.current!==null&&(m.current.scrollTop=W),a.current!==null&&(a.current.scrollTop=W,a.current.scrollLeft=B)},"_"),e[21]=M):M=e[21];let D=M,T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=i(I=>{let B=d.current;B===null||I.offset===void 0||(B.focus(),B.setSelectionRange(I.offset,I.offset+(I.length??0)))},"$"),e[22]=T):T=e[22];let _=T,A;e[23]!==N||e[24]!==O||e[25]!==E||e[26]!==L?(A={onBlur:O,onChange:N,onKeyDown:E,onScroll:D,onSelect:L},e[23]=N,e[24]=O,e[25]=E,e[26]=L,e[27]=A):A=e[27];let $;return e[28]!==y||e[29]!==p||e[30]!==s||e[31]!==g||e[32]!==A?($={autocompleteState:y,closeAutocomplete:p,handlers:A,listboxId:s,onPickSuggestion:g,editorRef:d,gutterRef:m,overlayRef:a,revealDiagnostic:_},e[28]=y,e[29]=p,e[30]=s,e[31]=g,e[32]=A,e[33]=$):$=e[33],$},"fn"),mn="lunora-studio-sql-tabs",hn="lunora-studio-sql-active-tab",Be=12,Se=i((l="",e="")=>({activeId:null,id:Me("tab"),name:e,sql:l}),"ve"),fn=i(()=>Oe(hn,""),"bn"),pn=i(l=>{let e=(0,K.c)(16),[t,n]=Ce(mn),[r,o]=fn(),[s]=(0,P.useState)(l),m,a;e[0]!==s||e[1]!==n||e[2]!==t.length?(m=i(()=>{t.length===0&&n([s])},"d"),a=[s,n,t.length],e[0]=s,e[1]=n,e[2]=t.length,e[3]=m,e[4]=a):(m=e[3],a=e[4]),(0,P.useEffect)(m,a);let d;e[5]!==s||e[6]!==t?(d=t.length===0?[s]:t,e[5]=s,e[6]=t,e[7]=d):d=e[7];let f=d,p;e[8]!==r||e[9]!==f?(p=f.some(u=>u.id===r)?r:f[0]?.id??"",e[8]=r,e[9]=f,e[10]=p):p=e[10];let b=p,v;return e[11]!==b||e[12]!==o||e[13]!==n||e[14]!==f?(v={activeId:b,setActiveId:o,setTabs:n,tabs:f},e[11]=b,e[12]=o,e[13]=n,e[14]=f,e[15]=v):v=e[15],v},"gn"),at=i(l=>l.activeId===null&&l.sql.trim()!=="","Ge"),bn=i((l,e)=>[...l,e].slice(-Be),"xn"),gn=i((l,e,t)=>{let n=l.findIndex(o=>o.id===e);if(n===-1)return{activeId:l[0]?.id??"",tabs:[...l]};let r=l.filter(o=>o.id!==e);if(r.length===0){let o=t();return{activeId:o.id,tabs:[o]}}return{activeId:r[Math.min(n,r.length-1)].id,tabs:r}},"vn"),xn=i((l,e)=>{let t=l.filter(n=>n.id===e);return t.length===0?{activeId:l[0]?.id??"",tabs:[...l]}:{activeId:e,tabs:t}},"yn"),vn=i((l,e,t)=>{let n=l.findIndex(o=>o.id===e);if(n===-1)return{activeId:t,tabs:[...l]};let r=l.slice(0,n+1);return{activeId:r.some(o=>o.id===t)?t:e,tabs:r}},"wn"),yn=i(l=>{let e=l();return{activeId:e.id,tabs:[e]}},"Sn"),wn=i((l,e,t)=>{if(l==="others")return e.filter(n=>n.id!==t);if(l==="right"){let n=e.findIndex(r=>r.id===t);return n===-1?[]:e.slice(n+1)}return[...e]},"Nn"),nt={error:null,pane:"results",result:null,running:!1},Sn=i(l=>{let e=(0,K.c)(66),{activeId:t,setActiveId:n,setTabs:r,tabs:o}=pn(l),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={},e[0]=s):s=e[0];let[m,a]=(0,P.useState)(s),[d,f]=(0,P.useState)(null),[p,b]=(0,P.useState)(null),v;e[1]!==t||e[2]!==o?(v=o.find(F=>F.id===t)??o[0]??Se(),e[1]=t,e[2]=o,e[3]=v):v=e[3];let u=v,x=m[u.id]??nt,y;e[4]!==u.id||e[5]!==r?(y=i(F=>{r(j=>j.map(U=>U.id===u.id?{...U,...F}:U))},"v"),e[4]=u.id,e[5]=r,e[6]=y):y=e[6];let w=y,g;e[7]!==u.id?(g=i(F=>{a(j=>{let U=j[u.id]??nt;return{...j,[u.id]:{...U,...F}}})},"b"),e[7]=u.id,e[8]=g):g=e[8];let h=g,S;e[9]!==n||e[10]!==r||e[11]!==o.length?(S=i(()=>{if(o.length>=Be)return;let F=Se();r(j=>bn(j,F)),n(F.id)},"w"),e[9]=n,e[10]=r,e[11]=o.length,e[12]=S):S=e[12];let k=S,N;e[13]!==n||e[14]!==r?(N=i(F=>{f(null),b(null),r(F.tabs),n(F.activeId);let j=new Set(F.tabs.map(Nn));a(U=>Object.fromEntries(Object.entries(U).filter(ae=>{let[xe]=ae;return j.has(xe)})))},"S"),e[13]=n,e[14]=r,e[15]=N):N=e[15];let C=N,L;e[16]!==C||e[17]!==o?(L=i(F=>{C(gn(o,F,Se))},"R"),e[16]=C,e[17]=o,e[18]=L):L=e[18];let R=L,E;e[19]!==t||e[20]!==C||e[21]!==o?(E=i((F,j)=>{C(F==="others"?xn(o,j):F==="right"?vn(o,j,t):yn(Se))},"I"),e[19]=t,e[20]=C,e[21]=o,e[22]=E):E=e[22];let q=E,O;e[23]!==q||e[24]!==d||e[25]!==o?(O=i(F=>{d!==null&&(wn(F,o,d.id).some(kn)?b(F):q(F,d.id))},"L"),e[23]=q,e[24]=d,e[25]=o,e[26]=O):O=e[26];let M=O,D;e[27]===Symbol.for("react.memo_cache_sentinel")?(D=i((F,j)=>{j.preventDefault(),b(null),f({id:F,x:j.clientX,y:j.clientY})},"O"),e[27]=D):D=e[27];let T=D,_;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i(()=>{f(null),b(null)},"E"),e[28]=_):_=e[28];let A=_,$;e[29]===Symbol.for("react.memo_cache_sentinel")?($=i(F=>{F.preventDefault(),f(null),b(null)},"D"),e[29]=$):$=e[29];let I=$,B;e[30]!==M?(B=i(()=>{M("others")},"B"),e[30]=M,e[31]=B):B=e[31];let W=B,Q;e[32]!==M?(Q=i(()=>{M("right")},"P"),e[32]=M,e[33]=Q):Q=e[33];let Y=Q,H;e[34]!==M?(H=i(()=>{M("all")},"Q"),e[34]=M,e[35]=H):H=e[35];let G=H,J;e[36]!==q||e[37]!==p||e[38]!==d?(J=i(()=>{d!==null&&p!==null&&q(p,d.id),b(null)},"J"),e[36]=q,e[37]=p,e[38]=d,e[39]=J):J=e[39];let z=J,V;e[40]===Symbol.for("react.memo_cache_sentinel")?(V=i(()=>{b(null)},"G"),e[40]=V):V=e[40];let re=V,X;e[41]!==d?(X=d===null?void 0:{left:d.x,top:d.y},e[41]=d,e[42]=X):X=e[42];let Z=X,ee;e[43]!==r?(ee=i(F=>{r(j=>j.map(U=>U.activeId===F?{...U,activeId:null}:U))},"Z"),e[43]=r,e[44]=ee):ee=e[44];let te=ee,ne;e[45]!==r?(ne=i((F,j)=>{r(U=>U.map(ae=>ae.id===F?{...ae,name:j}:ae))},"te"),e[45]=r,e[46]=ne):ne=e[46];let le=ne,ce;return e[47]!==u||e[48]!==t||e[49]!==k||e[50]!==R||e[51]!==z||e[52]!==G||e[53]!==W||e[54]!==Y||e[55]!==x||e[56]!==h||e[57]!==w||e[58]!==p||e[59]!==le||e[60]!==n||e[61]!==d||e[62]!==Z||e[63]!==o||e[64]!==te?(ce={activeTab:u,activeTabId:t,addEditorTab:k,cancelBulk:re,closeEditorTab:R,closeTabMenu:A,confirmBulk:z,menuStyle:Z,onBackdropContextMenu:I,onCloseAll:G,onCloseOthers:W,onCloseToRight:Y,openTabMenu:T,output:x,patchActiveOutput:h,patchActiveTab:w,pendingBulk:p,renameTab:le,setActiveTabId:n,tabMenu:d,tabs:o,unlinkQuery:te},e[47]=u,e[48]=t,e[49]=k,e[50]=R,e[51]=z,e[52]=G,e[53]=W,e[54]=Y,e[55]=x,e[56]=h,e[57]=w,e[58]=p,e[59]=le,e[60]=n,e[61]=d,e[62]=Z,e[63]=o,e[64]=te,e[65]=ce):ce=e[65],ce},"kn");function Nn(l){return l.id}i(Nn,"Cn");function kn(l){return at(l)}i(kn,"$n");var Cn="lunora-studio-sql-queries",qn="lunora-studio-sql-history",Tn=25,In=i(l=>{let e=(0,K.c)(33),{loadIntoActiveTab:t,unlinkQuery:n}=l,r=oe(),[o,s]=Ce(Cn),[m,a]=Ce(qn),[d,f]=(0,P.useState)(""),p=(0,P.useRef)(null),b;e[0]!==a?(b=i(T=>{a(_=>_[0]?.sql===T?_:[{at:Date.now(),sql:T},..._.filter(A=>A.sql!==T)].slice(0,Tn))},"p"),e[0]=a,e[1]=b):b=e[1];let v=b,u;e[2]!==t||e[3]!==s||e[4]!==r?(u=i(()=>{let T={id:Me("q"),name:r("Untitled query"),sql:""};s(_=>[T,..._]),t("",T.id)},"c"),e[2]=t,e[3]=s,e[4]=r,e[5]=u):u=e[5];let x=u,y;e[6]!==t||e[7]!==o?(y=i(T=>{let _=o.find(A=>A.id===T);_!==void 0&&(t(_.sql,T),p.current?.querySelector(`[data-testid="sql-query-${T}"]`)?.scrollIntoView({block:"nearest"}))},"v"),e[6]=t,e[7]=o,e[8]=y):y=e[8];let w=y,g;e[9]!==s||e[10]!==n?(g=i(T=>{s(_=>_.filter(A=>A.id!==T)),n(T)},"b"),e[9]=s,e[10]=n,e[11]=g):g=e[11];let h=g,S;e[12]!==t?(S=i(T=>{t(T.currentTarget.dataset.sql??"",null)},"w"),e[12]=t,e[13]=S):S=e[13];let k=S,N;e[14]!==t?(N=i(T=>{t(T.currentTarget.dataset.sql??"",null)},"S"),e[14]=t,e[15]=N):N=e[15];let C=N,L;e[16]!==a?(L=i(()=>{a([])},"R"),e[16]=a,e[17]=L):L=e[17];let R=L,E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=i(T=>{f(T.target.value)},"I"),e[18]=E):E=e[18];let q=E,O;e[19]!==s?(O=i((T,_)=>{s(A=>A.map($=>$.id===T?{...$,sql:_}:$))},"L"),e[19]=s,e[20]=O):O=e[20];let M=O,D;return e[21]!==R||e[22]!==h||e[23]!==m||e[24]!==C||e[25]!==k||e[26]!==x||e[27]!==o||e[28]!==v||e[29]!==d||e[30]!==w||e[31]!==M?(D={clearHistory:R,deleteQuery:h,history:m,listRef:p,loadFromHistory:C,loadTemplate:k,newQuery:x,onSearchChange:q,queries:o,recordHistory:v,search:d,selectQuery:w,updateQuerySql:M},e[21]=R,e[22]=h,e[23]=m,e[24]=C,e[25]=k,e[26]=x,e[27]=o,e[28]=v,e[29]=d,e[30]=w,e[31]=M,e[32]=D):D=e[32],D},"In"),it="p-3 font-mono text-xs leading-5 whitespace-pre-wrap break-words",Rn=i((l,e)=>{let t=[];for(let r of l){if(r.offset===void 0||r.length===void 0||r.length<=0)continue;let o=Math.max(0,Math.min(r.offset,e)),s=Math.max(o,Math.min(r.offset+r.length,e));o!==s&&t.push({end:s,severity:r.severity,start:o})}t.sort((r,o)=>r.start-o.start);let n=[];for(let r of t)r.start>=(n.at(-1)?.end??0)&&n.push(r);return n},"En"),Ln=i(l=>l==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":l==="empty-response"?"The model returned nothing usable.":"The model could not be reached.","Ln"),En=i(l=>{let e=(0,K.c)(51),{assistant:t,failed:n,onGenerated:r}=l,o=oe(),[s,m]=(0,P.useState)("");if(t.unavailable)return null;let a;e[0]!==t?(a=t.pending("sql"),e[0]=t,e[1]=a):a=e[1];let d=a,f;if(e[2]!==t||e[3]!==n||e[4]!==r||e[5]!==d||e[6]!==s||e[7]!==o){let p=t.reason("sql"),b;e[9]!==t||e[10]!==n||e[11]!==r||e[12]!==s?(b=i(q=>{let O=s.trim();O===""&&!q||ie((async()=>{let M=await t.generate(O===""?"fix the failing statement":O,q?n:void 0);M!==void 0&&r(M)})())},"p"),e[9]=t,e[10]=n,e[11]=r,e[12]=s,e[13]=b):b=e[13];let v=b,u;e[14]!==o?(u=o("Describe the query you want"),e[14]=o,e[15]=u):u=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=i(q=>{m(q.target.value)},"g"),e[16]=x):x=e[16];let y;e[17]!==v?(y=i(q=>{q.key==="Enter"&&(q.preventDefault(),v(!1))},"v"),e[17]=v,e[18]=y):y=e[18];let w;e[19]!==o?(w=o("Describe the query you want"),e[19]=o,e[20]=w):w=e[20];let g;e[21]!==d||e[22]!==s||e[23]!==u||e[24]!==y||e[25]!==w?(g=(0,c.jsx)(Fe,{"aria-label":u,className:"h-7 flex-1 text-xs","data-testid":"sql-assistant-prompt",disabled:d,onChange:x,onKeyDown:y,placeholder:w,value:s}),e[21]=d,e[22]=s,e[23]=u,e[24]=y,e[25]=w,e[26]=g):g=e[26];let h=d&&"opacity-60",S;e[27]!==h?(S=ue("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",h),e[27]=h,e[28]=S):S=e[28];let k;e[29]!==d||e[30]!==s?(k=d||s.trim()==="",e[29]=d,e[30]=s,e[31]=k):k=e[31];let N;e[32]!==v?(N=i(()=>{v(!1)},"S"),e[32]=v,e[33]=N):N=e[33];let C;e[34]!==d||e[35]!==o?(C=o(d?"Thinking\u2026":"Draft SQL"),e[34]=d,e[35]=o,e[36]=C):C=e[36];let L;e[37]!==S||e[38]!==k||e[39]!==N||e[40]!==C?(L=(0,c.jsx)("button",{className:S,"data-testid":"sql-assistant-generate",disabled:k,onClick:N,type:"button",children:C}),e[37]=S,e[38]=k,e[39]=N,e[40]=C,e[41]=L):L=e[41];let R;e[42]!==n||e[43]!==d||e[44]!==v||e[45]!==o?(R=n!==void 0&&(0,c.jsx)("button",{className:"rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-assistant-fix",disabled:d,onClick:i(()=>{v(!0)},"onClick"),type:"button",children:o("Fix this")}),e[42]=n,e[43]=d,e[44]=v,e[45]=o,e[46]=R):R=e[46];let E;e[47]!==L||e[48]!==R||e[49]!==g?(E=(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[g,L,R]}),e[47]=L,e[48]=R,e[49]=g,e[50]=E):E=e[50],f=(0,c.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border px-3 py-2","data-testid":"sql-assistant",children:[E,p!==void 0&&(0,c.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-assistant-reason",role:"status",children:Ln(p)})]}),e[2]=t,e[3]=n,e[4]=r,e[5]=d,e[6]=s,e[7]=o,e[8]=f}else f=e[8];return f},"_n"),_n=i(l=>{let e=(0,K.c)(8),{diagnostics:t,draft:n,scrollRef:r}=l,o,s;if(e[0]!==t||e[1]!==n){s=Symbol.for("react.early_return_sentinel");e:{let d=Rn(t,n.length);if(d.length===0){s=null;break e}o=[];let f=0;for(let[p,b]of d.entries())b.start>f&&o.push(n.slice(f,b.start)),o.push((0,c.jsx)("span",{className:ue("decoration-wavy underline underline-offset-4",b.severity==="error"?"decoration-destructive":"decoration-amber-500"),children:n.slice(b.start,b.end)},`${b.start.toString()}-${p.toString()}`)),f=b.end;o.push(n.slice(f))}e[0]=t,e[1]=n,e[2]=o,e[3]=s}else o=e[2],s=e[3];if(s!==Symbol.for("react.early_return_sentinel"))return s;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=ue("pointer-events-none absolute inset-0 overflow-hidden text-transparent",it),e[4]=m):m=e[4];let a;return e[5]!==o||e[6]!==r?(a=(0,c.jsx)("div",{"aria-hidden":"true",className:m,"data-testid":"sql-diagnostics-overlay",ref:r,children:o}),e[5]=o,e[6]=r,e[7]=a):a=e[7],a},"On"),On={gate:"read-only",plan:"plan",schema:"schema",syntax:"syntax"},Mn=i(l=>{let e=(0,K.c)(10),{diagnostics:t,onSelect:n}=l,r=oe();if(t.length===0)return null;let o;e[0]!==r?(o=r("SQL problems"),e[0]=r,e[1]=o):o=e[1];let s;if(e[2]!==t||e[3]!==n){let a;e[5]!==n?(a=i((d,f)=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{className:"flex w-full items-start gap-2 px-3 py-1 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-problem",onClick:i(()=>{n(d)},"onClick"),type:"button",children:[(0,c.jsx)("span",{className:ue("mt-px shrink-0 rounded px-1 font-mono text-[10px] uppercase",d.severity==="error"?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"),children:On[d.source]}),(0,c.jsx)("span",{className:"min-w-0 text-muted-foreground",children:d.message})]})},`${d.source}-${(d.offset??f).toString()}-${f.toString()}`),"a"),e[5]=n,e[6]=a):a=e[6],s=t.map(a),e[2]=t,e[3]=n,e[4]=s}else s=e[4];let m;return e[7]!==o||e[8]!==s?(m=(0,c.jsx)("ul",{"aria-label":o,className:"max-h-24 shrink-0 overflow-y-auto border-t border-border bg-muted/30","data-testid":"sql-problems",children:s}),e[7]=o,e[8]=s,e[9]=m):m=e[9],m},"Dn"),Dn={minWidth:"2.75rem",paddingInline:"0.5rem"},An=i(l=>{let e=(0,K.c)(64),{assistant:t,autocomplete:n,diagnostics:r,draft:o,failed:s,handlers:m,editorRef:a,gutterRef:d,listboxId:f,onGenerated:p,onPickSuggestion:b,onRevealDiagnostic:v,overlayRef:u}=l,x=oe(),y,w,g,h,S,k,N,C;if(e[0]!==t||e[1]!==o||e[2]!==s||e[3]!==d||e[4]!==p){let B=o.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-UDOOZJO5.js";import{f as c}from"./chunk-UQV7Q5S4.js";import{a as r,e as f,g}from"./chunk-3XIESWL4.js";var m=f(g(),1);var p={capabilities:{accounts:!0,admin:!0,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},y=r(()=>{let o=(0,m.c)(6),t=c(),a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],o[0]=a):a=o[0];let e;o[1]!==t?(e=r(()=>t.getAuthConfig(),"o"),o[1]=t,o[2]=e):e=o[2];let{data:u,isLoading:d}=l(a,e),i=u??p,n=!d,s;return o[3]!==i||o[4]!==n?(s={config:i,ready:n},o[3]=i,o[4]=n,o[5]=s):s=o[5],s},"A");export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $}from"./chunk-
|
|
1
|
+
import{a as $}from"./chunk-CJQ2534J.js";import{a as b}from"./chunk-OKIEDUHL.js";import"./chunk-XXQUMVWH.js";import"./chunk-NQVE5YON.js";import"./chunk-QLQADHFE.js";import{a as u}from"./chunk-VDW32UET.js";import{c as p}from"./chunk-UDOOZJO5.js";import"./chunk-UQV7Q5S4.js";import"./chunk-XBDKZZ67.js";import{a as y,b as w,c as j,d as h,e as i,f as n}from"./chunk-WJQLNYGX.js";import{a as l,e as c}from"./chunk-WQH3LT2P.js";import{d as k}from"./chunk-IUYFXK4X.js";import"./chunk-5DVJR52Z.js";import{a as o,e as S,h as T,j as x}from"./chunk-3XIESWL4.js";var e=S(T(),1);var m={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},A={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},O=o((r,a)=>`exempt: ${r.exemptReason===void 0||r.exemptReason===""?a:r.exemptReason}`,"S"),P=o(r=>r.toSorted((a,d)=>a.coverage==="clean"&&d.coverage!=="clean"?1:d.coverage==="clean"&&a.coverage!=="clean"?-1:a.score-d.score),"T"),q=o(({testId:r="advisor-health"})=>{let a=k(),d=p(u.getAdvisories,{},{live:!0}),g=p(u.getAdvisorProcedures,{},{live:!0}),f=d.data?.advisories??null,N=g.data?.procedures??null,t=f===null||N===null?null:$(N,f),v=g.error??d.error;if(v!==null)return(0,e.jsx)(b,{error:v,testId:`${r}-error`});if(t===null)return(0,e.jsx)(l,{children:(0,e.jsx)(c,{className:"py-8 text-center text-muted-foreground","data-testid":`${r}-loading`,children:a("Loading\u2026")})});let I=P(t.procedures);return(0,e.jsxs)("div",{className:"space-y-4","data-testid":r,children:[(0,e.jsx)(l,{children:(0,e.jsxs)(c,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:x("text-4xl font-semibold tabular-nums",A[t.grade]),"data-testid":`${r}-score`,children:t.score}),(0,e.jsx)("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),(0,e.jsx)("span",{className:x("text-sm font-medium uppercase tracking-wide",A[t.grade]),"data-testid":`${r}-grade`,children:t.grade}),(0,e.jsxs)("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${r}-summary`,children:[(0,e.jsxs)("span",{className:m.clean,children:[t.summary.clean," ",a("clean")]}),(0,e.jsxs)("span",{className:m.warned,children:[t.summary.warned," ",a("warned")]}),(0,e.jsxs)("span",{className:m.failing,children:[t.summary.failing," ",a("failing")]}),(0,e.jsxs)("span",{className:m.exempt,children:[t.summary.exempt," ",a("exempt")]})]})]})}),t.project.checks.length>0&&(0,e.jsx)(l,{children:(0,e.jsxs)(c,{className:"py-4 text-sm","data-testid":`${r}-project`,children:[(0,e.jsxs)("span",{className:"font-medium",children:[a("Schema & config")," ",t.project.score,"/100"]}),(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \u2014 ",t.project.checks.map(s=>s.name).join(", ")]})]})}),(0,e.jsx)(l,{children:(0,e.jsx)(c,{className:"p-0",children:(0,e.jsxs)(y,{children:[(0,e.jsx)(w,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(i,{className:"w-20",children:a("Score")}),(0,e.jsx)(i,{children:a("Procedure")}),(0,e.jsx)(i,{className:"w-32",children:a("Kind")}),(0,e.jsx)(i,{children:a("Rules fired")})]})}),(0,e.jsx)(j,{children:I.map(s=>(0,e.jsxs)(h,{"data-testid":`${r}-row`,children:[(0,e.jsx)(n,{className:x("tabular-nums font-medium",m[s.coverage]),children:s.coverage==="exempt"?"\u2014":s.score}),(0,e.jsx)(n,{className:"font-mono text-xs",children:s.id}),(0,e.jsxs)(n,{className:"text-muted-foreground text-xs",children:[s.visibility," ",s.kind,s.sensitivity.level==="high"&&(0,e.jsx)("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),(0,e.jsx)(n,{className:"text-muted-foreground text-xs",children:s.coverage==="exempt"?O(s,a("no reason given")):s.checks.map(R=>R.name).join(", ")})]},s.id))})]})})})]})},"O");export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-54MMVNPT.js";import{b as x}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as B}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-54MMVNPT.js";import{b as x}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as B}from"./chunk-UDOOZJO5.js";import{f as O}from"./chunk-UQV7Q5S4.js";import"./chunk-XBDKZZ67.js";import{a as j}from"./chunk-XQCVZAGU.js";import{a as W,b as q,c as E,d as S,e as r,f as s}from"./chunk-WJQLNYGX.js";import{a as A,e as L}from"./chunk-WQH3LT2P.js";import{d as z}from"./chunk-IUYFXK4X.js";import"./chunk-5DVJR52Z.js";import{a as T,e as M,g as $,h as I}from"./chunk-3XIESWL4.js";var F=M($(),1);var n=M(I(),1);var J=2e3,Q=new Set(["open"]),re=T(G=>{let e=(0,F.c)(41),{read:y}=G,t=z(),K=O(),v;e[0]!==K||e[1]!==y?(v=T(()=>Promise.resolve(y?y():K.debug()),"S"),e[0]=K,e[1]=y,e[2]=v):v=e[2];let H=v,P=y?"injected":"live",b;e[3]!==P?(b=["lunora-studio","sync-client-debug",P],e[3]=P,e[4]=b):b=e[4];let{data:c,refetch:Y}=B(b,H);if(D(Y,!0,J),!c){let i;e[5]!==t?(i=t("Reading the sync client's state\u2026"),e[5]=t,e[6]=i):i=e[6];let g;e[7]!==t?(g=t("Sync client"),e[7]=t,e[8]=g):g=e[8];let _;return e[9]!==i||e[10]!==g?(_=(0,n.jsx)(A,{children:(0,n.jsx)(L,{children:(0,n.jsx)(j,{description:i,title:g})})}),e[9]=i,e[10]=g,e[11]=_):_=e[11],_}let{pendingWrites:k,shards:N,subscriptions:w}=c,l;e[12]!==t?(l=t("This Studio session's sync client"),e[12]=t,e[13]=l):l=e[13];let a;e[14]!==l?(a=(0,n.jsx)("span",{className:"text-sm font-medium",children:l}),e[14]=l,e[15]=a):a=e[15];let R=c.connectionStatus==="connected"?"default":"secondary",o;e[16]!==c.connectionStatus||e[17]!==R?(o=(0,n.jsx)(x,{variant:R,children:c.connectionStatus}),e[16]=c.connectionStatus,e[17]=R,e[18]=o):o=e[18];let d;e[19]!==k||e[20]!==t?(d=k>0?(0,n.jsx)(x,{variant:"secondary",children:t("{count} pending writes",{count:k})}):null,e[19]=k,e[20]=t,e[21]=d):d=e[21];let h;e[22]!==a||e[23]!==o||e[24]!==d?(h=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a,o,d]}),e[22]=a,e[23]=o,e[24]=d,e[25]=h):h=e[25];let u;e[26]!==t?(u=t("Reads client.debug() for the client running in this page \u2014 not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there."),e[26]=t,e[27]=u):u=e[27];let m;e[28]!==u?(m=(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:u}),e[28]=u,e[29]=m):m=e[29];let p;e[30]!==N||e[31]!==t?(p=N.length===0?(0,n.jsx)(j,{description:t("No shard connection has been opened yet."),title:t("No shards")}):(0,n.jsxs)(W,{children:[(0,n.jsx)(q,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(r,{children:t("Shard")}),(0,n.jsx)(r,{children:t("Socket")}),(0,n.jsx)(r,{children:t("Confirmed watermark")})]})}),(0,n.jsx)(E,{children:N.map(i=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{children:i.shardKey??t("(default)")}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:Q.has(i.wsState)?"default":"secondary",children:i.wsState})}),(0,n.jsx)(s,{children:i.confirmedMutationWatermark})]},i.shardKey??"__default__"))})]}),e[30]=N,e[31]=t,e[32]=p):p=e[32];let f;e[33]!==w||e[34]!==t?(f=w.length===0?(0,n.jsx)(j,{description:t("This client holds no live queries or shapes."),title:t("No subscriptions")}):(0,n.jsxs)(W,{children:[(0,n.jsx)(q,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(r,{children:t("Subscription")}),(0,n.jsx)(r,{children:t("Kind")}),(0,n.jsx)(r,{children:t("Acked")}),(0,n.jsx)(r,{children:t("Cursor")}),(0,n.jsx)(r,{children:t("Pending overlays")})]})}),(0,n.jsx)(E,{children:w.map(i=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{className:"font-mono text-xs",children:i.functionPath}),(0,n.jsx)(s,{children:i.kind}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:i.acked?"default":"secondary",children:i.acked?t("yes"):t("no")})}),(0,n.jsx)(s,{children:i.serverCursor??"\u2014"}),(0,n.jsx)(s,{children:i.pendingOptimisticLayers})]},i.id))})]}),e[33]=w,e[34]=t,e[35]=f):f=e[35];let C;return e[36]!==m||e[37]!==p||e[38]!==f||e[39]!==h?(C=(0,n.jsx)(A,{children:(0,n.jsxs)(L,{className:"flex flex-col gap-4",children:[h,m,p,f]})}),e[36]=m,e[37]=p,e[38]=f,e[39]=h,e[40]=C):C=e[40],C},"re");export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as He}from"./chunk-V53KNYRN.js";import{a as Ke}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{a as Ge}from"./chunk-Y32QIKBS.js";import{R as We}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{a as le}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as de}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Pe}from"./chunk-ZBVGZ4YA.js";import{a as Ue}from"./chunk-XXQUMVWH.js";import"./chunk-56Q3NCCQ.js";import"./chunk-QLQADHFE.js";import{a as F}from"./chunk-VDW32UET.js";import{c as _e}from"./chunk-KMT6UDR7.js";import{f as ze}from"./chunk-WVU7GHTG.js";import"./chunk-XBDKZZ67.js";import{a as ie}from"./chunk-XQCVZAGU.js";import{a as Te,b as ke,c as Be,d as G,e as C,f as w}from"./chunk-WJQLNYGX.js";import{a as De,e as Ee}from"./chunk-WQH3LT2P.js";import{d as $,f as ce,g as ue,h as me,o as he,r as je}from"./chunk-IUYFXK4X.js";import"./chunk-BR5GIQWK.js";import{a as h,e as Me,f as rt,g as nt,h as ot}from"./chunk-3XIESWL4.js";var z=Me(nt(),1);var A=Me(rt(),1);var t=Me(ot(),1);var dt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),l=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),d=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:d,queuesWithoutDlq:l,showReliabilityWarning:l.length>0||d>0}},"rt"),lt=200,it=ce(F.sendQueueMessage),ct=ce(F.replayQueueMessage),ut=ce(F.clearQueueMessages),Xe=96,mt=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n)}catch{return"[unserializable]"}},"it"),ht=h(n=>n.length>Xe?`${n.slice(0,Xe)}\u2026`:n,"ut"),pt=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","ct"),gt=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"mt"),ft=h(n=>{let e=(0,z.c)(11),{loaded:a,queues:l}=n,d=$(),s;e[0]!==d?(s=d("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=d,e[1]=s):s=e[1];let o;e[2]!==s?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==l||e[6]!==d?(r=a&&l.length===0?(0,t.jsx)(ie,{description:d("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:d("No queues defined")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsxs)(Te,{"data-testid":"queues-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:d("Export")}),(0,t.jsx)(C,{children:d("Queue")}),(0,t.jsx)(C,{children:d("Mode")}),(0,t.jsx)(C,{children:d("Binding")}),(0,t.jsx)(C,{children:d("Dead-letter")})]})}),(0,t.jsx)(Be,{children:l.map(bt)})]})})}),e[4]=a,e[5]=l,e[6]=d,e[7]=r):r=e[7];let p;return e[8]!==o||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[o,r]}),e[8]=o,e[9]=r,e[10]=p):p=e[10],p},"ht"),xt=h(n=>{let e=(0,z.c)(67),{message:a,onReplay:l,replayingId:d}=n,s=$(),o,r,p,u,x,N,y,i,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let W=mt(a.body);r=G,N=`queues-message-${a.id}`;let j=a.exportName??a.queue;e[19]!==j?(y=(0,t.jsx)(w,{className:"font-mono text-xs",children:j}),e[19]=j,e[20]=y):y=e[20],e[21]!==a.messageId?(i=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=i):i=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let D=`queues-outcome-${a.id}`,E;e[25]!==a.outcome?(E=pt(a.outcome),e[25]=a.outcome,e[26]=E):E=e[26];let I;e[27]!==a.outcome||e[28]!==D||e[29]!==E?(I=(0,t.jsx)(de,{"data-testid":D,variant:E,children:a.outcome}),e[27]=a.outcome,e[28]=D,e[29]=E,e[30]=I):I=e[30];let _;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(_=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=_):_=e[34],e[35]!==I||e[36]!==_?(f=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,_]})}),e[35]=I,e[36]=_,e[37]=f):f=e[37],o=w,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=W,x=ht(W),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=o,e[10]=r,e[11]=p,e[12]=u,e[13]=x,e[14]=N,e[15]=y,e[16]=i,e[17]=m,e[18]=f}else o=e[9],r=e[10],p=e[11],u=e[12],x=e[13],N=e[14],y=e[15],i=e[16],m=e[17],f=e[18];let g;e[38]!==o||e[39]!==p||e[40]!==u||e[41]!==x?(g=(0,t.jsx)(o,{className:p,title:u,children:x}),e[38]=o,e[39]=p,e[40]=u,e[41]=x,e[42]=g):g=e[42];let q;e[43]!==a.capturedAt?(q=je(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,M=d!==null,Q;e[47]!==a.id||e[48]!==d||e[49]!==s?(Q=d===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=d,e[49]=s,e[50]=Q):Q=e[50];let L;e[51]!==a.id||e[52]!==l||e[53]!==S||e[54]!==M||e[55]!==Q?(L=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":S,disabled:M,onClick:l,size:"xs",type:"button",variant:"outline",children:Q})}),e[51]=a.id,e[52]=l,e[53]=S,e[54]=M,e[55]=Q,e[56]=L):L=e[56];let T;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==N||e[61]!==y||e[62]!==i||e[63]!==m||e[64]!==f||e[65]!==g?(T=(0,t.jsxs)(r,{"data-testid":N,children:[y,i,m,f,g,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=N,e[61]=y,e[62]=i,e[63]=m,e[64]=f,e[65]=g,e[66]=T):T=e[66],T},"pt"),yt=h(n=>{let e=(0,z.c)(30),{hasError:a,messages:l,onClear:d,onReplay:s,replayingId:o}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let u;e[2]!==p?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=u):u=e[3];let x;e[4]!==l.length||e[5]!==r?(x=r("Clear {count} messages?",{count:l.length}),e[4]=l.length,e[5]=r,e[6]=x):x=e[6];let N=l.length===0,y;e[7]!==r?(y=r("Clear log"),e[7]=r,e[8]=y):y=e[8];let i;e[9]!==d||e[10]!==x||e[11]!==N||e[12]!==y?(i=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(Ge,{confirmLabel:x,disabled:N,onConfirm:d,testId:"queues-clear",children:y})}),e[9]=d,e[10]=x,e[11]=N,e[12]=y,e[13]=i):i=e[13];let m;e[14]!==l.length||e[15]!==r?(m=l.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:l.length})}),e[14]=l.length,e[15]=r,e[16]=m):m=e[16];let f;e[17]!==u||e[18]!==i||e[19]!==m?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,i,m]}),e[17]=u,e[18]=i,e[19]=m,e[20]=f):f=e[20];let g;e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==o||e[25]!==r?(g=!a&&l.length===0?(0,t.jsx)(ie,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsx)(Ve,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(Te,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Message")}),(0,t.jsx)(C,{children:r("Attempts")}),(0,t.jsx)(C,{children:r("Outcome")}),(0,t.jsx)(C,{children:r("Body")}),(0,t.jsx)(C,{children:r("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(Be,{children:l.map(b=>(0,t.jsx)(xt,{message:b,onReplay:s,replayingId:o},b.id))})]})})})}),e[21]=a,e[22]=l,e[23]=s,e[24]=o,e[25]=r,e[26]=g):g=e[26];let q;return e[27]!==f||e[28]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[f,g]}),e[27]=f,e[28]=g,e[29]=q):q=e[29],q},"gt"),Nt=h(n=>{let e=(0,z.c)(20),{batchMode:a,bodyText:l,delayText:d,onBatchModeChange:s,onBodyChange:o,onDelayChange:r,onSelectExport:p,onSend:u,queues:x,selectedExportName:N,sending:y}=n,i=$(),m;e[0]!==i?(m=i("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=i,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a||e[5]!==l||e[6]!==d||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==p||e[11]!==u||e[12]!==x||e[13]!==N||e[14]!==y||e[15]!==i?(g=x.length===0?(0,t.jsx)(ie,{description:i("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:i("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":i("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:p,value:N,children:x.map(qt)}),(0,t.jsx)(We,{"aria-label":i("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:i("Delay (s)"),type:"number",value:d}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),i("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||N==="",onClick:u,type:"button",children:i(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(He,{"aria-label":i("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:o,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:l})]}),e[4]=a,e[5]=l,e[6]=d,e[7]=s,e[8]=o,e[9]=r,e[10]=p,e[11]=u,e[12]=x,e[13]=N,e[14]=y,e[15]=i,e[16]=g):g=e[16];let q;return e[17]!==f||e[18]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,g]}),e[17]=f,e[18]=g,e[19]=q):q=e[19],q},"ft"),Ft=h(n=>{let e=(0,z.c)(59),{limit:a}=n,l=a??lt,d=ze(),s=$(),[o,r]=(0,A.useState)("declared"),[p,u]=(0,A.useState)(null),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let{data:N,error:y,errorSource:i}=_e(F.listQueues,x),m;e[1]!==l?(m={limit:l},e[1]=l,e[2]=m):m=e[2];let{data:f,error:g,errorSource:q,refetch:b}=_e(F.getQueueMessages,m),S=Array.isArray(N?.queues)?[...N.queues].toSorted(vt):[],M=f?.entries??[],{deadLetteredCount:Q,queuesWithoutDlq:L,showReliabilityWarning:T}=dt(S,M),[W,j]=(0,A.useState)(""),[D,E]=(0,A.useState)(""),[I,_]=(0,A.useState)(""),[U,Ye]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(c=>c.exportName===W)?W:S[0]?.exportName??"",Je=o==="messages"?g:y,Ze=o==="messages"?q:i,fe=Je??p,xe=Je===null?p:Ze,K;e[3]!==b?(K=h(()=>{b()},"H"),e[3]=b,e[4]=K):K=e[4],Ke(K,o==="messages");let ye=h(async()=>{u(null);let c=H;if(c==="")return;let v=null,$e=D.trim();if($e!=="")try{v=JSON.parse($e)}catch{u(s("Body must be valid JSON."));return}let Ae,Fe=I.trim();if(Fe!==""){let P=Number(Fe);if(!Number.isFinite(P)||P<0){u(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(U&&!Array.isArray(v)){u(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=U?{batch:v,delaySeconds:Ae,exportName:c}:{body:v,delaySeconds:Ae,exportName:c};try{await d.query(it,st,ue("")),b()}catch(P){u(me(P))}Oe(!1)},"ce"),V;e[5]!==d||e[6]!==b?(V=h(async c=>{u(null),Re(c);try{await d.query(ct,{id:c},ue("")),b()}catch(v){u(me(v))}Re(null)},"K"),e[5]=d,e[6]=b,e[7]=V):V=e[7];let Ne=V,X;e[8]!==d||e[9]!==b?(X=h(async()=>{u(null);try{await d.query(ut,{},ue("")),b()}catch(c){u(me(c))}},"V"),e[8]=d,e[9]=b,e[10]=X):X=e[10];let be=X,Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=h(c=>{let v=c.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Y):Y=e[11];let et=Y,Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=h(c=>{j(c.currentTarget.value)},"Y"),e[12]=Z):Z=e[12];let qe=Z,ee;e[13]===Symbol.for("react.memo_cache_sentinel")?(ee=h(c=>{E(c.currentTarget.value)},"Z"),e[13]=ee):ee=e[13];let ve=ee,te;e[14]===Symbol.for("react.memo_cache_sentinel")?(te=h(c=>{_(c.currentTarget.value)},"ee"),e[14]=te):te=e[14];let Se=te,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=h(c=>{Ye(c.currentTarget.checked)},"te"),e[15]=ae):ae=e[15];let Ce=ae,se;e[16]!==ye?(se=h(()=>{he(ye())},"ae"),e[16]=ye,e[17]=se):se=e[17];let we=se,re;e[18]!==Ne?(re=h(c=>{let{id:v}=c.currentTarget.dataset;v!==void 0&&he(Ne(v))},"se"),e[18]=Ne,e[19]=re):re=e[19];let Ie=re,ne;e[20]!==be?(ne=h(()=>{he(be())},"re"),e[20]=be,e[21]=ne):ne=e[21];let Qe=ne,tt="flex flex-col gap-6",at="lunora-queues-panel",k;e[22]!==s||e[23]!==o?(k=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(c=>(0,t.jsx)(le,{"aria-selected":o===c,"data-tab":c,"data-testid":`queues-tab-${c}`,onClick:et,role:"tab",size:"sm",type:"button",variant:o===c?"secondary":"ghost",children:gt(c,s)},c))}),e[22]=s,e[23]=o,e[24]=k):k=e[24];let B;e[25]!==fe||e[26]!==xe?(B=fe!==null&&(0,t.jsx)(Pe,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=B):B=e[27];let Le=T&&(0,t.jsx)(Ue,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(St).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),Q>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:Q===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:Q})})]})}),O;e[28]!==S||e[29]!==N||e[30]!==o?(O=o==="declared"&&(0,t.jsx)(ft,{loaded:N!==void 0,queues:S}),e[28]=S,e[29]=N,e[30]=o,e[31]=O):O=e[31];let R;e[32]!==M||e[33]!==g||e[34]!==Qe||e[35]!==Ie||e[36]!==ge||e[37]!==o?(R=o==="messages"&&(0,t.jsx)(yt,{hasError:g!==null,messages:M,onClear:Qe,onReplay:Ie,replayingId:ge}),e[32]=M,e[33]=g,e[34]=Qe,e[35]=Ie,e[36]=ge,e[37]=o,e[38]=R):R=e[38];let J;e[39]!==U||e[40]!==D||e[41]!==I||e[42]!==Ce||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==we||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==o?(J=o==="send"&&(0,t.jsx)(Nt,{batchMode:U,bodyText:D,delayText:I,onBatchModeChange:Ce,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:we,queues:S,selectedExportName:H,sending:pe}),e[39]=U,e[40]=D,e[41]=I,e[42]=Ce,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=we,e[47]=S,e[48]=H,e[49]=pe,e[50]=o,e[51]=J):J=e[51];let oe;return e[52]!==k||e[53]!==B||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:tt,"data-testid":at,children:[k,B,Le,O,R,J]}),e[52]=k,e[53]=B,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"Ft");function bt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(w,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(bt,"xt");function qt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(qt,"yt");function vt(n,e){return n.exportName.localeCompare(e.exportName)}h(vt,"Nt");function St(n){return n.name}h(St,"bt");export{Ft as default};
|
|
1
|
+
import{a as Ve}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as He}from"./chunk-V53KNYRN.js";import{a as Ke}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{a as Ge}from"./chunk-Y32QIKBS.js";import{R as We}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{a as le}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as de}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Pe}from"./chunk-OKIEDUHL.js";import{a as Ue}from"./chunk-XXQUMVWH.js";import"./chunk-NQVE5YON.js";import"./chunk-QLQADHFE.js";import{a as F}from"./chunk-VDW32UET.js";import{c as _e}from"./chunk-UDOOZJO5.js";import{f as ze}from"./chunk-UQV7Q5S4.js";import"./chunk-XBDKZZ67.js";import{a as ie}from"./chunk-XQCVZAGU.js";import{a as Te,b as ke,c as Be,d as G,e as C,f as w}from"./chunk-WJQLNYGX.js";import{a as De,e as Ee}from"./chunk-WQH3LT2P.js";import{d as $,f as ce,g as ue,h as me,o as he,r as je}from"./chunk-IUYFXK4X.js";import"./chunk-5DVJR52Z.js";import{a as h,e as Me,f as rt,g as nt,h as ot}from"./chunk-3XIESWL4.js";var z=Me(nt(),1);var A=Me(rt(),1);var t=Me(ot(),1);var dt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),l=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),d=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:d,queuesWithoutDlq:l,showReliabilityWarning:l.length>0||d>0}},"rt"),lt=200,it=ce(F.sendQueueMessage),ct=ce(F.replayQueueMessage),ut=ce(F.clearQueueMessages),Xe=96,mt=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n)}catch{return"[unserializable]"}},"it"),ht=h(n=>n.length>Xe?`${n.slice(0,Xe)}\u2026`:n,"ut"),pt=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","ct"),gt=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"mt"),ft=h(n=>{let e=(0,z.c)(11),{loaded:a,queues:l}=n,d=$(),s;e[0]!==d?(s=d("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=d,e[1]=s):s=e[1];let o;e[2]!==s?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==l||e[6]!==d?(r=a&&l.length===0?(0,t.jsx)(ie,{description:d("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:d("No queues defined")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsxs)(Te,{"data-testid":"queues-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:d("Export")}),(0,t.jsx)(C,{children:d("Queue")}),(0,t.jsx)(C,{children:d("Mode")}),(0,t.jsx)(C,{children:d("Binding")}),(0,t.jsx)(C,{children:d("Dead-letter")})]})}),(0,t.jsx)(Be,{children:l.map(bt)})]})})}),e[4]=a,e[5]=l,e[6]=d,e[7]=r):r=e[7];let p;return e[8]!==o||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[o,r]}),e[8]=o,e[9]=r,e[10]=p):p=e[10],p},"ht"),xt=h(n=>{let e=(0,z.c)(67),{message:a,onReplay:l,replayingId:d}=n,s=$(),o,r,p,u,x,N,y,i,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let W=mt(a.body);r=G,N=`queues-message-${a.id}`;let j=a.exportName??a.queue;e[19]!==j?(y=(0,t.jsx)(w,{className:"font-mono text-xs",children:j}),e[19]=j,e[20]=y):y=e[20],e[21]!==a.messageId?(i=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=i):i=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let D=`queues-outcome-${a.id}`,E;e[25]!==a.outcome?(E=pt(a.outcome),e[25]=a.outcome,e[26]=E):E=e[26];let I;e[27]!==a.outcome||e[28]!==D||e[29]!==E?(I=(0,t.jsx)(de,{"data-testid":D,variant:E,children:a.outcome}),e[27]=a.outcome,e[28]=D,e[29]=E,e[30]=I):I=e[30];let _;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(_=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=_):_=e[34],e[35]!==I||e[36]!==_?(f=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,_]})}),e[35]=I,e[36]=_,e[37]=f):f=e[37],o=w,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=W,x=ht(W),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=o,e[10]=r,e[11]=p,e[12]=u,e[13]=x,e[14]=N,e[15]=y,e[16]=i,e[17]=m,e[18]=f}else o=e[9],r=e[10],p=e[11],u=e[12],x=e[13],N=e[14],y=e[15],i=e[16],m=e[17],f=e[18];let g;e[38]!==o||e[39]!==p||e[40]!==u||e[41]!==x?(g=(0,t.jsx)(o,{className:p,title:u,children:x}),e[38]=o,e[39]=p,e[40]=u,e[41]=x,e[42]=g):g=e[42];let q;e[43]!==a.capturedAt?(q=je(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,M=d!==null,Q;e[47]!==a.id||e[48]!==d||e[49]!==s?(Q=d===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=d,e[49]=s,e[50]=Q):Q=e[50];let L;e[51]!==a.id||e[52]!==l||e[53]!==S||e[54]!==M||e[55]!==Q?(L=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":S,disabled:M,onClick:l,size:"xs",type:"button",variant:"outline",children:Q})}),e[51]=a.id,e[52]=l,e[53]=S,e[54]=M,e[55]=Q,e[56]=L):L=e[56];let T;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==N||e[61]!==y||e[62]!==i||e[63]!==m||e[64]!==f||e[65]!==g?(T=(0,t.jsxs)(r,{"data-testid":N,children:[y,i,m,f,g,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=N,e[61]=y,e[62]=i,e[63]=m,e[64]=f,e[65]=g,e[66]=T):T=e[66],T},"pt"),yt=h(n=>{let e=(0,z.c)(30),{hasError:a,messages:l,onClear:d,onReplay:s,replayingId:o}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let u;e[2]!==p?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=u):u=e[3];let x;e[4]!==l.length||e[5]!==r?(x=r("Clear {count} messages?",{count:l.length}),e[4]=l.length,e[5]=r,e[6]=x):x=e[6];let N=l.length===0,y;e[7]!==r?(y=r("Clear log"),e[7]=r,e[8]=y):y=e[8];let i;e[9]!==d||e[10]!==x||e[11]!==N||e[12]!==y?(i=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(Ge,{confirmLabel:x,disabled:N,onConfirm:d,testId:"queues-clear",children:y})}),e[9]=d,e[10]=x,e[11]=N,e[12]=y,e[13]=i):i=e[13];let m;e[14]!==l.length||e[15]!==r?(m=l.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:l.length})}),e[14]=l.length,e[15]=r,e[16]=m):m=e[16];let f;e[17]!==u||e[18]!==i||e[19]!==m?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,i,m]}),e[17]=u,e[18]=i,e[19]=m,e[20]=f):f=e[20];let g;e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==o||e[25]!==r?(g=!a&&l.length===0?(0,t.jsx)(ie,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsx)(Ve,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(Te,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Message")}),(0,t.jsx)(C,{children:r("Attempts")}),(0,t.jsx)(C,{children:r("Outcome")}),(0,t.jsx)(C,{children:r("Body")}),(0,t.jsx)(C,{children:r("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(Be,{children:l.map(b=>(0,t.jsx)(xt,{message:b,onReplay:s,replayingId:o},b.id))})]})})})}),e[21]=a,e[22]=l,e[23]=s,e[24]=o,e[25]=r,e[26]=g):g=e[26];let q;return e[27]!==f||e[28]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[f,g]}),e[27]=f,e[28]=g,e[29]=q):q=e[29],q},"gt"),Nt=h(n=>{let e=(0,z.c)(20),{batchMode:a,bodyText:l,delayText:d,onBatchModeChange:s,onBodyChange:o,onDelayChange:r,onSelectExport:p,onSend:u,queues:x,selectedExportName:N,sending:y}=n,i=$(),m;e[0]!==i?(m=i("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=i,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a||e[5]!==l||e[6]!==d||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==p||e[11]!==u||e[12]!==x||e[13]!==N||e[14]!==y||e[15]!==i?(g=x.length===0?(0,t.jsx)(ie,{description:i("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:i("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":i("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:p,value:N,children:x.map(qt)}),(0,t.jsx)(We,{"aria-label":i("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:i("Delay (s)"),type:"number",value:d}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),i("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||N==="",onClick:u,type:"button",children:i(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(He,{"aria-label":i("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:o,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:l})]}),e[4]=a,e[5]=l,e[6]=d,e[7]=s,e[8]=o,e[9]=r,e[10]=p,e[11]=u,e[12]=x,e[13]=N,e[14]=y,e[15]=i,e[16]=g):g=e[16];let q;return e[17]!==f||e[18]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,g]}),e[17]=f,e[18]=g,e[19]=q):q=e[19],q},"ft"),Ft=h(n=>{let e=(0,z.c)(59),{limit:a}=n,l=a??lt,d=ze(),s=$(),[o,r]=(0,A.useState)("declared"),[p,u]=(0,A.useState)(null),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let{data:N,error:y,errorSource:i}=_e(F.listQueues,x),m;e[1]!==l?(m={limit:l},e[1]=l,e[2]=m):m=e[2];let{data:f,error:g,errorSource:q,refetch:b}=_e(F.getQueueMessages,m),S=Array.isArray(N?.queues)?[...N.queues].toSorted(vt):[],M=f?.entries??[],{deadLetteredCount:Q,queuesWithoutDlq:L,showReliabilityWarning:T}=dt(S,M),[W,j]=(0,A.useState)(""),[D,E]=(0,A.useState)(""),[I,_]=(0,A.useState)(""),[U,Ye]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(c=>c.exportName===W)?W:S[0]?.exportName??"",Je=o==="messages"?g:y,Ze=o==="messages"?q:i,fe=Je??p,xe=Je===null?p:Ze,K;e[3]!==b?(K=h(()=>{b()},"H"),e[3]=b,e[4]=K):K=e[4],Ke(K,o==="messages");let ye=h(async()=>{u(null);let c=H;if(c==="")return;let v=null,$e=D.trim();if($e!=="")try{v=JSON.parse($e)}catch{u(s("Body must be valid JSON."));return}let Ae,Fe=I.trim();if(Fe!==""){let P=Number(Fe);if(!Number.isFinite(P)||P<0){u(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(U&&!Array.isArray(v)){u(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=U?{batch:v,delaySeconds:Ae,exportName:c}:{body:v,delaySeconds:Ae,exportName:c};try{await d.query(it,st,ue("")),b()}catch(P){u(me(P))}Oe(!1)},"ce"),V;e[5]!==d||e[6]!==b?(V=h(async c=>{u(null),Re(c);try{await d.query(ct,{id:c},ue("")),b()}catch(v){u(me(v))}Re(null)},"K"),e[5]=d,e[6]=b,e[7]=V):V=e[7];let Ne=V,X;e[8]!==d||e[9]!==b?(X=h(async()=>{u(null);try{await d.query(ut,{},ue("")),b()}catch(c){u(me(c))}},"V"),e[8]=d,e[9]=b,e[10]=X):X=e[10];let be=X,Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=h(c=>{let v=c.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Y):Y=e[11];let et=Y,Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=h(c=>{j(c.currentTarget.value)},"Y"),e[12]=Z):Z=e[12];let qe=Z,ee;e[13]===Symbol.for("react.memo_cache_sentinel")?(ee=h(c=>{E(c.currentTarget.value)},"Z"),e[13]=ee):ee=e[13];let ve=ee,te;e[14]===Symbol.for("react.memo_cache_sentinel")?(te=h(c=>{_(c.currentTarget.value)},"ee"),e[14]=te):te=e[14];let Se=te,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=h(c=>{Ye(c.currentTarget.checked)},"te"),e[15]=ae):ae=e[15];let Ce=ae,se;e[16]!==ye?(se=h(()=>{he(ye())},"ae"),e[16]=ye,e[17]=se):se=e[17];let we=se,re;e[18]!==Ne?(re=h(c=>{let{id:v}=c.currentTarget.dataset;v!==void 0&&he(Ne(v))},"se"),e[18]=Ne,e[19]=re):re=e[19];let Ie=re,ne;e[20]!==be?(ne=h(()=>{he(be())},"re"),e[20]=be,e[21]=ne):ne=e[21];let Qe=ne,tt="flex flex-col gap-6",at="lunora-queues-panel",k;e[22]!==s||e[23]!==o?(k=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(c=>(0,t.jsx)(le,{"aria-selected":o===c,"data-tab":c,"data-testid":`queues-tab-${c}`,onClick:et,role:"tab",size:"sm",type:"button",variant:o===c?"secondary":"ghost",children:gt(c,s)},c))}),e[22]=s,e[23]=o,e[24]=k):k=e[24];let B;e[25]!==fe||e[26]!==xe?(B=fe!==null&&(0,t.jsx)(Pe,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=B):B=e[27];let Le=T&&(0,t.jsx)(Ue,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(St).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),Q>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:Q===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:Q})})]})}),O;e[28]!==S||e[29]!==N||e[30]!==o?(O=o==="declared"&&(0,t.jsx)(ft,{loaded:N!==void 0,queues:S}),e[28]=S,e[29]=N,e[30]=o,e[31]=O):O=e[31];let R;e[32]!==M||e[33]!==g||e[34]!==Qe||e[35]!==Ie||e[36]!==ge||e[37]!==o?(R=o==="messages"&&(0,t.jsx)(yt,{hasError:g!==null,messages:M,onClear:Qe,onReplay:Ie,replayingId:ge}),e[32]=M,e[33]=g,e[34]=Qe,e[35]=Ie,e[36]=ge,e[37]=o,e[38]=R):R=e[38];let J;e[39]!==U||e[40]!==D||e[41]!==I||e[42]!==Ce||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==we||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==o?(J=o==="send"&&(0,t.jsx)(Nt,{batchMode:U,bodyText:D,delayText:I,onBatchModeChange:Ce,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:we,queues:S,selectedExportName:H,sending:pe}),e[39]=U,e[40]=D,e[41]=I,e[42]=Ce,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=we,e[47]=S,e[48]=H,e[49]=pe,e[50]=o,e[51]=J):J=e[51];let oe;return e[52]!==k||e[53]!==B||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:tt,"data-testid":at,children:[k,B,Le,O,R,J]}),e[52]=k,e[53]=B,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"Ft");function bt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(w,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(bt,"xt");function qt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(qt,"yt");function vt(n,e){return n.exportName.localeCompare(e.exportName)}h(vt,"Nt");function St(n){return n.name}h(St,"bt");export{Ft as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a}from"./chunk-3XIESWL4.js";var s="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",_=/string or blob too big/iu,l={BAD_REQUEST:{status:400,title:"Bad request"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},CONFLICT:{hint:["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],status:409,title:"Conflict"},NOT_UNIQUE:{hint:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{hint:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},TRANSACTION_LIMIT_EXCEEDED:{hint:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class."],status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},EMAIL_DOMAIN_BLOCKED:{hint:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` to `emailGate(...)` (`@lunora/auth/email-guard`)."],status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{hint:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_ERROR:{status:502,title:"Analytics Engine SQL API error"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{hint:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{hint:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{hint:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{hint:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_BINDING:{status:500,title:"Duplicate agent binding"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},EXPIRED:{status:404,title:"Session expired"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},TOKEN_EXPIRED:{status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"}},f=a(e=>Object.hasOwn(l,e)?l[e]:void 0,"h");var m=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
|
|
1
|
+
import{a}from"./chunk-3XIESWL4.js";var s="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",_=/string or blob too big/iu,l={BAD_REQUEST:{status:400,title:"Bad request"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},CONFLICT:{hint:["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],status:409,title:"Conflict"},NOT_UNIQUE:{hint:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{hint:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},TRANSACTION_LIMIT_EXCEEDED:{hint:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class."],status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},EMAIL_DOMAIN_BLOCKED:{hint:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` to `emailGate(...)` (`@lunora/auth/email-guard`)."],status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{hint:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_ERROR:{status:502,title:"Analytics Engine SQL API error"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{hint:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{hint:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{hint:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{hint:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_BINDING:{status:500,title:"Duplicate agent binding"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},EXPIRED:{status:404,title:"Session expired"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},STREAM_INTERRUPTED:{status:503,title:"Durable stream interrupted"},STREAM_TOO_LONG:{status:507,title:"Durable stream exceeded its chunk ceiling"},TOKEN_EXPIRED:{status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"}},f=a(e=>Object.hasOwn(l,e)?l[e]:void 0,"h");var m=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
|
|
2
2
|
`),header:"Row too large for the storage engine",id:"lunora-row-too-big",test:a(e=>_.test(e),"test")},{body:["Lunora codegen couldn't find a schema to generate from.","","Create `lunora/schema.ts` exporting a `defineSchema(...)` call:","","```ts",'import { defineSchema, defineTable, v } from "@lunora/server";',"","export default defineSchema({"," messages: defineTable({ body: v.string() }),","});","```","","Or run `lunora init` to scaffold Lunora (a sample `lunora/schema.ts` included) into your app."].join(`
|
|
3
3
|
`),header:"No Lunora schema found",id:"lunora-schema-missing",test:a(e=>e.includes("defineSchema() not found")||e.includes("schema.ts not found at"),"test")},{body:["`defineSchema(...)` must be called with an **inline object literal** mapping table names to `defineTable(...)`:","","```ts","export default defineSchema({"," todos: defineTable({ title: v.string(), done: v.boolean() }),","});","```","","Codegen reads the schema statically, so it can't follow a variable or a spread \u2014 pass the object literal directly."].join(`
|
|
4
4
|
`),header:"`defineSchema()` needs an inline object literal",id:"lunora-schema-not-object-literal",test:a(e=>e.includes("defineSchema() expects an object literal"),"test")},{body:["This table name collides with a built-in `ctx.db` member, so the generated client can't expose it.","","Rename the table to anything that isn't a reserved name (the error lists them) \u2014 e.g. `userAccounts` instead of `insert`."].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as we}from"./chunk-OBMNLQWG.js";import{a as Ne}from"./chunk-QWGT25SE.js";import{b as ve,c as ye}from"./chunk-KUVMORDQ.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 he}from"./chunk-RMN2JN4S.js";import{b as pe}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-OKIEDUHL.js";import"./chunk-XXQUMVWH.js";import"./chunk-NQVE5YON.js";import"./chunk-QLQADHFE.js";import{a as ce}from"./chunk-VDW32UET.js";import{c as ie}from"./chunk-UDOOZJO5.js";import"./chunk-UQV7Q5S4.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-5DVJR52Z.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 p;e[24]!==t.parentSpanId||e[25]!==a?(p=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=p):p=e[26];let h;e[27]!==p||e[28]!==M?(h=(0,s.jsx)(ee,{label:M,value:p}),e[27]=p,e[28]=M,e[29]=h):h=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]!==h||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,h,S,x,N]}),e[50]=h,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)}%`,p;e[7]!==w||e[8]!==M?(p={left:w,width:M},e[7]=w,e[8]=M,e[9]=p):p=e[9];let h=p,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]!==h||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:h})}),e[26]=h,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 p;e[11]!==M?(p=(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]=p):p=e[12];let h;e[13]!==o||e[14]!==r.spans.length?(h=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=h):h=e[15];let b;e[16]!==h?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:h}),e[16]=h,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]!==p||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,p,b,I,x]}),e[28]=t,e[29]=i,e[30]=p,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"),pt=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:p,error:h,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]!==p||e[9]!==r?(f=m(()=>{p!==void 0&&pe(r)},"p"),N=[p,r],e[8]=p,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]!==p||e[13]!==h||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(p),A=p?.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=h===null&&D.length===0&&!C,K;e[27]!==o||e[28]!==d?(K=(0,s.jsx)(he,{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]!==h||e[53]!==b?(ae=h!==null&&(0,s.jsx)(be,{error:b,testId:"tr-error"}),e[52]=h,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,h===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})}),h===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]=p,e[13]=h,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},"pt");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{pt as default};
|