django-cfg 1.4.84__py3-none-any.whl → 1.4.86__py3-none-any.whl
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.
Potentially problematic release.
This version of django-cfg might be problematic. Click here for more details.
- django_cfg/__init__.py +1 -1
- django_cfg/apps/dashboard/serializers/__init__.py +55 -0
- django_cfg/apps/dashboard/serializers/activity.py +38 -0
- django_cfg/apps/dashboard/serializers/apizones.py +26 -0
- django_cfg/apps/dashboard/serializers/base.py +16 -0
- django_cfg/apps/dashboard/serializers/charts.py +44 -0
- django_cfg/apps/dashboard/serializers/commands.py +26 -0
- django_cfg/apps/dashboard/serializers/overview.py +34 -0
- django_cfg/apps/dashboard/serializers/statistics.py +46 -0
- django_cfg/apps/dashboard/serializers/system.py +58 -0
- django_cfg/apps/dashboard/services/__init__.py +10 -1
- django_cfg/apps/dashboard/services/apizones_service.py +119 -0
- django_cfg/apps/dashboard/services/charts_service.py +266 -0
- django_cfg/apps/dashboard/services/commands_service.py +142 -0
- django_cfg/apps/dashboard/services/statistics_service.py +262 -104
- django_cfg/apps/dashboard/urls.py +25 -6
- django_cfg/apps/dashboard/views/__init__.py +23 -0
- django_cfg/apps/dashboard/views/activity_views.py +83 -0
- django_cfg/apps/dashboard/views/apizones_views.py +73 -0
- django_cfg/apps/dashboard/views/charts_views.py +159 -0
- django_cfg/apps/dashboard/views/commands_views.py +73 -0
- django_cfg/apps/dashboard/views/overview_views.py +92 -0
- django_cfg/apps/dashboard/views/statistics_views.py +105 -0
- django_cfg/apps/dashboard/views/system_views.py +73 -0
- django_cfg/modules/django_client/core/generator/typescript/templates/fetchers/fetchers.ts.jinja +0 -1
- django_cfg/modules/django_client/core/generator/typescript/templates/fetchers/function.ts.jinja +1 -1
- django_cfg/modules/django_unfold/callbacks/main.py +7 -6
- django_cfg/modules/django_unfold/dashboard.py +1 -36
- django_cfg/modules/django_unfold/models/config.py +102 -73
- django_cfg/modules/django_unfold/tailwind.py +31 -79
- django_cfg/pyproject.toml +1 -1
- django_cfg/static/frontend/admin/404.html +1 -1
- django_cfg/static/frontend/admin/500.html +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/23004-faae121bbfecc163.js +1 -0
- django_cfg/static/frontend/admin/_next/static/chunks/{20695.a7d37b6c40ad3f58.js → 43076.55dd23b6cd68edb0.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/50314-3b9d15242191c8bc.js +1 -0
- django_cfg/static/frontend/admin/_next/static/chunks/{64330.2ef79bccd7d4e363.js → 64330.41858e98c0e5173b.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/6766.8d01e44e83070e83.js +1 -0
- django_cfg/static/frontend/admin/_next/static/chunks/{96168.eb7fdb721b9cdb00.js → 96168.b7197f890097df6e.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/{404-c283223d1afd02a2.js → 404-cf71cd7b3cb005e5.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/{500-389d6d3e1f2f7fda.js → 500-ff19c7842e3df415.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/_app-f62e5528fbcbb6b3.js +272 -0
- django_cfg/static/frontend/admin/_next/static/chunks/pages/{_error-5291033275c26d09.js → _error-87f3fdc2aa131e77.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/{index-d7bc30185f52cbca.js → index-69f737d4802cc5b7.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/private/centrifugo-f24beb6ed3955aa8.js +1 -0
- django_cfg/static/frontend/admin/_next/static/chunks/pages/private/{profile-e93a65e8e7d9022b.js → profile-b8045f993287f1a7.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/private/{ui-669e8f2a785beba2.js → ui-373fff8b42878e64.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/private-fe9faa86ecdb0ce6.js +1 -0
- django_cfg/static/frontend/admin/_next/static/chunks/{webpack-92add5f95c66e349.js → webpack-7c456a65e96eb97e.js} +1 -1
- django_cfg/static/frontend/admin/_next/static/css/5f9a37b6e6a72303.css +3 -0
- django_cfg/static/frontend/admin/_next/static/wg0mGdXjT00H_1BUxoOSH/_buildManifest.js +1 -0
- django_cfg/static/frontend/admin/auth.html +1 -1
- django_cfg/static/frontend/admin/index.html +1 -1
- django_cfg/static/frontend/admin/legal/cookies.html +1 -1
- django_cfg/static/frontend/admin/legal/privacy.html +1 -1
- django_cfg/static/frontend/admin/legal/security.html +1 -1
- django_cfg/static/frontend/admin/legal/terms.html +1 -1
- django_cfg/static/frontend/admin/private/centrifugo.html +1 -1
- django_cfg/static/frontend/admin/private/profile.html +1 -1
- django_cfg/static/frontend/admin/private/ui.html +1 -1
- django_cfg/static/frontend/admin/private.html +1 -1
- django_cfg/templates/admin/index.html +237 -5
- django_cfg/templates/admin/sections/commands_section.html +5 -0
- django_cfg/templates/admin/sections/documentation_section.html +5 -0
- django_cfg/templates/admin/sections/overview_section.html +5 -0
- django_cfg/templates/admin/sections/stats_section.html +5 -0
- django_cfg/templates/admin/sections/system_section.html +5 -0
- django_cfg/templates/admin/sections/widgets_section.html +11 -0
- django_cfg/templates/unfold/layouts/skeleton.html +27 -0
- django_cfg/templatetags/django_cfg.py +53 -0
- {django_cfg-1.4.84.dist-info → django_cfg-1.4.86.dist-info}/METADATA +1 -1
- {django_cfg-1.4.84.dist-info → django_cfg-1.4.86.dist-info}/RECORD +76 -53
- django_cfg/apps/dashboard/api/__init__.py +0 -27
- django_cfg/apps/dashboard/api/serializers.py +0 -165
- django_cfg/apps/dashboard/api/viewsets.py +0 -257
- django_cfg/static/frontend/admin/_next/static/-Zk0eDB7OJOEFrFyR5BwZ/_buildManifest.js +0 -1
- django_cfg/static/frontend/admin/_next/static/chunks/43076-4be6a9794e9c3e8b.js +0 -1
- django_cfg/static/frontend/admin/_next/static/chunks/50314-79c02212788f1ec7.js +0 -1
- django_cfg/static/frontend/admin/_next/static/chunks/6766.d62fed7cd4761148.js +0 -1
- django_cfg/static/frontend/admin/_next/static/chunks/82296-a2c8d38f62224be5.js +0 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/_app-f25bec36bbdc9625.js +0 -272
- django_cfg/static/frontend/admin/_next/static/chunks/pages/private/centrifugo-22532c65971225eb.js +0 -1
- django_cfg/static/frontend/admin/_next/static/chunks/pages/private-a8a9ba76f2c75354.js +0 -1
- django_cfg/static/frontend/admin/_next/static/css/78d677ac1677c210.css +0 -3
- /django_cfg/static/frontend/admin/_next/static/{-Zk0eDB7OJOEFrFyR5BwZ → wg0mGdXjT00H_1BUxoOSH}/_ssgManifest.js +0 -0
- {django_cfg-1.4.84.dist-info → django_cfg-1.4.86.dist-info}/WHEEL +0 -0
- {django_cfg-1.4.84.dist-info → django_cfg-1.4.86.dist-info}/entry_points.txt +0 -0
- {django_cfg-1.4.84.dist-info → django_cfg-1.4.86.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12731],{83953:(e,t,_)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return _(94437)}])},94437:(e,t,_)=>{"use strict";_.r(t),_.d(t,{default:()=>i});var n=_(94513),r=_(56781),s=_(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12731],{83953:(e,t,_)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return _(94437)}])},94437:(e,t,_)=>{"use strict";_.r(t),_.d(t,{default:()=>i});var n=_(94513),r=_(56781),s=_(23252);function u(e){let{statusCode:t}=e;return(0,n.jsx)(s.x$,{code:t,supportEmail:r.W0.contact.email})}u.getInitialProps=s.sL;let i=u}},e=>{e.O(0,[90636,46593,38792],()=>e(e.s=83953)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93332],{6298:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var a=s(94513),i=s(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93332],{6298:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var a=s(94513),i=s(23252),n=s(30512),r=s(94285),l=s(24854),u=s(58380),c=s(17134);let d=()=>{let{isAuthenticated:e}=(0,i.h7)(),t=(0,u.useRouter)();return(0,r.useEffect)(()=>{e?t.push(l.JZ.private.overview):t.push((0,n.OJ)(l.JZ))},[e,t.asPath]),(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-background",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,a.jsx)(c.A,{className:"animate-spin text-primary",style:{width:"48px",height:"48px"}}),(0,a.jsx)("span",{className:"text-lg font-medium text-muted-foreground",children:"Loading..."})]})})};d.pageConfig={title:"Portal"};let h=d},59409:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return s(6298)}])}},e=>{e.O(0,[90636,46593,38792],()=>e(e.s=59409)),_N_E=e.O()}]);
|
django_cfg/static/frontend/admin/_next/static/chunks/pages/private/centrifugo-f24beb6ed3955aa8.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43164],{7737:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},13121:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},47019:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},47857:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},48747:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/private/centrifugo",function(){return a(65745)}])},51352:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},57147:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},65745:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>ew});var t=a(94513),n=a(94285),r=a(77625),l=a(7737),i=a(25365);let c=(0,i.A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),d=(0,i.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var o=a(60299);let x=(0,i.A)("test-tube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);var h=a(50314),m=a(71174);let u=(0,n.createContext)(void 0);function g(e){let{children:s}=e,a=(0,m.NG)(),n=(0,m.kG)(),r=(0,m.UI)(),l=(0,m.AS)(),i=(0,m.hn)(),c=(0,m.IO)(),d=async()=>await a(h.FH),o=async e=>await n(e||{},h.FH),x=async e=>await r(e,h.FH),g=async()=>await l(h.FH),j=async e=>await i(e,h.FH),p=async e=>await c(e,h.FH);return(0,t.jsx)(u.Provider,{value:{getAuthToken:d,listChannels:o,getChannelHistory:x,getServerInfo:g,getPresence:j,getPresenceStats:p},children:s})}function j(){let e=(0,n.useContext)(u);if(!e)throw Error("useCentrifugoAdminApiContext must be used within CentrifugoAdminApiProvider");return e}var p=a(10200);let b=(0,n.createContext)(void 0);function f(e){let{children:s}=e,{data:a,error:n,isLoading:r,mutate:l}=(0,p.xv)(h.FH),{data:i,error:c,isLoading:d,mutate:o}=(0,p.w4)(void 0,h.FH),{data:x,error:m,isLoading:u,mutate:g}=(0,p.uL)(void 0,h.FH),{data:j,error:f,isLoading:v,mutate:N}=(0,p.EF)(void 0,h.FH),y=async()=>{await l()},k=async e=>{await o()},w=async e=>{await g()},C=async e=>{await N()};return(0,t.jsx)(b.Provider,{value:{health:a,isLoadingHealth:r,healthError:n,refreshHealth:y,overview:i,isLoadingOverview:d,overviewError:c,refreshOverview:k,timeline:x,isLoadingTimeline:u,timelineError:m,refreshTimeline:w,publishes:j,isLoadingPublishes:v,publishesError:f,refreshPublishes:C},children:s})}function v(){let e=(0,n.useContext)(b);if(!e)throw Error("useCentrifugoMonitoringContext must be used within CentrifugoMonitoringProvider");return e}var N=a(50638);let y=(0,n.createContext)(void 0);function k(e){let{children:s}=e,a=(0,N.Sq)(),n=(0,N.CH)(),r=(0,N.VD)(),l=(0,N.oE)(),i=async e=>await a(e,h.FH),c=async e=>await n(e,h.FH),d=async e=>await r(e,h.FH),o=async e=>await l(e,h.FH);return(0,t.jsx)(y.Provider,{value:{generateConnectionToken:i,publishTest:c,publishWithLogging:d,sendAck:o},children:s})}function w(){let e=(0,n.useContext)(y);if(!e)throw Error("useCentrifugoTestingContext must be used within CentrifugoTestingProvider");return e}var C=a(71964);let A=(0,n.createContext)(void 0);function S(e){let{children:s}=e,{generateConnectionToken:a,publishTest:l}=w(),[i,c]=(0,n.useState)(!1),[d,o]=(0,n.useState)(!1),[x,h]=(0,n.useState)(null),[m,u]=(0,n.useState)(null),[g,j]=(0,n.useState)([]),[p,b]=(0,n.useState)(new Map),[f,v]=(0,n.useState)(0),N=(0,n.useRef)(null),y=(0,n.useRef)(0),k=(0,n.useCallback)(e=>{j(s=>[{...e,id:"event-".concat(y.current++),timestamp:new Date},...s].slice(0,100))},[]),S=(0,n.useCallback)(async()=>{if(!N.current&&!d){o(!0),h(null);try{let e=await a({user_id:"test-user",channels:[]}),s=e.centrifugo_url,t=new C.Ft(s,{token:e.token});t.on("connected",e=>{console.log("✅ Connected to Centrifugo:",e),c(!0),o(!1),u(new Date),k({type:"connected",message:"Connected to Centrifugo server",data:e})}),t.on("disconnected",e=>{console.warn("⚠️ Disconnected from Centrifugo:",e),c(!1),o(!1),u(null),v(0),k({type:"disconnected",message:"Disconnected: ".concat(e.reason),data:e})}),t.on("error",e=>{console.error("❌ Centrifugo error:",e),h(e.error.message),k({type:"error",message:"Error: ".concat(e.error.message),data:e})}),t.connect(),N.current=t,k({type:"info",message:"Connecting to Centrifugo..."})}catch(e){console.error("Failed to connect:",e),o(!1),h(e.message),k({type:"error",message:"Connection failed: ".concat(e.message)})}}},[d,a,k]),M=(0,n.useCallback)(()=>{N.current&&(p.forEach(e=>{e.subscription.unsubscribe()}),b(new Map),N.current.disconnect(),N.current=null,c(!1),k({type:"info",message:"Disconnected from Centrifugo"}))},[p,k]),E=(0,n.useCallback)(async e=>{let s=N.current;if(!s||!i)throw Error("Not connected to Centrifugo");if(p.has(e))return void k({type:"info",channel:e,message:"Already subscribed to ".concat(e)});let a=s.newSubscription(e);a.on("subscribed",s=>{console.log("✅ Subscribed to ".concat(e,":"),s),k({type:"subscribed",channel:e,message:"Subscribed to ".concat(e),data:s})}),a.on("unsubscribed",s=>{console.log("⚠️ Unsubscribed from ".concat(e,":"),s),k({type:"unsubscribed",channel:e,message:"Unsubscribed from ".concat(e),data:s})}),a.on("publication",s=>{console.log("\uD83D\uDCE9 Message on ".concat(e,":"),s.data),v(e=>e+1),b(a=>{let t=new Map(a),n=t.get(e);return n&&(n.lastMessage=s.data,n.messageCount++),t}),k({type:"publication",channel:e,message:"Received message on ".concat(e),data:s.data})}),a.on("error",s=>{console.error("❌ Subscription error on ".concat(e,":"),s),k({type:"error",channel:e,message:"Subscription error: ".concat(s.error.message),data:s})}),a.subscribe(),b(s=>{let t=new Map(s);return t.set(e,{channel:e,subscription:a,messageCount:0}),t})},[i,p,k]),_=(0,n.useCallback)(e=>{let s=p.get(e);s&&(s.subscription.unsubscribe(),b(s=>{let a=new Map(s);return a.delete(e),a}),k({type:"info",channel:e,message:"Unsubscribed from ".concat(e)}))},[p,k]),F=(0,n.useCallback)(()=>{p.forEach(e=>{e.subscription.unsubscribe()}),b(new Map),k({type:"info",message:"Unsubscribed from all channels"})},[p,k]),D=(0,n.useCallback)(async(e,s)=>{if(!i)throw Error("Not connected to Centrifugo");await l({channel:e,data:s,wait_for_ack:!1,ack_timeout:5}),k({type:"info",channel:e,message:"Published message to ".concat(e),data:s})},[i,l,k]),L=(0,n.useCallback)(()=>{j([])},[]),P=[{id:"simple-notification",name:"Simple Notification",description:"Fire-and-forget notification to user#test-123",channel:"user#test-123",icon:"notifications",color:"blue",action:async()=>{await E("user#test-123"),await D("user#test-123",{type:"notification",title:"Test Notification",message:"This is a simple test notification"})}},{id:"ack-notification",name:"ACK Required",description:"Message with acknowledgment tracking",channel:"user#test-123",icon:"check_circle",color:"green",action:async()=>{await E("user#test-123"),await l({channel:"user#test-123",data:{type:"notification",title:"ACK Test",message:"Please acknowledge this message"},wait_for_ack:!0,ack_timeout:10})}},{id:"broadcast",name:"Team Broadcast",description:"Broadcast to team#developers channel",channel:"team#developers",icon:"campaign",color:"orange",action:async()=>{await E("team#developers"),await D("team#developers",{type:"announcement",title:"Team Update",message:"New deployment is ready!"})}}],T=(0,n.useCallback)(async e=>{if(!i)return void(0,r.oRP)({title:"Not Connected",description:"Please connect to Centrifugo first",variant:"destructive"});let s=P.find(s=>s.id===e);if(!s)return void(0,r.oRP)({title:"Scenario Not Found",description:"Scenario not found: ".concat(e),variant:"destructive"});k({type:"info",message:"Running scenario: ".concat(s.name)}),await s.action()},[i,k,P]),I={isConnected:i,isConnecting:d,connectionError:x,connectionTime:m,centrifuge:N.current,connect:S,disconnect:M,subscriptions:p,subscribe:E,unsubscribe:_,unsubscribeAll:F,publish:D,events:g,clearEvents:L,totalMessagesReceived:f,quickScenarios:P,runScenario:T};return(0,t.jsx)(A.Provider,{value:I,children:s})}function M(){let e=(0,n.useContext)(A);if(!e)throw Error("useCentrifugoLiveTestingContext must be used within CentrifugoLiveTestingProvider");return e}var E=a(47857);let _=(0,i.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var F=a(47019);let D=()=>{let{health:e,isLoadingHealth:s,healthError:a}=v();if(s)return(0,t.jsx)(r.FcD,{children:(0,t.jsx)(r.EAD,{className:"h-4 w-full"})});if(a)return(0,t.jsxs)(r.FcD,{variant:"destructive",children:[(0,t.jsx)(E.A,{className:"h-4 w-4"}),(0,t.jsx)(r.XL1,{children:"Health Check Failed"}),(0,t.jsx)(r.TND,{children:"Unable to connect to Centrifugo monitoring service."})]});if(!e)return null;let n="healthy"===e.status;return(0,t.jsxs)(r.FcD,{variant:n?"default":"destructive",children:[n?(0,t.jsx)(_,{className:"h-4 w-4 text-green-600"}):(0,t.jsx)(F.A,{className:"h-4 w-4"}),(0,t.jsxs)(r.XL1,{className:"flex items-center gap-2",children:["System Status",n?(0,t.jsx)(r.Exy,{variant:"default",className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Healthy"}):(0,t.jsx)(r.Exy,{variant:"destructive",children:"Issues Detected"})]}),(0,t.jsxs)(r.TND,{className:"mt-2 space-y-2",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:"Wrapper URL:"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e.wrapper_url||"Not configured"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:"API Key:"}),e.has_api_key?(0,t.jsx)(r.Exy,{variant:"default",className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Configured"}):(0,t.jsx)(r.Exy,{variant:"destructive",children:"Not configured"})]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Last checked: ",new Date(e.timestamp).toLocaleString()]})]})]})},L=(0,i.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var P=a(80574);let T=()=>{let{overview:e,isLoadingOverview:s}=v(),a=(0,n.useMemo)(()=>{if(!e)return{total:0,successful:0,failed:0,timeout:0,successRate:0,avgDuration:0};let{total:s,successful:a,failed:t,timeout:n,success_rate:r,avg_duration_ms:l}=e;return{total:s,successful:a,failed:t+n,timeout:n,successRate:Math.round(r||0),avgDuration:Math.round(l||0)}},[e]);return s?(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[void 0,void 0,void 0,void 0].map((e,s)=>(0,t.jsx)(r.ZpM,{children:(0,t.jsx)(r.Wux,{className:"p-6",children:(0,t.jsx)(r.EAD,{className:"h-20 w-full"})})},s))}):(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)(L,{className:"h-8 w-8 text-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Today"})]}),(0,t.jsx)("h3",{className:"text-2xl font-bold mb-1",children:a.total.toLocaleString()}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Total Publishes"})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)(_,{className:"h-8 w-8 text-green-500"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Rate"})]}),(0,t.jsxs)("h3",{className:"text-2xl font-bold mb-1",children:[a.successRate,(0,t.jsx)("span",{className:"text-lg text-muted-foreground",children:"%"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Success Rate"})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)(P.A,{className:"h-8 w-8 text-yellow-500"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Average"})]}),(0,t.jsxs)("h3",{className:"text-2xl font-bold mb-1",children:[a.avgDuration,(0,t.jsx)("span",{className:"text-lg text-muted-foreground",children:"ms"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Avg Duration"})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)(E.A,{className:"h-8 w-8 text-red-500"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Issues"})]}),(0,t.jsx)("h3",{className:"text-2xl font-bold mb-1",children:a.failed.toLocaleString()}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Failed/Timeout"})]})})]})};var I=a(79145);let O=(0,i.A)("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);var H=a(69673);let R=()=>{var e;let{overview:s,timeline:a,isLoadingOverview:l,isLoadingTimeline:i}=v(),c=(0,n.useMemo)(()=>{if(!s)return{totalAcks:0,avgAcks:"0.0",ackRate:0};let e=s.avg_acks_received||0,a=s.total||0,t=Math.round(e*a);return{totalAcks:t,avgAcks:e.toFixed(1),ackRate:a>0?Math.round(e/a*100):0}},[s]);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)(r.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(I.A,{className:"h-5 w-5 text-purple-500"}),"Publish Timeline (24h)"]})}),(0,t.jsx)(r.Wux,{children:i?(0,t.jsx)(r.EAD,{className:"h-[200px] w-full"}):(0,t.jsxs)("div",{className:"h-[200px] flex items-center justify-center text-muted-foreground",children:["Chart visualization placeholder",(0,t.jsx)("br",{}),(0,t.jsxs)("span",{className:"text-xs mt-2",children:[(null==a||null==(e=a.channels)?void 0:e.length)||0," channels available"]})]})})]}),(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)(r.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(O,{className:"h-5 w-5 text-purple-500"}),"Success/Failure Breakdown"]})}),(0,t.jsx)(r.Wux,{children:l?(0,t.jsx)(r.EAD,{className:"h-[200px] w-full"}):(0,t.jsx)("div",{className:"h-[200px] flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-center",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-3xl font-bold text-green-600",children:(null==s?void 0:s.successful)||0}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Success"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-3xl font-bold text-red-600",children:((null==s?void 0:s.failed)||0)+((null==s?void 0:s.timeout)||0)}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Failed"})]})]})})})})]})]}),(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)(r.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(H.A,{className:"h-5 w-5 text-purple-500"}),"ACK Statistics"]})}),(0,t.jsx)(r.Wux,{children:l?(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[void 0,void 0,void 0].map((e,s)=>(0,t.jsx)(r.EAD,{className:"h-20 w-full"},s))}):(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-4",children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"Total ACKs Received"}),(0,t.jsx)("div",{className:"text-2xl font-bold",children:c.totalAcks.toLocaleString()})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-4",children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"Avg ACKs per Publish"}),(0,t.jsx)("div",{className:"text-2xl font-bold",children:c.avgAcks})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-4",children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"ACK Tracking Rate"}),(0,t.jsxs)("div",{className:"text-2xl font-bold",children:[c.ackRate,"%"]})]})})]})})]})]})};var z=a(51352);let B=()=>{var e,s;let{publishes:a,isLoadingPublishes:l,refreshPublishes:i}=v(),[c,d]=(0,n.useState)("all"),[o,x]=(0,n.useState)("all"),[h,m]=(0,n.useState)(0),u=(0,n.useMemo)(()=>(null==a?void 0:a.publishes)?Array.from(new Set(a.publishes.map(e=>e.channel))):[],[a]),g=()=>{i({channel:"all"!==c?c:void 0,status:"all"!==o?o:void 0,offset:h,count:50})};return(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(r.ZBx,{children:"Recent Publishes"}),(0,t.jsxs)(r.$nd,{onClick:g,variant:"outline",size:"sm",disabled:l,children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2"}),"Refresh"]})]})}),(0,t.jsxs)(r.Wux,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 mb-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-[200px]",children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Filter by Channel"}),(0,t.jsxs)(r.l6P,{value:c,onValueChange:d,children:[(0,t.jsx)(r.bqE,{children:(0,t.jsx)(r.yvm,{placeholder:"All Channels"})}),(0,t.jsxs)(r.gCo,{children:[(0,t.jsx)(r.ebT,{value:"all",children:"All Channels"}),u.map(e=>(0,t.jsx)(r.ebT,{value:e,children:e},e))]})]})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-[200px]",children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Filter by Status"}),(0,t.jsxs)(r.l6P,{value:o,onValueChange:x,children:[(0,t.jsx)(r.bqE,{children:(0,t.jsx)(r.yvm,{placeholder:"All Statuses"})}),(0,t.jsxs)(r.gCo,{children:[(0,t.jsx)(r.ebT,{value:"all",children:"All Statuses"}),(0,t.jsx)(r.ebT,{value:"success",children:"Success"}),(0,t.jsx)(r.ebT,{value:"failed",children:"Failed"}),(0,t.jsx)(r.ebT,{value:"timeout",children:"Timeout"})]})]})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)(r.$nd,{onClick:g,children:"Apply Filters"})})]}),l?(0,t.jsx)(r.EAD,{className:"h-[400px] w-full"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.XIK,{children:[(0,t.jsx)(r.A0N,{children:(0,t.jsxs)(r.Hjg,{children:[(0,t.jsx)(r.ndF,{children:"Timestamp"}),(0,t.jsx)(r.ndF,{children:"Message ID"}),(0,t.jsx)(r.ndF,{children:"Channel"}),(0,t.jsx)(r.ndF,{children:"Status"}),(0,t.jsx)(r.ndF,{children:"ACKs"}),(0,t.jsx)(r.ndF,{children:"Duration"})]})}),(0,t.jsx)(r.BFY,{children:(null==a||null==(e=a.publishes)?void 0:e.length)===0?(0,t.jsx)(r.Hjg,{children:(0,t.jsx)(r.nA6,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"No publishes found"})}):null==a||null==(s=a.publishes)?void 0:s.map(e=>{var s;return(0,t.jsxs)(r.Hjg,{children:[(0,t.jsx)(r.nA6,{children:new Date(e.created_at).toLocaleString()}),(0,t.jsxs)(r.nA6,{className:"font-mono text-xs",children:[null==(s=e.message_id)?void 0:s.substring(0,8),"..."]}),(0,t.jsx)(r.nA6,{children:e.channel}),(0,t.jsx)(r.nA6,{children:(e=>{switch(e){case"success":return(0,t.jsx)(r.Exy,{variant:"default",className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Success"});case"failed":return(0,t.jsx)(r.Exy,{variant:"destructive",children:"Failed"});case"timeout":return(0,t.jsx)(r.Exy,{variant:"secondary",children:"Timeout"});default:return(0,t.jsx)(r.Exy,{children:e})}})(e.status)}),(0,t.jsx)(r.nA6,{children:e.acks_received||0}),(0,t.jsxs)(r.nA6,{children:[e.duration_ms,"ms"]})]},e.id)})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center mt-4",children:[(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Showing ",(null==a?void 0:a.count)||0," of ",(null==a?void 0:a.total_available)||0," publishes"]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.$nd,{onClick:()=>{let e=Math.max(0,h-50);m(e),i({channel:"all"!==c?c:void 0,status:"all"!==o?o:void 0,offset:e,count:50})},variant:"outline",size:"sm",disabled:0===h,children:"Previous"}),(0,t.jsx)(r.$nd,{onClick:()=>{let e=h+50;m(e),i({channel:"all"!==c?c:void 0,status:"all"!==o?o:void 0,offset:e,count:50})},variant:"outline",size:"sm",disabled:!(null==a?void 0:a.has_more),children:"Next"})]})]})]})]})]})},Z=(0,i.A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var G=a(73548);let W={OPEN_PUBLISH_TEST_DIALOG:"OPEN_PUBLISH_TEST_DIALOG",OPEN_PUBLISH_WITH_LOGGING_DIALOG:"OPEN_PUBLISH_WITH_LOGGING_DIALOG",OPEN_SEND_ACK_DIALOG:"OPEN_SEND_ACK_DIALOG",OPEN_CHANNEL_HISTORY_DIALOG:"OPEN_CHANNEL_HISTORY_DIALOG",OPEN_CHANNEL_PRESENCE_DIALOG:"OPEN_CHANNEL_PRESENCE_DIALOG",REFRESH_PUBLISHES:"REFRESH_PUBLISHES"},K=()=>{let{timeline:e,isLoadingTimeline:s,refreshTimeline:a}=v(),n=(null==e?void 0:e.channels)||[];return(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(r.ZBx,{children:"Channel Statistics"}),(0,t.jsxs)(r.$nd,{onClick:()=>a(),variant:"outline",size:"sm",disabled:s,children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2"}),"Refresh"]})]})}),(0,t.jsx)(r.Wux,{children:s?(0,t.jsx)(r.EAD,{className:"h-[400px] w-full"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.XIK,{children:[(0,t.jsx)(r.A0N,{children:(0,t.jsxs)(r.Hjg,{children:[(0,t.jsx)(r.ndF,{children:"Channel"}),(0,t.jsx)(r.ndF,{children:"Total Publishes"}),(0,t.jsx)(r.ndF,{children:"Success Rate"}),(0,t.jsx)(r.ndF,{children:"Avg Duration"}),(0,t.jsx)(r.ndF,{children:"Avg ACKs"}),(0,t.jsx)(r.ndF,{children:"Last Activity"}),(0,t.jsx)(r.ndF,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(r.BFY,{children:0===n.length?(0,t.jsx)(r.Hjg,{children:(0,t.jsx)(r.nA6,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"No channel data available"})}):n.map(e=>{var s;let a=e.total>0?Math.round(e.successful/e.total*100):0;return(0,t.jsxs)(r.Hjg,{children:[(0,t.jsx)(r.nA6,{className:"font-medium",children:e.channel}),(0,t.jsx)(r.nA6,{children:e.total.toLocaleString()}),(0,t.jsxs)(r.nA6,{children:[a,"%"]}),(0,t.jsxs)(r.nA6,{children:[Math.round(e.avg_duration_ms),"ms"]}),(0,t.jsx)(r.nA6,{children:(null==(s=e.avg_acks)?void 0:s.toFixed(1))||"0.0"}),(0,t.jsx)(r.nA6,{children:e.last_activity_at?new Date(e.last_activity_at).toLocaleString():"N/A"}),(0,t.jsxs)(r.nA6,{className:"text-right space-x-2",children:[(0,t.jsx)(r.$nd,{variant:"ghost",size:"sm",onClick:()=>{var s;return s={channel:e.channel},void r.AZP.publish({type:W.OPEN_CHANNEL_HISTORY_DIALOG,payload:s})},children:(0,t.jsx)(Z,{className:"h-4 w-4"})}),(0,t.jsx)(r.$nd,{variant:"ghost",size:"sm",onClick:()=>{var s;return s={channel:e.channel},void r.AZP.publish({type:W.OPEN_CHANNEL_PRESENCE_DIALOG,payload:s})},children:(0,t.jsx)(G.A,{className:"h-4 w-4"})})]})]},e.channel)})})]}),(0,t.jsx)("div",{className:"mt-4 text-sm text-muted-foreground",children:"Showing statistics for the last 24 hours"})]})})]})};var U=a(74564);let V=()=>{var e;let{listChannels:s}=j(),[a,l]=(0,n.useState)(null),[i,c]=(0,n.useState)(""),[d,o]=(0,n.useState)(!1),x=async()=>{o(!0);try{let e=await s(i?{pattern:i}:void 0);l(e)}catch(e){console.error("Failed to load channels:",e)}finally{o(!1)}};return(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsx)(r.ZBx,{children:"Live Channels"})}),(0,t.jsx)(r.Wux,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.pde,{placeholder:"Channel pattern (e.g., user:*)",value:i,onChange:e=>c(e.target.value),className:"flex-1"}),(0,t.jsxs)(r.$nd,{onClick:x,disabled:d,children:[(0,t.jsx)(U.A,{className:"h-4 w-4 mr-2"}),"Load Channels"]})]}),a&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Found ",(null==(e=a.channels)?void 0:e.length)||0," active channels"]}),(0,t.jsxs)(r.$nd,{onClick:x,variant:"outline",size:"sm",disabled:d,children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),a.channels&&a.channels.length>0?(0,t.jsxs)(r.XIK,{children:[(0,t.jsx)(r.A0N,{children:(0,t.jsxs)(r.Hjg,{children:[(0,t.jsx)(r.ndF,{children:"Channel"}),(0,t.jsx)(r.ndF,{children:"Status"})]})}),(0,t.jsx)(r.BFY,{children:a.channels.map(e=>(0,t.jsxs)(r.Hjg,{children:[(0,t.jsx)(r.nA6,{className:"font-medium",children:e}),(0,t.jsx)(r.nA6,{children:(0,t.jsx)(r.Exy,{variant:"default",className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Active"})})]},e))})]}):(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:"No active channels found"})]}),!a&&(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:'Click "Load Channels" to view active channels'})]})})]})},$=(0,i.A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var q=a(57147);let X=()=>{let{quickScenarios:e,runScenario:s,isConnected:a}=M(),[l,i]=(0,n.useState)(null),c=async e=>{i(e);try{await s(e)}catch(e){console.error("Failed to run scenario:",e)}finally{i(null)}};return(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(q.A,{className:"h-5 w-5 text-yellow-500"}),(0,t.jsx)(r.ZBx,{children:"Quick Test Scenarios"})]}),a&&(0,t.jsx)(r.Exy,{variant:"outline",className:"bg-green-50 dark:bg-green-950/20 text-green-700 dark:text-green-300 border-green-200 dark:border-green-800",children:"Connected"})]})}),(0,t.jsxs)(r.Wux,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"One-click test scenarios that automatically connect, subscribe, and publish test messages."}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>{let s=(e=>{let s={blue:{bg:"bg-blue-50 dark:bg-blue-950/20",border:"border-blue-200 dark:border-blue-800",icon:"text-blue-500",button:"bg-blue-600 hover:bg-blue-700"},green:{bg:"bg-green-50 dark:bg-green-950/20",border:"border-green-200 dark:border-green-800",icon:"text-green-500",button:"bg-green-600 hover:bg-green-700"},orange:{bg:"bg-orange-50 dark:bg-orange-950/20",border:"border-orange-200 dark:border-orange-800",icon:"text-orange-500",button:"bg-orange-600 hover:bg-orange-700"},purple:{bg:"bg-purple-50 dark:bg-purple-950/20",border:"border-purple-200 dark:border-purple-800",icon:"text-purple-500",button:"bg-purple-600 hover:bg-purple-700"}};return s[e]||s.blue})(e.color),a=l===e.id;return(0,t.jsx)(r.ZpM,{className:"".concat(s.bg," border ").concat(s.border),children:(0,t.jsxs)(r.Wux,{className:"p-4",children:[(0,t.jsx)("div",{className:"flex items-start justify-between mb-3",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h4",{className:"font-semibold mb-1",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})}),(0,t.jsx)("div",{className:"bg-background/50 rounded p-2 mb-3 border border-border",children:(0,t.jsxs)("code",{className:"text-xs",children:["→ Connect",(0,t.jsx)("br",{}),"→ Subscribe to ",e.channel,(0,t.jsx)("br",{}),"→ Publish message",(0,t.jsx)("br",{}),"→ Receive immediately"]})}),(0,t.jsxs)(r.$nd,{onClick:()=>c(e.id),disabled:a,className:"w-full ".concat(s.button," text-white"),size:"sm",children:[(0,t.jsx)($,{className:"h-4 w-4 mr-2"}),a?"Running...":"Run Scenario"]})]})},e.id)})})]})]})},Y=(0,i.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var J=a(13121);let Q=()=>{let{events:e,clearEvents:s}=M(),a=(0,n.useRef)(null),[i,c]=(0,n.useState)(!0),[d,o]=(0,n.useState)(""),[x,h]=(0,n.useState)([]);(0,n.useEffect)(()=>{i&&a.current&&(a.current.scrollTop=a.current.scrollHeight)},[e,i]);let m=(0,n.useMemo)(()=>{let s=[...e].reverse();if(x.length>0&&(s=s.filter(e=>x.includes(e.type))),d.trim()){let e=d.toLowerCase();s=s.filter(s=>{var a;return s.message.toLowerCase().includes(e)||(null==(a=s.channel)?void 0:a.toLowerCase().includes(e))||JSON.stringify(s.data).toLowerCase().includes(e)})}return s},[e,x,d]),u=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return(0,t.jsxs)(r.ZpM,{children:[(0,t.jsxs)(r.aRn,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.A,{className:"h-5 w-5 text-purple-500"}),(0,t.jsx)(r.ZBx,{children:"Live Event Log"}),(0,t.jsxs)(r.Exy,{variant:"outline",children:[e.length," total"]}),m.length!==e.length&&(0,t.jsxs)(r.Exy,{variant:"outline",className:"bg-blue-50 dark:bg-blue-950/20 text-blue-700 dark:text-blue-300",children:[m.length," filtered"]})]}),(0,t.jsx)("div",{className:"flex gap-2",children:e.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.$nd,{variant:"outline",size:"sm",onClick:()=>{let e=new Blob([m.map(e=>"[".concat(u(e.timestamp),"] ").concat(e.type.toUpperCase()).concat(e.channel?" [".concat(e.channel,"]"):"",": ").concat(e.message)).join("\n")],{type:"text/plain"}),s=URL.createObjectURL(e),a=document.createElement("a");a.href=s,a.download="centrifugo-logs-".concat(Date.now(),".txt"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)},children:[(0,t.jsx)(Y,{className:"h-4 w-4 mr-2"}),"Export"]}),(0,t.jsxs)(r.$nd,{variant:"outline",size:"sm",onClick:s,children:[(0,t.jsx)(J.A,{className:"h-4 w-4 mr-2"}),"Clear"]})]})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(U.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(r.pde,{placeholder:"Search events...",value:d,onChange:e=>o(e.target.value),className:"pl-9"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)(r.OY8,{type:"multiple",value:x,onValueChange:e=>{h(e)},className:"flex-wrap justify-start",children:[(0,t.jsx)(r.dzE,{value:"error",size:"sm",className:"text-xs",children:"❌ Error"}),(0,t.jsx)(r.dzE,{value:"publication",size:"sm",className:"text-xs",children:"\uD83D\uDCE9 Pub"}),(0,t.jsx)(r.dzE,{value:"connected",size:"sm",className:"text-xs",children:"\uD83D\uDFE2 Conn"}),(0,t.jsx)(r.dzE,{value:"disconnected",size:"sm",className:"text-xs",children:"\uD83D\uDD34 Disc"}),(0,t.jsx)(r.dzE,{value:"subscribed",size:"sm",className:"text-xs",children:"\uD83D\uDCE1 Sub"}),(0,t.jsx)(r.dzE,{value:"unsubscribed",size:"sm",className:"text-xs",children:"\uD83D\uDCF4 Unsub"}),(0,t.jsx)(r.dzE,{value:"info",size:"sm",className:"text-xs",children:"ℹ️ Info"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,t.jsx)(r.dOG,{id:"auto-scroll",checked:i,onCheckedChange:c}),(0,t.jsx)("label",{htmlFor:"auto-scroll",className:"text-sm text-muted-foreground whitespace-nowrap cursor-pointer",children:"Auto-scroll"})]})]})]})]}),(0,t.jsx)(r.Wux,{children:(0,t.jsx)(r.FKN,{className:"h-[400px] w-full rounded-md border border-border bg-muted/20 p-4",ref:a,children:0===m.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,t.jsx)(l.A,{className:"h-12 w-12 mb-2 opacity-20"}),(0,t.jsx)("p",{className:"text-sm",children:0===e.length?"No events yet. Connect to Centrifugo to see real-time events.":"No events match your filters."})]}):(0,t.jsx)("div",{className:"space-y-2 font-mono text-xs",children:m.map(e=>{let s={connected:{badge:"bg-green-100 dark:bg-green-950/50 text-green-700 dark:text-green-300 border-green-300 dark:border-green-800",icon:"\uD83D\uDFE2",text:"text-green-700 dark:text-green-300"},disconnected:{badge:"bg-red-100 dark:bg-red-950/50 text-red-700 dark:text-red-300 border-red-300 dark:border-red-800",icon:"\uD83D\uDD34",text:"text-red-700 dark:text-red-300"},subscribed:{badge:"bg-blue-100 dark:bg-blue-950/50 text-blue-700 dark:text-blue-300 border-blue-300 dark:border-blue-800",icon:"\uD83D\uDCE1",text:"text-blue-700 dark:text-blue-300"},unsubscribed:{badge:"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-700",icon:"\uD83D\uDCF4",text:"text-gray-700 dark:text-gray-300"},publication:{badge:"bg-purple-100 dark:bg-purple-950/50 text-purple-700 dark:text-purple-300 border-purple-300 dark:border-purple-800",icon:"\uD83D\uDCE9",text:"text-purple-700 dark:text-purple-300"},error:{badge:"bg-red-100 dark:bg-red-950/50 text-red-700 dark:text-red-300 border-red-300 dark:border-red-800",icon:"❌",text:"text-red-700 dark:text-red-300"},info:{badge:"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-700",icon:"ℹ️",text:"text-gray-700 dark:text-gray-300"}}[e.type];return(0,t.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded bg-background/50 border border-border hover:bg-background/80 transition-colors",children:[(0,t.jsx)("span",{className:"text-base flex-shrink-0",children:s.icon}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground flex-shrink-0",children:u(e.timestamp)}),(0,t.jsx)(r.Exy,{variant:"outline",className:"".concat(s.badge," text-xs flex-shrink-0"),children:e.type}),e.channel&&(0,t.jsx)(r.Exy,{variant:"outline",className:"text-xs flex-shrink-0",children:e.channel})]}),(0,t.jsx)("p",{className:"".concat(s.text," break-words"),children:e.message}),e.data&&(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:"View data"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted rounded text-[10px] overflow-x-auto",children:JSON.stringify(e.data,null,2)})]})]})]},e.id)})})})})]})},ee=(0,i.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),es=(0,i.A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),ea=()=>{let{subscriptions:e,subscribe:s,unsubscribe:a,unsubscribeAll:l,publish:i,isConnected:c}=M(),[d,x]=(0,n.useState)(""),[h,m]=(0,n.useState)(!1),[u,g]=(0,n.useState)(null),[j,p]=(0,n.useState)({}),b=async()=>{if(d.trim()){m(!0);try{await s(d.trim()),x("")}catch(e){console.error("Failed to subscribe:",e)}finally{m(!1)}}},f=async e=>{let s=j[e]||"";if(s.trim()){g(e);try{let a;try{a=JSON.parse(s)}catch(e){a=s}await i(e,a),p(s=>({...s,[e]:""}))}catch(e){console.error("Failed to publish:",e)}finally{g(null)}}},v=Array.from(e.values());return(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.A,{className:"h-5 w-5 text-blue-500"}),(0,t.jsx)(r.ZBx,{children:"Active Subscriptions"}),(0,t.jsxs)(r.Exy,{variant:"outline",children:[v.length," channels"]})]}),v.length>0&&(0,t.jsxs)(r.$nd,{variant:"outline",size:"sm",onClick:l,children:[(0,t.jsx)(J.A,{className:"h-4 w-4 mr-2"}),"Unsubscribe All"]})]})}),(0,t.jsxs)(r.Wux,{children:[(0,t.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,t.jsx)(r.pde,{placeholder:"Channel name (e.g., user#123, team#dev)",value:d,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"!==e.key||h||b()},disabled:!c||h,className:"flex-1"}),(0,t.jsxs)(r.$nd,{onClick:b,disabled:!c||h||!d.trim(),size:"sm",children:[(0,t.jsx)(ee,{className:"h-4 w-4 mr-2"}),"Subscribe"]})]}),!c&&(0,t.jsxs)("div",{className:"flex items-center justify-center p-6 text-muted-foreground text-sm bg-muted/20 rounded border border-border",children:[(0,t.jsx)(o.A,{className:"h-8 w-8 mr-2 opacity-20"}),(0,t.jsx)("p",{children:"Connect to Centrifugo to manage subscriptions"})]}),c&&0===v.length&&(0,t.jsxs)("div",{className:"flex items-center justify-center p-6 text-muted-foreground text-sm bg-muted/20 rounded border border-border",children:[(0,t.jsx)(es,{className:"h-8 w-8 mr-2 opacity-20"}),(0,t.jsx)("p",{children:"No active subscriptions. Subscribe to a channel to start receiving messages."})]}),v.length>0&&(0,t.jsx)("div",{className:"space-y-2",children:v.map(e=>{var s;return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 rounded border border-border bg-background/50 hover:bg-background transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,t.jsx)(o.A,{className:"h-4 w-4 text-green-500 flex-shrink-0 animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("code",{className:"text-sm font-mono font-semibold truncate",children:e.channel}),(0,t.jsxs)(r.Exy,{variant:"outline",className:"text-xs flex-shrink-0",children:[e.messageCount," ",1===e.messageCount?"message":"messages"]})]}),e.lastMessage&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground truncate",children:["Last: ","string"==typeof e.lastMessage?e.lastMessage:JSON.stringify(e.lastMessage).slice(0,50),"..."]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsxs)(r.AMh,{children:[(0,t.jsx)(r.Wvm,{asChild:!0,children:(0,t.jsx)(r.$nd,{variant:"ghost",size:"sm",children:(0,t.jsx)(L,{className:"h-4 w-4"})})}),(0,t.jsx)(r.hlN,{className:"w-80",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold text-sm mb-1",children:"Quick Publish"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Send a message to ",(0,t.jsx)("code",{className:"text-xs",children:e.channel})]})]}),(0,t.jsx)(r.TMX,{placeholder:'{"type": "notification", "message": "Hello!"}',value:j[e.channel]||"",onChange:s=>p(a=>({...a,[e.channel]:s.target.value})),rows:4,className:"font-mono text-xs"}),(0,t.jsxs)(r.$nd,{onClick:()=>f(e.channel),disabled:!(null==(s=j[e.channel])?void 0:s.trim())||u===e.channel,className:"w-full",size:"sm",children:[(0,t.jsx)(L,{className:"h-4 w-4 mr-2"}),u===e.channel?"Sending...":"Send Message"]})]})})]}),(0,t.jsx)(r.$nd,{variant:"ghost",size:"sm",onClick:()=>{a(e.channel)},children:(0,t.jsx)(J.A,{className:"h-4 w-4"})})]})]},e.channel)})})]})]})},et=(0,i.A)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),en=(0,i.A)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),er=()=>{let{isConnected:e,isConnecting:s,connectionTime:a,subscriptions:l,totalMessagesReceived:i}=M(),[c,d]=(0,n.useState)("--:--:--");return(0,n.useEffect)(()=>{if(!a||!e)return void d("--:--:--");let s=()=>{let e=Math.floor((new Date().getTime()-a.getTime())/1e3),s=Math.floor(e/3600),t=Math.floor(e%3600/60);d("".concat(s.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0"),":").concat((e%60).toString().padStart(2,"0")))};s();let t=setInterval(s,1e3);return()=>clearInterval(t)},[a,e]),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s?(0,t.jsx)(et,{className:"h-4 w-4 animate-pulse"}):e?(0,t.jsx)(et,{className:"h-4 w-4"}):(0,t.jsx)(en,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-semibold text-sm",children:"Connection Status"})]}),(0,t.jsxs)(r.Exy,{variant:"outline",className:"".concat(e?"bg-green-50 dark:bg-green-950/20 text-green-700 dark:text-green-300 border-green-300 dark:border-green-800":"bg-red-50 dark:bg-red-950/20 text-red-700 dark:text-red-300 border-red-300 dark:border-red-800"),children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(s?"bg-yellow-500":e?"bg-green-500":"bg-red-500"," mr-2 ").concat(e?"animate-pulse":"")}),s?"Connecting...":e?"Connected":"Disconnected"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center p-3 rounded-lg bg-muted/30 border border-border",children:[(0,t.jsx)(P.A,{className:"h-5 w-5 text-blue-500 mb-1"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1",children:"Uptime"}),(0,t.jsx)("span",{className:"text-lg font-mono font-semibold",children:c})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center p-3 rounded-lg bg-muted/30 border border-border",children:[(0,t.jsx)(es,{className:"h-5 w-5 text-purple-500 mb-1"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1",children:"Messages"}),(0,t.jsx)("span",{className:"text-lg font-mono font-semibold",children:i})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center p-3 rounded-lg bg-muted/30 border border-border",children:[(0,t.jsx)(o.A,{className:"h-5 w-5 text-green-500 mb-1"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1",children:"Channels"}),(0,t.jsx)("span",{className:"text-lg font-mono font-semibold",children:l.size})]})]})]})})},el=()=>{let{isConnected:e,isConnecting:s,connect:a,disconnect:n}=M();return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(er,{})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-4 flex flex-col items-center justify-center h-full gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-center text-muted-foreground",children:e?"Connected to WebSocket server":"Start testing real-time features"}),(0,t.jsxs)(r.$nd,{onClick:e?n:a,disabled:s,variant:e?"destructive":"default",size:"lg",className:"w-full",children:[(0,t.jsx)($,{className:"h-4 w-4 mr-2"}),s?"Connecting...":e?"Disconnect":"Connect"]})]})})]}),(0,t.jsx)(X,{}),(0,t.jsx)(ea,{}),(0,t.jsx)(Q,{}),(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsx)(r.ZBx,{children:"Advanced Testing Tools"})}),(0,t.jsx)(r.Wux,{children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsx)(L,{className:"h-8 w-8 text-purple-500 mb-4"}),(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"Publish Test"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Send a test message to a channel with optional ACK tracking"}),(0,t.jsx)(r.$nd,{onClick:()=>{r.AZP.publish({type:W.OPEN_PUBLISH_TEST_DIALOG,payload:{}})},className:"w-full",children:"Open Test Publisher"})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsx)(d,{className:"h-8 w-8 text-blue-500 mb-4"}),(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"Publish with Logging"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Send a message and save to database for tracking"}),(0,t.jsx)(r.$nd,{onClick:()=>{r.AZP.publish({type:W.OPEN_PUBLISH_WITH_LOGGING_DIALOG,payload:{}})},className:"w-full",children:"Open Logger"})]})}),(0,t.jsx)(r.ZpM,{children:(0,t.jsxs)(r.Wux,{className:"p-6",children:[(0,t.jsx)(_,{className:"h-8 w-8 text-green-500 mb-4"}),(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"Send ACK"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Manually send acknowledgment for a message"}),(0,t.jsx)(r.$nd,{onClick:()=>{r.AZP.publish({type:W.OPEN_SEND_ACK_DIALOG,payload:{}})},className:"w-full",children:"Send ACK"})]})})]})})]}),(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsx)(r.ZBx,{children:"Usage Guide"})}),(0,t.jsx)(r.Wux,{children:(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2",children:"Live Testing"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Connect to the WebSocket server to test real-time features. Use Quick Scenarios for one-click testing, or manually subscribe to channels and publish messages. All events are logged in real-time for debugging."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2",children:"Publish Test"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Use this tool to send test messages to specific channels. You can enable ACK tracking to monitor message delivery confirmations."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2",children:"Publish with Logging"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Similar to Publish Test, but creates a CentrifugoLog record in the database for persistent tracking and monitoring."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2",children:"Send ACK"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Manually send an acknowledgment for a specific message. Useful for testing ACK handling and debugging delivery issues."})]})]})})]})]})},ei=()=>(0,t.jsx)(S,{children:(0,t.jsx)(el,{})});var ec=a(19140),ed=a(91416),eo=a(23309);let ex=eo.Ikc({channel:eo.YjP().min(1,"Channel is required"),message:eo.YjP().min(1,"Message is required"),wait_for_ack:eo.zMY().optional(),ack_timeout:eo.aig().int().min(1).max(60).optional()}),eh=()=>{let[e,s]=n.useState(!1),{publishTest:a}=w(),{refreshPublishes:l,refreshOverview:i}=v(),{toast:c}=(0,r.djX)(),d=(0,ec.mN)({resolver:(0,ed.u)(ex),defaultValues:{channel:"",message:'{"type": "test", "content": "Hello from admin"}',wait_for_ack:!1,ack_timeout:5}});(0,r.MLh)(W.OPEN_PUBLISH_TEST_DIALOG,e=>{var a,t;(null==(a=e.payload)?void 0:a.channel)&&d.setValue("channel",e.payload.channel),(null==(t=e.payload)?void 0:t.message)&&d.setValue("message",JSON.stringify(e.payload.message,null,2)),s(!0)});let o=()=>{s(!1),d.reset()},x=async e=>{try{let s={message:e.message};try{let a=JSON.parse(e.message);s="object"==typeof a&&null!==a?a:{message:a}}catch(e){}await a({channel:e.channel,data:s,wait_for_ack:e.wait_for_ack,ack_timeout:e.ack_timeout}),c({title:"Message Published",description:'Successfully published to channel "'.concat(e.channel,'"')}),await l(),await i(),o()}catch(a){let e="Publishing Failed",s="Failed to publish message";a instanceof h.LG?a.isPermissionError?(e="Permission Denied",s=a.errorMessage||"You do not have permission to publish messages"):a.isAuthError?(e="Authentication Required",s="Please log in to publish messages"):a.isValidationError?(e="Validation Error",s=a.errorMessage):a.isServerError?(e="Server Error",s=a.errorMessage||"Internal server error occurred"):s=a.errorMessage:a instanceof Error&&(s=a.message),c({title:e,description:s,variant:"destructive"})}};return(0,t.jsx)(r.lGe,{open:e,onOpenChange:e=>!e&&o(),children:(0,t.jsxs)(r.Cff,{className:"max-w-2xl",children:[(0,t.jsxs)(r.c75,{children:[(0,t.jsx)(r.L33,{children:"Publish Test Message"}),(0,t.jsx)(r.rrK,{children:"Publish a test message to a Centrifugo channel via the wrapper"})]}),(0,t.jsx)(r.lVW,{...d,children:(0,t.jsxs)("form",{onSubmit:d.handleSubmit(x),className:"space-y-4",children:[(0,t.jsx)(r.zBI,{control:d.control,name:"channel",render:e=>{let{field:s}=e;return(0,t.jsxs)(r.eIh,{children:[(0,t.jsx)(r.lRv,{children:"Channel *"}),(0,t.jsx)(r.MJN,{children:(0,t.jsx)(r.pde,{placeholder:"test:channel",...s})}),(0,t.jsx)(r.Rrd,{children:'Target channel name (e.g., "test:channel")'}),(0,t.jsx)(r.C5h,{})]})}}),(0,t.jsx)(r.zBI,{control:d.control,name:"message",render:e=>{let{field:s}=e;return(0,t.jsxs)(r.eIh,{children:[(0,t.jsx)(r.lRv,{children:"Message *"}),(0,t.jsx)(r.MJN,{children:(0,t.jsx)(r.TMX,{placeholder:'{"type": "test", "content": "Hello"}',rows:6,...s})}),(0,t.jsx)(r.Rrd,{children:"JSON object or string (will be auto-wrapped if needed)"}),(0,t.jsx)(r.C5h,{})]})}}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)(r.zBI,{control:d.control,name:"wait_for_ack",render:e=>{let{field:s}=e;return(0,t.jsxs)(r.eIh,{className:"flex flex-row items-center justify-between rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(r.lRv,{children:"Wait for ACK"}),(0,t.jsx)(r.Rrd,{className:"text-xs",children:"Track client acknowledgments"})]}),(0,t.jsx)(r.MJN,{children:(0,t.jsx)(r.dOG,{checked:s.value,onCheckedChange:s.onChange})})]})}}),(0,t.jsx)(r.zBI,{control:d.control,name:"ack_timeout",render:e=>{let{field:s}=e;return(0,t.jsxs)(r.eIh,{children:[(0,t.jsx)(r.lRv,{children:"ACK Timeout (seconds)"}),(0,t.jsx)(r.MJN,{children:(0,t.jsx)(r.pde,{type:"number",min:"1",max:"60",...s,onChange:e=>s.onChange(parseInt(e.target.value)||5)})}),(0,t.jsx)(r.C5h,{})]})}})]}),(0,t.jsxs)(r.Esm,{children:[(0,t.jsx)(r.$nd,{type:"button",variant:"outline",onClick:o,children:"Cancel"}),(0,t.jsx)(r.$nd,{type:"submit",disabled:d.formState.isSubmitting,children:d.formState.isSubmitting?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Publishing..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{className:"h-4 w-4 mr-2"}),"Publish"]})})]})]})})]})})};var em=a(88073),eu=a(20495);let eg=eo.Ikc({channel:eo.YjP().min(1,"Channel is required"),data:eo.YjP().min(1,"Message data is required"),wait_for_ack:eo.zMY().optional(),ack_timeout:eo.aig().int().min(1).max(60).optional()}),ej=()=>{let[e,s]=n.useState(!1),{publishWithLogging:a}=w(),{refreshPublishes:l,refreshOverview:i}=v(),{toast:c}=(0,eu.dj)(),o=(0,ec.mN)({resolver:(0,ed.u)(eg),defaultValues:{channel:"",data:"{}",wait_for_ack:!0,ack_timeout:5}});(0,eu.ML)(W.OPEN_PUBLISH_WITH_LOGGING_DIALOG,e=>{var a,t;(null==(a=e.payload)?void 0:a.channel)&&o.setValue("channel",e.payload.channel),(null==(t=e.payload)?void 0:t.message)&&o.setValue("data",JSON.stringify(e.payload.message,null,2)),s(!0)});let x=()=>{s(!1),o.reset()},m=async e=>{try{let s={};try{let a=JSON.parse(e.data);s="object"==typeof a&&null!==a?a:{message:a}}catch(a){s={message:e.data}}await a({channel:e.channel.trim(),data:s,wait_for_ack:e.wait_for_ack,ack_timeout:e.ack_timeout}),c({title:"Success",description:"Message published to ".concat(e.channel," and saved to database")}),r.AZP.publish({type:W.REFRESH_PUBLISHES,payload:{}}),await l(),await i(),x()}catch(a){let e="Publishing Failed",s="Failed to publish message";a instanceof h.LG?a.isPermissionError?(e="Permission Denied",s=a.errorMessage||"You do not have permission to publish messages"):a.isAuthError?(e="Authentication Required",s="Please log in to publish messages"):a.isValidationError?(e="Validation Error",s=a.errorMessage):a.isServerError?(e="Server Error",s=a.errorMessage||"Internal server error occurred"):s=a.errorMessage:a instanceof Error&&(s=a.message),c({title:e,description:s,variant:"destructive"})}};return(0,t.jsx)(em.Dialog,{open:e,onOpenChange:e=>!e&&x(),children:(0,t.jsxs)(em.DialogContent,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(em.DialogHeader,{children:[(0,t.jsx)(em.DialogTitle,{children:"Publish with Database Logging"}),(0,t.jsx)(em.DialogDescription,{children:"Publish a message and save it to the database for tracking"})]}),(0,t.jsx)(em.Form,{...o,children:(0,t.jsxs)("form",{onSubmit:o.handleSubmit(m),className:"space-y-6",children:[(0,t.jsx)(em.FormField,{control:o.control,name:"channel",render:e=>{let{field:s}=e;return(0,t.jsxs)(em.FormItem,{children:[(0,t.jsx)(em.FormLabel,{children:"Channel *"}),(0,t.jsx)(em.FormControl,{children:(0,t.jsx)(em.Input,{placeholder:"e.g., user:123",...s})}),(0,t.jsx)(em.FormDescription,{children:"The channel to publish the message to"}),(0,t.jsx)(em.FormMessage,{})]})}}),(0,t.jsx)(em.FormField,{control:o.control,name:"data",render:e=>{let{field:s}=e;return(0,t.jsxs)(em.FormItem,{children:[(0,t.jsx)(em.FormLabel,{children:"Message Data (JSON)"}),(0,t.jsx)(em.FormControl,{children:(0,t.jsx)(em.Textarea,{placeholder:'{"type": "notification", "message": "Test"}',rows:8,className:"font-mono text-sm",...s})}),(0,t.jsx)(em.FormDescription,{children:"Enter JSON data or plain text (will be auto-wrapped)"}),(0,t.jsx)(em.FormMessage,{})]})}}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:"ACK Options"}),(0,t.jsx)(em.FormField,{control:o.control,name:"wait_for_ack",render:e=>{let{field:s}=e;return(0,t.jsxs)(em.FormItem,{className:"flex flex-row items-center justify-between rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(em.FormLabel,{children:"Wait for ACK"}),(0,t.jsx)(em.FormDescription,{children:"Track acknowledgment responses from subscribers"})]}),(0,t.jsx)(em.FormControl,{children:(0,t.jsx)(em.Switch,{checked:s.value,onCheckedChange:s.onChange})})]})}}),o.watch("wait_for_ack")&&(0,t.jsx)(em.FormField,{control:o.control,name:"ack_timeout",render:e=>{let{field:s}=e;return(0,t.jsxs)(em.FormItem,{children:[(0,t.jsx)(em.FormLabel,{children:"ACK Timeout (seconds)"}),(0,t.jsx)(em.FormControl,{children:(0,t.jsx)(em.Input,{type:"number",min:1,max:60,...s,onChange:e=>s.onChange(parseInt(e.target.value)||5)})}),(0,t.jsx)(em.FormDescription,{children:"Maximum time to wait for acknowledgments (1-60 seconds)"}),(0,t.jsx)(em.FormMessage,{})]})}})]}),(0,t.jsxs)(em.DialogFooter,{children:[(0,t.jsx)(em.Button,{type:"button",variant:"outline",onClick:x,children:"Cancel"}),(0,t.jsx)(em.Button,{type:"submit",disabled:o.formState.isSubmitting,children:o.formState.isSubmitting?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Publishing..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{className:"h-4 w-4 mr-2"}),"Publish & Log"]})})]})]})})]})})};var ep=a(98315);let eb=()=>{let[e,s]=n.useState(!1),{sendAck:a}=w(),{toast:r}=(0,eu.dj)(),l=(0,ec.mN)({resolver:(0,ed.u)(ep.R),defaultValues:{message_id:"",client_id:""}});(0,eu.ML)(W.OPEN_SEND_ACK_DIALOG,e=>{var a,t;(null==(a=e.payload)?void 0:a.messageId)&&l.setValue("message_id",e.payload.messageId),(null==(t=e.payload)?void 0:t.channel)&&l.setValue("client_id",e.payload.channel),s(!0)});let i=()=>{s(!1),l.reset()},c=async e=>{try{await a({message_id:e.message_id.trim(),client_id:e.client_id.trim()}),r({title:"Success",description:"ACK sent for message ".concat(e.message_id)}),i()}catch(a){let e="Failed to Send ACK",s="Failed to send acknowledgment";a instanceof h.LG?a.isPermissionError?(e="Permission Denied",s=a.errorMessage||"You do not have permission to send ACKs"):a.isAuthError?(e="Authentication Required",s="Please log in to send ACKs"):a.isValidationError?(e="Validation Error",s=a.errorMessage):a.isServerError?(e="Server Error",s=a.errorMessage||"Internal server error occurred"):s=a.errorMessage:a instanceof Error&&(s=a.message),r({title:e,description:s,variant:"destructive"})}};return(0,t.jsx)(em.Dialog,{open:e,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(em.DialogContent,{className:"max-w-lg",children:[(0,t.jsxs)(em.DialogHeader,{children:[(0,t.jsx)(em.DialogTitle,{children:"Send Manual ACK"}),(0,t.jsx)(em.DialogDescription,{children:"Manually send acknowledgment for a specific message"})]}),(0,t.jsx)(em.Form,{...l,children:(0,t.jsxs)("form",{onSubmit:l.handleSubmit(c),className:"space-y-6",children:[(0,t.jsx)(em.FormField,{control:l.control,name:"message_id",render:e=>{let{field:s}=e;return(0,t.jsxs)(em.FormItem,{children:[(0,t.jsx)(em.FormLabel,{children:"Message ID *"}),(0,t.jsx)(em.FormControl,{children:(0,t.jsx)(em.Input,{placeholder:"Enter message ID",className:"font-mono",...s})}),(0,t.jsx)(em.FormDescription,{children:"The unique identifier of the message to acknowledge"}),(0,t.jsx)(em.FormMessage,{})]})}}),(0,t.jsx)(em.FormField,{control:l.control,name:"client_id",render:e=>{let{field:s}=e;return(0,t.jsxs)(em.FormItem,{children:[(0,t.jsx)(em.FormLabel,{children:"Client ID *"}),(0,t.jsx)(em.FormControl,{children:(0,t.jsx)(em.Input,{placeholder:"e.g., client-123",className:"font-mono",...s})}),(0,t.jsx)(em.FormDescription,{children:"The client ID that should acknowledge the message"}),(0,t.jsx)(em.FormMessage,{})]})}}),(0,t.jsxs)(em.DialogFooter,{children:[(0,t.jsx)(em.Button,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,t.jsx)(em.Button,{type:"submit",disabled:l.formState.isSubmitting,children:l.formState.isSubmitting?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Sending..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{className:"h-4 w-4 mr-2"}),"Send ACK"]})})]})]})})]})})},ef=()=>{let[e,s]=n.useState(!1),[a,r]=n.useState(""),[l,i]=n.useState(null),[c,d]=n.useState(!1),{getChannelHistory:o}=j(),{toast:x}=(0,eu.dj)();(0,eu.ML)(W.OPEN_CHANNEL_HISTORY_DIALOG,async e=>{r(e.payload.channel),s(!0),await m(e.payload.channel)});let m=async e=>{d(!0),i(null);try{let s=await o({channel:e});i(s)}catch(t){let s="Failed to Load History",a="Failed to load channel history";t instanceof h.LG?t.isPermissionError?(s="Permission Denied",a=t.errorMessage||"You do not have permission to view channel history"):t.isAuthError?(s="Authentication Required",a="Please log in to view channel history"):t.isNotFoundError?(s="Channel Not Found",a='Channel "'.concat(e,'" not found or has no history')):t.isServerError?(s="Server Error",a=t.errorMessage||"Internal server error occurred"):a=t.errorMessage:t instanceof Error&&(a=t.message),x({title:s,description:a,variant:"destructive"})}finally{d(!1)}},u=()=>{s(!1),r(""),i(null)};return(0,t.jsx)(em.Dialog,{open:e,onOpenChange:e=>!e&&u(),children:(0,t.jsxs)(em.DialogContent,{className:"max-w-6xl max-h-[90vh]",children:[(0,t.jsxs)(em.DialogHeader,{children:[(0,t.jsxs)(em.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(Z,{className:"h-5 w-5"}),"Channel History: ",a,(null==l?void 0:l.publications)&&(0,t.jsxs)(em.Badge,{variant:"secondary",children:[l.publications.length," messages"]})]}),(0,t.jsx)(em.DialogDescription,{children:"View message history for this channel"})]}),(0,t.jsx)(em.ScrollArea,{className:"h-[60vh] w-full",children:c?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(em.Skeleton,{className:"h-[100px] w-full"}),(0,t.jsx)(em.Skeleton,{className:"h-[100px] w-full"}),(0,t.jsx)(em.Skeleton,{className:"h-[100px] w-full"})]}):(null==l?void 0:l.publications)&&l.publications.length>0?(0,t.jsxs)(em.Table,{children:[(0,t.jsx)(em.TableHeader,{children:(0,t.jsxs)(em.TableRow,{children:[(0,t.jsx)(em.TableHead,{className:"w-[100px]",children:"Offset"}),(0,t.jsx)(em.TableHead,{children:"Data"}),(0,t.jsx)(em.TableHead,{className:"w-[200px]",children:"Info"})]})}),(0,t.jsx)(em.TableBody,{children:l.publications.map((e,s)=>(0,t.jsxs)(em.TableRow,{children:[(0,t.jsx)(em.TableCell,{className:"font-mono text-xs align-top",children:e.offset||"N/A"}),(0,t.jsx)(em.TableCell,{className:"align-top",children:(0,t.jsx)("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto max-w-2xl",children:JSON.stringify(e.data,null,2)})}),(0,t.jsx)(em.TableCell,{className:"text-xs align-top",children:e.info?(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Client:"}),(0,t.jsx)("code",{className:"text-xs bg-muted px-1 rounded",children:e.info.client||"N/A"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-semibold",children:"User:"}),(0,t.jsx)("code",{className:"text-xs bg-muted px-1 rounded",children:e.info.user||"N/A"})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"No info"})})]},s))})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(Z,{className:"h-12 w-12 text-muted-foreground mb-3"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"No history available for this channel"})]})}),(0,t.jsxs)(em.DialogFooter,{children:[(0,t.jsx)(em.Button,{variant:"outline",onClick:()=>{a&&m(a)},disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2"}),"Refresh"]})}),(0,t.jsx)(em.Button,{variant:"outline",onClick:u,children:"Close"})]})]})})},ev=()=>{let[e,s]=n.useState(!1),[a,r]=n.useState(""),[l,i]=n.useState(null),[c,d]=n.useState(!1),{getPresence:o}=j(),{toast:x}=(0,eu.dj)();(0,eu.ML)(W.OPEN_CHANNEL_PRESENCE_DIALOG,async e=>{r(e.payload.channel),s(!0),await m(e.payload.channel)});let m=async e=>{d(!0),i(null);try{let s=await o({channel:e});i(s)}catch(t){let s="Failed to Load Presence",a="Failed to load channel presence";t instanceof h.LG?t.isPermissionError?(s="Permission Denied",a=t.errorMessage||"You do not have permission to view channel presence"):t.isAuthError?(s="Authentication Required",a="Please log in to view channel presence"):t.isNotFoundError?(s="Channel Not Found",a='Channel "'.concat(e,'" not found')):t.isServerError?(s="Server Error",a=t.errorMessage||"Internal server error occurred"):a=t.errorMessage:t instanceof Error&&(a=t.message),x({title:s,description:a,variant:"destructive"})}finally{d(!1)}},u=()=>{s(!1),r(""),i(null)},g=(null==l?void 0:l.presence)?Object.keys(l.presence).length:0;return(0,t.jsx)(em.Dialog,{open:e,onOpenChange:e=>!e&&u(),children:(0,t.jsxs)(em.DialogContent,{className:"max-w-5xl max-h-[90vh]",children:[(0,t.jsxs)(em.DialogHeader,{children:[(0,t.jsxs)(em.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(G.A,{className:"h-5 w-5"}),"Channel Presence: ",a,l&&(0,t.jsxs)(em.Badge,{variant:"secondary",children:[g," ",1===g?"client":"clients"]})]}),(0,t.jsx)(em.DialogDescription,{children:"View currently subscribed clients for this channel"})]}),(0,t.jsx)(em.ScrollArea,{className:"h-[60vh] w-full",children:c?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(em.Skeleton,{className:"h-[80px] w-full"}),(0,t.jsx)(em.Skeleton,{className:"h-[80px] w-full"}),(0,t.jsx)(em.Skeleton,{className:"h-[80px] w-full"})]}):(null==l?void 0:l.presence)&&Object.keys(l.presence).length>0?(0,t.jsxs)(em.Table,{children:[(0,t.jsx)(em.TableHeader,{children:(0,t.jsxs)(em.TableRow,{children:[(0,t.jsx)(em.TableHead,{className:"w-[250px]",children:"Client ID"}),(0,t.jsx)(em.TableHead,{className:"w-[150px]",children:"User"}),(0,t.jsx)(em.TableHead,{children:"Connection Info"})]})}),(0,t.jsx)(em.TableBody,{children:Object.entries(l.presence).map(e=>{let[s,a]=e;return(0,t.jsxs)(em.TableRow,{children:[(0,t.jsx)(em.TableCell,{className:"font-mono text-xs align-top",children:(0,t.jsx)("code",{className:"text-xs bg-muted px-2 py-1 rounded",children:s})}),(0,t.jsx)(em.TableCell,{className:"align-top",children:(0,t.jsx)(em.Badge,{variant:"outline",children:a.user||"Anonymous"})}),(0,t.jsx)(em.TableCell,{className:"text-xs align-top",children:a.conn_info?(0,t.jsx)("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto max-w-xl",children:JSON.stringify(a.conn_info,null,2)}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"No connection info"})})]},s)})})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(G.A,{className:"h-12 w-12 text-muted-foreground mb-3"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"No clients currently subscribed to this channel"})]})}),(0,t.jsxs)(em.DialogFooter,{children:[(0,t.jsx)(em.Button,{variant:"outline",onClick:()=>{a&&m(a)},disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-2"}),"Refresh"]})}),(0,t.jsx)(em.Button,{variant:"outline",onClick:u,children:"Close"})]})]})})},eN=()=>{let[e,s]=(0,n.useState)("overview");return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(D,{}),(0,t.jsx)(T,{}),(0,t.jsxs)(r.ZpM,{children:[(0,t.jsx)(r.aRn,{children:(0,t.jsx)(r.ZBx,{children:"Centrifugo Monitor Dashboard"})}),(0,t.jsx)(r.Wux,{children:(0,t.jsxs)(r.tUM,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(r.j7C,{className:"grid w-full grid-cols-5",children:[(0,t.jsxs)(r.Xib,{value:"overview",className:"flex items-center gap-2",children:[(0,t.jsx)(l.A,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Overview"})]}),(0,t.jsxs)(r.Xib,{value:"publishes",className:"flex items-center gap-2",children:[(0,t.jsx)(c,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Recent Publishes"})]}),(0,t.jsxs)(r.Xib,{value:"channels",className:"flex items-center gap-2",children:[(0,t.jsx)(d,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Channels"})]}),(0,t.jsxs)(r.Xib,{value:"live-channels",className:"flex items-center gap-2",children:[(0,t.jsx)(o.A,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Live Channels"})]}),(0,t.jsxs)(r.Xib,{value:"testing",className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Live Testing"})]})]}),(0,t.jsx)(r.avX,{value:"overview",className:"mt-6",children:(0,t.jsx)(R,{})}),(0,t.jsx)(r.avX,{value:"publishes",className:"mt-6",children:(0,t.jsx)(B,{})}),(0,t.jsx)(r.avX,{value:"channels",className:"mt-6",children:(0,t.jsx)(K,{})}),(0,t.jsx)(r.avX,{value:"live-channels",className:"mt-6",children:(0,t.jsx)(V,{})}),(0,t.jsx)(r.avX,{value:"testing",className:"mt-6",children:(0,t.jsx)(ei,{})})]})})]}),(0,t.jsx)(eh,{}),(0,t.jsx)(ej,{}),(0,t.jsx)(eb,{}),(0,t.jsx)(ef,{}),(0,t.jsx)(ev,{})]})},ey=()=>(0,t.jsx)(f,{children:(0,t.jsx)(g,{children:(0,t.jsx)(k,{children:(0,t.jsx)(eN,{})})})}),ek=()=>(0,t.jsx)(ey,{});ek.pageConfig={title:"Centrifugo Monitor",description:"Real-time monitoring and management interface for Centrifugo",protected:!0};let ew=ek},69673:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},73548:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},79145:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},80574:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(25365).A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}},e=>{e.O(0,[50314,90636,46593,38792],()=>e(e.s=48747)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14011],{2043:(e,i,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/private/profile",function(){return t(49765)}])},49765:(e,i,t)=>{"use strict";t.r(i),t.d(i,{default:()=>_});var n=t(94513),o=t(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14011],{2043:(e,i,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/private/profile",function(){return t(49765)}])},49765:(e,i,t)=>{"use strict";t.r(i),t.d(i,{default:()=>_});var n=t(94513),o=t(23252);let r=()=>(0,n.jsx)(o.ug,{title:"Profile",description:"Manage your account settings and profile information"});r.pageConfig={title:"Profile"};let _=r}},e=>{e.O(0,[90636,46593,38792],()=>e(e.s=2043)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[99266],{19428:(e,o,n)=>{"use strict";n.r(o),n.d(o,{default:()=>_});var t=n(94513),i=n(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[99266],{19428:(e,o,n)=>{"use strict";n.r(o),n.d(o,{default:()=>_});var t=n(94513),i=n(23252);let s=()=>(0,t.jsx)(i.QP,{});s.pageConfig={title:"Component Showcase",description:"Explore our comprehensive collection of React components"};let _=s},23003:(e,o,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/private/ui",function(){return n(19428)}])}},e=>{e.O(0,[90636,46593,38792],()=>e(e.s=23003)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[61137],{93442:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>e2});var t=a(94513),r=a(94285),l=a(77625),n=a(51352),c=a(88051),i=a(7647),d=a(73548),x=a(7737),o=a(49829),m=a(79145),h=a(72916),j=a(8745),u=a(50314);a(66525);var p=a(85449);let g=(0,r.createContext)(void 0);function N(e){let{children:s}=e,{data:a,error:r,isLoading:l,mutate:n}=(0,p.G3)(u.FH),{data:c,error:i,isLoading:d,mutate:x}=(0,p.zr)(u.FH),{data:o,error:m,isLoading:h,mutate:j}=(0,p.Ly)(u.FH),N=async()=>{await n()},f=async()=>{await x()},v=async()=>{await j()},y=async()=>{await Promise.all([n(),x(),j()])};return(0,t.jsx)(g.Provider,{value:{cards:a,isLoadingCards:l,cardsError:r,refreshCards:N,users:c,isLoadingUsers:d,usersError:i,refreshUsers:f,apps:o,isLoadingApps:h,appsError:m,refreshApps:v,refreshAll:y},children:s})}var f=a(55891);let v=(0,r.createContext)(void 0);function y(e){let{children:s}=e,{data:a,error:r,isLoading:l,mutate:n}=(0,f.N)(u.FH),{data:c,error:i,isLoading:d,mutate:x}=(0,f.M)(u.FH),o=async()=>{await n()},m=async()=>{await x()},h=async()=>{await Promise.all([n(),x()])};return(0,t.jsx)(v.Provider,{value:{health:a,isLoadingHealth:l,healthError:r,refreshHealth:o,metrics:c,isLoadingMetrics:d,metricsError:i,refreshMetrics:m,refreshAll:h},children:s})}var w=a(14527);let b=(0,r.createContext)(void 0);function A(e){let{children:s}=e,{data:a,error:r,isLoading:l,mutate:n}=(0,w.c)(void 0,u.FH),{data:c,error:i,isLoading:d,mutate:x}=(0,w.m)(u.FH),o=async()=>{await n()},m=async()=>{await x()},h=async()=>{await Promise.all([n(),x()])};return(0,t.jsx)(b.Provider,{value:{recentActivity:a,isLoadingRecentActivity:l,recentActivityError:r,refreshRecentActivity:o,quickActions:c,isLoadingQuickActions:d,quickActionsError:i,refreshQuickActions:m,refreshAll:h},children:s})}var _=a(81231);let E=(0,r.createContext)(void 0);function C(e){let{children:s}=e,[a,l]=(0,r.useState)(7),[n,c]=(0,r.useState)(7),[i,d]=(0,r.useState)(52),[x,o]=(0,r.useState)(10),{data:m,error:h,isLoading:j,mutate:p}=(0,_.vD)({days:a},u.FH),{data:g,error:N,isLoading:f,mutate:v}=(0,_.wD)({days:n},u.FH),{data:y,error:w,isLoading:b,mutate:A}=(0,_.lJ)({weeks:i},u.FH),{data:C,error:k,isLoading:D,mutate:M}=(0,_.UQ)({limit:x},u.FH),Z=async()=>{await p()},L=async()=>{await v()},S=async()=>{await A()},R=async()=>{await M()},T=async()=>{await Promise.all([p(),v(),A(),M()])};return(0,t.jsx)(E.Provider,{value:{registrationChart:m,isLoadingRegistrationChart:j,registrationChartError:h,registrationChartDays:a,setRegistrationChartDays:l,refreshRegistrationChart:Z,activityChart:g,isLoadingActivityChart:f,activityChartError:N,activityChartDays:n,setActivityChartDays:c,refreshActivityChart:L,activityTracker:y,isLoadingActivityTracker:b,activityTrackerError:w,activityTrackerWeeks:i,setActivityTrackerWeeks:d,refreshActivityTracker:S,recentUsers:C,isLoadingRecentUsers:D,recentUsersError:k,recentUsersLimit:x,setRecentUsersLimit:o,refreshRecentUsers:R,refreshAll:T},children:s})}function k(){let e=(0,r.useContext)(E);if(!e)throw Error("useDashboardChartsContext must be used within DashboardChartsProvider");return e}var D=a(12032);let M=(0,r.createContext)(void 0);function Z(e){let{children:s}=e,{data:a,error:r,isLoading:l,mutate:n}=(0,D.U)(u.FH),{data:c,error:i,isLoading:d,mutate:x}=(0,D.A)(u.FH),o=async()=>{await n()},m=async()=>{await x()},h=async()=>{await Promise.all([n(),x()])};return(0,t.jsx)(M.Provider,{value:{commands:a,isLoadingCommands:l,commandsError:r,refreshCommands:o,summary:c,isLoadingSummary:d,summaryError:i,refreshSummary:m,refreshAll:h},children:s})}function L(){let e=(0,r.useContext)(M);if(!e)throw Error("useDashboardCommandsContext must be used within DashboardCommandsProvider");return e}var S=a(9010);let R=(0,r.createContext)(void 0);function T(e){let{children:s}=e,{data:a,error:r,isLoading:l,mutate:n}=(0,S.P)(u.FH),{data:c,error:i,isLoading:d,mutate:x}=(0,S.t)(u.FH),o=async()=>{await n()},m=async()=>{await x()},h=async()=>{await Promise.all([n(),x()])};return(0,t.jsx)(R.Provider,{value:{zones:a,isLoadingZones:l,zonesError:r,refreshZones:o,summary:c,isLoadingSummary:d,summaryError:i,refreshSummary:m,refreshAll:h},children:s})}function B(){let e=(0,r.useContext)(R);if(!e)throw Error("useDashboardZonesContext must be used within DashboardZonesProvider");return e}var F=a(69620),P=a(69997),W=a(20024),H=a(9376);function U(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,t.jsx)(l.EAD,{className:"h-4 w-24"}),(0,t.jsx)(l.EAD,{className:"h-4 w-4 rounded-full"})]}),(0,t.jsxs)(l.Wux,{children:[(0,t.jsx)(l.EAD,{className:"h-8 w-20 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-3 w-full"})]})]})}function X(e){let{cards:s,isLoading:a}=e;if(a)return(0,t.jsx)("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((e,s)=>(0,t.jsx)(U,{},s))});if(!s)return(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:"No statistics available"});let r=Array.isArray(s)?s:[s];return(0,t.jsx)("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",children:r.map((e,s)=>{var a;return(0,t.jsxs)(l.ZpM,{style:e.color?{borderLeftColor:e.color,borderLeftWidth:"4px"}:{},children:[(0,t.jsxs)(l.aRn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium",children:e.title}),(0,t.jsx)("div",{className:"text-muted-foreground",style:e.color?{color:e.color}:{},children:(a=e.icon,({trending_up:(0,t.jsx)(m.A,{className:"h-4 w-4"}),people:(0,t.jsx)(d.A,{className:"h-4 w-4"}),activity:(0,t.jsx)(x.A,{className:"h-4 w-4"}),attach_money:(0,t.jsx)(F.A,{className:"h-4 w-4"})})[a]||(0,t.jsx)(x.A,{className:"h-4 w-4"}))})]}),(0,t.jsxs)(l.Wux,{children:[(0,t.jsx)("div",{className:"text-2xl font-bold",children:e.value}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[e.change&&(0,t.jsxs)(l.Exy,{variant:(e=>{switch(e){case"positive":return"default";case"negative":return"destructive";default:return"secondary"}})(e.change_type),className:"flex items-center gap-1 text-xs",children:[(e=>{switch(e){case"positive":return(0,t.jsx)(P.A,{className:"h-3 w-3"});case"negative":return(0,t.jsx)(W.A,{className:"h-3 w-3"});default:return(0,t.jsx)(H.A,{className:"h-3 w-3"})}})(e.change_type),e.change]}),e.description&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]})]},s)})})}var O=a(57147),I=a(20254);function J(){return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg",children:[(0,t.jsx)(l.EAD,{className:"h-10 w-10 rounded"}),(0,t.jsx)(l.EAD,{className:"h-5 w-3/4"}),(0,t.jsx)(l.EAD,{className:"h-4 w-full"})]})}function z(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-32 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-48"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:Array.from({length:4}).map((e,s)=>(0,t.jsx)(J,{},s))})})]})}function K(e){let{actions:s,isLoading:a}=e;if(a)return(0,t.jsx)(z,{});let r=s?Array.isArray(s)?s:[s]:[];return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{children:"Quick Actions"}),(0,t.jsx)(l.BTJ,{children:"Common tasks and shortcuts"})]}),(0,t.jsx)(l.Wux,{children:0===r.length?(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,t.jsx)(O.A,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),(0,t.jsx)("p",{className:"text-sm",children:"No quick actions available"})]}):(0,t.jsx)("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:r.map((e,s)=>{let a=(e=>{switch(e){case"success":return{bg:"bg-green-500/10",text:"text-green-600",border:"hover:border-green-500"};case"warning":return{bg:"bg-yellow-500/10",text:"text-yellow-600",border:"hover:border-yellow-500"};case"danger":return{bg:"bg-red-500/10",text:"text-red-600",border:"hover:border-red-500"};case"secondary":return{bg:"bg-gray-500/10",text:"text-gray-600",border:"hover:border-gray-500"};default:return{bg:"bg-primary/10",text:"text-primary",border:"hover:border-primary"}}})(e.color);return(0,t.jsx)("a",{href:e.link,className:"group block",target:e.link.startsWith("http")?"_blank":void 0,rel:e.link.startsWith("http")?"noopener noreferrer":void 0,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg ".concat(a.border," hover:shadow-md transition-all duration-200"),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsx)("div",{className:"h-10 w-10 rounded-md ".concat(a.bg," flex items-center justify-center ").concat(a.text),children:(e.icon,(0,t.jsx)(O.A,{className:"h-5 w-5"}))}),e.link.startsWith("http")&&(0,t.jsx)(I.A,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"font-semibold text-sm",children:e.title}),e.category&&(0,t.jsx)(l.Exy,{variant:"secondary",className:"text-xs",children:e.category})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description})]})]})},s)})})})]})}var q=a(91553),G=a(51304),V=a.n(G);let{ZB:Q,DP:Y,rS:$}=q,ee=e=>e>=80?"hsl(var(--chart-1))":e>=50?"hsl(var(--chart-3))":"hsl(var(--chart-5))",es={health:{label:"Health"}};function ea(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-40 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-56"})]}),(0,t.jsx)(l.Wux,{className:"flex items-center justify-center",children:(0,t.jsx)(l.EAD,{className:"h-[250px] w-[250px] rounded-full"})})]})}function et(e){let{health:s,isLoading:a}=e;if(a)return(0,t.jsx)(ea,{});if(!s)return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsx)(l.ZBx,{children:"System Health"})}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No health data available"})})]});let r=[{name:"health",value:s.overall_health_percentage,fill:ee(s.overall_health_percentage)}];return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(l.ZBx,{children:"System Health"}),(0,t.jsxs)(l.BTJ,{children:["Overall health status",s.timestamp&&(0,t.jsxs)("span",{className:"text-xs ml-2",children:["\xb7 Updated ",V()(s.timestamp).fromNow()]})]})]}),(0,t.jsx)(l.Exy,{variant:(e=>{switch(e){case"healthy":return"default";case"warning":case"unknown":default:return"secondary";case"error":return"destructive"}})(s.overall_status),children:s.overall_status.toUpperCase()})]})}),(0,t.jsxs)(l.Wux,{className:"flex flex-col items-center justify-center pb-8",children:[(0,t.jsx)(l.atp,{config:es,className:"h-[250px] w-full",children:(0,t.jsxs)(Y,{data:r,startAngle:90,endAngle:90+s.overall_health_percentage/100*360,innerRadius:"80%",outerRadius:"100%",children:[(0,t.jsx)($,{type:"number",domain:[0,100],angleAxisId:0,tick:!1}),(0,t.jsx)(Q,{background:!0,dataKey:"value",cornerRadius:10,fill:ee(s.overall_health_percentage)}),(0,t.jsxs)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",className:"fill-foreground",children:[(0,t.jsxs)("tspan",{x:"50%",dy:"-0.5em",fontSize:"48",fontWeight:"bold",children:[s.overall_health_percentage,"%"]}),(0,t.jsx)("tspan",{x:"50%",dy:"1.5em",fontSize:"14",className:"fill-muted-foreground",children:"System Health"})]})]})}),(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-3 gap-4 w-full text-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-2xl font-bold text-green-500",children:s.components.filter(e=>"healthy"===e.status).length}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Healthy"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-2xl font-bold text-yellow-500",children:s.components.filter(e=>"warning"===e.status).length}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Warning"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-2xl font-bold text-red-500",children:s.components.filter(e=>"error"===e.status).length}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Error"})]})]})]})]})}let{Gk:er,QF:el,dC:en,WX:ec,h8:ei}=q,ed={cpu:{label:"CPU Usage",color:"hsl(var(--chart-1))"},memory:{label:"Memory Usage",color:"hsl(var(--chart-2))"},disk:{label:"Disk Usage",color:"hsl(var(--chart-3))"}};function ex(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-48 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-64"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)(l.EAD,{className:"h-[300px] w-full"})})]})}function eo(e){let{metrics:s,isLoading:a,historicalData:n}=e;if(a)return(0,t.jsx)(ex,{});if(!s)return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsx)(l.ZBx,{children:"System Metrics"})}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No metrics data available"})})]});let c=(0,r.useMemo)(()=>n&&n.length>0?n.map((e,s)=>({time:"T-".concat(n.length-s),cpu:e.cpu_usage,memory:e.memory_usage,disk:e.disk_usage})):function(e){if(!e)return[];let s=[],a=Date.now();for(let t=11;t>=0;t--){let r=new Date(a-3e5*t),l=r.getHours(),n=r.getMinutes(),c="".concat(l.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0")),i=()=>10*Math.random()-5;s.push({time:c,cpu:Math.max(0,Math.min(100,e.cpu_usage+i())),memory:Math.max(0,Math.min(100,e.memory_usage+i())),disk:Math.max(0,Math.min(100,e.disk_usage+i()))})}return s}(s),[s,n]);return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{children:"System Metrics"}),(0,t.jsx)(l.BTJ,{children:"Resource usage and performance indicators"})]}),(0,t.jsxs)(l.Wux,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Network In"}),(0,t.jsx)("p",{className:"text-lg font-semibold",children:s.network_in})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Network Out"}),(0,t.jsx)("p",{className:"text-lg font-semibold",children:s.network_out})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Response Time"}),(0,t.jsx)("p",{className:"text-lg font-semibold",children:s.response_time})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Uptime"}),(0,t.jsx)("p",{className:"text-lg font-semibold",children:s.uptime})]})]}),(0,t.jsx)(l.atp,{config:ed,className:"h-[300px] w-full",children:(0,t.jsxs)(el,{data:c,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"colorCpu",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"5%",stopColor:"var(--color-cpu)",stopOpacity:.3}),(0,t.jsx)("stop",{offset:"95%",stopColor:"var(--color-cpu)",stopOpacity:0})]}),(0,t.jsxs)("linearGradient",{id:"colorMemory",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"5%",stopColor:"var(--color-memory)",stopOpacity:.3}),(0,t.jsx)("stop",{offset:"95%",stopColor:"var(--color-memory)",stopOpacity:0})]}),(0,t.jsxs)("linearGradient",{id:"colorDisk",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"5%",stopColor:"var(--color-disk)",stopOpacity:.3}),(0,t.jsx)("stop",{offset:"95%",stopColor:"var(--color-disk)",stopOpacity:0})]})]}),(0,t.jsx)(en,{strokeDasharray:"3 3",className:"stroke-muted"}),(0,t.jsx)(ec,{dataKey:"time",tickLine:!1,axisLine:!1,tickMargin:8,className:"text-xs"}),(0,t.jsx)(ei,{tickLine:!1,axisLine:!1,tickMargin:8,className:"text-xs",domain:[0,100],tickFormatter:e=>"".concat(e,"%")}),(0,t.jsx)(l.IIn,{content:(0,t.jsx)(l.NtK,{})}),(0,t.jsx)(l._3D,{content:(0,t.jsx)(l.Hm2,{})}),(0,t.jsx)(er,{type:"monotone",dataKey:"cpu",stroke:"var(--color-cpu)",fill:"url(#colorCpu)",strokeWidth:2}),(0,t.jsx)(er,{type:"monotone",dataKey:"memory",stroke:"var(--color-memory)",fill:"url(#colorMemory)",strokeWidth:2}),(0,t.jsx)(er,{type:"monotone",dataKey:"disk",stroke:"var(--color-disk)",fill:"url(#colorDisk)",strokeWidth:2})]})})]})]})}function em(e){let{statCards:s,isLoadingStatCards:a,systemHealth:r,isLoadingSystemHealth:l,quickActions:n,isLoadingQuickActions:c,systemMetrics:i,isLoadingSystemMetrics:d}=e;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(X,{cards:s,isLoading:a}),(0,t.jsxs)("div",{className:"grid gap-6 grid-cols-1 lg:grid-cols-3",children:[(0,t.jsx)(et,{health:r,isLoading:l}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eo,{metrics:i,isLoading:d})})]}),(0,t.jsx)(K,{actions:n,isLoading:c})]})}var eh=a(81129),ej=a(75608),eu=a(13121);function ep(){return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsx)(l.EAD,{className:"h-10 w-10 rounded-full"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)(l.EAD,{className:"h-4 w-3/4"}),(0,t.jsx)(l.EAD,{className:"h-3 w-1/2"})]})]})}function eg(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-32 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-48"})]}),(0,t.jsx)(l.Wux,{className:"space-y-4",children:Array.from({length:5}).map((e,s)=>(0,t.jsx)(ep,{},s))})]})}function eN(e){let{activities:s,isLoading:a,maxItems:r=10}=e;if(a)return(0,t.jsx)(eg,{});let n=(s?Array.isArray(s)?s:[s]:[]).slice(0,r);return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{children:"Recent Activity"}),(0,t.jsx)(l.BTJ,{children:"Latest actions across the system"})]}),(0,t.jsx)(l.Wux,{children:0===n.length?(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,t.jsx)(x.A,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),(0,t.jsx)("p",{className:"text-sm",children:"No recent activity"})]}):(0,t.jsx)("div",{className:"space-y-6 max-h-[400px] overflow-y-auto pr-2",children:n.map(e=>{var s;return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(l.euF,{className:"h-10 w-10",children:(0,t.jsx)(l.q5E,{className:"text-xs",children:(e=>{let s=e.split(" ");return s.length>=2?"".concat(s[0][0]).concat(s[1][0]).toUpperCase():e.substring(0,2).toUpperCase()})(e.user)})}),(0,t.jsx)("div",{className:"absolute -bottom-1 -right-1 h-5 w-5 rounded-full border-2 border-background flex items-center justify-center",style:{backgroundColor:e.color},children:(0,t.jsx)("div",{className:"text-white",children:(s=e.action,({created:(0,t.jsx)(eh.A,{className:"h-4 w-4"}),updated:(0,t.jsx)(ej.A,{className:"h-4 w-4"}),deleted:(0,t.jsx)(eu.A,{className:"h-4 w-4"})})[s.toLowerCase()]||(0,t.jsx)(x.A,{className:"h-4 w-4"}))})})]}),(0,t.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:e.user})," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:e.action})," ",(0,t.jsx)("span",{className:"font-medium",children:e.resource})]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:(e=>{try{return V()(e).fromNow()}catch(s){return e}})(e.timestamp)})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(l.Exy,{variant:"secondary",className:"text-xs",children:e.action})})]})]},e.id)})})})]})}let{yP:ef,Es:ev,dC:ey,WX:ew,h8:eb}=q,eA={count:{label:"Users",color:"hsl(var(--chart-1))"}};function e_(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-40 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-56"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)(l.EAD,{className:"h-[300px] w-full"})})]})}function eE(e){let{statistics:s,isLoading:a}=e;if(a)return(0,t.jsx)(e_,{});if(!s)return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsx)(l.ZBx,{children:"User Statistics"})}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No user statistics available"})})]});let r=[{category:"Total Users",count:s.total_users,fill:"hsl(var(--chart-1))"},{category:"Active Users",count:s.active_users,fill:"hsl(var(--chart-2))"},{category:"New Users",count:s.new_users,fill:"hsl(var(--chart-3))"},{category:"Superusers",count:s.superusers,fill:"hsl(var(--chart-4))"}];return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{children:"User Statistics"}),(0,t.jsx)(l.BTJ,{children:"Breakdown of user accounts"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)(l.atp,{config:eA,className:"h-[300px] w-full",children:(0,t.jsxs)(ev,{data:r,children:[(0,t.jsx)(ey,{strokeDasharray:"3 3",className:"stroke-muted"}),(0,t.jsx)(ew,{dataKey:"category",tickLine:!1,axisLine:!1,tickMargin:8,className:"text-xs",angle:-45,textAnchor:"end",height:80}),(0,t.jsx)(eb,{tickLine:!1,axisLine:!1,tickMargin:8,className:"text-xs"}),(0,t.jsx)(l.IIn,{content:(0,t.jsx)(l.NtK,{})}),(0,t.jsx)(ef,{dataKey:"count",radius:[8,8,0,0]})]})})})]})}function eC(e){let{userStatistics:s,isLoadingUserStatistics:a,recentActivity:r,isLoadingRecentActivity:l}=e;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(eE,{statistics:s,isLoading:a}),(0,t.jsx)(eN,{activities:r,isLoading:l,maxItems:20})]})}var ek=a(69673),eD=a(47019),eM=a(47857),eZ=a(80587);let eL=e=>{try{return V()(e).fromNow()}catch(s){return e}};function eS(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-32 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-48"})]}),(0,t.jsx)(l.EAD,{className:"h-6 w-20"})]})}),(0,t.jsx)(l.Wux,{className:"space-y-4",children:Array.from({length:3}).map((e,s)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(l.EAD,{className:"h-4 w-24"}),(0,t.jsx)(l.EAD,{className:"h-4 w-16"})]}),(0,t.jsx)(l.EAD,{className:"h-2 w-full"})]},s))})]})}function eR(e){let{health:s,isLoading:a}=e;return a?(0,t.jsx)(eS,{}):s?(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(l.ZBx,{children:"System Health"}),(0,t.jsxs)(l.BTJ,{children:["Last check: ",eL(s.timestamp)]})]}),(0,t.jsx)(l.Exy,{variant:(e=>{switch(e){case"healthy":return"default";case"warning":case"unknown":default:return"secondary";case"error":return"destructive"}})(s.overall_status),children:s.overall_status.toUpperCase()})]})}),(0,t.jsxs)(l.Wux,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:"Overall Health"}),(0,t.jsxs)("span",{className:"text-sm font-bold",children:[s.overall_health_percentage,"%"]})]}),(0,t.jsx)(l.kej,{value:s.overall_health_percentage,className:"h-2"})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-sm font-medium",children:"Components"}),s.components.map((e,s)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(e=>{switch(e){case"healthy":return(0,t.jsx)(ek.A,{className:"h-4 w-4 text-green-500"});case"warning":return(0,t.jsx)(eD.A,{className:"h-4 w-4 text-yellow-500"});case"error":return(0,t.jsx)(eM.A,{className:"h-4 w-4 text-red-500"});default:return(0,t.jsx)(eZ.A,{className:"h-4 w-4 text-muted-foreground"})}})(e.status),(0,t.jsx)("span",{className:"text-sm font-medium",children:e.component})]}),(0,t.jsx)("span",{className:"text-xs font-medium ".concat((e=>{switch(e){case"healthy":return"text-green-500";case"warning":return"text-yellow-500";case"error":return"text-red-500";default:return"text-muted-foreground"}})(e.status)),children:e.status})]}),null!==e.health_percentage&&void 0!==e.health_percentage&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.description}),(0,t.jsxs)("span",{className:"text-xs font-medium",children:[e.health_percentage,"%"]})]}),(0,t.jsx)(l.kej,{value:e.health_percentage,className:"h-1.5"})]}),(null===e.health_percentage||void 0===e.health_percentage)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last check: ",eL(e.last_check)]})]},s))]})]})]}):(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsx)(l.ZBx,{children:"System Health"})}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)(l.FcD,{children:(0,t.jsx)(l.TND,{children:"No health data available"})})})]})}var eT=a(98958),eB=a(86240),eF=a(97818),eP=a(80574);function eW(e){let{icon:s,label:a,value:r,percentage:n,showProgress:c=!1}=e,i="number"==typeof r?"".concat(r,"%"):r;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"text-muted-foreground",children:s}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a})]}),c&&"number"==typeof n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-2xl font-bold",children:i}),(0,t.jsx)(l.Exy,{variant:n>=90?"destructive":n>=70?"secondary":"default",className:"ml-2",children:n>=90?"Critical":n>=70?"High":"Normal"})]}),(0,t.jsx)(l.kej,{value:n,className:"h-2"})]}):(0,t.jsx)("span",{className:"text-2xl font-bold",children:i})]})}function eH(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-40 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-56"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("div",{className:"grid gap-6 grid-cols-1 sm:grid-cols-2",children:Array.from({length:6}).map((e,s)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.EAD,{className:"h-4 w-24"}),(0,t.jsx)(l.EAD,{className:"h-8 w-20"}),(0,t.jsx)(l.EAD,{className:"h-2 w-full"})]},s))})})]})}function eU(e){let{metrics:s,isLoading:a}=e;return a?(0,t.jsx)(eH,{}):s?(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{children:"System Metrics"}),(0,t.jsx)(l.BTJ,{children:"Real-time system performance"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsxs)("div",{className:"grid gap-6 grid-cols-1 sm:grid-cols-2",children:[(0,t.jsx)(eW,{icon:(0,t.jsx)(eT.A,{className:"h-4 w-4"}),label:"CPU Usage",value:s.cpu_usage,percentage:s.cpu_usage,showProgress:!0}),(0,t.jsx)(eW,{icon:(0,t.jsx)(x.A,{className:"h-4 w-4"}),label:"Memory Usage",value:s.memory_usage,percentage:s.memory_usage,showProgress:!0}),(0,t.jsx)(eW,{icon:(0,t.jsx)(eB.A,{className:"h-4 w-4"}),label:"Disk Usage",value:s.disk_usage,percentage:s.disk_usage,showProgress:!0}),(0,t.jsx)(eW,{icon:(0,t.jsx)(eF.A,{className:"h-4 w-4"}),label:"Network In",value:s.network_in}),(0,t.jsx)(eW,{icon:(0,t.jsx)(eF.A,{className:"h-4 w-4"}),label:"Network Out",value:s.network_out}),(0,t.jsx)(eW,{icon:(0,t.jsx)(O.A,{className:"h-4 w-4"}),label:"Response Time",value:s.response_time}),(0,t.jsx)("div",{className:"sm:col-span-2",children:(0,t.jsx)(eW,{icon:(0,t.jsx)(eP.A,{className:"h-4 w-4"}),label:"System Uptime",value:s.uptime})})]})})]}):(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsx)(l.ZBx,{children:"System Metrics"})}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No metrics data available"})})]})}function eX(e){let{systemHealth:s,isLoadingSystemHealth:a,systemMetrics:r,isLoadingSystemMetrics:l,recentActivity:n,isLoadingRecentActivity:c}=e;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(eo,{metrics:r,isLoading:l}),(0,t.jsxs)("div",{className:"grid gap-6 grid-cols-1 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(eR,{health:s,isLoading:a}),(0,t.jsx)(eU,{metrics:r,isLoading:l})]}),(0,t.jsx)("div",{className:"space-y-6",children:(0,t.jsx)(eN,{activities:n,isLoading:c,maxItems:20})})]})]})}var eO=a(32436);function eI(){return(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-6 w-40 mb-2"}),(0,t.jsx)(l.EAD,{className:"h-4 w-32"})]}),(0,t.jsx)(l.Wux,{children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(l.EAD,{className:"h-4 w-full"}),(0,t.jsx)(l.EAD,{className:"h-4 w-3/4"}),(0,t.jsx)(l.EAD,{className:"h-4 w-1/2"})]})})]})}function eJ(e){let{appStatistics:s,isLoadingAppStatistics:a}=e;return a?(0,t.jsx)("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((e,s)=>(0,t.jsx)(eI,{},s))}):s&&0!==s.length?(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:"Application Statistics"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Statistics for all enabled django-cfg applications"})]}),(0,t.jsx)("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:s.map((e,s)=>(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(eO.A,{className:"h-5 w-5"}),e.app_name]}),(0,t.jsx)(l.BTJ,{className:"mt-1",children:"Application metrics"})]})})}),(0,t.jsx)(l.Wux,{children:(0,t.jsx)("div",{className:"space-y-3",children:e.statistics&&"object"==typeof e.statistics?Object.entries(e.statistics).map(e=>{let[s,a]=e;return"object"==typeof a&&null!==a?(0,t.jsxs)("div",{className:"border-l-2 border-primary/20 pl-3 space-y-2",children:[(0,t.jsx)("div",{className:"font-medium text-sm",children:a.name||s.replace(/_/g," ")}),(0,t.jsxs)("div",{className:"space-y-1",children:[void 0!==a.model_count&&(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Models"}),(0,t.jsx)("span",{className:"font-medium",children:a.model_count})]}),void 0!==a.total_records&&(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Total Records"}),(0,t.jsx)("span",{className:"font-medium",children:a.total_records.toLocaleString()})]})]})]},s):(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground capitalize",children:s.replace(/_/g," ")}),(0,t.jsx)("span",{className:"font-medium",children:"number"==typeof a?a.toLocaleString():String(a)})]},s)}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No statistics available"})})})]},s))})]}):(0,t.jsxs)(l.FcD,{children:[(0,t.jsx)(eD.A,{className:"h-4 w-4"}),(0,t.jsx)(l.TND,{children:"No application statistics available. This may indicate that no django-cfg apps are enabled or configured."})]})}var ez=a(6766);function eK(){var e,s,a,r,n,c,i,o;let{registrationChart:h,isLoadingRegistrationChart:j,registrationChartDays:u,setRegistrationChartDays:p,activityChart:g,isLoadingActivityChart:N,activityChartDays:f,setActivityChartDays:v,activityTracker:y,isLoadingActivityTracker:w,recentUsers:b,isLoadingRecentUsers:A,recentUsersLimit:_,setRecentUsersLimit:E}=k();return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(m.A,{className:"h-5 w-5"}),"User Registrations"]}),(0,t.jsx)(l.BTJ,{children:"New user registrations over time"})]}),(0,t.jsxs)(l.l6P,{value:u.toString(),onValueChange:e=>p(Number(e)),children:[(0,t.jsx)(l.bqE,{className:"w-[120px]",children:(0,t.jsx)(l.yvm,{})}),(0,t.jsxs)(l.gCo,{children:[(0,t.jsx)(l.ebT,{value:"7",children:"Last 7 days"}),(0,t.jsx)(l.ebT,{value:"30",children:"Last 30 days"}),(0,t.jsx)(l.ebT,{value:"90",children:"Last 90 days"})]})]})]})}),(0,t.jsx)(l.Wux,{children:j?(0,t.jsx)(l.EAD,{className:"w-full h-64"}):h?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Registrations"}),(0,t.jsx)("p",{className:"text-2xl font-bold",children:(null==(a=h.datasets)||null==(s=a[0])||null==(e=s.data)?void 0:e.reduce((e,s)=>e+s,0))||0})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Time Period"}),(0,t.jsxs)("p",{className:"text-2xl font-bold",children:[u," days"]})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:null==(r=h.labels)?void 0:r.map((e,s)=>{var a,r,l,n,c;let i=(null==(l=h.datasets)||null==(r=l[0])||null==(a=r.data)?void 0:a[s])||0;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm w-20 text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-6 overflow-hidden",children:(0,t.jsx)("div",{className:"bg-primary h-full flex items-center justify-end pr-2",style:{width:"".concat(i>0?i/Math.max(...(null==(c=h.datasets)||null==(n=c[0])?void 0:n.data)||[1])*100:0,"%")},children:i>0&&(0,t.jsx)("span",{className:"text-xs font-medium text-primary-foreground",children:i})})})]},e)})})]}):(0,t.jsx)("p",{className:"text-center text-muted-foreground py-8",children:"No data available"})})]}),(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(x.A,{className:"h-5 w-5"}),"User Activity"]}),(0,t.jsx)(l.BTJ,{children:"User activity patterns over time"})]}),(0,t.jsxs)(l.l6P,{value:f.toString(),onValueChange:e=>v(Number(e)),children:[(0,t.jsx)(l.bqE,{className:"w-[120px]",children:(0,t.jsx)(l.yvm,{})}),(0,t.jsxs)(l.gCo,{children:[(0,t.jsx)(l.ebT,{value:"7",children:"Last 7 days"}),(0,t.jsx)(l.ebT,{value:"30",children:"Last 30 days"}),(0,t.jsx)(l.ebT,{value:"90",children:"Last 90 days"})]})]})]})}),(0,t.jsx)(l.Wux,{children:N?(0,t.jsx)(l.EAD,{className:"w-full h-64"}):g?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Activities"}),(0,t.jsx)("p",{className:"text-2xl font-bold",children:(null==(i=g.datasets)||null==(c=i[0])||null==(n=c.data)?void 0:n.reduce((e,s)=>e+s,0))||0})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Time Period"}),(0,t.jsxs)("p",{className:"text-2xl font-bold",children:[f," days"]})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:null==(o=g.labels)?void 0:o.map((e,s)=>{var a,r,l,n,c;let i=(null==(l=g.datasets)||null==(r=l[0])||null==(a=r.data)?void 0:a[s])||0;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm w-20 text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-6 overflow-hidden",children:(0,t.jsx)("div",{className:"bg-primary h-full flex items-center justify-end pr-2",style:{width:"".concat(i>0?i/Math.max(...(null==(c=g.datasets)||null==(n=c[0])?void 0:n.data)||[1])*100:0,"%")},children:i>0&&(0,t.jsx)("span",{className:"text-xs font-medium text-primary-foreground",children:i})})})]},e)})})]}):(0,t.jsx)("p",{className:"text-center text-muted-foreground py-8",children:"No data available"})})]}),(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(ez.A,{className:"h-5 w-5"}),"Activity Tracker"]}),(0,t.jsx)(l.BTJ,{children:"GitHub-style activity heatmap (52 weeks)"})]}),(0,t.jsx)(l.Wux,{children:w?(0,t.jsx)(l.EAD,{className:"w-full h-32"}):y&&y.length>0?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Showing activity for the last ",y.length," days"]}),(0,t.jsx)("div",{className:"overflow-x-auto pb-2",children:(0,t.jsx)("div",{className:"inline-grid",style:{gridTemplateColumns:"repeat(".concat(Math.ceil(y.length/7),", 12px)"),gridTemplateRows:"repeat(7, 12px)",gridAutoFlow:"column",gap:"3px"},children:y.map((e,s)=>(0,t.jsx)("div",{className:"rounded-sm border border-border/40",style:{width:"12px",height:"12px",backgroundColor:e.color||"hsl(var(--muted))"},title:"".concat(e.date,": ").concat(e.count," activities (level ").concat(e.level,")")},s))})}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Total active days: ",y.filter(e=>e.count>0).length]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"Less"}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-sm border",style:{backgroundColor:"hsl(var(--muted))"}}),(0,t.jsx)("div",{className:"w-3 h-3 rounded-sm border",style:{backgroundColor:"hsl(var(--primary) / 0.2)"}}),(0,t.jsx)("div",{className:"w-3 h-3 rounded-sm border",style:{backgroundColor:"hsl(var(--primary) / 0.4)"}}),(0,t.jsx)("div",{className:"w-3 h-3 rounded-sm border",style:{backgroundColor:"hsl(var(--primary) / 0.6)"}}),(0,t.jsx)("div",{className:"w-3 h-3 rounded-sm border",style:{backgroundColor:"hsl(var(--primary) / 0.8)"}})]}),(0,t.jsx)("span",{children:"More"})]})]})]}):(0,t.jsx)("p",{className:"text-center text-muted-foreground py-8",children:"No activity data available"})})]}),(0,t.jsxs)(l.ZpM,{children:[(0,t.jsx)(l.aRn,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(d.A,{className:"h-5 w-5"}),"Recent Users"]}),(0,t.jsx)(l.BTJ,{children:"Recently registered users"})]}),(0,t.jsxs)(l.l6P,{value:_.toString(),onValueChange:e=>E(Number(e)),children:[(0,t.jsx)(l.bqE,{className:"w-[120px]",children:(0,t.jsx)(l.yvm,{})}),(0,t.jsxs)(l.gCo,{children:[(0,t.jsx)(l.ebT,{value:"5",children:"Show 5"}),(0,t.jsx)(l.ebT,{value:"10",children:"Show 10"}),(0,t.jsx)(l.ebT,{value:"20",children:"Show 20"})]})]})]})}),(0,t.jsx)(l.Wux,{children:A?(0,t.jsx)("div",{className:"space-y-2",children:Array.from({length:5}).map((e,s)=>(0,t.jsx)(l.EAD,{className:"w-full h-12"},s))}):b&&b.length>0?(0,t.jsxs)(l.XIK,{children:[(0,t.jsx)(l.A0N,{children:(0,t.jsxs)(l.Hjg,{children:[(0,t.jsx)(l.ndF,{children:"Username"}),(0,t.jsx)(l.ndF,{children:"Email"}),(0,t.jsx)(l.ndF,{children:"Status"}),(0,t.jsx)(l.ndF,{className:"text-right",children:"Registered"})]})}),(0,t.jsx)(l.BFY,{children:b.map(e=>(0,t.jsxs)(l.Hjg,{children:[(0,t.jsx)(l.nA6,{className:"font-medium",children:e.username}),(0,t.jsx)(l.nA6,{children:e.email}),(0,t.jsx)(l.nA6,{children:(0,t.jsx)(l.Exy,{variant:e.is_active?"default":"secondary",children:e.is_active?"Active":"Inactive"})}),(0,t.jsx)(l.nA6,{className:"text-right text-muted-foreground",children:new Date(e.date_joined).toLocaleDateString()})]},e.id))})]}):(0,t.jsx)("p",{className:"text-center text-muted-foreground py-8",children:"No users found"})})]})]})}var eq=a(55244);function eG(){var e;let{commands:s,isLoadingCommands:a,summary:n,isLoadingSummary:c}=L(),[i,d]=(0,r.useState)(""),[x,o]=(0,r.useState)("all"),m=r.useMemo(()=>s&&Array.isArray(s)?s.filter(e=>{let s=!i||e.name.toLowerCase().includes(i.toLowerCase())||e.help.toLowerCase().includes(i.toLowerCase()),a="all"===x||"core"===x&&e.is_core||"custom"===x&&e.is_custom||"third-party"===x&&!e.is_core&&!e.is_custom;return s&&a}):[],[s,i,x]);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-4",children:c?(0,t.jsx)(t.Fragment,{children:Array.from({length:4}).map((e,s)=>(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-4 w-24"}),(0,t.jsx)(l.EAD,{className:"h-8 w-16"})]})},s))}):n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Total Commands"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:n.total_commands})]})}),(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Core Commands"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:n.core_commands})]})}),(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Custom Commands"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:n.custom_commands})]})}),(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Categories"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:(null==(e=n.categories)?void 0:e.length)||0})]})})]}):null}),(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(h.A,{className:"h-5 w-5"}),"Django Management Commands"]}),(0,t.jsx)(l.BTJ,{children:"All available management commands"})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mt-4",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(l.pde,{placeholder:"Search commands...",value:i,onChange:e=>d(e.target.value),className:"max-w-sm"})}),(0,t.jsxs)(l.l6P,{value:x,onValueChange:o,children:[(0,t.jsx)(l.bqE,{className:"w-[180px]",children:(0,t.jsx)(l.yvm,{placeholder:"Filter by type"})}),(0,t.jsxs)(l.gCo,{children:[(0,t.jsx)(l.ebT,{value:"all",children:"All Commands"}),(0,t.jsx)(l.ebT,{value:"core",children:"Core Only"}),(0,t.jsx)(l.ebT,{value:"custom",children:"Custom Only"}),(0,t.jsx)(l.ebT,{value:"third-party",children:"Third Party Only"})]})]})]})]}),(0,t.jsx)(l.Wux,{children:a?(0,t.jsx)("div",{className:"space-y-2",children:Array.from({length:10}).map((e,s)=>(0,t.jsx)(l.EAD,{className:"w-full h-16"},s))}):m.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.XIK,{children:[(0,t.jsx)(l.A0N,{children:(0,t.jsxs)(l.Hjg,{children:[(0,t.jsx)(l.ndF,{children:"Command"}),(0,t.jsx)(l.ndF,{children:"App"}),(0,t.jsx)(l.ndF,{children:"Type"}),(0,t.jsx)(l.ndF,{className:"max-w-md",children:"Help"})]})}),(0,t.jsx)(l.BFY,{children:m.map(e=>(0,t.jsxs)(l.Hjg,{children:[(0,t.jsx)(l.nA6,{children:(0,t.jsx)("code",{className:"relative rounded bg-muted px-2 py-1 font-mono text-sm",children:e.name})}),(0,t.jsx)(l.nA6,{children:(0,t.jsxs)(l.Exy,{variant:"outline",children:[(0,t.jsx)(eO.A,{className:"h-3 w-3 mr-1"}),e.app]})}),(0,t.jsx)(l.nA6,{children:(0,t.jsxs)("div",{className:"flex gap-1",children:[e.is_core&&(0,t.jsx)(l.Exy,{variant:"default",children:"Core"}),e.is_custom&&(0,t.jsx)(l.Exy,{variant:"secondary",children:"Custom"}),!e.is_core&&!e.is_custom&&(0,t.jsx)(l.Exy,{variant:"outline",children:"Third Party"})]})}),(0,t.jsx)(l.nA6,{className:"max-w-md text-sm text-muted-foreground truncate",children:e.help||"No description available"})]},"".concat(e.app,"-").concat(e.name)))})]}),s&&s.length>0&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Showing ",m.length," of ",s.length," commands"]})})]}):(0,t.jsxs)("div",{className:"text-center py-12",children:[(0,t.jsx)(eq.A,{className:"h-12 w-12 mx-auto text-muted-foreground/50"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground",children:"No commands found matching your filters"})]})})]})]})}var eV=a(89460),eQ=a(31740);function eY(){let{zones:e,isLoadingZones:s,summary:a,isLoadingSummary:r}=B();return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-3",children:r?(0,t.jsx)(t.Fragment,{children:Array.from({length:3}).map((e,s)=>(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.EAD,{className:"h-4 w-24"}),(0,t.jsx)(l.EAD,{className:"h-8 w-16"})]})},s))}):(null==a?void 0:a.summary)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Total Zones"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:a.summary.total_zones})]})}),(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Total Apps"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:a.summary.total_apps})]})}),(0,t.jsx)(l.ZpM,{children:(0,t.jsxs)(l.aRn,{children:[(0,t.jsx)(l.ZBx,{className:"text-sm font-medium text-muted-foreground",children:"Total Endpoints"}),(0,t.jsx)("div",{className:"text-3xl font-bold",children:a.summary.total_endpoints})]})})]}):null}),(0,t.jsxs)(l.ZpM,{children:[(0,t.jsxs)(l.aRn,{children:[(0,t.jsxs)(l.ZBx,{className:"flex items-center gap-2",children:[(0,t.jsx)(j.A,{className:"h-5 w-5"}),"API Zones"]}),(0,t.jsx)(l.BTJ,{children:"OpenAPI zones with their configuration and endpoints"})]}),(0,t.jsx)(l.Wux,{children:s?(0,t.jsx)("div",{className:"space-y-2",children:Array.from({length:5}).map((e,s)=>(0,t.jsx)(l.EAD,{className:"w-full h-24"},s))}):e&&Array.isArray(e)&&e.length>0?(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(l.XIK,{children:[(0,t.jsx)(l.A0N,{children:(0,t.jsxs)(l.Hjg,{children:[(0,t.jsx)(l.ndF,{children:"Zone"}),(0,t.jsx)(l.ndF,{children:"Description"}),(0,t.jsx)(l.ndF,{className:"text-center",children:"Apps"}),(0,t.jsx)(l.ndF,{className:"text-center",children:"Endpoints"}),(0,t.jsx)(l.ndF,{children:"Status"}),(0,t.jsx)(l.ndF,{className:"text-right",children:"Actions"})]})}),(0,t.jsx)(l.BFY,{children:e.map(e=>(0,t.jsxs)(l.Hjg,{children:[(0,t.jsx)(l.nA6,{children:(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:e.title}),(0,t.jsx)("code",{className:"text-xs text-muted-foreground",children:e.name})]})}),(0,t.jsxs)(l.nA6,{className:"max-w-md",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground truncate",children:e.description}),e.apps&&e.apps.length>0&&(0,t.jsxs)("div",{className:"flex gap-1 mt-2 flex-wrap",children:[e.apps.slice(0,3).map(e=>(0,t.jsxs)(l.Exy,{variant:"outline",className:"text-xs",children:[(0,t.jsx)(eO.A,{className:"h-3 w-3 mr-1"}),e]},e)),e.apps.length>3&&(0,t.jsxs)(l.Exy,{variant:"outline",className:"text-xs",children:["+",e.apps.length-3," more"]})]})]}),(0,t.jsx)(l.nA6,{className:"text-center",children:(0,t.jsx)(l.Exy,{variant:"secondary",children:e.app_count})}),(0,t.jsx)(l.nA6,{className:"text-center",children:(0,t.jsx)(l.Exy,{variant:"secondary",children:e.endpoint_count})}),(0,t.jsx)(l.nA6,{children:(0,t.jsx)(l.Exy,{variant:"active"===e.status?"default":"empty"===e.status?"secondary":"outline",children:e.status})}),(0,t.jsx)(l.nA6,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,t.jsxs)(l.$nd,{variant:"ghost",size:"sm",onClick:()=>window.open(e.schema_url,"_blank"),children:[(0,t.jsx)(eV.A,{className:"h-4 w-4 mr-1"}),"Schema"]}),(0,t.jsxs)(l.$nd,{variant:"ghost",size:"sm",onClick:()=>window.open(e.api_url,"_blank"),children:[(0,t.jsx)(eQ.A,{className:"h-4 w-4 mr-1"}),"API"]})]})})]},e.name))})]})}):(0,t.jsxs)("div",{className:"text-center py-12",children:[(0,t.jsx)(j.A,{className:"h-12 w-12 mx-auto text-muted-foreground/50"}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground",children:"No API zones configured"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Configure OpenAPI groups in your Django settings"})]})})]})]})}function e$(){let{cards:e,isLoadingCards:s,cardsError:a,users:u,isLoadingUsers:p,usersError:N,apps:f,isLoadingApps:y,appsError:w,refreshAll:A}=function(){let e=(0,r.useContext)(g);if(!e)throw Error("useDashboardStatisticsContext must be used within DashboardStatisticsProvider");return e}(),{health:_,isLoadingHealth:E,healthError:C,metrics:D,isLoadingMetrics:M,metricsError:Z,refreshAll:S}=function(){let e=(0,r.useContext)(v);if(!e)throw Error("useDashboardSystemContext must be used within DashboardSystemProvider");return e}(),{recentActivity:R,isLoadingRecentActivity:T,recentActivityError:F,quickActions:P,isLoadingQuickActions:W,quickActionsError:H,refreshAll:U}=function(){let e=(0,r.useContext)(b);if(!e)throw Error("useDashboardActivityContext must be used within DashboardActivityProvider");return e}(),{refreshAll:X}=k(),{refreshAll:O}=L(),{refreshAll:I}=B(),J=async()=>{await Promise.all([A(),S(),U(),X(),O(),I()])},z=a||C||Z||F||H||N||w,K=s&&E&&M&&T&&W&&p&&y;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-3xl font-bold tracking-tight",children:"Dashboard"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Welcome back! Here's your system overview."})]}),(0,t.jsxs)(l.$nd,{onClick:J,disabled:K,variant:"outline",size:"sm",children:[(0,t.jsx)(n.A,{className:"h-4 w-4 mr-2 ".concat(K?"animate-spin":"")}),"Refresh"]})]}),z&&(0,t.jsxs)(l.FcD,{variant:"destructive",children:[(0,t.jsx)(c.A,{className:"h-4 w-4"}),(0,t.jsx)(l.XL1,{children:"Error Loading Dashboard Data"}),(0,t.jsx)(l.TND,{children:"Some dashboard components failed to load. Please try refreshing."})]}),(0,t.jsxs)(l.tUM,{defaultValue:"overview",className:"space-y-6",children:[(0,t.jsxs)(l.j7C,{className:"grid w-full grid-cols-7 gap-2",children:[(0,t.jsxs)(l.Xib,{value:"overview",className:"flex items-center gap-2",children:[(0,t.jsx)(i.A,{className:"h-4 w-4"}),"Overview"]}),(0,t.jsxs)(l.Xib,{value:"users",className:"flex items-center gap-2",children:[(0,t.jsx)(d.A,{className:"h-4 w-4"}),"Users"]}),(0,t.jsxs)(l.Xib,{value:"system",className:"flex items-center gap-2",children:[(0,t.jsx)(x.A,{className:"h-4 w-4"}),"System"]}),(0,t.jsxs)(l.Xib,{value:"app-stats",className:"flex items-center gap-2",children:[(0,t.jsx)(o.A,{className:"h-4 w-4"}),"Apps"]}),(0,t.jsxs)(l.Xib,{value:"charts",className:"flex items-center gap-2",children:[(0,t.jsx)(m.A,{className:"h-4 w-4"}),"Charts"]}),(0,t.jsxs)(l.Xib,{value:"commands",className:"flex items-center gap-2",children:[(0,t.jsx)(h.A,{className:"h-4 w-4"}),"Commands"]}),(0,t.jsxs)(l.Xib,{value:"zones",className:"flex items-center gap-2",children:[(0,t.jsx)(j.A,{className:"h-4 w-4"}),"Zones"]})]}),(0,t.jsx)(l.avX,{value:"overview",className:"space-y-6",children:(0,t.jsx)(em,{statCards:e,isLoadingStatCards:s,systemHealth:_,isLoadingSystemHealth:E,quickActions:P,isLoadingQuickActions:W,systemMetrics:D,isLoadingSystemMetrics:M})}),(0,t.jsx)(l.avX,{value:"users",className:"space-y-6",children:(0,t.jsx)(eC,{userStatistics:u,isLoadingUserStatistics:p,recentActivity:R,isLoadingRecentActivity:T})}),(0,t.jsx)(l.avX,{value:"system",className:"space-y-6",children:(0,t.jsx)(eX,{systemHealth:_,isLoadingSystemHealth:E,systemMetrics:D,isLoadingSystemMetrics:M,recentActivity:R,isLoadingRecentActivity:T})}),(0,t.jsx)(l.avX,{value:"app-stats",className:"space-y-6",children:(0,t.jsx)(eJ,{appStatistics:f,isLoadingAppStatistics:y})}),(0,t.jsx)(l.avX,{value:"charts",className:"space-y-6",children:(0,t.jsx)(eK,{})}),(0,t.jsx)(l.avX,{value:"commands",className:"space-y-6",children:(0,t.jsx)(eG,{})}),(0,t.jsx)(l.avX,{value:"zones",className:"space-y-6",children:(0,t.jsx)(eY,{})})]})]})}function e0(){return(0,t.jsx)(N,{children:(0,t.jsx)(y,{children:(0,t.jsx)(A,{children:(0,t.jsx)(C,{children:(0,t.jsx)(Z,{children:(0,t.jsx)(T,{children:(0,t.jsx)(e$,{})})})})})})})}function e2(){return(0,t.jsx)(e0,{})}},96482:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/private",function(){return a(93442)}])}},e=>{e.O(0,[23004,50314,90636,46593,38792],()=>e(e.s=96482)),_N_E=e.O()}]);
|