1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{403:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("megaphone",[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]])},14234:(e,t,a)=>{"use strict";a.d(t,{F:()=>n});var s=a(36489);async function r(){try{await (0,s.signOut)({redirect:!1}),window.location.href="/login"}catch(e){console.error("Error during logout:",e),window.location.href="/login"}}async function i(e){var t,a;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=await (0,s.getSession)(),l=null==n||null==(t=n.user)?void 0:t.accessToken;if(!l)throw await r(),Error("No access token found");try{let t=new URL(e,window.location.origin);i.params&&Object.entries(i.params).forEach(e=>{let[a,s]=e;t.searchParams.append(a,s)});let s=await fetch(t,{...i,headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(l),...i.headers},credentials:"include"});if(!s.ok){if(401===s.status)throw await r(),Error("Session expired. Please login again.");if(403===s.status)throw Error("You do not have permission to access this resource.");let e="Something went wrong. Please try again.";try{let t=await s.json();e=null!=(a=function(e){if(!e||"object"!=typeof e)return null;if("string"==typeof e.error&&e.error.trim())return e.error.trim();if("string"==typeof e.message&&e.message.trim())return e.message.trim();if("string"==typeof e.detail&&e.detail.trim())return e.detail.trim();if(Array.isArray(e.detail)){let t=e.detail.map(e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e&&"msg"in e){var t;return String(null!=(t=e.msg)?t:"")}return""}).filter(Boolean);if(t.length>0)return t.join(" ")}return null}(t))?a:e}catch(e){}throw Error(e)}return s.json()}catch(e){if(e instanceof Error)throw e;throw Error("An unexpected error occurred")}}let n={get:(e,t,a)=>i(e,{method:"GET",params:t,...null!=a?a:{}}),post:(e,t,a,s)=>i(e,{method:"POST",body:JSON.stringify(t),params:a,...null!=s?s:{}}),put:(e,t,a,s)=>i(e,{method:"PUT",body:JSON.stringify(t),params:a,...null!=s?s:{}}),patch:(e,t,a,s)=>i(e,{method:"PATCH",body:JSON.stringify(t),params:a,...null!=s?s:{}}),delete:(e,t,a)=>i(e,{method:"DELETE",params:t,...null!=a?a:{}})}},19408:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]])},23664:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},24970:(e,t,a)=>{Promise.resolve().then(a.bind(a,32563))},32563:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>b});var s=a(95155),r=a(12115),i=a(52619),n=a.n(i),l=a(60890),o=a(52020),d=a(85710),c=a(71871),m=a(19408),h=a(23664),u=a(403),x=a(89559),g=a(14234),p=a(85289);function b(){let[e,t]=(0,r.useState)({userCount:0,clientCount:0,organizationCount:0,siteCount:0}),[a,i]=(0,r.useState)({feedbackCount:0,feedbackAverage:0,feedbackBreakdown:{1:0,2:0,3:0,4:0,5:0}}),[b,f]=(0,r.useState)(!0),[k,y]=(0,r.useState)(null);(0,r.useEffect)(()=>{w()},[]);let w=async()=>{try{f(!0),y(null);let[e,a]=await Promise.allSettled([g.F.get("/api/admin/dashboard"),g.F.get("/api/admin/feedback")]);if("fulfilled"===e.status)t(e.value);else throw e.reason;"fulfilled"===a.status?i(a.value):i({feedbackCount:0,feedbackAverage:0,feedbackBreakdown:{1:0,2:0,3:0,4:0,5:0}})}catch(e){console.error("Error fetching dashboard stats:",e),y("Failed to load dashboard statistics")}finally{f(!1)}},N=[{title:"How-To Guides",description:"Watch video tutorials on how to use the WS Insights platform, manage users, accounts, and budgets.",icon:(0,s.jsx)(l.A,{className:"w-12 h-12 text-[#003153]"}),link:"/manage/how-to",linkText:"Watch Tutorials"},{title:"User Management",description:"Add, edit, and manage user accounts. Control permissions, reset passwords, and configure user roles and access levels.",icon:(0,s.jsx)(o.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/users",linkText:"Manage Users"},{title:"Client Management",description:"Manage client accounts, subscription plans, and billing information. Track client activity and configure client-specific settings.",icon:(0,s.jsx)(d.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/clients",linkText:"Manage Clients"},{title:"Organization Management",description:"Create and manage organizations within clients. Configure organization details, assign sites, and manage organizational structure.",icon:(0,s.jsx)(c.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/organizations",linkText:"Manage Organizations"},{title:"Site Management",description:"Oversee all site configurations, locations, and performance metrics. Add new sites or modify existing site details.",icon:(0,s.jsx)(m.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/sites",linkText:"Manage Sites"},{title:"Email Management",description:"Manage email receivers for onboarding and notifications. Add, edit, or remove email addresses and configure email delivery settings.",icon:(0,s.jsx)(h.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/email",linkText:"Manage Email Receivers"},{title:"Release Notes",description:"Manage release notes shown to users on first login. Add, edit, or remove releases and set visible to all users again.",icon:(0,s.jsx)(u.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/release-notes",linkText:"Manage Release Notes"},{title:"Power BI Roles Management",description:"Manage Power BI roles for datasets and workspaces. Add, edit, or remove roles and configure role assignments.",icon:(0,s.jsx)(h.A,{className:"w-12 h-12 text-[#003153]"}),link:"/admin/pbi-roles",linkText:"Manage Power BI Roles"}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center mb-8 md:mb-10",children:[(0,s.jsx)("h1",{className:"text-4xl md:text-5xl font-bold text-[#003153] mb-2",children:"Admin Control Center"}),(0,s.jsxs)("h2",{className:"text-xl md:text-3xl font-medium",children:[(0,s.jsx)("span",{className:"italic",children:"System"})," ",(0,s.jsx)("span",{className:"font-bold",children:"Administration"})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-md border border-gray-200 p-6 mb-8",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold text-[#003153]",children:"System Overview"}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsxs)("button",{onClick:w,className:"p-2 bg-[#003153] text-white rounded-md hover:bg-[#004173] transition-colors flex items-center",disabled:b,children:[(0,s.jsx)(x.A,{className:"h-4 w-4 mr-1 ".concat(b?"animate-spin":"")}),(0,s.jsx)("span",{children:"Refresh"})]}),(0,s.jsxs)("button",{onClick:()=>{(0,p.hW)("clear-cache"),console.log("Broadcast sent to clear cache! This will affect all open tabs.")},className:"p-2 bg-[#003153] text-white rounded-md hover:bg-[#004173] transition-colors flex items-center",disabled:b,children:[(0,s.jsx)(x.A,{className:"h-4 w-4 mr-1 ".concat(b?"animate-spin":"")}),(0,s.jsx)("span",{children:"Clear Cache"})]})]})]}
1),k&&(0,s.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-red-600",children:k}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,s.jsxs)("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-100",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"Total Users"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-16 bg-blue-100 animate-pulse rounded h-8"}):e.userCount})]}),(0,s.jsxs)("div",{className:"bg-purple-50 p-4 rounded-lg border border-purple-100",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"Clients"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-16 bg-purple-100 animate-pulse rounded h-8"}):e.clientCount})]}),(0,s.jsxs)("div",{className:"bg-amber-50 p-4 rounded-lg border border-amber-100",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"Organizations"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-16 bg-amber-100 animate-pulse rounded h-8"}):e.organizationCount})]}),(0,s.jsxs)("div",{className:"bg-green-50 p-4 rounded-lg border border-green-100",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"Active Sites"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-16 bg-green-100 animate-pulse rounded h-8"}):e.siteCount})]})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-md border border-gray-200 p-6 mb-8",children:[(0,s.jsx)("h3",{className:"text-xl font-bold text-[#003153] mb-4",children:"Platform Feedback"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{className:"bg-slate-50 p-4 rounded-lg border border-slate-100",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"Total Responses"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-16 bg-slate-100 animate-pulse rounded h-8"}):a.feedbackCount})]}),(0,s.jsxs)("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-100",children:[(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"Average Rating"}),(0,s.jsx)("p",{className:"text-3xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-16 bg-blue-100 animate-pulse rounded h-8"}):a.feedbackCount>0?a.feedbackAverage.toFixed(1):"N/A"})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[1,2,3,4,5].map(e=>{var t;return(0,s.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg border border-gray-100",children:[(0,s.jsxs)("p",{className:"text-gray-500 text-sm",children:[e," Star"]}),(0,s.jsx)("p",{className:"text-2xl font-bold text-[#003153]",children:b?(0,s.jsx)("span",{className:"inline-block w-12 bg-gray-100 animate-pulse rounded h-7"}):null!=(t=a.feedbackBreakdown[e])?t:0})]},e)})}),!b&&0===a.feedbackCount&&(0,s.jsx)("p",{className:"mt-4 text-sm text-gray-500",children:"No feedback yet."})]}),(0,s.jsx)("div",{className:"grid md:grid-cols-2 gap-6 mb-8",children:N.map((e,t)=>(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-md border border-gray-200 p-6 flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-start mb-4",children:[(0,s.jsx)("div",{className:"mr-4 p-2",children:e.icon}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xl font-bold text-[#003153] mb-2",children:e.title}),(0,s.jsx)("p",{className:"text-gray-600 mb-4",children:e.description})]})]}),"#"===e.link?(0,s.jsx)("div",{className:"mt-auto inline-block px-4 py-2 bg-gray-200 text-gray-500 rounded-md font-medium self-start",children:e.linkText}):(0,s.jsx)(n(),{href:e.link,className:"mt-auto inline-block px-4 py-2 bg-[#003153] text-white rounded-md font-medium self-start hover:bg-[#004173] transition-colors",children:e.linkText})]},t))})]})}},52020:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("users-round",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},60890:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]])},71847:(e,t,a)=>{"use strict";a.d(t,{A:()=>
1o});var s=a(12115);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,s.forwardRef)((e,t)=>{let{color:a="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:d="",children:c,iconNode:m,...h}=e;return(0,s.createElement)("svg",{ref:t,...n,width:r,height:r,stroke:a,strokeWidth:o?24*Number(l)/Number(r):l,className:i("lucide",d),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(h)&&{"aria-hidden":"true"},...h},[...m.map(e=>{let[t,a]=e;return(0,s.createElement)(t,a)}),...Array.isArray(c)?c:[c]])}),o=(e,t)=>{let a=(0,s.forwardRef)((a,n)=>{let{className:o,...d}=a;return(0,s.createElement)(l,{ref:n,iconNode:t,className:i("lucide-".concat(r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),o),...d})});return a.displayName=r(e),a}},71871:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("building",[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]])},85289:(e,t,a)=>{"use strict";a.d(t,{Hl:()=>i,hW:()=>r});let s=new BroadcastChannel("pwa-broadcast"),r=e=>{s.postMessage(e)},i=e=>{s.onmessage=t=>{e(t.data)}}},85710:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).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"}]])},89559:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).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"}]])}},e=>{e.O(0,[6489,2619,8441,1255,7358],()=>e(e.s=24970)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.