@lunora/studio 1.0.0-alpha.221 → 1.0.0-alpha.222
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.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.mjs +1 -1
- package/dist/mount.mjs +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ApiTab.mjs +1 -1
- package/dist/packem_chunks/AuditPanel.mjs +1 -1
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
- package/dist/packem_chunks/FileBrowser.mjs +1 -1
- package/dist/packem_chunks/FunctionRunner.mjs +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
- package/dist/packem_chunks/HealthPanel.mjs +1 -1
- package/dist/packem_chunks/InsightsPanel.mjs +1 -1
- package/dist/packem_chunks/LogsPanel.mjs +1 -1
- package/dist/packem_chunks/MailPanel.mjs +1 -1
- package/dist/packem_chunks/MetricsPanel.mjs +1 -1
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
- package/dist/packem_chunks/PitrPanel.mjs +1 -1
- package/dist/packem_chunks/SchemaViewer.mjs +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
- package/dist/packem_chunks/SettingsPanel.mjs +1 -1
- package/dist/packem_chunks/SqlEditorPanel.mjs +1 -1
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/agents-panel.mjs +1 -1
- package/dist/packem_chunks/analytics-panel.mjs +1 -1
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/auth-config-panel.mjs +1 -1
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -1
- package/dist/packem_chunks/containers-panel.mjs +1 -1
- package/dist/packem_chunks/dashboards-panel.mjs +1 -1
- package/dist/packem_chunks/evals-panel.mjs +1 -1
- package/dist/packem_chunks/fanout-panel.mjs +1 -1
- package/dist/packem_chunks/flags-panel.mjs +1 -1
- package/dist/packem_chunks/issues-panel.mjs +1 -1
- package/dist/packem_chunks/kv-browser.mjs +1 -1
- package/dist/packem_chunks/log-drains-panel.mjs +1 -1
- package/dist/packem_chunks/migrations-route.mjs +1 -1
- package/dist/packem_chunks/organizations-panel.mjs +1 -1
- package/dist/packem_chunks/payments-panel.mjs +1 -1
- package/dist/packem_chunks/permissions-panel.mjs +1 -1
- package/dist/packem_chunks/queues-panel.mjs +1 -1
- package/dist/packem_chunks/reactors-panel.mjs +1 -1
- package/dist/packem_chunks/rls-panel.mjs +1 -1
- package/dist/packem_chunks/schedule-panel.mjs +1 -1
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
- package/dist/packem_chunks/sync-client-panel.mjs +1 -1
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_chunks/users-panel.mjs +1 -1
- package/dist/packem_chunks/vector-browser.mjs +1 -1
- package/dist/packem_chunks/workflows-panel.mjs +1 -1
- package/dist/packem_shared/{ApiDocsPanel-DzvVLAev.mjs → ApiDocsPanel-fhDlZGE4.mjs} +1 -1
- package/dist/packem_shared/{ApiReferencePanel--1Y4o_-l.mjs → ApiReferencePanel-CHoHM5ME.mjs} +1 -1
- package/dist/packem_shared/{CommandPalette-D7GxhPrH.mjs → CommandPalette-D9ZY-qQd.mjs} +1 -1
- package/dist/packem_shared/DataBrowser-DWSaSSRj.mjs +4 -0
- package/dist/packem_shared/{GlobalDataBrowser-DSexMt80.mjs → GlobalDataBrowser-CR138dEZ.mjs} +1 -1
- package/dist/packem_shared/{HomePanel-BkCmY0Hl.mjs → HomePanel-fJZRA0b0.mjs} +1 -1
- package/dist/packem_shared/{MigrationsPanel-DLQRarWw.mjs → MigrationsPanel-QjQ4Gp9s.mjs} +1 -1
- package/dist/packem_shared/{OpenRpcReferencePanel-a_mbqw67.mjs → OpenRpcReferencePanel-C8ctFJVm.mjs} +1 -1
- package/dist/packem_shared/{ScheduledJobs-DSqsMB51.mjs → ScheduledJobs-nPx7NmOE.mjs} +1 -1
- package/dist/packem_shared/{Studio-BE_SzY44.mjs → Studio-DQq17PO6.mjs} +1 -1
- package/dist/packem_shared/{StudioApp-kVjMop0V.mjs → StudioApp-DikgPBVJ.mjs} +1 -1
- package/dist/packem_shared/{advisor-view-DtkbHW2O.mjs → advisor-view-BzzJg9D_.mjs} +1 -1
- package/dist/packem_shared/{data-grid-BPu1a997.mjs → data-grid-DIiNmDR9.mjs} +1 -1
- package/dist/packem_shared/{error-alert-dQk3g8WI.mjs → error-alert-DueSEkt-.mjs} +1 -1
- package/dist/packem_shared/{grid-features-ByxOklon.mjs → grid-features-OVIMIQan.mjs} +1 -1
- package/dist/packem_shared/home-panel-DBSHjxil.mjs +3 -0
- package/dist/packem_shared/{internal-CyDwqA67.mjs → internal-Df43vQI0.mjs} +1 -1
- package/dist/packem_shared/{log-line-BHZD2Aj4.mjs → log-line-BHWXobrl.mjs} +1 -1
- package/dist/packem_shared/{recording-client-CjRFjhya.mjs → recording-client-CyFiAE2l.mjs} +1 -1
- package/dist/packem_shared/{reference-view-vNXUVPlA.mjs → reference-view-DSeKRrUU.mjs} +4 -4
- package/dist/packem_shared/{schema-diagram-DADlbs2X.mjs → schema-diagram-CQ4vn0CN.mjs} +1 -1
- package/dist/packem_shared/{sql-result-table-DS4o0GoC.mjs → sql-result-table-DyK762_A.mjs} +1 -1
- package/dist/packem_shared/studio-ajWxPNfI.mjs +2 -0
- package/dist/packem_shared/{table-list-sidebar-D30qERKx.mjs → table-list-sidebar-DxvakjpR.mjs} +1 -1
- package/dist/packem_shared/{use-admin-query-CR9mHt0P.mjs → use-admin-query-tlBof8Yg.mjs} +1 -1
- package/dist/packem_shared/{use-async-submit-LWIKsZ8r.mjs → use-async-submit-CZqCMTJ_.mjs} +1 -1
- package/dist/packem_shared/{use-auth-config-HmTOvrWd.mjs → use-auth-config-B9hH2tQa.mjs} +1 -1
- package/dist/packem_shared/{use-open-trace-DdGxsEB9.mjs → use-open-trace-DMVhpnyG.mjs} +1 -1
- package/dist/packem_shared/{use-sql-assistant-D4XQ0v0R.mjs → use-sql-assistant-pjfGp-Ol.mjs} +1 -1
- package/dist/standalone/{chunk-EQVY6WGK.js → chunk-2H7LJELF.js} +1 -1
- package/dist/standalone/{chunk-AM7VTTNL.js → chunk-2PLDVCEP.js} +1 -1
- package/dist/standalone/{chunk-DXT2DY4I.js → chunk-2QSGCPIS.js} +1 -1
- package/dist/standalone/chunk-2UECQGYG.js +1 -0
- package/dist/standalone/{chunk-PVNT7VXC.js → chunk-4DLM7KCA.js} +1 -1
- package/dist/standalone/{chunk-FCEQTBLC.js → chunk-4IX7Z3XP.js} +1 -1
- package/dist/standalone/{chunk-3C25RFTP.js → chunk-4RLMVWJL.js} +1 -1
- package/dist/standalone/{chunk-3TE3V2QL.js → chunk-4ZHQUGP5.js} +1 -1
- package/dist/standalone/{chunk-2HF37UQN.js → chunk-5CEDU7OP.js} +1 -1
- package/dist/standalone/{chunk-GGAUC5ZI.js → chunk-5JAOC6KI.js} +1 -1
- package/dist/standalone/{chunk-PSBP27ZK.js → chunk-6LYYH4KG.js} +1 -1
- package/dist/standalone/{chunk-MMMRSTCL.js → chunk-6UFH4FWY.js} +1 -1
- package/dist/standalone/chunk-6ZPT7CTC.js +5 -0
- package/dist/standalone/{chunk-PY5P53RV.js → chunk-AANB526D.js} +1 -1
- package/dist/standalone/{chunk-4AZDQAT2.js → chunk-ANAVNSAK.js} +1 -1
- package/dist/standalone/{chunk-MDUTVBJZ.js → chunk-B2HYHTIX.js} +1 -1
- package/dist/standalone/{chunk-KFEWMJQS.js → chunk-BF5GZZ2N.js} +1 -1
- package/dist/standalone/{chunk-VQM2MKYO.js → chunk-BNFLBJXF.js} +1 -1
- package/dist/standalone/{chunk-WINPNKYC.js → chunk-BOASUV37.js} +1 -1
- package/dist/standalone/{chunk-LJVH6HRQ.js → chunk-BWLFO2IE.js} +1 -1
- package/dist/standalone/{chunk-6HDT763N.js → chunk-C5JRZI3P.js} +1 -1
- package/dist/standalone/{chunk-YBCFAAQJ.js → chunk-C7JZ7GM3.js} +1 -1
- package/dist/standalone/{chunk-UYKO4I36.js → chunk-CFIBDQF7.js} +1 -1
- package/dist/standalone/{chunk-RBJMRBC3.js → chunk-D73MZIDA.js} +1 -1
- package/dist/standalone/{chunk-I3TUOZM3.js → chunk-DHJHD5RD.js} +1 -1
- package/dist/standalone/{chunk-PSPSEIFN.js → chunk-DPJRFJGG.js} +1 -1
- package/dist/standalone/{chunk-ZUGCPRKB.js → chunk-EBNLDFWL.js} +1 -1
- package/dist/standalone/{chunk-Q2F2DRGB.js → chunk-EIISOYGA.js} +1 -1
- package/dist/standalone/{chunk-GYKK64E7.js → chunk-EIREQDTV.js} +1 -1
- package/dist/standalone/{chunk-ZHM5ZHPC.js → chunk-EJSI4PMU.js} +1 -1
- package/dist/standalone/{chunk-2HAWCLCS.js → chunk-EUBMVV62.js} +1 -1
- package/dist/standalone/{chunk-V2JKX5UU.js → chunk-FRX3HV4O.js} +2 -2
- package/dist/standalone/{chunk-I4VOJYXE.js → chunk-FZXPE3EA.js} +1 -1
- package/dist/standalone/{chunk-V2LIXSFE.js → chunk-HZ23X7G4.js} +1 -1
- package/dist/standalone/{chunk-DX6246CW.js → chunk-IVHSLEDF.js} +1 -1
- package/dist/standalone/{chunk-6RNWWWLS.js → chunk-IVSO7SEU.js} +1 -1
- package/dist/standalone/{chunk-GL7PC32W.js → chunk-KRYLPBID.js} +1 -1
- package/dist/standalone/{chunk-VQTSESFP.js → chunk-LCRAEP3B.js} +1 -1
- package/dist/standalone/{chunk-RE4RWXYW.js → chunk-LD7EXQJA.js} +1 -1
- package/dist/standalone/chunk-MK64Z2KK.js +3 -0
- package/dist/standalone/{chunk-DKLSANZA.js → chunk-MRAMNVDG.js} +1 -1
- package/dist/standalone/{chunk-3ZMF2GJ5.js → chunk-MU57Q7EJ.js} +1 -1
- package/dist/standalone/{chunk-ZJZNCJHY.js → chunk-NFS7FTAR.js} +1 -1
- package/dist/standalone/{chunk-EDEQELIO.js → chunk-NGBD2OUY.js} +1 -1
- package/dist/standalone/{chunk-2R6ZRXPJ.js → chunk-NNOKBVJ7.js} +1 -1
- package/dist/standalone/{chunk-UTPXXTQ6.js → chunk-NO3SWCXH.js} +1 -1
- package/dist/standalone/{chunk-PIKO7SSB.js → chunk-NSTYZZ5L.js} +1 -1
- package/dist/standalone/{chunk-6WPU62WQ.js → chunk-NX7UAIZ2.js} +1 -1
- package/dist/standalone/{chunk-TZHEXHD4.js → chunk-OCZPVECA.js} +1 -1
- package/dist/standalone/{chunk-4P2KFEUN.js → chunk-PJZYLISI.js} +1 -1
- package/dist/standalone/{chunk-H4OORJHB.js → chunk-PQPPJGH4.js} +1 -1
- package/dist/standalone/{chunk-6CGJCPHC.js → chunk-QYCKDIIK.js} +1 -1
- package/dist/standalone/{chunk-JQ63BDVF.js → chunk-QZRXRMVF.js} +1 -1
- package/dist/standalone/{chunk-2RMFAASK.js → chunk-SQKUZR6R.js} +1 -1
- package/dist/standalone/{chunk-2JLOP2EL.js → chunk-SRVHSFKC.js} +1 -1
- package/dist/standalone/{chunk-JNDBJAO6.js → chunk-TS5SE5EM.js} +1 -1
- package/dist/standalone/{chunk-FS4GMDIW.js → chunk-TXJX5ASO.js} +1 -1
- package/dist/standalone/{chunk-J345HOFQ.js → chunk-U775EN4P.js} +1 -1
- package/dist/standalone/{chunk-YV6JXZJO.js → chunk-UXXDN6Z3.js} +1 -1
- package/dist/standalone/{chunk-RVBRSHYE.js → chunk-VWJ4BY6M.js} +1 -1
- package/dist/standalone/{chunk-PUBYZCHW.js → chunk-WLA5B3GY.js} +1 -1
- package/dist/standalone/{chunk-PAE3ULFR.js → chunk-YGZGLWD5.js} +1 -1
- package/dist/standalone/{chunk-6P7CYZPR.js → chunk-YHYYGVE2.js} +1 -1
- package/dist/standalone/{chunk-K4HVLN3Z.js → chunk-YTMEMOHR.js} +1 -1
- package/dist/standalone/{chunk-IJPXZZZ5.js → chunk-Z5O2NQAV.js} +1 -1
- package/dist/standalone/{chunk-SEBIGECV.js → chunk-ZXEE2Z4S.js} +1 -1
- package/dist/standalone/chunk-ZY35EIK4.js +1 -0
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/packem_shared/DataBrowser-CKbaOtDh.mjs +0 -4
- package/dist/packem_shared/home-panel-B_HN6YMA.mjs +0 -3
- package/dist/packem_shared/studio-BVQq3QLR.mjs +0 -2
- package/dist/standalone/chunk-3GFF4BA4.js +0 -3
- package/dist/standalone/chunk-FCPY75TQ.js +0 -1
- package/dist/standalone/chunk-HR7W3Z5I.js +0 -1
- package/dist/standalone/chunk-KGCUFNFC.js +0 -5
- /package/dist/standalone/{chunk-6B7FVPW3.js → chunk-PTZD7RUZ.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const f=(t,n,r,i,o)=>{switch(n){case"action":return t.action(r,i,o);case"mutation":return t.mutation(r,i,o);default:return t.query(r,i,o)}},u=t=>({__lunoraRef:t}),d=t=>{const n=t.trim();return n===""?{}:{shardKey:n}},g=t=>t instanceof Error?t.message:String(t),l=t=>{if(t===null||typeof t!="object"||!("code"in t))return;const{code:n}=t;return typeof n=="string"?n:void 0},y=t=>{if(t===null||typeof t!="object"||!("hint"in t))return;const{hint:n}=t;return typeof n=="string"?n:Array.isArray(n)?n.filter(r=>typeof r=="string").join(`
|
|
2
|
-
`):void 0},h=t=>{if(t===null||typeof t!="object"||!("docsUrl"in t))return;const n=t.docsUrl;if(typeof n=="string")try{const{protocol:r}=new URL(n);return r==="http:"||r==="https:"?n:void 0}catch{return}},e=t=>{if(t==null)return"—";if(t<1024)return`${t.toString()} B`;const n=["KB","MB","GB","TB"];let r=t/1024,i=0;for(;r>=1024&&i<n.length-1;)r/=1024,i+=1;return`${r.toFixed(1)} ${n[i]??"TB"}`},s=(t,n)=>typeof n=="bigint"?n.toString():n instanceof ArrayBuffer||ArrayBuffer.isView(n)?`<bytes: ${e(n.byteLength)}>`:n,p=t=>typeof t=="bigint"?t.toString():t,b=t=>{if(t==null)return"";switch(typeof t){case"bigint":case"boolean":case"number":return t.toString();case"string":return t;case"symbol":return t.toString();default:return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?`<bytes: ${e(t.byteLength)}>`:JSON.stringify(t,s)}},c=(t,n)=>{t.catch(r=>{n?.(r)})},a=t=>{if(t!==void 0&&t!=="")return t;const n=globalThis.location;return n?.origin!==void 0&&n.origin!==""?n.origin:"http://localhost:5173"},m=t=>{let n=a(t);for(;n.endsWith("/");)n=n.slice(0,-1);return n},B=t=>{const n="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return n===void 0?!1:(c(n.writeText(t)),!0)},w=(t,n="")=>{if(t==null||t==="")return n;const r=new Date(t);return Number.isNaN(r.getTime())?String(t):r.toLocaleString()};export{h as a,g as b,u as c,d,y as e,c as f,B as g,w as h,
|
|
2
|
+
`):void 0},h=t=>{if(t===null||typeof t!="object"||!("docsUrl"in t))return;const n=t.docsUrl;if(typeof n=="string")try{const{protocol:r}=new URL(n);return r==="http:"||r==="https:"?n:void 0}catch{return}},e=t=>{if(t==null)return"—";if(t<1024)return`${t.toString()} B`;const n=["KB","MB","GB","TB"];let r=t/1024,i=0;for(;r>=1024&&i<n.length-1;)r/=1024,i+=1;return`${r.toFixed(1)} ${n[i]??"TB"}`},s=(t,n)=>typeof n=="bigint"?n.toString():n instanceof ArrayBuffer||ArrayBuffer.isView(n)?`<bytes: ${e(n.byteLength)}>`:n,p=t=>typeof t=="bigint"?t.toString():t,b=t=>{if(t==null)return"";switch(typeof t){case"bigint":case"boolean":case"number":return t.toString();case"string":return t;case"symbol":return t.toString();default:return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?`<bytes: ${e(t.byteLength)}>`:JSON.stringify(t,s)}},c=(t,n)=>{t.catch(r=>{n?.(r)})},a=t=>{if(t!==void 0&&t!=="")return t;const n=globalThis.location;return n?.origin!==void 0&&n.origin!==""?n.origin:"http://localhost:5173"},m=t=>{let n=a(t);for(;n.endsWith("/");)n=n.slice(0,-1);return n},B=t=>{const n="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return n===void 0?!1:(c(n.writeText(t)),!0)},w=(t,n="")=>{if(t==null||t==="")return n;const r=new Date(t);return Number.isNaN(r.getTime())?String(t):r.toLocaleString()};export{h as a,g as b,u as c,d,y as e,c as f,B as g,w as h,l as i,s as j,b as k,f as l,e as m,p as n,a as r,m as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h}from"react/compiler-runtime";import{f as v}from"./log-fields-SBxKyBug.mjs";import{B as x}from"./badge-r_5B4LHP.mjs";import{h as L}from"./internal-
|
|
1
|
+
import{c as h}from"react/compiler-runtime";import{f as v}from"./log-fields-SBxKyBug.mjs";import{B as x}from"./badge-r_5B4LHP.mjs";import{h as L}from"./internal-Df43vQI0.mjs";import{jsx as o,jsxs as g,Fragment as N}from"react/jsx-runtime";const w={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},B=p=>{const e=h(21),{entry:t}=p;let m;e[0]!==t.fields?(m=v(t.fields),e[0]=t.fields,e[1]=m):m=e[1];const c=m;let l;e[2]!==t.timestamp?(l=L(t.timestamp),e[2]=t.timestamp,e[3]=l):l=e[3];let s;e[4]!==l?(s=o("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:l}),e[4]=l,e[5]=s):s=e[5];const f=w[t.level];let r;e[6]!==t.level||e[7]!==f?(r=o("span",{className:"w-20 shrink-0",role:"gridcell",children:o(x,{variant:f,children:t.level})}),e[6]=t.level,e[7]=f,e[8]=r):r=e[8];const u=t.functionPath??"—";let a;e[9]!==u?(a=o("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:u}),e[9]=u,e[10]=a):a=e[10];let i;e[11]!==c?(i=c===""?null:o("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:c}),e[11]=c,e[12]=i):i=e[12];let n;e[13]!==t.message||e[14]!==i?(n=g("span",{className:"flex-1 truncate",role:"gridcell",children:[t.message,i]}),e[13]=t.message,e[14]=i,e[15]=n):n=e[15];let d;return e[16]!==s||e[17]!==r||e[18]!==a||e[19]!==n?(d=g(N,{children:[s,r,a,n]}),e[16]=s,e[17]=r,e[18]=a,e[19]=n,e[20]=d):d=e[20],d};export{B as L,w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as u}from"./use-admin-query-
|
|
1
|
+
import{o as u}from"./use-admin-query-tlBof8Yg.mjs";const b="__lunora_admin__:",d=new Set(["action","mutation","query"]),r=Symbol("lunora.operationSeq"),g=t=>{if(typeof t!="object"||t===null)return;const n=t[r];return typeof n=="number"?n:void 0},h=(t,n)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value:n,writable:!0})}catch{}},p=t=>{if(typeof t!="object"||t===null)return;const n=t.__lunoraRef;return typeof n=="string"&&n.startsWith(b)?n:void 0},O=t=>{if(typeof t!="object"||t===null)return"";const{shardKey:n}=t;return typeof n=="string"?n:""},E=t=>new Proxy(t,{get(n,c,a){const i=Reflect.get(n,c,a);if(typeof i!="function"||typeof c!="string"||!d.has(c))return typeof i=="function"?i.bind(n):i;const f=i;return async(...e)=>{const l=p(e[0]);if(l===void 0)return f.apply(n,e);const y=typeof e[1]=="object"&&e[1]!==null?e[1]:{},s=u.start(l,y,O(e[2]));try{const o=await f.apply(n,e);return u.settle(s,{result:o}),o}catch(o){throw u.settle(s,{error:o instanceof Error?o.message:String(o)}),h(o,s),o}}}});export{g as o,E as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as P}from"react/compiler-runtime";import{useState as L,useEffectEvent as U,useEffect as ae,createContext as le,use as de}from"react";import{b as z,g as Y,f as ce,
|
|
1
|
+
import{c as P}from"react/compiler-runtime";import{useState as L,useEffectEvent as U,useEffect as ae,createContext as le,use as de}from"react";import{b as z,g as Y,f as ce,l as ue,c as fe,d as me,j as pe}from"./internal-Df43vQI0.mjs";import{SentIcon as he,Copy01Icon as ge,Search01Icon as xe}from"@hugeicons/core-free-icons";import{HugeiconsIcon as W}from"@hugeicons/react";import{I as be}from"./input-CXhxesPC.mjs";import{useT as J}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{B as q}from"./button-q0UYSmrn.mjs";import{jsx as i,jsxs as N,Fragment as ye}from"react/jsx-runtime";import{B as ve}from"./badge-r_5B4LHP.mjs";import{ShardInput as Ne}from"./ShardInput-C6mjgAh4.mjs";import{L as V}from"./label-DKFzyHq6.mjs";import{T as Se}from"./textarea--40GKAyz.mjs";import{LunoraError as we}from"@lunora/errors";import{useLunora as ke}from"@lunora/react";import{c as Q}from"./utils-bhneXptQ.mjs";const Ot=function(t,e,s){const r=P(15);let n;r[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},r[0]=n):n=r[0];const[o,l]=L(n);let a;r[1]!==e?(a=async()=>e(),r[1]=e,r[2]=a):a=r[2];const g=U(a);let d;r[3]!==s?(d=f=>s(f),r[3]=s,r[4]=d):d=r[4];const c=U(d);let u;r[5]!==c||r[6]!==g||r[7]!==t?(u=()=>{if(t!==void 0)return;let f=!1;return g().then(m=>(f||l(c(m)),m)).catch(m=>{f||l({kind:"error",message:z(m)})}),()=>{f=!0}},r[5]=c,r[6]=g,r[7]=t,r[8]=u):u=r[8];let h;r[9]!==t?(h=[t],r[9]=t,r[10]=h):h=r[10],ae(u,h);let p;return r[11]!==s||r[12]!==o||r[13]!==t?(p=t===void 0?o:s(t),r[11]=s,r[12]=o,r[13]=t,r[14]=p):p=r[14],p},Oe=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",Z=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},F=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>F(e)).join(" | "):t.type==="array"?`array<${F(t.items)}>`:t.type??"any",$e=t=>{const e=Z(t);return e!==void 0?t.type??Oe(e[0]):F(t)},Te=t=>{const e=Z(t);return e===void 0?void 0:e.map(s=>JSON.stringify(s)).join(" | ")},Ee=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const s=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const r=e.length>(s?2:1);return s||r?e.join(" "):void 0},Ce=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},D=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return D(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[s,r]of Object.entries(t.properties??{}))e[s]=D(r);return e}case"string":return"";default:return null}},K=t=>{const e=P(7),{label:s,value:r}=t;let n;e[0]!==s?(n=i("span",{className:"text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let o;e[2]!==r?(o=i("span",{className:"text-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==n||e[5]!==o?(l=N("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,o]}),e[4]=n,e[5]=o,e[6]=l):l=e[6],l},Ae=t=>{const e=P(40),{name:s,required:r,schema:n}=t,o=J();let l;e[0]!==n?(l=Ee(n),e[0]=n,e[1]=l):l=e[1];const a=l;let g;e[2]!==n?(g=Te(n),e[2]=n,e[3]=g):g=e[3];const d=g,c=n["x-lunora-table"],u=n.format!==void 0||a!==void 0||d!==void 0||c!==void 0;let h;e[4]!==n?(h=Ce(n),e[4]=n,e[5]=h):h=e[5];const p=h,f=r?"*":"?";let m;e[6]!==f?(m=i("span",{className:"text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let v;e[8]!==s||e[9]!==m?(v=N("span",{className:"font-mono text-foreground",children:[s,m]}),e[8]=s,e[9]=m,e[10]=v):v=e[10];let w;e[11]!==n?(w=$e(n),e[11]=n,e[12]=w):w=e[12];let x;e[13]!==w?(x=i("span",{className:"font-mono text-muted-foreground",children:w}),e[13]=w,e[14]=x):x=e[14];let b;e[15]!==v||e[16]!==x?(b=N("div",{className:"flex items-baseline gap-2",children:[v,x]}),e[15]=v,e[16]=x,e[17]=b):b=e[17];let y;e[18]!==n.description?(y=n.description!==void 0&&i("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=y):y=e[19];let S;e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==n.format||e[24]!==o||e[25]!==d?(S=u&&N("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&i(K,{label:o("Format"),value:n.format}),a!==void 0&&i(K,{label:o("Range"),value:a}),d!==void 0&&i(K,{label:o("Value in"),value:d}),c!==void 0&&i(K,{label:o("relation"),value:c})]}),e[20]=u,e[21]=a,e[22]=c,e[23]=n.format,e[24]=o,e[25]=d,e[26]=S):S=e[26];let O;e[27]!==y||e[28]!==S||e[29]!==b?(O=N("div",{className:"flex flex-col gap-1 py-2",children:[b,y,S]}),e[27]=y,e[28]=S,e[29]=b,e[30]=O):O=e[30];const k=O;if(p===void 0){let $;return e[31]!==k?($=i("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=$):$=e[32],$}let T;e[33]!==k?(T=i("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=T):T=e[34];let A;e[35]!==p?(A=i("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:i(ee,{schema:p})}),e[35]=p,e[36]=A):A=e[36];let E;return e[37]!==T||e[38]!==A?(E=N("details",{className:"border-b border-border/50 last:border-b-0",children:[T,A]}),e[37]=T,e[38]=A,e[39]=E):E=e[39],E},ee=t=>{const e=P(7),{schema:s}=t;let r;e[0]!==s.required?(r=new Set(s.required),e[0]=s.required,e[1]=r):r=e[1];const n=r;let o;e[2]!==s.properties?(o=Object.entries(s.properties??{}),e[2]=s.properties,e[3]=o):o=e[3];const l=o;let a;return e[4]!==n||e[5]!==l?(a=i("div",{className:"flex flex-col",children:l.map(g=>{const[d,c]=g;return i(Ae,{name:d,required:n.has(d),schema:c},d)})}),e[4]=n,e[5]=l,e[6]=a):a=e[6],a},G=t=>{const e=P(10),{schema:s,testId:r}=t;if(s?.type!=="object"||Object.keys(s.properties??{}).length===0){let l;e[0]!==s?(l=F(s),e[0]=s,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==r?(a=i("p",{className:"font-mono text-xs text-muted-foreground","data-testid":r,children:l}),e[2]=l,e[3]=r,e[4]=a):a=e[4],a}let n;e[5]!==s?(n=i(ee,{schema:s}),e[5]=s,e[6]=n):n=e[6];let o;return e[7]!==n||e[8]!==r?(o=i("div",{className:"text-xs","data-testid":r,children:n}),e[7]=n,e[8]=r,e[9]=o):o=e[9],o},Re=["curl","javascript","lunora"],je={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Ie=t=>`api.${t.replaceAll(/[/:]/g,".")}`,Pe=t=>{const e=D(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Le=(t,e,s)=>{const r=`${s}${e.httpPath}`,n=JSON.stringify(Pe(e),void 0,2),o=JSON.stringify(D(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const l=e.method!=="GET"&&e.method!=="HEAD",a=[`curl -X ${e.method} ${JSON.stringify(r)}`];return l&&a.push(' -H "Content-Type: application/json"',` -d '${n}'`),a.join(` \\
|
|
2
2
|
`)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
|
|
3
3
|
import { api } from "./_generated/api";
|
|
4
4
|
|
|
@@ -8,6 +8,6 @@ await client.${e.kind??"query"}(${Ie(e.functionPath)}, ${o});`;default:{const a=
|
|
|
8
8
|
headers: { "Content-Type": "application/json" },
|
|
9
9
|
body: JSON.stringify(${n}),
|
|
10
10
|
}`:`{ method: ${JSON.stringify(e.method)} }`;return`const response = await fetch(${JSON.stringify(r)}, ${a});
|
|
11
|
-
const data = await response.json();`}}},_e=t=>{const e=P(24),{operation:s,server:r}=t,n=J(),[o,l]=L("curl");let a;e[0]!==s||e[1]!==o||e[2]!==r?(a=Le(o,s,r),e[0]=s,e[1]=o,e[2]=r,e[3]=a):a=e[3];const g=a;let d;e[4]!==g?(d=()=>{Y(g)},e[4]=g,e[5]=d):d=e[5];const c=d;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{l(y.currentTarget.dataset.sample)},e[6]=u):u=e[6];const h=u;let p;e[7]!==o?(p=Re.map(y=>i("button",{"aria-selected":o===y,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":y,"data-testid":`api-sample-${y}`,onClick:h,role:"tab",type:"button",children:je[y]},y)),e[7]=o,e[8]=p):p=e[8];let f;e[9]!==p?(f=i("div",{className:"flex gap-1",role:"tablist",children:p}),e[9]=p,e[10]=f):f=e[10];let m;e[11]!==n?(m=n("Copy"),e[11]=n,e[12]=m):m=e[12];let v;e[13]!==c||e[14]!==m?(v=i(q,{"data-testid":"api-sample-copy",onClick:c,size:"xs",type:"button",variant:"ghost",children:m}),e[13]=c,e[14]=m,e[15]=v):v=e[15];let
|
|
12
|
-
`,"\r"]),X=" ",Ke=t=>{let e="";for(const n of t)De.has(n)||(e+=n);let s=0,r=e.length;for(;s<r&&(e[s]??"")<=X;)s+=1;for(;r>s&&(e[r-1]??"")<=X;)r-=1;return e.slice(s,r)},Fe=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,ze=(t,e)=>{const s=globalThis.location?.origin??"",r=e===""?s:e,n=Ke(t);if(r===""){if(Fe.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}const o=new URL(n,r);if(o.origin!==new URL(r).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${o.origin} is not ${r})`);return o.toString()},We=async(t,e,s,r)=>{const n=t.method!=="GET"&&t.method!=="HEAD",o=ze(t.httpPath,s),a=await(await fetch(o,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...r===null||r===""?{}:{authorization:`Bearer ${r}`}},method:t.method})).text();try{return JSON.parse(a)}catch{return a}},qe=t=>JSON.stringify(D(t.argsSchema)??{},void 0,2),se=le(null),ne=()=>{const t=de(se);if(t===null)throw new
|
|
13
|
-
`),t[27]=s,t[28]=T):T=t[28];const A=Math.min(12,Math.max(3,T.length));let E;t[29]!==s||t[30]!==c||t[31]!==h||t[32]!==A?(E=i(Se,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:c,onKeyDown:h,rows:A,spellCheck:!1,value:s}),t[29]=s,t[30]=c,t[31]=h,t[32]=A,t[33]=E):E=t[33];let $;t[34]!==w||t[35]!==E?($=N("div",{className:"flex flex-col gap-1.5",children:[w,E]}),t[34]=w,t[35]=E,t[36]=$):$=t[36];let R;t[37]!==r.functionPath||t[38]!==l||t[39]!==a||t[40]!==e?(R=r.functionPath!==void 0&&N("div",{className:"flex flex-col gap-1.5",children:[i(V,{htmlFor:"shard-input",children:e("Shard key (optional)")}),i(Ne,{id:"shard-input",onChange:l,testId:"shard-input",value:a})]}),t[37]=r.functionPath,t[38]=l,t[39]=a,t[40]=e,t[41]=R):R=t[41];let j;t[42]!==$||t[43]!==R?(j=N("div",{className:"flex flex-col gap-3 p-3",children:[$,R]}),t[42]=$,t[43]=R,t[44]=j):j=t[44];let I;return t[45]!==j||t[46]!==S?(I=N("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[S,j]}),t[45]=j,t[46]=S,t[47]=I):I=t[47],I},Ve=t=>{const e=P(51),{operation:s}=t,r=J(),n=`api-operation-${s.operationId}`,o=s.key;let l;e[0]!==s.kind||e[1]!==s.method?(l=i(H,{kind:s.kind,method:s.method,testId:"api-operation-method"}),e[0]=s.kind,e[1]=s.method,e[2]=l):l=e[2];const a=s.functionPath??s.httpPath;let g;e[3]!==a?(g=i("code",{className:"truncate font-mono text-xs text-muted-foreground",children:a}),e[3]=a,e[4]=g):g=e[4];let d;e[5]!==l||e[6]!==g?(d=N("div",{className:"flex items-center gap-2",children:[l,g]}),e[5]=l,e[6]=g,e[7]=d):d=e[7];let c;e[8]!==s.title?(c=i("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:s.title}),e[8]=s.title,e[9]=c):c=e[9];let u;e[10]!==s.description?(u=s.description!==void 0&&i("p",{className:"text-sm text-muted-foreground",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==d||e[13]!==c||e[14]!==u?(h=N("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[d,c,u]}),e[12]=d,e[13]=c,e[14]=u,e[15]=h):h=e[15];let p;e[16]!==r?(p=r("Try it"),e[16]=r,e[17]=p):p=e[17];let f;e[18]!==p?(f=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:p}),e[18]=p,e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i(Ue,{}),e[20]=m):m=e[20];let v;e[21]!==f?(v=N("section",{className:"flex flex-col gap-2",children:[f,m]}),e[21]=f,e[22]=v):v=e[22];let k;e[23]!==r?(k=r("Request arguments"),e[23]=r,e[24]=k):k=e[24];let x;e[25]!==k?(x=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:k}),e[25]=k,e[26]=x):x=e[26];let b;e[27]!==s.argsSchema?(b=i(G,{schema:s.argsSchema,testId:"api-operation-args"}),e[27]=s.argsSchema,e[28]=b):b=e[28];let y;e[29]!==x||e[30]!==b?(y=N("section",{className:"flex flex-col gap-2",children:[x,b]}),e[29]=x,e[30]=b,e[31]=y):y=e[31];let S;e[32]!==r?(S=r("Response body"),e[32]=r,e[33]=S):S=e[33];let O;e[34]!==S?(O=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:S}),e[34]=S,e[35]=O):O=e[35];let w;if(e[36]!==s.responses||e[37]!==r){let E;e[39]!==r?(E=$=>N("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[N("div",{className:"flex items-center justify-between gap-2",children:[N("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${te($.status)}`,children:[i("span",{className:`size-1.5 rounded-full ${re($.status)}`}),$.status]}),$.schema!==void 0&&i("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r("application/json")})]}),$.description!==void 0&&i("p",{className:"text-xs text-muted-foreground",children:$.description}),$.schema!==void 0&&i(G,{schema:$.schema,testId:`api-response-${$.status}`})]},$.status),e[39]=r,e[40]=E):E=e[40],w=s.responses.map(E),e[36]=s.responses,e[37]=r,e[38]=w}else w=e[38];let T;e[41]!==O||e[42]!==w?(T=N("section",{className:"flex flex-col gap-3",children:[O,w]}),e[41]=O,e[42]=w,e[43]=T):T=e[43];let A;return e[44]!==s.key||e[45]!==n||e[46]!==v||e[47]!==y||e[48]!==T||e[49]!==h?(A=N("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[h,v,y,T]},o),e[44]=s.key,e[45]=n,e[46]=v,e[47]=y,e[48]=T,e[49]=h,e[50]=A):A=e[50],A},Ge={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Xe=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Ye=/^\s*:/,Qe=(t,e,s)=>s.startsWith('"')?Ye.test(t.slice(e))?"key":"string":s==="true"||s==="false"||s==="null"?"boolean":"number",Ze=t=>{const e=[];let s=0;for(const r of t.matchAll(Xe)){const{index:n}=r,o=r[0],l=n+o.length;n>s&&e.push({kind:"plain",start:s,text:t.slice(s,n)}),e.push({kind:Qe(t,l,o),start:n,text:o}),s=l}return s<t.length&&e.push({kind:"plain",start:s,text:t.slice(s)}),e},et=t=>{const e=P(4),{code:s}=t;let r;e[0]!==s?(r=Ze(s).map(tt),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=i(ye,{children:r}),e[2]=r,e[3]=n):n=e[3],n};function tt(t){return i("span",{className:Ge[t.kind],children:t.text},t.start)}const oe="__live__",rt=t=>t.schema===void 0?"":JSON.stringify(D(t.schema),void 0,2),st=(t,e,s)=>s?t??"":e===void 0?"":JSON.stringify(e,pe,2),nt=t=>{const e=P(18),{active:s,running:r,showError:n}=t,o=J();if(r){let u;e[0]!==o?(u=o("Sending…"),e[0]=o,e[1]=u):u=e[1];let h;return e[2]!==u?(h=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:u}),e[2]=u,e[3]=h):h=e[3],h}if(s===void 0||s.body===""){let u;e[4]!==s?.live||e[5]!==o?(u=s?.live===!0?o("Send a request to see the response."):o("No example for this response."),e[4]=s?.live,e[5]=o,e[6]=u):u=e[6];let h;return e[7]!==u?(h=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:u}),e[7]=u,e[8]=h):h=e[8],h}const l=n&&"text-destructive";let a;e[9]!==l?(a=Q("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",l),e[9]=l,e[10]=a):a=e[10];const g=n?"api-response-error":"api-response-body";let d;e[11]!==s.body||e[12]!==n?(d=n?s.body:i(et,{code:s.body}),e[11]=s.body,e[12]=n,e[13]=d):d=e[13];let c;return e[14]!==a||e[15]!==g||e[16]!==d?(c=i("pre",{className:a,"data-testid":g,children:d}),e[14]=a,e[15]=g,e[16]=d,e[17]=c):c=e[17],c},ot=({durationMs:t,error:e,failed:s,operation:r,ran:n,response:o,t:l})=>{const a=r.responses.map(d=>({body:rt(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:st(e,o,s),durationMs:t,id:oe,label:l("Live"),live:!0,status:s?"error":"200"},...a]:a},it=()=>{const t=P(19),e=J(),{durationMs:s,error:r,operation:n,response:o,status:l}=ne(),a=l==="running",g=l==="error",d=l==="success"||g,c=ot({durationMs:s,error:r,failed:g,operation:n,ran:d,response:o,t:e}),u=d?oe:c.find(at)?.id??c[0]?.id??"",[h,p]=L(null),f=c.find(C=>C.id===(h??u))??c[0];let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=C=>{const{id:_}=C.currentTarget.dataset;_!==void 0&&p(_)},t[0]=m):m=t[0];const v=m,k=()=>{f!==void 0&&Y(f.body)},x=f?.live===!0?f.durationMs:null,b=f?.live===!0&&f.status==="error",y="flex min-h-0 flex-col rounded-xl border border-border bg-card",S="api-response-panel";let O;t[1]!==e?(O=e("Response"),t[1]=e,t[2]=O):O=t[2];let w;t[3]!==O?(w=i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O}),t[3]=O,t[4]=w):w=t[4];const T=x!==null&&i("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:x})}),A=f!==void 0&&f.body!==""&&i(q,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:k,size:"icon-xs",type:"button",variant:"ghost",children:i(W,{icon:ge,strokeWidth:2})});let E;t[5]!==T||t[6]!==A?(E=N("div",{className:"flex items-center gap-2",children:[T,A]}),t[5]=T,t[6]=A,t[7]=E):E=t[7];let $;t[8]!==w||t[9]!==E?($=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[w,E]}),t[8]=w,t[9]=E,t[10]=$):$=t[10];const R=c.length>0&&i("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:c.map(C=>{const _=C.id===f?.id;return N("button",{"aria-selected":_,className:Q("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",_?te(C.status):"text-muted-foreground"),"data-id":C.id,"data-testid":C.live?"api-response-tab-live":`api-response-tab-${C.status}`,onClick:v,role:"tab",type:"button",children:[i("span",{className:`size-1.5 rounded-full ${re(C.status)}`}),C.label]},C.id)})});let j;t[11]!==f||t[12]!==a||t[13]!==b?(j=i(nt,{active:f,running:a,showError:b}),t[11]=f,t[12]=a,t[13]=b,t[14]=j):j=t[14];let I;return t[15]!==j||t[16]!==$||t[17]!==R?(I=N("div",{className:y,"data-testid":S,children:[$,R,j]}),t[15]=j,t[16]=$,t[17]=R,t[18]=I):I=t[18],I};function at(t){return t.status.startsWith("2")}const lt=(t,e)=>{const s=e.trim().toLowerCase();return s===""?t:t.map(r=>({...r,operations:r.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(s))})).filter(r=>r.operations.length>0)},$t=t=>{const e=P(53),{model:s}=t,r=J(),n=s.groups[0]?.operations[0]?.key??"",[o,l]=L(n),[a,g]=L("");let d;e[0]!==n||e[1]!==s.operationByKey||e[2]!==o?(d=s.operationByKey.get(o)??s.operationByKey.get(n),e[0]=n,e[1]=s.operationByKey,e[2]=o,e[3]=d):d=e[3];const c=d;let u,h,p,f,m,v,k,x,b,y;if(e[4]!==a||e[5]!==s.groups||e[6]!==s.server||e[7]!==c?.key||e[8]!==r){u=lt(s.groups,a);let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=M=>{const{key:B}=M.currentTarget.dataset;B!==void 0&&l(B)},e[19]=E):E=e[19];const $=E;let R;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=M=>{g(M.target.value)},e[20]=R):R=e[20];const j=R;h=s.server??"",b="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",y="api-reference",e[21]!==r?(m=r("API operations"),e[21]=r,e[22]=m):m=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",k="api-reference-nav";let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=i(W,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:xe,strokeWidth:2}),e[23]=I):I=e[23];let C;e[24]!==r?(C=r("Filter operations"),e[24]=r,e[25]=C):C=e[25],e[26]!==a||e[27]!==C?(x=i("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:N("div",{className:"relative",children:[I,i(be,{className:"h-7 pl-7","data-testid":"api-filter",onChange:j,placeholder:C,value:a})]})}),e[26]=a,e[27]=C,e[28]=x):x=e[28],p="flex flex-col gap-4 p-2";let _;e[29]!==c?.key||e[30]!==r?(_=M=>N("div",{className:"flex flex-col gap-1",children:[N("div",{className:"flex items-center justify-between px-2",children:[i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M.name||r("(root)")}),i("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:M.operations.length})]}),M.operations.map(B=>{const ie=B.key===c?.key;return N("button",{"aria-current":ie?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":B.key,"data-testid":`api-nav-${B.operationId}`,onClick:$,type:"button",children:[i("span",{className:"truncate",children:B.summary}),i(H,{kind:B.kind,method:B.method})]},B.key)})]},M.name),e[29]=c?.key,e[30]=r,e[31]=_):_=e[31],f=u.map(_),e[4]=a,e[5]=s.groups,e[6]=s.server,e[7]=c?.key,e[8]=r,e[9]=u,e[10]=h,e[11]=p,e[12]=f,e[13]=m,e[14]=v,e[15]=k,e[16]=x,e[17]=b,e[18]=y}else u=e[9],h=e[10],p=e[11],f=e[12],m=e[13],v=e[14],k=e[15],x=e[16],b=e[17],y=e[18];let S;e[32]!==u.length||e[33]!==r?(S=u.length===0&&i("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:r("No operations match your filter.")}),e[32]=u.length,e[33]=r,e[34]=S):S=e[34];let O;e[35]!==S||e[36]!==p||e[37]!==f?(O=N("div",{className:p,children:[f,S]}),e[35]=S,e[36]=p,e[37]=f,e[38]=O):O=e[38];let w;e[39]!==O||e[40]!==m||e[41]!==v||e[42]!==k||e[43]!==x?(w=N("nav",{"aria-label":m,className:v,"data-testid":k,children:[x,O]}),e[39]=O,e[40]=m,e[41]=v,e[42]=k,e[43]=x,e[44]=w):w=e[44];let T;e[45]!==c||e[46]!==h?(T=c===void 0?i("div",{className:"lg:col-span-2"}):N(He,{operation:c,children:[i("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:i(Ve,{operation:c})}),N("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[i(_e,{operation:c,server:h}),i(it,{})]})]},c.key),e[45]=c,e[46]=h,e[47]=T):T=e[47];let A;return e[48]!==w||e[49]!==T||e[50]!==b||e[51]!==y?(A=N("div",{className:b,"data-testid":y,children:[w,T]}),e[48]=w,e[49]=T,e[50]=b,e[51]=y,e[52]=A):A=e[52],A};export{$t as R,Ot as u};
|
|
11
|
+
const data = await response.json();`}}},_e=t=>{const e=P(24),{operation:s,server:r}=t,n=J(),[o,l]=L("curl");let a;e[0]!==s||e[1]!==o||e[2]!==r?(a=Le(o,s,r),e[0]=s,e[1]=o,e[2]=r,e[3]=a):a=e[3];const g=a;let d;e[4]!==g?(d=()=>{Y(g)},e[4]=g,e[5]=d):d=e[5];const c=d;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{l(y.currentTarget.dataset.sample)},e[6]=u):u=e[6];const h=u;let p;e[7]!==o?(p=Re.map(y=>i("button",{"aria-selected":o===y,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":y,"data-testid":`api-sample-${y}`,onClick:h,role:"tab",type:"button",children:je[y]},y)),e[7]=o,e[8]=p):p=e[8];let f;e[9]!==p?(f=i("div",{className:"flex gap-1",role:"tablist",children:p}),e[9]=p,e[10]=f):f=e[10];let m;e[11]!==n?(m=n("Copy"),e[11]=n,e[12]=m):m=e[12];let v;e[13]!==c||e[14]!==m?(v=i(q,{"data-testid":"api-sample-copy",onClick:c,size:"xs",type:"button",variant:"ghost",children:m}),e[13]=c,e[14]=m,e[15]=v):v=e[15];let w;e[16]!==f||e[17]!==v?(w=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[f,v]}),e[16]=f,e[17]=v,e[18]=w):w=e[18];let x;e[19]!==g?(x=i("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:g}),e[19]=g,e[20]=x):x=e[20];let b;return e[21]!==w||e[22]!==x?(b=N("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[w,x]}),e[21]=w,e[22]=x,e[23]=b):b=e[23],b},Be={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},Me=t=>{switch(t.toUpperCase()){case"DELETE":return"red";case"GET":return"emerald";case"PATCH":return"orange";case"POST":return"blue";case"PUT":return"orange";default:return"neutral"}},Je=t=>{switch(t){case"action":return"violet";case"mutation":return"orange";case"query":return"emerald";default:return"neutral"}},H=t=>{const e=P(7),{kind:s,method:r,testId:n}=t;let o;e[0]!==s||e[1]!==r?(o=s??r.toUpperCase(),e[0]=s,e[1]=r,e[2]=o):o=e[2];const l=o,a=s===void 0?Me(r):Je(s),g=`${Be[a]} font-mono text-[10px] tracking-wide uppercase`;let d;return e[3]!==l||e[4]!==g||e[5]!==n?(d=i(ve,{className:g,"data-testid":n,variant:"ghost",children:l}),e[3]=l,e[4]=g,e[5]=n,e[6]=d):d=e[6],d},te=t=>t.startsWith("2")?"text-emerald-600 dark:text-emerald-400":t==="default"||t.startsWith("4")||t.startsWith("5")?"text-red-600 dark:text-red-400":"text-muted-foreground",re=t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground",De=new Set([" ",`
|
|
12
|
+
`,"\r"]),X=" ",Ke=t=>{let e="";for(const n of t)De.has(n)||(e+=n);let s=0,r=e.length;for(;s<r&&(e[s]??"")<=X;)s+=1;for(;r>s&&(e[r-1]??"")<=X;)r-=1;return e.slice(s,r)},Fe=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,ze=(t,e)=>{const s=globalThis.location?.origin??"",r=e===""?s:e,n=Ke(t);if(r===""){if(Fe.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}const o=new URL(n,r);if(o.origin!==new URL(r).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${o.origin} is not ${r})`);return o.toString()},We=async(t,e,s,r)=>{const n=t.method!=="GET"&&t.method!=="HEAD",o=ze(t.httpPath,s),a=await(await fetch(o,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...r===null||r===""?{}:{authorization:`Bearer ${r}`}},method:t.method})).text();try{return JSON.parse(a)}catch{return a}},qe=t=>JSON.stringify(D(t.argsSchema)??{},void 0,2),se=le(null),ne=()=>{const t=de(se);if(t===null)throw new we("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},He=({children:t,operation:e})=>{const s=J(),r=ke(),[n,o]=L(()=>qe(e)),[l,a]=L(""),[g,d]=L("idle"),[c,u]=L(void 0),[h,p]=L(null),[f,m]=L(null),v=async()=>{let b;try{b=n.trim()===""?{}:JSON.parse(n)}catch(S){d("error"),u(void 0),m(null),p(s("Invalid JSON args: {message}",{message:z(S)}));return}d("running"),p(null);const y=performance.now();try{const S=await(e.functionPath===void 0?We(e,b,r.url,r.getAuthToken()):ue(r,e.kind,fe(e.functionPath),b,me(l)));u(S),m(Math.round(performance.now()-y)),d("success")}catch(S){u(void 0),m(Math.round(performance.now()-y)),p(z(S)),d("error")}};return i(se,{value:{argsText:n,durationMs:f,error:h,operation:e,response:c,send:()=>{ce(v())},setArgsText:o,setShardKey:a,shardKey:l,status:g},children:t})},Ue=()=>{const t=P(48),e=J(),{argsText:s,operation:r,send:n,setArgsText:o,setShardKey:l,shardKey:a,status:g}=ne();let d;t[0]!==o?(d=C=>{o(C.target.value)},t[0]=o,t[1]=d):d=t[1];const c=d;let u;t[2]!==n?(u=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),n())},t[2]=n,t[3]=u):u=t[3];const h=u,p=g==="running";let f;t[4]!==r.kind||t[5]!==r.method?(f=i(H,{kind:r.kind,method:r.method,testId:"api-try-method"}),t[4]=r.kind,t[5]=r.method,t[6]=f):f=t[6];const m=r.functionPath??r.httpPath;let v;t[7]!==m?(v=i("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:m}),t[7]=m,t[8]=v):v=t[8];const w=p?"animate-pulse":void 0;let x;t[9]!==w?(x=i(W,{className:w,icon:he,strokeWidth:2}),t[9]=w,t[10]=x):x=t[10];let b;t[11]!==p||t[12]!==e?(b=e(p?"Sending…":"Send"),t[11]=p,t[12]=e,t[13]=b):b=t[13];let y;t[14]!==p||t[15]!==n||t[16]!==x||t[17]!==b?(y=N(q,{"data-testid":"api-try-send",disabled:p,onClick:n,size:"sm",type:"button",children:[x,b]}),t[14]=p,t[15]=n,t[16]=x,t[17]=b,t[18]=y):y=t[18];let S;t[19]!==f||t[20]!==v||t[21]!==y?(S=N("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[f,v,y]}),t[19]=f,t[20]=v,t[21]=y,t[22]=S):S=t[22];let O;t[23]!==e?(O=e("Arguments (JSON)"),t[23]=e,t[24]=O):O=t[24];let k;t[25]!==O?(k=i(V,{htmlFor:"api-try-args",children:O}),t[25]=O,t[26]=k):k=t[26];let T;t[27]!==s?(T=s.split(`
|
|
13
|
+
`),t[27]=s,t[28]=T):T=t[28];const A=Math.min(12,Math.max(3,T.length));let E;t[29]!==s||t[30]!==c||t[31]!==h||t[32]!==A?(E=i(Se,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:c,onKeyDown:h,rows:A,spellCheck:!1,value:s}),t[29]=s,t[30]=c,t[31]=h,t[32]=A,t[33]=E):E=t[33];let $;t[34]!==k||t[35]!==E?($=N("div",{className:"flex flex-col gap-1.5",children:[k,E]}),t[34]=k,t[35]=E,t[36]=$):$=t[36];let R;t[37]!==r.functionPath||t[38]!==l||t[39]!==a||t[40]!==e?(R=r.functionPath!==void 0&&N("div",{className:"flex flex-col gap-1.5",children:[i(V,{htmlFor:"shard-input",children:e("Shard key (optional)")}),i(Ne,{id:"shard-input",onChange:l,testId:"shard-input",value:a})]}),t[37]=r.functionPath,t[38]=l,t[39]=a,t[40]=e,t[41]=R):R=t[41];let j;t[42]!==$||t[43]!==R?(j=N("div",{className:"flex flex-col gap-3 p-3",children:[$,R]}),t[42]=$,t[43]=R,t[44]=j):j=t[44];let I;return t[45]!==j||t[46]!==S?(I=N("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[S,j]}),t[45]=j,t[46]=S,t[47]=I):I=t[47],I},Ve=t=>{const e=P(51),{operation:s}=t,r=J(),n=`api-operation-${s.operationId}`,o=s.key;let l;e[0]!==s.kind||e[1]!==s.method?(l=i(H,{kind:s.kind,method:s.method,testId:"api-operation-method"}),e[0]=s.kind,e[1]=s.method,e[2]=l):l=e[2];const a=s.functionPath??s.httpPath;let g;e[3]!==a?(g=i("code",{className:"truncate font-mono text-xs text-muted-foreground",children:a}),e[3]=a,e[4]=g):g=e[4];let d;e[5]!==l||e[6]!==g?(d=N("div",{className:"flex items-center gap-2",children:[l,g]}),e[5]=l,e[6]=g,e[7]=d):d=e[7];let c;e[8]!==s.title?(c=i("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:s.title}),e[8]=s.title,e[9]=c):c=e[9];let u;e[10]!==s.description?(u=s.description!==void 0&&i("p",{className:"text-sm text-muted-foreground",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==d||e[13]!==c||e[14]!==u?(h=N("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[d,c,u]}),e[12]=d,e[13]=c,e[14]=u,e[15]=h):h=e[15];let p;e[16]!==r?(p=r("Try it"),e[16]=r,e[17]=p):p=e[17];let f;e[18]!==p?(f=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:p}),e[18]=p,e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i(Ue,{}),e[20]=m):m=e[20];let v;e[21]!==f?(v=N("section",{className:"flex flex-col gap-2",children:[f,m]}),e[21]=f,e[22]=v):v=e[22];let w;e[23]!==r?(w=r("Request arguments"),e[23]=r,e[24]=w):w=e[24];let x;e[25]!==w?(x=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[25]=w,e[26]=x):x=e[26];let b;e[27]!==s.argsSchema?(b=i(G,{schema:s.argsSchema,testId:"api-operation-args"}),e[27]=s.argsSchema,e[28]=b):b=e[28];let y;e[29]!==x||e[30]!==b?(y=N("section",{className:"flex flex-col gap-2",children:[x,b]}),e[29]=x,e[30]=b,e[31]=y):y=e[31];let S;e[32]!==r?(S=r("Response body"),e[32]=r,e[33]=S):S=e[33];let O;e[34]!==S?(O=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:S}),e[34]=S,e[35]=O):O=e[35];let k;if(e[36]!==s.responses||e[37]!==r){let E;e[39]!==r?(E=$=>N("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[N("div",{className:"flex items-center justify-between gap-2",children:[N("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${te($.status)}`,children:[i("span",{className:`size-1.5 rounded-full ${re($.status)}`}),$.status]}),$.schema!==void 0&&i("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r("application/json")})]}),$.description!==void 0&&i("p",{className:"text-xs text-muted-foreground",children:$.description}),$.schema!==void 0&&i(G,{schema:$.schema,testId:`api-response-${$.status}`})]},$.status),e[39]=r,e[40]=E):E=e[40],k=s.responses.map(E),e[36]=s.responses,e[37]=r,e[38]=k}else k=e[38];let T;e[41]!==O||e[42]!==k?(T=N("section",{className:"flex flex-col gap-3",children:[O,k]}),e[41]=O,e[42]=k,e[43]=T):T=e[43];let A;return e[44]!==s.key||e[45]!==n||e[46]!==v||e[47]!==y||e[48]!==T||e[49]!==h?(A=N("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[h,v,y,T]},o),e[44]=s.key,e[45]=n,e[46]=v,e[47]=y,e[48]=T,e[49]=h,e[50]=A):A=e[50],A},Ge={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Xe=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Ye=/^\s*:/,Qe=(t,e,s)=>s.startsWith('"')?Ye.test(t.slice(e))?"key":"string":s==="true"||s==="false"||s==="null"?"boolean":"number",Ze=t=>{const e=[];let s=0;for(const r of t.matchAll(Xe)){const{index:n}=r,o=r[0],l=n+o.length;n>s&&e.push({kind:"plain",start:s,text:t.slice(s,n)}),e.push({kind:Qe(t,l,o),start:n,text:o}),s=l}return s<t.length&&e.push({kind:"plain",start:s,text:t.slice(s)}),e},et=t=>{const e=P(4),{code:s}=t;let r;e[0]!==s?(r=Ze(s).map(tt),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=i(ye,{children:r}),e[2]=r,e[3]=n):n=e[3],n};function tt(t){return i("span",{className:Ge[t.kind],children:t.text},t.start)}const oe="__live__",rt=t=>t.schema===void 0?"":JSON.stringify(D(t.schema),void 0,2),st=(t,e,s)=>s?t??"":e===void 0?"":JSON.stringify(e,pe,2),nt=t=>{const e=P(18),{active:s,running:r,showError:n}=t,o=J();if(r){let u;e[0]!==o?(u=o("Sending…"),e[0]=o,e[1]=u):u=e[1];let h;return e[2]!==u?(h=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:u}),e[2]=u,e[3]=h):h=e[3],h}if(s===void 0||s.body===""){let u;e[4]!==s?.live||e[5]!==o?(u=s?.live===!0?o("Send a request to see the response."):o("No example for this response."),e[4]=s?.live,e[5]=o,e[6]=u):u=e[6];let h;return e[7]!==u?(h=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:u}),e[7]=u,e[8]=h):h=e[8],h}const l=n&&"text-destructive";let a;e[9]!==l?(a=Q("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",l),e[9]=l,e[10]=a):a=e[10];const g=n?"api-response-error":"api-response-body";let d;e[11]!==s.body||e[12]!==n?(d=n?s.body:i(et,{code:s.body}),e[11]=s.body,e[12]=n,e[13]=d):d=e[13];let c;return e[14]!==a||e[15]!==g||e[16]!==d?(c=i("pre",{className:a,"data-testid":g,children:d}),e[14]=a,e[15]=g,e[16]=d,e[17]=c):c=e[17],c},ot=({durationMs:t,error:e,failed:s,operation:r,ran:n,response:o,t:l})=>{const a=r.responses.map(d=>({body:rt(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:st(e,o,s),durationMs:t,id:oe,label:l("Live"),live:!0,status:s?"error":"200"},...a]:a},it=()=>{const t=P(19),e=J(),{durationMs:s,error:r,operation:n,response:o,status:l}=ne(),a=l==="running",g=l==="error",d=l==="success"||g,c=ot({durationMs:s,error:r,failed:g,operation:n,ran:d,response:o,t:e}),u=d?oe:c.find(at)?.id??c[0]?.id??"",[h,p]=L(null),f=c.find(C=>C.id===(h??u))??c[0];let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=C=>{const{id:_}=C.currentTarget.dataset;_!==void 0&&p(_)},t[0]=m):m=t[0];const v=m,w=()=>{f!==void 0&&Y(f.body)},x=f?.live===!0?f.durationMs:null,b=f?.live===!0&&f.status==="error",y="flex min-h-0 flex-col rounded-xl border border-border bg-card",S="api-response-panel";let O;t[1]!==e?(O=e("Response"),t[1]=e,t[2]=O):O=t[2];let k;t[3]!==O?(k=i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O}),t[3]=O,t[4]=k):k=t[4];const T=x!==null&&i("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:x})}),A=f!==void 0&&f.body!==""&&i(q,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:w,size:"icon-xs",type:"button",variant:"ghost",children:i(W,{icon:ge,strokeWidth:2})});let E;t[5]!==T||t[6]!==A?(E=N("div",{className:"flex items-center gap-2",children:[T,A]}),t[5]=T,t[6]=A,t[7]=E):E=t[7];let $;t[8]!==k||t[9]!==E?($=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,E]}),t[8]=k,t[9]=E,t[10]=$):$=t[10];const R=c.length>0&&i("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:c.map(C=>{const _=C.id===f?.id;return N("button",{"aria-selected":_,className:Q("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",_?te(C.status):"text-muted-foreground"),"data-id":C.id,"data-testid":C.live?"api-response-tab-live":`api-response-tab-${C.status}`,onClick:v,role:"tab",type:"button",children:[i("span",{className:`size-1.5 rounded-full ${re(C.status)}`}),C.label]},C.id)})});let j;t[11]!==f||t[12]!==a||t[13]!==b?(j=i(nt,{active:f,running:a,showError:b}),t[11]=f,t[12]=a,t[13]=b,t[14]=j):j=t[14];let I;return t[15]!==j||t[16]!==$||t[17]!==R?(I=N("div",{className:y,"data-testid":S,children:[$,R,j]}),t[15]=j,t[16]=$,t[17]=R,t[18]=I):I=t[18],I};function at(t){return t.status.startsWith("2")}const lt=(t,e)=>{const s=e.trim().toLowerCase();return s===""?t:t.map(r=>({...r,operations:r.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(s))})).filter(r=>r.operations.length>0)},$t=t=>{const e=P(53),{model:s}=t,r=J(),n=s.groups[0]?.operations[0]?.key??"",[o,l]=L(n),[a,g]=L("");let d;e[0]!==n||e[1]!==s.operationByKey||e[2]!==o?(d=s.operationByKey.get(o)??s.operationByKey.get(n),e[0]=n,e[1]=s.operationByKey,e[2]=o,e[3]=d):d=e[3];const c=d;let u,h,p,f,m,v,w,x,b,y;if(e[4]!==a||e[5]!==s.groups||e[6]!==s.server||e[7]!==c?.key||e[8]!==r){u=lt(s.groups,a);let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=M=>{const{key:B}=M.currentTarget.dataset;B!==void 0&&l(B)},e[19]=E):E=e[19];const $=E;let R;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=M=>{g(M.target.value)},e[20]=R):R=e[20];const j=R;h=s.server??"",b="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",y="api-reference",e[21]!==r?(m=r("API operations"),e[21]=r,e[22]=m):m=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",w="api-reference-nav";let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=i(W,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:xe,strokeWidth:2}),e[23]=I):I=e[23];let C;e[24]!==r?(C=r("Filter operations"),e[24]=r,e[25]=C):C=e[25],e[26]!==a||e[27]!==C?(x=i("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:N("div",{className:"relative",children:[I,i(be,{className:"h-7 pl-7","data-testid":"api-filter",onChange:j,placeholder:C,value:a})]})}),e[26]=a,e[27]=C,e[28]=x):x=e[28],p="flex flex-col gap-4 p-2";let _;e[29]!==c?.key||e[30]!==r?(_=M=>N("div",{className:"flex flex-col gap-1",children:[N("div",{className:"flex items-center justify-between px-2",children:[i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M.name||r("(root)")}),i("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:M.operations.length})]}),M.operations.map(B=>{const ie=B.key===c?.key;return N("button",{"aria-current":ie?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":B.key,"data-testid":`api-nav-${B.operationId}`,onClick:$,type:"button",children:[i("span",{className:"truncate",children:B.summary}),i(H,{kind:B.kind,method:B.method})]},B.key)})]},M.name),e[29]=c?.key,e[30]=r,e[31]=_):_=e[31],f=u.map(_),e[4]=a,e[5]=s.groups,e[6]=s.server,e[7]=c?.key,e[8]=r,e[9]=u,e[10]=h,e[11]=p,e[12]=f,e[13]=m,e[14]=v,e[15]=w,e[16]=x,e[17]=b,e[18]=y}else u=e[9],h=e[10],p=e[11],f=e[12],m=e[13],v=e[14],w=e[15],x=e[16],b=e[17],y=e[18];let S;e[32]!==u.length||e[33]!==r?(S=u.length===0&&i("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:r("No operations match your filter.")}),e[32]=u.length,e[33]=r,e[34]=S):S=e[34];let O;e[35]!==S||e[36]!==p||e[37]!==f?(O=N("div",{className:p,children:[f,S]}),e[35]=S,e[36]=p,e[37]=f,e[38]=O):O=e[38];let k;e[39]!==O||e[40]!==m||e[41]!==v||e[42]!==w||e[43]!==x?(k=N("nav",{"aria-label":m,className:v,"data-testid":w,children:[x,O]}),e[39]=O,e[40]=m,e[41]=v,e[42]=w,e[43]=x,e[44]=k):k=e[44];let T;e[45]!==c||e[46]!==h?(T=c===void 0?i("div",{className:"lg:col-span-2"}):N(He,{operation:c,children:[i("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:i(Ve,{operation:c})}),N("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[i(_e,{operation:c,server:h}),i(it,{})]})]},c.key),e[45]=c,e[46]=h,e[47]=T):T=e[47];let A;return e[48]!==k||e[49]!==T||e[50]!==b||e[51]!==y?(A=N("div",{className:b,"data-testid":y,children:[k,T]}),e[48]=k,e[49]=T,e[50]=b,e[51]=y,e[52]=A):A=e[52],A};export{$t as R,Ot as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as v}from"react/compiler-runtime";import{Download01Icon as ne}from"@hugeicons/core-free-icons";import{HugeiconsIcon as se}from"@hugeicons/react";import{Handle as B,Position as G,getNodesBounds as re,getViewportForBounds as ae,useNodesState as le,useEdgesState as ie,ReactFlow as ce,Background as de,Panel as M,Controls as me,MiniMap as pe,useNodes as ue,useReactFlow as U,useNodesInitialized as fe}from"@xyflow/react";import{useState as k,useMemo as _,useRef as ge,useEffect as D}from"react";import{S as he,T as N}from"./storage-tier-C2mKwYRj.mjs";import{B as S}from"./badge-r_5B4LHP.mjs";import{B as j}from"./button-q0UYSmrn.mjs";import{d as be,D as xe,c as Ne,b as C}from"./dropdown-menu-jLZenfWH.mjs";import{I as ye}from"./input-CXhxesPC.mjs";import{useT as T}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{f as L}from"./internal-CyDwqA67.mjs";import{c as y}from"./utils-bhneXptQ.mjs";import{jsx as i,jsxs as f}from"react/jsx-runtime";import{LunoraError as ve}from"@lunora/errors";import{toBlob as we,toSvg as Se}from"html-to-image";function Ee(o){const e=v(10);let t,a,s;e[0]!==o?({className:t,selected:s,...a}=o,e[0]=o,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const r=s===!0?"":void 0;let n;e[4]!==t?(n=y("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=n):n=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l=i("div",{"data-slot":"base-node","data-selected":r,className:n,...a}),e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],l}function Te(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}function $e(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex flex-col",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}const F=o=>{const e=o.ref===void 0?o.type:`${o.type} → ${o.ref}`;return o.optional===!0?`${e}?`:e},_e=o=>{const e=v(22),{data:t,selected:a}=o,s=T();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==s?(r=t.loadError===!0?i("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:s("Columns unavailable")}):i("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=s,e[3]=r):r=e[3];const n=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=i("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=i("span",{className:"ms-auto",children:i(he,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let c;e[8]!==d||e[9]!==m?(c=f(Te,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=c):c=e[10];let p;e[11]!==t.columns||e[12]!==t.label||e[13]!==n?(p=t.columns.length===0?n:t.columns.map(g=>f("div",{className:y("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",g.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${g.name}`,children:[i(B,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Left,type:"target"}),i("span",{className:"truncate font-mono",title:g.name,children:g.name}),g.pk===!0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),g.ref!==void 0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),i("span",{className:"ms-auto truncate text-muted-foreground",title:F(g),children:F(g)}),i(B,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Right,type:"source"})]},g.name)),e[11]=t.columns,e[12]=t.label,e[13]=n,e[14]=p):p=e[14];let u;e[15]!==p?(u=i($e,{children:p}),e[15]=p,e[16]=u):u=e[16];let b;return e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=f(Ee,{className:"w-64 overflow-hidden","data-testid":l,selected:a,children:[c,u]}),e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],b},x=1920,E=1080,K=32,R=(o,e)=>{const t=globalThis.document.createElement("a");t.href=o,t.download=e,globalThis.document.body.append(t),t.click(),t.remove()},Ce=(o,e,t="schema-diagram.json")=>{const a={edges:e,exportedAt:new Date().toISOString(),nodes:o},s=JSON.stringify(a,void 0,2),r=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));R(r,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(r)},0)},P=(o,e,t,a)=>{const s=re(o),{x:r,y:n,zoom:l}=ae(s,e,t,.1,2,a);return{transform:[r,n,l],zoom:l}},Me=async(o,e,t="schema-diagram.png")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await we(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});if(l===null)throw new ve("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(l);R(d,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},ke=async(o,e,t="schema-diagram.svg")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await Se(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});R(l,t)},W=256,q=112,I=36,w=24,De=480,Le=1.4,Re=o=>{const e=Math.max(1,Math.round(Math.sqrt(Le*o/(W+q))));return Math.max(De,o/e)},Ae=38,Oe=28,z=o=>Ae+Math.max(1,o)*Oe,He=(o,e)=>{const t=new Map;for(const n of o)t.set(n,[]);for(const n of e)n.to!==n.from&&t.has(n.from)&&t.has(n.to)&&t.get(n.from)?.push(n.to);const a=new Map,s=new Set,r=n=>{const l=a.get(n);if(l!==void 0)return l;if(s.has(n))return 0;s.add(n);let d=0;for(const m of t.get(n)??[])d=Math.max(d,r(m)+1);return s.delete(n),a.set(n,d),d};for(const n of o)r(n);return a},Be=(o,e,t)=>{const a=He(o,e),s=new Map;for(const m of o){const c=a.get(m)??0,p=s.get(c);p===void 0?s.set(c,[m]):p.push(m)}const r=o.reduce((m,c)=>m+z(t.get(c)??0)+I,0),n=Re(r),l=[];let d=0;for(const m of[...s.keys()].toSorted((c,p)=>c-p)){let c=0,p=w;for(const u of s.get(m)??[]){const b=z(t.get(u)??0);p>w&&p+b>n&&(c+=1,p=w),l.push({name:u,x:w+(d+c)*(W+q),y:p}),p+=b+I}d+=c+1}return l},Ge={databaseSchema:_e},J={backgroundColor:N.shard.color},V={backgroundColor:N.global.color},je={global:!0,shard:!0},Fe={},Ie=o=>{const e=o.find(t=>t.pk===!0)?.name;return e!==void 0?e:o.some(t=>t.name==="_id")?"_id":o.some(t=>t.name==="id")?"id":o[0]?.name??"_id"},Y=o=>o.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),ze=(o,e,t)=>{const a=o.map(l=>l.name),s=new Map(o.map(l=>[l.name,l.columns.length])),r=Be(a,Y(o),s),n=new Map(o.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const c=n.get(l);return c===void 0?[]:[{className:t[l],data:{columns:c.columns,label:l,loadError:e,tier:c.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Ue=o=>{const e=new Map(o.map(t=>[t.name,t.columns]));return Y(o).flatMap(t=>{const a=e.get(t.to)??[],s=e.get(t.from)??[],r=Ie(a);return!a.some(n=>n.name===r)||!s.some(n=>n.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ke=()=>{const o=v(15),e=T();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),o[0]=t):t=o[0];let a;o[1]===Symbol.for("react.memo_cache_sentinel")?(a=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]}),o[1]=a):a=o[1];let s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),o[2]=s):s=o[2];let r;o[3]!==e?(r=e("Primary key"),o[3]=e,o[4]=r):r=o[4];let n;o[5]!==r?(n=f("span",{className:"flex items-center gap-1",children:[s,r]}),o[5]=r,o[6]=n):n=o[6];let l;o[7]===Symbol.for("react.memo_cache_sentinel")?(l=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),o[7]=l):l=o[7];let d;o[8]!==e?(d=e("Foreign key"),o[8]=e,o[9]=d):d=o[9];let m;o[10]!==d?(m=f("span",{className:"flex items-center gap-1",children:[l,d]}),o[10]=d,o[11]=m):m=o[11];let c;return o[12]!==n||o[13]!==m?(c=f("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,a,n,m]}),o[12]=n,o[13]=m,o[14]=c):c=o[14],c},Pe=12,We=o=>{const e=v(9),{containerRef:t,seedKey:a}=o,s=fe(),{fitView:r}=U();let n;e[0]!==t||e[1]!==r||e[2]!==s?(n=()=>{if(!s)return;const d=()=>{L(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const c=new ResizeObserver(()=>{d()});return c.observe(m),()=>{c.disconnect()}},e[0]=t,e[1]=r,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==s||e[7]!==a?(l=[t,r,s,a],e[4]=t,e[5]=r,e[6]=s,e[7]=a,e[8]=l):l=e[8],D(n,l),null},qe=({containerRef:o,testIdPrefix:e})=>{const t=T(),a=ue(),{getEdges:s}=U(),[r,n]=k(null),l=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("png");try{await Me(u,a,`${e}-schema-diagram.png`)}finally{n(null)}}},d=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("svg");try{await ke(u,a,`${e}-schema-diagram.svg`)}finally{n(null)}}},m=()=>{n("json");try{Ce(a,s(),`${e}-schema-diagram.json`)}finally{n(null)}},c=()=>{L(l())},p=()=>{L(d())};return i(M,{position:"top-right",children:f(be,{children:[f(xe,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${e}-export-trigger`,disabled:r!==null,children:[i(se,{className:"size-3.5",icon:ne,strokeWidth:2}),t("Export")]}),f(Ne,{align:"end",children:[i(C,{"data-testid":`${e}-export-png`,disabled:r!==null,onClick:c,children:t("PNG")}),i(C,{"data-testid":`${e}-export-svg`,disabled:r!==null,onClick:p,children:t("SVG")}),i(C,{"data-testid":`${e}-export-json`,disabled:r!==null,onClick:m,children:t("JSON")})]})]})})},dt=({columnsError:o,fill:e=!1,nodeClasses:t,tables:a,testIdPrefix:s})=>{const r=T(),[n,l]=k(je),[d,m]=k(""),c=_(()=>{const h=d.trim().toLowerCase();return a.filter(H=>n[H.tier]&&H.name.toLowerCase().includes(h))},[a,n,d]),p=_(()=>ze(c,o??!1,t??Fe),[c,o,t]),u=_(()=>Ue(c),[c]),b=c.map(h=>h.name).join(","),[g,A,Q]=le(p),[Z,O,X]=ie(u),$=ge(null);D(()=>{A(p)},[p,A]),D(()=>{O(u)},[u,O]);const ee=h=>{m(h.target.value)},te=()=>{l(h=>({...h,shard:!h.shard}))},oe=()=>{l(h=>({...h,global:!h.global}))};return a.length===0?i("section",{className:"flex flex-col gap-2","data-testid":`${s}-section`,children:i("p",{className:"text-sm text-muted-foreground","data-testid":`${s}-empty`,children:r("No tables to graph.")})}):i("section",{className:y("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${s}-section`,children:i("div",{className:y("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${s}-canvas`,ref:$,children:f(ce,{edges:Z,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:g,nodesConnectable:!1,nodeTypes:Ge,onEdgesChange:X,onNodesChange:Q,children:[i(de,{}),i(M,{position:"top-left",children:f("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[i(ye,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${s}-find`,onChange:ee,placeholder:r("Find table…"),value:d}),f("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[f(j,{"aria-pressed":n.shard,className:"gap-1.5","data-testid":`${s}-tier-shard`,onClick:te,size:"xs",type:"button",variant:n.shard?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),f(j,{"aria-pressed":n.global,className:"gap-1.5","data-testid":`${s}-tier-global`,onClick:oe,size:"xs",type:"button",variant:n.global?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]})]})]})}),i(M,{position:"bottom-center",children:i(Ke,{})}),i(me,{showInteractive:!1}),c.length>Pe&&i(pe,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),i(qe,{containerRef:$,testIdPrefix:s}),i(We,{containerRef:$,seedKey:b})]})})})};export{dt as S};
|
|
2
|
+
import{c as v}from"react/compiler-runtime";import{Download01Icon as ne}from"@hugeicons/core-free-icons";import{HugeiconsIcon as se}from"@hugeicons/react";import{Handle as B,Position as G,getNodesBounds as re,getViewportForBounds as ae,useNodesState as le,useEdgesState as ie,ReactFlow as ce,Background as de,Panel as M,Controls as me,MiniMap as pe,useNodes as ue,useReactFlow as U,useNodesInitialized as fe}from"@xyflow/react";import{useState as k,useMemo as _,useRef as ge,useEffect as D}from"react";import{S as he,T as N}from"./storage-tier-C2mKwYRj.mjs";import{B as S}from"./badge-r_5B4LHP.mjs";import{B as j}from"./button-q0UYSmrn.mjs";import{d as be,D as xe,c as Ne,b as C}from"./dropdown-menu-jLZenfWH.mjs";import{I as ye}from"./input-CXhxesPC.mjs";import{useT as T}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{f as L}from"./internal-Df43vQI0.mjs";import{c as y}from"./utils-bhneXptQ.mjs";import{jsx as i,jsxs as f}from"react/jsx-runtime";import{LunoraError as ve}from"@lunora/errors";import{toBlob as we,toSvg as Se}from"html-to-image";function Ee(o){const e=v(10);let t,a,s;e[0]!==o?({className:t,selected:s,...a}=o,e[0]=o,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const r=s===!0?"":void 0;let n;e[4]!==t?(n=y("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=n):n=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l=i("div",{"data-slot":"base-node","data-selected":r,className:n,...a}),e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],l}function Te(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}function $e(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex flex-col",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}const F=o=>{const e=o.ref===void 0?o.type:`${o.type} → ${o.ref}`;return o.optional===!0?`${e}?`:e},_e=o=>{const e=v(22),{data:t,selected:a}=o,s=T();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==s?(r=t.loadError===!0?i("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:s("Columns unavailable")}):i("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=s,e[3]=r):r=e[3];const n=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=i("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=i("span",{className:"ms-auto",children:i(he,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let c;e[8]!==d||e[9]!==m?(c=f(Te,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=c):c=e[10];let p;e[11]!==t.columns||e[12]!==t.label||e[13]!==n?(p=t.columns.length===0?n:t.columns.map(g=>f("div",{className:y("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",g.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${g.name}`,children:[i(B,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Left,type:"target"}),i("span",{className:"truncate font-mono",title:g.name,children:g.name}),g.pk===!0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),g.ref!==void 0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),i("span",{className:"ms-auto truncate text-muted-foreground",title:F(g),children:F(g)}),i(B,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Right,type:"source"})]},g.name)),e[11]=t.columns,e[12]=t.label,e[13]=n,e[14]=p):p=e[14];let u;e[15]!==p?(u=i($e,{children:p}),e[15]=p,e[16]=u):u=e[16];let b;return e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=f(Ee,{className:"w-64 overflow-hidden","data-testid":l,selected:a,children:[c,u]}),e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],b},x=1920,E=1080,K=32,R=(o,e)=>{const t=globalThis.document.createElement("a");t.href=o,t.download=e,globalThis.document.body.append(t),t.click(),t.remove()},Ce=(o,e,t="schema-diagram.json")=>{const a={edges:e,exportedAt:new Date().toISOString(),nodes:o},s=JSON.stringify(a,void 0,2),r=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));R(r,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(r)},0)},P=(o,e,t,a)=>{const s=re(o),{x:r,y:n,zoom:l}=ae(s,e,t,.1,2,a);return{transform:[r,n,l],zoom:l}},Me=async(o,e,t="schema-diagram.png")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await we(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});if(l===null)throw new ve("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(l);R(d,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},ke=async(o,e,t="schema-diagram.svg")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await Se(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});R(l,t)},W=256,q=112,I=36,w=24,De=480,Le=1.4,Re=o=>{const e=Math.max(1,Math.round(Math.sqrt(Le*o/(W+q))));return Math.max(De,o/e)},Ae=38,Oe=28,z=o=>Ae+Math.max(1,o)*Oe,He=(o,e)=>{const t=new Map;for(const n of o)t.set(n,[]);for(const n of e)n.to!==n.from&&t.has(n.from)&&t.has(n.to)&&t.get(n.from)?.push(n.to);const a=new Map,s=new Set,r=n=>{const l=a.get(n);if(l!==void 0)return l;if(s.has(n))return 0;s.add(n);let d=0;for(const m of t.get(n)??[])d=Math.max(d,r(m)+1);return s.delete(n),a.set(n,d),d};for(const n of o)r(n);return a},Be=(o,e,t)=>{const a=He(o,e),s=new Map;for(const m of o){const c=a.get(m)??0,p=s.get(c);p===void 0?s.set(c,[m]):p.push(m)}const r=o.reduce((m,c)=>m+z(t.get(c)??0)+I,0),n=Re(r),l=[];let d=0;for(const m of[...s.keys()].toSorted((c,p)=>c-p)){let c=0,p=w;for(const u of s.get(m)??[]){const b=z(t.get(u)??0);p>w&&p+b>n&&(c+=1,p=w),l.push({name:u,x:w+(d+c)*(W+q),y:p}),p+=b+I}d+=c+1}return l},Ge={databaseSchema:_e},J={backgroundColor:N.shard.color},V={backgroundColor:N.global.color},je={global:!0,shard:!0},Fe={},Ie=o=>{const e=o.find(t=>t.pk===!0)?.name;return e!==void 0?e:o.some(t=>t.name==="_id")?"_id":o.some(t=>t.name==="id")?"id":o[0]?.name??"_id"},Y=o=>o.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),ze=(o,e,t)=>{const a=o.map(l=>l.name),s=new Map(o.map(l=>[l.name,l.columns.length])),r=Be(a,Y(o),s),n=new Map(o.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const c=n.get(l);return c===void 0?[]:[{className:t[l],data:{columns:c.columns,label:l,loadError:e,tier:c.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Ue=o=>{const e=new Map(o.map(t=>[t.name,t.columns]));return Y(o).flatMap(t=>{const a=e.get(t.to)??[],s=e.get(t.from)??[],r=Ie(a);return!a.some(n=>n.name===r)||!s.some(n=>n.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ke=()=>{const o=v(15),e=T();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),o[0]=t):t=o[0];let a;o[1]===Symbol.for("react.memo_cache_sentinel")?(a=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]}),o[1]=a):a=o[1];let s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),o[2]=s):s=o[2];let r;o[3]!==e?(r=e("Primary key"),o[3]=e,o[4]=r):r=o[4];let n;o[5]!==r?(n=f("span",{className:"flex items-center gap-1",children:[s,r]}),o[5]=r,o[6]=n):n=o[6];let l;o[7]===Symbol.for("react.memo_cache_sentinel")?(l=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),o[7]=l):l=o[7];let d;o[8]!==e?(d=e("Foreign key"),o[8]=e,o[9]=d):d=o[9];let m;o[10]!==d?(m=f("span",{className:"flex items-center gap-1",children:[l,d]}),o[10]=d,o[11]=m):m=o[11];let c;return o[12]!==n||o[13]!==m?(c=f("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,a,n,m]}),o[12]=n,o[13]=m,o[14]=c):c=o[14],c},Pe=12,We=o=>{const e=v(9),{containerRef:t,seedKey:a}=o,s=fe(),{fitView:r}=U();let n;e[0]!==t||e[1]!==r||e[2]!==s?(n=()=>{if(!s)return;const d=()=>{L(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const c=new ResizeObserver(()=>{d()});return c.observe(m),()=>{c.disconnect()}},e[0]=t,e[1]=r,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==s||e[7]!==a?(l=[t,r,s,a],e[4]=t,e[5]=r,e[6]=s,e[7]=a,e[8]=l):l=e[8],D(n,l),null},qe=({containerRef:o,testIdPrefix:e})=>{const t=T(),a=ue(),{getEdges:s}=U(),[r,n]=k(null),l=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("png");try{await Me(u,a,`${e}-schema-diagram.png`)}finally{n(null)}}},d=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("svg");try{await ke(u,a,`${e}-schema-diagram.svg`)}finally{n(null)}}},m=()=>{n("json");try{Ce(a,s(),`${e}-schema-diagram.json`)}finally{n(null)}},c=()=>{L(l())},p=()=>{L(d())};return i(M,{position:"top-right",children:f(be,{children:[f(xe,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${e}-export-trigger`,disabled:r!==null,children:[i(se,{className:"size-3.5",icon:ne,strokeWidth:2}),t("Export")]}),f(Ne,{align:"end",children:[i(C,{"data-testid":`${e}-export-png`,disabled:r!==null,onClick:c,children:t("PNG")}),i(C,{"data-testid":`${e}-export-svg`,disabled:r!==null,onClick:p,children:t("SVG")}),i(C,{"data-testid":`${e}-export-json`,disabled:r!==null,onClick:m,children:t("JSON")})]})]})})},dt=({columnsError:o,fill:e=!1,nodeClasses:t,tables:a,testIdPrefix:s})=>{const r=T(),[n,l]=k(je),[d,m]=k(""),c=_(()=>{const h=d.trim().toLowerCase();return a.filter(H=>n[H.tier]&&H.name.toLowerCase().includes(h))},[a,n,d]),p=_(()=>ze(c,o??!1,t??Fe),[c,o,t]),u=_(()=>Ue(c),[c]),b=c.map(h=>h.name).join(","),[g,A,Q]=le(p),[Z,O,X]=ie(u),$=ge(null);D(()=>{A(p)},[p,A]),D(()=>{O(u)},[u,O]);const ee=h=>{m(h.target.value)},te=()=>{l(h=>({...h,shard:!h.shard}))},oe=()=>{l(h=>({...h,global:!h.global}))};return a.length===0?i("section",{className:"flex flex-col gap-2","data-testid":`${s}-section`,children:i("p",{className:"text-sm text-muted-foreground","data-testid":`${s}-empty`,children:r("No tables to graph.")})}):i("section",{className:y("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${s}-section`,children:i("div",{className:y("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${s}-canvas`,ref:$,children:f(ce,{edges:Z,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:g,nodesConnectable:!1,nodeTypes:Ge,onEdgesChange:X,onNodesChange:Q,children:[i(de,{}),i(M,{position:"top-left",children:f("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[i(ye,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${s}-find`,onChange:ee,placeholder:r("Find table…"),value:d}),f("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[f(j,{"aria-pressed":n.shard,className:"gap-1.5","data-testid":`${s}-tier-shard`,onClick:te,size:"xs",type:"button",variant:n.shard?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),f(j,{"aria-pressed":n.global,className:"gap-1.5","data-testid":`${s}-tier-global`,onClick:oe,size:"xs",type:"button",variant:n.global?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]})]})]})}),i(M,{position:"bottom-center",children:i(Ke,{})}),i(me,{showInteractive:!1}),c.length>Pe&&i(pe,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),i(qe,{containerRef:$,testIdPrefix:s}),i(We,{containerRef:$,seedKey:b})]})})})};export{dt as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as T}from"react/compiler-runtime";import{AreaChart as R,CartesianGrid as g,XAxis as N,Area as B,LineChart as X,Line as $}from"recharts";import{useT as S}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{k as E}from"./internal-Df43vQI0.mjs";import{E as H,X as _,B as j,T as G,C as O,a as A,b as K}from"./bar-chart-BCsEIQoQ.mjs";import{jsx as l,jsxs as k}from"react/jsx-runtime";import{c as V,a as z,b as L,e as F,d as I,T as M}from"./table-D0SBiDu-.mjs";import{C as U}from"./data-grid-DIiNmDR9.mjs";const W=50,q={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},D=o=>{const e=o.columns.find(n=>o.rows.length>0&&o.rows.every(a=>typeof a[n]=="number"))??null;return{label:o.columns.find(n=>n!==e)??null,value:e}},J=o=>{const e=T(3),{data:t,kind:n}=o;let a;return e[0]!==t||e[1]!==n?(a=l(O,{className:"h-full w-full",config:q,children:n==="area"?k(R,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l(B,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):k(X,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l($,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),e[0]=t,e[1]=n,e[2]=a):a=e[2],a},oe=o=>{const e=T(21),{axes:t,kind:n,result:a}=o,u=S();let r;e[0]!==a?(r=D(a),e[0]=a,e[1]=r):r=e[1];const d=r;let m;e[2]!==a.columns?(m=new Set(a.columns),e[2]=a.columns,e[3]=m):m=e[3];const s=m,i=t!==void 0&&s.has(t.x)?t.x:d.label;let h;e[4]!==t?.y||e[5]!==s?(h=t?.y.find(c=>s.has(c)),e[4]=t?.y,e[5]=s,e[6]=h):h=e[6];const b=h,C=b??d.value;let w;e[7]!==i||e[8]!==a.rows||e[9]!==C?(w=C===null?[]:a.rows.slice(0,W).map((c,v)=>({label:i===null?`#${(v+1).toString()}`:E(c[i]),value:Number(c[C])||0})),e[7]=i,e[8]=a.rows,e[9]=C,e[10]=w):w=e[10];const x=w;if(C===null){let c;e[11]!==u?(c=u("No numeric column to chart."),e[11]=u,e[12]=c):c=e[12];let v;return e[13]!==c?(v=l("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:c}),e[13]=c,e[14]=v):v=e[14],v}const f=n??(t!==void 0&&b!==void 0?t.kind:"bar");let p;e[15]!==x||e[16]!==f?(p=f==="bar"?k(H,{className:"h-full w-full",config:q,data:x,children:[l(_,{dataKey:"label"}),l(j,{dataKey:"value"}),l(G,{})]}):l(J,{data:x,kind:f}),e[15]=x,e[16]=f,e[17]=p):p=e[17];let y;return e[18]!==f||e[19]!==p?(y=l("div",{className:"h-80 w-full p-3","data-chart-kind":f,"data-testid":"sql-chart",children:p}),e[18]=f,e[19]=p,e[20]=y):y=e[20],y},ne=o=>{const e=T(19),{result:t}=o,n=S();if(t.columns.length===0){let s;e[0]!==t.rowCount||e[1]!==n?(s=n("{count} rows",{count:t.rowCount}),e[0]=t.rowCount,e[1]=n,e[2]=s):s=e[2];let i;return e[3]!==s?(i=l("p",{className:"p-4 text-sm text-muted-foreground",children:s}),e[3]=s,e[4]=i):i=e[4],i}let a;e[5]!==t.columns?(a=t.columns.map(P),e[5]=t.columns,e[6]=a):a=e[6];let u;e[7]!==a?(u=l(z,{className:"sticky top-0 z-10 bg-muted",children:l(L,{children:a})}),e[7]=a,e[8]=u):u=e[8];let r;if(e[9]!==t.columns||e[10]!==t.rows){let s;e[12]!==t.columns?(s=(i,h)=>l(L,{"data-testid":"sql-row",children:t.columns.map(b=>l(F,{className:"max-w-md truncate font-mono text-xs",children:l(U,{value:i[b]})},b))},h),e[12]=t.columns,e[13]=s):s=e[13],r=t.rows.map(s),e[9]=t.columns,e[10]=t.rows,e[11]=r}else r=e[11];let d;e[14]!==r?(d=l(I,{children:r}),e[14]=r,e[15]=d):d=e[15];let m;return e[16]!==u||e[17]!==d?(m=k(M,{"data-testid":"sql-rows",children:[u,d]}),e[16]=u,e[17]=d,e[18]=m):m=e[18],m};function P(o){return l(V,{children:o},o)}export{oe as S,ne as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as N}from"react/compiler-runtime";import{createRootRoute as as,createRoute as _t,createBrowserHistory as os,createMemoryHistory as ns,createRouter as rs,useNavigate as Et,useSearch as is,RouterProvider as ls,useRouterState as ds,Outlet as cs}from"@tanstack/react-router";import*as it from"react";import{use as St,createContext as $t,useState as ct,useEffect as lt,useSyncExternalStore as us,lazy as A,Suspense as fs}from"react";import{c as _}from"./utils-bhneXptQ.mjs";import{jsx as n,jsxs as w,Fragment as Ht}from"react/jsx-runtime";import{ErrorBoundary as ms}from"./ErrorBoundary-BWNF98VF.mjs";import{O as hs,u as ps}from"./operation-console-provider-DoloEvon.mjs";import{useT as te}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{LunoraError as Bt}from"@lunora/errors";import{B as ut}from"./badge-r_5B4LHP.mjs";import{I as Vt}from"./input-CXhxesPC.mjs";import{Popover as dt}from"@base-ui/react/popover";import{Cancel01Icon as gs,SidebarLeftIcon as bs}from"@hugeicons/core-free-icons";import{HugeiconsIcon as zt}from"@hugeicons/react";import{mergeProps as Dt}from"@base-ui/react/merge-props";import{useRender as Ot}from"@base-ui/react/use-render";import{cva as vs}from"class-variance-authority";import{B as Zt}from"./button-q0UYSmrn.mjs";import{Dialog as oe}from"@base-ui/react/dialog";import{Tooltip as ae}from"@base-ui/react/tooltip";import{S as yt}from"./skeleton-DX1gfixl.mjs";import{H as xs,u as ys}from"./home-panel-DBSHjxil.mjs";import{g as ws,f as Nt}from"./internal-Df43vQI0.mjs";import{o as pt}from"./use-admin-query-tlBof8Yg.mjs";import{StudioI18nProvider as ks}from"./StudioI18nProvider-fVsCSs5L.mjs";import{v as Ns,a as Ms}from"./data-view-params-DhYmAkcj.mjs";import{CommandPalette as Ss,openCommandPalette as Cs}from"./CommandPalette-D9ZY-qQd.mjs";import{motion as Ps}from"motion/react";import{E as _s}from"./empty-state-D7jEML_T.mjs";import{u as Ts}from"./shortcuts-B9gDaXmw.mjs";const Ft="(prefers-color-scheme: dark)",qt=()=>{try{return globalThis.localStorage}catch{return}},Ls=t=>t==="system"||t==="light"||t==="dark",Wt=()=>globalThis.matchMedia,jt="lunora-studio-theme",wt=["system","light","dark"],As=(t="system")=>{try{const e=qt()?.getItem(jt);return Ls(e)?e:t}catch{return t}},Tt=t=>{const e=qt();if(e!==void 0)try{e.setItem(jt,t)}catch{}},Is=()=>{try{return Wt()?.(Ft).matches?"dark":"light"}catch{return"light"}},Rs=(t,e)=>t==="system"?e:t,Es=t=>{let e;try{e=Wt()?.(Ft)}catch{e=void 0}if(e===void 0)return()=>{};const s=a=>{t(a.matches?"dark":"light")};return e.addEventListener("change",s),()=>{e.removeEventListener("change",s)}},Ct=$t(null),$s=({children:t,defaultTheme:e="system"})=>{const[s,a]=ct(()=>As(e)),[o,r]=ct(()=>Is());lt(()=>Es(r),[]);const i=u=>{Tt(u),a(u)},d={cycleTheme:()=>{a(u=>{const c=wt[(wt.indexOf(u)+1)%wt.length]??u;return Tt(c),c})},resolvedTheme:Rs(s,o),setTheme:i,systemTheme:o,theme:s};return n(Ct,{value:d,children:t})},Hs=t=>{const e=N(3),{children:s}=t,a=St(Ct);let o;return e[0]!==s||e[1]!==a?(o=a===null?n($s,{children:s}):s,e[0]=s,e[1]=a,e[2]=o):o=e[2],o},Bs=()=>{const t=St(Ct);if(t===null)throw new Bt("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function Pn({delay:t=0,...e}){return n(ae.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function Vs(t){const e=N(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(ae.Root,{"data-slot":"tooltip",...s}),e[2]=s,e[3]=a):a=e[3],a}function zs(t){const e=N(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(ae.Trigger,{"data-slot":"tooltip-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ds({className:t,side:e="top",sideOffset:s=4,align:a="center",alignOffset:o=0,children:r,...i}){return n(ae.Portal,{children:n(ae.Positioner,{align:a,alignOffset:o,side:e,sideOffset:s,className:"isolate z-50",children:w(ae.Popup,{"data-slot":"tooltip-content",className:_("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:[r,n(ae.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 Os=t=>{const e=N(5),{className:s}=t;let a;e[0]!==s?(a=_("h-full w-full text-foreground",s),e[0]=s,e[1]=a):a=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=n("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]=o):o=e[2];let r;return e[3]!==a?(r=n("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 543 446",children:o}),e[3]=a,e[4]=r):r=e[4],r},Gt="lunora.studio.rulesBannerDismissed",Zs=()=>{try{return globalThis.localStorage.getItem(Gt)==="1"}catch{return!1}},Fs=()=>{try{globalThis.localStorage.setItem(Gt,"1")}catch{}},qs=()=>{const t=N(18),e=te(),[s,a]=ct(Ws);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{a(!0),Fs()},t[0]=o):o=t[0];const r=o;if(s)return null;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n("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=n("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=w("span",{children:[l," ",d," ",u]}),t[7]=l,t[8]=u,t[9]=c):c=t[9];let m;t[10]!==e?(m=e("Dismiss"),t[10]=e,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=n("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:n("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=h):h=t[12];let f;t[13]!==m?(f=n("button",{"aria-label":m,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:r,type:"button",children:h}),t[13]=m,t[14]=f):f=t[14];let g;return t[15]!==c||t[16]!==f?(g=w("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,f]}),t[15]=c,t[16]=f,t[17]=g):g=t[17],g};function Ws(){return Zs()}function Ut(t){const e=N(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(dt.Root,{"data-slot":"popover",...s}),e[2]=s,e[3]=a):a=e[3],a}function Kt(t){const e=N(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(dt.Trigger,{"data-slot":"popover-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Qt({align:t="end",alignOffset:e=0,className:s,keepMounted:a=!1,side:o="bottom",sideOffset:r=6,...i}){return n(dt.Portal,{keepMounted:a,children:n(dt.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:o,sideOffset:r,children:n(dt.Popup,{className:_("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",s),"data-slot":"popover-content",...i})})})}const kt=768;function js(){const t=N(2),[e,s]=ct(void 0);let a,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const r=globalThis.matchMedia(`(max-width: ${kt-1}px)`),i=()=>{s(globalThis.innerWidth<kt)};return r.addEventListener("change",i),s(globalThis.innerWidth<kt),()=>{r.removeEventListener("change",i)}},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),lt(a,o),!!e}function Gs(t){const e=N(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(oe.Root,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function Us(t){const e=N(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(oe.Portal,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ks(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("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:",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n(oe.Backdrop,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function Qs({className:t,children:e,side:s="right",showCloseButton:a=!0,...o}){return w(Us,{children:[n(Ks,{}),w(oe.Popup,{"data-slot":"sheet-content","data-side":s,className:_("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),...o,children:[e,a&&w(oe.Close,{"data-slot":"sheet-close",render:n(Zt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[n(zt,{icon:gs,strokeWidth:2}),n("span",{className:"sr-only",children:"Close"})]})]})]})}function Ys(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex flex-col gap-0.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function Js(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("text-sm font-medium text-foreground",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n(oe.Title,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function Xs(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("text-xs/relaxed text-muted-foreground",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n(oe.Description,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}const ea="sidebar_state",ta=3600*24*7,sa="16rem",aa="18rem",oa="3rem",na="b",Yt=it.createContext(null);function gt(){const t=it.useContext(Yt);if(!t)throw new Bt("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function ra({defaultOpen:t=!0,open:e,onOpenChange:s,className:a,style:o,children:r,...i}){const l=js(),[d,u]=it.useState(!1),[c,m]=it.useState(t),h=e??c,f=p=>{const x=typeof p=="function"?p(h):p;s?s(x):m(x),document.cookie=`${ea}=${x}; path=/; max-age=${ta}`},g=()=>l?u(p=>!p):f(p=>!p),v=it.useEffectEvent(()=>{g()});it.useEffect(()=>{const p=x=>{x.key===na&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),v())};return globalThis.addEventListener("keydown",p),()=>globalThis.removeEventListener("keydown",p)},[]);const b={state:h?"expanded":"collapsed",open:h,setOpen:f,isMobile:l,openMobile:d,setOpenMobile:u,toggleSidebar:g};return n(Yt.Provider,{value:b,children:n("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":sa,"--sidebar-width-icon":oa,...o},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...i,children:r})})}function ia({side:t="left",variant:e="sidebar",collapsible:s="offcanvas",className:a,children:o,dir:r,...i}){const{isMobile:l,state:d,openMobile:u,setOpenMobile:c}=gt();return s==="none"?n("div",{"data-slot":"sidebar",className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...i,children:o}):l?n(Gs,{open:u,onOpenChange:c,...i,children:w(Qs,{dir:r,"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":aa},side:t,children:[w(Ys,{className:"sr-only",children:[n(Js,{children:"Sidebar"}),n(Xs,{children:"Displays the mobile sidebar."})]}),n("div",{className:"flex h-full w-full flex-col",children:o})]})}):w("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?s:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[n("div",{"data-slot":"sidebar-gap",className:_("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)")}),n("div",{"data-slot":"sidebar-container","data-side":t,className:_("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",a),...i,children:n("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:o})})]})}function la(t){const e=N(15);let s,a,o;e[0]!==t?({className:s,onClick:a,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);const{toggleSidebar:r}=gt();let i;e[4]!==s?(i=_(s),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==a||e[7]!==r?(l=m=>{a?.(m),r()},e[6]=a,e[7]=r,e[8]=l):l=e[8];let d,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=n(zt,{icon:bs,strokeWidth:2,className:"rtl:rotate-180"}),u=n("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=d,e[10]=u):(d=e[9],u=e[10]);let c;return e[11]!==o||e[12]!==i||e[13]!==l?(c=w(Zt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:i,onClick:l,...o,children:[d,u]}),e[11]=o,e[12]=i,e[13]=l,e[14]=c):c=e[14],c}function da(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("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",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ca(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ua(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function fa(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("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",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ma(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("relative flex w-full min-w-0 flex-col p-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ha(t){const e=N(10);let s,a,o,r;if(e[0]!==t){const{className:d,render:u,...c}=t;s=u,r=Ot,a="div",o=Dt({className:_("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]=s,e[2]=a,e[3]=o,e[4]=r}else s=e[1],a=e[2],o=e[3],r=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]!==s||e[7]!==a||e[8]!==o?(l={defaultTagName:a,props:o,render:s,state:i},e[6]=s,e[7]=a,e[8]=o,e[9]=l):l=e[9],r(l)}function pa(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("w-full text-xs",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function Lt(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex w-full min-w-0 flex-col gap-0",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function At(t){const e=N(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}const ga=vs("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 Jt({render:t,isActive:e=!1,variant:s="default",size:a="default",tooltip:o,className:r,...i}){const{isMobile:l,state:d}=gt(),u=Ot({defaultTagName:"button",props:Dt({className:_(ga({variant:s,size:a}),r)},i),render:o?n(zs,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:e}});return o?(typeof o=="string"&&(o={children:o}),w(Vs,{children:[u,n(Ds,{side:"right",align:"center",hidden:d!=="collapsed"||l,...o})]})):u}const ba=t=>t.replace("__lunora_admin__:",""),va=()=>us(pt.subscribe,pt.getSnapshot,pt.getSnapshot),xa=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",ya=t=>{const e=N(56),{entry:s,focused:a}=t,o=te();let r;e[0]!==a?(r=O=>{O!==null&&a&&O.scrollIntoView({block:"nearest"})},e[0]=a,e[1]=r):r=e[1];const i=r;let l;e[2]!==s.functionPath||e[3]!==s.shardKey||e[4]!==s.summary?(l=()=>{ws(`${s.functionPath} ${s.summary}${s.shardKey===""?"":` (shard ${s.shardKey})`}`)},e[2]=s.functionPath,e[3]=s.shardKey,e[4]=s.summary,e[5]=l):l=e[5];const d=l,u=a&&"bg-accent ring-1 ring-inset ring-primary/40";let c;e[6]!==u?(c=_("border-b border-border/60 last:border-b-0",u),e[6]=u,e[7]=c):c=e[7];let m;e[8]!==s.status?(m=xa(s.status),e[8]=s.status,e[9]=m):m=e[9];const h=s.status==="pending"?"…":s.status;let f;e[10]!==m||e[11]!==h?(f=n(ut,{className:"mt-px shrink-0",variant:m,children:h}),e[10]=m,e[11]=h,e[12]=f):f=e[12];let g;e[13]!==s.functionPath?(g=ba(s.functionPath),e[13]=s.functionPath,e[14]=g):g=e[14];let v;e[15]!==g?(v=n("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:g}),e[15]=g,e[16]=v):v=e[16];let y;e[17]!==s.kind||e[18]!==o?(y=s.kind==="subscription"&&n(ut,{className:"shrink-0",variant:"outline",children:o("live")}),e[17]=s.kind,e[18]=o,e[19]=y):y=e[19];let b;e[20]!==s.summary?(b=s.summary!==""&&n("span",{className:"min-w-0 truncate text-muted-foreground",children:s.summary}),e[20]=s.summary,e[21]=b):b=e[21];let p;e[22]!==s.shardKey?(p=s.shardKey!==""&&n("span",{className:"font-mono",children:s.shardKey}),e[22]=s.shardKey,e[23]=p):p=e[23];let x;e[24]!==s.resultCount||e[25]!==o?(x=s.resultCount!==void 0&&n("span",{children:o("{count} rows",{count:s.resultCount})}),e[24]=s.resultCount,e[25]=o,e[26]=x):x=e[26];let k;e[27]!==s.pushes||e[28]!==o?(k=s.pushes!==void 0&&s.pushes>0&&n("span",{children:o("{count} pushes",{count:s.pushes})}),e[27]=s.pushes,e[28]=o,e[29]=k):k=e[29];let P;e[30]!==s.durationMs?(P=s.durationMs!==void 0&&w("span",{children:[s.durationMs,"ms"]}),e[30]=s.durationMs,e[31]=P):P=e[31];let C;e[32]!==o?(C=o("Copy"),e[32]=o,e[33]=C):C=e[33];let S;e[34]!==d||e[35]!==C?(S=n("button",{"aria-label":C,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]=C,e[36]=S):S=e[36];let M;e[37]!==p||e[38]!==x||e[39]!==k||e[40]!==P||e[41]!==S?(M=w("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[p,x,k,P,S]}),e[37]=p,e[38]=x,e[39]=k,e[40]=P,e[41]=S,e[42]=M):M=e[42];let T;e[43]!==y||e[44]!==b||e[45]!==M||e[46]!==f||e[47]!==v?(T=w("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[f,v,y,b,M]}),e[43]=y,e[44]=b,e[45]=M,e[46]=f,e[47]=v,e[48]=T):T=e[48];let L;e[49]!==s.error?(L=s.error!==void 0&&n("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:s.error}),e[49]=s.error,e[50]=L):L=e[50];let I;return e[51]!==i||e[52]!==T||e[53]!==L||e[54]!==c?(I=w("li",{className:c,"data-testid":"oc-row",ref:i,children:[T,L]}),e[51]=i,e[52]=T,e[53]=L,e[54]=c,e[55]=I):I=e[55],I},wa=t=>{const e=N(62),{focusSeq:s,onClose:a,onShownChange:o,shown:r}=t,i=te(),l=va(),[d,u]=ct("");let c;if(e[0]!==l||e[1]!==s||e[2]!==d||e[3]!==a||e[4]!==o||e[5]!==r||e[6]!==i){const m=d.trim().toLowerCase(),h=l.filter(E=>(r==="errors"?E.status==="error":!0)&&(m===""||`${E.functionPath} ${E.summary} ${E.shardKey}`.toLowerCase().includes(m))).toReversed();let f;e[8]!==l?(f=l.filter(ka),e[8]=l,e[9]=f):f=e[9];const g=f.length;let v;e[10]!==i?(v=i("Operation console"),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==i?(y=i("Operation console"),e[12]=i,e[13]=y):y=e[13];let b;e[14]!==y?(b=n("span",{className:"text-xs font-medium",children:y}),e[14]=y,e[15]=b):b=e[15];let p;e[16]!==l.length||e[17]!==i?(p=i("{count} calls",{count:l.length}),e[16]=l.length,e[17]=i,e[18]=p):p=e[18];let x;e[19]!==p?(x=n(ut,{variant:"secondary",children:p}),e[19]=p,e[20]=x):x=e[20];let k;e[21]!==g||e[22]!==i?(k=g>0&&n(ut,{variant:"destructive",children:i("{count} failed",{count:g})}),e[21]=g,e[22]=i,e[23]=k):k=e[23];const P=r==="errors",C=r==="errors"&&"bg-accent";let S;e[24]!==C?(S=_("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",C),e[24]=C,e[25]=S):S=e[25];let M;e[26]!==o||e[27]!==r?(M=()=>{o(r==="errors"?"all":"errors")},e[26]=o,e[27]=r,e[28]=M):M=e[28];let T;e[29]!==i?(T=i("Errors"),e[29]=i,e[30]=T):T=e[30];let L;e[31]!==S||e[32]!==M||e[33]!==T||e[34]!==P?(L=n("button",{"aria-pressed":P,className:S,"data-testid":"oc-filter-errors",onClick:M,type:"button",children:T}),e[31]=S,e[32]=M,e[33]=T,e[34]=P,e[35]=L):L=e[35];let I;e[36]!==i?(I=i("Filter"),e[36]=i,e[37]=I):I=e[37];let O;e[38]===Symbol.for("react.memo_cache_sentinel")?(O=E=>{u(E.target.value)},e[38]=O):O=e[38];let B;e[39]!==i?(B=i("Filter"),e[39]=i,e[40]=B):B=e[40];let V;e[41]!==d||e[42]!==I||e[43]!==B?(V=n(Vt,{"aria-label":I,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:O,placeholder:B,value:d}),e[41]=d,e[42]=I,e[43]=B,e[44]=V):V=e[44];let z;e[45]!==i?(z=i("Clear"),e[45]=i,e[46]=z):z=e[46];let $;e[47]!==z?($=n("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:Na,type:"button",children:z}),e[47]=z,e[48]=$):$=e[48];let H;e[49]!==i?(H=i("Hide"),e[49]=i,e[50]=H):H=e[50];let D;e[51]!==a||e[52]!==H?(D=n("button",{"aria-label":H,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:a,type:"button",children:"✕"}),e[51]=a,e[52]=H,e[53]=D):D=e[53];let Z;e[54]!==L||e[55]!==V||e[56]!==$||e[57]!==D||e[58]!==b||e[59]!==x||e[60]!==k?(Z=w("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[b,x,k,L,V,$,D]}),e[54]=L,e[55]=V,e[56]=$,e[57]=D,e[58]=b,e[59]=x,e[60]=k,e[61]=Z):Z=e[61],c=w("section",{"aria-label":v,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[Z,h.length===0?n("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:i("Every admin call this studio makes is recorded here.")}):n("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:h.map(E=>n(ya,{entry:E,focused:E.seq===s},E.seq))})]}),e[0]=l,e[1]=s,e[2]=d,e[3]=a,e[4]=o,e[5]=r,e[6]=i,e[7]=c}else c=e[7];return c};function ka(t){return t.status==="error"}function Na(){pt.clear()}const Ma=()=>{const t=N(316),e=te();let s;t[0]!==e?(s=e("Health score"),t[0]=e,t[1]=s):s=t[1];let a;t[2]!==e?(a=e("Agents"),t[2]=e,t[3]=a):a=t[3];let o;t[4]!==e?(o=e("Evals"),t[4]=e,t[5]=o):o=t[5];let r;t[6]!==e?(r=e("Analytics"),t[6]=e,t[7]=r):r=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 m;t[18]!==e?(m=e("Containers"),t[18]=e,t[19]=m):m=t[19];let h;t[20]!==e?(h=e("Dashboards"),t[20]=e,t[21]=h):h=t[21];let f;t[22]!==e?(f=e("Data"),t[22]=e,t[23]=f):f=t[23];let g;t[24]!==e?(g=e("Deployment health"),t[24]=e,t[25]=g):g=t[25];let v;t[26]!==e?(v=e("Log drains"),t[26]=e,t[27]=v):v=t[27];let y;t[28]!==e?(y=e("Export / Import"),t[28]=e,t[29]=y):y=t[29];let b;t[30]!==e?(b=e("Fan-out"),t[30]=e,t[31]=b):b=t[31];let p;t[32]!==e?(p=e("Files"),t[32]=e,t[33]=p):p=t[33];let x;t[34]!==e?(x=e("Flags"),t[34]=e,t[35]=x):x=t[35];let k;t[36]!==e?(k=e("Functions"),t[36]=e,t[37]=k):k=t[37];let P;t[38]!==e?(P=e("Health"),t[38]=e,t[39]=P):P=t[39];let C;t[40]!==e?(C=e("Home"),t[40]=e,t[41]=C):C=t[41];let S;t[42]!==e?(S=e("Performance"),t[42]=e,t[43]=S):S=t[43];let M;t[44]!==e?(M=e("Issues"),t[44]=e,t[45]=M):M=t[45];let T;t[46]!==e?(T=e("KV"),t[46]=e,t[47]=T):T=t[47];let L;t[48]!==e?(L=e("Logs"),t[48]=e,t[49]=L):L=t[49];let I;t[50]!==e?(I=e("Metrics"),t[50]=e,t[51]=I):I=t[51];let O;t[52]!==e?(O=e("Migrations"),t[52]=e,t[53]=O):O=t[53];let B;t[54]!==e?(B=e("Notifications"),t[54]=e,t[55]=B):B=t[55];let V;t[56]!==e?(V=e("Organizations"),t[56]=e,t[57]=V):V=t[57];let z;t[58]!==e?(z=e("Time Travel"),t[58]=e,t[59]=z):z=t[59];let $;t[60]!==e?($=e("Mail"),t[60]=e,t[61]=$):$=t[61];let H;t[62]!==e?(H=e("Payments"),t[62]=e,t[63]=H):H=t[63];let D;t[64]!==e?(D=e("Permissions"),t[64]=e,t[65]=D):D=t[65];let Z;t[66]!==e?(Z=e("Queues"),t[66]=e,t[67]=Z):Z=t[67];let E;t[68]!==e?(E=e("Reactors"),t[68]=e,t[69]=E):E=t[69];let F;t[70]!==e?(F=e("Realtime"),t[70]=e,t[71]=F):F=t[71];let X;t[72]!==e?(X=e("RLS Policies"),t[72]=e,t[73]=X):X=t[73];let q;t[74]!==e?(q=e("Scheduled"),t[74]=e,t[75]=q):q=t[75];let Y;t[76]!==e?(Y=e("Schema"),t[76]=e,t[77]=Y):Y=t[77];let ee;t[78]!==e?(ee=e("Security"),t[78]=e,t[79]=ee):ee=t[79];let W;t[80]!==e?(W=e("Settings"),t[80]=e,t[81]=W):W=t[81];let j;t[82]!==e?(j=e("SQL editor"),t[82]=e,t[83]=j):j=t[83];let G;t[84]!==e?(G=e("Traces"),t[84]=e,t[85]=G):G=t[85];let U;t[86]!==e?(U=e("Access Rules"),t[86]=e,t[87]=U):U=t[87];let K;t[88]!==e?(K=e("Users"),t[88]=e,t[89]=K):K=t[89];let J;t[90]!==e?(J=e("Vectors"),t[90]=e,t[91]=J):J=t[91];let Q;t[92]!==e?(Q=e("Workflows"),t[92]=e,t[93]=Q):Q=t[93];let se;t[94]!==s||t[95]!==a||t[96]!==h||t[97]!==f||t[98]!==g||t[99]!==v||t[100]!==y||t[101]!==b||t[102]!==p||t[103]!==x||t[104]!==k||t[105]!==P||t[106]!==o||t[107]!==C||t[108]!==S||t[109]!==M||t[110]!==T||t[111]!==L||t[112]!==I||t[113]!==O||t[114]!==B||t[115]!==V||t[116]!==z||t[117]!==r||t[118]!==$||t[119]!==H||t[120]!==D||t[121]!==Z||t[122]!==E||t[123]!==F||t[124]!==X||t[125]!==q||t[126]!==Y||t[127]!==ee||t[128]!==i||t[129]!==W||t[130]!==j||t[131]!==G||t[132]!==U||t[133]!==K||t[134]!==J||t[135]!==Q||t[136]!==l||t[137]!==d||t[138]!==u||t[139]!==c||t[140]!==m?(se={advisorHealth:s,agents:a,evals:o,analytics:r,api:i,audit:l,authAudit:d,authConfig:u,authSessions:c,containers:m,dashboards:h,data:f,deploymentHealth:g,drains:v,export:y,fanout:b,files:p,flags:x,functions:k,health:P,home:C,insights:S,issues:M,kv:T,logs:L,metrics:I,migrations:O,notifications:B,organizations:V,pitr:z,mail:$,payments:H,permissions:D,queues:Z,reactors:E,realtime:F,rls:X,schedule:q,schema:Y,security:ee,settings:W,sql:j,traces:G,storageRules:U,users:K,vectors:J,workflows:Q},t[94]=s,t[95]=a,t[96]=h,t[97]=f,t[98]=g,t[99]=v,t[100]=y,t[101]=b,t[102]=p,t[103]=x,t[104]=k,t[105]=P,t[106]=o,t[107]=C,t[108]=S,t[109]=M,t[110]=T,t[111]=L,t[112]=I,t[113]=O,t[114]=B,t[115]=V,t[116]=z,t[117]=r,t[118]=$,t[119]=H,t[120]=D,t[121]=Z,t[122]=E,t[123]=F,t[124]=X,t[125]=q,t[126]=Y,t[127]=ee,t[128]=i,t[129]=W,t[130]=j,t[131]=G,t[132]=U,t[133]=K,t[134]=J,t[135]=Q,t[136]=l,t[137]=d,t[138]=u,t[139]=c,t[140]=m,t[141]=se):se=t[141];const bt=se;let ne;t[142]!==e?(ne=e("Advisors"),t[142]=e,t[143]=ne):ne=t[143];let re;t[144]!==e?(re=e("Auth"),t[144]=e,t[145]=re):re=t[145];let ie;t[146]!==e?(ie=e("Database"),t[146]=e,t[147]=ie):ie=t[147];let le;t[148]!==e?(le=e("Functions"),t[148]=e,t[149]=le):le=t[149];let de;t[150]!==e?(de=e("Observability"),t[150]=e,t[151]=de):de=t[151];let ce;t[152]!==e?(ce=e("Operations"),t[152]=e,t[153]=ce):ce=t[153];let ue;t[154]!==e?(ue=e("Overview"),t[154]=e,t[155]=ue):ue=t[155];let fe;t[156]!==e?(fe=e("Settings"),t[156]=e,t[157]=fe):fe=t[157];let me;t[158]!==e?(me=e("Storage"),t[158]=e,t[159]=me):me=t[159];let ft;t[160]!==ne||t[161]!==re||t[162]!==ie||t[163]!==le||t[164]!==de||t[165]!==ce||t[166]!==ue||t[167]!==fe||t[168]!==me?(ft={advisors:ne,auth:re,database:ie,functions:le,observability:de,operations:ce,overview:ue,settings:fe,storage:me},t[160]=ne,t[161]=re,t[162]=ie,t[163]=le,t[164]=de,t[165]=ce,t[166]=ue,t[167]=fe,t[168]=me,t[169]=ft):ft=t[169];const vt=ft;let he;t[170]!==e?(he=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[170]=e,t[171]=he):he=t[171];let pe;t[172]!==e?(pe=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[172]=e,t[173]=pe):pe=t[173];let ge;t[174]!==e?(ge=e("Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it."),t[174]=e,t[175]=ge):ge=t[175];let be;t[176]!==e?(be=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[176]=e,t[177]=be):be=t[177];let ve;t[178]!==e?(ve=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[178]=e,t[179]=ve):ve=t[179];let xe;t[180]!==e?(xe=e("A durable log of admin state-changing operations."),t[180]=e,t[181]=xe):xe=t[181];let ye;t[182]!==e?(ye=e("Authentication and security events — sign-ins, MFA, and session changes."),t[182]=e,t[183]=ye):ye=t[183];let we;t[184]!==e?(we=e("Enabled plugins and session config (read-only)."),t[184]=e,t[185]=we):we=t[185];let ke;t[186]!==e?(ke=e("Browse and revoke active sessions across all users."),t[186]=e,t[187]=ke):ke=t[187];let Ne;t[188]!==e?(Ne=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[188]=e,t[189]=Ne):Ne=t[189];let Me;t[190]!==e?(Me=e("Chart widgets backed by saved read-only SQL queries."),t[190]=e,t[191]=Me):Me=t[191];let Se;t[192]!==e?(Se=e("Browse and edit rows across your shard and global tables."),t[192]=e,t[193]=Se):Se=t[193];let Ce;t[194]!==e?(Ce=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[194]=e,t[195]=Ce):Ce=t[195];let Pe;t[196]!==e?(Pe=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[196]=e,t[197]=Pe):Pe=t[197];let _e;t[198]!==e?(_e=e("Export a shard to NDJSON, or import rows from it."),t[198]=e,t[199]=_e):_e=t[199];let Te;t[200]!==e?(Te=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[200]=e,t[201]=Te):Te=t[201];let Le;t[202]!==e?(Le=e("Browse objects in your R2 storage buckets."),t[202]=e,t[203]=Le):Le=t[203];let Ae;t[204]!==e?(Ae=e("Inspect feature flags and their live evaluation under a targeting context."),t[204]=e,t[205]=Ae):Ae=t[205];let Ie;t[206]!==e?(Ie=e("Run registered queries, mutations, and actions."),t[206]=e,t[207]=Ie):Ie=t[207];let Re;t[208]!==e?(Re=e("At-a-glance connection, error, and shard signals."),t[208]=e,t[209]=Re):Re=t[209];let Ee;t[210]!==e?(Ee=e("Connection, health, and advisor summary for your deployment."),t[210]=e,t[211]=Ee):Ee=t[211];let $e;t[212]!==e?($e=e("Surface slow functions, error spikes, and cache problems."),t[212]=e,t[213]=$e):$e=t[213];let He;t[214]!==e?(He=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[214]=e,t[215]=He):He=t[215];let Be;t[216]!==e?(Be=e("A live stream of recent function logs."),t[216]=e,t[217]=Be):Be=t[217];let Ve;t[218]!==e?(Ve=e("Per-shard health and aggregate metrics."),t[218]=e,t[219]=Ve):Ve=t[219];let ze;t[220]!==e?(ze=e("Review migration status and run them."),t[220]=e,t[221]=ze):ze=t[221];let De;t[222]!==e?(De=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[222]=e,t[223]=De):De=t[223];let Oe;t[224]!==e?(Oe=e("Browse and manage organizations, members, and invitations."),t[224]=e,t[225]=Oe):Oe=t[225];let Ze;t[226]!==e?(Ze=e("Restore a shard to a point in the last 30 days."),t[226]=e,t[227]=Ze):Ze=t[227];let Fe;t[228]!==e?(Fe=e("Email your app sent, captured in dev."),t[228]=e,t[229]=Fe):Fe=t[229];let qe;t[230]!==e?(qe=e("Synced customers, subscriptions, and webhook events."),t[230]=e,t[231]=qe):qe=t[231];let We;t[232]!==e?(We=e("Inspect access policies per table, and probe a function as any identity."),t[232]=e,t[233]=We):We=t[233];let je;t[234]!==e?(je=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[234]=e,t[235]=je):je=t[235];let Ge;t[236]!==e?(Ge=e("Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing."),t[236]=e,t[237]=Ge):Ge=t[237];let Ue;t[238]!==e?(Ue=e("Active WebSocket subscriptions on this shard."),t[238]=e,t[239]=Ue):Ue=t[239];let Ke;t[240]!==e?(Ke=e("Inspect row-level-security policies and roles, per table."),t[240]=e,t[241]=Ke):Ke=t[241];let Qe;t[242]!==e?(Qe=e("Inspect and cancel scheduled jobs."),t[242]=e,t[243]=Qe):Qe=t[243];let Ye;t[244]!==e?(Ye=e("Inspect each table and its columns."),t[244]=e,t[245]=Ye):Ye=t[245];let Je;t[246]!==e?(Je=e("Review admin gates, credentials, and log redaction."),t[246]=e,t[247]=Je):Je=t[247];let Xe;t[248]!==e?(Xe=e("Read-only deployment config — vars, secrets, and bindings."),t[248]=e,t[249]=Xe):Xe=t[249];let et;t[250]!==e?(et=e("Run read-only SQL against a shard."),t[250]=e,t[251]=et):et=t[251];let tt;t[252]!==e?(tt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[252]=e,t[253]=tt):tt=t[253];let st;t[254]!==e?(st=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[254]=e,t[255]=st):st=t[255];let at;t[256]!==e?(at=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[256]=e,t[257]=at):at=t[257];let ot;t[258]!==e?(ot=e("Manage auth users — roles, bans, sessions, and identity."),t[258]=e,t[259]=ot):ot=t[259];let nt;t[260]!==e?(nt=e("Browse Vectorize indexes and run similarity searches."),t[260]=e,t[261]=nt):nt=t[261];let rt;t[262]!==e?(rt=e("Inspect declared Cloudflare Workflows and their bindings."),t[262]=e,t[263]=rt):rt=t[263];let mt;t[264]!==st||t[265]!==at||t[266]!==ot||t[267]!==nt||t[268]!==rt||t[269]!==he||t[270]!==pe||t[271]!==ge||t[272]!==be||t[273]!==ve||t[274]!==xe||t[275]!==ye||t[276]!==we||t[277]!==ke||t[278]!==Ne||t[279]!==Me||t[280]!==Se||t[281]!==Ce||t[282]!==Pe||t[283]!==_e||t[284]!==Te||t[285]!==Le||t[286]!==Ae||t[287]!==Ie||t[288]!==Re||t[289]!==Ee||t[290]!==$e||t[291]!==He||t[292]!==Be||t[293]!==Ve||t[294]!==ze||t[295]!==De||t[296]!==Oe||t[297]!==Ze||t[298]!==Fe||t[299]!==qe||t[300]!==We||t[301]!==je||t[302]!==Ge||t[303]!==Ue||t[304]!==Ke||t[305]!==Qe||t[306]!==Ye||t[307]!==Je||t[308]!==Xe||t[309]!==et||t[310]!==tt?(mt={advisorHealth:he,agents:pe,evals:ge,analytics:be,api:ve,audit:xe,authAudit:ye,authConfig:we,authSessions:ke,containers:Ne,dashboards:Me,data:Se,deploymentHealth:Ce,drains:Pe,export:_e,fanout:Te,files:Le,flags:Ae,functions:Ie,health:Re,home:Ee,insights:$e,issues:He,logs:Be,metrics:Ve,migrations:ze,notifications:De,organizations:Oe,pitr:Ze,mail:Fe,payments:qe,permissions:We,queues:je,reactors:Ge,realtime:Ue,rls:Ke,schedule:Qe,schema:Ye,security:Je,settings:Xe,sql:et,kv:tt,storageRules:st,traces:at,users:ot,vectors:nt,workflows:rt},t[264]=st,t[265]=at,t[266]=ot,t[267]=nt,t[268]=rt,t[269]=he,t[270]=pe,t[271]=ge,t[272]=be,t[273]=ve,t[274]=xe,t[275]=ye,t[276]=we,t[277]=ke,t[278]=Ne,t[279]=Me,t[280]=Se,t[281]=Ce,t[282]=Pe,t[283]=_e,t[284]=Te,t[285]=Le,t[286]=Ae,t[287]=Ie,t[288]=Re,t[289]=Ee,t[290]=$e,t[291]=He,t[292]=Be,t[293]=Ve,t[294]=ze,t[295]=De,t[296]=Oe,t[297]=Ze,t[298]=Fe,t[299]=qe,t[300]=We,t[301]=je,t[302]=Ge,t[303]=Ue,t[304]=Ke,t[305]=Qe,t[306]=Ye,t[307]=Je,t[308]=Xe,t[309]=et,t[310]=tt,t[311]=mt):mt=t[311];const xt=mt;let ht;return t[312]!==vt||t[313]!==xt||t[314]!==bt?(ht={groupLabel:vt,tabDescription:xt,tabLabel:bt},t[312]=vt,t[313]=xt,t[314]=bt,t[315]=ht):ht=t[315],ht},Sa=()=>{const t=N(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("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:[n("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),n("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},Ca=()=>{const t=N(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("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:[n("circle",{cx:"12",cy:"12",r:"4"}),n("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},Pa=()=>{const t=N(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n("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:n("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},_a=[{Icon:Sa,value:"system"},{Icon:Ca,value:"light"},{Icon:Pa,value:"dark"}],Ta=()=>{const t=N(19),{theme:e,setTheme:s}=Bs(),a=te();let o;t[0]!==a?(o=a("Dark theme"),t[0]=a,t[1]=o):o=t[1];let r;t[2]!==a?(r=a("Light theme"),t[2]=a,t[3]=r):r=t[3];let i;t[4]!==a?(i=a("System theme"),t[4]=a,t[5]=i):i=t[5];let l;t[6]!==o||t[7]!==r||t[8]!==i?(l={dark:o,light:r,system:i},t[6]=o,t[7]=r,t[8]=i,t[9]=l):l=t[9];const d=l;let u;t[10]!==a?(u=a("Theme"),t[10]=a,t[11]=u):u=t[11];let c;t[12]!==d||t[13]!==s||t[14]!==e?(c=_a.map(h=>{const{Icon:f,value:g}=h,v=e===g;return w("button",{"aria-checked":v,"aria-label":d[g],className:_("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-${g}`,onClick:()=>{s(g)},role:"radio",title:d[g],type:"button",children:[v&&n(Ps.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"}}),n("span",{className:"relative",children:n(f,{})})]},g)}),t[12]=d,t[13]=s,t[14]=e,t[15]=c):c=t[15];let m;return t[16]!==u||t[17]!==c?(m=n("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]=m):m=t[18],m},La=t=>{const e=N(23),{domain:s,onOpenCommandPalette:a,page:o}=t,r=te();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n(la,{className:"-ms-1"}),e[0]=i):i=e[0];let l;e[1]!==r?(l=r("Breadcrumb"),e[1]=r,e[2]=l):l=e[2];let d;e[3]!==s?(d=n("span",{className:"text-muted-foreground",children:s}),e[3]=s,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=n("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:n("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=u):u=e[5];let c;e[6]!==o?(c=n("span",{className:"font-medium text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let m;e[8]!==l||e[9]!==d||e[10]!==c?(m=w("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]=m):m=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[n("circle",{cx:"11",cy:"11",r:"7"}),n("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=h):h=e[12];let f;e[13]!==r?(f=r("Search…"),e[13]=r,e[14]=f):f=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=g):g=e[15];let v;e[16]!==a||e[17]!==f?(v=w("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:a,type:"button",children:[h,f,g]}),e[16]=a,e[17]=f,e[18]=v):v=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:n(Ta,{})}),e[19]=y):y=e[19];let b;return e[20]!==v||e[21]!==m?(b=w("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[i,m,v,y]}),e[20]=v,e[21]=m,e[22]=b):b=e[22],b},Aa={agents:{capability:"agents"},analytics:{capability:"analytics",feature:"analytics"},authAudit:{feature:"auth"},authConfig:{feature:"auth"},authSessions:{feature:"auth"},containers:{capability:"containers",feature:"containers"},fanout:{capability:"crossShardFanout"},files:{capability:"objectStorage",feature:"storage"},flags:{feature:"flags"},kv:{capability:"keyValueStore",feature:"kv"},mail:{capability:"mail",feature:"mail"},notifications:{feature:"notifications"},organizations:{feature:"auth"},payments:{feature:"payments"},pitr:{capability:"pointInTimeRecovery"},queues:{capability:"queues",feature:"queues"},reactors:{capability:"serverReactors"},schedule:{capability:"scheduler",feature:"scheduler"},storageRules:{feature:"storage"},users:{feature:"auth"},vectors:{capability:"vectorStore",feature:"vectors"},workflows:{capability:"workflows",feature:"workflows"}},Ia={agents:"Durable agents",analytics:"Analytics",containers:"Containers",crossShardFanout:"Cross-shard fan-out",keyValueStore:"Key-value storage",mail:"Mail delivery",objectStorage:"Object storage",pointInTimeRecovery:"Point-in-time recovery",queues:"Queues",scheduler:"Scheduling",serverReactors:"Server reactors",vectorStore:"Vector search",workflows:"Workflows"},Ra={kind:"hidden"},It={kind:"ok"},Ea={kind:"pending"},Xt=(t,e,s)=>{const a=Aa[t];return a?.feature!==void 0&&!e[a.feature]?Ra:a?.capability===void 0?It:e.settled?e.platform?.unsupported.includes(a.capability)===!0?{kind:"unavailable",reason:s("{capability} is not supported on {platform}.",{capability:s(Ia[a.capability]),platform:e.platform.name})}:It:Ea},$a=(t,e,s)=>{const a={},o=[];for(const r of t){const i=[];for(const l of r.tabs){const d=Xt(l,e,s);d.kind!=="hidden"&&i.push(l),d.kind==="unavailable"&&(a[l]=d.reason)}i.length>0&&o.push({...r,tabs:i})}return{unavailable:a,visibleGroups:o}},Ha=t=>{const e=N(3),{reason:s,title:a}=t;let o;return e[0]!==s||e[1]!==a?(o=n(_s,{description:s,testId:"dash-unsupported",title:a}),e[0]=s,e[1]=a,e[2]=o):o=e[2],o},Ba=t=>{const e=N(4),{console:s}=Ts();let a,o;e[0]!==s||e[1]!==t?(a=()=>{if(t===void 0)return;const r=i=>{if(!i.ctrlKey||i.metaKey||i.altKey||i.shiftKey||i.repeat||i.key.toLowerCase()!==s)return;const{target:l}=i;l instanceof HTMLElement&&(l.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(l.tagName))||(i.preventDefault(),t())};return globalThis.addEventListener("keydown",r),()=>{globalThis.removeEventListener("keydown",r)}},o=[s,t],e[0]=s,e[1]=t,e[2]=a,e[3]=o):(a=e[2],o=e[3]),lt(a,o)},R=(t,e)=>A(()=>t().then(s=>({default:s[e]}))),Va=R(()=>import("../packem_chunks/InsightsPanel.mjs"),"InsightsPanel"),za=A(()=>import("../packem_chunks/rls-panel.mjs")),Da=A(()=>import("../packem_chunks/AdvisorHealthPanel.mjs")),Oa=A(()=>import("../packem_chunks/SecurityAdvisorPanel.mjs")),Za=A(()=>import("../packem_chunks/agents-panel.mjs")),Fa=R(()=>import("../packem_chunks/analytics-panel.mjs"),"AnalyticsPanel"),qa=A(()=>import("../packem_chunks/ApiTab.mjs")),Wa=A(()=>import("../packem_chunks/auth-audit-panel.mjs")),ja=A(()=>import("../packem_chunks/auth-config-panel.mjs")),Ga=A(()=>import("../packem_chunks/auth-sessions-panel.mjs")),Ua=A(()=>import("../packem_chunks/organizations-panel.mjs")),Ka=R(()=>import("../packem_chunks/users-panel.mjs"),"UsersPanel"),Qa=A(()=>import("../packem_chunks/containers-panel.mjs")),Ya=R(()=>import("../packem_chunks/DeploymentHealthPanel.mjs"),"DeploymentHealthPanel"),Ja=R(()=>import("../packem_chunks/TableEditor.mjs"),"TableEditor"),Xa=R(()=>import("../packem_chunks/ExportImportPanel.mjs"),"ExportImportPanel"),eo=A(()=>import("../packem_chunks/migrations-route.mjs")),to={data:Ms,migrations:Ns},so=R(()=>import("../packem_chunks/PitrPanel.mjs"),"PitrPanel"),ao=A(()=>import("../packem_chunks/flags-panel.mjs")),oo=A(()=>import("../packem_chunks/reactors-panel.mjs")),no=R(()=>import("../packem_chunks/FunctionRunner.mjs"),"FunctionRunner"),ro=R(()=>import("../packem_chunks/FunctionStatsPanel.mjs"),"FunctionStatsPanel"),io=A(()=>import("../packem_chunks/issues-panel.mjs")),lo=R(()=>import("../packem_chunks/AuditPanel.mjs"),"AuditPanel"),co=A(()=>import("../packem_chunks/log-drains-panel.mjs")),uo=A(()=>import("../packem_chunks/LogsPanel.mjs").then(t=>({default:t.LogsPanel}))),fo=R(()=>import("../packem_chunks/MailPanel.mjs"),"MailPanel"),mo=R(()=>import("../packem_chunks/schedule-panel.mjs"),"SchedulePanel"),ho=A(()=>import("../packem_chunks/subscriptions-panel.mjs")),po=A(()=>import("../packem_chunks/sync-client-panel.mjs")),go=R(()=>import("../packem_chunks/kv-browser.mjs"),"KvBrowser"),bo=A(()=>import("../packem_chunks/NotificationsPanel.mjs")),vo=R(()=>import("../packem_chunks/payments-panel.mjs"),"PaymentsPanel"),xo=R(()=>import("../packem_chunks/permissions-panel.mjs"),"PermissionsPanel"),yo=A(()=>import("../packem_chunks/queues-panel.mjs")),wo=A(()=>import("../packem_chunks/dashboards-panel.mjs")),ko=A(()=>import("../packem_chunks/fanout-panel.mjs")),No=R(()=>import("../packem_chunks/HealthPanel.mjs"),"HealthPanel"),Mo=R(()=>import("../packem_chunks/MetricsPanel.mjs"),"MetricsPanel"),So=R(()=>import("../packem_chunks/SchemaViewer.mjs"),"SchemaViewer"),Co=R(()=>import("../packem_chunks/SettingsPanel.mjs"),"SettingsPanel"),Po=R(()=>import("../packem_chunks/SqlEditorPanel.mjs"),"SqlEditorPanel"),_o=R(()=>import("../packem_chunks/FileBrowser.mjs"),"FileBrowser"),To=A(()=>import("../packem_chunks/storage-rules-panel.mjs")),Lo=A(()=>import("../packem_chunks/traces-panel.mjs")),Ao=A(()=>import("../packem_chunks/evals-panel.mjs")),Io=R(()=>import("../packem_chunks/vector-browser.mjs"),"VectorBrowser"),Ro=A(()=>import("../packem_chunks/workflows-panel.mjs")),es=$t(null),Eo={analytics:n("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:n("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:n("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:n("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:n("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:n("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:n("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:n("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:n("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:n("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:n("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:n("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:n("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:n("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:n("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:n("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:n("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:n("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),health:n("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:n("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:n("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:n("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:n("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:n("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:n("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:n("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:n("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:n("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:n("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:n("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:n("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:n("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:n("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),reactors:n("path",{d:"M4 4v6h6M20 20v-6h-6M20 9a8 8 0 0 0-14.7-3M4 15a8 8 0 0 0 14.7 3"}),realtime:n("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:n("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:n("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:n("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:n("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:n("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:n("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:n("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:n("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:n("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:n("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:n("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:n("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},Rt=[{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","reactors","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"]}],Mt=t=>{const e=N(2),{tab:s}=t,a=Eo[s];let o;return e[0]!==a?(o=n("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:a}),e[0]=a,e[1]=o):o=e[1],o},$o=t=>t,ts=$o(["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","reactors","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),Ho=new Set(["api","data","migrations","sql"]),Bo=t=>{const e=t.split("/").findLast(Boolean)??"";return ts.includes(e)?e:"home"},Vo=t=>{const e=N(19),{chrome:s,connected:a}=t,o=te();let r;e[0]!==o?(r=o("admin token"),e[0]=o,e[1]=r):r=e[1];let i;e[2]!==r?(i=n("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:r}),e[2]=r,e[3]=i):i=e[3];let l;e[4]!==s.onTokenChange||e[5]!==s.token?(l=n(Vt,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:s.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:s.token}),e[4]=s.onTokenChange,e[5]=s.token,e[6]=l):l=e[6];let d;e[7]!==a||e[8]!==o?(d=a&&w("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[n("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),o("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=a,e[8]=o,e[9]=d):d=e[9];let u;e[10]!==s.clearToken||e[11]!==a||e[12]!==o?(u=a&&n("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:s.clearToken,type:"button",children:o("Clear")}),e[10]=s.clearToken,e[11]=a,e[12]=o,e[13]=u):u=e[13];let c;return e[14]!==i||e[15]!==l||e[16]!==d||e[17]!==u?(c=w("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},ss="opacity-50",zo=t=>{const e=N(27),{current:s,group:a,groupLabel:o,selectTab:r,tabDescription:i,tabLabel:l,unavailable:d}=t,u=a.tabs.includes(s)?"page":void 0,c=o[a.key],m=a.tabs[0];let h;e[0]!==m?(h=n(Mt,{tab:m}),e[0]=m,e[1]=h):h=e[1];let f;e[2]!==u||e[3]!==c||e[4]!==h?(f=n(Kt,{"aria-current":u,"aria-label":c,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:h}),e[2]=u,e[3]=c,e[4]=h,e[5]=f):f=e[5];const g=o[a.key];let v;e[6]!==g?(v=n("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:g}),e[6]=g,e[7]=v):v=e[7];let y;if(e[8]!==s||e[9]!==a.tabs||e[10]!==r||e[11]!==i||e[12]!==l||e[13]!==d){let x;e[15]!==s||e[16]!==r||e[17]!==i||e[18]!==l||e[19]!==d?(x=k=>w("button",{"aria-current":s===k?"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",d[k]!==void 0&&ss),"data-tab":k,"data-testid":`dash-tab-${k}`,"data-unsupported":d[k]===void 0?void 0:"true",onClick:r,title:i[k],type:"button",children:[n(Mt,{tab:k}),n("span",{children:l[k]})]},k),e[15]=s,e[16]=r,e[17]=i,e[18]=l,e[19]=d,e[20]=x):x=e[20],y=a.tabs.map(x),e[8]=s,e[9]=a.tabs,e[10]=r,e[11]=i,e[12]=l,e[13]=d,e[14]=y}else y=e[14];let b;e[21]!==v||e[22]!==y?(b=w(Qt,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[v,y]}),e[21]=v,e[22]=y,e[23]=b):b=e[23];let p;return e[24]!==f||e[25]!==b?(p=w(Ut,{children:[f,b]}),e[24]=f,e[25]=b,e[26]=p):p=e[26],p},Do=t=>{const e=N(45),{chrome:s,collapsed:a,connected:o}=t,r=te();if(s===null){let x;e[0]!==r?(x=r("Admin"),e[0]=r,e[1]=x):x=e[1];let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=n("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=k):k=e[2];let P;e[3]!==r?(P=r("Admin"),e[3]=r,e[4]=P):P=e[4];let C;e[5]!==P?(C=n("span",{className:"truncate text-[13px] font-medium",children:P}),e[5]=P,e[6]=C):C=e[6];let S;e[7]!==r?(S=r("Studio"),e[7]=r,e[8]=S):S=e[8];let M;e[9]!==S?(M=n("span",{className:"truncate text-[11px] text-muted-foreground",children:S}),e[9]=S,e[10]=M):M=e[10];let T;e[11]!==C||e[12]!==M?(T=w("span",{className:"grid flex-1 text-start leading-tight",children:[C,M]}),e[11]=C,e[12]=M,e[13]=T):T=e[13];let L;return e[14]!==x||e[15]!==T?(L=w(Jt,{className:"data-active:bg-transparent",size:"lg",tooltip:x,children:[k,T]}),e[14]=x,e[15]=T,e[16]=L):L=e[16],L}const i=a?"mx-auto size-8 justify-center":"w-full p-2";let l;e[17]!==i?(l=_("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]!==o||e[20]!==r?(d=r(o?"Connected":"Not connected"),e[19]=o,e[20]=r,e[21]=d):d=e[21];const u=o?"bg-success":"bg-muted-foreground/50";let c;e[22]!==u?(c=_("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 m;e[24]!==c?(m=w("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",n("span",{"aria-hidden":"true",className:c})]}),e[24]=c,e[25]=m):m=e[25];let h;e[26]!==a||e[27]!==o||e[28]!==r?(h=!a&&w(Ht,{children:[w("span",{className:"grid flex-1 text-start leading-tight",children:[n("span",{className:"truncate text-[13px] font-medium",children:r("Admin")}),n("span",{className:"truncate text-[11px] text-muted-foreground",children:r(o?"Connected":"Not connected")})]}),n("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:n("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=a,e[27]=o,e[28]=r,e[29]=h):h=e[29];let f;e[30]!==l||e[31]!==d||e[32]!==m||e[33]!==h?(f=w(Kt,{className:l,"data-testid":"dash-app-connect",title:d,children:[m,h]}),e[30]=l,e[31]=d,e[32]=m,e[33]=h,e[34]=f):f=e[34];const g=a?"end":"start",v=a?"right":"top";let y;e[35]!==s||e[36]!==o?(y=n(Vo,{chrome:s,connected:o}),e[35]=s,e[36]=o,e[37]=y):y=e[37];let b;e[38]!==v||e[39]!==y||e[40]!==g?(b=n(Qt,{align:g,keepMounted:!0,side:v,children:y}),e[38]=v,e[39]=y,e[40]=g,e[41]=b):b=e[41];let p;return e[42]!==b||e[43]!==f?(p=w(Ut,{children:[f,b]}),e[42]=b,e[43]=f,e[44]=p):p=e[44],p},Oo=t=>{const e=N(29),{chrome:s,connected:a,current:o,groupLabel:r,groups:i,selectTab:l,tabDescription:d,tabLabel:u,unavailable:c}=t,m=te(),{state:h}=gt(),f=h==="collapsed",g=f&&"justify-center px-0";let v;e[0]!==g?(v=_("flex items-center gap-2.5 px-1.5 py-1",g),e[0]=g,e[1]=v):v=e[1];let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=n(Os,{className:"size-9 shrink-0 text-foreground"}),e[2]=y):y=e[2];let b;e[3]!==f||e[4]!==a||e[5]!==m?(b=!f&&w(Ht,{children:[w("span",{className:"grid flex-1 leading-tight",children:[n("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),n("span",{className:"truncate text-[11px] text-muted-foreground",children:m("Studio")})]}),n(ut,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:m(a?"Live":"Local")})]}),e[3]=f,e[4]=a,e[5]=m,e[6]=b):b=e[6];let p;e[7]!==v||e[8]!==b?(p=n(ca,{children:w("div",{className:v,children:[y,b]})}),e[7]=v,e[8]=b,e[9]=p):p=e[9];let x;e[10]!==f||e[11]!==o||e[12]!==r||e[13]!==i||e[14]!==l||e[15]!==d||e[16]!==u||e[17]!==c?(x=f?i.map(S=>n(zo,{current:o,group:S,groupLabel:r,selectTab:l,tabDescription:d,tabLabel:u,unavailable:c},S.key)):i.map(S=>w(ma,{children:[n(ha,{className:"text-[11px] font-medium tracking-wider uppercase",children:r[S.key]}),n(pa,{children:n(Lt,{children:S.tabs.map(M=>n(At,{children:w(Jt,{className:_("data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",c[M]!==void 0&&ss),"data-tab":M,"data-testid":`dash-tab-${M}`,"data-unsupported":c[M]===void 0?void 0:"true",isActive:o===M,onClick:l,title:d[M],tooltip:d[M],children:[n(Mt,{tab:M}),n("span",{children:u[M]})]})},M))})})]},S.key)),e[10]=f,e[11]=o,e[12]=r,e[13]=i,e[14]=l,e[15]=d,e[16]=u,e[17]=c,e[18]=x):x=e[18];let k;e[19]!==x?(k=n(fa,{children:x}),e[19]=x,e[20]=k):k=e[20];let P;e[21]!==s||e[22]!==f||e[23]!==a?(P=n(ua,{children:n(Lt,{children:n(At,{children:n(Do,{chrome:s,collapsed:f,connected:a})})})}),e[21]=s,e[22]=f,e[23]=a,e[24]=P):P=e[24];let C;return e[25]!==p||e[26]!==k||e[27]!==P?(C=w(ia,{collapsible:"icon",variant:"inset",children:[p,k,P]}),e[25]=p,e[26]=k,e[27]=P,e[28]=C):C=e[28],C},Pt=()=>{const t=N(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[w("div",{className:"flex items-center gap-2",children:[n(yt,{className:"h-8 w-40"}),n(yt,{className:"h-8 w-24"})]}),n(yt,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},Zo=t=>{const e=N(5),{title:s,verdict:a}=t;if(a.kind==="pending"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n(Pt,{}),e[0]=r):r=e[0],r}if(a.kind==="unavailable"){let r;return e[1]!==s||e[2]!==a.reason?(r=n(Ha,{reason:a.reason,title:s}),e[1]=s,e[2]=a.reason,e[3]=r):r=e[3],r}let o;return e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n(cs,{}),e[4]=o):o=e[4],o},Fo=()=>{const t=N(46),e=te(),s=Et();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:Ko},t[0]=a):a=t[0];const o=ds(a),r=Bo(o),i=Ho.has(r),l=ps(),d=l?.toggle;Ba(d);const u=ys(),{groupLabel:c,tabDescription:m,tabLabel:h}=Ma(),{unavailable:f,visibleGroups:g}=$a(Rt,u,e),v={...m,...f},y=Xt(r,u,e),b=y.kind==="hidden";let p,x;t[1]!==b||t[2]!==s?(p=()=>{b&&Nt(s({replace:!0,to:"/home"}))},x=[b,s],t[1]=b,t[2]=s,t[3]=p,t[4]=x):(p=t[3],x=t[4]),lt(p,x);let k;t[5]!==s?(k=Q=>{Nt(s({to:`/${Q.currentTarget.dataset.tab??""}`}))},t[5]=s,t[6]=k):k=t[6];const P=k;let C,S;t[7]!==r||t[8]!==h?(C=()=>{typeof document<"u"&&(document.title=`${h[r]} · lunora`)},S=[r,h],t[7]=r,t[8]=h,t[9]=C,t[10]=S):(C=t[9],S=t[10]),lt(C,S);const M=g.find(Q=>Q.tabs.includes(r))??Rt[0],T=g.flatMap(Q=>Q.tabs.filter(se=>f[se]===void 0).map(se=>({group:c[Q.key],label:h[se],to:`/${se}`}))),L=d===void 0?T:[...T,{group:e("Operations"),label:e("Toggle operation console"),run:d}],I=St(es),O=I!==null&&I.token!=="";let B;t[11]!==L?(B=n(Ss,{items:L}),t[11]=L,t[12]=B):B=t[12];const V=c[M.key],z=h[r];let $;t[13]!==V||t[14]!==z?($=n(La,{domain:V,onOpenCommandPalette:Cs,page:z}),t[13]=V,t[14]=z,t[15]=$):$=t[15];let H;t[16]!==I?.rulesInstalled?(H=I?.rulesInstalled===!1&&n(qs,{}),t[16]=I?.rulesInstalled,t[17]=H):H=t[17];const D=`dash-tab-${r}`,Z=i?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",E=h[r];let F;t[18]!==e||t[19]!==E?(F=e("{title} failed",{title:E}),t[18]=e,t[19]=E,t[20]=F):F=t[20];const X=h[r];let q;t[21]!==e?(q=e("Try again"),t[21]=e,t[22]=q):q=t[22];let Y;t[23]===Symbol.for("react.memo_cache_sentinel")?(Y=n(Pt,{}),t[23]=Y):Y=t[23];const ee=h[r];let W;t[24]!==ee||t[25]!==y?(W=n(fs,{fallback:Y,children:n(Zo,{title:ee,verdict:y})}),t[24]=ee,t[25]=y,t[26]=W):W=t[26];let j;t[27]!==r||t[28]!==F||t[29]!==X||t[30]!==q||t[31]!==W?(j=n(ms,{fallbackTitle:F,label:X,retryLabel:q,children:W},r),t[27]=r,t[28]=F,t[29]=X,t[30]=q,t[31]=W,t[32]=j):j=t[32];let G;t[33]!==Z||t[34]!==j?(G=n("div",{className:Z,children:j}),t[33]=Z,t[34]=j,t[35]=G):G=t[35];let U;t[36]!==l?(U=l?.open===!0&&n(wa,{focusSeq:l.focusSeq,onClose:l.close,onShownChange:l.setShown,shown:l.shown}),t[36]=l,t[37]=U):U=t[37];let K;t[38]!==D||t[39]!==G||t[40]!==U?(K=w("div",{"aria-labelledby":D,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[G,U]}),t[38]=D,t[39]=G,t[40]=U,t[41]=K):K=t[41];let J;return t[42]!==H||t[43]!==K||t[44]!==$?(J=w(da,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[$,H,K]}),t[42]=H,t[43]=K,t[44]=$,t[45]=J):J=t[45],w(ra,{className:"min-h-0 flex-1","data-platform":u.platform?.id,"data-testid":"lunora-studio",children:[B,n(Oo,{chrome:I,connected:O,current:r,groupLabel:c,groups:g,selectTab:P,tabDescription:v,tabLabel:h,unavailable:f}),J]})},qo=()=>{const t=N(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n(hs,{children:n(Fo,{})}),t[0]=e):e=t[0],e},Wo=t=>{const e=N(5),{initialShardKey:s,schemaEditable:a}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=is(o),{table:i}=r,l=typeof i=="string"?i:void 0;let d;return e[1]!==s||e[2]!==l||e[3]!==a?(d=n(So,{initialShardKey:s,initialTable:l,schemaEditable:a}),e[1]=s,e[2]=l,e[3]=a,e[4]=d):d=e[4],d},jo=()=>{const t=N(3),e=Et();let s,a;return t[0]!==e?(s=()=>{Nt(e({replace:!0,to:"/home"}))},a=[e],t[0]=e,t[1]=s,t[2]=a):(s=t[1],a=t[2]),lt(s,a),null},Go=({analyticsQuery:t,basePath:e,dataEditable:s=!1,functions:a,initialShardKey:o,openApiSpec:r,openRpcSpec:i,runAsIdentity:l=!1,schemaEditable:d=!1,scheduledCancel:u,scheduledCron:c,scheduledLoad:m})=>{const h=as({component:qo}),f={agents:n(Za,{initialShardKey:o}),analytics:n(Fa,{runQuery:t}),api:n(qa,{functions:a,initialShardKey:o,openApiSpec:r,openRpcSpec:i}),audit:n(lo,{initialShardKey:o}),authAudit:n(Wa,{}),authConfig:n(ja,{}),authSessions:n(Ga,{}),containers:n(Qa,{}),dashboards:n(wo,{initialShardKey:o}),data:n(Ja,{canGenerateRows:s&&d,editable:s,initialShardKey:o}),deploymentHealth:n(Ya,{}),drains:n(co,{}),export:n(Xa,{initialShardKey:o}),fanout:n(ko,{initialShardKey:o}),files:n(_o,{}),kv:n(go,{}),flags:n(ao,{initialShardKey:o}),reactors:n(oo,{initialShardKey:o}),functions:w("div",{className:"flex flex-col gap-8",children:[n(ro,{functions:a,initialShardKey:o}),n(no,{functions:a,runAsIdentity:l})]}),health:n(No,{initialShardKey:o}),home:n(xs,{initialShardKey:o}),insights:n(Va,{initialShardKey:o}),issues:n(io,{initialShardKey:o}),logs:n(uo,{initialShardKey:o}),traces:n(Lo,{initialShardKey:o}),evals:n(Ao,{initialShardKey:o}),metrics:n(Mo,{initialShardKey:o}),migrations:n(eo,{initialShardKey:o}),notifications:n(bo,{}),organizations:n(Ua,{}),permissions:n(xo,{functions:a,runAsIdentity:l,schemaEditable:d}),pitr:n(so,{initialShardKey:o}),mail:n(fo,{}),payments:n(vo,{}),queues:n(yo,{}),realtime:w("div",{className:"flex flex-col gap-8",children:[n(ho,{initialShardKey:o}),n(po,{})]}),rls:n(za,{}),schedule:n(mo,{loadCronJobs:c,scheduledCancel:u,scheduledLoad:m}),schema:n(Wo,{initialShardKey:o,schemaEditable:d}),advisorHealth:n(Da,{}),security:n(Oa,{}),settings:n(Co,{initialShardKey:o}),sql:n(Po,{initialShardKey:o}),storageRules:n(To,{}),users:n(Ka,{}),vectors:n(Io,{}),workflows:n(Ro,{})},g=_t({component:()=>f.home,getParentRoute:()=>h,path:"/"}),v=ts.map(p=>_t({component:()=>f[p],getParentRoute:()=>h,path:`/${p}`,validateSearch:to[p]})),y=h.addChildren([g,...v]),b="window"in globalThis?os():ns({initialEntries:["/home"]});return rs({...e===void 0||e==="/"?{}:{basepath:e},defaultNotFoundComponent:jo,defaultPendingComponent:Pt,defaultPendingMinMs:0,defaultPendingMs:0,history:b,routeTree:y})},Uo=t=>{const e=N(18),{analyticsQuery:s,basePath:a,chrome:o,dataEditable:r,functions:i,initialShardKey:l,openApiSpec:d,openRpcSpec:u,runAsIdentity:c,schemaEditable:m,scheduledCancel:h,scheduledCron:f,scheduledLoad:g}=t;let v;e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==i||e[4]!==l||e[5]!==d||e[6]!==u||e[7]!==c||e[8]!==h||e[9]!==f||e[10]!==g||e[11]!==m?(v=Go({analyticsQuery:s,basePath:a,dataEditable:r,functions:i,initialShardKey:l,openApiSpec:d,openRpcSpec:u,runAsIdentity:c,schemaEditable:m,scheduledCancel:h,scheduledCron:f,scheduledLoad:g}),e[0]=s,e[1]=a,e[2]=r,e[3]=i,e[4]=l,e[5]=d,e[6]=u,e[7]=c,e[8]=h,e[9]=f,e[10]=g,e[11]=m,e[12]=v):v=e[12];const y=v,b=o??null;let p;e[13]!==y?(p=n(ls,{router:y}),e[13]=y,e[14]=p):p=e[14];let x;return e[15]!==b||e[16]!==p?(x=n(es,{value:b,children:p}),e[15]=b,e[16]=p,e[17]=x):x=e[17],x},_n=t=>{const e=N(10);let s,a,o;e[0]!==t?({i18n:s,locale:a,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);let r;e[4]!==o?(r=n(Hs,{children:n(Uo,{...o})}),e[4]=o,e[5]=r):r=e[5];const i=r;if(s===void 0&&a===void 0)return i;let l;return e[6]!==s||e[7]!==a||e[8]!==i?(l=n(ks,{i18n:s,locale:a,children:i}),e[6]=s,e[7]=a,e[8]=i,e[9]=l):l=e[9],l};function Ko(t){return t.location.pathname}export{Os as B,_n as S,$s as T,Pn as a,Gs as b,Qs as c,Ys as d,Js as e,Bs as u};
|
package/dist/packem_shared/{table-list-sidebar-D30qERKx.mjs → table-list-sidebar-DxvakjpR.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T}from"react/compiler-runtime";import{useT as E}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{i as H,f as I,b as Q}from"./internal-CyDwqA67.mjs";import{jsx as p,jsxs as S}from"react/jsx-runtime";import{useRef as O,useEffect as Y,useState as L,useMemo as G}from"react";import{u as J}from"./use-admin-query-CR9mHt0P.mjs";import{ADMIN_FUNCTIONS as K}from"./ADMIN_FUNCTIONS-B8yyk5BX.mjs";import{useVirtualizer as Z}from"@tanstack/react-virtual";import{c as X}from"./utils-bhneXptQ.mjs";import{f as ee}from"./virtual-rect-D_j7aLxX.mjs";const te=2166136261,re=16777619,V=(s,e=te)=>{let t=e;for(let r=0;r<s.length;r+=1)t^=s.charCodeAt(r),t=Math.imul(t,re);return(t>>>0).toString(16).padStart(8,"0")},se=/([a-z\d])([A-Z])/gu,ne=/[\s_-]+/u,oe=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),le=s=>{const e=s.replaceAll(se,"$1 $2").split(ne).map(r=>r.toLowerCase()).filter(r=>r.length>0),t=new Set(e);for(let r=0;r<e.length-1;r+=1){const n=e[r],u=e[r+1];n===void 0||u===void 0||(t.add(`${n}${u}`),t.add(`${n}_${u}`))}return[...t]},j="•••",W=(s,e)=>{try{return e==="redact"?null:e==="hash"?s==null?s:V(typeof s=="bigint"?s.toString():typeof s=="string"?s:JSON.stringify(s)):j}catch{return j}},z=(s,e)=>{const t=new Map;for(const r of s)r.table===e&&t.set(r.column,r.strategy);return t},ae=s=>{for(const e of le(s))if(oe.has(e))return!0;return!1},B=(s,e)=>{const t=e.filter(n=>!s.has(n)&&ae(n));if(t.length===0)return s;const r=new Map(s);for(const n of t)r.set(n,"redact");return r},Ce=(s,e,t)=>{if(!t.enabled)return s;const r=t.columns.get(e);return r===void 0?s:W(s,r)},ce=(s,e)=>{if(!e.enabled||e.columns.size===0)return s;const t={...s};for(const[r,n]of e.columns)r in t&&(t[r]=W(t[r],n));return t},Fe=(s,e)=>!e.enabled||e.columns.size===0?s:s.map(t=>ce(t,e)),P=s=>s==null?"∅":s===""?"(empty)":H(s),ie=s=>{const e=T(32),{column:t,onFacetFilter:r,state:n}=s,u=E();let x;e[0]!==t||e[1]!==r||e[2]!==n.result?.values?(x=c=>{const m=Number(c.currentTarget.dataset.index),k=n.result?.values[m];k!==void 0&&r(t,k.value)},e[0]=t,e[1]=r,e[2]=n.result?.values,e[3]=x):x=e[3];const g=x,o=`db-facet-${t}`;let d;e[4]!==t?(d=p("span",{className:"font-medium text-foreground",children:t}),e[4]=t,e[5]=d):d=e[5];let a;e[6]!==n.loading||e[7]!==n.result||e[8]!==u?(a=n.loading&&n.result===null&&p("span",{className:"text-muted-foreground",children:u("Loading…")}),e[6]=n.loading,e[7]=n.result,e[8]=u,e[9]=a):a=e[9];let l;e[10]!==n.error?(l=n.error!==null&&p("span",{className:"text-destructive",role:"alert",children:n.error}),e[10]=n.error,e[11]=l):l=e[11];let i;e[12]!==n.result?.values?(i=n.result?.values??[],e[12]=n.result?.values,e[13]=i):i=e[13];let f;if(e[14]!==t||e[15]!==g||e[16]!==i){let c;e[18]!==t||e[19]!==g?(c=(m,k)=>S("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":k,"data-testid":`db-facet-value-${t}`,onClick:g,type:"button",children:[p("span",{className:"truncate",children:P(m.value)}),p("span",{className:"shrink-0 tabular-nums text-foreground/70",children:m.count})]},P(m.value)),e[18]=t,e[19]=g,e[20]=c):c=e[20],f=i.map(c),e[14]=t,e[15]=g,e[16]=i,e[17]=f}else f=e[17];let b;e[21]!==t||e[22]!==n.result||e[23]!==u?(b=n.result?.truncated===!0&&p("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${t}`,children:u("Showing the {n} most common values.",{n:n.result.values.length})}),e[21]=t,e[22]=n.result,e[23]=u,e[24]=b):b=e[24];let h;return e[25]!==o||e[26]!==d||e[27]!==a||e[28]!==l||e[29]!==f||e[30]!==b?(h=S("section",{className:"flex flex-col gap-1","data-testid":o,children:[d,a,l,f,b]}),e[25]=o,e[26]=d,e[27]=a,e[28]=l,e[29]=f,e[30]=b,e[31]=h):h=e[31],h},_e=s=>{const e=T(44),{columns:t,facets:r,mask:n,onFacetFilter:u,onToggleFacet:x}=s,g=E();let o;e[0]!==x?(o=y=>{const{column:v}=y.currentTarget.dataset;v!==void 0&&x(v)},e[0]=x,e[1]=o):o=e[1];const d=o;let a;e[2]!==n?(a=y=>n.enabled&&n.columns.has(y),e[2]=n,e[3]=a):a=e[3];const l=a;let i,f,b,h,c,m,k,w;if(e[4]!==t||e[5]!==r||e[6]!==l||e[7]!==g||e[8]!==d){w=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==l?(y=N=>!l(N),e[17]=l,e[18]=y):y=e[18];const v=t.filter(y);let M;if(e[19]!==r||e[20]!==l?(M=Object.entries(r).filter(N=>{const[q]=N;return!l(q)}),e[19]=r,e[20]=l,e[21]=M):M=e[21],i=M,v.length===0){w=null;break e}m="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",k="db-facets",h="flex flex-col gap-1.5";let $;e[22]!==g?($=g("Facets"),e[22]=g,e[23]=$):$=e[23],e[24]!==$?(c=p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:$}),e[24]=$,e[25]=c):c=e[25],f="flex flex-wrap gap-1";let A;e[26]!==r||e[27]!==d?(A=N=>p("button",{"aria-pressed":N in r,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":N,"data-testid":`db-facet-toggle-${N}`,onClick:d,type:"button",children:N},N),e[26]=r,e[27]=d,e[28]=A):A=e[28],b=v.map(A)}e[4]=t,e[5]=r,e[6]=l,e[7]=g,e[8]=d,e[9]=i,e[10]=f,e[11]=b,e[12]=h,e[13]=c,e[14]=m,e[15]=k,e[16]=w}else i=e[9],f=e[10],b=e[11],h=e[12],c=e[13],m=e[14],k=e[15],w=e[16];if(w!==Symbol.for("react.early_return_sentinel"))return w;let C;e[29]!==f||e[30]!==b?(C=p("div",{className:f,children:b}),e[29]=f,e[30]=b,e[31]=C):C=e[31];let F;e[32]!==C||e[33]!==h||e[34]!==c?(F=S("div",{className:h,children:[c,C]}),e[32]=C,e[33]=h,e[34]=c,e[35]=F):F=e[35];let _;e[36]!==u||e[37]!==i?(_=i.map(y=>{const[v,M]=y;return p(ie,{column:v,onFacetFilter:u,state:M},v)}),e[36]=u,e[37]=i,e[38]=_):_=e[38];let R;return e[39]!==F||e[40]!==_||e[41]!==m||e[42]!==k?(R=S("aside",{className:m,"data-testid":k,children:[F,_]}),e[39]=F,e[40]=_,e[41]=m,e[42]=k,e[43]=R):R=e[43],R};function ue(s){const e=T(2),t=O(s);let r;return e[0]!==s?(r=()=>{t.current=s},e[0]=s,e[1]=r):r=e[1],Y(r),t}const Me=()=>{const[s,e]=L({}),t=ue(s),r=O({}),n=async(o,d)=>{const a=(r.current[o]??0)+1;r.current[o]=a,e(l=>o in l?{...l,[o]:{error:null,loading:!0,result:l[o]?.result??null}}:l);try{const l=await d(o);if(r.current[o]!==a)return;e(i=>o in i?{...i,[o]:{error:null,loading:!1,result:l}}:i)}catch(l){if(r.current[o]!==a)return;e(i=>o in i?{...i,[o]:{error:Q(l),loading:!1,result:null}}:i)}};return{clearFacets:()=>{e({})},facets:s,facetsRef:t,refetchFacets:o=>{for(const d of Object.keys(t.current))I(n(d,o))},toggleFacet:(o,d)=>{if(o in t.current){e(a=>Object.fromEntries(Object.entries(a).filter(([l])=>l!==o)));return}e(a=>({...a,[o]:{error:null,loading:!0,result:null}})),d!==null&&I(n(o,d))}}},de=[],fe=()=>{const s=T(1);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={},s[0]=e):e=s[0];const{data:t}=J(K.maskPolicies,e);return Array.isArray(t?.columns)?t.columns:de},$e=s=>{const e=T(16),{columns:t,selectedTable:r}=s,n=fe(),[u,x]=L(!0);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{x(me)},e[0]=g):g=e[0];const o=g;let d;if(e[1]!==t||e[2]!==n||e[3]!==r){const h=z(n,r??"");d=B(h,t),e[1]=t,e[2]=n,e[3]=r,e[4]=d}else d=e[4];const a=d;let l;e[5]!==u||e[6]!==n?(l=(h,c)=>({columns:B(z(n,h),c),enabled:u}),e[5]=u,e[6]=n,e[7]=l):l=e[7];const i=l;let f;e[8]!==a||e[9]!==u?(f={columns:a,enabled:u},e[8]=a,e[9]=u,e[10]=f):f=e[10];let b;return e[11]!==a||e[12]!==u||e[13]!==i||e[14]!==f?(b={maskColumns:a,maskOn:u,maskView:f,maskViewFor:i,onToggleMask:o},e[11]=a,e[12]=u,e[13]=i,e[14]=f,e[15]=b):b=e[15],b};function me(s){return!s}const D=34,U=600,ge=s=>{const e=T(21),{item:t,onSelect:r,prefix:n,selected:u,start:x}=s;let g;e[0]!==t.name||e[1]!==r?(g=()=>{r(t.name)},e[0]=t.name,e[1]=r,e[2]=g):g=e[2];const o=g,d=`translateY(${String(x)}px)`;let a;e[3]!==d?(a={insetInline:0,position:"absolute",top:0,transform:d},e[3]=d,e[4]=a):a=e[4];const l=a,i=u?"bg-accent font-medium text-accent-foreground":"text-foreground";let f;e[5]!==i?(f=X("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",i),e[5]=i,e[6]=f):f=e[6];const b=`${n}-table-${t.name}`;let h;e[7]!==t.name?(h=p("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=h):h=e[8];let c;e[9]!==t.rowCount?(c=p("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:t.rowCount}),e[9]=t.rowCount,e[10]=c):c=e[10];let m;e[11]!==o||e[12]!==u||e[13]!==f||e[14]!==b||e[15]!==h||e[16]!==c?(m=S("button",{"aria-pressed":u,className:f,"data-testid":b,onClick:o,type:"button",children:[h,c]}),e[11]=o,e[12]=u,e[13]=f,e[14]=b,e[15]=h,e[16]=c,e[17]=m):m=e[17];let k;return e[18]!==l||e[19]!==m?(k=p("li",{style:l,children:m}),e[18]=l,e[19]=m,e[20]=k):k=e[20],k},Te=({header:s,onReload:e,onSelect:t,prefix:r,reloadLabel:n,selected:u,tables:x})=>{const g=E(),[o,d]=L(""),a=O(null),l=c=>{d(c.target.value)},i=G(()=>{const c=o.trim().toLowerCase();return c===""?x:x.filter(m=>m.name.toLowerCase().includes(c))},[o,x]),b=Z({count:i.length,estimateSize:()=>D,getScrollElement:()=>a.current,initialRect:{height:U,width:240},observeElementRect:(c,m)=>ee(c,m,U),overscan:12}).getVirtualItems(),h={height:i.length*D};return S("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${r}-table-list`,children:[s,S("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:g("Tables")}),e!==void 0&&p("button",{"aria-label":n??g("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${r}-load-tables`,onClick:e,title:n??g("Refresh"),type:"button",children:p("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:p("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"})})})]}),p("div",{className:"shrink-0 border-b border-border p-2",children:p("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${r}-table-search`,onChange:l,placeholder:g("search table…"),type:"search",value:o})}),S("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${r}-table-list-rows`,ref:a,children:[p("li",{"aria-hidden":"true",style:h}),b.map(c=>{const m=i[c.index];return m===void 0?null:p(ge,{item:m,onSelect:t,prefix:r,selected:u===m.name,start:c.start},m.name)})]})]})};export{_e as D,Te as T,Me as a,$e as b,ce as c,Fe as d,Ce as m,ue as u};
|
|
1
|
+
import{c as T}from"react/compiler-runtime";import{useT as E}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{k as H,f as I,b as Q}from"./internal-Df43vQI0.mjs";import{jsx as p,jsxs as S}from"react/jsx-runtime";import{useRef as O,useEffect as Y,useState as L,useMemo as G}from"react";import{u as J}from"./use-admin-query-tlBof8Yg.mjs";import{ADMIN_FUNCTIONS as K}from"./ADMIN_FUNCTIONS-B8yyk5BX.mjs";import{useVirtualizer as Z}from"@tanstack/react-virtual";import{c as X}from"./utils-bhneXptQ.mjs";import{f as ee}from"./virtual-rect-D_j7aLxX.mjs";const te=2166136261,re=16777619,V=(s,e=te)=>{let t=e;for(let r=0;r<s.length;r+=1)t^=s.charCodeAt(r),t=Math.imul(t,re);return(t>>>0).toString(16).padStart(8,"0")},se=/([a-z\d])([A-Z])/gu,ne=/[\s_-]+/u,oe=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),le=s=>{const e=s.replaceAll(se,"$1 $2").split(ne).map(r=>r.toLowerCase()).filter(r=>r.length>0),t=new Set(e);for(let r=0;r<e.length-1;r+=1){const n=e[r],u=e[r+1];n===void 0||u===void 0||(t.add(`${n}${u}`),t.add(`${n}_${u}`))}return[...t]},j="•••",W=(s,e)=>{try{return e==="redact"?null:e==="hash"?s==null?s:V(typeof s=="bigint"?s.toString():typeof s=="string"?s:JSON.stringify(s)):j}catch{return j}},z=(s,e)=>{const t=new Map;for(const r of s)r.table===e&&t.set(r.column,r.strategy);return t},ae=s=>{for(const e of le(s))if(oe.has(e))return!0;return!1},B=(s,e)=>{const t=e.filter(n=>!s.has(n)&&ae(n));if(t.length===0)return s;const r=new Map(s);for(const n of t)r.set(n,"redact");return r},Ce=(s,e,t)=>{if(!t.enabled)return s;const r=t.columns.get(e);return r===void 0?s:W(s,r)},ce=(s,e)=>{if(!e.enabled||e.columns.size===0)return s;const t={...s};for(const[r,n]of e.columns)r in t&&(t[r]=W(t[r],n));return t},Fe=(s,e)=>!e.enabled||e.columns.size===0?s:s.map(t=>ce(t,e)),P=s=>s==null?"∅":s===""?"(empty)":H(s),ie=s=>{const e=T(32),{column:t,onFacetFilter:r,state:n}=s,u=E();let x;e[0]!==t||e[1]!==r||e[2]!==n.result?.values?(x=c=>{const m=Number(c.currentTarget.dataset.index),k=n.result?.values[m];k!==void 0&&r(t,k.value)},e[0]=t,e[1]=r,e[2]=n.result?.values,e[3]=x):x=e[3];const g=x,o=`db-facet-${t}`;let d;e[4]!==t?(d=p("span",{className:"font-medium text-foreground",children:t}),e[4]=t,e[5]=d):d=e[5];let a;e[6]!==n.loading||e[7]!==n.result||e[8]!==u?(a=n.loading&&n.result===null&&p("span",{className:"text-muted-foreground",children:u("Loading…")}),e[6]=n.loading,e[7]=n.result,e[8]=u,e[9]=a):a=e[9];let l;e[10]!==n.error?(l=n.error!==null&&p("span",{className:"text-destructive",role:"alert",children:n.error}),e[10]=n.error,e[11]=l):l=e[11];let i;e[12]!==n.result?.values?(i=n.result?.values??[],e[12]=n.result?.values,e[13]=i):i=e[13];let f;if(e[14]!==t||e[15]!==g||e[16]!==i){let c;e[18]!==t||e[19]!==g?(c=(m,k)=>S("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":k,"data-testid":`db-facet-value-${t}`,onClick:g,type:"button",children:[p("span",{className:"truncate",children:P(m.value)}),p("span",{className:"shrink-0 tabular-nums text-foreground/70",children:m.count})]},P(m.value)),e[18]=t,e[19]=g,e[20]=c):c=e[20],f=i.map(c),e[14]=t,e[15]=g,e[16]=i,e[17]=f}else f=e[17];let b;e[21]!==t||e[22]!==n.result||e[23]!==u?(b=n.result?.truncated===!0&&p("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${t}`,children:u("Showing the {n} most common values.",{n:n.result.values.length})}),e[21]=t,e[22]=n.result,e[23]=u,e[24]=b):b=e[24];let h;return e[25]!==o||e[26]!==d||e[27]!==a||e[28]!==l||e[29]!==f||e[30]!==b?(h=S("section",{className:"flex flex-col gap-1","data-testid":o,children:[d,a,l,f,b]}),e[25]=o,e[26]=d,e[27]=a,e[28]=l,e[29]=f,e[30]=b,e[31]=h):h=e[31],h},_e=s=>{const e=T(44),{columns:t,facets:r,mask:n,onFacetFilter:u,onToggleFacet:x}=s,g=E();let o;e[0]!==x?(o=y=>{const{column:v}=y.currentTarget.dataset;v!==void 0&&x(v)},e[0]=x,e[1]=o):o=e[1];const d=o;let a;e[2]!==n?(a=y=>n.enabled&&n.columns.has(y),e[2]=n,e[3]=a):a=e[3];const l=a;let i,f,b,h,c,m,k,w;if(e[4]!==t||e[5]!==r||e[6]!==l||e[7]!==g||e[8]!==d){w=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==l?(y=N=>!l(N),e[17]=l,e[18]=y):y=e[18];const v=t.filter(y);let M;if(e[19]!==r||e[20]!==l?(M=Object.entries(r).filter(N=>{const[q]=N;return!l(q)}),e[19]=r,e[20]=l,e[21]=M):M=e[21],i=M,v.length===0){w=null;break e}m="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",k="db-facets",h="flex flex-col gap-1.5";let $;e[22]!==g?($=g("Facets"),e[22]=g,e[23]=$):$=e[23],e[24]!==$?(c=p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:$}),e[24]=$,e[25]=c):c=e[25],f="flex flex-wrap gap-1";let A;e[26]!==r||e[27]!==d?(A=N=>p("button",{"aria-pressed":N in r,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":N,"data-testid":`db-facet-toggle-${N}`,onClick:d,type:"button",children:N},N),e[26]=r,e[27]=d,e[28]=A):A=e[28],b=v.map(A)}e[4]=t,e[5]=r,e[6]=l,e[7]=g,e[8]=d,e[9]=i,e[10]=f,e[11]=b,e[12]=h,e[13]=c,e[14]=m,e[15]=k,e[16]=w}else i=e[9],f=e[10],b=e[11],h=e[12],c=e[13],m=e[14],k=e[15],w=e[16];if(w!==Symbol.for("react.early_return_sentinel"))return w;let C;e[29]!==f||e[30]!==b?(C=p("div",{className:f,children:b}),e[29]=f,e[30]=b,e[31]=C):C=e[31];let F;e[32]!==C||e[33]!==h||e[34]!==c?(F=S("div",{className:h,children:[c,C]}),e[32]=C,e[33]=h,e[34]=c,e[35]=F):F=e[35];let _;e[36]!==u||e[37]!==i?(_=i.map(y=>{const[v,M]=y;return p(ie,{column:v,onFacetFilter:u,state:M},v)}),e[36]=u,e[37]=i,e[38]=_):_=e[38];let R;return e[39]!==F||e[40]!==_||e[41]!==m||e[42]!==k?(R=S("aside",{className:m,"data-testid":k,children:[F,_]}),e[39]=F,e[40]=_,e[41]=m,e[42]=k,e[43]=R):R=e[43],R};function ue(s){const e=T(2),t=O(s);let r;return e[0]!==s?(r=()=>{t.current=s},e[0]=s,e[1]=r):r=e[1],Y(r),t}const Me=()=>{const[s,e]=L({}),t=ue(s),r=O({}),n=async(o,d)=>{const a=(r.current[o]??0)+1;r.current[o]=a,e(l=>o in l?{...l,[o]:{error:null,loading:!0,result:l[o]?.result??null}}:l);try{const l=await d(o);if(r.current[o]!==a)return;e(i=>o in i?{...i,[o]:{error:null,loading:!1,result:l}}:i)}catch(l){if(r.current[o]!==a)return;e(i=>o in i?{...i,[o]:{error:Q(l),loading:!1,result:null}}:i)}};return{clearFacets:()=>{e({})},facets:s,facetsRef:t,refetchFacets:o=>{for(const d of Object.keys(t.current))I(n(d,o))},toggleFacet:(o,d)=>{if(o in t.current){e(a=>Object.fromEntries(Object.entries(a).filter(([l])=>l!==o)));return}e(a=>({...a,[o]:{error:null,loading:!0,result:null}})),d!==null&&I(n(o,d))}}},de=[],fe=()=>{const s=T(1);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={},s[0]=e):e=s[0];const{data:t}=J(K.maskPolicies,e);return Array.isArray(t?.columns)?t.columns:de},$e=s=>{const e=T(16),{columns:t,selectedTable:r}=s,n=fe(),[u,x]=L(!0);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{x(me)},e[0]=g):g=e[0];const o=g;let d;if(e[1]!==t||e[2]!==n||e[3]!==r){const h=z(n,r??"");d=B(h,t),e[1]=t,e[2]=n,e[3]=r,e[4]=d}else d=e[4];const a=d;let l;e[5]!==u||e[6]!==n?(l=(h,c)=>({columns:B(z(n,h),c),enabled:u}),e[5]=u,e[6]=n,e[7]=l):l=e[7];const i=l;let f;e[8]!==a||e[9]!==u?(f={columns:a,enabled:u},e[8]=a,e[9]=u,e[10]=f):f=e[10];let b;return e[11]!==a||e[12]!==u||e[13]!==i||e[14]!==f?(b={maskColumns:a,maskOn:u,maskView:f,maskViewFor:i,onToggleMask:o},e[11]=a,e[12]=u,e[13]=i,e[14]=f,e[15]=b):b=e[15],b};function me(s){return!s}const D=34,U=600,ge=s=>{const e=T(21),{item:t,onSelect:r,prefix:n,selected:u,start:x}=s;let g;e[0]!==t.name||e[1]!==r?(g=()=>{r(t.name)},e[0]=t.name,e[1]=r,e[2]=g):g=e[2];const o=g,d=`translateY(${String(x)}px)`;let a;e[3]!==d?(a={insetInline:0,position:"absolute",top:0,transform:d},e[3]=d,e[4]=a):a=e[4];const l=a,i=u?"bg-accent font-medium text-accent-foreground":"text-foreground";let f;e[5]!==i?(f=X("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",i),e[5]=i,e[6]=f):f=e[6];const b=`${n}-table-${t.name}`;let h;e[7]!==t.name?(h=p("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=h):h=e[8];let c;e[9]!==t.rowCount?(c=p("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:t.rowCount}),e[9]=t.rowCount,e[10]=c):c=e[10];let m;e[11]!==o||e[12]!==u||e[13]!==f||e[14]!==b||e[15]!==h||e[16]!==c?(m=S("button",{"aria-pressed":u,className:f,"data-testid":b,onClick:o,type:"button",children:[h,c]}),e[11]=o,e[12]=u,e[13]=f,e[14]=b,e[15]=h,e[16]=c,e[17]=m):m=e[17];let k;return e[18]!==l||e[19]!==m?(k=p("li",{style:l,children:m}),e[18]=l,e[19]=m,e[20]=k):k=e[20],k},Te=({header:s,onReload:e,onSelect:t,prefix:r,reloadLabel:n,selected:u,tables:x})=>{const g=E(),[o,d]=L(""),a=O(null),l=c=>{d(c.target.value)},i=G(()=>{const c=o.trim().toLowerCase();return c===""?x:x.filter(m=>m.name.toLowerCase().includes(c))},[o,x]),b=Z({count:i.length,estimateSize:()=>D,getScrollElement:()=>a.current,initialRect:{height:U,width:240},observeElementRect:(c,m)=>ee(c,m,U),overscan:12}).getVirtualItems(),h={height:i.length*D};return S("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${r}-table-list`,children:[s,S("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[p("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:g("Tables")}),e!==void 0&&p("button",{"aria-label":n??g("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${r}-load-tables`,onClick:e,title:n??g("Refresh"),type:"button",children:p("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:p("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"})})})]}),p("div",{className:"shrink-0 border-b border-border p-2",children:p("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${r}-table-search`,onChange:l,placeholder:g("search table…"),type:"search",value:o})}),S("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${r}-table-list-rows`,ref:a,children:[p("li",{"aria-hidden":"true",style:h}),b.map(c=>{const m=i[c.index];return m===void 0?null:p(ge,{item:m,onSelect:t,prefix:r,selected:u===m.name,start:c.start},m.name)})]})]})};export{_e as D,Te as T,Me as a,$e as b,ce as c,Fe as d,Ce as m,ue as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $}from"react/compiler-runtime";import{useLunora as w}from"@lunora/react";import{useQueryClient as k,useQuery as L,keepPreviousData as P}from"@tanstack/react-query";import{useState as Q,useEffect as T}from"react";import{c as b,d as v,f as I,b as _}from"./internal-
|
|
1
|
+
import{c as $}from"react/compiler-runtime";import{useLunora as w}from"@lunora/react";import{useQueryClient as k,useQuery as L,keepPreviousData as P}from"@tanstack/react-query";import{useState as Q,useEffect as T}from"react";import{c as b,d as v,f as I,b as _}from"./internal-Df43vQI0.mjs";const S=300,a=e=>typeof e=="string"?e===""?void 0:e:typeof e=="number"||typeof e=="boolean"?String(e):void 0,c=e=>e.filter(t=>t!==void 0).join(" "),q=e=>{const t=Array.isArray(e.filters)?e.filters.length:0,r=typeof e.search=="string"&&e.search!=="";return t===0&&!r?"no predicate":c([t===0?void 0:`${String(t)} filters`,r?"search":void 0])},C={clearTable:e=>c([a(e.table),"whole table"]),deleteRows:e=>c([a(e.table),q(e)]),facetColumn:e=>c([a(e.table),a(e.column)]),importShard:e=>{if(!Array.isArray(e.rows))return"";const t=[...new Set(e.rows.filter(r=>typeof r=="object"&&r!==null).map(r=>r.table).filter(r=>typeof r=="string"))].toSorted((r,i)=>r.localeCompare(i));return c([`${String(e.rows.length)} rows`,t.length===0?void 0:`into ${t.join(", ")}`])},lintSql:()=>"sql",patchRows:e=>c([a(e.table),typeof e.doc=="object"&&e.doc!==null?`set ${Object.keys(e.doc).join(", ")}`:void 0,q(e)]),pitrRestore:e=>c([a(e.time)===void 0?void 0:`to ${String(e.time)}`,typeof e.bookmark=="string"&&e.bookmark!==""?"from bookmark":void 0,e.restart===!0?"restart now":void 0]),readTablePage:e=>c([a(e.table),Array.isArray(e.filters)&&e.filters.length>0?`${String(e.filters.length)} filters`:void 0,typeof e.search=="string"&&e.search!==""?"search":void 0,typeof e.limit=="number"?`limit ${String(e.limit)}`:void 0]),runMigration:e=>c([a(e.id),a(e.direction),e.dryRun===!0?"dry-run":void 0]),runSql:e=>typeof e.sql=="string"?`${String(e.sql.length)} chars`:"",schemaVersion:e=>typeof e.hash=="string"?e.hash.slice(0,8):"",writeRow:e=>c([a(e.table),"1 row"])},A="__lunora_admin__:",M=(e,t)=>{const r=e.startsWith(A)?e.slice(A.length):e,i=C[r];if(i!==void 0)return i(t);const s=Object.keys(t);return s.length===0?"":s.join(", ")},K=e=>{if(Array.isArray(e))return e.length;if(!(typeof e!="object"||e===null)){for(const t of Object.values(e))if(Array.isArray(t))return t.length}};class x{entries=[];listeners=new Set;nextSeq=1;getSnapshot=()=>this.entries;subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});start(t,r,i){return this.append(t,r,i,"call","pending")}startSubscription(t,r,i){return this.append(t,r,i,"subscription","live")}recordPush(t){if(this.listeners.size===0){const r=this.entries.find(i=>i.seq===t);r!==void 0&&(r.pushes=(r.pushes??0)+1);return}this.patch(t,r=>({...r,pushes:(r.pushes??0)+1}))}failSubscription(t,r){this.patch(t,i=>({...i,error:r,status:"error"}))}endSubscription(t){this.patch(t,r=>r.status==="error"?r:{...r,durationMs:Date.now()-r.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(t=>t.status==="error")?.seq}settle(t,r){this.patch(t,i=>({...i,durationMs:Date.now()-i.startedAt,...r.error===void 0?{resultCount:K(r.result),status:"ok"}:{error:r.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(t,r,i,s,n){const l=this.nextSeq;this.nextSeq+=1;const d={functionPath:t,kind:s,seq:l,shardKey:i,startedAt:Date.now(),status:n,summary:M(t,r),...s==="subscription"?{pushes:0}:{}},o=[...this.entries,d];return this.entries=o.length>S?o.slice(o.length-S):o,this.emit(),l}patch(t,r){const i=this.entries.findIndex(s=>s.seq===t);i!==-1&&(this.entries=this.entries.with(i,r(this.entries[i])),this.emit())}emit(){for(const t of this.listeners)t()}}const f=new x,j=(e,t,r)=>["lunora-admin",e,t,r.trim()],E=(e,t)=>[...e,t];function F(e,t,r={}){const i=w(),{enabled:s=!0,keepPreviousData:n=!1,staleTime:l=0}=r,d=E(e,i.clientIdentifier()),u=L({enabled:s,queryFn:t,placeholderData:n?P:void 0,queryKey:d,staleTime:l});return{data:u.data,error:u.error?_(u.error):u.error,errorSource:u.error??void 0,isLoading:u.isLoading,liveError:void 0,refetch:()=>{I(u.refetch())}}}function U(e,t,r={}){const i=w(),s=k(),{enabled:n=!0,keepPreviousData:l=!1,live:d=!1,shardKey:o="",staleTime:u}=r,p=j(e,t,o),R=F(p,()=>i.query(b(e),t,v(o)),{enabled:n,keepPreviousData:l,staleTime:u??(d?Number.POSITIVE_INFINITY:0)}),[g,y]=Q(void 0),D=JSON.stringify(p);return T(()=>{if(!n||!d)return;y(void 0);const m=f.startSubscription(e,t,o),O=i.subscribe(b(e),t,h=>{f.recordPush(m),y(void 0),s.setQueryData(E(p,i.clientIdentifier()),h)},{...v(o),onError:h=>{f.failSubscription(m,h.message),y(h.message)}});return()=>{f.endSubscription(m),O()}},[i,D,n,d]),{...R,liveError:n&&d?g:void 0}}const W=()=>{const e=$(2),t=k();let r;return e[0]!==t?(r=(i,s,n)=>{const l=s===void 0?["lunora-admin",i]:j(i,s,n??"");I(t.invalidateQueries({queryKey:l}))},e[0]=t,e[1]=r):r=e[1],r};export{W as a,F as b,f as o,U as u};
|