PageSourceSearch

https://app.knockknockapp.ai/assets/AgencyLayout-BmolDVcp.js

js knockknockapp.ai collected 2026-10-01 16:42:04 UTC 28,412 bytes, 1 lines download raw bytes

1import{l as s,m as r,q as e,D as k,u as a,K as m,y as _,a9 as $e,a4 as re,a6 as le,B as g,z as O,p as f,W as we,F as L,v as F,C as A,H as W,J as R,e as b,w as Ue,aa as U,ac as Ee,Z as Ve,r as $,n as Ke,E as qe,a5 as Ge,ad as G,X as Je,b as ae,_ as Xe}from"./vue-vendor-c0W5WEtO.js";import{a as ce,f as de,_ as Ye,u as X,t as Ce,B as Se,X as ke,ad as Qe,af as Ze,d as et,ac as tt,cx as at}from"./index-B2Yag7Gu.js";import{_ as st}from"./ImpersonationBanner-B24xF3rS.js";import{u as nt,_ as ot}from"./useAppVersion-DIi7SGcj.js";import{_ as it}from"./SubscriptionExpiredBanner-BKMJCrMP.js";import{X as ze,aO as rt,J,K as Te,ad as Ae,ap as se,a9 as ne,ak as Ne,ai as Me,az as oe,x as je,cJ as ie,ct as lt,aT as Pe,aR as Be,cR as ct,b as dt,ay as ut,j as gt,A as yt,Y as mt,u as pt,s as _e,P as ht,ab as vt,d9 as ft}from"./ui-vendor-B7SopUXd.js";import{b as Le}from"./query-vendor-BMwEzNLN.js";import{e as bt}from"./index-COv0RcNg.js";import{c as xt}from"./settings-DWA2ONzw.js";import"./date-vendor-HBGOQ70J.js";import"./twilio-DAuME2Y9.js";import"./charts-BVdrK9wF.js";import"./socket-Kk_l3rvZ.js";import"./rewardful-2QOTUYRt.js";const wt={class:"flex items-center justify-between px-4 py-3 md:hidden dark:bg-gray-800",style:{backgroundColor:"var(--agency-sidebar-bg, #2c4f4f)",color:"var(--agency-sidebar-text, #fff)"}},kt={class:"flex items-center gap-3"},_t=["src","alt"],$t={class:"text-white"},Ct={class:"text-xs text-white/70"},St={__name:"AgencyMobileHeader",props:{agencyName:{type:String,default:"My Agency"},isMenuOpen:{type:Boolean,default:!1}},emits:["toggle-menu"],setup(u){const{brandingName:p,brandingLogoUrl:l,isWhiteLabeled:C}=ce(),{backdropClass:T}=de(l,{onDark:!0});return(y,h)=>(s(),r("header",wt,[e("div",kt,[e("img",{src:a(l),alt:a(p),class:k(["shrink-0 object-contain",a(C)?["h-10 w-10 rounded-lg p-1",a(T)]:"h-8"])},null,10,_t),e("div",$t,[h[1]||(h[1]=e("div",{class:"text-sm font-bold"},"Agency Portal",-1)),e("div",Ct,m(u.agencyName),1)])]),e("button",{onClick:h[0]||(h[0]=B=>y.$emit("toggle-menu")),class:"flex h-10 w-10 items-center justify-center rounded-lg text-white hover:bg-white/10"},[u.isMenuOpen?(s(),_(a(ze),{key:0,size:24})):(s(),_(a(rt),{key:1,size:24}))])]))}},zt={key:0,class:"fixed inset-y-0 left-0 z-50 w-72 overflow-y-auto md:hidden dark:bg-gray-800",style:{backgroundColor:"var(--agency-sidebar-bg, #2c4f4f)",color:"var(--agency-sidebar-text, #fff)"}},Tt={class:"flex h-full flex-col text-white"},At={class:"border-b border-white/20 p-4 dark:border-gray-700"},Nt={class:"flex items-center justify-between"},Mt={class:"flex items-center gap-3"},jt=["src","alt"],Pt={class:"text-xs text-white/70"},Bt={class:"flex-1 space-y-1 overflow-y-auto px-4 py-4"},Lt={class:"border-t border-white/20 p-4 dark:border-gray-700"},Ht={class:"mb-4"},Rt={class:"mb-2 flex items-center gap-2"},Ft={class:"flex rounded-lg bg-white/10 p-1 dark:bg-gray-700/50"},Wt=["onClick"],Ot=["disabled"],Dt={class:"flex items-center gap-2"},It={class:"truncate text-white/80"},Ut={class:"mb-4 rounded-lg bg-white/10 p-3 dark:bg-gray-700/50"},Et={class:"flex items-center gap-3"},Vt={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-semibold text-white",style:{backgroundColor:"var(--agency-primary, #14b8a6)"}},Kt={class:"min-w-0 flex-1"},qt={class:"font-semibold text-white"},Gt={__name:"AgencyMobileMenu",props:{isOpen:{type:Boolean,default:!1},agencyName:{type:String,default:"My Agency"},userName:{type:String,default:""},userInitials:{type:String,default:""},canSwitchToCompany:{type:Boolean,default:!1},switchTargetName:{type:String,default:"Company"},isSwitching:{type:Boolean,default:!1}},emits:["close","logout","switch"],setup(u){const{brandingName:p,brandingLogoUrl:l,isWhiteLabeled:C}=ce(),{backdropClass:T}=de(l,{onDark:!0}),y=$e(),h=X(),{themeMode:B,isGhlSession:N}=re(h),{setThemeMode:S}=h,M=[{value:"light",label:"Light",icon:Te},{value:"dark",label:"Dark",icon:J},{value:"system",label:"System",icon:Ae}],j=c=>{S(c)},z=b(()=>{const c=[{name:"dashboard",label:"Dashboard",to:"/agency",icon:Ne}];return h.agencyHasPermission("agency.subscription_payments")&&c.push({name:"subscription",label:"Subscription",to:"/agency/subscription-management",icon:Me}),h.agencyHasPermission("agency.add_client_subscription")&&c.push({name:"add-client",label:"Add Client (Standard)",to:"/agency/companies/create",icon:oe}),c.push({name:"all-clients",label:"All Clients",to:"/agency/companies",icon:je},{name:"playground",label:"Playground",to:"/agency/playground",icon:ie},{name:"testing-playground",label:"Testing Playground",to:`/simple-playground?agency_id=${h.agency?._id||""}`,icon:lt}),h.agencyHasPermission("agency.manage_packages")&&c.push({name:"packages",label:"Packages & Allocations",to:"/agency/packages",icon:Pe}),c.push({name:"settings",label:"Settings",to:"/agency/settings",icon:Be}),c}),P=c=>c==="/agency"?y.path==="/agency":c==="/agency/subscription-management"?y.path.startsWith("/agency/subscription-management"):c==="/agency/companies/create"?y.path==="/agency/companies/create":c==="/agency/companies"?y.path==="/agency/companies"||y.path.startsWith("/agency/companies/")&&y.path!=="/agency/companies/create"&&y.path!=="/agency/companies/create-ghl":c==="/agency/settings"?y.path.startsWith("/agency/settings"):y.path.startsWith(c);return(c,d)=>{const w=le("router-link");return s(),r(L,null,[g(we,{name:"fade"},{default:O(()=>[u.isOpen?(s(),r("div",{key:0,class:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:d[0]||(d[0]=o=>c.$emit("close"))})):f("",!0)]),_:1}),g(we,{name:"slide"},{default:O(()=>[u.isOpen?(s(),r("nav",zt,[e("div",Tt,[e("div",At,[e("div",Nt,[e("div",Mt,[e("img",{src:a(l),alt:a(p),class:k(["shrink-0 object-contain",a(C)?["h-12 w-12 rounded-lg p-1",a(T)]:"h-10"])},null,10,jt),e("div",null,[d[5]||(d[5]=e("div",{class:"text-lg font-bold"},"Agency Portal",-1)),e("div",Pt,m(u.agencyName),1)])]),e("button",{onClick:d[1]||(d[1]=o=>c.$emit("close")),class:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-white/10"},[g(a(ze),{size:20})])])]),e("div",Bt,[(s(!0),r(L,null,F(z.value,o=>(s(),_(w,{key:o.name,to:o.to,onClick:d[2]||(d[2]=v=>c.$emit("close")),class:k(["flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors",P(o.to)?"text-white":"text-white/90 hover:bg-white/10 hover:text-white"]),style:A(P(o.to)?{backgroundColor:"var(--agency-primary, #14b8a6)"}:{})},{default:O(()=>[(s(),_(W(o.icon),{size:20})),e("span",null,m(o.label),1)]),_:2},1032,["to","class","style"]))),128))]),e("div",Lt,[e("div",Ht,[e("div",Rt,[g(a(J),{size:16,class:"text-white/70"}),d[6]||(d[6]=e("span",{class:"text-sm text-white/70"},"Appearance",-1))]),e("div",Ft,[(s(),r(L,null,F(M,o=>e("button",{key:o.value,onClick:v=>
1j(o.value),class:k(["flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all duration-200",a(B)===o.value?"text-white shadow-sm":"text-white/70 hover:text-white"]),style:A(a(B)===o.value?{backgroundColor:"var(--agency-primary, #14b8a6)"}:{})},[(s(),_(W(o.icon),{size:12})),R(" "+m(o.label),1)],14,Wt)),64))])]),u.canSwitchToCompany?(s(),r("button",{key:0,onClick:d[3]||(d[3]=o=>c.$emit("switch")),disabled:u.isSwitching,class:"mb-4 flex w-full items-center justify-between rounded-lg bg-white/20 p-3 text-sm transition-colors hover:bg-white/30 disabled:cursor-not-allowed disabled:opacity-50"},[e("div",Dt,[g(a(se),{size:16}),d[7]||(d[7]=e("span",{class:"font-medium"},"Switch",-1))]),e("span",It,m(u.switchTargetName),1)],8,Ot)):f("",!0),e("div",Ut,[e("div",Et,[e("div",Vt,m(u.userInitials),1),e("div",Kt,[e("div",qt,m(u.userName),1),d[8]||(d[8]=e("div",{class:"truncate text-xs text-white/70"},"Agency Manager",-1))])])]),a(N)?f("",!0):(s(),r("button",{key:1,onClick:d[4]||(d[4]=o=>c.$emit("logout")),class:"flex w-full items-center justify-center gap-2 rounded-lg bg-red-500/20 p-3 text-red-300 transition-colors hover:bg-red-500/30 dark:bg-red-600/20 dark:text-red-400 dark:hover:bg-red-600/30"},[g(a(ne),{size:18}),d[9]||(d[9]=e("span",{class:"text-sm font-medium"}
1,"Logout",-1))]))])])])):f("",!0)]),_:1})],64)}}},Jt=Ye(Gt,[["__scopeId","data-v-2921b662"]]),Xt={key:0,class:"relative"},Yt=["title"],Qt={key:0,class:"truncate font-medium"},Zt={class:"border-b border-gray-100 p-3 dark:border-gray-700"},ea={class:"relative"},ta={class:"max-h-80 overflow-y-auto"},aa={key:0,class:"px-4 py-6 text-center text-sm text-gray-500 dark:text-gray-400"},sa={key:1,class:"px-4 py-6 text-center text-sm text-gray-500 dark:text-gray-400"},na=["disabled","onClick"],oa={class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-teal-100 text-sm font-semibold text-teal-700 dark:bg-teal-900/40 dark:text-teal-300"},ia={class:"min-w-0 flex-1"},ra={class:"flex items-center gap-1.5"},la={class:"truncate text-sm font-medium text-gray-900 dark:text-white"},ca={class:"block truncate text-xs text-gray-500 dark:text-gray-400"},da={__name:"SubAccountSwitcher",props:{isExpanded:{type:Boolean,default:!0}},setup(u){const p=X(),l=$(!1),C=$(""),T=$(null),y=$(null),h=$("");let B=null;Ue(C,w=>{clearTimeout(B),B=setTimeout(()=>{h.value=w.trim()},250)});const{data:N,isFetching:S}=Le({queryKey:b(()=>["agency","switcher",h.value]),queryFn:()=>bt({page:1,pageSize:25,search:h.value}),enabled:l,staleTime:3e4}),M=b(()=>N.value?.results||[]),j=b(()=>p.agencyHasPermission("agency.impersonate_clients")),z=async()=>{j.value&&(l.value=!0,await Ke(),T.value?.focus())},P=()=>{l.value=!1,C.value="",h.value=""},c=w=>w?.user_id||w?.owner||null,d=async w=>{const o=c(w);if(!o?._id){Ce.error("This client has no owner account to switch into");return}if(!y.value){y.value=w._id;try{await Se(o)}catch{}finally{y.value=null}}};return(w,o)=>j.value?(s(),r("div",Xt,[e("button",{type:"button",onClick:o[0]||(o[0]=v=>l.value?P():z()),class:k(["flex w-full items-center gap-2 rounded-lg bg-white/20 text-sm transition-colors hover:bg-white/30",u.isExpanded?"justify-between px-3 py-2.5":"justify-center p-2.5"]),title:u.isExpanded?void 0:"Switch to a sub-account"},[u.isExpanded?(s(),r("span",Qt,"Click here to switch")):f("",!0),g(a(ct),{size:16,class:"shrink-0 opacity-80"})],10,Yt),l.value?(s(),r("div",{key:0,class:"fixed inset-0 z-40",onClick:P})):f("",!0),l.value?(s(),r("div",{key:1,class:k(["absolute z-50 mt-2 w-80 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800",u.isExpanded?"left-0":"left-full ml-2"])},[e("div",Zt,[e("div",ea,[g(a(dt),{size:16,class:"absolute top-1/2 left-3 -translate-y-1/2 text-gray-400 dark:text-gray-500"}),U(e("input",{ref_key:"searchInput",ref:T,"onUpdate:modelValue":o[1]||(o[1]=v=>C.value=v),type:"text",placeholder:"Search for a sub-account",class:"w-full rounded-md border border-gray-300 bg-white py-2 pr-3 pl-9 text-sm text-gray-900 focus:border-teal-500 focus:ring-1 focus:ring-teal-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white",onKeydown:Ve(P,["esc"])},null,544),[[Ee,C.value]])])]),e("div",ta,[a(S)&&!M.value.length?(s(),r("p",aa," Loading… ")):M.value.length?(s(),r(L,{key:2},[o[2]||(o[2]=e("p",{class:"px-4 pt-3 pb-1 text-xs font-semibold tracking-wide text-gray-400 uppercase dark:text-gray-500"}," All accounts ",-1)),(s(!0),r(L,null,F(M.value,v=>(s(),r("button",{key:v._id,type:"button",disabled:y.value===v._id,onClick:H=>d(v),class:"flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-gray-50 disabled:cursor-wait disabled:opacity-60 dark:hover:bg-gray-700"},[e("span",oa,m((v.company_name||"?").charAt(0).toUpperCase()),1),e("span",ia,[e("span",ra,[e("span",la,m(v.company_name||"Untitled"),1),v.paused_at?(s(),_(a(ut),{key:0,size:13,class:"shrink-0 text-amber-500",title:"Paused"})):f("",!0)]),e("span",ca,m(c(v)?.email||"—"),1)]),a(p).company?._id===v._id?(s(),_(a(gt),{key:0,size:16,class:"shrink-0 text-teal-600 dark:text-teal-400"})):f("",!0)],8,na))),128))],64)):(s(),r("p",sa,m(C.value?"No sub-accounts match that search.":"No sub-accounts yet."),1))])],2)):f("",!0)])):f("",!0)}},ua=["title"],ga={class:"flex h-full flex-col"},ya={class:"border-b border-white/20 p-4 dark:border-gray-700"},ma={class:"flex items-center gap-3"},pa=["src","alt"],ha={key:0},va={class:"text-xs opacity-70"},fa=["onMouseenter"],ba={key:0},xa={class:"border-t border-white/20 dark:border-gray-700"},wa={key:0,class:"space-y-4 p-4"},ka={class:"mb-2 flex items-center gap-2"},_a={class:"flex rounded-lg bg-white/10 p-1 dark:bg-gray-700/50"},$a=["onClick"],Ca=["disabled"],Sa={class:"flex items-center gap-2"},za={class:"truncate opacity-80"},Ta={class:"flex items-center gap-2"},Aa={class:"tabular-nums"},Na={class:"rounded-lg bg-white/10 p-3 backdrop-blur dark:bg-gray-800/50"},Ma={class:"flex items-center gap-3"},ja={class:"min-w-0 flex-1"},Pa={class:"font-semibold"},Ba={class:"truncate text-xs opacity-70"},La={class:"mt-3 text-center text-[10px] opacity-40"},Ha={key:1,class:"space-y-3 p-3"},Ra={class:"group/theme relative flex justify-center"},Fa=["title"],Wa={class:"pointer-events-none absolute top-1/2 left-full z-50 flex -translate-y-1/2 items-center pl-2 opacity-0 transition-all duration-200 group-hover/theme:pointer-events-auto group-hover/theme:opacity-100"},Oa={class:"flex items-center gap-1 rounded-lg bg-gray-700 p-1.5 shadow-lg dark:bg-gray-800"},Da=["onClick","title"],Ia=["disabled"],Ua=["title"],Ea={__name:"AgencyNavigationSidebar",props:{agencyName:{type:String,default:"My Agency"},userName:{type:String,default:""},userInitials:{type:String,default:""},canSwitchToCompany:{type:Boolean,default:!1},switchTargetName:{type:String,default:"Company"},isSwitching:{type:Boolean,default:!1}},emits:["logout","switch"],setup(u){const p=$e(),l=X(),{version:C,fullVersion:T}=nt(),{brandingName:y,brandingLogoUrl:h,isWhiteLabeled:B}=ce(),{backdropClass:N}=de(h,{onDark:!0}),{themeMode:S,isGhlSession:M,isDarkMode:j,user:z,agency:P}=re(l),c=b(()=>Number(P.value?.wallet_credits||0)/100),d=b(()=>c.value<2),w=b(()=>l.agencyHasPermission("agency.subscription_payments")),{setThemeMode:o}=l,v=b(()=>z.value&&(z.value.photo_file||z.value.photo)||""),H=$(null),E=$(!1),V=()=>{const t=H.value;if(!t)return;const n=t.scrollHeight>t.clientHeight+4,I=t.scrollTop+t.clientHeight>=t.scrollHeight-20;E.value=n&&!I};let Y=null;qe(()=>{const t=H.value;t&&(t.addEventListener("scroll",V,{passive:!0}),Y=new ResizeObserver(V),Y.observe(t),V())}),Ge(()=>{H.value?.removeEventListener("scroll",V),Y?.disconnect()});const x=$(!0),ue=ae({}),Q=$(null),ge=ae({}),ye=$(null),me=$(null),pe=$(null),D=$(null),K=ae({switch:{},user:{},logout:{}}),he=t=>{if(!t)return{top:"0px",left:"0px"};const n=t.getBoundingClientRect();return{top:`${n.top+n.height/2}px`,left:`${n.right+8}px`,transform:"translateY(-50%)"}}
1,He=t=>{if(x.value)return;const n=ue[t];n&&(ge[t]=he(n),Q.value=t)},Re=()=>{Q.value=null},Fe=t=>ge[t]||{top:"0px",left:"0px"},Z=t=>{if(x.value)return;let n=null;t==="switch"?n=ye.value:t==="user"?n=me.value:t==="logout"&&(n=pe.value),n&&(K[t]=he(n),D.value=t)},ee=()=>{D.value=null},te=[{value:"light",label:"Light",icon:Te},{value:"dark",label:"Dark",icon:J},{value:"system",label:"System",icon:Ae}],ve=b(()=>te.find(t=>t.value===S.value)),fe=t=>{o(t)},We=b(()=>!!l.agency?.go_high_level?.access_token),{data:Oe}=Le({queryKey:["settings"],queryFn:xt,staleTime:300*1e3}),De=b(()=>Oe.value?.settings?.client_invitations_enabled??!1),be=b(()=>{const t=[];return l.agencyHasPermission("agency.view_dashboard")&&t.push({name:"dashboard",label:"Dashboard",to:"/agency",icon:Ne}),l.agencyHasPermission("agency.subscription_payments")&&(t.push({name:"subscription",label:"Subscription",to:"/agency/subscription-management/plans",icon:Me}),t.push({name:"phone-numbers",label:"Phone Numbers",to:"/agency/phone-numbers",icon:ht})),l.agencyHasPermission("agency.add_client_subscription")&&(t.push({name:"add-client",label:"Add Client (Standard)",to:"/agency/companies/create",icon:oe}),We.value&&t.push({name:"add-client-ghl",label:"Add Client (GHL)",to:"/agency/companies/create-ghl",icon:oe})),l.agencyHasPermission("agency.manage_clients")&&t.push({name:"all-clients",label:"All Clients",to:"/agency/companies",icon:je}),De.value&&l.agencyHasPermission("agency.manage_clients")&&t.push({name:"client-invitations",label:"Client Invitations",to:"/agency/client-invitations/create",icon:vt}),l.agencyHasPermission("agency.manage_playground")&&(t.push({name:"playground",label:"Playground",to:"/agency/playground",icon:ie}),t.push({name:"simple-playground",label:"Shareable Playgrounds",to:"/agency/simple-playground",icon:ie})),l.agencyHasPermission("agency.manage_packages")&&t.push({name:"packages",label:"Packages & Allocations",to:"/agency/packages",icon:Pe}),l.isAgencyOwner&&t.push({name:"staff",label:"Staff Members",to:"/agency/staff",icon:ft}),t.push({name:"settings",label:"Settings",to:"/agency/settings",icon:Be}),t}),xe=t=>t==="/agency"?p.path==="/agency":t==="/agency/subscription-management/plans"?p.path.startsWith("/agency/subscription-management"):t==="/agency/companies/create"?p.path==="/agency/companies/create":t==="/agency/companies/create-ghl"?p.path==="/agency/companies/create-ghl":t==="/agency/client-invitations/create"?p.path.startsWith("/agency/client-invitations"):t==="/agency/companies"?p.path==="/agency/companies"||p.path.startsWith("/agency/companies/")&&p.path!=="/agency/companies/create"&&p.path!=="/agency/companies/create-ghl":t==="/agency/settings"?p.path.startsWith("/agency/settings"):t.startsWith("/agency/playground")?p.path.startsWith("/agency/playground"):p.path.startsWith(t),Ie=()=>{x.value=!x.value};return(t,n)=>{const I=le("router-link");return s(),r(L,null,[e("nav",{class:k(["group/nav relative hidden shrink-0 transition-all duration-300 md:block",[x.value?"w-80":"w-20"]]),style:A({backgroundColor:a(j)?"#111827":"var(--agency-sidebar-bg, #2c4f4f)",color:a(j)?"#fff":"var(--agency-sidebar-text, #fff)"})},[e("button",{onClick:Ie,class:"absolute top-7 -right-3 z-50 flex h-6 w-6 items-center justify-center rounded-full border border-gray-300 bg-white text-gray-600 opacity-0 shadow-md transition-all duration-200 group-hover/nav:opacity-100 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700",title:x.value?"Collapse menu":"Expand menu"},[x.value?(s(),_(a(yt),{key:0,size:14})):(s(),_(a(mt),{key:1,size:14}))],8,ua),e("div",ga,[e("div",ya,[e("div",ma,[e("img",{src:a(h),alt:a(y),class:k(["shrink-0 object-contain",a(B)?["h-12 w-12 rounded-lg p-1",a(N)]:"h-10"])},null,10,pa),x.value?(s(),r("div",ha,[n[7]||(n[7]=e("div",{class:"text-lg font-bold whitespace-nowrap"},"Agency Portal",-1)),e("div",va,m(u.agencyName),1)])):f("",!0)]),g(da,{"is-expanded":x.value,class:"mt-3"},null,8,["is-expanded"])]),e("div",{ref_key:"menuScrollRef",ref:H,class:"sidebar-scroll flex-1 overflow-y-auto py-4"},[e("div",{class:k([x.value?"px-4":"px-3","space-y-1"])},[(s(!0),r(L,null,F(be.value,i=>(s(),r("div",{key:i.name,ref_for:!0,ref:q=>
1ue[i.name]=q,onMouseenter:q=>He(i.name),onMouseleave:Re},[g(I,{to:i.to,class:k(["flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors",xe(i.to)?"agency-nav-active":"opacity-90 hover:bg-white/10 hover:opacity-100",!x.value&&"justify-center"]),style:A(xe(i.to)?{backgroundColor:"var(--agency-primary, #14b8a6)"}:{})},{default:O(()=>[(s(),_(W(i.icon),{size:20})),x.value?(s(),r("span",ba,m(i.label),1)):f("",!0)]),_:2},1032,["to","class","style"])],40,fa))),128))],2)],512),E.value?(s(),r("div",{key:0,class:"pointer-events-none relative z-10 flex justify-center",style:A({background:a(j)?"linear-gradient(to top, #111827 30%, transparent)":"linear-gradient(to top, var(--agency-sidebar-bg, #2c4f4f) 30%, transparent)",marginTop:"-2.5rem",height:"2.5rem"})},[g(a(pt),{size:16,class:"mb-1 animate-bounce self-end text-white opacity-60"})],4)):f("",!0),e("div",xa,[x.value?(s(),r("div",wa,[e("div",null,[e("div",ka,[g(a(J),{size:16,class:"opacity-70"}),n[8]||(n[8]=e("span",{class:"text-sm opacity-70"},"Appearance",-1))]),e("div",_a,[(s(),r(L,null,F(te,i=>e("button",{key:i.value,onClick:q=>fe(i.value),class:k(["flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all duration-200",a(S)===i.value?"shadow-sm":"opacity-70 hover:opacity-100"]),style:A(a(S)===i.value?{backgroundColor:"var(--agency-primary, #14b8a6)"}:{})},[(s(),_(W(i.icon),{size:12})),R(" "+m(i.label),1)],14,$a)),64))])]),u.canSwitchToCompany?(s(),r("button",{key:0,onClick:n[0]||(n[0]=i=>t.$emit("switch")),disabled:u.isSwitching,class:"flex w-full items-center justify-between rounded-lg bg-white/20 p-3 text-sm transition-colors hover:bg-white/30 disabled:cursor-not-allowed disabled:opacity-50"},[e("div",Sa,[g(a(se),{size:16}),n[9]||(n[9]=e("span",{class:"font-medium"},"Switch",-1))]),e("span",za,m(u.switchTargetName),1)],8,Ca)):f("",!0),w.value?(s(),_(I,{key:1,to:{name:"agency-subscription-wallet"},class:k(["flex items-center justify-between rounded-lg px-3 py-2 text-sm transition-colors",d.value?"bg-amber-500/15 text-amber-200 hover:bg-amber-500/25":"bg-white/10 text-white/90 hover:bg-white/15"]),title:"Wallet — click to top up"},{default:O(()=>[e("span",Ta,[g(a(_e),{size:15,class:k(d.value?"text-amber-300":"opacity-70")},null,8,["class"]),n[10]||(n[10]=R(" Wallet ",-1))]),e("strong",Aa,"$"+m(c.value.toFixed(2)),1)]),_:1},8,["class"])):f("",!0),e("div",Na,[e("div",Ma,[g(ke,{name:u.userName,"file-id":v.value,size:"md",shape:"circle"},null,8,["name","file-id"]),e("div",ja,[e("div",Pa,m(u.userName),1),e("div",Ba,m(a(l).isAgencyStaff?"Agency Staff":"Agency Manager"),1)])])]),a(M)?f("",!0):(s(),r("button",{key:2,onClick:n[1]||(n[1]=i=>t.$emit("logout")),class:"mt-3 flex w-full items-center justify-center gap-2 rounded-lg bg-red-500/20 p-3 text-red-300 transition-colors hover:bg-red-500/30 dark:bg-red-600/20 dark:text-red-400 dark:hover:bg-red-600/30"},[g(a(ne),{size:18}),n[11]||(n[11]=e("span",{class:"text-sm font-medium"}
1,"Logout",-1))])),e("div",La,"v"+m(a(T)),1)])):(s(),r("div",Ha,[e("div",Ra,[e("button",{class:"flex h-10 w-10 items-center justify-center rounded-lg text-white shadow-sm transition-all duration-200",style:{backgroundColor:"var(--agency-primary, #14b8a6)"},title:ve.value?.label},[(s(),_(W(ve.value?.icon),{size:18}))],8,Fa),e("div",Wa,[e("div",Oa,[(s(),r(L,null,F(te,i=>e("button",{key:i.value,onClick:q=>fe(i.value),class:k(["flex h-8 w-8 items-center justify-center rounded-md transition-all duration-150",a(S)===i.value?"text-white":"text-white/70 hover:bg-white/10 hover:text-white"]),style:A(a(S)===i.value?{backgroundColor:"var(--agency-primary, #14b8a6)"}:{}),title:i.label},[(s(),_(W(i.icon),{size:16}))],14,Da)),64))])])]),u.canSwitchToCompany?(s(),r("div",{key:0,ref_key:"switchButtonRef",ref:ye,class:"flex justify-center",onMouseenter:n[3]||(n[3]=i=>Z("switch")),onMouseleave:ee},[e("button",{onClick:n[2]||(n[2]=i=>t.$emit("switch")),disabled:u.isSwitching,class:"flex h-10 w-10 items-center justify-center rounded-lg bg-white/20 transition-colors hover:bg-white/30 disabled:cursor-not-allowed disabled:opacity-50"},[g(a(se),{size:18})],8,Ia)],544)):f("",!0),w.value?(s(),_(I,{key:1,to:{name:"agency-subscription-wallet"},class:"flex flex-col items-center gap-0.5",title:"Wallet — click to top up"},{default:O(()=>[e("div",{class:k(["flex h-10 w-10 items-center justify-center rounded-lg transition-colors",d.value?"bg-amber-500/20 text-amber-300 hover:bg-amber-500/30":"bg-white/10 text-white/80 hover:bg-white/20"])},[g(a(_e),{size:18})],2),e("span",{class:k(["text-[9px] font-semibold tabular-nums",d.value?"text-amber-300":"text-white/60"])}," $"+m(c.value.toFixed(2)),3)]),_:1})):f("",!0),e("div",{ref_key:"userAvatarRef",ref:me,class:"flex justify-center",onMouseenter:n[4]||(n[4]=i=>Z("user")),onMouseleave:ee},[g(ke,{name:u.userName,"file-id":v.value,size:"md",shape:"circle"},null,8,["name","file-id"])],544),a(M)?f("",!0):(s(),r("div",{key:2,ref_key:"logoutButtonRef",ref:pe,class:"flex justify-center",onMouseenter:n[6]||(n[6]=i=>Z("logout")),onMouseleave:ee},[e("button",{onClick:n[5]||(n[5]=i=>t.$emit("logout")),class:"flex h-10 w-10 items-center justify-center rounded-lg bg-red-500/20 text-red-300 transition-colors hover:bg-red-500/30 dark:bg-red-600/20 dark:text-red-400 dark:hover:bg-red-600/30"},[g(a(ne),{size:20})])],544)),e("div",{class:"mt-2 text-center text-[9px] opacity-30",title:`v${a(T)}`}," v"+m(a(C)),9,Ua)]))])])],6),(s(),_(Je,{to:"body"},[(s(!0),r(L,null,F(be.value,i=>U((s(),r("div",{key:`tooltip-${i.name}`,class:"pointer-events-none fixed z-9999 rounded-md bg-gray-900 px-2.5 py-1.5 text-xs font-medium whitespace-nowrap text-white shadow-lg dark:bg-gray-700",style:A(Fe(i.name))},[R(m(i.label)+" ",1),n[12]||(n[12]=e("div",{class:"absolute top-1/2 right-full -translate-y-1/2 border-4 border-transparent border-r-gray-900 dark:border-r-gray-700"},null,-1))],4)),[[G,!x.value&&Q.value===i.name]])),128)),U(e("div",{class:"pointer-events-none fixed z-9999 rounded-md bg-gray-900 px-2.5 py-1.5 text-xs font-medium whitespace-nowrap text-white shadow-lg dark:bg-gray-700",style:A(K.switch)},[R(" Switch to "+m(u.switchTargetName)+" ",1),n[13]||(n[13]=e("div",{class:"absolute top-1/2 right-full -translate-y-1/2 border-4 border-transparent border-r-gray-900 dark:border-r-gray-700"},null,-1))],4),[[G,!x.value&&D.value==="switch"]]),U(e("div",{class:"pointer-events-none fixed z-9999 rounded-md bg-gray-900 px-2.5 py-1.5 text-xs font-medium whitespace-nowrap text-white shadow-lg dark:bg-gray-700",style:A(K.user)},[R(m(u.userName)+" ",1),n[14]||(n[14]=e("div",{class:"absolute top-1/2 right-full -translate-y-1/2 border-4 border-transparent border-r-gray-900 dark:border-r-gray-700"},null,-1))],4),[[G,!x.value&&D.value==="user"]]),U(e("div",{class:"pointer-events-none fixed z-9999 rounded-md bg-gray-900 px-2.5 py-1.5 text-xs font-medium whitespace-nowrap text-white shadow-lg dark:bg-gray-700",style:A(K.logout)},[...n[15]||(n[15]=[R(" Logout ",-1),e("div",{class:"absolute top-1/2 right-full -translate-y-1/2 border-4 border-transparent border-r-gray-900 dark:border-r-gray-700"},null,-1)])],4),[[G,!x.value&&D.value==="logout"]])]))],64)}}},Va={class:"relative flex flex-1 flex-col overflow-hidden md:flex-row"},Ka={class:"flex flex-1 flex-col overflow-hidden bg-gray-100 dark:bg-gray-900"},qa={class:"flex-1 overflow-y-auto p-4 lg:p-6"},ls={__name:"AgencyLayout",setup(u){const p=Xe(),l=X(),{user:C,agency:T,company:y}=re(l),{logout:h}=l,B=b(()=>{const o=T.value?.theme_colors||{};return{"--agency-primary":o.primary||"#14b8a6","--agency-secondary":o.secondary||"#163236","--agency-accent":o.accent||"#10B981","--agency-sidebar-bg":o.sidebar_bg||"#2c4f4f","--agency-sidebar-text":o.sidebar_text||"#FFFFFF","--agency-header-bg":o.header_bg||"#FFFFFF","--agency-header-text":
1o.header_text||"#111827"}}),N=$(!1),S=b(()=>T.value?.name||"My Agency"),M=b(()=>tt(C.value)),j=b(()=>at(C.value)),z=$(!1),P=b(()=>!!y.value?.user_id),c=b(()=>y.value?.name||"Company"),d=()=>{h(),p.push("/login")},w=async()=>{if(!(z.value||!y.value?.user_id)){z.value=!0;try{l.isAgencyStaff&&l.user?.linked_user_id?(await Qe(),p.push("/dashboard").then(()=>window.location.reload())):l.isAgencyStaff?await Se({_id:y.value.user_id,email:y.value.company_name},{redirectTo:"/dashboard",useHardNavigation:!0}):(await Ze(y.value.user_id),p.push("/dashboard").then(()=>{window.location.reload()}))}catch(o){Ce.error(et(o)),z.value=!1}}};return(o,v)=>{const H=le("router-view");return s(),r("div",{class:"flex h-screen flex-col bg-gray-100 dark:bg-gray-900",style:A(B.value)},[g(ot),g(st),g(it,{type:"agency"}),e("div",Va,[g(St,{"agency-name":S.value,"is-menu-open":N.value,onToggleMenu:v[0]||(v[0]=E=>N.value=!N.value)},null,8,["agency-name","is-menu-open"]),g(Jt,{"is-open":N.value,"agency-name":S.value,"user-name":M.value,"user-initials":j.value,"can-switch-to-company":P.value,"switch-target-name":c.value,"is-switching":z.value,onClose:v[1]||(v[1]=E=>N.value=!1),onLogout:d,onSwitch:w},null,8,["is-open","agency-name","user-name","user-initials","can-switch-to-company","switch-target-name","is-switching"]),g(Ea,{"agency-name":S.value,"user-name":M.value,"user-initials":j.value,"can-switch-to-company":P.value,"switch-target-name":c.value,"is-switching":z.value,onLogout:d,onSwitch:w},null,8,["agency-name","user-name","user-initials","can-switch-to-company","switch-target-name","is-switching"]),e("main",Ka,[e("div",qa,[g(H)])])])],4)}}};export{ls as default};

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.