1import{$a as Lo,$d as Go,C as No,Cb as $o,De as zo,Ed as Bo,I as he,Sa as Fe,Ua as Oo,Va as ho,Xd as H,Yd as Ae,Zd as xe,_a as Mo,ab as Po,ae as Do,be as Xo,db as Io,eb as Uo,jd as bo,kd as Fo,ld as Ao,md as xo,nd as ko,od as vo,pd as Wo,rc as yo,t as Oe,u as wo,w as To}from"./chunk-TN5ZZO3Q.js";import{$l as Dt,$m as Yt,Aa as b,Ab as x,Ad as yt,B as ie,Ba as y,Bb as D,Cb as gt,D as et,Dc as Ot,Dd as bt,Et as ao,Fb as d,Fn as we,Ft as lo,Ga as f,Gb as m,Gn as Jt,Gt as _o,Ha as rt,Hn as Qt,Ht as co,Ia as R,Il as Bt,In as Zt,Jb as ue,Jm as fe,Jn as eo,Ka as st,Kn as to,La as at,Ln as oo,Ma as lt,N as tt,Na as c,O as I,Oa as n,Ob as wt,Oc as ht,Pa as r,Pl as Y,Pn as V,Qa as C,Qb as Tt,Qc as Mt,S as ot,Sb as F,Tb as pe,Ua as _t,Uc as Lt,Ud as Ft,Va as ct,Vc as $e,Vm as jt,Vt as K,W as it,Wa as ut,Wc as X,Wt as q,Xa as M,Xc as Pt,Xi as kt,Xw as fo,Yb as Nt,Yi as ye,Z as _,_a as l,_l as Gt,ab as pt,am as Xt,aq as no,au as Te,aw as mo,b as Qe,bb as dt,bq as ro,bw as Jo,ca as N,cf as xt,cm as zt,cv as re,cw as Ne,da as O,db as h,dl as B,dn as Kt,eb as p,ee as At,el as vt,ev as be,ew as Eo,fb as mt,gb as Et,gn as qt,gw as So,ha as Ue,i as Ze,id as It,iq as so,jd as j,jh as me,k as w,kl as A,kv as po,l as S,lw as Co,m as G,ma as ae,md as z,mm as Se,mu as uo,nb as St,nc as ne,np as io,om as Ce,pc as k,qb as le,qd as Ut,ql as Ee,qm as Vt,rc as de,sb as _e,sd as $t,sy as Ro,ta as a,ty as go,ub as ce,uc as v,v as se,vb as Ct,wb as ft,wl as Wt,wm as Ht,xa as U,ya as nt,yb as Rt,yc as W,yn as Re,zn as ge}from"./chunk-N6MTJI5Q.js";import"./chunk-UNNH6OJB.js";import{a as Pe,b as Ie,f as qo,h as T}from"./chunk-HE2D45TV.js";var Zo=Bt(vt),ve=(()=>{class o extends Zo{constructor(){super(...arguments),this.reportOptions=[H,Ae,xe],this.pluckReportLabel=e=>({[H]:$localize`Never`,[Ae]:$localize`Daily`,[xe]:$localize`Weekly`})[e]}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=ae(o)))(i||o)}})()}static{this.\u0275cmp=U({type:o,selectors:[["ww-user-performance-select"]],hostAttrs:[1,"ww-user-performance-select"],standalone:!1,features:[b],decls:1,vars:3,consts:()=>{let e;e=$localize`Send performance updates`;let t;return t=$localize`Send weekly emails with visit metrics like wait times, serve rates, and customer activity.`,[["label",e,"sublabel",t,3,"data","pluckLabel","formControl"]]},template:function(t,i){t&1&&C(0,"ww-select",0),t&2&&c("data",i.reportOptions)("pluckLabel",i.pluckReportLabel)("formControl",i._formControl)},dependencies:[V,k,W],encapsulation:2,changeDetection:0})}}return o})();var oi=["*"];function ii(o,u){if(o&1){let e=M();n(0,"button",8),h("click",function(){N(e);let i=p(2);return O(i.onLink())}),l(1,1),r()}}function ni(o,u){if(o&1){let e=M();n(0,"button",9),h("click",function(){N(e);let i=p(2);return O(i.onUnlink())}),l(1,2),r()}}function ri(o,u){if(o&1&&(_t(0),f(1,ii,2,0,"button",6),d(2,"async"),f(3,ni,2,0,"button",7),d(4,"async"),ct()),o&2){let e=p();a(),R(m(2,2,e.canLink$)?1:-1),a(2),R(m(4,4,e.canUnlink$)?3:-1)}}function si(o,u){o&1&&(n(0,"div",10),C(1,"mat-spinner"),r())}var We=(()=>{class o extends B{constructor(){super(),this.commonDisplay=_(No),this.userRx=_(q),this.resourceRx=_(Te),this.permissionRx=_(K),this.linkResource=new Ue,this.unlinkResource=new Ue,this.formControl=new v(null),this.selectedResource$=yt(this.formControl),this.linkableResources$=G([this.resourceRx.resources$,this.userRx.userId$]).pipe(S(([e,t])=>e.filter(i=>!i.isCategory&&(i.userId===t||It(i.userId))))),this.pluckResourceLabel=e=>this.commonDisplay.displayResource(e),this.pluckSearchResourceLabel=e=>e.name,this.userResourceId$=this.userRx.getCurrentUser(["resourceId"]).pipe(S(({resourceId:e})=>e??null)),this.canUnlink$=G([this.selectedResource$,this.userResourceId$]).pipe(S(([e,t])=>!e||!t?!1:e.id===t)),this.canLink$=G([this.selectedResource$,this.userResourceId$]).pipe(S(([e,t])=>e?e.id!==t:!1)),this.userResource$=this.userResourceId$.pipe(tt(e=>e?this.resourceRx.getResource(e):Ze(null)),this.shareReplay()),this.readonly$=this.permissionRx.lacksPermission("resources.update"),this.subscribe()}onLink(){this.formControl.value&&this.linkResource.emit(this.formControl.value)}onUnlink(){return T(this,null,function*(){let e=yield w(this.userResource$);e&&this.unlinkResource.emit(e)})}subscribe(){this.userResource$.pipe(I(this.ngOnDestroy$)).subscribe(e=>this.formControl.setValue(e))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=U({type:o,selectors:[["ww-link-resource"]],hostAttrs:[1,"ww-link-resource"],outputs:{linkResource:"linkResource",unlinkResource:"unlinkResource"},standalone:!1,features:[b],ngContentSelectors:oi,decls:8,vars:11,consts:()=>{let e;e=$localize`None`;let t;t=$localize`Linked resource`;let i;i=$localize`Link`;let s;s=$localize`Unlink`;let E;E=$localize` Link `;let L;return L=$localize` Unlink `,[["loadingTmpl",""],E,L,[1,"flex","gap-2","items-center","flex-wrap"],["placeholder",e,"ariaLabel",t,1,"max-w-full",3,"data","searchable","readonly","formControl","pluckLabel","pluckSearchLabel"],[4,"wwPermission"],["wwButton","secondary","aria-label",i],["wwButton","secondary","aria-label",s],["wwButton","secondary","aria-label",i,3,"click"],["wwButton","secondary","aria-label",s,3,"click"],[1,"flex","justify-center","p-4"]]},template:function(t,i){t&1&&(mt(),n(0,"span",3),C(1,"ww-select",4),d(2,"async"),d(3,"async"),y(4,ri,5,6,"ng-container",5),Et(5),r(),y(6,si,2,0,"ng-template",null,0,ue)),t&2&&(a(),c("data",m(2,7,i.linkableResources$))("searchable",!0)("readonly",m(3,9,i.readonly$))("formControl",i.formControl)("pluckLabel",i.pluckResourceLabel)("pluckSearchLabel",i.pluckSearchResourceLabel),a(3),c("wwPermission","resources.update"))},dependencies:[To,fe,Y,V,k,W,F],encapsulation:2,changeDetection:0})}}return o}
1)();function ci(o,u){o&1&&(n(0,"span",12),C(1,"ww-icon",13),n(2,"span",14)(3,"h5",15)(4,"span"),l(5,0),r(),n(6,"ww-chip",16),l(7,1),r()(),n(8,"p"),l(9,2),r()()()),o&2&&(a(6),c("wwColor","success")("wwBackgroundColor","success-alpha-10"))}function ui(o,u){o&1&&(n(0,"ww-chip",16),l(1,7),r()),o&2&&c("wwColor","success")("wwBackgroundColor","success-alpha-10")}function pi(o,u){if(o&1){let e=M();n(0,"button",22),h("click",function(){N(e);let i=p(3);return O(i.linkGoogleProvider())}),l(1,8),r()}}function di(o,u){o&1&&(n(0,"ww-chip",16),l(1,9),r()),o&2&&c("wwColor","success")("wwBackgroundColor","success-alpha-10")}function mi(o,u){if(o&1){let e=M();n(0,"button",22),h("click",function(){N(e);let i=p(3);return O(i.changePassword())}),l(1,10),r()}}function Ei(o,u){if(o&1){let e=M();n(0,"button",22),h("click",function(){N(e);let i=p(3);return O(i.linkPasswordProvider())}),l(1,11),r()}}function Si(o,u){if(o&1&&(n(0,"span",12),C(1,"ww-icon",17),n(2,"span",14)(3,"h5",15)(4,"span"),l(5,3),r(),f(6,ui,2,2,"ww-chip",16),r(),n(7,"p"),l(8,4),r()(),n(9,"div",18),f(10,pi,2,0,"button",19),r()(),C(11,"ww-section-divider",20),n(12,"span",12),C(13,"ww-icon",21),n(14,"span",14)(15,"h5",15)(16,"span"),l(17,5),r(),f(18,di,2,2,"ww-chip",16),r(),n(19,"p"),l(20,6),r()(),n(21,"div",18),f(22,mi,2,0,"button",19)(23,Ei,2,0,"button",19),r()()),o&2){let e=p();a(6),R(e.google?6:-1),a(4),R(e.google?-1:10),a(8),R(e.password?18:-1),a(4),R(e.password?22:23)}}function Ci(o,u){o&1&&f(0,ci,10,2,"span",12)(1,Si,24,4),o&2&&R(u.sso?0:1)}var Be=(()=>{class o extends B{constructor(){super(...arguments),this.coreUserRx=_(Ro),this.firebaseAuth=_(me),this.updateCurrentUserWrite=_(Ne),this.wwDialog=_(ge),this.wwSnackBar=_(qt),this.providerIds$=this.firebaseAuth.user$.pipe(se(j),S(e=>e.providerData.map(t=>t.providerId))),this.providers$=this.providerIds$.pipe(S(e=>({sso:e.some(t=>lo(t)||_o(t)),google:e.some(co),password:e.some(ao)})))}updatePassword(e,t){return T(this,null,function*(){let i=yield w(this.providers$);if(!i.password)return"no-password-provider";let s=yield w(this.coreUserRx.getCurrentUser(["id","email"])),E=s?.email;if(!s||!E||!i.password)return"invalid-password";try{yield this.firebaseAuth.signInWithEmailAndPassword(E,e)}catch(L){return"invalid-password"}try{yield this.updateCurrentUserWrite.call({password:t},!0)}catch(L){return"update-failed"}try{let L=yield this.firebaseAuth.signInWithEmailAndPassword(E,t);yield this.firebaseAuth.updateCurrentUser(L.user)}catch(L){console.error(L)}return"success"})}changePassword(){return T(this,null,function*(){let e=yield w(this.wwDialog.openPrompt({title:$localize`Change password`,message:$localize`To update your password, please provide your existing password and a new password.`,controls:[{component:A(we,{label:$localize`Existing password`}),required:!0},{component:A(we,{label:$localize`New password`}),required:!0}]}).afterClosed$),[t,i]=e??[];if(!z(t)||!z(i))return;let s=yield this.updatePassword(t,i);s==="no-password-provider"?this.wwSnackBar.open({message:$localize`Your user does not use password authentication.`}):s==="success"?this.wwSnackBar.open({message:$localize`Password updated successfully.`}):s==="invalid-password"&&this.wwSnackBar.open({message:$localize`Unable to update password.`})})}linkPasswordProvider(){return T(this,null,function*(){let e=yield w(this.wwDialog.openPrompt({title:$localize`Add password`,message:$localize`To link your account, please provide a password.`,controls:[{component:A(we,{label:$localize`Password`}),required:!0}]}).afterClosed$),[t]=e??[];z(t)&&(yield this.firebaseAuth.linkPassword(t))})}linkGoogleProvider(){return T(this,null,function*(){yield this.firebaseAuth.linkGoogle()})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=ae(o)))(i||o)}})()}static{this.\u0275cmp=U({type:o,selectors:[["ww-login-methods"]],hostAttrs:[1,"ww-login-methods"],standalone:!1,features:[b],decls:2,vars:3,consts:()=>{let e;e=$localize`Link with SSO`;let t;t=$localize` Active `;let i;i=$localize`Log into Waitwhile using your company's SSO`;let s;s=$localize`Link with Google account`;let E;E=$localize`Log into Waitwhile using your Google account`;let L;L=$localize` Link with email`;let $;$=$localize`Log into Waitwhile using your email and password`;let Q;Q=$localize` Active `;let Z;Z=$localize` Link `;let ee;ee=$localize` Active `;let te;te=$localize` Change password `;let oe;return oe=$localize` Link `,[e,t,i,s,E,L,$,Q,Z,ee,te,oe,[1,"ww-login-methods-section"],["size","x-large","icon","bxs-business"],[1,"ww-login-methods-section-description"],[1,"flex","items-center","gap-2"],["size","x-small",3,"wwColor","wwBackgroun
1dColor"],["size","x-large","icon","ww-logo-google-color"],[1,"ww-login-methods-section-actions"],["wwButton","secondary"],[1,"my-4"],["size","x-large","icon","bx-user"],["wwButton","secondary",3,"click"]]},template:function(t,i){if(t&1&&(f(0,Ci,2,1),d(1,"async")),t&2){let s;R((s=m(1,1,i.providers$))?0:-1,s)}},dependencies:[Y,Kt,Se,Ce,Zt,F],styles:[`.ww-login-methods .ww-login-methods-section{display:flex;column-gap:16px;align-items:center}.ww-breakpoints-below-mobile .ww-login-methods .ww-login-methods-section{flex-wrap:wrap;row-gap:8px}.ww-login-methods .ww-login-methods-section .ww-login-methods-section-description{width:400px}.ww-breakpoints-below-mobile .ww-login-methods .ww-login-methods-section .ww-login-methods-section-description{width:auto}.ww-login-methods .ww-login-methods-section .ww-login-methods-section-actions{display:flex;column-gap:16px;align-items:center;margin-left:auto} 2/*nooplogin-methods.component-C6VGBYLR.css.map */ 3`],encapsulation:2,changeDetection:0})}}return o})();var Ti=()=>["enablePerformanceReports"],Ni=()=>["users.update.reports","users.update-self.reports"],Oi=(o,u)=>({accountFeatures:o,somePermissions:u}),hi=()=>["users.update.notifications","users.update-self.notifications"],Mi=o=>({somePermissions:o});function Li(o,u){if(o&1&&(n(0,"ww-label-layout")(1,"ww-label")(2,"span"),l(3,1),r(),n(4,"ww-sublabel"),l(5,2),r()(),C(6,"ww-checkbox",7),r()),o&2){let e=p();a(6),c("formControl",e.formGroup.controls.showInAppNotificationsFormControl)("layout","vertical")}}function Pi(o,u){if(o&1&&C(0,"ww-user-performance-select",8),o&2){let e=p();c("formControl",e.formGroup.controls.performanceReport)}}function Ii(o,u){if(o&1&&C(0,"ww-user-notifications-form",9),o&2){let e=p();c("formControl",e.formGroup.controls.notifications)("tempus","first-person")}}var Ge=(()=>{class o extends B{constructor(){super(),this.pushNotificationService=_(po),this.updateUserWrite=_(Eo),this.changeDetectorRef=_(wt),this.layout=_(re),this.pendingChangesStore=_(be),this.permissionRx=_(K),this.userRx=_(q),this.formId="user-notifications",this.formGroup=new de({notifications:new v(null),performanceReport:new v(H,{nonNullable:!0}),showInAppNotificationsFormControl:new v(!1,{nonNullable:!0})}),this.user$=this.userRx.getCurrentUser(["id","notifications","reports"]),this.layout.updateFeatureContext({pendingChanges:{formId:this.formId,save:()=>this.save(),reset:()=>T(this,null,function*(){let e=yield w(this.user$);this.reset(e)}),store:this.pendingChangesStore,enabledConfig:{}}}),this.subscribe()}save(){return T(this,null,function*(){let e={};if(this.formGroup.controls.notifications.disabled||(e.notifications=Do(this.formGroup.controls.notifications.value??null)),this.formGroup.controls.performanceReport.disabled||(e.reports=this.performanceReportToPayload(this.formGroup.controls.performanceReport.value)),Object.keys(e).length===0)return;let t=yield w(this.user$);this.pushNotificationService.updateInAppNotifications(this.formGroup.controls.showInAppNotificationsFormControl.value,!0),this.updateUserWrite.payload.next({id:t.id,updates:e})})}reset(e){this.formGroup.reset({showInAppNotificationsFormControl:this.pushNotificationService.hasInAppNotifications,notifications:Go(e.notifications??null),performanceReport:e.reports?.performance?.[0]??H},{emitEvent:!1}),this.formGroup.markAsPristine(),this.formGroup.updateValueAndValidity(),this.pendingChangesStore.resetInitialValue(this.formGroup),this.changeDetectorRef.markForCheck()}performanceReportToPayload(e){return e===H?{performance:null}:{performance:[e]}}subscribe(){this.user$.pipe(se(j),ie(1),I(this.ngOnDestroy$)).subscribe(e=>this.reset(e)),this.permissionRx.hasSomePermission("users.update.notifications","users.update-self.notifications").pipe(I(this.ngOnDestroy$)).subscribe(e=>{e?this.formGroup.controls.notifications.enable({emitEvent:!1}):this.formGroup.controls.notifications.disable({emitEvent:!1})}),this.permissionRx.hasSomePermission("users.update.reports","users.update-self.reports").pipe(I(this.ngOnDestroy$)).subscribe(e=>{e?this.formGroup.controls.performanceReport.enable({emitEvent:!1}):this.formGroup.controls.performanceReport.disable({emitEvent:!1})}),this.ngOnDestroy$.pipe(ie(1)).subscribe(()=>
3{this.layout.updateFeatureContext({pendingChanges:null})}),this.pushNotificationService.hasInAppNotifications$.pipe(I(this.ngOnDestroy$)).subscribe(e=>{this.formGroup.controls.showInAppNotificationsFormControl.setValue(e,{emitEvent:!1})})}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=U({type:o,selectors:[["ww-user-notifications"]],hostAttrs:[1,"ww-user-notifications"],standalone:!1,features:[Rt([be,{provide:Gt,useFactory:e=>({layout:e.labelLayout$}),deps:[re]}]),b],decls:8,vars:15,consts:()=>{let e;e=$localize` Push notifications are sent through your browser and native iOS/Android apps (if installed). `;let t;t=$localize`Show`;let i;i=$localize`In-app push notifications`;let s;return s=$localize` Whether push notifications should be shown while using the app. `,[e,i,s,[1,"flex","flex-col","gap-6","below-mobile:p-4",3,"wwTrackPendingChanges","wwTrackPendingChangesUntil"],[1,"mb-2"],[3,"formControl",4,"wwFeatureEnabledConfig"],[3,"formControl","tempus",4,"wwFeatureEnabledConfig"],["label",t,3,"formControl","layout"],[3,"formControl"],[3,"formControl","tempus"]]},template:function(t,i){t&1&&(n(0,"div",3)(1,"ww-info-bubble",4),l(2,0),r(),C(3,"ww-push-notification-permission-trigger"),f(4,Li,7,2,"ww-label-layout"),d(5,"async"),y(6,Pi,1,1,"ww-user-performance-select",5)(7,Ii,1,2,"ww-user-notifications-form",6),r()),t&2&&(c("wwTrackPendingChanges",i.formGroup)("wwTrackPendingChangesUntil",i.updateUserWrite.response$),a(4),R(m(5,5,i.pushNotificationService.userHasConfiguredPushNotification$)?4:-1),a(2),c("wwFeatureEnabledConfig",gt(9,Oi,x(7,Ti),x(8,Ni))),a(),c("wwFeatureEnabledConfig",D(13,Mi,x(12,hi))))},dependencies:[Oe,Bo,he,Xo,Yt,Xt,Dt,zt,Re,k,W,ve,F],encapsulation:2,changeDetection:0})}}return o})();var De=qo(Jo());var Ho=$t()(["name","email","phone","language","locale"]),jo=10;var Ui=()=>["users.update.photoUrl","users.update-self.photoUrl"],Le=o=>({somePermissions:o}),$i=()=>["resources.update","resources.update-self"],Yo=()=>["resources.update","resources.update-hours","resources.update-self"];function yi(o,u){o&1&&le(0),o&2&&_e(" ",u,". ")}function bi(o,u){if(o&1&&(n(0,"ww-info-bubble",30)(1,"span")(2,"span"),l(3,7),r(),n(4,"span"),f(5,yi,1,1),d(6,"async"),r()()()),o&2){let e;p();let t=ft(9),i=p();a(3),pt(t.languageName)(t.countryCode),dt(3),a(2),R((e=m(6,3,i.publicLocalesLabel$))?5:-1,e)}}function Fi(o,u){if(o&1){let e=M();n(0,"ww-card",22),d(1,"async"),n(2,"ww-section",27)(3,"ww-section-title"),l(4,5),r(),n(5,"ww-section-content",28),C(6,"ww-joi-form",29),ce(7),d(8,"async"),ce(9),d(10,"async"),ce(11),d(12,"async"),f(13,bi,7,5,"ww-info-bubble",30),r(),n(14,"ww-section-actions",31)(15,"button",32),h("click",function(){N(e);let i=p();return O(i.save())}),l(16,6),r()()()()}if(o&2){let e=p();c("bordered",m(1,6,e.breakpoints.isAboveMobile$)),a(6),c("form",e.form)("wwTrackPendingChanges",e.form.options.formGroup)("wwTrackPendingChangesUntil",e.updateCurrentUserWrite.response$);let t=m(8,8,e.publicLocales$);a(3);let i=Ct(m(10,10,e.userLocale$)),s=m(12,13,e.userHaveUnsupportedLocale$);a(4),R(t&&i&&s?13:-1),a(2),c("disabled",e.formGroup.invalid)}}function Ai(o,u){if(o&1&&(n(0,"ww-card",22),d(1,"async"),n(2,"ww-section")(3,"ww-section-title"),l(4,8),r(),n(5,"ww-section-content"),C(6,"ww-image-select",33),r()()()),o&2){let e=p();c("bordered",m(1,3,e.breakpoints.isAboveMobile$)),a(6),c("formControl",e.photoUrlFormControl)("uploader",e.uploadUserProfileImage)}}function xi(o,u){if(o&1){let e=M();n(0,"button",38),h("click",function(){N(e);let i=p(),s=p(2);return O(s.editResource(i))}),l(1,11),r()}}function ki(o,u){if(o&1){let e=M();n(0,"button",38),h("click",function(){N(e);let i=p(),s=p(2);return O(s.openHoursByWeekdayEditorDialog(i))}),l(1,12),r()}}function vi(o,u){if(o&1){let e=M();n(0,"button",38),h("click",function(){N(e);let i=p(),s=p(2);return O(s.openHoursByDateEditorDialog(i))}),l(1,13),r()}}function Wi(o,u){o&1&&y(0,xi,2,0,"button",37)(1,ki,2,0,"button",37)(2,vi,2,0,"button",37),o&2&&(c("wwFeatureEnabledConfig",D(4,Le,x(3,$i))),a(),c("wwFeatureEnabledConfig",D(7,Le,x(6,Yo))),a(),c("wwFeatureEnabledConfig",D(10,Le,x(9,Yo))))}function Bi(o,u){if(o&1){let e=M();n(0,"ww-section")(1,"ww-section-title"),l(2,9),r(),n(3,"ww-section-subtitle"),l(4,10),r(),n(5,"ww-section-content",34)(6,"ww-link-resource",35),h("linkResource",function(i){N(e);let s=p();return O(s.linkResource(i))})("unlinkResource",function(i){N(e);let s=p();return O(s.unlinkResource(i))}),n(7,"div",36),f(8,Wi,3,12),d(9,"async"),r()()()()}if(o&2){let e,t=p();a(8),R((e=m(9,1,t.resourceRx.currentLocationUserResource$))?8:-1,e)}}function Gi(o,u){if(o&1){let e=M();n(0,"ww-setting-card")(1,"ww-setting-card-content")(2,"ww-setting-card-header")(3,"ww-setting-card-prefix"),C(4,"ww-illustration",26),r(),n(5,"ww-setting-card-title"),l(6,16),r(),n(7,"ww-setting-card-subtitle"),l(8,17),r(),n(9,"ww-setting-card-suffix")(10,"button",25),h("click",function(){N(e);let i=p(2);
3return O(i.integrationRx.disconnectOutlookCalendar())}),l(11,18),r()()()()()}o&2&&(a(4),c("icon","ww-logo-outlook"))}function Di(o,u){if(o&1){let e=M();n(0,"button",40),h("click",function(){N(e);let i=p(2);return O(i.connectOutlookCalendar())}),n(1,"ww-setting-card")(2,"ww-setting-card-content")(3,"ww-setting-card-header")(4,"ww-setting-card-prefix"),C(5,"ww-illustration",26),r(),n(6,"ww-setting-card-title"),l(7,19),r(),n(8,"ww-setting-card-subtitle"),l(9,20),r(),n(10,"ww-setting-card-suffix"),C(11,"ww-icon",26),r()()()()()}o&2&&(a(5),c("icon","ww-logo-outlook"),a(6),c("icon","bx-chevron-right"))}function Xi(o,u){if(o&1&&(n(0,"ww-setting-card")(1,"ww-setting-card-header")(2,"ww-setting-card-title")(3,"ww-setting-card")(4,"ww-setting-card-header")(5,"ww-setting-card-title"),l(6,14),r(),n(7,"ww-setting-card-subtitle"),l(8,15),r()()()()(),n(9,"ww-setting-card-content"),f(10,Gi,12,1,"ww-setting-card"),d(11,"async"),rt(12,Di,12,2,"button",39),r()()),o&2){let e=p();a(10),R(m(11,1,e.integrationRx.isOutlookConnected$)?10:12)}}function zi(o,u){o&1&&(n(0,"div",41),C(1,"mat-spinner"),r())}var Xe=(()=>{class o extends B{save(){this.formGroup.valid&&this.updateCurrentUserWrite.payload.next(this.formGroup.value)}editResource(e){this.dialog.open(A(Uo,{entity:e}),{size:"medium"})}linkResource(e){this.linkResourceSub.next(e.id)}unlinkResource(e){return T(this,null,function*(){e.userId&&e.externalCalendars&&e.externalCalendars.length>0&&!(yield this.integrationRx.promptUnlink(e.userId))||this.updateResourceWrite.payload.next({id:e.id,updates:{email:null,userId:null}})})}constructor(){super(),this.coreLocationRx=_(go),this.dialog=_(ge),this.firebaseAuth=_(me),this.permissionRx=_(K),this.removeUserAvatarWrite=_(So),this.revokeAuthTokensWrite=_(mo),this.ssoAuthService=_($o),this.titleCase=_(pe),this.updateResourceWrite=_(fo),this.uploadUserAvatarWrite=_(Co),this.userRx=_(q),this.breakpoints=_(Ee),this.integrationRx=_(uo),this.resourceRx=_(Te),this.updateCurrentUserWrite=_(Ne),this.formGroup=Lo(De.PAYLOAD_SCHEMA,new de(Wt()({name:["",ne.required],email:["",ne.required],phone:[""],language:[null,ne.required],locale:[null,ne.required]}))),this.form=Po({formGroup:this.formGroup,description:De.PAYLOAD_SCHEMA,labels:{name:$localize`Name`,email:$localize`Email`,phone:$localize`Phone`,language:$localize`Language`,locale:$localize`Region`},placeholders:{name:$localize`Ex. Walter Wait`,email:$localize`Ex. [email protected]`,language:$localize`Select language`,locale:$localize`Select region`,phone:this.getExamplePhoneNumber()??void 0},componentModifiers:{language:()=>this.languageSelector(),locale:()=>this.regionSelector(kt,this.userRx.nullableUser?.locale)},dependencies:()=>({name:this.permissionRx.hasSomePermission("users.update.name","users.update-self.name").pipe(S(e=>({hidden:!e}))),email:this.permissionRx.hasSomePermission("users.update.email","users.update-self.email").pipe(S(e=>({hidden:!e}))),phone:this.permissionRx.hasSomePermission("users.update.phone","users.update-self.phone").pipe(S(e=>({hidden:!e}))),language:this.permissionRx.hasSomePermission("users.update.language","users.update-self.language").pipe(S(e=>({hidden:!e}))),locale:this.permissionRx.hasSomePermission("users.update.locale","users.update-self.locale").pipe(S(e=>({hidden:!e})))})}),this.hasSomePermission$=this.permissionRx.hasSomePermission("users.update.name","users.update-self.name","users.update.email","users.update-self.email","users.update.phone","users.update-self.phone","users.update.language","users.update-self.language","users.update.locale","users.update-self.locale"),this.initialValue$=this.userRx.getCurrentUser(Ho),this.photoUrlFormControl=new v(null),this.uploadUserProfileImage=e=>T(this,null,function*(){let t=yield w(this.userRx.getCurrentUser(["id"]).pipe(S(s=>s.id)));return this.uploadUserAvatarWrite.payload.next({userId:t,dataUrl:e}),(yield w(this.uploadUserAvatarWrite.response$))?.url}),this.linkResourceSub=new Qe,this.linkResourcePayload$=this.linkResourceSub.pipe(ot(this.userRx.getCurrentUser(["id","email"])),S(([e,t])=>({resourceId:e,userId:t.id,email:t.email}))),this.canInteractWithUserResource$=G([this.resourceRx.currentLocationUserResource$,this.permissionRx.hasPermission("resources.update")]).pipe(S(([e,t])=>!!e||t),et()),this.location$=this.coreLocationRx.getCurrentNullableLocation(["id","i18n","publicLocales"]),this.publicLocales$=this.location$.pipe(S(e=>At(e?.publicLocales))),this.publicLocalesLabel$=this.publicLocales$.pipe(S(e=>e.length>jo?null:`The location languages are ${Ft(e.map(t=>X(t)).filter(j).map(t=>`${t.languageName} (${t.countryCode})`),$localize`and`)}`)),this.userLocaleCode$=this.userRx.getCurrentUser(["locale"]).pipe(S(e=>e.locale)),this.userLocale$=this.userLocaleCode$.pipe(S(e=>X(e))),this.userHaveUnsupportedLocale$=G([this.publicLocales$,this.userLocaleCode$]).pipe(S(([e,t])=>z(t)&&Ut(z)(e)?!e.includes(t):!1)),this.subscribeToInitialPhotoValue(),this.subscribeToUpdateUserPhoto(),this.subscribeToResourceLinking(),this.subscribeToSetInitialValue()}
3connectOutlookCalendar(){return T(this,null,function*(){xt.IOS_NATIVE?this.dialog.openConfirm({title:$localize`Connect Outlook calendar`,message:$localize`To connect your Outlook calendar, please use the web version of Waitwhile.`,cancelLabel:null,confirmLabel:$localize`OK`}):this.integrationRx.connectOutlookCalendar()})}logout(){return T(this,null,function*(){if(yield w(this.dialog.openConfirm({title:$localize`Logout from all devices`,message:$localize`You'll be signed out of your account on all devices. You can sign back in at any time.`,confirmLabel:$localize`Logout`,confirmColor:"warning",cancelLabel:$localize`Cancel`}).afterClosed$)){let t,i=yield w(this.ssoAuthService.hasSsoSlo$);i||(t=yield w(this.ssoAuthService.ssoLogoutUrl$)),this.revokeAuthTokensWrite.payload.next(),(yield w(this.revokeAuthTokensWrite.response$)).statusCode===200&&(i?this.ssoAuthService.logout():this.firebaseAuth.signOut(t))}})}openHoursByWeekdayEditorDialog(e){return T(this,null,function*(){let t=this.dialog.open(A(ho,{title:`Edit weekly hours for ${e.name}`,name:e.name,inheritsFromLocation:!0,defaultHours:Fe(this.coreLocationRx.nullableLocation),openingHours:Fe(this.coreLocationRx.nullableLocation),hours:e.hours,bookingHours:e.bookingHours,waitlistHours:e.waitlistHours}),{size:"x-large"}),i=yield w(t.afterClosed$);i&&this.updateResourceWrite.payload.next({id:e.id,updates:i})})}openHoursByDateEditorDialog(e){return T(this,null,function*(){let t=this.dialog.open(A(Oo,{title:`Edit hours by date ${e.name}`,name:e.name,defaultHours:this.coreLocationRx.nullableLocation,openingHours:this.coreLocationRx.nullableLocation,hoursByDate:e.hoursByDate,bookingHoursByDate:e.bookingHoursByDate,waitlistHoursByDate:e.waitlistHoursByDate,entityName:$localize`resource`}),{size:"x-large"}),i=yield w(t.afterClosed$);i&&this.updateResourceWrite.payload.next({id:e.id,updates:i})})}languageSelector(){let e=ye.reduce((t,i)=>{let s=Pt(i);return s?Ie(Pe({},t),{[i]:s.languageNativeName}):t},{});return A(V,{label:$localize`Language`,data:ye,pluckLabel:t=>this.titleCase.transform(e[t]),pluckSearchLabel:t=>e[t]})}regionSelector(e,t){let i=[...e];return t&&!e.includes(t)&&X(t)&&i.push(t),A(V,{label:$localize`Region`,data:i,pluckLabel:s=>{let E=X(s);return E?`${E.countryNativeName} (${E.countryCode})`:`${$e.countryNativeName} (${$e.countryCode})`},pluckSearchLabel:s=>{let E=X(s);return E?`${E.countryNativeName} ${E.countryCode}`:""}})}subscribeToInitialPhotoValue(){this.userRx.getCurrentUser(["photoUrl"]).pipe(ie(1),I(this.ngOnDestroy$)).subscribe(e=>{this.photoUrlFormControl.setValue(e.photoUrl??null,{emitEvent:!1})})}subscribeToUpdateUserPhoto(){this.photoUrlFormControl.valueChanges.pipe(I(this.ngOnDestroy$)).subscribe(e=>{e?this.updateCurrentUserWrite.payload.next({photoUrl:e}):this.removeUserAvatarWrite.payload.next()})}subscribeToResourceLinking(){this.linkResourcePayload$.pipe(I(this.ngOnDestroy$)).subscribe(e=>{this.updateResourceWrite.payload.next({id:e.resourceId,updates:{email:e.email,userId:e.userId}})})}subscribeToSetInitialValue(){this.initialValue$.pipe(I(this.ngOnDestroy$)).subscribe(e=>{this.formGroup.patchValue(Ie(Pe({},e),{locale:X(e.locale)?.code??Lt}))})}getExamplePhoneNumber(){return this.coreLocationRx.nullableLocation?$localize`Ex. ${Mt(this.coreLocationRx.nullableLocation.address?.country?.code??"US",yo)?.formatNational()}`:null}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=U({type:o,selectors:[["ww-user-profile"]],hostAttrs:[1,"ww-user-profile"],standalone:!1,features:[b],decls:31,vars:23,consts:()=>{let e;e=$localize`Login methods`;let t;t=$localize`Log out from all devices`;let i;i=$localize` You'll be signed out of your account on all devices. You can sign back in at any time. `;let s;s=$localize`Log out from all devices`;let E;E=$localize`Save`;let L;L=$localize`Personal data`;let $;$=$localize` Save `;let Q;Q=$localize` Your selected language ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) is not supported by the current location. `;let Z;Z=$localize`Profile image`;let ee;ee=$localize`Link to resource`;let te;te=$localize` By linking your log-in to a resource it allows you to manage the resource and to act as it. `;let oe;oe=$localize` Edit resource `;let P;P=$localize` Edit weekly hours `;let ze;ze=$localize` Edit hours by date `;let Ve;
3Ve=$localize` Connect resource to external calendar `;let He;He=$localize` Connect your linked resource to your external calendar to automatically synchronize your bookings and events. `;let je;je=$localize`Outlook`;let Ye;Ye=$localize` Connect your linked resource to your Outlook calendar. `;let Ke;Ke=$localize` Disconnect `;let qe;qe=$localize`Outlook`;let Je;return Je=$localize` Connect your linked resource to your Outlook calendar. `,[["loadingTmpl",""],e,t,i,s,L,$,Q,Z,ee,te,oe,P,ze,Ve,He,je,Ye,Ke,qe,Je,[1,"flex","flex-col","gap-8"],[3,"bordered"],[3,"bordered",4,"wwFeatureEnabledConfig"],[1,"flex","!flex-row"],["wwButton","secondary",3,"click"],[3,"icon"],["wwBackgroundColor","white",1,"ww-user-profile-personal-data"],[1,"flex","flex-col","gap-4"],[3,"form","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[1,"w-full","max-w-full"],["alignment","left"],["wwButton","","aria-label",E,3,"click","disabled"],["shape","round",3,"formControl","uploader"],[1,"flex","!flex-row","gap-4","flex-wrap","items-baseline"],[1,"w-full",3,"linkResource","unlinkResource"],[1,"flex","gap-2","w-full"],["wwButton","secondary","type","button",3,"click",4,"wwFeatureEnabledConfig"],["wwButton","secondary","type","button",3,"click"],[1,"text-start"],[1,"text-start",3,"click"],[1,"flex","justify-center","p-4"]]},template:function(t,i){t&1&&(n(0,"div",21),f(1,Fi,17,15,"ww-card",22),d(2,"async"),y(3,Ai,7,5,"ww-card",23),n(4,"ww-card",22),d(5,"async"),n(6,"ww-section")(7,"ww-section-title"),l(8,1),r(),n(9,"ww-section-content"),C(10,"ww-login-methods"),r()()(),n(11,"ww-card",22),d(12,"async"),f(13,Bi,10,3,"ww-section"),d(14,"async"),r(),f(15,Xi,13,3,"ww-setting-card"),d(16,"async"),n(17,"ww-card",22),d(18,"async"),n(19,"ww-section")(20,"ww-section-title"),l(21,2),r(),n(22,"ww-section-subtitle"),l(23,3),r(),n(24,"ww-section-content",24)(25,"button",25),h("click",function(){return i.logout()}),C(26,"ww-icon",26),n(27,"span"),l(28,4),r()()()()()(),y(29,zi,2,0,"ng-template",null,0,ue)),t&2&&(a(),R(m(2,8,i.hasSomePermission$)?1:-1),a(2),c("wwFeatureEnabledConfig",D(21,Le,x(20,Ui))),a(),c("bordered",m(5,10,i.breakpoints.isAboveMobile$)),a(7),c("bordered",m(12,12,i.breakpoints.isAboveMobile$)),a(2),R(m(14,14,i.canInteractWithUserResource$)?13:-1),a(2),R(m(16,16,i.integrationRx.canConnectCalendar$)?15:-1),a(2),c("bordered",m(18,18,i.breakpoints.isAboveMobile$)),a(9),c("icon","bx-log-out"))},dependencies:[Oe,Wo,Fo,bo,Ao,xo,ko,vo,he,fe,Y,jt,Se,Ce,Vt,io,Re,Jt,oo,Qt,eo,to,Mo,k,W,We,Be,F],encapsulation:2,changeDetection:0})}}return o})();function Vi(o,u){if(o&1&&(n(0,"a",1),d(1,"async"),le(2),r()),o&2){let e=u.$implicit,t=p();c("active",e===m(1,4,t.activeTabNavItem$))("wwNativeQueryParams",e.queryParams)("label",e.label),a(2),_e(" ",e.label," ")}}function Hi(o,u){o&1&&ut(0)}function ji(o,u){o&1&&y(0,Hi,1,0,"ng-container",3),o&2&&c("ngComponentOutlet",u.component)}var Ko=(()=>{class o{constructor(){this.breakpoints=_(Ee),this.layout=_(re),this.tabNavItems=[{label:$localize`Your profile`,queryParams:{params:{tab:"profile"}},component:Xe},{label:$localize`Notifications`,queryParams:{params:{tab:"notifications"}},component:Ge}],this.activeTabNavItem$=bt().pipe(S(e=>this.tabNavItems.find(t=>t.queryParams.params.tab===e.tab)||this.tabNavItems[0])),this.layout.setFeatureContext({name:$localize`User settings`})}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=U({type:o,selectors:[["ww-user"]],hostAttrs:[1,"ww-user"],standalone:!1,decls:7,vars:8,consts:[[1,"flex","w-full",3,"type"],["wwTabBarItem","",3,"active","wwNativeQueryParams","label"],[1,"flex","flex-col","flex-1","p-6","gap-y-4","max-w-4xl"],[4,"ngComponentOutlet"]],template:function(t,i){if(t&1&&(n(0,"ww-tab-bar",0),at(1,Vi,3,6,"a",1,st),r(),n(3,"div",2),d(4,"async"),f(5,ji,1,1,"ng-container"),d(6,"async"),r()),t&2){let s;c("type","fill"),a(),lt(i.tabNavItems),a(2),St("!p-0",m(4,4,i.breakpoints.isBelowMobile$)),a(2),R((s=m(6,6,i.activeTabNavItem$))?5:-1,s)}},dependencies:[Tt,Ht,ro,no,F],encapsulation:2,changeDetection:0})}}return o})();var is=(()=>{class o{static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275mod=nt({type:o})}static{this.\u0275inj=it({providers:[pe],imports:[Nt,ht.forChild([wo({path:"",component:Ko},{trackPendingChanges:!0})]),zo,so,Io,Ot]}
3)}}return o})();export{We as WwLinkResourceComponent,Be as WwLoginMethodsComponent,Ko as WwUserComponent,is as WwUserModule,Ge as WwUserNotificationsComponent,ve as WwUserPerformanceSelectComponent,Xe as WwUserProfileComponent}; 4//noopchunk-WWGJTIZY.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.