PageSourceSearch

https://myechoboard.com/assets/ManageOverview-DQJJPbxs.js

js myechoboard.com collected 2026-10-02 00:21:34 UTC 34,056 bytes, 1 lines download raw bytes

vendor: 9,097 bytes, line 1
1import{r as e,j as t}from"./vendor-react-BfgFmtGS.js";import{s as a}from"./documentVisibilitySubscriptions-CqVNm4Da.js";import{supabase as r}from"./supabase-client-2CObC91N.js";import{a as s}from"./useAuth-DynbexoK.js";import{B as i}from"./button-CYJdLL_L.js";import{B as l}from"./badge-Cd6jhgwG.js";import{C as o,a as n,b as d,d as c}from"./card-pSM3z4Zt.js";import{I as m}from"./input-Cv-gXlbe.js";import{u as x,c as u,P as h}from"./index-Bj_QpGJn.js";import{u as p,b}from"./index-h37mMD1s.js";import{c as g,P as f}from"./index-DvGZCNsD.js";import{D as v}from"./index-8Q0hjuah.js";import{u as w}from"./index-DYDcV3bE.js";import{c as k,R as j,A as y,C as N,a as _}from"./index-BQmzLb9B.js";import{R as C}from"./index-iLL8Ykfz.js";import{a as T,f as E}from"./runtime-utils-GN4cODRt.js";import{U as M}from"./user-plus-E0L9d7C2.js";import{c as S}from"./createLucideIcon-D9HkCDkl.js";import{U as L}from"./users-BxEfMauC.js";import{L as P}from"./layout-grid-Bpg0VprM.js";import{F as D}from"./folder-open-BFC5J5Fo.js";import{F as R}from"./file-text-B5ffPq62.js";import{C as A}from"./compass-D3UAMNj_.js";import{T as O}from"./trending-up-DNrsL3Qd.js";import{L as $}from"./loader-circle-fXsKc0TP.js";import{I}from"./info-CT5rZD9C.js";import{R as U}from"./refresh-cw-BjP_646P.js";import{L as B}from"./link-2-D0DLgMN3.js";import{M as F}from"./music-jZP0GveI.js";import{M as q}from"./mic-B76gHqs6.js";import{V}from"./video-Bo3AcXon.js";import{I as z}from"./image-Cz6bY_bo.js";import{P as H}from"./plus-O3w64FuI.js";import{X as G}from"./x-DV2I6wJI.js";import{S as X}from"./search-D_LVchoc.js";const Y=S("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]),Z=S("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);var[K]=g("Tooltip",[k]),W=k(),J="TooltipProvider",Q=700,ee="tooltip.open",[te,ae]=K(J),re=a=>{const{__scopeTooltip:r,delayDuration:s=Q,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:o}=a,n=e.useRef(!0),d=e.useRef(!1),c=e.useRef(0);return e.useEffect(()=>{const e=c.current;return()=>window.clearTimeout(e)},[]),t.jsx(te,{scope:r,isOpenDelayedRef:n,delayDuration:s,onOpen:e.useCallback(()=>{i<=0||(window.clearTimeout(c.current),n.current=!1)},[i]),onClose:e.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>n.current=!0,i))},[i]),isPointerInTransitRef:d,onPointerInTransitChange:e.useCallback(e=>{d.current=e},[]),disableHoverableContent:l,children:o})};re.displayName=J;var se="Tooltip",[ie,le]=K(se),oe=a=>{const{__scopeTooltip:r,children:s,open:i,defaultOpen:l,onOpenChange:o,disableHoverableContent:n,delayDuration:d}=a,c=ae(se,a.__scopeTooltip),m=W(r),[u,h]=e.useState(null),p=w(),b=e.useRef(0),g=n??c.disableHoverableContent,f=d??c.delayDuration,v=e.useRef(!1),[k,y]=x({prop:i,defaultProp:l??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(ee))):c.onClose(),null==o||o(e)},caller:se}),N=e.useMemo(()=>k?v.current?"delayed-open":"instant-open":"closed",[k]),_=e.useCallback(()=>{window.clearTimeout(b.current),b.current=0,v.current=!1,y(!0)},[y]),C=e.useCallback(()=>{window.clearTimeout(b.current),b.current=0,y(!1)},[y]),T=e.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{v.current=!0,y(!0),b.current=0},f)},[f,y]);return e.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),t.jsx(j,{...m,children:t.jsx(ie,{scope:r,contentId:p,open:k,stateAttribute:N,trigger:u,onTriggerChange:h,onTriggerEnter:e.useCallback(()=>{c.isOpenDelayedRef.current?T():_()},[c.isOpenDelayedRef,T,_]),onTriggerLeave:e.useCallback(()=>{g?C():(window.clearTimeout(b.current),b.current=0)},[C,g]),onOpen:_,onClose:C,disableHoverableContent:g,children:s})})};oe.displayName=se;var ne="TooltipTrigger",de=e.forwardRef((a,r)=>{const{__scopeTooltip:s,...i}=a,l=le(ne,s),o=ae(ne,s),n=W(s),d=e.useRef(null),c=p(r,d,l.onTriggerChange),m=e.useRef(!1),x=e.useRef(!1),h=e.useCallback(()=>m.current=!1,[]);return e.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),t.jsx(y,{asChild:!0,...n,children:t.jsx(f.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:c,onPointerMove:u(a.onPointerMove,e=>{"touch"!==e.pointerType&&(x.current||o.isPointerInTransitRef.current||(l.onTriggerEnter(),x.current=!0))}),onPointerLeave:u(a.onPointerLeave,()=>{l.onTriggerLeave(),x.current=!1}),onPointerDown:u(a.onPointerDown,()=>{l.open&&l.onClose(),m.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:u(a.onFocus,()=>{m.current||l.onOpen()}),onBlur:u(a.onBlur,l.onClose),onClick:u(a.onClick,l.onClose)})})});de.displayName=ne;var[ce,me]=K("TooltipPortal",{forceMount:void 0}),xe="TooltipContent",ue=e.forwardRef((e,a)=>{const r=me(xe,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...l}=e,o=le(xe,e.__scopeTooltip);return t.jsx(h,{present:s||o.open,children:o.disableHoverableContent?t.jsx(fe,{side:i,...l,ref:a}):t.jsx(he,{side:i,...l,ref:a})})}),he=e.forwardRef((a,r)=>{const s=le(xe,a.__scopeTooltip),i=ae(xe,a.__scopeTooltip),l=e.useRef(null),o=p(r,l),[n,d]=e.useState(null),{trigger:c,onClose:m}=s,x=l.current,{onPointerInTransitChange:u}=i,h=e.useCallback(()=>{d(null),u(!1)},[u]),b=e.useCallback((e,t)=>{const a=e.currentTarget,r={x:e.clientX,y:e.clientY},s=function(e,t,a=5){const r=[];switch(t){case"top":r.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":r.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":r.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":r.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a})}return r}(r,function(e,t){const a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(a,r,s,i)){case i:return"left";case s:return"right";case a:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,a.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(a.y-r.y)>=(e.y-r.y)*(a.x-r.x)))break;t.pop()}t.push(a)}t.pop();const a=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;a.length>=2;){const e=a[a.length-1],r=a[a.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;a.pop()}a.push(t)}return a.pop(),1===t.length&&1===a.length&&t[0].x===a[0].x&&t[0].y===a[0].y?t:t.concat(a)}(t)}([...s,...function(e){const{top:t,right:a,bottom:r,left:s}=e;return[{x:s,y:t},{x:a,y:t},{x:a,y:r},{x:s,y:r}]}(t.getBoundingClientRect())]);d(i),u(!0)},[u]);return e.useEffect(()=>()=>h(),[h]),e.useEffect(()=>{if(c&&x){const e=e=>b(e,x),t=e=>b(e,c);return c.addEventListener("pointerleave",e),x.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),x.removeEventListener("pointerleave",t)}}},[c,x,b,h]),e.useEffect(()=>{if(n){const e=e=>{const t=e.target,a={x:e.clientX,y:e.clientY},r=(null==c?void 0:c.contains(t))||(null==x?void 0:x.contains(t)),s=!function(e,t){const{x:a,y:r}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const e=t[i],o=t[l],n=e.x,d=e.y,c=o.x,m=o.y;d>r!=m>r&&a<(c-n)*(r-d)/(m-d)+n&&(s=!s)}return s}(a,n);r?h():s&&(h(),m())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,x,n,m,h]),t.jsx(fe,{...a,ref:o})}),[pe,be]=K(se,{isInside:!1}),ge=b("TooltipContent"),fe=e.forwardRef((a,r)=>{const{__scopeTooltip:s,children:i,"aria-label":l,onEscapeKeyDown:o,onPointerDownOutside:n,...d}=a,c=le(xe,s),m=W(s),{onClose:x}=c;return e.useEffect(()=>(document.addEventListener(ee,x),()=>document.removeEventListener(ee,x)),[x]),e.useEffect(()=>{if(c.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&x()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,x]),t.jsx(v,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:e=>e.preventDefault(),onDismiss:x,children:t.jsxs(N,{"data-state":c.stateAttribute,...m,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(ge,{children:i}),t.jsx(pe,{scope:s,isInside:!0,children:t.jsx(C,{id:c.contentId,role:"tooltip",children:l||i})})]})})});ue.displayName=xe;var ve="TooltipArrow";e.forwardRef((e,a)=>{const{__scopeTooltip:r,...s}=e,i=W(r);return be(ve,r).isInside?null:t.jsx(_,{...i,...s,ref:a})}).displayName=ve;var we=ue;
1const ke=re,je=oe,ye=de,Ne=e.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(we,{ref:s,sideOffset:a,className:T("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Ne.displayName=we.displayName;const _e=[{value:"today",label:"Today",description:"Current daily cockpit"},{value:"7d",label:"7D",description:"Fast pulse for launches and spikes"},{value:"30d",label:"30D",description:"Best default for product health"},{value:"90d",label:"90D",description:"Pattern view for momentum shifts"},{value:"all",label:"All",description:"Long arc of Echo growth"}],Ce="admin_overview_excluded_user_ids",Te=e=>{const t=String(e||"").slice(0,10),a=new Date(`${t}T00:00:00`);return Number.isNaN(a.getTime())?"":a.toLocaleDateString(void 0,{month:"short",day:"numeric"})},Ee={image:z,gif:z,video:V,note:R,voice:q,audio:F,pdf:Z,docx:R,url:B,other:Z},Me={image:"from-sky-500/18 via-cyan-300/14 to-blue-300/18",gif:"from-fuchsia-500/18 via-pink-300/14 to-orange-300/18",video:"from-rose-500/18 via-orange-300/14 to-amber-300/18",note:"from-emerald-500/18 via-teal-300/14 to-cyan-300/18",voice:"from-violet-500/18 via-indigo-300/14 to-sky-300/18",audio:"from-amber-500/18 via-yellow-300/14 to-lime-300/18",pdf:"from-slate-500/18 via-slate-300/14 to-zinc-300/18",docx:"from-blue-500/18 via-indigo-300/14 to-sky-300/18",url:"from-teal-500/18 via-cyan-300/14 to-emerald-300/18",other:"from-slate-500/18 via-zinc-300/14 to-stone-300/18"},Se="rounded-[1.5rem] border border-slate-200 bg-slate-50/70 p-4 dark:border-white/10 dark:bg-white/[0.04]",Le="rounded-[1.5rem] border border-slate-200 bg-white p-4 dark:border-white/10 dark:bg-slate-900/80",Pe="rounded-[1.2rem] border border-slate-200 bg-slate-50/70 p-4 dark:border-white/10 dark:bg-white/[0.04]",De="rounded-2xl bg-white px-3 py-2 dark:bg-white/[0.06]";function Re({active:e,label:a,description:r,onClick:s}){return t.jsxs(je,{children:[t.jsx(ye,{asChild:!0,children:t.jsx("button",{type:"button",onClick:s,className:T("rounded-full px-4 py-2 text-xs font-black uppercase tracking-[0.22em] transition",e?"bg-slate-900 text-white shadow-[0_18px_40px_rgba(15,23,42,0.22)] dark:bg-white dark:text-slate-950 dark:shadow-[0_18px_40px_rgba(2,6,23,0.45)]":"bg-white/70 text-slate-700 hover:bg-white dark:bg-white/[0.08] dark:text-slate-300 dark:hover:bg-white/[0.14]"),children:a})}),t.jsx(Ne,{className:"text-xs",children:r})]})}function Ae({label:e,value:a,icon:r,hint:s,accent:i}){return t.jsxs("div",{className:"relative overflow-hidden rounded-[1.8rem] border border-white/50 bg-white/78 p-5 shadow-[0_18px_55px_rgba(15,23,42,0.08)] backdrop-blur dark:border-white/10 dark:bg-slate-950/88 dark:shadow-[0_18px_55px_rgba(2,6,23,0.48)]",children:[t.jsx("div",{className:T("absolute inset-0 bg-gradient-to-br opacity-80",i)}),t.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(255,255,255,0.65),transparent_42%)] dark:bg-[radial-gradient(circle_at_top_right,rgba(255,255,255,0.14),transparent_40%)]"}),t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"mb-4 flex items-start justify-between gap-4",children:t.jsx("div",{className:"inline-flex h-11 w-11 items-center justify-center rounded-2xl border border-white/50 bg-white/70 dark:border-white/10 dark:bg-white/[0.08]",children:t.jsx(r,{className:"h-5 w-5 text-slate-900 dark:text-slate-100"})})}),t.jsx("p",{className:"text-[11px] font-black uppercase tracking-[0.22em] text-slate-600 dark:text-slate-300",children:e}),t.jsx("p",{className:"mt-2 text-4xl font-black tracking-tight text-slate-950 dark:text-white",children:a}),t.jsx("p",{className:"mt-2 min-h-[2.5rem] text-sm text-slate-600 dark:text-slate-300",children:s})]})]})}function Oe({eyebrow:e,title:a,description:r,children:s,className:i}){return t.jsxs(o,{className:T("rounded-[2rem] border border-white/50 bg-white/82 shadow-[0_18px_60px_rgba(15,23,42,0.07)] backdrop-blur dark:border-white/10 dark:bg-slate-950/82 dark:shadow-[0_18px_60px_rgba(2,6,23,0.45)]",i),children:[t.jsxs(n,{className:"pb-4",children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.24em] text-slate-500 dark:text-slate-400",children:e}),t.jsx(d,{className:"text-2xl font-black tracking-tight text-slate-950 dar
1k:text-white",children:a}),t.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300",children:r})]}),t.jsx(c,{children:s})]})}function $e(){return t.jsx(ke,{children:t.jsx(Ie,{})})}function Ie(){var o;const{user:n}=s(),[d,c]=e.useState("today"),[x,u]=e.useState(null),[h,p]=e.useState(null),[b,g]=e.useState({top_creators:[],top_searches:[]}),[f,v]=e.useState([]),[w,k]=e.useState(""),[j,y]=e.useState(!0),[N,_]=e.useState(!1),[C,S]=e.useState(!1),[B,F]=e.useState(!1),[q,V]=e.useState(null),z=async()=>{x||y(!0),_(!0),V(null);const e=new AbortController,t=window.setTimeout(()=>e.abort(),9e3);let a=null,s=null;try{const t=await r.rpc("admin_get_growth_overview_fast",{p_range:d}).abortSignal(e.signal);a=t.data,s=t.error}catch(i){s=i}finally{window.clearTimeout(t)}if(s||!a){const e="AbortError"===s.name||String(s.message||"").toLowerCase().includes("abort")?"Overview took too long to load. Try again, or use a shorter range.":(null==s?void 0:s.message)||"No overview data returned from Supabase.";return x?(V(null),p(`${e} Showing the last loaded overview.`)):(V(e),u(null)),y(!1),void _(!1)}u(a),p(null),y(!1),_(!1)},K=async()=>{S(!0);const e=new AbortController,t=window.setTimeout(()=>e.abort(),5e3);try{const{data:t,error:a}=await r.rpc("admin_get_growth_overview_leaders",{p_range:d}).abortSignal(e.signal);g(!a&&t?{top_creators:Array.isArray(t.top_creators)?t.top_creators:[],top_searches:Array.isArray(t.top_searches)?t.top_searches:[]}:{top_creators:[],top_searches:[]})}catch{g({top_creators:[],top_searches:[]})}finally{window.clearTimeout(t),S(!1)}};e.useEffect(()=>{(async()=>{const{data:e}=await r.from("system_settings").select("value").eq("key",Ce).maybeSingle(),t=Array.isArray(null==e?void 0:e.value)?e.value.map(e=>String(e)).filter(Boolean):[];v(t)})()},[]),e.useEffect(()=>{z()},[d]),e.useEffect(()=>{x&&K()},[x,d]),e.useEffect(()=>{if(!x)return;const e=()=>{"visible"===document.visibilityState&&K()};window.addEventListener("focus",e);const t=a(e);return()=>{window.removeEventListener("focus",e),t()}},[x,d]);const W=async e=>{F(!0);const{error:t}=await r.from("system_settings").upsert({key:Ce,value:e,description:"User IDs excluded from admin growth overview metrics.",updated_at:(new Date).toISOString()},{onConflict:"key"});F(!1),t?V(t.message):(v(e),k(""),await z())},J=async e=>{const t=e.trim();t&&!f.includes(t)&&await W([...f,t])},Q=(null==x?void 0:x.timeseries.daily)??[],ee=null==x?void 0:x.headline,te=(null==x?void 0:x.media_breakdown)??{total_uploads:0,items:[]},ae=(null==(o=_e.find(e=>e.value===d))?void 0:o.label)??d.toUpperCase(),re=e.useMemo(()=>Q.reduce((e,t)=>({registrations:e.registrations+Number(t.registrations||0),echoesUploaded:e.echoesUploaded+Number(t.echoes_uploaded||0),dauSum:e.dauSum+Number(t.dau||0),likesGiven:e.likesGiven+Number(t.likes_given||0),boardsCreated:e.boardsCreated+Number(t.boards_created||0),foldersCreated:e.foldersCreated+Number(t.folders_created||0),notesMade:e.notesMade+Number(t.notes_made||0),follows:e.follows+Number(t.follows||0),publicBoardViews:e.publicBoardViews+Number(t.public_board_views||0),canvase
1sCreated:e.canvasesCreated+Number(t.canvases_created||0)}),{registrations:0,echoesUploaded:0,dauSum:0,likesGiven:0,boardsCreated:0,foldersCreated:0,notesMade:0,follows:0,publicBoardViews:0,canvasesCreated:0}),[Q]),se=e.useMemo(()=>ee?[{label:"New Registrations",value:E(re.registrations),icon:M,hint:`${E(re.registrations)} signups in the selected range.`,accent:"from-blue-500/28 via-sky-300/18 to-cyan-300/28"},{label:"Echoes Uploaded",value:E(re.echoesUploaded),icon:Y,hint:`${E(re.echoesUploaded)} echoes uploaded in the selected range.`,accent:"from-pink-500/28 via-rose-300/18 to-orange-300/24"},{label:"Monthly Active Users",value:E(ee.monthly_active_users),icon:L,hint:`${E(ee.weekly_active_users)} weekly active users, ${E(ee.monthly_active_users)} monthly.`,accent:"from-emerald-500/28 via-teal-300/18 to-cyan-300/24"},{label:"Canvas Creations",value:E(re.canvasesCreated),icon:P,hint:`${E(re.canvasesCreated)} canvases created in the selected range.`,accent:"from-sky-500/28 via-cyan-300/18 to-indigo-300/24"},{label:"Boards Created",value:E(re.boardsCreated),icon:D,hint:`${E(re.boardsCreated)} boards created in the selected range.`,accent:"from-violet-500/28 via-indigo-300/18 to-sky-300/24"},{label:"Folders Created",value:E(re.foldersCreated),icon:D,hint:`${E(re.foldersCreated)} folders created in the selected range.`,accent:"from-lime-500/24 via-emerald-300/16 to-teal-300/22"},{label:"Notes Made",value:E(re.notesMade),icon:R,hint:`${E(re.notesMade)} notes made in the selected range.`,accent:"from-slate-500/20 via-zinc-300/14 to-stone-300/20"},{label:"Follows",value:E(re.follows),icon:A,hint:`${E(re.follows)} follows in the selected range.`,accent:"from-amber-500/26 via-yellow-300/18 to-orange-300/24"},{label:"Public Board Views",value:E(re.publicBoardViews),icon:O,hint:`${E(re.publicBoardViews)} public board views in the selected range.`,accent:"from-teal-500/26 via-cyan-300/18 to-sky-300/24"}]:[],[re,ee]),ie=e.useMemo(()=>[...te.items].sort((e,t)=>t.count-e.count)[0]??null,[te.items]);return j?t.jsx("div",{className:"flex min-h-[420px] items-center justify-center rounded-[2rem] border border-border/40 bg-card/80",children:t.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[t.jsx($,{className:"h-5 w-5 animate-spin"}),"Loading growth overview…"]})}):!q&&x&&ee?t.jsxs("div",{className:"space-y-6",children:[t.jsxs("section",{className:"relative overflow-hidden rounded-[2.25rem] border border-white/50 bg-[linear-gradient(135deg,rgba(255,255,255,0.95),rgba(242,248,255,0.88),rgba(255,247,240,0.84))] p-6 shadow-[0_25px_90px_rgba(15,23,42,0.08)] dark:border-white/10 dark:bg-[linear-gradient(135deg,rgba(15,23,42,0.96),rgba(17,24,39,0.94),rgba(30,41,59,0.92))] dark:shadow-[0_25px_90px_rgba(2,6,23,0.5)] md:p-8",children:[t.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(56,189,248,0.14),transparent_34%),radial-gradient(circle_at_top_right,rgba(251,191,36,0.16),transparent_28%),radial-gradient(circle_at_bottom_left,rgba(16,185,129,0.12),transparent_28%)] dark:bg-[radial-gradient(circle_at_top_left,rgba(14,165,233,0.16),transparent_34%),radial-gradient(circle_at_top_right,rgba(245,158,11,0.12),transparent_28%),radial-gradient(circle_at_bottom_left,rgba(16,185,129,0.12),transparent_28%)]"}),t.jsxs("div",{className:"relative flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[t.jsxs("div",{className:"max-w-4xl",children:[t.jsx("div",{className:"inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white/80 px-4 py-2 text-[11px] font-black uppercase tracking-[0.24em] text-slate-600 dark:border-white/10 dark:bg-white/[0.08] dark:text-slate-300",children:"Overview"}),t.jsx("h2",{className:"mt-4 text-4xl font-black tracking-tight text-slate-950 dark:text-white md:text-5xl",children:"Growth cockpit for Echo."}),t.jsx("p",{className:"mt-4 max-w-3xl text-base leading-7 text-slate-600 dark:text-slate-300",children:"Daily growth, usage quality, retention, search demand, public distribution, and creator output in one place."}),h?t.jsxs("div",{className:"mt-5 inline-flex max-w-3xl items-center gap-2 rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm font-semibold text-amber-900 dark:border-amber-300/20 dark:bg-amber-400/10 dark:text-amber-100",children:[t.jsx(I,{className:"h-4 w-4 shrink-0"}),h]}):null]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[_e.map(e=>t.jsx(Re,{active:d===e.value,label:e.label,description:e.description,onClick:()=>c(e.value)},e.value)),t.jsxs(i,{type:"button",variant:"outline",className:"rounded-full bg-white/70 text-xs font-black uppercase tracking-[0.18em] dark:bg-white/[0.08]",onClick:()=>{z()},disabled:N,children:[t.jsx(U,{className:T("mr-2 h-3.5 w-3.5",N?"animate-spin":"")}),"Refresh"]})]})]})]}),t.jsx("div",{className:"grid gap-4 xl:grid-cols-3",children:se.map(e=>t.jsx(Ae,{...e},e.label))}),t.jsx(Oe,{eyebrow:"Upload Mix",title:"Media Type Breakdown",description:"See exactly what got uploaded in the selected range, with GIFs split out from still images.",children:t.jsxs("div",{className:"grid gap-4 xl:grid-cols-[0.8fr_1.2fr]",children:[t.jsxs("div",{className:"rounded-[1.6rem] border border-slate-200 bg-[linear-gradient(145deg,rgba(255,255,255,0.96),rgba(241,245,249,0.8))] p-5 shadow-[0_18px_55px_rgba(15,23,42,0.06)] dark:border-white/10 dark:bg-[linear-gradient(145deg,rgba(15,23,42,0.92),rgba(30,41,59,0.82))] dark:shadow-[0_18px_55px_rgba(2,6,23,0.44)]",children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.24em] text-slate-500 dark:text-slate-400",children:"Uploads in range"}),t.jsx("div",{className:"mt-3 text-4xl font-black tracking-tight text-slate-950 dar
1k:text-white",children:E(te.total_uploads)}),t.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600 dark:text-slate-300",children:ie?`${ie.label} lead this window with ${E(ie.count)} uploads (${ie.share_pct.toFixed(1)}%).`:"No uploads landed in this range yet."}),t.jsxs("div",{className:"mt-5 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 dark:text-slate-300",children:[t.jsx("span",{children:"Unique upload types"}),t.jsx("span",{className:"font-semibold text-slate-950 dark:text-white",children:te.items.length})]}),t.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 dark:text-slate-300",children:[t.jsx("span",{children:"Range"}),t.jsxs("span",{className:"font-semibold text-slate-950 dark:text-white",children:[Te(x.range_start)," to ",Te(x.range_end)]})]})]})]}),t.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:0===te.items.length?t.jsx("div",{className:"rounded-[1.6rem] border border-dashed border-slate-200 bg-slate-50/70 p-6 text-sm text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-300 md:col-span-2",children:"Nothing has been uploaded in the selected window yet."}):te.items.map(e=>{const a=Ee[e.key]??Z,r=Me[e.key]??Me.other;return t.jsxs("div",{className:"relative overflow-hidden rounded-[1.45rem] border border-slate-200 bg-white p-4 shadow-[0_16px_40px_rgba(15,23,42,0.05)] dark:border-white/10 dark:bg-[linear-gradient(145deg,rgba(15,23,42,0.94),rgba(17,24,39,0.9))] dark:shadow-[0_16px_40px_rgba(2,6,23,0.4)]",children:[t.jsx("div",{className:T("absolute inset-0 bg-gradient-to-br opacity-70 dark:opacity-30",r)}),t.jsx("div",{className:"absolute inset-0 hidden dark:block dark:bg-[radial-gradient(circle_at_top_left,rgba(255,255,255,0.06),transparent_38%),linear-gradient(180deg,rgba(2,6,23,0.02),rgba(2,6,23,0.28))]"}),t.jsxs("div",{className:"relative",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx("div",{className:"inline-flex h-11 w-11 items-center justify-center rounded-2xl border border-white/60 bg-white/70 dark:border-white/10 dark:bg-white/[0.05]",children:t.jsx(a,{className:"h-5 w-5 text-slate-900 dark:text-slate-100"})}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"text-2xl font-black tracking-tight text-slate-950 dark:text-white",children:E(e.count)}),t.jsxs("div",{className:"text-[11px] font-black uppercase tracking-[0.18em] text-slate-500 dark:text-slate-400",children:[e.share_pct.toFixed(1),"%"]})]})]}),t.jsx("div",{className:"mt-4 text-sm font-semibold text-slate-950 dark:text-white",children:e.label}),t.jsx("div",{className:"mt-3 h-2.5 overflow-hidden rounded-full bg-slate-200/80 dark:bg-white/[0.07]",children:t.jsx("div",{className:"h-full rounded-full bg-slate-900 transition-[width] dark:bg-white/90",style:{width:`${Math.max(e.share_pct,e.count>0?4:0)}%`}})})]})]},e.key)})})]})}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-[0.95fr_1.05fr]",children:[t.jsx(Oe,{eyebrow:"Exclusions",title:"Ignore specific accounts from overview stats",description:"Use this for your own account or internal/testing users so they do not distort growth and engagement metrics.",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex flex-wrap gap-3",children:(null==n?void 0:n.id)?t.jsx(i,{variant:"outline",className:"rounded-full",disabled:B||f.includes(n.id),onClick:()=>{J(n.id)},children:"Exclude my account"}):null}),t.jsxs("div",{className:"flex flex-col gap-3 md:flex-row",children:[t.jsx(m,{value:w,onChange:e=>k(e.target.value),placeholder:"Paste a user UUID to exclude",className:"rounded-2xl"}),t.jsxs(i,{className:"rounded-2xl gap-2",disabled:B||!w.trim(),onClick:()=>{J(w)},children:[t.jsx(H,{className:"h-4 w-4"}),"Add exclusion"]})]}),t.jsx("div",{className:"flex flex-wrap gap-2",children:0===f.length?t.jsx("div",{className:"text-sm text-slate-500 dark:text-slate-300",children:"No excluded accounts yet."}):f.map(e=>t.jsxs(l,{variant:"outline",className:"rounded-full border-slate-200 bg-slate-50 px-3 py-1 text-slate-700 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-200",children:[t.jsx("span",{className:"max-w-[16rem] truncate",children:e}),t.jsx("button",{type:"button",className:"ml-2",onClick:()=>{(async e=>{await W(f.filter(t=>t!==e))})(e)},children:t.jsx(G,{className:"h-3.5 w-3.5"})})]},e))})]})}),t.jsxs(Oe,{eyebrow:"Public Surfaces",title:"Boards and profiles with public visibility",description:"A first-party read on how much public distribution Echo has live right now, and which surfaces are carrying it.",children:[t.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[t.jsxs("div",{className:Se,children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.22em] text-slate-500 dark:text-slate-400",children:"Public boards live"}),t.jsx("div",{className:"mt-3 text-3xl font-black tracking-tight text-slate-950 dar
1k:text-white",children:E(ee.public_boards_live)})]}),t.jsxs("div",{className:Se,children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.22em] text-slate-500 dark:text-slate-400",children:"Public profiles with visibility"}),t.jsx("div",{className:"mt-3 text-3xl font-black tracking-tight text-slate-950 dark:text-white",children:E(ee.public_profiles_live)})]})]}),t.jsxs("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:[t.jsxs("div",{className:Le,children:[t.jsx("div",{className:"text-sm font-semibold text-slate-800 dark:text-slate-100",children:"Boards getting public attention"}),t.jsx("div",{className:"mt-3 space-y-3 max-h-[22rem] overflow-y-auto pr-1",children:(x.leaders.top_boards??[]).map(e=>t.jsxs("div",{className:Pe,children:[t.jsx("div",{className:"font-semibold text-slate-950 dark:text-white",children:e.name}),t.jsx("div",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:e.owner_username?`by @${e.owner_username}`:"Owner unknown"}),t.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 text-sm",children:[t.jsxs("div",{className:De,children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.2em] text-slate-500 dark:text-slate-400",children:"Public views"}),t.jsx("div",{className:"mt-1 font-semibold text-slate-950 dark:text-white",children:E(e.public_views)})]}),t.jsxs("div",{className:De,children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.2em] text-slate-500 dark:text-slate-400",children:"Follows"}),t.jsx("div",{className:"mt-1 font-semibold text-slate-950 dark:text-white",children:E(e.follows)})]})]})]},e.id))})]}),t.jsxs("div",{className:Le,children:[t.jsx("div",{className:"text-sm font-semibold text-slate-800 dark:text-slate-100",children:"Profiles with public visibility"}),t.jsx("div",{className:"mt-3 space-y-3 max-h-[22rem] overflow-y-auto pr-1",children:(x.leaders.public_profiles??[]).map(e=>t.jsxs("div",{className:Pe,children:[t.jsx("div",{className:"font-semibold text-slate-950 dark:text-white",children:e.full_name||e.username||"Unknown profile"}),t.jsx("div",{className:"mt-1 text-sm text-slate-500 dark:text-slate-400",children:e.username?`@${e.username}`:"No username set"}),t.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 text-sm",children:[t.jsxs("div",{className:De,children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.2em] text-slate-500 dark:text-slate-400",children:"Profile views"}),t.jsx("div",{className:"mt-1 font-semibold text-slate-950 dark:text-white",children:E(e.profile_views)})]}),t.jsxs("div",{className:De,children:[t.jsx("div",{className:"text-[11px] font-black uppercase tracking-[0.2em] text-slate-500 dark:text-slate-400",children:"Public boards"}),t.jsx("div",{className:"mt-1 font-semibold text-slate-950 dark:text-white",children:E(e.public_board_count)})]})]})]},e.id))})]})]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-[0.9fr_1.1fr]",children:[t.jsx(Oe,{eyebrow:"Top Creators",title:"Who is creating the most",description:"The creators producing the most echoes in the selected range.",children:t.jsx("div",{className:"space-y-3 max-h-[26rem] overflow-y-auto pr-1",children:C?t.jsx("div",{className:"rounded-[1.4rem] border border-dashed border-slate-200 bg-slate-50/70 p-5 text-sm text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-300",children:"Loading creator leaders..."}):0===(b.top_creators??[]).length?t.jsx("div",{className:"rounded-[1.4rem] border border-dashed border-slate-200 bg-slate-50/70 p-5 text-sm text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-300",children:"No creator uploads in this range yet."}):(b.top_creators??[]).map((e,a)=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-[1.4rem] border border-slate-200 bg-slate-50/70 p-4 dark:border-white/10 dark:bg-white/[0.04]",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-semibold text-slate-950 dark:text-white",children:e.full_name||e.username||"Unknown creator"}),t.jsx("div",{className:"truncate text-sm text-slate-500 dark:text-slate-400",children:e.username?`@${e.username}`:"No username set"})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"text-2xl font-black tracking-tight text-slate-950 dar
1k:text-white",children:E(e.uploads)}),t.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"uploads"})]})]},`${e.username||e.full_name||"creator"}-${a}`))})}),t.jsx(Oe,{eyebrow:"Search Demand",title:"What people are searching for",description:"All tracked search demand in the selected range, not just a tiny top slice.",children:t.jsx("div",{className:"space-y-3 max-h-[26rem] overflow-y-auto pr-1",children:C?t.jsx("div",{className:"rounded-[1.4rem] border border-dashed border-slate-200 bg-slate-50/70 p-5 text-sm text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-300",children:"Loading search demand..."}):0===(b.top_searches??[]).length?t.jsxs("div",{className:"rounded-[1.4rem] border border-dashed border-slate-200 bg-slate-50/70 p-5 text-sm text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-300",children:["No tracked searches ","today"===d?"today":`in the ${ae} range`," yet."]}):(b.top_searches??[]).map(e=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-[1.4rem] border border-slate-200 bg-slate-50/70 p-4 dark:border-white/10 dark:bg-white/[0.04]",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx("div",{className:"inline-flex h-10 w-10 items-center justify-center rounded-2xl border border-slate-200 bg-white dark:border-white/10 dark:bg-white/[0.06]",children:t.jsx(X,{className:"h-4 w-4 text-slate-700 dark:text-slate-200"})}),t.jsx("div",{className:"truncate font-semibold text-slate-950 dark:text-white",children:e.query})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"text-2xl font-black tracking-tight text-slate-950 dark:text-white",children:E(e.searches)}),t.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"searches"})]})]},e.query))})})]})]}):t.jsxs("div",{className:"rounded-[2rem] border border-rose-200 bg-rose-50/80 p-8 text-rose-900",children:[t.jsx("h3",{className:"text-lg font-bold",children:"Overview failed to load"}),t.jsx("p",{className:"mt-2 text-sm text-rose-800/80",children:q||"No overview data returned from Supabase."}),t.jsx(i,{className:"mt-5 rounded-2xl",variant:"outline",onClick:()=>{z()},children:"Try again"})]})}export{$e as ManageOverview};

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.