import{a as w}from"./chunk-3NQXB5WN.js";import{a as p}from"./chunk-2YWX5GX7.js";import{b as o,c as n}from"./chunk-WUIJKQUK.js";import{V as r}from"./chunk-7BYF4LVK.js";import{J as d,M as h,d as m}from"./chunk-4SVIVQBS.js";import{f as l}from"./chunk-4IDNTCH7.js";var e=(function(i){return i.Diagram="Diagram",i.Summary="Summary",i.CheckIn="CheckIn",i.Presentation="Presentation",i.Needs="Needs",i.Completion="Completion",i.Inspection="Inspection",i.JobSummary="JobSummary",i.Pricing="Pricing",i.Negotiation="Negotiation",i})(e||{});var N=(()=>{let s=class s{constructor(t,a){this.appointmentUiService=t,this.routeService=a,this.activeUser=null,this.isAssignedUser=!1,this.backLabel="Go Back",this.forwardLabel="Go Forward",this.customLabel="Custom",this.canGoBack=!1,this.goBack$=new m,this.canGoForward=!1,this.goForward$=new m,this.canGoCustom=!1,this.goCustom$=new m,this.showCustomNavControl=!1,this.showCustomNavIndicator=!0,this.viewingPhoto=!1,this.managingPhotos=!1,this.closingManagePhotos=!1,this.managingAdditionalConsiderations=!1,this.showConsiderationPrices=!1,this.showQuoteControl=!1}get canModifyAppointment(){return this.appointment!=null&&this.activeUser?.id==this.appointment.assignedTo?.id&&this.appointment.status!=r.Canceled&&this.appointment.status!=r.Dispositioned&&this.appointment.status!=r.PendingSubmission&&this.appointment.status!=r.Submitted}setActiveUser(t){this.activeUser=t}setBackLabel(t){this.backLabel=t}setForwardLabel(t){this.forwardLabel=t}setCustomLabel(t){this.customLabel=t}initRoutes(t,a){return l(this,null,function*(){let c={Summary:new o(e.Summary),CheckIn:new o(e.CheckIn),Needs:new o(e.Needs),Presentation:new o(e.Presentation),Completion:new o(e.Completion),Inspection:new o(e.Inspection),JobSummary:new o(e.JobSummary),Pricing:new o(e.Pricing),Negotiation:new o(e.Negotiation)},u="Summary";t.status==r.PendingSubmission&&(u="Completion");let g=e[u];g!=null?this.routeService.init(c,g,250,a):this.routeService.init(c,e.Summary,250,a)})}viewPhoto(t){this.photoSrc=t,this.viewingPhoto=!0}stopViewingPhoto(){this.viewingPhoto=!1,setTimeout(()=>{this.photoSrc=void 0},500)}managePhotos(t){this.managingPhotos||(window.clearTimeout(this.managePhotosTimer),this.closingManagePhotos=!1,this.managingPhotos=!0,this.managingPhotosEntity=t)}stopManagingPhotos(){window.clearTimeout(this.managePhotosTimer),this.closingManagePhotos=!0,this.managePhotosTimer=window.setTimeout(()=>{this.managingPhotos=!1,this.closingManagePhotos=!1,this.managingPhotosEntity=void 0},200)}manageAdditionalConsiderations(t=!1){this.managingAdditionalConsiderations=!0,this.showConsiderationPrices=t}stopManagingAdditionalConsiderations(){this.managingAdditionalConsiderations=!1}startSummary(t){}goToSummary(t){this.routeService.viewRoute(e.Summary,n.Reverse,!0)}completeSummary(t){this.routeService.viewRoute(e.CheckIn,n.Forward,!0)}startCheckIn(t){t.changed$.next()}goToCheckIn(t){this.routeService.viewRoute(e.CheckIn,n.Reverse,!0)}checkIn(t){this.routeService.viewRoute(e.Needs,n.Forward,!0)}startNeeds(t){}goToNeeds(t){this.routeService.viewRoute(e.Needs,n.Reverse,!0)}submitCustomerNeeds(t){this.routeService.viewRoute(e.Inspection,n.Forward,!0)}startInspection(t){}goToInspection(t){this.routeService.viewRoute(e.Inspection,n.Reverse,!0)}completeInspection(t){}startDetailedSummary(t){}completeDetailedSummary(t){}startPresentation(t){}completePresentation(t){}};s.\u0275fac=function(a){return new(a||s)(h(w),h(p))},s.\u0275prov=d({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})();export{e as a,N as b};
