@lunora/studio 1.0.0-alpha.43 → 1.0.0-alpha.45
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/standalone/{chunk-W3SHEIAL.js → chunk-245TEXSO.js} +2 -2
- package/dist/standalone/{chunk-ISDZPW3V.js → chunk-2BBENYBY.js} +1 -1
- package/dist/standalone/{chunk-2ANAF4ZM.js → chunk-34B5ECBI.js} +1 -1
- package/dist/standalone/{chunk-GUI5GFFI.js → chunk-3IJLM4GF.js} +1 -1
- package/dist/standalone/{chunk-7MVSQS7B.js → chunk-3JO76DWI.js} +1 -1
- package/dist/standalone/{chunk-IN2SYVJB.js → chunk-3SKIYIBN.js} +1 -1
- package/dist/standalone/chunk-4WGGEF73.js +8 -0
- package/dist/standalone/{chunk-GTLEWM5Y.js → chunk-5KUKYIU6.js} +1 -1
- package/dist/standalone/{chunk-EQZQOTJY.js → chunk-6CRKDJNL.js} +1 -1
- package/dist/standalone/{chunk-BX5MKYOC.js → chunk-6HW2RKAX.js} +1 -1
- package/dist/standalone/{chunk-5C4TSNE6.js → chunk-73BV73BI.js} +1 -1
- package/dist/standalone/{chunk-BGXOXASQ.js → chunk-7JOVXGO4.js} +1 -1
- package/dist/standalone/{chunk-J73VHFCL.js → chunk-7KR346F4.js} +1 -1
- package/dist/standalone/{chunk-6VO23MMW.js → chunk-7XTR7BWT.js} +1 -1
- package/dist/standalone/{chunk-JPRH6DPK.js → chunk-AFCBRDRQ.js} +1 -1
- package/dist/standalone/{chunk-UKDJ4H7I.js → chunk-ATG3655M.js} +1 -1
- package/dist/standalone/{chunk-HZK5RQHG.js → chunk-AX7GYUQC.js} +1 -1
- package/dist/standalone/{chunk-ZFNBPAIZ.js → chunk-B4TTGYIX.js} +1 -1
- package/dist/standalone/{chunk-W3JK4YWR.js → chunk-BGHGKAOM.js} +1 -1
- package/dist/standalone/{chunk-HYDJNCGW.js → chunk-BL45HXOJ.js} +1 -1
- package/dist/standalone/{chunk-RHZ4M2NZ.js → chunk-EOSXQTSQ.js} +1 -1
- package/dist/standalone/{chunk-6HSHEMZV.js → chunk-ERUIC6WI.js} +1 -1
- package/dist/standalone/{chunk-OZACQNKG.js → chunk-ERXJPMCU.js} +1 -1
- package/dist/standalone/{chunk-WIHXMNUY.js → chunk-GNMTLLGB.js} +1 -1
- package/dist/standalone/{chunk-THNBTMUF.js → chunk-I34RPZ7P.js} +1 -1
- package/dist/standalone/{chunk-KYJPPVGB.js → chunk-I4RSHYDW.js} +1 -1
- package/dist/standalone/{chunk-KQV4NGH3.js → chunk-ICIQ2GWQ.js} +1 -1
- package/dist/standalone/{chunk-JHKMUTIF.js → chunk-J75M4LTW.js} +1 -1
- package/dist/standalone/{chunk-HN6KJXYQ.js → chunk-JEVKZIHN.js} +1 -1
- package/dist/standalone/{chunk-KUH4P5F5.js → chunk-KFNNMXUZ.js} +1 -1
- package/dist/standalone/{chunk-YBGC4PPD.js → chunk-KMNEQEHM.js} +1 -1
- package/dist/standalone/chunk-M5OMEMQ3.js +1 -0
- package/dist/standalone/{chunk-TMYVNQ66.js → chunk-MP5MTWY5.js} +1 -1
- package/dist/standalone/{chunk-PNDNXS5Z.js → chunk-O4YNKFCZ.js} +1 -1
- package/dist/standalone/{chunk-IOANPSJN.js → chunk-OLUEBOHS.js} +1 -1
- package/dist/standalone/{chunk-N2X2OO4V.js → chunk-OOETIPAO.js} +1 -1
- package/dist/standalone/{chunk-MJWVMKQ4.js → chunk-OQPT2BEZ.js} +1 -1
- package/dist/standalone/{chunk-WLDVXVI2.js → chunk-P7AMKXU2.js} +1 -1
- package/dist/standalone/{chunk-UJB2LEI4.js → chunk-PBXQ5QS4.js} +1 -1
- package/dist/standalone/{chunk-TDZ44E5I.js → chunk-PKIPNNRD.js} +1 -1
- package/dist/standalone/{chunk-NGKITPQP.js → chunk-PXR5E7AX.js} +1 -1
- package/dist/standalone/{chunk-447TAUFD.js → chunk-QB3QUTSJ.js} +1 -1
- package/dist/standalone/{chunk-MLZYX5CQ.js → chunk-QQH2YTBW.js} +1 -1
- package/dist/standalone/{chunk-KBB75WNT.js → chunk-S6JKSFSO.js} +1 -1
- package/dist/standalone/{chunk-L2TJVSDQ.js → chunk-T4XWXBKR.js} +1 -1
- package/dist/standalone/{chunk-Q7DMUTUE.js → chunk-TU5ZNEZ4.js} +1 -1
- package/dist/standalone/{chunk-3OIHOXVV.js → chunk-WATFBATD.js} +1 -1
- package/dist/standalone/{chunk-LBN7LPVK.js → chunk-WKUGR7ER.js} +1 -1
- package/dist/standalone/{chunk-UGUEC6BC.js → chunk-WKWKAU22.js} +1 -1
- package/dist/standalone/{chunk-YJAPWSDC.js → chunk-WSMZLZWM.js} +1 -1
- package/dist/standalone/{chunk-6JIZ34MB.js → chunk-XFPHUG7M.js} +1 -1
- package/dist/standalone/{chunk-KA5YB3VP.js → chunk-YSF43KIJ.js} +1 -1
- package/dist/standalone/{chunk-TIQISBGK.js → chunk-ZSNXQT4N.js} +1 -1
- package/dist/standalone/{chunk-25AYY4H7.js → chunk-ZTOATVB7.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +10 -10
- package/dist/standalone/chunk-XLXNLJ4N.js +0 -1
- package/dist/standalone/chunk-ZEJB6DXU.js +0 -8
- /package/dist/standalone/{chunk-E75ANNWX.js → chunk-2GMEK2W3.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as He}from"./chunk-YAECF5LW.js";import"./chunk-DWDILV2E.js";import{a as je}from"./chunk-J6J54MBP.js";import"./chunk-5OIBXYZM.js";import{a as Pe}from"./chunk-HN6KJXYQ.js";import{a as Ge}from"./chunk-XNJNSCLM.js";import{a as Be,b as Re,c as $e,d as j,e as E,f as _}from"./chunk-GTM65MVX.js";import{a as Ve}from"./chunk-VLXV72QE.js";import{R as We}from"./chunk-3CJW6NWG.js";import{c as V}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as J}from"./chunk-BOXSWNXZ.js";import{a as ie}from"./chunk-TAD43CG5.js";import{b as De}from"./chunk-RHZ4M2NZ.js";import{a as Le,e as Me}from"./chunk-SEU5V7I6.js";import{b as de}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as Fe}from"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as U,e as ce,f as ue,g as me,k as fe,o as ze}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as f,e as Ie,f as at,g as ot,h as rt}from"./chunk-RRCPZMC2.js";var F=Ie(ot(),1);var w=Ie(at(),1);var t=Ie(rt(),1);var lt=f((o,e)=>{let s=new Set(o.map(a=>a.deadLetterQueue).filter(a=>typeof a=="string"&&a!=="")),i=o.filter(a=>(a.deadLetterQueue===void 0||a.deadLetterQueue==="")&&!s.has(a.name)),n=e.filter(a=>a.deadLettered).length;return{deadLetteredCount:n,queuesWithoutDlq:i,showReliabilityWarning:i.length>0||n>0}},"computeQueueReliability"),nt=200,dt=ce(J.sendQueueMessage),it=ce(J.replayQueueMessage),ct=ce(J.clearQueueMessages),Ye=96,ut=f(o=>{if(o===void 0)return"\u2014";try{return JSON.stringify(o)}catch{return"[unserializable]"}},"formatBody"),mt=f(o=>o.length>Ye?`${o.slice(0,Ye)}\u2026`:o,"truncate"),ft=f(o=>o==="error"?"destructive":o==="retry"?"outline":"secondary","outcomeVariant"),ht=f((o,e)=>e(o==="messages"?"Messages":o==="send"?"Send":"Declared"),"tabLabel"),pt=f(o=>{let e=(0,F.c)(11),{loaded:s,queues:i}=o,n=U(),a;e[0]!==n?(a=n("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==a?(l=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a},void 0,!1),e[2]=a,e[3]=l):l=e[3];let r;e[4]!==s||e[5]!==i||e[6]!==n?(r=s&&i.length===0?(0,t.jsxDEV)(ie,{description:n("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:n("No queues defined")},void 0,!1):(0,t.jsxDEV)(Le,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Me,{className:"px-0",children:(0,t.jsxDEV)(Be,{"data-testid":"queues-table",children:[(0,t.jsxDEV)(Re,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(E,{children:n("Export")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Queue")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Mode")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Binding")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Dead-letter")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)($e,{children:i.map(yt)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[4]=s,e[5]=i,e[6]=n,e[7]=r):r=e[7];let h;return e[8]!==l||e[9]!==r?(h=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[l,r]},void 0,!0),e[8]=l,e[9]=r,e[10]=h):h=e[10],h},"QueuesDeclaredTab"),gt=f(o=>{let e=(0,F.c)(67),{message:s,onReplay:i,replayingId:n}=o,a=U(),l,r,h,u,y,p,x,d,m,g;if(e[0]!==s.attempts||e[1]!==s.body||e[2]!==s.deadLettered||e[3]!==s.exportName||e[4]!==s.id||e[5]!==s.messageId||e[6]!==s.outcome||e[7]!==s.queue||e[8]!==a){let W=ut(s.body);r=j,p=`queues-message-${s.id}`;let z=s.exportName??s.queue;e[19]!==z?(x=(0,t.jsxDEV)(_,{className:"font-mono text-xs",children:z},void 0,!1),e[19]=z,e[20]=x):x=e[20],e[21]!==s.messageId?(d=(0,t.jsxDEV)(_,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:s.messageId,children:s.messageId},void 0,!1),e[21]=s.messageId,e[22]=d):d=e[22],e[23]!==s.attempts?(m=(0,t.jsxDEV)(_,{className:"font-mono text-xs tabular-nums",children:s.attempts},void 0,!1),e[23]=s.attempts,e[24]=m):m=e[24];let I=`queues-outcome-${s.id}`,L;e[25]!==s.outcome?(L=ft(s.outcome),e[25]=s.outcome,e[26]=L):L=e[26];let T;e[27]!==s.outcome||e[28]!==I||e[29]!==L?(T=(0,t.jsxDEV)(de,{"data-testid":I,variant:L,children:s.outcome},void 0,!1),e[27]=s.outcome,e[28]=I,e[29]=L,e[30]=T):T=e[30];let M;e[31]!==s.deadLettered||e[32]!==s.id||e[33]!==a?(M=s.deadLettered&&(0,t.jsxDEV)(de,{"data-testid":`queues-dlq-${s.id}`,variant:"destructive",children:a("DLQ")},void 0,!1),e[31]=s.deadLettered,e[32]=s.id,e[33]=a,e[34]=M):M=e[34],e[35]!==T||e[36]!==M?(g=(0,t.jsxDEV)(_,{children:(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1",children:[T,M]},void 0,!0)},void 0,!1),e[35]=T,e[36]=M,e[37]=g):g=e[37],l=_,h="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=W,y=mt(W),e[0]=s.attempts,e[1]=s.body,e[2]=s.deadLettered,e[3]=s.exportName,e[4]=s.id,e[5]=s.messageId,e[6]=s.outcome,e[7]=s.queue,e[8]=a,e[9]=l,e[10]=r,e[11]=h,e[12]=u,e[13]=y,e[14]=p,e[15]=x,e[16]=d,e[17]=m,e[18]=g}else l=e[9],r=e[10],h=e[11],u=e[12],y=e[13],p=e[14],x=e[15],d=e[16],m=e[17],g=e[18];let v;e[38]!==l||e[39]!==h||e[40]!==u||e[41]!==y?(v=(0,t.jsxDEV)(l,{className:h,title:u,children:y},void 0,!1),e[38]=l,e[39]=h,e[40]=u,e[41]=y,e[42]=v):v=e[42];let N;e[43]!==s.capturedAt?(N=ze(s.capturedAt,"\u2014"),e[43]=s.capturedAt,e[44]=N):N=e[44];let b;e[45]!==N?(b=(0,t.jsxDEV)(_,{className:"text-xs text-muted-foreground tabular-nums",children:N},void 0,!1),e[45]=N,e[46]=b):b=e[46];let S=`queues-replay-${s.id}`,A=n!==null,C;e[47]!==s.id||e[48]!==n||e[49]!==a?(C=n===s.id?a("Replaying\u2026"):a("Replay"),e[47]=s.id,e[48]=n,e[49]=a,e[50]=C):C=e[50];let Q;e[51]!==s.id||e[52]!==i||e[53]!==S||e[54]!==A||e[55]!==C?(Q=(0,t.jsxDEV)(_,{children:(0,t.jsxDEV)(V,{"data-id":s.id,"data-testid":S,disabled:A,onClick:i,size:"xs",type:"button",variant:"outline",children:C},void 0,!1)},void 0,!1),e[51]=s.id,e[52]=i,e[53]=S,e[54]=A,e[55]=C,e[56]=Q):Q=e[56];let D;return e[57]!==r||e[58]!==b||e[59]!==Q||e[60]!==p||e[61]!==x||e[62]!==d||e[63]!==m||e[64]!==g||e[65]!==v?(D=(0,t.jsxDEV)(r,{"data-testid":p,children:[x,d,m,g,v,b,Q]},void 0,!0),e[57]=r,e[58]=b,e[59]=Q,e[60]=p,e[61]=x,e[62]=d,e[63]=m,e[64]=g,e[65]=v,e[66]=D):D=e[66],D},"QueueLogRow"),vt=f(o=>{let e=(0,F.c)(26),{hasError:s,messages:i,onClear:n,onReplay:a,replayingId:l}=o,r=U(),h;e[0]!==r?(h=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=h):h=e[1];let u;e[2]!==h?(u=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:h},void 0,!1),e[2]=h,e[3]=u):u=e[3];let y=i.length===0,p;e[4]!==r?(p=r("Clear log"),e[4]=r,e[5]=p):p=e[5];let x;e[6]!==n||e[7]!==y||e[8]!==p?(x=(0,t.jsxDEV)(V,{className:"ml-auto","data-testid":"queues-clear",disabled:y,onClick:n,size:"sm",type:"button",variant:"outline",children:p},void 0,!1),e[6]=n,e[7]=y,e[8]=p,e[9]=x):x=e[9];let d;e[10]!==i.length||e[11]!==r?(d=i.length>0&&(0,t.jsxDEV)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:i.length})},void 0,!1),e[10]=i.length,e[11]=r,e[12]=d):d=e[12];let m;e[13]!==u||e[14]!==x||e[15]!==d?(m=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[u,x,d]},void 0,!0),e[13]=u,e[14]=x,e[15]=d,e[16]=m):m=e[16];let g;e[17]!==s||e[18]!==i||e[19]!==a||e[20]!==l||e[21]!==r?(g=!s&&i.length===0?(0,t.jsxDEV)(ie,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")},void 0,!1):(0,t.jsxDEV)(Le,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Me,{className:"px-0",children:(0,t.jsxDEV)(He,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxDEV)(Be,{"data-testid":"queues-messages-table",children:[(0,t.jsxDEV)(Re,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(E,{children:r("Export")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Message")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Attempts")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Outcome")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Body")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Captured")},void 0,!1),(0,t.jsxDEV)(E,{},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)($e,{children:i.map(N=>(0,t.jsxDEV)(gt,{message:N,onReplay:a,replayingId:l},N.id,!1))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)},void 0,!1),e[17]=s,e[18]=i,e[19]=a,e[20]=l,e[21]=r,e[22]=g):g=e[22];let v;return e[23]!==m||e[24]!==g?(v=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[m,g]},void 0,!0),e[23]=m,e[24]=g,e[25]=v):v=e[25],v},"QueuesMessagesTab"),xt=f(o=>{let e=(0,F.c)(20),{batchMode:s,bodyText:i,delayText:n,onBatchModeChange:a,onBodyChange:l,onDelayChange:r,onSelectExport:h,onSend:u,queues:y,selectedExportName:p,sending:x}=o,d=U(),m;e[0]!==d?(m=d("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=d,e[1]=m):m=e[1];let g;e[2]!==m?(g=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:m},void 0,!1),e[2]=m,e[3]=g):g=e[3];let v;e[4]!==s||e[5]!==i||e[6]!==n||e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==h||e[11]!==u||e[12]!==y||e[13]!==p||e[14]!==x||e[15]!==d?(v=y.length===0?(0,t.jsxDEV)(ie,{description:d("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:d("No queues to send to")},void 0,!1):(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)("select",{"aria-label":d("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:h,value:p,children:y.map(bt)},void 0,!1),(0,t.jsxDEV)(We,{"aria-label":d("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:d("Delay (s)"),type:"number",value:n},void 0,!1),(0,t.jsxDEV)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsxDEV)("input",{checked:s,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:a,type:"checkbox"},void 0,!1),d("Send as batch (JSON array)")]},void 0,!0),(0,t.jsxDEV)(V,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||p==="",onClick:u,type:"button",children:d(x?"Sending\u2026":"Send message")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(Ve,{"aria-label":d("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:s?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:i},void 0,!1)]},void 0,!0),e[4]=s,e[5]=i,e[6]=n,e[7]=a,e[8]=l,e[9]=r,e[10]=h,e[11]=u,e[12]=y,e[13]=p,e[14]=x,e[15]=d,e[16]=v):v=e[16];let N;return e[17]!==g||e[18]!==v?(N=(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[g,v]},void 0,!0),e[17]=g,e[18]=v,e[19]=N):N=e[19],N},"QueuesSendTab"),Ut=f(o=>{let e=(0,F.c)(59),{limit:s}=o,i=s??nt,n=Fe(),a=U(),[l,r]=(0,w.useState)("declared"),[h,u]=(0,w.useState)(null),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={},e[0]=y):y=e[0];let{data:p,error:x,errorSource:d}=De(J.listQueues,y),m;e[1]!==i?(m={limit:i},e[1]=i,e[2]=m):m=e[2];let{data:g,error:v,errorSource:N,refetch:b}=De(J.getQueueMessages,m),S=Array.isArray(p?.queues)?[...p.queues].toSorted(Nt):[],A=g?.entries??[],{deadLetteredCount:C,queuesWithoutDlq:Q,showReliabilityWarning:D}=lt(S,A),[W,z]=(0,w.useState)(""),[I,L]=(0,w.useState)(""),[T,M]=(0,w.useState)(""),[G,Xe]=(0,w.useState)(!1),[he,Oe]=(0,w.useState)(!1),[pe,ke]=(0,w.useState)(null),H=S.some(c=>c.exportName===W)?W:S[0]?.exportName??"",Ue=l==="messages"?v:x,Ke=l==="messages"?N:d,ge=Ue??h,ve=Ue===null?h:Ke,Y;e[3]!==b?(Y=f(()=>{b()},"t3"),e[3]=b,e[4]=Y):Y=e[4],je(Y,l==="messages");let xe=f(async()=>{u(null);let c=H;if(c==="")return;let q=null,we=I.trim();if(we!=="")try{q=JSON.parse(we)}catch{u(a("Body must be valid JSON."));return}let Ae,Je=T.trim();if(Je!==""){let P=Number(Je);if(!Number.isFinite(P)||P<0){u(a("Delay must be a non-negative number of seconds."));return}Ae=P}if(G&&!Array.isArray(q)){u(a("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=G?{batch:q,delaySeconds:Ae,exportName:c}:{body:q,delaySeconds:Ae,exportName:c};try{await n.query(dt,st,ue("")),b()}catch(P){u(me(P))}Oe(!1)},"send"),X;e[5]!==n||e[6]!==b?(X=f(async c=>{u(null),ke(c);try{await n.query(it,{id:c},ue("")),b()}catch(q){u(me(q))}ke(null)},"t5"),e[5]=n,e[6]=b,e[7]=X):X=e[7];let ye=X,K;e[8]!==n||e[9]!==b?(K=f(async()=>{u(null);try{await n.query(ct,{},ue("")),b()}catch(c){u(me(c))}},"t6"),e[8]=n,e[9]=b,e[10]=K):K=e[10];let be=K,Z;e[11]===Symbol.for("react.memo_cache_sentinel")?(Z=f(c=>{let q=c.currentTarget.dataset.tab;(q==="declared"||q==="messages"||q==="send")&&r(q)},"t7"),e[11]=Z):Z=e[11];let Ze=Z,ee;e[12]===Symbol.for("react.memo_cache_sentinel")?(ee=f(c=>{z(c.currentTarget.value)},"t8"),e[12]=ee):ee=e[12];let Ne=ee,te;e[13]===Symbol.for("react.memo_cache_sentinel")?(te=f(c=>{L(c.currentTarget.value)},"t9"),e[13]=te):te=e[13];let qe=te,se;e[14]===Symbol.for("react.memo_cache_sentinel")?(se=f(c=>{M(c.currentTarget.value)},"t10"),e[14]=se):se=e[14];let Se=se,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=f(c=>{Xe(c.currentTarget.checked)},"t11"),e[15]=ae):ae=e[15];let Ee=ae,oe;e[16]!==xe?(oe=f(()=>{fe(xe())},"t12"),e[16]=xe,e[17]=oe):oe=e[17];let _e=oe,re;e[18]!==ye?(re=f(c=>{let{id:q}=c.currentTarget.dataset;q!==void 0&&fe(ye(q))},"t13"),e[18]=ye,e[19]=re):re=e[19];let Te=re,le;e[20]!==be?(le=f(()=>{fe(be())},"t14"),e[20]=be,e[21]=le):le=e[21];let Ce=le,et="flex flex-col gap-6",tt="lunora-queues-panel",B;e[22]!==a||e[23]!==l?(B=(0,t.jsxDEV)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(c=>(0,t.jsxDEV)(V,{"aria-selected":l===c,"data-tab":c,"data-testid":`queues-tab-${c}`,onClick:Ze,role:"tab",size:"sm",type:"button",variant:l===c?"secondary":"ghost",children:ht(c,a)},c,!1))},void 0,!1),e[22]=a,e[23]=l,e[24]=B):B=e[24];let R;e[25]!==ge||e[26]!==ve?(R=ge!==null&&(0,t.jsxDEV)(Pe,{error:ve,testId:"queues-error"},void 0,!1),e[25]=ge,e[26]=ve,e[27]=R):R=e[27];let Qe=D&&(0,t.jsxDEV)(Ge,{icon:(0,t.jsxDEV)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"},void 0,!1),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxDEV)("div",{className:"flex flex-col gap-1",children:[Q.length>0&&(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("p",{className:"font-medium",children:a("No dead-letter queue on {queues}.",{queues:Q.map(qt).join(", ")})},void 0,!1),(0,t.jsxDEV)("p",{className:"text-muted-foreground",children:a("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")},void 0,!1)]},void 0,!0),C>0&&(0,t.jsxDEV)("p",{className:Q.length>0?"text-muted-foreground":"font-medium",children:C===1?a("1 message was recently dead-lettered."):a("{count} messages were recently dead-lettered.",{count:C})},void 0,!1)]},void 0,!0)},void 0,!1),$;e[28]!==S||e[29]!==p||e[30]!==l?($=l==="declared"&&(0,t.jsxDEV)(pt,{loaded:p!==void 0,queues:S},void 0,!1),e[28]=S,e[29]=p,e[30]=l,e[31]=$):$=e[31];let O;e[32]!==A||e[33]!==v||e[34]!==Ce||e[35]!==Te||e[36]!==pe||e[37]!==l?(O=l==="messages"&&(0,t.jsxDEV)(vt,{hasError:v!==null,messages:A,onClear:Ce,onReplay:Te,replayingId:pe},void 0,!1),e[32]=A,e[33]=v,e[34]=Ce,e[35]=Te,e[36]=pe,e[37]=l,e[38]=O):O=e[38];let k;e[39]!==G||e[40]!==I||e[41]!==T||e[42]!==Ee||e[43]!==qe||e[44]!==Se||e[45]!==Ne||e[46]!==_e||e[47]!==S||e[48]!==H||e[49]!==he||e[50]!==l?(k=l==="send"&&(0,t.jsxDEV)(xt,{batchMode:G,bodyText:I,delayText:T,onBatchModeChange:Ee,onBodyChange:qe,onDelayChange:Se,onSelectExport:Ne,onSend:_e,queues:S,selectedExportName:H,sending:he},void 0,!1),e[39]=G,e[40]=I,e[41]=T,e[42]=Ee,e[43]=qe,e[44]=Se,e[45]=Ne,e[46]=_e,e[47]=S,e[48]=H,e[49]=he,e[50]=l,e[51]=k):k=e[51];let ne;return e[52]!==B||e[53]!==R||e[54]!==Qe||e[55]!==$||e[56]!==O||e[57]!==k?(ne=(0,t.jsxDEV)("div",{className:et,"data-testid":tt,children:[B,R,Qe,$,O,k]},void 0,!0),e[52]=B,e[53]=R,e[54]=Qe,e[55]=$,e[56]=O,e[57]=k,e[58]=ne):ne=e[58],ne},"QueuesPanel");function yt(o){return(0,t.jsxDEV)(j,{"data-testid":`queues-row-${o.exportName}`,children:[(0,t.jsxDEV)(_,{className:"font-mono text-xs",children:o.exportName},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.name},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.mode},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.binding},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.deadLetterQueue??"\u2014"},void 0,!1)]},o.exportName,!0)}f(yt,"_temp");function bt(o){return(0,t.jsxDEV)("option",{value:o.exportName,children:o.exportName},o.exportName,!1)}f(bt,"_temp2");function Nt(o,e){return o.exportName.localeCompare(e.exportName)}f(Nt,"_temp3");function qt(o){return o.name}f(qt,"_temp4");export{Ut as default};
|
|
1
|
+
import{a as He}from"./chunk-YAECF5LW.js";import"./chunk-DWDILV2E.js";import{a as je}from"./chunk-J6J54MBP.js";import"./chunk-5OIBXYZM.js";import{a as Pe}from"./chunk-JEVKZIHN.js";import{a as Ge}from"./chunk-XNJNSCLM.js";import{a as Be,b as Re,c as $e,d as j,e as E,f as _}from"./chunk-GTM65MVX.js";import{a as Ve}from"./chunk-VLXV72QE.js";import{R as We}from"./chunk-3CJW6NWG.js";import{c as V}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as J}from"./chunk-BOXSWNXZ.js";import{a as ie}from"./chunk-TAD43CG5.js";import{b as De}from"./chunk-EOSXQTSQ.js";import{a as Le,e as Me}from"./chunk-SEU5V7I6.js";import{b as de}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as Fe}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as U,e as ce,f as ue,g as me,k as fe,o as ze}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a as f,e as Ie,f as at,g as ot,h as rt}from"./chunk-RRCPZMC2.js";var F=Ie(ot(),1);var w=Ie(at(),1);var t=Ie(rt(),1);var lt=f((o,e)=>{let s=new Set(o.map(a=>a.deadLetterQueue).filter(a=>typeof a=="string"&&a!=="")),i=o.filter(a=>(a.deadLetterQueue===void 0||a.deadLetterQueue==="")&&!s.has(a.name)),n=e.filter(a=>a.deadLettered).length;return{deadLetteredCount:n,queuesWithoutDlq:i,showReliabilityWarning:i.length>0||n>0}},"computeQueueReliability"),nt=200,dt=ce(J.sendQueueMessage),it=ce(J.replayQueueMessage),ct=ce(J.clearQueueMessages),Ye=96,ut=f(o=>{if(o===void 0)return"\u2014";try{return JSON.stringify(o)}catch{return"[unserializable]"}},"formatBody"),mt=f(o=>o.length>Ye?`${o.slice(0,Ye)}\u2026`:o,"truncate"),ft=f(o=>o==="error"?"destructive":o==="retry"?"outline":"secondary","outcomeVariant"),ht=f((o,e)=>e(o==="messages"?"Messages":o==="send"?"Send":"Declared"),"tabLabel"),pt=f(o=>{let e=(0,F.c)(11),{loaded:s,queues:i}=o,n=U(),a;e[0]!==n?(a=n("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==a?(l=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a},void 0,!1),e[2]=a,e[3]=l):l=e[3];let r;e[4]!==s||e[5]!==i||e[6]!==n?(r=s&&i.length===0?(0,t.jsxDEV)(ie,{description:n("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:n("No queues defined")},void 0,!1):(0,t.jsxDEV)(Le,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Me,{className:"px-0",children:(0,t.jsxDEV)(Be,{"data-testid":"queues-table",children:[(0,t.jsxDEV)(Re,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(E,{children:n("Export")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Queue")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Mode")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Binding")},void 0,!1),(0,t.jsxDEV)(E,{children:n("Dead-letter")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)($e,{children:i.map(yt)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[4]=s,e[5]=i,e[6]=n,e[7]=r):r=e[7];let h;return e[8]!==l||e[9]!==r?(h=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[l,r]},void 0,!0),e[8]=l,e[9]=r,e[10]=h):h=e[10],h},"QueuesDeclaredTab"),gt=f(o=>{let e=(0,F.c)(67),{message:s,onReplay:i,replayingId:n}=o,a=U(),l,r,h,u,y,p,x,d,m,g;if(e[0]!==s.attempts||e[1]!==s.body||e[2]!==s.deadLettered||e[3]!==s.exportName||e[4]!==s.id||e[5]!==s.messageId||e[6]!==s.outcome||e[7]!==s.queue||e[8]!==a){let W=ut(s.body);r=j,p=`queues-message-${s.id}`;let z=s.exportName??s.queue;e[19]!==z?(x=(0,t.jsxDEV)(_,{className:"font-mono text-xs",children:z},void 0,!1),e[19]=z,e[20]=x):x=e[20],e[21]!==s.messageId?(d=(0,t.jsxDEV)(_,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:s.messageId,children:s.messageId},void 0,!1),e[21]=s.messageId,e[22]=d):d=e[22],e[23]!==s.attempts?(m=(0,t.jsxDEV)(_,{className:"font-mono text-xs tabular-nums",children:s.attempts},void 0,!1),e[23]=s.attempts,e[24]=m):m=e[24];let I=`queues-outcome-${s.id}`,L;e[25]!==s.outcome?(L=ft(s.outcome),e[25]=s.outcome,e[26]=L):L=e[26];let T;e[27]!==s.outcome||e[28]!==I||e[29]!==L?(T=(0,t.jsxDEV)(de,{"data-testid":I,variant:L,children:s.outcome},void 0,!1),e[27]=s.outcome,e[28]=I,e[29]=L,e[30]=T):T=e[30];let M;e[31]!==s.deadLettered||e[32]!==s.id||e[33]!==a?(M=s.deadLettered&&(0,t.jsxDEV)(de,{"data-testid":`queues-dlq-${s.id}`,variant:"destructive",children:a("DLQ")},void 0,!1),e[31]=s.deadLettered,e[32]=s.id,e[33]=a,e[34]=M):M=e[34],e[35]!==T||e[36]!==M?(g=(0,t.jsxDEV)(_,{children:(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1",children:[T,M]},void 0,!0)},void 0,!1),e[35]=T,e[36]=M,e[37]=g):g=e[37],l=_,h="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=W,y=mt(W),e[0]=s.attempts,e[1]=s.body,e[2]=s.deadLettered,e[3]=s.exportName,e[4]=s.id,e[5]=s.messageId,e[6]=s.outcome,e[7]=s.queue,e[8]=a,e[9]=l,e[10]=r,e[11]=h,e[12]=u,e[13]=y,e[14]=p,e[15]=x,e[16]=d,e[17]=m,e[18]=g}else l=e[9],r=e[10],h=e[11],u=e[12],y=e[13],p=e[14],x=e[15],d=e[16],m=e[17],g=e[18];let v;e[38]!==l||e[39]!==h||e[40]!==u||e[41]!==y?(v=(0,t.jsxDEV)(l,{className:h,title:u,children:y},void 0,!1),e[38]=l,e[39]=h,e[40]=u,e[41]=y,e[42]=v):v=e[42];let N;e[43]!==s.capturedAt?(N=ze(s.capturedAt,"\u2014"),e[43]=s.capturedAt,e[44]=N):N=e[44];let b;e[45]!==N?(b=(0,t.jsxDEV)(_,{className:"text-xs text-muted-foreground tabular-nums",children:N},void 0,!1),e[45]=N,e[46]=b):b=e[46];let S=`queues-replay-${s.id}`,A=n!==null,C;e[47]!==s.id||e[48]!==n||e[49]!==a?(C=n===s.id?a("Replaying\u2026"):a("Replay"),e[47]=s.id,e[48]=n,e[49]=a,e[50]=C):C=e[50];let Q;e[51]!==s.id||e[52]!==i||e[53]!==S||e[54]!==A||e[55]!==C?(Q=(0,t.jsxDEV)(_,{children:(0,t.jsxDEV)(V,{"data-id":s.id,"data-testid":S,disabled:A,onClick:i,size:"xs",type:"button",variant:"outline",children:C},void 0,!1)},void 0,!1),e[51]=s.id,e[52]=i,e[53]=S,e[54]=A,e[55]=C,e[56]=Q):Q=e[56];let D;return e[57]!==r||e[58]!==b||e[59]!==Q||e[60]!==p||e[61]!==x||e[62]!==d||e[63]!==m||e[64]!==g||e[65]!==v?(D=(0,t.jsxDEV)(r,{"data-testid":p,children:[x,d,m,g,v,b,Q]},void 0,!0),e[57]=r,e[58]=b,e[59]=Q,e[60]=p,e[61]=x,e[62]=d,e[63]=m,e[64]=g,e[65]=v,e[66]=D):D=e[66],D},"QueueLogRow"),vt=f(o=>{let e=(0,F.c)(26),{hasError:s,messages:i,onClear:n,onReplay:a,replayingId:l}=o,r=U(),h;e[0]!==r?(h=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=h):h=e[1];let u;e[2]!==h?(u=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:h},void 0,!1),e[2]=h,e[3]=u):u=e[3];let y=i.length===0,p;e[4]!==r?(p=r("Clear log"),e[4]=r,e[5]=p):p=e[5];let x;e[6]!==n||e[7]!==y||e[8]!==p?(x=(0,t.jsxDEV)(V,{className:"ml-auto","data-testid":"queues-clear",disabled:y,onClick:n,size:"sm",type:"button",variant:"outline",children:p},void 0,!1),e[6]=n,e[7]=y,e[8]=p,e[9]=x):x=e[9];let d;e[10]!==i.length||e[11]!==r?(d=i.length>0&&(0,t.jsxDEV)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:i.length})},void 0,!1),e[10]=i.length,e[11]=r,e[12]=d):d=e[12];let m;e[13]!==u||e[14]!==x||e[15]!==d?(m=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[u,x,d]},void 0,!0),e[13]=u,e[14]=x,e[15]=d,e[16]=m):m=e[16];let g;e[17]!==s||e[18]!==i||e[19]!==a||e[20]!==l||e[21]!==r?(g=!s&&i.length===0?(0,t.jsxDEV)(ie,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")},void 0,!1):(0,t.jsxDEV)(Le,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Me,{className:"px-0",children:(0,t.jsxDEV)(He,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxDEV)(Be,{"data-testid":"queues-messages-table",children:[(0,t.jsxDEV)(Re,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(E,{children:r("Export")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Message")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Attempts")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Outcome")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Body")},void 0,!1),(0,t.jsxDEV)(E,{children:r("Captured")},void 0,!1),(0,t.jsxDEV)(E,{},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)($e,{children:i.map(N=>(0,t.jsxDEV)(gt,{message:N,onReplay:a,replayingId:l},N.id,!1))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)},void 0,!1),e[17]=s,e[18]=i,e[19]=a,e[20]=l,e[21]=r,e[22]=g):g=e[22];let v;return e[23]!==m||e[24]!==g?(v=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[m,g]},void 0,!0),e[23]=m,e[24]=g,e[25]=v):v=e[25],v},"QueuesMessagesTab"),xt=f(o=>{let e=(0,F.c)(20),{batchMode:s,bodyText:i,delayText:n,onBatchModeChange:a,onBodyChange:l,onDelayChange:r,onSelectExport:h,onSend:u,queues:y,selectedExportName:p,sending:x}=o,d=U(),m;e[0]!==d?(m=d("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=d,e[1]=m):m=e[1];let g;e[2]!==m?(g=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:m},void 0,!1),e[2]=m,e[3]=g):g=e[3];let v;e[4]!==s||e[5]!==i||e[6]!==n||e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==h||e[11]!==u||e[12]!==y||e[13]!==p||e[14]!==x||e[15]!==d?(v=y.length===0?(0,t.jsxDEV)(ie,{description:d("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:d("No queues to send to")},void 0,!1):(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)("select",{"aria-label":d("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:h,value:p,children:y.map(bt)},void 0,!1),(0,t.jsxDEV)(We,{"aria-label":d("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:d("Delay (s)"),type:"number",value:n},void 0,!1),(0,t.jsxDEV)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsxDEV)("input",{checked:s,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:a,type:"checkbox"},void 0,!1),d("Send as batch (JSON array)")]},void 0,!0),(0,t.jsxDEV)(V,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||p==="",onClick:u,type:"button",children:d(x?"Sending\u2026":"Send message")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(Ve,{"aria-label":d("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:s?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:i},void 0,!1)]},void 0,!0),e[4]=s,e[5]=i,e[6]=n,e[7]=a,e[8]=l,e[9]=r,e[10]=h,e[11]=u,e[12]=y,e[13]=p,e[14]=x,e[15]=d,e[16]=v):v=e[16];let N;return e[17]!==g||e[18]!==v?(N=(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[g,v]},void 0,!0),e[17]=g,e[18]=v,e[19]=N):N=e[19],N},"QueuesSendTab"),Ut=f(o=>{let e=(0,F.c)(59),{limit:s}=o,i=s??nt,n=Fe(),a=U(),[l,r]=(0,w.useState)("declared"),[h,u]=(0,w.useState)(null),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={},e[0]=y):y=e[0];let{data:p,error:x,errorSource:d}=De(J.listQueues,y),m;e[1]!==i?(m={limit:i},e[1]=i,e[2]=m):m=e[2];let{data:g,error:v,errorSource:N,refetch:b}=De(J.getQueueMessages,m),S=Array.isArray(p?.queues)?[...p.queues].toSorted(Nt):[],A=g?.entries??[],{deadLetteredCount:C,queuesWithoutDlq:Q,showReliabilityWarning:D}=lt(S,A),[W,z]=(0,w.useState)(""),[I,L]=(0,w.useState)(""),[T,M]=(0,w.useState)(""),[G,Xe]=(0,w.useState)(!1),[he,Oe]=(0,w.useState)(!1),[pe,ke]=(0,w.useState)(null),H=S.some(c=>c.exportName===W)?W:S[0]?.exportName??"",Ue=l==="messages"?v:x,Ke=l==="messages"?N:d,ge=Ue??h,ve=Ue===null?h:Ke,Y;e[3]!==b?(Y=f(()=>{b()},"t3"),e[3]=b,e[4]=Y):Y=e[4],je(Y,l==="messages");let xe=f(async()=>{u(null);let c=H;if(c==="")return;let q=null,we=I.trim();if(we!=="")try{q=JSON.parse(we)}catch{u(a("Body must be valid JSON."));return}let Ae,Je=T.trim();if(Je!==""){let P=Number(Je);if(!Number.isFinite(P)||P<0){u(a("Delay must be a non-negative number of seconds."));return}Ae=P}if(G&&!Array.isArray(q)){u(a("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=G?{batch:q,delaySeconds:Ae,exportName:c}:{body:q,delaySeconds:Ae,exportName:c};try{await n.query(dt,st,ue("")),b()}catch(P){u(me(P))}Oe(!1)},"send"),X;e[5]!==n||e[6]!==b?(X=f(async c=>{u(null),ke(c);try{await n.query(it,{id:c},ue("")),b()}catch(q){u(me(q))}ke(null)},"t5"),e[5]=n,e[6]=b,e[7]=X):X=e[7];let ye=X,K;e[8]!==n||e[9]!==b?(K=f(async()=>{u(null);try{await n.query(ct,{},ue("")),b()}catch(c){u(me(c))}},"t6"),e[8]=n,e[9]=b,e[10]=K):K=e[10];let be=K,Z;e[11]===Symbol.for("react.memo_cache_sentinel")?(Z=f(c=>{let q=c.currentTarget.dataset.tab;(q==="declared"||q==="messages"||q==="send")&&r(q)},"t7"),e[11]=Z):Z=e[11];let Ze=Z,ee;e[12]===Symbol.for("react.memo_cache_sentinel")?(ee=f(c=>{z(c.currentTarget.value)},"t8"),e[12]=ee):ee=e[12];let Ne=ee,te;e[13]===Symbol.for("react.memo_cache_sentinel")?(te=f(c=>{L(c.currentTarget.value)},"t9"),e[13]=te):te=e[13];let qe=te,se;e[14]===Symbol.for("react.memo_cache_sentinel")?(se=f(c=>{M(c.currentTarget.value)},"t10"),e[14]=se):se=e[14];let Se=se,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=f(c=>{Xe(c.currentTarget.checked)},"t11"),e[15]=ae):ae=e[15];let Ee=ae,oe;e[16]!==xe?(oe=f(()=>{fe(xe())},"t12"),e[16]=xe,e[17]=oe):oe=e[17];let _e=oe,re;e[18]!==ye?(re=f(c=>{let{id:q}=c.currentTarget.dataset;q!==void 0&&fe(ye(q))},"t13"),e[18]=ye,e[19]=re):re=e[19];let Te=re,le;e[20]!==be?(le=f(()=>{fe(be())},"t14"),e[20]=be,e[21]=le):le=e[21];let Ce=le,et="flex flex-col gap-6",tt="lunora-queues-panel",B;e[22]!==a||e[23]!==l?(B=(0,t.jsxDEV)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(c=>(0,t.jsxDEV)(V,{"aria-selected":l===c,"data-tab":c,"data-testid":`queues-tab-${c}`,onClick:Ze,role:"tab",size:"sm",type:"button",variant:l===c?"secondary":"ghost",children:ht(c,a)},c,!1))},void 0,!1),e[22]=a,e[23]=l,e[24]=B):B=e[24];let R;e[25]!==ge||e[26]!==ve?(R=ge!==null&&(0,t.jsxDEV)(Pe,{error:ve,testId:"queues-error"},void 0,!1),e[25]=ge,e[26]=ve,e[27]=R):R=e[27];let Qe=D&&(0,t.jsxDEV)(Ge,{icon:(0,t.jsxDEV)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"},void 0,!1),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxDEV)("div",{className:"flex flex-col gap-1",children:[Q.length>0&&(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("p",{className:"font-medium",children:a("No dead-letter queue on {queues}.",{queues:Q.map(qt).join(", ")})},void 0,!1),(0,t.jsxDEV)("p",{className:"text-muted-foreground",children:a("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")},void 0,!1)]},void 0,!0),C>0&&(0,t.jsxDEV)("p",{className:Q.length>0?"text-muted-foreground":"font-medium",children:C===1?a("1 message was recently dead-lettered."):a("{count} messages were recently dead-lettered.",{count:C})},void 0,!1)]},void 0,!0)},void 0,!1),$;e[28]!==S||e[29]!==p||e[30]!==l?($=l==="declared"&&(0,t.jsxDEV)(pt,{loaded:p!==void 0,queues:S},void 0,!1),e[28]=S,e[29]=p,e[30]=l,e[31]=$):$=e[31];let O;e[32]!==A||e[33]!==v||e[34]!==Ce||e[35]!==Te||e[36]!==pe||e[37]!==l?(O=l==="messages"&&(0,t.jsxDEV)(vt,{hasError:v!==null,messages:A,onClear:Ce,onReplay:Te,replayingId:pe},void 0,!1),e[32]=A,e[33]=v,e[34]=Ce,e[35]=Te,e[36]=pe,e[37]=l,e[38]=O):O=e[38];let k;e[39]!==G||e[40]!==I||e[41]!==T||e[42]!==Ee||e[43]!==qe||e[44]!==Se||e[45]!==Ne||e[46]!==_e||e[47]!==S||e[48]!==H||e[49]!==he||e[50]!==l?(k=l==="send"&&(0,t.jsxDEV)(xt,{batchMode:G,bodyText:I,delayText:T,onBatchModeChange:Ee,onBodyChange:qe,onDelayChange:Se,onSelectExport:Ne,onSend:_e,queues:S,selectedExportName:H,sending:he},void 0,!1),e[39]=G,e[40]=I,e[41]=T,e[42]=Ee,e[43]=qe,e[44]=Se,e[45]=Ne,e[46]=_e,e[47]=S,e[48]=H,e[49]=he,e[50]=l,e[51]=k):k=e[51];let ne;return e[52]!==B||e[53]!==R||e[54]!==Qe||e[55]!==$||e[56]!==O||e[57]!==k?(ne=(0,t.jsxDEV)("div",{className:et,"data-testid":tt,children:[B,R,Qe,$,O,k]},void 0,!0),e[52]=B,e[53]=R,e[54]=Qe,e[55]=$,e[56]=O,e[57]=k,e[58]=ne):ne=e[58],ne},"QueuesPanel");function yt(o){return(0,t.jsxDEV)(j,{"data-testid":`queues-row-${o.exportName}`,children:[(0,t.jsxDEV)(_,{className:"font-mono text-xs",children:o.exportName},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.name},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.mode},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.binding},void 0,!1),(0,t.jsxDEV)(_,{className:"font-mono text-xs text-muted-foreground",children:o.deadLetterQueue??"\u2014"},void 0,!1)]},o.exportName,!0)}f(yt,"_temp");function bt(o){return(0,t.jsxDEV)("option",{value:o.exportName,children:o.exportName},o.exportName,!1)}f(bt,"_temp2");function Nt(o,e){return o.exportName.localeCompare(e.exportName)}f(Nt,"_temp3");function qt(o){return o.name}f(qt,"_temp4");export{Ut as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V}from"./chunk-VLXV72QE.js";import{a as g}from"./chunk-JSEXCW5Q.js";import{a as z}from"./chunk-
|
|
1
|
+
import{a as V}from"./chunk-VLXV72QE.js";import{a as g}from"./chunk-JSEXCW5Q.js";import{a as z}from"./chunk-ATG3655M.js";import{b as q}from"./chunk-TBMYIZIO.js";import{R as j}from"./chunk-3CJW6NWG.js";import{c as p}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as P}from"./chunk-BOXSWNXZ.js";import{b as w}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as L}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as U,e as B,g as J,k as K,o as M}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a,e as D,f as oe,h as ne}from"./chunk-RRCPZMC2.js";var n=D(oe(),1);var t=D(ne(),1);var ie=a(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"argumentType"),de=a(r=>r===void 0||r.length===0?"()":`(${r.map(l=>`${l.name}${l.optional?"?":""}: ${ie(l)}`).join(", ")})`,"formatSignature"),le=a(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"placeholderValue"),ce=a(r=>{let l={};for(let s of r??[])s.optional||(l[s.name]=le(s.kind));return JSON.stringify(l,void 0,2)},"argumentsTemplate"),ue=B(P.runAs),fe=10,me=a(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"formatResult"),Ie=a(({functions:r,runAsIdentity:l=!1}={})=>{let s=U(),c=L(),[H,X]=(0,n.useState)(null),[k,Y]=(0,n.useState)(null),x=r??H??[],[R,I]=(0,n.useState)(""),[f,b]=(0,n.useState)("{}"),[u,A]=(0,n.useState)(""),[m,G]=(0,n.useState)(""),[N,h]=(0,n.useState)("idle"),[Q,y]=(0,n.useState)(void 0),[C,S]=(0,n.useState)(null),[T,W]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(r!==void 0)return;let e=!1;return c.listFunctions().then(i=>(e||X(i),i)).catch(i=>{e||Y(J(i))}),()=>{e=!0}},[c,r]);let F=R===""?x[0]?.path??"":R,o=x.find(e=>e.path===F),Z=a(async()=>{if(!o)return;let e;try{e=f.trim()===""?{}:JSON.parse(f)}catch(d){h("error"),y(void 0),S(s("Invalid JSON args: {message}",{message:d.message}));return}let i={__lunoraRef:o.path},v=u.trim()===""?{}:{shardKey:u.trim()},$=l?m.trim():"",E=a(d=>{W(O=>[{argsText:f,at:Date.now(),id:(O[0]?.id??0)+1,kind:o.kind,path:o.path,shardKey:u,status:d},...O].slice(0,fe))},"record");h("running"),S(null);try{let d;if($==="")switch(o.kind){case"action":{d=await c.action(i,e,v);break}case"mutation":{d=await c.mutation(i,e,v);break}default:d=await c.query(i,e,v)}else d=await c.query(ue,{args:e,functionPath:o.path,userId:$},v);q(u),y(d),h("success"),E("success")}catch(d){y(void 0),S(d.message),h("error"),E("error")}},"run"),_=a(e=>{I(e.path),b(e.argsText),A(e.shardKey)},"loadRun"),ee=a(e=>{I(e.target.value)},"onSelectChange"),te=a(e=>{b(e.target.value)},"onArgsChange"),re=a(e=>{G(e.target.value)},"onRunAsChange"),se=a(()=>{K(Z())},"runOnce"),ae=a(()=>{b(ce(o?.args))},"prefillArgs");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k},void 0,!1),(0,t.jsxDEV)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,t.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxDEV)(g,{htmlFor:"function-select",children:s("Function")},void 0,!1),(0,t.jsxDEV)("select",{"aria-label":s("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:ee,value:F,children:x.map(e=>(0,t.jsxDEV)("option",{value:e.path,children:[e.path," (",e.kind,")"]},e.path,!0))},void 0,!1),o!==void 0&&(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:[(0,t.jsxDEV)("span",{className:"mr-1.5 font-medium",children:s("Signature")},void 0,!1),(0,t.jsxDEV)("code",{className:"font-mono","data-testid":"function-signature",children:de(o.args)},void 0,!1)]},void 0,!0)]},void 0,!0),(0,t.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxDEV)(g,{htmlFor:"args-input",children:s("Arguments")},void 0,!1),(0,t.jsxDEV)(p,{"data-testid":"prefill-button",disabled:o===void 0,onClick:ae,size:"xs",type:"button",variant:"ghost",children:s("Prefill")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(V,{"aria-label":s("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:te,value:f},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(z,{onChange:A,testId:"shard-input",value:u},void 0,!1),l&&(0,t.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,t.jsxDEV)(g,{htmlFor:"run-as-input",children:s("Run as identity (userId)")},void 0,!1),(0,t.jsxDEV)(j,{"aria-label":s("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:re,placeholder:s("Leave empty to run as admin"),value:m},void 0,!1),(0,t.jsxDEV)("p",{className:"text-[11px] text-muted-foreground",children:s("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)(p,{"data-testid":"run-button",disabled:N==="running"||o===void 0,onClick:se,type:"button",children:s("Run")},void 0,!1),o!==void 0&&(0,t.jsxDEV)(w,{variant:"outline",children:o.kind},void 0,!1),l&&m.trim()!==""&&(0,t.jsxDEV)(w,{"data-testid":"run-as-badge",variant:"secondary",children:s("as {userId}",{userId:m.trim()})},void 0,!1)]},void 0,!0)]},void 0,!0),N==="error"&&C!==null&&(0,t.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C},void 0,!1),N==="success"&&(0,t.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:me(Q)},void 0,!1),T.length>0&&(0,t.jsxDEV)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:T.map((e,i)=>(0,t.jsxDEV)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,t.jsxDEV)("span",{className:e.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${i.toString()}`,children:e.status==="success"?"\u2713":"\u2717"},void 0,!1)," ",(0,t.jsxDEV)("span",{className:"font-mono text-xs",children:[e.path," (",e.kind,")"]},void 0,!0)," ",(0,t.jsxDEV)("time",{className:"text-xs text-muted-foreground",children:M(e.at)},void 0,!1)," ",(0,t.jsxDEV)(p,{className:"ml-auto","data-testid":`fn-history-load-${i.toString()}`,onClick:a(()=>{_(e)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Load")},void 0,!1)]},e.id,!0))},void 0,!1)]},void 0,!0)},"FunctionRunner");export{Ie as FunctionRunner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as de,e as j}from"./chunk-KBB75WNT.js";import{a as ce}from"./chunk-UGUEC6BC.js";import"./chunk-6HSHEMZV.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import"./chunk-KEGAWN6Y.js";import{a as ie}from"./chunk-TBMYIZIO.js";import"./chunk-HV7G6DFP.js";import{a as E}from"./chunk-BOXSWNXZ.js";import{b as ne}from"./chunk-RHZ4M2NZ.js";import{a as S}from"./chunk-SEU5V7I6.js";import{b as A}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as ae,g as le}from"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as D,e as T,f as H,g as Q,k as F,o as oe}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as h,e as k,f as ke,g as re,h as se,j as w}from"./chunk-RRCPZMC2.js";var ve=k(re(),1);var c=k(ke(),1);var ue=k(re(),1);var W=k(se(),1);var Ae={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},fe=h(()=>{let t=(0,ue.c)(16),e=D(),a=le(),s;e:switch(a){case"connected":{let n;t[0]!==e?(n=e("Connected"),t[0]=e,t[1]=n):n=t[1],s=n;break e}case"connecting":{let n;t[2]!==e?(n=e("Connecting\u2026"),t[2]=e,t[3]=n):n=t[3],s=n;break e}case"idle":{let n;t[4]!==e?(n=e("Idle"),t[4]=e,t[5]=n):n=t[5],s=n;break e}case"offline":{let n;t[6]!==e?(n=e("Offline"),t[6]=e,t[7]=n):n=t[7],s=n;break e}default:s=a}let l=Ae[a],d;t[8]!==l?(d=w("size-2 rounded-full",l),t[8]=l,t[9]=d):d=t[9];let u;t[10]!==d?(u=(0,W.jsxDEV)("span",{"aria-hidden":"true",className:d},void 0,!1),t[10]=d,t[11]=u):u=t[11];let i;return t[12]!==a||t[13]!==u||t[14]!==s?(i=(0,W.jsxDEV)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[u,s]},void 0,!0),t[12]=a,t[13]=u,t[14]=s,t[15]=i):i=t[15],i},"ConnectionBadge");var r=k(se(),1);var me={completed:0,failed:2,in_progress:1},Re=h(t=>{let e=0,a=0,s=0,l=0,d=[];for(let{metrics:u}of t){if(u===null){l+=1;continue}s+=1,e+=u.requests,a+=u.errors,d.push(...u.history??[])}return{errors:a,failed:l,history:d,reachable:s,requests:e}},"sumShardMetrics"),Me=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"mergeFunctionStats"),_e=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let d=me[s.status]-me[l.status];(d>0||d===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"dedupeMigrations"),Ie=T(E.getAuthMetrics),Le=T(E.getFunctionStats),Ce=T(E.getLogs),Oe=T(E.getMetrics),qe=T(E.migrationStatus),De=5,he=2e3,Fe=5,pe=.01,ge=.05,je=.1,Ue=.3,Pe=1,Ge=50,X=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","rateLevel"),Ve=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","countLevel"),Be={crit:"destructive",ok:"secondary",warn:"default"},U=h((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"ratePercent"),Ke=h(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"requestErrorSeries"),$e=h(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"migrationSummary"),ze=h((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"migrationTileValue"),xe={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Ne={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},He={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Qe=h(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","worstLevel"),P=h(t=>{let e=(0,ve.c)(19),{chart:a,label:s,level:l,testId:d,value:u}=t,i=xe[l],n;e[0]!==i?(n=w("size-1.5 shrink-0 rounded-full",i),e[0]=i,e[1]=n):n=e[1];let p;e[2]!==n?(p=(0,r.jsxDEV)("span",{"aria-hidden":"true",className:n},void 0,!1),e[2]=n,e[3]=p):p=e[3];let g;e[4]!==s||e[5]!==p?(g=(0,r.jsxDEV)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[p,s]},void 0,!0),e[4]=s,e[5]=p,e[6]=g):g=e[6];let b=Ne[l],m;e[7]!==b?(m=w("truncate text-2xl font-semibold tabular-nums",b),e[7]=b,e[8]=m):m=e[8];let f;e[9]!==m||e[10]!==d||e[11]!==u?(f=(0,r.jsxDEV)("span",{className:m,"data-testid":d,children:u},void 0,!1),e[9]=m,e[10]=d,e[11]=u,e[12]=f):f=e[12];let v;e[13]!==a||e[14]!==f?(v=(0,r.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[f,a]},void 0,!0),e[13]=a,e[14]=f,e[15]=v):v=e[15];let x;return e[16]!==g||e[17]!==v?(x=(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:(0,r.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,v]},void 0,!0)},void 0,!1),e[16]=g,e[17]=v,e[18]=x):x=e[18],x},"SloCard"),We=h(async(t,e,a)=>{let s=await Promise.all(a.map(m=>{let f=H(m);return Promise.allSettled([t.query(Oe,{},f),t.query(Le,{},f),t.query(qe,{},f)])})),l=H(e),d=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[u,i,n]=await Promise.allSettled([t.query(Ce,{},l),t.query(Ie,{},l),d]),p=s.map(([m,f,v])=>({functions:f.status==="fulfilled"?f.value.functions:[],metrics:m.status==="fulfilled"?m.value:null,migrations:v.status==="fulfilled"?v.value.migrations:[]})),g=Re(p),b=s[0]?.[0];return{auth:i.status==="fulfilled"?i.value:null,entries:u.status==="fulfilled"?u.value.entries:[],functions:Me(p.map(m=>m.functions)),logsError:u.status==="rejected"?Q(u.reason):null,metricsError:g.reachable===0&&b?.status==="rejected"?Q(b.reason):null,migrations:_e(p.map(m=>m.migrations)),scheduler:n.status==="fulfilled"?n.value:null,totals:g}},"loadSloData"),ht=h(({initialShardKey:t})=>{let e=ae(),a=D(),[s,l]=(0,c.useState)([]),[d,u]=(0,c.useState)(null),[i,n]=(0,c.useState)(null),[p,g]=(0,c.useState)(null),[b,m]=(0,c.useState)([]),[f,v]=(0,c.useState)(null),[x,be]=(0,c.useState)(null),[we,Ee]=(0,c.useState)([]),[y]=(0,c.useState)(ie),R=(0,c.useRef)(!1),G=(0,c.useRef)(!0);(0,c.useEffect)(()=>(G.current=!0,()=>{G.current=!1}),[]);let M=t??"",_=(0,c.useCallback)(async()=>{if(R.current)return;R.current=!0;let o=await We(e,M,de(M,y));if(!G.current){R.current=!1;return}n(o.totals),g(o.metricsError),m(o.functions),Ee(o.migrations),l(o.entries),u(o.logsError),v(o.auth),be(o.scheduler),R.current=!1},[e,y,M]);(0,c.useEffect)(()=>{F(_())},[_]);let V=(0,c.useRef)(0),I=(0,c.useRef)(null),Se=h(()=>{let o=Date.now()-V.current;if(o>=he){V.current=Date.now(),F(_());return}I.current??=setTimeout(()=>{I.current=null,V.current=Date.now(),F(_())},he-o)},"scheduleFanOut");(0,c.useEffect)(()=>()=>{I.current!==null&&clearTimeout(I.current)},[]);let{data:J,liveError:Te}=ne(E.getMetrics,{},{live:!0,shardKey:M});(0,c.useEffect)(()=>{J!==void 0&&Se()},[J]);let B=s.filter(o=>o.level==="error"),K=B.slice(0,De),L=Ke(i?.history),Y=(0,c.useMemo)(()=>{let o=f?.history??[];return{attempts:o.map(N=>N.attempts),failures:o.map(N=>N.failures)}},[f?.history]),Z=b.filter(o=>o.calls>0).toSorted((o,N)=>N.errors/N.calls-o.errors/o.calls||N.calls-o.calls).slice(0,Fe),$=$e(we),ye=i===null||i.requests===0?0:i.errors/i.requests,z=X(ye,pe,ge),ee=f===null?"ok":X(f.failureRate,je,Ue),te=x===null?"ok":Ve(x.backlog,Pe,Ge),C=Qe([z,ee,te,$.level]),O,q;return C==="crit"?(O=a("Critical"),q=a("One or more service levels are breached.")):C==="warn"?(O=a("Degraded"),q=a("Some service levels need attention.")):(O=a("All systems healthy"),q=a("All service levels are within target.")),(0,r.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxDEV)("div",{className:"flex items-center gap-3",children:[(0,r.jsxDEV)("span",{"aria-hidden":"true",className:w("flex size-10 shrink-0 items-center justify-center rounded-full",He[C]),children:(0,r.jsxDEV)("span",{className:w("size-3 rounded-full",xe[C])},void 0,!1)},void 0,!1),(0,r.jsxDEV)("div",{className:"grid leading-tight",children:[(0,r.jsxDEV)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:O},void 0,!1),(0,r.jsxDEV)("span",{className:"text-[13px] text-muted-foreground",children:q},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxDEV)("div",{className:"text-end",children:[(0,r.jsxDEV)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")},void 0,!1),(0,r.jsxDEV)("div",{className:"flex items-center justify-end gap-2",children:[L.requests.length>=2&&(0,r.jsxDEV)(j,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:L.requests,testId:"hl-spark-requests"},void 0,!1),(0,r.jsxDEV)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(i?.requests??0).toString()},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"},void 0,!1),(0,r.jsxDEV)("div",{className:"text-end",children:[(0,r.jsxDEV)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")},void 0,!1),(0,r.jsxDEV)("div",{className:w("text-lg font-semibold tabular-nums",Ne[z]),"data-testid":"hl-error-rate",children:i===null?"\u2014":U(i.errors,i.requests)},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"},void 0,!1),(0,r.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,r.jsxDEV)(fe,{},void 0,!1),(0,r.jsxDEV)(ce,{message:Te,prefix:"hl"},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),p!==null&&(0,r.jsxDEV)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:p},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsxDEV)(P,{chart:L.errors.length>=2?(0,r.jsxDEV)(j,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:L.errors,testId:"hl-spark-errors"},void 0,!1):void 0,label:a("Error rate"),level:z,testId:"hl-slo-errorrate",value:i===null?"\u2014":U(i.errors,i.requests)},void 0,!1),(0,r.jsxDEV)(P,{chart:Y.failures.length>=2?(0,r.jsxDEV)(j,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:Y.failures,testId:"hl-spark-auth"},void 0,!1):void 0,label:a("Auth failures"),level:ee,testId:"hl-slo-auth",value:f===null?"\u2014":U(f.failures,f.attempts)},void 0,!1),(0,r.jsxDEV)(P,{label:a("Scheduler backlog"),level:te,testId:"hl-slo-backlog",value:x===null?"\u2014":x.backlog.toString()},void 0,!1),(0,r.jsxDEV)(P,{label:a("Migrations"),level:$.level,testId:"hl-slo-migrations",value:ze($,a)},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,r.jsxDEV)(S,{className:"gap-0 py-0","data-testid":"hl-functions",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Functions by error rate")},void 0,!1)},void 0,!1),Z.length===0?(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:a("No function activity yet.")},void 0,!1):(0,r.jsxDEV)("ul",{className:"divide-y divide-border",children:Z.map(o=>(0,r.jsxDEV)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsxDEV)("span",{className:"truncate font-mono text-foreground",children:o.path},void 0,!1),(0,r.jsxDEV)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsxDEV)("span",{className:"tabular-nums text-muted-foreground",children:a("{count} calls",{count:o.calls.toString()})},void 0,!1),(0,r.jsxDEV)(A,{variant:Be[X(o.errors/o.calls,pe,ge)],children:U(o.errors,o.calls)},void 0,!1)]},void 0,!0)]},o.path,!0))},void 0,!1)]},void 0,!0),(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Recent errors")},void 0,!1),(0,r.jsxDEV)(A,{"data-testid":"hl-error-count",variant:B.length>0?"destructive":"outline",children:B.length},void 0,!1)]},void 0,!0),d!==null&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:d},void 0,!1),d===null&&K.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:a("No recent errors.")},void 0,!1),K.length>0&&(0,r.jsxDEV)("ul",{className:"divide-y divide-border",children:K.map((o,N)=>(0,r.jsxDEV)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxDEV)("span",{className:"flex items-center gap-2",children:[(0,r.jsxDEV)("time",{className:"shrink-0 text-muted-foreground",children:oe(o.timestamp)},void 0,!1),o.functionPath!==void 0&&(0,r.jsxDEV)("span",{className:"truncate font-mono text-foreground",children:o.functionPath},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("span",{className:"text-destructive",children:o.message},void 0,!1)]},`${o.timestamp.toString()}-${N.toString()}`,!0))},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")},void 0,!1),(0,r.jsxDEV)(A,{"data-testid":"hl-shard-count",variant:"outline",children:y.length},void 0,!1)]},void 0,!0),y.length>0&&(0,r.jsxDEV)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:y.map(o=>(0,r.jsxDEV)("li",{"data-testid":"hl-shard",children:(0,r.jsxDEV)(A,{variant:"secondary",children:o},void 0,!1)},o,!1))},void 0,!1)]},void 0,!0)]},void 0,!0)},"HealthPanel");export{ht as HealthPanel};
|
|
1
|
+
import{b as de,e as j}from"./chunk-S6JKSFSO.js";import{a as ce}from"./chunk-WKWKAU22.js";import"./chunk-ERUIC6WI.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import"./chunk-KEGAWN6Y.js";import{a as ie}from"./chunk-TBMYIZIO.js";import"./chunk-HV7G6DFP.js";import{a as E}from"./chunk-BOXSWNXZ.js";import{b as ne}from"./chunk-EOSXQTSQ.js";import{a as S}from"./chunk-SEU5V7I6.js";import{b as A}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as ae,g as le}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as D,e as T,f as H,g as Q,k as F,o as oe}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a as h,e as k,f as ke,g as re,h as se,j as w}from"./chunk-RRCPZMC2.js";var ve=k(re(),1);var c=k(ke(),1);var ue=k(re(),1);var W=k(se(),1);var Ae={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},fe=h(()=>{let t=(0,ue.c)(16),e=D(),a=le(),s;e:switch(a){case"connected":{let n;t[0]!==e?(n=e("Connected"),t[0]=e,t[1]=n):n=t[1],s=n;break e}case"connecting":{let n;t[2]!==e?(n=e("Connecting\u2026"),t[2]=e,t[3]=n):n=t[3],s=n;break e}case"idle":{let n;t[4]!==e?(n=e("Idle"),t[4]=e,t[5]=n):n=t[5],s=n;break e}case"offline":{let n;t[6]!==e?(n=e("Offline"),t[6]=e,t[7]=n):n=t[7],s=n;break e}default:s=a}let l=Ae[a],d;t[8]!==l?(d=w("size-2 rounded-full",l),t[8]=l,t[9]=d):d=t[9];let u;t[10]!==d?(u=(0,W.jsxDEV)("span",{"aria-hidden":"true",className:d},void 0,!1),t[10]=d,t[11]=u):u=t[11];let i;return t[12]!==a||t[13]!==u||t[14]!==s?(i=(0,W.jsxDEV)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[u,s]},void 0,!0),t[12]=a,t[13]=u,t[14]=s,t[15]=i):i=t[15],i},"ConnectionBadge");var r=k(se(),1);var me={completed:0,failed:2,in_progress:1},Re=h(t=>{let e=0,a=0,s=0,l=0,d=[];for(let{metrics:u}of t){if(u===null){l+=1;continue}s+=1,e+=u.requests,a+=u.errors,d.push(...u.history??[])}return{errors:a,failed:l,history:d,reachable:s,requests:e}},"sumShardMetrics"),Me=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"mergeFunctionStats"),_e=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let d=me[s.status]-me[l.status];(d>0||d===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"dedupeMigrations"),Ie=T(E.getAuthMetrics),Le=T(E.getFunctionStats),Ce=T(E.getLogs),Oe=T(E.getMetrics),qe=T(E.migrationStatus),De=5,he=2e3,Fe=5,pe=.01,ge=.05,je=.1,Ue=.3,Pe=1,Ge=50,X=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","rateLevel"),Ve=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","countLevel"),Be={crit:"destructive",ok:"secondary",warn:"default"},U=h((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"ratePercent"),Ke=h(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"requestErrorSeries"),$e=h(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"migrationSummary"),ze=h((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"migrationTileValue"),xe={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Ne={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},He={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Qe=h(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","worstLevel"),P=h(t=>{let e=(0,ve.c)(19),{chart:a,label:s,level:l,testId:d,value:u}=t,i=xe[l],n;e[0]!==i?(n=w("size-1.5 shrink-0 rounded-full",i),e[0]=i,e[1]=n):n=e[1];let p;e[2]!==n?(p=(0,r.jsxDEV)("span",{"aria-hidden":"true",className:n},void 0,!1),e[2]=n,e[3]=p):p=e[3];let g;e[4]!==s||e[5]!==p?(g=(0,r.jsxDEV)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[p,s]},void 0,!0),e[4]=s,e[5]=p,e[6]=g):g=e[6];let b=Ne[l],m;e[7]!==b?(m=w("truncate text-2xl font-semibold tabular-nums",b),e[7]=b,e[8]=m):m=e[8];let f;e[9]!==m||e[10]!==d||e[11]!==u?(f=(0,r.jsxDEV)("span",{className:m,"data-testid":d,children:u},void 0,!1),e[9]=m,e[10]=d,e[11]=u,e[12]=f):f=e[12];let v;e[13]!==a||e[14]!==f?(v=(0,r.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[f,a]},void 0,!0),e[13]=a,e[14]=f,e[15]=v):v=e[15];let x;return e[16]!==g||e[17]!==v?(x=(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:(0,r.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,v]},void 0,!0)},void 0,!1),e[16]=g,e[17]=v,e[18]=x):x=e[18],x},"SloCard"),We=h(async(t,e,a)=>{let s=await Promise.all(a.map(m=>{let f=H(m);return Promise.allSettled([t.query(Oe,{},f),t.query(Le,{},f),t.query(qe,{},f)])})),l=H(e),d=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[u,i,n]=await Promise.allSettled([t.query(Ce,{},l),t.query(Ie,{},l),d]),p=s.map(([m,f,v])=>({functions:f.status==="fulfilled"?f.value.functions:[],metrics:m.status==="fulfilled"?m.value:null,migrations:v.status==="fulfilled"?v.value.migrations:[]})),g=Re(p),b=s[0]?.[0];return{auth:i.status==="fulfilled"?i.value:null,entries:u.status==="fulfilled"?u.value.entries:[],functions:Me(p.map(m=>m.functions)),logsError:u.status==="rejected"?Q(u.reason):null,metricsError:g.reachable===0&&b?.status==="rejected"?Q(b.reason):null,migrations:_e(p.map(m=>m.migrations)),scheduler:n.status==="fulfilled"?n.value:null,totals:g}},"loadSloData"),ht=h(({initialShardKey:t})=>{let e=ae(),a=D(),[s,l]=(0,c.useState)([]),[d,u]=(0,c.useState)(null),[i,n]=(0,c.useState)(null),[p,g]=(0,c.useState)(null),[b,m]=(0,c.useState)([]),[f,v]=(0,c.useState)(null),[x,be]=(0,c.useState)(null),[we,Ee]=(0,c.useState)([]),[y]=(0,c.useState)(ie),R=(0,c.useRef)(!1),G=(0,c.useRef)(!0);(0,c.useEffect)(()=>(G.current=!0,()=>{G.current=!1}),[]);let M=t??"",_=(0,c.useCallback)(async()=>{if(R.current)return;R.current=!0;let o=await We(e,M,de(M,y));if(!G.current){R.current=!1;return}n(o.totals),g(o.metricsError),m(o.functions),Ee(o.migrations),l(o.entries),u(o.logsError),v(o.auth),be(o.scheduler),R.current=!1},[e,y,M]);(0,c.useEffect)(()=>{F(_())},[_]);let V=(0,c.useRef)(0),I=(0,c.useRef)(null),Se=h(()=>{let o=Date.now()-V.current;if(o>=he){V.current=Date.now(),F(_());return}I.current??=setTimeout(()=>{I.current=null,V.current=Date.now(),F(_())},he-o)},"scheduleFanOut");(0,c.useEffect)(()=>()=>{I.current!==null&&clearTimeout(I.current)},[]);let{data:J,liveError:Te}=ne(E.getMetrics,{},{live:!0,shardKey:M});(0,c.useEffect)(()=>{J!==void 0&&Se()},[J]);let B=s.filter(o=>o.level==="error"),K=B.slice(0,De),L=Ke(i?.history),Y=(0,c.useMemo)(()=>{let o=f?.history??[];return{attempts:o.map(N=>N.attempts),failures:o.map(N=>N.failures)}},[f?.history]),Z=b.filter(o=>o.calls>0).toSorted((o,N)=>N.errors/N.calls-o.errors/o.calls||N.calls-o.calls).slice(0,Fe),$=$e(we),ye=i===null||i.requests===0?0:i.errors/i.requests,z=X(ye,pe,ge),ee=f===null?"ok":X(f.failureRate,je,Ue),te=x===null?"ok":Ve(x.backlog,Pe,Ge),C=Qe([z,ee,te,$.level]),O,q;return C==="crit"?(O=a("Critical"),q=a("One or more service levels are breached.")):C==="warn"?(O=a("Degraded"),q=a("Some service levels need attention.")):(O=a("All systems healthy"),q=a("All service levels are within target.")),(0,r.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxDEV)("div",{className:"flex items-center gap-3",children:[(0,r.jsxDEV)("span",{"aria-hidden":"true",className:w("flex size-10 shrink-0 items-center justify-center rounded-full",He[C]),children:(0,r.jsxDEV)("span",{className:w("size-3 rounded-full",xe[C])},void 0,!1)},void 0,!1),(0,r.jsxDEV)("div",{className:"grid leading-tight",children:[(0,r.jsxDEV)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:O},void 0,!1),(0,r.jsxDEV)("span",{className:"text-[13px] text-muted-foreground",children:q},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxDEV)("div",{className:"text-end",children:[(0,r.jsxDEV)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")},void 0,!1),(0,r.jsxDEV)("div",{className:"flex items-center justify-end gap-2",children:[L.requests.length>=2&&(0,r.jsxDEV)(j,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:L.requests,testId:"hl-spark-requests"},void 0,!1),(0,r.jsxDEV)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(i?.requests??0).toString()},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"},void 0,!1),(0,r.jsxDEV)("div",{className:"text-end",children:[(0,r.jsxDEV)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")},void 0,!1),(0,r.jsxDEV)("div",{className:w("text-lg font-semibold tabular-nums",Ne[z]),"data-testid":"hl-error-rate",children:i===null?"\u2014":U(i.errors,i.requests)},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"},void 0,!1),(0,r.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,r.jsxDEV)(fe,{},void 0,!1),(0,r.jsxDEV)(ce,{message:Te,prefix:"hl"},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),p!==null&&(0,r.jsxDEV)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:p},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsxDEV)(P,{chart:L.errors.length>=2?(0,r.jsxDEV)(j,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:L.errors,testId:"hl-spark-errors"},void 0,!1):void 0,label:a("Error rate"),level:z,testId:"hl-slo-errorrate",value:i===null?"\u2014":U(i.errors,i.requests)},void 0,!1),(0,r.jsxDEV)(P,{chart:Y.failures.length>=2?(0,r.jsxDEV)(j,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:Y.failures,testId:"hl-spark-auth"},void 0,!1):void 0,label:a("Auth failures"),level:ee,testId:"hl-slo-auth",value:f===null?"\u2014":U(f.failures,f.attempts)},void 0,!1),(0,r.jsxDEV)(P,{label:a("Scheduler backlog"),level:te,testId:"hl-slo-backlog",value:x===null?"\u2014":x.backlog.toString()},void 0,!1),(0,r.jsxDEV)(P,{label:a("Migrations"),level:$.level,testId:"hl-slo-migrations",value:ze($,a)},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,r.jsxDEV)(S,{className:"gap-0 py-0","data-testid":"hl-functions",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Functions by error rate")},void 0,!1)},void 0,!1),Z.length===0?(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:a("No function activity yet.")},void 0,!1):(0,r.jsxDEV)("ul",{className:"divide-y divide-border",children:Z.map(o=>(0,r.jsxDEV)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsxDEV)("span",{className:"truncate font-mono text-foreground",children:o.path},void 0,!1),(0,r.jsxDEV)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsxDEV)("span",{className:"tabular-nums text-muted-foreground",children:a("{count} calls",{count:o.calls.toString()})},void 0,!1),(0,r.jsxDEV)(A,{variant:Be[X(o.errors/o.calls,pe,ge)],children:U(o.errors,o.calls)},void 0,!1)]},void 0,!0)]},o.path,!0))},void 0,!1)]},void 0,!0),(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Recent errors")},void 0,!1),(0,r.jsxDEV)(A,{"data-testid":"hl-error-count",variant:B.length>0?"destructive":"outline",children:B.length},void 0,!1)]},void 0,!0),d!==null&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:d},void 0,!1),d===null&&K.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:a("No recent errors.")},void 0,!1),K.length>0&&(0,r.jsxDEV)("ul",{className:"divide-y divide-border",children:K.map((o,N)=>(0,r.jsxDEV)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxDEV)("span",{className:"flex items-center gap-2",children:[(0,r.jsxDEV)("time",{className:"shrink-0 text-muted-foreground",children:oe(o.timestamp)},void 0,!1),o.functionPath!==void 0&&(0,r.jsxDEV)("span",{className:"truncate font-mono text-foreground",children:o.functionPath},void 0,!1)]},void 0,!0),(0,r.jsxDEV)("span",{className:"text-destructive",children:o.message},void 0,!1)]},`${o.timestamp.toString()}-${N.toString()}`,!0))},void 0,!1)]},void 0,!0)]},void 0,!0),(0,r.jsxDEV)(S,{className:"gap-0 py-0",children:[(0,r.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")},void 0,!1),(0,r.jsxDEV)(A,{"data-testid":"hl-shard-count",variant:"outline",children:y.length},void 0,!1)]},void 0,!0),y.length>0&&(0,r.jsxDEV)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:y.map(o=>(0,r.jsxDEV)("li",{"data-testid":"hl-shard",children:(0,r.jsxDEV)(A,{variant:"secondary",children:o},void 0,!1)},o,!1))},void 0,!1)]},void 0,!0)]},void 0,!0)},"HealthPanel");export{ht as HealthPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as f}from"./chunk-
|
|
1
|
+
import{b as f}from"./chunk-I34RPZ7P.js";import"./chunk-JEVKZIHN.js";import"./chunk-XNJNSCLM.js";import"./chunk-GTM65MVX.js";import{a as R}from"./chunk-BOXSWNXZ.js";import{b as p}from"./chunk-EOSXQTSQ.js";import"./chunk-SEU5V7I6.js";import"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as h}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a as i,e as m,g as S,h as A}from"./chunk-RRCPZMC2.js";var g=m(S(),1);var k=m(A(),1);var _=i((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("Live admin subscriptions are ungated")})[s.kind],"findingTitle"),E=i(e=>Array.isArray(e.findings)?e.findings:[],"toFindings"),w=i(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"findingEntity"),T=i((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: live admin subscriptions need no credential. Set it to gate them like the HTTP admin RPCs.")})[s.kind],"findingDetail"),v=i(()=>{let e=(0,g.c)(8),s=h(),r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},e[0]=r):r=e[0];let{data:a,error:d,errorSource:c}=p(R.getSecurityAudit,r),o;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:E(a);o=u===null?null:u.map(t=>({description:T(s,t),entity:w(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=o}else o=e[3];let l=o,n;return e[4]!==d||e[5]!==c||e[6]!==l?(n=(0,k.jsxDEV)(f,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"},void 0,!1),e[4]=d,e[5]=c,e[6]=l,e[7]=n):n=e[7],n},"SecurityAdvisorPanel");export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as n}from"./chunk-
|
|
1
|
+
import{d as n}from"./chunk-2GMEK2W3.js";import{a as l,e as a,g as u,h as d}from"./chunk-RRCPZMC2.js";var c=a(u(),1);var v=a(d(),1);var x=l(f=>{let e=(0,c.c)(6),{message:r,prefix:m}=f,o=n();if(r===void 0)return null;let i=`${m}-live-error`,t;e[0]!==r||e[1]!==o?(t=o("Live unavailable: {liveError}",{liveError:r}),e[0]=r,e[1]=o,e[2]=t):t=e[2];let s;return e[3]!==i||e[4]!==t?(s=(0,v.jsxDEV)("span",{className:"text-xs text-destructive","data-testid":i,role:"status",children:t},void 0,!1),e[3]=i,e[4]=t,e[5]=s):s=e[5],s},"LiveError");export{x as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as De}from"./chunk-
|
|
1
|
+
import{b as De}from"./chunk-OQPT2BEZ.js";import"./chunk-LNZIB2MD.js";import"./chunk-QBAT52GB.js";import{c as Re}from"./chunk-TQ36RWOP.js";import"./chunk-QAFAJBAW.js";import{a as pe}from"./chunk-7YXOPTWI.js";import"./chunk-AHILM3ZP.js";import{a as Fe}from"./chunk-J6J54MBP.js";import"./chunk-IXDH4GL5.js";import"./chunk-KSKXW5PX.js";import"./chunk-5OIBXYZM.js";import"./chunk-L7SK4ZZD.js";import{a as $e}from"./chunk-KMNEQEHM.js";import"./chunk-KEGAWN6Y.js";import{a as Te,b as _e,c as Ee,d as ie,e as te,f as Q}from"./chunk-GTM65MVX.js";import"./chunk-4QHKBC77.js";import{a as Ne}from"./chunk-ATG3655M.js";import"./chunk-TBMYIZIO.js";import{R as Se}from"./chunk-3CJW6NWG.js";import{c as ee}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as ge}from"./chunk-BOXSWNXZ.js";import{a as fe}from"./chunk-TAD43CG5.js";import{a as we,e as Ce}from"./chunk-SEU5V7I6.js";import{b as oe}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as xe}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as ke,e as ue,f as he,g as J,k as H,n as me}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a as g,e as de,f as ft,g as ut,h as ht}from"./chunk-RRCPZMC2.js";var j=de(ut(),1),_=de(ft(),1);var l=de(ht(),1);var Be=g((a,e,s)=>{let t=(0,j.c)(21),{onCopy:r,onDelete:o,onDownload:u,onToggleSelect:c}=s,n;t[0]!==a.key||t[1]!==r?(n=g(()=>{r(a.key)},"t0"),t[0]=a.key,t[1]=r,t[2]=n):n=t[2];let d=n,h;t[3]!==a.key||t[4]!==u?(h=g(()=>{u(a.key)},"t1"),t[3]=a.key,t[4]=u,t[5]=h):h=t[5];let f=h,m;t[6]!==a.key||t[7]!==o?(m=g(()=>{o(a.key)},"t2"),t[6]=a.key,t[7]=o,t[8]=m):m=t[8];let S=m,i;t[9]!==a.key||t[10]!==c?(i=g(()=>{c(a.key)},"t3"),t[9]=a.key,t[10]=c,t[11]=i):i=t[11];let x=i,y;t[12]!==a.key||t[13]!==e.length?(y=a.key.slice(e.length),t[12]=a.key,t[13]=e.length,t[14]=y):y=t[14];let v;return t[15]!==d||t[16]!==f||t[17]!==S||t[18]!==y||t[19]!==x?(v={copy:d,download:f,name:y,remove:S,toggle:x},t[15]=d,t[16]=f,t[17]=S,t[18]=y,t[19]=x,t[20]=v):v=t[20],v},"useFileItem"),Ie=g(a=>{let e=(0,j.c)(31),{busy:s,buttonClassName:t,copied:r,objectKey:o,onCopy:u,onDelete:c,onDownload:n,t:d}=a,h=`storage-copy-${o}`,f;e[0]!==r||e[1]!==d?(f=d(r?"Copied":"Copy URL"),e[0]=r,e[1]=d,e[2]=f):f=e[2];let m;e[3]!==s||e[4]!==t||e[5]!==u||e[6]!==h||e[7]!==f?(m=(0,l.jsxDEV)(ee,{className:t,"data-testid":h,disabled:s,onClick:u,size:"sm",type:"button",variant:"ghost",children:f},void 0,!1),e[3]=s,e[4]=t,e[5]=u,e[6]=h,e[7]=f,e[8]=m):m=e[8];let S=`storage-download-${o}`,i;e[9]!==d?(i=d("Download"),e[9]=d,e[10]=i):i=e[10];let x;e[11]!==s||e[12]!==t||e[13]!==n||e[14]!==S||e[15]!==i?(x=(0,l.jsxDEV)(ee,{className:t,"data-testid":S,disabled:s,onClick:n,size:"sm",type:"button",variant:"ghost",children:i},void 0,!1),e[11]=s,e[12]=t,e[13]=n,e[14]=S,e[15]=i,e[16]=x):x=e[16];let y;e[17]!==d?(y=d("Delete object?"),e[17]=d,e[18]=y):y=e[18];let v=`storage-delete-${o}`,b;e[19]!==d?(b=d("Delete"),e[19]=d,e[20]=b):b=e[20];let k;e[21]!==s||e[22]!==c||e[23]!==y||e[24]!==v||e[25]!==b?(k=(0,l.jsxDEV)($e,{confirmLabel:y,disabled:s,onConfirm:c,testId:v,children:b},void 0,!1),e[21]=s,e[22]=c,e[23]=y,e[24]=v,e[25]=b,e[26]=k):k=e[26];let w;return e[27]!==k||e[28]!==m||e[29]!==x?(w=(0,l.jsxDEV)(l.Fragment,{children:[m,x,k]},void 0,!0),e[27]=k,e[28]=m,e[29]=x,e[30]=w):w=e[30],w},"FileActions"),Oe=g(a=>{let e=(0,j.c)(14),{objectKey:s,references:t,t:r}=a;if(t===void 0)return null;if(t.length===0){let h=`storage-orphan-${s}`,f;e[0]!==r?(f=r("Orphan"),e[0]=r,e[1]=f):f=e[1];let m;return e[2]!==h||e[3]!==f?(m=(0,l.jsxDEV)(oe,{"data-testid":h,variant:"warning",children:f},void 0,!1),e[2]=h,e[3]=f,e[4]=m):m=e[4],m}let o;e[5]!==t?(o=t.map(mt).join(`
|
|
2
2
|
`),e[5]=t,e[6]=o):o=e[6];let u=o,c=`storage-refs-${s}`,n;e[7]!==t.length||e[8]!==r?(n=t.length===1?r("1 record"):r("{count} records",{count:t.length}),e[7]=t.length,e[8]=r,e[9]=n):n=e[9];let d;return e[10]!==u||e[11]!==c||e[12]!==n?(d=(0,l.jsxDEV)(oe,{"data-testid":c,title:u,variant:"secondary",children:n},void 0,!1),e[10]=u,e[11]=c,e[12]=n,e[13]=d):d=e[13],d},"FileReferences"),je=g(a=>{let e=(0,j.c)(7),{objectKey:s,onToggle:t,selected:r,t:o}=a,u;e[0]!==o?(u=o("Select row"),e[0]=o,e[1]=u):u=e[1];let c=`storage-select-${s}`,n;return e[2]!==t||e[3]!==r||e[4]!==u||e[5]!==c?(n=(0,l.jsxDEV)(pe,{"aria-label":u,checked:r,"data-testid":c,onCheckedChange:t},void 0,!1),e[2]=t,e[3]=r,e[4]=u,e[5]=c,e[6]=n):n=e[6],n},"FileSelect");function mt(a){return`${a.table}\xB7${a.id}`}g(mt,"_temp$2");var gt=g(a=>{let e=(0,j.c)(10),{colSpan:s,name:t,onEnter:r}=a,o;e[0]!==t||e[1]!==r?(o=g(()=>{r(t)},"t1"),e[0]=t,e[1]=r,e[2]=o):o=e[2];let u=o,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"},void 0,!1)},void 0,!1),e[3]=c):c=e[3];let n;e[4]!==u||e[5]!==t?(n=(0,l.jsxDEV)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:u,type:"button",children:[c,t]},void 0,!0),e[4]=u,e[5]=t,e[6]=n):n=e[6];let d;return e[7]!==s||e[8]!==n?(d=(0,l.jsxDEV)(ie,{children:(0,l.jsxDEV)(Q,{colSpan:s,children:n},void 0,!1)},void 0,!1),e[7]=s,e[8]=n,e[9]=d):d=e[9],d},"FolderRow"),pt=g(a=>{let e=(0,j.c)(33),{busy:s,copiedKey:t,handlers:r,object:o,prefix:u,references:c,selected:n,showReferences:d,t:h}=a,{copy:f,download:m,name:S,remove:i,toggle:x}=Be(o,u,r),y;e[0]!==o.key||e[1]!==n||e[2]!==h||e[3]!==x?(y=(0,l.jsxDEV)(Q,{className:"w-8",children:(0,l.jsxDEV)(je,{objectKey:o.key,onToggle:x,selected:n,t:h},void 0,!1)},void 0,!1),e[0]=o.key,e[1]=n,e[2]=h,e[3]=x,e[4]=y):y=e[4];let v;e[5]!==S?(v=(0,l.jsxDEV)(Q,{className:"font-mono text-xs",children:S},void 0,!1),e[5]=S,e[6]=v):v=e[6];let b;e[7]!==o.size?(b=me(o.size),e[7]=o.size,e[8]=b):b=e[8];let k;e[9]!==b?(k=(0,l.jsxDEV)(Q,{className:"tabular-nums text-muted-foreground",children:b},void 0,!1),e[9]=b,e[10]=k):k=e[10];let w=o.httpMetadata?.contentType??"",T;e[11]!==w?(T=(0,l.jsxDEV)(Q,{children:w},void 0,!1),e[11]=w,e[12]=T):T=e[12];let C;e[13]!==o.key||e[14]!==c||e[15]!==d||e[16]!==h?(C=d&&(0,l.jsxDEV)(Q,{children:(0,l.jsxDEV)(Oe,{objectKey:o.key,references:c,t:h},void 0,!1)},void 0,!1),e[13]=o.key,e[14]=c,e[15]=d,e[16]=h,e[17]=C):C=e[17];let N=t===o.key,E;e[18]!==s||e[19]!==f||e[20]!==m||e[21]!==o.key||e[22]!==i||e[23]!==h||e[24]!==N?(E=(0,l.jsxDEV)(Q,{className:"text-right",children:(0,l.jsxDEV)("span",{className:"inline-flex items-center gap-1",children:(0,l.jsxDEV)(Ie,{busy:s,copied:N,objectKey:o.key,onCopy:f,onDelete:i,onDownload:m,t:h},void 0,!1)},void 0,!1)},void 0,!1),e[18]=s,e[19]=f,e[20]=m,e[21]=o.key,e[22]=i,e[23]=h,e[24]=N,e[25]=E):E=e[25];let $;return e[26]!==y||e[27]!==v||e[28]!==k||e[29]!==T||e[30]!==C||e[31]!==E?($=(0,l.jsxDEV)(ie,{"data-testid":"fb-row",children:[y,v,k,T,C,E]},void 0,!0),e[26]=y,e[27]=v,e[28]=k,e[29]=T,e[30]=C,e[31]=E,e[32]=$):$=e[32],$},"FileRow"),vt=g(a=>{let e=(0,j.c)(65),{allSelected:s,busy:t,copiedKey:r,files:o,folders:u,handlers:c,onEnterFolder:n,prefix:d,references:h,selected:f,showReferences:m,someSelected:S,t:i,toggleSelectAll:x}=a,y;e[0]!==i?(y=i("Select all rows"),e[0]=i,e[1]=y):y=e[1];let v;e[2]!==s||e[3]!==S||e[4]!==y||e[5]!==x?(v=(0,l.jsxDEV)(te,{className:"w-8",children:(0,l.jsxDEV)(pe,{"aria-label":y,checked:s,"data-testid":"storage-select-all",indeterminate:S,onCheckedChange:x},void 0,!1)},void 0,!1),e[2]=s,e[3]=S,e[4]=y,e[5]=x,e[6]=v):v=e[6];let b;e[7]!==i?(b=i("key"),e[7]=i,e[8]=b):b=e[8];let k;e[9]!==b?(k=(0,l.jsxDEV)(te,{children:b},void 0,!1),e[9]=b,e[10]=k):k=e[10];let w;e[11]!==i?(w=i("size"),e[11]=i,e[12]=w):w=e[12];let T;e[13]!==w?(T=(0,l.jsxDEV)(te,{children:w},void 0,!1),e[13]=w,e[14]=T):T=e[14];let C;e[15]!==i?(C=i("content-type"),e[15]=i,e[16]=C):C=e[16];let N;e[17]!==C?(N=(0,l.jsxDEV)(te,{children:C},void 0,!1),e[17]=C,e[18]=N):N=e[18];let E;e[19]!==m||e[20]!==i?(E=m&&(0,l.jsxDEV)(te,{children:i("used by")},void 0,!1),e[19]=m,e[20]=i,e[21]=E):E=e[21];let $;e[22]!==i?($=i("Actions"),e[22]=i,e[23]=$):$=e[23];let R;e[24]!==$?(R=(0,l.jsxDEV)(te,{"aria-label":$},void 0,!1),e[24]=$,e[25]=R):R=e[25];let D;e[26]!==R||e[27]!==v||e[28]!==k||e[29]!==T||e[30]!==N||e[31]!==E?(D=(0,l.jsxDEV)(_e,{children:(0,l.jsxDEV)(ie,{children:[v,k,T,N,E,R]},void 0,!0)},void 0,!1),e[26]=R,e[27]=v,e[28]=k,e[29]=T,e[30]=N,e[31]=E,e[32]=D):D=e[32];let B;if(e[33]!==u||e[34]!==n||e[35]!==m){let z;e[37]!==n||e[38]!==m?(z=g(L=>(0,l.jsxDEV)(gt,{colSpan:m?6:5,name:L,onEnter:n},L,!1),"t142"),e[37]=n,e[38]=m,e[39]=z):z=e[39],B=u.map(z),e[33]=u,e[34]=n,e[35]=m,e[36]=B}else B=e[36];let I;if(e[40]!==t||e[41]!==r||e[42]!==o||e[43]!==c||e[44]!==d||e[45]!==h||e[46]!==f||e[47]!==m||e[48]!==i){let z;e[50]!==t||e[51]!==r||e[52]!==c||e[53]!==d||e[54]!==h||e[55]!==f||e[56]!==m||e[57]!==i?(z=g(L=>(0,l.jsxDEV)(pt,{busy:t,copiedKey:r,handlers:c,object:L,prefix:d,references:h[L.key],selected:f.has(L.key),showReferences:m,t:i},L.key,!1),"t152"),e[50]=t,e[51]=r,e[52]=c,e[53]=d,e[54]=h,e[55]=f,e[56]=m,e[57]=i,e[58]=z):z=e[58],I=o.map(z),e[40]=t,e[41]=r,e[42]=o,e[43]=c,e[44]=d,e[45]=h,e[46]=f,e[47]=m,e[48]=i,e[49]=I}else I=e[49];let K;e[59]!==B||e[60]!==I?(K=(0,l.jsxDEV)(Ee,{children:[B,I]},void 0,!0),e[59]=B,e[60]=I,e[61]=K):K=e[61];let O;return e[62]!==D||e[63]!==K?(O=(0,l.jsxDEV)(we,{className:"overflow-hidden py-0",children:(0,l.jsxDEV)(Ce,{className:"px-0",children:(0,l.jsxDEV)(Te,{"data-testid":"fb-table",children:[D,K]},void 0,!0)},void 0,!1)},void 0,!1),e[62]=D,e[63]=K,e[64]=O):O=e[64],O},"FileBrowserList"),bt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],yt=3600,ze=g((a,e)=>{if(e==="size")return a.size;if(e==="type")return a.httpMetadata?.contentType??"";if(e==="date"){if(a.uploaded===void 0)return 0;let s=new Date(a.uploaded).getTime();return Number.isNaN(s)?0:s}return e.startsWith("tag:")?a.customMetadata?.[e.slice(4)]??"":a.key},"fileSortValue"),xt=g((a,e,s)=>{let t=s==="desc"?-1:1;return a.toSorted((r,o)=>{let u=ze(r,e),c=ze(o,e);return(typeof u=="number"&&typeof c=="number"?u-c:String(u).localeCompare(String(c)))*t})},"sortFiles"),kt=g((a,e)=>{let s=new Set,t=[];for(let r of a){let o=r.key.slice(e.length),u=o.indexOf("/");u===-1?t.push(r):s.add(o.slice(0,u+1))}return{files:t,folders:[...s].toSorted((r,o)=>r.localeCompare(o))}},"deriveEntries"),St=g(a=>{let e=(0,j.c)(59),{bucket:s,buckets:t,busy:r,draftPrefix:o,expiry:u,fileInputRef:c,onBucketChange:n,onExpiryChange:d,onFileChange:h,onList:f,onPrefixChange:m,onUploadClick:S,t:i}=a,x;e[0]!==m?(x=g(G=>{m(G.target.value)},"t1"),e[0]=m,e[1]=x):x=e[1];let y=x,v;e[2]!==n?(v=g(G=>{n(G.target.value)},"t2"),e[2]=n,e[3]=v):v=e[3];let b=v,k;e[4]!==d?(k=g(G=>{d(Number.parseInt(G.target.value,10))},"t3"),e[4]=d,e[5]=k):k=e[5];let w=k,T;e[6]!==s||e[7]!==t||e[8]!==b||e[9]!==i?(T=t.length>0&&(0,l.jsxDEV)("select",{"aria-label":i("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:s,children:t.map(Ct)},void 0,!1),e[6]=s,e[7]=t,e[8]=b,e[9]=i,e[10]=T):T=e[10];let C;e[11]!==i?(C=i("Key prefix"),e[11]=i,e[12]=C):C=e[12];let N;e[13]!==i?(N=i("key prefix (optional)"),e[13]=i,e[14]=N):N=e[14];let E;e[15]!==o||e[16]!==y||e[17]!==C||e[18]!==N?(E=(0,l.jsxDEV)(Se,{"aria-label":C,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:y,placeholder:N,value:o},void 0,!1),e[15]=o,e[16]=y,e[17]=C,e[18]=N,e[19]=E):E=e[19];let $;e[20]!==i?($=i("List"),e[20]=i,e[21]=$):$=e[21];let R;e[22]!==r||e[23]!==f||e[24]!==$?(R=(0,l.jsxDEV)(ee,{"data-testid":"fb-list",disabled:r,onClick:f,size:"sm",type:"button",children:$},void 0,!1),e[22]=r,e[23]=f,e[24]=$,e[25]=R):R=e[25];let D;e[26]!==r||e[27]!==i?(D=i(r?"Uploading\u2026":"Upload"),e[26]=r,e[27]=i,e[28]=D):D=e[28];let B;e[29]!==r||e[30]!==S||e[31]!==D?(B=(0,l.jsxDEV)(ee,{"data-testid":"storage-upload",disabled:r,onClick:S,size:"sm",type:"button",variant:"outline",children:D},void 0,!1),e[29]=r,e[30]=S,e[31]=D,e[32]=B):B=e[32];let I;e[33]!==c||e[34]!==h?(I=(0,l.jsxDEV)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:c,type:"file"},void 0,!1),e[33]=c,e[34]=h,e[35]=I):I=e[35];let K;e[36]!==i?(K=i("Link expiry"),e[36]=i,e[37]=K):K=e[37];let O;e[38]!==i?(O=bt.map(G=>(0,l.jsxDEV)("option",{value:G.seconds,children:i(G.label)},G.seconds,!1)),e[38]=i,e[39]=O):O=e[39];let z;e[40]!==u||e[41]!==w||e[42]!==O?(z=(0,l.jsxDEV)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:w,value:u,children:O},void 0,!1),e[40]=u,e[41]=w,e[42]=O,e[43]=z):z=e[43];let L;e[44]!==K||e[45]!==z?(L=(0,l.jsxDEV)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[K,z]},void 0,!0),e[44]=K,e[45]=z,e[46]=L):L=e[46];let U;e[47]!==i?(U=i("Open in Cloudflare"),e[47]=i,e[48]=U):U=e[48];let M;e[49]!==U?(M=(0,l.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:Re,rel:"noreferrer",target:"_blank",children:U},void 0,!1),e[49]=U,e[50]=M):M=e[50];let P;return e[51]!==B||e[52]!==I||e[53]!==L||e[54]!==M||e[55]!==T||e[56]!==E||e[57]!==R?(P=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[T,E,R,B,I,L,M]},void 0,!0),e[51]=B,e[52]=I,e[53]=L,e[54]=M,e[55]=T,e[56]=E,e[57]=R,e[58]=P):P=e[58],P},"FileBrowserToolbar"),wt=g(a=>{let e=(0,j.c)(66),{onSortKeyChange:s,onThumbSizeChange:t,showGrid:r,showList:o,sortDirection:u,sortKey:c,t:n,tagKeys:d,thumbSize:h,toggleSortDirection:f,view:m}=a,S;e[0]!==s?(S=g(Z=>{s(Z.target.value)},"t1"),e[0]=s,e[1]=S):S=e[1];let i=S,x;e[2]!==t?(x=g(Z=>{t(Number.parseInt(Z.target.value,10))},"t2"),e[2]=t,e[3]=x):x=e[3];let y=x,v=m==="list",b;e[4]!==n?(b=n("List"),e[4]=n,e[5]=b):b=e[5];let k;e[6]!==o||e[7]!==v||e[8]!==b?(k=(0,l.jsxDEV)("button",{"aria-pressed":v,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:o,type:"button",children:b},void 0,!1),e[6]=o,e[7]=v,e[8]=b,e[9]=k):k=e[9];let w=m==="grid",T;e[10]!==n?(T=n("Grid"),e[10]=n,e[11]=T):T=e[11];let C;e[12]!==r||e[13]!==w||e[14]!==T?(C=(0,l.jsxDEV)("button",{"aria-pressed":w,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:r,type:"button",children:T},void 0,!1),e[12]=r,e[13]=w,e[14]=T,e[15]=C):C=e[15];let N;e[16]!==k||e[17]!==C?(N=(0,l.jsxDEV)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[k,C]},void 0,!0),e[16]=k,e[17]=C,e[18]=N):N=e[18];let E;e[19]!==n?(E=n("Sort"),e[19]=n,e[20]=E):E=e[20];let $;e[21]!==n?($=n("Name"),e[21]=n,e[22]=$):$=e[22];let R;e[23]!==$?(R=(0,l.jsxDEV)("option",{value:"name",children:$},void 0,!1),e[23]=$,e[24]=R):R=e[24];let D;e[25]!==n?(D=n("size"),e[25]=n,e[26]=D):D=e[26];let B;e[27]!==D?(B=(0,l.jsxDEV)("option",{value:"size",children:D},void 0,!1),e[27]=D,e[28]=B):B=e[28];let I;e[29]!==n?(I=n("Type"),e[29]=n,e[30]=I):I=e[30];let K;e[31]!==I?(K=(0,l.jsxDEV)("option",{value:"type",children:I},void 0,!1),e[31]=I,e[32]=K):K=e[32];let O;e[33]!==n?(O=n("Modified"),e[33]=n,e[34]=O):O=e[34];let z;e[35]!==O?(z=(0,l.jsxDEV)("option",{value:"date",children:O},void 0,!1),e[35]=O,e[36]=z):z=e[36];let L;e[37]!==d?(L=d.map(Nt),e[37]=d,e[38]=L):L=e[38];let U;e[39]!==i||e[40]!==c||e[41]!==R||e[42]!==B||e[43]!==K||e[44]!==z||e[45]!==L?(U=(0,l.jsxDEV)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:i,value:c,children:[R,B,K,z,L]},void 0,!0),e[39]=i,e[40]=c,e[41]=R,e[42]=B,e[43]=K,e[44]=z,e[45]=L,e[46]=U):U=e[46];let M;e[47]!==E||e[48]!==U?(M=(0,l.jsxDEV)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[E,U]},void 0,!0),e[47]=E,e[48]=U,e[49]=M):M=e[49];let P;e[50]!==n?(P=n("Toggle sort direction"),e[50]=n,e[51]=P):P=e[51];let G=u==="asc"?"\u2191":"\u2193",W;e[52]!==P||e[53]!==G||e[54]!==f?(W=(0,l.jsxDEV)("button",{"aria-label":P,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:f,type:"button",children:G},void 0,!1),e[52]=P,e[53]=G,e[54]=f,e[55]=W):W=e[55];let Y;e[56]!==y||e[57]!==n||e[58]!==h||e[59]!==m?(Y=m==="grid"&&(0,l.jsxDEV)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[n("Thumbnail size"),(0,l.jsxDEV)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:y,step:8,type:"range",value:h},void 0,!1)]},void 0,!0),e[56]=y,e[57]=n,e[58]=h,e[59]=m,e[60]=Y):Y=e[60];let se;return e[61]!==M||e[62]!==W||e[63]!==Y||e[64]!==N?(se=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[N,M,W,Y]},void 0,!0),e[61]=M,e[62]=W,e[63]=Y,e[64]=N,e[65]=se):se=e[65],se},"FileBrowserControls");function Ct(a){return(0,l.jsxDEV)("option",{value:a,children:a},a,!1)}g(Ct,"_temp$1");function Nt(a){return(0,l.jsxDEV)("option",{value:`tag:${a}`,children:a},a,!1)}g(Nt,"_temp2");var Tt=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,_t=g(a=>(a.httpMetadata?.contentType??"").startsWith("image/")||Tt.test(a.key),"isImage"),Et=g(()=>{let a=(0,j.c)(1),e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsxDEV)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"},void 0,!1)},void 0,!1),a[0]=e):e=a[0],e},"FileGlyph"),$t=g(a=>{let e=(0,j.c)(13),{object:s,resolveUrl:t}=a,[r,o]=(0,_.useState)(null),[u,c]=(0,_.useState)(!1),n;e[0]!==s?(n=_t(s),e[0]=s,e[1]=n):n=e[1];let d=n,h,f;e[2]!==d||e[3]!==s.key||e[4]!==t?(h=g(()=>{if(!d)return;let x={cancelled:!1};return H((async()=>{try{let y=await t(s.key);x.cancelled||o(y)}catch{x.cancelled||c(!0)}})()),()=>{x.cancelled=!0}},"t2"),f=[d,s.key,t],e[2]=d,e[3]=s.key,e[4]=t,e[5]=h,e[6]=f):(h=e[5],f=e[6]),(0,_.useEffect)(h,f);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=g(()=>{c(!0)},"t4"),e[7]=m):m=e[7];let S=m,i;return e[8]!==u||e[9]!==d||e[10]!==s.key||e[11]!==r?(i=(0,l.jsxDEV)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:d&&r!==null&&!u?(0,l.jsxDEV)("img",{alt:s.key,className:"size-full object-cover",loading:"lazy",onError:S,src:r},void 0,!1):(0,l.jsxDEV)(Et,{},void 0,!1)},void 0,!1),e[8]=u,e[9]=d,e[10]=s.key,e[11]=r,e[12]=i):i=e[12],i},"Thumbnail"),Ft=g(a=>{let e=(0,j.c)(38),{busy:s,copiedKey:t,handlers:r,object:o,prefix:u,references:c,resolveUrl:n,selected:d,showReferences:h,t:f}=a,{copy:m,download:S,name:i,remove:x,toggle:y}=Be(o,u,r),v;e[0]!==o||e[1]!==n?(v=(0,l.jsxDEV)($t,{object:o,resolveUrl:n},void 0,!1),e[0]=o,e[1]=n,e[2]=v):v=e[2];let b;e[3]!==o.key||e[4]!==d||e[5]!==f||e[6]!==y?(b=(0,l.jsxDEV)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,l.jsxDEV)(je,{objectKey:o.key,onToggle:y,selected:d,t:f},void 0,!1)},void 0,!1),e[3]=o.key,e[4]=d,e[5]=f,e[6]=y,e[7]=b):b=e[7];let k;e[8]!==v||e[9]!==b?(k=(0,l.jsxDEV)("div",{className:"relative",children:[v,b]},void 0,!0),e[8]=v,e[9]=b,e[10]=k):k=e[10];let w;e[11]!==i?(w=(0,l.jsxDEV)("p",{className:"truncate font-mono text-xs",title:i,children:i},void 0,!1),e[11]=i,e[12]=w):w=e[12];let T;e[13]!==o.size?(T=me(o.size),e[13]=o.size,e[14]=T):T=e[14];let C;e[15]!==T?(C=(0,l.jsxDEV)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:T},void 0,!1),e[15]=T,e[16]=C):C=e[16];let N;e[17]!==o.key||e[18]!==c||e[19]!==h||e[20]!==f?(N=h&&(0,l.jsxDEV)("div",{className:"mt-1",children:(0,l.jsxDEV)(Oe,{objectKey:o.key,references:c,t:f},void 0,!1)},void 0,!1),e[17]=o.key,e[18]=c,e[19]=h,e[20]=f,e[21]=N):N=e[21];let E;e[22]!==w||e[23]!==C||e[24]!==N?(E=(0,l.jsxDEV)("div",{className:"min-w-0",children:[w,C,N]},void 0,!0),e[22]=w,e[23]=C,e[24]=N,e[25]=E):E=e[25];let $=t===o.key,R;e[26]!==s||e[27]!==m||e[28]!==S||e[29]!==o.key||e[30]!==x||e[31]!==f||e[32]!==$?(R=(0,l.jsxDEV)("div",{className:"flex items-center gap-1",children:(0,l.jsxDEV)(Ie,{busy:s,buttonClassName:"h-7 px-2 text-xs",copied:$,objectKey:o.key,onCopy:m,onDelete:x,onDownload:S,t:f},void 0,!1)},void 0,!1),e[26]=s,e[27]=m,e[28]=S,e[29]=o.key,e[30]=x,e[31]=f,e[32]=$,e[33]=R):R=e[33];let D;return e[34]!==R||e[35]!==k||e[36]!==E?(D=(0,l.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[k,E,R]},void 0,!0),e[34]=R,e[35]=k,e[36]=E,e[37]=D):D=e[37],D},"GalleryTile"),Dt=g(a=>{let e=(0,j.c)(9),{name:s,onEnter:t}=a,r;e[0]!==s||e[1]!==t?(r=g(()=>{t(s)},"t1"),e[0]=s,e[1]=t,e[2]=r):r=e[2];let o=r,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsxDEV)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,l.jsxDEV)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,l.jsxDEV)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"},void 0,!1)},void 0,!1)},void 0,!1),e[3]=u):u=e[3];let c;e[4]!==s?(c=(0,l.jsxDEV)("span",{className:"truncate font-mono text-xs",title:s,children:s},void 0,!1),e[4]=s,e[5]=c):c=e[5];let n;return e[6]!==o||e[7]!==c?(n=(0,l.jsxDEV)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:o,type:"button",children:[u,c]},void 0,!0),e[6]=o,e[7]=c,e[8]=n):n=e[8],n},"FolderTile"),Rt=g(a=>{let e=(0,j.c)(34),{busy:s,copiedKey:t,files:r,folders:o,handlers:u,onEnterFolder:c,prefix:n,references:d,resolveUrl:h,selected:f,showReferences:m,size:S,t:i}=a,x;e[0]!==S?(x=S.toString(),e[0]=S,e[1]=x):x=e[1];let y=`repeat(auto-fill, minmax(${x}px, 1fr))`,v;e[2]!==y?(v={gridTemplateColumns:y},e[2]=y,e[3]=v):v=e[3];let b=v,k;if(e[4]!==o||e[5]!==c){let C;e[7]!==c?(C=g(N=>(0,l.jsxDEV)(Dt,{name:N,onEnter:c},N,!1),"t52"),e[7]=c,e[8]=C):C=e[8],k=o.map(C),e[4]=o,e[5]=c,e[6]=k}else k=e[6];let w;if(e[9]!==s||e[10]!==t||e[11]!==r||e[12]!==u||e[13]!==n||e[14]!==d||e[15]!==h||e[16]!==f||e[17]!==m||e[18]!==i){let C;e[20]!==s||e[21]!==t||e[22]!==u||e[23]!==n||e[24]!==d||e[25]!==h||e[26]!==f||e[27]!==m||e[28]!==i?(C=g(N=>(0,l.jsxDEV)(Ft,{busy:s,copiedKey:t,handlers:u,object:N,prefix:n,references:d[N.key],resolveUrl:h,selected:f.has(N.key),showReferences:m,t:i},N.key,!1),"t62"),e[20]=s,e[21]=t,e[22]=u,e[23]=n,e[24]=d,e[25]=h,e[26]=f,e[27]=m,e[28]=i,e[29]=C):C=e[29],w=r.map(C),e[9]=s,e[10]=t,e[11]=r,e[12]=u,e[13]=n,e[14]=d,e[15]=h,e[16]=f,e[17]=m,e[18]=i,e[19]=w}else w=e[19];let T;return e[30]!==b||e[31]!==k||e[32]!==w?(T=(0,l.jsxDEV)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[k,w]},void 0,!0),e[30]=b,e[31]=k,e[32]=w,e[33]=T):T=e[33],T},"FileGallery"),zt=g(a=>{let e=(0,j.c)(23),{reference:s,t}=a,r=`fb-dangling-${s.table}-${s.id}-${s.column}`,o=`${s.table}\xB7${s.id}`,u;e[0]!==o?(u=(0,l.jsxDEV)(oe,{variant:"secondary",children:o},void 0,!1),e[0]=o,e[1]=u):u=e[1];let c;e[2]!==s.column?(c=(0,l.jsxDEV)("span",{className:"text-muted-foreground",children:s.column},void 0,!1),e[2]=s.column,e[3]=c):c=e[3];let n;e[4]!==t?(n=t("\u2192"),e[4]=t,e[5]=n):n=e[5];let d;e[6]!==n?(d=(0,l.jsxDEV)("span",{className:"text-muted-foreground/60",children:n},void 0,!1),e[6]=n,e[7]=d):d=e[7];let h;e[8]!==s.key?(h=(0,l.jsxDEV)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:s.key},void 0,!1),e[8]=s.key,e[9]=h):h=e[9];let f;e[10]!==u||e[11]!==c||e[12]!==d||e[13]!==h?(f=(0,l.jsxDEV)("span",{className:"flex flex-wrap items-center gap-1.5",children:[u,c,d,h]},void 0,!0),e[10]=u,e[11]=c,e[12]=d,e[13]=h,e[14]=f):f=e[14];let m;e[15]!==t?(m=t("Missing object"),e[15]=t,e[16]=m):m=e[16];let S;e[17]!==m?(S=(0,l.jsxDEV)(oe,{className:"border-destructive/40 text-destructive",variant:"outline",children:m},void 0,!1),e[17]=m,e[18]=S):S=e[18];let i;return e[19]!==r||e[20]!==S||e[21]!==f?(i=(0,l.jsxDEV)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":r,children:[f,S]},void 0,!0),e[19]=r,e[20]=S,e[21]=f,e[22]=i):i=e[22],i},"DanglingRow"),Kt=g(a=>{let e=(0,j.c)(37),{busy:s,onCheck:t,references:r,t:o,truncated:u}=a,c;e[0]!==o?(c=o("Integrity"),e[0]=o,e[1]=c):c=e[1];let n;e[2]!==c?(n=(0,l.jsxDEV)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:c},void 0,!1),e[2]=c,e[3]=n):n=e[3];let d;e[4]!==o?(d=o("Orphaned objects"),e[4]=o,e[5]=d):d=e[5];let h;e[6]!==d?(h=(0,l.jsxDEV)("span",{className:"text-sm font-medium text-foreground",children:d},void 0,!1),e[6]=d,e[7]=h):h=e[7];let f;e[8]!==o?(f=o("Find records whose file reference points at an object the bucket no longer has."),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=(0,l.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:f},void 0,!1),e[10]=f,e[11]=m):m=e[11];let S;e[12]!==n||e[13]!==h||e[14]!==m?(S=(0,l.jsxDEV)("div",{className:"flex flex-col gap-1",children:[n,h,m]},void 0,!0),e[12]=n,e[13]=h,e[14]=m,e[15]=S):S=e[15];let i;e[16]!==s||e[17]!==o?(i=o(s?"Checking\u2026":"Check for orphans"),e[16]=s,e[17]=o,e[18]=i):i=e[18];let x;e[19]!==s||e[20]!==t||e[21]!==i?(x=(0,l.jsxDEV)(ee,{"data-testid":"fb-orphans-check",disabled:s,onClick:t,size:"sm",type:"button",variant:"outline",children:i},void 0,!1),e[19]=s,e[20]=t,e[21]=i,e[22]=x):x=e[22];let y;e[23]!==S||e[24]!==x?(y=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[S,x]},void 0,!0),e[23]=S,e[24]=x,e[25]=y):y=e[25];let v;e[26]!==r?.length||e[27]!==o?(v=r?.length===0&&(0,l.jsxDEV)(fe,{description:o("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:o("No dangling references.")},void 0,!1),e[26]=r?.length,e[27]=o,e[28]=v):v=e[28];let b;e[29]!==r||e[30]!==o||e[31]!==u?(b=r!==void 0&&r.length>0&&(0,l.jsxDEV)(l.Fragment,{children:[u&&(0,l.jsxDEV)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:o("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:r.length})},void 0,!1),(0,l.jsxDEV)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:r.map(w=>(0,l.jsxDEV)(zt,{reference:w,t:o},`${w.table}\xB7${w.id}\xB7${w.column}`,!1))},void 0,!1)]},void 0,!0),e[29]=r,e[30]=o,e[31]=u,e[32]=b):b=e[32];let k;return e[33]!==y||e[34]!==v||e[35]!==b?(k=(0,l.jsxDEV)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[y,v,b]},void 0,!0),e[33]=y,e[34]=v,e[35]=b,e[36]=k):k=e[36],k},"OrphanedObjectsSection"),Lt=g(function(a,e){let s=(0,j.c)(18),t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,s[0]=t):t=s[0];let[r,o]=(0,_.useState)(t),u;s[1]===Symbol.for("react.memo_cache_sentinel")?(u=g(v=>{o(b=>{let k=new Set(b);return k.has(v)?k.delete(v):k.add(v),k})},"t1"),s[1]=u):u=s[1];let c=u,n;s[2]===Symbol.for("react.memo_cache_sentinel")?(n=g(()=>{o(new Set)},"t2"),s[2]=n):n=s[2];let d=n,h,f,m;if(s[3]!==a||s[4]!==e||s[5]!==r){let v;s[9]!==e?(v=g(b=>e(b),"t42"),s[9]=e,s[10]=v):v=s[10],f=a.map(v),h=f.length>0&&f.every(b=>r.has(b)),m=!h&&f.some(b=>r.has(b)),s[3]=a,s[4]=e,s[5]=r,s[6]=h,s[7]=f,s[8]=m}else h=s[6],f=s[7],m=s[8];let S=m,i;s[11]!==f?(i=g(()=>{o(v=>f.every(b=>v.has(b))?new Set:new Set(f))},"t4"),s[11]=f,s[12]=i):i=s[12];let x=i,y;return s[13]!==h||s[14]!==r||s[15]!==S||s[16]!==x?(y={allSelected:h,clear:d,selected:r,someSelected:S,toggle:c,toggleAll:x},s[13]=h,s[14]=r,s[15]=S,s[16]=x,s[17]=y):y=s[17],y},"useKeySelection"),Bt=ue(ge.storageReferences),It=ue(ge.storageOrphans),Ke=1e4,Ot=1e3,jt=3600,At=g((a,e)=>{if(!("document"in globalThis))return;let s=globalThis.document.createElement("a");s.href=a,s.download=e,s.rel="noopener",globalThis.document.body.append(s),s.click(),s.remove()},"triggerDownload"),Ut=g(async a=>{"navigator"in globalThis&&"clipboard"in globalThis.navigator&&await globalThis.navigator.clipboard.writeText(a)},"copyToClipboard"),Mt=g(({initialPrefix:a,pageSize:e})=>{let s=xe(),[t,r]=(0,_.useState)(a??""),[o,u]=(0,_.useState)(a??""),[c,n]=(0,_.useState)(yt),[d,h]=(0,_.useState)("list"),[f,m]=(0,_.useState)(128),[S,i]=(0,_.useState)("name"),[x,y]=(0,_.useState)("asc"),[v,b]=(0,_.useState)(void 0),[k,w]=(0,_.useState)(void 0),[T,C]=(0,_.useState)(!1),[N,E]=(0,_.useState)(void 0),[$,R]=(0,_.useState)(void 0),[D,B]=(0,_.useState)(""),[I,K]=(0,_.useState)({}),[O,z]=(0,_.useState)(!1),[L,U]=(0,_.useState)(void 0),[M,P]=(0,_.useState)(!1),[G,W]=(0,_.useState)(!1),[Y,se]=(0,_.useState)([]),[Z,ve]=(0,_.useState)("");(0,_.useEffect)(()=>{let p={cancelled:!1};return H((async()=>{try{let F=await s.listStorageBuckets();if(!p.cancelled){se(F);let[A]=F;A!==void 0&&ve(V=>V===""?A:V)}}catch{}})()),()=>{p.cancelled=!0}},[s]);let q=(0,_.useMemo)(()=>({list:g(p=>s.listStorageObjects({...p,bucket:Z}),"list"),remove:g(p=>s.deleteStorageObject(p,{bucket:Z}),"remove"),signedUrl:g((p,F)=>s.signedStorageUrl(p,{...F,bucket:Z}),"signedUrl"),upload:g(p=>s.uploadStorageObject({...p,bucket:Z}),"upload")}),[Z,s]),X=(0,_.useCallback)(async(p,F,A)=>{w(void 0),C(!0);try{let V=await q.list({cursor:F,limit:e,prefix:p});b(re=>A&&re!==void 0?[...re,...V.objects]:V.objects),R(V.cursor)}catch(V){A||b(void 0),w(J(V))}finally{C(!1)}},[e,q]);(0,_.useEffect)(()=>{H(X(a??"",void 0,!1))},[X,a]);let Ae=(v?.length??0)<=e;Fe(()=>{H(X(t,void 0,!1))},Ae);let{files:ae,folders:Ue}=kt(v??[],t),Me=(0,_.useMemo)(()=>{let p=new Set;for(let F of ae)for(let A of Object.keys(F.customMetadata??{}))p.add(A);return[...p].toSorted((F,A)=>F.localeCompare(A))},[ae]),ne=xt(ae,S,x),ce=(0,_.useMemo)(()=>[...new Set(ne.map(p=>p.key))].toSorted((p,F)=>p.localeCompare(F)).join(`
|
|
3
3
|
`),[ne]);(0,_.useEffect)(()=>{let p=ce===""?[]:ce.split(`
|
|
4
4
|
`);if(p.length===0){K({});return}let F={current:!0};return H((async()=>{try{let A=await s.query(Bt,{keys:p},he(D));F.current&&(K(A.references??{}),z(Object.keys(A.storageColumns??{}).length>0))}catch{F.current&&(K({}),z(!1))}})()),()=>{F.current=!1}},[s,ce,D]);let Ge=g(p=>p.key,"keyOf"),{allSelected:He,clear:le,selected:be,someSelected:Pe,toggle:Ve,toggleAll:We}=Lt(ne,Ge),Ze=g(()=>{r(o),le(),H(X(o,void 0,!1))},"listFirst"),qe=g(()=>{H(X(t,$,!0))},"loadMore"),ye=g(p=>{r(p),u(p),le(),H(X(p,void 0,!1))},"navigate"),Xe=g(p=>{ye(`${t}${p}`)},"enterFolder"),Ye=g(p=>q.signedUrl(p,{expiresInSeconds:jt}),"resolveUrl"),Je=g(()=>{h("list")},"showList"),Qe=g(()=>{h("grid")},"showGrid"),et=g(p=>{i(p)},"onSortKeyChange"),tt=g(()=>{y(p=>p==="asc"?"desc":"asc")},"toggleSortDirection"),st=g(p=>{m(p)},"onThumbSizeChange"),lt=g(p=>{n(p)},"onExpiryChange"),ot=g(()=>{w(void 0),C(!0),H((async()=>{try{for(let p of be)await q.remove(p);await X(t,void 0,!1),le()}catch(p){w(J(p))}finally{C(!1)}})())},"bulkDelete"),nt=g(p=>{w(void 0),H((async()=>{try{let F=await q.signedUrl(p,{expiresInSeconds:c});await Ut(F),E(p)}catch(F){w(J(F))}})())},"onCopy"),rt=g(p=>{w(void 0),H((async()=>{try{let F=await q.signedUrl(p,{expiresInSeconds:c}),A=p.slice(p.lastIndexOf("/")+1)||p;At(F,A)}catch(F){w(J(F))}})())},"onDownload");(0,_.useEffect)(()=>{if(N===void 0)return;let p=globalThis.setTimeout(()=>{E(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[N]);let it=g(p=>{w(void 0),C(!0),H((async()=>{try{await q.remove(p),await X(t,void 0,!1)}catch(F){w(J(F))}finally{C(!1)}})())},"onDelete"),at=g(p=>{let F=`${t}${p.name}`;w(void 0),C(!0),H((async()=>{try{let A=await p.arrayBuffer();await q.upload({body:A,contentType:p.type===""?void 0:p.type,key:F}),await X(t,void 0,!1)}catch(A){w(J(A))}finally{C(!1)}})())},"onFile");(0,_.useEffect)(()=>{U(void 0),W(!1)},[D]);let ct=g(()=>{w(void 0),P(!0),H((async()=>{try{let p=[],F;do{let V=await q.list({cursor:F,limit:Ot});for(let re of V.objects)p.push(re.key);F=p.length>=Ke?void 0:V.cursor}while(F!==void 0);if(p.length>=Ke)U([]),W(!0);else{let V=await s.query(It,{liveKeys:p},he(D));U(V.references??[]),W(V.truncated===!0)}}catch(p){U([]),W(!1),w(J(p))}finally{P(!1)}})())},"checkOrphans"),dt=g(p=>{ve(p),r(a??""),u(a??""),b(void 0),le()},"selectBucket");return{allSelected:He,bucket:Z,buckets:Y,bulkDelete:ot,busy:T,checkOrphans:ct,clearSelection:le,copiedKey:N,danglingBusy:M,danglingReferences:L,danglingTruncated:G,draftPrefix:o,enterFolder:Xe,error:k,expiry:c,files:ne,folders:Ue,hasObjects:v!==void 0&&v.length>0,hasStorageColumns:O,listFirst:Ze,loaded:v!==void 0,loadMore:qe,navigate:ye,nextCursor:$,onCopy:nt,onDelete:it,onDownload:rt,onExpiryChange:lt,onFile:at,onSortKeyChange:et,onThumbSizeChange:st,prefix:t,referenceShard:D,references:I,resolveUrl:Ye,selectBucket:dt,selected:be,setDraftPrefix:u,setReferenceShard:B,showGrid:Qe,showList:Je,someSelected:Pe,sortDirection:x,sortKey:S,tagKeys:Me,thumbSize:f,toggleSelect:Ve,toggleSelectAll:We,toggleSortDirection:tt,view:d}},"useFileBrowser"),Gt=100,Le=g(a=>{let e=(0,j.c)(6),{label:s,onNavigate:t,target:r}=a,o;e[0]!==t||e[1]!==r?(o=g(()=>{t(r)},"t1"),e[0]=t,e[1]=r,e[2]=o):o=e[2];let u=o,c;return e[3]!==u||e[4]!==s?(c=(0,l.jsxDEV)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:u,type:"button",children:s},void 0,!1),e[3]=u,e[4]=s,e[5]=c):c=e[5],c},"Crumb"),Ht=g(a=>{let e=(0,j.c)(11),{onNavigate:s,prefix:t,t:r}=a,o;if(e[0]!==s||e[1]!==t||e[2]!==r){let u=t.split("/").filter(Pt),c;e[4]!==r?(c=r("Folder path"),e[4]=r,e[5]=c):c=e[5];let n;e[6]!==r?(n=r("root"),e[6]=r,e[7]=n):n=e[7];let d;e[8]!==s||e[9]!==n?(d=(0,l.jsxDEV)(Le,{label:n,onNavigate:s,target:""},void 0,!1),e[8]=s,e[9]=n,e[10]=d):d=e[10],o=(0,l.jsxDEV)("nav",{"aria-label":c,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[d,u.map((h,f)=>(0,l.jsxDEV)("span",{className:"flex items-center gap-0.5",children:[(0,l.jsxDEV)("span",{className:"text-muted-foreground/50",children:"/"},void 0,!1),(0,l.jsxDEV)(Le,{label:h,onNavigate:s,target:`${u.slice(0,f+1).join("/")}/`},void 0,!1)]},`${h}-${f.toString()}`,!0))]},void 0,!0),e[0]=s,e[1]=t,e[2]=r,e[3]=o}else o=e[3];return o},"Breadcrumbs"),as=g(({initialPrefix:a,pageSize:e=Gt})=>{let s=ke(),t=Mt({initialPrefix:a,pageSize:e}),r=(0,_.useRef)(null),{onCopy:o,onDelete:u,onDownload:c,onFile:n,toggleSelect:d}=t,h={onCopy:o,onDelete:u,onDownload:c,onToggleSelect:d},f=g(()=>{r.current?.click()},"onUploadClick"),m=g(i=>{let x=i.target,y=x.files?.[0];x.value="",y&&n(y)},"onFileChange"),S=t.loaded&&!t.hasObjects;return(0,l.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,l.jsxDEV)(St,{bucket:t.bucket,buckets:t.buckets,busy:t.busy,draftPrefix:t.draftPrefix,expiry:t.expiry,fileInputRef:r,onBucketChange:t.selectBucket,onExpiryChange:t.onExpiryChange,onFileChange:m,onList:t.listFirst,onPrefixChange:t.setDraftPrefix,onUploadClick:f,t:s},void 0,!1),t.loaded&&(0,l.jsxDEV)(Ht,{onNavigate:t.navigate,prefix:t.prefix,t:s},void 0,!1),t.hasObjects&&(0,l.jsxDEV)(wt,{onSortKeyChange:t.onSortKeyChange,onThumbSizeChange:t.onThumbSizeChange,showGrid:t.showGrid,showList:t.showList,sortDirection:t.sortDirection,sortKey:t.sortKey,t:s,tagKeys:t.tagKeys,thumbSize:t.thumbSize,toggleSortDirection:t.toggleSortDirection,view:t.view},void 0,!1),t.hasStorageColumns&&(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,l.jsxDEV)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:s("References shard")},void 0,!1),(0,l.jsxDEV)(Ne,{id:"fb-reference-shard-input",onChange:t.setReferenceShard,testId:"fb-reference-shard-input",value:t.referenceShard},void 0,!1),(0,l.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:s("Which shard's records are checked for references to these files. Empty = root shard.")},void 0,!1)]},void 0,!0),t.hasStorageColumns&&(0,l.jsxDEV)(Kt,{busy:t.danglingBusy,onCheck:t.checkOrphans,references:t.danglingReferences,t:s,truncated:t.danglingTruncated},void 0,!1),t.selected.size>0&&(0,l.jsxDEV)(De,{count:t.selected.size,editable:!0,onClear:t.clearSelection,onDelete:t.bulkDelete},void 0,!1),t.error!==void 0&&(0,l.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:t.error},void 0,!1),S&&(0,l.jsxDEV)(fe,{description:s("Objects you upload to your R2 buckets will appear here."),icon:(0,l.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,l.jsxDEV)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"},void 0,!1),(0,l.jsxDEV)("path",{d:"M12 11v5m-2.5-2.5h5"},void 0,!1)]},void 0,!0),testId:"fb-empty",title:s("No objects.")},void 0,!1),t.hasObjects&&t.view==="list"&&(0,l.jsxDEV)(vt,{allSelected:t.allSelected,busy:t.busy,copiedKey:t.copiedKey,files:t.files,folders:t.folders,handlers:h,onEnterFolder:t.enterFolder,prefix:t.prefix,references:t.references,selected:t.selected,showReferences:t.hasStorageColumns,someSelected:t.someSelected,t:s,toggleSelectAll:t.toggleSelectAll},void 0,!1),t.hasObjects&&t.view==="grid"&&(0,l.jsxDEV)(Rt,{busy:t.busy,copiedKey:t.copiedKey,files:t.files,folders:t.folders,handlers:h,onEnterFolder:t.enterFolder,prefix:t.prefix,references:t.references,resolveUrl:t.resolveUrl,selected:t.selected,showReferences:t.hasStorageColumns,size:t.thumbSize,t:s},void 0,!1),t.nextCursor!==void 0&&(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)(ee,{"data-testid":"fb-next",disabled:t.busy,onClick:t.loadMore,size:"sm",type:"button",variant:"outline",children:s("Load more")},void 0,!1)},void 0,!1)]},void 0,!0)},"FileBrowser");function Pt(a){return a!==""}g(Pt,"_temp");export{as as FileBrowser};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as J}from"./chunk-
|
|
1
|
+
import{a as J}from"./chunk-KMNEQEHM.js";import{a as P}from"./chunk-VLXV72QE.js";import{a as B}from"./chunk-ATG3655M.js";import{b as j}from"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import{c as D}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as f}from"./chunk-BOXSWNXZ.js";import{c as L}from"./chunk-EOSXQTSQ.js";import{a as v,e as y}from"./chunk-SEU5V7I6.js";import"./chunk-CKSHCYGC.js";import{f as _}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as E,e as S,f as w,g as b,k as I}from"./chunk-2GMEK2W3.js";import{b as N}from"./chunk-J75M4LTW.js";import{a as o,e as R,f as K,h as U}from"./chunk-RRCPZMC2.js";var c=R(K(),1);var e=R(U(),1);var V=S(f.exportShard),X=S(f.importShard),z=o(m=>m.map(a=>JSON.stringify(a)).join(`
|
|
2
2
|
`),"toNdjson"),G=o(m=>{let a=[],x=m.split(`
|
|
3
3
|
`);for(let[r,n]of x.entries()){let h=n.trim();if(h==="")continue;let l=JSON.parse(h);if(typeof l!="object"||l===null)throw new N("INTERNAL",`line ${(r+1).toString()}: expected a { table, doc } object`);let s=l;if(typeof s.table!="string"||typeof s.doc!="object"||s.doc===null||Array.isArray(s.doc))throw new N("INTERNAL",`line ${(r+1).toString()}: expected a { table, doc } object`);a.push(s)}return a},"parseNdjson"),ie=o(({initialShardKey:m})=>{let a=_(),x=L(),r=E(),[n,h]=(0,c.useState)(m??""),[l,s]=(0,c.useState)(""),[C,p]=(0,c.useState)(!1),[T,u]=(0,c.useState)(null),[i,g]=(0,c.useState)(null),[A,O]=(0,c.useState)(null),$=o(async()=>{p(!0),u(null),g(null);try{let t=await a.query(V,{},w(n));j(n),s(z(t.rows)),O(t.rows.length)}catch(t){u(b(t))}finally{p(!1)}},"exportShard"),k=o(async()=>{p(!0),u(null),g(null),O(null);let t;try{t=G(l)}catch(d){u(r("Invalid NDJSON: {message}",{message:b(d)})),p(!1);return}try{let d=await a.query(X,{rows:t},w(n));j(n),g(d),x(f.readTablePage),x(f.listTables)}catch(d){u(b(d))}finally{p(!1)}},"importShard"),M=i===null?0:Object.values(i.inserted).reduce((t,d)=>t+d,0),q=o(()=>{I($())},"runExport"),F=o(()=>{I(k())},"runImport"),H=o(t=>{s(t.target.value)},"onNdjsonChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,e.jsxDEV)(v,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Export")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(y,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(B,{onChange:h,testId:"ei-shard-input",value:n},void 0,!1),(0,e.jsxDEV)(D,{"data-testid":"ei-export",disabled:C,onClick:q,type:"button",children:r("Export")},void 0,!1)]},void 0,!0),A!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:r("Exported {count} rows.",{count:A})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)(v,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Import")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(y,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxDEV)(P,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:H,placeholder:'{"table":"messages","doc":{\u2026}}',value:l},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:(0,e.jsxDEV)(J,{confirmLabel:r("Import (writes rows)?"),disabled:C||l.trim()==="",onConfirm:F,testId:"ei-import",children:r("Import")},void 0,!1)},void 0,!1),i!==null&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:r("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:M})},void 0,!1),i.errors.length>0&&(0,e.jsxDEV)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(t=>(0,e.jsxDEV)("li",{className:"text-xs text-destructive",children:r("line {line} ({table}): {message}",{line:t.line,message:t.message,table:t.table})},`${t.table}-${t.line.toString()}`,!1))},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),T!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:T},void 0,!1)]},void 0,!0)},"ExportImportPanel");export{ie as ExportImportPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-EOSXQTSQ.js";import{f as m}from"./chunk-M5OMEMQ3.js";import{g as d,k as g}from"./chunk-2GMEK2W3.js";import{a as o,e as f,f as A,g as b}from"./chunk-RRCPZMC2.js";var p=f(b(),1);var c=f(A(),1);var h={capabilities:{accounts:!0,admin:!0,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},L=o(()=>{let e=(0,p.c)(6),t=m(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],e[0]=a):a=e[0];let s;e[1]!==t?(s=o(()=>t.getAuthConfig(),"t1"),e[1]=t,e[2]=s):s=e[2];let{data:u,isLoading:i}=y(a,s),r=u??h,l=!i,n;return e[3]!==r||e[4]!==l?(n={config:r,ready:l},e[3]=r,e[4]=l,e[5]=n):n=e[5],n},"useAuthConfig"),w=o(()=>{let[e,t]=(0,c.useState)(!1),[a,s]=(0,c.useState)(null);return{busy:e,error:a,run:o(i=>{g((async()=>{t(!0),s(null);try{await i()}catch(r){s(d(r))}finally{t(!1)}})())},"run")}},"useAsyncSubmit");export{L as a,w as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-WKWKAU22.js";import{a as w,b as O,c as D,d as C,e as v,f as h}from"./chunk-GTM65MVX.js";import{a as L}from"./chunk-BOXSWNXZ.js";import{a as S}from"./chunk-TAD43CG5.js";import{b as _}from"./chunk-EOSXQTSQ.js";import{a as A,e as I}from"./chunk-SEU5V7I6.js";import{b as E}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as b}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a as u,e as T,f as M,g as P,h as V}from"./chunk-RRCPZMC2.js";var B=T(P(),1),K=T(M(),1);var t=T(V(),1);var k="container:",F={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},H=u(e=>{let r=e.indexOf(":");if(r===-1)return{event:e.trim()};let a=e.slice(r+1).trim(),s=e.slice(0,r).trim();return a===""?{event:s}:{detail:a,event:s}},"parseContainerMessage"),W=u(e=>{let r=new Map;for(let a of e){let s=a.functionPath??"";if(!s.startsWith(k))continue;let n=s.slice(k.length);if(n==="")continue;let i=r.get(n);if(i!==void 0&&i.timestamp>=a.timestamp)continue;let{detail:x,event:o}=H(a.message);r.set(n,{detail:x,event:o,level:a.level,name:n,state:F[o]??"unknown",timestamp:a.timestamp})}return[...r.values()].toSorted((a,s)=>a.name.localeCompare(s.name))},"foldContainerInstances"),$={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},j=u(e=>{let{entries:r}=e??{};return Array.isArray(r)?r:[]},"entriesOf"),ee=u(()=>{let e=(0,B.c)(23),r=b(),a,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},s={live:!0,shardKey:""},e[0]=a,e[1]=s):(a=e[0],s=e[1]);let{data:n,error:i,liveError:x}=_(L.getLogs,a,s),o=n!==void 0,N;e[2]!==n?(N=W(j(n)),e[2]=n,e[3]=N):N=e[3];let g=N,l;e[4]!==i?(l=i!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:i},void 0,!1),e[4]=i,e[5]=l):l=e[5];let c;e[6]!==r?(c=r("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per container \u2014 ports and health checks aren't carried in that stream."),e[6]=r,e[7]=c):c=e[7];let d;e[8]!==c?(d=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:c},void 0,!1),e[8]=c,e[9]=d):d=e[9];let m;e[10]!==x?(m=(0,t.jsxDEV)(R,{message:x,prefix:"containers"},void 0,!1),e[10]=x,e[11]=m):m=e[11];let f;e[12]!==d||e[13]!==m?(f=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[d,m]},void 0,!0),e[12]=d,e[13]=m,e[14]=f):f=e[14];let p;e[15]!==o||e[16]!==g||e[17]!==r?(p=o&&g.length===0?(0,t.jsxDEV)(S,{description:r("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:r("No container activity")},void 0,!1):(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(I,{className:"px-0",children:(0,t.jsxDEV)(w,{"data-testid":"containers-table",children:[(0,t.jsxDEV)(O,{children:(0,t.jsxDEV)(C,{children:[(0,t.jsxDEV)(v,{children:r("Container")},void 0,!1),(0,t.jsxDEV)(v,{children:r("State")},void 0,!1),(0,t.jsxDEV)(v,{children:r("Last event")},void 0,!1),(0,t.jsxDEV)(v,{children:r("Detail")},void 0,!1),(0,t.jsxDEV)(v,{children:r("When")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(D,{children:g.map(G)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[15]=o,e[16]=g,e[17]=r,e[18]=p):p=e[18];let y;return e[19]!==l||e[20]!==f||e[21]!==p?(y=(0,t.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[l,f,p]},void 0,!0),e[19]=l,e[20]=f,e[21]=p,e[22]=y):y=e[22],y},"ContainersPanel");function G(e){return(0,t.jsxDEV)(C,{"data-testid":`containers-row-${e.name}`,children:[(0,t.jsxDEV)(h,{className:"font-mono text-xs",children:e.name},void 0,!1),(0,t.jsxDEV)(h,{children:(0,t.jsxDEV)(E,{variant:$[e.state],children:e.state},void 0,!1)},void 0,!1),(0,t.jsxDEV)(h,{className:"font-mono text-xs text-muted-foreground",children:e.event},void 0,!1),(0,t.jsxDEV)(h,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"},void 0,!1),(0,t.jsxDEV)(h,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()},void 0,!1)]},e.name,!0)}u(G,"_temp");export{ee as ContainersPanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as q}from"./chunk-YAECF5LW.js";import"./chunk-DWDILV2E.js";import{a as T}from"./chunk-QAFAJBAW.js";import{a as H}from"./chunk-J6J54MBP.js";import"./chunk-5OIBXYZM.js";import{a as D}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-YAECF5LW.js";import"./chunk-DWDILV2E.js";import{a as T}from"./chunk-QAFAJBAW.js";import{a as H}from"./chunk-J6J54MBP.js";import"./chunk-5OIBXYZM.js";import{a as D}from"./chunk-JEVKZIHN.js";import"./chunk-XNJNSCLM.js";import{R as F}from"./chunk-3CJW6NWG.js";import{c}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as p}from"./chunk-BOXSWNXZ.js";import{a as O}from"./chunk-TAD43CG5.js";import{b as B}from"./chunk-EOSXQTSQ.js";import{b as P}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as j}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as $,e as g,f as N,g as w,k as y,m as R,o as C}from"./chunk-2GMEK2W3.js";import"./chunk-J75M4LTW.js";import{a as o,e as M,f as oe,h as se,j as z}from"./chunk-RRCPZMC2.js";var d=M(oe(),1);var e=M(se(),1);function de({className:r,orientation:m="horizontal",...a}){return(0,e.jsxDEV)(T,{"data-slot":"separator",orientation:m,className:z("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",r),...a},void 0,!1)}o(de,"Separator");var le=g(p.clearCapturedMail),ne=g(p.sendTestMail),ce=/https?:\/\/[^\s"'<>)]+/i,_=o(r=>r===void 0?void 0:ce.exec(r)?.[0],"firstLink"),me=o(r=>{if(r!==void 0)return _(r.html)??_(r.text)},"selectedLink"),ue=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,fe=o(r=>`${ue}${r}`,"withPreviewCsp"),v=o(r=>r===void 0?"":Array.isArray(r)?r.join(", "):r,"recipientText"),Ie=o(({limit:r=100})=>{let m=j(),a=$(),{data:S,error:k,errorSource:U,isLoading:V,refetch:x}=B(p.getCapturedMail,{limit:r}),[E,h]=(0,d.useState)(null),[A,L]=(0,d.useState)(null),[u,W]=(0,d.useState)("html"),[b,K]=(0,d.useState)(""),l=(0,d.useMemo)(()=>S?.entries??[],[S]),I=k??E,Q=k===null?E:U,G=o(async()=>{h(null);try{await m.query(le,{},N("")),L(null),x()}catch(t){h(w(t))}},"clearInbox"),J=o(async()=>{h(null);try{await m.query(ne,{},N("")),x()}catch(t){h(w(t))}},"sendTest");H(()=>{x()},!0);let X=o(()=>{y(G())},"onClear"),Y=o(()=>{y(J())},"onSendTest"),Z=o(t=>{K(t.currentTarget.value)},"onFilterChange"),ee=o(t=>{let{id:s}=t.currentTarget.dataset;s!==void 0&&L(s)},"onSelectMessage"),te=o(t=>{let s=t.currentTarget.dataset.tab;(s==="headers"||s==="html"||s==="text")&&W(s)},"onSelectTab"),ae=o(t=>a(t==="html"?"HTML":t==="text"?"Plain text":"Headers"),"tabTitle"),f=(0,d.useMemo)(()=>{let t=b.trim().toLowerCase();return t===""?l:l.filter(s=>`${s.subject} ${v(s.to)}`.toLowerCase().includes(t))},[l,b]),i=(0,d.useMemo)(()=>{if(f.length!==0)return f.find(t=>t.id===A)??f[0]},[f,A]),n=me(i),re=o(()=>{n!==void 0&&R(n)},"onCopyLink"),ie=o(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"onOpenLink");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(c,{"data-testid":"mail-send-test",onClick:Y,size:"sm",type:"button",variant:"outline",children:a("Send test")},void 0,!1),(0,e.jsxDEV)(c,{"data-testid":"mail-clear",disabled:l.length===0,onClick:X,size:"sm",type:"button",variant:"outline",children:a("Clear inbox")},void 0,!1),l.length>0&&(0,e.jsxDEV)(P,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:a("{count} messages",{count:l.length})},void 0,!1)]},void 0,!0),I!==null&&(0,e.jsxDEV)(D,{error:Q,testId:"mail-error"},void 0,!1),I===null&&!V&&l.length===0&&(0,e.jsxDEV)(O,{description:a("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,e.jsxDEV)("path",{d:"M4 5h16v14H4z"},void 0,!1),(0,e.jsxDEV)("path",{d:"m4 6 8 6 8-6"},void 0,!1)]},void 0,!0),testId:"mail-empty",title:a("No captured email.")},void 0,!1),l.length>0&&(0,e.jsxDEV)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxDEV)(F,{"aria-label":a("Search messages"),"data-testid":"mail-search",onChange:Z,placeholder:a("Filter messages"),type:"search",value:b},void 0,!1),(0,e.jsxDEV)(q,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,e.jsxDEV)("ul",{className:"divide-y",children:f.map(t=>{let s=t.id===i?.id;return(0,e.jsxDEV)("li",{children:(0,e.jsxDEV)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${s?"bg-muted":""}`,"data-active":s,"data-id":t.id,"data-testid":"mail-list-item",onClick:ee,type:"button",children:[(0,e.jsxDEV)("span",{className:"w-full truncate font-medium",children:t.subject||a("(no subject)")},void 0,!1),(0,e.jsxDEV)("span",{className:"w-full truncate text-xs text-muted-foreground",children:v(t.to)},void 0,!1),(0,e.jsxDEV)("span",{className:"text-xs text-muted-foreground tabular-nums",children:C(t.capturedAt,"\u2014")},void 0,!1)]},void 0,!0)},t.id,!1)})},void 0,!1)},void 0,!1)]},void 0,!0),i!==void 0&&(0,e.jsxDEV)("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,e.jsxDEV)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxDEV)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||a("(no subject)")},void 0,!1),(0,e.jsxDEV)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,e.jsxDEV)("dt",{children:a("From")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:i.from??"\u2014"},void 0,!1),(0,e.jsxDEV)("dt",{children:a("To")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:v(i.to)},void 0,!1),i.cc!==void 0&&i.cc.length>0&&(0,e.jsxDEV)(e.Fragment,{children:[(0,e.jsxDEV)("dt",{children:a("Cc")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:v(i.cc)},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("dt",{children:a("Sent")},void 0,!1),(0,e.jsxDEV)("dd",{className:"tabular-nums",children:C(i.capturedAt,"\u2014")},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,e.jsxDEV)(c,{"data-testid":"mail-copy-link",disabled:n===void 0,onClick:re,size:"sm",type:"button",variant:"outline",children:a("Copy link")},void 0,!1),(0,e.jsxDEV)(c,{"data-testid":"mail-open-link",disabled:n===void 0,onClick:ie,size:"sm",type:"button",variant:"outline",children:a("Open in new tab")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(de,{},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(t=>(0,e.jsxDEV)(c,{"aria-selected":u===t,"data-tab":t,"data-testid":`mail-tab-${t}`,onClick:te,role:"tab",size:"sm",type:"button",variant:u===t?"secondary":"ghost",children:ae(t)},t,!1))},void 0,!1),(0,e.jsxDEV)("div",{className:"min-h-[12rem]",children:[u==="html"&&(i.html===void 0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No HTML body.")},void 0,!1):(0,e.jsxDEV)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:fe(i.html),title:a("Email preview")},void 0,!1)),u==="text"&&(i.text===void 0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No text body.")},void 0,!1):(0,e.jsxDEV)("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},void 0,!1)),u==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No headers.")},void 0,!1):(0,e.jsxDEV)("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(([t,s])=>`${t}: ${s}`).join(`
|
|
2
2
|
`)},void 0,!1))]},void 0,!0)]},void 0,!0)]},void 0,!0)]},void 0,!0)},"MailPanel");export{Ie as MailPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as hS,b as rp,c as SS,d as dp,e as bS,f as ES,k as TS}from"./chunk-W3SHEIAL.js";import"./chunk-ZPUO7FNI.js";import"./chunk-IXDH4GL5.js";import"./chunk-KSKXW5PX.js";import"./chunk-5OIBXYZM.js";import"./chunk-L7SK4ZZD.js";import"./chunk-ZIGWVHCS.js";import"./chunk-7TJJXVSE.js";import"./chunk-WI7GWFEG.js";import{a as vS}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import"./chunk-KZ6INM5M.js";import"./chunk-4QHKBC77.js";import{R as mS}from"./chunk-3CJW6NWG.js";import{c as yS}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{a as ET}from"./chunk-HV7G6DFP.js";import"./chunk-BOXSWNXZ.js";import"./chunk-TAD43CG5.js";import"./chunk-RHZ4M2NZ.js";import"./chunk-SEU5V7I6.js";import"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as fS,e as dS}from"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as pS,d as fp,l as gS}from"./chunk-E75ANNWX.js";import{b as cS}from"./chunk-JHKMUTIF.js";import{a as o,c as gf,e as Wi,f as sS,g as TT,h as rS,j as sp}from"./chunk-RRCPZMC2.js";var AS=gf(Ye=>{"use strict";(function(){function Me(){if(ot=!1,K){var z=Ye.unstable_now();Ae=z;var j=!0;try{e:{he=!1,Ue&&(Ue=!1,pt(Ke),Ke=-1),oe=!0;var q=V;try{t:{for(se(z),I=J(L);I!==null&&!(I.expirationTime>z&&A());){var xe=I.callback;if(typeof xe=="function"){I.callback=null,V=I.priorityLevel;var Ge=xe(I.expirationTime<=z);if(z=Ye.unstable_now(),typeof Ge=="function"){I.callback=Ge,se(z),j=!0;break t}I===J(L)&&G(L),se(z)}else G(L);I=J(L)}if(I!==null)j=!0;else{var ba=J(de);ba!==null&&ce(ae,ba.startTime-z),j=!1}}break e}finally{I=null,V=q,oe=!1}j=void 0}}finally{j?_e():K=!1}}}o(Me,"performWorkUntilDeadline");function r(z,j){var q=z.length;z.push(j);e:for(;0<q;){var xe=q-1>>>1,Ge=z[xe];if(0<ee(Ge,j))z[xe]=j,z[q]=Ge,q=xe;else break e}}o(r,"push");function J(z){return z.length===0?null:z[0]}o(J,"peek");function G(z){if(z.length===0)return null;var j=z[0],q=z.pop();if(q!==j){z[0]=q;e:for(var xe=0,Ge=z.length,ba=Ge>>>1;xe<ba;){var iu=2*(xe+1)-1,yo=z[iu],Sn=iu+1,it=z[Sn];if(0>ee(yo,q))Sn<Ge&&0>ee(it,yo)?(z[xe]=it,z[Sn]=q,xe=Sn):(z[xe]=yo,z[iu]=q,xe=iu);else if(Sn<Ge&&0>ee(it,q))z[xe]=it,z[Sn]=q,xe=Sn;else break e}}return j}o(G,"pop");function ee(z,j){var q=z.sortIndex-j.sortIndex;return q!==0?q:z.id-j.id}o(ee,"compare");function se(z){for(var j=J(de);j!==null;){if(j.callback===null)G(de);else if(j.startTime<=z)G(de),j.sortIndex=j.expirationTime,r(L,j);else break;j=J(de)}}o(se,"advanceTimers");function ae(z){if(Ue=!1,se(z),!he)if(J(L)!==null)he=!0,K||(K=!0,_e());else{var j=J(de);j!==null&&ce(ae,j.startTime-z)}}o(ae,"handleTimeout");function A(){return ot?!0:!(Ye.unstable_now()-Ae<U)}o(A,"shouldYieldToHost");function ce(z,j){Ke=Gt(function(){z(Ye.unstable_now())},j)}if(o(ce,"requestHostTimeout"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),Ye.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var Be=performance;Ye.unstable_now=function(){return Be.now()}}else{var Ze=Date,ue=Ze.now();Ye.unstable_now=function(){return Ze.now()-ue}}var L=[],de=[],Te=1,I=null,V=3,oe=!1,he=!1,Ue=!1,ot=!1,Gt=typeof setTimeout=="function"?setTimeout:null,pt=typeof clearTimeout=="function"?clearTimeout:null,bt=typeof setImmediate<"u"?setImmediate:null,K=!1,Ke=-1,U=5,Ae=-1;if(typeof bt=="function")var _e=o(function(){bt(Me)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ul=pe.port2;pe.port1.onmessage=Me,_e=o(function(){ul.postMessage(null)},"schedulePerformWorkUntilDeadline")}else _e=o(function(){Gt(Me,0)},"schedulePerformWorkUntilDeadline");Ye.unstable_IdlePriority=5,Ye.unstable_ImmediatePriority=1,Ye.unstable_LowPriority=4,Ye.unstable_NormalPriority=3,Ye.unstable_Profiling=null,Ye.unstable_UserBlockingPriority=2,Ye.unstable_cancelCallback=function(z){z.callback=null},Ye.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<z?Math.floor(1e3/z):5},Ye.unstable_getCurrentPriorityLevel=function(){return V},Ye.unstable_next=function(z){switch(V){case 1:case 2:case 3:var j=3;break;default:j=V}var q=V;V=j;try{return z()}finally{V=q}},Ye.unstable_requestPaint=function(){ot=!0},Ye.unstable_runWithPriority=function(z,j){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=V;V=z;try{return j()}finally{V=q}},Ye.unstable_scheduleCallback=function(z,j,q){var xe=Ye.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?xe+q:xe):q=xe,z){case 1:var Ge=-1;break;case 2:Ge=250;break;case 5:Ge=1073741823;break;case 4:Ge=1e4;break;default:Ge=5e3}return Ge=q+Ge,z={id:Te++,callback:j,priorityLevel:z,startTime:q,expirationTime:Ge,sortIndex:-1},q>xe?(z.sortIndex=q,r(de,z),J(L)===null&&z===J(de)&&(Ue?(pt(Ke),Ke=-1):Ue=!0,ce(ae,q-xe))):(z.sortIndex=Ge,r(L,z),he||oe||(he=!0,K||(K=!0,_e()))),z},Ye.unstable_shouldYield=A,Ye.unstable_wrapCallback=function(z){var j=V;return function(){var q=V;V=j;try{return z.apply(this,arguments)}finally{V=q}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var RS=gf((_T,DS)=>{"use strict";DS.exports=AS()});var OS=gf(vf=>{"use strict";(function(){function Me(e,t){for(e=e.memoizedState;e!==null&&0<t;)e=e.next,t--;return e}o(Me,"findHook");function r(e,t,n,l){if(n>=t.length)return l;var a=t[n],u=lt(e)?e.slice():F({},e);return u[a]=r(e[a],t,n+1,l),u}o(r,"copyWithSetImpl");function J(e,t,n){if(t.length!==n.length)console.warn("copyWithRename() expects paths of the same length");else{for(var l=0;l<n.length-1;l++)if(t[l]!==n[l]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return G(e,t,n,0)}}o(J,"copyWithRename");function G(e,t,n,l){var a=t[l],u=lt(e)?e.slice():F({},e);return l+1===t.length?(u[n[l]]=u[a],lt(u)?u.splice(a,1):delete u[a]):u[a]=G(e[a],t,n,l+1),u}o(G,"copyWithRenameImpl");function ee(e,t,n){var l=t[n],a=lt(e)?e.slice():F({},e);return n+1===t.length?(lt(a)?a.splice(l,1):delete a[l],a):(a[l]=ee(e[l],t,n+1),a)}o(ee,"copyWithDeleteImpl");function se(){return!1}o(se,"shouldSuspendImpl");function ae(){return null}o(ae,"shouldErrorImpl");function A(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}o(A,"warnInvalidHookAccess");function ce(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}o(ce,"warnInvalidContextAccess");function Be(){}o(Be,"noop");function Ze(){}o(Ze,"warnForMissingKey");function ue(e){var t=[];return e.forEach(function(n){t.push(n)}),t.sort().join(", ")}o(ue,"setToSortedString");function L(e,t,n,l){return new sb(e,t,n,l)}o(L,"createFiber");function de(e,t){e.context===Pl&&(Cd(e.current,2,t,e,null,null),Du())}o(de,"scheduleRoot");function Te(e,t){if(sn!==null){var n=t.staleFamilies;t=t.updatedFamilies,Jo(),pm(e.current,t,n),Du()}}o(Te,"scheduleRefresh");function I(e){sn=e}o(I,"setRefreshHandler");function V(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}o(V,"isValidContainer");function oe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}o(oe,"getNearestMountedFiber");function he(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(he,"getSuspenseInstanceFromFiber");function Ue(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(Ue,"getActivityInstanceFromFiber");function ot(e){if(oe(e)!==e)throw Error("Unable to find node on an unmounted component.")}o(ot,"assertIsMounted");function Gt(e){var t=e.alternate;if(!t){if(t=oe(e),t===null)throw Error("Unable to find node on an unmounted component.");return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return ot(a),e;if(u===l)return ot(a),t;u=u.sibling}throw Error("Unable to find node on an unmounted component.")}if(n.return!==l.return)n=a,l=u;else{for(var i=!1,c=a.child;c;){if(c===n){i=!0,n=a,l=u;break}if(c===l){i=!0,l=a,n=u;break}c=c.sibling}if(!i){for(c=u.child;c;){if(c===n){i=!0,n=u,l=a;break}if(c===l){i=!0,l=u,n=a;break}c=c.sibling}if(!i)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(n.alternate!==l)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(n.tag!==3)throw Error("Unable to find node on an unmounted component.");return n.stateNode.current===n?e:t}o(Gt,"findCurrentFiberUsingSlowPath");function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=pt(e),t!==null)return t;e=e.sibling}return null}o(pt,"findCurrentHostFiberImpl");function bt(e){return e===null||typeof e!="object"?null:(e=Eg&&e[Eg]||e["@@iterator"],typeof e=="function"?e:null)}o(bt,"getIteratorFn");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_2?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _u:return"Fragment";case Bd:return"Profiler";case fs:return"StrictMode";case qd:return"Suspense";case jd:return"SuspenseList";case Yd:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Uu:return"Portal";case Kn:return e.displayName||"Context";case Nd:return(e._context.displayName||"Context")+".Consumer";case ni:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rs:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case kt:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}o(K,"getComponentNameFromType");function Ke(e){return typeof e.tag=="number"?U(e):typeof e.name=="string"?e.name:null}o(Ke,"getComponentNameFromOwner");function U(e){var t=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(t._context.displayName||"Context")+".Consumer";case 10:return t.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(t);case 8:return t===fs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;break;case 29:if(t=e._debugInfo,t!=null){for(var n=t.length-1;0<=n;n--)if(typeof t[n].name=="string")return t[n].name}if(e.return!==null)return U(e.return)}return null}o(U,"getComponentNameFromFiber");function Ae(e){return{current:e}}o(Ae,"createCursor");function _e(e,t){0>ml?console.error("Unexpected pop."):(t!==Ld[ml]&&console.error("Unexpected Fiber popped."),e.current=Gd[ml],Gd[ml]=null,Ld[ml]=null,ml--)}o(_e,"pop");function pe(e,t,n){ml++,Gd[ml]=e.current,Ld[ml]=n,e.current=t}o(pe,"push");function ul(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}o(ul,"requiredContext");function z(e,t){pe($l,t,e),pe(li,e,e),pe(Jl,null,e);var n=t.nodeType;switch(n){case 9:case 11:n=n===9?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?Zy(t):Ml;break;default:if(n=t.tagName,t=t.namespaceURI)t=Zy(t),t=Jy(t,n);else switch(n){case"svg":t=ro;break;case"math":t=ff;break;default:t=Ml}}n=n.toLowerCase(),n=Yp(null,n),n={context:t,ancestorInfo:n},_e(Jl,e),pe(Jl,n,e)}o(z,"pushHostContainer");function j(e){_e(Jl,e),_e(li,e),_e($l,e)}o(j,"popHostContainer");function q(){return ul(Jl.current)}o(q,"getHostContext");function xe(e){e.memoizedState!==null&&pe(ds,e,e);var t=ul(Jl.current),n=e.type,l=Jy(t.context,n);n=Yp(t.ancestorInfo,n),l={context:l,ancestorInfo:n},t!==l&&(pe(li,e,e),pe(Jl,l,e))}o(xe,"pushHostContext");function Ge(e){li.current===e&&(_e(Jl,e),_e(li,e)),ds.current===e&&(_e(ds,e),Ki._currentValue=ou)}o(Ge,"popHostContext");function ba(){}o(ba,"disabledLog");function iu(){if(ai===0){Tg=console.log,Ag=console.info,Dg=console.warn,Rg=console.error,Og=console.group,zg=console.groupCollapsed,Cg=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ba,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ai++}o(iu,"disableLogs");function yo(){if(ai--,ai===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:Tg}),info:F({},e,{value:Ag}),warn:F({},e,{value:Dg}),error:F({},e,{value:Rg}),group:F({},e,{value:Og}),groupCollapsed:F({},e,{value:zg}),groupEnd:F({},e,{value:Cg})})}0>ai&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}o(yo,"reenableLogs");function Sn(e){var t=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith(`Error: react-stack-top-frame
|
|
1
|
+
import{a as hS,b as rp,c as SS,d as dp,e as bS,f as ES,k as TS}from"./chunk-245TEXSO.js";import"./chunk-ZPUO7FNI.js";import"./chunk-IXDH4GL5.js";import"./chunk-KSKXW5PX.js";import"./chunk-5OIBXYZM.js";import"./chunk-L7SK4ZZD.js";import"./chunk-ZIGWVHCS.js";import"./chunk-7TJJXVSE.js";import"./chunk-WI7GWFEG.js";import{a as vS}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import"./chunk-KZ6INM5M.js";import"./chunk-4QHKBC77.js";import{R as mS}from"./chunk-3CJW6NWG.js";import{c as yS}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{a as ET}from"./chunk-HV7G6DFP.js";import"./chunk-BOXSWNXZ.js";import"./chunk-TAD43CG5.js";import"./chunk-EOSXQTSQ.js";import"./chunk-SEU5V7I6.js";import"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as fS,e as dS}from"./chunk-M5OMEMQ3.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as pS,d as fp,l as gS}from"./chunk-2GMEK2W3.js";import{b as cS}from"./chunk-J75M4LTW.js";import{a as o,c as gf,e as Wi,f as sS,g as TT,h as rS,j as sp}from"./chunk-RRCPZMC2.js";var AS=gf(Ye=>{"use strict";(function(){function Me(){if(ot=!1,K){var z=Ye.unstable_now();Ae=z;var j=!0;try{e:{he=!1,Ue&&(Ue=!1,pt(Ke),Ke=-1),oe=!0;var q=V;try{t:{for(se(z),I=J(L);I!==null&&!(I.expirationTime>z&&A());){var xe=I.callback;if(typeof xe=="function"){I.callback=null,V=I.priorityLevel;var Ge=xe(I.expirationTime<=z);if(z=Ye.unstable_now(),typeof Ge=="function"){I.callback=Ge,se(z),j=!0;break t}I===J(L)&&G(L),se(z)}else G(L);I=J(L)}if(I!==null)j=!0;else{var ba=J(de);ba!==null&&ce(ae,ba.startTime-z),j=!1}}break e}finally{I=null,V=q,oe=!1}j=void 0}}finally{j?_e():K=!1}}}o(Me,"performWorkUntilDeadline");function r(z,j){var q=z.length;z.push(j);e:for(;0<q;){var xe=q-1>>>1,Ge=z[xe];if(0<ee(Ge,j))z[xe]=j,z[q]=Ge,q=xe;else break e}}o(r,"push");function J(z){return z.length===0?null:z[0]}o(J,"peek");function G(z){if(z.length===0)return null;var j=z[0],q=z.pop();if(q!==j){z[0]=q;e:for(var xe=0,Ge=z.length,ba=Ge>>>1;xe<ba;){var iu=2*(xe+1)-1,yo=z[iu],Sn=iu+1,it=z[Sn];if(0>ee(yo,q))Sn<Ge&&0>ee(it,yo)?(z[xe]=it,z[Sn]=q,xe=Sn):(z[xe]=yo,z[iu]=q,xe=iu);else if(Sn<Ge&&0>ee(it,q))z[xe]=it,z[Sn]=q,xe=Sn;else break e}}return j}o(G,"pop");function ee(z,j){var q=z.sortIndex-j.sortIndex;return q!==0?q:z.id-j.id}o(ee,"compare");function se(z){for(var j=J(de);j!==null;){if(j.callback===null)G(de);else if(j.startTime<=z)G(de),j.sortIndex=j.expirationTime,r(L,j);else break;j=J(de)}}o(se,"advanceTimers");function ae(z){if(Ue=!1,se(z),!he)if(J(L)!==null)he=!0,K||(K=!0,_e());else{var j=J(de);j!==null&&ce(ae,j.startTime-z)}}o(ae,"handleTimeout");function A(){return ot?!0:!(Ye.unstable_now()-Ae<U)}o(A,"shouldYieldToHost");function ce(z,j){Ke=Gt(function(){z(Ye.unstable_now())},j)}if(o(ce,"requestHostTimeout"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),Ye.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var Be=performance;Ye.unstable_now=function(){return Be.now()}}else{var Ze=Date,ue=Ze.now();Ye.unstable_now=function(){return Ze.now()-ue}}var L=[],de=[],Te=1,I=null,V=3,oe=!1,he=!1,Ue=!1,ot=!1,Gt=typeof setTimeout=="function"?setTimeout:null,pt=typeof clearTimeout=="function"?clearTimeout:null,bt=typeof setImmediate<"u"?setImmediate:null,K=!1,Ke=-1,U=5,Ae=-1;if(typeof bt=="function")var _e=o(function(){bt(Me)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ul=pe.port2;pe.port1.onmessage=Me,_e=o(function(){ul.postMessage(null)},"schedulePerformWorkUntilDeadline")}else _e=o(function(){Gt(Me,0)},"schedulePerformWorkUntilDeadline");Ye.unstable_IdlePriority=5,Ye.unstable_ImmediatePriority=1,Ye.unstable_LowPriority=4,Ye.unstable_NormalPriority=3,Ye.unstable_Profiling=null,Ye.unstable_UserBlockingPriority=2,Ye.unstable_cancelCallback=function(z){z.callback=null},Ye.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<z?Math.floor(1e3/z):5},Ye.unstable_getCurrentPriorityLevel=function(){return V},Ye.unstable_next=function(z){switch(V){case 1:case 2:case 3:var j=3;break;default:j=V}var q=V;V=j;try{return z()}finally{V=q}},Ye.unstable_requestPaint=function(){ot=!0},Ye.unstable_runWithPriority=function(z,j){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=V;V=z;try{return j()}finally{V=q}},Ye.unstable_scheduleCallback=function(z,j,q){var xe=Ye.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?xe+q:xe):q=xe,z){case 1:var Ge=-1;break;case 2:Ge=250;break;case 5:Ge=1073741823;break;case 4:Ge=1e4;break;default:Ge=5e3}return Ge=q+Ge,z={id:Te++,callback:j,priorityLevel:z,startTime:q,expirationTime:Ge,sortIndex:-1},q>xe?(z.sortIndex=q,r(de,z),J(L)===null&&z===J(de)&&(Ue?(pt(Ke),Ke=-1):Ue=!0,ce(ae,q-xe))):(z.sortIndex=Ge,r(L,z),he||oe||(he=!0,K||(K=!0,_e()))),z},Ye.unstable_shouldYield=A,Ye.unstable_wrapCallback=function(z){var j=V;return function(){var q=V;V=j;try{return z.apply(this,arguments)}finally{V=q}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var RS=gf((_T,DS)=>{"use strict";DS.exports=AS()});var OS=gf(vf=>{"use strict";(function(){function Me(e,t){for(e=e.memoizedState;e!==null&&0<t;)e=e.next,t--;return e}o(Me,"findHook");function r(e,t,n,l){if(n>=t.length)return l;var a=t[n],u=lt(e)?e.slice():F({},e);return u[a]=r(e[a],t,n+1,l),u}o(r,"copyWithSetImpl");function J(e,t,n){if(t.length!==n.length)console.warn("copyWithRename() expects paths of the same length");else{for(var l=0;l<n.length-1;l++)if(t[l]!==n[l]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return G(e,t,n,0)}}o(J,"copyWithRename");function G(e,t,n,l){var a=t[l],u=lt(e)?e.slice():F({},e);return l+1===t.length?(u[n[l]]=u[a],lt(u)?u.splice(a,1):delete u[a]):u[a]=G(e[a],t,n,l+1),u}o(G,"copyWithRenameImpl");function ee(e,t,n){var l=t[n],a=lt(e)?e.slice():F({},e);return n+1===t.length?(lt(a)?a.splice(l,1):delete a[l],a):(a[l]=ee(e[l],t,n+1),a)}o(ee,"copyWithDeleteImpl");function se(){return!1}o(se,"shouldSuspendImpl");function ae(){return null}o(ae,"shouldErrorImpl");function A(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}o(A,"warnInvalidHookAccess");function ce(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}o(ce,"warnInvalidContextAccess");function Be(){}o(Be,"noop");function Ze(){}o(Ze,"warnForMissingKey");function ue(e){var t=[];return e.forEach(function(n){t.push(n)}),t.sort().join(", ")}o(ue,"setToSortedString");function L(e,t,n,l){return new sb(e,t,n,l)}o(L,"createFiber");function de(e,t){e.context===Pl&&(Cd(e.current,2,t,e,null,null),Du())}o(de,"scheduleRoot");function Te(e,t){if(sn!==null){var n=t.staleFamilies;t=t.updatedFamilies,Jo(),pm(e.current,t,n),Du()}}o(Te,"scheduleRefresh");function I(e){sn=e}o(I,"setRefreshHandler");function V(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}o(V,"isValidContainer");function oe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}o(oe,"getNearestMountedFiber");function he(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(he,"getSuspenseInstanceFromFiber");function Ue(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(Ue,"getActivityInstanceFromFiber");function ot(e){if(oe(e)!==e)throw Error("Unable to find node on an unmounted component.")}o(ot,"assertIsMounted");function Gt(e){var t=e.alternate;if(!t){if(t=oe(e),t===null)throw Error("Unable to find node on an unmounted component.");return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return ot(a),e;if(u===l)return ot(a),t;u=u.sibling}throw Error("Unable to find node on an unmounted component.")}if(n.return!==l.return)n=a,l=u;else{for(var i=!1,c=a.child;c;){if(c===n){i=!0,n=a,l=u;break}if(c===l){i=!0,l=a,n=u;break}c=c.sibling}if(!i){for(c=u.child;c;){if(c===n){i=!0,n=u,l=a;break}if(c===l){i=!0,l=u,n=a;break}c=c.sibling}if(!i)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(n.alternate!==l)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(n.tag!==3)throw Error("Unable to find node on an unmounted component.");return n.stateNode.current===n?e:t}o(Gt,"findCurrentFiberUsingSlowPath");function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=pt(e),t!==null)return t;e=e.sibling}return null}o(pt,"findCurrentHostFiberImpl");function bt(e){return e===null||typeof e!="object"?null:(e=Eg&&e[Eg]||e["@@iterator"],typeof e=="function"?e:null)}o(bt,"getIteratorFn");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_2?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _u:return"Fragment";case Bd:return"Profiler";case fs:return"StrictMode";case qd:return"Suspense";case jd:return"SuspenseList";case Yd:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Uu:return"Portal";case Kn:return e.displayName||"Context";case Nd:return(e._context.displayName||"Context")+".Consumer";case ni:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rs:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case kt:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}o(K,"getComponentNameFromType");function Ke(e){return typeof e.tag=="number"?U(e):typeof e.name=="string"?e.name:null}o(Ke,"getComponentNameFromOwner");function U(e){var t=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(t._context.displayName||"Context")+".Consumer";case 10:return t.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(t);case 8:return t===fs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;break;case 29:if(t=e._debugInfo,t!=null){for(var n=t.length-1;0<=n;n--)if(typeof t[n].name=="string")return t[n].name}if(e.return!==null)return U(e.return)}return null}o(U,"getComponentNameFromFiber");function Ae(e){return{current:e}}o(Ae,"createCursor");function _e(e,t){0>ml?console.error("Unexpected pop."):(t!==Ld[ml]&&console.error("Unexpected Fiber popped."),e.current=Gd[ml],Gd[ml]=null,Ld[ml]=null,ml--)}o(_e,"pop");function pe(e,t,n){ml++,Gd[ml]=e.current,Ld[ml]=n,e.current=t}o(pe,"push");function ul(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}o(ul,"requiredContext");function z(e,t){pe($l,t,e),pe(li,e,e),pe(Jl,null,e);var n=t.nodeType;switch(n){case 9:case 11:n=n===9?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?Zy(t):Ml;break;default:if(n=t.tagName,t=t.namespaceURI)t=Zy(t),t=Jy(t,n);else switch(n){case"svg":t=ro;break;case"math":t=ff;break;default:t=Ml}}n=n.toLowerCase(),n=Yp(null,n),n={context:t,ancestorInfo:n},_e(Jl,e),pe(Jl,n,e)}o(z,"pushHostContainer");function j(e){_e(Jl,e),_e(li,e),_e($l,e)}o(j,"popHostContainer");function q(){return ul(Jl.current)}o(q,"getHostContext");function xe(e){e.memoizedState!==null&&pe(ds,e,e);var t=ul(Jl.current),n=e.type,l=Jy(t.context,n);n=Yp(t.ancestorInfo,n),l={context:l,ancestorInfo:n},t!==l&&(pe(li,e,e),pe(Jl,l,e))}o(xe,"pushHostContext");function Ge(e){li.current===e&&(_e(Jl,e),_e(li,e)),ds.current===e&&(_e(ds,e),Ki._currentValue=ou)}o(Ge,"popHostContext");function ba(){}o(ba,"disabledLog");function iu(){if(ai===0){Tg=console.log,Ag=console.info,Dg=console.warn,Rg=console.error,Og=console.group,zg=console.groupCollapsed,Cg=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ba,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ai++}o(iu,"disableLogs");function yo(){if(ai--,ai===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:Tg}),info:F({},e,{value:Ag}),warn:F({},e,{value:Dg}),error:F({},e,{value:Rg}),group:F({},e,{value:Og}),groupCollapsed:F({},e,{value:zg}),groupEnd:F({},e,{value:Cg})})}0>ai&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}o(yo,"reenableLogs");function Sn(e){var t=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith(`Error: react-stack-top-frame
|
|
2
2
|
`)&&(e=e.slice(29)),t=e.indexOf(`
|
|
3
3
|
`),t!==-1&&(e=e.slice(t+1)),t=e.indexOf("react_stack_bottom_frame"),t!==-1&&(t=e.lastIndexOf(`
|
|
4
4
|
`,t)),t!==-1)e=e.slice(0,t);else return"";return e}o(Sn,"formatOwnerStack");function it(e){if(Vd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vd=t&&t[1]||"",Mg=-1<n.stack.indexOf(`
|