!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="089dd75e-756c-4b37-b9cf-b641e044c7dc",e._sentryDebugIdIdentifier="sentry-dbid-089dd75e-756c-4b37-b9cf-b641e044c7dc")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1026],{43318:function(e,t,n){var r=n(85893),s=n(36948),a=n(52091),i=n(34292),l=n(57747),d=n(71293),o=n(22757),c=n(31377),u=n(46319),x=n(82443);t.Z=function(e){let{clinic:t}=e,{avatar_url:n,name:m,address:y}=t||{};return(0,r.jsxs)(i.U,{spacing:4,mb:{base:4,md:12},alignItems:"center","data-sentry-element":"HStack","data-sentry-component":"AppointmentClinicInfo","data-sentry-source-file":"clinic-info.tsx",children:[(0,r.jsx)(l.Cd,{p:3,bg:"brand.50",_dark:{bg:"brand.900"},"data-sentry-element":"Circle","data-sentry-source-file":"clinic-info.tsx",children:(0,r.jsx)(s.J,{as:a.ymq,fontSize:"2xl",color:"brand.500","data-sentry-element":"Icon","data-sentry-source-file":"clinic-info.tsx"})}),(0,r.jsxs)(l.xu,{"data-sentry-element":"Box","data-sentry-source-file":"clinic-info.tsx",children:[(0,r.jsx)(d.x,{fontWeight:"bold",mb:1,"data-sentry-element":"Text","data-sentry-source-file":"clinic-info.tsx",children:x.u.CLINIC}),(0,r.jsxs)(i.U,{spacing:6,"data-sentry-element":"HStack","data-sentry-source-file":"clinic-info.tsx",children:[(0,r.jsx)(u.Z,{avatarUrl:n||"",name:m||"",width:24,"data-sentry-element":"ClinicLogo","data-sentry-source-file":"clinic-info.tsx"}),(0,r.jsxs)(l.xu,{"data-sentry-element":"Box","data-sentry-source-file":"clinic-info.tsx",children:[(0,r.jsx)(o.X,{size:"md","data-sentry-element":"Heading","data-sentry-source-file":"clinic-info.tsx",children:m}),(0,c.yL)(y||{}).map(e=>(0,r.jsx)(d.x,{fontSize:"sm",color:"gray.500",children:e},e))]})]})]})]})}},9757:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(85893),s=n(67294),a=n(49429),i=n(81323),l=function(e){let{children:t,center:n}=e;return(0,r.jsx)(i.D5,{mapId:"5b06494c4f1015c3",defaultCenter:n,defaultZoom:13,zoomControl:!1,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,rotateControl:!1,fullscreenControl:!1,controlled:!1,"data-sentry-element":"GoogleMap","data-sentry-component":"Map","data-sentry-source-file":"map.tsx",children:t})},d=n(36948),o=n(52091),c=n(57747),u=function(e){let{position:t}=e;return(0,r.jsx)(i._Q,{position:t,"data-sentry-element":"AdvancedMarker","data-sentry-component":"Marker","data-sentry-source-file":"marker.tsx",children:(0,r.jsx)(c.xu,{position:"relative","data-sentry-element":"Box","data-sentry-source-file":"marker.tsx",children:(0,r.jsx)(c.xu,{position:"absolute",top:"-24px",left:"-24px","data-sentry-element":"Box","data-sentry-source-file":"marker.tsx",children:(0,r.jsx)(c.Cd,{p:2,style:{width:"fit-content"},bg:"accent.100","data-sentry-element":"Circle","data-sentry-source-file":"marker.tsx",children:(0,r.jsx)(c.Cd,{p:2,bg:"accent.500","data-sentry-element":"Circle","data-sentry-source-file":"marker.tsx",children:(0,r.jsx)(d.J,{as:o.IHQ,fontSize:"md",color:"white","data-sentry-element":"Icon","data-sentry-source-file":"marker.tsx"})})})})})})},x=function(e){return(0,r.jsx)(c.xu,{...e,"data-sentry-element":"Box","data-sentry-component":"MapContainer","data-sentry-source-file":"map-container.tsx",children:e.children})},m=n(12805),y=function(e){let{clinic:t,width:n}=e,{address:i}=t,{addressToLatLng:d}=(0,m.i)(),[o,c]=(0,s.useState)(),y=(0,s.useCallback)(async()=>{let e="".concat(null==i?void 0:i.street_a,", ").concat(null==i?void 0:i.city,", ").concat(null==i?void 0:i.state," ").concat(null==i?void 0:i.zip,", ").concat(null==i?void 0:i.country),{lat:t,lng:n}=await d(e);return{lat:t,lng:n}},[i,d]);return((0,s.useEffect)(()=>{y().then(e=>c(e))},[i,y]),o)?(0,r.jsx)(a.o,{ratio:4/3,w:n||"196px","data-sentry-element":"AspectRatio","data-sentry-component":"ClinicMap","data-sentry-source-file":"clinic-map.tsx",children:(0,r.jsx)(x,{h:"full",w:"full",rounded:"2xl",bg:"gray.50",overflow:"hidden",mr:4,"data-sentry-element":"MapContainer","data-sentry-source-file":"clinic-map.tsx",children:(0,r.jsx)(l,{center:o,"data-sentry-element":"Map","data-sentry-source-file":"clinic-map.tsx",children:(0,r.jsx)(u,{position:o,"data-sentry-element":"Marker","data-sentry-source-file":"clinic-map.tsx"})})})}):null}},97521:function(e,t,n){var r=n(85893),s=n(52091),a=n(87874),i=n(5674),l=n(57747),d=n(31377),o=n(58555),c=n(82443);t.Z=function(e){var t,n;let{appointment:u,rescheduleRequest:x}=e,{clinic:m,patient:y,service:f,service_name:h,minutes:p,clinician:g,client_notes:_,start_time:v,drop_off_time:E}=u,[I,T]=(0,d.W4)({startTime:v,dropOffTime:E,serviceDropOff:null==f?void 0:f.drop_off_time,minutes:p,timeZone:null==m?void 0:m.time_zone});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.M,{columns:{base:1,md:2},gridGap:8,"data-sentry-element":"SimpleGrid","data-sentry-source-file":"info.tsx",children:[(0,r.jsx)(o.Z,{label:c.u.PATIENT,icon:s.IHQ,primaryText:(null==y?void 0:y.name)||"",secondaryText:"".concat((null==y?void 0:null===(t=y.clinic_species)||void 0===t?void 0:t.species)||"").concat((null==y?void 0:y.breed)?", ".concat(null==y?void 0:y.breed):""),enhancer:(0,r.jsx)(a.q,{size:"sm",src:(null==y?void 0:null===(n=y.pet)||void 0===n?void 0:n.avatar_url)||"",name:(null==y?void 0:y.name)||""}),"data-sentry-element":"ReviewItem","data-sentry-source-file":"info.tsx"}),(0,r.jsx)(o.Z,{label:c.u.SERVICE,icon:s.gQF,primaryText:(null==f?void 0:f.name)||h||"",secondaryText:(null==f?void 0:f.name)&&h||"","data-sentry-element":"ReviewItem","data-sentry-source-file":"info.tsx"}),(0,r.jsx)(o.Z,{label:c.u.CLINICIAN,icon:s.K7y,primaryText:(null==g?void 0:g.name)||"",secondaryText:(null==g?void 0:g.authority_level)||"",enhancer:(0,r.jsx)(a.q,{size:"sm",src:(null==g?void 0:g.avatar_url)||"",name:(null==g?void 0:g.name)||""}),"data-sentry-element":"ReviewItem","data-sentry-source-file":"info.tsx"}),(0,r.jsx)(l.xu,{textDecoration:x?"line-through":"none","data-sentry-element":"Box","data-sentry-source-file":"info.tsx",children:(0,r.jsx)(o.Z,{label:E||(null==f?void 0:f.drop_off_time)?c.u.DROP_OFF_TIME:c.u.DATE,icon:s.qyc,primaryText:I,secondaryText:T,"data-sentry-element":"ReviewItem","data-sentry-source-file":"info.tsx"})})]}),_&&(0,r.jsx)(l.xu,{mt:8,children:(0,r.jsx)(o.Z,{label:c.u.YOUR_NOTES,icon:s.KPP,primaryText:_})})]})}},62847:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(85893),s=n(11163),a=n(93108),i=n(11824);function l(e){let{children:t,...n}=e,l=(0,s.useRouter)();return(0,r.jsx)(a.z,{colorScheme:"accent",onClick:()=>{l.push("".concat(i.Z.Login,"?returnUrl=").concat(l.asPath))},size:{base:"sm",md:"md"},...n,"data-sentry-element":"Button","data-sentry-component":"LoginButton","data-sentry-source-file":"login-button.tsx",children:null!=t?t:"Log In"})}},43985:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(85893);n(67294);var s=n(33361),a=n(15755),i=n(3877),l=n(82443);function d(e){let{numMatches:t}=e;return(0,r.jsxs)(s.Z,{textAlign:"center",align:"center",spacing:1,mb:4,"data-sentry-element":"SharedStack","data-sentry-component":"MatchSelectSubheader","data-sentry-source-file":"match-select-subheader.tsx",children:[1===t?(0,r.jsx)(i.Z,{children:l.u.SINGLE_PATIENT_MATCH_TITLE}):(0,r.jsx)(i.Z,{children:l.u.MULTIPLE_PATIENT_MATCH_TITLE(t)}),1===t?(0,r.jsx)(a.Z,{children:l.u.SINGLE_PATIENT_MATCH_DESCRIPTION}):(0,r.jsx)(a.Z,{children:l.u.MULTIPLE_PATIENT_MATCH_DESCRIPTION})]})}},67754:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(85893),s=n(52091),a=n(63016),i=n(36948),l=n(57747),d=n(71293),o=n(21516),c=n(33361),u=n(25996),x=n(82443);function m(e){let{searchResult:t,isSelected:n=!1,...m}=e,{client_name_preview:y,client_phone_preview:f,patient_name:h,patient_gender:p,patient_birthday:g}=t,_=new Date,v=g?x.u.AGE_DISPLAY((0,a.Z)(new Date(g),_)):x.u.NO_BIRTHDATE,E=p===o.NQQ.Unknown?"":p,I=[v,E].filter(Boolean).join(" | ");return(0,r.jsx)(u.Z,{w:"full",px:6,py:4,isSelected:n,...m,"data-sentry-element":"SelectableCard","data-sentry-component":"ReturningClientSearchResult","data-sentry-source-file":"returning-client-search-result.tsx",children:(0,r.jsxs)(c.Z,{row:!0,"data-sentry-element":"SharedStack","data-sentry-source-file":"returning-client-search-result.tsx",children:[!!h&&(0,r.jsxs)(c.Z,{row:!0,align:"center",flex:1,spacing:3,children:[(0,r.jsx)(i.J,{as:s.IHQ,color:"brand.600",boxSize:"24px"}),(0,r.jsxs)(l.xu,{children:[(0,r.jsx)(d.x,{fontSize:"16px",fontWeight:"semibold",color:"gray.7000",children:h}),(0,r.jsx)(d.x,{fontSize:"12px",color:"gray.500",children:I})]})]}),(0,r.jsxs)(c.Z,{row:!0,align:"center",flex:1,spacing:3,"data-sentry-element":"SharedStack","data-sentry-source-file":"returning-client-search-result.tsx",children:[(0,r.jsx)(i.J,{as:s.Xws,color:"brand.600",boxSize:"24px","data-sentry-element":"Icon","data-sentry-source-file":"returning-client-search-result.tsx"}),(0,r.jsxs)(l.xu,{"data-sentry-element":"Box","data-sentry-source-file":"returning-client-search-result.tsx",children:[(0,r.jsx)(d.x,{fontSize:"14px","data-sentry-element":"Text","data-sentry-source-file":"returning-client-search-result.tsx",children:y}),(0,r.jsx)(d.x,{fontSize:"12px",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"returning-client-search-result.tsx",children:f||x.u.NO_PHONE_NUMBER})]})]})]})})}},31026:function(e,t,n){n.d(t,{Z:function(){return np}});var r,s,a=n(85893),i=n(67294),l=n(93717),d=n(57747),o=n(20967),c=n(48783),u=n(84596),x=n(73037),m=n(22757),y=n(34292),f=n(87874),h=n(5674),p=n(23219),g=n(24259),_=n(71293),v=function(e){var t;let{clinician:n,setClinician:r,isSelected:s}=e;return(0,a.jsx)(d.xu,{role:"group",cursor:"pointer",onClick:()=>r(n),"data-sentry-element":"Box","data-sentry-component":"ClinicianItem","data-sentry-source-file":"clinician-item.tsx",children:(0,a.jsx)(p.Z,{px:4,py:3,rounded:"xl",shadow:"blue.md",transition:"all 0.2s",bg:s?"brand.50":"white",_dark:{bg:s?"brand.900":"gray.800",borderColor:s?"brand.500":"whiteAlpha.200"},borderWidth:1,borderColor:s?"brand.500":"blackAlpha.100",_groupHover:{bg:s?"brand.50":"gray.50",shadow:"blue.lg",_dark:{shadow:"none",bg:s?"brand.900":"gray.700"}},"data-sentry-element":"Card","data-sentry-source-file":"clinician-item.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"clinician-item.tsx",children:[(0,a.jsx)(g.Y,{isChecked:s,colorScheme:"brand",size:"lg","data-sentry-element":"Radio","data-sentry-source-file":"clinician-item.tsx"}),(0,a.jsx)(f.q,{src:n.avatar_url||"",name:n.name,getInitials:n.initials?()=>null!==(t=n.initials)&&void 0!==t?t:"":void 0,size:"md","data-sentry-element":"Avatar","data-sentry-source-file":"clinician-item.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"clinician-item.tsx",children:[(0,a.jsx)(_.x,{fontSize:"md",fontWeight:"semibold","data-sentry-element":"Text","data-sentry-source-file":"clinician-item.tsx",children:n.name}),(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"clinician-item.tsx",children:n.authority_level})]})]})})})},E=n(99398),I=n(31377),T=n(37602),j=n(82443),b=function(e){let{clinicians:t,clinicianFilter:n,setClinicianFilter:r}=e,{setDate:s,clinician:l}=(0,E.Q)();function o(e){r(e),s(void 0)}let u=(0,i.useMemo)(()=>(0,I.Y4)(t,"name"),[t]);return u.length>6?(0,a.jsxs)(c.g,{spacing:4,pt:6,children:[(0,a.jsx)(d.xu,{children:(0,a.jsx)(m.X,{size:"md",fontWeight:"semibold",children:j.u.CLINICIAN_SELECT_SECTION_TITLE})}),(0,a.jsx)(d.xu,{children:(0,a.jsx)(T.GZ,{value:(null==n?void 0:n.length)?n[0].name:(null==l?void 0:l.name)||"",placeholder:j.u.CLINICIAN_SELECT_SECTION_TITLE,onChange:e=>{let n=t.filter(t=>t.name===e);o(n)},options:u.map(e=>({value:e.name,label:e.name,leftElement:(0,a.jsx)(f.q,{size:"xs",src:e.avatar_url||"",name:e.name})})),buttonOverrides:{w:"400px",bg:"white",_dark:{bg:"gray.800"}}})})]}):(0,a.jsxs)(c.g,{w:"full",alignItems:{base:"center",md:"flex-start"},spacing:6,"data-sentry-element":"VStack","data-sentry-component":"Clinicians","data-sentry-source-file":"clinicians.tsx",children:[(0,a.jsx)(m.X,{size:"md",fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"clinicians.tsx",children:"Select a clinician"}),(0,a.jsx)(h.M,{w:"full",columns:{base:1,md:3},gridGap:{base:4,md:6},"data-sentry-element":"SimpleGrid","data-sentry-source-file":"clinicians.tsx",children:u.map(e=>(0,a.jsx)(v,{clinician:e,setClinician:e=>o(t.filter(t=>t.name===(null==e?void 0:e.name))),isSelected:(null==n?void 0:n.length)?null==n?void 0:n.some(t=>t.id===e.id):e.id===(null==l?void 0:l.id)},e.id))})]})},S=function(e){let{label:t,isSelected:n,...r}=e;return(0,a.jsx)(d.xu,{role:"group",cursor:"pointer",fontSize:"lg",fontWeight:"medium",...r,"data-sentry-element":"Box","data-sentry-component":"PreferenceButton","data-sentry-source-file":"preference-button.tsx",children:(0,a.jsx)(p.Z,{px:8,py:3,borderWidth:1,borderColor:n?"brand.500":"blackAlpha.100",rounded:"lg",shadow:"blue.md",transition:"all 0.2s",bg:n?"brand.50":"white",_groupHover:{bg:n?"brand.50":"gray.50",shadow:"blue.lg",_dark:{bg:n?"brand.900":"gray.700",shadow:"none"}},_dark:{bg:n?"brand.900":"gray.800",borderColor:n?"brand.500":"whiteAlpha.200",shadow:"none"},"data-sentry-element":"Card","data-sentry-source-file":"preference-button.tsx",children:(0,a.jsx)(_.x,{"data-sentry-element":"Text","data-sentry-source-file":"preference-button.tsx",children:t})})})},N=n(21516);function C(){let{clinic:e,patientSpecies:t,isNewPatient:n,isNewClient:r,service:s,patientFixed:a,patientGender:i,selectedClientPatient:l,widget:d}=(0,E.Q)(),o={clinic_species_id:(null==l?void 0:l.patient_clinic_species)||(null==t?void 0:t.id)||"",is_new_patient:!!n,service_id:null==s?void 0:s.id,fixed_status:(null==l?void 0:l.patient_fixed_status)||a,is_new_client:r,patient_gender:(null==l?void 0:l.patient_gender)||i},{data:c,loading:u}=(0,N.iLs)({variables:{clinicId:(null==e?void 0:e.id)||"",widgetId:null==d?void 0:d.id,params:o}}),{data:x,loading:m}=(0,N.zun)({variables:{clinicId:(null==e?void 0:e.id)||"",widgetId:null==d?void 0:d.id,params:o}}),y=(null==c?void 0:c.getCliniciansForBooking)||[],f=(null==x?void 0:x.getRoomsForBooking)||[];return{clinicians:y,rooms:f,isLoading:u||m}}var R=function(){let{clinician:e,setClinician:t,clinicianFilter:n,setClinicianFilter:r}=(0,E.Q)(),[s,d]=(0,i.useState)(!1);(0,i.useEffect)(()=>{s||e||(t(void 0),r(void 0))},[e,s,t,r]);let{clinicians:o}=C();return(0,a.jsxs)(c.g,{w:"full",spacing:8,py:8,"data-sentry-element":"VStack","data-sentry-component":"ClinicianSelect","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},textAlign:{base:"center",md:"left"},fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.CLINICIAN_PREFERENCE_QUESTION}),(0,a.jsx)(l.k,{w:"full",justifyContent:"center",alignItems:"center","data-sentry-element":"Flex","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(S,{label:j.u.YES,onClick:()=>d(!0),isSelected:s,"data-sentry-element":"PreferenceButton","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(S,{label:j.u.NO+j.u.CLINICIAN_ASSIGN_ME_ONE,onClick:()=>void(d(!1),t(void 0),r(void 0)),isSelected:!s,"data-sentry-element":"PreferenceButton","data-sentry-source-file":"index.tsx"})]})}),s&&(0,a.jsx)(b,{clinicians:o,clinicianFilter:n,setClinicianFilter:r})]})},w=n(3562);function A(e){var t,n;let{clinic:r,serviceCategory:a,service:l,clinician:d,roomId:o,date:c,requiredBookingQuestions:u,isNewPatient:x,isNewClient:m,patientFixed:y,patientGender:f,client:h,hasAgreedToMoreInfo:p,clientInputs:g}=(0,E.Q)(),{validPatient:_,validClient:v}=O(),I=(null==r?void 0:null===(t=r.settings)||void 0===t?void 0:t.urgency_type)===N._FB.GeneralPractice,T=!!c,j=!I||!!a,b=!1===x||void 0!==m||h,S=(0,i.useMemo)(()=>{if(!(null==u?void 0:u.length))return!0;let e=!0;return u.includes(N.Jtw.ClientReturningStatus)&&(e=e&&void 0!==m),u.includes(N.Jtw.PatientReturningStatus)&&(e=e&&void 0!==x),u.includes(N.Jtw.PatientFixedStatus)&&(e=e&&void 0!==y),u.includes(N.Jtw.PatientGender)&&(e=e&&void 0!==f),e},[u,m,x,y,f]),C=!(null===(n=r.settings)||void 0===n?void 0:n.is_using_detailed_services)||!!l,R=!!d||!!o,w=(0,i.useMemo)(()=>null==l||!l.services_forms||0===l.services_forms.length||!!g&&Object.keys(g).every(e=>{var t,n;return null===(t=g[e].form_data)||void 0===t?void 0:null===(n=t.fields)||void 0===n?void 0:n.every(e=>!e.is_required||!!e.value)}),[g,l]),A=null==l||!l.more_info_action_required||p,k=(0,i.useMemo)(()=>({[s.returningStatus]:I?!j:!j||!T,[s.client]:!j||!b,[s.pet]:!j||!b||!v,[s.requiredBookingQuestions]:!j||!b||!v||!_,[s.service]:!j||!b||!v||!_||!S,[s.time]:(!j||!b||!v||!_||!S||!C)&&I,[s.forms]:!j||!b||!v||!_||!S||!C||!R||!T||!A,[s.confirm]:!j||!b||!v||!_||!S||!C||!R||!T||!w||!A}),[j,b,v,_,S,C,R,T,w,A]);return k[e]}function O(){let{user:e}=(0,w.a)(),{client:t,pet:n,patient:r,selectedClientPatient:s}=(0,E.Q)(),a=function(){var e;let{clinic:t,patientName:n,patientSpecies:r,clinicBreed:s,patientBreed:a,isNewPatient:i,patientGender:l,patientFixed:d,patientBirthdate:o}=(0,E.Q)();return i||void 0===i?!!n&&!!r&&!!(s||a)&&!!l&&!!d&&!!o:(null===(e=t.settings)||void 0===e?void 0:e.booking_match_procedure)===N.FYq.Legacy?!!n&&!!r&&!!(s||a):!!n}(),i=function(){let{clinic:e,clientFirstName:t,clientLastName:n,clientPhone:r,clientEmail:s,clientAddress:a,clientDOB:i,isNewClient:l}=(0,E.Q)();if(l){var d,o;let l=null==e?void 0:null===(d=e.settings)||void 0===d?void 0:d.does_require_new_client_address,c=!l||!!a&&!!a.street_a&&!!a.city&&!!a.state&&!!a.zip,u=null==e?void 0:null===(o=e.settings)||void 0===o?void 0:o.does_require_new_client_birthday,x=!u||!!i&&(i<new Date||i>new Date(new Date().getFullYear()-200,0,1));return!!t&&!!n&&!!r&&!!s&&c&&x}return!!s&&!!r}();return s?{validPatient:!0,validClient:!0}:t||e?{validPatient:!!r||!!n||a,validClient:!0}:{validPatient:a,validClient:i}}(r=s||(s={})).pet="pet",r.requiredBookingQuestions="requiredBookingQuestions",r.service="service",r.time="time",r.client="client",r.forms="forms",r.confirm="confirm",r.returningStatus="returningStatus";var k=function(){var e;let{clinic:t,patient:n,service:r,isNewPatient:l,patientSpecies:o,date:m,setDate:y,dropOffDate:f,setDropOffDate:h,setClinician:p,clinicianFilter:g,bookingSettings:_}=(0,E.Q)(),{clinicians:v,rooms:I,isLoading:T}=C(),b=(0,i.useMemo)(()=>{var e;return n?null!==(e=null==n?void 0:n.clinic_species)&&void 0!==e?e:void 0:o},[n,o]),S=A(s.time),N=(null==_?void 0:_.hide_clinician_preference)===!1&&!!(null===(e=t.settings)||void 0===e?void 0:e.does_use_clinicians_to_schedule);return(0,a.jsxs)(c.g,{py:8,spacing:12,...(0,u.A)(S),"data-sentry-element":"VStack","data-sentry-component":"TimeStep","data-sentry-source-file":"index.tsx",children:[N&&(0,a.jsx)(R,{}),!v.length&&!I.length&&!T&&(0,a.jsx)(d.xu,{children:j.u.EMPTY_CLINICIANS_SELECT_MESSAGE(null==t?void 0:t.phone)}),(0,a.jsx)(x.Z,{clinic:t,service:r,isNew:l||!1,species:b,date:m,dropOffDate:f,clinicianFilter:g,onDateClick:(e,t,n)=>{y(e),h(t),p(n)},bookingSettings:_,"data-sentry-element":"AvailableTimes","data-sentry-source-file":"index.tsx"})]})},P=n(93108),L=n(58555),D=n(52091);function U(){var e,t,n,r,s;let{clinic:l,isNewPatient:d,patient:o,patientName:u,patientSpecies:y,patientBreed:g,service:v,serviceCategory:I,clinician:T,date:b,setDate:S,dropOffDate:N,setDropOffDate:C,setClinician:R,createLoading:w,createAppointment:A,bookingSettings:O}=(0,E.Q)(),k=(0,i.useMemo)(()=>{var e;return o?null!==(e=o.clinic_species)&&void 0!==e?e:void 0:y},[o,y]),U=!!(null==l?void 0:null===(e=l.settings)||void 0===e?void 0:e.does_use_rooms_to_schedule);async function B(){await A()}return(0,a.jsx)(p.Z,{p:{base:0,md:8},w:"full",rounded:"3xl",borderWidth:{base:0,md:1},shadow:{base:"none",md:"blue.xl"},borderColor:"blackAlpha.100","data-sentry-element":"Card","data-sentry-component":"RetryView","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(c.g,{spacing:12,alignItems:"flex-start","data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsxs)(c.g,{w:"full",alignItems:"center",spacing:1,"data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:"md",textAlign:"center","data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.APPOINTMENT_RETRY_SECTION_TITLE((null==l?void 0:l.name)||"")}),(0,a.jsx)(_.x,{"data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:j.u.APPOINTMENT_RETRY_WITH_TIME_ERROR_CTA}),(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:j.u.APPOINTMENT_RETRY_HELP_TEXT(null==l?void 0:l.phone)})]}),(0,a.jsxs)(c.g,{bg:"gray.50",_dark:{bg:"gray.800"},w:"full",px:6,py:4,rounded:"lg",alignItems:"flex-start",spacing:6,"data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(_.x,{fontWeight:"semibold",color:"gray.600","data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:j.u.APPOINTMENT_DETAILS}),(0,a.jsxs)(h.M,{w:"full",columns:{base:2,md:3},"data-sentry-element":"SimpleGrid","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(L.Z,{label:j.u.PATIENT,icon:D.IHQ,primaryText:(null==o?void 0:o.name)||u||"",secondaryText:"".concat((null==o?void 0:null===(t=o.clinic_species)||void 0===t?void 0:t.species)||(null==y?void 0:y.species)||"").concat((null==o?void 0:null===(n=o.clinic_breed)||void 0===n?void 0:n.description)||g?", ".concat((null==o?void 0:null===(r=o.clinic_breed)||void 0===r?void 0:r.description)||g):""),enhancer:(0,a.jsx)(f.q,{size:"sm",src:(null==o?void 0:null===(s=o.pet)||void 0===s?void 0:s.avatar_url)||"",name:(null==o?void 0:o.name)||""}),"data-sentry-element":"ReviewItem","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(L.Z,{label:j.u.SERVICE,icon:D.gQF,primaryText:(null==v?void 0:v.name)||I||"",secondaryText:(null==v?void 0:v.name)?I:"","data-sentry-element":"ReviewItem","data-sentry-source-file":"index.tsx"}),!U&&(0,a.jsx)(L.Z,{label:j.u.CLINICIAN,icon:D.K7y,primaryText:(null==T?void 0:T.name)||"",secondaryText:(null==T?void 0:T.authority_level)||"",enhancer:(0,a.jsx)(f.q,{size:"sm",src:(null==T?void 0:T.avatar_url)||"",name:(null==T?void 0:T.name)||""})})]})]}),(0,a.jsx)(x.Z,{isWithin:!0,clinic:l,bookingSettings:O,service:v,isNew:d||!1,species:k,date:b,dropOffDate:N,clinicianFilter:null,onDateClick:(e,t,n)=>{S(e),C(t),R(n)},"data-sentry-element":"AvailableTimes","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(P.z,{colorScheme:"accent",alignSelf:"center",onClick:B,isLoading:w,isDisabled:!b,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:j.u.CONTINUE})]})})}var B=n(57169),M=n(25324),z=n(82143),Z=function(){let{notes:e,setNotes:t}=(0,E.Q)();return(0,a.jsxs)(d.xu,{w:"full","data-sentry-element":"Box","data-sentry-component":"ClientNotes","data-sentry-source-file":"notes.tsx",children:[(0,a.jsx)(_.x,{mb:2,fontWeight:"semibold","data-sentry-element":"Text","data-sentry-source-file":"notes.tsx",children:j.u.CLIENT_NOTES_LABEL}),(0,a.jsxs)(d.xu,{position:"relative","data-sentry-element":"Box","data-sentry-source-file":"notes.tsx",children:[(0,a.jsx)(B.g,{resize:"none",value:e,minH:"120px",borderColor:"gray.200",focusBorderColor:"brand.500",_dark:{borderColor:"whiteAlpha.200"},onChange:e=>t(e.target.value),placeholder:j.u.CLIENT_NOTES_PLACEHOLDER(3),"data-sentry-element":"Textarea","data-sentry-source-file":"notes.tsx"}),(0,a.jsx)(M.D,{zIndex:1,position:"absolute",bg:"transparent",bottom:2,left:2,thickness:8,trackColor:e.length<3||e.length>500?"red.100":"gray.200",color:e.length<3||e.length>500?"red.300":"green.400",size:10,value:(e.length||0)/3*100,"data-sentry-element":"CircularProgress","data-sentry-source-file":"notes.tsx",children:(0,a.jsx)(z.i,{fontSize:"sm",lineHeight:0,color:e.length<3||e.length>500?"red.300":"green.400","data-sentry-element":"CircularProgressLabel","data-sentry-source-file":"notes.tsx",children:e.length})})]})]})},F=n(46319),G=function(e){let{clinic:t}=e,{name:n,avatar_url:r,address:s}=t;return(0,a.jsx)(d.xu,{flex:2,h:"fit-content","data-sentry-element":"Box","data-sentry-component":"ClinicCard","data-sentry-source-file":"clinic-card.tsx",children:(0,a.jsxs)(y.U,{spacing:4,mt:0,px:1,pb:1,"data-sentry-element":"HStack","data-sentry-source-file":"clinic-card.tsx",children:[(0,a.jsx)(F.Z,{avatarUrl:r||"",name:n||"","data-sentry-element":"ClinicLogo","data-sentry-source-file":"clinic-card.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"clinic-card.tsx",children:[(0,a.jsx)(m.X,{size:"md",mb:2,"data-sentry-element":"Heading","data-sentry-source-file":"clinic-card.tsx",children:n}),(0,a.jsxs)(_.x,{fontSize:"sm",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"clinic-card.tsx",children:[null==s?void 0:s.street_a,(null==s?void 0:s.street_b)?", "+s.street_b:""]}),(0,a.jsxs)(_.x,{fontSize:"sm",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"clinic-card.tsx",children:[null==s?void 0:s.city,", ",null==s?void 0:s.state," ",null==s?void 0:s.zip]})]})]})})},W=n(32883),H=n(43589);function Q(){var e;let{clinic:t,bookingSettings:n}=(0,E.Q)(),{custom_well_description:r,custom_sick_description:s,custom_other_title:a,custom_other_description:i,custom_booking_copy:l}=n||{},{custom_well_description:d,custom_sick_description:o,custom_other_title:c,custom_other_description:u,custom_booking_copy:x}=(null==t?void 0:null===(e=t.organization)||void 0===e?void 0:e.settings)||{};return{BOOKING_COPY:{SERVICE_TYPE_SECTION_HEADING:(null==l?void 0:l.SERVICE_TYPE_SECTION_HEADING)||(null==x?void 0:x.SERVICE_TYPE_SECTION_HEADING)||q.SERVICE_TYPE_SECTION_HEADING,DEFAULT_WELLNESS_DESCRIPTION:r||d||q.DEFAULT_WELLNESS_DESCRIPTION,DEFAULT_SICK_DESCRIPTION:s||o||q.DEFAULT_SICK_DESCRIPTION,DEFAULT_OTHER_TITLE:a||c||q.DEFAULT_OTHER_TITLE,DEFAULT_OTHER_DESCRIPTION:i||u||q.DEFAULT_OTHER_DESCRIPTION,RETURNING_PATIENT_QUESTION:(null==l?void 0:l.RETURNING_PATIENT_QUESTION)||(null==x?void 0:x.RETURNING_PATIENT_QUESTION)||q.RETURNING_PATIENT_QUESTION,POSITIVE_RETURNING_PATIENT_ANSWER:(null==l?void 0:l.POSITIVE_RETURNING_PATIENT_ANSWER)||(null==x?void 0:x.POSITIVE_RETURNING_PATIENT_ANSWER)||q.POSITIVE_RETURNING_PATIENT_ANSWER,NEGATIVE_RETURNING_PATIENT_ANSWER:(null==l?void 0:l.NEGATIVE_RETURNING_PATIENT_ANSWER)||(null==x?void 0:x.NEGATIVE_RETURNING_PATIENT_ANSWER)||q.NEGATIVE_RETURNING_PATIENT_ANSWER,RETURNING_CLIENT_QUESTION:(null==l?void 0:l.RETURNING_CLIENT_QUESTION)||(null==x?void 0:x.RETURNING_CLIENT_QUESTION)||q.RETURNING_CLIENT_QUESTION,POSITIVE_RETURNING_CLIENT_ANSWER:(null==l?void 0:l.POSITIVE_RETURNING_CLIENT_ANSWER)||(null==x?void 0:x.POSITIVE_RETURNING_CLIENT_ANSWER)||q.POSITIVE_RETURNING_CLIENT_ANSWER,NEGATIVE_RETURNING_CLIENT_ANSWER:(null==l?void 0:l.NEGATIVE_RETURNING_CLIENT_ANSWER)||(null==x?void 0:x.NEGATIVE_RETURNING_CLIENT_ANSWER)||q.NEGATIVE_RETURNING_CLIENT_ANSWER,CLIENT_INFORMATION_SECTION_TITLE:(null==l?void 0:l.CLIENT_INFORMATION_SECTION_TITLE)||(null==x?void 0:x.CLIENT_INFORMATION_SECTION_TITLE)||q.CLIENT_INFORMATION_SECTION_TITLE,PATIENT_INFORMATION_SECTION_TITLE:(null==l?void 0:l.PATIENT_INFORMATION_SECTION_TITLE)||(null==x?void 0:x.PATIENT_INFORMATION_SECTION_TITLE)||q.PATIENT_INFORMATION_SECTION_TITLE,SERVICE_SECTION_TITLE:(null==l?void 0:l.SERVICE_SECTION_TITLE)||(null==x?void 0:x.SERVICE_SECTION_TITLE)||q.SERVICE_SECTION_TITLE,PREVIOUS_OR_REFERRING_CLINIC_QUESTION:(null==l?void 0:l.PREVIOUS_OR_REFERRING_CLINIC_QUESTION)||(null==x?void 0:x.PREVIOUS_OR_REFERRING_CLINIC_QUESTION)||q.PREVIOUS_OR_REFERRING_CLINIC_QUESTION}}}let q={SERVICE_TYPE_SECTION_HEADING:"Why are you bringing your pet in?",DEFAULT_WELLNESS_DESCRIPTION:"Routine Checkup / Microchipping / Vaccinations / Dental",DEFAULT_SICK_DESCRIPTION:"Wounds / Limping / Digestive Issues / Skin Conditions",DEFAULT_OTHER_TITLE:"Other",DEFAULT_OTHER_DESCRIPTION:"Grooming / Boarding / Prescription Pickup / Other",RETURNING_PATIENT_QUESTION:"Has your pet been to this clinic before?",POSITIVE_RETURNING_PATIENT_ANSWER:"Yes, my pet is a returning patient",NEGATIVE_RETURNING_PATIENT_ANSWER:"No, my pet is a new patient",RETURNING_CLIENT_QUESTION:"Have you been to this clinic before?",POSITIVE_RETURNING_CLIENT_ANSWER:"Yes, I have been to this clinic",NEGATIVE_RETURNING_CLIENT_ANSWER:"No, I have never been to this clinic",CLIENT_INFORMATION_SECTION_TITLE:"Who are you?",PATIENT_INFORMATION_SECTION_TITLE:"Who are you bringing in?",SERVICE_SECTION_TITLE:"What service are you looking for?",PREVIOUS_OR_REFERRING_CLINIC_QUESTION:"What was the last clinic your pet visited?"};var V=function(){let{clinic:e,patient:t,patientName:n,patientGender:r,previousClinic:s,setPreviousClinic:i}=(0,E.Q)(),{BOOKING_COPY:l}=Q(),o=(null==t?void 0:t.name)||n||"",c=(null==t?void 0:t.gender)||r;return(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-component":"PreviousClinic","data-sentry-source-file":"previous-clinic.tsx",children:[(0,a.jsx)(_.x,{fontWeight:"semibold",mb:1,"data-sentry-element":"Text","data-sentry-source-file":"previous-clinic.tsx",children:l.PREVIOUS_OR_REFERRING_CLINIC_QUESTION}),(0,a.jsx)(_.x,{color:"gray.500",fontSize:"sm",mb:2,"data-sentry-element":"Text","data-sentry-source-file":"previous-clinic.tsx",children:j.u.PREVIOUS_OR_REFERRING_CLINIC_HELP_TEXT(o,(null==e?void 0:e.name)||"",c===N.NQQ.Male?j.u.HIS:c===N.NQQ.Female?j.u.HER:j.u.THEIR)}),(0,a.jsx)(H.I,{value:s,onChange:e=>i(e.target.value),mb:1,"data-sentry-element":"Input","data-sentry-source-file":"previous-clinic.tsx"}),(0,a.jsx)(W.r,{fontSize:"sm",textDecor:"underline",color:"gray.500",onClick:()=>i(j.u.NO_PREVIOUS_CLINIC),"data-sentry-element":"Link","data-sentry-source-file":"previous-clinic.tsx",children:j.u.NEVER_SEEN_A_CLINIC})]})},X=n(19027);function Y(e){let{content:t}=e;return(0,a.jsx)(d.xu,{fontSize:"14px",color:"gray.600",_dark:{color:"gray.200"},"data-sentry-element":"Box","data-sentry-component":"RichTextDisplay","data-sentry-source-file":"rich-text-display.tsx",children:(0,a.jsx)(X.Lu,{content:t,transform:J,"data-sentry-element":"Markup","data-sentry-source-file":"rich-text-display.tsx"})})}function J(e,t){return"A"===e.tagName?(0,a.jsx)(W.r,{isExternal:!0,color:"brand.600",href:e.getAttribute("href")||void 0,children:t}):"P"===e.tagName?(0,a.jsx)("p",{style:{margin:"0"},children:t}):void 0}var K=n(79815),$=n(55512),ee=n(19778),et=n(64859),en=n(54346),er=n(14253);function es(e){let{warningIsOpen:t,setWarningIsOpen:n,clinic:r,triggerWord:s,onContinue:l}=e,d=i.useRef(null);return(0,a.jsx)($.a,{isCentered:!0,isOpen:t,onClose:()=>n(!1),leastDestructiveRef:d,"data-sentry-element":"AlertDialog","data-sentry-component":"TriggerWordAlertModal","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:(0,a.jsx)(ee.Z,{zIndex:100003,"data-sentry-element":"AlertDialogOverlay","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:(0,a.jsxs)($._,{"data-sentry-element":"AlertDialogContent","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:[(0,a.jsx)(et.x,{borderBottom:"3px solid",borderBottomColor:"red.500","data-sentry-element":"AlertDialogHeader","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:(0,a.jsxs)(y.U,{spacing:"16px","data-sentry-element":"HStack","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:[(0,a.jsx)(K.i,{color:"red.500",boxSize:"20px","data-sentry-element":"WarningTwoIcon","data-sentry-source-file":"trigger-word-alert-modal.tsx"}),(0,a.jsx)(_.x,{fontSize:"lg","data-sentry-element":"Text","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:j.u.EMERGENCY_DETECTED_TITLE})]})}),(0,a.jsx)(en.f,{py:"24px","data-sentry-element":"AlertDialogBody","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:(0,a.jsxs)(c.g,{spacing:"16px","data-sentry-element":"VStack","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:[(0,a.jsx)(_.x,{fontWeight:"medium",fontSize:"16px",lineHeight:"24px",textAlign:"center","data-sentry-element":"Text","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:j.u.EMERGENCY_DETECTED_SUBTITLE('"'.concat(s,'"'))}),(0,a.jsx)(_.x,{fontWeight:"medium",fontSize:"16px",lineHeight:"24px",textAlign:"center","data-sentry-element":"Text","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:j.u.EMERGENCY_DETECTED_DESCRIPTION((null==r?void 0:r.name)||"",(null==r?void 0:r.phone)?(0,I.un)(r.phone):"once")})]})}),(0,a.jsxs)(er.m,{justifyContent:"space-between","data-sentry-element":"AlertDialogFooter","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:[(0,a.jsx)(P.z,{ref:d,onClick:()=>n(!1),"data-sentry-element":"Button","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:j.u.CANCEL}),(0,a.jsx)(P.z,{colorScheme:"red",onClick:()=>{l()},"data-sentry-element":"Button","data-sentry-source-file":"trigger-word-alert-modal.tsx",children:j.u.CONFIRM_AND_CONTINUE})]})]})})})}var ea=n(86204);function ei(){var e,t,n,r,s;let{clinic:i,date:l,serviceCategory:o,service:c,patient:u,patientName:x,patientSpecies:y,patientBreed:p,clinician:g,dropOffDate:_,selectedClientPatient:v}=(0,E.Q)(),T=!!(null==i?void 0:null===(e=i.settings)||void 0===e?void 0:e.does_use_rooms_to_schedule),[b,S]=(0,I.W4)({startTime:l?new Date(l).getTime():Date.now(),dropOffTime:_?new Date(_).getTime():void 0,minutes:(null==c?void 0:c.duration)||30,timeZone:null==i?void 0:i.time_zone});return(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-component":"ReviewDetails","data-sentry-source-file":"details.tsx",children:[(0,a.jsx)(m.X,{size:"md",fontWeight:"semibold",mb:4,"data-sentry-element":"Heading","data-sentry-source-file":"details.tsx",children:j.u.DETAILS}),(0,a.jsxs)(h.M,{columns:{base:1,md:2},gridGap:{base:4,md:8},"data-sentry-element":"SimpleGrid","data-sentry-source-file":"details.tsx",children:[(0,a.jsx)(L.Z,{label:j.u.PATIENT,icon:ea.IHQ,primaryText:(null==u?void 0:u.name)||x||(null==v?void 0:v.patient_name)||"",secondaryText:"".concat((null==u?void 0:null===(t=u.clinic_species)||void 0===t?void 0:t.species)||(null==y?void 0:y.species)||"").concat((null==u?void 0:null===(n=u.clinic_breed)||void 0===n?void 0:n.description)||(null==u?void 0:u.breed)||p?", ".concat((null==u?void 0:null===(r=u.clinic_breed)||void 0===r?void 0:r.description)||(null==u?void 0:u.breed)||p):""),enhancer:(0,a.jsx)(f.q,{size:"sm",src:(null==u?void 0:null===(s=u.pet)||void 0===s?void 0:s.avatar_url)||"",name:(null==u?void 0:u.name)||""}),"data-sentry-element":"ReviewItem","data-sentry-source-file":"details.tsx"}),(0,a.jsx)(L.Z,{label:j.u.SERVICE,icon:D.gQF,primaryText:(null==c?void 0:c.name)||o||"",secondaryText:(null==c?void 0:c.name)?o:"","data-sentry-element":"ReviewItem","data-sentry-source-file":"details.tsx"}),!T&&(0,a.jsx)(L.Z,{label:j.u.CLINICIAN,icon:D.K7y,primaryText:(null==g?void 0:g.name)||"",secondaryText:(null==g?void 0:g.authority_level)||"",enhancer:(0,a.jsx)(f.q,{size:"sm",src:(null==g?void 0:g.avatar_url)||"",name:(null==g?void 0:g.name)||""})}),(0,a.jsx)(L.Z,{label:_?j.u.DROP_OFF_TIME:j.u.DATE,icon:D.qyc,primaryText:b,secondaryText:S,"data-sentry-element":"ReviewItem","data-sentry-source-file":"details.tsx"})]})]})}var el=n(36948),ed=n(55281),eo=n(9757);function ec(e){let{clinic:t}=e;return(0,a.jsxs)(d.xu,{mt:8,"data-sentry-element":"Box","data-sentry-component":"ClinicLocation","data-sentry-source-file":"clinic-location.tsx",children:[(0,a.jsxs)(y.U,{spacing:6,mb:4,"data-sentry-element":"HStack","data-sentry-source-file":"clinic-location.tsx",children:[(0,a.jsx)(d.Cd,{p:3,bg:"brand.50",_dark:{bg:"brand.900"},"data-sentry-element":"Circle","data-sentry-source-file":"clinic-location.tsx",children:(0,a.jsx)(el.J,{as:D.ekl,fontSize:"2xl",color:"brand.500","data-sentry-element":"Icon","data-sentry-source-file":"clinic-location.tsx"})}),(0,a.jsx)(_.x,{fontSize:"md",fontWeight:"bold","data-sentry-element":"Text","data-sentry-source-file":"clinic-location.tsx",children:"Location"})]}),(0,a.jsxs)(ed.K,{alignItems:"center",direction:{base:"column",md:"row"},spacing:{base:4,md:8},"data-sentry-element":"Stack","data-sentry-source-file":"clinic-location.tsx",children:[(0,a.jsx)(eo.Z,{clinic:t,"data-sentry-element":"ClinicMap","data-sentry-source-file":"clinic-location.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"clinic-location.tsx",children:[(0,a.jsx)(_.x,{fontSize:"md",fontWeight:"semibold",mb:1,"data-sentry-element":"Text","data-sentry-source-file":"clinic-location.tsx",children:t.name}),(0,I.yL)(t.address||{}).map(e=>(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.500",children:e},e))]})]})]})}var eu=function(e){let{onPay:t}=e,[n,r]=(0,i.useState)(!1),{clinic:s,service:o,isNewPatient:u,createLoading:x,createAppointment:y,notes:f,bookingSettings:h}=(0,E.Q)(),g=(0,i.useMemo)(()=>{var e;return o&&(null===(e=o.pricing)||void 0===e?void 0:e.price)},[o]);function v(){let e=(null==h?void 0:h.default_trigger_words)||[];if(e.length>0){let t=e.find(e=>null==f?void 0:f.toLowerCase().includes(e.toLowerCase()));return t}}async function I(){if(v()&&!n){r(!0);return}r(!1),g?t():await y()}return(0,a.jsxs)(p.Z,{p:{base:0,md:8},w:"full",rounded:"3xl",bg:"white",_dark:{bg:"gray.800",shadow:"none",borderColor:"whiteAlpha.200"},borderWidth:{base:0,md:1},shadow:{base:"none",md:"blue.xl"},borderColor:"blackAlpha.100","data-sentry-element":"Card","data-sentry-component":"ReviewStep","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},mb:{base:6,md:10},px:{base:4,md:0},mt:{base:4,md:0},"data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.APPOINTMENT_INFO_REVIEW_TITLE}),(0,a.jsxs)(l.k,{flexDir:{base:"column-reverse",md:"column-reverse"},"data-sentry-element":"Flex","data-sentry-source-file":"index.tsx",children:[(0,a.jsxs)(c.g,{flex:3,spacing:8,alignItems:"flex-start",my:{base:6,md:0},px:{base:4,md:0},"data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsxs)(l.k,{flexDir:{base:"column",md:"row"},"data-sentry-element":"Flex","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(ei,{"data-sentry-element":"ReviewDetails","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(ec,{clinic:s,"data-sentry-element":"ClinicLocation","data-sentry-source-file":"index.tsx"})]}),u&&(0,a.jsx)(V,{}),(null==o?void 0:o.more_info)&&(0,a.jsxs)(d.xu,{children:[(0,a.jsx)(_.x,{mb:2,fontWeight:"semibold",children:j.u.ADDITIONAL_INSTRUCTIONS_LABEL}),(0,a.jsx)(Y,{content:o.more_info})]}),(0,a.jsx)(Z,{"data-sentry-element":"ClientNotes","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(P.z,{colorScheme:"accent",alignSelf:{base:"center",md:"flex-end"},onClick:I,isLoading:x,isDisabled:f.length<3,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:g?j.u.CONTINUE:j.u.BOOK_APPOINTMENT})]}),(0,a.jsx)(d.xu,{w:"full",h:"1px",bgGradient:"linear(to-r, blackAlpha.50, blackAlpha.300, blackAlpha.50)",_dark:{bgGradient:"linear(to-r, whiteAlpha.50, whiteAlpha.200, whiteAlpha.50)"},my:4,"data-sentry-element":"Box","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(G,{clinic:s,"data-sentry-element":"ClinicCard","data-sentry-source-file":"index.tsx"})]}),(0,a.jsx)(es,{warningIsOpen:n,setWarningIsOpen:r,clinic:s,triggerWord:v()||"",onContinue:I,"data-sentry-element":"TriggerWordAlertModal","data-sentry-source-file":"index.tsx"})]})},ex=n(53468);function em(e){let{children:t,...n}=e;return(0,a.jsx)(d.xu,{border:"1px",borderColor:"brand.500",bg:"white",rounded:"2xl",_dark:{bg:"gray.800"},...n,"data-sentry-element":"Box","data-sentry-component":"BrandOutlineBox","data-sentry-source-file":"brand-outline-box.tsx",children:t})}function ey(){let{service:e,hasAgreedToMoreInfo:t,setHasAgreedToMoreInfo:n}=(0,E.Q)();return(0,a.jsxs)(em,{p:6,"data-sentry-element":"BrandOutlineBox","data-sentry-component":"ConsentStep","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:"md",color:"brand.600",_dark:{color:"brand.400"},mb:3,"data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.SERVICE_CONSENT_SECTION_TITLE}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",mb:3,"data-sentry-element":"Box","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(Y,{content:(null==e?void 0:e.more_info_action_required)||"","data-sentry-element":"RichTextDisplay","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",my:6,"data-sentry-element":"Box","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(ex.X,{colorScheme:"accent",isChecked:t,onChange:e=>n(e.target.checked),borderColor:"brand.500","data-sentry-element":"Checkbox","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(_.x,{color:"gray.700",_dark:{color:"gray.300"},fontWeight:600,"data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:(null==e?void 0:e.action_required_acknowledgement_text)||j.u.SERVICE_CONSENT_DEFAULT_ACKOWLEDGEMENT})})]})}var ef=n(54465),eh=n(86664),ep=n(7963),eg=n(65028),e_=function(e){let{label:t,value:n,...r}=e;return(0,a.jsxs)(l.k,{justify:"space-between","data-sentry-element":"Flex","data-sentry-component":"PriceItem","data-sentry-source-file":"price-item.tsx",children:[(0,a.jsx)(_.x,{...r,"data-sentry-element":"Text","data-sentry-source-file":"price-item.tsx",children:t}),(0,a.jsx)(_.x,{...r,"data-sentry-element":"Text","data-sentry-source-file":"price-item.tsx",children:n})]})},ev=n(82102),eE=n(15755),eI=n(33361),eT=n(45161),ej=n(91843),eb=function(){var e,t;let n=(0,eT.ff)("blue.xl","none"),r=(0,ep.p)(),{service:s,setStripeResponse:o,createAppointment:c}=(0,E.Q)(),u=(0,eh.useStripe)(),x=(0,eh.useElements)(),[y,f]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),v=async()=>{try{if(!u||!x)return;f(!0);let e=x.getElement(eh.PaymentElement);if(!e){f(!1);return}let{error:t,paymentIntent:n}=await u.confirmPayment({elements:x,redirect:"if_required"});t?(r({title:j.u.UNPROCESSED_PAYMENT_TOAST_TITLE,description:t.message||j.u.UNPROCESSED_PAYMENT_TOAST_DESCRIPTION,status:"error",duration:5e3,isClosable:!0}),g(t.message||j.u.UNPROCESSED_PAYMENT_TOAST_DESCRIPTION)):(o(n),await c()),f(!1)}catch(e){r({title:j.u.UNEXPECTED_ERROR,description:j.u.UNPROCESSED_PAYMENT_TOAST_DESCRIPTION,status:"error",duration:5e3,isClosable:!0}),e instanceof Error&&g((null==e?void 0:e.message)||j.u.UNEXPECTED_ERROR),f(!1)}};return(0,a.jsx)(ej.iJ,{"data-sentry-element":"LightMode","data-sentry-component":"PaymentForm","data-sentry-source-file":"payment-form.tsx",children:(0,a.jsxs)(p.Z,{pt:4,pb:8,px:6,rounded:"2xl",shadow:n,borderWidth:1,borderColor:"blackAlpha.100",bg:"white","data-sentry-element":"Card","data-sentry-source-file":"payment-form.tsx",children:[(0,a.jsxs)(eI.Z,{mb:8,maxW:"600px","data-sentry-element":"SharedStack","data-sentry-source-file":"payment-form.tsx",children:[(0,a.jsx)(m.X,{size:"md",color:"gray.900","data-sentry-element":"Heading","data-sentry-source-file":"payment-form.tsx",children:j.u.PREPAY_REQUIRED_TITLE(null==s?void 0:s.name)}),(0,a.jsx)(eE.Z,{"data-sentry-element":"SharedHelpText","data-sentry-source-file":"payment-form.tsx",children:j.u.PREPAY_SECTION_HELP_TEXT}),h&&(0,a.jsx)(_.x,{color:"red.500",mb:4,children:h})]}),(0,a.jsxs)(ed.K,{direction:{base:"column-reverse",lg:"row"},w:"full",spacing:8,"data-sentry-element":"Stack","data-sentry-source-file":"payment-form.tsx",children:[(0,a.jsxs)(d.xu,{flex:1,display:"flex",flexDir:"column","data-sentry-element":"Box","data-sentry-source-file":"payment-form.tsx",children:[(0,a.jsx)(eh.PaymentElement,{id:"payment","data-sentry-element":"PaymentElement","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsx)(P.z,{mt:6,colorScheme:"accent",alignSelf:"flex-end",onClick:v,autoFocus:!0,isLoading:y,"data-sentry-element":"Button","data-sentry-source-file":"payment-form.tsx",children:j.u.CONFIRM_PAYMENT})]}),(0,a.jsx)(d.xu,{flex:1,maxW:"1px",display:{base:"none",md:"block"},bgGradient:"linear(to-b, blackAlpha.50, blackAlpha.200, blackAlpha.50)",_dark:{bgGradient:"linear(to-b, whiteAlpha.50, whiteAlpha.200, whiteAlpha.50)"},"data-sentry-element":"Box","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsx)(ev.Z,{display:{base:"block",md:"none"},"data-sentry-element":"Divider","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsxs)(l.k,{direction:"column",w:{base:"100%",md:"40%"},borderWidth:{base:0,md:1},borderColor:"gray.200",rounded:"lg",bg:"gray.50",px:{base:0,md:4},py:{base:0,md:3},"data-sentry-element":"Flex","data-sentry-source-file":"payment-form.tsx",children:[(0,a.jsx)(_.x,{textTransform:"uppercase",letterSpacing:"wider",fontWeight:"semibold",color:"gray.600",_dark:{color:"gray.400"},"data-sentry-element":"Text","data-sentry-source-file":"payment-form.tsx",children:j.u.ORDER_SUMMARY}),(0,a.jsx)(ev.Z,{my:2,"data-sentry-element":"Divider","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"payment-form.tsx",children:[(0,a.jsx)(e_,{label:"Service Cost",value:(0,I.lb)((null==s?void 0:null===(e=s.pricing)||void 0===e?void 0:e.price)/100),"data-sentry-element":"PriceItem","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsx)(e_,{label:"Booking Fee",value:"$0.00","data-sentry-element":"PriceItem","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsx)(e_,{label:"Taxes",value:"$0.00","data-sentry-element":"PriceItem","data-sentry-source-file":"payment-form.tsx"})]}),(0,a.jsx)(eg.L,{"data-sentry-element":"Spacer","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsx)(ev.Z,{my:3,"data-sentry-element":"Divider","data-sentry-source-file":"payment-form.tsx"}),(0,a.jsx)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"payment-form.tsx",children:(0,a.jsx)(e_,{fontWeight:"semibold",fontSize:"18px",label:"Total",value:(0,I.lb)((null==s?void 0:null===(t=s.pricing)||void 0===t?void 0:t.price)/100),"data-sentry-element":"PriceItem","data-sentry-source-file":"payment-form.tsx"})})]})]})]})})},eS=n(30362),eN=n(26196),eC=function(){var e,t;let{user:n}=(0,w.a)(),{clinic:r,service:s,setPaymentIntent:l,clientFirstName:d,clientLastName:o,clientPhone:c,clientEmail:u}=(0,E.Q)(),{data:x,loading:m}=(0,N.BUY)({variables:{clinicId:(null==r?void 0:r.id)||"",serviceId:(null==s?void 0:s.id)||"",customerInfo:{first_name:(null==n?void 0:n.first_name)||d||"",last_name:(null==n?void 0:n.last_name)||o||"",phone:(null==n?void 0:n.phone)||c||"",email:(null==n?void 0:n.email)||u||""}},onError:e=>console.error("PaymentIntent Error: ",e)});(0,i.useEffect)(()=>{x&&l(x.paymentIntentFromService)},[x,l]);let y=(0,ef.J)("pk_live_51JPaDsAkT8JZvXSAluBU6tVyQpWcHBqzhsAm54kMjWr4HoOx3fQmJf7t7rO8lfHuT7ZzPTFBjMP7haFS4cuAnhqL005ChLG17c"),f={clientSecret:(null==x?void 0:null===(e=x.paymentIntentFromService)||void 0===e?void 0:e.client_secret)||"",appearances:{theme:"flat"}};return(0,a.jsx)(a.Fragment,{children:m?(0,a.jsx)(eN.Z,{isSmall:!0}):(null==x?void 0:null===(t=x.paymentIntentFromService)||void 0===t?void 0:t.client_secret)?(0,a.jsx)(eh.Elements,{options:f,stripe:y,children:(0,a.jsx)(eb,{})}):(0,a.jsx)(eS.Z,{isSmall:!0})})},eR=n(27239),ew=n(32568),eA=n(36070),eO=n(17191),ek=n(50151),eP=n(64325),eL=n(72303),eD=n(13591),eU=n(82509);function eB(e){return e.length>200}var eM=function(e){var t;let{service:n,setService:r,isSelected:s}=e,i=s&&n.more_info&&!eB(n.more_info);return(0,a.jsxs)(eO.J,{"data-sentry-element":"Popover","data-sentry-component":"ServiceItem","data-sentry-source-file":"service-item.tsx",children:[(0,a.jsx)(ek.x,{"data-sentry-element":"PopoverTrigger","data-sentry-source-file":"service-item.tsx",children:(0,a.jsx)(d.xu,{role:"group",cursor:"pointer",onClick:()=>r(n),"data-sentry-element":"Box","data-sentry-source-file":"service-item.tsx",children:(0,a.jsx)(p.Z,{px:4,py:4,bg:s?"brand.50":"white",rounded:"xl",shadow:"blue.md",transition:"all 0.2s",borderWidth:1,borderColor:s?"brand.500":"blackAlpha.100",_groupHover:{bg:s?"brand.50":"gray.50",shadow:"blue.lg",_dark:{bg:s?"brand.900":"gray.700",shadow:"none"}},_dark:{bg:s?"brand.900":"gray.800",borderColor:s?"brand.500":"whiteAlpha.200",shadow:"none"},"data-sentry-element":"Card","data-sentry-source-file":"service-item.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"service-item.tsx",children:[(0,a.jsx)(g.Y,{isChecked:s,colorScheme:"brand",size:"lg","data-sentry-element":"Radio","data-sentry-source-file":"service-item.tsx"}),(0,a.jsx)(_.x,{fontWeight:"medium","data-sentry-element":"Text","data-sentry-source-file":"service-item.tsx",children:n.name}),(null===(t=n.pricing)||void 0===t?void 0:t.price)&&(0,a.jsxs)(_.x,{fontSize:"sm",children:[(0,I.lb)(n.pricing.price/100)," ",n.pricing.type===N.fyV.PerDay?j.u.SERVICE_PRICING_PER_DAY:""]})]})})})}),i&&(0,a.jsxs)(eP.y,{children:[(0,a.jsx)(eL.Q,{}),(0,a.jsx)(eD.u,{}),(0,a.jsxs)(eU.b,{children:[(0,a.jsx)(m.X,{size:"sm",children:"Additional Info"}),(0,a.jsx)(Y,{content:(null==n?void 0:n.more_info)||""})]})]})]})},ez=n(53329),eZ=n(96854),eF=function(){let{serviceCategory:e,service:t,setService:n,clinic:r,patient:l,isNewPatient:o,isNewClient:x,patientSpecies:y,patientGender:f,patientFixed:p,patientBirthdate:g,selectedClientPatient:v,widget:T}=(0,E.Q)(),{BOOKING_COPY:b}=Q(),{data:S,loading:C}=(0,N.evB)({variables:{clinicId:(null==r?void 0:r.id)||"",widgetId:null==T?void 0:T.id,params:{is_new_patient:o,clinic_species_id:(null==v?void 0:v.patient_clinic_species)||(null==y?void 0:y.id)||"",fixed_status:(null==v?void 0:v.patient_fixed_status)||p,is_new_client:x,patient_gender:(null==v?void 0:v.patient_gender)||f}},skip:!r}),R=(null==S?void 0:S.getServicesForBooking)||[],w=A(s.service),O=(0,i.useMemo)(()=>(null==l?void 0:l.birthday)||(null==g?void 0:g.getTime()),[l,g]),k=[...(R||[]).filter(t=>!!t.is_active&&(!e||t.service_types.includes(e))).filter(e=>{let t="boolean"!=typeof e.allow_new||e.allow_new,n="boolean"!=typeof e.allow_returning||e.allow_returning;return(!o||!!t&&!!o||!!n&&!o)&&!(O&&e.minimum_patient_age_in_days&&Date.now()/ez.jD-O/ez.jD<e.minimum_patient_age_in_days)})],[P,L]=(0,I.DQ)(k,e=>{var t;return null===(t=e.pricing)||void 0===t?void 0:t.price}),D=t&&t.more_info&&eB(t.more_info);return(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-component":"ServiceStep","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(eR.M,{w:"full",py:8,...(0,u.A)(w),"data-sentry-element":"Center","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(c.g,{w:"full",spacing:8,"data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:b.SERVICE_SECTION_TITLE}),C&&(0,a.jsx)(eZ.O,{w:"full",h:"100px",rounded:"xl"}),!k.length&&!C&&(0,a.jsx)(d.xu,{children:j.u.EMPTY_SERVICES_MESSAGE(null==r?void 0:r.phone)}),P.length>0&&(0,a.jsxs)(d.xu,{w:"full",children:[(0,a.jsx)(d.xu,{mb:4,children:(0,a.jsx)(ew.u,{label:j.u.PREPAID_SERVICE_TOOLTIP,placement:"end",w:"fit-content",children:(0,a.jsxs)(_.x,{fontWeight:"semibold",w:"fit-content",children:[j.u.PREPAID_SERVICES_LABEL," ",(0,a.jsx)(eA.h,{boxSize:3})]})})}),(0,a.jsx)(h.M,{columns:{base:1,md:3},gridGap:{base:4,md:6},w:"full",children:[...P].sort((e,t)=>{var n,r;return((null===(n=e.name)||void 0===n?void 0:n.charCodeAt(0))||0)-((null===(r=t.name)||void 0===r?void 0:r.charCodeAt(0))||0)}).map(e=>(0,a.jsx)(eM,{service:e,setService:n,isSelected:e.id===(null==t?void 0:t.id)},e.id))})]}),P.length>0&&L.length>0&&(0,a.jsx)(_.x,{children:j.u.STANDARD_SERVICES_LABEL}),L.length>0&&(0,a.jsx)(h.M,{columns:{base:1,md:3},gridGap:{base:4,md:6},w:"full",children:[...L].sort((e,t)=>{var n,r;return((null===(n=e.name)||void 0===n?void 0:n.charCodeAt(0))||0)-((null===(r=t.name)||void 0===r?void 0:r.charCodeAt(0))||0)}).map(e=>(0,a.jsx)(eM,{service:e,setService:n,isSelected:e.id===(null==t?void 0:t.id)},e.id))})]})}),D&&(0,a.jsxs)(em,{p:6,children:[(0,a.jsx)(m.X,{size:"md",color:"brand.600",mb:3,children:j.u.SERVICE_ADDITIONAL_INFO_LABEL}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",mb:3}),(0,a.jsx)(Y,{content:(null==t?void 0:t.more_info)||""})]})]})},eG=n(81136);function eW(){return(0,a.jsxs)(eR.M,{flexDir:"column",gap:6,py:24,"data-sentry-element":"Center","data-sentry-component":"LoadingView","data-sentry-source-file":"loading-view.tsx",children:[(0,a.jsx)(eG.$,{size:"xl",thickness:"5px",emptyColor:"gray.200",color:"brand.500","data-sentry-element":"Spinner","data-sentry-source-file":"loading-view.tsx"}),(0,a.jsx)(_.x,{fontWeight:"medium",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"loading-view.tsx",children:j.u.LOADING})]})}var eH=e=>(0,a.jsxs)(el.J,{viewBox:"0 0 72 72",...e,"data-sentry-element":"Icon","data-sentry-component":"PawIcon","data-sentry-source-file":"paw-icon.tsx",children:[(0,a.jsx)("path",{d:"M50.9996 46.9765C51.0401 46.5066 51.0694 46.0332 51.071 45.5524C51.0973 36.8118 44.5052 29.7063 36.3474 29.6819C28.1895 29.6575 21.5552 36.7232 21.5289 45.4637C21.5275 45.9447 21.554 46.4181 21.5917 46.8883C18.6188 48.6969 16.5853 52.0752 16.5736 55.9998C16.5561 61.8268 20.9507 66.5636 26.3893 66.58C30.0523 66.5909 35.8036 61.3327 36.2525 61.3342C36.7015 61.3355 42.4212 66.6281 46.0842 66.639C51.5228 66.6554 55.9456 61.9448 55.9632 56.1178C55.9747 52.1932 53.9617 48.8028 50.9996 46.9765Z",fill:"none",opacity:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4","data-sentry-element":"path","data-sentry-source-file":"paw-icon.tsx"}),(0,a.jsx)("path",{d:"M20.8813 13.9503C20.3594 9.59547 22.4582 5.76301 25.5689 5.39023C28.6797 5.01745 31.6245 8.24553 32.1464 12.6003C32.6682 16.9551 30.5695 20.7876 27.4587 21.1604C24.348 21.5332 21.4032 18.3051 20.8813 13.9503Z",fill:"none",opacity:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4","data-sentry-element":"path","data-sentry-source-file":"paw-icon.tsx"}),(0,a.jsx)("path",{d:"M6.42502 31.2775C4.94418 27.1492 6.13428 22.9451 9.08319 21.8873C12.0321 20.8295 15.6231 23.3186 17.104 27.4468C18.5848 31.575 17.3947 35.7791 14.4458 36.837C11.4969 37.8948 7.90586 35.4057 6.42502 31.2775Z",fill:"none",opacity:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4","data-sentry-element":"path","data-sentry-source-file":"paw-icon.tsx"}),(0,a.jsx)("path",{d:"M57.7342 34.6221C54.7649 33.6228 53.4917 29.443 54.8906 25.2862C56.2895 21.1293 59.8306 18.5696 62.7999 19.5688C65.7693 20.5681 67.0424 24.7479 65.6436 28.9047C64.2447 33.0616 60.7036 35.6213 57.7342 34.6221Z",fill:"none",opacity:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4","data-sentry-element":"path","data-sentry-source-file":"paw-icon.tsx"}),(0,a.jsx)("path",{d:"M39.7804 12.743C40.2332 8.3806 43.1264 5.10638 46.2426 5.42981C49.3588 5.75325 51.5179 9.55187 51.0651 13.9143C50.6123 18.2767 47.7191 21.5509 44.6029 21.2274C41.4867 20.904 39.3276 17.1054 39.7804 12.743Z",fill:"none",opacity:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4","data-sentry-element":"path","data-sentry-source-file":"paw-icon.tsx"})]}),eQ=n(65695),eq=n(25996),eV=function(e){let{name:t,description:n,Icon:r,isSelected:s,onClick:i}=e;return(0,a.jsx)(d.xu,{role:"group",cursor:"pointer",onClick:i,display:"flex",flex:1,"data-sentry-element":"Box","data-sentry-component":"ServiceCategory","data-sentry-source-file":"service-category.tsx",children:(0,a.jsx)(eq.Z,{isSelected:s,p:{base:4,md:6},pt:{base:4,md:8},onClick:i,"data-sentry-element":"SelectableCard","data-sentry-source-file":"service-category.tsx",children:(0,a.jsxs)(ed.K,{direction:{base:"row",md:"column"},spacing:4,alignItems:{base:"center",md:"flex-start"},"data-sentry-element":"Stack","data-sentry-source-file":"service-category.tsx",children:[(0,a.jsx)(r,{boxSize:{base:12,md:14},color:"brand.500","data-sentry-element":"Icon","data-sentry-source-file":"service-category.tsx"}),(0,a.jsxs)(c.g,{alignItems:"flex-start",spacing:{base:0,md:2},"data-sentry-element":"VStack","data-sentry-source-file":"service-category.tsx",children:[(0,a.jsx)(m.X,{size:"sm",color:"brand.600","data-sentry-element":"Heading","data-sentry-source-file":"service-category.tsx",children:t}),(0,a.jsx)(_.x,{fontSize:"sm","data-sentry-element":"Text","data-sentry-source-file":"service-category.tsx",children:n})]})]})})})},eX=n(2572),eY=function(){let{isOpen:e,onOpen:t,onClose:n}=(0,o.q)(),{clinic:r,serviceCategory:s,setServiceCategory:i,hasHealthyServices:d,hasSickServices:u,hasOtherServices:x,bookingSettings:y}=(0,E.Q)(),{BOOKING_COPY:f}=Q();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eR.M,{w:"full",py:8,"data-sentry-element":"Center","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(c.g,{w:"full",spacing:8,"data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:f.SERVICE_TYPE_SECTION_HEADING}),(0,a.jsxs)(l.k,{flexDir:{base:"column",md:"row"},w:"full",gridGap:{base:4,md:8},"data-sentry-element":"Flex","data-sentry-source-file":"index.tsx",children:[d&&(0,a.jsx)(eV,{name:N.UW4.Healthy,description:(null==y?void 0:y.custom_well_description)||f.DEFAULT_WELLNESS_DESCRIPTION,Icon:eX.NC,isSelected:s===N.UW4.Healthy,onClick:()=>i(N.UW4.Healthy)}),u&&(0,a.jsx)(eV,{name:N.UW4.Sick,description:(null==y?void 0:y.custom_sick_description)||f.DEFAULT_SICK_DESCRIPTION,Icon:eX.wv,isSelected:s===N.UW4.Sick,onClick:t}),x&&(0,a.jsx)(eV,{name:(null==y?void 0:y.custom_other_title)||N.UW4.Other,description:(null==y?void 0:y.custom_other_description)||f.DEFAULT_OTHER_DESCRIPTION,Icon:eH,isSelected:s===N.UW4.Other,onClick:()=>i(N.UW4.Other)})]})]})}),(0,a.jsx)(eQ.Z,{isOpen:e,onClose:n,onConfirm:()=>{i(N.UW4.Sick),n()},severity:"danger",header:"Are you sure?",body:"If you feel your pet is in danger or needs to be seen right away, please call ".concat(null==r?void 0:r.name," directly").concat((null==r?void 0:r.phone)?" at ".concat((0,I.un)(r.phone)):"","."),"data-sentry-element":"ConfirmModal","data-sentry-source-file":"index.tsx"})]})},eJ=n(90273),eK=n(56418),e$=function(e){let{onReview:t}=e;(0,eK.H)(!1);let n=A(s.confirm);return(0,a.jsx)(eR.M,{w:"full",py:8,...(0,u.A)(n),"data-sentry-element":"Center","data-sentry-component":"ConfirmButton","data-sentry-source-file":"confirm-button.tsx",children:(0,a.jsx)(P.z,{colorScheme:"accent",size:"lg",rightIcon:(0,a.jsx)(eJ.m,{}),onClick:t,"data-sentry-element":"Button","data-sentry-source-file":"confirm-button.tsx",children:j.u.CONTINUE})})},e0=n(63016),e1=n(90349),e5=n(74279);function e2(){let{selectedClientPatient:e,setSelectedClientPatient:t,serviceCategory:n,hasClientMatched:r,clientFirstName:s,clientLastName:i,clientPhone:l,patientName:o,patientSpecies:c,setHasClientMatched:u,patientBirthdate:x,patientGender:m}=(0,E.Q)();if(!r)return null;let{client_name_preview:y,client_phone_preview:f,patient_name:h,patient_birthday:p,patient_gender:g}=e||{client_name_preview:"".concat(s," ").concat(i),client_phone_preview:l,patient_name:o,patient_birthday:x},v=p||x,I=g||m,T=I===N.NQQ.Unknown?"":I,b=new Date,S=v?j.u.AGE_DISPLAY((0,e0.Z)(new Date(v),b)):e?j.u.NO_BIRTHDATE:"",C=null==c?void 0:c.species,R=[C,S,T].filter(Boolean).join(" | "),w={row:!0,justify:{md:"center"},align:"center",flex:1,spacing:6};return(0,a.jsxs)(eI.Z,{align:"center",spacing:18,"data-sentry-element":"SharedStack","data-sentry-component":"ClientSelected","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(P.z,{colorScheme:"accent",onClick:()=>{u(!1),t(void 0)},"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(_.x,{textAlign:"left","data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:j.u.RETURN_TO_CLIENT_PATIENT_STEP})}),(0,a.jsx)(e5.Z,{px:6,py:4,w:"full","data-sentry-element":"OutlineBox","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(eI.Z,{direction:{base:"column",md:"row"},justify:{md:"space-around"},"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsxs)(eI.Z,{...w,"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(el.J,{as:D.IHQ,color:"brand.600",boxSize:"24px","data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(e1.Z,{"data-sentry-element":"ContentText","data-sentry-source-file":"index.tsx",children:h||o}),(0,a.jsx)(_.x,{fontSize:"12px",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:R||j.u.PATIENT})]})]}),(0,a.jsxs)(eI.Z,{...w,"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(el.J,{as:D.Xws,color:"brand.600",boxSize:"24px","data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(e1.Z,{"data-sentry-element":"ContentText","data-sentry-source-file":"index.tsx",children:y}),(0,a.jsx)(_.x,{fontSize:"12px",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:f||j.u.NO_PHONE_NUMBER})]})]}),(0,a.jsxs)(eI.Z,{...w,"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(el.J,{as:D.GON,color:"brand.600",boxSize:"24px","data-sentry-element":"Icon","data-sentry-source-file":"index.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(e1.Z,{"data-sentry-element":"ContentText","data-sentry-source-file":"index.tsx",children:n}),(0,a.jsx)(_.x,{fontSize:"12px",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"index.tsx",children:j.u.SERVICE_CATEGORY})]})]})]})})]})}var e4=n(9512),e3=n(68519),e6=n(52315),e8=n(17971),e7=n(35796),e9=n(72821);function te(e){var t;let{clinic:n}=e,r=(0,e7.S)({base:!0,lg:!1}),s=(0,I.yL)(n.address||{}),i=!!(t=n.clinic_hours)&&Object.values((0,I.PT)(t)).some(e=>null==e?void 0:e.length),l=i?n.clinic_hours:n.hours;return(0,a.jsxs)(e6.Z,{mb:6,mt:{base:2,md:0},"data-sentry-element":"Card","data-sentry-component":"ClinicInfoCard","data-sentry-source-file":"clinic-info-card.tsx",children:[(0,a.jsxs)(ed.K,{direction:{base:"column",md:"row"},spacing:{base:4,md:8},alignItems:"flex-start","data-sentry-element":"Stack","data-sentry-source-file":"clinic-info-card.tsx",children:[(0,a.jsx)(F.Z,{avatarUrl:(null==n?void 0:n.avatar_url)||"",name:(null==n?void 0:n.name)||"","data-sentry-element":"ClinicLogo","data-sentry-source-file":"clinic-info-card.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"clinic-info-card.tsx",children:[(0,a.jsx)(_.x,{mb:1,fontSize:"sm",fontWeight:"medium","data-sentry-element":"Text","data-sentry-source-file":"clinic-info-card.tsx",children:j.u.BOOKING_WITH_CLINIC_TITLE}),(0,a.jsx)(e8.Z,{size:"lg",fontWeight:"bold",mb:1,"data-sentry-element":"SharedHeader","data-sentry-source-file":"clinic-info-card.tsx",children:n.name}),(0,a.jsx)(ed.K,{direction:{base:"column",md:"row"},spacing:{base:0,md:1},"data-sentry-element":"Stack","data-sentry-source-file":"clinic-info-card.tsx",children:s.map((e,t)=>(0,a.jsxs)(_.x,{fontSize:{base:"sm",lg:"md"},color:"gray.500",children:[e,t<s.length-1?",":""]},e))})]})]}),(0,a.jsx)(ev.Z,{my:4,"data-sentry-element":"Divider","data-sentry-source-file":"clinic-info-card.tsx"}),(0,a.jsxs)(h.M,{columns:{base:1,lg:3},spacing:6,"data-sentry-element":"SimpleGrid","data-sentry-source-file":"clinic-info-card.tsx",children:[n.phone&&(0,a.jsxs)(d.xu,{children:[(0,a.jsx)(_.x,{fontSize:"sm",fontWeight:"semibold",children:"Phone Number"}),(0,a.jsx)(e9.r,{textDecor:"underline",href:"tel:".concat((0,I.un)(n.phone)),children:(0,a.jsx)(_.x,{fontSize:"sm",children:(0,I.un)(n.phone)})}),(0,a.jsx)(_.x,{fontSize:"xs",color:"gray.500",children:"If you need to call the clinic directly"})]}),l&&(0,a.jsxs)(e3.P,{colSpan:{base:1,lg:2},children:[(0,a.jsx)(_.x,{fontSize:"sm",fontWeight:"semibold",children:"Clinic Hours"}),(0,I.u6)(l,void 0,r).map(e=>(0,a.jsx)(_.x,{fontSize:"sm",children:e},e))]})]})]})}var tt=n(11163),tn=n(18618),tr=n(97521),ts=n(43318),ta=n(11824),ti=function(e){var t,n,r;let{appointment:s,clinic:i}=e,o=(0,tt.useRouter)(),{user:u}=(0,w.a)(),[x]=(0,tn.a)("(min-width: 768px)"),y=(null===(t=i.features)||void 0===t?void 0:t.portal_enabled)||!1,f=(null===(n=i.settings)||void 0===n?void 0:n.appointment_entry_method)===N.Kh7.Instant;return(0,a.jsx)(e6.Z,{pb:8,...x?{}:{bg:"none",borderWidth:0,px:2,py:2,shadow:"none"},"data-sentry-element":"Card","data-sentry-component":"CompletedBookView","data-sentry-source-file":"completed-view.tsx",children:(0,a.jsxs)(c.g,{w:"full",spacing:8,"data-sentry-element":"VStack","data-sentry-source-file":"completed-view.tsx",children:[(0,a.jsxs)(l.k,{w:"full",alignItems:"flex-start",justifyContent:"space-between","data-sentry-element":"Flex","data-sentry-source-file":"completed-view.tsx",children:[(0,a.jsx)(eg.L,{"data-sentry-element":"Spacer","data-sentry-source-file":"completed-view.tsx"}),(0,a.jsx)(F.Z,{avatarUrl:i.avatar_url||"",name:i.name||"","data-sentry-element":"ClinicLogo","data-sentry-source-file":"completed-view.tsx"}),(0,a.jsx)(eg.L,{"data-sentry-element":"Spacer","data-sentry-source-file":"completed-view.tsx"})]}),(0,a.jsx)(d.xu,{px:{base:4,md:24},"data-sentry-element":"Box","data-sentry-source-file":"completed-view.tsx",children:(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},textAlign:"center","data-sentry-element":"Heading","data-sentry-source-file":"completed-view.tsx",children:j.u.COMPLETED_APPOINTMENT_SECTION_TITLE((null===(r=s.clinic)||void 0===r?void 0:r.name)||"",f)})}),(0,a.jsx)(ev.Z,{"data-sentry-element":"Divider","data-sentry-source-file":"completed-view.tsx"}),(0,a.jsxs)(l.k,{w:"full",mt:8,direction:"column-reverse","data-sentry-element":"Flex","data-sentry-source-file":"completed-view.tsx",children:[(0,a.jsx)(d.xu,{flex:2,"data-sentry-element":"Box","data-sentry-source-file":"completed-view.tsx",children:(0,a.jsx)(tr.Z,{appointment:s,"data-sentry-element":"AppointmentInfo","data-sentry-source-file":"completed-view.tsx"})}),(0,a.jsx)(d.xu,{flex:1,"data-sentry-element":"Box","data-sentry-source-file":"completed-view.tsx",children:(0,a.jsx)(ts.Z,{clinic:s.clinic,"data-sentry-element":"AppointmentClinicInfo","data-sentry-source-file":"completed-view.tsx"})})]}),(!!u||y)&&(0,a.jsx)(P.z,{size:"lg",colorScheme:"accent",onClick:()=>{u?o.push(ta.Z.AllAppointments):o.push("".concat(ta.Z.Login,"?returnUrl=").concat(ta.Z.AllAppointments))},children:u?j.u.VIEW_MY_APPPOINTMENTS:j.u.LOGIN_TO_VIEW_APPOINTMENTS})]})})},tl=n(62847),td=n(35541),to=n(14581),tc=n(49289),tu=n(82140),tx=n(32735),tm=n(19131),ty=n(65370),tf=n(1679),th=n(19754),tp=n(89993);function tg(e){var t;let{inputProps:n,value:r,onChange:s,isDisabled:l,options:d,getters:c,searchFields:u=[],storeFields:x=[]}=e,[m,y]=(0,i.useState)(""),{isOpen:f,onOpen:h,onClose:p}=(0,o.q)(),g=(0,i.useRef)(null),v=new ty.Z({fields:u,storeFields:x,searchOptions:{fuzzy:!0,prefix:!0}});v.addAll(d);let E=()=>{y(""),p()},I=(0,i.useMemo)(()=>m?v.search(m):d,[m,d]);return(0,a.jsxs)(eO.J,{variant:"responsive",autoFocus:!1,isOpen:f,onClose:E,id:"chakra-popover","data-sentry-element":"Popover","data-sentry-component":"SearchSelect","data-sentry-source-file":"search-select.tsx",children:[(0,a.jsx)(tm.t,{"data-sentry-element":"PopoverAnchor","data-sentry-source-file":"search-select.tsx",children:(0,a.jsxs)(tu.B,{"data-sentry-element":"InputGroup","data-sentry-source-file":"search-select.tsx",children:[(0,a.jsx)(H.I,{ref:g,isDisabled:l,value:r?c.label(r):m,onFocus:h,onBlur:e=>{var t;null!==(t=e.relatedTarget)&&void 0!==t&&t.id.includes("chakra-popover")||E()},onChange:e=>{y(e.target.value)},...n,_hover:{bg:"gray.100"},"data-sentry-element":"Input","data-sentry-source-file":"search-select.tsx"}),(0,a.jsx)(tx.x,{"data-sentry-element":"InputRightElement","data-sentry-source-file":"search-select.tsx",children:(!!m||!!r)&&(0,a.jsx)(tp.h,{variant:"unstyled","aria-label":"clear",onClick:()=>{y(""),s(void 0)},children:(0,a.jsx)(tf.T,{fontSize:"xs",color:"gray.500"})})})]})}),(0,a.jsx)(eP.y,{minW:"".concat(null===(t=g.current)||void 0===t?void 0:t.clientWidth,"px"),maxH:"290px",overflowY:"scroll",overflowX:"hidden",rounded:"lg",borderColor:"blackAlpha.200","data-sentry-element":"PopoverContent","data-sentry-source-file":"search-select.tsx",children:(0,a.jsx)(eU.b,{px:0,"data-sentry-element":"PopoverBody","data-sentry-source-file":"search-select.tsx",children:I.length>0?I.map(e=>(0,a.jsx)(t_,{option:e,getters:c,onClick:()=>{s(e),E()},isSelected:!!r&&c.value(e)===c.value(r)},c.value(e))):(0,a.jsxs)(_.x,{py:4,textAlign:"center",children:["No Results for ",m]})})})]})}function t_(e){let{option:t,getters:n,onClick:r,isSelected:s}=e;return(0,a.jsxs)(l.k,{flexDir:"row",alignItems:"center",gap:2,py:1.5,px:3,_hover:{bg:"gray.100"},_dark:{_hover:{bg:"gray.700"}},cursor:"pointer",onClick:r,"data-sentry-element":"Flex","data-sentry-component":"SelectOption","data-sentry-source-file":"search-select.tsx",children:[(0,a.jsx)(_.x,{"data-sentry-element":"Text","data-sentry-source-file":"search-select.tsx",children:n.label(t)}),s&&(0,a.jsx)(th.n,{})]})}var tv=e=>{let{breeds:t,loading:n,selectedBreed:r,setSelectedBreed:s}=e,{patientSpecies:i}=(0,E.Q)(),l=n||!i||0===t.length;return(0,a.jsx)(tg,{isDisabled:l,value:r,onChange:s,options:[...t].sort((e,t)=>e.description.localeCompare(t.description)),getters:{value:e=>e.id,label:e=>e.description},inputProps:{placeholder:i?j.u.PET_BREED_SELECT_PLACEHOLDER:j.u.PET_BREED_SPECIES_FIRST},searchFields:["description"],storeFields:["id","description"],"data-sentry-element":"SearchSelect","data-sentry-component":"BreedSelect","data-sentry-source-file":"breed-select.tsx"})},tE=n(66889);function tI(){let{clientAddress:e,setClientAddress:t}=(0,E.Q)();return(0,a.jsx)(tE.Z,{address:e,setAddress:t,"data-sentry-element":"AddressInputBlock","data-sentry-component":"ClientAddressBlock","data-sentry-source-file":"client-address.tsx"})}let tT=e=>![N.taI.AvImark].includes(e);function tj(e){var t,n,r,s;let{isOpen:l,onClose:o,onConfirm:c}=e,{clinic:u,clinicBreed:x,setClinicBreed:m,clientAddress:y,patientId:f,clientId:h,isNewClient:p,patient:g,patientSpecies:v,pet:I}=(0,E.Q)(),T=tT(u.pms),{data:b,loading:S}=(0,N.NPk)({variables:{where:[u.pms_db?{column:"pms_db",filterOp:N.JX8.Eq,value:{string:(null===(t=u.pms_db)||void 0===t?void 0:t.id)||""}}:{column:"clinic",filterOp:N.JX8.Eq,value:{string:(null==u?void 0:u.id)||""}},{column:"species",filterOp:N.JX8.Eq,value:{string:(null==v?void 0:v.species)||""}},{column:"description",filterOp:N.JX8.Gte,value:{string:"a"}}],page:0,pageSize:1e3},skip:!T||!(null==v?void 0:v.species)||!(null==u?void 0:u.id)}),C=(null==b?void 0:b.queryBreeds)||[],R=(0,i.useRef)(!f&&u.pms!==N.taI.AvImark&&!x),w=(0,i.useRef)(!h&&p&&!y&&(null===(n=u.settings)||void 0===n?void 0:n.does_require_new_client_address)),A=R.current&&(!x||(null==g?void 0:null===(r=g.clinic_species)||void 0===r?void 0:r.species)!==x.species&&(null==I?void 0:I.species)!==x.species),O=w.current&&!(null==y?void 0:y.street_a)||!(null==y?void 0:y.city)||!(null==y?void 0:y.state)||!(null==y?void 0:y.zip);return(0,a.jsxs)(td.u_,{isOpen:l,onClose:o,"data-sentry-element":"Modal","data-sentry-component":"RequiredInfoModal","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(ee.Z,{"data-sentry-element":"ModalOverlay","data-sentry-source-file":"index.tsx"}),(0,a.jsxs)(to.h,{"data-sentry-element":"ModalContent","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(et.x,{"data-sentry-element":"ModalHeader","data-sentry-source-file":"index.tsx",children:j.u.MORE_INFO_MODAL_TITLE}),(0,a.jsx)(en.f,{"data-sentry-element":"ModalBody","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(eI.Z,{spacing:4,divider:(0,a.jsx)(tc.i,{}),"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[R&&(0,a.jsxs)(d.xu,{children:[(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.700",mb:4,children:j.u.MORE_INFO_BREED_DESCRIPTION}),(0,a.jsxs)(_.x,{fontWeight:"semibold",textTransform:"uppercase",fontSize:"sm",letterSpacing:"wider",color:"gray.500",children:[(null==g?void 0:null===(s=g.clinic_species)||void 0===s?void 0:s.species)||(null==I?void 0:I.species)," ",j.u.BREEDS]}),(0,a.jsx)(tv,{breeds:C,loading:S,selectedBreed:x,setSelectedBreed:m,placeholder:j.u.PET_BREED_SELECT_PLACEHOLDER})]}),w&&(0,a.jsxs)(d.xu,{children:[(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.700",mb:4,children:j.u.MORE_INFO_ADDRESS_DESCRIPTION}),(0,a.jsx)(_.x,{fontWeight:"semibold",textTransform:"uppercase",fontSize:"sm",letterSpacing:"wider",color:"gray.500",children:j.u.ADDRESS}),(0,a.jsx)(tI,{})]})]})}),(0,a.jsx)(er.m,{"data-sentry-element":"ModalFooter","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(P.z,{colorScheme:"accent",isDisabled:A||O,onClick:c,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:j.u.CONTINUE})})]})]})}var tb=n(63965);function tS(){let{client:e,isNewClient:t,setIsNewClient:n,isNewPatient:r,setIsNewPatient:i,bookingSettings:l}=(0,E.Q)(),{BOOKING_COPY:d}=Q(),{setThenClearState:o}=(0,tb.I)(),c=o(n),x=o(i),m=A(s.returningStatus);if(e)return null;let y=(null==l?void 0:l.should_allow_new_patients)===!1;return(0,a.jsxs)(eI.Z,{py:8,spacing:16,...(0,u.A)(m),"data-sentry-element":"SharedStack","data-sentry-component":"ReturningStatusStep","data-sentry-source-file":"index.tsx",children:[(0,a.jsxs)(eI.Z,{spacing:8,align:"center","data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(e8.Z,{"data-sentry-element":"SharedHeader","data-sentry-source-file":"index.tsx",children:d.RETURNING_PATIENT_QUESTION}),(0,a.jsxs)(eI.Z,{...tN,"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(S,{label:d.POSITIVE_RETURNING_PATIENT_ANSWER,onClick:()=>x(!1),isSelected:!1===r,...tC,"data-sentry-element":"PreferenceButton","data-sentry-source-file":"index.tsx"}),(0,a.jsx)(S,{label:d.NEGATIVE_RETURNING_PATIENT_ANSWER,onClick:()=>x(!0),isSelected:!0===r,...tC,"data-sentry-element":"PreferenceButton","data-sentry-source-file":"index.tsx"})]})]}),!0===r&&!y&&(0,a.jsxs)(eI.Z,{spacing:8,align:"center",children:[(0,a.jsx)(e8.Z,{children:d.RETURNING_CLIENT_QUESTION}),(0,a.jsxs)(eI.Z,{...tN,children:[(0,a.jsx)(S,{label:d.POSITIVE_RETURNING_CLIENT_ANSWER,onClick:()=>c(!1),isSelected:!1===t,...tC}),(0,a.jsx)(S,{label:d.NEGATIVE_RETURNING_CLIENT_ANSWER,onClick:()=>c(!0),isSelected:!0===t,...tC})]})]})]})}let tN={direction:{base:"column",md:"row"},w:{base:"full",md:"fit-content"}},tC={fontSize:{base:"md",md:"lg"},w:{base:"full",md:"initial"}};var tR=n(50250),tw=n(97058);function tA(){let{clientDOB:e,setClientDOB:t}=(0,E.Q)();return(0,a.jsx)(H.I,{type:"date",onBlur:e=>isNaN(Date.parse(e.target.value))?void 0:t(new Date(e.target.value)),defaultValue:(null==e?void 0:e.toISOString().split("T")[0])||"","data-sentry-element":"Input","data-sentry-component":"ClientDOBBlock","data-sentry-source-file":"client-dob-block.tsx"})}var tO=function(){var e,t;let{clinic:n,clientFirstName:r,setClientFirstName:s,clientLastName:i,setClientLastName:d,clientPhone:o,setClientPhone:u,clientEmail:x,setClientEmail:y,isNewClient:f}=(0,E.Q)(),{BOOKING_COPY:h}=Q(),{setThenClearState:p}=(0,tb.I)(),g=p(s),_=p(d),v=p(u),I=p(y),T=null===(e=n.settings)||void 0===e?void 0:e.does_require_new_client_birthday,b=null===(t=n.settings)||void 0===t?void 0:t.does_require_new_client_address;return(0,a.jsxs)(c.g,{w:"full",spacing:8,px:{base:2,md:32},"data-sentry-element":"VStack","data-sentry-component":"ClientForm","data-sentry-source-file":"client-form.tsx",children:[(0,a.jsx)(m.X,{size:"lg",fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"client-form.tsx",children:h.CLIENT_INFORMATION_SECTION_TITLE}),(0,a.jsxs)(l.k,{w:"full",gridGap:8,"data-sentry-element":"Flex","data-sentry-source-file":"client-form.tsx",children:[(0,a.jsx)(tR.Z,{label:j.u.FIRST_NAME,isRequired:!0,"data-sentry-element":"FormWrapper","data-sentry-source-file":"client-form.tsx",children:(0,a.jsx)(H.I,{value:r||"",onChange:e=>g(e.target.value),placeholder:j.u.FIRST_NAME_INPUT_PLACEHOLDER,"data-sentry-element":"Input","data-sentry-source-file":"client-form.tsx"})}),(0,a.jsx)(tR.Z,{label:j.u.LAST_NAME,isRequired:!0,"data-sentry-element":"FormWrapper","data-sentry-source-file":"client-form.tsx",children:(0,a.jsx)(H.I,{value:i||"",onChange:e=>_(e.target.value),placeholder:j.u.LAST_NAME_INPUT_PLACEHOLDER,"data-sentry-element":"Input","data-sentry-source-file":"client-form.tsx"})})]}),(0,a.jsxs)(l.k,{w:"full",gridGap:8,direction:{base:"column",md:"row"},"data-sentry-element":"Flex","data-sentry-source-file":"client-form.tsx",children:[(0,a.jsx)(tR.Z,{label:j.u.PHONE_NUMBER,isRequired:!0,"data-sentry-element":"FormWrapper","data-sentry-source-file":"client-form.tsx",children:(0,a.jsx)(tw.Z,{value:o||"",onChange:e=>v(e.target.value),placeholder:j.u.PHONE_NUMBER_INPUT_PLACEHOLDER,"data-sentry-element":"PhoneNumberInput","data-sentry-source-file":"client-form.tsx"})}),(0,a.jsx)(tR.Z,{label:j.u.EMAIL,isRequired:!0,"data-sentry-element":"FormWrapper","data-sentry-source-file":"client-form.tsx",children:(0,a.jsx)(H.I,{value:x||"",onChange:e=>I(e.target.value),placeholder:j.u.EMAIL_INPUT_PLACEHOLDER,"data-sentry-element":"Input","data-sentry-source-file":"client-form.tsx"})})]}),f&&T&&(0,a.jsx)(tR.Z,{label:j.u.CLIENT_DOB,isRequired:!0,children:(0,a.jsx)(tA,{})}),f&&b&&(0,a.jsx)(tR.Z,{label:j.u.ADDRESS,isRequired:!0,children:(0,a.jsx)(tI,{})})]})};function tk(e){let{user:t}=e,n=(0,tt.useRouter)(),{logout:r}=(0,w.a)(),{client:s}=(0,E.Q)(),{first_name:i,last_name:o,email:c,phone:u}=s||t;return(0,a.jsx)(d.xu,{py:8,w:"full","data-sentry-element":"Box","data-sentry-component":"LoggedInCard","data-sentry-source-file":"logged-in-card.tsx",children:(0,a.jsxs)(d.xu,{px:6,pt:3,pb:4,bg:"white",_dark:{bg:"gray.800",borderColor:"whiteAlpha.200"},rounded:"xl",borderWidth:1,borderColor:"gray.200","data-sentry-element":"Box","data-sentry-source-file":"logged-in-card.tsx",children:[(0,a.jsx)(_.x,{mb:4,fontSize:"sm",fontWeight:"semibold","data-sentry-element":"Text","data-sentry-source-file":"logged-in-card.tsx",children:j.u.BOOKING_AS_CLIENT_TITLE}),(0,a.jsxs)(l.k,{flexDir:{base:"column",md:"row"},alignItems:"center",justifyContent:"space-between",gap:{base:4,md:0},"data-sentry-element":"Flex","data-sentry-source-file":"logged-in-card.tsx",children:[(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"logged-in-card.tsx",children:[(0,a.jsx)(f.q,{src:s?"":t.avatar_url||"",name:"".concat(i," ").concat(o),"data-sentry-element":"Avatar","data-sentry-source-file":"logged-in-card.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"logged-in-card.tsx",children:[(0,a.jsxs)(_.x,{fontSize:"lg",fontWeight:"semibold","data-sentry-element":"Text","data-sentry-source-file":"logged-in-card.tsx",children:[i," ",o]}),(0,a.jsxs)(_.x,{fontSize:"sm",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"logged-in-card.tsx",children:[c," | ",(0,I.un)(u||"")]}),!s&&(0,a.jsx)(eE.Z,{mt:2,bg:"gray.100",p:1,px:3,w:"fit-content",rounded:"md",_dark:{bg:"gray.700"},children:j.u.NO_CLIENT_LINKED_MESSAGE})]})]}),(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"logged-in-card.tsx",children:[(0,a.jsx)(P.z,{size:"sm",colorScheme:"accent",variant:"subtle",onClick:()=>{r({returnToLogin:!1}),n.push("".concat(ta.Z.Login,"?returnUrl=").concat(n.asPath))},"data-sentry-element":"Button","data-sentry-source-file":"logged-in-card.tsx",children:"Switch account"}),(0,a.jsx)(_.x,{color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"logged-in-card.tsx",children:"or"}),(0,a.jsx)(P.z,{size:"sm",colorScheme:"red",variant:"outline",onClick:()=>{r({returnToLogin:!1})},"data-sentry-element":"Button","data-sentry-source-file":"logged-in-card.tsx",children:j.u.LOG_OUT})]})]})]})})}var tP=n(7414),tL=n(51680),tD=n(33090),tU=n(7116),tB=n(67754),tM=n(3877),tz=n(65775);function tZ(){var e;let{clinic:t,setHasClientMatched:n,setSelectedClientPatient:r}=(0,E.Q)(),d=A(s.client),[o,x]=(0,i.useState)(""),[y,f]=(0,i.useState)(void 0),[h,p]=(0,i.useState)(!0),[g,_]=(0,i.useState)(""),[v,I]=(0,i.useState)(""),T=(0,tP.N)(o,500),{data:b,loading:S}=(0,N.ZBk)({variables:{clinicId:t.id,searchInput:T},skip:!T||T.length<3}),[C,{loading:R}]=(0,N.UfQ)(),w=null!==(e=null==b?void 0:b.checkReturningClientPatient)&&void 0!==e?e:[];return(0,a.jsxs)(c.g,{w:"full",spacing:8,px:{base:2,md:32},...(0,u.A)(d),"data-sentry-element":"VStack","data-sentry-component":"ReturningClientForm","data-sentry-source-file":"index.tsx",children:[(0,a.jsxs)(eI.Z,{align:"center",spacing:4,"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:"lg",fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.RETURNING_CLIENT_PATIENT_SEARCH_TITLE}),(0,a.jsx)(tM.Z,{textAlign:"center","data-sentry-element":"SharedSubheader","data-sentry-source-file":"index.tsx",children:j.u.RETURNING_CLIENT_PATIENT_SEARCH_DESCRIPTION})]}),(0,a.jsx)(l.k,{w:"full",gridGap:8,"data-sentry-element":"Flex","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(tu.B,{size:"lg","data-sentry-element":"InputGroup","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(tL.Ui,{w:"52px",bg:"brand.600",color:"white","data-sentry-element":"InputLeftAddon","data-sentry-source-file":"index.tsx",children:S?(0,a.jsx)(eG.$,{size:"sm"}):(0,a.jsx)(tU.W,{})}),(0,a.jsx)(tD.I,{bg:"white",_dark:{bg:"gray.800"},fontSize:"md",focusBorderColor:"brand.500",placeholder:"Search...",value:o,onChange:e=>{f(void 0),x(e.target.value)},onFocus:()=>p(!1),"data-sentry-element":"Input","data-sentry-source-file":"index.tsx"})]})}),T&&!S&&0===w.length&&(0,a.jsx)(tM.Z,{textAlign:"center",children:T.length<3?j.u.INCOMPLETE_CLIENT_SEARCH_MESSAGE:j.u.EMPTY_CLIENT_SEARCH_MESSAGE}),S&&(0,a.jsx)(eI.Z,{spacing:3,children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(eZ.O,{height:"76px",w:"full",rounded:"xl"},t))}),y&&h?(0,a.jsx)(tB.Z,{searchResult:y,isSelected:!0}):(0,a.jsx)(eI.Z,{spacing:3,children:w.map((e,t)=>(0,a.jsx)(tB.Z,{onClick:()=>{f(e),p(!0)},searchResult:e,isSelected:(null==y?void 0:y.patient_id)===e.patient_id},"".concat(e.client_id,"-").concat(e.patient_id,"-").concat(t)))}),y&&(0,a.jsxs)(eI.Z,{w:"auto",align:"center",children:[(0,a.jsx)(tM.Z,{children:j.u.VERIFY_PHONE_NUMBER_TITLE(y.client_name_preview)}),(0,a.jsx)(tw.Z,{w:{base:"full",md:"fit-content"},autoFocus:!0,value:g,onChange:e=>_(e.target.value)})]}),v&&(0,a.jsx)(tz.Z,{children:v}),(0,a.jsx)(P.z,{colorScheme:"accent",onClick:()=>C({variables:{clientId:(null==y?void 0:y.client_id)||"",phoneInput:g.replace(/\D/g,"")},onCompleted:e=>{e.validateClientPhone?(n(!0),r(y)):I(j.u.ENTERED_PHONE_NUMBER_MISMATCH_ERROR)},onError:e=>{I(e.message)},fetchPolicy:"no-cache"}),isLoading:R,isDisabled:!y,"data-sentry-element":"Button","data-sentry-source-file":"index.tsx",children:j.u.CONTINUE})]})}var tF=function(){let{user:e}=(0,w.a)(),t=A(s.client),{isNewClient:n,procedure:r}=(0,E.Q)();return e?(0,a.jsx)(tk,{user:e}):!n&&[N.FYq.PatientSearch,N.FYq.PatientSearchWithVerification].includes(r)?(0,a.jsx)(tZ,{}):(0,a.jsx)(eR.M,{id:"pet",w:"full",py:8,flexDir:"column",...(0,u.A)(t),"data-sentry-element":"Center","data-sentry-component":"ClientStep","data-sentry-source-file":"index.tsx",children:(0,a.jsx)(tO,{"data-sentry-element":"ClientForm","data-sentry-source-file":"index.tsx"})})},tG=function(){var e;let{clinic:t,client:n,patientName:r,setPatientName:s,patientSpecies:d,setPatientSpecies:o,patientBreed:u,setPatientBreed:x,clinicBreed:y,setClinicBreed:f,patientBirthdate:h,setPatientBirthdate:p,patientGender:g,setPatientGender:_,patientFixed:v,setPatientFixed:I,isNewPatient:b,procedure:S}=(0,E.Q)(),{BOOKING_COPY:C}=Q(),{checkClient:R,setThenClearState:w}=(0,tb.I)(),{data:A,loading:O}=(0,N.Dof)({variables:{clinicId:t.id}}),k=(0,i.useMemo)(()=>[...(null==A?void 0:A.getClinicSpeciesByClinic)||[]].filter(e=>!!e.species&&e.is_primary),[A]),P=tT(t.pms),{data:L,loading:D}=(0,N.NPk)({variables:{where:[t.pms_db?{column:"pms_db",filterOp:N.JX8.Eq,value:{string:(null===(e=t.pms_db)||void 0===e?void 0:e.id)||""}}:{column:"clinic",filterOp:N.JX8.Eq,value:{string:(null==t?void 0:t.id)||""}},{column:"species",filterOp:N.JX8.Eq,value:{string:(null==d?void 0:d.species)||""}},{column:"description",filterOp:N.JX8.Gte,value:{string:"A"}}],page:0,pageSize:1e3},skip:!P||!(null==d?void 0:d.species)||!(null==t?void 0:t.id)}),U=(null==L?void 0:L.queryBreeds)||[],B=P?k||[]:k,M=b||S===N.FYq.Legacy||!!n,z=w(s);return(0,a.jsxs)(c.g,{w:"full",spacing:{base:4,md:8},px:{base:2,md:32},"data-sentry-element":"VStack","data-sentry-component":"PatientForm","data-sentry-source-file":"patient-form.tsx",children:[(0,a.jsx)(m.X,{size:"lg",fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"patient-form.tsx",children:C.PATIENT_INFORMATION_SECTION_TITLE}),(0,a.jsx)(tR.Z,{label:j.u.PET_NAME_LABEL,isRequired:!0,"data-sentry-element":"FormWrapper","data-sentry-source-file":"patient-form.tsx",children:(0,a.jsx)(H.I,{value:r||"",onChange:e=>z(e.target.value),placeholder:j.u.PET_NAME_INPUT_PLACEHOLDER,onKeyDown:e=>{!b&&"Enter"===e.key&&R&&R()},"data-sentry-element":"Input","data-sentry-source-file":"patient-form.tsx"})}),M&&(0,a.jsxs)(l.k,{w:"full",gridGap:{base:4,md:8},flexDir:{base:"column",md:"row"},children:[(0,a.jsx)(tR.Z,{label:j.u.PET_SPECIES_LABEL,isRequired:!0,children:(0,a.jsx)(T.GZ,{value:(null==d?void 0:d.species)||"",onChange:e=>o(B.find(t=>t.species===e)),placeholder:j.u.PET_SPECIES_SELECT_PLACEHOLDER,options:B.filter(e=>{var n,r;return null==t?void 0:null===(n=t.settings)||void 0===n?void 0:null===(r=n.included_species)||void 0===r?void 0:r.some(t=>e.species===t)}).sort((e,t)=>e.species.localeCompare(t.species)).map(e=>({value:e.species,label:e.species})),buttonOverrides:{w:"100%",isDisabled:O}})}),(0,a.jsx)(tR.Z,{label:j.u.PET_BREED_LABEL,isRequired:P,children:P?(0,a.jsx)(tv,{breeds:U,loading:D,selectedBreed:y,setSelectedBreed:f}):(0,a.jsx)(H.I,{value:u||"",onChange:e=>x(e.target.value),placeholder:j.u.PET_BREED_INPUT_PLACEHOLDER})})]}),(b||!!n)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.k,{w:"full",gridGap:8,direction:{base:"column",md:"row"},children:[(0,a.jsx)(tR.Z,{label:j.u.PET_GENDER_LABEL,isRequired:!0,children:(0,a.jsx)(T.GZ,{value:g||"",onChange:e=>_(e),options:Object.values(N.NQQ).map(e=>({value:e,label:e})),buttonOverrides:{w:"100%"}})}),(0,a.jsx)(tR.Z,{label:j.u.PET_FIXED_STATUS_LABEL,isRequired:!0,children:(0,a.jsx)(T.GZ,{value:v||"",onChange:e=>{I(e)},options:[{value:N.sXh.Unknown,label:j.u.NOT_SURE},{value:N.sXh.Fixed,label:j.u.YES},{value:N.sXh.Intact,label:j.u.NO}],buttonOverrides:{w:"100%"}})})]}),(0,a.jsx)(tR.Z,{label:j.u.PET_BIRTHDATE_LABEL,hintText:j.u.PET_BIRTHDATE_HELP_TEXT,children:(0,a.jsx)(H.I,{type:"date",onBlur:e=>isNaN(Date.parse(e.target.value))?void 0:p(new Date(e.target.value)),defaultValue:(null==h?void 0:h.toISOString().split("T")[0])||""})})]})]})},tW=n(12054),tH=n(43214);function tQ(e){var t,n,r;let{patient:s,setPatient:i,isSelected:l,isInvalid:o}=e,{clinic:c}=(0,E.Q)();return(0,a.jsx)(ew.u,{isDisabled:!o,label:j.u.PATIENT_ITEM_SPECIES_NOT_TREATED((null==c?void 0:c.name)||"",(null===(t=s.clinic_species)||void 0===t?void 0:t.species)||""),closeOnClick:!1,"data-sentry-element":"Tooltip","data-sentry-component":"PatientItem","data-sentry-source-file":"patient-item.tsx",children:(0,a.jsx)(d.xu,{role:"group",cursor:"pointer",onClick:()=>o?null:i(s),filter:o?"grayscale(100%)":"none",opacity:o?.8:1,"data-sentry-element":"Box","data-sentry-source-file":"patient-item.tsx",children:(0,a.jsx)(p.Z,{px:4,py:3,rounded:"xl",shadow:"blue.md",transition:"all 0.2s",bg:l?"brand.50":"white",borderWidth:1,_dark:{shadow:"none",bg:l?"brand.900":"gray.800",borderColor:l?"brand.500":"whiteAlpha.200"},borderColor:l?"brand.500":"blackAlpha.100",_groupHover:o?{}:{bg:l?"brand.50":"gray.50",shadow:"blue.lg",_dark:{shadow:"none",bg:l?"brand.900":"gray.700"}},"data-sentry-element":"Card","data-sentry-source-file":"patient-item.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"patient-item.tsx",children:[(0,a.jsx)(g.Y,{isChecked:l,colorScheme:"brand",size:"lg","data-sentry-element":"Radio","data-sentry-source-file":"patient-item.tsx"}),(0,a.jsx)(f.q,{src:(null===(n=s.pet)||void 0===n?void 0:n.avatar_url)||"",name:s.name||"","data-sentry-element":"Avatar","data-sentry-source-file":"patient-item.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"patient-item.tsx",children:[(0,a.jsx)(_.x,{fontSize:"md",fontWeight:"semibold","data-sentry-element":"Text","data-sentry-source-file":"patient-item.tsx",children:s.name}),(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.500",noOfLines:1,w:"full","data-sentry-element":"Text","data-sentry-source-file":"patient-item.tsx",children:(null===(r=s.clinic_species)||void 0===r?void 0:r.species)+(s.breed?", ".concat(s.breed):"")})]})]})})})})}function tq(){return(0,a.jsx)(p.Z,{px:4,py:3,rounded:"xl",shadow:"blue.md",borderWidth:1,borderColor:"blackAlpha.100","data-sentry-element":"Card","data-sentry-component":"LoadingPatientItem","data-sentry-source-file":"patient-item.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"patient-item.tsx",children:[(0,a.jsx)(g.Y,{isChecked:!1,colorScheme:"brand",size:"lg","data-sentry-element":"Radio","data-sentry-source-file":"patient-item.tsx"}),(0,a.jsx)(tW.s,{boxSize:12,"data-sentry-element":"SkeletonCircle","data-sentry-source-file":"patient-item.tsx"}),(0,a.jsx)(tH.N,{noOfLines:2,lineHeight:4,w:"40%","data-sentry-element":"SkeletonText","data-sentry-source-file":"patient-item.tsx"})]})})}var tV=function(e){var t;let{client:n}=e,{BOOKING_COPY:r}=Q(),[s,l]=(0,i.useState)(!1),{isOpen:d,onToggle:u}=(0,o.q)(),{clinic:x,patient:f,setPatient:p,setPatientName:g,setIsNewPatient:_}=(0,E.Q)(),{setThenClearState:v}=(0,tb.I)(),I=v(p),{data:T,loading:b}=(0,N.PBg)({variables:{where:[{column:"owner",filterOp:N.JX8.Eq,value:{string:n.id}},{column:"is_deceased",filterOp:N.JX8.Is,value:{boolean:!1}}]},onCompleted:e=>{0===e.countPatients&&_(!0)}}),{data:S,loading:C}=(0,N.lon)({variables:{where:[{column:"owner",filterOp:N.JX8.Eq,value:{string:n.id}},{column:"is_deceased",filterOp:N.JX8.Is,value:{boolean:!1}}],page:0,pageSize:d?void 0:9,orderBy:{column:"name",isAscending:!0}}}),R=(null==T?void 0:T.countPatients)||0,w=(0,i.useMemo)(()=>null!==(t=null==S?void 0:S.queryPatients)&&void 0!==t?t:[],[S]),A=(0,i.useMemo)(()=>!f||d||w.some(e=>e.id===f.id)?w:[...w.slice(0,8),f],[w,d,f]);return C||b?(0,a.jsx)(h.M,{columns:{base:1,md:3},w:"full",gridGap:{base:4,md:6},children:[1,2,3].map(e=>(0,a.jsx)(tq,{},e))}):s||0===R?(0,a.jsxs)(c.g,{w:"full",spacing:8,children:[(0,a.jsx)(tG,{}),R>0&&(0,a.jsx)(P.z,{variant:"subtle",colorScheme:"red",onClick:()=>{g(""),l(!1)},children:j.u.CANCEL})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.g,{w:"full",spacing:8,"data-sentry-element":"VStack","data-sentry-source-file":"client-pets.tsx",children:[(0,a.jsx)(m.X,{size:"lg",fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"client-pets.tsx",children:r.PATIENT_INFORMATION_SECTION_TITLE}),(0,a.jsx)(h.M,{columns:{base:1,md:3},w:"full",gridGap:{base:4,md:6},"data-sentry-element":"SimpleGrid","data-sentry-source-file":"client-pets.tsx",children:A.map(e=>{var t,n,r,s;return(0,a.jsx)(tQ,{patient:e,setPatient:I,isSelected:(null==f?void 0:f.id)===e.id,isInvalid:null===(t=e.clinic_species)||void 0===t||!t.species||!(null==x?void 0:null===(n=x.settings)||void 0===n?void 0:null===(r=n.included_species)||void 0===r?void 0:r.includes(null===(s=e.clinic_species)||void 0===s?void 0:s.species))},e.id)})})]}),(0,a.jsxs)(y.U,{mt:6,"data-sentry-element":"HStack","data-sentry-source-file":"client-pets.tsx",children:[R>9&&!C&&(0,a.jsx)(P.z,{size:"sm",onClick:u,variant:"outline",colorScheme:"gray",bg:"white",_dark:{bg:"gray.800"},children:d?j.u.SHOW_LESS:j.u.SHOW_ALL}),(0,a.jsx)(P.z,{colorScheme:"accent",size:0===R?"lg":"sm",onClick:()=>{l(!0),p(void 0)},"data-sentry-element":"Button","data-sentry-source-file":"client-pets.tsx",children:j.u.ADD_A_NEW_PET})]})]})};function tX(){return(0,a.jsx)(p.Z,{px:4,py:3,rounded:"xl",shadow:"blue.md",borderWidth:1,borderColor:"blackAlpha.100","data-sentry-element":"Card","data-sentry-component":"LoadingPetItem","data-sentry-source-file":"pet-item.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"pet-item.tsx",children:[(0,a.jsx)(g.Y,{isChecked:!1,colorScheme:"brand",size:"lg","data-sentry-element":"Radio","data-sentry-source-file":"pet-item.tsx"}),(0,a.jsx)(tW.s,{boxSize:12,"data-sentry-element":"SkeletonCircle","data-sentry-source-file":"pet-item.tsx"}),(0,a.jsx)(tH.N,{noOfLines:2,lineHeight:4,w:"40%","data-sentry-element":"SkeletonText","data-sentry-source-file":"pet-item.tsx"})]})})}var tY=function(e){let{pet:t,setPet:n,isSelected:r,isInvalid:s}=e,{clinic:i}=(0,E.Q)();return(0,a.jsx)(ew.u,{isDisabled:!s,label:j.u.PATIENT_ITEM_SPECIES_NOT_TREATED((null==i?void 0:i.name)||"",(null==t?void 0:t.species)||""),closeOnClick:!1,"data-sentry-element":"Tooltip","data-sentry-component":"PetItem","data-sentry-source-file":"pet-item.tsx",children:(0,a.jsx)(d.xu,{role:"group",cursor:"pointer",onClick:()=>s?null:n(t),filter:s?"grayscale(100%)":"none",opacity:s?.8:1,"data-sentry-element":"Box","data-sentry-source-file":"pet-item.tsx",children:(0,a.jsx)(p.Z,{px:4,py:3,rounded:"xl",shadow:"blue.md",transition:"all 0.2s",bg:r?"brand.50":"white",borderWidth:1,borderColor:r?"brand.500":"blackAlpha.100",_groupHover:s?{}:{bg:r?"brand.50":"gray.50",shadow:"blue.lg"},"data-sentry-element":"Card","data-sentry-source-file":"pet-item.tsx",children:(0,a.jsxs)(y.U,{spacing:4,"data-sentry-element":"HStack","data-sentry-source-file":"pet-item.tsx",children:[(0,a.jsx)(g.Y,{isChecked:r,colorScheme:"brand",size:"lg","data-sentry-element":"Radio","data-sentry-source-file":"pet-item.tsx"}),(0,a.jsx)(f.q,{src:t.avatar_url||"",name:t.name||"","data-sentry-element":"Avatar","data-sentry-source-file":"pet-item.tsx"}),(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"pet-item.tsx",children:[(0,a.jsx)(_.x,{fontSize:"md",fontWeight:"semibold","data-sentry-element":"Text","data-sentry-source-file":"pet-item.tsx",children:t.name}),(0,a.jsx)(_.x,{fontSize:"sm",color:"gray.500","data-sentry-element":"Text","data-sentry-source-file":"pet-item.tsx",children:t.species+(t.breed?", ".concat(t.breed):"")})]})]})})})})},tJ=function(){let{userId:e}=(0,w.a)(),{BOOKING_COPY:t}=Q(),[n,r]=(0,i.useState)(!1),{isOpen:s,onToggle:l}=(0,o.q)(),{clinic:d,pet:u,setPet:x,setPatientName:f}=(0,E.Q)(),{setThenClearState:p}=(0,tb.I)(),g=p(x),{data:_,loading:v}=(0,N.zW)({variables:{userId:e||""},skip:!e}),{data:I,loading:T}=(0,N.bp1)({skip:!e,variables:{userId:e||"",page:0,pageSize:s?void 0:9}}),b=(null==_?void 0:_.countPetsByUserId)||0,S=(null==I?void 0:I.getPetsByUserId)||[],C=(0,i.useMemo)(()=>!u||s||S.some(e=>e.id===u.id)?S:[...S.slice(0,8),u],[S,s,u]);return n||0===b?(0,a.jsxs)(c.g,{w:"full",spacing:8,children:[(0,a.jsx)(tG,{}),b>0&&(0,a.jsx)(P.z,{variant:"subtle",colorScheme:"red",onClick:()=>{f(""),r(!1)},children:j.u.CANCEL})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.g,{w:"full",spacing:8,"data-sentry-element":"VStack","data-sentry-source-file":"user-pets.tsx",children:[(0,a.jsx)(m.X,{size:"lg",fontWeight:"semibold","data-sentry-element":"Heading","data-sentry-source-file":"user-pets.tsx",children:t.PATIENT_INFORMATION_SECTION_TITLE}),(0,a.jsx)(h.M,{columns:{base:1,md:3},w:"full",gridGap:{base:4,md:6},"data-sentry-element":"SimpleGrid","data-sentry-source-file":"user-pets.tsx",children:T?[1,2,3].map(e=>(0,a.jsx)(tX,{},e)):C.map(e=>{var t,n;return(0,a.jsx)(tY,{pet:e,setPet:g,isSelected:(null==u?void 0:u.id)===e.id,isInvalid:!e.species||!(null==d?void 0:null===(t=d.settings)||void 0===t?void 0:null===(n=t.included_species)||void 0===n?void 0:n.includes(e.species))},e.id)})})]}),(0,a.jsxs)(y.U,{mt:6,"data-sentry-element":"HStack","data-sentry-source-file":"user-pets.tsx",children:[b>9&&!T&&!v&&(0,a.jsx)(P.z,{size:"sm",onClick:l,variant:"outline",colorScheme:"gray",bg:"white",_dark:{bg:"gray.800"},children:s?j.u.SHOW_LESS:j.u.SHOW_ALL}),(0,a.jsx)(P.z,{colorScheme:"brand",size:0===b?"lg":"sm",onClick:()=>{r(!0),x(void 0)},"data-sentry-element":"Button","data-sentry-source-file":"user-pets.tsx",children:j.u.ADD_A_NEW_PET})]})]})},tK=function(){let{user:e}=(0,w.a)(),{client:t,procedure:n}=(0,E.Q)(),r=A(s.pet);return(0,a.jsx)(eR.M,{id:"pet",w:"full",py:8,flexDir:"column",...(0,u.A)(r),"data-sentry-element":"Center","data-sentry-component":"PetStep","data-sentry-source-file":"index.tsx",children:t?(0,a.jsx)(tV,{client:t}):e?(0,a.jsx)(tJ,{}):[N.FYq.EnterAllInformation,N.FYq.Legacy].includes(n)?(0,a.jsx)(tG,{}):null})};function t$(){let{clinic:e}=(0,E.Q)();return(0,a.jsxs)(em,{p:6,"data-sentry-element":"BrandOutlineBox","data-sentry-component":"NoNewClientsMessage","data-sentry-source-file":"no-new-clients-message.tsx",children:[(0,a.jsx)(m.X,{size:"md",color:"brand.600",mb:3,"data-sentry-element":"Heading","data-sentry-source-file":"no-new-clients-message.tsx",children:j.u.NEW_CLIENT_BOOKING_DISABLED_TITLE}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",mb:3,"data-sentry-element":"Box","data-sentry-source-file":"no-new-clients-message.tsx"}),(0,a.jsx)(_.x,{fontSize:"14px",color:"gray.600","data-sentry-element":"Text","data-sentry-source-file":"no-new-clients-message.tsx",children:j.u.NEW_CLIENT_BOOKING_DISABLED_DESCRIPTION((null==e?void 0:e.name)||"",null==e?void 0:e.phone)})]})}function t0(){let{clinic:e}=(0,E.Q)();return(0,a.jsxs)(em,{p:6,"data-sentry-element":"BrandOutlineBox","data-sentry-component":"NoNewPatientsMessage","data-sentry-source-file":"no-new-patients-message.tsx",children:[(0,a.jsx)(m.X,{size:"md",color:"brand.600",mb:3,"data-sentry-element":"Heading","data-sentry-source-file":"no-new-patients-message.tsx",children:j.u.NEW_PATIENT_BOOKING_DISABLED_TITLE}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",mb:3,"data-sentry-element":"Box","data-sentry-source-file":"no-new-patients-message.tsx"}),(0,a.jsx)(_.x,{fontSize:"14px",color:"gray.600","data-sentry-element":"Text","data-sentry-source-file":"no-new-patients-message.tsx",children:j.u.NEW_PATIENT_BOOKING_DISABLED_DESCRIPTION((null==e?void 0:e.name)||"",null==e?void 0:e.phone)})]})}var t1=n(43985);function t5(){let{clinic:e}=(0,E.Q)();return(0,a.jsxs)(em,{p:6,"data-sentry-element":"BrandOutlineBox","data-sentry-component":"NoReturningPatientsMessage","data-sentry-source-file":"no-returning-patients-message.tsx",children:[(0,a.jsx)(m.X,{size:"md",color:"brand.600",mb:3,"data-sentry-element":"Heading","data-sentry-source-file":"no-returning-patients-message.tsx",children:j.u.RETURNING_PATIENT_BOOKING_DISABLED_TITLE}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",mb:3,"data-sentry-element":"Box","data-sentry-source-file":"no-returning-patients-message.tsx"}),(0,a.jsx)(_.x,{fontSize:"14px",color:"gray.600","data-sentry-element":"Text","data-sentry-source-file":"no-returning-patients-message.tsx",children:j.u.RETURNING_PATIENT_BOOKING_DISABLED_DESCRIPTION((null==e?void 0:e.name)||"",null==e?void 0:e.phone)})]})}function t2(){let{clinic:e}=(0,E.Q)();return(0,a.jsxs)(em,{p:6,"data-sentry-element":"BrandOutlineBox","data-sentry-component":"NoReturningClientsMessage","data-sentry-source-file":"no-returning-clients-message.tsx",children:[(0,a.jsx)(m.X,{size:"md",color:"brand.600",mb:3,"data-sentry-element":"Heading","data-sentry-source-file":"no-returning-clients-message.tsx",children:j.u.RETURNING_CLIENT_BOOKING_DISABLED_TITLE}),(0,a.jsx)(d.xu,{h:"1px",w:"50px",bg:"brand.500",mb:3,"data-sentry-element":"Box","data-sentry-source-file":"no-returning-clients-message.tsx"}),(0,a.jsx)(_.x,{fontSize:"14px",color:"gray.600","data-sentry-element":"Text","data-sentry-source-file":"no-returning-clients-message.tsx",children:j.u.RETURNING_CLIENT_BOOKING_DISABLED_DESCRIPTION((null==e?void 0:e.name)||"",null==e?void 0:e.phone)})]})}function t4(){let{setSelectedClientPatient:e,isNewPatient:t,isNewClient:n,procedure:r,setHasClientMatched:s,client:i,patient:l,setPatient:o,setIsNewPatient:c,bookingSettings:u}=(0,E.Q)(),{selectedResult:x,setSelectedResult:m,error:y,checkClient:f,loading:h,potentialMatches:p}=(0,tb.I)(),{validClient:g,validPatient:_}=O(),v=(null==u?void 0:u.should_allow_new_clients)===!1&&!0===n,I=(null==u?void 0:u.should_allow_returning_clients)===!1&&!1===n,T=(null==u?void 0:u.should_allow_new_patients)===!1&&!0===t,b=(null==u?void 0:u.should_allow_returning_patients)===!1&&!1===t,S=[N.FYq.EnterAllInformation,N.FYq.Legacy].includes(r);return(0,a.jsxs)(eI.Z,{"data-sentry-element":"SharedStack","data-sentry-component":"ClientPatientSection","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(tS,{"data-sentry-element":"ReturningStatusStep","data-sentry-source-file":"index.tsx"}),T&&(0,a.jsx)(t0,{}),v&&(0,a.jsx)(t$,{}),b?(0,a.jsx)(t5,{}):I?(0,a.jsx)(t2,{}):null,!T&&!v&&!b&&!I&&(0,a.jsxs)(eI.Z,{align:"center",children:[(0,a.jsx)(tF,{}),(0,a.jsx)(tK,{}),y&&(0,a.jsx)(d.xu,{children:(0,a.jsx)(tz.Z,{mt:-6,mb:2,w:"full",textAlign:"center",children:y})}),!!p.length&&(0,a.jsxs)(eI.Z,{pb:8,children:[(0,a.jsx)(t1.Z,{numMatches:p.length}),p.map(e=>(0,a.jsx)(tB.Z,{searchResult:e,onClick:()=>m(e),isSelected:(null==x?void 0:x.client_id)===e.client_id&&(null==x?void 0:x.patient_id)===e.patient_id,cursor:"pointer"},"".concat(e.client_id,"-").concat(e.patient_id)))]}),S&&(0,a.jsx)(P.z,{colorScheme:"accent",isLoading:h,isDisabled:!g||!_||!!p.length&&!x,onClick:()=>(function(){if(r===N.FYq.Legacy){s(!0);return}if(i&&l){o(l),s(!0);return}if(x){e(x),s(!0);return}if(i&&(void 0===t||!0===t)){c(!0),s(!0);return}f()})(),children:j.u.CONTINUE})]})]})}var t3=n(73034);function t6(e){let{requiredQuestions:t,question:n}=e,{client:r}=(0,t3.y)(),{clinic:s,patientName:i,patientFixed:l,setPatientFixed:d,patientGender:o,setPatientGender:c,isNewClient:u,setIsNewClient:x,isNewPatient:m}=(0,E.Q)();return n!==N.Jtw.ClientReturningStatus||r?n===N.Jtw.PatientFixedStatus&&t.includes(N.Jtw.PatientFixedStatus)&&!m?(0,a.jsx)(tR.Z,{label:j.u.REQUIRED_QUESTION_PATIENT_FIXED_STATUS(i||"your pet"),isRequired:!0,children:(0,a.jsx)(T.GZ,{value:l||"",onChange:e=>{d(e)},options:[{value:N.sXh.Unknown,label:j.u.NOT_SURE},{value:N.sXh.Fixed,label:j.u.YES},{value:N.sXh.Intact,label:j.u.NO}],buttonOverrides:{w:"100%"}})}):n===N.Jtw.PatientGender&&t.includes(N.Jtw.PatientGender)&&!m?(0,a.jsx)(tR.Z,{label:j.u.REQUIRED_QUESTION_PATIENT_GENDER(i||"your pet"),isRequired:!0,children:(0,a.jsx)(T.GZ,{value:o||"",onChange:e=>c(e),options:Object.values(N.NQQ).map(e=>({value:e,label:e})),buttonOverrides:{w:"100%"}})}):(0,a.jsx)("div",{"data-sentry-component":"RequiredQuestion","data-sentry-source-file":"required-question.tsx"}):(0,a.jsx)(tR.Z,{label:j.u.REQUIRED_QUESTION_RETURNING_CLIENT((null==s?void 0:s.name)||""),isRequired:!0,children:(0,a.jsx)(T.GZ,{value:void 0===u?"":u?"No":"Yes",onChange:e=>x("No"===e),placeholder:j.u.SELECT_GENERIC_PLACEHOLDER,options:[{value:"Yes",label:j.u.YES},{value:"No",label:j.u.NO}],buttonOverrides:{w:"100%"}})})}function t8(){let{requiredBookingQuestions:e}=(0,E.Q)(),t=A(s.requiredBookingQuestions);return(null==e?void 0:e.length)?(0,a.jsx)(d.xu,{py:8,...(0,u.A)(t),"data-sentry-element":"Box","data-sentry-component":"RequiredBookingQuestionsStep","data-sentry-source-file":"index.tsx",children:(0,a.jsxs)(c.g,{w:"full",spacing:8,"data-sentry-element":"VStack","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},fontWeight:"semibold",textAlign:"center","data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.REQUIRED_QUESTIONS_SECTION_TITLE}),e.map(t=>(0,a.jsx)(t6,{requiredQuestions:e,question:t},t))]})}):(0,a.jsx)(d.xu,{})}var t7=n(29895),t9=n(85970),ne=n(5418),nt=n(26105),nn=n(51607),nr=n(79078),ns=n(58877),na=n.n(ns);function ni(e){let{value:t,onSignatureSave:n,allowEditing:r=!0}=e,s=(0,i.useRef)(null),l=(0,i.useRef)(null),[d,o]=(0,i.useState)({width:500,height:200});return(0,i.useEffect)(()=>{let e=()=>{if(l.current){let{width:e,height:t}=l.current.getBoundingClientRect();o({width:e,height:t})}};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,i.useEffect)(()=>{s.current&&t&&s.current.fromDataURL(t)},[]),(0,a.jsxs)(eI.Z,{"data-sentry-element":"SharedStack","data-sentry-component":"SignatureInput","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)("div",{ref:l,style:{width:"100%",height:"200px"},children:(0,a.jsx)(na(),{penColor:"black",canvasProps:{width:d.width,height:d.height,className:"signature-canvas",style:{pointerEvents:r?"auto":"none"}},ref:s,"data-sentry-element":"SignatureCanvas","data-sentry-source-file":"index.tsx"})}),r&&(0,a.jsxs)(eI.Z,{row:!0,children:[n&&(0,a.jsx)(P.z,{colorScheme:"brand",size:"sm",onClick:()=>{if(s.current){let e=s.current.getTrimmedCanvas().toDataURL("image/png");n&&n(e)}},children:"Save Signature"}),(0,a.jsx)(P.z,{variant:"outline",size:"sm",onClick:()=>{var e;null===(e=s.current)||void 0===e||e.clear()},children:"Clear"})]})]})}let nl=function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{},i=!!r[e.id];switch(e.type){case N.gMU.Header:return(0,a.jsx)(m.X,{size:"md",pt:6,children:e.content},e.id);case N.gMU.Subtitle:return(0,a.jsx)(_.x,{children:e.content},e.id);case N.gMU.ShortAnswer:return(0,a.jsxs)(t9.NI,{display:"flex",flexDir:"column",flex:1,minW:0,isRequired:!!e.is_required,isInvalid:i,children:[(0,a.jsx)(ne.l,{children:e.content}),(0,a.jsx)(H.I,{value:e.value||"",onChange:t=>s(e.id,t.target.value),width:"auto"}),(0,a.jsx)(nt.J1,{children:r[e.id]})]},e.id);case N.gMU.ParagraphAnswer:return(0,a.jsxs)(t9.NI,{isRequired:!!e.is_required,isInvalid:i,children:[(0,a.jsx)(ne.l,{children:e.content}),(0,a.jsx)(B.g,{borderColor:"gray.200",focusBorderColor:"brand.500",value:e.value||"",onChange:t=>s(e.id,t.target.value)}),(0,a.jsx)(nt.J1,{children:r[e.id]})]},e.id);case N.gMU.Checkbox:return(0,a.jsxs)(t9.NI,{isRequired:!!e.is_required,isInvalid:i,children:[(0,a.jsx)(ex.X,{isChecked:"true"===e.value,onChange:t=>s(e.id,t.target.checked?"true":""),display:"flex",alignItems:"center",borderColor:"gray.200",colorScheme:"brand",children:(0,a.jsx)(ne.l,{mb:0,children:e.content})}),(0,a.jsx)(nt.J1,{children:r[e.id]})]},e.id);case N.gMU.SelectOne:return(0,a.jsxs)(t9.NI,{isRequired:!!e.is_required,isInvalid:i,children:[(0,a.jsx)(ne.l,{children:e.content}),(0,a.jsx)(nn.E,{value:e.value||"",onChange:t=>s(e.id,t),children:(0,a.jsx)(nr.r,{gridTemplateColumns:"repeat(2, 1fr)",gridGap:2,children:null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,a.jsx)(g.Y,{value:e,borderColor:"gray.200",colorScheme:"brand",children:e},e))})}),(0,a.jsx)(nt.J1,{children:r[e.id]})]},e.id);case N.gMU.SelectMultiple:return(0,a.jsxs)(t9.NI,{isRequired:!!e.is_required,isInvalid:i,children:[(0,a.jsx)(ne.l,{children:e.content}),(0,a.jsx)(nr.r,{gridTemplateColumns:"repeat(2, 1fr)",gridGap:2,children:null===(n=e.options)||void 0===n?void 0:n.map(t=>(0,a.jsx)(ex.X,{value:t,isChecked:e.value&&JSON.parse(e.value).includes(t),borderColor:"gray.200",colorScheme:"brand",onChange:()=>{let n=JSON.parse(e.value||"[]");if(Array.isArray(n)){let r=n.includes(t)?n.filter(e=>e!==t):[...n,t];s(e.id,JSON.stringify(r))}else{let n=[t];s(e.id,JSON.stringify(n))}},children:t},t))})]},e.id);case N.gMU.Signature:return(0,a.jsxs)(t9.NI,{isRequired:!!e.is_required,isInvalid:i,children:[(0,a.jsx)(ne.l,{children:e.content}),(0,a.jsx)(ni,{value:e.value||void 0,onSignatureSave:t=>s(e.id,t||"")}),(0,a.jsx)(nt.J1,{children:r[e.id]})]},e.id);default:return null}};function nd(e){let{formData:t,setFormData:n,onSubmit:r,errors:s,setErrors:i}=e,l=(e,t,n)=>e?e.map(e=>e.id===t?{...e,value:n}:e):[];return(0,a.jsxs)(eI.Z,{spacing:6,"data-sentry-element":"SharedStack","data-sentry-component":"FormFillEdit","data-sentry-source-file":"form-fill-edit.tsx",children:[(0,a.jsx)(no,{elements:t,errors:s,updateFormData:(e,r)=>{n(t?l(t,e,r):[]),(null==s?void 0:s[e])&&i&&i(t=>{let n={...t};return delete n[e],n})},"data-sentry-element":"EditFormElements","data-sentry-source-file":"form-fill-edit.tsx"}),r&&(0,a.jsx)(P.z,{mt:4,colorScheme:"blue",type:"submit",children:"Submit"})]})}function no(e){let{elements:t,errors:n,updateFormData:r}=e,s=(0,I.Y4)(t.map(e=>e.column_order).filter(Boolean)).sort((e,t)=>e-t);return(0,a.jsx)(eI.Z,{spacing:6,"data-sentry-element":"SharedStack","data-sentry-component":"EditFormElements","data-sentry-source-file":"form-fill-edit.tsx",children:s.map(e=>{let s=t.filter(t=>t.column_order===e);return(0,a.jsx)(eI.Z,{row:!0,h:"100%",alignItems:"stretch",children:s.map(e=>(0,a.jsx)(a.Fragment,{children:nl(e,n,r)}))},e)})})}function nc(e){var t;let{form:n}=e,[r,s]=(0,i.useState)({}),{clientInputs:l,setClientInputs:d}=(0,E.Q)(),o=e=>{d(l?{...l,[n.id]:{...l[n.id],form_data:{...l[n.id].form_data,fields:e}}}:{})};return l&&l[n.id]?(0,a.jsx)(nd,{form:n,formData:(null===(t=l[n.id].form_data)||void 0===t?void 0:t.fields)||[],setFormData:e=>o(e),errors:r,setErrors:s,"data-sentry-element":"FormFillEdit","data-sentry-component":"FormFillEditForm","data-sentry-source-file":"index.tsx"}):null}N.gMU.Form,N.gMU.Row,N.gMU.Column,N.gMU.Header,N.gMU.Subtitle,N.gMU.ShortAnswer,N.gMU.ParagraphAnswer,N.gMU.Checkbox,N.gMU.SelectOne,N.gMU.SelectMultiple,N.gMU.Signature;var nu=n(66656),nx=n(14905);function nm(e){let{form:t,isOpen:n,onClose:r}=e,{top:s,bottom:i}=(0,nx.Z)();return(0,a.jsx)(nu.Z,{title:"Fill out ".concat(t.name),showCloseButton:!0,size:{base:"full",md:"4xl"},scrollBehavior:"inside",isOpen:n,onClose:r,onConfirm:r,confirmText:"Save",headerOverrides:t7.dV.isNativePlatform()?{pt:s}:{},footerOverrides:t7.dV.isNativePlatform()?{pb:i}:{},"data-sentry-element":"SharedModal","data-sentry-component":"FormFillEditModal","data-sentry-source-file":"form-modal.tsx",children:(0,a.jsx)(nc,{form:t,"data-sentry-element":"FormFillEditForm","data-sentry-source-file":"form-modal.tsx"})})}function ny(e){var t,n,r,s,i,c;let{form:u}=e,{isOpen:x,onClose:m,onOpen:y}=(0,o.q)(),{clientInputs:f}=(0,E.Q)(),h=null===(t=u.form_fields)||void 0===t?void 0:null===(n=t.fields)||void 0===n?void 0:n.filter(e=>e.is_required),p=!!f&&(null===(r=f[u.id])||void 0===r?void 0:null===(s=r.form_data)||void 0===s?void 0:null===(i=s.fields)||void 0===i?void 0:i.every(e=>null==e||!e.is_required||!!e.value));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e5.Z,{py:3,px:6,bg:"gray.50",shadow:"none",w:"full",_hover:{bg:"gray.100"},cursor:"pointer",onClick:y,"data-sentry-element":"OutlineBox","data-sentry-source-file":"form-item.tsx",children:(0,a.jsxs)(l.k,{w:"full",justifyContent:"space-between",alignItems:"center","data-sentry-element":"Flex","data-sentry-source-file":"form-item.tsx",children:[(0,a.jsxs)(d.xu,{"data-sentry-element":"Box","data-sentry-source-file":"form-item.tsx",children:[(0,a.jsx)(tM.Z,{color:"gray.900",_dark:{color:"gray.100"},"data-sentry-element":"SharedSubheader","data-sentry-source-file":"form-item.tsx",children:u.name}),!!h&&(0,a.jsx)(eE.Z,{children:h.length>0?"Takes ".concat((c=h.length,"~".concat(Math.floor(16*c/60)," min"))," to complete"):"(Optional)"})]}),(0,a.jsx)(el.J,{fontSize:"xl",as:p?ea.ETl:ea.gbA,color:p?"green.500":"gray.200",_dark:{color:p?"green.300":"gray.700"},"data-sentry-element":"Icon","data-sentry-source-file":"form-item.tsx"})]})}),(0,a.jsx)(nm,{form:u,isOpen:x,onClose:m,"data-sentry-element":"FormFillEditModal","data-sentry-source-file":"form-item.tsx"})]})}function nf(e){let{forms:t}=e;return(0,a.jsxs)(eI.Z,{spacing:8,"data-sentry-element":"SharedStack","data-sentry-component":"FormsList","data-sentry-source-file":"index.tsx",children:[(0,a.jsx)(m.X,{size:{base:"md",md:"lg"},fontWeight:"semibold",textAlign:{base:"center",md:"left"},"data-sentry-element":"Heading","data-sentry-source-file":"index.tsx",children:j.u.FORMS_REQUIRED_TITLE}),(0,a.jsx)(eI.Z,{spacing:4,"data-sentry-element":"SharedStack","data-sentry-source-file":"index.tsx",children:t.map(e=>(0,a.jsx)(ny,{form:e},e.id))})]})}function nh(){var e,t;let{service:n,setClientInputs:r}=(0,E.Q)(),l=A(s.forms),o=null!==(t=null==n?void 0:null===(e=n.services_forms)||void 0===e?void 0:e.filter(e=>e.is_required_before_booking).map(e=>e.form))&&void 0!==t?t:[];return(0,i.useEffect)(()=>{r(o.reduce((e,t)=>({...e,[t.id]:{form:t.id,form_data:t.form_fields}}),{}))},[n]),(0,a.jsx)(d.xu,{...(0,u.A)(l),"data-sentry-element":"Box","data-sentry-component":"FormsStep","data-sentry-source-file":"index.tsx",children:1===o.length?(0,a.jsx)(nc,{form:o[0]}):(0,a.jsx)(nf,{forms:o})})}var np=function(e){var t,n,r;let{clinic:s,showBackButton:c}=e,{user:u}=(0,w.a)(),{appointment:x,showServiceTypeStep:m,isUsingDetailedServices:y,hasServices:f,errorOnCreate:h,createLoading:p,clinicBreed:g,patientId:_,clientId:v,isNewClient:I,clientAddress:T,service:b,hasClientMatched:S}=(0,E.Q)(),C=(null===(t=s.features)||void 0===t?void 0:t.portal_enabled)||!1,[R,A]=(0,i.useState)(!1),[O,P]=(0,i.useState)(!1),{isOpen:L,onOpen:D,onClose:B}=(0,o.q)(),M=((null==s?void 0:null===(n=s.settings)||void 0===n?void 0:n.urgency_type)||N._FB.GeneralPractice)!==N._FB.GeneralPractice;return(0,a.jsxs)(a.Fragment,{children:[!(!u&&x)&&(0,a.jsxs)(l.k,{flexDirection:{base:"column",md:"row"},justifyContent:"space-between",mb:{base:0,md:4},children:[(0,a.jsx)(d.xu,{flex:1,children:R||O?(0,a.jsx)(e4.Z,{backOverride:()=>R?A(!1):P(!1)}):(c||t7.dV.isNativePlatform())&&(0,a.jsx)(e4.Z,{})}),(0,a.jsx)(l.k,{flex:1,my:{base:0,md:0},justifyContent:{base:"center",md:"flex-end"},alignItems:"center",children:!u&&!R&&!O&&!x&&!h&&C&&(0,a.jsx)(tl.Z,{children:j.u.LOG_IN_TO_BOOK_FASTER})})]}),p?(0,a.jsx)(eW,{}):x?(0,a.jsx)(ti,{appointment:x,clinic:s}):h?(0,a.jsx)(U,{}):R?(0,a.jsx)(eC,{}):O?(0,a.jsx)(eu,{onPay:()=>A(!0)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(te,{clinic:s}),S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e2,{}),(0,a.jsx)(t8,{}),y&&f&&(0,a.jsx)(eF,{}),!M&&(0,a.jsx)(k,{}),(null==b?void 0:b.more_info_action_required)&&(0,a.jsx)(ey,{}),(null==b?void 0:b.services_forms)&&(null==b?void 0:null===(r=b.services_forms)||void 0===r?void 0:r.length)>0&&(0,a.jsx)(nh,{}),(0,a.jsx)(e$,{onReview:()=>{var e;let t=!_&&s.pms!==N.taI.AvImark&&!g,n=!v&&I&&!T&&(null===(e=s.settings)||void 0===e?void 0:e.does_require_new_client_address);t||n?D():P(!0)}})]}):(0,a.jsxs)(a.Fragment,{children:[M&&(0,a.jsx)(k,{}),m&&!M&&(0,a.jsx)(eY,{}),(0,a.jsx)(t4,{})]})]}),(0,a.jsx)(tj,{isOpen:L,onClose:B,onConfirm:()=>{B(),P(!0)},"data-sentry-element":"RequiredInfoModal","data-sentry-source-file":"index.tsx"})]})}},65775:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(85893),s=n(71293);function a(e){let{children:t,...n}=e;return(0,r.jsx)(s.x,{fontSize:"14px",color:"red.600",...n,"data-sentry-element":"Text","data-sentry-component":"ErrorText","data-sentry-source-file":"error-text.tsx",children:t})}n(67294)},3877:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(85893),s=n(71293);function a(e){let{children:t,...n}=e;return(0,r.jsx)(s.x,{color:"gray.500",fontSize:"16px",fontWeight:"semibold",_dark:{color:"gray.300"},...n,"data-sentry-element":"Text","data-sentry-component":"SharedSubheader","data-sentry-source-file":"shared-subheader.tsx",children:t})}n(67294)},74279:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(85893),s=n(57747);function a(e){let{children:t,...n}=e;return(0,r.jsx)(s.xu,{border:"1px solid",borderColor:"gray.200",borderRadius:"xl",px:4,py:2,boxShadow:"blue.lg",overflow:"hidden",bg:"white",_dark:{bg:"gray.800",shadow:"none",borderColor:"whiteAlpha.200"},...n,"data-sentry-element":"Box","data-sentry-component":"OutlineBox","data-sentry-source-file":"outline-box.tsx",children:t})}},25996:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(85893),s=n(23219);function a(e){let{isSelected:t,children:n,...a}=e;return(0,r.jsx)(s.Z,{bg:t?"brand.50":"white",borderWidth:1,borderColor:t?"brand.500":"blackAlpha.100",_dark:{bg:t?"brand.900":"gray.800",shadow:"none"},rounded:"xl",shadow:"blue.lg",_groupHover:{shadow:"blue.xl",transform:"translateY(-2px)",_dark:{shadow:"none"}},w:"full",transition:"all 0.2s",...a,"data-sentry-element":"Card","data-sentry-component":"SelectableCard","data-sentry-source-file":"selectable-card.tsx",children:n})}n(67294)},63965:function(e,t,n){n.d(t,{I:function(){return o},q:function(){return d}});var r=n(85893),s=n(67294),a=n(21516),i=n(99398);let l=(0,s.createContext)({});function d(e){let{children:t}=e;return(0,r.jsx)(l.Provider,{value:{...function(){let[e,t]=(0,s.useState)(void 0),{error:n,checkClient:r,loading:l,potentialMatches:d,setThenClearState:o}=function(e){let{clinic:t,client:n,isNewPatient:r,isNewClient:l,clientFirstName:d,clientLastName:o,clientEmail:c,clientPhone:u,patientName:x,setHasClientMatched:m}=(0,i.Q)(),[y,{loading:f}]=(0,a.xNf)(),[h,p]=(0,s.useState)(""),[g,_]=(0,s.useState)([]);return{error:h,checkClient:()=>{if(p(""),_([]),!n&&l){m(!0);return}y({variables:{clinicId:t.id,input:{email:null!=c?c:"",first_name:null!=d?d:"",last_name:null!=o?o:"",phone:null!=u?u:"",patient_name:null!=x?x:""},isNewPatient:r},onCompleted:t=>{if(!t.checkMaybeClient.length){p("The information you have entered does not match our records. Please try again.");return}_(t.checkMaybeClient),1===t.checkMaybeClient.length&&e(t.checkMaybeClient[0])},onError:e=>p(e.message)})},loading:f,potentialMatches:g,setThenClearState:function(t){return n=>{t(n),e(void 0),p(""),_([])}}}}(t);return{selectedResult:e,setSelectedResult:t,checkClient:r,error:n,loading:l,potentialMatches:d,setThenClearState:o}}()},"data-sentry-element":"unknown","data-sentry-component":"ClientMatchProvider","data-sentry-source-file":"client-match-provider.tsx",children:t})}function o(){return(0,s.useContext)(l)}},7414:function(e,t,n){n.d(t,{N:function(){return s}});var r=n(67294);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,[n,s]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let n=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}}}]);