1"use strict";(self.webpackChunkquickmail=self.webpackChunkquickmail||[]).push([["app_javascript_angular-engine_projects_quickmail_app_business_business_module_ts"],{22805:(Ut,B,s)=>{s.d(B,{BusinessModule:()=>Bt});var u=s(72200),h=s(38132),t=s(73664),U=s(33748),_=s(37589),j=s(16018),V=s(30450),z=s(11534);function X(r,p){if(1&r&&(t.j41(0,"div",1)(1,"div",2),t.nrm(2,"ui-avatar",3),t.k0s(),t.j41(3,"div",4)(4,"div",5),t.EFF(5),t.k0s()(),t.j41(6,"div",6),t.nrm(7,"ui-icon-button"),t.k0s()()),2&r){const e=p.ngIf,n=t.XpG();t.R7$(2),t.Y8G("src",e.avatarUrl)("name",e.name)("pillText",n.roleSign(e.role))("pillTooltipText",e.role),t.R7$(3),t.JRh(e.name)}}let N=(()=>{class r{profileService;profile$;constructor(e){this.profileService=e}roleSign(e){return this.profileService.roleSign(e)}static \u0275fac=function(n){return new(n||r)(t.rXU(j.p))};static \u0275cmp=t.VBU({type:r,selectors:[["sidebar-footer"]],inputs:{profile$:"profile$"},standalone:!1,decls:2,vars:3,consts:[["class","footer",4,"ngIf"],[1,"footer"],[1,"footer_avatar"],[3,"src","name","pillText","pillTooltipText"],[1,"footer__details"],[1,"footer__name"],[1,"footer__more"]],template:function(n,o){1&n&&(t.DNE(0,X,8,5,"div",0),t.nI1(1,"async")),2&n&&t.Y8G("ngIf",t.bMT(1,1,o.profile$))},dependencies:[u.bT,V.f,z.x,u.Jj],styles:["[_nghost-%COMP%]{height:4rem;border-top-width:2px;border-color:#d1d5db66;padding:.625rem 1rem}.footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;font-size:.9375rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.footer__details[_ngcontent-%COMP%]{flex:1 1 0%;overflow:hidden}.footer__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.footer__avatar[_ngcontent-%COMP%]{flex-shrink:0}"]})}return r})(),J=(()=>{class r{currentAccount$;constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=t.VBU({type:r,selectors:[["sidebar-header"]],inputs:{currentAccount$:"currentAccount$"},standalone:!1,decls:6,vars:0,consts:[[1,"header"],[1,"header__details"],[1,"header__title"],[1,"header__subtitle"]],template:function(n,o){1&n&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2),t.EFF(3,"Business Dashboard"),t.k0s(),t.j41(4,"div",3),t.EFF(5,"Biz"),t.k0s()()())},styles:["[_nghost-%COMP%]{height:3.5rem}.header[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding:.5rem 1rem;vertical-align:top}.header__back[_ngcontent-%COMP%]{width:1rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.header__details[_ngcontent-%COMP%]{flex:1 1 0%;overflow:hidden}.header__title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9375rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.header__subtitle[_ngcontent-%COMP%]{margin-top:.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.625rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;--tw-text-opacity: 1;color:rgb(105 107 143 / var(--tw-text-opacity, 1))}.header__notifications[_ngcontent-%COMP%]{position:relative;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.header__notifications[_ngcontent-%COMP%] ui-pill[_ngcontent-%COMP%]{position:absolute;right:-5px;top:-.25rem}"]})}return r})();var Q=s(60208),$=s(48578);let L=(()=>{class r{watchAccount;settingsSubNavOpen=!1;constructor(e){this.watchAccount=e}ngOnInit(){}static \u0275fac=function(n){return new(n||r)(t.rXU(Q.O))};static \u0275cmp=t.VBU({type:r,selectors:[["sidebar-navigation"]],standalone:!1,decls:16,vars:3,consts:[[1,"nav"],[1,"nav__group"],[1,"nav__menu"],[1,"nav__item"],["routerLinkActive","nav__link--selected","routerLink","dashboard",1,"nav__link"],[3,"name"],["routerLinkActive","nav__link--selected","routerLink","kpi",1,"nav__link"],["routerLinkActive","nav__link--selected","routerLink","money",1,"nav__link"]],template:function(n,o){1&n&&(t.j41(0,"ul",0)(1,"li",1)(2,"ul",2)(3,"li",3)(4,"a",4),t.nrm(5,"ui-icon",5),t.j41(6,"span"),t.EFF(7,"Dashboard"),t.k0s()(),t.j41(8,"a",6),t.nrm(9,"ui-icon",5),t.j41(10,"span"),t.EFF(11,"KPIs"),t.k0s()(),t.j41(12,"a",7),t.nrm(13,"ui-icon",5),t.j41(14,"span"),t.EFF(15,"Money"),t.k0s()()()()()()),2&n&&(t.R7$(5),t.Y8G("name","columns"),t.R7$(4),t.Y8G("name","chart
1-line"),t.R7$(4),t.Y8G("name","money-bill"))},dependencies:[h.Wk,h.wQ,$.R],styles:["[_nghost-%COMP%]{display:flex;flex:1 1 0%;flex-direction:column;overflow-y:auto;padding:.75rem}.nav[_ngcontent-%COMP%]{display:flex;flex:1 1 0%;flex-direction:column}.nav__link[_ngcontent-%COMP%]{display:flex;height:2.5rem;cursor:pointer;align-items:center;gap:.625rem;border-radius:.5rem;padding:.5rem .75rem;font-size:.9375rem;font-weight:500;line-height:1.5rem;--tw-text-opacity: 1;color:rgb(192 192 206 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nav__link[_ngcontent-%COMP%]:hover{background-color:hsl(var(--twc-blue-500) / .2);--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.nav__link--open[_ngcontent-%COMP%] > .nav__link[_ngcontent-%COMP%]{border-bottom-right-radius:0;border-bottom-left-radius:0;background-color:hsl(var(--twc-blue-500) / .2);--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.nav__link--selected[_ngcontent-%COMP%]{--tw-bg-opacity: 1;background-color:hsl(var(--twc-blue-500) / var(--twc-blue-500-opacity, var(--tw-bg-opacity)));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.nav__link--selected[_ngcontent-%COMP%]:hover{--tw-bg-opacity: 1;background-color:hsl(var(--twc-blue-500) / var(--twc-blue-500-opacity, var(--tw-bg-opacity)))}.nav__group-title[_ngcontent-%COMP%]{margin-top:.5rem;margin-bottom:.5rem;padding-left:.5rem;padding-right:.5rem;padding-top:.5rem;font-size:.625rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;--tw-text-opacity: 1;color:rgb(105 107 143 / var(--tw-text-opacity, 1))}.nav__sub-menu[_ngcontent-%COMP%]{display:none;padding-bottom:.625rem}.nav__link--open[_ngcontent-%COMP%] .nav__sub-menu[_ngcontent-%COMP%]{display:block;border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem;background-color:hsl(var(--twc-blue-500) / .2)}.nav__sub-menu-toggle[_ngcontent-%COMP%]{margin-left:auto;margin-right:1px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nav__link--open[_ngcontent-%COMP%] .nav__sub-menu-toggle[_ngcontent-%COMP%]{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.nav__sub-menu[_ngcontent-%COMP%] .nav__link[_ngcontent-%COMP%]{margin-left:.625rem;margin-right:.625rem;padding-left:1rem;font-size:.8125rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.nav__sub-menu[_ngcontent-%COMP%] .nav__link[_ngcontent-%COMP%]:hover{--tw-bg-opacity: 1;background-color:hsl(var(--twc-blue-700) / var(--twc-blue-700-opacity, var(--tw-bg-opacity)))}"]})}return r})(),W=(()=>{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=t.VBU({type:r,selectors:[["sidebar-plan"]],standalone:!1,decls:3,vars:0,consts:[[1,"plan"],[1,"plan__link"]],template:function(n,o){1&n&&(t.j41(0,"div",0)(1,"a",1),t.EFF(2,"ADMIN"),t.k0s()())},styles:["[_nghost-%COMP%]{height:2rem}.plan[_ngcontent-%COMP%]{display:flex}.plan__link[_ngcontent-%COMP%]{margin-left:auto;margin-right:auto;display:inline-flex;height:1.75rem;
1align-items:center;justify-content:center;border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem;--tw-bg-opacity: 1;background-color:hsl(var(--twc-blue-800) / var(--twc-blue-800-opacity, var(--tw-bg-opacity)));padding:.375rem 1rem;font-size:.625rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;--tw-text-opacity: 1;color:hsl(var(--twc-blue-300) / var(--twc-blue-300-opacity, var(--tw-text-opacity)))}"]})}return r})(),H=(()=>{class r{profileService;profile$;constructor(e){this.profileService=e}ngOnInit(){this.profile$=this.profileService.profile(68,1)}static \u0275fac=function(n){return new(n||r)(t.rXU(j.p))};static \u0275cmp=t.VBU({type:r,selectors:[["sidebar"]],hostAttrs:[1,"business-sidebar"],standalone:!1,decls:4,vars:1,consts:[[3,"profile$"]],template:function(n,o){1&n&&t.nrm(0,"sidebar-plan")(1,"sidebar-header")(2,"sidebar-navigation")(3,"sidebar-footer",0),2&n&&(t.R7$(3),t.Y8G("profile$",o.profile$))},dependencies:[N,J,L,W],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:14rem;-webkit-user-select:none;user-select:none;flex-direction:column;--tw-bg-opacity: 1;background-color:hsl(var(--twc-blue-dark) / var(--twc-blue-dark-opacity, var(--tw-bg-opacity)))}"],changeDetection:0})}return r})(),K=(()=>{class r{constructor(){}ngOnInit(){}ngOnDestroy(){}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=t.VBU({type:r,selectors:[["business-layout"]],standalone:!1,decls:6,vars:0,consts:[[1,"main"],[1,"pin"],["name","pin"]],template:function(n,o){1&n&&(t.nrm(0,"sidebar"),t.j41(1,"div",0),t.nrm(2,"router-outlet"),t.k0s(),t.j41(3,"div",1),t.nrm(4,"router-outlet",2),t.k0s(),t.nrm(5,"ui-modal"))},dependencies:[U.z,_.n3,H],styles:["[_nghost-%COMP%]{display:flex;height:100vh}.main[_ngcontent-%COMP%]{flex:1 1 0%;overflow-y:auto;--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:1.25rem;padding-right:1.25rem;padding-bottom:7rem}@media (max-height: 740px){.main[_ngcontent-%COMP%]{padding-bottom:5rem}}.pin[_ngcontent-%COMP%]{display:flex;height:100vh;flex-direction:column;overflow-y:auto;border-left-width:1px;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}"]})}return r})();var b=s(98221),O=s(21698),m=s(2615),E=s(10566),x=s(61990),Z=s(76986),q=s(65450),tt=s(99549),et=s(55676),f=s(84341);function nt(r,p){if(1&r&&t.nrm(0,"ui-error",12),2&r){const e=t.XpG();t.Y8G("error",e.error)}}let rt=(()=>{class r extends O.h{businessService;route;router;data;error="";name="";website="";source="inbound";clients=null;constructor(e,n,o,a,i){super(a,i),this.businessService=e,this.route=n,this.router=o,this.data=i}add(e,n,o){this.error="",this.businessService.createPilot(this.name,this.website,this.source,this.clients,a=>{this.router.navigate(["/","agency",a.agencyId],{}),n(),this.modalService.onSuccess()},a=>{this.error=a,o(a)})}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u),t.rXU(_.nX),t.rXU(_.Ix),t.rXU(E.B),t.rXU("data",8))};static \u0275cmp=t.VBU({type:r,selectors:[["modal-add-pilot"]],standalone:!1,features:[t.Vt3],decls:18,vars:15,consts:[["form","ngForm"],["header",""],["body",""],[1,"flex","flex-col","gap-y-4"],["required","","name","name",3,"ngModelChange","label","ngModel"],["required","","name","website",3,"ngModelChange","label","ngModel"],["name","clients",3,"ngModelChange","label","ngModel"],["required","","name","source",3,"ngModelChange","ngModel","label","alignment"],[3,"value"],["actions",""],[3,"title","disabled","onClick"],["error","",3,"error",4,"ngIf"],["error","",3,"error"]],template:function(n,o){if(1&n){const a=t.RV6();t.j41(0,"form",null,0)(2,"ui-modal-child")(3,"div",1),t.EFF(4,"Create Pilot Agency"),t.k0s(),t.j41(5,"div",2)(6,"div",3)(7,"ui-input",4),t.mxI("ngModelChange",function(c){return m.eBV(a),t.DH7(o.name,c)||(o.name=c),m.Njj(c)}),t.k0s(),t.j41(8,"ui-input",5),t.mxI("ngModelChange",function(c){return m.eBV(a),t.DH7(o.website,c)||(o.website=c),m.Njj(c)}),t.k0s(),t.j41(9,"ui-input",6),t.mxI("ngModelChange",function(c){return m.eBV(a),t.DH7(o.clients,c)||(o.clients=c),m.Njj(c)}),t.k0s(),t.j41(10,"ui-radio-group",7),t.mxI("ngModelChange",function(c){return m.eBV(a),t.DH7(o.source,c)||(o.source=c),m.Njj(c)}),t.j41(11,"ui-radio-button",8),t.EFF(12,"Inbound"),t.k0s(),t.j41(13,"ui-radio-button",8),t.EFF(14,"Outbound"),t.k0s()()()(),t.j41(15,"div",9),t.nrm(16,"ui-button",10),t.k0s(),t.DNE(17,nt,1,1,"ui-error",11),t.k0s()()}if(2&n){const a=t.sdS(1);t.R7$(7),t.Y8G("label","Name"),t.R50("ngModel",o.name),t.R7$(),t.Y8G("label","Website"),t.R50("ngModel",o.website),t.R7$(),t.Y8G("label","Clients"),t.R50("ngModel",o.clients),t.R7$(),t.R50("ngModel",o.source),t.Y8G("label","Source")("alignment","horizontal"),t.R7$(),t.Y8G("value","inbound"),t.R7$(2),t.Y8G("value","outbound"),t.R7$(3),t.Y8G("title","Add")("disabled",!a.dirty||a.invalid)("onClick",o.add.bind(o)),t.R7$(),t.Y8G("ngIf",o.error)}},dependencies:[u.bT,x.Q,O.h,Z.c,q.u,tt.Z,et.U,f.qT,f.BC,f.cb,f.YS,f.vS,f.cV],encapsulation:2})}return r})();var R=s(28256),w=s(83026),D=s(72096),y=s(96354),d=s(52472),v=s(27165),k=s(60117);let G=(()=>{class r{businessService;daysToDisplay=180;total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");constructor(e){this.businessService=e}ngOnInit(){this.startDate=(0,d.GP)((0,v.e)(new Date,this.daysToDisplay),"yyyy-MM-dd"),this.chartData$=this.businessService.trialsPerDay(this.startDate,this.endDate).pipe((0,y.T)(e=>{const n=e.map(a=>(0,d.GP)(new Date(a.date),"MMM d").toUpperCase()),o=e.map(a=>a.count);return this.total=o.reduce((a,i)=>a+i,0),{labels:n,datasets:[{data:o}]}}))}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u))};static \u0275cmp=t.VBU({type:r,selectors:[["trials-per-day"]],inputs:{daysToDisplay:"daysToDisplay"},standalone:!1,decls:6,vars:5,consts:[[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[3,"type","data$"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Trials per day"),t.k0s(),t.j41(2,"p",1),t.EFF(3),t.nI1(4,"number"),t.k0s(),t.nrm(5,"ui-chart",2)),2&n&&(t.R7$(3),t.JRh(t.bMT(4,3,o.total||0)),t.R7$(2),t.Y8G("type","bar")("data$",o.chartData$))},dependencies:[k.Q,u.QX],encapsulation:2})}return r})(),ot=(()=>{class r{businessService;daysToDisplay=180;total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");constructor(e){this.businessService=e}ngOnInit(){this.startDate=(0,d.GP)((0,v.e)(new Date,this.daysToDisplay),"yyyy-MM-dd"),this.chartData$=this.businessService.subscriptionsPerDay(this.startDate,this.endDate).pipe((0,y.T)(e=>{const n=e.map(a=>(0,d.GP)(new Date(a.date),"MMM d").toUpperCase()),o=e.map(a=>a.count);return this.total=o.reduce((a,i)=>a+i,0),{labels:n,datasets:[{data:o}]}}))}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u))};static \u0275cmp=t.VBU({type:r,selectors:[["subscriptions-per-day"]],inputs:{daysToDisplay:"daysToDisplay"},standalone:!1,decls:6,vars:5,consts:[[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[3,"type","data$"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Subscriptions started (attribution to billing creation)"),t.k0s(),t.j41(2,"p",1),t.EFF(3),t.nI1(4,"number"),t.k0s(),t.nrm(5,"ui-chart",2)),2&n&&(t.R7$(3),t.JRh(t.bMT(4,3,o.total||0)),t.R7$(2),t.Y8G("type","bar")("data$",o.chartData$))},dependencies:[k.Q,u.QX],encapsulation:2})}return r})(),at=(()=>{class r{businessService;daysToDisplay=180;total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");constructor(e){this.businessService=e}ngOnInit(){this.startDate=(0,d.GP)((0,v.e)(new Date,this.daysToDisplay),"yyyy-MM-dd"),this.chartData$=this.businessService.churnsPerDay(this.startDate,this.endDate).pipe((0,y.T)(e=>{const n=e.map(a=>(0,d.GP)(new Date(a.date),"MMM d").toUpperCase()),o=e.map(a=>a.count);return this.total=o.reduce((a,i)=>a+i,0),{labels:n,datasets:[{data:o}]}}))}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u))};
1static \u0275cmp=t.VBU({type:r,selectors:[["churns-per-day"]],inputs:{daysToDisplay:"daysToDisplay"},standalone:!1,decls:6,vars:5,consts:[[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[3,"type","data$"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Churns (attribution to billing creation)"),t.k0s(),t.j41(2,"p",1),t.EFF(3),t.nI1(4,"number"),t.k0s(),t.nrm(5,"ui-chart",2)),2&n&&(t.R7$(3),t.JRh(t.bMT(4,3,o.total||0)),t.R7$(2),t.Y8G("type","bar")("data$",o.chartData$))},dependencies:[k.Q,u.QX],encapsulation:2})}return r})();var it=s(85612);let st=(()=>{class r{businessService;daysToDisplay=180;total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");constructor(e){this.businessService=e}ngOnInit(){}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u))};static \u0275cmp=t.VBU({type:r,selectors:[["business-cohort"]],inputs:{daysToDisplay:"daysToDisplay"},standalone:!1,decls:4,vars:0,consts:[[1,"text-sm","text-purple-dark"],[1,"mt-4"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Global stats"),t.k0s(),t.j41(2,"div",1),t.nrm(3,"app-cohort"),t.k0s())},dependencies:[it.E],encapsulation:2})}return r})();var ct=s(30678);let lt=(()=>{class r{total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");numberOfWeeksToSelect=12;constructor(){}handleUpdate({setting:e,value:n}){"week_range"==e&&(this.numberOfWeeksToSelect=n)}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=t.VBU({type:r,selectors:[["business-first-week-metrics"]],standalone:!1,decls:4,vars:3,consts:[[1,"text-sm","text-purple-dark"],[1,"mt-4"],[3,"onUpdate","force","displayRanges","numberOfWeeksToSelect"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Analytics"),t.k0s(),t.j41(2,"div",1)(3,"app-first-week-metrics",2),t.bIt("onUpdate",function(i){return o.handleUpdate(i)}),t.k0s()()),2&n&&(t.R7$(3),t.Y8G("force",!0)("displayRanges",!0)("numberOfWeeksToSelect",o.numberOfWeeksToSelect))},dependencies:[ct.u],encapsulation:2})}return r})(),dt=(()=>{class r{modalService;constructor(e){this.modalService=e}openAddModal(){this.modalService.show(rt)}static \u0275fac=function(n){return new(n||r)(t.rXU(E.B))};static \u0275cmp=t.VBU({type:r,selectors:[["business-dashboard"]],standalone:!1,decls:14,vars:8,consts:[[3,"title"],["actions",""],[3,"click","title","icon"],[3,"cols"]],template:function(n,o){1&n&&(t.j41(0,"ui-page-header",0),t.qex(1,1),t.j41(2,"ui-button",2),t.bIt("click",function(){return o.openAddModal()}),t.k0s(),t.bVm(),t.k0s(),t.j41(3,"ui-tiles")(4,"ui-tile",3),t.nrm(5,"trials-per-day"),t.k0s(),t.j41(6,"ui-tile",3),t.nrm(7,"subscriptions-per-day"),t.k0s(),t.j41(8,"ui-tile",3),t.nrm(9,"churns-per-day"),t.k0s(),t.j41(10,"ui-tile",3),t.nrm(11,"business-first-week-metrics"),t.k0s(),t.j41(12,"ui-tile",3),t.nrm(13,"business-cohort"),t.k0s()()),2&n&&(t.Y8G("title","Dashboard"),t.R7$(2),t.Y8G("title","Pilot")("icon","plus"),t.R7$(2),t.Y8G("cols",4),t.R7$(2),t.Y8G("cols",4),t.R7$(2),t.Y8G("cols",4),t.R7$(2),t.Y8G("cols",4),t.R7$(2),t.Y8G("cols",4))},dependencies:[x.Q,R.y,w.m,D.z,G,ot,at,st,lt],encapsulation:2})}return r})(),pt=(()=>{class r{businessService;weeksToDisplay=80;total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");constructor(e){this.businessService=e}ngOnInit(){const e=7*this.weeksToDisplay;this.startDate=(0,d.GP)((0,v.e)(new Date,e),"yyyy-MM-dd"),this.chartData$=this.businessService.trialsPerWeek(this.startDate,this.endDate).pipe((0,y.T)(n=>{const o=n.map(i=>(0,d.GP)(new Date(i.date),"MMM d").toUpperCase()),a=n.map(i=>i.count);return this.total=a.reduce((i,c)=>i+c,0),{labels:o,datasets:[{data:a}]}}))}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u))};static \u0275cmp=t.VBU({type:r,selectors:[["trials-per-week"]],inputs:{weeksToDisplay:"weeksToDisplay"},standalone:!1,decls:6,vars:5,consts:[[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[3,"type","data$"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Trials per week"),t.k0s(),t.j41(2,"p",1),t.EFF(3),t.nI1(4,"number"),t.k0s(),t.nrm(5,"ui-chart",2)),2&n&&(t.R7$(3),t.JRh(t.bMT(4,3,o.total||0)),t.R7$(2),t.Y8G("type","bar")("data$",o.chartData$))},dependencies:[k.Q,u.QX],encapsulation:2})}return r})(),ut=(()=>{class r{businessService;monthsToDisplay=24;total;chartData$;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");constructor(e){this.businessService=e}ngOnInit(){const e=30*this.monthsToDisplay;this.startDate=(0,d.GP)((0,v.e)(new Date,e),"yyyy-MM-dd"),this.chartData$=this.businessService.trialsPerMonth(this.startDate,this.endDate).pipe((0,y.T)(n=>{const o=n.map(i=>(0,d.GP)(new Date(i.date),"MMM d").toUpperCase()),a=n.map(i=>i.count);return this.total=a.reduce((i,c)=>i+c,0),{labels:o,datasets:[{data:a}]}}))}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u))};static \u0275cmp=t.VBU({type:r,selectors:[["trials-per-month"]],inputs:{monthsToDisplay:"monthsToDisplay"},standalone:!1,decls:6,vars:5,consts:[[1,"text-sm","text-purple-dark"],[1,"text-3xl","font-bold","leading-10","text-black"],[3,"type","data$"]],template:function(n,o){1&n&&(t.j41(0,"p",0),t.EFF(1,"Trials per month"),t.k0s(),t.j41(2,"p",1),t.EFF(3),t.nI1(4,"number"),t.k0s(),t.nrm(5,"ui-chart",2)),2&n&&(t.R7$(3),t.JRh(t.bMT(4,3,o.total||0)),t.R7$(2),t.Y8G("type","bar")("data$",o.chartData$))},dependencies:[k.Q,u.QX],encapsulation:2})}return r})(),gt=(()=>
1{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=t.VBU({type:r,selectors:[["business-kpi"]],standalone:!1,decls:8,vars:4,consts:[[3,"title"],[3,"cols"]],template:function(n,o){1&n&&(t.nrm(0,"ui-page-header",0),t.j41(1,"ui-tiles")(2,"ui-tile",1),t.nrm(3,"trials-per-day"),t.k0s(),t.j41(4,"ui-tile",1),t.nrm(5,"trials-per-week"),t.k0s(),t.j41(6,"ui-tile",1),t.nrm(7,"trials-per-month"),t.k0s()()),2&n&&(t.Y8G("title","KPIs"),t.R7$(2),t.Y8G("cols",4),t.R7$(2),t.Y8G("cols",4),t.R7$(2),t.Y8G("cols",4))},dependencies:[R.y,w.m,D.z,G,pt,ut],encapsulation:2})}return r})();var mt=s(83e3),bt=s(54654),ft=s(94354),ht=s(74204),yt=s(98728),A=s(79018),S=s(28460);const I=r=>["/admin/agencies",r];function vt(r,p){if(1&r&&(t.j41(0,"div",13)(1,"strong"),t.EFF(2,"Selected:"),t.k0s(),t.EFF(3),t.k0s()),2&r){const e=t.XpG();t.R7$(3),t.JRh(e.formattedDateRange)}}function kt(r,p){if(1&r&&(t.j41(0,"ui-tile",14)(1,"p",15),t.EFF(2,"Info"),t.k0s(),t.j41(3,"table",16)(4,"tr",16)(5,"td",17),t.EFF(6,"Adjusted MRR"),t.k0s(),t.j41(7,"td",18),t.EFF(8),t.nI1(9,"currency"),t.k0s()(),t.j41(10,"tr",16)(11,"td",17),t.EFF(12,"MRR"),t.k0s(),t.j41(13,"td",18),t.EFF(14),t.nI1(15,"currency"),t.k0s()(),t.j41(16,"tr",16)(17,"td",17),t.EFF(18,"ARR"),t.k0s(),t.j41(19,"td",18),t.EFF(20),t.nI1(21,"currency"),t.k0s()(),t.j41(22,"tr",16)(23,"td",17),t.EFF(24,"Total clients"),t.k0s(),t.j41(25,"td",18),t.EFF(26),t.nI1(27,"number"),t.k0s()()()()),2&r){const e=t.XpG();t.R7$(8),t.JRh(t.bMT(9,4,(e.generalInfo.arr/12+e.generalInfo.mrr)/100)),t.R7$(6),t.JRh(t.bMT(15,6,e.generalInfo.mrr/100)),t.R7$(6),t.JRh(t.bMT(21,8,e.generalInfo.arr/100)),t.R7$(6),t.JRh(t.bMT(27,10,e.generalInfo.clients))}}function Mt(r,p){if(1&r&&(t.j41(0,"div",24)(1,"div",25),t.nrm(2,"ui-icon",26),t.EFF(3),t.k0s(),t.j41(4,"div",27)(5,"span",28),t.EFF(6),t.k0s(),t.j41(7,"span",29),t.EFF(8,"\u2022"),t.k0s(),t.j41(9,"span",30),t.EFF(10),t.k0s(),t.j41(11,"span",30),t.EFF(12),t.nI1(13,"currency"),t.k0s()()()),2&r){const e=p.$implicit,n=p.index,o=t.XpG(3);t.xc7("animation-delay",50*n,"ms"),t.Y8G("ngClass",o.getRefererColor(n))("title",o.getRefererTooltip(e)),t.R7$(2),t.Aen(o.getRefererIcon(e.referer).style),t.Y8G("name",o.getRefererIcon(e.referer).name)("size","xs"),t.R7$(),t.JRh(e.referer),t.R7$(3),t.JRh(e.count),t.R7$(4),t.SpI("",e.percentage,"%"),t.R7$(2),t.SpI("(",t.bMT(13,12,e.activeMrr),")")}}function _t(r,p){if(1&r&&(t.j41(0,"div",22),t.DNE(1,Mt,14,14,"div",23),t.k0s()),2&r){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.getClientRefererStats())}}function Ct(r,p){if(1&r&&(t.j41(0,"div",8)(1,"div",19)(2,"span",20),t.EFF(3),t.k0s()(),t.DNE(4,_t,2,1,"div",21),t.k0s()),2&r){const e=t.XpG();t.R7$(3),t.SpI("",e.getClientCount()," entries"),t.R7$(),t.Y8G("ngIf",e.getClientRefererStats().length>0)}}function Ft(r,p){if(1&r&&(t.j41(0,"div",40),t.EFF(1),t.nI1(2,"currency"),t.k0s()),2&r){const e=t.XpG().$implicit;t.R7$(),t.JRh(t.bMT(2,1,e.activeMrr))}}function xt(r,p){1&r&&(t.j41(0,"div",40),t.EFF(1,"$0.00"),t.k0s())}function Rt(r,p){if(1&r&&(t.j41(0,"tr",36)(1,"td",37)(2,"a",38),t.nrm(3,"ui-debug-info",39),t.k0s()(),t.j41(4,"td",37)(5,"div",40),t.EFF(6),t.k0s()(),t.j41(7,"td",37)(8,"div",40),t.EFF(9),t.k0s()(),t.j41(10,"td",37)(11,"div",40),t.EFF(12),t.k0s()(),t.j41(13,"td",37)(14,"div",41),t.EFF(15),t.k0s()(),t.j41(16,"td",37),t.DNE(17,Ft,3,3,"div",42)(18,xt,2,0,"div",42),t.k0s(),t.j41(19,"td",37)(20,"div",40),t.EFF(21),t.nI1(22,"currency"),t.k0s()(),t.j41(23,"td",37)(24,"div",40),t.EFF(25),t.k0s()(),t.j41(26,"td",37)(27,"div",40),t.EFF(28),t.k0s()(),t.j41(29,"td",37)(30,"div",40),t.EFF(31),t.k0s()(),t.j41(32,"td",37)(33,"div",40),t.EFF(34),t.k0s()(),t.j41(35,"td",37)(36,"div",40),t.EFF(37),t.k0s()(),t.j41(38,"td",37)(39,"div",40),t.EFF(40),t.k0s()()()),2&r){const e=p.$implicit,n=t.XpG(3);t.R7$(2),t.Y8G("routerLink",t.eq3(26,I,e.id))("title","Navigate to agency"),t.R7$(),t.Aen("primary"),t.Y8G("id","Agency "+(e.id||""))("clipboardText","agency = Agency.find("+e.id+")")("icon","building")("iconStyle","regular"),t.R7$(3),t.JRh(e.name),t.R7$(3),t.JRh(e.domain),t.R7$(3),t.JRh(e.referer),t.R7$(2),t.Y8G("title",e.refererExtra||""),t.BMQ("data-bs-toggle",e.refererExtra&&e.refererExtra.length>70?"tooltip":null)("data-bs-placement","top"),t.R7$(),t.JRh(n.truncateText(e.refererExtra,70)),t.R7$(2),t.Y8G("ngIf",n.activeMrr),t.R7$(),t.Y8G("ngIf",n.activeMrr),t.R7$(3),t.JRh(t.bMT(22,24,(e.totalRevenues-e.totalRefunds)/100)),t.R7$(4),t.JRh(n.getRelativeTime(e)),t.R7$(3),t.JRh(n.getActiveDays(e.id)),t.R7$(3),t.JRh(e.adminName),t.R7$(3),t.JRh(e.adminEmail),t.R7$(3),t.JRh(e.skill),t.R7$(3),t.JRh(n.formatCreatedAt(e.createdAt))}}function wt(r,p){if(1&r&&t.DNE(0,Rt,41,28,"tr",35),2&r){const e=t.XpG(2);
1t.Y8G("ngForOf",e.support.bizMetrics.clients)}}function Dt(r,p){1&r&&(t.j41(0,"ui-table",31),t.qex(1,32),t.j41(2,"tr")(3,"th",33),t.EFF(4,"Agency"),t.k0s(),t.j41(5,"th",33),t.EFF(6,"Name"),t.k0s(),t.j41(7,"th",33),t.EFF(8,"Domain"),t.k0s(),t.j41(9,"th",33),t.EFF(10,"Referer"),t.k0s(),t.j41(11,"th",33),t.EFF(12,"Extra"),t.k0s(),t.j41(13,"th",33),t.EFF(14,"MRR"),t.k0s(),t.j41(15,"th",33),t.EFF(16,"Revenues"),t.k0s(),t.j41(17,"th",33),t.EFF(18,"Conversion"),t.k0s(),t.j41(19,"th",33),t.EFF(20,"Active days"),t.k0s(),t.j41(21,"th",33),t.EFF(22,"Admin Name"),t.k0s(),t.j41(23,"th",33),t.EFF(24,"Admin Email"),t.k0s(),t.j41(25,"th",33),t.EFF(26,"Skill"),t.k0s(),t.j41(27,"th",33),t.EFF(28,"Created At"),t.k0s()(),t.bVm(),t.DNE(29,wt,1,1,"ng-template",34),t.k0s()),2&r&&t.Y8G("title","Clients")("total",10)}function Pt(r,p){if(1&r&&(t.j41(0,"div",24)(1,"div",25),t.nrm(2,"ui-icon",26),t.EFF(3),t.k0s(),t.j41(4,"div",27)(5,"span",28),t.EFF(6),t.k0s(),t.j41(7,"span",29),t.EFF(8,"\u2022"),t.k0s(),t.j41(9,"span",30),t.EFF(10),t.k0s()()()),2&r){const e=p.$implicit,n=p.index,o=t.XpG(3);t.xc7("animation-delay",50*n,"ms"),t.Y8G("ngClass",o.getRefererColor(n))("title",o.getRefererTooltip(e)),t.R7$(2),t.Aen(o.getRefererIcon(e.referer).style),t.Y8G("name",o.getRefererIcon(e.referer).name)("size","xs"),t.R7$(),t.JRh(e.referer),t.R7$(3),t.JRh(e.count),t.R7$(4),t.SpI("",e.percentage,"%")}}function Tt(r,p){if(1&r&&(t.j41(0,"div",22),t.DNE(1,Pt,11,11,"div",23),t.k0s()),2&r){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.getTrialRefererStats())}}function jt(r,p){if(1&r&&(t.j41(0,"div",43)(1,"div",19)(2,"span",20),t.EFF(3),t.k0s()(),t.DNE(4,Tt,2,1,"div",21),t.k0s()),2&r){const e=t.XpG();t.R7$(3),t.SpI("",e.getTrialCount()," entries"),t.R7$(),t.Y8G("ngIf",e.getTrialRefererStats().length>0)}}function $t(r,p){if(1&r&&(t.j41(0,"tr",36)(1,"td",37)(2,"a",38),t.nrm(3,"ui-debug-info",39),t.k0s()(),t.j41(4,"td",37)(5,"div",40),t.EFF(6),t.k0s()(),t.j41(7,"td",37)(8,"div",40),t.EFF(9),t.k0s()(),t.j41(10,"td",37)(11,"div",40),t.EFF(12),t.k0s()(),t.j41(13,"td",37)(14,"div",41),t.EFF(15),t.k0s()(),t.j41(16,"td",37)(17,"div",40),t.EFF(18),t.k0s()(),t.j41(19,"td",37)(20,"div",40),t.EFF(21),t.k0s()(),t.j41(22,"td",37)(23,"div",40),t.EFF(24),t.k0s()(),t.j41(25,"td",37)(26,"div",40),t.EFF(27),t.k0s()(),t.j41(28,"td",37)(29,"div",40),t.EFF(30),t.k0s()()()),2&r){const e=p.$implicit,n=t.XpG(3);t.R7$(2),t.Y8G("routerLink",t.eq3(20,I,e.id))("title","Navigate to agency"),t.R7$(),t.Aen("primary"),t.Y8G("id","Agency "+(e.id||""))("clipboardText","agency = Agency.find("+e.id+")")("icon","building")("iconStyle","regular"),t.R7$(3),t.JRh(e.name),t.R7$(3),t.JRh(e.domain),t.R7$(3),t.JRh(e.referer),t.R7$(2),t.Y8G("title",e.refererExtra||""),t.BMQ("data-bs-toggle",e.refererExtra&&e.refererExtra.length>70?"tooltip":null)("data-bs-placement","top"),t.R7$(),t.JRh(n.truncateText(e.refererExtra,70)),t.R7$(3),t.JRh(n.getActiveDays(e.id)),t.R7$(3),t.JRh(e.adminName),t.R7$(3),t.JRh(e.adminEmail),t.R7$(3),t.JRh(e.skill),t.R7$(3),t.JRh(n.formatCreatedAt(e.createdAt))}}function Ot(r,p){if(1&r&&t.DNE(0,$t,31,22,"tr",35),2&r){const e=t.XpG(2);t.Y8G("ngForOf",e.support.bizMetrics.trials)}}function Et(r,p){1&r&&(t.j41(0,"ui-table",31),t.qex(1,32),t.j41(2,"tr")(3,"th",33),t.EFF(4,"Agency"),t.k0s(),t.j41(5,"th",33),t.EFF(6,"Name"),t.k0s(),t.j41(7,"th",33),t.EFF(8,"Domain"),t.k0s(),t.j41(9,"th",33),t.EFF(10,"Referer"),t.k0s(),t.j41(11,"th",33),t.EFF(12,"Extra"),t.k0s(),t.j41(13,"th",33),t.EFF(14,"Active days"),t.k0s(),t.j41(15,"th",33),t.EFF(16,"Admin Name"),t.k0s(),t.j41(17,"th",33),t.EFF(18,"Admin Email"),t.k0s(),t.j41(19,"th",33),t.EFF(20,"Skill"),t.k0s(),t.j41(21,"th",33),t.EFF(22,"Created At"),t.k0s()(),t.bVm(),t.DNE(23,Ot,1,1,"ng-template",34),t.k0s()),2&r&&t.Y8G("title","Trials")("total",10)}const At=h.iI.forChild([{path:"",component:K,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",component:dt},{path:"kpi",component:gt},{path:"money",component:(()=>{class r{businessService;supportService;router;daysToDisplay=180;total;chartData$;generalInfo=null;subRev;subActivity;startDate;endDate=(0,d.GP)(new Date,"yyyy-MM-dd");support;orgActivities=null;from=null;to=null;sub;orgEvents={};aggregatedClientStats;aggregatedTrialStats;bsRangeValue;maxDate=new Date;bsConfig={containerClass:"theme-purple",isAnimated:!0,dateInputFormat:"YYYY-MM-DD",returnFocusToInput:!0,showWeekNumbers:!1,rangeInputFormat:"YYYY-MM-DD",displayOneMonthRange:!0};constructor(e,n,o){this.businessService=e,this.supportService=n,this.router=o}ngOnInit(){this.subRev=this.supportService.revenues().subscribe(o=>{this.generalInfo=o});const e=new Date(Date.now()-2592e6),n=new Date;this.bsRangeValue=[e,n],this.onValueChange(e,n)}ngOnDestroy(){this.subRev&&this.subRev.unsubscribe(),this.subActivity&&this.subActivity.unsubscribe()}onValueChange(e,n){let o=e,a=n,i=Math.floor(new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate())).valueOf()/1e3),c=Math.floor(new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate())).valueOf()/1e3);this.support=null,this.from=i,this.to=c,this.orgEvents={},this.sub=this.supportService.business(i,c).subscribe(g=>{this.support=g,this.total=0,this.total=this.total+this.support.bizMetrics.newSubscriptionAmount,this.total=this.total+this.support.bizMetrics.expansionAccountAmount,this.total=this.total+this.support.bizMetrics.expansionInboxAmount,this.total=this.total-this.support.bizMetrics.contractionAccountAmount,this.total=this.total-this.support.bizMetrics.contractionInboxAmount,this.total=this.total-this.support.bizMetrics.cancellationAmount,this.total=this.total-this.support.bizMetrics.pastDueAmount,this.total=this.total-this.support.bizMetrics.delinquentAmount,this.total=this.total-this.support.bizMetrics.paymentFailedAmount,this.total=this.total-this.support.bizMetrics.refundAmount,this.total=this.total+this.support.bizMetrics.reactivationAmount,this.total=this.total-this.support.bizMetrics.disputeAmount,this.aggregatedClientStats=this.getRefererStats(this.support.bizMetrics.clients||[]),this.aggregatedTrialStats=this.getRefererStats(this.support.bizMetrics.trials||[])}),this.subActivity=this.supportService.orgActivities(i,c).subscribe(g=>{this.orgActivities=g.orgActivityData})}getRelativeTime(e){return null==e.convertedAt?"":(0,mt.B)(e.createdAt,e.convertedAt)}getAuditsCount(e){if(this.orgActivities&&this.orgActivities[e])return this.orgActivities[e].audits_count}getActiveDays(e){if(this.orgActivities&&this.orgActivities[e])return this.orgActivities[e].active_days}getDistributionData(e){if(this.orgActivities&&this.orgActivities[e])return this.orgActivities[e].distribution_data}getStyle(e,n){return this.orgActivities&&this.orgActivities[e]?{height:100*n/this.orgActivities[e].max_daily_audits+"
1%"}:{}}trackByDocumentId(e,n){return n.id}exportToCSV(){if(!this.support)return void console.warn("No data available for export");const i=[["Type","Agency ID","Name","Domain","Referer","Referer Extra","MRR","Revenues","Conversion Time","Active Days","Admin name","Admin email","Skill","Created At"],...(this.support.bizMetrics.clients||[]).map(l=>["Client",l.id||"",l.name||"",l.domain||"",l.referer||"",l.refererExtra||"",l.activeMrr?(l.activeMrr/100).toFixed(2):"0.00",((l.totalRevenues-l.totalRefunds)/100).toFixed(2),this.getRelativeTime(l),this.getActiveDays(l.id)||"",l.adminName||"",l.adminEmail||"",l.skill||"",this.formatCreatedAt(l.createdAt)]),...(this.support.bizMetrics.trials||[]).map(l=>["Trial",l.id||"",l.name||"",l.domain||"",l.referer||"",l.refererExtra||"","","","",this.getActiveDays(l.id)||"",l.adminName||"",l.adminEmail||"",l.skill||"",this.formatCreatedAt(l.createdAt)])].map(l=>l.map(F=>"string"==typeof F&&F.includes(",")?`"${F.replace(/"/g,'""')}"`:F).join(",")).join("\n"),c=(0,d.GP)(this.bsRangeValue[0],"yyyy-MM-dd"),g=(0,d.GP)(this.bsRangeValue[1],"yyyy-MM-dd"),C=new File([i],`business-money-export-${c}-to-${g}.csv`,{type:"text/csv"}),M=document.createElement("a"),Y=URL.createObjectURL(C);M.href=Y,M.download=C.name,document.body.appendChild(M),M.click(),document.body.removeChild(M),window.URL.revokeObjectURL(Y)}get dateRangeTitle(){return this.bsRangeValue&&2===this.bsRangeValue.length?`Money - ${(0,d.GP)(this.bsRangeValue[0],"MMM dd, yyyy")} to ${(0,d.GP)(this.bsRangeValue[1],"MMM dd, yyyy")}`:"Money"}get formattedDateRange(){return this.bsRangeValue&&2===this.bsRangeValue.length?`${(0,d.GP)(this.bsRangeValue[0],"MMM dd, yyyy")} - ${(0,d.GP)(this.bsRangeValue[1],"MMM dd, yyyy")}`:""}truncateText(e,n=70){return!e||e.length<=n?e||"":e.substring(0,n)+"\u2026"}formatCreatedAt(e){if(!e)return"";try{return(0,d.GP)(new Date(e),"MMM dd, yyyy")}catch{return e}}getClientCount(){return this.support?.bizMetrics?.clients?.length||0}getTrialCount(){return this.support?.bizMetrics?.trials?.length||0}navigateToAgency(e,n){n.preventDefault(),n.stopPropagation(),e&&this.router.navigate(["/admin/agencies",e])}getRefererStats(e){if(!e||0===e.length)return[];const n=e.reduce((i,c)=>{const g=c.referer||"Unknown";return i[g]=i[g]||{},i[g].count=(i[g].count||0)+1,i[g].activeMrr=(i[g].activeMrr||0)+c.activeMrr,i},{}),o=e.length,a=Object.entries(n).map(([i,c])=>({referer:i,count:c.count,percentage:Math.round(c.count/o*100),activeMrr:c.activeMrr})).sort((i,c)=>c.count-i.count);if(a.length>7){const i=a.slice(0,7),c=a.slice(7).reduce((T,C)=>T+C.count,0),g=Math.round(c/o*100);return c>0&&i.push({referer:"Others",count:c,percentage:g,activeMrr:0}),i}return a}getClientRefererStats(){return this.aggregatedClientStats}getTrialRefererStats(){return this.aggregatedTrialStats}getRefererColor(e){const n=["bg-purple-100 text-purple-700 border-purple-300","bg-blue-100 text-blue-700 border-blue-300","bg-green-100 text-green-700 border-green-300","bg-yellow-100 text-yellow-700 border-yellow-300","bg-pink-100 text-pink-700 border-pink-300","bg-indigo-100 text-indigo-700 border-indigo-300","bg-red-100 text-red-700 border-red-300","bg-gray-100 text-gray-700 border-gray-300"];return n[e%n.length]}getRefererTooltip(e){return`${e.count} organizations from ${e.referer}`}getRefererIcon(e){const n=e.toLowerCase();return n.includes("google")?{name:"google",style:"brand"}:n.includes("facebook")||n.includes("fb")?{name:"facebook",style:"brand"}:n.includes("linkedin")?{name:"linkedin",style:"brand"}:n.includes("twitter")||n.includes("x.com")?{name:"twitter",style:"brand"}:n.includes("youtube")?{name:"youtube",style:"brand"}:n.includes("instagram")?{name:"instagram",style:"brand"}:n.includes("direct")||"unknown"===n?{name:"link",style:"solid"}:"others"===n?{name:"ellipsis",style:"solid"}:{name:"globe",style:"solid"}}static \u0275fac=function(n){return new(n||r)(t.rXU(b.u),t.rXU(bt.x),t.rXU(_.Ix))};static \u0275cmp=t.VBU({type:r,selectors:[["business-money"]],inputs:{daysToDisplay:"daysToDisplay"},standalone:!1,decls:16,vars:12,consts:[[3,"title"],["actions",""],[3,"click","title","icon"],[1,"page-container"],[1,"date-picker-sidebar"],[3,"bsValueChange","bsValue","bsConfig","maxDate"],["class","date-range-display",4,"ngIf"],[1,"main-content"],[1,"mb-4"],["cols","4",4,"ngIf"],["class","mb-4",4,"ngIf"],[3,"title","total",4,"ngIf"],["class","mb-4 mt-4",4,"ngIf"],[1,"date-range-display"],["cols","4"],[1,"text-sm","text-purple-dark"],[1,"info"],[1,"font-bold"],["align","right"],[1,"mb-2"],[1,"text-sm","text-gray-600"],["class","referer-stats flex flex-wrap gap-2",4,"ngIf"],[1,"referer-stats","flex","flex-wrap","gap-2"],["class","referer-box",3,"ngClass","title","animation-delay",4,"ngFor","ngForOf"],[1,"referer-box",3,"ngClass","title"],[1,"referer-name"],[1,"mr-1",3,"name","size"],[1,"referer-numbers"],[1,"referer-count"],[1,"referer-divider"],[1,"referer-percentage"],[3,"title","total"],["header",""],["cell",""],["body",""],["class","link-container","row","",4,"ngFor","ngForOf"],["row","",1,"link-container"],["cell","","align","middle"],[1,"inline-block","no-underline",3,"routerLink","title"],[1,"relative",3,"id","clipboardText","icon","iconStyle"],[1,"text-sm"],[1,"text-sm",3,"title"],["class","text-sm",4,"ngIf"],[1,"mb-4","mt-4"]],template:function(n,o){1&n&&(t.j41(0,"ui-page-header",0),t.qex(1,1),t.j41(2,"ui-button",2),t.bIt("click",function(){return o.exportToCSV()}),t.k0s(),t.bVm(),t.k0s(),t.j41(3,"div",3)(4,"div",4)(5,"h3"),t.EFF(6,"Date Range"),t.k0s(),t.j41(7,"bs-daterangepicker-inline",5),t.bIt("bsValueChange",function(i){return o.onValueChange(i[0],i[1])}),t.k0s(),t.DNE(8,vt,4,1,"div",6),t.k0s(),t.j41(9,"div",7)(10,"ui-tiles",8),t.DNE(11,kt,28,12,"ui-tile",9),t.k0s(),t.DNE(12,Ct,5,2,"div",10)(13,Dt,30,2,"ui-table",11)(14,jt,5,2,"div",12)(15,Et,24,2,"ui-table",11),t.k0s()()),2&n&&(t.Y8G("title",o.dateRangeTitle),t.R7$(2),t.Y8G("title","Download")("icon","download"),t.R7$(5),t.Y8G("bsValue",o.bsRangeValue)("bsConfig",o.bsConfig)("maxDate",o.maxDate),t.R7$(),t.Y8G("ngIf",o.formattedDateRange),t.R7$(3),t.Y8G("ngIf",o.generalInfo),t.R7$(),t.Y8G("ngIf",o.support),t.R7$(),t.Y8G("ngIf",o.support),t.R7$(),t.Y8G("ngIf",o.support),t.R7$(),t.Y8G("ngIf",o.support))},dependencies:[u.YU,u.Sq,u.bT,x.Q,ft.J,$.R,R.y,ht.Q,yt.Y,A.O,A._,w.m,D.z,h.Wk,S.zT,u.QX,u.oe],styles:["table.info[_ngcontent-%COMP%]{width:100%}tr.info[_ngcontent-%COMP%]{height:2.5rem;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));font-size:.8125rem}.page-container[_ngcontent-%COMP%]{display:flex;gap:1rem}.date-picker-sidebar[_ngcontent-%COMP%]{width:16rem;flex-shrink:0;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem}.date-picker-sidebar[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.main-content[_ngcontent-%COMP%]{flex:1 1 0%}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-container{box-shadow:none}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-head{background-color:#7c3aed;color:#fff}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td.week span{color:#4b5563}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td span.selected, .date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td.selected span, .date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td span.is-highlighted, .date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td.is-highlighted span{background-color:#7c3aed;color:#fff;border-radius:4px}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td.in-range:not(.selected), .date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td span.in-range:not(.selected){background-color:#ede9fe;color:#5b21b6}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td.in-range:before{background-color:#ede9fe}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td span:hover{background-color:#ddd6fe;color:#5b21b6}.date-picker-sidebar[_ngcontent-%COMP%] .bs-datepicker-body table td.is-other-month span{color:#9ca3af}.date-range-display[_ngcontent-%COMP%]{margin-top:1rem;padding:.75rem;background-color:#f9fafb;border-radius:.25rem;font-size:.875rem}.date-range-display[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#374151;font-weight:600}a.no-underline[_ngcontent-%COMP%], a.no-underline[_ngcontent-%COMP%]:hover{text-decoration:none}.referer-stats[_ngcontent-%COMP%]{margin-bottom:.75rem;display:flex;flex-wrap:wrap;gap:.5rem}.referer-box[_ngcontent-%COMP%]{display:flex;cursor:default;align-items:center;gap:.75rem;border-radius:.5rem;border-width:2px;padding:.5rem .75rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.referer-box[_ngcontent-%COMP%]:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
1--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.referer-box[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeInScale .3s ease-out}@keyframes _ngcontent-%COMP%_fadeInScale{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.referer-name[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:.75rem;font-weight:500}.referer-name[_ngcontent-%COMP%] ui-icon[_ngcontent-%COMP%]{opacity:.6}.referer-numbers[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.8125rem}.referer-count[_ngcontent-%COMP%]{font-weight:700}.referer-divider[_ngcontent-%COMP%]{font-size:.75rem;opacity:.4}.referer-percentage[_ngcontent-%COMP%]{opacity:.75}.bg-purple-100[_ngcontent-%COMP%]{background-color:#f3e8ff}.text-purple-700[_ngcontent-%COMP%]{color:#6b21a8}.border-purple-300[_ngcontent-%COMP%]{border-color:#d8b4fe}.bg-blue-100[_ngcontent-%COMP%]{background-color:#dbeafe}.text-blue-700[_ngcontent-%COMP%]{color:#1d4ed8}.border-blue-300[_ngcontent-%COMP%]{border-color:#93c5fd}.bg-green-100[_ngcontent-%COMP%]{background-color:#d1fae5}.text-green-700[_ngcontent-%COMP%]{color:#15803d}.border-green-300[_ngcontent-%COMP%]{border-color:#86efac}.bg-yellow-100[_ngcontent-%COMP%]{background-color:#fef3c7}.text-yellow-700[_ngcontent-%COMP%]{color:#a16207}.border-yellow-300[_ngcontent-%COMP%]{border-color:#fcd34d}.bg-pink-100[_ngcontent-%COMP%]{background-color:#fce7f3}.text-pink-700[_ngcontent-%COMP%]{color:#be185d}.border-pink-300[_ngcontent-%COMP%]{border-color:#f9a8d4}.bg-indigo-100[_ngcontent-%COMP%]{background-color:#e0e7ff}.text-indigo-700[_ngcontent-%COMP%]{color:#4338ca}.border-indigo-300[_ngcontent-%COMP%]{border-color:#a5b4fc}.bg-red-100[_ngcontent-%COMP%]{background-color:#fee2e2}.text-red-700[_ngcontent-%COMP%]{color:#b91c1c}.border-red-300[_ngcontent-%COMP%]{border-color:#fca5a5}.bg-gray-100[_ngcontent-%COMP%]{background-color:#f3f4f6}.text-gray-700[_ngcontent-%COMP%]{color:#374151}.border-gray-300[_ngcontent-%COMP%]{border-color:#d1d5db}"]})}return r})()}]}]);var P=s(89347),St=s(71036);let It=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=t.$C({type:r});static \u0275inj=m.G2t({imports:[u.MD,P.F,St.Q]})}return r})(),Yt=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=t.$C({type:r});static \u0275inj=m.G2t({imports:[u.MD,h.iI,P.F]})}return r})(),Bt=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=t.$C({type:r});static \u0275inj=m.G2t({imports:[u.MD,P.F,h.iI,Yt,It,f.YN,f.X1,S.YN.forRoot(),At]})}return r})()}}]);
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.