1import{a as Xl}from"./chunk-YFG23DWD.js";import{a as Al}from"./chunk-U3257QJK.js";import{d as Ul,e as Ql,f as ql,i as wa,j as Ho,k as jo,l as Kl,m as Zl,n as Aa,o as ec,s as tc}from"./chunk-MLK7OJUN.js";import{a as ka}from"./chunk-BOKWOCEG.js";import{a as Jl}from"./chunk-X7L44UIA.js";import"./chunk-56P23O63.js";import{Da as ya,Ea as Vl,F as Ll,G as Pl,Ga as Rl,Ka as Nl,S as xa,T as va,Ya as zl,fb as Yl,jb as zo,kb as $l,nb as Ta,pb as Sa,s as wl}from"./chunk-XM5NCJXQ.js";import{h as Gl,m as Hl,v as jl}from"./chunk-SA2BEY37.js";import{b as oe,c as R}from"./chunk-IKWRQ4GC.js";import"./chunk-5XBU4W6K.js";import"./chunk-AWGSOQ5J.js";import"./chunk-64DHE6O6.js";import"./chunk-QVRKFDXD.js";import"./chunk-MQDCJZE3.js";import{E as Ml,F as Ol,H as Fl,L as Bl,O as tt,f as mt,k as ha,l as ua,m as ga,n as fa,q as El,r as kt,t as _a}from"./chunk-DQAAUNNE.js";import"./chunk-MABY7COI.js";import"./chunk-JXHHNFK4.js";import{a as Ca}from"./chunk-ZZHFAEJE.js";import{a as zi,e as pt}from"./chunk-O5EJJVHH.js";import"./chunk-VON5DLH6.js";import"./chunk-DMB4Z5T6.js";import{e as ba}from"./chunk-VZTWP2YM.js";import"./chunk-YEMXMR2O.js";import"./chunk-7C5JE7JZ.js";import"./chunk-EQBSRMKC.js";import{a as Dl}from"./chunk-J5NRK73A.js";import"./chunk-SPFKRAIK.js";import{a as kl}from"./chunk-HUERJLW6.js";import"./chunk-K7GGQVIK.js";import{a as ma}from"./chunk-X3CMEPIE.js";import{a as Wl}from"./chunk-PGS3JRWZ.js";import"./chunk-MEJZISAX.js";import{a as At}from"./chunk-JGFUTTST.js";import"./chunk-BQSYM23H.js";import{a as Hi}from"./chunk-UJLMMLUM.js";import"./chunk-5CRQFKDA.js";import"./chunk-EKQL4IFR.js";import"./chunk-JG3VZZY4.js";import"./chunk-WJY6HROL.js";import{b as Il}from"./chunk-2GHFED2S.js";import"./chunk-WCL72VCC.js";import"./chunk-BYXBJQAS.js";import"./chunk-7AAUCWQR.js";import"./chunk-FZ3BTEDS.js";import"./chunk-MNIMTV6A.js";import"./chunk-TEIN3CJU.js";import{b as Jt}from"./chunk-4TJQHVPV.js";import"./chunk-XGHI7KS5.js";import"./chunk-SM2ZZ44M.js";import"./chunk-DHGPBOST.js";import{a as Sl}from"./chunk-7O5KE4XQ.js";import"./chunk-QFG6BXC7.js";import{a as gl,b as Tl}from"./chunk-3ITR3TRQ.js";import"./chunk-E3ODSFG7.js";import"./chunk-D4DYXVUU.js";import"./chunk-Q2KUA2HM.js";import"./chunk-JPOZLFY4.js";import"./chunk-LNP67U4I.js";import"./chunk-GX4UVFWP.js";import"./chunk-KH4MM3R3.js";import"./chunk-BVCJYP5M.js";import"./chunk-HJIP32AF.js";import"./chunk-45XUUWBS.js";import"./chunk-JK6VBQRQ.js";import"./chunk-UR7B3SVE.js";import"./chunk-ZOXOJ2SW.js";import"./chunk-75FPLXLX.js";import{i as xl,k as vl,q as yl}from"./chunk-AQBRTEMP.js";import"./chunk-GCZ3C3HM.js";import"./chunk-QGUVMJOM.js";import"./chunk-G4IDWB6G.js";import"./chunk-N5NDHDLL.js";import"./chunk-VNEWJX7J.js";import{a as Cl}from"./chunk-MQLXRJLY.js";import"./chunk-UWTSORKH.js";import"./chunk-BCD2KHGG.js";import"./chunk-XMQL2ZPB.js";import"./chunk-YQ2HBBL5.js";import"./chunk-4M3H6OJK.js";import"./chunk-2NWUFIXC.js";import"./chunk-KADQP2XK.js";import"./chunk-ECMF7CC2.js";import"./chunk-C4XHNRNH.js";import"./chunk-ZTBOUZVQ.js";import{a as Pe,b as Ee}from"./chunk-Z36TISWV.js";import"./chunk-V5JHT2G4.js";import{a as _l,b as bl}from"./chunk-XM23J7BA.js";import{c as hl,d as ul}from"./chunk-WH6ILIPS.js";import{a as fl}from"./chunk-LKIIPTIG.js";import{B as qs,S as pa,V as pl,f as ra,g as Us}from"./chunk-SRUBCUSW.js";import{d as dl}from"./chunk-52TU3IL6.js";import{c as Js,ga as Zt}from"./chunk-TDIWFVPA.js";import{b as sa}from"./chunk-MN2F2UI2.js";import{H as rl,J as dn,K as sl,O as ll,V as pn,Z as wt,e as cn}from"./chunk-LJV7ZYHU.js";import{D as al,E as Gi,G as Vo,e as xi,h as el,m as il,r as nl,s as ft}from"./chunk-25QDB3SE.js";import{a as Ks,f as la,g as ol,h as vi,i as cl}from"./chunk-KJ3PV2LN.js";import{a as da}from"./chunk-35M7AFQZ.js";import{a as Se,b as Bo,d as tl}from"./chunk-HCVRNL4G.js";import"./chunk-INMDLS22.js";import"./chunk-AJZMXFMA.js";import{z as Kt}from"./chunk-YE7HTOLI.js";import{a as Zs}from"./chunk-NZ4I6U2Z.js";import"./chunk-23N7CA4O.js";import"./chunk-YI7ZQONV.js";import"./chunk-54IZQ3MU.js";import"./chunk-QUO3WGUK.js";import"./chunk-GZLC4DDF.js";import"./chunk-74YMZKOK.js";import{a as Xs}from"./chunk-6IH4M65S.js";import"./chunk-NGAT3XSV.js";import{a as Te}from"./chunk-6DMACB4X.js";import{a as ca}from"./chunk-SXLHBEO2.js";import"./chunk-IUPWKUGB.js";import"./chunk-C5J3HTKX.js";import{a as Qs}from"./chunk-56FUNJ2L.js";import"./chunk-KORPXNVS.js";import{c as Ro,d as No,f as mn,h as Go}from"./chunk-W4BNGQYG.js";import{a as ml}from"./chunk-OSVOK6WL.js";import"./chunk-WXXKR7LF.js";import"./chunk-R2NO6V5K.js";import{a as ia}from"./chunk-FV2Q4OA6.js";import{l as Ws}from"./chunk-QPZCEWML.js";import"./chunk-L44SDTPC.js";import{f as Ni}from"./chunk-CLQP3QCS.js";import{b as Ys,e as qt}from"./chunk-TWVMK4TV.js";import{a as $s}from"./chunk-EGNI2XJ3.js";import{a as dt}from"./chunk-A3N634GV.js";import"./chunk-F457L6VT.js";import"./chunk-6BC3ZOBR.js";import{Aa as Le,Ba as Ye,Ca as Hs,D as zs,Fa as ln,P as Tt,V as De,a as _e,c as Vi,s as Fs,w as Ct}from"./chunk-4U4PLY73.js";import"./chunk-RQ4F2COW.js";import"./chunk-7RWCIHFI.js";import{a as xe}from"./chunk-GP7G4HVV.js";import{a as na}from"./chunk-X5ROTD3U.js";import{a as ae}from"./chunk-V4NS6LW3.js";import"./chunk-VFTYDXHH.js";import"./chunk-LJSWAOQY.js";import{a as Ls}from"./chunk-RFPVTC6I.js";import{b as ta}from"./chunk-SPFBMSSO.js";import{b as q}from"./chunk-TZOYHBJT.js";import{b as oa,d as St,e as He,f as js}from"./chunk-34KEMFZC.js";import{d as aa,g as et,h as Ns,j,k as re}from"./chunk-4BUGZAA4.js";import{a as Vs,d as Rs}from"./chunk-3TCRHIAB.js";import{Q as Bs,p as Ri}from"./chunk-76JNFTGE.js";import{$ as us,$b as Zn,A as hi,Ca as je,Da as gs,Ga as Mo,Pb as Bt,Ra as ui,S as Xt,Sb as Oo,T as ms,Xa as fs,Yb as _s,Z as hs,Zb as xs,bb as Ut,bc as vs,cc as bs,e as ps,ea as Kn,fc as Io,fd as Be,g as U,ga as sn,gd as rt,hc as ys,hd as Qt,id as Fo,jd as ks,pd as Ds,qd as st,x as Ft}from"./chunk-C7VFP4N4.js";import{b as Gs,c as Y,d as $}from"./chunk-CYMQMRSQ.js";import{C as ea,F as As,d as Cs,g as Ts,m as Jn,o as Ss,s as ws}
1from"./chunk-SAPP7HDL.js";import"./chunk-YJOTM47P.js";import"./chunk-2PJAPLDY.js";import"./chunk-UQ5LDOFJ.js";import{Fb as Es,Ib as fi,Pb as Ms,Tb as Os,Ua as Bi,Wb as Is,Xb as _i,kc as gt,nb as gi,vb as Ps}from"./chunk-C2CO7BOS.js";import"./chunk-XAC26MV5.js";import"./chunk-UVTXHEDZ.js";import{g as yt,h as le,i as z,k as ze,n as It,q as rn,t as mi,u as Qn}from"./chunk-3APTCJCW.js";import"./chunk-EMVJM2S7.js";import"./chunk-KDTKTPR2.js";import{c as qn}from"./chunk-TPWGF6XO.js";import{$a as Ei,A as $n,Ab as Wn,Ac as P,Ad as Oe,Bb as Xn,Bc as E,Cb as l,Cc as Ce,Dc as I,Fb as Jr,H as Ur,Ha as ye,Hb as Lo,Ia as D,Ib as y,Ic as A,Ja as L,Jc as f,Ka as K,Kb as es,Kc as Ii,Kd as ut,Lc as Fi,Ld as ds,Ma as qr,Mc as ee,Oa as Kr,Pb as ts,Pc as rs,Q as qe,Qc as ne,Rc as te,S as Ve,Sc as ie,Tb as O,Ua as J,Ub as on,Va as an,Vb as Po,Wb as Oi,Wc as he,Xb as is,Xc as v,Ya as Pi,Yb as C,Yc as W,Za as di,Zc as T,_c as pi,a as Wr,bd as ss,cd as ls,dd as cs,eb as Mi,ed as Eo,f as we,g as $t,gc as ns,ha as Ke,hd as Un,ia as Ze,id as Q,ja as Je,jd as V,kc as pe,kd as bt,lc as p,ma as Qr,mc as Fe,nc as X,pc as Wt,pd as x,q as Xr,qc as as,qd as S,ra as Z,rd as F,sa as nn,sc as os,sd as me,u as Ue,v as Qe,wa as G,xa as ht,xb as Zr,xc as m,yc as h,zc as w}from"./chunk-MH4BPXDL.js";import"./chunk-E3LNTQT4.js";import{a as Ot,g as $m,i as Wm,l as B}from"./chunk-CU44V7JF.js";var am=$m((lO,nm)=>{"use strict";nm.exports=l_;function Zi(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function l_(e){if(e=e||{},e.circles)return c_(e);let n=new Map;if(n.set(Date,r=>new Date(r)),n.set(Map,(r,s)=>new Map(i(Array.from(r),s))),n.set(Set,(r,s)=>new Set(i(Array.from(r),s))),e.constructorHandlers)for(let r of e.constructorHandlers)n.set(r[0],r[1]);let t=null;return e.proto?o:a;function i(r,s){let c=Object.keys(r),d=new Array(c.length);for(let u=0;u<c.length;u++){let g=c[u],_=r[g];typeof _!="object"||_===null?d[g]=_:_.constructor!==Object&&(t=n.get(_.constructor))?d[g]=t(_,s):ArrayBuffer.isView(_)?d[g]=Zi(_):d[g]=s(_)}return d}function a(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return i(r,a);if(r.constructor!==Object&&(t=n.get(r.constructor)))return t(r,a);let s={};for(let c in r){if(Object.hasOwnProperty.call(r,c)===!1)continue;let d=r[c];typeof d!="object"||d===null?s[c]=d:d.constructor!==Object&&(t=n.get(d.constructor))?s[c]=t(d,a):ArrayBuffer.isView(d)?s[c]=Zi(d):s[c]=a(d)}return s}function o(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return i(r,o);if(r.constructor!==Object&&(t=n.get(r.constructor)))return t(r,o);let s={};for(let c in r){let d=r[c];typeof d!="object"||d===null?s[c]=d:d.constructor!==Object&&(t=n.get(d.constructor))?s[c]=t(d,o):ArrayBuffer.isView(d)?s[c]=Zi(d):s[c]=o(d)}return s}}function c_(e){let n=[],t=[],i=new Map;if(i.set(Date,c=>new Date(c)),i.set(Map,(c,d)=>new Map(o(Array.from(c),d))),i.set(Set,(c,d)=>new Set(o(Array.from(c),d))),e.constructorHandlers)for(let c of e.constructorHandlers)i.set(c[0],c[1]);let a=null;return e.proto?s:r;function o(c,d){let u=Object.keys(c),g=new Array(u.length);for(let _=0;_<u.length;_++){let b=u[_],k=c[b];if(typeof k!="object"||k===null)g[b]=k;else if(k.constructor!==Object&&(a=i.get(k.constructor)))g[b]=a(k,d);else if(ArrayBuffer.isView(k))g[b]=Zi(k);else{let M=n.indexOf(k);M!==-1?g[b]=t[M]:g[b]=d(k)}}return g}function r(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return o(c,r);if(c.constructor!==Object&&(a=i.get(c.constructor)))return a(c,r);let d={};n.push(c),t.push(d);for(let u in c){if(Object.hasOwnProperty.call(c,u)===!1)continue;let g=c[u];if(typeof g!="object"||g===null)d[u]=g;else if(g.constructor!==Object&&(a=i.get(g.constructor)))d[u]=a(g,r);else if(ArrayBuffer.isView(g))d[u]=Zi(g);else{let _=n.indexOf(g);_!==-1?d[u]=t[_]:d[u]=r(g)}}return n.pop(),t.pop(),d}function s(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return o(c,s);if(c.constructor!==Object&&(a=i.get(c.constructor)))return a(c,s);let d={};n.push(c),t.push(d);for(let u in c){let g=c[u];if(typeof g!="object"||g===null)d[u]=g;else if(g.constructor!==Object&&(a=i.get(g.constructor)))d[u]=a(g,s);else if(ArrayBuffer.isView(g))d[u]=Zi(g);else{let _=n.indexOf(g);_!==-1?d[u]=t[_]:d[u]=s(g)}}return n.pop(),t.pop(),d}}});var Da=(()=>{let n=class n{constructor(i,a){this.appContext=i,this.userSubscriptionBannerStorageService=a}get userVedius(){return this.appContext.getUserCredential()?.userVedius}get isTrial(){return!!this.userVedius?.settings.platformAccess.isTrial}get isClinic(){return this.userVedius?.type===_e.Clinic}get showTrialBanner(){return this.isTrial&&!this.isClinic||this.isTrial&&this.isBlackNovember()}get trialDaysRemaining(){return this.userVedius?.settings.platformAccess.trialLeft}get isRenewalReminder(){let a=this.userVedius?.subscriptions?.vediusPlatformDetails?.futureOrCurrentSubscription?.nextBillingAt;if(!a)return!1;let o=new Date(a),r=new Date,s=o.getTime()-r.getTime(),c=Math.ceil(s/(1e3*3600*24));return c>=1&&c<=5}get showRenewalReminderBanner(){let i=this.userVedius?.settings?.subscriptionBanner?.isAllowBannerDisplay(Ye.RENEWAL_REMINDER)||!1;if(i){let a=this.userSubscriptionBannerStorageService.getStorage();a&&(i=a.isAllowBannerDisplay(Ye.RENEWAL_REMINDER))}return this.isRenewalReminder&&this.isEligibleForSubscription&&i}get isEligibleForSubscription(){return this.userVedius instanceof ln?this.userVedius?.isEligibleForSubscription():!0}get isRenewalTime(){return!!this.userVedius?.subscriptions?.vediusPlatformDetails?.futureOrCurrentSubscription?.isLastBillPending()&&this.renewalTimeDaysRemaining>=2}get showRenewalTimeBanner(){let i=this.userVedius?.settings?.subscriptionBanner?.isAllowBannerDisplay(Ye.RENEWAL_TIME)||!1;if(i){let a=this.userSubscriptionBannerStorageService.getStorage();a&&(i=a.isAllowBannerDisplay(Ye.RENEWAL_TIME))}return this.isRenewalTime&&this.isEligibleForSubscription&&i}get isRenewalFinalDay(){return!!this.userVedius?.subscriptions?.vediusPlatformDetails?.futureOrCurrentSubscription?.isLastBillPending()&&this.renewalTimeDaysRemaining<=1}get showRenewalFinalDayBanner(){let i=this.userVedius?.settings?.subscriptionBanner?.isAllowBannerDisplay(Ye.RENEWAL_FINAL_DAY)||!1;if(i){let a=this.userSubscriptionBannerStorageService.getStorage();a&&(i=a.isAllowBannerDisplay(Ye.RENEWAL_FINAL_DAY))}return this.isRenewalFinalDay&&this.isEligibleForSubscription&&i}get renewalTimeDaysRemaining(){let a=this.userVedius?.subscriptions?.vediusPlatformDetails?.futureOrCurrentSubscription?.lastPendingBill();if(!a||!a.dueAt)return 0;let o=new Date(a.dueAt),r=new Date,s=o.getTime()-r.getTime(),c=Math.ceil(s/(1e3*3600*24));return c>0?c:0}get lastPendingBill(){let a=this.userVedius?.subscriptions?.vediusPlatformDetails?.futureOrCurrentSubscription?.lastPendingBill();if(!(!a||!a.urlAddress))return a}showBanner(){let i=this.userVedius;if(!i||!i?.settings?.subscriptionBanner)return!1;let a=this.showTrialBanner,o=this.showRenewalReminderBanner,r=this.showRenewalTimeBanner,s=this.showRenewalFinalDayBanner;return a||o||r||s}isBlackNovember(){return ra()}getBannerConfig(){let i={};return this.showTrialBanner?(i.type=Ye.TRIAL,i.daysRemaining=this.trialDaysRemaining):this.showRenewalFinalDayBanner?(i.type=Ye.RENEWAL_FINAL_DAY,i.lastPendingBill=this.lastPendingBill):this.showRenewalTimeBanner?(i.type=Ye.RENEWAL_TIME,i.lastPendingBill=this.lastPendingBill,i.daysRemaining=this.renewalTimeDaysRemaining):this.showRenewalReminderBanner?i.type=Ye.RENEWAL_REMINDER:(i.type=Ye.TRIAL,i.daysRemaining=0),i}};n.\u0275fac=function(a){return new(a||n)(G(Le),G(pa))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();function Qm(e,n){if(e&1){let t=I();m(0,"vedius-subscription-info-banner",1),A("onRememberLaterClicked",function(){D(t);let a=f();return L(a.rememberLaterClicked())})("onResolveClicked",function(){D(t);let a=f();return L(a.resolveClicked())})("onBannerClicked",function(){D(t);let a=f();return L(a.bannerClicked())})("onClose",function(){D(t);let a=f();return L(a.close())}),h()}if(e&2){let t=f();p("isSmall",t.isSmall)("daysRemaining",t.daysRemaining)("type",t.subscriptionBannerType)("showImage",t.showImage)("blackNovemberMode",t.isBlackNovember())("vediusPromotionMode",t.isVediusPromotion()&&
1!t.isBlackNovember())}}var ac=(()=>{let n=class n{constructor(i,a,o,r,s,c,d){this.appContext=i,this.userService=a,this.firstSubscriptionRouteStrategy=o,this.userSubscriptionBannerService=r,this.subscriptionRouteStrategy=s,this.userSubscriptionBannerStorageService=c,this.vediusSupportService=d,this.showImage=!0,this.isSmall=!1,this.onClose=new J,this.isBlackNovember=Ei(!1),this.isVediusPromotion=Ei(!1),this.onResolveClicked=new J,this.onRememberLaterClicked=new J}get userVedius(){return this.appContext.getUserCredential()?.userVedius}get isClinic(){return this.userVedius?.type===_e.Clinic}get isTrialType(){return this.subscriptionBannerType===Ye.TRIAL}get isRenewalReminder(){return this.subscriptionBannerType===Ye.RENEWAL_REMINDER}get isRenewalTime(){return this.subscriptionBannerType===Ye.RENEWAL_TIME}get isRenewalFinalDay(){return this.subscriptionBannerType===Ye.RENEWAL_FINAL_DAY}ngOnInit(){this.isBlackNovember.set(ra()),this.isVediusPromotion.set(Us());let i=this.userSubscriptionBannerService.getBannerConfig();this.subscriptionBannerType=i.type,this.daysRemaining=i.daysRemaining,this.lastPendingBill=i.lastPendingBill}rememberLaterClicked(){let i=this?.userVedius;if(!i)return;let a=i.settings.subscriptionBanner;a.setAllowBannerDisplay(this.subscriptionBannerType,!1),this.userSubscriptionBannerStorageService.setStorage(a),this.onClose.emit()}resolveClicked(){let i=this?.userVedius;i&&(i.settings.subscriptionBanner.setAllowBannerDisplay(this.subscriptionBannerType,!1),this.userService.updateSync({userVedius:i}),this.onClose.emit())}close(){let i=this?.userVedius;i&&(i.settings.subscriptionBanner.setAllowBannerDisplay(this.subscriptionBannerType,!1),this.userService.updateSync({userVedius:i}),this.onClose.emit())}bannerClicked(){let i={trial:this.onTrialBannerClicked.bind(this),renewalReminder:this.onRenewReminderBannerClicked.bind(this),renewalTime:this.onRenewTimeBannerClicked.bind(this),renewalFinalDay:this.onRenewFinalDayBannerClicked.bind(this)},a=this.getBannerType();a&&i[a]?i[a]():console.warn("No action defined for this banner type.")}getBannerType(){return this.isTrialType?"trial":this.isRenewalReminder?"renewalReminder":this.isRenewalTime?"renewalTime":this.isRenewalFinalDay?"renewalFinalDay":null}onTrialBannerClicked(){if(this.isClinic&&this.isBlackNovember()){this.vediusSupportService.openCrispChat();return}this.firstSubscriptionRouteStrategy.redirect()}onRenewReminderBannerClicked(){this.subscriptionRouteStrategy.redirect()}onRenewTimeBannerClicked(){this.lastPendingBill?.openBillUrl()}onRenewFinalDayBannerClicked(){this.lastPendingBill?.openBillUrl()}};n.\u0275fac=function(a){return new(a||n)(y(Le),y(sa),y(Qs),y(Da),y(qs),y(pa),y(qt))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-user-subscription-banner"]],inputs:{showImage:"showImage",isSmall:"isSmall"},outputs:{onClose:"onClose",onResolveClicked:"onResolveClicked",onRememberLaterClicked:"onRememberLaterClicked"},decls:1,vars:1,consts:[[3,"isSmall","daysRemaining","type","showImage","blackNovemberMode","vediusPromotionMode","onRememberLaterClicked","onResolveClicked","onBannerClicked","onClose",4,"ngIf"],[3,"onRememberLaterClicked","onResolveClicked","onBannerClicked","onClose","isSmall","daysRemaining","type","showImage","blackNovemberMode","vediusPromotionMode"]],template:function(a,o){a&1&&C(0,Qm,1,6,"vedius-subscription-info-banner",0),a&2&&p("ngIf",o.subscriptionBannerType)},dependencies:[z,Hs],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.starting-onboarding-card[_ngcontent-%COMP%]{display:flex;padding:40px;flex-direction:column;align-items:flex-start;gap:24px;align-self:stretch;width:100%;border-radius:8px;background:#014954;height:232px;position:relative;box-sizing:border-box}.starting-onboarding-card[_ngcontent-%COMP%] .neutral-day-color[_ngcontent-%COMP%]{color:#fff}.starting-onboarding-card[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%]{display:flex;
1max-width:490px;width:100%;flex-direction:column;align-items:flex-start;gap:8px;z-index:2}.starting-onboarding-card[_ngcontent-%COMP%] .action-button[_ngcontent-%COMP%]{max-width:260px;width:100%;z-index:2}.starting-onboarding-card[_ngcontent-%COMP%] .onboarding-image-content[_ngcontent-%COMP%]{position:absolute;right:0;top:0;z-index:1}.starting-onboarding-card[_ngcontent-%COMP%] .onboarding-image-content[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-top-right-radius:8px;border-bottom-right-radius:8px}.starting-onboarding-card.no-image[_ngcontent-%COMP%]{height:100%}.starting-onboarding-card.no-image[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%], .starting-onboarding-card.no-image[_ngcontent-%COMP%] .action-button[_ngcontent-%COMP%]{z-index:0}.starting-onboarding-card.small[_ngcontent-%COMP%]{padding:24px;border-radius:0;height:100%}.starting-onboarding-card.small[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%], .starting-onboarding-card.small[_ngcontent-%COMP%] .action-button[_ngcontent-%COMP%]{z-index:0}"]});let e=n;return e})();var qm=[[["vds-icon-tab"]]],Km=["vds-icon-tab"],La=(()=>{let n=class n{constructor(){this.orientation=Pi("horizontal"),this.value=ts()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["vds-icon-tabs"]],hostAttrs:["role","tablist"],hostVars:3,hostBindings:function(a,o){a&2&&(pe("aria-orientation",o.orientation()),X("vds-icon-tabs--vertical",o.orientation()==="vertical"))},inputs:{orientation:[1,"orientation"],value:[1,"value"]},outputs:{value:"valueChange"},ngContentSelectors:Km,decls:1,vars:0,template:function(a,o){a&1&&(Ii(qm),Fi(0))},styles:['@charset "UTF-8";[_ngcontent-%COMP%]:root{--001: #fefefe;--002: #f1f3f5}.theme-dark[_ngcontent-%COMP%]{--001: #16191e;--002: #22262e}[_ngcontent-%COMP%]:root{--elevation-low-bottom: 0 8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-above: 0 -8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-left: -8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-low-right: 8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-high-bottom: 0 12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-above: 0 -12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-left: -12px 0 40px 0 rgba(0, 0, 0, .12);--elevation-high-right: 12px 0 40px 0 rgba(0, 0, 0, .12)}[_nghost-%COMP%]{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;gap:.25rem;width:100%;padding:.25rem}.vds-icon-tabs--vertical[_nghost-%COMP%]{flex-direction:column;width:max-content;gap:.75rem;--vds-icon-tab-width: 100%}'],changeDetection:0});let e=n;return e})();var Zm=["*"],oc=(()=>{let n=class n{constructor(){this.tabsGroup=ht(La,{optional:!0}),this.value=Pi.required(),this.iconName=Pi.required(),this.disabled=Pi(!1),this.active=ut(()=>this.tabsGroup?.value()===this.value())}onTrigger(i){i.preventDefault(),i.stopPropagation(),!(this.disabled()||this.active())&&this.tabsGroup&&this.tabsGroup.value.set(this.value())}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["vds-icon-tab"]],hostAttrs:["role","tab"],hostVars:7,hostBindings:function(a,o){a&1&&A("click",function(s){return o.onTrigger(s)})("keydown.enter",function(s){return o.onTrigger(s)})("keydown.space",function(s){return o.onTrigger(s)}),a&2&&(pe("tabindex",o.disabled()?-1:0)("aria-selected",o.active())("aria-disabled",o.disabled()),X("vds-icon-tab--active",o.active())("vds-icon-tab--disabled",o.disabled()))},inputs:{value:[1,"value"],iconName:[1,"iconName"],disabled:[1,"disabled"]},ngContentSelectors:Zm,decls:5,vars:1,consts:[[1,"vds-icon-tab__ring"],[1,"vds-icon-tab__circle"],["type","icon","size","md",3,"iconName"],[1,"vds-icon-tab__label"]],template:function(a,o){a&1&&(Ii(),m(0,"div",0)(1,"div",1),w(2,"vds-visual",2),h()(),m(3,"span",3),Fi(4),h()),a&2&&(l(2),p("iconName",o.iconName()))},dependencies:[xl],styles:['@charset "UTF-8";[_ngcontent-%COMP%]:root{--001: #fefefe;--002: #f1f3f5}.theme-dark[_ngcontent-%COMP%]{--001: #16191e;--002: #22262e}[_ngcontent-%COMP%]:root{--elevation-low-bottom: 0 8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-above: 0 -8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-left: -8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-low-right: 8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-high-bottom: 0 12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-above: 0 -12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-left: -12px 0 40px 0 rgba(0, 0, 0, .12);--elevation-high-right: 12px 0 40px 0 rgba(0, 0, 0, .12)}[_nghost-%COMP%]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;outline:none;border-radius:9999px;width:var(--vds-icon-tab-width, 5.3125rem);flex-shrink:0}[_nghost-%COMP%]:focus-visible .vds-icon-tab__ring[_ngcontent-%COMP%]{outline:2px solid #dee1e8;outline-offset:2px}[_nghost-%COMP%]:hover:not(.vds-icon-tab--active,.vds-icon-tab--disabled) .vds-icon-tab__circle[_ng
1content-%COMP%], [_nghost-%COMP%]:active:not(.vds-icon-tab--active,.vds-icon-tab--disabled) .vds-icon-tab__circle[_ngcontent-%COMP%]{background-color:#17bbd31a;color:#0f7888}[_nghost-%COMP%]:hover:not(.vds-icon-tab--active,.vds-icon-tab--disabled) .vds-icon-tab__label[_ngcontent-%COMP%], [_nghost-%COMP%]:active:not(.vds-icon-tab--active,.vds-icon-tab--disabled) .vds-icon-tab__label[_ngcontent-%COMP%]{color:#0f7888}.vds-icon-tab--active[_nghost-%COMP%] .vds-icon-tab__circle[_ngcontent-%COMP%]{background-color:#17bbd31a;color:#0f7888}.vds-icon-tab--active[_nghost-%COMP%] .vds-icon-tab__label[_ngcontent-%COMP%]{color:#0f7888}.vds-icon-tab--disabled[_nghost-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.vds-icon-tab__ring[_ngcontent-%COMP%]{display:flex;padding:.25rem;border-radius:9999px;background-color:#fff;border:1px solid #dee1e8}.vds-icon-tab__ring.theme-dark[_ngcontent-%COMP%], .theme-dark[_nghost-%COMP%] .vds-icon-tab__ring[_ngcontent-%COMP%], .theme-dark [_nghost-%COMP%] .vds-icon-tab__ring[_ngcontent-%COMP%], .theme-dark[_ngcontent-%COMP%] .vds-icon-tab__ring[_ngcontent-%COMP%]{background-color:#161616}.vds-icon-tab__circle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:.625rem;border-radius:9999px;background-color:transparent;color:#686f7a;transition:background-color .2s ease-in-out,color .2s ease-in-out}.vds-icon-tab__label[_ngcontent-%COMP%]{font-family:Inter,DM Sans,-apple-system,BlinkMacSystemFont,sans-serif;font-size:.75rem;line-height:1rem;font-weight:500;letter-spacing:0;color:#686f7a;text-align:center;transition:color .2s ease-in-out;max-width:5.3125rem;white-space:normal;word-break:break-word;text-wrap:balance}'],changeDetection:0});let e=n;return e})();var rc=e=>({label:e});function Jm(e,n){e&1&&(v(0),x(1,"translate")),e&2&&T(" ",S(1,1,"ONBOARDING.PLATFORM_OVERVIEW.TABS.STUDENTS")," ")}function eh(e,n){e&1&&(v(0),x(1,"translate")),e&2&&T(" ",S(1,1,"ONBOARDING.PLATFORM_OVERVIEW.TABS.PATIENTS")," ")}var Yo=["agenda","finances","patients","programs"],hn=[{titleKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.AGENDA.TITLE",descriptionKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.AGENDA.DESCRIPTION",videoUrl:"https://youtu.be/qoHu1efihOQ?list=PLYnZvJulJd-p6jqcmrXhgw-CkMHWu49CH"},{titleKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.FINANCES.TITLE",descriptionKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.FINANCES.DESCRIPTION",videoUrl:"https://youtu.be/VobilU6eBSY?si=ZjBCBkP3Ym5GE-8b"},{titleKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.RECORD.TITLE",descriptionKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.RECORD.DESCRIPTION",videoUrl:"https://youtu.be/MY0i8RgjOJU?si=H2bnoAJgSE_9NO-I"},{titleKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.PROGRAMS.TITLE",descriptionKey:"ONBOARDING.PLATFORM_OVERVIEW.SLIDES.PROGRAMS.DESCRIPTION",videoUrl:"https://youtu.be/vsoKdIqx4FI?si=R-9Btus0VMjn0KNx"}],sc=(()=>{let n=class n{constructor(){this.modalRef=ht(hl,{optional:!0}),this.appContext=ht(Le),this.vediusSupportService=ht(qt),this.breakpointObserver=ht(Ri),this.translate=ht(Gs),this.selectedTab=Ei("agenda"),this.currentSlideIndex=Ei(0),this.currentSlide=ut(()=>hn[this.currentSlideIndex()]??hn[0]),this.isLastStep=ut(()=>this.currentSlideIndex()===hn.length-1),this.userVedius=ut(()=>this.appContext.getUserCredential()?.userVedius),this.isStudentTreatment=ut(()=>this.userVedius()?.clientTreatmentType===xe.STUDENT),this.isMobile=qn(this.breakpointObserver.observe(ui).pipe($n(i=>i.matches)),{initialValue:this.breakpointObserver.isMatched(ui)}),this.tertiaryBtnConfig=ut(()=>{if(!this.isMobile())return{label:this.translate.instant("ONBOARDING.PLATFORM_OVERVIEW.ACTIONS.CLOSE")}}),ds(()=>{let i=this.selectedTab(),a=Yo.indexOf(i);a>=0&&this.currentSlideIndex.set(a)})}onHeaderClose(){this.modalRef?.close()}closeTour(){this.modalRef?.close()}navigateTabs(i,a){let o=document.activeElement;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="IFRAME"))return;i.preventDefault();let s=(this.currentSlideIndex()+a+hn.length)%hn.length;this.selectedTab.set(Yo[s])}handleEnterKeyPress(i){Cl(i,()=>void this.onPrimaryNext())}onPrimaryNext(){if(this.isLastStep()){this.closeTour();return}let i=this.currentSlideIndex();this.selectedTab.set(Yo[i+1])}onWatchDemo(){this.vediusSupportService.openVediusDemo()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["app-platform-overview-modal"]],hostBindings:function(a,o){a&1&&A("keydown.enter",function(s){return o.handleEnterKeyPress(s)}
1,!1,Xn)("keydown.arrowRight",function(s){return o.navigateTabs(s,1)},!1,Xn)("keydown.arrowLeft",function(s){return o.navigateTabs(s,-1)},!1,Xn)},decls:24,vars:33,consts:[["size","md",3,"closeClick","titleText","description","showClose"],[1,"platform-overview-modal__content"],[1,"platform-overview-modal__video-wrap"],[3,"url"],[1,"platform-overview-modal__tabs",3,"valueChange","value"],["value","agenda","iconName","vds-calendar"],["value","finances","iconName","vds-finance"],["value","patients","iconName","vds-users"],["value","programs","iconName","vds-fitness-biceps"],[3,"primaryClick","secondaryClick","tertiaryClick","primary","secondary","tertiary","sticky"]],template:function(a,o){a&1&&(m(0,"vds-modal")(1,"vds-modal-header",0),x(2,"translate"),x(3,"translate"),A("closeClick",function(){return o.onHeaderClose()}),h(),m(4,"vds-modal-content",1)(5,"div",2),w(6,"vds-video",3),h(),m(7,"vds-icon-tabs",4),cs("valueChange",function(s){return ls(o.selectedTab,s)||(o.selectedTab=s),s}),m(8,"vds-icon-tab",5),v(9),x(10,"translate"),h(),m(11,"vds-icon-tab",6),v(12),x(13,"translate"),h(),m(14,"vds-icon-tab",7),C(15,Jm,2,3)(16,eh,2,3),h(),m(17,"vds-icon-tab",8),v(18),x(19,"translate"),h()()(),m(20,"vds-default-footer-actions-modal",9),x(21,"translate"),x(22,"translate"),x(23,"translate"),A("primaryClick",function(){return o.onPrimaryNext()})("secondaryClick",function(){return o.onWatchDemo()})("tertiaryClick",function(){return o.closeTour()}),h()()),a&2&&(l(),p("titleText",S(2,13,o.currentSlide().titleKey))("description",S(3,15,o.currentSlide().descriptionKey))("showClose",!0),l(5),p("url",o.currentSlide().videoUrl),l(),ss("value",o.selectedTab),l(2),T(" ",S(10,17,"ONBOARDING.PLATFORM_OVERVIEW.TABS.AGENDA")," "),l(3),T(" ",S(13,19,"ONBOARDING.PLATFORM_OVERVIEW.TABS.FINANCES")," "),l(3),os(o.isStudentTreatment()?15:16),l(3),T(" ",S(19,21,"ONBOARDING.PLATFORM_OVERVIEW.TABS.PROGRAMS")," "),l(2),p("primary",V(29,rc,o.isLastStep()?S(21,23,"ONBOARDING.PLATFORM_OVERVIEW.ACTIONS.FINISH_TUTORIAL_BUTTON"):S(22,25,"ONBOARDING.PLATFORM_OVERVIEW.ACTIONS.NEXT")))("secondary",V(31,rc,S(23,27,"BUTTONS.VEDIUS_SPECIALIST_TRAINING")))("tertiary",o.tertiaryBtnConfig())("sticky",!0))},dependencies:[$,Y,Sl,oc,La,_l,bl,yl,vl],styles:['@charset "UTF-8";[_ngcontent-%COMP%]:root{--001: #fefefe;--002: #f1f3f5}.theme-dark[_ngcontent-%COMP%]{--001: #16191e;--002: #22262e}[_ngcontent-%COMP%]:root{--elevation-low-bottom: 0 8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-above: 0 -8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-left: -8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-low-right: 8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-high-bottom: 0 12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-above: 0 -12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-left: -12px 0 40px 0 rgba(0, 0, 0, .12);--elevation-high-right: 12px 0 40px 0 rgba(0, 0, 0, .12)}[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;height:100%}.platform-overview-modal__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;min-height:0;width:100%;overflow-y:auto}.platform-overview-modal__video-wrap[_ngcontent-%COMP%]{padding:1rem;border-radius:1rem;background:linear-gradient(88deg,#68b3ad -3.46%,#185964 103.19%);width:100%;margin:0 auto;box-sizing:border-box;justify-content:center;display:flex}.platform-overview-modal__video-wrap[_ngcontent-%COMP%] vds-video[_ngcontent-%COMP%]{display:block;width:100%;aspect-ratio:16/9;border-radius:.5rem;overflow:hidden}@media (max-width: 1919px){.platform-overview-modal__video-wrap[_ngcontent-%COMP%] vds-video[_ngcontent-%COMP%]{width:764px}}@media (max-width: 1536px){.platform-overview-modal__video-wrap[_ngcontent-%COMP%] vds-video[_ngcontent-%COMP%]{width:423px}}@media (max-width: 600px){.platform-overview-modal__video-wrap[_ngcontent-%COMP%] vds-video[_ngcontent-%COMP%]{width:318px}}.platform-overview-modal__tabs[_ngcontent-%COMP%]{width:100%;flex-shrink:0;justify-content:center;box-sizing:border-box}'],changeDetection:0});let e=n;return e})();function th(e,n){e&1&&(m(0,"div",10),w(1,"img",11),h())}var lc=(()=>{let n=class n{constructor(i,a,o){this.appContext=i,this.vediusSupportService=a,this.vdsModalService=o,this.showImage=!0,this.isSmall=!1,this.onClose=new J}get userVedius(){return this.appContext.getUserCredential()?.userVedius}get isPatientTreatmentType(){return this.userVedius?.clientTreatmentType===xe.PATIENT}onCloseClick(){this.onClose.emit()}onAction(){this.vediusSupportService.openVediusDemo()}openTutorialModal(){this.vdsModalService.open(sc,{width:"960px"})}};n.\u0275fac=function(a){return new(a||n)(y(Le),y(qt),y(ul))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-onboarding-card"]],inputs:{showImage:"showImage",isSmall:"isSmall"},outputs:{onClose:"onClose"},decls:18,vars:19,consts:[[1,"starting-onboarding-card"],["tabindex","0",1,"close-button-container",3,"click"],["svgIcon","close-banner","aria-label","Fechar banner",1,"icon-close-button"],[1,"info-message-container"],["variant","display-md",1,"starting-onboarding-card__title"],["variant","body-lg",1,"starting-onboarding-card__description"],[1,"starting-onboarding-card__actions"],["variant","primary","size","lg","trailingIcon","vds-arrow-right",1,"starting-onboarding-card__demo-button",3,"click","fullWidth"],["variant","secondary","size","lg",1,"starting-onboarding-card__tutorial-button",3,"click","fullWidth"],["class","onboarding-image-content",4,"ngIf"],[1,"onboarding-image-content"],["src","../../../../../../assets/images/dashboard-onboarding.svg","alt","onboarding image"]],template:function(a,o){a&1&&(m(0,"div",0)(1,"div",1),A("click",function(){return o.onCloseClick()}),w(2,"mat-icon",2),h(),m(3,"div",3)(4,"vds-text",4),v(5),x(6,"translate"),h(),m(7,"vds-text",5),v(8),x(9,"translate"),h()(),m(10,"div",6)(11,"vds-button",7),A("click",function(){return o.onAction()}),v(12),x(13,"translate"),h(),m(14,"vds-button",8),A("click",function(){return o.openTutorialModal()}),v(15),x(16,"translate"),h()(),C(17,th,2,0,"div",9),h()),a&2&&(X("small",o.isSmall)("no-image",!o.showImage),l(5),T(" ",S(6,11,"STARTING_ONBOARDING_CARD.TITLE")," "),l(3),T(" ",S(9,13,"STARTING_ONBOARDING_CARD.DESCRIPTION")," "),l(3),p("fullWidth",o.isSmall),l(),T(" ",S(13,15,"BUTTONS.VEDIUS_SPECIALIST_TRAINING")," "),l(2),p("fullWidth",o.isSmall),l(),T(" ",S(16,17,"STARTING_ONBOARDING_CARD.WATCH_TUTORIAL")," "),l(2),p("ngIf",o.showImage&&!o.isSmall))},dependencies:[fl,ml,z,$,Y,Ns,et],styles:['@charset "UTF-8";.disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
1-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}[_ngcontent-%COMP%]:root{--001: #fefefe;--002: #f1f3f5}.theme-dark[_ngcontent-%COMP%]{--001: #16191e;--002: #22262e}[_ngcontent-%COMP%]:root{--elevation-low-bottom: 0 8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-above: 0 -8px 12px 0 rgba(0, 0, 0, .08);--elevation-low-left: -8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-low-right: 8px 0 12px 0 rgba(0, 0, 0, .08);--elevation-high-bottom: 0 12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-above: 0 -12px 40px 0 rgba(0, 0, 0, .12);--elevation-high-left: -12px 0 40px 0 rgba(0, 0, 0, .12);--elevation-high-right: 12px 0 40px 0 rgba(0, 0, 0, .12)}.starting-onboarding-card[_ngcontent-%COMP%]{display:flex;padding:40px;flex-direction:column;align-items:flex-start;gap:24px;align-self:stretch;width:100%;border-radius:8px;background:#014954;position:relative;box-sizing:border-box;overflow:hidden}.starting-onboarding-card[_ngcontent-%COMP%] .close-button-container[_ngcontent-%COMP%]{position:absolute;z-index:2;top:0;right:0;cursor:pointer;padding:12px}.starting-onboarding-card[_ngcontent-%COMP%] .close-button-container[_ngcontent-%COMP%] .icon-close-button[_ngcontent-%COMP%]{stroke:#f5f6f8;width:20px;height:20px}.starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__title[_ngcontent-%COMP%] .vds-text, .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__description[_ngcontent-%COMP%] .vds-text{color:#fff;display:block}.starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__title[_ngcontent-%COMP%] .vds-text.theme-dark, .theme-dark[_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__title[_ngcontent-%COMP%] .vds-text, .theme-dark [_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__title[_ngcontent-%COMP%] .vds-text, .theme-dark[_ngcontent-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__title[_ngcontent-%COMP%] .vds-text, .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__description[_ngcontent-%COMP%] .vds-text.theme-dark, .theme-dark[_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__description[_ngcontent-%COMP%] .vds-text, .theme-dark [_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__description[_ngcontent-%COMP%] .vds-text, .theme-dark[_ngcontent-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] vds-text.starting-onboarding-card__description[_ngcontent-%COMP%] .vds-text{color:#161616}.starting-onboarding-card[_ngcontent-%COMP%]:not(.small){gap:2rem}.starting-onboarding-card[_ngcontent-%COMP%]:not(.small) .info-message-container[_ngcontent-%COMP%]{max-width:560px;gap:1rem}.starting-onboarding-card[_ngcontent-%COMP%]:not(.small) vds-text.starting-onboarding-card__title[_ngcontent-%COMP%] .vds-text{line-height:2.5rem}.starting-onboarding-card[_ngcontent-%COMP%]:not(.small) vds-text.starting-onboarding-card__description[_ngcontent-%COMP%] .vds-text{line-height:1.75rem}.starting-onboarding-card[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%]{display:flex;max-width:490px;width:100%;flex-direction:column;align-items:flex-start;gap:8px;z-index:5}.starting-onboarding-card[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%] .description-2-text[_ngcontent-%COMP%]{font-weight:700}.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-start;gap:1rem;z-index:5}.starting-onboarding-card[_ngcontent-%COMP%]:not(.small) .starting-onboarding-card__actions[_ngcontent-%COMP%]{gap:1.5rem}.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__demo-button[_ngcontent-%COMP%], .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%]{z-index:5}.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default{background-color:#a2acbd33;color:#fff;border-color:transparent}.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default.theme-dark, .theme-dark[_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default, .theme-dark [_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default, .theme-dark[_ngcontent-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default{color:#161616}@media (hover: hover){.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:hover:not(.vds-button--disabled):not(:disabled), .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:active:not(.vds-button--disabled):not(:disabled){background-color:#0d7180;color:#fff;border-color:transparent}.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:hover:not(.vds-button--disabled):not(:disabled).theme-dark, .theme-dark[_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:hover:not(.vds-button--disabled):not(:disabled), .theme-dark [_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:hover:not(.vds-button--disabled):not(:disabled), .theme-dark[_ngcontent-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:hover:not(.vds-button--disabled):not(:disabled), .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:active:not(.vds-button--disabled):not(:disabled).theme-dark, .theme-dark[_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:active:not(.vds-button--disabled):not(:disabled), .theme-dark [_nghost-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:active:not(.vds-button--disabled):not(:disabled), .theme-dark[_ngcontent-%COMP%] .starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__tutorial-button[_ngcontent-%COMP%] .vds-button__native.vds-button--secondary-default:active:not(.vds-button--disabled):not(:disabled){color:#161616}}.starting-onboarding-card[_ngcontent-%COMP%] .onboarding-image-content[_ngcontent-%COMP%]{position:absolute;right:0;top:0;bottom:0;z-index:1;display:flex;align-items:flex-end;justify-content:flex-end}.starting-onboarding-card[_ngcontent-%COMP%] .onboarding-image-content[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;right:0;bottom:0;width:140%;background:#0a5b66;clip-path:polygon(0% 0,100% 0,100% 100%,25% 100%);z-index:-1}.starting-onboarding-card[_ngcontent-%COMP%] .onboarding-image-content[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:block;max-height:100%;width:auto;margin-right:40px;margin-bottom:0}.starting-onboarding-card.no-image[_ngcontent-%COMP%]{height:100%}.starting-onboarding-card.no-image[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%], .starting-onboarding-card.no-image[_ngcontent-%COMP%] .starting-onboarding-card__actions[_ngcontent-%COMP%]{z-index:0}@media screen and (max-width: 1200px){.starting-onboarding-card[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%]{max-width:100%}.starting-onboarding-card[_ngcontent-%COMP%] .starting-onboarding-card__actions[_ngcontent-%COMP%]{flex-direction:column;width:100%}}.starting-onboarding-card.small[_ngcontent-%COMP%]{padding:24px;height:100%}.starting-onboarding-card.small[_ngcontent-%COMP%] .info-message-container[_ngcontent-%COMP%], .starting-onboarding-card.small[_ngcontent-%COMP%] .starting-onboarding-card__actions[_ngcontent-%COMP%]{z-index:0}.starting-onboarding-card.small[_ngcontent-%COMP%] .starting-onboarding-card__actions[_ngcontent-%COMP%]{flex-direction:column;width:100%}']});let e=n;return e})();var cc=(()=>{let n=class n{constructor(i){this.localeContext=i}transform(i){if(!i)return"";let a=typeof i=="string"?new Date(i):i,r=new It(this.localeContext.current).transform(a,"EEEE");return je(r?.replace("-feira","")||"")||""}};n.\u0275fac=function(a){return new(a||n)(y(st,16))},n.\u0275pipe=Oi({name:"vediusWeekDay",type:n,pure:!0});let e=n;return e})();var ah=["unconfirmedAgendaAppointmentLists"],oh=e=>({warning:e}),rh=e=>({value:e});function sh(e,n){e&1&&(P(0),v(1),x(2,"translate"),E()),e&2&&(l(),T(" - ",S(2,1,"PERIOD.TODAY")," "))}function lh(e,n){if(e&1&&(P(0),v(1),x(2,"date"),E()),e&2){let t=f().$implicit;l(),T(" - ",F(2,1,t.date,"dd/MM")," ")}}function ch(e,n){if(e&1){let t=I();P(0),m(1,"vedius-text",9),v(2),x(3,"vediusWeekDay"),C(4,sh,3,3,"ng-container",7)(5,lh,3,4,"ng-container",7),h(),m(6,"app-agenda-appointment-list",10,0),A("onChangeStatus",function(a){D(t);let o=f();
1return L(o.changeStatus(a))}),h(),E()}if(e&2){let t=n.$implicit,i=f();l(2),T(" ",S(3,11,t.date)," "),l(2),p("ngIf",i.isToday(t.date)),l(),p("ngIf",!i.isToday(t.date)),l(),p("data",t.appointments)("hideServiceInfo",!0)("hideProfessionalInfo",!0)("disableRowClick",!0)("sendWhatsappConfig",i.sendWhatsappConfig)("allPatientsObjectInfos",i.allPatientsObjectInfos)("isSmall",i.isMobile)("hideStatusMenuKeys",i.hideStatusMenuKeys)}}function dh(e,n){if(e&1&&(P(0),v(1),x(2,"translate"),E()),e&2){let t=f();l(),T(" ",F(2,1,"UNCONFIRMED_APPOINTMENTS_MODAL.UNCONFIRMED_INFO",V(4,rh,t.unconfirmedCount))," ")}}function ph(e,n){e&1&&(P(0),v(1),x(2,"translate"),E()),e&2&&(l(),T(" ",S(2,1,"UNCONFIRMED_APPOINTMENTS_MODAL.ALL_OK")," \u{1F389} "))}var dc=(()=>{let n=class n{constructor(i,a,o){this.breakpointObserver=i,this.editEventCalendarHandlerFactory=a,this.data=o,this.modal=null,this.appointments=[],this.isMobile=!1,this.today=new Date,this.hideStatusMenuKeys=[Se.InService,Se.Scheduled,Se.Waiting,Se.Completed]}ngOnInit(){if(this.data?.eventsCalendarDisplay){this.listenIsMobile(),this.sendWhatsappConfig=this.data?.calendarSettings?.length?{enabled:!0,calendarSettings:this.data.calendarSettings}:void 0;let i=this.data.eventsCalendarDisplay;this.loadAppointments(i)}}listenIsMobile(){this.breakpointObserver.observe([ui]).subscribe(i=>{this.isMobile=i.matches})}isToday(i){return Xt(this.today,i)}get allPatientsObjectInfos(){return this.data?.allPatientsObjectInfos||[]}get unconfirmedCount(){return this.appointments.reduce((i,a)=>i+a.appointments.filter(o=>o.status===Se.Scheduled).length,0)}loadAppointments(i){let a={};i.forEach(r=>{let s=us(r.start);a[s]||(a[s]={date:r.start,appointments:[]}),a[s].appointments.push(r)});for(let r in a)a[r].appointments.sort((s,c)=>s.start.getTime()-c.start.getTime());let o=Object.values(a);o.sort((r,s)=>r.date.getTime()-s.date.getTime()),this.appointments=o}changeStatus(i){let a=i.eventCalendarDisplay.start;this.changeEventStatus(i.eventCalendarDisplay,i.status,a)}changeEventStatus(i,a,o){if(i){this.lastEventCalendarStatusDateChanged=o;let r=this.editEventCalendarHandlerFactory.create(xa.EDIT_STATUS),s={status:a,eventCalendarDisplay:i,editableEventCalendar:void 0,parentEventCalendar:void 0,callback:this.callbackAfterChangeStatus.bind(this),config:{notAllowUndo:!0}};r.handle({data:s})}}callbackAfterChangeStatus(i){let a=i.eventCalendarDisplay;for(let o of this.appointments){let r=o.appointments.findIndex(s=>s.id===a.id);if(r!==-1){o.appointments[r]=a;break}this.unconfirmedAgendaAppointmentLists?.forEach(s=>{s.updateData(a)})}}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(Ri),y(va),y(St))},n.\u0275cmp=O({type:n,selectors:[["app-unconfirmed-appointments-modal"]],viewQuery:function(a,o){if(a&1&&(ne(q,5),ne(ah,5)),a&2){let r;te(r=ie())&&(o.modal=r.first),te(r=ie())&&(o.unconfirmedAgendaAppointmentLists=r)}},decls:14,vars:14,consts:[["unconfirmedAgendaAppointmentLists",""],[1,"unconfirmed-appointments-modal-component"],[1,"title"],[1,"appointments-wrapper"],[4,"ngFor","ngForOf"],[1,"bottom"],[3,"ngClass"],[4,"ngIf"],["variant","secondary",3,"onClick"],["variant","text","size","md",1,"color-neutral-dusk","appointment-title"],[3,"onChangeStatus","data","hideServiceInfo","hideProfessionalInfo","disableRowClick","sendWhatsappConfig","allPatientsObjectInfos","isSmall","hideStatusMenuKeys"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",1)(2,"h1",2),v(3),x(4,"translate"),h(),m(5,"div",3),C(6,ch,8,13,"ng-container",4),h(),m(7,"div",5)(8,"span",6),C(9,dh,3,6,"ng-container",7)(10,ph,3,3,"ng-container",7),h(),m(11,"vedius-button",8),A("onClick",function(){return o.close()}),v(12),x(13,"translate"),h()()()()),a&2&&(l(),X("small",o.isMobile),l(2),T(" ",S(4,8,"UNCONFIRMED_APPOINTMENTS_MODAL.TITLE")," "),l(3),p("ngForOf",o.appointments),l(2),p("ngClass",V(12,oh,o.unconfirmedCount>0)),l(),p("ngIf",o.unconfirmedCount>=1),l(),p("ngIf",o.unconfirmedCount===0),l(2),W(S(13,10,"BUTTONS.CLOSE")))},dependencies:[q,le,j,z,Fl,yt,re,It,$,Y,cc],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;
1-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.unconfirmed-appointments-modal-component{display:flex;flex-direction:column;gap:40px}.unconfirmed-appointments-modal-component .color-neutral-dusk{color:#192840}.unconfirmed-appointments-modal-component .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center}.unconfirmed-appointments-modal-component .appointments-wrapper{display:flex;flex-direction:column;width:100%;height:calc(100vh - 300px);overflow:auto}.unconfirmed-appointments-modal-component .appointments-wrapper .appointment-title{margin-bottom:8px;margin-top:8px}.unconfirmed-appointments-modal-component .appointments-wrapper .appointment-title :first-child{margin-top:0}.unconfirmed-appointments-modal-component .appointments-wrapper .appointment-title :last-child{margin-bottom:0}.unconfirmed-appointments-modal-component ul{padding:0;margin:0;list-style:none}.unconfirmed-appointments-modal-component .bottom{display:flex;align-items:center;justify-content:space-between}.unconfirmed-appointments-modal-component .bottom span{color:#192840;font-family:DM Sans;font-size:1rem;font-weight:500;line-height:1.5rem}.unconfirmed-appointments-modal-component .bottom span.warning{color:#7c4805}.unconfirmed-appointments-modal-component.small .title{font-size:1.25rem;line-height:1.875rem;margin-top:0;max-width:300px} 2`],encapsulation:2});let e=n;return e})();var Pa=(()=>
2{let n=class n{constructor(){this._programDisabledSubject=new $t(void 0)}notifyProgramDashboardDisabled(i){this._programDisabledSubject.next(i)}get programDashboardDisabled(){return this._programDisabledSubject.asObservable()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var uh=e=>({warning:e}),mc=e=>({total:e}),gh=()=>({height:"56px"}),hc=e=>({value:e});function fh(e,n){if(e&1){let t=I();m(0,"div",12),w(1,"vedius-avatar",13),m(2,"div",14)(3,"vedius-text",15),v(4),h(),m(5,"div",16)(6,"span",17),v(7),h(),m(8,"vedius-text",18),v(9),x(10,"translate"),x(11,"translate"),h()()(),m(12,"vedius-text",19),A("click",function(){D(t);let a=f().$implicit,o=f();return L(o.disableInDashboard(a))}),v(13),x(14,"translate"),h(),m(15,"vedius-button",20),A("onClick",function(){D(t);let a=f().$implicit,o=f();return L(o.redirect(a))}),h()()}if(e&2){let t=f().$implicit;l(),ee("src",t.patientInfo==null||t.patientInfo.imageUrl==null?null:t.patientInfo.imageUrl.url),ee("alt",t.patientInfo==null?null:t.patientInfo.visibleName),l(3),T(" ",t.patientInfo==null?null:t.patientInfo.visibleName," "),l(3),T(" ",t.title," "),l(2),T(" ",t.exerciseQuantity===1?F(10,6,"DASHBOARD_PAGE.EXPIRED_PROGRAMS_DASHBOARD_MODAL.SINGLE_TOTAL_OF_EXERCISES",V(14,mc,t.exerciseQuantity)):F(11,9,"DASHBOARD_PAGE.EXPIRED_PROGRAMS_DASHBOARD_MODAL.PLURAL_TOTAL_OF_EXERCISES",V(16,mc,t.exerciseQuantity))," "),l(4),T(" ",S(14,12,"DASHBOARD_PAGE.EXPIRED_PROGRAMS_DASHBOARD_MODAL.DISCARD"),"")}}function _h(e,n){e&1&&w(0,"ngx-skeleton-loader",21),e&2&&p("count",1)("theme",Q(2,gh))}function xh(e,n){if(e&1&&(P(0),m(1,"div",8)(2,"li",9),C(3,fh,16,18,"div",10)(4,_h,1,3,"ngx-skeleton-loader",11),h()(),E()),e&2){let t=n.$implicit,i=f();l(3),p("ngIf",i.discardingProgramUid!==t.key.protocolKey.value),l(),p("ngIf",i.discardingProgramUid===t.key.protocolKey.value)}}function vh(e,n){if(e&1&&(P(0),v(1),x(2,"translate"),x(3,"translate"),E()),e&2){let t=f();l(),T(" ",t.expiredCount===1?F(2,1,"DASHBOARD_PAGE.EXPIRED_PROGRAMS_DASHBOARD_MODAL.SINGLE_TOTAL_EXPIRING_INFO",V(7,hc,t.expiredCount)):F(3,4,"DASHBOARD_PAGE.EXPIRED_PROGRAMS_DASHBOARD_MODAL.PLURAL_TOTAL_EXPIRING_INFO",V(9,hc,t.expiredCount))," ")}}var uc=(()=>{let n=class n{constructor(i,a,o,r,s,c){this.programDetailsRouteStrategy=i,this.programService=a,this.toastService=o,this.trackingErrorCore=r,this.expiredProgramsDashboardChangeService=s,this.data=c,this.modal=null,this.programs=[],this.discardingProgramUid="",this.programs=c.programs||[]}get expiredCount(){return this.programs.length}disableInDashboard(i){this.discardingProgramUid=i.key.protocolKey.value,this.programService.updateDashboardProgramActivation({programKey:i.key,activated:!1}).then(()=>{this.programs=this.programs.filter(a=>a.key.protocolKey.value!==i.key.protocolKey.value),this.expiredProgramsDashboardChangeService.notifyProgramDashboardDisabled(i.key),this.programs.length===0&&this.close()}).catch(a=>{console.error("Error to disable expired program: ",a),this.toastService.showDefaultErrorMessage(),this.trackingErrorCore.onCaptureException(a)}).finally(()=>this.discardingProgramUid="")}redirect(i){this.programDetailsRouteStrategy.setFromDashboardScreen(!0),this.programDetailsRouteStrategy.redirect(i.key.protocolKey.value),this.close()}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(Nl),y(ya),y(dt),y(ta),y(Pa),y(St))},n.\u0275cmp=O({type:n,selectors:[["app-expired-programs-dashboard-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:13,vars:11,consts:[[1,"expired-programs-dashboard-modal"],[1,"title"],[1,"expired-list-items"],[4,"ngFor","ngForOf"],[1,"bottom"],[3,"ngClass"],[4,"ngIf"],["variant","secondary",3,"onClick"],[1,"expired-list-item-wrapper"],[1,"expired-list-item"],["class","expired-list-item-content",4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],[1,"expired-list-item-content"],["size","medium",3,"src","alt"],[1,"program-exercise-info-content"],["variant","text","size","sm",1,"patient-name","neutral-dusk-color"],[1,"program-exercise-info"],[1,"title-text"],["variant","text","size","micro","fontFamily","font-family-secundary",1,"neutral-dark-color"],["tabindex","0","variant","text","size","sm",1,"discard",3,"click"],["variant","tertiary","icon","arrow","iconType","only",1,"redirect-button",3,"onClick"],[1,"loader",3,"count","theme"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"ul",2),C(6,xh,5,2,"ng-container",3),h(),m(7,"div",4)(8,"span",5),C(9,vh,4,11,"ng-container",6),h(),m(10,"vedius-button",7),A("onClick",function(){return o.close()}),v(11),x(12,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,5,"DASHBOARD_PAGE.EXPIRED_PROGRAMS_DASHBOARD_MODAL.TITLE")," "),l(3),p("ngForOf",o.programs),l(2),p("ngClass",V(9,uh,o.expiredCount>0)),l(),p("ngIf",o.expiredCount>=1),l(2),W(S(12,7,"BUTTONS.CLOSE")))},dependencies:[q,le,z,At,j,re,Ee,Pe,yt,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;
2-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.expired-programs-dashboard-modal{display:flex;flex-direction:column;gap:40px}.expired-programs-dashboard-modal .neutral-dusk-color{color:#192840}.expired-programs-dashboard-modal .neutral-dark-color{color:#6d7a8e}.expired-programs-dashboard-modal .loader{width:100%}.expired-programs-dashboard-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center}.expired-programs-dashboard-modal .expired-list-items{width:100%;display:flex;flex-direction:column;gap:24px;list-style:none;margin:0;padding:0}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper{position:relative}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item{width:100%;transition:.2s all;outline:none}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content{width:100%;display:flex;padding:12px;gap:24px;align-items:center;align-self:stretch}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .program-exercise-info-content{width:100%;display:flex;gap:24px;align-items:center;align-self:stretch}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .patient-name{width:110px}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .program-exercise-info{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 0 0;width:calc(100% - 352px);max-width:153px}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .program-exercise-info .title-text{color:#192840;font-family:DM Sans;font-size:.875rem;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:calc(100% - 5px)}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .discard{color:#1570ef}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .discard:hover{cursor:pointer;opacity:.8}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .redirect-button button mat-icon{transform:rotate(270deg);width:24px;height:24px;stroke:#425168}.expired-programs-dashboard-modal ul{padding:0;margin:0;list-style:none}.expired-programs-dashboard-modal .bottom{display:flex;align-items:center;justify-content:space-between}.expired-programs-dashboard-modal .bottom span{color:#192840;font-family:DM Sans;font-size:1rem;font-weight:500;line-height:1.5rem}.expired-programs-dashboard-modal .bottom span.warning{color:#7c4805}@media screen and (max-width: 600px){.expired-programs-dashboard-modal .title{font-size:1.25rem;line-height:1.875rem;margin-top:0;max-width:250px}.expired-programs-dashboard-modal .expired-list-items{max-height:100%}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content{gap:16px}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .patient-name{width:100%}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .program-exercise-info-content{flex-direction:column;align-items:flex-start;gap:4px;max-width:calc(100% - 200px)}.expired-programs-dashboard-modal .expired-list-items .expired-list-item-wrapper .expired-list-item .expired-list-item-content .program-exercise-info-content .program-exercise-info{width:calc(100% - 4px)}} 3`],encapsulation:2});let e=n;return e})();var Ea=(()=>{let n=class n{constructor(){this._unansweredEvaluationQuestionnaireDisabledSubject=ne
3w $t(void 0)}notifyUnansweredEvaluationQuestionnaireDashboardDisabled(i){this._unansweredEvaluationQuestionnaireDisabledSubject.next(i)}get unansweredEvaluationQuestionnaireDashboardDisabled(){return this._unansweredEvaluationQuestionnaireDisabledSubject.asObservable()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var yh=e=>({warning:e}),fc=e=>({total:e}),Ch=()=>({height:"56px"}),_c=e=>({value:e});function Th(e,n){if(e&1){let t=I();m(0,"div",12),w(1,"vedius-avatar",13),m(2,"div",14)(3,"vedius-text",15),v(4),h(),m(5,"div",16)(6,"span",17),v(7),h(),m(8,"vedius-text",18),v(9),x(10,"translate"),x(11,"translate"),h()()(),m(12,"vedius-text",19),A("click",function(){D(t);let a=f().$implicit,o=f();return L(o.disableInDashboard(a))}),v(13),x(14,"translate"),h(),m(15,"vedius-button",20),A("onClick",function(){D(t);let a=f().$implicit,o=f();return L(o.redirect(a))}),h()()}if(e&2){let t=f().$implicit;l(),ee("src",t.patientInfo.imageUrl==null?null:t.patientInfo.imageUrl.url),ee("alt",t.patientInfo.visibleName),l(3),T(" ",t.patientInfo.visibleName," "),l(3),T(" ",t.title," "),l(2),T(" ",t.totalOfQuestions===1?F(10,6,"DASHBOARD_PAGE.UNANSWERED_EVALUATION_QUEST_DASHBOARD_MODAL.SINGLE_TOTAL_OF_QUESTIONS",V(14,fc,t.totalOfQuestions)):F(11,9,"DASHBOARD_PAGE.UNANSWERED_EVALUATION_QUEST_DASHBOARD_MODAL.PLURAL_TOTAL_OF_QUESTIONS",V(16,fc,t.totalOfQuestions))," "),l(4),T(" ",S(14,12,"DASHBOARD_PAGE.UNANSWERED_EVALUATION_QUEST_DASHBOARD_MODAL.DISCARD"),"")}}function Sh(e,n){e&1&&w(0,"ngx-skeleton-loader",21),e&2&&p("count",1)("theme",Q(2,Ch))}function wh(e,n){if(e&1&&(P(0),m(1,"div",8)(2,"li",9),C(3,Th,16,18,"div",10)(4,Sh,1,3,"ngx-skeleton-loader",11),h()(),E()),e&2){let t=n.$implicit,i=f();l(3),p("ngIf",i.discardingUid!==t.key.value),l(),p("ngIf",i.discardingUid===t.key.value)}}function Ah(e,n){if(e&1&&(P(0),v(1),x(2,"translate"),x(3,"translate"),E()),e&2){let t=f();l(),T(" ",t.unansweredCount===1?F(2,1,"DASHBOARD_PAGE.UNANSWERED_EVALUATION_QUEST_DASHBOARD_MODAL.SINGLE_TOTAL_INFO",V(7,_c,t.unansweredCount)):F(3,4,"DASHBOARD_PAGE.UNANSWERED_EVALUATION_QUEST_DASHBOARD_MODAL.PLURAL_TOTAL_INFO",V(9,_c,t.unansweredCount))," ")}}var xc=(()=>{let n=class n{constructor(i,a,o,r,s){this.toastService=i,this.evaluationQuestionnaireService=a,this.unansweredEvaluationQuestionnaireDashboardChangeService=o,this.patientManagementRouteStrategy=r,this.data=s,this.modal=null,this.unansweredEvaluationQuestionnaire=[],this.discardingUid="",this.unansweredEvaluationQuestionnaire=s.unansweredEvaluationQuestionnaire||[]}get unansweredCount(){return this.unansweredEvaluationQuestionnaire.length}disableInDashboard(i){this.discardingUid=i.key.value,this.evaluationQuestionnaireService.updateDashboardProgramSentActivation({key:i.key,activated:!1}).then(()=>{this.unansweredEvaluationQuestionnaire=this.unansweredEvaluationQuestionnaire.filter(a=>a.key.value!==i.key.value),this.unansweredEvaluationQuestionnaireDashboardChangeService.notifyUnansweredEvaluationQuestionnaireDashboardDisabled(i.key),this.unansweredEvaluationQuestionnaire.length===0&&this.close()}).catch(a=>{console.error("Error to disable unanswered evaluation questionnaire: ",a),this.toastService.showDefaultErrorMessage()}).finally(()=>this.discardingUid="")}redirect(i){this.patientManagementRouteStrategy.setConfig({patientManagementState:Ta.Medical_Record,backTo:"dashboard",extendsObject:{scrollToId:i.key.value}}),this.patientManagementRouteStrategy.redirect(i.patientInfo.key.patientKey.value),this.close()}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(dt),y(zl),y(Ea),y(Sa),y(St))},n.\u0275cmp=O({type:n,selectors:[["app-unanswered-evaluation-questionnaire-dashboard-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:13,vars:11,consts:[[1,"unanswered-evaluation-questionnaire-dashboard-modal"],[1,"title"],[1,"unanswered-list-items"],[4,"ngFor","ngForOf"],[1,"bottom"],[3,"ngClass"],[4,"ngIf"],["variant","secondary",3,"onClick"],[1,"unanswered-list-item-wrapper"],[1,"unanswered-list-item"],["class","unanswered-list-item-content",4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],[1,"unanswered-list-item-content"],["size","medium",3,"src","alt"],[1,"unanswered-info-content"],["variant","text","size","sm",1,"patient-name","neutral-dusk-color"],[1,"unanswered-evaluation-quest-info"],[1,"title-text"],["variant","text","size","micro","fontFamily","font-family-secundary",1,"neutral-dark-color"],["tabindex","0","variant","text","size","sm",1,"discard",3,"click"],["variant","tertiary","icon","arrow","iconType","only",1,"redirect-button",3,"onClick"],[1,"loader",3,"count","theme"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"ul",2),C(6,wh,5,2,"ng-container",3),h(),m(7,"div",4)(8,"span",5),C(9,Ah,4,11,"ng-container",6),h(),m(10,"vedius-button",7),A("onClick",function(){return o.close()}),v(11),x(12,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,5,"DASHBOARD_PAGE.UNANSWERED_EVALUATION_QUEST_DASHBOARD_MODAL.TITLE")," "),l(3),p("ngForOf",o.unansweredEvaluationQuestionnaire),l(2),p("ngClass",V(9,yh,o.unansweredCount>0)),l(),p("ngIf",o.unansweredCount>=1),l(2),W(S(12,7,"BUTTONS.CLOSE")))},dependencies:[q,le,z,At,j,re,Ee,Pe,yt,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;
3-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.unanswered-evaluation-questionnaire-dashboard-modal{display:flex;flex-direction:column;gap:40px}.unanswered-evaluation-questionnaire-dashboard-modal .neutral-dusk-color{color:#192840}.unanswered-evaluation-questionnaire-dashboard-modal .neutral-dark-color{color:#6d7a8e}.unanswered-evaluation-questionnaire-dashboard-modal .loader{width:100%}.unanswered-evaluation-questionnaire-dashboard-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items{width:100%;display:flex;flex-direction:column;gap:24px;list-style:none;margin:0;padding:0;max-width:535px;max-height:calc(100vh - 300px);overflow:auto}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper{position:relative}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item{width:100%;transition:.2s all;outline:none}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content{width:100%;display:flex;padding:12px;gap:24px;align-items:center;align-self:stretch;box-sizing:border-box}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .patient-name{width:110px}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .unanswered-info-content{width:100%;display:flex;gap:24px;align-items:center;align-self:stretch}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .unanswered-evaluation-quest-info{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 0 0;width:calc(100% - 352px);max-width:153px}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .unanswered-evaluation-quest-info .title-text{color:#192840;font-family:DM Sans;font-size:.875rem;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:calc(100% - 5px)}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .discard{color:#1570ef}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .discard:hover{cursor:pointer;opacity:.8}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .redirect-button button mat-icon{transform:rotate(270deg);width:24px;height:24px;stroke:#425168}.unanswered-evaluation-questionnaire-dashboard-modal ul{padding:0;margin:0;list-style:none}.unanswered-evaluation-questionnaire-dashboard-modal .bottom{display:flex;align-items:center;justify-content:space-between;gap:16px}.unanswered-evaluation-questionnaire-dashboard-modal .bottom span{color:#192840;font-family:DM Sans;font-size:1rem;font-weight:500;line-height:1.5rem}.unanswered-evaluation-questionnaire-dashboard-modal .bottom span.warning{color:#7c4805}@media screen and (max-width: 600px){.unanswered-evaluation-questionnaire-dashboard-modal .title{font-size:1.25rem;line-height:1.875rem;margin-top:0;max-width:250px}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items{max-height:100%}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content{gap:16px}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .patient-name{width:100%}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .unanswered-info-content{flex-direction:column;align-items:flex-start;gap:4px;max-width:calc(100% - 200px)}.unanswered-evaluation-questionnaire-dashboard-modal .unanswered-list-items .unanswered-list-item-wrapper .unanswered-list-item .unanswered-list-item-content .unanswered-info-content .unanswered-evaluation-quest-info{width:calc(100% - 4px)}} 4`],encapsulation:2});let e=n;return e})();var gn=function(e){return e.MONTH="MONTH",e}(gn||{});var Rt=class{constructor(n,t,i){this._key=n,this._goal=t,this._professional=i}get key(){return this._key}get goal(){return this._goal}get professional(){return this._professional}get periodType(){return gn.MONTH}toFuncDocument(){return{uid:this.key.value,professional_uid:this.professional.key.value,period_type_value:this.key.periodTypeValue,goal:this.goal.value,period_type:this.periodType}}};var Ma=class e{constructor(n){this._value=n}static fromMonthlyNow(){let n=new Date,t=n.getFullYear(),i=n.getMonth()+1,a=t*100+i;return new e(a.toString())}get value(){return this._value}},Nt=class e{constructor(n,t,i){this._userVediusKey=n,this._value=t,this._periodTypeValue=i}static new(n){let t=new Date,i=t.getFullYear(),a=t.getMonth()+1,o=i*100+a,r=na();return new e(n,r,o.toString())}static from(n,t,i){return new e(n,t,i)}get userVediusKey(){return this._userVediusKey}get value(){return this._value}get periodTypeValue(){return this._periodTypeValue}};var Oa=(()=>{let n=class n{constructor(i){this.localeContext=i}transform(i){return isNaN(i)?"":$o.create(this.localeContext.current).format(i)}};n.\u0275fac=function(a){return new(a||n)(y(st,16))},n.\u0275pipe=Oi({name:"vediusCurrencyOnlyNumber",type:n,pure:!0});let e=n;return e})(),$o=class{static create(n){return n===vi?new Xo:new Wo}}
4,Wo=class{format(n){return n.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2})}},Xo=class{format(n){return n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}};var vc=(()=>{let n=class n extends Ct{constructor(i){super(),this.professionalParser=i}parseDocument(i){let{data:a,collaborators:o}=i,r=this.professionalParser.parseDocument({professionalId:a.professional_uid,professionals:o}),s=Nt.from(r.key,a.uid,a.period_type_value),c=a.goal?Tt.fromString(a.goal?.toString()):Tt.zero;return new Rt(s,c,r)}parseFromJson(i){let{_key:a,_goal:o,_professional:r}=i,s=this.professionalParser.parseFromJson(r),c=Nt.from(s.key,a._value,a._periodTypeValue),d=o?Tt.fromString(o._value?.toString()):Tt.zero;return new Rt(c,d,s)}};n.\u0275fac=function(a){return new(a||n)(G(Zs))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var bc=(()=>{let n=class n{constructor(i,a){this.monthlyBillingGoalParser=i,this.translation=a}create(i){if(i===gn.MONTH)return this.monthlyBillingGoalParser;throw new Ls({message:this.translation.get(U.BillingGoalParserNotImplemented)})}};n.\u0275fac=function(a){return new(a||n)(G(vc),G(ae))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var yc=(()=>{let n=class n extends Ct{constructor(i){super(),this.billingGoalFactoryParser=i}parseDocument(i){return this.billingGoalFactoryParser.create(i.data.period_type).parseDocument(i)}parseFromJson(i){return this.billingGoalFactoryParser.create(i.data.period_type).parseFromJson(i)}};n.\u0275fac=function(a){return new(a||n)(G(bc))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Sc=(()=>{let n=class n{constructor(i,a,o,r,s){this.firestore=i,this.firebaseErrorHandler=a,this.billingGoalParser=o,this.userVediusContext=r,this.afFunc=s}get(r){return B(this,arguments,function*({periodTypeValue:i,professionalKey:a,userVediusReferenceKey:o}){try{let s=gi(this.firestore,kt.Finance,o.value,kt.BillingGoal),c=_i(s,gt("professional_uid","==",a.value),gt("period_type_value","==",i.value)),d=yield fi(c);if(!d.empty){let k=d.docs[0];return this.billingGoalParser.parseDocument({data:k.data(),collaborators:this.userVediusContext.getCollaboratorsOrDefault()})}let u=_i(s,gt("professional_uid","==",a.value),Is("period_type_value","desc"),Ms(1)),g=yield fi(u);if(g.empty)return null;let _=g.docs[0],b=this.billingGoalParser.parseDocument({data:_.data(),collaborators:this.userVediusContext.getCollaboratorsOrDefault()});return yield this.save({billingGoal:new Rt(Nt.from(a,na(),i.value),b.goal,b.professional)}),this.get({periodTypeValue:i,professionalKey:a,userVediusReferenceKey:o})}catch(s){throw this.firebaseErrorHandler.handleError(s)}})}save(a){return B(this,arguments,function*({billingGoal:i}){try{let o=El.SAVE_FINANCE_BILLING_GOAL,r=yield this.afFunc.httpsCallable(o,{billing_goal:i.toFuncDocument()});if(!r.success)throw new ia({message:r.message})}catch(o){throw this.firebaseErrorHandler.handleError(o)}})}};n.\u0275fac=function(a){return new(a||n)(G(Bi),G(Ni),G(yc),G(Te),G(Ws))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Ia=(()=>{let n=class n{constructor(i,a){this.userVediusReferenceKeyFactoryService=i,this.financeBillingGoalRepository=a}getCurrentMonthlyBillingGoalForProfessional(a){return B(this,arguments,function*({professionalKey:i}){let o=this.userVediusReferenceKeyFactoryService.create(xi.CLINIC_OR_DEFAULT_KEY),r=Ma.fromMonthlyNow();return yield this.financeBillingGoalRepository.get({periodTypeValue:r,professionalKey:i,userVediusReferenceKey:o})})}save(a){return B(this,arguments,function*({billingGoal:i}){yield this.financeBillingGoalRepository.save({billingGoal:i})})}};n.\u0275fac=function(a){return new(a||n)(G(Gi),G(Sc))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Fa=(()=>{let n=class n{constructor(i){this.appLocale=i}create(){return this.appLocale.current===vi?"$":"R$"}};n.\u0275fac=function(a){return new(a||n)(G(st))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();function Oh(e,n){e&1&&(P(0),v(1),x(2,"translate"),E()),e&2&&(l(),T(" ",S(2,1,"SAVE_BILLING_GOAL_MODAL.INPUTS.GOAL.ERROR_REQUIRED")," "))}function Ih(e,n){e&1&&(P(0),v(1),x(2,"translate"),E()),e&2&&(l(),T(" ",S(2,1,"SAVE_BILLING_GOAL_MODAL.INPUTS.GOAL.ERROR_NEGATIVE")," "))}function Fh(e,n){if(e&1&&C(0,Oh,3,3,"ng-container",15)(1,Ih,3,3,"ng-container",15),e&2){let t=f();p("ngIf",t.goalControl.hasError("required")),l(),p("ngIf",t.goalControl.hasError("negativeValue"))}}var Dc=(()=>{let n=class n{constructor(i,a,o,r){this.formBuilder=i,this.financeBillingGoalService=a,this.currencySymbolFactoryService=o,this.data=r,this.modal=null,this.currencySymbol="",this.isLoading=!1,this.billingGoal=r.billingGoal||void 0,this.userVedius=r.userVedius,this.currencySymbol=this.currencySymbolFactoryService.create(),this.goal=this.billingGoal?.goal?.value||0,this.form=this.formBuilder.group({goal:new Jn(this.goal,[Cs.required,Il])})}get goalControl(){return this.form.get("goal")}submit(){try{if(!this.formHasErrors()){this.isLoading=!0;let i=this.createBillingGoal();this.financeBillingGoalService.save({billingGoal:i}).then(()=>{this.modal?.close(i)}).catch(a=>console.error(a)).finally(()=>this.isLoading=!1)}}catch(i){console.log(i),this.isLoading=!1}}createBillingGoal(){let i=Tt.fromNumber(this.goalControl.value),a=this.billingGoal?.key||Nt.new(this.userVedius.key);return new Rt(a,i,this.userVedius)}formHasErrors(){return Ks(this.form),!this.form.valid}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(ea),y(Ia),y(Fa),y(St))},n.\u0275cmp=O({type:n,selectors:[["app-save-billing-goal-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:29,vars:26,consts:[["goalErrorTemplate",""],[1,"save-billing-goal-modal"],[1,"title"],[1,"billing-goal-content"],[1,"current-goal-info"],["variant","text","size","sm",1,"neutral-dark-color"],[1,"current-value"],["variant","text","size","md",1,"neutral-medium-color"],["variant","display","size","micro",1,"color-neutral-dusk","value"],[1,"balance-form",3,"submit","formGroup"],["type","money",3,"selectOnFocus","label","control","errorTemplate"],[1,"bottom-content"],["variant","tertiary",3,"onClick","fullSize"],["type","submit","variant","primary",3,"fullSize"],[3,"active"],[4,"ngIf"]],template:function(a,o){if(a&1){let r=I();m(0,"vedius-modal")(1,"div",1)(2,"h1",2),v(3),x(4,"translate"),h(),m(5,"div",3)(6,"div",4)(7,"vedius-text",5),v(8),x(9,"translate"),h(),m(10,"div",6)(11,"vedius-text",7),v(12),h(),m(13,"vedius-text",8),v(14),x(15,"vediusCurrencyOnlyNumber"),h()()(),m(16,"form",9),A("submit",function(){return D(r),L(o.submit())}),m(17,"vedius-input",10),x(18,"translate"),C(19,Fh,2,2,"ng-template",null,0,me),h(),m(21,"div",11)(22,"vedius-button",12),A("onClick",function(){return D(r),L(o.close())}),v(23),x(24,"translate"),h(),m(25,"vedius-button",13),v(26),x(27,"translate"),h()()()()(),w(28,"vedius-page-loading",14),h()}if(a&2){let r=he(20);l(3),T(" ",S(4,14,"SAVE_BILLING_GOAL_MODAL.TITLE")," "),l(5),T(" ",S(9,16,"SAVE_BILLING_GOAL_MODAL.CURRENT_GOAL_LABEL")," "),l(4),W(o.currencySymbol),l(2),W(S(15,18,o.goal)),l(2),p("formGroup",o.form),l(),ee("label",S(18,20,"SAVE_BILLING_GOAL_MODAL.INPUTS.GOAL.LABEL")),p("selectOnFocus",!0)("control",o.goalControl)("errorTemplate",r),l(5),p("fullSize",!0),l(),W(S(24,22,"BUTTONS.CANCEL")),l(2),p("fullSize",!0),l(),W(S(27,24,"BUTTONS.SAVE")),l(2),p("active",o.isLoading)}},dependencies:[z,q,j,As,Ss,Ts,ws,la,re,ca,$,Y,Oa],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;
4-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.save-billing-goal-modal{display:flex;flex-direction:column;gap:40px}.save-billing-goal-modal .neutral-dusk-color{color:#192840}.save-billing-goal-modal .neutral-dark-color{color:#6d7a8e}.save-billing-goal-modal .neutral-medium-color{color:#96a0b0}.save-billing-goal-modal .loader{width:100%}.save-billing-goal-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:4px 0 0}.save-billing-goal-modal .billing-goal-content{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:40px}.save-billing-goal-modal .billing-goal-content form{width:100%}.save-billing-goal-modal .billing-goal-content form mat-form-field{width:100%}.save-billing-goal-modal .billing-goal-content .current-goal-info{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.save-billing-goal-modal .billing-goal-content .current-goal-info .current-value{display:flex;align-items:flex-end;gap:8px}.save-billing-goal-modal .bottom-content{margin-top:64px;width:100%;display:flex;justify-content:flex-end;gap:24px}@media screen and (max-width: 600px){.save-billing-goal-modal .title{font-size:1.25rem;line-height:1.875rem;margin-top:12px;max-width:300px}.save-billing-goal-modal .bottom-content{flex-direction:column-reverse}.save-billing-goal-modal .bottom-content vedius-button{width:100%}} 5`],encapsulation:2});let e=n;return e})();var Ba=(()=>{let n=class n{constructor(){this._patientProtocolReportsDisabledSubject=ne
5w $t(void 0)}notifyPatientProtocolReportsDisabled(i){this._patientProtocolReportsDisabledSubject.next(i)}get patientProtocolReportDisabled(){return this._patientProtocolReportsDisabledSubject.asObservable()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Uo=function(e){return e[e.NONE=0]="NONE",e[e.LOW=3]="LOW",e[e.MEDIUM=8]="MEDIUM",e[e.HIGH=9]="HIGH",e}(Uo||{});var fn=class e{constructor(n,t){this._patientInfo=n,this._programReport=t}static from({patientInfo:n,programReport:t}){return new e(n,t)}get programReportKey(){return this._programReport.key}get patientInfo(){return this._patientInfo}get programReport(){return this._programReport}};var Pc=(()=>{let n=class n extends Ct{constructor(i,a){super(),this.programReportParser=i,this.patientInfoParser=a}parseDocument({program:i,exercises:a,report_data:o}){let r=this.programReportParser.parseDocument({program:i,exercises:a,report_data:o});return fn.from({patientInfo:i.patientInfo,programReport:r})}parseFromJson(i){let{_patientInfo:a,_programReport:o}=i,r=this.patientInfoParser.parseFromJson(a),s=this.programReportParser.parseFromJson(o);return fn.from({patientInfo:r,programReport:s})}};n.\u0275fac=function(a){return new(a||n)(G($l),G(al))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Ec=(()=>{let n=class n extends Ct{constructor(i,a,o){super(),this.patientProgramReportParser=i,this.programParser=a,this.exerciseParser=o}parseDocument({data:i,collaborators:a}){let o=i.protocol,r=i.feedback_report,s=i.feedback_report.exercises||[],c=i.patient,d=s.map(b=>this.exerciseParser.parseDocument({data:b,uid:b.exerciseDocId||b.id||""}));o.professional_uid=o?.ownerId||o.professional_uid||"",o.uid=o?.id||o.uid||"",o.patient_name=c.name||"",o.patient_url_image=c.url_image||"";let u=d.map(b=>({exerciseId:b.key.value}));o.protocol_exercises=u;let g=this.programParser.parseDocument({data:o,professionals:a,exercises:d});return this.patientProgramReportParser.parseDocument({program:g,exercises:d,report_data:r})}parseFromJson(i){return this.patientProgramReportParser.parseFromJson(i)}};n.\u0275fac=function(a){return new(a||n)(G(Pc),G(wl),G(Js))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Mc=(()=>{let n=class n{constructor(i,a,o,r,s){this.firebaseErrorHandler=i,this.firestore=a,this.allPatientProgramReportParser=o,this.userVediusContext=r,this.saasApiClient=s}getAllIntensePainProtocol(r){return B(this,arguments,function*({period:i,professional:a,userVediusReferenceKey:o}){try{let s=gi(this.firestore,zo.Reports,o.key.value,zo.AllPatientProtocolReports),c=_i(s,gt("created_date",">=",i.start),gt("created_date","<=",i.end),gt("professional_uid","==",a.key.value)),d=yield fi(c);if(d.empty)return[];let u=[];return d.docs.forEach(_=>{let b=_.data(),k=b.feedback_report?.feedback?.find(M=>M.id==="pain");b.dashboard_activated!==!1&&k?.value&&k.value>=Uo.HIGH&&u.push(b)}),u.map(_=>this.allPatientProgramReportParser.parseDocument({data:_,collaborators:this.userVediusContext.getCollaboratorsOrDefault()}))}catch(s){throw this.firebaseErrorHandler.handleError(s)}})}updateDashboardPatientProtocolReportActivation(o){return B(this,arguments,function*({reportKey:i,activated:a}){try{let r=yield this.saasApiClient.post({functionName:Gl.UPDATE_DASHBOARD_PROTOCOL_REPORT_ACTIVATION,payload:{report_uid:i.value,dashboard_activated:a}});if(!r.success)throw new ia({message:r.message})}catch(r){throw this.firebaseErrorHandler.handleError(r)}})}};n.\u0275fac=function(a){return new(a||n)(G(Ni),G(Bi),G(Ec),G(Te),G(el))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Va=(()=>{let n=class n{constructor(i,a){this.userVediusReferenceKeyFactoryService=i,this.allPatientProtocolReportRepository=a}getAllIntensePainProtocol(o){return B(this,arguments,function*({period:i,professional:a}){let r=this.userVediusReferenceKeyFactoryService.create(xi.CLINIC_OR_DEFAULT_KEY);return yield this.allPatientProtocolReportRepository.getAllIntensePainProtocol({period:i,professional:a,userVediusReferenceKey:r})})}updateDashboardPatientProtocolReportActivation(o){return B(this,arguments,function*({reportKey:i,activated:a}){return yield this.allPatientProtocolReportRepository.updateDashboardPatientProtocolReportActivation({reportKey:i,activated:a})})}};n.\u0275fac=function(a){return new(a||n)(G(Gi),G(Mc))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Nh=e=>({warning:e}),Ic=e=>({total:e}),Gh=()=>({height:"56px"}),Fc=e=>({value:e});function zh(e,n){if(e&1){let t=I();m(0,"div",12),w(1,"vedius-avatar",13),m(2,"div",14)(3,"vedius-text",15),v(4),h(),m(5,"div",16)(6,"span",17),v(7),h(),m(8,"vedius-text",18),v(9),x(10,"translate"),x(11,"translate"),h()()(),m(12,"vedius-text",19),A("click",function(){D(t);let a=f().$implicit,o=f();return L(o.disableInDashboard(a))}),v(13),x(14,"translate"),h(),m(15,"vedius-button",20),A("onClick",function(){D(t);let a=f().$implicit,o=f();return L(o.redirect(a))}),h()()}if(e&2){let t=f().$implicit;l(),ee("src",t.patientInfo.imageUrl==null?null:t.patientInfo.imageUrl.url),ee("alt",t.patientInfo.visibleName),l(3),T(" ",t.patientInfo.visibleName," "),l(3),T(" ",t.programReport.program.title," "),l(2),T(" ",t.programReport.programExercisesQuantity===1?F(10,6,"DASHBOARD_PAGE.PATIENT_PROTOCOL_REPORTS_MODAL.SINGLE_TOTAL_OF_EXERCISES",V(14,Ic,t.programReport.programExercisesQuantity)):F(11,9,"DASHBOARD_PAGE.PATIENT_PROTOCOL_REPORTS_MODAL.PLURAL_TOTAL_OF_EXERCISES",V(16,Ic,t.programReport.programExercisesQuantity))," "),l(4),T(" ",S(14,12,"DASHBOARD_PAGE.PATIENT_PROTOCOL_REPORTS_MODAL.DISCARD"),"")}}function Hh(e,n){e&1&&w(0,"ngx-skeleton-loader",21),e&2&&p("count",1)("theme",Q(2,Gh))}function jh(e,n){if(e&1&&(P(0),m(1,"div",8)(2,"li",9),C(3,zh,16,18,"div",10)(4,Hh,1,3,"ngx-skeleton-loader",11),h()(),E()),e&2){let t=n.$implicit,i=f();l(3),p("ngIf",i.discardingProgramReportKeyUid!==t.programReportKey.value),l(),p("ngIf",i.discardingProgramReportKeyUid===t.programReportKey.value)}}function Yh(e,n){if(e&1&&(P(0),v(1),x(2,"translate"),x(3,"translate"),E()),e&2){let t=f();l(),T(" ",t.patientProtocolsReportsCount===1?F(2,1,"DASHBOARD_PAGE.PATIENT_PROTOCOL_REPORTS_MODAL.SINGLE_TOTAL_INFO",V(7,Fc,t.patientProtocolsReportsCount)):F(3,4,"DASHBOARD_PAGE.PATIENT_PROTOCOL_REPORTS_MODAL.PLURAL_TOTAL_INFO",V(9,Fc,t.patientProtocolsReportsCount))," ")}}var Bc=(()=>{let n=class n{constructor(i,a,o,r,s){this.patientProtocolReportsDashboardChangeService=i,this.allPatientProtocolReportService=a,this.patientManagementRouteStrategy=o,this.toastService=r,this.data=s,this.modal=null,this.patientProgramReports=[],this.discardingProgramReportKeyUid="",this.patientProgramReports=s.patientProgramReports||[]}get patientProtocolsReportsCount(){return this.patientProgramReports.length}disableInDashboard(i){this.discardingProgramReportKeyUid=i.programReportKey.value,this.allPatientProtocolReportService.updateDashboardPatientProtocolReportActivation({reportKey:i.programReportKey,activated:!1}).then(()=>{this.patientProgramReports=this.patientProgramReports.filter(a=>a.programReportKey.value!==i.programReportKey.value),this.patientProtocolReportsDashboardChangeService.n
5otifyPatientProtocolReportsDisabled(i.programReportKey),this.patientProgramReports.length===0&&this.close()}).catch(a=>{console.error("Error to disable patient protocol reports: ",a),this.toastService.showDefaultErrorMessage()}).finally(()=>this.discardingProgramReportKeyUid="")}redirect(i){this.patientManagementRouteStrategy.setConfig({patientManagementState:Ta.Monitoring,backTo:"back-location",queryParams:{programa:i.programReport.program.protocolKey.value,data:i.programReport.createdAt}}),this.patientManagementRouteStrategy.redirect(i.patientInfo.key.patientKey.value),this.close()}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(Ba),y(Va),y(Sa),y(dt),y(St))},n.\u0275cmp=O({type:n,selectors:[["app-patient-protocol-reports-dashboard-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:13,vars:11,consts:[[1,"patient-protocol-reports-dashboard-modal"],[1,"title"],[1,"patient-protocol-reports-list-items"],[4,"ngFor","ngForOf"],[1,"bottom"],[3,"ngClass"],[4,"ngIf"],["variant","secondary",3,"onClick"],[1,"patient-protocol-reports-list-item-wrapper"],[1,"patient-protocol-reports-list-item"],["class","patient-protocol-reports-list-item-content",4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],[1,"patient-protocol-reports-list-item-content"],["size","medium",3,"src","alt"],[1,"patient-protocol-report-info-content"],["variant","text","size","sm",1,"patient-name","neutral-dusk-color"],[1,"patient-protocol-report-exercise-info"],[1,"title-text"],["variant","text","size","micro","fontFamily","font-family-secundary",1,"neutral-dark-color"],["tabindex","0","variant","text","size","sm",1,"discard",3,"click"],["variant","tertiary","icon","arrow","iconType","only",1,"redirect-button",3,"onClick"],[1,"loader",3,"count","theme"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"ul",2),C(6,jh,5,2,"ng-container",3),h(),m(7,"div",4)(8,"span",5),C(9,Yh,4,11,"ng-container",6),h(),m(10,"vedius-button",7),A("onClick",function(){return o.close()}),v(11),x(12,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,5,"DASHBOARD_PAGE.PATIENT_PROTOCOL_REPORTS_MODAL.TITLE")," "),l(3),p("ngForOf",o.patientProgramReports),l(2),p("ngClass",V(9,Nh,o.patientProtocolsReportsCount>0)),l(),p("ngIf",o.patientProtocolsReportsCount>=1),l(2),W(S(12,7,"BUTTONS.CLOSE")))},dependencies:[q,le,z,At,j,re,Ee,Pe,yt,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.patient-protocol-reports-dashboard-modal{display:flex;flex-direction:column;gap:40px}.patient-protocol-reports-dashboard-modal .neutral-dusk-color{color:#192840}.patient-protocol-reports-dashboard-modal .neutral-dark-color{color:#6d7a8e}.patient-protocol-reports-dashboard-modal .loader{width:100%}.patient-protocol-reports-dashboard-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items{width:100%;display:flex;flex-direction:column;gap:24px;list-style:none;margin:0;padding:0}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper{position:relative}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item{width:100%;transition:.2s all;outline:none}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content{width:100%;display:flex;padding:12px;gap:24px;align-items:center;align-self:stretch}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-protocol-report-info-content{width:100%;display:flex;gap:24px;align-items:center;align-self:stretch}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-name{width:110px}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-protocol-report-exercise-info{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 0 0;width:calc(100% - 352px);max-width:153px}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-protocol-report-exercise-info .title-text{color:#192840;font-family:DM Sans;font-size:.875rem;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:calc(100% - 5px)}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .discard{color:#1570ef}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .discard:hover{cursor:pointer;opacity:.8}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .redirect-button button mat-icon{transform:rotate(270deg);width:24px;height:24px;stroke:#425168}.patient-protocol-reports-dashboard-modal ul{padding:0;margin:0;list-style:none}.patient-protocol-reports-dashboard-modal .bottom{display:flex;align-items:center;justify-content:space-between}.patient-protocol-reports-dashboard-modal .bottom span{color:#192840;font-family:DM Sans;font-size:1rem;font-weight:500;line-height:1.5rem}.patient-protocol-reports-dashboard-modal .bottom span.warning{color:#7c4805}@media screen and (max-width: 600px){.patient-protocol-reports-dashboard-modal .title{font-size:1.25rem;line-height:1.875rem;margin-top:0;max-width:250px}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items{max-height:100%}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content{gap:16px}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-name{width:100%}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-protocol-report-info-content{flex-direction:column;align-items:flex-start;gap:4px;max-width:calc(100% - 200px)}.patient-protocol-reports-dashboard-modal .patient-protocol-reports-list-items .patient-protocol-reports-list-item-wrapper .patient-protocol-reports-list-item .patient-protocol-reports-list-item-content .patient-protocol-report-info-content .patient-protocol-report-exercise-info{width:calc(100% - 4px)}} 6`],encapsulation:2});let e=n;return e})();var $h=()=>({height:"64px"}),it=e=>({value:e}),Wh=()=>({height:"16px"}),Xh=()=>({fractionDigits:0}),Uh=()=>({height:"2px"});function Qh(e,n){e&1&&Ce(0)}function qh(e,n){if(e&1&&(P(0),C(1,Qh,1,0,"ng-container",15),E()),e&2){f(3);let t=he(3);l(),p("ngTemplateOutlet",t)}}function Kh(e,n){e&1&&Ce(0)}function Zh(e,n){if(e&1&&(P(0),C(1,Kh,1,0,"ng-container",15),E()),e&2){f(3);let t=he(5);l(),p("ngTemplateOutlet",t)}}function Jh(e,n){e&1&&Ce(0)}function eu(e,n){if(e&1&&(P(0),C(1,Jh,1,0,"ng-container",15),E()),e&2){f(3);let t=he(7);l(),p("ngTemplateOutlet",t)}}function tu(e,n){e&1&&Ce(0)}function iu(e,n){if(e&1&&(P(0),C(1,tu,1,0,"ng-container",15),E()),e&2){f(3);let t=he(9);l(),p("ngTemplateOutlet",t)}}function nu(e,n){e&1&&Ce(0)}function au(e,n){if(e&1&&(P(0),C(1,nu,1,0,"ng-container",15),E()),e&2){f(3);let t=he(11);l(),p("ngTemplateOutlet",t)}}function ou(e,n){e&1&&Ce(0)}function ru(e,n){if(e&1&&(P(0),C(1,ou,1,0,"ng-container",15),E()),e&2){f(3);let t=he(13);l(),p("ngTemplateOutlet",t)}}function su(e,n){e&1&&Ce(0)}function lu(e,n){if(e&1&&(P(0),C(1,su,1,0,"ng-container",15),E()),e&2){f(3);let t=he(15);l(),p("ngTemplateOutlet",t)}}function cu(e,n){e&1&&w(0,"mat-icon",16)}function du(e,n){if(e&1&&(P(0),m(1,"div",11),w(2,"mat-icon",12),h(),m(3,"div",13),C(4,qh,2,1,"ng-container",9)(5,Zh,2,1,"ng-container",9)(6,eu,2,1,"ng-container",9)(7,iu,2,1,"ng-container",9)(8,au,2,1,"ng-container",9)(9,ru,2,1,"ng-container",9)(10,lu,2,1,"ng-container",9),h(),C(11,cu,1,0,"mat-icon",14),E()),e&2){let t=f(2);l(2),p("svgIcon",t.svgIconName),l(2),p("ngIf",t.type==="finance"),l(),p("ngIf",t.type==="program"),l(),p("ngIf",t.type==="report"),l(),p("ngIf",t.type==="appointment"),l(),p("ngIf",t.type==="absences-appointment"),l(),p("ngIf",t.type==="monthly-goal"),l(),p("ngIf",t.type==="evaluation-questionnaire"),l(),p("ngIf",t.isEnableClick)}}function pu(e,n){e&1&&Ce(0)}function mu(e,n){if(e&1&&(P(0),m(1,"div",17),w(2,"img",18),h(),m(3,"div",13),C(4,pu,1,0,"ng-container",15),h(),w(5,"mat-icon",19),E()),e&2){let t=f(2),i=he(17);l(2),X("trial",t.isTrial),l(2),p("ngTemplateOutlet",i),l(),X("trial",t.isTrial),p("svgIcon",t.isTrial?"lock-closed":"vds-arrow")}}function hu(e,n){if(e&1){let t=I();m(0,"div",10),x(1,"translate"),A("click",function(){D(t);let a=f();return L(a.onCardClicked())}),C(2,du,12,9,"ng-container",9)(3,mu,6,6,"ng-container",9),h()}if(e&2){let t=f();X("enable",t.isEnableClick)("rewards",t.type==="rewards")("trial",t.isTrial),ee("matTooltip",S(1,11,"DASHBOARD_PAGE.CARD_INFO.REWARDS_DISABLED_MESSAGE")),p("matRippleDisabled",!t.isEnableClick)("matTooltipDisabled",t.isTooltipDisabled),l(2),p("ngIf",t.type!=="rewards"),l(
6),p("ngIf",t.type==="rewards")}}function uu(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",20),E()),e&2&&(l(),p("count",1)("theme",Q(2,$h)))}function gu(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"translate"),x(3,"translate"),h(),m(4,"vedius-text",22),v(5),x(6,"translate"),x(7,"translate"),h()),e&2){let t=f();l(),T(" ",t.total===1?F(2,2,"DASHBOARD_PAGE.CARD_INFO.SINGLE_FINANCE_TITLE",V(12,it,t.total)):F(3,5,"DASHBOARD_PAGE.CARD_INFO.PLURAL_FINANCE_TITLE",V(14,it,t.total))," "),l(4),T(" ",t.total===1?S(6,8,"DASHBOARD_PAGE.CARD_INFO.SINGLE_FINANCE_SUB_TITLE"):S(7,10,"DASHBOARD_PAGE.CARD_INFO.PLURAL_FINANCE_SUB_TITLE")," ")}}function fu(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"translate"),x(3,"translate"),h(),m(4,"vedius-text",22),v(5),x(6,"translate"),x(7,"translate"),h()),e&2){let t=f();l(),T(" ",t.total===1?F(2,2,"DASHBOARD_PAGE.CARD_INFO.SINGLE_PROGRAM_TITLE",V(12,it,t.total)):F(3,5,"DASHBOARD_PAGE.CARD_INFO.PLURAL_PROGRAM_TITLE",V(14,it,t.total))," "),l(4),T(" ",t.total===1?S(6,8,"DASHBOARD_PAGE.CARD_INFO.SINGLE_PROGRAM_SUB_TITLE"):S(7,10,"DASHBOARD_PAGE.CARD_INFO.PLURAL_PROGRAM_SUB_TITLE")," ")}}function _u(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"translate"),x(3,"translate"),h(),m(4,"vedius-text",22),v(5),x(6,"translate"),x(7,"translate"),h()),e&2){let t=f();l(),T(" ",t.total===1?F(2,2,"DASHBOARD_PAGE.CARD_INFO.SINGLE_REPORT_TITLE",V(12,it,t.total)):F(3,5,"DASHBOARD_PAGE.CARD_INFO.PLURAL_REPORT_TITLE",V(14,it,t.total))," "),l(4),T(" ",t.total===1?S(6,8,"DASHBOARD_PAGE.CARD_INFO.SINGLE_REPORT_SUB_TITLE"):S(7,10,"DASHBOARD_PAGE.CARD_INFO.PLURAL_REPORT_SUB_TITLE")," ")}}function xu(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"translate"),x(3,"translate"),x(4,"translate"),h(),m(5,"vedius-text",22),v(6),x(7,"translate"),x(8,"translate"),h()),e&2){let t=f();l(),T(" ",t.total===0?S(2,2,"DASHBOARD_PAGE.CARD_INFO.ALL_OK"):t.total===1?F(3,4,"DASHBOARD_PAGE.CARD_INFO.SINGLE_APPOINTMENT_TITLE",V(14,it,t.total)):F(4,7,"DASHBOARD_PAGE.CARD_INFO.PLURAL_APPOINTMENT_TITLE",V(16,it,t.total))," "),l(5),T(" ",t.total===0?S(7,10,"DASHBOARD_PAGE.CARD_INFO.EMPTY_APPOINTMENT_DESCRIPTION"):S(8,12,"DASHBOARD_PAGE.CARD_INFO.APPOINTMENT_SUB_TITLE")," ")}}function vu(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"translate"),x(3,"translate"),h(),m(4,"vedius-text",22),v(5),x(6,"translate"),x(7,"translate"),x(8,"translate"),h()),e&2){let t=f();l(),T(" ",t.total===1?F(2,2,"DASHBOARD_PAGE.CARD_INFO.SINGLE_ABSENCES_APPOINTMENT_TITLE",V(16,it,t.total)):F(3,5,"DASHBOARD_PAGE.CARD_INFO.PLURAL_ABSENCES_APPOINTMENT_TITLE",V(18,it,t.total))," "),l(4),T(" ",t.subTotal===0&&t.total===0?S(6,8,"DASHBOARD_PAGE.CARD_INFO.EMPTY_ABSENCES_APPOINTMENT_DESCRIPTION"):t.subTotal===1?F(7,10,"DASHBOARD_PAGE.CARD_INFO.SINGLE_ABSENCES_APPOINTMENT_SUB_TITLE",V(20,it,t.subTotal)):F(8,13,"DASHBOARD_PAGE.CARD_INFO.PLURAL_ABSENCES_APPOINTMENT_SUB_TITLE",V(22,it,t.subTotal))," ")}}function bu(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"vediusCurrency"),x(3,"translate"),x(4,"translate"),h()),e&2){let t=f(2);l(),T(" ",t.total>0?F(3,3,"DASHBOARD_PAGE.CARD_INFO.MONTHLY_GOAL_TITLE",V(8,it,S(2,1,t.total))):S(4,6,"DASHBOARD_PAGE.CARD_INFO.EMPTY_MONTHLY_GOAL_TITLE")," ")}}function yu(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",20),E()),e&2&&(l(),p("count",1)("theme",Q(2,Wh)))}function Cu(e,n){if(e&1&&(m(0,"vedius-text",22),v(1),x(2,"translate"),x(3,"percentageFormat"),x(4,"translate"),h()),e&2){let t=f(2);l(),T(" ",t.subTotal===0&&t.total===0?S(2,1,"DASHBOARD_PAGE.CARD_INFO.EMPTY_MONTHLY_GOAL_SUB_TIT
6LE"):F(4,6,"DASHBOARD_PAGE.CARD_INFO.MONTHLY_GOAL_SUB_TITLE",V(10,it,t.subTotal===0?t.subTotal+"%":F(3,3,t.subTotal,Q(9,Xh))))," ")}}function Tu(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",25),E()),e&2&&(l(),p("count",1)("theme",Q(2,Uh)))}function Su(e,n){if(e&1&&C(0,bu,5,10,"vedius-text",23)(1,yu,2,3,"ng-container",9)(2,Cu,5,12,"vedius-text",24)(3,Tu,2,3,"ng-container",9),e&2){let t=f();p("ngIf",!t.isMonthlyGoalLoading),l(),p("ngIf",t.isMonthlyGoalLoading),l(),p("ngIf",!t.isMonthlyGoalLoading&&!t.isMonthlyGoalInfoLoading),l(),p("ngIf",t.isMonthlyGoalInfoLoading)}}function wu(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),x(2,"translate"),x(3,"translate"),x(4,"translate"),h(),m(5,"vedius-text",22),v(6),x(7,"translate"),x(8,"translate"),h()),e&2){let t=f();l(),T(" ",t.total===0?S(2,2,"DASHBOARD_PAGE.CARD_INFO.ALL_OK"):t.total===1?F(3,4,"DASHBOARD_PAGE.CARD_INFO.SINGLE_EVALUATION_QUESTIONNAIRE_TITLE",V(14,it,t.total)):F(4,7,"DASHBOARD_PAGE.CARD_INFO.PLURAL_EVALUATION_QUESTIONNAIRE_TITLE",V(16,it,t.total))," "),l(5),T(" ",t.total===0?S(7,10,"DASHBOARD_PAGE.CARD_INFO.EMPTY_EVALUATION_QUESTIONNAIRE_DESCRIPTION"):S(8,12,"DASHBOARD_PAGE.CARD_INFO.EVALUATION_QUESTIONNAIRE_SUB_TITLE")," ")}}function Au(e,n){if(e&1&&(m(0,"vedius-text",26),v(1),x(2,"translate"),h(),m(3,"vedius-text",27),v(4),x(5,"translate"),h()),e&2){let t=f();l(),T(" ",S(2,2,"DASHBOARD_PAGE.CARD_INFO.REWARDS_TITLE")," "),l(3),T(" ",S(5,4,t.isClinicUser?"DASHBOARD_PAGE.CARD_INFO.REWARDS_SUB_TITLE_CLINIC":"DASHBOARD_PAGE.CARD_INFO.REWARDS_SUB_TITLE")," ")}}var Vc=(()=>{let n=class n{constructor(i){this.appContext=i,this.type="finance",this.total=0,this.subTotal=0,this.onClick=new J}get userVedius(){return this.appContext.getUserCredential()?.userVedius}get isTrial(){return this.userVedius?.settings.platformAccess.isTrial}get isClinicUser(){return this.userVedius?.type===_e.Clinic}get svgIconName(){return`dashboard-${this.type}`}get isEnableClick(){return this.type!=="absences-appointment"&&this.total>0||this.type==="monthly-goal"||this.type==="rewards"&&!this.isTrial}get isTooltipDisabled(){return!(this.type==="rewards"&&this.isTrial)}onCardClicked(){this.isEnableClick&&this.onClick.emit()}};n.\u0275fac=function(a){return new(a||n)(y(Le))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-card-info"]],inputs:{type:"type",total:"total",subTotal:"subTotal",isLoading:"isLoading",isMonthlyGoalLoading:"isMonthlyGoalLoading",isMonthlyGoalInfoLoading:"isMonthlyGoalInfoLoading"},outputs:{onClick:"onClick"},decls:18,vars:2,consts:[["financeContent",""],["programContent",""],["reportContent",""],["appointmentContent",""],["absencesAppointmentContent",""],["monthlyGoalContent",""],["evaluationQuestionnaireContent",""],["rewardsContent",""],["tabindex","0","class","dashboard-card-info-component","matRipple","",3,"enable","rewards","trial","matRippleDisabled","matTooltip","matTooltipDisabled","click",4,"ngIf"],[4,"ngIf"],["tabindex","0","matRipple","",1,"dashboard-card-info-component",3,"click","matRippleDisabled","matTooltip","matTooltipDisabled"],[1,"dash-icon-container"],[3,"svgIcon"],[1,"card-info-content"],["class","card-arrow-icon","svgIcon","vds-arrow",4,"ngIf"],[4,"ngTemplateOutlet"],["svgIcon","vds-arrow",1,"card-arrow-icon"],[1,"rewards-image-content"],["src","../../../../../../assets/images/dashboard-rewards.svg","alt","dashboard-rewards"],[1,"card-arrow-icon","white",3,"svgIcon"],[1,"loader",3,"count","theme"],["variant","text","size","sm",1,"neutral-dusk-color"],["variant","text","size","micro",1,"neutral-dark-color"],["class","neutral-dusk-color","variant","text","size","sm",4,"ngIf"],["class","neutral-dark-color","variant","text","size","micro",4,"ngIf"],[1,"loader","info-skeleton-loading",3,"count","theme"],["variant","text","size","sm",1,"$color-neutral-dusk"],["variant","text","size","micro",1,"$color-neutral-dusk"]],template:function(a,o){a&1&&C(0,hu,4,13,"div",8)(1,uu,2,3,"ng-container",9)(2,gu,8,16,"ng-template",null,0,me)(4,fu,8,16,"ng-template",null,1,me)(6,_u,8,16,"ng-template",null,2,me)(8,xu,9,18,"ng-template",null,3,me)(10,vu,9,24,"ng-template",null,4,me)(12,Su,4,4,"ng-template",null,5,me)(14,wu,9,18,"ng-template",null,6,me)(16,Au,6,6,"ng-template",null,7,me),a&2&&(p("ngIf",!o.isLoading),l(
6),p("ngIf",o.isLoading))},dependencies:[z,Bs,aa,et,ze,Ee,Pe,j,$,Y,Hi,tt],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}[_ngcontent-%COMP%]:root{width:100%}.loader[_ngcontent-%COMP%]{width:100%}.dashboard-card-info-component[_ngcontent-%COMP%]{display:flex;padding:0 12px;align-items:center;gap:16px;flex:1 0 0;border-radius:8px;background:#fff;height:64px}.dashboard-card-info-component[_ngcontent-%COMP%] .info-skeleton-loading[_ngcontent-%COMP%]{margin:2px 0 0;width:58%;line-height:6px}.dashboard-card-info-component.enable[_ngcontent-%COMP%]:hover{cursor:pointer;opacity:.8}.dashboard-card-info-component.rewards[_ngcontent-%COMP%]{background:linear-gradient(to right,#80fff4,#fff 102px 102px,#96a0b0 420px)}@media screen and (max-width: 600px){.dashboard-card-info-component.rewards[_ngcontent-%COMP%]{background:linear-gradient(to right,#80fff4,#fff 102px 102px,#96a0b0 350px)}}.dashboard-card-info-component.rewards.trial[_ngcontent-%COMP%]{background:#6d7a8e;opacity:.8}.dashboard-card-info-component[_ngcontent-%COMP%] .dash-icon-container[_ngcontent-%COMP%]{display:flex;padding:4px;align-items:center;border-radius:8px;background:#e6fffd}.dashboard-card-info-component[_ngcontent-%COMP%] .card-info-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0;position:relative}.dashboard-card-info-component[_ngcontent-%COMP%] .card-arrow-icon[_ngcontent-%COMP%]{transform:rotate(270deg);width:24px;height:24px;stroke:#192840}.dashboard-card-info-component[_ngcontent-%COMP%] .card-arrow-icon.trial[_ngcontent-%COMP%]{transform:rotate(0)}.dashboard-card-info-component[_ngcontent-%COMP%] .card-arrow-icon.white[_ngcontent-%COMP%]{stroke:#fff}.dashboard-card-info-component[_ngcontent-%COMP%] .rewards-image-content[_ngcontent-%COMP%]{position:relative;height:64px;width:42px}.dashboard-card-info-component[_ngcontent-%COMP%] .rewards-image-content[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{position:absolute;left:-12px;top:0;width:102px;height:64px;padding-right:13px;padding-top:4px}.dashboard-card-info-component[_ngcontent-%COMP%] .rewards-image-content[_ngcontent-%COMP%] img.trial[_ngcontent-%COMP%]{background:#6d7a8e}.dashboard-card-info-component[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.dashboard-card-info-component[_ngcontent-%COMP%] .neutral-dark-color[_ngcontent-%COMP%]{color:#6d7a8e}.dashboard-card-info-component[_ngcontent-%COMP%] .neutral-day-color[_ngcontent-%COMP%]{color:#fff}.dashboard-card-info-component[_ngcontent-%COMP%] .brand-light-color[_ngcontent-%COMP%]{color:#b3fff8}"]});let e=n;return e})();var _n=class e{constructor(n,t,i,a){this._monthSummaryKey=n,this._financeKey=t,this._collaboratorSummary=i,this._overallSummary=a}static create({monthSummaryKey:n,financeKey:t,collaboratorSummary:i,overallSummary:a}){return new e(n,t,i,a)}get monthSummaryKey(){return this._monthSummaryKey}get financeKey(){return this._financeKey}get collaboratorSummary(){return this._collaboratorSummary}get overallSumary(){return this._overallSummary}};var Rc=(()=>{let n=class n extends Ct{constructor(i,a){super(),this.transactionBalanceSummaryParser=i,this.transactionCategoryBalanceSummaryParser=a}parseDocument(i){let{monthSummaryKey:a,financeKey:o,data:r}=i,{overall:s,collaborators:c}=r,d=wa.empty();s&&(d=wa.create({balanceSummary:this.transactionBalanceSummaryParser.parseDocument(s.balance_summary),categorySummary:this.transactionCategoryBalanceSummaryParser.parseDocument(s.category_summary)}));let u={};if(c)for(let[_,b]of Object.entries(c)){let k=this.transactionBalanceSummaryParser.parseDocument(b.balance_summary),M=this.transactionCategoryBalanceSummaryParser.parseDocument(b.category_summary);u[_]=Ho.create({balanceSummary:k,categorySummary:M})}let g=jo.create({collaboratorRecord:u});return _n.create({monthSummaryKey:a,financeKey:o,collaboratorSummary:g,overallSummary:d})}parseFromJson(i){let{_monthSummaryKey:a,_financeKey:o,_overallSummary:r,_collaboratorSummary:s}=i,c=wa.create({balanceSummary:this.transactionBalanceSummaryParser.parseFromJson(r._balanceSummary),categorySummary:this.transactionCategoryBalanceSummaryParser.parseFromJson(r._categorySummary)}),d={};if(s)for(let[b,k]of Object.entries(s)){let M=this.transactionBalanceSummaryParser.parseFromJson(k._balanceSummary),H=this.transactionCategoryBalanceSummaryParser.parseFromJson(k._categorySummary);d[b]=Ho.create({balanceSummary:M,categorySummary:H})}let u=jo.create({collaboratorRecord:d}),g=wt.fromNumber(a._value),_=pn.fromString(o._value);return _n.create({monthSummaryKey:g,financeKey:_,collaboratorSummary:u,overallSummary:c})}};n.\u0275fac=function(a){return new(a||n)(G(Kl),G(Zl))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Nc=(()=>{let n=class n{constructor(i,a,o,r){this.firestore=i,this.firebaseErrorHandler=a,this.transactionMonthSummaryParser=o,this.fsCtx=r}get(o){return B(this,arguments,function*({financeMonthSummaryKey:i,financeKey:a}){try{let r=Ps(this.firestore,kt.Finance,a.value,kt.MonthSummary,i.toString()),s=yield Es(r);return s.exists()?this.transactionMonthSummaryParser.parseDocument({monthSummaryKey:i,financeKey:a,data:s.data()}):null}catch(r){throw this.firebaseErrorHandler.handleError(r)}})}getAllByPeriod(o){return B(this,arguments,function*({period:i,financeKey:a}){try{let r=wt.fromDate(i.start),s=wt.fromDate(i.end),c=gi(this.firestore,kt.Finance,a.value,kt.MonthSummary),d=_i(c,gt("id",">=",r.value),gt("id","<=",s.value)),u=yield fi(d);return u.empty?[]:u.docs.map(g=>{let _=wt.fromNumber(Number(g.id));return this.transactionMonthSummaryParser.parseDocument({monthSummaryKey:_,financeKey:a,data:g.data()})})}catch(r){throw this.firebaseErrorHandler.handleError(r)}})}listenTransactionMonthSummary(i,a){let o=gi(this.firestore,kt.Finance,a.value,kt.MonthSummary),r=this.fsCtx.run(()=>Os(o,s=>
6{s.docChanges().forEach(c=>{let d=c.doc.data();if(c.type==="removed"){let u=this.transactionMonthSummaryParser.parseDocument({monthSummaryKey:wt.fromNumber(d.id),financeKey:a,data:{overall:null,collaborators:null}});i(u);return}if(["added","modified"].includes(c.type)){let u=this.transactionMonthSummaryParser.parseDocument({monthSummaryKey:wt.fromNumber(d.id),financeKey:a,data:d});i(u)}})}));return new Wr(()=>r())}};n.\u0275fac=function(a){return new(a||n)(G(Bi),G(Ni),G(Rc),G(Xs))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Ra=(()=>{let n=class n{constructor(i,a){this.userVediusReferenceKeyFactoryService=i,this.transactionMonthSummaryRepository=a}get(a){return B(this,arguments,function*({financeMonthSummaryKey:i}){let o=this.userVediusReferenceKeyFactoryService.create(xi.CLINIC_OR_DEFAULT_KEY);return yield this.transactionMonthSummaryRepository.get({financeMonthSummaryKey:i,financeKey:pn.fromUserVediusReferenceKey(o)})})}getAllByPeriod(a){return B(this,arguments,function*({period:i}){let o=this.userVediusReferenceKeyFactoryService.create(xi.CLINIC_OR_DEFAULT_KEY);return yield this.transactionMonthSummaryRepository.getAllByPeriod({period:i,financeKey:pn.fromUserVediusReferenceKey(o)})})}};n.\u0275fac=function(a){return new(a||n)(G(Gi),G(Nc))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();function Mu(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",10),A("onClick",function(){D(t);let a=f(2);return L(a.openOverdueModal())}),h()}if(e&2){let t=f(2);p("total",t.financeTotal)("isLoading",t.loading)}}function Ou(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",11),A("onClick",function(){D(t);let a=f(2);return L(a.openSaveBillingGoal())}),h()}if(e&2){let t=f(2);p("total",t.monthlyGoalTotal)("subTotal",t.monthlyGoalPercentageTotal)("isLoading",t.loading)("isMonthlyGoalLoading",t.isMonthlyGoalLoading)("isMonthlyGoalInfoLoading",t.isMonthlyGoalInfoLoading)}}function Iu(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",12),A("onClick",function(){D(t);let a=f(2);return L(a.goToReferAndEarn())}),h()}if(e&2){let t=f(2);p("isLoading",t.loading)}}function Fu(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",13),A("onClick",function(){D(t);let a=f(2);return L(a.openUnansweredEvaluationQuestionnaires())}),h()}if(e&2){let t=f(2);p("total",t.evaluationQuestionnaireWithoutAnswerTotal)("isLoading",t.loading)}}function Bu(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",13),A("onClick",function(){D(t);let a=f(2);return L(a.openUnansweredEvaluationQuestionnaires())}),h()}if(e&2){let t=f(2);p("total",t.evaluationQuestionnaireWithoutAnswerTotal)("isLoading",t.loading)}}function Vu(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",14),A("onClick",function(){D(t);let a=f(2);return L(a.openExpiredPrograms())}),h()}if(e&2){let t=f(2);p("total",t.programTotal)("isLoading",t.loading)}}function Ru(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",15),A("onClick",function(){D(t);let a=f(2);return L(a.openReports())}),h()}if(e&2){let t=f(2);p("total",t.reportTotal)("isLoading",t.loading)}}function Nu(e,n){if(e&1&&(P(0),m(1,"div",3),C(2,Mu,1,2,"app-dashboard-card-info",4)(3,Ou,1,5,"app-dashboard-card-info",5)(4,Iu,1,1,"app-dashboard-card-info",6)(5,Fu,1,2,"app-dashboard-card-info",7),h(),m(6,"div",3),C(7,Bu,1,2,"app-dashboard-card-info",7)(8,Vu,1,2,"app-dashboard-card-info",8)(9,Ru,1,2,"app-dashboard-card-info",9),h(),E()),e&2){let t=f();l(2),p("ngIf",t.hasFinancesReportsPermission),l(),p("ngIf",t.hasFinancesReportsPermission&&!t.isAnySecretaryRole),l(),p("ngIf",t.isRewardsVisible&&!t.isSmallScreen),l(),p("ngIf",!t.isAnySecretaryRole&&t.isSmallScreen),l(2),p("ngIf",!t.isAnySecretaryRole&&!t.isSmallScreen),l(),p("ngIf",!t.isAnySecretaryRole),l(),p("ngIf",!t.isAnySecretaryRole)}}function Gu(e,n){if(e&1){let t=I();m(0,"app-dashboard-card-info",12),A("onClick",function(){D(t);let a=f(2);return L(a.goToReferAndEarn())}),h()}if(e&2){let t=f(2);p("isLoading",t.loading)}}function zu(e,n){if(e&1&&(m(0,"div",16),C(1,Gu,1,1,"app-dashboard-card-info",6),h()),e&2){let t=f();l(),p("ngIf",t.isRewardsVisible&&t.isSmallScreen)}}var zc=(()=>{let n=class n{constructor(i,a,o,r,s,c,d,u,g,_,b,k,M,H,ce,Ae,fe,ue){this.dialog=i,this.financeTransactionService=a,this.financeChangedService=o,this.programService=r,this.patientService=s,this.eventCalendarDisplayService=c,this.calendarSettingsService=d,this.userVediusContext=u,this.evaluationQuestionnaireSentService=g,this.eventCalendarDisplayInputsChangesService=_,this.expiredProgramsDashboardChangeService=b,this.patientProtocolReportsDashboardChangeService=k,this.unansweredEvaluationQuestionnaireDashboardChangeService=M,this.financeBillingGoalService=H,this.financeTransactionMonthSummaryService=ce,this.referAndEarnRouteStrategy=Ae,this.allPatientProtocolReportService=fe,this.cdr=ue,this.hasMinimumDataToLoad=!1,this.isPageLoading=!1,this.isSmallScreen=!1,this.loadingDelay=0,this.overdueTransactions=[],this.programsExpiring=[],this.absencesAppointmentTotal=0,this.absencesAppointmentWeeklyTotal=0,this.unconfirmedAppointment=0,this.unconfirmedAppointmentSchedules=[],this.absences=[],this.isLoading=!1,this.subscriptions=[],this.unansweredEvaluationQuestionnaire=[],this.monthlyGoalPercentageTotal=0,this.isMonthlyGoalLoading=!0,this.collaboratorsSett
6ings=[],this.patientProtocolsReports=[],this.allPatientsObjectInfos=[],this.isMonthlyGoalInfoLoading=!1,this.initialLoadSubject=new we,this.destroy$=new we;let Ie=new Date,ot=new Date(Ie.getFullYear(),Ie.getMonth(),Ie.getDate()),tn=new Date(Ie);tn.setDate(Ie.getDate()+4),tn.setHours(23,59,59),this.unconfirmedAppointmentPeriod=De.fromDate(ot,tn)}get userVedius(){return this.userVediusContext.current}get financeTotal(){return this.overdueTransactions.length}get programTotal(){return this.programsExpiring.length}get reportTotal(){return this.patientProtocolsReports.length}get isRewardsVisible(){return this.isOwnerCredential}get monthlyGoalTotal(){return this.monthlyBillingGoal?.goal.value||0}get evaluationQuestionnaireWithoutAnswerTotal(){return this.unansweredEvaluationQuestionnaire.length}get loading(){return this.isLoading||this.isPageLoading}get isLoadingMonthlyGoal(){return this.isMonthlyGoalLoading||this.isPageLoading}get isOwnerCredential(){return this.userVedius instanceof ln?this.userVedius.hasAnyOwnerRoleType():!0}get hasFinancesReportsPermission(){return this.userVedius instanceof ln?this.userVedius.clinicRole!==Vi.COLLABORATOR:!0}get isAnySecretaryRole(){return this.userVedius.type!==_e.Clinic?!1:this.userVedius.hasAnySecretaryRoleType()}ngOnChanges(i){i.isPageLoading&&i.isPageLoading?.currentValue===!1&&setTimeout(()=>{this.reload(),this.cdr.detectChanges()})}ngOnInit(){this.isLoading=!0;try{this.startInitialSubjectLoad(),this.observables(),setTimeout(()=>{this.initialLoadSubject.next(),this.cdr.detectChanges()})}catch(i){console.error("Error to load dashboard cards info: ",i)}}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}reload(){setTimeout(()=>{this.isLoading=!0,this.isMonthlyGoalLoading=!0,this.initialLoadSubject.next(),this.cdr.detectChanges()})}load(){return B(this,null,function*(){if(this.hasMinimumDataToLoad)try{yield Promise.all([this.loadAllPatientObjectInfos(),this.loadCalendarSettings(),this.loadOverdueTransactions(),this.loadProgramsExpiring(),this.loadMonthlyBillingGoal(),this.loadEvaluationQuestionnaireWithoutAnswers(),this.loadPainReportInfo()]),setTimeout(()=>{this.isLoading=!1,this.isMonthlyGoalLoading=!1,this.cdr.detectChanges()})}catch(i){console.error("Error during loading:",i),setTimeout(()=>{this.isLoading=!1,this.isMonthlyGoalLoading=!1,this.cdr.detectChanges()})}})}observables(){let i=this.financeChangedService.listenChange().subscribe(c=>{if(!c||c.actionType!==ha.Updated)return;let{transaction:d}=c,u=this.overdueTransactions.findIndex(_=>_.key.value===d.key.value),g=d.status===cn.CONFIRMED;setTimeout(()=>{u!==-1&&g?this.overdueTransactions.splice(u,1):!g&&Ql(d.dateTZ.date)&&ql(d.dateTZ.date,15)&&(this.overdueTransactions.push(d),this.overdueTransactions.sort((_,b)=>b.dateTZ.date.getTime()-_.dateTZ.date.getTime())),this.loadMonthlyBillingGoal(!1),this.cdr.detectChanges()})}),a=this.eventCalendarDisplayInputsChangesService.getEventInputsChangesObservable().subscribe(c=>{let d=c.currentEventsDisplay;d.length!==0&&c?.eventType===ga.Edition&&setTimeout(()=>{let u=!1;c.deletedChildId&&(this.unconfirmedAppointmentSchedules=this.unconfirmedAppointmentSchedules.filter(g=>g.id!==c.deletedChildId),u=!0);for(let g of d){let _=this.unconfirmedAppointmentSchedules.findIndex(b=>b.id===g.id);_!==-1&&(this.unconfirmedAppointmentSchedules[_]=g,u=!0),g.eventType===da.schedule&&this.loadAbsencesAppointmentReceived(g)}u&&(this.unconfirmedAppointmentSchedules=this.unconfirmedAppointmentSchedules.filter(g=>g.status===Se.Scheduled&&this.unconfirmedAppointmentPeriod.containsDate(g.start)),this.unconfirmedAppointment=this.unconfirmedAppointmentSchedules.length,this.cdr.detectChanges()),this.cdr.detectChanges()})}),o=this.expiredProgramsDashboardChangeService.programDashboardDisabled.subscribe(c=>{c&&setTimeout(()=>{this.programsExpiring=this.programsExpiring.filter(d=>d.key.protocolKey.value!==c.protocolKey.value),this.cdr.detectChanges()})}),r=this.patientProtocolReportsDashboardChangeService.patientProtocolReportDisabled.subscribe(c=>{c&&setTimeout(()=>{this.patientProtocolsReports=this.patientProtocolsReports.filter(d=>d.programReportKey.value!==c.value),this.cdr.detectChanges()})}),s=this.unansweredEvaluationQuestionnaireDashboardChangeService.unansweredEvaluationQuestionnaireDashboardDisabled.subscribe(c=>{c&&setTimeout(()=>{this.unansweredEvaluationQuestionnaire=this.unansweredEvaluationQuestionnaire.filter(d=>d.key.value!==c.value),this.cdr.detectChanges()})});this.subscriptions=[i,a,o,s,r]}openOverdueModal(){this.dialog.open(Ul,{width:"840px",data:{transactions:[...this.overdueTransactions],collaboratorsSett
6ings:this.collaboratorsSettings}})}openUnconfirmedAppointments(){let i=this.unconfirmedAppointmentSchedules.filter(a=>this.unconfirmedAppointmentPeriod.containsDate(a.start));i.length!==0&&this.dialog.open(dc,{width:"600px",data:{eventsCalendarDisplay:[...i],calendarSettings:this.collaboratorsSettings,allPatientsObjectInfos:this.allPatientsObjectInfos}})}openExpiredPrograms(){this.dialog.open(uc,{width:"600px",data:{programs:[...this.programsExpiring]}})}openReports(){this.dialog.open(Bc,{width:"600px",data:{patientProgramReports:[...this.patientProtocolsReports]}})}openUnansweredEvaluationQuestionnaires(){this.dialog.open(xc,{width:"600px",data:{unansweredEvaluationQuestionnaire:[...this.unansweredEvaluationQuestionnaire]}})}openSaveBillingGoal(){this.dialog.open(Dc,{width:"600px",data:{billingGoal:this.monthlyBillingGoal,userVedius:this.userVedius}}).afterClosed().subscribe(a=>{a&&a.goal.value!==this.monthlyBillingGoal?.goal?.value&&this.loadMonthlyBillingGoal()})}goToReferAndEarn(){this.referAndEarnRouteStrategy.redirect()}loadCalendarSettings(){return B(this,null,function*(){let i=this.userVediusContext.getCollaboratorsOrDefault();this.collaboratorsSettings=yield this.calendarSettingsService.getMany({userVediusKeys:i.map(a=>a.key)})})}loadOverdueTransactions(){return B(this,null,function*(){let i=yield this.financeTransactionService.getOverdueTransactionsLast15Days();setTimeout(()=>{this.isOwnerCredential||this.isAnySecretaryRole?this.overdueTransactions=i:this.overdueTransactions=i.filter(a=>a.collaborator.key.value===this.userVedius.key.value),this.cdr.detectChanges()})})}loadProgramsExpiring(){return B(this,null,function*(){let i=this.userVedius?.key,a=De.thisWeek(),o=yield this.programService.getProgramsExpiringIn({period:a,userVediusKey:i});setTimeout(()=>{this.programsExpiring=o,this.cdr.detectChanges()})})}loadAbsencesAppointment(){return B(this,null,function*(){let i=this.userVedius?.key,a=De.thisWeek(),r=(yield this.eventCalendarDisplayService.getByRange({period:a,professionalKeys:[i],type:"weekly"})).filter(s=>s.status===Se.Absent);setTimeout(()=>{this.absences=r,this.populateAbsences(),this.cdr.detectChanges()})})}loadAllPatientObjectInfos(){this.patientService.getAllObjectInfos().then(i=>{setTimeout(()=>{this.allPatientsObjectInfos=i,this.cdr.detectChanges()})})}loadAbsencesAppointmentReceived(i){return B(this,null,function*(){setTimeout(()=>{let a=this.absences.findIndex(r=>
6r.id===i.id),o=i.status===Se.Absent;a!==-1?o||(this.absences=this.absences.filter(r=>r.id!==i.id)):o&&this.absences.push(i),this.populateAbsences()})})}populateAbsences(){setTimeout(()=>{this.absencesAppointmentTotal=this.absences.length;let i=De.thisWeek();this.absencesAppointmentWeeklyTotal=this.absences.filter(a=>i.containsDate(a.start)).length,this.cdr.detectChanges()})}loadUnconfirmedAppointments(){return B(this,null,function*(){let i=this.userVedius?.key,a=yield this.eventCalendarDisplayService.getByRange({period:this.unconfirmedAppointmentPeriod,professionalKeys:[i]});setTimeout(()=>{this.unconfirmedAppointmentSchedules=a.filter(o=>o.status===Se.Scheduled),this.unconfirmedAppointment=this.unconfirmedAppointmentSchedules.length,this.cdr.detectChanges()})})}loadEvaluationQuestionnaireWithoutAnswers(){return B(this,null,function*(){let i=this.userVedius?.key,a=yield this.evaluationQuestionnaireSentService.getEvaluationQuestionnarieSentWithoutResponse({professionalKey:i});setTimeout(()=>{this.unansweredEvaluationQuestionnaire=a,this.cdr.detectChanges()})})}loadMonthlyBillingGoal(i=!0){return B(this,null,function*(){i&&(this.isMonthlyGoalLoading=!0,this.monthlyGoalPercentageTotal=0);let a=this.userVedius?.key,o=wt.fromDate(new Date),r=(yield this.financeBillingGoalService.getCurrentMonthlyBillingGoalForProfessional({professionalKey:a}))||void 0;setTimeout(()=>{this.monthlyBillingGoal=r,this.isMonthlyGoalLoading=!1,this.isMonthlyGoalInfoLoading=!0,this.cdr.detectChanges()}),r&&r.goal.isGreaterThanZero()?setTimeout(()=>B(this,null,function*(){let s=yield this.financeTransactionMonthSummaryService.get({financeMonthSummaryKey:o});if(s){let c=s.collaboratorSummary.getTotalBalanceSummary([a]);setTimeout(()=>{this.monthlyGoalPercentageTotal=ks(c.income.value,r.goal.value),this.isMonthlyGoalInfoLoading=!1,this.cdr.detectChanges()})}else setTimeout(()=>{this.isMonthlyGoalInfoLoading=!1,this.cdr.detectChanges()})})):setTimeout(()=>{this.monthlyGoalPercentageTotal=0,this.isMonthlyGoalInfoLoading=!1,this.cdr.detectChanges()})})}loadPainReportInfo(){return B(this,null,function*(){let i=De.thisWeek(),a=yield this.allPatientProtocolReportService.getAllIntensePainProtocol({period:i,professional:this.userVedius});setTimeout(()=>{this.patientProtocolsReports=a,this.cdr.detectChanges()})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.subscriptions.forEach(i=>i.unsubscribe())}};n.\u0275fac=function(a){return new(a||n)(y(He),y(_a),y(ua),y(ya),y(pt),y(Zt),y(Kt),y(Te),y(Hl),y(fa),y(Pa),y(Ba),y(Ea),y(Ia),y(Ra),y(Xl),y(Va),y(Oe))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-cards-info"]],inputs:{hasMinimumDataToLoad:"hasMinimumDataToLoad",isPageLoading:"isPageLoading",isSmallScreen:"isSmallScreen",loadingDelay:"loadingDelay"},features:[ye],decls:3,vars:4,consts:[[1,"dashboard-cards-infos-component"],[4,"ngIf"],["class","dashboard-cards-infos-content-rewards-small",4,"ngIf"],[1,"dashboard-cards-infos-content"],["type","finance",3,"total","isLoading","onClick",4,"ngIf"],["type","monthly-goal",3,"total","subTotal","isLoading","isMonthlyGoalLoading","isMonthlyGoalInfoLoading","onClick",4,"ngIf"],["type","rewards",3,"isLoading","onClick",4,"ngIf"],["type","evaluation-questionnaire",3,"total","isLoading","onClick",4,"ngIf"],["type","program",3,"total","isLoading","onClick",4,"ngIf"],["type","report",3,"total","isLoading","onClick",4,"ngIf"],["type","finance",3,"onClick","total","isLoading"],["type","monthly-goal",3,"onClick","total","subTotal","isLoading","isMonthlyGoalLoading","isMonthlyGoalInfoLoading"],["type","rewards",3,"onClick","isLoading"],["type","evaluation-questionnaire",3,"onClick","total","isLoading"],["type","program",3,"onClick","total","isLoading"],["type","report",3,"onClick","total","isLoading"],[1,"dashboard-cards-infos-content-rewards-small"]],template:function(a,o){a&1&&(m(0,"div",0),C(1,Nu,10,7,"ng-container",1),h(),C(2,zu,2,1,"div",2)),a&2&&(X("small",o.isSmallScreen),l(),p("ngIf",o.hasMinimumDataToLoad||o.loading),l(),p("ngIf",o.isRewardsVisible&&o.isSmallScreen))},dependencies:[z,Vc],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
6-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-cards-infos-component[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:24px}.dashboard-cards-infos-component[_ngcontent-%COMP%] .dashboard-cards-infos-content[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:24px;align-self:stretch;width:100%}.dashboard-cards-infos-component[_ngcontent-%COMP%] app-dashboard-card-info[_ngcontent-%COMP%], .dashboard-cards-infos-component[_ngcontent-%COMP%] app-dashboard-onboarding-card[_ngcontent-%COMP%]{width:100%}.dashboard-cards-infos-component.small[_ngcontent-%COMP%]{padding:0 48px;margin-left:-24px;overflow-x:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;-ms-overflow-style:none;scrollbar-width:none}.dashboard-cards-infos-component.small[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.dashboard-cards-infos-component.small[_ngcontent-%COMP%] app-dashboard-card-info[_ngcontent-%COMP%]{min-width:250px}@media screen and (max-width: 600px){.dashboard-cards-infos-component.small[_ngcontent-%COMP%]{padding:0;margin-left:0}}.dashboard-cards-infos-content-rewards-small[_ngcontent-%COMP%]{padding:48px 24px 0;width:100%;box-sizing:border-box}@media screen and (max-width: 600px){.dashboard-cards-infos-content-rewards-small[_ngcontent-%COMP%]{padding:48px 0 0}}"]});let e=n;return e})();var Na=(()=>{let n=class n extends Vl{constructor(i,a,o){super(),this.translation=i,this.appLocale=a,this.imageService=o}generate(i){return B(this,null,function*(){let a=vs("Lista de Aniversariantes");try{let o=i.length>0?i[0]?.professional:void 0;o&&(yield this.addProfessionalHeader(a,o),Yl(a),a.content.push(Zn(5))),this.addBirthdayListHeader(a),a.content.push(Zn(1)),i.length===0?a.content.push({text:this.translation.get(U.NoBirthdaysFound),alignment:"center",fontSize:12,color:Bt.NeutralDarker,margin:[20,20,20,0]}):yield this.addPatientList(a,i),a.content.push(Zn(5)),yield ys(a,this.imageService,this.translation),this.download(a)}catch(o){throw console.error("Birthday List PDF Error:",o),o}})}addProfessionalHeader(i,a){return B(this,null,function*(){let o=yield bs(a),r=Mo(a.phone?.number),s=a.email?.value||"N/A",c=a.settings?.protocol?.hidePhone,d=a.settings?.protocol?.hideEmail,g={stack:[{columns:[{width:"20%",stack:[o?{image:a.logo?o:yield Io(o,64,"#70BBC8"),width:64,height:64,alignment:"center"}:{}]},{width:"*",margin:[10,0,0,0],stack:[{text:this.translation.get(U.ResponsibleProfessional),style:{fontSize:8,color:Bt.NeutralDark},margin:[0,0,0,3]},{text:a.name.fullNameNormalized||a.name.fullName,style:{fontSize:14,color:Bt.NeutralDusk,bold:!0},margin:[0,4,0,8]}]},{width:"auto",margin:[0,0,0,0],stack:[!c&&r!=="N/A"?{columns:[{svg:_s,fit:[12,12],width:12,margin:[2,0,0,0]},{width:"auto",text:r,style:{fontSize:10,color:Bt.NeutralDarker},margin:[5,0,0,0]}],margin:[0,0,0,5]}:{},!d&&s!=="N/A"?{columns:[{svg:xs,fit:[12,12],width:12,margin:[2,0,0,0]},{width:"auto",text:s,style:{fontSize:10,color:Bt.NeutralDarker},margin:[5,0,0,0]}]}:{}]}]}],margin:[20,20,20,20],border:[!0,!0,!0,!0],borderColor:"#E0E0E0",borderRadius:5,fillColor:"#FFFFFF",padding:[10,10,10,10]};i.content.push(g)})}addBirthdayListHeader(i){let a=new Date,o=je(a.toLocaleString(this.appLocale.current,{month:"long"})),r=a.getFullYear(),c={text:`Aniversariantes do m\xEAs - ${o}, ${r}`,alignment:"center",fontSize:14,bold:!0,color:Bt.NeutralDarker,margin:[20,10,20,10]};i.content.push(c)}addPatientList(i,a){return B(this,null,function*(){for(let o of a){let r=o.birthday?.date?`${o.birthday.date.getDate()} de ${o.birthday.date.toLocaleString(this.appLocale.current,{month:"long"})}`:this.translation.get(U.UnknownBirthday),s=null,c=40,d="#C6EEF7",u="#70BBC8";if(o.imageUrl?.url)try{s=yield this.imageService.getBase64ImageFromURL(o.imageUrl.url)}catch(_){console.error("Error fetching patient image from URL:",_,"URL:",o.imageUrl.url);let b=o.name.fullName.charAt(0).toUpperCase();s=Oo(b,c,d,u)}else{let _=o.name.fullName.charAt(0).toUpperCase();s=Oo(_,c,d,u)}let g={columns:[{width:"auto",stack:[s?yield B(this,null,function*(){try{return{image:yield Io(s,c,d),width:c,height:c,alignment:"center"}}catch(_){return console.error("Error creating circular image:",_),{}}}):{}]},{stack:[{text:`${o.name.fullName} - ${Mo(o.phone?.number)}`,fontSize:12,color:Bt.NeutralDarker}
6,{text:r,fontSize:10,color:Bt.NeutralDarker}],width:"*",margin:[12,8,0,0]}],verticalAlignment:"middle",margin:[20,5,20,5]};i.content.push(g)}})}};n.\u0275fac=function(a){return new(a||n)(G(ae),G(st),G(Rl))},n.\u0275prov=Z({token:n,factory:n.\u0275fac});let e=n;return e})();var ju=["observationInput"],Hc=e=>({clientTreatmentType:e});function Yu(e,n){if(e&1&&(m(0,"div"),w(1,"vedius-page-loading",15),h()),e&2){let t=f();l(),p("active",t.isSaving)}}var jc=(()=>{let n=class n{constructor(i,a,o,r,s,c,d,u,g){this.appContext=i,this.formBuilder=a,this.userService=o,this.toastService=r,this.trackingErrorCore=s,this.translationService=c,this.birthdayListPDFGeneratorService=d,this.cdr=u,this.data=g,this.translatedClientTreatmentType="",this.isSaving=!1,this.patientFullName="",this.patienteNameToBirthday=""}get userVedius(){return this.appContext.current}get controls(){return this.form.controls}ngOnInit(){this.patientFullName=this.userVedius.name.firstName+" "+this.userVedius.name.lastName,this.switchMap=this.userVedius.settings.birthdayDisplaySettings,this.clientTreatmentType=this.userVedius.clientTreatmentType||xe.PATIENT,this.setTranslatedClientTreatmentType(),this.patienteNameToBirthday=this.translationService.get(U.ClienteNameParameterReminderMessageBirthday);let i=this.userVedius.settings.birthdayDisplaySettings?.messageBirthday||`Feliz aniversario${this.patienteNameToBirthday}!!!`;this.form=this.getForm(i)}isChecked(i){return this.switchMap?.settings[i]??!1}onSwitchChanged(i,a){i==="BIRTHDAY_SETTING_PATIENT_ACTIVE"&&!a.checked&&this.switchMap?.setSetting("BIRTHDAY_SETTING_PATIENT_INACTIVE",!0),i==="BIRTHDAY_SETTING_PATIENT_INACTIVE"&&!a.checked&&this.switchMap?.setSetting("BIRTHDAY_SETTING_PATIENT_ACTIVE",!0),this.switchMap?.setSetting(i,a.checked),this.cdr.detectChanges()}onSave(){return B(this,null,function*(){try{this.isSaving=!0;let i=this.userVedius;i.settings.birthdayDisplaySettings&&(i.settings.birthdayDisplaySettings.messageBirthday=this.controls.observation.value),Object.entries(this.switchMap?.settings??{}).forEach(([o,r])=>{typeof r=="boolean"&&i.settings.birthdayDisplaySettings?.setSetting(o,r)}),yield this.userService.update({userVedius:i});let a=this.translationService.get(U.NotificationSettingsSavedMessage);this.toastService.showSuccess({title:a}),this.modal?.close(!0)}catch(i){console.error(i),this.toastService.showDefaultErrorMessage(),this.trackingErrorCore.onCaptureException(i)}finally{this.isSaving=!1}})}close(){this.modal?.close()}printListPdf(){this.data?this.birthdayListPDFGeneratorService.generate(this.data):console.error("No patient data available to generate birthday list PDF.")}addParameter(i){let a=this.observationInput?.inputElementRef?.nativeElement;if(a){let o=a.selectionStart,r=a.value.substring(0,o),s=a.value.substring(o),c=r+i+s;a.value=c,a.selectionStart=a.selectionEnd=o+i.length,a.focus(),this.controls.observation.setValue(c)}}getForm(i=""){return this.formBuilder.group({observation:new Jn(i,[])})}
6setTranslatedClientTreatmentType(){this.translatedClientTreatmentType=this.clientTreatmentType===xe.PATIENT?this.translationService.get(U.PatientsUpper):this.translationService.get(U.StudentsUpper)}};n.\u0275fac=function(a){return new(a||n)(y(Te),y(ea),y(sa),y(dt),y(ta),y(ae),y(Na),y(Oe),y(oa,8))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-birthday-preferences-modal"]],viewQuery:function(a,o){if(a&1&&(ne(q,5),ne(ju,5)),a&2){let r;te(r=ie())&&(o.modal=r.first),te(r=ie())&&(o.observationInput=r.first)}},features:[Un([Na])],decls:44,vars:51,consts:[["observationInput",""],[3,"keydown.escape"],[1,"user-notification-settings"],[1,"title-modal"],[1,"settings-content"],["variant","text","size","sm","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"observation-content"],["type","textarea",3,"maxLength","showHint","control"],["tabindex","0",1,"patient-full-name-container",3,"click"],[3,"onCustomChange","checked","title"],["variant","secondary","icon","print","iconType","left",1,"print-list-button",3,"onClick"],[1,"buttons"],["variant","secondary",3,"onClick","fullSize"],[3,"onClick","fullSize"],[4,"ngIf"],[3,"active"]],template:function(a,o){if(a&1){let r=I();m(0,"vedius-modal",1),A("keydown.escape",function(){return D(r),L(o.close())}),m(1,"div",2)(2,"h1",3),v(3),x(4,"translate"),h(),m(5,"div",4)(6,"vedius-text",5),v(7),x(8,"translate"),h(),m(9,"div",6),w(10,"vedius-input",7,0),h(),m(12,"div",8),A("click",function(){return D(r),L(o.addParameter(o.patienteNameToBirthday))}),v(13),h()(),m(14,"div",4)(15,"vedius-text",5),v(16),x(17,"translate"),h(),m(18,"vedius-switch",9),x(19,"translate"),A("onCustomChange",function(c){return D(r),L(o.onSwitchChanged("BIRTHDAY_SETTING_PATIENT_ACTIVE",c))}),h(),m(20,"vedius-switch",9),x(21,"translate"),A("onCustomChange",function(c){return D(r),L(o.onSwitchChanged("BIRTHDAY_SETTING_PATIENT_INACTIVE",c))}),h()(),m(22,"div",4)(23,"vedius-text",5),v(24),x(25,"translate"),h(),m(26,"vedius-switch",9),x(27,"translate"),x(28,"translate"),A("onCustomChange",function(c){return D(r),L(o.onSwitchChanged("BIRTHDAY_SETTING_ALREADY_HAPPENED_OPTIONS",c))}),h()(),m(29,"div",4)(30,"vedius-text",5),v(31),x(32,"translate"),h(),m(33,"vedius-button",10),A("onClick",function(){return D(r),L(o.printListPdf())}),v(34),x(35,"translate"),h()(),m(36,"div",11)(37,"vedius-button",12),A("onClick",function(){return D(r),L(o.close())}),v(38),x(39,"translate"),h(),m(40,"vedius-button",13),A("onClick",function(){return D(r),L(o.onSave())}),v(41),x(42,"translate"),h()()(),C(43,Yu,2,1,"div",14),h()}a&2&&(l(3),T(" ",S(4,21,"BIRTHDAY_SETTING_FORM.TITLE")," "),l(4),T(" ",S(8,23,"BIRTHDAY_SETTING_FORM.SUBTITLE")," "),l(3),p("maxLength",400)("showHint",!1)("control",o.controls.observation),l(3),T(" ",o.patienteNameToBirthday," "),l(3),T(" ",S(17,25,"BIRTHDAY_SETTING_FORM.SUBTITLE_SETTING_LIST_STATUS")," "),l(2),p("checked",o.isChecked("BIRTHDAY_SETTING_PATIENT_ACTIVE"))("title",F(19,27,"BIRTHDAY_SETTING_FORM.BIRTHDAY_SETTING_PATIENT_ACTIVE",V(47,Hc,o.translatedCl
6ientTreatmentType))),l(2),p("checked",o.isChecked("BIRTHDAY_SETTING_PATIENT_INACTIVE"))("title",F(21,30,"BIRTHDAY_SETTING_FORM.BIRTHDAY_SETTING_PATIENT_INACTIVE",V(49,Hc,o.translatedClientTreatmentType))),l(4),T(" ",S(25,33,"BIRTHDAY_SETTING_FORM.SUBTITLE_ALREADY_HAPPENED")," "),l(2),p("checked",o.isChecked("BIRTHDAY_SETTING_ALREADY_HAPPENED_OPTIONS"))("title",o.isChecked("BIRTHDAY_SETTING_ALREADY_HAPPENED_OPTIONS")?S(27,35,"BIRTHDAY_SETTING_FORM.BIRTHDAY_SETTING_ALREADY_HAPPENED_OPTIONS"):S(28,37,"BIRTHDAY_SETTING_FORM.BIRTHDAY_SETTING_ALREADY_HAPPENED_OPTIONS_NOT_SHOW")),l(5),T(" ",S(32,39,"BIRTHDAY_SETTING_FORM.SUBTITLE_PRINT_LIST")," "),l(3),T(" ",S(35,41,"BIRTHDAY_SETTING_FORM.BUTTON_PRINT_LIST_PDF")," "),l(3),p("fullSize",!0),l(),W(S(39,43,"BUTTONS.CANCEL")),l(2),p("fullSize",!0),l(),W(S(42,45,"BUTTONS.SAVE")),l(2),p("ngIf",o.isSaving))},dependencies:[q,j,z,re,$,Y,ma,la,ca,js],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.user-notification-settings{display:flex;flex-direction:column;gap:16px}.user-notification-settings .neutral-darker-color{color:#425168}.user-notification-settings .neutral-dark-color{color:#6d7a8e}.user-notification-settings .title-modal{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;gap:16px;margin:0;max-width:450px}.user-notification-settings .tab-options-wrapper{width:100%;padding:8px 0;box-sizing:border-box}.user-notification-settings .tab-options-wrapper vedius-button-group{width:100%}.user-notification-settings .tab-options-wrapper vedius-button-group mat-button-toggle-group{width:100%}.user-notification-settings .tab-options-wrapper vedius-button-group mat-button-toggle-group mat-button-toggle{width:100%}.user-notification-settings .print-list-button button{width:260px}.user-notification-settings .settings-content{display:flex;flex-direction:column;gap:32px;width:100%;margin-top:16px;overflow:auto;max-height:calc(100vh - 300px)}.user-notification-settings .settings-content .patient-full-name-container{display:flex;align-items:center;justify-content:center;background-color:#f5f6f8;border-radius:8px;padding:12px;margin-bottom:16px;max-width:260px;cursor:pointer}.user-notification-settings .buttons{margin-top:16px;display:flex;flex-direction:row;gap:16px;justify-content:flex-end;width:100%}@media screen and (max-width: 600px){.user-notification-settings{margin-top:4px}.user-notification-settings .title-modal{font-size:1.25rem;line-height:1.875rem;margin:0;max-width:250px}.user-notification-settings .settings-content{max-height:100%}.user-notification-settings .buttons{display:flex;flex-direction:column-reverse;gap:16px;justify-content:center;width:100%;margin-bottom:24px}.user-notification-settings .buttons vedius-button{width:100%}} 7`],encapsulation:2});let e=n;return e})();var Ga=(()=>
7{let n=class n{constructor(){this.patientsBirthdaySubject=new $t([]),this.patientsBirthday$=this.patientsBirthdaySubject.asObservable()}notifyPatientBirthday(i){this.patientsBirthdaySubject.next(i)}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var $c=(()=>{let n=class n{constructor(i,a,o){this.whatsappClient=i,this.toastService=a,this.translation=o}sendWhatsappMessage(o){return B(this,arguments,function*({patient:i,message:a}){try{let r=i.phone;if(!r)return this.toastService.showInfo({title:this.translation.get(U.PatientWithoutPhoneMessage)}),!1;let s=a??this.translation.get(U.HappyBirthday);if(i.name){let c=this.translation.get(U.ClienteNameParameterReminderMessageBirthday),d=new RegExp(c,"g");s=s.replace(d,String(i.name.fullName))}return yield this.whatsappClient.send({message:s,phone:r}),!0}catch(r){return console.error(r),!1}})}};n.\u0275fac=function(a){return new(a||n)(G($s),G(dt),G(ae))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Wc=e=>({value:e}),Xc=e=>({month:e}),Wu=()=>({height:"240px"});function Xu(e,n){if(e&1&&(m(0,"vedius-text",22),v(1),x(2,"dayMonthDate"),h()),e&2){let t=f().$implicit;l(),T(" ",S(2,1,t.birthday.date),"")}}function Uu(e,n){if(e&1){let t=I();P(0),m(1,"div",12)(2,"li",13)(3,"div",14)(4,"div",15),w(5,"vedius-avatar",16),m(6,"div",17)(7,"span",18),v(8),h(),C(9,Xu,3,3,"vedius-text",19),h()(),m(10,"div",20)(11,"vedius-button",21),A("onClick",function(){let a=D(t).$implicit,o=f(3);return L(o.sendWhatsappMessage(a))}),v(12),x(13,"translate"),h()()()()(),E()}if(e&2){let t=n.$implicit,i=f(3);l(5),ee("src",t.imageUrl==null?null:t.imageUrl.url),ee("alt",t.visibleName),l(3),W(t.visibleName),l(),p("ngIf",t.birthday),l(2),p("iconType",i.isSmall?"only":"left")("withStroke",!1),l(),T(" ",S(13,7,"DASHBOARD_PAGE.BIRTHDAYS.SEND_WHATSAPP")," ")}}function Qu(e,n){if(e&1){let t=I();P(0),m(1,"div",5)(2,"vedius-text",6)(3,"span",7),v(4),x(5,"translate"),x(6,"translate"),h(),m(7,"span"),v(8),x(9,"translate"),h()(),m(10,"div",8),x(11,"translate"),A("click",function(){D(t);let a=f(2);return L(a.openBirthdayModal())}),w(12,"img",9),h()(),m(13,"ul",10),C(14,Uu,14,9,"ng-container",11),h(),E()}if(e&2){let t=f(2);l(4),T("",t.total>1?F(5,4,"DASHBOARD_PAGE.BIRTHDAYS.PLURAL_TITLE_1",V(15,Wc,t.total)):F(6,7,"DASHBOARD_PAGE.BIRTHDAYS.SINGLE_TITLE_1",V(17,Wc,t.total))," "),l(4),W(F(9,10,"DASHBOARD_PAGE.BIRTHDAYS.TITLE_2",V(19,Xc,t.month))),l(2),ee("matTooltip",S(11,13,"DASHBOARD_SIDEBAR.SETTINGS")),l(4),p("ngForOf",t.patients)}}function qu(e,n){e&1&&Ce(0)}function Ku(e,n){if(e&1&&(P(0),C(1,qu,1,0,"ng-container",23),E()),e&2){f(2);let t=he(3);l(),p("ngTemplateOutlet",t)}}function Zu(e,n){e&1&&(m(0,"div",24),w(1,"img",25),h())}function Ju(e,n){if(e&1&&(m(0,"div",3),C(1,Qu,15,21,"ng-container",2)(2,Ku,2,1,"ng-container",2)(3,Zu,2,0,"div",4),h()),e&2){let t=f();X("empty",t.total===0)("small",t.isSmall),l(),p("ngIf",t.total>0),l(),p("ngIf",t.total===0),l(),p("ngIf",t.total>0)}}function eg(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",26),E()),e&2&&(l(),p("count",1)("theme",Q(2,Wu)))}function tg(e,n){if(e&1){let t=I();m(0,"div",5)(1,"vedius-text",27)(2,"span",7),v(3),x(4,"translate"),h(),m(5,"span"),v(6),x(7,"translate"),h()(),m(8,"div",8),x(9,"translate"),A("click",function(){D(t);let a=f();return L(a.openBirthdayModal())}),w(10,"img",28),h()(),m(11,"div",29),w(12,"img",30),m(13,"vedius-text",31),v(14),x(15,"translate"),h()()}if(e&2){let t=f();l(3),T("",S(4,4,"DASHBOARD_PAGE.BIRTHDAYS.EMPTY_TITLE_1")," "),l(3),W(F(7,6,"DASHBOARD_PAGE.BIRTHDAYS.TITLE_2",V(13,Xc,t.month))),l(2),ee("matTooltip",S(9,9,"DASHBOARD_SIDEBAR.SETTINGS")),l(6),T(" ",S(15,11,"DASHBOARD_PAGE.BIRTHDAYS.EMPTY_DESCRIPTION")," ")}}var Uc=(()=>{let n=class n{constructor(i,a,o,r,s,c,d){this.zone=i,this.patientService=a,this.patientBirthdayService=o,this.appLocaleContext=r,this.patientBirthdayMessageService=s,this.dialog=c,this.appContext=d,this.isSmall=!1,this.loadingDelay=0,this.total=0,this.month="",this.patients=[],this.isLoading=!0,this.initialLoadSubject=ne
7w we,this.destroy$=new we,this.month=new Date().toLocaleString(this.appLocaleContext.current,{month:"long"})}get userVedius(){return this.appContext.current}ngOnInit(){this.isLoading=!0,this.startInitialSubjectLoad(),this.initialLoadSubject.next()}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}load(){return B(this,null,function*(){let i=nl.fromDateTZ(Fs.fromNow()),a=this.userVedius.settings.birthdayDisplaySettings?.settings;this.isLoading=!0;try{let o=i.date.getDate(),r=yield this.loadPatients(i),s=a?.BIRTHDAY_SETTING_PATIENT_ACTIVE??!1,c=a?.BIRTHDAY_SETTING_PATIENT_INACTIVE??!1,d=a?.BIRTHDAY_SETTING_ALREADY_HAPPENED_OPTIONS??!1,u=r.filter(_=>_.status!==Vo.DECEASED&&_.status!==Vo.DROP_OUT);d||(u=u.filter(_=>_.birthday&&_.birthday.date?new Date(_.birthday.date).getDate()>=o:!1)),s&&!c?u=u.filter(_=>_.activated===!0):c&&!s&&(u=u.filter(_=>_.activated===!1));let g=u.sort((_,b)=>!_.birthday?.toDateString()||!b.birthday?.toDateString()?0:_.birthday.toDateString().localeCompare(b.birthday.toDateString()));this.patients=g,this.total=this.patients.length,this.notifyBirthday()}catch(o){console.error("Error to load patient birthdays: ",o)}finally{this.zone.run(()=>{this.isLoading=!1})}})}loadPatients(i){return B(this,null,function*(){return yield this.patientService.getPatientsWithBirthdayInTheMonth({birthday:i})})}notifyBirthday(){let i=new Date,a=this.patients.filter(o=>ms(o.birthday.date,i));a.length>0&&this.patientBirthdayService.notifyPatientBirthday(a)}sendWhatsappMessage(i){let a=this.userVedius.settings.birthdayDisplaySettings?.messageBirthday;this.patientBirthdayMessageService.sendWhatsappMessage({patient:i,message:a})}openBirthdayModal(){this.openModal(jc,{data:this.patients}).afterClosed().subscribe({next:a=>{a&&this.load()},error:a=>{console.error("Erro ao fechar o modal:",a)}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}openModal(i,a){return this.dialog.open(i,Ot({width:"600px",disableClose:!0,autoFocus:!1},a))}};n.\u0275fac=function(a){return new(a||n)(y(an),y(pt),y(Ga),y(st),y($c),y(He),y(Te))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-birthdays"]],inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:4,vars:2,consts:[["emptyBirthdays",""],["class","dashboard-birthdays-component",3,"empty","small",4,"ngIf"],[4,"ngIf"],[1,"dashboard-birthdays-component"],["class","celebration-birthdays-wrapper",4,"ngIf"],[1,"title-wrapper"],["variant","display","size","micro",1,"title","neutral-day-color"],[1,"weight-bold"],["tabindex","0",1,"setting-wrapper-birthday",3,"click","matTooltip"],["src","../../../../../../../assets/images/birthday-settings-button.svg","alt","SETTING BUTTON"],[1,"patient-list-items"],[4,"ngFor","ngForOf"],[1,"patient-list-item-wrapper"],[1,"patient-list-item"],[1,"patient-list-item-content"],[1,"patient-left-content"],["size","medium",3,"src","alt"],[1,"text-info"],[1,"patient-name"],["variant","text","size","sm",4,"ngIf"],[1,"patient-right-content"],["variant","secondary","icon","whatsapp","size","small",1,"whatsapp-button",3,"onClick","iconType","withStroke"],["variant","text","size","sm"],[4,"ngTemplateOutlet"],[1,"celebration-birthdays-wrapper"],["src","../../../../../../assets/images/celebration-birthdays.svg","alt","celebration"],[1,"loader",3,"count","theme"],["variant","display","size","micro",1,"neutral-darker-color"],["src","../../../../../../../assets/images/birthday-settings-button-2.svg","alt","SETTING BUTTON"],[1,"empty-content"],["src","../../../../../../assets/images/birthdays-empty.svg","alt","empty-state"],["variant","text","size","sm",1,"neutral-darker-color"]],template:function(a,o){a&1&&C(0,Ju,4,7,"div",1)(1,eg,2,3,"ng-container",2)(2,tg,16,15,"ng-template",null,0,me),a&2&&(p("ngIf",!o.isLoading),l(),p("ngIf",o.isLoading))},dependencies:[z,j,le,At,re,ze,Ee,Pe,$,Y,jl,aa],styles:['.disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
7-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}[_ngcontent-%COMP%]:root{width:100%}.dashboard-birthdays-component[_ngcontent-%COMP%]{display:flex;padding:32px;flex-direction:column;gap:24px;align-self:stretch;min-height:240px;border-radius:12px;background:#0d7180;position:relative}.dashboard-birthdays-component.empty[_ngcontent-%COMP%]{background:#fff}.dashboard-birthdays-component[_ngcontent-%COMP%] .loader[_ngcontent-%COMP%]{width:100%}.dashboard-birthdays-component[_ngcontent-%COMP%] .loader[_ngcontent-%COMP%] img[alt="SETTING BUTTON"][_ngcontent-%COMP%]{cursor:pointer}.dashboard-birthdays-component[_ngcontent-%COMP%] .loader[_ngcontent-%COMP%] img[alt="SETTING BUTTON"][_ngcontent-%COMP%]:hover{opacity:.8}.dashboard-birthdays-component[_ngcontent-%COMP%] .title-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%}.dashboard-birthdays-component[_ngcontent-%COMP%] .title-wrapper[_ngcontent-%COMP%] .setting-wrapper-birthday[_ngcontent-%COMP%]{cursor:pointer;z-index:20}.dashboard-birthdays-component[_ngcontent-%COMP%] .title-wrapper[_ngcontent-%COMP%] .setting-wrapper-birthday[_ngcontent-%COMP%]:hover{opacity:.8}.dashboard-birthdays-component[_ngcontent-%COMP%] .neutral-day-color[_ngcontent-%COMP%]{color:#fff}.dashboard-birthdays-component[_ngcontent-%COMP%] .neutral-darker-color[_ngcontent-%COMP%]{color:#425168}.dashboard-birthdays-component[_ngcontent-%COMP%] .weight-bold[_ngcontent-%COMP%]{font-weight:700}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;list-style:none;margin:0;padding:0;z-index:1}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%]{position:relative;width:100%}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%]{color:#fff;width:100%;transition:.2s all;outline:none}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%]{display:flex;padding:12px 0;align-items:center;gap:24px;align-self:stretch;width:100%}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-left-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;flex:1;min-width:0}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-left-content[_ngcontent-%COMP%] .text-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;flex:1;min-width:0}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-left-content[_ngcontent-%COMP%] .text-info[_ngcontent-%COMP%] .patient-name[_ngcontent-%COMP%]{font-family:DM Sans;font-size:1rem;font-style:normal;font-weight:700;line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:inline-block;width:100%}.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-right-content[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0;width:175px;justify-content:flex-end}
7.dashboard-birthdays-component[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-right-content[_ngcontent-%COMP%] .whatsapp-button[_ngcontent-%COMP%]{display:flex;width:100%;justify-content:flex-end}.dashboard-birthdays-component[_ngcontent-%COMP%] .celebration-birthdays-wrapper[_ngcontent-%COMP%]{position:absolute;right:0;bottom:-5px}.dashboard-birthdays-component[_ngcontent-%COMP%] .empty-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:4px;box-sizing:border-box}.dashboard-birthdays-component[_ngcontent-%COMP%] .empty-content[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:150px;max-height:150px}.dashboard-birthdays-component.small[_ngcontent-%COMP%]{border-radius:8px;padding:24px}.dashboard-birthdays-component.small[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%]{gap:8px}.dashboard-birthdays-component.small[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-left-content[_ngcontent-%COMP%], .dashboard-birthdays-component.small[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-left-content[_ngcontent-%COMP%] .text-info[_ngcontent-%COMP%]{flex:1;min-width:0}.dashboard-birthdays-component.small[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-right-content[_ngcontent-%COMP%]{flex-shrink:0;width:auto;justify-content:flex-end}.dashboard-birthdays-component.small[_ngcontent-%COMP%] .patient-list-items[_ngcontent-%COMP%] .patient-list-item-wrapper[_ngcontent-%COMP%] .patient-list-item[_ngcontent-%COMP%] .patient-list-item-content[_ngcontent-%COMP%] .patient-right-content[_ngcontent-%COMP%] .whatsapp-button[_ngcontent-%COMP%]{width:auto;min-width:120px}.dashboard-birthdays-component.small[_ngcontent-%COMP%] .celebration-birthdays-wrapper[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:170px}']});let e=n;return e})();var Qc=(()=>{let n=class n{constructor(){this.modal=null}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-appointments-info-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:13,vars:10,consts:[[1,"dashboard-appointments-info-modal"],[1,"title"],[1,"appointments-info-content"],["variant","text","size","md","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"bottom"],[3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"div",2)(6,"vedius-text",3),v(7),x(8,"translate"),h()(),m(9,"div",4)(10,"vedius-button",5),A("onClick",function(){return o.close()}),v(11),x(12,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,4,"DASHBOARD_PAGE.MODAL_INFO.APPOINTMENTS.TITLE")," "),l(4),T(" ",S(8,6,"DASHBOARD_PAGE.MODAL_INFO.APPOINTMENTS.DESCRIPTION"),""),l(3),p("fullSize",!0),l(),T(" ",S(12,8,"BUTTONS.UNDERSTOOD"),""))},dependencies:[q,j,re,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-appointments-info-modal{display:flex;flex-direction:column;gap:24px}.dashboard-appointments-info-modal .neutral-dusk-color{color:#192840}.dashboard-appointments-info-modal .neutral-darker-color{color:#425168}.dashboard-appointments-info-modal .loader{width:100%}.dashboard-appointments-info-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:4px 0}.dashboard-appointments-info-modal .bottom{width:100%;margin-top:16px}.dashboard-appointments-info-modal .bottom vedius-button{width:100%}@media screen and (max-width: 600px){.dashboard-appointments-info-modal .title{font-size:1.25rem;line-height:1.875rem;margin:12px 0 0}} 8`],encapsulation:2});let e=n;return e})();function ig(e,n){e&1&&(m(0,"span"),v(1,"\u{1F389} "),h())}function ng(e,n){if(e&1&&(w(0,"vedius-status-label",19),x(1,"translate"),x(2,"translate")),e&2){let t=f(3);X("replacement-canceled",t.isReplacementCanceled),ee("text",t.isReplacementCanceled?S(2,6,"AGENDA.REPLACEMENT_CANCELED"):S(1,4,"AGENDA.REPLACEMENT")),p("status",t.replacementStatusLabel)}}function ag(e,n){if(e&1){let t=I();m(0,"app-event-status-menu-button",20),A("onMenuItemSelected",function(a){D(t);let o=f(3);return L(o.eventStatusMenuChanged(o.event,a))}),h()}}function og(e,n){if(e&1&&(P(0),m(1,"div",15),C(2,ng,3,8,"vedius-status-label",16),w(3,"app-event-status-label",17),C(4,ag,1,0,"app-event-status-menu-button",18),h(),E()),e&2){let t=f(2);l(2),p("ngIf",t.event.isReplacementCreated),l(),p("status",t.event.status),l(),p("ngIf",!t.isReplacementCanceled&&!t.isEventType)}}function rg(e,n){if(e&1&&(w(0,"vedius-status-label",19),x(1,"translate"),x(2,"translate")),e&2){let t=f(3);X("replacement-canceled",t.isReplacementCanceled),ee("text",t.isReplacementCanceled?S(2,6,"AGENDA.REPLACEMENT_CANCELED"):S(1,4,"AGENDA.REPLACEMENT")),p("status",t.replacementStatusLabel)}}function sg(e,n){if(e&1){let t=I();m(0,"app-event-status-menu-button",23),A("onMenuItemSelected",function(a){D(t);let o=f(3);return L(o.eventStatusMenuChanged(o.event,a))}),h()}if(e&2){let t=f(3);p("isListFilteredByDate",t.isListFilteredByDate)}}function lg(e,n){if(e&1&&(m(0,"div",21)(1,"div",15),C(2,rg,3,8,"vedius-status-label",16),w(3,"app-event-status-label",17),C(4,sg,1,1,"app-event-status-menu-button",22),h()()),e&2){let t=f(2);l(2),p("ngIf",t.event.isReplacementCreated),l(),p("status",t.event.status),l(),p("ngIf",!t.isReplacementCanceled&&!t.isEventType)}}function cg(e,n){if(e&1&&(m(0,"div",1)(1,"li",2)(2,"div",3)(3,"div",4),w(4,"vedius-avatar",5),m(5,"div",6)(6,"vedius-text",7),C(7,ig,2,0,"span",8),v(8),h(),m(9,"div",9)(10,"vedius-text",10),v(11),h(),m(12,"div",11),w(13,"vedius-dot-palette",12),m(14,"vedius-text",13),v(15),h()()(),C(16,og,5,3,"ng-container",8),h()(),C(17,lg,5,3,"div",14),h()()()),e&2){let t=f();X("small",t.isSmall),l(4),ee("src",(t.event.patientInfo==null||t.event.patientInfo.imageUrl==null?null:t.event.patientInfo.imageUrl.url)||""),ee("alt",t.displayName),p("state",t.event.meetingType==="remote"?"remote":"default"),l(2),X("birthday",t.isBirthday),p("weight",t.isBirthday?"bold":"normal"),l(),p("ngIf",t.isBirthday),l(),T(" ",t.displayName,""),l(3),W(t.event.timeRange.toString()),l(2),p("color",t.event.color||""),l(2),T(" ",t.serviceTypeLabel,""),l(),p("ngIf",t.isSmall),l(),p("ngIf",!t.isSmall)}}var qc=(()=>{let n=class n{constructor(i,a){this.userVediusContext=i,this.translation=a,this.isSmall=!1,this.onChangeStatus=new J,this.replacementStatusLabel=cl.PURPLE_LIGHTER,this.serviceTypeLabel="",this.eventTypeLabel="",this.isListFilteredByDate=!0}get userVedius(){return this.userVediusContext.current}get isPatientTreatmentType(){return this.userVedius?.clientTreatmentType===xe.PATIENT}get isReplacementCanceled(){return this.event?.isReplacementCanceled||!1}get isEventType(){return this.event?.eventType===da.eventType}get displayName(){return this.event?.patientInfo?.visibleName?.trim()||this.event?.title?.trim()||this.eventTypeLabel}ngOnInit(){this.translation.loaded().then(()=>{this.eventTypeLabel=this.isEventType?this.translate(U.DefaultEventTitle):"",this.loadServiceTypeLabel()})}loadServiceTypeLabel(){if(this.isEventType){this.serviceTypeLabel=this.eventTypeLabel;return}this.event?.serviceType&&(this.serviceTypeLabel=this.getServiceTypeLabel(this.event.serviceType))}getServiceTypeLabel(i){return Ds.includes(i)?this.translate(`${U.ServicesAgenda}.${i}`):i}eventStatusMenuChanged(i,a){this.onChangeStatus.emit({eventCalendarDisplay:i,status:a.key})}translate(i){return this.translation.get(i)}};n.\u0275fac=function(a){return new(a||n)(y(Te),y(ae))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-appointment-item"]],inputs:{event:"event",isBirthday:"isBirthday",isSmall:"isSmall"},outputs:{onChangeStatus:"onChangeStatus"},decls:1,vars:1,consts:[["class","appointment-list-item-wrapper",3,"small",4,"ngIf"],[1,"appointment-list-item-wrapper"],[1,"appointment-list-item"],[1,"appointment-list-item-content"],[1,"appointment-list-item-left-content"],["size","medium",3,"state","src","alt"],[1,"item-text-content"],["variant","text","size","md",1,"neutral-dusk-color",3,"weight"],[4,"ngIf"],[1,"item-text-row"],["variant","text","size","sm",1,"time-label","neutral-dark-color"],[1,"service-scheduling-content"],[3,"color"],["variant","text","size","sm",1,"neutral-dusk-color"],["class","appointment-list-item-right-content",4,"ngIf"],[1,"status-scheduling-content"],["class","replacement-status-label","size","micro",3,"replacement-canceled","status","text",4,"ngIf"],["size","micro",3,"status"],[3,"onMenuItemSelected",4,"ngIf"],["size","micro",1,"replacement-status-label",3,"status","text"],[3,"onMenuItemSelected"],[1,"appointment-list-item-right-content"],[3,"isListFilteredByDate","onMenuItemSelected",4,"ngIf"],[3,"onMenuItemSelected","isListFilteredByDate"]],template:function(a,o){a&1&&C(0,cg,18,15,"div",0),a&2&&p("ngIf",o.event)},dependencies:[z,At,j,Jt,kl,Ml,Ol,$,Y],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
8-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}[_ngcontent-%COMP%]:root{width:100%}.appointment-list-item-wrapper[_ngcontent-%COMP%]{position:relative}.appointment-list-item-wrapper[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.appointment-list-item-wrapper[_ngcontent-%COMP%] .neutral-dark-color[_ngcontent-%COMP%]{color:#6d7a8e}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%]{width:100%;transition:.2s all;outline:none}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%]{display:flex;padding:12px 0;justify-content:space-between;align-items:center;align-self:stretch;gap:16px}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;width:100%}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%] .birthday[_ngcontent-%COMP%]{color:#7c4805}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%] .time-label[_ngcontent-%COMP%]{width:100px}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%] .item-text-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:40px;width:100%}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%] .service-scheduling-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;min-width:120px}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-right-content[_ngcontent-%COMP%]{width:auto}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-right-content[_ngcontent-%COMP%] .status-scheduling-content[_ngcontent-%COMP%]{min-width:120px;display:flex;align-items:center;justify-content:flex-end;gap:8px}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-right-content[_ngcontent-%COMP%] .status-scheduling-content[_ngcontent-%COMP%] app-event-status-label[_ngcontent-%COMP%]{min-width:120px}.appointment-list-item-wrapper[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-right-content[_ngcontent-%COMP%] .status-scheduling-content[_ngcontent-%COMP%] .replacement-canceled[_ngcontent-%COMP%]{min-width:150px}.appointment-list-item-wrapper.small[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%]{flex-direction:column;gap:8px}.appointment-list-item-wrapper.small[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%]{align-items:flex-start}.appointment-list-item-wrapper.small[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%] .item-text-row[_ngcontent-%COMP%]{gap:16px}.appointment-list-item-wrapper.small[_ngcontent-%COMP%] .appointment-list-item[_ngcontent-%COMP%] .appointment-list-item-content[_ngcontent-%COMP%] .appointment-list-item-left-content[_ngcontent-%COMP%] .item-text-content[_ngcontent-%COMP%] .status-scheduling-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center}"]});let e=n;return e})();function dg(e,n){if(e&1&&(m(0,"vedius-text",8),v(1),h()),e&2){let t=f(2);l(),W(t.currentNumber)}}function pg(e,n){if(e&1&&(m(0,"vedius-text",9),v(1),h()),e&2){let t=f(2);l(),W(t.currentLetters)}}function mg(e,n){if(e&1&&(m(0,"div",5),C(1,dg,2,1,"vedius-text",6)(2,pg,2,1,"vedius-text",7),h()),e&2){let t=f();l(),p("ngIf",!t.hideCurrentNumber),l(),p("ngIf",!t.hideCurrentLetters)}}function hg(e,n){if(e&1&&w(0,"span"),e&2){let t=f().$implicit,i=f(2);Fe("flex",t.number/i.max)("background-color",t.color)}}function ug(e,n){if(e&1&&(P(0),C(1,hg,1,4,"span",12),E()),e&2){let t=n.$implicit;l(),p("ngIf",t.number!==0)}}function gg(e,n){if(e&1&&(m(0,"div",10),C(1,ug,2,1,"ng-container",11),h()),e&2){let t=f();
8p("ngClass",t.barSize),l(),p("ngForOf",t.rows)}}function fg(e,n){if(e&1&&(m(0,"div",10),w(1,"span",13),h()),e&2){let t=f();p("ngClass",t.barSize)}}function _g(e,n){if(e&1&&(m(0,"vedius-text",20),v(1),h()),e&2){let t=f().$implicit;l(),W(t.label)}}function xg(e,n){if(e&1&&(m(0,"div",16),w(1,"span",17),m(2,"vedius-text",18),v(3),h(),C(4,_g,2,1,"vedius-text",19),h()),e&2){let t=n.$implicit;l(),Fe("background-color",t.color),l(2),W(t.number),l(),p("ngIf",t.label)}}function vg(e,n){if(e&1&&(m(0,"div",14),C(1,xg,5,4,"div",15),h()),e&2){let t=f();l(),p("ngForOf",t.rows)}}function bg(e,n){if(e&1&&(m(0,"vedius-text",27),v(1),h()),e&2){let t=f().$implicit;l(),W(t.label)}}function yg(e,n){if(e&1&&(m(0,"div",23),C(1,bg,2,1,"vedius-text",24),m(2,"div",25),w(3,"vedius-dot-palette",26),m(4,"vedius-text",18),v(5),h()()()),e&2){let t=n.$implicit;l(),p("ngIf",t.label),l(2),p("color",t.color),l(2),W(t.number)}}function Cg(e,n){if(e&1&&(m(0,"div",21),C(1,yg,6,3,"div",22),h()),e&2){let t=f();l(),p("ngForOf",t.rows)}}var ti=(()=>{let n=class n{constructor(){this.currentNumber=0,this.currentLetters="",this.max=10,this.rows=[],this.detailsType="row",this.barSize="small",this.hideCurrentNumber=!1,this.hideCurrentLetters=!1,this.hideDetailsType=!1}isAllEmpty(){return this.rows?.map(i=>i.number).every(i=>i===0)}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["vedius-summary-progress-bar"]],inputs:{currentNumber:"currentNumber",currentLetters:"currentLetters",max:"max",rows:"rows",detailsType:"detailsType",barSize:"barSize",hideCurrentNumber:"hideCurrentNumber",hideCurrentLetters:"hideCurrentLetters",hideDetailsType:"hideDetailsType"},decls:6,vars:5,consts:[[1,"summary-progress-bar-component"],["class","current",4,"ngIf"],["class","bar",3,"ngClass",4,"ngIf"],["class","detail",4,"ngIf"],["class","columns-detail",4,"ngIf"],[1,"current"],["class","number","variant","display","size","md",4,"ngIf"],["class","letters","variant","text","size","sm",4,"ngIf"],["variant","display","size","md",1,"number"],["variant","text","size","sm",1,"letters"],[1,"bar",3,"ngClass"],[4,"ngFor","ngForOf"],[3,"flex","background-color",4,"ngIf"],[1,"empty-bar"],[1,"detail"],["class","row",4,"ngFor","ngForOf"],[1,"row"],[1,"bar-wrapper"],["variant","text","size","md",1,"summary-number"],["variant","text","size","sm",4,"ngIf"],["variant","text","size","sm"],[1,"columns-detail"],["class","column-item",4,"ngFor","ngForOf"],[1,"column-item"],["class","label-detail","variant","text","size","micro",4,"ngIf"],[1,"dot-quantity"],["size","small",3,"color"],["variant","text","size","micro",1,"label-detail"]],template:function(a,o){a&1&&(m(0,"div",0),C(1,mg,3,2,"div",1)(2,gg,2,2,"div",2)(3,fg,2,1,"div",2)(4,vg,2,1,"div",3)(5,Cg,2,1,"div",4),h()),a&2&&(l(),p("ngIf",!o.hideCurrentNumber&&!o.hideCurrentLetters),l(),p("ngIf",!o.isAllEmpty()),l(),p("ngIf",o.isAllEmpty()),l(),p("ngIf",!o.hideDetailsType&&o.detailsType==="row"),l(),p("ngIf",!o.hideDetailsType&&o.detailsType==="column"))},dependencies:[z,j,yt,le,Jt],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.summary-progress-bar-component .current{align-items:center;display:flex}.summary-progress-bar-component vedius-text{color:#192840;font-weight:700;margin-right:8px}.summary-progress-bar-component vedius-text:last-child{color:#6d7a8e;font-weight:400;margin-right:0}.summary-progress-bar-component .bar{border-radius:8px;display:flex;flex-wrap:wrap;gap:2px;background-color:#f5f6f8;margin-top:8px;overflow:hidden;width:100%}.summary-progress-bar-component .bar.small{height:4px}.summary-progress-bar-component .bar.medium{height:8px}.summary-progress-bar-component .bar span{display:flex;height:100%;border-radius:8px}.summary-progress-bar-component .bar .empty-bar:nth-child(1){flex:1;background-color:#d3dae5}.summary-progress-bar-component .detail{margin-top:24px}.summary-progress-bar-component .detail .row{display:flex;margin-top:8px;align-items:center}.summary-progress-bar-component .detail .row span.bar-wrapper{align-self:center;border-radius:8px;display:block;height:4px;margin-right:8px;width:12px}.summary-progress-bar-component .detail .row .summary-number span{min-width:12px;text-align:center}.summary-progress-bar-component .columns-detail{margin-top:24px;display:flex;align-items:flex-start;gap:8px 24px;align-self:stretch;flex-wrap:wrap}.summary-progress-bar-component .columns-detail .column-item{display:flex;flex-direction:column;align-items:flex-start}.summary-progress-bar-component .columns-detail .column-item .label-detail{color:#6d7a8e}.summary-progress-bar-component .columns-detail .column-item .dot-quantity{display:flex;align-items:center;gap:8px}.summary-progress-bar-component .columns-detail .column-item .summary-number{color:#192840}.summary-progress-bar-component .columns-detail .column-item .summary-number span{min-width:12px;text-align:center} 9`],encapsulation:2});let e=n;return e})();var Tg=()=>({height:"64px"}),Sg=()=>({height:"400px"}),wg=e=>({client_type:e});function Ag(e,n){if(e&1){let t=I();m(0,"vedius-collaborator-selection-button",21),x(1,"translate"),x(2,"translate"),A("onFilterSelect",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))})("onLoad",function(a){D(t);let o=f();return L(o.onCollaboratorLoaded(a))}),h()}if(e&2){let t=f();ee("defaultLabel",S(1,4,"DASHBOARD_PAGE.DEFAULT_PROFESSIONAL_LABEL")),ee("labelForFullSelection",S(2,6,"DASHBOARD_PAGE.ALL_PROFESSIONAL_SELECTED")),p("type",t.isSmall?"modal":"dropdown")("maxLabels",1)}}function kg(e,n){e&1&&(m(0,"vedius-text",27),v(1),x(2,"translate"),h()),e&2&&(l(),T(" ",S(2,1,"DASHBOARD_PAGE.APPOINTMENTS.NEXT")," "))}function Dg(e,n){if(e&1){let t=I();P(0),m(1,"app-dashboard-appointment-item",28),A("onChangeStatus",function(a){D(t);let o=f(2);
9return L(o.changeStatus(a))}),h(),E()}if(e&2){let t=n.$implicit,i=f(2);l(),p("event",t)("isSmall",i.isSmall)("isBirthday",i.isPatientBirthday(t))}}function Lg(e,n){e&1&&(m(0,"vedius-text",27),v(1),x(2,"translate"),h()),e&2&&(l(),T(" ",S(2,1,"DASHBOARD_PAGE.APPOINTMENTS.RESUME")," "))}function Pg(e,n){if(e&1){let t=I();P(0),m(1,"app-dashboard-appointment-item",28),A("onChangeStatus",function(a){D(t);let o=f(2);return L(o.changeStatus(a))}),h(),E()}if(e&2){let t=n.$implicit,i=f(2);l(),p("event",t)("isSmall",i.isSmall)("isBirthday",i.isPatientBirthday(t))}}function Eg(e,n){if(e&1){let t=I();m(0,"vedius-button",29),A("onClick",function(){D(t);let a=f(2);return L(a.seeAll())}),v(1),x(2,"translate"),h()}e&2&&(p("fullSize",!0),l(),W(S(2,2,"DASHBOARD_PAGE.APPOINTMENTS.SEE_ALL")))}function Mg(e,n){if(e&1){let t=I();m(0,"vedius-button",30),A("onClick",function(){D(t);let a=f(2);return L(a.dontSeeAll())}),v(1),x(2,"translate"),h()}e&2&&(p("fullSize",!0),l(),T(" ",S(2,2,"DASHBOARD_PAGE.APPOINTMENTS.DONT_SEE_ALL"),""))}function Og(e,n){if(e&1&&(m(0,"ul",22),C(1,kg,3,3,"vedius-text",23)(2,Dg,2,3,"ng-container",24)(3,Lg,3,3,"vedius-text",23)(4,Pg,2,3,"ng-container",24)(5,Eg,3,4,"vedius-button",25)(6,Mg,3,4,"vedius-button",26),h()),e&2){let t=f();l(),p("ngIf",t.nextEventsCalendarDisplayDisplayed.length>0),l(),p("ngForOf",t.nextEventsCalendarDisplayDisplayed),l(),p("ngIf",t.resumeEventsCalendarDisplayDisplayed.length>0),l(),p("ngForOf",t.resumeEventsCalendarDisplayDisplayed),l(),p("ngIf",!t.isSeeAll),l(),p("ngIf",t.isSeeAll&&t.isGreaterThanMaximumAllowed)}}function Ig(e,n){e&1&&w(0,"ngx-skeleton-loader",31),e&2&&p("count",4)("theme",Q(2,Tg))}function Fg(e,n){e&1&&Ce(0)}function Bg(e,n){if(e&1&&(P(0),C(1,Fg,1,0,"ng-container",32),E()),e&2){f();let t=he(35);l(),p("ngTemplateOutlet",t)}}function Vg(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",31),E()),e&2&&(l(),p("count",1)("theme",Q(2,Sg)))}function Rg(e,n){if(e&1&&(m(0,"div",33),w(1,"img",34),m(2,"vedius-text",35),v(3),x(4,"translate"),x(5,"translate"),x(6,"translate"),h()()),e&2){let t=f();l(3),T(" ",F(6,5,"DASHBOARD_PAGE.APPOINTMENTS.EMPTY_DESCRIPTION",V(8,wg,t.isPatientTreatmentType?S(4,1,"PATIENTS"):S(5,3,"STUDENTS")))," ")}}var Kc=(()=>{let n=class n{constructor(i,a,o,r,s,c,d,u,g,_){this.eventCalendarDisplayService=i,this.calendarSettingsService=a,this.userVediusContext=o,this.translate=r,this.patientBirthdayService=s,this.eventCalendarDisplayChangeService=c,this.dialog=d,this.editEventCalendarHandlerFactory=u,this.cdr=g,this.financeOptionsSettingsService=_,this.isSmall=!1,this.loadingDelay=0,this.observableRefId="dashboard-appointments",this.totalOfAppointments=0,this.isLoading=!0,this.eventsCalendarDisplay=[],this.eventsCalendarDisplaySplitter=[],this.nextEventsCalendarDisplayDisplayed=[],this.resumeEventsCalendarDisplayDisplayed=[],this.maxDisplayedScheduleEvents=6,this.period=De.perDay(new Date),this.totalOfSummary=0,this.summaryRows=[],this.now=new Date,this.subscriptions=[],this.summaryTotalStatus=[],this.patientsBirthdayKeys=new Set,this.hiddenAbsences=!1,this.collaboratorsSelected=[],this.isFirstLoading=!0,this.loadedTranslation=!1,this.initialLoadSubject=new we,this.destroy$=new we}get userVedius(){return this.userVediusContext.current}get isPatientTreatmentType(){return this.userVedius?.clientTreatmentType===xe.PATIENT}get isClinicUser(){return this.userVedius.type===_e.Clinic}get isSeeAll(){return this.eventsCalendarDisplaySplitter.length>0&&this.eventsCalendarDisplaySplitter.length===this.nextEventsCalendarDisplayDisplayed.length+this.resumeEventsCalendarDisplayDisplayed.length}get isGreaterThanMaximumAllowed(){return this.eventsCalendarDisplaySplitter.length>this.maxDisplayedScheduleEvents}ngOnInit(){this.startInitialSubjectLoad(),this.observables(),this.translate.loaded().then(()=>{this.loadedTranslation=!0}),this.isClinicUser||(this.isLoading=!0,this.collaboratorsSelected=[this.userVedius],this.initialLoadSubject.next())}onCollaboratorLoaded(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),setTimeout(()=>{this.initialLoadSubject.next(),this.cdr.detectChanges()})}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}load(){return B(this,null,function*(){this.summaryRows=[];let i=this.collaboratorsSelected.map(a=>a.key);this.isLoading=!0;try{let a=[];a.push(this.calendarSettingsService.get({userVediusKey:this.userVedius.key}
9)),a.push(this.financeOptionsSettingsService.get({userVediusKey:this.userVedius.key}));let[o,r]=yield Promise.all(a);this.calendarSettings=o,this.financeSettingsOptionsModel=r,this.hiddenAbsences=this.calendarSettings.hideAbsencesInDashboard;let s=yield this.eventCalendarDisplayService.getByRange({period:this.period,professionalKeys:i,type:"weekly"});this.eventsCalendarDisplay=s,this.populateData(this.eventsCalendarDisplay)}catch(a){console.error("Error to load appointments: ",a)}finally{this.isLoading=!1,this.isFirstLoading=!1}})}onCollaboratorSelect(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),setTimeout(()=>{this.initialLoadSubject.next(),this.cdr.detectChanges()})}openInfo(){this.dialog.open(Qc,{width:"600px"})}populateData(i){this.loadTotalStatusSummary(i);let a=i.sort((o,r)=>o.start.getTime()-r.start.getTime());this.eventsCalendarDisplaySplitter=this.hiddenAbsences?a.filter(o=>o.status!==Se.Absent&&o.status!==Se.Canceled):a,this.totalOfAppointments=this.eventsCalendarDisplaySplitter.length,this.dontSeeAll(),this.loadSummary()}observables(){let i=this.patientBirthdayService.patientsBirthday$.subscribe(o=>{o.length>0&&(this.patientsBirthdayKeys=new Set(o.map(r=>r.key.patientKey.value)))}),a=this.eventCalendarDisplayChangeService.getEventInputsChangesObservable().subscribe(o=>{if(o?.observableRefId!==this.observableRefId&&o?.eventType===ga.Edition){let r=!1;o.deletedChildId&&(this.eventsCalendarDisplay=this.eventsCalendarDisplay.filter(s=>s.id!==o.deletedChildId),r=!0);for(let s of o.currentEventsDisplay){let c=this.eventsCalendarDisplay.findIndex(d=>d.id===s.id);c!==-1&&(this.eventsCalendarDisplay[c]=s,r=!0)}r&&this.populateData(this.eventsCalendarDisplay)}});this.subscriptions=[i,a]}
9seeAll(){let i=this.eventsCalendarDisplaySplitter.filter(o=>o.end.getTime()>=this.now.getTime());this.nextEventsCalendarDisplayDisplayed=i;let a=this.eventsCalendarDisplaySplitter.filter(o=>o.end.getTime()<this.now.getTime());this.resumeEventsCalendarDisplayDisplayed=a}dontSeeAll(){let i=this.eventsCalendarDisplaySplitter.filter(a=>a.end.getTime()>=this.now.getTime());if(i.length>=this.maxDisplayedScheduleEvents)this.nextEventsCalendarDisplayDisplayed=i.slice(0,this.maxDisplayedScheduleEvents),this.resumeEventsCalendarDisplayDisplayed=[];else{this.nextEventsCalendarDisplayDisplayed=i;let a=this.eventsCalendarDisplaySplitter.filter(r=>r.end.getTime()<this.now.getTime()),o=this.maxDisplayedScheduleEvents-this.nextEventsCalendarDisplayDisplayed.length;a.length>=o?this.resumeEventsCalendarDisplayDisplayed=a.slice(0,o):this.resumeEventsCalendarDisplayDisplayed=a}}isPatientBirthday(i){return i.patientInfo?this.patientsBirthdayKeys.has(i.patientInfo.key.patientKey.value):!1}onHiddenAbsencesChange(i){this.hiddenAbsences=i.checked,setTimeout(()=>{this.populateData(this.eventsCalendarDisplay),this.cdr.detectChanges()}),setTimeout(()=>{this.calendarSettings&&(this.calendarSettings.setHideAbsencesInDashboard(this.hiddenAbsences),this.calendarSettingsService.saveSync({calendarSettings:this.calendarSettings}))})}changeStatus(i){let a=i.eventCalendarDisplay.start;this.changeEventStatus(i.eventCalendarDisplay,i.status,a)}changeEventStatus(i,a,o){if(i){this.lastEventCalendarStatusDateChanged=o;let r=this.calendarSettings;this.editEventCalendarHandlerFactory.create(xa.EDIT_STATUS).handle({data:{status:a,eventCalendarDisplay:i,editableEventCalendar:void 0,parentEventCalendar:void 0,callback:this.callbackAfterChangeStatus.bind(this),config:{notAllowUndo:!0,observableRefId:this.observableRefId,calendarSettings:r,financeSettingsOptionsModel:this.financeSettingsOptionsModel}}})}}callbackAfterChangeStatus(i){let a=i.eventCalendarDisplay,o=this.nextEventsCalendarDisplayDisplayed.findIndex(d=>d.id===a.id),r=this.resumeEventsCalendarDisplayDisplayed.findIndex(d=>d.id===a.id);o!==-1&&(this.nextEventsCalendarDisplayDisplayed[o]=a),r!==-1&&(this.resumeEventsCalendarDisplayDisplayed[r]=a);
9let s=this.eventsCalendarDisplaySplitter.findIndex(d=>d.id===a.id);s!==-1&&(this.eventsCalendarDisplaySplitter[s]=a);let c=this.eventsCalendarDisplay.findIndex(d=>d.id===i.eventCalendarDisplay.id);c!==-1&&(this.eventsCalendarDisplay[c]=i.eventCalendarDisplay),setTimeout(()=>{this.loadTotalStatusSummary(this.eventsCalendarDisplay),this.loadSummary(),this.cdr.detectChanges()})}loadTotalStatusSummary(i){let a={},o=Object.values(Se),r=Object.values(Bo),s=[...o,...r];s.forEach(d=>{a[d]=0});let c=rl.createByPeriodFromEventCalendarDisplay(this.period,i);s.forEach(d=>{a[d]+=c.details[d]}),this.summaryTotalStatus=s.map(d=>({total:a[d],type:d}))}loadSummary(){let i=[Se.Confirmed,Se.Waiting,Se.InService,Se.Completed,Se.Canceled,Se.Absent,Bo.Replacement],a=this.summaryTotalStatus.filter(s=>i.includes(s.type)),r=(this.eventsCalendarDisplaySplitter.length>0?i.filter(s=>!this.hiddenAbsences||s!==Se.Canceled&&s!==Se.Absent):[]).map(s=>{let c=a?.find(u=>u.type===s),d=c?c.total:0;return{number:d,label:je(this.translateStatus(s,d)),color:tl(s)}});this.totalOfSummary=this.totalOfAppointments,this.summaryRows=r}translateStatus(i,a){return i===Se.Waiting?this.translate.get(`${U.EventStatusAgenda}.WAITING_FULL_LABEL`):i===Se.InService?this.translate.get(`${U.EventStatusAgenda}.${i}`):a>1?this.translate.get(`${U.EventStatusPluralAgenda}.${i}`):this.translate.get(`${U.EventStatusAgenda}.${i}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.subscriptions.forEach(i=>i.unsubscribe())}};n.\u0275fac=function(a){return new(a||n)(y(Zt),y(Kt),y(Te),y(ae),y(Ga),y(fa),y(He),y(va),y(Oe),y(Bl))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-appointments"]],inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:36,vars:38,consts:[["emptyAppointments",""],[1,"dashboard-appointments-component"],[1,"appointment-header-info"],[1,"left-header-info"],["variant","text","size","md",1,"neutral-dusk-color"],["svgIcon","help-info",1,"help-icon",3,"click"],[3,"onCustomChange","title","checked"],[1,"appointment-day-header-info"],["variant","display","size","md",1,"color-neutral-dusk"],["variant","text","size","xl",1,"neutral-medium-color","day"],[1,"appointment-sub-header-info"],[1,"sub-header-info-content"],[1,"left-sub-header-info"],["variant","display","size","md",1,"total-appointment","neutral-dusk-color"],["variant","text","size","xl",1,"neutral-medium-color"],[1,"right-sub-header-info"],["size","small",3,"type","maxLabels","defaultLabel","labelForFullSelection","onFilterSelect","onLoad",4,"ngIf"],["detailsType","column","barSize","medium",3,"hideCurrentNumber","hideCurrentLetters","rows","max"],["class","appointment-list-items",4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],[4,"ngIf"],["size","small",3,"onFilterSelect","onLoad","type","maxLabels","defaultLabel","labelForFullSelection"],[1,"appointment-list-items"],["class","list-title color-neutral-dark","variant","text","size","md","weight","bold",4,"ngIf"],[4,"ngFor","ngForOf"],["class","see-all-button","variant","secondary","size","small",3,"fullSize","onClick",4,"ngIf"],["class","dont-see-all-button","variant","secondary","size","small",3,"fullSize","onClick",4,"ngIf"],["variant","text","size","md","weight","bold",1,"list-title","color-neutral-dark"],[3,"onChangeStatus","event","isSmall","isBirthday"],["variant","secondary","size","small",1,"see-all-button",3,"onClick","fullSize"],["variant","secondary","size","small",1,"dont-see-all-button",3,"onClick","fullSize"],[1,"loader",3,"count","theme"],[4,"ngTemplateOutlet"],[1,"empty-content"],["src","../../../../../../assets/images/appointments-empty.svg","alt","empty-state"],["variant","text","size","sm",1,"neutral-darker-color"]],template:function(a,o){if(a&1){let r=I();m(0,"div",1),P(1),m(2,"div",2)(3,"div",3)(4,"vedius-text",4),v(5),x(6,"translate"),h(),m(7,"mat-icon",5),A("click",function(){return D(r),L(o.openInfo())}),h()(),m(8,"vedius-switch",6),x(9,"translate"),A("onCustomChange",function(c){return D(r),L(o.onHiddenAbsencesChange(c))}),h()(),m(10,"div",7)(11,"vedius-text",8),v(12),x(13,"date"),x(14,"capitalizeFirstLetter"),h(),m(15,"vedius-text",9),v(16),x(17,"date"),h()(),m(18,"div",10)(19,"div",11)(20,"div",12)(21,"span",13),v(22),h(),m(23,"vedius-text",14),v(24),x(25,"translate"),x(26,"translate"),h()(),m(27,"div",15),C(28,Ag,3,8,"vedius-collaborator-selection-button",16),h()()(),w(29,"vedius-summary-progress-bar",17),C(30,Og,7,6,"ul",18)(31,Ig,1,3,"ngx-skeleton-loader",19)(32,Bg,2,1,"ng-container",20),E(),h(),C(33,Vg,2,3,"ng-container",20)(34,Rg,7,10,"ng-template",null,0,me)}a&2&&(X("empty",o.eventsCalendarDisplaySplitter.length===0&&!o.isLoading)("hidden",o.isLoading&&o.isFirstLoading)("small",o.isSmall),l(5),T(" ",S(6,22,"DASHBOARD_PAGE.APPOINTMENTS.TITLE")," "),l(3),ee("title",S(9,24,"DASHBOARD_PAGE.APPOINTMENTS.HIDDEN_ABSENCES_TITLE")),p("checked",o.hiddenAbsences),l(4),T(" ",S(14,29,F(13,26,o.now,"EEEE"))," "),l(4),T(" ",F(17,31,o.now,"dd/MM")," "),l(6),W(o.totalOfAppointments),l(2),T(" ",o.totalOfAppointments>1||o.eventsCalendarDisplaySplitter.length===0&&!o.isLoading?S(25,34,"DASHBOARD_PAGE.APPOINTMENTS.PLURAL"):S(26,36,"DASHBOARD_PAGE.APPOINTMENTS.SINGLE")," "),l(4),p("ngIf",o.isClinicUser&&o.loadedTranslation),l(),p("hideCurrentNumber",!0)("hideCurrentLetters",!0)("rows",o.summaryRows)("max",o.totalOfSummary),l(),p("ngIf",o.eventsCalendarDisplaySplitter.length>
90&&!o.isLoading),l(),p("ngIf",o.isLoading),l(),p("ngIf",o.eventsCalendarDisplaySplitter.length===0&&!o.isLoading),l(),p("ngIf",o.isLoading&&o.isFirstLoading))},dependencies:[j,et,ma,z,mt,ti,le,qc,re,Ee,Pe,ze,It,$,Y,Jl],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}[_ngcontent-%COMP%]:root{width:100%}.dashboard-appointments-component[_ngcontent-%COMP%]{display:flex;padding:24px;flex-direction:column;gap:24px;align-self:stretch;min-height:400px;border-radius:12px;background:#fff;border:1px solid #f5f6f8;position:relative}.dashboard-appointments-component.hidden[_ngcontent-%COMP%]{display:none!important}.dashboard-appointments-component.empty[_ngcontent-%COMP%]{background:#fff}.dashboard-appointments-component[_ngcontent-%COMP%] .loader[_ngcontent-%COMP%]{width:100%}.dashboard-appointments-component[_ngcontent-%COMP%] .color-neutral-dusk[_ngcontent-%COMP%]{color:#192840}.dashboard-appointments-component[_ngcontent-%COMP%] .color-neutral-dark[_ngcontent-%COMP%]{color:#6d7a8e}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-day-header-info[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;gap:4px}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-day-header-info[_ngcontent-%COMP%] .day[_ngcontent-%COMP%]{margin-top:10px}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-header-info[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;align-self:stretch}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-header-info[_ngcontent-%COMP%] .left-header-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-header-info[_ngcontent-%COMP%] .left-header-info[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]{width:16px;height:16px}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-header-info[_ngcontent-%COMP%] .left-header-info[_ngcontent-%COMP%] .help-icon[_ngcontent-%COMP%]:hover{cursor:pointer;opacity:.8}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-sub-header-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:16px;align-self:stretch;margin-bottom:-16px;margin-top:-16px}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-sub-header-info[_ngcontent-%COMP%] .sub-header-info-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;justify-content:space-between;align-self:stretch}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-sub-header-info[_ngcontent-%COMP%] .sub-header-info-content[_ngcontent-%COMP%] .left-sub-header-info[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:4px;flex:1 0 0}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-sub-header-info[_ngcontent-%COMP%] .sub-header-info-content[_ngcontent-%COMP%] .left-sub-header-info[_ngcontent-%COMP%] .total-appointment[_ngcontent-%COMP%]{font-family:DM Sans;font-size:32px;font-style:normal;font-weight:500;line-height:40px;letter-spacing:-.64px}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-sub-header-info[_ngcontent-%COMP%] .sub-header-info-content[_ngcontent-%COMP%] .right-sub-header-info[_ngcontent-%COMP%] vedius-collaborator-selection-button[_ngcontent-%COMP%]{width:200px;display:flex}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-list-items[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;list-style:none;margin:0;padding:0}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-list-items[_ngcontent-%COMP%] .list-title[_ngcontent-%COMP%]{padding:12px 0}
9.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-list-items[_ngcontent-%COMP%] .see-all-button[_ngcontent-%COMP%], .dashboard-appointments-component[_ngcontent-%COMP%] .appointment-list-items[_ngcontent-%COMP%] .dont-see-all-button[_ngcontent-%COMP%]{margin-top:24px;width:100%}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-list-items[_ngcontent-%COMP%] .appointment-list-item-wrapper[_ngcontent-%COMP%]{position:relative}.dashboard-appointments-component[_ngcontent-%COMP%] .appointment-list-items[_ngcontent-%COMP%] .appointment-list-item-wrapper[_ngcontent-%COMP%] app-dashboard-appointment-item[_ngcontent-%COMP%]{width:100%}.dashboard-appointments-component[_ngcontent-%COMP%] .neutral-day-color[_ngcontent-%COMP%]{color:#fff}.dashboard-appointments-component[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.dashboard-appointments-component[_ngcontent-%COMP%] .neutral-medium-color[_ngcontent-%COMP%]{color:#96a0b0}.dashboard-appointments-component[_ngcontent-%COMP%] .neutral-dark-color[_ngcontent-%COMP%]{color:#6d7a8e}.dashboard-appointments-component[_ngcontent-%COMP%] .neutral-darker-color[_ngcontent-%COMP%]{color:#425168}.dashboard-appointments-component[_ngcontent-%COMP%] .empty-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:4px;box-sizing:border-box}.dashboard-appointments-component[_ngcontent-%COMP%] .empty-content[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:150px;max-height:150px}.dashboard-appointments-component.small[_ngcontent-%COMP%]{border-radius:8px}.dashboard-appointments-component.small[_ngcontent-%COMP%] .appointment-header-info[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px}.dashboard-appointments-component.small[_ngcontent-%COMP%] .appointment-sub-header-info[_ngcontent-%COMP%] .sub-header-info-content[_ngcontent-%COMP%] .right-sub-header-info[_ngcontent-%COMP%] vedius-collaborator-selection-button[_ngcontent-%COMP%]{width:100%}"]});let e=n;return e})();var ke=function(e){return e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e}(ke||{}),Zc=(()=>{let n=class n{constructor(i,a){this.translation=i,this.cdr=a,this.onChange=new J,this.tabOptions=[],this.active=ke.DAILY,this.initialActivated&&(this.active=this.initialActivated)}ngOnInit(){this.translation.loaded().then(()=>{this.loadTabOptions(),this.cdr.detectChanges()})}loadTabOptions(){this.tabOptions=[{label:this.translate(ke.DAILY),value:ke.DAILY,checked:this.active===ke.DAILY,onChange:()=>this.change(ke.DAILY)},{label:this.translate(ke.WEEKLY),value:ke.WEEKLY,checked:this.active===ke.WEEKLY,onChange:()=>this.change(ke.WEEKLY)},{label:this.translate(ke.MONTHLY),value:ke.MONTHLY,checked:this.active===ke.MONTHLY,onChange:()=>this.change(ke.MONTHLY)}]}change(i){this.active=i,this.onChange.emit(this.active)}translate(i){return this.translation.get(`${U.DashboardYearAndMonthlyPeriodSelectorLabel}.${i}`)}};n.\u0275fac=function(a){return new(a||n)(y(ae),y(Oe))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-year-and-monthly-period-selector-tab-group"]],inputs:{initialActivated:"initialActivated"},outputs:{onChange:"onChange"},decls:1,vars:1,consts:[["type","inline",1,"year-and-monthly-period-tab-options",3,"options"]],template:function(a,o){a&1&&w(0,"vedius-button-group",0),a&2&&p("options",o.tabOptions)},dependencies:[ba],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.year-and-monthly-period-tab-options,.year-and-monthly-period-tab-options .mat-button-toggle-group{width:100%}.year-and-monthly-period-tab-options .mat-button-toggle-group mat-button-toggle{flex:1} 10`],encapsulation:2});let e=n;return e})();var Jc=(()=>{let n=class n{constructor(i){this.localeContext=i}transform(i){return i?(typeof i=="string"&&(i=new Date(i)),Ko.create(this.localeContext.current).format(i)):""}};n.\u0275fac=function(a){return new(a||n)(y(st,16))}
vendor: 9,616 bytes, line 10
10,n.\u0275pipe=Oi({name:"onlyMonthYearDate",type:n,pure:!0});let e=n;return e})(),Ko=class{static create(n){return n===vi?new Jo(new It(vi)):new Zo(new It(ol))}},Zo=class{constructor(n){this.datePipe=n}format(n){return this.datePipe.transform(n,"MMMM, y")||""}},Jo=class{constructor(n){this.datePipe=n}format(n){return this.datePipe.transform(n,"MMMM, y")||""}};var za="http://www.w3.org/1999/xhtml",er={svg:"http://www.w3.org/2000/svg",xhtml:za,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gt(e){var n=e+="",t=n.indexOf(":");return t>=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),er.hasOwnProperty(n)?{space:er[n],local:e}:e}function Ng(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===za&&n.documentElement.namespaceURI===za?n.createElement(e):n.createElementNS(t,e)}}function Gg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ha(e){var n=Gt(e);return(n.local?Gg:Ng)(n)}function zg(){}function bi(e){return e==null?zg:function(){return this.querySelector(e)}}function ed(e){typeof e!="function"&&(e=bi(e));for(var n=this._groups,t=n.length,i=new Array(t),a=0;a<t;++a)for(var o=n[a],r=o.length,s=i[a]=new Array(r),c,d,u=0;u<r;++u)(c=o[u])&&(d=e.call(c,c.__data__,u,o))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new Me(i,this._parents)}function tr(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Hg(){return[]}function vn(e){return e==null?Hg:function(){return this.querySelectorAll(e)}}function jg(e){return function(){return tr(e.apply(this,arguments))}}function td(e){typeof e=="function"?e=jg(e):e=vn(e);for(var n=this._groups,t=n.length,i=[],a=[],o=0;o<t;++o)for(var r=n[o],s=r.length,c,d=0;d<s;++d)(c=r[d])&&(i.push(e.call(c,c.__data__,d,r)),a.push(c));return new Me(i,a)}function bn(e){return function(){return this.matches(e)}}function ja(e){return function(n){return n.matches(e)}}var Yg=Array.prototype.find;function $g(e){return function(){return Yg.call(this.children,e)}}function Wg(){return this.firstElementChild}function id(e){return this.select(e==null?Wg:$g(typeof e=="function"?e:ja(e)))}var Xg=Array.prototype.filter;function Ug(){return Array.from(this.children)}function Qg(e){return function(){return Xg.call(this.children,e)}}function nd(e){return this.selectAll(e==null?Ug:Qg(typeof e=="function"?e:ja(e)))}function ad(e){typeof e!="function"&&(e=bn(e));for(var n=this._groups,t=n.length,i=new Array(t),a=0;a<t;++a)for(var o=n[a],r=o.length,s=i[a]=[],c,d=0;d<r;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&s.push(c);return new Me(i,this._parents)}function Ya(e){return new Array(e.length)}function od(){return new Me(this._enter||this._groups.map(Ya),this._parents)}function yn(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}yn.prototype={constructor:yn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function rd(e){return function(){return e}}function qg(e,n,t,i,a,o){for(var r=0,s,c=n.length,d=o.length;r<d;++r)(s=n[r])?(s.__data__=o[r],i[r]=s):t[r]=new yn(e,o[r]);for(;r<c;++r)(s=n[r])&&(a[r]=s)}function Kg(e,n,t,i,a,o,r){var s,c,d=new Map,u=n.length,g=o.length,_=new Array(u),b;for(s=0;s<u;++s)(c=n[s])&&(_[s]=b=r.call(c,c.__data__,s,n)+"",d.has(b)?a[s]=c:d.set(b,c));for(s=0;s<g;++s)b=r.call(e,o[s],s,o)+"",(c=d.get(b))?(i[s]=c,c.__data__=o[s],d.delete(b)):t[s]=new yn(e,o[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(_[s])===c&&(a[s]=c)}function Zg(e){return e.__data__}function sd(e,n){if(!arguments.length)return Array.from(this,Zg);var t=n?Kg:qg,i=this._parents,a=this._groups;typeof e!="function"&&(e=rd(e));for(var o=a.length,r=new Array(o),s=new Array(o),c=new Array(o),d=0;d<o;++d){var u=i[d],g=a[d],_=g.length,b=Jg(e.call(u,u&&u.__data__,d,i)),k=b.length,M=s[d]=new Array(k),H=r[d]=new Array(k),ce=c[d]=new Array(_);t(u,g,M,H,ce,b,n);for(var Ae=0,fe=0,ue,Ie;Ae<k;++Ae)if(ue=M[Ae]){for(Ae>=fe&&(fe=Ae+1);!(Ie=H[fe])&&++fe<k;);ue._next=Ie||null}}return r=new Me(r,i),r._enter=s,r._exit=c,r}function Jg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ld(){return new Me(this._exit||this._groups.map(Ya),this._parents)}function cd(e,n,t){var i=this.enter(),a=this,o=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),t==null?o.remove():t(o),i&&a?i.merge(a).order():a}function dd(e){for(var n=e.selection?e.selection():e,t=this._groups,i=n._groups,a=t.length,o=i.length,r=Math.min(a,o),s=new Array(a),c=0;c<r;++c)for(var d=t[c],u=i[c],g=d.length,_=s[c]=new Array(g),b,k=0;k<g;++k)(b=d[k]||u[k])&&(_[k]=b);for(;c<a;++c)s[c]=t[c];return new Me(s,this._parents)}function pd(){for(var e=this._groups,n=-1,t=e.length;++n<t;)for(var i=e[n],a=i.length-1,o=i[a],r;--a>=0;)(r=i[a])&&(o&&r.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(r,o),o=r);return this}function md(e){e||(e=ef);function n(g,_){return g&&_?e(g.__data__,_.__data__):!g-!_}for(var t=this._groups,i=t.length,a=new Array(i),o=0;o<i;++o){for(var r=t[o],s=r.length,c=a[o]=new Array(s),d,u=0;u<s;++u)(d=r[u])&&(c[u]=d);c.sort(n)}return new Me(a,this._parents).order()}function ef(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function hd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ud(){return Array.from(this)}function gd(){for(var e=this._groups,n=0,t=e.length;n<t;++n)for(var i=e[n],a=0,o=i.length;a<o;++a){var r=i[a];if(r)return r}return null}function fd(){let e=0;for(let n of this)++e;return e}function _d(){return!this.node()}function xd(e){for(var n=this._groups,t=0,i=n.length;t<i;++t)for(var a=n[t],o=0,r=a.length,s;o<r;++o)(s=a[o])&&e.call(s,s.__data__,o,a);return this}function tf(e){return function(){this.removeAttribute(e)}}function nf(e){return function(){this.removeAttributeNS(e.space,e.local)}}function af(e,n){return function(){this.setAttribute(e,n)}}function of(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function rf(e,n){return function(){var t=n.apply(this,arguments);t==null?this.removeAttribute(e):this.setAttribute(e,t)}}function sf(e,n){return function(){var t=n.apply(this,arguments);t==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}}function vd(e,n){var t=Gt(e);if(arguments.length<2){var i=this.node();return t.local?i.getAttributeNS(t.space,t.local):i.getAttribute(t)}return this.each((n==null?t.local?nf:tf:typeof n=="function"?t.local?sf:rf:t.local?of:af)(t,n))}function $a(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lf(e){return function(){this.style.removeProperty(e)}}function cf(e,n,t){return function(){this.style.setProperty(e,n,t)}}function df(e,n,t){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,t)}}function bd(e,n,t){return arguments.length>1?this.each((n==null?lf:typeof n=="function"?df:cf)(e,n,t??"")):ii(this.node(),e)}function ii(e,n){return e.style.getPropertyValue(n)||$a(e).getComputedStyle(e,null).getPropertyValue(n)}function pf(e){return function(){delete this[e]}}function mf(e,n){return function(){this[e]=n}}function hf(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function yd(e,n){return arguments.length>1?this.each((n==null?pf:typeof n=="function"?hf:mf)(e,n)):this.node()[e]}function Cd(e){return e.trim().split(/^|\s+/)}function ir(e){return e.classList||new Td(e)}function Td(e){this._node=e,this._names=Cd(e.getAttribute("class")||"")}Td.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Sd(e,n){for(var t=ir(e),i=-1,a=n.length;++i<a;)t.add(n[i])}function wd(e,n){for(var t=ir(e),i=-1,a=n.length;++i<a;)t.remove(n[i])}function uf(e){return function(){Sd(this,e)}}function gf(e){return function(){wd(this,e)}}function ff(e,n){return function(){(n.apply(this,arguments)?Sd:wd)(this,e)}}function Ad(e,n){var t=Cd(e+"");if(arguments.length<2){for(var i=ir(this.node()),a=-1,o=t.length;++a<o;)if(!i.contains(t[a]))return!1;return!0}return this.each((typeof n=="function"?ff:n?uf:gf)(t,n))}function _f(){this.textContent=""}function xf(e){return function(){this.textContent=e}}function vf(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function kd(e){return arguments.length?this.each(e==null?_f:(typeof e=="function"?vf:xf)(e)):this.node().textContent}function bf(){this.innerHTML=""}function yf(e){return function(){this.innerHTML=e}}function Cf(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function Dd(e){return arguments.length?this.each(e==null?bf:(typeof e=="function"?Cf:yf)(e)):this.node().innerHTML}function Tf(){this.nextSibling&&this.parentNode.appendChild(this)}function Ld(){return this.each(Tf)}function Sf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Pd(){return this.each(Sf)}function Ed(e){var n=typeof e=="function"?e:Ha(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function wf(){return null}
vendor: 8,475 bytes, line 10
10function Md(e,n){var t=typeof e=="function"?e:Ha(e),i=n==null?wf:typeof n=="function"?n:bi(n);return this.select(function(){return this.insertBefore(t.apply(this,arguments),i.apply(this,arguments)||null)})}function Af(){var e=this.parentNode;e&&e.removeChild(this)}function Od(){return this.each(Af)}function kf(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Df(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Id(e){return this.select(e?Df:kf)}function Fd(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Lf(e){return function(n){e.call(this,n,this.__data__)}}function Pf(e){return e.trim().split(/^|\s+/).map(function(n){var t="",i=n.indexOf(".");return i>=0&&(t=n.slice(i+1),n=n.slice(0,i)),{type:n,name:t}})}function Ef(e){return function(){var n=this.__on;if(n){for(var t=0,i=-1,a=n.length,o;t<a;++t)o=n[t],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++i]=o;++i?n.length=i:delete this.__on}}}function Mf(e,n,t){return function(){var i=this.__on,a,o=Lf(n);if(i){for(var r=0,s=i.length;r<s;++r)if((a=i[r]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=o,a.options=t),a.value=n;return}}this.addEventListener(e.type,o,t),a={type:e.type,name:e.name,value:n,listener:o,options:t},i?i.push(a):this.__on=[a]}}function Bd(e,n,t){var i=Pf(e+""),a,o=i.length,r;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(a=0,u=s[c];a<o;++a)if((r=i[a]).type===u.type&&r.name===u.name)return u.value}return}for(s=n?Mf:Ef,a=0;a<o;++a)this.each(s(i[a],n,t));return this}function Vd(e,n,t){var i=$a(e),a=i.CustomEvent;typeof a=="function"?a=new a(n,t):(a=i.document.createEvent("Event"),t?(a.initEvent(n,t.bubbles,t.cancelable),a.detail=t.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function Of(e,n){return function(){return Vd(this,e,n)}}function If(e,n){return function(){return Vd(this,e,n.apply(this,arguments))}}function Rd(e,n){return this.each((typeof n=="function"?If:Of)(e,n))}function*Nd(){for(var e=this._groups,n=0,t=e.length;n<t;++n)for(var i=e[n],a=0,o=i.length,r;a<o;++a)(r=i[a])&&(yield r)}var nr=[null];function Me(e,n){this._groups=e,this._parents=n}function Gd(){return new Me([[document.documentElement]],nr)}function Ff(){return this}Me.prototype=Gd.prototype={constructor:Me,select:ed,selectAll:td,selectChild:id,selectChildren:nd,filter:ad,data:sd,enter:od,exit:ld,join:cd,merge:dd,selection:Ff,order:pd,sort:md,call:hd,nodes:ud,node:gd,size:fd,empty:_d,each:xd,attr:vd,style:bd,property:yd,classed:Ad,text:kd,html:Dd,raise:Ld,lower:Pd,append:Ed,insert:Md,remove:Od,clone:Id,datum:Fd,on:Bd,dispatch:Rd,[Symbol.iterator]:Nd};var zt=Gd;function ar(e){return typeof e=="string"?new Me([[document.querySelector(e)]],[document.documentElement]):new Me([[e]],nr)}var Bf={value:()=>{}};function Hd(){for(var e=0,n=arguments.length,t={},i;e<n;++e){if(!(i=arguments[e]+"")||i in t||/[\s.]/.test(i))throw new Error("illegal type: "+i);t[i]=[]}return new Wa(t)}function Wa(e){this._=e}function Vf(e,n){return e.trim().split(/^|\s+/).map(function(t){var i="",a=t.indexOf(".");if(a>=0&&(i=t.slice(a+1),t=t.slice(0,a)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}Wa.prototype=Hd.prototype={constructor:Wa,on:function(e,n){var t=this._,i=Vf(e+"",t),a,o=-1,r=i.length;if(arguments.length<2){for(;++o<r;)if((a=(e=i[o]).type)&&(a=Rf(t[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<r;)if(a=(e=i[o]).type)t[a]=zd(t[a],e.name,n);else if(n==null)for(a in t)t[a]=zd(t[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var t in n)e[t]=n[t].slice();return new Wa(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var t=new Array(a),i=0,a,o;i<a;++i)t[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,a=o.length;i<a;++i)o[i].value.apply(n,t)},apply:function(e,n,t){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,o=i.length;a<o;++a)i[a].value.apply(n,t)}};function Rf(e,n){for(var t=0,i=e.length,a;t<i;++t)if((a=e[t]).name===n)return a.value}function zd(e,n,t){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=Bf,e=e.slice(0,i).concat(e.slice(i+1));break}return t!=null&&e.push({name:n,value:t}),e}var or=Hd;function Xa(e,n,t){e.prototype=n.prototype=t,t.constructor=e}function rr(e,n){var t=Object.create(e.prototype);for(var i in n)t[i]=n[i];return t}function Sn(){}var Cn=.7,qa=1/Cn,Yi="\\s*([+-]?\\d+)\\s*",Tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nf=/^#([0-9a-f]{3,8})$/,Gf=new RegExp(`^rgb\\(${Yi},${Yi},${Yi}\\)$`),zf=new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`),Hf=new RegExp(`^rgba\\(${Yi},${Yi},${Yi},${Tn}\\)$`),jf=new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${Tn}\\)$`),Yf=new RegExp(`^hsl\\(${Tn},${Lt},${Lt}\\)$`),$f=new RegExp(`^hsla\\(${Tn},${Lt},${Lt},${Tn}\\)$`),jd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xa(Sn,vt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yd,formatHex:Yd,formatHex8:Wf,formatHsl:Xf,formatRgb:$d,toString:$d});function Yd(){return this.rgb().formatHex()}function Wf(){return this.rgb().formatHex8()}function Xf(){return Kd(this).formatHsl()}function $d(){return this.rgb().formatRgb()}function vt(e){var n,t;return e=(e+"").trim().toLowerCase(),(n=Nf.exec(e))?(t=n[1].length,n=parseInt(n[1],16),t===6?Wd(n):t===3?new lt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?Ua(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?Ua(n>
vendor: 4,120 bytes, line 10
10>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Gf.exec(e))?new lt(n[1],n[2],n[3],1):(n=zf.exec(e))?new lt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Hf.exec(e))?Ua(n[1],n[2],n[3],n[4]):(n=jf.exec(e))?Ua(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Yf.exec(e))?Qd(n[1],n[2]/100,n[3]/100,1):(n=$f.exec(e))?Qd(n[1],n[2]/100,n[3]/100,n[4]):jd.hasOwnProperty(e)?Wd(jd[e]):e==="transparent"?new lt(NaN,NaN,NaN,0):null}function Wd(e){return new lt(e>>16&255,e>>8&255,e&255,1)}function Ua(e,n,t,i){return i<=0&&(e=n=t=NaN),new lt(e,n,t,i)}function Uf(e){return e instanceof Sn||(e=vt(e)),e?(e=e.rgb(),new lt(e.r,e.g,e.b,e.opacity)):new lt}function $i(e,n,t,i){return arguments.length===1?Uf(e):new lt(e,n,t,i??1)}function lt(e,n,t,i){this.r=+e,this.g=+n,this.b=+t,this.opacity=+i}Xa(lt,$i,rr(Sn,{brighter(e){return e=e==null?qa:Math.pow(qa,e),new lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new lt(Ci(this.r),Ci(this.g),Ci(this.b),Ka(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xd,formatHex:Xd,formatHex8:Qf,formatRgb:Ud,toString:Ud}));function Xd(){return`#${yi(this.r)}${yi(this.g)}${yi(this.b)}`}function Qf(){return`#${yi(this.r)}${yi(this.g)}${yi(this.b)}${yi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ud(){let e=Ka(this.opacity);return`${e===1?"rgb(":"rgba("}${Ci(this.r)}, ${Ci(this.g)}, ${Ci(this.b)}${e===1?")":`, ${e})`}`}function Ka(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ci(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yi(e){return e=Ci(e),(e<16?"0":"")+e.toString(16)}function Qd(e,n,t,i){return i<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new xt(e,n,t,i)}function Kd(e){if(e instanceof xt)return new xt(e.h,e.s,e.l,e.opacity);if(e instanceof Sn||(e=vt(e)),!e)return new xt;if(e instanceof xt)return e;e=e.rgb();var n=e.r/255,t=e.g/255,i=e.b/255,a=Math.min(n,t,i),o=Math.max(n,t,i),r=NaN,s=o-a,c=(o+a)/2;return s?(n===o?r=(t-i)/s+(t<i)*6:t===o?r=(i-n)/s+2:r=(n-t)/s+4,s/=c<.5?o+a:2-o-a,r*=60):s=c>0&&c<1?0:r,new xt(r,s,c,e.opacity)}function Zd(e,n,t,i){return arguments.length===1?Kd(e):new xt(e,n,t,i??1)}function xt(e,n,t,i){this.h=+e,this.s=+n,this.l=+t,this.opacity=+i}Xa(xt,Zd,rr(Sn,{brighter(e){return e=e==null?qa:Math.pow(qa,e),new xt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new xt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*n,a=2*t-i;return new lt(sr(e>=240?e-240:e+120,a,i),sr(e,a,i),sr(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new xt(qd(this.h),Qa(this.s),Qa(this.l),Ka(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Ka(this.opacity);return`${e===1?"hsl(":"hsla("}${qd(this.h)}, ${Qa(this.s)*100}%, ${Qa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qd(e){return e=(e||0)%360,e<0?e+360:e}function Qa(e){return Math.max(0,Math.min(1,e||0))}function sr(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}function lr(e,n,t,i,a){var o=e*e,r=o*e;return((1-3*e+3*o-r)*n+(4-6*o+3*r)*t+(1+3*e+3*o-3*r)*i+r*a)/6}function Jd(e){var n=e.length-1;return function(t){var i=t<=0?t=0:t>=1?(t=1,n-1):Math.floor(t*n),a=e[i],o=e[i+1],r=i>0?e[i-1]:2*a-o,s=i<n-1?e[i+2]:2*o-a;return lr((t-i/n)*n,r,a,o,s)}}function ep(e){var n=e.length;return function(t){var i=Math.floor(((t%=1)<0?++t:t)*n),a=e[(i+n-1)%n],o=e[i%n],r=e[(i+1)%n],s=e[(i+2)%n];return lr((t-i/n)*n,a,o,r,s)}}var wn=e=>()=>e;function qf(e,n){return function(t){return e+t*n}}function Kf(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(i){return Math.pow(e+i*n,t)}}function tp(e){return(e=+e)==1?Za:function(n,t){return t-n?Kf(n,t,e):wn(isNaN(n)?t:n)}}function Za(e,n){var t=n-e;return t?qf(e,t):wn(isNaN(e)?n:e)}var Ti=function e(n){var t=tp(n);
vendor: 3,345 bytes, line 10
10function i(a,o){var r=t((a=$i(a)).r,(o=$i(o)).r),s=t(a.g,o.g),c=t(a.b,o.b),d=Za(a.opacity,o.opacity);return function(u){return a.r=r(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i}(1);function ip(e){return function(n){var t=n.length,i=new Array(t),a=new Array(t),o=new Array(t),r,s;for(r=0;r<t;++r)s=$i(n[r]),i[r]=s.r||0,a[r]=s.g||0,o[r]=s.b||0;return i=e(i),a=e(a),o=e(o),s.opacity=1,function(c){return s.r=i(c),s.g=a(c),s.b=o(c),s+""}}}var Zf=ip(Jd),Jf=ip(ep);function np(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,i=n.slice(),a;return function(o){for(a=0;a<t;++a)i[a]=e[a]*(1-o)+n[a]*o;return i}}function ap(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function op(e,n){var t=n?n.length:0,i=e?Math.min(t,e.length):0,a=new Array(i),o=new Array(t),r;for(r=0;r<i;++r)a[r]=Si(e[r],n[r]);for(;r<t;++r)o[r]=n[r];return function(s){for(r=0;r<i;++r)o[r]=a[r](s);return o}}function rp(e,n){var t=new Date;return e=+e,n=+n,function(i){return t.setTime(e*(1-i)+n*i),t}}function $e(e,n){return e=+e,n=+n,function(t){return e*(1-t)+n*t}}function sp(e,n){var t={},i={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?t[a]=Si(e[a],n[a]):i[a]=n[a];return function(o){for(a in t)i[a]=t[a](o);return i}}var dr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cr=new RegExp(dr.source,"g");function e0(e){return function(){return e}}function t0(e){return function(n){return e(n)+""}}function An(e,n){var t=dr.lastIndex=cr.lastIndex=0,i,a,o,r=-1,s=[],c=[];for(e=e+"",n=n+"";(i=dr.exec(e))&&(a=cr.exec(n));)(o=a.index)>t&&(o=n.slice(t,o),s[r]?s[r]+=o:s[++r]=o),(i=i[0])===(a=a[0])?s[r]?s[r]+=a:s[++r]=a:(s[++r]=null,c.push({i:r,x:$e(i,a)})),t=cr.lastIndex;return t<n.length&&(o=n.slice(t),s[r]?s[r]+=o:s[++r]=o),s.length<2?c[0]?t0(c[0].x):e0(n):(n=c.length,function(d){for(var u=0,g;u<n;++u)s[(g=c[u]).i]=g.x(d);return s.join("")})}function Si(e,n){var t=typeof n,i;return n==null||t==="boolean"?wn(n):(t==="number"?$e:t==="string"?(i=vt(n))?(n=i,Ti):An:n instanceof vt?Ti:n instanceof Date?rp:ap(n)?np:Array.isArray(n)?op:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?sp:$e)(e,n)}function pr(e,n){return e=+e,n=+n,function(t){return Math.round(e*(1-t)+n*t)}}var lp=180/Math.PI,Ja={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mr(e,n,t,i,a,o){var r,s,c;return(r=Math.sqrt(e*e+n*n))&&(e/=r,n/=r),(c=e*t+n*i)&&(t-=e*c,i-=n*c),(s=Math.sqrt(t*t+i*i))&&(t/=s,i/=s,c/=s),e*i<n*t&&(e=-e,n=-n,c=-c,r=-r),{translateX:a,translateY:o,rotate:Math.atan2(n,e)*lp,skewX:Math.atan(c)*lp,scaleX:r,scaleY:s}}var eo;function cp(e){let n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Ja:mr(n.a,n.b,n.c,n.d,n.e,n.f)}function dp(e){return e==null?Ja:(eo||(eo=document.createElementNS("http://www.w3.org/2000/svg","g")),eo.setAttribute("transform",e),(e=eo.transform.baseVal.consolidate())?(e=e.matrix,mr(e.a,e.b,e.c,e.d,e.e,e.f)):Ja)}function pp(e,n,t,i){function a(d){return d.length?d.pop()+" ":""}function o(d,u,g,_,b,k){if(d!==g||u!==_){var M=b.push("translate(",null,n,null,t);k.push({i:M-4,x:$e(d,g)},{i:M-2,x:$e(u,_)})}else(g||_)&&b.push("translate("+g+n+_+t)}function r(d,u,g,_){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),_.push({i:g.push(a(g)+"rotate(",null,i)-2,x:$e(d,u)})):u&&g.push(a(g)+"rotate("+u+i)}
vendor: 5,950 bytes, line 10
10function s(d,u,g,_){d!==u?_.push({i:g.push(a(g)+"skewX(",null,i)-2,x:$e(d,u)}):u&&g.push(a(g)+"skewX("+u+i)}function c(d,u,g,_,b,k){if(d!==g||u!==_){var M=b.push(a(b)+"scale(",null,",",null,")");k.push({i:M-4,x:$e(d,g)},{i:M-2,x:$e(u,_)})}else(g!==1||_!==1)&&b.push(a(b)+"scale("+g+","+_+")")}return function(d,u){var g=[],_=[];return d=e(d),u=e(u),o(d.translateX,d.translateY,u.translateX,u.translateY,g,_),r(d.rotate,u.rotate,g,_),s(d.skewX,u.skewX,g,_),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,g,_),d=u=null,function(b){for(var k=-1,M=_.length,H;++k<M;)g[(H=_[k]).i]=H.x(b);return g.join("")}}}var hr=pp(cp,"px, ","px)","deg)"),ur=pp(dp,", ",")",")");var Wi=0,Dn=0,kn=0,hp=1e3,to,Ln,io=0,wi=0,no=0,Pn=typeof performance=="object"&&performance.now?performance:Date,up=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mn(){return wi||(up(i0),wi=Pn.now()+no)}function i0(){wi=0}function En(){this._call=this._time=this._next=null}En.prototype=ao.prototype={constructor:En,restart:function(e,n,t){if(typeof e!="function")throw new TypeError("callback is not a function");t=(t==null?Mn():+t)+(n==null?0:+n),!this._next&&Ln!==this&&(Ln?Ln._next=this:to=this,Ln=this),this._call=e,this._time=t,gr()},stop:function(){this._call&&(this._call=null,this._time=1/0,gr())}};function ao(e,n,t){var i=new En;return i.restart(e,n,t),i}function gp(){Mn(),++Wi;for(var e=to,n;e;)(n=wi-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Wi}function mp(){wi=(io=Pn.now())+no,Wi=Dn=0;try{gp()}finally{Wi=0,a0(),wi=0}}function n0(){var e=Pn.now(),n=e-io;n>hp&&(no-=n,io=e)}function a0(){for(var e,n=to,t,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:to=t);Ln=e,gr(i)}function gr(e){if(!Wi){Dn&&(Dn=clearTimeout(Dn));var n=e-wi;n>24?(e<1/0&&(Dn=setTimeout(mp,e-Pn.now()-no)),kn&&(kn=clearInterval(kn))):(kn||(io=Pn.now(),kn=setInterval(n0,hp)),Wi=1,up(mp))}}function oo(e,n,t){var i=new En;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,t),i}var o0=or("start","end","cancel","interrupt"),r0=[],xp=0,fp=1,so=2,ro=3,_p=4,lo=5,On=6;function ni(e,n,t,i,a,o){var r=e.__transition;if(!r)e.__transition={};else if(t in r)return;s0(e,t,{name:n,index:i,group:a,on:o0,tween:r0,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:xp})}function In(e,n){var t=Ne(e,n);if(t.state>xp)throw new Error("too late; already scheduled");return t}function We(e,n){var t=Ne(e,n);if(t.state>ro)throw new Error("too late; already running");return t}function Ne(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function s0(e,n,t){var i=e.__transition,a;i[n]=t,t.timer=ao(o,0,t.time);function o(d){t.state=fp,t.timer.restart(r,t.delay,t.time),t.delay<=d&&r(d-t.delay)}function r(d){var u,g,_,b;if(t.state!==fp)return c();for(u in i)if(b=i[u],b.name===t.name){if(b.state===ro)return oo(r);b.state===_p?(b.state=On,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[u]):+u<n&&(b.state=On,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[u])}if(oo(function(){t.state===ro&&(t.state=_p,t.timer.restart(s,t.delay,t.time),s(d))}),t.state=so,t.on.call("start",e,e.__data__,t.index,t.group),t.state===so){for(t.state=ro,a=new Array(_=t.tween.length),u=0,g=-1;u<_;++u)(b=t.tween[u].value.call(e,e.__data__,t.index,t.group))&&(a[++g]=b);a.length=g+1}}function s(d){for(var u=d<t.duration?t.ease.call(null,d/t.duration):(t.timer.restart(c),t.state=lo,1),g=-1,_=a.length;++g<_;)a[g].call(e,u);t.state===lo&&(t.on.call("end",e,e.__data__,t.index,t.group),c())}function c(){t.state=On,t.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function fr(e,n){var t=e.__transition,i,a,o=!0,r;if(t){n=n==null?null:n+"";for(r in t){if((i=t[r]).name!==n){o=!1;continue}a=i.state>so&&i.state<lo,i.state=On,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete t[r]}o&&delete e.__transition}}function vp(e){return this.each(function(){fr(this,e)})}function l0(e,n){var t,i;return function(){var a=We(this,e),o=a.tween;if(o!==t){i=t=o;for(var r=0,s=i.length;r<s;++r)if(i[r].name===n){i=i.slice(),i.splice(r,1);break}}a.tween=i}}function c0(e,n,t){var i,a;if(typeof t!="function")throw new Error;return function(){var o=We(this,e),r=o.tween;if(r!==i){a=(i=r).slice();for(var s={name:n,value:t},c=0,d=a.length;c<d;++c)if(a[c].name===n){a[c]=s;break}c===d&&a.push(s)}o.tween=a}}function bp(e,n){var t=this._id;if(e+="",arguments.length<2){for(var i=Ne(this.node(),t).tween,a=0,o=i.length,r;a<o;++a)if((r=i[a]).name===e)return r.value;return null}return this.each((n==null?l0:c0)(t,e,n))}function Xi(e,n,t){var i=e._id;return e.each(function(){var a=We(this,i);(a.value||(a.value={}))[n]=t.apply(this,arguments)}),function(a){return Ne(a,i).value[n]}}function co(e,n){var t;return(typeof n=="number"?$e:n instanceof vt?Ti:(t=vt(n))?(n=t,Ti):An)(e,n)}function d0(e){return function(){this.removeAttribute(e)}}function p0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function m0(e,n,t){var i,a=t+"",o;return function(){var r=this.getAttribute(e);return r===a?null:r===i?o:o=n(i=r,t)}}function h0(e,n,t){var i,a=t+"",o;return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?o:o=n(i=r,t)}}function u0(e,n,t){var i,a,o;return function(){var r,s=t(this),c;return s==null?void this.removeAttribute(e):(r=this.getAttribute(e),c=s+"",r===c?null:r===i&&c===a?o:(a=c,o=n(i=r,s)))}}function g0(e,n,t){var i,a,o;return function(){var r,s=t(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(r=this.getAttributeNS(e.space,e.local),c=s+"",r===c?null:r===i&&c===a?o:(a=c,o=n(i=r,s)))}}function yp(e,n){var t=Gt(e),i=t==="transform"?ur:co;return this.attrTween(e,typeof n=="function"?(t.local?g0:u0)(t,i,Xi(this,"attr."+e,n)):n==null?(t.local?p0:d0)(t):(t.local?h0:m0)(t,i,n))}
vendor: 7,502 bytes, line 10
10function f0(e,n){return function(t){this.setAttribute(e,n.call(this,t))}}function _0(e,n){return function(t){this.setAttributeNS(e.space,e.local,n.call(this,t))}}function x0(e,n){var t,i;function a(){var o=n.apply(this,arguments);return o!==i&&(t=(i=o)&&_0(e,o)),t}return a._value=n,a}function v0(e,n){var t,i;function a(){var o=n.apply(this,arguments);return o!==i&&(t=(i=o)&&f0(e,o)),t}return a._value=n,a}function Cp(e,n){var t="attr."+e;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(n==null)return this.tween(t,null);if(typeof n!="function")throw new Error;var i=Gt(e);return this.tween(t,(i.local?x0:v0)(i,n))}function b0(e,n){return function(){In(this,e).delay=+n.apply(this,arguments)}}function y0(e,n){return n=+n,function(){In(this,e).delay=n}}function Tp(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?b0:y0)(n,e)):Ne(this.node(),n).delay}function C0(e,n){return function(){We(this,e).duration=+n.apply(this,arguments)}}function T0(e,n){return n=+n,function(){We(this,e).duration=n}}function Sp(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?C0:T0)(n,e)):Ne(this.node(),n).duration}function S0(e,n){if(typeof n!="function")throw new Error;return function(){We(this,e).ease=n}}function wp(e){var n=this._id;return arguments.length?this.each(S0(n,e)):Ne(this.node(),n).ease}function w0(e,n){return function(){var t=n.apply(this,arguments);if(typeof t!="function")throw new Error;We(this,e).ease=t}}function Ap(e){if(typeof e!="function")throw new Error;return this.each(w0(this._id,e))}function kp(e){typeof e!="function"&&(e=bn(e));for(var n=this._groups,t=n.length,i=new Array(t),a=0;a<t;++a)for(var o=n[a],r=o.length,s=i[a]=[],c,d=0;d<r;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&s.push(c);return new nt(i,this._parents,this._name,this._id)}function Dp(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,t=e._groups,i=n.length,a=t.length,o=Math.min(i,a),r=new Array(i),s=0;s<o;++s)for(var c=n[s],d=t[s],u=c.length,g=r[s]=new Array(u),_,b=0;b<u;++b)(_=c[b]||d[b])&&(g[b]=_);for(;s<i;++s)r[s]=n[s];return new nt(r,this._parents,this._name,this._id)}function A0(e){return(e+"").trim().split(/^|\s+/).every(function(n){var t=n.indexOf(".");return t>=0&&(n=n.slice(0,t)),!n||n==="start"})}function k0(e,n,t){var i,a,o=A0(n)?In:We;return function(){var r=o(this,e),s=r.on;s!==i&&(a=(i=s).copy()).on(n,t),r.on=a}}function Lp(e,n){var t=this._id;return arguments.length<2?Ne(this.node(),t).on.on(e):this.each(k0(t,e,n))}function D0(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function Pp(){return this.on("end.remove",D0(this._id))}function Ep(e){var n=this._name,t=this._id;typeof e!="function"&&(e=bi(e));for(var i=this._groups,a=i.length,o=new Array(a),r=0;r<a;++r)for(var s=i[r],c=s.length,d=o[r]=new Array(c),u,g,_=0;_<c;++_)(u=s[_])&&(g=e.call(u,u.__data__,_,s))&&("__data__"in u&&(g.__data__=u.__data__),d[_]=g,ni(d[_],n,t,_,d,Ne(u,t)));return new nt(o,this._parents,n,t)}function Mp(e){var n=this._name,t=this._id;typeof e!="function"&&(e=vn(e));for(var i=this._groups,a=i.length,o=[],r=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,g=0;g<d;++g)if(u=c[g]){for(var _=e.call(u,u.__data__,g,c),b,k=Ne(u,t),M=0,H=_.length;M<H;++M)(b=_[M])&&ni(b,n,t,M,_,k);o.push(_),r.push(u)}return new nt(o,r,n,t)}var L0=zt.prototype.constructor;function Op(){return new L0(this._groups,this._parents)}function P0(e,n){var t,i,a;return function(){var o=ii(this,e),r=(this.style.removeProperty(e),ii(this,e));return o===r?null:o===t&&r===i?a:a=n(t=o,i=r)}}function Ip(e){return function(){this.style.removeProperty(e)}}function E0(e,n,t){var i,a=t+"",o;return function(){var r=ii(this,e);return r===a?null:r===i?o:o=n(i=r,t)}}function M0(e,n,t){var i,a,o;return function(){var r=ii(this,e),s=t(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ii(this,e))),r===c?null:r===i&&c===a?o:(a=c,o=n(i=r,s))}}function O0(e,n){var t,i,a,o="style."+n,r="end."+o,s;return function(){var c=We(this,e),d=c.on,u=c.value[o]==null?s||(s=Ip(n)):void 0;(d!==t||a!==u)&&(i=(t=d).copy()).on(r,a=u),c.on=i}}function Fp(e,n,t){var i=(e+="")=="transform"?hr:co;return n==null?this.styleTween(e,P0(e,i)).on("end.style."+e,Ip(e)):typeof n=="function"?this.styleTween(e,M0(e,i,Xi(this,"style."+e,n))).each(O0(this._id,e)):this.styleTween(e,E0(e,i,n),t).on("end.style."+e,null)}function I0(e,n,t){return function(i){this.style.setProperty(e,n.call(this,i),t)}}function F0(e,n,t){var i,a;function o(){var r=n.apply(this,arguments);return r!==a&&(i=(a=r)&&I0(e,r,t)),i}return o._value=n,o}function Bp(e,n,t){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,F0(e,n,t??""))}function B0(e){return function(){this.textContent=e}}function V0(e){return function(){var n=e(this);this.textContent=n??""}}function Vp(e){return this.tween("text",typeof e=="function"?V0(Xi(this,"text",e)):B0(e==null?"":e+""))}function R0(e){return function(n){this.textContent=e.call(this,n)}}function N0(e){var n,t;function i(){var a=e.apply(this,arguments);return a!==t&&(n=(t=a)&&R0(a)),n}return i._value=e,i}function Rp(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,N0(e))}function Np(){for(var e=this._name,n=this._id,t=po(),i=this._groups,a=i.length,o=0;o<a;++o)for(var r=i[o],s=r.length,c,d=0;d<s;++d)if(c=r[d]){var u=Ne(c,n);ni(c,e,t,d,r,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new nt(i,this._parents,e,t)}function Gp(){var e,n,t=this,i=t._id,a=t.size();return new Promise(function(o,r){var s={value:r},c={value:function(){--a===0&&o()}};t.each(function(){var d=We(this,i),u=d.on;u!==e&&(n=(e=u).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),d.on=n}),a===0&&o()})}var G0=0;function nt(e,n,t,i){this._groups=e,this._parents=n,this._name=t,this._id=i}function zp(e){return zt().transition(e)}function po(){return++G0}var Ht=zt.prototype;nt.prototype=zp.prototype={constructor:nt,select:Ep,selectAll:Mp,selectChild:Ht.selectChild,selectChildren:Ht.selectChildren,filter:kp,merge:Dp,selection:Op,transition:Np,call:Ht.call,nodes:Ht.nodes,node:Ht.node,size:Ht.size,empty:Ht.empty,each:Ht.each,on:Lp,attr:yp,attrTween:Cp,style:Fp,styleTween:Bp,text:Vp,textTween:Rp,remove:Pp,tween:bp,delay:Tp,duration:Sp,ease:wp,easeVarying:Ap,end:Gp,[Symbol.iterator]:Ht[Symbol.iterator]};function mo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var z0={time:null,delay:0,duration:250,ease:mo};function H0(e,n){for(var t;!(t=e.__transition)||!(t=t[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return t}function Hp(e){var n,t;e instanceof nt?(n=e._id,e=e._name):(n=po(),(t=z0).time=Mn(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,o=0;o<a;++o)for(var r=i[o],s=r.length,c,d=0;d<s;++d)(c=r[d])&&ni(c,e,n,d,r,t||H0(c,n));return new nt(i,this._parents,e,n)}zt.prototype.interrupt=vp;zt.prototype.transition=Hp;var{abs:cE,max:dE,min:pE}=Math;function jp(e){return[+e[0],+e[1]]}function j0(e){return[jp(e[0]),jp(e[1])]}var mE={name:"x",handles:["w","e"].map(_r),input:function(e,n){return e==null?null:[[+e[0],n[0][1]],[+e[1],n[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},hE={name:"y",handles:["n","s"].map(_r),input:function(e,n){return e==null?null:[[n[0][0],+e[0]],[n[
101][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},uE={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(_r),input:function(e){return e==null?null:j0(e)},output:function(e){return e}};function _r(e){return{type:e}}function Pt(e,n){return e==null||n==null?NaN:e<n?-1:e>n?1:e>=n?0:NaN}function xr(e,n){return e==null||n==null?NaN:n<e?-1:n>e?1:n>=e?0:NaN}function ho(e){let n,t,i;e.length!==2?(n=Pt,t=(s,c)=>Pt(e(s),c),i=(s,c)=>e(s)-c):(n=e===Pt||e===xr?e:$0,t=e,i=e);function a(s,c,d=0,u=s.length){if(d<u){if(n(c,c)!==0)return u;do{let g=d+u>>>1;t(s[g],c)<0?d=g+1:u=g}while(d<u)}return d}function o(s,c,d=0,u=s.length){if(d<u){if(n(c,c)!==0)return u;do{let g=d+u>>>1;t(s[g],c)<=0?d=g+1:u=g}while(d<u)}return d}function r(s,c,d=0,u=s.length){let g=a(s,c,d,u-1);return g>d&&i(s[g-1],c)>-i(s[g],c)?g-1:g}return{left:a,center:r,right:o}}function $0(){return 0}function Fn(e){return e===null?NaN:+e}var Yp=ho(Pt),$p=Yp.right,W0=Yp.left,X0=ho(Fn).center,Bn=$p;var Ui=class extends Map{constructor(n,t=q0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(let[i,a]of n)this.set(i,a)}get(n){return super.get(Wp(this,n))}has(n){return super.has(Wp(this,n))}set(n,t){return super.set(U0(this,n),t)}delete(n){return super.delete(Q0(this,n))}};function Wp({_intern:e,_key:n},t){let i=n(t);return e.has(i)?e.get(i):t}function U0({_intern:e,_key:n},t){let i=n(t);return e.has(i)?e.get(i):(e.set(i,t),t)}function Q0({_intern:e,_key:n},t){let i=n(t);return e.has(i)&&(t=e.get(i),e.delete(i)),t}function q0(e){return e!==null&&typeof e=="object"?e.valueOf():e}var K0=Math.sqrt(50),Z0=Math.sqrt(10),J0=Math.sqrt(2);function uo(e,n,t){let i=(n-e)/Math.max(0,t),a=Math.floor(Math.log10(i)),o=i/Math.pow(10,a),r=o>=K0?10:o>=Z0?5:o>=J0?2:1,s,c,d;return a<0?(d=Math.pow(10,-a)/r,s=Math.round(e*d),c=Math.round(n*d),s/d<e&&++s,c/d>n&&--c,d=-d):(d=Math.pow(10,a)*r,s=Math.round(e/d),c=Math.round(n/d),s*d<e&&++s,c*d>n&&--c),c<s&&.5<=t&&t<2?uo(e,n,t*2):[s,c,d]}function go(e,n,t){if(n=+n,e=+e,t=+t,!(t>0))return[];if(e===n)return[e];let i=n<e,[a,o,r]=i?uo(n,e,t):uo(e,n,t);if(!(o>=a))return[];let s=o-a+1,c=new Array(s);if(i)if(r<0)for(let d=0;d<s;++d)c[d]=(o-d)/-r;else for(let d=0;d<s;++d)c[d]=(o-d)*r;else if(r<0)for(let d=0;d<s;++d)c[d]=(a+d)/-r;else for(let d=0;d<s;++d)c[d]=(a+d)*r;return c}function Vn(e,n,t){return n=+n,e=+e,t=+t,uo(e,n,t)[2]}function vr(e,n,t){n=+n,e=+e,t=+t;let i=n<e,a=i?Vn(n,e,t):Vn(e,n,t);return(i?-1:1)*(a<0?1/-a:a)}function br(e,n,t=Fn){if(!(!(i=e.length)||isNaN(n=+n))){if(n<=0||i<2)return+t(e[0],0,e);if(n>=1)return+t(e[i-1],i-1,e);var i,a=(i-1)*n,o=Math.floor(a),r=+t(e[o],o,e),s=+t(e[o+1],o+1,e);return r+(s-r)*(a-o)}}function Qi(e,n,t){e=+e,n=+n,t=(a=arguments.length)<2?(n=e,e=0,1):a<3?1:+t;for(var i=-1,a=Math.max(0,Math.ceil((n-e)/t))|0,o=new Array(a);++i<a;)o[i]=e+i*t;return o}function ai(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e);break}return this}var yr=Symbol("implicit");function Ai(){var e=new Ui,n=[],t=[],i=yr;function a(o){let r=e.get(o);if(r===void 0){if(i!==yr)return i;e.set(o,r=n.push(o)-1)}return t[r%t.length]}return a.domain=function(o){if(!arguments.length)return n.slice();n=[],e=new Ui;for(let r of o)e.has(r)||e.set(r,n.push(r)-1);return a},a.range=function(o){return arguments.length?(t=Array.from(o),a):t.slice()},a.unknown=function(o){return arguments.length?(i=o,a):i},a.copy=function(){return Ai(n,t).unknown(i)},ai.apply(a,arguments),a}function qi(){var e=Ai().unknown(void 0),n=e.domain,t=e.range,i=0,a=1,o,r,s=!1,c=0,d=0,u=.5;delete e.unknown;function g(){var _=n().length,b=a<i,k=b?a:i,M=b?i:a;o=(M-k)/Math.max(1,_-c+d*2),s&&(o=Math.floor(o)),k+=(M-k-o*(_-c))*u,r=o*(1-c),s&&(k=Math.round(k),r=Math.round(r));var H=Qi(_).map(function(ce){return k+o*ce});return t(b?H.reverse():H)}return e.domain=function(_){return arguments.length?(n(_),g()):n()},e.range=function(_){return arguments.length?([i,a]=_,i=+i,a=+a,g()):[i,a]},e.rangeRound=function(_){return[i,a]=_,i=+i,a=+a,s=!0,g()},e.bandwidth=function(){return r},e.step=function(){return o},e.round=function(_){return arguments.length?(s=!!_,g()):s},e.padding=function(_){return arguments.length?(c=Math.min(1,d=+_),g()):c},e.paddingInner=function(_){return arguments.length?(c=Math.min(1,_),g()):c},e.paddingOuter=function(_){return arguments.length?(d=+_,g()):d},e.align=function(_){return arguments.length?(u=Math.max(0,Math.min(1,_)),g()):u},e.copy=function(){return qi(n(),[i,a]).round(s).paddingInner(c).paddingOuter(d).align(u)},ai.apply(g(),arguments)}function Cr(e){return function(){return e}}function Tr(e){return+e}var Xp=[0,1];function Ki(e){return e}function Sr(e,n){return(n-=e=+e)?function(t){return(t-e)/n}:Cr(isNaN(n)?NaN:.5)}function t_(e,n){var t;return e>n&&(t=e,e=n,n=t),function(i){return Math.max(e,Math.min(n,i))}}function i_(e,n,t){var i=e[0],a=e[1],o=n[0],r=n[1];return a<i?(i=Sr(a,i),o=t(r,o)):(i=Sr(i,a),o=t(o,r)),function(s){return o(i(s))}}function n_(e,n,t){var i=Math.min(e.length,n.length)-1,a=new Array(i),o=new Array(i),r=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),n=n.slice().reverse());++r<i;)a[r]=Sr(e[r],e[r+1]),o[r]=t(n[r],n[r+1]);return function(s){var c=Bn(e,s,1,i)-1;return o[c](a[c](s))}}function Up(e,n){return n.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function a_(){var e=Xp,n=Xp,t=Si,i,a,o,r=Ki,s,c,d;function u(){var _=Math.min(e.length,n.length);return r!==Ki&&(r=t_(e[0],e[_-1])),s=_>2?n_:i_,c=d=null,g}function g(_){return _==null||isNaN(_=+_)?o:(c||(c=s(e.map(i),n,t)))(i(r(_)))}return g.invert=function(_){return r(a((d||(d=s(n,e.map(i),$e)))(_)))},g.domain=function(_){return arguments.length?(e=Array.from(_,Tr),u()):e.slice()},g.range=function(_){return arguments.length?(n=Array.from(_),u()):n.slice()},g.rangeRound=function(_){return n=Array.from(_),t=pr,u()},g.clamp=function(_){return arguments.length?(r=_?!0:Ki,u()):r!==Ki},g.interpolate=function(_){return arguments.length?(t=_,u()):t},g.unknown=function(_){return arguments.length?(o=_,g):o},function(_,b){return i=_,a=b,u()}}function wr(){return a_()(Ki,Ki)}
vendor: 5,190 bytes, line 10
10function Qp(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ki(e,n){if(!isFinite(e)||e===0)return null;var t=(e=n?e.toExponential(n-1):e.toExponential()).indexOf("e"),i=e.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+e.slice(t+1)]}function Et(e){return e=ki(Math.abs(e)),e?e[1]:NaN}function qp(e,n){return function(t,i){for(var a=t.length,o=[],r=0,s=e[0],c=0;a>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),o.push(t.substring(a-=s,a+s)),!((c+=s+1)>i));)s=e[r=(r+1)%e.length];return o.reverse().join(n)}}function Kp(e){return function(n){return n.replace(/[0-9]/g,function(t){return e[+t]})}}var o_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function oi(e){if(!(n=o_.exec(e)))throw new Error("invalid format: "+e);var n;return new fo({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}oi.prototype=fo.prototype;function fo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}fo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Zp(e){e:for(var n=e.length,t=1,i=-1,a;t<n;++t)switch(e[t]){case".":i=a=t;break;case"0":i===0&&(i=t),a=t;break;default:if(!+e[t])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(a+1):e}var Rn;function Jp(e,n){var t=ki(e,n);if(!t)return Rn=void 0,e.toPrecision(n);var i=t[0],a=t[1],o=a-(Rn=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,r=i.length;return o===r?i:o>r?i+new Array(o-r+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+ki(e,Math.max(0,n+o-1))[0]}function Ar(e,n){var t=ki(e,n);if(!t)return e+"";var i=t[0],a=t[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}var kr={"%":(e,n)=>(e*100).toFixed(n),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Qp,e:(e,n)=>e.toExponential(n),f:(e,n)=>e.toFixed(n),g:(e,n)=>e.toPrecision(n),o:e=>Math.round(e).toString(8),p:(e,n)=>Ar(e*100,n),r:Ar,s:Jp,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Dr(e){return e}var em=Array.prototype.map,tm=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function im(e){var n=e.grouping===void 0||e.thousands===void 0?Dr:qp(em.call(e.grouping,Number),e.thousands+""),t=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Dr:Kp(em.call(e.numerals,String)),r=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(g,_){g=oi(g);var b=g.fill,k=g.align,M=g.sign,H=g.symbol,ce=g.zero,Ae=g.width,fe=g.comma,ue=g.precision,Ie=g.trim,ot=g.type;ot==="n"?(fe=!0,ot="g"):kr[ot]||(ue===void 0&&(ue=12),Ie=!0,ot="g"),(ce||b==="0"&&k==="=")&&(ce=!0,b="0",k="=");var tn=(_&&_.prefix!==void 0?_.prefix:"")+(H==="$"?t:H==="#"&&/[boxX]/.test(ot)?"0"+ot.toLowerCase():""),jm=(H==="$"?i:/[%p]/.test(ot)?r:"")+(_&&_.suffix!==void 0?_.suffix:""),jr=kr[ot],Ym=/[defgprs%]/.test(ot);ue=ue===void 0?6:/[gprs]/.test(ot)?Math.max(1,Math.min(21,ue)):Math.max(0,Math.min(20,ue));function Yr(de){var ci=tn,ct=jm,Li,$r,Hn;if(ot==="c")ct=jr(de)+ct,de="";else{de=+de;var jn=de<0||1/de<0;if(de=isNaN(de)?c:jr(Math.abs(de),ue),Ie&&(de=Zp(de)),jn&&+de==0&&M!=="+"&&(jn=!1),ci=(jn?M==="("?M:s:M==="-"||M==="("?"":M)+ci,ct=(ot==="s"&&!isNaN(de)&&Rn!==void 0?tm[8+Rn/3]:"")+ct+(jn&&M==="("?")":""),Ym){for(Li=-1,$r=de.length;++Li<$r;)if(Hn=de.charCodeAt(Li),48>Hn||Hn>57){ct=(Hn===46?a+de.slice(Li+1):de.slice(Li))+ct,de=de.slice(0,Li);break}}}fe&&!ce&&(de=n(de,1/0));var Yn=ci.length+de.length+ct.length,Mt=Yn<Ae?new Array(Ae-Yn+1).join(b):"";switch(fe&&ce&&(de=n(Mt+de,Mt.length?Ae-ct.length:1/0),Mt=""),k){case"<":de=ci+de+ct+Mt;break;case"=":de=ci+Mt+de+ct;break;case"^":de=Mt.slice(0,Yn=Mt.length>>1)+ci+de+ct+Mt.slice(Yn);break;default:de=Mt+ci+de+ct;break}return o(de)}return Yr.toString=function(){return g+""},Yr}function u(g,_){var b=Math.max(-8,Math.min(8,Math.floor(Et(_)/3)))*3,k=Math.pow(10,-b),M=d((g=oi(g),g.type="f",g),{suffix:tm[8+b/3]});return function(H){return M(k*H)}}return{format:d,formatPrefix:u}}var _o,xo,vo;Lr({thousands:",",grouping:[3],currency:["$",""]});function Lr(e){return _o=im(e),xo=_o.format,vo=_o.formatPrefix,_o}function Pr(e){return Math.max(0,-Et(Math.abs(e)))}function Er(e,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Et(n)/3)))*3-Et(Math.abs(e)))}function Mr(e,n){return e=Math.abs(e),n=Math.abs(n)-e,Math.max(0,Et(n)-Et(e))+1}function Or(e,n,t,i){var a=vr(e,n,t),o;switch(i=oi(i??",f"),i.type){case"s":{var r=Math.max(Math.abs(e),Math.abs(n));
10return i.precision==null&&!isNaN(o=Er(a,r))&&(i.precision=o),vo(i,r)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=Mr(a,Math.max(Math.abs(e),Math.abs(n))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=Pr(a))&&(i.precision=o-(i.type==="%")*2);break}}return xo(i)}function r_(e){var n=e.domain;return e.ticks=function(t){var i=n();return go(i[0],i[i.length-1],t??10)},e.tickFormat=function(t,i){var a=n();return Or(a[0],a[a.length-1],t??10,i)},e.nice=function(t){t==null&&(t=10);var i=n(),a=0,o=i.length-1,r=i[a],s=i[o],c,d,u=10;for(s<r&&(d=r,r=s,s=d,d=a,a=o,o=d);u-- >0;){if(d=Vn(r,s,t),d===c)return i[a]=r,i[o]=s,n(i);if(d>0)r=Math.floor(r/d)*d,s=Math.ceil(s/d)*d;else if(d<0)r=Math.ceil(r*d)/d,s=Math.floor(s*d)/d;else break;c=d}return e},e}function ri(){var e=wr();return e.copy=function(){return Up(e,ri())},ai.apply(e,arguments),r_(e)}function Nn(){var e=[],n=[],t=[],i;function a(){var r=0,s=Math.max(1,n.length);for(t=new Array(s-1);++r<s;)t[r-1]=br(e,r/s);return o}function o(r){return r==null||isNaN(r=+r)?i:n[Bn(t,r)]}return o.invertExtent=function(r){var s=n.indexOf(r);return s<0?[NaN,NaN]:[s>0?t[s-1]:e[0],s<t.length?t[s]:e[e.length-1]]},o.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Pt),a()},o.range=function(r){return arguments.length?(n=Array.from(r),a()):n.slice()},o.unknown=function(r){return arguments.length?(i=r,o):i},o.quantiles=function(){return t.slice()},o.copy=function(){return Nn().domain(e).range(n).unknown(i)},ai.apply(o,arguments)}var um=Wm(am(),1);var u_=["caretElm"],g_=e=>({model:e});function f_(e,n){}function __(e,n){if(e&1&&(m(0,"span"),C(1,f_,0,0,"ng-template",5),h()),e&2){let t=f();l(),p("ngTemplateOutlet",t.template)("ngTemplateOutletContext",V(2,g_,t.context))}}function x_(e,n){if(e&1&&w(0,"span",6),e&2){let t=f();p("innerHTML",t.title,Zr)}}function v_(e,n){if(e&1&&(m(0,"header",4)(1,"span",5),v(2),h()()),e&2){let t=f();l(2),W(t.title)}}function b_(e,n){if(e&1){let t=I();m(0,"li",6)(1,"ngx-charts-legend-entry",7),A("select",function(a){D(t);let o=f();return L(o.labelClick.emit(a))})("activate",function(a){D(t);let o=f();return L(o.activate(a))})("deactivate",function(a){D(t);let o=f();return L(o.deactivate(a))}),h()()}if(e&2){let t=n.$implicit,i=f();l(),p("label",t.label)("formattedLabel",t.formattedLabel)("color",t.color)("isActive",i.isActive(t))}}var y_=["*"];function C_(e,n){if(e&1&&w(0,"ngx-charts-scale-legend",4),e&2){let t=f();p("horizontal",t.legendOptions&&t.legendOptions.position===t.LegendPosition.Below)("valueRange",t.legendOptions.domain)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)}}function T_(e,n){if(e&1){let t=I();m(0,"ngx-charts-legend",5),A("labelClick",function(a){D(t);let o=f();return L(o.legendLabelClick.emit(a))})("labelActivate",function(a){D(t);let o=f();return L(o.legendLabelActivate.emit(a))})("labelDeactivate",function(a){D(t);let o=f();return L(o.legendLabelDeactivate.emit(a))}),h()}if(e&2){let t=f();p("horizontal",t.legendOptions&&t.legendOptions.position===t.LegendPosition.Below)("data",t.legendOptions.domain)("title",t.legendOptions.title)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)("activeEntries",t.activeEntries)}}var S_=["ngx-charts-axis-label",""],gm=["ticksel"],w_=["ngx-charts-x-axis-ticks",""];function A_(e,n){e&1&&(K(),Ce(0))}function k_(e,n){if(e&1&&(K(),m(0,"tspan",10),v(1),h()),e&2){let t=n.$implicit,i=n.index;pe("y",i*12),l(),T(" ",t," ")}}function D_(e,n){if(e&1&&(K(),P(0),C(1,k_,2,2,"tspan",9),E()),e&2){let t=n.ngIf;l(),p("ngForOf",t)}}function L_(e,n){if(e&1&&C(0,D_,2,1,"ng-container",6),e&2){let t=f(2).$implicit,i=f();p("ngIf",i.tickChunks(t))}}function P_(e,n){if(e&1&&v(0),e&2){let t=f().ngIf,i=f(2);T(" ",i.tickTrim(t)," ")}}function E_(e,n){if(e&1&&(K(),P(0),m(1,"title"),v(2),h(),m(3,"text",7),C(4,A_,1,0,"ng-container",8),h(),C(5,L_,1,1,"ng-template",null,1,me)(7,P_,1,1,"ng-template",null,2,me),E()),e&2){let t=n.ngIf,i=he(6),a=he(8),o=f(2);l(2),W(t),l(),pe("text-anchor",o.textAnchor)("transform",o.textTransform),l(
10),p("ngIf",o.isWrapTicksSupported)("ngIfThen",i)("ngIfElse",a)}}function M_(e,n){if(e&1&&(K(),m(0,"g",5),C(1,E_,9,6,"ng-container",6),h()),e&2){let t=n.$implicit,i=f();pe("transform",i.tickTransform(t)),l(),p("ngIf",i.tickFormat(t))}}function O_(e,n){if(e&1&&(K(),m(0,"g"),w(1,"line",11),h()),e&2){let t=f(2);pe("transform",t.gridLineTransform()),l(),pe("y1",-t.gridLineHeight)}}function I_(e,n){if(e&1&&(K(),m(0,"g"),C(1,O_,2,2,"g",6),h()),e&2){let t=n.$implicit,i=f();pe("transform",i.tickTransform(t)),l(),p("ngIf",i.showGridLines)}}var F_=["ngx-charts-x-axis",""];function B_(e,n){if(e&1){let t=I();K(),m(0,"g",2),A("dimensionsChanged",function(a){D(t);let o=f();return L(o.emitTicksHeight(a))}),h()}if(e&2){let t=f();p("trimTicks",t.trimTicks)("rotateTicks",t.rotateTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickStroke",t.tickStroke)("scale",t.xScale)("orient",t.xOrient)("showGridLines",t.showGridLines)("gridLineHeight",t.dims.height)("width",t.dims.width)("tickValues",t.ticks)("wrapTicks",t.wrapTicks)}}function V_(e,n){if(e&1&&(K(),w(0,"g",3)),e&2){let t=f();p("label",t.labelText)("offset",t.labelOffset)("orient",t.orientation.Bottom)("height",t.dims.height)("width",t.dims.width)}}var R_=["ngx-charts-y-axis-ticks",""];function N_(e,n){e&1&&(K(),Ce(0))}function G_(e,n){if(e&1&&(K(),m(0,"tspan",12),v(1),h()),e&2){let t=n.$implicit,i=n.index,a=f(6);pe("y",i*(8+a.tickSpacing)),l(),T(" ",t," ")}}function z_(e,n){if(e&1&&(K(),P(0),C(1,G_,2,2,"tspan",11),E()),e&2){let t=f().ngIf;l(),p("ngForOf",t)}}function H_(e,n){if(e&1&&(K(),P(0),C(1,z_,2,1,"ng-container",10),E()),e&2){let t=n.ngIf;f(2);let i=he(8);l(),p("ngIf",t.length>1)("ngIfElse",i)}}function j_(e,n){if(e&1&&C(0,H_,2,2,"ng-container",7),e&2){let t=f(2).$implicit,i=f();p("ngIf",i.tickChunks(t))}}function Y_(e,n){if(e&1&&v(0),e&2){let t=f().ngIf,i=f(2);T(" ",i.tickTrim(t)," ")}}function $_(e,n){if(e&1&&(K(),P(0),m(1,"title"),v(2),h(),m(3,"text",8),C(4,N_,1,0,"ng-container",9),h(),C(5,j_,1,1,"ng-template",null,1,me)(7,Y_,1,1,"ng-template",null,2,me),E()),e&2){let t=n.ngIf,i=he(6),a=he(8),o=f(2);l(2),W(t),l(),Fe("font-size","12px"),pe("dy",o.dy)("x",o.x1)("y",o.y1)("text-anchor",o.textAnchor),l(),p("ngIf",o.wrapTicks)("ngIfThen",i)("ngIfElse",a)}}function W_(e,n){if(e&1&&(K(),m(0,"g",6),C(1,$_,9,10,"ng-container",7),h()),e&2){let t=n.$implicit,i=f();pe("transform",i.transform(t)),l(),p("ngIf",i.tickFormat(t))}}function X_(e,n){if(e&1&&(K(),w(0,"path",13)),e&2){let t=f();pe("d",t.referenceAreaPath)("transform",t.gridLineTransform())}}function U_(e,n){if(e&1&&(K(),w(0,"line",15)),e&2){let t=f(3);pe("x2",t.gridLineWidth)}}function Q_(e,n){if(e&1&&(K(),w(0,"line",15)),e&2){let t=f(3);pe("x2",-t.gridLineWidth)}}function q_(e,n){if(e&1&&(K(),m(0,"g"),C(1,U_,1,1,"line",14)(2,Q_,1,1,"line",14),h()),e&2){let t=f(2);pe("transform",t.gridLineTransform()),l(),p("ngIf",t.orient===t.Orientation.Left),l(),p("ngIf",t.orient===t.Orientation.Right)}}function K_(e,n){if(e&1&&(K(),m(0,"g"),C(1,q_,3,3,"g",7),h()),e&2){let t=n.$implicit,i=f();pe("transform",i.transform(t)),l(),p("ngIf",i.showGridLines)}}function Z_(e,n){if(e&1&&(K(),m(0,"g")(1,"title"),v(2),h(),m(3,"text",17),v(4),h()()),e&2){let t=f(2).$implicit,i=f();l(2),W(i.tickTrim(i.tickFormat(t.value))),l(),pe("dy",i.dy)("y",-6)("x",i.gridLineWidth)("text-anchor",i.textAnchor),l(),T(" ",t.name," ")}}function J_(e,n){if(e&1&&(K(),m(0,"g"),w(1,"line",16),C(2,Z_,5,6,"g",7),h()),e&2){let t=f().$implicit,i=f();pe("transform",i.transform(t.value)),l(),pe("x2",i.gridLineWidth)("transform",i.gridLineTransform()),l(),p("ngIf",i.showRefLabels)}}function ex(e,n){if(e&1&&(K(),m(0,"g"),C(1,J_,3,4,"g",7),h()),e&2){let t=f();l(),p("ngIf",t.showRefLines)}}var tx=["ngx-charts-y-axis",""];function ix(e,n){if(e&1){let t=I();K(),m(0,"g",2),A("dimensionsChanged",function(a){D(t);let o=f();return L(o.emitTicksWidth(a))}),h()}if(e&2){let t=f();p("trimTicks",t.trimTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickValues",t.ticks)("tickStroke",t.tickStroke)("scale",t.yScale)("orient",t.yOrient)("showGridLines",t.showGridLines)("gridLineWidth",t.dims.width)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)("height",t.dims.height)("wrapTicks",t.wrapTicks)}}function nx(e,n){if(e&1&&(K(),w(0,"g",3)),e&2){let t=f();p("label",t.labelText)("offset",t.labelOffset)("orient",t.yOrient)("height",t.dims.height)("width",t.dims.width)}}var ax=["ngx-charts-svg-linear-gradient",""];function ox(e,n){if(e&1&&(K(),w(0,"stop")),e&2){let t=n.$implicit;Fe("stop-color",t.color)("stop-opacity",t.opacity),pe("offset",t.offset+"%")}}var rx=["tooltipTemplate"];var sx=(e,n)=>[e,n];var lx=`.ngx-charts-outer{animation:chartFadeIn linear .6s}@keyframes chartFadeIn{0%{opacity:0}
1020%{opacity:0}to{opacity:1}}.ngx-charts{float:left;overflow:visible}.ngx-charts .circle,.ngx-charts .cell,.ngx-charts .bar,.ngx-charts .node,.ngx-charts .link,.ngx-charts .arc{cursor:pointer}.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover,.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .node.active,.ngx-charts .node:hover,.ngx-charts .link.active,.ngx-charts .link:hover,.ngx-charts .card.active,.ngx-charts .card:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .bar:focus,.ngx-charts .cell:focus,.ngx-charts .arc:focus,.ngx-charts .node:focus,.ngx-charts .link:focus,.ngx-charts .card:focus{outline:none}.ngx-charts .bar.hidden,.ngx-charts .cell.hidden,.ngx-charts .arc.hidden,.ngx-charts .node.hidden,.ngx-charts .link.hidden,.ngx-charts .card.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .line-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .polar-series-path.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .area-series.inactive{transition:opacity .1s ease-in-out;opacity:.2}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:400}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{stroke:#ddd;stroke-width:1;fill:none}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-width:1;stroke-dasharray:5;stroke-dashoffset:5}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill-opacity:.05;fill:#000}.ngx-charts .gridline-path-dotted{stroke:#ddd;stroke-width:1;fill:none;stroke-dasharray:1,20;stroke-dashoffset:3}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:#0000000d} 11`;var cx=["ngx-charts-bar",""];function dx(e,n){if(e&1&&(K(),m(0,"defs"),w(1,"g",2),h()),e&2){let t=f();l(),p("orientation",t.orientation)("name",t.gradientId)("stops",t.gradientStops)}}var px=["ngx-charts-bar-label",""];var mx=["ngx-charts-series-vertical",""];function hx(e,n){if(e&1){let t=I();K(),m(0,"g",2),A("select",function(a){D(t);let o=f(2);return L(o.onClick(a))})("activate",function(a){D(t);let o=f(2);return L(o.activate.emit(a))})("deactivate",function(a){D(t);let o=f(2);return L(o.deactivate.emit(a))}),h()}if(e&2){let t=n.$implicit,i=f(2);p("@animationState","active")("@.disabled",!i.animations)("width",t.width)("height",t.height)("x",t.x)("y",t.y)("fill",t.color)("stops",t.gradientStops)("data",t.data)("orientation",i.barOrientation.Vertical)("roundEdges",t.roundEdges)("gradient",i.gradient)("ariaLabel",t.ariaLabel)("isActive",i.isActive(t.data))("tooltipDisabled",i.tooltipDisabled)("tooltipPlacement",i.tooltipPlacement)("tooltipType",i.tooltipType)("tooltipTitle",i.tooltipTemplate?void 0:t.tooltipText)("tooltipTemplate",i.tooltipTemplate)("tooltipContext",t.data)("noBarWhenZero",i.noBarWhenZero)("animations",i.animations)}}function ux(e,n){if(e&1&&(K(),m(0,"g"),C(1,hx,1,22,"g",1),h()),e&2){let t=f();l(),p("ngForOf",t.bars)("ngForTrackBy",t.trackBy)}}function gx(e,n){if(e&1){let t=I();K(),m(0,"g",2),A("select",function(a){D(t);let o=f(2);return L(o.onClick(a))})("activate",function(a){D(t);let o=f(2);return L(o.activate.emit(a))})("deactivate",function(a){D(t);let o=f(2);return L(o.deactivate.emit(a))}),h()}if(e&2){let t=n.$implicit,i=f(2);p("width",t.width)("height",t.height)("x",t.x)("y",t.y)("fill",t.color)("stops",t.gradientStops)("data",t.data)("orientation",i.barOrientation.Vertical)("roundEdges",t.roundEdges)("gradient",i.gradient)("ariaLabel",t.ariaLabel)("isActive",i.isActive(t.data))("tooltipDisabled",i.tooltipDisabled)("tooltipPlacement",i.tooltipPlacement)("tooltipType",i.tooltipType)("tooltipTitle",i.tooltipTemplate?void 0:t.tooltipText)("tooltipTemplate",i.tooltipTemplate)("tooltipContext",t.data)("noBarWhenZero",i.noBarWhenZero)("animations",i.animations)}}function fx(e,n){if(e&1&&(K(),m(0,"g"),C(1,gx,1,20,"g",1),h()),e&2){let t=f();l(),p("ngForOf",t.bars)("ngForTrackBy",t.trackBy)}}function _x(e,n){if(e&1){let t=I();K(),m(0,"g",4),A("dimensionsChanged",function(a){let o=D(t).index,r=f(2);return L(r.dataLabelHeightChanged.emit({size:a,index:o}))}),h()}if(e&2){let t=n.$implicit,i=f(2);p("barX",t.x)("barY",t.y)("barWidth",t.width)("barHeight",t.height)("value",t.total)("valueFormatting",i.dataLabelFormatting)("orientation",i.barOrientation.Vertical)}}function xx(e,n){if(e&1&&(K(),m(0,"g"),C(1,_x,1,7,"g",3),h()),e&2){let t=f();l(),p("ngForOf",t.barsForDataLabels)("ngForTrackBy",t.trackDataLabelBy)}}function vx(e,n){if(e&1){let t=I();K(),m(0,"g",5),A("dimensionsChanged",function(a){D(t);let o=f();
11return L(o.updateXAxisHeight(a))}),h()}if(e&2){let t=f();p("xScale",t.xScale)("dims",t.dims)("showLabel",t.showXAxisLabel)("labelText",t.xAxisLabel)("trimTicks",t.trimXAxisTicks)("rotateTicks",t.rotateXAxisTicks)("maxTickLength",t.maxXAxisTickLength)("tickFormatting",t.xAxisTickFormatting)("ticks",t.xAxisTicks)("xAxisOffset",t.dataLabelMaxHeight.negative)("wrapTicks",t.wrapTicks)}}function bx(e,n){if(e&1){let t=I();K(),m(0,"g",6),A("dimensionsChanged",function(a){D(t);let o=f();return L(o.updateYAxisWidth(a))}),h()}if(e&2){let t=f();p("yScale",t.yScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showYAxisLabel)("labelText",t.yAxisLabel)("trimTicks",t.trimYAxisTicks)("maxTickLength",t.maxYAxisTickLength)("tickFormatting",t.yAxisTickFormatting)("ticks",t.yAxisTicks)("wrapTicks",t.wrapTicks)}}function yx(e,n){if(e&1){let t=I();K(),m(0,"g")(1,"g",8),A("select",function(a){let o=D(t).$implicit,r=f(2);return L(r.onClick(a,o))})("activate",function(a){let o=D(t).$implicit,r=f(2);return L(r.onActivate(a,o))})("deactivate",function(a){let o=D(t).$implicit,r=f(2);return L(r.onDeactivate(a,o))})("dataLabelHeightChanged",function(a){let o=D(t).index,r=f(2);return L(r.onDataLabelMaxHeightChanged(a,o))}),h()()}if(e&2){let t=n.$implicit,i=f(2);p("@animationState","active"),pe("transform",i.groupTransform(t)),l(),p("type",i.barChartType.Stacked)("xScale",i.xScale)("yScale",i.yScale)("activeEntries",i.activeEntries)("colors",i.colors)("series",t.series)("dims",i.dims)("gradient",i.gradient)("tooltipDisabled",i.tooltipDisabled)("tooltipTemplate",i.tooltipTemplate)("showDataLabel",i.showDataLabel)("dataLabelFormatting",i.dataLabelFormatting)("seriesName",t.name)("animations",i.animations)("noBarWhenZero",i.noBarWhenZero)}}function Cx(e,n){if(e&1&&(K(),m(0,"g"),C(1,yx,2,17,"g",7),h()),e&2){let t=f();l(),p("ngForOf",t.results)("ngForTrackBy",t.trackBy)}}function Tx(e,n){if(e&1){let t=I();K(),m(0,"g")(1,"g",8),A("select",function(a){let o=D(t).$implicit,r=f(2);return L(r.onClick(a,o))})("activate",function(a){let o=D(t).$implicit,r=f(2);return L(r.onActivate(a,o))})("deactivate",function(a){let o=D(t).$implicit,r=f(2);return L(r.onDeactivate(a,o))})("dataLabelHeightChanged",function(a){let o=D(t).index,r=f(2);return L(r.onDataLabelMaxHeightChanged(a,o))}),h()()}if(e&2){let t=n.$implicit,i=f(2);pe("transform",i.groupTransform(t)),l(),p("type",i.barChartType.Stacked)("xScale",i.xScale)("yScale",i.yScale)("activeEntries",i.activeEntries)("colors",i.colors)("series",t.series)("dims",i.dims)("gradient",i.gradient)("tooltipDisabled",i.tooltipDisabled)("tooltipTemplate",i.tooltipTemplate)("showDataLabel",i.showDataLabel)("dataLabelFormatting",i.dataLabelFormatting)("seriesName",t.name)("animations",i.animations)("noBarWhenZero",i.noBarWhenZero)}}function Sx(e,n){if(e&1&&(K(),m(0,"g"),C(1,Tx,2,16,"g",7),h()),e&2){let t=f();l(),p("ngForOf",t.results)("ngForTrackBy",t.trackBy)}}function wx(e,n,t){t=t||{};let i,a,o,r=null,s=0;function c(){s=t.leading===!1?0:+new Date,r=null,o=e.apply(i,a)}return function(){let d=+new Date;!s&&t.leading===!1&&(s=d);let u=n-(d-s);return i=this,a=arguments,u<=0?(clearTimeout(r),r=null,s=d,o=e.apply(i,a)):!r&&t.trailing!==!1&&(r=setTimeout(c,u)),o}}function Ax(e,n){return function(i,a,o){return{configurable:!0,enumerable:o.enumerable,get:function(){return Object.defineProperty(this,a,{configurable:!0,enumerable:o.enumerable,value:wx(o.value,e,n)}),this[a]}}}}var se=function(e){return e.Top="top",e.Bottom="bottom",e.Left="left",e.Right="right",e.Center="center",e}(se||{}),li=7;function om(e,n,t){if(t===se.Top)return e.top-li;if(t===se.Bottom)return e.top+e.height-n.height+li;if(t===se.Center)return e.top+e.height/2-n.height/2}function rm(e,n,t){if(t===se.Left)return e.left-li;if(t===se.Right)return e.left+e.width-n.width+li;if(t===se.Center)return e.left+e.width/2-n.width/2}var zn=class e{static calculateVerticalAlignment(n,t,i){let a=om(n,t,i);return a+t.height>window.innerHeight&&(a=window.innerHeight-t.height),a}static calculateVerticalCaret(n,t,i,a){let o;a===se.Top&&(o=n.height/2-i.height/2+li),a===se.Bottom&&(o=t.height-n.height/2-i.height/2-li),a===se.Center&&(o=t.height/2-i.height/2);let r=om(n,t,a);return r+t.height>window.innerHeight&&(o+=r+t.height-window.innerHeight),o}static calculateHorizontalAlignment(n,t,i){let a=rm(n,t,i);return a+t.width>window.innerWidth&&(a=window.innerWidth-t.width),a}static calculateHorizontalCaret(n,t,i,a){let o;
11a===se.Left&&(o=n.width/2-i.width/2+li),a===se.Right&&(o=t.width-n.width/2-i.width/2-li),a===se.Center&&(o=t.width/2-i.width/2);let r=rm(n,t,a);return r+t.width>window.innerWidth&&(o+=r+t.width-window.innerWidth),o}static shouldFlip(n,t,i,a){let o=!1;return i===se.Right&&n.left+n.width+t.width+a>window.innerWidth&&(o=!0),i===se.Left&&n.left-t.width-a<0&&(o=!0),i===se.Top&&n.top-t.height-a<0&&(o=!0),i===se.Bottom&&n.top+n.height+t.height+a>window.innerHeight&&(o=!0),o}static positionCaret(n,t,i,a,o){let r=0,s=0;return n===se.Right?(s=-7,r=e.calculateVerticalCaret(i,t,a,o)):n===se.Left?(s=t.width,r=e.calculateVerticalCaret(i,t,a,o)):n===se.Top?(r=t.height,s=e.calculateHorizontalCaret(i,t,a,o)):n===se.Bottom&&(r=-7,s=e.calculateHorizontalCaret(i,t,a,o)),{top:r,left:s}}static positionContent(n,t,i,a,o){let r=0,s=0;return n===se.Right?(s=i.left+i.width+a,r=e.calculateVerticalAlignment(i,t,o)):n===se.Left?(s=i.left-t.width-a,r=e.calculateVerticalAlignment(i,t,o)):n===se.Top?(r=i.top-t.height-a,s=e.calculateHorizontalAlignment(i,t,o)):n===se.Bottom&&(r=i.top+i.height+a,s=e.calculateHorizontalAlignment(i,t,o)),{top:r,left:s}}static determinePlacement(n,t,i,a){if(e.shouldFlip(i,t,n,a)){if(n===se.Right)return se.Left;if(n===se.Left)return se.Right;if(n===se.Top)return se.Bottom;if(n===se.Bottom)return se.Top}return n}},kx=(()=>{class e{constructor(t,i,a){this.element=t,this.renderer=i,this.platformId=a}get cssClasses(){let t="ngx-charts-tooltip-content";return t+=` position-${this.placement}`,t+=` type-${this.type}`,t+=` ${this.cssClass}`,t}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){if(!mi(this.platformId))return;let t=this.element.nativeElement,i=this.host.nativeElement.getBoundingClientRect();if(!i.height&&!i.width)return;let a=t.getBoundingClientRect();this.checkFlip(i,a),this.positionContent(t,i,a),this.showCaret&&this.positionCaret(i,a),setTimeout(()=>this.renderer.addClass(t,"animate"),1)}positionContent(t,i,a){let{top:o,left:r}=zn.positionContent(this.placement,a,i,this.spacing,this.alignment);this.renderer.setStyle(t,"top",`${o}px`),this.renderer.setStyle(t,"left",`${r}px`)}positionCaret(t,i){let a=this.caretElm.nativeElement,o=a.getBoundingClientRect(),{top:r,left:s}=zn.positionCaret(this.placement,i,t,o,this.alignment);this.renderer.setStyle(a,"top",`${r}px`),this.renderer.setStyle(a,"left",`${s}px`)}checkFlip(t,i){this.placement=zn.determinePlacement(this.placement,i,t,this.spacing)}onWindowResize(){this.position()}}return e.\u0275fac=function(t){return new(t||e)(y(di),y(Lo),y(Mi))},e.\u0275cmp=O({type:e,selectors:[["ngx-tooltip-content"]],viewQuery:function(t,i){if(t&1&&ne(u_,5),t&2){let a;te(a=ie())&&(i.caretElm=a.first)}},hostVars:2,hostBindings:function(t,i){t&1&&A("resize",function(){return i.onWindowResize()},!1,Wn),t&2&&Wt(i.cssClasses)},inputs:{host:"host",showCaret:"showCaret",type:"type",placement:"placement",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},standalone:!1,decls:6,vars:6,consts:[["caretElm",""],[3,"hidden"],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(t,i){t&1&&(m(0,"div"),w(1,"span",1,0),m(3,"div",2),C(4,__,2,4,"span",3)(5,x_,1,1,"span",4),h()()),t&2&&(l(),as("tooltip-caret position-",i.placement,""),p("hidden",!i.showCaret),l(3),p("ngIf",!i.title),l(),p("ngIf",i.title))},dependencies:[z,ze],styles:[`.ngx-charts-tooltip-content{position:fixed;border-radius:3px;z-index:5000;display:block;font-weight:400;opacity:0;pointer-events:none!important}.ngx-charts-tooltip-content.type-popover{background:#fff;color:#060709;border:1px solid #72809b;box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{position:absolute;z-index:5001;width:0;height:0}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #fff}.ngx-charts-tooltip-content.type-tooltip{color:#fff;background:rgba(0,0,0,.75);font-size:12px;padding:0 10px;text-align:center;pointer-events:auto}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content .tooltip-label{display:block;line-height:1em;padding:8px 5px 5px;font-size:1em}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{position:absolute;z-index:5001;width:0;height:0}.ngx-charts-tooltip-content.position-right{transform:translate(10px)}.ngx-charts-tooltip-content.position-left{transform:translate(-10px)}.ngx-charts-tooltip-content.position-top{transform:translateY(-10px)}.ngx-charts-tooltip-content.position-bottom{transform:translateY(10px)}.ngx-charts-tooltip-content.animate{opacity:1;transition:opacity .3s,transform .3s;transform:translate(0);pointer-events:auto}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{text-align:left;line-height:1.2em;padding:5px 0}.tooltip-item .tooltip-item-color{display:inline-block;height:12px;width:12px;margin-right:5px;color:#5b646b;border-radius:3px} 12`],encapsulation:2}),Xr([Ax(100)],e.prototype,"onWindowResize",null),e})(),Ir=class{constructor(n){this.injectionService=n,this.defaults={},this.components=new Map}getByType(n=this.type){return this.components.get(n)}create(n){return this.createByType(this.type,n)}createByType(n,t){t=this.assignDefaults(t);let i=this.injectComponent(n,t);return this.register(n,i),i}destroy(n){let t=this.components.get(n.componentType);if(t&&t.length){let i=t.indexOf(n);i>-1&&(t[i].destroy(),t.splice(i,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(n){let t=this.components.get(n);if(t&&t.length){let i=t.length-1;for(;i>=0;)this.destroy(t[i--])}}injectComponent(n,t){return this.injectionService.appendComponent(n,t)}assignDefaults(n){let t=Ot({},this.defaults.inputs),i=Ot({},this.defaults.outputs);return!n.inputs&&!n.outputs&&(n={inputs:n}),t&&(n.inputs=Ot(Ot({},t),n.inputs)),i&&(n.outputs=Ot(Ot({},i),n.outputs)),n}register(n,t){this.components.has(n)||this.components.set(n,[]),this.components.get(n).push(t)}};function Dx(e){return e.element}var fm=(()=>{class e{constructor(t,i,a){this.applicationRef=t,this.componentFactoryResolver=i,this.injector=a}static setGlobalRootViewContainer(t){e.globalRootViewContainer=t}getRootViewContainer(){if(this._container)return this._container;if(e.globalRootViewContainer)return e.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(t){this._container=t}getComponentRootNode(t){return Dx(t)?t.element.nativeElement:t.hostView&&t.hostView.rootNodes.length>0?t.hostView.rootNodes[0]:t.location.nativeElement}getRootViewContainerNode(t){return this.getComponentRootNode(t)}projectComponentBindings(t,i){if(i){if(i.inputs!==void 0){let a=Object.getOwnPropertyNames(i.inputs);for(let o of a)t.instance[o]=i.inputs[o]}if(i.outputs!==void 0){let a=Object.getOwnPropertyNames(i.outputs);for(let o of a)t.instance[o]=i.outputs[o]}}return t}appendComponent(t,i={},a){a||(a=this.getRootViewContainer());let o=this.getComponentRootNode(a),r=new Rs(o,this.componentFactoryResolver,this.applicationRef,this.injector),s=new Vs(t),c=r.attach(s);return this.projectComponentBindings(c,i),c}}return e.globalRootViewContainer=null,e.\u0275fac=function(t){return new(t||e)(G(ns),G(Jr),G(Kr))},e.\u0275prov=Z({token:e,factory:e.\u0275fac}),e})(),Vr=(()=>{class e extends Ir{constructor(t){super(t),this.type=kx}}return e.\u0275fac=function(t){return new(t||e)(G(fm))},e.\u0275prov=Z({token:e,factory:e.\u0275fac}),e})(),Di=function(e){return e.Right="right",e.Below="below",e}(Di||{}),Gn=function(e){return e.ScaleLegend="scaleLegend",e.Legend="legend",e}(Gn||{}),ve=function(e){return e.Time="time",e.Linear="linear",e.Ordinal="ordinal",e.Quantile="quantile",e}(ve||{}),Lx=(()=>{class e{constructor(){this.horizontal=!1}ngOnChanges(t){let i=this.gradientString(this.colors.range(),this.colors.domain()),a=this.horizontal?"right":"bottom";this.gradient=`linear-gradient(to ${a}, ${i})`}gradientString(t,i){i.push(1);let a=[];
12return t.reverse().forEach((o,r)=>{a.push(`${o} ${Math.round(i[r]*100)}%`)}),a.join(", ")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=O({type:e,selectors:[["ngx-charts-scale-legend"]],inputs:{valueRange:"valueRange",colors:"colors",height:"height",width:"width",horizontal:"horizontal"},standalone:!1,features:[ye],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(t,i){t&1&&(m(0,"div",0)(1,"div",1)(2,"span"),v(3),h()(),w(4,"div",2),m(5,"div",1)(6,"span"),v(7),h()()()),t&2&&(Fe("height",i.horizontal?void 0:i.height,"px")("width",i.width,"px"),X("horizontal-legend",i.horizontal),l(3),W(i.valueRange[1].toLocaleString()),l(),Fe("background",i.gradient),l(3),W(i.valueRange[0].toLocaleString()))},styles:[`.chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{text-align:center;display:flex;flex-direction:column}.chart-legend .scale-legend-wrap{display:inline-block;flex:1;width:30px;border-radius:5px;margin:0 auto}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{width:auto;height:30px;margin:0 16px} 13`],encapsulation:2,changeDetection:0}),e})();function Rr(e){return e instanceof Date?e=e.toLocaleDateString():e=e.toLocaleString(),e}function Px(e){return e.toLocaleString().replace(/[&'`"<>]/g,n=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"})[n])}var Ex=(()=>{class e{constructor(){this.isActive=!1,this.select=new J,this.activate=new J,this.deactivate=new J,this.toggle=new J}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=O({type:e,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(t,i){t&1&&A("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(){return i.onMouseLeave()})},inputs:{color:"color",label:"label",formattedLabel:"formattedLabel",isActive:"isActive"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},standalone:!1,decls:4,vars:6,consts:[["tabindex","-1",3,"click","title"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(t,i){t&1&&(m(0,"span",0),A("click",function(){return i.select.emit(i.formattedLabel)}),m(1,"span",1),A("click",function(){return i.toggle.emit(i.formattedLabel)}),h(),m(2,"span",2),v(3),h()()),t&2&&(X("active",i.isActive),p("title",i.formattedLabel),l(),Fe("background-color",i.color),l(2),T(" ",i.trimmedLabel," "))},encapsulation:2,changeDetection:0}),e})(),Mx=(()=>{class e{constructor(t){this.cd=t,this.horizontal=!1,this.labelClick=new J,this.labelActivate=new J,this.labelDeactivate=new J,this.legendEntries=[]}ngOnChanges(t){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){let t=[];for(let i of this.data){let a=Rr(i);t.findIndex(r=>r.label===a)===-1&&t.push({label:i,formattedLabel:a,color:this.colors.getColor(i)})}return t}isActive(t){return this.activeEntries?this.activeEntries.find(a=>t.label===a.name)!==void 0:!1}activate(t){this.labelActivate.emit(t)}deactivate(t){this.labelDeactivate.emit(t)}trackBy(t,i){return i.label}}return e.\u0275fac=function(t){return new(t||e)(y(Oe))},e.\u0275cmp=O({type:e,selectors:[["ngx-charts-legend"]],inputs:{data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries",horizontal:"horizontal"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},standalone:!1,features:[ye],decls:5,vars:9,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"select","activate","deactivate","label","formattedLabel","color","isActive"]],template:function(t,i){t&1&&(m(0,"div"),C(1,v_,3,1,"header",0),m(2,"div",1)(3,"ul",2),C(4,b_,2,4,"li",3),h()()()),t&2&&(Fe("width",i.width,"px"),l(),p("ngIf",(i.title==null?null:i.title.length)>0),l(2),Fe("max-height",i.height-45,"px"),X("horizontal-legend",i.horizontal),l(),p("ngForOf",i.legendEntries)("ngForTrackBy",i.trackBy))}
13,dependencies:[Ex,z,le],styles:[`.chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:700}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;float:left;width:100%;border-radius:3px;overflow-y:auto;overflow-x:hidden;white-space:nowrap;background:rgba(0,0,0,.05)}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;width:calc(100% - 20px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} 14`],encapsulation:2,changeDetection:0}),e})(),Ox=(()=>{class e{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new J,this.legendLabelActivate=new J,this.legendLabelDeactivate=new J,this.LegendPosition=Di,this.LegendType=Gn}ngOnChanges(t){this.update()}update(){let t=0;this.showLegend&&(this.legendType=this.getLegendType(),(!this.legendOptions||this.legendOptions.position===Di.Right)&&(this.legendType===Gn.ScaleLegend?t=1:t=2));let i=12-t;this.chartWidth=Math.floor(this.view[0]*i/12),this.legendWidth=!this.legendOptions||this.legendOptions.position===Di.Right?Math.floor(this.view[0]*t/12):this.chartWidth}getLegendType(){return this.legendOptions.scaleType===ve.Linear?Gn.ScaleLegend:Gn.Legend}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=O({type:e,selectors:[["ngx-charts-chart"]],inputs:{view:"view",showLegend:"showLegend",legendOptions:"legendOptions",legendType:"legendType",activeEntries:"activeEntries",animations:"animations"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},standalone:!1,features:[Un([Vr]),ye],ngContentSelectors:y_,decls:5,vars:8,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"horizontal","valueRange","colors","height","width",4,"ngIf"],["class","chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"labelClick","labelActivate","labelDeactivate","horizontal","data","title","colors","height","width","activeEntries"]],template:function(t,i){t&1&&(Ii(),m(0,"div",0),K(),m(1,"svg",1),Fi(2),h(),C(3,C_,1,5,"ngx-charts-scale-legend",2)(4,T_,1,7,"ngx-charts-legend",3),h()),t&2&&(Fe("width",i.view[0],"px")("height",i.view[1],"px"),l(),pe("width",i.chartWidth)("height",i.view[1]),l(2),p("ngIf",i.showLegend&&i.legendType===i.LegendType.ScaleLegend),l(),p("ngIf",i.showLegend&&i.legendType===i.LegendType.Legend))}
14,dependencies:[Lx,Mx,z],encapsulation:2,changeDetection:0}),e})(),Ix=(()=>{class e{constructor(t,i){this.element=t,this.zone=i,this.visible=new J,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){let t=()=>{if(!this.element)return;let{offsetHeight:i,offsetWidth:a}=this.element.nativeElement;i&&a?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t())})}}return e.\u0275fac=function(t){return new(t||e)(y(di),y(an))},e.\u0275dir=Po({type:e,selectors:[["visibility-observer"]],outputs:{visible:"visible"},standalone:!1}),e})();function sm(e){return toString.call(e)==="[object Date]"}var Fx=(()=>{class e{constructor(t,i,a,o){this.chartElement=t,this.zone=i,this.cd=a,this.platformId=o,this.scheme="cool",this.schemeType=ve.Ordinal,this.animations=!0,this.select=new J}ngOnInit(){Qn(this.platformId)&&(this.animations=!1)}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new Ix(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(t){this.update()}update(){if(this.results?this.results=this.cloneData(this.results):this.results=[],this.view)this.width=this.view[0],this.height=this.view[1];else{let t=this.getContainerDims();t&&(this.width=t.width,this.height=t.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let t,i,a=this.chartElement.nativeElement;if(mi(this.platformId)&&a.parentNode!==null){let o=a.parentNode.getBoundingClientRect();t=o.width,i=o.height}return t&&i?{width:t,height:i}:null}formatDates(){for(let t=0;t<this.results.length;t++){let i=this.results[t];if(i.label=i.name,sm(i.label)&&(i.label=i.label.toLocaleDateString()),i.series)for(let a=0;a<i.series.length;a++){let o=i.series[a];o.label=o.name,sm(o.label)&&(o.label=o.label.toLocaleDateString())}}}unbindEvents(){this.resizeSubscription&&this.resizeSubscription.unsubscribe()}bindWindowResizeEvent(){if(!mi(this.platformId))return;let i=Ur(window,"resize").pipe(Ve(200)).subscribe(a=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=i}cloneData(t){let i=[];for(let a of t){let o={};if(a.name!==void 0&&(o.name=a.name),a.value!==void 0&&(o.value=a.value),a.series!==void 0){o.series=[];for(let r of a.series){let s=Object.assign({},r);o.series.push(s)}}a.extra!==void 0&&(o.extra=JSON.parse(JSON.stringify(a.extra))),a.source!==void 0&&(o.source=a.source),a.target!==void 0&&(o.target=a.target),i.push(o)}return i}}return e.\u0275fac=function(t){return new(t||e)(y(di),y(an),y(Oe),y(Mi))},e.\u0275cmp=O({type:e,selectors:[["base-chart"]],inputs:{results:"results",view:"view",scheme:"scheme",schemeType:"schemeType",customColors:"customColors",animations:"animations"},outputs:{select:"select"},standalone:!1,features:[ye],decls:1,vars:0,template:function(t,i){t&1&&w(0,"div")},encapsulation:2}),e})(),Xe=function(e){return e.Top="top",e.Bottom="bottom",e.Left="left",e.Right="right",e}(Xe||{}),_m=(()=>{class e{constructor(t){this.textHeight=25,this.margin=5,this.element=t.nativeElement}ngOnChanges(t){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case Xe.Top:this.y=this.offset,this.x=this.width/2;break;case Xe.Bottom:this.y=this.offset,this.x=this.width/2;break;case Xe.Left:this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case Xe.Right:this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)";break;default:}}}return e.\u0275fac=function(t){return new(t||e)(y(di))},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},standalone:!1,features:[ye],attrs:S_,decls:2,vars:6,template:function(t,i){t&1&&(K(),m(0,"text"),v(1),h()),t&2&&(pe("stroke-width",i.strokeWidth)("x",i.x)("y",i.y)("text-anchor",i.textAnchor)("transform",i.transform),l(
14),T(" ",i.label," "))},encapsulation:2,changeDetection:0}),e})();function xm(e,n=16){return typeof e!="string"?typeof e=="number"?e+"":"":(e=e.trim(),e.length<=n?e:`${e.slice(0,n)}...`)}function vm(e,n){if(e.length>n){let t=[],i=Math.floor(e.length/n);for(let a=0;a<e.length;a++)a%i===0&&t.push(e[a]);e=t}return e}function bm(e,n,t){let i=(e||"").toString(),a=[];if(/\s/.test(i))a=i.split(/\s+/).reduce((o,r)=>{let s=(o.pop()||"")+" ";return s.length+r.length>n?[...o,s.trim(),r.trim()]:[...o,s+r]},[]);else{let o=0;for(;o<i.length;)a.push(i.substring(o,o+n)),o+=n}return a.length>t&&(a=a.splice(0,t),a[a.length-1]+="..."),a}var Yt=function(e){return e.Start="start",e.Middle="middle",e.End="end",e}(Yt||{}),lm=(()=>{class e{constructor(t){this.platformId=t,this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.wrapTicks=!1,this.dimensionsChanged=new J,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor=Yt.Middle,this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0,this.approxHeight=10,this.maxPossibleLengthForTickIfWrapped=16}get isWrapTicksSupported(){return this.wrapTicks&&this.scale.step}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){if(!mi(this.platformId)){this.dimensionsChanged.emit({height:this.approxHeight});return}let t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);t!==this.height&&(this.height=t,this.dimensionsChanged.emit({height:this.height}),setTimeout(()=>this.updateDims()))}update(){let t=this.scale;this.ticks=this.getTicks(),this.tickFormatting?this.tickFormat=this.tickFormatting:t.tickFormat?this.tickFormat=t.tickFormat.apply(t,this.tickArguments):this.tickFormat=function(a){return a.constructor.name==="Date"?a.toLocaleDateString():a.toLocaleString()};let i=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.adjustedScale=this.scale.bandwidth?function(a){return this.scale(a)+this.scale.bandwidth()*.5}:this.scale,this.textTransform="",i&&i!==0?(this.textTransform=`rotate(${i})`,this.textAnchor=Yt.End,this.verticalSpacing=10):this.textAnchor=Yt.Middle,setTimeout(()=>this.updateDims())}getRotationAngle(t){let i=0;this.maxTicksLength=0;for(let g=0;g<t.length;g++){let _=this.tickFormat(t[g]).toString(),b=_.length;this.trimTicks&&(b=this.tickTrim(_).length),b>this.maxTicksLength&&(this.maxTicksLength=b)}let a=Math.min(this.maxTicksLength,this.maxAllowedLength),o=7,r=a*o,s=r,c=Math.floor(this.width/t.length);for(;s>c&&i>-90;)i-=30,s=Math.cos(i*(Math.PI/180))*r;let d=14;if(this.isWrapTicksSupported){let g=this.ticks.reduce((b,k)=>k.length>b.length?k:b,"");d=14*(this.tickChunks(g).length||1),this.maxPossibleLengthForTickIfWrapped=this.getMaxPossibleLengthForTick(g)}let u=i!==0?Math.max(Math.abs(Math.sin(i*Math.PI/180))*this.maxTickLength*o,10):d;return this.approxHeight=Math.min(u,200),i}getTicks(){let t,i=this.getMaxTicks(20),a=this.getMaxTicks(100);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[a]):(t=this.scale.domain(),t=vm(t,i)),t}getMaxTicks(t){return Math.floor(this.width/t)}tickTransform(t){return"translate("+this.adjustedScale(t)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(t){return this.trimTicks?xm(t,this.maxTickLength):t}getMaxPossibleLengthForTick(t){if(this.scale.bandwidth){let a=Math.floor(this.scale.bandwidth()/7),o=t.slice(0,a);return Math.max(o.length,this.maxTickLength)}return this.maxTickLength}tickChunks(t){if(t.toString().length>this.maxTickLength&&this.scale.bandwidth){let a=this.rotateTicks?Math.floor(this.scale.step()/14):5;if(a<=1)return[this.tickTrim(t)];let o=Math.max(this.maxPossibleLengthForTickIfWrapped,this.maxTickLength);return mi(this.platformId)||(o=Math.floor(Math.min(this.approxHeight/5,Math.max(this.maxPossibleLengthForTickIfWrapped,this.maxTickLength)))),a=Math.min(a,5),bm(t,o,a<1?1:a)}return[this.tickTrim(t)]}}return e.\u0275fac=function(t){return new(t||e)(y(Mi))},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(t,i){if(t&1&&ne(gm,5),t&2){let a;
14te(a=ie())&&(i.ticksElement=a.first)}},inputs:{scale:"scale",orient:"orient",tickArguments:"tickArguments",tickValues:"tickValues",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showGridLines:"showGridLines",gridLineHeight:"gridLineHeight",width:"width",rotateTicks:"rotateTicks",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ye],attrs:w_,decls:4,vars:2,consts:[["ticksel",""],["tmplMultilineTick",""],["tmplSinglelineTick",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"tick"],[4,"ngIf"],["stroke-width","0.01","font-size","12px"],[4,"ngIf","ngIfThen","ngIfElse"],["x","0",4,"ngFor","ngForOf"],["x","0"],["y2","0",1,"gridline-path","gridline-path-vertical"]],template:function(t,i){t&1&&(K(),m(0,"g",null,0),C(2,M_,2,2,"g",3),h(),C(3,I_,2,2,"g",4)),t&2&&(l(2),p("ngForOf",i.ticks),l(),p("ngForOf",i.ticks))},dependencies:[le,z],encapsulation:2,changeDetection:0}),e})(),Bx=(()=>{class e{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient=Xe.Bottom,this.xAxisOffset=0,this.wrapTicks=!1,this.dimensionsChanged=new J,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5,this.orientation=Xe}ngOnChanges(t){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,typeof this.xAxisTickCount<"u"&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:t}){let i=t+25+5;i!==this.labelOffset&&(this.labelOffset=i,setTimeout(()=>{this.dimensionsChanged.emit({height:t})},0))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(t,i){if(t&1&&ne(lm,5),t&2){let a;te(a=ie())&&(i.ticksComponent=a.first)}},inputs:{xScale:"xScale",dims:"dims",trimTicks:"trimTicks",rotateTicks:"rotateTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showGridLines:"showGridLines",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickCount:"xAxisTickCount",xOrient:"xOrient",xAxisOffset:"xAxisOffset",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ye],attrs:F_,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","wrapTicks","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"dimensionsChanged","trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","wrapTicks"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,i){t&1&&(K(),m(0,"g"),C(1,B_,1,13,"g",0)(2,V_,1,5,"g",1),h()),t&2&&(pe("class",i.xAxisClassName)("transform",i.transform),l(),p("ngIf",i.xScale),l(),p("ngIf",i.showLabel))},dependencies:[lm,_m,z],encapsulation:2,changeDetection:0}),e})();function si(e,n,t,i,a,[o,r,s,c]){let d="";return t=Math.floor(t),i=Math.floor(i),t=t===0?1:t,i=i===0?1:i,d=`M${[e+a,n]}`,d+=`h${t-2*a}`,r?d+=`a${[a,a]} 0 0 1 ${[a,a]}`:d+=`h${a}v${a}`,d+=`v${i-2*a}`,c?d+=`a${[a,a]} 0 0 1 ${[-a,a]}`:d+=`v${a}h${-a}`,d+=`h${2*a-t}`,s?d+=`a${[a,a]} 0 0 1 ${[-a,-a]}`:d+=`h${-a}v${-a}`,d+=`v${2*a-i}`,o?d+=`a${[a,a]} 0 0 1 ${[a,-a]}`:d+=`v${-a}h${a}`,d+="z",d}var cm=(()=>{class e{constructor(t){this.platformId=t,this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.wrapTicks=!1,this.dimensionsChanged=new J,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor=Yt.Middle,this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0,this.Orientation=Xe}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){if(!mi(this.platformId)){this.width=this.getApproximateAxisWidth(),this.dimensionsChanged.emit({width:this.width});return}let t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);t!==this.width&&(this.width=t,this.dimensionsChanged.emit({width:t}),setTimeout(()=>this.updateDims()))}update(){let t=this.scale,i=this.orient===Xe.Top||this.orient===Xe.Right?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,this.ticks=this.getTicks(),this.tickFormatting?this.tickFormat=this.tickFormatting:t.tickFormat?this.tickFormat=t.tickFormat.apply(t,this.tickArguments):this.tickFormat=function(a){return a.constructor.name==="Date"?a.toLocaleDateString():a.toLocaleStr
14ing()},this.adjustedScale=t.bandwidth?a=>{let o=t(a)+t.bandwidth()*.5;if(this.wrapTicks&&a.toString().length>this.maxTickLength){let r=this.tickChunks(a).length;if(r===1)return o;let s=t.bandwidth(),c=r*8,d=s*.5-c*.5;return t(a)+d}return o}:t,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case Xe.Top:this.transform=function(a){return"translate("+this.adjustedScale(a)+",0)"},this.textAnchor=Yt.Middle,this.y2=this.innerTickSize*i,this.y1=this.tickSpacing*i,this.dy=i<0?"0em":".71em";break;case Xe.Bottom:this.transform=function(a){return"translate("+this.adjustedScale(a)+",0)"},this.textAnchor=Yt.Middle,this.y2=this.innerTickSize*i,this.y1=this.tickSpacing*i,this.dy=i<0?"0em":".71em";break;case Xe.Left:this.transform=function(a){return"translate(0,"+this.adjustedScale(a)+")"},this.textAnchor=Yt.End,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dy=".32em";break;case Xe.Right:this.transform=function(a){return"translate(0,"+this.adjustedScale(a)+")"},this.textAnchor=Yt.Start,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dy=".32em";break;default:}setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(t=>t.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(t=>t.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=si(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let t,i=this.getMaxTicks(20),a=this.getMaxTicks(50);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[a]):(t=this.scale.domain(),t=vm(t,i)),t}getMaxTicks(t){return Math.floor(this.height/t)}tickTransform(t){return`translate(${this.adjustedScale(t)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(t){return this.trimTicks?xm(t,this.maxTickLength):t}getApproximateAxisWidth(){return Math.max(...this.ticks.map(a=>this.tickTrim(this.tickFormat(a)).length))*7}tickChunks(t){if(t.toString().length>this.maxTickLength&&this.scale.bandwidth){let i=this.maxTickLength,a=Math.floor(this.scale.bandwidth()/15);return a<=1?[this.tickTrim(t)]:bm(t,i,Math.min(a,5))}return[this.tickFormat(t)]}}return e.\u0275fac=function(t){return new(t||e)(y(Mi))},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(t,i){if(t&1&&ne(gm,5),t&2){let a;te(a=ie())&&(i.ticksElement=a.first)}},inputs:{scale:"scale",orient:"orient",tickArguments:"tickArguments",tickValues:"tickValues",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showGridLines:"showGridLines",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ye],attrs:R_,decls:6,vars:4,consts:[["ticksel",""],["tmplMultilineTick",""],["tmplSinglelineTick",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tick"],[4,"ngIf"],["stroke-width","0.01"],[4,"ngIf","ngIfThen","ngIfElse"],[4,"ngIf","ngIfElse"],["x","0",4,"ngFor","ngForOf"],["x","0"],[1,"reference-area"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(t,i){t&1&&(K(),m(0,"g",null,0),C(2,W_,2,2,"g",3),h(),C(3,X_,1,2,"path",4)(4,K_,2,2,"g",5)(5,ex,2,1,"g",5)),t&2&&(l(2),p("ngForOf",i.ticks),l(),p("ngIf",i.referenceLineLength>1&&i.refMax&&i.refMin&&i.showRefLines),l(),p("ngForOf",i.ticks),l(),p("ngForOf",i.referenceLines))},dependencies:[le,z],encapsulation:2,changeDetection:0}),e})(),Vx=(()=>{class e{constructor(){this.showGridLines=!1,this.yOrient=Xe.Left,this.yAxisOffset=0,this.wrapTicks=!1,this.dimensionsChanged=new J,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5}ngOnChanges(t){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),this.yOrient===Xe.Right?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):this.transform=`translate(${this.offset} , 0)`,this.yAxisTickCount!==void 0&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:t}){t!==this.labelOffset&&this.yOrient===Xe.Right?(this.labelOffset=t+this.labelOffset,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0)):t!==this.labelOffset&&(this.labelOffset=t,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(t,i){if(t&1&&ne(cm,5),t&2){let a;
14te(a=ie())&&(i.ticksComponent=a.first)}},inputs:{yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showGridLines:"showGridLines",showLabel:"showLabel",labelText:"labelText",yAxisTickCount:"yAxisTickCount",yOrient:"yOrient",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels",yAxisOffset:"yAxisOffset",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ye],attrs:tx,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","wrapTicks","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"dimensionsChanged","trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","wrapTicks"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,i){t&1&&(K(),m(0,"g"),C(1,ix,1,15,"g",0)(2,nx,1,5,"g",1),h()),t&2&&(pe("class",i.yAxisClassName)("transform",i.transform),l(),p("ngIf",i.yScale),l(),p("ngIf",i.showLabel))},dependencies:[cm,_m,z],encapsulation:2,changeDetection:0}),e})(),dm=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=on({type:e}),e.\u0275inj=nn({imports:[[rn]]}),e})(),Nr=function(e){return e.popover="popover",e.tooltip="tooltip",e}(Nr||{}),Ji=function(e){return e[e.all="all"]="all",e[e.focus="focus"]="focus",e[e.mouseover="mouseover"]="mouseover",e}(Ji||{}),Rx=(()=>{class e{constructor(t,i,a){this.tooltipService=t,this.viewContainerRef=i,this.renderer=a,this.tooltipCssClass="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=se.Top,this.tooltipAlignment=se.Center,this.tooltipType=Nr.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=Ji.all,this.tooltipImmediateExit=!1,this.show=new J,this.hide=new J}get listensForFocus(){return this.tooltipShowEvent===Ji.all||this.tooltipShowEvent===Ji.focus}get listensForHover(){return this.tooltipShowEvent===Ji.all||this.tooltipShowEvent===Ji.mouseover}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(t){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(t))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(t){if(this.component||this.tooltipDisabled)return;let i=t?0:this.tooltipShowTimeout+(navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?400:0);clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();let a=this.createBoundOptions();this.component=this.tooltipService.create(a),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},i)}addHideListeners(t){this.mouseEnterContentEvent=this.renderer.listen(t,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(t,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen("window","click",i=>{t.contains(i.target)||this.hideTooltip()}))}hideTooltip(t=!1){if(!this.component)return;let i=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),t?i():this.timeout=setTimeout(i,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}}return e.\u0275fac=function(t){return new(t||e)(y(Vr),y(es),y(Lo))},e.\u0275dir=Po({type:e,selectors:[["","ngx-tooltip",""]],hostBindings:function(t,i){t&1&&A("focusin",function(){return i.onFocus()})("blur",function(){return i.onBlur()})("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(o){return i.onMouseLeave(o.target)})("click",function(){return i.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipTitle:"tooltipTitle",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipTemplate:"tooltipTemplate",tooltipShowEvent:"tooltipShowEvent",tooltipContext:"tooltipContext",tooltipImmediateExit:"tooltipImmediateExit"},outputs:{show:"show",hide:"hide"},standalone:!1}),e})(),pm=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=on({type:e}),e.\u0275inj=nn({providers:[fm,Vr],imports:[[rn]]}),e})(),mm={};function ym(){let e=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return e=`a${e}`,mm[e]?ym():(mm[e]=!0,e)}var at=function(e){return e.Vertical="vertical",e.Horizontal="horizontal",e}(at||{}),Nx=(()=>{class e{constructor(){this.orientation=at.Vertical}ngOnChanges(t){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%",this.orientation===at.Horizontal?this.x2="100%":this.orientation===at.Vertical&&(this.y1="100%")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},standalone:!1,features:[ye],attrs:ax,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(t,i){t&1&&(K(),m(0,"linearGradient",0),C(1,ox,1,5,"stop",1),h()),t&2&&(p("id",i.name),pe("x1",i.x1)("y1",i.y1)("x2",i.x2)("y2",i.y2),l(),p("ngForOf",i.stops))},dependencies:[le],encapsulation:2,changeDetection:0}),e})();var Fr;typeof window<"u"?Fr=window:typeof global<"u"&&(Fr=global);var eI=Fr.MouseEvent;var Gx=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=on({type:e}),e.\u0275inj=nn({imports:[[rn,dm,pm],rn,dm,pm]}),e})();function zx({width:e,height:n,margins:t,showXAxis:i=!1,showYAxis:a=!1,xAxisHeight:o=0,yAxisWidth:r=0,showXLabel:s=!1,showYLabel:c=!1,showLegend:d=!1,legendT
14ype:u=ve.Ordinal,legendPosition:g=Di.Right,columns:_=12}){let b=t[3],k=e,M=n-t[0]-t[2];return d&&g===Di.Right&&(u===ve.Ordinal?_-=2:_-=1),k=k*_/12,k=k-t[1]-t[3],i&&(M-=5,M-=o,s&&(M-=30)),a&&(k-=5,k-=r,b+=r,b+=10,c&&(k-=30,b+=30)),k=Math.max(0,k),M=Math.max(0,M),{width:Math.floor(k),height:Math.floor(M),xOffset:Math.floor(b)}}var hm=[{name:"vivid",selectable:!0,group:ve.Ordinal,domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:ve.Ordinal,domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:ve.Ordinal,domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:ve.Ordinal,domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:ve.Linear,domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:ve.Linear,domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:ve.Linear,domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:ve.Ordinal,domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:ve.Ordinal,domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:ve.Ordinal,domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:ve.Ordinal,domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:ve.Ordinal,domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:ve.Ordinal,domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:ve.Ordinal,domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:ve.Ordinal,domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}],Br=class{constructor(n,t,i,a){typeof n=="string"&&(n=hm.find(o=>o.name===n)),this.colorDomain=n.domain,this.scaleType=t,this.domain=i,this.customColors=a,this.scale=this.generateColorScheme(n,t,this.domain)}generateColorScheme(n,t,i){typeof n=="string"&&(n=hm.find(o=>o.name===n));let a;switch(t){case ve.Quantile:a=Nn().range(n.domain).domain(i);break;case ve.Ordinal:a=Ai().range(n.domain).domain(i);break;case ve.Linear:{let o=[...n.domain];o.length===1&&(o.push(o[0]),this.colorDomain=o);let r=Qi(0,1,1/o.length);a=ri().range(o).domain(r)}break;default:break}return a}getColor(n){if(n==null)throw new Error("Value can not be null");if(this.scaleType===ve.Linear){let t=ri().domain(this.domain).range([0,1]);return this.scale(t(n))}else{if(typeof this.customColors=="function")return this.customColors(n);let t=n.toString(),i;return this.customColors&&this.customColors.length>0&&(i=this.customColors.find(a=>a.name.toLowerCase()===t.toLowerCase())),i?i.value:this.scale(n)}}getLinearGradientStops(n,t){t===void 0&&(t=this.domain[0]);let i=ri().domain(this.domain).range([0,1]),a=qi().domain(this.colorDomain).range([0,1]),o=this.getColor(n),r=i(t),s=this.getColor(t),c=i(n),d=1,u=r,g=[];for(g.push({color:s,offset:r,originalOffset:r,opacity:1});u<c&&d<this.colorDomain.length;){let _=this.colorDomain[d],b=a(_);if(b<=r){d++;continue}if(b.toFixed(4)>=(c-a.bandwidth()).toFixed(4))break;g.push({color:_,offset:b,opacity:1}),u=b,d++}if(g[g.length-1].offset<100&&g.push({color:o,offset:c,opacity:1}),c===r)g[0].offset=0,g[1].offset=100;else if(g[g.length-1].offset!==100)for(let _ of g)_.offset=(_.offset-r)/(c-r)*100;return g}};var Hx=(()=>{class e{constructor(t){this.roundEdges=!0,this.gradient=!1,this.offset=0,this.isActive=!1,this.animations=!0,this.noBarWhenZero=!0,this.select=new J,this.activate=new J,this.deactivate=new J,this.hasGradient=!1,this.hideBar=!1,this.element=t.nativeElement}ngOnChanges(t){t.roundEdges&&this.loadAnimation(),this.update()}update(){this.gradientId="grad"+ym().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl(),this.checkToHideBar()}loadAnimation(){this.path=this.getStartingPath(),setTimeout(this.update.bind(this),100)}updatePathEl(){let t=ar(this.element).select(".bar"),i=this.getPath();this.animations?t.transition().duration(500).attr("d",i):t.attr("d",i)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.getStartOpacity()},{offset:100,color:this.fill,opacity:1}]}getStartingPath(){if(!this.animations)return this.getPath();let t=this.getRadius(),i;return this.roundEdges?this.orientation===at.Vertical?(t=Math.min(this.height,t),i=si(this.x,this.y+this.height,this.width,1,0,this.edges)):this.orientation===at.Horizontal&&(t=Math.min(this.width,t),i=si(this.x,this.y,1,this.height,0,this.edges)):this.orientation===at.Vertical?i=si(this.x,this.y+this.height,this.width,1,0,this.edges):this.orientation===at.Horizontal&&(i=si(this.x,this.y,1,this.height,0,this.edges)),i}getPath(){let t=this.getRadius(),i;return this.roundEdges?this.orientation===at.Vertical?(t=Math.min(this.height,t),i=si(this.x,this.y,this.width,this.height,t,this.edges)):this.orientation===at.Horizontal&&(t=Math.min(this.width,t),i=si(this.x,this.y,this.width,this.height,t,this.edges)):i=si(this.x,this.y,this.width,this.height,t,this.edges),i}getRadius(){let t=0;return this.roundEdges&&this.height>5&&this.width>5&&(t=Math.floor(Math.min(5,this.height/2,this.width/2))),t}getStartOpacity(){return this.roundEdges?.2:.5}get edges(){let t=[!1,!1,!1,!1];return this.roundEdges&&(this.orientation===at.Vertical?this.data.value>
140?t=[!0,!0,!1,!1]:t=[!1,!1,!0,!0]:this.orientation===at.Horizontal&&(this.data.value>0?t=[!1,!0,!1,!0]:t=[!0,!1,!0,!1])),t}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}checkToHideBar(){this.hideBar=this.noBarWhenZero&&(this.orientation===at.Vertical&&this.height===0||this.orientation===at.Horizontal&&this.width===0)}}return e.\u0275fac=function(t){return new(t||e)(y(di))},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-bar",""]],hostBindings:function(t,i){t&1&&A("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(){return i.onMouseLeave()})},inputs:{fill:"fill",data:"data",width:"width",height:"height",x:"x",y:"y",orientation:"orientation",roundEdges:"roundEdges",gradient:"gradient",offset:"offset",isActive:"isActive",stops:"stops",animations:"animations",ariaLabel:"ariaLabel",noBarWhenZero:"noBarWhenZero"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},standalone:!1,features:[ye],attrs:cx,decls:2,vars:8,consts:[[4,"ngIf"],["stroke","none","role","img","tabIndex","-1",1,"bar",3,"click"],["ngx-charts-svg-linear-gradient","",3,"orientation","name","stops"]],template:function(t,i){t&1&&(C(0,dx,2,3,"defs",0),K(),m(1,"path",1),A("click",function(){return i.select.emit(i.data)}),h()),t&2&&(p("ngIf",i.hasGradient),l(),X("active",i.isActive)("hidden",i.hideBar),pe("d",i.path)("aria-label",i.ariaLabel)("fill",i.hasGradient?i.gradientFill:i.fill))},dependencies:[Nx,z],encapsulation:2,changeDetection:0}),e})(),jt=function(e){return e.Standard="standard",e.Normalized="normalized",e.Stacked="stacked",e}(jt||{}),en=function(e){return e.positive="positive",e.negative="negative",e}(en||{}),jx=(()=>{class e{constructor(t){this.dimensionsChanged=new J,this.horizontalPadding=2,this.verticalPadding=5,this.element=t.nativeElement}ngOnChanges(t){this.update()}getSize(){let t=this.element.getBoundingClientRect().height,i=this.element.getBoundingClientRect().width;return{height:t,width:i,negative:this.value<0}}ngAfterViewInit(){this.dimensionsChanged.emit(this.getSize())}update(){this.valueFormatting?this.formatedValue=this.valueFormatting(this.value):this.formatedValue=Rr(this.value),this.orientation==="horizontal"?(this.x=this.barX+this.barWidth,this.value<0?(this.x=this.x-this.horizontalPadding,this.textAnchor="end"):(this.x=this.x+this.horizontalPadding,this.textAnchor="start"),this.y=this.barY+this.barHeight/2):(this.x=this.barX+this.barWidth/2,this.y=this.barY+this.barHeight,this.value<0?(this.y=this.y+this.verticalPadding,this.textAnchor="end"):(this.y=this.y-this.verticalPadding,this.textAnchor="start"),this.transform=`rotate(-45, ${this.x} , ${this.y})`)}}return e.\u0275fac=function(t){return new(t||e)(y(di))},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-bar-label",""]],inputs:{value:"value",valueFormatting:"valueFormatting",barX:"barX",barY:"barY",barWidth:"barWidth",barHeight:"barHeight",orientation:"orientation"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ye],attrs:px,decls:2,vars:5,consts:[["alignment-baseline","middle",1,"textDataLabel"]],template:function(t,i){t&1&&(K(),m(0,"text",0),v(1),h()),t&2&&(pe("text-anchor",i.textAnchor)("transform",i.transform)("x",i.x)("y",i.y),l(),T(" ",i.formatedValue," "))},styles:[".textDataLabel[_ngcontent-%COMP%]{font-size:11px}"],changeDetection:0}),e})();var Yx=(()=>{class e{constructor(t){this.platformId=t,this.type=jt.Standard,this.tooltipDisabled=!1,this.animations=!0,this.showDataLabel=!1,this.noBarWhenZero=!0,this.select=new J,this.activate=new J,this.deactivate=new J,this.dataLabelHeightChanged=new J,this.barsForDataLabels=[],this.barOrientation=at,this.isSSR=!1}ngOnInit(){Qn(this.platformId)&&(this.isSSR=!0)}ngOnChanges(t){this.update()}update(){this.updateTooltipSettings();let t;this.series.length&&(t=this.xScale.bandwidth()),t=Math.round(t);let i=Math.max(this.yScale.domain()[0],0),a={[en.positive]:0,[en.negative]:0},o=en.positive,r;this.type===jt.Normalized&&(r=this.series.map(s=>s.value).reduce((s,c)=>s+c,0)),this.bars=this.series.map((s,c)=>{let d=s.value,u=this.getLabel(s),g=Rr(u),_=this.roundEdges;o=d>0?en.positive:en.negative;let b={value:d,label:u,roundEdges:_,data:s,width:t,formattedLabel:g,height:0,x:0,y:0};
14if(this.type===jt.Standard)b.height=Math.abs(this.yScale(d)-this.yScale(i)),b.x=this.xScale(u),d<0?b.y=this.yScale(0):b.y=this.yScale(d);else if(this.type===jt.Stacked){let M=a[o],H=M+d;a[o]+=d,b.height=this.yScale(M)-this.yScale(H),b.x=0,b.y=this.yScale(H),b.offset0=M,b.offset1=H}else if(this.type===jt.Normalized){let M=a[o],H=M+d;a[o]+=d,r>0?(M=M*100/r,H=H*100/r):(M=0,H=0),b.height=this.yScale(M)-this.yScale(H),b.x=0,b.y=this.yScale(H),b.offset0=M,b.offset1=H,d=(H-M).toFixed(2)+"%"}this.colors.scaleType===ve.Ordinal?b.color=this.colors.getColor(u):this.type===jt.Standard?(b.color=this.colors.getColor(d),b.gradientStops=this.colors.getLinearGradientStops(d)):(b.color=this.colors.getColor(b.offset1),b.gradientStops=this.colors.getLinearGradientStops(b.offset1,b.offset0));let k=g;return b.ariaLabel=g+" "+d.toLocaleString(),this.seriesName!==null&&this.seriesName!==void 0&&(k=`${this.seriesName} \u2022 ${g}`,b.data.series=this.seriesName,b.ariaLabel=this.seriesName+" "+b.ariaLabel),b.tooltipText=this.tooltipDisabled?void 0:` 15 <span class="tooltip-label">${Px(k)}</span> 16 <span class="tooltip-val">${this.dataLabelFormatting?this.dataLabelFormatting(d):d.toLocaleString()}</span> 17 `,b}),this.updateDataLabels()}updateDataLabels(){if(this.type===jt.Stacked){this.barsForDataLabels=[];let t={};t.series=this.seriesName;let i=this.series.map(o=>o.value).reduce((o,r)=>r>0?o+r:o,0),a=this.series.map(o=>o.value).reduce((o,r)=>r<0?o+r:o,0);t.total=i+a,t.x=0,t.y=0,t.total>0?t.height=this.yScale(i):t.height=this.yScale(a),t.width=this.xScale.bandwidth(),this.barsForDataLabels.push(t)}else this.barsForDataLabels=this.series.map(t=>{let i={};return i.series=this.seriesName??t.label,i.total=t.value,i.x=this.xScale(t.label),i.y=this.yScale(0),i.height=this.yScale(i.total)-this.yScale(0),i.width=this.xScale.bandwidth(),i})}updateTooltipSettings(){this.tooltipPlacement=this.tooltipDisabled?void 0:se.Top,this.tooltipType=this.tooltipDisabled?void 0:Nr.tooltip}isActive(t){return this.activeEntries?this.activeEntries.find(a=>t.name===a.name&&t.value===a.value)!==void 0:!1}onClick(t){this.select.emit(t)}getLabel(t){return t.label?t.label:t.name}trackBy(t,i){return i.label}trackDataLabelBy(t,i){return t+"#"+i.series+"#"+i.total}}return e.\u0275fac=function(t){return new(t||e)(y(Mi))},e.\u0275cmp=O({type:e,selectors:[["g","ngx-charts-series-vertical",""]],inputs:{dims:"dims",type:"type",series:"series",xScale:"xScale",yScale:"yScale",colors:"colors",gradient:"gradient",activeEntries:"activeEntries",seriesName:"seriesName",tooltipDisabled:"tooltipDisabled",tooltipTemplate:"tooltipTemplate",roundEdges:"roundEdges",animations:"animations",showDataLabel:"showDataLabel",dataLabelFormatting:"dataLabelFormatting",noBarWhenZero:"noBarWhenZero"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",dataLabelHeightChanged:"dataLabelHeightChanged"},standalone:!1,features:[ye],attrs:mx,decls:3,vars:3,consts:[[4,"ngIf"],["ngx-charts-bar","","ngx-tooltip","",3,"width","height","x","y","fill","stops","data","orientation","roundEdges","gradient","ariaLabel","isActive","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","noBarWhenZero","animations","select","activate","deactivate",4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-bar","","ngx-tooltip","",3,"select","activate","deactivate","width","height","x","y","fill","stops","data","orientation","roundEdges","gradient","ariaLabel","isActive","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","noBarWhenZero","animations"],["ngx-charts-bar-label","",3,"barX","barY","barWidth","barHeight","value","valueFormatting","orientation","dimensionsChanged",4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-bar-label","",3,"dimensionsChanged","barX","barY","barWidth","barHeight","value","valueFormatting","orientation"]],template:function(t,i){t&1&&C(0,ux,2,2,"g",0)(1,fx,2,2,"g",0)(2,xx,2,2,"g",0),t&2&&(p("ngIf",!i.isSSR),l(),p("ngIf",i.isSSR),l(),p("ngIf",i.showDataLabel))},dependencies:[Hx,jx,z,le,Rx],encapsulation:2,data:{animation:[Ro("animationState",[Go(":leave",[mn({opacity:1}),No(500,mn({opacity:0}
17))])])]},changeDetection:0}),e})();var Cm=(()=>{class e extends Fx{constructor(){super(...arguments),this.legend=!1,this.legendTitle="Legend",this.legendPosition=Di.Right,this.tooltipDisabled=!1,this.showGridLines=!0,this.activeEntries=[],this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.barPadding=8,this.roundDomains=!1,this.showDataLabel=!1,this.noBarWhenZero=!0,this.wrapTicks=!1,this.activate=new J,this.deactivate=new J,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.dataLabelMaxHeight={negative:0,positive:0},this.isSSR=!1,this.barChartType=jt,this.trackBy=(t,i)=>i.name}ngOnInit(){Qn(this.platformId)&&(this.isSSR=!0)}update(){super.update(),this.showDataLabel||(this.dataLabelMaxHeight={negative:0,positive:0}),this.margin=[10+this.dataLabelMaxHeight.positive,20,10+this.dataLabelMaxHeight.negative,20],this.dims=zx({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.showDataLabel&&(this.dims.height-=this.dataLabelMaxHeight.negative),this.formatDates(),this.groupDomain=this.getGroupDomain(),this.innerDomain=this.getInnerDomain(),this.valueDomain=this.getValueDomain(),this.xScale=this.getXScale(),this.yScale=this.getYScale(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]+this.dataLabelMaxHeight.negative})`}getGroupDomain(){let t=[];for(let i of this.results)t.includes(i.label)||t.push(i.label);return t}getInnerDomain(){let t=[];for(let i of this.results)for(let a of i.series)t.includes(a.label)||t.push(a.label);return t}getValueDomain(){let t=[],i=0,a=0;for(let s of this.results){let c=0,d=0;for(let u of s.series)u.value<0?c+=u.value:d+=u.value,i=u.value<i?u.value:i,a=u.value>a?u.value:a;t.push(c),t.push(d)}t.push(i),t.push(a);let o=Math.min(0,...t),r=this.yScaleMax?Math.max(this.yScaleMax,...t):Math.max(...t);return[o,r]}getXScale(){let t=this.groupDomain.length/(this.dims.width/this.barPadding+1);return qi().rangeRound([0,this.dims.width]).paddingInner(t).domain(this.groupDomain)}getYScale(){let t=ri().range([this.dims.height,0]).domain(this.valueDomain);return this.roundDomains?t.nice():t}onDataLabelMaxHeightChanged(t,i){t.size.negative?this.dataLabelMaxHeight.negative=Math.max(this.dataLabelMaxHeight.negative,t.size.height):this.dataLabelMaxHeight.positive=Math.max(this.dataLabelMaxHeight.positive,t.size.height),i===this.results.length-1&&setTimeout(()=>this.update())}groupTransform(t){return`translate(${this.xScale(t.name)||0}, 0)`}onClick(t,i){i&&(t.series=i.name),this.select.emit(t)}setColors(){let t;this.schemeType===ve.Ordinal?t=this.innerDomain:t=this.valueDomain,this.colors=new Br(this.scheme,this.schemeType,t,this.customColors)}getLegendOptions(){let t={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return t.scaleType===ve.Ordinal?(t.domain=this.innerDomain,t.colors=this.colors,t.title=this.legendTitle):(t.domain=this.valueDomain,t.colors=this.colors.scale),t}updateYAxisWidth({width:t}){this.yAxisWidth=t,this.update()}updateXAxisHeight({height:t}){this.xAxisHeight=t,this.update()}onActivate(t,i,a=!1){let o=Object.assign({},t);i&&(o.series=i.name);let r=this.results.map(s=>s.series).flat().filter(s=>a?s.label===o.name:s.name===o.name&&s.series===o.series);this.activeEntries=[...r],this.activate.emit({value:o,entries:this.activeEntries})}onDeactivate(t,i,a=!1){let o=Object.assign({},t);i&&(o.series=i.name),this.activeEntries=this.activeEntries.filter(r=>a?r.label!==o.name:!(r.name===o.name&&r.series===o.series)),this.deactivate.emit({value:o,entries:this.activeEntries})}}return e.\u0275fac=(()=>{let n;return function(i){return(n||(n=qr(e)))(i||e)}})(),e.\u0275cmp=O({type:e,selectors:[["ngx-charts-bar-vertical-stacked"]],contentQueries:function(t,i,a){if(t&1&&rs(a,rx,5),t&2){let o;
17te(o=ie())&&(i.tooltipTemplate=o.first)}},inputs:{legend:"legend",legendTitle:"legendTitle",legendPosition:"legendPosition",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",tooltipDisabled:"tooltipDisabled",gradient:"gradient",showGridLines:"showGridLines",activeEntries:"activeEntries",schemeType:"schemeType",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",barPadding:"barPadding",roundDomains:"roundDomains",yScaleMax:"yScaleMax",showDataLabel:"showDataLabel",dataLabelFormatting:"dataLabelFormatting",noBarWhenZero:"noBarWhenZero",wrapTicks:"wrapTicks"},outputs:{activate:"activate",deactivate:"deactivate"},standalone:!1,features:[is],decls:6,vars:13,consts:[[3,"legendLabelActivate","legendLabelDeactivate","legendLabelClick","view","showLegend","legendOptions","activeEntries","animations"],[1,"bar-chart","chart"],["ngx-charts-x-axis","",3,"xScale","dims","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","xAxisOffset","wrapTicks","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","wrapTicks","dimensionsChanged",4,"ngIf"],[4,"ngIf"],["ngx-charts-x-axis","",3,"dimensionsChanged","xScale","dims","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","xAxisOffset","wrapTicks"],["ngx-charts-y-axis","",3,"dimensionsChanged","yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","wrapTicks"],[4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-series-vertical","",3,"select","activate","deactivate","dataLabelHeightChanged","type","xScale","yScale","activeEntries","colors","series","dims","gradient","tooltipDisabled","tooltipTemplate","showDataLabel","dataLabelFormatting","seriesName","animations","noBarWhenZero"]],template:function(t,i){t&1&&(m(0,"ngx-charts-chart",0),A("legendLabelActivate",function(o){return i.onActivate(o,void 0,!0)})("legendLabelDeactivate",function(o){return i.onDeactivate(o,void 0,!0)})("legendLabelClick",function(o){return i.onClick(o)}),K(),m(1,"g",1),C(2,vx,1,11,"g",2)(3,bx,1,10,"g",3)(4,Cx,2,2,"g",4),h(),C(5,Sx,2,2,"g",4),h()),t&2&&(p("view",bt(10,sx,i.width,i.height))("showLegend",i.legend)("legendOptions",i.legendOptions)("activeEntries",i.activeEntries)("animations",i.animations),l(),pe("transform",i.transform),l(),p("ngIf",i.xAxis),l(),p("ngIf",i.yAxis),l(),p("ngIf",!i.isSSR),l(),p("ngIf",i.isSSR))},dependencies:[Ox,Bx,Vx,Yx,z,le],styles:[lx],encapsulation:2,data:{animation:[Ro("animationState",[Go(":leave",[mn({opacity:1,transform:"*"}),No(500,mn({opacity:0,transform:"scale(0)"}))])])]},changeDetection:0}),e})(),Tm=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=on({type:e}),e.\u0275inj=nn({imports:[[Gx]]}),e})(),tI=(0,um.default)();var iI=2*Math.PI;var Wx=["barStackChartContainer"],Xx=e=>({total:e});function Ux(e,n){if(e&1&&(m(0,"vedius-text",7),v(1),x(2,"vediusCurrency"),x(3,"translate"),h()),e&2){let t=f().model,i=f(2);l(),T(" ",F(3,3,"TOTAL",V(6,Xx,S(2,1,i.totalOfSeries(t.series))))," ")}}function Qx(e,n){if(e&1&&(m(0,"vedius-text",16),v(1),h()),e&2){let t=f(2).$implicit;l(),T(" ",t.suffixInfo," ")}}function qx(e,n){if(e&1&&(m(0,"div",12),w(1,"span",13),m(2,"vedius-text",14),v(3),x(4,"vediusCurrency"),h(),C(5,Qx,2,1,"vedius-text",15),h()),e&2){let t=f().$implicit,i=f(3);l(),Fe("background",t==null?null:t.color),l(2),T(" ",i.isAmount?S(4,4,t.value):t==null?null:t.value," "),l(2),p("ngIf",t==null?null:t.suffixInfo)}}function Kx(e,n){if(e&1&&(m(0,"vedius-text",22),v(1),h()),e&2){let t=f(3).$implicit;l(),T(" ",t.info==null?null:t.info.value," ")}}function Zx(e,n){if(e&1&&(m(0,"div",19),w(1,"span",13),C(2,Kx,2,1,"vedius-text",20),m(3,"vedius-text",21),v(4),h()()),e&2){let t=f(2).$implicit;l(),Fe("background",t.info==null?null:t.info.color),l(),p("ngIf",t.info==null?null:t.info.value),l(2),T(" ",t.info==null?null:t.info.label," ")}}function Jx(e,n){if(e&1&&(m(0,"div",19)(1,"vedius-text",14),v(2),h(),m(3,"vedius-text",21),v(4),h()()),e&2){let t=f(2).$implicit;l(2),T(" ",t==null?null:t.value,"% "),l(2),W(t==null?null:t.name)}}function ev(e,n){if(e&1&&(m(0,"div",17),C(1,Zx,5,4,"div",18)(2,Jx,5,2,"div",18),h()),e&2){let t=f().$implicit;l(),p("ngIf",t==null?null:t.info),l(),p("ngIf",t==null?null:t.value)}}function tv(e,n){if(e&1&&(P(0),C(1,qx,6,6,"div",10)(2,ev,3,2,"div",11),E()),e&2){let t=n.$implicit,i=f(3);
17l(),p("ngIf",!!t.value&&!i.isPercentage),l(),p("ngIf",!!t.value&&i.isPercentage)}}function iv(e,n){if(e&1&&(m(0,"div",5)(1,"div",6)(2,"vedius-text",7),v(3),h(),C(4,Ux,4,8,"vedius-text",8)(5,tv,3,2,"ng-container",9),h()()),e&2){let t=n.model,i=f(2);l(3),T(" ",i.getSerieTitleByKey(t.series)," "),l(),p("ngIf",i.isAmount),l(),p("ngForOf",i.getSeriesByKey(t.series))}}function nv(e,n){if(e&1&&(m(0,"ngx-charts-bar-vertical-stacked",4),C(1,iv,6,3,"ng-template",null,1,me),h()),e&2){let t=f();p("view",t.chartView)("scheme",t.colorScheme)("results",t.results)("gradient",t.gradient)("xAxis",t.showXAxis)("yAxis",t.showYAxis)("legend",t.showLegend)("showXAxisLabel",t.showXAxisLabel)("showYAxisLabel",t.showYAxisLabel)("showGridLines",!0)("barPadding",t.barPadding)("legend",!1)("animations",t.animations)("yAxisTickFormatting",t.yAxisTickFormatting)}}var bo=(()=>{let n=class n{constructor(i){this.cdr=i,this.barStackChartData=[],this.typeView="default",this.barPadding=24,this.animations=!0,this.results=[],this.heightChart=270,this.showXAxis=!0,this.showYAxis=!0,this.gradient=!1,this.showLegend=!0,this.showXAxisLabel=!1,this.showYAxisLabel=!1,this.isResize=!1,this.isMobile=!1,this.chartView=[0,270],this.isChartReady=!1,this.colorScheme={name:"myScheme",selectable:!0,group:ve.Ordinal,domain:[]},this.yAxisTickFormatting=a=>{if(this.isAmount){if(a<1e3)return a.toString();{let o=["","k","M","B","T"],r=Math.floor((""+a).length/3),s=parseFloat((r!==0?a/Math.pow(1e3,r):a).toPrecision(2));return s%1!==0&&(s=Number(s.toFixed(1))),s+o[r]}}else if(this.isPercentage)return`${a}%`;return a}}get isAmount(){return this.typeView==="amount"&&this.isNumber}get isPercentage(){return this.typeView==="percentage"&&this.isNumber}ngAfterViewInit(){setTimeout(()=>{this.updateChartView(),this.cdr.detectChanges()})}ngOnChanges(i){i.barStackChartData?.currentValue&&setTimeout(()=>{this.convertDataToChart(),this.isChartReady&&this.updateChartView(),this.cdr.detectChanges()}),i.barStackChartOptions?.currentValue&&setTimeout(()=>{this.setOptions(),this.cdr.detectChanges()})}ngOnInit(){this.isMobile=Ut(),setTimeout(()=>{this.convertDataToChart(),this.cdr.detectChanges()})}resizeChart(){this.isMobile||(this.isResize=!0,setTimeout(()=>{this.isResize=!1,setTimeout(()=>{this.updateChartView(),this.convertDataToChart(),this.cdr.detectChanges()})}))}updateChartView(){if(this.divContainer?.nativeElement){let i=this.divContainer.nativeElement.offsetWidth;i>0?(this.chartView=[i,this.heightChart],this.isChartReady=!0):(this.chartView=[400,this.heightChart],this.isChartReady=!0)}else this.chartView=[400,this.heightChart],this.isChartReady=!0}setOptions(){this.colorScheme.domain=this.barStackChartOptions?.colors||[]}convertDataToChart(){this.isNumber=this.barStackChartData?.map(i=>i.series).flat().every(i=>!isNaN(i.value)),this.results=this.barStackChartData?.map(i=>({name:i.name,series:i.series}))}getSerieTitleByKey(i){return this.barStackChartData.find(a=>a.name===i)?.tooltip?.title||""}getSeriesByKey(i){let a=this.barStackChartData.find(o=>o.name===i)?.series||[];return this.isAmount?a.sort((o,r)=>(r.value||0)-(o.value||0)):a}totalOfSeries(i){let a=this.barStackChartData.find(o=>o.name===i)?.series||[];return this.isAmount?a.reduce((r,s)=>r+s.value,0).toFixed(2):0}};n.\u0275fac=function(a){return new(a||n)(y(Oe))},n.\u0275cmp=O({type:n,selectors:[["vedius-bar-stack-chart"]],viewQuery:function(a,o){if(a&1&&ne(Wx,5),a&2){let r;te(r=ie())&&(o.divContainer=r.first)}},inputs:{barStackChartData:"barStackChartData",barStackChartOptions:"barStackChartOptions",typeView:"typeView",barPadding:"barPadding",animations:"animations"},features:[ye],decls:3,vars:1,consts:[["barStackChartContainer",""],["tooltipTemplate",""],[1,"bar-stack-chart-container",3,"resize"],["style","fill: #56677b; font-family: 'DM Sans'; font-size: 10px",3,"view","scheme","results","gradient","xAxis","yAxis","legend","showXAxisLabel","showYAxisLabel","showGridLines","barPadding","animations","yAxisTickFormatting",4,"ngIf"],[2,"fill","#56677b","font-family","'DM Sans'","font-size","10px",3,"view","scheme","results","gradient","xAxis","yAxis","legend","showXAxisLabel","showYAxisLabel","showGridLines","barPadding","animations","yAxisTickFormatting"],[1,"bar-stack-tooltip"],[1,"tooltip-content"],["variant","text","size","micro","weight","bold",1,"neutral-darker-color"],["class","neutral-darker-color","variant","text","size","micro","weight","bold",4,"ngIf"],[4,"ngFor","ngForOf"],["class","serie
17-item-content",4,"ngIf"],["class","percentage-serie-item-content",4,"ngIf"],[1,"serie-item-content"],[1,"serie-color"],["variant","text","size","micro","weight","bold"],["variant","text","size","micro",4,"ngIf"],["variant","text","size","micro"],[1,"percentage-serie-item-content"],["class","serie-info",4,"ngIf"],[1,"serie-info"],["variant","text","weight","bold","size","micro",4,"ngIf"],["variant","text","size","micro",1,"neutral-darker-color"],["variant","text","weight","bold","size","micro"]],template:function(a,o){if(a&1){let r=I();m(0,"div",2,0),A("resize",function(){return D(r),L(o.resizeChart())},!1,Wn),C(2,nv,3,14,"ngx-charts-bar-vertical-stacked",3),h()}a&2&&(l(2),p("ngIf",!o.isResize&&o.isChartReady))},dependencies:[z,Tm,Cm,j,le,Hi,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.bar-stack-chart-container{width:100%;min-height:250px}.bar-stack-chart-container .ngx-charts .gridline-path{stroke:#ebeff4!important}.bar-stack-chart-container .ngx-charts .bar.active,.bar-stack-chart-container .ngx-charts .bar:hover{opacity:1!important}.bar-stack-tooltip{color:#192840}.bar-stack-tooltip .neutral-darker-color{color:#425168}.bar-stack-tooltip .tooltip-content{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.bar-stack-tooltip .tooltip-content .serie-item-content{display:flex;gap:8px;align-items:center}.bar-stack-tooltip .tooltip-content .serie-item-content .serie-color{width:8px;height:8px}.bar-stack-tooltip .tooltip-content .percentage-serie-item-content{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.bar-stack-tooltip .tooltip-content .percentage-serie-item-content .serie-info{display:flex;gap:8px;align-items:center}.bar-stack-tooltip .tooltip-content .percentage-serie-item-content .serie-info .serie-color{width:8px;height:8px}ngx-tooltip-content.ngx-charts-tooltip-content.type-tooltip{padding:12px;border-radius:8px;background:#fff;box-shadow:0 4px 24px -4px #00000014}ngx-tooltip-content.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-top:#ffffff} 18`],encapsulation:2});let e=n;return e})();var yo=(()=>{let n=class n{constructor(){}calculateScheduledPeriodTimeByCollaborator(i,a,o,r){let s=o.getTotalAvailableMinutesPerDayOfWeek(),c=i.getAllDates(),d=0,u=0;for(let g=0;g<c.length;g++){let _=c[g],b=Ft(_);
18if(s[b]>0){let M=this.calculateScheduledDayTimeByCollaborator(_,a,o,s,r);d+=M.result,u=u+1}}return d/u}calculateWeeklyAverageOccupancyRate(i,a,o,r){let s=i.getAllDates(),c=Kn(s),d=0,u=0;for(let g of c){let _=0,b=0;for(let k of g){let M=Ft(k);if(o.getTotalAvailableMinutesPerDayOfWeek()[M]>0){let ce=this.calculateScheduledDayTimeByCollaborator(k,a,o,o.getTotalAvailableMinutesPerDayOfWeek(),r);_+=ce.result,b++}}if(b>0){let k=_/b;d+=k,u++}}return u>0?d/u:0}calculateScheduledDayTimeByCollaborator(i,a,o,r,s){let c=Ft(i),d=r?r[c]:0;return d===0?{totalOfSchedules:0,result:0}:{result:this.calculateCollaboratorScheduledMinutesByDay(i,o,r,a,s).result/d*100,totalOfSchedules:s.length}}calculateCollaboratorScheduledMinutesByDay(i,a,o,r,s){let c=0,d=Ft(i),u=o[d],g=a.weeklyAppointmentTimes.weeklyAppointmentTimes[d],_=[];if(u>0){_=s.filter(k=>k.professional.key.value===r.key.value&&Xt(k.start,i)&&g.some(M=>M.containsTimeRange(k.timeRange)));let b=this.calculateTotalOfMinutesScheduledByDay(_);c+=b}return{result:c,totalOfSchedules:_.length}}calculateTotalOfMinutesScheduledByDay(i){if(i.length===0)return 0;let a=i.sort((s,c)=>s.start.getTime()-c.start.getTime()),o=[];for(let s of a){let c=s.start.getTime(),d=s.end.getTime();o.length===0||c>o[o.length-1].end?o.push({start:c,end:d}):o[o.length-1].end=Math.max(o[o.length-1].end,d)}let r=0;for(let s of o)r+=(s.end-s.start)/(1e3*60);return r}getWeeksInMonth(i){let a=i.getMonth(),o=i.getFullYear();switch(new Date(o,a+1,0).getDate()){case 31:return 4.43;case 30:return 4.29;case 29:return 4.14;case 28:return 4;default:return 0}}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var Gr=(()=>{let n=class n{get barPadding(){return this.dashboardPeriodSelectorType===ke.DAILY?this.isSmall?4:8:this.isSmall?8:24}constructor(i,a,o,r){this.translate=i,this.localeContext=a,this.scheduleEventCalculationService=o,this.cdr=r,this.isSmall=!1,this.schedules=[],this.collaboratorsSelected=[],this.calendarSettings=[],this.chartDefaultColor="#0D7180",this.barStackChartData=[],this.barStackChartOptions={colors:[this.chartDefaultColor]},this.allMonthsLabels=[],this.dayMonthYearDatePipe=new Wl(this.localeContext),this.monthYearDatePipe=new Jc(this.localeContext)}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}ngOnInit(){this.translate.loaded().then(()=>{this.allMonthsLabels=Aa.map(i=>this.translate.get(`MONTHS.${i}`))}),setTimeout(()=>{this.load(),this.cdr.detectChanges()},50)}load(){this.schedules.length&&this.collaboratorsSelected.length&&this.dashboardPeriodSelectorType&&this.calendarSettings.length&&this.period?this.populateData():this.barStackChartData=[]}onLoad(i,a,o,r,s){this.schedules=i,this.collaboratorsSelected=a,this.dashboardPeriodSelectorType=o,this.period=s,this.calendarSettings=r,setTimeout(()=>{this.barStackChartData=[],this.populateData(),this.cdr.detectChanges()})}populateData(){setTimeout(()=>{this.populateChart(),this.cdr.detectChanges()})}populateChart(){this.dashboardPeriodSelectorType===ke.DAILY&&this.loadDailyChartData(),this.dashboardPeriodSelectorType===ke.WEEKLY&&this.loadWeeklyChartData(),this.dashboardPeriodSelectorType===ke.MONTHLY&&this.loadYearChartData()}loadDailyChartData(){let i=[];
18this.period?.getAllDates().forEach(a=>{let o=this.schedules.filter(d=>Xt(d.start,a)),r=0,s=0;this.collaboratorsSelected.forEach(d=>{let u=this.calendarSettings.find(k=>k.userVedius.key.value===d.key.value),g=u?.getTotalAvailableMinutesPerDayOfWeek();if(!g)return;let _=Ft(a);if((g?g[_]:0)>0){let k=this.scheduleEventCalculationService.calculateScheduledDayTimeByCollaborator(a,d,u,g,o);r+=k.result,s+=k.totalOfSchedules}});let c=r>0?Be(r/this.collaboratorsSelected.length,2):0;i.push({name:`${a.getDate()}`,series:[{name:this.getBusyTimeLabel(),value:c,info:{color:this.chartDefaultColor,label:this.getScheduleChartLabel(s),value:s}}],tooltip:{title:`${this.dayMonthYearDatePipe.transform(a)}`}})}),setTimeout(()=>{this.barStackChartData=i,this.cdr.detectChanges()})}loadWeeklyChartData(){let i=[];Kn(this.period?.getAllDates()||[]).forEach((o,r)=>{let s=r+1,c=0,d=0,u=0;o.forEach(_=>{let b=!1,k=this.schedules.filter(M=>Xt(M.start,_));this.collaboratorsSelected.forEach(M=>{let H=this.calendarSettings.find(ue=>ue.userVedius.key.value===M.key.value),
18ce=H?.getTotalAvailableMinutesPerDayOfWeek();if(!ce)return;let Ae=Ft(_);if((ce?ce[Ae]:0)>0){let ue=this.scheduleEventCalculationService.calculateScheduledDayTimeByCollaborator(_,M,H,ce,k);c+=ue.result,d+=ue.totalOfSchedules,b=!0}}),b&&(u+=1)});let g=c>0?Be(c/(this.collaboratorsSelected.length*(u||1)),2):0;i.push({name:`S${s}`,series:[{name:this.getBusyTimeLabel(),value:g,info:{color:this.chartDefaultColor,label:this.getScheduleChartLabel(d),value:d}}],tooltip:{title:`Semana ${s} - ${this.monthYearDatePipe.transform(o[0])}`}})}),setTimeout(()=>{this.barStackChartData=i,this.cdr.detectChanges()})}loadYearChartData(){let i=[];hs(this.period?.getAllDates()||[]).forEach((o,r)=>{let s=0,c=0,d=0;o.forEach(g=>{let _=!1,b=this.schedules.filter(k=>Xt(k.start,g));this.collaboratorsSelected.forEach(k=>{let M=this.calendarSettings.find(fe=>fe.userVedius.key.value===k.key.value),H=M?.getTotalAvailableMinutesPerDayOfWeek();if(!H)return;let ce=Ft(g);if((H?H[ce]:0)>0){let fe=this.scheduleEventCalculationService.calculateScheduledDayTimeByCollaborator(g,k,M,H,b);s+=fe.result,c+=fe.totalOfSchedules,_=!0}}),_&&(d+=1)});let u=s>0?Be(s/(this.collaboratorsSelected.length*d),2):0;i.push({name:this.getMonthName(r),series:[{name:this.getBusyTimeLabel(),value:u,info:{color:this.chartDefaultColor,label:this.getScheduleChartLabel(c),value:c}}],tooltip:{title:`${je(this.monthYearDatePipe.transform(o[0]))}`}})}),setTimeout(()=>{this.barStackChartData=i,this.cdr.detectChanges()})}getMonthName(i){return this.allMonthsLabels[i].slice(0,3).toLowerCase()}getScheduleChartLabel(i){return i>1?this.translate.get(U.DashboardAppointmentOccupancyPluralScheduleChartLabel):this.translate.get(U.DashboardAppointmentOccupancySingleScheduleChartLabel)}getBusyTimeLabel(){return this.translate.get(U.DashboardAppointmentOccupancyBusyTimeChartLabel)}translatePeriodYear(i){return this.translate.get(`${U.DashboardYearPeriodSelectorLabel}.${i}`)}};n.\u0275fac=function(a){return new(a||n)(y(ae),y(st),y(yo),y(Oe))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-appointment-occupancy-rate-bar-chart"]],inputs:{isSmall:"isSmall",schedules:"schedules",collaboratorsSelected:"collaboratorsSelected",dashboardPeriodSelectorType:"dashboardPeriodSelectorType",period:"period",calendarSettings:"calendarSettings"},decls:2,vars:4,consts:[[1,"dashboard-appointment-occupancy-rate-bar-chart"],["type","bar-stack","typeView","percentage",3,"barStackChartData","barStackChartOptions","barPadding","animations"]],template:function(a,o){a&1&&(m(0,"div",0),w(1,"vedius-bar-stack-chart",1),h()),a&2&&(l(),p("barStackChartData",o.barStackChartData)("barStackChartOptions",o.barStackChartOptions)("barPadding",o.barPadding)("animations",!0))},dependencies:[bo],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-appointment-occupancy-rate-bar-chart{display:flex;flex-direction:column;align-items:flex-start;gap:24px;align-self:stretch;width:100%;overflow-x:hidden}.dashboard-appointment-occupancy-rate-bar-chart .neutral-dusk-color{color:#192840}.dashboard-appointment-occupancy-rate-bar-chart .neutral-darker-color{color:#425168}.dashboard-appointment-occupancy-rate-bar-chart vedius-bar-stack-chart{display:block;width:100%}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack{display:flex;flex-direction:column;align-items:flex-start;width:100%}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-header{width:100%;display:flex;align-items:flex-start;align-self:stretch;padding:12px;border-bottom:1px solid #d3dae5;box-sizing:border-box}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-header .header-label{display:flex;justify-content:flex-start;align-items:center;flex:1 0 0}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-header .header-values{display:flex;justify-content:flex-end;align-items:center;gap:24px;min-width:50px}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content{display:flex;align-items:flex-start;align-self:stretch;padding:12px;border-bottom:1px solid #d3dae5}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content.last-item{border-bottom:none}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-label-content{display:flex;justify-content:center;align-items:center;gap:8px;flex:1 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-label-content .dot-legend{width:8px;height:8px;border-radius:100px}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-label-content .legend-label{flex:1 0 0;color:#425168;font-family:DM Sans;font-size:.875rem;font-style:normal;font-weight:500;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-values{display:flex;justify-content:flex-end;align-items:center;gap:24px}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-values .percentage-content{min-width:50px}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-values .percentage-content .percentage-label-content{display:flex;justify-content:flex-end;align-items:center;color:#425168}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-values .percentage-content .percentage-label-content.positive{color:#12b76a}.dashboard-appointment-occupancy-rate-bar-chart .legends-bar-stack .legend-item-content .legend-values .percentage-content .percentage-label-content.negative{color:#f03838}.dashboard-appointment-occupancy-rate-bar-chart .see-all-legends-button,.dashboard-appointment-occupancy-rate-bar-chart .dont-see-all-button{margin-top:20px;width:100%} 19`],encapsulation:2});let e=n;return e})();var wm=(()=>{let n=class n{constructor(){this.modal=null}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-appointment-occupancy-rate-info-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:13,vars:10,consts:[[1,"dashboard-appointment-occupancy-rate-info-modal"],[1,"title"],[1,"appointment-occupancy-rate-info-content"],["variant","text","size","md","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"bottom"],[3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"div",2)(6,"vedius-text",3),v(7),x(8,"translate"),h()(),m(9,"div",4)(10,"vedius-button",5),A("onClick",function(){return o.close()}),v(11),x(12,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,4,"DASHBOARD_PAGE.MODA
19L_INFO.APPOINTMENT_OCCUPANCY_RANGE.TITLE")," "),l(4),T(" ",S(8,6,"DASHBOARD_PAGE.MODAL_INFO.APPOINTMENT_OCCUPANCY_RANGE.DESCRIPTION"),""),l(3),p("fullSize",!0),l(),T(" ",S(12,8,"BUTTONS.UNDERSTOOD"),""))},dependencies:[q,j,re,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-appointment-occupancy-rate-info-modal{display:flex;flex-direction:column;gap:24px}.dashboard-appointment-occupancy-rate-info-modal .neutral-dusk-color{color:#192840}.dashboard-appointment-occupancy-rate-info-modal .neutral-darker-color{color:#425168}.dashboard-appointment-occupancy-rate-info-modal .loader{width:100%}.dashboard-appointment-occupancy-rate-info-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:0;max-width:400px}.dashboard-appointment-occupancy-rate-info-modal .bottom{width:100%;margin-top:16px}.dashboard-appointment-occupancy-rate-info-modal .bottom vedius-button{width:100%}@media screen and (max-width: 600px){.dashboard-appointment-occupancy-rate-info-modal .title{font-size:1.25rem;line-height:1.875rem;margin:12px 0 0;max-width:300px}} 20`],encapsulation:2});let e=n;return e})();var av=()=>({fractionDigits:1}),ov=()=>({height:"42px"}),rv=()=>({height:"200px"}),sv=()=>({height:"500px"});function lv(e,n){if(e&1){let t=I();m(0,"vedius-collaborator-selection-button",16),x(1,"translate"),x(2,"translate"),A("onFilterSelect",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))})("onLoad",function(a){D(t);let o=f();return L(o.onCollaboratorLoaded(a))}),h()}if(e&2){let t=f();X("hidden",!t.isOwner&&!t.isAnySecretaryRole),ee("defaultLabel",S(1,6,"DASHBOARD_PAGE.DEFAULT_PROFESSIONAL_LABEL")),ee("labelForFullSelection",S(2,8,"DASHBOARD_PAGE.ALL_PROFESSIONAL_SELECTED")),p("type",t.isSmall?"modal":"dropdown")("maxLabels",1)}}function cv(e,n){if(e&1&&(P(0),m(1,"vedius-text",17),v(2),x(3,"percentageFormat"),h(),m(4,"vedius-text",18),v(5),x(6,"translate"),h(),E()),e&2){let t=f();l(2),T("",t.totalPercentage===0?"00,00%":F(3,2,t.totalPercentage,Q(7,av))," "),l(3),T(" ",S(6,5,"DASHBOARD_PAGE.APPOINTMENT_OCCUPANCY_RANGE.RESULT_TITLE")," ")}}function dv(e,n){e&1&&w(0,"ngx-skeleton-loader",19),e&2&&p("count",1)("theme",Q(2,ov))}function pv(e,n){e&1&&w(0,"ngx-skeleton-loader",20),e&2&&p("count",1)("theme",Q(2,rv))}function mv(e,n){e&1&&Ce(0)}function hv(e,n){if(e&1&&(P(0),C(1,mv,1,0,"ng-container",21),E()),e&2){f();let t=he(21);l(),p("ngTemplateOutlet",t)}}function uv(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",20),E()),e&2&&(l(),p("count",1)("theme",Q(2,sv)))}function gv(e,n){e&1&&(m(0,"div",22),w(1,"img",23),m(2,"vedius-text",24),v(3),x(4,"translate"),h()()),e&2&&(l(3),T(" ",S(4,1,"DASHBOARD_PAGE.APPOINTMENT_OCCUPANCY_RANGE.EMPTY_DESCRIPTION")," "))}var Am=(()=>{let n=class n{get userVedius(){return this.userVediusContext.current}get isClinicUser(){return this.userVedius.type===_e.Clinic}get isAnnualFilter(){return this.dashboardPeriodSelectorTypeSelected===ke.MONTHLY}get isWeeklyFilter(){return this.dashboardPeriodSelectorTypeSelected===ke.WEEKLY}get isAnySecretaryRole(){return this.userVedius.type!==_e.Clinic?!1:this.userVedius.hasAnySecretaryRoleType()}get totalTimeScheduledPerCollaborators(){return this.isAnnualFilter?this.totalTimeYearScheduledPerCollaborators:this.isWeeklyFilter?this.totalTimeWeeklyScheduledPerCollaborators:this.totalTimeMonthlyScheduledPerCollaborators}get isOwner(){return this.userVedius.type===_e.Clinic?this.userVedius.hasAnyOwnerRoleType():!0}constructor(i,a,o,r,s,c,d){this.userVediusContext=i,this.translate=a,this.dialog=o,this.calendarSettingsService=r,this.eventCalendarDisplayService=s,this.scheduleEventCalculationService=c,this.cdr=d,this.isSmall=!1,this.loadingDelay=0,this.isLoading=!0,this.collaboratorsSelected=[],this.isFirstLoading=!0,this.loadedTranslation=!1,this.calendarSettings=[],this.dashboardPeriodSelectorTypeSelected=ke.DAILY,this.monthlyPeriod=De.thisMonth(),this.yearPeriod=De.thisYear(),this.currentEventsCalendarDisplaySplittered=[],this.totalTimeMonthlyScheduledPerCollaborators={},this.totalTimeYearScheduledPerCollaborators={},this.totalTimeWeeklyScheduledPerCollaborators={},this.eventCalendarDisplayMonthlySplitteredPerCollaborators={},this.eventCalendarDisplayYearSplitteredPerCollaborators={}
20,this.initialLoadSubject=new we,this.destroy$=new we}ngOnInit(){this.startInitialSubjectLoad(),this.translate.loaded().then(()=>{this.loadedTranslation=!0}),this.isClinicUser||(this.isLoading=!0,this.collaboratorsSelected=[this.userVedius],this.initialLoadSubject.next())}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Qr(2e3),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load appointment occupancy rate: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}setTotalTimeScheduledPerCollaborators(i,a){this.isAnnualFilter?this.totalTimeYearScheduledPerCollaborators[i]=a:this.isWeeklyFilter?this.totalTimeWeeklyScheduledPerCollaborators[i]=a:this.totalTimeMonthlyScheduledPerCollaborators[i]=a}setEventCalendarDisplayPerCollaborators(i,a,o){o?this.eventCalendarDisplayYearSplitteredPerCollaborators[i]=a:this.eventCalendarDisplayMonthlySplitteredPerCollaborators[i]=a}get allCollaboratorsKeys(){return this.isClinicUser?this.userVedius.collaborators.map(i=>i.key):[this.userVedius.key]}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}get currentPeriod(){return this.isAnnualFilter?this.yearPeriod:this.monthlyPeriod}get totalPercentage(){let i=0;this.collaboratorsSelected.forEach(o=>{let r=this.totalTimeScheduledPerCollaborators[o.key.value]||0;i+=r});let a=i/this.collaboratorsSelected.length;return a>0?Be(a,2):0}getCollaboratorEventCalendarDisplay(i){return this.isAnnualFilter?this.eventCalendarDisplayYearSplitteredPerCollaborators[i.key.value]||[]:this.eventCalendarDisplayMonthlySplitteredPerCollaborators[i.key.value]||[]}onCollaboratorLoaded(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),setTimeout(()=>{this.initialLoadSubject.next(),this.cdr.detectChanges()})}onCollaboratorSelect(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),setTimeout(()=>{this.loadAppointments(),this.cdr.detectChanges()})}load(i=!0){return B(this,null,function*(){try{i&&(this.isLoading=!0),yield this.loadCalendarSettings(),yield this.loadAppointments()}catch(a){console.error("Error to load appointment occupancy rate: ",a)}finally{this.isLoading=!1,this.isFirstLoading=!1}})}onPeriodSelectorTabChanged(i){return B(this,null,function*(){this.dashboardPeriodSelectorTypeSelected=i,setTimeout(()=>{this.loadAppointments(),this.cdr.detectChanges()})})}openInfo(){this.dialog.open(wm,{width:"600px"})}populateTotalScheduledTimePerCollaborators(){this.collaboratorsSelected.forEach(i=>{let a=this.totalTimeScheduledPerCollaborators[i.key.value],o=this.calendarSettings.find(r=>r.userVedius.key.value===i.key.value);if(a===void 0&&o){let r=this.getCollaboratorEventCalendarDisplay(i);this.isWeeklyFilter?a=this.scheduleEventCalculationService.calculateWeeklyAverageOccupancyRate(this.currentPeriod,i,o,r):a=this.scheduleEventCalculationService.calculateScheduledPeriodTimeByCollaborator(this.currentPeriod,i,o,r),this.setTotalTimeScheduledPerCollaborators(i.key.value,a)}})}loadAppointments(i=!0){return B(this,null,function*(){i&&(this.isLoading=!0);try{let a=this.collaboratorsSelected.map(r=>this.isAnnualFilter?this.loadYearAppointments(r):this.loadMonthlyAppointments(r));yield Promise.all(a);let o=[];this.collaboratorsSelected.forEach(r=>{let s=this.getCollaboratorEventCalendarDisplay(r);o.push(...s)}),this.currentEventsCalendarDisplaySplittered=o,this.populateTotalScheduledTimePerCollaborators(),this.dashboardAppointmentOccupancyRateBarChartComponent?.onLoad(this.currentEventsCalendarDisplaySplittered,this.collaboratorsSelected,this.dashboardPeriodSelectorTypeSelected,this.calendarSettings,this.currentPeriod)}catch(a){throw console.error("Error to load appointment occupancy rate: ",a),a}finally{this.isLoading=!1}})}loadMonthlyAppointments(i){return B(this,null,function*(){let a=this.eventCalendarDisplayMonthlySplitteredPerCollaborators[i.key.value];a||(a=yield this.eventCalendarDisplayService.getByRange({period:this.monthlyPeriod,professionalKeys:[i.key]}
20),this.setEventCalendarDisplayPerCollaborators(i.key.value,a,!1))})}loadYearAppointments(i){return B(this,null,function*(){if(!this.eventCalendarDisplayYearSplitteredPerCollaborators[i.key.value]){let r=yield this.eventCalendarDisplayService.getByRange({period:this.yearPeriod,professionalKeys:[i.key]});this.setEventCalendarDisplayPerCollaborators(i.key.value,r,!0)}})}loadCalendarSettings(){return B(this,null,function*(){this.calendarSettings=yield this.calendarSettingsService.getMany({userVediusKeys:this.allCollaboratorsKeys})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}};n.\u0275fac=function(a){return new(a||n)(y(Te),y(ae),y(He),y(Kt),y(Zt),y(yo),y(Oe))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-appointment-occupancy-rate"]],viewQuery:function(a,o){if(a&1&&ne(Gr,5),a&2){let r;te(r=ie())&&(o.dashboardAppointmentOccupancyRateBarChartComponent=r.first)}},inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:22,vars:22,consts:[["emptyAppointmentOccupancyRate",""],[1,"dashboard-appointment-occupancy-rate-component"],[1,"appointment-occupancy-header-info"],[1,"left-header-info"],["variant","text","size","md",1,"neutral-dusk-color"],["svgIcon","help-info",1,"help-icon",3,"click"],[1,"right-header-info"],["size","small",3,"hidden","type","maxLabels","defaultLabel","labelForFullSelection","onFilterSelect","onLoad",4,"ngIf"],[1,"appointment-occupancy-rate-sub-header-info"],[1,"result-info"],[4,"ngIf"],["class","loader","style","width: 150px; margin-top: 8px",3,"count","theme",4,"ngIf"],[1,"appointment-occupancy-rate-sub-header-year"],[3,"onChange","initialActivated"],[3,"dashboardPeriodSelectorType","collaboratorsSelected","schedules","calendarSettings","period","isSmall"],["class","loader",3,"count","theme",4,"ngIf"],["size","small",3,"onFilterSelect","onLoad","type","maxLabels","defaultLabel","labelForFullSelection"],["variant","display","size","md",1,"neutral-dusk-color","value"],["variant","text","size","xl",1,"neutral-medium-color"],[1,"loader",2,"width","150px","margin-top","8px",3,"count","theme"],[1,"loader",3,"count","theme"],[4,"ngTemplateOutlet"],[1,"empty-content"],["src","../../../../../../assets/images/appointment-occupancy-rate-empty.svg","alt","empty-state"],["variant","text","size","sm",1,"empty-description","neutral-darker-color"]],template:function(a,o){if(a&1){let r=I();m(0,"div",1),P(1),m(2,"div",2)(3,"div",3)(4,"vedius-text",4),v(5),x(6,"translate"),h(),m(7,"mat-icon",5),A("click",function(){return D(r),L(o.openInfo())}),h()(),m(8,"div",6),C(9,lv,3,10,"vedius-collaborator-selection-button",7),h()(),m(10,"div",8)(11,"div",9),C(12,cv,7,8,"ng-container",10)(13,dv,1,3,"ngx-skeleton-loader",11),h()(),m(14,"div",12)(15,"app-dashboard-year-and-monthly-period-selector-tab-group",13),A("onChange",function(c){return D(r),L(o.onPeriodSelectorTabChanged(c))}),h()(),w(16,"app-dashboard-appointment-occupancy-rate-bar-chart",14),C(17,pv,1,3,"ngx-skeleton-loader",15)(18,hv,2,1,"ng-container",10),E(),h(),C(19,uv,2,3,"ng-container",10)(20,gv,5,3,"ng-template",null,0,me)}a&2&&(X("hidden",o.isLoading&&o.isFirstLoading)("small",o.isSmall),l(5),T(" ",S(6,20,"DASHBOARD_PAGE.APPOINTMENT_OCCUPANCY_RANGE.TITLE")," "),l(4),p("ngIf",o.isClinicUser&&o.loadedTranslation),l(3),p("ngIf",!o.isLoading),l(),p("ngIf",o.isLoading),l(2),p("initialActivated",o.dashboardPeriodSelectorTypeSelected),l(),X("hidden",o.isLoading||o.totalPercentage===0),p("dashboardPeriodSelectorType",o.dashboardPeriodSelectorTypeSelected)("collaboratorsSelected",o.collaboratorsSelected)("schedules",o.currentEventsCalendarDisplaySplittered)("calendarSettings",o.calendarSettings)("period",o.currentPeriod)("isSmall",o.isSmall),l(),p("ngIf",o.isLoading),l(),p("ngIf",o.totalPercentage===0&&!o.isLoading),l(),p("ngIf",o.isLoading&&o.isFirstLoading))},dependencies:[j,et,z,mt,Ee,Pe,Zc,Gr,ze,$,Y,tt],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-appointment-occupancy-rate-component{display:flex;padding:12px;flex-direction:column;gap:24px;align-self:stretch;min-height:400px;border-radius:12px;background:#fff;border:1px solid #f5f6f8;position:relative;overflow-x:hidden}.dashboard-appointment-occupancy-rate-component.hidden,.dashboard-appointment-occupancy-rate-component .hidden{display:none!important}.dashboard-appointment-occupancy-rate-component .loader{width:100%}.dashboard-appointment-occupancy-rate-component .neutral-dusk-color{color:#192840}.dashboard-appointment-occupancy-rate-component .neutral-medium-color{color:#96a0b0}.dashboard-appointment-occupancy-rate-component .neutral-darker-color{color:#425168}
20.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info{padding:0 12px;display:flex;justify-content:space-between;align-items:center;align-self:stretch;width:100%;box-sizing:border-box;min-width:0;gap:12px}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info .left-header-info{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info .left-header-info .help-icon{width:16px;height:16px}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info .left-header-info .help-icon:hover{cursor:pointer;opacity:.8}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info .right-header-info{display:flex;align-items:center;gap:24px;min-width:0;flex:0 1 auto;max-width:100%}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info .right-header-info .hidden{display:none}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-header-info .right-header-info vedius-collaborator-selection-button{width:200px;max-width:100%;display:flex;min-width:0}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-rate-sub-header-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:4px;padding:0 12px}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-rate-sub-header-info .result-info{display:flex;align-items:baseline;gap:8px}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-rate-sub-header-info .result-info .value span{line-height:40px;letter-spacing:-.64px}.dashboard-appointment-occupancy-rate-component .appointment-occupancy-rate-sub-header-year{padding:0 12px}.dashboard-appointment-occupancy-rate-component .empty-content{display:flex;flex-direction:column;align-items:center;gap:4px;box-sizing:border-box}.dashboard-appointment-occupancy-rate-component .empty-content .empty-description{text-align:center;width:280px;max-width:100%;box-sizing:border-box}.dashboard-appointment-occupancy-rate-component .empty-content img{max-width:150px;max-height:150px}.dashboard-appointment-occupancy-rate-component.small{padding:24px;border-radius:8px}.dashboard-appointment-occupancy-rate-component.small .appointment-occupancy-header-info,.dashboard-appointment-occupancy-rate-component.small .appointment-occupancy-rate-sub-header-info,.dashboard-appointment-occupancy-rate-component.small .appointment-occupancy-rate-sub-header-year{padding-left:0;padding-right:0}.dashboard-appointment-occupancy-rate-component.small app-dashboard-appointment-occupancy-rate-bar-chart{display:block;width:100%}.dashboard-appointment-occupancy-rate-component.small .appointment-occupancy-header-info{flex-wrap:wrap;align-items:flex-start}.dashboard-appointment-occupancy-rate-component.small .appointment-occupancy-header-info .right-header-info{flex:1 1 100%;max-width:100%;justify-content:flex-end}.dashboard-appointment-occupancy-rate-component.small .appointment-occupancy-header-info .right-header-info vedius-collaborator-selection-button{width:100%;max-width:100%} 21`],encapsulation:2});let e=n;return e})();var fv=(e,n)=>({plural_client_treatment_type:e,single_client_treatment_type:n}),km=(()=>{let n=class n{constructor(i){this.appContext=i,this.modal=null}get isPatientTreatmentType(){return this.appContext.getUserCredential()?.userVedius?.clientTreatmentType===xe.PATIENT}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(Le))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-patient-funnel-info-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:17,vars:22,consts:[[1,"dashboard-patient-funnel-info-modal"],[1,"title"],[1,"patient-funnel-info-content"],["variant","text","size","md","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"bottom"],[3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"div",2)(6,"vedius-text",3),v(7),x(8,"translate"),x(9,"translate"),x(10,"translate"),x(11,"translate"),x(12,"translate"),h()(),m(13,"div",4)(14,"vedius-button",5),A("onClick",function(){return o.close()}),v(15),x(16,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,4,"DASHBOARD_PAGE.MODA
21L_INFO.PATIENT_FUNNEL.TITLE")," "),l(4),T(" ",F(12,14,"DASHBOARD_PAGE.MODAL_INFO.PATIENT_FUNNEL.DESCRIPTION",bt(19,fv,o.isPatientTreatmentType?S(8,6,"PATIENTS"):S(9,8,"STUDENTS"),o.isPatientTreatmentType?S(10,10,"PATIENT"):S(11,12,"STUDENT"))),""),l(7),p("fullSize",!0),l(),T(" ",S(16,17,"BUTTONS.UNDERSTOOD"),""))},dependencies:[q,j,re,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-patient-funnel-info-modal{display:flex;flex-direction:column;gap:24px}.dashboard-patient-funnel-info-modal .neutral-dusk-color{color:#192840}.dashboard-patient-funnel-info-modal .neutral-darker-color{color:#425168}.dashboard-patient-funnel-info-modal .loader{width:100%}.dashboard-patient-funnel-info-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:4px 0}.dashboard-patient-funnel-info-modal .bottom{width:100%;margin-top:16px}.dashboard-patient-funnel-info-modal .bottom vedius-button{width:100%}@media screen and (max-width: 600px){.dashboard-patient-funnel-info-modal .title{font-size:1.25rem;line-height:1.875rem;margin:12px 0 0}} 22`],encapsulation:2});let e=n;return e})();var zr=()=>({fractionDigits:1,fixedInteger:!0}),_v=()=>({height:"165px"}),xv=()=>({height:"105px"}),vv=()=>({height:"62px"}),bv=()=>({height:"500px"});function yv(e,n){if(e&1){let t=I();m(0,"vedius-collaborator-selection-button",16),x(1,"translate"),x(2,"translate"),A("onFilterSelect",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))})("onLoad",function(a){D(t);let o=f();return L(o.onCollaboratorLoaded(a))}),h()}if(e&2){let t=f();X("hidden",!t.isOwner&&!t.isAnySecretaryRole),ee("defaultLabel",S(1,6,"DASHBOARD_PAGE.DEFAULT_PROFESSIONAL_LABEL")),ee("labelForFullSelection",S(2,8,"DASHBOARD_PAGE.ALL_PROFESSIONAL_SELECTED")),p("type",t.isSmall?"modal":"dropdown")("maxLabels",1)}}function Cv(e,n){if(e&1&&(m(0,"vedius-text",10),v(1),x(2,"percentageFormat"),h()),e&2){let t=f(2);l(),T(" ",F(2,1,t.patientsData.funnelPercentage,Q(4,zr))," ")}}function Tv(e,n){if(e&1&&(P(0),m(1,"vedius-text",17),v(2),h(),C(3,Cv,3,5,"vedius-text",18),E()),e&2){let t=f();l(2),T(" ",t.patientsData.total," "),l(),p("ngIf",t.patientsData.total>0)}}function Sv(e,n){if(e&1&&(P(0),m(1,"div",19)(2,"div",20)(3,"vedius-text",21),v(4),h()(),m(5,"vedius-text",10),v(6),x(7,"translate"),h()(),E()),e&2){let t=f();l(2),X("positive",t.patientsData.previousDifferencePercentage>0)("negative",t.patientsData.previousDifferencePercentage<0),l(2),W(t.patientsData.previousDifferencePercentageFormatted),l(2),W(S(7,6,"DASHBOARD_PAGE.PATIENT_FUNNEL.VS_PREVIOUS_MONTH"))}}function wv(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",22),E()),e&2&&(l(),p("count",1)("theme",Q(2,_v)))}function Av(e,n){if(e&1&&(m(0,"vedius-text",10),v(1),x(2,"percentageFormat"),h()),e&2){let t=f(2);l(),T(" ",F(2,1,t.appointmentsData.funnelPercentage,Q(4,zr))," ")}}function kv(e,n){if(e&1&&(P(0),m(1,"vedius-text",17),v(2),h(),C(3,Av,3,5,"vedius-text",18),E()),e&2){let t=f();l(2),T(" ",t.appointmentsData.total," "),l(),p("ngIf",t.patientsData.total>0)}}function Dv(e,n){if(e&1&&(P(0),m(1,"div",19)(2,"div",20)(3,"vedius-text",21),v(4),h()(),m(5,"vedius-text",10),v(6),x(7,"translate"),h()(),E()),e&2){let t=f();l(2),X("positive",t.appointmentsData.previousDifferencePercentage>0)("negative",t.appointmentsData.previousDifferencePercentage<0),l(2),W(t.appointmentsData.previousDifferencePercentageFormatted),l(2),W(S(7,6,"DASHBOARD_PAGE.PATIENT_FUNNEL.VS_PREVIOUS_MONTH"))}}function Lv(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",22),E()),e&2&&(l(),p("count",1)("theme",Q(2,xv)))}function Pv(e,n){if(e&1&&(m(0,"vedius-text",10),v(1),x(2,"percentageFormat"),h()),e&2){let t=f(3);
22l(),T(" ",F(2,1,t.paymentsData.funnelPercentage,Q(4,zr))," ")}}function Ev(e,n){if(e&1&&(P(0),m(1,"vedius-text",17),v(2),h(),C(3,Pv,3,5,"vedius-text",18),E()),e&2){let t=f(2);l(2),T(" ",t.paymentsData.total," "),l(),p("ngIf",t.patientsData.total>0)}}function Mv(e,n){if(e&1&&(P(0),m(1,"div",19)(2,"div",20)(3,"vedius-text",21),v(4),h()(),m(5,"vedius-text",10),v(6),x(7,"translate"),h()(),E()),e&2){let t=f(2);l(2),X("positive",t.paymentsData.previousDifferencePercentage>0)("negative",t.paymentsData.previousDifferencePercentage<0),l(2),W(t.paymentsData.previousDifferencePercentageFormatted),l(2),W(S(7,6,"DASHBOARD_PAGE.PATIENT_FUNNEL.VS_PREVIOUS_MONTH"))}}function Ov(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",22),E()),e&2&&(l(),p("count",1)("theme",Q(2,vv)))}function Iv(e,n){if(e&1&&(m(0,"div",23)(1,"div",9)(2,"vedius-text",10),v(3),x(4,"translate"),h(),C(5,Ev,4,2,"ng-container",11),h(),C(6,Mv,8,8,"ng-container",11),m(7,"div",24),C(8,Ov,2,3,"ng-container",11),h()()),e&2){let t=f();l(3),T(" ",S(4,12,"DASHBOARD_PAGE.PATIENT_FUNNEL.PAYMENTS")," "),l(2),p("ngIf",!t.isPaymentLoading),l(),p("ngIf",!t.isPaymentLoading&&t.paymentsData.previousDifferencePercentageFormatted&&t.paymentsData.previousDifferencePercentage),l(),Fe("height",t.paymentsHeight,"px"),X("loading",t.isPaymentLoading)("empty",t.paymentsData.total===0)("with-value",t.paymentsData.total>0),l(),p("ngIf",t.isPaymentLoading)}}function Fv(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",22),E()),e&2&&(l(),p("count",1)("theme",Q(2,bv)))}var Lm=(()=>{let n=class n{constructor(i,a,o,r,s,c,d,u){this.userVediusContext=i,this.translate=a,this.patientService=o,this.patientInfoConverterService=r,this.eventCalendarDisplayService=s,this.transactionService=c,this.toastService=d,this.dialog=u,this.isSmall=!1,this.loadingDelay=0,this.isPatientsLoading=!0,this.isAppointmentsLoading=!0,this.isPaymentLoading=!0,this.isFirstLoading=!0,this.collaboratorsSelected=[],this.loadedTranslation=!1,this.allPatientsObjectInfos=[],this.newPatients=[],this.previousNewPatients=[],this.newPatientsAppointments=[],this.previousNewPatientsAppointments=[],this.currentPeriod=De.thisMonth(),this.previousPeriod=De.lastMonth(),this.data={patients:{total:0,funnelPercentage:0,previousDifferencePercentage:void 0,previousDifferencePercentageFormatted:""},appointments:{total:0,funnelPercentage:0,previousDifferencePercentage:void 0,previousDifferencePercentageFormatted:""},payments:{total:0,funnelPercentage:0,previousDifferencePercentage:void 0,previousDifferencePercentageFormatted:""}},this.initialLoadSubject=new we,this.destroy$=new we}get userVedius(){return this.userVediusContext.current}get isClinicUser(){return this.userVedius.type===_e.Clinic}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}get allTeamCollaboratorKeys(){return this.isClinicUser?this.userVedius.collaborators.map(i=>i.key):[this.userVedius.key]}get isPatientTreatmentType(){return this.userVedius?.clientTreatmentType===xe.PATIENT}get patientsData(){return this.data.patients}get appointmentsData(){return this.data.appointments}get paymentsData(){return this.data.payments}get isPatientTotalGreaterThanZero(){return this.patientsData.total>0}get isOwner(){return this.userVedius.type===_e.Clinic?this.userVedius.hasAnyOwnerRoleType():!0}get isAnySecretaryRole(){return this.userVedius.type!==_e.Clinic?!1:this.userVedius.hasAnySecretaryRoleType()}get hasFinancialBalanceAccess(){return this.userVedius.type===_e.Clinic?this.userVedius?.clinicRole!==Vi.COLLABORATOR:!0}ngOnInit(){this.startInitialSubjectLoad(),this.translate.loaded().then(()=>{this.loadedTranslation=!0}),this.isClinicUser||(this.collaboratorsSelected=[this.userVedius],this.initialLoadSubject.next())}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}onCollaboratorLoaded(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),this.initialLoadSubject.next()}load(){return B(this,null,function*(){try{this.isPatientsLoading=!0,this.isAppointmentsLoading=!0,this.isPaymentLoading=!0,yield this.loadAllPatientsObjectInfos(),this.isPatientsLoading=!1,this.isFirstLoading=!1;try{yield this.loadAppointments(),this.isAppointmentsLoading=!1,yield this.loadPayments(),this.isPaymentLoading=!1}catch(i){console.error("Error to load sub patient funnel data: ",i),this.isAppointmentsLoading=!1,this.isPaymentLoading=!1}}catch(i){console.error("Error to load patient funnel data: ",i),this.isPatientsLoading=!1,this.isAppointmentsLoading=!1,this.isPaymentLoading=!1,this.isFirstLoading=!1}})}onCollaboratorSelect(i){return B(this,null,function*(){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value));try{this.isAppointmentsLoading=!0,this.isPaymentLoading=!0,this.applyFilterPatientsForCollaborators(),yield this.loadAppointments(),this.isAppointmentsLoading=!1,yield this.loadPayments(),this.isPaymentLoading=!1}catch(o){console.error("Error to load patient funnel after change collaborator: ",o),this.toastService.showDefaultErrorMessage(),this.isAppointmentsLoading=!1,this.isPaymentLoading=!1}})}openInfo(){this.dialog.open(km,{width:"600px"})}loadAllPatientsObjectInfos(){return B(this,null,function*(){this.allPatientsObjectInfos=yield this.patientService.getAllObjectInfos(),this.applyFilterPatientsForCollaborators()})}loadAppointments(){return B(this,null,function*(){if(this.isPatientTotalGreaterThanZero){let i=this.allTeamCollaboratorKeys,[a,o]=yield Promise.all([this.eventCalendarDisplayService.getByRange({period:this.currentPeriod,professionalKeys:i}),this.eventCalendarDisplayService.getByRange({period:this.previousPeriod,professionalKeys:i})]);this.applyFilterAppointmentsPatients(a,o)}this.calculateAppointmentHeight(),this.scheduleAppointmentHeightCalculation(200),this.scheduleAppointmentHeightCalculation(700)})}scheduleAppointmentHeightCalculation(i){setTimeout(()=>{this.calculateAppointmentHeight()},i)}loadPayments(){return B(this,null,function*(){if(this.isPatientTotalGreaterThanZero){let[i,a]=yield Promise.all([this.transactionService.getAllByPeriod({period:this.currentPeriod}),this.transactionService.getAllByPeriod({period:this.previousPeriod})]);this.applyFilterPaymentsPatients(i,a)}this.calculatePaymentHeight(),this.schedulePaymentHeightCalculation(400),this.schedulePaymentHeightCalculation(600),this.schedulePaymentHeightCalculation(1200)})}schedulePaymentHeightCalculation(i){setTimeout(()=>{this.calculatePaymentHeight()},i)}applyFilterPatientsForCollaborators(){let i=this.collaboratorsSelectedKeys.map(c=>c.value),a=this.allPatientsObjectInfos.filter(c=>i.includes(c.professional_uid)&&c.created_date&&this.currentPeriod.containsDate(hi(c.created_date)));this.newPatients=a.map(c=>this.patientInfoConverterService.convertFromObjectToInfo(c));let o=this.allPatientsObjectInfos.filter(c=>i.includes(c.professional_uid)&&c.created_date&&this.previousPeriod.containsDate(hi(c.created_date)));this.previousNewPatients=o.map(c=>this.patientInfoConverterService.convertFromObjectToInfo(c)),this.data.patients.total=this.newPatients.length,this.data.patients.funnelPercentage=this.isPatientTotalGreaterThanZero?100:0;let r=this.data.patients.total,s=this.previousNewPatients.length;this.data.patients.previousDifferencePercentage=s>0?Qt(r,s,2):void 0,this.data.patients.previousDifferencePercentageFormatted=s>0?rt(r,s,!0,2):""}applyFilterAppointmentsPatients(i,a){let o=this.newPatients.map(d=>d.key.patientKey.value),r=new Set;
22i.forEach(d=>{let u=d.patientInfo?.key?.patientKey?.value;u&&o.includes(u)&&r.add(u)}),this.newPatientsAppointments=this.newPatients.filter(d=>i.some(u=>u.patientInfo?.key?.patientKey?.value===d.key.patientKey.value));let s=this.previousNewPatients.map(d=>d.key.patientKey.value),c=new Set;a.forEach(d=>{let u=d.patientInfo?.key?.patientKey?.value;u&&s.includes(u)&&c.add(u)}),this.previousNewPatientsAppointments=this.previousNewPatients.filter(d=>a.some(u=>u.patientInfo?.key?.patientKey?.value===d.key.patientKey.value)),this.data.appointments.total=r.size,this.data.appointments.funnelPercentage=this.data.appointments.total>0?Fo(this.data.appointments.total,this.data.patients.total,2):0,this.data.appointments.previousDifferencePercentage=c.size>0?Qt(this.data.appointments.total,c.size):void 0,this.data.appointments.previousDifferencePercentageFormatted=c.size>0?rt(this.data.appointments.total,c.size):""}applyFilterPaymentsPatients(i,a){let o=this.newPatientsAppointments.map(g=>g.key.patientKey.value),r=(i?.transactions?.perDays?.map(g=>g.transactions).flat()||[])?.filter(g=>(g.registerType===dn.PATIENT||g.registerType===dn.PATIENT_EVENTS)&&g.status===cn.CONFIRMED),s=(a?.transactions?.perDays?.map(g=>g.transactions).flat()||[])?.filter(g=>(g.registerType===dn.PATIENT||g.registerType===dn.PATIENT_EVENTS)&&g.status===cn.CONFIRMED),c=new Set;r.forEach(g=>{let _=g.patient.key.patientKey.value;o.includes(_)&&c.add(_)});let d=this.previousNewPatientsAppointments.map(g=>g.key.patientKey.value),u=new Set;s.forEach(g=>{let _=g.patient.key.patientKey.value;d.includes(_)&&u.add(_)}),this.data.payments.total=c.size,this.data.payments.funnelPercentage=this.data.payments.total>0?Fo(this.data.payments.total,this.data.appointments.total,2):0,this.data.payments.previousDifferencePercentage=u.size>0?Qt(this.data.payments.total,u.size):void 0,this.data.payments.previousDifferencePercentageFormatted=u.size>0?rt(this.data.payments.total,u.size):""}calculateAppointmentHeight(){if(this.patientsData.total===0){this.appointmentsHeight=105;return}let a=document.querySelector(".patient-funnel-content.with-value")?.clientHeight||0,o=this.appointmentsData.funnelPercentage/100*a;this.appointmentsHeight=o}calculatePaymentHeight(){if(this.patientsData.total===0){this.paymentsHeight=62;return}let a=document.querySelector(".appointment-funnel-content")?.clientHeight||0,o=this.paymentsData.funnelPercentage/100*a;this.paymentsHeight=o}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}};n.\u0275fac=function(a){return new(a||n)(y(Te),y(ae),y(pt),y(zi),y(Zt),y(_a),y(dt),y(He))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-patient-funnel"]],inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:32,vars:40,consts:[[1,"dashboard-patient-funnel-component"],[1,"patient-funnel-header-info"],[1,"left-header-info"],["variant","text","size","md",1,"neutral-dusk-color"],["svgIcon","help-info",1,"help-icon",3,"click"],[1,"right-header-info"],["dropdownClass","collaborators-patient-funnel-dropdown","size","small",3,"hidden","type","maxLabels","defaultLabel","labelForFullSelection","onFilterSelect","onLoad",4,"ngIf"],[1,"patient-funnel-container"],[1,"patient-funnel","funnel-column","border-right"],[1,"info-header"],["variant","text","size","micro",1,"neutral-dark-color"],[4,"ngIf"],[1,"patient-funnel-content","funnel-content"],[1,"appointment-funnel","funnel-column"],[1,"appointment-funnel-content","funnel-content"],["class","payment-funnel funnel-column",4,"ngIf"],["dropdownClass","collaborators-patient-funnel-dropdown","size","small",3,"onFilterSelect","onLoad","type","maxLabels","defaultLabel","labelForFullSelection"],["variant","display","size","micro",1,"neutral-dusk-color"],["class","neutral-dark-color","variant","text","size","micro",4,"ngIf"],[1,"previous-difference"],[1,"difference-label"],["variant","text","size","micro"],[1,"loader",3,"count","theme"],[1,"payment-funnel","funnel-column"],[1,"payment-funnel-content","funnel-content"]],template:function(a,o){a&1&&(m(0,"div",0),P(1),m(2,"div",1)(3,"div",2)(4,"vedius-text",3),v(5),x(6,"translate"),h(),m(7,"mat-icon",4),A("click",function(){return o.openInfo()}),h()(),m(8,"div",5),C(9,yv,3,10,"vedius-collaborator-selection-button",6),h()(),m(10,"div",7)(11,"div",8)(12,"div",9)(13,"vedius-text",10),v(14),x(15,"translate"),x(16,"translate"),h(),C(17,Tv,4,2,"ng-container",11),h(),C(18,Sv,8,8,"ng-container",11),m(19,"div",12),C(20,wv,2,3,"ng-container",11),h()(),m(21,"div",13)(22,"div",9)(23,"vedius-text",10),v(24),x(25,"translate"),h(),C(26,kv,4,2,"ng-container",11),h(),C(27,Dv,8,8,"ng-container",11),m(28,"div",14),C(29,Lv,2,3,"ng-container",11),h()(),C(30,Iv,9,14,"div",15),h(),E(),h(),C(31,Fv,2,3,"ng-container",11)),a&2&&(X("hidden",o.isFirstLoading)("small",o.isSmall),l(5),T(" ",S(6,32,"DASHBOARD_PAGE.PATIENT_FUNNEL.TITLE")," "),l(4),p("ngIf",o.isClinicUser&&o.loadedTranslation),l(5),T(" ",o.isPatientTreatmentType?S(15,34,"DASHBOARD_PAGE.PATIENT_FUNNEL.NEW_PATIENTS"):S(16,36,"DASHBOARD_PAGE.PATIENT_FUNNEL.NEW_STUDENTS")," "),l(3),p("ngIf",!o.isPatientsLoading),l(
22),p("ngIf",!o.isPatientsLoading&&o.patientsData.previousDifferencePercentageFormatted&&o.patientsData.previousDifferencePercentage),l(),X("loading",o.isPatientsLoading)("empty",o.patientsData.total===0)("with-value",o.patientsData.total>0),l(),p("ngIf",o.isPatientsLoading),l(),X("border-right",o.hasFinancialBalanceAccess),l(3),T(" ",S(25,38,"DASHBOARD_PAGE.PATIENT_FUNNEL.APPOINTMENTS")," "),l(2),p("ngIf",!o.isAppointmentsLoading),l(),p("ngIf",!o.isAppointmentsLoading&&o.appointmentsData.previousDifferencePercentageFormatted&&o.appointmentsData.previousDifferencePercentage),l(),Fe("height",o.appointmentsHeight,"px"),X("loading",o.isAppointmentsLoading)("empty",o.appointmentsData.total===0)("with-value",o.appointmentsData.total>0),l(),p("ngIf",o.isAppointmentsLoading),l(),p("ngIf",o.hasFinancialBalanceAccess),l(),p("ngIf",o.isFirstLoading))},dependencies:[j,et,z,mt,Ee,Pe,$,Y,tt],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.collaborators-patient-funnel-dropdown{left:-100px!important}.dashboard-patient-funnel-component{display:flex;padding:24px;flex-direction:column;align-self:stretch;gap:24px;min-height:320px;border-radius:12px;background:#fff;border:1px solid #f5f6f8;position:relative;overflow-x:hidden}.dashboard-patient-funnel-component.hidden{display:none!important}.dashboard-patient-funnel-component .loader{width:100%}.dashboard-patient-funnel-component .patient-funnel-header-info{display:flex;justify-content:space-between;align-items:center;align-self:stretch;min-width:0;gap:12px}.dashboard-patient-funnel-component .patient-funnel-header-info .left-header-info{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.dashboard-patient-funnel-component .patient-funnel-header-info .left-header-info .help-icon{width:16px;height:16px}.dashboard-patient-funnel-component .patient-funnel-header-info .left-header-info .help-icon:hover{cursor:pointer;opacity:.8}.dashboard-patient-funnel-component .patient-funnel-header-info .right-header-info{display:flex;align-items:center;gap:24px;min-width:0;flex:0 1 auto;max-width:100%}.dashboard-patient-funnel-component .patient-funnel-header-info .right-header-info .hidden{display:none}.dashboard-patient-funnel-component .patient-funnel-header-info .right-header-info vedius-collaborator-selection-button{width:200px;max-width:100%;display:flex;min-width:0}.dashboard-patient-funnel-component .neutral-day-color{color:#fff}.dashboard-patient-funnel-component .neutral-dusk-color{color:#192840}.dashboard-patient-funnel-component .neutral-medium-color{color:#96a0b0}.dashboard-patient-funnel-component .neutral-dark-color{color:#6d7a8e}.dashboard-patient-funnel-component .neutral-darker-color{color:#425168}.dashboard-patient-funnel-component .patient-funnel-container{display:flex;height:240px;align-items:flex-start;align-self:stretch;min-width:0;width:100%}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column{display:flex;flex-direction:column;align-items:center;gap:24px;flex:1 1 0;min-width:0;align-self:stretch;position:relative}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column.border-right{border-right:1px solid #d3dae5}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .info-header{display:flex;padding:0 4px;flex-direction:column;align-items:center;align-self:stretch}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .previous-difference{display:flex;flex-direction:column;width:100%;align-items:center;justify-content:flex-start;gap:4px;margin-top:4px;z-index:2}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .previous-difference .difference-label{display:flex;padding:4px 8px;justify-content:center;align-items:center;gap:4px;border-radius:16px}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .previous-difference .difference-label.positive{background-color:#e6fff1}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .previous-difference .difference-label.positive vedius-text{color:#095c35}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .previous-difference .difference-label.negative{background-color:#ffe6e6}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .previous-difference .difference-label.negative vedius-text{color:#781c1c}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .funnel-content{opacity:.32;background:linear-gradient(180deg,#d3dae5,#f5f6f8);position:absolute;
22left:0;right:0;width:auto;bottom:0;z-index:1}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .funnel-content.loading{opacity:1}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .funnel-content.with-value{background:linear-gradient(180deg,#80fff4,#80fff400)}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .patient-funnel-content.with-value{height:146px}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .patient-funnel-content.empty{height:165px;box-sizing:border-box}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .appointment-funnel-content.empty{height:105px;box-sizing:border-box}.dashboard-patient-funnel-component .patient-funnel-container .funnel-column .payment-funnel-content.empty{height:62px;box-sizing:border-box}.dashboard-patient-funnel-component.small{border-radius:8px}.dashboard-patient-funnel-component.small .patient-funnel-header-info{flex-wrap:wrap;align-items:flex-start}.dashboard-patient-funnel-component.small .patient-funnel-header-info .right-header-info{flex:1 1 100%;max-width:100%;justify-content:flex-end}.dashboard-patient-funnel-component.small .patient-funnel-header-info .right-header-info vedius-collaborator-selection-button{width:100%;max-width:100%} 23`],encapsulation:2});let e=n;return e})();var Co=class e{static create(n){let t=[],i=Array.from(new Set(n.currentTransactionMonthSummary.flatMap(s=>s.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getCategories()||[]))),a=n.previousTransactionMonthSummary.length>0?e.createPreviousLegends(n,i):[],o=new Map;i.forEach(s=>{let c=n.translateCategory(s),d=0;
23n.allMonthsLabels.forEach((g,_)=>{let b=_+1,M=n.currentTransactionMonthSummary.find(H=>H.monthSummaryKey.month===b)?.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getAmountByCategory(s)?.value||0;d+=M});let u=o.get(c);u?u.value+=d:o.set(c,{value:d,color:n.getCategoryColor(s)})});let r=new Map;return a.forEach(s=>{r.set(s.label,s)}),o.forEach((s,c)=>{let d=r.get(c);t.push({color:s.color,label:c,value:s.value,percentage:d&&d?.value!==0?{format:rt(s.value,d.value),value:Qt(s.value,d.value)}:void 0})}),t=t.sort((s,c)=>c.value-s.value),t}static createPreviousLegends(n,t){let i=new Map;return t.forEach(o=>{let r=n.translateCategory(o),s=0;if(n.allMonthsLabels.forEach((c,d)=>{let u=d+1,_=n.previousTransactionMonthSummary.find(b=>b.monthSummaryKey.month===u)?.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getAmountByCategory(o)?.value||0;s+=_}),i.has(r)){let c=i.get(r);c.value+=s}else{let c={color:n.getCategoryColor(r),label:r,value:s};i.set(r,c)}}),Array.from(i.values()).sort((o,r)=>r.value-o.value)}};var Ge=function(e){return e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.SEMI_ANNUAL="SEMI_ANNUAL",e}(Ge||{}),Pm=(()=>{let n=class n{constructor(i){this.translation=i,this.onChange=new J,this.tabOptions=[],this.active=Ge.MONTHLY}ngOnInit(){this.initialActivated&&(this.active=this.initialActivated),this.translation.loaded().then(()=>{this.loadTabOptions()})}loadTabOptions(){this.tabOptions=[{label:this.translate(Ge.MONTHLY),value:Ge.MONTHLY,checked:this.active===Ge.MONTHLY,onChange:()=>this.change(Ge.MONTHLY)},{label:this.translate(Ge.QUARTERLY),value:Ge.QUARTERLY,checked:this.active===Ge.QUARTERLY,onChange:()=>this.change(Ge.QUARTERLY)},{label:this.translate(Ge.SEMI_ANNUAL),value:Ge.SEMI_ANNUAL,checked:this.active===Ge.SEMI_ANNUAL,onChange:()=>this.change(Ge.SEMI_ANNUAL)}]}change(i){this.active=i,this.onChange.emit(this.active)}translate(i){return this.translation.get(`${U.DashboardYearPeriodSelectorLabel}.${i}`)}};n.\u0275fac=function(a){return new(a||n)(y(ae))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-year-period-selector-tab-group"]],inputs:{initialActivated:"initialActivated"},outputs:{onChange:"onChange"},decls:1,vars:1,consts:[["type","inline",1,"period-tab-options",3,"options"]],template:function(a,o){a&1&&w(0,"vedius-button-group",0),a&2&&p("options",o.tabOptions)},dependencies:[ba],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.period-tab-options,.period-tab-options .mat-button-toggle-group{width:100%}.period-tab-options .mat-button-toggle-group mat-button-toggle{flex:1} 24`],encapsulation:2});let e=n;return e})();var Bv=!1,To=class e{static create(n){let t=n.currentTransactionMonthSummary[0]?.monthSummaryKey.year,i=Array.from(new Set(n.currentTransactionMonthSummary.flatMap(s=>s.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getCategories()||[]))),a=n.previousTransactionMonthSummary.length>0?e.createPrevious(n,i)?.barStackChartData:[],o=n.allMonthsLabels.map((s,c)=>{let d=c+1,u=n.currentTransactionMonthSummary.find(b=>b.monthSummaryKey.month===d),g=new Map;i.forEach(b=>{let k=n.translateCategory(b),M=u?.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getAmountByCategory(b)?.value||0,H=s?.toLowerCase()?.slice(0,3),Ae=a.find(fe=>fe.name===H)?.series.find(fe=>fe.name===k&&fe.value!==0);if(g.has(k)){let fe=g.get(k);fe.value+=M}else{let fe=M>0&&Ae?.value?rt(M,Ae.value,Bv):void 0,ue=n.getCategoryColor(b);g.set(k,{name:k,value:M,color:ue,suffixInfo:fe})}});let _=Array.from(g.values());return{name:s?.toLowerCase()?.slice(0,3),series:_,tooltip:{title:`${je(s)} ${t}`}}}),r={colors:o.length>0?o[0].series.map(s=>s.color||""):[]};return{barStackChartData:o,barStackChartOptions:r}}static createPrevious(n,t){if(n.previousTransactionMonthSummary.length<=0)return{barStackChartOptions:void 0,barStackChartData:[]};let i=n.previousTransactionMonthSummary[0]?.monthSummaryKey.year,a=n.allMonthsLabels.map((r,s)=>{let c=s+1,d=n.previousTransactionMonthSummary.find(_=>_.monthSummaryKey.month===c),u=new Map;t.forEach(_=>{let b=n.translateCategory(_),k=d?.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getAmountByCategory(_)?.value||0;if(u.has(b)){let M=u.get(b);M.value+=k}else u.set(b,{name:b,value:k,color:n.getCategoryColor(_)})});let g=Array.from(u.values());return{name:r?.toLowerCase()?.slice(0,3),series:g,tooltip:{title:`${je(r)} ${i}`}}}),o={colors:a.length>0?a[0].series.map(r=>r.color||""):[]};return{barStackChartData:a,barStackChartOptions:o}}};var Vv=!1,So=class e{static create(n){let t=new wo,i=Array.from(new Set(n.currentTransactionMonthSummary.flatMap(d=>d.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getCategories()||[]))),a=n.previousTransactionMonthSummary.length>0?e.createPrevious(n,i)?.barStackChartData:[];
24n.currentTransactionMonthSummary.forEach(d=>{t.addMonthSummary(d,n,i)});let r=Array.from(t.getQuarters()).map(([d,u])=>{let[g,_]=d.split("-"),b=Number(_.substr(1)),k=new Map;i.forEach(H=>{let ce=n.translateCategory(H),Ae=u.get(H)||0,ue=a.find(Ie=>Ie.name===_)?.series.find(Ie=>Ie.name===ce&&Ie.value!==0);if(k.has(ce)){let Ie=k.get(ce);Ie.value+=Ae}else{let Ie=Ae>0&&ue?.value?rt(Ae,ue.value,Vv):void 0;k.set(ce,{name:ce,value:Ae,color:n.getCategoryColor(H),suffixInfo:Ie})}});let M=Array.from(k.values());return{name:`T${b}`,series:M,tooltip:{title:`${n.translatePeriodYear("QUARTER")} ${b}, ${g}`}}}),s={colors:r.length>0?r[0].series.map(d=>d.color||""):[]};return["T1","T2","T3","T4"].forEach((d,u)=>{if(!r.find(_=>_.name===d)){let _=n.currentTransactionMonthSummary[0]?.monthSummaryKey.year,b=u<2?0:r.length;r.splice(b,0,{name:`${d}`,series:[],tooltip:{title:`${n.translatePeriodYear("QUARTER")} ${d}, ${_}`}})}}),{barStackChartData:r,barStackChartOptions:s}}static createPrevious(n,t){let i=new wo;n.previousTransactionMonthSummary.forEac
24h(s=>{i.addMonthSummary(s,n,t)});let o=Array.from(i.getQuarters()).map(([s,c])=>{let[d,u]=s.split("-"),g=Number(u.substr(1)),_=new Map;t.forEach(k=>{let M=n.translateCategory(k),H=c.get(k)||0;if(_.has(M)){let ce=_.get(M);ce.value+=H}else _.set(M,{name:M,value:H,color:n.getCategoryColor(k)})});let b=Array.from(_.values());return{name:`Q${g}`,series:b,tooltip:{title:`${n.translatePeriodYear("QUARTER")} ${g}, ${d}`}}}),r={colors:o.length>0?o[0].series.map(s=>s.color||""):[]};return{barStackChartData:o,barStackChartOptions:r}}},wo=class{constructor(){this._quarters=new Map}addMonthSummary(n,t,i){let a=n.monthSummaryKey.year,o=n.monthSummaryKey.month,r=Math.ceil(o/3),s=`${a}-Q${r}`,c=this._quarters.get(s);c||(c=new Map,this._quarters.set(s,c)),i.forEach(d=>{let u=n?.collaboratorSummary.getTotalCategorySummary(t.collaboratorsSelectedKeys)?.income.getAmountByCategory(d)?.value||0,g=c.get(d);g||(g=0);let _=g;c.set(d,_+u)})}getQuarterSummary(n,t){let i=`${n}-Q${t}`;return this._quarters.get(i)}getQuarters(){return this._quarters.entries()}};var Rv=!1,Ao=class e{static create(n){let t=new ko,i=Array.from(new Set(n.currentTransactionMonthSummary.flatMap(d=>d.collaboratorSummary.getTotalCategorySummary(n.collaboratorsSelectedKeys)?.income.getCategories()||[]))),a=n.previousTransactionMonthSummary.length>0?e.createPrevious(n,i)?.barStackChartData:[];
24n.currentTransactionMonthSummary.forEach(d=>{t.addMonthSummary(d,n,i)});let r=Array.from(t.getSemiAnnuals()).map(([d,u])=>{let[g,_]=d.split("-"),b=new Map;i.forEach(M=>{let H=n.translateCategory(M),ce=u.get(M)||0,fe=a.find(ue=>ue.name===_)?.series.find(ue=>ue.name===H&&ue.value!==0);if(b.has(H)){let ue=b.get(H);ue.value+=ce}else{let ue=ce>0&&fe?.value?rt(ce,fe.value,Rv):void 0;b.set(H,{name:H,value:ce,color:n.getCategoryColor(M),suffixInfo:ue})}});let k=Array.from(b.values());return{name:`${_}`,series:k,tooltip:{title:`${n.translatePeriodYear("SEMESTER")} ${_[_.length-1]}, ${g}`}}}),s={colors:r.length>0?r[0].series.map(d=>d.color||""):[]};return["S1","S2"].forEach((d,u)=>{if(!r.find(_=>_.name===d)){let _=n.currentTransactionMonthSummary[0]?.monthSummaryKey.year,b=u<1?0:r.length;r.splice(b,0,{name:`${d}`,series:[],tooltip:{title:`${n.translatePeriodYear("SEMESTER")} ${d}, ${_}`}})}}),{barStackChartData:r,barStackChartOptions:s}}static createPrevious(n,t){let i=new ko;n.previousTransactionMonthSummary.forEach(s=>{i.addMonthSummary(s,n,t)});let o=Array.from(i.getSemiAnnuals()).map(([s,c])=>{let[d,u]=s.split("-"),g=new Map;t.forEach(b=>{let k=n.translateCategory(b),M=c.get(b)||0;if(g.has(k)){let H=g.get(k);H.value+=M}else g.set(k,{name:k,value:M,color:n.getCategoryColor(b)})});let _=Array.from(g.values());return{name:`${u}`,series:_,tooltip:{title:`${n.translatePeriodYear("SEMESTER")} ${u[u.length-1]}, ${d}`}}}),r={colors:o.length>0?o[0].series.map(s=>s.color||""):[]};return{barStackChartData:o,barStackChartOptions:r}}},ko=class{constructor(){this._semiAnnuals=new Map}addMonthSummary(n,t,i){let a=n.monthSummaryKey.year,o=n.monthSummaryKey.month,r=Math.ceil(o/6),s=`${a}-S${r}`,c=this._semiAnnuals.get(s);c||(c=new Map,this._semiAnnuals.set(s,c)),i.forEach(d=>{let u=n?.collaboratorSummary.getTotalCategorySummary(t.collaboratorsSelectedKeys)?.income.getAmountByCategory(d)?.value||0,g=c.get(d);g||(g=0);let _=g;c.set(d,_+u)})}getSemiAnnualSummary(n,t){let i=`${n}-S${t}`;return this._semiAnnuals.get(i)}getSemiAnnuals(){return this._semiAnnuals.entries()}};var Do=class{static create(n,t){return n===Ge.MONTHLY?To.create(t):n===Ge.QUARTERLY?So.create(t):Ao.create(t)}};function Nv(e,n){e&1&&(m(0,"vedius-text",12),v(1),x(2,"translate"),h()),e&2&&(l(),T(" ",S(2,1,"DASHBOARD_PAGE.FINANCIAL_BALANCES.HEADER.PERCENTAGE")," "))}function Gv(e,n){if(e&1&&(m(0,"div",14)(1,"div",15)(2,"vedius-text",16),v(3),x(4,"translate"),h()(),m(5,"div",17)(6,"vedius-text",12),v(7),x(8,"translate"),h(),C(9,Nv,3,3,"vedius-text",18),h()()),e&2){let t=f(2);l(3),T(" ",S(4,3,"DASHBOARD_PAGE.FINANCIAL_BALANCES.HEADER.LABEL")," "),l(4),T(" ",S(8,5,"DASHBOARD_PAGE.FINANCIAL_BALANCES.HEADER.VALUE")," "),l(2),p("ngIf",t.hasPercentageInfo)}}function zv(e,n){if(e&1&&(m(0,"vedius-text",21),v(1),h()),e&2){let t=f(2).$implicit;X("positive",t.percentage.value>10)("negative",t.percentage.value<-10),l(),T(" ",t.percentage.format," ")}}function Hv(e,n){if(e&1&&(m(0,"div",19),C(1,zv,2,5,"vedius-text",20),h()),e&2){let t=f().$implicit;l(),p("ngIf",t.percentage)}}function jv(e,n){if(e&1&&(P(0),C(1,Gv,10,7,"div",6),m(2,"div",7)(3,"div",8),w(4,"span",9),m(5,"span",10),v(6),h()(),m(7,"div",11)(8,"vedius-text",12),v(9),x(10,"vediusCurrency"),h(),C(11,Hv,2,1,"div",13),h()(),E()),e&2){let t=n.$implicit,i=n.index,a=n.last,o=f();l(),p("ngIf",i===0),l(),X("last-item",a),l(2),Fe("background",t.color),l(2),W(t.label),l(3),T(" ",S(10,8,t.value)," "),l(2),p("ngIf",o.hasPercentageInfo)}}function Yv(e,n){if(e&1){let t=I();m(0,"vedius-button",22),A("onClick",function(){D(t);let a=f();return L(a.seeAllLegends())}),v(1),x(2,"translate"),h()}e&2&&(p("fullSize",!0),l(),W(S(2,2,"DASHBOARD_PAGE.FINANCIAL_BALANCES.SEE_MORE")))}function $v(e,n){if(e&1){let t=I();m(0,"vedius-button",23),A("onClick",function(){D(t);let a=f();return L(a.dontSeeAllLegends())}),v(1),x(2,"translate"),h()}e&2&&(p("fullSize",!0),l(),T(" ",S(2,2,"DASHBOARD_PAGE.FINANCIAL_BALANCES.SEE_LESS"),""))}var Hr=(()=>{let n=class n{constructor(i,a){this.translate=i,this.cdr=a,this.calendarSettings=[],this.currentTransactionMonthSummary=[],this.previousTransactionMonthSummary=[],this.collaboratorsSelected=[],this.isSmall=!1,this.barStackChartData=[],this.allMonthsLabels=[],this.hasPercentageInfo=!1,this.maxDisplayedLegends=5,this.legendsDisplayed=[],this.legends=[]}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}get isSeeAllLegends(){return this.legends.length>0&&this.legends.length===this.legendsDisplayed.length}get isLegendsGreaterThanMaximumAllowed(){return this.legends.length>this.maxDisplayedLegends}ngOnInit(){this.translate.loaded().then(()=>{this.allMonthsLabels=Aa.map(i=>this.translate.get(`MONTHS.${i}`))}),setTimeout(()=>{this.load(),this.cdr.detectChanges()},50)}load(){this.currentTransactionMonthSummary&&this.collaboratorsSelected.length&&this.dashboardPeriodSelectorType?this.populateData():setTimeout(()=>{this.barStackChartData=[],this.barStackChartOptions=void 0,this.cdr.detectChanges()})}
24onChangePeriod(i){this.dashboardPeriodSelectorType=i,setTimeout(()=>{this.populateMonthsChart(),this.cdr.detectChanges()})}populateData(){setTimeout(()=>{this.populateMonthsChart(),this.populateLegends(),this.cdr.detectChanges()})}populateMonthsChart(){if(this.dashboardPeriodSelectorType){let i=Do.create(this.dashboardPeriodSelectorType,this);setTimeout(()=>{this.barStackChartData=i.barStackChartData,this.barStackChartOptions=i.barStackChartOptions,this.cdr.detectChanges()})}}populateLegends(){setTimeout(()=>{this.populateLegendsYear(),this.hasPercentageInfo=this.legendsDisplayed.some(i=>!!i.percentage),this.cdr.detectChanges()})}seeAllLegends(){setTimeout(()=>{this.legendsDisplayed=this.legends,this.cdr.detectChanges()})}dontSeeAllLegends(){setTimeout(()=>{this.legendsDisplayed=this.legends.slice(0,this.maxDisplayedLegends),this.cdr.detectChanges()})}populateLegendsYear(){let i=Co.create(this);setTimeout(()=>{this.legendsDisplayed=i.slice(0,this.maxDisplayedLegends),this.legends=i,this.cdr.detectChanges()})}translateCategory(i){return ps(i,sl)?this.translate.get(`TRANSACTION_CATEGORY.${i}`):i}getCategoryColor(i){let a=this.translate.get(`TRANSACTION_CATEGORY.${i}`),o=this.calendarSettings.map(r=>r.customScheduleTypeSettings).find(r=>!!r.getValueByKey(a))?.getValueByKey(a)?.colorOption;if(o)return o.color;{let r=this.calendarSettings.map(s=>s.customScheduleTypeSettings).find(s=>!!s.getValueByKey(i));if(r)return r.getValueByKey(i).colorOption?.color}return ll[i]}translatePeriodYear(i){return this.translate.get(`${U.DashboardYearPeriodSelectorLabel}.${i}`)}};n.\u0275fac=function(a){return new(a||n)(y(ae),y(Oe))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-financial-balances-bar-stack-chart"]],inputs:{calendarSettings:"calendarSettings",currentTransactionMonthSummary:"currentTransactionMonthSummary",previousTransactionMonthSummary:"previousTransactionMonthSummary",collaboratorsSelected:"collaboratorsSelected",dashboardPeriodSelectorType:"dashboardPeriodSelectorType",isSmall:"isSmall"},decls:6,vars:7,consts:[[1,"vedius-bar-stack-chart-component"],["type","bar-stack","typeView","amount",3,"barStackChartData","barStackChartOptions","barPadding","animations"],[1,"legends-bar-stack"],[4,"ngFor","ngForOf"],["class","see-all-legends-button","variant","secondary","size","small",3,"fullSize","onClick",4,"ngIf"],["class","dont-see-all-button","variant","secondary","size","small",3,"fullSize","onClick",4,"ngIf"],["class","legend-item-header",4,"ngIf"],[1,"legend-item-content"],[1,"legend-label-content"],[1,"dot-legend"],[1,"legend-label"],[1,"legend-values"],["variant","text","size","sm",1,"neutral-dusk-color"],["class","percentage-content",4,"ngIf"],[1,"legend-item-header"],[1,"header-label"],["variant","text","size","sm",1,"neutral-darker-color"],[1,"header-values"],["class","neutral-dusk-color","variant","text","size","sm",4,"ngIf"],[1,"percentage-content"],["class","percentage-label-content","variant","text","size","micro","weight","bold",3,"positive","negative",4,"ngIf"],["variant","text","size","micro","weight","bold",1,"percentage-label-content"],["variant","secondary","size","small",1,"see-all-legends-button",3,"onClick","fullSize"],["variant","secondary","size","small",1,"dont-see-all-button",3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"div",0),w(1,"vedius-bar-stack-chart",1),m(2,"div",2),C(3,jv,12,10,"ng-container",3)(4,Yv,3,4,"vedius-button",4)(5,$v,3,4,"vedius-button",5),h()()),a&2&&(l(),p("barStackChartData",o.barStackChartData)("barStackChartOptions",o.barStackChartOptions)("barPadding",o.isSmall?8:24)("animations",!0),l(2),p("ngForOf",o.legendsDisplayed),l(),p("ngIf",!o.isSeeAllLegends),l(),p("ngIf",o.isSeeAllLegends&&o.isLegendsGreaterThanMaximumAllowed))},dependencies:[bo,le,z,j,re,$,Y,Hi],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.vedius-bar-stack-chart-component{display:flex;flex-direction:column;align-items:flex-start;gap:24px;align-self:stretch;width:100%;overflow-x:hidden}.vedius-bar-stack-chart-component .neutral-dusk-color{color:#192840}.vedius-bar-stack-chart-component .neutral-darker-color{color:#425168}.vedius-bar-stack-chart-component vedius-bar-stack-chart{display:block;width:100%}.vedius-bar-stack-chart-component .legends-bar-stack{display:flex;flex-direction:column;align-items:flex-start;width:100%}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-header{width:100%;display:flex;align-items:flex-start;align-self:stretch;padding:12px;border-bottom:1px solid #d3dae5;box-sizing:border-box}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-header .header-label{display:flex;justify-content:flex-start;align-items:center;flex:1 0 0}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-header .header-values{display:flex;justify-content:flex-end;align-items:center;gap:24px;min-width:50px}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content{display:flex;align-items:flex-start;align-self:stretch;padding:12px;border-bottom:1px solid #d3dae5}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content.last-item{border-bottom:none}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-label-content{display:flex;justify-content:center;align-items:center;gap:8px;flex:1 0 0}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-label-content .dot-legend{width:8px;height:8px;border-radius:100px}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-label-content .legend-label{flex:1 0 0;color:#425168;font-family:DM Sans;font-size:.875rem;font-style:normal;font-weight:500;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-values{display:flex;justify-content:flex-end;align-items:center;gap:24px}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-values .percentage-content{min-width:50px}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-values .percentage-content .percentage-label-content{display:flex;justify-content:flex-end;align-items:center;color:#425168}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-values .percentage-content .percentage-label-content.positive{color:#12b76a}.vedius-bar-stack-chart-component .legends-bar-stack .legend-item-content .legend-values .percentage-content .percentage-label-content.negative{color:#f03838}.vedius-bar-stack-chart-component .see-all-legends-button,.vedius-bar-stack-chart-component .dont-see-all-button{margin-top:20px;width:100%} 25`],encapsulation:2});let e=n;return e})();var Em=(()=>{let n=class n{constructor(){this.modal=null}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-financial-balances-info-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:13,vars:10,consts:[[1,"dashboard-financial-balances-info-modal"],[1,"title"],[1,"financial-balances-info-content"],["variant","text","size","md","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"bottom"],[3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"div",2)(6,"vedius-text",3),v(7),x(8,"translate"),h()(),m(9,"div",4)(10,"vedius-button",5),A("onClick",function(){return o.close()}),v(11),x(12,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,4,"DASHBOARD_PAGE.MODA
25L_INFO.FINANCIAL_BALANCES.TITLE")," "),l(4),T(" ",S(8,6,"DASHBOARD_PAGE.MODAL_INFO.FINANCIAL_BALANCES.DESCRIPTION"),""),l(3),p("fullSize",!0),l(),T(" ",S(12,8,"BUTTONS.UNDERSTOOD"),""))},dependencies:[q,j,re,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-financial-balances-info-modal{display:flex;flex-direction:column;gap:24px}.dashboard-financial-balances-info-modal .neutral-dusk-color{color:#192840}.dashboard-financial-balances-info-modal .neutral-darker-color{color:#425168}.dashboard-financial-balances-info-modal .loader{width:100%}.dashboard-financial-balances-info-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:0;max-width:400px}.dashboard-financial-balances-info-modal .bottom{width:100%;margin-top:16px}.dashboard-financial-balances-info-modal .bottom vedius-button{width:100%}@media screen and (max-width: 600px){.dashboard-financial-balances-info-modal .title{font-size:1.25rem;line-height:1.875rem;margin:12px 0 0;max-width:300px}} 26`],encapsulation:2});let e=n;return e})();var Wv=()=>({height:"42px"}),Xv=()=>({height:"64px"}),Uv=()=>({height:"500px"});function Qv(e,n){if(e&1){let t=I();m(0,"vedius-collaborator-selection-button",18),x(1,"translate"),x(2,"translate"),A("onFilterSelect",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))})("onLoad",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))}),h()}if(e&2){let t=f();X("hidden",!t.isOwner),ee("defaultLabel",S(1,6,"DASHBOARD_PAGE.DEFAULT_PROFESSIONAL_LABEL")),ee("labelForFullSelection",S(2,8,"DASHBOARD_PAGE.ALL_PROFESSIONAL_SELECTED")),p("type",t.isSmall?"modal":"dropdown")("maxLabels",1)}}function qv(e,n){if(e&1&&(P(0),m(1,"vedius-text",19),v(2),h(),m(3,"vedius-text",20),v(4),x(5,"vediusCurrencyOnlyNumber"),h(),E()),e&2){let t=f();l(2),W(t.currencySymbol),l(2),W(S(5,2,t.total))}}function Kv(e,n){e&1&&w(0,"ngx-skeleton-loader",21),e&2&&p("count",1)("theme",Q(2,Wv))}function Zv(e,n){if(e&1&&(m(0,"div",22)(1,"vedius-text",23),v(2),h()()),e&2){let t=f();X("positive",t.totalPercentageDifference>0)("negative",t.totalPercentageDifference<0),l(2),W(t.totalPercentageDifferenceFormatted)}}function Jv(e,n){if(e&1&&w(0,"app-dashboard-financial-balances-bar-stack-chart",24),e&2){let t=f();p("calendarSettings",t.calendarSettings)("currentTransactionMonthSummary",t.currentTransactionMonthSummary)("previousTransactionMonthSummary",t.previousTransactionMonthSummary)("collaboratorsSelected",t.collaboratorsSelected)("dashboardPeriodSelectorType",t.dashboardPeriodSelectorTypeSelected)("isSmall",t.isSmall)}}function eb(e,n){e&1&&w(0,"ngx-skeleton-loader",25),e&2&&p("count",4)("theme",Q(2,Xv))}function tb(e,n){e&1&&Ce(0)}function ib(e,n){if(e&1&&(P(0),C(1,tb,1,0,"ng-container",26),E()),e&2){f();let t=he(25);l(),p("ngTemplateOutlet",t)}}function nb(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",25),E()),e&2&&(l(),p("count",1)("theme",Q(2,Uv)))}function ab(e,n){e&1&&(m(0,"div",27),w(1,"img",28),m(2,"vedius-text",29),v(3),x(4,"translate"),h()()),e&2&&(l(3),T(" ",S(4,1,"DASHBOARD_PAGE.FINANCIAL_BALANCES.EMPTY_DESCRIPTION")," "))}var Mm=(()=>{let n=class n{constructor(i,a,o,r,s,c,d,u){this.userVediusContext=i,this.translate=a,this.currencySymbolFactoryService=o,this.financeTransactionMonthSummaryService=r,this.financeTransactionYearSummaryService=s,this.calendarSettingsService=c,this.financeChangedService=d,this.dialog=u,this.isSmall=!1,this.loadingDelay=0,this.isLoading=!0,this.collaboratorsSelected=[],this.isFirstLoading=!0,this.loadedTranslation=!1,this.currencySymbol="",this.calendarSettings=[],this.year=new Date().getFullYear(),this.yearOptions=[],this.currentTransactionMonthSummary=[],this.previousTransactionMonthSummary=[],this.dashboardPeriodSelectorTypeSelected=Ge.MONTHLY,this.subscriptions=[],this.initialLoadSubject=ne
26w we,this.destroy$=new we,this.currencySymbol=this.currencySymbolFactoryService.create()}get userVedius(){return this.userVediusContext.current}get isClinicUser(){return this.userVedius.type===_e.Clinic}get total(){return this.currentReceivableAmount?.value||0}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}get isOwner(){return this.userVedius.type===_e.Clinic?this.userVedius.hasAnyOwnerRoleType():!0}ngOnInit(){this.startInitialSubjectLoad(),this.translate.loaded().then(()=>{this.loadedTranslation=!0,this.observables()}),this.isClinicUser||(this.isLoading=!0,this.collaboratorsSelected=[this.userVedius],this.initialLoadSubject.next())}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}observables(){let i=this.financeChangedService.listenChange().pipe(Ve(1e3)).subscribe(a=>{!a||a.actionType!==ha.Updated||this.initialLoadSubject.next()});this.subscriptions=[i]}onCollaboratorLoaded(i){this.onCollaboratorSelect(i)}onCollaboratorSelect(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),this.initialLoadSubject.next()}onYearChange(i){this.year!==i&&(this.year=i,this.load())}onPeriodSelectorTabChanged(i){i!==this.dashboardPeriodSelectorTypeSelected&&(this.dashboardPeriodSelectorTypeSelected=i,this.dashboardFinancialBalancesBarStackChartComponent?.onChangePeriod(this.dashboardPeriodSelectorTypeSelected))}load(i=!0){return B(this,null,function*(){try{i&&(this.isLoading=!0),this.totalPercentageDifference=void 0;let a=yield this.financeTransactionYearSummaryService.getAllYearSummaryKeys();this.yearOptions=a.map(c=>c.value),this.year=this.yearOptions.includes(this.year)?this.year:this.yearOptions[0]||this.year,this.currentPeriod=De.fromYear(this.year),this.previousPeriod=De.fromYear(this.year-1);let[o,r,s]=yield Promise.all([this.financeTransactionMonthSummaryService.getAllByPeriod({period:this.currentPeriod}),this.financeTransactionMonthSummaryService.getAllByPeriod({period:this.previousPeriod}),this.calendarSettingsService.getMany({userVediusKeys:this.collaboratorsSelectedKeys})]);this.calendarSettings=s,this.currentTransactionMonthSummary=o,this.previousTransactionMonthSummary=r,this.populateTotalAmount()}catch(a){console.error("Error to load financial balances: ",a)}finally{this.isLoading=!1,this.isFirstLoading=!1}})}openInfo(){this.dialog.open(Em,{width:"600px"})}populateTotalAmount(){let i=this.currentTransactionMonthSummary.reduce((o,r)=>{let s=r.collaboratorSummary.getTotalBalanceSummary(this.collaboratorsSelectedKeys).income.value;return o+(s||0)},0);this.currentReceivableAmount=Tt.fromNumber(i);let a=this.previousTransactionMonthSummary.reduce((o,r)=>{let s=r.collaboratorSummary.getTotalBalanceSummary(this.collaboratorsSelectedKeys).income.value;return o+(s||0)},0);this.previousReceivableAmount=Tt.fromNumber(a),this.totalPercentageDifference=this.previousReceivableAmount.value===0?void 0:Qt(this.currentReceivableAmount.value,this.previousReceivableAmount?.value),this.totalPercentageDifferenceFormatted=this.previousReceivableAmount.value===0?"":rt(this.currentReceivableAmount.value,this.previousReceivableAmount?.value)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.subscriptions.forEach(i=>i.unsubscribe())}};n.\u0275fac=function(a){return new(a||n)(y(Te),y(ae),y(Fa),y(Ra),y(tc),y(Kt),y(ua),y(He))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-financial-balances"]],viewQuery:function(a,o){if(a&1&&ne(Hr,5),a&2){let r;te(r=ie())&&(o.dashboardFinancialBalancesBarStackChartComponent=r.first)}},inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:26,vars:21,consts:[["emptyFinancialBalances",""],[1,"dashboard-financial-balances-component"],[1,"financial-balances-header-info"],[1,"left-header-info"],["variant","text","size","md",1,"neutral-dusk-color"],["svgIcon","help-info",1,"help-icon",3,"click"],[1,"right-header-info"],["size","small",3,"hidden","type","maxLabels","defaultLabel","labelForFullSelection","onFilterSelect","onLoad",4,"ngIf"],[3,"yearChanged","year","options"],[3,"onChange","initialActivated"],[1,"financial-balances-sub-header-info"],["variant","text","size","sm",1,"color-neutral-dark"],[1,"result-value"],[4,"ngIf"],["class","loader","style","width: 150px; margin-top: 8px",3,"count","theme",4,"ngIf"],["class","percentage-difference-label",3,"positive","negative",4,"ngIf"],[3,"calendarSettings","currentTransactionMonthSummary","previousTransactionMonthSummary","collaboratorsSelected","dashboardPeriodSelectorType","isSmall",4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],["size","small",3,"onFilterSelect","onLoad","type","maxLabels","defaultLabel","labelForFullSelection"],["variant","text","size","xl",1,"color-neutral-dark"],["variant","display","size","md",1,"color-neutral-dusk","value"],[1,"loader",2,"width","150px","margin-top","8px",3,"count","theme"],[1,"percentage-difference-label"],["variant","text","size","micro"],[3,"calendarSettings","currentTransactionMonthSummary","previousTransactionMonthSummary","collaboratorsSelected","dashboardPeriodSelectorType","isSmall"],[1,"loader",3,"count","theme"],[4,"ngTemplateOutlet"],[1,"empty-content"],["src","../../../../../../assets/images/financial-balances-empty.svg","alt","empty-state"],["variant","text","size","sm",1,"empty-description","neutral-darker-color"]],template:function(a,o){if(a&1){let r=I();m(0,"div",1),P(1),m(2,"div",2)(3,"div",3)(4,"vedius-text",4),v(5),x(6,"translate"),h(),m(7,"mat-icon",5),A("click",function(){return D(r),L(o.openInfo())}),h()(),m(8,"div",6),C(9,Qv,3,10,"vedius-collaborator-selection-button",7),m(10,"vedius-year-selector-button",8),A("yearChanged",function(c){return D(r),L(o.onYearChange(c))}),h()()(),m(11,"app-dashboard-year-period-selector-tab-group",9),A("onChange",function(c){return D(r),L(o.onPeriodSelectorTabChanged(c))}),h(),m(12,"div",10)(13,"vedius-text",11),v(14),x(15,"translate"),h(),m(16,"div",12),C(17,qv,6,4,"ng-container",13)(18,Kv,1,3,"
26ngx-skeleton-loader",14),h(),C(19,Zv,3,5,"div",15),h(),C(20,Jv,1,6,"app-dashboard-financial-balances-bar-stack-chart",16)(21,eb,1,3,"ngx-skeleton-loader",17)(22,ib,2,1,"ng-container",13),E(),h(),C(23,nb,2,3,"ng-container",13)(24,ab,5,3,"ng-template",null,0,me)}a&2&&(X("hidden",o.isLoading&&o.isFirstLoading)("small",o.isSmall),l(5),T(" ",S(6,17,"DASHBOARD_PAGE.FINANCIAL_BALANCES.TITLE")," "),l(4),p("ngIf",o.isClinicUser&&o.loadedTranslation),l(),p("year",o.year)("options",o.yearOptions),l(),p("initialActivated",o.dashboardPeriodSelectorTypeSelected),l(3),W(S(15,19,"DASHBOARD_PAGE.FINANCIAL_BALANCES.RESULT_TITLE")),l(3),p("ngIf",!o.isLoading),l(),p("ngIf",o.isLoading),l(),p("ngIf",o.totalPercentageDifference),l(),p("ngIf",!o.isLoading&&o.total!==0),l(),p("ngIf",o.isLoading),l(),p("ngIf",o.total===0&&!o.isLoading),l(),p("ngIf",o.isLoading&&o.isFirstLoading))},dependencies:[j,et,z,mt,ec,Pm,Ee,Pe,Hr,ze,$,Y,Oa],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-financial-balances-component{display:flex;padding:24px;flex-direction:column;gap:24px;align-self:stretch;min-height:400px;border-radius:12px;background:#fff;border:1px solid #f5f6f8;position:relative;overflow-x:hidden}.dashboard-financial-balances-component.hidden{display:none!important}.dashboard-financial-balances-component .loader{width:100%}.dashboard-financial-balances-component .color-neutral-dusk{color:#192840}.dashboard-financial-balances-component .color-neutral-dark{color:#6d7a8e}.dashboard-financial-balances-component .financial-balances-header-info{display:flex;justify-content:space-between;align-items:center;align-self:stretch;min-width:0;gap:12px}.dashboard-financial-balances-component .financial-balances-header-info .left-header-info{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.dashboard-financial-balances-component .financial-balances-header-info .left-header-info .help-icon{width:16px;height:16px}.dashboard-financial-balances-component .financial-balances-header-info .left-header-info .help-icon:hover{cursor:pointer;opacity:.8}.dashboard-financial-balances-component .financial-balances-header-info .right-header-info{display:flex;align-items:center;gap:24px;min-width:0;flex:0 1 auto;max-width:100%;justify-content:flex-end}.dashboard-financial-balances-component .financial-balances-header-info .right-header-info .hidden{display:none}.dashboard-financial-balances-component .financial-balances-header-info .right-header-info vedius-collaborator-selection-button{width:200px;max-width:100%;display:flex;min-width:0}.dashboard-financial-balances-component .financial-balances-sub-header-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:4px}.dashboard-financial-balances-component .financial-balances-sub-header-info .result-value{display:flex;align-items:baseline;gap:8px}.dashboard-financial-balances-component .financial-balances-sub-header-info .result-value .value span{line-height:40px;letter-spacing:-.64px}.dashboard-financial-balances-component .financial-balances-sub-header-info .percentage-difference-label{display:flex;padding:2px 8px 2px 6px;justify-content:center;align-items:center;gap:4px;border-radius:16px}.dashboard-financial-balances-component .financial-balances-sub-header-info .percentage-difference-label.positive{background:#e6fff1}.dashboard-financial-balances-component .financial-balances-sub-header-info .percentage-difference-label.positive vedius-text{color:#095c35}.dashboard-financial-balances-component .financial-balances-sub-header-info .percentage-difference-label.negative{background:#ffe6e6}.dashboard-financial-balances-component .financial-balances-sub-header-info .percentage-difference-label.negative vedius-text{color:#781c1c}.dashboard-financial-balances-component .neutral-day-color{color:#fff}.dashboard-financial-balances-component .neutral-dusk-color{color:#192840}.dashboard-financial-balances-component .neutral-medium-color{color:#96a0b0}.dashboard-financial-balances-component .neutral-dark-color{color:#6d7a8e}.dashboard-financial-balances-component .neutral-darker-color{color:#425168}.dashboard-financial-balances-component .empty-content{display:flex;flex-direction:column;align-items:center;gap:4px;box-sizing:border-box}.dashboard-financial-balances-component .empty-content .empty-description{text-align:center;width:280px;max-width:100%;box-sizing:border-box}.dashboard-financial-balances-component .empty-content img{max-width:150px;max-height:150px}.dashboard-financial-balances-component.small{border-radius:8px}.dashboard-financial-balances-component.small app-dashboard-financial-balances-bar-stack-chart{display:block;width:100%}.dashboard-financial-balances-component.small .financial-balances-header-info{flex-wrap:wrap;align-items:flex-start;gap:16px}.dashboard-financial-balances-component.small .financial-balances-header-info .right-header-info{flex:1 1 100%;max-width:100%;gap:12px;justify-content:flex-end}.dashboard-financial-balances-component.small .financial-balances-header-info .right-header-info vedius-collaborator-selection-button,.dashboard-financial-balances-component.small .financial-balances-header-info .right-header-info vedius-year-selector-button{width:100%;max-width:100%} 27`],encapsulation:2});let e=n;return e})();var ob=e=>({plural_client_treatment_type:e}),Om=(()=>{let n=class n{constructor(i){this.appContext=i,this.modal=null}get isPatientTreatmentType(){return this.appContext.getUserCredential()?.userVedius?.clientTreatmentType===xe.PATIENT}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(Le))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-recruitment-info-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:18,vars:20,consts:[[1,"dashboard-recruitment-info-modal"],[1,"title"],[1,"recruitment-info-content"],["variant","text","size","md","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"bottom"],[3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),x(5,"translate"),x(6,"translate"),h(),m(7,"div",2)(8,"vedius-text",3),v(9),x(10,"translate"),h(),m(11,"vedius-text",3),v(12),x(13,"translate"),h()(),m(14,"div",4)(15,"vedius-button",5),A("onClick",function(){return o.close()}),v(16),x(17,"translate"),h()()()()),a&2&&(l(3),T(" ",F(6,9,"DASHBOARD_PAGE.MODA
27L_INFO.RECRUITMENT_DATA.TITLE",V(18,ob,o.isPatientTreatmentType?S(4,5,"PATIENTS"):S(5,7,"STUDENTS")))," "),l(6),T(" ",S(10,12,"DASHBOARD_PAGE.MODAL_INFO.RECRUITMENT_DATA.DESCRIPTION_1"),""),l(3),T(" ",S(13,14,"DASHBOARD_PAGE.MODAL_INFO.RECRUITMENT_DATA.DESCRIPTION_2"),""),l(3),p("fullSize",!0),l(),T(" ",S(17,16,"BUTTONS.UNDERSTOOD"),""))},dependencies:[q,j,re,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-recruitment-info-modal{display:flex;flex-direction:column;gap:24px}.dashboard-recruitment-info-modal .neutral-dusk-color{color:#192840}.dashboard-recruitment-info-modal .neutral-darker-color{color:#425168}.dashboard-recruitment-info-modal .loader{width:100%}.dashboard-recruitment-info-modal .recruitment-info-content{display:flex;flex-direction:column;width:100%;gap:24px}.dashboard-recruitment-info-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:0;max-width:400px}.dashboard-recruitment-info-modal .bottom{width:100%;margin-top:16px}.dashboard-recruitment-info-modal .bottom vedius-button{width:100%}@media screen and (max-width: 600px){.dashboard-recruitment-info-modal .title{font-size:1.25rem;line-height:1.875rem;margin:12px 0 0;max-width:300px}} 28`],encapsulation:2});let e=n;return e})();var rb=()=>({fractionDigits:1});function sb(e,n){if(e&1&&(P(0),m(1,"div",5),w(2,"vedius-dot-palette",6),m(3,"vedius-text",7),v(4),x(5,"percentageFormat"),h(),m(6,"vedius-text",8),v(7),h()(),E()),e&2){let t=n.$implicit;l(2),p("color",t.color),l(2),T(" ",F(5,3,t.percentage,Q(6,rb))," "),l(3),T(" ",t.label," ")}}var Im=(()=>{let n=class n{constructor(i){this.translation=i,this.patientInfos=[],this.isMobile=!1,this.data=[],this.legends=[],this.colorMap=new Map([[R.Patient_Student_Referral,"#FFC673"],[R.Friend_Family_Referral,"#FFC673"],[R.Social_Media_Facebook,"#73ABFF"],[R.Social_Media_Instagram,"#73ABFF"],[R.Social_Media_TikTok,"#73ABFF"],[R.Social_Media_Youtube,"#73ABFF"],[R.Social_Media_Linkedin,"#73ABFF"],[R.Google,"#73D9FF"],[R.Health_Event,"#73EEAF"],[R.Flyer,"#73EEAF"],[R.Television_Ad,"#73EEAF"],[R.Billboard_Ad,"#73EEAF"],[R.Newspaper_Ad,"#73EEAF"],[R.Radio_Ad,"#73EEAF"],[R.Walking_Down_The_Street,"#73EEAF"],[R.Other,"#D3DAE5"],["NOT_INFORMED","#D3DAE5"]]),this.isMobile=Ut()}ngOnChanges(i){i.patientInfos?.currentValue&&this.setChartData()}setChartData(){if(!this.patientInfos)return;let i=this.patientInfos.length,a=0,o={[R.Patient_Student_Referral]:0,[R.Friend_Family_Referral]:0,[R.Social_Media_Facebook]:0,[R.Social_Media_Instagram]:0,[R.Social_Media_TikTok]:0,[R.Social_Media_Youtube]:0,[R.Social_Media_Linkedin]:0,[R.Google]:0,[R.Health_Event]:0,[R.Flyer]:0,[R.Television_Ad]:0,[R.Billboard_Ad]:0,[R.Newspaper_Ad]:0,[R.Radio_Ad]:0,[R.Walking_Down_The_Street]:0,[R.Other]:0},r={[oe.Acupuncturist]:0,[oe.Social_Worker]:0,[oe.Audiologist]:0,[oe.Biomedical]:0,[oe.Biologist]:0,[oe.Dentist]:0,[oe.Physical_Education_Teacher]:0,[oe.Nurse]:0,[oe.Pharmacist]:0,[oe.Physiotherapist]:0,[oe.Speech_Therapist]:0,[oe.Doctor]:0,[oe.Veterinary_Doctor]:0,[oe.Nutritionist]:0,[oe.Odontologist]:0,[oe.Podiatrist]:0,[oe.Psychologist]:0,[oe.Occupational_Therapist]:0};this.patientInfos.forEach(u=>{u.howYouMetMe&&u.howYouMetMe in o&&o[u.howYouMetMe]++,u.indicationInfo&&u.indicationInfo.type in r&&r[u.indicationInfo.type]++,u.howYouMetMe===void 0&&u.indicationInfo===void 0&&a++});let s=Object.keys(o).map(u=>{let g=u,_=o[g],b=Be(_/i*100,1);return{key:g,label:this.howYouMetMeTranslation(g),percentage:b,color:this.colorMap.get(g)||""}}),c=Object.keys(r).map(u=>{let g=u,_=r[g],b=Be(_/i*100,1);return{key:g,label:this.indicaitonTypeTranslation(g),percentage:b,color:"#70BBC8"}}),d=[...s,...c];if(d=d.sort((u,g)=>g.percentage-u.percentage),a>0){let u="NOT_INFORMED",_=Be(a/i*100,1),b={key:u,label:this.howYouMetMeTranslation(u),percentage:_,color:this.colorMap.get(u)||""};d.push(b)}this.legends=d.filter(u=>u.percentage>0),this.data=this.legends.map(u=>({id:u.key,label:u.label,data:[{color:u.color,value:u.percentage}],hideTooltip:!0}))}howYouMetMeTranslation(i){return this.translation.get(`${U.HowYouMetMeType}.${i?.toUpperCase()}`)}indicaitonTypeTranslation(i){return this.translation.get(`${U.IndicationType}.${i?.toUpperCase()}`)}};n.\u0275fac=function(a){return new(a||n)(y(ae))},n.\u0275cmp=O({type:n,selectors:[["app-patient-recruitment-chart-data"]],inputs:{patientInfos:"patientInfos"},features:[ye],decls:5,vars:5,consts:[["data-testid","recruitment-donut",1,"patient-recruitment-chart-data"],[1,"recruitment-chart-content"],["type","donut",3,"donutWidth","donutHeight","forceSize","data"],[1,"recruitment-legends"],[4,"ngFor","ngForOf"],[1,"recruitment-legend-item"],["size","small",3,"color"],["variant","text","size","sm",1,"neutral-dusk-color"],["variant","text","size","micro",1,"neutral-darker-color"]],template:function(a,o){a&1&&(m(0,"div",0)(1,"div",1),w(2,"vedius-chart",2),m(3,"div",3),C(4,sb,8,7,"ng-container",4),h()()()),a&2&&(l(2),p("donutWidth",o.isMobile?200:250)("donutHeight",o.isMobile?200:250)("forceSize",!0)("data",o.data),l(2),p("ngForOf",o.legends))},dependencies:[ka,le,Jt,j,tt],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
28-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.patient-recruitment-chart-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;border-radius:8px;background-color:#fff;width:100%;overflow:hidden}.patient-recruitment-chart-data[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.patient-recruitment-chart-data[_ngcontent-%COMP%] .neutral-darker-color[_ngcontent-%COMP%]{color:#425168}.patient-recruitment-chart-data[_ngcontent-%COMP%] .recruitment-chart-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:center;flex-wrap:wrap;row-gap:16px;overflow:hidden}.patient-recruitment-chart-data[_ngcontent-%COMP%] .recruitment-chart-content[_ngcontent-%COMP%] vedius-chart[_ngcontent-%COMP%]{pointer-events:none;width:250px;max-width:100%}.patient-recruitment-chart-data[_ngcontent-%COMP%] .recruitment-chart-content[_ngcontent-%COMP%] .recruitment-legends[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:16px;min-width:160px;max-width:100%}.patient-recruitment-chart-data[_ngcontent-%COMP%] .recruitment-chart-content[_ngcontent-%COMP%] .recruitment-legends[_ngcontent-%COMP%] .recruitment-legend-item[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}"]});let e=n;return e})();var lb=e=>({indication_type:e}),cb=()=>({fractionDigits:1}),db=(e,n)=>({number:e,color:n}),pb=e=>[e];function mb(e,n){if(e&1&&(m(0,"div",13)(1,"vedius-text",14),v(2),x(3,"translate"),h(),m(4,"vedius-text",15),v(5),h(),m(6,"vedius-text",16),v(7," % "),h()()),e&2){let t=f(2);l(2),T(" ",S(3,3,"DASHBOARD_PAGE.RECRUITMENT_DATA.LIST_TITLE")," "),l(3),pi(" ",t.treatmentTypeLabel," (",t.patientInfos.length,") ")}}function hb(e,n){if(e&1){let t=I();m(0,"vedius-button",17),A("onClick",function(){D(t);let a=f().$implicit,o=f();return L(o.onSendWhatsapp(a.phone))}),h()}e&2&&p("withStroke",!1)}function ub(e,n){if(e&1&&(P(0),C(1,mb,8,5,"div",5),m(2,"div",6)(3,"div",7)(4,"vedius-text",8),v(5),x(6,"vediusTruncate"),h(),C(7,hb,1,1,"vedius-button",9),h(),m(8,"vedius-text",10),v(9),h(),m(10,"vedius-text",11),v(11),x(12,"percentageFormat"),h()(),w(13,"vedius-summary-progress-bar",12),E()),e&2){let t=n.$implicit,i=n.index,a=f();l(),p("ngIf",i===0),l(3),Wt(t.key==="NOT_INFORMED"?"neutral-darker-color":"neutral-dusk-color"),l(),T(" ",F(6,12,t.label,a.truncate)," "),l(2),p("ngIf",t.phone),l(2),T(" ",t.total," "),l(2),T(" ",F(12,15,t.percentage,Q(18,cb))," "),l(2),p("rows",V(22,pb,bt(19,db,t.percentage,t.color)))("hideCurrentNumber",!0)("hideCurrentLetters",!0)("hideDetailsType",!0)("max",100)}}var Fm=(()=>{let n=class n{get isPatientTreatmentType(){return this.appContext?.getUserCredential()?.userVedius?.clientTreatmentType===xe.PATIENT}constructor(i,a,o,r){if(this.appContext=i,this.patientProfessionalIndicationMessageService=a,this.translation=o,this.data=r,this.modal=null,this.truncate=50,this.recruitmentList=[],this.treatmentTypeLabel="",this.indicationTypeLabel="",!this.data?.indicationType)throw new Error("Indication type is required!");this.currentType=this.data.indicationType,this.indications=this.data.indications||[],this.patientInfos=(this.data?.patientInfos||[]).filter(s=>s.indicationInfo?.type===this.currentType),this.truncate=Ut()?20:50}handleKeyUp(i){i.stopPropagation(),i.key===Ys&&this.close()}ngOnInit(){this.translation.loaded().then(()=>{let i=this.translation.get(this.isPatientTreatmentType?U.Patients:U.Students);this.indicationTypeLabel=this.translation.get(`${U.IndicationType}.${this.currentType?.toUpperCase()}`),this.treatmentTypeLabel=je(i)}),this.setData()}close(){this.modal?.close()}setData(){let i=this.patientInfos.length,a={};this.patientInfos.forEach(c=>{c.indicationInfo?.key&&c.indicationInfo.key.value in a?a[c.indicationInfo.key.value]++:c.indicationInfo?.key&&(a[c.indicationInfo.key.value]=1)});let s=[...Object.keys(a).map(c=>{let d=a[c],u=Be(d/i*100,1),g=this.indications.find(_=>_.key.value===c);return{key:c,label:g?.name,percentage:u,phone:g?.phone,total:d,color:"#70BBC8"}}).filter(({total:c})=>c>0)].sort((c,d)=>d.percentage-c.percentage);this.recruitmentList=s}getTypeTranslation(i){let a=`${U.IndicationType}.${i?.toUpperCase()}`;return this.translation.get(a)}onSendWhatsapp(i){this.patientProfessionalIndicationMessageService.sendWhatsappMessage(i)}};n.\u0275fac=function(a){return new(a||n)(y(Le),y(Pl),y(ae),y(oa,8))},n.\u0275cmp=O({type:n,selectors:[["app-pprofessional-types-recruitment-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},hostBindings:function(a,o){a&1&&A("keyup",function(s){return o.handleKeyUp(s)})},decls:8,vars:7,consts:[[1,"professional-types-indications-modal"],[1,"title"],[1,"professional-recruitment-list-data"],[1,"professional-recruitment-item-content"],[4,"ngFor","ngForOf"],["class","professional-recruitment-header",4,"ngIf"],[1,"professional-recruitment-item-info"],[1,"professional-recuitment-text-content"],["variant","text","size","sm",1,"neutral-dusk-color","professional-recruitment-text"],["class","whatsapp-button","variant","tertiary","icon","whatsapp","iconType","only",3,"withStroke","onClick",4,"ngIf"],["variant","text","size","sm",1,"neutral-dusk-color","professional-recruitment-total"],["variant","text","size","micro",1,"neutral-darker-color","professional-recruitment-percentage"],["barSize","medium",3,"rows","hideCurrentNumber","hideCurrentLetters","hideDetailsType","max"],[1,"professional-recruitment-header"],["variant","text","size","sm",1,"neutral-darker-color","professional-recruitment-label-header"],["variant","text","size","sm",1,"neutral-dusk-color","professional-recruitment-total-header"],["variant","text","size","micro",1,"neutral-darker-color","professional-recruitment-percentage-header"],["variant","tertiary","icon","whatsapp","iconType","only",1,"whatsapp-button",3,"onClick","withStroke"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"div",2)(6,"div",3),C(7,ub,14,24,"ng-container",4),h()()()()),a&2&&(l(3),T(" ",F(4,2,"PATIENT_PROFILE.FORM.PROFESSIONAL_INDICATION.TITLE",V(5,lb,o.indicationTypeLabel))," "),l(4),p("ngForOf",o.recruitmentList))},dependencies:[q,le,z,j,re,ti,$,Y,tt,Dl],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;
28-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.professional-types-indications-modal{display:flex;flex-direction:column;gap:40px}.professional-types-indications-modal .hidden{display:none}.professional-types-indications-modal .neutral-dusk-color{color:#192840}.professional-types-indications-modal .neutral-dark-color{color:#6d7a8e}.professional-types-indications-modal .neutral-darker-color{color:#425168}.professional-types-indications-modal .loader{width:100%}.professional-types-indications-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:0;max-width:400px}.professional-types-indications-modal .professional-recruitment-list-data{display:flex;flex-direction:column;gap:24px;border-radius:8px;background-color:#fff;width:100%}.professional-types-indications-modal .professional-recruitment-list-data .neutral-dusk-color{color:#192840}.professional-types-indications-modal .professional-recruitment-list-data .neutral-darker-color{color:#425168}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content{display:flex;flex-direction:column;width:100%}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-header{padding:12px 0 4px;display:flex;flex-direction:row;align-items:center;gap:8px}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-header .professional-recruitment-label-header{display:flex;flex:1 0 0}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-header .professional-recruitment-total-header{display:flex;min-width:110px}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-header .professional-recruitment-percentage-header{display:flex;width:60px}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-header .professional-recruitment-total-header{justify-content:center}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-header .professional-recruitment-percentage-header{justify-content:flex-end}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info{padding:12px 0 4px;display:flex;flex-direction:row;align-items:center}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recuitment-text-content{flex:1 0 0;display:flex;flex-direction:row;gap:8px;align-items:center}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recuitment-text-content .whatsapp-button button{height:32px}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recuitment-text-content .professional-recruitment-text{display:flex}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recruitment-total{display:flex;min-width:110px}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recruitment-percentage{display:flex;width:60px}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recruitment-total{justify-content:center}.professional-types-indications-modal .professional-recruitment-list-data .professional-recruitment-item-content .professional-recruitment-item-info .professional-recruitment-percentage{justify-content:flex-end}@media screen and (max-width: 600px){.professional-types-indications-modal .title{font-size:1.25rem;line-height:1.875rem;margin:-6px 0 0;max-width:270px}} 29`],encapsulation:2});let e=n;return e})();var gb=()=>({fractionDigits:1}),fb=(e,n)=>({number:e,color:n}),_b=e=>[e];function xb(e,n){if(e&1&&(m(0,"div",11)(1,"vedius-text",12),v(2),x(3,"translate"),h(),m(4,"vedius-text",13),v(5),h(),m(6,"vedius-text",14),v(7," % "),h()()),e&2){let t=f(2);l(2),T(" ",S(3,3,"DASHBOARD_PAGE.RECRUITMENT_DATA.LIST_TITLE")," "),l(3),pi(" ",t.treatmentTypeLabel," (",t.patientInfos.length,") ")}}function vb(e,n){if(e&1){let t=I();m(0,"vedius-button",15),A("onClick",function(){D(t);let a=f().$implicit,o=f();return L(o.openProfessionalTypesRecruitmentDetails(a.key))}),h()}}function bb(e,n){if(e&1&&(P(0),C(1,xb,8,5,"div",3),m(2,"div",4)(3,"div",5)(4,"vedius-text",6),v(5),h(),C(6,vb,1,0,"vedius-button",7),h(),m(7,"vedius-text",8),v(8),h(),m(9,"vedius-text",9),v(10),x(11,"percentageFormat"),h()(),w(12,"vedius-summary-progress-bar",10),E()),e&2){let t=n.$implicit,i=n.index,a=f();l(),p("ngIf",i===0),l(3),Wt(t.key==="NOT_INFORMED"?"neutral-darker-color":"neutral-dusk-color"),l(),T(" ",t.label," "),l(),p("ngIf",a.isIndicationType(t.key)),l(2),T(" ",t.total," "),l(2),T(" ",F(11,12,t.percentage,Q(15,gb))," "),l(2),p("rows",V(19,_b,bt(16,fb,t.percentage,t.color)))("hideCurrentNumber",!0)("hideCurrentLetters",!0)("hideDetailsType",!0)("max",100)}}var Bm=(()=>{let n=class n{constructor(i,a,o){this.dialog=i,this.translation=a,this.appContext=o,this.patientInfos=[],this.recruitmentList=[],this.indications=[],this.treatmentTypeLabel="",this.colorMap=new Map([[R.Patient_Student_Referral,"#FFC673"],[R.Friend_Family_Referral,"#FFC673"],[R.Social_Media_Facebook,"#73ABFF"],[R.Social_Media_Instagram,"#73ABFF"],[R.Social_Media_TikTok,"#73ABFF"],[R.Social_Media_Youtube,"#73ABFF"],[R.Social_Media_Linkedin,"#73ABFF"],[R.Google,"#73D9FF"],[R.Health_Event,"#73EEAF"],[R.Flyer,"#73EEAF"],[R.Television_Ad,"#73EEAF"],[R.Billboard_Ad,"#73EEAF"],[R.Newspaper_Ad,"#73EEAF"],[R.Radio_Ad,"#73EEAF"],[R.Walking_Down_The_Street,"#73EEAF"],[R.Other,"#D3DAE5"],["NOT_INFORMED","#D3DAE5"]])}get isPatientTreatmentType(){return this.appContext?.getUserCredential()?.userVedius?.clientTreatmentType===xe.PATIENT}ngOnInit(){this.translation.loaded().then(()=>{let i=this.translation.get(this.isPatientTreatmentType?U.Patients:U.Students);this.treatmentTypeLabel=je(i)})}
29ngOnChanges(i){i.patientInfos?.currentValue&&this.setData()}setData(){let i=this.patientInfos.length,a=0,o={[R.Patient_Student_Referral]:0,[R.Friend_Family_Referral]:0,[R.Social_Media_Facebook]:0,[R.Social_Media_Instagram]:0,[R.Social_Media_TikTok]:0,[R.Social_Media_Youtube]:0,[R.Social_Media_Linkedin]:0,[R.Google]:0,[R.Health_Event]:0,[R.Flyer]:0,[R.Television_Ad]:0,[R.Billboard_Ad]:0,[R.Newspaper_Ad]:0,[R.Radio_Ad]:0,[R.Walking_Down_The_Street]:0,[R.Other]:0},r={[oe.Acupuncturist]:0,[oe.Social_Worker]:0,[oe.Audiologist]:0,[oe.Biomedical]:0,[oe.Biologist]:0,[oe.Dentist]:0,[oe.Physical_Education_Teacher]:0,[oe.Nurse]:0,[oe.Pharmacist]:0,[oe.Physiotherapist]:0,[oe.Speech_Therapist]:0,[oe.Doctor]:0,[oe.Veterinary_Doctor]:0,[oe.Nutritionist]:0,[oe.Odontologist]:0,[oe.Podiatrist]:0,[oe.Psychologist]:0,[oe.Occupational_Therapist]:0};this.patientInfos.forEach(g=>{g.howYouMetMe&&g.howYouMetMe in o&&o[g.howYouMetMe]++,g.indicationInfo&&g.indicationInfo.type in r&&r[g.indicationInfo.type]++,g.howYouMetMe===void 0&&g.indicationInfo===void 0&&a++});let s=Object.keys(o).map(g=>{let _=g,b=o[_],k=Be(b/i*100,1);return{key:_,label:this.howYouMetMeTranslation(_),percentage:k,total:b,color:this.colorMap.get(_)||""}}).filter(({total:g})=>g>0),c=Object.keys(r).map(g=>{let _=g,b=r[_],k=Be(b/i*100,1);return{key:_,label:this.indicationTypeTranslation(_),percentage:k,total:b,color:"#70BBC8"}}).filter(({total:g})=>g>0),u=[...s,...c].sort((g,_)=>_.percentage-g.percentage);if(a>0){let g="NOT_INFORMED",_=a,b=Be(_/i*100,1),k={key:g,label:this.howYouMetMeTranslation(g),percentage:b,total:_,color:this.colorMap.get(g)||""};u.push(k)}this.recruitmentList=u}isIndicationType(i){return Object.values(oe).includes(i)}openProfessionalTypesRecruitmentDetails(i){let a={indications:this.indications,patientInfos:this.patientInfos,indicationType:i};this.dialog.open(Fm,{width:"600px",data:a})}howYouMetMeTranslation(i){return this.translation.get(`${U.HowYouMetMeType}.${i?.toUpperCase()}`)}indicationTypeTranslation(i){return this.translation.get(`${U.IndicationType}.${i?.toUpperCase()}`)}};n.\u0275fac=function(a){return new(a||n)(y(He),y(ae),y(Le))},n.\u0275cmp=O({type:n,selectors:[["app-patient-recruitment-list-data"]],inputs:{patientInfos:"patientInfos",indications:"indications"},features:[ye],decls:3,vars:1,consts:[["data-testid","recruitment-channel-table",1,"patient-recruitment-list-data"],[1,"recruitment-item-content"],[4,"ngFor","ngForOf"],["class","recruitment-header",4,"ngIf"],["data-testid","recruitment-channel-row",1,"recruitment-item-info"],[1,"recuitment-text-content"],["variant","text","size","sm",1,"neutral-dusk-color","recruitment-text"],["variant","tertiary","icon","eye-show","iconType","only","size","xsmall","customTitle","Visualizar indica\xE7\xF5es",3,"onClick",4,"ngIf"],["variant","text","size","sm",1,"neutral-dusk-color","recruitment-total"],["variant","text","size","micro",1,"neutral-darker-color","recruitment-percentage"],["barSize","medium",3,"rows","hideCurrentNumber","hideCurrentLetters","hideDetailsType","max"],[1,"recruitment-header"],["variant","text","size","sm",1,"neutral-darker-color","recruitment-label-header"],["data-testid","recruitment-patient-count","variant","text","size","sm",1,"neutral-dusk-color","recruitment-total-header"],["variant","text","size","micro",1,"neutral-darker-color","recruitment-percentage-header"],["variant","tertiary","icon","eye-show","iconType","only","size","xsmall","customTitle","Visualizar indica\xE7\xF5es",3,"onClick"]],template:function(a,o){a&1&&(m(0,"div",0)(1,"div",1),C(2,bb,13,21,"ng-container",2),h()()),a&2&&(l(2),p("ngForOf",o.recruitmentList))},dependencies:[le,z,j,re,ti,$,Y,tt],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.patient-recruitment-list-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;border-radius:8px;background-color:#fff;width:100%;min-width:0;overflow-x:clip}.patient-recruitment-list-data[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.patient-recruitment-list-data[_ngcontent-%COMP%] .neutral-darker-color[_ngcontent-%COMP%]{color:#425168}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-header[_ngcontent-%COMP%]{padding:12px 0 4px;display:flex;flex-direction:row;align-items:center;gap:8px}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-header[_ngcontent-%COMP%] .recruitment-label-header[_ngcontent-%COMP%]{display:flex;flex:1 0 0}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-header[_ngcontent-%COMP%] .recruitment-total-header[_ngcontent-%COMP%]{display:flex;min-width:110px}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-header[_ngcontent-%COMP%] .recruitment-percentage-header[_ngcontent-%COMP%]{display:flex;width:60px}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-header[_ngcontent-%COMP%] .recruitment-total-header[_ngcontent-%COMP%]{justify-content:center}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-header[_ngcontent-%COMP%] .recruitment-percentage-header[_ngcontent-%COMP%]{justify-content:flex-end}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%]{padding:12px 0 4px;display:flex;flex-direction:row;align-items:center}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%] .recuitment-text-content[_ngcontent-%COMP%]{flex:1 0 0;display:flex;flex-direction:row;gap:8px;align-items:center}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%] .recuitment-text-content[_ngcontent-%COMP%] .recruitment-text[_ngcontent-%COMP%]{display:flex}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%] .recruitment-total[_ngcontent-%COMP%]{display:flex;min-width:110px}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%] .recruitment-percentage[_ngcontent-%COMP%]{display:flex;width:60px}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%] .recruitment-total[_ngcontent-%COMP%]{justify-content:center}.patient-recruitment-list-data[_ngcontent-%COMP%] .recruitment-item-content[_ngcontent-%COMP%] .recruitment-item-info[_ngcontent-%COMP%] .recruitment-percentage[_ngcontent-%COMP%]{justify-content:flex-end}"]});let e=n;return e})();var yb=()=>({height:"64px"}),Cb=()=>({height:"500px"});function Tb(e,n){if(e&1){let t=I();m(0,"vedius-collaborator-selection-button",11),x(1,"translate"),x(2,"translate"),A("onFilterSelect",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))})("onLoad",function(a){D(t);let o=f();return L(o.onCollaboratorLoaded(a))}),h()}if(e&2){let t=f();ee("defaultLabel",S(1,4,"DASHBOARD_PAGE.DEFAULT_PROFESSIONAL_LABEL")),ee("labelForFullSelection",S(2,6,"DASHBOARD_PAGE.ALL_PROFESSIONAL_SELECTED")),p("type",t.isSmall?"modal":"dropdown")("maxLabels",1)}}function Sb(e,n){if(e&1&&w(0,"app-patient-recruitment-chart-data",14),e&2){let t=f(2);p("patientInfos",t.patientsInfosDisplayed)}}function wb(e,n){if(e&1&&w(0,"app-patient-recruitment-list-data",15),e&2){let t=f(2);p("patientInfos",t.patientsInfosDisplayed)("indications",t.indications)}}function Ab(e,n){if(e&1&&(P(0),C(1,Sb,1,1,"app-patient-recruitment-chart-data",12)(2,wb,1,2,"app-patient-recruitment-list-data",13),E()),e&2){let t=f();l(),p("ngIf",t.patientsInfosDisplayed.length>0),l(),p("ngIf",t.patientsInfosDisplayed.length>0)}}function kb(e,n){e&1&&w(0,"ngx-skeleton-loader",16),e&2&&p("count",4)("theme",Q(2,yb))}function Db(e,n){e&1&&Ce(0)}
29function Lb(e,n){if(e&1&&(P(0),C(1,Db,1,0,"ng-container",17),E()),e&2){f();let t=he(17);l(),p("ngTemplateOutlet",t)}}function Pb(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",16),E()),e&2&&(l(),p("count",1)("theme",Q(2,Cb)))}function Eb(e,n){if(e&1&&(m(0,"div",18),w(1,"img",19),m(2,"vedius-text",20),v(3),x(4,"translate"),x(5,"translate"),h()()),e&2){let t=f();l(3),T(" ",t.isPatientTreatmentType?S(4,1,"DASHBOARD_PAGE.RECRUITMENT_DATA.PATIENT_EMPTY_DESCRIPTION"):S(5,3,"DASHBOARD_PAGE.RECRUITMENT_DATA.STUDENT_EMPTY_DESCRIPTION")," ")}}var Vm=(()=>{let n=class n{constructor(i,a,o,r,s,c){this.patientProfessionalIndicationService=i,this.patientInfoConverterService=a,this.userVediusContext=o,this.translate=r,this.patientService=s,this.dialog=c,this.isSmall=!1,this.loadingDelay=0,this.isLoading=!0,this.collaboratorsSelected=[],this.isFirstLoading=!0,this.loadedTranslation=!1,this.currentPeriod=De.perMonth(new Date),this.initialPeriodOption={title:"",value:"this-month"},this.allPatientsObjectInfos=[],this.patientsInfosDisplayed=[],this.indications=[],this.initialLoadSubject=new we,this.destroy$=new we}get userVedius(){return this.userVediusContext.current}get isClinicUser(){return this.userVedius.type===_e.Clinic}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}get isPatientTreatmentType(){return this.userVedius?.clientTreatmentType===xe.PATIENT}ngOnInit(){this.startInitialSubjectLoad(),this.translate.loaded().then(()=>{this.loadedTranslation=!0}),this.isClinicUser||(this.isLoading=!0,this.collaboratorsSelected=[this.userVedius],this.initialLoadSubject.next())}onCollaboratorLoaded(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),this.initialLoadSubject.next()}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}load(){return B(this,null,function*(){try{this.isLoading=!0,yield this.loadAllPatientsObjectInfos(),yield this.loadIndications(),this.applyFilter()}catch(i){console.error("Error to load recruitment data: ",i)}finally{this.isLoading=!1,this.isFirstLoading=!1}})}openInfo(){this.dialog.open(Om,{width:"600px"})}onCollaboratorSelect(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),this.applyFilter()}onPeriodChange(i){this.currentPeriod=i,this.applyFilter()}applyFilter(){let i=this.collaboratorsSelected.map(o=>o.key.value),a=this.allPatientsObjectInfos.filter(o=>o.created_date&&this.currentPeriod.containsDate(hi(o.created_date))&&i.includes(o.professional_uid));this.patientsInfosDisplayed=a.map(o=>this.patientInfoConverterService.convertFromObjectToInfo(o))}loadAllPatientsObjectInfos(){return B(this,null,function*(){this.allPatientsObjectInfos=yield this.patientService.getAllObjectInfos()})}loadIndications(){return B(this,null,function*(){this.indications=yield this.patientProfessionalIndicationService.getAll()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}};n.\u0275fac=function(a){return new(a||n)(y(Ll),y(zi),y(Te),y(ae),y(pt),y(He))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-recruitment-data"]],inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:18,vars:16,consts:[["emptyTemplate",""],["data-testid","recruitment-card",1,"dashboard-recruitment-data-component"],[1,"recruitment-header-info"],[1,"left-header-info"],["variant","text","size","md",1,"neutral-dusk-color"],["svgIcon","help-info",1,"help-icon",3,"click"],[1,"right-header-info"],["size","small",3,"type","maxLabels","defaultLabel","labelForFullSelection","onFilterSelect","onLoad",4,"ngIf"],["data-testid","recruitment-period-filter","buttonSize","small","type","auto",3,"periodChanged","isMobile","initialPeriodOption"],[4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],["size","small",3,"onFilterSelect","onLoad","type","maxLabels","defaultLabel","labelForFullSelection"],[3,"patientInfos",4,"ngIf"],[3,"patientInfos","indications",4,"ngIf"],[3,"patientInfos"],[3,"patientInfos","indications"],[1,"loader",3,"count","theme"],[4,"ngTemplateOutlet"],["data-testid","recruitment-empty-state",1,"empty-content"],["src","../../../../../../assets/images/dashboard-recruitment-empty-data.svg","alt","empty-state"],["variant","text","size","sm",1,"empty-description","neutral-darker-color"]],template:function(a,o){if(a&1){let r=I();m(0,"div",1),P(1),m(2,"div",2)(3,"div",3)(4,"vedius-text",4),v(5),x(6,"translate"),x(7,"translate"),h(),m(8,"mat-icon",5),A("click",function(){return D(r),L(o.openInfo())}),h()(),m(9,"div",6),C(10,Tb,3,8,"vedius-collaborator-selection-button",7),m(11,"vedius-period-selection-button",8),A("peri
29odChanged",function(c){return D(r),L(o.onPeriodChange(c))}),h()()(),C(12,Ab,3,2,"ng-container",9)(13,kb,1,3,"ngx-skeleton-loader",10)(14,Lb,2,1,"ng-container",9),E(),h(),C(15,Pb,2,3,"ng-container",9)(16,Eb,6,5,"ng-template",null,0,me)}a&2&&(X("hidden",o.isLoading&&o.isFirstLoading)("small",o.isSmall),l(5),T(" ",o.isPatientTreatmentType?S(6,12,"DASHBOARD_PAGE.RECRUITMENT_DATA.PATIENT_TITLE"):S(7,14,"DASHBOARD_PAGE.RECRUITMENT_DATA.STUDENT_TITLE")," "),l(5),p("ngIf",o.isClinicUser&&o.loadedTranslation),l(),p("isMobile",o.isSmall)("initialPeriodOption",o.initialPeriodOption),l(),p("ngIf",!o.isLoading),l(),p("ngIf",o.isLoading),l(),p("ngIf",o.patientsInfosDisplayed.length===0&&!o.isLoading),l(),p("ngIf",o.isLoading&&o.isFirstLoading))},dependencies:[j,et,z,mt,Ca,Im,Bm,Ee,Pe,ze,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-recruitment-data-component{display:flex;padding:24px;flex-direction:column;align-self:stretch;min-height:320px;border-radius:12px;background:#fff;border:1px solid #f5f6f8;position:relative;overflow:visible}.dashboard-recruitment-data-component.hidden{display:none!important}.dashboard-recruitment-data-component .loader{margin-top:24px;width:100%}.dashboard-recruitment-data-component .color-neutral-dusk{color:#192840}.dashboard-recruitment-data-component .color-neutral-darker{color:#425168}.dashboard-recruitment-data-component .recruitment-header-info{display:flex;justify-content:space-between;align-items:center;align-self:stretch;min-width:0;gap:12px;margin-bottom:24px}.dashboard-recruitment-data-component .recruitment-header-info .left-header-info{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.dashboard-recruitment-data-component .recruitment-header-info .left-header-info .help-icon{width:16px;height:16px}.dashboard-recruitment-data-component .recruitment-header-info .left-header-info .help-icon:hover{cursor:pointer;opacity:.8}.dashboard-recruitment-data-component .recruitment-header-info .right-header-info{display:flex;align-items:center;gap:24px;min-width:0;flex:0 1 auto;max-width:100%}.dashboard-recruitment-data-component .recruitment-header-info .right-header-info vedius-collaborator-selection-button{width:200px;max-width:100%;display:flex;min-width:0}.dashboard-recruitment-data-component .recruitment-header-info .right-header-info vedius-period-selection-button .period-selection-wrapper:not(.mobile) .main-header{justify-content:flex-end}.dashboard-recruitment-data-component .recruitment-header-info .right-header-info vedius-period-selection-button .period-selection-wrapper:not(.mobile) .content{left:auto;right:0;align-items:flex-end}.dashboard-recruitment-data-component .neutral-day-color{color:#fff}.dashboard-recruitment-data-component .neutral-dusk-color{color:#192840}.dashboard-recruitment-data-component .neutral-medium-color{color:#96a0b0}.dashboard-recruitment-data-component .neutral-dark-color{color:#6d7a8e}.dashboard-recruitment-data-component .neutral-darker-color{color:#425168}.dashboard-recruitment-data-component .empty-content{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:24px;box-sizing:border-box}.dashboard-recruitment-data-component .empty-content .empty-description{text-align:center;width:280px;max-width:100%;box-sizing:border-box}.dashboard-recruitment-data-component .empty-content img{max-width:150px;max-height:150px}.dashboard-recruitment-data-component.small{border-radius:8px}.dashboard-recruitment-data-component.small .recruitment-header-info{flex-wrap:wrap;align-items:flex-start}.dashboard-recruitment-data-component.small .recruitment-header-info .right-header-info{flex:1 1 100%;max-width:100%;flex-wrap:wrap;justify-content:flex-start;gap:12px}.dashboard-recruitment-data-component.small .recruitment-header-info .right-header-info vedius-collaborator-selection-button{width:100%;max-width:100%}.dashboard-recruitment-data-component.small .recruitment-header-info .right-header-info vedius-period-selection-button{width:100%;max-width:100%}.dashboard-recruitment-data-component.small .recruitment-header-info .right-header-info vedius-period-selection-button .period-selection-wrapper.mobile .main-header{background-color:transparent;padding:0}.dashboard-recruitment-data-component.small .recruitment-header-info .right-header-info vedius-period-selection-button .period-selection-wrapper.mobile .button-wrapper{flex:1 1 auto;min-width:0} 30`],encapsulation:2});let e=n;return e})();var Mb=e=>({plural_client_treatment_type:e}),Rm=(()=>{let n=class n{constructor(i){this.appContext=i,this.modal=null}get isPatientTreatmentType(){return this.appContext.getUserCredential()?.userVedius?.clientTreatmentType===xe.PATIENT}close(){this.modal?.close()}};n.\u0275fac=function(a){return new(a||n)(y(Le))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-demographic-info-modal"]],viewQuery:function(a,o){if(a&1&&ne(q,5),a&2){let r;te(r=ie())&&(o.modal=r.first)}},decls:15,vars:17,consts:[[1,"dashboard-demographic-info-modal"],[1,"title"],[1,"demographic-info-content"],["variant","text","size","md","fontFamily","font-family-secundary",1,"neutral-darker-color"],[1,"bottom"],[3,"onClick","fullSize"]],template:function(a,o){a&1&&(m(0,"vedius-modal")(1,"div",0)(2,"h1",1),v(3),x(4,"translate"),h(),m(5,"div",2)(6,"vedius-text",3),v(7),x(8,"translate"),x(9,"translate"),x(10,"translate"),h()(),m(11,"div",4)(12,"vedius-button",5),A("onClick",function(){return o.close()}),v(13),x(14,"translate"),h()()()()),a&2&&(l(3),T(" ",S(4,4,"DASHBOARD_PAGE.MODA
30L_INFO.DEMOGRAPHIC_DATA.TITLE")," "),l(4),T(" ",F(10,10,"DASHBOARD_PAGE.MODAL_INFO.DEMOGRAPHIC_DATA.DESCRIPTION",V(15,Mb,o.isPatientTreatmentType?S(8,6,"PATIENTS"):S(9,8,"STUDENTS"))),""),l(5),p("fullSize",!0),l(),T(" ",S(14,13,"BUTTONS.UNDERSTOOD"),""))},dependencies:[q,j,re,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-demographic-info-modal{display:flex;flex-direction:column;gap:24px}.dashboard-demographic-info-modal .neutral-dusk-color{color:#192840}.dashboard-demographic-info-modal .neutral-darker-color{color:#425168}.dashboard-demographic-info-modal .loader{width:100%}.dashboard-demographic-info-modal .title{color:#192840;font-family:DM Sans;font-size:1.5rem;font-weight:500;line-height:2rem;letter-spacing:-.48px;display:flex;align-items:center;margin:0;max-width:400px}.dashboard-demographic-info-modal .bottom{width:100%;margin-top:16px}.dashboard-demographic-info-modal .bottom vedius-button{width:100%}@media screen and (max-width: 600px){.dashboard-demographic-info-modal .title{font-size:1.25rem;line-height:1.875rem;margin:12px 0 0;max-width:300px}} 31`],encapsulation:2});let e=n;return e})();var Ob=()=>({fractionDigits:1});function Ib(e,n){if(e&1&&w(0,"vedius-chart",5),e&2){let t=f();p("donutWidth",t.isMobile?200:250)("donutHeight",t.isMobile?200:250)("forceSize",!0)("data",t.data)}}function Fb(e,n){if(e&1&&(P(0),m(1,"div",6),w(2,"vedius-dot-palette",7),m(3,"vedius-text",8),v(4),x(5,"percentageFormat"),h(),m(6,"vedius-text",9),v(7),h()(),E()),e&2){let t=n.$implicit;l(2),p("color",t.color),l(2),T(" ",F(5,3,t.percentage,Q(6,Ob))," "),l(3),T(" ",t.label," ")}}var Nm=(()=>{let n=class n{constructor(i,a){this.translation=i,this.cdr=a,this.patientInfos=[],this.isMobile=!1,this.data=[],this.legends=[],this.colorMap=new Map([[sn.Prefer_Not_To_Say,"#D3DAE5"],[ft.Female,"#014954"],[ft.Male,"#0D7180"]]),this.isMobile=Ut()}ngOnChanges(i){i.patientInfos?.currentValue&&this.setChartData()}setChartData(){if(!this.patientInfos)return;let i=this.patientInfos.length,a=0,o=0,r=0;this.patientInfos.forEach(s=>{switch(s.biologicalSex){case ft.Female:a++;break;case ft.Male:o++;break;case void 0:r++;break;default:r++}let c=Be(a/i*100,1),d=Be(o/i*100,1),u=Be(r/i*100,1),g=[{key:ft.Female,label:this.legendsTranslation(ft.Female?.toUpperCase()),percentage:c,color:this.colorMap.get(ft.Female)||""},{key:ft.Male,label:this.legendsTranslation(ft.Male?.toUpperCase()),percentage:d,color:this.colorMap.get(ft.Male)||""},{key:sn.Prefer_Not_To_Say,label:this.legendsTranslation(sn?.Prefer_Not_To_Say.toUpperCase()),percentage:u,color:this.colorMap.get(sn.Prefer_Not_To_Say)||""}];this.legends=g.filter(_=>_.percentage>0),setTimeout(()=>{this.data=this.legends.map(_=>({id:_.key,label:_.label,data:[{color:_.color,value:_.percentage}],hideTooltip:!0})),this.cdr.detectChanges()},1e3)})}legendsTranslation(i){return this.translation.get(`${U.PatientDemographicLegends}.${i}`)}};n.\u0275fac=function(a){return new(a||n)(y(ae),y(Oe))},n.\u0275cmp=O({type:n,selectors:[["app-patient-gender-demographic-data"]],inputs:{patientInfos:"patientInfos"},features:[ye],decls:5,vars:2,consts:[[1,"patient-gender-demographic-data"],[1,"demographic-chart-content"],["type","donut","type","donut",3,"donutWidth","donutHeight","forceSize","data",4,"ngIf"],[1,"demographic-legends"],[4,"ngFor","ngForOf"],["type","donut","type","donut",3,"donutWidth","donutHeight","forceSize","data"],[1,"demographic-legend-item"],["size","small",3,"color"],["variant","text","size","sm",1,"neutral-dusk-color"],["variant","text","size","micro",1,"neutral-darker-color"]],template:function(a,o){a&1&&(m(0,"div",0)(1,"div",1),C(2,Ib,1,4,"vedius-chart",2),m(3,"div",3),C(4,Fb,8,7,"ng-container",4),h()()()),a&2&&(l(2),p("ngIf",o.data),l(2),p("ngForOf",o.legends))},dependencies:[z,ka,le,Jt,j,tt],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
31-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.patient-gender-demographic-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;border-radius:8px;background-color:#fff;width:100%}.patient-gender-demographic-data[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.patient-gender-demographic-data[_ngcontent-%COMP%] .neutral-darker-color[_ngcontent-%COMP%]{color:#425168}.patient-gender-demographic-data[_ngcontent-%COMP%] .demographic-chart-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:center;flex-wrap:wrap;gap:16px}.patient-gender-demographic-data[_ngcontent-%COMP%] .demographic-chart-content[_ngcontent-%COMP%] vedius-chart[_ngcontent-%COMP%]{pointer-events:none;width:250px;max-width:100%}.patient-gender-demographic-data[_ngcontent-%COMP%] .demographic-chart-content[_ngcontent-%COMP%] .demographic-legends[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:16px;min-width:0;max-width:100%}.patient-gender-demographic-data[_ngcontent-%COMP%] .demographic-chart-content[_ngcontent-%COMP%] .demographic-legends[_ngcontent-%COMP%] .demographic-legend-item[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}"]});let e=n;return e})();var Bb=()=>({fractionDigits:1}),Vb=(e,n)=>({number:e,color:n}),Rb=e=>[e];function Nb(e,n){if(e&1&&(m(0,"div",9)(1,"vedius-text",10),v(2),x(3,"translate"),h(),m(4,"vedius-text",11),v(5),h(),m(6,"vedius-text",12),v(7," % "),h()()),e&2){let t=f(2);l(2),T(" ",S(3,3,"DASHBOARD_PAGE.DEMOGRAPHIC_DATA.AGE_RANGE_LABEL")," "),l(3),pi(" ",t.treatmentTypeLabel," (",t.patientInfos.length,") ")}}function Gb(e,n){if(e&1&&(P(0),C(1,Nb,8,5,"div",3),m(2,"div",4)(3,"vedius-text",5),v(4),h(),m(5,"vedius-text",6),v(6),h(),m(7,"vedius-text",7),v(8),x(9,"percentageFormat"),h()(),w(10,"vedius-summary-progress-bar",8),E()),e&2){let t=n.$implicit,i=n.index,a=f();l(),p("ngIf",i===0),l(2),Wt(t.ageRange==="NOT_INFORMED"?"neutral-darker-color":"neutral-dusk-color"),l(),T(" ",a.getAgeRangeLabel(t.ageRange)," "),l(2),T(" ",t.total," "),l(2),T(" ",F(9,11,t.percentage,Q(14,Bb))," "),l(2),p("rows",V(18,Rb,bt(15,Vb,t.percentage,t.ageRange==="NOT_INFORMED"?"#D3DAE5":"#0D7180")))("hideCurrentNumber",!0)("hideCurrentLetters",!0)("hideDetailsType",!0)("max",100)}}var ge=function(e){return e.AGE_0_5="0-5",e.AGE_6_11="6-11",e.AGE_12_17="12-17",e.AGE_18_24="18-24",e.AGE_25_34="25-34",e.AGE_35_44="35-44",e.AGE_45_54="45-54",e.AGE_55_64="55-64",e["AGE_65+"]="AGE_65+",e.NOT_INFORMED="NOT_INFORMED",e}(ge||{}),Gm=(()=>{let n=class n{constructor(i,a){this.translation=i,this.appContext=a,this.patientInfos=[],this.ageDemographics=[],this.treatmentTypeLabel=""}get isPatientTreatmentType(){return this.appContext?.getUserCredential()?.userVedius?.clientTreatmentType===xe.PATIENT}ngOnInit(){this.translation.loaded().then(()=>{let i=this.translation.get(this.isPatientTreatmentType?U.Patients:U.Students);this.treatmentTypeLabel=je(i)})}ngOnChanges(i){i.patientInfos?.currentValue&&this.setData()}setData(){let i=this.patientInfos.length,a={[ge.AGE_0_5]:0,[ge.AGE_6_11]:0,[ge.AGE_12_17]:0,[ge.AGE_18_24]:0,[ge.AGE_25_34]:0,[ge.AGE_35_44]:0,[ge.AGE_45_54]:0,[ge.AGE_55_64]:0,[ge["AGE_65+"]]:0,[ge.NOT_INFORMED]:0},o=0;this.patientInfos.forEach(s=>{let c=s.birthday?.date?il.fromDate(s.birthday?.date).years:void 0;if(c===void 0){o++;return}c>=0&&c<=5?a[ge.AGE_0_5]++:c>=6&&c<=11?a[ge.AGE_6_11]++:c>=12&&c<=17?a[ge.AGE_12_17]++:c>=18&&c<=24?a[ge.AGE_18_24]++:c>=25&&c<=34?a[ge.AGE_25_34]++:c>=35&&c<=44?a[ge.AGE_35_44]++:c>=45&&c<=54?a[ge.AGE_45_54]++:c>=55&&c<=64?a[ge.AGE_55_64]++:a[ge["AGE_65+"]]++});let r=Object.entries(a).map(([s,c])=>({ageRange:s,percentage:c/i*100,total:c})).filter(({total:s})=>s>0);r.push({ageRange:ge.NOT_INFORMED,percentage:o/i*100,total:o}),this.ageDemographics=r}getAgeRangeLabel(i){switch(i){case ge.AGE_0_5:return this.getAgeInfotranslation(0,5);case ge.AGE_6_11:return this.getAgeInfotranslation(6,11);case ge.AGE_12_17:return this.getAgeInfotranslation(12,17);case ge.AGE_18_24:return this.getAgeInfotranslation(18,24);case ge.AGE_25_34:return this.getAgeInfotranslation(25,34);case ge.AGE_35_44:return this.getAgeInfotranslation(35,44);case ge.AGE_45_54:return this.getAgeInfotranslation(45,54);case ge.AGE_55_64:return this.getAgeInfotranslation(55,64);case ge["AGE_65+"]:return this.getAgeInfotranslation(65);case ge.NOT_INFORMED:return this.getAgeNotInformedtranslation();default:return""}}getAgeInfotranslation(i,a){return a?this.translation.get(U.PatientAgeRangeDemographicInfo,{startAge:i,endAge:a}):this.translation.get(U.PatientAgeOlderThanDemographicInfo,{startAge:i})}getAgeNotInformedtranslation(){return this.translation.get(U.PatientDemographicAgeNotInformed)}};n.\u0275fac=function(a){return new(a||n)(y(ae),y(Le))},n.\u0275cmp=O({type:n,selectors:[["app-patient-age-demographic-data"]],inputs:{patientInfos:"patientInfos"},features:[ye],decls:3,vars:1,consts:[[1,"patient-age-demographic-data"],[1,"age-demographic-item-content"],[4,"ngFor","ngForOf"],["class","age-demographic-header",4,"ngIf"],[1,"age-demographic-item-info"],["variant","text","size","sm",1,"neutral-dusk-color","age-text"],["variant","text","size","sm",1,"neutral-dusk-color","age-total"],["variant","text","size","micro",1,"neutral-darker-color","age-percentage"],["barSize","medium",3,"rows","hideCurrentNumber","hideCurrentLetters","hideDetailsType","max"],[1,"age-demographic-header"],["variant","text","size","sm",1,"neutral-darker-color","age-label-header"],["variant","text","size","sm",1,"neutral-dusk-color","age-total-header"],["variant","text","size","micro",1,"neutral-darker-color","age-percentage-header"]],template:function(a,o){a&1&&(m(0,"div",0)(1,"div",1),C(2,Gb,11,20,"ng-container",2),h()()),a&2&&(l(2),p("ngForOf",o.ageDemographics))},dependencies:[le,z,j,ti,$,Y,tt],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
31-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.patient-age-demographic-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;border-radius:8px;background-color:#fff;width:100%}.patient-age-demographic-data[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.patient-age-demographic-data[_ngcontent-%COMP%] .neutral-darker-color[_ngcontent-%COMP%]{color:#425168}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-header[_ngcontent-%COMP%]{padding:12px 0 4px;display:flex;flex-direction:row;align-items:center;gap:8px}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-header[_ngcontent-%COMP%] .age-label-header[_ngcontent-%COMP%]{display:flex;flex:1 0 0}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-header[_ngcontent-%COMP%] .age-total-header[_ngcontent-%COMP%]{display:flex;min-width:110px}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-header[_ngcontent-%COMP%] .age-percentage-header[_ngcontent-%COMP%]{display:flex;width:60px}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-header[_ngcontent-%COMP%] .age-total-header[_ngcontent-%COMP%]{justify-content:center}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-header[_ngcontent-%COMP%] .age-percentage-header[_ngcontent-%COMP%]{justify-content:flex-end}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-item-info[_ngcontent-%COMP%]{padding:12px 0 4px;display:flex;flex-direction:row;align-items:center}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-item-info[_ngcontent-%COMP%] .age-text[_ngcontent-%COMP%]{display:flex;flex:1 0 0}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-item-info[_ngcontent-%COMP%] .age-total[_ngcontent-%COMP%]{display:flex;min-width:110px}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-item-info[_ngcontent-%COMP%] .age-percentage[_ngcontent-%COMP%]{display:flex;width:60px}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-item-info[_ngcontent-%COMP%] .age-total[_ngcontent-%COMP%]{justify-content:center}.patient-age-demographic-data[_ngcontent-%COMP%] .age-demographic-item-content[_ngcontent-%COMP%] .age-demographic-item-info[_ngcontent-%COMP%] .age-percentage[_ngcontent-%COMP%]{justify-content:flex-end}"]});let e=n;return e})();var zb=()=>({height:"64px"}),Hb=()=>({height:"500px"}),jb=e=>({plural_client_treatment_type:e});function Yb(e,n){if(e&1){let t=I();m(0,"vedius-collaborator-selection-button",11),x(1,"translate"),x(2,"translate"),A("onFilterSelect",function(a){D(t);let o=f();return L(o.onCollaboratorSelect(a))})("onLoad",function(a){D(t);let o=f();return L(o.onCollaboratorLoaded(a))}),h()}if(e&2){let t=f();ee("defaultLabel",S(1,4,"DASHBOARD_PAGE.DEFAULT_PROFESSIONAL_LABEL")),ee("labelForFullSelection",S(2,6,"DASHBOARD_PAGE.ALL_PROFESSIONAL_SELECTED")),p("type",t.isSmall?"modal":"dropdown")("maxLabels",1)}}function $b(e,n){if(e&1&&w(0,"app-patient-gender-demographic-data",14),e&2){let t=f(2);p("patientInfos",t.patientsInfosDisplayed)}}function Wb(e,n){if(e&1&&w(0,"app-patient-age-demographic-data",15),e&2){let t=f(2);p("patientInfos",t.patientsInfosDisplayed)}}function Xb(e,n){if(e&1&&(P(0),C(1,$b,1,1,"app-patient-gender-demographic-data",12)(2,Wb,1,1,"app-patient-age-demographic-data",13),E()),e&2){let t=f();l(),p("ngIf",t.patientsInfosDisplayed.length>0),l(),p("ngIf",t.patientsInfosDisplayed.length>0)}}function Ub(e,n){e&1&&w(0,"ngx-skeleton-loader",16),e&2&&p("count",4)("theme",Q(2,zb))}function Qb(e,n){e&1&&Ce(0)}function qb(e,n){if(e&1&&(P(0),C(1,Qb,1,0,"ng-container",17),E()),e&2){f();let t=he(16);l(),p("ngTemplateOutlet",t)}}function Kb(e,n){e&1&&(P(0),w(1,"ngx-skeleton-loader",16),E()),e&2&&(l(),p("count",1)("theme",Q(2,Hb)))}function Zb(e,n){if(e&1&&(m(0,"div",18),w(1,"img",19),m(2,"vedius-text",20),v(3),x(4,"translate"),x(5,"translate"),x(6,"translate"),h()()),e&2){let t=f();l(3),T(" ",F(6,5,"DASHBOARD_PAGE.DEMOGRAPHIC_DATA.EMPTY_DESCRIPTION",V(8,jb,t.isPatientTreatmentType?S(4,1,"PATIENTS"):S(5,3,"STUDENTS")))," ")}}var zm=(()=>{let n=class n{constructor(i,a,o,r,s){this.userVediusContext=i,this.translate=a,this.patientService=o,this.dialog=r,this.patientInfoConverterService=s,this.isSmall=!1,this.loadingDelay=0,this.isLoading=!0,this.collaboratorsSelected=[],this.isFirstLoading=!0,this.loadedTranslation=!1,this.selectedPeriod=De.thisYear(),this.initialPeriodOption={title:"",value:"this-year",period:De.thisYear()},this.allPatientsObjectInfos=[],this.patientsInfosDisplayed=[],this.initialLoadSubject=ne
31w we,this.destroy$=new we}get userVedius(){return this.userVediusContext.current}get isClinicUser(){return this.userVedius.type===_e.Clinic}get collaboratorsSelectedKeys(){return this.collaboratorsSelected.map(i=>i.key)}get isPatientTreatmentType(){return this.userVedius?.clientTreatmentType===xe.PATIENT}ngOnInit(){this.startInitialSubjectLoad(),this.translate.loaded().then(()=>{this.loadedTranslation=!0}),this.isClinicUser||(this.isLoading=!0,this.collaboratorsSelected=[this.userVedius],this.initialLoadSubject.next())}startInitialSubjectLoad(){this.initialLoadSubject.pipe(Ve(this.loadingDelay),Ze(()=>Ue(this.load()).pipe(qe(i=>(console.error("Error to load: ",i),Qe(null))))),Je(this.destroy$),Ke(null)).subscribe()}onCollaboratorLoaded(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),this.initialLoadSubject.next()}load(){return B(this,null,function*(){try{this.isLoading=!0,yield this.loadAllPatientsObjectInfos(),this.applyFilter()}catch(i){console.error("Error to load demographic data: ",i)}finally{this.isLoading=!1,this.isFirstLoading=!1}})}openInfo(){this.dialog.open(Rm,{width:"600px"})}onCollaboratorSelect(i){let a=i.map(o=>o.value);this.collaboratorsSelected=this.userVedius.collaborators.filter(o=>a.includes(o.key.value)),this.applyFilter()}onPeriodChanged(i){this.selectedPeriod=i,this.applyFilter()}applyFilter(){let i=this.collaboratorsSelected.map(o=>o.key.value),a=this.allPatientsObjectInfos.filter(o=>o.activated!==!1&&o.created_date&&this.selectedPeriod.containsDate(hi(o.created_date))&&i.includes(o.professional_uid));this.patientsInfosDisplayed=a.map(o=>this.patientInfoConverterService.convertFromObjectToInfo(o))}loadAllPatientsObjectInfos(){return B(this,null,function*(){this.allPatientsObjectInfos=yield this.patientService.getAllObjectInfos()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}};n.\u0275fac=function(a){return new(a||n)(y(Te),y(ae),y(pt),y(He),y(zi))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard-demographic-data"]],inputs:{isSmall:"isSmall",loadingDelay:"loadingDelay"},decls:17,vars:15,consts:[["emptyFinancialBalances",""],["data-testid","demographic-section",1,"dashboard-demographic-data-component"],[1,"demographic-header-info"],[1,"left-header-info"],["variant","text","size","md",1,"neutral-dusk-color"],["svgIcon","help-info",1,"help-icon",3,"click"],[1,"right-header-info"],["size","small",3,"type","maxLabels","defaultLabel","labelForFullSelection","onFilterSelect","onLoad",4,"ngIf"],["data-testid","demographic-period-button","type","auto","buttonSize","small",3,"periodChanged","isMobile","showManualControls","initialPeriodOption"],[4,"ngIf"],["class","loader",3,"count","theme",4,"ngIf"],["size","small",3,"onFilterSelect","onLoad","type","maxLabels","defaultLabel","labelForFullSelection"],["data-testid","gender-chart",3,"patientInfos",4,"ngIf"],["data-testid","age-table",3,"patientInfos",4,"ngIf"],["data-testid","gender-chart",3,"patientInfos"],["data-testid","age-table",3,"patientInfos"],[1,"loader",3,"count","theme"],[4,"ngTemplateOutlet"],[1,"empty-content"],["src","../../../../../../assets/images/dashboard-demographic-empty-data.svg","alt","empty-state"],["variant","text","size","sm",1,"empty-description","neutral-darker-color"]],template:function(a,o){if(a&1){let r=I();m(0,"div",1),P(1),m(2,"div",2)(3,"div",3)(4,"vedius-text",4),v(5),x(6,"translate"),h(),m(7,"mat-icon",5),A("click",function(){return D(r),L(o.openInfo())}),h()(),m(8,"div",6),C(9,Yb,3,8,"vedius-collaborator-selection-button",7),m(10,"vedius-period-selection-button",8),A("periodChanged",function(c){return D(r),L(o.onPeriodChanged(c))}),h()()(),C(11,Xb,3,2,"ng-container",9)(12,Ub,1,3,"ngx-skeleton-loader",10)(13,qb,2,1,"ng-container",9),E(),h(),C(14,Kb,2,3,"ng-container",9)(15,Zb,7,10,"ng-template",null,0,me)}a&2&&(X("hidden",o.isLoading&&o.isFirstLoading)("small",o.isSmall),l(5),T(" ",S(6,13,"DASHBOARD_PAGE.DEMOGRAPHIC_DATA.TITLE")," "),l(4),p("ngIf",o.isClinicUser&&o.loadedTranslation),l(),p("isMobile",o.isSmall)("showManualControls",!1)("initialPeriodOption",o.initialPeriodOption),l(),p("ngIf",!o.isLoading),l(
31),p("ngIf",o.isLoading),l(),p("ngIf",o.patientsInfosDisplayed.length===0&&!o.isLoading),l(),p("ngIf",o.isLoading&&o.isFirstLoading))},dependencies:[j,et,z,mt,Ca,Nm,Gm,Ee,Pe,ze,$,Y],styles:[`.disable-text-copies{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies{-webkit-user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;user-select:text!important}.icon-circle{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard-demographic-data-component{display:flex;padding:24px;flex-direction:column;align-self:stretch;min-height:320px;border-radius:12px;background:#fff;border:1px solid #f5f6f8;position:relative;overflow-x:hidden}.dashboard-demographic-data-component .demographic-header-info{position:relative}.dashboard-demographic-data-component .right-header-info vedius-period-selection-button .period-selection-wrapper:not(.mobile){position:static}.dashboard-demographic-data-component .right-header-info vedius-period-selection-button .period-selection-wrapper:not(.mobile) .main-header .button-wrapper{position:static}.dashboard-demographic-data-component .right-header-info vedius-period-selection-button .period-selection-wrapper:not(.mobile) .content{left:0;right:0;width:auto;align-items:flex-end}.dashboard-demographic-data-component .right-header-info vedius-period-selection-button .period-selection-wrapper:not(.mobile) .content .panel{max-width:100%}.dashboard-demographic-data-component.hidden{display:none!important}.dashboard-demographic-data-component .loader{margin-top:24px;width:100%}.dashboard-demographic-data-component .color-neutral-dusk{color:#192840}.dashboard-demographic-data-component .color-neutral-darker{color:#425168}.dashboard-demographic-data-component .demographic-header-info{display:flex;justify-content:space-between;align-items:center;align-self:stretch;min-width:0;gap:12px}.dashboard-demographic-data-component .demographic-header-info .left-header-info{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}.dashboard-demographic-data-component .demographic-header-info .left-header-info .help-icon{width:16px;height:16px}.dashboard-demographic-data-component .demographic-header-info .left-header-info .help-icon:hover{cursor:pointer;opacity:.8}.dashboard-demographic-data-component .demographic-header-info .right-header-info{display:flex;align-items:center;gap:24px;min-width:0;flex:0 1 auto;max-width:100%}.dashboard-demographic-data-component .demographic-header-info .right-header-info vedius-collaborator-selection-button{width:200px;max-width:100%;display:flex;min-width:0}.dashboard-demographic-data-component .neutral-day-color{color:#fff}.dashboard-demographic-data-component .neutral-dusk-color{color:#192840}.dashboard-demographic-data-component .neutral-medium-color{color:#96a0b0}.dashboard-demographic-data-component .neutral-dark-color{color:#6d7a8e}.dashboard-demographic-data-component .neutral-darker-color{color:#425168}.dashboard-demographic-data-component .empty-content{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:24px;box-sizing:border-box}.dashboard-demographic-data-component .empty-content .empty-description{text-align:center;width:280px;max-width:100%;box-sizing:border-box}.dashboard-demographic-data-component .empty-content img{max-width:150px;max-height:150px}.dashboard-demographic-data-component.small{border-radius:8px}.dashboard-demographic-data-component.small .demographic-header-info{flex-wrap:wrap;align-items:flex-start}.dashboard-demographic-data-component.small .demographic-header-info .right-header-info{flex:1 1 100%;max-width:100%;flex-wrap:wrap;justify-content:space-between;gap:12px}.dashboard-demographic-data-component.small .demographic-header-info .right-header-info vedius-collaborator-selection-button{width:auto;max-width:100%;flex:0 0 auto}.dashboard-demographic-data-component.small .demographic-header-info .right-header-info vedius-period-selection-button{flex:1 1 auto;min-width:0} 32`],encapsulation:2});let e=n;return e})();var Hm=(()=>{let n=class n{constructor(i){this.patientService=i}hasMinimumDataToLoad(){return B(this,null,function*(){return(yield this.patientService.getAllObjectInfos()).length>0})}};n.\u0275fac=function(a){return new(a||n)(G(pt))},n.\u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"});let e=n;return e})();var ey=()=>["thumbs-up-like-checkmark","arrow-right"];function ty(e,n){e&1&&Ce(0)}function iy(e,n){if(e&1&&(P(0),C(1,ty,1,0,"ng-container",4),E()),e&2){f();let t=he(3);l(),p("ngTemplateOutlet",t)}}function ny(e,n){if(e&1){let t=I();m(0,"app-dashboard-user-subscription-banner",17),A("onClose",function(){D(t);let a=f(3);return L(a.closeSubscriptionBanner())}),h()}if(e&2){let t=f(3);p("showImage",!t.isXSmallDesktop)}}function ay(e,n){if(e&1){let t=I();m(0,"app-dashboard-onboarding-card",17),A("onClose",function(){D(t);let a=f(3);return L(a.closeOnboardingCard())}),h()}if(e&2){let t=f(3);p("showImage",!t.isXSmallDesktop)}}function oy(e,n){if(e&1&&(P(0),C(1,ny,1,1,"app-dashboard-user-subscription-banner",16)(2,ay,1,1,"app-dashboard-onboarding-card",16),E()),e&2){let t=f(2);l(),p("ngIf",t.showSubscriptionBanner&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_USER_SUBSCRIPTION_BANNER_DISPLAY)),l(),p("ngIf",t.showOnboardingCard&&t.noDataToLoadConfirmed&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_ONBOARDING_CARD_DISPLAY))}}function ry(e,n){if(e&1){let t=I();m(0,"vedius-button",18),A("onClick",function(){D(t);let a=f(2);return L(a.openVediusDemo())}),v(1,"Demonstra\xE7\xE3o gr\xE1tis"),h()}e&2&&p("fullSize",!0)("icons",Q(2,ey))}function sy(e,n){if(e&1){let t=I();m(0,"app-dashboard-user-subscription-banner",20),A("onClose",function(){D(t);let a=f(3);return L(a.closeSubscriptionBanner())}),h()}e&2&&p("showImage",!1)("isSmall",!0)}
32function ly(e,n){if(e&1){let t=I();m(0,"app-dashboard-onboarding-card",20),A("onClose",function(){D(t);let a=f(3);return L(a.closeOnboardingCard())}),h()}if(e&2){let t=f(3);p("showImage",!t.isXSmallDesktop)("isSmall",!0)}}function cy(e,n){if(e&1&&(P(0),C(1,sy,1,2,"app-dashboard-user-subscription-banner",19)(2,ly,1,2,"app-dashboard-onboarding-card",19),E()),e&2){let t=f(2);l(),p("ngIf",t.showSubscriptionBanner&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_USER_SUBSCRIPTION_BANNER_DISPLAY)),l(),p("ngIf",t.showOnboardingCard&&t.noDataToLoadConfirmed&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_ONBOARDING_CARD_DISPLAY))}}function dy(e,n){if(e&1&&w(0,"app-dashboard-cards-info",21),e&2){let t=f(2);p("hasMinimumDataToLoad",t.hasMinimumDataToLoad)("isPageLoading",t.isLoading)("isSmallScreen",t.isXSmallDesktop)("loadingDelay",20)}}function py(e,n){if(e&1&&w(0,"app-dashboard-birthdays",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",50)}}function my(e,n){if(e&1&&w(0,"app-dashboard-appointments",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",200)}}function hy(e,n){if(e&1&&w(0,"app-dashboard-appointment-occupancy-rate",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",1200)}}function uy(e,n){if(e&1&&w(0,"app-dashboard-patient-funnel",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",400)}}function gy(e,n){if(e&1&&w(0,"app-dashboard-financial-balances",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",100)}}function fy(e,n){if(e&1&&w(0,"app-dashboard-recruitment-data",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",700)}}function _y(e,n){if(e&1&&w(0,"app-dashboard-demographic-data",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",900)}}function xy(e,n){if(e&1&&(m(0,"div",5),C(1,oy,3,2,"ng-container",6),m(2,"div",7)(3,"vedius-text",8),Eo(4),v(5),x(6,"translate"),h(),C(7,ry,2,3,"vedius-button",9),h(),C(8,cy,3,2,"ng-container",6),m(9,"div",10),C(10,dy,1,4,"app-dashboard-cards-info",11),m(11,"div",12)(12,"div",13),C(13,py,1,2,"app-dashboard-birthdays",14)(14,my,1,2,"app-dashboard-appointments",14)(15,hy,1,2,"app-dashboard-appointment-occupancy-rate",14),h(),m(16,"div",15),C(17,uy,1,2,"app-dashboard-patient-funnel",14)(18,gy,1,2,"app-dashboard-financial-balances",14)(19,fy,1,2,"app-dashboard-recruitment-data",14)(20,_y,1,2,"app-dashboard-demographic-data",14),h()()()()),e&2){let t=f();l(),p("ngIf",!t.isSmallScreen),l(2),p("size",t.isSmallScreen?"micro":"md");let i=t.greetingI18n();l(2),T(" ",F(6,13,i.key,i.params)," "),l(2),p("ngIf",t.isTrial||t.isProfileIncomplete),l(),p("ngIf",t.isSmallScreen),l(2),p("ngIf",!t.noDataToLoadConfirmed&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_CARDS_INFO)),l(3),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_BIRTHDAYS_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_APPOINTMENTS_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_APPOINTMENT_OCCUPANCY_RATE_DISPLAY)),l(2),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_PATIENT_FUNNEL_DISPLAY)),l(),p("ngIf",t.hasFinancialBalanceAccess&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_FINANCIAL_BALANCES_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_RECRUITMENT_DATA_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_DEMOGRAPHIC_DATA_DISPLAY))}}function vy(e,n){if(e&1&&w(0,"app-dashboard-cards-info",21),e&2){let t=f(2);p("hasMinimumDataToLoad",t.hasMinimumDataToLoad)("isPageLoading",t.isLoading)("isSmallScreen",t.isXSmallDesktop)("loadingDelay",20)}}function by(e,n){if(e&1&&w(0,"app-dashboard-appointments",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",200)}}function yy(e,n){e&1&&w(0,"app-dashboard-birthdays",22),e&2&&p("isSmall",!0)("loadingDelay",50)}function Cy(e,n){if(e&1&&w(0,"app-dashboard-appointment-occupancy-rate",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",1200)}}function Ty(e,n){e&1&&w(0,"app-dashboard-birthdays",22),e&2&&p("isSmall",!1)("loadingDelay",50)}function Sy(e,n){if(e&1&&w(0,"app-dashboard-patient-funnel",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",400)}}function wy(e,n){if(e&1&&w(0,"app-dashboard-recruitment-data",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",700)}}function Ay(e,n){if(e&1&&w(0,"app-dashboard-demographic-data",22),e&2){let t=f(2);p("isSmall",t.isSmallScreen)("loadingDelay",800)}}function ky(e,n){if(e&1&&(m(0,"div",5)(1,"div",7)(2,"vedius-text",8),Eo(3),v(4),x(5,"translate"),h()(),m(6,"div",10),C(7,vy,1,4,"app-dashboard-cards-info",11),m(8,"div",12)(9,"div",13),C(10,by,1,2,"app-dashboard-appointments",14)(11,yy,1,2,"app-dashboard-birthdays",14)(12,Cy,1,2,"app-dashboard-appointment-occupancy-rate",14),h(),m(13,"div",13),C(14,Ty,1,2,"app-dashboard-birthdays",14)(15,Sy,1,2,"app-dashboard-patient-funnel",14)(16,wy,1,2,"app-dashboard-recruitment-data",14)(17,Ay,1,2,"app-dashboard-demographic-data",14),h()()()()),e&2){let t=f();l(2),p("size",t.isSmallScreen?"micro":"md");let i=t.greetingI18n();l(2),T(" ",F(5,10,i.key,i.params)," "),l(3),p("ngIf",!t.noDataToLoadConfirmed&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_CARDS_INFO)),l(3),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_APPOINTMENTS_DISPLAY)),l(),p("ngIf",t.isSmallScreen&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_BIRTHDAYS_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_APPOINTMENT_OCCUPANCY_RATE_DISPLAY)),l(2),p("ngIf",!t.isSmallScreen&&t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_BIRTHDAYS_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_PATIENT_FUNNEL_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_RECRUITMENT_DATA_DISPLAY)),l(),p("ngIf",t.displayComponent(t.dashboardDisplayTypes.APP_DASHBOARD_DEMOGRAPHIC_DATA_DISPLAY))}}var ZV=(()=>
32{let n=class n{constructor(i,a,o,r,s,c,d){this.mainBackgroundService=i,this.dashboardService=a,this.breakpointObserver=o,this.userSubscriptionBannerService=r,this.dashboardOnboardingCardStorageService=s,this.crispService=c,this.vediusSupportService=d,this.userContext=ht(Te),this.profileOnboarding=ht(gl),this.userVediusFromStream=qn(this.userContext.getAsObservable().pipe($n(u=>u??this.userContext.get()??this.userContext.current)),{initialValue:this.userContext.current}),this.greetingDisplayName=ut(()=>{let u=this.userVediusFromStream()?.name?.firstName?.trim()??"";return u&&gs(u)||""}),this.greetingI18n=ut(()=>{let u=this.today.getHours(),g=this.greetingDisplayName();return u>=18||u<5?g?{key:"DASHBOARD_PAGE.NIGHT_TITLE",params:{name:g}}:{key:"DASHBOARD_PAGE.NIGHT_TITLE_FALLBACK",params:{}}:u>=5&&u<12?g?{key:"DASHBOARD_PAGE.MORNING_TITLE",params:{name:g}}:{key:"DASHBOARD_PAGE.MORNING_TITLE_FALLBACK",params:{}}:g?{key:"DASHBOARD_PAGE.AFTERNOON_TITLE",params:{name:g}}:{key:"DASHBOARD_PAGE.AFTERNOON_TITLE_FALLBACK",params:{}}}),this.today=new Date,this.isLoading=!0,this.hasMinimumDataToLoad=!1,this.noDataToLoadConfirmed=!1,this.isXSmallDesktop=!1,this.isSmallScreen=!1,this.subscriptions=[],this.showSubscriptionBanner=!0,this.showOnboardingCard=!0,this.dashboardDisplayTypes=zs,this.mainBackgroundService.changeBackgroundColor(Tl.NEUTRAL_LIGHTER)}get userVedius(){return this.userContext.current}get isProfileIncomplete(){return this.profileOnboarding?.isProfileIncomplete()}get hasFinancialBalanceAccess(){return this.userVedius.type===_e.Clinic?this.userVedius?.clinicRole!==Vi.COLLABORATOR:!0}get isClinic(){return this.userVedius?.type===_e.Clinic}get isTrial(){return this.userVedius?.settings?.platformAccess?.isTrial??!1}get isAnySecretaryRole(){return this.isClinic?this.userVedius.hasAnySecretaryRoleType():!1}ngOnInit(){return B(this,null,function*(){this.isLoading=!0,this.showSubscriptionBanner=this.userSubscriptionBannerService.showBanner(),this.showOnboardingCard=!this.dashboardOnboardingCardStorageService.isDismissed(),this.listenSize(),setTimeout(()=>{this.crispService.ensureVisibilityOnDashboard()},200);try{this.hasMinimumDataToLoad=yield this.dashboardService.hasMinimumDataToLoad()}catch(i){console.error("Error to load dashboard page: ",i)}finally{this.isLoading=!1,this.noDataToLoadConfirmed=!this.hasMinimumDataToLoad}})}openVediusDemo(){this.vediusSupportService.openVediusDemo()}listenSize(){let i=this.breakpointObserver.observe([fs]).subscribe(o=>{this.isXSmallDesktop=o.matches}),a=this.breakpointObserver.observe([ui]).subscribe(o=>{this.isSmallScreen=o.matches});this.subscriptions=[i,a]}displayComponent(i){let a=this.userVedius?.settings?.dashboardDisplaySettings;return a?a.settingsTypes?.[i]??!1:!0}closeSubscriptionBanner(){this.showSubscriptionBanner=!1}closeOnboardingCard(){this.dashboardOnboardingCardStorageService.dismiss(),this.showOnboardingCard=!1}ngOnDestroy(){this.mainBackgroundService.reset(),this.subscriptions.forEach(i=>i.unsubscribe())}};n.\u0275fac=function(a){return new(a||n)(y(Al),y(Hm),y(Ri),y(Da),y(pl),y(dl),y(qt))},n.\u0275cmp=O({type:n,selectors:[["app-dashboard"]],decls:6,vars:8,consts:[["defaultDashboardTemplate",""],["secretaryDashboardTemplate",""],[1,"dashboard"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[1,"dashboard-wrapper"],[4,"ngIf"],[1,"dashboard-header-wrapper"],["variant","display",1,"neutral-dusk-color",3,"size"],["variant","secondary","iconType","both",3,"fullSize","icons","onClick",4,"ngIf"],[1,"dashboard-content-wrapper"],[3,"hasMinimumDataToLoad","isPageLoading","isSmallScreen","loadingDelay",4,"ngIf"],[1,"dashboard-containers"],[1,"dashboard-container"],[3,"isSmall","loadingDelay",4,"ngIf"],[1,"dashboard-container-right"],[3,"showImage","onClose",4,"ngIf"],[3,"onClose","showImage"],["variant","secondary","iconType","both",3,"onClick","fullSize","icons"],[3,"showImage","isSmall","onClose",4,"ngIf"],[3,"onClose","showImage","isSmall"],[3,"hasMinimumDataToLoad","isPageLoading","isSmallScreen","loadingDelay"],[3,"isSmall","loadingDelay"]],template:function(a,o){if(a&1&&(m(0,"div",2),C(1,iy,2,1,"ng-container",3),h(),C(2,xy,21,16,"ng-template",null,0,me)(4,ky,18,13,"ng-template",null,1,me)),a&2){let r=he(5);X("small",o.isSmallScreen)("small-desktop",o.isXSmallDesktop&&!o.isSmallScreen)("active-user-state",!o.isTrial&&!o.noDataToLoadConfirmed),l(),p("ngIf",!o.isAnySecretaryRole)("ngIfElse",r)}},dependencies:[z,ze,ac,lc,j,zc,Uc,Kc,Am,Lm,Mm,Vm,zm,$,Y,re],styles:[".disable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.enable-text-copies[_ngcontent-%COMP%]{-webkit-user-select:text!important;-moz-user-select:text!important;
32-ms-user-select:text!important;user-select:text!important}.icon-circle[_ngcontent-%COMP%]{width:40px;height:40px;padding:8px;background:#f5f6f8;border-radius:100px;justify-content:center;align-items:center;gap:10px;display:inline-flex;box-sizing:border-box}.dashboard[_ngcontent-%COMP%]{height:100%;padding:40px}.dashboard[_ngcontent-%COMP%] .dashboard-header-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;gap:12px}.dashboard.active-user-state[_ngcontent-%COMP%]{padding:30px 40px 40px}.dashboard[_ngcontent-%COMP%] .neutral-dusk-color[_ngcontent-%COMP%]{color:#192840}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:40px}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] app-dashboard-onboarding-card[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] app-dashboard-user-subscription-banner[_ngcontent-%COMP%]{width:100%}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:24px;width:100%}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] app-dashboard-cards-info[_ngcontent-%COMP%]{width:100%}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;width:100%}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;width:97%}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%] app-dashboard-birthdays[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%] app-dashboard-appointments[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%] app-dashboard-appointment-occupancy-rate[_ngcontent-%COMP%]{width:97%}@media screen and (max-width: 600px){.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%]{width:100%}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%] app-dashboard-birthdays[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%] app-dashboard-appointments[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%] app-dashboard-appointment-occupancy-rate[_ngcontent-%COMP%]{display:block;width:100%}}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;gap:24px;width:97%;box-sizing:border-box}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-financial-balances[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-recruitment-data[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-demographic-data[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-patient-funnel[_ngcontent-%COMP%]{width:97%}@media screen and (max-width: 600px){.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%]{width:100%;align-items:stretch}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-financial-balances[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-recruitment-data[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-demographic-data[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] app-dashboard-patient-funnel[_ngcontent-%COMP%]{display:block;width:100%}}.dashboard[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%] .left-card[_ngcontent-%COMP%]{width:100%;border-radius:12px;border:1px solid #f5f6f8;background:#fff;height:calc(100vh - 260px)}.dashboard.small-desktop[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;justify-content:flex-start}.dashboard.small-desktop[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%]{align-items:flex-end!important;width:100%}.dashboard.small-desktop[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%]{width:100%;box-sizing:border-box}.dashboard.small[_ngcontent-%COMP%]{padding-top:24px;padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px));padding-bottom:calc(108px + env(safe-area-inset-bottom,0px))}.dashboard.small[_ngcontent-%COMP%] .dashboard-containers[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:stretch;align-self:stretch;width:100%;min-width:0}.dashboard.small[_ngcontent-%COMP%] .dashboard-container[_ngcontent-%COMP%]{align-self:stretch;min-width:0}.dashboard.small[_ngcontent-%COMP%] .dashboard-container-right[_ngcontent-%COMP%]{align-items:stretch;align-self:stretch;padding:0;min-width:0}.dashboard.small[_ngcontent-%COMP%] .dashboard-header-wrapper[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.dashboard.small[_ngcontent-%COMP%] .dashboard-header-wrapper[_ngcontent-%COMP%] vedius-button[_ngcontent-%COMP%]{width:100%}.dashboard.small[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%]{align-items:stretch;gap:24px;min-width:0}.dashboard.small[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%]:first-child{gap:16px}.dashboard.small[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] .dashboard-content-wrapper[_ngcontent-%COMP%]{align-items:stretch;align-self:stretch;min-width:0}.dashboard.small[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] app-dashboard-onboarding-card[_ngcontent-%COMP%], .dashboard.small[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] app-dashboard-user-subscription-banner[_ngcontent-%COMP%], .dashboard.small[_ngcontent-%COMP%] .dashboard-wrapper[_ngcontent-%COMP%] app-dashboard-cards-info[_ngcontent-%COMP%]{display:block;min-width:0}"]});let e=n;return e})();export{ZV as DashboardComponent};
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.