@lunora/studio 1.0.0-alpha.183 → 1.0.0-alpha.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/standalone/{chunk-QWJQUQY3.js → chunk-2254YC77.js} +1 -1
  2. package/dist/standalone/{chunk-I6FR5UAK.js → chunk-22EHJEFE.js} +1 -1
  3. package/dist/standalone/{chunk-3TXB4AKZ.js → chunk-2PYJCU6C.js} +1 -1
  4. package/dist/standalone/{chunk-PGMASM2T.js → chunk-2TAFAGWH.js} +1 -1
  5. package/dist/standalone/{chunk-L2CWAQUO.js → chunk-2VGRBZVS.js} +1 -1
  6. package/dist/standalone/{chunk-5XRNQ732.js → chunk-3PUGTMHP.js} +1 -1
  7. package/dist/standalone/{chunk-SDHFSBNM.js → chunk-5G2MAI3G.js} +1 -1
  8. package/dist/standalone/{chunk-CBNGOAD4.js → chunk-6DGK6352.js} +1 -1
  9. package/dist/standalone/{chunk-VWXJAY7R.js → chunk-6MMHVZID.js} +1 -1
  10. package/dist/standalone/{chunk-RM4TNBYG.js → chunk-77UI3GTT.js} +1 -1
  11. package/dist/standalone/{chunk-FI6N7XWP.js → chunk-7F5LVCXA.js} +1 -1
  12. package/dist/standalone/{chunk-3PZNTIBM.js → chunk-AMPB3H6K.js} +1 -1
  13. package/dist/standalone/chunk-CEA2QYAI.js +15 -0
  14. package/dist/standalone/{chunk-AODYDAXY.js → chunk-EKMKNRYI.js} +1 -1
  15. package/dist/standalone/{chunk-TXHTSFLO.js → chunk-EMUTRNK5.js} +1 -1
  16. package/dist/standalone/{chunk-XKP3TSCE.js → chunk-FGEBPY6M.js} +1 -1
  17. package/dist/standalone/{chunk-D4ZGY3II.js → chunk-FHW7T5NC.js} +1 -1
  18. package/dist/standalone/{chunk-KIW73EIK.js → chunk-GLTOTU4J.js} +1 -1
  19. package/dist/standalone/{chunk-PZVVEPIN.js → chunk-GQQPTCCH.js} +1 -1
  20. package/dist/standalone/{chunk-GZ6GAFM2.js → chunk-GXSHHAYL.js} +1 -1
  21. package/dist/standalone/{chunk-WD4WHTAV.js → chunk-H7UQ7W6L.js} +1 -1
  22. package/dist/standalone/{chunk-BAAPQWFF.js → chunk-HB2AVFM7.js} +1 -1
  23. package/dist/standalone/{chunk-IXNOQYEE.js → chunk-HEIGV6KL.js} +1 -1
  24. package/dist/standalone/{chunk-4PRXEO3C.js → chunk-HQWKWSY4.js} +1 -1
  25. package/dist/standalone/{chunk-WRZTTZFV.js → chunk-IOPBEKDK.js} +1 -1
  26. package/dist/standalone/{chunk-DAD33Q2T.js → chunk-J6ESSV7B.js} +1 -1
  27. package/dist/standalone/{chunk-E2X625P3.js → chunk-JA7FUFCP.js} +1 -1
  28. package/dist/standalone/{chunk-GP2GJRJ3.js → chunk-K5ZNTNAC.js} +1 -1
  29. package/dist/standalone/{chunk-5MKG6RW3.js → chunk-L3AFRJE2.js} +1 -1
  30. package/dist/standalone/{chunk-EBU3TTYR.js → chunk-METTWXRR.js} +1 -1
  31. package/dist/standalone/{chunk-V7G6YTQ5.js → chunk-MH73AR4R.js} +1 -1
  32. package/dist/standalone/{chunk-QDHXQ56K.js → chunk-MRI7UILC.js} +1 -1
  33. package/dist/standalone/{chunk-DI34YDBW.js → chunk-MVJL6J4Y.js} +1 -1
  34. package/dist/standalone/{chunk-QQ3CS3FX.js → chunk-NGEP4H3Q.js} +1 -1
  35. package/dist/standalone/{chunk-INXSZE5I.js → chunk-NSYGYSMJ.js} +1 -1
  36. package/dist/standalone/{chunk-AX24JD2G.js → chunk-OGEHSNF7.js} +1 -1
  37. package/dist/standalone/{chunk-WIXX2VWE.js → chunk-OUKLYU72.js} +1 -1
  38. package/dist/standalone/{chunk-TTIBDOV6.js → chunk-P52AMBNB.js} +1 -1
  39. package/dist/standalone/{chunk-GAPFZFIL.js → chunk-PAWM6IP3.js} +1 -1
  40. package/dist/standalone/{chunk-Y2I6GYEG.js → chunk-PCQP4NHL.js} +1 -1
  41. package/dist/standalone/{chunk-NVKY4CIW.js → chunk-Q5R67CRQ.js} +1 -1
  42. package/dist/standalone/{chunk-URBHAYYZ.js → chunk-QAIEAIIE.js} +1 -1
  43. package/dist/standalone/{chunk-KX3YZ3TC.js → chunk-QMFQGVTQ.js} +1 -1
  44. package/dist/standalone/{chunk-JYT34NQM.js → chunk-QZJVCXWS.js} +1 -1
  45. package/dist/standalone/{chunk-J3LCGEBD.js → chunk-RBAMNKW7.js} +1 -1
  46. package/dist/standalone/{chunk-B3JY36UV.js → chunk-RJZI2ZRF.js} +1 -1
  47. package/dist/standalone/{chunk-5B6TTEP6.js → chunk-RY2LZULX.js} +1 -1
  48. package/dist/standalone/{chunk-H43JNQM6.js → chunk-SMMYONB7.js} +1 -1
  49. package/dist/standalone/{chunk-B6RRRJP5.js → chunk-SZSHO6RE.js} +1 -1
  50. package/dist/standalone/{chunk-A6S4TULR.js → chunk-TLFNAWL6.js} +1 -1
  51. package/dist/standalone/{chunk-MH2NGGUC.js → chunk-U5EMA2D7.js} +1 -1
  52. package/dist/standalone/{chunk-Z2XS4ZOO.js → chunk-UCYK6YWD.js} +1 -1
  53. package/dist/standalone/{chunk-ITMXIPQ7.js → chunk-UD47ZOIF.js} +1 -1
  54. package/dist/standalone/{chunk-IP7YCJUN.js → chunk-UREV5NIX.js} +1 -1
  55. package/dist/standalone/{chunk-AULH6SZB.js → chunk-VWLX4CH4.js} +2 -2
  56. package/dist/standalone/{chunk-5LZJ5JBB.js → chunk-XRR2R2H5.js} +1 -1
  57. package/dist/standalone/{chunk-TIIEZS24.js → chunk-XXB357HN.js} +1 -1
  58. package/dist/standalone/{chunk-GZAXFXZE.js → chunk-YAMJRRT2.js} +1 -1
  59. package/dist/standalone/{chunk-66Z7ZIZZ.js → chunk-Z4FYPU4Q.js} +1 -1
  60. package/dist/standalone/{chunk-HGT5U6GD.js → chunk-ZEZ5FW7V.js} +1 -1
  61. package/dist/standalone/{chunk-AFSPF2R4.js → chunk-ZVMUTCUE.js} +1 -1
  62. package/dist/standalone/studio.js +1 -1
  63. package/package.json +6 -6
  64. package/dist/standalone/chunk-2Y6PXGIS.js +0 -15
@@ -1,4 +1,4 @@
1
- import{d as Le}from"./chunk-M4POCI2J.js";import{c as _e}from"./chunk-UYEZR3BI.js";import"./chunk-RFNGDE33.js";import"./chunk-V3CZW3JB.js";import"./chunk-MU3P2FI7.js";import{a as ye}from"./chunk-3FBLWUXD.js";import"./chunk-XZMOZFE6.js";import{a as Ee}from"./chunk-66UGPQVC.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{a as Oe}from"./chunk-PD6WIDY6.js";import{a as Te}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as Ce}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as te}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ae}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as be}from"./chunk-4ZEL6BYL.js";import{f as Se}from"./chunk-B6RRRJP5.js";import"./chunk-FSRSK4LY.js";import"./chunk-2Y6PXGIS.js";import{a as he}from"./chunk-FKVZRPV5.js";import{a as $e,b as Ke,c as Fe,d as ie,e as re,f as ee}from"./chunk-HEAQVSNS.js";import{a as je,e as ze}from"./chunk-WUWBZPUK.js";import{d as Ne,f as me,g as pe,h as Q,l as ge,o as W,q as De}from"./chunk-FODLDLE2.js";import{a as m,d as fe,e as mt,f as pt,g as gt}from"./chunk-YKXDMIHQ.js";var M=fe(pt(),1),z=fe(mt(),1);var o=fe(gt(),1);var Ue=m((d,e,t)=>{let{onCopy:r,onDelete:l,onDownload:n,onToggleSelect:c}=t,i=m(()=>{r(d.key)},"c"),s=m(()=>{n(d.key)},"o"),u=m(()=>{l(d.key)},"f"),h=m(()=>{c(d.key)},"h");return{copy:i,download:s,name:d.key.slice(e.length),remove:u,toggle:h}},"Ee"),Me=m(d=>{let e=(0,M.c)(31),{busy:t,buttonClassName:r,copied:l,objectKey:n,onCopy:c,onDelete:i,onDownload:s,t:u}=d,h=`storage-copy-${n}`,f;e[0]!==l||e[1]!==u?(f=u(l?"Copied":"Copy URL"),e[0]=l,e[1]=u,e[2]=f):f=e[2];let p;e[3]!==t||e[4]!==r||e[5]!==c||e[6]!==h||e[7]!==f?(p=(0,o.jsx)(te,{className:r,"data-testid":h,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:f}),e[3]=t,e[4]=r,e[5]=c,e[6]=h,e[7]=f,e[8]=p):p=e[8];let w=`storage-download-${n}`,a;e[9]!==u?(a=u("Download"),e[9]=u,e[10]=a):a=e[10];let k;e[11]!==t||e[12]!==r||e[13]!==s||e[14]!==w||e[15]!==a?(k=(0,o.jsx)(te,{className:r,"data-testid":w,disabled:t,onClick:s,size:"sm",type:"button",variant:"ghost",children:a}),e[11]=t,e[12]=r,e[13]=s,e[14]=w,e[15]=a,e[16]=k):k=e[16];let N;e[17]!==u?(N=u("Delete object?"),e[17]=u,e[18]=N):N=e[18];let v=`storage-delete-${n}`,b;e[19]!==u?(b=u("Delete"),e[19]=u,e[20]=b):b=e[20];let y;e[21]!==t||e[22]!==i||e[23]!==N||e[24]!==v||e[25]!==b?(y=(0,o.jsx)(Oe,{confirmLabel:N,disabled:t,onConfirm:i,testId:v,children:b}),e[21]=t,e[22]=i,e[23]=N,e[24]=v,e[25]=b,e[26]=y):y=e[26];let x;return e[27]!==y||e[28]!==p||e[29]!==k?(x=(0,o.jsxs)(o.Fragment,{children:[p,k,y]}),e[27]=y,e[28]=p,e[29]=k,e[30]=x):x=e[30],x},"$e"),Ae=m(d=>{let e=(0,M.c)(14),{objectKey:t,references:r,t:l}=d;if(r===void 0)return null;if(r.length===0){let h=`storage-orphan-${t}`,f;e[0]!==l?(f=l("Orphan"),e[0]=l,e[1]=f):f=e[1];let p;return e[2]!==h||e[3]!==f?(p=(0,o.jsx)(ae,{"data-testid":h,variant:"warning",children:f}),e[2]=h,e[3]=f,e[4]=p):p=e[4],p}let n;e[5]!==r?(n=r.map(bt).join(`
1
+ import{d as Le}from"./chunk-M4POCI2J.js";import{c as _e}from"./chunk-UYEZR3BI.js";import"./chunk-RFNGDE33.js";import"./chunk-V3CZW3JB.js";import"./chunk-MU3P2FI7.js";import{a as ye}from"./chunk-3FBLWUXD.js";import"./chunk-XZMOZFE6.js";import{a as Ee}from"./chunk-66UGPQVC.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{a as Oe}from"./chunk-PD6WIDY6.js";import{a as Te}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as Ce}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as te}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ae}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as be}from"./chunk-4ZEL6BYL.js";import{f as Se}from"./chunk-SZSHO6RE.js";import"./chunk-FSRSK4LY.js";import"./chunk-CEA2QYAI.js";import{a as he}from"./chunk-FKVZRPV5.js";import{a as $e,b as Ke,c as Fe,d as ie,e as re,f as ee}from"./chunk-HEAQVSNS.js";import{a as je,e as ze}from"./chunk-WUWBZPUK.js";import{d as Ne,f as me,g as pe,h as Q,l as ge,o as W,q as De}from"./chunk-FODLDLE2.js";import{a as m,d as fe,e as mt,f as pt,g as gt}from"./chunk-YKXDMIHQ.js";var M=fe(pt(),1),z=fe(mt(),1);var o=fe(gt(),1);var Ue=m((d,e,t)=>{let{onCopy:r,onDelete:l,onDownload:n,onToggleSelect:c}=t,i=m(()=>{r(d.key)},"c"),s=m(()=>{n(d.key)},"o"),u=m(()=>{l(d.key)},"f"),h=m(()=>{c(d.key)},"h");return{copy:i,download:s,name:d.key.slice(e.length),remove:u,toggle:h}},"Ee"),Me=m(d=>{let e=(0,M.c)(31),{busy:t,buttonClassName:r,copied:l,objectKey:n,onCopy:c,onDelete:i,onDownload:s,t:u}=d,h=`storage-copy-${n}`,f;e[0]!==l||e[1]!==u?(f=u(l?"Copied":"Copy URL"),e[0]=l,e[1]=u,e[2]=f):f=e[2];let p;e[3]!==t||e[4]!==r||e[5]!==c||e[6]!==h||e[7]!==f?(p=(0,o.jsx)(te,{className:r,"data-testid":h,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:f}),e[3]=t,e[4]=r,e[5]=c,e[6]=h,e[7]=f,e[8]=p):p=e[8];let w=`storage-download-${n}`,a;e[9]!==u?(a=u("Download"),e[9]=u,e[10]=a):a=e[10];let k;e[11]!==t||e[12]!==r||e[13]!==s||e[14]!==w||e[15]!==a?(k=(0,o.jsx)(te,{className:r,"data-testid":w,disabled:t,onClick:s,size:"sm",type:"button",variant:"ghost",children:a}),e[11]=t,e[12]=r,e[13]=s,e[14]=w,e[15]=a,e[16]=k):k=e[16];let N;e[17]!==u?(N=u("Delete object?"),e[17]=u,e[18]=N):N=e[18];let v=`storage-delete-${n}`,b;e[19]!==u?(b=u("Delete"),e[19]=u,e[20]=b):b=e[20];let y;e[21]!==t||e[22]!==i||e[23]!==N||e[24]!==v||e[25]!==b?(y=(0,o.jsx)(Oe,{confirmLabel:N,disabled:t,onConfirm:i,testId:v,children:b}),e[21]=t,e[22]=i,e[23]=N,e[24]=v,e[25]=b,e[26]=y):y=e[26];let x;return e[27]!==y||e[28]!==p||e[29]!==k?(x=(0,o.jsxs)(o.Fragment,{children:[p,k,y]}),e[27]=y,e[28]=p,e[29]=k,e[30]=x):x=e[30],x},"$e"),Ae=m(d=>{let e=(0,M.c)(14),{objectKey:t,references:r,t:l}=d;if(r===void 0)return null;if(r.length===0){let h=`storage-orphan-${t}`,f;e[0]!==l?(f=l("Orphan"),e[0]=l,e[1]=f):f=e[1];let p;return e[2]!==h||e[3]!==f?(p=(0,o.jsx)(ae,{"data-testid":h,variant:"warning",children:f}),e[2]=h,e[3]=f,e[4]=p):p=e[4],p}let n;e[5]!==r?(n=r.map(bt).join(`
2
2
  `),e[5]=r,e[6]=n):n=e[6];let c=n,i=`storage-refs-${t}`,s;e[7]!==r.length||e[8]!==l?(s=r.length===1?l("1 record"):l("{count} records",{count:r.length}),e[7]=r.length,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==c||e[11]!==i||e[12]!==s?(u=(0,o.jsx)(ae,{"data-testid":i,title:c,variant:"secondary",children:s}),e[10]=c,e[11]=i,e[12]=s,e[13]=u):u=e[13],u},"Fe"),Pe=m(d=>{let e=(0,M.c)(7),{objectKey:t,onToggle:r,selected:l,t:n}=d,c;e[0]!==n?(c=n("Select row"),e[0]=n,e[1]=c):c=e[1];let i=`storage-select-${t}`,s;return e[2]!==r||e[3]!==l||e[4]!==c||e[5]!==i?(s=(0,o.jsx)(ye,{"aria-label":c,checked:l,"data-testid":i,onCheckedChange:r}),e[2]=r,e[3]=l,e[4]=c,e[5]=i,e[6]=s):s=e[6],s},"Re");function bt(d){return`${d.table}\xB7${d.id}`}m(bt,"yt");var yt=m(d=>{let e=(0,M.c)(10),{colSpan:t,name:r,onEnter:l}=d,n;e[0]!==r||e[1]!==l?(n=m(()=>{l(r)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,o.jsx)("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,o.jsx)("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"})}),e[3]=i):i=e[3];let s;e[4]!==c||e[5]!==r?(s=(0,o.jsxs)("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:c,type:"button",children:[i,r]}),e[4]=c,e[5]=r,e[6]=s):s=e[6];let u;return e[7]!==t||e[8]!==s?(u=(0,o.jsx)(ie,{children:(0,o.jsx)(ee,{colSpan:t,children:s})}),e[7]=t,e[8]=s,e[9]=u):u=e[9],u},"xt"),xt=m(d=>{let e=(0,M.c)(37),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,selected:s,showReferences:u,t:h}=d,f;e[0]!==l||e[1]!==n||e[2]!==c?(f=Ue(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=f):f=e[3];let{copy:p,download:w,name:a,remove:k,toggle:N}=f,v;e[4]!==n.key||e[5]!==s||e[6]!==h||e[7]!==N?(v=(0,o.jsx)(ee,{className:"w-8",children:(0,o.jsx)(Pe,{objectKey:n.key,onToggle:N,selected:s,t:h})}),e[4]=n.key,e[5]=s,e[6]=h,e[7]=N,e[8]=v):v=e[8];let b;e[9]!==a?(b=(0,o.jsx)(ee,{className:"font-mono text-xs",children:a}),e[9]=a,e[10]=b):b=e[10];let y;e[11]!==n.size?(y=ge(n.size),e[11]=n.size,e[12]=y):y=e[12];let x;e[13]!==y?(x=(0,o.jsx)(ee,{className:"tabular-nums text-muted-foreground",children:y}),e[13]=y,e[14]=x):x=e[14];let j=n.httpMetadata?.contentType??"",S;e[15]!==j?(S=(0,o.jsx)(ee,{children:j}),e[15]=j,e[16]=S):S=e[16];let C;e[17]!==n.key||e[18]!==i||e[19]!==u||e[20]!==h?(C=u&&(0,o.jsx)(ee,{children:(0,o.jsx)(Ae,{objectKey:n.key,references:i,t:h})}),e[17]=n.key,e[18]=i,e[19]=u,e[20]=h,e[21]=C):C=e[21];let T=r===n.key,D;e[22]!==t||e[23]!==p||e[24]!==w||e[25]!==n.key||e[26]!==k||e[27]!==h||e[28]!==T?(D=(0,o.jsx)(ee,{className:"text-right",children:(0,o.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,o.jsx)(Me,{busy:t,copied:T,objectKey:n.key,onCopy:p,onDelete:k,onDownload:w,t:h})})}),e[22]=t,e[23]=p,e[24]=w,e[25]=n.key,e[26]=k,e[27]=h,e[28]=T,e[29]=D):D=e[29];let F;return e[30]!==D||e[31]!==v||e[32]!==b||e[33]!==x||e[34]!==S||e[35]!==C?(F=(0,o.jsxs)(ie,{"data-testid":"fb-row",children:[v,b,x,S,C,D]}),e[30]=D,e[31]=v,e[32]=b,e[33]=x,e[34]=S,e[35]=C,e[36]=F):F=e[36],F},"vt"),vt=m(d=>{let e=(0,M.c)(65),{allSelected:t,busy:r,copiedKey:l,files:n,folders:c,handlers:i,onEnterFolder:s,prefix:u,references:h,selected:f,showReferences:p,someSelected:w,t:a,toggleSelectAll:k}=d,N;e[0]!==a?(N=a("Select all rows"),e[0]=a,e[1]=N):N=e[1];let v;e[2]!==t||e[3]!==w||e[4]!==N||e[5]!==k?(v=(0,o.jsx)(re,{className:"w-8",children:(0,o.jsx)(ye,{"aria-label":N,checked:t,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:k})}),e[2]=t,e[3]=w,e[4]=N,e[5]=k,e[6]=v):v=e[6];let b;e[7]!==a?(b=a("key"),e[7]=a,e[8]=b):b=e[8];let y;e[9]!==b?(y=(0,o.jsx)(re,{children:b}),e[9]=b,e[10]=y):y=e[10];let x;e[11]!==a?(x=a("size"),e[11]=a,e[12]=x):x=e[12];let j;e[13]!==x?(j=(0,o.jsx)(re,{children:x}),e[13]=x,e[14]=j):j=e[14];let S;e[15]!==a?(S=a("content-type"),e[15]=a,e[16]=S):S=e[16];let C;e[17]!==S?(C=(0,o.jsx)(re,{children:S}),e[17]=S,e[18]=C):C=e[18];let T;e[19]!==p||e[20]!==a?(T=p&&(0,o.jsx)(re,{children:a("used by")}),e[19]=p,e[20]=a,e[21]=T):T=e[21];let D;e[22]!==a?(D=a("Actions"),e[22]=a,e[23]=D):D=e[23];let F;e[24]!==D?(F=(0,o.jsx)(re,{"aria-label":D}),e[24]=D,e[25]=F):F=e[25];let $;e[26]!==F||e[27]!==v||e[28]!==y||e[29]!==j||e[30]!==C||e[31]!==T?($=(0,o.jsx)(Ke,{children:(0,o.jsxs)(ie,{children:[v,y,j,C,T,F]})}),e[26]=F,e[27]=v,e[28]=y,e[29]=j,e[30]=C,e[31]=T,e[32]=$):$=e[32];let O;if(e[33]!==c||e[34]!==s||e[35]!==p){let E;e[37]!==s||e[38]!==p?(E=m(_=>(0,o.jsx)(yt,{colSpan:p?6:5,name:_,onEnter:s},_),"D"),e[37]=s,e[38]=p,e[39]=E):E=e[39],O=c.map(E),e[33]=c,e[34]=s,e[35]=p,e[36]=O}else O=e[36];let B;if(e[40]!==r||e[41]!==l||e[42]!==n||e[43]!==i||e[44]!==u||e[45]!==h||e[46]!==f||e[47]!==p||e[48]!==a){let E;e[50]!==r||e[51]!==l||e[52]!==i||e[53]!==u||e[54]!==h||e[55]!==f||e[56]!==p||e[57]!==a?(E=m(_=>(0,o.jsx)(xt,{busy:r,copiedKey:l,handlers:i,object:_,prefix:u,references:h[_.key],selected:f.has(_.key),showReferences:p,t:a},_.key),"D"),e[50]=r,e[51]=l,e[52]=i,e[53]=u,e[54]=h,e[55]=f,e[56]=p,e[57]=a,e[58]=E):E=e[58],B=n.map(E),e[40]=r,e[41]=l,e[42]=n,e[43]=i,e[44]=u,e[45]=h,e[46]=f,e[47]=p,e[48]=a,e[49]=B}else B=e[49];let L;e[59]!==O||e[60]!==B?(L=(0,o.jsxs)(Fe,{children:[O,B]}),e[59]=O,e[60]=B,e[61]=L):L=e[61];let I;return e[62]!==$||e[63]!==L?(I=(0,o.jsx)(je,{className:"overflow-hidden py-0",children:(0,o.jsx)(ze,{className:"px-0",children:(0,o.jsxs)($e,{"data-testid":"fb-table",children:[$,L]})})}),e[62]=$,e[63]=L,e[64]=I):I=e[64],I},"kt"),kt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],wt=3600,Be=m((d,e)=>{if(e==="size")return d.size;if(e==="type")return d.httpMetadata?.contentType??"";if(e==="date"){if(d.uploaded===void 0)return 0;let t=new Date(d.uploaded).getTime();return Number.isNaN(t)?0:t}return e.startsWith("tag:")?d.customMetadata?.[e.slice(4)]??"":d.key},"ve"),St=m((d,e,t)=>{let r=t==="desc"?-1:1;return d.toSorted((l,n)=>{let c=Be(l,e),i=Be(n,e);return(typeof c=="number"&&typeof i=="number"?c-i:String(c).localeCompare(String(i)))*r})},"Ct"),Nt=m((d,e)=>{let t=new Set,r=[];for(let l of d){let n=l.key.slice(e.length),c=n.indexOf("/");c===-1?r.push(l):t.add(n.slice(0,c+1))}return{files:r,folders:[...t].toSorted((l,n)=>l.localeCompare(n))}},"Nt"),Ct=m(d=>{let e=(0,M.c)(59),{bucket:t,buckets:r,busy:l,draftPrefix:n,expiry:c,fileInputRef:i,onBucketChange:s,onExpiryChange:u,onFileChange:h,onList:f,onPrefixChange:p,onUploadClick:w,t:a}=d,k;e[0]!==p?(k=m(P=>{p(P.target.value)},"v"),e[0]=p,e[1]=k):k=e[1];let N=k,v;e[2]!==s?(v=m(P=>{s(P.target.value)},"x"),e[2]=s,e[3]=v):v=e[3];let b=v,y;e[4]!==u?(y=m(P=>{u(Number.parseInt(P.target.value,10))},"b"),e[4]=u,e[5]=y):y=e[5];let x=y,j;e[6]!==t||e[7]!==r||e[8]!==b||e[9]!==a?(j=r.length>0&&(0,o.jsx)("select",{"aria-label":a("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:t,children:r.map(zt)}),e[6]=t,e[7]=r,e[8]=b,e[9]=a,e[10]=j):j=e[10];let S;e[11]!==a?(S=a("Key prefix"),e[11]=a,e[12]=S):S=e[12];let C;e[13]!==a?(C=a("key prefix (optional)"),e[13]=a,e[14]=C):C=e[14];let T;e[15]!==n||e[16]!==N||e[17]!==S||e[18]!==C?(T=(0,o.jsx)(Ce,{"aria-label":S,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:N,placeholder:C,value:n}),e[15]=n,e[16]=N,e[17]=S,e[18]=C,e[19]=T):T=e[19];let D;e[20]!==a?(D=a("List"),e[20]=a,e[21]=D):D=e[21];let F;e[22]!==l||e[23]!==f||e[24]!==D?(F=(0,o.jsx)(te,{"data-testid":"fb-list",disabled:l,onClick:f,size:"sm",type:"button",children:D}),e[22]=l,e[23]=f,e[24]=D,e[25]=F):F=e[25];let $;e[26]!==l||e[27]!==a?($=a(l?"Uploading\u2026":"Upload"),e[26]=l,e[27]=a,e[28]=$):$=e[28];let O;e[29]!==l||e[30]!==w||e[31]!==$?(O=(0,o.jsx)(te,{"data-testid":"storage-upload",disabled:l,onClick:w,size:"sm",type:"button",variant:"outline",children:$}),e[29]=l,e[30]=w,e[31]=$,e[32]=O):O=e[32];let B;e[33]!==i||e[34]!==h?(B=(0,o.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:i,type:"file"}),e[33]=i,e[34]=h,e[35]=B):B=e[35];let L;e[36]!==a?(L=a("Link expiry"),e[36]=a,e[37]=L):L=e[37];let I;e[38]!==a?(I=kt.map(P=>(0,o.jsx)("option",{value:P.seconds,children:a(P.label)},P.seconds)),e[38]=a,e[39]=I):I=e[39];let E;e[40]!==c||e[41]!==x||e[42]!==I?(E=(0,o.jsx)("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:x,value:c,children:I}),e[40]=c,e[41]=x,e[42]=I,e[43]=E):E=e[43];let _;e[44]!==L||e[45]!==E?(_=(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[L,E]}),e[44]=L,e[45]=E,e[46]=_):_=e[46];let U;e[47]!==a?(U=a("Open in Cloudflare"),e[47]=a,e[48]=U):U=e[48];let A;e[49]!==U?(A=(0,o.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:_e,rel:"noreferrer",target:"_blank",children:U}),e[49]=U,e[50]=A):A=e[50];let H;return e[51]!==O||e[52]!==B||e[53]!==_||e[54]!==A||e[55]!==j||e[56]!==T||e[57]!==F?(H=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,T,F,O,B,_,A]}),e[51]=O,e[52]=B,e[53]=_,e[54]=A,e[55]=j,e[56]=T,e[57]=F,e[58]=H):H=e[58],H},"Tt"),jt=m(d=>{let e=(0,M.c)(66),{onSortKeyChange:t,onThumbSizeChange:r,showGrid:l,showList:n,sortDirection:c,sortKey:i,t:s,tagKeys:u,thumbSize:h,toggleSortDirection:f,view:p}=d,w;e[0]!==t?(w=m(G=>{t(G.target.value)},"k"),e[0]=t,e[1]=w):w=e[1];let a=w,k;e[2]!==r?(k=m(G=>{r(Number.parseInt(G.target.value,10))},"v"),e[2]=r,e[3]=k):k=e[3];let N=k,v=p==="list",b;e[4]!==s?(b=s("List"),e[4]=s,e[5]=b):b=e[5];let y;e[6]!==n||e[7]!==v||e[8]!==b?(y=(0,o.jsx)("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:n,type:"button",children:b}),e[6]=n,e[7]=v,e[8]=b,e[9]=y):y=e[9];let x=p==="grid",j;e[10]!==s?(j=s("Grid"),e[10]=s,e[11]=j):j=e[11];let S;e[12]!==l||e[13]!==x||e[14]!==j?(S=(0,o.jsx)("button",{"aria-pressed":x,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:l,type:"button",children:j}),e[12]=l,e[13]=x,e[14]=j,e[15]=S):S=e[15];let C;e[16]!==y||e[17]!==S?(C=(0,o.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[y,S]}),e[16]=y,e[17]=S,e[18]=C):C=e[18];let T;e[19]!==s?(T=s("Sort"),e[19]=s,e[20]=T):T=e[20];let D;e[21]!==s?(D=s("Name"),e[21]=s,e[22]=D):D=e[22];let F;e[23]!==D?(F=(0,o.jsx)("option",{value:"name",children:D}),e[23]=D,e[24]=F):F=e[24];let $;e[25]!==s?($=s("size"),e[25]=s,e[26]=$):$=e[26];let O;e[27]!==$?(O=(0,o.jsx)("option",{value:"size",children:$}),e[27]=$,e[28]=O):O=e[28];let B;e[29]!==s?(B=s("Type"),e[29]=s,e[30]=B):B=e[30];let L;e[31]!==B?(L=(0,o.jsx)("option",{value:"type",children:B}),e[31]=B,e[32]=L):L=e[32];let I;e[33]!==s?(I=s("Modified"),e[33]=s,e[34]=I):I=e[34];let E;e[35]!==I?(E=(0,o.jsx)("option",{value:"date",children:I}),e[35]=I,e[36]=E):E=e[36];let _;e[37]!==u?(_=u.map(Dt),e[37]=u,e[38]=_):_=e[38];let U;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==O||e[43]!==L||e[44]!==E||e[45]!==_?(U=(0,o.jsxs)("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:a,value:i,children:[F,O,L,E,_]}),e[39]=a,e[40]=i,e[41]=F,e[42]=O,e[43]=L,e[44]=E,e[45]=_,e[46]=U):U=e[46];let A;e[47]!==T||e[48]!==U?(A=(0,o.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[T,U]}),e[47]=T,e[48]=U,e[49]=A):A=e[49];let H;e[50]!==s?(H=s("Toggle sort direction"),e[50]=s,e[51]=H):H=e[51];let P=c==="asc"?"\u2191":"\u2193",q;e[52]!==H||e[53]!==P||e[54]!==f?(q=(0,o.jsx)("button",{"aria-label":H,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:P}),e[52]=H,e[53]=P,e[54]=f,e[55]=q):q=e[55];let Y;e[56]!==N||e[57]!==s||e[58]!==h||e[59]!==p?(Y=p==="grid"&&(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[s("Thumbnail size"),(0,o.jsx)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:N,step:8,type:"range",value:h})]}),e[56]=N,e[57]=s,e[58]=h,e[59]=p,e[60]=Y):Y=e[60];let ne;return e[61]!==A||e[62]!==q||e[63]!==Y||e[64]!==C?(ne=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[C,A,q,Y]}),e[61]=A,e[62]=q,e[63]=Y,e[64]=C,e[65]=ne):ne=e[65],ne},"_t");function zt(d){return(0,o.jsx)("option",{value:d,children:d},d)}m(zt,"Et");function Dt(d){return(0,o.jsx)("option",{value:`tag:${d}`,children:d},d)}m(Dt,"$t");var Tt=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,$t=m(d=>(d.httpMetadata?.contentType??"").startsWith("image/")||Tt.test(d.key),"Rt"),Kt=m(()=>{let d=(0,M.c)(1),e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,o.jsx)("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,o.jsx)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),d[0]=e):e=d[0],e},"zt"),Ft=m(d=>{let e=(0,M.c)(13),{object:t,resolveUrl:r}=d,[l,n]=(0,z.useState)(null),[c,i]=(0,z.useState)(!1),s;e[0]!==t?(s=$t(t),e[0]=t,e[1]=s):s=e[1];let u=s,h,f;e[2]!==u||e[3]!==t.key||e[4]!==r?(h=m(()=>{if(!u)return;let k={cancelled:!1};return W((async()=>{try{let N=await r(t.key);k.cancelled||n(N)}catch{k.cancelled||i(!0)}})()),()=>{k.cancelled=!0}},"h"),f=[u,t.key,r],e[2]=u,e[3]=t.key,e[4]=r,e[5]=h,e[6]=f):(h=e[5],f=e[6]),(0,z.useEffect)(h,f);let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=m(()=>{i(!0)},"m"),e[7]=p):p=e[7];let w=p,a;return e[8]!==c||e[9]!==u||e[10]!==t.key||e[11]!==l?(a=(0,o.jsx)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:u&&l!==null&&!c?(0,o.jsx)("img",{alt:t.key,className:"size-full object-cover",loading:"lazy",onError:w,src:l}):(0,o.jsx)(Kt,{})}),e[8]=c,e[9]=u,e[10]=t.key,e[11]=l,e[12]=a):a=e[12],a},"Dt"),Ot=m(d=>{let e=(0,M.c)(42),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,resolveUrl:s,selected:u,showReferences:h,t:f}=d,p;e[0]!==l||e[1]!==n||e[2]!==c?(p=Ue(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=p):p=e[3];let{copy:w,download:a,name:k,remove:N,toggle:v}=p,b;e[4]!==n||e[5]!==s?(b=(0,o.jsx)(Ft,{object:n,resolveUrl:s}),e[4]=n,e[5]=s,e[6]=b):b=e[6];let y;e[7]!==n.key||e[8]!==u||e[9]!==f||e[10]!==v?(y=(0,o.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,o.jsx)(Pe,{objectKey:n.key,onToggle:v,selected:u,t:f})}),e[7]=n.key,e[8]=u,e[9]=f,e[10]=v,e[11]=y):y=e[11];let x;e[12]!==b||e[13]!==y?(x=(0,o.jsxs)("div",{className:"relative",children:[b,y]}),e[12]=b,e[13]=y,e[14]=x):x=e[14];let j;e[15]!==k?(j=(0,o.jsx)("p",{className:"truncate font-mono text-xs",title:k,children:k}),e[15]=k,e[16]=j):j=e[16];let S;e[17]!==n.size?(S=ge(n.size),e[17]=n.size,e[18]=S):S=e[18];let C;e[19]!==S?(C=(0,o.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:S}),e[19]=S,e[20]=C):C=e[20];let T;e[21]!==n.key||e[22]!==i||e[23]!==h||e[24]!==f?(T=h&&(0,o.jsx)("div",{className:"mt-1",children:(0,o.jsx)(Ae,{objectKey:n.key,references:i,t:f})}),e[21]=n.key,e[22]=i,e[23]=h,e[24]=f,e[25]=T):T=e[25];let D;e[26]!==j||e[27]!==C||e[28]!==T?(D=(0,o.jsxs)("div",{className:"min-w-0",children:[j,C,T]}),e[26]=j,e[27]=C,e[28]=T,e[29]=D):D=e[29];let F=r===n.key,$;e[30]!==t||e[31]!==w||e[32]!==a||e[33]!==n.key||e[34]!==N||e[35]!==f||e[36]!==F?($=(0,o.jsx)("div",{className:"flex items-center gap-1",children:(0,o.jsx)(Me,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:n.key,onCopy:w,onDelete:N,onDownload:a,t:f})}),e[30]=t,e[31]=w,e[32]=a,e[33]=n.key,e[34]=N,e[35]=f,e[36]=F,e[37]=$):$=e[37];let O;return e[38]!==$||e[39]!==x||e[40]!==D?(O=(0,o.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[x,D,$]}),e[38]=$,e[39]=x,e[40]=D,e[41]=O):O=e[41],O},"jt"),Et=m(d=>{let e=(0,M.c)(9),{name:t,onEnter:r}=d,l;e[0]!==t||e[1]!==r?(l=m(()=>{r(t)},"n"),e[0]=t,e[1]=r,e[2]=l):l=e[2];let n=l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,o.jsx)("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,o.jsx)("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,o.jsx)("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"})})}),e[3]=c):c=e[3];let i;e[4]!==t?(i=(0,o.jsx)("span",{className:"truncate font-mono text-xs",title:t,children:t}),e[4]=t,e[5]=i):i=e[5];let s;return e[6]!==n||e[7]!==i?(s=(0,o.jsxs)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:n,type:"button",children:[c,i]}),e[6]=n,e[7]=i,e[8]=s):s=e[8],s},"Kt"),Lt=m(d=>{let e=(0,M.c)(34),{busy:t,copiedKey:r,files:l,folders:n,handlers:c,onEnterFolder:i,prefix:s,references:u,resolveUrl:h,selected:f,showReferences:p,size:w,t:a}=d,k;e[0]!==w?(k=w.toString(),e[0]=w,e[1]=k):k=e[1];let N=`repeat(auto-fill, minmax(${k}px, 1fr))`,v;e[2]!==N?(v={gridTemplateColumns:N},e[2]=N,e[3]=v):v=e[3];let b=v,y;if(e[4]!==n||e[5]!==i){let S;e[7]!==i?(S=m(C=>(0,o.jsx)(Et,{name:C,onEnter:i},C),"S"),e[7]=i,e[8]=S):S=e[8],y=n.map(S),e[4]=n,e[5]=i,e[6]=y}else y=e[6];let x;if(e[9]!==t||e[10]!==r||e[11]!==l||e[12]!==c||e[13]!==s||e[14]!==u||e[15]!==h||e[16]!==f||e[17]!==p||e[18]!==a){let S;e[20]!==t||e[21]!==r||e[22]!==c||e[23]!==s||e[24]!==u||e[25]!==h||e[26]!==f||e[27]!==p||e[28]!==a?(S=m(C=>(0,o.jsx)(Ot,{busy:t,copiedKey:r,handlers:c,object:C,prefix:s,references:u[C.key],resolveUrl:h,selected:f.has(C.key),showReferences:p,t:a},C.key),"S"),e[20]=t,e[21]=r,e[22]=c,e[23]=s,e[24]=u,e[25]=h,e[26]=f,e[27]=p,e[28]=a,e[29]=S):S=e[29],x=l.map(S),e[9]=t,e[10]=r,e[11]=l,e[12]=c,e[13]=s,e[14]=u,e[15]=h,e[16]=f,e[17]=p,e[18]=a,e[19]=x}else x=e[19];let j;return e[30]!==b||e[31]!==y||e[32]!==x?(j=(0,o.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[y,x]}),e[30]=b,e[31]=y,e[32]=x,e[33]=j):j=e[33],j},"Lt"),_t=m(d=>{let e=(0,M.c)(23),{reference:t,t:r}=d,l=`fb-dangling-${t.table}-${t.id}-${t.column}`,n=`${t.table}\xB7${t.id}`,c;e[0]!==n?(c=(0,o.jsx)(ae,{variant:"secondary",children:n}),e[0]=n,e[1]=c):c=e[1];let i;e[2]!==t.column?(i=(0,o.jsx)("span",{className:"text-muted-foreground",children:t.column}),e[2]=t.column,e[3]=i):i=e[3];let s;e[4]!==r?(s=r("\u2192"),e[4]=r,e[5]=s):s=e[5];let u;e[6]!==s?(u=(0,o.jsx)("span",{className:"text-muted-foreground/60",children:s}),e[6]=s,e[7]=u):u=e[7];let h;e[8]!==t.key?(h=(0,o.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:t.key}),e[8]=t.key,e[9]=h):h=e[9];let f;e[10]!==c||e[11]!==i||e[12]!==u||e[13]!==h?(f=(0,o.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,i,u,h]}),e[10]=c,e[11]=i,e[12]=u,e[13]=h,e[14]=f):f=e[14];let p;e[15]!==r?(p=r("Missing object"),e[15]=r,e[16]=p):p=e[16];let w;e[17]!==p?(w=(0,o.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:p}),e[17]=p,e[18]=w):w=e[18];let a;return e[19]!==l||e[20]!==w||e[21]!==f?(a=(0,o.jsxs)("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":l,children:[f,w]}),e[19]=l,e[20]=w,e[21]=f,e[22]=a):a=e[22],a},"Bt"),Bt=m(d=>{let e=(0,M.c)(42),{busy:t,onCheck:r,references:l,t:n,truncated:c}=d,i;e[0]!==n?(i=n("Integrity"),e[0]=n,e[1]=i):i=e[1];let s;e[2]!==i?(s=(0,o.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[2]=i,e[3]=s):s=e[3];let u;e[4]!==n?(u=n("Orphaned objects"),e[4]=n,e[5]=u):u=e[5];let h;e[6]!==u?(h=(0,o.jsx)("span",{className:"text-sm font-medium text-foreground",children:u}),e[6]=u,e[7]=h):h=e[7];let f;e[8]!==n?(f=n("Find records whose file reference points at an object the bucket no longer has."),e[8]=n,e[9]=f):f=e[9];let p;e[10]!==f?(p=(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[10]=f,e[11]=p):p=e[11];let w;e[12]!==s||e[13]!==h||e[14]!==p?(w=(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[s,h,p]}),e[12]=s,e[13]=h,e[14]=p,e[15]=w):w=e[15];let a;e[16]!==t||e[17]!==n?(a=n(t?"Checking\u2026":"Check for orphans"),e[16]=t,e[17]=n,e[18]=a):a=e[18];let k;e[19]!==t||e[20]!==r||e[21]!==a?(k=(0,o.jsx)(te,{"data-testid":"fb-orphans-check",disabled:t,onClick:r,size:"sm",type:"button",variant:"outline",children:a}),e[19]=t,e[20]=r,e[21]=a,e[22]=k):k=e[22];let N;e[23]!==w||e[24]!==k?(N=(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w,k]}),e[23]=w,e[24]=k,e[25]=N):N=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==c?(v=c&&(0,o.jsx)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:l===void 0||l.length===0?n("The bucket is larger than the scan's key limit, so dangling references could not be checked."):n("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:l.length})}),e[26]=l,e[27]=n,e[28]=c,e[29]=v):v=e[29];let b;e[30]!==l?.length||e[31]!==n||e[32]!==c?(b=l?.length===0&&!c&&(0,o.jsx)(he,{description:n("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:n("No dangling references.")}),e[30]=l?.length,e[31]=n,e[32]=c,e[33]=b):b=e[33];let y;e[34]!==l||e[35]!==n?(y=l!==void 0&&l.length>0&&(0,o.jsx)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:l.map(j=>(0,o.jsx)(_t,{reference:j,t:n},`${j.table}\xB7${j.id}\xB7${j.column}`))}),e[34]=l,e[35]=n,e[36]=y):y=e[36];let x;return e[37]!==N||e[38]!==v||e[39]!==b||e[40]!==y?(x=(0,o.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[N,v,b,y]}),e[37]=N,e[38]=v,e[39]=b,e[40]=y,e[41]=x):x=e[41],x},"It"),It=m(function(d,e){let t=(0,M.c)(18),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,t[0]=r):r=t[0];let[l,n]=(0,z.useState)(r),c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=m(v=>{n(b=>{let y=new Set(b);return y.has(v)?y.delete(v):y.add(v),y})},"a"),t[1]=c):c=t[1];let i=c,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=m(()=>{n(new Set)},"o"),t[2]=s):s=t[2];let u=s,h,f,p;if(t[3]!==d||t[4]!==e||t[5]!==l){let v;t[9]!==e?(v=m(b=>e(b),"x"),t[9]=e,t[10]=v):v=t[10],f=d.map(v),h=f.length>0&&f.every(b=>l.has(b)),p=!h&&f.some(b=>l.has(b)),t[3]=d,t[4]=e,t[5]=l,t[6]=h,t[7]=f,t[8]=p}else h=t[6],f=t[7],p=t[8];let w=p,a;t[11]!==f?(a=m(()=>{n(v=>f.every(b=>v.has(b))?new Set:new Set(f))},"i"),t[11]=f,t[12]=a):a=t[12];let k=a,N;return t[13]!==h||t[14]!==l||t[15]!==w||t[16]!==k?(N={allSelected:h,clear:u,selected:l,someSelected:w,toggle:i,toggleAll:k},t[13]=h,t[14]=l,t[15]=w,t[16]=k,t[17]=N):N=t[17],N},"Ot"),Rt=me(be.storageReferences),Ut=me(be.storageOrphans),Ie=1e4,Mt=1e3,At=m(async d=>{let e=[],t,r=!0,l=!1;for(;r&&e.length<Ie;){let n=await d.list({cursor:t,limit:Mt}),c=Ie-e.length;for(let i of n.objects.slice(0,c))e.push(i.key);l||=n.objects.length>c,t=n.cursor,r=t!==void 0}return{liveKeys:e,truncated:l||r}},"Gt"),Pt=3600,Wt=m((d,e)=>{if(!("document"in globalThis))return;let t=globalThis.document.createElement("a");t.href=d,t.download=e,t.rel="noopener",globalThis.document.body.append(t),t.click(),t.remove()},"Pt"),Ht=m(d=>d.key,"qt"),qt=m(({initialPrefix:d,pageSize:e})=>{let t=Se(),[r,l]=(0,z.useState)(d??""),[n,c]=(0,z.useState)(d??""),[i,s]=(0,z.useState)(wt),[u,h]=(0,z.useState)("list"),[f,p]=(0,z.useState)(128),[w,a]=(0,z.useState)("name"),[k,N]=(0,z.useState)("asc"),[v,b]=(0,z.useState)(void 0),[y,x]=(0,z.useState)(void 0),[j,S]=(0,z.useState)(!1),[C,T]=(0,z.useState)(void 0),[D,F]=(0,z.useState)(void 0),[$,O]=(0,z.useState)(""),[B,L]=(0,z.useState)({}),[I,E]=(0,z.useState)(!1),[_,U]=(0,z.useState)(void 0),[A,H]=(0,z.useState)(!1),[P,q]=(0,z.useState)(!1),[Y,ne]=(0,z.useState)([]),[G,xe]=(0,z.useState)(""),oe=(0,z.useRef)(0),J=(0,z.useRef)(0);(0,z.useEffect)(()=>{let g={cancelled:!1};return W((async()=>{try{let K=await t.listStorageBuckets();if(!g.cancelled){ne(K);let[R]=K;R!==void 0&&xe(X=>X===""?R:X)}}catch{}})()),()=>{g.cancelled=!0}},[t]);let V=(0,z.useMemo)(()=>({list:m(g=>t.listStorageObjects({...g,bucket:G}),"list"),remove:m(g=>t.deleteStorageObject(g,{bucket:G}),"remove"),signedUrl:m((g,K)=>t.signedStorageUrl(g,{...K,bucket:G}),"signedUrl"),upload:m(g=>t.uploadStorageObject({...g,bucket:G}),"upload")}),[G,t]),Z=(0,z.useCallback)(async(g,K,R)=>{oe.current+=1;let X=oe.current;x(void 0),S(!0);try{let se=await V.list({cursor:K,limit:e,prefix:g});if(X!==oe.current)return;b(we=>R&&we!==void 0?[...we,...se.objects]:se.objects),F(se.cursor)}catch(se){if(X!==oe.current)return;R||b(void 0),x(Q(se))}finally{X===oe.current&&S(!1)}},[e,V]);(0,z.useEffect)(()=>{W(Z(d??"",void 0,!1))},[Z,d]);let We=(v?.length??0)<=e;Ee(()=>{W(Z(r,void 0,!1))},We);let{files:de,folders:He}=Nt(v??[],r),qe=(0,z.useMemo)(()=>{let g=new Set;for(let K of de)for(let R of Object.keys(K.customMetadata??{}))g.add(R);return[...g].toSorted((K,R)=>K.localeCompare(R))},[de]),ce=St(de,w,k),ue=(0,z.useMemo)(()=>[...new Set(ce.map(g=>g.key))].toSorted((g,K)=>g.localeCompare(K)).join(`
3
3
  `),[ce]);(0,z.useEffect)(()=>{let g=ue===""?[]:ue.split(`
4
4
  `);if(g.length===0){L({});return}let K={current:!0};return W((async()=>{try{let R=await t.query(Rt,{keys:g},pe($));K.current&&(L(R.references??{}),E(Object.keys(R.storageColumns??{}).length>0))}catch{K.current&&(L({}),E(!1))}})()),()=>{K.current=!1}},[t,ue,$]);let{allSelected:Ge,clear:le,selected:ve,someSelected:Ve,toggle:Ze,toggleAll:Xe}=It(ce,Ht),Ye=m(()=>{l(n),le(),W(Z(n,void 0,!1))},"Oe"),Je=m(()=>{W(Z(r,D,!0))},"Ae"),ke=m(g=>{l(g),c(g),le(),W(Z(g,void 0,!1))},"be"),Qe=m(g=>{ke(`${r}${g}`)},"Ue"),et=m(g=>V.signedUrl(g,{expiresInSeconds:Pt}),"Me"),tt=m(()=>{h("list")},"Ge"),rt=m(()=>{h("grid")},"He"),nt=m(g=>{a(g)},"Pe"),ot=m(()=>{N(g=>g==="asc"?"desc":"asc")},"qe"),lt=m(g=>{p(g)},"Ve"),st=m(g=>{s(g)},"We"),at=m(()=>{x(void 0),S(!0),W((async()=>{try{for(let g of ve)await V.remove(g);await Z(r,void 0,!1),le()}catch(g){x(Q(g))}S(!1)})())},"Ze"),ct=m(g=>{x(void 0),W((async()=>{try{let K=await V.signedUrl(g,{expiresInSeconds:i});De(K)&&T(g)}catch(K){x(Q(K))}})())},"Xe"),it=m(g=>{x(void 0),W((async()=>{try{let K=await V.signedUrl(g,{expiresInSeconds:i}),R=g.slice(g.lastIndexOf("/")+1)||g;Wt(K,R)}catch(K){x(Q(K))}})())},"Ye");(0,z.useEffect)(()=>{if(C===void 0)return;let g=globalThis.setTimeout(()=>{T(void 0)},2e3);return()=>{globalThis.clearTimeout(g)}},[C]);let dt=m(g=>{x(void 0),S(!0),W((async()=>{try{await V.remove(g),await Z(r,void 0,!1)}catch(K){x(Q(K))}S(!1)})())},"Je"),ut=m(g=>{let K=`${r}${g.name}`;x(void 0),S(!0),W((async()=>{try{let R=await g.arrayBuffer();await V.upload({body:R,contentType:g.type===""?void 0:g.type,key:K}),await Z(r,void 0,!1)}catch(R){x(Q(R))}S(!1)})())},"Qe");(0,z.useEffect)(()=>{J.current+=1,U(void 0),q(!1)},[$]);let ft=m(()=>{J.current+=1;let g=J.current;x(void 0),H(!0),W((async()=>{try{let{liveKeys:K,truncated:R}=await At(V);if(R)g===J.current&&(U(void 0),q(!0));else{let X=await t.query(Ut,{liveKeys:K},pe($));g===J.current&&(U(X.references??[]),q(X.truncated===!0))}}catch(K){g===J.current&&(U(void 0),q(!1),x(Q(K)))}g===J.current&&H(!1)})())},"et"),ht=m(g=>{oe.current+=1,J.current+=1,xe(g),l(d??""),c(d??""),b(void 0),U(void 0),q(!1),le()},"tt");return{allSelected:Ge,bucket:G,buckets:Y,bulkDelete:at,busy:j,checkOrphans:ft,clearSelection:le,copiedKey:C,danglingBusy:A,danglingReferences:_,danglingTruncated:P,draftPrefix:n,enterFolder:Qe,error:y,expiry:i,files:ce,folders:He,hasObjects:v!==void 0&&v.length>0,hasStorageColumns:I,listFirst:Ye,loaded:v!==void 0,loadMore:Je,navigate:ke,nextCursor:D,onCopy:ct,onDelete:dt,onDownload:it,onExpiryChange:st,onFile:ut,onSortKeyChange:nt,onThumbSizeChange:lt,prefix:r,referenceShard:$,references:B,resolveUrl:et,selectBucket:ht,selected:ve,setDraftPrefix:c,setReferenceShard:O,showGrid:rt,showList:tt,someSelected:Ve,sortDirection:k,sortKey:w,tagKeys:qe,thumbSize:f,toggleSelect:Ze,toggleSelectAll:Xe,toggleSortDirection:ot,view:u}},"Vt"),Gt=100,Re=m(d=>{let e=(0,M.c)(6),{label:t,onNavigate:r,target:l}=d,n;e[0]!==r||e[1]!==l?(n=m(()=>{r(l)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;return e[3]!==c||e[4]!==t?(i=(0,o.jsx)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:c,type:"button",children:t}),e[3]=c,e[4]=t,e[5]=i):i=e[5],i},"Se"),Vt=m(d=>{let e=(0,M.c)(11),{onNavigate:t,prefix:r,t:l}=d,n;if(e[0]!==t||e[1]!==r||e[2]!==l){let c=r.split("/").filter(Zt),i;e[4]!==l?(i=l("Folder path"),e[4]=l,e[5]=i):i=e[5];let s;e[6]!==l?(s=l("root"),e[6]=l,e[7]=s):s=e[7];let u;e[8]!==t||e[9]!==s?(u=(0,o.jsx)(Re,{label:s,onNavigate:t,target:""}),e[8]=t,e[9]=s,e[10]=u):u=e[10],n=(0,o.jsxs)("nav",{"aria-label":i,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[u,c.map((h,f)=>(0,o.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,o.jsx)("span",{className:"text-muted-foreground/50",children:"/"}),(0,o.jsx)(Re,{label:h,onNavigate:t,target:`${c.slice(0,f+1).join("/")}/`})]},`${h}-${f.toString()}`))]}),e[0]=t,e[1]=r,e[2]=l,e[3]=n}else n=e[3];return n},"Zt"),fr=m(({initialPrefix:d,pageSize:e=Gt})=>{let t=Ne(),r=qt({initialPrefix:d,pageSize:e}),l=(0,z.useRef)(null),{onCopy:n,onDelete:c,onDownload:i,onFile:s,toggleSelect:u}=r,h={onCopy:n,onDelete:c,onDownload:i,onToggleSelect:u},f=m(()=>{l.current?.click()},"u"),p=m(a=>{let k=a.target,N=k.files?.[0];k.value="",N&&s(N)},"m"),w=r.loaded&&!r.hasObjects;return(0,o.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,o.jsx)(Ct,{bucket:r.bucket,buckets:r.buckets,busy:r.busy,draftPrefix:r.draftPrefix,expiry:r.expiry,fileInputRef:l,onBucketChange:r.selectBucket,onExpiryChange:r.onExpiryChange,onFileChange:p,onList:r.listFirst,onPrefixChange:r.setDraftPrefix,onUploadClick:f,t}),r.loaded&&(0,o.jsx)(Vt,{onNavigate:r.navigate,prefix:r.prefix,t}),r.hasObjects&&(0,o.jsx)(jt,{onSortKeyChange:r.onSortKeyChange,onThumbSizeChange:r.onThumbSizeChange,showGrid:r.showGrid,showList:r.showList,sortDirection:r.sortDirection,sortKey:r.sortKey,t,tagKeys:r.tagKeys,thumbSize:r.thumbSize,toggleSortDirection:r.toggleSortDirection,view:r.view}),r.hasStorageColumns&&(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,o.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:t("References shard")}),(0,o.jsx)(Te,{id:"fb-reference-shard-input",onChange:r.setReferenceShard,testId:"fb-reference-shard-input",value:r.referenceShard}),(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:t("Which shard's records are checked for references to these files. Empty = root shard.")})]}),r.hasStorageColumns&&(0,o.jsx)(Bt,{busy:r.danglingBusy,onCheck:r.checkOrphans,references:r.danglingReferences,t,truncated:r.danglingTruncated}),r.selected.size>0&&(0,o.jsx)(Le,{count:r.selected.size,editable:!0,onClear:r.clearSelection,onDelete:r.bulkDelete}),r.error!==void 0&&(0,o.jsx)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:r.error}),w&&(0,o.jsx)(he,{description:t("Objects you upload to your R2 buckets will appear here."),icon:(0,o.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,o.jsx)("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"}),(0,o.jsx)("path",{d:"M12 11v5m-2.5-2.5h5"})]}),testId:"fb-empty",title:t("No objects.")}),r.hasObjects&&r.view==="list"&&(0,o.jsx)(vt,{allSelected:r.allSelected,busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:h,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,selected:r.selected,showReferences:r.hasStorageColumns,someSelected:r.someSelected,t,toggleSelectAll:r.toggleSelectAll}),r.hasObjects&&r.view==="grid"&&(0,o.jsx)(Lt,{busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:h,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,resolveUrl:r.resolveUrl,selected:r.selected,showReferences:r.hasStorageColumns,size:r.thumbSize,t}),r.nextCursor!==void 0&&(0,o.jsx)("div",{children:(0,o.jsx)(te,{"data-testid":"fb-next",disabled:r.busy,onClick:r.loadMore,size:"sm",type:"button",variant:"outline",children:t("Load more")})})]})},"ps");function Zt(d){return d!==""}m(Zt,"Xt");export{fr as FileBrowser};
@@ -1,4 +1,4 @@
1
- import{a as Yi,b as Ve,c as Ri,d as Je,e as Zi,f as xi,k as ji}from"./chunk-NVKY4CIW.js";import"./chunk-Q4CAKBWN.js";import"./chunk-AULH6SZB.js";import"./chunk-RLLKECZT.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import{a as pi}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import"./chunk-5WJXVZMZ.js";import"./chunk-EVTM6Q43.js";import"./chunk-K7AJEMKE.js";import"./chunk-6D6Z2KXU.js";import{a as Le}from"./chunk-OKG3HWSJ.js";import{W as Xi}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import{a as zy}from"./chunk-4L4WTGN5.js";import{a as Gi}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as Ke}from"./chunk-3PZNTIBM.js";import"./chunk-35DM4JJG.js";import"./chunk-4ZEL6BYL.js";import"./chunk-SDHFSBNM.js";import{a as Hi,e as qi}from"./chunk-B6RRRJP5.js";import"./chunk-FSRSK4LY.js";import{d as _i}from"./chunk-2Y6PXGIS.js";import"./chunk-FKVZRPV5.js";import"./chunk-WUWBZPUK.js";import{a as Qi,d as je,p as Ci}from"./chunk-FODLDLE2.js";import{a as c,b as vn,d as fu,e as Ni,f as Ay,g as Bi,i as xe}from"./chunk-YKXDMIHQ.js";var ri=vn(w=>{"use strict";function $e(l,t){var a=l.length;l.push(t);l:for(;0<a;){var u=a-1>>>1,n=l[u];if(0<yn(n,t))l[u]=t,l[a]=n,a=u;else break l}}c($e,"push");function wl(l){return l.length===0?null:l[0]}c(wl,"peek");function hn(l){if(l.length===0)return null;var t=l[0],a=l.pop();if(a!==t){l[0]=a;l:for(var u=0,n=l.length,e=n>>>1;u<e;){var f=2*(u+1)-1,i=l[f],m=f+1,d=l[m];if(0>yn(i,a))m<n&&0>yn(d,i)?(l[u]=d,l[m]=a,u=m):(l[u]=i,l[f]=a,u=f);else if(m<n&&0>yn(d,a))l[u]=d,l[m]=a,u=m;else break l}}return t}c(hn,"pop");function yn(l,t){var a=l.sortIndex-t.sortIndex;return a!==0?a:l.id-t.id}c(yn,"compare");w.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vi=performance,w.unstable_now=function(){return Vi.now()}):(We=Date,Li=We.now(),w.unstable_now=function(){return We.now()-Li});var Vi,We,Li,tt=[],Et=[],Ty=1,Ql=null,Sl=3,ke=!1,iu=!1,mu=!1,re=!1,Wi=typeof setTimeout=="function"?setTimeout:null,wi=typeof clearTimeout=="function"?clearTimeout:null,Ki=typeof setImmediate<"u"?setImmediate:null;function dn(l){for(var t=wl(Et);t!==null;){if(t.callback===null)hn(Et);else if(t.startTime<=l)hn(Et),t.sortIndex=t.expirationTime,$e(tt,t);else break;t=wl(Et)}}c(dn,"advanceTimers");function Ie(l){if(mu=!1,dn(l),!iu)if(wl(tt)!==null)iu=!0,oa||(oa=!0,ga());else{var t=wl(Et);t!==null&&Pe(Ie,t.startTime-l)}}c(Ie,"handleTimeout");var oa=!1,vu=-1,Fi=5,$i=-1;function ki(){return re?!0:!(w.unstable_now()-$i<Fi)}c(ki,"shouldYieldToHost");function we(){if(re=!1,oa){var l=w.unstable_now();$i=l;var t=!0;try{l:{iu=!1,mu&&(mu=!1,wi(vu),vu=-1),ke=!0;var a=Sl;try{t:{for(dn(l),Ql=wl(tt);Ql!==null&&!(Ql.expirationTime>l&&ki());){var u=Ql.callback;if(typeof u=="function"){Ql.callback=null,Sl=Ql.priorityLevel;var n=u(Ql.expirationTime<=l);if(l=w.unstable_now(),typeof n=="function"){Ql.callback=n,dn(l),t=!0;break t}Ql===wl(tt)&&hn(tt),dn(l)}else hn(tt);Ql=wl(tt)}if(Ql!==null)t=!0;else{var e=wl(Et);e!==null&&Pe(Ie,e.startTime-l),t=!1}}break l}finally{Ql=null,Sl=a,ke=!1}t=void 0}}finally{t?ga():oa=!1}}}c(we,"performWorkUntilDeadline");var ga;typeof Ki=="function"?ga=c(function(){Ki(we)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Fe=new MessageChannel,Ji=Fe.port2,Fe.port1.onmessage=we,ga=c(function(){Ji.postMessage(null)},"schedulePerformWorkUntilDeadline")):ga=c(function(){Wi(we,0)},"schedulePerformWorkUntilDeadline");var Fe,Ji;function Pe(l,t){vu=Wi(function(){l(w.unstable_now())},t)}c(Pe,"requestHostTimeout");w.unstable_IdlePriority=5;w.unstable_ImmediatePriority=1;w.unstable_LowPriority=4;w.unstable_NormalPriority=3;w.unstable_Profiling=null;w.unstable_UserBlockingPriority=2;w.unstable_cancelCallback=function(l){l.callback=null};w.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fi=0<l?Math.floor(1e3/l):5};w.unstable_getCurrentPriorityLevel=function(){return Sl};w.unstable_next=function(l){switch(Sl){case 1:case 2:case 3:var t=3;break;default:t=Sl}var a=Sl;Sl=t;try{return l()}finally{Sl=a}};w.unstable_requestPaint=function(){re=!0};w.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var a=Sl;Sl=l;try{return t()}finally{Sl=a}};w.unstable_scheduleCallback=function(l,t,a){var u=w.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?u+a:u):a=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,l={id:Ty++,callback:t,priorityLevel:l,startTime:a,expirationTime:n,sortIndex:-1},a>u?(l.sortIndex=a,$e(Et,l),wl(tt)===null&&l===wl(Et)&&(mu?(wi(vu),vu=-1):mu=!0,Pe(Ie,a-u))):(l.sortIndex=n,$e(tt,l),iu||ke||(iu=!0,oa||(oa=!0,ga()))),l};w.unstable_shouldYield=ki;w.unstable_wrapCallback=function(l){var t=Sl;return function(){var a=Sl;Sl=t;try{return l.apply(this,arguments)}finally{Sl=a}}}});var Pi=vn((e2,Ii)=>{"use strict";Ii.exports=ri()});var yy=vn(Re=>{"use strict";var el=Pi(),U1=Ni(),Ey=zy();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}c(z,"formatProdErrorMessage");function D1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}c(D1,"isValidContainer");function ku(l){var t=l,a=l;if(l.alternate)for(;t.return;)t=t.return;else{l=t;do t=l,(t.flags&4098)!==0&&(a=t.return),l=t.return;while(l)}return t.tag===3?a:null}c(ku,"getNearestMountedFiber");function _1(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(_1,"getSuspenseInstanceFromFiber");function N1(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(N1,"getActivityInstanceFromFiber");function l0(l){if(ku(l)!==l)throw Error(z(188))}c(l0,"assertIsMounted");function My(l){var t=l.alternate;if(!t){if(t=ku(l),t===null)throw Error(z(188));return t!==l?null:l}for(var a=l,u=t;;){var n=a.return;if(n===null)break;var e=n.alternate;if(e===null){if(u=n.return,u!==null){a=u;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===a)return l0(n),l;if(e===u)return l0(n),t;e=e.sibling}throw Error(z(188))}if(a.return!==u.return)a=n,u=e;else{for(var f=!1,i=n.child;i;){if(i===a){f=!0,a=n,u=e;break}if(i===u){f=!0,u=n,a=e;break}i=i.sibling}if(!f){for(i=e.child;i;){if(i===a){f=!0,a=e,u=n;break}if(i===u){f=!0,u=e,a=n;break}i=i.sibling}if(!f)throw Error(z(189))}}if(a.alternate!==u)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?l:t}c(My,"findCurrentFiberUsingSlowPath");function H1(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=H1(l),t!==null)return t;l=l.sibling}return null}c(H1,"findCurrentHostFiberImpl");var W=Object.assign,Oy=Symbol.for("react.element"),Sn=Symbol.for("react.transitional.element"),su=Symbol.for("react.portal"),Ea=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Cc=Symbol.for("react.activity"),Uy=Symbol.for("react.memo_cache_sentinel"),t0=Symbol.iterator;function yu(l){return l===null||typeof l!="object"?null:(l=t0&&l[t0]||l["@@iterator"],typeof l=="function"?l:null)}c(yu,"getIteratorFn");var Dy=Symbol.for("react.client.reference");function pc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Dy?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Ea:return"Fragment";case Qc:return"Profiler";case B1:return"StrictMode";case Xc:return"Suspense";case Gc:return"SuspenseList";case Cc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case su:return"Portal";case mt:return l.displayName||"Context";case q1:return(l._context.displayName||"Context")+".Consumer";case Hf:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bf:return t=l.displayName||null,t!==null?t:pc(l.type)||"Memo";case Mt:t=l._payload,l=l._init;try{return pc(l(t))}catch{}}return null}c(pc,"getComponentNameFromType");var zu=Array.isArray,D=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Ey.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Rc=[],Ma=-1;function Il(l){return{current:l}}c(Il,"createCursor");function il(l){0>Ma||(l.current=Rc[Ma],Rc[Ma]=null,Ma--)}c(il,"pop");function L(l,t){Ma++,Rc[Ma]=l.current,l.current=t}c(L,"push");var rl=Il(null),Cu=Il(null),Xt=Il(null),wn=Il(null);function Fn(l,t){switch(L(Xt,t),L(Cu,l),L(rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?i1(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=i1(t),l=rv(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}il(rl),L(rl,l)}c(Fn,"pushHostContainer");function ja(){il(rl),il(Cu),il(Xt)}c(ja,"popHostContainer");function Zc(l){l.memoizedState!==null&&L(wn,l);var t=rl.current,a=rv(t,l.type);t!==a&&(L(Cu,l),L(rl,a))}c(Zc,"pushHostContext");function $n(l){Cu.current===l&&(il(rl),il(Cu)),wn.current===l&&(il(wn),wu._currentValue=la)}c($n,"popHostContext");var lc,a0;function kt(l){if(lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lc=t&&t[1]||"",a0=-1<a.stack.indexOf(`
1
+ import{a as Yi,b as Ve,c as Ri,d as Je,e as Zi,f as xi,k as ji}from"./chunk-Q5R67CRQ.js";import"./chunk-Q4CAKBWN.js";import"./chunk-VWLX4CH4.js";import"./chunk-RLLKECZT.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import{a as pi}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import"./chunk-5WJXVZMZ.js";import"./chunk-EVTM6Q43.js";import"./chunk-K7AJEMKE.js";import"./chunk-6D6Z2KXU.js";import{a as Le}from"./chunk-OKG3HWSJ.js";import{W as Xi}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import{a as zy}from"./chunk-4L4WTGN5.js";import{a as Gi}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as Ke}from"./chunk-AMPB3H6K.js";import"./chunk-35DM4JJG.js";import"./chunk-4ZEL6BYL.js";import"./chunk-5G2MAI3G.js";import{a as Hi,e as qi}from"./chunk-SZSHO6RE.js";import"./chunk-FSRSK4LY.js";import{d as _i}from"./chunk-CEA2QYAI.js";import"./chunk-FKVZRPV5.js";import"./chunk-WUWBZPUK.js";import{a as Qi,d as je,p as Ci}from"./chunk-FODLDLE2.js";import{a as c,b as vn,d as fu,e as Ni,f as Ay,g as Bi,i as xe}from"./chunk-YKXDMIHQ.js";var ri=vn(w=>{"use strict";function $e(l,t){var a=l.length;l.push(t);l:for(;0<a;){var u=a-1>>>1,n=l[u];if(0<yn(n,t))l[u]=t,l[a]=n,a=u;else break l}}c($e,"push");function wl(l){return l.length===0?null:l[0]}c(wl,"peek");function hn(l){if(l.length===0)return null;var t=l[0],a=l.pop();if(a!==t){l[0]=a;l:for(var u=0,n=l.length,e=n>>>1;u<e;){var f=2*(u+1)-1,i=l[f],m=f+1,d=l[m];if(0>yn(i,a))m<n&&0>yn(d,i)?(l[u]=d,l[m]=a,u=m):(l[u]=i,l[f]=a,u=f);else if(m<n&&0>yn(d,a))l[u]=d,l[m]=a,u=m;else break l}}return t}c(hn,"pop");function yn(l,t){var a=l.sortIndex-t.sortIndex;return a!==0?a:l.id-t.id}c(yn,"compare");w.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vi=performance,w.unstable_now=function(){return Vi.now()}):(We=Date,Li=We.now(),w.unstable_now=function(){return We.now()-Li});var Vi,We,Li,tt=[],Et=[],Ty=1,Ql=null,Sl=3,ke=!1,iu=!1,mu=!1,re=!1,Wi=typeof setTimeout=="function"?setTimeout:null,wi=typeof clearTimeout=="function"?clearTimeout:null,Ki=typeof setImmediate<"u"?setImmediate:null;function dn(l){for(var t=wl(Et);t!==null;){if(t.callback===null)hn(Et);else if(t.startTime<=l)hn(Et),t.sortIndex=t.expirationTime,$e(tt,t);else break;t=wl(Et)}}c(dn,"advanceTimers");function Ie(l){if(mu=!1,dn(l),!iu)if(wl(tt)!==null)iu=!0,oa||(oa=!0,ga());else{var t=wl(Et);t!==null&&Pe(Ie,t.startTime-l)}}c(Ie,"handleTimeout");var oa=!1,vu=-1,Fi=5,$i=-1;function ki(){return re?!0:!(w.unstable_now()-$i<Fi)}c(ki,"shouldYieldToHost");function we(){if(re=!1,oa){var l=w.unstable_now();$i=l;var t=!0;try{l:{iu=!1,mu&&(mu=!1,wi(vu),vu=-1),ke=!0;var a=Sl;try{t:{for(dn(l),Ql=wl(tt);Ql!==null&&!(Ql.expirationTime>l&&ki());){var u=Ql.callback;if(typeof u=="function"){Ql.callback=null,Sl=Ql.priorityLevel;var n=u(Ql.expirationTime<=l);if(l=w.unstable_now(),typeof n=="function"){Ql.callback=n,dn(l),t=!0;break t}Ql===wl(tt)&&hn(tt),dn(l)}else hn(tt);Ql=wl(tt)}if(Ql!==null)t=!0;else{var e=wl(Et);e!==null&&Pe(Ie,e.startTime-l),t=!1}}break l}finally{Ql=null,Sl=a,ke=!1}t=void 0}}finally{t?ga():oa=!1}}}c(we,"performWorkUntilDeadline");var ga;typeof Ki=="function"?ga=c(function(){Ki(we)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Fe=new MessageChannel,Ji=Fe.port2,Fe.port1.onmessage=we,ga=c(function(){Ji.postMessage(null)},"schedulePerformWorkUntilDeadline")):ga=c(function(){Wi(we,0)},"schedulePerformWorkUntilDeadline");var Fe,Ji;function Pe(l,t){vu=Wi(function(){l(w.unstable_now())},t)}c(Pe,"requestHostTimeout");w.unstable_IdlePriority=5;w.unstable_ImmediatePriority=1;w.unstable_LowPriority=4;w.unstable_NormalPriority=3;w.unstable_Profiling=null;w.unstable_UserBlockingPriority=2;w.unstable_cancelCallback=function(l){l.callback=null};w.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fi=0<l?Math.floor(1e3/l):5};w.unstable_getCurrentPriorityLevel=function(){return Sl};w.unstable_next=function(l){switch(Sl){case 1:case 2:case 3:var t=3;break;default:t=Sl}var a=Sl;Sl=t;try{return l()}finally{Sl=a}};w.unstable_requestPaint=function(){re=!0};w.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var a=Sl;Sl=l;try{return t()}finally{Sl=a}};w.unstable_scheduleCallback=function(l,t,a){var u=w.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?u+a:u):a=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,l={id:Ty++,callback:t,priorityLevel:l,startTime:a,expirationTime:n,sortIndex:-1},a>u?(l.sortIndex=a,$e(Et,l),wl(tt)===null&&l===wl(Et)&&(mu?(wi(vu),vu=-1):mu=!0,Pe(Ie,a-u))):(l.sortIndex=n,$e(tt,l),iu||ke||(iu=!0,oa||(oa=!0,ga()))),l};w.unstable_shouldYield=ki;w.unstable_wrapCallback=function(l){var t=Sl;return function(){var a=Sl;Sl=t;try{return l.apply(this,arguments)}finally{Sl=a}}}});var Pi=vn((e2,Ii)=>{"use strict";Ii.exports=ri()});var yy=vn(Re=>{"use strict";var el=Pi(),U1=Ni(),Ey=zy();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}c(z,"formatProdErrorMessage");function D1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}c(D1,"isValidContainer");function ku(l){var t=l,a=l;if(l.alternate)for(;t.return;)t=t.return;else{l=t;do t=l,(t.flags&4098)!==0&&(a=t.return),l=t.return;while(l)}return t.tag===3?a:null}c(ku,"getNearestMountedFiber");function _1(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(_1,"getSuspenseInstanceFromFiber");function N1(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(N1,"getActivityInstanceFromFiber");function l0(l){if(ku(l)!==l)throw Error(z(188))}c(l0,"assertIsMounted");function My(l){var t=l.alternate;if(!t){if(t=ku(l),t===null)throw Error(z(188));return t!==l?null:l}for(var a=l,u=t;;){var n=a.return;if(n===null)break;var e=n.alternate;if(e===null){if(u=n.return,u!==null){a=u;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===a)return l0(n),l;if(e===u)return l0(n),t;e=e.sibling}throw Error(z(188))}if(a.return!==u.return)a=n,u=e;else{for(var f=!1,i=n.child;i;){if(i===a){f=!0,a=n,u=e;break}if(i===u){f=!0,u=n,a=e;break}i=i.sibling}if(!f){for(i=e.child;i;){if(i===a){f=!0,a=e,u=n;break}if(i===u){f=!0,u=e,a=n;break}i=i.sibling}if(!f)throw Error(z(189))}}if(a.alternate!==u)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?l:t}c(My,"findCurrentFiberUsingSlowPath");function H1(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=H1(l),t!==null)return t;l=l.sibling}return null}c(H1,"findCurrentHostFiberImpl");var W=Object.assign,Oy=Symbol.for("react.element"),Sn=Symbol.for("react.transitional.element"),su=Symbol.for("react.portal"),Ea=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Cc=Symbol.for("react.activity"),Uy=Symbol.for("react.memo_cache_sentinel"),t0=Symbol.iterator;function yu(l){return l===null||typeof l!="object"?null:(l=t0&&l[t0]||l["@@iterator"],typeof l=="function"?l:null)}c(yu,"getIteratorFn");var Dy=Symbol.for("react.client.reference");function pc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Dy?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Ea:return"Fragment";case Qc:return"Profiler";case B1:return"StrictMode";case Xc:return"Suspense";case Gc:return"SuspenseList";case Cc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case su:return"Portal";case mt:return l.displayName||"Context";case q1:return(l._context.displayName||"Context")+".Consumer";case Hf:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bf:return t=l.displayName||null,t!==null?t:pc(l.type)||"Memo";case Mt:t=l._payload,l=l._init;try{return pc(l(t))}catch{}}return null}c(pc,"getComponentNameFromType");var zu=Array.isArray,D=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Ey.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Rc=[],Ma=-1;function Il(l){return{current:l}}c(Il,"createCursor");function il(l){0>Ma||(l.current=Rc[Ma],Rc[Ma]=null,Ma--)}c(il,"pop");function L(l,t){Ma++,Rc[Ma]=l.current,l.current=t}c(L,"push");var rl=Il(null),Cu=Il(null),Xt=Il(null),wn=Il(null);function Fn(l,t){switch(L(Xt,t),L(Cu,l),L(rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?i1(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=i1(t),l=rv(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}il(rl),L(rl,l)}c(Fn,"pushHostContainer");function ja(){il(rl),il(Cu),il(Xt)}c(ja,"popHostContainer");function Zc(l){l.memoizedState!==null&&L(wn,l);var t=rl.current,a=rv(t,l.type);t!==a&&(L(Cu,l),L(rl,a))}c(Zc,"pushHostContext");function $n(l){Cu.current===l&&(il(rl),il(Cu)),wn.current===l&&(il(wn),wu._currentValue=la)}c($n,"popHostContext");var lc,a0;function kt(l){if(lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lc=t&&t[1]||"",a0=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+lc+l+a0}c(kt,"describeBuiltInComponentFrame");var tc=!1;function ac(l,t){if(!l||tc)return"";tc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:c(function(){try{if(t){var b=c(function(){throw Error()},"Fake");if(Object.defineProperty(b.prototype,"props",{set:c(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(g){var S=g}Reflect.construct(l,[],b)}else{try{b.call()}catch(g){S=g}l.call(b.prototype)}}else{try{throw Error()}catch(g){S=g}(b=l())&&typeof b.catch=="function"&&b.catch(function(){})}}catch(g){if(g&&S&&typeof g.stack=="string")return[g.stack,S.stack]}return[null,null]},"DetermineComponentFrameRoot")};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var e=u.DetermineComponentFrameRoot(),f=e[0],i=e[1];if(f&&i){var m=f.split(`
4
4
  `),d=i.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/studio",
3
- "version": "1.0.0-alpha.183",
3
+ "version": "1.0.0-alpha.185",
4
4
  "description": "The Lunora Studio: a local admin UI for your schema, data, logs, and advisors",
5
5
  "keywords": [
6
6
  "admin-ui",
@@ -58,11 +58,11 @@
58
58
  "@hugeicons/react": "^1.1.10",
59
59
  "@lingui/core": "^6.6.0",
60
60
  "@lingui/message-utils": "^6.6.0",
61
- "@lunora/advisor": "1.0.0-alpha.135",
62
- "@lunora/bindings": "1.0.0-alpha.60",
63
- "@lunora/client": "1.0.0-alpha.106",
64
- "@lunora/errors": "1.0.0-alpha.36",
65
- "@lunora/react": "1.0.0-alpha.111",
61
+ "@lunora/advisor": "1.0.0-alpha.137",
62
+ "@lunora/bindings": "1.0.0-alpha.62",
63
+ "@lunora/client": "1.0.0-alpha.108",
64
+ "@lunora/errors": "1.0.0-alpha.38",
65
+ "@lunora/react": "1.0.0-alpha.113",
66
66
  "@tanstack/react-query": "5.101.4",
67
67
  "@tanstack/react-router": "^1.170.32",
68
68
  "@tanstack/react-table": "^9.2.4",
@@ -1,15 +0,0 @@
1
- import{a}from"./chunk-YKXDMIHQ.js";var r="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",_=/string or blob too big/iu,l={BAD_REQUEST:{status:400,title:"Bad request"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},CONFLICT:{hint:["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],status:409,title:"Conflict"},NOT_UNIQUE:{hint:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{hint:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},RUN_KIND_FORBIDDEN:{status:500,title:"Function kind may not be composed from a query"},TRANSACTION_LIMIT_EXCEEDED:{hint:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class."],status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},SHARD_TIMEOUT:{status:504,title:"Shard timeout"},SHARD_HTTP_ERROR:{status:502,title:"Shard HTTP error"},SUBSCRIPTION_PERSIST_FAILED:{status:500,title:"Subscription persist failed"},TOO_MANY_SUBSCRIPTIONS:{status:429,title:"Too many subscriptions"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},EMAIL_DOMAIN_BLOCKED:{hint:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` to `emailGate(...)` (`@lunora/auth/email-guard`)."],status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{hint:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_ERROR:{status:502,title:"Analytics Engine SQL API error"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},CONFIG_INVALID:{internal:!0,status:500,title:"Payment configuration invalid"},CURRENCY_MISMATCH:{status:400,title:"Currency mismatch"},PROVIDER_ERROR:{status:502,title:"Payment provider error"},WEBHOOK_EVENT_ID_MISSING:{status:400,title:"Webhook event id missing"},WEBHOOK_SIGNATURE_INVALID:{status:400,title:"Webhook signature invalid"},WEBHOOK_TIMESTAMP_INVALID:{status:400,title:"Webhook timestamp outside tolerance"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_MIGRATOR_UNSUPPORTED:{hint:["better-auth migrates only through its Kysely adapter, so `ensureMigrated` / `compileMigrationsSql` need the raw D1 binding as `database` \u2014 a custom adapter (`lunoraD1Adapter`, `lunoraAuthAdapter`, `lunoraDoAdapter`) cannot be migrated through, and neither can an absent `database`.","","Build a SECOND, migration-only instance over the raw binding \u2014 `createAuth({ ...options, database: env.DB })` \u2014 and hand that one to `ensureMigrated`. Keep the adapter on the instance that serves requests: the adapter exists to dodge a dev-runner hang in `$context`, which the migration instance never resolves.","","To compile the SQL off-platform (`compileMigrationsSql`), diff against an empty local database \u2014 `new DatabaseSync(':memory:')` from `node:sqlite` \u2014 rather than passing no `database` at all."],status:500,title:"Auth migrator cannot drive the configured database"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{hint:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{hint:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{hint:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{hint:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},RAG_DIMENSION_MISMATCH:{hint:["A stored vector and the query embedding have different widths, so they cannot be compared.","","This is what changing a RAG index's `embeddingModel` (or a provider's `dimensions` option) without reindexing looks like. Either put the previous model back, or reindex the namespace under the new one \u2014 bump `embeddingModelVersion` so the index rebuilds instead of mixing widths."],status:409,title:"Embedding dimension mismatch"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_BINDING:{status:500,title:"Duplicate agent binding"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},DISPATCH_UNAUTHENTICATED:{hint:"The scheduler could not authenticate to the worker. Check that `LUNORA_SCHEDULER_SECRET` matches on both sides, or that `LUNORA_ADMIN_TOKEN` is set and current.",status:403,title:"Dispatch caller not authenticated"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},GLOBAL_SEARCH_SCORES_UNSUPPORTED:{status:400,title:"collectWithScores() is unsupported on a global table"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},INVALID_SCHEDULE_ID:{status:400,title:"Invalid schedule id"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SEARCH_INDEX_BUILDING:{status:503,title:"Search index is still building"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_MEMORY_TABLE:{status:400,title:"Shape over a memory table is unsupported"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},WIRE_DECODE_FAILED:{status:502,title:"Could not decode a server frame"},WIRE_ENCODE_FAILED:{status:500,title:"Could not encode a return value"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},CDC_LOG_TRIMMED:{status:409,title:"CDC log trimmed"},CDC_PAYLOAD_COMPACTED:{status:409,title:"CDC payloads compacted"},EXPIRED:{status:404,title:"Session expired"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SHAPE_REQUIRES_CDC:{status:409,title:"Shape requires change-data-capture"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},STREAM_ID_IN_USE:{status:409,title:"Stream id already in use"},STREAM_INTERRUPTED:{status:503,title:"Durable stream interrupted"},STREAM_TOO_LONG:{status:507,title:"Durable stream exceeded its chunk ceiling"},TOKEN_EXPIRED:{status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},RELAY_SHAPE_UNROUTABLE:{status:500,title:"Relay shape unroutable"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"},LOCAL_DEPENDENCY_MISSING:{hint:["The command Lunora tried to run is not on your PATH, so nothing ran.","","Install it (or put it on PATH) and retry \u2014 `wrangler` ships as a dependency of a Lunora app, so `pnpm install` usually fixes that one; `git` and `docker` are installed separately."],status:500,title:"Required local tool not found"}},c=a(t=>Object.hasOwn(l,t)?l[t]:void 0,"h");var E=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
2
- `),header:"Row too large for the storage engine",id:"lunora-row-too-big",test:a(t=>_.test(t),"test")},{body:["Lunora codegen couldn't find a schema to generate from.","","Create `lunora/schema.ts` exporting a `defineSchema(...)` call:","","```ts",'import { defineSchema, defineTable, v } from "@lunora/server";',"","export default defineSchema({"," messages: defineTable({ body: v.string() }),","});","```","","Or run `lunora init` to scaffold Lunora (a sample `lunora/schema.ts` included) into your app."].join(`
3
- `),header:"No Lunora schema found",id:"lunora-schema-missing",test:a(t=>t.includes("defineSchema() not found")||t.includes("schema.ts not found at"),"test")},{body:["`defineSchema(...)` must be called with an **inline object literal** mapping table names to `defineTable(...)`:","","```ts","export default defineSchema({"," todos: defineTable({ title: v.string(), done: v.boolean() }),","});","```","","Codegen reads the schema statically, so it can't follow a variable or a spread \u2014 pass the object literal directly."].join(`
4
- `),header:"`defineSchema()` needs an inline object literal",id:"lunora-schema-not-object-literal",test:a(t=>t.includes("defineSchema() expects an object literal"),"test")},{body:["This table name collides with a built-in `ctx.db` member, so the generated client can't expose it.","","Rename the table to anything that isn't a reserved name (the error lists them) \u2014 e.g. `userAccounts` instead of `insert`."].join(`
5
- `),header:"Table name is reserved",id:"lunora-table-reserved",test:a(t=>t.includes("is reserved")&&t.includes("ctx.db"),"test")},{body:["Two tables resolve to the same name \u2014 usually a base table and a schema **extension** both defining it.","","Rename one of them, or drop the duplicate from the extension. Each table name must be unique across `defineSchema(...)` and every `.extend(...)`."].join(`
6
- `),header:"Duplicate table name",id:"lunora-table-duplicate",test:a(t=>t.includes("already exists")&&t.includes(".extend("),"test")},{body:['`.jurisdiction(...)` accepts only a **string literal** of `"eu"`, `"us"`, or `"fedramp"`:',"","```ts",'defineSchema({ /* \u2026 */ }).jurisdiction("eu");',"```"].join(`
7
- `),header:"Invalid `.jurisdiction(...)` value",id:"lunora-jurisdiction",test:a(t=>t.includes("unknown jurisdiction")||t.includes("jurisdiction")&&t.includes('"eu", "us", or "fedramp"'),"test")},{body:["The `unique` flag on an index must be a **literal** `true` or `false`, not a computed value \u2014 codegen needs to read it statically:","","```ts",'defineTable({ email: v.string() }).index("by_email", ["email"], { unique: true });',"```"].join(`
8
- `),header:"`unique` must be a literal",id:"lunora-unique-literal",test:a(t=>t.includes("must be a literal")&&t.includes("unique"),"test")},{body:["A declared container/workflow class isn't re-exported by your worker entry, so `wrangler deploy` would reject it.","","Add the generated re-export shown in the error to your worker entry (e.g. `src/index.ts`):","","```ts",'export * from "./lunora/_generated/containers";',"```"].join(`
9
- `),header:"Binding not exported by your worker entry",id:"lunora-worker-entry-export-gap",test:a(t=>t.includes("not exported by your worker entry"),"test")},{body:["A row with the same value already exists in a `unique` index.","","- If you meant to upsert, use `ctx.db.<table>().upsert(...)` (or `.patch(...)` an existing row) instead of `.insert(...)`.",`- Otherwise pick a value that isn't already taken, and consider surfacing a friendly "already exists" message to the user.`].join(`
10
- `),header:"Unique constraint violation",id:"lunora-runtime-unique",test:a(t=>t.includes("unique constraint violation on"),"test")},{body:l.CONFLICT.hint.join(`
11
- `),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:a(t=>t.includes("optimistic concurrency conflict"),"test")}],d=[{causes:"the origin returned an empty, unknown, or malformed response Cloudflare couldn't interpret (often an origin crash or an oversized response header)",code:"520",docsUrl:r,family:"5xx",fix:"check your origin's logs for a crash, ensure it returns a valid HTTP response, and keep response headers under the size limit",summary:"Cloudflare got an unknown/empty response from your origin web server.",title:"Web server returns an unknown error"},{causes:"the origin refused the connection \u2014 the web server is down, or a firewall is blocking Cloudflare's IP ranges",code:"521",docsUrl:r,family:"5xx",fix:"confirm the origin process is running and allowlist Cloudflare's published IP ranges in your firewall/security groups",summary:"Cloudflare could not connect to your origin because it refused the connection.",title:"Web server is down"},{causes:"Cloudflare could not establish a TCP connection to the origin in time \u2014 the origin is overloaded, a firewall is dropping packets, or the origin IP is wrong",code:"522",docsUrl:r,family:"5xx",fix:"verify the origin is reachable and not overloaded, and that the DNS record points at the correct origin IP",summary:"The connection to your origin timed out before it was established.",title:"Connection timed out"},{causes:"Cloudflare cannot route to the origin at all \u2014 a bad DNS record, an origin IP that changed, or invalid routing",code:"523",docsUrl:r,family:"5xx",fix:"verify the DNS A/AAAA record points at a reachable origin IP and that no upstream network is blocking Cloudflare",summary:"Cloudflare could not reach your origin server.",title:"Origin is unreachable"},{causes:"Cloudflare made a TCP connection but the origin did not return an HTTP response within 100 seconds \u2014 a slow handler or long-running request",code:"524",docsUrl:r,family:"5xx",fix:"speed up the slow origin handler, or move long work off the request path into a background job (a Durable Object, Queue, or Workflow)",summary:"Cloudflare connected to your origin but it did not respond in time.",title:"A timeout occurred"},{causes:"the TLS handshake between Cloudflare and the origin failed \u2014 a missing/invalid origin certificate, or a cipher/SNI mismatch under Full (Strict) SSL",code:"525",docsUrl:r,family:"5xx",fix:"install a valid certificate on the origin and align your Cloudflare SSL/TLS mode with the origin's certificate setup",summary:"The SSL handshake with your origin failed.",title:"SSL handshake failed"},{causes:"Cloudflare could not validate the origin's certificate under Full (Strict) SSL \u2014 it is expired, self-signed, or issued for the wrong hostname",code:"526",docsUrl:r,family:"5xx",fix:"install a valid, publicly-trusted certificate on the origin (or use a Cloudflare Origin CA cert), matching the request hostname",summary:"Cloudflare could not validate your origin's SSL certificate.",title:"Invalid SSL certificate"},{causes:"a DNS record points at a Cloudflare IP or another prohibited address instead of your real origin",code:"1000",docsUrl:n,family:"1xxx",fix:"point the DNS record at your real origin IP, not a Cloudflare-owned or loopback address",summary:"DNS points to a prohibited IP.",title:"DNS points to prohibited IP"},{causes:"Cloudflare could not resolve the requested hostname \u2014 a Worker fetched an unresolvable host, or a DNS record is misconfigured",code:"1001",docsUrl:n,family:"1xxx",fix:"check the hostname you're requesting and the DNS records for the zone resolve to a valid origin",summary:"Cloudflare could not resolve the origin DNS.",title:"DNS resolution error"},{causes:"a Worker or DNS record targets a restricted IP (for example a Cloudflare-owned or loopback address)",code:"1002",docsUrl:n,family:"1xxx",fix:"change the Worker fetch target or DNS record to a valid, non-restricted origin address",summary:"DNS points to a prohibited IP (Worker/restricted).",title:"DNS points to a prohibited IP"},{causes:"the visitor's IP was blocked by an IP Access Rule, WAF rule, or security configuration on the zone",code:"1006",docsUrl:n,family:"1xxx",fix:"review the zone's Firewall/WAF and IP Access Rules to see why the address was banned, and adjust if it was blocked in error",summary:"Access denied: the visitor's IP has been banned.",title:"Access denied: your IP has been banned"},{causes:"your Worker threw an unhandled JavaScript exception during the request",code:"1101",docsUrl:n,family:"1xxx",fix:"reproduce with `wrangler tail` (or the Workers Logs / Studio Logs panel) to get the stack trace, then handle the throwing code path",summary:"A Worker threw a JavaScript exception.",title:"Worker threw a JavaScript exception"},{causes:"the Worker used more CPU time than a single invocation is allowed \u2014 usually a hot loop or heavy synchronous work",code:"1102",docsUrl:n,family:"1xxx",fix:"reduce per-request CPU (optimize hot loops, avoid heavy synchronous work) or offload the heavy work to a Durable Object, Queue, or Workflow",summary:"A Worker exceeded its CPU-time resource limit.",title:"Worker exceeded resource limits"}],u=a(t=>t!==void 0&&t>="0"&&t<="9","l"),T=a((t,e)=>{for(let o=t.indexOf(e);o!==-1;o=t.indexOf(e,o+e.length))if(!u(t[o-1])&&!u(t[o+e.length]))return!0;return!1},"E"),g=a((t,e)=>{for(let o of[`error ${e}`,`error: ${e}`])for(let i=t.indexOf(o);i!==-1;i=t.indexOf(o,i+o.length))if(!u(t[i+o.length]))return!0;return!1},"f"),A=/error|cloudflare/iu,m=a(t=>({body:[t.summary,"",`**Likely cause:** ${t.causes}.`,"",`**Fix:** ${t.fix}.`,"",`See [Cloudflare's ${t.family} error docs](${t.docsUrl}).`].join(`
12
- `),header:`Cloudflare Error ${t.code}: ${t.title}`,id:`cloudflare-error-${t.code}`}),"c"),p=a(t=>{if(!A.test(t))return;let e=t.toLowerCase(),o=e.includes("error"),i=e.includes("cloudflare");if(o){for(let s of d)if(g(e,s.code))return m(s)}if(i){for(let s of d)if(T(e,s.code))return m(s)}},"T"),O=a(t=>(typeof t=="string"?t:t.join(`
13
- `)).split(`
14
- `).filter(e=>!e.startsWith("```")).join(`
15
- `).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"N"),f=a(t=>{for(let e of E)if(e.test(t))return{body:e.body,header:e.header,id:e.id}},"d"),N=a(t=>f(t)??p(t),"g");var h=class extends Error{static{a(this,"l")}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(e,o,i={}){let s=c(e);super(o??e,i.cause===void 0?void 0:{cause:i.cause}),this.name=i.name??"LunoraError",this.hint=i.hint??s?.hint,this.title=i.title??s?.title,this.loc=i.location,this.code=e,this.status=i.status??s?.status??500,this.docsUrl=i.docsUrl??s?.docsUrl,this.data=i.data}};export{l as a,O as b,N as c,h as d};