@lunora/studio 1.0.0-alpha.53 → 1.0.0-alpha.55

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 (135) hide show
  1. package/dist/index.d.ts +680 -780
  2. package/dist/index.js +8 -8
  3. package/dist/mount.d.ts +10 -10
  4. package/dist/mount.js +1 -1
  5. package/dist/packem_chunks/ApiTab.js +1 -1
  6. package/dist/packem_chunks/AuditPanel.js +2 -2
  7. package/dist/packem_chunks/ExportImportPanel.js +2 -2
  8. package/dist/packem_chunks/FileBrowser.js +3 -3
  9. package/dist/packem_chunks/FunctionRunner.js +1 -1
  10. package/dist/packem_chunks/FunctionStatsPanel.js +2 -2
  11. package/dist/packem_chunks/HealthPanel.js +2 -2
  12. package/dist/packem_chunks/InsightsPanel.js +2 -2
  13. package/dist/packem_chunks/LogsPanel.js +81 -53
  14. package/dist/packem_chunks/MailPanel.js +1 -1
  15. package/dist/packem_chunks/MetricsPanel.js +392 -7
  16. package/dist/packem_chunks/MigrationsPanel.js +2 -2
  17. package/dist/packem_chunks/PitrPanel.js +1 -1
  18. package/dist/packem_chunks/SchemaViewer.js +2 -2
  19. package/dist/packem_chunks/SecurityAdvisorPanel.js +2 -2
  20. package/dist/packem_chunks/SettingsPanel.js +3 -3
  21. package/dist/packem_chunks/SqlEditorPanel.js +1 -1
  22. package/dist/packem_chunks/TableEditor.js +2 -2
  23. package/dist/packem_chunks/agents-panel.js +2 -2
  24. package/dist/packem_chunks/analytics-panel.js +1 -1
  25. package/dist/packem_chunks/auth-config-panel.js +1 -1
  26. package/dist/packem_chunks/auth-sessions-panel.js +1 -1
  27. package/dist/packem_chunks/containers-panel.js +2 -2
  28. package/dist/packem_chunks/dashboards-panel.js +2 -2
  29. package/dist/packem_chunks/fanout-panel.js +2 -2
  30. package/dist/packem_chunks/flags-panel.js +2 -2
  31. package/dist/packem_chunks/issues-panel.js +2 -2
  32. package/dist/packem_chunks/kv-browser.js +2 -2
  33. package/dist/packem_chunks/log-drains-panel.js +2 -2
  34. package/dist/packem_chunks/organizations-panel.js +1 -1
  35. package/dist/packem_chunks/payments-panel.js +2 -2
  36. package/dist/packem_chunks/permissions-panel.js +2 -2
  37. package/dist/packem_chunks/queues-panel.js +2 -2
  38. package/dist/packem_chunks/rls-panel.js +2 -2
  39. package/dist/packem_chunks/schedule-panel.js +2 -2
  40. package/dist/packem_chunks/storage-rules-panel.js +2 -2
  41. package/dist/packem_chunks/subscriptions-panel.js +2 -2
  42. package/dist/packem_chunks/traces-panel.js +734 -0
  43. package/dist/packem_chunks/users-panel.js +1 -1
  44. package/dist/packem_chunks/vector-browser.js +1 -1
  45. package/dist/packem_chunks/workflows-panel.js +2 -2
  46. package/dist/packem_shared/{ADMIN_FUNCTIONS-DNeyYtUN.js → ADMIN_FUNCTIONS-C6TEeUiJ.js} +2 -0
  47. package/dist/packem_shared/{ApiDocsPanel-_aEZxAMX.js → ApiDocsPanel-CcC6ucbp.js} +1 -1
  48. package/dist/packem_shared/{DataBrowser-C8hejnub.js → DataBrowser-BuFEPTiv.js} +1 -1
  49. package/dist/packem_shared/{GlobalDataBrowser-f5Ll2AQK.js → GlobalDataBrowser-D8h1fTL1.js} +1 -1
  50. package/dist/packem_shared/{HomePanel-Ye8PaqQL.js → HomePanel-2I1YZm0A.js} +3 -3
  51. package/dist/packem_shared/{ScheduledJobs-dHMgnJbx.js → ScheduledJobs-Cz5Tr-M6.js} +1 -1
  52. package/dist/packem_shared/{Studio-BNGjxLVo.js → Studio-CCJBI2wP.js} +2 -2
  53. package/dist/packem_shared/{StudioApp-K9dn1Q9d.js → StudioApp-Daeqxw2h.js} +1 -1
  54. package/dist/packem_shared/{advisor-view-Cx21PS_T.js → advisor-view-1RaDWED7.js} +1 -1
  55. package/dist/packem_shared/app.d-C-kxb-1T.d.ts +254 -0
  56. package/dist/packem_shared/{card-DURq3ElK.js → card-F2vH_aj2.js} +1 -1
  57. package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-SIbyi4Y1.js} +1 -1
  58. package/dist/packem_shared/{home-panel-D62G8108.js → home-panel-DHHUtnKU.js} +2 -2
  59. package/dist/packem_shared/log-fields-jEH83H2G.js +18 -0
  60. package/dist/packem_shared/{studio-Cd21fp4v.js → studio-0479nrrm.js} +551 -524
  61. package/dist/standalone/{chunk-SDQE2IUJ.js → chunk-3W4CSGDO.js} +1 -1
  62. package/dist/standalone/{chunk-FFVSSWU2.js → chunk-4AZYW2PI.js} +1 -1
  63. package/dist/standalone/{chunk-ZQQ3MFEQ.js → chunk-4F72YCTU.js} +1 -1
  64. package/dist/standalone/{chunk-IZN4TYMN.js → chunk-5IGHDPEP.js} +1 -1
  65. package/dist/standalone/{chunk-T7FHIJ2T.js → chunk-6LLFTVEI.js} +1 -1
  66. package/dist/standalone/{chunk-JPILGFXT.js → chunk-7YGTGBP7.js} +1 -1
  67. package/dist/standalone/{chunk-OETK333R.js → chunk-AE3AKGOW.js} +1 -1
  68. package/dist/standalone/{chunk-TO6D2PJC.js → chunk-CHNXZYAC.js} +1 -1
  69. package/dist/standalone/{chunk-R2MAZ2OH.js → chunk-CW7LZ4SR.js} +1 -1
  70. package/dist/standalone/{chunk-WUFVFVHJ.js → chunk-D73WYMRU.js} +1 -1
  71. package/dist/standalone/{chunk-YFZ27MEC.js → chunk-DVBY6YQK.js} +1 -1
  72. package/dist/standalone/chunk-EBTLTGG3.js +1 -0
  73. package/dist/standalone/chunk-EIZG4GOM.js +1 -0
  74. package/dist/standalone/{chunk-DMFVDMUJ.js → chunk-EPDC422O.js} +1 -1
  75. package/dist/standalone/{chunk-ISOUWAPB.js → chunk-FBGC3RSU.js} +1 -1
  76. package/dist/standalone/{chunk-LUP4YTBS.js → chunk-FDWXYXOM.js} +1 -1
  77. package/dist/standalone/{chunk-XXAW7V4T.js → chunk-FPKTXKPE.js} +1 -1
  78. package/dist/standalone/{chunk-AITOCPML.js → chunk-FQUNSQLG.js} +1 -1
  79. package/dist/standalone/{chunk-HRHG4HOZ.js → chunk-FXNS5NBY.js} +1 -1
  80. package/dist/standalone/{chunk-3GVA2ROQ.js → chunk-G4GGGHEV.js} +1 -1
  81. package/dist/standalone/{chunk-C4QK2DJN.js → chunk-G5CMK5GY.js} +1 -1
  82. package/dist/standalone/{chunk-GPQX3AEO.js → chunk-G5RC7USY.js} +1 -1
  83. package/dist/standalone/{chunk-PWKD5FTM.js → chunk-GVFODXW2.js} +1 -1
  84. package/dist/standalone/{chunk-MDTNVR3G.js → chunk-HNIDN3RX.js} +1 -1
  85. package/dist/standalone/{chunk-XXXNY3DK.js → chunk-IKVZUVHJ.js} +1 -1
  86. package/dist/standalone/{chunk-3C3CU2DS.js → chunk-JGCRBFFO.js} +1 -1
  87. package/dist/standalone/chunk-JHR3HKT5.js +3 -0
  88. package/dist/standalone/{chunk-WXUUGXDV.js → chunk-JQPHZL2A.js} +1 -1
  89. package/dist/standalone/{chunk-CRY26DNY.js → chunk-LJE6PGHD.js} +1 -1
  90. package/dist/standalone/{chunk-5JB7FDCA.js → chunk-LTCX3QOE.js} +1 -1
  91. package/dist/standalone/{chunk-ALL4U2C5.js → chunk-MWH5LBNF.js} +1 -1
  92. package/dist/standalone/{chunk-CZGILAZI.js → chunk-N5FMEYSL.js} +1 -1
  93. package/dist/standalone/chunk-N7SVJOHN.js +1 -0
  94. package/dist/standalone/{chunk-7KSXHCUD.js → chunk-NAFKYFBZ.js} +1 -1
  95. package/dist/standalone/{chunk-3XBP6RRG.js → chunk-OVSBLTAA.js} +1 -1
  96. package/dist/standalone/chunk-OXHHSUXO.js +1 -0
  97. package/dist/standalone/chunk-PIB7VUVM.js +1 -0
  98. package/dist/standalone/{chunk-IC7XYSER.js → chunk-Q3X7IMLF.js} +1 -1
  99. package/dist/standalone/{chunk-LAK5VSPI.js → chunk-QVIPA6UJ.js} +1 -1
  100. package/dist/standalone/{chunk-NXAKNU3L.js → chunk-RCSULEDU.js} +1 -1
  101. package/dist/standalone/{chunk-6TMEOFZC.js → chunk-RDA4VTHI.js} +1 -1
  102. package/dist/standalone/{chunk-VY6AI3RI.js → chunk-RG4HLPM2.js} +1 -1
  103. package/dist/standalone/{chunk-LOYE7OU2.js → chunk-S2G7OH5T.js} +1 -1
  104. package/dist/standalone/{chunk-7N5KFSSB.js → chunk-SP7GSPKX.js} +1 -1
  105. package/dist/standalone/{chunk-W6JKUZKD.js → chunk-SPACAIAR.js} +1 -1
  106. package/dist/standalone/{chunk-X4QFAAZ5.js → chunk-SWMBBYJU.js} +1 -1
  107. package/dist/standalone/{chunk-HZKFL2M7.js → chunk-TTEEPVCN.js} +1 -1
  108. package/dist/standalone/{chunk-SXAFEREK.js → chunk-VC2VDAUO.js} +1 -1
  109. package/dist/standalone/{chunk-USYCKPUK.js → chunk-VQ3YOUZB.js} +1 -1
  110. package/dist/standalone/chunk-VXM5H542.js +4 -0
  111. package/dist/standalone/{chunk-3MAQAOUA.js → chunk-W7ND56KZ.js} +1 -1
  112. package/dist/standalone/{chunk-43F677PE.js → chunk-WA3DGSC2.js} +1 -1
  113. package/dist/standalone/{chunk-75LPCQ77.js → chunk-WCLFE2ZB.js} +1 -1
  114. package/dist/standalone/{chunk-EEWKIQUE.js → chunk-WOYQG5AM.js} +1 -1
  115. package/dist/standalone/{chunk-JM7XBQVK.js → chunk-XCNYUUD6.js} +1 -1
  116. package/dist/standalone/{chunk-ZVT4GJEI.js → chunk-XG4TZSP4.js} +1 -1
  117. package/dist/standalone/{chunk-A3ZJACVT.js → chunk-XZWFP2GI.js} +1 -1
  118. package/dist/standalone/chunk-YNSFQKMM.js +1 -0
  119. package/dist/standalone/{chunk-CODD62OJ.js → chunk-YRE6TGXH.js} +1 -1
  120. package/dist/standalone/{chunk-S7RKDQPS.js → chunk-YS7NUMAN.js} +1 -1
  121. package/dist/standalone/{chunk-IEKK5GO6.js → chunk-ZUTFDG76.js} +1 -1
  122. package/dist/standalone/{chunk-22C6COGE.js → chunk-ZXLEXF4X.js} +2 -2
  123. package/dist/standalone/studio.js +1 -1
  124. package/dist/styles.css +2 -2
  125. package/package.json +8 -8
  126. package/dist/packem_shared/app.d-CGdOmLTm.d.ts +0 -300
  127. package/dist/standalone/chunk-G7ZBM54M.js +0 -1
  128. package/dist/standalone/chunk-I7Y7ST5Y.js +0 -1
  129. package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
  130. package/dist/standalone/chunk-LT7IG26L.js +0 -1
  131. package/dist/standalone/chunk-TC4KPQJ7.js +0 -3
  132. package/dist/standalone/chunk-WI7GWFEG.js +0 -1
  133. /package/dist/standalone/{chunk-ITQKVEP7.js → chunk-5XO36X4C.js} +0 -0
  134. /package/dist/standalone/{chunk-TQ36RWOP.js → chunk-IYHPYY4A.js} +0 -0
  135. /package/dist/standalone/{chunk-SEU5V7I6.js → chunk-Y572GMZE.js} +0 -0
@@ -0,0 +1 @@
1
+ import{b as xs}from"./chunk-KEGAWN6Y.js";import{a as Ps}from"./chunk-HV7G6DFP.js";import{a as rt}from"./chunk-3OA7PECS.js";import{a as i,e as k,f as j}from"./chunk-RRCPZMC2.js";var Jo=k(j(),1),ue=Jo.createContext(null);var Yo=k(j(),1);function D(t){let o=Yo.useContext(ue);return(t?.warn??!0)&&!o&&console.warn("Warning: useRouter must be used inside a <RouterProvider> component!"),o}i(D,"useRouter");var ze=k(j(),1),Mt=ze.createContext(void 0),Xo=ze.createContext(void 0);function pt(t){return t[t.length-1]}i(pt,"last");function ws(t){return typeof t=="function"}i(ws,"isFunction");function Y(t,o){return ws(t)?t(o):t}i(Y,"functionalUpdate");var or=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable;function mt(t){for(let o in t)if(or.call(t,o))return!0;return!1}i(mt,"hasKeys");var _s=i(()=>Object.create(null),"createNull"),gt=i((t,o)=>at(t,o,_s),"nullReplaceEqualDeep");function at(t,o,e=()=>({}),s=0){if(!1)return o;if(t===o)return t;if(s>500)return o;let r=o,n=Ke(t)&&Ke(r);if(!n&&!(Yt(t)&&Yt(r)))return r;let a=n?t:Qo(t);if(!a)return r;let u=n?r:Qo(r);if(!u)return r;let c=a.length,d=u.length,f=n?new Array(d):e(),l=0;for(let p=0;p<d;p++){let h=n?p:u[p],m=t[h],y=r[h];if(m===y){f[h]=m,(n?p<c:or.call(t,h))&&l++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[h]=y;continue}let v=at(m,y,e,s+1);f[h]=v,v===m&&l++}return c===d&&l===c?t:f}i(at,"replaceEqualDeep");function Qo(t){let o=Object.getOwnPropertyNames(t);for(let r of o)if(!Zo.call(t,r))return!1;let e=Object.getOwnPropertySymbols(t);if(e.length===0)return o;let s=o;for(let r of e){if(!Zo.call(t,r))return!1;s.push(r)}return s}i(Qo,"getEnumerableOwnKeys");function Yt(t){if(!tr(t))return!1;let o=t.constructor;if(typeof o>"u")return!0;let e=o.prototype;return!(!tr(e)||!e.hasOwnProperty("isPrototypeOf"))}i(Yt,"isPlainObject");function tr(t){return Object.prototype.toString.call(t)==="[object Object]"}i(tr,"hasObjectPrototype");function Ke(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(Ke,"isPlainArray");function st(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,r=t.length;s<r;s++)if(!st(t[s],o[s],e))return!1;return!0}if(Yt(t)&&Yt(o)){let s=e?.ignoreUndefined??!0;if(e?.partial){for(let a in o)if((!s||o[a]!==void 0)&&!st(t[a],o[a],e))return!1;return!0}let r=0;if(!s)r=Object.keys(t).length;else for(let a in t)t[a]!==void 0&&r++;let n=0;for(let a in o)if((!s||o[a]!==void 0)&&(n++,n>r||!st(t[a],o[a],e)))return!1;return r===n}return!1}i(st,"deepEqual");function ct(t){let o,e,s=new Promise((r,n)=>{o=r,e=n});return s.status="pending",s.resolve=r=>{s.status="resolved",s.value=r,o(r),t?.(r)},s.reject=r=>{s.status="rejected",e(r)},s}i(ct,"createControlledPromise");function vt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}i(vt,"isPromise");function qe(t,o){for(let e=t.length-1;e>=0;e--){let s=t[e];if(o(s))return s}}i(qe,"findLast");var Cs=/[\x00-\x1f\x7f"<>`{}]/g;function bs(t){return t.replace(Cs,o=>"%"+o.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(bs,"sanitizePathSegment");function er(t){let o;try{o=decodeURI(t)}catch{o=t.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return bs(o)}i(er,"decodeSegment");var Ge=["http:","https:","mailto:","tel:"];function ut(t,o){if(!t)return!1;try{let e=new URL(t);return!o.has(e.protocol)}catch{return!1}}i(ut,"isDangerousProtocol");function Bt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let o=/%25|%5C/gi,e=0,s="",r;for(;(r=o.exec(t))!==null;)s+=er(t.slice(e,r.index))+r[0],e=o.lastIndex;s=s+er(e?t.slice(e):t);let n=!1;return s.startsWith("//")&&(n=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:n}}i(Bt,"decodePath");function rr(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(rr,"encodePathLikeUrl");function sr(t,o){if(t===o)return!0;if(t.length!==o.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==o[e])return!1;return!0}i(sr,"arraysEqual");function $(){throw new Error("Invariant failed")}i($,"invariant");function yt(t){let o=new Map,e,s,r=i(n=>{n.next&&(n.prev?(n.prev.next=n.next,n.next.prev=n.prev,n.next=void 0,s&&(s.next=n,n.prev=s)):(n.next.prev=void 0,e=n.next,n.next=void 0,s&&(n.prev=s,s.next=n)),s=n)},"touch");return{get(n){let a=o.get(n);if(a)return r(a),a.value},set(n,a){if(o.size>=t&&e){let c=e;o.delete(c.key),c.next&&(e=c.next,c.next.prev=void 0),c===s&&(s=void 0)}let u=o.get(n);if(u)u.value=a,r(u);else{let c={key:n,value:a,prev:s};s&&(s.next=c),s=c,e||(e=c),o.set(n,c)}},clear(){o.clear(),e=void 0,s=void 0}}}i(yt,"createLRUCache");var St=4,ir=5;function Ls(t){let o=t.indexOf("{");if(o===-1)return null;let e=t.indexOf("}",o);return e===-1||o+1>=t.length?null:[o,e]}i(Ls,"getOpenAndCloseBraces");function Xe(t,o,e=new Uint16Array(6)){let s=t.indexOf("/",o),r=s===-1?t.length:s,n=t.substring(o,r);if(!n||!n.includes("$"))return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e;if(n==="$"){let u=t.length;return e[0]=2,e[1]=o,e[2]=o,e[3]=u,e[4]=u,e[5]=u,e}if(n.charCodeAt(0)===36)return e[0]=1,e[1]=o,e[2]=o+1,e[3]=r,e[4]=r,e[5]=r,e;let a=Ls(n);if(a){let[u,c]=a,d=n.charCodeAt(u+1);if(d===45){if(u+2<n.length&&n.charCodeAt(u+2)===36){let f=u+3,l=c;if(f<l)return e[0]=3,e[1]=o+u,e[2]=o+f,e[3]=o+l,e[4]=o+c+1,e[5]=r,e}}else if(d===36){let f=u+1,l=u+2;return l===c?(e[0]=2,e[1]=o+u,e[2]=o+f,e[3]=o+l,e[4]=o+c+1,e[5]=t.length,e):(e[0]=1,e[1]=o+u,e[2]=o+l,e[3]=o+c,e[4]=o+c+1,e[5]=r,e)}}return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e}i(Xe,"parseSegment");function de(t,o,e,s,r,n,a){a?.(e);let u=s;{let c=e.fullPath??e.from,d=c.length,f=e.options?.caseSensitive??t,l=e.options?.params?.parse??e.options?.parseParams;for(;u<d;){let h=Xe(c,u,o),m,y=u,v=h[5];switch(u=v+1,n++,h[0]){case 0:{let g=c.substring(h[2],h[3]);if(f){let R=r.static?.get(g);if(R)m=R;else{r.static??=new Map;let S=It(e.fullPath??e.from);S.parent=r,S.depth=n,m=S,r.static.set(g,S)}}else{let R=g.toLowerCase(),S=r.staticInsensitive?.get(R);if(S)m=S;else{r.staticInsensitive??=new Map;let P=It(e.fullPath??e.from);P.parent=r,P.depth=n,m=P,r.staticInsensitive.set(R,P)}}break}case 1:{let g=c.substring(y,h[1]),R=c.substring(h[4],v),S=f&&!!(g||R),P=g?S?g:g.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,L=!l&&r.dynamic?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(L)m=L;else{let x=Ye(1,e.fullPath??e.from,S,P,_);m=x,x.depth=n,x.parent=r,r.dynamic??=[],r.dynamic.push(x)}break}case 3:{let g=c.substring(y,h[1]),R=c.substring(h[4],v),S=f&&!!(g||R),P=g?S?g:g.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,L=!l&&r.optional?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(L)m=L;else{let x=Ye(3,e.fullPath??e.from,S,P,_);m=x,x.parent=r,x.depth=n,r.optional??=[],r.optional.push(x)}break}case 2:{let g=c.substring(y,h[1]),R=c.substring(h[4],v),S=f&&!!(g||R),P=g?S?g:g.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,L=Ye(2,e.fullPath??e.from,S,P,_);m=L,L.parent=r,L.depth=n,r.wildcard??=[],r.wildcard.push(L)}}r=m}if(l&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){let h=It(e.fullPath??e.from);h.kind=ir,h.parent=r,n++,h.depth=n,r.pathless??=[],r.pathless.push(h),r=h}let p=(e.path||!e.children)&&!e.isRoot;if(p&&c.endsWith("/")){let h=It(e.fullPath??e.from);h.kind=St,h.parent=r,n++,h.depth=n,r.index=h,r=h}r.parse=l??null,r.priority=e.options?.params?.priority??0,p&&!r.route&&(r.route=e,r.fullPath=e.fullPath??e.from)}if(e.children)for(let c of e.children)de(t,o,c,u,r,n,a)}i(de,"parseSegments");function Je(t,o){if(t.parse&&!o.parse)return-1;if(!t.parse&&o.parse)return 1;if(t.parse&&o.parse&&(t.priority||o.priority))return o.priority-t.priority;if(t.prefix&&o.prefix&&t.prefix!==o.prefix){if(t.prefix.startsWith(o.prefix))return-1;if(o.prefix.startsWith(t.prefix))return 1}if(t.suffix&&o.suffix&&t.suffix!==o.suffix){if(t.suffix.endsWith(o.suffix))return-1;if(o.suffix.endsWith(t.suffix))return 1}return t.prefix&&!o.prefix?-1:!t.prefix&&o.prefix?1:t.suffix&&!o.suffix?-1:!t.suffix&&o.suffix?1:t.caseSensitive&&!o.caseSensitive?-1:!t.caseSensitive&&o.caseSensitive?1:0}i(Je,"sortDynamic");function Rt(t){if(t.pathless)for(let o of t.pathless)Rt(o);if(t.static)for(let o of t.static.values())Rt(o);if(t.staticInsensitive)for(let o of t.staticInsensitive.values())Rt(o);if(t.dynamic?.length){t.dynamic.sort(Je);for(let o of t.dynamic)Rt(o)}if(t.optional?.length){t.optional.sort(Je);for(let o of t.optional)Rt(o)}if(t.wildcard?.length){t.wildcard.sort(Je);for(let o of t.wildcard)Rt(o)}}i(Rt,"sortTreeNodes");function It(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}i(It,"createStaticNode");function Ye(t,o,e,s,r){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:o,parent:null,parse:null,priority:0,caseSensitive:e,prefix:s,suffix:r}}i(Ye,"createDynamicNode");function ar(t,o){let e=It("/"),s=new Uint16Array(6);for(let r of t)de(!1,s,r,1,e,0);Rt(e),o.masksTree=e,o.flatCache=yt(1e3)}i(ar,"processRouteMasks");function cr(t,o){t||="/";let e=o.flatCache.get(t);if(e)return e;let s=Ze(t,o.masksTree);return o.flatCache.set(t,s),s}i(cr,"findFlatMatch");function ur(t,o,e,s,r){t||="/",s||="/";let n=o?`case\0${t}`:t,a=r.singleCache.get(n);return a||(a=It("/"),de(o,new Uint16Array(6),{from:t},1,a,0),r.singleCache.set(n,a)),Ze(s,a,e)}i(ur,"findSingleMatch");function lr(t,o,e=!1){let s=e?t:`nofuzz\0${t}`,r=o.matchCache.get(s);if(r!==void 0)return r;t||="/";let n;try{n=Ze(t,o.segmentTree,e)}catch(a){if(a instanceof URIError)n=null;else throw a}return n&&(n.branch=Qe(n.route)),o.matchCache.set(s,n),n}i(lr,"findRouteMatch");function Ms(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Ms,"trimPathRight");function fr(t,o=!1,e){let s=It(t.fullPath),r=new Uint16Array(6),n={},a={},u=0;return de(o,r,t,1,s,0,c=>{if(e?.(c,u),c.id in n)throw new Error(`Invariant failed: Duplicate routes found with id: ${String(c.id)}`);if(n[c.id]=c,u!==0&&c.path){let d=Ms(c.fullPath);(!a[d]||c.fullPath.endsWith("/"))&&(a[d]=c)}u++}),Rt(s),{processedTree:{segmentTree:s,singleCache:yt(1e3),matchCache:yt(1e3),flatCache:null,masksTree:null},routesById:n,routesByPath:a}}i(fr,"processRouteTree");function Ze(t,o,e=!1){let s=t.split("/"),r=Es(t,s,o,e);if(!r)return null;let[n]=dr(t,s,r);return{route:r.node.route,rawParams:n}}i(Ze,"findMatch");function dr(t,o,e){let s=Is(e.node),r=null,n=Object.create(null),a=e.extract?.part??0,u=e.extract?.node??0,c=e.extract?.path??0,d=e.extract?.segment??0;for(;u<s.length;a++,u++,c++,d++){let f=s[u];if(f.kind===St)break;if(f.kind===ir){d--,a--,c--;continue}let l=o[a],p=c;if(l&&(c+=l.length),f.kind===1){r??=e.node.fullPath.split("/");let h=r[d],m=f.prefix?.length??0;if(h.charCodeAt(m)===123){let y=f.suffix?.length??0,v=h.substring(m+2,h.length-y-1),g=l.substring(m,l.length-y);n[v]=decodeURIComponent(g)}else{let y=h.substring(1);n[y]=decodeURIComponent(l)}}else if(f.kind===3){if(e.skipped&1<<u){a--,c=p-1;continue}r??=e.node.fullPath.split("/");let h=r[d],m=f.prefix?.length??0,y=f.suffix?.length??0,v=h.substring(m+3,h.length-y-1),g=f.suffix||f.prefix?l.substring(m,l.length-y):l;g&&(n[v]=decodeURIComponent(g))}else if(f.kind===2){let h=f,m=t.substring(p+(h.prefix?.length??0),t.length-(h.suffix?.length??0)),y=decodeURIComponent(m);n["*"]=y,n._splat=y;break}}return e.rawParams&&Object.assign(n,e.rawParams),[n,{part:a,node:u,path:c,segment:d}]}i(dr,"extractParams");function Qe(t){let o=[t];for(;t.parentRoute;)t=t.parentRoute,o.push(t);return o.reverse(),o}i(Qe,"buildRouteBranch");function Is(t){let o=Array(t.depth+1);do o[t.depth]=t,t=t.parent;while(t);return o}i(Is,"buildBranch");function Es(t,o,e,s){if(t==="/"&&e.index)return{node:e.index,skipped:0};let r=!pt(o),n=r&&t!=="/",a=o.length-(r?1:0),u=[{node:e,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,d=null;for(;u.length;){let f=u.pop(),{node:l,index:p,skipped:h,depth:m,statics:y,dynamics:v,optionals:g}=f,{extract:R,rawParams:S}=f;if(l.kind===2&&l.route&&!fe(d,f))continue;if(l.parse){if(!nr(t,o,f))continue;S=f.rawParams,R=f.extract}s&&l.route&&l.kind!==St&&fe(c,f)&&(c=f);let P=p===a;if(P&&(l.route&&(!n||l.kind===St||l.kind===2)&&fe(d,f)&&(d=f),!l.optional&&!l.wildcard&&!l.index&&!l.pathless))continue;let _=P?void 0:o[p],L;if(P&&l.index){let x={node:l.index,index:p,skipped:h,depth:m+1,statics:y,dynamics:v,optionals:g,extract:R,rawParams:S},w=!0;if(l.index.parse&&(nr(t,o,x)||(w=!1)),w){if(!v&&!g&&!h&&ks(y,a))return x;fe(d,x)&&(d=x)}}if(l.wildcard)for(let x=l.wildcard.length-1;x>=0;x--){let w=l.wildcard[x],{prefix:C,suffix:I}=w;if(!(C&&(P||!(w.caseSensitive?_:L??=_.toLowerCase()).startsWith(C)))){if(I){if(P)continue;let b=o.slice(p).join("/").slice(-I.length);if((w.caseSensitive?b:b.toLowerCase())!==I)continue}u.push({node:w,index:a,skipped:h,depth:m+1,statics:y,dynamics:v,optionals:g,extract:R,rawParams:S})}}if(l.optional){let x=h|1<<m,w=m+1;for(let C=l.optional.length-1;C>=0;C--){let I=l.optional[C];u.push({node:I,index:p,skipped:x,depth:w,statics:y,dynamics:v,optionals:g,extract:R,rawParams:S})}if(!P)for(let C=l.optional.length-1;C>=0;C--){let I=l.optional[C],{prefix:b,suffix:M}=I;if(b||M){let et=I.caseSensitive?_:L??=_.toLowerCase();if(b&&!et.startsWith(b)||M&&!et.endsWith(M))continue}u.push({node:I,index:p+1,skipped:h,depth:w,statics:y,dynamics:v,optionals:g+le(a,p),extract:R,rawParams:S})}}if(!P&&l.dynamic&&_)for(let x=l.dynamic.length-1;x>=0;x--){let w=l.dynamic[x],{prefix:C,suffix:I}=w;if(C||I){let b=w.caseSensitive?_:L??=_.toLowerCase();if(C&&!b.startsWith(C)||I&&!b.endsWith(I))continue}u.push({node:w,index:p+1,skipped:h,depth:m+1,statics:y,dynamics:v+le(a,p),optionals:g,extract:R,rawParams:S})}if(!P&&l.staticInsensitive){let x=l.staticInsensitive.get(L??=_.toLowerCase());x&&u.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+le(a,p),dynamics:v,optionals:g,extract:R,rawParams:S})}if(!P&&l.static){let x=l.static.get(_);x&&u.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+le(a,p),dynamics:v,optionals:g,extract:R,rawParams:S})}if(l.pathless){let x=m+1;for(let w=l.pathless.length-1;w>=0;w--){let C=l.pathless[w];u.push({node:C,index:p,skipped:h,depth:x,statics:y,dynamics:v,optionals:g,extract:R,rawParams:S})}}}if(d)return d;if(s&&c){let f=c.index;for(let p=0;p<c.index;p++)f+=o[p].length;let l=f===t.length?"/":t.slice(f);return c.rawParams??=Object.create(null),c.rawParams["**"]=decodeURIComponent(l),c}return null}i(Es,"getNodeMatch");function le(t,o){return 2**(t-o-1)}i(le,"segmentScore");function ks(t,o){return t===2**(o-1)-1}i(ks,"isPerfectStaticMatch");function nr(t,o,e){let s,r;try{[s,r]=dr(t,o,e)}catch{return null}if(e.rawParams=s,e.extract=r,!e.node.parse)return!0;try{if(e.node.parse(s)===!1)return null}catch{}return!0}i(nr,"validateParseParams");function fe(t,o){return t?o.statics>t.statics||o.statics===t.statics&&(o.dynamics>t.dynamics||o.dynamics===t.dynamics&&(o.optionals>t.optionals||o.optionals===t.optionals&&((o.node.kind===St)>(t.node.kind===St)||o.node.kind===St==(t.node.kind===St)&&o.depth>t.depth))):!0}i(fe,"isFrameMoreSpecific");function Et(t){return Zt(t.filter(o=>o!==void 0).join("/"))}i(Et,"joinPaths");function Zt(t){return t.replace(/\/{2,}/g,"/")}i(Zt,"cleanPath");function he(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(he,"trimPathLeft");function Q(t){let o=t.length;return o>1&&t[o-1]==="/"?t.replace(/\/{1,}$/,""):t}i(Q,"trimPathRight");function Qt(t){return Q(he(t))}i(Qt,"trimPath");function Pt(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}i(Pt,"removeTrailingSlash");function pe(t,o,e){return Pt(t,e)===Pt(o,e)}i(pe,"exactPathTest");function to({base:t,to:o,trailingSlash:e="never",cache:s}){let r=o.startsWith("/"),n=!r&&o===".",a;if(s){a=r?o:n?t:t+"\0"+o;let d=s.get(a);if(d)return d}let u;if(n)u=t.split("/");else if(r)u=o.split("/");else{for(u=t.split("/");u.length>1&&pt(u)==="";)u.pop();let d=o.split("/");for(let f=0,l=d.length;f<l;f++){let p=d[f];p===""?f?f===l-1&&u.push(p):u=[p]:p===".."?u.pop():p==="."||u.push(p)}}u.length>1&&(pt(u)===""?e==="never"&&u.pop():e==="always"&&u.push(""));let c=Zt(u.join("/"))||"/";return a&&s&&s.set(a,c),c}i(to,"resolvePath");function pr(t){let o=new Map(t.map(r=>[encodeURIComponent(r),r])),e=Array.from(o.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(e,"g");return r=>r.replace(s,n=>o.get(n)??n)}i(pr,"compileDecodeCharMap");function Xt(t,o,e){let s=o[t];return typeof s!="string"?s:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(r=>hr(r,e)).join("/"):hr(s,e)}i(Xt,"encodeParam");function me({path:t,params:o,decoder:e,...s}){let r=!1,n=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:n,isMissingParams:r};if(!t.includes("$"))return{interpolatedPath:t,usedParams:n,isMissingParams:r};if(!1){let f=t.length,l=0,p="";for(;l<f;){for(;l<f&&t.charCodeAt(l)===47;)l++;if(l>=f)break;let h=l,m=t.indexOf("/",l);m===-1&&(m=f),l=m;let y=t.substring(h,m);if(y)if(y.charCodeAt(0)===36)if(y.length===1){let v=o._splat;if(n._splat=v,n["*"]=v,!v){r=!0;continue}let g=Xt("_splat",o,e);p+="/"+g}else{let v=y.substring(1);!r&&!(v in o)&&(r=!0),n[v]=o[v];let g=Xt(v,o,e)??"undefined";p+="/"+g}else p+="/"+y}return t.endsWith("/")&&(p+="/"),{usedParams:n,interpolatedPath:p||"/",isMissingParams:r}}let a=t.length,u=0,c,d="";for(;u<a;){let f=u;c=Xe(t,f,c);let l=c[5];if(u=l+1,f===l)continue;let p=c[0];if(p===0){d+="/"+t.substring(f,l);continue}if(p===2){let h=o._splat;n._splat=h,n["*"]=h;let m=t.substring(f,c[1]),y=t.substring(c[4],l);if(!h){r=!0,(m||y)&&(d+="/"+m+y);continue}let v=Xt("_splat",o,e);d+="/"+m+v+y;continue}if(p===1){let h=t.substring(c[2],c[3]);!r&&!(h in o)&&(r=!0),n[h]=o[h];let m=t.substring(f,c[1]),y=t.substring(c[4],l),v=Xt(h,o,e)??"undefined";d+="/"+m+v+y;continue}if(p===3){let h=t.substring(c[2],c[3]),m=o[h];if(m==null)continue;n[h]=m;let y=t.substring(f,c[1]),v=t.substring(c[4],l),g=Xt(h,o,e)??"";d+="/"+y+g+v;continue}}return t.endsWith("/")&&(d+="/"),{usedParams:n,interpolatedPath:d||"/",isMissingParams:r}}i(me,"interpolatePath");function hr(t,o){let e=encodeURIComponent(t);return o?.(e)??e}i(hr,"encodePathParam");function A(t){return t?.isNotFound===!0}i(A,"isNotFound");function Ts(){try{return sessionStorage}catch{return}}i(Ts,"getSafeSessionStorage");var Os="tsr-scroll-restoration-v1_3",vr=Ts();function Ns(){try{return JSON.parse(vr?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(Ns,"createScrollRestorationCache");function Ds(){try{vr?.setItem(Os,JSON.stringify($t))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}i(Ds,"persistScrollRestorationCache");var $t=Ns(),mr="data-scroll-restoration-id",Fs=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function As(t){let o=t.getAttribute(mr);if(o)return`[${mr}="${o}"]`;let e="",s=t,r;for(;r=s.parentNode;){let n=1,a=s;for(;a=a.previousElementSibling;)n++;let u=`${s.localName}:nth-child(${n})`;e=e?`${u} > ${e}`:u,s=r}return e}i(As,"getScrollRestorationSelector");var ge=!1,ve="window";function eo(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(eo,"getElement");function gr(t){let o=new Set;for(let e of t){if(e===ve)continue;let s=eo(e);s&&o.add(s)}return o}i(gr,"getScrollToTopElements");function yr(t,o){let e=o??t.options.scrollRestoration,s=t._scroll;if(e&&(s.restoring=!0),!1)return;let r=t.options.getScrollRestorationKey||Fs,n=new Set,a=i(u=>{let c=$t[u]||={};for(let d of n)d===document?c[ve]={scrollX,scrollY}:d.isConnected&&(c[As(d)]={scrollX:d.scrollLeft,scrollY:d.scrollTop})},"snapshotCurrentScrollTargets");e&&!s.restoration&&(s.restoration=!0,ge=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{ge||n.add(u.target)},!0),t.subscribe("onBeforeLoad",u=>{u.fromLocation&&a(r(u.fromLocation)),n.clear()}),addEventListener("pagehide",()=>{a(r(t.stores.resolvedLocation.get()??t.stores.location.get())),Ds()})),!s.reset&&(s.reset=!0,t.subscribe("onRendered",u=>{let c=t.options.scrollRestorationBehavior,d=t.options.scrollToTopSelectors,f=s.next,l=s.hash,p;if(n.clear(),s.next=!0,s.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let h=r(u.toLocation),m=u.fromLocation&&r(u.fromLocation);if(s.restoring&&m&&m!==h){let y=$t[m];if(y){let v=$t[h];for(let g in y){if(g===ve){if(f)continue}else{let R=eo(g);if(!R||f&&d&&(p??=gr(d),p.has(R)))continue}v||(v=$t[h]={}),v[g]??=y[g]}}}ge=!0;try{let y=u.toLocation.hash,v=u.toLocation.state.__hashScrollIntoViewOptions??!0,g=!1;if(f){!y&&d&&(p??=gr(d));let R=y&&v&&l,S=s.restoring?$t[h]:void 0;if(S)for(let P in S){let{scrollX:_,scrollY:L}=S[P];if(P===ve){if(R)continue;scrollTo({top:L,left:_,behavior:c}),g=!0}else{let x=eo(P);x&&(x.scrollLeft=_,x.scrollTop=L,p?.delete(x))}}if(!y){let P={top:0,left:0,behavior:c};if(g||scrollTo(P),p)for(let _ of p)_.scrollTo(P)}}!g&&y&&v&&document.getElementById(y)?.scrollIntoView(v)}finally{ge=!1}}))}i(yr,"setupScrollRestoration");function Rr(t,o=String){let e=new URLSearchParams;for(let s in t){let r=t[s];r!==void 0&&e.set(s,o(r))}return e.toString()}i(Rr,"encode");function oo(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(oo,"toValue");function Sr(t){let o=new URLSearchParams(t),e=Object.create(null);for(let[s,r]of o.entries()){let n=e[s];n==null?e[s]=oo(r):Array.isArray(n)?n.push(oo(r)):e[s]=[n,oo(r)]}return e}i(Sr,"decode");var Pr=Bs(JSON.parse),xr=$s(JSON.stringify,JSON.parse);function Bs(t){return o=>{o[0]==="?"&&(o=o.substring(1));let e=Sr(o);for(let s in e){let r=e[s];if(typeof r=="string")try{e[s]=t(r)}catch{}}return e}}i(Bs,"parseSearchWith");function $s(t,o){let e=typeof o=="function";function s(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(e&&typeof r=="string")try{return o(r),t(r)}catch{}return r}return i(s,"stringifyValue"),r=>{let n=Rr(r,s);return n?`?${n}`:""}}i($s,"stringifySearchWith");var X="__root__";function Ut(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);let e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}i(Ut,"redirect");function H(t){return t instanceof Response&&!!t.options}i(H,"isRedirect");function wr(t){return{input:i(({url:o})=>{for(let e of t)o=ye(e,o);return o},"input"),output:i(({url:o})=>{for(let e=t.length-1;e>=0;e--)o=ro(t[e],o);return o},"output")}}i(wr,"composeRewrites");function _r(t){let o=Qt(t.basepath),e=`/${o}`,s=t.caseSensitive?e:e.toLowerCase(),r=`${s}/`;return{input:i(({url:n})=>{let a=t.caseSensitive?n.pathname:n.pathname.toLowerCase();return a===s?n.pathname="/":a.startsWith(r)&&(n.pathname=n.pathname.slice(e.length)),n},"input"),output:i(({url:n})=>(n.pathname=Et(["/",o,n.pathname]),n),"output")}}i(_r,"rewriteBasepath");function ye(t,o){let e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(ye,"executeRewriteInput");function ro(t,o){let e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(ro,"executeRewriteOutput");function io(t){let o=t;return{get(){return o},set(e){o=Y(e,o)}}}i(io,"createNonReactiveMutableStore");function ao(t){return{get(){return t()}}}i(ao,"createNonReactiveReadonlyStore");function Cr(t,o){let{createMutableStore:e,createReadonlyStore:s,batch:r,init:n}=o,a=new Map,u=new Map,c=new Map,d=e(t.status),f=e(t.loadedAt),l=e(t.isLoading),p=e(t.isTransitioning),h=e(t.location),m=e(t.resolvedLocation),y=e(t.statusCode),v=e(t.redirect),g=e([]),R=e([]),S=e([]),P=s(()=>so(a,g.get())),_=s(()=>so(u,R.get())),L=s(()=>so(c,S.get())),x=s(()=>g.get()[0]),w=s(()=>g.get().some(ot=>a.get(ot)?.get().status==="pending")),C=s(()=>({locationHref:h.get().href,resolvedLocationHref:m.get()?.href,status:d.get()})),I=s(()=>({status:d.get(),loadedAt:f.get(),isLoading:l.get(),isTransitioning:p.get(),matches:P.get(),location:h.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:v.get()})),b=yt(64);function M(ot){let Kt=b.get(ot);return Kt||(Kt=s(()=>{let Ao=g.get();for(let Bo of Ao){let ie=a.get(Bo);if(ie&&ie.routeId===ot)return ie.get()}}),b.set(ot,Kt)),Kt}i(M,"getRouteMatchStore");let et={status:d,loadedAt:f,isLoading:l,isTransitioning:p,location:h,resolvedLocation:m,statusCode:y,redirect:v,matchesId:g,pendingIds:R,cachedIds:S,matches:P,pendingMatches:_,cachedMatches:L,firstId:x,hasPending:w,matchRouteDeps:C,matchStores:a,pendingMatchStores:u,cachedMatchStores:c,__store:I,getRouteMatchStore:M,setMatches:V,setPending:dt,setCached:ne};V(t.matches),n?.(et);function V(ot){no(ot,a,g,e,r)}i(V,"setMatches");function dt(ot){no(ot,u,R,e,r)}i(dt,"setPending");function ne(ot){no(ot,c,S,e,r)}return i(ne,"setCached"),et}i(Cr,"createRouterStores");function so(t,o){let e=[];for(let s of o){let r=t.get(s);r&&e.push(r.get())}return e}i(so,"readPoolMatches");function no(t,o,e,s,r){let n=t.map(u=>u.id),a=new Set(n);r(()=>{for(let u of o.keys())a.has(u)||o.delete(u);for(let u of t){let c=o.get(u.id);if(!c){let d=s(u);d.routeId=u.routeId,o.set(u.id,d);continue}c.routeId=u.routeId,c.get()!==u&&c.set(u)}sr(e.get(),n)||e.set(n)})}i(no,"reconcileMatchPool");var co=i(t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},"triggerOnReady"),Us=i(t=>t.stores.matchesId.get().some(o=>t.stores.matchStores.get(o)?.get()._forcePending),"hasForcePendingActiveMatch"),Pe=i((t,o)=>!!(t.preload&&!t.router.stores.matchStores.has(o)),"resolvePreload"),kt=i((t,o,e=!0)=>{let s={...t.router.options.context??{}},r=e?o:o-1;for(let n=0;n<=r;n++){let a=t.matches[n];if(!a)continue;let u=t.router.getMatch(a.id);u&&Object.assign(s,u.__routeContext,u.__beforeLoadContext)}return s},"buildMatchContext"),br=i((t,o)=>{if(!t.matches.length)return;let e=o.routeId,s=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),r=s>=0?s:0,n=e?t.matches.findIndex(a=>a.routeId===e):t.firstBadMatchIndex??t.matches.length-1;n<0&&(n=r);for(let a=n;a>=0;a--){let u=t.matches[a];if(t.router.looseRoutesById[u.routeId].options.notFoundComponent)return a}return e?n:r},"getNotFoundBoundaryIndex"),xt=i((t,o,e)=>{if(!(!H(e)&&!A(e)))throw H(e)&&e.redirectHandled&&!e.options.reloadDocument||(o&&(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0,o._nonReactive.error=e,t.updateMatch(o.id,s=>({...s,status:H(e)?"redirected":A(e)?"notFound":s.status==="pending"?"success":s.status,context:kt(t,o.index),isFetching:!1,error:e})),A(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()),H(e)&&(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e))),e},"handleRedirectAndNotFound"),Er=i((t,o)=>{let e=t.router.getMatch(o);return!!(!e||!!1&&e._nonReactive.dehydrated||!1)},"shouldSkipLoader"),Lr=i((t,o,e)=>{let s=kt(t,e);t.updateMatch(o,r=>({...r,context:s}))},"syncMatchContext"),te=i((t,o,e)=>{let{id:s,routeId:r}=t.matches[o],n=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;t.firstBadMatchIndex??=o,xt(t,t.router.getMatch(s),e);try{n.options.onError?.(e)}catch(a){e=a,xt(t,t.router.getMatch(s),e)}t.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!H(e)&&!A(e)&&(t.serialError??=e)},"handleSerialError"),Hs=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=t.matches[e-1]?.id,a=n?t.router.getMatch(n):void 0;if(t.router.isShell()){r.ssr=s.id===X;return}if(a?.ssr===!1){r.ssr=!1;return}let u=i(h=>h===!0&&a?.ssr==="data-only"?"data-only":h,"parentOverride"),c=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){r.ssr=u(c);return}if(typeof s.options.ssr!="function"){r.ssr=u(s.options.ssr);return}let{search:d,params:f}=r,l={search:Re(d,r.searchError),params:Re(f,r.paramsError),location:t.location,matches:t.matches.map(h=>({index:h.index,pathname:h.pathname,fullPath:h.fullPath,staticData:h.staticData,id:h.id,routeId:h.routeId,search:Re(h.search,h.searchError),params:Re(h.params,h.paramsError),ssr:h.ssr}))},p=s.options.ssr(l);if(vt(p))return p.then(h=>{r.ssr=u(h??c)});r.ssr=u(p??c)},"isBeforeLoadSsr"),kr=i((t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;let r=e.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!!1&&!Pe(t,o)&&(e.options.loader||e.options.beforeLoad||lo(e))&&typeof r=="number"&&r!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent)){let n=setTimeout(()=>{co(t)},r);s._nonReactive.pendingTimeout=n}},"setupPendingTimeout"),Vs=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;kr(t,o,e,s);let r=i(()=>{let n=t.router.getMatch(o);n.preload&&(n.status==="redirected"||n.status==="notFound")&&xt(t,n,n.error)},"then");return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()},"preBeforeLoadSetup"),Ws=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=r._nonReactive.loadPromise;r._nonReactive.loadPromise=ct(()=>{n?.resolve(),n=void 0});let{paramsError:a,searchError:u}=r;a&&te(t,e,a),u&&te(t,e,u),kr(t,o,s,r);let c=new AbortController,d=!1,f=i(()=>{d||(d=!0,t.updateMatch(o,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:c})))},"pending"),l=i(()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,P=>({...P,isFetching:!1}))},"resolve");if(!s.options.beforeLoad){t.router.batch(()=>{f(),l()});return}r._nonReactive.beforeLoadPromise=ct();let p={...kt(t,e,!1),...r.__routeContext},{search:h,params:m,cause:y}=r,v=Pe(t,o),g={search:h,abortController:c,params:m,preload:v,context:p,location:t.location,navigate:i(P=>t.router.navigate({...P,_fromLocation:t.location}),"navigate"),buildLocation:t.router.buildLocation,cause:v?"preload":y,matches:t.matches,routeId:s.id,...t.router.options.additionalContext},R=i(P=>{if(P===void 0){t.router.batch(()=>{f(),l()});return}(H(P)||A(P))&&(f(),te(t,e,P)),t.router.batch(()=>{f(),t.updateMatch(o,_=>({..._,__beforeLoadContext:P})),l()})},"updateContext"),S;try{if(S=s.options.beforeLoad(g),vt(S))return f(),S.catch(P=>{te(t,e,P)}).then(R)}catch(P){f(),te(t,e,P)}R(S)},"executeBeforeLoad"),js=i((t,o)=>{let{id:e,routeId:s}=t.matches[o],r=t.router.looseRoutesById[s],n=i(()=>{if(!1){let c=Hs(t,e,o,r);if(vt(c))return c.then(u)}return u()},"serverSsr"),a=i(()=>Ws(t,e,o,r),"execute"),u=i(()=>{if(Er(t,e))return;let c=Vs(t,e,r);return vt(c)?c.then(a):a()},"queueExecution");return n()},"handleBeforeLoad"),zs=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;let r={ssr:t.router.options.ssr,matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(r),e.options.scripts?.(r),e.options.headers?.(r)]).then(([n,a,u])=>({meta:n?.meta,links:n?.links,headScripts:n?.scripts,headers:u,scripts:a,styles:n?.styles}))},"executeHead"),Tr=i((t,o,e,s,r)=>{let n=o[s-1],{params:a,loaderDeps:u,abortController:c,cause:d}=t.router.getMatch(e),f=kt(t,s),l=Pe(t,e);return{params:a,deps:u,preload:!!l,parentMatchPromise:n,abortController:c,context:f,location:t.location,navigate:i(p=>t.router.navigate({...p,_fromLocation:t.location}),"navigate"),cause:l?"preload":d,route:r,...t.router.options.additionalContext}},"getLoaderContext"),Mr=i(async(t,o,e,s,r)=>{try{let n=t.router.getMatch(e);try{(!!1||n.ssr===!0)&&Ht(r);let a=r.options.loader,u=typeof a=="function"?a:a?.handler,c=u?.(Tr(t,o,e,s,r)),d=!!u&&vt(c);if((d||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(e,l=>({...l,isFetching:"loader"})),u){let l=d?await c:c;xt(t,t.router.getMatch(e),l),l!==void 0&&t.updateMatch(e,p=>({...p,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;let f=n._nonReactive.minPendingPromise;f&&await f,r._componentsPromise&&await r._componentsPromise,t.updateMatch(e,l=>({...l,error:void 0,context:kt(t,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let u=a;if(u?.name==="AbortError"){if(n.abortController.signal.aborted){n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:kt(t,s)}));return}let c=n._nonReactive.minPendingPromise;c&&await c,A(a)&&await r.options.notFoundComponent?.preload?.(),xt(t,t.router.getMatch(e),a);try{r.options.onError?.(a)}catch(d){u=d,xt(t,t.router.getMatch(e),d)}!H(u)&&!A(u)&&await Ht(r,["errorComponent"]),t.updateMatch(e,d=>({...d,error:u,context:kt(t,s),status:"error",isFetching:!1}))}}catch(n){let a=t.router.getMatch(e);a&&(a._nonReactive.loaderPromise=void 0),xt(t,a,n)}},"runLoader"),Ks=i(async(t,o,e)=>{async function s(h,m,y,v,g){let R=Date.now()-m.updatedAt,S=h?g.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:g.options.staleTime??t.router.options.defaultStaleTime??0,P=g.options.shouldReload,_=typeof P=="function"?P(Tr(t,o,r,e,g)):P,{status:L,invalid:x}=v,w=R>=S&&(!!t.forceStaleReload||v.cause==="enter"||y!==void 0&&y!==v.id);a=L==="success"&&(x||(_??w)),h&&g.options.preload===!1||(a&&!t.sync&&f?(u=!0,(async()=>{try{await Mr(t,o,r,e,g);let C=t.router.getMatch(r);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0,C._nonReactive.loadPromise=void 0}catch(C){H(C)&&await t.router.navigate(C.options)}})()):L!=="success"||a?await Mr(t,o,r,e,g):Lr(t,r,e))}i(s,"handleLoader");let{id:r,routeId:n}=t.matches[e],a=!1,u=!1,c=t.router.looseRoutesById[n],d=c.options.loader,f=((typeof d=="function"?void 0:d?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Er(t,r)){if(!t.router.getMatch(r))return t.matches[e];if(Lr(t,r,e),!1)return t.router.getMatch(r)}else{let h=t.router.getMatch(r),m=t.router.stores.matchesId.get()[e],y=(m&&t.router.stores.matchStores.get(m)||null)?.routeId===n?m:t.router.stores.matches.get().find(g=>g.routeId===n)?.id,v=Pe(t,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!t.sync&&!h.preload&&f)return h;await h._nonReactive.loaderPromise;let g=t.router.getMatch(r),R=g._nonReactive.error||g.error;R&&xt(t,g,R),g.status==="pending"&&await s(v,h,y,g,c)}else{let g=v&&!t.router.stores.matchStores.has(r),R=t.router.getMatch(r);R._nonReactive.loaderPromise=ct(),g!==R.preload&&t.updateMatch(r,S=>({...S,preload:g})),await s(v,h,y,R,c)}}let l=t.router.getMatch(r);u||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve(),l._nonReactive.loadPromise=void 0),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,u||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;let p=u?l.isFetching:!1;return p!==l.isFetching||l.invalid!==!1?(t.updateMatch(r,h=>({...h,isFetching:p,invalid:!1})),t.router.getMatch(r)):l},"loadRouteMatch");async function uo(t){let o=t,e=[];!!1&&Us(o.router)&&co(o);let s;for(let p=0;p<o.matches.length;p++){try{let h=js(o,p);vt(h)&&await h}catch(h){if(H(h))throw h;if(A(h))s=h;else if(!o.preload)throw h;break}if(o.serialError||o.firstBadMatchIndex!=null)break}let r=o.firstBadMatchIndex??o.matches.length,n=s&&!o.preload?br(o,s):void 0,a=s&&o.preload?0:n!==void 0?Math.min(n+1,r):r,u,c;for(let p=0;p<a;p++)e.push(Ks(o,e,p));try{await Promise.all(e)}catch{let p=await Promise.allSettled(e);for(let h of p){if(h.status!=="rejected")continue;let m=h.reason;if(H(m))throw m;A(m)?u??=m:c??=m}if(c!==void 0)throw c}let d=u??(s&&!o.preload?s:void 0),f=o.firstBadMatchIndex!==void 0?o.firstBadMatchIndex:o.matches.length-1;if(!d&&s&&o.preload)return o.matches;if(d){let p=br(o,d);if(p===void 0)throw new Error("Invariant failed: Could not find match for notFound boundary");let h=o.matches[p],m=o.router.looseRoutesById[h.routeId],y=o.router.options?.defaultNotFoundComponent;!m.options.notFoundComponent&&y&&(m.options.notFoundComponent=y),d.routeId=h.routeId;let v=h.routeId===o.router.routeTree.id;o.updateMatch(h.id,g=>({...g,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),f=p,await Ht(m,["notFoundComponent"])}else if(!o.preload){let p=o.matches[0];p.globalNotFound||o.router.getMatch(p.id)?.globalNotFound&&o.updateMatch(p.id,h=>({...h,globalNotFound:!1,error:void 0}))}if(o.serialError&&o.firstBadMatchIndex!==void 0){let p=o.router.looseRoutesById[o.matches[o.firstBadMatchIndex].routeId];await Ht(p,["errorComponent"])}for(let p=0;p<=f;p++){let{id:h,routeId:m}=o.matches[p],y=o.router.looseRoutesById[m];try{let v=zs(o,h,y);if(v){let g=await v;o.updateMatch(h,R=>({...R,...g}))}}catch(v){console.error(`Error executing head for route ${m}:`,v)}}let l=co(o);if(vt(l)&&await l,d)throw d;if(o.serialError&&!o.preload&&!o.onReady)throw o.serialError;return o.matches}i(uo,"loadMatches");function Ir(t,o){let e=o.map(s=>t.options[s]?.preload?.()).filter(Boolean);if(e.length!==0)return Promise.all(e)}i(Ir,"preloadRouteComponents");function Ht(t,o=Se){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(s=>{let{id:r,...n}=s.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);let e=i(()=>t._componentsLoaded?void 0:o===Se?(()=>{if(t._componentsPromise===void 0){let s=Ir(t,Se);s?t._componentsPromise=s.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():Ir(t,o),"runAfterLazy");return t._lazyPromise?t._lazyPromise.then(e):e()}i(Ht,"loadRouteChunk");function Re(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}i(Re,"makeMaybe");function lo(t){for(let o of Se)if(t.options[o]?.preload)return!0;return!1}i(lo,"routeNeedsPreload");var Se=["component","errorComponent","pendingComponent","notFoundComponent"];var wt="__TSR_index",Or="popstate",Nr="beforeunload";function ho(t){let o=t.getLocation(),e=new Set,s=i(a=>{o=t.getLocation(),e.forEach(u=>u({location:o,action:a}))},"notify"),r=i(a=>{t.notifyOnIndexChange??!0?s(a):o=t.getLocation()},"handleIndexChange"),n=i(async({task:a,navigateOpts:u,...c})=>{if(u?.ignoreBlocker??!1){a();return}let d=t.getBlockers?.()??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(let l of d){let p=Vt(c.path,c.state);if(await l.blockerFn({currentLocation:o,nextLocation:p,action:c.type})){t.onBlocked?.();return}}a()},"tryNavigation");return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i(a=>(e.add(a),()=>{e.delete(a)}),"subscribe"),push:i((a,u,c)=>{let d=o.state[wt];u=fo(d+1,u),n({task:i(()=>{t.pushState(a,u),s({type:"PUSH"})},"task"),navigateOpts:c,type:"PUSH",path:a,state:u})},"push"),replace:i((a,u,c)=>{let d=o.state[wt];u=fo(d,u),n({task:i(()=>{t.replaceState(a,u),s({type:"REPLACE"})},"task"),navigateOpts:c,type:"REPLACE",path:a,state:u})},"replace"),go:i((a,u)=>{n({task:i(()=>{t.go(a),r({type:"GO",index:a})},"task"),navigateOpts:u,type:"GO"})},"go"),back:i(a=>{n({task:i(()=>{t.back(a?.ignoreBlocker??!1),r({type:"BACK"})},"task"),navigateOpts:a,type:"BACK"})},"back"),forward:i(a=>{n({task:i(()=>{t.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},"task"),navigateOpts:a,type:"FORWARD"})},"forward"),canGoBack:i(()=>o.state[wt]!==0,"canGoBack"),createHref:i(a=>t.createHref(a),"createHref"),block:i(a=>{if(!t.setBlockers)return()=>{};let u=t.getBlockers?.()??[];return t.setBlockers([...u,a]),()=>{let c=t.getBlockers?.()??[];t.setBlockers?.(c.filter(d=>d!==a))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:s}}i(ho,"createHistory");function fo(t,o){o||(o={});let e=mo();return{...o,key:e,__TSR_key:e,[wt]:t}}i(fo,"assignKeyAndIndex");function po(t){let o=t?.window??(typeof document<"u"?window:void 0),e=o.history.pushState,s=o.history.replaceState,r=[],n=i(()=>r,"_getBlockers"),a=i(w=>r=w,"_setBlockers"),u=t?.createHref??(w=>w),c=t?.parseLocation??(()=>Vt(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){let w=mo();o.history.replaceState({[wt]:0,key:w,__TSR_key:w},"")}let d=c(),f,l=!1,p=!1,h=!1,m=!1,y=i(()=>d,"getLocation"),v,g,R=i(()=>{v&&(x._ignoreSubscribers=!0,(v.isPush?o.history.pushState:o.history.replaceState)(v.state,"",v.href),x._ignoreSubscribers=!1,v=void 0,g=void 0,f=void 0)},"flush"),S=i((w,C,I)=>{let b=u(C);g||(f=d),d=Vt(C,I),v={href:b,state:I,isPush:v?.isPush||w==="push"},g||(g=Promise.resolve().then(()=>R()))},"queueHistoryAction"),P=i(w=>{d=c(),x.notify({type:w})},"onPushPop"),_=i(async()=>{if(p){p=!1;return}let w=c(),C=w.state[wt]-d.state[wt],I=C===1,b=C===-1,M=!I&&!b||l;l=!1;let et=M?"GO":b?"BACK":"FORWARD",V=M?{type:"GO",index:C}:{type:b?"BACK":"FORWARD"};if(h)h=!1;else{let dt=n();if(typeof document<"u"&&dt.length){for(let ne of dt)if(await ne.blockerFn({currentLocation:d,nextLocation:w,action:et})){p=!0,o.history.go(1),x.notify(V);return}}}d=c(),x.notify(V)},"onPushPopEvent"),L=i(w=>{if(m){m=!1;return}let C=!1,I=n();if(typeof document<"u"&&I.length)for(let b of I){let M=b.enableBeforeUnload??!0;if(M===!0){C=!0;break}if(typeof M=="function"&&M()===!0){C=!0;break}}if(C)return w.preventDefault(),w.returnValue=""},"onBeforeUnload"),x=ho({getLocation:y,getLength:i(()=>o.history.length,"getLength"),pushState:i((w,C)=>S("push",w,C),"pushState"),replaceState:i((w,C)=>S("replace",w,C),"replaceState"),back:i(w=>(w&&(h=!0),m=!0,o.history.back()),"back"),forward:i(w=>{w&&(h=!0),m=!0,o.history.forward()},"forward"),go:i(w=>{l=!0,o.history.go(w)},"go"),createHref:i(w=>u(w),"createHref"),flush:R,destroy:i(()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(Nr,L,{capture:!0}),o.removeEventListener(Or,_)},"destroy"),onBlocked:i(()=>{f&&d!==f&&(d=f)},"onBlocked"),getBlockers:n,setBlockers:a,notifyOnIndexChange:!1});return o.addEventListener(Nr,L,{capture:!0}),o.addEventListener(Or,_),o.history.pushState=function(...w){let C=e.apply(o.history,w);return x._ignoreSubscribers||P("PUSH"),C},o.history.replaceState=function(...w){let C=s.apply(o.history,w);return x._ignoreSubscribers||P("REPLACE"),C},x}i(po,"createBrowserHistory");function qs(t={initialEntries:["/"]}){let o=t.initialEntries,e=t.initialIndex?Math.min(Math.max(t.initialIndex,0),o.length-1):o.length-1,s=o.map((c,d)=>fo(d,void 0)),r=i(()=>Vt(o[e],s[e]),"getLocation"),n=[];return ho({getLocation:r,getLength:i(()=>o.length,"getLength"),pushState:i((c,d)=>{e<o.length-1&&(o.splice(e+1),s.splice(e+1)),s.push(d),o.push(c),e=Math.max(o.length-1,0)},"pushState"),replaceState:i((c,d)=>{s[e]=d,o[e]=c},"replaceState"),back:i(()=>{e=Math.max(e-1,0)},"back"),forward:i(()=>{e=Math.min(e+1,o.length-1)},"forward"),go:i(c=>{e=Math.min(Math.max(e+c,0),o.length-1)},"go"),createHref:i(c=>c,"createHref"),getBlockers:i(()=>n,"_getBlockers"),setBlockers:i(c=>n=c,"_setBlockers")})}i(qs,"createMemoryHistory");function Gs(t){let o=t.replace(/[\x00-\x1f\x7f]/g,"");return o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}i(Gs,"sanitizePath");function Vt(t,o){let e=Gs(t),s=e.indexOf("#"),r=e.indexOf("?"),n=mo();return{href:e,pathname:e.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:e.length),hash:s>-1?e.substring(s):"",search:r>-1?e.slice(r,s===-1?void 0:s):"",state:o||{[wt]:0,key:n,__TSR_key:n}}}i(Vt,"parseHref");function mo(){return(Math.random()+1).toString(36).substring(7)}i(mo,"createRandomKey");function ht(t,o){let e=o,s=t;return{fromLocation:e,toLocation:s,pathChanged:e?.pathname!==s.pathname,hrefChanged:e?.href!==s.href,hashChanged:e?.hash!==s.hash}}i(ht,"getLocationChangeInfo");var go=class{static{i(this,"RouterCore")}constructor(t,o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");let s=this.options,r=this.basepath??s?.basepath??"/",n=this.basepath===void 0,a=s?.rewrite;if(this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=pr(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=po()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;!1,this.resolvePathCache=yt(1e3),f=this.buildRouteTree(),!1,this.setRoutes(f)}if(!this.stores&&this.latestLocation){let f=this.getStoreConfig(this);this.batch=f.batch,this.stores=Cr($r(this.latestLocation),f),yr(this)}let u=!1,c=this.options.basepath??"/",d=this.options.rewrite;if(n||r!==c||a!==d){this.basepath=c;let f=[],l=Qt(c);l&&l!=="/"&&f.push(_r({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:wr(f),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=fr(this.routeTree,this.options.caseSensitive,(s,r)=>{s.init({originalIndex:r})});return this.options.routeMasks&&ar(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,s)=>{let r={eventType:e,fn:s};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{let r=i(({pathname:c,search:d,hash:f,href:l,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){let g=this.options.parseSearch(d),R=this.options.stringifySearch(g);return{href:c+R+f,publicHref:c+R+f,pathname:Bt(c).path,external:!1,searchStr:R,search:gt(s?.search,g),hash:Bt(f.slice(1)).path,state:at(s?.state,p)}}let h=new URL(l,this.origin),m=ye(this.rewrite,h),y=this.options.parseSearch(m.search),v=this.options.stringifySearch(y);return m.search=v,{href:m.href.replace(m.origin,""),publicHref:l,pathname:Bt(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:v,search:gt(s?.search,y),hash:Bt(m.hash.slice(1)).path,state:at(s?.state,p)}},"parse"),n=r(e),{__tempLocation:a,__tempKey:u}=n.state;if(a&&(!u||u===this.tempLocationKey)){let c=r(a);return c.state.key=n.state.key,c.state.__TSR_key=n.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:n}}return n},this.resolvePathWithBase=(e,s)=>to({base:e,to:s.includes("//")?Zt(s):s,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,s,r)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},r):this.matchRoutesInternal(e,s),this.getMatchedRoutes=e=>Ur({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let s=this.stores.matchStores.get(e)?.get();s&&(s.status==="pending"||s.isFetching==="loader")&&this.cancelMatch(e)})},this.buildLocation=e=>{let s=i((n={})=>{let a=n._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(a);if(n.from&&n._isNavigate){let b=this.getMatchedRoutes(n.from).matchedRoutes,M=qe(u.matchedRoutes,V=>Fr(V.fullPath,n.from)),et=qe(b,V=>Fr(V.fullPath,u.fullPath));!M&&!et&&console.warn(`Could not find match for from: ${n.from}`)}let c=n.unsafeRelative==="path"?a.pathname:n.from??u.fullPath,d=n.to?`${n.to}`:void 0,f=u.search,l=Object.assign(Object.create(null),u.params),p=d?.charCodeAt(0)===47?"/":this.resolvePathWithBase(c,"."),h=d?this.resolvePathWithBase(p,d):p,m=n.params===!1||n.params===null?Object.create(null):(n.params??!0)===!0?l:Object.assign(l,Y(n.params,l)),y=this.routesByPath[Q(h)],v;if(y)v=this.getRouteBranch(y);else if(h.includes("$"))v=[];else{let b=this.getMatchedRoutes(h);v=b.matchedRoutes,this.options.notFoundRoute&&(!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&(v=[...v,this.options.notFoundRoute])}if(v.length&&mt(m))for(let b of v){let M=b.options.params?.stringify??b.options.stringifyParams;if(M)try{Object.assign(m,M(m))}catch{}}let g=e.leaveParams?h:Bt(me({path:h,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;if(y&&!e.leaveParams)try{let b=this.getMatchedRoutes(g);b.foundRoute?.id!==y.id&&console.warn(`Generated path "${g}" for route "${y.id}" matched route "${b.foundRoute?.id}" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`)}catch{}let R=f;if(e._includeValidateSearch&&this.options.search?.strict){let b={};v.forEach(M=>{if(M.options.validateSearch)try{Object.assign(b,xe(M.options.validateSearch,{...b,...R}))}catch{}}),R=b}R=Js({search:R,dest:n,destRoutes:v,_includeValidateSearch:e._includeValidateSearch}),R=gt(f,R);let S=this.options.stringifySearch(R),P=n.hash===!0?a.hash:n.hash?Y(n.hash,a.hash):void 0,_=P?`#${P}`:"",L=n.state===!0?a.state:n.state?Y(n.state,a.state):{};L=at(a.state,L);let x=`${g}${S}${_}`,w,C,I=!1;if(this.rewrite){let b=new URL(x,this.origin),M=ro(this.rewrite,b);w=b.href.replace(b.origin,""),M.origin!==this.origin?(C=M.href,I=!0):C=M.pathname+M.search+M.hash}else w=rr(x),C=w;return{publicHref:C,href:w,pathname:g,search:R,searchStr:S,state:L,hash:P??"",external:I,unmaskOnReload:n.unmaskOnReload}},"build"),r=i((n={},a)=>{let u=s(n),c=a?s(a):void 0;if(!c){let d=Object.create(null);if(this.options.routeMasks){let f=cr(u.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);let{from:l,params:p,...h}=f.route,m=p===!1||p===null?Object.create(null):(p??!0)===!0?d:Object.assign(d,Y(p,d));a={from:e.from,...h,params:m},c=s(a)}}}return c&&(u.maskedLocation=c),u},"buildWithMatches");return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:s,...r})=>{let n,a=i(()=>{let d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(l=>{r.state[l]=this.latestLocation.state[l]});let f=st(r.state,this.latestLocation.state);return d.forEach(l=>{delete r.state[l]}),f},"isSameState"),u=Q(this.latestLocation.href)===Q(r.href),c=this.commitLocationPromise;if(this.commitLocationPromise=ct(()=>{c?.resolve(),c=void 0}),u&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...l}=r;d&&(l={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...l,search:l.searchStr,state:{...l.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(l.unmaskOnReload??this.options.unmaskOnReload??!1)&&(l.state.__tempKey=this.tempLocationKey)),l.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,n=r.replace?"REPLACE":"PUSH",this.history[n==="REPLACE"?"replace":"push"](l.publicHref,l.state,{ignoreBlocker:s})}return this._scroll.next=r.resetScroll??!0,this.history.subscribers.size||this.load(n?{action:{type:n}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:r,viewTransition:n,ignoreBlocker:a,href:u,...c}={})=>{if(u){let l=this.history.location.state.__TSR_index,p=Vt(u,{__TSR_index:e?l:l+1}),h=new URL(p.pathname,this.origin);c.to=ye(this.rewrite,h).pathname,c.search=this.options.parseSearch(p.search),c.hash=p.hash.slice(1)}let d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;let f=this.commitLocation({...d,viewTransition:n,replace:e,resetScroll:s,hashScrollIntoView:r,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:e,reloadDocument:s,href:r,publicHref:n,...a})=>{let u=!1;if(r)try{new URL(`${r}`),u=!0}catch{}if(u&&!s&&(s=!0),s){if(e!==void 0||!r){let d=this.buildLocation({to:e,...a});r=r??d.publicHref,n=n??d.publicHref}let c=!u&&n?n:r;if(ut(c,this.protocolAllowlist)){console.warn(`Blocked navigation to dangerous protocol: ${c}`);return}if(!a.ignoreBlocker){let d=this.history.getBlockers?.()??[];for(let f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(c):window.location.href=c;return}return this.buildAndCommitLocation({...a,href:r,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),!1){let r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==r.publicHref){let n=this.getParsedLocationHref(r);throw r.external?Ut({href:n}):Ut({href:n,_builtLocation:r})}}let e=this.matchRoutes(this.latestLocation),s=this.stores.cachedMatches.get().filter(r=>!e.some(n=>n.id===r.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(s)})},this.load=async e=>{let s=e?.action?.type,r,n,a,u=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad(),s&&(this._scroll.hash=s==="PUSH"||s==="REPLACE");let f=this.latestLocation,l=ht(f,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...l}),this.emit({type:"onBeforeLoad",...l}),await uo({router:this,sync:e?.sync,forceStaleReload:u.href===f.href,matches:this.stores.pendingMatches.get(),location:f,updateMatch:this.updateMatch,onReady:i(async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=null,h=null,m=null,y=null;this.batch(()=>{let v=this.stores.pendingMatches.get(),g=v.length,R=this.stores.matches.get();p=g?R.filter(_=>!this.stores.pendingMatchStores.has(_.id)):null;let S=new Set;for(let _ of this.stores.pendingMatchStores.values())_.routeId&&S.add(_.routeId);let P=new Set;for(let _ of this.stores.matchStores.values())_.routeId&&P.add(_.routeId);h=g?R.filter(_=>!S.has(_.routeId)):null,m=g?v.filter(_=>!P.has(_.routeId)):null,y=g?v.filter(_=>P.has(_.routeId)):R,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),g&&(this.stores.setMatches(v),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(_=>_.status!=="error"&&_.status!=="notFound"&&_.status!=="redirected")]),this.clearExpiredCache())});for(let[v,g]of[[h,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(v)for(let R of v)this.looseRoutesById[R.routeId].options[g]?.(R)})})},"onReady")})}catch(f){H(f)?(r=f,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):A(f)&&(n=f);let l=r?r.status:n?404:this.stores.matches.get().some(p=>p.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(l),this.stores.redirect.set(r)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(d=>d.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=e=>{let s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof s=="object"&&this.isViewTransitionTypesSupported){let n=this.latestLocation,a=this.stores.resolvedLocation.get(),u=typeof s.types=="function"?s.types(ht(n,a)):s.types;if(u===!1){e();return}r={update:e,types:u}}else r=e;document.startViewTransition(r)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{let r=this.stores.pendingMatchStores.get(e);if(r){r.set(s);return}let n=this.stores.matchStores.get(e);if(n){n.set(s);return}let a=this.stores.cachedMatchStores.get(e);if(a){let u=s(a.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(c=>c.filter(d=>d!==e)):a.set(u)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let s=i(r=>e?.filter?.(r)??!0?{...r,invalid:!0,...e?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r,"invalidate");return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(s)),this.stores.setCached(this.stores.cachedMatches.get().map(s)),this.stores.setPending(this.stores.pendingMatches.get().map(s))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||"/",this.resolveRedirect=e=>{let s=e.headers.get("Location");if(!e.options.href||e.options._builtLocation){let r=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(r);e.options.href=n,e.headers.set("Location",n)}else if(s)try{let r=new URL(s);if(this.origin&&r.origin===this.origin){let n=r.pathname+r.search+r.hash;e.options.href=n,e.headers.set("Location",n)}}catch{}if(e.options.href&&!e.options._builtLocation&&ut(e.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${e.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{let s=e?.filter;s!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(r=>!s(r))):this.stores.setCached([])},this.clearExpiredCache=()=>{let e=Date.now(),s=i(r=>{let n=this.looseRoutesById[r.routeId];if(!n.options.loader)return!0;let a=(r.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:e-r.updatedAt>=a},"filter");this.clearCache({filter:s})},this.loadRouteChunk=Ht,this.preloadRoute=async e=>{let s=e._builtLocation??this.buildLocation(e),r=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e}),n=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...n,...this.stores.cachedIds.get()]),u=r.filter(c=>!a.has(c.id));if(u.length){let c=this.stores.cachedMatches.get();this.stores.setCached([...c,...u])}try{return r=await uo({router:this,matches:r,location:s,preload:!0,updateMatch:i((c,d)=>{n.has(c)?r=r.map(f=>f.id===c?d(f):f):this.updateMatch(c,d)},"updateMatch")}),r}catch(c){if(H(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:s});A(c)||console.error(c);return}},this.matchRoute=(e,s)=>{let r={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},n=this.buildLocation(r);if(s?.pending&&this.stores.status.get()!=="pending")return!1;let a=(s?.pending===void 0?!this.stores.isLoading.get():s.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=ur(n.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!u||e.params&&!st(u.rawParams,e.params,{partial:!0})?!1:s?.includeSearch??!0?st(a.search,n.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status==="notFound"||e.globalNotFound),this.getStoreConfig=o,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??xr,parseSearch:t.parseSearch??Pr,protocolAllowlist:t.protocolAllowlist??Ge}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:o,processedTree:e}){this.routesById=t,this.routesByPath=o,this.processedTree=e;let s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}getRouteBranch(t){let o=this.routeBranchCache.get(t);return o||(o=Qe(t),this.routeBranchCache.set(t,o)),o}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,o){let e=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:r}=e,{matchedRoutes:n}=e,a=!1;(s?s.path!=="/"&&r["**"]:Q(t.pathname))&&(this.options.notFoundRoute?n=[...n,this.options.notFoundRoute]:a=!0);let u=a?Xs(this.options.notFoundMode,n):void 0,c=new Array(n.length),d=new Map;for(let f of this.stores.matchStores.values())f.routeId&&d.set(f.routeId,f.get());for(let f=0;f<n.length;f++){let l=n[f],p=c[f-1],h,m,y;{let M=p?.search??t.search,et=p?._strictSearch??void 0;try{let V=xe(l.options.validateSearch,{...M})??void 0;h={...M,...V},m={...et,...V},y=void 0}catch(V){let dt=V;if(V instanceof ee||(dt=new ee(V.message,{cause:V})),o?.throwOnError)throw dt;h=M,m={},y=dt}}let v=l.options.loaderDeps?.({search:h})??"",g=v?JSON.stringify(v):"",{interpolatedPath:R,usedParams:S}=me({path:l.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),P=l.id+R+g,_=this.getMatch(P),L=d.get(l.id),x=_?._strictParams??S,w;if(!_)try{Ar(l,x)}catch(M){if(A(M)||H(M)?w=M:w=new Br(M.message,{cause:M}),o?.throwOnError)throw w}Object.assign(r,x);let C=L?"stay":"enter",I;if(_)I={..._,cause:C,params:L?.params??r,_strictParams:x,search:L?gt(L.search,h):gt(_.search,h),_strictSearch:m};else{let M=l.options.loader||l.options.beforeLoad||l.lazyFn||lo(l)?"pending":"success";I={id:P,ssr:l.options.ssr,index:f,routeId:l.id,params:L?.params??r,_strictParams:x,pathname:R,updatedAt:Date.now(),search:L?gt(L.search,h):h,_strictSearch:m,searchError:void 0,status:M,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:ct()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:L?at(L.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:l.options.staticData||{},fullPath:l.fullPath}}o?.preload||(I.globalNotFound=u===l.id),I.searchError=y;let b=this.getParentContext(p);I.context={...b,...I.__routeContext,...I.__beforeLoadContext},c[f]=I}for(let f=0;f<c.length;f++){let l=c[f],p=this.looseRoutesById[l.routeId],h=this.getMatch(l.id),m=d.get(l.routeId);if(l.params=m?gt(m.params,r):r,!h){let y=c[f-1],v=this.getParentContext(y);if(p.options.context){let g={deps:l.loaderDeps,params:l.params,context:v??{},location:t,navigate:i(R=>this.navigate({...R,_fromLocation:t}),"navigate"),buildLocation:this.buildLocation,cause:l.cause,abortController:l.abortController,preload:!!l.preload,matches:c,routeId:p.id};l.__routeContext=p.options.context(g)??void 0}l.context={...v,...l.__routeContext,...l.__beforeLoadContext}}}return c}matchRoutesLightweight(t){let o=pt(this.stores.matchesId.get()),e=this.lightweightCache.get(t);if(e&&e[0]===o)return e[1];let{matchedRoutes:s,routeParams:r}=this.getMatchedRoutes(t.pathname),n=pt(s),a={...t.search};for(let l of s)try{Object.assign(a,xe(l.options.validateSearch,a))}catch{}let u=o&&this.stores.matchStores.get(o)?.get(),c=u&&u.routeId===n.id&&u.pathname===t.pathname,d;if(c)d=u.params;else{let l=Object.assign(Object.create(null),r);for(let p of s)try{Ar(p,l)}catch{}d=l}let f={matchedRoutes:s,fullPath:n.fullPath,search:a,params:d};return this.lightweightCache.set(t,[o,f]),f}},ee=class extends Error{static{i(this,"SearchParamError")}},Br=class extends Error{static{i(this,"PathParamError")}},Dr=i(t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t,"normalize");function Fr(t,o){return Dr(t)===Dr(o)}i(Fr,"comparePaths");function $r(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}i($r,"getInitialRouterState");function xe(t,o){if(t==null)return{};if("~standard"in t){let e=t["~standard"].validate(o);if(e instanceof Promise)throw new ee("Async validation not supported");if(e.issues)throw new ee(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}i(xe,"validateSearch");function Ur({pathname:t,routesById:o,processedTree:e}){let s=Object.create(null),r=Q(t),n,a=lr(r,e,!0);return a&&(n=a.route,Object.assign(s,a.rawParams)),{matchedRoutes:a?.branch||[o.__root__],routeParams:s,foundRoute:n}}i(Ur,"getMatchedRoutes");function Js({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){return Ys(e)(t,o,s??!1)}i(Js,"applySearchMiddleware");function Ys(t){let o,e,s=[];for(let n of t){let a=n.options;if("search"in a)a.search?.middlewares&&s.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let c=i(({search:d,next:f})=>{let l=f(a.preSearchFilters?a.preSearchFilters.reduce((p,h)=>h(p),d):d);return a.postSearchFilters?a.postSearchFilters.reduce((p,h)=>h(p),l):l},"legacyMiddleware");s.push(c)}let u=a.validateSearch;if(u){let c=i(({search:d,next:f,meta:l})=>{let p=f(d);if(e)try{let h=xe(u,p);if(l&&h)for(let m in h)m in p||(l.defaulted||=new Map).set(m,h[m]);return{...p,...h}}catch{}return p},"validate");s.push(c)}}let r=i((n,a,u)=>{if(n>=s.length){if(!o.search)return{};if(o.search===!0)return a;let d=Y(o.search,a);return u&&(u.explicit=d),d}let c=i((d,f)=>{if(f){let l=u||{};return{search:r(n+1,d,l),meta:l}}return r(n+1,d,u)},"next");return s[n]({search:a,next:c,meta:u})},"applyNext");return i(function(a,u,c){return o=u,e=c,r(0,a)},"middleware")}i(Ys,"buildMiddlewareChain");function Xs(t,o){if(t!=="root")for(let e=o.length-1;e>=0;e--){let s=o[e];if(s.children)return s.id}return X}i(Xs,"findGlobalNotFoundRouteId");function Ar(t,o){let e=t.options.params?.parse??t.options.parseParams;if(e){let s=e(o);if(s===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(o,s)}}i(Ar,"extractStrictParams");var vo="Error preloading route! \u261D\uFE0F";var we=class{static{i(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=o=>{this.originalIndex=o.originalIndex;let e=this.options,s=!e?.path&&!e?.id;if(this.parentRoute=this.options.getParentRoute?.(),s)this._path=X;else if(!this.parentRoute)throw new Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let r=s?X:e?.path;r&&r!=="/"&&(r=he(r));let n=e?.id||r,a=s?X:Et([this.parentRoute.id==="__root__"?"":this.parentRoute.id,n]);r==="__root__"&&(r="/"),a!=="__root__"&&(a=Et(["/",a]));let u=a==="__root__"?"/":Et([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=u,this._to=Q(u)},this.addChildren=o=>this._addFileChildren(o),this._addFileChildren=o=>(Array.isArray(o)&&(this.children=o),typeof o=="object"&&o!==null&&(this.children=Object.values(o)),this),this._addFileTypes=()=>this,this.updateLoader=o=>(Object.assign(this.options,o),this),this.update=o=>(Object.assign(this.options,o),this),this.lazy=o=>(this.lazyFn=o,this),this.redirect=o=>Ut({from:this.fullPath,...o}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var yo=class extends we{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Me=k(j(),1);var F=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(F||{});function Hr({update:t,notify:o,unwatched:e}){return{link:s,unlink:r,propagate:n,checkDirty:a,shallowPropagate:u};function s(d,f,l){let p=f.depsTail;if(p!==void 0&&p.dep===d)return;let h=p!==void 0?p.nextDep:f.deps;if(h!==void 0&&h.dep===d){h.version=l,f.depsTail=h;return}let m=d.subsTail;if(m!==void 0&&m.version===l&&m.sub===f)return;let y=f.depsTail=d.subsTail={version:l,dep:d,sub:f,prevDep:p,nextDep:h,prevSub:m,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:f.deps=y,m!==void 0?m.nextSub=y:d.subs=y}function r(d,f=d.sub){let l=d.dep,p=d.prevDep,h=d.nextDep,m=d.nextSub,y=d.prevSub;return h!==void 0?h.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=h:f.deps=h,m!==void 0?m.prevSub=y:l.subsTail=y,y!==void 0?y.nextSub=m:(l.subs=m)===void 0&&e(l),h}function n(d){let f=d.nextSub,l;t:do{let p=d.sub,h=p.flags;if(h&60?h&12?h&4?!(h&48)&&c(d,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&o(p),h&1){let m=p.subs;if(m!==void 0){let y=(d=m).nextSub;y!==void 0&&(l={value:f,prev:l},f=y);continue}}if((d=f)!==void 0){f=d.nextSub;continue}for(;l!==void 0;)if(d=l.value,l=l.prev,d!==void 0){f=d.nextSub;continue t}break}while(!0)}function a(d,f){let l,p=0,h=!1;t:do{let m=d.dep,y=m.flags;if(f.flags&16)h=!0;else if((y&17)===17){if(t(m)){let v=m.subs;v.nextSub!==void 0&&u(v),h=!0}}else if((y&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(l={value:d,prev:l}),d=m.deps,f=m,++p;continue}if(!h){let v=d.nextDep;if(v!==void 0){d=v;continue}}for(;p--;){let v=f.subs,g=v.nextSub!==void 0;if(g?(d=l.value,l=l.prev):d=v,h){if(t(f)){g&&u(v),f=d.sub;continue}h=!1}else f.flags&=-33;f=d.sub;let R=d.nextDep;if(R!==void 0){d=R;continue t}}return h}while(!0)}function u(d){do{let f=d.sub,l=f.flags;(l&48)===32&&(f.flags=l|16,(l&6)===2&&o(f))}while((d=d.nextSub)!==void 0)}function c(d,f){let l=f.depsTail;for(;l!==void 0;){if(l===d)return!0;l=l.prevDep}return!1}}i(Hr,"createReactiveSystem");function jr(t,o,e){let s=typeof t=="object",r=s?t:void 0;return{next:(s?t.next:t)?.bind(r),error:(s?t.error:o)?.bind(r),complete:(s?t.complete:e)?.bind(r)}}i(jr,"toObserver");var Ro=[],Ce=0,{link:Vr,unlink:tn,propagate:en,checkDirty:zr,shallowPropagate:Wr}=Hr({update(t){return t._update()},notify(t){Ro[So++]=t,t.flags&=~F.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=F.Mutable|F.Dirty,be(t))}}),_e=0,So=0,lt,Po=0;function oe(t){try{++Po,t()}finally{--Po||xo()}}i(oe,"batch");function be(t){let o=t.depsTail,e=o!==void 0?o.nextDep:t.deps;for(;e!==void 0;)e=tn(e,t)}i(be,"purgeDeps");function xo(){if(!(Po>0)){for(;_e<So;){let t=Ro[_e];Ro[_e++]=void 0,t.notify()}_e=0,So=0}}i(xo,"flush");function Le(t,o){let e=typeof t=="function",s=t,r={_snapshot:e?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:e?F.None:F.Mutable,get(){return lt!==void 0&&Vr(r,lt,Ce),r._snapshot},subscribe(n){let a=jr(n),u={current:!1},c=on(()=>{r.get(),u.current?a.next?.(r._snapshot):u.current=!0});return{unsubscribe:i(()=>{c.stop()},"unsubscribe")}},_update(n){let a=lt,u=o?.compare??Object.is;if(e)lt=r,++Ce,r.depsTail=void 0;else if(n===void 0)return!1;e&&(r.flags=F.Mutable|F.RecursedCheck);try{let c=r._snapshot,d=typeof n=="function"?n(c):n===void 0&&e?s(c):n;return c===void 0||!u(c,d)?(r._snapshot=d,!0):!1}finally{lt=a,e&&(r.flags&=~F.RecursedCheck),be(r)}}};return e?(r.flags=F.Mutable|F.Dirty,r.get=function(){let n=r.flags;if(n&F.Dirty||n&F.Pending&&zr(r.deps,r)){if(r._update()){let a=r.subs;a!==void 0&&Wr(a)}}else n&F.Pending&&(r.flags=n&~F.Pending);return lt!==void 0&&Vr(r,lt,Ce),r._snapshot}):r.set=function(n){if(r._update(n)){let a=r.subs;a!==void 0&&(en(a),Wr(a),xo())}},r}i(Le,"createAtom");function on(t){let o=i(()=>{let s=lt;lt=e,++Ce,e.depsTail=void 0,e.flags=F.Watching|F.RecursedCheck;try{return t()}finally{lt=s,e.flags&=~F.RecursedCheck,be(e)}},"run"),e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:F.Watching|F.RecursedCheck,notify(){let s=this.flags;s&F.Dirty||s&F.Pending&&zr(this.deps,this)?o():this.flags=F.Watching},stop(){this.flags=F.None,this.depsTail=void 0,be(this)}};return o(),e}i(on,"effect");var wo=k(j(),1),Kr=k(xs(),1);function rn(t,o){return t===o}i(rn,"defaultCompare");function B(t,o,e=rn){let s=(0,wo.useCallback)(a=>{if(!t)return()=>{};let{unsubscribe:u}=t.subscribe(a);return u},[t]),r=(0,wo.useCallback)(()=>t?.get(),[t]);return(0,Kr.useSyncExternalStoreWithSelector)(s,r,r,o,e)}i(B,"useStore");var _o={get(){},subscribe(){return{unsubscribe(){}}}};function Co(t,o){let e=Me.useRef();return s=>{let r=t?.select?t.select(s):s;return t?.structuralSharing??o.options.defaultStructuralSharing?e.current=at(e.current,r):r}}i(Co,"useStructuralSharing");function tt(t){let o=D(),e=Me.useContext(t.from?Xo:Mt),s=t.from?o.stores.getRouteMatchStore(t.from):o.stores.matchStores.get(e);if(!1){let a=s?.get();if(!a){if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`);return}return t.select?t.select(a):a}let r=Co(t,o),n=B(s??_o,a=>a?r(a):_o);if(n!==_o)return n;if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`)}i(tt,"useMatch");function Ie(t){return tt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.search):o.search,"select")})}i(Ie,"useSearch");var nt=k(j(),1);var Tt=typeof window<"u"?nt.useLayoutEffect:nt.useEffect;function Ee(t){let o=nt.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}i(Ee,"usePrevious");function qr(t,o,e={},s={}){nt.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;let r=new IntersectionObserver(([n])=>{o(n)},e);return r.observe(t.current),()=>{r.disconnect()}},[o,e,s.disabled,t])}i(qr,"useIntersectionObserver");function Gr(t){let o=nt.useRef(null);return nt.useImperativeHandle(t,()=>o.current,[]),o}i(Gr,"useForwardedRef");var bo=k(j(),1);function ke(t){let o=D();return bo.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}i(ke,"useNavigate");var Wt=k(j(),1),it=k(rt(),1);function Ot(t){let o=t.errorComponent??Nt;return(0,it.jsx)(sn,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:i(({error:e,reset:s})=>e?Wt.createElement(o,{error:e,reset:s}):t.children,"children")})}i(Ot,"CatchBoundary");var sn=class extends Wt.Component{static{i(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,o){let e=t.getResetKey();return o.error&&o.resetKey!==e?{resetKey:e,error:null}:{resetKey:e}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,o){this.props.onCatch&&this.props.onCatch(t,o)}render(){return this.props.children({error:this.state.error,reset:i(()=>{this.reset()},"reset")})}};function Nt({error:t}){let[o,e]=Wt.useState(!0);return(0,it.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,it.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,it.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,it.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>e(s=>!s),"onClick"),children:o?"Hide Error":"Show Error"})]}),(0,it.jsx)("div",{style:{height:".25rem"}}),o?(0,it.jsx)("div",{children:(0,it.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,it.jsx)("code",{children:t.message}):null})}):null]})}i(Nt,"ErrorComponent");var Te=k(j(),1),Lo=k(rt(),1);function Jr({children:t,fallback:o=null}){return Mo()?(0,Lo.jsx)(Te.default.Fragment,{children:t}):(0,Lo.jsx)(Te.default.Fragment,{children:o})}i(Jr,"ClientOnly");function Mo(){return Te.default.useSyncExternalStore(nn,()=>!0,()=>!1)}i(Mo,"useHydrated");function nn(){return()=>{}}i(nn,"subscribe");function Io(t){return tt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.loaderData):o.loaderData,"select")})}i(Io,"useLoaderData");function Eo(t){let{select:o,...e}=t;return tt({...e,select:i(s=>o?o(s.loaderDeps):s.loaderDeps,"select")})}i(Eo,"useLoaderDeps");function ko(t){return tt({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(o=>{let e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e},"select")})}i(ko,"useParams");function To(t){return tt({...t,select:i(o=>t.select?t.select(o.context):o.context,"select")})}i(To,"useRouteContext");var U=k(j(),1),an=k(rt(),1);var es=k(Ps(),1);function cn(t,o){let e=D(),s=Gr(o),r=!1,{activeProps:n,inactiveProps:a,activeOptions:u,to:c,preload:d,preloadDelay:f,preloadIntentProximity:l,hashScrollIntoView:p,replace:h,startTransition:m,resetScroll:y,viewTransition:v,children:g,target:R,disabled:S,style:P,className:_,onClick:L,onBlur:x,onFocus:w,onMouseEnter:C,onMouseLeave:I,onTouchStart:b,ignoreBlocker:M,params:et,search:V,hash:dt,state:ne,mask:ot,reloadDocument:Kt,unsafeRelative:Ao,from:Bo,_fromLocation:ie,...Dt}=t;if(r){let O=ts(c);if(typeof c=="string"&&!O&&c.indexOf(":")>-1)try{return new URL(c),ut(c,e.protocolAllowlist)?(console.warn(`Blocked Link with dangerous protocol: ${c}`),{...Dt,ref:s,href:void 0,...g&&{children:g},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}):{...Dt,ref:s,href:c,...g&&{children:g},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}}catch{}let T=e.buildLocation({...t,from:t.from}),Z=Qr(T.maskedLocation?T.maskedLocation.publicHref:T.publicHref,T.maskedLocation?T.maskedLocation.external:T.external,e.history,S),Jt=(()=>{if(Z?.external){if(ut(Z.href,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${Z.href}`);return}return Z.href}if(!O&&typeof c=="string"&&c.indexOf(":")>-1)try{if(new URL(c),ut(c,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${c}`);return}return c}catch{}})(),Ve=(()=>{if(Jt)return!1;let W=e.stores.location.get(),G=u?.exact??!1;if(G){if(!pe(W.pathname,T.pathname,e.basepath))return!1}else{let z=Pt(W.pathname,e.basepath),J=Pt(T.pathname,e.basepath);if(!(z.startsWith(J)&&(z.length===J.length||z[J.length]==="/")))return!1}if((u?.includeSearch??!0)&&W.search!==T.search){let z=!W.search||typeof W.search=="object"&&!mt(W.search),J=!T.search||typeof T.search=="object"&&!mt(T.search);if(!(z&&J)&&!st(W.search,T.search,{partial:!G,ignoreUndefined:!u?.explicitUndefined}))return!1}return!u?.includeHash})();if(Jt)return{...Dt,ref:s,href:Jt,...g&&{children:g},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}};let We=Ve?Y(n,{})??Yr:jt,je=Ve?jt:Y(a,{})??jt,qo=(()=>{let W=P,G=We.style,z=je.style;if(!(!W&&!G&&!z))return W&&!G&&!z?W:!W&&G&&!z?G:!W&&!G&&z?z:{...W,...G,...z}})(),Go=(()=>{let W=_,G=We.className,z=je.className;if(!W&&!G&&!z)return"";let J="";return W&&(J=W),G&&(J=J?`${J} ${G}`:G),z&&(J=J?`${J} ${z}`:z),J})();return{...Dt,...We,...je,href:Z?.href,ref:s,disabled:!!S,target:R,...qo&&{style:qo},...Go&&{className:Go},...S&&Xr,...Ve&&Zr}}let $e=Mo(),qt=U.useMemo(()=>t,[e,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),bt=B(e.stores.location,O=>O,(O,T)=>O.href===T.href),q=U.useMemo(()=>{let O={_fromLocation:bt,...qt};return e.buildLocation(O)},[e,bt,qt]),$o=q.maskedLocation?q.maskedLocation.publicHref:q.publicHref,Uo=q.maskedLocation?q.maskedLocation.external:q.external,Ft=U.useMemo(()=>Qr($o,Uo,e.history,S),[S,Uo,$o,e.history]),Gt=U.useMemo(()=>{if(Ft?.external){if(ut(Ft.href,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${Ft.href}`);return}return Ft.href}if(!ts(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{if(new URL(c),ut(c,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${c}`);return}return c}catch{}},[c,Ft,e.protocolAllowlist]),Ue=U.useMemo(()=>{if(Gt)return!1;if(u?.exact){if(!pe(bt.pathname,q.pathname,e.basepath))return!1}else{let O=Pt(bt.pathname,e.basepath),T=Pt(q.pathname,e.basepath);if(!(O.startsWith(T)&&(O.length===T.length||O[T.length]==="/")))return!1}return(u?.includeSearch??!0)&&!st(bt.search,q.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?$e&&bt.hash===q.hash:!0},[u?.exact,u?.explicitUndefined,u?.includeHash,u?.includeSearch,bt,Gt,$e,q.hash,q.pathname,q.search,e.basepath]),ae=Ue?Y(n,{})??Yr:jt,ce=Ue?jt:Y(a,{})??jt,Ho=[_,ae.className,ce.className].filter(Boolean).join(" "),Vo=(P||ae.style||ce.style)&&{...P,...ae.style,...ce.style},[ys,Wo]=U.useState(!1),jo=U.useRef(!1),At=t.reloadDocument||Gt?!1:d??e.options.defaultPreload,He=f??e.options.defaultPreloadDelay??0,Lt=U.useCallback(()=>{e.preloadRoute({...qt,_builtLocation:q}).catch(O=>{console.warn(O),console.warn(vo)})},[e,qt,q]);qr(s,U.useCallback(O=>{O?.isIntersecting&&Lt()},[Lt]),ln,{disabled:!!S||At!=="viewport"}),U.useEffect(()=>{jo.current||!S&&At==="render"&&(Lt(),jo.current=!0)},[S,Lt,At]);let Rs=i(O=>{let T=O.currentTarget.getAttribute("target"),Z=R!==void 0?R:T;if(!S&&!fn(O)&&!O.defaultPrevented&&(!Z||Z==="_self")&&O.button===0){O.preventDefault(),(0,es.flushSync)(()=>{Wo(!0)});let Jt=e.subscribe("onResolved",()=>{Jt(),Wo(!1)});e.navigate({...qt,replace:h,resetScroll:y,hashScrollIntoView:p,startTransition:m,viewTransition:v,ignoreBlocker:M})}},"handleClick");if(Gt)return{...Dt,ref:s,href:Gt,...g&&{children:g},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_},...L&&{onClick:L},...x&&{onBlur:x},...w&&{onFocus:w},...C&&{onMouseEnter:C},...I&&{onMouseLeave:I},...b&&{onTouchStart:b}};let zo=i(O=>{if(S||At!=="intent")return;if(!He){Lt();return}let T=O.currentTarget;if(re.has(T))return;let Z=setTimeout(()=>{re.delete(T),Lt()},He);re.set(T,Z)},"enqueueIntentPreload"),Ss=i(O=>{S||At!=="intent"||Lt()},"handleTouchStart"),Ko=i(O=>{if(S||!At||!He)return;let T=O.currentTarget,Z=re.get(T);Z&&(clearTimeout(Z),re.delete(T))},"handleLeave");return{...Dt,...ae,...ce,href:Ft?.href,ref:s,onClick:zt([L,Rs]),onBlur:zt([x,Ko]),onFocus:zt([w,zo]),onMouseEnter:zt([C,zo]),onMouseLeave:zt([I,Ko]),onTouchStart:zt([b,Ss]),disabled:!!S,target:R,...Vo&&{style:Vo},...Ho&&{className:Ho},...S&&Xr,...Ue&&Zr,...$e&&ys&&un}}i(cn,"useLinkProps");var jt={},Yr={className:"active"},Xr={role:"link","aria-disabled":!0},Zr={"data-status":"active","aria-current":"page"},un={"data-transitioning":"transitioning"},re=new WeakMap,ln={rootMargin:"100px"},zt=i(t=>o=>{for(let e of t)if(e){if(o.defaultPrevented)return;e(o)}},"composeHandlers");function Qr(t,o,e,s){if(!s)return o?{href:t,external:!0}:{href:e.createHref(t)||"/",external:!1}}i(Qr,"getHrefOption");function ts(t){if(typeof t!="string")return!1;let o=t.charCodeAt(0);return o===47?t.charCodeAt(1)!==47:o===46}i(ts,"isSafeInternal");var Oo=U.forwardRef((t,o)=>{let{_asChild:e,...s}=t,{type:r,...n}=cn(s,o),a=typeof s.children=="function"?s.children({isActive:n["data-status"]==="active"}):s.children;if(!e){let{disabled:u,...c}=n;return U.createElement("a",c,a)}return U.createElement(e,n,a)});function fn(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}i(fn,"isCtrlEvent");var No=k(j(),1),Do=k(rt(),1);var os=class extends we{static{i(this,"Route")}constructor(t){super(t),this.useMatch=o=>tt({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>To({...o,from:this.id}),this.useSearch=o=>Ie({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>ko({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>Eo({...o,from:this.id}),this.useLoaderData=o=>Io({...o,from:this.id}),this.useNavigate=()=>ke({from:this.fullPath}),this.Link=No.default.forwardRef((o,e)=>(0,Do.jsx)(Oo,{ref:e,from:this.fullPath,...o}))}};function dn(t){return new os(t)}i(dn,"createRoute");var rs=class extends yo{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=o=>tt({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>To({...o,from:this.id}),this.useSearch=o=>Ie({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>ko({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>Eo({...o,from:this.id}),this.useLoaderData=o=>Io({...o,from:this.id}),this.useNavigate=()=>ke({from:this.fullPath}),this.Link=No.default.forwardRef((o,e)=>(0,Do.jsx)(Oo,{ref:e,from:this.fullPath,...o}))}};function hn(t){return new rs(t)}i(hn,"createRootRoute");var Pc=k(j(),1),Oe=k(rt(),1);function ss(t){let o=D();if(!1){let s=`not-found-${o.stores.location.get().pathname}-${o.stores.status.get()}`;return(0,Oe.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),onCatch:i((r,n)=>{if(A(r))t.onCatch?.(r,n);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(A(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}let e=`not-found-${B(o.stores.location,s=>s.pathname)}-${B(o.stores.status,s=>s)}`;return(0,Oe.jsx)(Ot,{getResetKey:i(()=>e,"getResetKey"),onCatch:i((s,r)=>{if(A(s))t.onCatch?.(s,r);else throw s},"onCatch"),errorComponent:i(({error:s})=>{if(A(s))return t.fallback?.(s);throw s},"errorComponent"),children:t.children})}i(ss,"CatchNotFound");function ns(){return(0,Oe.jsx)("p",{children:"Not Found"})}i(ns,"DefaultGlobalNotFound");var is=k(rt(),1);function as({children:t}){let o=D();return null}i(as,"ScriptOnce");var Mc=k(j(),1),Ne=k(rt(),1);function _t(t){return(0,Ne.jsx)(Ne.Fragment,{children:t.children})}i(_t,"SafeFragment");var Tc=k(j(),1),De=k(rt(),1);function Fe(t,o,e){return o.options.notFoundComponent?(0,De.jsx)(o.options.notFoundComponent,{...e}):t.options.defaultNotFoundComponent?(0,De.jsx)(t.options.defaultNotFoundComponent,{...e}):(o.options.notFoundComponent||console.warn(`Warning: A notFoundError was encountered on the route with ID "${o.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),(0,De.jsx)(ns,{}))}i(Fe,"renderRouteNotFound");var us=k(rt(),1);function cs(t){return null}i(cs,"getScrollRestorationScriptForRouter");function ls(){let t=cs(D());return t?(0,us.jsx)(as,{children:t}):null}i(ls,"ScrollRestoration");var K=k(j(),1),N=k(rt(),1);var pn=i((t,o)=>t.routeId===o.routeId&&t._displayPending===o._displayPending,"matchViewFieldsEqual"),mn=i((t,o)=>t[0]===o[0]&&t[1]===o[1],"outletMatchSelectionEqual"),Ae=K.memo(i(function({matchId:o}){let e=D();if(!1){let a=e.stores.matchStores.get(o)?.get();if(!a)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let u=a.routeId,c=e.routesById[u].parentRoute?.id;return(0,N.jsx)(fs,{router:e,matchId:o,resetKey:e.stores.loadedAt.get(),matchState:{routeId:u,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:c}})}let s=e.stores.matchStores.get(o);if(!s)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let r=B(e.stores.loadedAt,a=>a),n=B(s,a=>a,pn);return(0,N.jsx)(fs,{router:e,matchId:o,resetKey:r,matchState:K.useMemo(()=>{let a=n.routeId,u=e.routesById[a].parentRoute?.id;return{routeId:a,ssr:n.ssr,_displayPending:n._displayPending,parentRouteId:u}},[n._displayPending,n.routeId,n.ssr,e.routesById])})},"MatchImpl"));function fs({router:t,matchId:o,resetKey:e,matchState:s}){let r=t.routesById[s.routeId],n=r.options.pendingComponent??t.options.defaultPendingComponent,a=n?(0,N.jsx)(n,{}):null,u=r.options.errorComponent??t.options.defaultErrorComponent,c=r.options.onCatch??t.options.defaultOnCatch,d=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,f=s.ssr===!1||s.ssr==="data-only",l=(!r.isRoot||r.options.wrapInSuspense||f)&&(r.options.wrapInSuspense??n??(r.options.errorComponent?.preload||f))?K.Suspense:_t,p=u?Ot:_t,h=d?ss:_t;return(0,N.jsxs)(r.isRoot?r.options.shellComponent??_t:_t,{children:[(0,N.jsx)(Mt.Provider,{value:o,children:(0,N.jsx)(l,{fallback:a,children:(0,N.jsx)(p,{getResetKey:i(()=>e,"getResetKey"),errorComponent:u||Nt,onCatch:i((m,y)=>{if(A(m))throw m.routeId??=s.routeId,m;console.warn(`Warning: Error in route match: ${o}`),c?.(m,y)},"onCatch"),children:(0,N.jsx)(h,{fallback:i(m=>{if(m.routeId??=s.routeId,!d||m.routeId&&m.routeId!==s.routeId||!m.routeId&&!r.isRoot)throw m;return K.createElement(d,m)},"fallback"),children:f||s._displayPending?(0,N.jsx)(Jr,{fallback:a,children:(0,N.jsx)(ds,{matchId:o})}):(0,N.jsx)(ds,{matchId:o})})})})}),s.parentRouteId===X?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(gn,{}),t.options.scrollRestoration&&!1?(0,N.jsx)(ls,{}):null]}):null]})}i(fs,"MatchView");function gn(){let t=D();if(!1)return null;let o=K.useRef();return Tt(()=>{let e=t.stores.resolvedLocation.get(),s=o.current;e&&(!s||s.href!==e.href)&&t.emit({type:"onRendered",...ht(t.stores.location.get(),s??e)}),o.current=e},[B(t.stores.resolvedLocation,e=>e?.state.__TSR_key),t]),null}i(gn,"OnRendered");var ds=K.memo(i(function({matchId:o}){let e=D(),s=i((f,l)=>e.getMatch(f.id)?._nonReactive[l]??f._nonReactive[l],"getMatchPromise");if(!1){let f=e.stores.matchStores.get(o)?.get();if(!f)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let l=f.routeId,p=e.routesById[l],h=(e.routesById[l].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:l,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch}),m=h?JSON.stringify(h):void 0,y=p.options.component??e.options.defaultComponent,v=y?(0,N.jsx)(y,{},m):(0,N.jsx)(Fo,{});if(f._displayPending)throw s(f,"displayPendingPromise");if(f._forcePending)throw s(f,"minPendingPromise");if(f.status==="pending")throw s(f,"loadPromise");if(f.status==="notFound"){if(!A(f.error))throw new Error("Invariant failed: Expected a notFound error");return Fe(e,p,f.error)}if(f.status==="redirected")throw H(f.error)?s(f,"loadPromise"):new Error("Invariant failed: Expected a redirect error");return f.status==="error"?(0,N.jsx)((p.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:f.error,reset:void 0,info:{componentStack:""}}):v}let r=e.stores.matchStores.get(o);if(!r)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let n=B(r,f=>f),a=n.routeId,u=e.routesById[a],c=K.useMemo(()=>{let f=(e.routesById[a].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:a,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return f?JSON.stringify(f):void 0},[a,n.loaderDeps,n._strictParams,n._strictSearch,e.options.defaultRemountDeps,e.routesById]),d=K.useMemo(()=>{let f=u.options.component??e.options.defaultComponent;return f?(0,N.jsx)(f,{},c):(0,N.jsx)(Fo,{})},[c,u.options.component,e.options.defaultComponent]);if(n._displayPending)throw s(n,"displayPendingPromise");if(n._forcePending)throw s(n,"minPendingPromise");if(n.status==="pending"){let f=u.options.pendingMinMs??e.options.defaultPendingMinMs;if(f){let l=e.getMatch(n.id);if(l&&!l._nonReactive.minPendingPromise&&!!1){let p=ct();l._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),l._nonReactive.minPendingPromise=void 0},f)}}throw s(n,"loadPromise")}if(n.status==="notFound"){if(!A(n.error))throw new Error("Invariant failed: Expected a notFound error");return Fe(e,u,n.error)}if(n.status==="redirected")throw H(n.error)?s(n,"loadPromise"):new Error("Invariant failed: Expected a redirect error");if(n.status==="error"){if(!1)return(0,N.jsx)((u.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:n.error,reset:void 0,info:{componentStack:""}});throw n.error}return d},"MatchInnerImpl")),Fo=K.memo(i(function(){let o=D(),e=K.useContext(Mt),s,r=!1,n;if(!1){let d=o.stores.matches.get(),f=e?d.findIndex(p=>p.id===e):-1,l=f>=0?d[f]:void 0;s=l?.routeId,r=l?.globalNotFound??!1,n=f>=0?d[f+1]?.id:void 0}else{let d=e?o.stores.matchStores.get(e):void 0;[s,r]=B(d,f=>[f?.routeId,f?.globalNotFound??!1],mn),n=B(o.stores.matchesId,f=>f[f.findIndex(l=>l===e)+1])}let a=s?o.routesById[s]:void 0,u=o.options.defaultPendingComponent?(0,N.jsx)(o.options.defaultPendingComponent,{}):null;if(r){if(!a)throw new Error("Invariant failed: Could not resolve route for Outlet render");return Fe(o,a,void 0)}if(!n)return null;let c=(0,N.jsx)(Ae,{matchId:n});return s===X?(0,N.jsx)(K.Suspense,{fallback:u,children:c}):c},"OutletImpl"));var Ct=k(j(),1);function hs(){let t=D(),o=Ct.useRef({router:t,mounted:!1}),[e,s]=Ct.useState(!1),r=B(t.stores.isLoading,l=>l),n=B(t.stores.hasPending,l=>l),a=Ee(r),u=r||e||n,c=Ee(u),d=r||n,f=Ee(d);return t.startTransition=l=>{s(!0),Ct.startTransition(()=>{l(),s(!1)})},Ct.useEffect(()=>{let l=t.history.subscribe(t.load),p=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Q(t.latestLocation.publicHref)!==Q(p.publicHref)&&t.commitLocation({...p,replace:!0}),()=>{l()}},[t,t.history]),Tt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},i(async()=>{try{await t.load()}catch(p){console.error(p)}},"tryLoad")()},[t]),Tt(()=>{a&&!r&&t.emit({type:"onLoad",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[a,t,r]),Tt(()=>{f&&!d&&t.emit({type:"onBeforeRouteMount",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[d,f,t]),Tt(()=>{if(c&&!u){let l=ht(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...l}),oe(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[u,c,t]),null}i(hs,"Transitioner");var Be=k(j(),1),ft=k(rt(),1);function ps(){let t=D(),o=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,e=o?(0,ft.jsx)(o,{}):null,s=(0,ft.jsxs)(typeof document<"u"&&t.ssr?_t:Be.Suspense,{fallback:e,children:[!!1&&(0,ft.jsx)(hs,{}),(0,ft.jsx)(vn,{})]});return t.options.InnerWrap?(0,ft.jsx)(t.options.InnerWrap,{children:s}):s}i(ps,"Matches");function vn(){let t=D(),o=!1,e=o?t.stores.firstId.get():B(t.stores.firstId,n=>n),s=o?t.stores.loadedAt.get():B(t.stores.loadedAt,n=>n),r=e?(0,ft.jsx)(Ae,{matchId:e}):null;return(0,ft.jsx)(Mt.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:(0,ft.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),errorComponent:Nt,onCatch:n=>{console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),console.warn(`Warning: ${n.message||n.toString()}`)},children:r})})}i(vn,"MatchesInner");var ms=i(t=>({createMutableStore:Le,createReadonlyStore:Le,batch:oe}),"getStoreFactory");var yn=i(t=>new gs(t),"createRouter"),gs=class extends go{static{i(this,"Router")}constructor(t){super(t,ms)}};var Iu=k(j(),1),se=k(rt(),1);function vs({router:t,children:o,...e}){mt(e)&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});let s=(0,se.jsx)(ue.Provider,{value:t,children:o});return t.options.Wrap?(0,se.jsx)(t.options.Wrap,{children:s}):s}i(vs,"RouterContextProvider");function Rn({router:t,...o}){return(0,se.jsx)(vs,{router:t,...o,children:(0,se.jsx)(ps,{})})}i(Rn,"RouterProvider");function Sn(t){let o=D({warn:t?.router===void 0}),e=t?.router||o;if(!1){let s=e.stores.__store.get();return t?.select?t.select(s):s}return B(e.stores.__store,Co(t,e))}i(Sn,"useRouterState");export{po as a,qs as b,D as c,Ie as d,ke as e,dn as f,hn as g,Fo as h,yn as i,Rn as j,Sn as k};
@@ -0,0 +1 @@
1
+ import{a as vt,b as ht,c as gt,d as xt,e as pt}from"./chunk-7YGTGBP7.js";import{a as ct,b as ft,c as ut,d as mt,e as ke}from"./chunk-S5NTGHCG.js";import"./chunk-DWDILV2E.js";import{a as dt}from"./chunk-N7SVJOHN.js";import"./chunk-APSSZB6Z.js";import"./chunk-QAFAJBAW.js";import{e as nt}from"./chunk-IYHPYY4A.js";import{a as ot}from"./chunk-FQUNSQLG.js";import"./chunk-SHERR7ZP.js";import"./chunk-5OIBXYZM.js";import"./chunk-L7SK4ZZD.js";import"./chunk-SWMBBYJU.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import{a as it}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import{b as je}from"./chunk-4F72YCTU.js";import{a as Ue,b as Ve,c as Ge,d as Ie,e as Z,f as G}from"./chunk-GTM65MVX.js";import{a as ee,b as Re,c as Me,d as Ye,e as le}from"./chunk-Y572GMZE.js";import"./chunk-4QHKBC77.js";import{a as at}from"./chunk-FDWXYXOM.js";import{a as lt,b as st}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as Ke}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as He}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as Be}from"./chunk-EBTLTGG3.js";import{f as Xe}from"./chunk-S2G7OH5T.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as Ee,f as Ze,g as et,h as tt,l as rt,o as ze}from"./chunk-5XO36X4C.js";import"./chunk-ZXLEXF4X.js";import{a as d,e as Qe,f as bt,g as Nt,h as yt}from"./chunk-RRCPZMC2.js";var Fe=Qe(Nt(),1);var _=Qe(bt(),1);var t=Qe(yt(),1);var St=d(s=>s.kind==="gauge"?s.last:s.kind==="histogram"?s.sum/Math.max(1,s.count):s.sum,"metricHeadline"),Je=d(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"formatMetricValue"),wt=d(s=>Array.isArray(s?.series)?s.series:[],"seriesOf"),qt={counter:"secondary",gauge:"default",histogram:"outline"},Tt=d(s=>{let e=(0,Fe.c)(79),{shardKey:l}=s,r=Ee(),o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={},e[0]=o):o=e[0];let U;e[1]!==l?(U={live:!0,shardKey:l},e[1]=l,e[2]=U):U=e[2];let{data:M,error:g}=je(Be.getMetricSeries,o,U),y,v,p,u,c,C,z,B,i,q,O,E,W;if(e[3]!==M||e[4]!==g||e[5]!==r){C=Symbol.for("react.early_return_sentinel");e:{let V=wt(M);if(g!==null||V.length===0){C=null;break e}let S;e[19]!==r?(S=d(f=>r(f==="counter"?"Counter":f==="gauge"?"Gauge":"Histogram"),"t122"),e[19]=r,e[20]=S):S=e[20];let w=S;E="flex flex-col gap-2",W="mt-instruments";let F;e[21]!==r?(F=r("Instruments"),e[21]=r,e[22]=F):F=e[22],e[23]!==F?(c=(0,t.jsxDEV)("h3",{className:"text-sm font-semibold text-foreground",children:F},void 0,!1),e[23]=F,e[24]=c):c=e[24],u=ee,O="overflow-hidden py-0",p=le,q="px-0",v=Ue,B="mt-instruments-table";let D;e[25]!==r?(D=r("name"),e[25]=r,e[26]=D):D=e[26];let A;e[27]!==D?(A=(0,t.jsxDEV)(Z,{children:D},void 0,!1),e[27]=D,e[28]=A):A=e[28];let L;e[29]!==r?(L=r("kind"),e[29]=r,e[30]=L):L=e[30];let a;e[31]!==L?(a=(0,t.jsxDEV)(Z,{children:L},void 0,!1),e[31]=L,e[32]=a):a=e[32];let b;e[33]!==r?(b=r("value"),e[33]=r,e[34]=b):b=e[34];let h;e[35]!==b?(h=(0,t.jsxDEV)(Z,{className:"text-right",children:b},void 0,!1),e[35]=b,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("count"),e[37]=r,e[38]=x):x=e[38];let P;e[39]!==x?(P=(0,t.jsxDEV)(Z,{className:"text-right",children:x},void 0,!1),e[39]=x,e[40]=P):P=e[40];let Q;e[41]!==r?(Q=r("range"),e[41]=r,e[42]=Q):Q=e[42];let H;e[43]!==Q?(H=(0,t.jsxDEV)(Z,{className:"text-right",children:Q},void 0,!1),e[43]=Q,e[44]=H):H=e[44];let K;e[45]!==r?(K=r("dimensions"),e[45]=r,e[46]=K):K=e[46];let j;e[47]!==K?(j=(0,t.jsxDEV)(Z,{children:K},void 0,!1),e[47]=K,e[48]=j):j=e[48],e[49]!==A||e[50]!==a||e[51]!==h||e[52]!==P||e[53]!==H||e[54]!==j?(i=(0,t.jsxDEV)(Ve,{children:(0,t.jsxDEV)(Ie,{children:[A,a,h,P,H,j]},void 0,!0)},void 0,!1),e[49]=A,e[50]=a,e[51]=h,e[52]=P,e[53]=H,e[54]=j,e[55]=i):i=e[55],y=Ge;let X;e[56]!==w?(X=d(f=>{let Y=dt(f.attributes),te=`${f.kind}:${f.name}:${Y}`;return(0,t.jsxDEV)(Ie,{"data-testid":`mt-instrument-${f.name}`,children:[(0,t.jsxDEV)(G,{className:"font-mono text-xs",title:f.functionPath,children:f.name},void 0,!1),(0,t.jsxDEV)(G,{children:(0,t.jsxDEV)(He,{variant:qt[f.kind],children:w(f.kind)},void 0,!1)},void 0,!1),(0,t.jsxDEV)(G,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${f.name}`,children:Je(St(f))},void 0,!1),(0,t.jsxDEV)(G,{className:"text-right tabular-nums text-muted-foreground",children:f.count.toLocaleString()},void 0,!1),(0,t.jsxDEV)(G,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:f.min===f.max?"\u2014":`${Je(f.min)}\u2013${Je(f.max)}`},void 0,!1),(0,t.jsxDEV)(G,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:Y,children:Y===""?"\u2014":Y},void 0,!1)]},te,!0)},"t26"),e[56]=w,e[57]=X):X=e[57],z=V.map(X)}e[3]=M,e[4]=g,e[5]=r,e[6]=y,e[7]=v,e[8]=p,e[9]=u,e[10]=c,e[11]=C,e[12]=z,e[13]=B,e[14]=i,e[15]=q,e[16]=O,e[17]=E,e[18]=W}else y=e[6],v=e[7],p=e[8],u=e[9],c=e[10],C=e[11],z=e[12],B=e[13],i=e[14],q=e[15],O=e[16],E=e[17],W=e[18];if(C!==Symbol.for("react.early_return_sentinel"))return C;let I;e[58]!==y||e[59]!==z?(I=(0,t.jsxDEV)(y,{children:z},void 0,!1),e[58]=y,e[59]=z,e[60]=I):I=e[60];let m;e[61]!==v||e[62]!==I||e[63]!==B||e[64]!==i?(m=(0,t.jsxDEV)(v,{"data-testid":B,children:[i,I]},void 0,!0),e[61]=v,e[62]=I,e[63]=B,e[64]=i,e[65]=m):m=e[65];let $;e[66]!==p||e[67]!==m||e[68]!==q?($=(0,t.jsxDEV)(p,{className:q,children:m},void 0,!1),e[66]=p,e[67]=m,e[68]=q,e[69]=$):$=e[69];let k;e[70]!==u||e[71]!==$||e[72]!==O?(k=(0,t.jsxDEV)(u,{className:O,children:$},void 0,!1),e[70]=u,e[71]=$,e[72]=O,e[73]=k):k=e[73];let R;return e[74]!==c||e[75]!==k||e[76]!==E||e[77]!==W?(R=(0,t.jsxDEV)("section",{className:E,"data-testid":W,children:[c,k]},void 0,!0),e[74]=c,e[75]=k,e[76]=E,e[77]=W,e[78]=R):R=e[78],R},"InstrumentsTable"),Pe=d(s=>s>=100?"critical":s>=50?"warning":"good","performanceLevel"),We=d(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"formatLatency"),Oe=d(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"formatCount"),_t=d(s=>{let e=(0,Fe.c)(3),{level:l}=s;if(l==="critical"){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsxDEV)(He,{variant:"destructive",children:"Slow"},void 0,!1),e[0]=o):o=e[0],o}if(l==="warning"){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"},void 0,!1),e[1]=o):o=e[1],o}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"},void 0,!1),e[2]=r):r=e[2],r},"PerformanceBadge"),Ct=d(s=>{let e=(0,Fe.c)(152),{queryStats:l}=s,r=Ee(),[o,U]=(0,_.useState)("totalTime"),M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M=new Set,e[0]=M):M=e[0];let[g,y]=(0,_.useState)(M),v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=d(n=>{n!==null&&U(n)},"t2"),e[1]=v):v=e[1];let p=v,u;if(e[2]!==l||e[3]!==o){u=[...l];let n;e[5]!==o?(n=d((T,N)=>{switch(o){case"avgTime":return N.avgDurationMs-T.avgDurationMs;case"execCount":return N.execCount-T.execCount;case"rowsRead":return N.rowsRead-T.rowsRead;default:return N.totalDurationMs-T.totalDurationMs}},"t310"),e[5]=o,e[6]=n):n=e[6],u.sort(n),e[2]=l,e[3]=o,e[4]=u}else u=e[4];let c=u,C;e[7]!==l?(C=l.filter($t),e[7]=l,e[8]=C):C=e[8];let z=C.length,B;e[9]!==l?(B=l.filter(Rt),e[9]=l,e[10]=B):B=e[10];let i=B.length,q;e[11]!==l?(q=l.filter(Mt),e[11]=l,e[12]=q):q=e[12];let O=q.length,E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=d(n=>{y(T=>{let N=new Set(T);return N.has(n)?N.delete(n):N.add(n),N})},"t6"),e[13]=E):E=e[13];let W=E;if(l.length===0){let n;e[14]!==r?(n=r("No query insights yet"),e[14]=r,e[15]=n):n=e[15];let T;e[16]!==n?(T=(0,t.jsxDEV)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:n},void 0,!1),e[16]=n,e[17]=T):T=e[17];let N;e[18]!==r?(N=r("Query insights appear once statements are executed against this shard."),e[18]=r,e[19]=N):N=e[19];let re;e[20]!==N?(re=(0,t.jsxDEV)("p",{className:"mt-1 text-sm",children:N},void 0,!1),e[20]=N,e[21]=re):re=e[21];let Le;return e[22]!==re||e[23]!==T?(Le=(0,t.jsxDEV)(ee,{children:(0,t.jsxDEV)(le,{className:"py-12",children:(0,t.jsxDEV)("div",{className:"text-center text-muted-foreground",children:[T,re]},void 0,!0)},void 0,!1)},void 0,!1),e[22]=re,e[23]=T,e[24]=Le):Le=e[24],Le}let I;e[25]!==r?(I=r("Critical queries"),e[25]=r,e[26]=I):I=e[26];let m;e[27]!==I?(m=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(Me,{className:"text-sm font-medium",children:I},void 0,!1)},void 0,!1),e[27]=I,e[28]=m):m=e[28];let $;e[29]!==z?($=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:z},void 0,!1),e[29]=z,e[30]=$):$=e[30];let k;e[31]!==r?(k=r(">100ms avg execution"),e[31]=r,e[32]=k):k=e[32];let R;e[33]!==k?(R=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:k},void 0,!1),e[33]=k,e[34]=R):R=e[34];let V;e[35]!==R||e[36]!==$?(V=(0,t.jsxDEV)(le,{children:[$,R]},void 0,!0),e[35]=R,e[36]=$,e[37]=V):V=e[37];let S;e[38]!==V||e[39]!==m?(S=(0,t.jsxDEV)(ee,{children:[m,V]},void 0,!0),e[38]=V,e[39]=m,e[40]=S):S=e[40];let w;e[41]!==r?(w=r("Moderate queries"),e[41]=r,e[42]=w):w=e[42];let F;e[43]!==w?(F=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(Me,{className:"text-sm font-medium",children:w},void 0,!1)},void 0,!1),e[43]=w,e[44]=F):F=e[44];let D;e[45]!==i?(D=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:i},void 0,!1),e[45]=i,e[46]=D):D=e[46];let A;e[47]!==r?(A=r("50\u2013100ms avg execution"),e[47]=r,e[48]=A):A=e[48];let L;e[49]!==A?(L=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:A},void 0,!1),e[49]=A,e[50]=L):L=e[50];let a;e[51]!==D||e[52]!==L?(a=(0,t.jsxDEV)(le,{children:[D,L]},void 0,!0),e[51]=D,e[52]=L,e[53]=a):a=e[53];let b;e[54]!==F||e[55]!==a?(b=(0,t.jsxDEV)(ee,{children:[F,a]},void 0,!0),e[54]=F,e[55]=a,e[56]=b):b=e[56];let h;e[57]!==r?(h=r("Fast queries"),e[57]=r,e[58]=h):h=e[58];let x;e[59]!==h?(x=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(Me,{className:"text-sm font-medium",children:h},void 0,!1)},void 0,!1),e[59]=h,e[60]=x):x=e[60];let P;e[61]!==O?(P=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:O},void 0,!1),e[61]=O,e[62]=P):P=e[62];let Q;e[63]!==r?(Q=r("<50ms avg execution"),e[63]=r,e[64]=Q):Q=e[64];let H;e[65]!==Q?(H=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:Q},void 0,!1),e[65]=Q,e[66]=H):H=e[66];let K;e[67]!==P||e[68]!==H?(K=(0,t.jsxDEV)(le,{children:[P,H]},void 0,!0),e[67]=P,e[68]=H,e[69]=K):K=e[69];let j;e[70]!==x||e[71]!==K?(j=(0,t.jsxDEV)(ee,{children:[x,K]},void 0,!0),e[70]=x,e[71]=K,e[72]=j):j=e[72];let X;e[73]!==S||e[74]!==b||e[75]!==j?(X=(0,t.jsxDEV)("div",{className:"grid gap-4 md:grid-cols-3",children:[S,b,j]},void 0,!0),e[73]=S,e[74]=b,e[75]=j,e[76]=X):X=e[76];let f;e[77]!==r?(f=r("Query leaderboard"),e[77]=r,e[78]=f):f=e[78];let Y;e[79]!==f?(Y=(0,t.jsxDEV)("h3",{className:"text-lg font-semibold",children:f},void 0,!1),e[79]=f,e[80]=Y):Y=e[80];let te;e[81]!==o||e[82]!==r?(te=r("Slow queries sorted by {sortField}",{sortField:r(o)}),e[81]=o,e[82]=r,e[83]=te):te=e[83];let se;e[84]!==te?(se=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:te},void 0,!1),e[84]=te,e[85]=se):se=e[85];let ae;e[86]!==Y||e[87]!==se?(ae=(0,t.jsxDEV)("div",{children:[Y,se]},void 0,!0),e[86]=Y,e[87]=se,e[88]=ae):ae=e[88];let ie;e[89]!==r?(ie=r("Sort by"),e[89]=r,e[90]=ie):ie=e[90];let oe;e[91]!==ie?(oe=(0,t.jsxDEV)("span",{className:"text-sm text-muted-foreground",children:ie},void 0,!1),e[91]=ie,e[92]=oe):oe=e[92];let ne;e[93]!==r?(ne=r("Sort queries by"),e[93]=r,e[94]=ne):ne=e[94];let De;e[95]===Symbol.for("react.memo_cache_sentinel")?(De=(0,t.jsxDEV)(ft,{},void 0,!1),e[95]=De):De=e[95];let de;e[96]!==ne?(de=(0,t.jsxDEV)(ut,{"aria-label":ne,className:"w-[140px]","data-testid":"qi-sort",children:De},void 0,!1),e[96]=ne,e[97]=de):de=e[97];let ce;e[98]!==r?(ce=r("Total time"),e[98]=r,e[99]=ce):ce=e[99];let fe;e[100]!==ce?(fe=(0,t.jsxDEV)(ke,{value:"totalTime",children:ce},void 0,!1),e[100]=ce,e[101]=fe):fe=e[101];let ue;e[102]!==r?(ue=r("Avg time"),e[102]=r,e[103]=ue):ue=e[103];let me;e[104]!==ue?(me=(0,t.jsxDEV)(ke,{value:"avgTime",children:ue},void 0,!1),e[104]=ue,e[105]=me):me=e[105];let ve;e[106]!==r?(ve=r("Execution count"),e[106]=r,e[107]=ve):ve=e[107];let he;e[108]!==ve?(he=(0,t.jsxDEV)(ke,{value:"execCount",children:ve},void 0,!1),e[108]=ve,e[109]=he):he=e[109];let ge;e[110]!==r?(ge=r("Rows read"),e[110]=r,e[111]=ge):ge=e[111];let xe;e[112]!==ge?(xe=(0,t.jsxDEV)(ke,{value:"rowsRead",children:ge},void 0,!1),e[112]=ge,e[113]=xe):xe=e[113];let pe;e[114]!==fe||e[115]!==me||e[116]!==he||e[117]!==xe?(pe=(0,t.jsxDEV)(mt,{children:[fe,me,he,xe]},void 0,!0),e[114]=fe,e[115]=me,e[116]=he,e[117]=xe,e[118]=pe):pe=e[118];let be;e[119]!==o||e[120]!==de||e[121]!==pe?(be=(0,t.jsxDEV)(ct,{onValueChange:p,value:o,children:[de,pe]},void 0,!0),e[119]=o,e[120]=de,e[121]=pe,e[122]=be):be=e[122];let Ne;e[123]!==oe||e[124]!==be?(Ne=(0,t.jsxDEV)("div",{className:"flex items-center gap-2",children:[oe,be]},void 0,!0),e[123]=oe,e[124]=be,e[125]=Ne):Ne=e[125];let ye;e[126]!==ae||e[127]!==Ne?(ye=(0,t.jsxDEV)("div",{className:"flex items-center justify-between",children:[ae,Ne]},void 0,!0),e[126]=ae,e[127]=Ne,e[128]=ye):ye=e[128];let Se;e[129]!==r?(Se=r("Statements"),e[129]=r,e[130]=Se):Se=e[130];let we;e[131]!==Se?(we=(0,t.jsxDEV)(Me,{children:Se},void 0,!1),e[131]=Se,e[132]=we):we=e[132];let qe;e[133]!==c.length||e[134]!==r?(qe=r("{count} tracked statements",{count:c.length}),e[133]=c.length,e[134]=r,e[135]=qe):qe=e[135];let Te;e[136]!==qe?(Te=(0,t.jsxDEV)(Ye,{children:qe},void 0,!1),e[136]=qe,e[137]=Te):Te=e[137];let _e;e[138]!==we||e[139]!==Te?(_e=(0,t.jsxDEV)(Re,{children:[we,Te]},void 0,!0),e[138]=we,e[139]=Te,e[140]=_e):_e=e[140];let Ce;e[141]!==g||e[142]!==c||e[143]!==r?(Ce=(0,t.jsxDEV)(le,{children:(0,t.jsxDEV)("div",{className:"space-y-2",children:c.map(n=>{let T=n.normalizedSql,N=g.has(T),re=Pe(n.avgDurationMs);return(0,t.jsxDEV)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxDEV)("button",{"aria-expanded":N,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:d(()=>{W(T)},"onClick"),type:"button",children:[(0,t.jsxDEV)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsxDEV)(_t,{level:re},void 0,!1),(0,t.jsxDEV)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:n.normalizedSql},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:We(n.totalDurationMs)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("total")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:We(n.avgDurationMs)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("avg")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:Oe(n.execCount)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("calls")},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),N&&(0,t.jsxDEV)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("p",{className:"mb-2 text-sm font-medium",children:r("Full statement")},void 0,!1),(0,t.jsxDEV)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:n.normalizedSql},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Exec count")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Oe(n.execCount)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Total time")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:We(n.totalDurationMs)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Rows read")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Oe(n.rowsRead)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Rows written")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Oe(n.rowsWritten)},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},T,!0)})},void 0,!1)},void 0,!1),e[141]=g,e[142]=c,e[143]=r,e[144]=Ce):Ce=e[144];let $e;e[145]!==_e||e[146]!==Ce?($e=(0,t.jsxDEV)(ee,{children:[_e,Ce]},void 0,!0),e[145]=_e,e[146]=Ce,e[147]=$e):$e=e[147];let Ae;return e[148]!==X||e[149]!==ye||e[150]!==$e?(Ae=(0,t.jsxDEV)("div",{className:"space-y-4","data-testid":"qi-root",children:[X,ye,$e]},void 0,!0),e[148]=X,e[149]=ye,e[150]=$e,e[151]=Ae):Ae=e[151],Ae},"QueryInsights");function $t(s){return Pe(s.avgDurationMs)==="critical"}d($t,"_temp");function Rt(s){return Pe(s.avgDurationMs)==="warning"}d(Rt,"_temp2");function Mt(s){return Pe(s.avgDurationMs)==="good"}d(Mt,"_temp3");var It=Ze(Be.getMetrics),kt=d(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),r=Math.floor(e%3600/60),o=e%60;return l>0?`${l.toString()}h ${r.toString()}m`:r>0?`${r.toString()}m ${o.toString()}s`:`${o.toString()}s`},"formatDuration"),Ft=d((s,e)=>s?e:"overview","resolveTab"),Dt=d((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"hitRate"),J=d(s=>{let e=(0,Fe.c)(16),{chart:l,footer:r,label:o,testId:U,value:M}=s,g;e[0]!==o?(g=(0,t.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o},void 0,!1),e[0]=o,e[1]=g):g=e[1];let y;e[2]!==U||e[3]!==M?(y=(0,t.jsxDEV)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":U,children:M},void 0,!1),e[2]=U,e[3]=M,e[4]=y):y=e[4];let v;e[5]!==l||e[6]!==y?(v=(0,t.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[y,l]},void 0,!0),e[5]=l,e[6]=y,e[7]=v):v=e[7];let p;e[8]!==g||e[9]!==v?(p=(0,t.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,v]},void 0,!0),e[8]=g,e[9]=v,e[10]=p):p=e[10];let u;e[11]!==r?(u=r!=null&&(0,t.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:r},void 0,!1),e[11]=r,e[12]=u):u=e[12];let c;return e[13]!==p||e[14]!==u?(c=(0,t.jsxDEV)(ee,{className:"justify-between gap-0 py-0",children:[p,u]},void 0,!0),e[13]=p,e[14]=u,e[15]=c):c=e[15],c},"StatCard"),Zt=d(({initialShardKey:s})=>{let e=Xe(),l=Ee(),[r,o]=(0,_.useState)(s??""),[U,M]=(0,_.useState)("overview"),[g,y]=(0,_.useState)([]),v=(0,_.useRef)(null),p=(0,_.useRef)(null),u=(0,_.useRef)(!0);(0,_.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let c=it(r.trim(),400),{data:C,error:z,liveError:B}=je(Be.getMetrics,{},{live:!0,shardKey:c}),i=C??null;(0,_.useEffect)(()=>{if(C===void 0)return;st(c);let a=C,b=v.current,h=p.current!==null&&p.current!==a.shard;if(p.current=a.shard,v.current=a.requests,h){y([]);return}b!==null&&a.requests>=b&&y(x=>[...x,a.requests-b].slice(-30))},[C,c]);let[q,O]=(0,_.useState)(null),[E,W]=(0,_.useState)(!1),I=d(async()=>{W(!0);let a=ht(r,lt());try{let b=await Promise.all(a.map(async h=>{try{let x=await e.query(It,{},et(h));return{error:null,metrics:x,shard:h===""?x.shard:h}}catch(x){return{error:tt(x),metrics:null,shard:h===""?"__root__":h}}}));u.current&&O(b)}finally{u.current&&W(!1)}},"aggregateAll"),m=q===null?null:vt(q),$=i===null||i.requests===0?"\u2014":`${(i.errors/i.requests*100).toFixed(1)}%`,k=g.length>0?g.at(-1):0,R=i?gt(i):{p90:0,p95:0},V=d(a=>a<=0?"\u2014":a<1?`${(a*1e3).toFixed(0)}\u03BCs`:a<1e3?`${a.toFixed(1)}ms`:`${(a/1e3).toFixed(2)}s`,"formatMs"),S=(0,_.useMemo)(()=>{if(!i||!("queryStats"in i))return;let a=i.queryStats;if(!(!a||!Array.isArray(a)))return xt(a)},[i]),w=Ft(S!==void 0,U),F=d(()=>{rt(I())},"runAggregate"),D=d(()=>{O(null)},"clearAggregate"),A=d(()=>{M("overview")},"switchToOverview"),L=d(()=>{M("query-insights")},"switchToQueryInsights");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)(at,{onChange:o,testId:"mt-shard-input",value:r},void 0,!1),(0,t.jsxDEV)(ot,{message:B,prefix:"mt"},void 0,!1),(0,t.jsxDEV)(Ke,{"data-testid":"mt-aggregate",disabled:E,onClick:F,size:"sm",type:"button",variant:"secondary",children:l(E?"Aggregating\u2026":"All shards")},void 0,!1),q!==null&&(0,t.jsxDEV)(Ke,{"data-testid":"mt-aggregate-clear",onClick:D,size:"sm",type:"button",variant:"ghost",children:l("Hide")},void 0,!1),(0,t.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:nt,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")},void 0,!1)]},void 0,!0),z!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:z},void 0,!1),S!==void 0&&(0,t.jsxDEV)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsxDEV)("button",{className:`pb-2 text-sm font-medium transition-colors ${w==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:A,type:"button",children:l("Overview")},void 0,!1),(0,t.jsxDEV)("button",{className:`pb-2 text-sm font-medium transition-colors ${w==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:L,type:"button",children:[l("Query insights"),S.length>0&&(0,t.jsxDEV)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:S.length},void 0,!1)]},void 0,!0)]},void 0,!0),w==="query-insights"&&S!==void 0&&(0,t.jsxDEV)(Ct,{queryStats:S},void 0,!1),w==="overview"&&i!==null&&(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[(0,t.jsxDEV)(J,{chart:g.length>=2?(0,t.jsxDEV)(pt,{ariaLabel:l("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:g,testId:"mt-sparkline"},void 0,!1):void 0,footer:g.length>=2?(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("span",{className:"font-semibold text-foreground",children:`+${k.toLocaleString()}`},void 0,!1)," ",l("last interval")]},void 0,!0):(0,t.jsxDEV)("span",{"data-testid":"mt-sparkline-empty",children:l("collecting samples\u2026")},void 0,!1),label:l("Requests"),testId:"mt-requests",value:i.requests},void 0,!1),(0,t.jsxDEV)(J,{footer:l("{rate} error rate",{rate:$}),label:l("Errors"),testId:"mt-errors",value:(0,t.jsxDEV)(t.Fragment,{children:[i.errors," (",$,")"]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(J,{footer:R.p90>0?`P90 ${V(R.p90)}`:void 0,label:l("P95 latency"),testId:"mt-p95",value:R.p95>0?V(R.p95):"\u2014"},void 0,!1),(0,t.jsxDEV)(J,{footer:i.cache===null?void 0:`${i.cache.entries.toLocaleString()} ${l("cache entries")}`,label:l("Database size"),testId:"mt-db-size",value:ze(i.databaseSize)},void 0,!1),(0,t.jsxDEV)(J,{label:l("Shard"),testId:"mt-shard",value:i.shard},void 0,!1),(0,t.jsxDEV)(J,{label:l("Uptime"),testId:"mt-uptime",value:kt(i.uptimeMs)},void 0,!1),(0,t.jsxDEV)(J,{label:l("Cache hit rate"),testId:"mt-cache",value:i.cache===null?l("no cache configured"):l("{rate} ({count} entries)",{count:i.cache.entries,rate:Dt(i.cache.hits,i.cache.misses)})},void 0,!1)]},void 0,!0),w==="overview"&&i===null&&null,w==="overview"&&(0,t.jsxDEV)(Tt,{shardKey:c},void 0,!1),w==="overview"&&m!==null&&q!==null&&(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[(0,t.jsxDEV)(J,{label:l("Shards"),testId:"mt-agg-shards",value:m.failed>0?l("{reachable} reachable, {failed} unreachable",{failed:m.failed,reachable:m.reachable}):l("{reachable} reachable",{reachable:m.reachable})},void 0,!1),(0,t.jsxDEV)(J,{label:l("Total requests"),testId:"mt-agg-requests",value:m.totalRequests},void 0,!1),(0,t.jsxDEV)(J,{label:l("Total errors"),testId:"mt-agg-errors",value:m.totalErrors},void 0,!1),(0,t.jsxDEV)(J,{label:l("Total database size"),testId:"mt-agg-db-size",value:ze(m.totalDatabaseSize)},void 0,!1),(0,t.jsxDEV)(J,{label:l("Combined cache hit rate"),testId:"mt-agg-cache",value:m.hitRate===null?l("no cache configured"):`${(m.hitRate*100).toFixed(1)}%`},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(ee,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(le,{className:"px-0",children:(0,t.jsxDEV)(Ue,{"data-testid":"mt-agg-table",children:[(0,t.jsxDEV)(Ve,{children:(0,t.jsxDEV)(Ie,{children:[(0,t.jsxDEV)(Z,{children:l("shard")},void 0,!1),(0,t.jsxDEV)(Z,{children:l("requests")},void 0,!1),(0,t.jsxDEV)(Z,{children:l("errors")},void 0,!1),(0,t.jsxDEV)(Z,{children:l("db size")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(Ge,{children:q.map(a=>(0,t.jsxDEV)(Ie,{"data-testid":`mt-agg-row-${a.shard}`,children:[(0,t.jsxDEV)(G,{children:a.shard},void 0,!1),a.metrics===null?(0,t.jsxDEV)(G,{className:"text-destructive",colSpan:3,children:a.error??l("unreachable")},void 0,!1):(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)(G,{className:"tabular-nums",children:a.metrics.requests},void 0,!1),(0,t.jsxDEV)(G,{className:"tabular-nums",children:a.metrics.errors},void 0,!1),(0,t.jsxDEV)(G,{className:"tabular-nums",children:ze(a.metrics.databaseSize)},void 0,!1)]},void 0,!0)]},a.shard,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"MetricsPanel");export{Zt as MetricsPanel};
@@ -1 +1 @@
1
- import{a as le}from"./chunk-AITOCPML.js";import{a as Y}from"./chunk-2K47A3P6.js";import{a as Z}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as G}from"./chunk-ZQQ3MFEQ.js";import{a as ee,b as te,c as re,d as j,e as o,f as i}from"./chunk-GTM65MVX.js";import{a as z,e as Q}from"./chunk-SEU5V7I6.js";import{a as X}from"./chunk-LUP4YTBS.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as V}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as O}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as J}from"./chunk-G7ZBM54M.js";import"./chunk-LOYE7OU2.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as U}from"./chunk-TAD43CG5.js";import{d as H,p as W}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a,e as L,f as fe,g as me,h as ue,j as P}from"./chunk-RRCPZMC2.js";var ae=L(me(),1),q=L(fe(),1);var t=L(ue(),1);var he={action:"outline",mutation:"default",query:"secondary"},se=a(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"formatMs"),ve=a(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"errorCell"),pe=a(r=>{let e=r.conflicts??0;return r.calls===0?"\u2014":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},"conflictCell"),xe={calls:a((r,e)=>e.calls-r.calls,"calls"),recent:a((r,e)=>e.lastCalledAt-r.lastCalledAt,"recent"),slowest:a((r,e)=>e.maxDurationMs-r.maxDurationMs,"slowest")},Ie=a(r=>{let e=(0,ae.c)(47),{functions:I,initialShardKey:oe}=r,s=H(),[n,ie]=(0,q.useState)(oe??""),[d,ne]=(0,q.useState)("recent"),C;e[0]!==n?(C=n.trim(),e[0]=n,e[1]=C):C=e[1];let F=Y(C,400),M;e[2]===Symbol.for("react.memo_cache_sentinel")?(M={},e[2]=M):M=e[2];let T;e[3]!==F?(T={live:!0,shardKey:F},e[3]=F,e[4]=T):T=e[4];let{data:de,error:c,errorSource:N,liveError:b}=G(J.getFunctionStats,M,T),S=de?.functions??null,w;e[5]!==I?(w=new Map((I??[]).map(ge)),e[5]=I,e[6]=w):w=e[6];let K=w,E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=a(k=>{ne(k.currentTarget.dataset.sort)},"t5"),e[7]=E):E=e[7];let ce=E,$;if(e[8]!==c||e[9]!==N||e[10]!==K||e[11]!==b||e[12]!==n||e[13]!==d||e[14]!==S||e[15]!==s){let k=S===null?[]:S.toSorted(xe[d]),f;e[17]!==s?(f=s("Recent"),e[17]=s,e[18]=f):f=e[18];let m;e[19]!==f?(m={key:"recent",label:f},e[19]=f,e[20]=m):m=e[20];let u;e[21]!==s?(u=s("Most called"),e[21]=s,e[22]=u):u=e[22];let h;e[23]!==u?(h={key:"calls",label:u},e[23]=u,e[24]=h):h=e[24];let v;e[25]!==s?(v=s("Slowest"),e[25]=s,e[26]=v):v=e[26];let p;e[27]!==v?(p={key:"slowest",label:v},e[27]=v,e[28]=p):p=e[28];let A;e[29]!==h||e[30]!==p||e[31]!==m?(A=[m,h,p],e[29]=h,e[30]=p,e[31]=m,e[32]=A):A=e[32];let _=A,x;e[33]!==n?(x=(0,t.jsxDEV)(X,{onChange:ie,testId:"fs-shard-input",value:n},void 0,!1),e[33]=n,e[34]=x):x=e[34];let g;e[35]!==b?(g=(0,t.jsxDEV)(le,{message:b,prefix:"fs"},void 0,!1),e[35]=b,e[36]=g):g=e[36];let y;e[37]!==_||e[38]!==d?(y=(0,t.jsxDEV)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:_.map(l=>(0,t.jsxDEV)(V,{"data-sort":l.key,"data-testid":`fs-sort-${l.key}`,onClick:ce,size:"sm",type:"button",variant:d===l.key?"secondary":"ghost",children:l.label},l.key,!1))},void 0,!1),e[37]=_,e[38]=d,e[39]=y):y=e[39];let B;e[40]!==x||e[41]!==g||e[42]!==y?(B=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[x,g,y]},void 0,!0),e[40]=x,e[41]=g,e[42]=y,e[43]=B):B=e[43];let D;e[44]!==c||e[45]!==N?(D=c!==null&&(0,t.jsxDEV)(Z,{error:N,testId:"fs-error"},void 0,!1),e[44]=c,e[45]=N,e[46]=D):D=e[46],$=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[B,D,S!==null&&k.length===0&&c===null&&(0,t.jsxDEV)(U,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsxDEV)("path",{d:"M3 3v18h18"},void 0,!1),(0,t.jsxDEV)("path",{d:"M7 14l4-4 3 3 5-6"},void 0,!1)]},void 0,!0),testId:"fs-empty",title:s("No functions have run on this shard yet.")},void 0,!1),k.length>0&&(0,t.jsxDEV)(z,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Q,{className:"px-0",children:(0,t.jsxDEV)(ee,{"data-testid":"fs-table",children:[(0,t.jsxDEV)(te,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(o,{children:s("function")},void 0,!1),(0,t.jsxDEV)(o,{children:s("kind")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("calls")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("errors")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("conflicts")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("avg")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("max")},void 0,!1),(0,t.jsxDEV)(o,{children:s("last run")},void 0,!1),(0,t.jsxDEV)(o,{children:s("last error")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(re,{children:k.map(l=>{let R=K.get(l.path);return(0,t.jsxDEV)(j,{"data-testid":`fs-row-${l.path}`,children:[(0,t.jsxDEV)(i,{className:"font-medium",children:l.path},void 0,!1),(0,t.jsxDEV)(i,{children:R===void 0?(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1):(0,t.jsxDEV)(O,{variant:he[R],children:R},void 0,!1)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls},void 0,!1),(0,t.jsxDEV)(i,{className:P("text-right tabular-nums",l.errors>0&&"text-destructive"),children:ve(l)},void 0,!1),(0,t.jsxDEV)(i,{className:P("text-right tabular-nums",(l.conflicts??0)>0&&"text-warning"),children:pe(l)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls===0?"\u2014":se(l.totalDurationMs/l.calls)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls===0?"\u2014":se(l.maxDurationMs)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-muted-foreground",children:W(l.lastCalledAt,"\u2014")},void 0,!1),(0,t.jsxDEV)(i,{className:"max-w-[24ch] truncate text-destructive",title:l.lastErrorMessage??void 0,children:l.lastErrorMessage??(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},l.path,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[8]=c,e[9]=N,e[10]=K,e[11]=b,e[12]=n,e[13]=d,e[14]=S,e[15]=s,e[16]=$}else $=e[16];return $},"FunctionStatsPanel");function ge(r){return[r.path,r.kind]}a(ge,"_temp");export{Ie as FunctionStatsPanel};
1
+ import{a as le}from"./chunk-FQUNSQLG.js";import{a as Y}from"./chunk-2K47A3P6.js";import{a as Z}from"./chunk-D73WYMRU.js";import"./chunk-XNJNSCLM.js";import{b as G}from"./chunk-4F72YCTU.js";import{a as ee,b as te,c as re,d as j,e as o,f as i}from"./chunk-GTM65MVX.js";import{a as z,e as Q}from"./chunk-Y572GMZE.js";import{a as X}from"./chunk-FDWXYXOM.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as V}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as O}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as J}from"./chunk-EBTLTGG3.js";import"./chunk-S2G7OH5T.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as U}from"./chunk-TAD43CG5.js";import{d as H,p as W}from"./chunk-5XO36X4C.js";import"./chunk-ZXLEXF4X.js";import{a,e as L,f as fe,g as me,h as ue,j as P}from"./chunk-RRCPZMC2.js";var ae=L(me(),1),q=L(fe(),1);var t=L(ue(),1);var he={action:"outline",mutation:"default",query:"secondary"},se=a(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"formatMs"),ve=a(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"errorCell"),pe=a(r=>{let e=r.conflicts??0;return r.calls===0?"\u2014":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},"conflictCell"),xe={calls:a((r,e)=>e.calls-r.calls,"calls"),recent:a((r,e)=>e.lastCalledAt-r.lastCalledAt,"recent"),slowest:a((r,e)=>e.maxDurationMs-r.maxDurationMs,"slowest")},Ie=a(r=>{let e=(0,ae.c)(47),{functions:I,initialShardKey:oe}=r,s=H(),[n,ie]=(0,q.useState)(oe??""),[d,ne]=(0,q.useState)("recent"),C;e[0]!==n?(C=n.trim(),e[0]=n,e[1]=C):C=e[1];let F=Y(C,400),M;e[2]===Symbol.for("react.memo_cache_sentinel")?(M={},e[2]=M):M=e[2];let T;e[3]!==F?(T={live:!0,shardKey:F},e[3]=F,e[4]=T):T=e[4];let{data:de,error:c,errorSource:N,liveError:b}=G(J.getFunctionStats,M,T),S=de?.functions??null,w;e[5]!==I?(w=new Map((I??[]).map(ge)),e[5]=I,e[6]=w):w=e[6];let K=w,E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=a(k=>{ne(k.currentTarget.dataset.sort)},"t5"),e[7]=E):E=e[7];let ce=E,$;if(e[8]!==c||e[9]!==N||e[10]!==K||e[11]!==b||e[12]!==n||e[13]!==d||e[14]!==S||e[15]!==s){let k=S===null?[]:S.toSorted(xe[d]),f;e[17]!==s?(f=s("Recent"),e[17]=s,e[18]=f):f=e[18];let m;e[19]!==f?(m={key:"recent",label:f},e[19]=f,e[20]=m):m=e[20];let u;e[21]!==s?(u=s("Most called"),e[21]=s,e[22]=u):u=e[22];let h;e[23]!==u?(h={key:"calls",label:u},e[23]=u,e[24]=h):h=e[24];let v;e[25]!==s?(v=s("Slowest"),e[25]=s,e[26]=v):v=e[26];let p;e[27]!==v?(p={key:"slowest",label:v},e[27]=v,e[28]=p):p=e[28];let A;e[29]!==h||e[30]!==p||e[31]!==m?(A=[m,h,p],e[29]=h,e[30]=p,e[31]=m,e[32]=A):A=e[32];let _=A,x;e[33]!==n?(x=(0,t.jsxDEV)(X,{onChange:ie,testId:"fs-shard-input",value:n},void 0,!1),e[33]=n,e[34]=x):x=e[34];let g;e[35]!==b?(g=(0,t.jsxDEV)(le,{message:b,prefix:"fs"},void 0,!1),e[35]=b,e[36]=g):g=e[36];let y;e[37]!==_||e[38]!==d?(y=(0,t.jsxDEV)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:_.map(l=>(0,t.jsxDEV)(V,{"data-sort":l.key,"data-testid":`fs-sort-${l.key}`,onClick:ce,size:"sm",type:"button",variant:d===l.key?"secondary":"ghost",children:l.label},l.key,!1))},void 0,!1),e[37]=_,e[38]=d,e[39]=y):y=e[39];let B;e[40]!==x||e[41]!==g||e[42]!==y?(B=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[x,g,y]},void 0,!0),e[40]=x,e[41]=g,e[42]=y,e[43]=B):B=e[43];let D;e[44]!==c||e[45]!==N?(D=c!==null&&(0,t.jsxDEV)(Z,{error:N,testId:"fs-error"},void 0,!1),e[44]=c,e[45]=N,e[46]=D):D=e[46],$=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[B,D,S!==null&&k.length===0&&c===null&&(0,t.jsxDEV)(U,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsxDEV)("path",{d:"M3 3v18h18"},void 0,!1),(0,t.jsxDEV)("path",{d:"M7 14l4-4 3 3 5-6"},void 0,!1)]},void 0,!0),testId:"fs-empty",title:s("No functions have run on this shard yet.")},void 0,!1),k.length>0&&(0,t.jsxDEV)(z,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Q,{className:"px-0",children:(0,t.jsxDEV)(ee,{"data-testid":"fs-table",children:[(0,t.jsxDEV)(te,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(o,{children:s("function")},void 0,!1),(0,t.jsxDEV)(o,{children:s("kind")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("calls")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("errors")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("conflicts")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("avg")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("max")},void 0,!1),(0,t.jsxDEV)(o,{children:s("last run")},void 0,!1),(0,t.jsxDEV)(o,{children:s("last error")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(re,{children:k.map(l=>{let R=K.get(l.path);return(0,t.jsxDEV)(j,{"data-testid":`fs-row-${l.path}`,children:[(0,t.jsxDEV)(i,{className:"font-medium",children:l.path},void 0,!1),(0,t.jsxDEV)(i,{children:R===void 0?(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1):(0,t.jsxDEV)(O,{variant:he[R],children:R},void 0,!1)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls},void 0,!1),(0,t.jsxDEV)(i,{className:P("text-right tabular-nums",l.errors>0&&"text-destructive"),children:ve(l)},void 0,!1),(0,t.jsxDEV)(i,{className:P("text-right tabular-nums",(l.conflicts??0)>0&&"text-warning"),children:pe(l)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls===0?"\u2014":se(l.totalDurationMs/l.calls)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls===0?"\u2014":se(l.maxDurationMs)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-muted-foreground",children:W(l.lastCalledAt,"\u2014")},void 0,!1),(0,t.jsxDEV)(i,{className:"max-w-[24ch] truncate text-destructive",title:l.lastErrorMessage??void 0,children:l.lastErrorMessage??(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},l.path,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[8]=c,e[9]=N,e[10]=K,e[11]=b,e[12]=n,e[13]=d,e[14]=S,e[15]=s,e[16]=$}else $=e[16];return $},"FunctionStatsPanel");function ge(r){return[r.path,r.kind]}a(ge,"_temp");export{Ie as FunctionStatsPanel};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-KJJ3WM6H.js";import{a as t}from"./chunk-RRCPZMC2.js";var d=t((h,i,r)=>o(h,e=>{i(e.height>0?e:{height:r,width:e.width})}),"flooredRectObserver");export{d as a};
1
+ import{a as o}from"./chunk-VXM5H542.js";import{a as t}from"./chunk-RRCPZMC2.js";var d=t((h,i,r)=>o(h,e=>{i(e.height>0?e:{height:r,width:e.width})}),"flooredRectObserver");export{d as a};
@@ -1 +1 @@
1
- import{a as U}from"./chunk-J6J54MBP.js";import{a as G}from"./chunk-EEWKIQUE.js";import{a as Q}from"./chunk-ZQQ3MFEQ.js";import{a as W,b as H,c as K,d as F,e as p,f as x}from"./chunk-GTM65MVX.js";import{a as A,e as D}from"./chunk-SEU5V7I6.js";import{c as te}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as ee}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as P}from"./chunk-LOYE7OU2.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as R}from"./chunk-TAD43CG5.js";import{d as q,h as Y,l as V,p as j}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as f,e as M,f as oe,g as se,h as re}from"./chunk-RRCPZMC2.js";var Z=M(se(),1),z=M(oe(),1);var t=M(re(),1);var ae=M(se(),1);var X=M(oe(),1);var u=M(re(),1);var ce=f(s=>Number.isFinite(s)?j(s,"\u2014"):"\u2014","formatScheduledFor"),ie=f(s=>s.toSorted((e,c)=>e.scheduledFor-c.scheduledFor),"sortByDue"),de=f(s=>{let e=(0,ae.c)(33),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{cancelJob:n,loadJobs:m}=c,r=P(),o=q(),l=m===void 0,k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=["lunora-scheduled-jobs"],e[2]=k):k=e[2];let v;e[3]!==r||e[4]!==m?(v=f(async()=>{let d=await(m??(()=>r.listScheduledJobs()))();return ie(d)},"t3"),e[3]=r,e[4]=m,e[5]=v):v=e[5];let a=Q(k,v),[i,h]=(0,X.useState)(void 0),[S,C]=(0,X.useState)(void 0),g,T;e[6]!==r||e[7]!==l?(g=f(()=>{if(l)return r.subscribeScheduledJobs(d=>{C(void 0),h(ie(d))})},"t4"),T=[l,r],e[6]=r,e[7]=l,e[8]=g,e[9]=T):(g=e[8],T=e[9]),(0,X.useEffect)(g,T);let b;e[10]!==a?(b=f(()=>{a.refetch()},"t6"),e[10]=a,e[11]=b):b=e[11],U(b,!l);let J;e:{if(n!==void 0){J=n;break e}let d;e[12]!==r||e[13]!==m?(d=m===void 0?O=>r.cancelScheduledJob(O):void 0,e[12]=r,e[13]=m,e[14]=d):d=e[14],J=d}let y=J,w=i??a.data,$=S??a.error,I;e[15]!==y||e[16]!==a||e[17]!==l?(I=f(async d=>{if(y!==void 0){C(void 0);try{await y(d),l||a.refetch()}catch(O){C(Y(O))}}},"t8"),e[15]=y,e[16]=a,e[17]=l,e[18]=I):I=e[18];let E=I,L;e[19]!==$?(L=$!==null&&(0,u.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:$},void 0,!1),e[19]=$,e[20]=L):L=e[20];let N;e[21]!==w?.length||e[22]!==o?(N=w?.length===0&&(0,u.jsxDEV)(R,{description:o("Jobs queued with runAfter / runAt will appear here."),icon:(0,u.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,u.jsxDEV)("circle",{cx:"12",cy:"12",r:"9"},void 0,!1),(0,u.jsxDEV)("path",{d:"M12 7.5V12l4 2"},void 0,!1)]},void 0,!0),testId:"sj-empty",title:o("No scheduled jobs.")},void 0,!1),e[21]=w?.length,e[22]=o,e[23]=N):N=e[23];let B;e[24]!==E||e[25]!==y||e[26]!==w||e[27]!==o?(B=w!==void 0&&w.length>0&&(0,u.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,u.jsxDEV)(D,{className:"px-0",children:(0,u.jsxDEV)(W,{"data-testid":"sj-table",children:[(0,u.jsxDEV)(H,{children:(0,u.jsxDEV)(F,{children:[(0,u.jsxDEV)(p,{children:o("function")},void 0,!1),(0,u.jsxDEV)(p,{children:o("scheduled for")},void 0,!1),(0,u.jsxDEV)(p,{children:o("pool")},void 0,!1),(0,u.jsxDEV)(p,{children:o("attempts")},void 0,!1),(0,u.jsxDEV)(p,{children:o("shard")},void 0,!1),(0,u.jsxDEV)(p,{children:o("id")},void 0,!1),y!==void 0&&(0,u.jsxDEV)(p,{"aria-label":o("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,u.jsxDEV)(K,{children:w.map(d=>(0,u.jsxDEV)(F,{"data-testid":`sj-row-${d.id}`,children:[(0,u.jsxDEV)(x,{className:"font-mono text-xs",children:d.functionPath},void 0,!1),(0,u.jsxDEV)(x,{className:"text-muted-foreground tabular-nums",children:ce(d.scheduledFor)},void 0,!1),(0,u.jsxDEV)(x,{className:"font-mono text-xs",children:d.pool??""},void 0,!1),(0,u.jsxDEV)(x,{className:"tabular-nums",children:d.attempts??0},void 0,!1),(0,u.jsxDEV)(x,{children:d.shardKey??""},void 0,!1),(0,u.jsxDEV)(x,{className:"font-mono text-xs",children:d.id},void 0,!1),y!==void 0&&(0,u.jsxDEV)(x,{className:"text-right",children:(0,u.jsxDEV)(G,{confirmLabel:o("Cancel job?"),onConfirm:f(()=>{V(E(d.id))},"onConfirm"),testId:`sj-cancel-${d.id}`,children:o("Cancel")},void 0,!1)},void 0,!1)]},d.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[24]=E,e[25]=y,e[26]=w,e[27]=o,e[28]=B):B=e[28];let _;return e[29]!==N||e[30]!==B||e[31]!==L?(_=(0,u.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduled-jobs",children:[L,N,B]},void 0,!0),e[29]=N,e[30]=B,e[31]=L,e[32]=_):_=e[32],_},"ScheduledJobs");var fe={kind:"idle"},ue=f(({loadCronJobs:s,runCronJob:e}={})=>{let c=P(),n=q(),[m,r]=(0,z.useState)({}),o=Q(["lunora-cron-jobs",s?"custom":"default"],()=>(s??(()=>c.getCronJobs()))()),{data:l,error:k}=o,v=(0,z.useMemo)(()=>e!==void 0?e:s===void 0?i=>c.runCronJob(i):void 0,[c,s,e]),a=f(async i=>{if(v!==void 0){r(h=>({...h,[i]:{kind:"running"}}));try{await v(i),r(h=>({...h,[i]:{kind:"ok"}})),o.refetch()}catch(h){r(S=>({...S,[i]:{kind:"error",message:Y(h)}}))}}},"run");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[k!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:k},void 0,!1),l?.length===0&&(0,t.jsxDEV)(R,{description:n("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsxDEV)("circle",{cx:"12",cy:"12",r:"9"},void 0,!1),(0,t.jsxDEV)("path",{d:"M12 7.5V12l4 2"},void 0,!1)]},void 0,!0),testId:"cron-empty",title:n("No cron triggers.")},void 0,!1),l!==void 0&&l.length>0&&(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(D,{className:"px-0",children:(0,t.jsxDEV)(W,{"data-testid":"cron-table",children:[(0,t.jsxDEV)(H,{children:(0,t.jsxDEV)(F,{children:[(0,t.jsxDEV)(p,{children:n("name")},void 0,!1),(0,t.jsxDEV)(p,{children:n("schedule")},void 0,!1),(0,t.jsxDEV)(p,{children:n("target")},void 0,!1),(0,t.jsxDEV)(p,{children:n("shard")},void 0,!1),v!==void 0&&(0,t.jsxDEV)(p,{"aria-label":n("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(K,{children:l.map(i=>{let h=m[i.name]??fe;return(0,t.jsxDEV)(F,{"data-testid":`cron-row-${i.name}`,children:[(0,t.jsxDEV)(x,{children:i.name},void 0,!1),(0,t.jsxDEV)(x,{className:"font-mono text-xs tabular-nums",children:i.cron},void 0,!1),(0,t.jsxDEV)(x,{children:(0,t.jsxDEV)("span",{className:"flex items-center gap-2",children:[i.workflow===void 0?(0,t.jsxDEV)(ee,{variant:"outline",children:n("function")},void 0,!1):(0,t.jsxDEV)(ee,{variant:"secondary",children:n("workflow")},void 0,!1),(0,t.jsxDEV)("span",{className:"font-mono text-xs",children:i.workflow??i.functionPath},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(x,{children:i.shardKey??""},void 0,!1),v!==void 0&&(0,t.jsxDEV)(x,{className:"text-right",children:(0,t.jsxDEV)("span",{className:"flex items-center justify-end gap-2",children:[h.kind==="ok"&&(0,t.jsxDEV)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${i.name}`,children:n("ran")},void 0,!1),h.kind==="error"&&(0,t.jsxDEV)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${i.name}`,role:"alert",children:h.message},void 0,!1),(0,t.jsxDEV)(G,{confirmLabel:n("Run now?"),disabled:h.kind==="running",onConfirm:f(()=>{V(a(i.name))},"onConfirm"),testId:`cron-run-${i.name}`,children:h.kind==="running"?n("Running\u2026"):n("Run now")},void 0,!1)]},void 0,!0)},void 0,!1)]},`${i.cron}:${i.name}`,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"CronTriggersPanel"),he=f(s=>Number.isFinite(s)?j(s,"\u2014"):"\u2014","formatScheduledFor"),ve=f(s=>{let e=(0,Z.c)(34),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{loadJobs:n,removeJob:m,retryJob:r}=c,o=P(),l=q(),k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=["lunora-dead-jobs"],e[2]=k):k=e[2];let v;e[3]!==o||e[4]!==n?(v=f(async()=>(await(n??(()=>o.listDeadJobs()))()).toSorted(me),"t3"),e[3]=o,e[4]=n,e[5]=v):v=e[5];let a=Q(k,v),i=a.data,[h,S]=(0,z.useState)(void 0),C=a.error??h,g=n===void 0,T;e[6]!==o||e[7]!==g||e[8]!==r?(T=r??(g?d=>o.retryDeadJob(d):void 0),e[6]=o,e[7]=g,e[8]=r,e[9]=T):T=e[9];let b=T,J;e[10]!==o||e[11]!==g||e[12]!==m?(J=m??(g?d=>o.removeDeadJob(d):void 0),e[10]=o,e[11]=g,e[12]=m,e[13]=J):J=e[13];let y=J,w;e[14]!==a?(w=f(()=>{a.refetch()},"t6"),e[14]=a,e[15]=w):w=e[15],U(w,!0);let $;e[16]!==a?($=f(async d=>{S(void 0);try{await d,a.refetch()}catch(O){S(Y(O))}},"t7"),e[16]=a,e[17]=$):$=e[17];let I=$,E=b!==void 0||y!==void 0,L;e[18]!==C?(L=C!==void 0&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:C},void 0,!1),e[18]=C,e[19]=L):L=e[19];let N;e[20]!==i?.length||e[21]!==l?(N=i?.length===0&&(0,t.jsxDEV)(R,{description:l("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"},void 0,!1)},void 0,!1),testId:"dlq-empty",title:l("No dead-letter jobs.")},void 0,!1),e[20]=i?.length,e[21]=l,e[22]=N):N=e[22];let B;e[23]!==I||e[24]!==E||e[25]!==i||e[26]!==y||e[27]!==b||e[28]!==l?(B=i!==void 0&&i.length>0&&(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(D,{className:"px-0",children:(0,t.jsxDEV)(W,{"data-testid":"dlq-table",children:[(0,t.jsxDEV)(H,{children:(0,t.jsxDEV)(F,{children:[(0,t.jsxDEV)(p,{children:l("function")},void 0,!1),(0,t.jsxDEV)(p,{children:l("attempts")},void 0,!1),(0,t.jsxDEV)(p,{children:l("last tried")},void 0,!1),(0,t.jsxDEV)(p,{children:l("pool")},void 0,!1),(0,t.jsxDEV)(p,{children:l("shard")},void 0,!1),(0,t.jsxDEV)(p,{children:l("id")},void 0,!1),E&&(0,t.jsxDEV)(p,{"aria-label":l("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(K,{children:i.map(d=>(0,t.jsxDEV)(F,{"data-testid":`dlq-row-${d.id}`,children:[(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:d.functionPath},void 0,!1),(0,t.jsxDEV)(x,{className:"tabular-nums",children:d.attempts??0},void 0,!1),(0,t.jsxDEV)(x,{className:"text-muted-foreground tabular-nums",children:he(d.scheduledFor)},void 0,!1),(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:d.pool??""},void 0,!1),(0,t.jsxDEV)(x,{children:d.shardKey??""},void 0,!1),(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:d.id},void 0,!1),E&&(0,t.jsxDEV)(x,{className:"text-right",children:(0,t.jsxDEV)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsxDEV)(te,{"data-testid":`dlq-retry-${d.id}`,onClick:f(()=>{V(I(b(d.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:l("Retry")},void 0,!1),y!==void 0&&(0,t.jsxDEV)(G,{confirmLabel:l("Drop job?"),onConfirm:f(()=>{V(I(y(d.id)))},"onConfirm"),testId:`dlq-remove-${d.id}`,children:l("Drop")},void 0,!1)]},void 0,!0)},void 0,!1)]},d.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[23]=I,e[24]=E,e[25]=i,e[26]=y,e[27]=b,e[28]=l,e[29]=B):B=e[29];let _;return e[30]!==B||e[31]!==L||e[32]!==N?(_=(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[L,N,B]},void 0,!0),e[30]=B,e[31]=L,e[32]=N,e[33]=_):_=e[33],_},"DeadLetterJobs");function me(s,e){return(e.attempts??0)-(s.attempts??0)}f(me,"_temp$1");var le=f(s=>{let e=(0,Z.c)(8),{label:c,testId:n,value:m}=s,r;e[0]!==c?(r=(0,t.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:c},void 0,!1),e[0]=c,e[1]=r):r=e[1];let o;e[2]!==n||e[3]!==m?(o=(0,t.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":n,children:m},void 0,!1),e[2]=n,e[3]=m,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=(0,t.jsxDEV)(A,{className:"flex-1 py-0",children:(0,t.jsxDEV)(D,{className:"flex flex-col gap-1 p-4",children:[r,o]},void 0,!0)},void 0,!1),e[5]=r,e[6]=o,e[7]=l):l=e[7],l},"StatTile"),pe=f(s=>{let e=(0,Z.c)(25),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{loadStatus:n}=c,m=P(),r=q(),o=n===void 0,l;e[2]!==o?(l=["lunora-scheduler-status",o],e[2]=o,e[3]=l):l=e[3];let k;e[4]!==m||e[5]!==n?(k=f(async()=>{let J=await(n??(()=>m.schedulerStatus()))();return{...J,pools:J.pools.toSorted(xe)}},"t4"),e[4]=m,e[5]=n,e[6]=k):k=e[6];let v=Q(l,k),{data:a,error:i}=v,h;e[7]!==v?(h=f(()=>{v.refetch()},"t5"),e[7]=v,e[8]=h):h=e[8],U(h,!0);let S;e[9]!==i?(S=i!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:i},void 0,!1),e[9]=i,e[10]=S):S=e[10];let C;e[11]!==a||e[12]!==r?(C=a!==void 0&&(0,t.jsxDEV)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsxDEV)(le,{label:r("backlog"),testId:"pools-backlog",value:a.backlog},void 0,!1),(0,t.jsxDEV)(le,{label:r("in flight"),testId:"pools-inflight",value:a.inFlight},void 0,!1),(0,t.jsxDEV)(le,{label:r("pools"),testId:"pools-count",value:a.pools.length},void 0,!1)]},void 0,!0),e[11]=a,e[12]=r,e[13]=C):C=e[13];let g;e[14]!==a?.pools.length||e[15]!==r?(g=a?.pools.length===0&&(0,t.jsxDEV)(R,{description:r("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("path",{d:"M4 7h16M4 12h16M4 17h16"},void 0,!1)},void 0,!1),testId:"pools-empty",title:r("No workpools.")},void 0,!1),e[14]=a?.pools.length,e[15]=r,e[16]=g):g=e[16];let T;e[17]!==a||e[18]!==r?(T=a!==void 0&&a.pools.length>0&&(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(D,{className:"px-0",children:(0,t.jsxDEV)(W,{"data-testid":"pools-table",children:[(0,t.jsxDEV)(H,{children:(0,t.jsxDEV)(F,{children:[(0,t.jsxDEV)(p,{children:r("pool")},void 0,!1),(0,t.jsxDEV)(p,{children:r("queued")},void 0,!1),(0,t.jsxDEV)(p,{children:r("in flight")},void 0,!1),(0,t.jsxDEV)(p,{children:r("max concurrency")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(K,{children:a.pools.map(ge)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[17]=a,e[18]=r,e[19]=T):T=e[19];let b;return e[20]!==S||e[21]!==C||e[22]!==g||e[23]!==T?(b=(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[S,C,g,T]},void 0,!0),e[20]=S,e[21]=C,e[22]=g,e[23]=T,e[24]=b):b=e[24],b},"SchedulerPoolsPanel");function xe(s,e){return e.queued-s.queued}f(xe,"_temp");function ge(s){return(0,t.jsxDEV)(F,{"data-testid":`pools-row-${s.name}`,children:[(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:s.name},void 0,!1),(0,t.jsxDEV)(x,{className:"tabular-nums",children:s.queued},void 0,!1),(0,t.jsxDEV)(x,{className:"tabular-nums",children:[s.inFlight," / ",s.maxConcurrency]},void 0,!0),(0,t.jsxDEV)(x,{className:"tabular-nums",children:s.maxConcurrency},void 0,!1)]},s.name,!0)}f(ge,"_temp2");var be=["jobs","dead","pools","cron"],We=f(s=>{let e=(0,Z.c)(41),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{loadCronJobs:n,scheduledCancel:m,scheduledLoad:r}=c,o=q(),[l,k]=(0,z.useState)("jobs"),v;e[2]!==o?(v=o("Cron triggers"),e[2]=o,e[3]=v):v=e[3];let a;e[4]!==o?(a=o("Dead letter"),e[4]=o,e[5]=a):a=e[5];let i;e[6]!==o?(i=o("Scheduled jobs"),e[6]=o,e[7]=i):i=e[7];let h;e[8]!==o?(h=o("Pools"),e[8]=o,e[9]=h):h=e[9];let S;e[10]!==v||e[11]!==a||e[12]!==i||e[13]!==h?(S={cron:v,dead:a,jobs:i,pools:h},e[10]=v,e[11]=a,e[12]=i,e[13]=h,e[14]=S):S=e[14];let C=S,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=f(N=>{k(N.currentTarget.dataset.view)},"t7"),e[15]=g):g=e[15];let T=g,b;e[16]!==o?(b=o("Schedule view"),e[16]=o,e[17]=b):b=e[17];let J;e[18]!==l||e[19]!==C?(J=be.map(N=>(0,t.jsxDEV)(te,{"aria-selected":l===N,"data-testid":`schedule-view-${N}`,"data-view":N,onClick:T,role:"tab",size:"sm",type:"button",variant:l===N?"default":"outline",children:C[N]},N,!1)),e[18]=l,e[19]=C,e[20]=J):J=e[20];let y;e[21]!==b||e[22]!==J?(y=(0,t.jsxDEV)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:J},void 0,!1),e[21]=b,e[22]=J,e[23]=y):y=e[23];let w;e[24]!==m||e[25]!==r||e[26]!==l?(w=l==="jobs"&&(0,t.jsxDEV)(de,{cancelJob:m,loadJobs:r},void 0,!1),e[24]=m,e[25]=r,e[26]=l,e[27]=w):w=e[27];let $;e[28]!==l?($=l==="dead"&&(0,t.jsxDEV)(ve,{},void 0,!1),e[28]=l,e[29]=$):$=e[29];let I;e[30]!==l?(I=l==="pools"&&(0,t.jsxDEV)(pe,{},void 0,!1),e[30]=l,e[31]=I):I=e[31];let E;e[32]!==n||e[33]!==l?(E=l==="cron"&&(0,t.jsxDEV)(ue,{loadCronJobs:n},void 0,!1),e[32]=n,e[33]=l,e[34]=E):E=e[34];let L;return e[35]!==y||e[36]!==w||e[37]!==$||e[38]!==I||e[39]!==E?(L=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[y,w,$,I,E]},void 0,!0),e[35]=y,e[36]=w,e[37]=$,e[38]=I,e[39]=E,e[40]=L):L=e[40],L},"SchedulePanel");export{We as SchedulePanel};
1
+ import{a as U}from"./chunk-J6J54MBP.js";import{a as G}from"./chunk-WOYQG5AM.js";import{a as Q}from"./chunk-4F72YCTU.js";import{a as W,b as H,c as K,d as F,e as p,f as x}from"./chunk-GTM65MVX.js";import{a as A,e as D}from"./chunk-Y572GMZE.js";import{c as te}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as ee}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as P}from"./chunk-S2G7OH5T.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as R}from"./chunk-TAD43CG5.js";import{d as q,h as Y,l as V,p as j}from"./chunk-5XO36X4C.js";import"./chunk-ZXLEXF4X.js";import{a as f,e as M,f as oe,g as se,h as re}from"./chunk-RRCPZMC2.js";var Z=M(se(),1),z=M(oe(),1);var t=M(re(),1);var ae=M(se(),1);var X=M(oe(),1);var u=M(re(),1);var ce=f(s=>Number.isFinite(s)?j(s,"\u2014"):"\u2014","formatScheduledFor"),ie=f(s=>s.toSorted((e,c)=>e.scheduledFor-c.scheduledFor),"sortByDue"),de=f(s=>{let e=(0,ae.c)(33),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{cancelJob:n,loadJobs:m}=c,r=P(),o=q(),l=m===void 0,k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=["lunora-scheduled-jobs"],e[2]=k):k=e[2];let v;e[3]!==r||e[4]!==m?(v=f(async()=>{let d=await(m??(()=>r.listScheduledJobs()))();return ie(d)},"t3"),e[3]=r,e[4]=m,e[5]=v):v=e[5];let a=Q(k,v),[i,h]=(0,X.useState)(void 0),[S,C]=(0,X.useState)(void 0),g,T;e[6]!==r||e[7]!==l?(g=f(()=>{if(l)return r.subscribeScheduledJobs(d=>{C(void 0),h(ie(d))})},"t4"),T=[l,r],e[6]=r,e[7]=l,e[8]=g,e[9]=T):(g=e[8],T=e[9]),(0,X.useEffect)(g,T);let b;e[10]!==a?(b=f(()=>{a.refetch()},"t6"),e[10]=a,e[11]=b):b=e[11],U(b,!l);let J;e:{if(n!==void 0){J=n;break e}let d;e[12]!==r||e[13]!==m?(d=m===void 0?O=>r.cancelScheduledJob(O):void 0,e[12]=r,e[13]=m,e[14]=d):d=e[14],J=d}let y=J,w=i??a.data,$=S??a.error,I;e[15]!==y||e[16]!==a||e[17]!==l?(I=f(async d=>{if(y!==void 0){C(void 0);try{await y(d),l||a.refetch()}catch(O){C(Y(O))}}},"t8"),e[15]=y,e[16]=a,e[17]=l,e[18]=I):I=e[18];let E=I,L;e[19]!==$?(L=$!==null&&(0,u.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:$},void 0,!1),e[19]=$,e[20]=L):L=e[20];let N;e[21]!==w?.length||e[22]!==o?(N=w?.length===0&&(0,u.jsxDEV)(R,{description:o("Jobs queued with runAfter / runAt will appear here."),icon:(0,u.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,u.jsxDEV)("circle",{cx:"12",cy:"12",r:"9"},void 0,!1),(0,u.jsxDEV)("path",{d:"M12 7.5V12l4 2"},void 0,!1)]},void 0,!0),testId:"sj-empty",title:o("No scheduled jobs.")},void 0,!1),e[21]=w?.length,e[22]=o,e[23]=N):N=e[23];let B;e[24]!==E||e[25]!==y||e[26]!==w||e[27]!==o?(B=w!==void 0&&w.length>0&&(0,u.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,u.jsxDEV)(D,{className:"px-0",children:(0,u.jsxDEV)(W,{"data-testid":"sj-table",children:[(0,u.jsxDEV)(H,{children:(0,u.jsxDEV)(F,{children:[(0,u.jsxDEV)(p,{children:o("function")},void 0,!1),(0,u.jsxDEV)(p,{children:o("scheduled for")},void 0,!1),(0,u.jsxDEV)(p,{children:o("pool")},void 0,!1),(0,u.jsxDEV)(p,{children:o("attempts")},void 0,!1),(0,u.jsxDEV)(p,{children:o("shard")},void 0,!1),(0,u.jsxDEV)(p,{children:o("id")},void 0,!1),y!==void 0&&(0,u.jsxDEV)(p,{"aria-label":o("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,u.jsxDEV)(K,{children:w.map(d=>(0,u.jsxDEV)(F,{"data-testid":`sj-row-${d.id}`,children:[(0,u.jsxDEV)(x,{className:"font-mono text-xs",children:d.functionPath},void 0,!1),(0,u.jsxDEV)(x,{className:"text-muted-foreground tabular-nums",children:ce(d.scheduledFor)},void 0,!1),(0,u.jsxDEV)(x,{className:"font-mono text-xs",children:d.pool??""},void 0,!1),(0,u.jsxDEV)(x,{className:"tabular-nums",children:d.attempts??0},void 0,!1),(0,u.jsxDEV)(x,{children:d.shardKey??""},void 0,!1),(0,u.jsxDEV)(x,{className:"font-mono text-xs",children:d.id},void 0,!1),y!==void 0&&(0,u.jsxDEV)(x,{className:"text-right",children:(0,u.jsxDEV)(G,{confirmLabel:o("Cancel job?"),onConfirm:f(()=>{V(E(d.id))},"onConfirm"),testId:`sj-cancel-${d.id}`,children:o("Cancel")},void 0,!1)},void 0,!1)]},d.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[24]=E,e[25]=y,e[26]=w,e[27]=o,e[28]=B):B=e[28];let _;return e[29]!==N||e[30]!==B||e[31]!==L?(_=(0,u.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduled-jobs",children:[L,N,B]},void 0,!0),e[29]=N,e[30]=B,e[31]=L,e[32]=_):_=e[32],_},"ScheduledJobs");var fe={kind:"idle"},ue=f(({loadCronJobs:s,runCronJob:e}={})=>{let c=P(),n=q(),[m,r]=(0,z.useState)({}),o=Q(["lunora-cron-jobs",s?"custom":"default"],()=>(s??(()=>c.getCronJobs()))()),{data:l,error:k}=o,v=(0,z.useMemo)(()=>e!==void 0?e:s===void 0?i=>c.runCronJob(i):void 0,[c,s,e]),a=f(async i=>{if(v!==void 0){r(h=>({...h,[i]:{kind:"running"}}));try{await v(i),r(h=>({...h,[i]:{kind:"ok"}})),o.refetch()}catch(h){r(S=>({...S,[i]:{kind:"error",message:Y(h)}}))}}},"run");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[k!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:k},void 0,!1),l?.length===0&&(0,t.jsxDEV)(R,{description:n("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsxDEV)("circle",{cx:"12",cy:"12",r:"9"},void 0,!1),(0,t.jsxDEV)("path",{d:"M12 7.5V12l4 2"},void 0,!1)]},void 0,!0),testId:"cron-empty",title:n("No cron triggers.")},void 0,!1),l!==void 0&&l.length>0&&(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(D,{className:"px-0",children:(0,t.jsxDEV)(W,{"data-testid":"cron-table",children:[(0,t.jsxDEV)(H,{children:(0,t.jsxDEV)(F,{children:[(0,t.jsxDEV)(p,{children:n("name")},void 0,!1),(0,t.jsxDEV)(p,{children:n("schedule")},void 0,!1),(0,t.jsxDEV)(p,{children:n("target")},void 0,!1),(0,t.jsxDEV)(p,{children:n("shard")},void 0,!1),v!==void 0&&(0,t.jsxDEV)(p,{"aria-label":n("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(K,{children:l.map(i=>{let h=m[i.name]??fe;return(0,t.jsxDEV)(F,{"data-testid":`cron-row-${i.name}`,children:[(0,t.jsxDEV)(x,{children:i.name},void 0,!1),(0,t.jsxDEV)(x,{className:"font-mono text-xs tabular-nums",children:i.cron},void 0,!1),(0,t.jsxDEV)(x,{children:(0,t.jsxDEV)("span",{className:"flex items-center gap-2",children:[i.workflow===void 0?(0,t.jsxDEV)(ee,{variant:"outline",children:n("function")},void 0,!1):(0,t.jsxDEV)(ee,{variant:"secondary",children:n("workflow")},void 0,!1),(0,t.jsxDEV)("span",{className:"font-mono text-xs",children:i.workflow??i.functionPath},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(x,{children:i.shardKey??""},void 0,!1),v!==void 0&&(0,t.jsxDEV)(x,{className:"text-right",children:(0,t.jsxDEV)("span",{className:"flex items-center justify-end gap-2",children:[h.kind==="ok"&&(0,t.jsxDEV)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${i.name}`,children:n("ran")},void 0,!1),h.kind==="error"&&(0,t.jsxDEV)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${i.name}`,role:"alert",children:h.message},void 0,!1),(0,t.jsxDEV)(G,{confirmLabel:n("Run now?"),disabled:h.kind==="running",onConfirm:f(()=>{V(a(i.name))},"onConfirm"),testId:`cron-run-${i.name}`,children:h.kind==="running"?n("Running\u2026"):n("Run now")},void 0,!1)]},void 0,!0)},void 0,!1)]},`${i.cron}:${i.name}`,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"CronTriggersPanel"),he=f(s=>Number.isFinite(s)?j(s,"\u2014"):"\u2014","formatScheduledFor"),ve=f(s=>{let e=(0,Z.c)(34),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{loadJobs:n,removeJob:m,retryJob:r}=c,o=P(),l=q(),k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=["lunora-dead-jobs"],e[2]=k):k=e[2];let v;e[3]!==o||e[4]!==n?(v=f(async()=>(await(n??(()=>o.listDeadJobs()))()).toSorted(me),"t3"),e[3]=o,e[4]=n,e[5]=v):v=e[5];let a=Q(k,v),i=a.data,[h,S]=(0,z.useState)(void 0),C=a.error??h,g=n===void 0,T;e[6]!==o||e[7]!==g||e[8]!==r?(T=r??(g?d=>o.retryDeadJob(d):void 0),e[6]=o,e[7]=g,e[8]=r,e[9]=T):T=e[9];let b=T,J;e[10]!==o||e[11]!==g||e[12]!==m?(J=m??(g?d=>o.removeDeadJob(d):void 0),e[10]=o,e[11]=g,e[12]=m,e[13]=J):J=e[13];let y=J,w;e[14]!==a?(w=f(()=>{a.refetch()},"t6"),e[14]=a,e[15]=w):w=e[15],U(w,!0);let $;e[16]!==a?($=f(async d=>{S(void 0);try{await d,a.refetch()}catch(O){S(Y(O))}},"t7"),e[16]=a,e[17]=$):$=e[17];let I=$,E=b!==void 0||y!==void 0,L;e[18]!==C?(L=C!==void 0&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:C},void 0,!1),e[18]=C,e[19]=L):L=e[19];let N;e[20]!==i?.length||e[21]!==l?(N=i?.length===0&&(0,t.jsxDEV)(R,{description:l("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"},void 0,!1)},void 0,!1),testId:"dlq-empty",title:l("No dead-letter jobs.")},void 0,!1),e[20]=i?.length,e[21]=l,e[22]=N):N=e[22];let B;e[23]!==I||e[24]!==E||e[25]!==i||e[26]!==y||e[27]!==b||e[28]!==l?(B=i!==void 0&&i.length>0&&(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(D,{className:"px-0",children:(0,t.jsxDEV)(W,{"data-testid":"dlq-table",children:[(0,t.jsxDEV)(H,{children:(0,t.jsxDEV)(F,{children:[(0,t.jsxDEV)(p,{children:l("function")},void 0,!1),(0,t.jsxDEV)(p,{children:l("attempts")},void 0,!1),(0,t.jsxDEV)(p,{children:l("last tried")},void 0,!1),(0,t.jsxDEV)(p,{children:l("pool")},void 0,!1),(0,t.jsxDEV)(p,{children:l("shard")},void 0,!1),(0,t.jsxDEV)(p,{children:l("id")},void 0,!1),E&&(0,t.jsxDEV)(p,{"aria-label":l("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(K,{children:i.map(d=>(0,t.jsxDEV)(F,{"data-testid":`dlq-row-${d.id}`,children:[(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:d.functionPath},void 0,!1),(0,t.jsxDEV)(x,{className:"tabular-nums",children:d.attempts??0},void 0,!1),(0,t.jsxDEV)(x,{className:"text-muted-foreground tabular-nums",children:he(d.scheduledFor)},void 0,!1),(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:d.pool??""},void 0,!1),(0,t.jsxDEV)(x,{children:d.shardKey??""},void 0,!1),(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:d.id},void 0,!1),E&&(0,t.jsxDEV)(x,{className:"text-right",children:(0,t.jsxDEV)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsxDEV)(te,{"data-testid":`dlq-retry-${d.id}`,onClick:f(()=>{V(I(b(d.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:l("Retry")},void 0,!1),y!==void 0&&(0,t.jsxDEV)(G,{confirmLabel:l("Drop job?"),onConfirm:f(()=>{V(I(y(d.id)))},"onConfirm"),testId:`dlq-remove-${d.id}`,children:l("Drop")},void 0,!1)]},void 0,!0)},void 0,!1)]},d.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[23]=I,e[24]=E,e[25]=i,e[26]=y,e[27]=b,e[28]=l,e[29]=B):B=e[29];let _;return e[30]!==B||e[31]!==L||e[32]!==N?(_=(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[L,N,B]},void 0,!0),e[30]=B,e[31]=L,e[32]=N,e[33]=_):_=e[33],_},"DeadLetterJobs");function me(s,e){return(e.attempts??0)-(s.attempts??0)}f(me,"_temp$1");var le=f(s=>{let e=(0,Z.c)(8),{label:c,testId:n,value:m}=s,r;e[0]!==c?(r=(0,t.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:c},void 0,!1),e[0]=c,e[1]=r):r=e[1];let o;e[2]!==n||e[3]!==m?(o=(0,t.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":n,children:m},void 0,!1),e[2]=n,e[3]=m,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=(0,t.jsxDEV)(A,{className:"flex-1 py-0",children:(0,t.jsxDEV)(D,{className:"flex flex-col gap-1 p-4",children:[r,o]},void 0,!0)},void 0,!1),e[5]=r,e[6]=o,e[7]=l):l=e[7],l},"StatTile"),pe=f(s=>{let e=(0,Z.c)(25),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{loadStatus:n}=c,m=P(),r=q(),o=n===void 0,l;e[2]!==o?(l=["lunora-scheduler-status",o],e[2]=o,e[3]=l):l=e[3];let k;e[4]!==m||e[5]!==n?(k=f(async()=>{let J=await(n??(()=>m.schedulerStatus()))();return{...J,pools:J.pools.toSorted(xe)}},"t4"),e[4]=m,e[5]=n,e[6]=k):k=e[6];let v=Q(l,k),{data:a,error:i}=v,h;e[7]!==v?(h=f(()=>{v.refetch()},"t5"),e[7]=v,e[8]=h):h=e[8],U(h,!0);let S;e[9]!==i?(S=i!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:i},void 0,!1),e[9]=i,e[10]=S):S=e[10];let C;e[11]!==a||e[12]!==r?(C=a!==void 0&&(0,t.jsxDEV)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsxDEV)(le,{label:r("backlog"),testId:"pools-backlog",value:a.backlog},void 0,!1),(0,t.jsxDEV)(le,{label:r("in flight"),testId:"pools-inflight",value:a.inFlight},void 0,!1),(0,t.jsxDEV)(le,{label:r("pools"),testId:"pools-count",value:a.pools.length},void 0,!1)]},void 0,!0),e[11]=a,e[12]=r,e[13]=C):C=e[13];let g;e[14]!==a?.pools.length||e[15]!==r?(g=a?.pools.length===0&&(0,t.jsxDEV)(R,{description:r("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("path",{d:"M4 7h16M4 12h16M4 17h16"},void 0,!1)},void 0,!1),testId:"pools-empty",title:r("No workpools.")},void 0,!1),e[14]=a?.pools.length,e[15]=r,e[16]=g):g=e[16];let T;e[17]!==a||e[18]!==r?(T=a!==void 0&&a.pools.length>0&&(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(D,{className:"px-0",children:(0,t.jsxDEV)(W,{"data-testid":"pools-table",children:[(0,t.jsxDEV)(H,{children:(0,t.jsxDEV)(F,{children:[(0,t.jsxDEV)(p,{children:r("pool")},void 0,!1),(0,t.jsxDEV)(p,{children:r("queued")},void 0,!1),(0,t.jsxDEV)(p,{children:r("in flight")},void 0,!1),(0,t.jsxDEV)(p,{children:r("max concurrency")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(K,{children:a.pools.map(ge)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[17]=a,e[18]=r,e[19]=T):T=e[19];let b;return e[20]!==S||e[21]!==C||e[22]!==g||e[23]!==T?(b=(0,t.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[S,C,g,T]},void 0,!0),e[20]=S,e[21]=C,e[22]=g,e[23]=T,e[24]=b):b=e[24],b},"SchedulerPoolsPanel");function xe(s,e){return e.queued-s.queued}f(xe,"_temp");function ge(s){return(0,t.jsxDEV)(F,{"data-testid":`pools-row-${s.name}`,children:[(0,t.jsxDEV)(x,{className:"font-mono text-xs",children:s.name},void 0,!1),(0,t.jsxDEV)(x,{className:"tabular-nums",children:s.queued},void 0,!1),(0,t.jsxDEV)(x,{className:"tabular-nums",children:[s.inFlight," / ",s.maxConcurrency]},void 0,!0),(0,t.jsxDEV)(x,{className:"tabular-nums",children:s.maxConcurrency},void 0,!1)]},s.name,!0)}f(ge,"_temp2");var be=["jobs","dead","pools","cron"],We=f(s=>{let e=(0,Z.c)(41),c;e[0]!==s?(c=s===void 0?{}:s,e[0]=s,e[1]=c):c=e[1];let{loadCronJobs:n,scheduledCancel:m,scheduledLoad:r}=c,o=q(),[l,k]=(0,z.useState)("jobs"),v;e[2]!==o?(v=o("Cron triggers"),e[2]=o,e[3]=v):v=e[3];let a;e[4]!==o?(a=o("Dead letter"),e[4]=o,e[5]=a):a=e[5];let i;e[6]!==o?(i=o("Scheduled jobs"),e[6]=o,e[7]=i):i=e[7];let h;e[8]!==o?(h=o("Pools"),e[8]=o,e[9]=h):h=e[9];let S;e[10]!==v||e[11]!==a||e[12]!==i||e[13]!==h?(S={cron:v,dead:a,jobs:i,pools:h},e[10]=v,e[11]=a,e[12]=i,e[13]=h,e[14]=S):S=e[14];let C=S,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=f(N=>{k(N.currentTarget.dataset.view)},"t7"),e[15]=g):g=e[15];let T=g,b;e[16]!==o?(b=o("Schedule view"),e[16]=o,e[17]=b):b=e[17];let J;e[18]!==l||e[19]!==C?(J=be.map(N=>(0,t.jsxDEV)(te,{"aria-selected":l===N,"data-testid":`schedule-view-${N}`,"data-view":N,onClick:T,role:"tab",size:"sm",type:"button",variant:l===N?"default":"outline",children:C[N]},N,!1)),e[18]=l,e[19]=C,e[20]=J):J=e[20];let y;e[21]!==b||e[22]!==J?(y=(0,t.jsxDEV)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:J},void 0,!1),e[21]=b,e[22]=J,e[23]=y):y=e[23];let w;e[24]!==m||e[25]!==r||e[26]!==l?(w=l==="jobs"&&(0,t.jsxDEV)(de,{cancelJob:m,loadJobs:r},void 0,!1),e[24]=m,e[25]=r,e[26]=l,e[27]=w):w=e[27];let $;e[28]!==l?($=l==="dead"&&(0,t.jsxDEV)(ve,{},void 0,!1),e[28]=l,e[29]=$):$=e[29];let I;e[30]!==l?(I=l==="pools"&&(0,t.jsxDEV)(pe,{},void 0,!1),e[30]=l,e[31]=I):I=e[31];let E;e[32]!==n||e[33]!==l?(E=l==="cron"&&(0,t.jsxDEV)(ue,{loadCronJobs:n},void 0,!1),e[32]=n,e[33]=l,e[34]=E):E=e[34];let L;return e[35]!==y||e[36]!==w||e[37]!==$||e[38]!==I||e[39]!==E?(L=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[y,w,$,I,E]},void 0,!0),e[35]=y,e[36]=w,e[37]=$,e[38]=I,e[39]=E,e[40]=L):L=e[40],L},"SchedulePanel");export{We as SchedulePanel};
@@ -1 +1 @@
1
- import{b as $}from"./chunk-TQ36RWOP.js";import{a as M}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-ZQQ3MFEQ.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as K,e as O}from"./chunk-SEU5V7I6.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as j}from"./chunk-G7ZBM54M.js";import"./chunk-LOYE7OU2.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(a=>{let e=(0,q.c)(68),{initialShardKey:z}=a,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let i;e[12]!==s.workerUrl||e[13]!==l?(i={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=i):i=e[14],o.push(i)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let i;e[17]!==s.environment||e[18]!==l?(i={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=i):i=e[19],o.push(i)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let i;e[22]!==s.deploymentId||e[23]!==l?(i={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=i):i=e[24],o.push(i)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let i;e[27]!==s.versionTag||e[28]!==l?(i={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=i):i=e[29],o.push(i)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(a){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:a.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:a.value,children:a.value},void 0,!1)]},a.label,!0)}U(Z,"_temp");function ee(a){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:a.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[a.kind],children:a.bindingType??a.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:a.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
1
+ import{b as $}from"./chunk-IYHPYY4A.js";import{a as M}from"./chunk-D73WYMRU.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-4F72YCTU.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as K,e as O}from"./chunk-Y572GMZE.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as j}from"./chunk-EBTLTGG3.js";import"./chunk-S2G7OH5T.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-5XO36X4C.js";import"./chunk-ZXLEXF4X.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(i=>{let e=(0,q.c)(68),{initialShardKey:z}=i,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let a;e[12]!==s.workerUrl||e[13]!==l?(a={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=a):a=e[14],o.push(a)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let a;e[17]!==s.environment||e[18]!==l?(a={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=a):a=e[19],o.push(a)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let a;e[22]!==s.deploymentId||e[23]!==l?(a={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=a):a=e[24],o.push(a)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let a;e[27]!==s.versionTag||e[28]!==l?(a={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=a):a=e[29],o.push(a)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(i){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:i.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:i.value,children:i.value},void 0,!1)]},i.label,!0)}U(Z,"_temp");function ee(i){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:i.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[i.kind],children:i.bindingType??i.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:i.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},i.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
@@ -1 +1 @@
1
- import{a as H}from"./chunk-VLXV72QE.js";import{a as v}from"./chunk-JSEXCW5Q.js";import{a as q}from"./chunk-LUP4YTBS.js";import{b as V}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as B}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as p}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as S}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as z}from"./chunk-G7ZBM54M.js";import{f as L}from"./chunk-LOYE7OU2.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as j,e as K,f as U,h as J,l as M,p as P}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a,e as D,f as ne,h as ie}from"./chunk-RRCPZMC2.js";var n=D(ne(),1);var e=D(ie(),1);var de=a(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"argumentType"),le=a(r=>r===void 0||r.length===0?"()":`(${r.map(i=>`${i.name}${i.optional?"?":""}: ${de(i)}`).join(", ")})`,"formatSignature"),ce=a(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"placeholderValue"),ue=a(r=>{let i={};for(let s of r??[])s.optional||(i[s.name]=ce(s.kind));return JSON.stringify(i,void 0,2)},"argumentsTemplate"),fe=U(z.runAs),me=10,he=a(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"formatResult"),Ae=a(({functions:r,runAsIdentity:i=!1}={})=>{let s=j(),u=L(),[X,Y]=(0,n.useState)(null),[w,G]=(0,n.useState)(null),g=r??X??[],[R,I]=(0,n.useState)(""),[f,x]=(0,n.useState)("{}"),[c,k]=(0,n.useState)(""),[m,Q]=(0,n.useState)(""),[b,h]=(0,n.useState)("idle"),[W,N]=(0,n.useState)(void 0),[A,y]=(0,n.useState)(null),[C,Z]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(r!==void 0)return;let t=!1;return u.listFunctions().then(d=>(t||Y(d),d)).catch(d=>{t||G(J(d))}),()=>{t=!0}},[u,r]);let T=R===""?g[0]?.path??"":R,o=g.find(t=>t.path===T),_=a(async()=>{if(!o)return;let t;try{t=f.trim()===""?{}:JSON.parse(f)}catch(l){h("error"),N(void 0),y(s("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:o.path},F=c.trim()===""?{}:{shardKey:c.trim()},$=i?m.trim():"",E=a(l=>{Z(O=>[{argsText:f,at:Date.now(),id:(O[0]?.id??0)+1,kind:o.kind,path:o.path,shardKey:c,status:l},...O].slice(0,me))},"record");h("running"),y(null);try{let l=$===""?await K(u,o.kind,d,t,F):await u.query(fe,{args:t,functionPath:o.path,userId:$},F);V(c),N(l),h("success"),E("success")}catch(l){N(void 0),y(l.message),h("error"),E("error")}},"run"),ee=a(t=>{I(t.path),x(t.argsText),k(t.shardKey)},"loadRun"),te=a(t=>{I(t.target.value)},"onSelectChange"),re=a(t=>{x(t.target.value)},"onArgsChange"),se=a(t=>{Q(t.target.value)},"onRunAsChange"),ae=a(()=>{M(_())},"runOnce"),oe=a(()=>{x(ue(o?.args))},"prefillArgs");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[w!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:w},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxDEV)(v,{htmlFor:"function-select",children:s("Function")},void 0,!1),(0,e.jsxDEV)("select",{"aria-label":s("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:T,children:g.map(t=>(0,e.jsxDEV)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path,!0))},void 0,!1),o!==void 0&&(0,e.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsxDEV)("span",{className:"mr-1.5 font-medium",children:s("Signature")},void 0,!1),(0,e.jsxDEV)("code",{className:"font-mono","data-testid":"function-signature",children:le(o.args)},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxDEV)(v,{htmlFor:"args-input",children:s("Arguments")},void 0,!1),(0,e.jsxDEV)(p,{"data-testid":"prefill-button",disabled:o===void 0,onClick:oe,size:"xs",type:"button",variant:"ghost",children:s("Prefill")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(H,{"aria-label":s("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:f},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(q,{onChange:k,testId:"shard-input",value:c},void 0,!1),i&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsxDEV)(v,{htmlFor:"run-as-input",children:s("Run as identity (userId)")},void 0,!1),(0,e.jsxDEV)(B,{"aria-label":s("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:se,placeholder:s("Leave empty to run as admin"),value:m},void 0,!1),(0,e.jsxDEV)("p",{className:"text-[11px] text-muted-foreground",children:s("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(p,{"data-testid":"run-button",disabled:b==="running"||o===void 0,onClick:ae,type:"button",children:s("Run")},void 0,!1),o!==void 0&&(0,e.jsxDEV)(S,{variant:"outline",children:o.kind},void 0,!1),i&&m.trim()!==""&&(0,e.jsxDEV)(S,{"data-testid":"run-as-badge",variant:"secondary",children:s("as {userId}",{userId:m.trim()})},void 0,!1)]},void 0,!0)]},void 0,!0),b==="error"&&A!==null&&(0,e.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:A},void 0,!1),b==="success"&&(0,e.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:he(W)},void 0,!1),C.length>0&&(0,e.jsxDEV)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:C.map((t,d)=>(0,e.jsxDEV)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsxDEV)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"},void 0,!1)," ",(0,e.jsxDEV)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]},void 0,!0)," ",(0,e.jsxDEV)("time",{className:"text-xs text-muted-foreground",children:P(t.at)},void 0,!1)," ",(0,e.jsxDEV)(p,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:a(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Load")},void 0,!1)]},t.id,!0))},void 0,!1)]},void 0,!0)},"FunctionRunner");export{Ae as FunctionRunner};
1
+ import{a as H}from"./chunk-VLXV72QE.js";import{a as v}from"./chunk-JSEXCW5Q.js";import{a as q}from"./chunk-FDWXYXOM.js";import{b as V}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as B}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as p}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as S}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as z}from"./chunk-EBTLTGG3.js";import{f as L}from"./chunk-S2G7OH5T.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as j,e as K,f as U,h as J,l as M,p as P}from"./chunk-5XO36X4C.js";import"./chunk-ZXLEXF4X.js";import{a,e as D,f as ne,h as ie}from"./chunk-RRCPZMC2.js";var n=D(ne(),1);var e=D(ie(),1);var de=a(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"argumentType"),le=a(r=>r===void 0||r.length===0?"()":`(${r.map(i=>`${i.name}${i.optional?"?":""}: ${de(i)}`).join(", ")})`,"formatSignature"),ce=a(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"placeholderValue"),ue=a(r=>{let i={};for(let s of r??[])s.optional||(i[s.name]=ce(s.kind));return JSON.stringify(i,void 0,2)},"argumentsTemplate"),fe=U(z.runAs),me=10,he=a(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"formatResult"),Ae=a(({functions:r,runAsIdentity:i=!1}={})=>{let s=j(),u=L(),[X,Y]=(0,n.useState)(null),[w,G]=(0,n.useState)(null),g=r??X??[],[R,I]=(0,n.useState)(""),[f,x]=(0,n.useState)("{}"),[c,k]=(0,n.useState)(""),[m,Q]=(0,n.useState)(""),[b,h]=(0,n.useState)("idle"),[W,N]=(0,n.useState)(void 0),[A,y]=(0,n.useState)(null),[C,Z]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(r!==void 0)return;let t=!1;return u.listFunctions().then(d=>(t||Y(d),d)).catch(d=>{t||G(J(d))}),()=>{t=!0}},[u,r]);let T=R===""?g[0]?.path??"":R,o=g.find(t=>t.path===T),_=a(async()=>{if(!o)return;let t;try{t=f.trim()===""?{}:JSON.parse(f)}catch(l){h("error"),N(void 0),y(s("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:o.path},F=c.trim()===""?{}:{shardKey:c.trim()},$=i?m.trim():"",E=a(l=>{Z(O=>[{argsText:f,at:Date.now(),id:(O[0]?.id??0)+1,kind:o.kind,path:o.path,shardKey:c,status:l},...O].slice(0,me))},"record");h("running"),y(null);try{let l=$===""?await K(u,o.kind,d,t,F):await u.query(fe,{args:t,functionPath:o.path,userId:$},F);V(c),N(l),h("success"),E("success")}catch(l){N(void 0),y(l.message),h("error"),E("error")}},"run"),ee=a(t=>{I(t.path),x(t.argsText),k(t.shardKey)},"loadRun"),te=a(t=>{I(t.target.value)},"onSelectChange"),re=a(t=>{x(t.target.value)},"onArgsChange"),se=a(t=>{Q(t.target.value)},"onRunAsChange"),ae=a(()=>{M(_())},"runOnce"),oe=a(()=>{x(ue(o?.args))},"prefillArgs");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[w!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:w},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxDEV)(v,{htmlFor:"function-select",children:s("Function")},void 0,!1),(0,e.jsxDEV)("select",{"aria-label":s("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:T,children:g.map(t=>(0,e.jsxDEV)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path,!0))},void 0,!1),o!==void 0&&(0,e.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsxDEV)("span",{className:"mr-1.5 font-medium",children:s("Signature")},void 0,!1),(0,e.jsxDEV)("code",{className:"font-mono","data-testid":"function-signature",children:le(o.args)},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxDEV)(v,{htmlFor:"args-input",children:s("Arguments")},void 0,!1),(0,e.jsxDEV)(p,{"data-testid":"prefill-button",disabled:o===void 0,onClick:oe,size:"xs",type:"button",variant:"ghost",children:s("Prefill")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(H,{"aria-label":s("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:f},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(q,{onChange:k,testId:"shard-input",value:c},void 0,!1),i&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsxDEV)(v,{htmlFor:"run-as-input",children:s("Run as identity (userId)")},void 0,!1),(0,e.jsxDEV)(B,{"aria-label":s("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:se,placeholder:s("Leave empty to run as admin"),value:m},void 0,!1),(0,e.jsxDEV)("p",{className:"text-[11px] text-muted-foreground",children:s("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(p,{"data-testid":"run-button",disabled:b==="running"||o===void 0,onClick:ae,type:"button",children:s("Run")},void 0,!1),o!==void 0&&(0,e.jsxDEV)(S,{variant:"outline",children:o.kind},void 0,!1),i&&m.trim()!==""&&(0,e.jsxDEV)(S,{"data-testid":"run-as-badge",variant:"secondary",children:s("as {userId}",{userId:m.trim()})},void 0,!1)]},void 0,!0)]},void 0,!0),b==="error"&&A!==null&&(0,e.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:A},void 0,!1),b==="success"&&(0,e.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:he(W)},void 0,!1),C.length>0&&(0,e.jsxDEV)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:C.map((t,d)=>(0,e.jsxDEV)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsxDEV)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"},void 0,!1)," ",(0,e.jsxDEV)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]},void 0,!0)," ",(0,e.jsxDEV)("time",{className:"text-xs text-muted-foreground",children:P(t.at)},void 0,!1)," ",(0,e.jsxDEV)(p,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:a(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Load")},void 0,!1)]},t.id,!0))},void 0,!1)]},void 0,!0)},"FunctionRunner");export{Ae as FunctionRunner};