1import{o as n}from"./index-BNPflmqD.js";function o(a){const t=a.is_active!==!1;return{id:String(a.id??""),email:String(a.email??"â"),displayName:String(a.display_name??a.email??"â"),plan:String(a.plan_name??a.plan??a.tier??"free"),role:String(a.role??"customer"),status:t?"active":"banned",isAdmin:!!a.is_admin,isActive:t,createdAt:a.created_at?String(a.created_at):null,lastLoginAt:a.last_login_at?String(a.last_login_at):null,lastIp:a.last_ip?String(a.last_ip):null}}function m(a){let t=[],e={page:1,limit:50,total:0,pages:0};const r=s=>{const i=s.data??s;Array.isArray(i.users)&&(t=i.users);const c=i.pagination;c&&(e={page:Number(c.page??1),limit:Number(c.limit??50),total:Number(c.total??t.length),pages:Number(c.pages??1)})};return Array.isArray(a)?(t=a,e.total=t.length):a&&typeof a=="object"&&r(a),{users:t.map(o),pagination:e}}function l(a){const t=a,e=t.data??t,s=(e.ai_usage??{}).last_period??{};return{platformConnectionsCount:Number(e.platform_connections_count??0),sessionsCount:Number(e.sessions_count??0),aiCostCents:Number(s.total_cost_cents??0),aiTokens:Number(s.total_tokens??0)}}function g(a){const t=a;return((t.data??t).logs??t.logs??[]).map((s,i)=>({id:String(s.id??s.event_id??`log-${i}`),timestamp:String(s.timestamp??"â"),severity:String(s.severity??"info"),message:String(s.message??s.description??s.event_type??"â"),action:String(s.action??s.event_type??"â"),userId:s.user_id?String(s.user_id):null,ipAddress:s.ip_address?String(s.ip_address):null}))}async function f(){const{data:a}=await n.get("/admin/dashboard");return a}async function p(){const{data:a}=await n.get("/admin/monitoring");return a}async function y(){const{data:a}=await n.get("/admin/metrics/db-pool");return a}async function h(a){const{data:t}=await n.get("/errors/log",{params:a});return t}async function w(){const{data:a}=await n.delete("/errors/log");return a}async function b(a){const{data:t}=await n.get("/admin/users",{params:a});return t}async function _(a,t=90){const{data:e}=await n.get(`/admin/users/${a}/usage`,{params:{days:t}});return e}async function A(){const{data:a}=await n.get("/admin/platform-usage/overview");return a}async function v(a){const{data:t}=await n.get("/admin/feedback",{params:a});return t}async function S(){const{data:a}=await n.get("/admin/feedback/stats");return a}async function k(){const{data:a}=await n.get("/admin/feedback/admins/list");return a}async function U(){const{data:a}=await n.get("/admin/business-metrics");return a}async function C(a=12){const{data:t}=await n.get("/admin/mrr-trend",{params:{months:a}});return t}async function M(a,t){const{data:e}=await n.patch(`/admin/users/${a}/ban`,{reason:t});return e}async function $(a){const{data:t}=await n.patch(`/admin/users/${a}/unban`,{});return t}async function F(a,t){const{data:e}=await n.patch(`/admin/users/${a}/role`,{make_admin:t});return e}async function N(a,t){const{data:e}=await n.patch(`/admin/users/${a}/plan`,{plan:t,confirm:!0});return e}async function T(a){const{data:t}=await n.post(`/admin/users/${a}/impersonate`,{});return t}async function E(a){const{data:t}=await n.post("/admin/users/impersonation/exchange",{token:a},{headers:{"X-Impersonation-Token":a}});return t}async function I(a,t){const{data:e}=await n.patch(`/admin/feedback/${a}`,t);return e}async function L(a,t){const{data:e}=await n.post("/admin/security/block-ip",{ip_address:a,reason:t??"Blocked by admin"});return e}async function O(a){const{data:t}=await n.post("/admin/security/unblock-ip",{ip_address:a});return t}async function P(a){const{data:t}=await n.post("/admin/monitoring/resolve-alert",{alert_id:a});return t}async function B(){const{data:a}=await n.post("/admin/ml/bigquery/sync",{});return a}async function x(){const{data:a}=await n.get("/admin/ml/bigquery");return a}async function D(){const{data:a}=await n.get("/admin/ml/overview");return a}async function R(a=30){const{data:t}=await n.get("/admin/ml/llm-usage",{params:{days:a}});return t}async function j(a){const{data:t}=await n.get("/admin/ml/fine-tune-jobs",{params:a});return t}async function q(){const{data:a}=await n.get("/admin/ml/models");return a}
1async function H(){const{data:a}=await n.get("/admin/ml/mcp/overview");return a}async function J(a=30){const{data:t}=await n.get("/admin/ml/mcp/usage",{params:{days:a}});return t}async function Q(){const{data:a}=await n.get("/admin/security");return a}async function X(){const{data:a}=await n.get("/admin/ai-systems");return a}function d(a){const t=String(a.key??""),e=String(a.display_name??a.name??t);return{key:t,name:e,display_name:e,description:a.description!=null?String(a.description):void 0,enabled:!!a.enabled,flag_type:a.flag_type!=null?String(a.flag_type):void 0,category:a.category!=null?String(a.category):void 0}}async function z(){const{data:a}=await n.get("/feature-flags");return(Array.isArray(a)?a:a&&typeof a=="object"&&Array.isArray(a.flags)?a.flags:[]).map(d)}async function G(a,t){const{data:e}=await n.patch(`/feature-flags/${encodeURIComponent(a)}`,{enabled:t});return e}async function K(){const{data:a}=await n.get("/admin/health/modules");return a}async function V(){const{data:a}=await n.get("/admin/platform-config/");return Array.isArray(a)?a:[]}async function W(a,t){const{data:e}=await n.patch(`/admin/platform-config/${encodeURIComponent(a)}`,t);return e}async function Y(){const{data:a}=await n.get("/admin/test-email/types");return a.email_types??[]}async function Z(a,t){const{data:e}=await n.post("/admin/test-email",{email_type:a,to_email:t});return e}async function aa(a){const{data:t}=await n.get("/admin/sync-health",{params:a});return t}async function ta(a){const{data:t}=await n.get("/admin/audit-logs",{params:a});return t}async function na(a){const{data:t}=await n.get("/admin/ops/agencies",{params:a});return t}async function ea(a){const{data:t}=await n.get(`/admin/ops/agencies/${a}`);return t}async function sa(a,t){const{data:e}=await n.patch(`/admin/ops/agencies/${a}/status`,{status:t});return e}async function ia(a,t){const{data:e}=await n.patch(`/admin/ops/agencies/${a}/tier`,{tier_id:t});return e}async function ca(){const{data:a}=await n.get("/changelog/admin/drafts");return a}async function ra(a){const{data:t}=await n.get("/changelog/published",{params:a});return t}async function oa(a){const{data:t}=await n.post("/changelog/admin/create",a);return t}async function da(a,t){const{data:e}=await n.put(`/changelog/admin/${a}`,t);return e}async function ua(a){const{data:t}=await n.post(`/changelog/admin/${a}/publish`,{});return t}async function ma(a){await n.delete(`/changelog/admin/${a}`)}async function la(a=365){const{data:t}=await n.post("/changelog/admin/service-token",{},{params:{expires_days:a}});return t}export{W as $,O as A,L as B,Q as C,ta as D,g as E,D as F,R as G,H,J as I,j as J,q as K,x as L,B as M,U as N,C as O,v as P,S as Q,k as R,I as S,ca as T,ra as U,la as V,ma as W,ua as X,da as Y,oa as Z,V as _,A as a,Y as a0,Z as a1,N as b,F as c,$ as d,E as e,f,M as g,l as h,T as i,_ as j,na as k,b as l,sa as m,ia as n,ea as o,m as p,p as q,y as r,P as s,G as t,z as u,X as v,aa as w,K as x,h as y,w as z};
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.