adonisjs-server-stats 1.12.0 → 1.12.2

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 (57) hide show
  1. package/README.md +19 -1
  2. package/dist/core/api-client.d.ts +1 -1
  3. package/dist/core/index.js +1 -1
  4. package/dist/react/{CacheSection-DZFOiOYH.js → CacheSection-CX2duJuc.js} +1 -1
  5. package/dist/react/{CacheTab-D8js5o69.js → CacheTab-CgT4t0oZ.js} +1 -1
  6. package/dist/react/{ConfigSection-DoJmvNkF.js → ConfigSection-Dt0FyeaW.js} +1 -1
  7. package/dist/react/{ConfigTab-CDvljuBF.js → ConfigTab-KtiTtsrj.js} +1 -1
  8. package/dist/react/{CustomPaneTab-Db9eIQ-9.js → CustomPaneTab-15QoEplP.js} +1 -1
  9. package/dist/react/{EmailsTab-BITuGTQm.js → EmailsTab-CUjubln_.js} +2 -2
  10. package/dist/react/{EventsSection-7mDZv70I.js → EventsSection-GGPoYSNv.js} +1 -1
  11. package/dist/react/{EventsTab-DF13BChE.js → EventsTab-Wdwr0_ny.js} +1 -1
  12. package/dist/react/{JobsSection-B_VJFWy6.js → JobsSection-BqqIh_DR.js} +1 -1
  13. package/dist/react/{JobsTab-DK8Fl9nz.js → JobsTab-CBrU-ryL.js} +1 -1
  14. package/dist/react/{LogEntryRow-Bdie9SFe.js → LogEntryRow-BOrRkhRU.js} +1 -1
  15. package/dist/react/{LogsSection-CrWqxWRr.js → LogsSection-Cm_lphM6.js} +2 -2
  16. package/dist/react/{LogsTab-DYSpL637.js → LogsTab-jKwv9G7Q.js} +2 -2
  17. package/dist/react/{OverviewSection-CuaccMZt.js → OverviewSection-XF7bakyM.js} +1 -1
  18. package/dist/react/QueriesSection-DsQBKrNK.js +123 -0
  19. package/dist/react/QueriesTab-CxCC1GVq.js +87 -0
  20. package/dist/react/{RequestsSection-mENyeNsk.js → RequestsSection-D8cMbZU0.js} +2 -2
  21. package/dist/react/{RoutesSection-DjovlaNS.js → RoutesSection-D0y5JQP4.js} +1 -1
  22. package/dist/react/{RoutesTab-CbQECiUc.js → RoutesTab-Y_alJVMV.js} +1 -1
  23. package/dist/react/{SplitPaneWrapper-DyRyH5Re.js → SplitPaneWrapper-CZl1ouIT.js} +1 -1
  24. package/dist/react/{TimelineTab-BKTFbsPe.js → TimelineTab-HyqZpfbp.js} +2 -2
  25. package/dist/react/{index-CAUHa8QX.js → index-CsprmgzI.js} +2 -2
  26. package/dist/react/index.js +1 -1
  27. package/dist/src/edge/client/dashboard.js +2 -2
  28. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  29. package/dist/src/edge/client/stats-bar.js +1 -1
  30. package/dist/src/edge/client-vue/dashboard.js +3 -3
  31. package/dist/src/edge/client-vue/debug-panel-deferred.js +1 -1
  32. package/dist/src/edge/client-vue/stats-bar.js +1 -1
  33. package/dist/src/provider/auth_middleware_detector.d.ts +12 -6
  34. package/dist/src/provider/auth_middleware_detector.js +53 -6
  35. package/dist/src/provider/boot_helpers.d.ts +1 -0
  36. package/dist/src/provider/boot_helpers.js +7 -1
  37. package/dist/src/provider/server_stats_provider.js +2 -1
  38. package/dist/src/routes/no_session_middleware.d.ts +14 -0
  39. package/dist/src/routes/no_session_middleware.js +16 -0
  40. package/dist/src/routes/register_routes.js +5 -1
  41. package/dist/vue/{CacheSection-Bx41lpfK.js → CacheSection-DRqV3YX2.js} +1 -1
  42. package/dist/vue/{ConfigSection-fkfUdCmx.js → ConfigSection-C6pQCHAL.js} +1 -1
  43. package/dist/vue/{EmailsSection-CbcDKF9Q.js → EmailsSection-BTNw3ZU2.js} +1 -1
  44. package/dist/vue/{EmailsTab-CNyEODVB.js → EmailsTab-CwIF1fik.js} +1 -1
  45. package/dist/vue/{EventsSection-CWbTYOBi.js → EventsSection-BpgkWIwM.js} +1 -1
  46. package/dist/vue/{JobsSection-CGGO6rtS.js → JobsSection-DrghFEKL.js} +1 -1
  47. package/dist/vue/{LogsSection-BPB-C-XA.js → LogsSection-BDxx9Bfi.js} +1 -1
  48. package/dist/vue/{OverviewSection-BTcnPeoM.js → OverviewSection-BAgZTPjY.js} +1 -1
  49. package/dist/vue/{QueriesSection-2SE3igQJ.js → QueriesSection-CUpwhp7u.js} +127 -115
  50. package/dist/vue/{RequestsSection-DXcG5Zok.js → RequestsSection-D8P2xpF2.js} +1 -1
  51. package/dist/vue/{RoutesSection-BkNGWdoP.js → RoutesSection-0qB81hTT.js} +1 -1
  52. package/dist/vue/{index-CptF6Qbp.js → index-30jLw-_w.js} +2 -2
  53. package/dist/vue/index.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/react/QueriesSection-CvGGh5Ij.js +0 -117
  56. package/dist/react/QueriesTab-C7CCwhVc.js +0 -87
  57. package/dist/react/{EmailsSection-D7oxvAjA.js → EmailsSection-YcJYR5eA.js} +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";var se,$,qe,Q,Ve,We,Je,Ke,$e,ke,Ce,le={},ie=[],cn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function z(e,n){for(var r in n)e[r]=n[r];return e}function Se(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ae(e,n,r){var s,l,i,o={};for(i in n)i=="key"?s=n[i]:i=="ref"?l=n[i]:o[i]=n[i];if(arguments.length>2&&(o.children=arguments.length>3?se.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return oe(e,o,s,l,null)}function oe(e,n,r,s,l){var i={type:e,props:n,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++qe,__i:-1,__u:0};return l==null&&$.vnode!=null&&$.vnode(i),i}function E(e){return e.children}function q(e,n){this.props=e,this.context=n}function G(e,n){if(n==null)return e.__?G(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?G(e):null}function dn(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,s=[],l=[],i=z({},n);i.__v=n.__v+1,$.vnode&&$.vnode(i),Te(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??G(n),!!(32&n.__u),l),i.__v=n.__v,i.__.__k[i.__i]=i,tt(s,i,l),n.__e=n.__=null,i.__e!=r&&Qe(i)}}function Qe(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Qe(e)}function Ge(e){(!e.__d&&(e.__d=!0)&&Q.push(e)&&!ce.__r++||Ve!=$.debounceRendering)&&((Ve=$.debounceRendering)||We)(ce)}function ce(){for(var e,n=1;Q.length;)Q.length>n&&Q.sort(Je),e=Q.shift(),n=Q.length,dn(e);ce.__r=0}function Ye(e,n,r,s,l,i,o,c,u,d,h){var a,p,f,m,y,v,g,_=s&&s.__k||ie,w=n.length;for(u=un(r,n,_,u,w),a=0;a<w;a++)(f=r.__k[a])!=null&&(p=f.__i!=-1&&_[f.__i]||le,f.__i=a,v=Te(e,f,p,l,i,o,c,u,d,h),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Ee(p.ref,null,f),h.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),(g=!!(4&f.__u))||p.__k===f.__k?u=Xe(f,u,e,g):typeof f.type=="function"&&v!==void 0?u=v:m&&(u=m.nextSibling),f.__u&=-7);return r.__e=y,u}function un(e,n,r,s,l){var i,o,c,u,d,h=r.length,a=h,p=0;for(e.__k=new Array(l),i=0;i<l;i++)(o=n[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[i]=oe(null,o,null,null,null):Y(o)?o=e.__k[i]=oe(E,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[i]=oe(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[i]=o,u=i+p,o.__=e,o.__b=e.__b+1,c=null,(d=o.__i=hn(o,r,u,a))!=-1&&(a--,(c=r[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(l>h?p--:l<h&&p++),typeof o.type!="function"&&(o.__u|=4)):d!=u&&(d==u-1?p--:d==u+1?p++:(d>u?p--:p++,o.__u|=4))):e.__k[i]=null;if(a)for(i=0;i<h;i++)(c=r[i])!=null&&(2&c.__u)==0&&(c.__e==s&&(s=G(c)),rt(c,c));return s}function Xe(e,n,r,s){var l,i;if(typeof e.type=="function"){for(l=e.__k,i=0;l&&i<l.length;i++)l[i]&&(l[i].__=e,n=Xe(l[i],n,r,s));return n}e.__e!=n&&(s&&(n&&e.type&&!n.parentNode&&(n=G(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function de(e,n){return n=n||[],e==null||typeof e=="boolean"||(Y(e)?e.some(function(r){de(r,n)}):n.push(e)),n}function hn(e,n,r,s){var l,i,o,c=e.key,u=e.type,d=n[r],h=d!=null&&(2&d.__u)==0;if(d===null&&c==null||h&&c==d.key&&u==d.type)return r;if(s>(h?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((d=n[o=l>=0?l--:i++])!=null&&(2&d.__u)==0&&c==d.key&&u==d.type)return o}return-1}function Ze(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||cn.test(n)?r:r+"px"}function ue(e,n,r,s,l){var i,o;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(n in s)r&&n in r||Ze(e.style,n,"");if(r)for(n in r)s&&r[n]==s[n]||Ze(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")i=n!=(n=n.replace(Ke,"$1")),o=n.toLowerCase(),n=o in e||n=="onFocusOut"||n=="onFocusIn"?o.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=r,r?s?r.u=s.u:(r.u=$e,e.addEventListener(n,i?Ce:ke,i)):e.removeEventListener(n,i?Ce:ke,i);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function et(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=$e++;else if(n.t<r.u)return;return r($.event?$.event(n):n)}}}function Te(e,n,r,s,l,i,o,c,u,d){var h,a,p,f,m,y,v,g,_,w,N,b,k,L,O,M=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),i=[c=n.__e=r.__e]),(h=$.__b)&&h(n);e:if(typeof M=="function")try{if(g=n.props,_="prototype"in M&&M.prototype.render,w=(h=M.contextType)&&s[h.__c],N=h?w?w.props.value:h.__:s,r.__c?v=(a=n.__c=r.__c).__=a.__E:(_?n.__c=a=new M(g,N):(n.__c=a=new q(g,N),a.constructor=M,a.render=pn),w&&w.sub(a),a.state||(a.state={}),a.__n=s,p=a.__d=!0,a.__h=[],a._sb=[]),_&&a.__s==null&&(a.__s=a.state),_&&M.getDerivedStateFromProps!=null&&(a.__s==a.state&&(a.__s=z({},a.__s)),z(a.__s,M.getDerivedStateFromProps(g,a.__s))),f=a.props,m=a.state,a.__v=n,p)_&&M.getDerivedStateFromProps==null&&a.componentWillMount!=null&&a.componentWillMount(),_&&a.componentDidMount!=null&&a.__h.push(a.componentDidMount);else{if(_&&M.getDerivedStateFromProps==null&&g!==f&&a.componentWillReceiveProps!=null&&a.componentWillReceiveProps(g,N),n.__v==r.__v||!a.__e&&a.shouldComponentUpdate!=null&&a.shouldComponentUpdate(g,a.__s,N)===!1){n.__v!=r.__v&&(a.props=g,a.state=a.__s,a.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(S){S&&(S.__=n)}),ie.push.apply(a.__h,a._sb),a._sb=[],a.__h.length&&o.push(a);break e}a.componentWillUpdate!=null&&a.componentWillUpdate(g,a.__s,N),_&&a.componentDidUpdate!=null&&a.__h.push(function(){a.componentDidUpdate(f,m,y)})}if(a.context=N,a.props=g,a.__P=e,a.__e=!1,b=$.__r,k=0,_)a.state=a.__s,a.__d=!1,b&&b(n),h=a.render(a.props,a.state,a.context),ie.push.apply(a.__h,a._sb),a._sb=[];else do a.__d=!1,b&&b(n),h=a.render(a.props,a.state,a.context),a.state=a.__s;while(a.__d&&++k<25);a.state=a.__s,a.getChildContext!=null&&(s=z(z({},s),a.getChildContext())),_&&!p&&a.getSnapshotBeforeUpdate!=null&&(y=a.getSnapshotBeforeUpdate(f,m)),L=h!=null&&h.type===E&&h.key==null?nt(h.props.children):h,c=Ye(e,Y(L)?L:[L],n,r,s,l,i,o,c,u,d),a.base=n.__e,n.__u&=-161,a.__h.length&&o.push(a),v&&(a.__E=a.__=null)}catch(S){if(n.__v=null,u||i!=null)if(S.then){for(n.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;i[i.indexOf(c)]=null,n.__e=c}else{for(O=i.length;O--;)Se(i[O]);Le(n)}else n.__e=r.__e,n.__k=r.__k,S.then||Le(n);$.__e(S,n,r)}else i==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=fn(r.__e,n,r,s,l,i,o,u,d);return(h=$.diffed)&&h(n),128&n.__u?void 0:c}function Le(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Le))}function tt(e,n,r){for(var s=0;s<r.length;s++)Ee(r[s],r[++s],r[++s]);$.__c&&$.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(i){i.call(l)})}catch(i){$.__e(i,l.__v)}})}function nt(e){return typeof e!="object"||e==null||e.__b>0?e:Y(e)?e.map(nt):z({},e)}function fn(e,n,r,s,l,i,o,c,u){var d,h,a,p,f,m,y,v=r.props||le,g=n.props,_=n.type;if(_=="svg"?l="http://www.w3.org/2000/svg":_=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!_&&(_?f.localName==_:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(_==null)return document.createTextNode(g);e=document.createElementNS(l,_,g.is&&g),c&&($.__m&&$.__m(n,i),c=!1),i=null}if(_==null)v===g||c&&e.data==g||(e.data=g);else{if(i=i&&se.call(e.childNodes),!c&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?a=f:d=="children"||d in g||d=="value"&&"defaultValue"in g||d=="checked"&&"defaultChecked"in g||ue(e,d,null,f,l);for(d in g)f=g[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?h=f:d=="value"?m=f:d=="checked"?y=f:c&&typeof f!="function"||v[d]===f||ue(e,d,f,v[d],l);if(h)c||a&&(h.__html==a.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(a&&(e.innerHTML=""),Ye(n.type=="template"?e.content:e,Y(p)?p:[p],n,r,s,_=="foreignObject"?"http://www.w3.org/1999/xhtml":l,i,o,i?i[0]:r.__k&&G(r,0),c,u),i!=null)for(d=i.length;d--;)Se(i[d]);c||(d="value",_=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||_=="progress"&&!m||_=="option"&&m!=v[d])&&ue(e,d,m,v[d],l),d="checked",y!=null&&y!=e[d]&&ue(e,d,y,v[d],l))}return e}function Ee(e,n,r){try{if(typeof e=="function"){var s=typeof e.__u=="function";s&&e.__u(),s&&n==null||(e.__u=e(n))}else e.current=n}catch(l){$.__e(l,r)}}function rt(e,n,r){var s,l;if($.unmount&&$.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||Ee(s,null,n)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){$.__e(i,n)}s.base=s.__P=null}if(s=e.__k)for(l=0;l<s.length;l++)s[l]&&rt(s[l],n,r||typeof e.type!="function");r||Se(e.__e),e.__c=e.__=e.__e=void 0}function pn(e,n,r){return this.constructor(e,r)}function st(e,n,r){var s,l,i,o;n==document&&(n=document.documentElement),$.__&&$.__(e,n),l=(s=!1)?null:n.__k,i=[],o=[],Te(n,e=n.__k=ae(E,null,[e]),l||le,le,n.namespaceURI,l?null:n.firstChild?se.call(n.childNodes):null,i,l?l.__e:n.firstChild,s,o),tt(i,e,o)}se=ie.slice,$={__e:function(e,n,r,s){for(var l,i,o;n=n.__;)if((l=n.__c)&&!l.__)try{if((i=l.constructor)&&i.getDerivedStateFromError!=null&&(l.setState(i.getDerivedStateFromError(e)),o=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,s||{}),o=l.__d),o)return l.__E=l}catch(c){e=c}throw e}},qe=0,q.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=z({},this.state),typeof e=="function"&&(e=e(z({},r),this.props)),e&&z(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Ge(this))},q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ge(this))},q.prototype.render=E,Q=[],We=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Je=function(e,n){return e.__v.__b-n.__v.__b},ce.__r=0,Ke=/(PointerCapture)$|Capture$/i,$e=0,ke=et(!1),Ce=et(!0);var mn=0;function t(e,n,r,s,l,i){n||(n={});var o,c,u=n;if("ref"in u)for(c in u={},n)c=="ref"?o=n[c]:u[c]=n[c];var d={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mn,__i:-1,__u:0,__source:l,__self:i};if(typeof e=="function"&&(o=e.defaultProps))for(c in o)u[c]===void 0&&(u[c]=o[c]);return $.vnode&&$.vnode(d),d}var X,A,Ae,lt,Z=0,it=[],D=$,at=D.__b,ot=D.__r,ct=D.diffed,dt=D.__c,ut=D.unmount,ht=D.__;function Pe(e,n){D.__h&&D.__h(A,e,Z||n),Z=0;var r=A.__H||(A.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function x(e){return Z=1,_n(mt,e)}function _n(e,n,r){var s=Pe(X++,2);if(s.t=e,!s.__c&&(s.__=[r?r(n):mt(void 0,n),function(c){var u=s.__N?s.__N[0]:s.__[0],d=s.t(u,c);u!==d&&(s.__N=[d,s.__[1]],s.__c.setState({}))}],s.__c=A,!A.__f)){var l=function(c,u,d){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(p){return p.__c});if(h.every(function(p){return!p.__N}))return!i||i.call(this,c,u,d);var a=s.__c.props!==c;return h.some(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(a=!0)}}),i&&i.call(this,c,u,d)||a};A.__f=!0;var i=A.shouldComponentUpdate,o=A.componentWillUpdate;A.componentWillUpdate=function(c,u,d){if(this.__e){var h=i;i=void 0,l(c,u,d),i=h}o&&o.call(this,c,u,d)},A.shouldComponentUpdate=l}return s.__N||s.__}function F(e,n){var r=Pe(X++,3);!D.__s&&pt(r.__H,n)&&(r.__=e,r.u=n,A.__H.__h.push(r))}function j(e){return Z=5,T(function(){return{current:e}},[])}function T(e,n){var r=Pe(X++,7);return pt(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function C(e,n){return Z=8,T(function(){return e},n)}function gn(){for(var e;e=it.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(he),n.__h.some(Me),n.__h=[]}catch(r){n.__h=[],D.__e(r,e.__v)}}}D.__b=function(e){A=null,at&&at(e)},D.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ht&&ht(e,n)},D.__r=function(e){ot&&ot(e),X=0;var n=(A=e.__c).__H;n&&(Ae===A?(n.__h=[],A.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(he),n.__h.some(Me),n.__h=[],X=0)),Ae=A},D.diffed=function(e){ct&&ct(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(it.push(n)!==1&&lt===D.requestAnimationFrame||((lt=D.requestAnimationFrame)||bn)(gn)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ae=A=null},D.__c=function(e,n){n.some(function(r){try{r.__h.some(he),r.__h=r.__h.filter(function(s){return!s.__||Me(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],D.__e(s,r.__v)}}),dt&&dt(e,n)},D.unmount=function(e){ut&&ut(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(s){try{he(s)}catch(l){n=l}}),r.__H=void 0,n&&D.__e(n,r.__v))};var ft=typeof requestAnimationFrame=="function";function bn(e){var n,r=function(){clearTimeout(s),ft&&cancelAnimationFrame(n),setTimeout(e)},s=setTimeout(r,35);ft&&(n=requestAnimationFrame(r))}function he(e){var n=A,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),A=n}function Me(e){var n=A;e.__c=e.__(),A=n}function pt(e,n){return!e||e.length!==n.length||n.some(function(r,s){return r!==e[s]})}function mt(e,n){return typeof n=="function"?n(e):n}function yn(e,n){for(var r in n)e[r]=n[r];return e}function _t(e,n){for(var r in e)if(r!=="__source"&&!(r in n))return!0;for(var s in n)if(s!=="__source"&&e[s]!==n[s])return!0;return!1}function gt(e,n){this.props=e,this.context=n}(gt.prototype=new q).isPureReactComponent=!0,gt.prototype.shouldComponentUpdate=function(e,n){return _t(this.props,e)||_t(this.state,n)};var bt=$.__b;$.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),bt&&bt(e)};var vn=$.__e;$.__e=function(e,n,r,s){if(e.then){for(var l,i=n;i=i.__;)if((l=i.__c)&&l.__c)return n.__e==null&&(n.__e=r.__e,n.__k=r.__k),l.__c(e,n)}vn(e,n,r,s)};var yt=$.unmount;function vt(e,n,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),e.__c.__H=null),(e=yn({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=n),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(s){return vt(s,n,r)})),e}function wt(e,n,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return wt(s,n,r)}),e.__c&&e.__c.__P===n&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function ee(){this.__u=0,this.o=null,this.__b=null}function xt(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function B(e){var n,r,s,l=null;function i(o){if(n||(n=e()).then(function(c){c&&(l=c.default||c),s=!0},function(c){r=c,s=!0}),r)throw r;if(!s)throw n;return l?ae(l,o):null}return i.displayName="Lazy",i.__f=!0,i}function fe(){this.i=null,this.l=null}$.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),yt&&yt(e)},(ee.prototype=new q).__c=function(e,n){var r=n.__c,s=this;s.o==null&&(s.o=[]),s.o.push(r);var l=xt(s.__v),i=!1,o=function(){i||s.__z||(i=!0,r.__R=null,l?l(u):u())};r.__R=o;var c=r.__P;r.__P=null;var u=function(){if(!--s.__u){if(s.state.__a){var d=s.state.__a;s.__v.__k[0]=wt(d,d.__c.__P,d.__c.__O)}var h;for(s.setState({__a:s.__b=null});h=s.o.pop();)h.__P=c,h.forceUpdate()}};s.__u++||32&n.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(o,o)},ee.prototype.componentWillUnmount=function(){this.o=[]},ee.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=vt(this.__b,r,s.__O=s.__P)}this.__b=null}var l=n.__a&&ae(E,null,e.fallback);return l&&(l.__u&=-33),[ae(E,null,n.__a?null:e.children),l]};var Nt=function(e,n,r){if(++r[1]===r[0]&&e.l.delete(n),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(fe.prototype=new q).__a=function(e){var n=this,r=xt(n.__v),s=n.l.get(e);return s[0]++,function(l){var i=function(){n.props.revealOrder?(s.push(l),Nt(n,e,s)):l()};r?r(i):i()}},fe.prototype.render=function(e){this.i=null,this.l=new Map;var n=de(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&n.reverse();for(var r=n.length;r--;)this.l.set(n[r],this.i=[1,0,this.i]);return e.children},fe.prototype.componentDidUpdate=fe.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,r){Nt(e,r,n)})};var wn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,xn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Nn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,$n=/[A-Z0-9]/g,kn=typeof document<"u",Cn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};q.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(q.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var $t=$.event;function Sn(){}function Tn(){return this.cancelBubble}function Ln(){return this.defaultPrevented}$.event=function(e){return $t&&(e=$t(e)),e.persist=Sn,e.isPropagationStopped=Tn,e.isDefaultPrevented=Ln,e.nativeEvent=e};var En={enumerable:!1,configurable:!0,get:function(){return this.class}},kt=$.vnode;$.vnode=function(e){typeof e.type=="string"&&(function(n){var r=n.props,s=n.type,l={},i=s.indexOf("-")===-1;for(var o in r){var c=r[o];if(!(o==="value"&&"defaultValue"in r&&c==null||kn&&o==="children"&&s==="noscript"||o==="class"||o==="className")){var u=o.toLowerCase();o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&c===!0?c="":u==="translate"&&c==="no"?c=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?o="ondblclick":u!=="onchange"||s!=="input"&&s!=="textarea"||Cn(r.type)?u==="onfocus"?o="onfocusin":u==="onblur"?o="onfocusout":Nn.test(o)&&(o=u):u=o="oninput":i&&xn.test(o)?o=o.replace($n,"-$&").toLowerCase():c===null&&(c=void 0),u==="oninput"&&l[o=u]&&(o="oninputCapture"),l[o]=c}}s=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=de(r.children).forEach(function(d){d.props.selected=l.value.indexOf(d.props.value)!=-1})),s=="select"&&l.defaultValue!=null&&(l.value=de(r.children).forEach(function(d){d.props.selected=l.multiple?l.defaultValue.indexOf(d.props.value)!=-1:l.defaultValue==d.props.value})),r.class&&!r.className?(l.class=r.class,Object.defineProperty(l,"className",En)):r.className&&(l.class=l.className=r.className),n.props=l})(e),e.$$typeof=wn,kt&&kt(e)};var Ct=$.__r;$.__r=function(e){Ct&&Ct(e),e.__c};var St=$.diffed;$.diffed=function(e){St&&St(e);var n=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in n&&n.value!==r.value&&(r.value=n.value==null?"":n.value)};var Tt={Fragment:E};const P={queries:{viewBox:"0 0 24 24",elements:['<ellipse cx="12" cy="5" rx="9" ry="3"/>','<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>','<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>']},events:{viewBox:"0 0 24 24",elements:['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']},emails:{viewBox:"0 0 24 24",elements:['<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>','<polyline points="22,6 12,13 2,6"/>']},routes:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<line x1="2" y1="12" x2="22" y2="12"/>','<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>']},logs:{viewBox:"0 0 24 24",elements:['<line x1="8" y1="6" x2="21" y2="6"/>','<line x1="8" y1="12" x2="21" y2="12"/>','<line x1="8" y1="18" x2="21" y2="18"/>','<line x1="3" y1="6" x2="3.01" y2="6"/>','<line x1="3" y1="12" x2="3.01" y2="12"/>','<line x1="3" y1="18" x2="3.01" y2="18"/>']},timeline:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},cache:{viewBox:"0 0 24 24",elements:['<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>','<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>','<line x1="6" y1="6" x2="6.01" y2="6"/>','<line x1="6" y1="18" x2="6.01" y2="18"/>']},jobs:{viewBox:"0 0 24 24",elements:['<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>','<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>']},config:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="3"/>','<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>']},internals:{viewBox:"0 0 24 24",elements:['<rect x="4" y="4" width="16" height="16" rx="2"/>','<rect x="9" y="9" width="6" height="6"/>','<line x1="9" y1="1" x2="9" y2="4"/>','<line x1="15" y1="1" x2="15" y2="4"/>','<line x1="9" y1="20" x2="9" y2="23"/>','<line x1="15" y1="20" x2="15" y2="23"/>','<line x1="20" y1="9" x2="23" y2="9"/>','<line x1="20" y1="14" x2="23" y2="14"/>','<line x1="1" y1="9" x2="4" y2="9"/>','<line x1="1" y1="14" x2="4" y2="14"/>']},overview:{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="7" height="7"/>','<rect x="14" y="3" width="7" height="7"/>','<rect x="14" y="14" width="7" height="7"/>','<rect x="3" y="14" width="7" height="7"/>']},requests:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},"dashboard-timeline":{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<polyline points="12 6 12 12 16 14"/>']},"custom-pane":{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="18" height="18" rx="2"/>','<path d="M9 3v18"/>']},wrench:{viewBox:"0 0 24 24",elements:['<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>']},"external-link":{viewBox:"0 0 24 24",elements:['<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>','<polyline points="15 3 21 3 21 9"/>','<line x1="10" y1="14" x2="21" y2="3"/>']},sun:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="5"/>','<line x1="12" y1="1" x2="12" y2="3"/>','<line x1="12" y1="21" x2="12" y2="23"/>','<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>','<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>','<line x1="1" y1="12" x2="3" y2="12"/>','<line x1="21" y1="12" x2="23" y2="12"/>','<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>','<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>']},moon:{viewBox:"0 0 24 24",elements:['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']},search:{viewBox:"0 0 24 24",elements:['<circle cx="11" cy="11" r="8"/>','<line x1="21" y1="21" x2="16.65" y2="16.65"/>']},eye:{viewBox:"0 0 24 24",elements:['<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>','<circle cx="12" cy="12" r="3"/>']},"eye-off":{viewBox:"0 0 24 24",elements:['<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>','<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>','<line x1="1" y1="1" x2="23" y2="23"/>','<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>']},"chevron-right":{viewBox:"0 0 24 24",elements:['<path d="M9 18l6-6-6-6"/>']},"chevron-left":{viewBox:"0 0 24 24",elements:['<path d="M15 18l-6-6 6-6"/>']},"open-external":{viewBox:"0 0 16 16",elements:['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']}};class pe extends Error{status;constructor(n=403){super(`Unauthorized (HTTP ${n})`),this.name="UnauthorizedError",this.status=n}}class An extends Error{status;body;constructor(n,r){super(`API error (HTTP ${n})`),this.name="ApiError",this.status=n,this.body=r}}class De{baseUrl;authToken;constructor(n){this.baseUrl=n.baseUrl.replace(/\/+$/,""),this.authToken=n.authToken}async fetch(n,r){const l={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...r?.headers},i=await globalThis.fetch(`${this.baseUrl}${n}`,{...r,headers:l,credentials:this.authToken?"omit":"include"});if(r?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(i.status===401||i.status===403)throw new pe(i.status);if(!i.ok){const o=await i.text().catch(()=>"");throw new An(i.status,o)}return i.json()}async get(n,r){const s=r?`${n}?${r}`:n;return this.fetch(s)}async post(n,r){const s={method:"POST",...r!==void 0?{body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(n,s)}async delete(n){return this.fetch(n,{method:"DELETE"})}}const Pn=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],Lt="/admin/api/debug",Et={tracing:!1,process:!1,system:!1,http:!1,db:!1,redis:!1,queues:!1,cache:!1,app:!1,log:!1,emails:!1,dashboard:!1,customPanes:[]};function Mn(e){const n={customPanes:e.customPanes??[]},r=e.features;for(const s of Pn)n[s]=r?.[s]??!1;return n}async function Dn(e,n=Lt){const r=`${n.replace(/\/+$/,"")}/config`;return e.fetch(r)}async function On(e){const{baseUrl:n="",debugEndpoint:r=Lt,authToken:s}=e,l=new De({baseUrl:n,authToken:s});try{const i=await Dn(l,r);return Mn(i)}catch{return Et}}function jn(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e,[l,i]=x(Et),[o,c]=x(!0),[u,d]=x(null),h=j(!1);return F(()=>{if(h.current)return;h.current=!0;let a=!1;return(async()=>{try{const f=await On({baseUrl:n,debugEndpoint:r,authToken:s});a||(i(f),c(!1))}catch(f){a||(d(f instanceof Error?f:new Error(String(f))),c(!1))}})(),()=>{a=!0}},[n,r,s]),{features:l,isLoading:o,error:u}}const me="ss-dash-theme",Oe="ss-theme-change";function je(){if(typeof window>"u")return"light";const e=localStorage.getItem(me);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function In(e){typeof window>"u"||(localStorage.setItem(me,e),window.dispatchEvent(new CustomEvent(Oe,{detail:e})))}function Bn(){const n=je()==="dark"?"light":"dark";return In(n),n}function Rn(e){if(typeof window>"u")return()=>{};const n=i=>{const o=i.detail;(o==="dark"||o==="light")&&e(o)},r=i=>{if(i.key===me){const o=i.newValue;e(o==="dark"||o==="light"?o:je())}},s=window.matchMedia("(prefers-color-scheme: dark)"),l=i=>{localStorage.getItem(me)||e(i.matches?"dark":"light")};return window.addEventListener(Oe,n),window.addEventListener("storage",r),s.addEventListener("change",l),()=>{window.removeEventListener(Oe,n),window.removeEventListener("storage",r),s.removeEventListener("change",l)}}function Fn(){const[e,n]=x(()=>je());F(()=>Rn(l=>{n(l)}),[]);const r=C(()=>{const s=Bn();return n(s),s},[]);return{theme:e,toggleTheme:r}}function Hn({theme:e,onToggle:n,className:r="",classPrefix:s="ss-dash"}){const l=e==="dark";return t("button",{type:"button",className:`${s==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${r}`,onClick:n,title:l?"Switch to light theme":"Switch to dark theme","aria-label":l?"Switch to light theme":"Switch to dark theme",children:l?t("svg",{width:"16",height:"16",viewBox:P.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:P.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.moon.elements.join("")}})})}const Un=B(()=>Promise.resolve().then(()=>Dr)),zn=B(()=>Promise.resolve().then(()=>Or)),qn=B(()=>Promise.resolve().then(()=>Ir)),Vn=B(()=>Promise.resolve().then(()=>Rr)),Wn=B(()=>Promise.resolve().then(()=>Jr)),Jn=B(()=>Promise.resolve().then(()=>Xr)),Kn=B(()=>Promise.resolve().then(()=>es)),Qn=B(()=>Promise.resolve().then(()=>is)),Gn=B(()=>Promise.resolve().then(()=>ps)),Yn=B(()=>Promise.resolve().then(()=>Ts)),Xn=B(()=>Promise.resolve().then(()=>Ls));function Zn(e){const{defaultOpen:n=!1,dashboardPath:r,isOpen:s,onOpenChange:l,isLive:i=!1,...o}=e,[c,u]=x(n),d=s!==void 0?s:c,h=b=>{l?l(b):u(b)},[a,p]=x("queries"),{features:f}=jn(o),{theme:m,toggleTheme:y}=Fn(),v=f.customPanes||[];F(()=>{const b=k=>{k.key==="Escape"&&d&&h(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);const g=T(()=>[{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"timeline",label:"Requests",visible:f.tracing},{id:"cache",label:"Cache",visible:f.cache},{id:"jobs",label:"Jobs",visible:f.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[f]),_=T(()=>g.filter(b=>b.visible),[g]);F(()=>{const b=[..._.map(k=>k.id),...v.map(k=>k.id)];!b.includes(a)&&b.length>0&&p(b[0])},[_,v,a]);const w=C(()=>{h(!d)},[d]),N=C(()=>{const b={options:o},k=v.find(O=>O.id===a);if(k)return t(ee,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:t(Xn,{pane:k,options:o})});const L={queries:t(Un,{...b}),events:t(zn,{...b}),emails:t(qn,{...b}),routes:t(Vn,{...b,currentPath:typeof window<"u"?window.location.pathname:""}),logs:t(Wn,{...b}),timeline:t(Jn,{...b}),cache:t(Kn,{...b,dashboardPath:r}),jobs:t(Qn,{...b,dashboardPath:r}),config:t(Gn,{...b,dashboardPath:r}),internals:t(Yn,{...b})};return t(ee,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:L[a]||t("div",{className:"ss-dbg-empty",children:"Unknown tab"})})},[a,o,v]);return t(E,{children:[s===void 0&&t("button",{type:"button",className:`ss-dbg-btn ${d?"ss-dbg-active":""}`,onClick:w,title:"Toggle debug panel",id:"ss-dbg-wrench",children:t("svg",{width:"14",height:"14",viewBox:P.wrench.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.wrench.elements.join("")}})}),t("div",{className:`ss-dbg-panel ${d?"ss-dbg-open":""}`,"data-ss-theme":m,id:"ss-dbg-panel",children:[t("div",{className:"ss-dbg-tabs",children:[t("div",{className:"ss-dbg-tabs-scroll",children:[_.map(b=>t("button",{type:"button",className:`ss-dbg-tab ${a===b.id?"ss-dbg-active":""}`,onClick:()=>p(b.id),children:[P[b.id]?t("svg",{className:"ss-dbg-tab-icon",viewBox:P[b.id].viewBox,dangerouslySetInnerHTML:{__html:P[b.id].elements.join("")}}):null,b.label]},b.id)),v.map(b=>t("button",{type:"button",className:`ss-dbg-tab ${a===b.id?"ss-dbg-active":""}`,onClick:()=>p(b.id),children:b.label},b.id))]}),t("div",{className:"ss-dbg-tabs-right",children:[t("span",{className:`ss-dbg-conn-mode ${i?"ss-dbg-conn-live":"ss-dbg-conn-polling"}`,title:i?"Connected via Transmit (SSE) — real-time updates":"Polling every 3s",children:i?"live":"polling"}),t(Hn,{theme:m,onToggle:y,classPrefix:"ss-dbg"}),r&&t("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"ss-dbg-dashboard-link",title:"Open dashboard",children:t("svg",{width:"14",height:"14",viewBox:P["external-link"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P["external-link"].elements.join("")}})}),t("button",{type:"button",className:"ss-dbg-close",onClick:()=>h(!1),title:"Close panel",children:"×"})]})]}),t("div",{className:"ss-dbg-content",children:d&&N()})]})]})}window.__ssDebugPanel={mount(e,n,r){st(t(Zn,{debugEndpoint:n.debugEndpoint,authToken:n.authToken,dashboardPath:n.dashboardPath||void 0,defaultOpen:!0,isLive:r}),e)},unmount(e){st(null,e)}};const er=3e3,tr=100,nr=500;function rr(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function sr(e,n,r){if(e.length===0)return"[]";const s=e.slice(0,3).map(o=>r(o,30)),l=e.length>3?", ..."+e.length+" items":"",i="["+s.join(", ")+l+"]";return i.length>n?"["+e.length+" items]":i}function lr(e,n,r){const s=Object.keys(e);if(s.length===0)return"{}";const l=[];for(let u=0;u<Math.min(s.length,4);u++)l.push(s[u]+": "+r(e[s[u]],30));const i=s.length>4?", ...+"+(s.length-4):"",o="{ "+l.join(", ")+i+" }";return o.length<=n?o:"{ "+(s.slice(0,6).join(", ")+(s.length>6?", ...":""))+" }"}function ir(e){if(!e&&e!==0)return"-";const n=Math.floor(e),r=Math.floor(n/86400),s=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return r>0?`${r}d ${s}h`:s>0?`${s}h ${l}m`:l>0?`${l}m ${n%60}s`:`${n}s`}function V(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function At(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function ar(e){if(!e)return"-";const n=typeof e=="string"?new Date(At(e)):new Date(e);return Number.isNaN(n.getTime())?"-":n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(n.getMilliseconds()).padStart(3,"0")}function Ie(e){if(!e)return"-";const n=typeof e=="string"?new Date(At(e)).getTime():e,r=Math.floor((Date.now()-n)/1e3);return r<0?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function or(e){return e>nr?"very-slow":e>tr?"slow":"normal"}function _e(e,n="ss-dash"){const r=or(e);return r==="very-slow"?`${n}-very-slow`:r==="slow"?`${n}-slow`:""}function ge(e,n=100){return e===null?"null":e===void 0?"-":typeof e=="string"?rr(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?sr(e,n,ge):typeof e=="object"?lr(e,n,ge):String(e)}function cr(e){return e<0?"no expiry":e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function dr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function be(e,...n){for(const r of n){const s=e[r];if(s!=null)return s}}function Be(e){return be(e,"createdAt","created_at","timestamp")}function ur(e){return be(e,"timestamp","createdAt","processedAt","created_at")}function Pt(e){return be(e,"method","sql_method")??""}function Re(e){return be(e,"sqlNormalized","normalizedSql","sql_normalized","sql")??""}function hr(e,n){if(!n)return e;const r=n.toLowerCase();return e.filter(s=>s.sql.toLowerCase().includes(r)||s.model&&s.model.toLowerCase().includes(r)||s.method.toLowerCase().includes(r))}function fr(e){const n={};for(const r of e)n[r.sql]=(n[r.sql]||0)+1;return n}function pr(e,n){const r=e.filter(i=>i.duration>100).length,s=Object.values(n).filter(i=>i>1).length,l=e.length>0?e.reduce((i,o)=>i+o.duration,0)/e.length:0;return{slowCount:r,dupCount:s,avgDuration:l,totalCount:e.length}}function mr(e){const n=new Map;for(const r of e){const l=Re(r);n.set(l,(n.get(l)||0)+1)}return n}class _r{state;constructor(n="list"){this.state={viewMode:n,sort:{key:n==="list"?"createdAt":"count",dir:"desc"},expandedIds:new Set,explainData:new Map,search:""}}setViewMode(n){return this.state.viewMode=n,this.state.sort={key:n==="list"?"createdAt":"count",dir:"desc"},this.state.expandedIds=new Set,this.state.explainData=new Map,this.state}toggleSort(n){return this.state.sort.key===n?this.state.sort={key:n,dir:this.state.sort.dir==="asc"?"desc":"asc"}:this.state.sort={key:n,dir:"desc"},this.state}toggleExpand(n){return this.state.expandedIds.has(n)?this.state.expandedIds.delete(n):this.state.expandedIds.add(n),this.state}isExpanded(n){return this.state.expandedIds.has(n)}setSearch(n){return this.state.search=n,this.state}startExplain(n){this.state.explainData.set(n,{loading:!0})}completeExplain(n,r){this.state.explainData.set(n,{loading:!1,result:r})}failExplain(n,r){this.state.explainData.set(n,{loading:!1,error:r})}clearExplain(){this.state.explainData=new Map}getExplainState(n){return this.state.explainData.get(n)}}const gr={queries:"/queries",events:"/events",emails:"/emails",routes:"/routes",logs:"/logs",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config",internals:"/diagnostics"};function br(e){return gr[e]||`/${e}`}class yr{client;endpoint;refreshInterval;callbacks;timer=null;currentTab=null;fetchOnceCache={};abortController=null;constructor(n){this.client=new De({baseUrl:n.baseUrl,authToken:n.authToken}),this.endpoint=n.endpoint??"/admin/api/debug",this.refreshInterval=n.refreshInterval??er,this.callbacks={onData:n.onData,onLoading:n.onLoading,onError:n.onError,onUnauthorized:n.onUnauthorized}}start(n){this.stop(),this.currentTab=n,this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetchData(),this.timer=setInterval(()=>this.fetchData(),this.refreshInterval)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null),this.abortController?.abort(),this.abortController=null}switchTab(n){this.start(n)}refresh(){this.currentTab&&this.fetchData()}async fetchCustomPane(n,r=!1){if(r&&this.fetchOnceCache[n]!==void 0){this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1);return}this.callbacks.onLoading(!0);try{const s=await this.client.fetch(n);this.callbacks.onData(s),this.callbacks.onError(null),r&&(this.fetchOnceCache[n]=s)}catch(s){if(s instanceof pe){this.callbacks.onUnauthorized(s);return}this.callbacks.onError(s instanceof Error?s:new Error(String(s)))}finally{this.callbacks.onLoading(!1)}}cacheForTab(n,r){this.fetchOnceCache[n]=r}clearCache(){this.fetchOnceCache={}}async fetchData(){const n=this.currentTab;if(!n||this.serveFromCache(n))return;this.abortController?.abort();const r=new AbortController;this.abortController=r;try{const s=`${this.endpoint}${br(n)}`,l=await this.client.fetch(s,{signal:r.signal});if(r.signal.aborted)return;this.callbacks.onData(l),this.callbacks.onError(null),this.callbacks.onLoading(!1)}catch(s){this.handleFetchError(s,r)}}serveFromCache(n){return this.fetchOnceCache[n]===void 0?!1:(this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1),!0)}handleFetchError(n,r){if(!(n instanceof DOMException&&n.name==="AbortError")&&!r.signal.aborted){if(n instanceof pe){this.callbacks.onError(n),this.callbacks.onLoading(!1),this.stop(),this.callbacks.onUnauthorized(n);return}this.callbacks.onError(n instanceof Error?n:new Error(String(n))),this.callbacks.onLoading(!1)}}}function H(e,n={}){const{baseUrl:r="",debugEndpoint:s="/admin/api/debug",authToken:l}=n,[i,o]=x(null),[c,u]=x(!0),[d,h]=x(null),a=j(null);a.current||(a.current=new yr({baseUrl:r,endpoint:s,authToken:l,onData:y=>o(y),onLoading:y=>u(y),onError:y=>h(y),onUnauthorized:y=>h(y)})),F(()=>{const y=a.current;return y.start(e),()=>y.stop()},[e]);const p=C(()=>{a.current?.refresh()},[]),f=C(()=>{o(null)},[]),m=C((y,v)=>{a.current?.cacheForTab(y,v)},[]);return{data:i,isLoading:c,error:d,refresh:p,clearData:f,cacheForTab:m}}function vr(e){const n=[];if(e["Startup Cost"]!==null&&e["Startup Cost"]!==void 0&&n.push(`cost=${e["Startup Cost"]}..${e["Total Cost"]}`),e["Plan Rows"]!==null&&e["Plan Rows"]!==void 0&&n.push(`rows=${e["Plan Rows"]}`),e["Plan Width"]!==null&&e["Plan Width"]!==void 0&&n.push(`width=${e["Plan Width"]}`),e.Filter&&n.push(`filter: ${e.Filter}`),e["Index Cond"]&&n.push(`cond: ${e["Index Cond"]}`),e["Hash Cond"]&&n.push(`hash: ${e["Hash Cond"]}`),e["Join Type"]&&n.push(`join: ${e["Join Type"]}`),e["Sort Key"]){const r=Array.isArray(e["Sort Key"])?e["Sort Key"].join(", "):e["Sort Key"];n.push(`sort: ${r}`)}return n}function Mt(e,n=0){if(!e)return[];const s=[{depth:n,nodeType:e["Node Type"]||"Unknown",relationName:e["Relation Name"]||"",alias:e.Alias&&e.Alias!==e["Relation Name"]?e.Alias:"",indexName:e["Index Name"]||"",metrics:vr(e),isRoot:n===0}],l=e.Plans||[];for(const i of l)s.push(...Mt(i,n+1));return s}function wr(e){return!e||typeof e!="object"?!1:"Plan"in e}function xr(e){if(!e||e.length===0)return[];const n=e[0];return!n||typeof n!="object"?[]:Object.keys(n)}function Nr(e){return e==null?"-":String(e)}function $r(e){const n=e?.showExplain??!0,r=[{key:"id",label:"#",width:"40px",type:"index"},{key:"sql",label:"SQL",type:"sql"},{key:"duration",label:"Duration",width:"70px",sortable:!0,type:"duration"},{key:"method",label:"Method",width:"60px",type:"method"},{key:"model",label:"Model",width:"90px",type:"model"},{key:"connection",label:"Connection",width:"80px",type:"connection"},{key:"createdAt",label:"Time",width:"90px",sortable:!0,type:"time"}];return n&&r.push({key:"id",label:"",width:"70px",type:"explain"}),r}function kr(){return[{key:"sqlNormalized",label:"Pattern",type:"sql"},{key:"count",label:"Count",width:"60px",sortable:!0},{key:"avgDuration",label:"Avg",width:"70px",sortable:!0,type:"duration"},{key:"minDuration",label:"Min",width:"70px",type:"duration"},{key:"maxDuration",label:"Max",width:"70px",type:"duration"},{key:"totalDuration",label:"Total",width:"70px",sortable:!0,type:"duration"},{key:"percentOfTotal",label:"% Time",width:"60px"}]}function U({search:e,onSearchChange:n,placeholder:r="Search...",summary:s,children:l,className:i=""}){const o=C(()=>{n("")},[n]);return t("div",{className:`ss-dbg-filter-bar ${i}`,children:[s!=null&&t("span",{className:"ss-dbg-summary",children:s}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:P.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:r,value:e,onChange:c=>n(c.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:o,children:"×"})]}),l&&t("div",{className:"ss-dbg-filter-controls",children:l})]})}function J({ts:e,className:n,style:r}){return e?t("span",{className:n,style:r,title:ar(e),children:Ie(e)}):t("span",{className:n,style:r,children:"-"})}const Cr="ss-col-resize",Dt="ss-resizing";function Ot(e){const n=Array.from(e.querySelectorAll("thead th"));if(n.length===0)return()=>{};const r=[];let s=!1;function l(){if(!s){s=!0;for(const i of n)i.style.width=i.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const i of n){let o=function(u){u.preventDefault(),u.stopPropagation(),l();const d=u.clientX,h=i.offsetWidth;c.classList.add(Dt),c.setPointerCapture(u.pointerId);function a(f){const m=f.clientX-d,y=Math.max(30,h+m);i.style.width=y+"px"}function p(){c.classList.remove(Dt),c.removeEventListener("pointermove",a),c.removeEventListener("pointerup",p)}c.addEventListener("pointermove",a),c.addEventListener("pointerup",p)};if(!i.textContent?.trim())continue;const c=document.createElement("div");c.className=Cr,i.appendChild(c),c.addEventListener("pointerdown",o),r.push(()=>{c.removeEventListener("pointerdown",o),c.remove()})}return()=>{for(const i of r)i()}}function K(e=[]){const n=j(null),r=j(null);return F(()=>(n.current&&(r.current?.(),r.current=Ot(n.current)),()=>{r.current?.(),r.current=null}),e),C(l=>{r.current?.(),r.current=null,n.current=l,l&&(r.current=Ot(l))},[])}function jt({columns:e,data:n,keyField:r="id",sort:s,sortDir:l,onSort:i,onRowClick:o,rowClassName:c,emptyMessage:u="No data",className:d="",renderAfterRow:h}){const a=C(f=>{i&&i(f)},[i]),p=K([n,e]);return n.length===0?t("div",{className:"ss-dash-empty",children:u}):t("table",{ref:p,className:`ss-dash-table ${d}`,children:[t("colgroup",{children:e.map(f=>t("col",{style:f.width?{width:f.width}:void 0},f.key))}),t("thead",{children:t("tr",{children:e.map(f=>t("th",{onClick:f.sortable?()=>a(f.key):void 0,className:f.sortable?"ss-dash-sortable":"",children:[f.label,s===f.key&&t("span",{className:"ss-dash-sort-arrow",children:l==="asc"?" ▲":" ▼"})]},f.key))})}),t("tbody",{children:n.map((f,m)=>{const y=c?typeof c=="function"?c(f):c:"",v=o?"ss-dash-clickable":"";return t(Tt.Fragment,{children:[t("tr",{onClick:o?()=>o(f):void 0,className:`${v} ${y}`.trim(),children:e.map(g=>t("td",{children:g.render?g.render(f[g.key],f):f[g.key]??"-"},g.key))}),h?h(f,m):null]},f[r]??m)})})]})}function Sr(e,n,r=2){if(n<=1)return[1];const s=[],l=Math.max(2,e-r),i=Math.min(n-1,e+r);s.push(1),l>2&&s.push("...");for(let o=l;o<=i;o++)s.push(o);return i<n-1&&s.push("..."),n>1&&s.push(n),s}function Tr({page:e,lastPage:n,total:r,onPageChange:s,className:l=""}){const i=T(()=>Sr(e,n),[e,n]),o=C(()=>{e>1&&s(e-1)},[e,s]),c=C(()=>{e<n&&s(e+1)},[e,n,s]);return n<=1?null:t("div",{className:`ss-dash-pagination ${l}`,children:[t("span",{className:"ss-dash-page-info",children:["Page ",e," of ",n," (",r," total)"]}),t("div",{className:"ss-dash-pagination-controls",children:[t("button",{type:"button",className:"ss-dash-page-btn",onClick:o,disabled:e<=1,children:"« Prev"}),i.map((u,d)=>u==="..."?t("span",{className:"ss-dash-page-ellipsis",children:"..."},`ellipsis-${d}`):t("button",{type:"button",className:`ss-dash-page-btn ${u===e?"ss-dash-active":""}`,onClick:()=>s(u),children:u},u)),t("button",{type:"button",className:"ss-dash-page-btn",onClick:c,disabled:e>=n,children:"Next »"})]})]})}function Lr({node:e,depth:n=0}){if(!e)return null;const r=T(()=>Mt(e,n),[e,n]);return t(E,{children:r.map((s,l)=>t("div",{className:"ss-dash-explain-node",style:{marginLeft:`${s.depth*20}px`},children:[t("div",{className:"ss-dash-explain-node-header",children:[t("span",{className:"ss-dash-explain-node-type",children:s.nodeType}),s.relationName&&t(E,{children:[" on ",t("strong",{children:s.relationName})]}),s.alias&&` (${s.alias})`,s.indexName&&t(E,{children:[" using ",t("em",{children:s.indexName})]})]}),s.metrics.length>0&&t("div",{className:"ss-dash-explain-metrics",children:s.metrics.join(" · ")})]},l))})}function Er({plan:e}){if(!e||!Array.isArray(e)||e.length===0)return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"});const n=e[0];if(wr(n))return t("div",{className:"ss-dash-explain-result",children:t(Lr,{node:n.Plan,depth:0})});if(typeof n=="object"&&n!==null){const r=xr(e);return t("div",{className:"ss-dash-explain-result",children:t("table",{children:[t("thead",{children:t("tr",{children:r.map(s=>t("th",{children:s},s))})}),t("tbody",{children:e.map((s,l)=>{const i=s;return t("tr",{children:r.map(o=>t("td",{children:Nr(i[o])},o))},l)})})]})})}return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"})}const It=t("span",{className:"ss-empty-hint",children:["Queries require ",t("code",{children:"debug: true"})," on your Lucid connections in"," ",t("code",{children:"config/database.ts"})]});function Ar({mode:e,controllerState:n,queries:r,meta:s,isLoading:l,onSearchChange:i,onSort:o,onToggleExpand:c,onViewModeChange:u,onPageChange:d,onExplain:h,onCloseExplain:a,summary:p,filterBarChildren:f}){const{viewMode:m,sort:y,expandedIds:v,explainData:g,search:_}=n,w=!!h,N=e==="dashboard"&&!!s,b=e==="dashboard"&&!!u,k=T(()=>mr(r),[r]);if(b&&m==="grouped")return L();return O();function L(){const S=kr().map(I=>Pr(I,v,c));return t("div",{children:[t(U,{search:_,onSearchChange:i,placeholder:"Filter queries...",summary:p,children:f}),l&&r.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t("div",{className:"ss-dash-table-wrap",children:t(jt,{columns:S,data:r,keyField:"sqlNormalized",sort:y.key,sortDir:y.dir,onSort:o,emptyMessage:t(E,{children:["No queries recorded",It]})})})]})}function O(){const M=$r({showExplain:w}),S=M.map(re=>Mr(re,v,k,g,c,h)),I=M.length,ze=w?re=>{const Es=re.id,W=g.get(Es);return!W||W.loading?null:t("tr",{className:"ss-dash-explain-row",children:t("td",{colSpan:I,className:"ss-dash-explain",children:t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[t("div",{style:{flex:1},children:W.error?t("div",{className:"ss-dash-explain-result ss-dash-explain-error",children:[t("strong",{children:"Error:"})," ",W.error,W.result?.message&&t(E,{children:[t("br",{}),W.result.message]})]}):W.result?t(Er,{plan:W.result.plan||W.result.rows||[]}):null}),t("button",{type:"button",className:"ss-dash-explain-btn",onClick:()=>a?.(),style:{marginLeft:"8px",flexShrink:0},children:"Close"})]})})})}:void 0;return t("div",{children:[t(U,{search:_,onSearchChange:i,placeholder:"Filter queries...",summary:p,children:f}),l&&r.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t(E,{children:[t("div",{className:"ss-dash-table-wrap",children:t(jt,{columns:S,data:r,sort:y.key,sortDir:y.dir,onSort:o,emptyMessage:t(E,{children:["No queries captured",It]}),renderAfterRow:ze})}),N&&s&&t(Tr,{page:s.page,lastPage:s.lastPage,total:s.total,onPageChange:d})]})]})}}function Pr(e,n,r){const s={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"sql":s.render=(l,i)=>{const o=l||"",c=(i.count||0)>=3;return t(E,{children:[t("span",{className:`ss-dash-sql ${n.has(o)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:u=>{u.stopPropagation(),r(o)},role:"button",tabIndex:0,onKeyDown:u=>u.key==="Enter"&&r(o),children:o}),c&&t(E,{children:[" ",t("span",{className:"ss-dash-dup",children:"DUP"})]})]})};break;case"duration":s.render=l=>{const i=l||0,o=e.key==="avgDuration"||e.key==="maxDuration";return t("span",{className:`ss-dash-duration ${o?_e(i):""}`,children:e.key==="totalDuration"?i.toFixed(1)+"ms":i.toFixed(2)+"ms"})};break;default:e.key==="count"?s.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:l||0}):e.key==="percentOfTotal"&&(s.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:(l||0).toFixed(1)+"%"}));break}return s}function Mr(e,n,r,s,l,i){const o={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"index":o.render=c=>t("span",{style:{color:"var(--ss-dim)"},children:c});break;case"sql":o.render=(c,u)=>{const d=u.sql||u.sql_text||"",h=u.id;return t("div",{children:[t("span",{className:`ss-dash-sql ${n.has(h)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:a=>{a.stopPropagation(),l(h)},role:"button",tabIndex:0,onKeyDown:a=>a.key==="Enter"&&l(h),children:d}),(r.get(Re(u))??0)>1&&t("span",{className:"ss-dash-dup",children:["×",r.get(Re(u))]})]})};break;case"duration":o.render=c=>{const u=c||0;return t("span",{className:`ss-dash-duration ${_e(u)}`,children:u.toFixed(2)+"ms"})};break;case"method":o.render=(c,u)=>{const d=Pt(u);return t("span",{className:`ss-dash-method ss-dash-method-${d.toLowerCase()}`,children:d})};break;case"model":o.render=c=>t("span",{style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:c,children:c||"-"});break;case"connection":o.render=c=>t("span",{style:{color:"var(--ss-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c||"-"});break;case"time":o.render=(c,u)=>{const d=c||(Be(u)??"");return t(J,{ts:d,className:"ss-dash-event-time"})};break;case"explain":o.render=(c,u)=>{if(Pt(u)!=="select")return null;const h=u.id,a=s.get(h),p=a&&!a.loading&&a.result&&!a.error,f=a?.loading;return t("button",{type:"button",className:`ss-dash-explain-btn${p?" ss-dash-explain-btn-active":""}`,onClick:m=>{m.stopPropagation(),i?.(h)},disabled:!!f,children:f?"...":"EXPLAIN"})};break}return o}function Bt({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:o}=H("queries",e),c=j(new _r("list")),[u,d]=x(c.current.state),h=C(()=>{d({...c.current.state})},[]),{search:a}=u,p=C(k=>{c.current.setSearch(k),h()},[h]),f=C(k=>{c.current.toggleExpand(k),h()},[h]),m=C(k=>{},[]),y=C(async k=>{const L=c.current.getExplainState(k);if(L&&!L.loading){c.current.clearExplain(),h();return}c.current.startExplain(k),h();try{const O={};s&&(O.Authorization=`Bearer ${s}`);const M=`${n}${r}/queries/${k}/explain`,I=await(await fetch(M,{headers:O})).json();I&&I.error?c.current.completeExplain(k,{rows:[],error:I.error,message:I.message}):c.current.completeExplain(k,{plan:I?.plan||void 0,rows:I?.rows||void 0})}catch(O){console.warn("[ss] Query explain failed:",O),c.current.failExplain(k,O instanceof Error?O.message:String(O))}h()},[n,r,s,h]),v=C(()=>{c.current.clearExplain(),h()},[h]),g=T(()=>l?.queries||[],[l]),_=T(()=>hr(g,a),[g,a]),w=T(()=>fr(g),[g]),N=T(()=>pr(g,w),[g,w]);if(i&&!l)return t("div",{className:"ss-dash-empty",children:"Loading queries..."});if(o)return t("div",{className:"ss-dash-empty",children:["Error: ",o.message]});const b=t(E,{children:[_.length," queries",N.slowCount>0&&` | ${N.slowCount} slow`,N.dupCount>0&&` | ${N.dupCount} dup`,_.length>0&&` | avg ${V(N.avgDuration)}`]});return t(Ar,{mode:"debug",controllerState:u,queries:_,onSearchChange:p,onSort:m,onToggleExpand:f,onExplain:y,onCloseExplain:v,summary:b})}const Dr=Object.freeze(Object.defineProperty({__proto__:null,QueriesTab:Bt,default:Bt},Symbol.toStringTag,{value:"Module"}));function ye({data:e,maxPreviewLength:n=100,className:r="",classPrefix:s="ss-dash",defaultExpanded:l=!1}){const[i,o]=x(l),c=T(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),u=T(()=>typeof c=="object"&&c!==null?ge(c,n):String(c??"-"),[c,n]),d=T(()=>typeof c=="object"&&c!==null?JSON.stringify(c,null,2):String(c),[c]),h=C(()=>{o(p=>!p)},[]),a=C(async()=>{try{await navigator.clipboard.writeText(d)}catch{}},[d]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${s}-c-dim`,children:"-"}):t("div",{className:`${s}-data-cell ${r}`,children:[!i&&t("span",{className:`${s}-data-preview`,onClick:h,role:"button",tabIndex:0,onKeyDown:p=>p.key==="Enter"&&h(),children:u}),i&&t("div",{className:`${s}-data-full`,onClick:h,children:[t("button",{className:`${s}-copy-btn`,onClick:p=>{p.stopPropagation(),a()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:d})]})]})}function Rt({options:e}){const{data:n,isLoading:r,error:s}=H("events",e),[l,i]=x(""),o=T(()=>{const u=n?.events||[];if(!l)return u;const d=l.toLowerCase();return u.filter(h=>(h.event||"").toLowerCase().includes(d)||(h.data||"").toLowerCase().includes(d))},[n,l]),c=K([o]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading events..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(U,{search:l,onSearchChange:i,placeholder:"Filter events...",summary:`${o.length} events`}),o.length===0?t("div",{className:"ss-dbg-empty",children:"No events captured"}):t("table",{ref:c,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"20%"}}),t("col",{}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Event"}),t("th",{children:"Data"}),t("th",{children:"Time"})]})}),t("tbody",{children:o.map(u=>{const d=Be(u);return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:u.id}),t("td",{className:"ss-dbg-event-name",children:u.event}),t("td",{className:"ss-dbg-event-data",children:t(ye,{data:u.data,maxPreviewLength:80,classPrefix:"ss-dbg"})}),t("td",{children:t(J,{ts:d,className:"ss-dbg-event-time"})})]},u.id)})})]})]})}const Or=Object.freeze(Object.defineProperty({__proto__:null,EventsTab:Rt,default:Rt},Symbol.toStringTag,{value:"Module"}));function jr({email:e,previewHtml:n,isLoading:r=!1,onClose:s,className:l}){return t("div",{className:l||"ss-email-preview",children:[t("div",{className:"ss-email-preview-header",children:[t("div",{className:"ss-email-preview-meta",children:e&&t(E,{children:[e.subject!=null&&t("div",{children:[t("strong",{children:"Subject:"})," ",e.subject]}),e.from!=null&&t("div",{children:[t("strong",{children:"From:"})," ",e.from]}),e.to!=null&&t("div",{children:[t("strong",{children:"To:"})," ",e.to]}),e.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",e.cc]}),e.status&&t("div",{children:[t("strong",{children:"Status:"})," ",t("span",{className:`ss-email-status ss-email-status-${e.status}`,children:e.status})]}),e.mailer&&t("div",{children:[t("strong",{children:"Mailer:"})," ",e.mailer]})]})}),t("button",{className:"ss-dbg-btn-clear",onClick:s,type:"button",children:"×"})]}),r?t("div",{className:"ss-empty",children:"Loading preview..."}):n?t("iframe",{className:"ss-email-iframe",srcDoc:n,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:e?.text||"No content"})]})}function Ft({options:e}){const{data:n,isLoading:r,error:s}=H("emails",e),[l,i]=x(""),[o,c]=x(null),[u,d]=x(null),[h,a]=x(!1),p=T(()=>{const _=n?.emails||[];if(!l)return _;const w=l.toLowerCase();return _.filter(N=>(N.subject||"").toLowerCase().includes(w)||(N.to||"").toLowerCase().includes(w)||(N.from||"").toLowerCase().includes(w)||(N.mailer||"").toLowerCase().includes(w))},[n,l]),f=T(()=>p.find(_=>_.id===o),[p,o]),m=C(async _=>{if(c(_.id),d(_.html||null),!_.html&&_.id){a(!0);try{const w=e?.debugEndpoint||"/admin/api/debug",N={};e?.authToken&&(N.Authorization=`Bearer ${e.authToken}`);const b=await fetch(`${w}/emails/${_.id}/preview`,{headers:N,credentials:e?.authToken?"omit":"include"});b.ok&&d(await b.text())}catch{}finally{a(!1)}}},[e]),y=C(()=>{c(null),d(null),a(!1)},[]),v={sent:"ss-dbg-email-status-sent",sending:"ss-dbg-email-status-sending",queueing:"ss-dbg-email-status-queued",queued:"ss-dbg-email-status-queued",failed:"ss-dbg-email-status-failed"},g=K([p]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading emails..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):f?t(jr,{email:f,previewHtml:u,isLoading:h,onClose:y,className:"ss-dbg-email-preview"}):t("div",{children:[t(U,{search:l,onSearchChange:i,placeholder:"Filter emails...",summary:`${p.length} emails`}),p.length===0?t("div",{className:"ss-dbg-empty",children:"No emails captured"}):t("table",{ref:g,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"140px"}}),t("col",{style:{width:"140px"}}),t("col",{}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"40px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"From"}),t("th",{children:"To"}),t("th",{children:"Subject"}),t("th",{children:"Status"}),t("th",{children:"Mailer"}),t("th",{title:"Attachments",children:"📎"}),t("th",{children:"Time"})]})}),t("tbody",{children:p.map(_=>t("tr",{className:"ss-dbg-email-row",onClick:()=>m(_),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:_.id}),t("td",{className:"ss-dbg-c-secondary",title:_.from,children:_.from}),t("td",{className:"ss-dbg-c-secondary",title:_.to,children:_.to}),t("td",{className:"ss-dbg-c-sql",children:_.subject}),t("td",{children:t("span",{className:`ss-dbg-email-status ${v[_.status]||""}`,children:_.status})}),t("td",{className:"ss-dbg-c-muted",children:_.mailer}),t("td",{className:"ss-dbg-c-dim",style:{textAlign:"center"},children:_.attachmentCount>0?_.attachmentCount:"-"}),t("td",{children:t(J,{ts:Be(_),className:"ss-dbg-event-time"})})]},_.id))})]})]})}const Ir=Object.freeze(Object.defineProperty({__proto__:null,EmailsTab:Ft,default:Ft},Symbol.toStringTag,{value:"Module"}));function Br({color:e="muted",children:n,className:r="",classPrefix:s="ss-dash"}){return t("span",{className:`${s}-badge ${s}-badge-${e} ${r}`,children:n})}function ve({method:e,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-method ${r}-method-${e.toLowerCase()} ${n}`,children:e})}function Ht({code:e,className:n="",classPrefix:r="ss-dash"}){let s=`${r}-status-2xx`;return e>=500?s=`${r}-status-5xx`:e>=400?s=`${r}-status-4xx`:e>=300&&(s=`${r}-status-3xx`),t("span",{className:`${r}-status ${s} ${n}`,children:e})}function Ut({options:e,currentPath:n}){const{data:r,isLoading:s,error:l}=H("routes",e),[i,o]=x(""),c=T(()=>{const d=r?.routes||[];if(!i)return d;const h=i.toLowerCase();return d.filter(a=>a.pattern.toLowerCase().includes(h)||a.handler.toLowerCase().includes(h)||a.method.toLowerCase().includes(h)||a.name&&a.name.toLowerCase().includes(h))},[r,i]),u=K([c]);return s&&!r?t("div",{className:"ss-dbg-empty",children:"Loading routes..."}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[t(U,{search:i,onSearchChange:o,placeholder:"Filter routes...",summary:`${c.length} routes`}),c.length===0?t("div",{className:"ss-dbg-empty",children:"No routes found"}):t("table",{ref:u,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"70px"}}),t("col",{style:{width:"25%"}}),t("col",{style:{width:"15%"}}),t("col",{}),t("col",{style:{width:"20%"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Method"}),t("th",{children:"Pattern"}),t("th",{children:"Name"}),t("th",{children:"Handler"}),t("th",{children:"Middleware"})]})}),t("tbody",{children:c.map((d,h)=>{const a=n&&(d.pattern===n||new RegExp("^"+d.pattern.replace(/:[^/]+/g,"[^/]+")+"$").test(n));return t("tr",{className:a?"ss-dbg-current-route":"",children:[t("td",{children:t(ve,{method:d.method,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-text",children:d.pattern}),t("td",{className:"ss-dbg-c-muted",children:d.name||"-"}),t("td",{className:"ss-dbg-c-sql",children:d.handler}),t("td",{className:"ss-dbg-c-dim",style:{fontSize:"10px"},children:d.middleware.length>0?d.middleware.join(", "):"-"})]},`${d.method}-${d.pattern}-${h}`)})})]})]})}const Rr=Object.freeze(Object.defineProperty({__proto__:null,RoutesTab:Ut,default:Ut},Symbol.toStringTag,{value:"Module"}));function Fr(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return null}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function zt(e){const n={};for(const[r,s]of Object.entries(e))Vr.has(r)||(n[r]=s);return Object.keys(n).length>0?n:null}const Hr=["all","error","warn","info","debug"];function qt(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Vt(e){return e.msg||e.message||JSON.stringify(e)}function Ur(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Wt(e){const n=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||n.requestId||n.request_id||n["x-request-id"]||""}function zr(e,n="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${n}-error`;case"warn":return`${n}-warn`;case"info":return`${n}-info`;case"debug":return`${n}-debug`;case"trace":return`${n}-trace`;default:return`${n}-info`}}function qr(e,n){return n==="all"?e:e.filter(r=>{const s=qt(r);return n==="error"?s==="error"||s==="fatal":s===n})}const Vr=new Set(["level","time","pid","hostname","msg","message","v","name","levelName","level_name","timestamp","createdAt","created_at","requestId","request_id","x-request-id","id","data"]);function Wr(e){if(e.data){const n=Fr(e.data);if(n){const r=zt(n);if(r)return r}}return zt(e)}function Jt({log:e,index:n,expanded:r,onToggleExpand:s,onReqIdClick:l}){const i=qt(e),o=Vt(e),c=Ur(e),u=Wt(e),d=Wr(e);return t(Tt.Fragment,{children:[t("div",{className:`ss-log-entry${d?" ss-log-entry-expandable":""}`,onClick:()=>d&&s(n),children:[t("span",{className:`ss-log-level ${zr(i,"ss-log-level")}`,children:i.toUpperCase()}),t(J,{ts:c,className:"ss-log-time"}),u?t("span",{className:"ss-log-reqid",title:u,onClick:l?h=>{h.stopPropagation(),l(u)}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,onKeyDown:l?h=>{h.key==="Enter"&&(h.stopPropagation(),l(u))}:void 0,children:u.slice(0,8)}):t("span",{className:"ss-log-reqid-empty",children:"--"}),d?t("span",{className:`ss-log-expand-icon${r?" ss-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-log-msg",children:o})]}),r&&d&&t("div",{className:"ss-log-detail",children:t(ye,{data:d,classPrefix:"ss-dbg",defaultExpanded:!0})})]})}function Kt({options:e}){const{data:n,isLoading:r,error:s}=H("logs",e),[l,i]=x("all"),[o,c]=x(""),[u,d]=x(""),[h,a]=x(null),p=T(()=>{let m=Array.isArray(n)?n:n?.logs||n?.entries||[];if(m=qr(m,l),u){const y=u.toLowerCase();m=m.filter(v=>Wt(v).toLowerCase().includes(y))}if(o){const y=o.toLowerCase();m=m.filter(v=>Vt(v).toLowerCase().includes(y))}return m},[n,l,o,u]),f=C(m=>{d(y=>y===m?"":m)},[]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading logs..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t("div",{className:"ss-dbg-log-filters",children:[Hr.map(m=>t("button",{type:"button",className:`ss-dbg-log-filter ${l===m?"ss-dbg-active":""}`,onClick:()=>i(m),children:m},m)),u&&t("button",{type:"button",className:"ss-dbg-log-filter ss-dbg-active",onClick:()=>d(""),children:["req: ",u.slice(0,8)," x"]}),t("span",{className:"ss-dbg-summary",style:{marginLeft:"auto"},children:[p.length," entries"]})]}),t(U,{search:o,onSearchChange:c,placeholder:"Filter log messages..."}),t("div",{style:{overflow:"auto",flex:1},children:p.length===0?t("div",{className:"ss-dbg-empty",children:"No log entries"}):p.slice(0,200).map((m,y)=>t(Jt,{log:m,index:y,expanded:h===y,onToggleExpand:v=>a(h===v?null:v),onReqIdClick:f},y))})]})}const Jr=Object.freeze(Object.defineProperty({__proto__:null,LogsTab:Kt,default:Kt},Symbol.toStringTag,{value:"Module"}));function Qt(e="",n){const r=j(null);return C(()=>(r.current||(r.current=new De({baseUrl:e,authToken:n})),r.current),[e,n])}function Kr({logs:e,onReqIdClick:n}){const[r,s]=x(null);return e.length===0?null:t("div",{children:[t("div",{className:"ss-related-logs-title",children:["Related Logs",t("span",{className:"ss-related-logs-count",children:["(",e.length,")"]})]}),t("div",{style:{overflow:"auto"},children:e.map((l,i)=>t(Jt,{log:l,index:i,expanded:r===i,onToggleExpand:o=>s(r===o?null:o),onReqIdClick:n},l.id||i))})]})}function Qr(e){const{container:n,handle:r,topPane:s,bottomPane:l,storageKey:i,minHeight:o=60}=e;if(i){const u=localStorage.getItem(i);if(u){const d=parseFloat(u);d>0&&d<1&&(s.style.flex=`${d}`,l.style.flex=`${1-d}`)}}function c(u){u.preventDefault(),r.setPointerCapture(u.pointerId);const h=n.getBoundingClientRect().height,a=u.clientY,p=s.getBoundingClientRect().height;function f(y){const v=y.clientY-a;let g=p+v;const _=h-o-r.offsetHeight;g=Math.max(o,Math.min(g,_));const w=g/(h-r.offsetHeight);s.style.flex=`${w}`,l.style.flex=`${1-w}`}function m(){if(r.removeEventListener("pointermove",f),r.removeEventListener("pointerup",m),i){const y=n.getBoundingClientRect().height-r.offsetHeight;if(y>0){const v=s.getBoundingClientRect().height/y;localStorage.setItem(i,String(v))}}}r.addEventListener("pointermove",f),r.addEventListener("pointerup",m)}return r.addEventListener("pointerdown",c),()=>{r.removeEventListener("pointerdown",c)}}function Gr({children:e,storageKey:n}){const r=j(null),s=j(null),l=j(null),i=j(null);return F(()=>{if(r.current&&s.current&&l.current&&i.current)return Qr({container:r.current,handle:s.current,topPane:l.current,bottomPane:i.current,storageKey:n})},[n]),t("div",{ref:r,className:"ss-split-container",children:[t("div",{ref:l,className:"ss-split-top",children:e[0]}),t("div",{ref:s,className:"ss-split-handle"}),t("div",{ref:i,className:"ss-split-bottom",children:e[1]})]})}const Gt={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"#525252"},Yr=[{label:"Request",color:"#1e3a5f"},{label:"Middleware",color:"rgba(30, 58, 95, 0.7)"},{label:"Database",color:"#6d28d9"},{label:"View",color:"#0e7490"},{label:"Mail",color:"#059669"},{label:"Event",color:"#b45309"}];function Yt({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:o}=H("timeline",e),[c,u]=x(""),[d,h]=x(null),[a,p]=x(null),[f,m]=x(!1),[y,v]=x(null),g=T(()=>{const b=l?.traces||[];if(!c)return b;const k=c.toLowerCase();return b.filter(L=>L.url.toLowerCase().includes(k)||L.method.toLowerCase().includes(k)||String(L.statusCode).includes(k))},[l,c]),_=Qt(n,s);F(()=>{if(d===null){p(null),v(null);return}let b=!1;return m(!0),v(null),_().get(`${r}/traces/${d}`).then(L=>{b||(p(L),m(!1))}).catch(L=>{b||(v(L instanceof Error?L.message:"Failed to load trace"),m(!1))}),()=>{b=!0}},[d,r,_]);const w=C(b=>{h(k=>k===b?null:b)},[]),N=K([g]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading traces..."});if(o)return t("div",{className:"ss-dbg-empty",children:["Error: ",o.message]});if(d!==null){if(f)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});if(y)return t("div",{children:[t("div",{className:"ss-dbg-tl-detail-header",children:t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"})}),t("div",{className:"ss-dbg-empty",children:["Error: ",y]})]});if(!a)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});const b=a.spans||[],k=a.warnings||[],L=a.logs||[],O=L.length>0,M=t("div",{children:[t("div",{className:"ss-dbg-tl-legend",children:Yr.map(S=>t("div",{className:"ss-dbg-tl-legend-item",children:[t("div",{className:"ss-dbg-tl-legend-dot",style:{background:S.color}}),t("span",{children:S.label})]},S.label))}),t("div",{style:{padding:"8px 12px",overflow:"auto"},children:b.length===0?t("div",{className:"ss-dbg-empty",children:"No spans captured for this request"}):b.map(S=>{const I=a.totalDuration||1,ze=S.startOffset/I*100,re=Math.max(S.duration/I*100,.5);return t("div",{className:"ss-dbg-tl-row",children:[t("div",{className:"ss-dbg-tl-label",title:S.label,children:S.label}),t("div",{className:"ss-dbg-tl-track",children:t("div",{className:`ss-dbg-tl-bar ss-dbg-tl-bar-${S.category}`,style:{left:`${ze}%`,width:`${re}%`,background:Gt[S.category]||Gt.custom},title:`${S.label}: ${V(S.duration)}`})}),t("span",{className:"ss-dbg-tl-dur",children:V(S.duration)})]},S.id)})}),k.length>0&&t("div",{className:"ss-dbg-tl-warnings",children:[t("div",{className:"ss-dbg-tl-warnings-title",children:"Warnings"}),k.map((S,I)=>t("div",{className:"ss-dbg-tl-warning",children:S},I))]})]});return t("div",{className:"ss-dbg-tl-detail-wrapper",children:[t("div",{className:"ss-dbg-tl-detail-header",children:[t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"}),t(ve,{method:a.method,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-detail-url",children:a.url}),t(Ht,{code:a.statusCode,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-meta",children:[V(a.totalDuration)," · ",a.spanCount," spans"]})]}),O?t(Gr,{storageKey:"ss-dbg-timeline-split",children:[M,t(Kr,{logs:L})]}):M]})}return t("div",{children:[t(U,{search:c,onSearchChange:u,placeholder:"Filter traces...",summary:`${g.length} traces`}),g.length===0?t("div",{className:"ss-dbg-empty",children:"No traces captured. Enable tracing in config."}):t("table",{ref:N,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"70px"}}),t("col",{}),t("col",{style:{width:"60px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Method"}),t("th",{children:"URL"}),t("th",{children:"Status"}),t("th",{children:"Duration"}),t("th",{children:"Spans"}),t("th",{children:"Time"})]})}),t("tbody",{children:g.map(b=>t("tr",{className:"ss-dbg-email-row",onClick:()=>w(b.id),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:b.id}),t("td",{children:t(ve,{method:b.method,classPrefix:"ss-dbg"})}),t("td",{title:b.url,children:b.url}),t("td",{children:t(Ht,{code:b.statusCode,classPrefix:"ss-dbg"})}),t("td",{className:`ss-dbg-duration ${_e(b.totalDuration,"ss-dbg")}`,children:V(b.totalDuration)}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:b.spanCount}),t("td",{children:t(J,{ts:b.timestamp,className:"ss-dbg-event-time"})})]},b.id))})]})]})}const Xr=Object.freeze(Object.defineProperty({__proto__:null,TimelineTab:Yt,default:Yt},Symbol.toStringTag,{value:"Module"}));function Fe(e,n){const r=T(()=>e?e.replace(/\/+$/,"")+"/api":null,[e]),s=T(()=>r?{...n,debugEndpoint:r}:n,[r,n]);return{dashApiBase:r,resolvedOptions:s}}function Zr({hitRate:e,hits:n,misses:r,keys:s}){return t("div",{className:"ss-cache-stats",children:[t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-cache-stat-value",children:[e.toFixed(1),"%"]})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-cache-stat-value",children:n})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-cache-stat-value",children:r})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-cache-stat-value",children:s})]})]})}function Xt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=Fe(n,e),{data:l,isLoading:i,error:o}=H("cache",s),[c,u]=x(""),[d,h]=x(null),[a,p]=x(null),f=T(()=>{const _=l?.keys||[];if(!c)return _;const w=c.toLowerCase();return _.filter(N=>N.key.toLowerCase().includes(w))},[l,c]),m=C(async _=>{if(d===_){h(null),p(null);return}h(_);try{const{baseUrl:w="",authToken:N}=e||{},b=r||e?.debugEndpoint||"/admin/api/debug",k=`${w}${b}/cache/${encodeURIComponent(_)}`,L={Accept:"application/json"};N&&(L.Authorization=`Bearer ${N}`);const M=await(await fetch(k,{headers:L,credentials:N?"omit":"same-origin"})).json();p(M)}catch{p({error:"Failed to fetch key value"})}},[d,e,r]),y=K([f]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading cache data..."});if(o)return t("div",{className:"ss-dbg-empty",children:["Error: ",o.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Cache inspector not available"});const g=l.stats||l;return t("div",{children:[t(Zr,{hitRate:g.hitRate??0,hits:g.totalHits??0,misses:g.totalMisses??0,keys:g.keyCount??0}),t(U,{search:c,onSearchChange:u,placeholder:"Filter keys...",summary:`${f.length} keys`}),d&&!!a&&t("div",{className:"ss-dbg-cache-detail",children:[t("strong",{children:d}),t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:["←"," Back"]}),t(ye,{data:a,classPrefix:"ss-dbg"})]}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No cache keys found"}):t("table",{ref:y,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Key"}),t("th",{children:"Type"}),t("th",{children:"TTL"}),t("th",{children:"Size"})]})}),t("tbody",{children:f.map(_=>t("tr",{className:"ss-dbg-email-row",onClick:()=>m(_.key),children:[t("td",{className:"ss-dbg-c-sql",children:_.key}),t("td",{className:"ss-dbg-c-muted",children:_.type}),t("td",{className:"ss-dbg-c-muted",children:_.ttl>0?cr(_.ttl):"-"}),t("td",{className:"ss-dbg-c-dim",children:_.size>0?dr(_.size):"-"})]},_.key))})]})]})}const es=Object.freeze(Object.defineProperty({__proto__:null,CacheTab:Xt,default:Xt},Symbol.toStringTag,{value:"Module"})),ts=["all","active","waiting","delayed","completed","failed"];function ns(e,n="ss-dbg-job-status"){switch(e){case"completed":case"failed":case"active":case"waiting":case"delayed":return`${n}-${e}`;default:return"ss-dbg-badge-muted"}}function rs(e){if(!e)return[];if(Array.isArray(e))return e;const n=e;return n.jobs||n.data||[]}function ss(e){if(!e||Array.isArray(e))return null;const n=e;return n.stats||n.overview||null}function ls({stats:e,classPrefix:n="ss"}){if(!e)return null;const r=n;return t("div",{className:`${r}-job-stats`,children:[t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Active:"}),t("span",{className:`${r}-job-stat-value`,children:e.active??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Waiting:"}),t("span",{className:`${r}-job-stat-value`,children:e.waiting??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Delayed:"}),t("span",{className:`${r}-job-stat-value`,children:e.delayed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Completed:"}),t("span",{className:`${r}-job-stat-value`,children:e.completed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Failed:"}),t("span",{className:`${r}-job-stat-value ${r}-c-red`,children:e.failed??0})]})]})}function Zt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=Fe(n,e),{data:l,isLoading:i,error:o}=H("jobs",s),[c,u]=x(""),[d,h]=x("all"),[a,p]=x(null),f=T(()=>{const g=rs(l),_=d==="all"?g:g.filter(N=>N.status===d);if(!c)return _;const w=c.toLowerCase();return _.filter(N=>N.name?.toLowerCase().includes(w)||N.id?.toString().includes(w))},[l,d,c]),m=C(async g=>{p(g);try{const{baseUrl:_="",authToken:w}=e||{},N=r||e?.debugEndpoint||"/admin/api/debug",b=`${_}${N}/jobs/${g}/retry`,k={Accept:"application/json"};w&&(k.Authorization=`Bearer ${w}`),await fetch(b,{method:"POST",headers:k,credentials:w?"omit":"same-origin"})}catch{}p(null)},[e,r]),y=K([f]);if(!r)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available (no dashboard configured)"});if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading jobs..."});if(o)return t("div",{className:"ss-dbg-empty",children:["Error: ",o.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available"});const v=ss(l);return t("div",{children:[t(U,{search:c,onSearchChange:u,placeholder:"Filter jobs...",summary:`${f.length} jobs`}),t("div",{className:"ss-dbg-job-stats-area",children:[t(ls,{stats:v,classPrefix:"ss-dbg"}),t("div",{className:"ss-dbg-log-filters",children:ts.map(g=>t("button",{type:"button",className:`ss-dbg-job-filter ${d===g?"ss-dbg-active":""}`,onClick:()=>h(g),children:g},g))})]}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No jobs found"}):t("table",{ref:y,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"15%"}}),t("col",{style:{width:"80px"}}),t("col",{}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"60px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"ID"}),t("th",{children:"Name"}),t("th",{children:"Status"}),t("th",{children:"Payload"}),t("th",{children:"Tries"}),t("th",{children:"Duration"}),t("th",{children:"Time"}),t("th",{})]})}),t("tbody",{children:f.map(g=>{const _=g;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",children:g.id}),t("td",{className:"ss-dbg-c-sql",title:g.name,children:g.name}),t("td",{children:t("span",{className:`ss-dbg-badge ${ns(g.status)}`,children:g.status})}),t("td",{children:t(ye,{data:g.payload||g.data,maxPreviewLength:60,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:g.attempts||_.attemptsMade||0}),t("td",{className:"ss-dbg-duration",children:g.duration!==null?V(g.duration):"-"}),t("td",{children:t(J,{ts:ur(_),className:"ss-dbg-event-time"})}),t("td",{children:g.status==="failed"&&t("button",{type:"button",className:"ss-dbg-retry-btn",onClick:()=>m(g.id),disabled:a===g.id,children:a===g.id?"...":"Retry"})})]},g.id)})})]})]})}const is=Object.freeze(Object.defineProperty({__proto__:null,JobsTab:Zt,default:Zt},Symbol.toStringTag,{value:"Module"}));function R(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function we(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!R(e)}function He(e,n=""){if(!we(e))return[{path:n,value:e}];const r=[];for(const s of Object.keys(e)){const l=n?`${n}.${s}`:s,i=e[s];we(i)?r.push(...He(i,l)):r.push({path:l,value:i})}return r}function Ue(e){return e==null?{text:"null",color:"var(--ss-dim)"}:typeof e=="boolean"?{text:String(e),color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"}:typeof e=="number"?{text:String(e),color:"var(--ss-amber-fg)"}:Array.isArray(e)?{text:`[${e.map(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function en(e){if(e==null||typeof e!="object"||Array.isArray(e)||R(e))return 1;let n=0;for(const r of Object.keys(e))n+=en(e[r]);return n}function as(e){if(!we(e))return[];const n=[];for(const r of Object.keys(e))we(e[r])&&n.push(r);return n}function xe(e,n,r){n&&navigator.clipboard.writeText(e).then(()=>{const s=n.textContent;n.textContent="✓",n.classList.add(`${r}-copy-row-ok`),setTimeout(()=>{n.textContent=s,n.classList.remove(`${r}-copy-row-ok`)},1200)}).catch(()=>{})}function Ne({redacted:e,p:n}){const[r,s]=x(!1);return t("span",{className:`${n}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:r?e.value:e.display}),t("button",{type:"button",className:`${n}-btn`,title:r?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:l=>{l.stopPropagation(),s(i=>!i)},children:r?t("svg",{width:"14",height:"14",viewBox:P["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:P.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.eye.elements.join("")}})})]})}function os({env:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=Object.entries(e).filter(([o,c])=>{if(!l)return!0;const u=R(c)?c.display:c==null?"":String(c);return o.toLowerCase().includes(l)||u.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:t("table",{className:`${r}-table ${r}-config-env-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Variable"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[i.map(([o,c])=>{const u=R(c),d=u?c.display:c==null?"null":String(c),h=`${o}=${d}`;return t("tr",{children:[t("td",{className:`${r}-env-key`,children:t("span",{className:`${r}-config-key`,children:o})}),t("td",{className:`${r}-env-val`,children:u?t(Ne,{redacted:c,p:r}):t("span",{className:`${r}-config-val`,children:d})}),t("td",{children:!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:a=>{s.current.set(o,a)},onClick:a=>{a.stopPropagation(),xe(h,s.current.get(o)??null,r)},children:"⎘"})})]},o)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function cs({source:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=He(e,""),o=i.filter(c=>{const u=R(c.value)?c.value.display:c.value===null||c.value===void 0?"":String(c.value);return c.path.toLowerCase().includes(l)||u.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:[t("table",{className:`${r}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[o.map(c=>{const u=R(c.value),d=u?null:Ue(c.value),h=u?c.value.display:d.text,a=`${c.path}: ${h}`;return t("tr",{children:[t("td",{children:t("span",{className:`${r}-config-key`,style:{whiteSpace:"nowrap"},children:c.path})}),t("td",{children:u?t(Ne,{redacted:c.value,p:r}):t("span",{className:`${r}-config-val`,style:{wordBreak:"break-all",color:d.color},children:d.text})}),t("td",{children:!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:p=>{s.current.set(c.path,p)},onClick:p=>{p.stopPropagation(),xe(a,s.current.get(c.path)??null,r)},children:"⎘"})})]},c.path)}),o.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching entries"})})]})]}),t("div",{style:{padding:"4px 16px",fontSize:"10px",color:"var(--ss-muted)"},children:[o.length," of ",i.length," entries"]})]})}function ds({obj:e,prefix:n,p:r}){const s=j(new Map),l=He(e,n);return t("table",{className:`${r}-table ${r}-config-inner-table`,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"35%"},children:"Key"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:l.map(i=>{const o=i.path.indexOf(n+".")===0?i.path.slice(n.length+1):i.path,c=R(i.value),u=c?null:Ue(i.value),d=c?i.value.display:u.text,h=`${i.path}: ${d}`;return t("tr",{children:[t("td",{title:o,children:t("span",{className:`${r}-config-key`,children:o})}),t("td",{title:d,children:c?t(Ne,{redacted:i.value,p:r}):t("span",{className:`${r}-config-val`,style:{color:u.color},children:u.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:a=>{s.current.set(i.path,a)},onClick:a=>{a.stopPropagation(),xe(h,s.current.get(i.path)??null,r)},children:"⎘"})})]},i.path)})})]})}function us({value:e,p:n}){if(e==null)return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(R(e))return t(Ne,{redacted:e,p:n});if(typeof e=="boolean")return t("span",{className:`${n}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const r=e.map(s=>s==null?"null":typeof s=="object"?JSON.stringify(s):String(s));return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",r.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${n}-config-val`,children:String(e)})}function hs({obj:e,expandedPaths:n,onToggle:r,p:s}){if(e==null||typeof e!="object"||Array.isArray(e)||R(e))return null;const l=Object.keys(e),i=j(new Map);return t("div",{className:`${s}-config-sections`,children:l.map(o=>{const c=e[o],u=c!==null&&typeof c=="object"&&!Array.isArray(c)&&!R(c),d=n.has(o),h=R(c);return t("div",{className:`${s}-config-section`,children:[t("div",{className:`${s}-config-section-header${u?"":` ${s}-config-leaf`}`,onClick:u?()=>r(o):void 0,style:{cursor:u?"pointer":"default"},children:[u?t("span",{className:`${s}-config-toggle`,children:d?"▼":"▶"}):t("span",{className:`${s}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${s}-config-key`,children:o}),u?t("span",{className:`${s}-config-count`,children:[en(c)," entries"]}):t(E,{children:[t("span",{className:`${s}-config-val`,style:{marginLeft:"8px"},children:t(us,{value:c,p:s})}),!h&&t("button",{type:"button",className:`${s}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:a=>{i.current.set(o,a)},onClick:a=>{a.stopPropagation();const p=Ue(c);xe(`${o}: ${p.text}`,i.current.get(o)??null,s)},children:"⎘"})]})]}),u&&d&&t("div",{className:`${s}-config-section-body`,children:t(ds,{obj:c,prefix:o,p:s})})]},o)})})}function fs({data:e,isLoading:n,classPrefix:r}){const s=r,[l,i]=x(""),[o,c]=x(""),[u,d]=x("app"),[h,a]=x(new Set),[p,f]=x("Copy JSON");F(()=>{const w=setTimeout(()=>c(l),200);return()=>clearTimeout(w)},[l]);const m=e,y=C(w=>{a(N=>{const b=new Set(N);return b.has(w)?b.delete(w):b.add(w),b})},[]),v=C(()=>{if(!m)return;const w=u==="app"?m.app:m.env;if(!w)return;const N=as(w);a(new Set(N))},[m,u]),g=C(()=>{a(new Set)},[]),_=C(async()=>{if(m)try{const w=u==="app"?m.app:m.env;await navigator.clipboard.writeText(JSON.stringify(w,null,2)),f("Copied!"),setTimeout(()=>f("Copy JSON"),1500)}catch{}},[m,u]);return t("div",{children:[t("div",{className:`${s}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${s}-config-tab${u==="app"?` ${s}-active`:""}`,onClick:()=>d("app"),children:"App Config"}),t("button",{type:"button",className:`${s}-config-tab${u==="env"?` ${s}-active`:""}`,onClick:()=>d("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${s}-search`,placeholder:"Search keys and values...",value:l,onChange:w=>i(w.target.value),style:{width:"100%"}}),l&&t("button",{type:"button",onClick:()=>i(""),style:{position:"absolute",right:"6px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"14px",color:"var(--ss-dim)",padding:"0 2px",lineHeight:1},children:"×"})]}),u==="app"&&!o&&t(E,{children:[t("button",{type:"button",className:`${s}-btn`,onClick:v,children:"Expand All"}),t("button",{type:"button",className:`${s}-btn`,onClick:g,children:"Collapse All"})]}),t("button",{type:"button",className:`${s}-btn`,onClick:_,children:p})]}),n&&!e?t("div",{className:`${s}-empty`,children:"Loading config..."}):m?u==="env"?t(os,{env:m.env??{},search:o,p:s}):o?t(cs,{source:m.app??{},search:o,p:s}):t("div",{className:`${s}-config-table-wrap`,children:t(hs,{obj:m.app,expandedPaths:h,onToggle:y,p:s})}):t("div",{className:`${s}-empty`,children:"Config not available"})]})}function tn({options:e,dashboardPath:n}){const{resolvedOptions:r}=Fe(n,e),{data:s,isLoading:l,error:i}=H("config",r);return i?t("div",{className:"ss-dbg-empty",children:["Error: ",i.message]}):t(fs,{data:s,isLoading:l,classPrefix:"ss-dbg"})}const ps=Object.freeze(Object.defineProperty({__proto__:null,ConfigTab:tn,default:tn},Symbol.toStringTag,{value:"Module"}));function ms(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s,refreshInterval:l=3e3}=e,[i,o]=x(null),[c,u]=x(!0),[d,h]=x(null),a=j(null),p=Qt(n,s),f=C(async()=>{try{const y=await p().get(`${r}/diagnostics`);o(y),h(null),u(!1)}catch(m){if(m instanceof pe){h(m),u(!1),a.current&&(clearInterval(a.current),a.current=null);return}h(m instanceof Error?m:new Error(String(m))),u(!1)}},[r,p]);return F(()=>(u(!0),h(null),f(),a.current=setInterval(f,l),()=>{a.current&&(clearInterval(a.current),a.current=null)}),[f,l]),{data:i,isLoading:c,error:d}}const _s=["password","secret","token","key","credential","auth"];function nn(e){const n=e.toLowerCase();return _s.some(r=>n.includes(r))}function rn(e){if(e==null)return"-";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.join(", ")||"-";try{return JSON.stringify(e)}catch{return String(e)}}const gs={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function bs(e){return gs[e]||e}const ys={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function vs(e){return ys[e]||e}const ws=["healthy","active","connected","available","ready"],xs=["errored","unavailable"];function Ns(e){return ws.includes(e)?"ok":xs.includes(e)?"err":""}function te({status:e,prefix:n}){const r=Ns(e);let s=`${n}-dot`;return r==="ok"?s+=` ${n}-dot-ok`:r==="err"&&(s+=` ${n}-dot-err`),t("span",{className:s})}const sn=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:P.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.eye.elements.join("")}}),ln=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:P["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P["eye-off"].elements.join("")}});function $s({value:e}){const[n,r]=x(!1);return t("span",{children:[n?e:"••••••••"," ",t("button",{type:"button",onClick:()=>r(s=>!s),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:n?t(ln,{}):t(sn,{})})]})}function ks({current:e,max:n,prefix:r}){const s=n>0?Math.min(100,Math.round(e/n*100)):0,l=s>=100;return t("div",{className:`${r}-bar`,children:[t("div",{className:`${r}-bar-track`,children:t("div",{className:`${r}-bar-fill${l?` ${r}-bar-fill-warn`:""}`,style:{width:`${s}%`}})}),t("span",{className:`${r}-bar-pct${l?` ${r}-bar-pct-warn`:""}`,children:[s,"%"]})]})}function Cs({config:e,prefix:n}){const r=Object.entries(e);return r.length===0?t("span",{className:`${n}-c-dim`,children:"-"}):t("span",{className:`${n}-c-muted`,children:r.map(([s,l],i)=>t("span",{children:[i>0&&", ",t("span",{className:`${n}-c-dim`,children:s}),"=",nn(s)&&typeof l=="string"?t($s,{value:l}):t("span",{children:rn(l)})]},s))})}function ne({label:e,value:n,prefix:r}){return t("div",{className:`${r}-info-card`,children:[t("span",{className:`${r}-info-card-label`,children:e}),t("span",{className:`${r}-info-card-value`,children:n})]})}function Ss({data:e,tableClassName:n,classPrefix:r}){const s=r||"ss-dash",[l,i]=x(new Set),o=C(h=>{i(a=>{const p=new Set(a);return p.has(h)?p.delete(h):p.add(h),p})},[]),c=C((h,a)=>{if(a==null)return t("span",{className:`${s}-c-dim`,children:"null"});if(typeof a=="boolean")return t("span",{className:a?`${s}-c-green`:`${s}-c-red`,children:String(a)});if(Array.isArray(a))return t("span",{children:a.join(", ")||"-"});const p=rn(a);if(nn(h)){const f=l.has(h);return t("span",{children:[f?p:"••••••••"," ",t("button",{type:"button",onClick:()=>o(h),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:f?t(ln,{}):t(sn,{})})]})}return t("span",{children:p})},[l,o,s]),d=e.collectors?.some(h=>h.name==="db_pool"||h.name==="app")&&Array.isArray(e.lucidDebugConnections)&&e.lucidDebugConnections.length===0;return t("div",{children:[d&&t("div",{style:{background:"var(--ss-amber-bg)",color:"var(--ss-amber-fg)",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",marginBottom:"12px",lineHeight:1.5},children:[t("strong",{children:"Query capture disabled"})," — no Lucid connections have"," ",t("code",{style:{fontSize:"11px"},children:"debug: true"}),". Add it to your database connection in ",t("code",{style:{fontSize:"11px"},children:"config/database.ts"})," to see queries in the Queries panel."]}),t("h3",{className:`${s}-internals-title`,children:"Package Info"}),t("div",{className:`${s}-info-cards`,children:[t(ne,{label:"Version",value:e.package.version||"-",prefix:s}),t(ne,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:s}),t(ne,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:s}),t(ne,{label:"Uptime",value:ir(e.package.uptime),prefix:s}),t(ne,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:s})]}),e.collectors.length>0&&t(E,{children:[t("h3",{className:`${s}-internals-title`,children:"Collectors"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Collector"}),t("th",{children:"Status"}),t("th",{children:"Last Error"}),t("th",{children:"Config"})]})}),t("tbody",{children:e.collectors.map(h=>t("tr",{children:[t("td",{children:[t("code",{children:h.name}),h.label&&h.label!==h.name&&t("span",{className:`${s}-c-dim`,children:[" ",h.label]})]}),t("td",{children:[t(te,{status:h.status,prefix:s}),h.status]}),t("td",{className:h.lastError?`${s}-c-red`:`${s}-c-dim`,children:h.lastError?t(E,{children:[h.lastError,h.lastErrorAt&&t("span",{className:`${s}-c-dim`,style:{fontSize:"10px"},children:Ie(h.lastErrorAt)})]}):"-"}),t("td",{children:t(Cs,{config:h.config,prefix:s})})]},h.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Buffers"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Buffer"}),t("th",{children:"Usage"}),t("th",{children:"Fill %"})]})}),t("tbody",{children:Object.entries(e.buffers).map(([h,a])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:h}),t("td",{children:[a.current.toLocaleString()," / ",a.max.toLocaleString()]}),t("td",{children:t(ks,{current:a.current,max:a.max,prefix:s})})]},h))})]}),t("h3",{className:`${s}-internals-title`,children:"Timers"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Timer"}),t("th",{children:"Status"}),t("th",{children:"Interval"})]})}),t("tbody",{children:Object.entries(e.timers).map(([h,a])=>t("tr",{children:[t("td",{children:bs(h)}),t("td",{children:[t(te,{status:a.active?"active":"inactive",prefix:s}),t("span",{className:a.active?`${s}-c-green`:`${s}-c-dim`,children:a.active?"active":"inactive"})]}),t("td",{children:a.active?a.intervalMs?V(a.intervalMs):a.debounceMs?`${V(a.debounceMs)} (debounce)`:"-":t("span",{className:`${s}-c-dim`,children:"—"})})]},h))})]}),t("h3",{className:`${s}-internals-title`,children:"Integrations"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Integration"}),t("th",{children:"Status"}),t("th",{children:"Details"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Transmit (SSE)"}),t("td",{children:[t(te,{status:e.transmit.available?"connected":"inactive",prefix:s}),e.transmit.available?"connected":"unavailable"]}),t("td",{style:{fontSize:"11px"},children:e.transmit.channels.length>0?`Channels: ${e.transmit.channels.join(", ")}`:"-"})]}),Object.entries(e.integrations).map(([h,a])=>{const p=a.active??a.available??!1,f=a.active?"active":a.available?"available":"unavailable";let m=a.mode?`Mode: ${a.mode}`:"-";return h==="edgePlugin"&&a.active?m="@serverStats() tag registered":h==="cacheInspector"&&a.available?m="Redis dependency detected":h==="queueInspector"&&a.available&&(m="Queue dependency detected"),t("tr",{children:[t("td",{children:vs(h)}),t("td",{children:[t(te,{status:p?"active":"inactive",prefix:s}),f]}),t("td",{className:`${s}-c-dim`,style:{fontSize:"11px"},children:m})]},h)})]})]}),e.storage&&t(E,{children:[t("h3",{className:`${s}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Metric"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Status"}),t("td",{children:[t(te,{status:e.storage.ready?"ready":"inactive",prefix:s}),e.storage.ready?"ready":"not ready"]})]}),t("tr",{children:[t("td",{children:"DB Path"}),t("td",{children:t("code",{children:e.storage.dbPath})})]}),t("tr",{children:[t("td",{children:"File Size"}),t("td",{children:[e.storage.fileSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"WAL Size"}),t("td",{children:[e.storage.walSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"Retention"}),t("td",{children:[e.storage.retentionDays," days"]})]}),t("tr",{children:[t("td",{children:"Last Cleanup"}),t("td",{children:e.storage.lastCleanupAt?Ie(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:n,style:{marginTop:8},children:[t("thead",{children:t("tr",{children:[t("th",{children:"Table"}),t("th",{children:"Rows"})]})}),t("tbody",{children:e.storage.tables.map(h=>t("tr",{children:[t("td",{children:t("code",{children:h.name})}),t("td",{children:h.rowCount.toLocaleString()})]},h.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Resolved Config"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"intervalMs"}),t("td",{children:e.config.intervalMs})]}),t("tr",{children:[t("td",{children:"transport"}),t("td",{children:e.config.transport})]}),t("tr",{children:[t("td",{children:"channelName"}),t("td",{children:e.config.channelName})]}),t("tr",{children:[t("td",{children:"endpoint"}),t("td",{children:e.config.endpoint===!1?"false":e.config.endpoint})]}),t("tr",{children:[t("td",{children:"skipInTest"}),t("td",{children:c("skipInTest",e.config.skipInTest)})]}),t("tr",{children:[t("td",{children:"onStats callback"}),t("td",{children:e.config.hasOnStatsCallback?"defined":"not defined"})]}),t("tr",{children:[t("td",{children:"shouldShow callback"}),t("td",{children:e.config.hasShouldShowCallback?"defined":"not defined"})]})]})]}),t("h4",{className:`${s}-internals-title`,children:"DevToolbar"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:Object.entries(e.devToolbar).map(([h,a])=>t("tr",{children:[t("td",{children:h==="customPaneCount"?"customPanes":h}),t("td",{children:h==="customPaneCount"?`${a} registered`:c(h,a)})]},h))})]})]})}function an({options:e}){const{data:n,isLoading:r,error:s}=ms({baseUrl:e?.baseUrl,debugEndpoint:e?.debugEndpoint,authToken:e?.authToken});return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading diagnostics..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):n?t(Ss,{data:n,tableClassName:"ss-dbg-table",classPrefix:"ss-dbg"}):t("div",{className:"ss-dbg-empty",children:"Diagnostics not available"})}const Ts=Object.freeze(Object.defineProperty({__proto__:null,InternalsTab:an,default:an},Symbol.toStringTag,{value:"Module"}));function on({pane:e,options:n}){({...n});const{data:r,isLoading:s,error:l,clearData:i}=H(e.endpoint.replace(/^\//,""),{...n,debugEndpoint:""}),[o,c]=x(""),u=T(()=>{if(!r)return[];const p=e.dataKey||e.id;let f=r;for(const m of p.split("."))f=f?.[m];return Array.isArray(f)?f:[]},[r,e.dataKey,e.id]),d=T(()=>{if(!o)return u;const p=o.toLowerCase(),f=e.columns.filter(m=>m.searchable).map(m=>m.key);return f.length===0?u:u.filter(m=>f.some(y=>{const v=m[y];return v!==null&&String(v).toLowerCase().includes(p)}))},[u,o,e.columns]),h=(p,f)=>{if(p==null)return t("span",{className:"ss-dbg-c-dim",children:"-"});switch(f.format||"text"){case"time":return typeof p=="number"?t(J,{ts:p,className:"ss-dbg-event-time"}):t("span",{className:"ss-dbg-event-time",children:String(p)});case"timeAgo":return t(J,{ts:p,className:"ss-dbg-event-time"});case"duration":{const y=typeof p=="number"?p:parseFloat(String(p));return isNaN(y)?String(p):t("span",{className:`ss-dbg-duration ${_e(y,"ss-dbg")}`,children:V(y)})}case"method":return t(ve,{method:String(p),classPrefix:"ss-dbg"});case"json":{let y=p;if(typeof p=="string")try{y=JSON.parse(p)}catch{}return ge(y,80)}case"badge":{const y=String(p).toLowerCase(),g=(f.badgeColorMap||{})[y]||"muted";return t(Br,{color:g,classPrefix:"ss-dbg",children:String(p)})}default:return String(p)}},a=K([d]);return s&&!r?t("div",{className:"ss-dbg-empty",children:["Loading ",e.label,"..."]}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[e.search&&t(U,{search:o,onSearchChange:c,placeholder:e.search.placeholder,summary:`${d.length} items`,children:e.clearable&&t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:i,children:"Clear"})}),d.length===0?t("div",{className:"ss-dbg-empty",children:"No data"}):t("table",{ref:a,className:"ss-dbg-table",children:[t("thead",{children:t("tr",{children:e.columns.map(p=>t("th",{children:p.label},p.key))})}),t("tbody",{children:d.map((p,f)=>t("tr",{children:e.columns.map(m=>t("td",{children:h(p[m.key],m)},m.key))},p.id??f))})]})]})}const Ls=Object.freeze(Object.defineProperty({__proto__:null,CustomPaneTab:on,default:on},Symbol.toStringTag,{value:"Module"}))})();
1
+ (function(){"use strict";var le,$,qe,Q,Ve,We,Je,Ke,ke,Ce,Se,ie={},ae=[],cn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function z(e,n){for(var r in n)e[r]=n[r];return e}function Te(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function oe(e,n,r){var s,l,i,o={};for(i in n)i=="key"?s=n[i]:i=="ref"?l=n[i]:o[i]=n[i];if(arguments.length>2&&(o.children=arguments.length>3?le.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return ce(e,o,s,l,null)}function ce(e,n,r,s,l){var i={type:e,props:n,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++qe,__i:-1,__u:0};return l==null&&$.vnode!=null&&$.vnode(i),i}function E(e){return e.children}function q(e,n){this.props=e,this.context=n}function G(e,n){if(n==null)return e.__?G(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?G(e):null}function dn(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,s=[],l=[],i=z({},n);i.__v=n.__v+1,$.vnode&&$.vnode(i),Le(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??G(n),!!(32&n.__u),l),i.__v=n.__v,i.__.__k[i.__i]=i,tt(s,i,l),n.__e=n.__=null,i.__e!=r&&Qe(i)}}function Qe(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Qe(e)}function Ge(e){(!e.__d&&(e.__d=!0)&&Q.push(e)&&!de.__r++||Ve!=$.debounceRendering)&&((Ve=$.debounceRendering)||We)(de)}function de(){for(var e,n=1;Q.length;)Q.length>n&&Q.sort(Je),e=Q.shift(),n=Q.length,dn(e);de.__r=0}function Ye(e,n,r,s,l,i,o,c,u,d,h){var a,p,f,m,y,v,g,_=s&&s.__k||ae,w=n.length;for(u=un(r,n,_,u,w),a=0;a<w;a++)(f=r.__k[a])!=null&&(p=f.__i!=-1&&_[f.__i]||ie,f.__i=a,v=Le(e,f,p,l,i,o,c,u,d,h),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Ae(p.ref,null,f),h.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),(g=!!(4&f.__u))||p.__k===f.__k?u=Xe(f,u,e,g):typeof f.type=="function"&&v!==void 0?u=v:m&&(u=m.nextSibling),f.__u&=-7);return r.__e=y,u}function un(e,n,r,s,l){var i,o,c,u,d,h=r.length,a=h,p=0;for(e.__k=new Array(l),i=0;i<l;i++)(o=n[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[i]=ce(null,o,null,null,null):Y(o)?o=e.__k[i]=ce(E,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[i]=ce(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[i]=o,u=i+p,o.__=e,o.__b=e.__b+1,c=null,(d=o.__i=hn(o,r,u,a))!=-1&&(a--,(c=r[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(l>h?p--:l<h&&p++),typeof o.type!="function"&&(o.__u|=4)):d!=u&&(d==u-1?p--:d==u+1?p++:(d>u?p--:p++,o.__u|=4))):e.__k[i]=null;if(a)for(i=0;i<h;i++)(c=r[i])!=null&&(2&c.__u)==0&&(c.__e==s&&(s=G(c)),rt(c,c));return s}function Xe(e,n,r,s){var l,i;if(typeof e.type=="function"){for(l=e.__k,i=0;l&&i<l.length;i++)l[i]&&(l[i].__=e,n=Xe(l[i],n,r,s));return n}e.__e!=n&&(s&&(n&&e.type&&!n.parentNode&&(n=G(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function ue(e,n){return n=n||[],e==null||typeof e=="boolean"||(Y(e)?e.some(function(r){ue(r,n)}):n.push(e)),n}function hn(e,n,r,s){var l,i,o,c=e.key,u=e.type,d=n[r],h=d!=null&&(2&d.__u)==0;if(d===null&&c==null||h&&c==d.key&&u==d.type)return r;if(s>(h?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((d=n[o=l>=0?l--:i++])!=null&&(2&d.__u)==0&&c==d.key&&u==d.type)return o}return-1}function Ze(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||cn.test(n)?r:r+"px"}function he(e,n,r,s,l){var i,o;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(n in s)r&&n in r||Ze(e.style,n,"");if(r)for(n in r)s&&r[n]==s[n]||Ze(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")i=n!=(n=n.replace(Ke,"$1")),o=n.toLowerCase(),n=o in e||n=="onFocusOut"||n=="onFocusIn"?o.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=r,r?s?r.u=s.u:(r.u=ke,e.addEventListener(n,i?Se:Ce,i)):e.removeEventListener(n,i?Se:Ce,i);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function et(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=ke++;else if(n.t<r.u)return;return r($.event?$.event(n):n)}}}function Le(e,n,r,s,l,i,o,c,u,d){var h,a,p,f,m,y,v,g,_,w,N,b,k,L,O,M=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),i=[c=n.__e=r.__e]),(h=$.__b)&&h(n);e:if(typeof M=="function")try{if(g=n.props,_="prototype"in M&&M.prototype.render,w=(h=M.contextType)&&s[h.__c],N=h?w?w.props.value:h.__:s,r.__c?v=(a=n.__c=r.__c).__=a.__E:(_?n.__c=a=new M(g,N):(n.__c=a=new q(g,N),a.constructor=M,a.render=pn),w&&w.sub(a),a.state||(a.state={}),a.__n=s,p=a.__d=!0,a.__h=[],a._sb=[]),_&&a.__s==null&&(a.__s=a.state),_&&M.getDerivedStateFromProps!=null&&(a.__s==a.state&&(a.__s=z({},a.__s)),z(a.__s,M.getDerivedStateFromProps(g,a.__s))),f=a.props,m=a.state,a.__v=n,p)_&&M.getDerivedStateFromProps==null&&a.componentWillMount!=null&&a.componentWillMount(),_&&a.componentDidMount!=null&&a.__h.push(a.componentDidMount);else{if(_&&M.getDerivedStateFromProps==null&&g!==f&&a.componentWillReceiveProps!=null&&a.componentWillReceiveProps(g,N),n.__v==r.__v||!a.__e&&a.shouldComponentUpdate!=null&&a.shouldComponentUpdate(g,a.__s,N)===!1){n.__v!=r.__v&&(a.props=g,a.state=a.__s,a.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(S){S&&(S.__=n)}),ae.push.apply(a.__h,a._sb),a._sb=[],a.__h.length&&o.push(a);break e}a.componentWillUpdate!=null&&a.componentWillUpdate(g,a.__s,N),_&&a.componentDidUpdate!=null&&a.__h.push(function(){a.componentDidUpdate(f,m,y)})}if(a.context=N,a.props=g,a.__P=e,a.__e=!1,b=$.__r,k=0,_)a.state=a.__s,a.__d=!1,b&&b(n),h=a.render(a.props,a.state,a.context),ae.push.apply(a.__h,a._sb),a._sb=[];else do a.__d=!1,b&&b(n),h=a.render(a.props,a.state,a.context),a.state=a.__s;while(a.__d&&++k<25);a.state=a.__s,a.getChildContext!=null&&(s=z(z({},s),a.getChildContext())),_&&!p&&a.getSnapshotBeforeUpdate!=null&&(y=a.getSnapshotBeforeUpdate(f,m)),L=h!=null&&h.type===E&&h.key==null?nt(h.props.children):h,c=Ye(e,Y(L)?L:[L],n,r,s,l,i,o,c,u,d),a.base=n.__e,n.__u&=-161,a.__h.length&&o.push(a),v&&(a.__E=a.__=null)}catch(S){if(n.__v=null,u||i!=null)if(S.then){for(n.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;i[i.indexOf(c)]=null,n.__e=c}else{for(O=i.length;O--;)Te(i[O]);Ee(n)}else n.__e=r.__e,n.__k=r.__k,S.then||Ee(n);$.__e(S,n,r)}else i==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=fn(r.__e,n,r,s,l,i,o,u,d);return(h=$.diffed)&&h(n),128&n.__u?void 0:c}function Ee(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ee))}function tt(e,n,r){for(var s=0;s<r.length;s++)Ae(r[s],r[++s],r[++s]);$.__c&&$.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(i){i.call(l)})}catch(i){$.__e(i,l.__v)}})}function nt(e){return typeof e!="object"||e==null||e.__b>0?e:Y(e)?e.map(nt):z({},e)}function fn(e,n,r,s,l,i,o,c,u){var d,h,a,p,f,m,y,v=r.props||ie,g=n.props,_=n.type;if(_=="svg"?l="http://www.w3.org/2000/svg":_=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!_&&(_?f.localName==_:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(_==null)return document.createTextNode(g);e=document.createElementNS(l,_,g.is&&g),c&&($.__m&&$.__m(n,i),c=!1),i=null}if(_==null)v===g||c&&e.data==g||(e.data=g);else{if(i=i&&le.call(e.childNodes),!c&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?a=f:d=="children"||d in g||d=="value"&&"defaultValue"in g||d=="checked"&&"defaultChecked"in g||he(e,d,null,f,l);for(d in g)f=g[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?h=f:d=="value"?m=f:d=="checked"?y=f:c&&typeof f!="function"||v[d]===f||he(e,d,f,v[d],l);if(h)c||a&&(h.__html==a.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(a&&(e.innerHTML=""),Ye(n.type=="template"?e.content:e,Y(p)?p:[p],n,r,s,_=="foreignObject"?"http://www.w3.org/1999/xhtml":l,i,o,i?i[0]:r.__k&&G(r,0),c,u),i!=null)for(d=i.length;d--;)Te(i[d]);c||(d="value",_=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||_=="progress"&&!m||_=="option"&&m!=v[d])&&he(e,d,m,v[d],l),d="checked",y!=null&&y!=e[d]&&he(e,d,y,v[d],l))}return e}function Ae(e,n,r){try{if(typeof e=="function"){var s=typeof e.__u=="function";s&&e.__u(),s&&n==null||(e.__u=e(n))}else e.current=n}catch(l){$.__e(l,r)}}function rt(e,n,r){var s,l;if($.unmount&&$.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||Ae(s,null,n)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){$.__e(i,n)}s.base=s.__P=null}if(s=e.__k)for(l=0;l<s.length;l++)s[l]&&rt(s[l],n,r||typeof e.type!="function");r||Te(e.__e),e.__c=e.__=e.__e=void 0}function pn(e,n,r){return this.constructor(e,r)}function st(e,n,r){var s,l,i,o;n==document&&(n=document.documentElement),$.__&&$.__(e,n),l=(s=!1)?null:n.__k,i=[],o=[],Le(n,e=n.__k=oe(E,null,[e]),l||ie,ie,n.namespaceURI,l?null:n.firstChild?le.call(n.childNodes):null,i,l?l.__e:n.firstChild,s,o),tt(i,e,o)}le=ae.slice,$={__e:function(e,n,r,s){for(var l,i,o;n=n.__;)if((l=n.__c)&&!l.__)try{if((i=l.constructor)&&i.getDerivedStateFromError!=null&&(l.setState(i.getDerivedStateFromError(e)),o=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,s||{}),o=l.__d),o)return l.__E=l}catch(c){e=c}throw e}},qe=0,q.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=z({},this.state),typeof e=="function"&&(e=e(z({},r),this.props)),e&&z(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Ge(this))},q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ge(this))},q.prototype.render=E,Q=[],We=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Je=function(e,n){return e.__v.__b-n.__v.__b},de.__r=0,Ke=/(PointerCapture)$|Capture$/i,ke=0,Ce=et(!1),Se=et(!0);var mn=0;function t(e,n,r,s,l,i){n||(n={});var o,c,u=n;if("ref"in u)for(c in u={},n)c=="ref"?o=n[c]:u[c]=n[c];var d={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mn,__i:-1,__u:0,__source:l,__self:i};if(typeof e=="function"&&(o=e.defaultProps))for(c in o)u[c]===void 0&&(u[c]=o[c]);return $.vnode&&$.vnode(d),d}var X,A,Pe,lt,Z=0,it=[],D=$,at=D.__b,ot=D.__r,ct=D.diffed,dt=D.__c,ut=D.unmount,ht=D.__;function Me(e,n){D.__h&&D.__h(A,e,Z||n),Z=0;var r=A.__H||(A.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function x(e){return Z=1,_n(mt,e)}function _n(e,n,r){var s=Me(X++,2);if(s.t=e,!s.__c&&(s.__=[r?r(n):mt(void 0,n),function(c){var u=s.__N?s.__N[0]:s.__[0],d=s.t(u,c);u!==d&&(s.__N=[d,s.__[1]],s.__c.setState({}))}],s.__c=A,!A.__f)){var l=function(c,u,d){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(p){return p.__c});if(h.every(function(p){return!p.__N}))return!i||i.call(this,c,u,d);var a=s.__c.props!==c;return h.some(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(a=!0)}}),i&&i.call(this,c,u,d)||a};A.__f=!0;var i=A.shouldComponentUpdate,o=A.componentWillUpdate;A.componentWillUpdate=function(c,u,d){if(this.__e){var h=i;i=void 0,l(c,u,d),i=h}o&&o.call(this,c,u,d)},A.shouldComponentUpdate=l}return s.__N||s.__}function F(e,n){var r=Me(X++,3);!D.__s&&pt(r.__H,n)&&(r.__=e,r.u=n,A.__H.__h.push(r))}function I(e){return Z=5,T(function(){return{current:e}},[])}function T(e,n){var r=Me(X++,7);return pt(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function C(e,n){return Z=8,T(function(){return e},n)}function gn(){for(var e;e=it.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(fe),n.__h.some(De),n.__h=[]}catch(r){n.__h=[],D.__e(r,e.__v)}}}D.__b=function(e){A=null,at&&at(e)},D.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ht&&ht(e,n)},D.__r=function(e){ot&&ot(e),X=0;var n=(A=e.__c).__H;n&&(Pe===A?(n.__h=[],A.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(fe),n.__h.some(De),n.__h=[],X=0)),Pe=A},D.diffed=function(e){ct&&ct(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(it.push(n)!==1&&lt===D.requestAnimationFrame||((lt=D.requestAnimationFrame)||bn)(gn)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Pe=A=null},D.__c=function(e,n){n.some(function(r){try{r.__h.some(fe),r.__h=r.__h.filter(function(s){return!s.__||De(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],D.__e(s,r.__v)}}),dt&&dt(e,n)},D.unmount=function(e){ut&&ut(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(s){try{fe(s)}catch(l){n=l}}),r.__H=void 0,n&&D.__e(n,r.__v))};var ft=typeof requestAnimationFrame=="function";function bn(e){var n,r=function(){clearTimeout(s),ft&&cancelAnimationFrame(n),setTimeout(e)},s=setTimeout(r,35);ft&&(n=requestAnimationFrame(r))}function fe(e){var n=A,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),A=n}function De(e){var n=A;e.__c=e.__(),A=n}function pt(e,n){return!e||e.length!==n.length||n.some(function(r,s){return r!==e[s]})}function mt(e,n){return typeof n=="function"?n(e):n}function yn(e,n){for(var r in n)e[r]=n[r];return e}function _t(e,n){for(var r in e)if(r!=="__source"&&!(r in n))return!0;for(var s in n)if(s!=="__source"&&e[s]!==n[s])return!0;return!1}function gt(e,n){this.props=e,this.context=n}(gt.prototype=new q).isPureReactComponent=!0,gt.prototype.shouldComponentUpdate=function(e,n){return _t(this.props,e)||_t(this.state,n)};var bt=$.__b;$.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),bt&&bt(e)};var vn=$.__e;$.__e=function(e,n,r,s){if(e.then){for(var l,i=n;i=i.__;)if((l=i.__c)&&l.__c)return n.__e==null&&(n.__e=r.__e,n.__k=r.__k),l.__c(e,n)}vn(e,n,r,s)};var yt=$.unmount;function vt(e,n,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),e.__c.__H=null),(e=yn({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=n),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(s){return vt(s,n,r)})),e}function wt(e,n,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return wt(s,n,r)}),e.__c&&e.__c.__P===n&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function ee(){this.__u=0,this.o=null,this.__b=null}function xt(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function B(e){var n,r,s,l=null;function i(o){if(n||(n=e()).then(function(c){c&&(l=c.default||c),s=!0},function(c){r=c,s=!0}),r)throw r;if(!s)throw n;return l?oe(l,o):null}return i.displayName="Lazy",i.__f=!0,i}function pe(){this.i=null,this.l=null}$.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),yt&&yt(e)},(ee.prototype=new q).__c=function(e,n){var r=n.__c,s=this;s.o==null&&(s.o=[]),s.o.push(r);var l=xt(s.__v),i=!1,o=function(){i||s.__z||(i=!0,r.__R=null,l?l(u):u())};r.__R=o;var c=r.__P;r.__P=null;var u=function(){if(!--s.__u){if(s.state.__a){var d=s.state.__a;s.__v.__k[0]=wt(d,d.__c.__P,d.__c.__O)}var h;for(s.setState({__a:s.__b=null});h=s.o.pop();)h.__P=c,h.forceUpdate()}};s.__u++||32&n.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(o,o)},ee.prototype.componentWillUnmount=function(){this.o=[]},ee.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=vt(this.__b,r,s.__O=s.__P)}this.__b=null}var l=n.__a&&oe(E,null,e.fallback);return l&&(l.__u&=-33),[oe(E,null,n.__a?null:e.children),l]};var Nt=function(e,n,r){if(++r[1]===r[0]&&e.l.delete(n),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(pe.prototype=new q).__a=function(e){var n=this,r=xt(n.__v),s=n.l.get(e);return s[0]++,function(l){var i=function(){n.props.revealOrder?(s.push(l),Nt(n,e,s)):l()};r?r(i):i()}},pe.prototype.render=function(e){this.i=null,this.l=new Map;var n=ue(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&n.reverse();for(var r=n.length;r--;)this.l.set(n[r],this.i=[1,0,this.i]);return e.children},pe.prototype.componentDidUpdate=pe.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,r){Nt(e,r,n)})};var wn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,xn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Nn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,$n=/[A-Z0-9]/g,kn=typeof document<"u",Cn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};q.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(q.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var $t=$.event;function Sn(){}function Tn(){return this.cancelBubble}function Ln(){return this.defaultPrevented}$.event=function(e){return $t&&(e=$t(e)),e.persist=Sn,e.isPropagationStopped=Tn,e.isDefaultPrevented=Ln,e.nativeEvent=e};var En={enumerable:!1,configurable:!0,get:function(){return this.class}},kt=$.vnode;$.vnode=function(e){typeof e.type=="string"&&(function(n){var r=n.props,s=n.type,l={},i=s.indexOf("-")===-1;for(var o in r){var c=r[o];if(!(o==="value"&&"defaultValue"in r&&c==null||kn&&o==="children"&&s==="noscript"||o==="class"||o==="className")){var u=o.toLowerCase();o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&c===!0?c="":u==="translate"&&c==="no"?c=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?o="ondblclick":u!=="onchange"||s!=="input"&&s!=="textarea"||Cn(r.type)?u==="onfocus"?o="onfocusin":u==="onblur"?o="onfocusout":Nn.test(o)&&(o=u):u=o="oninput":i&&xn.test(o)?o=o.replace($n,"-$&").toLowerCase():c===null&&(c=void 0),u==="oninput"&&l[o=u]&&(o="oninputCapture"),l[o]=c}}s=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=ue(r.children).forEach(function(d){d.props.selected=l.value.indexOf(d.props.value)!=-1})),s=="select"&&l.defaultValue!=null&&(l.value=ue(r.children).forEach(function(d){d.props.selected=l.multiple?l.defaultValue.indexOf(d.props.value)!=-1:l.defaultValue==d.props.value})),r.class&&!r.className?(l.class=r.class,Object.defineProperty(l,"className",En)):r.className&&(l.class=l.className=r.className),n.props=l})(e),e.$$typeof=wn,kt&&kt(e)};var Ct=$.__r;$.__r=function(e){Ct&&Ct(e),e.__c};var St=$.diffed;$.diffed=function(e){St&&St(e);var n=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in n&&n.value!==r.value&&(r.value=n.value==null?"":n.value)};var Tt={Fragment:E};const P={queries:{viewBox:"0 0 24 24",elements:['<ellipse cx="12" cy="5" rx="9" ry="3"/>','<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>','<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>']},events:{viewBox:"0 0 24 24",elements:['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']},emails:{viewBox:"0 0 24 24",elements:['<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>','<polyline points="22,6 12,13 2,6"/>']},routes:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<line x1="2" y1="12" x2="22" y2="12"/>','<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>']},logs:{viewBox:"0 0 24 24",elements:['<line x1="8" y1="6" x2="21" y2="6"/>','<line x1="8" y1="12" x2="21" y2="12"/>','<line x1="8" y1="18" x2="21" y2="18"/>','<line x1="3" y1="6" x2="3.01" y2="6"/>','<line x1="3" y1="12" x2="3.01" y2="12"/>','<line x1="3" y1="18" x2="3.01" y2="18"/>']},timeline:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},cache:{viewBox:"0 0 24 24",elements:['<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>','<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>','<line x1="6" y1="6" x2="6.01" y2="6"/>','<line x1="6" y1="18" x2="6.01" y2="18"/>']},jobs:{viewBox:"0 0 24 24",elements:['<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>','<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>']},config:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="3"/>','<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>']},internals:{viewBox:"0 0 24 24",elements:['<rect x="4" y="4" width="16" height="16" rx="2"/>','<rect x="9" y="9" width="6" height="6"/>','<line x1="9" y1="1" x2="9" y2="4"/>','<line x1="15" y1="1" x2="15" y2="4"/>','<line x1="9" y1="20" x2="9" y2="23"/>','<line x1="15" y1="20" x2="15" y2="23"/>','<line x1="20" y1="9" x2="23" y2="9"/>','<line x1="20" y1="14" x2="23" y2="14"/>','<line x1="1" y1="9" x2="4" y2="9"/>','<line x1="1" y1="14" x2="4" y2="14"/>']},overview:{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="7" height="7"/>','<rect x="14" y="3" width="7" height="7"/>','<rect x="14" y="14" width="7" height="7"/>','<rect x="3" y="14" width="7" height="7"/>']},requests:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},"dashboard-timeline":{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<polyline points="12 6 12 12 16 14"/>']},"custom-pane":{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="18" height="18" rx="2"/>','<path d="M9 3v18"/>']},wrench:{viewBox:"0 0 24 24",elements:['<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>']},"external-link":{viewBox:"0 0 24 24",elements:['<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>','<polyline points="15 3 21 3 21 9"/>','<line x1="10" y1="14" x2="21" y2="3"/>']},sun:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="5"/>','<line x1="12" y1="1" x2="12" y2="3"/>','<line x1="12" y1="21" x2="12" y2="23"/>','<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>','<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>','<line x1="1" y1="12" x2="3" y2="12"/>','<line x1="21" y1="12" x2="23" y2="12"/>','<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>','<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>']},moon:{viewBox:"0 0 24 24",elements:['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']},search:{viewBox:"0 0 24 24",elements:['<circle cx="11" cy="11" r="8"/>','<line x1="21" y1="21" x2="16.65" y2="16.65"/>']},eye:{viewBox:"0 0 24 24",elements:['<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>','<circle cx="12" cy="12" r="3"/>']},"eye-off":{viewBox:"0 0 24 24",elements:['<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>','<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>','<line x1="1" y1="1" x2="23" y2="23"/>','<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>']},"chevron-right":{viewBox:"0 0 24 24",elements:['<path d="M9 18l6-6-6-6"/>']},"chevron-left":{viewBox:"0 0 24 24",elements:['<path d="M15 18l-6-6 6-6"/>']},"open-external":{viewBox:"0 0 16 16",elements:['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']}};class me extends Error{status;constructor(n=403){super(`Unauthorized (HTTP ${n})`),this.name="UnauthorizedError",this.status=n}}class An extends Error{status;body;constructor(n,r){super(`API error (HTTP ${n})`),this.name="ApiError",this.status=n,this.body=r}}class Oe{baseUrl;authToken;constructor(n){this.baseUrl=n.baseUrl.replace(/\/+$/,""),this.authToken=n.authToken}async fetch(n,r){const l={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...r?.headers},i=await globalThis.fetch(`${this.baseUrl}${n}`,{...r,headers:l,credentials:this.authToken?"omit":"same-origin"});if(r?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(i.status===401||i.status===403)throw new me(i.status);if(!i.ok){const o=await i.text().catch(()=>"");throw new An(i.status,o)}return i.json()}async get(n,r){const s=r?`${n}?${r}`:n;return this.fetch(s)}async post(n,r){const s={method:"POST",...r!==void 0?{body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(n,s)}async delete(n){return this.fetch(n,{method:"DELETE"})}}const Pn=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],Lt="/admin/api/debug",Et={tracing:!1,process:!1,system:!1,http:!1,db:!1,redis:!1,queues:!1,cache:!1,app:!1,log:!1,emails:!1,dashboard:!1,customPanes:[]};function Mn(e){const n={customPanes:e.customPanes??[]},r=e.features;for(const s of Pn)n[s]=r?.[s]??!1;return n}async function Dn(e,n=Lt){const r=`${n.replace(/\/+$/,"")}/config`;return e.fetch(r)}async function On(e){const{baseUrl:n="",debugEndpoint:r=Lt,authToken:s}=e,l=new Oe({baseUrl:n,authToken:s});try{const i=await Dn(l,r);return Mn(i)}catch{return Et}}function jn(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e,[l,i]=x(Et),[o,c]=x(!0),[u,d]=x(null),h=I(!1);return F(()=>{if(h.current)return;h.current=!0;let a=!1;return(async()=>{try{const f=await On({baseUrl:n,debugEndpoint:r,authToken:s});a||(i(f),c(!1))}catch(f){a||(d(f instanceof Error?f:new Error(String(f))),c(!1))}})(),()=>{a=!0}},[n,r,s]),{features:l,isLoading:o,error:u}}const _e="ss-dash-theme",je="ss-theme-change";function Ie(){if(typeof window>"u")return"light";const e=localStorage.getItem(_e);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function In(e){typeof window>"u"||(localStorage.setItem(_e,e),window.dispatchEvent(new CustomEvent(je,{detail:e})))}function Bn(){const n=Ie()==="dark"?"light":"dark";return In(n),n}function Rn(e){if(typeof window>"u")return()=>{};const n=i=>{const o=i.detail;(o==="dark"||o==="light")&&e(o)},r=i=>{if(i.key===_e){const o=i.newValue;e(o==="dark"||o==="light"?o:Ie())}},s=window.matchMedia("(prefers-color-scheme: dark)"),l=i=>{localStorage.getItem(_e)||e(i.matches?"dark":"light")};return window.addEventListener(je,n),window.addEventListener("storage",r),s.addEventListener("change",l),()=>{window.removeEventListener(je,n),window.removeEventListener("storage",r),s.removeEventListener("change",l)}}function Fn(){const[e,n]=x(()=>Ie());F(()=>Rn(l=>{n(l)}),[]);const r=C(()=>{const s=Bn();return n(s),s},[]);return{theme:e,toggleTheme:r}}function Hn({theme:e,onToggle:n,className:r="",classPrefix:s="ss-dash"}){const l=e==="dark";return t("button",{type:"button",className:`${s==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${r}`,onClick:n,title:l?"Switch to light theme":"Switch to dark theme","aria-label":l?"Switch to light theme":"Switch to dark theme",children:l?t("svg",{width:"16",height:"16",viewBox:P.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:P.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.moon.elements.join("")}})})}const Un=B(()=>Promise.resolve().then(()=>Dr)),zn=B(()=>Promise.resolve().then(()=>Or)),qn=B(()=>Promise.resolve().then(()=>Ir)),Vn=B(()=>Promise.resolve().then(()=>Rr)),Wn=B(()=>Promise.resolve().then(()=>Jr)),Jn=B(()=>Promise.resolve().then(()=>Xr)),Kn=B(()=>Promise.resolve().then(()=>es)),Qn=B(()=>Promise.resolve().then(()=>is)),Gn=B(()=>Promise.resolve().then(()=>ps)),Yn=B(()=>Promise.resolve().then(()=>Ts)),Xn=B(()=>Promise.resolve().then(()=>Ls));function Zn(e){const{defaultOpen:n=!1,dashboardPath:r,isOpen:s,onOpenChange:l,isLive:i=!1,...o}=e,[c,u]=x(n),d=s!==void 0?s:c,h=b=>{l?l(b):u(b)},[a,p]=x("queries"),{features:f}=jn(o),{theme:m,toggleTheme:y}=Fn(),v=f.customPanes||[];F(()=>{const b=k=>{k.key==="Escape"&&d&&h(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);const g=T(()=>[{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"timeline",label:"Requests",visible:f.tracing},{id:"cache",label:"Cache",visible:f.cache},{id:"jobs",label:"Jobs",visible:f.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[f]),_=T(()=>g.filter(b=>b.visible),[g]);F(()=>{const b=[..._.map(k=>k.id),...v.map(k=>k.id)];!b.includes(a)&&b.length>0&&p(b[0])},[_,v,a]);const w=C(()=>{h(!d)},[d]),N=C(()=>{const b={options:o},k=v.find(O=>O.id===a);if(k)return t(ee,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:t(Xn,{pane:k,options:o})});const L={queries:t(Un,{...b}),events:t(zn,{...b}),emails:t(qn,{...b}),routes:t(Vn,{...b,currentPath:typeof window<"u"?window.location.pathname:""}),logs:t(Wn,{...b}),timeline:t(Jn,{...b}),cache:t(Kn,{...b,dashboardPath:r}),jobs:t(Qn,{...b,dashboardPath:r}),config:t(Gn,{...b,dashboardPath:r}),internals:t(Yn,{...b})};return t(ee,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:L[a]||t("div",{className:"ss-dbg-empty",children:"Unknown tab"})})},[a,o,v]);return t(E,{children:[s===void 0&&t("button",{type:"button",className:`ss-dbg-btn ${d?"ss-dbg-active":""}`,onClick:w,title:"Toggle debug panel",id:"ss-dbg-wrench",children:t("svg",{width:"14",height:"14",viewBox:P.wrench.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.wrench.elements.join("")}})}),t("div",{className:`ss-dbg-panel ${d?"ss-dbg-open":""}`,"data-ss-theme":m,id:"ss-dbg-panel",children:[t("div",{className:"ss-dbg-tabs",children:[t("div",{className:"ss-dbg-tabs-scroll",children:[_.map(b=>t("button",{type:"button",className:`ss-dbg-tab ${a===b.id?"ss-dbg-active":""}`,onClick:()=>p(b.id),children:[P[b.id]?t("svg",{className:"ss-dbg-tab-icon",viewBox:P[b.id].viewBox,dangerouslySetInnerHTML:{__html:P[b.id].elements.join("")}}):null,b.label]},b.id)),v.map(b=>t("button",{type:"button",className:`ss-dbg-tab ${a===b.id?"ss-dbg-active":""}`,onClick:()=>p(b.id),children:b.label},b.id))]}),t("div",{className:"ss-dbg-tabs-right",children:[t("span",{className:`ss-dbg-conn-mode ${i?"ss-dbg-conn-live":"ss-dbg-conn-polling"}`,title:i?"Connected via Transmit (SSE) — real-time updates":"Polling every 3s",children:i?"live":"polling"}),t(Hn,{theme:m,onToggle:y,classPrefix:"ss-dbg"}),r&&t("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"ss-dbg-dashboard-link",title:"Open dashboard",children:t("svg",{width:"14",height:"14",viewBox:P["external-link"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P["external-link"].elements.join("")}})}),t("button",{type:"button",className:"ss-dbg-close",onClick:()=>h(!1),title:"Close panel",children:"×"})]})]}),t("div",{className:"ss-dbg-content",children:d&&N()})]})]})}window.__ssDebugPanel={mount(e,n,r){st(t(Zn,{debugEndpoint:n.debugEndpoint,authToken:n.authToken,dashboardPath:n.dashboardPath||void 0,defaultOpen:!0,isLive:r}),e)},unmount(e){st(null,e)}};const er=3e3,tr=100,nr=500;function rr(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function sr(e,n,r){if(e.length===0)return"[]";const s=e.slice(0,3).map(o=>r(o,30)),l=e.length>3?", ..."+e.length+" items":"",i="["+s.join(", ")+l+"]";return i.length>n?"["+e.length+" items]":i}function lr(e,n,r){const s=Object.keys(e);if(s.length===0)return"{}";const l=[];for(let u=0;u<Math.min(s.length,4);u++)l.push(s[u]+": "+r(e[s[u]],30));const i=s.length>4?", ...+"+(s.length-4):"",o="{ "+l.join(", ")+i+" }";return o.length<=n?o:"{ "+(s.slice(0,6).join(", ")+(s.length>6?", ...":""))+" }"}function ir(e){if(!e&&e!==0)return"-";const n=Math.floor(e),r=Math.floor(n/86400),s=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return r>0?`${r}d ${s}h`:s>0?`${s}h ${l}m`:l>0?`${l}m ${n%60}s`:`${n}s`}function V(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function At(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function ar(e){if(!e)return"-";const n=typeof e=="string"?new Date(At(e)):new Date(e);return Number.isNaN(n.getTime())?"-":n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(n.getMilliseconds()).padStart(3,"0")}function Be(e){if(!e)return"-";const n=typeof e=="string"?new Date(At(e)).getTime():e,r=Math.floor((Date.now()-n)/1e3);return r<0?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function or(e){return e>nr?"very-slow":e>tr?"slow":"normal"}function ge(e,n="ss-dash"){const r=or(e);return r==="very-slow"?`${n}-very-slow`:r==="slow"?`${n}-slow`:""}function be(e,n=100){return e===null?"null":e===void 0?"-":typeof e=="string"?rr(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?sr(e,n,be):typeof e=="object"?lr(e,n,be):String(e)}function cr(e){return e<0?"no expiry":e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function dr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function ye(e,...n){for(const r of n){const s=e[r];if(s!=null)return s}}function Re(e){return ye(e,"createdAt","created_at","timestamp")}function ur(e){return ye(e,"timestamp","createdAt","processedAt","created_at")}function Pt(e){return ye(e,"method","sql_method")??""}function Fe(e){return ye(e,"sqlNormalized","normalizedSql","sql_normalized","sql")??""}function hr(e,n){if(!n)return e;const r=n.toLowerCase();return e.filter(s=>s.sql.toLowerCase().includes(r)||s.model&&s.model.toLowerCase().includes(r)||s.method.toLowerCase().includes(r))}function fr(e){const n={};for(const r of e)n[r.sql]=(n[r.sql]||0)+1;return n}function pr(e,n){const r=e.filter(i=>i.duration>100).length,s=Object.values(n).filter(i=>i>1).length,l=e.length>0?e.reduce((i,o)=>i+o.duration,0)/e.length:0;return{slowCount:r,dupCount:s,avgDuration:l,totalCount:e.length}}function mr(e){const n=new Map;for(const r of e){const l=Fe(r);n.set(l,(n.get(l)||0)+1)}return n}class _r{state;constructor(n="list"){this.state={viewMode:n,sort:{key:n==="list"?"createdAt":"count",dir:"desc"},expandedIds:new Set,explainData:new Map,search:""}}setViewMode(n){return this.state.viewMode=n,this.state.sort={key:n==="list"?"createdAt":"count",dir:"desc"},this.state.expandedIds=new Set,this.state.explainData=new Map,this.state}toggleSort(n){return this.state.sort.key===n?this.state.sort={key:n,dir:this.state.sort.dir==="asc"?"desc":"asc"}:this.state.sort={key:n,dir:"desc"},this.state}toggleExpand(n){return this.state.expandedIds.has(n)?this.state.expandedIds.delete(n):this.state.expandedIds.add(n),this.state}isExpanded(n){return this.state.expandedIds.has(n)}setSearch(n){return this.state.search=n,this.state}startExplain(n){this.state.explainData.set(n,{loading:!0})}completeExplain(n,r){this.state.explainData.set(n,{loading:!1,result:r})}failExplain(n,r){this.state.explainData.set(n,{loading:!1,error:r})}clearExplain(){this.state.explainData=new Map}getExplainState(n){return this.state.explainData.get(n)}}const gr={queries:"/queries",events:"/events",emails:"/emails",routes:"/routes",logs:"/logs",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config",internals:"/diagnostics"};function br(e){return gr[e]||`/${e}`}class yr{client;endpoint;refreshInterval;callbacks;timer=null;currentTab=null;fetchOnceCache={};abortController=null;constructor(n){this.client=new Oe({baseUrl:n.baseUrl,authToken:n.authToken}),this.endpoint=n.endpoint??"/admin/api/debug",this.refreshInterval=n.refreshInterval??er,this.callbacks={onData:n.onData,onLoading:n.onLoading,onError:n.onError,onUnauthorized:n.onUnauthorized}}start(n){this.stop(),this.currentTab=n,this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetchData(),this.timer=setInterval(()=>this.fetchData(),this.refreshInterval)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null),this.abortController?.abort(),this.abortController=null}switchTab(n){this.start(n)}refresh(){this.currentTab&&this.fetchData()}async fetchCustomPane(n,r=!1){if(r&&this.fetchOnceCache[n]!==void 0){this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1);return}this.callbacks.onLoading(!0);try{const s=await this.client.fetch(n);this.callbacks.onData(s),this.callbacks.onError(null),r&&(this.fetchOnceCache[n]=s)}catch(s){if(s instanceof me){this.callbacks.onUnauthorized(s);return}this.callbacks.onError(s instanceof Error?s:new Error(String(s)))}finally{this.callbacks.onLoading(!1)}}cacheForTab(n,r){this.fetchOnceCache[n]=r}clearCache(){this.fetchOnceCache={}}async fetchData(){const n=this.currentTab;if(!n||this.serveFromCache(n))return;this.abortController?.abort();const r=new AbortController;this.abortController=r;try{const s=`${this.endpoint}${br(n)}`,l=await this.client.fetch(s,{signal:r.signal});if(r.signal.aborted)return;this.callbacks.onData(l),this.callbacks.onError(null),this.callbacks.onLoading(!1)}catch(s){this.handleFetchError(s,r)}}serveFromCache(n){return this.fetchOnceCache[n]===void 0?!1:(this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1),!0)}handleFetchError(n,r){if(!(n instanceof DOMException&&n.name==="AbortError")&&!r.signal.aborted){if(n instanceof me){this.callbacks.onError(n),this.callbacks.onLoading(!1),this.stop(),this.callbacks.onUnauthorized(n);return}this.callbacks.onError(n instanceof Error?n:new Error(String(n))),this.callbacks.onLoading(!1)}}}function H(e,n={}){const{baseUrl:r="",debugEndpoint:s="/admin/api/debug",authToken:l}=n,[i,o]=x(null),[c,u]=x(!0),[d,h]=x(null),a=I(null);a.current||(a.current=new yr({baseUrl:r,endpoint:s,authToken:l,onData:y=>o(y),onLoading:y=>u(y),onError:y=>h(y),onUnauthorized:y=>h(y)})),F(()=>{const y=a.current;return y.start(e),()=>y.stop()},[e]);const p=C(()=>{a.current?.refresh()},[]),f=C(()=>{o(null)},[]),m=C((y,v)=>{a.current?.cacheForTab(y,v)},[]);return{data:i,isLoading:c,error:d,refresh:p,clearData:f,cacheForTab:m}}function vr(e){const n=[];if(e["Startup Cost"]!==null&&e["Startup Cost"]!==void 0&&n.push(`cost=${e["Startup Cost"]}..${e["Total Cost"]}`),e["Plan Rows"]!==null&&e["Plan Rows"]!==void 0&&n.push(`rows=${e["Plan Rows"]}`),e["Plan Width"]!==null&&e["Plan Width"]!==void 0&&n.push(`width=${e["Plan Width"]}`),e.Filter&&n.push(`filter: ${e.Filter}`),e["Index Cond"]&&n.push(`cond: ${e["Index Cond"]}`),e["Hash Cond"]&&n.push(`hash: ${e["Hash Cond"]}`),e["Join Type"]&&n.push(`join: ${e["Join Type"]}`),e["Sort Key"]){const r=Array.isArray(e["Sort Key"])?e["Sort Key"].join(", "):e["Sort Key"];n.push(`sort: ${r}`)}return n}function Mt(e,n=0){if(!e)return[];const s=[{depth:n,nodeType:e["Node Type"]||"Unknown",relationName:e["Relation Name"]||"",alias:e.Alias&&e.Alias!==e["Relation Name"]?e.Alias:"",indexName:e["Index Name"]||"",metrics:vr(e),isRoot:n===0}],l=e.Plans||[];for(const i of l)s.push(...Mt(i,n+1));return s}function wr(e){return!e||typeof e!="object"?!1:"Plan"in e}function xr(e){if(!e||e.length===0)return[];const n=e[0];return!n||typeof n!="object"?[]:Object.keys(n)}function Nr(e){return e==null?"-":String(e)}function $r(e){const n=e?.showExplain??!0,r=[{key:"id",label:"#",width:"40px",type:"index"},{key:"sql",label:"SQL",type:"sql"},{key:"duration",label:"Duration",width:"70px",sortable:!0,type:"duration"},{key:"method",label:"Method",width:"60px",type:"method"},{key:"model",label:"Model",width:"90px",type:"model"},{key:"connection",label:"Connection",width:"80px",type:"connection"},{key:"createdAt",label:"Time",width:"90px",sortable:!0,type:"time"}];return n&&r.push({key:"id",label:"",width:"70px",type:"explain"}),r}function kr(){return[{key:"sqlNormalized",label:"Pattern",type:"sql"},{key:"count",label:"Count",width:"60px",sortable:!0},{key:"avgDuration",label:"Avg",width:"70px",sortable:!0,type:"duration"},{key:"minDuration",label:"Min",width:"70px",type:"duration"},{key:"maxDuration",label:"Max",width:"70px",type:"duration"},{key:"totalDuration",label:"Total",width:"70px",sortable:!0,type:"duration"},{key:"percentOfTotal",label:"% Time",width:"60px"}]}function U({search:e,onSearchChange:n,placeholder:r="Search...",summary:s,children:l,className:i=""}){const o=C(()=>{n("")},[n]);return t("div",{className:`ss-dbg-filter-bar ${i}`,children:[s!=null&&t("span",{className:"ss-dbg-summary",children:s}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:P.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:r,value:e,onChange:c=>n(c.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:o,children:"×"})]}),l&&t("div",{className:"ss-dbg-filter-controls",children:l})]})}function J({ts:e,className:n,style:r}){return e?t("span",{className:n,style:r,title:ar(e),children:Be(e)}):t("span",{className:n,style:r,children:"-"})}const Cr="ss-col-resize",Dt="ss-resizing";function Ot(e){const n=Array.from(e.querySelectorAll("thead th"));if(n.length===0)return()=>{};const r=[];let s=!1;function l(){if(!s){s=!0;for(const i of n)i.style.width=i.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const i of n){let o=function(u){u.preventDefault(),u.stopPropagation(),l();const d=u.clientX,h=i.offsetWidth;c.classList.add(Dt),c.setPointerCapture(u.pointerId);function a(f){const m=f.clientX-d,y=Math.max(30,h+m);i.style.width=y+"px"}function p(){c.classList.remove(Dt),c.removeEventListener("pointermove",a),c.removeEventListener("pointerup",p)}c.addEventListener("pointermove",a),c.addEventListener("pointerup",p)};if(!i.textContent?.trim())continue;const c=document.createElement("div");c.className=Cr,i.appendChild(c),c.addEventListener("pointerdown",o),r.push(()=>{c.removeEventListener("pointerdown",o),c.remove()})}return()=>{for(const i of r)i()}}function K(e=[]){const n=I(null),r=I(null);return F(()=>(n.current&&(r.current?.(),r.current=Ot(n.current)),()=>{r.current?.(),r.current=null}),e),C(l=>{r.current?.(),r.current=null,n.current=l,l&&(r.current=Ot(l))},[])}function jt({columns:e,data:n,keyField:r="id",sort:s,sortDir:l,onSort:i,onRowClick:o,rowClassName:c,emptyMessage:u="No data",className:d="",renderAfterRow:h}){const a=C(f=>{i&&i(f)},[i]),p=K([n,e]);return n.length===0?t("div",{className:"ss-dash-empty",children:u}):t("table",{ref:p,className:`ss-dash-table ${d}`,children:[t("colgroup",{children:e.map(f=>t("col",{style:f.width?{width:f.width}:void 0},f.key))}),t("thead",{children:t("tr",{children:e.map(f=>t("th",{onClick:f.sortable?()=>a(f.key):void 0,className:f.sortable?"ss-dash-sortable":"",children:[f.label,s===f.key&&t("span",{className:"ss-dash-sort-arrow",children:l==="asc"?" ▲":" ▼"})]},f.key))})}),t("tbody",{children:n.map((f,m)=>{const y=c?typeof c=="function"?c(f):c:"",v=o?"ss-dash-clickable":"";return t(Tt.Fragment,{children:[t("tr",{onClick:o?()=>o(f):void 0,className:`${v} ${y}`.trim(),children:e.map(g=>t("td",{children:g.render?g.render(f[g.key],f):f[g.key]??"-"},g.key))}),h?h(f,m):null]},f[r]??m)})})]})}function Sr(e,n,r=2){if(n<=1)return[1];const s=[],l=Math.max(2,e-r),i=Math.min(n-1,e+r);s.push(1),l>2&&s.push("...");for(let o=l;o<=i;o++)s.push(o);return i<n-1&&s.push("..."),n>1&&s.push(n),s}function Tr({page:e,lastPage:n,total:r,onPageChange:s,className:l=""}){const i=T(()=>Sr(e,n),[e,n]),o=C(()=>{e>1&&s(e-1)},[e,s]),c=C(()=>{e<n&&s(e+1)},[e,n,s]);return n<=1?null:t("div",{className:`ss-dash-pagination ${l}`,children:[t("span",{className:"ss-dash-page-info",children:["Page ",e," of ",n," (",r," total)"]}),t("div",{className:"ss-dash-pagination-controls",children:[t("button",{type:"button",className:"ss-dash-page-btn",onClick:o,disabled:e<=1,children:"« Prev"}),i.map((u,d)=>u==="..."?t("span",{className:"ss-dash-page-ellipsis",children:"..."},`ellipsis-${d}`):t("button",{type:"button",className:`ss-dash-page-btn ${u===e?"ss-dash-active":""}`,onClick:()=>s(u),children:u},u)),t("button",{type:"button",className:"ss-dash-page-btn",onClick:c,disabled:e>=n,children:"Next »"})]})]})}function Lr({node:e,depth:n=0}){if(!e)return null;const r=T(()=>Mt(e,n),[e,n]);return t(E,{children:r.map((s,l)=>t("div",{className:"ss-dash-explain-node",style:{marginLeft:`${s.depth*20}px`},children:[t("div",{className:"ss-dash-explain-node-header",children:[t("span",{className:"ss-dash-explain-node-type",children:s.nodeType}),s.relationName&&t(E,{children:[" on ",t("strong",{children:s.relationName})]}),s.alias&&` (${s.alias})`,s.indexName&&t(E,{children:[" using ",t("em",{children:s.indexName})]})]}),s.metrics.length>0&&t("div",{className:"ss-dash-explain-metrics",children:s.metrics.join(" · ")})]},l))})}function Er({plan:e}){if(!e||!Array.isArray(e)||e.length===0)return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"});const n=e[0];if(wr(n))return t("div",{className:"ss-dash-explain-result",children:t(Lr,{node:n.Plan,depth:0})});if(typeof n=="object"&&n!==null){const r=xr(e);return t("div",{className:"ss-dash-explain-result",children:t("table",{children:[t("thead",{children:t("tr",{children:r.map(s=>t("th",{children:s},s))})}),t("tbody",{children:e.map((s,l)=>{const i=s;return t("tr",{children:r.map(o=>t("td",{children:Nr(i[o])},o))},l)})})]})})}return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"})}const It=t("span",{className:"ss-empty-hint",children:["Queries require ",t("code",{children:"debug: true"})," on your Lucid connections in"," ",t("code",{children:"config/database.ts"})]});function Ar({mode:e,controllerState:n,queries:r,meta:s,isLoading:l,onSearchChange:i,onSort:o,onToggleExpand:c,onViewModeChange:u,onPageChange:d,onExplain:h,onCloseExplain:a,summary:p,filterBarChildren:f}){const{viewMode:m,sort:y,expandedIds:v,explainData:g,search:_}=n,w=!!h,N=e==="dashboard"&&!!s,b=e==="dashboard"&&!!u,k=T(()=>mr(r),[r]);if(b&&m==="grouped")return L();return O();function L(){const S=kr().map(j=>Pr(j,v,c));return t("div",{children:[t(U,{search:_,onSearchChange:i,placeholder:"Filter queries...",summary:p,children:f}),l&&r.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t("div",{className:"ss-dash-table-wrap",children:t(jt,{columns:S,data:r,keyField:"sqlNormalized",sort:y.key,sortDir:y.dir,onSort:o,emptyMessage:t(E,{children:["No queries recorded",It]})})})]})}function O(){const M=$r({showExplain:w}),S=M.map(se=>Mr(se,v,k,g,c,h)),j=M.length,re=w?se=>{const Es=se.id,W=g.get(Es);return!W||W.loading?null:t("tr",{className:"ss-dash-explain-row",children:t("td",{colSpan:j,className:"ss-dash-explain",children:t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[t("div",{style:{flex:1},children:W.error?t("div",{className:"ss-dash-explain-result ss-dash-explain-error",children:[t("strong",{children:"Error:"})," ",W.error,W.result?.message&&t(E,{children:[t("br",{}),W.result.message]})]}):W.result?t(Er,{plan:W.result.plan||W.result.rows||[]}):null}),t("button",{type:"button",className:"ss-dash-explain-btn",onClick:()=>a?.(),style:{marginLeft:"8px",flexShrink:0},children:"Close"})]})})})}:void 0;return t("div",{children:[t(U,{search:_,onSearchChange:i,placeholder:"Filter queries...",summary:p,children:f}),l&&r.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t(E,{children:[t("div",{className:"ss-dash-table-wrap",children:t(jt,{columns:S,data:r,sort:y.key,sortDir:y.dir,onSort:o,emptyMessage:t(E,{children:["No queries captured",It]}),renderAfterRow:re})}),N&&s&&t(Tr,{page:s.page,lastPage:s.lastPage,total:s.total,onPageChange:d})]})]})}}function Pr(e,n,r){const s={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"sql":s.render=(l,i)=>{const o=l||"",c=(i.count||0)>=3;return t(E,{children:[t("span",{className:`ss-dash-sql ${n.has(o)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:u=>{u.stopPropagation(),r(o)},role:"button",tabIndex:0,onKeyDown:u=>u.key==="Enter"&&r(o),children:o}),c&&t(E,{children:[" ",t("span",{className:"ss-dash-dup",children:"DUP"})]})]})};break;case"duration":s.render=l=>{const i=l||0,o=e.key==="avgDuration"||e.key==="maxDuration";return t("span",{className:`ss-dash-duration ${o?ge(i):""}`,children:e.key==="totalDuration"?i.toFixed(1)+"ms":i.toFixed(2)+"ms"})};break;default:e.key==="count"?s.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:l||0}):e.key==="percentOfTotal"&&(s.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:(l||0).toFixed(1)+"%"}));break}return s}function Mr(e,n,r,s,l,i){const o={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"index":o.render=c=>t("span",{style:{color:"var(--ss-dim)"},children:c});break;case"sql":o.render=(c,u)=>{const d=u.sql||u.sql_text||"",h=u.id;return t("div",{children:[t("span",{className:`ss-dash-sql ${n.has(h)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:a=>{a.stopPropagation(),l(h)},role:"button",tabIndex:0,onKeyDown:a=>a.key==="Enter"&&l(h),children:d}),(r.get(Fe(u))??0)>1&&t("span",{className:"ss-dash-dup",children:["×",r.get(Fe(u))]})]})};break;case"duration":o.render=c=>{const u=c||0;return t("span",{className:`ss-dash-duration ${ge(u)}`,children:u.toFixed(2)+"ms"})};break;case"method":o.render=(c,u)=>{const d=Pt(u);return t("span",{className:`ss-dash-method ss-dash-method-${d.toLowerCase()}`,children:d})};break;case"model":o.render=c=>t("span",{style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:c,children:c||"-"});break;case"connection":o.render=c=>t("span",{style:{color:"var(--ss-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c||"-"});break;case"time":o.render=(c,u)=>{const d=c||(Re(u)??"");return t(J,{ts:d,className:"ss-dash-event-time"})};break;case"explain":o.render=(c,u)=>{if(Pt(u)!=="select")return null;const h=u.id,a=s.get(h),p=a&&!a.loading&&a.result&&!a.error,f=a?.loading;return t("button",{type:"button",className:`ss-dash-explain-btn${p?" ss-dash-explain-btn-active":""}`,onClick:m=>{m.stopPropagation(),i?.(h)},disabled:!!f,children:f?"...":"EXPLAIN"})};break}return o}function Bt({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:o}=H("queries",e),c=I(new _r("list")),[u,d]=x(c.current.state),h=C(()=>{d({...c.current.state})},[]),{search:a}=u,p=C(k=>{c.current.setSearch(k),h()},[h]),f=C(k=>{c.current.toggleExpand(k),h()},[h]),m=C(k=>{},[]),y=C(async k=>{const L=c.current.getExplainState(k);if(L&&!L.loading){c.current.clearExplain(),h();return}c.current.startExplain(k),h();try{const O={};s&&(O.Authorization=`Bearer ${s}`);const M=`${n}${r}/queries/${k}/explain`,j=await(await fetch(M,{headers:O})).json();if(j&&j.error){const re=j.message?`${j.error}: ${j.message}`:j.error;c.current.failExplain(k,re)}else c.current.completeExplain(k,{plan:j?.plan||void 0,rows:j?.rows||void 0})}catch(O){console.warn("[ss] Query explain failed:",O),c.current.failExplain(k,O instanceof Error?O.message:String(O))}h()},[n,r,s,h]),v=C(()=>{c.current.clearExplain(),h()},[h]),g=T(()=>l?.queries||[],[l]),_=T(()=>hr(g,a),[g,a]),w=T(()=>fr(g),[g]),N=T(()=>pr(g,w),[g,w]);if(i&&!l)return t("div",{className:"ss-dash-empty",children:"Loading queries..."});if(o)return t("div",{className:"ss-dash-empty",children:["Error: ",o.message]});const b=t(E,{children:[_.length," queries",N.slowCount>0&&` | ${N.slowCount} slow`,N.dupCount>0&&` | ${N.dupCount} dup`,_.length>0&&` | avg ${V(N.avgDuration)}`]});return t(Ar,{mode:"debug",controllerState:u,queries:_,onSearchChange:p,onSort:m,onToggleExpand:f,onExplain:y,onCloseExplain:v,summary:b})}const Dr=Object.freeze(Object.defineProperty({__proto__:null,QueriesTab:Bt,default:Bt},Symbol.toStringTag,{value:"Module"}));function ve({data:e,maxPreviewLength:n=100,className:r="",classPrefix:s="ss-dash",defaultExpanded:l=!1}){const[i,o]=x(l),c=T(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),u=T(()=>typeof c=="object"&&c!==null?be(c,n):String(c??"-"),[c,n]),d=T(()=>typeof c=="object"&&c!==null?JSON.stringify(c,null,2):String(c),[c]),h=C(()=>{o(p=>!p)},[]),a=C(async()=>{try{await navigator.clipboard.writeText(d)}catch{}},[d]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${s}-c-dim`,children:"-"}):t("div",{className:`${s}-data-cell ${r}`,children:[!i&&t("span",{className:`${s}-data-preview`,onClick:h,role:"button",tabIndex:0,onKeyDown:p=>p.key==="Enter"&&h(),children:u}),i&&t("div",{className:`${s}-data-full`,onClick:h,children:[t("button",{className:`${s}-copy-btn`,onClick:p=>{p.stopPropagation(),a()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:d})]})]})}function Rt({options:e}){const{data:n,isLoading:r,error:s}=H("events",e),[l,i]=x(""),o=T(()=>{const u=n?.events||[];if(!l)return u;const d=l.toLowerCase();return u.filter(h=>(h.event||"").toLowerCase().includes(d)||(h.data||"").toLowerCase().includes(d))},[n,l]),c=K([o]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading events..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(U,{search:l,onSearchChange:i,placeholder:"Filter events...",summary:`${o.length} events`}),o.length===0?t("div",{className:"ss-dbg-empty",children:"No events captured"}):t("table",{ref:c,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"20%"}}),t("col",{}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Event"}),t("th",{children:"Data"}),t("th",{children:"Time"})]})}),t("tbody",{children:o.map(u=>{const d=Re(u);return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:u.id}),t("td",{className:"ss-dbg-event-name",children:u.event}),t("td",{className:"ss-dbg-event-data",children:t(ve,{data:u.data,maxPreviewLength:80,classPrefix:"ss-dbg"})}),t("td",{children:t(J,{ts:d,className:"ss-dbg-event-time"})})]},u.id)})})]})]})}const Or=Object.freeze(Object.defineProperty({__proto__:null,EventsTab:Rt,default:Rt},Symbol.toStringTag,{value:"Module"}));function jr({email:e,previewHtml:n,isLoading:r=!1,onClose:s,className:l}){return t("div",{className:l||"ss-email-preview",children:[t("div",{className:"ss-email-preview-header",children:[t("div",{className:"ss-email-preview-meta",children:e&&t(E,{children:[e.subject!=null&&t("div",{children:[t("strong",{children:"Subject:"})," ",e.subject]}),e.from!=null&&t("div",{children:[t("strong",{children:"From:"})," ",e.from]}),e.to!=null&&t("div",{children:[t("strong",{children:"To:"})," ",e.to]}),e.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",e.cc]}),e.status&&t("div",{children:[t("strong",{children:"Status:"})," ",t("span",{className:`ss-email-status ss-email-status-${e.status}`,children:e.status})]}),e.mailer&&t("div",{children:[t("strong",{children:"Mailer:"})," ",e.mailer]})]})}),t("button",{className:"ss-dbg-btn-clear",onClick:s,type:"button",children:"×"})]}),r?t("div",{className:"ss-empty",children:"Loading preview..."}):n?t("iframe",{className:"ss-email-iframe",srcDoc:n,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:e?.text||"No content"})]})}function Ft({options:e}){const{data:n,isLoading:r,error:s}=H("emails",e),[l,i]=x(""),[o,c]=x(null),[u,d]=x(null),[h,a]=x(!1),p=T(()=>{const _=n?.emails||[];if(!l)return _;const w=l.toLowerCase();return _.filter(N=>(N.subject||"").toLowerCase().includes(w)||(N.to||"").toLowerCase().includes(w)||(N.from||"").toLowerCase().includes(w)||(N.mailer||"").toLowerCase().includes(w))},[n,l]),f=T(()=>p.find(_=>_.id===o),[p,o]),m=C(async _=>{if(c(_.id),d(_.html||null),!_.html&&_.id){a(!0);try{const w=e?.debugEndpoint||"/admin/api/debug",N={};e?.authToken&&(N.Authorization=`Bearer ${e.authToken}`);const b=await fetch(`${w}/emails/${_.id}/preview`,{headers:N,credentials:e?.authToken?"omit":"same-origin"});b.ok&&d(await b.text())}catch{}finally{a(!1)}}},[e]),y=C(()=>{c(null),d(null),a(!1)},[]),v={sent:"ss-dbg-email-status-sent",sending:"ss-dbg-email-status-sending",queueing:"ss-dbg-email-status-queued",queued:"ss-dbg-email-status-queued",failed:"ss-dbg-email-status-failed"},g=K([p]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading emails..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):f?t(jr,{email:f,previewHtml:u,isLoading:h,onClose:y,className:"ss-dbg-email-preview"}):t("div",{children:[t(U,{search:l,onSearchChange:i,placeholder:"Filter emails...",summary:`${p.length} emails`}),p.length===0?t("div",{className:"ss-dbg-empty",children:"No emails captured"}):t("table",{ref:g,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"140px"}}),t("col",{style:{width:"140px"}}),t("col",{}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"40px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"From"}),t("th",{children:"To"}),t("th",{children:"Subject"}),t("th",{children:"Status"}),t("th",{children:"Mailer"}),t("th",{title:"Attachments",children:"📎"}),t("th",{children:"Time"})]})}),t("tbody",{children:p.map(_=>t("tr",{className:"ss-dbg-email-row",onClick:()=>m(_),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:_.id}),t("td",{className:"ss-dbg-c-secondary",title:_.from,children:_.from}),t("td",{className:"ss-dbg-c-secondary",title:_.to,children:_.to}),t("td",{className:"ss-dbg-c-sql",children:_.subject}),t("td",{children:t("span",{className:`ss-dbg-email-status ${v[_.status]||""}`,children:_.status})}),t("td",{className:"ss-dbg-c-muted",children:_.mailer}),t("td",{className:"ss-dbg-c-dim",style:{textAlign:"center"},children:_.attachmentCount>0?_.attachmentCount:"-"}),t("td",{children:t(J,{ts:Re(_),className:"ss-dbg-event-time"})})]},_.id))})]})]})}const Ir=Object.freeze(Object.defineProperty({__proto__:null,EmailsTab:Ft,default:Ft},Symbol.toStringTag,{value:"Module"}));function Br({color:e="muted",children:n,className:r="",classPrefix:s="ss-dash"}){return t("span",{className:`${s}-badge ${s}-badge-${e} ${r}`,children:n})}function we({method:e,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-method ${r}-method-${e.toLowerCase()} ${n}`,children:e})}function Ht({code:e,className:n="",classPrefix:r="ss-dash"}){let s=`${r}-status-2xx`;return e>=500?s=`${r}-status-5xx`:e>=400?s=`${r}-status-4xx`:e>=300&&(s=`${r}-status-3xx`),t("span",{className:`${r}-status ${s} ${n}`,children:e})}function Ut({options:e,currentPath:n}){const{data:r,isLoading:s,error:l}=H("routes",e),[i,o]=x(""),c=T(()=>{const d=r?.routes||[];if(!i)return d;const h=i.toLowerCase();return d.filter(a=>a.pattern.toLowerCase().includes(h)||a.handler.toLowerCase().includes(h)||a.method.toLowerCase().includes(h)||a.name&&a.name.toLowerCase().includes(h))},[r,i]),u=K([c]);return s&&!r?t("div",{className:"ss-dbg-empty",children:"Loading routes..."}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[t(U,{search:i,onSearchChange:o,placeholder:"Filter routes...",summary:`${c.length} routes`}),c.length===0?t("div",{className:"ss-dbg-empty",children:"No routes found"}):t("table",{ref:u,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"70px"}}),t("col",{style:{width:"25%"}}),t("col",{style:{width:"15%"}}),t("col",{}),t("col",{style:{width:"20%"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Method"}),t("th",{children:"Pattern"}),t("th",{children:"Name"}),t("th",{children:"Handler"}),t("th",{children:"Middleware"})]})}),t("tbody",{children:c.map((d,h)=>{const a=n&&(d.pattern===n||new RegExp("^"+d.pattern.replace(/:[^/]+/g,"[^/]+")+"$").test(n));return t("tr",{className:a?"ss-dbg-current-route":"",children:[t("td",{children:t(we,{method:d.method,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-text",children:d.pattern}),t("td",{className:"ss-dbg-c-muted",children:d.name||"-"}),t("td",{className:"ss-dbg-c-sql",children:d.handler}),t("td",{className:"ss-dbg-c-dim",style:{fontSize:"10px"},children:d.middleware.length>0?d.middleware.join(", "):"-"})]},`${d.method}-${d.pattern}-${h}`)})})]})]})}const Rr=Object.freeze(Object.defineProperty({__proto__:null,RoutesTab:Ut,default:Ut},Symbol.toStringTag,{value:"Module"}));function Fr(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return null}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function zt(e){const n={};for(const[r,s]of Object.entries(e))Vr.has(r)||(n[r]=s);return Object.keys(n).length>0?n:null}const Hr=["all","error","warn","info","debug"];function qt(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Vt(e){return e.msg||e.message||JSON.stringify(e)}function Ur(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Wt(e){const n=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||n.requestId||n.request_id||n["x-request-id"]||""}function zr(e,n="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${n}-error`;case"warn":return`${n}-warn`;case"info":return`${n}-info`;case"debug":return`${n}-debug`;case"trace":return`${n}-trace`;default:return`${n}-info`}}function qr(e,n){return n==="all"?e:e.filter(r=>{const s=qt(r);return n==="error"?s==="error"||s==="fatal":s===n})}const Vr=new Set(["level","time","pid","hostname","msg","message","v","name","levelName","level_name","timestamp","createdAt","created_at","requestId","request_id","x-request-id","id","data"]);function Wr(e){if(e.data){const n=Fr(e.data);if(n){const r=zt(n);if(r)return r}}return zt(e)}function Jt({log:e,index:n,expanded:r,onToggleExpand:s,onReqIdClick:l}){const i=qt(e),o=Vt(e),c=Ur(e),u=Wt(e),d=Wr(e);return t(Tt.Fragment,{children:[t("div",{className:`ss-log-entry${d?" ss-log-entry-expandable":""}`,onClick:()=>d&&s(n),children:[t("span",{className:`ss-log-level ${zr(i,"ss-log-level")}`,children:i.toUpperCase()}),t(J,{ts:c,className:"ss-log-time"}),u?t("span",{className:"ss-log-reqid",title:u,onClick:l?h=>{h.stopPropagation(),l(u)}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,onKeyDown:l?h=>{h.key==="Enter"&&(h.stopPropagation(),l(u))}:void 0,children:u.slice(0,8)}):t("span",{className:"ss-log-reqid-empty",children:"--"}),d?t("span",{className:`ss-log-expand-icon${r?" ss-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-log-msg",children:o})]}),r&&d&&t("div",{className:"ss-log-detail",children:t(ve,{data:d,classPrefix:"ss-dbg",defaultExpanded:!0})})]})}function Kt({options:e}){const{data:n,isLoading:r,error:s}=H("logs",e),[l,i]=x("all"),[o,c]=x(""),[u,d]=x(""),[h,a]=x(null),p=T(()=>{let m=Array.isArray(n)?n:n?.logs||n?.entries||[];if(m=qr(m,l),u){const y=u.toLowerCase();m=m.filter(v=>Wt(v).toLowerCase().includes(y))}if(o){const y=o.toLowerCase();m=m.filter(v=>Vt(v).toLowerCase().includes(y))}return m},[n,l,o,u]),f=C(m=>{d(y=>y===m?"":m)},[]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading logs..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t("div",{className:"ss-dbg-log-filters",children:[Hr.map(m=>t("button",{type:"button",className:`ss-dbg-log-filter ${l===m?"ss-dbg-active":""}`,onClick:()=>i(m),children:m},m)),u&&t("button",{type:"button",className:"ss-dbg-log-filter ss-dbg-active",onClick:()=>d(""),children:["req: ",u.slice(0,8)," x"]}),t("span",{className:"ss-dbg-summary",style:{marginLeft:"auto"},children:[p.length," entries"]})]}),t(U,{search:o,onSearchChange:c,placeholder:"Filter log messages..."}),t("div",{style:{overflow:"auto",flex:1},children:p.length===0?t("div",{className:"ss-dbg-empty",children:"No log entries"}):p.slice(0,200).map((m,y)=>t(Jt,{log:m,index:y,expanded:h===y,onToggleExpand:v=>a(h===v?null:v),onReqIdClick:f},y))})]})}const Jr=Object.freeze(Object.defineProperty({__proto__:null,LogsTab:Kt,default:Kt},Symbol.toStringTag,{value:"Module"}));function Qt(e="",n){const r=I(null);return C(()=>(r.current||(r.current=new Oe({baseUrl:e,authToken:n})),r.current),[e,n])}function Kr({logs:e,onReqIdClick:n}){const[r,s]=x(null);return e.length===0?null:t("div",{children:[t("div",{className:"ss-related-logs-title",children:["Related Logs",t("span",{className:"ss-related-logs-count",children:["(",e.length,")"]})]}),t("div",{style:{overflow:"auto"},children:e.map((l,i)=>t(Jt,{log:l,index:i,expanded:r===i,onToggleExpand:o=>s(r===o?null:o),onReqIdClick:n},l.id||i))})]})}function Qr(e){const{container:n,handle:r,topPane:s,bottomPane:l,storageKey:i,minHeight:o=60}=e;if(i){const u=localStorage.getItem(i);if(u){const d=parseFloat(u);d>0&&d<1&&(s.style.flex=`${d}`,l.style.flex=`${1-d}`)}}function c(u){u.preventDefault(),r.setPointerCapture(u.pointerId);const h=n.getBoundingClientRect().height,a=u.clientY,p=s.getBoundingClientRect().height;function f(y){const v=y.clientY-a;let g=p+v;const _=h-o-r.offsetHeight;g=Math.max(o,Math.min(g,_));const w=g/(h-r.offsetHeight);s.style.flex=`${w}`,l.style.flex=`${1-w}`}function m(){if(r.removeEventListener("pointermove",f),r.removeEventListener("pointerup",m),i){const y=n.getBoundingClientRect().height-r.offsetHeight;if(y>0){const v=s.getBoundingClientRect().height/y;localStorage.setItem(i,String(v))}}}r.addEventListener("pointermove",f),r.addEventListener("pointerup",m)}return r.addEventListener("pointerdown",c),()=>{r.removeEventListener("pointerdown",c)}}function Gr({children:e,storageKey:n}){const r=I(null),s=I(null),l=I(null),i=I(null);return F(()=>{if(r.current&&s.current&&l.current&&i.current)return Qr({container:r.current,handle:s.current,topPane:l.current,bottomPane:i.current,storageKey:n})},[n]),t("div",{ref:r,className:"ss-split-container",children:[t("div",{ref:l,className:"ss-split-top",children:e[0]}),t("div",{ref:s,className:"ss-split-handle"}),t("div",{ref:i,className:"ss-split-bottom",children:e[1]})]})}const Gt={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"#525252"},Yr=[{label:"Request",color:"#1e3a5f"},{label:"Middleware",color:"rgba(30, 58, 95, 0.7)"},{label:"Database",color:"#6d28d9"},{label:"View",color:"#0e7490"},{label:"Mail",color:"#059669"},{label:"Event",color:"#b45309"}];function Yt({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:o}=H("timeline",e),[c,u]=x(""),[d,h]=x(null),[a,p]=x(null),[f,m]=x(!1),[y,v]=x(null),g=T(()=>{const b=l?.traces||[];if(!c)return b;const k=c.toLowerCase();return b.filter(L=>L.url.toLowerCase().includes(k)||L.method.toLowerCase().includes(k)||String(L.statusCode).includes(k))},[l,c]),_=Qt(n,s);F(()=>{if(d===null){p(null),v(null);return}let b=!1;return m(!0),v(null),_().get(`${r}/traces/${d}`).then(L=>{b||(p(L),m(!1))}).catch(L=>{b||(v(L instanceof Error?L.message:"Failed to load trace"),m(!1))}),()=>{b=!0}},[d,r,_]);const w=C(b=>{h(k=>k===b?null:b)},[]),N=K([g]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading traces..."});if(o)return t("div",{className:"ss-dbg-empty",children:["Error: ",o.message]});if(d!==null){if(f)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});if(y)return t("div",{children:[t("div",{className:"ss-dbg-tl-detail-header",children:t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"})}),t("div",{className:"ss-dbg-empty",children:["Error: ",y]})]});if(!a)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});const b=a.spans||[],k=a.warnings||[],L=a.logs||[],O=L.length>0,M=t("div",{children:[t("div",{className:"ss-dbg-tl-legend",children:Yr.map(S=>t("div",{className:"ss-dbg-tl-legend-item",children:[t("div",{className:"ss-dbg-tl-legend-dot",style:{background:S.color}}),t("span",{children:S.label})]},S.label))}),t("div",{style:{padding:"8px 12px",overflow:"auto"},children:b.length===0?t("div",{className:"ss-dbg-empty",children:"No spans captured for this request"}):b.map(S=>{const j=a.totalDuration||1,re=S.startOffset/j*100,se=Math.max(S.duration/j*100,.5);return t("div",{className:"ss-dbg-tl-row",children:[t("div",{className:"ss-dbg-tl-label",title:S.label,children:S.label}),t("div",{className:"ss-dbg-tl-track",children:t("div",{className:`ss-dbg-tl-bar ss-dbg-tl-bar-${S.category}`,style:{left:`${re}%`,width:`${se}%`,background:Gt[S.category]||Gt.custom},title:`${S.label}: ${V(S.duration)}`})}),t("span",{className:"ss-dbg-tl-dur",children:V(S.duration)})]},S.id)})}),k.length>0&&t("div",{className:"ss-dbg-tl-warnings",children:[t("div",{className:"ss-dbg-tl-warnings-title",children:"Warnings"}),k.map((S,j)=>t("div",{className:"ss-dbg-tl-warning",children:S},j))]})]});return t("div",{className:"ss-dbg-tl-detail-wrapper",children:[t("div",{className:"ss-dbg-tl-detail-header",children:[t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:"← Back"}),t(we,{method:a.method,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-detail-url",children:a.url}),t(Ht,{code:a.statusCode,classPrefix:"ss-dbg"}),t("span",{className:"ss-dbg-tl-meta",children:[V(a.totalDuration)," · ",a.spanCount," spans"]})]}),O?t(Gr,{storageKey:"ss-dbg-timeline-split",children:[M,t(Kr,{logs:L})]}):M]})}return t("div",{children:[t(U,{search:c,onSearchChange:u,placeholder:"Filter traces...",summary:`${g.length} traces`}),g.length===0?t("div",{className:"ss-dbg-empty",children:"No traces captured. Enable tracing in config."}):t("table",{ref:N,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"70px"}}),t("col",{}),t("col",{style:{width:"60px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"Method"}),t("th",{children:"URL"}),t("th",{children:"Status"}),t("th",{children:"Duration"}),t("th",{children:"Spans"}),t("th",{children:"Time"})]})}),t("tbody",{children:g.map(b=>t("tr",{className:"ss-dbg-email-row",onClick:()=>w(b.id),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:b.id}),t("td",{children:t(we,{method:b.method,classPrefix:"ss-dbg"})}),t("td",{title:b.url,children:b.url}),t("td",{children:t(Ht,{code:b.statusCode,classPrefix:"ss-dbg"})}),t("td",{className:`ss-dbg-duration ${ge(b.totalDuration,"ss-dbg")}`,children:V(b.totalDuration)}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:b.spanCount}),t("td",{children:t(J,{ts:b.timestamp,className:"ss-dbg-event-time"})})]},b.id))})]})]})}const Xr=Object.freeze(Object.defineProperty({__proto__:null,TimelineTab:Yt,default:Yt},Symbol.toStringTag,{value:"Module"}));function He(e,n){const r=T(()=>e?e.replace(/\/+$/,"")+"/api":null,[e]),s=T(()=>r?{...n,debugEndpoint:r}:n,[r,n]);return{dashApiBase:r,resolvedOptions:s}}function Zr({hitRate:e,hits:n,misses:r,keys:s}){return t("div",{className:"ss-cache-stats",children:[t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-cache-stat-value",children:[e.toFixed(1),"%"]})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-cache-stat-value",children:n})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-cache-stat-value",children:r})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-cache-stat-value",children:s})]})]})}function Xt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=He(n,e),{data:l,isLoading:i,error:o}=H("cache",s),[c,u]=x(""),[d,h]=x(null),[a,p]=x(null),f=T(()=>{const _=l?.keys||[];if(!c)return _;const w=c.toLowerCase();return _.filter(N=>N.key.toLowerCase().includes(w))},[l,c]),m=C(async _=>{if(d===_){h(null),p(null);return}h(_);try{const{baseUrl:w="",authToken:N}=e||{},b=r||e?.debugEndpoint||"/admin/api/debug",k=`${w}${b}/cache/${encodeURIComponent(_)}`,L={Accept:"application/json"};N&&(L.Authorization=`Bearer ${N}`);const M=await(await fetch(k,{headers:L,credentials:N?"omit":"same-origin"})).json();p(M)}catch{p({error:"Failed to fetch key value"})}},[d,e,r]),y=K([f]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading cache data..."});if(o)return t("div",{className:"ss-dbg-empty",children:["Error: ",o.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Cache inspector not available"});const g=l.stats||l;return t("div",{children:[t(Zr,{hitRate:g.hitRate??0,hits:g.totalHits??0,misses:g.totalMisses??0,keys:g.keyCount??0}),t(U,{search:c,onSearchChange:u,placeholder:"Filter keys...",summary:`${f.length} keys`}),d&&!!a&&t("div",{className:"ss-dbg-cache-detail",children:[t("strong",{children:d}),t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:["←"," Back"]}),t(ve,{data:a,classPrefix:"ss-dbg"})]}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No cache keys found"}):t("table",{ref:y,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"Key"}),t("th",{children:"Type"}),t("th",{children:"TTL"}),t("th",{children:"Size"})]})}),t("tbody",{children:f.map(_=>t("tr",{className:"ss-dbg-email-row",onClick:()=>m(_.key),children:[t("td",{className:"ss-dbg-c-sql",children:_.key}),t("td",{className:"ss-dbg-c-muted",children:_.type}),t("td",{className:"ss-dbg-c-muted",children:_.ttl>0?cr(_.ttl):"-"}),t("td",{className:"ss-dbg-c-dim",children:_.size>0?dr(_.size):"-"})]},_.key))})]})]})}const es=Object.freeze(Object.defineProperty({__proto__:null,CacheTab:Xt,default:Xt},Symbol.toStringTag,{value:"Module"})),ts=["all","active","waiting","delayed","completed","failed"];function ns(e,n="ss-dbg-job-status"){switch(e){case"completed":case"failed":case"active":case"waiting":case"delayed":return`${n}-${e}`;default:return"ss-dbg-badge-muted"}}function rs(e){if(!e)return[];if(Array.isArray(e))return e;const n=e;return n.jobs||n.data||[]}function ss(e){if(!e||Array.isArray(e))return null;const n=e;return n.stats||n.overview||null}function ls({stats:e,classPrefix:n="ss"}){if(!e)return null;const r=n;return t("div",{className:`${r}-job-stats`,children:[t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Active:"}),t("span",{className:`${r}-job-stat-value`,children:e.active??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Waiting:"}),t("span",{className:`${r}-job-stat-value`,children:e.waiting??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Delayed:"}),t("span",{className:`${r}-job-stat-value`,children:e.delayed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Completed:"}),t("span",{className:`${r}-job-stat-value`,children:e.completed??0})]}),t("div",{className:`${r}-job-stat`,children:[t("span",{className:`${r}-job-stat-label`,children:"Failed:"}),t("span",{className:`${r}-job-stat-value ${r}-c-red`,children:e.failed??0})]})]})}function Zt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=He(n,e),{data:l,isLoading:i,error:o}=H("jobs",s),[c,u]=x(""),[d,h]=x("all"),[a,p]=x(null),f=T(()=>{const g=rs(l),_=d==="all"?g:g.filter(N=>N.status===d);if(!c)return _;const w=c.toLowerCase();return _.filter(N=>N.name?.toLowerCase().includes(w)||N.id?.toString().includes(w))},[l,d,c]),m=C(async g=>{p(g);try{const{baseUrl:_="",authToken:w}=e||{},N=r||e?.debugEndpoint||"/admin/api/debug",b=`${_}${N}/jobs/${g}/retry`,k={Accept:"application/json"};w&&(k.Authorization=`Bearer ${w}`),await fetch(b,{method:"POST",headers:k,credentials:w?"omit":"same-origin"})}catch{}p(null)},[e,r]),y=K([f]);if(!r)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available (no dashboard configured)"});if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading jobs..."});if(o)return t("div",{className:"ss-dbg-empty",children:["Error: ",o.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available"});const v=ss(l);return t("div",{children:[t(U,{search:c,onSearchChange:u,placeholder:"Filter jobs...",summary:`${f.length} jobs`}),t("div",{className:"ss-dbg-job-stats-area",children:[t(ls,{stats:v,classPrefix:"ss-dbg"}),t("div",{className:"ss-dbg-log-filters",children:ts.map(g=>t("button",{type:"button",className:`ss-dbg-job-filter ${d===g?"ss-dbg-active":""}`,onClick:()=>h(g),children:g},g))})]}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No jobs found"}):t("table",{ref:y,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{style:{width:"15%"}}),t("col",{style:{width:"80px"}}),t("col",{}),t("col",{style:{width:"50px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"60px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"ID"}),t("th",{children:"Name"}),t("th",{children:"Status"}),t("th",{children:"Payload"}),t("th",{children:"Tries"}),t("th",{children:"Duration"}),t("th",{children:"Time"}),t("th",{})]})}),t("tbody",{children:f.map(g=>{const _=g;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",children:g.id}),t("td",{className:"ss-dbg-c-sql",title:g.name,children:g.name}),t("td",{children:t("span",{className:`ss-dbg-badge ${ns(g.status)}`,children:g.status})}),t("td",{children:t(ve,{data:g.payload||g.data,maxPreviewLength:60,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:g.attempts||_.attemptsMade||0}),t("td",{className:"ss-dbg-duration",children:g.duration!==null?V(g.duration):"-"}),t("td",{children:t(J,{ts:ur(_),className:"ss-dbg-event-time"})}),t("td",{children:g.status==="failed"&&t("button",{type:"button",className:"ss-dbg-retry-btn",onClick:()=>m(g.id),disabled:a===g.id,children:a===g.id?"...":"Retry"})})]},g.id)})})]})]})}const is=Object.freeze(Object.defineProperty({__proto__:null,JobsTab:Zt,default:Zt},Symbol.toStringTag,{value:"Module"}));function R(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function xe(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!R(e)}function Ue(e,n=""){if(!xe(e))return[{path:n,value:e}];const r=[];for(const s of Object.keys(e)){const l=n?`${n}.${s}`:s,i=e[s];xe(i)?r.push(...Ue(i,l)):r.push({path:l,value:i})}return r}function ze(e){return e==null?{text:"null",color:"var(--ss-dim)"}:typeof e=="boolean"?{text:String(e),color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"}:typeof e=="number"?{text:String(e),color:"var(--ss-amber-fg)"}:Array.isArray(e)?{text:`[${e.map(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function en(e){if(e==null||typeof e!="object"||Array.isArray(e)||R(e))return 1;let n=0;for(const r of Object.keys(e))n+=en(e[r]);return n}function as(e){if(!xe(e))return[];const n=[];for(const r of Object.keys(e))xe(e[r])&&n.push(r);return n}function Ne(e,n,r){n&&navigator.clipboard.writeText(e).then(()=>{const s=n.textContent;n.textContent="✓",n.classList.add(`${r}-copy-row-ok`),setTimeout(()=>{n.textContent=s,n.classList.remove(`${r}-copy-row-ok`)},1200)}).catch(()=>{})}function $e({redacted:e,p:n}){const[r,s]=x(!1);return t("span",{className:`${n}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:r?e.value:e.display}),t("button",{type:"button",className:`${n}-btn`,title:r?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:l=>{l.stopPropagation(),s(i=>!i)},children:r?t("svg",{width:"14",height:"14",viewBox:P["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:P.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.eye.elements.join("")}})})]})}function os({env:e,search:n,p:r}){const s=I(new Map),l=n.toLowerCase(),i=Object.entries(e).filter(([o,c])=>{if(!l)return!0;const u=R(c)?c.display:c==null?"":String(c);return o.toLowerCase().includes(l)||u.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:t("table",{className:`${r}-table ${r}-config-env-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Variable"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[i.map(([o,c])=>{const u=R(c),d=u?c.display:c==null?"null":String(c),h=`${o}=${d}`;return t("tr",{children:[t("td",{className:`${r}-env-key`,children:t("span",{className:`${r}-config-key`,children:o})}),t("td",{className:`${r}-env-val`,children:u?t($e,{redacted:c,p:r}):t("span",{className:`${r}-config-val`,children:d})}),t("td",{children:!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:a=>{s.current.set(o,a)},onClick:a=>{a.stopPropagation(),Ne(h,s.current.get(o)??null,r)},children:"⎘"})})]},o)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function cs({source:e,search:n,p:r}){const s=I(new Map),l=n.toLowerCase(),i=Ue(e,""),o=i.filter(c=>{const u=R(c.value)?c.value.display:c.value===null||c.value===void 0?"":String(c.value);return c.path.toLowerCase().includes(l)||u.toLowerCase().includes(l)});return t("div",{className:`${r}-config-table-wrap`,children:[t("table",{className:`${r}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[o.map(c=>{const u=R(c.value),d=u?null:ze(c.value),h=u?c.value.display:d.text,a=`${c.path}: ${h}`;return t("tr",{children:[t("td",{children:t("span",{className:`${r}-config-key`,style:{whiteSpace:"nowrap"},children:c.path})}),t("td",{children:u?t($e,{redacted:c.value,p:r}):t("span",{className:`${r}-config-val`,style:{wordBreak:"break-all",color:d.color},children:d.text})}),t("td",{children:!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:p=>{s.current.set(c.path,p)},onClick:p=>{p.stopPropagation(),Ne(a,s.current.get(c.path)??null,r)},children:"⎘"})})]},c.path)}),o.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching entries"})})]})]}),t("div",{style:{padding:"4px 16px",fontSize:"10px",color:"var(--ss-muted)"},children:[o.length," of ",i.length," entries"]})]})}function ds({obj:e,prefix:n,p:r}){const s=I(new Map),l=Ue(e,n);return t("table",{className:`${r}-table ${r}-config-inner-table`,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"35%"},children:"Key"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:l.map(i=>{const o=i.path.indexOf(n+".")===0?i.path.slice(n.length+1):i.path,c=R(i.value),u=c?null:ze(i.value),d=c?i.value.display:u.text,h=`${i.path}: ${d}`;return t("tr",{children:[t("td",{title:o,children:t("span",{className:`${r}-config-key`,children:o})}),t("td",{title:d,children:c?t($e,{redacted:i.value,p:r}):t("span",{className:`${r}-config-val`,style:{color:u.color},children:u.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:a=>{s.current.set(i.path,a)},onClick:a=>{a.stopPropagation(),Ne(h,s.current.get(i.path)??null,r)},children:"⎘"})})]},i.path)})})]})}function us({value:e,p:n}){if(e==null)return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(R(e))return t($e,{redacted:e,p:n});if(typeof e=="boolean")return t("span",{className:`${n}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const r=e.map(s=>s==null?"null":typeof s=="object"?JSON.stringify(s):String(s));return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",r.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${n}-config-val`,children:String(e)})}function hs({obj:e,expandedPaths:n,onToggle:r,p:s}){if(e==null||typeof e!="object"||Array.isArray(e)||R(e))return null;const l=Object.keys(e),i=I(new Map);return t("div",{className:`${s}-config-sections`,children:l.map(o=>{const c=e[o],u=c!==null&&typeof c=="object"&&!Array.isArray(c)&&!R(c),d=n.has(o),h=R(c);return t("div",{className:`${s}-config-section`,children:[t("div",{className:`${s}-config-section-header${u?"":` ${s}-config-leaf`}`,onClick:u?()=>r(o):void 0,style:{cursor:u?"pointer":"default"},children:[u?t("span",{className:`${s}-config-toggle`,children:d?"▼":"▶"}):t("span",{className:`${s}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${s}-config-key`,children:o}),u?t("span",{className:`${s}-config-count`,children:[en(c)," entries"]}):t(E,{children:[t("span",{className:`${s}-config-val`,style:{marginLeft:"8px"},children:t(us,{value:c,p:s})}),!h&&t("button",{type:"button",className:`${s}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:a=>{i.current.set(o,a)},onClick:a=>{a.stopPropagation();const p=ze(c);Ne(`${o}: ${p.text}`,i.current.get(o)??null,s)},children:"⎘"})]})]}),u&&d&&t("div",{className:`${s}-config-section-body`,children:t(ds,{obj:c,prefix:o,p:s})})]},o)})})}function fs({data:e,isLoading:n,classPrefix:r}){const s=r,[l,i]=x(""),[o,c]=x(""),[u,d]=x("app"),[h,a]=x(new Set),[p,f]=x("Copy JSON");F(()=>{const w=setTimeout(()=>c(l),200);return()=>clearTimeout(w)},[l]);const m=e,y=C(w=>{a(N=>{const b=new Set(N);return b.has(w)?b.delete(w):b.add(w),b})},[]),v=C(()=>{if(!m)return;const w=u==="app"?m.app:m.env;if(!w)return;const N=as(w);a(new Set(N))},[m,u]),g=C(()=>{a(new Set)},[]),_=C(async()=>{if(m)try{const w=u==="app"?m.app:m.env;await navigator.clipboard.writeText(JSON.stringify(w,null,2)),f("Copied!"),setTimeout(()=>f("Copy JSON"),1500)}catch{}},[m,u]);return t("div",{children:[t("div",{className:`${s}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${s}-config-tab${u==="app"?` ${s}-active`:""}`,onClick:()=>d("app"),children:"App Config"}),t("button",{type:"button",className:`${s}-config-tab${u==="env"?` ${s}-active`:""}`,onClick:()=>d("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${s}-search`,placeholder:"Search keys and values...",value:l,onChange:w=>i(w.target.value),style:{width:"100%"}}),l&&t("button",{type:"button",onClick:()=>i(""),style:{position:"absolute",right:"6px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"14px",color:"var(--ss-dim)",padding:"0 2px",lineHeight:1},children:"×"})]}),u==="app"&&!o&&t(E,{children:[t("button",{type:"button",className:`${s}-btn`,onClick:v,children:"Expand All"}),t("button",{type:"button",className:`${s}-btn`,onClick:g,children:"Collapse All"})]}),t("button",{type:"button",className:`${s}-btn`,onClick:_,children:p})]}),n&&!e?t("div",{className:`${s}-empty`,children:"Loading config..."}):m?u==="env"?t(os,{env:m.env??{},search:o,p:s}):o?t(cs,{source:m.app??{},search:o,p:s}):t("div",{className:`${s}-config-table-wrap`,children:t(hs,{obj:m.app,expandedPaths:h,onToggle:y,p:s})}):t("div",{className:`${s}-empty`,children:"Config not available"})]})}function tn({options:e,dashboardPath:n}){const{resolvedOptions:r}=He(n,e),{data:s,isLoading:l,error:i}=H("config",r);return i?t("div",{className:"ss-dbg-empty",children:["Error: ",i.message]}):t(fs,{data:s,isLoading:l,classPrefix:"ss-dbg"})}const ps=Object.freeze(Object.defineProperty({__proto__:null,ConfigTab:tn,default:tn},Symbol.toStringTag,{value:"Module"}));function ms(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s,refreshInterval:l=3e3}=e,[i,o]=x(null),[c,u]=x(!0),[d,h]=x(null),a=I(null),p=Qt(n,s),f=C(async()=>{try{const y=await p().get(`${r}/diagnostics`);o(y),h(null),u(!1)}catch(m){if(m instanceof me){h(m),u(!1),a.current&&(clearInterval(a.current),a.current=null);return}h(m instanceof Error?m:new Error(String(m))),u(!1)}},[r,p]);return F(()=>(u(!0),h(null),f(),a.current=setInterval(f,l),()=>{a.current&&(clearInterval(a.current),a.current=null)}),[f,l]),{data:i,isLoading:c,error:d}}const _s=["password","secret","token","key","credential","auth"];function nn(e){const n=e.toLowerCase();return _s.some(r=>n.includes(r))}function rn(e){if(e==null)return"-";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.join(", ")||"-";try{return JSON.stringify(e)}catch{return String(e)}}const gs={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function bs(e){return gs[e]||e}const ys={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function vs(e){return ys[e]||e}const ws=["healthy","active","connected","available","ready"],xs=["errored","unavailable"];function Ns(e){return ws.includes(e)?"ok":xs.includes(e)?"err":""}function te({status:e,prefix:n}){const r=Ns(e);let s=`${n}-dot`;return r==="ok"?s+=` ${n}-dot-ok`:r==="err"&&(s+=` ${n}-dot-err`),t("span",{className:s})}const sn=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:P.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P.eye.elements.join("")}}),ln=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:P["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:P["eye-off"].elements.join("")}});function $s({value:e}){const[n,r]=x(!1);return t("span",{children:[n?e:"••••••••"," ",t("button",{type:"button",onClick:()=>r(s=>!s),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:n?t(ln,{}):t(sn,{})})]})}function ks({current:e,max:n,prefix:r}){const s=n>0?Math.min(100,Math.round(e/n*100)):0,l=s>=100;return t("div",{className:`${r}-bar`,children:[t("div",{className:`${r}-bar-track`,children:t("div",{className:`${r}-bar-fill${l?` ${r}-bar-fill-warn`:""}`,style:{width:`${s}%`}})}),t("span",{className:`${r}-bar-pct${l?` ${r}-bar-pct-warn`:""}`,children:[s,"%"]})]})}function Cs({config:e,prefix:n}){const r=Object.entries(e);return r.length===0?t("span",{className:`${n}-c-dim`,children:"-"}):t("span",{className:`${n}-c-muted`,children:r.map(([s,l],i)=>t("span",{children:[i>0&&", ",t("span",{className:`${n}-c-dim`,children:s}),"=",nn(s)&&typeof l=="string"?t($s,{value:l}):t("span",{children:rn(l)})]},s))})}function ne({label:e,value:n,prefix:r}){return t("div",{className:`${r}-info-card`,children:[t("span",{className:`${r}-info-card-label`,children:e}),t("span",{className:`${r}-info-card-value`,children:n})]})}function Ss({data:e,tableClassName:n,classPrefix:r}){const s=r||"ss-dash",[l,i]=x(new Set),o=C(h=>{i(a=>{const p=new Set(a);return p.has(h)?p.delete(h):p.add(h),p})},[]),c=C((h,a)=>{if(a==null)return t("span",{className:`${s}-c-dim`,children:"null"});if(typeof a=="boolean")return t("span",{className:a?`${s}-c-green`:`${s}-c-red`,children:String(a)});if(Array.isArray(a))return t("span",{children:a.join(", ")||"-"});const p=rn(a);if(nn(h)){const f=l.has(h);return t("span",{children:[f?p:"••••••••"," ",t("button",{type:"button",onClick:()=>o(h),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:f?t(ln,{}):t(sn,{})})]})}return t("span",{children:p})},[l,o,s]),d=e.collectors?.some(h=>h.name==="db_pool"||h.name==="app")&&Array.isArray(e.lucidDebugConnections)&&e.lucidDebugConnections.length===0;return t("div",{children:[d&&t("div",{style:{background:"var(--ss-amber-bg)",color:"var(--ss-amber-fg)",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",marginBottom:"12px",lineHeight:1.5},children:[t("strong",{children:"Query capture disabled"})," — no Lucid connections have"," ",t("code",{style:{fontSize:"11px"},children:"debug: true"}),". Add it to your database connection in ",t("code",{style:{fontSize:"11px"},children:"config/database.ts"})," to see queries in the Queries panel."]}),t("h3",{className:`${s}-internals-title`,children:"Package Info"}),t("div",{className:`${s}-info-cards`,children:[t(ne,{label:"Version",value:e.package.version||"-",prefix:s}),t(ne,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:s}),t(ne,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:s}),t(ne,{label:"Uptime",value:ir(e.package.uptime),prefix:s}),t(ne,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:s})]}),e.collectors.length>0&&t(E,{children:[t("h3",{className:`${s}-internals-title`,children:"Collectors"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Collector"}),t("th",{children:"Status"}),t("th",{children:"Last Error"}),t("th",{children:"Config"})]})}),t("tbody",{children:e.collectors.map(h=>t("tr",{children:[t("td",{children:[t("code",{children:h.name}),h.label&&h.label!==h.name&&t("span",{className:`${s}-c-dim`,children:[" ",h.label]})]}),t("td",{children:[t(te,{status:h.status,prefix:s}),h.status]}),t("td",{className:h.lastError?`${s}-c-red`:`${s}-c-dim`,children:h.lastError?t(E,{children:[h.lastError,h.lastErrorAt&&t("span",{className:`${s}-c-dim`,style:{fontSize:"10px"},children:Be(h.lastErrorAt)})]}):"-"}),t("td",{children:t(Cs,{config:h.config,prefix:s})})]},h.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Buffers"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Buffer"}),t("th",{children:"Usage"}),t("th",{children:"Fill %"})]})}),t("tbody",{children:Object.entries(e.buffers).map(([h,a])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:h}),t("td",{children:[a.current.toLocaleString()," / ",a.max.toLocaleString()]}),t("td",{children:t(ks,{current:a.current,max:a.max,prefix:s})})]},h))})]}),t("h3",{className:`${s}-internals-title`,children:"Timers"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Timer"}),t("th",{children:"Status"}),t("th",{children:"Interval"})]})}),t("tbody",{children:Object.entries(e.timers).map(([h,a])=>t("tr",{children:[t("td",{children:bs(h)}),t("td",{children:[t(te,{status:a.active?"active":"inactive",prefix:s}),t("span",{className:a.active?`${s}-c-green`:`${s}-c-dim`,children:a.active?"active":"inactive"})]}),t("td",{children:a.active?a.intervalMs?V(a.intervalMs):a.debounceMs?`${V(a.debounceMs)} (debounce)`:"-":t("span",{className:`${s}-c-dim`,children:"—"})})]},h))})]}),t("h3",{className:`${s}-internals-title`,children:"Integrations"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Integration"}),t("th",{children:"Status"}),t("th",{children:"Details"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Transmit (SSE)"}),t("td",{children:[t(te,{status:e.transmit.available?"connected":"inactive",prefix:s}),e.transmit.available?"connected":"unavailable"]}),t("td",{style:{fontSize:"11px"},children:e.transmit.channels.length>0?`Channels: ${e.transmit.channels.join(", ")}`:"-"})]}),Object.entries(e.integrations).map(([h,a])=>{const p=a.active??a.available??!1,f=a.active?"active":a.available?"available":"unavailable";let m=a.mode?`Mode: ${a.mode}`:"-";return h==="edgePlugin"&&a.active?m="@serverStats() tag registered":h==="cacheInspector"&&a.available?m="Redis dependency detected":h==="queueInspector"&&a.available&&(m="Queue dependency detected"),t("tr",{children:[t("td",{children:vs(h)}),t("td",{children:[t(te,{status:p?"active":"inactive",prefix:s}),f]}),t("td",{className:`${s}-c-dim`,style:{fontSize:"11px"},children:m})]},h)})]})]}),e.storage&&t(E,{children:[t("h3",{className:`${s}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Metric"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Status"}),t("td",{children:[t(te,{status:e.storage.ready?"ready":"inactive",prefix:s}),e.storage.ready?"ready":"not ready"]})]}),t("tr",{children:[t("td",{children:"DB Path"}),t("td",{children:t("code",{children:e.storage.dbPath})})]}),t("tr",{children:[t("td",{children:"File Size"}),t("td",{children:[e.storage.fileSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"WAL Size"}),t("td",{children:[e.storage.walSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"Retention"}),t("td",{children:[e.storage.retentionDays," days"]})]}),t("tr",{children:[t("td",{children:"Last Cleanup"}),t("td",{children:e.storage.lastCleanupAt?Be(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:n,style:{marginTop:8},children:[t("thead",{children:t("tr",{children:[t("th",{children:"Table"}),t("th",{children:"Rows"})]})}),t("tbody",{children:e.storage.tables.map(h=>t("tr",{children:[t("td",{children:t("code",{children:h.name})}),t("td",{children:h.rowCount.toLocaleString()})]},h.name))})]})]}),t("h3",{className:`${s}-internals-title`,children:"Resolved Config"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"intervalMs"}),t("td",{children:e.config.intervalMs})]}),t("tr",{children:[t("td",{children:"transport"}),t("td",{children:e.config.transport})]}),t("tr",{children:[t("td",{children:"channelName"}),t("td",{children:e.config.channelName})]}),t("tr",{children:[t("td",{children:"endpoint"}),t("td",{children:e.config.endpoint===!1?"false":e.config.endpoint})]}),t("tr",{children:[t("td",{children:"skipInTest"}),t("td",{children:c("skipInTest",e.config.skipInTest)})]}),t("tr",{children:[t("td",{children:"onStats callback"}),t("td",{children:e.config.hasOnStatsCallback?"defined":"not defined"})]}),t("tr",{children:[t("td",{children:"shouldShow callback"}),t("td",{children:e.config.hasShouldShowCallback?"defined":"not defined"})]})]})]}),t("h4",{className:`${s}-internals-title`,children:"DevToolbar"}),t("table",{className:n,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:Object.entries(e.devToolbar).map(([h,a])=>t("tr",{children:[t("td",{children:h==="customPaneCount"?"customPanes":h}),t("td",{children:h==="customPaneCount"?`${a} registered`:c(h,a)})]},h))})]})]})}function an({options:e}){const{data:n,isLoading:r,error:s}=ms({baseUrl:e?.baseUrl,debugEndpoint:e?.debugEndpoint,authToken:e?.authToken});return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading diagnostics..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):n?t(Ss,{data:n,tableClassName:"ss-dbg-table",classPrefix:"ss-dbg"}):t("div",{className:"ss-dbg-empty",children:"Diagnostics not available"})}const Ts=Object.freeze(Object.defineProperty({__proto__:null,InternalsTab:an,default:an},Symbol.toStringTag,{value:"Module"}));function on({pane:e,options:n}){({...n});const{data:r,isLoading:s,error:l,clearData:i}=H(e.endpoint.replace(/^\//,""),{...n,debugEndpoint:""}),[o,c]=x(""),u=T(()=>{if(!r)return[];const p=e.dataKey||e.id;let f=r;for(const m of p.split("."))f=f?.[m];return Array.isArray(f)?f:[]},[r,e.dataKey,e.id]),d=T(()=>{if(!o)return u;const p=o.toLowerCase(),f=e.columns.filter(m=>m.searchable).map(m=>m.key);return f.length===0?u:u.filter(m=>f.some(y=>{const v=m[y];return v!==null&&String(v).toLowerCase().includes(p)}))},[u,o,e.columns]),h=(p,f)=>{if(p==null)return t("span",{className:"ss-dbg-c-dim",children:"-"});switch(f.format||"text"){case"time":return typeof p=="number"?t(J,{ts:p,className:"ss-dbg-event-time"}):t("span",{className:"ss-dbg-event-time",children:String(p)});case"timeAgo":return t(J,{ts:p,className:"ss-dbg-event-time"});case"duration":{const y=typeof p=="number"?p:parseFloat(String(p));return isNaN(y)?String(p):t("span",{className:`ss-dbg-duration ${ge(y,"ss-dbg")}`,children:V(y)})}case"method":return t(we,{method:String(p),classPrefix:"ss-dbg"});case"json":{let y=p;if(typeof p=="string")try{y=JSON.parse(p)}catch{}return be(y,80)}case"badge":{const y=String(p).toLowerCase(),g=(f.badgeColorMap||{})[y]||"muted";return t(Br,{color:g,classPrefix:"ss-dbg",children:String(p)})}default:return String(p)}},a=K([d]);return s&&!r?t("div",{className:"ss-dbg-empty",children:["Loading ",e.label,"..."]}):l?t("div",{className:"ss-dbg-empty",children:["Error: ",l.message]}):t("div",{children:[e.search&&t(U,{search:o,onSearchChange:c,placeholder:e.search.placeholder,summary:`${d.length} items`,children:e.clearable&&t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:i,children:"Clear"})}),d.length===0?t("div",{className:"ss-dbg-empty",children:"No data"}):t("table",{ref:a,className:"ss-dbg-table",children:[t("thead",{children:t("tr",{children:e.columns.map(p=>t("th",{children:p.label},p.key))})}),t("tbody",{children:d.map((p,f)=>t("tr",{children:e.columns.map(m=>t("td",{children:h(p[m.key],m)},m.key))},p.id??f))})]})]})}const Ls=Object.freeze(Object.defineProperty({__proto__:null,CustomPaneTab:on,default:on},Symbol.toStringTag,{value:"Module"}))})();