PageSourceSearch

https://app.waitwhile.com/chunk-BTJTDE3G.js

js waitwhile.com collected 2026-10-01 10:17:18 UTC 323,764 bytes, 228 lines download raw bytes

1import{a as Zr}from"./chunk-U5BD2E7P.js";import{$c as Xa,Ae as tn,Be as Qr,C as Gr,Cc as Fe,De as an,Ec as Qt,Fc as Nt,Ha as jr,Hc as Q,Ia as Xt,L as Hr,bd as Qa,cd as Ue,db as qr,dd as fe,ed as ue,fd as ye,gd as Ce,hd as Za,i as Vr,id as Ja,k as Pr,l as zr,m as Yr,ma as bi,o as Ur,pa as qa,re as en,se as bt,ta as Ka,te as Ti,ue as Kr,v as ja,ve as ut,we as Ot,x as Oe,xe as oi,ye as Ve,ze as Xr}from"./chunk-TN5ZZO3Q.js";import{$f as Mt,$k as kn,$r as br,$u as Ir,A as xi,Aa as B,Ab as $e,Ad as Ye,Ae as zo,Al as at,Am as Xe,Ay as Nr,Ba as Le,Bb as Eo,Bm as Ci,By as Or,Cl as Oa,Co as fr,Ct as En,D as $,Dc as Ia,Dm as pr,Ea as $o,Ef as Fi,El as Va,F as $a,Fb as o,Ga as _,Gb as r,Gd as k,H as Ao,Ha as Re,Hb as le,He as Yo,Hi as Zo,Hn as pe,Ia as v,Ic as pi,If as bn,Ja as Yt,Jb as gt,Je as jt,K as I,Ka as It,Ke as Uo,Kt as kr,L as La,La as We,Lc as Ht,Ld as oe,Li as Jo,Ln as me,M as Wi,Ma as Ie,Mi as er,N as ie,Na as p,Nf as Ho,Ni as Ln,Nk as Na,O as Ze,Oa as d,Ob as xo,Oc as Mo,Of as jo,Om as Be,On as wi,Pa as m,Pd as mi,Pf as qo,Pl as lr,Pn as ge,Q as Ra,Qa as A,Qb as Wa,Rb as Gt,Rm as mr,S as li,Sb as L,Sm as dr,Te as Ke,Tf as Ma,Tn as Ni,Tt as St,Ua as Pe,Ub as Wo,Up as X,V as Wt,Va as ze,Vf as Ba,Vm as dt,Vt as Ua,Vu as Wr,W as bo,Wa as Je,Wb as ce,Wk as nr,Wl as cr,Xa as ae,Xj as ir,Xk as P,Xt as At,Ya as ka,Yb as Io,Ye as Go,Yj as ar,Yk as hi,Yn as Oi,Yo as yr,Z as w,Za as Ea,Zk as fi,Zo as Cr,Zu as Ha,_a as te,_k as Rn,_n as Vi,_o as wr,_r as za,ab as yt,ae as Mi,aq as _r,as as Tr,bb as Ct,bg as Fa,bq as vr,br as Ar,bs as Dr,bu as Er,bv as Mr,c as De,ca as G,cb as Lo,cd as Bo,cs as $r,cv as Kt,da as H,db as E,dl as _t,do as ni,ds as Lr,e as vn,ea as To,eb as f,ee as we,eg as Tn,el as or,eq as Sr,gg as Dn,gl as Ft,gu as Ga,hg as $n,ho as Pi,hu as Ai,i as b,id as ai,iq as Pa,is as Ya,jd as se,je as it,jo as zi,k as Ee,kg as Bt,kj as tr,kl as ve,ku as xr,l as c,lb as et,m as T,ma as Y,mb as Ro,md as Lt,me as Vo,mm as he,nb as tt,nd as Fo,o as zt,ob as xa,om as qt,pb as ko,pc as Ae,pg as Ko,po as gi,qa as Ii,qb as U,qg as Me,ql as ke,qm as yi,qo as _i,rb as _e,rf as di,rg as Xo,sb as xe,sd as qe,se as Sn,sg as Qo,sl as rr,ta as l,te as Po,to as Yi,ub as R,uc as Ne,ud as No,ue as An,ut as Rr,uy as Br,v as Qe,vb as N,vd as Oo,ve as Bi,vj as ui,vo as vi,vp as Si,wb as x,wp as gr,xa as D,ya as Do,yc as be,yn as ur,yo as hr,yp as vt,za as ci,zl as sr,zo as de,zy as Fr}from"./chunk-N6MTJI5Q.js";import"./chunk-UNNH6OJB.js";import{a as j,b as K,h as mt}from"./chunk-HE2D45TV.js";var Jr=100,es=400,nn={"customer-distribution":"new-vs-returning","customer-registrations":"customers","financials-locations":"financials-location-revenue","financials-service-price":"financials-service-revenue","financials-value-costs":"financials-revenue","top-visited-locations":"top-locations","traffic-by-period":"visit-trend","visits-by-creator-source":"registration-details","visits-distribution":"visits-heatmap"},Tt={pageIndex:0,pageSize:18,length:18},xn={overview:$localize`Overview`,visits:$localize`Visits`,"guest-experience":$localize`Guest experience`,messages:$localize`Messages`,operations:$localize`Operations`,services:$localize`Services`,"
1input-fields":$localize`Input fields`,financials:$localize`Financials`,surveys:$localize`Surveys`,"more-analytics":$localize`More analytics`,upgrade:$localize`Upgrade`},Wn={overview:$localize`Overview`,visits:$localize`Visits`,"guest-experience":$localize`Guest experience`,messages:$localize`Messages`,operations:$localize`Operations`,services:$localize`Services`,"input-fields":$localize`Input fields`,financials:$localize`Financials`,surveys:$localize`Surveys`,"more-analytics":Va({components:[$localize`More analytics`,ve(Ur)]}),upgrade:$localize`Upgrade`},Ui=qe()(["numVisits","numRegistrations.booking","numRegistrations.waitlist","numRegistrations.waitlistedBooking","numDropoff","numServed.total","numCompleted.total","numNoShowed.total","numCancelled.total","numRemoved.total","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]),on=[...Ui].filter(a=>!["avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"].includes(a)),ee={numVisits:$localize`All visits`,"numRegistrations.booking":$localize`Bookings`,"numRegistrations.waitlist":$localize`Waitlisted`,"numRegistrations.waitlistedBooking":$localize`Waitlisted bookings`,numDropoff:$localize`Dropoff`,"numServed.total":$localize`Served`,"numCompleted.total":$localize`Completed`,"numNoShowed.total":$localize`No-show`,"numCancelled.total":$localize`Cancelled`,"numRemoved.total":$localize`Removed`,avgWaitDuration:$localize`Avg wait duration`,avgServeDuration:$localize`Avg serve duration`,maxWaitDuration:$localize`Longest wait`,maxServeDuration:$localize`Longest serve duration`},Di=qe()(["date","week","month","dayOfWeek","hourOfDay"]),rn={date:$localize`Date`,week:$localize`Week`,month:$localize`Month`,dayOfWeek:$localize`Day of week`,hourOfDay:$localize`Hour of day`},ts={SUNDAY:"sun",MONDAY:"mon",TUESDAY:"tue",WEDNESDAY:"wed",THURSDAY:"thu",FRIDAY:"fri",SATURDAY:"sat"},is={1:"MONDAY",2:"TUESDAY",3:"WEDNESDAY",4:"THURSDAY",5:"FRIDAY",6:"SATURDAY",7:"SUNDAY"},as=[Ni,ni,Vi,Oi,zi,Pi,_i,Yi],ns={[Ni.id]:$localize`Compared to the previous day`,[ni.id]:$localize`Compared to the previous 7 days`,[Vi.id]:$localize`Compared to the same days in the previous week`,[Oi.id]:$localize`Compared to the previous week`,[zi.id]:$localize`Compared to the same days in the previous month`,[Pi.id]:$localize`Compared to the previous month`,[_i.id]:$localize`Compared to the same days in the previous year`,[Yi.id]:$localize`Compared to the previous year`};function os(a){try{let t=new Intl.Locale(a).getWeekInfo()?.firstDay;return se(t)?t:1}catch(u){return 1}}function sn(a){return Di.includes(a)}function Zt(a){let u=a;return a!==null&&Array.isArray(u.data)&&Sn(u.fromDate)&&Sn(u.toDate)}function rs(a){return a==="date"||a==="month"||a==="weekStarting"||a==="dayOfWeekNumber"}function Jt(a){return qe()(["numVisits","numRegistrations.booking","numRegistrations.waitlist","numRegistrations.waitlistedBooking","numDropoff","numServed.total","numCompleted.total","numNoShowed.total","numCancelled.total","numRemoved.total","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]).includes(a)}function ss(a){if(a.length<2||a.length>3)return null;let[u,e,t]=a;return e.path in nn?{consumed:a,posParams:t?{tab:u,chart:e,hash:t}:{tab:u,chart:e}}:null}function Bs(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messages,"1.0-0"))}}function Fs(a,u){a&1&&A(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var In=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Messages: The total number of sent and received customer messagess and users across all channels (email, sms, chat) regardless of delivered state.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.messages,response:t,previous:t?.data[0]?.numMessages??0,rangeLabel:i})),$((e,t)=>
1k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.numMessages}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-alerts-messages"]],hostAttrs:[1,"ww-analytics-alerts-messages"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Messages`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),te(5,0),m(),R(6),o(7,"async"),_(8,Bs,5,10,"ww-metric-value",3)(9,Fs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(7,3,i.currentData$));l(2),v(n?8:9)}},dependencies:[Ce,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function Os(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messagesPerCustomer,"1.0-1"))}}function Vs(a,u){a&1&&A(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Mn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Messages per customer: The average number of sent and received messages per unique customer. All channels (email, sms, chat) regardless of delivered state. The count of unique customers used in this calculation is an approximation.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>{let n=(t?.data[0]?.approxUniqueCustomers??0)>0?Math.fround((t?.data[0]?.numMessagesByRecipient?.guest??0)/(t?.data[0]?.approxUniqueCustomers??0)):0;return ue({current:e.messagesPerCustomer,response:t,previous:n,rangeLabel:i})}),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messagesPerCustomer:t.approxUniqueCustomers>0?Math.fround(t.numMessagesByRecipient.guest/t.approxUniqueCustomers):0}:{messagesPerCustomer:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-alerts-messages-per-customer"]],hostAttrs:[1,"ww-analytics-alerts-messages-per-customer"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Messages per customer`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),te(5,0),m(),R(6),o(7,"async"),_(8,Os,5,10,"ww-metric-value",3)(9,Vs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(7,3,i.currentData$));l(2),v(n?8:9)}},dependencies:[Ce,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function zs(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messageSegments,"1.0-0"))}}function Ys(a,u){a&1&&A(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Bn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Message segments: The total number of incoming and outgoing message segments to customers and users across all channels regardless of delivered state.
2
3  Messages longer than 160 characters are automatically split into parts (called ""segments"") and then re-assembled when they are received. Message concatenation allows you to send long SMS messages, but this increases your per-message cost, because SMS are billed per segment.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.messageSegments,response:t,previous:t?.data[0]?.numMessageSegments??0,rangeLabel:i})),$((e,t)=>
3k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messageSegments:t.numMessageSegments}:{messageSegments:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-alerts-messages-segments"]],hostAttrs:[1,"ww-analytics-alerts-messages-segments"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Message segments`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),te(5,0),m(),R(6),o(7,"async"),_(8,zs,5,10,"ww-metric-value",3)(9,Ys,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(7,3,i.currentData$));l(2),v(n?8:9)}},dependencies:[Ce,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function Gs(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messages,"1.0-0"))}}function Hs(a,u){a&1&&A(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Fn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Automatic SMS: The number of SMS messages that were automatically sent as a result of an event (e.g. customer registered to a Waitlist, customer cancelled a visit)`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.messages,response:t,previous:t?.data[0]?.smsMessagesByOriginType?.automatic??0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.smsMessagesByOriginType.automatic}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-alerts-sms-automatic"]],hostAttrs:[1,"ww-analytics-alerts-sms-automatic"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Automatic SMS`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),te(5,0),m(),R(6),o(7,"async"),_(8,Gs,5,10,"ww-metric-value",3)(9,Hs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(7,3,i.currentData$));l(2),v(n?8:9)}},dependencies:[Ce,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function qs(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messages,"1.0-0"))}}function Ks(a,u){a&1&&A(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Nn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Custom SMS: The number of SMS messages that were sent manually as custom messages (e.g. saved replies, individual messages sent/received from a specific customer)`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.messages,response:t,previous:t?.data[0]?.smsMessagesByOriginType?.custom??0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.smsMessagesByOriginType.custom}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-alerts-sms-custom"]],hostAttrs:[1,"ww-analytics-alerts-sms-custom"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Custom SMS`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),te(5,0),m(),R(6),o(7,"async"),_(8,qs,5,10,"ww-metric-value",3)(9,Ks,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(7,3,i.currentData$));l(2),v(n?8:9)}},dependencies:[Ce,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function Qs(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messages,"1.0-0"))}}function Zs(a,u){a&1&&A(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var On=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Triggered SMS: The number of SMS messages that were sent as a result of a triggered manual action (e.g. User alerts customer, marks customer as a no show, or rejects a customers appointment request)`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
3k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.messages,response:t,previous:t?.data[0]?.smsMessagesByOriginType?.triggered??0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.smsMessagesByOriginType.triggered}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-alerts-sms-triggered"]],hostAttrs:[1,"ww-analytics-alerts-sms-triggered"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Triggered SMS`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),te(5,0),m(),R(6),o(7,"async"),_(8,Qs,5,10,"ww-metric-value",3)(9,Zs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(7,3,i.currentData$));l(2),v(n?8:9)}},dependencies:[Ce,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();var $i=20,ln=qe()(["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]);function cn(a){return a.reduce((u,e)=>{let t=e;for(let i in Object.keys(t))if(t[i]?.isOpen)for(let n of we(t[i].periods)){u===null&&(u={first:23,last:0});let s=parseInt(n.from.split(":")[0]);s<u.first&&(u.first=s);let h=parseInt(n.to.split(":")[0]);h>u.last&&(u.last=h)}return u},null)}function el(a){let u=-1,e=-1;if(a.length>0){for(let[t,i]of a.entries())i>0&&(t<u||u===-1)&&(u=t);for(let[t,i]of[...a].reverse().entries())i>0&&(t<e||e===-1)&&(e=t);e=a.length-e}return{first:u,last:e}}function ps(a){let u=-1,e=-1;for(let t of a){let i=el(t);(i.first>u||u===-1)&&(u=i.first),(i.last<e||e===-1)&&(e=i.last)}return{first:u,last:e}}var ls=["#3B6BC5","#6DBC45","#ED7DEC","#49B8D6","#AE76F6","#F2B053","#39C295","#EB5252","#023FB2","#42A60E","#E859E6","#14A2C9","#9850F4","#EE9922","#00AE74","#E52020","#7497D8","#98D27C","#F2A1F2","#7ECEE3","#C49CF8","#F6C784","#72D6B6","#F18484"],cs=[["#3B6BC5","#9CA4FD"],["#6DBC45","#D5E5A7"],["#ED7DEC","#FCA4F9"],["#49B8D6","#AADEE9"],["#AE76F6","#D0B1F6"],["#F2B053","#FEDA7B"],["#39C295","#AFE6AD"],["#EB5252","#F98E75"],["#023FB2","#9CA4FD"]];function Vt(a){return ls[a%ls.length]}function Se(a,u=!1){return cs[a%cs.length][u?1:0]}function pn(a,u){if(a===1)return u;let e=ln.indexOf(u),t=(a-1+e)%ln.length;return ln[t]}function Ut(a,u=!1){let e=ts[a];return u?ar[e]:ir[e]}var J=(()=>{class a extends _t{constructor(){super(...arguments),this.analyticsService=w(ne),this.breakpoints=w(ke),this.layout=w(Kt),this.route=w(pi),this.router=w(Ht),this.currentTab$=this.route.params.pipe(c(e=>e.tab)),this.currentChart$=this.route.params.pipe(c(e=>e.chart)),this.hasData$=zt(()=>this.dataMap$).pipe(c(e=>(e?.rows.length??0)>0)),this.exportData$=zt(()=>this.dataMap$).pipe(c(e=>{if(!e||e.rows.length<1)return null;let t=e.columns.map(s=>`${s.label}`),i=e.columns.map(s=>s.key),n=e.rows.map(s=>Object.keys(s).reduce((h,S)=>(h[S]=Qt(s,S),h),{}));return{columns:t,keys:i,rows:n,fileName:`${this.chartId}-${e.dateRange}.csv`}})),this.fullscreen$=this.currentChart$.pipe(c(e=>se(e)))}onTitleClicked(){return mt(this,null,function*(){if(yield Ee(this.fullscreen$))return;let t=yield Ee(this.currentTab$);this.router.navigateByUrl(`account/analytics/${t}/${this.chartId}${window.location.search}`)})}onChartClicked(){return mt(this,null,function*(){if((yield Ee(this.fullscreen$))||(yield Ee(this.breakpoints.isBelowMobile$)))return;let i=yield Ee(this.currentTab$);this.router.navigateByUrl(`account/analytics/${i}/${this.chartId}${window.location.search}`)})}export(){return mt(this,null,function*(){let e=yield Ee(zt(()=>this.exportData$));if(e){let t=this.analyticsService.createCsvData(e.columns,e.keys,e.rows);Bo(t,e.fileName)}})}setTitleForFullscreenChart(){T([this.currentTab$,this.title$,this.fullscreen$]).pipe(Qe(([e,t,i])=>i===!0),Ze(this.ngOnDestroy$)).subscribe(([e,t,i])=>{this.layout.updateFeatureContext({name:pr({component:at({content:t,truncate:!0}),content:t,withTouch:!0}),breadcrumbName:t,breadcrumbs:[{name:$localize`Analytics`,routerLink:`/account/analytics/${e}${window.location.search}`}]})})}ngOnInit(){this.setTitleForFullscreenChart()}
3persistObservableInQueryString(e,t){e.pipe(La(1),Ze(this.ngOnDestroy$)).subscribe(i=>{this.analyticsService.persistFormControlValue(t,`${i}`)})}getDayOfWeekName(e,t){return Ut(e.dayOfWeek,!t)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275dir=ci({type:a,features:[B]})}}return a})();function tl(a,u){if(a&1&&A(0,"img",6),a&2){let e=f().$implicit;p("src",e.image,Ii)}}function il(a,u){if(a&1&&(d(0,"div",3)(1,"div",4),U(2),m(),d(3,"div",5),_(4,tl,1,1,"img",6),d(5,"div",7),A(6,"ww-text",8),m()()()),a&2){let e=u.$implicit,t=f(3);l(2),xe(" ",e.x," "),l(),p("wwBackgroundColor",e.fillColor)("wwBorderColor",e.fillColor)("wwTooltip",e.x)("wwTooltipWithTouch",!0),l(),v(e.image?4:-1),l(),p("wwBackgroundColor",e.fillColor)("wwColor","white"),l(),p("content",t.getDuration(e.y))("truncate",!0)}}function al(a,u){if(a&1&&(d(0,"div",1),We(1,il,7,10,"div",3,Yt),m()),a&2){let e=f();l(),Ie(e.series)}}function nl(a,u){if(a&1&&(d(0,"td",4),U(1),m()),a&2){let e=f().$implicit;l(),xe(" ",e.x," ")}}function ol(a,u){if(a&1&&A(0,"img",6),a&2){let e=f(3).$implicit;p("src",e.image,Ii)}}function rl(a,u){if(a&1&&(d(0,"td")(1,"div",11),_(2,ol,1,1,"img",6),d(3,"div",7),A(4,"ww-text",8),m()()()),a&2){let e=f(2).$implicit;f(2);let t=x(0),i=f();Ro("width",e.right-e.left,"%"),$o("colspan",t?3:1),l(),p("wwBackgroundColor",e.fillColor)("wwBorderColor",e.fillColor)("wwTooltip",e.x)("wwTooltipWithTouch",!0),l(),v(e.image?2:-1),l(),p("wwBackgroundColor",e.fillColor)("wwColor","white"),l(),p("content",i.getDuration(e.y))("truncate",!0)}}function sl(a,u){a&1&&A(0,"td")}function ll(a,u){if(a&1&&_(0,rl,5,12,"td",10)(1,sl,1,0,"td"),a&2){let e=u.$implicit;f();let t=x(0);v(e===t?0:1)}}function cl(a,u){if(a&1&&(R(0),d(1,"tr"),_(2,nl,2,1,"td",4),We(3,ll,2,1,null,null,It),m()),a&2){let e=u.$index,t=f(2);f();let i=x(0);N(e),l(2),v(i?2:-1),l(),Ie(t.indexes)}}function pl(a,u){if(a&1){let e=ae();d(0,"table",9),E("click",function(){G(e);let i=f(2);return H(i.onChartClicked())}),d(1,"tbody"),We(2,cl,5,2,"tr",null,Yt),m()()}if(a&2){let e=f();f();let t=x(0);tt("cursor-pointer",!t),l(2),Ie(e.series)}}function ml(a,u){if(a&1&&(R(0),o(1,"async"),_(2,al,3,0,"div",1)(3,pl,4,2,"table",2)),a&2){let e=f(),t=x(0),i=N(r(1,1,e.breakpoints.isBelowSmall$));l(2),v(i&&t?2:3)}}var dl=qe()(["avgBookingLeadDuration","avgBookingToServeDuration","avgWaitDuration","avgAlertToServeDuration","avgServeDuration"]),ms={avgBookingLeadDuration:$localize`Booking lead`,avgBookingToServeDuration:$localize`Booking to serve`,avgWaitDuration:$localize`Wait`,avgAlertToServeDuration:$localize`Alert to serve`,avgServeDuration:$localize`Serve duration`},Vn={avgBookingLeadDuration:P["average-durations-booking-lead"],avgBookingToServeDuration:P["average-durations-booking-to-serve"],avgWaitDuration:P["average-durations-wait"],avgAlertToServeDuration:P["average-durations-alert-to-serve"],avgServeDuration:P["average-durations-serve-duration"]},Gi=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="average-durations",this.durationService=w(Me),this.locationRx=w(At),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=T([this.analyticsService.reportData$,this.locationRx.getCurrentLocation(["isBookingActive"])]).pipe(c(([e,{isBookingActive:t}])=>this.createDataMap(e,t===!0)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Average durations`),this.tooltip$=b($localize`The Average durations chart summarizes the average durations for various steps in the customer flow.
4
5These steps include:
6- Booking lead: The average time between when the booking was submitted and the time of the appointment.
7- Booking to serve: The average duration between the appointment time and when the appointment was moved to the serving list.
8- Wait: The average time a visit was in the waitlist. This number excludes bookings that are automatically synced to the waitlist.
9- Alert to serve: The average time between a visit being alerted and being served.
10- Serve Duration: The average time a visit was in the serving list.`)}getDuration(e){let t=e??[];return t.length>1?this.durationService.transform(t[1]-t[0]):""}createDataMap(e,t){let i=e?.data[0];if(!i)return{series:[],indexes:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=0,s=t?dl:["avgWaitDuration","avgAlertToServeDuration","avgServeDuration"],h=[];s.reduce((V,y)=>{let O=((g,F)=>{let q=g[F]??0;return q>0?q:0})(i,y);return O===0?V:(n+=O,h.push({x:ms[y],y:[V,V+O],fillColor:Vn[y],left:0,right:0,image:Mi(Vn[y])}),V+O+1)},0);let W=100/(h[h.length-1]?.y[1]??0);
10for(let V of h)V.left=V.y[0]*W,V.right=V.y[1]*W;if(n===0)return{series:[],indexes:[],legendItems:[],dateRange:"",columns:[],rows:[]};let M=[{key:"name",label:$localize`State`,sortable:!0},{key:"avgDuration",label:$localize`Avg Duration`,sortable:!0}];return{hasData:!0,series:h,indexes:Array.from({length:h.length},(V,y)=>y),legendItems:s.map(V=>({color:Vn[V],label:ms[V],key:V})),dateRange:`${e.fromDate}-${e.toDate}`,columns:M,rows:h.map(V=>({name:V.x,avgDuration:this.durationService.transform(V.y[1]-V.y[0]-1)}))}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-average-durations"]],hostAttrs:[1,"ww-analytics-chart-average-durations"],standalone:!1,features:[B],decls:9,vars:20,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"flex","flex-col","gap-1","w-full"],[1,"w-full","border-separate","border-spacing-1",3,"cursor-pointer"],[1,"flex","items-center","justify-between","gap-1"],[1,"ww-analytics-chart-average-durations-row-label"],[1,"ww-analytics-chart-average-durations-row-duration-container","w-full",3,"wwBackgroundColor","wwBorderColor","wwTooltip","wwTooltipWithTouch"],[1,"print:visible","invisible",2,"height","100%","width","100%",3,"src"],[1,"ww-analytics-chart-average-durations-row-duration-value",3,"wwBackgroundColor","wwColor"],[3,"content","truncate"],[1,"w-full","border-separate","border-spacing-1",3,"click"],[3,"width"],[1,"ww-analytics-chart-average-durations-row-duration-container",3,"wwBackgroundColor","wwBorderColor","wwTooltip","wwTooltipWithTouch"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),d(2,"ww-chart-layout",0),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(7,ml,4,4),o(8,"async"),m()),t&2){let n,s=N(r(1,7,i.fullscreen$));l(2),p("chartTitle",r(3,10,i.title$))("tooltip",r(4,12,i.tooltip$))("loading",r(5,14,i.loading$))("dataMap",r(6,16,i.dataMap$))("isFullscreen",s)("showTable",s),l(5),v((n=r(8,18,i.dataMap$))?7:-1,n)}},dependencies:[Q,he,sr,Ci,L],styles:[`.ww-analytics-chart-average-durations .ww-chart-layout .ww-chart-layout-graph,.ww-analytics-chart-average-durations .ww-chart-layout .ww-chart-layout-graph-button{justify-content:center}.ww-analytics-chart-average-durations .ww-analytics-chart-average-durations-row-label{font-family:var(--ww-typography-caption1-font-family);font-size:var(--ww-typography-caption1-font-size);font-weight:var(--ww-typography-caption1-font-weight);line-height:var(--ww-typography-caption1-line-height);letter-spacing:var(--ww-typography-caption1-letter-spacing);min-width:128px;color:var(--ww-color-darkerGrey)}.ww-analytics-chart-average-durations .ww-analytics-chart-average-durations-row-duration-container{display:flex;justify-content:center;border-radius:6px;border-width:1px;border-style:solid;min-width:96px;height:40px;position:relative}.ww-analytics-chart-average-durations .ww-analytics-chart-average-durations-row-duration-value{font-family:var(--ww-typography-caption2-font-family);font-size:var(--ww-typography-caption2-font-size);font-weight:var(--ww-typography-caption2-font-weight);line-height:var(--ww-typography-caption2-line-height);letter-spacing:var(--ww-typography-caption2-letter-spacing);display:inline-flex;padding:2px 6px;border-radius:4px;border:1px solid var(--ww-color-white);min-width:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
11/*noopanalytics-chart-average-durations.component-53ERKTPW.css.map */
12`],encapsulation:2,changeDetection:0})}}return a})();var us=["1","2","3","4","5"],hs={1:"#E52020",2:"#F18484",3:"#86868B",4:"#98D27C",5:"#42A60E"};function hl(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",2),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}var Hi=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(Me),this.chartId="csat-distribution",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatDimensionsData)),this.dataMap$=T([this.fullscreen$,this.analyticsService.csatDimensionsData$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>
12k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Customer satisfaction distribution`),this.tooltip$=b($localize`The Customer satisfaction distribution chart shows the number of responses by satisfaction score.
13
14The Customer satisfaction distribution table displays the following metrics broken down by the response score: Responses, Average Original Position, Average wait, Average serve duration, and Dropoff rate`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=t.score,n=t.score,s=t.responses,h=s.toLocaleString();return{key:i,label:n,formattedValue:h,values:[{label:n,value:s,formattedValue:h,color:hs[t.score]}]}})))}createDataMap(e,t){let i=we(t?.data);if(!t||i.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"score",label:$localize`CSAT score`,sortable:!0},{key:"responses",label:$localize`Responses`,sortable:!0}];e&&n.push({key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0});let s=i.filter(S=>S.surveyAnswerValues&&S.surveyAnswerValues.length>0).map(S=>({score:S.surveyAnswerValues,responses:S.numSurveyAnswers??0,avgVisitOriginalPosition:S.avgVisitOriginalPosition??0,avgVisitWaitDuration:S.avgVisitWaitDuration??0,avgVisitServeDuration:S.avgVisitServeDuration??0,dropoffRatio:S.dropoffRatio??0})),h=us.map(S=>{let W=s.find(M=>M.score===S);return{score:S,responses:W?W.responses:0,avgVisitOriginalPosition:W?W.avgVisitOriginalPosition:0,avgVisitWaitDuration:W?this.durationService.transform(W.avgVisitWaitDuration):"-",avgVisitServeDuration:W?this.durationService.transform(W.avgVisitServeDuration):"-",dropoffRatio:W?`${(W.dropoffRatio*100).toFixed(0)}%`:"-"}});return{hasData:oe(h.map(S=>S.responses))>0,legendItems:[],hideLegend:!0,dateRange:`${t.fromDate}-${t.toDate}`,columns:n,rows:h}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-csat-distribution"]],hostAttrs:[1,"ww-analytics-chart-csat-distribution"],standalone:!1,features:[B],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(7,hl,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),v((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[Q,Be,L],encapsulation:2,changeDetection:0})}}return a})();var yl=()=>[];function Cl(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,yl))("type",e.type)}}var ji=(()=>{class a extends J{constructor(){super(...arguments),this.dateService=w(Bt),this.durationService=w(Me),this.chartId="csat-response-trend",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatResponseTrendData)),this.dataMap$=this.analyticsService.csatResponseTrendData$.pipe(li(this.analyticsService.dateRange$),c(([e,t])=>this.createDataMap(e,t?.id??null)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart(e.period,e.numSurveyAnswers,e.avgSurveyAnswerValue,e.labels))),this.title$=b($localize`Satisfaction over time`),this.tooltip$=b($localize`The Satisfaction over time chart is a trend over time of the average satisfaction score and the number of responses.
15
16Avg score: The average of the satisfaction scores for all responses on that date.
17
18Responses: The total number of responses on that date
19
20For visual clarity, the chart will dynamically roll up dates to weeks or months depending on the number of days selected.`)}formatTooltipLabel(e,t){if(e==="month")return this.dateService.transform(t,{hideTime:!0,hideDate:!0});if(e==="weekStarting"){let i=new Date(t),n=di(i,6);return this.dateService.transformDateRange({start:i,end:n},{hideTime:!0})}return e==="surveyAnswerDate"?this.dateService.transform(t,{hideTime:!0}):`${t}`}formatAxisLabel(e,t){return e==="month"?this.dateService.transform(t,{hideTime:!0,hideDate:!0}):e==="weekStarting"||e==="surveyAnswerDate"?this.dateService.transform(t,{hideTime:!0}):`${t}`}createDataMap(e,t){let i=e?.dimensions?.[0];if(!e||!$r(i))return{numSurveyAnswers:[],avgSurveyAnswerValue:[],labels:[],legendItems:[],dateRange:"",columns:[],rows:[],peri
20od:"surveyAnswerDate",pluckCellLabel:null};let n=[{key:"responses",label:$localize`Responses`,color:P["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:P["csat-avg-score"]}],s=[{key:"period",label:$localize`Period`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],h=we(e?.data).filter(C=>i==="weekStarting"?(C.weekStarting??"").length>0:i==="month"?(C.month??"").length>0:(C.surveyAnswerDate??"").length>0),S=t!==gi.id,W=Lr(h,i,e.fromDate,S?e.toDate:zo(Ma()),e.weekdayStart),M=W.map(C=>i==="weekStarting"?C.weekStarting:i==="month"?`${C.month??"2020-01"}-01`:C.surveyAnswerDate).map(C=>`${C}T00:00`),V=W.map(C=>{let O=C.surveyAnswerDate,g=this.dateService.transform(O,{hideTime:!0})??O;return i==="weekStarting"?O=C.weekStarting:i==="month"&&(O=`${C.month??"2020-01"}-01`,g=this.dateService.transform(O,{hideTime:!0,hideDate:!0})??O),{period:{value:g,sortableValue:O},numSurveyAnswers:C.numSurveyAnswers,avgSurveyAnswerValue:Math.round(C.avgSurveyAnswerValue*100)/100,avgVisitOriginalPosition:Math.round(C.avgVisitOriginalPosition*100)/100,avgVisitServeDuration:C.avgVisitServeDuration?this.durationService.transform(C.avgVisitServeDuration):"-",avgVisitWaitDuration:C.avgVisitWaitDuration?this.durationService.transform(C.avgVisitWaitDuration):"-",dropoffRatio:C.dropoffRatio>=0?`${Math.round(C.dropoffRatio*100).toFixed(0)}%`:"-"}}),y={numSurveyAnswers:V.map(C=>C.numSurveyAnswers),avgSurveyAnswerValue:V.map(C=>C.avgSurveyAnswerValue),avgVisitOriginalPosition:W.map(C=>C.avgVisitOriginalPosition),avgVisitServeDuration:W.map(C=>C.avgVisitServeDuration),avgVisitWaitDuration:W.map(C=>C.avgVisitWaitDuration),dropoffRatio:W.map(C=>C.dropoffRatio),labels:M,legendItems:n,dateRange:`${e.fromDate}-${e.toDate}`,columns:s,rows:V,period:i};return K(j({},y),{hasData:oe(y.numSurveyAnswers)>0||oe(y.avgSurveyAnswerValue)>0,hasInternalPadding:!0})}createChart(e,t,i,n){let s=Math.max(...t,0),h=[bt(),Ti({hideLabelForDatasetIndexes:[1]})],S={datasets:[{type:"bar",data:t,label:$localize`Responses`,borderColor:P["csat-responses"],backgroundColor:P["csat-responses"],yAxisID:"y0",order:2},{type:"line",data:i,label:$localize`Avg score`,borderColor:P["csat-avg-score"],backgroundColor:P["csat-avg-score"],yAxisID:"y1",order:1}],labels:n.map(M=>this.formatAxisLabel(e,M))},W=ut({datasets:{bar:{borderRadius:4,borderSkipped:"bottom",maxBarThickness:32}
20,line:{pointStyle:"rectRounded",pointBackgroundColor:P["csat-avg-score"],pointRadius:0,pointHoverRadius:6}},plugins:{tooltip:{callbacks:{title:M=>{let V=M[0]?.dataIndex??-1;return this.formatTooltipLabel(e,n[V]??M[0]?.label??"")},label:M=>{if(M.dataset.type==="bar")return`${M.dataset.label}: ${M.raw}`;let V=M.dataset.label,y=M.raw;return`${V}: ${(y??0).toFixed(1)}`}}}},scales:{x:{ticks:{autoSkip:!0,maxTicksLimit:12,maxRotation:0}},y:{display:!1},y0:{display:!1,min:0,max:Math.ceil(s*1.1)},y1:{display:!1,min:0,max:6}}});return{data:S,options:W,plugins:h,type:"bar"}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-csat-response-trend"]],hostAttrs:[1,"ww-analytics-chart-csat-response-trend"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","dataMap","loading","isFullscreen","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,Cl,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("dataMap",n)("loading",r(7,16,i.loading$))("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();function gl(a,u){if(a&1){let e=ae();d(0,"div",3)(1,"ww-link",5),E("click",function(){G(e);let i=f(2);return H(i.onTitleClicked())}),d(2,"span"),U(3),m(),A(4,"ww-icon",6),m()()}if(a&2){let e=f();l(3),xe("Show all ",e.total," responses")}}function _l(a,u){if(a&1){let e=ae();d(0,"div",4)(1,"ww-link",7),E("click",function(){G(e);let i=f(2);return H(i.loadNextPage())}),d(2,"span"),U(3,"Show more"),m()()()}if(a&2){f();let e=x(0);l(),p("disabled",e)("wwColor",e?"darkGrey":"black")}}function vl(a,u){if(a&1){let e=ae();R(0),o(1,"async"),d(2,"ww-table",2),o(3,"async"),E("rowClicked",function(){G(e);let i=f();return H(i.onChartClicked())}),m(),_(4,gl,5,1,"div",3),_(5,_l,4,2,"div",4),o(6,"async")}if(a&2){let e=u,t=f(),i=et(11),n=x(0),s=N(r(1,11,t.nextPageLoading$)??!1),h=e.showFullscreenLink&&!n;l(2),tt("ww-chart-layout-table-with-bottom-border",h),p("placeholder",i)("columns",e.columns)("data",r(3,14,t.tableRows$))("pluckCellLabel",e.pluckCellLabel)("selection","none")("withPointerStyles",!n)("loading",s),l(2),v(h?4:-1),l(),v(n&&r(6,16,t.hasNextPage$)?5:-1)}}function Sl(a,u){a&1&&Je(0)}function Al(a,u){if(a&1&&Le(0,Sl,1,0,"ng-container",8),a&2){f();let e=et(11);p("ngTemplateOutlet",e)}}function bl(a,u){a&1&&(d(0,"span",9),U(1,"No data available"),m())}var Ki=(()=>{class a extends J{constructor(){super(...arguments),this.dateService=w(Bt),this.chartId="csat-responses",this.nextPageTokenSub=new De(null),this.nextPageLoadingSub=new De(!1),this.nextPageLoading$=this.nextPageLoadingSub.asObservable(),this.tableRowsSub=new De([]),this.tableRows$=this.tableRowsSub.asObservable(),this.hasNextPage$=this.nextPageTokenSub.asObservable().pipe(c(e=>e&&e.length>0)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatAnswersData)),this.dataMap$=this.fullscreen$.pipe(ie(e=>{let t=e?20:5;return this.analyticsService.getCsatAnswers(t).pipe(c(i=>this.createDataMap(e,i)),$((i,n)=>k(i,n)),I({bufferSize:1,refCount:!0}))})),this.exportData$=this.analyticsService.getCsatAnswers().pipe(c(e=>{let t=this.getColumns(!0);if(!e)return{columns:t.map(h=>`${h.label}`),keys:t.map(h=>h.key),rows:[],fileName:`${this.chartId}-empty.csv`};let n=this.getTableRows(e).map(h=>Object.keys(h).reduce((S,W)=>(S[W]=Qt(h,W),S),{})),s=`${e.fromDate}-${e.toDate}`;return{columns:t.map(h=>`${h.label}`),keys:t.map(h=>h.key),rows:n,fileName:`${this.chartId}-${s}.csv`}})),this.chart$=b(null),this.title$=b($localize`Responses`),this.tooltip$=b($localize`A table of the individual responses. The table includes the following metrics:
21
22- Time: The timestamp of when the response was created
23- Location: The name of the location associated with the response
24- Visit ID: The Visit ID associated with the response
25- Position: The position of the visit when it was first placed on the waitlist (if applicable)
26- Service: The services associated with the visit (if applicable)
27- Resources: The resources associated with the visit (if applicable)
28- Tags: Any tags associated with the visit, such as ALERTED, NO-SHOW, DELAYED, etc.
29- Feedback: The written feedback associated with the satisfaction score (if provided)`)}loadNextPage(){return mt(this,null,function*(){let e=this.nextPageTokenSub.value;if(e){this.nextPageLoadingSub.next(!0);let t=yield Ee(this.analyticsService.getCsatAnswers(20,e));t?.pagination?.nextPageToken?this.nextPageTokenSub.next(t.pagination.nextPageToken):this.nextPageTokenSub.next(null);let i=this.getTableRows(t);this.tableRowsSub.next([...this.tableRowsSub.value,...i]),this.nextPageLoadingSub.next(!1)}})}getTableRows(e){let t=we(e?.data);return!e||t.length<1?[]:t.filter(i=>se(i.csatScore)).map(i=>K(j({},i),{csatScore:Yo(i.csatScore)}))}createDataMap(e,t){let i=this.getTableRows(t);if(this.nextPageTokenSub.next(t?.pagination?.nextPageToken||null),this.tableRowsSub.next(i),!t||i.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:i,pluckCellLabel:null};let n=t.pagination?.totalRows??i.length,s=e?i:i.slice(0,5),h=this.getColumns(e);return{hasData:i.length>0,legendItems:[],hideLegend:!0,dateRange:`${t.fromDate}-${t.toDate}
29`,columns:h,rows:s,total:n,showFullscreenLink:!e&&n>5,pluckCellLabel:S=>h.reduce((W,M)=>{if(M.key==="answerLocalTimestamp"){let V=S[M.key];if(Lt(V)&&Po(V))return K(j({},W),{[M.key]:at({content:this.dateService.transform(Bi(V),{hideTime:!0})})})}if(M.key==="visitId"){let V=S[M.key];if(Lt(V))return K(j({},W),{[M.key]:gr({content:V,inline:!0,type:"router-link",href:"/visits",queryParams:{params:{visitId:V}},$element:{color:"black"}})})}return K(j({},W),{[M.key]:S[M.key]})},{})}}getColumns(e){return e?[{key:"answerLocalTimestamp",label:$localize`Local time`,sortable:!0},{key:"locationName",label:$localize`Location`,sortable:!0},{key:"visitId",label:$localize`Visit ID`,sortable:!0},{key:"originalPosition",label:$localize`Position`,sortable:!0},{key:"serviceCombinations",label:$localize`Services`,sortable:!0},{key:"resourceCombinations",label:$localize`Resources`,sortable:!0},{key:"visitTags",label:$localize`Tags`,sortable:!0},{key:"csatScore",label:$localize`Score`,sortable:!0},{key:"csatFeedback",label:$localize`Feedback`,sortable:!0}]:[{key:"answerLocalTimestamp",label:$localize`Local time`,sortable:!0},{key:"locationName",label:$localize`Location`,sortable:!0},{key:"csatScore",label:$localize`Score`,sortable:!0},{key:"csatFeedback",label:$localize`Feedback`,sortable:!0}]}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-csat-responses"]],hostAttrs:[1,"ww-analytics-chart-csat-responses"],standalone:!1,features:[B],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"rowClicked","placeholder","columns","data","pluckCellLabel","selection","withPointerStyles","loading"],[1,"flex","justify-center","w-full","pt-5"],[1,"flex","justify-center","gap-2","w-full","pt-5"],["type","internal-in-same-tab","wwColor","black",3,"click"],["icon","bx-chevron-right","size","small"],["type","internal-in-same-tab",3,"click","disabled","wwColor"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),d(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()}),_(7,vl,7,18),o(8,"async"),Re(9,Al,1,1,"ng-container"),m(),Le(10,bl,2,0,"ng-template",null,0,gt)),t&2){let n,s=N(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),v((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Gt,Q,he,qt,Si,vt,Xe,L],styles:[`.ww-analytics-chart-csat-responses .ww-chart-layout.ww-chart-layout-fullscreen .ww-chart-layout-graph{max-height:unset}
30/*noopanalytics-chart-csat-responses.component-PC655G5P.css.map */
31`],encapsulation:2,changeDetection:0})}}return a})();function $l(a,u){if(a&1){let e=ae();d(0,"ww-funnel",3),o(1,"async"),E("click",function(){G(e);let i=f();return H(i.onChartClicked())}),m()}if(a&2){let e=f(),t=x(0);tt("cursor-pointer",!t),p("data",u)("showLegend",!1)("trimLabelSegments",!!r(1,5,e.trimLabelSegments$))}}function Ll(a,u){a&1&&(d(0,"span",2),U(1,"No data available"),m()),a&2&&p("wwTypography","body2")}var ri=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="customer-path",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.funnel$=T([this.fullscreen$,this.dataMap$]).pipe(c(([e,t])=>this.createChart(e,t.series,t.legendItems))),this.title$=b($localize`Customer path`),this.tooltip$=b($localize`The Customer path chart gives you insight into the path of visits through the steps in Waitwhile.
32
33The Customer Flow steps include:
34
35- Registration: The first step of the flow where visits are created as bookings or waitlisted visits.
36- Served: The second step of the flow where visits are marked as being served.
37- Completed: The final step of the flow where visits are marked as completed and are no longer an active visit.
38
39Breakdowns within each step:
40
41- Bookings: Scheduled appointments that are not waitlisted and did not drop off in the associated step. Tracked across all three steps.
42- Waitlisted bookings: Scheduled appointments that were waitlisted and did not drop off in the associated step. Tracked across all three steps.
43- Waitlist:  Waitlisted visits that were not bookings and did not drop off in the associated step. Tracked across all three steps.
44- Direct to served: Visits that bypassed the registration step and were placed directly into the serving list.
45- Direct to completed: Visits that bypassed the registration and served steps and were directly marked as completed (only possible via the API).
46- Auto-completed: Given the default setting is to auto-complete customers after a certain amount of time, we provide details on customers who were auto-completed so you can choose to count them or not count them as a completed customer.
47- Dropoff: Any created visit that was cancelled or marked as a no-show. Drop-offs can occur in either the registration or serving steps.`),this.trimLabelSegments$=T([this.breakpoints.isBelowMedium$,this.breakpoints.isBelowMobile$]).pipe(li(this.fullscreen$),c(([[e,t],i])=>t?!1:e||i))}createDataMap(e){let t=e?.data?.[0];if(!t)return{series:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[[t.numRegistrations.booking,t.numRegistrations.waitlistedBooking,t.numRegistrations.waitlist,NaN,NaN,NaN,t.numRegistrations.dropoff],[t.numServed.booking,t.numServed.waitlistedBooking,t.numServed.waitlist,t.numServed.directToServed,NaN,NaN,t.numServed.dropoff],[t.numCompleted.booking,t.numCompleted.waitlistedBooking,t.numCompleted.waitlist,t.numCompleted.directToServed,t.numCompleted.directToCompleted,t.numCompleted.autoCompleted,NaN]];if(oe(i.flatMap(s=>s.map(h=>isNaN(h)?0:h)))===0)return{series:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"name",label:$localize`Type`,sortable:!0},{key:"total",label:$localize`Total`,sortable:!0},{key:"booking",label:$localize`Bookings`,sortable:!0},{key:"waitlistedBooking",label:$localize`Waitlisted bookings`,sortable:!0},{key:"waitlist",label:$localize`Waitlist`,sortable:!0},{key:"directToServed",label:$localize`Direct to served`,sortable:!0},{key:"directToCompleted",label:$localize`Direct to completed`,sortable:!0},{key:"autoCompleted",label:$localize`Auto Completed`,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0},{key:"other",label:$localize`Other`,sortable:!0}];return{hasData:!0,series:i,legendItems:[{color:Vt(0),key:"bookings",label:$localize`Bookings`}
47,{color:Vt(1),key:"waitlisted-bookings",label:$localize`Waitlisted bookings`},{color:Vt(2),key:"waitlist",label:$localize`Waitlist`},{color:Vt(3),key:"direct-to-served",label:$localize`Direct to served`},{color:Vt(4),key:"direct-to-completed",label:$localize`Direct to completed`},{color:Vt(5),key:"auto-completed",label:$localize`Auto Completed`},{color:Vt(6),key:"dropoff",label:$localize`Dropoff`}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{name:$localize`Registration`,total:t.numRegistrations.total,booking:t.numRegistrations.booking,waitlistedBooking:t.numRegistrations.waitlistedBooking,waitlist:t.numRegistrations.waitlist,directToServed:0,directToCompleted:0,autoCompleted:0,dropoff:t.numRegistrations.dropoff,other:t.numRegistrations.other},{name:$localize`Served`,total:t.numServed.total,booking:t.numServed.booking,waitlistedBooking:t.numServed.waitlistedBooking,waitlist:t.numServed.waitlist,directToServed:t.numServed.directToServed,directToCompleted:0,autoCompleted:0,dropoff:t.numServed.dropoff,other:t.numServed.other},{name:$localize`Completed`,total:t.numCompleted.total,booking:t.numCompleted.booking,waitlistedBooking:t.numCompleted.waitlistedBooking,waitlist:t.numCompleted.waitlist,directToServed:t.numCompleted.directToServed,directToCompleted:t.numCompleted.directToCompleted,autoCompleted:t.numCompleted.autoCompleted,dropoff:0,other:t.numCompleted.other}]}}createChart(e,t,i){return t.length<1?null:{labels:[$localize`Registration`,$localize`Served`,$localize`Completed`],subLabels:[$localize`Bookings`,$localize`Waitlisted bookings`,$localize`Waitlist`,$localize`Direct to served`,$localize`Direct to completed`,$localize`Auto Completed`,$localize`Dropoff`],colors:i.map(n=>n.color),values:t,maxHeight:e?400:150}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-customer-path"]],hostAttrs:[1,"ww-analytics-chart-customer-path"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["id","path-funnel-graph",3,"cursor-pointer","data","showLegend","trimLabelSegments"],[1,"flex","self-center",3,"wwTypography"],["id","path-funnel-graph",3,"click","data","showLegend","trimLabelSegments"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),d(2,"ww-chart-layout",0),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),o(7,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(8,$l,2,7,"ww-funnel",1),o(9,"async"),Re(10,Ll,2,1,"span",2),m()),t&2){let n,s=N(r(1,7,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,10,i.title$))("tooltip",r(4,12,i.tooltip$))("loading",r(5,14,i.loading$))("dataMap",r(6,16,i.dataMap$))("isFullscreen",s)("showTable",r(7,18,i.fullscreen$)),l(6),v((n=r(9,20,i.funnel$))?8:10,n)}},dependencies:[tn,Q,Xe,L],styles:[`.ww-analytics-chart-customer-path{position:relative;width:100%}.ww-analytics-chart-customer-path .ww-chart-layout .ww-chart-layout-graph,.ww-analytics-chart-customer-path .ww-chart-layout .ww-chart-layout-graph .ww-chart-layout-graph-button{justify-content:center}.ww-analytics-chart-customer-path .ww-funnel{width:100%}
48/*noopanalytics-chart-customer-path.component-MMJDLN5A.css.map */
49`],encapsulation:2,changeDetection:0})}}return a})();var Rl=a=>({width:a}),kl=(a,u)=>u.key;function El(a,u){if(a&1&&(d(0,"div",6),A(1,"div",7),d(2,"div",8),U(3),m(),d(4,"div",9),U(5),m()()),a&2){let e=f().$implicit;l(),p("wwBackgroundColor",e.color),l(2),xe(" ",e.label," "),l(2),xe(" ",e.value," ")}}function xl(a,u){if(a&1&&(d(0,"div",4)(1,"div",5),U(2),m(),Le(3,El,6,3,"ng-template",null,0,gt),m()),a&2){let e=u.$implicit,t=et(4);xa(Eo(9,Rl,e.percent+"%")),p("wwBackgroundColor",e.color)("wwTooltip",t)("wwTooltipPanelClass","ww-analytics-chart-customers-tooltip-panel")("wwTooltipPosition","above")("wwTooltipShowDelay",50)("wwTooltipWithTouch",!0),l(2),xe(" ",e.value," ")}}function Wl(a,u){if(a&1&&(d(0,"div",2),We(1,xl,5,11,"div",3,kl),m()),a&2){f();let e=x(2);l(),Ie(e)}}var Xi=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="customers",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
49k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Customers`),this.tooltip$=b($localize`The Customer funnel chart shows the breakdown of number of people, number of parties, and the number of unique contacts within the time frame selected.
50
51- Total people: The summation of party size across all visits created in the time period selected.
52- Total parties: The total number of visits started. Bookings count based on the date of the appointment, not the date of creation. Direct to served and direct to completed visits also account for in this metric.
53- Unique parties: An approximate count of the unique customers with created visits in the time period selected. Example: If Customer 1 has two separate visits in November, the November report will count them as 1 unique customer. This number does not cleanly sum with any other number as Customer 1 could exist in different visit types or days.
54`),this.bars$=this.dataMap$.pipe(c(e=>{let t=Math.ceil(Math.max(e.customersIndividuals,e.customersTotalVisits,e.customersUnique)*1.1);return[{color:P["customers-total-people"],label:$localize`Total people`,key:"total-people",value:e.customersIndividuals,percent:e.customersIndividuals/t*100},{color:P["customers-total-parties"],label:$localize`Total parties`,key:"total-parties",value:e.customersTotalVisits,percent:e.customersTotalVisits/t*100},{color:P["customers-unique"],label:$localize`Unique parties`,key:"unique-parties",value:e.customersUnique,percent:e.customersUnique/t*100}]}),$((e,t)=>k(e,t)),this.shareReplay())}createDataMap(e){let t=e?.data?.[0];if(!t)return{customersIndividuals:0,customersTotalVisits:0,customersUnique:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:t.numIndividuals.total+t.numCreated+t.approxUniqueCustomers>0,customersIndividuals:t.numIndividuals.total,customersTotalVisits:t.numCreated,customersUnique:t.approxUniqueCustomers,legendItems:[{color:P["customers-total-people"],label:$localize`Total people`,key:"total-people"},{color:P["customers-total-parties"],label:$localize`Total parties`,key:"total-parties"},{color:P["customers-unique"],label:$localize`Unique parties`,key:"unique-parties"}],dateRange:`${e.fromDate} - ${e.toDate}`,columns:i,rows:[{name:$localize`Total people`,count:t.numIndividuals.total},{name:$localize`Total parties`,count:t.numCreated},{name:$localize`Unique parties`,count:t.approxUniqueCustomers}]}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-customers"]],hostAttrs:[1,"ww-analytics-chart-customers"],standalone:!1,features:[B],decls:11,vars:22,consts:[["tooltipTmpl",""],[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"flex","flex-col","items-center","gap-3","w-full"],[1,"flex","items-center","justify-center","py-3","rounded-lg",3,"style","wwBackgroundColor","wwTooltip","wwTooltipPanelClass","wwTooltipPosition","wwTooltipShowDelay","wwTooltipWithTouch"],[1,"flex","items-center","justify-center","py-3","rounded-lg",3,"wwBackgroundColor","wwTooltip","wwTooltipPanelClass","wwTooltipPosition","wwTooltipShowDelay","wwTooltipWithTouch"],["wwTypography","caption1","wwBorderColor","white","wwColor","white",1,"flex","items-center","justify-center","px-1","rounded","border"],[1,"ww-analytics-chart-customers-tooltip"],[1,"ww-analytics-chart-customers-tooltip-color",3,"wwBackgroundColor"],[1,"ww-analytics-chart-customers-tooltip-label"],[1,"ww-analytics-chart-customers-tooltip-value"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",1),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,Wl,3,0,"div",2),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.bars$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("loading",r(7,16,i.loading$))("dataMap",n)("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Q,he,Ci,Xe,L],styles:[`.ww-analytics-chart-customers .ww-chart-layout .ww-chart-layout-graph,.ww-analytics-chart-customers .ww-chart-layout .ww-chart-layout-graph .ww-chart-layout-graph-button{justify-content:center}.ww-analytics-chart-customers-tooltip-panel .ww-tooltip-overlay-content{padding:8px 16px;background-color:var(--ww-color-white);color:var(--ww-color-black);border:1px solid var(--ww-color-mediumGrey);box-shadow:4px 4px 16px #00000040}.ww-analytics-chart-customers-tooltip-panel .ww-analytics-chart-customers-tooltip{display:flex;align-items:center;justify-content:space-between;gap:8px;font-family:var(--ww-typography-caption1-font-family);font-size:var(--ww-typography-caption1-font-size);font-weight:var(--ww-typography-caption1-font-weight);line-height:var(--ww-typography-caption1-line-height);letter-spacing:var(--ww-typography-caption1-letter-spacing)}.ww-analytics-chart-customers-tooltip-panel .ww-analytics-chart-customers-tooltip .ww-analytics-chart-customers-tooltip-color{display:block;border-radius:2px;width:10px;height:10px;min-width:10px;min-height:10px;max-width:10px;max-height:10px}.ww-analytics-chart-customers-tooltip-panel .ww-analytics-chart-customers-tooltip .ww-analytics-chart-customers-tooltip-label{font-weight:500;flex-grow:1}.ww-analytics-chart-customers-tooltip-panel .ww-analytics-chart-customers-tooltip .ww-analytics-chart-customers-tooltip-value{display:block}
55/*noopanalytics-chart-customers.component-OX7H4M4A.css.map */
56`],encapsulation:2,changeDetection:0})}}return a})();var Ml=()=>[];function Bl(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,Ml))("type",e.type)}}var Qi=(()=>{class a extends J{constructor(){super(...arguments),this.decimalPipe=w(ce),this.chartId="dropoff-by-position",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData||e.distributionsData)),this.dataMap$=T([this.analyticsService.reportData$,this.analyticsService.distributionsData$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>
56k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart(e.entries,e.avgDropoffPosition))),this.title$=b($localize`Dropoff by waitlist position`),this.tooltip$=b($localize`In the dropoff by waitlist position chart you'll see the frequency and rate of dropoffs based on how long the line was when they first entered it.
57- The column bars represent the number of dropped off visits broken out by their original position in line when the visit was created.
58- The line represents the percentage of all visits that dropped off broken out by their original position in line.
59- The average dropoff position annotation is the average line length of all visits that dropped off. Visits that get in a line longer than this number are more likely to dropoff.`)}createDataMap(e,t){let i=(n,s)=>n<=1?`< ${s}`:n===s?`${n}`:n+1>=s?`> ${n}`:`${n}-${s}`;if(e&&e.data.length>0&&t&&t.data.length>=0){let n=t.data.find(s=>s.distributionType==="dropoffPosition");if(n&&n.data){let s=n.data.map(S=>({range:i(S.lowerBound??0,S.upperBound??0),lower:S.lowerBound??0,upper:S.upperBound??0,frequency:S.dropoffFrequency??0,rate:S.dropoffRate??0})),h=[{key:"range",label:$localize`Range`,sortable:!0},{key:"lower",label:$localize`Lower`,sortable:!0},{key:"upper",label:$localize`Upper`,sortable:!0},{key:"frequency",label:$localize`Dropoffs`,sortable:!0},{key:"rate",label:$localize`Dropoff rate`,sortable:!0}];return{hasData:s.length>0,hasInternalPadding:!0,avgDropoffPosition:e.data[0].avgDropoffPosition,entries:s,legendItems:[{color:P.dropoff,label:$localize`Dropoffs`,key:"dropoffs"},{color:P["dropoff-rate"],label:$localize`Dropoff rate`,key:"dropoff-rate"}],dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:s.map(S=>K(j({},S),{rate:`${S.rate*100}%`}))}}}return{avgDropoffPosition:0,entries:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null}}createChart(e,t){let i=Math.max(...e.map(q=>q.frequency)),n=e.map(q=>q.rate*100),s=n.length>0?Math.min(...n):0,h=n.length>0?Math.max(...n):0,S=Math.max((h-s)*.1,h*.1,1),W=Math.max(0,s-S),M=h+S,V=en({showTitle:!1}),y=[bt(),Ti({hideLabelForDatasetIndexes:[1]})],C=Math.round(t),O=t>0?e.findIndex(q=>C>=q.lower&&C<=q.upper):-1;if(O>=0){let q=this.decimalPipe.transform(t,"1.0-1");y.push(Kr({index:O,label:$localize`Avg dropoff position: ${q}`,color:P["dropoff-avg-position"]}))}let g={datasets:[{label:$localize`Dropoffs`,type:"bar",data:e.map(q=>q.frequency),backgroundColor:P.dropoff,borderColor:P.dropoff,yAxisID:"y0",order:2},{label:$localize`Dropoff rate`,type:"line",data:e.map(q=>q.rate*100),backgroundColor:P["dropoff-rate"],borderColor:P["dropoff-rate"],yAxisID:"y1",order:1}],labels:e.map(q=>q.range)},F=ut({layout:{padding:{top:O>=0?32:0}},datasets:{bar:{borderRadius:4,borderSkipped:"bottom",maxBarThickness:32}
59,line:{pointStyle:"rectRounded",pointBackgroundColor:P["dropoff-rate"],pointRadius:0,pointHoverRadius:6}},plugins:{tooltip:K(j({},V),{callbacks:{label:q=>{let He=q.dataset.label||"",re=q.parsed.y;return q.dataset.type==="line"?`${He}: ${this.decimalPipe.transform(re,"1.0-0")}%`:`${He}: ${this.decimalPipe.transform(re,"1.0-0")}`}}})},scales:{x:{ticks:{autoSkip:!0,maxTicksLimit:12,maxRotation:0}},y:{display:!1},y0:{display:!1,max:Math.ceil(i*1.1)},y1:{display:!1,min:W,max:M}}});return{data:g,options:F,plugins:y,type:"bar"}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-dropoff-by-position"]],hostAttrs:[1,"ww-analytics-chart-dropoff-by-position"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","dataMap","isFullscreen","loading","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,Bl,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("dataMap",n)("isFullscreen",r(7,16,i.fullscreen$))("loading",r(8,18,i.loading$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();var Nl=()=>[];function Ol(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,Nl))("type",e.type)}}var Zi=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="dropoffs",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.dropoffCancelled,e.dropoffNoShows,e.dropoffDeleted],e.legendItems))),this.title$=b($localize`Dropoffs`),this.tooltip$=b($localize`A pie chart showing the breakdown of the number of dropped-off visits.
60
61Dropped-off visits include:
62
63- Cancelled visits.
64- No-showed visits.
65- Deleted visits.
66`)}createDataMap(e){let t=[{color:P["dropoffs-cancelled"],label:$localize`Cancelled`,key:"cancelled"},{color:P["dropoffs-no-show"],label:$localize`No-shows`,key:"no-show"},{color:P["dropoffs-deleted"],label:$localize`Deleted`,key:"deleted"}],i=e?.data?.[0];if(!i)return{dropoffCancelled:0,dropoffNoShows:0,dropoffDeleted:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:i.numCancelledByVisitType.total+i.numNoShowedByVisitType.total+i.numRemovedByVisitType.total>0,dropoffCancelled:i.numCancelledByVisitType.total,dropoffNoShows:i.numNoShowedByVisitType.total,dropoffDeleted:i.numRemovedByVisitType.total,isDonutChart:!0,legendItems:t,dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{name:$localize`Cancelled`,count:i.numCancelledByVisitType.total},{name:$localize`No-shows`,count:i.numNoShowedByVisitType.total},{name:$localize`Deleted`,count:i.numRemovedByVisitType.total}]}}createChart(e,t){return Ot(e,t.map(i=>i.color),t.map(i=>i.label))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-dropoffs"]],hostAttrs:[1,"ww-analytics-chart-dropoffs"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,Ol,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("loading",r(7,16,i.loading$))("dataMap",n)("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();function Pl(a,u){if(a&1){let e=ae();d(0,"ww-table",3),o(1,"async"),o(2,"async"),E("headerClicked",function(i){G(e);
66let n=f();return H(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f();return H(i.onChartClicked())}),m()}if(a&2){let e=u,t=f(),i=et(11),n=x(0);tt("ww-chart-layout-table-fullscreen",n)("ww-chart-layout-table-partial",!n),p("placeholder",i)("columns",e.columns)("data",r(1,11,t.rows$))("pluckCellLabel",e.pluckCellLabel)("selection",n?"none":"single")("orderBy",r(2,13,t.orderBy$))("withPointerStyles",!n)}}function zl(a,u){a&1&&Je(0)}function Yl(a,u){if(a&1&&Le(0,zl,1,0,"ng-container",4),a&2){f();let e=et(11);p("ngTemplateOutlet",e)}}function Ul(a,u){a&1&&(d(0,"span",5),U(1,"No data available"),m())}var Ji=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="financials-location-revenue",this.decimalPipe=w(ce),this.rowCountInTable$=this.fullscreen$.pipe(c(e=>e?void 0:5)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLocations)),this.dataMap$=T([this.analyticsService.reportDataForFinancialsLocations$,this.rowCountInTable$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Location revenue`),this.tooltip$=b($localize`The locations revenue table shows a breakdown of revenue and revenue per visit by location and currency. The table displays the top locations based on revenue.`),this.baseColumns=[{key:"orderValue",label:$localize`Revenue`,sortable:!0},{key:"orderValuePerVisit",label:$localize`Revenue per visit`,sortable:!0}],this.orderBySub=new De({property:"orderValue",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.rows$=this.dataMap$.pipe(ie(e=>this.orderBy$.pipe(c(t=>!e?.rows||!t?e?.rows||[]:Nt(e.rows,t)))))}createDataMap(e,t){if(!Zt(e)||e.data.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=(h,S)=>h&&h>0?h/S:0,n=[{key:"name",label:$localize`Location`,sortable:!0},...this.baseColumns],s=e.data.filter(h=>h.numVisits>0&&h.orderValueCurrency&&h.orderValueCurrency.length>0).sort(Ke("locationName")).sort((h,S)=>S.orderValue.total-h.orderValue.total).map(h=>({id:h.locationId,name:h.locationName??"<Unknown>",orderValue:`${this.decimalPipe.transform(h.orderValue.total,"1.0-2")} ${h.orderValueCurrency}`,orderValuePerVisit:`${this.decimalPipe.transform(i(h.orderValue.total,h.numVisits),"1.0-2")} ${h.orderValueCurrency}`})).slice(0,t);return{hasData:s.length>0,hideLegend:!0,legendItems:[],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:s,pluckCellLabel:h=>n.reduce((S,W)=>K(j({},S),{[W.key]:at({content:h[W.key]})}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-financials-location-revenue"]],hostAttrs:[1,"ww-analytics-chart-financials-location-revenue"],standalone:!1,features:[B],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"ww-chart-layout-table-fullscreen","ww-chart-layout-table-partial","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),d(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()}),_(7,Pl,3,15,"ww-table",2),o(8,"async"),Re(9,Yl,1,1,"ng-container"),m(),Le(10,Ul,2,0,"ng-template",null,0,gt)),t&2){let n,s=N(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),v((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Gt,Q,he,vt,Xe,L],styles:[`.ww-analytics-chart-financials-location-revenue .ww-chart-layout .ww-chart-layout-graph,.ww-analytics-chart-financials-location-revenue .ww-chart-layout .ww-chart-layout-graph-button{justify-content:flex-start}
67/*noopanalytics-chart-financials-location-revenue.component-L7PCHJCM.css.map */
68`],encapsulation:2,changeDetection:0})}}return a})();var ws={date:$localize`Date`,dayOfWeekNumber:$localize`Day of Week`,month:$localize`Month`,weekStarting:$localize`Week`},Yn=["#023fb2","#42a60e","#e859e6","#e52020"];var Hl=()=>[];function jl(a,u){if(a&1&&A(0,"ww-canvas-chart",2),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,Hl))("type",e.type)}}var ea=(()=>{class a extends J{constructor(){super(),this.chartId="financials-revenue",this.dateService=w(Bt),this.title$=b($localize`Revenue`),this.tooltip$=b($localize`The revenue by currency chart visualizes a trend over time of the revenue broken down by currency.
69
70The drop-down list at the top right of the chart allows you to select different time breakouts:
71
72- Date (default): The total for each metric by day across the time range selected.
73- Day of Week: The average for each metric by day of week across the time range selected.
74- Month: The total for each metric by month across the time range selected.
75- Week: The total for each metric by week starting across the time range selected.`),this.dimensions=qe()(["date","dayOfWeekNumber","month","weekStarting"]),this.dimensionsFormControl=new Ne(this.analyticsService.getInitialFormControlValue("value-costs-dimension","date",rs),{nonNullable:!0}),this.dimension$=Ye(this.dimensionsFormControl),this.pluckDimensionsLabel=e=>ws[e],this.pluckDimensionEventLoggerParams=e=>({chart_dimension:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForFinancialsValue)),this.dataMap$=this.analyticsService.reportDataForFinancialsValue$.pipe(li(this.analyticsService.dateRange$),c(([e,t])=>this.createDataMap(e,t?.id??null)),$((e,t)=>
75k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart(e.period,e.periods,e.series,e.legendItems))),this.populateMissingPeriodsWithEmptyData=(e,t,i=null)=>{if(!Zt(e)||!this.dimensions.includes(t))return null;let{fromDate:n,toDate:s}=e,h=Bi(n),S=i||Bi(s),W=e.data.filter(C=>se(C[t])&&se(C.orderValue)&&se(C.orderValue?.total)&&C.orderValueCurrency&&C.orderValueCurrency.length>0),M=it(W.map(C=>C.orderValueCurrency)),V=[],y=Ke(t);switch(t){case"date":V=Ho({start:h,end:S}).map(C=>Ba(C,"yyyy-MM-dd"));break;case"dayOfWeekNumber":V=[1,2,3,4,5,6,7],y=(C,O)=>C.dayOfWeekNumber-O.dayOfWeekNumber;break;case"weekStarting":V=qo({start:h,end:S}).map(C=>Ba(C,"yyyy-MM-dd"));break;case"month":V=jo({start:h,end:S}).map(C=>Ba(C,"yyyy-MM"));break}for(let C of M){let O=W.filter(g=>g.orderValueCurrency===C).map(g=>g[t]);for(let g of V){if(O.includes(g))continue;let F={orderValue:{booking:0,directToCompleted:0,directToServed:0,other:0,total:0,waitlist:0,waitlistedBooking:0},orderValueCurrency:C};F[t]=g,t==="dayOfWeekNumber"&&typeof g=="number"&&(F.dayOfWeek=pn(g,e.weekdayStart)),W.push(F)}}return K(j({},e),{data:W.sort(y)})},this.subscribe()}subscribe(){this.dimension$.pipe(Ze(this.ngOnDestroy$)).subscribe(e=>{this.analyticsService.setFinancialsValueCostsDimension(e)}),this.persistObservableInQueryString(this.dimension$,"value-costs-dimension")}formatPeriod(e,t){return e==="month"?`${this.dateService.transform(new Date(t),{hideTime:!0,hideDate:!0})??`${t}`}`:e==="weekStarting"||e==="date"?`${this.dateService.transform(new Date(t),{hideTime:!0})??`${t}`}`:`${t}`}formatTooltipPeriod(e,t){if(e==="month")return this.dateService.transform(t,{hideTime:!0,hideDate:!0});if(e==="weekStarting"){let i=new Date(t),n=di(i,6);return this.dateService.transformDateRange({start:i,end:n},{hideTime:!0})}return e==="date"?this.dateService.transform(t,{hideTime:!0}):`${t}`}createDataMap(e,t){let i=e?.dimensions?.[0]??"date",n=this.populateMissingPeriodsWithEmptyData(e,i,t===gi.id?Ma():null),s=we(n?.data).filter(F=>F.orderValueCurrency&&F.orderValueCurrency.length>0&&se(F[i])),h=it(s.map(F=>F.orderValueCurrency??"")),S=h.map((F,q)=>({color:Yn[q%Yn.length],label:F,key:F})),W=h.map(F=>({name:F,data:s.filter(q=>q.orderValueCurrency===F).map(q=>q.orderValue.total)})),M=oe(W.flatMap(F=>F.data.map(q=>q??0)??[]))>0,V=[],y=[];i==="dayOfWeekNumber"?(V=[{key:"name",label:$localize`Weekday`,sortable:!0}],y=it(s.map(F=>F.dayOfWeek)).map(F=>Ut(F))):i==="month"?(V=[{key:"name",label:$localize`Month`,sortable:!0}],y=it(s.map(F=>`${F.month}-01`))):i==="weekStarting"?(V=[{key:"name",label:$localize`Week`,sortable:!0}],y=it(s.map(F=>F.weekStarting))):(V=[{key:"name",label:$localize`Day`,sortable:!0}],y=it(s.map(F=>F.date))),V=[...V,...h.map(F=>({key:F,label:F,sortable:!0}))];let C=s.reduce((F,q)=>{let re=q[i==="dayOfWeekNumber"?"dayOfWeek":i]?.toString()??"",pt=q.orderValueCurrency,Ms=q.orderValue.total;return re&&!F[re]&&(F[re]={}),pt&&(F[re]=K(j({},F[re]),{[pt]:Ms})),F},{}),O=Object.keys(C).map(F=>{let q=this.formatPeriod(i,F),He=C[F];return j({name:{value:q,sortableValue:F}},He)}),g=i==="date"&&y.length===1?"bar":"area";return{period:i,preset:g,hasData:M,hasInternalPadding:!0,series:W,periods:y,legendItems:S,dateRange:`${n?.fromDate}-${n?.toDate}`,columns:V,rows:O}}createChart(e,t,i,n){let s=i.flatMap(y=>y.data??[]),h=Math.max(...s,0),S=[bt()],W=n.map(y=>y.color),M={datasets:i.map((y,C)=>({type:"line",label:y.name,data:y.data,borderColor:W[C],fill:"origin",backgroundColor:oi(W[C]),pointStyle:"rectRounded",pointBackgroun
75dColor:W[C],pointRadius:0,pointHoverRadius:6})),labels:t.map(y=>this.formatPeriod(e,y))},V=ut({elements:{line:{tension:0}},plugins:{tooltip:{callbacks:{title:y=>{let C=y[0]?.dataIndex??-1;return this.formatTooltipPeriod(e,t[C]??y[0]?.label??"")}}}},scales:{x:{ticks:{maxTicksLimit:12}},y:{display:!1,suggestedMin:0,suggestedMax:Math.ceil(h*1.1)}}});return{data:M,options:V,plugins:S,type:"line"}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-financials-revenue"]],hostAttrs:[1,"ww-analytics-chart-financials-revenue"],standalone:!1,features:[B],decls:13,vars:28,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-financials-revenue-dimensions",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(10,"ww-chart-layout-select")(11,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(12,jl,1,5,"ww-canvas-chart",2),m()),t&2){let n=r(1,13,i.dataMap$);l(2);let s=N(r(3,15,i.chart$));l(2),p("chartTitle",r(5,18,i.title$))("tooltip",r(6,20,i.tooltip$))("loading",r(7,22,i.loading$))("dataMap",n)("isFullscreen",r(8,24,i.fullscreen$))("showTable",r(9,26,i.fullscreen$)),l(7),p("formControl",i.dimensionsFormControl)("data",i.dimensions)("pluckLabel",i.pluckDimensionsLabel)("searchable",!1)("wwEventLogger","updated_analytics_dimension")("wwEventLoggerPluckControlParams",i.pluckDimensionEventLoggerParams),l(),v(n&&s?12:-1)}},dependencies:[Ae,be,Ve,Q,Fe,Oe,ge,L],encapsulation:2,changeDetection:0})}}return a})();function Kl(a,u){if(a&1){let e=ae();d(0,"ww-table",3),o(1,"async"),o(2,"async"),E("headerClicked",function(i){G(e);let n=f();return H(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f();return H(i.onChartClicked())}),m()}if(a&2){let e=u,t=f(),i=et(11),n=x(0);tt("ww-chart-layout-table-fullscreen",n)("ww-chart-layout-table-partial",!n),p("placeholder",i)("columns",e.columns)("data",r(1,11,t.rows$))("pluckCellLabel",e.pluckCellLabel)("selection",n?"none":"single")("orderBy",r(2,13,t.orderBy$))("withPointerStyles",!n)}}function Xl(a,u){a&1&&Je(0)}function Ql(a,u){if(a&1&&Le(0,Xl,1,0,"ng-container",4),a&2){f();let e=et(11);p("ngTemplateOutlet",e)}}function Zl(a,u){a&1&&(d(0,"span",5),U(1,"No data available"),m())}var ta=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="financials-service-revenue",this.decimalPipe=w(ce),this.rowCountInTable$=this.fullscreen$.pipe(c(e=>e?void 0:5)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForFinancialsServices)),this.dataMap$=T([this.analyticsService.reportDataForFinancialsServices$,this.rowCountInTable$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Service revenue`),this.tooltip$=b($localize`The service revenue chart shows a breakdown of the revenue by service and currency. The table displays the top services based on revenue.`),this.baseColumns=[{key:"orderValue",label:$localize`Revenue`,sortable:!0}],this.orderBySub=new De({property:"orderValue",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.rows$=this.dataMap$.pipe(ie(e=>this.orderBy$.pipe(c(t=>!e?.rows||!t?e?.rows||[]:Nt(e.rows,t)))))}createDataMap(e,t){if(!Zt(e)||e.data.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Service`,sortable:!0},{key:"categoryName",label:$localize`Category`,sortable:!0},...this.baseColumns],n=e.data.filter(s=>s.orderValueCurrency&&s.orderValueCurrency.length>0&&s.serviceName&&s.serviceName.length>0&&s.serviceCategoryName&&s.serviceCategoryName.length>0).sort(Ke("serviceName")).sort(Ke("serviceCategoryName")).sort((s,h)=>h.orderValue.total-s.orderValue.total).map(s=>({id:s.serviceId,name:s.serviceName??"<Unknown>",categoryName:s.serviceCategoryName??"<Unknown>",orderValue:`${this.decimalPipe.transform(s.orderValue.total,"1.0-2")} ${s.orderValueCurrency}`})).slice(0,t);return{hasData:n.length>0,hideLegend:!0,legendItems:[],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n,pluckCellLabel:s=>i.reduce((h,S)=>K(j({},h),{[S.key]:at({content:s[S.key]})}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-financials-service-revenue"]],hostAttrs:[1,"ww-analytics-chart-financials-service-revenue"],standalone:!1,features:[B],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"ww-chart-layout-table-fullscreen","ww-chart-layout-table-partial","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),d(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()}),_(7,Kl,3,15,"ww-table",2),o(8,"async"),Re(9,Ql,1,1,"ng-container"),m(),Le(10,Zl,2,0,"ng-template",null,0,gt)),t&2){let n,s=N(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),v((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Gt,Q,he,vt,Xe,L],styles:[`.ww-analytics-chart-financials-service-revenue .ww-chart-layout .ww-chart-layout-graph,.ww-analytics-chart-financials-service-revenue .ww-chart-layout .ww-chart-layout-graph-button{justify-content:flex-start}
76/*noopanalytics-chart-financials-service-revenue.component-GXCEWMDO.css.map */
77`],encapsulation:2,changeDetection:0})}}return a})();var ec=()=>[];function tc(a,u){if(a&1&&(d(0,"ww-select",2),E("click",function(t){return t.stopPropagation()}),m()),a&2){let e=f();p("formControl",e.metricsFormControl)("data",e.metrics)("pluckLabel",e.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",e.pluckEventLoggerParams)}}function ic(a,u){if(a&1&&A(0,"ww-canvas-chart",3),a&2){f(2);let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,ec))("type",e.type)}}function ac(a,u){if(a&1&&_(0,ic,1,5,"ww-canvas-chart",3),a&2){f();let e=x(2);v(e?0:-1)}}function nc(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",5),o(1,"async"),o(2,"async"),E("chartClicked",function(){G(e);let i=f(2);return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f(2);return H(i.onTitleClicked())}),m()}if(a&2){let e=f(2),t=x(4);p("data",t)("hiddenRowCount",r(1,3,e.hiddenRowCount$))("fullscreen",r(2,5,e.fullscreen$))}}function oc(a,u){if(a&1&&_(0,nc,3,7,"ww-bar-chart",4),a&2){f();let e=x(4);v(e?0:-1)}}var ia=(()=>{class a extends J{constructor(){super(),this.durationService=w(Me),this.chartId="input-field",this.hash=null,this.hash$=this.observe("hash"),this.metrics=Ui,this.metricsFormControl=new Ne("numVisits",{nonNullable:!0}),this.metric$=Ye(this.metricsFormControl),this.pluckMetricsLabel=e=>ee[e],this.pluckEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForDataFields)),this.dataMap$=T([this.fullscreen$,this.analyticsService.reportDataForDataFields$,this.hash$,this.metric$]).pipe(c(([e,t,i,n])=>this.createDataMap(e,t,i,n))),this.isCheckbox$=this.dataMap$.pipe(c(e=>e.isCheckbox)),this.chart$=this.dataMap$.pipe(c(e=>this.createChart(e.isCheckbox,e.series,e.legendItems))),this.title$=this.dataMap$.pipe(c(e=>e.title?e.title:$localize`Unknown input field`)),this.tooltip$=b($localize`The input field charts show a breakdown of the input values per custom input field.
78
79The metrics include:
80
81- Total visits
82- Bookings
83- Waitlisted parties
84- Waitlisted bookings
85- Dropoff
86- Served
87- Completed
88- No-show
89- Cancelled
90- Removed
91- Avg wait duration
92- Avg serve duration`),this.bars$=this.dataMap$.pipe(c(e=>e.isCheckbox?null:e.rows.map(t=>{let i=t.name,n=t.metricValue??void 0,h=this.getFormatter(e.metric)(n);return{key:t.name,label:i,formattedValue:h,values:[{label:i,value:n,formattedValue:h}]}}))),this.hiddenRowCount$=this.dataMap$.pipe(c(e=>e.hiddenRowCount??0)),this.columns=[{key:"name",label:$localize`Value`,sortable:!0},{key:"numVisits",label:ee.numVisits,sortable:!0},{key:"numRegistrations.booking",label:ee["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:ee["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:ee["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:ee.numDropoff,sortable:!0},{key:"numServed",label:ee["numServed.total"],sortable:!0},{key:"numNoShowed",label:ee["numNoShowed.total"],sortable:!0},{key:"numCancelled",label:ee["numCancelled.total"],sortable:!0},{key:"numRemoved",label:ee["numRemoved.total"],sortable:!0},{key:"avgWaitDuration",label:ee.avgWaitDuration,sortable:!0},{key:"avgServeDuration",label:ee.avgServeDuration,sortable:!0},{key:"maxWaitDuration",label:ee.maxWaitDuration,sortable:!0},{key:"maxServeDuration",label:ee.maxServeDuration,sortable:!0}],this.subscribe()}ngOnInit(){super.ngOnInit();let e=this.analyticsService.getInitialFormControlValue(`field-metric-${this.hash}`,"numVisits",Jt);e&&this.metricsFormControl.setValue(e)}onTitleClicked(){return mt(this,null,function*(){if(yield Ee(this.fullscreen$))return;let t=yield Ee(this.currentTab$),i=yield Ee(this.hash$);i?this.router.navigateByUrl(`/account/analytics/${t}/${this.chartId}/${i}${window.location.search}`):this.router.navigateByUrl(`/account/analytics/${t}/${this.chartId}${window.location.search}`)})}onChartClicked(){return mt(this,null,function*(){if((yield Ee(this.fullscreen$))||(yield Ee(this.breakpoints.isBelowMobile$)))return;let i=yield Ee(this.currentTab$),n=yield Ee(this.hash$);n?this.router.navigateByUrl(`/account/analytics/${i}/${this.chartId}/${n}${window.location.search}`):this.router.navigateByUrl(`/account/analytics/${i}/${this.chartId}${window.location.search}`)})}subscribe(){this.hash$.pipe(Qe(se),Ze(this.ngOnDestroy$)).subscribe(e=>
92this.persistObservableInQueryString(this.metric$,`field-metric-${e}`))}getFormatter(e){switch(e){case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t=>t==null?"-":t>0?this.durationService.transform(t):"-";default:return t=>t==null?"-":`${Math.ceil(t)}`}}displayName(e){return e===!0||e==="true"?$localize`Yes`:e===!1||e==="false"?$localize`No`:e?`${e}`:$localize`Unknown`}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t,i,n){let s=(t?.data||[]).filter(y=>y.dataFieldNameHashed===i&&se(y.dataFieldValues)&&`${y.dataFieldValues}`.length>0).sort((y,C)=>this.displayName(y.dataFieldValues).localeCompare(this.displayName(C.dataFieldValues))).sort((y,C)=>C.numVisits-y.numVisits);if(!i||!t||s.length===0)return{isCheckbox:!1,title:"",metric:n,series:[],legendItems:[],hideLegend:!0,dateRange:"",columns:this.columns,rows:[],pluckCellLabel:()=>({})};let h=e?s:s.slice(0,$i),S=s.length-h.length,W=h.map(y=>({name:this.displayName(y.dataFieldValues),metricValue:this.getValue(n,y),numVisits:y.numVisits,"numRegistrations.booking":y.numRegistrations.booking,"numRegistrations.waitlist":y.numRegistrations.waitlist,"numRegistrations.waitlistedBooking":y.numRegistrations.waitlistedBooking,numDropoff:y.numDropoff,numServed:y.numServed.total,numCompleted:y.numCompleted.total,numNoShowed:y.numNoShowedByVisitType.total,numCancelled:y.numCancelledByVisitType.total,numRemoved:y.numRemovedByVisitType.total,avgWaitDuration:(y.avgWaitDuration??0)>0?this.durationService.transform(y.avgWaitDuration):"-",avgServeDuration:(y.avgServeDuration??0)>0?this.durationService.transform(y.avgServeDuration):"-",maxWaitDuration:(y.maxWaitDuration??0)>0?this.durationService.transform(y.maxWaitDuration):"-",maxServeDuration:(y.maxServeDuration??0)>0?this.durationService.transform(y.maxServeDuration):"-"})),M=W.map(y=>y.metricValue??0),V=h?.[0]?.dataFieldType==="CHECKBOX";return{hasData:oe(M)>0,isCheckbox:V,title:h?.[0]?.dataFieldName,metric:n,series:M,hideLegend:!V,isDonutChart:V,legendItems:V?W.map((y,C)=>({color:C===0?P["input-field-yes"]:P["input-field-no"],label:y.name,key:y.name})):[],dateRange:`${t.fromDate}-${t.toDate}`,columns:this.columns,rows:W,hiddenRowCount:S,pluckCellLabel:y=>this.columns.reduce((C,O)=>{let g=Qt(y,O.key);return K(j({},C),{[O.key]:at({content:`${g}`,$element:{typography:"body1"}})})},{})}}createChart(e,t,i){return e?Ot(t,i.map(n=>n.color),i.map(n=>n.label)):null}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-input-field"]],hostAttrs:[1,"ww-analytics-chart-input-field"],inputs:{hash:"hash"},standalone:!1,features:[B],decls:18,vars:30,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-input-field-metrics",3,"formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[1,"ww-analytics-select","ww-analytics-chart-input-field-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","options","plugins","type"],[3,"data","hiddenRowCount","fullscreen"],[3,"chartClicked","linkClicked","data","hiddenRowCount","fullscreen"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),R(4),o(5,"async"),d(6,"ww-chart-layout",0),o(7,"async"),o(8,"async"),o(9,"async"),o(10,"async"),o(11,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(12,"ww-chart-layout-select"),_(13,tc,1,6,"ww-select",1),o(14,"async"),m(),_(15,ac,1,1),o(16,"async"),Re(17,oc,1,1),m()),t&2){let n=r(1,8,i.dataMap$);l(2),N(r(3,10,i.chart$)),l(2),N(r(5,13,i.bars$)),l(2),p("chartTitle",r(7,16,i.title$))("tooltip",r(8,18,i.tooltip$))("loading",r(9,20,i.loading$))("dataMap",n)("isFullscreen",r(10,22,i.fullscreen$))("showTable",r(11,24,i.fullscreen$)),l(7),v(r(14,26,i.hasData$)?13:-1),l(2),v(r(16,28,i.isCheckbox$)?15:17)}},dependencies:[Ae,be,Ve,Q,Fe,Oe,Be,ge,L],encapsulation:2,changeDetection:0})}}return a})();var sc=()=>[];function lc(a,u){if(a&1&&A(0,"ww-canvas-chart",2),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,sc))("type",e.type)}}var aa=(()=>{class a extends J{constructor(){super(),this.dateService=w(Bt),this.locationRx=w(At),this.chartId="line-length",this.periods=Di,this.periodsFormControl=new Ne("hourOfDay",{nonNullable:!0}),this.period$=Ye(this.periodsFormControl),this.pluckPeriodLabel=e=>rn[e],this.pluckEventLoggerParams=e=>({chart_period:e,chart_type:this.chartId}),this.response$=this.period$.pipe(ie(e=>e==="dayOfWeek"?this.analyticsService.reportDataByDayOfWeek$:e==="hourOfDay"?this.analyticsService.reportData$:e==="week"?this.analyticsService.reportDataByWeek$:e==="month"?this.analyticsService.reportDataByMonth$:this.analyticsService.reportDataByDate$),$((e,t)=>
92k(e,t)),I({bufferSize:1,refCount:!0})),this.hoursByWeekday$=this.response$.pipe(c(e=>e?.locationIds??[]),ie(e=>this.locationRx.getLocationsByIds(e,["hours"])),c(e=>e.map(({hours:t})=>t).filter(se))),this.loading$=this.period$.pipe(ie(e=>e==="dayOfWeek"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDayOfWeek)):e==="hourOfDay"?this.analyticsService.loadingState$.pipe(c(t=>t.reportData)):e==="week"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByWeek)):e==="month"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByMonth)):this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDate))),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.dataMap$=T([this.period$,this.response$,this.hoursByWeekday$,this.fullscreen$]).pipe(c(([e,t,i,n])=>this.createDataMap(e,t,i,n))),this.chart$=T([this.period$,this.dataMap$]).pipe(c(([e,t])=>this.createChart(e,t.maxLineLength,t.avgLineLength,t.periods,t.labels))),this.title$=b($localize`Line length`),this.tooltip$=b($localize`A trend over time of the average length of the waitlist and the longest length of the waitlist.
93
94- Avg line length: The average starting position of all visits that were added to the waitlist. Assigned to the date the visit was waitlisted.
95- Max line length: The longest starting position of all visits that were added to the waitlisted. Assigned to the date the visit was waitlisted.
96
97The dropdown list at the top right of the chart allows you to select different time breakouts:
98
99- Hour of day (default): The average line length and longest line length by hour of day across the time range selected.
100- Date: The average line length and longest line length by day across the time range selected.
101- Day of week: The average line length and longest line length by day of week across the time range selected.`),this.subscribe()}ngOnInit(){super.ngOnInit();let e=this.analyticsService.getInitialFormControlValue("line-length-period","hourOfDay",sn);e&&this.periodsFormControl.setValue(e)}subscribe(){this.persistObservableInQueryString(this.period$,"line-length-period")}getHourFormat(e,t){let i=this.dateService.transform(`2001-01-01T${e<10?"0"+e:e}:00`,{hideDate:!0})??`${e}:00`;return t?i:i.replace(":00","")}formatPeriod(e,t){if(e==="month")return this.dateService.transform(t,{hideDate:!0,hideTime:!0});if(e==="week"){let i=new Date(t),n=di(i,6);return this.dateService.transformDateRange({start:i,end:n},{hideTime:!0})}return e==="date"?this.dateService.transform(t,{hideTime:!0}):`${t}`}formatLabel(e,t){return e==="month"?this.dateService.transform(t,{hideDate:!0,hideTime:!0}):e==="week"||e==="date"?this.dateService.transform(t,{hideTime:!0}):`${t}`}createDataMap(e,t,i,n){if(!t)return{maxLineLength:[],avgLineLength:[],labels:[],periods:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let s=[{key:"maxLineLength",label:$localize`Max line length`,color:P["line-length-max"]},{key:"avgLineLength",label:$localize`Avg line length`,color:P["line-length-avg"]}],h=[{key:"period",label:$localize`Period`,sortable:!0},{key:"maxLineLength",label:$localize`Max line length`,sortable:!0},{key:"avgLineLength",label:$localize`Avg line length`,sortable:!0}];if(e==="hourOfDay"){let y=cn(i)??{first:0,last:23},C=we(t?.data)[0],O=ps([C?.maxLineLengthByHourOfDay??[],C?.avgLineLengthByHourOfDay??[]]);O.first>=0&&O.first<y.first&&(y.first=O.first),O.last>=0&&O.last>y.last&&(y.last=O.last);let g={maxLineLength:[],avgLineLength:[],labels:this.analyticsService.hoursOfDay.map(F=>this.getHourFormat(F,n)).slice(y.first,y.last+1),legendItems:s,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:[]};return C&&(g.maxLineLength=C.maxLineLengthByHourOfDay.slice(y.first,y.last+1),g.avgLineLength=C.avgLineLengthByHourOfDay.slice(y.first,y.last+1)),K(j({},g),{periods:g.labels,hasData:oe(g.maxLineLength)>0||oe(g.avgLineLength)>0,hasInternalPadding:!0,rows:g.labels.map((F,q)=>({period:{value:F,sortableValue:q},maxLineLength:g.maxLineLength[q],avgLineLength:g.avgLineLength[q]}))})}if(e==="dayOfWeek"){let y=we(t?.data).filter(g=>g.dayOfWeekNumber>0).sort((g,F)=>g.dayOfWeekNumber>F.dayOfWeekNumber?1:-1),C=y.map(g=>Ut(g.dayOfWeek)),O={maxLineLength:y.map(g=>g.maxLineLength),avgLineLength:y.map(g=>g.avgLineLength),labels:C,periods:C,legendItems:s,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:[]};return K(j({},O),{hasData:oe(O.maxLineLength)>0||oe(O.avgLineLength)>0,hasInternalPadding:!0,rows:O.labels.map((g,F)=>({period:{value:g,sortableValue:F},maxLineLength:O.maxLineLength[F],avgLineLength:O.avgLineLength[F]}))})}let S=we(t?.data).filter(y=>e==="week"?(y.weekStarting??"").length>0:e==="month"?(y.month??"").length>0:(y.date??"").length>0),W=S.map(y=>e==="week"?y.weekStarting:e==="month"?`${y.month}-01`:y.date),M=S.map(y=>{let C=y.date,O=this.dateService.transform(C,{hideTime:!0})??`${C}`;return e==="week"?C=y.weekStarting:e==="month"&&(C=y.month,O=this.dateService.transform(C,{hideDate:!0,hideTime:!0})??`${C}`),{period:{value:O,sortableValue:C},maxLineLength:y.maxLineLength,avgLineLength:y.avgLineLength}}),V={maxLineLength:M.map(y=>y.maxLineLength),avgLineLength:M.map(y=>y.avgLineLength),labels:W.map(y=>this.formatLabel(e,y)??y),periods:W,legendItems:s,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:M};return K(j({},V),{hasData:oe(V.maxLineLength)>0||oe(V.avgLineLength)>0,hasInternalPadding:!0})}createChart(e,t,i,n,s){let h=Math.max(...t,0),S=en(),W=[bt(),Ti({hideLabelForDatasetIndexe
101s:[1]})],M={datasets:[{type:"bar",data:t,label:$localize`Max line length`,borderColor:P["line-length-max"],backgroundColor:P["line-length-max"],order:2},{type:"line",data:i,label:$localize`Avg line length`,borderColor:P["line-length-avg"],backgroundColor:P["line-length-avg"],order:1}],labels:s},V=ut({datasets:{bar:{borderRadius:4,borderSkipped:"bottom",maxBarThickness:32},line:{pointStyle:"rectRounded",pointBackgroundColor:P["line-length-avg"],pointRadius:0,pointHoverRadius:6}},plugins:{tooltip:K(j({},S),{callbacks:{title:y=>{let C=y[0]?.dataIndex??-1;return this.formatPeriod(e,n[C]??y[0]?.label??"")}}})},scales:{x:{ticks:{autoSkip:!0,maxTicksLimit:e==="hourOfDay"?24:12,maxRotation:0}},y:{display:!1,max:Math.ceil(h*1.1)}}});return{data:M,options:V,plugins:W,type:"bar"}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-line-length"]],hostAttrs:[1,"ww-analytics-chart-line-length"],standalone:!1,features:[B],decls:13,vars:28,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","dataMap","loading","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-line-length-period",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(10,"ww-chart-layout-select")(11,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(12,lc,1,5,"ww-canvas-chart",2),m()),t&2){let n=r(1,13,i.dataMap$);l(2);let s=N(r(3,15,i.chart$));l(2),p("chartTitle",r(5,18,i.title$))("tooltip",r(6,20,i.tooltip$))("dataMap",n)("loading",r(7,22,i.loading$))("isFullscreen",r(8,24,i.fullscreen$))("showTable",r(9,26,i.fullscreen$)),l(7),p("formControl",i.periodsFormControl)("data",i.periods)("pluckLabel",i.pluckPeriodLabel)("searchable",!1)("wwEventLogger","updated_analytics_period")("wwEventLoggerPluckControlParams",i.pluckEventLoggerParams),l(),v(n&&s?12:-1)}},dependencies:[Ae,be,Ve,Q,Fe,Oe,ge,L],encapsulation:2,changeDetection:0})}}return a})();function gs(a){return a==="channels"||a==="state"||a==="type"||a==="recipient"}var Un={channels:$localize`Channels`,state:$localize`State`,type:$localize`Type`,recipient:$localize`Recipient`},mn={channels:["numMessagesByChannel","numMessageSegmentsByChannel"],state:["numMessagesByState","numMessageSegmentsByState"],type:["numMessagesByIncomingOutgoing","numMessageSegmentsByIncomingOutgoing"],recipient:["numMessagesByRecipient","numMessageSegmentsByRecipient"]},Et={email:$localize`Email`,sms:$localize`SMS`,app:$localize`Push`,call:$localize`Call`,other:$localize`Other`},Li={email:Se(0,!1),sms:Se(1,!1),app:Se(2,!1),call:Se(3,!1),other:Se(4,!1)},F0={email:Se(0,!0),sms:Se(1,!0),app:Se(2,!0),call:Se(3,!0),other:Se(4,!0)},ft={blocked:$localize`Blocked`,delivered:$localize`Delivered`,failed:$localize`Failed`,other:$localize`Other`,pending:$localize`Pending`,received:$localize`Received`},ti={delivered:Se(0),received:Se(1),pending:Se(2),failed:Se(3),blocked:Se(4),other:Se(5)},N0={delivered:Se(0,!0),received:Se(1,!0),pending:Se(2,!0),failed:Se(3,!0),blocked:Se(4,!0),other:Se(5,!0)},na={incoming:$localize`Incoming`,outgoing:$localize`Outgoing`},Gn={incoming:Se(0),outgoing:Se(1)},O0={incoming:Se(0,!0),outgoing:Se(1,!0)},oa={guest:$localize`Customer`,user:$localize`User`},Hn={guest:Se(0),user:Se(1)},V0={guest:Se(0,!1),user:Se(1,!1)};function pc(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}var ra=(()=>{class a extends J{constructor(){super(),this.chartId="message-details",this.levelOfDetails=qe()(["channels","state","type","recipient"]),this.levelOfDetailFormControl=new Ne(this.analyticsService.getInitialFormControlValue("message-detail-lod","channels",gs),{nonNullable:!0}),this.levelOfDetail$=Ye(this.levelOfDetailFormControl),this.pluckLevelOfDetailLabel=e=>Un[e],this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForMessageDetails)),this.dataMap$=this.levelOfDetail$.pipe(ie(e=>T([this.analyticsService.reportDataForMessageDetails$,b(e)])),c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>
101k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Message details`),this.tooltip$=b($localize`In the Message details bar chart, you'll find a summary of the different message breakdowns. Where possible it details out the messages vs the message segments.
102
103- Channels: Breakdown of the channel of the message (email, SMS, app, call)
104- State: Breakdown of the state of the message (delivered, blocked, failed, pending, received)
105- Type: Breakdown of incoming vs outgoing messages
106- Recipient: Breakdown of who sent/received the messages (customers or user)`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i="segments"in t&&se(t.segments)?t.segments:t.messages,n=["segments"in t&&se(t.segments)&&t.segments>t.messages?{label:$localize`Segments`,value:t.segments-t.messages,formattedValue:`${t.segments}`,color:P["message-details-segments"]}:null,{label:$localize`Messages`,value:t.messages,formattedValue:`${t.messages}`,color:P["message-details-messages"]}].filter(se),s=["segments"in t&&se(t.segments)?{label:$localize`Segments`,value:t.segments-t.messages,formattedValue:`${t.segments}`,color:P["message-details-segments"]}:null,{label:$localize`Messages`,value:t.messages,formattedValue:`${t.messages}`,color:P["message-details-messages"]}].filter(se);return{key:t.key,label:t.name,formattedValue:`${i}`,values:n,tooltips:s}}))),this.subscribe()}subscribe(){this.levelOfDetail$.pipe(Ze(this.ngOnDestroy$)).subscribe(e=>{this.analyticsService.setMessageDetailsMetrics(mn[e])}),this.persistObservableInQueryString(this.levelOfDetail$,"message-detail-lod")}createDataMap(e,t){let i=e?.data?.[0];if(!i)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"name",label:Un[t],sortable:!0},{key:"messages",label:$localize`Messages`,sortable:!0},{key:"segments",label:$localize`Segments`,sortable:!0}];if(t==="state"){let h=[i.numMessagesByState.delivered,i.numMessagesByState.blocked,i.numMessagesByState.failed,i.numMessagesByState.pending,i.numMessagesByState.received,i.numMessagesByState.other,i.numMessageSegmentsByState.delivered,i.numMessageSegmentsByState.blocked,i.numMessageSegmentsByState.failed,i.numMessageSegmentsByState.pending,i.numMessageSegmentsByState.received,i.numMessageSegmentsByState.other];return{hasData:oe(h)>0,hideLegend:!0,legendItems:[{color:ti.delivered,label:ft.delivered,key:"delivered"},{color:ti.blocked,label:ft.blocked,key:"blocked"},{color:ti.failed,label:ft.failed,key:"failed"},{color:ti.pending,label:ft.pending,key:"pending"},{color:ti.pending,label:ft.pending,key:"pending"},{color:ti.received,label:ft.received,key:"received"},{color:ti.other,label:ft.other,key:"other"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"delivered",name:ft.delivered,messages:i.numMessagesByState.delivered,segments:i.numMessageSegmentsByState.delivered},{key:"blocked",name:ft.blocked,messages:i.numMessagesByState.blocked,segments:i.numMessageSegmentsByState.blocked},{key:"failed",name:ft.failed,messages:i.numMessagesByState.failed,segments:i.numMessageSegmentsByState.failed},{key:"pending",name:ft.pending,messages:i.numMessagesByState.pending,segments:i.numMessageSegmentsByState.pending},{key:"received",name:ft.received,messages:i.numMessagesByState.received,segments:i.numMessageSegmentsByState.received},{key:"other",name:ft.other,messages:i.numMessagesByState.other,segments:i.numMessageSegmentsByState.other}]}}if(t==="type"){let h=[i.numMessagesByIncomingOutgoing.outgoing,i.numMessagesByIncomingOutgoing.incoming,i.numMessageSegmentsByIncomingOutgoing.outgoing,i.numMessageSegmentsByIncomingOutgoing.incoming];return{hasData:oe(h)>0,hideLegend:!0,legendItems:[{color:Gn.outgoing,label:na.outgoing,key:"outgoing"},{color:Gn.incoming,label:na.incoming,key:"incoming"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"outgoing",name:na.outgoing,messages:i.numMessagesByIncomingOutgoing.outgoing,segments:i.numMessageSegmentsByIncomingOutgoing.outgoing},{key:"incoming",name:na.incoming,messages:i.numMessagesByIncomingOutgoing.incoming,segments:i.numMessageSegmentsByIncomingOutgoing.incoming}]}}if(t==="recipient"){let h=[i.numMessagesByRecipient.guest,i.numMessagesByRecipient.user,i.numMessageSegmentsByRecipient.guest,i.numMessageSegmentsByRecipient.user];return{hasData:oe(h)>0,hideLegend:!0,legendItems:[{color:Hn.guest,label:oa.guest,key:"guest"},{color:Hn.user,label:oa.user,key:"user"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"guest",name:oa.guest,messages:i.numMessagesByRecipient.guest,segments:i.numMessageSegmentsByRecipient.guest},{key:"user",name:oa.user,messages:i.numMessagesByRecipient.user,segments:i.numMessageSegmentsByRecipient.user}]}}let s=[i.numMessagesByChannel.email,i.numMessagesByChannel.sms,i.numMessagesByChannel.app,i.numMessagesByChannel.call,i.numMessagesByChannel.other,i.numMessageSegmentsByChannel.sms];return{hasData:oe(s)>0,hideLegend:!0,legendItems:[{color:Li.email,label:Et.email,key:"email"},{color:Li.sms,label:Et.sms,key:"sms"},{color:Li.app,label:Et.app,key:"app"},{color:Li.call,label:Et.call,key:"call"},{color:Li.other,label:Et.other,key:"other"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"email",name:Et.email,messages:i.numMessagesByChannel.email},{key:"sms",name:Et.sms,messages:i.numMessagesByChannel.sms,segments:i.numMessageSegmentsByChannel.sms},{key:"app",name:Et.app,messages:i.numMessagesByChannel.app},{key:"call",name:Et.call,messages:i.numMessagesByChannel.call},{key:"other",name:Et.other,messages:i.numMessagesByChannel.other}]}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-message-details"]],hostAttrs:[1,"ww-analytics-chart-message-details"],standalone:!1,features:[B],decls:11,vars:25,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-message-details-level-of-detail",3,"click","formControl","data","pluckLabel","searchable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,pc,2,4,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,11,i.title$))("tooltip",r(2,13,i.tooltip$))("loading",r(3,15,i.loading$))("dataMap",r(4,17,i.dataMap$))("isFullscreen",r(5,19,i.fullscreen$))("showTable",r(6,21,i.fullscreen$)),l(8),p("formControl",i.levelOfDetailFormControl)("data",i.levelOfDetails)("pluckLabel",i.pluckLevelOfDetailLabel)("searchable",!1),l(),v((n=r(10,23,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Be,ge,L],styles:[`.ww-analytics-chart-message-details .ww-analytics-chart-message-details-tooltip{font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);
106font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing)}
107/*noopanalytics-chart-message-details.component-LGBLYBXY.css.map */
108`],encapsulation:2,changeDetection:0})}}return a})();var dc=()=>[];function uc(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,dc))("type",e.type)}}var sa=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="message-recipient",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.guest,e.user],e.legendItems))),this.title$=b($localize`Message recipient`),this.tooltip$=b($localize`The recipient chart shows a breakdown of messages by recipient (Guest, User). This includes incoming and outgoing messages to any recipient regardless of delivery state.`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{hasData:!0,guest:0,user:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Channel`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:t.numMessagesByRecipient.guest+t.numMessagesByRecipient.user>0,guest:t.numMessagesByRecipient.guest,user:t.numMessagesByRecipient.user,isDonutChart:!0,legendItems:[{color:P["message-recipient-guest"],label:$localize`Guest`,key:"guest"},{color:P["message-recipient-user"],label:$localize`User`,key:"user"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:[{name:$localize`Guest`,count:t.numMessagesByRecipient.guest},{name:$localize`User`,count:t.numMessagesByRecipient.user}]}}createChart(e,t){return Ot(e,t.map(i=>i.color),t.map(i=>i.label))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-message-recipient"]],hostAttrs:[1,"ww-analytics-chart-message-recipient"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,uc,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("loading",r(7,16,i.loading$))("dataMap",n)("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();var fc=()=>[];function yc(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,fc))("type",e.type)}}var la=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="message-type",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.incoming,e.outgoing],e.legendItems))),this.title$=b($localize`Message type`),this.tooltip$=b($localize`The Message type chart shows a breakdown of messages by incoming vs outgoing. This includes all channels and recipients, regardless of delivery state.`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{incoming:0,outgoing:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}],n=[t.numMessagesByIncomingOutgoing.incoming,t.numMessagesByIncomingOutgoing.outgoing];return{hasData:oe(n)>0,incoming:t.numMessagesByIncomingOutgoing.incoming,outgoing:t.numMessagesByIncomingOutgoing.outgoing,isDonutChart:!0,legendItems:[{color:P["message-type-incoming"],label:$localize`Incoming`,key:"incoming"},{color:P["message-type-outgoing"],label:$localize`Outgoing`,key:"outgoing"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:[{name:$localize`Incoming`,count:t.numMessagesByIncomingOutgoing.incoming},{name:$localize`Outgoing`,count:t.numMessagesByIncomingOutgoing.outgoing}]}}createChart(e,t){return Ot(e,t.map(i=>i.color),t.map(i=>i.label))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-message-type"]],hostAttrs:[1,"ww-analytics-chart-message-type"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,yc,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("loading",r(7,16,i.loading$))("dataMap",n)("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();var wc=()=>[];function gc(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,wc))("type",e.type)}}var ca=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="new-vs-returning",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
108k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.distributionNew,e.distributionReturning],e.legendItems))),this.title$=b($localize`New vs returning`),this.tooltip$=b($localize`New vs returning customers is visualized by a pie chart breaking down the number of new vs returning visits. Visits are counted as returning if a visit used the same phone number, email, or external customer id as a previous visit in within the Waitwhile account (across locations).`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{distributionNew:0,distributionReturning:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:t.numNewCustomers.total>0||t.numCreated>0,distributionNew:t.numNewCustomers.total,distributionReturning:t.numCreated-t.numNewCustomers.total,isDonutChart:!0,legendItems:[{color:P["customer-distribution-new"],label:$localize`New`,key:"new"},{color:P["customer-distribution-returning"],label:$localize`Returning`,key:"returning"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:[{name:$localize`New`,count:t.numNewCustomers.total},{name:$localize`Returning`,count:t.numCreated-t.numNewCustomers.total}]}}createChart(e,t){return Ot(e,t.map(i=>i.color),t.map(i=>i.label))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-new-vs-returning"]],hostAttrs:[1,"ww-analytics-chart-new-vs-returning"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,gc,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("loading",r(7,16,i.loading$))("dataMap",n)("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();var jn={agent:$localize`Creator`,source:$localize`Source`},_s={STAFF:$localize`Staff`,GUEST:$localize`Guest`,API:$localize`API`,OTHER:$localize`Other`},qn={"ANDROID-APP":"Android app","IOS-APP":"iOS app","IOS-APP-CLIP":"iOS app clip","WEB-APP":"Web app",API:"API",EMAIL:"Email",IMPORT:"Import",KIOSK:"Kiosk",PUBLIC:"Public",QR:"QR",RWG:"Google",SMS:"SMS",OTHER:$localize`Other`},vs={STAFF:"#023fb2",GUEST:"#42a60e",API:"#e859e6",OTHER:"#e859e6"},Ss={STAFF:100,GUEST:200,API:300,OTHER:400},As={"ANDROID-APP":120,"IOS-APP":130,"IOS-APP-CLIP":260,"WEB-APP":140,API:310,EMAIL:210,IMPORT:110,KIOSK:240,PUBLIC:250,QR:240,RWG:220,SMS:230,OTHER:410};function vc(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}var pa=(()=>{class a extends J{constructor(){super(),this.chartId="registration-details",this.title$=b($localize`Registration details`),this.tooltip$=b($localize`In the Registration details bar chart, you'll find a summary of the different registration types.
109
110- Creator: Breakdown of the visits that were created by staff vs customers
111- Source: Breakdown of the specific source where the visit was created
112
113The bars are broken out by the creator and are stacked by the associated sources.
114
115These levels of detail can be compared using multiple metrics:
116
117- Total Visits
118- Bookings
119- Waitlisted
120- Waitlisted bookings
121- Dropoff
122- Served
123- Completed
124- No-show
125- Cancelled
126- Removed`),this.metrics=on,this.metricsFormControl=new Ne(this.analyticsService.getInitialFormControlValue("reg-details-metric","
126numVisits",Jt),{nonNullable:!0}),this.metric$=Ye(this.metricsFormControl),this.pluckMetricsLabel=e=>ee[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataByCreatorSource)),this.dataMap$=T([this.analyticsService.reportDataBySource$,this.metric$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.bars$=this.dataMap$.pipe(c(e=>it(e.values.map(i=>i.agent)).map(i=>{let n=e.values.filter(h=>h.agent===i),s=oe(n.map(h=>h.value??0));return{key:i,label:_s[i],formattedValue:s.toLocaleString(),values:n.map(h=>({label:qn[h.source],value:h.value,formattedValue:h.value?.toLocaleString(),color:h.color,opacity:h.opacity}))}}).filter(se))),this.persistObservableInQueryString(this.metric$,"reg-details-metric")}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t){let i=we(e?.data);if(!Zt(e)||i.length<1)return{values:[],legendItems:[],metric:t,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n="source",h=i.filter(y=>se(y.source)&&se(y.agent)).map(y=>{let C=Tr(y.agent)?y.agent:"OTHER",O=Dr(y.source)?y.source:"OTHER";return C==="API"&&(C="OTHER"),{agent:C,source:O,value:this.getValue(t,y)}}).reduce((y,C)=>{let O=y.findIndex(g=>g.agent===C.agent&&g.source===C.source);return O>-1?y[O].value+=C.value:y.push(C),y},[]).map(y=>{let{agent:C,source:O,value:g}=y;return{agent:C,source:O,value:g,color:vs[C],agentOrder:Ss[C],order:As[O]}}).sort((y,C)=>y.order<C.order?-1:1).reduce((y,C)=>(y[C.agent]?y[C.agent].push(C):y[C.agent]=[C],y),{}),S=Object.keys(h).map(y=>h[y].map((O,g,F)=>{let He=.8/F.length,re=.2+He+g*He;return K(j({},O),{opacity:re})})).flat().filter(y=>y.value>0),W=[{key:"agent",label:jn.agent,sortable:!0},{key:"source",label:jn.source,sortable:!0},{key:"numVisits",label:ee.numVisits,sortable:!0},{key:"numRegistrations.booking",label:ee["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:ee["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:ee["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:ee.numDropoff,sortable:!0},{key:"numServed.total",label:ee["numServed.total"],sortable:!0},{key:"numCompleted.total",label:ee["numCompleted.total"],sortable:!0},{key:"numNoShowed.total",label:ee["numNoShowed.total"],sortable:!0},{key:"numCancelled.total",label:ee["numCancelled.total"],sortable:!0},{key:"numRemoved.total",label:ee["numRemoved.total"],sortable:!0}],M=i.filter(y=>se(y[n])&&`${y[n]}`.length>0).map(y=>({agent:y.agent??"",source:y.source??"",numVisits:y.numVisits??0,"numRegistrations.booking":y.numRegistrations?.booking??0,"numRegistrations.waitlist":y.numRegistrations?.waitlist??0,"numRegistrations.waitlistedBooking":y.numRegistrations?.waitlistedBooking??0,numDropoff:y.numDropoff??0,"numServed.total":y.numServed?.total??0,"numCompleted.total":y.numCompleted?.total??0,"numNoShowed.total":y.numNoShowed?.total??0,"numCancelled.total":y.numCancelled?.total??0,"numRemoved.total":y.numRemoved?.total??0})).sort((y,C)=>y.numVisits<C.numVisits?1:-1),V=[...S].reverse().sort((y,C)=>y.agentOrder-C.agentOrder).map(y=>({key:`${y.agent}-${y.source}`,label:qn[y.source],color:y.color,style:{opacity:y.opacity}}));return{hasData:oe(S.map(y=>y.value))>0,values:S,legendItems:V,dimension:n,metric:t,dateRange:`${e.fromDate}-${e.toDate}`,columns:W,rows:M}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-registration-detail
126s"]],hostAttrs:[1,"ww-analytics-chart-registration-details"],standalone:!1,features:[B],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-registration-details-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,vc,2,4,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.metricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Oe,Be,ge,L],encapsulation:2,changeDetection:0})}}return a})();function Ac(a,u){if(a&1){let e=ae();d(0,"div",3)(1,"ww-link",4),E("click",function(){G(e);let i=f(2);return H(i.onTitleClicked())}),d(2,"span"),U(3),m(),A(4,"ww-icon",5),m()()}if(a&2){let e=f();l(3),xe("Show all ",e.total," locations")}}function bc(a,u){if(a&1){let e=ae();d(0,"ww-table",2),o(1,"async"),E("headerClicked",function(i){G(e);let n=f();return H(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f();return H(i.onChartClicked())}),m(),_(2,Ac,5,1,"div",3)}if(a&2){let e=u,t=f(),i=et(11),n=x(0),s=e.showFullscreenLink&&!n;tt("ww-chart-layout-table-fullscreen",n)("ww-chart-layout-table-partial",!n)("ww-chart-layout-table-with-bottom-border",s),p("placeholder",i)("columns",e.columns)("data",e.rows)("pluckCellLabel",e.pluckCellLabel)("selection","none")("orderBy",r(1,14,t.orderBy$))("withPointerStyles",!n),l(2),v(s?2:-1)}}function Tc(a,u){a&1&&Je(0)}function Dc(a,u){if(a&1&&Le(0,Tc,1,0,"ng-container",6),a&2){f();let e=et(11);p("ngTemplateOutlet",e)}}function $c(a,u){a&1&&(d(0,"span",7),U(1,"No data available"),m())}var ma=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(Me),this.chartId="top-locations",this.orderBySub=new De({property:"numVisits",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.rowCountInTable$=this.fullscreen$.pipe(c(e=>e?void 0:5)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLocations)),this.dataMap$=T([this.analyticsService.reportDataForLocations$,this.analyticsService.compareReportDataForLocations$,this.analyticsService.compareDateRangeLabel$,this.rowCountInTable$,this.orderBySub]).pipe(c(([e,t,i,n,s])=>this.createDataMap(e,t,i,n,s)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Top locations`),this.tooltip$=b($localize`The top locations table shows the top locations based on visits. Other available metrics are Waitlisted, Bookings, Served, Completed, Dropoff, Avg wait duration and Avg serve duration.`),this.baseColumns=[{key:"numVisits",label:$localize`Visits`,sortable:!0},{key:"totalWaitlist",label:$localize`Waitlisted`,sortable:!0},{key:"totalBookings",label:$localize`Bookings`,sortable:!0},{key:"numServed",label:$localize`Served`,sortable:!0},{key:"numCompleted",label:$localize`Completed`,sortable:!0},{key:"numDropoff",label:$localize`Dropoff`,sortable:!0},{key:"avgWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"maxWaitDuration",label:$localize`Longest wait`,sortable:!0},{key:"maxServeDuration",label:$localize`Longest serve duration`,sortable:!0}]}getValueForCompare(e,t){if(!e)return null;if(t==="numServed")return e.numServed.total;if(t==="numCompleted")return e.numCompleted.total;let i=e[t];return typeof i=="number"?i:null}getCompareComponent(e,t,i,n,s){if(t.key==="name")return null;let h=i?.data.find(C=>C.locationId===e)??null,S=n?.data.find(C=>C.locationId===e)??null,W=this.getValueForCompare(h,t.key),M=this.getValueForCompare(S,t.key),V=t.key==="avgServeDuration"||t.key==="avgWaitDuration"||t.key==="maxWaitDuration"||t.key==="maxServeDuration"?"duration":void 0,y=t.key==="numDropoff"||t.key==="avgServeDuration"||t.key==="avgWaitDuration"||t.key==="maxWaitDuration"||t.key==="maxServeDuration";return ve(Qa,{compare:ue({current:W??0,response:n,previous:M??void 0,valueType:V,invertNegativeAndPositive:y,rangeLabel:s}),loading:!1})}createDataMap(e,t,i,n,s){if(!e?.data||e.data.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let h=[{key:"name",label:$localize`Location`,sortable:!0},...this.baseColumns],S=e.data.map(M=>
126({id:M.locationId,name:M.locationName??"",numVisits:M.numVisits,totalWaitlist:M.totalWaitlist,totalBookings:M.totalBookings,numServed:M.numServed.total,numCompleted:M.numCompleted.total,numDropoff:M.numDropoff,avgWaitDuration:(M.avgWaitDuration??0)>0?this.durationService.transform(M.avgWaitDuration):"-",avgServeDuration:(M.avgServeDuration??0)>0?this.durationService.transform(M.avgServeDuration):"-",maxWaitDuration:(M.maxWaitDuration??0)>0?this.durationService.transform(M.maxWaitDuration):"-",maxServeDuration:(M.maxServeDuration??0)>0?this.durationService.transform(M.maxServeDuration):"-"})).filter(M=>M.numVisits>0).sort(Ke("name"));s?S=Nt(S,s):S=Nt(S,{property:"numVisits",direction:"desc"});let W=S.length;return S=S.slice(0,n),{hasData:S.length>0,hideLegend:!0,legendItems:[],dateRange:`${e.fromDate}-${e.toDate}`,columns:h,rows:S,total:W,showFullscreenLink:W>5,pluckCellLabel:M=>h.reduce((V,y)=>K(j({},V),{[y.key]:Va({$element:{classList:["!flex-nowrap"]},components:[at({content:M[y.key]}),this.getCompareComponent(M.id,y,e,t,i)]})}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-top-locations"]],hostAttrs:[1,"ww-analytics-chart-top-locations"],standalone:!1,features:[B],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[1,"flex","justify-center","w-full","pt-5"],["type","internal-in-same-tab","wwColor","black",3,"click"],["icon","bx-chevron-right","size","small"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),d(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()}),_(7,bc,3,16),o(8,"async"),Re(9,Dc,1,1,"ng-container"),m(),Le(10,$c,2,0,"ng-template",null,0,gt)),t&2){let n,s=N(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),v((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Gt,Q,he,qt,Si,vt,Xe,L],styles:[`.ww-analytics-chart-top-locations{--ww-analytics-table-name-column-width: 300px}.ww-breakpoints-below-large .ww-analytics-chart-top-locations{--ww-analytics-table-name-column-width: 200px}.ww-analytics-chart-top-locations .ww-table thead th:first-of-type,.ww-analytics-chart-top-locations .ww-table thead td:first-of-type,.ww-analytics-chart-top-locations .ww-table tbody th:first-of-type,.ww-analytics-chart-top-locations .ww-table tbody td:first-of-type{min-width:var(--ww-analytics-table-name-column-width);max-width:var(--ww-analytics-table-name-column-width);width:var(--ww-analytics-table-name-column-width)}.ww-analytics-chart-top-locations .ww-table.ww-chart-layout-table-with-bottom-border .mat-mdc-table.mat-mdc-table tbody .mat-mdc-row:last-of-type .mat-mdc-cell{border-bottom:1px solid var(--ww-color-mediumGrey)}.ww-analytics-chart-top-locations .ww-table.ww-chart-layout-table-partial tbody tr{cursor:pointer}
127/*noopanalytics-chart-top-locations.component-YLMF2B42.css.map */
128`],encapsulation:2,changeDetection:0})}}return a})();var Rc=()=>[];function kc(a,u){if(a&1&&A(0,"ww-canvas-chart",2),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,Rc))("type",e.type)}}var si=(()=>{class a extends J{constructor(){super(),this.businessTerms=w(Wr),this.dateService=w(Bt),this.chartId="visit-trend",this.periods=Di,this.periodsFormControl=new Ne(this.analyticsService.getInitialFormControlValue("visit-trend-period","date",sn),{nonNullable:!0}),this.period$=Ye(this.periodsFormControl),this.pluckEventLoggerParams=e=>({chart_period:e,chart_type:this.chartId}),this.pluckPeriodLabel=e=>rn[e],this.loading$=this.period$.pipe(ie(e=>e==="dayOfWeek"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDayOfWeek)):e==="hourOfDay"?this.analyticsService.loadingState$.pipe(c(t=>t.reportData)):e==="week"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByWeek)):e==="month"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByMonth)):this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDate)))),this.dataMap$=T([this.period$,this.businessTerms.businessTerms$,this.fullscreen$]).pipe(ie(([e,t,i])=>e==="dayOfWeek"?this.analyticsService.reportDataByDayOfWeek$.pipe(c(n=>this.createDataMap(e,n,t,i))):e==="hourOfDay"?this.analyticsService.reportData$.pipe(c(n=>this.createDataMap(e,n,t,i))):e==="week"?this.analyticsService.reportDataByWeek$.pipe(c(n=>this.createDataMap(e,n,t,i))):e==="month"?this.analyticsService.reportDataByMonth$.pipe(c(n=>this.createDataMap(e,n,t,i))):this.analyticsService.reportDataByDate$.pipe(c(n=>this.createDataMap(e,n,t,i)))),$((e,t)=>
128k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=T([this.fullscreen$,this.dataMap$]).pipe(c(([e,t])=>this.createChart(e,t.period,t.periods,t.series,t.legendItems))),this.title$=b($localize`Visit trend`),this.tooltip$=b($localize`The Visit trend chart visualizes a trend over time of the number of waitlisted parties, bookings, served parties, and dropoff.
129
130The dropdown list at the top right of the chart allows you to select different time breakouts:
131
132- Date (default): The total for each metric by day across the time range selected.
133- Hour of day: The average for each metric by hour of day across the time range selected.
134- Day of week: The average for each metric by day of week across the time range selected.
135`),this.exportData$=this.dataMap$.pipe(c(e=>{if(!e)return null;let t=e.columns.map(s=>`${s.label}`),i=e.columns.map(s=>s.key),n=e.rows.map(s=>Object.keys(s).reduce((h,S)=>(h[S]=Qt(s,S),h),{}));return{columns:t,keys:i,rows:n,fileName:`${this.chartId}-${e.period}-${e.dateRange}.csv`}})),this.subscribe()}subscribe(){this.persistObservableInQueryString(this.period$,"visit-trend-period")}createSeries(e,t,i,n,s){return[{name:s.waitingStateTerm.capitalized,data:e},{name:s.bookedStateTerm.capitalized,data:t},{name:s.servingStateTerm.capitalized,data:i},{name:$localize`Dropoff`,data:n}]}getHourFormat(e,t){let i=this.dateService.transform(`2001-01-01T${e<10?"0"+e:e}:00`,{hideDate:!0})??`${e}:00`;return t?i:i.replace(":00","")}createDataMap(e,t,i,n){let s=[{color:P["traffic-waitlist"],label:i.waitingStateTerm.capitalized,key:"waitlist"},{color:P["traffic-bookings"],label:i.bookedStateTerm.capitalized,key:"bookings"},{color:P["traffic-serving"],label:i.servingStateTerm.capitalized,key:"serving"},{color:P["traffic-dropoff"],label:$localize`Dropoff`,key:"dropoff"}];if(e==="hourOfDay"){let g=t?.data?.[0];if(!g)return{period:e,preset:"area",series:this.createSeries([],[],[],[],i),periods:this.analyticsService.hoursOfDay,legendItems:s,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let F=[{key:"name",label:$localize`Time`,sortable:!0},{key:"waitlist",label:i.waitingStateTerm.capitalized,sortable:!0},{key:"bookings",label:i.bookedStateTerm.capitalized,sortable:!0},{key:"serving",label:i.servingStateTerm.capitalized,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0}],q=this.createSeries(g.numWaitlistedByHourOfDay,g.numBookedByHourOfDay,g.numServedByHourOfDay,g.numDropoffByHourOfDay,i);return{hasData:oe(q.flatMap(re=>re.data.map(pt=>pt??0)??[]))>0,hasInternalPadding:!0,preset:"area",series:q,period:e,periods:this.analyticsService.hoursOfDay,legendItems:s,dateRange:`${t?.fromDate}-${t?.toDate}`,columns:F,rows:this.analyticsService.hoursOfDay.map((re,pt)=>({name:{value:this.getHourFormat(re,n),sortableValue:pt},waitlist:g.numWaitlistedByHourOfDay[pt],bookings:g.numBookedByHourOfDay[pt],serving:g.numServedByHourOfDay[pt],dropoff:g.numDropoffByHourOfDay[pt]}))}}if(e==="dayOfWeek"){let g=we(t?.data).filter(re=>re.dayOfWeekNumber>0).sort((re,pt)=>re.dayOfWeekNumber>pt.dayOfWeekNumber?1:-1),F=[{key:"name",label:$localize`Day`,sortable:!0},{key:"waitlist",label:i.waitingStateTerm.capitalized,sortable:!0},{key:"bookings",label:i.bookedStateTerm.capitalized,sortable:!0},{key:"serving",label:i.servingStateTerm.capitalized,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0}],q=this.createSeries(g.map(re=>re.numRegistrations.waitlist),g.map(re=>re.numRegistrations.booking+re.numRegistrations.waitlistedBooking),g.map(re=>re.numServed.total),g.map(re=>re.numDropoff),i),He=oe(q.flatMap(re=>re.data.map(pt=>pt??0)??[]))>0;return{period:e,preset:"area",hasData:He,hasInternalPadding:!0,series:q,periods:g.map(re=>Ut(re.dayOfWeek)),legendItems:s,dateRange:`${t?.fromDate}-${t?.toDate}`,columns:F,rows:g.map(re=>({name:{value:Ut(re.dayOfWeek),sortableValue:re.dayOfWeekNumber},waitlist:re.numRegistrations.waitlist,bookings:re.numRegistrations.booking+re.numRegistrations.waitlistedBooking,serving:re.numServed.total,dropoff:re.numDropoff}))}}let h=we(t?.data).filter(g=>e==="week"?(g.weekStarting??"").length>0:e==="month"?(g.month??"").length>0:(g.date??"").length>0),S=$localize`Date`;e==="week"?S=$localize`Week`:e==="month"&&(S=$localize`Month`);let W=[{key:"name",label:S,sortable:!0},{key:"waitlist",label:i.waitingStateTerm.capitalized,sortable:!0},{key:"bookings",label:i.bookedStateTerm.capitalized,sortable:!0},{key:"serving",label:i.servingStateTerm.capitalized,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0}],M=this.createSeries(h.map(g=>g.numRegistrations.waitlist),h.map(g=>g.numRegistrations.booking+g.numRegistrations.waitlistedBooking),h.map(g=>g.numServed.total),h.map(g=>g.numDropoff),i),V=oe(M.flatMap(g=>g.data.map(F=>F??0)??[]))>0,y=h.map(g=>e==="week"?g.weekStarting:e==="month"?`${g.month}-01`:g.date),C=e==="date"&&y.length===1?"bar":"area",O=h.map(g=>{let F=g.date;return e==="week"?F=g.weekStarting:e==="month"&&(F=g.month),{name:{value:this.dateService.transform(F,{hideTime:!0,hideDate:e==="month"})??F,sortableValue:F},waitlist:g.numRegistrations.waitlist,bookings:g.numRegistrations.booking+g.numRegistrations.waitlistedBooking,serving:g.numServed.total,dropoff:g.numDropoff}});return{period:e,preset:C,hasData:V,hasInternalPadding:!0,series:M,periods:y,legendItems:s,dateRange:`${t?.fromDate}-${t?.toDate}`,columns:W,rows:O}}createChart(e,t,i,n,s){let h=Math.max(...n.flatMap(O=>O.data.map(g=>g??0))),S=i.map(O=>t==="hourOfDay"&&typeof O=="number"?this.getHourFormat(O,!this.dateService.isAmPm):t==="dayOfWeek"||typeof O!="string"?`${O}`:t==="month"?this.dateService.transform(O,{hideDate:!0,hideTime:!0}):t==="week"?this.dateService.transform(O,{hideTime:!0}):this.dateService.transform(O,{hideTime:!0})),W=i.map(O=>t==="hourOfDay"&&typeof O=="number"?this.getHourFormat(O,!this.dateService.isAmPm):t==="dayOfWeek"||typeof O!="string"?`${O}`:t==="month"?this.dateService.transform(O,{hideDate:!0,hideTime:!0}):t==="week"?$localize`Week starting with ${this.dateService.transform(O,{hideTime:!0})}`:this.dateService.transform(O,{hideTime:!0})),M=[bt()],V={datasets:n.map((O,g)=>({data:O.data.map(F=>F??0),label:O.name,order:g,borderWidth:2,borderColor:s[g].color,fill:"origin",cubicInterpolationMode:"default",backgroundColor:oi(s[g].color),pointStyle:"rectRounded",pointBackgroun
135dColor:s[g].color,pointRadius:0,pointHoverRadius:6})),labels:S},y=e?31:7;if(!e)switch(t){case"month":y=12;break;case"hourOfDay":y=24;break;default:y=7;break}let C=ut({elements:{line:{tension:0}},plugins:{tooltip:{callbacks:{title:function(O){return W[O[0].dataIndex]??O[0].label}}}},scales:{x:{ticks:{maxTicksLimit:y}},y:{suggestedMin:0,suggestedMax:Math.ceil(h*1.1),ticks:{display:e}}}});return{data:V,options:C,plugins:M,type:"line"}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-visit-trend"]],hostAttrs:[1,"ww-analytics-chart-visit-trend"],standalone:!1,features:[B],decls:13,vars:28,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-visit-trend-period",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(10,"ww-chart-layout-select")(11,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(12,kc,1,5,"ww-canvas-chart",2),m()),t&2){let n=r(1,13,i.dataMap$);l(2);let s=N(r(3,15,i.chart$));l(2),p("chartTitle",r(5,18,i.title$))("tooltip",r(6,20,i.tooltip$))("loading",r(7,22,i.loading$))("dataMap",n)("isFullscreen",r(8,24,i.fullscreen$))("showTable",r(9,26,i.fullscreen$)),l(7),p("formControl",i.periodsFormControl)("data",i.periods)("pluckLabel",i.pluckPeriodLabel)("searchable",!1)("wwEventLogger","updated_analytics_period")("wwEventLoggerPluckControlParams",i.pluckEventLoggerParams),l(),v(n&&s?12:-1)}},dependencies:[Ae,be,Ve,Q,Fe,Oe,ge,L],encapsulation:2,changeDetection:0})}}return a})();var Ec=(a,u)=>u.group;function xc(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",5),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}function Wc(a,u){a&1&&(d(0,"div",9),A(1,"ww-illustration",11),d(2,"span",12),te(3,0),m()())}function Ic(a,u){if(a&1){let e=ae();d(0,"ww-table",13),o(1,"async"),E("headerClicked",function(i){G(e);let n=f(4);return H(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f(4);return H(i.onChartClicked())}),m()}if(a&2){f(2);let e=x(0),t=f(2),i=x(2);p("columns",i.groupColumns)("data",e)("pluckCellLabel",i.pluckCellLabel)("selection","none")("orderBy",r(1,5,t.orderBy$))}}function Mc(a,u){if(a&1&&(d(0,"div"),_(1,Wc,4,0,"div",9)(2,Ic,2,7,"ww-table",10),m()),a&2){f();let e=x(0);l(),v(!e||e.length===0?1:2)}}function Bc(a,u){if(a&1&&(R(0),d(1,"ww-expansion",6)(2,"ww-expansion-header",7),U(3),m(),Le(4,Mc,3,1,"div",8),m()),a&2){let e=u.$implicit,t=u.$index;f(2);let i=x(2);N(i.rowsByGroup[e.group]),l(),p("initiallyOpened",t===0)("bordered",!1),l(2),xe(" ",e.group," ")}}function Fc(a,u){if(a&1&&(d(0,"div",4),We(1,Bc,5,4,"ww-expansion",6,Ec),m()),a&2){f();let e=x(2);l(),Ie(e.groups)}}var da=(()=>{class a extends J{constructor(){super(),this.chartId="visits-by-label",this.metrics=on,this.primaryMetricsFormControl=new Ne(this.analyticsService.getInitialFormControlValue("label-metric","numVisits",Jt),{nonNullable:!0}),this.primaryMetric$=Ye(this.primaryMetricsFormControl),this.pluckMetricsLabel=e=>ee[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.orderBySub=new De({property:"numVisits",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLabels)),this.dataMap$=T([this.analyticsService.reportDataForLabels$,this.primaryMetric$,this.orderBy$]).pipe(c(([e,t,i])=>this.createDataMap(e,t,i)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Labels`),this.tooltip$=b($localize`The Labels chart is a bar chart summarizing location groupings through labels. Each bar represents the label group and is stacked by the values available within that label grouping.
136
137The metrics include:
138
139- Total Visits
140- Bookings
141- Waitlisted Parties
142- Waitlisted bookings
143- Dropoff
144- Served
145- Completed
146- No-show
147- Cancelled
148- Removed`),this.bars$=this.dataMap$.pipe(c(e=>e.groups.map(t=>({key:t.group,label:t.group??$localize`<No value>`,formattedValue:`${oe(t.labels.map(i=>this.getValue(e.primaryMetric,i)))}`,values:t.labels.map((i,n,s)=>{let S=.8/s.length,W=.2+S+n*S,M=this.getValue(e.primaryMetric,i),V=Math.ceil(M).toLocaleStr
148ing();return{label:i.label,value:M,formattedValue:V,opacity:W}})})))),this.persistObservableInQueryString(this.primaryMetric$,"label-metric")}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t,i){if(!e||e.length<1)return{groups:[],rowsByGroup:{},dataRows:[],hideLegend:!0,legendItems:[],primaryMetric:t,dateRange:"",columns:[],groupColumns:[],rows:[],pluckCellLabel:null};let n=e.filter(se),s=n[0]?.fromDate??"",h=n[0]?.toDate??"",S=n.map(g=>{let F=g.data??[],q=g.dimensions?.[0]?.replace("label:","");if(!q||!Lt(q))return console.warn("No label group found in response dimensions",g.dimensions),null;let He=F.filter(re=>(re.labels?.[q]?.length??0)>0&&this.getValue(t,re)>0);return{group:q,labels:He.map(re=>K(j({},re),{label:re.labels?.[q]?.[0]??$localize`<No value>`}))??[]}}).filter(se),W=S.flatMap(g=>g.labels.map(F=>j({group:g.group},F))),M=W.sort((g,F)=>(F.numVisits??0)-(g.numVisits??0)).sort(Ke("group")),V=W.flatMap(g=>this.getValue(t,g));if(oe(V)<=0)return{dataRows:[],groups:[],rowsByGroup:{},hideLegend:!0,legendItems:[],primaryMetric:t,labelGroup:null,dateRange:"",columns:[],groupColumns:[],rows:[],pluckCellLabel:null};let y=[{key:"group",label:$localize`Group`,sortable:!0},{key:"label",label:$localize`Label`,sortable:!0},{key:"numVisits",label:ee.numVisits,sortable:!0},{key:"numRegistrations.booking",label:ee["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:ee["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:ee["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:ee.numDropoff,sortable:!0},{key:"numServed.total",label:ee["numServed.total"],sortable:!0},{key:"numCompleted.total",label:ee["numCompleted.total"],sortable:!0},{key:"numNoShowed.total",label:ee["numNoShowed.total"],sortable:!0},{key:"numCancelled.total",label:ee["numCancelled.total"],sortable:!0},{key:"numRemoved.total",label:ee["numRemoved.total"],sortable:!0}],C=M.map(g=>({group:g.group,label:g.label,numVisits:g.numVisits,"numRegistrations.booking":g.numRegistrations.booking,"numRegistrations.waitlist":g.numRegistrations.waitlist,"numRegistrations.waitlistedBooking":g.numRegistrations.waitlistedBooking,numDropoff:g.numDropoff,"numServed.total":g.numServed.total,"numCompleted.total":g.numCompleted.total,"numNoShowed.total":g.numNoShowedByVisitType.total,"numCancelled.total":g.numCancelledByVisitType.total,"numRemoved.total":g.numRemovedByVisitType.total}));i?C=Nt(C,i):C=Nt(C,{property:"numVisits",direction:"desc"});let O=C.reduce((g,F)=>(g[F.group]||(g[F.group]=[]),g[F.group].push(F),g),{});return{hasData:!0,hideLegend:!0,legendItems:[],groups:S,rowsByGroup:O,dataRows:M,primaryMetric:t,dateRange:`${s}-${h}`,columns:y,groupColumns:y.slice(1),rows:C,pluckCellLabel:g=>y.reduce((F,q)=>K(j({},F),{[q.key]:g[q.key]}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-visits-by-label"]],hostAttrs:[1,"ww-analytics-chart-visits-by-label"],standalone:!1,features:[B],decls:13,vars:27,consts:()=>{let e;return e=$localize`No data available`,[e,[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-visits-by-label-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","fullscreen"],[1,"flex","flex-col","gap-6","pt-6","max-w-full","min-w-full"],[3,"chartClicked","linkClicked","data","fullscreen"],[1,"max-w-full","min-w-full",3,"initiallyOpened","bordered"],["openIcon","bx-chevron-up","closedIcon","bx-chevron-down","wwColor","black","wwTypography","h5",1,"!justify-start","gap-2","py-2"],[4,"wwExpansionContent"],[1,"flex","flex-col","items-center","justify-center","gap-2","w-full","py-2"],[1,"w-full","ww-chart-layout-table",3,"columns","data","pluckCellLabel","selection","orderBy"],["icon","ww-analytics-chart-no-data-fullscreen","wwColor","black"],["wwColor","black"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","columns","data","pluckCellLabel","selection","orderBy"]]},template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",1),o(5,"async"),o(6,"async"),o(7,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(8,"ww-chart-layout-select")(9,"ww-select",2),E("click",function(s){return s.stopPropagation()}),m()(),_(10,xc,2,4,"ww-bar-chart",3),o(11,"async"),_(12,Fc,3,0,"div",4),m()),t&2){let n,s=r(1,14,i.fullscreen$)??!1;l(2);let h=N(r(3,16,i.dataMap$));l(2),p("chartTitle",r(5,19,i.title$))("tooltip",r(6,21,i.tooltip$))("loading",r(7,23,i.loading$))("dataMap",h)("isFullscreen",s)("showTable",!1),l(5),p("formControl",i.primaryMetricsF
148ormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(11,25,i.bars$))?10:-1,n),l(2),v(s&&h&&h.groups.length>0&&h.rowsByGroup?12:-1)}},dependencies:[Ae,be,Q,Fe,Oe,Be,he,Cr,yr,wr,yi,ge,vt,Xe,L],styles:[`.ww-analytics-chart-visits-by-label .ww-expansion:not(.ww-expansion-opened) .ww-expansion-header{border-bottom:1px solid var(--ww-color-mediumGrey)}
149/*noopanalytics-chart-visits-by-label.component-4RWDKSIN.css.map */
150`],encapsulation:2,changeDetection:0})}}return a})();function Oc(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("hiddenRowCount",r(1,3,e.hiddenRowCount$))("fullscreen",r(2,5,e.fullscreen$))}}var ua=(()=>{class a extends J{constructor(){super(),this.durationService=w(Me),this.chartId="visits-by-location",this.metrics=Ui,this.primaryMetricsFormControl=new Ne(this.analyticsService.getInitialFormControlValue("location-p-metric","numVisits",Jt),{nonNullable:!0}),this.primaryMetric$=Ye(this.primaryMetricsFormControl),this.pluckMetricsLabel=e=>ee[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLocations)),this.dataMap$=T([this.fullscreen$,this.analyticsService.reportDataForLocations$,this.primaryMetric$]).pipe(c(([e,t,i])=>this.createDataMap(e,t,i)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Locations`),this.tooltip$=b($localize`The Locations chart is a bar chart summarizing locations using different metrics.
151
152The metrics include:
153
154- Total Visits
155- Bookings
156- Waitlisted Parties
157- Waitlisted bookings
158- Dropoff
159- Served
160- Completed
161- No-show
162- Cancelled
163- Removed
164- Avg wait duration
165- Avg serve duration`),this.bars$=this.dataMap$.pipe(c(e=>e.dataRows.map(t=>{let i=t.locationName??$localize`Unknown/None`,n=this.getValue(e.primaryMetric,t),h=this.getFormatter(e.primaryMetric)(n);return{key:t.locationId,label:i,formattedValue:h,values:[{label:i,value:n,formattedValue:h}]}}))),this.hiddenRowCount$=this.dataMap$.pipe(c(e=>e.hiddenRowCount??0)),this.subscribe()}ngOnInit(){super.ngOnInit()}subscribe(){this.persistObservableInQueryString(this.primaryMetric$,"location-p-metric")}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t,i){let n=t?.data??[],s=t?.dimensions?.[1];if(!t||n.length<1||!s)return{dataRows:[],legendItems:[],hideLegend:!0,primaryMetric:i,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let h=n.sort((C,O)=>this.getValue(i,O)-this.getValue(i,C)),S=e?h:h.slice(0,$i),W=h.length-S.length,M=S.map(C=>this.getValue(i,C));if(oe(M)<=0)return{dataRows:[],legendItems:[],hideLegend:!0,primaryMetric:i,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let V=[{key:"name",label:$localize`Location`,sortable:!0},{key:"numVisits",label:ee.numVisits,sortable:!0},{key:"numRegistrations.booking",label:ee["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:ee["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:ee["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:ee.numDropoff,sortable:!0},{key:"numServed.total",label:ee["numServed.total"],sortable:!0},{key:"numCompleted.total",label:ee["numCompleted.total"],sortable:!0},{key:"numNoShowed.total",label:ee["numNoShowed.total"],sortable:!0},{key:"numCancelled.total",label:ee["numCancelled.total"],sortable:!0},{key:"numRemoved.total",label:ee["numRemoved.total"],sortable:!0},{key:"avgWaitDuration",label:ee.avgWaitDuration,sortable:!0},{key:"avgServeDuration",label:ee.avgServeDuration,sortable:!0},{key:"maxWaitDuration",label:ee.maxWaitDuration,sortable:!0},{key:"maxServeDuration",label:ee.maxServeDuration,sortable:!0}],y=S.map(C=>({name:C[s]?.toString()??$localize`Unknown/None`,numVisits:C.numVisits,"numRegistrations.booking":C.numRegistrations.booking,"
165numRegistrations.waitlist":C.numRegistrations.waitlist,"numRegistrations.waitlistedBooking":C.numRegistrations.waitlistedBooking,numDropoff:C.numDropoff,"numServed.total":C.numServed.total,"numCompleted.total":C.numCompleted.total,"numNoShowed.total":C.numNoShowedByVisitType.total,"numCancelled.total":C.numCancelledByVisitType.total,"numRemoved.total":C.numRemovedByVisitType.total,avgWaitDuration:(C.avgWaitDuration??0)>0?this.durationService.transform(C.avgWaitDuration):"-",avgServeDuration:(C.avgServeDuration??0)>0?this.durationService.transform(C.avgServeDuration):"-",maxWaitDuration:(C.maxWaitDuration??0)>0?this.durationService.transform(C.maxWaitDuration):"-",maxServeDuration:(C.maxServeDuration??0)>0?this.durationService.transform(C.maxServeDuration):"-"})).sort((C,O)=>C.numVisits<O.numVisits?1:-1);return{hasData:!0,dataRows:S,legendItems:[],hideLegend:!0,primaryMetric:i,dateRange:`${t.fromDate}-${t.toDate}`,columns:V,rows:y,hiddenRowCount:W}}getFormatter(e){switch(e){case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t=>this.durationService.transform(t);default:return t=>`${typeof t=="number"?Math.ceil(t):t}`}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-visits-by-location"]],hostAttrs:[1,"ww-analytics-chart-visits-by-location"],standalone:!1,features:[B],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-visits-by-location-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","hiddenRowCount","fullscreen"],[3,"chartClicked","linkClicked","data","hiddenRowCount","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,Oc,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Oe,Be,ge,L],encapsulation:2,changeDetection:0})}}return a})();function Pc(a,u){if(a&1&&A(0,"img",8),a&2){let e=f().$implicit;p("src",e.image,Ii)}}function zc(a,u){if(a&1&&(d(0,"td",7),_(1,Pc,1,1,"img",8),m()),a&2){let e=u.$implicit,t=f().$implicit;f();let i=x(0);xa(e.style),p("wwTooltip",`${t.name} ${e.x}: ${i?i(e.y):e.y}`)("wwTooltipWithTouch",!0),l(),v(e.image?1:-1)}}function Yc(a,u){if(a&1&&(d(0,"tr")(1,"td",5),U(2),m(),We(3,zc,2,5,"td",6,Yt),m()),a&2){let e=u.$implicit;l(2),xe(" ",e.shortName," "),l(),Ie(e.data)}}function Uc(a,u){if(a&1&&(d(0,"td",4),U(1),m()),a&2){let e=u.$implicit,t=u.$index;l(),xe(" ",t===0?"":e.label," ")}}function Gc(a,u){if(a&1){let e=ae();R(0),d(1,"table",3),E("click",function(){G(e);let i=f();return H(i.onChartClicked())}),d(2,"tbody"),We(3,Yc,5,1,"tr",null,Yt),d(5,"tr"),We(6,Uc,2,1,"td",4,Yt),m()()()}if(a&2){f();let e=x(0),t=x(2);N(e.tooltipFormatter),l(),tt("cursor-pointer",!t);let i=e.reversedSeries;l(2),Ie(i),l(3),Ie(e.columns)}}function Hc(a){return a==="totalVisits"||a==="waitlisted"||a==="bookings"||a==="served"||a==="dropoff"||a==="dropoffRatio"||a==="avgWaitDuration"||a==="avgServeDuration"||a==="avgLineLength"||a==="maxLineLength"}var jc={totalVisits:$localize`Total visits`,waitlisted:$localize`Waitlisted`,bookings:$localize`Bookings`,served:$localize`Served`,dropoff:$localize`Dropoffs`,dropoffRatio:$localize`Dropoff rate`,avgWaitDuration:$localize`Avg wait duration`,avgServeDuration:$localize`Avg serve duration`,avgLineLength:$localize`Avg line length`,maxLineLength:$localize`Max line length`},qc={totalVisits:"numVisitsByHourOfDay",waitlisted:"numWaitlistedByHourOfDay",bookings:"numBookedByHourOfDay",served:"numServedByH
165ourOfDay",dropoff:"numDropoffByHourOfDay",dropoffRatio:"dropoffRatioByHourOfDay",avgWaitDuration:"avgWaitDurationByHourOfDay",avgServeDuration:"avgServeDurationByHourOfDay",avgLineLength:"avgLineLengthByHourOfDay",maxLineLength:"maxLineLengthByHourOfDay"},ha=(()=>{class a extends J{constructor(){super(),this.datePipe=w(Wo),this.durationService=w(Me),this.locationRx=w(At),this.chartId="visits-heatmap",this.metrics=qe()(["totalVisits","waitlisted","bookings","served","dropoff","dropoffRatio","avgWaitDuration","avgServeDuration","avgLineLength","maxLineLength"]),this.metricsFormControl=new Ne(this.analyticsService.getInitialFormControlValue("visits-dist-metric","totalVisits",Hc),{nonNullable:!0}),this.metric$=Ye(this.metricsFormControl),this.pluckMetricLabel=e=>jc[e],this.pluckEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.hoursByWeekday$=this.analyticsService.reportDataByDayOfWeek$.pipe(c(e=>e?.locationIds??[]),ie(e=>this.locationRx.getLocationsByIds(e,["hours"])),c(e=>e.map(({hours:t})=>t).filter(se))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData||e.reportDataByDayOfWeek)),this.dataMap$=T([this.metric$,this.analyticsService.reportData$,this.analyticsService.reportDataByDayOfWeek$,this.hoursByWeekday$,this.fullscreen$]).pipe(c(([e,t,i,n,s])=>this.createDataMap(e,t,i,n,s)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Heatmap`),this.tooltip$=b($localize`A heatmap of when visits most typically occur, broken out by weekday and hour of day.
166
167The dropdown list in the top right corner lets you pick from a number of different metrics to compare:
168
169- Waitlisted parties
170- Bookings
171- Served parties
172- Dropoffs
173- Avg wait duration
174- Avg serve duration
175- Avg line length
176- Max line length`),this.exportData$=this.dataMap$.pipe(c(e=>{if(!e)return null;let t=e.columns.map(s=>`${s.label}`),i=e.columns.map(s=>s.key),n=e.rows;return{columns:t,keys:i,rows:n,fileName:`${this.chartId}-${e.metric}-${e.dateRange}.csv`}})),this.valuesToSeries=(e,t)=>t?t.map((i,n)=>({x:this.getHourFormat(n,e),y:i??0}
176)):[],this.subscribe()}subscribe(){this.persistObservableInQueryString(this.metric$,"visits-dist-metric")}getHourFormat(e,t){let i=this.datePipe.transform(`2001-01-01T${e<10?"0"+e:e}:00`,"shortTime")??`${e}:00`;return t?i:i.replace(":00","")}getDataLabelFormatter(e){switch(e){case"avgWaitDuration":case"avgServeDuration":return t=>typeof t!="number"?"":t<1?t.toString():this.durationService.transform(t);case"dropoffRatio":return t=>typeof t!="number"?"":`${Math.round(t*100)}%`}}getTooltipFormatter(e){switch(e){case"avgWaitDuration":case"avgServeDuration":return t=>typeof t!="number"?"":t<1?t.toString():this.durationService.transform(t);case"dropoffRatio":return t=>typeof t!="number"?"":`${Math.round(t*100)}%`}}ensureAllDaysOfWeekArePresent(e){let t=e.data.map(i=>i.dayOfWeekNumber);for(let i=1;i<=7;i++)t.includes(i)||e.data.push(K(j({},Jo),{dayOfWeekNumber:i,dayOfWeek:pn(i,e.weekdayStart),numVisitsByHourOfDay:Array(24).fill(0),numWaitlistedByHourOfDay:Array(24).fill(0),numBookedByHourOfDay:Array(24).fill(0),numServedByHourOfDay:Array(24).fill(0),numDropoffByHourOfDay:Array(24).fill(0),avgWaitDurationByHourOfDay:Array(24).fill(0),avgServeDurationByHourOfDay:Array(24).fill(0),avgLineLengthByHourOfDay:Array(24).fill(0),maxLineLengthByHourOfDay:Array(24).fill(0)}));return e}removeZeroValuesFromSeriesOutsideCommonHours(e,t){if(t===null||t.first>t.last||t.first===0&&t.last===23)return e;let i=e.reduce((S,W)=>{let M=W.data.findIndex(V=>V.y>0);return M>=0&&M<S&&(S=M),S},23),n=e.reduce((S,W)=>{let V=[...W.data].reverse().findIndex(C=>C.y>0),y=V>-1?23-V:-1;return y>=0&&y>S&&(S=y),S},0),s=i<t.first?i:t.first,h=n>t.last?n:t.last;return e.map(S=>({name:S.name,shortName:S.shortName,data:S.data.slice(s,h+1)}))}createDataMap(e,t,i,n,s){if(t&&i){let h=cn(n),S=this.ensureAllDaysOfWeekArePresent(i).data.filter(g=>g.dayOfWeekNumber>0).sort((g,F)=>g.dayOfWeekNumber<F.dayOfWeekNumber?1:-1).map(g=>({name:this.getDayOfWeekName(g,!0),shortName:this.getDayOfWeekName(g,!1),data:this.valuesToSeries(s,g[qc[e]])})),W=this.removeZeroValuesFromSeriesOutsideCommonHours(S,h),M=this.getDataLabelFormatter(e),V=this.getTooltipFormatter(e),y=[{key:"name",label:$localize`Day`,sortable:!0},...this.analyticsService.hoursOfDay.map(g=>{let F=this.datePipe.transform(`2001-01-01T${g<10?"0"+g:g}:00`,"shortTime")??`${g}:00`,q=s?F:F.replace(":00","");return{key:`${g}:00`,label:q.trim().replace(" ",`\r
177`),sortable:!0}})],C=Math.max(...W.flatMap(g=>g.data.map(F=>F.y))),O=W.map(g=>({name:g.name,shortName:g.shortName,data:g.data.map(F=>{if(F.y<1)return K(j({},F),{image:Mi(Ft("lighterGrey")),style:{opacity:1,backgroundColor:"var(--ww-color-lighterGrey)"}});let q=jt(F.y,C),He=1;return q<10?He=.1:q<100&&(He=Uo(q,5)/100),K(j({},F),{image:Mi(`rgba(2, 63, 178, ${He})`),style:{opacity:`${He}`,backgroundColor:"#023fb2"}})})}));return{hasData:!this.isSeriesEmpty(W),series:O,reversedSeries:[...O].reverse(),dataLabelFormatter:M,tooltipFormatter:V,hideLegend:!0,legendItems:[],metric:e,dateRange:`${t.fromDate}-${t.toDate}`,columns:y,rows:S.map(g=>j({name:g.name},g.data.reduce((F,q,He)=>K(j({},F),{[`${He}:00`]:M?M(q.y):q.y}),{}))).reverse()}}return{series:[],reversedSeries:[],hideLegend:!0,legendItems:[],metric:e,dateRange:"",columns:[],rows:[],pluckCellLabel:null}}isSeriesEmpty(e){if(e.length<1)return!0;let t=e.flatMap(i=>i.data.map(n=>n.y??0));return t.length<1||oe(t)<1}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-visits-heatmap"]],hostAttrs:[1,"ww-analytics-chart-visits-heatmap"],standalone:!1,features:[B],decls:13,vars:29,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-visits-heatmap-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[1,"ww-analytics-chart-visits-heatmap-table","border-separate","border-spacing-1",3,"cursor-pointer"],[1,"ww-analytics-chart-visits-heatmap-table","border-separate","border-spacing-1",3,"click"],["wwTypography","caption2","wwColor","darkerGrey",1,"whitespace-break-spaces"],["wwTypography","caption2","wwColor","darkerGrey",1,"uppercase"],[3,"style","wwTooltip","wwTooltipWithTouch"],[3,"wwTooltip","wwTooltipWithTouch"],[1,"print:visible","invisible",2,"height","100%","width","100%",3,"src"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(10,"ww-chart-layout-select")(11,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(12,Gc,8,3,"table",2),m()),t&2){let n=N(r(1,13,i.dataMap$));l(2),N(r(3,16,i.fullscreen$)),l(2),p("chartTitle",r(5,19,i.title$))("tooltip",r(6,21,i.tooltip$))("loading",r(7,23,i.loading$))("dataMap",n)("isFullscreen",r(8,25,i.fullscreen$))("showTable",r(9,27,i.fullscreen$)),l(7),p("formControl",i.metricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckEventLoggerParams),l(),v(n?12:-1)}},dependencies:[Ae,be,Q,Fe,Oe,he,ge,Ci,Xe,L],styles:[`.ww-analytics-chart-visits-heatmap .ww-chart-layout .ww-chart-layout-card{padding-bottom:0}.ww-analytics-chart-visits-heatmap .ww-chart-layout .ww-chart-layout-graph{overflow:auto;align-items:flex-start;max-height:292px;min-height:292px}.ww-analytics-chart-visits-heatmap .ww-chart-layout .ww-chart-layout-graph .ww-analytics-chart-visits-heatmap-table{width:100%}.ww-analytics-chart-visits-heatmap .ww-chart-layout .ww-chart-layout-graph .ww-analytics-chart-visits-heatmap-table td{width:4%;min-width:4%;height:32px;min-height:32px;text-align:center;border-radius:4px;white-space-collapse:preserve-breaks}.ww-analytics-chart-visits-heatmap .ww-chart-layout.ww-chart-layout-loading .ww-chart-layout-graph{align-items:center}
178/*noopanalytics-chart-visits-heatmap.component-GCLLMCUM.css.map */
179`],encapsulation:2,changeDetection:0})}}return a})();var Xc=()=>[];function Qc(a,u){if(a&1&&A(0,"ww-canvas-chart",1),a&2){f();let e=x(2);p("data",e.data)("options",e.options)("plugins",e.plugins??$e(4,Xc))("type",e.type)}}var fa=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(Me),this.chartId="wait-serve-durations",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.distributionsData)),this.dataMap$=this.analyticsService.distributionsData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
179k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=T([this.dataMap$]).pipe(c(([e])=>this.createChart(e.entries))),this.title$=b($localize`Wait & serve durations`),this.tooltip$=b($localize`The Wait & serve durations chart shows the frequency of waitlisted and served visits by different duration increments.`)}createDataMap(e){if(!e)return{entries:[],legendItems:[],dateRange:"",columns:[],rows:[]};let t=(s,h,S)=>s<=1?`< ${this.durationService.transform(s,{format:S})}`:s+1>=h?`> ${this.durationService.transform(s,{format:S})}`:`${this.durationService.transform(s,{format:S})} - ${this.durationService.transform(h,{format:S})}`,i=e?.data.find(s=>s.distributionType==="durations")?.data?.map(s=>({range:t(s.lowerBound??0,s.upperBound??0,"short"),rangeLong:t(s.lowerBound??0,s.upperBound??0,"medium"),served:s.serveDurationFrequency??0,waitlisted:s.waitDurationFrequency??0}))??[],n=[{key:"range",label:$localize`Range`,sortable:!0},{key:"served",label:$localize`Served`,sortable:!0},{key:"waitlisted",label:$localize`Waitlisted`,sortable:!0}];return{hasData:oe(i.flatMap(s=>s.served+s.waitlisted))>0,hasInternalPadding:!0,entries:i,legendItems:[{key:"waitlisted",color:P["wait-serve-durations-waitlisted"],label:$localize`Waitlisted`},{key:"served",color:P["wait-serve-durations-served"],label:$localize`Served`}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:i.map(s=>({range:s.rangeLong,waitlisted:s.waitlisted,served:s.served}))}}createChart(e){let t=e.flatMap(W=>[W.waitlisted,W.served]),i=Math.max(...t,0),n=[bt()],s=[P["wait-serve-durations-waitlisted"],P["wait-serve-durations-served"]],h={datasets:[{type:"line",label:$localize`Waitlisted`,data:e.map(W=>W.waitlisted),borderColor:s[0],fill:"origin",backgroundColor:oi(s[0]),pointStyle:"rectRounded",pointBackgroun
179dColor:s[0],pointRadius:0,pointHoverRadius:6},{type:"line",label:$localize`Served`,data:e.map(W=>W.served),borderColor:s[1],fill:"origin",backgroundColor:oi(s[1]),pointStyle:"rectRounded",pointBackgroundColor:s[1],pointRadius:0,pointHoverRadius:6}],labels:e.map(W=>W.range)},S=ut({elements:{line:{tension:0}},scales:{x:{ticks:{maxTicksLimit:e.length}},y:{display:!1,suggestedMin:0,suggestedMax:Math.ceil(i*1.1)}}});return{data:h,options:S,plugins:n,type:"line"}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-wait-serve-durations"]],hostAttrs:[1,"ww-analytics-chart-wait-serve-durations"],standalone:!1,features:[B],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","options","plugins","type"]],template:function(t,i){if(t&1&&(R(0),o(1,"async"),R(2),o(3,"async"),d(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(10,Qc,1,5,"ww-canvas-chart",1),m()),t&2){let n=r(1,7,i.dataMap$);l(2);let s=N(r(3,9,i.chart$));l(2),p("chartTitle",r(5,12,i.title$))("tooltip",r(6,14,i.tooltip$))("loading",r(7,16,i.loading$))("dataMap",n)("isFullscreen",r(8,18,i.fullscreen$))("showTable",r(9,20,i.fullscreen$)),l(6),v(n&&s?10:-1)}},dependencies:[Ve,Q,L],encapsulation:2,changeDetection:0})}}return a})();function Jc(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",2),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}var ya=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(Me),this.chartId="csat-by-location",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatByLocationData)),this.dataMap$=this.analyticsService.csatByLocationData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Location performance`),this.tooltip$=b($localize`The Location performance chart shows the top locations, ordered by the number of responses. The bar represents the number of responses, and the dot represents the average satisfaction score.
180
181The Location performance table displays the top locations sorted by default by the number of responses.
182
183The metrics available by location include: Responses, Average satisfaction score, Average Original Position, Average wait, Average serve duration, and Dropoff rate`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=`${t.locationName}`,n=t.numSurveyAnswers,s=n.toLocaleString(),h=t.avgSurveyAnswerValue,S=hi,W=fi,M=jt(h-W,S-W);return{key:t.locationName,label:i,formattedValue:s,values:[{label:$localize`Responses`,value:n,formattedValue:s,color:P["csat-responses"]}],dataLabel:{label:$localize`Avg score`,value:h,valueAsPercentOfMax:M,formattedValue:h.toFixed(1),color:P["csat-avg-score"]}}})))}createDataMap(e){let t=we(e?.data);if(!e||t.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"locationName",label:$localize`Location`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],n=t.filter(s=>se(s.locationName)).sort(Ke("locationName")).sort((s,h)=>s.numSurveyAnswers<h.numSurveyAnswers?1:-1).map(s=>({locationName:s.locationName??$localize`(No location)`,numSurveyAnswers:s.numSurveyAnswers,avgSurveyAnswerValue:s.avgSurveyAnswerValue??0,avgVisitOriginalPosition:s.avgVisitOriginalPosition??0,avgVisitWaitDuration:s.avgVisitWaitDuration?this.durationService.transform(s.avgVisitWaitDuration):"-",avgVisitServeDuration:s.avgVisitServeDuration?this.durationService.transform(s.avgVisitServeDuration):"-",dropoffRatio:s.dropoffRatio>=0?`${Math.round(s.dropoffRatio*100).toFixed(0)}%`:"-"}));return{hasData:oe(n.map(s=>s.numSurveyAnswers))>0,legendItems:[{key:"responses",label:$localize`Responses`,color:P["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:P["csat-avg-score"]}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-csat-by-location"]],hostAttrs:[1,"ww-analytics-chart-csat-by-location"],standalone:!1,features:[B],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(7,Jc,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),v((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[Q,Be,L],encapsulation:2,changeDetection:0})}}return a})();function tp(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",2),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}var Ca=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(Me),this.chartId="csat-by-resource",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatByResourceData)),this.dataMap$=this.analyticsService.csatByResourceData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
183k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Resource performance`),this.tooltip$=b($localize`The Resource performance chart shows the top resource combinations across resource categories, ordered by the number of responses. The bar represents the number of responses, and the dot represents the average satisfaction score.
184
185The Resource performance table displays the top resource combinations across resource categories, sorted by default by the number of responses.
186
187The metrics available by resource combination include: Responses, Average satisfaction score, Average Original Position, Average wait, Average serve duration, and Dropoff rate
188
189The resource combinations data will only be meaningful if you allow your customers to select more than one resource when registering, thereby creating resource combinations. If your business does not allow multiple resources, the data in this chart and table will be displayed on a per-resource basis instead.`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=t.resourceCombinations,n=t.numSurveyAnswers,s=n.toLocaleString(),h=t.avgSurveyAnswerValue,S=hi,W=fi,M=jt(h-W,S-W);return{key:i,label:i,formattedValue:s,values:[{label:$localize`Responses`,value:n,formattedValue:s,color:P["csat-responses"]}],dataLabel:{label:$localize`Avg score`,value:h,valueAsPercentOfMax:M,formattedValue:h.toFixed(1),color:P["csat-avg-score"]}}})))}createDataMap(e){let t=we(e?.data);if(!e||t.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"resourceCombinations",label:$localize`Resource`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],n=t.filter(s=>se(s.resourceCombinations)).sort(Ke("locationName")).sort((s,h)=>s.numSurveyAnswers<h.numSurveyAnswers?1:-1).map(s=>({resourceCombinations:s.resourceCombinations??$localize`(No resource)`,numSurveyAnswers:s.numSurveyAnswers,avgSurveyAnswerValue:s.avgSurveyAnswerValue??0,avgVisitOriginalPosition:s.avgVisitOriginalPosition??0,avgVisitWaitDuration:s.avgVisitWaitDuration?this.durationService.transform(s.avgVisitWaitDuration):"-",avgVisitServeDuration:s.avgVisitServeDuration?this.durationService.transform(s.avgVisitServeDuration):"-",dropoffRatio:s.dropoffRatio>=0?`${Math.round(s.dropoffRatio*100).toFixed(0)}%`:"-"}));return{hasData:oe(n.map(s=>s.numSurveyAnswers))>0,legendItems:[{key:"responses",label:$localize`Responses`,color:P["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:P["csat-avg-score"]}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-csat-by-resource"]],hostAttrs:[1,"ww-analytics-chart-csat-by-resource"],standalone:!1,features:[B],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(7,tp,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),v((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[Q,Be,L],encapsulation:2,changeDetection:0})}}return a})();function ap(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",2),o(1,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",u)("fullscreen",r(1,2,e.fullscreen$))}}var wa=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(Me),this.chartId="csat-by-service",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatByServiceData)),this.dataMap$=this.analyticsService.csatByServiceData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
189k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Service performance`),this.tooltip$=b($localize`The Service performance chart shows the top service combinations across service categories ordered by the number of responses. The bar represents the number of responses, and the dot represents the average satisfaction score.
190
191The Service performance table displays the top service combinations across service categories, sorted by default by the number of responses.
192
193The metrics available by service combination include: Responses, Average satisfaction score, Average Original Position, Average wait, Average serve duration, and Dropoff rate
194
195The service combinations data will only be meaningful if you allow your customers to select more than one service when registering, thereby creating service combinations. If your business does not allow multiple services, the data in this chart and table will be displayed on a per-service basis instead.`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=`${t.serviceCombinations}`,n=t.numSurveyAnswers,s=n.toLocaleString(),h=t.avgSurveyAnswerValue,S=hi,W=fi,M=jt(h-W,S-W);return{key:i,label:i,formattedValue:s,values:[{label:$localize`Responses`,value:n,formattedValue:s,color:P["csat-responses"]}],dataLabel:{label:$localize`Avg score`,value:h,valueAsPercentOfMax:M,formattedValue:h.toFixed(1),color:P["csat-avg-score"]}}})))}createDataMap(e){let t=we(e?.data);if(!e||t.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"serviceCombinations",label:$localize`Service`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],n=t.filter(s=>se(s.serviceCombinations)).sort(Ke("serviceCombinations")).sort((s,h)=>s.numSurveyAnswers<h.numSurveyAnswers?1:-1).map(s=>({serviceCombinations:s.serviceCombinations??$localize`(No service)`,numSurveyAnswers:s.numSurveyAnswers,avgSurveyAnswerValue:s.avgSurveyAnswerValue??0,avgVisitOriginalPosition:s.avgVisitOriginalPosition??0,avgVisitWaitDuration:s.avgVisitWaitDuration?this.durationService.transform(s.avgVisitWaitDuration):"-",avgVisitServeDuration:s.avgVisitServeDuration?this.durationService.transform(s.avgVisitServeDuration):"-",dropoffRatio:s.dropoffRatio>=0?`${Math.round(s.dropoffRatio*100).toFixed(0)}%`:"-"}));return{hasData:oe(n.map(s=>s.numSurveyAnswers))>0,legendItems:[{key:"responses",label:$localize`Responses`,color:P["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:P["csat-avg-score"]}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-csat-by-service"]],hostAttrs:[1,"ww-analytics-chart-csat-by-service"],standalone:!1,features:[B],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),_(7,ap,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),v((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[Q,Be,L],encapsulation:2,changeDetection:0})}}return a})();
195function op(a,u){if(a&1&&(d(0,"ww-metric-value",4),U(1),o(2,"number"),m()),a&2){f();let e=x(8),t=x(10),i=x(12);p("compare",t)("loading",i),l(),_e(le(2,3,e.avg,"1.0-1"))}}function rp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function sp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function lp(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,1),m())}var Kn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`The average satisfaction score of the responses`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),$()),this.compareData$=T([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.avg,response:t,previous:t?.data?.[0]?.avgSurveyAnswerValue,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),$())}createDataMap(e){return{avg:(Array.isArray(e?.data)?e?.data?.[0]:null)?.avgSurveyAnswerValue??0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-csat-metric-average"]],hostAttrs:[1,"ww-analytics-csat-metric-average"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Avg. satisfaction score`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),te(5,0),m(),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),R(12),o(13,"async"),_(14,op,3,6,"ww-metric-value",4)(15,rp,1,2,"ww-skeleton-placeholder",5),_(16,sp,1,2,"ww-skeleton-placeholder",5)(17,lp,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=N(r(9,6,i.currentData$));l(2);let h=N(r(11,9,i.compareData$));l(2);let S=N(r(13,12,i.compareLoading$));l(2),v(s&&!n?14:15),l(2),v(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function pp(a,u){if(a&1&&(d(0,"ww-metric-value",4),U(1),o(2,"number"),m()),a&2){f();let e=x(8),t=x(10),i=x(12);p("compare",t)("loading",i),l(),xe("",le(2,3,e.rate,"1.0-0"),"%")}}function mp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function dp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function up(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,1),m())}var Xn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`The percent of responses with written feedback divided by the number of responses`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),$()),this.compareData$=T([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>{let n=this.getResponseWithFeedback(t),s=this.getResponses(t),h=this.getRate(n,s);return ue({current:e.rate,response:t,previous:h,valueType:"percent",invertNegativeAndPositive:!0,rangeLabel:i})}),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),$())}createDataMap(e){let t=this.getResponseWithFeedback(e),i=this.getResponses(e);return{rate:this.getRate(t,i)}}getRate(e,t){return!e||!t?0:Math.round(e/t*100)}getResponseWithFeedback(e){return e?.data?.[0]?.numAnswersWithFeedback}getResponses(e){return e?.data?.[0]?.numSurveyAnswers}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-csat-metric-feedback-rate"]],hostAttrs:[1,"ww-analytics-csat-metric-feedback-rate"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Feedback rate`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),te(5,0),m(),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),R(12),o(13,"async"),_(14,pp,3,6,"ww-metric-value",4)(15,mp,1,2,"ww-skeleton-placeholder",5),_(16,dp,1,2,"ww-skeleton-placeholder",5)(17,up,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=N(r(9,6,i.currentData$));l(2);let h=N(r(11,9,i.compareData$));l(2);let S=N(r(13,12,i.compareLoading$));l(2),v(s&&!n?14:15),l(2),v(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();
195function fp(a,u){if(a&1&&(d(0,"ww-metric-value",4),U(1),o(2,"number"),m()),a&2){f();let e=x(8),t=x(10),i=x(12);p("compare",t)("loading",i),l(),_e(le(2,3,e.count,"1.0-0"))}}function yp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function Cp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function wp(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,1),m())}var Qn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`The number of responses with written feedback`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),$()),this.compareData$=T([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.count,response:t,previous:t?.data?.[0]?.numAnswersWithFeedback,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),$())}createDataMap(e){return{count:(Array.isArray(e?.data)?e?.data?.[0]:null)?.numAnswersWithFeedback??0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-csat-metric-response-feedback"]],hostAttrs:[1,"ww-analytics-csat-metric-response-feedback"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Responses with feedback`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),te(5,0),m(),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),R(12),o(13,"async"),_(14,fp,3,6,"ww-metric-value",4)(15,yp,1,2,"ww-skeleton-placeholder",5),_(16,Cp,1,2,"ww-skeleton-placeholder",5)(17,wp,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=N(r(9,6,i.currentData$));l(2);let h=N(r(11,9,i.compareData$));l(2);let S=N(r(13,12,i.compareLoading$));l(2),v(s&&!n?14:15),l(2),v(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function _p(a,u){if(a&1&&(d(0,"ww-metric-value",4),U(1),o(2,"number"),m()),a&2){f();let e=x(8),t=x(10),i=x(12);p("compare",t)("loading",i),l(),xe("",le(2,3,e.rate,"1.0-0"),"%")}}function vp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function Sp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function Ap(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,1),m())}var Zn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`The number of responses divided by the number of surveys sent`,this.currentData$=T([this.analyticsService.csatMetricsReportData$,this.analyticsService.csatMetricsSurveyData$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>k(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData||e.csatMetricsReportData),$()),this.compareData$=T([this.currentData$,this.analyticsService.compareCsatMetricsReportData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i,n])=>{let s=this.getRate(t,i);return ue({current:e.rate,response:t,previous:s,valueType:"percent",invertNegativeAndPositive:!0,rangeLabel:n})}),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),$())}createDataMap(e,t){return{rate:this.getRate(e,t)}}getRate(e,t){let i=Array.isArray(e?.data)?e?.data?.[0]:null,n=Array.isArray(t?.data)?t?.data?.[0]:null;if(!n||!i)return 0;let s=n.numAnswersWithFeedback??0,h=i.numSurveysSent??0;return s===0||h===0?0:Math.round(s/h*100)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-csat-metric-response-rate"]],hostAttrs:[1,"ww-analytics-csat-metric-response-rate"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Response rate`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),te(5,0),m(),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),R(12),o(13,"async"),_(14,_p,3,6,"ww-metric-value",4)(15,vp,1,2,"ww-skeleton-placeholder",5),_(16,Sp,1,2,"ww-skeleton-placeholder",5)(17,Ap,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=N(r(9,6,i.currentData$));l(2);let h=N(r(11,9,i.compareData$));l(2);let S=N(r(13,12,i.compareLoading$));l(2),v(s&&!n?14:15),l(2),v(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();
195function Tp(a,u){if(a&1&&(d(0,"ww-metric-value",4),U(1),o(2,"number"),m()),a&2){f();let e=x(8),t=x(10),i=x(12);p("compare",t)("loading",i),l(),_e(le(2,3,e.count,"1.0-0"))}}function Dp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function $p(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function Lp(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,1),m())}var Jn=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`The number of responses`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),$()),this.compareData$=T([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.count,response:t,previous:t?.data?.[0]?.numSurveyAnswers,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),$())}createDataMap(e){let t=Array.isArray(e?.data)?e?.data?.[0]:null;return t?{count:t.numSurveyAnswers??0}:{count:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-csat-metric-responses"]],hostAttrs:[1,"ww-analytics-csat-metric-responses"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Responses`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),d(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),te(5,0),m(),R(6),o(7,"async"),R(8),o(9,"async"),R(10),o(11,"async"),R(12),o(13,"async"),_(14,Tp,3,6,"ww-metric-value",4)(15,Dp,1,2,"ww-skeleton-placeholder",5),_(16,$p,1,2,"ww-skeleton-placeholder",5)(17,Lp,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=N(r(9,6,i.currentData$));l(2);let h=N(r(11,9,i.compareData$));l(2);let S=N(r(13,12,i.compareLoading$));l(2),v(s&&!n?14:15),l(2),v(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function Ds(a){return qe()(["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]).includes(a)}var xt={numVisits:$localize`All visits`,totalWaitlist:$localize`Waitlisted`,totalBookings:$localize`Bookings`,numServed:$localize`Served`,numDropoff:$localize`Dropoff`,avgWaitDuration:$localize`Avg wait duration`,avgServeDuration:$localize`Avg serve duration`,maxWaitDuration:$localize`Longest wait`,maxServeDuration:$localize`Longest serve duration`};var ii=(()=>{class a extends J{constructor(){super(...arguments),this.hash=null,this.hash$=this.observe("hash"),this.categoryName=null,this.categoryName$=this.observe("categoryName"),this.durationService=w(Me),this.columns$=zt(()=>this.categoryName$).pipe(c(e=>[{key:"name",label:e,sortable:!0},{key:"numVisits",label:xt.numVisits,sortable:!0},{key:"totalWaitlist",label:xt.totalWaitlist,sortable:!0},{key:"totalBookings",label:xt.totalBookings,sortable:!0},{key:"numServed",label:xt.numServed,sortable:!0},{key:"numDropoff",label:xt.numDropoff,sortable:!0},{key:"avgWaitDuration",label:xt.avgWaitDuration,sortable:!0},{key:"avgServeDuration",label:xt.avgServeDuration,sortable:!0},{key:"maxWaitDuration",label:xt.maxWaitDuration,sortable:!0},{key:"maxServeDuration",label:xt.maxServeDuration,sortable:!0}])),this.loading$=zt(()=>this.loadingSource$),this.dataMap$=T([this.fullscreen$,zt(()=>this.dataSource$),this.hash$,this.columns$,zt(()=>this.primaryMetric$)]).pipe(c(([e,t,i,n,s])=>this.createDataMap(e,t,i,n,s)),$((e,t)=>k(e,t)),I({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=this.categoryName$.pipe(c(e=>e??"")),this.bars$=this.dataMap$.pipe(c(e=>{let t=this.getFormatter(e.metric);return e.rows.map(i=>{let n=i.name??$localize`<No value>`,s=i[e.metric],h=t(s);return{key:i.name,label:n,formattedValue:h,values:[{label:n,value:s,formattedValue:t(s)}]}})})),this.hiddenRowCount$=this.dataMap$.pipe(c(e=>e.hiddenRowCount)),this.metrics=qe()(["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]),this.primaryMetricsF
195ormControl=new Ne("numVisits",{nonNullable:!0}),this.primaryMetric$=Ye(this.primaryMetricsFormControl),this.pluckMetricsLabel=e=>xt[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId})}onTitleClicked(){return mt(this,null,function*(){if(yield Ee(this.fullscreen$))return;let t=yield Ee(this.currentTab$),i=yield Ee(this.hash$);i?this.router.navigateByUrl(`account/analytics/${t}/${this.chartId}/${i}${window.location.search}`):this.router.navigateByUrl(`account/analytics/${t}/${this.chartId}${window.location.search}`)})}onChartClicked(){return mt(this,null,function*(){if((yield Ee(this.fullscreen$))||(yield Ee(this.breakpoints.isBelowMobile$)))return;let i=yield Ee(this.currentTab$),n=yield Ee(this.hash$);n?this.router.navigateByUrl(`account/analytics/${i}/${this.chartId}/${n}${window.location.search}`):this.router.navigateByUrl(`account/analytics/${i}/${this.chartId}${window.location.search}`)})}getFormatter(e){switch(e){case"avgWaitDuration":case"avgServeDuration":case"maxWaitDuration":case"maxServeDuration":return t=>t>0?this.durationService.transform(t):"-";default:return t=>`${typeof t=="number"?Math.ceil(t):t}`}}createDataMap(e,t,i,n,s){let h=(t?.data||[]).filter(C=>se(C[this.nameColumn])&&`${C[this.nameColumn]}`.length>0);if(!t||h.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:n,rows:[],hiddenRowCount:0,pluckCellLabel:()=>({}),metric:s};let W=(i!==null&&this.idColumn!==null?h.filter(C=>this.idColumn!==null&&C[this.idColumn]===i):h).map(C=>({name:C[this.nameColumn]??"",numVisits:C.numVisits??0,totalWaitlist:C.totalWaitlist??0,totalBookings:C.totalBookings??0,numServed:C.numServed?.total??0,numDropoff:C.numDropoff??0,avgWaitDuration:C.avgWaitDuration??0,avgServeDuration:C.avgServeDuration??0,maxWaitDuration:C.maxWaitDuration??0,maxServeDuration:C.maxServeDuration??0})).sort(Ke("name")).sort((C,O)=>O.numVisits-C.numVisits),M=e?W:W.slice(0,$i),V=W.length-M.length,y=M.map((C,O)=>({color:Vt(O),label:C.name,key:C.name}));return{hasData:M.length>0,hideLegend:!0,legendItems:y,dateRange:`${t.fromDate}-${t.toDate}`,columns:n,rows:M,hiddenRowCount:V,pluckCellLabel:C=>n.reduce((O,g)=>K(j({},O),{[g.key]:at({content:g.key==="avgWaitDuration"||g.key==="avgServeDuration"||g.key==="maxWaitDuration"||g.key==="maxServeDuration"?C[g.key]>0?this.durationService.transform(C[g.key]):"-":C[g.key],$element:{typography:"body1"}})}),{}),metric:s}}ngOnInit(){super.ngOnInit(),this.subscribe()}subscribe(){this.hash$.pipe(Ze(this.ngOnDestroy$)).subscribe(e=>{let t=e&&e.length>0?`${this.chartId}-${e}-metric`:`${this.chartId}-metric`;this.persistObservableInQueryString(this.primaryMetric$,t),this.primaryMetricsFormControl.setValue(this.analyticsService.getInitialFormControlValue(t,"numVisits",Ds),{emitEvent:!1})})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275dir=ci({type:a,inputs:{hash:"hash",categoryName:"categoryName"},features:[B]})}}return a})();function kp(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",u)("fullscreen",r(2,5,e.fullscreen$))}}var ga=(()=>{class a extends ii{constructor(){super(...arguments),this.chartId="operations-resources",this.type="resources",this.idColumn="resourceCategoryNameHashed",this.nameColumn="resourceName",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.resourcesReportData)),this.dataSource$=this.analyticsService.resourcesReportData$,this.tooltip$=b($localize`The Resource category bar charts show the top resources within the resource category ordered by the number of served visits. The bar represents the number of served visits and the dot represents the average serve duration.
196
197The Resource category table shows the top resources within the resource category ordered by the number of served visits. The metrics available by resource include: Waitlisted, Bookings, Served, No-shows, Cancelled.`),this.title$=T([this.dataSource$,this.hash$]).pipe(c(([e,t])=>{let i=we(e?.data).filter(n=>n.resourceCategoryNameHashed===t&&n.resourceCategoryName&&n.resourceCategoryName.length>0);return i.length<1?$localize`Unknown category`:i[0].resourceCategoryName})),this.categoryName$=b($localize`Resource`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-operations-resources"]],hostAttrs:[1,"ww-analytics-chart-operations-resources","ww-analytics-operations-table"],standalone:!1,features:[B],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,kp,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsF
197ormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Oe,Be,ge,L],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
198/*noopoperations-table-base-5234GOFA.css.map */
199`],encapsulation:2,changeDetection:0})}}return a})();function xp(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",u)("fullscreen",r(2,5,e.fullscreen$))}}var _a=(()=>{class a extends ii{constructor(){super(...arguments),this.chartId="operations-service-combinations",this.type="service-combinations",this.idColumn=null,this.nameColumn="serviceCombinations",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.serviceCombinationsReportData)),this.dataSource$=this.analyticsService.serviceCombinationsReportData$,this.title$=b($localize`Service combinations`),this.tooltip$=b($localize`The Service combinations bar charts show the top service combinations across service category ordered by the number of served visits. The bar represents the number of served visits and the dot represents the average serve duration.
200
201The Service combinations table shows the top service combinations across service category ordered by the number of served visits.
202
203The metrics available by service include: Waitlisted, Bookings, Served, No-shows, Cancelled.
204
205The service combinations data will only be meaningful if you allow your customers to select more than one service when registering, thereby creating service combinations. If your business does not allow multiple services, the data in this chart and table will be displayed on a per-service basis instead.`),this.categoryName$=b($localize`Service combination`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-operations-service-combinations"]],hostAttrs:[1,"ww-analytics-chart-operations-service-combinations","ww-analytics-operations-table"],standalone:!1,features:[B],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,xp,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Oe,Be,ge,L],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
206/*noopoperations-table-base-5234GOFA.css.map */
207`],encapsulation:2,changeDetection:0})}}return a})();function Ip(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",u)("fullscreen",r(2,5,e.fullscreen$))}}var va=(()=>{class a extends ii{constructor(){super(...arguments),this.chartId="operations-services",this.type="services",this.idColumn="serviceCategoryNameHashed",this.nameColumn="serviceName",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.servicesReportData)),this.dataSource$=this.analyticsService.servicesReportData$,this.tooltip$=b($localize`The Service category bar charts show the top services within the service category ordered by the number of served visits. The bar represents the number of served visits and the dot represents the average serve duration.
208
209The Service category table shows the top services within the service category ordered by the number of served visits. The metrics available by service include: Waitlisted, Bookings, Served, No-shows, Cancelled.`),this.title$=T([this.dataSource$,this.hash$]).pipe(c(([e,t])=>{let i=we(e?.data).filter(n=>n.serviceCategoryNameHashed===t&&n.serviceCategoryName&&n.serviceCategoryName.length>0);return i.length<1?$localize`Unknown category`:i[0].serviceCategoryName})),this.categoryName$=b($localize`Service`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-operations-services"]],hostAttrs:[1,"ww-analytics-chart-operations-services","ww-analytics-operations-table"],standalone:!1,features:[B],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,Ip,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsF
209ormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Oe,Be,ge,L],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
210/*noopoperations-table-base-5234GOFA.css.map */
211`],encapsulation:2,changeDetection:0})}}return a})();function Bp(a,u){if(a&1){let e=ae();d(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),E("chartClicked",function(){G(e);let i=f();return H(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return H(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",u)("fullscreen",r(2,5,e.fullscreen$))}}var Sa=(()=>{class a extends ii{constructor(){super(...arguments),this.chartId="operations-users",this.type="users",this.idColumn=null,this.nameColumn="updatedByName",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.usersReportData)),this.dataSource$=this.analyticsService.usersReportData$,this.title$=b($localize`Users`),this.tooltip$=b($localize`Shows the top users by visits served. Bars show served-visit counts; dots show average serve duration.
212
213The table lists the same users with metrics for Waitlisted, Bookings, Served, No-shows, and Cancelled.
214
215All metrics are attributed to the last user who touched the visit.`),this.categoryName$=b($localize`User`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart-operations-users"]],hostAttrs:[1,"ww-analytics-chart-operations-users","ww-analytics-operations-table"],standalone:!1,features:[B],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-chart-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(d(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),E("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),d(7,"ww-chart-layout-select")(8,"ww-select",1),E("click",function(s){return s.stopPropagation()}),m()(),_(9,Bp,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),v((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[Ae,be,Q,Fe,Oe,Be,ge,L],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
216/*noopoperations-table-base-5234GOFA.css.map */
217`],encapsulation:2,changeDetection:0})}}return a})();function Np(a,u){if(a&1&&(d(0,"ww-metric-value",5),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.bookings,"1.0-0"))}}function Op(a,u){a&1&&A(0,"ww-skeleton-placeholder",6)(1,"ww-skeleton-placeholder",6),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function Vp(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,1),o(2,"number"),m()),a&2){f();let e=x(5);l(2),yt(le(2,1,e==null?null:e.dropoffPercent,"1.0-0")),Ct(1)}}function Pp(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,2),m())}var eo=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Bookings: The number of parties that have scheduled appointments for the dates selected. If they were a booking that later turned into waitlisted, they are counted here (not under Waitlisted parties).\r\n\r\nBookings dropoff rate: The percentage of bookings that did not get served because they cancelled or were no-shows.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
217k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.bookings,response:t,previous:t?.data[0]?.totalBookings??0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;if(!t)return{bookings:0,dropoff:0,dropoffPercent:0};let i=t.totalBookings,n=t.numNoShowedByVisitType.booking+t.numNoShowedByVisitType.waitlistedBooking+t.numCancelledByVisitType.booking+t.numCancelledByVisitType.waitlistedBooking+t.numRemovedByVisitType.booking+t.numRemovedByVisitType.waitlistedBooking;return{bookings:i,dropoff:n,dropoffPercent:n>0&&i>0?Math.round(n/i*100):0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-bookings"]],hostAttrs:[1,"ww-analytics-overview-bookings"],standalone:!1,decls:11,vars:7,consts:()=>{let e;e=$localize`Bookings`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:% dropped off`;let i;return i=$localize`No dropoffs`,[e,t,i,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",3)(2,"ww-metric")(3,"ww-metric-title",4),te(4,0),m(),R(5),o(6,"async"),_(7,Np,5,10,"ww-metric-value",5)(8,Op,2,4),_(9,Vp,3,4,"ww-metric-summary")(10,Pp,2,0,"ww-metric-summary"),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(6,4,i.currentData$));l(2),v(n?7:8);let s=(n==null?null:n.dropoffPercent)??null;l(2),v(s&&s>0?9:10)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function Yp(a,u){if(a&1&&(d(0,"ww-metric-value",5),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),xe("",le(4,7,t.dropoffPercent,"1.0-0"),"%")}}function Up(a,u){a&1&&A(0,"ww-skeleton-placeholder",6)(1,"ww-skeleton-placeholder",6),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function Gp(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,1),o(2,"number"),m()),a&2){f(2);let e=x(5);l(2),yt(le(2,1,e==null?null:e.dropoff,"1.0-0")),Ct(1)}}function Hp(a,u){a&1&&(d(0,"ww-metric-summary"),te(1,2),m())}function jp(a,u){if(a&1&&_(0,Gp,3,4,"ww-metric-summary")(1,Hp,2,0,"ww-metric-summary"),a&2){f();let e=x(9);v(e>0?0:1)}}var to=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Dropoff rate: The percentage of registered visits that were cancelled, no-showed, removed (deleted).\r\n\r\nTotal dropoffs: The total number of registered visits that were cancelled, no-showed, or removed (deleted).\r\n\r\nRemoved visits will only show if "Hide deleted visits" is turned off in the analytics filters.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.dropoffPercent,response:t,previous:Math.round((t?.data[0]?.dropoffRatio??0)*100),valueType:"percent",invertNegativeAndPositive:!0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{dropoff:t.numDropoff,dropoffPercent:Math.round(t.dropoffRatio*100)}:{dropoff:0,dropoffPercent:0,noShows:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-dropoff"]],hostAttrs:[1,"ww-analytics-overview-dropoff"],standalone:!1,decls:11,vars:8,consts:()=>{let e;e=$localize`Dropoff rate`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: dropped off`;let i;return i=$localize`No dropoffs`,[e,t,i,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",3)(2,"ww-metric")(3,"ww-metric-title",4),te(4,0),m(),R(5),o(6,"async"),_(7,Yp,5,10,"ww-metric-value",5)(8,Up,2,4),R(9),_(10,jp,2,1),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(6,4,i.currentData$));l(2),v(n?7:8),l(2);let s=N((n==null?null:n.dropoffPercent)??null);l(),v(s!==null?10:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function Kp(a,u){if(a&1&&(d(0,"ww-metric-value",4),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.messages,"1.0-0"))}}function Xp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function Qp(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,1),o(2,"number"),m()),a&2){f();let e=x(5);l(2),yt(le(2,1,e.avgMessages,"1.0-1")),Ct(1)}}function Zp(a,u){a&1&&A(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",130)}var io=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Messages: The total number of sent and received customer messagess and users across all channels (email, sms, chat) regardless of delivered state.\r\n\r\nAvg messages per visit: The average number of messages sent and received by a single visit.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
217k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.messages,response:t,previous:t?.data[0]?.numMessages,withNeutralIndicator:!0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.numMessages,avgMessages:t.numVisits>0?Math.ceil(t.numMessages/t.numCreated):0}:{messages:0,avgMessages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-messages"]],hostAttrs:[1,"ww-analytics-overview-messages"],standalone:!1,decls:11,vars:7,consts:()=>{let e;e=$localize`Messages`;let t;return t=$localize`On avg ${"\uFFFD0\uFFFD"}:INTERPOLATION: message(s) per visit`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",2)(2,"ww-metric")(3,"ww-metric-title",3),te(4,0),m(),R(5),o(6,"async"),_(7,Kp,5,10,"ww-metric-value",4)(8,Xp,1,2,"ww-skeleton-placeholder",5),_(9,Qp,3,4,"ww-metric-summary")(10,Zp,1,2,"ww-skeleton-placeholder",5),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(6,4,i.currentData$));l(2),v(n?7:8),l(2),v(n?9:10)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();var $s={current:100,previous:99,valueType:"percent",negative:!1,positive:!0,percent:1,days:null,range:null,rangeLabel:null},Ls={current:99,previous:100,valueType:"percent",negative:!0,positive:!1,percent:1,days:null,range:null,rangeLabel:null};function em(a,u){a&1&&A(0,"ww-metric-compare",4),a&2&&p("loading",!1)("compare",u)}var ao=(()=>{class a extends _t{constructor(){super(...arguments),this.positive=!1,this.positive$=this.observe("positive"),this.compareData$=this.positive$.pipe(c(e=>e?$s:Ls))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-placeholder"]],hostAttrs:[1,"ww-analytics-overview-placeholder"],inputs:{positive:"positive"},standalone:!1,features:[B],decls:9,vars:10,consts:[[1,"gap-3",3,"padding"],[3,"height","width"],[1,"flex","flex-col","gap-1"],[1,"flex","gap-2"],[3,"loading","compare"]],template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",0),A(2,"ww-skeleton-placeholder",1),d(3,"div",2)(4,"div",3),A(5,"ww-skeleton-placeholder",1),_(6,em,1,2,"ww-metric-compare",4),o(7,"async"),m(),A(8,"ww-skeleton-placeholder",1),m()()()),t&2){let n;l(),p("padding","none"),l(),p("height",14)("width",73),l(3),p("height",20)("width",53),l(),v((n=r(7,8,i.compareData$))?6:-1,n),l(2),p("height",8)("width",53)}},dependencies:[Qa,me,pe,X,L],encapsulation:2,changeDetection:0})}}return a})();function im(a,u){if(a&1&&(d(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.served,"1.0-0"))}}function am(a,u){a&1&&A(0,"ww-skeleton-placeholder",4)(1,"ww-skeleton-placeholder",4),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function nm(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,0),o(2,"number"),m()),a&2){f();let e=x(6);l(2),yt(le(2,1,e==null?null:e.serveRatio,"1.0-0")),Ct(1)}}var no=(()=>{class a{constructor(){this.analyticsService=w(ne),this.locationRx=w(At),this.title$=this.locationRx.getCurrentLocation(["showPartySize"]).pipe(c(e=>e.showPartySize?$localize`Served parties`:$localize`Served`)),this.tooltip=$localize`Served parties: The total number of parties that were served in the time frame selected. This include bookings, waitlisted, and directly served parties.\r\n\r\nServe ratio: The percentage of visits that were served in the time range selected. While it is not common, this can be greater than 100% if enough of the served visits originally registered outside of the time window selected.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
217k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.served,response:t,previous:t?.data[0]?.numServed?.total,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return ai(t?.numServed?.total)||ai(t.serveRatio)?{served:0,serveRatio:0}:{served:t.numServed.total,serveRatio:Math.round(t.serveRatio*100)}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-served"]],hostAttrs:[1,"ww-analytics-overview-served"],standalone:!1,decls:11,vars:10,consts:()=>{let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:% of visits were served`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",1)(2,"ww-metric")(3,"ww-metric-title",2),U(4),o(5,"async"),m(),R(6),o(7,"async"),_(8,im,5,10,"ww-metric-value",3)(9,am,2,4),_(10,nm,3,4,"ww-metric-summary"),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(),_e(r(5,5,i.title$)),l(2);let n=N(r(7,7,i.currentData$));l(2),v(n?8:9),l(2),v((n==null?null:n.serveRatio)!==null?10:-1)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function rm(a,u){if(a&1&&(d(0,"ww-metric-value",4),o(1,"async"),o(2,"async"),U(3),o(4,"number"),m()),a&2){let e=f(),t=x(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),_e(le(4,7,t.waitlisted,"1.0-0"))}}function sm(a,u){a&1&&A(0,"ww-skeleton-placeholder",5)(1,"ww-skeleton-placeholder",5),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function lm(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,0),o(2,"number"),o(3,"number"),m()),a&2){f();let e=x(6);l(3),yt(le(2,2,e==null?null:e.totalIndividuals,"1.0-0"))(le(3,5,e==null?null:e.avgPartySize,"1.0-1")),Ct(1)}}function cm(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,1),o(2,"number"),m()),a&2){f();let e=x(6);l(2),yt(le(2,1,e==null?null:e.avgPartySize,"1.0-1")),Ct(1)}}var oo=(()=>{class a{constructor(){this.analyticsService=w(ne),this.locationRx=w(At),this.showPartySize$=this.locationRx.getCurrentLocation(["showPartySize","showPartySizeWaitlist"]).pipe(c(e=>e.showPartySize&&e.showPartySizeWaitlist)),this.title$=this.showPartySize$.pipe(c(e=>e?$localize`Waitlisted parties`:$localize`Waitlist`)),this.tooltip=$localize`Waitlisted parties: The number of parties that were placed on the waitlist for the dates selected. Waitlisted bookings are excluded from this number and instead counted under Bookings.\r\n\r\nTotal people: The number of people (not parties) that were placed on the waitlist for the dates selected. Waitlisted bookings are excluded from this number but counted under Bookings.\r\n\r\nAvg party size: The average party size for all visits within the dates selected.`,this.currentData$=T([this.analyticsService.reportData$,this.showPartySize$]).pipe(c(([e,t])=>this.createDataMap(e,t)),$((e,t)=>k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.waitlisted,response:t,previous:t?.data[0]?.totalWaitlist,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e,t){let i=Array.isArray(e?.data)?e?.data[0]:null;return i?{waitlisted:i.totalWaitlist,avgPartySize:i.avgPartySize,showPartySize:t,totalIndividuals:i.numIndividuals.waitlist}:{waitlisted:0,avgPartySize:1,showPartySize:t,totalIndividuals:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-waitlist"]],hostAttrs:[1,"ww-analytics-overview-waitlist"],standalone:!1,decls:12,vars:10,consts:()=>{let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: total people (avg. party size ${"\uFFFD1\uFFFD"}:INTERPOLATION_1:)`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: avg. party size`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",2)(2,"ww-metric")(3,"ww-metric-title",3),U(4),o(5,"async"),m(),R(6),o(7,"async"),_(8,rm,5,10,"ww-metric-value",4)(9,sm,2,4),_(10,lm,4,8,"ww-metric-summary")(11,cm,3,4,"ww-metric-summary"),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(),_e(r(5,5,i.title$)),l(2);let n=N(r(7,7,i.currentData$));l(2),v(n?8:9),l(2),v(n!=null&&n.showPartySize?10:11)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,ce],encapsulation:2,changeDetection:0})}}return a})();function mm(a,u){if(a&1&&(d(0,"ww-metric-value",4),o(1,"async"),o(2,"async"),U(3),o(4,"duration"),m()),a&2){let e=f(2),t=x(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),xe("",le(4,7,t.avgWaitDuration,"short")," ")}}function dm(a,u){a&1&&(d(0,"ww-metric-value"),U(1,"-"),m())}function um(a,u){if(a&1&&(d(0,"ww-metric-summary"),te(1,1),o(2,"duration"),m()),a&2){f(2);let e=x(5);l(2),yt(r(2,1,e.maxWaitDuration)),Ct(1)}}function hm(a,u){if(a&1&&(_(0,mm,5,10,"ww-metric-value",4)(1,dm,2,0,"ww-metric-value"),_(2,um,3,3,"ww-metric-summary")),a&2){f();let e=x(5);v((e.avgWaitDuration??-1)>=0?0:1),l(2),v((e.maxWaitDuration??-1)>=0?2:-1)}}function fm(a,u){a&1&&A(0,"ww-skeleton-placeholder",5)(1,"ww-skeleton-placeholder",5),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}var ro=(()=>{class a{constructor(){this.analyticsService=w(ne),this.tooltip=$localize`Avg wait times: The average amount of time the parties were in the waitlist before being moved to the serve list.\r\n\r\nLongest wait time: The longest a single party was in the waitlist before being moved to the serve list.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),$((e,t)=>
217k(e,t))),this.compareData$=T([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>ue({current:e.avgWaitDuration??null,response:t,previous:t?.data[0]?.avgWaitDuration??void 0,valueType:"duration",invertNegativeAndPositive:!0,rangeLabel:i})),$((e,t)=>k(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{avgWaitDuration:(t.avgWaitDuration??0)>0?t.avgWaitDuration:null,maxWaitDuration:(t.maxWaitDuration??0)>0?t.maxWaitDuration:null}:{avgWaitDuration:null,maxWaitDuration:null}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview-waittimes"]],hostAttrs:[1,"ww-analytics-overview-waittimes"],standalone:!1,decls:9,vars:6,consts:()=>{let e;e=$localize`Avg wait times`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: was the longest wait`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(d(0,"ww-section")(1,"ww-section-content",2)(2,"ww-metric")(3,"ww-metric-title",3),te(4,0),m(),R(5),o(6,"async"),_(7,hm,3,2)(8,fm,2,4),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=N(r(6,3,i.currentData$));l(2),v(n?7:8)}},dependencies:[Ce,Ue,fe,ye,me,pe,X,L,Xo],encapsulation:2,changeDetection:0})}}return a})();function Cm(a,u){if(a&1&&(d(0,"div",6)(1,"div",8)(2,"span",9),U(3,"\u2691"),m()(),A(4,"ww-skeleton-placeholder",4),m()),a&2){let e=u.$implicit;l(4),p("height",8)("width",e)}}var Aa=(()=>{class a{constructor(){this.breakpoints=w(ke),this.labelWidths=[60,30,50,100,70,40,110,25],this.trimLabelSegments$=T([this.breakpoints.isBelowMedium$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t])=>t?!1:e)),this.legendItems=[{color:Ft("aqua3"),label:$localize`First`},{color:Ft("aqua3"),label:$localize`Second`},{color:Ft("aqua3"),label:$localize`Third`},{color:Ft("aqua3"),label:$localize`Fourth`},{color:Ft("aqua3"),label:$localize`Fifth`},{color:Ft("aqua3"),label:$localize`Sixth`},{color:Ft("aqua3"),label:$localize`Seventh`}],this.series=[[100,0,140,NaN,NaN,NaN,40],[80,0,120,0,NaN,NaN,40],[60,0,100,0,0,0,NaN]],this.funnel={labels:[$localize`Segment`,$localize`Segment`,$localize`Segment`],subLabels:this.legendItems.map(e=>e.label),colors:this.legendItems.map(e=>e.color),values:this.series,maxHeight:150}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-placeholder-funnel"]],hostAttrs:[1,"ww-analytics-placeholder-funnel"],standalone:!1,decls:11,vars:10,consts:[["wwBackgroundColor","lighterGrey",1,"flex","flex-col","gap-1","px-6","py-4",3,"bordered"],[1,"flex","items-end","justify-between","max-w-full"],[1,"flex","flex-col","gap-1"],[1,"flex","gap-2"],[3,"height","width"],[1,"flex","flex-wrap","items-center","gap-x-2","h-8"],[1,"flex","gap-x-0.5"],["id","path-funnel-graph",3,"data","showLegend","trimLabelSegments"],["wwBackgroundColor","aqua2",1,"block","w-2","h-2"],["wwColor","aqua2",1,"hidden"]],template:function(t,i){t&1&&(d(0,"ww-card",0)(1,"div",1)(2,"div",2)(3,"div",3),A(4,"ww-skeleton-placeholder",4)(5,"ww-skeleton-placeholder",4),m(),d(6,"div",5),We(7,Cm,5,2,"div",6,It),m()()(),A(9,"ww-funnel",7),o(10,"async"),m()),t&2&&(p("bordered",!1),l(4),p("height",32)("width",72),l(),p("height",32)("width",107),l(2),Ie(i.labelWidths),l(2),p("data",i.funnel)("showLegend",!1)("trimLabelSegments",!!r(10,8,i.trimLabelSegments$)))},dependencies:[tn,dt,he,X,L],encapsulation:2,changeDetection:0})}}return a})();var ba=(()=>{class a{constructor(){this.data=Array.from({length:10}).map(()=>({a:Math.ceil(Math.random()*100)+40,b:Math.ceil(Math.random()*100)+30,c:Math.ceil(Math.random()*100)+50,d:Math.ceil(Math.random()*100)+70,e:Math.ceil(Math.random()*100)+20,f:Math.ceil(Math.random()*100)+30,g:Math.ceil(Math.random()*100)+40,h:Math.ceil(Math.random()*100)+50,k:Math.ceil(Math.random()*100)+40})),this.columns=[{key:"a",label:ve(X,{height:20,width:60})},{key:"b",label:ve(X,{height:20,width:60})},{key:"c",label:ve(X,{height:20,width:60})},{key:"d",label:ve(X,{height:20,width:60})},{key:"e",label:ve(X,{height:20,width:60})},{key:"f",label:ve(X,{height:20,width:60})},{key:"g",label:ve(X,{height:20,width:60})},{key:"h",label:ve(X,{height:20,width:60})},{key:"k",label:ve(X,{height:20,width:60})}],this.pluckCellLabel=e=>({a:ve(X,{height:14,width:e.a}),b:ve(X,{height:14,width:e.b}),c:ve(X,{height:14,width:e.c}),d:ve(X,{height:14,width:e.d}),e:ve(X,{height:14,width:e.e}),f:ve(X,{height:14,width:e.f}),g:ve(X,{height:14,width:e.g}
217),h:ve(X,{height:14,width:e.h}),k:ve(X,{height:14,width:e.k})})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-placeholder-table"]],hostAttrs:[1,"ww-analytics-placeholder-table"],standalone:!1,decls:7,vars:8,consts:[["wwBackgroundColor","lighterGrey",1,"flex","flex-col","gap-1",3,"bordered"],["wwBorderColor","mediumGrey",1,"flex","flex-col","gap-1","p-6","pt-4","border-b"],[1,"flex","gap-2"],[3,"height","width"],[1,"flex","flex-col","px-4"],["selection","none",3,"data","columns","pluckCellLabel"]],template:function(t,i){t&1&&(d(0,"ww-card",0)(1,"div",1)(2,"div",2),A(3,"ww-skeleton-placeholder",3)(4,"ww-skeleton-placeholder",3),m()(),d(5,"div",4),A(6,"ww-table",5),m()()),t&2&&(p("bordered",!1),l(3),p("height",24)("width",100),l(),p("height",24)("width",130),l(2),p("data",i.data)("columns",i.columns)("pluckCellLabel",i.pluckCellLabel))},dependencies:[dt,he,X,vt],styles:[`.ww-analytics-placeholder-table .ww-table .mat-mdc-row.mat-mdc-row,.ww-analytics-placeholder-table .ww-table .mat-mdc-header-row.mat-mdc-header-row{background-color:transparent}
218/*noopplaceholder-table.component-VGQBV7A4.css.map */
219`],encapsulation:2,changeDetection:0})}}return a})();function _m(a,u){if(a&1&&(d(0,"div",4)(1,"div",6)(2,"span",7),U(3,"\u2691"),m()(),A(4,"ww-skeleton-placeholder",2),m()),a&2){let e=u.$implicit;l(4),p("height",8)("width",e)}}var Ta=(()=>{class a{constructor(){this.labelWidths=[60,40,50,100],this.chart={data:{datasets:[]},options:ut(),type:"line"}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-placeholder-traffic"]],hostAttrs:[1,"ww-analytics-placeholder-traffic"],standalone:!1,decls:7,vars:6,consts:[["wwBackgroundColor","lighterGrey",1,"flex","flex-col","gap-1","px-6","py-4",3,"bordered"],[1,"flex","flex-col","gap-1"],[3,"height","width"],[1,"flex","gap-2","py-3"],[1,"flex","gap-x-0.5"],[3,"data","options","type"],["wwBackgroundColor","aqua2",1,"block","w-2","h-2"],["wwColor","aqua2",1,"hidden"]],template:function(t,i){t&1&&(d(0,"ww-card",0)(1,"div",1),A(2,"ww-skeleton-placeholder",2),d(3,"div",3),We(4,_m,5,2,"div",4,It),m()(),A(6,"ww-canvas-chart",5),m()),t&2&&(p("bordered",!1),l(2),p("height",32)("width",155),l(2),Ie(i.labelWidths),l(2),p("data",i.chart.data)("options",i.chart.options)("type","line"))},dependencies:[Ve,dt,he,X],encapsulation:2,changeDetection:0})}}return a})();var dn="analytics-source",un="analytics-location",hn="analytics-resources",fn="analytics-services",yn="analytics-deleted",Cn="analytics-labels",wn="analytics-type",gn="analytics-surveys",so={DRAFT:$localize`Draft`,BOOKING_FROM_WAITLIST:$localize`Booking from waitlist`,BOOKING:$localize`Booking`,WAITLIST:$localize`Waitlist`,WAITLISTED_BOOKING:$localize`Waitlisted booking`,DIRECT_SERVED:$localize`Direct served`,DIRECT_COMPLETED:$localize`Direct completed`,OTHER:$localize`Other`};var Rs=(()=>{class a{constructor(){this.dataOptions=w(Ga),this.maxNumberOfNamesInComponent=3}displayNames(e,t){if(e.length>this.maxNumberOfNamesInComponent){let i=e.slice(0,this.maxNumberOfNamesInComponent),n=t.filter(s=>i.includes(s.id)).map(s=>s.name).join(", ");return $localize`${n} + ${e.length-this.maxNumberOfNamesInComponent} more`}return t.filter(i=>e.includes(i.id)).map(i=>i.name).join(", ")}displayResourceNames(e){return at({$rx:{content:this.dataOptions.resources$.pipe(c(t=>this.displayNames(e,t)))}})}displayServiceNames(e){return at({$rx:{content:this.dataOptions.services$.pipe(c(t=>this.displayNames(e,t)))}})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Wt({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();function lo(a){return K(j({},a),{isCategory:ai(a.parentId)})}var Sm=rr(or),co=(()=>{class a extends Sm{constructor(){super(...arguments),this.changeDetectorRef=w(xo),this.selection="single",this.fields$=this.observe("fields").pipe(this.shareReplay()),this.formControl=new Ne([],{nonNullable:!0}),this.fieldsByNameHashed$=this.fields$.pipe(c(e=>e.reduce((t,i)=>{let n=t.find(s=>s.nameHashed===i.nameHashed);if(n)n.fieldIds.push(i.id);else if(i.isCategory)t.push({name:i.name,nameHashed:i.nameHashed,fieldIds:[i.id]});else{let s=e.find(h=>h.id===i.parentId);t.push({name:i.name,nameHashed:i.nameHashed,fieldIds:[i.id],parentId:s?.id,parentNameHashed:s?.nameHashed})}return t},[])),this.shareReplay()),this.recordByNameHashed$=this.fieldsByNameHashed$.pipe(c(e=>Vo(e,t=>t.nameHashed)),this.shareReplay()),this.data$=this.fieldsByNameHashed$.pipe(c(e=>e.map(t=>t.nameHashed))),this.isLoading$=this.data$.pipe(c(()=>!1),Wi(!0),$(),this.shareReplay()),this.pluckParent$=this.recordByNameHashed$.pipe(c(e=>t=>e[t]?.parentNameHashed)),this.pluckTrigger$=this.recordByNameHashed$.pipe(c(e=>t=>{let i=e[t];return i?i.fieldIds.length>1?`${i.name} (${i.fieldIds.length})`:i.name:$localize`Unknown`})),this.pluckLabel$=this.recordByNameHashed$.pipe(c(e=>t=>{let i=e[t];return i?i.fieldIds.length>1?`${i.name} (${i.fieldIds.length})`:i.name:$localize`Unknown`})),this.pluckSearchLabel$=this.recordByNameHashed$.pipe(c(e=>t=>e[t]?.name??"")),this.viewValue$=T([this.fieldsByNameHashed$,this.formControl.valueChanges]).pipe(Qe(()=>this.formControl.dirty),c(([e,t])=>e.filter(n=>t.includes(n.nameHashed)).flatMap(n=>n.fieldIds)))}writeValue(e){return mt(this,null,function*(){let t=we(e);if(t.length>0){let n=(yield Ee(this.fields$)).filter(h=>t.includes(h.id)),s=it(n.map(h=>h.nameHashed));this.formControl.setValue(s,{emitEvent:!1})}else this.formControl.setValue([],{emitEvent:!1});this.changeDetectorRef.markForCheck()})}registerOnChange(e){this.viewValue$.pipe(Ze(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?this.formControl.disable():this.formControl.enable()}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-field-select"]],hostAttrs:[1,"ww-analytics-field-select"],inputs:{ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoF
219ocus:"autoFocus",hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",layout:"layout",appearance:"appearance",selection:"selection",fields:"fields"},features:[B],decls:7,vars:26,consts:[[3,"label","sublabel","layout","placeholder","appearance","loading","pluckLabel","pluckParent","pluckSearchLabel","pluckTrigger","data","formControl","selection","searchable"]],template:function(t,i){t&1&&(A(0,"ww-select",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async")),t&2&&p("label",i.label)("sublabel",i.sublabel)("layout",i.layout)("placeholder",i.placeholder)("appearance",i.appearance)("loading",r(1,14,i.isLoading$))("pluckLabel",r(2,16,i.pluckLabel$))("pluckParent",r(3,18,i.pluckParent$))("pluckSearchLabel",r(4,20,i.pluckSearchLabel$))("pluckTrigger",r(5,22,i.pluckTrigger$))("data",r(6,24,i.data$))("formControl",i.formControl)("selection",i.selection)("searchable",!0)},dependencies:[Ia,Ae,be,an,Pa,ge,L],encapsulation:2,changeDetection:0})}}return a})();var ks=(()=>{class a{constructor(){this.accountRx=w(St),this.analyticsFilterDisplay=w(Rs),this.commonDisplay=w(Gr),this.dataOptions=w(Ga),this.eventLogger=w(Ha),this.labelRx=w(Ai),this.permissionRx=w(Ua),this.defaultLocationFilter=jr(un,this.commonDisplay),this.hasSurveyPermissions$=T([this.accountRx.hasAccountFeature
219("enableSurveys"),this.permissionRx.hasPermission("surveys.show")]).pipe(c(([e,t])=>e&&t),$(),I({refCount:!0,bufferSize:1})),this.resources$=this.dataOptions.resources$.pipe(c(e=>e.map(lo)),I({refCount:!0,bufferSize:1})),this.services$=this.dataOptions.services$.pipe(c(e=>e.map(lo)),I({refCount:!0,bufferSize:1})),this.locationsFilter=K(j({},this.defaultLocationFilter),{component:ve(this.defaultLocationFilter.component,{$hooks:{onCreate:e=>e.instance._viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"locations"}}))}}),toQueryArgs:void 0}),this.visitSourcesFilter={id:Xt("visit-source"),name:$localize`Source`,categoryId:dn,pluckLabel:e=>e.map(t=>Na[t]).join(", "),stringify:e=>e.join(","),parse:e=>e.split(",").filter(kr),component:ve(ge,{selection:"multiple",label:$localize`Visit source`,placeholder:$localize`Any`,data:Object.keys(Na),pluckLabel:e=>Na[e],$hooks:{onCreate:e=>e.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"visit-source"}}))}})},this.deletedVisitsFilter={id:Xt("visit-include-deleted"),name:$localize`Include deleted visits`,categoryId:yn,stringify:e=>e.toString(),parse:e=>e?.toLocaleLowerCase()==="true",pluckLabel:e=>e?$localize`Include deleted visits`:$localize`Exclude deleted visits`,component:ve(Sr,{label:$localize`Include deleted visits`,$hooks:{onCreate:e=>e.instance.checked$.pipe(La(1)).subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"visit-include-deleted"}}))}})},this.resourcesFilter$=this.resources$.pipe(c(e=>({id:Xt("resources"),name:$localize`Resources`,categoryId:hn,stringify:t=>{let i=e.filter(s=>t.includes(s.id)).map(s=>s.nameHashed);return Array.from(new Set(i)).join(",")},parse:t=>{let i=t.split(",").filter(Lt);return e.filter(h=>i.includes(h.nameHashed)).map(h=>h.id)},pluckLabel:t=>this.analyticsFilterDisplay.displayResourceNames(t),component:ve(co,{selection:"multiple",label:$localize`Resources`,placeholder:$localize`Any`,fields:e,$hooks:{onCreate:t=>t.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"resources"}}))}})}))),this.servicesFilter$=this.services$.pipe(c(e=>({id:Xt("services"),name:$localize`Services`,categoryId:fn,stringify:t=>{let i=e.filter(s=>t.includes(s.id)).map(s=>s.nameHashed);return Array.from(new Set(i)).join(",")},parse:t=>{let i=t.split(",").filter(Lt);return e.filter(h=>i.includes(h.nameHashed)).map(h=>h.id)},pluckLabel:t=>this.analyticsFilterDisplay.displayServiceNames(t),component:ve(co,{selection:"multiple",label:$localize`Services`,placeholder:$localize`Any`,fields:e,$hooks:{onCreate:t=>t.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"services"}}))}})}))),this.visitTypeFilter={id:Xt("visit-type"),name:$localize`Visit Type`,categoryId:wn,stringify:e=>e.join(","),parse:e=>e.split(",").filter(br),pluckLabel:e=>e.map(t=>so[t]).join(", "),component:ve(ge,{selection:"multiple",label:$localize`Visit type`,placeholder:$localize`Any`,data:nr,pluckLabel:e=>so[e],$hooks:{onCreate:e=>e.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"visit-type"}}))}})},this.labelFilters$=this.labelRx.labelGroups$.pipe(c(e=>e.map(t=>{let i=t.name.toLocaleLowerCase();return{id:Xt("label-"+i),name:t.name,categoryId:Cn+"-"+i,stringify:n=>n.join(","),parse:n=>n.split(",").filter(Lt),pluckLabel:n=>n.join(", "),component:ve(ge,{selection:"multiple",label:t.name,placeholder:$localize`Any`,data:t.values,$hooks:{onCreate:n=>n.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"label"}}))}})}}))),this.surveysFilters$=this.hasSurveyPermissions$.pipe(c(e=>e?[{id:Xt("surveys"),name:$localize`Surveys`,categoryId:gn,pluckLabel:t=>t.map(En).join(", "),stringify:t=>t.join(","),parse:t=>t.split(",").filter(Rr),component:ve(ge,{selection:"multiple",label:$localize`Surveys`,placeholder:$localize`All`,data:Zo,pluckLabel:En,$hooks:{onCreate:t=>t.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"surveys"}}))}})}]:[]))}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Wt({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var ki=(()=>{class a extends Hr{constructor(){let e=w(To);super(e),this.analyticsFilterComponents=w(ks),this.filters$=T([this.analyticsFilterComponents.labelFilters$,this.analyticsFilterComponents.resourcesFilter$,this.analyticsFilterComponents.servicesFilter$,this.analyticsFilterComponents.surveysFilters$]).pipe(c(([t,i,n,s])=>[this.analyticsFilterComponents.locationsFilter,this.analyticsFilterComponents.visitSourcesFilter,this.analyticsFilterComponents.visitTypeFilter,i,n,...t,...s,this.analyticsFilterComponents.deletedVisitsFilter])),this.filterValues$=this.state$.pipe(xi(es),c(t=>t.reduce((i,n)=>{if(n.source.categoryId.startsWith(Cn))i=K(j({},i),{labels:K(j({},i.labels),{[n.source.name]:n.value})});else switch(n.source.categoryId){case yn:i=K(j({},i),{includeDeleted:!!n.value});break;case un:i=K(j({},i),{locationIds:n.value});break;case dn:i=K(j({},i),{source:n.value});break;case fn:i=K(j({},i),{serviceId:[...i.serviceId??[],...n.value]});break;case hn:i=K(j({},i),{resourceId:[...i.resourceId??[],...n.value]});break;case wn:i=K(j({},i),{visitType:n.value});break;case gn:i=K(j({},i),{presetSurveyIds:n.value});break}return i},{})),I({refCount:!0,bufferSize:1})),this.injector=e}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Wt({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var Es={compareCsatMetricsReportData:!1,compareCsatMetricsSurveyData:!1,compareReportData:!1,compareReportDataForLocations:!1,csatAnswersData:!1,csatByLocationData:!1,csatByResourceData:!1,csatByServiceData:!1,csatDimensionsData:!1,csatMetricsReportData:!1,csatMetricsSurveyData:!1,csatResponseTrendData:!1,dayOfReport:!1,dayOfReportResources:!1,dayOfReportServices:!1,distributionsData:!1,reportData:!1,reportDataByCreatorSource:!1,reportDataByDate:!1,reportDataByDayOfWeek:!1,reportDataByLocation:!1,reportDataByMonth:!1,reportDataByResourceService:!1,reportDataByWeek:!1,reportDataForDataFields:!1,reportDataForFinancialsLocations:!1,reportDataForFinancialsServices:!1,reportDataForFinancialsValue:!1,reportDataForLabels:!1,reportDataForLocations:!1,reportDataForMessageDetails:!1,resourcesReportData:!1,serviceCombinationsReportData:!1,servicesReportData:!1,usersReportData:!1},ne=(()=>{class a{constructor(){this.accountRx=w(St),this.analyticsRx=w(Er),this.coreDataFieldRx=w(Br),this.coreResourceRx=w(Fr),this.coreServiceRx=w(Nr),this.coreSurveyRx=w(Or),this.filterStore=w(ki),this.labelRx=w(Ai),this.localeService=w(tr),this.locationRx=w(At),this.permissionRx=w(Ua),this.queryParams=w(Go),this.dateRangeSub=new De(null),this.dateRange$=this.dateRangeSub.asObservable(),this.compareDateRangeSub=new De(null),this.compareDateRange$=this.compareDateRangeSub.asObservable(),this.creatorSourceDimensionSub=new De("agent"),this.creatorSourceDimension$=this.creatorSourceDimensionSub.asObservable(),this.resourceServiceDimensionSub=new De("resourceName"),this.resourceServiceDimension$=this.resourceServiceDimensionSub.asObservable(),this.financialsValueCostsDimensionSub=new De(["date"]),this.financialsValueCostsDimension$=this.financialsValueCostsDimensionSub.asObservable(),this.messageDetailsMetricsSub=new De(mn.channels),this.messageDetailsMetrics$=this.messageDetailsMetricsSub.asObservable(),this.defaultFormControlValues={},this.labelGroupSub=new De(null),this.labelGroup$=this.labelGroupSub.asObservable(),this.weekdayStartSub=new De(null),this.weekdayStart$=this.weekdayStartSub.asObservable(),this.loadingStateSub=new De(Es),this.loadingState$=this.loadingStateSub.asObservable(),this.hoursOfDay=[...Array(24).keys()],this.loading$=this.loadingState$.pipe(c(e=>Object.values(K(j({},e),{dayOfReport:!1,dayOfReportResources:!1,dayOfReportServices:!1,compareReportData:!1})).some(t=>t===!0))),this.compareLoading$=this.loadingState$.pipe(c(e=>e.compareReportData)),this.dayOfReportLoading$=this.loadingState$.pipe(c(e=>Object.values({dayOfReport:e.dayOfReport,dayOfReportResources:e.dayOfReportResources,dayOfReportServices:e.dayOfReportServices}).some(t=>t===!0))),this.hasDataFields$=this.coreDataFieldRx.collection(za(Ya,{limit:[1]})).pipe(c(e=>e.length>0),I({refCount:!0,bufferSize:1})),this.hasResources$=this.coreResourceRx.collection(za(Ya,{limit:[1]})).pipe(c(e=>e.length>0),I({refCount:!0,bufferSize:1})),this.hasServices$=this.coreServiceRx.collection(za(Ya,{limit:[1]})).pipe(c(e=>e.length>0),I({refCount:!0,bufferSize:1})),this.hasSurveyPermissions$=T([this.accountRx.hasAccountFeature
219("enableSurveys"),this.permissionRx.hasPermission("surveys.show")]).pipe(c(([e,t])=>e&&t),$(),I({refCount:!0,bufferSize:1})),this.reportingGroupKeyAndValue$=T([this.filterStore.filterValues$,this.accountRx.getAccount(["id"]).pipe(c(e=>e.id)),this.locationRx.locationId$]).pipe(c(([e,t,i])=>{let n=e.locationIds?"locationId":"accountId",s=e.locationIds?e.locationIds:[i],h=e.locationIds?s:[t];return{key:n,value:h}})),this.minFromDateForAccount$=this.accountRx.getAccount(["features"]).pipe(c(e=>e.features?.maxAnalyticsHistoricalDays&&e.features.maxAnalyticsHistoricalDays>0?Mt(Fa(),e.features.maxAnalyticsHistoricalDays):new Date(2020,0,1))),this.selectedPresetSurveyId$=this.filterStore.filterValues$.pipe(c(e=>e.presetSurveyIds??[]),$((e,t)=>k(e,t)),I({refCount:!0,bufferSize:1})),this.surveys$=this.coreSurveyRx.collection().pipe($((e,t)=>k(e,t)),I({refCount:!0,bufferSize:1})),this.selectedSurveyIds$=this.selectedPresetSurveyId$.pipe(ie(e=>e.length===0?b(null):this.surveys$.pipe(c(t=>t.filter(i=>e.includes(i.presetSurveyId??Ar)).map(i=>i.id)))),$((e,t)=>k(e,t)),I({refCount:!0,bufferSize:1})),this.surveyIdsFilter$=this.selectedSurveyIds$.pipe(c(e=>e===null?null:e.length===0?{key:"surveyId",operator:"in",value:["NotSomeValidSurveyId"]}:{key:"surveyId",operator:"in",value:e}),$((e,t)=>k(e,t)),I({refCount:!0,bufferSize:1})),this.surveyQuestionIdsFilter$=this.selectedPresetSurveyId$.pipe(c(e=>{let t=e.length===0?Object.values(kn):e.map(i=>kn[i]);return{key:"surveyQuestionId",operator:"in",value:[Rn,...t]}}),$((e,t)=>k(e,t)),I({refCount:!0,bufferSize:1})),this.distributionsData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("distributionsData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getDistributionsData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("distributionsData",!1),I({refCount:!0,bufferSize:1})),this.reportData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportData",!1),I({refCount:!0,bufferSize:1})),this.reportDataByDate$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataByDate",!0),ie(([e,t,i])=>{if(!de(e))return b(null);let n=e.id===gi.id||e.id===_i.id,s=e.start,h=n?new Date:void 0;return this.analyticsRx.getReportDataByDate(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),Ln,!0,s,h)}),this.updateLoadingState("reportDataByDate",!1),I({refCount:!0,bufferSize:1})),this.reportDataByWeek$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.weekdayStart$]).pipe(this.updateLoadingState("reportDataByWeek",!0),ie(([e,t,i,n])=>de(e)?this.analyticsRx.getReportDataByWeek(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),Ln,n??void 0):b(null)),this.updateLoadingState("reportDataByWeek",!1),I({refCount:!0,bufferSize:1})),this.reportDataByMonth$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataByMonth",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportDataByMonth(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportDataByMonth",!1),I({refCount:!0,bufferSize:1})),this.reportDataByDayOfWeek$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.weekdayStart$]).pipe(this.updateLoadingState("reportDataByDayOfWeek",!0),ie(([e,t,i,n])=>de(e)?this.analyticsRx.getReportDataByDayOfWeek(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),n??void 0):b(null)),this.updateLoadingState("reportDataByDayOfWeek",!1),I({refCount:!0,bufferSize:1})),this.reportDataBySource$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataByCreatorSource",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportDataBySource(e.start,e.end,i.key,i.value,["agent","source"],this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportDataByCreatorSource",!1),I({refCount:!0,bufferSize:1})),this.reportDataByResourceService$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.resourceServiceDimension$]).pipe(this.updateLoadingState("reportDataByResourceService",!0),ie(([e,t,i,n])=>de(e)?this.analyticsRx.getReportDataBySource(e.start,e.end,i.key,i.value,n,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportDataByResourceService",!1),I({refCount:!0,bufferSize:1})),this.reportDataForLabels$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.labelRx.labelGroups$]).pipe(this.updateLoadingState("reportDataForLabels",!0),ie(([e,t,i,n])=>de(e)?T(n.map(s=>this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),s?[`label:${s.name}`]:[]))):b(null)),this.updateLoadingState("reportDataForLabels",!1),I({refCount:!0,bufferSize:1})),this.reportDataForDataFields$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForDataFields",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["dataFieldName","dataFieldNameHashed","dataFieldValues","dataFieldType"],["numRegistrations","numIndividuals","numVisits","totalWaitlist","totalBookings","numServed","numCompleted","numDropoff","numNoShowedByVisitType","numCancelledByVisitType","numRemovedByVisitType","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("reportDataForDataFields",!1),I({refCount:!0,bufferSize:1})),this.reportDataForFinancialsLocations$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForFinancialsLocations",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["locationId","locationName","orderValueCurrency"],["numVisits","orderValue"]):b(null)),this.updateLoadingState("reportDataForFinancialsLocations",!1),I({refCount:!0,bufferSize:1})),this.reportDataForFinancialsServices$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForFinancialsServices",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["serviceCategoryName","serviceCategoryNameHashed","serviceName","orderValueCurrency"],["orderValue"]):b(null)),this.updateLoadingState("reportDataForFinancialsServices",!1),I({refCount:!0,bufferSize:1})),this.reportDataForFinancialsValue$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.financialsValueCostsDimension$,this.weekdayStart$]).pipe(this.updateLoadingState("reportDataForFinancialsValue",!0),ie(([e,t,i,n,s])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[...n,"orderValueCurrency"],["orderValue"],s??void 0):b(null)),this.updateLoadingState("reportDataForFinancialsValue",!1),I({refCount:!0,bufferSize:1})),this.reportDataForLocations$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForLocations",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["locationId","locationName"],["numRegistrations","numIndividuals","numVisits","totalWaitlist","totalBookings","numServed","numCompleted","numDropoff","numNoShowedByVisitType","numCancelledByVisitType","numRemovedByVisitType","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("reportDataForLocations",!1),I({refCount:!0,bufferSize:1})),this.reportDataForMessageDetails$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.messageDetailsMetrics$]).pipe(this.updateLoadingState("reportDataForMessageDetails",!0),ie(([e,t,i,n])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[],n):b(null)),this.updateLoadingState("reportDataForMessageDetails",!1),I({refCount:!0,bufferSize:1})),this.usersReportData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("usersReportData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["updatedBy","updatedByName"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("usersReportData",!1),I({refCount:!0,bufferSize:1})),this.resourcesReportData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("resourcesReportData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["resourceCategoryName","resourceCategoryNameHashed","resourceName"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("resourcesReportData",!1),I({refCount:!0,bufferSize:1})),this.servicesReportData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("servicesReportData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["serviceCategoryName","serviceCategoryNameHashed","serviceName"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("servicesReportData",!1),I({refCount:!0,bufferSize:1})),this.serviceCombinationsReportData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("serviceCombinationsReportData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["serviceCombinations"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("serviceCombinationsReportData",!1),I({refCount:!0,bufferSize:1})),this.csatDimensionsData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatDimensionsData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["surveyAnswerValues"],[...this.toAnalyticsReportFilters(t,!1,!0,!0),{key:"surveyQuestionId",operator:"=",value:Rn}],["numSurveyAnswers","avgVisitOriginalPosition","avgVisitWaitDuration","avgVisitServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatDimensionsData",!1),I({refCount:!0,bufferSize:1})),this.csatByLocationData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatByLocationData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["locationName"],this.toAnalyticsReportFilters(t,!1,!0,!0),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatByLocationData",!1),I({refCount:!0,bufferSize:1})),this.csatByResourceData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatByResourceData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["resourceCombinations"],this.toAnalyticsReportFilters(t,!1,!0,!0),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatByResourceData",!1),I({refCount:!0,bufferSize:1})),this.csatByServiceData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatByServiceData",!0),ie(([e,t,i])=>de(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["serviceCombinations"],this.toAnalyticsReportFilters(t,!1,!0,!0),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatByServiceData",!1),I({refCount:!0,bufferSize:1})),this.csatResponseTrendData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatResponseTrendData",!0),ie(([e,t,i])=>{if(!de(e))return b(null);let n=[],s=bn(e.end,e.start);return s<=31?n.push("surveyAnswerDate"):s<=180?n.push("weekStarting"):n.push("month"),this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,n,this.toAnalyticsReportFilters(t,!1,!0,!0),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"])}),this.updateLoadingState("csatResponseTrendData",!1),I({refCount:!0,bufferSize:1})),this.csatMetricsReportData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.surveyIdsFilter$]).pipe(this.updateLoadingState("csatMetricsReportData",!0),ie(([e,t,i,n])=>de(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,[...this.toAnalyticsReportFilters(t),n].filter(s=>s!==null),[],["numVisits","numSurveysSent"]):b(null)),this.updateLoadingState("csatMetricsReportData",!1),I({refCount:!0,bufferSize:1})),this.csatMetricsSurveyData$=T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.surveyQuestionIdsFilter$]).pipe(this.updateLoadingState("csatMetricsSurveyData",!0),ie(([e,t,i,n])=>de(e)?this.analyticsRx.getAnalyticsCsatMetrics(e.start,e.end,i.key,i.value,[...this.toAnalyticsReportFilters(t,!1,!0,!0),n]):b(null)),this.updateLoadingState("csatMetricsSurveyData",!1),I({refCount:!0,bufferSize:1})),this.compareDateRangeLabel$=this.dateRange$.pipe(c(e=>de(e)&&e.id?ns[e.id]??null:null),$(),I({refCount:!0,bufferSize:1})),this.compareReportData$=T([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$]).pipe(this.updateLoadingState("compareReportData",!0),ie(([e,t,i,n])=>de(e)&&Fi(e.start,n)===1?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[],er):b(null)),this.updateLoadingState("compareReportData",!1),I({refCount:!0,bufferSize:1})),this.compareReportDataForLocations$=T([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$]).pipe(this.updateLoadingState("compareReportDataForLocations",!0),ie(([e,t,i,n])=>de(e)&&Fi(e.start,n)===1?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["locationId","locationName"],["numRegistrations","numIndividuals","numVisits","totalWaitlist","totalBookings","numServed","numCompleted","numDropoff","numNoShowedByVisitType","numCancelledByVisitType","numRemovedByVisitType","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("compareReportDataForLocations",!1),I({refCount:!0,bufferSize:1})),this.compareCsatMetricsReportData$=T([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$,this.surveyIdsFilter$]).pipe(this.updateLoadingState("compareCsatMetricsReportData",!0),ie(([e,t,i,n,s])=>de(e)&&Fi(e.start,n)===1?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,[...this.toAnalyticsReportFilters(t),s].filter(h=>h!==null),[],["numVisits"]):b(null)),this.updateLoadingState("compareCsatMetricsReportData",!1),I({refCount:!0,bufferSize:1})),this.compareCsatMetricsSu
219rveyData$=T([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$,this.surveyQuestionIdsFilter$]).pipe(this.updateLoadingState("compareCsatMetricsSurveyData",!0),ie(([e,t,i,n,s])=>de(e)&&Fi(e.start,n)===1?this.analyticsRx.getAnalyticsCsatMetrics(e.start,e.end,i.key,i.value,[...this.toAnalyticsReportFilters(t,!1,!0,!0),s]):b(null)),this.updateLoadingState("compareCsatMetricsSurveyData",!1),I({refCount:!0,bufferSize:1})),this.subscribeToLocationChanges(),this.subscribeToLocaleChanges()}setLoadingState(e,t){this.loadingStateSub.next(K(j({},this.loadingStateSub.value),{[e]:t}))}setDateRange(e){this.dateRangeSub.next(e),this.compareDateRangeSub.next(this.getCompareDateRange(e))}setLabelGroup(e){this.labelGroupSub.next(e)}setCreatorSourceDimension(e){this.creatorSourceDimensionSub.next(e)}setResourceServiceLocationDimension(e){this.resourceServiceDimensionSub.next(e)}setFinancialsValueCostsDimension(e){e==="dayOfWeekNumber"?this.financialsValueCostsDimensionSub.next(["dayOfWeekNumber","dayOfWeek"]):this.financialsValueCostsDimensionSub.next([e])}setMessageDetailsMetrics(e){this.messageDetailsMetricsSub.next(e)}setWeekdayStart(e){this.weekdayStartSub.next(e)}getCsatAnswers(e,t){return T([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatAnswersData",ai(t)),ie(([i,n,s])=>de(i)?this.analyticsRx.getCsatAnswers(i.start,i.end,s.key,s.value,this.toAnalyticsReportFilters(n,!1,!0,!0),e,t):b(null)),this.updateLoadingState("csatAnswersData",!1),I({refCount:!0,bufferSize:1}))}getInitialFormControlValue(e,t,i){return this.defaultFormControlValues[e]=t,this.queryParams.get(e,t,i)}persistFormControlValue(e,t){if(this.defaultFormControlValues[e]===t){this.queryParams.update({remove:[e]});return}this.queryParams.set(e,t,{navigation:"replace",disableEmitEvent:!0})}createCsvData(e,t,i){let s=e.join(",")+`
220`,h=i.map(S=>t.map(W=>this.convertValueToCsvCompatibleValue(S[W])).join(",")).join(`
221`);return s+h}updateLoadingState(e,t){return i=>i.pipe(Ra(()=>this.setLoadingState(e,t)),$a(()=>this.setLoadingState(e,!1)))}convertValueToCsvCompatibleValue(e){if(e==null)return"";if(e instanceof Date)return e.toLocaleString();let t=e.toString().replace(/"/g,'""');return t.search(/("|,|\n)/g)>=0?`"${t}"`:t}subscribeToLocationChanges(){this.locationRx.nullableLocationId$.pipe(Ao()).subscribe(([e,t])=>{e!==t&&this.loadingStateSub.next(Es)})}subscribeToLocaleChanges(){this.localeService.locale$.subscribe(e=>{let t=os(e),i=is[t];this.weekdayStartSub.next(i)})}getCompareDateRange(e){if(!de(e))return null;let t=bn(e.end,e.start);switch(e.id){case Ni.id:return{start:Mt(e.start,1),end:Mt(e.end,1)};case ni.id:return{start:Mt(e.start,8),end:Mt(e.end,8)};case Vi.id:case Oi.id:return{start:Dn(e.start,1),end:Dn(e.end,1)};case zi.id:case Pi.id:return{start:Tn(e.start,1),end:Tn(e.end,1)};case _i.id:case Yi.id:return{start:$n(e.start,1),end:$n(e.end,1)};default:return{start:Mt(e.start,t+1),end:Mt(e.end,t+1)}}}toAnalyticsReportFilters(e,t=!0,i=!1,n=!1){let s=[];if(e.source){let S=n?"visitSource":"source";s.push({key:S,operator:"in",value:e.source})}if(e.resourceId&&s.push({key:"resourceId",operator:"in",value:e.resourceId}),e.serviceId&&s.push({key:"serviceId",operator:"in",value:e.serviceId}),!e.includeDeleted&&t&&s.push({key:"isDeleted",operator:"=",value:"false"}),e.visitType&&s.push({key:"visitType",operator:"in",value:e.visitType}),e.labels)for(let[S,W]of Object.entries(e.labels))s.push({key:`label:${S}`,operator:"in",value:W});let h=we(e.presetSurveyIds);return i&&h.length>0&&s.push({key:"presetSurveyId",operator:"in",value:h}),s}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Wt({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();function Am(a,u){if(a&1&&A(0,"ww-date-range-picker",0),a&2){let e=f(),t=x(0),i=f(),n=f();p("filters",e)("formControl",n.dateRangePickerFormControl)("min",i)("wwTypography","button")("size",t)}}function bm(a,u){if(a&1&&(R(0),o(1,"async"),_(2,Am,1,5,"ww-date-range-picker",0)),a&2){let e=N(r(1,1,f(2).size$));l(2),v(e?2:-1)}}function Tm(a,u){if(a&1&&(_(0,bm,3,4),o(1,"async")),a&2){let e,t=f();v((e=r(1,1,t.dateRangeFilters$))?0:-1,e)}}var Da=(()=>{class a extends _t{constructor(){super(),this.breakpoints=w(ke),this.accountRx=w(St),this.analyticsService=w(ne),this.eventLogger=w(Ha),this.defaultDateRangeMinDate=new Date(2023,0,1),this.defaultDateRangeFilters=as,this.dateRangePickerFormControl=new Ne(null),this.size$=this.breakpoints.isBelowSmall$.pipe(c(e=>e?"full":"auto")),this.maxAnalyticsHistoricalDays$=this.accountRx.getAccount(["features"]).pipe(c(e=>e.features.maxAnalyticsHistoricalDays)),this.dateRangeMinDate$=this.maxAnalyticsHistoricalDays$.pipe(c(e=>e?Mt(Fa(),e):this.defaultDateRangeMinDate)),this.dateRangeFilters$=this.dateRangeMinDate$.pipe(c(e=>this.defaultDateRangeFilters.filter(t=>t.createDateRange().start.getTime()>=e.getTime()))),this.dateRange$=Ye(this.dateRangePickerFormControl).pipe(Qe(de),Qe(e=>e.start.getTime()<=e.end.getTime())),this.subscribeToDateRange()}subscribeToDateRange(){this.dateRange$.pipe(Ze(this.ngOnDestroy$)).subscribe(e=>{let t=this.defaultDateRangeFilters.find(i=>k(i.createDateRange(),e));this.analyticsService.setDateRange(K(j({},e),{id:t?.id??vi.id})),this.eventLogger.log("updated_analytics_date_range",{params:{range:t?.id??vi.id}}),t&&t.id!==vi.id?(this.analyticsService.persistFormControlValue("date-range",t.id),this.analyticsService.persistFormControlValue("date-start",null),this.analyticsService.persistFormControlValue("date-end",null)):(this.analyticsService.persistFormControlValue("date-range",null),this.analyticsService.persistFormControlValue("date-start",e.start.toISOString()),this.analyticsService.persistFormControlValue("date-end",e.end.toISOString()))})}syncDateRangeWithQueryParams(){let e=ni.createDateRange(),t=this.analyticsService.getInitialFormControlValue("date-range",vi.id,Lt),i=this.analyticsService.getInitialFormControlValue("date-start",e.start.toISOString(),An),n=this.analyticsService.getInitialFormControlValue("date-end",e.end.toISOString(),An),s=this.defaultDateRangeFilters.find(S=>S.id===t),h=s&&s.id!==vi.id?s.createDateRange():hr({start:i,end:n});h.start.getTime()<this.defaultDateRangeMinDate.getTime()&&(h.start=this.defaultDateRangeMinDate),this.dateRangePickerFormControl.setValue(h)}ngOnInit(){this.syncDateRangeWithQueryParams()}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-date-range-picker"]],hostAttrs:[1,"ww-analytics-date-range-picker"],standalone:!1,features:[B],decls:2,vars:3,consts:[[1,"flex","flex-col","items-start","w-full",3,"filters","formControl","min","wwTypography","size"]],template:function(t,i){if(t&1&&(_(0,Tm,2,3),o(1,"async")),t&2){let n;v((n=r(1,1,i.dateRangeMinDate$))?0:-1,n)}},dependencies:[Ae,be,fr,Xe,L],styles:[`.ww-analytics-date-range-picker{display:flex;flex-direction:column}.ww-breakpoints-below-small .ww-analytics-date-range-picker .ww-form-field{width:100%}.ww-breakpoints-below-small .ww-analytics-date-range-picker .ww-form-field .ww-form-field-control{justify-content:flex-start}
222/*noopanalytics-date-range-picker.component-5HKMVTJJ.css.map */
223`],encapsulation:2,changeDetection:0})}}return a})();var Em=()=>({order:110}),xm=()=>({order:120}),Wm=()=>({});function Im(a,u){if(a&1&&(d(0,"div",0),A(1,"ww-analytics-date-range-picker",2)(2,"ww-page-filter-button",3),m()),a&2){let e=f(2);l(2),p("buttonType","secondary")("store",e.analyticsFilterStore)("title",e.filterTitle)}}function Mm(a,u){if(a&1&&A(0,"ww-page-filter-button",6),a&2){let e=f(3);p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function Bm(a,u){a&1&&A(0,"ww-analytics-date-range-picker",7)}function Fm(a,u){a&1&&Le(0,Mm,1,2,"ww-page-filter-button",4)(1,Bm,1,0,"ww-analytics-date-range-picker",5),a&2&&(p("wwLayoutTertiaryAction",$e(2,Em)),l(),p("wwLayoutTertiaryAction",$e(3,xm)))}function Nm(a,u){if(a&1&&(d(0,"ww-page-toolbar"),A(1,"ww-page-filter-chips",8),m()),a&2){let e=f(2);l(),p("store",e.analyticsFilterStore)("title",e.filterTitle)}}
223function Om(a,u){a&1&&Je(0)}function Vm(a,u){if(a&1&&(Le(0,Om,1,0,"ng-container",9),o(1,"async")),a&2){let e=f(),t=f();p("ngComponentOutlet",e)("ngComponentOutletInputs",r(1,2,t.chartInputs$)??$e(4,Wm))}}function Pm(a,u){a&1&&Je(0)}function zm(a,u){if(a&1&&Le(0,Pm,1,0,"ng-container",10),a&2){let e=f();p("ngComponentOutlet",e)}}function Ym(a,u){if(a&1&&(_(0,Im,3,3,"div",0),o(1,"async"),Re(2,Fm,2,4),_(3,Nm,2,2,"ww-page-toolbar"),o(4,"async"),d(5,"div",1),_(6,Vm,2,5,"ng-container"),o(7,"async"),Re(8,zm,1,1,"ng-container"),m()),a&2){let e=f();v(r(1,3,e.breakpoints.isBelowSmall$)?0:2),l(3),v(r(4,5,e.analyticsFilterStore.hasData$)?3:-1),l(3),v(r(7,7,e.hash$)?6:8)}}var Um={"average-durations":Gi,"csat-by-location":ya,"csat-by-resource":Ca,"csat-by-service":wa,"csat-distribution":Hi,"csat-response-trend":ji,"csat-responses":Ki,"customer-path":ri,customers:Xi,"dropoff-by-position":Qi,dropoffs:Zi,"financials-location-revenue":Ji,"financials-revenue":ea,"financials-service-revenue":ta,"input-field":ia,"line-length":aa,"message-details":ra,"message-recipient":sa,"message-type":la,"new-vs-returning":ca,"operations-resources":ga,"operations-service-combinations":_a,"operations-services":va,"operations-users":Sa,"placeholder-funnel":Aa,"placeholder-table":ba,"placeholder-traffic":Ta,"registration-details":pa,"top-locations":ma,"visit-trend":si,"visits-by-label":da,"visits-by-location":ua,"visits-heatmap":ha,"wait-serve-durations":fa},po=(()=>{class a extends _t{constructor(){super(),this.analyticsFilterStore=w(ki),this.breakpoints=w(ke),this.layout=w(Kt),this.activatedRoute=w(pi),this.analyticsService=w(ne),this.filterTitle=$localize`Filter analytics`,this.currentTab$=this.activatedRoute.params.pipe(c(e=>e.tab)),this.currentChart$=this.activatedRoute.params.pipe(c(e=>e.chart)),this.hash$=this.activatedRoute.params.pipe(c(e=>e.hash)),this.chartInputs$=this.hash$.pipe(c(e=>({hash:e}))),this.chartComponent$=this.currentChart$.pipe(c(e=>Um[e])),this.queryStringArgs$=T([this.currentTab$,this.analyticsService.dateRange$,this.analyticsFilterStore.queryParams$.pipe($((e,t)=>k(e,t)))]).pipe(xi(0,vn),c(([e,t,i])=>({tab:e,dateRange:t,queryParams:i}))),this.layout.updateFeatureContext({name:$localize`Some chart name`,parentPath:"account/analytics"}),this.subscribe()}subscribe(){this.queryStringArgs$.pipe(xi(Jr,vn),Ze(this.ngOnDestroy$)).subscribe(e=>{let t=new URLSearchParams(window.location.search);for(let[n,s]of Object.entries(e.queryParams))t.set(n,s);let i=t.size>0?`?${t.toString()}`:"";this.layout.updateFeatureContext({parentPath:`account/analytics/${e.tab}${i}`})})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-chart"]],hostAttrs:[1,"ww-analytics-chart","flex","flex-col","small:gap-6","gap-4","below-small:px-4"],standalone:!1,features:[B],decls:2,vars:3,consts:[[1,"flex","items-center","justify-between","gap-2","small:px-4"],["wwBorderColor","mediumGrey","wwLayoutPadding","",1,"flex","flex-col","small:gap-6","gap-4","border-t"],[1,"w-full"],[3,"buttonType","store","title"],[3,"store","title",4,"wwLayoutTertiaryAction"],["class","ml-1",4,"wwLayoutTertiaryAction"],[3,"store","title"],[1,"ml-1"],[1,"small:pl-6",3,"store","title"],[4,"ngComponentOutlet","ngComponentOutletInputs"],[4,"ngComponentOutlet"]],template:function(t,i){if(t&1&&(_(0,Ym,9,9),o(1,"async")),t&2){let n;v((n=r(1,1,i.chartComponent$))?0:-1,n)}},dependencies:[Wa,qa,Ka,Za,Ja,Xa,he,Da,L],encapsulation:2,changeDetection:0})}}return a})();var je=(()=>{class a extends _t{constructor(){super(...arguments),this.layout=w(Kt)}ngOnInit(){this.layout.updateFeatureContext({name:$localize`Analytics`})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275dir=ci({type:a,features:[B]})}}return a})();function Gm(a,u){if(a&1&&A(0,"ww-analytics-chart-csat-by-resource",6),a&2){f();let e=x(9);tt("medium:col-span-3",e)}}function Hm(a,u){if(a&1&&A(0,"ww-analytics-chart-csat-by-service",6),a&2){f();let e=x(7);tt("medium:col-span-3",e)}}function jm(a,u){if(a&1&&(d(0,"ww-card",0)(1,"div",1),A(2,"ww-analytics-csat-metric-average")(3,"ww-analytics-csat-metric-responses")(4,"ww-analytics-csat-metric-response-rate")(5,"ww-analytics-csat-metric-response-feedback")(6,"ww-analytics-csat-metric-feedback-rate"),m()(),R(7),o(8,"async"),R(9),o(10,"async"),d(11,"div",2),A(12,"ww-analytics-chart-csat-distribution",3)(13,"ww-analytics-chart-csat-by-location",4),_(14,Gm,1,2,"ww-analytics-chart-csat-by-resource",5),_(15,Hm,1,2,"ww-analytics-chart-csat-by-service",5),A(16,"ww-analytics-chart-csat-response-trend",6)(17,"ww-analytics-chart-csat-responses",6),m()),a&2){let e=f();l(7);let t=N(r(8,2,e.analyticsService.hasResources$));l(2);let i=N(r(10,5,e.analyticsService.hasServices$));l(5),v(t?14:-1),l(),v(i?15:-1)}}var mo=(()=>{class a extends je{constructor(){super(...arguments),this.analyticsService=w(ne)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-surveys"]],hostAttrs:[1,"ww-analytics-surveys","ww-analytics-tab"],standalone:!1,features:[B],decls:2,vars:3,consts:[["wwBorderColor","mediumGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-5","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[1,"grid","grid-cols-6","small:gap-6","gap-4"],[1,"medium:col-span-2","col-span-6"],[1,"medium:col-span-4","col-span-6"],[1,"col-span-6",3,"medium:col-span-3"],[1,"col-span-6"]],template:function(t,i){t&1&&(_(0,jm,18,8),o(1,"async")),t&2&&v(r(1,1,i.analyticsService.hasSurveyPermissions$)?0:-1)},dependencies:[dt,he,Hi,Ki,ji,ya,Ca,wa,Kn,Xn,Qn,Zn,Jn,L],encapsulation:2,changeDetection:0})}}return a})();var uo="analytics-financials-bubble-hidden";function qm(a,u){if(a&1){let e=ae();d(0,"ww-info-bubble",1)(1,"div",4)(2,"span"),ka(3,0),A(4,"ww-link",5),d(5,"ww-link",6),E("click",function(){G(e);let i=f();return H(i.intercom.showArticle(10006688))}),m(),Ea(),m(),d(6,"button",7),E("click",function(){G(e);let i=f();return H(i.hideBubble())}),A(7,"ww-icon",8),m()()()}a&2&&(l(4),p("inline",!0),l(),p("inline",!0))}function Km(a,u){a&1&&(d(0,"div",2),A(1,"ww-analytics-chart-financials-revenue",9)(2,"ww-analytics-chart-financials-location-revenue")(3,"ww-analytics-chart-financials-service-revenue"),m())}function Xm(a,u){a&1&&(d(0,"div",3),A(1,"ww-analytics-chart-financials-revenue")(2,"ww-analytics-chart-financials-location-revenue")(3,"ww-analytics-chart-financials-service-revenue"),m())}var ho=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke),this.intercom=w(Ir),this.bubbleHidden=No(uo,!1,Fo)}hideBubble(){Oo(uo,!0),this.bubbleHidden=!0}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-financials"]],hostAttrs:[1,"ww-analytics-financials","ww-analytics-tab"],standalone:!1,features:[B],decls:4,vars:4,consts:()=>{let e;e=$localize`service options`;let t;t=$localize`Learn more`;let i;i=$localize`Hide`;let n;n=$localize`Hide`;let s;return s=$localize`To view revenue data, set up revenue tracking in ${"\uFFFD#4\uFFFD"}:START_TAG_WW_LINK:${"[\uFFFD/#4\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_WW_LINK: in location settings. ${"\uFFFD#5\uFFFD"}:START_TAG_WW_LINK_1:${"[\uFFFD/#4\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_WW_LINK:`,s=Lo(s),[s,[1,"!max-w-full","!w-full"],[1,"grid","grid-cols-2","gap-6"],[1,"flex","flex-col","small:gap-6","gap-4"],[1,"flex","items-center","justify-between","w-full"],["type","router-link","href","/settings/services/service-options","content",e,3,"inline"],["type","external-in-same-tab","content",t,3,"click","inline"],["aria-label",i,"title",n,3,"click"],["icon","bx-x"],[1,"col-span-2"]]},template:function(t,i){t&1&&(_(0,qm,8,2,"ww-info-bubble",1),_(1,Km,4,0,"div",2),o(2,"async"),Re(3,Xm,4,0,"div",3)),t&2&&(v(i.bubbleHidden?-1:0),l(),v(r(2,2,i.breakpoints.isAboveLarge$)?1:3))},dependencies:[qt,ur,Si,Ji,ea,ta,L],encapsulation:2,changeDetection:0})}}return a})();function Qm(a,u){a&1&&(d(0,"div",1),A(1,"ww-analytics-chart-dropoff-by-position",2)(2,"ww-analytics-chart-dropoffs",3),m(),d(3,"div",1),A(4,"ww-analytics-chart-customer-path",3)(5,"ww-analytics-chart-line-length",2),m(),d(6,"div",1),A(7,"ww-analytics-chart-registration-detail
223s",3)(8,"ww-analytics-chart-wait-serve-durations",2),m(),d(9,"div",4),A(10,"ww-analytics-chart-average-durations"),m())}function Zm(a,u){a&1&&(d(0,"div",0),A(1,"ww-analytics-chart-dropoff-by-position")(2,"ww-analytics-chart-dropoffs")(3,"ww-analytics-chart-customer-path")(4,"ww-analytics-chart-line-length")(5,"ww-analytics-chart-registration-details")(6,"ww-analytics-chart-wait-serve-durations")(7,"ww-analytics-chart-average-durations"),m())}var fo=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-guest-experience"]],hostAttrs:[1,"ww-analytics-guest-experience","ww-analytics-tab"],standalone:!1,features:[B],decls:3,vars:3,consts:[[1,"flex","flex-col","small:gap-6","gap-4"],[1,"grid","grid-cols-3","gap-6"],[1,"col-span-2"],[1,"col-span-1"],[1,"flex","flex-col","gap-6"]],template:function(t,i){t&1&&(_(0,Qm,11,0),o(1,"async"),Re(2,Zm,8,0,"div",0)),t&2&&v(r(1,1,i.breakpoints.isAboveMedium$)?0:2)},dependencies:[Gi,ri,Qi,Zi,aa,pa,fa,L],encapsulation:2,changeDetection:0})}}return a})();var yo=(()=>{class a{static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-placeholder-graph"]],hostAttrs:[1,"ww-placeholder-graph","flex","grow","justify-center","items-center"],standalone:!1,decls:4,vars:6,consts:[[1,"flex","flex-row","items-end","gap-2"],[3,"width","height"]],template:function(t,i){t&1&&(d(0,"div",0),A(1,"ww-skeleton-placeholder",1)(2,"ww-skeleton-placeholder",1)(3,"ww-skeleton-placeholder",1),m()),t&2&&(l(),p("width",32)("height",64),l(),p("width",32)("height",128),l(),p("width",32)("height",96))},dependencies:[X],encapsulation:2,changeDetection:0})}}return a})();function ed(a,u){a&1&&(d(0,"div",2),A(1,"ww-analytics-placeholder-graph"),m())}function td(a,u){a&1&&(d(0,"div",3),A(1,"ww-illustration",5),d(2,"span",6),te(3,0),m()())}function id(a,u){if(a&1&&A(0,"ww-analytics-chart-input-field",7),a&2){let e=u.$implicit;p("hash",e)}}function ad(a,u){if(a&1&&(d(0,"div",4),We(1,id,1,1,"ww-analytics-chart-input-field",7,It),o(3,"async"),m()),a&2){let e=f();l(),Ie(r(3,0,e.hashes$))}}var Co=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke),this.analyticsService=w(ne),this.layoutComponent=w(bi),this.pageEventSub=new De(Tt),this.pageEvent$=this.pageEventSub.pipe(Qe(e=>e!==null),mi(["pageIndex","pageSize","length"])),this.loadingSub=new De(!0),this.loading$=this.loadingSub.asObservable(),this.dataRows$=this.analyticsService.reportDataForDataFields$.pipe(c(e=>e?.data??[]),c(e=>e.filter(t=>t.dataFieldNameHashed&&t.dataFieldNameHashed.length>0&&t.dataFieldName&&t.dataFieldName.length>0).sort((t,i)=>t.dataFieldName.localeCompare(i.dataFieldName))),this.updateLoadingState()),this.hashes$=ui(this.dataRows$.pipe(c(e=>e.map(t=>t.dataFieldNameHashed??null).filter(se)),c(e=>it(e))),this.pageEvent$),this.noMoreFields$=T([this.hashes$,this.pageEventSub]).pipe(c(([e,t])=>t.pageSize>e.length)),this.noInputFields$=this.dataRows$.pipe(c(e=>e.length===0))}updateLoadingState(){return e=>e.pipe(Ra(()=>this.loadingSub.next(!1)),$a(()=>this.loadingSub.next(!1)))}onScrolledToEnd(){this.pageEventSub.next(K(j({},Tt),{pageSize:this.pageEventSub.value.pageSize+Tt.pageSize}))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-input-fields"]],hostAttrs:[1,"ww-analytics-input-fields","ww-analytics-tab"],standalone:!1,features:[B],decls:9,vars:14,consts:()=>{let e;return e=$localize`No data available`,[e,[1,"overflow-y-auto","h-full",3,"scrolledToEnd","disabled","scrollElement","overflowElement"],[1,"w-full"],[1,"flex","flex-col","items-center","justify-center","gap-2","w-full","min-h-96"],[1,"grid","medium:grid-cols-3","small:grid-cols-2","grid-cols-1","small:gap-6","gap-4"],["icon","ww-analytics-chart-no-data-partial","color","mediumGrey"],["wwColor","mediumGrey"],[3,"hash"]]},template:function(t,i){t&1&&(d(0,"ww-infinite-scroll",1),o(1,"async"),o(2,"async"),o(3,"async"),E("scrolledToEnd",function(){return i.onScrolledToEnd()}),_(4,ed,2,0,"div",2),o(5,"async"),o(6,"async"),Re(7,td,4,0,"div",3)(8,ad,4,2,"div",4),m()),t&2&&(p("disabled",r(1,4,i.noMoreFields$))("scrollElement",r(2,6,i.layoutComponent.scrollElement$))("overflowElement",r(3,8,i.layoutComponent.overflowElement$)),l(4),v(r(5,10,i.loading$)?4:r(6,12,i.noInputFields$)?7:8))},dependencies:[he,yi,wi,yo,ia,L],encapsulation:2,changeDetection:0})}}return a})();var wo=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-messages"]],hostAttrs:[1,"ww-analytics-messages","ww-analytics-tab"],standalone:!1,features:[B],decls:12,vars:0,consts:[["wwBorderColor","mediumGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-6","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[1,"grid","grid-cols-4","small:gap-6","gap-4"],[1,"medium:col-span-2","col-span-4"],[1,"medium:col-span-1","small:col-span-2","col-span-4"]],template:function(t,i){t&1&&(d(0,"ww-card",0)(1,"div",1),A(2,"ww-analytics-alerts-messages")(3,"ww-analytics-alerts-messages-per-customer")(4,"ww-analytics-alerts-sms-automatic")(5,"ww-analytics-alerts-sms-triggered")(6,"ww-analytics-alerts-sms-custom")(7,"ww-analytics-alerts-messages-segments"),m()(),d(8,"div",2),A(9,"ww-analytics-chart-message-details",3)(10,"ww-analytics-chart-message-type",4)(11,"ww-analytics-chart-message-recipient",4),m())},dependencies:[dt,he,In,Mn,Bn,Fn,Nn,On,ra,sa,la],encapsulation:2,changeDetection:0})}}return a})();var nd=(a,u)=>u.hash;function od(a,u){a&1&&(d(0,"div",4),A(1,"ww-analytics-chart-visits-by-location",5)(2,"ww-analytics-chart-visits-by-label"),m())}function rd(a,u){a&1&&A(0,"ww-analytics-chart-visits-by-location")(1,"ww-analytics-chart-visits-by-label")}function sd(a,u){if(a&1&&(_(0,od,3,0,"div",4),o(1,"async"),Re(2,rd,2,0)),a&2){let e=f();v(r(1,1,e.breakpoints.isAboveMobile$)?0:2)}}function ld(a,u){a&1&&A(0,"ww-analytics-chart-visits-by-location")}function cd(a,u){if(a&1&&A(0,"ww-analytics-chart-operations-resources",3),a&2){let e=u.$implicit;p("hash",e.hash)("categoryName",e.name)}}var go=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke),this.labelRx=w(Ai),this.layoutComponent=w(bi),this.analyticsService=w(ne),this.pageEventSub=new De(Tt),this.pageEvent$=this.pageEventSub.pipe(Qe(e=>e!==null),mi(["pageIndex","pageSize","length"])),this.dataRows$=this.analyticsService.resourcesReportData$.pipe(c(e=>e?.data??[]),c(e=>e.filter(t=>t.resourceCategoryNameHashed&&t.resourceCategoryNameHashed.length>0&&t.resourceName&&t.resourceName.length>0).sort((t,i)=>t.resourceCategoryName.localeCompare(i.resourceCategoryName)))),this.resourceCategories$=ui(this.dataRows$.pipe(c(e=>e.filter(t=>t.resourceCategoryNameHashed&&t.resourceCategoryNameHashed.length>0).map(t=>({hash:t.resourceCategoryNameHashed??null,name:t.resourceCategoryName}))),c(e=>it(e,(t,i)=>t.hash===i.hash))),this.pageEvent$),this.noMoreFields$=T([this.resourceCategories$,this.pageEventSub]).pipe(c(([e,t])=>t.pageSize>e.length))}onScrolledToEnd(){this.pageEventSub.next(K(j({},Tt),{pageSize:this.pageEventSub.value.pageSize+Tt.pageSize}))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-operations"]],hostAttrs:[1,"ww-analytics-operations","ww-analytics-tab"],standalone:!1,features:[B],decls:14,vars:14,consts:[[1,"overflow-y-auto","h-full","gap-6",3,"scrolledToEnd","disabled","scrollElement","overflowElement"],[1,"flex","flex-col","small:gap-6","gap-4"],[1,"grid","medium:grid-cols-2","grid-cols-1","gap-6"],[3,"hash","categoryName"],[1,"grid","gap-6","medium:grid-cols-3","grid-cols-1"],[1,"medium:col-span-2"]],template:function(t,i){if(t&1&&(d(0,"ww-infinite-scroll",0),o(1,"async"),o(2,"async"),o(3,"async"),E("scrolledToEnd",function(){return i.onScrolledToEnd()}),R(4),o(5,"async"),d(6,"div",1),_(7,sd,3,3)(8,ld,1,0,"ww-analytics-chart-visits-by-location"),A(9,"ww-analytics-chart-operations-users"),d(10,"div",2),We(11,cd,1,2,"ww-analytics-chart-operations-resources",3,nd),o(13,"async"),m()()()),t&2){p("disabled",r(1,4,i.noMoreFields$))("scrollElement",r(2,6,i.layoutComponent.scrollElement$))("overflowElement",r(3,8,i.layoutComponent.overflowElement$));let n=r(5,10,i.labelRx.hasLabels$);l(7),v(n?7:8),l(4),Ie(r(13,12,i.resourceCategories$))}},dependencies:[wi,da,ua,ga,Sa,L],encapsulation:2,changeDetection:0})}}return a})();var _o=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-overview"]],hostAttrs:[1,"ww-analytics-overview","ww-analytics-tab"],standalone:!1,features:[B],decls:12,vars:0,consts:[["wwBorderColor","mediumGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-6","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[1,"medium:grid","medium:grid-cols-3","below-medium:flex","below-medium:flex-col","small:gap-6","gap-4"],[1,"medium:col-span-2"],[1,"medium:col-span-1"],[1,"medium:col-span-3"]],template:function(t,i){t&1&&(d(0,"ww-card",0)(1,"div",1),A(2,"ww-analytics-overview-bookings")(3,"ww-analytics-overview-waitlist")(4,"ww-analytics-overview-served")(5,"ww-analytics-overview-waittimes")(6,"ww-analytics-overview-dropoff")(7,"ww-analytics-overview-messages"),m()(),d(8,"div",2),A(9,"ww-analytics-chart-visit-trend",3)(10,"ww-analytics-chart-customer-path",4)(11,"ww-analytics-chart-top-locations",5),m())},dependencies:[dt,he,ri,ma,si,eo,to,io,no,oo,ro],encapsulation:2,changeDetection:0})}}return a})();function md(a,u){if(a&1&&(d(0,"ww-bullet-list-item"),U(1),m()),a&2){let e=u.$implicit;l(),_e(e)}}function dd(a,u){if(a&1&&(d(0,"ww-bullet-list",8),We(1,md,2,1,"ww-bullet-list-item",null,It),o(3,"async"),m()),a&2){let e=f(2);l(),Ie(r(3,0,e.bulletPoints$))}}function ud(a,u){a&1&&Je(0)}function hd(a,u){if(a&1&&(d(0,"div",4)(1,"div",5)(2,"ww-call-out",6)(3,"ww-call-out-title"),U(4),o(5,"async"),m(),d(6,"ww-call-out-content",7)(7,"p"),U(8),o(9,"async"),m(),_(10,dd,4,2,"ww-bullet-list",8),o(11,"async"),m(),d(12,"ww-call-out-actions"),Le(13,ud,1,0,"ng-container",9),m()()()(),d(14,"div",10)(15,"ww-card",11)(16,"div",12),A(17,"ww-analytics-overview-placeholder",13)(18,"ww-analytics-overview-placeholder")(19,"ww-analytics-overview-placeholder",13)(20,"ww-analytics-overview-placeholder")(21,"ww-analytics-overview-placeholder",13)(22,"ww-analytics-overview-placeholder"),m()(),d(23,"div",14),A(24,"ww-analytics-placeholder-traffic",15)(25,"ww-analytics-placeholder-funnel",16)(26,"ww-analytics-placeholder-table",17),m()()),a&2){let e=f(),t=et(4);l(2),p("backgroundColor","upgrade2")("illustration","ww-analytics-upgrade"),l(2),_e(r(5,9,e.title$)),l(4),xe(" ",r(9,11,e.description$)," "),l(2),v(r(11,13,e.breakpoints.isAboveMobile$)?10:-1),l(3),p("wwOutlet",t),l(4),p("positive",!0),l(2),p("positive",!0),l(2),p("positive",!0)}}function fd(a,u){a&1&&Je(0)}function yd(a,u){if(a&1&&(d(0,"div",3)(1,"div",18),A(2,"ww-illustration",19),d(3,"div",20)(4,"h3"),U(5),o(6,"async"),m(),d(7,"p",21),U(8),o(9,"async"),m()()(),d(10,"div",20),Le(11,fd,1,0,"ng-container",9),m()()),a&2){let e=f(),t=et(4);l(5),_e(r(6,3,e.title$)),l(3),xe(" ",r(9,5,e.description$)," "),l(3),p("wwOutlet",t)}}function Cd(a,u){if(a&1){let e=ae();d(0,"a",24),E("click",function(){G(e);let i=f(2);return H(i.upgrade())}),ka(1,2),A(2,"ww-icon",25),Ea(),m()}}function wd(a,u){if(a&1&&(_(0,Cd,3,0,"a",22),o(1,"async"),d(2,"a",23),te(3,1),m()),a&2){let e=f();v(r(1,1,e.featuresRx.withBilling$)?0:-1)}}var Ei=(()=>{class a extends je{constructor(){super(),this.breakpoints=w(ke),this.featuresRx=w(xr),this.accountRx=w(St),this.internalLinks=w(Mr),this.router=w(Ht),this.enableAnalytics$=this.accountRx.hasAccountFeature
223("enableAnalytics"),this.enableAdvancedAnalytics$=this.accountRx.hasAccountFeature("enableAdvancedAnalytics"),this.title$=this.enableAnalytics$.pipe(c(e=>e?$localize`Upgrade to Business plan to access more analytics`:$localize`Upgrade to Starter plan to access analytics`)),this.description$=this.enableAnalytics$.pipe(c(e=>e?$localize`The Business plan allows for up to 10 locations and 1,000 visits per location per month included. With advanced analytics, API access, and custom user roles, the Business plan gives you full control of every location’s operations and customer experience.`:$localize`The Starter plan comes with 4 locations and up to 3,000 visits/mo. It equips you with everything you need to manage your growing business, including high-level analytics and customizable communication tools`)),this.bulletPoints$=this.enableAnalytics$.pipe(c(e=>e?[$localize`Build customized experiences with API and webhooks`,$localize`Access advanced analytics and 365 days of data`,$localize`Create custom user roles that fit your needs`]:[$localize`Analyze and compare data across locations`,$localize`Customize default customer messages`,$localize`Initiate customer chats`])),this.subscribe()}subscribe(){this.enableAdvancedAnalytics$.subscribe(e=>{e&&this.router.navigate(["/account"])})}upgrade(){this.internalLinks.navigateToUpgrade()}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-paywall"]],hostAttrs:[1,"ww-analytics-paywall","ww-analytics-tab"],standalone:!1,features:[B],decls:5,vars:3,consts:()=>{let e;e=$localize` Learn more `;let t;return t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_WW_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_WW_ICON: Upgrade `,[["actionsTmpl",""],e,t,[1,"ww-analytics-paywall-background","flex","flex-col","flex-grow","justify-between","gap-4","p-6"],[1,"ww-analytics-paywall-overlay","block","absolute","top-0","left-0","w-full","h-full","z-20"],[1,"ww-analytics-paywall-overlay-container","flex","flex-col","items-center","pt-6","small:pt-24","w-full","h-full"],[1,"ww-analytics-paywall-overlay-content",3,"backgroundColor","illustration"],[1,"flex","flex-col","gap-4"],["icon","bx-check-circle"],[4,"wwOutlet"],[1,"z-10"],["wwBackgroundColor","lighterGrey","wwBorderColor","lighterGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-6","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[3,"positive"],[1,"medium:grid","medium:grid-cols-3","below-medium:flex","below-medium:flex-col","gap-6"],[1,"medium:col-span-2"],[1,"medium:col-span-1"],[1,"medium:col-span-3"],[1,"flex","flex-col","gap-2","flex-grow","justify-center"],["icon","ww-analytics-upgrade",1,"ww-analytics-paywall-illustration"],[1,"flex","flex-col","gap-2"],[1,"ww-analytics-paywall-description"],["wwButton","secondary","wwBackgroundColor","black","wwColor","white"],["wwButton","tertiary","href","https://help.waitwhile.com/en/articles/9250541-analytics-overview","target","_blank"],["wwButton","secondary","wwBackgroundColor","black","wwColor","white",3,"click"],["icon","bxs-bolt"]]},template:function(t,i){t&1&&(_(0,hd,27,15),o(1,"async"),Re(2,yd,12,7,"div",3),Le(3,wd,4,3,"ng-template",null,0,gt)),t&2&&v(r(1,1,i.breakpoints.isAboveSmall$)?0:2)},dependencies:[Vr,Pr,zr,Yr,mr,dr,lr,dt,he,qt,yi,Oa,ao,Aa,ba,Ta,L],styles:[`.ww-analytics-paywall .ww-analytics-paywall-overlay{background-color:#fff3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.ww-analytics-paywall .ww-analytics-paywall-overlay .ww-analytics-paywall-overlay-content{box-shadow:0 4px 8px #0000000f,0 12px 24px #0000000d;-webkit-backdrop-filter:none;backdrop-filter:none;background-color:var(--ww-color-white);max-width:832px}.ww-breakpoints-below-small .ww-analytics-paywall{--top-nav-bar-height: 48px;--layout-header-height: 56px;--layout-bottom-height: 64px;--analytics-date-range-picker-height: 40px;min-height:calc(100vh - var(--berg-layout-top-inset) - var(--top-nav-bar-height) - var(--layout-header-height) - var(--analytics-date-range-picker-height) - var(--layout-bottom-height))}.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-background{background:radial-gradient(circle at 50% 50%,var(--ww-color-upgrade2),transparent 100%)}.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-illustration{dis
223play:flex;justify-content:center}.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-illustration svg{max-height:160px;max-width:160px}@media screen and (max-height:700px){.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-description{display:none}}
224/*noopanalytics-paywall.component-5HHLM2CZ.css.map */
225`],encapsulation:2,changeDetection:0})}}return a})();var _d=(a,u)=>u.hash;function vd(a,u){if(a&1&&A(0,"ww-analytics-chart-operations-services",3),a&2){let e=u.$implicit;p("hash",e.hash)("categoryName",e.name)}}var vo=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke),this.analyticsService=w(ne),this.layoutComponent=w(bi),this.pageEventSub=new De(Tt),this.pageEvent$=this.pageEventSub.pipe(Qe(e=>e!==null),mi(["pageIndex","pageSize","length"])),this.dataRows$=this.analyticsService.servicesReportData$.pipe(c(e=>e?.data??[]),c(e=>e.filter(t=>t.serviceCategoryNameHashed&&t.serviceCategoryNameHashed.length>0&&t.serviceName&&t.serviceName.length>0).sort((t,i)=>t.serviceCategoryName.localeCompare(i.serviceCategoryName)))),this.serviceCategories$=ui(this.dataRows$.pipe(c(e=>e.filter(t=>t.serviceCategoryNameHashed&&t.serviceCategoryNameHashed.length>0&&t.serviceName&&t.serviceName.length>0).map(t=>({hash:t.serviceCategoryNameHashed??null,name:t.serviceCategoryName}))),c(e=>it(e,(t,i)=>t.hash===i.hash))),this.pageEvent$),this.noMoreFields$=T([this.serviceCategories$,this.pageEventSub]).pipe(c(([e,t])=>t.pageSize>e.length))}onScrolledToEnd(){this.pageEventSub.next(K(j({},Tt),{pageSize:this.pageEventSub.value.pageSize+Tt.pageSize}))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-services"]],hostAttrs:[1,"ww-analytics-services","ww-analytics-tab"],standalone:!1,features:[B],decls:9,vars:11,consts:[[1,"overflow-y-auto","h-full",3,"scrolledToEnd","disabled","scrollElement","overflowElement"],[1,"grid","medium:grid-cols-2","grid-cols-1","small:gap-6","gap-4"],[1,"medium:col-span-2"],[3,"hash","categoryName"]],template:function(t,i){t&1&&(d(0,"ww-infinite-scroll",0),o(1,"async"),o(2,"async"),o(3,"async"),E("scrolledToEnd",function(){return i.onScrolledToEnd()}),d(4,"div",1),A(5,"ww-analytics-chart-operations-service-combinations",2),We(6,vd,1,2,"ww-analytics-chart-operations-services",3,_d),o(8,"async"),m()()),t&2&&(p("disabled",r(1,3,i.noMoreFields$))("scrollElement",r(2,5,i.layoutComponent.scrollElement$))("overflowElement",r(3,7,i.layoutComponent.overflowElement$)),l(6),Ie(r(8,9,i.serviceCategories$)))},dependencies:[wi,_a,va,L],encapsulation:2,changeDetection:0})}}return a})();var So=(()=>{class a extends je{constructor(){super(...arguments),this.breakpoints=w(ke)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Y(a)))(i||a)}})()}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics-visits"]],hostAttrs:[1,"ww-analytics-visits","ww-analytics-tab"],standalone:!1,features:[B],decls:5,vars:0,consts:[[1,"medium:grid","medium:grid-cols-3","below-medium:flex","below-medium:flex-col","small:gap-6","gap-4"],[1,"medium:col-span-2"],[1,"medium:col-span-1"]],template:function(t,i){t&1&&(d(0,"div",0),A(1,"ww-analytics-chart-visit-trend",1)(2,"ww-analytics-chart-new-vs-returning",2)(3,"ww-analytics-chart-customers",2)(4,"ww-analytics-chart-visits-heatmap",1),m())},dependencies:[Xi,ca,ha,si],encapsulation:2,changeDetection:0})}}return a})();var Sd=()=>({order:110}),Ad=()=>({order:120});function bd(a,u){if(a&1&&(d(0,"div",1),A(1,"ww-analytics-date-range-picker",2)(2,"ww-page-filter-button",3),m()),a&2){let e=f(2);l(2),p("buttonType","secondary")("store",e.analyticsFilterStore)("title",e.filterTitle)}}function Td(a,u){if(a&1&&(_(0,bd,3,3,"div",1),o(1,"async")),a&2){let e=f();v(r(1,1,e.withFilter$)?0:-1)}}function Dd(a,u){if(a&1&&A(0,"ww-page-filter-button",6),a&2){let e=f(3);p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function $d(a,u){a&1&&A(0,"ww-analytics-date-range-picker",7)}function Ld(a,u){a&1&&Le(0,Dd,1,2,"ww-page-filter-button",4)(1,$d,1,0,"ww-analytics-date-range-picker",5),a&2&&(p("wwLayoutTertiaryAction",$e(2,Sd)),l(),p("wwLayoutTertiaryAction",$e(3,Ad)))}function Rd(a,u){if(a&1&&(_(0,Ld,2,4),o(1,"async")),a&2){let e=f();v(r(1,1,e.withFilter$)?0:-1)}}function kd(a,u){a&1&&(d(0,"a",9)(1,"span"),te(2,0),m()())}function Ed(a,u){a&1&&Je(0)}function xd(a,u){if(a&1){let e=ae();d(0,"a",13),E("click",function(){let i=G(e).$implicit,n=f(3);return H(n.onTabClick(i.segment))}),Le(1,Ed,1,0,"ng-container",14),m()}if(a&2){let e=u.$implicit,t=f();ko("ww-analytics-tab-"+e.segment),p("active",e.segment===t.segment)("label",e.title.text),l(),p("wwOutlet",e.title.component)}}function Wd(a,u){if(a&1&&(d(0,"ww-page-toolbar"),A(1,"ww-page-filter-chips",6),m()),a&2){let e=f(4);l(),p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function Id(a,u){if(a&1&&(_(0,Wd,2,2,"ww-page-toolbar"),o(1,"async")),a&2){let e=f(3);v(r(1,1,e.analyticsFilterStore.hasData$)?0:-1)}}function Md(a,u){a&1&&Je(0)}function Bd(a,u){if(a&1&&(d(0,"ww-tab-bar",8),R(1),o(2,"async"),_(3,kd,3,0,"a",9),We(4,xd,2,5,"a",10,Yt),o(6,"async"),m(),d(7,"div",11),_(8,Id,2,3),o(9,"async"),Le(10,Md,1,0,"ng-container",12),m()),a&2){let e=f(2);p("type","fill");let t=r(2,4,e.loadingTabs$);l(3),v(t?3:-1),l(),Ie(r(6,6,e.tabs$)),l(4),v(r(9,8,e.withFilter$)?8:-1),l(2),p("ngComponentOutlet",u.component)}}function Fd(a,u){if(a&1&&(_(0,Bd,11,10),o(1,"async")),a&2){let e,t=f();v((e=r(1,1,t.activeTab$))?0:-1,e)}}function Nd(a,u){a&1&&A(0,"ww-analytics-paywall")}var Od={overview:_o,visits:So,"guest-experience":fo,messages:wo,operations:go,services:vo,"input-fields":Co,financials:ho,surveys:mo,"more-analytics":Ei,upgrade:Ei},Is=(()=>{class a extends _t{constructor(){super(),this.analyticsFilterStore=w(ki),this.breakpoints=w(ke),this.accountRx=w(St),this.analyticsService=w(ne),this.layout=w(Kt),this.route=w(pi),this.router=w(Ht),this.filterTitle=$localize`Filter analytics`,this.enableAnalytics$=this.accountRx.hasAccountFeature
225("enableAnalytics"),this.advancedTabs=["overview","visits","guest-experience","messages","operations","services","input-fields","financials","surveys"],this.basicTabs=["overview","more-analytics"],this.noTabs=["upgrade"],this.availableTabs$=T([this.enableAnalytics$,this.accountRx.hasAccountFeature("enableAdvancedAnalytics"),this.analyticsService.hasServices$,this.analyticsService.hasDataFields$,this.analyticsService.hasSurveyPermissions$]).pipe(c(([e,t,i,n,s])=>{if(!e)return this.noTabs;if(!t)return this.basicTabs;let h=[...this.advancedTabs];return i||(h=h.filter(S=>S!=="services")),n||(h=h.filter(S=>S!=="input-fields")),s||(h=h.filter(S=>S!=="surveys")),h})),this.tabs$=this.availableTabs$.pipe(c(e=>e.map(t=>({segment:t,title:{text:xn[t],component:Wn[t]}})))),this.loadingTabs$=this.tabs$.pipe(c(e=>e.length===0),Wi(!0)),this.activeTab$=this.route.params.pipe(c(e=>{let t=e.tab;return t?{segment:t,title:{text:xn[t],component:Wn[t]},component:Od[t]}:null})),this.withFilter$=this.activeTab$.pipe(Qe(se),c(({segment:e})=>["no-analytics","more-analytics"].includes(e)===!1),Wi(!1)),this.layout.setFeatureContext({name:$localize`Analytics`,withResourceSwitcher:!1}),this.analyticsFilterStore.syncStateWithQueryParams()}onTabClick(e){this.router.navigate([`/account/analytics/${e}`],{queryParamsHandling:"merge"})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=D({type:a,selectors:[["ww-analytics"]],hostAttrs:[1,"ww-analytics"],standalone:!1,features:[B],decls:6,vars:6,consts:()=>{let e;return e=$localize`Loading analytics...`,[e,[1,"flex","items-center","justify-between","gap-2","px-4"],[1,"w-full"],[3,"buttonType","store","title"],[3,"store","title",4,"wwLayoutTertiaryAction"],["class","ml-1",4,"wwLayoutTertiaryAction"],[3,"store","title"],[1,"ml-1"],[1,"flex","w-full",3,"type"],["wwTabBarItem",""],["wwTabBarItem","",3,"class","active","label"],["wwLayoutPadding","",1,"h-full","flex","flex-col","small:gap-6","gap-4"],[4,"ngComponentOutlet"],["wwTabBarItem","",3,"click","active","label"],[4,"wwOutlet"]]},template:function(t,i){t&1&&(_(0,Td,2,3),o(1,"async"),Re(2,Rd,2,3),_(3,Fd,2,3),o(4,"async"),Re(5,Nd,1,0,"ww-analytics-paywall")),t&2&&(v(r(1,2,i.breakpoints.isBelowSmall$)?0:2),l(3),v(r(4,4,i.enableAnalytics$)?3:5))},dependencies:[Wa,qa,Ka,Za,Ja,Xa,Oa,vr,_r,Da,Ei,L],styles:[`.ww-analytics{display:flex;flex-direction:column;gap:24px;height:100%}.ww-analytics .ww-analytics-tab{display:flex;flex-direction:column;gap:24px;position:relative}.ww-analytics .ww-analytics-tab .ww-card{flex-direction:column;flex-grow:1;min-height:100%}.ww-analytics .ww-analytics-tab .ww-card .ww-section,.ww-analytics .ww-analytics-tab .ww-card .ww-section .ww-section-content{flex-grow:1}.ww-analytics .ww-analytics-tab .ww-placeholder-graph{min-height:400px}.ww-breakpoints-below-small .ww-analytics .ww-analytics-tab{gap:16px}.ww-breakpoints-above-large .ww-analytics .ww-analytics-tab .ww-analytics-grid-divider-container>*{position:relative}.ww-breakpoints-above-large .ww-analytics .ww-analytics-tab .ww-analytics-grid-divider-container>*:not(:last-child):after{content:"";position:absolute;top:0;right:0;display:block;height:100%;width:1px;background-color:var(--ww-color-mediumGrey)}.ww-breakpoints-below-small .ww-analytics{gap:16px}
226/*noopanalytics.component-U4NPPCQL.css.map */
227`],encapsulation:2,changeDetection:0})}}return a})();var _n=(()=>{class a{constructor(){this.accountRx=w(St),this.router=w(Ht)}
227canActivate(e,t){return T([this.accountRx.hasAccountFeature("enableAnalytics"),this.accountRx.hasAccountFeature("enableAdvancedAnalytics")]).pipe(c(([i,n])=>i&&n||t.url.startsWith("/account/analytics/upgrade")?!0:!i&&!n?(this.router.navigate(["/account/analytics/upgrade"]),!1):t.url.startsWith("/account/analytics/overview")||t.url.startsWith("/account/analytics/more-analytics")?!0:(this.router.navigate(["/account/analytics/more-analytics"]),!1)))}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Wt({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var aL=(()=>{class a{static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275mod=Do({type:a})}static{this.\u0275inj=bo({providers:[ce,{provide:Me,useClass:Ko},{provide:cr,useValue:{size:"auto"}}],imports:[Io,Zr,Ia,Mo.forChild([{path:"",pathMatch:"full",redirectTo:"overview"},{path:":tab",pathMatch:"full",component:Is,canActivate:[_n,ja({permissions:["analytics.show"]})]},{matcher:ss,redirectTo:({params:e})=>{let{tab:t,chart:i,hash:n}=e,s=nn[i];return n?`${t}/${s}/${n}`:`${t}/${s}`}},{path:":tab/:chart",pathMatch:"full",component:po,canActivate:[_n,ja({permissions:["analytics.show"]})]},{path:":tab/:chart/:hash",pathMatch:"full",component:po,canActivate:[_n,ja({permissions:["analytics.show"]})]}]),Xr,Qo,Qr,an,qr,Pa]})}}return a})();export{F0 as ANALYTICS_MESSAGE_DETAILS_CHANNEL_ALT_COLORS,Li as ANALYTICS_MESSAGE_DETAILS_CHANNEL_COLORS,Et as ANALYTICS_MESSAGE_DETAILS_CHANNEL_LABELS,Un as ANALYTICS_MESSAGE_DETAILS_LEVEL_OF_DETAILS_LOCALE,mn as ANALYTICS_MESSAGE_DETAILS_LEVEL_OF_DETAILS_METRICS,V0 as ANALYTICS_MESSAGE_DETAILS_RECIPIENT_ALT_COLORS,Hn as ANALYTICS_MESSAGE_DETAILS_RECIPIENT_COLORS,oa as ANALYTICS_MESSAGE_DETAILS_RECIPIENT_LABELS,N0 as ANALYTICS_MESSAGE_DETAILS_STATE_ALT_COLORS,ti as ANALYTICS_MESSAGE_DETAILS_STATE_COLORS,ft as ANALYTICS_MESSAGE_DETAILS_STATE_LABELS,O0 as ANALYTICS_MESSAGE_DETAILS_TYPE_ALT_COLORS,Gn as ANALYTICS_MESSAGE_DETAILS_TYPE_COLORS,na as ANALYTICS_MESSAGE_DETAILS_TYPE_LABELS,ks as AnalyticsFilterComponents,ki as AnalyticsFilterStore,_n as AnalyticsGuard,In as WwAnalyticsAlertsMessagesChartComponent,Mn as WwAnalyticsAlertsMessagesPerCustomerChartComponent,Bn as WwAnalyticsAlertsMessagesSegmentsChartComponent,Fn as WwAnalyticsAlertsSmsAutomaticChartComponent,Nn as WwAnalyticsAlertsSmsCustomChartComponent,On as WwAnalyticsAlertsSmsTriggeredChartComponent,Gi as WwAnalyticsChartAverageDurationsComponent,J as WwAnalyticsChartBase,po as WwAnalyticsChartComponent,Hi as WwAnalyticsChartCsatDistributionComponent,ji as WwAnalyticsChartCsatResponseTrendComponent,Ki as WwAnalyticsChartCsatResponsesComponent,ri as WwAnalyticsChartCustomerPathComponent,Xi as WwAnalyticsChartCustomersComponent,Qi as WwAnalyticsChartDropoffByPositionComponent,Zi as WwAnalyticsChartDropoffsComponent,Ji as WwAnalyticsChartFinancialsLocationRevenueComponent,ea as WwAnalyticsChartFinancialsRevenueComponent,ta as WwAnalyticsChartFinancialsServiceRevenueComponent,ia as WwAnalyticsChartInputFieldComponent,aa as WwAnalyticsChartLineLengthComponent,ra as WwAnalyticsChartMessageDetailsComponent,sa as WwAnalyticsChartMessageRecipientComponent,la as WwAnalyticsChartMessageTypeComponent,ca as WwAnalyticsChartNewVsReturningComponent,pa as WwAnalyticsChartRegistrationDetailsComponent,ma as WwAnalyticsChartTopLocationsComponent,si as WwAnalyticsChartVisitTrendComponent,da as WwAnalyticsChartVisitsByLabelComponent,ua as WwAnalyticsChartVisitsByLocationComponent,ha as WwAnalyticsChartVisitsHeatmapComponent,fa as WwAnalyticsChartWaitServeDurationsComponent,Is as WwAnalyticsComponent,ya as WwAnalyticsCsatByLocationChartComponent,Ca as WwAnalyticsCsatByResourceChartComponent,wa as WwAnalyticsCsatByServiceChartComponent,Kn as WwAnalyticsCsatMetricAverageChartComponent,Xn as WwAnalyticsCsatMetricFeedbackRateChartComponent,Qn as WwAnalyticsCsatMetricResponseFeedbackChartComponent,Zn as WwAnalyticsCsatMetricResponseRateChartComponent,Jn as WwAnalyticsCsatMetricResponsesChartComponent,Da as WwAnalyticsDateRangePickerComponent,co as WwAnalyticsFieldSelectComponent,aL as WwAnalyticsModule,ga as WwAnalyticsOperationsResourcesComponent,_a as WwAnalyticsOperationsServiceCombinationsComponent,va as WwAnalyticsOperationsServicesComponent,ii as WwAnalyticsOperationsTableBase,Sa as WwAnalyticsOperationsUsersComponent,eo as WwAnalyticsOverviewBookingsChartComponent,to as WwAnalyticsOverviewDropoffChartComponent,io as WwAnalyticsOverviewMessagesChartComponent,ao as WwAnalyticsOverviewPlaceholderChartComponent,no as WwAnalyticsOverviewServedChartComponent,oo as WwAnalyticsOverviewWaitlistChartComponent,ro as WwAnalyticsOverviewWaittimesChartComponent,Aa as WwAnalyticsPlaceholderFunnelChartComponent,yo as WwAnalyticsPlaceholderGraphComponent,ba as WwAnalyticsPlaceholderTableChartComponent,Ta as WwAnalyticsPlaceholderTrafficChartComponent,mo as WwAnalyticsTabCsatComponent,ho as WwAnalyticsTabFinancialsComponent,fo as WwAnalyticsTabGuestExperienceComponent,Co as WwAnalyticsTabInputFieldsComponent,wo as WwAnalyticsTabMessagesComponent,go as WwAnalyticsTabOperationsComponent,_o as WwAnalyticsTabOverviewComponent,Ei as WwAnalyticsTabPaywallComponent,vo as WwAnalyticsTabServicesComponent,So as WwAnalyticsTabVisitsComponent,gs as isAnalyticsMessageDetailsLevelOfDetails,Hc as isMetric};
228//noopchunk-BTJTDE3G.js.map

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.