@lunora/studio 1.0.0-alpha.377 → 1.0.0-alpha.378
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/packem_chunks/LogsPanel.mjs +1 -1
- package/dist/packem_chunks/MetricsPanel.mjs +1 -1
- package/dist/packem_chunks/ai-knowledge.mjs +1 -1
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_shared/log-fields-PjFFEqv0.mjs +8 -0
- package/dist/packem_shared/log-line-DnvvQnY5.mjs +1 -0
- package/dist/standalone/{chunk-PGK4SNG3.js → chunk-27YLJQRE.js} +1 -1
- package/dist/standalone/{chunk-DB332GVZ.js → chunk-2Q66YTBU.js} +1 -1
- package/dist/standalone/{chunk-JUTXPZQK.js → chunk-2RL5YVB7.js} +1 -1
- package/dist/standalone/chunk-2SWWUGUK.js +1 -0
- package/dist/standalone/{chunk-VSYZL2WH.js → chunk-3OVNOP65.js} +1 -1
- package/dist/standalone/{chunk-LIQOSH6R.js → chunk-3PRGO2WY.js} +1 -1
- package/dist/standalone/{chunk-LD6JOIEW.js → chunk-3RZB5QXH.js} +1 -1
- package/dist/standalone/{chunk-GBVYBBIF.js → chunk-4I23RURI.js} +1 -1
- package/dist/standalone/{chunk-OYCDWIG2.js → chunk-4S7ZIMWI.js} +9 -9
- package/dist/standalone/{chunk-NXNTS5G2.js → chunk-4XNMLHOA.js} +1 -1
- package/dist/standalone/{chunk-4NKJV7YX.js → chunk-4YENBZSS.js} +1 -1
- package/dist/standalone/{chunk-7VZPHPTH.js → chunk-5G2OOLMF.js} +1 -1
- package/dist/standalone/{chunk-F4KT43QZ.js → chunk-66PQJM66.js} +1 -1
- package/dist/standalone/{chunk-5Z6PF6KC.js → chunk-6DKBHMBL.js} +1 -1
- package/dist/standalone/{chunk-QVFWLGGW.js → chunk-6EPIINAW.js} +1 -1
- package/dist/standalone/{chunk-VH4NT2WJ.js → chunk-6IECLZ2U.js} +1 -1
- package/dist/standalone/{chunk-O6HYP4FT.js → chunk-77PKR3WU.js} +1 -1
- package/dist/standalone/{chunk-UBAPZPI2.js → chunk-7MQI2RNF.js} +1 -1
- package/dist/standalone/{chunk-OR2CSCVB.js → chunk-A5HJXHD2.js} +1 -1
- package/dist/standalone/{chunk-VB3BKQCE.js → chunk-A5INOAIL.js} +1 -1
- package/dist/standalone/{chunk-N33IYFIX.js → chunk-A6E46F3B.js} +1 -1
- package/dist/standalone/{chunk-P37L55FP.js → chunk-AKC4XWCD.js} +1 -1
- package/dist/standalone/{chunk-QH6WAQIT.js → chunk-APTQ5BDE.js} +1 -1
- package/dist/standalone/{chunk-2SKEPLDB.js → chunk-ASSIQ4W7.js} +1 -1
- package/dist/standalone/{chunk-EC3XQQRV.js → chunk-BEC2C3JD.js} +1 -1
- package/dist/standalone/{chunk-DBV2V6OY.js → chunk-BMGCCYQL.js} +1 -1
- package/dist/standalone/{chunk-446DKR7O.js → chunk-BMS6CAKT.js} +1 -1
- package/dist/standalone/{chunk-MAZES4KJ.js → chunk-BOYBN3TE.js} +1 -1
- package/dist/standalone/{chunk-3FVWKQLT.js → chunk-BR2A4DYH.js} +1 -1
- package/dist/standalone/{chunk-D76SLSGV.js → chunk-CB22PV3X.js} +1 -1
- package/dist/standalone/{chunk-FH4R64SS.js → chunk-CX2T7TTB.js} +1 -1
- package/dist/standalone/{chunk-TKALUM7Y.js → chunk-CXAPSZF2.js} +1 -1
- package/dist/standalone/{chunk-MXYZQCDR.js → chunk-D5VO54BI.js} +1 -1
- package/dist/standalone/chunk-DKEK4ZO6.js +8 -0
- package/dist/standalone/{chunk-AFIY2ATE.js → chunk-DQWEVUGA.js} +1 -1
- package/dist/standalone/{chunk-ZIUDJD6M.js → chunk-EA3RERQQ.js} +1 -1
- package/dist/standalone/{chunk-IEMQNFZ7.js → chunk-ELXPUNSN.js} +1 -1
- package/dist/standalone/{chunk-Y5HPCYBO.js → chunk-F2EGC6HE.js} +1 -1
- package/dist/standalone/{chunk-ZUVDTKXM.js → chunk-F32O6VAS.js} +1 -1
- package/dist/standalone/{chunk-N6H4WQHD.js → chunk-F5DCBRCJ.js} +1 -1
- package/dist/standalone/{chunk-OVXKPVKS.js → chunk-FBG5SSXS.js} +1 -1
- package/dist/standalone/{chunk-WUWBRYJG.js → chunk-FFQISGOB.js} +1 -1
- package/dist/standalone/{chunk-CVPH3ATG.js → chunk-FGEN2V4E.js} +1 -1
- package/dist/standalone/{chunk-5ZZO5UEC.js → chunk-FNE6FFFN.js} +1 -1
- package/dist/standalone/{chunk-BMDQFH65.js → chunk-FOURRGSO.js} +1 -1
- package/dist/standalone/{chunk-6ALD476Y.js → chunk-FPRVR763.js} +1 -1
- package/dist/standalone/{chunk-IAVAD545.js → chunk-FXSY2FCG.js} +1 -1
- package/dist/standalone/{chunk-3J26FAKO.js → chunk-FXZ6GEUP.js} +1 -1
- package/dist/standalone/{chunk-M5VU6MF5.js → chunk-H5AOMWTU.js} +1 -1
- package/dist/standalone/{chunk-RNVK7QCW.js → chunk-HNNAMZHQ.js} +1 -1
- package/dist/standalone/{chunk-RNTEWZRJ.js → chunk-IIIAOQ22.js} +1 -1
- package/dist/standalone/{chunk-AMWPN5JC.js → chunk-IO3TEFOW.js} +1 -1
- package/dist/standalone/{chunk-MWMVXHQM.js → chunk-J76P372V.js} +1 -1
- package/dist/standalone/{chunk-BS77NGL6.js → chunk-J7M7G2BA.js} +1 -1
- package/dist/standalone/{chunk-2BUAJRHS.js → chunk-JAY3ZKY6.js} +1 -1
- package/dist/standalone/{chunk-IDK6WH4X.js → chunk-JLPBW5EC.js} +1 -1
- package/dist/standalone/{chunk-RQFK2LYP.js → chunk-KEICHBPK.js} +1 -1
- package/dist/standalone/{chunk-CTIZP3XO.js → chunk-KFDOGDD2.js} +1 -1
- package/dist/standalone/{chunk-VRAOBE6E.js → chunk-KMEDIMYZ.js} +1 -1
- package/dist/standalone/chunk-LDWYV63L.js +1 -0
- package/dist/standalone/{chunk-CJJSRDJQ.js → chunk-MFVL3BKJ.js} +1 -1
- package/dist/standalone/{chunk-JQH5M3FB.js → chunk-MSZMSG3J.js} +1 -1
- package/dist/standalone/{chunk-QURAUVUB.js → chunk-N5A7KU32.js} +1 -1
- package/dist/standalone/{chunk-GQF53GWD.js → chunk-NIGA74BG.js} +1 -1
- package/dist/standalone/{chunk-6ORWM6ZT.js → chunk-NOJMUWHR.js} +1 -1
- package/dist/standalone/{chunk-7E3RA4X6.js → chunk-NSPPZR3Q.js} +1 -1
- package/dist/standalone/{chunk-22OYIN7Q.js → chunk-O5NP5MVG.js} +1 -1
- package/dist/standalone/{chunk-MUCEG53A.js → chunk-O65MHZCA.js} +1 -1
- package/dist/standalone/{chunk-MWF4AQ5B.js → chunk-PKOFJJA2.js} +1 -1
- package/dist/standalone/{chunk-YKUO2I5M.js → chunk-PLONGJJL.js} +1 -1
- package/dist/standalone/{chunk-PP75AWAZ.js → chunk-QEQGGAZQ.js} +1 -1
- package/dist/standalone/{chunk-74OCXJGH.js → chunk-R55GP52Y.js} +1 -1
- package/dist/standalone/{chunk-D7SKD7RO.js → chunk-R6B5XFEW.js} +1 -1
- package/dist/standalone/chunk-SAV5V3DG.js +7 -0
- package/dist/standalone/{chunk-4RPRUFVA.js → chunk-SBY32RYL.js} +1 -1
- package/dist/standalone/{chunk-DBOXAUII.js → chunk-SHTZR3TU.js} +1 -1
- package/dist/standalone/{chunk-553O7ESU.js → chunk-SZCXVIVT.js} +1 -1
- package/dist/standalone/{chunk-JB5VB7PX.js → chunk-TOBQK3ZF.js} +1 -1
- package/dist/standalone/{chunk-XMJB5JOF.js → chunk-TRJMN2YI.js} +1 -1
- package/dist/standalone/{chunk-44ZHY2EU.js → chunk-TU2IB3GT.js} +1 -1
- package/dist/standalone/{chunk-2BCNWFC5.js → chunk-UA7DC3LX.js} +1 -1
- package/dist/standalone/{chunk-APHDGDQX.js → chunk-UCOKDCSX.js} +1 -1
- package/dist/standalone/{chunk-TLOLN6RV.js → chunk-UEM26EYR.js} +1 -1
- package/dist/standalone/{chunk-ZAWNUXWP.js → chunk-UL5GMSAW.js} +1 -1
- package/dist/standalone/{chunk-GWRKSV2Q.js → chunk-UVMD7C4J.js} +1 -1
- package/dist/standalone/{chunk-KMA6JR2E.js → chunk-V4D77Q45.js} +1 -1
- package/dist/standalone/{chunk-NSG5VFIL.js → chunk-VONBNFUJ.js} +1 -1
- package/dist/standalone/{chunk-XNZ4WUSQ.js → chunk-VY5KDMVO.js} +1 -1
- package/dist/standalone/{chunk-EYDMS22X.js → chunk-W46UJQN7.js} +1 -1
- package/dist/standalone/{chunk-YOUTNV5Y.js → chunk-W5LH6U6X.js} +1 -1
- package/dist/standalone/{chunk-K7Z7UTJJ.js → chunk-X26D3KTK.js} +1 -1
- package/dist/standalone/chunk-X2KZTOZR.js +1 -0
- package/dist/standalone/{chunk-6BWAMHRF.js → chunk-YIOJWQ3G.js} +1 -1
- package/dist/standalone/{chunk-CD6Y4HMA.js → chunk-YU67D2FL.js} +1 -1
- package/dist/standalone/{chunk-AKOBXMLE.js → chunk-YV6YBDCS.js} +1 -1
- package/dist/standalone/{chunk-CF2MJGHC.js → chunk-YZUJTBSJ.js} +1 -1
- package/dist/standalone/{chunk-MBA6SBBO.js → chunk-ZBP4ZBS6.js} +1 -1
- package/dist/standalone/{chunk-COLRWCN5.js → chunk-ZF4WXT7S.js} +1 -1
- package/dist/standalone/{chunk-DIZP54PG.js → chunk-ZK2HQFGQ.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/log-fields-BolUoZ9g.mjs +0 -1
- package/dist/packem_shared/log-line-BH0iWiBv.mjs +0 -1
- package/dist/standalone/chunk-IYN56FBP.js +0 -1
- package/dist/standalone/chunk-K24LZAP2.js +0 -7
- package/dist/standalone/chunk-M7EHYZ6R.js +0 -1
- package/dist/standalone/chunk-U4X2I55T.js +0 -1
- package/dist/standalone/chunk-YORPLSI5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{b as I}from"./chunk-AKC4XWCD.js";import{a as y,e as A}from"./chunk-CB22PV3X.js";import{n as k}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as S}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as z}from"./chunk-A6TVTNKO.js";import{b as P}from"./chunk-ADABTCDI.js";import{a as u,d as w}from"./chunk-5PEAXTYQ.js";var N=w(z(),1);var a=w(P(),1);var j=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),p=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:n}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let s;i[2]!==t?(s=(0,a.jsx)(A,{className:"p-3",children:t}),i[2]=t,i[3]=s):s=i[3];let c;return i[4]!==l||i[5]!==s||i[6]!==n?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":n,children:[l,s]}),i[4]=l,i[5]=s,i[6]=n,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,n;i[0]!==t?(n=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=n):n=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let s;return i[4]!==n||i[5]!==l?(s=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[n,l]}),i[4]=n,i[5]=l,i[6]=s):s=i[6],s},"c"),M=u(()=>{let e=(0,N.c)(20),i=k(),t=S(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let n;e[1]!==i?(n=u(()=>i.getAuthConfig(),"r"),e[1]=i,e[2]=n):n=e[2];let{data:l,error:s}=I(d,n),c;e[3]!==t?(c=u(r=>(0,a.jsx)(h,{variant:r?"success":"outline",children:t(r?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,g;e[5]!==s?(g=s!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s}),e[5]=s,e[6]=g):g=e[6];let f;e[7]!==l||e[8]!==s||e[9]!==t?(f=s===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=s,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==s||e[13]!==m||e[14]!==t?(x=s===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:j.map(r=>{let $=l.capabilities[r.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${r.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(r.label)}),m($)]},r.key)})})}),(0,a.jsx)(p,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(C)})}),(0,a.jsx)(p,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(q)})})]})}),l.organization.enabled&&(0,a.jsx)(p,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(p,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(p,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(p,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(r=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${r.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:r.name}),r.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:r.type}),r.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),r.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},r.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=s,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==g||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,f,x]}),e[16]=g,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"O");function C(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(C,"P");function q(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(q,"z");export{M as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-BOYBN3TE.js";import{a as V,b as F,c as J,d as K,e as B,f as A,g as I,h as M}from"./chunk-YU67D2FL.js";import{a as z}from"./chunk-V4D77Q45.js";import{B as L,p as D,r as U,s as Q,v as W}from"./chunk-4S7ZIMWI.js";import{a as te}from"./chunk-A6TVTNKO.js";import{a as ee,b as le}from"./chunk-ADABTCDI.js";import{a as g,d as q}from"./chunk-5PEAXTYQ.js";var _=q(te(),1),E=q(ee(),1);var T="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",fe=`${T} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;var s=q(le(),1);var X=g(l=>`"${l.replaceAll('"','""')}"`,"q"),ne=/["\n\r,]/u,oe=/^[=+\-@\t\r]/u,Y=g(l=>{if(l==null)return"";let e;return typeof l=="string"?e=oe.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=U(l),ne.test(e)?`"${e.replaceAll('"','""')}"`:e},"J"),ae=g((l,e)=>{let n=l.map(t=>Y(t)).join(","),o=e.map(t=>l.map(c=>Y(t[c])).join(","));return[n,...o].join(`
|
|
2
2
|
`)},"ne"),se=g(l=>JSON.stringify(l,D,2),"oe"),Z=500,re=g(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:U(l)).replaceAll("'","''")}'`,"K"),G="__doc__",ie=g((l,e,n,o)=>{if(e.length===0||n.length===0)return"";let t=o?.includes(G)===!0&&!e.includes(G)?e.filter(d=>!o.includes(d)):void 0,c=t===void 0?e:o,r=g((d,b)=>re(t===void 0||b!==G?d[b]:JSON.stringify(Object.fromEntries(t.map(u=>[u,d[u]])),D)),"i"),a=c.map(d=>X(d)).join(", "),i=[];for(let d=0;d<n.length;d+=Z){let b=n.slice(d,d+Z).map(u=>` (${c.map(m=>r(u,m)).join(", ")})`).join(`,
|
|
3
3
|
`);i.push(`INSERT INTO ${X(l)} (${a}) VALUES
|
|
4
4
|
${b};`)}return i.join(`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as t}from"./chunk-5PEAXTYQ.js";var p=t(r=>{if(typeof r=="string")return r;if(r instanceof Error)return String(r);try{return JSON.stringify(r)??String(r)}catch{return String(r)}},"R"),g=t(r=>typeof r=="object"&&r!==null&&!Array.isArray(r),"a"),h=t(r=>g(r)&&typeof r.name=="string"&&typeof r.message=="string"?r:void 0,"$"),y=t(r=>{let e=r;if(typeof r=="string"){if(!r.startsWith("{")||!r.endsWith("}"))return;try{e=JSON.parse(r)}catch{return}}let s=h(e);return s!==void 0&&(typeof s.stack=="string"||s.cause!==void 0||Array.isArray(s.errors))?s:void 0},"d"),f=t(r=>r.message===""?r.name:`${r.name}: ${r.message}`,"E"),d=/^[\w$.]+$/u,m=t(r=>{if(typeof r.stack!="string")return[];let e=r.stack,s=r.message===""?-1:e.indexOf(r.message),n=s===-1?"":e.slice(0,s);return s>0&&n.endsWith(": ")&&!n.includes(`
|
|
2
|
+
`)?e=e.slice(s+r.message.length):r.message===""&&d.test(e.split(`
|
|
3
|
+
`,1)[0]??"")&&(e=e.slice((e.split(`
|
|
4
|
+
`,1)[0]??"").length)),e.split(`
|
|
5
|
+
`).map(i=>i.trim()).filter(i=>i!=="")},"p"),l=t((r,e,s=0)=>{let n=`${e} `,i=[f(r),...m(r).map(o=>`${n}${o}`)],a=t((o,c)=>{let u=h(c);return u===void 0?`${e}${o}: ${p(c)}`:`${e}${o}: ${s>=4?f(u):l(u,n,s+1).join(`
|
|
6
|
+
`)}`},"o");return Array.isArray(r.errors)&&r.errors.slice(0,10).forEach((o,c)=>{i.push(a(`errors[${String(c)}]`,o))}),r.cause!==void 0&&i.push(a("caused by",r.cause)),i},"y"),v=t((r,e="")=>r.map(([s,n])=>`${e}${s}: ${l(n,`${e} `).join(`
|
|
7
|
+
`)}`).join(`
|
|
8
|
+
`),"m"),A=t(r=>{if(typeof r!="string")return r;if(!(!(r.startsWith("{")&&r.endsWith("}"))&&!(r.startsWith("[")&&r.endsWith("]"))))try{return JSON.parse(r)}catch{return}},"_"),$=t((r,e,s,n)=>{if(n.length>=10||s>=8||typeof r!="object"||r===null)return;let i=y(r);if(i!==void 0){n.push([e,i]);return}if(Array.isArray(r)){r.forEach((a,o)=>{$(a,`${e}[${String(o)}]`,s+1,n)});return}for(let[a,o]of Object.entries(r))$(o,`${e}.${a}`,s+1,n)},"g"),j=t(r=>{if(!g(r))return{errors:[],text:""};let e=[],s=[];for(let[n,i]of Object.entries(r)){let a=y(i);if(a===void 0){s.push(`${n}=${p(i)}`);let o=[];$(A(i),n,0,o),e.push(...o)}else e.push([n,a]),s.push(`${n}=${f(a)}`)}return{errors:e,text:s.join(" ")}},"h"),S=t(r=>j(r).text,"O");export{v as a,j as b,S as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as nt,b as ot}from"./chunk-
|
|
1
|
+
import{a as nt,b as ot}from"./chunk-ZBP4ZBS6.js";import"./chunk-BR2A4DYH.js";import"./chunk-4I23RURI.js";import{d as tt}from"./chunk-D5VO54BI.js";import"./chunk-BOYBN3TE.js";import{a as Ae}from"./chunk-CVSIFPI5.js";import{a as Ze}from"./chunk-KEICHBPK.js";import"./chunk-Y2YLTUMD.js";import"./chunk-YU67D2FL.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import{a as et}from"./chunk-DRHZZ7IN.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import"./chunk-R3RIZDUS.js";import{a as Ye}from"./chunk-5G2OOLMF.js";import{b as Ve}from"./chunk-EDL46BPM.js";import"./chunk-V4D77Q45.js";import{c as Xe,d as we,e as Ne,f as Ee,g as Me}from"./chunk-4KPATTV6.js";import"./chunk-N7FOBAV3.js";import{i as ye}from"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import"./chunk-L27FKJTG.js";import{a as Je}from"./chunk-KFDOGDD2.js";import"./chunk-3OVNOP65.js";import{b as Ge}from"./chunk-FXSY2FCG.js";import{a as ve}from"./chunk-LYVYUTQY.js";import"./chunk-AKC4XWCD.js";import{n as Ce}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as J,h as ge,i as xe,j as Ke,r as Ue,s as le,x as ie}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as Et}from"./chunk-A6TVTNKO.js";import{a as Nt,b as Lt}from"./chunk-ADABTCDI.js";import{a as d,d as De}from"./chunk-5PEAXTYQ.js";var V=De(Et(),1),j=De(Nt(),1);var u=De(Lt(),1);var Se=class{static{d(this,"Diff")}diff(e,n,t={}){let o;typeof t=="function"?(o=t,t={}):"callback"in t&&(o=t.callback);let r=this.castInput(e,t),l=this.castInput(n,t),i=this.removeEmpty(this.tokenize(r,t)),a=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(i,a,t,o)}diffWithOptionsObj(e,n,t,o){var r;let l=d(h=>{if(h=this.postProcess(h,t),o){setTimeout(function(){o(h)},0);return}else return h},"done"),i=n.length,a=e.length,c=1,m=i+a;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let p=(r=t.timeout)!==null&&r!==void 0?r:1/0,f=Date.now()+p,b=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(b[0],n,e,0,t);if(b[0].oldPos+1>=a&&g+1>=i)return l(this.buildValues(b[0].lastComponent,n,e));let k=-1/0,q=1/0,N=d(()=>{for(let h=Math.max(k,-c);h<=Math.min(q,c);h+=2){let S,x=b[h-1],v=b[h+1];x&&(b[h-1]=void 0);let y=!1;if(v){let E=v.oldPos-h;y=v&&0<=E&&E<i}let w=x&&x.oldPos+1<a;if(!y&&!w){b[h]=void 0;continue}if(!w||y&&x.oldPos<v.oldPos?S=this.addToPath(v,!0,!1,0,t):S=this.addToPath(x,!1,!0,1,t),g=this.extractCommon(S,n,e,h,t),S.oldPos+1>=a&&g+1>=i)return l(this.buildValues(S.lastComponent,n,e))||!0;b[h]=S,S.oldPos+1>=a&&(q=Math.min(q,h-1)),g+1>=i&&(k=Math.max(k,h+1))}c++},"execEditLength");if(o)d(function h(){setTimeout(function(){if(c>m||Date.now()>f)return o(void 0);N()||h()},0)},"exec")();else for(;c<=m&&Date.now()<=f;){let h=N();if(h)return h}}addToPath(e,n,t,o,r){let l=e.lastComponent;return l&&!r.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,o,r){let l=n.length,i=t.length,a=e.oldPos,c=a-o,m=0;for(;c+1<l&&a+1<i&&this.equals(t[a+1],n[c+1],r);)c++,a++,m++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!r.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,c}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let o=[],r;for(;e;)o.push(e),r=e.previousComponent,delete e.previousComponent,e=r;o.reverse();let l=o.length,i=0,a=0,c=0;for(;i<l;i++){let m=o[i];if(m.removed)m.value=this.join(t.slice(c,c+m.count)),c+=m.count;else{if(!m.added&&this.useLongestToken){let p=n.slice(a,a+m.count);p=p.map(function(f,b){let g=t[c+b];return g.length>f.length?g:f}),m.value=this.join(p)}else m.value=this.join(n.slice(a,a+m.count));a+=m.count,m.added||(c+=m.count)}}return o}};var $e=class extends Se{static{d(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=_t}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
2
2
|
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
3
3
|
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
4
4
|
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
1
|
+
import{a as _}from"./chunk-X26D3KTK.js";import{b as j}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as J}from"./chunk-UA7DC3LX.js";import"./chunk-KFDOGDD2.js";import{a as E,b as G,c as L,d as I,e as c,f as p}from"./chunk-3OVNOP65.js";import"./chunk-UVMD7C4J.js";import{b as q}from"./chunk-FXSY2FCG.js";import"./chunk-EOFWXI3T.js";import{a as O}from"./chunk-LYVYUTQY.js";import{c as H}from"./chunk-AKC4XWCD.js";import{a as D,e as W}from"./chunk-CB22PV3X.js";import"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as z}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as Q}from"./chunk-A6TVTNKO.js";import{b as V}from"./chunk-ADABTCDI.js";import{a as d,d as F}from"./chunk-5PEAXTYQ.js";var K=F(Q(),1);var r=F(V(),1);var U=["read","insert","update","delete"],M=30,X=d((e,t)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[t],"z"),Y=d(e=>{let t=new Map;for(let s of e){let a=t.get(s.table)??{operations:new Set,procedures:new Set,table:s.table};a.operations.add(s.on),a.procedures.add(s.procedure),t.set(s.table,a)}return[...t.values()].toSorted((s,a)=>s.table.localeCompare(a.table))},"J"),Z=d(e=>{let t=e.slice(0,M).map(s=>`${s.table}: ${U.filter(a=>s.operations.has(a)).join("/")}`).join("; ");return e.length>M?`${t}; and ${String(e.length-M)} more tables`:t},"K"),pe=d(()=>{let e=(0,K.c)(45),t=z(),s=q(),a=s!==void 0&&!s.unavailable,k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];let{data:l,error:C,errorSource:P}=H(O.rlsPolicies,k),o=l!==void 0,m;e[1]!==l?(m=Array.isArray(l?.policies)?l.policies:[],e[1]=l,e[2]=m):m=e[2];let S;e[3]!==m?(S=Y(m),e[3]=m,e[4]=S):S=e[4];let i=S,R;e[5]!==l?(R=Array.isArray(l?.roles)?l.roles:[],e[5]=l,e[6]=R):R=e[6];let T=R,h;e[7]!==C||e[8]!==P?(h=C!==null&&(0,r.jsx)(J,{error:P,testId:"rls-error"}),e[7]=C,e[8]=P,e[9]=h):h=e[9];let u;e[10]!==t?(u=t("Policies"),e[10]=t,e[11]=u):u=e[11];let f;e[12]!==u?(f=(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:u}),e[12]=u,e[13]=f):f=e[13];let b;e[14]!==s||e[15]!==a||e[16]!==o||e[17]!==t||e[18]!==i?(b=o&&a&&(0,r.jsx)("button",{className:"ms-auto text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"rls-ask-assistant",onClick:d(()=>{s.openAssistant({ask:i.length===0?t("This app declares no row-level-security policies at all. Which tables most need one, and what policy should I write for them?"):t("The Lunora RLS inspector shows these declared policies \u2014 {coverage}. Which tables and operations are still unguarded, and what policy should I add?",{coverage:Z(i)}),suggestions:[t("Which procedures still need .use(rls(...))?"),t("How do I test a policy?")],title:t("Access rules")})},"onClick"),type:"button",children:t("Ask the assistant")}),e[14]=s,e[15]=a,e[16]=o,e[17]=t,e[18]=i,e[19]=b):b=e[19];let x;e[20]!==f||e[21]!==b?(x=(0,r.jsxs)("header",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[f,b]}),e[20]=f,e[21]=b,e[22]=x):x=e[22];let g;e[23]!==o||e[24]!==t||e[25]!==i?(g=o&&i.length===0?(0,r.jsx)(_,{description:t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:t("No policies defined")}):(0,r.jsx)(W,{className:"px-0",children:(0,r.jsxs)(E,{"data-testid":"rls-policies-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(I,{children:[(0,r.jsx)(c,{children:t("Table")}),U.map(n=>(0,r.jsx)(c,{children:X(t,n)},n)),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(L,{children:i.map(n=>(0,r.jsxs)(I,{"data-testid":`rls-table-${n.table}`,children:[(0,r.jsx)(p,{className:"font-mono text-xs",children:n.table}),U.map(B=>(0,r.jsx)(p,{children:n.operations.has(B)?(0,r.jsx)(j,{variant:"secondary",children:t("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},B)),(0,r.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:[...n.procedures].join(", ")})]},n.table))})]})}),e[23]=o,e[24]=t,e[25]=i,e[26]=g):g=e[26];let N;e[27]!==x||e[28]!==g?(N=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[x,g]})}),e[27]=x,e[28]=g,e[29]=N):N=e[29];let y;e[30]!==t?(y=t("Roles"),e[30]=t,e[31]=y):y=e[31];let w;e[32]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[32]=y,e[33]=w):w=e[33];let v;e[34]!==o||e[35]!==T||e[36]!==t?(v=o&&T.length===0?(0,r.jsx)(_,{description:t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:t("No roles defined")}):(0,r.jsx)(W,{className:"px-0",children:(0,r.jsxs)(E,{"data-testid":"rls-roles-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(I,{children:[(0,r.jsx)(c,{children:t("Role")}),(0,r.jsx)(c,{children:t("Description")}),(0,r.jsx)(c,{children:t("Permissions")})]})}),(0,r.jsx)(L,{children:T.map(re)})]})}),e[34]=o,e[35]=T,e[36]=t,e[37]=v):v=e[37];let A;e[38]!==w||e[39]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[w,v]})}),e[38]=w,e[39]=v,e[40]=A):A=e[40];let $;return e[41]!==N||e[42]!==A||e[43]!==h?($=(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-rls-panel",children:[h,N,A]}),e[41]=N,e[42]=A,e[43]=h,e[44]=$):$=e[44],$},"ce");function ee(e){return(0,r.jsx)(j,{variant:"outline",children:e},e)}d(ee,"V");function re(e){return(0,r.jsxs)(I,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(p,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(p,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(p,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(ee)})})]},e.name)}d(re,"Y");export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-J7M7G2BA.js";import{a as L}from"./chunk-X26D3KTK.js";import{b as S}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as T,b as k,c as A,d as g,e as c,f as l}from"./chunk-3OVNOP65.js";import"./chunk-EOFWXI3T.js";import{a as C}from"./chunk-LYVYUTQY.js";import{c as w}from"./chunk-AKC4XWCD.js";import{a as I,e as $}from"./chunk-CB22PV3X.js";import"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as b}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as _}from"./chunk-A6TVTNKO.js";import{b as j}from"./chunk-ADABTCDI.js";import{a as f,d as y}from"./chunk-5PEAXTYQ.js";var O=y(_(),1);var t=y(j(),1);var E="container:",M={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},B=f(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"B"),P=f(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(E))continue;let i=a.slice(E.length);if(i==="")continue;let s=JSON.stringify([i,r.instance??""]),o=n.get(s);if(o!==void 0&&o.timestamp>=r.timestamp)continue;let{detail:p,event:d}=B(r.message);n.set(s,{detail:p,event:d,exitCode:r.exitCode,instance:r.instance,level:r.level,name:i,state:M[d]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"D"),W={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},q=f(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"P"),V=f(()=>{let e=(0,O.c)(19),n=b(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:i,error:s,liveError:o}=w(C.getLogs,r,a),p=i!==void 0,d;if(e[2]!==i||e[3]!==s||e[4]!==o||e[5]!==p||e[6]!==n){let N=P(q(i)),x;e[8]!==s?(x=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:s}),e[8]=s,e[9]=x):x=e[9];let m;e[10]!==n?(m=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[10]=n,e[11]=m):m=e[11];let u;e[12]!==m?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;e[14]!==o?(h=(0,t.jsx)(D,{message:o,prefix:"containers"}),e[14]=o,e[15]=h):h=e[15];let v;e[16]!==u||e[17]!==h?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,h]}),e[16]=u,e[17]=h,e[18]=v):v=e[18],d=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[x,v,p&&N.length===0?(0,t.jsx)(L,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(I,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(T,{"data-testid":"containers-table",children:[(0,t.jsx)(k,{children:(0,t.jsxs)(g,{children:[(0,t.jsx)(c,{children:n("Container")}),(0,t.jsx)(c,{children:n("Instance")}),(0,t.jsx)(c,{children:n("State")}),(0,t.jsx)(c,{children:n("Last event")}),(0,t.jsx)(c,{children:n("Detail")}),(0,t.jsx)(c,{children:n("Exit")}),(0,t.jsx)(c,{children:n("When")})]})}),(0,t.jsx)(A,{children:N.map(F)})]})})})]}),e[2]=i,e[3]=s,e[4]=o,e[5]=p,e[6]=n,e[7]=d}else d=e[7];return d},"q");function F(e){return(0,t.jsxs)(g,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(l,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(l,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(l,{children:(0,t.jsx)(S,{variant:W[e.state],children:e.state})}),(0,t.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(l,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(l,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(l,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}f(F,"j");export{V as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as X}from"./chunk-CVSIFPI5.js";import{a as Q}from"./chunk-
|
|
1
|
+
import{a as X}from"./chunk-CVSIFPI5.js";import{a as Q}from"./chunk-KEICHBPK.js";import{d as O}from"./chunk-O5QATFN3.js";import{i as J}from"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as R}from"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import"./chunk-L27FKJTG.js";import"./chunk-LYVYUTQY.js";import"./chunk-AKC4XWCD.js";import"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as H,s as Y,v as G}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as st}from"./chunk-A6TVTNKO.js";import{a as et,b as at}from"./chunk-ADABTCDI.js";import{a as u,d as V}from"./chunk-5PEAXTYQ.js";var B=V(st(),1);var d=V(at(),1);var z=V(et(),1);var nt=u(h=>{let t=(0,B.c)(28),{draft:e,onDraftChange:r,onSend:n,pending:a}=h,l=H(),s;t[0]!==l?(s=l("Ask about your data"),t[0]=l,t[1]=s):s=t[1];let o;t[2]!==r?(o=u(v=>{r(v.target.value)},"o"),t[2]=r,t[3]=o):o=t[3];let i;t[4]!==n?(i=u(v=>{v.key==="Enter"&&(v.preventDefault(),n())},"r"),t[4]=n,t[5]=i):i=t[5];let c;t[6]!==l?(c=l("Ask about your data"),t[6]=l,t[7]=c):c=t[7];let p;t[8]!==e||t[9]!==a||t[10]!==s||t[11]!==o||t[12]!==i||t[13]!==c?(p=(0,d.jsx)(J,{"aria-label":s,"data-testid":"assistant-input",disabled:a,onChange:o,onKeyDown:i,placeholder:c,value:e}),t[8]=e,t[9]=a,t[10]=s,t[11]=o,t[12]=i,t[13]=c,t[14]=p):p=t[14];let x;t[15]!==e||t[16]!==a?(x=a||e.trim()==="",t[15]=e,t[16]=a,t[17]=x):x=t[17];let m;t[18]!==a||t[19]!==l?(m=l(a?"Thinking\u2026":"Send"),t[18]=a,t[19]=l,t[20]=m):m=t[20];let f;t[21]!==n||t[22]!==x||t[23]!==m?(f=(0,d.jsx)(R,{"data-testid":"assistant-send",disabled:x,onClick:n,size:"xs",type:"button",children:m}),t[21]=n,t[22]=x,t[23]=m,t[24]=f):f=t[24];let g;return t[25]!==p||t[26]!==f?(g=(0,d.jsxs)("div",{className:"flex items-center gap-2 border-t border-border px-3 py-2",children:[p,f]}),t[25]=p,t[26]=f,t[27]=g):g=t[27],g},"nt"),lt=u(h=>{let t=(0,B.c)(17),{onClose:e}=h,r=H(),n;t[0]!==r?(n=r("Assistant"),t[0]=r,t[1]=n):n=t[1];let a;t[2]!==n?(a=(0,d.jsx)("span",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:n}),t[2]=n,t[3]=a):a=t[3];let l;t[4]!==r?(l=r("Answers are suggestions \u2014 nothing runs until you insert and run it."),t[4]=r,t[5]=l):l=t[5];let s;t[6]!==l?(s=(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l}),t[6]=l,t[7]=s):s=t[7];let o;t[8]!==r?(o=r("Close assistant"),t[8]=r,t[9]=o):o=t[9];let i;t[10]!==e||t[11]!==o?(i=(0,d.jsx)(R,{"aria-label":o,className:"ms-auto","data-testid":"assistant-close",onClick:e,size:"xs",type:"button",variant:"ghost",children:"\xD7"}),t[10]=e,t[11]=o,t[12]=i):i=t[12];let c;return t[13]!==a||t[14]!==s||t[15]!==i?(c=(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[a,s,i]}),t[13]=a,t[14]=s,t[15]=i,t[16]=c):c=t[16],c},"lt"),ot={img:u(()=>null,"img")},Z=u(h=>{let t=(0,B.c)(2),{text:e}=h,r;return t[0]!==e?(r=(0,d.jsx)("div",{className:"prose-sm max-w-none text-xs","data-testid":"assistant-turn-body",children:(0,d.jsx)(O,{components:ot,children:e})}),t[0]=e,t[1]=r):r=t[1],r},"U"),_=u(h=>{let t=(0,B.c)(6),{children:e,label:r,testId:n}=h,a;t[0]!==r?(a=(0,d.jsx)("span",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:r}),t[0]=r,t[1]=a):a=t[1];let l;return t[2]!==e||t[3]!==a||t[4]!==n?(l=(0,d.jsxs)("li",{className:"flex flex-col gap-1 border-b border-border px-3 py-2 last:border-b-0","data-testid":n,children:[a,e]}),t[2]=e,t[3]=a,t[4]=n,t[5]=l):l=t[5],l},"W"),rt=u(h=>{let t=(0,B.c)(7),{text:e}=h,r=H(),n;t[0]!==r?(n=r("Assistant"),t[0]=r,t[1]=n):n=t[1];let a;t[2]!==e?(a=(0,d.jsx)(Z,{text:e}),t[2]=e,t[3]=a):a=t[3];let l;return t[4]!==n||t[5]!==a?(l=(0,d.jsx)(_,{label:n,testId:"assistant-turn-live",children:a}),t[4]=n,t[5]=a,t[6]=l):l=t[6],l},"ot"),it=u(h=>{let t=(0,B.c)(20),{activeId:e,onDelete:r,onNew:n,onSelect:a,sessions:l}=h,s=H(),o;if(t[0]!==e||t[1]!==r||t[2]!==a||t[3]!==l||t[4]!==s){let x;t[6]!==e||t[7]!==r||t[8]!==a||t[9]!==l.length||t[10]!==s?(x=u(m=>(0,d.jsxs)("span",{className:"flex shrink-0 items-center",children:[(0,d.jsx)(R,{"data-testid":"assistant-session",onClick:u(()=>{a(m.id)},"onClick"),size:"xs",type:"button",variant:m.id===e?"secondary":"ghost",children:m.name}),l.length>1&&(0,d.jsx)(R,{"aria-label":s("Close chat"),"data-testid":"assistant-session-close",onClick:u(()=>{r(m.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:"\xD7"})]},m.id),"p"),t[6]=e,t[7]=r,t[8]=a,t[9]=l.length,t[10]=s,t[11]=x):x=t[11],o=l.map(x),t[0]=e,t[1]=r,t[2]=a,t[3]=l,t[4]=s,t[5]=o}else o=t[5];let i;t[12]!==s?(i=s("New chat"),t[12]=s,t[13]=i):i=t[13];let c;t[14]!==n||t[15]!==i?(c=(0,d.jsx)(R,{"aria-label":i,className:"shrink-0","data-testid":"assistant-session-new",onClick:n,size:"xs",type:"button",variant:"ghost",children:"+"}),t[14]=n,t[15]=i,t[16]=c):c=t[16];let p;return t[17]!==o||t[18]!==c?(p=(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-2 py-1","data-testid":"assistant-sessions",children:[o,c]}),t[17]=o,t[18]=c,t[19]=p):p=t[19],p},"at"),dt=u(h=>{let t=(0,B.c)(9),{reason:e,truncated:r}=h,n=H(),a;t[0]!==n||t[1]!==r?(a=r&&(0,d.jsx)("p",{className:"px-3 py-1 text-[11px] text-muted-foreground","data-testid":"assistant-truncated",children:n("Older turns were dropped to fit the context budget.")}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let l;t[3]!==e||t[4]!==n?(l=e!==void 0&&(0,d.jsx)("p",{className:"px-3 py-1 text-[11px] text-destructive","data-testid":"assistant-error",children:X(e,n)}),t[3]=e,t[4]=n,t[5]=l):l=t[5];let s;return t[6]!==a||t[7]!==l?(s=(0,d.jsxs)(d.Fragment,{children:[a,l]}),t[6]=a,t[7]=l,t[8]=s):s=t[8],s},"rt"),ct=u(h=>{let t=(0,B.c)(12),{onPick:e,suggestions:r}=h,n=H(),a;t[0]!==n?(a=n("Try asking"),t[0]=n,t[1]=a):a=t[1];let l;t[2]!==a?(l=(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground",children:a}),t[2]=a,t[3]=l):l=t[3];let s;if(t[4]!==e||t[5]!==r){let i;t[7]!==e?(i=u(c=>(0,d.jsx)("button",{className:"self-start rounded-md border border-border px-2 py-1 text-start text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"assistant-suggestion",onClick:u(()=>{e(c)},"onClick"),type:"button",children:c},c),"r"),t[7]=e,t[8]=i):i=t[8],s=r.map(i),t[4]=e,t[5]=r,t[6]=s}else s=t[6];let o;return t[9]!==l||t[10]!==s?(o=(0,d.jsxs)("div",{className:"flex flex-col gap-1 px-3 py-2","data-testid":"assistant-suggestions",children:[l,s]}),t[9]=l,t[10]=s,t[11]=o):o=t[11],o},"dt"),L="```",ut=u(h=>{if(h.startsWith(L))return h.slice(L.length).trim().toLowerCase()==="sql"?"sql":"foreign"},"ct"),pt=u(h=>{let t=[],e=h.split(`
|
|
2
2
|
`),r,n=!1;for(let a of e){let l=a.trim();if(n){n=l!==L;continue}if(r===void 0){let s=ut(l);s==="sql"?r=[]:s==="foreign"&&(n=!0);continue}if(l===L){let s=r.join(`
|
|
3
3
|
`).trim();s!==""&&t.push(s),r=void 0;continue}r.push(a)}return t},"ft"),mt=u(h=>{let t=(0,B.c)(29),{approval:e,onDecide:r}=h,n=H(),a;t[0]!==n?(a=n("The assistant wants to read rows before answering. Nothing runs until you allow it."),t[0]=n,t[1]=a):a=t[1];let l;t[2]!==a?(l=(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground",children:a}),t[2]=a,t[3]=l):l=t[3];let s;t[4]!==e.sql?(s=(0,d.jsx)("pre",{className:"overflow-x-auto rounded bg-background p-1.5 font-mono text-[11px]","data-testid":"assistant-approval-sql",children:e.sql}),t[4]=e.sql,t[5]=s):s=t[5];let o;t[6]!==e||t[7]!==r?(o=u(()=>{r(!0,e)},"o"),t[6]=e,t[7]=r,t[8]=o):o=t[8];let i;t[9]!==n?(i=n("Allow"),t[9]=n,t[10]=i):i=t[10];let c;t[11]!==o||t[12]!==i?(c=(0,d.jsx)(R,{"data-testid":"assistant-approval-allow",onClick:o,size:"xs",type:"button",children:i}),t[11]=o,t[12]=i,t[13]=c):c=t[13];let p;t[14]!==e||t[15]!==r?(p=u(()=>{r(!1,e)},"f"),t[14]=e,t[15]=r,t[16]=p):p=t[16];let x;t[17]!==n?(x=n("Deny"),t[17]=n,t[18]=x):x=t[18];let m;t[19]!==p||t[20]!==x?(m=(0,d.jsx)(R,{"data-testid":"assistant-approval-deny",onClick:p,size:"xs",type:"button",variant:"secondary",children:x}),t[19]=p,t[20]=x,t[21]=m):m=t[21];let f;t[22]!==c||t[23]!==m?(f=(0,d.jsxs)("div",{className:"flex gap-2",children:[c,m]}),t[22]=c,t[23]=m,t[24]=f):f=t[24];let g;return t[25]!==f||t[26]!==l||t[27]!==s?(g=(0,d.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-md border border-border bg-muted/40 p-2","data-testid":"assistant-approval",children:[l,s,f]}),t[25]=f,t[26]=l,t[27]=s,t[28]=g):g=t[28],g},"ut"),xt=u(h=>{let t=(0,B.c)(15),{level:e,turn:r}=h,n=H(),a;t[0]!==r.toolCalls?(a=r.toolCalls??[],t[0]=r.toolCalls,t[1]=a):a=t[1];let l=a;if(l.length===0&&r.partial!==!0)return null;let s;if(t[2]!==l||t[3]!==e||t[4]!==n){let c;t[6]!==e||t[7]!==n?(c=u((p,x)=>(0,d.jsxs)("li",{children:[(0,d.jsx)("span",{className:"font-mono",children:p.name??n("(no such tool)")}),p.sql===void 0?null:(0,d.jsx)("span",{className:"ms-1 font-mono opacity-80",children:p.sql}),p.refused===void 0?null:(0,d.jsx)("span",{className:"ms-1 text-destructive",children:n("refused")}),p.needs===void 0?null:(0,d.jsx)("span",{className:"block text-muted-foreground","data-testid":"assistant-tool-needs",children:n("Needs the {needs} data-sharing level; this deployment is set to {level}. Change LUNORA_AI_OPT_IN in wrangler.jsonc.",{level:e??n("a lower level"),needs:p.needs})})]},`${String(x)}:${p.name??"?"}`),"d"),t[6]=e,t[7]=n,t[8]=c):c=t[8],s=l.map(c),t[2]=l,t[3]=e,t[4]=n,t[5]=s}else s=t[5];let o;t[9]!==n||t[10]!==r.partial?(o=r.partial===!0&&(0,d.jsx)("li",{"data-testid":"assistant-turn-partial",children:n("Stopped early \u2014 this answer is incomplete.")}),t[9]=n,t[10]=r.partial,t[11]=o):o=t[11];let i;return t[12]!==s||t[13]!==o?(i=(0,d.jsxs)("ul",{className:"flex flex-col gap-0.5 border-s border-border ps-2 text-[11px] text-muted-foreground","data-testid":"assistant-tool-calls",children:[s,o]}),t[12]=s,t[13]=o,t[14]=i):i=t[14],i},"pt"),ht=u(h=>{let t=(0,B.c)(60),{index:e,level:r,onBranch:n,onDecide:a,onInsert:l,onTruncate:s,turn:o}=h,i=H(),c,p,x,m,f;if(t[0]!==l||t[1]!==i||t[2]!==o.role||t[3]!==o.text){let $=o.role==="assistant"&&l!==void 0?pt(o.text):[];c=_,t[9]!==i||t[10]!==o.role?(p=o.role==="user"?i("You"):i("Assistant"),t[9]=i,t[10]=o.role,t[11]=p):p=t[11],x=`assistant-turn-${o.role}`,t[12]!==o.role||t[13]!==o.text?(m=o.role==="assistant"?(0,d.jsx)(Z,{text:o.text}):(0,d.jsx)("p",{className:"text-xs whitespace-pre-wrap","data-testid":"assistant-turn-body",children:o.text}),t[12]=o.role,t[13]=o.text,t[14]=m):m=t[14];let F;t[15]!==l||t[16]!==i?(F=u((T,j)=>(0,d.jsx)(R,{className:"self-start","data-testid":"assistant-insert",onClick:u(()=>{l?.(T)},"onClick"),size:"xs",type:"button",variant:"secondary",children:i("Insert into editor")},`${String(j)}:${T.slice(0,32)}`),"R"),t[15]=l,t[16]=i,t[17]=F):F=t[17],f=$.map(F),t[0]=l,t[1]=i,t[2]=o.role,t[3]=o.text,t[4]=c,t[5]=p,t[6]=x,t[7]=m,t[8]=f}else c=t[4],p=t[5],x=t[6],m=t[7],f=t[8];let g;t[18]!==a||t[19]!==o.pendingApproval?(g=o.pendingApproval!==void 0&&a!==void 0&&(0,d.jsx)(mt,{approval:o.pendingApproval,onDecide:a}),t[18]=a,t[19]=o.pendingApproval,t[20]=g):g=t[20];let v;t[21]!==r||t[22]!==o?(v=o.role==="assistant"&&(0,d.jsx)(xt,{level:r,turn:o}),t[21]=r,t[22]=o,t[23]=v):v=t[23];let S;t[24]!==o.text?(S=u(()=>{G(o.text)},"q"),t[24]=o.text,t[25]=S):S=t[25];let q;t[26]!==i?(q=i("Copy"),t[26]=i,t[27]=q):q=t[27];let k;t[28]!==S||t[29]!==q?(k=(0,d.jsx)("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"assistant-copy",onClick:S,type:"button",children:q}),t[28]=S,t[29]=q,t[30]=k):k=t[30];let y;t[31]!==e||t[32]!==n?(y=u(()=>{n(e)},"y"),t[31]=e,t[32]=n,t[33]=y):y=t[33];let b;t[34]!==i?(b=i("Branch from here"),t[34]=i,t[35]=b):b=t[35];let w;t[36]!==y||t[37]!==b?(w=(0,d.jsx)("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"assistant-branch",onClick:y,type:"button",children:b}),t[36]=y,t[37]=b,t[38]=w):w=t[38];let N;t[39]!==e||t[40]!==s?(N=u(()=>{s(e)},"k"),t[39]=e,t[40]=s,t[41]=N):N=t[41];let I;t[42]!==i?(I=i("Delete from here"),t[42]=i,t[43]=I):I=t[43];let A;t[44]!==N||t[45]!==I?(A=(0,d.jsx)("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"assistant-truncate",onClick:N,type:"button",children:I}),t[44]=N,t[45]=I,t[46]=A):A=t[46];let C;t[47]!==w||t[48]!==A||t[49]!==k?(C=(0,d.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[k,w,A]}),t[47]=w,t[48]=A,t[49]=k,t[50]=C):C=t[50];let P;return t[51]!==c||t[52]!==p||t[53]!==C||t[54]!==x||t[55]!==m||t[56]!==f||t[57]!==g||t[58]!==v?(P=(0,d.jsxs)(c,{label:p,testId:x,children:[m,f,g,v,C]}),t[51]=c,t[52]=p,t[53]=C,t[54]=x,t[55]=m,t[56]=f,t[57]=g,t[58]=v,t[59]=P):P=t[59],P},"ht"),ft=u(({assistant:h,ops:t,session:e})=>{let[r,n]=(0,z.useState)(""),[a,l]=(0,z.useState)(e?.id);e?.id!==a&&(l(e?.id),n(""));let[s,o]=(0,z.useState)(void 0),[i,c]=(0,z.useState)(void 0),[p,x]=(0,z.useState)(void 0),[m,f]=(0,z.useState)(void 0),g=(0,z.useRef)(void 0);(0,z.useEffect)(()=>()=>{g.current?.abort()},[]);let v=t.pending("chat"),S=t.reason("chat"),{setTurns:q,takeAsk:k,unavailable:y}=h,b=e?.id,w=S==="ai-disabled"||S==="no-ai-binding"||p===b?S:void 0,N=u(T=>{b!==void 0&&h.branchFrom(b,T)},"k"),I=u(T=>{b!==void 0&&h.truncateFrom(b,T)},"A"),A=u((T,j,K)=>{if(T===""||v||g.current!==void 0||e===void 0)return;let E=new AbortController;g.current=E;let W={role:"user",text:T},tt=[...j,W];q(e.id,tt),o({sessionId:e.id,text:""}),x(e.id),Y(t.chat(T,j.map(D=>({role:D.role,text:D.text})),e.schema,K,D=>{o(M=>M?.sessionId===e.id?{sessionId:e.id,text:D.type==="delta"?`${M.text}${D.text}`:""}:M)},E.signal).then(D=>{if(D!==void 0&&!E.signal.aborted){c(D.truncated?e.id:void 0);let M={partial:D.partial,...D.pendingApproval===void 0?{}:{pendingApproval:D.pendingApproval},role:"assistant",text:D.reply,toolCalls:D.toolCalls};q(e.id,U=>U.at(-1)===W?[...U,M]:U)}return D}).finally(()=>{g.current=void 0,o(void 0)}))},"I"),C=u(T=>{let j=(T??r).trim();j===""||v||g.current!==void 0||e===void 0||(n(""),A(j,e.turns))},"C"),P=u((T,j)=>{if(e===void 0||v||g.current!==void 0)return;let K=e.turns.slice(0,-1),E=K.at(-1);E?.role==="user"&&A(E.text,K.slice(0,-1),{allow:T,sql:j.sql,ticket:j.ticket})},"F"),$=h.draft;$!==void 0&&$.id!==m&&(f($.id),n($.text));let F=h.pendingAsk;return(0,z.useEffect)(()=>{F===void 0||F.sessionId!==b||v||y||(k(F.id),queueMicrotask(()=>{C(F.text)}))},[F,b,k,v,y]),{branchHere:N,decide:P,draft:r,live:s,pending:v,reason:w,send:C,setDraft:n,truncatedFor:i,truncateHere:I}},"mt"),Zt=u(h=>{let t=(0,B.c)(39),{assistant:e}=h,r=H(),n;t[0]!==e.activeId?(n=u(C=>C.id===e.activeId,"l"),t[0]=e.activeId,t[1]=n):n=t[1];let a=e.sessions.find(n),l=Q(a?.shardKey??""),s=ft({assistant:e,ops:l,session:a});if(l.unavailable||a===void 0)return null;let{turns:o}=a,i;t[2]!==r?(i=r("Assistant"),t[2]=r,t[3]=i):i=t[3];let c="flex h-full w-96 min-w-0 shrink-0 flex-col border-s border-border bg-card",p="assistant-panel",x;t[4]!==e.close?(x=(0,d.jsx)(lt,{onClose:e.close}),t[4]=e.close,t[5]=x):x=t[5];let m;t[6]!==e||t[7]!==r?(m=u(()=>{e.newChat({title:r("New chat")})},"u"),t[6]=e,t[7]=r,t[8]=m):m=t[8];let f;t[9]!==e.activeId||t[10]!==e.deleteChat||t[11]!==e.selectChat||t[12]!==e.sessions||t[13]!==m?(f=(0,d.jsx)(it,{activeId:e.activeId,onDelete:e.deleteChat,onNew:m,onSelect:e.selectChat,sessions:e.sessions}),t[9]=e.activeId,t[10]=e.deleteChat,t[11]=e.selectChat,t[12]=e.sessions,t[13]=m,t[14]=f):f=t[14];let g=o.length===0&&a.suggestions.length>0&&(0,d.jsx)(ct,{onPick:u(C=>{s.send(C)},"onPick"),suggestions:a.suggestions}),v="min-h-0 flex-1 overflow-y-auto",S="assistant-turns",q=o.map((C,P)=>(0,d.jsx)(ht,{index:P,level:l.level,onBranch:s.branchHere,onDecide:P===o.length-1?s.decide:void 0,onInsert:e.hasEditor?e.requestInsert:void 0,onTruncate:s.truncateHere,turn:C},`${String(P)}:${C.role}`)),k;t[15]!==s.live||t[16]!==a.id?(k=s.live?.sessionId===a.id&&s.live.text!==""&&(0,d.jsx)(rt,{text:s.live.text}),t[15]=s.live,t[16]=a.id,t[17]=k):k=t[17];let y;t[18]!==q||t[19]!==k?(y=(0,d.jsxs)("ul",{className:v,"data-testid":S,children:[q,k]}),t[18]=q,t[19]=k,t[20]=y):y=t[20];let b=s.truncatedFor===a.id,w;t[21]!==s.reason||t[22]!==b?(w=(0,d.jsx)(dt,{reason:s.reason,truncated:b}),t[21]=s.reason,t[22]=b,t[23]=w):w=t[23];let N;t[24]!==s?(N=u(()=>{s.send()},"k"),t[24]=s,t[25]=N):N=t[25];let I;t[26]!==s.draft||t[27]!==s.pending||t[28]!==s.setDraft||t[29]!==N?(I=(0,d.jsx)(nt,{draft:s.draft,onDraftChange:s.setDraft,onSend:N,pending:s.pending}),t[26]=s.draft,t[27]=s.pending,t[28]=s.setDraft,t[29]=N,t[30]=I):I=t[30];let A;return t[31]!==y||t[32]!==w||t[33]!==I||t[34]!==i||t[35]!==x||t[36]!==f||t[37]!==g?(A=(0,d.jsxs)("section",{"aria-label":i,className:c,"data-testid":p,children:[x,f,g,y,w,I]}),t[31]=y,t[32]=w,t[33]=I,t[34]=i,t[35]=x,t[36]=f,t[37]=g,t[38]=A):A=t[38],A},"It");export{Zt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u,s as f}from"./chunk-
|
|
1
|
+
import{j as u,s as f}from"./chunk-4S7ZIMWI.js";import{a as S}from"./chunk-A6TVTNKO.js";import{a as h}from"./chunk-ADABTCDI.js";import{a as s,d as l}from"./chunk-5PEAXTYQ.js";var i=l(S(),1),c=l(h(),1);var g=s(()=>{let t=(0,i.c)(4),[a,n]=(0,c.useState)(!1),[e,m]=(0,c.useState)(null),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(p=>{f((async()=>{n(!0),m(null);try{await p()}catch(b){m(u(b))}n(!1)})())},"e"),t[0]=r):r=t[0];let y=r,o;return t[1]!==a||t[2]!==e?(o={busy:a,error:e,run:y},t[1]=a,t[2]=e,t[3]=o):o=t[3],o},"g");export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-JLPBW5EC.js";import"./chunk-BR2A4DYH.js";import{a as k}from"./chunk-66PQJM66.js";import"./chunk-QLZGKBOW.js";import"./chunk-Y2YLTUMD.js";import"./chunk-R3RIZDUS.js";import{a as A}from"./chunk-2KTN53PK.js";import{a as $}from"./chunk-5G2OOLMF.js";import"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import"./chunk-OZID3UYF.js";import{a as E}from"./chunk-X26D3KTK.js";import{b as j}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as F}from"./chunk-UA7DC3LX.js";import"./chunk-KFDOGDD2.js";import"./chunk-UVMD7C4J.js";import"./chunk-FXSY2FCG.js";import"./chunk-EOFWXI3T.js";import{a as S}from"./chunk-LYVYUTQY.js";import{c as I}from"./chunk-AKC4XWCD.js";import{a as w,e as O}from"./chunk-CB22PV3X.js";import"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as T,w as C}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as D}from"./chunk-A6TVTNKO.js";import{b as H}from"./chunk-ADABTCDI.js";import{a as p,d as _}from"./chunk-5PEAXTYQ.js";var K=_(D(),1);var m=_(H(),1);var L=p(s=>s.length===0?void 0:{max:Math.max(...s),mean:s.reduce((e,t)=>e+t,0)/s.length,min:Math.min(...s)},"F"),B=/^gen_ai\.evaluation\.(.+)\.score$/u,P=p(s=>{let e=[];for(let t of s)for(let n of t.spans)for(let[a,l]of Object.entries(n.attributes??{})){let o=B.exec(a);if(!o||typeof l!="number")continue;let i=o[1],c=n.attributes?.[`gen_ai.evaluation.${i}.label`];e.push({...typeof c=="string"?{label:c}:{},name:i,score:l,spanName:n.name,startTs:t.startTs+n.offsetMs,traceId:t.traceId})}return e.toSorted((t,n)=>n.startTs-t.startTs)},"q"),Q=p(s=>{let e=[];for(let t of s?.series??[]){let n=B.exec(t.name);n&&e.push({name:n[1],points:t.points})}return e},"D"),R=p((s,e)=>{let t=new Set([...s.map(a=>a.name),...e.map(a=>a.name)]),n=[];for(let a of t){let l=s.filter(r=>r.name===a),o=e.find(r=>r.name===a)?.points??[],i=o.at(-1)?.last??l[0]?.score,c=o.length>0?{max:Math.max(...o.map(r=>r.max)),mean:o.reduce((r,d)=>r+d.sum,0)/o.reduce((r,d)=>r+d.count,0),min:Math.min(...o.map(r=>r.min))}:L(l.map(r=>r.score));n.push({...i===void 0?{}:{latest:i},...c,name:a,points:o,runs:l})}return n.toSorted((a,l)=>a.name.localeCompare(l.name))},"H"),U=p(s=>Array.isArray(s?.traces)?s.traces:[],"L"),N=p(s=>s===void 0?"\u2014":s.toFixed(2),"y"),z=p(s=>{let e=(0,K.c)(34),{card:t,onOpenTrace:n}=s,a=T(),l;e[0]!==t.name?(l=(0,m.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"ev-name",children:t.name}),e[0]=t.name,e[1]=l):l=e[1];let o;e[2]!==t.latest?(o=N(t.latest),e[2]=t.latest,e[3]=o):o=e[3];let i;e[4]!==o?(i=(0,m.jsx)("span",{className:"font-mono text-lg text-foreground","data-testid":"ev-latest",children:o}),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==l||e[7]!==i?(c=(0,m.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[l,i]}),e[6]=l,e[7]=i,e[8]=c):c=e[8];let r;e[9]!==t.max||e[10]!==t.mean||e[11]!==t.min||e[12]!==a?(r=a("min {min} \xB7 mean {mean} \xB7 max {max}",{max:N(t.max),mean:N(t.mean),min:N(t.min)}),e[9]=t.max,e[10]=t.mean,e[11]=t.min,e[12]=a,e[13]=r):r=e[13];let d;e[14]!==r?(d=(0,m.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"ev-summary",children:r}),e[14]=r,e[15]=d):d=e[15];let u;e[16]!==t.name||e[17]!==t.points||e[18]!==a?(u=t.points.length>1?(0,m.jsx)(q,{ariaLabel:a("Score trend for {name}",{name:t.name}),className:"h-10 w-full",series:t.points.map(G),testId:"ev-trend"}):(0,m.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ev-no-trend",children:a("No durable history yet \u2014 pass ctx.metrics to recordEvaluation to chart a trend.")}),e[16]=t.name,e[17]=t.points,e[18]=a,e[19]=u):u=e[19];let h;if(e[20]!==t.runs||e[21]!==n||e[22]!==a){let v;e[24]!==n||e[25]!==a?(v=p(f=>(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2 font-mono text-xs","data-testid":"ev-run",children:[(0,m.jsxs)("span",{className:"truncate text-muted-foreground",children:[C(f.startTs)," \xB7 ",f.spanName]}),(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[f.label===void 0?null:(0,m.jsx)(j,{variant:"outline",children:f.label}),(0,m.jsx)("span",{className:"text-foreground",children:N(f.score)}),n===void 0?null:(0,m.jsx)("button",{className:"text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{n(f.traceId)},"onClick"),title:a("Open the trace {trace}",{trace:f.traceId}),type:"button",children:f.traceId.slice(0,8)})]})]},`${f.traceId}:${f.spanName}`),"x"),e[24]=n,e[25]=a,e[26]=v):v=e[26],h=t.runs.slice(0,5).map(v),e[20]=t.runs,e[21]=n,e[22]=a,e[23]=h}else h=e[23];let x;e[27]!==h?(x=(0,m.jsx)("div",{className:"flex flex-col gap-1",children:h}),e[27]=h,e[28]=x):x=e[28];let g;return e[29]!==c||e[30]!==d||e[31]!==u||e[32]!==x?(g=(0,m.jsx)(w,{"data-testid":"ev-card",children:(0,m.jsxs)(O,{className:"flex flex-col gap-3 p-4",children:[c,d,u,x]})}),e[29]=c,e[30]=d,e[31]=u,e[32]=x,e[33]=g):g=e[33],g},"P"),oe=p(s=>{let e=(0,K.c)(21),{initialShardKey:t}=s,n=T(),{queryShardKey:a,setShardKey:l,shardKey:o}=A(t),i=k(a),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let r;e[1]!==a?(r={live:!0,shardKey:a},e[1]=a,e[2]=r):r=e[2];let{data:d,error:u}=I(S.getTraces,c,r),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let x;e[4]!==a?(x={live:!0,shardKey:a},e[4]=a,e[5]=x):x=e[5];let{data:g}=I(S.getMetricHistory,h,x),v;if(e[6]!==d||e[7]!==u||e[8]!==g||e[9]!==i||e[10]!==a||e[11]!==l||e[12]!==o||e[13]!==n){let f=R(P(U(d)),Q(g)),y;e[15]!==l||e[16]!==o?(y=(0,m.jsx)($,{onChange:l,testId:"ev-shard-input",value:o}),e[15]=l,e[16]=o,e[17]=y):y=e[17];let b;e[18]!==u||e[19]!==a?(b=u===null?null:(0,m.jsx)(F,{error:u,shardKey:a,testId:"ev-error"}),e[18]=u,e[19]=a,e[20]=b):b=e[20],v=(0,m.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ev-panel",children:[y,b,f.length===0?(0,m.jsx)(E,{description:n("Call recordEvaluation from a graded run and its score shows up here."),testId:"ev-empty",title:n("No evals recorded")}):(0,m.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(M=>(0,m.jsx)(z,{card:M,onOpenTrace:i},M.name))})]}),e[6]=d,e[7]=u,e[8]=g,e[9]=i,e[10]=a,e[11]=l,e[12]=o,e[13]=n,e[14]=v}else v=e[14];return v},"re");function G(s){return s.last}p(G,"Q");export{oe as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as fe}from"./chunk-
|
|
1
|
+
import{a as fe}from"./chunk-VONBNFUJ.js";import"./chunk-T7UKRA6J.js";import{a as ie}from"./chunk-LMCBMC2V.js";import{a as de}from"./chunk-W5LH6U6X.js";import"./chunk-OWRWDDJT.js";import{i as me}from"./chunk-A5INOAIL.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as b}from"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as ue}from"./chunk-X26D3KTK.js";import{b as he}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as pe}from"./chunk-UA7DC3LX.js";import"./chunk-KFDOGDD2.js";import"./chunk-UVMD7C4J.js";import"./chunk-FXSY2FCG.js";import"./chunk-EOFWXI3T.js";import{a as H}from"./chunk-LYVYUTQY.js";import{c as oe}from"./chunk-AKC4XWCD.js";import{n as se}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as ce,h as Z,i as ee,j as te,s as ae,v as le,w as re,x as ne}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as ve}from"./chunk-A6TVTNKO.js";import{a as ge,b as Ne}from"./chunk-ADABTCDI.js";import{a as l,d as Y}from"./chunk-5PEAXTYQ.js";var t=Y(Ne(),1);var be=Y(ve(),1),v=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:ne("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}l(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,xe=l(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),N=l(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"v"),Ce=/<a\s(?:[^>]*?\s)?href\s*=\s*["'](https?:\/\/[^"'\s]+)["']/iu,ke=/&(?:amp|#0*38|#x0*26);/giu,Se=l(a=>a===void 0?void 0:((a.html===void 0?void 0:Ce.exec(a.html)?.[1])??xe(a.text)??xe(a.html))?.replaceAll(ke,"&"),"ye"),Te=l((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${N(o.to)} ${N(o.cc)}`.toLowerCase().includes(s))},"Ce"),je=l((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"Se"),Le=Z(H.clearCapturedMail),_e=Z(H.sendTestMail),Me=l(a=>{let e=(0,be.c)(36),{limit:s}=a,o=se(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:I,error:y,errorSource:w,isLoading:g,poll:P,refetch:c}=oe(H.getCapturedMail,p),[C,f]=(0,v.useState)(null),[q,k]=(0,v.useState)(null),[i,h]=(0,v.useState)("html"),[x,B]=(0,v.useState)(""),r=I?.entries??[],m=y??C,D=y===null?C:w,S;e[2]!==o||e[3]!==c?(S=l(async()=>{f(null);try{await o.query(Le,{},ee("")),k(null),c()}catch(d){f(te(d))}},"S"),e[2]=o,e[3]=c,e[4]=S):S=e[4];let R=S,T;e[5]!==o||e[6]!==c?(T=l(async()=>{f(null);try{await o.query(_e,{},ee("")),c()}catch(d){f(te(d))}},"T"),e[5]=o,e[6]=c,e[7]=T):T=e[7];let Q=T;de(P,!0);let j;e[8]!==R?(j=l(()=>{ae(R())},"k"),e[8]=R,e[9]=j):j=e[9];let U=j,L;e[10]!==Q?(L=l(()=>{ae(Q())},"A"),e[10]=Q,e[11]=L):L=e[11];let W=L,_;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=l(d=>{B(d.currentTarget.value)},"E"),e[12]=_):_=e[12];let G=_,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=l(d=>{let{id:u}=d.currentTarget.dataset;u!==void 0&&k(u)},"_"),e[13]=M):M=e[13];let J=M,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=l(d=>{let u=d.currentTarget.dataset.tab;(u==="headers"||u==="html"||u==="text")&&h(u)},"L"),e[14]=z):z=e[14];let K=z,$=Te(r,x),A=je($,q),n=Se(A),O;e[15]!==n?(O=l(()=>{n!==void 0&&le(n)},"j"),e[15]=n,e[16]=O):O=e[16];let V=O,F;e[17]!==n?(F=l(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"$"),e[17]=n,e[18]=F):F=e[18];let X=F,E;return e[19]!==r||e[20]!==m||e[21]!==D||e[22]!==x||e[23]!==g||e[24]!==n||e[25]!==U||e[26]!==V||e[27]!==G||e[28]!==X||e[29]!==J||e[30]!==K||e[31]!==W||e[32]!==A||e[33]!==i||e[34]!==$?(E={entries:r,error:m,errorSource:D,filter:x,isLoading:g,link:n,onClear:U,onCopyLink:V,onFilterChange:G,onOpenLink:X,onSelectMessage:J,onSelectTab:K,onSendTest:W,selected:A,tab:i,visible:$},e[19]=r,e[20]=m,e[21]=D,e[22]=x,e[23]=g,e[24]=n,e[25]=U,e[26]=V,e[27]=G,e[28]=X,e[29]=J,e[30]=K,e[31]=W,e[32]=A,e[33]=i,e[34]=$,e[35]=E):E=e[35],E},"Ae"),ze=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,$e=l(a=>`${ze}${a}`,"_e"),Ke=l(({limit:a=100})=>{let e=ce(),{entries:s,error:o,errorSource:p,filter:I,isLoading:y,link:w,onClear:g,onCopyLink:P,onFilterChange:c,onOpenLink:C,onSelectMessage:f,onSelectTab:q,onSendTest:k,selected:i,tab:h,visible:x}=Me({limit:a}),B=l(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"H");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b,{"data-testid":"mail-send-test",onClick:k,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(b,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(he,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(pe,{error:p,testId:"mail-error"}),o===null&&!y&&s.length===0&&(0,t.jsx)(ue,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(me,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:c,placeholder:e("Filter messages"),type:"search",value:I}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:x.map(r=>{let m=r.id===i?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${m?"bg-muted":""}`,"data-active":m,"data-id":r.id,"data-testid":"mail-list-item",onClick:f,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:N(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),i!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:i.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.to)}),i.cc!==void 0&&i.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(i.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(b,{"data-testid":"mail-copy-link",disabled:w===void 0,onClick:P,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(b,{"data-testid":"mail-open-link",disabled:w===void 0,onClick:C,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(b,{"aria-selected":h===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:q,role:"tab",size:"sm",type:"button",variant:h===r?"secondary":"ghost",children:B(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[h==="html"&&(i.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:$e(i.html),title:e("Email preview")})),h==="text"&&(i.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:i.text})),h==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(i.headers).map(([r,m])=>`${r}: ${m}`).join(`
|
|
2
2
|
`)}))]})]})]})]})},"Qe");export{Ke as MailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-4YENBZSS.js";import{a as D}from"./chunk-UA7DC3LX.js";import"./chunk-KFDOGDD2.js";import{a as O,b as K,c as M,d as A,e as b,f as w}from"./chunk-3OVNOP65.js";import"./chunk-UVMD7C4J.js";import"./chunk-FXSY2FCG.js";import"./chunk-EOFWXI3T.js";import{a as U}from"./chunk-LYVYUTQY.js";import{c as R}from"./chunk-AKC4XWCD.js";import{a as x,e as v}from"./chunk-CB22PV3X.js";import{i as I,n as P}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as _,j as C,u as E,x as T}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as B}from"./chunk-A6TVTNKO.js";import{a as z,b as H}from"./chunk-ADABTCDI.js";import{a as l,d as S}from"./chunk-5PEAXTYQ.js";var k=S(z(),1);var V=S(B(),1);var r=S(H(),1);var F="/__lunora/advisor-procedures",Q=6e4,G=l(t=>{if(t.localProcedures)return{kind:"local"};if(t.advisorCompanion){let e=t.token===null||t.token===""?void 0:t.token;return{kind:"remote",remote:{baseUrl:E(t.workerUrl),token:e}}}return{kind:"none"}},"F"),$=class extends Error{static{l(this,"$")}constructor(){super("companion not deployed"),this.name="CompanionNotDeployedError"}},J=l(async t=>{let e=t===void 0?await fetch(F):await fetch(`${t.baseUrl}${F}`,{credentials:"include",headers:t.token===void 0?{}:{authorization:`Bearer ${t.token}`}});if(t!==void 0&&e.status===404)throw new $;if(e.ok&&!(e.headers.get("content-type")??"").includes("application/json"))throw new Error("The advisor procedure route is not available on this host.");if(!e.ok){let a=await e.json().catch(()=>{}),n=typeof a=="object"&&a&&"error"in a?String(a.error):`HTTP ${String(e.status)}`;throw new Error(n)}let o=await e.json();if(typeof o!="object"||o===null||!Array.isArray(o.procedures))throw new Error("The advisor procedure route answered without a procedure list.");return o},"G"),Y=l(t=>{let e=(0,V.c)(16),{enabled:o,refreshKey:a,remote:n}=t,[c,y]=(0,k.useState)(a),[m,p]=(0,k.useState)(0);c!==a&&(y(a),c!==void 0&&p(W));let h;e[0]!==n?(h=l(()=>J(n),"p"),e[0]=n,e[1]=h):h=e[1];let i;e[2]!==n||e[3]!==m?(i=["studio","advisor-procedures",n,m],e[2]=n,e[3]=m,e[4]=i):i=e[4];let f;e[5]!==o||e[6]!==h||e[7]!==i?(f={enabled:o,queryFn:h,queryKey:i,refetchInterval:Q,retry:!1,staleTime:0},e[5]=o,e[6]=h,e[7]=i,e[8]=f):f=e[8];let s=I(f),u;e[9]!==s.error?(u=s.error?C(s.error):void 0,e[9]=s.error,e[10]=u):u=e[10];let N=s.error instanceof $,d=c!==a,g;return e[11]!==s.data||e[12]!==u||e[13]!==N||e[14]!==d?(g={data:s.data,error:u,notDeployed:N,stale:d},e[11]=s.data,e[12]=u,e[13]=N,e[14]=d,e[15]=g):g=e[15],g},"Y");function W(t){return t+1}l(W,"z");var j={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},L={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},X=l((t,e)=>`exempt: ${t.exemptReason===void 0||t.exemptReason===""?e:t.exemptReason}`,"I"),Z=l(t=>t.toSorted((e,o)=>e.coverage==="clean"&&o.coverage!=="clean"?1:o.coverage==="clean"&&e.coverage!=="clean"?-1:e.score-o.score),"J"),me=l(({advisorCompanion:t=!1,localProcedures:e=!1,testId:o="advisor-health"})=>{let a=_(),n=P(),c=G({advisorCompanion:t,localProcedures:e,token:n.getAuthToken(),workerUrl:n.url}),y=R(U.getAdvisories,{},{enabled:c.kind!=="none",live:!0}),m=Y({enabled:c.kind!=="none",refreshKey:y.data,remote:c.kind==="remote"?c.remote:void 0}),[p,h]=(0,k.useState)(),i=y.data?.advisories,f=m.stale?void 0:m.data?.procedures;i!==void 0&&f!==void 0&&(p?.advisories!==i||p.procedures!==f)&&h({advisories:i,procedures:f});let s=(0,k.useMemo)(()=>p===void 0?null:q(p.procedures,p.advisories),[p]);if(c.kind==="none")return(0,r.jsx)(x,{children:(0,r.jsx)(v,{className:"py-8 text-center text-muted-foreground","data-testid":`${o}-local-only`,children:a("The health score needs `lunora dev`, or a Studio build with VITE_LUNORA_ADVISOR_COMPANION set to true.")})});if(m.notDeployed)return(0,r.jsx)(x,{children:(0,r.jsx)(v,{className:"py-8 text-center text-muted-foreground","data-testid":`${o}-companion-missing`,children:a("The health score needs the companion worker: it is not deployed for this Studio, so the advisor procedure list is unavailable.")})});if(m.data?.analysis==="disabled")return(0,r.jsx)(x,{children:(0,r.jsx)(v,{className:"py-8 text-center text-muted-foreground","data-testid":`${o}-lint-disabled`,children:a("The advisor analysis is disabled for this build: `lunora codegen` ran with `lint: false`, so there is no procedure list to score.")})});let u=m.error??y.error??null;if(u!==null)return(0,r.jsx)(D,{error:u,testId:`${o}-error`});if(s===null)return(0,r.jsx)(x,{children:(0,r.jsx)(v,{className:"py-8 text-center text-muted-foreground","data-testid":`${o}-loading`,children:a("Loading\u2026")})});let N=Z(s.procedures);return(0,r.jsxs)("div",{className:"space-y-4","data-testid":o,children:[(0,r.jsx)(x,{children:(0,r.jsxs)(v,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:T("text-4xl font-semibold tabular-nums",L[s.grade]),"data-testid":`${o}-score`,children:s.score}),(0,r.jsx)("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),(0,r.jsx)("span",{className:T("text-sm font-medium uppercase tracking-wide",L[s.grade]),"data-testid":`${o}-grade`,children:s.grade}),(0,r.jsxs)("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${o}-summary`,children:[(0,r.jsxs)("span",{className:j.clean,children:[s.summary.clean," ",a("clean")]}),(0,r.jsxs)("span",{className:j.warned,children:[s.summary.warned," ",a("warned")]}),(0,r.jsxs)("span",{className:j.failing,children:[s.summary.failing," ",a("failing")]}),(0,r.jsxs)("span",{className:j.exempt,children:[s.summary.exempt," ",a("exempt")]})]})]})}),s.project.checks.length>0&&(0,r.jsx)(x,{children:(0,r.jsxs)(v,{className:"py-4 text-sm","data-testid":`${o}-project`,children:[(0,r.jsxs)("span",{className:"font-medium",children:[a("Schema & config")," ",s.project.score,"/100"]}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[" \u2014 ",s.project.checks.map(d=>d.name).join(", ")]})]})}),(0,r.jsx)(x,{children:(0,r.jsx)(v,{className:"p-0",children:(0,r.jsxs)(O,{children:[(0,r.jsx)(K,{children:(0,r.jsxs)(A,{children:[(0,r.jsx)(b,{className:"w-20",children:a("Score")}),(0,r.jsx)(b,{children:a("Procedure")}),(0,r.jsx)(b,{className:"w-32",children:a("Kind")}),(0,r.jsx)(b,{children:a("Rules fired")})]})}),(0,r.jsx)(M,{children:N.map(d=>(0,r.jsxs)(A,{"data-testid":`${o}-row`,children:[(0,r.jsx)(w,{className:T("tabular-nums font-medium",j[d.coverage]),children:d.coverage==="exempt"?"\u2014":d.score}),(0,r.jsx)(w,{className:"font-mono text-xs",children:d.id}),(0,r.jsxs)(w,{className:"text-muted-foreground text-xs",children:[d.visibility," ",d.kind,d.sensitivity.level==="high"&&(0,r.jsx)("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),(0,r.jsx)(w,{className:"text-muted-foreground text-xs",children:d.coverage==="exempt"?X(d,a("no reason given")):d.checks.map(g=>g.name).join(", ")})]},d.id))})]})})})]})},"me");export{me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
1
|
+
import{a as B}from"./chunk-UEM26EYR.js";import{a as j}from"./chunk-W5LH6U6X.js";import"./chunk-DA2CAFXI.js";import"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import"./chunk-SZCXVIVT.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as I}from"./chunk-X26D3KTK.js";import{b as w}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as C}from"./chunk-UA7DC3LX.js";import"./chunk-KFDOGDD2.js";import{a as A,b as D,c as P,d as b,e as l,f as n}from"./chunk-3OVNOP65.js";import"./chunk-UVMD7C4J.js";import"./chunk-FXSY2FCG.js";import"./chunk-EOFWXI3T.js";import{a as u}from"./chunk-LYVYUTQY.js";import{c as p}from"./chunk-AKC4XWCD.js";import{a as v,e as S}from"./chunk-CB22PV3X.js";import{e as R}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as k,w as N}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import"./chunk-A6TVTNKO.js";import{b as Q}from"./chunk-ADABTCDI.js";import{a as m,d as H}from"./chunk-5PEAXTYQ.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=k(),h=B(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});j(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(I,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(w,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(C,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(I,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(D,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(w,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:N(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(S,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:N(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-JAY3ZKY6.js";import{a as ne}from"./chunk-X26D3KTK.js";import{b as Z}from"./chunk-TRJMN2YI.js";import"./chunk-L27FKJTG.js";import{a as O}from"./chunk-CB22PV3X.js";import{i as se,n as X}from"./chunk-SAV5V3DG.js";import"./chunk-ZPQBVYNN.js";import{B as re,w as le,x as Y}from"./chunk-4S7ZIMWI.js";import"./chunk-PDBW6GTJ.js";import{a as ce}from"./chunk-A6TVTNKO.js";import{b as me}from"./chunk-ADABTCDI.js";import{a as k,d as ae}from"./chunk-5PEAXTYQ.js";var te=ae(ce(),1);var a=ae(me(),1);var pe="/_lunora/health",he="/_lunora/health/ready",ue=k((r,e)=>(r.endsWith("/")?r.slice(0,-1):r)+e,"me"),fe=k(()=>{let r=X();return async e=>{let w=e==="ready"?he:pe,t=r.getAuthToken(),y=ue(r.url,w);try{let i=await fetch(y,{headers:t===null?{}:{authorization:`Bearer ${t}`}}),p=null;try{p=await i.json()}catch{p=null}return{body:p,ok:i.ok,status:i.status}}catch(i){return{body:null,error:i instanceof Error?i.message:String(i),ok:!1,status:0}}}},"pe"),ge={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},ye=k(r=>r==="unhealthy"?"crit":r==="degraded"?"warn":"ok","fe"),ie=k(r=>{let e=(0,te.c)(13),{label:w,level:t,testId:y,value:i}=r,p=ge[t],d;e[0]!==p?(d=Y("size-1.5 shrink-0 rounded-full",p),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==d?(o=(0,a.jsx)("span",{"aria-hidden":"true",className:d}),e[2]=d,e[3]=o):o=e[3];let c;e[4]!==w||e[5]!==o?(c=(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[o,w]}),e[4]=w,e[5]=o,e[6]=c):c=e[6];let h;e[7]!==y||e[8]!==i?(h=(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground","data-testid":y,children:i}),e[7]=y,e[8]=i,e[9]=h):h=e[9];let C;return e[10]!==c||e[11]!==h?(C=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[c,h]})}),e[10]=c,e[11]=h,e[12]=C):C=e[12],C},"Z"),Ie=k(r=>{let e=(0,te.c)(107),{probe:w}=r,t=re(),y=X(),i=fe(),p=w??i,d;e[0]!==p?(d=k(async()=>{let[s,n]=await Promise.all([p("live"),p("ready")]);return{live:s,ready:n}},"o"),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==y?(o=y.clientIdentifier(),e[2]=y,e[3]=o):o=e[3];let c;e[4]!==o?(c=["deployment-health",o],e[4]=o,e[5]=c):c=e[5];let h;e[6]!==d||e[7]!==c?(h={queryFn:d,queryKey:c},e[6]=d,e[7]=c,e[8]=h):h=e[8];let{data:C,isPending:de}=se(h),Q=C?.live??null,oe=C?.ready??null;if(de){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"deployment-health-loading",children:[(0,a.jsx)(ee,{className:"h-16 w-full"}),(0,a.jsx)(ee,{className:"h-40 w-full"})]}),e[9]=s):s=e[9],s}let l=Q?.body??null;if(l===null){let s=Q?.status===403,n;e[10]!==s||e[11]!==Q?.error||e[12]!==t?(n=s?t("The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public."):t("Couldn't reach the health endpoint: {message}",{message:Q?.error??t("no response")}),e[10]=s,e[11]=Q?.error,e[12]=t,e[13]=n):n=e[13];let m;e[14]!==t?(m=t("Health endpoint unavailable"),e[14]=t,e[15]=m):m=e[15];let f;return e[16]!==n||e[17]!==m?(f=(0,a.jsx)(ne,{description:n,testId:"deployment-health-error",title:m}),e[16]=n,e[17]=m,e[18]=f):f=e[18],f}let J;e[19]!==l.status?(J=ye(l.status),e[19]=l.status,e[20]=J):J=e[20];let W=J,u;if(l.status==="unhealthy"){let s;e[21]!==t?(s=t("Unhealthy"),e[21]=t,e[22]=s):s=e[22],u=s}else if(l.status==="degraded"){let s;e[23]!==t?(s=t("Degraded"),e[23]=t,e[24]=s):s=e[24],u=s}else{let s;e[25]!==t?(s=t("Healthy"),e[25]=t,e[26]=s):s=e[26],u=s}let _=oe?.ok??!1,G=_?"ok":"crit",j,H,I,x,N,v,S,V,b,P;if(e[27]!==l.appName||e[28]!==l.appVersion||e[29]!==l.checks||e[30]!==l.timestamp||e[31]!==W||e[32]!==G||e[33]!==_||e[34]!==u||e[35]!==t){let s=[...l.checks].toSorted(xe);H="flex flex-col gap-6",I="deployment-health";let n;e[46]!==t?(n=t("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint \u2014 wire an uptime monitor or a Cloudflare Health Check at it."),e[46]=t,e[47]=n):n=e[47],e[48]!==n?(x=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:n}),e[48]=n,e[49]=x):x=e[49];let m;e[50]!==u?(m=(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"dh-status",children:u}),e[50]=u,e[51]=m):m=e[51];let f;e[52]!==l.appName||e[53]!==l.appVersion?(f=(0,a.jsxs)("span",{className:"font-mono text-[13px] text-muted-foreground","data-testid":"dh-app",children:[l.appName," \xB7 ",l.appVersion]}),e[52]=l.appName,e[53]=l.appVersion,e[54]=f):f=e[54];let D;e[55]!==m||e[56]!==f?(D=(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"grid leading-tight",children:[m,f]})}),e[55]=m,e[56]=f,e[57]=D):D=e[57];let T;e[58]!==t?(T=t("Checked"),e[58]=t,e[59]=T):T=e[59];let $;e[60]!==T?($=(0,a.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:T}),e[60]=T,e[61]=$):$=e[61];let q;e[62]!==l.timestamp?(q=le(l.timestamp),e[62]=l.timestamp,e[63]=q):q=e[63];let B;e[64]!==q?(B=(0,a.jsx)("time",{className:"text-[13px] text-muted-foreground","data-testid":"dh-timestamp",children:q}),e[64]=q,e[65]=B):B=e[65];let E;e[66]!==$||e[67]!==B?(E=(0,a.jsxs)("div",{className:"text-end",children:[$,B]}),e[66]=$,e[67]=B,e[68]=E):E=e[68],e[69]!==D||e[70]!==E?(N=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[D,E]})}),e[69]=D,e[70]=E,e[71]=N):N=e[71];let L;e[72]!==t?(L=t("Liveness"),e[72]=t,e[73]=L):L=e[73];let R;e[74]!==W||e[75]!==u||e[76]!==L?(R=(0,a.jsx)(ie,{label:L,level:W,testId:"dh-liveness",value:u}),e[74]=W,e[75]=u,e[76]=L,e[77]=R):R=e[77];let U;e[78]!==t?(U=t("Readiness"),e[78]=t,e[79]=U):U=e[79];let A;e[80]!==_||e[81]!==t?(A=t(_?"Ready":"Not ready"),e[80]=_,e[81]=t,e[82]=A):A=e[82];let F;e[83]!==G||e[84]!==U||e[85]!==A?(F=(0,a.jsx)(ie,{label:U,level:G,testId:"dh-readiness",value:A}),e[83]=G,e[84]=U,e[85]=A,e[86]=F):F=e[86],e[87]!==R||e[88]!==F?(v=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2","data-testid":"dh-probes",children:[R,F]}),e[87]=R,e[88]=F,e[89]=v):v=e[89],j=O,S="gap-0 py-0",V="dh-checks";let K;e[90]!==t?(K=t("Subsystem checks"),e[90]=t,e[91]=K):K=e[91],e[92]!==K?(b=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:K})}),e[92]=K,e[93]=b):b=e[93],P=s.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"dh-checks-empty",children:t("No checks reported.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.map(g=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs","data-testid":`dh-check-${g.name}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:Y("size-1.5 shrink-0 rounded-full",g.status==="up"?"bg-success":"bg-destructive")}),(0,a.jsx)("span",{className:"font-mono text-foreground",children:g.name}),g.critical&&(0,a.jsx)(Z,{variant:"outline",children:t("Critical")})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[g.message!==void 0&&(0,a.jsx)("span",{className:"text-muted-foreground",children:g.message}),(0,a.jsx)(Z,{"data-testid":`dh-check-status-${g.name}`,variant:g.status==="up"?"secondary":"destructive",children:g.status==="up"?t("Up"):t("Down")})]})]},g.name))}),e[27]=l.appName,e[28]=l.appVersion,e[29]=l.checks,e[30]=l.timestamp,e[31]=W,e[32]=G,e[33]=_,e[34]=u,e[35]=t,e[36]=j,e[37]=H,e[38]=I,e[39]=x,e[40]=N,e[41]=v,e[42]=S,e[43]=V,e[44]=b,e[45]=P}else j=e[36],H=e[37],I=e[38],x=e[39],N=e[40],v=e[41],S=e[42],V=e[43],b=e[44],P=e[45];let z;e[94]!==j||e[95]!==S||e[96]!==V||e[97]!==b||e[98]!==P?(z=(0,a.jsxs)(j,{className:S,"data-testid":V,children:[b,P]}),e[94]=j,e[95]=S,e[96]=V,e[97]=b,e[98]=P,e[99]=z):z=e[99];let M;return e[100]!==H||e[101]!==I||e[102]!==x||e[103]!==N||e[104]!==v||e[105]!==z?(M=(0,a.jsxs)("div",{className:H,"data-testid":I,children:[x,N,v,z]}),e[100]=H,e[101]=I,e[102]=x,e[103]=N,e[104]=v,e[105]=z,e[106]=M):M=e[106],M},"_e");function xe(r,e){return r.name.localeCompare(e.name)}k(xe,"he");export{Ie as DeploymentHealthPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as i}from"./chunk-
|
|
1
|
+
import{x as i}from"./chunk-4S7ZIMWI.js";import{a as c}from"./chunk-A6TVTNKO.js";import{b as m}from"./chunk-ADABTCDI.js";import{a as s,d as n}from"./chunk-5PEAXTYQ.js";var d=n(c(),1);var p=n(m(),1);function b(r){let e=(0,d.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=i("flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=(0,p.jsx)("label",{"data-slot":"label",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}s(b,"m");export{b as a};
|