1import{$a as Oo,C as Ro,De as zo,Gc as li,Hc as ci,I as To,Ia as ai,L as xo,M as bo,Yc as mt,_a as Lo,ab as Do,db as Ao,dd as Mo,fd as Wo,gd as No,hd as ko,i as _o,k as wo,l as So,lc as Vo,m as fo,n as vo,o as yo,p as ho,pa as Ke,qa as Io,qe as Uo,r as Co,ra as Fo,se as ui,ta as $o,te as Po,u as go,v as si,ve as pi,we as Bo,xe as Yo,ye as Je,z as Eo,ze as Go}from"./chunk-TN5ZZO3Q.js";import{$e as Ae,$f as ut,$l as Vt,$m as Pt,$u as ni,Aa as V,Ab as Ne,Ad as Pe,Ae as Be,Al as In,Am as kt,Ba as X,Bb as De,Bm as $n,By as ri,Cl as Ge,Co as Yn,D as R,Dc as cn,Dd as Sn,El as At,F as Hi,Fb as _,Ga as S,Gb as v,Gd as H,Gi as gn,Gu as ye,Ha as he,Hb as rn,He as ce,Hi as En,Hn as zt,Ia as f,Ic as un,If as Li,Ii as Rn,Ja as rt,Jb as xt,Jc as pn,Ji as Ce,Jm as Ut,K as Y,Ka as gt,Kb as $i,Kn as Vn,Kq as Jn,La as q,Lc as Fe,Ld as Ft,Ln as qt,M as ot,Ma as j,Mb as _e,Mc as dn,Mo as Gn,N as k,Na as p,No as zn,O as Ee,Oa as l,Oc as mn,Oo as qn,Pa as c,Pl as re,Pn as ze,Q as ht,Qa as y,Qb as sn,Qi as Tn,Rf as hn,Rm as Ln,Rx as uo,Sb as L,Sm as On,Sx as ur,Tf as Oi,Tn as Mn,Tt as He,Tx as po,Ua as tn,Ub as bt,Up as B,Ux as mo,V as Re,Va as nn,Vm as ve,Vt as oo,Vu as ao,W as Ki,Wa as de,Wb as It,Wc as _n,Xa as Q,Xk as ge,Xl as Fn,Xt as Le,Ya as xe,Yb as an,Yd as fn,Ye as yn,Yn as Wn,Z as u,Za as be,Ze as $t,Zf as Cn,Zn as Nn,Zu as ii,_a as I,_e as Lt,ab as Me,am as Mt,aq as Qn,au as Zt,bb as We,bq as Xn,br as qe,bu as ro,c as Ve,ca as U,cb as Et,cm as Wt,ct as Zn,cv as ne,da as P,db as M,dl as z,dn as Dn,do as kn,ds as Xt,dt as eo,e as Qi,ea as Ji,eb as m,ee as ie,el as Ye,en as Bt,er as je,et as to,ev as lo,fr as Qe,gl as Ot,gr as Xe,ha as Te,hl as xn,ho as Un,i as Z,in as An,io as Pn,iq as Hn,jd as we,je as vn,k as ee,ka as Zi,kl as T,ku as ei,l as d,lb as st,ld as wn,lt as io,m as D,ma as te,mb as on,md as Se,mm as se,nb as Rt,nc as at,nl as pt,om as fe,oo as Ai,pc as ke,pl as bn,po as Vi,qa as Ct,qb as A,ql as $e,qm as Nt,r as Xi,rb as G,rc as ln,ru as so,rv as co,sb as Ie,se as lt,sk as Di,sl as Dt,ta as r,tb as Tt,to as Bn,ty as oi,ub as b,uc as oe,ut as Ht,v as Oe,vb as $,ve as ct,vo as dt,vp as jt,vt as Kt,wb as x,wp as jn,xa as E,ya as en,yc as Ue,yn as Yt,yp as Qt,yq as Kn,yt as Jt,zn as Gt,zo as ae,zt as no,zu as ti}from"./chunk-N6MTJI5Q.js";import"./chunk-UNNH6OJB.js";import{a as F,b as O,f as cr,h as pe}from"./chunk-HE2D45TV.js";var _t="surveys-survey",wt="surveys-services",St="surveys-resources";var qo=(()=>{class i{constructor(){this.accountRx=u(He),this.resourcesRx=u(Zt),this.servicesRx=u(ti),this.surveysRx=u(ye),this.showFilters$=this.accountRx.hasAccountFeature
1("enableSurveys").pipe(k(e=>e?this.surveysRx.surveys$.pipe(d(t=>t.length>0)):Z(!1)),R()),this.surveysFilter$=this.surveysRx.surveys$.pipe(d(e=>e.sort((t,n)=>{let o=t.isActive?1:0,a=n.isActive?1:0;return o===a?t.name.localeCompare(n.name):a-o})),d(e=>({id:ai(_t),name:$localize`Surveys`,categoryId:_t,stringify:t=>`${t.join(",")}`,parse:t=>t?.split(",")??[],pluckLabel:t=>t?.join(", ")??$localize`All surveys`,component:T(ze,{layout:"vertical",size:"full",selection:"multiple",panelClass:"ww-surveys-filter-trigger-select-panel",placeholder:$localize`All surveys`,data:e.map(t=>t.id),triggerComponent:T(Ze,{pluckLabel:t=>{let n=ie(t?.surveyIds);if(n.length===0)return $localize`All surveys`;if(n.length===1){let o=e.find(a=>a.id===n[0]);return o?o.name:$localize`1 survey`}return $localize`${n.length} surveys`}}),pluckLabel:t=>{let n=e.find(o=>o.id===t);return n?.isActive?At({$element:{classList:["flex","items-center","gap-4","w-fit"]},components:[In({content:n.name,$element:{classList:["w-full"]}}),T(et,{active:!0})]}):n?.name??$localize`Unknown`}})}))),this.servicesFilter$=D([this.servicesRx.hasSelectableServices$,this.servicesRx.services$,this.servicesRx.servicesById$]).pipe(d(([e,t,n])=>{if(!e)return null;let o=Object.values(n).filter(a=>a.isCategory);return{id:ai(wt),name:$localize`Services`,categoryId:wt,stringify:a=>`${a.join(",")}`,parse:a=>a?.split(",")??[],pluckLabel:a=>a?.join(", ")??$localize`Any service`,component:T(ze,{panelClass:"ww-surveys-filter-trigger-select-panel",layout:"vertical",size:"full",selection:"multiple",searchable:!0,placeholder:$localize`Any service`,data:t.map(a=>a.id),triggerComponent:T(Ze,{pluckLabel:a=>{let w=ie(a?.serviceIds);if(w.length===0)return $localize`Any service`;if(w.length===1){let h=n[w[0]];return h?h.name:$localize`1 service`}return $localize`${w.length} services`}}),groupBy:a=>{let w=n[a];if(!w)return{id:"",label:$localize`Service`};let h=o.findIndex(W=>W.id===w.id||W.id===w.parentId),g=o[h];return g?{id:g.id,label:g.name,index:h}:{id:"",label:$localize`Service`}},pluckParent:a=>n[a]?.parentId??void 0,pluckLabel:a=>n[a]?.name??$localize`Unknown`})}})),this.resourcesFilter$=D([this.resourcesRx.hasSelectableResources$,this.resourcesRx.resources$,this.resourcesRx.resourcesById$]).pipe(d(([e,t,n])=>{if(!e)return null;let o=Object.values(n).filter(a=>a.isCategory);return{id:ai(St),name:$localize`Resources`,categoryId:St,stringify:a=>`${a.join(",")}`,parse:a=>a?.split(",")??[],pluckLabel:a=>a?.join(", ")??$localize`Any resource`,component:T(ze,{panelClass:"ww-surveys-filter-trigger-select-panel",layout:"vertical",size:"full",selection:"multiple",searchable:!0,placeholder:$localize`Any resource`,data:t.map(a=>a.id),triggerComponent:T(Ze,{pluckLabel:a=>{let w=ie(a?.resourceIds);if(w.length===0)return $localize`Any resource`;if(w.length===1){let h=n[w[0]];return h?h.name:$localize`1 resource`}return $localize`${w.length} resources`}}),groupBy:a=>{let w=n[a];if(!w)return{id:"",label:$localize`Resource`};let h=o.findIndex(W=>W.id===w.id||W.id===w.parentId),g=o[h];return g?{id:g.id,label:g.name,index:h}:{id:"",label:$localize`Resource`}},pluckParent:a=>n[a]?.parentId??void 0,pluckLabel:a=>n[a]?.name??$localize`Unknown`})}}))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=Re({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var tt=(()=>{class i extends xo{constructor(){let e=u(Ji);super(e),this.filterComponents=u(qo),this.defaultFilterValues={surveyIds:[],serviceIds:[],resourceIds:[]},this.filters$=D([this.filterComponents.showFilters$,this.filterComponents.surveysFilter$,this.filterComponents.servicesFilter$,this.filterComponents.resourcesFilter$]).pipe(d(([t,n,o,a])=>t?[n,o,a].filter(we):[])),this.values$=this.state$.pipe(d(t=>t.reduce((n,o)=>{switch(o.source.categoryId){case _t:n=O(F({},n),{surveyIds:o.value});break;case wt:n=O(F({},n),{serviceIds:o.value});break;case St:n=O(F({},n),{resourceIds:o.value});break}return n},this.defaultFilterValues))),this.injector=e}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=Re({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var jo={0:[],1:["green2"],2:["green2","red2"],3:["green2","darkGrey","red2"],4:["green2","green4","red4","red2"],5:["green2","green4","darkGrey","red4","red2"]},Qo={"CS-ISSUE-RESOLVED":["green2","red2"],"CS-RESPONSE-TIME":["green2","green4","darkGrey","red4","red2"],"EV-LENGTH":["red2","red2","green2"],"QE-JOIN-METHOD":["darkGrey","darkGrey","darkGrey","red2"],"SR-VALUED-TIME":["red2","darkGrey","green2"],"WE-WAIT-TIME-COMPARISON":["green2","green4","darkGrey","red4","red2"]},pr=Object.entries(Ce).reduce((i,[s,e])=>(i[s]=e.pages.flatMap(t=>t.questions.map(n=>n.questionId)),i),{}),Xo=Object.values(pr).flat(),Ho=10,di="en-US",mi=Object.keys(Ce.CSAT.i18n??{}
1),ft={key:"surveyAnswerStatus",operator:"!=",value:gn.OPENED};var Ko={answersData:!1,moreAnswersData:!1,metricsReportData:!1,metricsSurveyData:!1,questionsData:!1,responseTrendData:!1},ue=(()=>{class i{constructor(){this.analyticsRx=u(ro),this.filterStore=u(tt),this.layout=u(ne),this.locationRx=u(Le),this.queryParams=u(yn),this.routingService=u(co),this.surveyRx=u(ye),this.dateRangeSub=new Ve(null),this.dateRange$=this.dateRangeSub.asObservable(),this.compareDateRangeSub=new Ve(null),this.answersResponseSub=new Ve(null),this.answersPaginationTokenSub=new Ve(null),this.defaultFormControlValues={},this.loadingStateSub=new Ve(Ko),this.loadingState$=this.loadingStateSub.asObservable(),this.loading$=this.loadingState$.pipe(d(e=>Object.values(F({},e)).some(t=>t===!0))),this.reportingGroupKeyAndValue$=D([this.locationRx.locationId$]).pipe(d(([e])=>({key:"locationId",value:[e]}))),this.presetSurveyIds$=this.filterStore.values$.pipe(k(e=>!e||!e.surveyIds||e.surveyIds.length===0?Z([]):this.surveyRx.surveys$.pipe(d(t=>t.filter(o=>e.surveyIds?.includes(o.id)).map(o=>o.presetSurveyId??qe)??[])))),this.resourceAndServiceFilters$=this.filterStore.values$.pipe(d(e=>{let t=[];return e.resourceIds&&e.resourceIds.length>0&&t.push({key:"resourceId",operator:"in",value:e.resourceIds}),e.serviceIds&&e.serviceIds.length>0&&t.push({key:"serviceId",operator:"in",value:e.serviceIds}),t}),R((e,t)=>H(e,t)),Y({refCount:!0,bufferSize:1})),this.surveyIdFilters$=this.filterStore.values$.pipe(d(e=>{let t=[];return e.surveyIds&&e.surveyIds.length>0&&t.push({key:"surveyId",operator:"in",value:e.surveyIds}),t}),R((e,t)=>H(e,t)),Y({refCount:!0,bufferSize:1})),this.presetSurveyIdFilters$=this.presetSurveyIds$.pipe(d(e=>{let t=[];return e&&e.length>0&&t.push({key:"presetSurveyId",operator:"in",value:e}),t}),R((e,t)=>H(e,t)),Y({refCount:!0,bufferSize:1})),this.metricFilters$=D([this.resourceAndServiceFilters$,this.surveyIdFilters$]).pipe(d(([e,t])=>[...e,...t]),R((e,t)=>H(e,t)),Y({refCount:!0,bufferSize:1})),this.answersFilters$=D([this.resourceAndServiceFilters$,this.presetSurveyIdFilters$]).pipe(d(([e,t])=>[...e,...t,ft]),R((e,t)=>H(e,t)),Y({refCount:!0,bufferSize:1})),this.responseTrendData$=D([this.dateRange$,this.reportingGroupKeyAndValue$,this.metricFilters$]).pipe(this.updateLoadingState("responseTrendData",!0),k(([e,t,n])=>{if(!ae(e))return Z(null);let o=[],a=Li(e.end,e.start);return a<=31?o.push("surveyAnswerDate"):a<=180?o.push("weekStarting"):o.push("month"),this.analyticsRx.getAnalyticsCsatData(e.start,e.end,t.key,t.value,o,[...n,ft],["numSurveyAnswers","avgCsatScore"])}),this.updateLoadingState("responseTrendData",!1),Y({refCount:!0,bufferSize:1})),this.metricsReportData$=D([this.dateRange$,this.reportingGroupKeyAndValue$,this.metricFilters$]).pipe(this.updateLoadingState("metricsReportData",!0),k(([e,t,n])=>ae(e)?this.analyticsRx.getReportData(e.start,e.end,t.key,t.value,n,[],["numSurveysSent"]):Z(null)),this.updateLoadingState("metricsReportData",!1),Y({refCount:!0,bufferSize:1})),this.metricsSurveyData$=D([this.dateRange$,this.reportingGroupKeyAndValue$,this.metricFilters$]).pipe(this.updateLoadingState("metricsSurveyData",!0),k(([e,t,n])=>ae(e)?this.analyticsRx.getSurveyMetrics(e.start,e.end,t.key,t.value,[...n,ft]):Z(null)),this.updateLoadingState("metricsSurveyData",!1),Y({refCount:!0,bufferSize:1})),this.questionsData$=D([this.dateRange$,this.reportingGroupKeyAndValue$,this.metricFilters$]).pipe(this.updateLoadingState("questionsData",!0),k(([e,t,n])=>ae(e)?this.analyticsRx.getSurveyQuestionsData(e.start,e.end,t.key,t.value,[...n,{key:"surveyQuestionInputType",operator:"!=",value:"TEXTAREA"},ft]):Z(null)),this.updateLoadingState("questionsData",!1),Y({refCount:!0,bufferSize:1})),this.answersVariables$=D([this.dateRange$,this.answersFilters$,this.reportingGroupKeyAndValue$]).pipe(Oe(([e])=>ae(e)),ht(()=>this.answersPaginationTokenSub.next(null)),ht(()=>this.answersResponseSub.next(null)),R((e,t)=>H(e,t)),Y({refCount:!0,bufferSize:1})),this.answers$=this.answersVariables$.pipe(this.updateLoadingState("answersData",!0),k(([e,t,n])=>ae(e)?this.answersPaginationTokenSub.pipe(this.updateLoadingState("moreAnswersData",!0),k(o=>this.analyticsRx.getCsatAnswers(e.start,e.end,n.key,n.value,t,Ho,o??void 0).pipe(d(a=>{if(a){let w=this.answersResponseSub.value?.data??[],h=a?.data??[],g=[...w,...h],W=O(F({},a),{data:g});this.answersResponseSub.next(W)}else this.answersResponseSub.next(null);return this.answersResponseSub.value}
1)))):Z(null)),this.updateLoadingState("answersData",!1),this.updateLoadingState("moreAnswersData",!1),Y({refCount:!0,bufferSize:1})),this.subscribeToLocationChanges(),this.subscribeToFeatureChanged()}setAnswersPaginationToken(e){this.answersPaginationTokenSub.next(e)}setLoadingState(e,t){this.loadingStateSub.next(O(F({},this.loadingStateSub.value),{[e]:t}))}setDateRange(e,t){this.dateRangeSub.next(e),this.compareDateRangeSub.next(this.getCompareDateRange(e)),t&&e&&ae(e)?(Lt(je,t),Lt(Qe,Be(e.start)),Lt(Xe,Be(e.end))):(Ae(je),Ae(Qe),Ae(Xe))}getInitialFormControlValue(e,t,n){return this.defaultFormControlValues[e]=t,this.queryParams.get(e,t,n)}persistFormControlValue(e,t){if(this.defaultFormControlValues[e]===t){this.queryParams.update({remove:[e]});return}this.queryParams.set(e,t,{navigation:"replace",disableEmitEvent:!0})}openSurveyAnswerViewer(e){this.layout.open({component:{type:vt,inputs:{entityId:e,disableEntityUpdates:!0}},isEqualInputs:(t,n)=>t?.entityId===n?.entityId})}openSurveyAnswerVisitViewer(e,t){this.layout.open({component:{type:Vo,inputs:{entityId:e,disableEntityUpdates:!0}}}),this.layout.openNext({component:{type:vt,inputs:{entityId:t,disableEntityUpdates:!0}}})}updateLoadingState(e,t){return n=>n.pipe(ht(()=>this.setLoadingState(e,t)),Hi(()=>this.setLoadingState(e,!1)))}subscribeToLocationChanges(){this.locationRx.locationChanged$.subscribe(()=>{this.loadingStateSub.next(Ko)})}subscribeToFeatureChanged(){this.routingService.featureChanged$.subscribe(([e,t])=>{e!==t&&e==="surveys"&&(Ae(je),Ae(Qe),Ae(Xe))})}getCompareDateRange(e){if(ae(e)){let t=Li(e.end,e.start);return{start:ut(e.start,t+1),end:ut(e.end,t+1)}}return null}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=Re({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Jo={1:"red2",2:"red2",3:"black",4:"green2",5:"green2"},Zo={1:"red2",2:"red2",3:"lightGrey",4:"green2",5:"green2"},er={1:!0,2:!0,3:!1,4:!0,5:!0};function wr(i,s){i&1&&(l(0,"ww-card",1),y(1,"ww-chart-layout-placeholder"),c()),i&2&&p("bordered",!0)}function Sr(i,s){if(i&1){let e=Q();l(0,"div",5)(1,"ww-link",6),M("click",function(){U(e);let n=m(2);return P(n.fetchRows.emit())}),l(2,"span"),I(3,0),c()()()}if(i&2){m();let e=x(2);r(),p("disabled",e??!1)("wwColor",e?"darkGrey":"black")}}function fr(i,s){if(i&1){let e=Q();b(0),_(1,"async"),b(2),_(3,"async"),l(4,"ww-card",3)(5,"ww-table",4),_(6,"async"),_(7,"async"),M("rowClicked",function(n){U(e);let o=m();return P(o.onRowClicked(n))}),c(),S(8,Sr,4,2,"div",5),_(9,"async"),c()}if(i&2){let e=m(),t=v(1,9,e.rows$);r(2);let n=$(v(3,11,e.loadingRows$));r(2),Rt("!hidden",!n&&t&&t.length===0),p("bordered",!0),r(),p("columns",v(6,14,e.columns$))("data",t)("loading",n)("pluckCellLabel",v(7,16,e.pluckCellLabel$))("withPointerStyles",!0),r(3),f(v(9,18,e.hasMoreRows$)?8:-1)}}var wi=(()=>{class i extends z{constructor(){super(...arguments),this.commonDisplay=u(Ro),this.resourceRx=u(Zt),this.serviceRx=u(ti),this.surveysService=u(ue),this.loading=null,this.loading$=this.observe("loading"),this.rows=null,this.rows$=this.observe("rows"),this.loadingRows=null,this.loadingRows$=this.observe("loadingRows"),this.hasMoreRows=null,this.hasMoreRows$=this.observe("hasMoreRows"),this.fetchRows=new Te,this.columns$=D([this.resourceRx.hasSelectableResources$,this.serviceRx.hasSelectableServices$]).pipe(d(([e,t])=>{let n=[{key:"date",label:$localize`Date`},{key:"score",label:$localize`Score`},{key:"feedback",label:$localize`Feedback`},{key:"survey",label:$localize`Survey`}];return t&&n.push({key:"service",label:$localize`Service`}),e&&n.push({key:"resource",label:$localize`Resource`}),n}),this.shareReplay()),this.title=$localize`Responses`,this.pluckCellLabel$=this.columns$.pipe(d(e=>t=>e.reduce((n,o)=>{if(o.key==="date"){let a=t[o.key];return Se(a)?O(F({},n),{[o.key]:this.commonDisplay.displayDate(a)}):n}if(o.key==="score"){let a=ce(t[o.key]);if(!wn(a)||a<1||a>5)return n;let w=Jo[a],h=Ot(Zo[a]),g=er[a]?`${h}1a`:h;return O(F({},n),{[o.key]:Bt({size:"small",component:a,backgroundColor:g,color:w,$element:{classList:["!inline-flex"]}})})}return O(F({},n),{[o.key]:t[o.key]})},{})))}onRowClicked(e){let t=e.id;Se(t)&&this.surveysService.openSurveyAnswerViewer(t)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-overview-answers-table"]],hostAttrs:[1,"ww-surveys-overview-answers-table"],inputs:{loading:"loading",rows:"rows",loadingRows:"loadingRows",hasMoreRows:"hasMoreRows"},outputs:{fetchRows:"fetchRows"},standalone:!1,features:[V],decls:4,vars:3,consts:()=>{let e;return e=$localize`Show more`,[e,[1,"flex","items-center","justify-center","min-h-[360px]",3,"bordered"],[1,"flex","flex-col","p-2","px-4",3,"!hidden","bordered"],[1,"flex","flex-col","p-2","px-4",3,"bordered"],[3,"rowClicked","columns","data","loading","pluckCellLabel","withPointerStyles"],[1,"flex","justify-center","gap-2","w-full","h-9"],["type","internal-in-same-tab",3,"click","disabled","wwColor"]]},template:function(t,n){if(t&1&&(b(0),_(1,"async"),S(2,wr,2,1,"ww-card",1)(3,fr,10,20,"ww-card",2)),t&2){let o=v(1,1,n.loading$);r(2),f(o?2:3)}},dependencies:[li,ve,se,jt,Qt,L],styles:[`.ww-surveys-overview-answers-table{width:100%}.ww-surveys-overview-answers-table:empty{display:none}.ww-surveys-overview-answers-table .ww-table .mat-mdc-cell{font-family:var(--ww-typography-body1-font-family);font-size:var(--ww-typography-body1-font-size);font-weight:var(--ww-typography-body1-font-weight);line-height:var(--ww-typography-body1-line-height);letter-spacing:var(--ww-typography-body1-letter-spacing)}.ww-surveys-overview-answers-table .ww-table .mat-mdc-cell ww-display-date{font-family:var(--ww-typography-body1-font-family);font-size:var(--ww-typography-body1-font-size);font-weight:var(--ww-typography-body1-font-weight);line-height:var(--ww-typography-body1-line-height);letter-spacing:var(--ww-typography-body1-letter-spacing);font-weight:400}.ww-surveys-overview-answers-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}.ww-surveys-overview-answers-table .ww-table .mat-mdc-header-row.mat-mdc-header-row .mat-mdc-header-cell .ww-table-header-cell-content{text-transform:uppercase}.ww-surveys-overview-answers-table .ww-table .mat-mdc-header-row.mat-mdc-header-row .mat-mdc-header-cell:last-child .ww-table-header-cell-content{justify-content:flex-start}.ww-surveys-overview-answers-table .ww-table .mat-mdc-table.mat-mdc-table .mat-mdc-header-cell{border-top:0} 2/*noopsurveys-overview-answers-table.component-A5GYQVXW.css.map */ 3`],encapsulation:2,changeDetection:0})}}return i})();
3function hr(i,s){if(i&1&&y(0,"ww-canvas-chart",1),i&2){m();let e=x(3);p("data",e.data)("options",e.options)("plugins",e.plugins)("type","bar")}}var Si=(()=>{class i{constructor(){this.datePipe=u(bt),this.surveysService=u(ue),this.title=$localize`Responses`,this.loading$=this.surveysService.loadingState$.pipe(d(e=>e.responseTrendData||e.metricsReportData||e.metricsSurveyData),R(),Y({bufferSize:1,refCount:!0})),this.response$=this.surveysService.responseTrendData$.pipe(R((e,t)=>H(e,t)),Y({bufferSize:1,refCount:!0})),this.dataMap$=this.response$.pipe(d(e=>this.createDataMap(e))),this.chart$=this.dataMap$.pipe(d(e=>this.createChart(e.period,e.responses,e.labels)))}createDataMap(e){let t=e?.dimensions?.[0];if(!e||!we(t))return{responses:[],avgScore:[],labels:[],hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],period:"surveyAnswerDate",pluckCellLabel:null};let n=[{key:"responses",label:$localize`Responses`,color:ge["csat-responses"]}],o=[{key:"period",label:$localize`Period`,sortable:!0},{key:"responses",label:$localize`Responses`,sortable:!0}],a=ie(e?.data).filter(C=>t==="weekStarting"?(C.weekStarting??"").length>0:t==="month"?(C.month??"").length>0:(C.surveyAnswerDate??"").length>0),w=Xt(a,t,e.fromDate,e.toDate,e.weekdayStart),h=w.map(C=>t==="weekStarting"?C.weekStarting:t==="month"?`${C.month??"2020-01"}-01`:C.surveyAnswerDate).map(C=>`${C}T00:00`),g=w.map(C=>{let K=C.surveyAnswerDate,me="shortDate";return t==="weekStarting"?(K=C.weekStarting,me="shortDate"):t==="month"&&(K=`${C.month??"2020-01"}-01`,me="yyyy MMM"),{period:{value:this.datePipe.transform(K,me)??K,sortableValue:K},response:C.numSurveyAnswers,avgScore:C.avgCsatScore}}),W={responses:g.map(C=>C.response),avgScore:g.map(C=>C.avgScore),labels:h,legendItems:n,dateRange:`${e.fromDate}-${e.toDate}`,columns:o,rows:g,period:t};return O(F({},W),{hasData:Ft(W.responses)>0,hasInternalPadding:!0,hideLegend:!0})}createChart(e,t,n){let o=Math.max(...t),a=[ui(),Po()],w={datasets:[{data:t,label:$localize`Responses`,backgroundColor:ge["csat-responses"],pointStyle:"rectRounded",pointBackgroun
3dColor:ge["csat-responses"],pointRadius:0,pointHoverRadius:6}],labels:n.map(g=>e==="month"?this.datePipe.transform(g,"LLL yyyy")??"":e==="weekStarting"?this.datePipe.transform(g,"dd MMM")??"":this.datePipe.transform(g,"dd MMM")??"")},h=pi({datasets:{bar:{borderRadius:4,borderSkipped:"bottom",maxBarThickness:32}},scales:{x:{ticks:{autoSkip:!0,maxTicksLimit:12,maxRotation:0}},y:{suggestedMin:0,suggestedMax:Math.ceil(o*1.1),ticks:{stepSize:Math.ceil(o*.1)||1}}}});return{data:w,options:h,plugins:a}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-chart-responses"]],hostAttrs:[1,"ww-surveys-chart-responses","p-4"],standalone:!1,decls:6,vars:12,consts:[[3,"chartTitle","loading","dataMap","withoutCardLayout"],[3,"data","options","plugins","type"]],template:function(t,n){if(t&1&&(l(0,"ww-chart-layout",0),_(1,"async"),_(2,"async"),b(3),_(4,"async"),S(5,hr,1,4,"ww-canvas-chart",1),c()),t&2){p("chartTitle",n.title)("loading",v(1,5,n.loading$))("dataMap",v(2,7,n.dataMap$))("withoutCardLayout",!0),r(3);let o=$(v(4,9,n.chart$));r(2),f(o?5:-1)}},dependencies:[Je,ci,L],encapsulation:2,changeDetection:0})}}return i})();function gr(i,s){if(i&1&&y(0,"ww-canvas-chart",1),i&2){m();let e=x(3);p("data",e.data)("options",e.options)("plugins",e.plugins)("type","line")}}var fi=(()=>{class i{constructor(){this.datePipe=u(bt),this.surveysService=u(ue),this.title=$localize`Satisfaction score`,this.loading$=this.surveysService.loadingState$.pipe(d(e=>e.responseTrendData||e.metricsReportData||e.metricsSurveyData),R(),Y({bufferSize:1,refCount:!0})),this.response$=this.surveysService.responseTrendData$.pipe(R((e,t)=>H(e,t)),Y({bufferSize:1,refCount:!0})),this.dataMap$=this.response$.pipe(d(e=>this.createDataMap(e)),Y({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(d(e=>this.createChart(e.period,e.avgScore,e.labels)),Y({bufferSize:1,refCount:!0}))}createDataMap(e){let t=e?.dimensions?.[0];if(!e||!we(t))return{avgScore:[],labels:[],hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],period:"surveyAnswerDate",pluckCellLabel:null};let n=[{key:"avgScore",label:$localize`Avg score`,color:ge["csat-avg-score"]}],o=[{key:"period",label:$localize`Period`,sortable:!0},{key:"avgScore",label:$localize`Avg score`,sortable:!0}],a=ie(e?.data).filter(C=>t==="weekStarting"?(C.weekStarting??"").length>0:t==="month"?(C.month??"").length>0:(C.surveyAnswerDate??"").length>0),w=Xt(a,t,e.fromDate,e.toDate,e.weekdayStart),h=w.map(C=>t==="weekStarting"?C.weekStarting:t==="month"?`${C.month??"2020-01"}-01`:C.surveyAnswerDate).map(C=>`${C}T00:00`),g=w.map(C=>{let K=C.surveyAnswerDate,me="shortDate";return t==="weekStarting"?(K=C.weekStarting,me="shortDate"):t==="month"&&(K=`${C.month??"2020-01"}-01`,me="yyyy MMM"),{period:{value:this.datePipe.transform(K,me)??K,sortableValue:K},response:C.numSurveyAnswers,avgScore:C.avgCsatScore}}),W={avgScore:g.map(C=>C.avgScore),labels:h,legendItems:n,dateRange:`${e.fromDate}-${e.toDate}`,columns:o,rows:g,period:t};return O(F({},W),{hasData:Ft(W.avgScore)>0,hasInternalPadding:!0,hideLegend:!0})}createChart(e,t,n){let o=[ui()],a={datasets:[{data:t,label:$localize`Avg score`,borderColor:ge["csat-avg-score"],fill:"origin",cubicInterpolationMode:"monotone",backgroundColor:Yo(ge["csat-avg-score"]),pointStyle:"rectRounded",pointBackgroun
3dColor:ge["csat-avg-score"],pointRadius:0,pointHoverRadius:6}],labels:n.map(h=>e==="month"?this.datePipe.transform(h,"LLL yyyy")??"":e==="weekStarting"?this.datePipe.transform(h,"dd MMM")??"":this.datePipe.transform(h,"dd MMM")??"")},w=pi({elements:{line:{tension:.5}},plugins:{tooltip:{callbacks:{label:h=>{let g=h.dataset.label,W=h.raw;return`${g}: ${(W??0).toFixed(1)}`}}}},scales:{x:{ticks:{autoSkip:!0,maxTicksLimit:12,maxRotation:0}},y:{min:-.25,max:5.25,ticks:{stepSize:1,includeBounds:!1}}}});return{data:a,options:w,plugins:o}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-chart-satisfaction-score"]],hostAttrs:[1,"ww-surveys-chart-satisfaction-score","p-4"],standalone:!1,decls:6,vars:12,consts:[[3,"chartTitle","loading","dataMap","withoutCardLayout"],[3,"data","options","plugins","type"]],template:function(t,n){if(t&1&&(l(0,"ww-chart-layout",0),_(1,"async"),_(2,"async"),b(3),_(4,"async"),S(5,gr,1,4,"ww-canvas-chart",1),c()),t&2){p("chartTitle",n.title)("loading",v(1,5,n.loading$))("dataMap",v(2,7,n.dataMap$))("withoutCardLayout",!0),r(3);let o=$(v(4,9,n.chart$));r(2),f(o?5:-1)}},dependencies:[Je,ci,L],encapsulation:2,changeDetection:0})}}return i})();function Tr(i,s){if(i&1&&y(0,"ww-date-range-picker",0),i&2){let e=m(),t=x(0),n=x(2);p("filters",n)("formControl",e.dateRangeFormControl)("min",t)("wwTypography","button")("size","full")}}var vi=(()=>{class i extends z{constructor(){super(),this.breakpoints=u($e),this.accountRx=u(He),this.eventLogger=u(ii),this.surveysService=u(ue),this.defaultMinDate=new Date(2023,0,1),this.defaultFilters=[Mn,kn,Nn,Wn,Ai,Pn,Un,Vi,Bn],this.dateRangeFormControl=new oe(null),this.maxAnalyticsHistoricalDays$=this.accountRx.getAccount(["features"]).pipe(d(e=>e.features.maxAnalyticsHistoricalDays)),this.minDate$=this.maxAnalyticsHistoricalDays$.pipe(d(e=>e?ut(Oi(),e-1):this.defaultMinDate)),this.filters$=this.minDate$.pipe(d(e=>this.defaultFilters.filter(t=>t.createDateRange().start.getTime()>=e.getTime()))),this.dateRange$=Pe(this.dateRangeFormControl).pipe(Oe(ae),Oe(e=>e.start.getTime()<=e.end.getTime())),this.subscribeToDateRange()}subscribeToDateRange(){this.dateRange$.pipe(Ee(this.ngOnDestroy$)).subscribe(e=>{let t=this.defaultFilters.find(n=>H(n.createDateRange(),e));t&&t.id===Vi.id?this.surveysService.setDateRange({start:hn(new Date),end:Oi()}
3,t.id):this.surveysService.setDateRange(e,t?.id??dt.id),this.eventLogger.log("updated_surveys_date_range",{params:{range:t?.id??dt.id}}),t&&t.id!==dt.id?(this.surveysService.persistFormControlValue("date-preset",t.id),this.surveysService.persistFormControlValue("date-start",null),this.surveysService.persistFormControlValue("date-end",null)):(this.surveysService.persistFormControlValue("date-preset",null),this.surveysService.persistFormControlValue("date-start",Be(e.start)),this.surveysService.persistFormControlValue("date-end",Be(e.end)))})}syncDateRangeFormControlWithQueryParamsAndSessionStorage(){let e=this.surveysService.getInitialFormControlValue("date-preset",null,Se),t=this.surveysService.getInitialFormControlValue("date-start",null,Se),n=this.surveysService.getInitialFormControlValue("date-end",null,Se);if(t&<(t)&&n&<(n)){this.dateRangeFormControl.setValue({start:ct(t),end:ct(n)});return}if(e){let h=this.defaultFilters.find(g=>g.id===e);if(h){let g=h.createDateRange();this.dateRangeFormControl.setValue(g);return}}let o=$t(je,null,Se);if(o===dt.id){let h=$t(Qe,null,Se),g=$t(Xe,null,Se);if(h&<(h)&&g&<(g)){this.dateRangeFormControl.setValue({start:ct(h),end:ct(g)});return}}let a=this.defaultFilters.find(h=>h.id===o);if(a){let h=a.createDateRange();this.dateRangeFormControl.setValue(h);return}let w=Ai.createDateRange();this.dateRangeFormControl.setValue(w)}ngOnInit(){this.syncDateRangeFormControlWithQueryParamsAndSessionStorage()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-date-range-picker"]],hostAttrs:[1,"ww-surveys-date-range-picker"],standalone:!1,features:[V],decls:5,vars:7,consts:[[1,"ww-surveys-date-range-picker-component",3,"filters","formControl","min","wwTypography","size"]],template:function(t,n){if(t&1&&(b(0),_(1,"async"),b(2),_(3,"async"),S(4,Tr,1,5,"ww-date-range-picker",0)),t&2){let o=$(v(1,1,n.minDate$));r(2);let a=$(v(3,4,n.filters$));r(2),f(o&&a?4:-1)}},dependencies:[ke,Ue,Yn,kt,L],styles:[`.ww-surveys-date-range-picker{display:block}.ww-breakpoints-below-small .ww-surveys-date-range-picker{width:100%}.ww-surveys-date-range-picker .ww-surveys-date-range-picker-component{display:block;min-width:160px} 4/*noopsurveys-date-range-picker.component-7IBCHJB6.css.map */ 5`],encapsulation:2,changeDetection:0})}}return i})();var Ze=(()=>{class i extends z{constructor(){super(...arguments),this.filterStore=u(tt),this.pluckLabel=null,this.pluckLabel$=this.observe("pluckLabel"),this.label$=this.pluckLabel$.pipe(k(e=>e?this.filterStore.values$.pipe(d(t=>e(t))):Z(null)))}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-filter-trigger"]],hostAttrs:[1,"ww-surveys-filter-trigger"],inputs:{pluckLabel:"pluckLabel"},standalone:!1,features:[V],decls:5,vars:4,consts:[[1,"ww-surveys-filter-trigger-button",3,"wwButton"],["icon","bx-chevron-down"]],template:function(t,n){t&1&&(l(0,"button",0)(1,"span"),A(2),_(3,"async"),c(),y(4,"ww-icon",1),c()),t&2&&(p("wwButton","secondary"),r(2),G(v(3,2,n.label$)))},dependencies:[re,fe,L],styles:[`.ww-surveys-filter-trigger{display:block;min-width:160px}.ww-surveys-filter-trigger .ww-surveys-filter-trigger-button{display:flex;justify-content:space-between;width:100%} 6/*noopsurveys-filter-trigger.component-BBNOJIWL.css.map */ 7`],encapsulation:2,changeDetection:0})}}return i})();function $r(i,s){i&1&&y(0,"ww-skeleton-placeholder",1),i&2&&p("height",30)("width",75)}function Lr(i,s){if(i&1&&(l(0,"ww-metric-value"),A(1),c()),i&2){let e=m();r(),Tt("",e.value(),"",e.valueSuffix())}}var hi=(()=>{class i{constructor(){this.loading=_e(!0),this.title=_e(""),this.value=_e(null),this.valueSuffix=_e(null)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-overview-metric"]],hostAttrs:[1,"ww-surveys-overview-metric"],inputs:{loading:[1,"loading"],title:[1,"title"],value:[1,"value"],valueSuffix:[1,"valueSuffix"]},standalone:!1,decls:7,vars:3,consts:[[3,"padding"],[3,"height","width"]],template:function(t,n){t&1&&(l(0,"ww-section")(1,"ww-section-content",0)(2,"ww-metric")(3,"ww-metric-title"),A(4),c(),S(5,$r,1,2,"ww-skeleton-placeholder",1)(6,Lr,2,2,"ww-metric-value"),c()()()),t&2&&(r(),p("padding","none"),r(3),G(n.title()),r(),f(n.loading()?5:6))},dependencies:[No,Mo,Wo,qt,zt,B],encapsulation:2,changeDetection:0})}}return i})();var Dr=()=>[],Ar=(i,s)=>s.label;
7function Vr(i,s){if(i&1&&(l(0,"div",8)(1,"div",9)(2,"div"),A(3),c(),l(4,"div",10),A(5),_(6,"number"),c()(),l(7,"div",11),y(8,"div",12),c()()),i&2){let e=s.$implicit;r(3),Tt("",e.label,"",e.labelSuffix),r(2),Ie(" ",rn(6,6,e.percent,"1.0-0"),"% "),r(3),on("width",e.percent,"%"),p("wwBackgroundColor",e.color)}}function Mr(i,s){if(i&1&&(l(0,"div",7),q(1,Vr,9,9,"div",8,Ar),c()),i&2){let e=m();r(),j(e.values())}}function Wr(i,s){if(i&1&&(l(0,"div",13),y(1,"ww-canvas-chart",14),c()),i&2){m();let e=x(0);r(),p("data",e.data)("options",e.options)("plugins",e.plugins??Ne(4,Dr))("type",e.type)}}function Nr(i,s){if(i&1&&(b(0),S(1,Wr,2,5,"div",13)),i&2){let e=$(m().donutChartOptions());r(),f(e?1:-1)}}var Ci=(()=>{class i extends z{constructor(){super(...arguments),this.title=_e(""),this.count=_e(0),this.type=_e("bars"),this.values=_e([]),this.countLabel=$i(()=>fn($localize`response`,this.count(),$localize`responses`)),this.donutChartOptions=$i(()=>{if(this.type()!=="donut")return null;let e=this.values(),t=e.map(n=>xn(n.color)?Ot(n.color):n.color);return Bo(e.map(n=>n.count),t,e.map(n=>n.label))})}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-overview-question-chart"]],hostAttrs:[1,"ww-surveys-overview-question-chart"],inputs:{title:[1,"title"],count:[1,"count"],type:[1,"type"],values:[1,"values"]},standalone:!1,features:[V],decls:10,vars:7,consts:()=>{let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD1\uFFFD"}:INTERPOLATION_1:`,[e,[1,"flex","flex-col","gap-4","p-4","min-h-full",3,"bordered"],[1,"flex","flex-col","gap-2"],[1,"ww-surveys-overview-question-chart-title"],[1,"flex"],["size","x-small"],[1,"w-full","h-px","border-b",3,"wwBorderColor"],[1,"flex","flex-col","gap-4","p-4","pt-0"],[1,"flex","flex-col","gap-1"],[1,"ww-surveys-overview-question-chart-value","flex","justify-between"],["wwColor","darkerGrey"],["wwBackgroundColor","lightGrey",1,"flex","w-full","rounded"],[1,"h-2","rounded",3,"wwBackgroundColor"],[1,"flex","items-center","justify-center","w-full","h-full","min-h-56"],[3,"data","options","plugins","type"]]},template:function(t,n){t&1&&(l(0,"ww-card",1)(1,"div",2)(2,"div",3),A(3),c(),l(4,"div",4)(5,"ww-chip",5),I(6,0),c()()(),y(7,"div",6),S(8,Mr,3,0,"div",7),S(9,Nr,2,2),c()),t&2&&(p("bordered",!0),r(3),G(n.title()),r(3),Me(n.count())(n.countLabel()),We(6),r(),p("wwBorderColor","mediumGrey"),r(),f(n.type()==="bars"?8:-1),r(),f(n.type()==="donut"?9:-1))},dependencies:[Je,ve,Dn,se,It],styles:[`.ww-surveys-overview-question-chart{min-height:360px}.ww-surveys-overview-question-chart .ww-surveys-overview-question-chart-title{font-family:var(--ww-typography-h5-font-family);font-size:var(--ww-typography-h5-font-size);font-weight:var(--ww-typography-h5-font-weight);line-height:var(--ww-typography-h5-line-height);letter-spacing:var(--ww-typography-h5-letter-spacing);font-weight:500}.ww-surveys-overview-question-chart .ww-surveys-overview-question-chart-value{font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing);font-weight:500} 8/*noopsurveys-overview-question-chart.component-WBUL4KMK.css.map */ 9`],encapsulation:2,changeDetection:0})}}return i})();var Pr=(i,s)=>s.key;function Br(i,s){i&1&&de(0)}function Yr(i,s){i&1&&de(0)}function Gr(i,s){if(i&1&&(l(0,"ww-display-object-key"),X(1,Br,1,0,"ng-container",4),c(),l(2,"ww-display-object-value"),X(3,Yr,1,0,"ng-container",4),c()),i&2){let e=s.$implicit;r(),p("wwOutlet",e.label),r(2),p("wwOutlet",e.component)}}function zr(i,s){i&1&&(l(0,"ww-display-object"),q(1,Gr,4,2,null,null,Pr),c()),i&2&&(r(),j(s))}function qr(i,s){i&1&&(l(0,"div",3),y(1,"mat-spinner"),c())}var jr=bn(Ye),vt=(()=>{class i extends jr{constructor(){super(...arguments),this.coreSurveyRx=u(ri),this.layout=u(ne),this.surveyAnswerProperties=u(Uo),this.surveysService=u(ue),this._entityApi=e=>this.coreSurveyRx.getAnswer(e),this.properties$=this._entity$.pipe(k(e=>this.surveyAnswerProperties.getProperties(e)),d(e=>io(e,{visitId:{display:t=>jn({type:"internal-in-same-tab",content:t.visit.id,$element:{color:"black",eventListeners:{click:n=>{n.preventDefault(),this.surveysService.openSurveyAnswerVisitViewer(t.visit.id,t.id)}}}})}}))),this.labelledComponents$=this._entity$.pipe(k(e=>e?this.properties$.pipe(d(t=>Eo(e,Object.values(t),[]))):Z([])))}close(){this.layout.close()}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-survey-answer-viewer"]],hostAttrs:[1,"ww-survey-answer-viewer"],inputs:{entity:"entity",entityId:"entityId",disableEntityUpdates:"disableEntityUpdates"},standalone:!1,features:[V],decls:12,vars:8,consts:[["wwButton","tert
9iary",3,"click","ariaLabel"],["icon","bx-x"],[3,"padding"],[1,"flex","justify-center","w-full"],[4,"wwOutlet"]],template:function(t,n){if(t&1&&(l(0,"ww-section"),b(1),_(2,"async"),l(3,"ww-section-title")(4,"span"),A(5),c(),l(6,"button",0),M("click",function(){return n.close()}),y(7,"ww-icon",1),c()(),l(8,"ww-section-content",2),S(9,zr,3,0,"ww-display-object"),_(10,"async"),he(11,qr,2,0,"div",3),c()()),t&2){let o,a=v(2,4,n._entity$);r(5),G(a==null?null:a.presetSurveyId),r(),p("ariaLabel","Close"),r(2),p("padding","large"),r(),f((o=v(10,6,n.labelledComponents$))?9:11,o)}},dependencies:[Ut,re,qn,Gn,zn,fe,Ge,qt,zt,Vn,L],encapsulation:2,changeDetection:0})}}return i})();function Qr(i,s){i&1&&(l(0,"div",2)(1,"div",4),y(2,"ww-icon",5),c(),l(3,"span",6),I(4,0),c()())}function Xr(i,s){i&1&&(l(0,"div",3)(1,"div",7),y(2,"ww-icon",8),c(),l(3,"span"),I(4,1),c()())}var et=(()=>{class i{constructor(){this.active=!1}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-status-indicator"]],hostAttrs:[1,"ww-surveys-status-indicator"],inputs:{active:"active"},standalone:!1,decls:2,vars:1,consts:()=>{let e;e=$localize`Active`;let t;return t=$localize`Inactive`,[e,t,[1,"flex","items-center","gap-1"],[1,"flex","items-center","gap-2"],["wwBackgroundColor","success-alpha-20",1,"rounded-full","p-0.5"],["icon","bxs-circle","wwColor","success","size","x-small"],["wwColor","darkerGrey"],["wwBackgroundColor","lightGrey",1,"rounded-full","p-0.5"],["icon","bxs-minus-circle","wwColor","darkGrey","size","x-small"]]},template:function(t,n){t&1&&S(0,Qr,5,0,"div",2)(1,Xr,5,0,"div",3),t&2&&f(n.active?0:1)},dependencies:[se,fe],encapsulation:2,changeDetection:0})}}return i})();function Jr(i,s){i&1&&y(0,"ww-illustration",2),i&2&&p("icon","ww-surveys-preset-active")}function Zr(i,s){i&1&&y(0,"ww-illustration",2),i&2&&p("icon","ww-surveys-preset-inactive")}function es(i,s){i&1&&y(0,"ww-account-feature-icon")}function ts(i,s){if(i&1&&y(0,"ww-surveys-status-indicator",7),i&2){let e=m();p("active",e.active)}}var gi=(()=>{class i{constructor(){this.breakpoints=u($e),this.dialog=u(Gt),this.router=u(Fe),this.active=!1,this.locked=!1,this.presetId=null,this.name=null,this.description=null}navigate(){if(this.locked){this.dialog.open(T(vo,{featureName:$localize`Survey addons`,missingAccountFeatures:["enableSurveys"]}),{size:this.breakpoints.isBelowSmall?"bottom-sheet":"auto"});return}this.router.navigate(["/surveys/edit"],{queryParams:{presetId:this.presetId}})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-template"]],hostAttrs:[1,"ww-surveys-template"],inputs:{active:"active",locked:"locked",presetId:"presetId",name:"name",description:"description"},standalone:!1,decls:11,vars:4,consts:[[1,"ww-surveys-template-card",3,"click"],[1,"ww-surveys-template-card-content"],[1,"ww-surveys-template-card-content-image",3,"icon"],[1,"ww-surveys-template-card-details"],[1,"flex","items-center","gap-2"],[1,"ww-surveys-template-card-name"],[1,"ww-surveys-template-card-description"],[3,"active"]],template:function(t,n){t&1&&(l(0,"ww-card",0),M("click",function(){return n.navigate()}),l(1,"div",1),S(2,Jr,1,1,"ww-illustration",2)(3,Zr,1,1,"ww-illustration",2),c(),l(4,"div",3)(5,"div",4)(6,"span",5),A(7),c(),S(8,es,1,0,"ww-account-feature-icon"),c(),l(9,"div",6),S(10,ts,1,1,"ww-surveys-status-indicator",7),c()()()),t&2&&(r(2),f(n.active?2:3),r(5),G(n.name),r(),f(n.locked?8:-1),r(2),f(n.locked?-1:10))},dependencies:[yo,ve,Nt,et],styles:[`.ww-surveys-template{cursor:pointer}.ww-surveys-template .ww-surveys-template-card{display:flex;flex-direction:column;height:256px;width:340px;border-radius:16px}.ww-surveys-template .ww-surveys-template-card .ww-surveys-template-card-content{display:flex;flex:1;overflow:hidden}.ww-breakpoints-below-mobile .ww-surveys-template .ww-surveys-template-card .ww-surveys-template-card-content .ww-surveys-template-card-content-image{width:100%}.ww-breakpoints-below-mobile .ww-surveys-template .ww-surveys-template-card .ww-surveys-template-card-content .ww-surveys-template-card-content-image svg{width:100%;height:auto}.ww-surveys-template .ww-surveys-template-card .ww-surveys-template-card-detail
9s{display:flex;flex-direction:column;padding:16px 16px 16px 20px;gap:4px;border-top:1px solid var(--ww-color-mediumGrey)}.ww-surveys-template .ww-surveys-template-card .ww-surveys-template-card-name{font-family:var(--ww-typography-h5-font-family);font-size:var(--ww-typography-h5-font-size);font-weight:var(--ww-typography-h5-font-weight);line-height:var(--ww-typography-h5-line-height);letter-spacing:var(--ww-typography-h5-letter-spacing)}.ww-surveys-template .ww-surveys-template-card .ww-surveys-template-card-description{display:flex;font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing);color:var(--ww-color-darkerGrey);min-height:20px}.ww-breakpoints-below-mobile .ww-surveys-template .ww-surveys-template-card{width:100%;height:auto}.ww-breakpoints-below-mobile .ww-surveys-template{width:100%} 10/*noopsurvey-template.component-FRIDN5OZ.css.map */ 11`],encapsulation:2,changeDetection:0})}}return i})();var Wi=cr(ur());function ss(i,s){i&1&&de(0)}function as(i,s){i&1&&de(0)}function ls(i,s){if(i&1&&(l(0,"ww-sublabel"),X(1,as,1,0,"ng-container",5),c()),i&2){let e=m(3);r(),p("wwOutlet",e.sublabel)}}function cs(i,s){if(i&1&&(l(0,"ww-label"),X(1,ss,1,0,"ng-container",5),S(2,ls,2,1,"ww-sublabel"),c()),i&2){let e=m(2);r(),p("wwOutlet",e.label),r(),f(e.sublabel?2:-1)}}function us(i,s){i&1&&(xe(0,0,2),y(1,"span"),be())}function ps(i,s){i&1&&I(0,0,3)}function ds(i,s){if(i&1&&(xe(0,0,1),S(1,us,2,0,"span"),S(2,ps,1,0),be()),i&2){let e=s.$implicit,t=s.$index,n=s.$index,o=s.$count;m(2);let a=x(5);r(),f(t>0&&a.length>2?1:-1),r(),f(n===o-1&&n!==0?2:-1),Me(e),We(0)}}function ms(i,s){i&1&&I(0,0,4)}function _s(i,s){i&1&&I(0,0,5)}function ws(i,s){if(i&1&&(l(0,"p",3),xe(1,0),q(2,ds,3,3,null,null,gt),S(4,ms,1,0)(5,_s,1,0),be(),c()),i&2){m();let e=x(5);r(2),j(e),r(2),f(e.length===1?4:5)}}function Ss(i,s){if(i&1){let e=Q();l(0,"ww-i18n-string-input",6),_(1,"async"),M("localeChanged",function(n){U(e);let o=m(2);return P(o.localeChanged.emit(n))}),c()}if(i&2){let e=m(2);p("formControl",e.linkTextFormControl)("locales",e.locales)("selectedLocale",v(1,3,e.selectedLocale$))}}function fs(i,s){if(i&1&&(l(0,"ww-label-layout"),S(1,cs,3,2,"ww-label"),l(2,"div",1)(3,"div"),y(4,"ww-select",2),b(5),_(6,"async"),S(7,ws,6,1,"p",3),c(),S(8,Ss,2,5,"ww-i18n-string-input",4),c()()),i&2){let e=m(),t=x(0);r(),f(e.label?1:-1),r(3),p("layout","vertical")("data",t)("selection","multiple")("formControl",e.includeInFormControl)("pluckLabel",e.pluckLabel),r();let n=$(v(6,8,e.selectedAndDisabledMessageTypes$));r(2),f(n&&n.length>0?7:-1),r(),f(e.includeInFormControl.value&&e.includeInFormControl.value.length>0?8:-1)}}var vs=Dt(Ye),Ei=(()=>{class i extends vs{constructor(){super(...arguments),this.coreLocationRx=u(oi),this.messageConfigRx=u(so),this.locales=null,this.selectedLocale=null,this.selectedLocale$=this.observe("selectedLocale"),this.localeChanged=new Te,this.linkTextFormControl=new oe({value:null,i18n:{}},{validators:[at.required]}),this.includeInFormControl=new oe([]),this.viewValue$=D([Pe(this.linkTextFormControl),Pe(this.includeInFormControl)]).pipe(Oe(()=>this.linkTextFormControl.dirty||this.includeInFormControl.dirty),d(([e,t])=>!e||!t||!t.length?null:{includeIn:t,linkText:e})),this.availableMessageTypes$=this.coreLocationRx.getCurrentNullableLocation(["isBookingActive","isWaitlistActive","bookingManualConfirmation"]).pipe(d(e=>Jn.filter(t=>!(Zn(t)&&!e?.isBookingActive||to(t)&&!e?.bookingManualConfirmation||eo(t)&&!e?.isWaitlistActive))),this.shareReplay()),this.activeEmailMessageTypes$=this.messageConfigRx.messageConfigs$.pipe(d(e=>e.filter(t=>t.channels.includes("EMAIL")).map(t=>t.type)),this.shareReplay()),this.selectedAndDisabledMessageTypes$=D([this.activeEmailMessageTypes$,Pe(this.includeInFormControl)]).pipe(d(([e,t])=>t?t.filter(n=>!e.includes(n)).map(n=>Di[n]):[])),this.pluckLabel=e=>Di[e]}writeValue(e){this.linkTextFormControl.setValue(e?.linkText??{value:"",i18n:{}},{emitEvent:!1}),this.includeInFormControl.setValue(e?.includeIn??[],{emitEvent:!1})}registerOnChange(e){this.viewValue$.pipe(Ee(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-include-in-messages"]],hostAttrs:[1,"ww-surveys-include-in-messages-editor"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoF
11ocus:"autoFocus",locales:"locales",selectedLocale:"selectedLocale"},outputs:{localeChanged:"localeChanged"},standalone:!1,features:[V],decls:3,vars:4,consts:()=>{let e;e=$localize`Add a linked button to the following email templates:`;let t;t=$localize`Button text`;let n;return n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD*1:2\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPAN:,${"\uFFFD/#1:2\uFFFD"}:CLOSE_TAG_SPAN:${"[\uFFFD/*1:2\uFFFD|\uFFFD/*2:3\uFFFD|\uFFFD/*4:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*2:3\uFFFD"}:START_BLOCK_IF_1: and ${"[\uFFFD/*1:2\uFFFD|\uFFFD/*2:3\uFFFD|\uFFFD/*4:4\uFFFD]"}:CLOSE_BLOCK_IF: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD*4:4\uFFFD"}:START_BLOCK_IF_2: is currently not enabled ${"[\uFFFD/*1:2\uFFFD|\uFFFD/*2:3\uFFFD|\uFFFD/*4:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*5:5\uFFFD"}:START_BLOCK_ELSE: are currently not enabled ${"\uFFFD/*5:5\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Et(n),[n,[1,"flex","flex-col","gap-4","pt-2","max-w-full"],["label",e,3,"layout","data","selection","formControl","pluckLabel"],["wwColor","darkerGrey","wwTypography","body2"],["size","large","layout","vertical","label",t,3,"formControl","locales","selectedLocale"],[4,"wwOutlet"],["size","large","layout","vertical","label",t,3,"localeChanged","formControl","locales","selectedLocale"]]},template:function(t,n){if(t&1&&(b(0),_(1,"async"),S(2,fs,9,11,"ww-label-layout")),t&2){let o=$(v(1,1,n.availableMessageTypes$));r(2),f(o&&o.length>0?2:-1)}},dependencies:[ke,Ue,mt,se,Mt,Vt,Wt,Ge,ze,kt,L],encapsulation:2,changeDetection:0})}}return i})();var Mi={EMOJI:{1:"\u{1F620}",2:"\u{1F641}",3:"\u{1F610}",4:"\u{1F60A}",5:"\u{1F604}"},STARS:{1:"\u2B50",2:"\u2B50",3:"\u2B50",4:"\u2B50",5:"\u2B50"}};function ys(i,s){if(i&1&&(l(0,"div",1),A(1),c()),i&2){m();let e=x(1);r(),Ie(" ",e," ")}}function hs(i,s){if(i&1&&(l(0,"button",5),A(1),c()),i&2){let e=s.$implicit;p("disabled",!0),r(),Ie(" ",e," ")}}function Cs(i,s){if(i&1&&(l(0,"div",6)(1,"div",7),A(2),c(),l(3,"div",7),A(4),c()()),i&2){m(2);let e=x(0);r(2),G(e.minValueDescription),r(2),G(e.maxValueDescription)}}function gs(i,s){if(i&1&&(l(0,"div",3)(1,"div",4),q(2,hs,2,2,"button",5,rt),c(),S(4,Cs,5,2,"div",6),c()),i&2){m();let e=x(0);r(2),j(e.entries),r(2),f(e.minValueDescription||e.maxValueDescription?4:-1)}}function Es(i,s){if(i&1&&(b(0),_(1,"async"),S(2,gs,5,1,"div",3)),i&2){let e=$(v(1,1,m(2).numbers$));r(2),f(e?2:-1)}}function Rs(i,s){if(i&1&&(l(0,"button",9),A(1),c()),i&2){let e=s.$implicit;p("disabled",!0),r(),Ie(" ",e," ")}}function Ts(i,s){if(i&1&&(l(0,"div",8),q(1,Rs,2,2,"button",9,rt),c()),i&2){m();let e=x(0);r(),j(e)}}function xs(i,s){if(i&1&&(b(0),_(1,"async"),S(2,Ts,3,0,"div",8)),i&2){let e=$(v(1,1,m(2).choices$));r(2),f(e?2:-1)}}function bs(i,s){if(i&1&&(y(0,"ww-textarea",2),_(1,"async")),i&2){let e=m(2);p("formControl",e.formControl)("placeholder",v(1,2,e.placeholder$))}}function Is(i,s){if(i&1&&(l(0,"div",0),b(1),_(2,"async"),S(3,ys,2,1,"div",1),S(4,Es,3,4),S(5,xs,3,4),S(6,bs,2,4,"ww-textarea",2),c()),i&2){let e=m();r();let t=$(v(2,4,e.displayName$));r(2),f(t?3:-1),r(),f(e.question.inputType==="NUMBER"?4:-1),r(),f(e.question.inputType==="CHOICE"?5:-1),r(),f(e.question.inputType==="TEXTAREA"?6:-1)}}var Fs=Dt(Ye),Ri=(()=>{class i extends Fs{constructor(){super(...arguments),this.question=null,this.locales=null,this.locales$=this.observe("locales"),this.selectedLocale=null,this.selectedLocale$=this.observe("selectedLocale"),this.formControl=new oe(""),this.choices$=this.selectedLocale$.pipe(d(e=>e?this.question?.i18n?.[e]?.inputOptions??this.question?.inputOptions??[]:this.question?.inputOptions??[]),R((e,t)=>H(e,t))),this.numbers$=this.selectedLocale$.pipe(d(e=>{let t=ce(this.question?.minValue),n=ce(this.question?.maxValue),o=[];return t!==null&&n!==null&&(o=Array.from({length:n-t+1},(a,w)=>`${t+w}`),this.question?.numberDisplayType==="EMOJI"?o=o.map(a=>{let w=ce(a)??Number.NaN;return Mi.EMOJI[w]??a}):this.question?.numberDisplayType==="STARS"&&(o=o.map(a=>{let w=ce(a)??Number.NaN;return Mi.STARS[w]??a}
11))),!e||!this.question?.i18n?.[e]?{entries:o,minValue:this.question?.minValue,minValueDescription:this.question?.minValueDescription,maxValue:this.question?.maxValue,maxValueDescription:this.question?.maxValueDescription,numberDisplayType:this.question?.numberDisplayType}:{entries:o,minValue:this.question?.minValue,minValueDescription:this.question.i18n[e].minValueDescription??this.question?.minValueDescription,maxValue:this.question?.maxValue,maxValueDescription:this.question.i18n[e].maxValueDescription??this.question?.maxValueDescription,numberDisplayType:this.question.numberDisplayType}}),R((e,t)=>H(e,t))),this.displayName$=this.selectedLocale$.pipe(d(e=>e?this.question?.i18n?.[e]?.displayName??this.question?.displayName??"":this.question?.displayName??""),R()),this.placeholder$=this.selectedLocale$.pipe(d(e=>e?this.question?.i18n?.[e]?.placeholder??this.question?.placeholder??"":this.question?.placeholder??""),R())}ngOnInit(){this.question&&Kt(this.question.id)&&this.formControl.disable()}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-editor-question-form"]],hostAttrs:[1,"ww-surveys-editor-question-form"],hostVars:2,hostBindings:function(t,n){t&2&&Rt("ww-surveys-editor-question-form-borderless",(n.question==null?null:n.question.inputType)!=="TEXTAREA")},inputs:{question:"question",locales:"locales",selectedLocale:"selectedLocale"},standalone:!1,features:[V],decls:1,vars:1,consts:[["wwFormFieldSize","large",1,"ww-surveys-editor-question-form-content"],[1,"ww-surveys-editor-question-form-title"],[3,"formControl","placeholder"],[1,"flex","flex-col","gap-2"],[1,"flex","items-center","justify-between","gap-3"],["wwButton","secondary",1,"ww-surveys-editor-question-form-number",3,"disabled"],[1,"flex","justify-between"],["wwColor","darkGrey"],[1,"flex","flex-col","gap-3"],["wwButton","secondary",1,"ww-surveys-editor-question-form-choice",3,"disabled"]],template:function(t,n){t&1&&S(0,Is,7,7,"div",0),t&2&&f(n.question?0:-1)},dependencies:[ke,Ue,re,se,Fn,An,L],styles:[`.ww-surveys-editor-question-form .ww-label-layout.ww-label-layout-horizontal{border-bottom:none;padding-bottom:8px}.ww-surveys-editor-question-form .ww-label-layout.ww-label-layout-horizontal .mat-mdc-input-element[disabled]{color:var(--ww-color-black)}.ww-surveys-editor-question-form .ww-surveys-editor-question-form-content{display:flex;flex-direction:column;gap:16px}.ww-surveys-editor-question-form .ww-surveys-editor-question-form-content .ww-surveys-editor-question-form-title{font-family:var(--ww-typography-h5-font-family);font-size:var(--ww-typography-h5-font-size);font-weight:var(--ww-typography-h5-font-weight);line-height:var(--ww-typography-h5-line-height);letter-spacing:var(--ww-typography-h5-letter-spacing)}.ww-surveys-editor-question-form .ww-surveys-editor-question-form-content .ww-surveys-editor-question-form-number{border:1px solid var(--ww-color-darkGrey);font-weight:300;width:100%}.ww-surveys-editor-question-form .ww-surveys-editor-question-form-content .ww-surveys-editor-question-form-choice{border:1px solid var(--ww-color-darkGrey);font-weight:300;justify-content:flex-start;width:100%} 12/*noopsurveys-editor-question-form.component-DRKMAAND.css.map */ 13`],encapsulation:2,changeDetection:0})}}return i})();function Ls(i,s){if(i&1&&(y(0,"ww-surveys-editor-question-form",4),_(1,"async"),_(2,"async")),i&2){let e=s.$implicit,t=m();p("question",e)("locales",v(1,3,t.locales$))("selectedLocale",v(2,5,t.selectedLocale$))}}var Ti=(()=>{class i extends z{constructor(){super(...arguments),this.surveyName=null,this.surveyName$=this.observe("surveyName"),this.questions=null,this.questions$=this.observe("questions"),this.locales=null,this.locales$=this.observe("locales"),this.selectedLocale=null,this.selectedLocale$=this.observe("selectedLocale")}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-editor-questions"]],hostAttrs:[1,"ww-surveys-editor-questions"],inputs:{surveyName:"surveyName",questions:"questions",locales:"locales",selectedLocale:"selectedLocale"},standalone:!1,features:[V],decls:10,vars:2,consts:()=>{let e;e=$localize`Survey questions`;let t;return t=$localize`The following questions are included in the selected survey. You are not able to edit the questions.`,[e,t,[1,"ww-surveys-editor-questions-label-layout"],[1,"flex","flex-col","gap-6","w-full"],[3,"question","locales","selectedLocale"]]},template:function(t,n){t&1&&(l(0,"ww-label-layout",2)(1,"ww-label")(2,"span"),I(3,0),c(),l(4,"ww-sublabel"),I(5,1),c()(),l(6,"div",3),q(7,Ls,3,7,"ww-surveys-editor-question-form",4,rt),_(9,"async"),c()()),t&2&&(r(7),j(v(9,0,n.questions$)))},dependencies:[Mt,Vt,Wt,Ri,L],styles:[`.ww-surveys-editor-questions .ww-surveys-editor-question-form:last-of-type .ww-label-layout.ww-label-layout-horizontal{padding-bottom:0} 14/*noopsurveys-editor-questions.component-CDKTGBZV.css.map */ 15`],encapsulation:2,changeDetection:0})}}return i})();var Ni=()=>["surveys.configure"],ki=i=>({permissions:i}),Ui=i=>({enabledConfig:i});function Os(i,s){if(i&1){let e=Q();l(0,"button",8),M("click",function(){U(e);let n=m(4);return P(n.onEnable())}),I(1,1),c()}}function Ds(i,s){i&1&&(l(0,"ww-account-feature-button",9),I(1,2),c())}function As(i,s){if(i&1&&(tn(0),X(1,Os,2,0,"button",7)(2,Ds,2,0,"ng-template",null,0,xt),nn()),i&2){let e=st(3);r(),p("wwAccountFeature","enableCustomMessageProvider")("wwAccountFeatureElse",e)}}function Vs(i,s){i&1&&X(0,As,4,2,"ng-container",6),i&2&&p("wwLayoutTertiaryAction",De(4,Ui,De(2,ki,Ne(1,Ni))))}function Ms(i,s){if(i&1){let e=Q();l(0,"button",13),M("click",function(){U(e);let n=m(4);return P(n.onDisable())}
15),I(1,3),c()}}function Ws(i,s){i&1&&X(0,Ms,2,0,"button",12),i&2&&p("wwLayoutTertiaryAction",De(4,Ui,De(2,ki,Ne(1,Ni))))}function Ns(i,s){if(i&1){let e=Q();l(0,"button",15),M("click",function(){U(e);let n=m(4);return P(n.onEnable())}),I(1,4),c()}if(i&2){let e=m(4);p("disabled",e.updateFormGroup.invalid)}}function ks(i,s){i&1&&X(0,Ns,2,1,"button",14),i&2&&p("wwLayoutTertiaryAction",De(4,Ui,De(2,ki,Ne(1,Ni))))}function Us(i,s){if(i&1&&S(0,Ws,1,6,"button",10)(1,ks,1,6,"button",11),i&2){let e=m(2);f(e.survey.isActive?0:1)}}function Ps(i,s){if(i&1&&(S(0,Vs,1,6,"ng-container")(1,Us,2,1),y(2,"ww-joi-form",5)),i&2){let e=m();f(e.survey.isLocked?0:1),r(2),p("form",e.joiFormUpdate)("wwTrackPendingChanges",e.joiFormUpdate.options.formGroup)("wwTrackPendingChangesUntil",e.update)}}var xi=(()=>{class i extends z{constructor(){super(...arguments),this.businessTerms=u(ao),this.layout=u(ne),this.locationRx=u(Le),this.pendingChangesStore=u(lo),this.create=new Te,this.disable=new Te,this.update=new Te,this.survey=null,this.survey$=this.observe("survey"),this.presetQuestions=null,this.presetQuestions$=this.observe("presetQuestions"),this.selectedLocale=Zi(null),this.surveyIdentity$=this.survey$.pipe(d(e=>e?{id:e.id,locationIds:e.locationIds,isLocked:e.isLocked}:null),R((e,t)=>H(e,t)),this.shareReplay()),this.locales$=this.locationRx.getCurrentLocation(["publicLocales"]).pipe(d(e=>vn([di,...e.publicLocales.map(t=>_n(t)?.code).filter(we)]))),this.supportedLocales$=this.locales$.pipe(d(e=>e.filter(t=>mi.includes(t)))),this.joiFormOptions={labels:{title:$localize`Survey title`,showOnStatusPageCompleted:`${this.businessTerms.businessTerms.completeStateTerm.capitalized} ${this.businessTerms.businessTerms.visitTerm.pluralLower}`,showOnStatusPageCancelled:$localize`Cancelled ${this.businessTerms.businessTerms.visitTerm.pluralLower}`,showOnStatusPageNoShow:$localize`No-show ${this.businessTerms.businessTerms.visitTerm.pluralLower}`,completionMessage:$localize`Completion message`,includeInMessages:$localize`Sharing options`},sublabels:{title:$localize`Header text for the survey. Survey title is not displayed on the status page.`,completionMessage:$localize`Displayed after a survey has been submitted.`,includeInMessages:$localize`Share the survey with a linked button attached at the bottom of any email.`},placeholders:{title:$localize`Thank you for your visit`,completionMessage:$localize`Thank you for your response`},groups:{showOnStatusPage:{children:["showOnStatusPageCompleted","showOnStatusPageCancelled","showOnStatusPageNoShow"],label:$localize`Targeting rules`,sublabel:$localize`Choose which ${this.businessTerms.businessTerms.visitTerm.pluralLower} states result in a survey being sent.`}},projection:{completionMessage:{above:T(Ti,{$rx:{surveyName:this.survey$.pipe(d(e=>e?.name??null)),locales:this.supportedLocales$,selectedLocale:pt(this.selectedLocale),questions:this.presetQuestions$}})}},components:{title:T(mt,{$rx:{locales:this.supportedLocales$,selectedLocale:pt(this.selectedLocale)},$hooks:{onCreate:e=>{e.instance.localeChanged.subscribe(t=>{this.selectedLocale.set(t)})}}}),showOnStatusPageCompleted:T(Pt),showOnStatusPageCancelled:T(Pt),showOnStatusPageNoShow:T(Pt),completionMessage:T(mt,{$rx:{locales:this.supportedLocales$,selectedLocale:pt(this.selectedLocale)},$hooks:{onCreate:e=>{e.instance.localeChanged.subscribe(t=>{this.selectedLocale.set(t)})}}}),includeInMessages:T(Ei,{$rx:{locales:this.supportedLocales$,selectedLocale:pt(this.selectedLocale)},$hooks:{onCreate:e=>{e.instance.localeChanged.subscribe(t=>{this.selectedLocale.set(t)})}}})}},this.updateFormGroup=Oo(Wi.PAYLOAD_SCHEMA,new ln({showOnStatusPageCompleted:new oe(!0),showOnStatusPageCancelled:new oe(!0),showOnStatusPageNoShow:new oe(!0),title:new oe({value:null,i18n:{}},{validators:[at.required]}),completionMessage:new oe({value:null,i18n:{}},{validators:[at.required]}),includeInMessages:new oe(null,{validators:({value:e})=>e&&e.includeIn.length!==0&&!e.linkText.value?.trim()?{linkText:!1}:null})})),this.joiFormUpdate=Do(F({formGroup:this.updateFormGroup,description:Wi.PAYLOAD_SCHEMA},this.joiFormOptions))}reset(){return pe(this,null,function*(){let e=yield ee(this.survey$);e&&(this.updateFormGroup.patchValue(this.toView(e),{emitEvent:!1}),this.updateFormGroup.markAsPristine({emitEvent:!1}
15),this.updateFormGroup.updateValueAndValidity())})}toView(e){let t=e.showOnStatusPageRules?.conditions.flatMap(n=>Object.prototype.hasOwnProperty.call(n,"logicalOperator")?[]:n.type)??[];return O(F({},e),{showOnStatusPageCompleted:t.includes("IS_COMPLETED"),showOnStatusPageCancelled:t.includes("IS_CANCELLED"),showOnStatusPageNoShow:t.includes("IS_NO_SHOW"),title:Jt(e,"displayName"),completionMessage:Jt(e,"completionMessage"),includeInMessages:{includeIn:e.addSurveyToEmailMessageTypes??[],linkText:Jt(e,"surveyEmailTextLink")}})}toPayload(e,t){let{title:n,completionMessage:o,includeInMessages:a}=e,w=F({},no({displayName:n,completionMessage:o,surveyEmailTextLink:a?.linkText}));w=O(F({},w),{i18n:Object.keys(w.i18n).reduce((g,W)=>{let C=w.i18n?.[W];return C.surveyEmailTextLink===null&&delete C.surveyEmailTextLink,g[W]=C,g},{})});let h=null;return(e.showOnStatusPageCancelled||e.showOnStatusPageCompleted||e.showOnStatusPageNoShow)&&(h={logicalOperator:"OR",conditions:[]},e.showOnStatusPageCompleted&&h.conditions.push({type:"IS_COMPLETED"}),e.showOnStatusPageCancelled&&h.conditions.push({type:"IS_CANCELLED"}),e.showOnStatusPageNoShow&&h.conditions.push({type:"IS_NO_SHOW"})),w=O(F({},w),{showOnStatusPageRules:h,addSurveyToEmailMessageTypes:a?.includeIn}),t&&(w.isActive=!0),w}onDisable(){return pe(this,null,function*(){let e=yield ee(this.survey$);e&&this.disable.emit(e.id)})}onEnable(){this.onUpdate(!0)}onUpdate(e=!1){return pe(this,null,function*(){if(!this.updateFormGroup.valid)return;let t=this.toPayload(this.updateFormGroup.value,e),n=yield ee(this.survey$);if(n&&n.id&&n.id.length>0){this.update.emit({id:n.id,updates:t});return}let o=yield ee(this.locationRx.getCurrentLocation(["id"])).then(w=>w?.id),a=n?.presetSurveyId??qe;this.create.emit(O(F({},t),{isActive:!0,presetSurveyId:a,locationIds:[o]}))})}ngOnInit(){this.surveyIdentity$.pipe(Ee(this.ngOnDestroy$)).subscribe(e=>{e&&(e.isLocked?this.updateFormGroup.disable({emitEvent:!1}):(this.updateFormGroup.enable({emitEvent:!1}),this.layout.updateFeatureContext({pendingChanges:{formId:"surveys-editor-form",reset:()=>this.reset(),save:()=>this.onUpdate(),store:this.pendingChangesStore,enabledConfig:{permissions:["accounts.update"]}}})),this.reset())})}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=te(i)))(n||i)}})()}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-editor-form"]],hostAttrs:[1,"ww-surveys-editor-form"],inputs:{survey:"survey",presetQuestions:"presetQuestions"},outputs:{create:"create",disable:"disable",update:"update"},standalone:!1,features:[V],decls:1,vars:1,consts:()=>{let e;e=$localize` Activate survey `;let t;t=$localize` Activate survey `;let n;n=$localize` Deactivate survey `;let o;return o=$localize` Activate survey `,[["featureMissingTmpl",""],e,t,n,o,[1,"flex","flex-col","gap-6",3,"form","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[4,"wwLayoutTertiaryAction"],["wwButton","",3,"click",4,"wwAccountFeature","wwAccountFeatureElse"],["wwButton","",3,"click"],["type","primary"],["wwButton","warning"],["wwButton","",3,"disabled"],["wwButton","warning",3,"click",4,"wwLayoutTertiaryAction"],["wwButton","warning",3,"click"],["wwButton","",3,"disabled","click",4,"wwLayoutTertiaryAction"],["wwButton","",3,"click","disabled"]]},template:function(t,n){t&1&&S(0,Ps,3,4),t&2&&f(n.survey?0:-1)},dependencies:[$o,ho,Co,To,Lo,re],encapsulation:2,changeDetection:0})}}return i})();function or(i){return O(F({},i),{isActive:!1,id:"",created:new Date,createdBy:"",updated:new Date,updatedBy:"",locationIds:[],numQuestions:0,numSurveyAnswers:0})}function Ys(i,s){let e=ce(i.minValue),t=ce(i.maxValue);if(e===null||t===null)return;let n;return i.minValueDescription&&s===e&&(n=` - ${i.minValueDescription}`),i.maxValueDescription&&s===t&&(n=` - ${i.maxValueDescription}`),n}function Gs(i){let s=Rn[i.questionId];if(!s)return i;if(s.inputType==="NUMBER"){let e=ce(s.minValue),t=ce(s.maxValue);if(e!==null&&t!==null)for(let n=e;n<=t;n++){let o=Ys(s,n),a=i.values.find(w=>w.label===n.toString());if(a){a.order=n,a.labelSuffix=o;continue}i.values.push({order:n,label:n.toString(),labelSuffix:o,count:0,percent:0,color:"darkGrey"})}}else if(s.inputType==="CHOICE"&&s.inputOptions)for(let[e,t]of s.inputOptions.entries()){let n=i.values.find(o=>o.label===t);if(n){n.order=e;continue}i.values.push({order:e,label:t,count:0,percent:0,color:"darkGrey"})}return i}function rr(i){let s=[];for(let e of i){let t=e.surveyQuestionId;if(!Kt(t))continue;let n=s.find(o=>o.questionId===t);n?(n.count+=e.numSurveyAnswers,n.values.push({order:n.values.length,label:e.surveyAnswerValues??"",count:e.numSurveyAnswers,percent:0,color:"darkGrey"})):s.push({questionId:t,questionInputType:e.surveyQuestionInputType??"",order:Xo.indexOf(t),title:e.surveyQuestionDisplayName??"",count:e.numSurveyAnswers,type:"bars",values:[{order:0,label:e.surveyAnswerValues??"",count:e.numSurveyAnswers,percent:0,color:"darkGrey"}]})}for(let e of s){Gs(e),e.questionInputType==="NUMBER"&&e.values.sort((o,a)=>a.order-o.order),e.questionInputType==="CHOICE"&&e.values.sort((o,a)=>o.order-a.order);let t=Qo[e.questionId];if(t)for(let o=0;o<e.values.length;o++)e.values[o].color=t[o]??"darkGrey";else{let o=jo[e.values.length];if(o)for(let a=0;a<e.values.length;a++)e.values[a].color=o[a]??"darkGrey"}e.questionInputType==="CHOICE"&&e.values.length===2&&(e.type="donut");let n=e.values.reduce((o,a)=>o+a.count,0);for(let o of e.values)o.percent=n>0?o.count/n*100:0}return s.sort((e,t)=>
15e.order-t.order)}function sr(i){return i.length<1?[]:i.map(s=>{let e=s.surveyAnswerId,t=s.answerLocalTimestamp,n=s.presetSurveyId??qe;if(!e||!t||!Ht(n))return null;let o=Ce[n];if(!o)return null;let a=ie(s.resourceCombinations?.split(",").filter(Boolean)),w=ie(s.serviceCombinations?.split(",").filter(Boolean));return{id:e,date:t,score:s.csatScore??null,feedback:s.csatFeedback??null,survey:o.displayName,resource:a.length>0?a.join(", "):null,service:w.length>0?w.join(", "):null}}).filter(we)}function qs(i,s){i&1&&(l(0,"div",2),y(1,"mat-spinner",4),c()),i&2&&(r(),p("diameter",60))}function js(i,s){if(i&1&&(l(0,"ww-info-bubble"),I(1,1),_(2,"async"),c()),i&2){let e=m(2);r(2),Me(v(2,2,e.unsupportedLocalesAsString$))(e.defaultLocale),We(1)}}function Qs(i,s){if(i&1){let e=Q();l(0,"ww-surveys-editor-form",8),M("create",function(n){U(e);let o=m(2);return P(o.onFormCreate(n))})("disable",function(n){U(e);let o=m(2);return P(o.onFormDisable(n))})("update",function(n){U(e);let o=m(2);return P(o.onFormUpdate(n))}),c()}if(i&2){m();let e=x(7),t=x(9);p("survey",e)("presetQuestions",t)}}function Xs(i,s){if(i&1&&(l(0,"div",3)(1,"div",5),xe(2,0),y(3,"ww-link",6)(4,"ww-link",6),be(),c(),S(5,js,3,4,"ww-info-bubble"),_(6,"async"),b(7),_(8,"async"),b(9),_(10,"async"),S(11,Qs,1,2,"ww-surveys-editor-form",7),c()),i&2){let e=m();r(3),p("inline",!0)("type","router-link")("href","/settings/customer-messages"),r(),p("inline",!0)("type","router-link")("href","/messages"),r(),f(v(6,8,e.hasUnsupportedLocales$)?5:-1),r(2);let t=$(v(8,10,e.survey$));r(2);let n=$(v(10,13,e.presetQuestions$));r(2),f(t&&n?11:-1)}}var Pi=(()=>{class i extends z{constructor(){super(),this.coreLocationRx=u(oi),this.coreSurveyRx=u(ri),this.createSurveyWrite=u(uo),this.dialog=u(Gt),this.featuresRx=u(ei),this.layout=u(ne),this.locationRx=u(Le),this.surveyRx=u(ye),this.updateSurveyWrite=u(po),this.defaultLocale=di,this.unsupportedLocales$=this.locationRx.getCurrentLocationProperty("publicLocales").pipe(d(e=>e?e.filter(t=>!mi.includes(t)):[]),R((e,t)=>e.join(",")===t.join(","))),this.hasUnsupportedLocales$=this.unsupportedLocales$.pipe(d(e=>e.length>0),R()),this.unsupportedLocalesAsString$=this.unsupportedLocales$.pipe(d(e=>e.join(", ")),R()),this.hasSurveys$=this.featuresRx.isFeatureEnabled({accountFeatures:["enableSurveys"]}),this.presetId$=Xi(0,Qi).pipe(k(()=>Sn().pipe(d(e=>e.presetId??null),d(e=>Ht(e)?e:null))),R(),this.shareReplay()),this.preset$=D([this.presetId$,this.hasSurveys$]).pipe(d(([e,t])=>e?O(F({},Ce[e]),{isActive:!1,isLocked:!t}):null),this.shareReplay()),this.survey$=this.coreLocationRx.currentLocationSnapshot$.pipe(k(()=>this.preset$.pipe(k(e=>{let t=e?.presetSurveyId;return t?this.surveyRx.get(t).pipe(d(n=>n?O(F({},n),{isActive:n.isActive,isLocked:e.isLocked}):or(e))):Z(null)}))),this.shareReplay()),this.presetQuestions$=this.presetId$.pipe(k(e=>e?this.coreSurveyRx.getPresetQuestions(e):Z([])),this.shareReplay()),this.isLoading$=this.locationRx.locationChanged$.pipe(ot([]),k(()=>this.survey$),d(()=>!1),ot(!0),R()),this.layout.setFeatureContext({name:$localize`Edit survey`,parentPath:"/surveys/library"}),this.subscribeToPreset()}onFormCreate(e){return pe(this,null,function*(){let t=yield ee(this.survey$);if(!t)return;let o=(yield ee(this.surveyRx.surveys$)).find(a=>a.isActive);if(o&&o.presetSurveyId!==t.presetSurveyId){if(!(yield ee(this.dialog.openConfirm({title:$localize`Switch active survey?`,message:$localize`Only one survey can be active at a time. ${o.name} will be deactivated and ${t.name} will become your new active survey.`,confirmLabel:$localize`Switch survey`}).afterClosed$)))return;yield this.updateSurveyWrite.call({id:o.id,updates:{isActive:!1}})}this.createSurveyWrite.payload.next(e)})}onFormUpdate(e){return pe(this,null,function*(){let t=yield ee(this.survey$);if(!t)return;let o=(yield ee(this.surveyRx.surveys$)).find(a=>a.isActive);if(o&&o.id!==e.id){if(!(yield ee(this.dialog.openConfirm({title:$localize`Switch active survey?`,message:$localize`Only one survey can be active at a time. ${o.name} will be deactivated and ${t.name} will become your new active survey.`,confirmLabel:$localize`Switch survey`}).afterClosed$)))return;yield this.updateSurveyWrite.call({id:o.id,updates:{isActive:!1}})}this.updateSurveyWrite.payload.next(e)})}onFormDisable(e){return pe(this,null,function*(){this.updateSurveyWrite.payload.next({id:e,updates:{isActive:!1}})})}subscribeToPreset(){this.preset$.pipe(Ee(this.ngOnDestroy$)).subscribe(e=>{e&&(e.isActive?this.layout.updateFeatureContext({breadcrumbName:e.displayName??e.name,name:At({components:[e.displayName??e.name,Bt({component:$localize`Active`,backgroundColor:"success-alpha-10",color:"green2",size:"x-small"})],$element:{classList:["flex","items-center","gap-2"]}})}):this.layout.updateFeatureContext({name:e.displayName??e.name}))})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-editor"]],hostAttrs:[1,"ww-surveys","ww-surveys-editor"],standalone:!1,features:[V],decls:3,vars:3,consts:()=>{let e;e=$localize` The survey URL can be shared by including it in any ${"\uFFFD#3\uFFFD"}:START_TAG_WW_LINK:Customer message${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_WW_LINK: template or ${"\uFFFD#4\uFFFD"}:START_TAG_WW_LINK_1:direct message${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_WW_LINK:. Find the â+â icon in the message editor or chat window and add the Satisfaction Survey variable to the message. `,e=Et(e);let t;return t=$localize` You are currently using location languages not supported by Surveys (${"\uFFFD0\uFFFD"}:INTERPOLATION:). Surveys sent to customers with an unsupported locale will use the default language: ${"\uFFFD1\uFFFD"}:INTERPOLATION_1:. `,[e,t,[1,"flex","items-center","justify-center","py-40","max-w-3xl"],["wwLayoutPadding","",1,"flex","flex-col","gap-6"],[3,"diameter"],[1,"max-w-3xl"],[3,"inline","type","href"],[3,"survey","presetQuestions"],[3,"create","disable","update","survey","presetQuestions"]]},template:function(t,n){t&1&&(S(0,qs,2,1,"div",2),_(1,"async"),he(2,Xs,12,16,"div",3)),t&2&&f(v(1,1,n.isLoading$)?0:2)},dependencies:[Ke,Ut,Yt,jt,xi,L],encapsulation:2,changeDetection:0})}}return i})();var yt=(()=>{class i{constructor(){this.accountRx=u(He),this.router=u(Fe)}
15canActivate(e,t){return this.accountRx.hasAccountFeature("enableSurveys").pipe(d(n=>n||t.url.startsWith("/surveys/upgrade")?!0:(this.router.navigate(["/surveys/upgrade"]),!1)))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=Re({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Hs=(i,s)=>s.presetSurveyId;function Ks(i,s){if(i&1&&y(0,"ww-surveys-template",1),i&2){let e=s.$implicit;p("active",e.isActive)("locked",e.isLocked)("presetId",e.presetSurveyId)("name",e.displayName)("description",e.description)}}var bi=(()=>{class i extends z{constructor(){super(),this.layout=u(ne),this.featuresRx=u(ei),this.surveyRx=u(ye),this.hasSurveys$=this.featuresRx.isFeatureEnabled({accountFeatures:["enableSurveys"]}),this.presets$=D([this.surveyRx.surveys$,this.hasSurveys$]).pipe(d(([e,t])=>En.map(n=>{let o=Ce[n],a=e?.find(w=>w.presetSurveyId===n);return O(F({},o),{displayName:o.displayName??o.name,presetSurveyId:n,isActive:!!a?.isActive,isLocked:!t})}).sort((n,o)=>n.displayName.localeCompare(o.displayName)).sort((n,o)=>n.isActive===o.isActive?0:n.isActive?-1:1)),this.shareReplay()),this.layout.setFeatureContext({name:$localize`Surveys`})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-library"]],hostAttrs:[1,"ww-surveys-library"],standalone:!1,features:[V],decls:4,vars:2,consts:[["wwLayoutPadding","",1,"flex","flex-wrap","gap-6"],[3,"active","locked","presetId","name","description"]],template:function(t,n){t&1&&(l(0,"div",0),q(1,Ks,1,5,"ww-surveys-template",1,Hs),_(3,"async"),c()),t&2&&(r(),j(v(3,0,n.presets$)))},dependencies:[Ke,gi,L],encapsulation:2,changeDetection:0})}}return i})();var Zs=(i,s)=>s.title;function ea(i,s){i&1&&(l(0,"div",5),y(1,"ww-icon",6),c())}function ta(i,s){if(i&1){let e=Q();l(0,"div",7)(1,"div",9),y(2,"ww-icon",10),l(3,"span"),I(4,0),c()(),l(5,"div",11)(6,"a",12),M("click",function(n){U(e);let o=m(2);return n.preventDefault(),P(o.openHelpArticle())}),I(7,1),c(),l(8,"button",13),M("click",function(){U(e);let n=m(2);return P(n.openLibrary())}),I(9,2),c()()()}if(i&2){let e=m(2);r(6),p("href",e.learnMoreUrl,Ct)}}function ia(i,s){if(i&1){let e=Q();l(0,"div",14)(1,"div",22),y(2,"ww-surveys-date-range-picker"),l(3,"ww-filter",23),_(4,"async"),_(5,"async"),M("filtersChanged",function(n){U(e);let o=m(3);return P(o.filterStore.reset(n))}),c()(),l(6,"button",24),M("click",function(){U(e);let n=m(3);return P(n.export())}),y(7,"ww-icon",25),l(8,"span"),I(9,3),c()()()}if(i&2){let e=m(3);r(3),p("layout","horizontal")("filters",v(4,3,e.filterStore.filters$))("values",v(5,5,e.filterStore.state$))}}function na(i,s){if(i&1&&(l(0,"div",15),y(1,"ww-surveys-date-range-picker")(2,"ww-page-filter-button",26),c()),i&2){let e=m(3);r(2),p("store",e.filterStore)}}function oa(i,s){i&1&&(l(0,"ww-info-bubble",16),I(1,4),c())}function ra(i,s){if(i&1&&(l(0,"div",18),y(1,"ww-surveys-overview-metric",27)(2,"ww-surveys-overview-metric",28)(3,"ww-surveys-overview-metric",29)(4,"ww-surveys-overview-metric",30)(5,"ww-surveys-overview-metric",31),c()),i&2){m();let e=x(7),t=x(9);r(),p("loading",t)("value",e==null?null:e.avgScore),r(),p("loading",t)("value",e==null?null:e.surveysSent),r(),p("loading",t)("value",e==null?null:e.responses),r(),p("loading",t)("value",e==null?null:e.responseRate)("valueSuffix",e==null?null:e.responseRateSuffix),r(),p("loading",t)("value",e==null?null:e.feedbackRate)("valueSuffix","%")}}function sa(i,s){if(i&1&&(l(0,"div",32),y(1,"ww-surveys-overview-metric",33)(2,"ww-surveys-overview-metric",34)(3,"ww-surveys-overview-metric",35),c(),l(4,"div",36),y(5,"ww-surveys-overview-metric",37)(6,"ww-surveys-overview-metric",38),c()),i&2){m();let e=x(7),t=x(9);r(),p("loading",t)("value",e==null?null:e.avgScore),r(),p("loading",t)("value",e==null?null:e.surveysSent),r(),p("loading",t)("value",e==null?null:e.responses),r(2),p("loading",t)("value",e==null?null:e.responseRate)("valueSuffix",e==null?null:e.responseRateSuffix),r(),p("loading",t)("value",e==null?null:e.feedbackRate)("valueSuffix","%")}}function aa(i,s){i&1&&(l(0,"div",20)(1,"ww-card",39),y(2,"ww-chart-layout-placeholder"),c()()),i&2&&(r(),p("bordered",!0))}function la(i,s){if(i&1&&y(0,"ww-surveys-overview-question-chart",41),i&2){let e=s.$implicit;p("title",e.title)("count",e.count)("type",e.type)("values",e.values)}}function ca(i,s){if(i&1&&(l(0,"div",40),q(1,la,1,4,"ww-surveys-overview-question-chart",41,Zs),c()),i&2){m(2);let e=x(17);r(),j(e)}}function ua(i,s){if(i&1&&S(0,ca,3,0,"div",40),i&2){m();let e=x(17);f(e.length>0?0:-1)}}function pa(i,s){if(i&1){let e=Q();b(0),_(1,"async"),l(2,"div",8),S(3,ia,10,7,"div",14)(4,na,3,1,"div",15),S(5,oa,2,0,"ww-info-bubble",16),_(6,"async"),b(7),_(8,"async"),b(9),_(10,"async"),l(11,"ww-card",17),S(12,ra,6,12,"div",18)(13,sa,7,12),c(),l(14,"ww-card",19),y(15,"ww-surveys-chart-satisfaction-score")(16,"ww-surveys-chart-responses"),c(),b(17),_(18,"async"),S(19,aa,3,1,"div",20)(20,ua,1,1),l(21,"ww-surveys-overview-answers-table",21),_(22,"async"),_(23,"async"),_(24,"async"),_(25,"async"),M("fetchRows",function(){U(e);let n=m(2);return P(n.fetchMoreAnswers())}),c()()}if(i&2){let e=m(2),t=v(1,10,e.breakpoints.isAboveSmall$);r(3),f(t?3:4),r(2),f(v(6,12,e.showDateRangeDisclaimer$)?5:-1),r(2),$(v(8,14,e.metricsData$)),r(2);let n=$(v(10,17,e.dataLoading$));r(2),p("bordered",!0),r(),f(t?12:13),r(2),p("bordered",!0),r(3);let o=$(v(18,20,e.questions$));r(2),f(o===null||n?19:20),r(2),p("loading",v(22,23,e.answersLoading$))("loadingRows",v
15(23,25,e.moreAnswersLoading$))("rows",v(24,27,e.answers$))("hasMoreRows",v(25,29,e.hasMoreAnswers$))}}function da(i,s){if(i&1&&(S(0,ta,10,1,"div",7),_(1,"async"),he(2,pa,26,31,"div",8)),i&2){let e=m();f(v(1,1,e.showGetStarted$)?0:2)}}var Ii=(()=>{class i extends z{constructor(){super(),this.breakpoints=u($e),this.filterStore=u(tt),this.decimalPipe=u(It),this.eventLogger=u(ii),this.exportSurveyAnswersWrite=u(mo),this.intercomService=u(ni),this.layout=u(ne),this.locationRx=u(Le),this.router=u(Fe),this.surveyRx=u(ye),this.surveysService=u(ue),this.learnMoreUrl=Kn,this.surveys$=this.surveyRx.surveys$,this.showGetStarted$=this.surveys$.pipe(d(e=>e.length===0)),this.dateRangeContainsPreLaunchDate$=this.surveysService.dateRange$.pipe(d(e=>ae(e)?Cn(e.start,new Date(2026,5,1)):!1),R(),this.shareReplay()),this.showDateRangeDisclaimer$=this.dateRangeContainsPreLaunchDate$,this.surveysLoading$=this.showGetStarted$.pipe(d(()=>!1),ot(!0),R()),this.dataLoading$=this.surveysService.loadingState$.pipe(d(e=>e.responseTrendData||e.metricsReportData||e.metricsSurveyData),R()),this.metricsData$=D([this.surveysService.metricsReportData$,this.surveysService.metricsSurveyData$,this.dateRangeContainsPreLaunchDate$]).pipe(d(([e,t,n])=>{let o=ie(e?.data)[0]??null,a=ie(t?.data)[0]??null;if(!o||!a)return{avgScore:"0",surveysSent:"0",feedbackRate:"0",responses:"0",responseRate:"0",responseRateSuffix:"%"};let w=a?.avgCsatScore??0,h=o?.numSurveysSent??0,g=a?.numSurveyAnswers??0,W=a?.numAnswersWithFeedback??0,C=W>0&&g>0?Math.round(W/g*100):0,K=h>0&&g>0?Math.round(g/h*100):0;return{avgScore:this.decimalPipe.transform(w,"1.0-1")??"0",surveysSent:n?"-":this.decimalPipe.transform(h,"1.0-0")??"0",feedbackRate:this.decimalPipe.transform(C,"1.0-0")??"0",responses:this.decimalPipe.transform(g,"1.0-1")??"0",responseRate:n?"-":this.decimalPipe.transform(K,"1.0-1")??"0",responseRateSuffix:n?"":"%"}})),this.questions$=this.surveysService.questionsData$.pipe(d(e=>{let t=ie(e?.data);return rr(t)})),this.answersLoading$=this.surveysService.loadingState$.pipe(d(e=>e.answersData),R(),this.shareReplay()),this.moreAnswersLoading$=this.surveysService.loadingState$.pipe(d(e=>e.moreAnswersData),R(),this.shareReplay()),this.answers$=this.surveysService.answers$.pipe(d(e=>e?sr(ie(e?.data)):null),this.shareReplay()),this.answersPaginationToken$=this.surveysService.answers$.pipe(d(e=>e?.pagination?.nextPageToken??null),R(),this.shareReplay()),this.hasMoreAnswers$=this.answersPaginationToken$.pipe(d(e=>!!e),R(),this.shareReplay()),this.layout.setFeatureContext({name:$localize`Surveys`})}export(){return pe(this,null,function*(){let e=yield ee(this.locationRx.locationId$);if(!e)return;let t=yield ee(this.surveysService.dateRange$);ae(t)&&(this.exportSurveyAnswersWrite.payload.next({locationId:e,fromTime:t.start,toTime:t.end}),this.eventLogger.log("survey_answers_export_csv"))})}openHelpArticle(){this.intercomService.showArticle(16050899)}openLibrary(){this.router.navigate(["/surveys/library"])}fetchMoreAnswers(){return pe(this,null,function*(){let e=yield ee(this.answersPaginationToken$);e&&this.surveysService.setAnswersPaginationToken(e)})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-overview"]],hostAttrs:[1,"ww-surveys-overview"],standalone:!1,features:[V],decls:3,vars:3,consts:()=>{let e;e=$localize`Enable your first survey to start collecting feedback.`;let t;t=$localize` Learn more `;let n;n=$localize`Get started`;let o;o=$localize`Export survey answers`;let a;a=$localize`Export`;let w;w=$localize`Filters`;let h;h=$localize`The new metric Surveys Sent went live on June 1, 2026. Any date range before June 1, 2026 may display no data.`;let g;g=$localize`Average score`;let W;W=$localize`Surveys sent`;let C;C=$localize`Responses`;let K;K=$localize`Response rate`;let me;me=$localize`Feedback rate`;let Yi;Yi=$localize`Average score`;let Gi;Gi=$localize`Surveys sent`;let zi;zi=$localize`Responses`;let qi;qi=$localize`Response rate`;let ji;return ji=$localize`Feedback rate`,[e,t,n,a,h,[1,"flex","items-center","justify-center","py-40"],["icon","bx-loader-alt","size","2x-large","wwColor","darkGrey",1,"ww-animate-rotate"],[1,"ww-surveys-overview-empty-state","flex","flex-col","items-center","gap-10"],["wwLayoutPadding","",1,"flex","flex-col","gap-6","w-full"],[1,"flex","flex-col","items-center","gap-2"],["icon","ww-surveys-overview-empty-state","sizeStyle","auto",1,"w-32","h-32"],[1,"flex","gap-4"],["
15wwButton","secondary",3,"click","href"],["wwButton","",3,"click"],[1,"flex","items-start","justify-between","w-full"],[1,"flex","gap-2"],["color","alert",1,"!w-full","!max-w-full"],[1,"flex","flex-col","py-2",3,"bordered"],[1,"grid","grid-cols-5","gap-4","w-full"],[1,"!grid","small:grid-cols-2","w-full",3,"bordered"],[1,"grid","small:grid-cols-2","small:gap-6","gap-4","w-full","min-h-[360px]"],[3,"fetchRows","loading","loadingRows","rows","hasMoreRows"],[1,"flex","flex-wrap","gap-3"],[3,"filtersChanged","layout","filters","values"],["wwButton","secondary","wwTooltip",o,3,"click"],["icon","bx-upload"],["title",w,"buttonType","secondary",3,"store"],["title",g,3,"loading","value"],["title",W,3,"loading","value"],["title",C,3,"loading","value"],["title",K,3,"loading","value","valueSuffix"],["title",me,3,"loading","value","valueSuffix"],[1,"grid","grid-cols-3","w-full"],["title",Yi,3,"loading","value"],["title",Gi,3,"loading","value"],["title",zi,3,"loading","value"],[1,"grid","grid-cols-2","w-full"],["title",qi,3,"loading","value","valueSuffix"],["title",ji,3,"loading","value","valueSuffix"],[1,"flex","items-center","justify-center","min-h-full","col-span-1",3,"bordered"],[1,"grid","small:grid-cols-2","small:gap-6","gap-4","w-full"],[1,"col-span-1",3,"title","count","type","values"]]},template:function(t,n){t&1&&(S(0,ea,2,0,"div",5),_(1,"async"),he(2,da,3,3)),t&2&&f(v(1,1,n.surveysLoading$)?0:2)},dependencies:[li,bo,Ke,ko,re,ve,se,fe,Yt,$n,Si,fi,vi,wi,hi,Ci,L],styles:[`.ww-breakpoints-below-small .ww-surveys-overview .ww-surveys-overview-date-range-picker{display:block;width:100%}.ww-surveys-overview .ww-chart-layout .ww-chart-layout-graph{min-height:240px;max-height:240px}.ww-surveys-overview .ww-section-content{padding:16px 12px}.ww-surveys-overview .ww-metric{align-items:center;flex-direction:column-reverse}.ww-surveys-overview .ww-metric .ww-metric-title-container{justify-content:center}.ww-surveys-overview .ww-metric .ww-metric-title-container .ww-metric-title{text-align:center}.ww-surveys-overview .ww-metric .ww-metric-value{display:flex;justify-content:center} 16/*noopsurveys-overview.component-6XDLIAR5.css.map */ 17`],encapsulation:2,changeDetection:0})}}return i})();var lr=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-routing"]],standalone:!1,decls:1,vars:0,template:function(t,n){t&1&&y(0,"router-outlet")},dependencies:[pn],encapsulation:2,changeDetection:0})}}return i})();var _a=(i,s)=>s.id;function wa(i,s){if(i&1){let e=Q();l(0,"button",2),M("click",function(){U(e);let n=m();return P(n.openIntercom())}),I(1,0),c()}}function Sa(i,s){if(i&1&&(l(0,"a",4),A(1),c()),i&2){let e=s.$implicit;m(2);let t=x(3);p("active",(t==null?null:t.id)===e.id)("routerLink",`/surveys/${e.path}`),r(),G(e.label)}}function fa(i,s){i&1&&de(0)}function va(i,s){if(i&1&&(l(0,"ww-tab-bar",3),q(1,Sa,2,3,"a",4,_a),c(),X(3,fa,1,0,"ng-container",5)),i&2){m();let e=x(1),t=x(3);p("type","fill"),r(),j(e),r(2),p("ngComponentOutlet",t.component)}}var Fi=(()=>{class i extends z{constructor(){super(),this.environment=u(Tn),this.intercomService=u(ni),this.layout=u(ne),this.permissionRx=u(oo),this.route=u(un),this.tabs$=D([this.permissionRx.hasPermission("surveys.show"),this.permissionRx.hasPermission("surveys.configure")]).pipe(d(([e,t])=>{if(!e)return[];let n=[{id:"overview",path:"overview",label:$localize`Overview`,component:Ii}];return t&&n.push({id:"library",path:"library",label:$localize`Library`,component:bi}),n}),this.shareReplay()),this.url$=this.route.url.pipe(d(e=>e[0]?.path),R()),this.activeTab$=this.tabs$.pipe(k(e=>this.url$.pipe(d(t=>e.find(n=>n.path===t)??null)))),this.layout.setFeatureContext({name:$localize`Surveys`})}openIntercom(){this.environment.intercom&&this.intercomService.startSurvey(this.environment.intercom.surveyId)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys"]],hostAttrs:[1,"ww-surveys","flex","flex-col","gap-6","w-full"],standalone:!1,features:[V],decls:6,vars:7,consts:()=>{let e;return e=$localize` Provide feedback 18`,[e,["wwButton","secondary",3,"click",4,"wwLayoutPrimaryAction"],["wwButton","secondary",3,"click"],[3,"type"],["wwTabBarItem","",3,"active","routerLink"],[4,"ngComponentOutlet"]]},template:function(t,n){if(t&1&&(X(0,wa,2,0,"button",1),b(1),_(2,"async"),b(3),_(4,"async"),S(5,va,4,2)),t&2){r();let o=$(v(2,1,n.tabs$));r(2);let a=$(v(4,4,n.activeTab$));r(2),f(o&&a?5:-1)}},dependencies:[sn,dn,Io,re,Xn,Qn,L],encapsulation:2,changeDetection:0})}}return i})();function ya(i,s){if(i&1&&(l(0,"ww-bullet-list-item"),A(1),c()),i&2){let e=s.$implicit;r(),G(e)}}function ha(i,s){if(i&1&&(l(0,"ww-bullet-list",8),q(1,ya,2,1,"ww-bullet-list-item",null,gt),c()),i&2){let e=m(3);r(),j(e.content.bulletPoints)}}function Ca(i,s){i&1&&de(0)}function ga(i,s){if(i&1&&(l(0,"div",4)(1,"div",5)(2,"ww-call-out",6)(3,"ww-call-out-title"),A(4),c(),l(5,"ww-call-out-content",7)(6,"p"),A(7),c(),S(8,ha,3,0,"ww-bullet-list",8),_(9,"async"),c(),l(10,"ww-call-out-actions"),X(11,Ca,1,0,"ng-container",9),c()()()(),l(12,"div",10)(13,"ww-card",11)(14,"div",12)(15,"div",13),y(16,"ww-skeleton-placeholder",14)(17,"ww-skeleton-placeholder",14),c()(),l(18,"div",15),y(19,"ww-table",16),c()()()),i&2){m();let e=st(4),t=m();r(2),p("backgroundColor","upgrade2")("illustration",t.content.illustration??null),r(2),G(t.content.title),r(3),G(t.content.description),r(),f(v(9,14,t.breakpoints.isAboveMobile$)?8:-1),r(3),p("wwOutlet",e),r(2),p("bordered",!1),r(3),p("height",24)("width",100),r(),p("height",24)("width",130),r(2),p("data",t.data)("columns",t.columns)("pluckCellLabel",t.pluckCellLabel)}}function Ea(i,s){i&1&&de(0)}function Ra(i,s){if(i&1&&(l(0,"div",3)(1,"div",17),y(2,"ww-illustration",18),l(3,"div",19)(4,"h3"),A(5),c(),l(6,"p",20),A(7),c()()(),l(8,"div",19),X(9,Ea,1,0,"ng-container",9),c()()),i&2){m();let e=st(4),t=m();r(2),p("icon",t.content.illustration??null),r(3),G(t.content.title),r(2),Ie(" ",t.content.description," "),r(2),p("wwOutlet",e)}}function Ta(i,s){if(i&1&&(l(0,"a",23),I(1,2),c()),i&2){let e=m(3);p("href",e.content.helpArticle,Ct)}}function xa(i,s){if(i&1){let e=Q();l(0,"button",21),M("click",function(){U(e);let n=m(2);return P(n.upgrade())}),xe(1,1),y(2,"ww-icon",22),be(),c(),S(3,Ta,2,1,"a",23)}if(i&2){let e=m(2);r(3),f(e.content.helpArticle?3:-1)}}function ba(i,s){if(i&1&&(S(0,ga,20,16),_(1,"async"),he(2,Ra,10,4,"div",3),X(3,xa,4,1,"ng-template",null,0,xt)),i&2){let e=m();f(v(1,1,e.breakpoints.isAboveSmall$)?0:2)}}var Bi=(()=>{class i{constructor(){this.breakpoints=u($e),this.layout=u(ne),this.router=u(Fe),this.content={title:$localize`Upgrade to Starter to access Surveys`,description:$localize`You know how many people walked through your door, now find out how they felt. Upgrade to a Starter account to measure guest satisfaction in real-time and make data-driven improvements to your service journey.`,illustration:"ww-plan-starter",helpArticle:"https://help.waitwhile.com/en/collections/14954126-surveys"},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:T(B,{height:20,width:60})},{key:"b",label:T(B,{height:20,width:60})},{key:"c",label:T(B,{height:20,width:60})},{key:"d",label:T(B,{height:20,width:60})},{key:"e",label:T(B,{height:20,width:60})},{key:"f",label:T(B,{height:20,width:60})},{key:"g",label:T(B,{height:20,width:60})},{key:"h",label:T(B,{height:20,width:60})},{key:"k",label:T(B,{height:20,width:60})}],this.pluckCellLabel=e=>({a:T(B,{height:14,width:e.a}),b:T(B,{height:14,width:e.b}),c:T(B,{height:14,width:e.c}),d:T(B,{height:14,width:e.d}),e:T(B,{height:14,width:e.e}),f:T(B,{height:14,width:e.f}),g:T(B,{height:14,width:e.g}),h:T(B,{height:14,width:e.h}),k:T(B,{height:14,width:e.k})}),this.layout.setFeatureContext({name:$localize`Surveys`})}upgrade(){this.router.navigate(["/account/settings/billing/change-plan"])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=E({type:i,selectors:[["ww-surveys-upgrade"]],hostAttrs:[1,"ww-surveys","ww-surveys-upgrade","flex","flex-col","gap-6","small:p-6","relative"],standalone:!1,decls:1,vars:1,consts:()=>{let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_WW_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_WW_ICON: Upgrade `;let t;return t=$localize` Learn more `,[["actionsTmpl",""],e,t,[1,"ww-surveys-upgrade-background","flex","flex-col","flex-grow","justify-between","gap-4","p-6"],[1,"ww-surveys-upgrade-overlay","block","absolute","top-0","left-0","w-full","h-full","z-20"],[1,"ww-surveys-upgrade-overlay-container","flex","flex-col","items-center","pt-6","small:pt-24","w-full","h-full"],[1,"ww-surveys-upgrade-overlay-content",3,"backgroundColor","illustration"],[1,"flex","flex-col","gap-4"],["icon","bx-check-circle"],[4,"wwOutlet"],[1,"z-10"],["wwBackgroun
18dColor","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"],[1,"flex","flex-col","gap-2","flex-grow","justify-center"],[1,"ww-surveys-upgrade-illustration",3,"icon"],[1,"flex","flex-col","gap-2"],[1,"ww-surveys-upgrade-description"],["wwButton","secondary","wwBackgroundColor","black","wwColor","white",3,"click"],["icon","bxs-bolt"],["wwButton","tertiary","target","_blank",3,"href"]]},template:function(t,n){t&1&&S(0,ba,5,3),t&2&&f(n.content?0:-1)},dependencies:[_o,wo,So,fo,Ln,On,re,ve,se,fe,Nt,Ge,B,Qt,L],styles:[`.ww-surveys-upgrade .ww-surveys-upgrade-overlay{background-color:#fff3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.ww-surveys-upgrade .ww-surveys-upgrade-overlay .ww-surveys-upgrade-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-surveys-upgrade{--top-nav-bar-height: 48px;--layout-header-height: 56px;--layout-bottom-height: 64px;min-height:calc(100vh - var(--berg-layout-top-inset) - var(--top-nav-bar-height) - var(--layout-header-height) - var(--layout-bottom-height))}.ww-breakpoints-below-small .ww-surveys-upgrade .ww-surveys-upgrade-background{background:radial-gradient(circle at 50% 50%,var(--ww-color-upgrade2),transparent 100%)}.ww-breakpoints-below-small .ww-surveys-upgrade .ww-surveys-upgrade-illustration{display:flex;justify-content:center}.ww-breakpoints-below-small .ww-surveys-upgrade .ww-surveys-upgrade-illustration svg{max-height:160px;max-width:160px}@media screen and (max-height:700px){.ww-breakpoints-below-small .ww-surveys-upgrade .ww-surveys-upgrade-description{display:none}} 19/*noopsurveys-upgrade.component-5EABOFDL.css.map */ 20`],encapsulation:2,changeDetection:0})}}return i})();var Ia=[Si,fi,vi,Ze,wi,hi,Ci],Fa=[et,gi],$a=[Pi,xi,Ri,Ti,Ei],C_=[...Ia,...Fa,...$a,vt,Fi,bi,Ii,lr,Bi],g_=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=en({type:i})}static{this.\u0275inj=Ki({providers:[Fo],imports:[an,cn,mn.forChild([{path:"",pathMatch:"full",redirectTo:"overview"},{path:"upgrade",component:Bi,canActivate:[yt]},go({path:"edit",component:Pi,canActivate:[yt,si({somePermissions:["surveys.configure"]})]},{trackPendingChanges:!0}),{path:"overview",component:Fi,canActivate:[yt,si({permissions:["surveys.show"]})]},{path:"library",component:Fi,canActivate:[yt,si({permissions:["surveys.configure"]})]}]),Go,zo,Ao,Hn]})}}return i})();export{tt as SurveysFilterStore,yt as SurveysGuard,vt as WwSurveyAnswerViewerComponent,Si as WwSurveysChartResponsesComponent,fi as WwSurveysChartSatisfactionScoreComponent,Fi as WwSurveysComponent,vi as WwSurveysDateRangePickerComponent,Pi as WwSurveysEditorComponent,xi as WwSurveysEditorFormComponent,Ri as WwSurveysEditorQuestionFormComponent,Ti as WwSurveysEditorQuestionsComponent,Ze as WwSurveysFilterTriggerComponent,Ei as WwSurveysIncludeInMessagesComponent,bi as WwSurveysLibraryComponent,g_ as WwSurveysModule,wi as WwSurveysOverviewAnswersTableComponent,Ii as WwSurveysOverviewComponent,hi as WwSurveysOverviewMetricComponent,Ci as WwSurveysOverviewQuestionChartComponent,lr as WwSurveysRoutingComponent,et as WwSurveysStatusIndicatorComponent,gi as WwSurveysTemplateComponent,Bi as WwSurveysUpgradeComponent}; 21//noopchunk-K52PFHXN.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.