adonisjs-server-stats 1.9.0 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -14
- package/dist/core/config-utils.d.ts +8 -0
- package/dist/core/constants.d.ts +4 -0
- package/dist/core/dashboard-data-controller.d.ts +16 -0
- package/dist/core/dashboard-data-helpers.d.ts +12 -0
- package/dist/core/debug-data-controller.d.ts +4 -0
- package/dist/core/define-config-helpers.d.ts +25 -0
- package/dist/core/feature-detect-helpers.d.ts +36 -0
- package/dist/core/formatters-helpers.d.ts +23 -0
- package/dist/core/index.js +596 -509
- package/dist/core/log-utils-helpers.d.ts +13 -0
- package/dist/core/metrics.d.ts +3 -28
- package/dist/core/pagination.d.ts +0 -9
- package/dist/core/server-stats-controller.d.ts +6 -0
- package/dist/core/split-pane.d.ts +18 -0
- package/dist/core/trace-utils.d.ts +5 -0
- package/dist/core/transmit-helpers.d.ts +7 -0
- package/dist/core/types-dashboard.d.ts +178 -0
- package/dist/core/types-diagnostics.d.ts +85 -0
- package/dist/core/types.d.ts +11 -443
- package/dist/react/{CacheSection-xH75hwXu.js → CacheSection-baMZotSn.js} +2 -2
- package/dist/react/CacheTab-2cw_rMzj.js +117 -0
- package/dist/react/{ConfigSection-D8BO1Ry9.js → ConfigSection-DGgqjAal.js} +1 -1
- package/dist/react/{ConfigTab-CcN-tfjv.js → ConfigTab-H3OnYqmK.js} +1 -1
- package/dist/react/CustomPaneTab-B6r7ha0u.js +98 -0
- package/dist/react/{EmailsSection-BzlsTdPs.js → EmailsSection-C-UZISG-.js} +2 -2
- package/dist/react/EmailsTab-DbK4Eobn.js +139 -0
- package/dist/react/{EventsSection-CGQWiIdV.js → EventsSection-C7RQW_LY.js} +2 -2
- package/dist/react/EventsTab-CfVr7AiM.js +57 -0
- package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
- package/dist/react/{JobsSection-D7AHQmZi.js → JobsSection-CQHNK_Ls.js} +2 -2
- package/dist/react/{JobsTab-B3Lfdqed.js → JobsTab-znzf6jzk.js} +54 -42
- package/dist/react/{LogsSection-Cly1dpvS.js → LogsSection-Dmm3rE2B.js} +9 -3
- package/dist/react/LogsTab-D8unMV5P.js +108 -0
- package/dist/react/{OverviewSection-CkBGFEWq.js → OverviewSection-ABP9ueBo.js} +1 -1
- package/dist/react/{QueriesSection-CfCpnNUD.js → QueriesSection-CnmSkznA.js} +2 -2
- package/dist/react/{QueriesTab-DbBmAqzO.js → QueriesTab-BQzcxEiW.js} +37 -40
- package/dist/react/RelatedLogs-3A8RuGKH.js +52 -0
- package/dist/react/RequestsSection-kW79_M7k.js +341 -0
- package/dist/react/{RoutesSection-CRqF-cNM.js → RoutesSection-BRhxrtjZ.js} +2 -2
- package/dist/react/RoutesTab-CpYH5lUw.js +68 -0
- package/dist/react/TimelineTab-DjLR35Ce.js +214 -0
- package/dist/react/index-CsImORX6.js +1121 -0
- package/dist/react/index.js +1 -1
- package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
- package/dist/react/react/components/shared/RelatedLogs.d.ts +7 -0
- package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
- package/dist/react/style.css +1 -1
- package/dist/src/collectors/app_collector.d.ts +0 -8
- package/dist/src/collectors/app_collector.js +45 -52
- package/dist/src/collectors/auto_detect.d.ts +0 -23
- package/dist/src/collectors/auto_detect.js +33 -55
- package/dist/src/collectors/db_pool_collector.d.ts +14 -16
- package/dist/src/collectors/db_pool_collector.js +72 -57
- package/dist/src/collectors/log_collector.d.ts +0 -47
- package/dist/src/collectors/log_collector.js +36 -65
- package/dist/src/collectors/queue_collector.d.ts +0 -20
- package/dist/src/collectors/queue_collector.js +60 -76
- package/dist/src/collectors/redis_collector.d.ts +10 -10
- package/dist/src/collectors/redis_collector.js +69 -66
- package/dist/src/config/deprecation_migration.d.ts +7 -0
- package/dist/src/config/deprecation_migration.js +201 -0
- package/dist/src/controller/debug_controller.d.ts +1 -1
- package/dist/src/controller/debug_controller.js +87 -81
- package/dist/src/dashboard/cache_handlers.d.ts +14 -0
- package/dist/src/dashboard/cache_handlers.js +52 -0
- package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
- package/dist/src/dashboard/chart_aggregator.js +68 -50
- package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
- package/dist/src/dashboard/coalesce_cache.js +47 -0
- package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
- package/dist/src/dashboard/dashboard_controller.js +52 -532
- package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
- package/dist/src/dashboard/dashboard_page_assets.js +51 -0
- package/dist/src/dashboard/dashboard_store.d.ts +19 -217
- package/dist/src/dashboard/dashboard_store.js +115 -1069
- package/dist/src/dashboard/dashboard_types.d.ts +83 -0
- package/dist/src/dashboard/dashboard_types.js +4 -0
- package/dist/src/dashboard/detail_queries.d.ts +19 -0
- package/dist/src/dashboard/detail_queries.js +98 -0
- package/dist/src/dashboard/email_event_builder.d.ts +8 -0
- package/dist/src/dashboard/email_event_builder.js +65 -0
- package/dist/src/dashboard/explain_query.d.ts +8 -0
- package/dist/src/dashboard/explain_query.js +22 -0
- package/dist/src/dashboard/filter_handlers.d.ts +23 -0
- package/dist/src/dashboard/filter_handlers.js +56 -0
- package/dist/src/dashboard/filtered_queries.d.ts +15 -0
- package/dist/src/dashboard/filtered_queries.js +155 -0
- package/dist/src/dashboard/flush_manager.d.ts +25 -0
- package/dist/src/dashboard/flush_manager.js +107 -0
- package/dist/src/dashboard/format_helpers.d.ts +126 -0
- package/dist/src/dashboard/format_helpers.js +140 -0
- package/dist/src/dashboard/inspector_manager.d.ts +36 -0
- package/dist/src/dashboard/inspector_manager.js +102 -0
- package/dist/src/dashboard/integrations/config_inspector.js +11 -13
- package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
- package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
- package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
- package/dist/src/dashboard/jobs_handlers.js +61 -0
- package/dist/src/dashboard/knex_factory.d.ts +18 -0
- package/dist/src/dashboard/knex_factory.js +91 -0
- package/dist/src/dashboard/migrator.js +30 -153
- package/dist/src/dashboard/migrator_tables.d.ts +19 -0
- package/dist/src/dashboard/migrator_tables.js +153 -0
- package/dist/src/dashboard/overview_queries.d.ts +66 -0
- package/dist/src/dashboard/overview_queries.js +155 -0
- package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
- package/dist/src/dashboard/overview_query_runners.js +84 -0
- package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
- package/dist/src/dashboard/overview_store_queries.js +69 -0
- package/dist/src/dashboard/paginate_helper.d.ts +12 -0
- package/dist/src/dashboard/paginate_helper.js +33 -0
- package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
- package/dist/src/dashboard/query_explain_handler.js +80 -0
- package/dist/src/dashboard/read_queries.d.ts +32 -0
- package/dist/src/dashboard/read_queries.js +107 -0
- package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
- package/dist/src/dashboard/saved_filter_queries.js +24 -0
- package/dist/src/dashboard/storage_stats.d.ts +41 -0
- package/dist/src/dashboard/storage_stats.js +81 -0
- package/dist/src/dashboard/write_queue.d.ts +106 -0
- package/dist/src/dashboard/write_queue.js +225 -0
- package/dist/src/data/data_access.d.ts +6 -36
- package/dist/src/data/data_access.js +43 -188
- package/dist/src/data/data_access_helpers.d.ts +130 -0
- package/dist/src/data/data_access_helpers.js +212 -0
- package/dist/src/debug/debug_store.js +37 -32
- package/dist/src/debug/email_collector.d.ts +1 -10
- package/dist/src/debug/email_collector.js +78 -81
- package/dist/src/debug/event_collector.d.ts +0 -9
- package/dist/src/debug/event_collector.js +79 -62
- package/dist/src/debug/query_collector.js +23 -19
- package/dist/src/debug/route_inspector.d.ts +1 -5
- package/dist/src/debug/route_inspector.js +50 -51
- package/dist/src/debug/trace_collector.d.ts +10 -2
- package/dist/src/debug/trace_collector.js +23 -16
- package/dist/src/debug/types.d.ts +5 -1
- package/dist/src/define_config.d.ts +0 -65
- package/dist/src/define_config.js +93 -333
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client/stats-bar.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +5 -5
- package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
- package/dist/src/edge/client-vue/stats-bar.js +3 -3
- package/dist/src/edge/plugin.d.ts +0 -16
- package/dist/src/edge/plugin.js +57 -64
- package/dist/src/engine/request_metrics.d.ts +1 -0
- package/dist/src/engine/request_metrics.js +32 -42
- package/dist/src/middleware/request_tracking_middleware.d.ts +3 -8
- package/dist/src/middleware/request_tracking_middleware.js +65 -91
- package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
- package/dist/src/provider/auth_middleware_detector.js +97 -0
- package/dist/src/provider/boot_helpers.d.ts +20 -0
- package/dist/src/provider/boot_helpers.js +91 -0
- package/dist/src/provider/boot_initializer.d.ts +28 -0
- package/dist/src/provider/boot_initializer.js +35 -0
- package/dist/src/provider/dashboard_init.d.ts +30 -0
- package/dist/src/provider/dashboard_init.js +138 -0
- package/dist/src/provider/dashboard_setup.d.ts +25 -0
- package/dist/src/provider/dashboard_setup.js +78 -0
- package/dist/src/provider/diagnostics.d.ts +134 -0
- package/dist/src/provider/diagnostics.js +127 -0
- package/dist/src/provider/email_bridge.d.ts +43 -0
- package/dist/src/provider/email_bridge.js +80 -0
- package/dist/src/provider/email_helpers.d.ts +13 -0
- package/dist/src/provider/email_helpers.js +68 -0
- package/dist/src/provider/pino_hook.d.ts +17 -0
- package/dist/src/provider/pino_hook.js +35 -0
- package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
- package/dist/src/provider/provider_helpers_extra.js +177 -0
- package/dist/src/provider/server_stats_provider.d.ts +39 -85
- package/dist/src/provider/server_stats_provider.js +131 -936
- package/dist/src/provider/shutdown_helpers.d.ts +43 -0
- package/dist/src/provider/shutdown_helpers.js +70 -0
- package/dist/src/provider/toolbar_setup.d.ts +57 -0
- package/dist/src/provider/toolbar_setup.js +141 -0
- package/dist/src/routes/dashboard_routes.d.ts +14 -0
- package/dist/src/routes/dashboard_routes.js +197 -0
- package/dist/src/routes/debug_routes.d.ts +14 -0
- package/dist/src/routes/debug_routes.js +101 -0
- package/dist/src/routes/register_routes.d.ts +0 -78
- package/dist/src/routes/register_routes.js +22 -347
- package/dist/src/routes/stats_routes.d.ts +5 -0
- package/dist/src/routes/stats_routes.js +14 -0
- package/dist/src/styles/components.css +177 -0
- package/dist/src/styles/dashboard.css +8 -90
- package/dist/src/styles/debug-panel.css +10 -31
- package/dist/src/types.d.ts +306 -15
- package/dist/vue/{CacheSection-Cx-hj09X.js → CacheSection-ITqvpfH5.js} +1 -1
- package/dist/vue/{ConfigSection-CMXyryf6.js → ConfigSection-DTn3GslE.js} +1 -1
- package/dist/vue/{EmailsSection-DgKl9xGT.js → EmailsSection-DtLJ4XoS.js} +1 -1
- package/dist/vue/{EventsSection-BNMCAim1.js → EventsSection-BOYYz0Ty.js} +1 -1
- package/dist/vue/{JobsSection-CCMgMlxd.js → JobsSection-BazTxcJL.js} +1 -1
- package/dist/vue/{LogsSection-CvOnTxUu.js → LogsSection-D55PjTKX.js} +9 -3
- package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
- package/dist/vue/{OverviewSection-CHgaKtUR.js → OverviewSection-1uBKo-Tu.js} +1 -1
- package/dist/vue/{QueriesSection-BnHRD98z.js → QueriesSection-rpoZ4ogd.js} +1 -1
- package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +84 -0
- package/dist/vue/RequestsSection-x7LvT0MC.js +401 -0
- package/dist/vue/{RoutesSection-BrceOcKQ.js → RoutesSection-CCD0zZqQ.js} +1 -1
- package/dist/vue/TimelineTab-zj5Z5OdT.js +338 -0
- package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +4 -0
- package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +4 -0
- package/dist/vue/components/{Dashboard/sections/TimelineSection.vue.d.ts → shared/RelatedLogs.vue.d.ts} +5 -6
- package/dist/vue/composables/useDashboardData.d.ts +12 -23
- package/dist/vue/index-C8MxnS7Q.js +1232 -0
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/react/CacheTab-DYmsZJJ1.js +0 -123
- package/dist/react/CustomPaneTab-D7_o3Ec6.js +0 -104
- package/dist/react/EmailsTab-Uh2CQY3o.js +0 -153
- package/dist/react/EventsTab-CC6DQzEm.js +0 -63
- package/dist/react/LogsTab-BbYK-iyh.js +0 -103
- package/dist/react/RequestsSection-Cb5a6MlT.js +0 -209
- package/dist/react/RoutesTab-Bwreij3e.js +0 -74
- package/dist/react/TimelineSection-B2y06kRE.js +0 -158
- package/dist/react/TimelineTab-6hthfdBB.js +0 -193
- package/dist/react/WaterfallChart-Cj73WdfM.js +0 -100
- package/dist/react/index-CecA4IdQ.js +0 -1075
- package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +0 -8
- package/dist/vue/RequestsSection-B-uSlM0f.js +0 -243
- package/dist/vue/TimelineSection-CfvnA2Oo.js +0 -186
- package/dist/vue/TimelineTab-Db6lKKsD.js +0 -250
- package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +0 -118
- package/dist/vue/index-oLxS08vN.js +0 -1235
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";var ne,$,Oe,J,Ie,De,je,Be,be,ve,ye,re={},se=[],qt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,G=Array.isArray;function U(e,n){for(var r in n)e[r]=n[r];return e}function we(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function le(e,n,r){var s,l,i,u={};for(i in n)i=="key"?s=n[i]:i=="ref"?l=n[i]:u[i]=n[i];if(arguments.length>2&&(u.children=arguments.length>3?ne.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)u[i]===void 0&&(u[i]=e.defaultProps[i]);return ie(e,u,s,l,null)}function ie(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??++Oe,__i:-1,__u:0};return l==null&&$.vnode!=null&&$.vnode(i),i}function I(e){return e.children}function H(e,n){this.props=e,this.context=n}function K(e,n){if(n==null)return e.__?K(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"?K(e):null}function Wt(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,s=[],l=[],i=U({},n);i.__v=n.__v+1,$.vnode&&$.vnode(i),Ne(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??K(n),!!(32&n.__u),l),i.__v=n.__v,i.__.__k[i.__i]=i,qe(s,i,l),n.__e=n.__=null,i.__e!=r&&Re(i)}}function Re(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}),Re(e)}function Fe(e){(!e.__d&&(e.__d=!0)&&J.push(e)&&!ae.__r++||Ie!=$.debounceRendering)&&((Ie=$.debounceRendering)||De)(ae)}function ae(){for(var e,n=1;J.length;)J.length>n&&J.sort(je),e=J.shift(),n=J.length,Wt(e);ae.__r=0}function Ue(e,n,r,s,l,i,u,o,c,a,f){var d,h,_,p,m,v,y,g=s&&s.__k||se,x=n.length;for(c=Jt(r,n,g,c,x),d=0;d<x;d++)(_=r.__k[d])!=null&&(h=_.__i!=-1&&g[_.__i]||re,_.__i=d,v=Ne(e,_,h,l,i,u,o,c,a,f),p=_.__e,_.ref&&h.ref!=_.ref&&(h.ref&&$e(h.ref,null,_),f.push(_.ref,_.__c||p,_)),m==null&&p!=null&&(m=p),(y=!!(4&_.__u))||h.__k===_.__k?c=He(_,c,e,y):typeof _.type=="function"&&v!==void 0?c=v:p&&(c=p.nextSibling),_.__u&=-7);return r.__e=m,c}function Jt(e,n,r,s,l){var i,u,o,c,a,f=r.length,d=f,h=0;for(e.__k=new Array(l),i=0;i<l;i++)(u=n[i])!=null&&typeof u!="boolean"&&typeof u!="function"?(typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?u=e.__k[i]=ie(null,u,null,null,null):G(u)?u=e.__k[i]=ie(I,{children:u},null,null,null):u.constructor===void 0&&u.__b>0?u=e.__k[i]=ie(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[i]=u,c=i+h,u.__=e,u.__b=e.__b+1,o=null,(a=u.__i=Kt(u,r,c,d))!=-1&&(d--,(o=r[a])&&(o.__u|=2)),o==null||o.__v==null?(a==-1&&(l>f?h--:l<f&&h++),typeof u.type!="function"&&(u.__u|=4)):a!=c&&(a==c-1?h--:a==c+1?h++:(a>c?h--:h++,u.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<f;i++)(o=r[i])!=null&&(2&o.__u)==0&&(o.__e==s&&(s=K(o)),Je(o,o));return s}function He(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=He(l[i],n,r,s));return n}e.__e!=n&&(s&&(n&&e.type&&!n.parentNode&&(n=K(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function oe(e,n){return n=n||[],e==null||typeof e=="boolean"||(G(e)?e.some(function(r){oe(r,n)}):n.push(e)),n}function Kt(e,n,r,s){var l,i,u,o=e.key,c=e.type,a=n[r],f=a!=null&&(2&a.__u)==0;if(a===null&&o==null||f&&o==a.key&&c==a.type)return r;if(s>(f?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((a=n[u=l>=0?l--:i++])!=null&&(2&a.__u)==0&&o==a.key&&c==a.type)return u}return-1}function ze(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||qt.test(n)?r:r+"px"}function ce(e,n,r,s,l){var i,u;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(Be,"$1")),u=n.toLowerCase(),n=u in e||n=="onFocusOut"||n=="onFocusIn"?u.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=r,r?s?r.u=s.u:(r.u=be,e.addEventListener(n,i?ye:ve,i)):e.removeEventListener(n,i?ye:ve,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 Ve(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=be++;else if(n.t<r.u)return;return r($.event?$.event(n):n)}}}function Ne(e,n,r,s,l,i,u,o,c,a){var f,d,h,_,p,m,v,y,g,x,k,b,w,P,C,M=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[o=n.__e=r.__e]),(f=$.__b)&&f(n);e:if(typeof M=="function")try{if(y=n.props,g="prototype"in M&&M.prototype.render,x=(f=M.contextType)&&s[f.__c],k=f?x?x.props.value:f.__:s,r.__c?v=(d=n.__c=r.__c).__=d.__E:(g?n.__c=d=new M(y,k):(n.__c=d=new H(y,k),d.constructor=M,d.render=Gt),x&&x.sub(d),d.state||(d.state={}),d.__n=s,h=d.__d=!0,d.__h=[],d._sb=[]),g&&d.__s==null&&(d.__s=d.state),g&&M.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=U({},d.__s)),U(d.__s,M.getDerivedStateFromProps(y,d.__s))),_=d.props,p=d.state,d.__v=n,h)g&&M.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),g&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(g&&M.getDerivedStateFromProps==null&&y!==_&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,k),n.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,k)===!1){n.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(W){W&&(W.__=n)}),se.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&u.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,k),g&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(_,p,m)})}if(d.context=k,d.props=y,d.__P=e,d.__e=!1,b=$.__r,w=0,g)d.state=d.__s,d.__d=!1,b&&b(n),f=d.render(d.props,d.state,d.context),se.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,b&&b(n),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++w<25);d.state=d.__s,d.getChildContext!=null&&(s=U(U({},s),d.getChildContext())),g&&!h&&d.getSnapshotBeforeUpdate!=null&&(m=d.getSnapshotBeforeUpdate(_,p)),P=f!=null&&f.type===I&&f.key==null?We(f.props.children):f,o=Ue(e,G(P)?P:[P],n,r,s,l,i,u,o,c,a),d.base=n.__e,n.__u&=-161,d.__h.length&&u.push(d),v&&(d.__E=d.__=null)}catch(W){if(n.__v=null,c||i!=null)if(W.then){for(n.__u|=c?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;i[i.indexOf(o)]=null,n.__e=o}else{for(C=i.length;C--;)we(i[C]);xe(n)}else n.__e=r.__e,n.__k=r.__k,W.then||xe(n);$.__e(W,n,r)}else i==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):o=n.__e=Qt(r.__e,n,r,s,l,i,u,c,a);return(f=$.diffed)&&f(n),128&n.__u?void 0:o}function xe(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(xe))}function qe(e,n,r){for(var s=0;s<r.length;s++)$e(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 We(e){return typeof e!="object"||e==null||e.__b>0?e:G(e)?e.map(We):U({},e)}function Qt(e,n,r,s,l,i,u,o,c){var a,f,d,h,_,p,m,v=r.props||re,y=n.props,g=n.type;if(g=="svg"?l="http://www.w3.org/2000/svg":g=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((_=i[a])&&"setAttribute"in _==!!g&&(g?_.localName==g:_.nodeType==3)){e=_,i[a]=null;break}}if(e==null){if(g==null)return document.createTextNode(y);e=document.createElementNS(l,g,y.is&&y),o&&($.__m&&$.__m(n,i),o=!1),i=null}if(g==null)v===y||o&&e.data==y||(e.data=y);else{if(i=i&&ne.call(e.childNodes),!o&&i!=null)for(v={},a=0;a<e.attributes.length;a++)v[(_=e.attributes[a]).name]=_.value;for(a in v)_=v[a],a=="dangerouslySetInnerHTML"?d=_:a=="children"||a in y||a=="value"&&"defaultValue"in y||a=="checked"&&"defaultChecked"in y||ce(e,a,null,_,l);for(a in y)_=y[a],a=="children"?h=_:a=="dangerouslySetInnerHTML"?f=_:a=="value"?p=_:a=="checked"?m=_:o&&typeof _!="function"||v[a]===_||ce(e,a,_,v[a],l);if(f)o||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),n.__k=[];else if(d&&(e.innerHTML=""),Ue(n.type=="template"?e.content:e,G(h)?h:[h],n,r,s,g=="foreignObject"?"http://www.w3.org/1999/xhtml":l,i,u,i?i[0]:r.__k&&K(r,0),o,c),i!=null)for(a=i.length;a--;)we(i[a]);o||(a="value",g=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[a]||g=="progress"&&!p||g=="option"&&p!=v[a])&&ce(e,a,p,v[a],l),a="checked",m!=null&&m!=e[a]&&ce(e,a,m,v[a],l))}return e}function $e(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 Je(e,n,r){var s,l;if($.unmount&&$.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||$e(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]&&Je(s[l],n,r||typeof e.type!="function");r||we(e.__e),e.__c=e.__=e.__e=void 0}function Gt(e,n,r){return this.constructor(e,r)}function Ke(e,n,r){var s,l,i,u;n==document&&(n=document.documentElement),$.__&&$.__(e,n),l=(s=!1)?null:n.__k,i=[],u=[],Ne(n,e=n.__k=le(I,null,[e]),l||re,re,n.namespaceURI,l?null:n.firstChild?ne.call(n.childNodes):null,i,l?l.__e:n.firstChild,s,u),qe(i,e,u)}ne=se.slice,$={__e:function(e,n,r,s){for(var l,i,u;n=n.__;)if((l=n.__c)&&!l.__)try{if((i=l.constructor)&&i.getDerivedStateFromError!=null&&(l.setState(i.getDerivedStateFromError(e)),u=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,s||{}),u=l.__d),u)return l.__E=l}catch(o){e=o}throw e}},Oe=0,H.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=U({},this.state),typeof e=="function"&&(e=e(U({},r),this.props)),e&&U(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Fe(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Fe(this))},H.prototype.render=I,J=[],De=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,je=function(e,n){return e.__v.__b-n.__v.__b},ae.__r=0,Be=/(PointerCapture)$|Capture$/i,be=0,ve=Ve(!1),ye=Ve(!0);var Xt=0;function t(e,n,r,s,l,i){n||(n={});var u,o,c=n;if("ref"in c)for(o in c={},n)o=="ref"?u=n[o]:c[o]=n[o];var a={type:e,props:c,key:r,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xt,__i:-1,__u:0,__source:l,__self:i};if(typeof e=="function"&&(u=e.defaultProps))for(o in u)c[o]===void 0&&(c[o]=u[o]);return $.vnode&&$.vnode(a),a}var X,L,ke,Qe,Y=0,Ge=[],E=$,Xe=E.__b,Ye=E.__r,Ze=E.diffed,et=E.__c,tt=E.unmount,nt=E.__;function Ce(e,n){E.__h&&E.__h(L,e,Y||n),Y=0;var r=L.__H||(L.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function N(e){return Y=1,Yt(lt,e)}function Yt(e,n,r){var s=Ce(X++,2);if(s.t=e,!s.__c&&(s.__=[r?r(n):lt(void 0,n),function(o){var c=s.__N?s.__N[0]:s.__[0],a=s.t(c,o);c!==a&&(s.__N=[a,s.__[1]],s.__c.setState({}))}],s.__c=L,!L.__f)){var l=function(o,c,a){if(!s.__c.__H)return!0;var f=s.__c.__H.__.filter(function(h){return h.__c});if(f.every(function(h){return!h.__N}))return!i||i.call(this,o,c,a);var d=s.__c.props!==o;return f.some(function(h){if(h.__N){var _=h.__[0];h.__=h.__N,h.__N=void 0,_!==h.__[0]&&(d=!0)}}),i&&i.call(this,o,c,a)||d};L.__f=!0;var i=L.shouldComponentUpdate,u=L.componentWillUpdate;L.componentWillUpdate=function(o,c,a){if(this.__e){var f=i;i=void 0,l(o,c,a),i=f}u&&u.call(this,o,c,a)},L.shouldComponentUpdate=l}return s.__N||s.__}function z(e,n){var r=Ce(X++,3);!E.__s&&st(r.__H,n)&&(r.__=e,r.u=n,L.__H.__h.push(r))}function j(e){return Y=5,T(function(){return{current:e}},[])}function T(e,n){var r=Ce(X++,7);return st(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function S(e,n){return Y=8,T(function(){return e},n)}function Zt(){for(var e;e=Ge.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(de),n.__h.some(Se),n.__h=[]}catch(r){n.__h=[],E.__e(r,e.__v)}}}E.__b=function(e){L=null,Xe&&Xe(e)},E.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),nt&&nt(e,n)},E.__r=function(e){Ye&&Ye(e),X=0;var n=(L=e.__c).__H;n&&(ke===L?(n.__h=[],L.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(de),n.__h.some(Se),n.__h=[],X=0)),ke=L},E.diffed=function(e){Ze&&Ze(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Ge.push(n)!==1&&Qe===E.requestAnimationFrame||((Qe=E.requestAnimationFrame)||en)(Zt)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ke=L=null},E.__c=function(e,n){n.some(function(r){try{r.__h.some(de),r.__h=r.__h.filter(function(s){return!s.__||Se(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],E.__e(s,r.__v)}}),et&&et(e,n)},E.unmount=function(e){tt&&tt(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(s){try{de(s)}catch(l){n=l}}),r.__H=void 0,n&&E.__e(n,r.__v))};var rt=typeof requestAnimationFrame=="function";function en(e){var n,r=function(){clearTimeout(s),rt&&cancelAnimationFrame(n),setTimeout(e)},s=setTimeout(r,35);rt&&(n=requestAnimationFrame(r))}function de(e){var n=L,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),L=n}function Se(e){var n=L;e.__c=e.__(),L=n}function st(e,n){return!e||e.length!==n.length||n.some(function(r,s){return r!==e[s]})}function lt(e,n){return typeof n=="function"?n(e):n}function tn(e,n){for(var r in n)e[r]=n[r];return e}function it(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 at(e,n){this.props=e,this.context=n}(at.prototype=new H).isPureReactComponent=!0,at.prototype.shouldComponentUpdate=function(e,n){return it(this.props,e)||it(this.state,n)};var ot=$.__b;$.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ot&&ot(e)};var nn=$.__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)}nn(e,n,r,s)};var ct=$.unmount;function dt(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=tn({},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 dt(s,n,r)})),e}function ut(e,n,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return ut(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 Z(){this.__u=0,this.o=null,this.__b=null}function ht(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function D(e){var n,r,s,l=null;function i(u){if(n||(n=e()).then(function(o){o&&(l=o.default||o),s=!0},function(o){r=o,s=!0}),r)throw r;if(!s)throw n;return l?le(l,u):null}return i.displayName="Lazy",i.__f=!0,i}function ue(){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),ct&&ct(e)},(Z.prototype=new H).__c=function(e,n){var r=n.__c,s=this;s.o==null&&(s.o=[]),s.o.push(r);var l=ht(s.__v),i=!1,u=function(){i||s.__z||(i=!0,r.__R=null,l?l(c):c())};r.__R=u;var o=r.__P;r.__P=null;var c=function(){if(!--s.__u){if(s.state.__a){var a=s.state.__a;s.__v.__k[0]=ut(a,a.__c.__P,a.__c.__O)}var f;for(s.setState({__a:s.__b=null});f=s.o.pop();)f.__P=o,f.forceUpdate()}};s.__u++||32&n.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(u,u)},Z.prototype.componentWillUnmount=function(){this.o=[]},Z.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]=dt(this.__b,r,s.__O=s.__P)}this.__b=null}var l=n.__a&&le(I,null,e.fallback);return l&&(l.__u&=-33),[le(I,null,n.__a?null:e.children),l]};var ft=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]}};(ue.prototype=new H).__a=function(e){var n=this,r=ht(n.__v),s=n.l.get(e);return s[0]++,function(l){var i=function(){n.props.revealOrder?(s.push(l),ft(n,e,s)):l()};r?r(i):i()}},ue.prototype.render=function(e){this.i=null,this.l=new Map;var n=oe(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},ue.prototype.componentDidUpdate=ue.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,r){ft(e,r,n)})};var rn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,sn=/^(?: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]/,ln=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,an=/[A-Z0-9]/g,on=typeof document<"u",cn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};H.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(H.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var pt=$.event;function dn(){}function un(){return this.cancelBubble}function hn(){return this.defaultPrevented}$.event=function(e){return pt&&(e=pt(e)),e.persist=dn,e.isPropagationStopped=un,e.isDefaultPrevented=hn,e.nativeEvent=e};var fn={enumerable:!1,configurable:!0,get:function(){return this.class}},_t=$.vnode;$.vnode=function(e){typeof e.type=="string"&&(function(n){var r=n.props,s=n.type,l={},i=s.indexOf("-")===-1;for(var u in r){var o=r[u];if(!(u==="value"&&"defaultValue"in r&&o==null||on&&u==="children"&&s==="noscript"||u==="class"||u==="className")){var c=u.toLowerCase();u==="defaultValue"&&"value"in r&&r.value==null?u="value":u==="download"&&o===!0?o="":c==="translate"&&o==="no"?o=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?u="ondblclick":c!=="onchange"||s!=="input"&&s!=="textarea"||cn(r.type)?c==="onfocus"?u="onfocusin":c==="onblur"?u="onfocusout":ln.test(u)&&(u=c):c=u="oninput":i&&sn.test(u)?u=u.replace(an,"-$&").toLowerCase():o===null&&(o=void 0),c==="oninput"&&l[u=c]&&(u="oninputCapture"),l[u]=o}}s=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=oe(r.children).forEach(function(a){a.props.selected=l.value.indexOf(a.props.value)!=-1})),s=="select"&&l.defaultValue!=null&&(l.value=oe(r.children).forEach(function(a){a.props.selected=l.multiple?l.defaultValue.indexOf(a.props.value)!=-1:l.defaultValue==a.props.value})),r.class&&!r.className?(l.class=r.class,Object.defineProperty(l,"className",fn)):r.className&&(l.class=l.className=r.className),n.props=l})(e),e.$$typeof=rn,_t&&_t(e)};var mt=$.__r;$.__r=function(e){mt&&mt(e),e.__c};var gt=$.diffed;$.diffed=function(e){gt&>(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 pn={Fragment:I};const A={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 he extends Error{status;constructor(n=403){super(`Unauthorized (HTTP ${n})`),this.name="UnauthorizedError",this.status=n}}class _n extends Error{status;body;constructor(n,r){super(`API error (HTTP ${n})`),this.name="ApiError",this.status=n,this.body=r}}class Te{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 he(i.status);if(!i.ok){const u=await i.text().catch(()=>"");throw new _n(i.status,u)}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 bt="/admin/api/debug",vt={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){return{tracing:e.features?.tracing??!1,process:e.features?.process??!1,system:e.features?.system??!1,http:e.features?.http??!1,db:e.features?.db??!1,redis:e.features?.redis??!1,queues:e.features?.queues??!1,cache:e.features?.cache??!1,app:e.features?.app??!1,log:e.features?.log??!1,emails:e.features?.emails??!1,dashboard:e.features?.dashboard??!1,customPanes:e.customPanes??[]}}async function gn(e,n=bt){const r=`${n.replace(/\/+$/,"")}/config`;return e.fetch(r)}async function bn(e){const{baseUrl:n="",debugEndpoint:r=bt,authToken:s}=e,l=new Te({baseUrl:n,authToken:s});try{const i=await gn(l,r);return mn(i)}catch{return vt}}function vn(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e,[l,i]=N(vt),[u,o]=N(!0),[c,a]=N(null),f=j(!1);return z(()=>{if(f.current)return;f.current=!0;let d=!1;return(async()=>{try{const _=await bn({baseUrl:n,debugEndpoint:r,authToken:s});d||(i(_),o(!1))}catch(_){d||(a(_ instanceof Error?_:new Error(String(_))),o(!1))}})(),()=>{d=!0}},[n,r,s]),{features:l,isLoading:u,error:c}}const fe="ss-dash-theme",Le="ss-theme-change";function Ee(){if(typeof window>"u")return"light";const e=localStorage.getItem(fe);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function yn(e){typeof window>"u"||(localStorage.setItem(fe,e),window.dispatchEvent(new CustomEvent(Le,{detail:e})))}function wn(){const n=Ee()==="dark"?"light":"dark";return yn(n),n}function Nn(e){if(typeof window>"u")return()=>{};const n=i=>{const u=i.detail;(u==="dark"||u==="light")&&e(u)},r=i=>{if(i.key===fe){const u=i.newValue;e(u==="dark"||u==="light"?u:Ee())}},s=window.matchMedia("(prefers-color-scheme: dark)"),l=i=>{localStorage.getItem(fe)||e(i.matches?"dark":"light")};return window.addEventListener(Le,n),window.addEventListener("storage",r),s.addEventListener("change",l),()=>{window.removeEventListener(Le,n),window.removeEventListener("storage",r),s.removeEventListener("change",l)}}function xn(){const[e,n]=N(()=>Ee());z(()=>Nn(l=>{n(l)}),[]);const r=S(()=>{const s=wn();return n(s),s},[]);return{theme:e,toggleTheme:r}}function $n({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:A.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:A.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A.moon.elements.join("")}})})}const kn=D(()=>Promise.resolve().then(()=>Gn)),Cn=D(()=>Promise.resolve().then(()=>Xn)),Sn=D(()=>Promise.resolve().then(()=>Yn)),Tn=D(()=>Promise.resolve().then(()=>Zn)),Ln=D(()=>Promise.resolve().then(()=>lr)),En=D(()=>Promise.resolve().then(()=>ar)),An=D(()=>Promise.resolve().then(()=>or)),Pn=D(()=>Promise.resolve().then(()=>fr)),Mn=D(()=>Promise.resolve().then(()=>wr)),On=D(()=>Promise.resolve().then(()=>Ir)),In=D(()=>Promise.resolve().then(()=>Dr));function Dn(e){const{defaultOpen:n=!1,dashboardPath:r,isOpen:s,onOpenChange:l,isLive:i=!1,...u}=e,[o,c]=N(n),a=s!==void 0?s:o,f=b=>{l?l(b):c(b)},[d,h]=N("queries"),{features:_}=vn(u),{theme:p,toggleTheme:m}=xn(),v=_.customPanes||[];z(()=>{const b=w=>{w.key==="Escape"&&a&&f(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[a]);const y=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:"Timeline",visible:_.tracing},{id:"cache",label:"Cache",visible:_.cache},{id:"jobs",label:"Jobs",visible:_.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[_]),g=T(()=>y.filter(b=>b.visible),[y]);z(()=>{const b=[...g.map(w=>w.id),...v.map(w=>w.id)];!b.includes(d)&&b.length>0&&h(b[0])},[g,v,d]);const x=S(()=>{f(!a)},[a]),k=S(()=>{const b={options:u},w=v.find(C=>C.id===d);if(w)return t(Z,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:t(In,{pane:w,options:u})});const P={queries:t(kn,{...b}),events:t(Cn,{...b}),emails:t(Sn,{...b}),routes:t(Tn,{...b,currentPath:typeof window<"u"?window.location.pathname:""}),logs:t(Ln,{...b}),timeline:t(En,{...b}),cache:t(An,{...b,dashboardPath:r}),jobs:t(Pn,{...b,dashboardPath:r}),config:t(Mn,{...b,dashboardPath:r}),internals:t(On,{...b})};return t(Z,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:P[d]||t("div",{className:"ss-dbg-empty",children:"Unknown tab"})})},[d,u,v]);return t(I,{children:[s===void 0&&t("button",{type:"button",className:`ss-dbg-btn ${a?"ss-dbg-active":""}`,onClick:x,title:"Toggle debug panel",id:"ss-dbg-wrench",children:t("svg",{width:"14",height:"14",viewBox:A.wrench.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A.wrench.elements.join("")}})}),t("div",{className:`ss-dbg-panel ${a?"ss-dbg-open":""}`,"data-ss-theme":p,id:"ss-dbg-panel",children:[t("div",{className:"ss-dbg-tabs",children:[t("div",{className:"ss-dbg-tabs-scroll",children:[g.map(b=>t("button",{type:"button",className:`ss-dbg-tab ${d===b.id?"ss-dbg-active":""}`,onClick:()=>h(b.id),children:[A[b.id]?t("svg",{className:"ss-dbg-tab-icon",viewBox:A[b.id].viewBox,dangerouslySetInnerHTML:{__html:A[b.id].elements.join("")}}):null,b.label]},b.id)),v.map(b=>t("button",{type:"button",className:`ss-dbg-tab ${d===b.id?"ss-dbg-active":""}`,onClick:()=>h(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($n,{theme:p,onToggle:m,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:A["external-link"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A["external-link"].elements.join("")}})}),t("button",{type:"button",className:"ss-dbg-close",onClick:()=>f(!1),title:"Close panel",children:"×"})]})]}),t("div",{className:"ss-dbg-content",children:a&&k()})]})]})}window.__ssDebugPanel={mount(e,n,r){Ke(t(Dn,{debugEndpoint:n.debugEndpoint,authToken:n.authToken,dashboardPath:n.dashboardPath||void 0,isOpen:!0,isLive:r}),e)},unmount(e){Ke(null,e)}};const jn=3e3,Bn=100,Rn=500;function Fn(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 B(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function yt(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function V(e){if(!e)return"-";const n=typeof e=="string"?new Date(yt(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 R(e){if(!e)return"-";const n=typeof e=="string"?new Date(yt(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 Q(e){return e>Rn?"very-slow":e>Bn?"slow":"normal"}function pe(e,n=100){if(e===null)return"null";if(e===void 0)return"-";if(typeof e=="string")return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"';if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";const s="["+e.slice(0,3).map(l=>pe(l,30)).join(", ")+(e.length>3?", ..."+e.length+" items":"")+"]";return s.length>n?"["+e.length+" items]":s}if(typeof e=="object"){const r=Object.keys(e);if(r.length===0)return"{}";const s=[];for(let i=0;i<Math.min(r.length,4);i++)s.push(r[i]+": "+pe(e[r[i]],30));const l="{ "+s.join(", ")+(r.length>4?", ...+"+(r.length-4):"")+" }";return l.length>n?"{ "+r.slice(0,6).join(", ")+(r.length>6?", ...":"")+" }":l}return String(e)}function Un(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 Hn(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function zn(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 Vn(e){const n={};for(const r of e)n[r.sql]=(n[r.sql]||0)+1;return n}function qn(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,u)=>i+u.duration,0)/e.length:0;return{slowCount:r,dupCount:s,avgDuration:l,totalCount:e.length}}const Wn={queries:"/queries",events:"/events",emails:"/emails",routes:"/routes",logs:"/logs",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config",internals:"/diagnostics"};function Jn(e){return Wn[e]||`/${e}`}class Kn{client;endpoint;refreshInterval;callbacks;timer=null;currentTab=null;fetchOnceCache={};abortController=null;constructor(n){this.client=new Te({baseUrl:n.baseUrl,authToken:n.authToken}),this.endpoint=n.endpoint??"/admin/api/debug",this.refreshInterval=n.refreshInterval??jn,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 he){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)return;if(this.fetchOnceCache[n]!==void 0){this.callbacks.onData(this.fetchOnceCache[n]),this.callbacks.onLoading(!1);return}this.abortController?.abort();const r=new AbortController;this.abortController=r;try{const s=`${this.endpoint}${Jn(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){if(s instanceof DOMException&&s.name==="AbortError"||r.signal.aborted)return;if(s instanceof he){this.callbacks.onError(s),this.callbacks.onLoading(!1),this.stop(),this.callbacks.onUnauthorized(s);return}this.callbacks.onError(s instanceof Error?s:new Error(String(s))),this.callbacks.onLoading(!1)}}}function F(e,n={}){const{baseUrl:r="",debugEndpoint:s="/admin/api/debug",authToken:l}=n,[i,u]=N(null),[o,c]=N(!0),[a,f]=N(null),d=j(null);d.current||(d.current=new Kn({baseUrl:r,endpoint:s,authToken:l,onData:m=>u(m),onLoading:m=>c(m),onError:m=>f(m),onUnauthorized:m=>f(m)})),z(()=>{const m=d.current;return m.start(e),()=>m.stop()},[e]);const h=S(()=>{d.current?.refresh()},[]),_=S(()=>{u(null)},[]),p=S((m,v)=>{d.current?.cacheForTab(m,v)},[]);return{data:i,isLoading:o,error:a,refresh:h,clearData:_,cacheForTab:p}}const Qn="ss-col-resize",wt="ss-resizing";function Nt(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 u=function(c){c.preventDefault(),c.stopPropagation(),l();const a=c.clientX,f=i.offsetWidth;o.classList.add(wt),o.setPointerCapture(c.pointerId);function d(_){const p=_.clientX-a,m=Math.max(30,f+p);i.style.width=m+"px"}function h(){o.classList.remove(wt),o.removeEventListener("pointermove",d),o.removeEventListener("pointerup",h)}o.addEventListener("pointermove",d),o.addEventListener("pointerup",h)};if(!i.textContent?.trim())continue;const o=document.createElement("div");o.className=Qn,i.appendChild(o),o.addEventListener("pointerdown",u),r.push(()=>{o.removeEventListener("pointerdown",u),o.remove()})}return()=>{for(const i of r)i()}}function q(e=[]){const n=j(null),r=j(null);return z(()=>(n.current&&(r.current?.(),r.current=Nt(n.current)),()=>{r.current?.(),r.current=null}),e),S(l=>{r.current?.(),r.current=null,n.current=l,l&&(r.current=Nt(l))},[])}function xt({options:e}){const{data:n,isLoading:r,error:s}=F("queries",e),[l,i]=N(""),[u,o]=N(null),c=T(()=>n?.queries||[],[n]),a=T(()=>zn(c,l),[c,l]),f=T(()=>Vn(c),[c]),d=T(()=>qn(c,f),[c,f]),h=S(p=>{o(m=>m===p?null:p)},[]),_=q([a]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading queries..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter queries...",value:l,onChange:p=>i(p.target.value)}),t("span",{className:"ss-dbg-summary",children:[a.length," queries",d.slowCount>0&&` | ${d.slowCount} slow`,d.dupCount>0&&` | ${d.dupCount} dup`,a.length>0&&` | avg ${B(d.avgDuration)}`]})]}),a.length===0?t("div",{className:"ss-dbg-empty",children:"No queries captured"}):t("table",{ref:_,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"100px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"SQL"}),t("th",{children:"Duration"}),t("th",{children:"Method"}),t("th",{children:"Model"}),t("th",{children:"Time"})]})}),t("tbody",{children:a.map(p=>t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:p.id}),t("td",{children:[t("span",{className:`ss-dbg-sql ${u===p.id?"ss-dbg-expanded":""}`,onClick:()=>h(p.id),role:"button",tabIndex:0,onKeyDown:m=>m.key==="Enter"&&h(p.id),children:p.sql}),f[p.sql]>1&&t("span",{className:"ss-dbg-dup",children:[" x",f[p.sql]]}),p.inTransaction&&t("span",{className:"ss-dbg-dup",children:" TXN"})]}),t("td",{className:`ss-dbg-duration ${Q(p.duration)==="very-slow"?"ss-dbg-very-slow":Q(p.duration)==="slow"?"ss-dbg-slow":""}`,children:B(p.duration)}),t("td",{children:t("span",{className:`ss-dbg-method ss-dbg-method-${p.method.toLowerCase()}`,children:p.method})}),t("td",{className:"ss-dbg-c-muted",children:p.model||"-"}),t("td",{className:"ss-dbg-event-time",title:V(p.timestamp),children:R(p.timestamp)})]},p.id))})]})]})}const Gn=Object.freeze(Object.defineProperty({__proto__:null,QueriesTab:xt,default:xt},Symbol.toStringTag,{value:"Module"}));function _e({data:e,maxPreviewLength:n=100,className:r="",classPrefix:s="ss-dash",defaultExpanded:l=!1}){const[i,u]=N(l),o=T(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),c=T(()=>typeof o=="object"&&o!==null?pe(o,n):String(o??"-"),[o,n]),a=T(()=>typeof o=="object"&&o!==null?JSON.stringify(o,null,2):String(o),[o]),f=S(()=>{u(h=>!h)},[]),d=S(async()=>{try{await navigator.clipboard.writeText(a)}catch{}},[a]);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:f,role:"button",tabIndex:0,onKeyDown:h=>h.key==="Enter"&&f(),children:c}),i&&t("div",{className:`${s}-data-full`,onClick:f,children:[t("button",{className:`${s}-copy-btn`,onClick:h=>{h.stopPropagation(),d()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:a})]})]})}function $t({options:e}){const{data:n,isLoading:r,error:s}=F("events",e),[l,i]=N(""),u=T(()=>{const c=n?.events||[];if(!l)return c;const a=l.toLowerCase();return c.filter(f=>(f.event||"").toLowerCase().includes(a)||(f.data||"").toLowerCase().includes(a))},[n,l]),o=q([u]);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("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter events...",value:l,onChange:c=>i(c.target.value)}),t("span",{className:"ss-dbg-summary",children:[u.length," events"]})]}),u.length===0?t("div",{className:"ss-dbg-empty",children:"No events captured"}):t("table",{ref:o,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:u.map(c=>{const a=c.timestamp||c.created_at||c.createdAt;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:c.id}),t("td",{className:"ss-dbg-event-name",children:c.event}),t("td",{className:"ss-dbg-event-data",children:t(_e,{data:c.data,maxPreviewLength:80,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-event-time",title:V(a),children:R(a)})]},c.id)})})]})]})}const Xn=Object.freeze(Object.defineProperty({__proto__:null,EventsTab:$t,default:$t},Symbol.toStringTag,{value:"Module"}));function kt({options:e}){const{data:n,isLoading:r,error:s}=F("emails",e),[l,i]=N(""),[u,o]=N(null),[c,a]=N(null),[f,d]=N(!1),h=T(()=>{const g=n?.emails||[];if(!l)return g;const x=l.toLowerCase();return g.filter(k=>(k.subject||"").toLowerCase().includes(x)||(k.to||"").toLowerCase().includes(x)||(k.from||"").toLowerCase().includes(x)||(k.mailer||"").toLowerCase().includes(x))},[n,l]),_=T(()=>h.find(g=>g.id===u),[h,u]),p=S(async g=>{if(o(g.id),a(g.html||null),!g.html&&g.id){d(!0);try{const x=e?.debugEndpoint||"/admin/api/debug",k={};e?.authToken&&(k.Authorization=`Bearer ${e.authToken}`);const b=await fetch(`${x}/emails/${g.id}/preview`,{headers:k,credentials:e?.authToken?"omit":"include"});b.ok&&a(await b.text())}catch{}finally{d(!1)}}},[e]),m=S(()=>{o(null),a(null),d(!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"},y=q([h]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading emails..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):_?t("div",{className:"ss-dbg-email-preview",children:[t("div",{className:"ss-dbg-email-preview-header",children:[t("div",{className:"ss-dbg-email-preview-meta",children:[t("div",{children:[t("strong",{children:"Subject:"})," ",_.subject]}),t("div",{children:[t("strong",{children:"From:"})," ",_.from]}),t("div",{children:[t("strong",{children:"To:"})," ",_.to]}),_.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",_.cc]})]}),t("button",{className:"ss-dbg-btn-clear",onClick:m,type:"button",children:"×"})]}),f?t("div",{className:"ss-dbg-empty",children:"Loading preview..."}):c?t("iframe",{className:"ss-dbg-email-iframe",srcDoc:c,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:_.text||"No content"})]}):t("div",{children:[t("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter emails...",value:l,onChange:g=>i(g.target.value)}),t("span",{className:"ss-dbg-summary",children:[h.length," emails"]})]}),h.length===0?t("div",{className:"ss-dbg-empty",children:"No emails captured"}):t("table",{ref:y,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:h.map(g=>t("tr",{className:"ss-dbg-email-row",onClick:()=>p(g),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:g.id}),t("td",{className:"ss-dbg-c-secondary",title:g.from,children:g.from}),t("td",{className:"ss-dbg-c-secondary",title:g.to,children:g.to}),t("td",{className:"ss-dbg-c-sql",children:g.subject}),t("td",{children:t("span",{className:`ss-dbg-email-status ${v[g.status]||""}`,children:g.status})}),t("td",{className:"ss-dbg-c-muted",children:g.mailer}),t("td",{className:"ss-dbg-c-dim",style:{textAlign:"center"},children:g.attachmentCount>0?g.attachmentCount:"-"}),t("td",{className:"ss-dbg-event-time",title:V(g.timestamp||g.created_at||g.createdAt),children:R(g.timestamp||g.created_at||g.createdAt)})]},g.id))})]})]})}const Yn=Object.freeze(Object.defineProperty({__proto__:null,EmailsTab:kt,default:kt},Symbol.toStringTag,{value:"Module"}));function Ct({options:e,currentPath:n}){const{data:r,isLoading:s,error:l}=F("routes",e),[i,u]=N(""),o=T(()=>{const a=r?.routes||[];if(!i)return a;const f=i.toLowerCase();return a.filter(d=>d.pattern.toLowerCase().includes(f)||d.handler.toLowerCase().includes(f)||d.method.toLowerCase().includes(f)||d.name&&d.name.toLowerCase().includes(f))},[r,i]),c=q([o]);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("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter routes...",value:i,onChange:a=>u(a.target.value)}),t("span",{className:"ss-dbg-summary",children:[o.length," routes"]})]}),o.length===0?t("div",{className:"ss-dbg-empty",children:"No routes found"}):t("table",{ref:c,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:o.map((a,f)=>{const d=n&&(a.pattern===n||new RegExp("^"+a.pattern.replace(/:[^/]+/g,"[^/]+")+"$").test(n));return t("tr",{className:d?"ss-dbg-current-route":"",children:[t("td",{children:t("span",{className:`ss-dbg-method ss-dbg-method-${a.method.toLowerCase()}`,children:a.method})}),t("td",{className:"ss-dbg-c-text",children:a.pattern}),t("td",{className:"ss-dbg-c-muted",children:a.name||"-"}),t("td",{className:"ss-dbg-c-sql",children:a.handler}),t("td",{className:"ss-dbg-c-dim",style:{fontSize:"10px"},children:a.middleware.length>0?a.middleware.join(", "):"-"})]},`${a.method}-${a.pattern}-${f}`)})})]})]})}const Zn=Object.freeze(Object.defineProperty({__proto__:null,RoutesTab:Ct,default:Ct},Symbol.toStringTag,{value:"Module"})),er=["all","error","warn","info","debug"];function St(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Tt(e){return e.msg||e.message||JSON.stringify(e)}function tr(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Lt(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 nr(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 rr(e,n){return n==="all"?e:e.filter(r=>{const s=St(r);return n==="error"?s==="error"||s==="fatal":s===n})}const Et=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 sr(e){if(e.data){let r=null;if(typeof e.data=="string")try{r=JSON.parse(e.data)}catch{}else typeof e.data=="object"&&!Array.isArray(e.data)&&(r=e.data);if(r){const s={};for(const[l,i]of Object.entries(r))Et.has(l)||(s[l]=i);if(Object.keys(s).length>0)return s}}const n={};for(const[r,s]of Object.entries(e))Et.has(r)||(n[r]=s);return Object.keys(n).length>0?n:null}function At({options:e}){const{data:n,isLoading:r,error:s}=F("logs",e),[l,i]=N("all"),[u,o]=N(""),[c,a]=N(""),[f,d]=N(null),h=T(()=>{let p=Array.isArray(n)?n:n?.logs||n?.entries||[];if(p=rr(p,l),c){const m=c.toLowerCase();p=p.filter(v=>Lt(v).toLowerCase().includes(m))}if(u){const m=u.toLowerCase();p=p.filter(v=>Tt(v).toLowerCase().includes(m))}return p},[n,l,u,c]),_=S(p=>{a(m=>m===p?"":p)},[]);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:[er.map(p=>t("button",{type:"button",className:`ss-dbg-log-filter ${l===p?"ss-dbg-active":""}`,onClick:()=>i(p),children:p},p)),c&&t("button",{type:"button",className:"ss-dbg-log-filter ss-dbg-active",onClick:()=>a(""),children:["req: ",c.slice(0,8)," x"]}),t("span",{className:"ss-dbg-summary",style:{marginLeft:"auto"},children:[h.length," entries"]})]}),t("div",{className:"ss-dbg-search-bar",children:t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter log messages...",value:u,onChange:p=>o(p.target.value)})}),t("div",{style:{overflow:"auto",flex:1},children:h.length===0?t("div",{className:"ss-dbg-empty",children:"No log entries"}):h.slice(-200).reverse().map((p,m)=>{const v=St(p),y=Tt(p),g=tr(p),x=Lt(p),k=sr(p);return t(pn.Fragment,{children:[t("div",{className:`ss-dbg-log-entry${k?" ss-dbg-log-entry-expandable":""}`,onClick:()=>k&&d(f===m?null:m),children:[t("span",{className:`ss-dbg-log-level ${nr(v)}`,children:v.toUpperCase()}),t("span",{className:"ss-dbg-log-time",title:g?V(g):"",children:g?R(g):"-"}),x?t("span",{className:"ss-dbg-log-reqid",onClick:b=>{b.stopPropagation(),_(x)},role:"button",tabIndex:0,title:x,onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),_(x))},children:x.slice(0,8)}):t("span",{className:"ss-dbg-log-reqid-empty",children:"-"}),k?t("span",{className:`ss-dbg-log-expand-icon${f===m?" ss-dbg-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-dbg-log-msg",children:y})]}),f===m&&k&&t("div",{className:"ss-dbg-log-detail",children:t(_e,{data:k,classPrefix:"ss-dbg",defaultExpanded:!0})})]},m)})})]})}const lr=Object.freeze(Object.defineProperty({__proto__:null,LogsTab:At,default:At},Symbol.toStringTag,{value:"Module"}));function Pt(e="",n){const r=j(null);return S(()=>(r.current||(r.current=new Te({baseUrl:e,authToken:n})),r.current),[e,n])}const Mt={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"#525252"},ir=[{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 Ot({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:u}=F("timeline",e),[o,c]=N(""),[a,f]=N(null),[d,h]=N(null),[_,p]=N(!1),[m,v]=N(null),y=T(()=>{const w=l?.traces||[];if(!o)return w;const P=o.toLowerCase();return w.filter(C=>C.url.toLowerCase().includes(P)||C.method.toLowerCase().includes(P)||String(C.statusCode).includes(P))},[l,o]),g=Pt(n,s);z(()=>{if(a===null){h(null),v(null);return}let w=!1;return p(!0),v(null),g().get(`${r}/traces/${a}`).then(C=>{w||(h(C),p(!1))}).catch(C=>{w||(v(C instanceof Error?C.message:"Failed to load trace"),p(!1))}),()=>{w=!0}},[a,r,g]);const x=S(w=>{f(P=>P===w?null:w)},[]),k=S(w=>w>=500?"ss-dbg-status-5xx":w>=400?"ss-dbg-status-4xx":w>=300?"ss-dbg-status-3xx":"ss-dbg-status-2xx",[]),b=q([y]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading traces..."});if(u)return t("div",{className:"ss-dbg-empty",children:["Error: ",u.message]});if(a!==null){if(_)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});if(m)return t("div",{children:[t("div",{className:"ss-dbg-tl-detail-header",children:t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>f(null),children:"← Back"})}),t("div",{className:"ss-dbg-empty",children:["Error: ",m]})]});if(!d)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});const w=d.spans||[],P=d.warnings||[];return t("div",{children:[t("div",{className:"ss-dbg-tl-detail-header",children:[t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>f(null),children:"← Back"}),t("span",{className:`ss-dbg-method ss-dbg-method-${d.method.toLowerCase()}`,children:d.method}),t("span",{className:"ss-dbg-tl-detail-url",children:d.url}),t("span",{className:`ss-dbg-status ${k(d.statusCode)}`,children:d.statusCode}),t("span",{className:"ss-dbg-tl-meta",children:[B(d.totalDuration)," · ",d.spanCount," spans"]})]}),t("div",{className:"ss-dbg-tl-legend",children:ir.map(C=>t("div",{className:"ss-dbg-tl-legend-item",children:[t("div",{className:"ss-dbg-tl-legend-dot",style:{background:C.color}}),t("span",{children:C.label})]},C.label))}),t("div",{style:{padding:"8px 12px",overflow:"auto"},children:w.length===0?t("div",{className:"ss-dbg-empty",children:"No spans captured for this request"}):w.map(C=>{const M=d.totalDuration||1,W=C.startOffset/M*100,jr=Math.max(C.duration/M*100,.5);return t("div",{className:"ss-dbg-tl-row",children:[t("div",{className:"ss-dbg-tl-label",title:C.label,children:C.label}),t("div",{className:"ss-dbg-tl-track",children:t("div",{className:`ss-dbg-tl-bar ss-dbg-tl-bar-${C.category}`,style:{left:`${W}%`,width:`${jr}%`,background:Mt[C.category]||Mt.custom},title:`${C.label}: ${B(C.duration)}`})}),t("span",{className:"ss-dbg-tl-dur",children:B(C.duration)})]},C.id)})}),P.length>0&&t("div",{className:"ss-dbg-tl-warnings",children:[t("div",{className:"ss-dbg-tl-warnings-title",children:"Warnings"}),P.map((C,M)=>t("div",{className:"ss-dbg-tl-warning",children:C},M))]})]})}return t("div",{children:[t("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter traces...",value:o,onChange:w=>c(w.target.value)}),t("span",{className:"ss-dbg-summary",children:[y.length," traces"]})]}),y.length===0?t("div",{className:"ss-dbg-empty",children:"No traces captured. Enable tracing in config."}):t("table",{ref:b,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:y.map(w=>t("tr",{className:"ss-dbg-email-row",onClick:()=>x(w.id),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:w.id}),t("td",{children:t("span",{className:`ss-dbg-method ss-dbg-method-${w.method.toLowerCase()}`,children:w.method})}),t("td",{title:w.url,children:w.url}),t("td",{children:t("span",{className:`ss-dbg-status ${k(w.statusCode)}`,children:w.statusCode})}),t("td",{className:`ss-dbg-duration ${Q(w.totalDuration)==="very-slow"?"ss-dbg-very-slow":Q(w.totalDuration)==="slow"?"ss-dbg-slow":""}`,children:B(w.totalDuration)}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:w.spanCount}),t("td",{className:"ss-dbg-event-time",title:V(w.timestamp),children:R(w.timestamp)})]},w.id))})]})]})}const ar=Object.freeze(Object.defineProperty({__proto__:null,TimelineTab:Ot,default:Ot},Symbol.toStringTag,{value:"Module"}));function Ae(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 It({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=Ae(n,e),{data:l,isLoading:i,error:u}=F("cache",s),[o,c]=N(""),[a,f]=N(null),[d,h]=N(null),_=T(()=>{const g=l?.keys||[];if(!o)return g;const x=o.toLowerCase();return g.filter(k=>k.key.toLowerCase().includes(x))},[l,o]),p=S(async g=>{if(a===g){f(null),h(null);return}f(g);try{const{baseUrl:x="",authToken:k}=e||{},b=r||e?.debugEndpoint||"/admin/api/debug",w=`${x}${b}/cache/${encodeURIComponent(g)}`,P={Accept:"application/json"};k&&(P.Authorization=`Bearer ${k}`);const M=await(await fetch(w,{headers:P,credentials:k?"omit":"same-origin"})).json();h(M)}catch{h({error:"Failed to fetch key value"})}},[a,e,r]),m=q([_]);if(i&&!l)return t("div",{className:"ss-dbg-empty",children:"Loading cache data..."});if(u)return t("div",{className:"ss-dbg-empty",children:["Error: ",u.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Cache inspector not available"});const y=l.stats||l;return t("div",{children:[t("div",{className:"ss-dbg-cache-stats",children:[t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-dbg-cache-stat-value",children:[y.hitRate!==null&&y.hitRate!==void 0?y.hitRate.toFixed(1):"0","%"]})]}),t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-dbg-cache-stat-value",children:y.totalHits??0})]}),t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-dbg-cache-stat-value",children:y.totalMisses??0})]}),t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-dbg-cache-stat-value",children:y.keyCount??"-"})]})]}),t("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:"Filter keys...",value:o,onChange:g=>c(g.target.value)}),t("span",{className:"ss-dbg-summary",children:[_.length," keys"]})]}),a&&!!d&&t("div",{className:"ss-dbg-cache-detail",children:[t("strong",{children:a}),t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>f(null),children:["←"," Back"]}),t(_e,{data:d,classPrefix:"ss-dbg"})]}),_.length===0?t("div",{className:"ss-dbg-empty",children:"No cache keys found"}):t("table",{ref:m,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:_.map(g=>t("tr",{className:"ss-dbg-email-row",onClick:()=>p(g.key),children:[t("td",{className:"ss-dbg-c-sql",children:g.key}),t("td",{className:"ss-dbg-c-muted",children:g.type}),t("td",{className:"ss-dbg-c-muted",children:g.ttl>0?Un(g.ttl):"-"}),t("td",{className:"ss-dbg-c-dim",children:g.size>0?Hn(g.size):"-"})]},g.key))})]})]})}const or=Object.freeze(Object.defineProperty({__proto__:null,CacheTab:It,default:It},Symbol.toStringTag,{value:"Module"})),cr=["all","active","waiting","delayed","completed","failed"];function dr(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 ur(e){if(!e)return[];if(Array.isArray(e))return e;const n=e;return n.jobs||n.data||[]}function hr(e){if(!e||Array.isArray(e))return null;const n=e;return n.stats||n.overview||null}function Dt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=Ae(n,e),{data:l,isLoading:i,error:u}=F("jobs",s),[o,c]=N("all"),[a,f]=N(null),d=T(()=>{const m=ur(l);return o==="all"?m:m.filter(v=>v.status===o)},[l,o]),h=S(async m=>{f(m);try{const{baseUrl:v="",authToken:y}=e||{},g=r||e?.debugEndpoint||"/admin/api/debug",x=`${v}${g}/jobs/${m}/retry`,k={Accept:"application/json"};y&&(k.Authorization=`Bearer ${y}`),await fetch(x,{method:"POST",headers:k,credentials:y?"omit":"same-origin"})}catch{}f(null)},[e,r]),_=q([d]);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(u)return t("div",{className:"ss-dbg-empty",children:["Error: ",u.message]});if(!l)return t("div",{className:"ss-dbg-empty",children:"Queue inspector not available"});const p=hr(l);return t("div",{children:[t("div",{className:"ss-dbg-job-stats-area",children:[t("div",{className:"ss-dbg-job-stats",children:[t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Active:"}),t("span",{className:"ss-dbg-job-stat-value",children:p?.active??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Waiting:"}),t("span",{className:"ss-dbg-job-stat-value",children:p?.waiting??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Delayed:"}),t("span",{className:"ss-dbg-job-stat-value",children:p?.delayed??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Completed:"}),t("span",{className:"ss-dbg-job-stat-value",children:p?.completed??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Failed:"}),t("span",{className:"ss-dbg-job-stat-value ss-dbg-c-red",children:p?.failed??0})]})]}),t("div",{className:"ss-dbg-log-filters",children:cr.map(m=>t("button",{type:"button",className:`ss-dbg-job-filter ${o===m?"ss-dbg-active":""}`,onClick:()=>c(m),children:m},m))})]}),d.length===0?t("div",{className:"ss-dbg-empty",children:"No jobs found"}):t("table",{ref:_,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:d.map(m=>{const v=m;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",children:m.id}),t("td",{className:"ss-dbg-c-sql",title:m.name,children:m.name}),t("td",{children:t("span",{className:`ss-dbg-badge ${dr(m.status)}`,children:m.status})}),t("td",{children:t(_e,{data:m.payload||m.data,maxPreviewLength:60,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:m.attempts||v.attemptsMade||0}),t("td",{className:"ss-dbg-duration",children:m.duration!==null?B(m.duration):"-"}),t("td",{className:"ss-dbg-event-time",title:V(m.timestamp||m.createdAt||v.processedAt||v.created_at),children:R(m.timestamp||m.createdAt||v.processedAt||v.created_at)}),t("td",{children:m.status==="failed"&&t("button",{type:"button",className:"ss-dbg-retry-btn",onClick:()=>h(m.id),disabled:a===m.id,children:a===m.id?"...":"Retry"})})]},m.id)})})]})]})}const fr=Object.freeze(Object.defineProperty({__proto__:null,JobsTab:Dt,default:Dt},Symbol.toStringTag,{value:"Module"}));function O(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function Pe(e,n=""){if(typeof e!="object"||e===null||e===void 0)return[{path:n,value:e}];if(Array.isArray(e)||O(e))return[{path:n,value:e}];const r=[];for(const s of Object.keys(e)){const l=n?`${n}.${s}`:s,i=e[s];typeof i=="object"&&i!==null&&!Array.isArray(i)&&!O(i)?r.push(...Pe(i,l)):r.push({path:l,value:i})}return r}function Me(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 jt(e){if(e==null||typeof e!="object"||Array.isArray(e)||O(e))return 1;let n=0;for(const r of Object.keys(e))n+=jt(e[r]);return n}function pr(e){if(e==null||typeof e!="object"||Array.isArray(e)||O(e))return[];const n=[];for(const r of Object.keys(e)){const s=e[r];s!==null&&typeof s=="object"&&!Array.isArray(s)&&!O(s)&&n.push(r)}return n}function me(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 ge({redacted:e,p:n}){const[r,s]=N(!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:A["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:A.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A.eye.elements.join("")}})})]})}function _r({env:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=Object.entries(e).filter(([u,o])=>{if(!l)return!0;const c=O(o)?o.display:o==null?"":String(o);return u.toLowerCase().includes(l)||c.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(([u,o])=>{const c=O(o),a=c?o.display:o==null?"null":String(o),f=`${u}=${a}`;return t("tr",{children:[t("td",{className:`${r}-env-key`,children:t("span",{className:`${r}-config-key`,children:u})}),t("td",{className:`${r}-env-val`,children:c?t(ge,{redacted:o,p:r}):t("span",{className:`${r}-config-val`,children:a})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:d=>{s.current.set(u,d)},onClick:d=>{d.stopPropagation(),me(f,s.current.get(u)??null,r)},children:"⎘"})})]},u)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function mr({source:e,search:n,p:r}){const s=j(new Map),l=n.toLowerCase(),i=Pe(e,""),u=i.filter(o=>{const c=O(o.value)?o.value.display:o.value===null||o.value===void 0?"":String(o.value);return o.path.toLowerCase().includes(l)||c.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:[u.map(o=>{const c=O(o.value),a=c?null:Me(o.value),f=c?o.value.display:a.text,d=`${o.path}: ${f}`;return t("tr",{children:[t("td",{children:t("span",{className:`${r}-config-key`,style:{whiteSpace:"nowrap"},children:o.path})}),t("td",{children:c?t(ge,{redacted:o.value,p:r}):t("span",{className:`${r}-config-val`,style:{wordBreak:"break-all",color:a.color},children:a.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:h=>{s.current.set(o.path,h)},onClick:h=>{h.stopPropagation(),me(d,s.current.get(o.path)??null,r)},children:"⎘"})})]},o.path)}),u.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:[u.length," of ",i.length," entries"]})]})}function gr({obj:e,prefix:n,p:r}){const s=j(new Map),l=Pe(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 u=i.path.indexOf(n+".")===0?i.path.slice(n.length+1):i.path,o=O(i.value),c=o?null:Me(i.value),a=o?i.value.display:c.text,f=`${i.path}: ${a}`;return t("tr",{children:[t("td",{title:u,children:t("span",{className:`${r}-config-key`,children:u})}),t("td",{title:a,children:o?t(ge,{redacted:i.value,p:r}):t("span",{className:`${r}-config-val`,style:{color:c.color},children:c.text})}),t("td",{children:!o&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:d=>{s.current.set(i.path,d)},onClick:d=>{d.stopPropagation(),me(f,s.current.get(i.path)??null,r)},children:"⎘"})})]},i.path)})})]})}function br({value:e,p:n}){if(e==null)return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(O(e))return t(ge,{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 vr({obj:e,expandedPaths:n,onToggle:r,p:s}){if(e==null||typeof e!="object"||Array.isArray(e)||O(e))return null;const l=Object.keys(e),i=j(new Map);return t("div",{className:`${s}-config-sections`,children:l.map(u=>{const o=e[u],c=o!==null&&typeof o=="object"&&!Array.isArray(o)&&!O(o),a=n.has(u),f=O(o);return t("div",{className:`${s}-config-section`,children:[t("div",{className:`${s}-config-section-header${c?"":` ${s}-config-leaf`}`,onClick:c?()=>r(u):void 0,style:{cursor:c?"pointer":"default"},children:[c?t("span",{className:`${s}-config-toggle`,children:a?"▼":"▶"}):t("span",{className:`${s}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${s}-config-key`,children:u}),c?t("span",{className:`${s}-config-count`,children:[jt(o)," entries"]}):t(I,{children:[t("span",{className:`${s}-config-val`,style:{marginLeft:"8px"},children:t(br,{value:o,p:s})}),!f&&t("button",{type:"button",className:`${s}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:d=>{i.current.set(u,d)},onClick:d=>{d.stopPropagation();const h=Me(o);me(`${u}: ${h.text}`,i.current.get(u)??null,s)},children:"⎘"})]})]}),c&&a&&t("div",{className:`${s}-config-section-body`,children:t(gr,{obj:o,prefix:u,p:s})})]},u)})})}function yr({data:e,isLoading:n,classPrefix:r}){const s=r,[l,i]=N(""),[u,o]=N(""),[c,a]=N("app"),[f,d]=N(new Set),[h,_]=N("Copy JSON");z(()=>{const x=setTimeout(()=>o(l),200);return()=>clearTimeout(x)},[l]);const p=e,m=S(x=>{d(k=>{const b=new Set(k);return b.has(x)?b.delete(x):b.add(x),b})},[]),v=S(()=>{if(!p)return;const x=c==="app"?p.app:p.env;if(!x)return;const k=pr(x);d(new Set(k))},[p,c]),y=S(()=>{d(new Set)},[]),g=S(async()=>{if(p)try{const x=c==="app"?p.app:p.env;await navigator.clipboard.writeText(JSON.stringify(x,null,2)),_("Copied!"),setTimeout(()=>_("Copy JSON"),1500)}catch{}},[p,c]);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${c==="app"?` ${s}-active`:""}`,onClick:()=>a("app"),children:"App Config"}),t("button",{type:"button",className:`${s}-config-tab${c==="env"?` ${s}-active`:""}`,onClick:()=>a("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:x=>i(x.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:"×"})]}),c==="app"&&!u&&t(I,{children:[t("button",{type:"button",className:`${s}-btn`,onClick:v,children:"Expand All"}),t("button",{type:"button",className:`${s}-btn`,onClick:y,children:"Collapse All"})]}),t("button",{type:"button",className:`${s}-btn`,onClick:g,children:h})]}),n&&!e?t("div",{className:`${s}-empty`,children:"Loading config..."}):p?c==="env"?t(_r,{env:p.env??{},search:u,p:s}):u?t(mr,{source:p.app??{},search:u,p:s}):t("div",{className:`${s}-config-table-wrap`,children:t(vr,{obj:p.app,expandedPaths:f,onToggle:m,p:s})}):t("div",{className:`${s}-empty`,children:"Config not available"})]})}function Bt({options:e,dashboardPath:n}){const{resolvedOptions:r}=Ae(n,e),{data:s,isLoading:l,error:i}=F("config",r);return i?t("div",{className:"ss-dbg-empty",children:["Error: ",i.message]}):t(yr,{data:s,isLoading:l,classPrefix:"ss-dbg"})}const wr=Object.freeze(Object.defineProperty({__proto__:null,ConfigTab:Bt,default:Bt},Symbol.toStringTag,{value:"Module"})),Nr=["password","secret","token","key","credential","auth"];function Rt(e){const n=e.toLowerCase();return Nr.some(r=>n.includes(r))}function Ft(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 xr={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function $r(e){return xr[e]||e}const kr={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function Cr(e){return kr[e]||e}const Sr=["healthy","active","connected","available","ready"],Tr=["errored","unavailable"];function Lr(e){return Sr.includes(e)?"ok":Tr.includes(e)?"err":""}function ee({status:e,prefix:n}){const r=Lr(e);let s=`${n}-dot`;return r==="ok"?s+=` ${n}-dot-ok`:r==="err"&&(s+=` ${n}-dot-err`),t("span",{className:s})}const Ut=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:A.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A.eye.elements.join("")}}),Ht=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:A["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:A["eye-off"].elements.join("")}});function Er({value:e}){const[n,r]=N(!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(Ht,{}):t(Ut,{})})]})}function Ar({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 Pr({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}),"=",Rt(s)&&typeof l=="string"?t(Er,{value:l}):t("span",{children:Ft(l)})]},s))})}function te({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 Mr({data:e,tableClassName:n,classPrefix:r}){const s=r||"ss-dash",[l,i]=N(new Set),u=S(c=>{i(a=>{const f=new Set(a);return f.has(c)?f.delete(c):f.add(c),f})},[]),o=S((c,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 f=Ft(a);if(Rt(c)){const d=l.has(c);return t("span",{children:[d?f:"••••••••"," ",t("button",{type:"button",onClick:()=>u(c),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:d?t(Ht,{}):t(Ut,{})})]})}return t("span",{children:f})},[l,u,s]);return t("div",{children:[t("h3",{className:`${s}-internals-title`,children:"Package Info"}),t("div",{className:`${s}-info-cards`,children:[t(te,{label:"Version",value:e.package.version||"-",prefix:s}),t(te,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:s}),t(te,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:s}),t(te,{label:"Uptime",value:Fn(e.package.uptime),prefix:s}),t(te,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:s})]}),e.collectors.length>0&&t(I,{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(c=>t("tr",{children:[t("td",{children:[t("code",{children:c.name}),c.label&&c.label!==c.name&&t("span",{className:`${s}-c-dim`,children:[" ",c.label]})]}),t("td",{children:[t(ee,{status:c.status,prefix:s}),c.status]}),t("td",{className:c.lastError?`${s}-c-red`:`${s}-c-dim`,children:c.lastError?t(I,{children:[c.lastError,c.lastErrorAt&&t("span",{className:`${s}-c-dim`,style:{fontSize:"10px"},children:R(c.lastErrorAt)})]}):"-"}),t("td",{children:t(Pr,{config:c.config,prefix:s})})]},c.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(([c,a])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:c}),t("td",{children:[a.current.toLocaleString()," / ",a.max.toLocaleString()]}),t("td",{children:t(Ar,{current:a.current,max:a.max,prefix:s})})]},c))})]}),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(([c,a])=>t("tr",{children:[t("td",{children:$r(c)}),t("td",{children:[t(ee,{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?B(a.intervalMs):a.debounceMs?`${B(a.debounceMs)} (debounce)`:"-":t("span",{className:`${s}-c-dim`,children:"—"})})]},c))})]}),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(ee,{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(([c,a])=>{const f=a.active??a.available??!1,d=a.active?"active":a.available?"available":"unavailable";let h=a.mode?`Mode: ${a.mode}`:"-";return c==="edgePlugin"&&a.active?h="@serverStats() tag registered":c==="cacheInspector"&&a.available?h="Redis dependency detected":c==="queueInspector"&&a.available&&(h="Queue dependency detected"),t("tr",{children:[t("td",{children:Cr(c)}),t("td",{children:[t(ee,{status:f?"active":"inactive",prefix:s}),d]}),t("td",{className:`${s}-c-dim`,style:{fontSize:"11px"},children:h})]},c)})]})]}),e.storage&&t(I,{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(ee,{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?R(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(c=>t("tr",{children:[t("td",{children:t("code",{children:c.name})}),t("td",{children:c.rowCount.toLocaleString()})]},c.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:o("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(([c,a])=>t("tr",{children:[t("td",{children:c==="customPaneCount"?"customPanes":c}),t("td",{children:c==="customPaneCount"?`${a} registered`:o(c,a)})]},c))})]})]})}const Or=3e3;function zt({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},[l,i]=N(null),[u,o]=N(!0),[c,a]=N(null),f=j(null),d=Pt(n,s),h=S(async()=>{try{const p=await d().get(`${r}/diagnostics`);i(p),a(null),o(!1)}catch(_){if(_ instanceof he){a(_),o(!1),f.current&&(clearInterval(f.current),f.current=null);return}a(_ instanceof Error?_:new Error(String(_))),o(!1)}},[r,d]);return z(()=>(o(!0),a(null),h(),f.current=setInterval(h,Or),()=>{f.current&&(clearInterval(f.current),f.current=null)}),[h]),u&&!l?t("div",{className:"ss-dbg-empty",children:"Loading diagnostics..."}):c?t("div",{className:"ss-dbg-empty",children:["Error: ",c.message]}):l?t(Mr,{data:l,tableClassName:"ss-dbg-table",classPrefix:"ss-dbg"}):t("div",{className:"ss-dbg-empty",children:"Diagnostics not available"})}const Ir=Object.freeze(Object.defineProperty({__proto__:null,InternalsTab:zt,default:zt},Symbol.toStringTag,{value:"Module"}));function Vt({pane:e,options:n}){({...n});const{data:r,isLoading:s,error:l,clearData:i}=F(e.endpoint.replace(/^\//,""),{...n,debugEndpoint:""}),[u,o]=N(""),c=T(()=>{if(!r)return[];const h=e.dataKey||e.id;let _=r;for(const p of h.split("."))_=_?.[p];return Array.isArray(_)?_:[]},[r,e.dataKey,e.id]),a=T(()=>{if(!u)return c;const h=u.toLowerCase(),_=e.columns.filter(p=>p.searchable).map(p=>p.key);return _.length===0?c:c.filter(p=>_.some(m=>{const v=p[m];return v!==null&&String(v).toLowerCase().includes(h)}))},[c,u,e.columns]),f=(h,_)=>{if(h==null)return t("span",{className:"ss-dbg-c-dim",children:"-"});switch(_.format||"text"){case"time":return t("span",{className:"ss-dbg-event-time",title:V(h),children:typeof h=="number"?R(h):String(h)});case"timeAgo":return t("span",{className:"ss-dbg-event-time",title:V(h),children:R(h)});case"duration":{const m=typeof h=="number"?h:parseFloat(String(h));return isNaN(m)?String(h):t("span",{className:`ss-dbg-duration ${Q(m)==="very-slow"?"ss-dbg-very-slow":Q(m)==="slow"?"ss-dbg-slow":""}`,children:B(m)})}case"method":return t("span",{className:`ss-dbg-method ss-dbg-method-${String(h).toLowerCase()}`,children:String(h)});case"json":{let m=h;if(typeof h=="string")try{m=JSON.parse(h)}catch{}return pe(m,80)}case"badge":{const m=String(h).toLowerCase(),y=(_.badgeColorMap||{})[m]||"muted";return t("span",{className:`ss-dbg-badge ss-dbg-badge-${y}`,children:String(h)})}default:return String(h)}},d=q([a]);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("div",{className:"ss-dbg-search-bar",children:[t("input",{type:"text",className:"ss-dbg-search",placeholder:e.search.placeholder,value:u,onChange:h=>o(h.target.value)}),t("span",{className:"ss-dbg-summary",children:[a.length," items"]}),e.clearable&&t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:i,children:"Clear"})]}),a.length===0?t("div",{className:"ss-dbg-empty",children:"No data"}):t("table",{ref:d,className:"ss-dbg-table",children:[t("thead",{children:t("tr",{children:e.columns.map(h=>t("th",{children:h.label},h.key))})}),t("tbody",{children:a.map((h,_)=>t("tr",{children:e.columns.map(p=>t("td",{children:f(h[p.key],p)},p.key))},h.id??_))})]})]})}const Dr=Object.freeze(Object.defineProperty({__proto__:null,CustomPaneTab:Vt,default:Vt},Symbol.toStringTag,{value:"Module"}))})();
|
|
1
|
+
(function(){"use strict";var le,C,He,Q,Ue,ze,Ve,qe,Ne,xe,$e,ie={},ae=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,X=Array.isArray;function z(e,n){for(var r in n)e[r]=n[r];return e}function Ce(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??++He,__i:-1,__u:0};return l==null&&C.vnode!=null&&C.vnode(i),i}function O(e){return e.children}function V(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 en(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,s=[],l=[],i=z({},n);i.__v=n.__v+1,C.vnode&&C.vnode(i),ke(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,Xe(s,i,l),n.__e=n.__=null,i.__e!=r&&We(i)}}function We(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}),We(e)}function Je(e){(!e.__d&&(e.__d=!0)&&Q.push(e)&&!de.__r++||Ue!=C.debounceRendering)&&((Ue=C.debounceRendering)||ze)(de)}function de(){for(var e,n=1;Q.length;)Q.length>n&&Q.sort(Ve),e=Q.shift(),n=Q.length,en(e);de.__r=0}function Ke(e,n,r,s,l,i,o,d,c,a,h){var u,f,p,_,b,y,m,g=s&&s.__k||ae,w=n.length;for(c=tn(r,n,g,c,w),u=0;u<w;u++)(p=r.__k[u])!=null&&(f=p.__i!=-1&&g[p.__i]||ie,p.__i=u,y=ke(e,p,f,l,i,o,d,c,a,h),_=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Te(f.ref,null,p),h.push(p.ref,p.__c||_,p)),b==null&&_!=null&&(b=_),(m=!!(4&p.__u))||f.__k===p.__k?c=Qe(p,c,e,m):typeof p.type=="function"&&y!==void 0?c=y:_&&(c=_.nextSibling),p.__u&=-7);return r.__e=b,c}function tn(e,n,r,s,l){var i,o,d,c,a,h=r.length,u=h,f=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):X(o)?o=e.__k[i]=ce(O,{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,c=i+f,o.__=e,o.__b=e.__b+1,d=null,(a=o.__i=nn(o,r,c,u))!=-1&&(u--,(d=r[a])&&(d.__u|=2)),d==null||d.__v==null?(a==-1&&(l>h?f--:l<h&&f++),typeof o.type!="function"&&(o.__u|=4)):a!=c&&(a==c-1?f--:a==c+1?f++:(a>c?f--:f++,o.__u|=4))):e.__k[i]=null;if(u)for(i=0;i<h;i++)(d=r[i])!=null&&(2&d.__u)==0&&(d.__e==s&&(s=G(d)),et(d,d));return s}function Qe(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=Qe(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"||(X(e)?e.some(function(r){ue(r,n)}):n.push(e)),n}function nn(e,n,r,s){var l,i,o,d=e.key,c=e.type,a=n[r],h=a!=null&&(2&a.__u)==0;if(a===null&&d==null||h&&d==a.key&&c==a.type)return r;if(s>(h?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((a=n[o=l>=0?l--:i++])!=null&&(2&a.__u)==0&&d==a.key&&c==a.type)return o}return-1}function Ge(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Zt.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||Ge(e.style,n,"");if(r)for(n in r)s&&r[n]==s[n]||Ge(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")i=n!=(n=n.replace(qe,"$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=Ne,e.addEventListener(n,i?$e:xe,i)):e.removeEventListener(n,i?$e:xe,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 Ye(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=Ne++;else if(n.t<r.u)return;return r(C.event?C.event(n):n)}}}function ke(e,n,r,s,l,i,o,d,c,a){var h,u,f,p,_,b,y,m,g,w,$,v,N,A,M,D=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[d=n.__e=r.__e]),(h=C.__b)&&h(n);e:if(typeof D=="function")try{if(m=n.props,g="prototype"in D&&D.prototype.render,w=(h=D.contextType)&&s[h.__c],$=h?w?w.props.value:h.__:s,r.__c?y=(u=n.__c=r.__c).__=u.__E:(g?n.__c=u=new D(m,$):(n.__c=u=new V(m,$),u.constructor=D,u.render=sn),w&&w.sub(u),u.state||(u.state={}),u.__n=s,f=u.__d=!0,u.__h=[],u._sb=[]),g&&u.__s==null&&(u.__s=u.state),g&&D.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=z({},u.__s)),z(u.__s,D.getDerivedStateFromProps(m,u.__s))),p=u.props,_=u.state,u.__v=n,f)g&&D.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),g&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(g&&D.getDerivedStateFromProps==null&&m!==p&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(m,$),n.__v==r.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(m,u.__s,$)===!1){n.__v!=r.__v&&(u.props=m,u.state=u.__s,u.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(J){J&&(J.__=n)}),ae.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(m,u.__s,$),g&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(p,_,b)})}if(u.context=$,u.props=m,u.__P=e,u.__e=!1,v=C.__r,N=0,g)u.state=u.__s,u.__d=!1,v&&v(n),h=u.render(u.props,u.state,u.context),ae.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,v&&v(n),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++N<25);u.state=u.__s,u.getChildContext!=null&&(s=z(z({},s),u.getChildContext())),g&&!f&&u.getSnapshotBeforeUpdate!=null&&(b=u.getSnapshotBeforeUpdate(p,_)),A=h!=null&&h.type===O&&h.key==null?Ze(h.props.children):h,d=Ke(e,X(A)?A:[A],n,r,s,l,i,o,d,c,a),u.base=n.__e,n.__u&=-161,u.__h.length&&o.push(u),y&&(u.__E=u.__=null)}catch(J){if(n.__v=null,c||i!=null)if(J.then){for(n.__u|=c?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;i[i.indexOf(d)]=null,n.__e=d}else{for(M=i.length;M--;)Ce(i[M]);Se(n)}else n.__e=r.__e,n.__k=r.__k,J.then||Se(n);C.__e(J,n,r)}else i==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):d=n.__e=rn(r.__e,n,r,s,l,i,o,c,a);return(h=C.diffed)&&h(n),128&n.__u?void 0:d}function Se(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Se))}function Xe(e,n,r){for(var s=0;s<r.length;s++)Te(r[s],r[++s],r[++s]);C.__c&&C.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(i){i.call(l)})}catch(i){C.__e(i,l.__v)}})}function Ze(e){return typeof e!="object"||e==null||e.__b>0?e:X(e)?e.map(Ze):z({},e)}function rn(e,n,r,s,l,i,o,d,c){var a,h,u,f,p,_,b,y=r.props||ie,m=n.props,g=n.type;if(g=="svg"?l="http://www.w3.org/2000/svg":g=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((p=i[a])&&"setAttribute"in p==!!g&&(g?p.localName==g:p.nodeType==3)){e=p,i[a]=null;break}}if(e==null){if(g==null)return document.createTextNode(m);e=document.createElementNS(l,g,m.is&&m),d&&(C.__m&&C.__m(n,i),d=!1),i=null}if(g==null)y===m||d&&e.data==m||(e.data=m);else{if(i=i&&le.call(e.childNodes),!d&&i!=null)for(y={},a=0;a<e.attributes.length;a++)y[(p=e.attributes[a]).name]=p.value;for(a in y)p=y[a],a=="dangerouslySetInnerHTML"?u=p:a=="children"||a in m||a=="value"&&"defaultValue"in m||a=="checked"&&"defaultChecked"in m||he(e,a,null,p,l);for(a in m)p=m[a],a=="children"?f=p:a=="dangerouslySetInnerHTML"?h=p:a=="value"?_=p:a=="checked"?b=p:d&&typeof p!="function"||y[a]===p||he(e,a,p,y[a],l);if(h)d||u&&(h.__html==u.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(u&&(e.innerHTML=""),Ke(n.type=="template"?e.content:e,X(f)?f:[f],n,r,s,g=="foreignObject"?"http://www.w3.org/1999/xhtml":l,i,o,i?i[0]:r.__k&&G(r,0),d,c),i!=null)for(a=i.length;a--;)Ce(i[a]);d||(a="value",g=="progress"&&_==null?e.removeAttribute("value"):_!=null&&(_!==e[a]||g=="progress"&&!_||g=="option"&&_!=y[a])&&he(e,a,_,y[a],l),a="checked",b!=null&&b!=e[a]&&he(e,a,b,y[a],l))}return e}function Te(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){C.__e(l,r)}}function et(e,n,r){var s,l;if(C.unmount&&C.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||Te(s,null,n)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){C.__e(i,n)}s.base=s.__P=null}if(s=e.__k)for(l=0;l<s.length;l++)s[l]&&et(s[l],n,r||typeof e.type!="function");r||Ce(e.__e),e.__c=e.__=e.__e=void 0}function sn(e,n,r){return this.constructor(e,r)}function tt(e,n,r){var s,l,i,o;n==document&&(n=document.documentElement),C.__&&C.__(e,n),l=(s=!1)?null:n.__k,i=[],o=[],ke(n,e=n.__k=oe(O,null,[e]),l||ie,ie,n.namespaceURI,l?null:n.firstChild?le.call(n.childNodes):null,i,l?l.__e:n.firstChild,s,o),Xe(i,e,o)}le=ae.slice,C={__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(d){e=d}throw e}},He=0,V.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),Je(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Je(this))},V.prototype.render=O,Q=[],ze=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ve=function(e,n){return e.__v.__b-n.__v.__b},de.__r=0,qe=/(PointerCapture)$|Capture$/i,Ne=0,xe=Ye(!1),$e=Ye(!0);var ln=0;function t(e,n,r,s,l,i){n||(n={});var o,d,c=n;if("ref"in c)for(d in c={},n)d=="ref"?o=n[d]:c[d]=n[d];var a={type:e,props:c,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ln,__i:-1,__u:0,__source:l,__self:i};if(typeof e=="function"&&(o=e.defaultProps))for(d in o)c[d]===void 0&&(c[d]=o[d]);return C.vnode&&C.vnode(a),a}var Z,T,Le,nt,ee=0,rt=[],E=C,st=E.__b,lt=E.__r,it=E.diffed,at=E.__c,ot=E.unmount,ct=E.__;function Ee(e,n){E.__h&&E.__h(T,e,ee||n),ee=0;var r=T.__H||(T.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function x(e){return ee=1,an(ht,e)}function an(e,n,r){var s=Ee(Z++,2);if(s.t=e,!s.__c&&(s.__=[r?r(n):ht(void 0,n),function(d){var c=s.__N?s.__N[0]:s.__[0],a=s.t(c,d);c!==a&&(s.__N=[a,s.__[1]],s.__c.setState({}))}],s.__c=T,!T.__f)){var l=function(d,c,a){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(f){return f.__c});if(h.every(function(f){return!f.__N}))return!i||i.call(this,d,c,a);var u=s.__c.props!==d;return h.some(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(u=!0)}}),i&&i.call(this,d,c,a)||u};T.__f=!0;var i=T.shouldComponentUpdate,o=T.componentWillUpdate;T.componentWillUpdate=function(d,c,a){if(this.__e){var h=i;i=void 0,l(d,c,a),i=h}o&&o.call(this,d,c,a)},T.shouldComponentUpdate=l}return s.__N||s.__}function F(e,n){var r=Ee(Z++,3);!E.__s&&ut(r.__H,n)&&(r.__=e,r.u=n,T.__H.__h.push(r))}function I(e){return ee=5,S(function(){return{current:e}},[])}function S(e,n){var r=Ee(Z++,7);return ut(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function k(e,n){return ee=8,S(function(){return e},n)}function on(){for(var e;e=rt.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(fe),n.__h.some(Ae),n.__h=[]}catch(r){n.__h=[],E.__e(r,e.__v)}}}E.__b=function(e){T=null,st&&st(e)},E.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ct&&ct(e,n)},E.__r=function(e){lt&<(e),Z=0;var n=(T=e.__c).__H;n&&(Le===T?(n.__h=[],T.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.some(fe),n.__h.some(Ae),n.__h=[],Z=0)),Le=T},E.diffed=function(e){it&&it(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(rt.push(n)!==1&&nt===E.requestAnimationFrame||((nt=E.requestAnimationFrame)||cn)(on)),n.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Le=T=null},E.__c=function(e,n){n.some(function(r){try{r.__h.some(fe),r.__h=r.__h.filter(function(s){return!s.__||Ae(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],E.__e(s,r.__v)}}),at&&at(e,n)},E.unmount=function(e){ot&&ot(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&&E.__e(n,r.__v))};var dt=typeof requestAnimationFrame=="function";function cn(e){var n,r=function(){clearTimeout(s),dt&&cancelAnimationFrame(n),setTimeout(e)},s=setTimeout(r,35);dt&&(n=requestAnimationFrame(r))}function fe(e){var n=T,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),T=n}function Ae(e){var n=T;e.__c=e.__(),T=n}function ut(e,n){return!e||e.length!==n.length||n.some(function(r,s){return r!==e[s]})}function ht(e,n){return typeof n=="function"?n(e):n}function dn(e,n){for(var r in n)e[r]=n[r];return e}function ft(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 pt(e,n){this.props=e,this.context=n}(pt.prototype=new V).isPureReactComponent=!0,pt.prototype.shouldComponentUpdate=function(e,n){return ft(this.props,e)||ft(this.state,n)};var _t=C.__b;C.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),_t&&_t(e)};var un=C.__e;C.__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)}un(e,n,r,s)};var gt=C.unmount;function mt(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=dn({},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 mt(s,n,r)})),e}function bt(e,n,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return bt(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 te(){this.__u=0,this.o=null,this.__b=null}function vt(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function R(e){var n,r,s,l=null;function i(o){if(n||(n=e()).then(function(d){d&&(l=d.default||d),s=!0},function(d){r=d,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}C.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),gt&>(e)},(te.prototype=new V).__c=function(e,n){var r=n.__c,s=this;s.o==null&&(s.o=[]),s.o.push(r);var l=vt(s.__v),i=!1,o=function(){i||s.__z||(i=!0,r.__R=null,l?l(c):c())};r.__R=o;var d=r.__P;r.__P=null;var c=function(){if(!--s.__u){if(s.state.__a){var a=s.state.__a;s.__v.__k[0]=bt(a,a.__c.__P,a.__c.__O)}var h;for(s.setState({__a:s.__b=null});h=s.o.pop();)h.__P=d,h.forceUpdate()}};s.__u++||32&n.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(o,o)},te.prototype.componentWillUnmount=function(){this.o=[]},te.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]=mt(this.__b,r,s.__O=s.__P)}this.__b=null}var l=n.__a&&oe(O,null,e.fallback);return l&&(l.__u&=-33),[oe(O,null,n.__a?null:e.children),l]};var yt=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 V).__a=function(e){var n=this,r=vt(n.__v),s=n.l.get(e);return s[0]++,function(l){var i=function(){n.props.revealOrder?(s.push(l),yt(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){yt(e,r,n)})};var hn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,fn=/^(?: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]/,pn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,_n=/[A-Z0-9]/g,gn=typeof document<"u",mn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};V.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var wt=C.event;function bn(){}function vn(){return this.cancelBubble}function yn(){return this.defaultPrevented}C.event=function(e){return wt&&(e=wt(e)),e.persist=bn,e.isPropagationStopped=vn,e.isDefaultPrevented=yn,e.nativeEvent=e};var wn={enumerable:!1,configurable:!0,get:function(){return this.class}},Nt=C.vnode;C.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 d=r[o];if(!(o==="value"&&"defaultValue"in r&&d==null||gn&&o==="children"&&s==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&d===!0?d="":c==="translate"&&d==="no"?d=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?o="ondblclick":c!=="onchange"||s!=="input"&&s!=="textarea"||mn(r.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":pn.test(o)&&(o=c):c=o="oninput":i&&fn.test(o)?o=o.replace(_n,"-$&").toLowerCase():d===null&&(d=void 0),c==="oninput"&&l[o=c]&&(o="oninputCapture"),l[o]=d}}s=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=ue(r.children).forEach(function(a){a.props.selected=l.value.indexOf(a.props.value)!=-1})),s=="select"&&l.defaultValue!=null&&(l.value=ue(r.children).forEach(function(a){a.props.selected=l.multiple?l.defaultValue.indexOf(a.props.value)!=-1:l.defaultValue==a.props.value})),r.class&&!r.className?(l.class=r.class,Object.defineProperty(l,"className",wn)):r.className&&(l.class=l.className=r.className),n.props=l})(e),e.$$typeof=hn,Nt&&Nt(e)};var xt=C.__r;C.__r=function(e){xt&&xt(e),e.__c};var $t=C.diffed;C.diffed=function(e){$t&&$t(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 Ct={Fragment:O};const L={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 _e extends Error{status;constructor(n=403){super(`Unauthorized (HTTP ${n})`),this.name="UnauthorizedError",this.status=n}}class Nn extends Error{status;body;constructor(n,r){super(`API error (HTTP ${n})`),this.name="ApiError",this.status=n,this.body=r}}class Me{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 _e(i.status);if(!i.ok){const o=await i.text().catch(()=>"");throw new Nn(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 xn=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],kt="/admin/api/debug",St={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 $n(e){const n={customPanes:e.customPanes??[]},r=e.features;for(const s of xn)n[s]=r?.[s]??!1;return n}async function Cn(e,n=kt){const r=`${n.replace(/\/+$/,"")}/config`;return e.fetch(r)}async function kn(e){const{baseUrl:n="",debugEndpoint:r=kt,authToken:s}=e,l=new Me({baseUrl:n,authToken:s});try{const i=await Cn(l,r);return $n(i)}catch{return St}}function Sn(e={}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e,[l,i]=x(St),[o,d]=x(!0),[c,a]=x(null),h=I(!1);return F(()=>{if(h.current)return;h.current=!0;let u=!1;return(async()=>{try{const p=await kn({baseUrl:n,debugEndpoint:r,authToken:s});u||(i(p),d(!1))}catch(p){u||(a(p instanceof Error?p:new Error(String(p))),d(!1))}})(),()=>{u=!0}},[n,r,s]),{features:l,isLoading:o,error:c}}const ge="ss-dash-theme",Pe="ss-theme-change";function Oe(){if(typeof window>"u")return"light";const e=localStorage.getItem(ge);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Tn(e){typeof window>"u"||(localStorage.setItem(ge,e),window.dispatchEvent(new CustomEvent(Pe,{detail:e})))}function Ln(){const n=Oe()==="dark"?"light":"dark";return Tn(n),n}function En(e){if(typeof window>"u")return()=>{};const n=i=>{const o=i.detail;(o==="dark"||o==="light")&&e(o)},r=i=>{if(i.key===ge){const o=i.newValue;e(o==="dark"||o==="light"?o:Oe())}},s=window.matchMedia("(prefers-color-scheme: dark)"),l=i=>{localStorage.getItem(ge)||e(i.matches?"dark":"light")};return window.addEventListener(Pe,n),window.addEventListener("storage",r),s.addEventListener("change",l),()=>{window.removeEventListener(Pe,n),window.removeEventListener("storage",r),s.removeEventListener("change",l)}}function An(){const[e,n]=x(()=>Oe());F(()=>En(l=>{n(l)}),[]);const r=k(()=>{const s=Ln();return n(s),s},[]);return{theme:e,toggleTheme:r}}function Mn({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:L.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:L.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L.moon.elements.join("")}})})}const Pn=R(()=>Promise.resolve().then(()=>ar)),On=R(()=>Promise.resolve().then(()=>or)),In=R(()=>Promise.resolve().then(()=>cr)),Dn=R(()=>Promise.resolve().then(()=>dr)),Rn=R(()=>Promise.resolve().then(()=>_r)),jn=R(()=>Promise.resolve().then(()=>yr)),Bn=R(()=>Promise.resolve().then(()=>wr)),Fn=R(()=>Promise.resolve().then(()=>kr)),Hn=R(()=>Promise.resolve().then(()=>Or)),Un=R(()=>Promise.resolve().then(()=>Kr)),zn=R(()=>Promise.resolve().then(()=>Qr));function Vn(e){const{defaultOpen:n=!1,dashboardPath:r,isOpen:s,onOpenChange:l,isLive:i=!1,...o}=e,[d,c]=x(n),a=s!==void 0?s:d,h=v=>{l?l(v):c(v)},[u,f]=x("queries"),{features:p}=Sn(o),{theme:_,toggleTheme:b}=An(),y=p.customPanes||[];F(()=>{const v=N=>{N.key==="Escape"&&a&&h(!1)};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[a]);const m=S(()=>[{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:p.tracing},{id:"cache",label:"Cache",visible:p.cache},{id:"jobs",label:"Jobs",visible:p.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[p]),g=S(()=>m.filter(v=>v.visible),[m]);F(()=>{const v=[...g.map(N=>N.id),...y.map(N=>N.id)];!v.includes(u)&&v.length>0&&f(v[0])},[g,y,u]);const w=k(()=>{h(!a)},[a]),$=k(()=>{const v={options:o},N=y.find(M=>M.id===u);if(N)return t(te,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:t(zn,{pane:N,options:o})});const A={queries:t(Pn,{...v}),events:t(On,{...v}),emails:t(In,{...v}),routes:t(Dn,{...v,currentPath:typeof window<"u"?window.location.pathname:""}),logs:t(Rn,{...v}),timeline:t(jn,{...v}),cache:t(Bn,{...v,dashboardPath:r}),jobs:t(Fn,{...v,dashboardPath:r}),config:t(Hn,{...v,dashboardPath:r}),internals:t(Un,{...v})};return t(te,{fallback:t("div",{className:"ss-dbg-empty",children:"Loading..."}),children:A[u]||t("div",{className:"ss-dbg-empty",children:"Unknown tab"})})},[u,o,y]);return t(O,{children:[s===void 0&&t("button",{type:"button",className:`ss-dbg-btn ${a?"ss-dbg-active":""}`,onClick:w,title:"Toggle debug panel",id:"ss-dbg-wrench",children:t("svg",{width:"14",height:"14",viewBox:L.wrench.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L.wrench.elements.join("")}})}),t("div",{className:`ss-dbg-panel ${a?"ss-dbg-open":""}`,"data-ss-theme":_,id:"ss-dbg-panel",children:[t("div",{className:"ss-dbg-tabs",children:[t("div",{className:"ss-dbg-tabs-scroll",children:[g.map(v=>t("button",{type:"button",className:`ss-dbg-tab ${u===v.id?"ss-dbg-active":""}`,onClick:()=>f(v.id),children:[L[v.id]?t("svg",{className:"ss-dbg-tab-icon",viewBox:L[v.id].viewBox,dangerouslySetInnerHTML:{__html:L[v.id].elements.join("")}}):null,v.label]},v.id)),y.map(v=>t("button",{type:"button",className:`ss-dbg-tab ${u===v.id?"ss-dbg-active":""}`,onClick:()=>f(v.id),children:v.label},v.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(Mn,{theme:_,onToggle:b,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:L["external-link"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L["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:a&&$()})]})]})}window.__ssDebugPanel={mount(e,n,r){tt(t(Vn,{debugEndpoint:n.debugEndpoint,authToken:n.authToken,dashboardPath:n.dashboardPath||void 0,defaultOpen:!0,isLive:r}),e)},unmount(e){tt(null,e)}};const qn=3e3,Wn=100,Jn=500;function Kn(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function Qn(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 Gn(e,n,r){const s=Object.keys(e);if(s.length===0)return"{}";const l=[];for(let c=0;c<Math.min(s.length,4);c++)l.push(s[c]+": "+r(e[s[c]],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 Yn(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 H(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function Tt(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function q(e){if(!e)return"-";const n=typeof e=="string"?new Date(Tt(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 j(e){if(!e)return"-";const n=typeof e=="string"?new Date(Tt(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 Y(e){return e>Jn?"very-slow":e>Wn?"slow":"normal"}function me(e,n=100){return e===null?"null":e===void 0?"-":typeof e=="string"?Kn(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?Qn(e,n,me):typeof e=="object"?Gn(e,n,me):String(e)}function Xn(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 Zn(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function er(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 tr(e){const n={};for(const r of e)n[r.sql]=(n[r.sql]||0)+1;return n}function nr(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}}const rr={queries:"/queries",events:"/events",emails:"/emails",routes:"/routes",logs:"/logs",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config",internals:"/diagnostics"};function sr(e){return rr[e]||`/${e}`}class lr{client;endpoint;refreshInterval;callbacks;timer=null;currentTab=null;fetchOnceCache={};abortController=null;constructor(n){this.client=new Me({baseUrl:n.baseUrl,authToken:n.authToken}),this.endpoint=n.endpoint??"/admin/api/debug",this.refreshInterval=n.refreshInterval??qn,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 _e){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}${sr(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 _e){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 U(e,n={}){const{baseUrl:r="",debugEndpoint:s="/admin/api/debug",authToken:l}=n,[i,o]=x(null),[d,c]=x(!0),[a,h]=x(null),u=I(null);u.current||(u.current=new lr({baseUrl:r,endpoint:s,authToken:l,onData:b=>o(b),onLoading:b=>c(b),onError:b=>h(b),onUnauthorized:b=>h(b)})),F(()=>{const b=u.current;return b.start(e),()=>b.stop()},[e]);const f=k(()=>{u.current?.refresh()},[]),p=k(()=>{o(null)},[]),_=k((b,y)=>{u.current?.cacheForTab(b,y)},[]);return{data:i,isLoading:d,error:a,refresh:f,clearData:p,cacheForTab:_}}const ir="ss-col-resize",Lt="ss-resizing";function Et(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(c){c.preventDefault(),c.stopPropagation(),l();const a=c.clientX,h=i.offsetWidth;d.classList.add(Lt),d.setPointerCapture(c.pointerId);function u(p){const _=p.clientX-a,b=Math.max(30,h+_);i.style.width=b+"px"}function f(){d.classList.remove(Lt),d.removeEventListener("pointermove",u),d.removeEventListener("pointerup",f)}d.addEventListener("pointermove",u),d.addEventListener("pointerup",f)};if(!i.textContent?.trim())continue;const d=document.createElement("div");d.className=ir,i.appendChild(d),d.addEventListener("pointerdown",o),r.push(()=>{d.removeEventListener("pointerdown",o),d.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=Et(n.current)),()=>{r.current?.(),r.current=null}),e),k(l=>{r.current?.(),r.current=null,n.current=l,l&&(r.current=Et(l))},[])}function W({search:e,onSearchChange:n,placeholder:r="Search...",summary:s,children:l,className:i=""}){const o=k(()=>{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:L.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:r,value:e,onChange:d=>n(d.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 At({options:e}){const{data:n,isLoading:r,error:s}=U("queries",e),[l,i]=x(""),[o,d]=x(null),c=S(()=>n?.queries||[],[n]),a=S(()=>er(c,l),[c,l]),h=S(()=>tr(c),[c]),u=S(()=>nr(c,h),[c,h]),f=k(_=>{d(b=>b===_?null:_)},[]),p=K([a]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading queries..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):t("div",{children:[t(W,{search:l,onSearchChange:i,placeholder:"Filter queries...",summary:t(O,{children:[a.length," queries",u.slowCount>0&&` | ${u.slowCount} slow`,u.dupCount>0&&` | ${u.dupCount} dup`,a.length>0&&` | avg ${H(u.avgDuration)}`]})}),a.length===0?t("div",{className:"ss-dbg-empty",children:"No queries captured"}):t("table",{ref:p,className:"ss-dbg-table",children:[t("colgroup",{children:[t("col",{style:{width:"50px"}}),t("col",{}),t("col",{style:{width:"80px"}}),t("col",{style:{width:"70px"}}),t("col",{style:{width:"100px"}}),t("col",{style:{width:"80px"}})]}),t("thead",{children:t("tr",{children:[t("th",{children:"#"}),t("th",{children:"SQL"}),t("th",{children:"Duration"}),t("th",{children:"Method"}),t("th",{children:"Model"}),t("th",{children:"Time"})]})}),t("tbody",{children:a.map(_=>t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:_.id}),t("td",{children:[t("span",{className:`ss-dbg-sql ${o===_.id?"ss-dbg-expanded":""}`,onClick:()=>f(_.id),role:"button",tabIndex:0,onKeyDown:b=>b.key==="Enter"&&f(_.id),children:_.sql}),h[_.sql]>1&&t("span",{className:"ss-dbg-dup",children:[" x",h[_.sql]]}),_.inTransaction&&t("span",{className:"ss-dbg-dup",children:" TXN"})]}),t("td",{className:`ss-dbg-duration ${Y(_.duration)==="very-slow"?"ss-dbg-very-slow":Y(_.duration)==="slow"?"ss-dbg-slow":""}`,children:H(_.duration)}),t("td",{children:t("span",{className:`ss-dbg-method ss-dbg-method-${_.method.toLowerCase()}`,children:_.method})}),t("td",{className:"ss-dbg-c-muted",children:_.model||"-"}),t("td",{className:"ss-dbg-event-time",title:q(_.timestamp),children:j(_.timestamp)})]},_.id))})]})]})}const ar=Object.freeze(Object.defineProperty({__proto__:null,QueriesTab:At,default:At},Symbol.toStringTag,{value:"Module"}));function ne({data:e,maxPreviewLength:n=100,className:r="",classPrefix:s="ss-dash",defaultExpanded:l=!1}){const[i,o]=x(l),d=S(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),c=S(()=>typeof d=="object"&&d!==null?me(d,n):String(d??"-"),[d,n]),a=S(()=>typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d),[d]),h=k(()=>{o(f=>!f)},[]),u=k(async()=>{try{await navigator.clipboard.writeText(a)}catch{}},[a]);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:f=>f.key==="Enter"&&h(),children:c}),i&&t("div",{className:`${s}-data-full`,onClick:h,children:[t("button",{className:`${s}-copy-btn`,onClick:f=>{f.stopPropagation(),u()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:a})]})]})}function Mt({options:e}){const{data:n,isLoading:r,error:s}=U("events",e),[l,i]=x(""),o=S(()=>{const c=n?.events||[];if(!l)return c;const a=l.toLowerCase();return c.filter(h=>(h.event||"").toLowerCase().includes(a)||(h.data||"").toLowerCase().includes(a))},[n,l]),d=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(W,{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:d,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(c=>{const a=c.timestamp||c.created_at||c.createdAt;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:c.id}),t("td",{className:"ss-dbg-event-name",children:c.event}),t("td",{className:"ss-dbg-event-data",children:t(ne,{data:c.data,maxPreviewLength:80,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-event-time",title:q(a),children:j(a)})]},c.id)})})]})]})}const or=Object.freeze(Object.defineProperty({__proto__:null,EventsTab:Mt,default:Mt},Symbol.toStringTag,{value:"Module"}));function Pt({options:e}){const{data:n,isLoading:r,error:s}=U("emails",e),[l,i]=x(""),[o,d]=x(null),[c,a]=x(null),[h,u]=x(!1),f=S(()=>{const g=n?.emails||[];if(!l)return g;const w=l.toLowerCase();return g.filter($=>($.subject||"").toLowerCase().includes(w)||($.to||"").toLowerCase().includes(w)||($.from||"").toLowerCase().includes(w)||($.mailer||"").toLowerCase().includes(w))},[n,l]),p=S(()=>f.find(g=>g.id===o),[f,o]),_=k(async g=>{if(d(g.id),a(g.html||null),!g.html&&g.id){u(!0);try{const w=e?.debugEndpoint||"/admin/api/debug",$={};e?.authToken&&($.Authorization=`Bearer ${e.authToken}`);const v=await fetch(`${w}/emails/${g.id}/preview`,{headers:$,credentials:e?.authToken?"omit":"include"});v.ok&&a(await v.text())}catch{}finally{u(!1)}}},[e]),b=k(()=>{d(null),a(null),u(!1)},[]),y={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"},m=K([f]);return r&&!n?t("div",{className:"ss-dbg-empty",children:"Loading emails..."}):s?t("div",{className:"ss-dbg-empty",children:["Error: ",s.message]}):p?t("div",{className:"ss-dbg-email-preview",children:[t("div",{className:"ss-dbg-email-preview-header",children:[t("div",{className:"ss-dbg-email-preview-meta",children:[t("div",{children:[t("strong",{children:"Subject:"})," ",p.subject]}),t("div",{children:[t("strong",{children:"From:"})," ",p.from]}),t("div",{children:[t("strong",{children:"To:"})," ",p.to]}),p.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",p.cc]})]}),t("button",{className:"ss-dbg-btn-clear",onClick:b,type:"button",children:"×"})]}),h?t("div",{className:"ss-dbg-empty",children:"Loading preview..."}):c?t("iframe",{className:"ss-dbg-email-iframe",srcDoc:c,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:p.text||"No content"})]}):t("div",{children:[t(W,{search:l,onSearchChange:i,placeholder:"Filter emails...",summary:`${f.length} emails`}),f.length===0?t("div",{className:"ss-dbg-empty",children:"No emails captured"}):t("table",{ref:m,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:f.map(g=>t("tr",{className:"ss-dbg-email-row",onClick:()=>_(g),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:g.id}),t("td",{className:"ss-dbg-c-secondary",title:g.from,children:g.from}),t("td",{className:"ss-dbg-c-secondary",title:g.to,children:g.to}),t("td",{className:"ss-dbg-c-sql",children:g.subject}),t("td",{children:t("span",{className:`ss-dbg-email-status ${y[g.status]||""}`,children:g.status})}),t("td",{className:"ss-dbg-c-muted",children:g.mailer}),t("td",{className:"ss-dbg-c-dim",style:{textAlign:"center"},children:g.attachmentCount>0?g.attachmentCount:"-"}),t("td",{className:"ss-dbg-event-time",title:q(g.timestamp||g.created_at||g.createdAt),children:j(g.timestamp||g.created_at||g.createdAt)})]},g.id))})]})]})}const cr=Object.freeze(Object.defineProperty({__proto__:null,EmailsTab:Pt,default:Pt},Symbol.toStringTag,{value:"Module"}));function Ot({options:e,currentPath:n}){const{data:r,isLoading:s,error:l}=U("routes",e),[i,o]=x(""),d=S(()=>{const a=r?.routes||[];if(!i)return a;const h=i.toLowerCase();return a.filter(u=>u.pattern.toLowerCase().includes(h)||u.handler.toLowerCase().includes(h)||u.method.toLowerCase().includes(h)||u.name&&u.name.toLowerCase().includes(h))},[r,i]),c=K([d]);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(W,{search:i,onSearchChange:o,placeholder:"Filter routes...",summary:`${d.length} routes`}),d.length===0?t("div",{className:"ss-dbg-empty",children:"No routes found"}):t("table",{ref:c,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:d.map((a,h)=>{const u=n&&(a.pattern===n||new RegExp("^"+a.pattern.replace(/:[^/]+/g,"[^/]+")+"$").test(n));return t("tr",{className:u?"ss-dbg-current-route":"",children:[t("td",{children:t("span",{className:`ss-dbg-method ss-dbg-method-${a.method.toLowerCase()}`,children:a.method})}),t("td",{className:"ss-dbg-c-text",children:a.pattern}),t("td",{className:"ss-dbg-c-muted",children:a.name||"-"}),t("td",{className:"ss-dbg-c-sql",children:a.handler}),t("td",{className:"ss-dbg-c-dim",style:{fontSize:"10px"},children:a.middleware.length>0?a.middleware.join(", "):"-"})]},`${a.method}-${a.pattern}-${h}`)})})]})]})}const dr=Object.freeze(Object.defineProperty({__proto__:null,RoutesTab:Ot,default:Ot},Symbol.toStringTag,{value:"Module"}));function ur(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 It(e){const n={};for(const[r,s]of Object.entries(e))pr.has(r)||(n[r]=s);return Object.keys(n).length>0?n:null}const hr=["all","error","warn","info","debug"];function Ie(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function De(e){return e.msg||e.message||JSON.stringify(e)}function Dt(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Re(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 Rt(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 fr(e,n){return n==="all"?e:e.filter(r=>{const s=Ie(r);return n==="error"?s==="error"||s==="fatal":s===n})}const pr=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 jt(e){if(e.data){const n=ur(e.data);if(n){const r=It(n);if(r)return r}}return It(e)}function Bt({options:e}){const{data:n,isLoading:r,error:s}=U("logs",e),[l,i]=x("all"),[o,d]=x(""),[c,a]=x(""),[h,u]=x(null),f=S(()=>{let _=Array.isArray(n)?n:n?.logs||n?.entries||[];if(_=fr(_,l),c){const b=c.toLowerCase();_=_.filter(y=>Re(y).toLowerCase().includes(b))}if(o){const b=o.toLowerCase();_=_.filter(y=>De(y).toLowerCase().includes(b))}return _},[n,l,o,c]),p=k(_=>{a(b=>b===_?"":_)},[]);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(_=>t("button",{type:"button",className:`ss-dbg-log-filter ${l===_?"ss-dbg-active":""}`,onClick:()=>i(_),children:_},_)),c&&t("button",{type:"button",className:"ss-dbg-log-filter ss-dbg-active",onClick:()=>a(""),children:["req: ",c.slice(0,8)," x"]}),t("span",{className:"ss-dbg-summary",style:{marginLeft:"auto"},children:[f.length," entries"]})]}),t(W,{search:o,onSearchChange:d,placeholder:"Filter log messages..."}),t("div",{style:{overflow:"auto",flex:1},children:f.length===0?t("div",{className:"ss-dbg-empty",children:"No log entries"}):f.slice(0,200).map((_,b)=>{const y=Ie(_),m=De(_),g=Dt(_),w=Re(_),$=jt(_);return t(Ct.Fragment,{children:[t("div",{className:`ss-dbg-log-entry${$?" ss-dbg-log-entry-expandable":""}`,onClick:()=>$&&u(h===b?null:b),children:[t("span",{className:`ss-dbg-log-level ${Rt(y)}`,children:y.toUpperCase()}),t("span",{className:"ss-dbg-log-time",title:g?q(g):"",children:g?j(g):"-"}),w?t("span",{className:"ss-dbg-log-reqid",onClick:v=>{v.stopPropagation(),p(w)},role:"button",tabIndex:0,title:w,onKeyDown:v=>{v.key==="Enter"&&(v.stopPropagation(),p(w))},children:w.slice(0,8)}):t("span",{className:"ss-dbg-log-reqid-empty",children:"-"}),$?t("span",{className:`ss-dbg-log-expand-icon${h===b?" ss-dbg-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-dbg-log-msg",children:m})]}),h===b&&$&&t("div",{className:"ss-dbg-log-detail",children:t(ne,{data:$,classPrefix:"ss-dbg",defaultExpanded:!0})})]},b)})})]})}const _r=Object.freeze(Object.defineProperty({__proto__:null,LogsTab:Bt,default:Bt},Symbol.toStringTag,{value:"Module"}));function gr(e){const{container:n,handle:r,topPane:s,bottomPane:l,storageKey:i,minHeight:o=60}=e;if(i){const c=localStorage.getItem(i);if(c){const a=parseFloat(c);a>0&&a<1&&(s.style.flex=`${a}`,l.style.flex=`${1-a}`)}}function d(c){c.preventDefault(),r.setPointerCapture(c.pointerId);const h=n.getBoundingClientRect().height,u=c.clientY,f=s.getBoundingClientRect().height;function p(b){const y=b.clientY-u;let m=f+y;const g=h-o-r.offsetHeight;m=Math.max(o,Math.min(m,g));const w=m/(h-r.offsetHeight);s.style.flex=`${w}`,l.style.flex=`${1-w}`}function _(){if(r.removeEventListener("pointermove",p),r.removeEventListener("pointerup",_),i){const b=n.getBoundingClientRect().height-r.offsetHeight;if(b>0){const y=s.getBoundingClientRect().height/b;localStorage.setItem(i,String(y))}}}r.addEventListener("pointermove",p),r.addEventListener("pointerup",_)}return r.addEventListener("pointerdown",d),()=>{r.removeEventListener("pointerdown",d)}}function Ft(e="",n){const r=I(null);return k(()=>(r.current||(r.current=new Me({baseUrl:e,authToken:n})),r.current),[e,n])}function mr({logs:e,classPrefix:n="ss-dash"}){const[r,s]=x(null);return e.length===0?null:t("div",{children:[t("div",{className:`${n}-related-logs-title`,children:["Related Logs",t("span",{className:`${n}-related-logs-count`,children:["(",e.length,")"]})]}),t("div",{className:`${n}-log-entries`,style:{overflow:"auto"},children:e.map((l,i)=>{const o=Ie(l),d=De(l),c=Re(l),a=Dt(l),h=jt(l);return t(Ct.Fragment,{children:[t("div",{className:`${n}-log-entry${h?` ${n}-log-entry-expandable`:""}`,onClick:()=>h&&s(r===i?null:i),children:[t("span",{className:`${n}-log-level ${Rt(o,`${n}-log-level`)}`,children:o.toUpperCase()}),t("span",{className:`${n}-log-time`,title:a?q(a):"",children:a?j(a):"-"}),c?t("span",{className:`${n}-log-reqid`,title:c,children:c.slice(0,8)}):t("span",{className:`${n}-log-reqid-empty`,children:"--"}),h?t("span",{className:`${n}-log-expand-icon${r===i?` ${n}-log-expand-icon-open`:""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:`${n}-log-msg`,children:d})]}),r===i&&h&&t("div",{className:`${n}-log-detail`,children:t(ne,{data:h,classPrefix:n,defaultExpanded:!0})})]},l.id||i)})})]})}function br({children:e,classPrefix:n="ss-dbg",storageKey:r}){const s=I(null),l=I(null),i=I(null),o=I(null);return F(()=>{if(s.current&&l.current&&i.current&&o.current)return gr({container:s.current,handle:l.current,topPane:i.current,bottomPane:o.current,storageKey:r})},[r]),t("div",{ref:s,className:`${n}-split-container`,children:[t("div",{ref:i,className:`${n}-split-top`,children:e[0]}),t("div",{ref:l,className:`${n}-split-handle`}),t("div",{ref:o,className:`${n}-split-bottom`,children:e[1]})]})}const Ht={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"#525252"},vr=[{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 Ut({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},{data:l,isLoading:i,error:o}=U("timeline",e),[d,c]=x(""),[a,h]=x(null),[u,f]=x(null),[p,_]=x(!1),[b,y]=x(null),m=S(()=>{const N=l?.traces||[];if(!d)return N;const A=d.toLowerCase();return N.filter(M=>M.url.toLowerCase().includes(A)||M.method.toLowerCase().includes(A)||String(M.statusCode).includes(A))},[l,d]),g=Ft(n,s);F(()=>{if(a===null){f(null),y(null);return}let N=!1;return _(!0),y(null),g().get(`${r}/traces/${a}`).then(M=>{N||(f(M),_(!1))}).catch(M=>{N||(y(M instanceof Error?M.message:"Failed to load trace"),_(!1))}),()=>{N=!0}},[a,r,g]);const w=k(N=>{h(A=>A===N?null:N)},[]),$=k(N=>N>=500?"ss-dbg-status-5xx":N>=400?"ss-dbg-status-4xx":N>=300?"ss-dbg-status-3xx":"ss-dbg-status-2xx",[]),v=K([m]);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(a!==null){if(p)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});if(b)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: ",b]})]});if(!u)return t("div",{className:"ss-dbg-empty",children:"Loading trace detail..."});const N=u.spans||[],A=u.warnings||[],M=u.logs||[],D=M.length>0,J=t("div",{children:[t("div",{className:"ss-dbg-tl-legend",children:vr.map(P=>t("div",{className:"ss-dbg-tl-legend-item",children:[t("div",{className:"ss-dbg-tl-legend-dot",style:{background:P.color}}),t("span",{children:P.label})]},P.label))}),t("div",{style:{padding:"8px 12px",overflow:"auto"},children:N.length===0?t("div",{className:"ss-dbg-empty",children:"No spans captured for this request"}):N.map(P=>{const we=u.totalDuration||1,Gr=P.startOffset/we*100,Yr=Math.max(P.duration/we*100,.5);return t("div",{className:"ss-dbg-tl-row",children:[t("div",{className:"ss-dbg-tl-label",title:P.label,children:P.label}),t("div",{className:"ss-dbg-tl-track",children:t("div",{className:`ss-dbg-tl-bar ss-dbg-tl-bar-${P.category}`,style:{left:`${Gr}%`,width:`${Yr}%`,background:Ht[P.category]||Ht.custom},title:`${P.label}: ${H(P.duration)}`})}),t("span",{className:"ss-dbg-tl-dur",children:H(P.duration)})]},P.id)})}),A.length>0&&t("div",{className:"ss-dbg-tl-warnings",children:[t("div",{className:"ss-dbg-tl-warnings-title",children:"Warnings"}),A.map((P,we)=>t("div",{className:"ss-dbg-tl-warning",children:P},we))]})]});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("span",{className:`ss-dbg-method ss-dbg-method-${u.method.toLowerCase()}`,children:u.method}),t("span",{className:"ss-dbg-tl-detail-url",children:u.url}),t("span",{className:`ss-dbg-status ${$(u.statusCode)}`,children:u.statusCode}),t("span",{className:"ss-dbg-tl-meta",children:[H(u.totalDuration)," · ",u.spanCount," spans"]})]}),D?t(br,{classPrefix:"ss-dbg",storageKey:"ss-dbg-timeline-split",children:[J,t(mr,{logs:M,classPrefix:"ss-dbg"})]}):J]})}return t("div",{children:[t(W,{search:d,onSearchChange:c,placeholder:"Filter traces...",summary:`${m.length} traces`}),m.length===0?t("div",{className:"ss-dbg-empty",children:"No traces captured. Enable tracing in config."}):t("table",{ref:v,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:m.map(N=>t("tr",{className:"ss-dbg-email-row",onClick:()=>w(N.id),children:[t("td",{className:"ss-dbg-c-dim",style:{whiteSpace:"nowrap"},children:N.id}),t("td",{children:t("span",{className:`ss-dbg-method ss-dbg-method-${N.method.toLowerCase()}`,children:N.method})}),t("td",{title:N.url,children:N.url}),t("td",{children:t("span",{className:`ss-dbg-status ${$(N.statusCode)}`,children:N.statusCode})}),t("td",{className:`ss-dbg-duration ${Y(N.totalDuration)==="very-slow"?"ss-dbg-very-slow":Y(N.totalDuration)==="slow"?"ss-dbg-slow":""}`,children:H(N.totalDuration)}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:N.spanCount}),t("td",{className:"ss-dbg-event-time",title:q(N.timestamp),children:j(N.timestamp)})]},N.id))})]})]})}const yr=Object.freeze(Object.defineProperty({__proto__:null,TimelineTab:Ut,default:Ut},Symbol.toStringTag,{value:"Module"}));function je(e,n){const r=S(()=>e?e.replace(/\/+$/,"")+"/api":null,[e]),s=S(()=>r?{...n,debugEndpoint:r}:n,[r,n]);return{dashApiBase:r,resolvedOptions:s}}function zt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=je(n,e),{data:l,isLoading:i,error:o}=U("cache",s),[d,c]=x(""),[a,h]=x(null),[u,f]=x(null),p=S(()=>{const g=l?.keys||[];if(!d)return g;const w=d.toLowerCase();return g.filter($=>$.key.toLowerCase().includes(w))},[l,d]),_=k(async g=>{if(a===g){h(null),f(null);return}h(g);try{const{baseUrl:w="",authToken:$}=e||{},v=r||e?.debugEndpoint||"/admin/api/debug",N=`${w}${v}/cache/${encodeURIComponent(g)}`,A={Accept:"application/json"};$&&(A.Authorization=`Bearer ${$}`);const D=await(await fetch(N,{headers:A,credentials:$?"omit":"same-origin"})).json();f(D)}catch{f({error:"Failed to fetch key value"})}},[a,e,r]),b=K([p]);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 m=l.stats||l;return t("div",{children:[t("div",{className:"ss-dbg-cache-stats",children:[t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-dbg-cache-stat-value",children:[m.hitRate!==null&&m.hitRate!==void 0?m.hitRate.toFixed(1):"0","%"]})]}),t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-dbg-cache-stat-value",children:m.totalHits??0})]}),t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-dbg-cache-stat-value",children:m.totalMisses??0})]}),t("div",{className:"ss-dbg-cache-stat",children:[t("span",{className:"ss-dbg-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-dbg-cache-stat-value",children:m.keyCount??"-"})]})]}),t(W,{search:d,onSearchChange:c,placeholder:"Filter keys...",summary:`${p.length} keys`}),a&&!!u&&t("div",{className:"ss-dbg-cache-detail",children:[t("strong",{children:a}),t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:()=>h(null),children:["←"," Back"]}),t(ne,{data:u,classPrefix:"ss-dbg"})]}),p.length===0?t("div",{className:"ss-dbg-empty",children:"No cache keys found"}):t("table",{ref:b,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:p.map(g=>t("tr",{className:"ss-dbg-email-row",onClick:()=>_(g.key),children:[t("td",{className:"ss-dbg-c-sql",children:g.key}),t("td",{className:"ss-dbg-c-muted",children:g.type}),t("td",{className:"ss-dbg-c-muted",children:g.ttl>0?Xn(g.ttl):"-"}),t("td",{className:"ss-dbg-c-dim",children:g.size>0?Zn(g.size):"-"})]},g.key))})]})]})}const wr=Object.freeze(Object.defineProperty({__proto__:null,CacheTab:zt,default:zt},Symbol.toStringTag,{value:"Module"})),Nr=["all","active","waiting","delayed","completed","failed"];function xr(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 $r(e){if(!e)return[];if(Array.isArray(e))return e;const n=e;return n.jobs||n.data||[]}function Cr(e){if(!e||Array.isArray(e))return null;const n=e;return n.stats||n.overview||null}function Vt({options:e,dashboardPath:n}){const{dashApiBase:r,resolvedOptions:s}=je(n,e),{data:l,isLoading:i,error:o}=U("jobs",s),[d,c]=x(""),[a,h]=x("all"),[u,f]=x(null),p=S(()=>{const m=$r(l),g=a==="all"?m:m.filter($=>$.status===a);if(!d)return g;const w=d.toLowerCase();return g.filter($=>$.name?.toLowerCase().includes(w)||$.id?.toString().includes(w))},[l,a,d]),_=k(async m=>{f(m);try{const{baseUrl:g="",authToken:w}=e||{},$=r||e?.debugEndpoint||"/admin/api/debug",v=`${g}${$}/jobs/${m}/retry`,N={Accept:"application/json"};w&&(N.Authorization=`Bearer ${w}`),await fetch(v,{method:"POST",headers:N,credentials:w?"omit":"same-origin"})}catch{}f(null)},[e,r]),b=K([p]);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 y=Cr(l);return t("div",{children:[t(W,{search:d,onSearchChange:c,placeholder:"Filter jobs...",summary:`${p.length} jobs`}),t("div",{className:"ss-dbg-job-stats-area",children:[t("div",{className:"ss-dbg-job-stats",children:[t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Active:"}),t("span",{className:"ss-dbg-job-stat-value",children:y?.active??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Waiting:"}),t("span",{className:"ss-dbg-job-stat-value",children:y?.waiting??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Delayed:"}),t("span",{className:"ss-dbg-job-stat-value",children:y?.delayed??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Completed:"}),t("span",{className:"ss-dbg-job-stat-value",children:y?.completed??0})]}),t("div",{className:"ss-dbg-job-stat",children:[t("span",{className:"ss-dbg-job-stat-label",children:"Failed:"}),t("span",{className:"ss-dbg-job-stat-value ss-dbg-c-red",children:y?.failed??0})]})]}),t("div",{className:"ss-dbg-log-filters",children:Nr.map(m=>t("button",{type:"button",className:`ss-dbg-job-filter ${a===m?"ss-dbg-active":""}`,onClick:()=>h(m),children:m},m))})]}),p.length===0?t("div",{className:"ss-dbg-empty",children:"No jobs found"}):t("table",{ref:b,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:p.map(m=>{const g=m;return t("tr",{children:[t("td",{className:"ss-dbg-c-dim",children:m.id}),t("td",{className:"ss-dbg-c-sql",title:m.name,children:m.name}),t("td",{children:t("span",{className:`ss-dbg-badge ${xr(m.status)}`,children:m.status})}),t("td",{children:t(ne,{data:m.payload||m.data,maxPreviewLength:60,classPrefix:"ss-dbg"})}),t("td",{className:"ss-dbg-c-muted",style:{textAlign:"center"},children:m.attempts||g.attemptsMade||0}),t("td",{className:"ss-dbg-duration",children:m.duration!==null?H(m.duration):"-"}),t("td",{className:"ss-dbg-event-time",title:q(m.timestamp||m.createdAt||g.processedAt||g.created_at),children:j(m.timestamp||m.createdAt||g.processedAt||g.created_at)}),t("td",{children:m.status==="failed"&&t("button",{type:"button",className:"ss-dbg-retry-btn",onClick:()=>_(m.id),disabled:u===m.id,children:u===m.id?"...":"Retry"})})]},m.id)})})]})]})}const kr=Object.freeze(Object.defineProperty({__proto__:null,JobsTab:Vt,default:Vt},Symbol.toStringTag,{value:"Module"}));function B(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function be(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!B(e)}function Be(e,n=""){if(!be(e))return[{path:n,value:e}];const r=[];for(const s of Object.keys(e)){const l=n?`${n}.${s}`:s,i=e[s];be(i)?r.push(...Be(i,l)):r.push({path:l,value:i})}return r}function Fe(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 qt(e){if(e==null||typeof e!="object"||Array.isArray(e)||B(e))return 1;let n=0;for(const r of Object.keys(e))n+=qt(e[r]);return n}function Sr(e){if(!be(e))return[];const n=[];for(const r of Object.keys(e))be(e[r])&&n.push(r);return n}function ve(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 ye({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:L["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:L.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L.eye.elements.join("")}})})]})}function Tr({env:e,search:n,p:r}){const s=I(new Map),l=n.toLowerCase(),i=Object.entries(e).filter(([o,d])=>{if(!l)return!0;const c=B(d)?d.display:d==null?"":String(d);return o.toLowerCase().includes(l)||c.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,d])=>{const c=B(d),a=c?d.display:d==null?"null":String(d),h=`${o}=${a}`;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:c?t(ye,{redacted:d,p:r}):t("span",{className:`${r}-config-val`,children:a})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:u=>{s.current.set(o,u)},onClick:u=>{u.stopPropagation(),ve(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 Lr({source:e,search:n,p:r}){const s=I(new Map),l=n.toLowerCase(),i=Be(e,""),o=i.filter(d=>{const c=B(d.value)?d.value.display:d.value===null||d.value===void 0?"":String(d.value);return d.path.toLowerCase().includes(l)||c.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(d=>{const c=B(d.value),a=c?null:Fe(d.value),h=c?d.value.display:a.text,u=`${d.path}: ${h}`;return t("tr",{children:[t("td",{children:t("span",{className:`${r}-config-key`,style:{whiteSpace:"nowrap"},children:d.path})}),t("td",{children:c?t(ye,{redacted:d.value,p:r}):t("span",{className:`${r}-config-val`,style:{wordBreak:"break-all",color:a.color},children:a.text})}),t("td",{children:!c&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:f=>{s.current.set(d.path,f)},onClick:f=>{f.stopPropagation(),ve(u,s.current.get(d.path)??null,r)},children:"⎘"})})]},d.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 Er({obj:e,prefix:n,p:r}){const s=I(new Map),l=Be(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,d=B(i.value),c=d?null:Fe(i.value),a=d?i.value.display:c.text,h=`${i.path}: ${a}`;return t("tr",{children:[t("td",{title:o,children:t("span",{className:`${r}-config-key`,children:o})}),t("td",{title:a,children:d?t(ye,{redacted:i.value,p:r}):t("span",{className:`${r}-config-val`,style:{color:c.color},children:c.text})}),t("td",{children:!d&&t("button",{type:"button",className:`${r}-copy-row-btn`,title:"Copy",ref:u=>{s.current.set(i.path,u)},onClick:u=>{u.stopPropagation(),ve(h,s.current.get(i.path)??null,r)},children:"⎘"})})]},i.path)})})]})}function Ar({value:e,p:n}){if(e==null)return t("span",{className:`${n}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(B(e))return t(ye,{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 Mr({obj:e,expandedPaths:n,onToggle:r,p:s}){if(e==null||typeof e!="object"||Array.isArray(e)||B(e))return null;const l=Object.keys(e),i=I(new Map);return t("div",{className:`${s}-config-sections`,children:l.map(o=>{const d=e[o],c=d!==null&&typeof d=="object"&&!Array.isArray(d)&&!B(d),a=n.has(o),h=B(d);return t("div",{className:`${s}-config-section`,children:[t("div",{className:`${s}-config-section-header${c?"":` ${s}-config-leaf`}`,onClick:c?()=>r(o):void 0,style:{cursor:c?"pointer":"default"},children:[c?t("span",{className:`${s}-config-toggle`,children:a?"▼":"▶"}):t("span",{className:`${s}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${s}-config-key`,children:o}),c?t("span",{className:`${s}-config-count`,children:[qt(d)," entries"]}):t(O,{children:[t("span",{className:`${s}-config-val`,style:{marginLeft:"8px"},children:t(Ar,{value:d,p:s})}),!h&&t("button",{type:"button",className:`${s}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:u=>{i.current.set(o,u)},onClick:u=>{u.stopPropagation();const f=Fe(d);ve(`${o}: ${f.text}`,i.current.get(o)??null,s)},children:"⎘"})]})]}),c&&a&&t("div",{className:`${s}-config-section-body`,children:t(Er,{obj:d,prefix:o,p:s})})]},o)})})}function Pr({data:e,isLoading:n,classPrefix:r}){const s=r,[l,i]=x(""),[o,d]=x(""),[c,a]=x("app"),[h,u]=x(new Set),[f,p]=x("Copy JSON");F(()=>{const w=setTimeout(()=>d(l),200);return()=>clearTimeout(w)},[l]);const _=e,b=k(w=>{u($=>{const v=new Set($);return v.has(w)?v.delete(w):v.add(w),v})},[]),y=k(()=>{if(!_)return;const w=c==="app"?_.app:_.env;if(!w)return;const $=Sr(w);u(new Set($))},[_,c]),m=k(()=>{u(new Set)},[]),g=k(async()=>{if(_)try{const w=c==="app"?_.app:_.env;await navigator.clipboard.writeText(JSON.stringify(w,null,2)),p("Copied!"),setTimeout(()=>p("Copy JSON"),1500)}catch{}},[_,c]);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${c==="app"?` ${s}-active`:""}`,onClick:()=>a("app"),children:"App Config"}),t("button",{type:"button",className:`${s}-config-tab${c==="env"?` ${s}-active`:""}`,onClick:()=>a("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:"×"})]}),c==="app"&&!o&&t(O,{children:[t("button",{type:"button",className:`${s}-btn`,onClick:y,children:"Expand All"}),t("button",{type:"button",className:`${s}-btn`,onClick:m,children:"Collapse All"})]}),t("button",{type:"button",className:`${s}-btn`,onClick:g,children:f})]}),n&&!e?t("div",{className:`${s}-empty`,children:"Loading config..."}):_?c==="env"?t(Tr,{env:_.env??{},search:o,p:s}):o?t(Lr,{source:_.app??{},search:o,p:s}):t("div",{className:`${s}-config-table-wrap`,children:t(Mr,{obj:_.app,expandedPaths:h,onToggle:b,p:s})}):t("div",{className:`${s}-empty`,children:"Config not available"})]})}function Wt({options:e,dashboardPath:n}){const{resolvedOptions:r}=je(n,e),{data:s,isLoading:l,error:i}=U("config",r);return i?t("div",{className:"ss-dbg-empty",children:["Error: ",i.message]}):t(Pr,{data:s,isLoading:l,classPrefix:"ss-dbg"})}const Or=Object.freeze(Object.defineProperty({__proto__:null,ConfigTab:Wt,default:Wt},Symbol.toStringTag,{value:"Module"})),Ir=["password","secret","token","key","credential","auth"];function Jt(e){const n=e.toLowerCase();return Ir.some(r=>n.includes(r))}function Kt(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 Dr={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function Rr(e){return Dr[e]||e}const jr={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function Br(e){return jr[e]||e}const Fr=["healthy","active","connected","available","ready"],Hr=["errored","unavailable"];function Ur(e){return Fr.includes(e)?"ok":Hr.includes(e)?"err":""}function re({status:e,prefix:n}){const r=Ur(e);let s=`${n}-dot`;return r==="ok"?s+=` ${n}-dot-ok`:r==="err"&&(s+=` ${n}-dot-err`),t("span",{className:s})}const Qt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:L.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L.eye.elements.join("")}}),Gt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:L["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:L["eye-off"].elements.join("")}});function zr({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(Gt,{}):t(Qt,{})})]})}function Vr({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 qr({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}),"=",Jt(s)&&typeof l=="string"?t(zr,{value:l}):t("span",{children:Kt(l)})]},s))})}function se({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 Wr({data:e,tableClassName:n,classPrefix:r}){const s=r||"ss-dash",[l,i]=x(new Set),o=k(c=>{i(a=>{const h=new Set(a);return h.has(c)?h.delete(c):h.add(c),h})},[]),d=k((c,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 h=Kt(a);if(Jt(c)){const u=l.has(c);return t("span",{children:[u?h:"••••••••"," ",t("button",{type:"button",onClick:()=>o(c),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:u?t(Gt,{}):t(Qt,{})})]})}return t("span",{children:h})},[l,o,s]);return t("div",{children:[t("h3",{className:`${s}-internals-title`,children:"Package Info"}),t("div",{className:`${s}-info-cards`,children:[t(se,{label:"Version",value:e.package.version||"-",prefix:s}),t(se,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:s}),t(se,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:s}),t(se,{label:"Uptime",value:Yn(e.package.uptime),prefix:s}),t(se,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:s})]}),e.collectors.length>0&&t(O,{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(c=>t("tr",{children:[t("td",{children:[t("code",{children:c.name}),c.label&&c.label!==c.name&&t("span",{className:`${s}-c-dim`,children:[" ",c.label]})]}),t("td",{children:[t(re,{status:c.status,prefix:s}),c.status]}),t("td",{className:c.lastError?`${s}-c-red`:`${s}-c-dim`,children:c.lastError?t(O,{children:[c.lastError,c.lastErrorAt&&t("span",{className:`${s}-c-dim`,style:{fontSize:"10px"},children:j(c.lastErrorAt)})]}):"-"}),t("td",{children:t(qr,{config:c.config,prefix:s})})]},c.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(([c,a])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:c}),t("td",{children:[a.current.toLocaleString()," / ",a.max.toLocaleString()]}),t("td",{children:t(Vr,{current:a.current,max:a.max,prefix:s})})]},c))})]}),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(([c,a])=>t("tr",{children:[t("td",{children:Rr(c)}),t("td",{children:[t(re,{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?H(a.intervalMs):a.debounceMs?`${H(a.debounceMs)} (debounce)`:"-":t("span",{className:`${s}-c-dim`,children:"—"})})]},c))})]}),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(re,{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(([c,a])=>{const h=a.active??a.available??!1,u=a.active?"active":a.available?"available":"unavailable";let f=a.mode?`Mode: ${a.mode}`:"-";return c==="edgePlugin"&&a.active?f="@serverStats() tag registered":c==="cacheInspector"&&a.available?f="Redis dependency detected":c==="queueInspector"&&a.available&&(f="Queue dependency detected"),t("tr",{children:[t("td",{children:Br(c)}),t("td",{children:[t(re,{status:h?"active":"inactive",prefix:s}),u]}),t("td",{className:`${s}-c-dim`,style:{fontSize:"11px"},children:f})]},c)})]})]}),e.storage&&t(O,{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(re,{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?j(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(c=>t("tr",{children:[t("td",{children:t("code",{children:c.name})}),t("td",{children:c.rowCount.toLocaleString()})]},c.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:d("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(([c,a])=>t("tr",{children:[t("td",{children:c==="customPaneCount"?"customPanes":c}),t("td",{children:c==="customPaneCount"?`${a} registered`:d(c,a)})]},c))})]})]})}const Jr=3e3;function Yt({options:e}){const{baseUrl:n="",debugEndpoint:r="/admin/api/debug",authToken:s}=e||{},[l,i]=x(null),[o,d]=x(!0),[c,a]=x(null),h=I(null),u=Ft(n,s),f=k(async()=>{try{const _=await u().get(`${r}/diagnostics`);i(_),a(null),d(!1)}catch(p){if(p instanceof _e){a(p),d(!1),h.current&&(clearInterval(h.current),h.current=null);return}a(p instanceof Error?p:new Error(String(p))),d(!1)}},[r,u]);return F(()=>(d(!0),a(null),f(),h.current=setInterval(f,Jr),()=>{h.current&&(clearInterval(h.current),h.current=null)}),[f]),o&&!l?t("div",{className:"ss-dbg-empty",children:"Loading diagnostics..."}):c?t("div",{className:"ss-dbg-empty",children:["Error: ",c.message]}):l?t(Wr,{data:l,tableClassName:"ss-dbg-table",classPrefix:"ss-dbg"}):t("div",{className:"ss-dbg-empty",children:"Diagnostics not available"})}const Kr=Object.freeze(Object.defineProperty({__proto__:null,InternalsTab:Yt,default:Yt},Symbol.toStringTag,{value:"Module"}));function Xt({pane:e,options:n}){({...n});const{data:r,isLoading:s,error:l,clearData:i}=U(e.endpoint.replace(/^\//,""),{...n,debugEndpoint:""}),[o,d]=x(""),c=S(()=>{if(!r)return[];const f=e.dataKey||e.id;let p=r;for(const _ of f.split("."))p=p?.[_];return Array.isArray(p)?p:[]},[r,e.dataKey,e.id]),a=S(()=>{if(!o)return c;const f=o.toLowerCase(),p=e.columns.filter(_=>_.searchable).map(_=>_.key);return p.length===0?c:c.filter(_=>p.some(b=>{const y=_[b];return y!==null&&String(y).toLowerCase().includes(f)}))},[c,o,e.columns]),h=(f,p)=>{if(f==null)return t("span",{className:"ss-dbg-c-dim",children:"-"});switch(p.format||"text"){case"time":return t("span",{className:"ss-dbg-event-time",title:q(f),children:typeof f=="number"?j(f):String(f)});case"timeAgo":return t("span",{className:"ss-dbg-event-time",title:q(f),children:j(f)});case"duration":{const b=typeof f=="number"?f:parseFloat(String(f));return isNaN(b)?String(f):t("span",{className:`ss-dbg-duration ${Y(b)==="very-slow"?"ss-dbg-very-slow":Y(b)==="slow"?"ss-dbg-slow":""}`,children:H(b)})}case"method":return t("span",{className:`ss-dbg-method ss-dbg-method-${String(f).toLowerCase()}`,children:String(f)});case"json":{let b=f;if(typeof f=="string")try{b=JSON.parse(f)}catch{}return me(b,80)}case"badge":{const b=String(f).toLowerCase(),m=(p.badgeColorMap||{})[b]||"muted";return t("span",{className:`ss-dbg-badge ss-dbg-badge-${m}`,children:String(f)})}default:return String(f)}},u=K([a]);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(W,{search:o,onSearchChange:d,placeholder:e.search.placeholder,summary:`${a.length} items`,children:e.clearable&&t("button",{type:"button",className:"ss-dbg-btn-clear",onClick:i,children:"Clear"})}),a.length===0?t("div",{className:"ss-dbg-empty",children:"No data"}):t("table",{ref:u,className:"ss-dbg-table",children:[t("thead",{children:t("tr",{children:e.columns.map(f=>t("th",{children:f.label},f.key))})}),t("tbody",{children:a.map((f,p)=>t("tr",{children:e.columns.map(_=>t("td",{children:h(f[_.key],_)},_.key))},f.id??p))})]})]})}const Qr=Object.freeze(Object.defineProperty({__proto__:null,CustomPaneTab:Xt,default:Xt},Symbol.toStringTag,{value:"Module"}))})();
|