@lunora/studio 1.0.0-alpha.364 → 1.0.0-alpha.366

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 (129) hide show
  1. package/dist/index.d.mts +3 -3
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.d.mts +1 -1
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.mjs +1 -1
  7. package/dist/packem_chunks/kv-browser.mjs +1 -1
  8. package/dist/packem_chunks/schedule-panel.mjs +1 -1
  9. package/dist/packem_shared/{Studio-B89ZNMOD.mjs → Studio-wrwGcG7J.mjs} +1 -1
  10. package/dist/packem_shared/{StudioApp-C9l1a3A8.mjs → StudioApp-D1XLXXe_.mjs} +1 -1
  11. package/dist/packem_shared/{app.d-D425h1XO.d.mts → app.d-jC98McBG.d.mts} +7 -1
  12. package/dist/packem_shared/{app.d-D425h1XO.d.ts → app.d-jC98McBG.d.ts} +7 -1
  13. package/dist/packem_shared/studio-Cm9ea8j7.mjs +2 -0
  14. package/dist/standalone/{chunk-YFTPHGS2.js → chunk-26Z7L3NM.js} +1 -1
  15. package/dist/standalone/{chunk-JOPNP4EO.js → chunk-2AVOAV4Y.js} +1 -1
  16. package/dist/standalone/{chunk-7MLX5CGD.js → chunk-2TG6UMQG.js} +1 -1
  17. package/dist/standalone/{chunk-LSEUUZN4.js → chunk-36PLWIHK.js} +1 -1
  18. package/dist/standalone/{chunk-HBG6SSE2.js → chunk-3RDUIFQ2.js} +3 -3
  19. package/dist/standalone/{chunk-KH6OXCG3.js → chunk-3SKL6OEA.js} +1 -1
  20. package/dist/standalone/{chunk-GJXCPZDN.js → chunk-3U6JHRLU.js} +1 -1
  21. package/dist/standalone/{chunk-UPPNZ6MI.js → chunk-3ZGPXDJ4.js} +1 -1
  22. package/dist/standalone/{chunk-Z64BZNPS.js → chunk-43IIUGWM.js} +1 -1
  23. package/dist/standalone/{chunk-IG5VD7R7.js → chunk-4KMCJFHZ.js} +3 -3
  24. package/dist/standalone/{chunk-ALR4VAUE.js → chunk-5L4C6Z7K.js} +1 -1
  25. package/dist/standalone/{chunk-5RX5CQSU.js → chunk-6ONPEGTC.js} +2 -2
  26. package/dist/standalone/{chunk-ELSQ4FVH.js → chunk-7HUPWAKM.js} +1 -1
  27. package/dist/standalone/{chunk-VQDTA4P6.js → chunk-7MYNH4FV.js} +1 -1
  28. package/dist/standalone/{chunk-Y3IGTWUE.js → chunk-7OZPINI4.js} +1 -1
  29. package/dist/standalone/{chunk-UQA2AJGI.js → chunk-7TWHRQXV.js} +1 -1
  30. package/dist/standalone/{chunk-EPWCW2DF.js → chunk-ARYARX6T.js} +1 -1
  31. package/dist/standalone/{chunk-JD6PRRFO.js → chunk-BOBQQR2H.js} +1 -1
  32. package/dist/standalone/{chunk-FVCBNFQW.js → chunk-BTR2GIRT.js} +3 -3
  33. package/dist/standalone/{chunk-4N76XUNG.js → chunk-C4IDZOYU.js} +1 -1
  34. package/dist/standalone/{chunk-HZDLUAWS.js → chunk-CFHHIEAK.js} +1 -1
  35. package/dist/standalone/{chunk-UZ2ZXB74.js → chunk-CSLKRY64.js} +1 -1
  36. package/dist/standalone/{chunk-UVG3ZISC.js → chunk-D6NAWS5P.js} +1 -1
  37. package/dist/standalone/{chunk-TKBTZX4K.js → chunk-DHXZI632.js} +1 -1
  38. package/dist/standalone/{chunk-2H6VLY2M.js → chunk-E2P5QCPC.js} +1 -1
  39. package/dist/standalone/{chunk-YEXTJUKQ.js → chunk-ESSPRXXR.js} +1 -1
  40. package/dist/standalone/{chunk-I3SSF2T6.js → chunk-F2GUD4BL.js} +2 -2
  41. package/dist/standalone/chunk-FCR7GOAE.js +1 -0
  42. package/dist/standalone/{chunk-I5QX75DE.js → chunk-FWCWPMMH.js} +1 -1
  43. package/dist/standalone/{chunk-5Z2U4KBN.js → chunk-GBL62M7L.js} +1 -1
  44. package/dist/standalone/chunk-GWRXYNN4.js +1 -0
  45. package/dist/standalone/{chunk-DZFXH55R.js → chunk-GYZWBIV5.js} +1 -1
  46. package/dist/standalone/{chunk-66BMMNUR.js → chunk-GZWXXJKZ.js} +1 -1
  47. package/dist/standalone/{chunk-UTQLJKHH.js → chunk-HDC7PCKE.js} +1 -1
  48. package/dist/standalone/{chunk-OWRKSQPE.js → chunk-HFBSWKJS.js} +1 -1
  49. package/dist/standalone/{chunk-SR6CPTRT.js → chunk-HPY26HUU.js} +1 -1
  50. package/dist/standalone/{chunk-UXBNXITB.js → chunk-HYTBZYDH.js} +1 -1
  51. package/dist/standalone/{chunk-YEVTA35E.js → chunk-HZK2UJ3K.js} +1 -1
  52. package/dist/standalone/{chunk-H5TMLWIS.js → chunk-IDEFXN4C.js} +1 -1
  53. package/dist/standalone/{chunk-LDHJRHPZ.js → chunk-IOU52UNN.js} +1 -1
  54. package/dist/standalone/{chunk-Z6VILGGP.js → chunk-ISN26NX7.js} +1 -1
  55. package/dist/standalone/{chunk-SDDEOSQB.js → chunk-IV35MWJJ.js} +1 -1
  56. package/dist/standalone/{chunk-ZOKSVUID.js → chunk-IXPMM6KT.js} +1 -1
  57. package/dist/standalone/{chunk-53XKGQEE.js → chunk-JBGSBRHU.js} +1 -1
  58. package/dist/standalone/{chunk-CKEQX655.js → chunk-JMZT3CEW.js} +1 -1
  59. package/dist/standalone/{chunk-AZIKM5BA.js → chunk-JUCO5WUV.js} +1 -1
  60. package/dist/standalone/chunk-KTK4NDWQ.js +1 -0
  61. package/dist/standalone/chunk-KXDEQH47.js +1 -0
  62. package/dist/standalone/{chunk-ZBOB33BA.js → chunk-LA3JZW4O.js} +1 -1
  63. package/dist/standalone/{chunk-HSF2DCJ2.js → chunk-LYJGUYBX.js} +1 -1
  64. package/dist/standalone/{chunk-CP7QNLR4.js → chunk-M4KIEY3B.js} +1 -1
  65. package/dist/standalone/{chunk-XPFVUAPX.js → chunk-MW2MAWEQ.js} +1 -1
  66. package/dist/standalone/{chunk-H3EIPYRZ.js → chunk-MYIDM3IF.js} +1 -1
  67. package/dist/standalone/chunk-N5AFTHW5.js +7 -0
  68. package/dist/standalone/{chunk-MNYDT3RH.js → chunk-NEGISEDY.js} +1 -1
  69. package/dist/standalone/{chunk-7TQ7BZ67.js → chunk-NMBKSBYQ.js} +1 -1
  70. package/dist/standalone/{chunk-IHGRWY3Y.js → chunk-NMQDQNDF.js} +2 -2
  71. package/dist/standalone/{chunk-MXJTD2OX.js → chunk-NZMLDVDH.js} +1 -1
  72. package/dist/standalone/{chunk-MT4ICMXJ.js → chunk-OBVZIDIU.js} +1 -1
  73. package/dist/standalone/{chunk-ICHZ2IBL.js → chunk-OE33ZUC4.js} +1 -1
  74. package/dist/standalone/{chunk-HLHMHCXS.js → chunk-PAR27NLE.js} +1 -1
  75. package/dist/standalone/chunk-PNFIIVQG.js +1 -0
  76. package/dist/standalone/{chunk-PJUVJTDR.js → chunk-POXXBJ5G.js} +1 -1
  77. package/dist/standalone/{chunk-32V7XGNC.js → chunk-Q5RHT6OH.js} +1 -1
  78. package/dist/standalone/{chunk-J4PQAVOF.js → chunk-QB74D2O2.js} +1 -1
  79. package/dist/standalone/{chunk-5WNGRT7N.js → chunk-QH3HSOII.js} +1 -1
  80. package/dist/standalone/{chunk-WLHQ4FKC.js → chunk-QHEP3PHU.js} +1 -1
  81. package/dist/standalone/{chunk-Q3IA6HPX.js → chunk-QHMICJL5.js} +1 -1
  82. package/dist/standalone/{chunk-AD5J2ANS.js → chunk-R3JCGGD6.js} +1 -1
  83. package/dist/standalone/{chunk-3X3NXJBR.js → chunk-RWHCLTTR.js} +1 -1
  84. package/dist/standalone/{chunk-GNI37YCV.js → chunk-SGHIB7TS.js} +10 -10
  85. package/dist/standalone/{chunk-TEMI7MVE.js → chunk-SIMN2JMH.js} +1 -1
  86. package/dist/standalone/{chunk-Y64STA6O.js → chunk-TPWDY3VI.js} +1 -1
  87. package/dist/standalone/chunk-TQLJ6WS4.js +1 -0
  88. package/dist/standalone/{chunk-BBDTJG2K.js → chunk-TRYQANZO.js} +1 -1
  89. package/dist/standalone/{chunk-RBIVXSXT.js → chunk-TTD4VIKR.js} +1 -1
  90. package/dist/standalone/{chunk-BI6MZHZJ.js → chunk-TWVNHWE7.js} +1 -1
  91. package/dist/standalone/{chunk-OZAOWE7T.js → chunk-U7CBXP36.js} +1 -1
  92. package/dist/standalone/{chunk-NGZNXNRD.js → chunk-UBX5ZPLV.js} +1 -1
  93. package/dist/standalone/{chunk-BAEIW3YS.js → chunk-UJ6FKZC4.js} +1 -1
  94. package/dist/standalone/{chunk-SVQWZPO4.js → chunk-UKVSYL5L.js} +1 -1
  95. package/dist/standalone/{chunk-V3BE427M.js → chunk-UQHDIACF.js} +1 -1
  96. package/dist/standalone/{chunk-2SNHKJXK.js → chunk-VNH4OBJS.js} +1 -1
  97. package/dist/standalone/{chunk-AXE2SDRU.js → chunk-VOG262N5.js} +1 -1
  98. package/dist/standalone/chunk-VUOEJJUH.js +1 -0
  99. package/dist/standalone/{chunk-2NGKUO32.js → chunk-VW5JVONI.js} +1 -1
  100. package/dist/standalone/{chunk-DB6QX4X6.js → chunk-W3SIIBHR.js} +1 -1
  101. package/dist/standalone/{chunk-JVP3TR3A.js → chunk-WL3MWYDB.js} +1 -1
  102. package/dist/standalone/{chunk-D57B4MFK.js → chunk-WQWNIVVZ.js} +1 -1
  103. package/dist/standalone/{chunk-KKMQUBYH.js → chunk-WYNGYEZR.js} +1 -1
  104. package/dist/standalone/{chunk-OK2QU2EV.js → chunk-X3BATMFU.js} +1 -1
  105. package/dist/standalone/{chunk-W4LJQYCI.js → chunk-XBVE6NFA.js} +1 -1
  106. package/dist/standalone/{chunk-QKUVJIRX.js → chunk-XLCYVOJY.js} +1 -1
  107. package/dist/standalone/{chunk-P5EVJEGC.js → chunk-XLYFGUEF.js} +1 -1
  108. package/dist/standalone/{chunk-HGCOTYPV.js → chunk-XSWXBYQU.js} +1 -1
  109. package/dist/standalone/{chunk-GVQPNM3T.js → chunk-YAHEWRDC.js} +1 -1
  110. package/dist/standalone/{chunk-FHLODLBC.js → chunk-YESQLEOG.js} +1 -1
  111. package/dist/standalone/{chunk-FJLRSFTE.js → chunk-YM3HTXWH.js} +1 -1
  112. package/dist/standalone/{chunk-4L55URI5.js → chunk-YPMRBJDE.js} +1 -1
  113. package/dist/standalone/{chunk-T3ZCW3RG.js → chunk-YUVGMKHG.js} +1 -1
  114. package/dist/standalone/{chunk-QNM2J7MG.js → chunk-ZH7VXMDC.js} +1 -1
  115. package/dist/standalone/{chunk-5GYHGDIF.js → chunk-ZK24PPCD.js} +1 -1
  116. package/dist/standalone/{chunk-RCXNYW7P.js → chunk-ZMBRGW6J.js} +1 -1
  117. package/dist/standalone/{chunk-7QEZ2SFW.js → chunk-ZYXDE5GW.js} +1 -1
  118. package/dist/standalone/studio.js +2 -2
  119. package/dist/styles.css +1 -1
  120. package/package.json +5 -5
  121. package/dist/packem_shared/studio-gZfpz1wC.mjs +0 -2
  122. package/dist/standalone/chunk-5QUTVSHM.js +0 -1
  123. package/dist/standalone/chunk-75TRPM7O.js +0 -1
  124. package/dist/standalone/chunk-BCUOQNI2.js +0 -1
  125. package/dist/standalone/chunk-HC2B7SXW.js +0 -1
  126. package/dist/standalone/chunk-SHHGIT7M.js +0 -7
  127. package/dist/standalone/chunk-U5MPNEM2.js +0 -1
  128. package/dist/standalone/chunk-UD5REVU2.js +0 -1
  129. package/dist/standalone/chunk-ULQNADMJ.js +0 -1
@@ -1,8 +1,8 @@
1
- import{a as de,b as ue,c as me,d as fe,e as pe}from"./chunk-2H6VLY2M.js";import"./chunk-O3AZ7JKE.js";import{c as ce}from"./chunk-KH6OXCG3.js";import"./chunk-66BMMNUR.js";import{a as ae}from"./chunk-TKBTZX4K.js";import"./chunk-JD6PRRFO.js";import"./chunk-NGZNXNRD.js";import"./chunk-2SNHKJXK.js";import"./chunk-BCUOQNI2.js";import"./chunk-P5EVJEGC.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as se}from"./chunk-YEVTA35E.js";import{a as ie}from"./chunk-FHLODLBC.js";import{b as Y}from"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import{a as P}from"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import"./chunk-T3ZCW3RG.js";import{a as $}from"./chunk-2W4UO5BC.js";import{c as oe,d as le}from"./chunk-4N76XUNG.js";import{a as W,e as H}from"./chunk-OK2QU2EV.js";import{c as R,d as re,m as ne}from"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as U,b as D,h as K,i as F,j as q,s as z}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as Ae}from"./chunk-GWNGVKLG.js";import{a as Ke,b as Be}from"./chunk-6G3E4PJ2.js";import{a as i,d as Z}from"./chunk-5PEAXTYQ.js";var X=Z(Ae(),1);var j=Z(Ke(),1);var d=Z(Be(),1);var E=class extends Error{static{i(this,"_")}problem;constructor(e){super(e.kind),this.name="CsvFormatError",this.problem=e}},De="\uFEFF",Re=i(()=>{let t=[],e=1,r=!1,n=!1,o="start",l="",s=i(()=>{t.push(o==="closing"||l!==""?l:void 0),o="start",l=""},"i"),a=i(c=>{s(),t.some(m=>m!==void 0)&&c.push({cells:t,number:e}),t=[],e+=1},"l"),u=i((c,m)=>{let f=r;if(r=!1,!(f&&c===`
1
+ import{a as de,b as ue,c as me,d as fe,e as pe}from"./chunk-E2P5QCPC.js";import"./chunk-O3AZ7JKE.js";import{c as ce}from"./chunk-3SKL6OEA.js";import"./chunk-GZWXXJKZ.js";import{a as ae}from"./chunk-DHXZI632.js";import"./chunk-BOBQQR2H.js";import"./chunk-UBX5ZPLV.js";import"./chunk-VNH4OBJS.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as se}from"./chunk-YESQLEOG.js";import{b as Y}from"./chunk-3D67ZJRW.js";import{a as ie}from"./chunk-HZK2UJ3K.js";import"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as P}from"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import"./chunk-YUVGMKHG.js";import{a as $}from"./chunk-2W4UO5BC.js";import{c as oe,d as le}from"./chunk-C4IDZOYU.js";import{a as W,e as H}from"./chunk-X3BATMFU.js";import{c as R,d as re,m as ne}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as U,b as D,h as K,i as F,j as q,s as z}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as Ae}from"./chunk-GWNGVKLG.js";import{a as Ke,b as Be}from"./chunk-6G3E4PJ2.js";import{a as i,d as Z}from"./chunk-5PEAXTYQ.js";var X=Z(Ae(),1);var j=Z(Ke(),1);var d=Z(Be(),1);var E=class extends Error{static{i(this,"_")}problem;constructor(e){super(e.kind),this.name="CsvFormatError",this.problem=e}},De="\uFEFF",Re=i(()=>{let t=[],e=1,r=!1,n=!1,o="start",l="",s=i(()=>{t.push(o==="closing"||l!==""?l:void 0),o="start",l=""},"i"),a=i(c=>{s(),t.some(m=>m!==void 0)&&c.push({cells:t,number:e}),t=[],e+=1},"l"),u=i((c,m)=>{let f=r;if(r=!1,!(f&&c===`
2
2
  `)){if(o==="quoted"){c==='"'?o="closing":l+=c;return}if(o==="closing"&&c==='"'){l+=c,o="quoted";return}if(c===","){s();return}if(c==="\r"){a(m),r=!0;return}if(c===`
3
3
  `){a(m);return}if(o==="closing")throw new E({kind:"text-after-quote",record:e});if(o==="start"&&c==='"'){o="quoted";return}o="unquoted",l+=c}},"c");return{finish:i(()=>{if(o==="quoted")throw new E({kind:"unterminated-quote",record:e});let c=[];return a(c),c},"finish"),push:i(c=>{let m=[],f=0;for(!n&&c!==""&&(n=!0,f=c.startsWith(De)?1:0);f<c.length;f+=1)u(c.charAt(f),m);return m},"push")}},"De"),ye=i(async function*(t){let e=Re();for await(let r of t)yield*e.push(r);yield*e.finish()},"ie"),M=i((t,e,r)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0})},"$"),ve=i(t=>{let e=[],r=new Set;return t.forEach((n,o)=>{let l=(n??"").trim();if(l==="")throw new E({column:o+1,kind:"empty-header"});if(r.has(l))throw new E({kind:"duplicate-header",name:l});r.add(l),e.push(l)}),e},"le"),Ne=i(({cells:t,number:e},r,n)=>{if(t.length!==r.length)throw new E({expected:r.length,found:t.length,kind:"ragged",record:e});let o={};return r.forEach((l,s)=>{let a=t[s];a!==void 0?M(o,l,a):n.has(l)&&M(o,l,null)}),{doc:o,record:e}},"ae"),Ue=/^-?\d+$/u,Me=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/iu,Je=/^-?\d{11,}$/u,Ve=/^(\d{4})-(\d{2})-(\d{2})$/u,Ze=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})?$/u,ze=/\.(\d+)/u,Pe=/[1-9]/u,We=/^[+-]?(\d*)(?:\.(\d*))?(?:e([+-]?\d+))?$/iu,he=i(t=>{let[,e="",r="",n="0"]=We.exec(t)??[],o=`${e}${r}`,l=0,s=o.length;for(;l<s&&o.charAt(l)==="0";)l+=1;for(;s>l&&o.charAt(s-1)==="0";)s-=1;return l===s?{digits:"",exponent:0}:{digits:o.slice(l,s),exponent:Number(n)-r.length+(o.length-s)}},"ee"),He=i((t,e)=>{let r=he(t),n=he(e.toExponential());return r.digits===n.digits&&r.exponent===n.exponent?!0:r.digits!==""&&r.exponent>=0&&Number.isInteger(e)&&BigInt(r.digits)*10n**BigInt(r.exponent)===BigInt(Math.abs(e))},"Xe"),Ye=i(t=>{let e=t.trim();if(!Me.test(e))return;let r=Number(e);if(Number.isFinite(r))return He(e,r)?{number:r}:{inexact:!0}},"Ve"),Ge=i((t,e,r)=>{let n=new Date(0);return n.setUTCFullYear(t,e-1,r),n.getUTCMonth()===e-1&&n.getUTCDate()===r},"He"),Qe=i((t,e,r,n)=>Number(t)<=23&&Number(e)<=59&&Number(r)<=59&&(n==="Z"||Number(n.slice(1,3))<=23&&Number(n.slice(4,6))<=59),"We"),Xe=i(t=>{let[e="",r,...n]=t.split("T"),o=Ve.exec(e),l=r===void 0?void 0:Ze.exec(r);if(o===null||n.length>0||r!==void 0&&l===null)return;let[,s="",a="",u=""]=o;if(!Ge(Number(s),Number(a),Number(u)))return;let[,c="0",m="0",f="0",b]=l??[];if(!Qe(c,m,f,b??"Z"))return;let w=ze.exec(r??"")?.[1]??"";if(Pe.test(w.slice(3)))return;let x=Date.parse(l!==void 0&&b===void 0?`${t}Z`:t);return Number.isFinite(x)?x:void 0},"Je"),_e=i(t=>{let e=Ye(t);return e===void 0?{expected:"number",kind:"rejected"}:"number"in e?{kind:"ok",value:e.number}:{expected:"number",inexact:!0,kind:"rejected"}},"Ye"),et=i(t=>{let e=t.trim(),r=Xe(e);return r===void 0&&Je.test(e)&&(r=Number(e)),r===void 0||!Number.isFinite(new Date(r).getTime())?{expected:"date",kind:"rejected"}:{kind:"ok",value:r}},"Ze"),tt=i(t=>{try{return R(t),!0}catch{return!1}},"ze"),rt=i((t,e)=>{if(e==="bigint"){let r=t.trim();if(!Ue.test(r))return{expected:"bigint",kind:"rejected"};let n=BigInt(r);return tt(n)?{kind:"ok",value:n}:{expected:"bigint",kind:"rejected",tooLong:!0}}if(e==="boolean"){let r=t.trim().toLowerCase();return r==="true"||r==="false"?{kind:"ok",value:r==="true"}:{expected:"boolean",kind:"rejected"}}return e==="number"?_e(t):e==="date"||e==="timestamp"?et(t):{kind:"ok",value:t}},"Ge"),ke=i(({doc:t,record:e},r)=>{let n={};for(let[o,l]of Object.entries(t)){if(l===null){M(n,o,null);continue}let s=rt(l,r.get(o));if(s.kind==="rejected")throw new E({column:o,expected:s.expected,...s.inexact===!0&&{inexact:!0},kind:"cell-type",record:e,...s.tooLong===!0&&{tooLong:!0},value:l});M(n,o,s.value)}return{doc:n,record:e}},"ce"),nt=i(async function*(t,e,r){let n;for await(let o of ye(t))n===void 0?n=ve(o.cells):yield ke(Ne(o,n,r),e)},"Qe"),ot=i(t=>new Set(t.filter(e=>e.nullable===!0&&!e.optional).map(e=>e.name)),"et"),we=i(t=>{if(t instanceof E)return t;throw t},"te"),lt=i(async(t,e,r,n)=>{let o,l,s;for await(let u of ye(t)){if(o===void 0){try{o=ve(u.cells)}catch(m){l=we(m),o=[]}continue}let c;try{c=ke(Ne(u,o,r),e)}catch(m){s??=we(m);continue}n(c)}let a=l??s;if(a!==void 0)throw a},"tt"),it=K($.exportShard),G=K($.importShard),st=K($.listTables),at=K($.describeTable),ct={},dt=i(t=>t.map(e=>JSON.stringify(R(e))).join(`
4
4
  `),"it"),ut=i((t,e)=>{let r=t.trim();if(r==="")return;let n=re(JSON.parse(r));if(typeof n!="object"||n===null)throw new D("INTERNAL",`line ${e.toString()}: expected a { table, doc } object`);let o=n;if(typeof o.table!="string"||typeof o.doc!="object"||o.doc===null||Array.isArray(o.doc))throw new D("INTERNAL",`line ${e.toString()}: expected a { table, doc } object`);return o},"lt"),ge=1024*1024,_=i(async function*(t){let e=new TextDecoder("utf-8",{fatal:!0});for(let n=0;n<t.size;n+=ge){let o=await t.slice(n,n+ge).arrayBuffer();yield e.decode(o,{stream:!0})}let r=e.decode();r!==""&&(yield r)},"H"),mt=i(async function*(t){let e="",r=0;for await(let n of _(t)){let o=`${e}${n}`.split(`
5
5
  `);e=o.pop()??"";for(let l of o)r+=1,yield{line:l,lineNumber:r}}e!==""&&(yield{line:e,lineNumber:r+1})},"at"),ft=i(async function*(t){for await(let{line:e,lineNumber:r}of mt(t)){let n=ut(e,r);n!==void 0&&(yield{line:r,row:n})}},"ct"),pt=i(async function*(t,e,r,n){for await(let{doc:o,record:l}of nt(_(t),r,n))yield{line:l,row:{doc:o,table:e}}},"dt"),ht=i(async(t,e,r,n)=>{try{let{columns:o}=await t.query(at,{table:n},F(r));return{kinds:new Map(o.map(l=>[l.name,l.type])),nullOnEmpty:ot(o)}}catch(o){return{failure:e("Couldn't read the columns of {table}: {message}",{message:q(o),table:n})}}},"ut"),be=50,wt=500,J=9e5,ee=i(t=>new TextEncoder().encode(JSON.stringify(R(t))).byteLength,"W"),Q="application/x-ndjson",Te=i(t=>new D("INTERNAL",`line ${t.toString()}: a single row is over the ${J.toString()}-byte import limit`),"de"),gt=i(async t=>{let e=0;for await(let{line:r,row:n}of t){if(ee(n)>J)throw Te(r);e+=1}return e},"mt"),bt=i(async(t,e,r,n)=>{let o={rows:0};if(await lt(_(t),r,n,({doc:l,record:s})=>{o.rows+=1,o.wide===void 0&&ee({doc:l,table:e})>J&&(o.wide=s)}),o.wide!==void 0)throw Te(o.wide);return o.rows},"ht"),xe=i(async(t,e)=>{let r=[],n=0,o=0,l=0;for await(let{line:s,row:a}of t){let u=ee(a),c=s!==l+1;r.length>0&&(c||r.length===wt||n+u>J)&&(await e(r,o),r=[],n=0),r.length===0&&(o=s),r.push(a),n+=u,l=s}r.length>0&&await e(r,o)},"oe"),xt=/\.csv$/iu,yt=i(t=>xt.test(t.name)||t.type==="text/csv","wt"),vt=i((t,e)=>t.expected==="boolean"?e("line {line}: column \u201C{column}\u201D must be true or false, got \u201C{value}\u201D.",{column:t.column,line:t.record,value:t.value}):t.tooLong===!0?e("line {line}: column \u201C{column}\u201D holds an integer longer than the import can send.",{column:t.column,line:t.record}):t.expected==="bigint"?e("line {line}: column \u201C{column}\u201D must be an integer, got \u201C{value}\u201D.",{column:t.column,line:t.record,value:t.value}):t.expected==="date"?e("line {line}: column \u201C{column}\u201D must be an ISO-8601 date or epoch milliseconds of at least 11 digits, got \u201C{value}\u201D.",{column:t.column,line:t.record,value:t.value}):t.inexact===!0?e("line {line}: column \u201C{column}\u201D holds \u201C{value}\u201D, which a number column cannot store exactly. Store a whole number past 9007199254740991 in a bigint column.",{column:t.column,line:t.record,value:t.value}):e("line {line}: column \u201C{column}\u201D must be a number, got \u201C{value}\u201D.",{column:t.column,line:t.record,value:t.value}),"gt"),Nt=i((t,e)=>t.kind==="duplicate-header"?e("The header \u201C{name}\u201D appears more than once.",{name:t.name}):t.kind==="empty-header"?e("Header column {column} is empty.",{column:t.column}):t.kind==="ragged"?e("line {line}: expected {expected} cells, found {found}.",{expected:t.expected,found:t.found,line:t.record}):t.kind==="cell-type"?vt(t,e):t.kind==="text-after-quote"?e("line {line}: text follows a closing quote.",{line:t.record}):e("line {line}: a quoted field is never closed.",{line:t.record}),"xt"),kt=i((t,e,r)=>{let n=e instanceof E?Nt(e.problem,r):q(e);return t===null?r("Invalid NDJSON: {message}",{message:n}):r("Invalid CSV: {message}",{message:n})},"yt"),Tt=i(t=>{let e=(0,X.c)(31),{onChange:r,shardKey:n,value:o}=t,l=U(),s;e[0]!==n?(s={shardKey:n},e[0]=n,e[1]=s):s=e[1];let{data:a}=oe($.listTables,ct,s),u;e[2]!==r?(u=i(p=>{r(p??"")},"c"),e[2]=r,e[3]=u):u=e[3];let c;e[4]!==l?(c=l("Target table"),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==l?(m=l("Choose a table"),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==m?(f=(0,d.jsx)(ue,{placeholder:m}),e[8]=m,e[9]=f):f=e[9];let b;e[10]!==c||e[11]!==f?(b=(0,d.jsx)(me,{"aria-label":c,className:"w-56","data-testid":"ei-csv-table",children:f}),e[10]=c,e[11]=f,e[12]=b):b=e[12];let w;e[13]!==a?(w=a??[],e[13]=a,e[14]=w):w=e[14];let x;e[15]!==w?(x=w.map(jt),e[15]=w,e[16]=x):x=e[16];let g;e[17]!==x?(g=(0,d.jsx)(fe,{children:x}),e[17]=x,e[18]=g):g=e[18];let N;e[19]!==u||e[20]!==b||e[21]!==g||e[22]!==o?(N=(0,d.jsxs)(de,{onValueChange:u,value:o,children:[b,g]}),e[19]=u,e[20]=b,e[21]=g,e[22]=o,e[23]=N):N=e[23];let k;e[24]!==l?(k=l("CSV rows have no table column, so choose the table they go into."),e[24]=l,e[25]=k):k=e[25];let h;e[26]!==k?(h=(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:k}),e[26]=k,e[27]=h):h=e[27];let I;return e[28]!==N||e[29]!==h?(I=(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[N,h]}),e[28]=N,e[29]=h,e[30]=I):I=e[30],I},"vt"),Ce=i(t=>Object.values(t).reduce((e,r)=>e+r,0),"ue"),Ct=i(async(t,e,r,n,o,l,s)=>{let a={conflicts:0,errors:[],inserted:{},replaced:0},u,c=l===null?{kinds:new Map,nullOnEmpty:new Set}:await ht(t,e,r,l);if("failure"in c)return{failure:{message:c.failure,rows:0},total:a};let{kinds:m,nullOnEmpty:f}=c;try{if(l===null){let p=i(()=>ft(o),"m");u={rows:await gt(p()),source:p}}else u={rows:await bt(o,l,m,f),source:i(()=>pt(o,l,m,f),"source")}}catch(p){return{failure:{message:kt(l,p,e),rows:0},total:a}}let{rows:b,source:w}=u;if(l!==null&&b===0)return{failure:{message:e("The CSV has no data rows after the header."),rows:0},total:a};let x={conflicts:0,errors:[],inserted:{}};n(e("Checking {total} rows before writing\u2026",{total:b}));try{let p=await t.query(G,{dryRun:!0,onConflict:s,rows:[],startLine:1},F(r));if(p.dryRun!==!0)return{failure:{message:e("This shard predates import checks, so it would write the file while checking it. Nothing was sent. Update the app and import again."),rows:0},total:a};if(s==="replace"&&typeof p.replaced!="number")return{failure:{message:e("This shard cannot overwrite existing rows. Nothing was sent. Update the app and import again."),rows:0},total:a};await xe(w(),async(S,v)=>{let C=await t.query(G,{dryRun:!0,onConflict:s,rows:S,startLine:v},F(r));x.errors.push(...C.errors)})}catch(p){return{failure:{message:q(p),rows:0},total:a}}if(x.errors.length>0)return{failure:{message:e("Nothing was written, because some rows would be refused. Fix the rows listed below and import again."),rows:0},total:x};let g=0,N=1,k={},h={},I=i(async(p,S)=>{n(e("Importing rows {from}\u2013{to} of {total}\u2026",{from:g+1,to:g+p.length,total:b})),h.startLine=S;let v=await t.query(G,{dryRun:!1,onConflict:s,rows:p,startLine:S},F(r));h.startLine=void 0,a.conflicts+=v.conflicts,a.replaced=(a.replaced??0)+(v.replaced??0),a.errors.push(...v.errors);for(let[C,A]of Object.entries(v.inserted))a.inserted[C]=(a.inserted[C]??0)+A;if(g+=p.length,N=S+p.length,v.errors.length>0){let C=Ce(a.inserted)+(a.replaced??0);throw k.refused=!0,new Error(C===0?e("The shard refused {count} rows, so the rest of the file was not sent. Nothing was written. Fix the rows listed below and import again.",{count:v.errors.length}):e("The shard refused {count} rows, so the rest of the file was not sent. {written} rows were already written, so do not import the whole file again. Import the refused rows and any rows from line {line} onward, or delete the written rows first and then import the whole file.",{count:v.errors.length,line:S+p.length,written:C}))}},"T");try{return await xe(w(),I),{failure:void 0,total:a}}catch(p){return{failure:{message:q(p),nextLine:N,rows:g,unknownFrom:h.startLine,...k},total:a}}},"bt"),It=i(t=>{let e=(0,X.c)(14),{result:r}=t,n=U(),o;e[0]!==r.conflicts||e[1]!==r.errors.length||e[2]!==r.inserted||e[3]!==r.replaced||e[4]!==n?(o=n("Inserted {inserted}, replaced {replaced}, {conflicts} conflicts, {errors} errors.",{conflicts:r.conflicts,errors:r.errors.length,inserted:Ce(r.inserted),replaced:r.replaced??0}),e[0]=r.conflicts,e[1]=r.errors.length,e[2]=r.inserted,e[3]=r.replaced,e[4]=n,e[5]=o):o=e[5];let l;e[6]!==o?(l=(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:o}),e[6]=o,e[7]=l):l=e[7];let s;e[8]!==r.errors||e[9]!==n?(s=r.errors.length>0&&(0,d.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:r.errors.map(u=>(0,d.jsx)("li",{className:"text-xs text-destructive",children:n("line {line} ({table}): {message}",{line:u.line,message:u.message,table:u.table})},`${u.table}-${u.line.toString()}`))}),e[8]=r.errors,e[9]=n,e[10]=s):s=e[10];let a;return e[11]!==l||e[12]!==s?(a=(0,d.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[l,s]}),e[11]=l,e[12]=s,e[13]=a):a=e[13],a},"Nt"),Vt=i(({initialShardKey:t})=>{let e=ne(),r=le(),n=U(),[o,l]=(0,j.useState)(t??""),[s,a]=(0,j.useState)(null),[u,c]=(0,j.useState)(null),[m,f]=(0,j.useState)(!1),[b,w]=(0,j.useState)(null),[x,g]=(0,j.useState)(null),[N,k]=(0,j.useState)(null),[h,I]=(0,j.useState)(null),[p,S]=(0,j.useState)(!1),v=s!==null&&yt(s),C=u!==null&&u.shardKey===o?u.table:"",A=s!==null&&(!v||C!==""),Ie=i(async()=>{let T=o;f(!0),w(null),g(null),I(null);try{let O=await e.query(st,{},F(T)),y=new Blob([],{type:Q}),L=0,B=[];for(let{name:Oe}of O){let{rows:V}=await e.query(it,{tables:[Oe]},F(T));if(V.length===0)continue;let te=dt(V);y=new Blob([y,`${te}
6
6
  `],{type:Q}),L+=V.length,B.length<be&&B.push(...te.split(`
7
7
  `).slice(0,be-B.length))}Y(T),I({blob:y,count:L,preview:B.join(`
8
- `),shardKey:T})}catch(O){w(q(O))}},"fe"),je=i(async(T,O)=>{f(!0),w(null),g(null),I(null);let{failure:y,total:L}=await Ct(e,n,o,k,T,O,p?"replace":"skip");y===void 0?(Y(o),g(L)):y.unknownFrom===void 0&&(y.refused===!0||y.rows===0)?(L.errors.length>0&&g(L),w(y.message)):y.unknownFrom===void 0?(g(L),w(n("Import stopped after {rows} rows: {message}. The counts below cover those rows. Rows from line {line} onward were not sent: do not import the whole file again, import from that line onward, or delete the written rows first and then import the whole file.",{line:y.nextLine,message:y.message,rows:y.rows}))):(g(L),w(n("Import stopped after {rows} rows: {message}. The counts below cover completed chunks only. The chunk from line {line} may have written rows: check the table for rows from line {line} onward before importing again, or delete the written rows first and then import the whole file.",{line:y.unknownFrom,message:y.message,rows:y.rows}))),r($.readTablePage),r($.listTables)},"me"),Ee=i(()=>{z(Ie().finally(()=>{f(!1)}))},"he"),Se=i(()=>{s!==null&&A&&z(je(s,v?C:null).finally(()=>{k(null),f(!1)}))},"pe"),Le=i(()=>{h!==null&&ce(`${h.shardKey.trim()===""?"shard":h.shardKey.trim()}.ndjson`,h.blob,Q)},"we"),$e=i(T=>{a(T.target.files?.[0]??null),c(null)},"ge"),Fe=i(T=>{c({shardKey:o,table:T})},"xe"),qe=i(T=>{S(T.target.checked)},"ye");return(0,d.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,d.jsxs)(W,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[(0,d.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,d.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Export")})}),(0,d.jsxs)(H,{className:"flex flex-col gap-3 p-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(ie,{onChange:l,testId:"ei-shard-input",value:o}),(0,d.jsx)(P,{"data-testid":"ei-export",disabled:m,onClick:Ee,type:"button",children:n("Export")})]}),h!==null&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:n("Exported {count} rows.",{count:h.count})}),(0,d.jsx)(P,{"data-testid":"ei-download",onClick:Le,size:"sm",type:"button",variant:"outline",children:n("Download")})]}),h.preview!==""&&(0,d.jsx)("pre",{className:"max-h-60 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"ei-preview",children:h.preview})]})]})]}),(0,d.jsxs)(W,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[(0,d.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,d.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Import")})}),(0,d.jsxs)(H,{className:"flex flex-col gap-3 p-4",children:[(0,d.jsx)("input",{accept:".ndjson,.jsonl,.csv,application/x-ndjson,text/csv","aria-label":n("Import file"),className:"text-sm","data-testid":"ei-file",onChange:$e,type:"file"}),v&&(0,d.jsx)(Tt,{onChange:Fe,shardKey:o,value:C}),(0,d.jsxs)(ae,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"ei-replace",children:[(0,d.jsx)("input",{checked:p,className:"size-4 accent-primary","data-testid":"ei-replace",id:"ei-replace",onChange:qe,type:"checkbox"}),n("Overwrite rows whose _id already exists (otherwise they are left unchanged and counted as conflicts)")]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,d.jsx)(se,{confirmLabel:n("Import (writes rows)?"),disabled:m||!A,onConfirm:Se,testId:"ei-import",children:n("Import")})}),N!==null&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-progress",role:"status",children:N}),x!==null&&(0,d.jsx)(It,{result:x})]})]}),b!==null&&(0,d.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:b})]})},"Kt");function jt(t){return(0,d.jsx)(pe,{value:t.name,children:t.name},t.name)}i(jt,"Ct");export{Vt as ExportImportPanel};
8
+ `),shardKey:T})}catch(O){w(q(O))}},"fe"),je=i(async(T,O)=>{f(!0),w(null),g(null),I(null);let{failure:y,total:L}=await Ct(e,n,o,k,T,O,p?"replace":"skip");y===void 0?(Y(o),g(L)):y.unknownFrom===void 0&&(y.refused===!0||y.rows===0)?(L.errors.length>0&&g(L),w(y.message)):y.unknownFrom===void 0?(g(L),w(n("Import stopped after {rows} rows: {message}. The counts below cover those rows. Rows from line {line} onward were not sent: do not import the whole file again, import from that line onward, or delete the written rows first and then import the whole file.",{line:y.nextLine,message:y.message,rows:y.rows}))):(g(L),w(n("Import stopped after {rows} rows: {message}. The counts below cover completed chunks only. The chunk from line {line} may have written rows: check the table for rows from line {line} onward before importing again, or delete the written rows first and then import the whole file.",{line:y.unknownFrom,message:y.message,rows:y.rows}))),r($.readTablePage),r($.listTables)},"me"),Ee=i(()=>{z(Ie().finally(()=>{f(!1)}))},"he"),Se=i(()=>{s!==null&&A&&z(je(s,v?C:null).finally(()=>{k(null),f(!1)}))},"pe"),Le=i(()=>{h!==null&&ce(`${h.shardKey.trim()===""?"shard":h.shardKey.trim()}.ndjson`,h.blob,Q)},"we"),$e=i(T=>{a(T.target.files?.[0]??null),c(null)},"ge"),Fe=i(T=>{c({shardKey:o,table:T})},"xe"),qe=i(T=>{S(T.target.checked)},"ye");return(0,d.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,d.jsxs)(W,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[(0,d.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,d.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Export")})}),(0,d.jsxs)(H,{className:"flex flex-col gap-3 p-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(se,{onChange:l,testId:"ei-shard-input",value:o}),(0,d.jsx)(P,{"data-testid":"ei-export",disabled:m,onClick:Ee,type:"button",children:n("Export")})]}),h!==null&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:n("Exported {count} rows.",{count:h.count})}),(0,d.jsx)(P,{"data-testid":"ei-download",onClick:Le,size:"sm",type:"button",variant:"outline",children:n("Download")})]}),h.preview!==""&&(0,d.jsx)("pre",{className:"max-h-60 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"ei-preview",children:h.preview})]})]})]}),(0,d.jsxs)(W,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[(0,d.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,d.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Import")})}),(0,d.jsxs)(H,{className:"flex flex-col gap-3 p-4",children:[(0,d.jsx)("input",{accept:".ndjson,.jsonl,.csv,application/x-ndjson,text/csv","aria-label":n("Import file"),className:"text-sm","data-testid":"ei-file",onChange:$e,type:"file"}),v&&(0,d.jsx)(Tt,{onChange:Fe,shardKey:o,value:C}),(0,d.jsxs)(ae,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"ei-replace",children:[(0,d.jsx)("input",{checked:p,className:"size-4 accent-primary","data-testid":"ei-replace",id:"ei-replace",onChange:qe,type:"checkbox"}),n("Overwrite rows whose _id already exists (otherwise they are left unchanged and counted as conflicts)")]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,d.jsx)(ie,{confirmLabel:n("Import (writes rows)?"),disabled:m||!A,onConfirm:Se,testId:"ei-import",children:n("Import")})}),N!==null&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-progress",role:"status",children:N}),x!==null&&(0,d.jsx)(It,{result:x})]})]}),b!==null&&(0,d.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:b})]})},"Kt");function jt(t){return(0,d.jsx)(pe,{value:t.name,children:t.name},t.name)}i(jt,"Ct");export{Vt as ExportImportPanel};
@@ -0,0 +1 @@
1
+ import{a as Yo}from"./chunk-GXTSE66Z.js";import{a as Ja,b as Xa}from"./chunk-6ONPEGTC.js";import{a as en,d as tn}from"./chunk-CL3JOU6F.js";import{a as fa}from"./chunk-ARYARX6T.js";import{a as Ut,b as Xt,c as eo,d as to,e as oo,f as Za,g as $o,h as Go}from"./chunk-KTK4NDWQ.js";import{$ as Bo,A as Ba,B as Io,C as _o,D as Fa,E as Kt,G as Zt,J as qt,K as Ao,L as Wt,M as $t,O as Vo,P as ja,Q as za,R as Gt,S as Qt,T as Yt,U as Jt,V as Ho,W as Te,Y as Ka,Z as Ua,_ as Lo,b as Ta,ca as Fo,da as jo,fa as zo,j as jt,k as zt,l as Ma,la as Ko,m as Ia,ma as Uo,n as _a,na as Zo,o as Aa,oa as qo,p as kr,pa as qa,q as Oo,qa as Wa,ra as Wo,s as Do,sa as $a,t as Va,u as Mo,y as Ha,z as La}from"./chunk-XLYFGUEF.js";import{a as Qo}from"./chunk-XLCYVOJY.js";import{c as Ga,h as Qa,k as Or}from"./chunk-QAOZXPLU.js";import{a as wr}from"./chunk-HZK2UJ3K.js";import{a as ta,b as oa,h as ra,i as io,j as Nr,k as aa,l as na,m as sa,n as ia,o as la}from"./chunk-RTS5G3ET.js";import{i as ko}from"./chunk-NMQDQNDF.js";import{C as wa,D as Ea,H as ka,I as Bt,M as K,N as ne,b as he,e as uo,f as Ca,l as Ra,m as mo,o as Ht,p as Sa,q as Lt,r as Oe,s as Na}from"./chunk-HFBSWKJS.js";import{a as ea}from"./chunk-4EPW63HS.js";import{a as Tr}from"./chunk-UQHDIACF.js";import{c as ke}from"./chunk-JMZT3CEW.js";import{e as Eo,f as ba,u as xa,v as Ce}from"./chunk-VUOEJJUH.js";import{a as Ya}from"./chunk-ZMBRGW6J.js";import{a as Er,b as Ft}from"./chunk-7TWHRQXV.js";import{b as co,d as J,g as po,i as ya,j as B}from"./chunk-YUVGMKHG.js";import{a as ua,b as ma}from"./chunk-TRYQANZO.js";import{a as Oa,b as Da}from"./chunk-4PI2OSSP.js";import{a as lo,b as pa}from"./chunk-C4IDZOYU.js";import{m as wo}from"./chunk-N5AFTHW5.js";import{a as Pa}from"./chunk-ZPQBVYNN.js";import{A as va,B as ue,b as Rr,j as To,s as Ee,v as ca,w as da,x as q,y as ga,z as ha}from"./chunk-SGHIB7TS.js";import{a as Sr}from"./chunk-GWNGVKLG.js";import{a as A,b as le}from"./chunk-6G3E4PJ2.js";import{a as i,c as Cr,d as T}from"./chunk-5PEAXTYQ.js";var M=T(Sr(),1);var Pe=T(A(),1),w=T(A(),1);var n=T(le(),1);var on=T(A(),1),we=T(le(),1);var ni={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},si={overflow:"auto",whiteSpace:"pre-wrap"},Jo=class extends on.Component{static{i(this,"g")}static getDerivedStateFromError(e){return{error:e}}state={error:null};componentDidCatch(e,o){console.error("[lunora-studio] panel error",e,o.componentStack)}reset=i(()=>{this.setState({error:null})},"reset");render(){let{children:e,fallbackTitle:o,label:r,retryLabel:a}=this.props,{error:s}=this.state;if(s===null)return(0,we.jsx)(we.Fragment,{children:e});let l=o??(r===void 0?"Something went wrong":`${r} failed`);return(0,we.jsxs)("div",{"data-testid":"dash-error-boundary",role:"alert",style:ni,children:[(0,we.jsx)("strong",{children:l}),(0,we.jsx)("pre",{"data-testid":"dash-error-message",style:si,children:s.message}),(0,we.jsx)("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:a??"Try again"})]})}};var Ie={};Cr(Ie,{Arrow:()=>Pn,Backdrop:()=>Rn,Close:()=>kn,Description:()=>wn,Handle:()=>vo,Popup:()=>xn,Portal:()=>fn,Positioner:()=>gn,Root:()=>dn,Title:()=>Nn,Trigger:()=>pn,Viewport:()=>Dn,createHandle:()=>Mn});var fo=T(A(),1);var Xo=T(A(),1);var Dr=Xo.createContext(void 0);function X(t){let e=Xo.useContext(Dr);if(e===void 0&&!t)throw new Error(J(47));return e}i(X,"usePopoverRootContext");var er=T(A(),1),rn=T(ea(),1);var an={...eo,disabled:i(t=>t.disabled,"disabled"),instantType:i(t=>t.instantType,"instantType"),openMethod:i(t=>t.openMethod,"openMethod"),openChangeReason:i(t=>t.openChangeReason,"openChangeReason"),modal:i(t=>t.modal,"modal"),focusManagerModal:i(t=>t.focusManagerModal,"focusManagerModal"),stickIfOpen:i(t=>t.stickIfOpen,"stickIfOpen"),titleElementId:i(t=>t.titleElementId,"titleElementId"),descriptionElementId:i(t=>t.descriptionElementId,"descriptionElementId"),openOnHover:i(t=>t.openOnHover,"openOnHover"),closeDelay:i(t=>t.closeDelay,"closeDelay"),adaptiveOrigin:i(t=>t.adaptiveOrigin,"adaptiveOrigin")},tr=class extends Zt{static{i(this,"PopoverStore")}constructor(e,o,r){let a=new Te;super(sn(e,a,o,r),ln(a),an)}setOpen=i((e,o)=>{let r=o.reason===K.triggerHover,a=o.reason===K.triggerPress&&o.event.detail===0,s=!e&&(o.reason===K.escapeKey||o.reason==null),l=ja(o),d=this.select("activeTriggerId");if(!e&&o.reason===K.closePress&&o.trigger==null&&d!=null&&(o.trigger=this.context.triggerElements.getById(d)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,o);let p=i(()=>{let u=Vo(this.state,e,o.trigger,l());u.openChangeReason=o.reason,this.update(u)},"changeState");r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set("stickIfOpen",!1)}),rn.flushSync(p)):p();let c;a?c="click":s?c="dismiss":o.reason===K.focusOut&&(c="focus"),this.set("instantType",c)},"setOpen")};function nn(){let t=new Te,e=new oo(Object.freeze(sn(void 0,t)),Object.freeze(ln(t)),an);return Object.assign(e,{setOpen:po})}i(nn,"createNullPopoverStore");function sn(t,e,o,r=!1){let a={...Xt(e,o,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return a.open&&t?.mounted===void 0&&(a.mounted=!0),a}i(sn,"createInitialState");function ln(t){return{popupRef:er.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:er.createRef(),beforeContentFocusGuardRef:er.createRef(),stickIfOpenTimeout:new wa,triggerElements:t}}i(ln,"createInitialContext");var De=T(le(),1);var cn=jt(i(function({props:e}){let{children:o,open:r,defaultOpen:a=!1,onOpenChange:s,onOpenChangeComplete:l,modal:d=!1,handle:p,triggerId:c,defaultTriggerId:u=null}=e,g=ii(p,{modal:d,open:a,openProp:r,activeTriggerId:u,triggerIdProp:c});g.useControlledProp("openProp",r),g.useControlledProp("triggerIdProp",c);let b=g.useState("open"),f=g.useState("mounted"),m=g.useState("payload");g.useContextCallback("onOpenChange",s),g.useContextCallback("onOpenChangeComplete",l),Ho(g,b),Qt(g);let{forceUnmount:x}=Yt(b,g,()=>{g.update({stickIfOpen:!0,openChangeReason:null})});g.useSyncedValues({modal:d}),fo.useEffect(()=>{b||g.context.stickIfOpenTimeout.clear()},[g,b]),fo.useImperativeHandle(e.actionsRef,()=>({unmount:x,close:i(()=>g.setOpen(!1,ne(K.imperativeAction)),"close")}),[x,g]);let h=b||f;return(0,De.jsxs)(Dr.Provider,{value:g,children:[p&&(0,De.jsx)($t,{handle:p,store:g}),h&&(0,De.jsx)(li,{store:g,modal:d}),typeof o=="function"?o({payload:m}):o]})},"PopoverRootComponent"));function dn(t){return X(!0)?(0,De.jsx)(cn,{props:t}):(0,De.jsx)(Ba,{children:(0,De.jsx)(cn,{props:t})})}i(dn,"PopoverRoot");function ii(t,e){let o=Wt((r,a)=>new tr(e,r,a));return fo.useEffect(()=>o.context.stickIfOpenTimeout.disposeEffect(),[o]),o}i(ii,"usePopoverRootStore");function li({store:t,modal:e}){let o=t.useState("floatingRootContext"),r=Kt(o,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),a=r.reference,s=r.floating;return Jt(t,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:s}),null}i(li,"PopoverInteractions");var go=T(A(),1);var ro=T(le(),1);var pn=zt(i(function(e,o){let{render:r,className:a,style:s,disabled:l=!1,nativeButton:d=!0,handle:p,payload:c,openOnHover:u=!1,delay:g=300,closeDelay:b=0,id:f,...m}=e,x=X(!0),v=to(p)??x;if(!v)throw new Error(J(74));let P=he(f),y=v.useState("isTriggerActive",P),C=v.useState("floatingRootContext"),R=v.useState("isOpenedByTrigger",P),k=v.useState("triggerPopupId",P),S=go.useRef(null),{registerTrigger:N,isMountedByThisTrigger:E}=Gt(P,S,v,{payload:c,disabled:l,openOnHover:u,closeDelay:b}),O=v.useState("openChangeReason"),_=v.useState("stickIfOpen"),H=v.useState("openMethod"),V=v.useState("focusManagerModal"),L=Bo(C,{enabled:!l&&u&&(H!=="touch"||O!==K.triggerPress),mouseOnly:!0,move:!1,handleClose:Fo(),restMs:g,delay:{close:b},triggerElementRef:S,isActiveTrigger:y,isClosing:i(()=>v.select("transitionStatus")==="ending","isClosing")}),F=_o(C,{stickIfOpen:_}),j=jo(()=>v.select("open"),Y=>{v.set("openMethod",Y)}),U=v.useState("triggerProps",E),{getButtonProps:z,buttonRef:D}=ke({disabled:l,native:d}),I={open(Y){return Y&&O===K.triggerPress?Sa.open(Y):Ht.open(Y)}},{preFocusGuardRef:W,handlePreFocusGuardFocus:$,handleFocusTargetFocus:ie}=Za(v,S),re=B("button",e,{state:{disabled:l,open:R},ref:[D,o,N,S],props:[F.reference,L,U,j,{[Oo]:"",id:P,"aria-haspopup":"dialog","aria-expanded":R,"aria-controls":k},m,z],stateAttributesMapping:I}),ee=(0,ro.jsx)(go.Fragment,{children:re},P);return E&&!V?(0,ro.jsxs)(go.Fragment,{children:[(0,ro.jsx)(kr,{ref:W,onFocus:$}),ee,(0,ro.jsx)(kr,{ref:v.context.triggerFocusTargetRef,onFocus:ie})]}):ee},"PopoverTrigger"));var mn=T(A(),1);var or=T(A(),1);var Mr=or.createContext(void 0);function un(){let t=or.useContext(Mr);if(t===void 0)throw new Error(J(45));return t}i(un,"usePopoverPortalContext");var Ir=T(le(),1);var fn=mn.forwardRef(i(function(e,o){let{keepMounted:r=!1,...a}=e;return X().useState("mounted")||r?(0,Ir.jsx)(Mr.Provider,{value:r,children:(0,Ir.jsx)(Mo,{ref:o,...a})}):null},"PopoverPortal"));var ar=T(A(),1);var rr=T(A(),1);var _r=rr.createContext(void 0);function ao(){let t=rr.useContext(_r);if(!t)throw new Error(J(46));return t}i(ao,"usePopoverPositionerContext");var ho=T(le(),1);var gn=ar.forwardRef(i(function(e,o){let{render:r,className:a,style:s,anchor:l,positionMethod:d,side:p,align:c,sideOffset:u,alignOffset:g,collisionBoundary:b="clipping-ancestors",collisionPadding:f,arrowPadding:m,sticky:x,disableAnchorTracking:h=!1,collisionAvoidance:v=Do,...P}=e,y=X(),C=un(),R=Ha(),k=y.useState("floatingRootContext"),S=y.useState("mounted"),N=y.useState("open"),E=y.useState("openChangeReason"),O=y.useState("activeTriggerElement"),_=y.useState("modal"),H=y.useState("openMethod"),V=y.useState("positionerElement"),L=y.useState("instantType"),F=y.useState("transitionStatus"),j=y.useState("adaptiveOrigin"),U=ar.useRef(null),z=ka(V),D=Ko({anchor:l,floatingRootContext:k,positionMethod:d,mounted:S,side:p,sideOffset:u,align:c,alignOffset:g,arrowPadding:m,collisionBoundary:b,collisionPadding:f,sticky:x,disableAnchorTracking:h,keepMounted:C,nodeId:R,collisionAvoidance:v,adaptiveOrigin:j}),I=k.useState("domReferenceElement");Ce(()=>{let re=I,ee=U.current;if(re&&(U.current=re),ee&&re&&re!==ee){y.set("instantType",void 0);let Y=new AbortController;return z(()=>{y.set("instantType","trigger-change")},Y.signal),()=>{Y.abort()}}},[I,z,y]);let W=_===!0&&E!==K.triggerHover;Wa(N&&W,H==="touch",V,O);let $=y.useStateSetter("positionerElement"),ie={open:N,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:L},oe=qo(e,ie,{styles:D.positionerStyles,transitionStatus:F,props:P,refs:[o,$],hidden:!S,inert:!N});return(0,ho.jsxs)(_r.Provider,{value:D,children:[S&&W&&(0,ho.jsx)(Uo,{inert:zo(!N),cutout:O}),(0,ho.jsx)(La,{id:R,children:oe})]})},"PopoverPositioner"));var bn=T(A(),1);var Me=T(A(),1);var Ar=Me.createContext(void 0);function hn(){let[t,e]=Me.useState(0),o=xa(()=>(e(a=>a+1),()=>{e(a=>Math.max(0,a-1))}));return{context:Me.useMemo(()=>({register:o}),[o]),hasClosePart:t>0}}i(hn,"useClosePartCount");function vn(){let t=Me.useContext(Ar);Ce(()=>t?.register(),[t])}i(vn,"useClosePartRegistration");var Vr=T(le(),1);var xn=bn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,initialFocus:l,finalFocus:d,...p}=e,c=X(),u=ao(),g=$a(!0)!=null,{context:b,hasClosePart:f}=hn(),m=c.useState("open"),x=c.useState("openMethod"),h=c.useState("instantType"),v=c.useState("transitionStatus"),P=c.useState("popupProps"),y=c.useState("titleElementId"),C=c.useState("descriptionElementId"),R=c.useState("modal"),k=c.useState("mounted"),S=c.useState("openChangeReason"),N=c.useState("activeTriggerElement"),E=c.useState("floatingRootContext"),O=E.useState("floatingId"),_=c.useState("disabled"),H=c.useState("openOnHover"),V=c.useState("closeDelay");Bt({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),Lo(E,{enabled:H&&!_,closeDelay:V});let L=l===void 0?Ao(c.context.popupRef):l,F=R!==!1&&f;c.useSyncedValue("focusManagerModal",F);let j=c.useStateSetter("popupElement"),U={open:m,side:u.side,align:u.align,instant:h,transitionStatus:v},z=B("div",e,{state:U,ref:[o,c.context.popupRef,j],props:[P,{id:O,role:"dialog",...qt,"aria-labelledby":y,"aria-describedby":C,onKeyDown(D){g&&Wo.has(D.key)&&D.stopPropagation()}},Zo(v),p],stateAttributesMapping:Oe});return(0,Vr.jsx)(Io,{context:E,openInteractionType:x,modal:F,disabled:!k||S===K.triggerHover,initialFocus:L,returnFocus:d,restoreFocus:"popup",previousFocusableElement:ba(N)?N:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Vr.jsx)(Ar.Provider,{value:b,children:z})})},"PopoverPopup"));var yn=T(A(),1);var Pn=yn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,...l}=e,p=X().useState("open"),{arrowRef:c,side:u,align:g,arrowUncentered:b,arrowStyles:f}=ao();return B("div",e,{state:{open:p,side:u,align:g,uncentered:b},ref:[o,c],props:[{style:f,"aria-hidden":!0},l],stateAttributesMapping:Lt})},"PopoverArrow"));var Cn=T(A(),1);var Rn=Cn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,...l}=e,d=X(),p=d.useState("open"),c=d.useState("mounted"),u=d.useState("transitionStatus"),g=d.useState("openChangeReason");return B("div",e,{state:{open:p,transitionStatus:u},ref:o,props:[{role:"presentation",hidden:!c,style:{pointerEvents:g===K.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},l],stateAttributesMapping:Oe})},"PopoverBackdrop"));var Sn=T(A(),1);var Nn=Sn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,...l}=e,d=X(),p=he(l.id);return d.useSyncedValueWithCleanup("titleElementId",p),B("h2",e,{ref:o,props:[{id:p},l]})},"PopoverTitle"));var Tn=T(A(),1);var wn=Tn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,...l}=e,d=X(),p=he(l.id);return d.useSyncedValueWithCleanup("descriptionElementId",p),B("p",e,{ref:o,props:[{id:p},l]})},"PopoverDescription"));var En=T(A(),1);var kn=En.forwardRef(i(function(e,o){let{render:r,className:a,style:s,disabled:l=!1,nativeButton:d=!0,...p}=e,{buttonRef:c,getButtonProps:u}=ke({disabled:l,focusableWhenDisabled:!1,native:d}),g=X();return vn(),B("button",e,{ref:[o,c],props:[{onClick(f){g.setOpen(!1,ne(K.closePress,f.nativeEvent))}},p,u]})},"PopoverClose"));var On=T(A(),1);var Dn=On.forwardRef(i(function(e,o){let{render:r,className:a,style:s,children:l,...d}=e,p=X(),{side:c}=ao(),u=p.useState("instantType"),{children:g,state:b}=Go({store:p,side:c,children:l}),f={activationDirection:b.activationDirection,transitioning:b.transitioning,instant:u};return B("div",e,{state:f,ref:o,props:[d,{children:g}],stateAttributesMapping:$o})},"PopoverViewport"));var vo=class extends Ut{static{i(this,"PopoverHandle")}constructor(){super(nn(),"Popover")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Mn(){return new vo}i(Mn,"createPopoverHandle");var ce={};Cr(ce,{Backdrop:()=>_n,Close:()=>Vn,Description:()=>Ln,Handle:()=>yo,Popup:()=>Kn,Portal:()=>Zn,Root:()=>Xn,Title:()=>rs,Trigger:()=>ns,Viewport:()=>ts,createHandle:()=>ss});var In=T(A(),1);var nr=T(A(),1);var Hr=nr.createContext(void 0);function se(t){let e=nr.useContext(Hr);if(!t&&e===void 0)throw new Error(J(27));return e}i(se,"useDialogRootContext");var _n=In.forwardRef(i(function(e,o){let{render:r,className:a,style:s,forceRender:l=!1,...d}=e,p=se(),c=p.useState("open"),u=p.useState("nested"),g=p.useState("mounted"),b=p.useState("transitionStatus");return B("div",e,{state:{open:c,transitionStatus:b},ref:[p.context.backdropRef,o],stateAttributesMapping:Oe,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:l||!u})},"DialogBackdrop"));var An=T(A(),1);var Vn=An.forwardRef(i(function(e,o){let{render:r,className:a,style:s,disabled:l=!1,nativeButton:d=!0,...p}=e,c=se(),u=c.useState("open"),{getButtonProps:g,buttonRef:b}=ke({disabled:l,native:d}),f={disabled:l};function m(x){u&&c.setOpen(!1,ne(K.closePress,x.nativeEvent))}return i(m,"handleClick"),B("button",e,{state:f,ref:[o,b],props:[{onClick:m},p,g]})},"DialogClose"));var Hn=T(A(),1);var Ln=Hn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,id:l,...d}=e,p=se(),c=he(l);return p.useSyncedValueWithCleanup("descriptionElementId",c),B("p",e,{ref:o,props:[{id:c},d]})},"DialogDescription"));var jn=T(A(),1);var sr=T(A(),1);var Lr=sr.createContext(void 0);function ir(){let t=sr.useContext(Lr);if(t===void 0)throw new Error(J(26));return t}i(ir,"useDialogPortalContext");var Bn="--nested-dialogs";var Uu=mo.open,Zu=mo.closed,qu=mo.startingStyle,Wu=mo.endingStyle;var Fn="data-nested-dialog-open";var lr={...Lt,...Ra,nestedDialogOpen(t){return t?{[Fn]:""}:null}};var zn=T(le(),1);var Kn=jn.forwardRef(i(function(e,o){let{render:r,className:a,style:s,finalFocus:l,initialFocus:d,...p}=e,c=se(),u=c.useState("descriptionElementId"),g=c.useState("disablePointerDismissal"),b=c.useState("floatingRootContext"),f=c.useState("popupProps"),m=c.useState("modal"),x=c.useState("mounted"),h=c.useState("nested"),v=c.useState("nestedOpenDialogCount"),P=c.useState("open"),y=c.useState("openMethod"),C=c.useState("titleElementId"),R=c.useState("transitionStatus"),k=c.useState("role"),S=b.useState("floatingId");ir(),Bt({open:P,ref:c.context.popupRef,onComplete(){P&&c.context.onOpenChangeComplete?.(!0)}});let N=d===void 0?Ao(c.context.popupRef):d,E=v>0,O=c.useStateSetter("popupElement"),H=B("div",e,{state:{open:P,nested:h,transitionStatus:R,nestedDialogOpen:E},props:[f,{id:S,"aria-labelledby":C,"aria-describedby":u,role:k,...qt,hidden:!x,onKeyDown(V){Wo.has(V.key)&&V.stopPropagation()},style:{[Bn]:v}},p],ref:[o,c.context.popupRef,O],stateAttributesMapping:lr});return(0,zn.jsx)(Io,{context:b,openInteractionType:y,disabled:!x,closeOnFocusOut:!g,initialFocus:N,returnFocus:l,modal:m!==!1,restoreFocus:"popup",children:H})},"DialogPopup"));var Un=T(A(),1);var bo=T(le(),1);var Zn=Un.forwardRef(i(function(e,o){let{keepMounted:r=!1,...a}=e,s=se(),l=s.useState("mounted"),d=s.useState("modal"),p=s.useState("open");return l||r?(0,bo.jsx)(Lr.Provider,{value:r,children:(0,bo.jsxs)(Mo,{ref:o,...a,children:[l&&d===!0&&(0,bo.jsx)(Uo,{ref:s.context.internalBackdropRef,inert:zo(!p)}),e.children]})}):null},"DialogPortal"));var Yn=T(A(),1);var Br=T(A(),1);function qn({store:t,parentContext:e,isDrawer:o}){let r=t.useState("open"),a=t.useState("disablePointerDismissal"),s=t.useState("modal"),l=t.useState("popupElement"),d=t.useState("floatingRootContext"),[p,c]=Br.useState(0),[u,g]=Br.useState(0),b=p===0,f=Kt(d,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!t.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}let x=Ca(m);if(b&&!a){if(s){let h=t.context.internalBackdropRef.current,v=t.context.backdropRef.current;return h||v?h===x||v===x||uo(x,l)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:b});return qa(r&&s===!0,l),t.useContextCallback("onNestedDialogOpen",(m,x)=>{c(m),g(x)}),Ce(()=>(e?.onNestedDialogOpen&&(r?e.onNestedDialogOpen(p+1,u+(o?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&r&&e.onNestedDialogOpen(0,0)}),[o,r,p,u,e]),Jt(t,{activeTriggerProps:f.reference,inactiveTriggerProps:f.trigger,popupProps:f.floating,nestedOpenDialogCount:p,nestedOpenDrawerCount:u}),null}i(qn,"DialogInteractions");var cr=T(A(),1);var Wn={...eo,modal:i(t=>t.modal,"modal"),nested:i(t=>t.nested,"nested"),nestedOpenDialogCount:i(t=>t.nestedOpenDialogCount,"nestedOpenDialogCount"),nestedOpenDrawerCount:i(t=>t.nestedOpenDrawerCount,"nestedOpenDrawerCount"),disablePointerDismissal:i(t=>t.disablePointerDismissal,"disablePointerDismissal"),openMethod:i(t=>t.openMethod,"openMethod"),descriptionElementId:i(t=>t.descriptionElementId,"descriptionElementId"),titleElementId:i(t=>t.titleElementId,"titleElementId"),viewportElement:i(t=>t.viewportElement,"viewportElement"),role:i(t=>t.role,"role")},dr=class extends Zt{static{i(this,"DialogStore")}constructor(e,o,r){let a=new Te,s=Gn(e,a,o,r);super(s,Qn(a),Wn)}setOpen=i((e,o)=>{o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,o),!o.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,o),this.update(Vo(this.state,e,o.trigger)))},"setOpen")};function $n(){let t=new Te;return new oo(Object.freeze(Gn(void 0,t)),Object.freeze(Qn(t)),Wn)}i($n,"createNullDialogStore");function Gn(t,e,o,r=!1){return{...Xt(e,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}i(Gn,"createInitialState");function Qn(t){return{popupRef:cr.createRef(),backdropRef:cr.createRef(),internalBackdropRef:cr.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}i(Qn,"createInitialContext");var xo=T(le(),1);function Jn(t,e){let{children:o,open:r,defaultOpen:a=!1,onOpenChange:s,onOpenChangeComplete:l,disablePointerDismissal:d=!1,modal:p=!0,actionsRef:c,handle:u,triggerId:g,defaultTriggerId:b=null}=e,f=t==="drawer",m=t==="alert-dialog",x=m?!0:p,h=m||d,v=m?"alertdialog":"dialog",P=se(!0),y=P!=null,C={modal:x,disablePointerDismissal:h,nested:y,role:v},R=Wt((_,H)=>new dr({open:a,openProp:r,activeTriggerId:b,triggerIdProp:g,...C},_,H),!0);R.useControlledProp("openProp",r),R.useControlledProp("triggerIdProp",g),R.useSyncedValues(C),R.useContextCallback("onOpenChange",s),R.useContextCallback("onOpenChangeComplete",l);let k=R.useState("open"),S=R.useState("mounted"),N=R.useState("payload");Ho(R,k),Qt(R);let{forceUnmount:E}=Yt(k,R);Yn.useImperativeHandle(c,()=>({unmount:E,close:i(()=>R.setOpen(!1,ne(K.imperativeAction)),"close")}),[E,R]);let O=k||S;return(0,xo.jsxs)(Hr.Provider,{value:R,children:[u&&(0,xo.jsx)($t,{handle:u,store:R}),O&&(0,xo.jsx)(qn,{store:R,parentContext:P?.context,isDrawer:f}),typeof o=="function"?o({payload:N}):o]})}i(Jn,"useRenderDialogRoot");var Xn=jt(i(function(e){return Jn("dialog",e)},"DialogRoot"));var es=T(A(),1);var ts=es.forwardRef(i(function(e,o){let{render:r,className:a,style:s,children:l,...d}=e,p=ir(),c=se(),u=c.useState("open"),g=c.useState("nested"),b=c.useState("transitionStatus"),f=c.useState("nestedOpenDialogCount"),m=c.useState("mounted"),x=c.useStateSetter("viewportElement"),h=f>0;return B("div",e,{enabled:p||m,state:{open:u,nested:g,transitionStatus:b,nestedDialogOpen:h},ref:[o,x],stateAttributesMapping:lr,props:[{role:"presentation",hidden:!m,style:{pointerEvents:u?void 0:"none"},children:l},d]})},"DialogViewport"));var os=T(A(),1);var rs=os.forwardRef(i(function(e,o){let{render:r,className:a,style:s,id:l,...d}=e,p=se(),c=he(l);return p.useSyncedValueWithCleanup("titleElementId",c),B("h2",e,{ref:o,props:[{id:c},d]})},"DialogTitle"));var as=T(A(),1);var ns=zt(i(function(e,o){let{render:r,className:a,style:s,disabled:l=!1,nativeButton:d=!0,id:p,payload:c,handle:u,...g}=e,b=se(!0),m=to(u)??b;if(!m)throw new Error(J(79));let x=he(p),h=m.useState("floatingRootContext"),v=m.useState("isOpenedByTrigger",x),P=m.useState("triggerPopupId",x),y=as.useRef(null),{registerTrigger:C,isMountedByThisTrigger:R}=Gt(x,y,m,{payload:c}),{getButtonProps:k,buttonRef:S}=ke({disabled:l,native:d}),N=_o(h),E=jo(()=>m.select("open"),H=>{m.set("openMethod",H)}),O={disabled:l,open:v},_=m.useState("triggerProps",R);return B("button",e,{state:O,ref:[S,o,C,y],props:[N.reference,_,E,{[Oo]:"",id:x,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":P},g,k],stateAttributesMapping:Ht})},"DialogTrigger"));var yo=class extends Ut{static{i(this,"DialogHandle")}constructor(){super($n(),"Dialog",!1)}open(e){this.openByTrigger(e)}openWithPayload(e){let o=this.attachedStore;o!==null&&(o.set("payload",e),o.setOpen(!0,ne(K.imperativeAction)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function ss(){return new yo}i(ss,"createDialogHandle");var Re={};Cr(Re,{Arrow:()=>Es,Handle:()=>Co,Popup:()=>Ts,Portal:()=>Cs,Positioner:()=>Ss,Provider:()=>Os,Root:()=>us,Trigger:()=>hs,Viewport:()=>Ms,createHandle:()=>Is});var no=T(A(),1);var pr=T(A(),1);var Fr=pr.createContext(void 0);function ye(t){let e=pr.useContext(Fr);if(e===void 0&&!t)throw new Error(J(72));return e}i(ye,"useTooltipRootContext");var is=T(A(),1);var ls={...eo,disabled:i(t=>t.disabled,"disabled"),instantType:i(t=>t.instantType,"instantType"),isInstantPhase:i(t=>t.isInstantPhase,"isInstantPhase"),trackCursorAxis:i(t=>t.trackCursorAxis,"trackCursorAxis"),disableHoverablePopup:i(t=>t.disableHoverablePopup,"disableHoverablePopup"),lastOpenChangeReason:i(t=>t.openChangeReason,"lastOpenChangeReason"),closeOnClick:i(t=>t.closeOnClick,"closeOnClick"),closeDelay:i(t=>t.closeDelay,"closeDelay"),adaptiveOrigin:i(t=>t.adaptiveOrigin,"adaptiveOrigin")},ur=class extends Zt{static{i(this,"TooltipStore")}constructor(e,o,r){let a=new Te;super(ds(e,a,o,r),ps(a),ls)}setOpen=i((e,o)=>{za(this,e,o,{extraState:{openChangeReason:o.reason}})},"setOpen");cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ne(K.triggerPress,e))}};function cs(){let t=new Te,e=new oo(Object.freeze(ds(void 0,t)),Object.freeze(ps(t)),ls);return Object.assign(e,{setOpen:po,cancelPendingOpen:po})}i(cs,"createNullTooltipStore");function ds(t,e,o,r=!1){return{...Xt(e,o,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}i(ds,"createInitialState");function ps(t){return{popupRef:is.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}i(ps,"createInitialContext");var Po=T(le(),1);var us=jt(i(function(e){let{disabled:o=!1,defaultOpen:r=!1,open:a,disableHoverablePopup:s=!1,trackCursorAxis:l="none",actionsRef:d,onOpenChange:p,onOpenChangeComplete:c,handle:u,triggerId:g,defaultTriggerId:b=null,children:f}=e,m=Wt((_,H)=>new ur({open:r,openProp:a,activeTriggerId:b,triggerIdProp:g},_,H));m.useControlledProp("openProp",a),m.useControlledProp("triggerIdProp",g),m.useContextCallback("onOpenChange",p),m.useContextCallback("onOpenChangeComplete",c);let x=m.useState("open"),h=!o&&x,v=m.useState("activeTriggerId"),P=m.useState("mounted"),y=m.useState("payload");m.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:s,disabled:o}),Qt(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:C,transitionStatus:R}=Yt(h,m),k=m.useState("isInstantPhase"),S=m.useState("instantType"),N=m.useState("lastOpenChangeReason"),E=no.useRef(null);Ce(()=>{x&&o&&m.setOpen(!1,ne(K.disabled))},[x,o,m]),Ce(()=>{R==="ending"&&N===K.none||R!=="ending"&&k?(S!=="delay"&&(E.current=S),m.set("instantType","delay")):E.current!==null&&(m.set("instantType",E.current),E.current=null)},[R,k,N,S,m]),Ce(()=>{h&&v==null&&m.set("payload",void 0)},[m,v,h]),no.useImperativeHandle(d,()=>({unmount:C,close:i(()=>m.setOpen(!1,ne(K.imperativeAction)),"close")}),[C,m]);let O=h||P||!o&&l!=="none";return(0,Po.jsxs)(Fr.Provider,{value:m,children:[u&&(0,Po.jsx)($t,{handle:u,store:m}),O&&(0,Po.jsx)(pi,{store:m,disabled:o,trackCursorAxis:l}),typeof f=="function"?f({payload:y}):f]})},"TooltipRoot"));function pi({store:t,disabled:e,trackCursorAxis:o}){let r=t.useState("floatingRootContext"),a=Kt(r,{enabled:!e,referencePress:i(()=>t.select("closeOnClick"),"referencePress")}),s=Fa(r,{enabled:!e&&o!=="none",axis:o==="none"?void 0:o}),l=no.useMemo(()=>co(s.reference,a.reference),[s.reference,a.reference]);return Jt(t,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:a.floating??ya}),null}i(pi,"TooltipInteractions");var fr=T(A(),1);var mr=T(A(),1);var jr=mr.createContext(void 0);function ms(){return mr.useContext(jr)}i(ms,"useTooltipProviderContext");var gs="data-base-ui-tooltip-trigger";function fs(t){if("composedPath"in t){let o=t.composedPath();for(let r=0;r<o.length;r+=1){let a=o[r];if(Eo(a))return a}}let e=t.target;return Eo(e)?e:null}i(fs,"getTargetElement");function ui(t){let e=t;for(;e;){let o=e.closest(`[${gs}]`);if(o)return o;let r=e.getRootNode();e="host"in r&&Eo(r.host)?r.host:null}return null}i(ui,"closestEnabledTooltipTrigger");var hs=zt(i(function(e,o){let{render:r,className:a,style:s,handle:l,payload:d,disabled:p,delay:c,closeOnClick:u=!0,closeDelay:g,id:b,...f}=e,m=ye(!0),h=to(l)??m;if(!h)throw new Error(J(82));let v=he(b),P=h.useState("isTriggerActive",v),y=h.useState("isOpenedByTrigger",v),C=h.useState("floatingRootContext"),R=fr.useRef(null),k=g??0,{registerTrigger:S,isMountedByThisTrigger:N}=Gt(v,R,h,{payload:d,closeOnClick:u,closeDelay:k}),E=ms(),{activeIdRef:O,delayRef:_,isInstantPhase:H,hasProvider:V}=_a(C,{open:y}),L=Ua(C);h.useSyncedValue("isInstantPhase",H);let F=h.useState("disabled"),j=p??F,U=Aa(j),z=h.useState("trackCursorAxis"),D=h.useState("disableHoverablePopup"),I=fr.useRef(!1),W=Ea(),$=fr.useRef(void 0);function ie(){return V&&O.current!=null?0:c??E??600}i(ie,"getOpenDelay");function oe(Z){let G=R.current;if(!G||!Z)return!1;let te=ui(Z);return te!==null&&te!==G&&uo(G,te)}i(oe,"isEnabledNestedTriggerTarget");function re(Z){let G=oe(Z);return I.current=G,G&&(L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1,W.clear()),G}i(re,"detectNestedTriggerHover");let ee=Bo(C,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!D&&z!=="both"?Fo():null,restMs:ie,delay(){return g==null&&V?{close:Ma(_.current,"close")}:{close:k}},triggerElementRef:R,isActiveTrigger:P,isClosing:i(()=>h.select("transitionStatus")==="ending","isClosing"),shouldOpen(){return!I.current}}),Y=Ka(C,{enabled:!j}).reference,be=i(Z=>{let G=I.current,te=fs(Z),xe=re(te),pe=R.current,ve=pe&&te&&uo(pe,te);if(xe&&h.select("open")&&h.select("lastOpenChangeReason")===K.triggerHover){h.setOpen(!1,ne(K.triggerHover,Z));return}if(G&&!xe&&ve&&!U.current&&!h.select("open")&&pe&&Ta($.current)){let Se=i(()=>{!I.current&&!U.current&&!h.select("open")&&h.setOpen(!0,ne(K.triggerHover,Z,pe))},"open"),Ne=ie();Ne===0?(W.clear(),Se()):W.start(Ne,Se)}},"handleNestedTriggerHover"),de=h.useState("triggerProps",N);return B("button",e,{state:{open:y},ref:[o,S,R],props:[ee,Y,N||z!=="none"?de:void 0,{onMouseOver(Z){be(Z.nativeEvent)},onFocus(Z){oe(fs(Z.nativeEvent))&&Z.preventBaseUIHandler()},onMouseLeave(){I.current=!1,W.clear(),$.current=void 0},onPointerEnter(Z){$.current=Z.pointerType},onPointerDown(Z){$.current=Z.pointerType,h.set("closeOnClick",u),u&&!h.select("open")&&h.cancelPendingOpen(Z.nativeEvent)},onClick(Z){u&&!h.select("open")&&h.cancelPendingOpen(Z.nativeEvent)},id:v,[Na]:j?"":void 0,[gs]:j?void 0:""},f],stateAttributesMapping:Ht})},"TooltipTrigger"));var Ps=T(A(),1);var gr=T(A(),1);var zr=gr.createContext(void 0);function vs(){let t=gr.useContext(zr);if(t===void 0)throw new Error(J(70));return t}i(vs,"useTooltipPortalContext");var hr=T(A(),1),bs=T(ea(),1);var xs=T(le(),1);var ys=hr.forwardRef(i(function(e,o){let{children:r,container:a,className:s,render:l,style:d,...p}=e,{node:c,subtree:u}=Va({container:a,ref:o,componentProps:e,elementProps:p});return!u&&!c?null:(0,xs.jsxs)(hr.Fragment,{children:[u,c&&bs.createPortal(r,c)]})},"FloatingPortalLite"));var Kr=T(le(),1);var Cs=Ps.forwardRef(i(function(e,o){let{keepMounted:r=!1,...a}=e;return ye().useState("mounted")||r?(0,Kr.jsx)(zr.Provider,{value:r,children:(0,Kr.jsx)(ys,{ref:o,...a})}):null},"TooltipPortal"));var br=T(A(),1);var vr=T(A(),1);var Ur=vr.createContext(void 0);function so(){let t=vr.useContext(Ur);if(t===void 0)throw new Error(J(71));return t}i(so,"useTooltipPositionerContext");var Rs=T(le(),1);var Ss=br.forwardRef(i(function(e,o){let{render:r,className:a,anchor:s,positionMethod:l="absolute",side:d="top",align:p="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:g="clipping-ancestors",collisionPadding:b=5,arrowPadding:f=5,sticky:m=!1,disableAnchorTracking:x=!1,collisionAvoidance:h=Do,style:v,...P}=e,y=ye(),C=vs(),R=y.useState("open"),k=y.useState("mounted"),S=y.useState("trackCursorAxis"),N=y.useState("disableHoverablePopup"),E=y.useState("floatingRootContext"),O=y.useState("instantType"),_=y.useState("transitionStatus"),H=y.useState("adaptiveOrigin"),V=Ko({anchor:s,positionMethod:l,floatingRootContext:E,mounted:k,side:d,sideOffset:c,align:p,alignOffset:u,collisionBoundary:g,collisionPadding:b,sticky:m,arrowPadding:f,disableAnchorTracking:x,keepMounted:C,collisionAvoidance:h,adaptiveOrigin:H}),L=br.useMemo(()=>({open:R,side:V.side,align:V.align,anchorHidden:V.anchorHidden,instant:S!=="none"?"tracking-cursor":O}),[R,V.side,V.align,V.anchorHidden,S,O]),F=qo(e,L,{styles:V.positionerStyles,transitionStatus:_,props:P,refs:[o,y.useStateSetter("positionerElement")],hidden:!k,inert:!R||S==="both"||N});return(0,Rs.jsx)(Ur.Provider,{value:V,children:F})},"TooltipPositioner"));var Ns=T(A(),1);var Ts=Ns.forwardRef(i(function(e,o){let{render:r,className:a,style:s,...l}=e,d=ye(),{side:p,align:c}=so(),u=d.useState("open"),g=d.useState("instantType"),b=d.useState("transitionStatus"),f=d.useState("popupProps"),m=d.useState("floatingRootContext"),x=d.useState("disabled"),h=d.useState("closeDelay");Bt({open:u,ref:d.context.popupRef,onComplete(){u&&d.context.onOpenChangeComplete?.(!0)}}),Lo(m,{enabled:!x,closeDelay:h});let v=d.useStateSetter("popupElement");return B("div",e,{state:{open:u,side:p,align:c,instant:g,transitionStatus:b},ref:[o,d.context.popupRef,v],props:[qt,f,Zo(b),l],stateAttributesMapping:Oe})},"TooltipPopup"));var ws=T(A(),1);var Es=ws.forwardRef(i(function(e,o){let{render:r,className:a,style:s,...l}=e,d=ye(),{arrowRef:p,side:c,align:u,arrowUncentered:g,arrowStyles:b}=so(),f=d.useState("open"),m=d.useState("instantType");return B("div",e,{state:{open:f,side:c,align:u,uncentered:g,instant:m},ref:[o,p],props:[{style:b,"aria-hidden":!0},l],stateAttributesMapping:Lt})},"TooltipArrow"));var ks=T(A(),1);var Zr=T(le(),1);var Os=i(function(e){let{delay:o,closeDelay:r,timeout:a=400}=e,s=ks.useMemo(()=>({open:o,close:r}),[o,r]);return(0,Zr.jsx)(jr.Provider,{value:o,children:(0,Zr.jsx)(Ia,{delay:s,timeoutMs:a,children:e.children})})},"TooltipProvider");var Ds=T(A(),1);var Ms=Ds.forwardRef(i(function(e,o){let{render:r,className:a,style:s,children:l,...d}=e,p=ye(),c=so(),u=p.useState("instantType"),{children:g,state:b}=Go({store:p,side:c.side,children:l}),f={activationDirection:b.activationDirection,transitioning:b.transitioning,instant:u};return B("div",e,{state:f,ref:o,props:[d,{children:g}],stateAttributesMapping:$o})},"TooltipViewport"));var Co=class extends Ut{static{i(this,"TooltipHandle")}constructor(){super(cs(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Is(){return new Co}i(Is,"createTooltipHandle");var _s=T(Sr(),1);var As=T(le(),1);var mi=i((t,e,o)=>t!==void 0?t:e===void 0&&o===void 0?ha:ga(e,o),"I"),Vs=i(t=>{let e=(0,_s.c)(7),{catalogs:o,children:r,i18n:a,locale:s}=t,l;e[0]!==o||e[1]!==a||e[2]!==s?(l=mi(a,s,o),e[0]=o,e[1]=a,e[2]=s,e[3]=l):l=e[3];let d=l,p;return e[4]!==r||e[5]!==d?(p=(0,As.jsx)(va,{value:d,children:r}),e[4]=r,e[5]=d,e[6]=p):p=e[6],p},"S");var Wr=T(Sr(),1);var _e=T(A(),1);var ae=T(le(),1);var qr="lunora:command-palette",Hs=i(()=>{"window"in globalThis&&globalThis.dispatchEvent(new Event(qr))},"ce"),fi=i(t=>{let e=(0,Wr.c)(18),{active:o,index:r,item:a,onActivate:s,onSelect:l}=t,d;e[0]!==a||e[1]!==l?(d=i(()=>{l(a)},"g"),e[0]=a,e[1]=l,e[2]=d):d=e[2];let p=d,c;e[3]!==r||e[4]!==s?(c=i(()=>{s(r)},"x"),e[3]=r,e[4]=s,e[5]=c):c=e[5];let u=c,g=o?"bg-accent text-accent-foreground":"text-foreground",b;e[6]!==g?(b=q("flex w-full items-center justify-between gap-3 rounded-md px-3 py-2 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground",g),e[6]=g,e[7]=b):b=e[7];let f;e[8]!==a.label?(f=(0,ae.jsx)("span",{children:a.label}),e[8]=a.label,e[9]=f):f=e[9];let m;e[10]!==a.group?(m=(0,ae.jsx)("span",{className:"text-xs text-muted-foreground",children:a.group}),e[10]=a.group,e[11]=m):m=e[11];let x;return e[12]!==p||e[13]!==u||e[14]!==b||e[15]!==f||e[16]!==m?(x=(0,ae.jsx)("li",{children:(0,ae.jsxs)("button",{className:b,onClick:p,onMouseEnter:u,type:"button",children:[f,m]})}),e[12]=p,e[13]=u,e[14]=b,e[15]=f,e[16]=m,e[17]=x):x=e[17],x},"Y"),gi=i((t,e)=>{let o=e.trim().toLowerCase();return o===""?t:t.filter(r=>r.label.toLowerCase().includes(o)||r.group.toLowerCase().includes(o))},"Z"),Ls=i(t=>{let e=(0,Wr.c)(40),{items:o}=t,r=ue(),a=io(),{palette:s}=Yo(),[l,d]=(0,_e.useState)(!1),[p,c]=(0,_e.useState)(""),[u,g]=(0,_e.useState)(0),b=(0,_e.useRef)(null),f,m;e[0]!==s?(f=i(()=>{let D=i(W=>{if(!(W.metaKey||W.ctrlKey)||W.key.toLowerCase()!==s)return;let{target:$}=W;$ instanceof HTMLElement&&($.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes($.tagName))||(W.preventDefault(),d(!0))},"t"),I=i(()=>{d(!0)},"l");return globalThis.addEventListener("keydown",D),globalThis.addEventListener(qr,I),()=>{globalThis.removeEventListener("keydown",D),globalThis.removeEventListener(qr,I)}},"s"),m=[s],e[0]=s,e[1]=f,e[2]=m):(f=e[1],m=e[2]),(0,_e.useEffect)(f,m);let x;e[3]!==o||e[4]!==p?(x=gi(o,p),e[3]=o,e[4]=p,e[5]=x):x=e[5];let h=x,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=i(D=>{d(D),D||(c(""),g(0))},"I"),e[6]=v):v=e[6];let P=v,y;e[7]!==a?(y=i(D=>{if(P(!1),D.run!==void 0){D.run();return}D.to!==void 0&&Ee(a({to:D.to}))},"K"),e[7]=a,e[8]=y):y=e[8];let C=y,R;e[9]===Symbol.for("react.memo_cache_sentinel")?(R=i(D=>{c(D.target.value),g(0)},"P"),e[9]=R):R=e[9];let k=R,S;e[10]!==u||e[11]!==h||e[12]!==C?(S=i(D=>{e:switch(D.key){case"ArrowDown":{D.preventDefault(),g(I=>h.length===0?0:(I+1)%h.length);break e}case"ArrowUp":{D.preventDefault(),g(I=>h.length===0?0:(I-1+h.length)%h.length);break e}case"Enter":{D.preventDefault();let I=h[u];I!==void 0&&C(I);break e}}},"z"),e[10]=u,e[11]=h,e[12]=C,e[13]=S):S=e[13];let N=S,E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=(0,ae.jsx)(ce.Backdrop,{className:"fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),e[14]=E):E=e[14];let O;e[15]!==r?(O=r("Command palette"),e[15]=r,e[16]=O):O=e[16];let _;e[17]!==O?(_=(0,ae.jsx)(ce.Title,{className:"sr-only",children:O}),e[17]=O,e[18]=_):_=e[18];let H;e[19]===Symbol.for("react.memo_cache_sentinel")?(H=(0,ae.jsxs)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,ae.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,ae.jsx)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[19]=H):H=e[19];let V;e[20]!==r?(V=r("Search\u2026"),e[20]=r,e[21]=V):V=e[21];let L;e[22]!==N||e[23]!==p||e[24]!==V?(L=(0,ae.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[H,(0,ae.jsx)("input",{className:"h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-testid":"dash-command-input",onChange:k,onKeyDown:N,placeholder:V,ref:b,type:"text",value:p})]}),e[22]=N,e[23]=p,e[24]=V,e[25]=L):L=e[25];let F;e[26]!==u||e[27]!==h||e[28]!==C||e[29]!==r?(F=h.length===0?(0,ae.jsx)("li",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:r("No results.")}):h.map((D,I)=>(0,ae.jsx)(fi,{active:I===u,index:I,item:D,onActivate:g,onSelect:C},D.to??`${D.group}:${D.label}`)),e[26]=u,e[27]=h,e[28]=C,e[29]=r,e[30]=F):F=e[30];let j;e[31]!==F?(j=(0,ae.jsx)("ul",{className:"max-h-80 overflow-y-auto p-1.5","data-testid":"dash-command-list",children:F}),e[31]=F,e[32]=j):j=e[32];let U;e[33]!==_||e[34]!==L||e[35]!==j?(U=(0,ae.jsxs)(ce.Portal,{children:[E,(0,ae.jsxs)(ce.Popup,{className:"fixed start-1/2 top-24 z-50 w-[36rem] max-w-[90vw] -translate-x-1/2 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","data-testid":"dash-command-palette",initialFocus:b,children:[_,L,j]})]}),e[33]=_,e[34]=L,e[35]=j,e[36]=U):U=e[36];let z;return e[37]!==l||e[38]!==U?(z=(0,ae.jsx)(ce.Root,{onOpenChange:P,open:l,children:U}),e[37]=l,e[38]=U,e[39]=z):z=e[39],z},"de");var Us="(prefers-color-scheme: dark)",Zs=i(()=>{try{return globalThis.localStorage}catch{return}},"ts"),hi=i(t=>t==="system"||t==="light"||t==="dark","Ws"),qs=i(()=>globalThis.matchMedia,"ss"),Ws="lunora-studio-theme",$r=["system","light","dark"],vi=i((t="system")=>{try{let e=Zs()?.getItem(Ws);return hi(e)?e:t}catch{return t}},"Us"),Bs=i(t=>{let e=Zs();if(e!==void 0)try{e.setItem(Ws,t)}catch{}},"zt"),bi=i(()=>{try{return qs()?.(Us).matches?"dark":"light"}catch{return"light"}},"js"),xi=i((t,e)=>t==="system"?e:t,"Gs"),yi=i(t=>{let e;try{e=qs()?.(Us)}catch{e=void 0}if(e===void 0)return()=>{};let o=i(r=>{t(r.matches?"dark":"light")},"s");return e.addEventListener("change",o),()=>{e.removeEventListener("change",o)}},"Qs"),Jr=(0,w.createContext)(null),Pi=i(({children:t,defaultTheme:e="system"})=>{let[o,r]=(0,w.useState)(()=>vi(e)),[a,s]=(0,w.useState)(()=>bi());(0,w.useEffect)(()=>yi(s),[]);let l=i(p=>{Bs(p),r(p)},"l"),d={cycleTheme:i(()=>{r(p=>{let c=$r[($r.indexOf(p)+1)%$r.length]??p;return Bs(c),c})},"cycleTheme"),resolvedTheme:xi(o,a),setTheme:l,systemTheme:a,theme:o};return(0,n.jsx)(Jr,{value:d,children:t})},"Ks"),Ci=i(t=>{let e=(0,M.c)(3),{children:o}=t,r=(0,w.use)(Jr),a;return e[0]!==o||e[1]!==r?(a=r===null?(0,n.jsx)(Pi,{children:o}):o,e[0]=o,e[1]=r,e[2]=a):a=e[2],a},"Ys"),Ri=i(()=>{let t=(0,w.use)(Jr);if(t===null)throw new Rr("INTERNAL","useTheme must be used within a <ThemeProvider>");return t},"Js");function fh({delay:t=0,...e}){return(0,n.jsx)(Re.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}i(fh,"er");function Si(t){let e=(0,M.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,n.jsx)(Re.Root,{"data-slot":"tooltip",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Si,"Xs");function Ni(t){let e=(0,M.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,n.jsx)(Re.Trigger,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Ni,"ea");function Ti({className:t,side:e="top",sideOffset:o=4,align:r="center",alignOffset:a=0,children:s,...l}){return(0,n.jsx)(Re.Portal,{children:(0,n.jsx)(Re.Positioner,{align:r,alignOffset:a,side:e,sideOffset:o,className:"isolate z-50",children:(0,n.jsxs)(Re.Popup,{"data-slot":"tooltip-content",className:q("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...l,children:[s,(0,n.jsx)(Re.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}i(Ti,"ta");var wi=i(t=>{let e=(0,M.c)(5),{className:o}=t,r;e[0]!==o?(r=q("h-full w-full text-foreground",o),e[0]=o,e[1]=r):r=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"}),e[2]=a):a=e[2];let s;return e[3]!==r?(s=(0,n.jsx)("svg",{"aria-hidden":"true",className:r,fill:"currentColor",viewBox:"0 0 543 446",children:a}),e[3]=r,e[4]=s):s=e[4],s},"sa"),Ei=["lunora-deployment-pause"],$s=i(()=>{let t=(0,M.c)(9),e=wo(),o;t[0]!==e?(o=i(async()=>e.getDeploymentPause().catch(Oi),"s"),t[0]=e,t[1]=o):o=t[1];let r=pa(Ei,o),a;t[2]!==r?(a=i(()=>r.poll(),"n"),t[2]=r,t[3]=a):a=t[3],fa(a,!0);let s;t[4]!==r?(s=i(()=>{r.refetch()},"r"),t[4]=r,t[5]=s):s=t[5];let l;return t[6]!==r.data||t[7]!==s?(l={refetch:s,state:r.data},t[6]=r.data,t[7]=s,t[8]=l):l=t[8],l},"os"),ki=i(()=>{let t=(0,M.c)(34),e=wo(),o=ue(),{refetch:r,state:a}=$s(),[s,l]=(0,w.useState)(void 0);if(a?.paused!==!0)return null;let d;t[0]!==e||t[1]!==r?(d=i(async()=>{try{await e.setDeploymentPause(!1),l(void 0),r()}catch(R){l(To(R))}},"i"),t[0]=e,t[1]=r,t[2]=d):d=t[2];let p=d,c;t[3]!==o?(c=o("Deployment paused"),t[3]=o,t[4]=c):c=t[4];let u;t[5]!==c?(u=(0,n.jsx)("strong",{children:c}),t[5]=c,t[6]=u):u=t[6];let g;t[7]!==a.pausedAt?(g=a.pausedAt!==void 0&&(0,n.jsx)("span",{className:"text-muted-foreground tabular-nums",children:da(a.pausedAt,"")}),t[7]=a.pausedAt,t[8]=g):g=t[8];let b;t[9]!==a.reason?(b=a.reason!==void 0&&(0,n.jsx)("span",{"data-testid":"deployment-paused-reason",children:a.reason}),t[9]=a.reason,t[10]=b):b=t[10];let f;t[11]!==o?(f=o("Function calls get 503, scheduled jobs are held on every scheduler instance, cron ticks are skipped and queue messages are held until you resume."),t[11]=o,t[12]=f):f=t[12];let m;t[13]!==f?(m=(0,n.jsx)("span",{className:"text-muted-foreground",children:f}),t[13]=f,t[14]=m):m=t[14];let x;t[15]!==s?(x=s!==void 0&&(0,n.jsx)("span",{className:"text-destructive",children:s}),t[15]=s,t[16]=x):x=t[16];let h;t[17]!==o?(h=o("Resume deployment?"),t[17]=o,t[18]=h):h=t[18];let v;t[19]!==p?(v=i(()=>{Ee(p())},"b"),t[19]=p,t[20]=v):v=t[20];let P;t[21]!==o?(P=o("Resume"),t[21]=o,t[22]=P):P=t[22];let y;t[23]!==P||t[24]!==h||t[25]!==v?(y=(0,n.jsx)("span",{className:"ml-auto",children:(0,n.jsx)(wr,{confirmLabel:h,onConfirm:v,testId:"deployment-resume",children:P})}),t[23]=P,t[24]=h,t[25]=v,t[26]=y):y=t[26];let C;return t[27]!==y||t[28]!==u||t[29]!==g||t[30]!==b||t[31]!==m||t[32]!==x?(C=(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-destructive/30 bg-destructive/10 px-6 py-2 text-[12px] text-foreground","data-testid":"deployment-paused-banner",role:"alert",children:[u,g,b,m,x,y]}),t[27]=y,t[28]=u,t[29]=g,t[30]=b,t[31]=m,t[32]=x,t[33]=C):C=t[33],C},"oa"),gh=i(()=>{let t=wo(),e=ue(),{refetch:o,state:r}=$s(),[a,s]=(0,w.useState)(""),[l,d]=(0,w.useState)(void 0);if(r?.supported!==!0)return null;let p=i(async c=>{try{await t.setDeploymentPause(c,c&&a!==""?a:void 0),d(void 0),o()}catch(u){d(To(u))}},"d");return(0,n.jsxs)("div",{className:"flex items-center gap-2","data-testid":"deployment-pause-toggle",children:[(0,n.jsx)("span",{className:"text-sm text-muted-foreground","data-testid":"deployment-pause-state",children:r.paused?e("Deployment paused"):e("Deployment running")}),!r.paused&&(0,n.jsx)(ko,{"aria-label":e("Reason (optional)"),className:"h-8 w-56","data-testid":"deployment-pause-reason",onChange:i(c=>{s(c.target.value)},"onChange"),placeholder:e("Reason (optional)"),value:a}),(0,n.jsx)(wr,{confirmLabel:r.paused?e("Resume deployment?"):e("Pause deployment?"),onConfirm:i(()=>{Ee(p(!r.paused))},"onConfirm"),testId:r.paused?"deployment-toggle-resume":"deployment-toggle-pause",children:r.paused?e("Resume"):e("Pause")}),l!==void 0&&(0,n.jsx)("span",{className:"text-xs text-destructive",role:"alert",children:l})]})},"tr");function Oi(t){if(To(t).includes("(status 404"))return{paused:!1,supported:!1};throw t}i(Oi,"na");var Gs="lunora.studio.rulesBannerDismissed",Di=i(()=>{try{return globalThis.localStorage.getItem(Gs)==="1"}catch{return!1}},"ra"),Mi=i(()=>{try{globalThis.localStorage.setItem(Gs,"1")}catch{}},"la"),Ii=i(()=>{let t=(0,M.c)(18),e=ue(),[o,r]=(0,w.useState)(_i),a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=i(()=>{r(!0),Mi()},"n"),t[0]=a):a=t[0];let s=a;if(o)return null;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"}),t[1]=l):l=t[1];let d;t[2]!==e?(d=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=d):d=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=p):p=t[4];let c;t[5]!==e?(c=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=c):c=t[6];let u;t[7]!==d||t[8]!==c?(u=(0,n.jsxs)("span",{children:[d," ",p," ",c]}),t[7]=d,t[8]=c,t[9]=u):u=t[9];let g;t[10]!==e?(g=e("Dismiss"),t[10]=e,t[11]=g):g=t[11];let b;t[12]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=b):b=t[12];let f;t[13]!==g?(f=(0,n.jsx)("button",{"aria-label":g,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:s,type:"button",children:b}),t[13]=g,t[14]=f):f=t[14];let m;return t[15]!==u||t[16]!==f?(m=(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[l,u,f]}),t[15]=u,t[16]=f,t[17]=m):m=t[17],m},"ia");function _i(){return Di()}i(_i,"da");function Qs(t){let e=(0,M.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,n.jsx)(Ie.Root,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Qs,"rs");function Ys(t){let e=(0,M.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,n.jsx)(Ie.Trigger,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Ys,"ls");function Js({align:t="end",alignOffset:e=0,className:o,keepMounted:r=!1,side:a="bottom",sideOffset:s=6,...l}){return(0,n.jsx)(Ie.Portal,{keepMounted:r,children:(0,n.jsx)(Ie.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:a,sideOffset:s,children:(0,n.jsx)(Ie.Popup,{className:q("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",o),"data-slot":"popover-content",...l})})})}i(Js,"is");var Gr=768;function Ai(){let t=(0,M.c)(2),[e,o]=(0,w.useState)(void 0),r,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i(()=>{let s=globalThis.matchMedia(`(max-width: ${Gr-1}px)`),l=i(()=>{o(globalThis.innerWidth<Gr)},"l");return s.addEventListener("change",l),o(globalThis.innerWidth<Gr),()=>{s.removeEventListener("change",l)}},"a"),a=[],t[0]=r,t[1]=a):(r=t[0],a=t[1]),(0,w.useEffect)(r,a),!!e}i(Ai,"ca");function Vi(t){let e=(0,M.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,n.jsx)(ce.Root,{"data-slot":"sheet",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Vi,"ua");function Hi(t){let e=(0,M.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,n.jsx)(ce.Portal,{"data-slot":"sheet-portal",...o}),e[2]=o,e[3]=r):r=e[3],r}i(Hi,"ma");function Li(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)(ce.Backdrop,{"data-slot":"sheet-overlay",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(Li,"fa");function Bi({className:t,children:e,side:o="right",showCloseButton:r=!0,...a}){return(0,n.jsxs)(Hi,{children:[(0,n.jsx)(Li,{}),(0,n.jsxs)(ce.Popup,{"data-slot":"sheet-content","data-side":o,className:q("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...a,children:[e,r&&(0,n.jsxs)(ce.Close,{"data-slot":"sheet-close",render:(0,n.jsx)(Tr,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[(0,n.jsx)(Or,{icon:Ga,strokeWidth:2}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}i(Bi,"pa");function Fi(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("flex flex-col gap-0.5 p-4",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("div",{"data-slot":"sheet-header",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(Fi,"ha");function ji(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("text-sm font-medium text-foreground",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)(ce.Title,{"data-slot":"sheet-title",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(ji,"ga");function zi(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("text-xs/relaxed text-muted-foreground",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)(ce.Description,{"data-slot":"sheet-description",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(zi,"ba");var Ki="sidebar_state",Ui=3600*24*7,Zi="16rem",qi="18rem",Wi="3rem",$i="b",Xs=Pe.createContext(null);function xr(){let t=Pe.useContext(Xs);if(!t)throw new Rr("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}i(xr,"Mt");function Gi({defaultOpen:t=!0,open:e,onOpenChange:o,className:r,style:a,children:s,...l}){let d=Ai(),[p,c]=Pe.useState(!1),[u,g]=Pe.useState(t),b=e??u,f=i(v=>{let P=typeof v=="function"?v(b):v;o?o(P):g(P),document.cookie=`${Ki}=${P}; path=/; max-age=${Ui}`},"m"),m=i(()=>d?c(v=>!v):f(v=>!v),"g"),x=Pe.useEffectEvent(()=>{m()});Pe.useEffect(()=>{let v=i(P=>{P.key===$i&&(P.metaKey||P.ctrlKey)&&(P.preventDefault(),x())},"h");return globalThis.addEventListener("keydown",v),()=>globalThis.removeEventListener("keydown",v)},[]);let h={state:b?"expanded":"collapsed",open:b,setOpen:f,isMobile:d,openMobile:p,setOpenMobile:c,toggleSidebar:m};return(0,n.jsx)(Xs.Provider,{value:h,children:(0,n.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Zi,"--sidebar-width-icon":Wi,...a},className:q("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...l,children:s})})}i(Gi,"Ma");function Qi({side:t="left",variant:e="sidebar",collapsible:o="offcanvas",className:r,children:a,dir:s,...l}){let{isMobile:d,state:p,openMobile:c,setOpenMobile:u}=xr();return o==="none"?(0,n.jsx)("div",{"data-slot":"sidebar",className:q("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...l,children:a}):d?(0,n.jsx)(Vi,{open:c,onOpenChange:u,...l,children:(0,n.jsxs)(Bi,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":qi},side:t,children:[(0,n.jsxs)(Fi,{className:"sr-only",children:[(0,n.jsx)(ji,{children:"Sidebar"}),(0,n.jsx)(zi,{children:"Displays the mobile sidebar."})]}),(0,n.jsx)("div",{className:"flex h-full w-full flex-col",children:a})]})}):(0,n.jsxs)("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":p==="collapsed"?o:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[(0,n.jsx)("div",{"data-slot":"sidebar-gap",className:q("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,n.jsx)("div",{"data-slot":"sidebar-container","data-side":t,className:q("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",r),...l,children:(0,n.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:a})})]})}i(Qi,"Sa");function Yi(t){let e=(0,M.c)(15),o,r,a;e[0]!==t?({className:o,onClick:r,...a}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=a):(o=e[1],r=e[2],a=e[3]);let{toggleSidebar:s}=xr(),l;e[4]!==o?(l=q(o),e[4]=o,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==s?(d=i(g=>{r?.(g),s()},"i"),e[6]=r,e[7]=s,e[8]=d):d=e[8];let p,c;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)(Or,{icon:Qa,strokeWidth:2,className:"rtl:rotate-180"}),c=(0,n.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=p,e[10]=c):(p=e[9],c=e[10]);let u;return e[11]!==a||e[12]!==l||e[13]!==d?(u=(0,n.jsxs)(Tr,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:l,onClick:d,...a,children:[p,c]}),e[11]=a,e[12]=l,e[13]=d,e[14]=u):u=e[14],u}i(Yi,"Ca");function Ji(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("main",{"data-slot":"sidebar-inset",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(Ji,"Pa");function Xi(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(Xi,"_a");function el(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(el,"Ta");function tl(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(tl,"Aa");function ol(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("relative flex w-full min-w-0 flex-col p-2",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(ol,"Ra");function rl(t){let e=(0,M.c)(10),o,r,a,s;if(e[0]!==t){let{className:p,render:c,...u}=t;o=c,s=Er,r="div",a=co({className:q("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",p)},u),e[0]=t,e[1]=o,e[2]=r,e[3]=a,e[4]=s}else o=e[1],r=e[2],a=e[3],s=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=l):l=e[5];let d;return e[6]!==o||e[7]!==r||e[8]!==a?(d={defaultTagName:r,props:a,render:o,state:l},e[6]=o,e[7]=r,e[8]=a,e[9]=d):d=e[9],s(d)}i(rl,"La");function al(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("w-full text-xs",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(al,"Ia");function Fs(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("flex w-full min-w-0 flex-col gap-0",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(Fs,"Ot");function js(t){let e=(0,M.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let a;e[3]!==o?(a=q("group/menu-item relative",o),e[3]=o,e[4]=a):a=e[4];let s;return e[5]!==r||e[6]!==a?(s=(0,n.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...r}),e[5]=r,e[6]=a,e[7]=s):s=e[7],s}i(js,"Zt");var nl=Pa("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ei({render:t,isActive:e=!1,variant:o="default",size:r="default",tooltip:a,className:s,...l}){let{isMobile:d,state:p}=xr(),c=Er({defaultTagName:"button",props:co({className:q(nl({variant:o,size:r}),s)},l),render:a?(0,n.jsx)(Ni,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:e}});return a?(typeof a=="string"&&(a={children:a}),(0,n.jsxs)(Si,{children:[c,(0,n.jsx)(Ti,{side:"right",align:"center",hidden:p!=="collapsed"||d,...a})]})):c}i(ei,"cs");var sl=i(t=>t.replace("__lunora_admin__:",""),"$a"),il=i(()=>(0,w.useSyncExternalStore)(lo.subscribe,lo.getSnapshot,lo.getSnapshot),"Ha"),ll=i(t=>t==="error"?"destructive":t==="pending"?"secondary":"default","Da"),cl=i(t=>{let e=(0,M.c)(56),{entry:o,focused:r}=t,a=ue(),s;e[0]!==r?(s=i(H=>{H!==null&&r&&H.scrollIntoView({block:"nearest"})},"r"),e[0]=r,e[1]=s):s=e[1];let l=s,d;e[2]!==o.functionPath||e[3]!==o.shardKey||e[4]!==o.summary?(d=i(()=>{ca(`${o.functionPath} ${o.summary}${o.shardKey===""?"":` (shard ${o.shardKey})`}`)},"i"),e[2]=o.functionPath,e[3]=o.shardKey,e[4]=o.summary,e[5]=d):d=e[5];let p=d,c=r&&"bg-accent ring-1 ring-inset ring-primary/40",u;e[6]!==c?(u=q("border-b border-border/60 last:border-b-0",c),e[6]=c,e[7]=u):u=e[7];let g;e[8]!==o.status?(g=ll(o.status),e[8]=o.status,e[9]=g):g=e[9];let b=o.status==="pending"?"\u2026":o.status,f;e[10]!==g||e[11]!==b?(f=(0,n.jsx)(Ft,{className:"mt-px shrink-0",variant:g,children:b}),e[10]=g,e[11]=b,e[12]=f):f=e[12];let m;e[13]!==o.functionPath?(m=sl(o.functionPath),e[13]=o.functionPath,e[14]=m):m=e[14];let x;e[15]!==m?(x=(0,n.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:m}),e[15]=m,e[16]=x):x=e[16];let h;e[17]!==o.kind||e[18]!==a?(h=o.kind==="subscription"&&(0,n.jsx)(Ft,{className:"shrink-0",variant:"outline",children:a("live")}),e[17]=o.kind,e[18]=a,e[19]=h):h=e[19];let v;e[20]!==o.summary?(v=o.summary!==""&&(0,n.jsx)("span",{className:"min-w-0 truncate text-muted-foreground",children:o.summary}),e[20]=o.summary,e[21]=v):v=e[21];let P;e[22]!==o.shardKey?(P=o.shardKey!==""&&(0,n.jsx)("span",{className:"font-mono",children:o.shardKey}),e[22]=o.shardKey,e[23]=P):P=e[23];let y;e[24]!==o.resultCount||e[25]!==a?(y=o.resultCount!==void 0&&(0,n.jsx)("span",{children:a("{count} rows",{count:o.resultCount})}),e[24]=o.resultCount,e[25]=a,e[26]=y):y=e[26];let C;e[27]!==o.pushes||e[28]!==a?(C=o.pushes!==void 0&&o.pushes>0&&(0,n.jsx)("span",{children:a("{count} pushes",{count:o.pushes})}),e[27]=o.pushes,e[28]=a,e[29]=C):C=e[29];let R;e[30]!==o.durationMs?(R=o.durationMs!==void 0&&(0,n.jsxs)("span",{children:[o.durationMs,"ms"]}),e[30]=o.durationMs,e[31]=R):R=e[31];let k;e[32]!==a?(k=a("Copy"),e[32]=a,e[33]=k):k=e[33];let S;e[34]!==p||e[35]!==k?(S=(0,n.jsx)("button",{"aria-label":k,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:p,type:"button",children:"\u29C9"}),e[34]=p,e[35]=k,e[36]=S):S=e[36];let N;e[37]!==P||e[38]!==y||e[39]!==C||e[40]!==R||e[41]!==S?(N=(0,n.jsxs)("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[P,y,C,R,S]}),e[37]=P,e[38]=y,e[39]=C,e[40]=R,e[41]=S,e[42]=N):N=e[42];let E;e[43]!==h||e[44]!==v||e[45]!==N||e[46]!==f||e[47]!==x?(E=(0,n.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[f,x,h,v,N]}),e[43]=h,e[44]=v,e[45]=N,e[46]=f,e[47]=x,e[48]=E):E=e[48];let O;e[49]!==o.error?(O=o.error!==void 0&&(0,n.jsx)("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:o.error}),e[49]=o.error,e[50]=O):O=e[50];let _;return e[51]!==l||e[52]!==E||e[53]!==O||e[54]!==u?(_=(0,n.jsxs)("li",{className:u,"data-testid":"oc-row",ref:l,children:[E,O]}),e[51]=l,e[52]=E,e[53]=O,e[54]=u,e[55]=_):_=e[55],_},"Ba"),dl=i(t=>{let e=(0,M.c)(62),{focusSeq:o,onClose:r,onShownChange:a,shown:s}=t,l=ue(),d=il(),[p,c]=(0,w.useState)(""),u;if(e[0]!==d||e[1]!==o||e[2]!==p||e[3]!==r||e[4]!==a||e[5]!==s||e[6]!==l){let g=p.trim().toLowerCase(),b=d.filter(I=>(s==="errors"?I.status==="error":!0)&&(g===""||`${I.functionPath} ${I.summary} ${I.shardKey}`.toLowerCase().includes(g))).toReversed(),f;e[8]!==d?(f=d.filter(pl),e[8]=d,e[9]=f):f=e[9];let m=f.length,x;e[10]!==l?(x=l("Operation console"),e[10]=l,e[11]=x):x=e[11];let h;e[12]!==l?(h=l("Operation console"),e[12]=l,e[13]=h):h=e[13];let v;e[14]!==h?(v=(0,n.jsx)("span",{className:"text-xs font-medium",children:h}),e[14]=h,e[15]=v):v=e[15];let P;e[16]!==d.length||e[17]!==l?(P=l("{count} calls",{count:d.length}),e[16]=d.length,e[17]=l,e[18]=P):P=e[18];let y;e[19]!==P?(y=(0,n.jsx)(Ft,{variant:"secondary",children:P}),e[19]=P,e[20]=y):y=e[20];let C;e[21]!==m||e[22]!==l?(C=m>0&&(0,n.jsx)(Ft,{variant:"destructive",children:l("{count} failed",{count:m})}),e[21]=m,e[22]=l,e[23]=C):C=e[23];let R=s==="errors",k=s==="errors"&&"bg-accent",S;e[24]!==k?(S=q("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",k),e[24]=k,e[25]=S):S=e[25];let N;e[26]!==a||e[27]!==s?(N=i(()=>{a(s==="errors"?"all":"errors")},"M"),e[26]=a,e[27]=s,e[28]=N):N=e[28];let E;e[29]!==l?(E=l("Errors"),e[29]=l,e[30]=E):E=e[30];let O;e[31]!==S||e[32]!==N||e[33]!==E||e[34]!==R?(O=(0,n.jsx)("button",{"aria-pressed":R,className:S,"data-testid":"oc-filter-errors",onClick:N,type:"button",children:E}),e[31]=S,e[32]=N,e[33]=E,e[34]=R,e[35]=O):O=e[35];let _;e[36]!==l?(_=l("Filter"),e[36]=l,e[37]=_):_=e[37];let H;e[38]===Symbol.for("react.memo_cache_sentinel")?(H=i(I=>{c(I.target.value)},"D"),e[38]=H):H=e[38];let V;e[39]!==l?(V=l("Filter"),e[39]=l,e[40]=V):V=e[40];let L;e[41]!==p||e[42]!==_||e[43]!==V?(L=(0,n.jsx)(ko,{"aria-label":_,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:H,placeholder:V,value:p}),e[41]=p,e[42]=_,e[43]=V,e[44]=L):L=e[44];let F;e[45]!==l?(F=l("Clear"),e[45]=l,e[46]=F):F=e[46];let j;e[47]!==F?(j=(0,n.jsx)("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:ul,type:"button",children:F}),e[47]=F,e[48]=j):j=e[48];let U;e[49]!==l?(U=l("Hide"),e[49]=l,e[50]=U):U=e[50];let z;e[51]!==r||e[52]!==U?(z=(0,n.jsx)("button",{"aria-label":U,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:r,type:"button",children:"\u2715"}),e[51]=r,e[52]=U,e[53]=z):z=e[53];let D;e[54]!==O||e[55]!==L||e[56]!==j||e[57]!==z||e[58]!==v||e[59]!==y||e[60]!==C?(D=(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[v,y,C,O,L,j,z]}),e[54]=O,e[55]=L,e[56]=j,e[57]=z,e[58]=v,e[59]=y,e[60]=C,e[61]=D):D=e[61],u=(0,n.jsxs)("section",{"aria-label":x,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[D,b.length===0?(0,n.jsx)("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:l("Every admin call this studio makes is recorded here.")}):(0,n.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:b.map(I=>(0,n.jsx)(cl,{entry:I,focused:I.seq===o},I.seq))})]}),e[0]=d,e[1]=o,e[2]=p,e[3]=r,e[4]=a,e[5]=s,e[6]=l,e[7]=u}else u=e[7];return u},"Va");function pl(t){return t.status==="error"}i(pl,"za");function ul(){lo.clear()}i(ul,"Oa");var ml=i(()=>{let t=(0,M.c)(334),e=ue(),o;t[0]!==e?(o=e("Health score"),t[0]=e,t[1]=o):o=t[1];let r;t[2]!==e?(r=e("Agents"),t[2]=e,t[3]=r):r=t[3];let a;t[4]!==e?(a=e("Evals"),t[4]=e,t[5]=a):a=t[5];let s;t[6]!==e?(s=e("AI usage"),t[6]=e,t[7]=s):s=t[7];let l;t[8]!==e?(l=e("Analytics"),t[8]=e,t[9]=l):l=t[9];let d;t[10]!==e?(d=e("API"),t[10]=e,t[11]=d):d=t[11];let p;t[12]!==e?(p=e("Architecture"),t[12]=e,t[13]=p):p=t[13];let c;t[14]!==e?(c=e("Audit"),t[14]=e,t[15]=c):c=t[15];let u;t[16]!==e?(u=e("Auth audit"),t[16]=e,t[17]=u):u=t[17];let g;t[18]!==e?(g=e("Configuration"),t[18]=e,t[19]=g):g=t[19];let b;t[20]!==e?(b=e("Sessions"),t[20]=e,t[21]=b):b=t[21];let f;t[22]!==e?(f=e("Containers"),t[22]=e,t[23]=f):f=t[23];let m;t[24]!==e?(m=e("Dashboards"),t[24]=e,t[25]=m):m=t[25];let x;t[26]!==e?(x=e("Data"),t[26]=e,t[27]=x):x=t[27];let h;t[28]!==e?(h=e("Deployment health"),t[28]=e,t[29]=h):h=t[29];let v;t[30]!==e?(v=e("Log drains"),t[30]=e,t[31]=v):v=t[31];let P;t[32]!==e?(P=e("Export / Import"),t[32]=e,t[33]=P):P=t[33];let y;t[34]!==e?(y=e("Fan-out"),t[34]=e,t[35]=y):y=t[35];let C;t[36]!==e?(C=e("Files"),t[36]=e,t[37]=C):C=t[37];let R;t[38]!==e?(R=e("Flags"),t[38]=e,t[39]=R):R=t[39];let k;t[40]!==e?(k=e("Functions"),t[40]=e,t[41]=k):k=t[41];let S;t[42]!==e?(S=e("Health"),t[42]=e,t[43]=S):S=t[43];let N;t[44]!==e?(N=e("Home"),t[44]=e,t[45]=N):N=t[45];let E;t[46]!==e?(E=e("Performance"),t[46]=e,t[47]=E):E=t[47];let O;t[48]!==e?(O=e("Issues"),t[48]=e,t[49]=O):O=t[49];let _;t[50]!==e?(_=e("KV"),t[50]=e,t[51]=_):_=t[51];let H;t[52]!==e?(H=e("Logs"),t[52]=e,t[53]=H):H=t[53];let V;t[54]!==e?(V=e("Metrics"),t[54]=e,t[55]=V):V=t[55];let L;t[56]!==e?(L=e("Migrations"),t[56]=e,t[57]=L):L=t[57];let F;t[58]!==e?(F=e("Notifications"),t[58]=e,t[59]=F):F=t[59];let j;t[60]!==e?(j=e("Organizations"),t[60]=e,t[61]=j):j=t[61];let U;t[62]!==e?(U=e("Time Travel"),t[62]=e,t[63]=U):U=t[63];let z;t[64]!==e?(z=e("Privacy requests"),t[64]=e,t[65]=z):z=t[65];let D;t[66]!==e?(D=e("Mail"),t[66]=e,t[67]=D):D=t[67];let I;t[68]!==e?(I=e("Payments"),t[68]=e,t[69]=I):I=t[69];let W;t[70]!==e?(W=e("Permissions"),t[70]=e,t[71]=W):W=t[71];let $;t[72]!==e?($=e("Queues"),t[72]=e,t[73]=$):$=t[73];let ie;t[74]!==e?(ie=e("Reactors"),t[74]=e,t[75]=ie):ie=t[75];let oe;t[76]!==e?(oe=e("Realtime"),t[76]=e,t[77]=oe):oe=t[77];let re;t[78]!==e?(re=e("RLS Policies"),t[78]=e,t[79]=re):re=t[79];let ee;t[80]!==e?(ee=e("Scheduled"),t[80]=e,t[81]=ee):ee=t[81];let Y;t[82]!==e?(Y=e("Schema"),t[82]=e,t[83]=Y):Y=t[83];let be;t[84]!==e?(be=e("Security"),t[84]=e,t[85]=be):be=t[85];let de;t[86]!==e?(de=e("Settings"),t[86]=e,t[87]=de):de=t[87];let me;t[88]!==e?(me=e("SQL editor"),t[88]=e,t[89]=me):me=t[89];let fe;t[90]!==e?(fe=e("Traces"),t[90]=e,t[91]=fe):fe=t[91];let ge;t[92]!==e?(ge=e("Access Rules"),t[92]=e,t[93]=ge):ge=t[93];let Z;t[94]!==e?(Z=e("Users"),t[94]=e,t[95]=Z):Z=t[95];let G;t[96]!==e?(G=e("Vectors"),t[96]=e,t[97]=G):G=t[97];let te;t[98]!==e?(te=e("Workflows"),t[98]=e,t[99]=te):te=t[99];let xe;t[100]!==o||t[101]!==r||t[102]!==b||t[103]!==f||t[104]!==m||t[105]!==x||t[106]!==h||t[107]!==v||t[108]!==P||t[109]!==y||t[110]!==C||t[111]!==R||t[112]!==a||t[113]!==k||t[114]!==S||t[115]!==N||t[116]!==E||t[117]!==O||t[118]!==_||t[119]!==H||t[120]!==V||t[121]!==L||t[122]!==F||t[123]!==s||t[124]!==j||t[125]!==U||t[126]!==z||t[127]!==D||t[128]!==I||t[129]!==W||t[130]!==$||t[131]!==ie||t[132]!==oe||t[133]!==re||t[134]!==l||t[135]!==ee||t[136]!==Y||t[137]!==be||t[138]!==de||t[139]!==me||t[140]!==fe||t[141]!==ge||t[142]!==Z||t[143]!==G||t[144]!==te||t[145]!==d||t[146]!==p||t[147]!==c||t[148]!==u||t[149]!==g?(xe={advisorHealth:o,agents:r,evals:a,aiUsage:s,analytics:l,api:d,architecture:p,audit:c,authAudit:u,authConfig:g,authSessions:b,containers:f,dashboards:m,data:x,deploymentHealth:h,drains:v,export:P,fanout:y,files:C,flags:R,functions:k,health:S,home:N,insights:E,issues:O,kv:_,logs:H,metrics:V,migrations:L,notifications:F,organizations:j,pitr:U,privacyRequests:z,mail:D,payments:I,permissions:W,queues:$,reactors:ie,realtime:oe,rls:re,schedule:ee,schema:Y,security:be,settings:de,sql:me,traces:fe,storageRules:ge,users:Z,vectors:G,workflows:te},t[100]=o,t[101]=r,t[102]=b,t[103]=f,t[104]=m,t[105]=x,t[106]=h,t[107]=v,t[108]=P,t[109]=y,t[110]=C,t[111]=R,t[112]=a,t[113]=k,t[114]=S,t[115]=N,t[116]=E,t[117]=O,t[118]=_,t[119]=H,t[120]=V,t[121]=L,t[122]=F,t[123]=s,t[124]=j,t[125]=U,t[126]=z,t[127]=D,t[128]=I,t[129]=W,t[130]=$,t[131]=ie,t[132]=oe,t[133]=re,t[134]=l,t[135]=ee,t[136]=Y,t[137]=be,t[138]=de,t[139]=me,t[140]=fe,t[141]=ge,t[142]=Z,t[143]=G,t[144]=te,t[145]=d,t[146]=p,t[147]=c,t[148]=u,t[149]=g,t[150]=xe):xe=t[150];let pe=xe,ve;t[151]!==e?(ve=e("Advisors"),t[151]=e,t[152]=ve):ve=t[152];let Se;t[153]!==e?(Se=e("Auth"),t[153]=e,t[154]=Se):Se=t[154];let Ne;t[155]!==e?(Ne=e("Database"),t[155]=e,t[156]=Ne):Ne=t[156];let Ae;t[157]!==e?(Ae=e("Functions"),t[157]=e,t[158]=Ae):Ae=t[158];let Ve;t[159]!==e?(Ve=e("Observability"),t[159]=e,t[160]=Ve):Ve=t[160];let He;t[161]!==e?(He=e("Operations"),t[161]=e,t[162]=He):He=t[162];let Le;t[163]!==e?(Le=e("Overview"),t[163]=e,t[164]=Le):Le=t[164];let Be;t[165]!==e?(Be=e("Settings"),t[165]=e,t[166]=Be):Be=t[166];let Fe;t[167]!==e?(Fe=e("Storage"),t[167]=e,t[168]=Fe):Fe=t[168];let Ro;t[169]!==ve||t[170]!==Se||t[171]!==Ne||t[172]!==Ae||t[173]!==Ve||t[174]!==He||t[175]!==Le||t[176]!==Be||t[177]!==Fe?(Ro={advisors:ve,auth:Se,database:Ne,functions:Ae,observability:Ve,operations:He,overview:Le,settings:Be,storage:Fe},t[169]=ve,t[170]=Se,t[171]=Ne,t[172]=Ae,t[173]=Ve,t[174]=He,t[175]=Le,t[176]=Be,t[177]=Fe,t[178]=Ro):Ro=t[178];let yr=Ro,je;t[179]!==e?(je=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[179]=e,t[180]=je):je=t[180];let ze;t[181]!==e?(ze=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[181]=e,t[182]=ze):ze=t[182];let Ke;t[183]!==e?(Ke=e("Scores recorded by recordEvaluation \u2014 the latest verdict per eval, its trend, and the graded runs behind it."),t[183]=e,t[184]=Ke):Ke=t[184];let Ue;t[185]!==e?(Ue=e("Tokens and spend from ctx.ai.model calls \u2014 totals, per function and per model, and the recent calls behind them."),t[185]=e,t[186]=Ue):Ue=t[186];let Ze;t[187]!==e?(Ze=e("Usage and latency from Analytics Engine \u2014 request volume, p50/p95, and hot shards."),t[187]=e,t[188]=Ze):Ze=t[188];let qe;t[189]!==e?(qe=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[189]=e,t[190]=qe):qe=t[190];let We;t[191]!==e?(We=e("A durable log of admin state-changing operations."),t[191]=e,t[192]=We):We=t[192];let $e;t[193]!==e?($e=e("Authentication and security events \u2014 sign-ins, MFA, and session changes."),t[193]=e,t[194]=$e):$e=t[194];let Ge;t[195]!==e?(Ge=e("Enabled plugins and session config (read-only)."),t[195]=e,t[196]=Ge):Ge=t[196];let Qe;t[197]!==e?(Qe=e("Your modules, and the calls, reads, writes and hand-offs between them, from codegen."),t[197]=e,t[198]=Qe):Qe=t[198];let Ye;t[199]!==e?(Ye=e("Browse and revoke active sessions across all users."),t[199]=e,t[200]=Ye):Ye=t[200];let Je;t[201]!==e?(Je=e("Live Cloudflare Containers \u2014 current lifecycle state per instance from the log stream."),t[201]=e,t[202]=Je):Je=t[202];let Xe;t[203]!==e?(Xe=e("Chart widgets backed by saved read-only SQL queries."),t[203]=e,t[204]=Xe):Xe=t[204];let et;t[205]!==e?(et=e("Browse and edit rows across your shard and global tables."),t[205]=e,t[206]=et):et=t[206];let tt;t[207]!==e?(tt=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[207]=e,t[208]=tt):tt=t[208];let ot;t[209]!==e?(ot=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[209]=e,t[210]=ot):ot=t[210];let rt;t[211]!==e?(rt=e("Export a shard to NDJSON, or import rows from it."),t[211]=e,t[212]=rt):rt=t[212];let at;t[213]!==e?(at=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[213]=e,t[214]=at):at=t[214];let nt;t[215]!==e?(nt=e("Browse objects in your R2 storage buckets."),t[215]=e,t[216]=nt):nt=t[216];let st;t[217]!==e?(st=e("Inspect feature flags and their live evaluation under a targeting context."),t[217]=e,t[218]=st):st=t[218];let it;t[219]!==e?(it=e("Run registered queries, mutations, and actions."),t[219]=e,t[220]=it):it=t[220];let lt;t[221]!==e?(lt=e("At-a-glance connection, error, and shard signals."),t[221]=e,t[222]=lt):lt=t[222];let ct;t[223]!==e?(ct=e("Connection, health, and advisor summary for your deployment."),t[223]=e,t[224]=ct):ct=t[224];let dt;t[225]!==e?(dt=e("Surface slow functions, error spikes, and cache problems."),t[225]=e,t[226]=dt):dt=t[226];let pt;t[227]!==e?(pt=e("Grouped error triage \u2014 Worker throws and container crashes folded by fingerprint."),t[227]=e,t[228]=pt):pt=t[228];let ut;t[229]!==e?(ut=e("A live stream of recent function logs."),t[229]=e,t[230]=ut):ut=t[230];let mt;t[231]!==e?(mt=e("Per-shard health and aggregate metrics."),t[231]=e,t[232]=mt):mt=t[232];let ft;t[233]!==e?(ft=e("Review migration status and run them."),t[233]=e,t[234]=ft):ft=t[234];let gt;t[235]!==e?(gt=e("Registered push devices \u2014 endpoint, kind, last-send status, and delivery errors."),t[235]=e,t[236]=gt):gt=t[236];let ht;t[237]!==e?(ht=e("Browse and manage organizations, members, and invitations."),t[237]=e,t[238]=ht):ht=t[238];let vt;t[239]!==e?(vt=e("Restore a shard to a point in the last 30 days."),t[239]=e,t[240]=vt):vt=t[240];let bt;t[241]!==e?(bt=e("Open data-subject export and erasure requests, with due dates and failed-run retries."),t[241]=e,t[242]=bt):bt=t[242];let xt;t[243]!==e?(xt=e("Email your app sent, captured in dev."),t[243]=e,t[244]=xt):xt=t[244];let yt;t[245]!==e?(yt=e("Synced customers, subscriptions, and webhook events."),t[245]=e,t[246]=yt):yt=t[246];let Pt;t[247]!==e?(Pt=e("Inspect access policies per table, and probe a function as any identity."),t[247]=e,t[248]=Pt):Pt=t[248];let Ct;t[249]!==e?(Ct=e("Inspect declared Cloudflare Queues \u2014 their producer bindings, consumer mode, and dead-letter queue."),t[249]=e,t[250]=Ct):Ct=t[250];let Rt;t[251]!==e?(Rt=e("Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing."),t[251]=e,t[252]=Rt):Rt=t[252];let St;t[253]!==e?(St=e("Active WebSocket subscriptions on this shard."),t[253]=e,t[254]=St):St=t[254];let Nt;t[255]!==e?(Nt=e("Inspect row-level-security policies and roles, per table."),t[255]=e,t[256]=Nt):Nt=t[256];let Tt;t[257]!==e?(Tt=e("Inspect and cancel scheduled jobs."),t[257]=e,t[258]=Tt):Tt=t[258];let wt;t[259]!==e?(wt=e("Inspect each table and its columns."),t[259]=e,t[260]=wt):wt=t[260];let Et;t[261]!==e?(Et=e("Review admin gates, credentials, and log redaction."),t[261]=e,t[262]=Et):Et=t[262];let kt;t[263]!==e?(kt=e("Read-only deployment config \u2014 vars, secrets, and bindings."),t[263]=e,t[264]=kt):kt=t[264];let Ot;t[265]!==e?(Ot=e("Run read-only SQL against a shard."),t[265]=e,t[266]=Ot):Ot=t[266];let Dt;t[267]!==e?(Dt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[267]=e,t[268]=Dt):Dt=t[268];let Mt;t[269]!==e?(Mt=e("Inspect storage access rules \u2014 per bucket, operation, and key prefix."),t[269]=e,t[270]=Mt):Mt=t[270];let It;t[271]!==e?(It=e("Recent ctx.trace waterfalls for this shard \u2014 the drill-down from a log line."),t[271]=e,t[272]=It):It=t[272];let _t;t[273]!==e?(_t=e("Manage auth users \u2014 roles, bans, sessions, and identity."),t[273]=e,t[274]=_t):_t=t[274];let At;t[275]!==e?(At=e("Browse Vectorize indexes and run similarity searches."),t[275]=e,t[276]=At):At=t[276];let Vt;t[277]!==e?(Vt=e("Inspect declared Cloudflare Workflows and their bindings."),t[277]=e,t[278]=Vt):Vt=t[278];let So;t[279]!==Tt||t[280]!==wt||t[281]!==Et||t[282]!==kt||t[283]!==Ot||t[284]!==Dt||t[285]!==Mt||t[286]!==It||t[287]!==_t||t[288]!==At||t[289]!==Vt||t[290]!==je||t[291]!==ze||t[292]!==Ke||t[293]!==Ue||t[294]!==Ze||t[295]!==qe||t[296]!==We||t[297]!==$e||t[298]!==Ge||t[299]!==Qe||t[300]!==Ye||t[301]!==Je||t[302]!==Xe||t[303]!==et||t[304]!==tt||t[305]!==ot||t[306]!==rt||t[307]!==at||t[308]!==nt||t[309]!==st||t[310]!==it||t[311]!==lt||t[312]!==ct||t[313]!==dt||t[314]!==pt||t[315]!==ut||t[316]!==mt||t[317]!==ft||t[318]!==gt||t[319]!==ht||t[320]!==vt||t[321]!==bt||t[322]!==xt||t[323]!==yt||t[324]!==Pt||t[325]!==Ct||t[326]!==Rt||t[327]!==St||t[328]!==Nt?(So={advisorHealth:je,agents:ze,evals:Ke,aiUsage:Ue,analytics:Ze,api:qe,audit:We,authAudit:$e,authConfig:Ge,architecture:Qe,authSessions:Ye,containers:Je,dashboards:Xe,data:et,deploymentHealth:tt,drains:ot,export:rt,fanout:at,files:nt,flags:st,functions:it,health:lt,home:ct,insights:dt,issues:pt,logs:ut,metrics:mt,migrations:ft,notifications:gt,organizations:ht,pitr:vt,privacyRequests:bt,mail:xt,payments:yt,permissions:Pt,queues:Ct,reactors:Rt,realtime:St,rls:Nt,schedule:Tt,schema:wt,security:Et,settings:kt,sql:Ot,kv:Dt,storageRules:Mt,traces:It,users:_t,vectors:At,workflows:Vt},t[279]=Tt,t[280]=wt,t[281]=Et,t[282]=kt,t[283]=Ot,t[284]=Dt,t[285]=Mt,t[286]=It,t[287]=_t,t[288]=At,t[289]=Vt,t[290]=je,t[291]=ze,t[292]=Ke,t[293]=Ue,t[294]=Ze,t[295]=qe,t[296]=We,t[297]=$e,t[298]=Ge,t[299]=Qe,t[300]=Ye,t[301]=Je,t[302]=Xe,t[303]=et,t[304]=tt,t[305]=ot,t[306]=rt,t[307]=at,t[308]=nt,t[309]=st,t[310]=it,t[311]=lt,t[312]=ct,t[313]=dt,t[314]=pt,t[315]=ut,t[316]=mt,t[317]=ft,t[318]=gt,t[319]=ht,t[320]=vt,t[321]=bt,t[322]=xt,t[323]=yt,t[324]=Pt,t[325]=Ct,t[326]=Rt,t[327]=St,t[328]=Nt,t[329]=So):So=t[329];let Pr=So,No;return t[330]!==yr||t[331]!==Pr||t[332]!==pe?(No={groupLabel:yr,tabDescription:Pr,tabLabel:pe},t[330]=yr,t[331]=Pr,t[332]=pe,t[333]=No):No=t[333],No},"Za"),fl=i(()=>{let t=(0,M.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,n.jsx)("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),(0,n.jsx)("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},"qa"),gl=i(()=>{let t=(0,M.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),t[0]=e):e=t[0],e},"Fa"),hl=i(()=>{let t=(0,M.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},"Wa"),vl=i(t=>{let e=(0,M.c)(2),{className:o}=t,r;return e[0]!==o?(r=(0,n.jsx)("span",{className:o}),e[0]=o,e[1]=r):r=e[1],r},"Ua"),bl=(0,w.lazy)(()=>import("./chunk-2EB7FN5S.js").catch(()=>({default:vl}))),Qr="absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",xl=[{Icon:fl,value:"system"},{Icon:gl,value:"light"},{Icon:hl,value:"dark"}],yl=i(()=>{let t=(0,M.c)(21),{theme:e,setTheme:o}=Ri(),r=ue(),[a,s]=(0,w.useState)(!1),l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=i(()=>{s(!0)},"l"),t[0]=l):l=t[0];let d=l,p;t[1]!==r?(p=r("Dark theme"),t[1]=r,t[2]=p):p=t[2];let c;t[3]!==r?(c=r("Light theme"),t[3]=r,t[4]=c):c=t[4];let u;t[5]!==r?(u=r("System theme"),t[5]=r,t[6]=u):u=t[6];let g;t[7]!==p||t[8]!==c||t[9]!==u?(g={dark:p,light:c,system:u},t[7]=p,t[8]=c,t[9]=u,t[10]=g):g=t[10];let b=g,f;t[11]!==r?(f=r("Theme"),t[11]=r,t[12]=f):f=t[12];let m;t[13]!==a||t[14]!==b||t[15]!==o||t[16]!==e?(m=xl.map(h=>{let{Icon:v,value:P}=h,y=e===P;return(0,n.jsxs)("button",{"aria-checked":y,"aria-label":b[P],className:q("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",y?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${P}`,onClick:i(()=>{d(),o(P)},"onClick"),role:"radio",title:b[P],type:"button",children:[y&&(a?(0,n.jsx)(w.Suspense,{fallback:(0,n.jsx)("span",{className:Qr}),children:(0,n.jsx)(bl,{className:Qr})}):(0,n.jsx)("span",{className:Qr})),(0,n.jsx)("span",{className:"relative",children:(0,n.jsx)(v,{})})]},P)}),t[13]=a,t[14]=b,t[15]=o,t[16]=e,t[17]=m):m=t[17];let x;return t[18]!==f||t[19]!==m?(x=(0,n.jsx)("div",{"aria-label":f,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",onFocus:d,onPointerEnter:d,role:"radiogroup",children:m}),t[18]=f,t[19]=m,t[20]=x):x=t[20],x},"Qa"),Pl=i(t=>{let e=(0,M.c)(23),{domain:o,onOpenCommandPalette:r,page:a}=t,s=ue(),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(Yi,{className:"-ms-1"}),e[0]=l):l=e[0];let d;e[1]!==s?(d=s("Breadcrumb"),e[1]=s,e[2]=d):d=e[2];let p;e[3]!==o?(p=(0,n.jsx)("span",{className:"text-muted-foreground",children:o}),e[3]=o,e[4]=p):p=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=c):c=e[5];let u;e[6]!==a?(u=(0,n.jsx)("span",{className:"font-medium text-foreground",children:a}),e[6]=a,e[7]=u):u=e[7];let g;e[8]!==d||e[9]!==p||e[10]!==u?(g=(0,n.jsxs)("nav",{"aria-label":d,className:"flex items-center gap-1.5 text-[13px]",children:[p,c,u]}),e[8]=d,e[9]=p,e[10]=u,e[11]=g):g=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,n.jsx)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=b):b=e[12];let f;e[13]!==s?(f=s("Search\u2026"),e[13]=s,e[14]=f):f=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=(0,n.jsx)("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"\u2318K"}),e[15]=m):m=e[15];let x;e[16]!==r||e[17]!==f?(x=(0,n.jsxs)("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:r,type:"button",children:[b,f,m]}),e[16]=r,e[17]=f,e[18]=x):x=e[18];let h;e[19]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:(0,n.jsx)(yl,{})}),e[19]=h):h=e[19];let v;return e[20]!==x||e[21]!==g?(v=(0,n.jsxs)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[l,g,x,h]}),e[20]=x,e[21]=g,e[22]=v):v=e[22],v},"Ka"),Cl={agents:{capability:"agents"},analytics:{capability:"analytics",feature:"analytics"},authAudit:{feature:"auth"},authConfig:{feature:"auth"},authSessions:{feature:"auth"},containers:{capability:"containers",feature:"containers"},fanout:{capability:"crossShardFanout"},files:{capability:"objectStorage",feature:"storage"},flags:{feature:"flags"},kv:{capability:"keyValueStore",feature:"kv"},mail:{capability:"mail",feature:"mail"},notifications:{feature:"notifications"},organizations:{feature:"auth"},payments:{feature:"payments"},pitr:{capability:"pointInTimeRecovery"},privacyRequests:{feature:"privacy"},queues:{capability:"queues",feature:"queues"},reactors:{capability:"serverReactors"},schedule:{capability:"scheduler",feature:"scheduler"},storageRules:{feature:"storage"},users:{feature:"auth"},vectors:{capability:"vectorStore",feature:"vectors"},workflows:{capability:"workflows",feature:"workflows"}},Rl={agents:"Durable agents",analytics:"Analytics",containers:"Containers",crossShardFanout:"Cross-shard fan-out",keyValueStore:"Key-value storage",mail:"Mail delivery",objectStorage:"Object storage",pointInTimeRecovery:"Point-in-time recovery",queues:"Queues",scheduler:"Scheduling",serverReactors:"Server reactors",vectorStore:"Vector search",workflows:"Workflows"},Sl={kind:"hidden"},zs={kind:"ok"},Nl={kind:"pending"},ti=i((t,e,o)=>{let r=Cl[t];return r?.feature!==void 0&&!e[r.feature]?Sl:r?.capability===void 0?zs:e.settled?e.platform?.unsupported.includes(r.capability)===!0?{kind:"unavailable",reason:o("{capability} is not supported on {platform}.",{capability:o(Rl[r.capability]),platform:e.platform.name})}:zs:Nl},"us"),Tl=i((t,e,o)=>{let r={},a=[];for(let s of t){let l=[];for(let d of s.tabs){let p=ti(d,e,o);p.kind!=="hidden"&&l.push(d),p.kind==="unavailable"&&(r[d]=p.reason)}l.length>0&&a.push({...s,tabs:l})}return{unavailable:r,visibleGroups:a}},"to"),wl=i(t=>{let e=(0,M.c)(3),{reason:o,title:r}=t,a;return e[0]!==o||e[1]!==r?(a=(0,n.jsx)(Ya,{description:o,testId:"dash-unsupported",title:r}),e[0]=o,e[1]=r,e[2]=a):a=e[2],a},"so"),El=i(t=>{let e=(0,M.c)(4),{console:o}=Yo(),r,a;e[0]!==o||e[1]!==t?(r=i(()=>{if(t===void 0)return;let s=i(l=>{if(!l.ctrlKey||l.metaKey||l.altKey||l.shiftKey||l.repeat||l.key.toLowerCase()!==o)return;let{target:d}=l;d instanceof HTMLElement&&(d.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(d.tagName))||(l.preventDefault(),t())},"r");return globalThis.addEventListener("keydown",s),()=>{globalThis.removeEventListener("keydown",s)}},"a"),a=[o,t],e[0]=o,e[1]=t,e[2]=r,e[3]=a):(r=e[2],a=e[3]),(0,w.useEffect)(r,a)},"ao"),Q=i((t,e)=>(0,w.lazy)(()=>t().then(o=>({default:o[e]}))),"$"),kl=Q(()=>import("./chunk-NEGISEDY.js"),"InsightsPanel"),Ol=(0,w.lazy)(()=>import("./chunk-7MYNH4FV.js")),Dl=(0,w.lazy)(()=>import("./chunk-FWCWPMMH.js")),Ml=(0,w.lazy)(()=>import("./chunk-JBGSBRHU.js")),Il=(0,w.lazy)(()=>import("./chunk-SIMN2JMH.js")),_l=(0,w.lazy)(()=>import("./chunk-YAHEWRDC.js")),Al=Q(()=>import("./chunk-JUCO5WUV.js"),"AnalyticsPanel"),Vl=(0,w.lazy)(()=>import("./chunk-3RDUIFQ2.js")),Hl=(0,w.lazy)(()=>import("./chunk-HDC7PCKE.js")),Ll=(0,w.lazy)(()=>import("./chunk-QHMICJL5.js")),Bl=(0,w.lazy)(()=>import("./chunk-3ZGPXDJ4.js")),Fl=(0,w.lazy)(()=>import("./chunk-PNFIIVQG.js")),jl=(0,w.lazy)(()=>import("./chunk-NZMLDVDH.js")),zl=Q(()=>import("./chunk-VOG262N5.js"),"UsersPanel"),Kl=(0,w.lazy)(()=>import("./chunk-Q5RHT6OH.js")),Ul=Q(()=>import("./chunk-D6NAWS5P.js"),"DeploymentHealthPanel"),Zl=Q(()=>import("./chunk-4KMCJFHZ.js"),"TableEditor"),ql=Q(()=>import("./chunk-F2GUD4BL.js"),"ExportImportPanel"),Wl=(0,w.lazy)(()=>import("./chunk-WYNGYEZR.js")),$l={data:en,migrations:tn},Gl=Q(()=>import("./chunk-TWVNHWE7.js"),"PitrPanel"),Ql=Q(()=>import("./chunk-IDEFXN4C.js"),"PrivacyRequestsPanel"),Yl=(0,w.lazy)(()=>import("./chunk-OBVZIDIU.js")),Jl=(0,w.lazy)(()=>import("./chunk-7OZPINI4.js")),Xl=Q(()=>import("./chunk-YM3HTXWH.js"),"FunctionRunner"),ec=Q(()=>import("./chunk-XSWXBYQU.js"),"FunctionStatsPanel"),tc=(0,w.lazy)(()=>import("./chunk-MYIDM3IF.js")),oc=Q(()=>import("./chunk-GYZWBIV5.js"),"AuditPanel"),rc=(0,w.lazy)(()=>import("./chunk-IXPMM6KT.js")),ac=(0,w.lazy)(()=>import("./chunk-WQWNIVVZ.js").then(t=>({default:t.LogsPanel}))),nc=Q(()=>import("./chunk-YPMRBJDE.js"),"MailPanel"),sc=Q(()=>import("./chunk-GWRXYNN4.js"),"SchedulePanel"),ic=(0,w.lazy)(()=>import("./chunk-43IIUGWM.js")),lc=(0,w.lazy)(()=>import("./chunk-PAR27NLE.js")),cc=Q(()=>import("./chunk-TQLJ6WS4.js"),"KvBrowser"),dc=(0,w.lazy)(()=>import("./chunk-5L4C6Z7K.js")),pc=Q(()=>import("./chunk-GBL62M7L.js"),"PaymentsPanel"),uc=Q(()=>import("./chunk-M4KIEY3B.js"),"PermissionsPanel"),mc=(0,w.lazy)(()=>import("./chunk-NMBKSBYQ.js")),fc=(0,w.lazy)(()=>import("./chunk-R3JCGGD6.js")),gc=(0,w.lazy)(()=>import("./chunk-KXDEQH47.js")),hc=Q(()=>import("./chunk-TTD4VIKR.js"),"HealthPanel"),vc=Q(()=>import("./chunk-OE33ZUC4.js"),"MetricsPanel"),bc=Q(()=>import("./chunk-IOU52UNN.js"),"SchemaViewer"),xc=Q(()=>import("./chunk-TPWDY3VI.js"),"SettingsPanel"),yc=Q(()=>import("./chunk-LYJGUYBX.js"),"SqlEditorPanel"),Pc=Q(()=>import("./chunk-BTR2GIRT.js"),"FileBrowser"),Cc=(0,w.lazy)(()=>import("./chunk-UJ6FKZC4.js")),Rc=(0,w.lazy)(()=>import("./chunk-UKVSYL5L.js")),Sc=(0,w.lazy)(()=>import("./chunk-MW2MAWEQ.js")),Nc=(0,w.lazy)(()=>import("./chunk-LA3JZW4O.js")),Tc=Q(()=>import("./chunk-IV35MWJJ.js"),"VectorBrowser"),wc=(0,w.lazy)(()=>import("./chunk-2TG6UMQG.js")),oi=(0,w.createContext)(null),Ec={analytics:(0,n.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:(0,n.jsx)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),architecture:(0,n.jsx)("path",{d:"M4 4h6v5H4V4Zm10 0h6v5h-6V4ZM9 15h6v5H9v-5ZM7 9v3h10V9M12 12v3"}),audit:(0,n.jsx)("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"}),authAudit:(0,n.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:(0,n.jsx)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),agents:(0,n.jsx)("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:(0,n.jsx)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:(0,n.jsx)("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:(0,n.jsx)("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:(0,n.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2 3 4-5"}),drains:(0,n.jsx)("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:(0,n.jsx)("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"}),export:(0,n.jsx)("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:(0,n.jsx)("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"}),files:(0,n.jsx)("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"}),flags:(0,n.jsx)("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:(0,n.jsx)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:(0,n.jsx)("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),aiUsage:(0,n.jsx)("path",{d:"M12 3v3m0 12v3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1M3 12h3m12 0h3M5.6 18.4l2.1-2.1m8.6-8.6 2.1-2.1M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z"}),health:(0,n.jsx)("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:(0,n.jsx)("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:(0,n.jsx)("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"}),issues:(0,n.jsx)("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:(0,n.jsx)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:(0,n.jsx)("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:(0,n.jsx)("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:(0,n.jsx)("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:(0,n.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:(0,n.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"}),notifications:(0,n.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:(0,n.jsx)("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:(0,n.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"}),pitr:(0,n.jsx)("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),privacyRequests:(0,n.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h4"}),queues:(0,n.jsx)("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),reactors:(0,n.jsx)("path",{d:"M4 4v6h6M20 20v-6h-6M20 9a8 8 0 0 0-14.7-3M4 15a8 8 0 0 0 14.7 3"}),realtime:(0,n.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),rls:(0,n.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"}),schedule:(0,n.jsx)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:(0,n.jsx)("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:(0,n.jsx)("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:(0,n.jsx)("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"}),advisorHealth:(0,n.jsx)("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:(0,n.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"}),traces:(0,n.jsx)("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:(0,n.jsx)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),users:(0,n.jsx)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"}),vectors:(0,n.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:(0,n.jsx)("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},Ks=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","architecture","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","evals","aiUsage","audit","realtime","reactors","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags","privacyRequests"]},{key:"settings",tabs:["settings"]}],Yr=i(t=>{let e=(0,M.c)(2),{tab:o}=t,r=Ec[o],a;return e[0]!==r?(a=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r}),e[0]=r,e[1]=a):a=e[1],a},"Lt"),kc=i(t=>t,"nn"),ri=kc(["home","data","sql","functions","api","architecture","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","evals","aiUsage","reactors","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","privacyRequests","settings"]),Oc=new Set(["api","data","migrations","sql"]),Dc=i(t=>{let e=t.split("/").findLast(Boolean)??"";return ri.includes(e)?e:"home"},"ln"),Mc=i(t=>{let e=(0,M.c)(19),{chrome:o,connected:r}=t,a=ue(),s;e[0]!==a?(s=a("admin token"),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==s?(l=(0,n.jsx)("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:s}),e[2]=s,e[3]=l):l=e[3];let d;e[4]!==o.onTokenChange||e[5]!==o.token?(d=(0,n.jsx)(ko,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:o.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:o.token}),e[4]=o.onTokenChange,e[5]=o.token,e[6]=d):d=e[6];let p;e[7]!==r||e[8]!==a?(p=r&&(0,n.jsxs)("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"}),a("Token rides the WebSocket URL \u2014 it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=r,e[8]=a,e[9]=p):p=e[9];let c;e[10]!==o.clearToken||e[11]!==r||e[12]!==a?(c=r&&(0,n.jsx)("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:o.clearToken,type:"button",children:a("Clear")}),e[10]=o.clearToken,e[11]=r,e[12]=a,e[13]=c):c=e[13];let u;return e[14]!==l||e[15]!==d||e[16]!==p||e[17]!==c?(u=(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[l,d,p,c]}),e[14]=l,e[15]=d,e[16]=p,e[17]=c,e[18]=u):u=e[18],u},"dn"),ai="opacity-50",Ic=i(t=>{let e=(0,M.c)(27),{current:o,group:r,groupLabel:a,selectTab:s,tabDescription:l,tabLabel:d,unavailable:p}=t,c=r.tabs.includes(o)?"page":void 0,u=a[r.key],g=r.tabs[0],b;e[0]!==g?(b=(0,n.jsx)(Yr,{tab:g}),e[0]=g,e[1]=b):b=e[1];let f;e[2]!==c||e[3]!==u||e[4]!==b?(f=(0,n.jsx)(Ys,{"aria-current":c,"aria-label":u,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:b}),e[2]=c,e[3]=u,e[4]=b,e[5]=f):f=e[5];let m=a[r.key],x;e[6]!==m?(x=(0,n.jsx)("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:m}),e[6]=m,e[7]=x):x=e[7];let h;if(e[8]!==o||e[9]!==r.tabs||e[10]!==s||e[11]!==l||e[12]!==d||e[13]!==p){let y;e[15]!==o||e[16]!==s||e[17]!==l||e[18]!==d||e[19]!==p?(y=i(C=>(0,n.jsxs)("button",{"aria-current":o===C?"page":void 0,className:q("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100",p[C]!==void 0&&ai),"data-tab":C,"data-testid":`dash-tab-${C}`,"data-unsupported":p[C]===void 0?void 0:"true",onClick:s,title:l[C],type:"button",children:[(0,n.jsx)(Yr,{tab:C}),(0,n.jsx)("span",{children:d[C]})]},C),"f"),e[15]=o,e[16]=s,e[17]=l,e[18]=d,e[19]=p,e[20]=y):y=e[20],h=r.tabs.map(y),e[8]=o,e[9]=r.tabs,e[10]=s,e[11]=l,e[12]=d,e[13]=p,e[14]=h}else h=e[14];let v;e[21]!==x||e[22]!==h?(v=(0,n.jsxs)(Js,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[x,h]}),e[21]=x,e[22]=h,e[23]=v):v=e[23];let P;return e[24]!==f||e[25]!==v?(P=(0,n.jsxs)(Qs,{children:[f,v]}),e[24]=f,e[25]=v,e[26]=P):P=e[26],P},"cn"),_c=i(t=>{let e=(0,M.c)(45),{chrome:o,collapsed:r,connected:a}=t,s=ue();if(o===null){let y;e[0]!==s?(y=s("Admin"),e[0]=s,e[1]=y):y=e[1];let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=(0,n.jsx)("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=C):C=e[2];let R;e[3]!==s?(R=s("Admin"),e[3]=s,e[4]=R):R=e[4];let k;e[5]!==R?(k=(0,n.jsx)("span",{className:"truncate text-[13px] font-medium",children:R}),e[5]=R,e[6]=k):k=e[6];let S;e[7]!==s?(S=s("Studio"),e[7]=s,e[8]=S):S=e[8];let N;e[9]!==S?(N=(0,n.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:S}),e[9]=S,e[10]=N):N=e[10];let E;e[11]!==k||e[12]!==N?(E=(0,n.jsxs)("span",{className:"grid flex-1 text-start leading-tight",children:[k,N]}),e[11]=k,e[12]=N,e[13]=E):E=e[13];let O;return e[14]!==y||e[15]!==E?(O=(0,n.jsxs)(ei,{className:"data-active:bg-transparent",size:"lg",tooltip:y,children:[C,E]}),e[14]=y,e[15]=E,e[16]=O):O=e[16],O}let l=r?"mx-auto size-8 justify-center":"w-full p-2",d;e[17]!==l?(d=q("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",l),e[17]=l,e[18]=d):d=e[18];let p;e[19]!==a||e[20]!==s?(p=s(a?"Connected":"Not connected"),e[19]=a,e[20]=s,e[21]=p):p=e[21];let c=a?"bg-success":"bg-muted-foreground/50",u;e[22]!==c?(u=q("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",c),e[22]=c,e[23]=u):u=e[23];let g;e[24]!==u?(g=(0,n.jsxs)("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",(0,n.jsx)("span",{"aria-hidden":"true",className:u})]}),e[24]=u,e[25]=g):g=e[25];let b;e[26]!==r||e[27]!==a||e[28]!==s?(b=!r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"grid flex-1 text-start leading-tight",children:[(0,n.jsx)("span",{className:"truncate text-[13px] font-medium",children:s("Admin")}),(0,n.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:s(a?"Connected":"Not connected")})]}),(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=r,e[27]=a,e[28]=s,e[29]=b):b=e[29];let f;e[30]!==d||e[31]!==p||e[32]!==g||e[33]!==b?(f=(0,n.jsxs)(Ys,{className:d,"data-testid":"dash-app-connect",title:p,children:[g,b]}),e[30]=d,e[31]=p,e[32]=g,e[33]=b,e[34]=f):f=e[34];let m=r?"end":"start",x=r?"right":"top",h;e[35]!==o||e[36]!==a?(h=(0,n.jsx)(Mc,{chrome:o,connected:a}),e[35]=o,e[36]=a,e[37]=h):h=e[37];let v;e[38]!==x||e[39]!==h||e[40]!==m?(v=(0,n.jsx)(Js,{align:m,keepMounted:!0,side:x,children:h}),e[38]=x,e[39]=h,e[40]=m,e[41]=v):v=e[41];let P;return e[42]!==v||e[43]!==f?(P=(0,n.jsxs)(Qs,{children:[f,v]}),e[42]=v,e[43]=f,e[44]=P):P=e[44],P},"un"),Ac=i(t=>{let e=(0,M.c)(29),{chrome:o,connected:r,current:a,groupLabel:s,groups:l,selectTab:d,tabDescription:p,tabLabel:c,unavailable:u}=t,g=ue(),{state:b}=xr(),f=b==="collapsed",m=f&&"justify-center px-0",x;e[0]!==m?(x=q("flex items-center gap-2.5 px-1.5 py-1",m),e[0]=m,e[1]=x):x=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(wi,{className:"size-9 shrink-0 text-foreground"}),e[2]=h):h=e[2];let v;e[3]!==f||e[4]!==r||e[5]!==g?(v=!f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"grid flex-1 leading-tight",children:[(0,n.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),(0,n.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:g("Studio")})]}),(0,n.jsx)(Ft,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:g(r?"Live":"Local")})]}),e[3]=f,e[4]=r,e[5]=g,e[6]=v):v=e[6];let P;e[7]!==x||e[8]!==v?(P=(0,n.jsx)(Xi,{children:(0,n.jsxs)("div",{className:x,children:[h,v]})}),e[7]=x,e[8]=v,e[9]=P):P=e[9];let y;e[10]!==f||e[11]!==a||e[12]!==s||e[13]!==l||e[14]!==d||e[15]!==p||e[16]!==c||e[17]!==u?(y=f?l.map(S=>(0,n.jsx)(Ic,{current:a,group:S,groupLabel:s,selectTab:d,tabDescription:p,tabLabel:c,unavailable:u},S.key)):l.map(S=>(0,n.jsxs)(ol,{children:[(0,n.jsx)(rl,{className:"text-[11px] font-medium tracking-wider uppercase",children:s[S.key]}),(0,n.jsx)(al,{children:(0,n.jsx)(Fs,{children:S.tabs.map(N=>(0,n.jsx)(js,{children:(0,n.jsxs)(ei,{className:q("data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",u[N]!==void 0&&ai),"data-tab":N,"data-testid":`dash-tab-${N}`,"data-unsupported":u[N]===void 0?void 0:"true",isActive:a===N,onClick:d,title:p[N],tooltip:p[N],children:[(0,n.jsx)(Yr,{tab:N}),(0,n.jsx)("span",{children:c[N]})]})},N))})})]},S.key)),e[10]=f,e[11]=a,e[12]=s,e[13]=l,e[14]=d,e[15]=p,e[16]=c,e[17]=u,e[18]=y):y=e[18];let C;e[19]!==y?(C=(0,n.jsx)(tl,{children:y}),e[19]=y,e[20]=C):C=e[20];let R;e[21]!==o||e[22]!==f||e[23]!==r?(R=(0,n.jsx)(el,{children:(0,n.jsx)(Fs,{children:(0,n.jsx)(js,{children:(0,n.jsx)(_c,{chrome:o,collapsed:f,connected:r})})})}),e[21]=o,e[22]=f,e[23]=r,e[24]=R):R=e[24];let k;return e[25]!==P||e[26]!==C||e[27]!==R?(k=(0,n.jsxs)(Qi,{collapsible:"icon",variant:"inset",children:[P,C,R]}),e[25]=P,e[26]=C,e[27]=R,e[28]=k):k=e[28],k},"mn"),Xr=i(()=>{let t=(0,M.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Qo,{className:"h-8 w-40"}),(0,n.jsx)(Qo,{className:"h-8 w-24"})]}),(0,n.jsx)(Qo,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},"Bt"),Vc=i(t=>{let e=(0,M.c)(5),{title:o,verdict:r}=t;if(r.kind==="pending"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(Xr,{}),e[0]=s):s=e[0],s}if(r.kind==="unavailable"){let s;return e[1]!==o||e[2]!==r.reason?(s=(0,n.jsx)(wl,{reason:r.reason,title:o}),e[1]=o,e[2]=r.reason,e[3]=s):s=e[3],s}let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(na,{}),e[4]=a):a=e[4],a},"fn"),Hc=i(()=>{let t=(0,M.c)(59),e=ue(),o=io(),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={select:Kc},t[0]=r):r=t[0];let a=la(r),s=Dc(a),l=Oc.has(s),d=Da(),p=d?.toggle,c=ma();El(p);let u=Ja(),{groupLabel:g,tabDescription:b,tabLabel:f}=ml(),{unavailable:m,visibleGroups:x}=Tl(Ks,u,e),h={...b,...m},v=ti(s,u,e),P=v.kind==="hidden",y,C;t[1]!==P||t[2]!==o?(y=i(()=>{P&&Ee(o({replace:!0,to:"/home"}))},"f"),C=[P,o],t[1]=P,t[2]=o,t[3]=y,t[4]=C):(y=t[3],C=t[4]),(0,w.useEffect)(y,C);let R;t[5]!==o?(R=i(pe=>{Ee(o({to:`/${pe.currentTarget.dataset.tab??""}`}))},"C"),t[5]=o,t[6]=R):R=t[6];let k=R,S,N;t[7]!==s||t[8]!==f?(S=i(()=>{typeof document<"u"&&(document.title=`${f[s]} \xB7 lunora`)},"S"),N=[s,f],t[7]=s,t[8]=f,t[9]=S,t[10]=N):(S=t[9],N=t[10]),(0,w.useEffect)(S,N);let E=x.find(pe=>pe.tabs.includes(s))??Ks[0],O=x.flatMap(pe=>pe.tabs.filter(ve=>m[ve]===void 0).map(ve=>({group:g[pe.key],label:f[ve],to:`/${ve}`}))),_;t[11]!==e||t[12]!==p?(_=p===void 0?[]:[{group:e("Operations"),label:e("Toggle operation console"),run:p}],t[11]=e,t[12]=p,t[13]=_):_=t[13];let H;t[14]!==c||t[15]!==e?(H=c===void 0||c.unavailable?[]:[{group:e("Operations"),label:e("Ask the assistant"),run:c.toggle}],t[14]=c,t[15]=e,t[16]=H):H=t[16];let V=[...O,..._,...H],L=(0,w.use)(oi),F=L!==null&&L.token!=="",j=g[E.key],U=f[s],z;t[17]!==j||t[18]!==U?(z=(0,n.jsx)(Pl,{domain:j,onOpenCommandPalette:Hs,page:U}),t[17]=j,t[18]=U,t[19]=z):z=t[19];let D;t[20]!==L?.rulesInstalled?(D=L?.rulesInstalled===!1&&(0,n.jsx)(Ii,{}),t[20]=L?.rulesInstalled,t[21]=D):D=t[21];let I;t[22]!==L||t[23]!==F?(I=(L===null||F)&&(0,n.jsx)(ki,{}),t[22]=L,t[23]=F,t[24]=I):I=t[24];let W=`dash-tab-${s}`,$=l?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",ie=f[s],oe;t[25]!==e||t[26]!==ie?(oe=e("{title} failed",{title:ie}),t[25]=e,t[26]=ie,t[27]=oe):oe=t[27];let re=f[s],ee;t[28]!==e?(ee=e("Try again"),t[28]=e,t[29]=ee):ee=t[29];let Y;t[30]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,n.jsx)(Xr,{}),t[30]=Y):Y=t[30];let be=f[s],de;t[31]!==be||t[32]!==v?(de=(0,n.jsx)(w.Suspense,{fallback:Y,children:(0,n.jsx)(Vc,{title:be,verdict:v})}),t[31]=be,t[32]=v,t[33]=de):de=t[33];let me;t[34]!==s||t[35]!==oe||t[36]!==re||t[37]!==ee||t[38]!==de?(me=(0,n.jsx)(Jo,{fallbackTitle:oe,label:re,retryLabel:ee,children:de},s),t[34]=s,t[35]=oe,t[36]=re,t[37]=ee,t[38]=de,t[39]=me):me=t[39];let fe;t[40]!==$||t[41]!==me?(fe=(0,n.jsx)("div",{className:$,children:me}),t[40]=$,t[41]=me,t[42]=fe):fe=t[42];let ge;t[43]!==d?(ge=d?.open===!0&&(0,n.jsx)(dl,{focusSeq:d.focusSeq,onClose:d.close,onShownChange:d.setShown,shown:d.shown}),t[43]=d,t[44]=ge):ge=t[44];let Z;t[45]!==W||t[46]!==fe||t[47]!==ge?(Z=(0,n.jsxs)("div",{"aria-labelledby":W,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[fe,ge]}),t[45]=W,t[46]=fe,t[47]=ge,t[48]=Z):Z=t[48];let G;t[49]!==z||t[50]!==D||t[51]!==I||t[52]!==Z?(G=(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[z,D,I,Z]}),t[49]=z,t[50]=D,t[51]=I,t[52]=Z,t[53]=G):G=t[53];let te;t[54]!==c?(te=c!==void 0&&c.open&&!c.unavailable&&(0,n.jsx)(w.Suspense,{fallback:null,children:(0,n.jsx)(_l,{assistant:c})}),t[54]=c,t[55]=te):te=t[55];let xe;return t[56]!==G||t[57]!==te?(xe=(0,n.jsxs)(Ji,{className:"flex flex-row overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[G,te]}),t[56]=G,t[57]=te,t[58]=xe):xe=t[58],(0,n.jsxs)(Gi,{className:"min-h-0 flex-1","data-platform":u.platform?.id,"data-testid":"lunora-studio",children:[(0,n.jsx)(Ls,{items:V}),(0,n.jsx)(Ac,{chrome:L,connected:F,current:s,groupLabel:g,groups:x,selectTab:k,tabDescription:h,tabLabel:f,unavailable:m}),xe]})},"pn"),Lc=i(()=>{let t=(0,M.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(Oa,{children:(0,n.jsx)(ua,{children:(0,n.jsx)(Hc,{})})}),t[0]=e):e=t[0],e},"hn"),Bc=i(t=>{let e=(0,M.c)(5),{initialShardKey:o,schemaEditable:r}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];let s=ra(a),{table:l}=s,d=typeof l=="string"?l:void 0,p;return e[1]!==o||e[2]!==d||e[3]!==r?(p=(0,n.jsx)(bc,{initialShardKey:o,initialTable:d,schemaEditable:r}),e[1]=o,e[2]=d,e[3]=r,e[4]=p):p=e[4],p},"gn"),Fc=i(()=>{let t=(0,M.c)(3),e=io(),o,r;return t[0]!==e?(o=i(()=>{Ee(e({replace:!0,to:"/home"}))},"s"),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),(0,w.useEffect)(o,r),null},"bn"),jc=i(({analyticsSqlQuery:t,basePath:e,privacyRequests:o,dataEditable:r=!1,functions:a,initialShardKey:s,openApiSpec:l,openRpcSpec:d,runAsIdentity:p=!1,schemaEditable:c=!1,scheduledCancel:u,scheduledCron:g,scheduledLoad:b})=>{let f=aa({component:Lc}),m={agents:(0,n.jsx)(Il,{initialShardKey:s}),analytics:(0,n.jsx)(Al,{runQuery:t}),api:(0,n.jsx)(Vl,{functions:a,initialShardKey:s,openApiSpec:l,openRpcSpec:d}),architecture:(0,n.jsx)(Hl,{}),audit:(0,n.jsx)(oc,{initialShardKey:s}),authAudit:(0,n.jsx)(Ll,{}),authConfig:(0,n.jsx)(Bl,{}),authSessions:(0,n.jsx)(Fl,{}),containers:(0,n.jsx)(Kl,{}),dashboards:(0,n.jsx)(fc,{initialShardKey:s}),data:(0,n.jsx)(Zl,{canGenerateRows:r&&c,editable:r,initialShardKey:s}),deploymentHealth:(0,n.jsx)(Ul,{}),drains:(0,n.jsx)(rc,{}),export:(0,n.jsx)(ql,{initialShardKey:s}),fanout:(0,n.jsx)(gc,{initialShardKey:s}),files:(0,n.jsx)(Pc,{}),kv:(0,n.jsx)(cc,{}),flags:(0,n.jsx)(Yl,{initialShardKey:s}),reactors:(0,n.jsx)(Jl,{initialShardKey:s}),functions:(0,n.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,n.jsx)(ec,{functions:a,initialShardKey:s}),(0,n.jsx)(Xl,{functions:a,runAsIdentity:p})]}),health:(0,n.jsx)(hc,{initialShardKey:s}),home:(0,n.jsx)(Xa,{initialShardKey:s}),insights:(0,n.jsx)(kl,{initialShardKey:s}),issues:(0,n.jsx)(tc,{initialShardKey:s}),logs:(0,n.jsx)(ac,{initialShardKey:s}),traces:(0,n.jsx)(Rc,{initialShardKey:s}),evals:(0,n.jsx)(Sc,{initialShardKey:s}),aiUsage:(0,n.jsx)(Nc,{initialShardKey:s}),metrics:(0,n.jsx)(vc,{initialShardKey:s}),migrations:(0,n.jsx)(Wl,{initialShardKey:s}),notifications:(0,n.jsx)(dc,{}),organizations:(0,n.jsx)(jl,{}),permissions:(0,n.jsx)(uc,{functions:a,runAsIdentity:p,schemaEditable:c}),pitr:(0,n.jsx)(Gl,{initialShardKey:s}),privacyRequests:(0,n.jsx)(Ql,{source:o}),mail:(0,n.jsx)(nc,{}),payments:(0,n.jsx)(pc,{}),queues:(0,n.jsx)(mc,{}),realtime:(0,n.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,n.jsx)(ic,{initialShardKey:s}),(0,n.jsx)(lc,{})]}),rls:(0,n.jsx)(Ol,{}),schedule:(0,n.jsx)(sc,{loadCronJobs:g,scheduledCancel:u,scheduledLoad:b}),schema:(0,n.jsx)(Bc,{initialShardKey:s,schemaEditable:c}),advisorHealth:(0,n.jsx)(Dl,{}),security:(0,n.jsx)(Ml,{}),settings:(0,n.jsx)(xc,{initialShardKey:s}),sql:(0,n.jsx)(yc,{initialShardKey:s}),storageRules:(0,n.jsx)(Cc,{}),users:(0,n.jsx)(zl,{}),vectors:(0,n.jsx)(Tc,{}),workflows:(0,n.jsx)(wc,{})},x=Nr({component:i(()=>m.home,"component"),getParentRoute:i(()=>f,"getParentRoute"),path:"/"}),h=ri.map(y=>Nr({component:i(()=>m[y],"component"),getParentRoute:i(()=>f,"getParentRoute"),path:`/${y}`,validateSearch:$l[y]})),v=f.addChildren([x,...h]),P="window"in globalThis?ta():oa({initialEntries:["/home"]});return sa({...e===void 0||e==="/"?{}:{basepath:e},defaultNotFoundComponent:Fc,defaultPendingComponent:Xr,defaultPendingMinMs:0,defaultPendingMs:0,history:P,routeTree:v})},"vn"),zc=i(t=>{let e=(0,M.c)(19),{analyticsSqlQuery:o,basePath:r,chrome:a,dataEditable:s,functions:l,initialShardKey:d,openApiSpec:p,openRpcSpec:c,privacyRequests:u,runAsIdentity:g,schemaEditable:b,scheduledCancel:f,scheduledCron:m,scheduledLoad:x}=t,h;e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==l||e[4]!==d||e[5]!==p||e[6]!==c||e[7]!==u||e[8]!==g||e[9]!==f||e[10]!==m||e[11]!==x||e[12]!==b?(h=jc({analyticsSqlQuery:o,basePath:r,privacyRequests:u,dataEditable:s,functions:l,initialShardKey:d,openApiSpec:p,openRpcSpec:c,runAsIdentity:g,schemaEditable:b,scheduledCancel:f,scheduledCron:m,scheduledLoad:x}),e[0]=o,e[1]=r,e[2]=s,e[3]=l,e[4]=d,e[5]=p,e[6]=c,e[7]=u,e[8]=g,e[9]=f,e[10]=m,e[11]=x,e[12]=b,e[13]=h):h=e[13];let v=h,P=a??null,y;e[14]!==v?(y=(0,n.jsx)(ia,{router:v}),e[14]=v,e[15]=y):y=e[15];let C;return e[16]!==P||e[17]!==y?(C=(0,n.jsx)(oi,{value:P,children:y}),e[16]=P,e[17]=y,e[18]=C):C=e[18],C},"yn"),hh=i(t=>{let e=(0,M.c)(10),o,r,a;e[0]!==t?({i18n:o,locale:r,...a}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=a):(o=e[1],r=e[2],a=e[3]);let s;e[4]!==a?(s=(0,n.jsx)(Ci,{children:(0,n.jsx)(zc,{...a})}),e[4]=a,e[5]=s):s=e[5];let l=s;if(o===void 0&&r===void 0)return l;let d;return e[6]!==o||e[7]!==r||e[8]!==l?(d=(0,n.jsx)(Vs,{i18n:o,locale:r,children:l}),e[6]=o,e[7]=r,e[8]=l,e[9]=d):d=e[9],d},"sr");function Kc(t){return t.location.pathname}i(Kc,"xn");export{Jo as a,Vs as b,Pi as c,Ri as d,fh as e,wi as f,gh as g,Vi as h,Bi as i,Fi as j,ji as k,hh as l};
@@ -1 +1 @@
1
- import{a as $}from"./chunk-4NKJV7YX.js";import{a as b}from"./chunk-YEXTJUKQ.js";import"./chunk-LSEUUZN4.js";import{a as y,b as w,c as j,d as h,e as c,f as i}from"./chunk-7QEZ2SFW.js";import"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import{a as u}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-4N76XUNG.js";import{a as d,e as l}from"./chunk-OK2QU2EV.js";import"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as k,x}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{b as T}from"./chunk-6G3E4PJ2.js";import{a as o,d as I}from"./chunk-5PEAXTYQ.js";var e=I(T(),1);var m={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},A={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},C=o((r,a)=>`exempt: ${r.exemptReason===void 0||r.exemptReason===""?a:r.exemptReason}`,"E"),E=o(r=>r.toSorted((a,n)=>a.coverage==="clean"&&n.coverage!=="clean"?1:n.coverage==="clean"&&a.coverage!=="clean"?-1:a.score-n.score),"S"),Y=o(({testId:r="advisor-health"})=>{let a=k(),n=p(u.getAdvisories,{},{live:!0}),g=p(u.getAdvisorProcedures,{},{live:!0}),f=n.data?.advisories??null,N=g.data?.procedures??null,t=f===null||N===null?null:$(N,f),v=g.error??n.error;if(v!==null)return(0,e.jsx)(b,{error:v,testId:`${r}-error`});if(t===null)return(0,e.jsx)(d,{children:(0,e.jsx)(l,{className:"py-8 text-center text-muted-foreground","data-testid":`${r}-loading`,children:a("Loading\u2026")})});let R=E(t.procedures);return(0,e.jsxs)("div",{className:"space-y-4","data-testid":r,children:[(0,e.jsx)(d,{children:(0,e.jsxs)(l,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:x("text-4xl font-semibold tabular-nums",A[t.grade]),"data-testid":`${r}-score`,children:t.score}),(0,e.jsx)("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),(0,e.jsx)("span",{className:x("text-sm font-medium uppercase tracking-wide",A[t.grade]),"data-testid":`${r}-grade`,children:t.grade}),(0,e.jsxs)("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${r}-summary`,children:[(0,e.jsxs)("span",{className:m.clean,children:[t.summary.clean," ",a("clean")]}),(0,e.jsxs)("span",{className:m.warned,children:[t.summary.warned," ",a("warned")]}),(0,e.jsxs)("span",{className:m.failing,children:[t.summary.failing," ",a("failing")]}),(0,e.jsxs)("span",{className:m.exempt,children:[t.summary.exempt," ",a("exempt")]})]})]})}),t.project.checks.length>0&&(0,e.jsx)(d,{children:(0,e.jsxs)(l,{className:"py-4 text-sm","data-testid":`${r}-project`,children:[(0,e.jsxs)("span",{className:"font-medium",children:[a("Schema & config")," ",t.project.score,"/100"]}),(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \u2014 ",t.project.checks.map(s=>s.name).join(", ")]})]})}),(0,e.jsx)(d,{children:(0,e.jsx)(l,{className:"p-0",children:(0,e.jsxs)(y,{children:[(0,e.jsx)(w,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(c,{className:"w-20",children:a("Score")}),(0,e.jsx)(c,{children:a("Procedure")}),(0,e.jsx)(c,{className:"w-32",children:a("Kind")}),(0,e.jsx)(c,{children:a("Rules fired")})]})}),(0,e.jsx)(j,{children:R.map(s=>(0,e.jsxs)(h,{"data-testid":`${r}-row`,children:[(0,e.jsx)(i,{className:x("tabular-nums font-medium",m[s.coverage]),children:s.coverage==="exempt"?"\u2014":s.score}),(0,e.jsx)(i,{className:"font-mono text-xs",children:s.id}),(0,e.jsxs)(i,{className:"text-muted-foreground text-xs",children:[s.visibility," ",s.kind,s.sensitivity.level==="high"&&(0,e.jsx)("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),(0,e.jsx)(i,{className:"text-muted-foreground text-xs",children:s.coverage==="exempt"?C(s,a("no reason given")):s.checks.map(S=>S.name).join(", ")})]},s.id))})]})})})]})},"Y");export{Y as default};
1
+ import{a as $}from"./chunk-4NKJV7YX.js";import{a as b}from"./chunk-ESSPRXXR.js";import"./chunk-36PLWIHK.js";import{a as y,b as w,c as j,d as h,e as c,f as i}from"./chunk-ZYXDE5GW.js";import"./chunk-U7CBXP36.js";import"./chunk-TRYQANZO.js";import"./chunk-4PI2OSSP.js";import{a as u}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-C4IDZOYU.js";import{a as d,e as l}from"./chunk-X3BATMFU.js";import"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as k,x}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{b as T}from"./chunk-6G3E4PJ2.js";import{a as o,d as I}from"./chunk-5PEAXTYQ.js";var e=I(T(),1);var m={clean:"text-emerald-600 dark:text-emerald-400",exempt:"text-muted-foreground",failing:"text-red-600 dark:text-red-400",warned:"text-amber-600 dark:text-amber-400"},A={"at-risk":"text-red-600 dark:text-red-400",excellent:"text-emerald-600 dark:text-emerald-400",good:"text-emerald-600 dark:text-emerald-400","needs-work":"text-amber-600 dark:text-amber-400"},C=o((r,a)=>`exempt: ${r.exemptReason===void 0||r.exemptReason===""?a:r.exemptReason}`,"E"),E=o(r=>r.toSorted((a,n)=>a.coverage==="clean"&&n.coverage!=="clean"?1:n.coverage==="clean"&&a.coverage!=="clean"?-1:a.score-n.score),"S"),Y=o(({testId:r="advisor-health"})=>{let a=k(),n=p(u.getAdvisories,{},{live:!0}),g=p(u.getAdvisorProcedures,{},{live:!0}),f=n.data?.advisories??null,N=g.data?.procedures??null,t=f===null||N===null?null:$(N,f),v=g.error??n.error;if(v!==null)return(0,e.jsx)(b,{error:v,testId:`${r}-error`});if(t===null)return(0,e.jsx)(d,{children:(0,e.jsx)(l,{className:"py-8 text-center text-muted-foreground","data-testid":`${r}-loading`,children:a("Loading\u2026")})});let R=E(t.procedures);return(0,e.jsxs)("div",{className:"space-y-4","data-testid":r,children:[(0,e.jsx)(d,{children:(0,e.jsxs)(l,{className:"flex flex-wrap items-baseline gap-x-6 gap-y-2 py-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{className:x("text-4xl font-semibold tabular-nums",A[t.grade]),"data-testid":`${r}-score`,children:t.score}),(0,e.jsx)("span",{className:"text-muted-foreground text-lg",children:"/100"})]}),(0,e.jsx)("span",{className:x("text-sm font-medium uppercase tracking-wide",A[t.grade]),"data-testid":`${r}-grade`,children:t.grade}),(0,e.jsxs)("div",{className:"text-muted-foreground flex gap-4 text-sm tabular-nums","data-testid":`${r}-summary`,children:[(0,e.jsxs)("span",{className:m.clean,children:[t.summary.clean," ",a("clean")]}),(0,e.jsxs)("span",{className:m.warned,children:[t.summary.warned," ",a("warned")]}),(0,e.jsxs)("span",{className:m.failing,children:[t.summary.failing," ",a("failing")]}),(0,e.jsxs)("span",{className:m.exempt,children:[t.summary.exempt," ",a("exempt")]})]})]})}),t.project.checks.length>0&&(0,e.jsx)(d,{children:(0,e.jsxs)(l,{className:"py-4 text-sm","data-testid":`${r}-project`,children:[(0,e.jsxs)("span",{className:"font-medium",children:[a("Schema & config")," ",t.project.score,"/100"]}),(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \u2014 ",t.project.checks.map(s=>s.name).join(", ")]})]})}),(0,e.jsx)(d,{children:(0,e.jsx)(l,{className:"p-0",children:(0,e.jsxs)(y,{children:[(0,e.jsx)(w,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(c,{className:"w-20",children:a("Score")}),(0,e.jsx)(c,{children:a("Procedure")}),(0,e.jsx)(c,{className:"w-32",children:a("Kind")}),(0,e.jsx)(c,{children:a("Rules fired")})]})}),(0,e.jsx)(j,{children:R.map(s=>(0,e.jsxs)(h,{"data-testid":`${r}-row`,children:[(0,e.jsx)(i,{className:x("tabular-nums font-medium",m[s.coverage]),children:s.coverage==="exempt"?"\u2014":s.score}),(0,e.jsx)(i,{className:"font-mono text-xs",children:s.id}),(0,e.jsxs)(i,{className:"text-muted-foreground text-xs",children:[s.visibility," ",s.kind,s.sensitivity.level==="high"&&(0,e.jsx)("span",{className:"ml-1 text-amber-600 dark:text-amber-400",children:a("sensitive")})]}),(0,e.jsx)(i,{className:"text-muted-foreground text-xs",children:s.coverage==="exempt"?C(s,a("no reason given")):s.checks.map(S=>S.name).join(", ")})]},s.id))})]})})})]})},"Y");export{Y as default};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-EPWCW2DF.js";import{a as k}from"./chunk-5RX5CQSU.js";import"./chunk-DA2CAFXI.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import{a as I}from"./chunk-RCXNYW7P.js";import{b as w}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as B}from"./chunk-YEXTJUKQ.js";import"./chunk-LSEUUZN4.js";import{a as A,b as C,c as P,d as b,e as l,f as n}from"./chunk-7QEZ2SFW.js";import"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import{a as u}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-4N76XUNG.js";import{a as v,e as S}from"./chunk-OK2QU2EV.js";import{e as R}from"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as j,w as N}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{b as Q}from"./chunk-6G3E4PJ2.js";import{a as m,d as H}from"./chunk-5PEAXTYQ.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=j(),h=k(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});D(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(I,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(w,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(B,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(I,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(C,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(w,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:N(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(S,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:N(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
1
+ import{a as B}from"./chunk-6ONPEGTC.js";import{a as j}from"./chunk-ARYARX6T.js";import"./chunk-DA2CAFXI.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as I}from"./chunk-ZMBRGW6J.js";import{b as w}from"./chunk-7TWHRQXV.js";import"./chunk-YUVGMKHG.js";import{a as C}from"./chunk-ESSPRXXR.js";import"./chunk-36PLWIHK.js";import{a as A,b as D,c as P,d as b,e as l,f as n}from"./chunk-ZYXDE5GW.js";import"./chunk-U7CBXP36.js";import"./chunk-TRYQANZO.js";import"./chunk-4PI2OSSP.js";import{a as u}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-C4IDZOYU.js";import{a as v,e as S}from"./chunk-X3BATMFU.js";import{e as R}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as k,w as N}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{b as Q}from"./chunk-6G3E4PJ2.js";import{a as m,d as H}from"./chunk-5PEAXTYQ.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=k(),h=B(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});j(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(I,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(w,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(C,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(I,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(D,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(w,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:N(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(S,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:N(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
@@ -0,0 +1 @@
1
+ import{a as ke}from"./chunk-26Z7L3NM.js";import{g as we}from"./chunk-FCR7GOAE.js";import"./chunk-GXTSE66Z.js";import"./chunk-6ONPEGTC.js";import"./chunk-CL3JOU6F.js";import{a as ne}from"./chunk-ARYARX6T.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-XLCYVOJY.js";import"./chunk-QAOZXPLU.js";import"./chunk-DA2CAFXI.js";import{a as ue}from"./chunk-HZK2UJ3K.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as ye}from"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as me}from"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as de}from"./chunk-ZMBRGW6J.js";import{b as oe}from"./chunk-7TWHRQXV.js";import"./chunk-YUVGMKHG.js";import{a as re,b as le,c as ae,d as B,e as S,f as J}from"./chunk-ZYXDE5GW.js";import"./chunk-TRYQANZO.js";import"./chunk-4PI2OSSP.js";import"./chunk-2W4UO5BC.js";import{b as te}from"./chunk-C4IDZOYU.js";import{a as Q,e as X}from"./chunk-X3BATMFU.js";import{m as se}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as V,j as ce,k as ge,s as G,w as ee,x as Ne}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as ve}from"./chunk-GWNGVKLG.js";import{a as xe,b as be}from"./chunk-6G3E4PJ2.js";import{a as b,d as ie}from"./chunk-5PEAXTYQ.js";var Y=ie(ve(),1),U=ie(xe(),1);var t=ie(be(),1);var Ce=ie(ve(),1),he=ie(xe(),1);var F=ie(be(),1);var Ae=b(r=>Number.isFinite(r)?ee(r,"\u2014"):"\u2014","X"),je=b(r=>r.toSorted((e,u)=>e.scheduledFor-u.scheduledFor),"F"),Ie=b((r,e,u)=>e!==void 0?e:u===void 0?a=>r.cancelScheduledJob(a):void 0,"Y"),Se=b(r=>{let e=(0,Ce.c)(16),{cancelJob:u,loadJobs:a}=r===void 0?{}:r,o=se(),l=V(),n=a===void 0,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=["lunora-scheduled-jobs"],e[0]=s):s=e[0];let N=te(s,async()=>{let p=await(a??(()=>o.listScheduledJobs()))();return je(p)}),[y,i]=(0,he.useState)(void 0),[h,g]=(0,he.useState)(void 0),v,f;e[1]!==o||e[2]!==n?(v=b(()=>{if(n)return o.subscribeScheduledJobs(p=>{g(void 0),i(je(p))})},"v"),f=[n,o],e[1]=o,e[2]=n,e[3]=v,e[4]=f):(v=e[3],f=e[4]),(0,he.useEffect)(v,f);let d;e[5]!==N?(d=b(()=>N.poll(),"y"),e[5]=N,e[6]=d):d=e[6],ne(d,!n);let c=Ie(o,u,a),m=y??N.data,k=h??N.error,w=b(async p=>{if(c!==void 0){g(void 0);try{await c(p),n||N.refetch()}catch(L){g(ce(L))}}},"E"),T="flex flex-col gap-3",j="lunora-scheduled-jobs",$;e[7]!==k?($=k!==null&&(0,F.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:k}),e[7]=k,e[8]=$):$=e[8];let C;e[9]!==m?.length||e[10]!==l?(C=m?.length===0&&(0,F.jsx)(de,{description:l("Jobs queued with runAfter / runAt will appear here."),icon:(0,F.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,F.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,F.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:l("No scheduled jobs.")}),e[9]=m?.length,e[10]=l,e[11]=C):C=e[11];let I=m!==void 0&&m.length>0&&(0,F.jsx)(Q,{className:"overflow-hidden py-0",children:(0,F.jsx)(X,{className:"px-0",children:(0,F.jsxs)(re,{"data-testid":"sj-table",children:[(0,F.jsx)(le,{children:(0,F.jsxs)(B,{children:[(0,F.jsx)(S,{children:l("function")}),(0,F.jsx)(S,{children:l("scheduled for")}),(0,F.jsx)(S,{children:l("pool")}),(0,F.jsx)(S,{children:l("attempts")}),(0,F.jsx)(S,{children:l("shard")}),(0,F.jsx)(S,{children:l("id")}),c!==void 0&&(0,F.jsx)(S,{"aria-label":l("Actions")})]})}),(0,F.jsx)(ae,{children:m.map(p=>(0,F.jsxs)(B,{"data-testid":`sj-row-${p.id}`,children:[(0,F.jsx)(J,{className:"font-mono text-xs",children:p.workflow??p.functionPath}),(0,F.jsx)(J,{className:"text-muted-foreground tabular-nums",children:Ae(p.scheduledFor)}),(0,F.jsx)(J,{className:"font-mono text-xs",children:p.pool??""}),(0,F.jsx)(J,{className:"tabular-nums",children:p.attempts??0}),(0,F.jsx)(J,{children:p.shardKey??""}),(0,F.jsx)(J,{className:"font-mono text-xs",children:p.id}),c!==void 0&&(0,F.jsx)(J,{className:"text-right",children:(0,F.jsx)(ue,{confirmLabel:l("Cancel job?"),onConfirm:b(()=>{G(w(p.id))},"onConfirm"),testId:`sj-cancel-${p.id}`,children:l("Cancel")})})]},p.id))})]})})}),A;return e[12]!==I||e[13]!==$||e[14]!==C?(A=(0,F.jsxs)("div",{className:T,"data-testid":j,children:[$,C,I]}),e[12]=I,e[13]=$,e[14]=C,e[15]=A):A=e[15],A},"he");var Je={failed:"destructive",skipped:"warning",succeeded:"success"},Le=25,Te=b(r=>r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(1)} s`,"we"),Fe=b(r=>{let e=(0,Y.c)(39),{inFlight:u,last:a}=r,o=V();if(u!==void 0){let c;e[0]!==o?(c=o("running"),e[0]=o,e[1]=c):c=e[1];let m;e[2]!==c?(m=(0,t.jsx)(oe,{variant:"info",children:c}),e[2]=c,e[3]=m):m=e[3];let k;e[4]!==u.startedAt?(k=ee(u.startedAt,"\u2014"),e[4]=u.startedAt,e[5]=k):k=e[5];let w;e[6]!==k?(w=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:k}),e[6]=k,e[7]=w):w=e[7];let T;e[8]!==u.skipped||e[9]!==o?(T=u.skipped>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("{count} ticks skipped",{count:u.skipped})}),e[8]=u.skipped,e[9]=o,e[10]=T):T=e[10];let j;return e[11]!==m||e[12]!==w||e[13]!==T?(j=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[m,w,T]}),e[11]=m,e[12]=w,e[13]=T,e[14]=j):j=e[14],j}if(a===void 0){let c;e[15]!==o?(c=o("never"),e[15]=o,e[16]=c):c=e[16];let m;return e[17]!==c?(m=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c}),e[17]=c,e[18]=m):m=e[18],m}let l;e[19]!==o?(l=o("failed"),e[19]=o,e[20]=l):l=e[20];let n;e[21]!==o?(n=o("skipped"),e[21]=o,e[22]=n):n=e[22];let s;e[23]!==o?(s=o("succeeded"),e[23]=o,e[24]=s):s=e[24];let N;e[25]!==l||e[26]!==n||e[27]!==s?(N={failed:l,skipped:n,succeeded:s},e[25]=l,e[26]=n,e[27]=s,e[28]=N):N=e[28];let y=N,i=Je[a.status],h=y[a.status],g;e[29]!==i||e[30]!==h?(g=(0,t.jsx)(oe,{variant:i,children:h}),e[29]=i,e[30]=h,e[31]=g):g=e[31];let v;e[32]!==a.startedAt?(v=ee(a.startedAt,"\u2014"),e[32]=a.startedAt,e[33]=v):v=e[33];let f;e[34]!==v?(f=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:v}),e[34]=v,e[35]=f):f=e[35];let d;return e[36]!==g||e[37]!==f?(d=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[g,f]}),e[36]=g,e[37]=f,e[38]=d):d=e[38],d},"ke"),De=b(r=>{let e=(0,Y.c)(80),{runs:u}=r,a=V();if(u.length===0)return;let o,l,n,s,N,y,i,h,g,v,f;if(e[0]!==u||e[1]!==a){let T=u.toSorted(qe).slice(0,Le),j;e[13]!==a?(j=a("failed"),e[13]=a,e[14]=j):j=e[14];let $;e[15]!==a?($=a("skipped"),e[15]=a,e[16]=$):$=e[16];let C;e[17]!==a?(C=a("succeeded"),e[17]=a,e[18]=C):C=e[18];let I;e[19]!==C||e[20]!==j||e[21]!==$?(I={failed:j,skipped:$,succeeded:C},e[19]=C,e[20]=j,e[21]=$,e[22]=I):I=e[22];let A=I;g="flex flex-col gap-2",v="cron-run-history";let p;e[23]!==a?(p=a("Recent runs"),e[23]=a,e[24]=p):p=e[24],e[25]!==p?(f=(0,t.jsx)("h3",{className:"text-sm font-medium",children:p}),e[25]=p,e[26]=f):f=e[26],s=Q,h="overflow-hidden py-0",n=X,i="px-0",l=re;let L;e[27]!==a?(L=a("name"),e[27]=a,e[28]=L):L=e[28];let x;e[29]!==L?(x=(0,t.jsx)(S,{children:L}),e[29]=L,e[30]=x):x=e[30];let D;e[31]!==a?(D=a("status"),e[31]=a,e[32]=D):D=e[32];let E;e[33]!==D?(E=(0,t.jsx)(S,{children:D}),e[33]=D,e[34]=E):E=e[34];let R;e[35]!==a?(R=a("started"),e[35]=a,e[36]=R):R=e[36];let P;e[37]!==R?(P=(0,t.jsx)(S,{children:R}),e[37]=R,e[38]=P):P=e[38];let Z;e[39]!==a?(Z=a("duration"),e[39]=a,e[40]=Z):Z=e[40];let O;e[41]!==Z?(O=(0,t.jsx)(S,{children:Z}),e[41]=Z,e[42]=O):O=e[42];let H;e[43]!==a?(H=a("skipped"),e[43]=a,e[44]=H):H=e[44];let _;e[45]!==H?(_=(0,t.jsx)(S,{children:H}),e[45]=H,e[46]=_):_=e[46];let z;e[47]!==a?(z=a("error"),e[47]=a,e[48]=z):z=e[48];let K;e[49]!==z?(K=(0,t.jsx)(S,{children:z}),e[49]=z,e[50]=K):K=e[50],e[51]!==x||e[52]!==E||e[53]!==P||e[54]!==O||e[55]!==_||e[56]!==K?(y=(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[x,E,P,O,_,K]})}),e[51]=x,e[52]=E,e[53]=P,e[54]=O,e[55]=_,e[56]=K,e[57]=y):y=e[57],o=ae;let W;e[58]!==A?(W=b(M=>(0,t.jsxs)(B,{"data-testid":`cron-run-row-${M.runId}`,children:[(0,t.jsx)(J,{children:M.name}),(0,t.jsx)(J,{children:(0,t.jsx)(oe,{variant:Je[M.status],children:A[M.status]})}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:ee(M.startedAt,"\u2014")}),(0,t.jsx)(J,{className:"tabular-nums",children:M.status==="skipped"?"":Te(M.durationMs)}),(0,t.jsx)(J,{className:"tabular-nums",children:M.skipped>0?M.skipped:""}),(0,t.jsx)(J,{className:"text-xs text-destructive",children:M.error??""})]},M.runId),"B"),e[58]=A,e[59]=W):W=e[59],N=T.map(W),e[0]=u,e[1]=a,e[2]=o,e[3]=l,e[4]=n,e[5]=s,e[6]=N,e[7]=y,e[8]=i,e[9]=h,e[10]=g,e[11]=v,e[12]=f}else o=e[2],l=e[3],n=e[4],s=e[5],N=e[6],y=e[7],i=e[8],h=e[9],g=e[10],v=e[11],f=e[12];let d;e[60]!==o||e[61]!==N?(d=(0,t.jsx)(o,{children:N}),e[60]=o,e[61]=N,e[62]=d):d=e[62];let c;e[63]!==l||e[64]!==y||e[65]!==d?(c=(0,t.jsxs)(l,{children:[y,d]}),e[63]=l,e[64]=y,e[65]=d,e[66]=c):c=e[66];let m;e[67]!==n||e[68]!==i||e[69]!==c?(m=(0,t.jsx)(n,{className:i,children:c}),e[67]=n,e[68]=i,e[69]=c,e[70]=m):m=e[70];let k;e[71]!==s||e[72]!==m||e[73]!==h?(k=(0,t.jsx)(s,{className:h,children:m}),e[71]=s,e[72]=m,e[73]=h,e[74]=k):k=e[74];let w;return e[75]!==k||e[76]!==g||e[77]!==v||e[78]!==f?(w=(0,t.jsxs)("div",{className:g,"data-testid":v,children:[f,k]}),e[75]=k,e[76]=g,e[77]=v,e[78]=f,e[79]=w):w=e[79],w},"Ce");function qe(r,e){return e.startedAt-r.startedAt}b(qe,"Te");var Re=b(()=>{let r=(0,Y.c)(50),e=V(),u=ke(""),[a,o]=(0,U.useState)(""),[l,n]=(0,U.useState)(void 0),[s,N]=(0,U.useState)(!1);if(u.unavailable)return null;let y;r[0]!==u?(y=u.pending("cron"),r[0]=u,r[1]=y):y=r[1];let i=y,h;r[2]!==u?(h=u.reason("cron"),r[2]=u,r[3]=h):h=r[3];let g=h,v;r[4]!==a||r[5]!==u?(v=b(()=>{let R=a.trim();R!==""&&G((async()=>{let P=await u.suggestCron(R);N(!1),n(P)})())},"x"),r[4]=a,r[5]=u,r[6]=v):v=r[6];let f=v,d;r[7]!==l?(d=b(()=>{let R="navigator"in globalThis?globalThis.navigator.clipboard:void 0;R===void 0||l===void 0||G((async()=>{try{await R.writeText(l),N(!0)}catch{N(!1)}})())},"o"),r[7]=l,r[8]=d):d=r[8];let c=d,m;r[9]!==e?(m=e("Describe a schedule"),r[9]=e,r[10]=m):m=r[10];let k;r[11]===Symbol.for("react.memo_cache_sentinel")?(k=b(R=>{o(R.target.value)},"b"),r[11]=k):k=r[11];let w;r[12]!==f?(w=b(R=>{R.key==="Enter"&&(R.preventDefault(),f())},"y"),r[12]=f,r[13]=w):w=r[13];let T;r[14]!==e?(T=e("Describe a schedule"),r[14]=e,r[15]=T):T=r[15];let j;r[16]!==i||r[17]!==a||r[18]!==m||r[19]!==w||r[20]!==T?(j=(0,t.jsx)(ye,{"aria-label":m,className:"h-7 flex-1 text-xs","data-testid":"cron-assistant-prompt",disabled:i,onChange:k,onKeyDown:w,placeholder:T,value:a}),r[16]=i,r[17]=a,r[18]=m,r[19]=w,r[20]=T,r[21]=j):j=r[21];let $=i&&"opacity-60",C;r[22]!==$?(C=Ne("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",$),r[22]=$,r[23]=C):C=r[23];let I;r[24]!==i||r[25]!==a?(I=i||a.trim()==="",r[24]=i,r[25]=a,r[26]=I):I=r[26];let A;r[27]!==i||r[28]!==e?(A=e(i?"Thinking\u2026":"Suggest schedule"),r[27]=i,r[28]=e,r[29]=A):A=r[29];let p;r[30]!==f||r[31]!==C||r[32]!==I||r[33]!==A?(p=(0,t.jsx)("button",{className:C,"data-testid":"cron-assistant-generate",disabled:I,onClick:f,type:"button",children:A}),r[30]=f,r[31]=C,r[32]=I,r[33]=A,r[34]=p):p=r[34];let L;r[35]!==p||r[36]!==j?(L=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[j,p]}),r[35]=p,r[36]=j,r[37]=L):L=r[37];let x;r[38]!==s||r[39]!==c||r[40]!==l||r[41]!==e?(x=l!==void 0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs tabular-nums","data-testid":"cron-assistant-result",children:l}),(0,t.jsx)("button",{className:"rounded-md border border-border px-2 py-0.5 text-[11px] outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cron-assistant-copy",onClick:c,type:"button",children:e(s?"Copied":"Copy")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e("Add it to lunora/crons.ts \u2014 triggers are compiled into the worker.")})]}),r[38]=s,r[39]=c,r[40]=l,r[41]=e,r[42]=x):x=r[42];let D;r[43]!==g||r[44]!==e?(D=g!==void 0&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"cron-assistant-reason",role:"status",children:e(g==="ai-error"?"The model could not be reached.":"The model did not return a schedule Cron Triggers accept.")}),r[43]=g,r[44]=e,r[45]=D):D=r[45];let E;return r[46]!==L||r[47]!==x||r[48]!==D?(E=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"cron-assistant",children:[L,x,D]}),r[46]=L,r[47]=x,r[48]=D,r[49]=E):E=r[49],E},"Se"),Ee={kind:"idle"},Me="SCHEDULER_NOT_CONFIGURED",pe={inFlight:[],runs:[]},Be=b((r,e,u)=>u!==void 0?u:e===void 0?a=>r.runCronJob(a):void 0,"Ae"),Pe=b(({loadCronJobs:r,loadCronRuns:e,runCronJob:u}={})=>{let a=se(),o=V(),[l,n]=(0,U.useState)({}),s=te(["lunora-cron-jobs",r?"custom":"default"],()=>(r??(()=>a.getCronJobs()))()),{data:N,error:y}=s,i=e??(r===void 0?()=>a.listCronRuns():void 0),h=te(["lunora-cron-runs",e?"custom":"default"],async()=>i===void 0?pe:i().catch(d=>{if(ge(d)===Me)return pe;throw d})),g=h.data??pe;ne(()=>h.poll(),i!==void 0);let v=Be(a,r,u),f=b(async d=>{if(v!==void 0){n(c=>({...c,[d]:{kind:"running"}}));try{await v(d),n(c=>({...c,[d]:{kind:"ok"}})),s.refetch(),h.refetch()}catch(c){n(m=>({...m,[d]:{kind:"error",message:ce(c)}}))}}},"p");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[(0,t.jsx)(Re,{}),y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:y}),h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-runs-error",role:"alert",children:h.error}),N?.length===0&&(0,t.jsx)(de,{description:o("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:o("No cron triggers.")}),N!==void 0&&N.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"cron-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:o("name")}),(0,t.jsx)(S,{children:o("schedule")}),(0,t.jsx)(S,{children:o("target")}),(0,t.jsx)(S,{children:o("shard")}),(0,t.jsx)(S,{children:o("last run")}),v!==void 0&&(0,t.jsx)(S,{"aria-label":o("Actions")})]})}),(0,t.jsx)(ae,{children:N.map(d=>{let c=l[d.name]??Ee;return(0,t.jsxs)(B,{"data-testid":`cron-row-${d.name}`,children:[(0,t.jsx)(J,{children:d.name}),(0,t.jsx)(J,{className:"font-mono text-xs tabular-nums",children:d.cron}),(0,t.jsx)(J,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[d.workflow===void 0?(0,t.jsx)(oe,{variant:"outline",children:o("function")}):(0,t.jsx)(oe,{variant:"secondary",children:o("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:d.workflow??d.functionPath})]})}),(0,t.jsx)(J,{children:d.shardKey??""}),(0,t.jsx)(J,{"data-testid":`cron-last-run-${d.name}`,children:(0,t.jsx)(Fe,{inFlight:g.inFlight.find(m=>m.name===d.name),last:g.runs.find(m=>m.name===d.name)})}),v!==void 0&&(0,t.jsx)(J,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[c.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${d.name}`,children:o("ran")}),c.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${d.name}`,role:"alert",children:c.message}),(0,t.jsx)(ue,{confirmLabel:o("Run now?"),disabled:c.kind==="running",onConfirm:b(()=>{G(f(d.name))},"onConfirm"),testId:`cron-run-${d.name}`,children:c.kind==="running"?o("Running\u2026"):o("Run now")})]})})]},`${d.cron}:${d.name}`)})})]})})}),(0,t.jsx)(De,{runs:g.runs})]})},"Le"),He=b(r=>Number.isFinite(r)?ee(r,"\u2014"):"\u2014","Re"),Ke=b(r=>{let e=(0,Y.c)(34),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadJobs:a,removeJob:o,retryJob:l}=u,n=se(),s=V(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let y;e[3]!==n||e[4]!==a?(y=b(async()=>(await(a??(()=>n.listDeadJobs()))()).toSorted(We),"v"),e[3]=n,e[4]=a,e[5]=y):y=e[5];let i=te(N,y),h=i.data,[g,v]=(0,U.useState)(void 0),f=i.error??g,d=a===void 0,c;e[6]!==n||e[7]!==d||e[8]!==l?(c=l??(d?x=>n.retryDeadJob(x):void 0),e[6]=n,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m=c,k;e[10]!==n||e[11]!==d||e[12]!==o?(k=o??(d?x=>n.removeDeadJob(x):void 0),e[10]=n,e[11]=d,e[12]=o,e[13]=k):k=e[13];let w=k,T;e[14]!==i?(T=b(()=>i.poll(),"I"),e[14]=i,e[15]=T):T=e[15],ne(T,!0);let j;e[16]!==i?(j=b(async x=>{v(void 0);try{await x,i.refetch()}catch(D){v(ce(D))}},"w"),e[16]=i,e[17]=j):j=e[17];let $=j,C=m!==void 0||w!==void 0,I;e[18]!==f?(I=f!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:f}),e[18]=f,e[19]=I):I=e[19];let A;e[20]!==h?.length||e[21]!==s?(A=h?.length===0&&(0,t.jsx)(de,{description:s("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:s("No dead-letter jobs.")}),e[20]=h?.length,e[21]=s,e[22]=A):A=e[22];let p;e[23]!==$||e[24]!==C||e[25]!==h||e[26]!==w||e[27]!==m||e[28]!==s?(p=h!==void 0&&h.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"dlq-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:s("function")}),(0,t.jsx)(S,{children:s("attempts")}),(0,t.jsx)(S,{children:s("last tried")}),(0,t.jsx)(S,{children:s("pool")}),(0,t.jsx)(S,{children:s("shard")}),(0,t.jsx)(S,{children:s("id")}),C&&(0,t.jsx)(S,{"aria-label":s("Actions")})]})}),(0,t.jsx)(ae,{children:h.map(x=>(0,t.jsxs)(B,{"data-testid":`dlq-row-${x.id}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:x.workflow??x.functionPath}),(0,t.jsx)(J,{className:"tabular-nums",children:x.attempts??0}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:He(x.scheduledFor)}),(0,t.jsx)(J,{className:"font-mono text-xs",children:x.pool??""}),(0,t.jsx)(J,{children:x.shardKey??""}),(0,t.jsx)(J,{className:"font-mono text-xs",children:x.id}),C&&(0,t.jsx)(J,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[m!==void 0&&(0,t.jsx)(me,{"data-testid":`dlq-retry-${x.id}`,onClick:b(()=>{G($(m(x.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:s("Retry")}),w!==void 0&&(0,t.jsx)(ue,{confirmLabel:s("Drop job?"),onConfirm:b(()=>{G($(w(x.id)))},"onConfirm"),testId:`dlq-remove-${x.id}`,children:s("Drop")})]})})]},x.id))})]})})}),e[23]=$,e[24]=C,e[25]=h,e[26]=w,e[27]=m,e[28]=s,e[29]=p):p=e[29];let L;return e[30]!==p||e[31]!==I||e[32]!==A?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[I,A,p]}),e[30]=p,e[31]=I,e[32]=A,e[33]=L):L=e[33],L},"De");function We(r,e){return(e.attempts??0)-(r.attempts??0)}b(We,"Ee");var Ve={canceled:"secondary",failed:"destructive",pending:"outline",running:"info",succeeded:"success"},_e=b(r=>{let e=(0,Y.c)(47),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadJobs:a}=u,o=se(),l=V(),n;e[2]!==o||e[3]!==a?(n=a??(async q=>o.listScheduledHistory(q===void 0?{}:{cursor:q})),e[2]=o,e[3]=a,e[4]=n):n=e[4];let s=n,N=a?"custom":"default",y;e[5]!==N?(y=["lunora-job-history",N],e[5]=N,e[6]=y):y=e[6];let i;e[7]!==s?(i=b(async()=>s(),"d"),e[7]=s,e[8]=i):i=e[8];let h=te(y,i),[g,v]=(0,U.useState)(void 0),[f,d]=(0,U.useState)(!1),[c,m]=(0,U.useState)(void 0),k=h.data?.records,w;e[9]!==k?(w=new Set(k?.map(ze)),e[9]=k,e[10]=w):w=e[10];let T=w,j=k===void 0?void 0:[...k,...(g?.records??[]).filter(q=>!T.has(q.id))],$=g===void 0?h.data?.cursor:g.cursor,C;e[11]!==s||e[12]!==$?(C=b(async()=>{d(!0),m(void 0);try{let q=await s($);v($e=>({cursor:q.cursor,records:[...$e?.records??[],...q.records]})),d(!1)}catch(q){m(ce(q)),d(!1)}},"S"),e[11]=s,e[12]=$,e[13]=C):C=e[13];let I=C,A;e[14]!==l?(A=l("canceled"),e[14]=l,e[15]=A):A=e[15];let p;e[16]!==l?(p=l("failed"),e[16]=l,e[17]=p):p=e[17];let L;e[18]!==l?(L=l("pending"),e[18]=l,e[19]=L):L=e[19];let x;e[20]!==l?(x=l("running"),e[20]=l,e[21]=x):x=e[21];let D;e[22]!==l?(D=l("succeeded"),e[22]=l,e[23]=D):D=e[23];let E;e[24]!==L||e[25]!==x||e[26]!==D||e[27]!==A||e[28]!==p?(E={canceled:A,failed:p,pending:L,running:x,succeeded:D},e[24]=L,e[25]=x,e[26]=D,e[27]=A,e[28]=p,e[29]=E):E=e[29];let R=E,P;e[30]!==h?(P=b(()=>h.poll(),"P"),e[30]=h,e[31]=P):P=e[31],ne(P,g===void 0);let Z="flex flex-col gap-3",O="lunora-job-history",H;e[32]!==h.error?(H=h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"job-history-error",role:"alert",children:h.error}),e[32]=h.error,e[33]=H):H=e[33];let _=j?.length===0&&(0,t.jsx)(de,{description:l("Jobs that succeed, fail or are cancelled stay here for seven days."),testId:"job-history-empty",title:l("No finished jobs.")}),z=j!==void 0&&j.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"job-history-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:l("function")}),(0,t.jsx)(S,{children:l("state")}),(0,t.jsx)(S,{children:l("finished")}),(0,t.jsx)(S,{children:l("error")}),(0,t.jsx)(S,{children:l("id")})]})}),(0,t.jsx)(ae,{children:j.map(q=>(0,t.jsxs)(B,{"data-testid":`job-history-row-${q.id}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:q.workflow??q.functionPath}),(0,t.jsx)(J,{children:(0,t.jsx)(oe,{"data-testid":`job-history-state-${q.id}`,variant:Ve[q.state],children:R[q.state]})}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:ee(q.completedAt,"\u2014")}),(0,t.jsx)(J,{className:"text-xs text-destructive",children:q.error??""}),(0,t.jsx)(J,{className:"font-mono text-xs",children:q.id})]},q.id))})]})})}),K;e[34]!==c?(K=c!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:c}),e[34]=c,e[35]=K):K=e[35];let W;e[36]!==f||e[37]!==$||e[38]!==I||e[39]!==l?(W=$!==void 0&&(0,t.jsx)("div",{children:(0,t.jsx)(me,{"data-testid":"job-history-load-more",disabled:f,onClick:b(()=>{G(I())},"onClick"),variant:"outline",children:l(f?"Loading\u2026":"Load more")})}),e[36]=f,e[37]=$,e[38]=I,e[39]=l,e[40]=W):W=e[40];let M;return e[41]!==H||e[42]!==_||e[43]!==z||e[44]!==K||e[45]!==W?(M=(0,t.jsxs)("div",{className:Z,"data-testid":O,children:[H,_,z,K,W]}),e[41]=H,e[42]=_,e[43]=z,e[44]=K,e[45]=W,e[46]=M):M=e[46],M},"Je");function ze(r){return r.id}b(ze,"Fe");var fe=b(r=>{let e=(0,Y.c)(8),{label:u,testId:a,value:o}=r,l;e[0]!==u?(l=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),e[0]=u,e[1]=l):l=e[1];let n;e[2]!==a||e[3]!==o?(n=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":a,children:o}),e[2]=a,e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==l||e[6]!==n?(s=(0,t.jsx)(Q,{className:"flex-1 py-0",children:(0,t.jsxs)(X,{className:"flex flex-col gap-1 p-4",children:[l,n]})}),e[5]=l,e[6]=n,e[7]=s):s=e[7],s},"de"),Ue=b(r=>{let e=(0,Y.c)(25),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadStatus:a}=u,o=se(),l=V(),n=a===void 0,s;e[2]!==n?(s=["lunora-scheduler-status",n],e[2]=n,e[3]=s):s=e[3];let N;e[4]!==o||e[5]!==a?(N=b(async()=>{let k=await(a??(()=>o.schedulerStatus()))();return{...k,pools:k.pools.toSorted(Ge)}},"N"),e[4]=o,e[5]=a,e[6]=N):N=e[6];let y=te(s,N),{data:i,error:h}=y,g;e[7]!==y?(g=b(()=>y.poll(),"g"),e[7]=y,e[8]=g):g=e[8],ne(g,!0);let v;e[9]!==h?(v=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:h}),e[9]=h,e[10]=v):v=e[10];let f;e[11]!==i||e[12]!==l?(f=i!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(fe,{label:l("backlog"),testId:"pools-backlog",value:i.backlog}),(0,t.jsx)(fe,{label:l("in flight"),testId:"pools-inflight",value:i.inFlight}),(0,t.jsx)(fe,{label:l("pools"),testId:"pools-count",value:i.pools.length})]}),e[11]=i,e[12]=l,e[13]=f):f=e[13];let d;e[14]!==i?.pools.length||e[15]!==l?(d=i?.pools.length===0&&(0,t.jsx)(de,{description:l("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:l("No workpools.")}),e[14]=i?.pools.length,e[15]=l,e[16]=d):d=e[16];let c;e[17]!==i||e[18]!==l?(c=i!==void 0&&i.pools.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"pools-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:l("pool")}),(0,t.jsx)(S,{children:l("queued")}),(0,t.jsx)(S,{children:l("in flight")}),(0,t.jsx)(S,{children:l("max concurrency")})]})}),(0,t.jsx)(ae,{children:i.pools.map(Qe)})]})})}),e[17]=i,e[18]=l,e[19]=c):c=e[19];let m;return e[20]!==v||e[21]!==f||e[22]!==d||e[23]!==c?(m=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[v,f,d,c]}),e[20]=v,e[21]=f,e[22]=d,e[23]=c,e[24]=m):m=e[24],m},"Oe");function Ge(r,e){return e.queued-r.queued}b(Ge,"Pe");function Qe(r){return(0,t.jsxs)(B,{"data-testid":`pools-row-${r.name}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:r.name}),(0,t.jsx)(J,{className:"tabular-nums",children:r.queued}),(0,t.jsxs)(J,{className:"tabular-nums",children:[r.inFlight," / ",r.maxConcurrency]}),(0,t.jsx)(J,{className:"tabular-nums",children:r.maxConcurrency})]},r.name)}b(Qe,"qe");var Xe=["jobs","history","dead","pools","cron"],jt=b(r=>{let e=(0,Y.c)(48),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadCronJobs:a,scheduledCancel:o,scheduledLoad:l}=u,n=V(),[s,N]=(0,U.useState)("jobs"),y;e[2]!==n?(y=n("Cron triggers"),e[2]=n,e[3]=y):y=e[3];let i;e[4]!==n?(i=n("Dead letter"),e[4]=n,e[5]=i):i=e[5];let h;e[6]!==n?(h=n("History"),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==n?(g=n("Scheduled jobs"),e[8]=n,e[9]=g):g=e[9];let v;e[10]!==n?(v=n("Pools"),e[10]=n,e[11]=v):v=e[11];let f;e[12]!==y||e[13]!==i||e[14]!==h||e[15]!==g||e[16]!==v?(f={cron:y,dead:i,history:h,jobs:g,pools:v},e[12]=y,e[13]=i,e[14]=h,e[15]=g,e[16]=v,e[17]=f):f=e[17];let d=f,c;e[18]===Symbol.for("react.memo_cache_sentinel")?(c=b(x=>{N(x.currentTarget.dataset.view)},"c"),e[18]=c):c=e[18];let m=c,k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(we,{}),e[19]=k):k=e[19];let w;e[20]!==n?(w=n("Schedule view"),e[20]=n,e[21]=w):w=e[21];let T;e[22]!==s||e[23]!==d?(T=Xe.map(x=>(0,t.jsx)(me,{"aria-selected":s===x,"data-testid":`schedule-view-${x}`,"data-view":x,onClick:m,role:"tab",size:"sm",type:"button",variant:s===x?"default":"outline",children:d[x]},x)),e[22]=s,e[23]=d,e[24]=T):T=e[24];let j;e[25]!==w||e[26]!==T?(j=(0,t.jsx)("div",{"aria-label":w,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:T}),e[25]=w,e[26]=T,e[27]=j):j=e[27];let $;e[28]!==o||e[29]!==l||e[30]!==s?($=s==="jobs"&&(0,t.jsx)(Se,{cancelJob:o,loadJobs:l}),e[28]=o,e[29]=l,e[30]=s,e[31]=$):$=e[31];let C;e[32]!==s?(C=s==="history"&&(0,t.jsx)(_e,{}),e[32]=s,e[33]=C):C=e[33];let I;e[34]!==s?(I=s==="dead"&&(0,t.jsx)(Ke,{}),e[34]=s,e[35]=I):I=e[35];let A;e[36]!==s?(A=s==="pools"&&(0,t.jsx)(Ue,{}),e[36]=s,e[37]=A):A=e[37];let p;e[38]!==a||e[39]!==s?(p=s==="cron"&&(0,t.jsx)(Pe,{loadCronJobs:a}),e[38]=a,e[39]=s,e[40]=p):p=e[40];let L;return e[41]!==j||e[42]!==$||e[43]!==C||e[44]!==I||e[45]!==A||e[46]!==p?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[k,j,$,C,I,A,p]}),e[41]=j,e[42]=$,e[43]=C,e[44]=I,e[45]=A,e[46]=p,e[47]=L):L=e[47],L},"it");export{jt as SchedulePanel};