1import{a as N}from"./chunk-2LPPYG5A.js";import{a as U}from"./chunk-LJ5OAOFF.js";import{g as L}from"./chunk-ZV7NG4F4.js";import"./chunk-DJ5AJG3T.js";import"./chunk-6EF6RNOO.js";import"./chunk-T3DWPM4S.js";import"./chunk-K6QYQNRN.js";import"./chunk-WF4KZOYP.js";import"./chunk-EB6TJ75L.js";import{a as A}from"./chunk-NBMUSEX4.js";import"./chunk-AB6CKZTE.js";import{d as D,e as H}from"./chunk-YQZAETCE.js";import{s as E,x as P}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{I as T,c as k,p as w,r as I,s as M}from"./chunk-ERUCNOOT.js";import{Fa as b,Ib as h,Jb as l,Qb as y,Qc as p,Rc as m,V as _,Vb as o,Wb as r,Xb as c,da as g,db as a,f as x,gc as v,sb as C,tc as s,vc as d,yb as f}from"./chunk-DBE7WQEG.js";import"./chunk-W7GRJBO5.js";function B(i,t){i&1&&c(0,"app-widget-loading")}function F(i,t){if(i&1&&(o(0,"span",13),s(1),r()),i&2){let e=v(2);a(),d(" \xB7 ",e.workspace.name,"")}}function K(i,t){if(i&1&&(c(0,"app-widget-stat-card",14),p(1,"translate")),i&2){let e=t.$implicit,n=v(2);l("icon",e.icon)("value",e.value)("label",m(1,4,e.label))("badge",n.badgeFor(e))}}function $(i,t){if(i&1&&(o(0,"a",15),c(1,"i",16),o(2,"div",17)(3,"div",18),s(4),p(5,"translate"),r(),o(6,"div",19),s(7),p(8,"translate"),r()(),c(9,"i",20),r()),i&2){let e=t.$implicit;l("routerLink",e.routerLink),h("data-accent",e.accent),a(),l("ngClass",e.icon),a(3),d(" ",m(5,5,e.label)," "),a(3),d(" ",m(8,7,e.description)," ")}}function W(i,t){if(i&1&&(o(0,"div",0)(1,"span",1),c(2,"i",2),s(3),p(4,"translate"),f(5,F,2,1,"span",3),r(),o(6,"p",4),s(7),p(8,"translate"),r()(),o(9,"div",5),f(10,K,2,6,"app-widget-stat-card",6),r(),o(11,"div",7)(12,"div",8)(13,"h2",9),c(14,"i",10),s(15),p(16,"translate"),r(),o(17,"div",11),f(18,$,10,9,"a",12),r()()()),i&2){let e=v();a(3),d(" ",m(4,6,"STUDIO.HOME.WELCOME")," "),a(2),l("ngIf",e.workspace),a(2),d(" ",m(8,8,"STUDIO.HOME.SUBTITLE")," "),a(3),l("ngForOf",e.stats),a(5),d(" ",m(16,10,"STUDIO.HOME.ACTIONS.TITLE")," "),a(3),l("ngForOf",e.quickActions)}}var V=class i{workspaceService=g(L);analytics=g(N);isBrowser=k(g(b));destroy$=new x;workspace=null;loading=!0;stats=[{key:"followers",label:"STUDIO.HOME.STATS.FOLLOWERS",icon:"pi pi-users",value:null,delta:null,deltaPlaceholder:!1},{key:"views",label:"STUDIO.HOME.STATS.VIEWS",icon:"pi pi-eye",value:null,delta:null,deltaPlaceholder:!1},{key:"likes",label:"STUDIO.HOME.STATS.LIKES",icon:"pi pi-heart",value:null,delta:null,deltaPlaceholder:!1},{key:"videos",label:"STUDIO.HOME.STATS.VIDEOS",icon:"pi pi-video",value:null,delta:null,deltaPlaceholder:!1}];quickActions=[{label:"STUDIO.HOME.ACTIONS.SHOP",description:"STUDIO.HOME.ACTIONS.SHOP_DESC",icon:"pi pi-shop",routerLink:"/studio/shop",accent:"shop"},{label:"STUDIO.HOME.ACTIONS.LIVE",description:"STUDIO.HOME.ACTIONS.LIVE_DESC",icon:"pi pi-video",routerLink:"/studio/live",accent:"live"},{label:"STUDIO.HOME.ACTIONS.LINKS",description:"STUDIO.HOME.ACTIONS.LINKS_DESC",icon:"pi pi-link",routerLink:"/studio/links",accent:"links"},{label:"STUDIO.HOME.ACTIONS.BIO",description:"STUDIO.HOME.ACTIONS.BIO_DESC",icon:"pi pi-id-card",routerLink:"/studio/profile",accent:"bio"}];ngOnInit(){if(!this.isBrowser){this.loading=!1;return}this.workspaceService.activeWorkspaceDetails$.pipe(_(this.destroy$)).subscribe(t=>{this.workspace=t,this.loading=!1}),this.analytics.getAccountSummary().pipe(_(this.destroy$)).subscribe({next:t=>{let e={followers:t.followers,views:t.views,likes:t.likes,videos:t.videos};for(let n of this.stats)n.value=this.compact(e[n.key])},error:()=>{}}),this.analytics.getOverview("30d").pipe(_(this.destroy$)).subscribe({next:t=>{let e=t?.kpis,n={followers:e?.followersGained,views:e?.videoViews,likes:e?.likes};for(let u of this.stats)this.applyDelta(u,n[u.key])},error:()=>{}})}badgeFor(t){return t.delta?t.delta.pct==="0%"?{text:"0%",tone:"flat"}:{text:t.delta.pct,tone:t.delta.up?"up":"down"}:t.deltaPlaceholder?{text:"+100%",tone:"up"}:{text:"\u2014",tone:"flat"}}applyDelta(t,e){let n=e?.value??0,u=e?.previous??0;if(u>0){let S=Math.round((n-u)/u*100);if(n===0||S===0)t.delta={pct:"0%",up:!0};else{let O=S>0;t.delta={pct:`${O?"+":""}${S}%`,up:O}}}else n>0&&(t.deltaPlaceholder=!0)}compact(t){let e=t??0;return Math.abs(e)>=1e6?(e/1e6).toFixed(1).replace(".0","").replace(".",",")+" M":Math.abs(e)>=1e3?(e/1e3).toFixed(1).replace(".0","").replace(".",",")+" K":String(Math.round(e))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=C({type:i,selectors:[["app-view-studio-home"]],decls:3,vars:1,consts:[[1,"mb-4"],[1,"text-light","fs-6"],[1,"pi","pi-home","me-2"],["class","text-primary",4,"ngIf"],[1,"text-muted","mb-0","small"],[1,"home__stats","mb-4"],[3,"icon","value","label","badge",4,"ngFor","ngForOf"],[1,"card","mb-4"],[1,"card-body"],[1,"fs-5","fw-semibold","mb-3"],[1,"pi","pi-th-large","me-2","text-primary"],[1,"home__actions"],["class","action-card",3,"routerLink",4,"ngFor","ngForOf"],[1,"text-primary"],[3,"icon","value","label","badge"],[1,"action-card",3,"routerLink"],[1,"action-card__ic",3,"ngClass"],[1,"action-card__body"],[1,"action-card__label"],[1,"action-card__desc"],[1,"action-card__arrow","pi","pi-arrow-right"]],template:function(e,n){e&1&&(o(0,"div"),f(1,B,1,0,"app-widget-loading")(2,W,19,12),r()),e&2&&(a(),y(n.loading?1:2))},dependencies:[T,w,I,M,P,E,H,D,A,U],styles:["[_nghost-%COMP%]{display:block;--accent: #2f8eef;--ink: #14141f;--ink-soft: #5a5a6b;--line: #e7e7ee}.home__stats[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.home__actions[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}.action-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px;text-decoration:none;transition:border-color .16s,transform .16s,box-shadow .16s}.action-card[_ngcontent-%COMP%]:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:0 10px 26px #14141f14}.action-card[_ngcontent-%COMP%]:hover .action-card__arrow[_ngcontent-%COMP%]{color:var(--accent);transform:translate(3px)}.action-card__ic[_ngcontent-%COMP%]{width:46px;height:46px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:12px;font-size:20px;color:#fff;background:var(--accent)}.action-card[data-accent=shop][_ngcontent-%COMP%] .action-card__ic[_ngcontent-%COMP%]{background:#16a394}.action-card[data-accent=live][_ngcontent-%COMP%] .action-card__ic[_ngcontent-%COMP%]{background:#ff3b30}.action-card[data-accent=links][_ngcontent-%COMP%] .action-card__ic[_ngcontent-%COMP%]{background:#2f8eef}.action-card[data-accent=bio][_ngcontent-%COMP%] .action-card__ic[_ngcontent-%COMP%]{background:#7a5cff}.action-card__body[_ngcontent-%COMP%]{flex:1;min-width:0}.action-card__label[_ngcontent-%COMP%]{font-size:15px;font-weight:700;color:var(--ink)}.action-card__desc[_ngcontent-%COMP%]{font-size:13px;color:var(--ink-soft);margin-top:2px}
1.action-card__arrow[_ngcontent-%COMP%]{color:#c2c2cf;font-size:14px;transition:color .16s,transform .16s}"]})};export{V as ViewStudioHomeComponent};
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.