@lunora/studio 1.0.0-alpha.91 → 1.0.0-alpha.93

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.
Files changed (66) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/packem_chunks/TableEditor.js +1 -1
  3. package/dist/packem_chunks/payments-panel.js +1 -1
  4. package/dist/packem_shared/{DataBrowser-BPRDaOHx.js → DataBrowser-H4oUFkPJ.js} +1 -1
  5. package/dist/packem_shared/wire-codec-DkrdsFXO.js +1 -0
  6. package/dist/standalone/{chunk-ZNMZQXWN.js → chunk-2O65JEMI.js} +1 -1
  7. package/dist/standalone/{chunk-RKGCSNAW.js → chunk-2OUIHY7G.js} +1 -1
  8. package/dist/standalone/{chunk-BCGEI67L.js → chunk-2T22UR7E.js} +1 -1
  9. package/dist/standalone/{chunk-WOEGO5M6.js → chunk-3DJ3IUUG.js} +1 -1
  10. package/dist/standalone/{chunk-QZGTDXV5.js → chunk-3KXDX76D.js} +1 -1
  11. package/dist/standalone/{chunk-ZKTWHB7Q.js → chunk-465RIA2L.js} +1 -1
  12. package/dist/standalone/chunk-5KCULF7S.js +11 -0
  13. package/dist/standalone/{chunk-J3FR2XBV.js → chunk-5TDGHWYU.js} +1 -1
  14. package/dist/standalone/{chunk-7QMX3D4D.js → chunk-6K46XGR5.js} +1 -1
  15. package/dist/standalone/{chunk-RHPP74O4.js → chunk-7ONX5YGW.js} +1 -1
  16. package/dist/standalone/{chunk-CRHCAN4W.js → chunk-7YJNH3RB.js} +1 -1
  17. package/dist/standalone/{chunk-ESEEVSPC.js → chunk-A3DBEJLO.js} +1 -1
  18. package/dist/standalone/{chunk-3XQMTTW2.js → chunk-ABYJC3LS.js} +1 -1
  19. package/dist/standalone/{chunk-6WWX4FJB.js → chunk-AQ4JNJF3.js} +1 -1
  20. package/dist/standalone/{chunk-XGMZESWC.js → chunk-BN4CIAXU.js} +1 -1
  21. package/dist/standalone/{chunk-XDEDCAYN.js → chunk-BNAMPDZ2.js} +1 -1
  22. package/dist/standalone/{chunk-XKKP2VFZ.js → chunk-D62SDRMM.js} +1 -1
  23. package/dist/standalone/{chunk-FBNRATNR.js → chunk-DBMFI2HC.js} +1 -1
  24. package/dist/standalone/{chunk-Q4AI6JRP.js → chunk-DMJDUC4L.js} +1 -1
  25. package/dist/standalone/{chunk-2QWHVQ6P.js → chunk-DYMO6MDG.js} +1 -1
  26. package/dist/standalone/{chunk-C6GLTSPO.js → chunk-G6GX5TVB.js} +1 -1
  27. package/dist/standalone/{chunk-4VEAVSAZ.js → chunk-GZMKPBTJ.js} +1 -1
  28. package/dist/standalone/{chunk-N233NOIN.js → chunk-JEZDJ7D6.js} +1 -1
  29. package/dist/standalone/{chunk-ZWSTXAG3.js → chunk-JYLYJT27.js} +1 -1
  30. package/dist/standalone/{chunk-2NX5QU44.js → chunk-KEVIGWKP.js} +1 -1
  31. package/dist/standalone/{chunk-ML5IJMH6.js → chunk-LZKU262J.js} +1 -1
  32. package/dist/standalone/{chunk-6XKVQES4.js → chunk-M7AWSDGY.js} +1 -1
  33. package/dist/standalone/chunk-MLT5MMMY.js +1 -0
  34. package/dist/standalone/{chunk-F3TP5L34.js → chunk-NNKN2XEZ.js} +1 -1
  35. package/dist/standalone/{chunk-NH3VWHCL.js → chunk-O3UMJLO3.js} +1 -1
  36. package/dist/standalone/{chunk-CUAGAM2B.js → chunk-OM36OEHZ.js} +1 -1
  37. package/dist/standalone/{chunk-BYIS2KWZ.js → chunk-PE7TI4TQ.js} +1 -1
  38. package/dist/standalone/{chunk-O2QUUHGF.js → chunk-PGVJE5F5.js} +1 -1
  39. package/dist/standalone/{chunk-IZ3ISXSM.js → chunk-QM4EXWKF.js} +1 -1
  40. package/dist/standalone/{chunk-QGA2HITH.js → chunk-QNHU4SKL.js} +1 -1
  41. package/dist/standalone/{chunk-LDYOCGEG.js → chunk-QXECM52Z.js} +1 -1
  42. package/dist/standalone/{chunk-LYQY7L72.js → chunk-SCKKQIAE.js} +1 -1
  43. package/dist/standalone/{chunk-6QKJ6JPJ.js → chunk-SKYFKPJC.js} +1 -1
  44. package/dist/standalone/{chunk-HKG5I64M.js → chunk-TITX6XEA.js} +1 -1
  45. package/dist/standalone/{chunk-CMP33R3N.js → chunk-TMNKNTC4.js} +1 -1
  46. package/dist/standalone/{chunk-NNRFDPSD.js → chunk-U6KDYJJC.js} +1 -1
  47. package/dist/standalone/{chunk-LUU4SDHW.js → chunk-UBIPFCOZ.js} +1 -1
  48. package/dist/standalone/{chunk-A7647FJE.js → chunk-UGU5GYDV.js} +1 -1
  49. package/dist/standalone/{chunk-QWJ4HKPY.js → chunk-UIGAA3GV.js} +1 -1
  50. package/dist/standalone/{chunk-4PLB4ZNI.js → chunk-VNQB6HY4.js} +1 -1
  51. package/dist/standalone/{chunk-AQT6EPZT.js → chunk-VVNQP4CI.js} +1 -1
  52. package/dist/standalone/{chunk-KUFAOKU3.js → chunk-WI4XINU2.js} +1 -1
  53. package/dist/standalone/{chunk-XXXMUP6L.js → chunk-YD5O2NWK.js} +1 -1
  54. package/dist/standalone/{chunk-ULYM26IH.js → chunk-YTWBHPAT.js} +1 -1
  55. package/dist/standalone/{chunk-7YXDJXNL.js → chunk-Z4AX76YZ.js} +1 -1
  56. package/dist/standalone/{chunk-LZH7RDRV.js → chunk-ZA5YIHZM.js} +1 -1
  57. package/dist/standalone/{chunk-4D7XIQ5Q.js → chunk-ZNAGZU6H.js} +1 -1
  58. package/dist/standalone/{chunk-XTEWLG3J.js → chunk-ZQPWVALL.js} +1 -1
  59. package/dist/standalone/{chunk-HWOD25QD.js → chunk-ZVAGD3FT.js} +1 -1
  60. package/dist/standalone/chunk-ZZJ7VUVZ.js +1 -0
  61. package/dist/standalone/studio.js +1 -1
  62. package/package.json +6 -6
  63. package/dist/packem_shared/wire-codec-BUrWLklj.js +0 -1
  64. package/dist/standalone/chunk-BENJFRZL.js +0 -1
  65. package/dist/standalone/chunk-DBWOWJYT.js +0 -11
  66. package/dist/standalone/chunk-FW75RYZU.js +0 -1
@@ -1 +1 @@
1
- import{a as We,b as De,c as Fe,d as Oe,e as be}from"./chunk-UU2QJMGJ.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as qe}from"./chunk-Q2Q7FR3R.js";import{a as Ve}from"./chunk-IGCNMZSB.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as ze}from"./chunk-3CWGJYBB.js";import{a as _e}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as ke}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as ie}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as me}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-VDW32UET.js";import{c as Te}from"./chunk-4D7XIQ5Q.js";import{f as Ne}from"./chunk-DBWOWJYT.js";import"./chunk-XBDKZZ67.js";import{a as Ce}from"./chunk-XQCVZAGU.js";import{a as Le,b as je,c as Re,d as pe,e as W,f as L}from"./chunk-MIQTKZAR.js";import{a as Me,e as Ae}from"./chunk-UZERI5YC.js";import{d as ue,f as le,g as we,h as Ke,o as re,r as Ee}from"./chunk-IUYFXK4X.js";import{a as Ie,b as $e}from"./chunk-XNGYYOLS.js";import{a as d,e as ye,f as Be,g as Ge,h as He}from"./chunk-3XIESWL4.js";var ge=ye(Ge(),1);var ne=ye(Be(),1);var t=ye(He(),1);var Se="none",Pe=["all","open","resolved","ignored"],Je=["critical","high","medium","low"],Qe=le(D.resolveIssue),Xe=le(D.ignoreIssue),Ue=le(D.assignIssue),Ye=le(D.setIssueSeverity),Ze=le(D.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Ye"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Ze"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Pe"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=Ne(),r=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:C,run:j}=qe(),K;e[0]!==i||e[1]!==s||e[2]!==j||e[3]!==$?(K=d(()=>{o(void 0),j(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,g,we($));o(I)})},"K"),e[0]=i,e[1]=s,e[2]=j,e[3]=$,e[4]=K):K=e[4];let z=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Ie(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let E=k,T=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==r?(x=r("Suggested fix"),e[9]=r,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==E||e[14]!==s.hash||e[15]!==r?(v=E===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:r("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:E}),e[13]=E,e[14]=s.hash,e[15]=r,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let w=`issues-explain-${s.hash}`,b;e[20]!==_||e[21]!==r?(b=r(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=r,e[22]=b):b=e[22];let m;e[23]!==_||e[24]!==z||e[25]!==b||e[26]!==w?(m=(0,t.jsx)("div",{children:(0,t.jsx)(ie,{"data-testid":w,disabled:_,onClick:z,size:"sm",type:"button",variant:"outline",children:b})}),e[23]=_,e[24]=z,e[25]=b,e[26]=w,e[27]=m):m=e[27];let f;e[28]!==C||e[29]!==s.hash?(f=C!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:C}),e[28]=C,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==r?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?r("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):r("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:r("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:r("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:r("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=r,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(L,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let S;return e[41]!==c||e[42]!==T?(S=(0,t.jsx)(pe,{"data-testid":T,children:c}),e[41]=c,e[42]=T,e[43]=S):S=e[43],S},"es"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:r}=n,a=ue(),[o,_]=(0,ne.useState)(!1),C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=d(()=>{_(ls)},"C"),e[0]=C):C=e[0];let j=C,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Se?null:ae;re(i(s.hash,Ye,{severity:ce}))},"K"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let z=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();re(i(s.hash,Ue,{assignee:ce===""?null:ce}))},"k"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let E=k,T=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let w;e[12]!==s.title?(w=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=w):w=e[13];let b;e[14]!==s.culprit?(b=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=b):b=e[15];let m;e[16]!==w||e[17]!==b?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[w,b]}),e[16]=w,e[17]=b,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:j,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(L,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let S=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==g?(I=(0,t.jsx)(L,{children:(0,t.jsx)(me,{"data-testid":S,variant:g,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=g,e[36]=I):I=e[36];let R=s.severity??Se,l;e[37]!==a?(l=a("Set severity"),e[37]=a,e[38]=l):l=e[38];let oe=`issues-severity-${s.hash}`,q;e[39]!==a?(q=a("\u2014"),e[39]=a,e[40]=q):q=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let A;e[44]!==q||e[45]!==N?(A=(0,t.jsx)(De,{placeholder:q,children:N}),e[44]=q,e[45]=N,e[46]=A):A=e[46];let V;e[47]!==l||e[48]!==oe||e[49]!==A?(V=(0,t.jsx)(Fe,{"aria-label":l,className:"h-7 w-[110px]","data-testid":oe,children:A}),e[47]=l,e[48]=oe,e[49]=A,e[50]=V):V=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Je.map(rs),e[51]=de):de=e[51];let F;e[52]!==a?(F=a("Clear"),e[52]=a,e[53]=F):F=e[53];let O;e[54]!==F?(O=(0,t.jsxs)(Oe,{children:[de,(0,t.jsx)(be,{value:Se,children:F})]}),e[54]=F,e[55]=O):O=e[55];let U;e[56]!==u||e[57]!==z||e[58]!==R||e[59]!==V||e[60]!==O?(U=(0,t.jsx)(L,{children:(0,t.jsxs)(We,{disabled:u,onValueChange:z,value:R,children:[V,O]})}),e[56]=u,e[57]=z,e[58]=R,e[59]=V,e[60]=O,e[61]=U):U=e[61];let B;e[62]!==a?(B=a("Assignee"),e[62]=a,e[63]=B):B=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==E||e[68]!==B||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(L,{children:(0,t.jsx)(ke,{"aria-label":B,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:E,placeholder:G},ve)}),e[66]=u,e[67]=E,e[68]=B,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let P;e[74]!==s.count?(P=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=P):P=e[75];let J;e[76]!==s.lastSeen?(J=Ee(s.lastSeen),e[76]=s.lastSeen,e[77]=J):J=e[77];let Q;e[78]!==J?(Q=(0,t.jsx)(L,{className:"text-xs tabular-nums text-muted-foreground",children:J}),e[78]=J,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(ie,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(ie,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(ie,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Ue,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==I||e[105]!==U||e[106]!==H||e[107]!==P||e[108]!==Q||e[109]!==T||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":T,children:[c,I,U,H,P,Q,ee]}),e[103]=c,e[104]=I,e[105]=U,e[106]=H,e[107]=P,e[108]=Q,e[109]=T,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==r?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:r},s.sampleMessage),e[112]=o,e[113]=s,e[114]=r,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"ss"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=Ne(),{queryShardKey:i,setShardKey:r,shardKey:a}=ze(u),[o,_]=(0,ne.useState)("all"),[C,j]=(0,ne.useState)(ns),[K,z]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let E;e[2]!==i?(E={live:!0,shardKey:i},e[2]=i,e[3]=E):E=e[3];let{data:T,error:h,liveError:x}=Te(D.getIssues,k,E),M=T!==void 0,v;if(e[4]!==K||e[5]!==C||e[6]!==$||e[7]!==T||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(T),w;e[17]!==$||e[18]!==i?(w=d(async(l,oe,q)=>{z(N=>{if(!N.has(l))return N;let A=new Map(N);return A.delete(l),A}),j(N=>new Set(N).add(l));try{await $.query(oe,{...q,hash:l},we(i))}catch(N){let A=Ke(N);z(V=>new Map(V).set(l,A))}j(N=>{let A=new Set(N);return A.delete(l),A})},"N"),e[17]=$,e[18]=i,e[19]=w):w=e[19];let b=w,m;e[20]!==s?(m=d(l=>s(l==="all"?"All":l==="open"?"Open":l==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==r||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:r,testId:"issues-shard-input",value:a}),e[24]=r,e[25]=a,e[26]=c):c=e[26];let S;e[27]!==x?(S=(0,t.jsx)(Ve,{message:x,prefix:"issues"}),e[27]=x,e[28]=S):S=e[28];let g;e[29]!==o||e[30]!==f?(g=Pe.map(l=>(0,t.jsx)(ie,{"data-active":o===l?"":void 0,"data-testid":`issues-filter-${l}`,onClick:d(()=>{_(l)},"onClick"),size:"xs",variant:o===l?"default":"outline",children:f(l)},l)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let I;e[32]!==g?(I=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=I):I=e[33];let R;e[34]!==I||e[35]!==c||e[36]!==S?(R=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,S,I]}),e[34]=I,e[35]=c,e[36]=S,e[37]=R):R=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,R,M&&y.length===0?(0,t.jsx)(Ce,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(je,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(W,{children:s("Issue")}),(0,t.jsx)(W,{children:s("Status")}),(0,t.jsx)(W,{children:s("Severity")}),(0,t.jsx)(W,{children:s("Assignee")}),(0,t.jsx)(W,{className:"text-right",children:s("Events")}),(0,t.jsx)(W,{children:s("Last seen")}),(0,t.jsx)(W,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Re,{children:y.map(l=>(0,t.jsx)(is,{busy:C.has(l.hash),issue:l,rowError:K.get(l.hash),runTriage:b,shardKey:i},l.hash))})]})})})]}),e[4]=K,e[5]=C,e[6]=$,e[7]=T,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=r,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"ks");function ls(n){return!n}d(ls,"ts");function rs(n){return(0,t.jsx)(be,{value:n,children:n},n)}d(rs,"as");function ns(){return new Set}d(ns,"is");function os(){return new Map}d(os,"rs");export{ks as IssuesPanel};
1
+ import{a as We,b as De,c as Fe,d as Oe,e as be}from"./chunk-UU2QJMGJ.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as qe}from"./chunk-Q2Q7FR3R.js";import{a as Ve}from"./chunk-IGCNMZSB.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as ze}from"./chunk-3CWGJYBB.js";import{a as _e}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as ke}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as ie}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as me}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-VDW32UET.js";import{c as Te}from"./chunk-ZNAGZU6H.js";import{f as Ne}from"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as Ce}from"./chunk-XQCVZAGU.js";import{a as Le,b as je,c as Re,d as pe,e as W,f as L}from"./chunk-MIQTKZAR.js";import{a as Me,e as Ae}from"./chunk-UZERI5YC.js";import{d as ue,f as le,g as we,h as Ke,o as re,r as Ee}from"./chunk-IUYFXK4X.js";import{a as Ie,b as $e}from"./chunk-XNGYYOLS.js";import{a as d,e as ye,f as Be,g as Ge,h as He}from"./chunk-3XIESWL4.js";var ge=ye(Ge(),1);var ne=ye(Be(),1);var t=ye(He(),1);var Se="none",Pe=["all","open","resolved","ignored"],Je=["critical","high","medium","low"],Qe=le(D.resolveIssue),Xe=le(D.ignoreIssue),Ue=le(D.assignIssue),Ye=le(D.setIssueSeverity),Ze=le(D.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Ye"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Ze"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Pe"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=Ne(),r=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:C,run:j}=qe(),K;e[0]!==i||e[1]!==s||e[2]!==j||e[3]!==$?(K=d(()=>{o(void 0),j(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,g,we($));o(I)})},"K"),e[0]=i,e[1]=s,e[2]=j,e[3]=$,e[4]=K):K=e[4];let z=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Ie(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let E=k,T=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==r?(x=r("Suggested fix"),e[9]=r,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==E||e[14]!==s.hash||e[15]!==r?(v=E===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:r("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:E}),e[13]=E,e[14]=s.hash,e[15]=r,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let w=`issues-explain-${s.hash}`,b;e[20]!==_||e[21]!==r?(b=r(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=r,e[22]=b):b=e[22];let m;e[23]!==_||e[24]!==z||e[25]!==b||e[26]!==w?(m=(0,t.jsx)("div",{children:(0,t.jsx)(ie,{"data-testid":w,disabled:_,onClick:z,size:"sm",type:"button",variant:"outline",children:b})}),e[23]=_,e[24]=z,e[25]=b,e[26]=w,e[27]=m):m=e[27];let f;e[28]!==C||e[29]!==s.hash?(f=C!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:C}),e[28]=C,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==r?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?r("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):r("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:r("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:r("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:r("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=r,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(L,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let S;return e[41]!==c||e[42]!==T?(S=(0,t.jsx)(pe,{"data-testid":T,children:c}),e[41]=c,e[42]=T,e[43]=S):S=e[43],S},"es"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:r}=n,a=ue(),[o,_]=(0,ne.useState)(!1),C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=d(()=>{_(ls)},"C"),e[0]=C):C=e[0];let j=C,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Se?null:ae;re(i(s.hash,Ye,{severity:ce}))},"K"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let z=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();re(i(s.hash,Ue,{assignee:ce===""?null:ce}))},"k"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let E=k,T=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let w;e[12]!==s.title?(w=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=w):w=e[13];let b;e[14]!==s.culprit?(b=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=b):b=e[15];let m;e[16]!==w||e[17]!==b?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[w,b]}),e[16]=w,e[17]=b,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:j,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(L,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let S=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==g?(I=(0,t.jsx)(L,{children:(0,t.jsx)(me,{"data-testid":S,variant:g,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=g,e[36]=I):I=e[36];let R=s.severity??Se,l;e[37]!==a?(l=a("Set severity"),e[37]=a,e[38]=l):l=e[38];let oe=`issues-severity-${s.hash}`,q;e[39]!==a?(q=a("\u2014"),e[39]=a,e[40]=q):q=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let A;e[44]!==q||e[45]!==N?(A=(0,t.jsx)(De,{placeholder:q,children:N}),e[44]=q,e[45]=N,e[46]=A):A=e[46];let V;e[47]!==l||e[48]!==oe||e[49]!==A?(V=(0,t.jsx)(Fe,{"aria-label":l,className:"h-7 w-[110px]","data-testid":oe,children:A}),e[47]=l,e[48]=oe,e[49]=A,e[50]=V):V=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Je.map(rs),e[51]=de):de=e[51];let F;e[52]!==a?(F=a("Clear"),e[52]=a,e[53]=F):F=e[53];let O;e[54]!==F?(O=(0,t.jsxs)(Oe,{children:[de,(0,t.jsx)(be,{value:Se,children:F})]}),e[54]=F,e[55]=O):O=e[55];let U;e[56]!==u||e[57]!==z||e[58]!==R||e[59]!==V||e[60]!==O?(U=(0,t.jsx)(L,{children:(0,t.jsxs)(We,{disabled:u,onValueChange:z,value:R,children:[V,O]})}),e[56]=u,e[57]=z,e[58]=R,e[59]=V,e[60]=O,e[61]=U):U=e[61];let B;e[62]!==a?(B=a("Assignee"),e[62]=a,e[63]=B):B=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==E||e[68]!==B||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(L,{children:(0,t.jsx)(ke,{"aria-label":B,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:E,placeholder:G},ve)}),e[66]=u,e[67]=E,e[68]=B,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let P;e[74]!==s.count?(P=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=P):P=e[75];let J;e[76]!==s.lastSeen?(J=Ee(s.lastSeen),e[76]=s.lastSeen,e[77]=J):J=e[77];let Q;e[78]!==J?(Q=(0,t.jsx)(L,{className:"text-xs tabular-nums text-muted-foreground",children:J}),e[78]=J,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(ie,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(ie,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(ie,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Ue,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==I||e[105]!==U||e[106]!==H||e[107]!==P||e[108]!==Q||e[109]!==T||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":T,children:[c,I,U,H,P,Q,ee]}),e[103]=c,e[104]=I,e[105]=U,e[106]=H,e[107]=P,e[108]=Q,e[109]=T,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==r?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:r},s.sampleMessage),e[112]=o,e[113]=s,e[114]=r,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"ss"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=Ne(),{queryShardKey:i,setShardKey:r,shardKey:a}=ze(u),[o,_]=(0,ne.useState)("all"),[C,j]=(0,ne.useState)(ns),[K,z]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let E;e[2]!==i?(E={live:!0,shardKey:i},e[2]=i,e[3]=E):E=e[3];let{data:T,error:h,liveError:x}=Te(D.getIssues,k,E),M=T!==void 0,v;if(e[4]!==K||e[5]!==C||e[6]!==$||e[7]!==T||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(T),w;e[17]!==$||e[18]!==i?(w=d(async(l,oe,q)=>{z(N=>{if(!N.has(l))return N;let A=new Map(N);return A.delete(l),A}),j(N=>new Set(N).add(l));try{await $.query(oe,{...q,hash:l},we(i))}catch(N){let A=Ke(N);z(V=>new Map(V).set(l,A))}j(N=>{let A=new Set(N);return A.delete(l),A})},"N"),e[17]=$,e[18]=i,e[19]=w):w=e[19];let b=w,m;e[20]!==s?(m=d(l=>s(l==="all"?"All":l==="open"?"Open":l==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==r||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:r,testId:"issues-shard-input",value:a}),e[24]=r,e[25]=a,e[26]=c):c=e[26];let S;e[27]!==x?(S=(0,t.jsx)(Ve,{message:x,prefix:"issues"}),e[27]=x,e[28]=S):S=e[28];let g;e[29]!==o||e[30]!==f?(g=Pe.map(l=>(0,t.jsx)(ie,{"data-active":o===l?"":void 0,"data-testid":`issues-filter-${l}`,onClick:d(()=>{_(l)},"onClick"),size:"xs",variant:o===l?"default":"outline",children:f(l)},l)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let I;e[32]!==g?(I=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=I):I=e[33];let R;e[34]!==I||e[35]!==c||e[36]!==S?(R=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,S,I]}),e[34]=I,e[35]=c,e[36]=S,e[37]=R):R=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,R,M&&y.length===0?(0,t.jsx)(Ce,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(je,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(W,{children:s("Issue")}),(0,t.jsx)(W,{children:s("Status")}),(0,t.jsx)(W,{children:s("Severity")}),(0,t.jsx)(W,{children:s("Assignee")}),(0,t.jsx)(W,{className:"text-right",children:s("Events")}),(0,t.jsx)(W,{children:s("Last seen")}),(0,t.jsx)(W,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Re,{children:y.map(l=>(0,t.jsx)(is,{busy:C.has(l.hash),issue:l,rowError:K.get(l.hash),runTriage:b,shardKey:i},l.hash))})]})})})]}),e[4]=K,e[5]=C,e[6]=$,e[7]=T,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=r,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"ks");function ls(n){return!n}d(ls,"ts");function rs(n){return(0,t.jsx)(be,{value:n,children:n},n)}d(rs,"as");function ns(){return new Set}d(ns,"is");function os(){return new Map}d(os,"rs");export{ks as IssuesPanel};
@@ -1 +1 @@
1
- import{b as B}from"./chunk-XF2B7P5A.js";import{b as A}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as P}from"./chunk-ZKTWHB7Q.js";import"./chunk-XXQUMVWH.js";import"./chunk-NH3VWHCL.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-VDW32UET.js";import{c as F}from"./chunk-4D7XIQ5Q.js";import"./chunk-DBWOWJYT.js";import"./chunk-XBDKZZ67.js";import{a as R,b as q,c as z,d as K,e as _,f as C}from"./chunk-MIQTKZAR.js";import{a as D,e as j}from"./chunk-UZERI5YC.js";import{d as V}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as k,e as O,g as H,h as W}from"./chunk-3XIESWL4.js";var G=O(H(),1);var t=O(W(),1);var $={binding:"outline",secret:"destructive",var:"secondary"},J=k((n,e)=>{if(n===void 0)return[];let m=[];return n.workerUrl!==void 0&&m.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&m.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&m.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&m.push({label:e("Version"),value:n.versionTag}),m},"B"),le=k(n=>{let e=(0,G.c)(52),{initialShardKey:m}=n,r=V(),w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];let E=m??"",S;e[1]!==E?(S={shardKey:E},e[1]=E,e[2]=S):S=e[2];let{data:s,error:l,errorSource:b,isLoading:U}=F(M.getSettings,w,S),a,c,p,d,o,i,u;if(e[3]!==l||e[4]!==b||e[5]!==s?.deploy||e[6]!==s?.settings||e[7]!==r){let L=J(s?.deploy,r),T;e[15]!==s?.settings?(T=s?.settings??[],e[15]=s?.settings,e[16]=T):T=e[16],a=T,c="flex flex-col gap-4",p="lunora-settings";let y;e[17]!==r?(y=r("Open in Cloudflare"),e[17]=r,e[18]=y):y=e[18],e[19]!==y?(d=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:B,rel:"noreferrer",target:"_blank",children:y})}),e[19]=y,e[20]=d):d=e[20];let N;e[21]!==r?(N=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=N):N=e[22],e[23]!==N?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:N}),e[23]=N,e[24]=o):o=e[24],e[25]!==l||e[26]!==b?(i=l!==null&&(0,t.jsx)(P,{error:b,testId:"set-error"}),e[25]=l,e[26]=b,e[27]=i):i=e[27],u=L.length>0&&(0,t.jsxs)(D,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(j,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:L.map(Q)})})]}),e[3]=l,e[4]=b,e[5]=s?.deploy,e[6]=s?.settings,e[7]=r,e[8]=a,e[9]=c,e[10]=p,e[11]=d,e[12]=o,e[13]=i,e[14]=u}else a=e[8],c=e[9],p=e[10],d=e[11],o=e[12],i=e[13],u=e[14];let h;e[28]!==r?(h=r("Environment & bindings"),e[28]=r,e[29]=h):h=e[29];let f;e[30]!==h?(f=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h})}),e[30]=h,e[31]=f):f=e[31];let g;e[32]!==l||e[33]!==U||e[34]!==a.length||e[35]!==r?(g=l===null&&!U&&a.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[32]=l,e[33]=U,e[34]=a.length,e[35]=r,e[36]=g):g=e[36];let x;e[37]!==a||e[38]!==r?(x=a.length>0&&(0,t.jsx)(j,{className:"px-0 py-0",children:(0,t.jsxs)(R,{"data-testid":"set-table",children:[(0,t.jsx)(q,{children:(0,t.jsxs)(K,{children:[(0,t.jsx)(_,{children:r("name")}),(0,t.jsx)(_,{children:r("kind")}),(0,t.jsx)(_,{children:r("value")})]})}),(0,t.jsx)(z,{children:a.map(X)})]})}),e[37]=a,e[38]=r,e[39]=x):x=e[39];let v;e[40]!==f||e[41]!==g||e[42]!==x?(v=(0,t.jsxs)(D,{className:"py-0",children:[f,g,x]}),e[40]=f,e[41]=g,e[42]=x,e[43]=v):v=e[43];let I;return e[44]!==v||e[45]!==c||e[46]!==p||e[47]!==d||e[48]!==o||e[49]!==i||e[50]!==u?(I=(0,t.jsxs)("div",{className:c,"data-testid":p,children:[d,o,i,u,v]}),e[44]=v,e[45]=c,e[46]=p,e[47]=d,e[48]=o,e[49]=i,e[50]=u,e[51]=I):I=e[51],I},"le");function Q(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}k(Q,"G");function X(n){return(0,t.jsxs)(K,{"data-testid":"set-row",children:[(0,t.jsx)(C,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(C,{children:(0,t.jsx)(A,{variant:$[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(C,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}k(X,"H");export{le as SettingsPanel};
1
+ import{b as B}from"./chunk-XF2B7P5A.js";import{b as A}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as P}from"./chunk-465RIA2L.js";import"./chunk-XXQUMVWH.js";import"./chunk-O3UMJLO3.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-VDW32UET.js";import{c as F}from"./chunk-ZNAGZU6H.js";import"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as R,b as q,c as z,d as K,e as _,f as C}from"./chunk-MIQTKZAR.js";import{a as D,e as j}from"./chunk-UZERI5YC.js";import{d as V}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as k,e as O,g as H,h as W}from"./chunk-3XIESWL4.js";var G=O(H(),1);var t=O(W(),1);var $={binding:"outline",secret:"destructive",var:"secondary"},J=k((n,e)=>{if(n===void 0)return[];let m=[];return n.workerUrl!==void 0&&m.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&m.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&m.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&m.push({label:e("Version"),value:n.versionTag}),m},"B"),le=k(n=>{let e=(0,G.c)(52),{initialShardKey:m}=n,r=V(),w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];let E=m??"",S;e[1]!==E?(S={shardKey:E},e[1]=E,e[2]=S):S=e[2];let{data:s,error:l,errorSource:b,isLoading:U}=F(M.getSettings,w,S),a,c,p,d,o,i,u;if(e[3]!==l||e[4]!==b||e[5]!==s?.deploy||e[6]!==s?.settings||e[7]!==r){let L=J(s?.deploy,r),T;e[15]!==s?.settings?(T=s?.settings??[],e[15]=s?.settings,e[16]=T):T=e[16],a=T,c="flex flex-col gap-4",p="lunora-settings";let y;e[17]!==r?(y=r("Open in Cloudflare"),e[17]=r,e[18]=y):y=e[18],e[19]!==y?(d=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:B,rel:"noreferrer",target:"_blank",children:y})}),e[19]=y,e[20]=d):d=e[20];let N;e[21]!==r?(N=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=N):N=e[22],e[23]!==N?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:N}),e[23]=N,e[24]=o):o=e[24],e[25]!==l||e[26]!==b?(i=l!==null&&(0,t.jsx)(P,{error:b,testId:"set-error"}),e[25]=l,e[26]=b,e[27]=i):i=e[27],u=L.length>0&&(0,t.jsxs)(D,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(j,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:L.map(Q)})})]}),e[3]=l,e[4]=b,e[5]=s?.deploy,e[6]=s?.settings,e[7]=r,e[8]=a,e[9]=c,e[10]=p,e[11]=d,e[12]=o,e[13]=i,e[14]=u}else a=e[8],c=e[9],p=e[10],d=e[11],o=e[12],i=e[13],u=e[14];let h;e[28]!==r?(h=r("Environment & bindings"),e[28]=r,e[29]=h):h=e[29];let f;e[30]!==h?(f=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h})}),e[30]=h,e[31]=f):f=e[31];let g;e[32]!==l||e[33]!==U||e[34]!==a.length||e[35]!==r?(g=l===null&&!U&&a.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[32]=l,e[33]=U,e[34]=a.length,e[35]=r,e[36]=g):g=e[36];let x;e[37]!==a||e[38]!==r?(x=a.length>0&&(0,t.jsx)(j,{className:"px-0 py-0",children:(0,t.jsxs)(R,{"data-testid":"set-table",children:[(0,t.jsx)(q,{children:(0,t.jsxs)(K,{children:[(0,t.jsx)(_,{children:r("name")}),(0,t.jsx)(_,{children:r("kind")}),(0,t.jsx)(_,{children:r("value")})]})}),(0,t.jsx)(z,{children:a.map(X)})]})}),e[37]=a,e[38]=r,e[39]=x):x=e[39];let v;e[40]!==f||e[41]!==g||e[42]!==x?(v=(0,t.jsxs)(D,{className:"py-0",children:[f,g,x]}),e[40]=f,e[41]=g,e[42]=x,e[43]=v):v=e[43];let I;return e[44]!==v||e[45]!==c||e[46]!==p||e[47]!==d||e[48]!==o||e[49]!==i||e[50]!==u?(I=(0,t.jsxs)("div",{className:c,"data-testid":p,children:[d,o,i,u,v]}),e[44]=v,e[45]=c,e[46]=p,e[47]=d,e[48]=o,e[49]=i,e[50]=u,e[51]=I):I=e[51],I},"le");function Q(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}k(Q,"G");function X(n){return(0,t.jsxs)(K,{"data-testid":"set-row",children:[(0,t.jsx)(C,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(C,{children:(0,t.jsx)(A,{variant:$[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(C,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}k(X,"H");export{le as SettingsPanel};
@@ -1 +1 @@
1
- import{R as V}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as F}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as q}from"./chunk-ZKTWHB7Q.js";import"./chunk-XXQUMVWH.js";import"./chunk-NH3VWHCL.js";import"./chunk-QLQADHFE.js";import{a as U}from"./chunk-VDW32UET.js";import{c as O}from"./chunk-4D7XIQ5Q.js";import"./chunk-DBWOWJYT.js";import"./chunk-XBDKZZ67.js";import{a as D}from"./chunk-XQCVZAGU.js";import{a as G,b as J,c as K,d as M,e as a,f as o}from"./chunk-MIQTKZAR.js";import{a as W,e as B}from"./chunk-UZERI5YC.js";import{d as T,r as H}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as n,e as j,f as re,g as se,h as ie}from"./chunk-3XIESWL4.js";var X=j(se(),1),P=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"P"),xe=n(()=>{let e=(0,X.c)(38),r=T(),[i,Y]=(0,P.useState)("all"),[l,Z]=(0,P.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:_,error:c,errorSource:v,isLoading:I,refetch:x}=O(U.listPushSubscriptions,g),N;if(e[1]!==_?.subscriptions||e[2]!==c||e[3]!==v||e[4]!==I||e[5]!==i||e[6]!==x||e[7]!==l||e[8]!==r){let L=_?.subscriptions??[],z=l.trim().toLowerCase(),A=L.filter(s=>i!=="all"&&s.kind!==i?!1:z===""?!0:`${Q(s)} ${s.userId??""}`.toLowerCase().includes(z)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(s=>{Z(s.target.value)},"b"),e[10]=b):b=e[10];let ee=b,w;e[11]!==x?(w=n(()=>{x()},"w"),e[11]=x,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,d;e[14]!==i||e[15]!==r?(d=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(s=>(0,t.jsx)(F,{"aria-selected":i===s,"data-testid":`nt-kind-${s}`,onClick:n(()=>{Y(s)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===s?"secondary":"ghost",children:s==="all"?r("All"):s},s))}),e[14]=i,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(V,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(F,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(C,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==d||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p,$]}),e[30]=p,e[31]=$,e[32]=d,e[33]=u,e[34]=y):y=e[34];let S;e[35]!==c||e[36]!==v?(S=c!==null&&(0,t.jsx)(q,{error:v,testId:"nt-error"}),e[35]=c,e[36]=v,e[37]=S):S=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,S,c===null&&!I&&A.length===0&&(0,t.jsx)(D,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("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:"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"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(W,{className:"overflow-hidden py-0",children:(0,t.jsx)(B,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(a,{children:r("kind")}),(0,t.jsx)(a,{children:r("endpoint")}),(0,t.jsx)(a,{children:r("user")}),(0,t.jsx)(a,{children:r("last seen")}),(0,t.jsx)(a,{children:r("status")}),(0,t.jsx)(a,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(s=>{let R=Q(s);return(0,t.jsxs)(M,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(C,{variant:"outline",children:s.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:R,children:R}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:s.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:H(s.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(C,{"data-testid":`nt-status-${s.id}`,variant:ne(s.lastStatus),children:s.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:s.lastError??void 0,children:s.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},s.id)})})]})})})]}),e[1]=_?.subscriptions,e[2]=c,e[3]=v,e[4]=I,e[5]=i,e[6]=x,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ve");export{xe as NotificationsPanel};
1
+ import{R as V}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as F}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as q}from"./chunk-465RIA2L.js";import"./chunk-XXQUMVWH.js";import"./chunk-O3UMJLO3.js";import"./chunk-QLQADHFE.js";import{a as U}from"./chunk-VDW32UET.js";import{c as O}from"./chunk-ZNAGZU6H.js";import"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as D}from"./chunk-XQCVZAGU.js";import{a as G,b as J,c as K,d as M,e as a,f as o}from"./chunk-MIQTKZAR.js";import{a as W,e as B}from"./chunk-UZERI5YC.js";import{d as T,r as H}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as n,e as j,f as re,g as se,h as ie}from"./chunk-3XIESWL4.js";var X=j(se(),1),P=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"P"),xe=n(()=>{let e=(0,X.c)(38),r=T(),[i,Y]=(0,P.useState)("all"),[l,Z]=(0,P.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:_,error:c,errorSource:v,isLoading:I,refetch:x}=O(U.listPushSubscriptions,g),N;if(e[1]!==_?.subscriptions||e[2]!==c||e[3]!==v||e[4]!==I||e[5]!==i||e[6]!==x||e[7]!==l||e[8]!==r){let L=_?.subscriptions??[],z=l.trim().toLowerCase(),A=L.filter(s=>i!=="all"&&s.kind!==i?!1:z===""?!0:`${Q(s)} ${s.userId??""}`.toLowerCase().includes(z)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(s=>{Z(s.target.value)},"b"),e[10]=b):b=e[10];let ee=b,w;e[11]!==x?(w=n(()=>{x()},"w"),e[11]=x,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,d;e[14]!==i||e[15]!==r?(d=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(s=>(0,t.jsx)(F,{"aria-selected":i===s,"data-testid":`nt-kind-${s}`,onClick:n(()=>{Y(s)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===s?"secondary":"ghost",children:s==="all"?r("All"):s},s))}),e[14]=i,e[15]=r,e[16]=d):d=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(V,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(F,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(C,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==d||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p,$]}),e[30]=p,e[31]=$,e[32]=d,e[33]=u,e[34]=y):y=e[34];let S;e[35]!==c||e[36]!==v?(S=c!==null&&(0,t.jsx)(q,{error:v,testId:"nt-error"}),e[35]=c,e[36]=v,e[37]=S):S=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,S,c===null&&!I&&A.length===0&&(0,t.jsx)(D,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("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:"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"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(W,{className:"overflow-hidden py-0",children:(0,t.jsx)(B,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(a,{children:r("kind")}),(0,t.jsx)(a,{children:r("endpoint")}),(0,t.jsx)(a,{children:r("user")}),(0,t.jsx)(a,{children:r("last seen")}),(0,t.jsx)(a,{children:r("status")}),(0,t.jsx)(a,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(s=>{let R=Q(s);return(0,t.jsxs)(M,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(C,{variant:"outline",children:s.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:R,children:R}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:s.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:H(s.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(C,{"data-testid":`nt-status-${s.id}`,variant:ne(s.lastStatus),children:s.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:s.lastError??void 0,children:s.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},s.id)})})]})})})]}),e[1]=_?.subscriptions,e[2]=c,e[3]=v,e[4]=I,e[5]=i,e[6]=x,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ve");export{xe as NotificationsPanel};