@everfur/sdk 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/{Chat-my5aJLz5.d.ts → Chat-CNRZEu92.d.ts} +3 -3
- package/dist/{Chat-B43wIXCv.d.cts → Chat-a6If51cF.d.cts} +3 -3
- package/dist/{DepthViews-G-7YRtOX.d.ts → DepthViews-Bfv2DTUl.d.ts} +1 -1
- package/dist/{DepthViews-BLK0kgza.d.cts → DepthViews-Cl4AoL3X.d.cts} +1 -1
- package/dist/{DepthViews-BBTv9VAs.d.cts → DepthViews-kURiusNd.d.cts} +1 -1
- package/dist/{DepthViews-CNqAyjne.d.ts → DepthViews-zhn3Rk5Z.d.ts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{attachments-CMNWE6YT.d.ts → attachments-5_p7kE38.d.ts} +2 -2
- package/dist/{attachments-CEmT52IA.d.cts → attachments-CHgc11hT.d.cts} +5 -5
- package/dist/{attachments-DU1djTNd.d.ts → attachments-TXOhN36S.d.ts} +5 -5
- package/dist/{attachments-ZyjWsZdI.d.cts → attachments-affGN_Uv.d.cts} +2 -2
- package/dist/{bookingCopy-BVhEt1bj.d.ts → bookingCopy-BQ7Pg7qg.d.ts} +2 -2
- package/dist/{bookingCopy-ChZR5mtd.d.cts → bookingCopy-BpZvZO1S.d.cts} +2 -2
- package/dist/{casesRepository-C5zrCcaE.d.ts → casesRepository-YCI0OVwl.d.ts} +1 -1
- package/dist/{casesRepository-q2ak9AW0.d.cts → casesRepository-z2JAFlKA.d.cts} +1 -1
- package/dist/chat/index.d.cts +9 -9
- package/dist/chat/index.d.ts +9 -9
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +1 -1
- package/dist/{config-DBpKJJbg.d.ts → config-BXVgTLCh.d.ts} +1 -1
- package/dist/{config-jocy3q66.d.cts → config-Bkbqkjb0.d.cts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context-C3n9s4aG.d.ts → context-BVpOBDMe.d.ts} +5 -5
- package/dist/{context-BfVBRgro.d.cts → context-ChPrlKhy.d.cts} +5 -5
- package/dist/{copy-IysFx8yL.d.cts → copy-Be2H2i-D.d.cts} +2 -2
- package/dist/{copy-KP91zgtW.d.ts → copy-SxmZ-Eps.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +12 -12
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.js +1 -1
- package/dist/{depth-BsMLLrQo.d.ts → depth-By8dFpLA.d.ts} +2 -2
- package/dist/{depth-O9kiVUjs.d.cts → depth-Dne8Qoss.d.cts} +2 -2
- package/dist/{entitlementRepository-CHsY2kF3.d.ts → entitlementRepository-Big-K_In.d.ts} +2 -2
- package/dist/{entitlementRepository-DIG16pso.d.cts → entitlementRepository-BmghvtGT.d.cts} +2 -2
- package/dist/{identity-k8nCQ_qM.d.ts → identity-AuoeDRTh.d.ts} +1 -1
- package/dist/{identity-D7GKfOE7.d.cts → identity-Z0yj-fC_.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +1 -1
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/{pets-Bod_DDiW.d.cts → pets-DfXGYmMk.d.cts} +1 -1
- package/dist/{pets-C_QX8s5f.d.ts → pets-FD-5nMXr.d.ts} +1 -1
- package/dist/{petsRepository-DdzgINfF.d.ts → petsRepository-BaTOwJ5L.d.ts} +1 -1
- package/dist/{petsRepository-B3vr628I.d.cts → petsRepository-CsvreWlY.d.cts} +1 -1
- package/dist/{ports-DHhxhn95.d.ts → ports-DNIvfzBP.d.ts} +4 -4
- package/dist/{ports-BSm48zIC.d.cts → ports-Dof7AQjk.d.cts} +4 -4
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/{requestFunnel-CTG-wNc3.d.ts → requestFunnel-CJC_q4BZ.d.ts} +2 -2
- package/dist/{requestFunnel-Dcjyh0j2.d.cts → requestFunnel-DrigK6q_.d.cts} +2 -2
- package/dist/{runtimeTypes-CmpdQaE2.d.ts → runtimeTypes-BiqMY6pC.d.ts} +4 -4
- package/dist/{runtimeTypes-4qptUulD.d.cts → runtimeTypes-Doj95Gll.d.cts} +4 -4
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/{timelineRows-Dp4ZSnAo.d.ts → timelineRows-BHA0gIKH.d.ts} +1 -1
- package/dist/{timelineRows-BkLhRUDt.d.cts → timelineRows-CHeqZRpM.d.cts} +1 -1
- package/dist/{useRecordsDepth-DnDhTaUL.d.ts → useRecordsDepth-CG63cXFZ.d.ts} +1 -1
- package/dist/{useRecordsDepth-DRNry1r9.d.cts → useRecordsDepth-ChhS4c6r.d.cts} +1 -1
- package/dist/{view-D4VdPKCa.d.cts → view-2pXv8ex7.d.cts} +2 -2
- package/dist/{view-CwuOPIJc.d.ts → view-BKy44Q-3.d.ts} +2 -2
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/index.cjs +1 -1
- package/dist/web/index.d.cts +14 -14
- package/dist/web/index.d.ts +14 -14
- package/dist/web/index.js +1 -1
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/index.d.cts +9 -9
- package/dist/web/records/index.d.ts +9 -9
- package/dist/web/televet/booking/index.cjs +2 -2
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var cs=Object.defineProperty;var o=(e,t)=>cs(e,"name",{value:t,configurable:true});function er(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(er,"assertNever");function ni(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(ni,"errorFrame");function Gr(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(Gr,"reportHostFailure");function ys(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(ys,"isThenable");function tr(e,...t){if(typeof e=="function")try{let r=e(...t);return ys(r)&&Promise.resolve(r).then(void 0,Gr),r}catch(r){Gr(r);return}}o(tr,"callHost");var oi=new WeakMap;function ms(e){if(typeof e!="function")return;let t=oi.get(e);if(t!==void 0)return t;let r=o((...n)=>{tr(e,...n);},"guarded");return oi.set(e,r),r}o(ms,"guardHost");function st(e,t){let r=null;for(let n of t){let l=e[n];typeof l=="function"&&(r??={...e},r[n]=ms(l));}return r??e}o(st,"guardHostProps");function rr(e,...t){let r;try{r=e(...t);}catch(n){return Gr(n),Promise.resolve({ok:false,error:n})}return Promise.resolve(r).then(n=>({ok:true,value:n}),n=>({ok:false,error:n}))}o(rr,"callHostAsync");var g=o(e=>e,"DRAFT"),gs=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function vs(e){return gs.some(t=>e.toUpperCase().includes(t.toUpperCase()))}o(vs,"isPlaceholderCopy");function Y(e,t){let r=e;for(let[n,l]of Object.entries(t))r=r.split(`{${n}}`).join(l);return r}o(Y,"fill");var ie=Object.freeze({stateBlockedTitle:g("Not available in this state yet"),noCliniciansTitle:g("No vets available right now"),noCliniciansBody:g("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:g("Check again"),noCliniciansRegionBody:g("Video visits have to be with a vet licensed in your state, and we don\u2019t have one there yet."),yourVetTitle:g("Your Vet"),reviewsLabel:g("reviews"),rescheduleFromTemplate:g("Moving your visit on {when}"),rescheduleFailed:g("That did not move. Your original time is unchanged."),keepExistingCta:g("Keep my current time"),bookingPausedTitle:g("Booking is not available right now."),slotsErrorTitle:g("Could not load times"),noSlotsTitle:g("No times available"),nextOpeningTemplate:g("Next opening across our vets: {when}"),seeOtherVetsCta:g("See other vets"),retryCta:g("Try again"),holdExpired:g("That time is no longer held. Pick another."),slotTaken:g("That time was just taken. Pick another."),reasonPlaceholder:g("What is going on with your pet?"),reasonTooLong:g("That is too long. Please shorten it."),shareRecordsOff:g("Share health records with this vet"),confirmNotEntitled:g("A Pro membership is needed to book a video visit."),confirmFailed:g("That did not book. Try again."),checkAvailabilityCta:g("Check availability"),stateInterest:Object.freeze({cta:g("Add me to the list"),submitting:g("Adding you to the list\u2026"),joinedTitle:g("You are on the list"),joinedBody:g("We will let you know when this changes."),failed:g("That did not save. Try again.")}),media:Object.freeze({droppedTemplate:g("{n} attachment did not upload."),droppedPluralTemplate:g("{n} attachments did not upload."),refusedSizeTemplate:g("{n} attachment was too large to send."),refusedSizePluralTemplate:g("{n} attachments were too large to send."),refusedTypeTemplate:g("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:g("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:g("{n} attachment could not be read."),refusedUnreadablePluralTemplate:g("{n} attachments could not be read.")}),navTitle:g("Book a visit"),rescheduleNavTitle:g("Change your visit"),close:g("Close"),continueCta:g("Continue"),petSelectTitle:g("Who is this visit for?"),addPetCta:g("Add a pet"),locationUnknownTitle:g("We need your location to find a vet"),locationUnknownBody:g("Turn on location for Everfur, then try again."),locationUnknownCta:g("Allow location"),locationBlockedTitle:g("Location is turned off"),locationBlockedBody:g("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:g("Open Settings"),locationUnavailableTitle:g("We could not read your location"),locationUnavailableBody:g("Try again in a moment."),stateAttestTemplate:g("I confirm my pet and I are in {state} right now."),describeHeading:g("Tell the vet what you are seeing"),describeHelpLong:g("A few sentences is plenty. When it started, what changed, anything you've already tried."),addPhotoCta:g("ADD PHOTO OR VIDEO"),removePhotoLabel:g("Remove photo"),summaryPet:g("Pet"),summaryVet:g("Vet"),summaryWhen:g("When"),summaryLength:g("Length"),summaryReason:g("Reason"),summaryLengthTemplate:g("{n} minutes"),confirmCta:g("Confirm visit"),bookedTitle:g("You are booked."),addToCalendarCta:g("Add to calendar"),doneCta:g("Done"),booked:Object.freeze({remindPromise:g("We will notify you 30 minutes before."),summaryPromise:g("{pet}'s summary goes to the vet ahead of the call."),joinPromise:g("Join right here in the app. No links to hunt for."),backToPet:g("Back to {pet}"),calendarAdded:g("Added to your calendar"),calendarFailedBody:g("That did not save to your calendar.")}),chrome:Object.freeze({closeHint:g("Closes without saving"),discardTitle:g("Leave without booking?"),discardBody:g("Your answers will not be saved."),discardConfirmCta:g("Leave"),discardKeepCta:g("Keep going"),noPetsTitle:g("No pets on this account"),loadFailedTitle:g("Could not load"),retryCta:g("Try again")}),emergency:Object.freeze({bannerTitle:g("This cannot wait for a scheduled call."),keepBookingCta:g("I have handled this, keep booking"),lede:g("What you are describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:g("Call {petName}'s primary vet"),exitFindErTitle:g("Find an emergency vet near you"),startCallHint:g("Starts a phone call")}),visit:Object.freeze({title:g("Your visit")}),loading:Object.freeze({pets:"Loading pets. Nothing to read yet.",clinicians:"Loading vets. Nothing to read yet.",slots:"Loading times. Nothing to read yet.",consult:"Loading your visit. Nothing to read yet.",progressTemplate:"Step {step} of {total}"})});function ii(e=ie){return typeof e=="string"?[e]:typeof e!="object"||e===null?[]:Object.values(e).flatMap(t=>ii(t))}o(ii,"televetBookingCopyValues");function Oe(){return ii().every(e=>e.trim().length>0&&!vs(e))}o(Oe,"isTelevetBookingCopyReady");var dt=Object.freeze({findEmergencyVet:"Find an emergency vet near you",poisonControl:"ASPCA Animal Poison Control",poisonControlDetail:"(888) 426-4435 \xB7 a fee may apply",poisonControlTel:"tel:+18884264435"}),f=Object.freeze({...ie,petSelectTitle:"Who is this visit for?",describeHeading:"Type to the vet what you're seeing",describeHelpLong:"Describe the issues your pet is experiencing",reasonPlaceholder:"She's been scratching her left ear a lot this week...",yourVetTitle:"Which vet would you like to see?",timeHeading:"Pick a date and time",reviewHeading:"Does this look right?",issuesHeadingTemplate:"Select {pet}\u2019s main issues",issuesHint:"Can select more than 1",otherIssue:"Other",bookedHeadingTemplate:"You're booked with {vet}",addToCalendarCta:"Add to Calendar",backLabel:"Back",emergency:Object.freeze({...ie.emergency,bannerTitle:"This can't wait for a scheduled call.",lede:"What you're describing is the kind of thing vets want to see in person, now. Please call one of these first.",ledeWithoutExits:ie.emergency.lede,keepBookingCta:"I've handled this, continue with booking",exitPrimaryVetTitle:"Call {petName}'s primary vet"})});var Jr=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Jr.map(e=>e.wireCode));var hs=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),ai=Object.freeze(Jr.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:hs[e.wireCode]}))),Ts=new Map(ai.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ss=Object.freeze(["http_envelope",...[...new Set(ai.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function nr(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let n of [t??"http_envelope",...Ss]){let l=Ts.get(n+r);if(l)return l}}o(nr,"contractErrorFor");function Es(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Es,"contractDocUrl");function si(e){return null}o(si,"publishedDocUrl");var Cs=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function di(e){return Cs[e]}o(di,"categoryFor");function ui(e){let t=nr(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(ui,"fromWire");var ks=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Xr(e){return ks.has(e)}o(Xr,"isAutoRetryable");var xs=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ci(e){return Xr(e)||xs.has(e)}o(ci,"isRetryableCode");var Rs=500,Qr=8e3,pi=4;function fi(e,t=Math.random){let r=Math.max(0,e),n=Math.min(Rs*2**r,Qr);return Math.floor(t()*n)}o(fi,"backoffDelayMs");var _s=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Zr(e){return _s[e]}o(Zr,"userFacingError");function yi(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}o(yi,"defineHidden");var Ps=/^[a-z][a-z0-9_]{0,63}$/;function ue(e,t){let r=nr(t?.wireCode,t?.wireEnvelope),n={code:e,category:di(e),retryable:t?.retryable??ci(e),displayMessage:Zr(e)};if(t?.httpStatus!==void 0&&(n.httpStatus=t.httpStatus),t?.requestId&&(n.requestId=t.requestId),typeof t?.reasonCode=="string"&&Ps.test(t.reasonCode)&&(n.reasonCode=t.reasonCode),r);return t?.wireMessage&&yi(n,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&yi(n,"raw",t.raw),Object.freeze(n)}o(ue,"makeEverfurError");function F(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}o(F,"ok");function P(e){return Object.freeze({ok:false,error:e})}o(P,"err");var or=class or extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,or.prototype);}};o(or,"EverfurConfigError");var xt=or;function ws(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}o(ws,"authHeaders");function Rt(e,t){return {...e,headers:{...Is(e.headers),...ws(t)}}}o(Rt,"withAuthHeaders");function Is(e){if(!e)return {};let t={};for(let[r,n]of Object.entries(e)){let l=r.toLowerCase();l==="authorization"||l==="x-everfur-partner-key"||(t[r]=n);}return t}o(Is,"stripAuthHeaders");async function mi(e,t){if(t.mode==="anonymous")return t.transport.request(Rt(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return P(en())}let n=await t.transport.request(Rt(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let l;try{l=await t.identity.currentToken({forceRefresh:!0});}catch{return P(en())}let a=await t.transport.request(Rt(e,{mode:"personalized",token:l,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?P(en(a.error.httpStatus)):a}o(mi,"authedSend");function en(e){return ue("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(en,"authRejectedError");function gi(e){return ue("internalError",{retryable:true,wireMessage:Os(e)})}o(gi,"networkError");function Os(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Os,"describeCause");var As=3e4,Bs=Qr*2,Ns="idempotency-key",Ds=new Set(["POST","PUT","PATCH","DELETE"]),Ls=Object.freeze({onEvent(){}}),Fs=Object.freeze({setTimeout:o((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Ms(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}o(Ms,"seededIdempotencyKey");function _t(e){let t=e.observer??Ls,r=e.timers??Fs,n=e.rng??Math.random,l=e.sleep??((m,y)=>Xs(m,r,y)),a=e.maxAttempts??pi,s=e.unaryTimeoutMs??As,i=e.newIdempotencyKey??tn(),d=o(m=>{try{t.onEvent(m);}catch{}},"emit");async function c(m,y,b){let h=b?.maxAttempts,T=Math.max(1,h??a),S=b?.idempotent??Ds.has(y.method),C=b?.idempotencyKey===void 0?null:Ms(b.idempotencyKey),k=S?C??i():null,B=zs(y,k),I=0;for(;;){let N=o(Q=>Object.freeze({call:m,method:y.method,path:y.path,attempt:I,...k?{idempotencyKey:k}:{},...Q}),"stamp");d(N({phase:"attempt"}));let z=Gs(s,r),j=Js(z.signal,y.signal),J;try{J=await mi({...B,signal:j.signal},e.auth);}catch(Q){J=P(gi(Q));}finally{j.dispose(),z.cancel();}if(J.ok)return d(N({phase:"settled",ok:true,reason:"ok"})),J;let D=J.error,X=Hs(D,I,{maxAttempts:T,rng:n,now:r.now(),aborted:y.signal?.aborted===true,...h!==void 0?{perCallMaxAttempts:h}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),$={ok:false,code:D.code,reason:X.reason,...D.httpStatus!==void 0?{httpStatus:D.httpStatus}:{},...D.requestId!==void 0?{requestId:D.requestId}:{}};if(!X.retry)return d(N({phase:"settled",...$})),P(D);if(d(N({phase:"retry",...$,delayMs:X.delayMs})),await l(X.delayMs,y.signal),y.signal?.aborted===true)return d(N({phase:"settled",...$,reason:"aborted"})),P(D);I+=1;}}o(c,"send");async function u(m){return Rt(m,await Ys(e.auth))}o(u,"authorize");async function*p(m,y,b){d(Object.freeze({call:m,phase:"stream.open",method:y.method,path:y.path,attempt:0}));try{yield*e.auth.transport.stream(y,b);}catch{yield ni({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(p,"stream"),Object.freeze({send:c,authorize:u,stream:p})}o(_t,"createRequestFunnel");function zs(e,t){let r={};for(let[n,l]of Object.entries(e.headers??{}))n.toLowerCase()!==Ns&&(r[n]=l);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}o(zs,"assembleHeaders");function tn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(tn,"defaultIdempotencyKeyFactory");var js=10;function Hs(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let n=Vs(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Xr(e.code))return {retry:false,reason:"terminal-code"};let l=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(r.policy===void 0)return null;let c;try{c=r.policy.maxAttempts(e.code);}catch{return null}return typeof c!="number"||!Number.isFinite(c)?null:Math.max(1,Math.min(js,Math.floor(c)))},"policyCeiling"),i=r.perCallMaxAttempts??s()??r.maxAttempts;if(t+1>=i)return {retry:false,reason:"attempts-exhausted"};let d=Us(e,r.now);return d!==null?d>Bs?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:l,delayMs:d}:{retry:true,reason:l,delayMs:fi(t,r.rng)}}o(Hs,"decideRetry");function Vs(e){let t=e.code==="unknown"?ui(qs(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}o(Vs,"throttleKind");function Us(e,t){let r=$s(e.raw);if(r!==null){let l=r-t;return l>0?l:0}let n=Ws(e.raw);return n===null?null:Math.round(n*1e3)}o(Us,"retryOverrideMs");function Ws(e){for(let t of rn(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}o(Ws,"findRetryAfterSeconds");function $s(e){for(let t of rn(e)){let r=t.resets_at,n=Ks(r);if(n!==null)return n}return null}o($s,"findResetsAt");function rn(e){if(!vi(e))return [];let t=[e];for(let r of ["error","detail"]){let n=e[r];vi(n)&&t.push(n);}return t}o(rn,"candidateScopes");function Ks(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}o(Ks,"parseInstantMs");function qs(e){for(let t of rn(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}o(qs,"rawWireCode");function vi(e){return typeof e=="object"&&e!==null}o(vi,"isRecord");async function Ys(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(Ys,"resolveDeviceAuth");function Gs(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:o(()=>t.clearTimeout(n),"cancel")}}o(Gs,"boundedSignal");function Js(e,t){let r=o(()=>{},"noop");if(!t)return {signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let l=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",l,{once:true}),t.addEventListener("abort",l,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",l),t.removeEventListener("abort",l);},"dispose")}}o(Js,"mergeSignals");function Xs(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let l=t.setTimeout(()=>{r?.removeEventListener("abort",a),n();},e),a=o(()=>{t.clearTimeout(l),n();},"onAbort");r?.addEventListener("abort",a,{once:true});})}o(Xs,"delayAbortable");var Si="televet_booking_not_live";function ir(e){return ue("conflict",{retryable:false,reasonCode:Si,wireMessage:`the booking was answered with a consult whose status is ${e}, which is not a live visit`})}o(ir,"televetBookingNotLiveError");var nn="televet_booking_key_reused",bi="IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST";function lr(e){return e.httpStatus!==409||e.reasonCode===nn||Pt(e)?.code!==bi?e:ue(e.code,{retryable:false,httpStatus:409,...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:bi,reasonCode:nn,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}o(lr,"foldTelevetBookingKeyReused");function Pt(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let r=t,n=r.detail??r.error;return typeof n=="object"&&n!==null?n:r}o(Pt,"details");function Qs(e){let t=Pt(e)?.categories;return Array.isArray(t)?Object.freeze(t.filter(r=>typeof r=="string")):Object.freeze([])}o(Qs,"categoriesOf");function hi(e){let t=Pt(e)?.retry_after_seconds;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(hi,"retryAfterOf");function Ti(e){let t=e.wireMessage;if(typeof t=="string"&&t.trim().length>0)return t.trim();let r=Pt(e)?.message;return typeof r=="string"&&r.trim().length>0?r.trim():null}o(Ti,"messageOf");function Zs(e){let t=e.reasonCode;if(typeof t=="string"&&t.length>0)return t;let r=Pt(e),n=r?.code??r?.error_code;return typeof n=="string"&&n.length>0?n:null}o(Zs,"codeOf");function ze(e){let t=e.httpStatus;if(t===402)return Object.freeze({kind:"not_entitled"});if(t===429||e.code==="rateLimited"||e.code==="quotaExceeded")return Object.freeze({kind:"rate_limited",retryAfterSeconds:hi(e),message:Ti(e)});if(t===404)return Object.freeze({kind:"unavailable"});switch(Zs(e)){case "televet_rate_limited":return Object.freeze({kind:"rate_limited",retryAfterSeconds:hi(e),message:Ti(e)});case "televet_emergency_ack_required":return Object.freeze({kind:"emergency",categories:Qs(e)});case "televet_not_entitled":return Object.freeze({kind:"not_entitled"});case "televet_slot_conflict":return Object.freeze({kind:"slot_taken"});case "televet_hold_invalid":return Object.freeze({kind:"slot_taken"});case Si:return Object.freeze({kind:"slot_taken"});case nn:return Object.freeze({kind:"slot_taken"});case "televet_clinician_cannot_prescribe":case "televet_clinician_unavailable":case "televet_clinician_not_bookable":return Object.freeze({kind:"clinician_unavailable"});case "televet_membership_conflict":return Object.freeze({kind:"not_entitled"});case "televet_registry_unavailable":return Object.freeze({kind:"failed"});}return Object.freeze({kind:"failed"})}o(ze,"televetBookingRefusal");function ed(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(ed,"isSafeRoomUrl");function td(e,t){return ed(e)&&t.trim().length>0}o(td,"isUsableRoomCredential");function ar(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ar,"isRecord");function on(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}o(on,"wholeNumber");function rd(e){if(!ar(e))return null;let t=on(e.consult_minutes,1),r=on(e.auto_end_minutes,0),n=on(e.warn_before_seconds,0);return t===null||r===null||n===null?null:Object.freeze({consultMinutes:t,autoEndMinutes:r,warnBeforeSeconds:n})}o(rd,"parseCallLimits");function ln(e){if(!ar(e))return null;let t=e.room_url??e.url,r=e.token;if(typeof t!="string"||typeof r!="string"||!td(t,r))return null;let n=e.recording_notice;return Object.freeze({roomUrl:t.trim(),token:r,recordingNotice:typeof n=="boolean"?n:true,callLimits:rd(e.call_limits)})}o(ln,"parseVetCallCredential");function an(e){let t=Ei(e.raw);return t!==null&&t.length>0?t:null}o(an,"vetCallJoinReason");function Ei(e){if(!ar(e))return null;let t=e.detail??e.error,n=(ar(t)?t:e).reason;return typeof n=="string"?n:null}o(Ei,"reasonOf");function sn(e){if(e.httpStatus===404)return "unavailable";let t=Ei(e.raw);return t==="too_early"||t==="too_late"||t==="room_not_ready"?t:t!==null&&t.startsWith("status_")?"not_joinable":"unknown"}o(sn,"vetCallJoinRefusal");var ki=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],sr=new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),nd=new Set(["scheduled","in_progress","awaiting_summary"]);function dr(e){return nd.has(e.status)}o(dr,"isLiveConsult");var xi=["wellness","prescription"],od=60;function un(e){let t=Date.parse(e.startsAt),r=Date.parse(e.endsAt);if(Number.isNaN(t)||Number.isNaN(r))return null;let n=Math.round((r-t)/6e4);return n>0?Math.min(n,od):null}o(un,"televetSlotMinutes");var ur=64,He=2e3,cr=10;function Ce(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}o(Ce,"isWellFormedStateCode");function Ae(e){return typeof e=="object"&&e!==null?e:null}o(Ae,"row");function Z(e){return typeof e=="string"&&e.length>0?e:null}o(Z,"str");function je(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}o(je,"trimmedOrNull");function ut(e,t){return typeof e=="boolean"?e:t}o(ut,"bool");function dn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(dn,"num");function Ci(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}o(Ci,"closed");function ct(e,t){if(!Array.isArray(e))return Object.freeze([]);let r=[];for(let n of e){let l=t(n);l!==null&&r.push(l);}return Object.freeze(r)}o(ct,"parseList");function Ri(e,t){let r=Ae(e);return r===null?null:Object.freeze({state:Z(r.state)??t,wellnessAvailable:ut(r.wellness_available,false),prescriptionsAvailable:ut(r.prescriptions_available,false),cancellationPolicyText:je(r.cancellation_policy_text)})}o(Ri,"parseStatePolicy");function _i(e){let t=Ae(e);if(t===null)return null;let r=je(t.summary),n=je(t.version);return r===null||n===null?null:Object.freeze({summary:r,version:n})}o(_i,"parseCancellationPolicy");function Pi(e){let t=Ae(e);if(t===null)return null;let r=Z(t.clinician_id),n=Z(t.display_name);return r===null||n===null?null:Object.freeze({clinicianId:r,displayName:n,credentials:je(t.credentials_text),rating:dn(t.rating),ratingCount:dn(t.rating_count),bio:je(t.bio),photoRef:Z(t.photo_ref),licensedStates:ct(t.licensed_states,l=>{let a=Ae(l),s=a===null?null:Z(a.state);return s===null?null:Object.freeze({state:s,canPrescribe:ut(a?.can_prescribe,false)})})})}o(Pi,"parseClinician");function cn(e){let t=Ae(e);if(t===null)return null;let r=Z(t.slot_id),n=Z(t.starts_at);return r===null||n===null?null:Object.freeze({slotId:r,startsAt:n,endsAt:Z(t.ends_at)??n})}o(cn,"parseSlot");function wi(e){let t=Ae(e);if(t===null)return null;let r=Z(t.slot_id),n=Z(t.hold_expires_at);return r===null||n===null?null:Object.freeze({slotId:r,expiresAt:n})}o(wi,"parseSlotHold");function wt(e){let t=Ae(e);if(t===null)return null;let r=Z(t.consult_id),n=Z(t.scheduled_at);return r===null||n===null?null:Object.freeze({consultId:r,petId:Z(t.pet_id)??"",clinicianId:Z(t.clinician_id)??"",clinicianName:je(t.display_name),reasonText:je(t.reason_text),mediaRefs:ct(t.media_refs,l=>Z(l)),status:Ci(ki,t.status),kind:Ci(xi,t.kind),scheduledAt:n,emergencyFlagged:ut(t.emergency_flagged,false),hasRoom:Z(t.meeting_url)!==null})}o(wt,"parseConsult");function Ii(e){let t=Ae(e);return Object.freeze({active:ut(t?.active,false)})}o(Ii,"parseBookingEntitlement");var Ve=240;function Oi(e){let t=Ae(e);if(t===null)return null;let r=dn(t.fee_cents);return r===null||r<0?null:Object.freeze({feeCents:r,currency:Z(t.currency)??"usd",feeRecorded:ut(t.fee_recorded,r>0),summary:je(t.summary)})}o(Oi,"parseCancelReceipt");var Ue="/widget/v1/televet",id=`${Ue}/state-policy`,ld=`${Ue}/vets`,Ai=`${Ue}/slots`,ad=`${Ue}/slots/next`,pr=`${Ue}/consults`,sd=`${Ue}/entitlement`,dd=`${Ue}/cancellation-policy`;function Bi(e){return `${Ai}/${encodeURIComponent(e)}/hold`}o(Bi,"televetHoldCall");function Ni(e){return `${pr}/${encodeURIComponent(e)}/reschedule`}o(Ni,"televetRescheduleCall");function fr(e){return `${pr}/${encodeURIComponent(e)}`}o(fr,"televetConsultCall");function Di(e){return `${fr(e)}/join`}o(Di,"televetJoinCall");function Li(e){return `${fr(e)}/cancel`}o(Li,"televetCancelCall");var Fi=100;function ce(e){return P(ue("validationFailed",{retryable:false,wireMessage:e}))}o(ce,"invalid");function Je(e){return P(ue("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}o(Je,"unusable");function pn(e){return e.httpStatus===404}o(pn,"isDark");function pt(e,t,r){try{e?.track(t,r);}catch{}}o(pt,"safeTrack");function Mi(e){if(e.pet_id.trim().length===0)return "pet_id is required";if(e.clinician_id.trim().length===0)return "clinician_id is required";if(e.slot_id.trim().length===0)return "slot_id is required";if(!Ce(e.state))return "state must be a two-letter US state code";let t=e.reason_text.trim();return t.length===0?"reason_text is required":t.length>He?`reason_text must be at most ${He} characters`:ud(e)}o(Mi,"validateBookingBody");function ud(e){let t=e.state_attested===true,r=e.cancellation_policy_version?.trim()??"";return t!==r.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":r.length>ur?`cancellation_policy_version must be at most ${ur} characters`:null}o(ud,"attestationRefusal");function yn(e){let t=e.funnel??_t({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry;return {async statePolicy(n,l){let a=n.trim();if(!Ce(a))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.state_policy",{method:"GET",path:`${id}/${encodeURIComponent(a)}`,...l?{signal:l}:{}});if(!s.ok)return P(s.error);let i=Ri(s.value,a);return i===null?Je("the state policy response was unreadable"):F(i)},async entitlement(n){let l=await t.send("televet.booking.entitlement",{method:"GET",path:sd,...n?{signal:n}:{}});return l.ok?F(Ii(l.value)):P(l.error)},async cancellationPolicy(n){let l=await t.send("televet.booking.cancellation_policy",{method:"GET",path:dd,...n?{signal:n}:{}});return l.ok?F(_i(l.value)):F(null)},async clinicians(n,l){let a=n.trim();if(!Ce(a))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.clinicians",{method:"GET",path:ld,query:{state:a},...l?{signal:l}:{}});return s.ok?F(ct(fn(s.value,"vets"),Pi)):pn(s.error)?F(Object.freeze([])):P(s.error)},async slots(n,l){let a=n.trim();if(a.length===0)return ce("clinicianId is required");let s=await t.send("televet.booking.slots",{method:"GET",path:Ai,query:{clinician_id:a},...l?{signal:l}:{}});return s.ok?F(ct(fn(s.value,"slots"),cn)):pn(s.error)?F(Object.freeze([])):P(s.error)},async nextSlot(n){let l=await t.send("televet.booking.next_slot",{method:"GET",path:ad,...n?{signal:n}:{}});return l.ok?F(cn(pd(l.value,"slot"))):F(null)},async holdSlot(n){let l=n.trim();if(l.length===0)return ce("slotId is required");let a=await t.send("televet.booking.hold",{method:"POST",path:Bi(l)},{idempotent:false,maxAttempts:1});if(!a.ok)return pt(r,"televet.booking.hold_failed",{status:a.error.httpStatus??null}),P(a.error);let s=wi(a.value);return s===null?Je("the hold response carried no usable expiry"):F(s)},async book(n,l){let a=Mi(n);if(a!==null)return ce(a);let s=l.trim();if(s.length===0)return ce("idempotencyKey is required");let i=await t.send("televet.booking.book",{method:"POST",path:pr,body:cd(n)},{idempotent:true,idempotencyKey:s,maxAttempts:1});if(!i.ok)return pt(r,"televet.booking.book_failed",{status:i.error.httpStatus??null}),P(lr(i.error));let d=wt(i.value);return d===null?Je("the booking response was unreadable"):dr(d)?F(d):(pt(r,"televet.booking.book_failed",{status:null,consult_status:d.status}),P(ir(d.status)))},async reschedule(n,l){let a=n.trim(),s=l.trim();if(a.length===0)return ce("consultId is required");if(s.length===0)return ce("slotId is required");let i=await t.send("televet.booking.reschedule",{method:"POST",path:Ni(a),body:{new_slot_id:s}},{idempotent:false,maxAttempts:1});if(!i.ok)return pt(r,"televet.booking.reschedule_failed",{status:i.error.httpStatus??null}),P(i.error);let d=wt(i.value);return d===null?Je("the reschedule response was unreadable"):F(d)},async listConsults(n){let l=await t.send("televet.booking.consults",{method:"GET",path:pr,query:{limit:String(Fi)},...n?{signal:n}:{}});return l.ok?F(ct(fn(l.value,"consults"),wt)):pn(l.error)?F(Object.freeze([])):P(l.error)},async getConsult(n,l){let a=n.trim();if(a.length===0)return ce("consultId is required");let s=await t.send("televet.booking.consult",{method:"GET",path:fr(a),...l?{signal:l}:{}});if(!s.ok)return P(s.error);let i=wt(s.value);return i===null?Je("the consult response was unreadable"):F(i)},async joinConsult(n){let l=n.trim();if(l.length===0)return ce("consultId is required");let a=await t.send("televet.booking.join",{method:"POST",path:Di(l)},{idempotent:false,maxAttempts:1});if(!a.ok)return pt(r,"televet.booking.join_failed",{status:a.error.httpStatus??null}),P(a.error);let s=ln(a.value);return s===null?Je("the join response carried no usable room credential"):F(s)},async cancelConsult(n,l){let a=n.trim(),s=l.trim();if(a.length===0)return ce("consultId is required");if(s.length===0)return ce("reason is required");if(s.length>Ve)return ce(`reason must be at most ${Ve} characters`);let i=await t.send("televet.booking.cancel",{method:"POST",path:Li(a),body:{reason:s}},{idempotent:false,maxAttempts:1});if(!i.ok)return pt(r,"televet.booking.cancel_failed",{status:i.error.httpStatus??null}),P(i.error);let d=Oi(i.value);return d===null?Je("the cancel response was unreadable"):F(d)}}}o(yn,"createTelevetBookingController");function cd(e){let t=e.cancellation_policy_version?.trim()??"",r=e.state_attested===true&&t.length>0;return {pet_id:e.pet_id,clinician_id:e.clinician_id,slot_id:e.slot_id,state:e.state,reason_text:e.reason_text.trim(),species:e.species,media_refs:[...e.media_refs],emergency_acknowledged:e.emergency_acknowledged,share_health_records:e.share_health_records,...r?{state_attested:true,cancellation_policy_version:t}:{}}}o(cd,"bookingWireBody");function fn(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let r=e,n=r[t]??r.items??r.data;if(Array.isArray(n))return n}return e}o(fn,"rows");function pd(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=e,n=r[t]??r.data;if(typeof n=="object"&&n!==null)return n}return e}o(pd,"unwrap");var zi=Symbol.for("@everfur/sdk#EverfurContext@v1"),ji=globalThis,Hi=ji[zi]??(ji[zi]=react.createContext(null));Hi.displayName??="EverfurContext";function Xe(){let e=react.useContext(Hi);if(e===null)throw new xt("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(Xe,"useEverfurContext");var md=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function gd(e){return md[e]}o(gd,"requires");function Vi(e,t,r){let n=gd(e),l=new Map;for(let i of t)l.set(i.resource,i);if(r?.isPending===true&&n.some(i=>!l.has(i)))return mn({name:e,enabled:false,isPending:true,limits:{}});let a=vd(n,l);return n.filter(i=>l.get(i)?.granted!==true).length===0?mn({name:e,enabled:true,isPending:false,limits:a}):mn({name:e,enabled:false,isPending:false,limits:a,disabled:bd(n,l)})}o(Vi,"decideCapability");function vd(e,t){let r={};for(let n of e){let l=t.get(n)?.limits;if(l)for(let[a,s]of Object.entries(l)){let i=r[a];r[a]=i===void 0?s:Math.min(i,s);}}return r}o(vd,"mergeLimits");function bd(e,t){for(let r of e){let n=t.get(r)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Zr("accessDenied"),level:"user_entitlement",recoverable:false})}o(bd,"disabledFor");function mn(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),Object.freeze(t)}o(mn,"freezeDecision");function It(e){let{runtime:t}=Xe(),r=t.entitlements,n=react.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);return react.useMemo(()=>Vi(e,n.decisions,{isPending:n.isPending}),[e,n])}o(It,"useCapability");function he(e){let{runtime:t,userRef:r,scopeEpoch:n}=Xe();return react.useMemo(()=>{if(e)return e;if(r===null)return null;let{services:l}=t.registry;return yn({auth:l.authFor(r),telemetry:l.telemetry,...l.errorPolicy?{errorPolicy:l.errorPolicy}:{}})},[t,r,n,e])}o(he,"useTelevetBookingController");function Sd(){let{userRef:e}=Xe(),t=It("televet");return react.useMemo(()=>({available:t.enabled&&e!==null,isPending:t.isPending}),[t.enabled,t.isPending,e])}o(Sd,"useTelevetBookingAvailable");function Qe(e,t,r){let[n,l]=react.useState(()=>({key:e,data:null,isPending:t&&r!==null,error:null})),[a,s]=react.useState(0),i=react.useRef(r);i.current=r,react.useEffect(()=>{let u=i.current;if(!t||u===null){l({key:e,data:null,isPending:false,error:null});return}let p=new AbortController,m=true;return l(y=>y.key===e?{...y,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let y;try{y=await u(p.signal);}catch{m&&l({key:e,data:null,isPending:false,error:null});return}m&&(y.ok?l({key:e,data:y.value,isPending:false,error:null}):l({key:e,data:null,isPending:false,error:y.error}));})(),()=>{m=false,p.abort();}},[e,t,a]);let d=react.useCallback(()=>s(u=>u+1),[]),c=n.key===e;return react.useMemo(()=>({enabled:t,data:c?n.data:null,isPending:t&&(!c||n.isPending),isError:c&&n.error!==null,error:c?n.error:null,refetch:d}),[t,c,n.data,n.isPending,n.error,d])}o(Qe,"useTelevetRead");function vn(e,t){let r=e?.trim()??"",n=t?.statePolicy!==void 0&&Ce(r),l=t?.statePolicy;return Qe(`state-policy:${r}`,n,n&&l?a=>l.call(t,r,a):null)}o(vn,"useTelevetStatePolicy");function bn(e){let t=e?.entitlement!==void 0,r=e?.entitlement;return Qe("entitlement",t,t&&r?n=>r.call(e,n):null)}o(bn,"useTelevetBookingEntitlement");function Ot(e){let t=e?.cancellationPolicy!==void 0,r=e?.cancellationPolicy;return Qe("cancellation-policy",t,t&&r?n=>r.call(e,n):null)}o(Ot,"useTelevetCancellationPolicy");function hn(e,t){let r=e?.trim()??"",n=t?.clinicians!==void 0&&Ce(r),l=t?.clinicians;return Qe(`clinicians:${r}`,n,n&&l?a=>l.call(t,r,a):null)}o(hn,"useTelevetClinicians");function At(e,t){let r=e?.trim()??"",n=t!==null&&r.length>0;return Qe(`slots:${r}`,n,n&&t?l=>t.slots(r,l):null)}o(At,"useTelevetSlots");function Tn(e){let t=e?.nextSlot!==void 0,r=e?.nextSlot;return Qe("next-slot",t,t&&r?n=>r.call(e,n):null)}o(Tn,"useTelevetNextSlot");function Sn(e){let[t,r]=react.useState(null),n=react.useRef(true),l=react.useRef(false),a=react.useRef(e);a.current=e,react.useEffect(()=>(n.current=true,()=>{n.current=false;}),[]);let s=react.useCallback((...i)=>{let d=a.current;if(d===null||l.current)return;let c=i[i.length-1],u=typeof c=="object"&&c!==null&&("onSuccess"in c||"onError"in c),p=u?c:void 0,m=u?i.slice(0,-1):i;l.current=true,r({variables:m[0]??null}),(async()=>{let y=null;try{y=await d(...m);}catch{y=null;}l.current=false,n.current&&r(null),y!==null&&(y.ok?p?.onSuccess?.(y.value):p?.onError?.(y.error));})();},[]);return react.useMemo(()=>({isPending:t!==null,variables:t?.variables??null,mutate:s}),[t,s])}o(Sn,"useTelevetWrite");function Bt(e){return Sn(e?t=>e.holdSlot(t):null)}o(Bt,"useTelevetHoldSlot");function En(e){return Sn(e?(t,r)=>e.book(t,r):null)}o(En,"useTelevetBookConsult");function Cn(e,t){return Sn(t&&e?r=>t.reschedule(e,r):null)}o(Cn,"useTelevetRescheduleConsult");function gr(e,t=0){let r=e?.listConsults!==void 0,n=e?.listConsults;return Qe(`consults:${t}`,r,r&&n?l=>n.call(e,l):null)}o(gr,"useTelevetConsults");function kn(e){return e.error!==null&&e.error.httpStatus===404}o(kn,"televetReadIsDark");var xn=15,Rn=250,$i=new Set(["scheduled","in_progress"]);function Ze(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}o(Ze,"startsAtMs");function _n(e){let t=Ze(e);return t===null?null:t-xn*6e4}o(_n,"televetJoinOpensAtMs");function Pn(e,t){if(!$i.has(e.status))return {joinable:false,reason:`status_${e.status}`};if(!e.hasRoom)return {joinable:false,reason:"room_not_ready"};let r=Ze(e);return r===null||t<r-xn*6e4?{joinable:false,reason:"too_early"}:t>r+Rn*6e4?{joinable:false,reason:"too_late"}:{joinable:true}}o(Pn,"televetJoinDecision");function Nt(e,t){let r=[],n=[];for(let l of e){let a=Ze(l);($i.has(l.status)&&a!==null&&a+Rn*6e4>t?r:n).push(l);}return r.sort((l,a)=>(Ze(l)??0)-(Ze(a)??0)),n.sort((l,a)=>(Ze(a)??0)-(Ze(l)??0)),Object.freeze({upcoming:Object.freeze(r),past:Object.freeze(n)})}o(Nt,"splitTelevetVisits");function wn(e){return e==="scheduled"}o(wn,"canManageTelevetVisit");function Ki(e){let t=gr(e);return t.enabled?t.isPending?"pending":t.isError||Nt(t.data??[],Date.now()).upcoming.length>0?"visits":"booking":"booking"}o(Ki,"useTelevetLanding");var w=Object.freeze({bookCardTitle:"Book a video visit",bookCardCta:"Find a time",upcomingTitle:"Upcoming visits",pastTitle:"Past visits",emptyTitle:"No visits yet",emptyBody:"When you book a video visit, it will appear here.",loading:"Loading your visits\u2026",loadErrorTitle:"Could not load your visits",loadErrorBody:"Check your connection and try again.",retry:"Try again",joinCta:"Join visit",joining:"Joining\u2026",rescheduleCta:"Reschedule",cancelCta:"Cancel visit",cancelConfirmTitle:"Cancel this visit?",cancellationReasonLabel:"Why are you cancelling?",cancelConfirmCta:"Cancel visit",cancellingVisit:"Cancelling visit\u2026",cancelDismissCta:"Keep visit",cancelledTitle:"Visit cancelled",cancellationFeeRecorded:"A late cancellation fee was recorded for this visit.",cancellationFeeNotRecorded:"No late cancellation fee was recorded for this visit.",loadingCancellationTerms:"Loading cancellation terms\u2026",cancellationTermsUnavailable:"We could not confirm the current cancellation terms. Try again before continuing.",cancellationReasonMissing:"Tell us why you are cancelling.",cancellationReasonTooLong:o(e=>`Keep the reason to ${String(e)} characters or fewer.`,"cancellationReasonTooLong"),cancelTermsFirst:"We could not confirm the cancellation terms. Please try again before cancelling.",cancelFailed:"We could not cancel this visit. Refresh your visits to confirm its status before trying again."});function qi(e){switch(e){case "scheduled":return "Scheduled";case "in_progress":return "In progress";case "awaiting_summary":return "Summary on its way";case "completed":return "Completed";case "cancelled_owner":return "Cancelled by you";case "cancelled_ops":return "Cancelled by Everfur";case "no_show_owner":return "Missed";case "no_show_vet":return "Vet couldn't attend";default:return null}}o(qi,"televetVisitStatusWeb");function Yi(e,t){if(e==="too_early")return t?`This visit opens at ${t}. You can join from then.`:"This visit has not opened yet.";if(e==="too_late")return "This visit has ended.";if(e==="room_not_ready")return "We are still setting up the video room. Try again in a moment.";switch(e){case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return "This visit cannot be joined right now."}}o(Yi,"televetJoinBlockWeb");var An=class An extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(r,n){return Object.is(r.resetKey,n.key)?null:{failed:false,key:r.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(An,"HostRenderBoundary");var In=An;function Cd({render:e}){return e()}o(Cd,"RenderHost");function On({render:e,fallback:t,resetKey:r}){return react.createElement(In,{fallback:t,resetKey:r,children:react.createElement(Cd,{render:e})})}o(On,"HostRender");function Dn(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Dn(e[t]);}return e}o(Dn,"deepFreeze");var kd=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Xi={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Qi={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ji={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},xd={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Rd={regular:"400",medium:"500",bold:"700"},_d={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Pd=0,vr="System",br="monospace",wd=["content","heading","control","compact","badge"];function Id(e){let t={};for(let r of wd)t[r]=e;return t}o(Id,"authoredTierSizes");function Zi(){return {family:vr,mono:br,fontUrl:null,families:{regular:vr,medium:vr,bold:vr,mono:br,monoMedium:br,monoBold:br},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ji,tierSizes:Id(Ji),lineHeight:xd,weight:Rd,letterSpacing:_d,scale:1,maxScale:Pd,scaleCaps:kd}}o(Zi,"baseType");var el={},Bn=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Nn(e){return `cubic-bezier(${e.join(", ")})`}o(Nn,"cssCubicBezier");var tl={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Nn(Bn.standard),emphasized:Nn(Bn.emphasized),exit:Nn(Bn.exit)},reducedMotion:false},Od={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},rl=Dn({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Od,space:Xi,radius:Qi,type:Zi(),motion:tl,slots:el}),Ad={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Dn({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ad,space:Xi,radius:Qi,type:Zi(),motion:tl,slots:el});var nl=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ol=globalThis,Ln=ol[nl]??(ol[nl]=react.createContext(rl));Ln.displayName??="EverfurThemeContext";function R(){return react.useContext(Ln)}o(R,"useEverfurTheme");var il=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var ll='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Dd="System";function Ld(e){let t=e.trim();return t.length===0||t===Dd?ll:`${al(t)}, ${ll}`}o(Ld,"cssFontFamily");function Fd(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${al(t)}, ui-monospace, Menlo, Consolas, monospace`}o(Fd,"cssMonoFamily");function al(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}o(al,"quote");function v(e,t){let r=e.type,n=r.families[t];return {fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?Fd(n):Ld(n),fontWeight:r.namedFaces[t]?r.weight.regular:r.weight[il[t]]}}o(v,"faceCss");var ft=Object.freeze({textAlign:"start"});var Md=48;function zd(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(zd,"selectView");function ul(e){let{capability:t,children:r,renderDisabled:n,renderPending:l,style:a,className:s}=e,i=It(t),d=react.useMemo(()=>zd(i),[i]);switch(d){case "enabled":return r;case "pending":return l?jsxRuntime.jsx(On,{render:l,fallback:jsxRuntime.jsx(sl,{capability:t,style:a,className:s})}):jsxRuntime.jsx(sl,{capability:t,style:a,className:s});case "disabled":return n?jsxRuntime.jsx(On,{render:()=>n(i),fallback:jsxRuntime.jsx(dl,{decision:i,style:a,className:s}),resetKey:i}):jsxRuntime.jsx(dl,{decision:i,style:a,className:s});default:return er(d)}}o(ul,"CapabilityGate");function sl({capability:e,style:t,className:r}){let n=R(),l=react.useMemo(()=>cl(n),[n]);return jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${e}`,className:r,style:{...l.offstate,...t},children:jsxRuntime.jsx("div",{style:l.skeletonBar})})}o(sl,"PendingSkeleton");function dl({decision:e,style:t,className:r}){let n=R(),l=react.useMemo(()=>cl(n),[n]),a=e.disabled?.reason??"";return jsxRuntime.jsx("div",{className:r,style:{...l.offstate,...t},children:a.length>0?jsxRuntime.jsx("p",{style:l.offstateText,children:a}):null})}o(dl,"OffState");function cl(e){let{color:t,space:r,radius:n,type:l}=e;return {offstate:{...ft,boxSizing:"border-box",minHeight:Md,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${r.md}px ${r.lg}px`,backgroundColor:t.surfaceCream,borderRadius:n.md,border:`1px solid ${t.brandBorder}`},offstateText:{margin:0,...v(e,"regular"),fontSize:l.size.body,lineHeight:`${Math.round(l.size.body*l.lineHeight.normal)}px`,color:t.text.muted},skeletonBar:{height:r.md,borderRadius:n.xs,backgroundColor:t.brandSofter}}}o(cl,"makeStyles");function hr(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}o(hr,"hasLoneSurrogate");function Tr(e){return [...e].length}o(Tr,"serverLength");var pl=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function fl(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(pl,t)?pl[t]:null}o(fl,"canonicalPetSpecies");var yl=50,jd=128,Mn=120,ml=120,Hd=2e3,gl=120,Vd=80,hl=new Set(["male","female","unknown"]),Tl=new Set(["day","month","year"]),Sl=new Set(["low","medium","high","athletic"]),El=new Set(["indoor","outdoor","both"]),Cl=new Set(["mild","moderate","severe"]),Ud=/^(\d{4})-(\d{2})-(\d{2})$/,kl=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],xl=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...kl,...xl].map(([e])=>e));function Wd(e){let t=Ud.exec(e);if(t===null)return false;let[r,n,l]=[Number(t[1]),Number(t[2]),Number(t[3])],a=new Date(Date.UTC(r,n-1,l));return a.getUTCFullYear()===r&&a.getUTCMonth()===n-1&&a.getUTCDate()===l}o(Wd,"isRealDate");var Lt=o(e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,"oneOf"),$d=o((e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,"boolean"),Er=o((e,t)=>typeof t=="string"&&Wd(t)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),xe=o((e,t={})=>(r,n)=>{if(typeof n!="string")return `${r} must be a string`;if(hr(n))return `${r} contains an unpaired surrogate and cannot be encoded`;let l=t.trimmed?n.trim():n;if(t.required&&l.length===0)return `${r} is required and must not be blank`;let a=Tr(l);return a<=e?null:`${r} is ${a} characters; the server accepts at most ${e}`},"text"),Kd={sex:Lt(hl),spayedNeutered:$d,birthDate:Er,birthDatePrecision:Lt(Tl),activityLevel:Lt(Sl),indoorOutdoor:Lt(El),foodBrand:xe(gl),foodType:xe(gl),microchipId:xe(Vd)},zn=["ref","ref",false,xe(jd,{required:true,trimmed:true})],jn=["notes","notes",false,xe(Hd,{trimmed:true})],vl=[zn,["name","name",true,xe(Mn,{required:true,trimmed:true})],["dose","dose",false,xe(ml,{trimmed:true})],["frequency","frequency",false,xe(ml,{trimmed:true})],["startDate","start_date",false,Er],["endDate","end_date",false,Er],jn],qd={allergies:[zn,["allergen","allergen",true,xe(Mn,{required:true,trimmed:true})],["severity","severity",false,Lt(Cl)],jn],medications:vl,supplements:vl,conditions:[zn,["conditionName","condition_name",true,xe(Mn,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Er],jn]};function Yd(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return {error:`${n} must be an object`};let l=r,a={};for(let[d,c,u,p]of qd[e]){let m=l[d];if(m==null){if(u)return {error:`${n}.${d} is required`};m===null&&(a[c]=null);continue}let y=p(`${n}.${d}`,m);if(y!==null)return {error:y};a[c]=m;}let s=a.start_date,i=a.end_date;return typeof s=="string"&&typeof i=="string"&&i<s?{error:`${n}.endDate must not be before startDate`}:{item:a}}o(Yd,"itemToWire");function Gd(e,t){if(!Array.isArray(t))return {error:`${e} must be an array (send [] to clear it)`};if(t.length>yl)return {error:`${e} has ${t.length} items; the server accepts at most ${yl}`};let r=[],n=new Set;for(let l=0;l<t.length;l+=1){let a=Yd(e,l,t[l]);if("error"in a)return a;let s=a.item.ref;if(typeof s=="string"){let i=s.trim();if(n.has(i))return {error:`${e}: ref ${JSON.stringify(i)} is used twice; a ref names one item`};n.add(i);}r.push(a.item);}return {items:r}}o(Gd,"listToWire");function Rl(e,t){let r=e,n={};for(let[s,i]of kl){let d=r[s];if(d!==void 0){if(d!==null){let c=Kd[s](s,d);if(c!==null)return {error:c}}n[i]=d;}}let l=r.birthDate!==void 0,a=r.birthDatePrecision!==void 0;if(l!==a||l&&r.birthDate===null!=(r.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[s,i]of xl){let d=r[s];if(d===void 0)continue;let c=Gd(s,d);if("error"in c)return c;n[i]=c.items;}return Object.keys(n).length>0&&t!==void 0&&fl(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}o(Rl,"petHealthToWire");var G=o(e=>typeof e=="string"?e:null,"str"),Dt=o((e,t)=>typeof t=="string"&&e.has(t)?t:null,"pick"),Jd=o(e=>typeof e=="boolean"?e:null,"bool");function Sr(e,t){return Array.isArray(e)?Object.freeze(e.flatMap(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return [];let n=t(r);return n===null?[]:[n]})):Object.freeze([])}o(Sr,"itemsFromWire");function bl(e){let t=G(e.name);return t===null||t.length===0?null:Object.freeze({ref:G(e.ref),name:t,dose:G(e.dose),frequency:G(e.frequency),startDate:G(e.start_date),endDate:G(e.end_date),notes:G(e.notes)})}o(bl,"medicationFromWire");function _l(e){let t=e.profile_version;return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:Dt(hl,e.sex),spayedNeutered:Jd(e.spayed_neutered),birthDate:G(e.birth_date),birthDatePrecision:Dt(Tl,e.birth_date_precision),activityLevel:Dt(Sl,e.activity_level),indoorOutdoor:Dt(El,e.indoor_outdoor),foodBrand:G(e.food_brand),foodType:G(e.food_type),microchipId:G(e.microchip_id),allergies:Sr(e.allergies,r=>{let n=G(r.allergen);return n===null||n.length===0?null:Object.freeze({ref:G(r.ref),allergen:n,severity:Dt(Cl,r.severity),notes:G(r.notes)})}),medications:Sr(e.medications,bl),supplements:Sr(e.supplements,bl),conditions:Sr(e.conditions,r=>{let n=G(r.condition_name);return n===null||n.length===0?null:Object.freeze({ref:G(r.ref),conditionName:n,diagnosedDate:G(r.diagnosed_date),notes:G(r.notes)})})})}o(_l,"petHealthFromWire");var Il=100,Ol=50,Al=100,Bl=50,Nl=500,Xd=128,Qd=6e4;function _e(e){return ue("validationFailed",{retryable:false,wireMessage:e})}o(_e,"invalid");function et(e,t,r){if(typeof t!="string")return _e(`${e} must be a string`);let n=Tr(t);return n<=r?null:_e(`${e} is ${n} characters; the server accepts at most ${r}`)}o(et,"checkString");function Cr(e,t,r){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=r?null:_e(`${e} must be a finite number between 0 and ${r}`)}o(Cr,"outOfRange");function Pl(e,t){if(typeof e!="string")return _e("pet_ref must be a string");if(e.trim().length===0)return _e("pet_ref must not be blank");if(hr(e))return _e("pet_ref contains an unpaired surrogate and cannot be encoded");if(t!=null&&typeof t!="object")return _e("profile must be an object");let r=[et("pet_ref",e,Xd)];return t?.name!==void 0&&r.push(et("name",t.name,Il)),t?.species!==void 0&&r.push(et("species",t.species,Ol)),t?.breed!==void 0&&r.push(et("breed",t.breed,Al)),t?.ageYears!==void 0&&r.push(Cr("age_years",t.ageYears,Bl)),t?.weightKg!==void 0&&r.push(Cr("weight_kg",t.weightKg,Nl)),r.find(n=>n!==null)??null}o(Pl,"validate");function Dl(e,t){let r=Rl(e,t);return "error"in r?{error:_e(r.error)}:r}o(Dl,"healthToWire");function Zd(e){if(typeof e!="object"||e===null)return {error:_e("patch must be an object")};let t=e,r=[["name","name",a=>et("name",a,Il)],["species","species",a=>et("species",a,Ol)],["breed","breed",a=>et("breed",a,Al)],["ageYears","age_years",a=>Cr("age_years",a,Bl)],["weightKg","weight_kg",a=>Cr("weight_kg",a,Nl)]],n={};for(let[a,s,i]of r){let d=t[a];if(d!==void 0){if(d!==null){let c=i(d);if(c!==null)return {error:c}}n[s]=d;}}let l=Dl(t,t.species);return "error"in l?l:(Object.assign(n,l.body),Object.keys(n).length===0?{error:_e("patch must change at least one field")}:{body:n})}o(Zd,"patchToWire");function eu(e){if(e==null)return {body:{}};let t=Dl(e,e.species);return "error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}o(eu,"toWire");var Re=o(e=>typeof e=="string"?e:null,"str"),kr=o(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function wl(e,t){let r=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:Re(r.pet_ref)??t,name:Re(r.name),species:Re(r.species),breed:Re(r.breed),ageYears:kr(r.age_years),weightKg:kr(r.weight_kg)})}o(wl,"fromWire");function Ll(e){if(typeof e!="object"||e===null)return null;let t=e,r=Re(t.pet_ref);return r===null||r.length===0?null:Object.freeze({petId:Re(t.pet_id),petRef:r,name:Re(t.name),species:Re(t.species),breed:Re(t.breed),ageYears:kr(t.age_years),weightKg:kr(t.weight_kg),updatedAt:Re(t.updated_at)})}o(Ll,"widgetPetFromWire");function tu(e){let t=Ll(e);return t===null?null:Object.freeze({...t,..._l(e)})}o(tu,"widgetPetProfileFromWire");function ru(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(t.flatMap(r=>{let n=Ll(r);return n===null?[]:[n]}))}o(ru,"petListFromWire");function Fl(e){return nu(_t({auth:e}),_t({auth:e,unaryTimeoutMs:Qd}))}o(Fl,"createPetsRepository");function nu(e,t=e){let r=o((l,a)=>a?{...l,signal:a}:l,"withSignal"),n=o(l=>Pl(l,void 0)??`/widget/v1/pets/${encodeURIComponent(l)}`,"petPath");return {async list(l){let a=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},l?.signal));return a.ok?F(ru(a.value)):P(a.error)},async registerPet(l,a,s){let i=Pl(l,a);if(i!==null)return P(i);let d=eu(a);if("error"in d)return P(d.error);let u={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(l)}`,body:d.body},p=await e.send("pets.registerPet",s?.signal?{...u,signal:s.signal}:u);return p.ok?F(wl(p.value,l)):P(p.error)},async updatePet(l,a,s){let i=n(l);if(typeof i!="string")return P(i);let d=Zd(a);if("error"in d)return P(d.error);let c=await e.send("pets.updatePet",r({method:"PATCH",path:i,body:d.body},s?.signal));return c.ok?F(wl(c.value,l)):P(c.error)},async getPetProfile(l,a){let s=n(l);if(typeof s!="string")return P(s);let i=await e.send("pets.getPetProfile",r({method:"GET",path:`${s}/profile`},a?.signal));if(!i.ok)return P(i.error);let d=tu(i.value);return d===null?P(ue("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):F(d)},async deletePet(l,a){let s=n(l);if(typeof s!="string")return P(s);let i=await e.send("pets.deletePet",r({method:"DELETE",path:s},a?.signal));return i.ok?F(void 0):P(i.error)},async eraseUserData(l){let a=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},l?.signal),{maxAttempts:1});return a.ok?F(void 0):P(a.error)}}}o(nu,"createPetsRepositoryOver");function xr(){let{runtime:e,userRef:t,activePet:r,scopeEpoch:n}=Xe(),l=react.useMemo(()=>Fl(e.registry.services.authFor(t)),[e,t,n]),[a,s]=react.useState({repository:l,pets:[],loading:true,error:null}),i=a.repository===l?a:{pets:[],loading:true,error:null},d=react.useRef(0),c=react.useCallback(async()=>{let p=++d.current;s(y=>({...y,repository:l,loading:true,error:null,pets:y.repository===l?y.pets:[]}));let m=await l.list();p===d.current&&s(m.ok?{repository:l,pets:m.value,loading:false,error:null}:y=>({repository:l,pets:y.repository===l?y.pets:[],loading:false,error:m.error}));},[l]);react.useEffect(()=>(c(),()=>{d.current+=1;}),[c]);let u=react.useMemo(()=>r===null?null:i.pets.find(p=>p.petRef===r)??null,[r,i.pets]);return react.useMemo(()=>({pets:i.pets,activePet:u,loading:i.loading,error:i.error,refresh:c}),[i.pets,i.loading,i.error,u,c])}o(xr,"useEverfurPets");var Ft=Object.freeze(["pet","issues","reason","clinician","time","review","booked"]),Ml=Object.freeze({petId:null,state:null,clinicianId:null,slot:null,holdExpiresAt:null,shareHealthRecords:false,idempotencyKey:null});function Un(e,t={}){let r=Object.freeze({...Ml,...t}),n=Vn(0,e);return Object.freeze({index:n,draft:r,furthestIndex:n})}o(Un,"initialTelevetBookingState");function Rr(e,t){return e==="pet"?t.ownedPetCount<=1:e==="issues"?t.withIssues!==true:false}o(Rr,"isSkipped");function _r(e){return Ft[e]}o(_r,"stepAt");function Vn(e,t){for(let r=e;r<Ft.length;r+=1){let n=_r(r);if(n&&!Rr(n,t))return r}return Ft.length-1}o(Vn,"nextVisible");function zl(e,t){for(let r=e;r>=0;r-=1){let n=_r(r);if(n&&!Rr(n,t))return r}return null}o(zl,"previousVisible");function Wn(e,t){return zl(e.index-1,t)!==null}o(Wn,"hasPreviousStep");function $n(e,t,r){switch(t.type){case "patch":{let n={...e.draft,...t.patch};return ("petId"in t.patch&&t.patch.petId!==e.draft.petId||"state"in t.patch&&t.patch.state!==e.draft.state||"clinicianId"in t.patch&&t.patch.clinicianId!==e.draft.clinicianId)&&e.draft.slot?Object.freeze({...e,draft:Object.freeze({...n,slot:null,holdExpiresAt:null,idempotencyKey:null})}):Object.freeze({...e,draft:Object.freeze(n)})}case "next":{let n=Vn(e.index+1,r);return Object.freeze({...e,index:n,furthestIndex:Math.max(e.furthestIndex,n)})}case "back":{if(_r(e.index)==="booked")return e;let n=zl(e.index-1,r);return n===null?e:Object.freeze({...e,index:n})}case "goTo":{let n=Ft.indexOf(t.step);if(n<0)return e;let l=Rr(t.step,r)?Vn(n,r):n;return Object.freeze({...e,index:l,furthestIndex:Math.max(e.furthestIndex,l)})}default:return e}}o($n,"televetBookingReducer");function Kn(e){return _r(e.index)??"pet"}o(Kn,"currentStep");function Mt(e,t){let r=t.trim();return !!e.petId&&!!e.clinicianId&&!!e.slot&&Ce(e.state)&&r.length>0&&r.length<=He}o(Mt,"canConfirm");function Pr(e,t){if(!e.holdExpiresAt)return false;let r=Date.parse(e.holdExpiresAt);return Number.isNaN(r)?false:r<=t}o(Pr,"isHoldExpired");function jl(e,t,r){return e.slot?.slotId!==t||e.holdExpiresAt===null||e.idempotencyKey===null?false:!Pr(e,r)}o(jl,"holdsSlot");var Hl=Object.freeze({slot:null,holdExpiresAt:null,idempotencyKey:null}),su=tn();function qn(e){return `televet.book.${su()}.${e}`}o(qn,"televetBookingKey");function Yn(e,t,r){let n=r?.version?.trim()??"";return !e||!t||n.length===0?Object.freeze({}):Object.freeze({state_attested:true,cancellation_policy_version:n})}o(Yn,"attestation");var du=Object.freeze([{id:"itchy-skin",label:"Itchy skin and allergies"},{id:"upset-stomach",label:"Upset stomach"},{id:"ear-infections",label:"Ear infections"},{id:"anxiety",label:"Anxiety and behavior"},{id:"parasites",label:"Fleas, ticks, and heartworm"},{id:"joint-pain",label:"Joint pain and mobility"},{id:"eye-issues",label:"Eye issues"},{id:"urinary",label:"Urinary issues"},{id:"surgery-aftercare",label:"Surgery aftercare"},{id:"senior-dog-care",label:"Senior dog care",species:"dog"}]),uu="other";function cu(e){let t=e?.trim().toLowerCase()??"";return t.startsWith("dog")?"dog":t.startsWith("cat")?"cat":null}o(cu,"televetIssueSpecies");function Vl(e){let t=cu(e),r=du.filter(n=>!n.species||n.species===t).map(({id:n,label:l})=>Object.freeze({id:n,label:l}));return Object.freeze([...r,Object.freeze({id:uu,label:f.otherIssue})])}o(Vl,"televetIssueChips");function Ul(e,t){let r=e.filter(l=>l.trim().length>0),n=t.trim();return r.length===0?n:n.length===0?r.join(", "):`${r.join(", ")}
|
|
2
|
-
${n}`}o(Ul,"composeTelevetReason");function Be(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}o(Be,"parse");function yt(e){let t=Be(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}o(yt,"formatClock");function pu(e){let t=Be(e);return t?t.toLocaleDateString(void 0,{month:"long",day:"numeric"}):""}o(pu,"formatDate");var tt=10;function mt(e){let t=Be(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??"":""}o(mt,"formatZone");function fu(e){let t=Be(e);if(!t)return "";let r=new Date(t.getTime()+tt*6e4).toISOString(),n=mt(e),l=`${yt(e)} - ${yt(r)}`;return n&&n!==""?`${l} ${n}`:l}o(fu,"formatVisitRange");function Wl(e){let t=pu(e),r=[yt(e),mt(e)].filter(Boolean).join(" ");return [t,r].filter(Boolean).join(", ")}o(Wl,"formatWhen");function Te(e){let t=Be(e);return t?[t.toLocaleDateString(void 0,{weekday:"short"}),Wl(e)].filter(Boolean).join(", "):""}o(Te,"formatWhenWithDay");function $l(e){let t=Be(e);if(!t)return "";let r=t.toLocaleString(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"}),n=mt(e);return n?`${r} ${n}`:r}o($l,"formatShortDateTimeWithZone");function Kl(e){return [yt(e),mt(e)].filter(Boolean).join(" ")}o(Kl,"formatClockWithZone");function zt(e){let t=Be(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:"unknown"}o(zt,"localDayKey");function ql(e){let t=Be(e);return t===null?"":t.toLocaleDateString(void 0,{month:"long"})}o(ql,"formatMonthLabel");function Yl(e){let t=Be(e);return t===null?"":t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}o(Yl,"formatFullDayLabel");function Jl(e){let{draft:t,reasonText:r,book:n,stateAttested:l,termsAttested:a,cancellationPolicy:s,triage:i,goTo:d,releaseSlot:c,setFailure:u,setEmergency:p,setBookedConsult:m,onBooked:y}=e,b=react.useCallback(T=>{if(!Mt(t,r)||!t.idempotencyKey)return;if(Pr(t,Date.now())){u("expired"),d("time");return}let S=o(C=>{let k=ze(C);if(k.kind==="emergency"){p(k.categories);return}if(k.kind==="rate_limited"){u("rate_limited");return}u(k.kind==="not_entitled"?"not_entitled":k.kind==="slot_taken"?"taken":k.kind==="clinician_unavailable"?"clinician_unavailable":k.kind==="unavailable"?"unavailable":"failed"),k.kind==="slot_taken"&&(c(),d("time"));},"refuse");u(null),p(null),n.mutate({pet_id:t.petId,clinician_id:t.clinicianId,slot_id:t.slot.slotId,state:t.state,reason_text:r.trim(),species:null,media_refs:[],emergency_acknowledged:T||i.isAcknowledged(r),share_health_records:t.shareHealthRecords,...Yn(l,a,s)},t.idempotencyKey,{onSuccess:o(C=>{if(!dr(C)){S(ir(C.status));return}m(C),d("booked"),y?.(C);},"onSuccess"),onError:o(C=>S(lr(C)),"onError")});},[t,r,n,l,a,s,i,d,c,u,p,m,y]),h=react.useCallback(()=>b(false),[b]);return {submitBooking:b,confirm:h}}o(Jl,"useBookingSubmit");function mu(e){if(e.httpStatus===409)return Object.freeze({failure:"taken"});switch(ze(e).kind){case "slot_taken":return Object.freeze({failure:"taken"});case "rate_limited":return Object.freeze({failure:"rate_limited"});case "not_entitled":return Object.freeze({failure:"not_entitled"});case "unavailable":return Object.freeze({failure:"unavailable"});default:return Object.freeze({failure:"failed"})}}o(mu,"televetHoldFailure");function Xl(e){let{draft:t,hold:r,dispatch:n,setFailure:l,refetchSlots:a}=e;return react.useCallback(s=>{if(l(null),jl(t,s.slotId,Date.now())){n({type:"next"});return}r.mutate(s.slotId,{onSuccess:o(i=>{n({type:"patch",patch:{slot:s,holdExpiresAt:i.expiresAt,idempotencyKey:qn(s.slotId)}}),n({type:"next"});},"onSuccess"),onError:o(i=>{let d=mu(i);l(d.failure),d.failure==="taken"&&a();},"onError")});},[t,r,n,l,a])}o(Xl,"useSlotHold");function Gn(e){return Object.freeze(e==="dark"?{title:ie.noCliniciansTitle,message:ie.noCliniciansBody,retryLabel:ie.noCliniciansRetryCta,interestReason:null}:{title:ie.noCliniciansTitle,message:ie.noCliniciansRegionBody,retryLabel:null,interestReason:"no_licensed_vet"})}o(Gn,"televetEmptyRosterView");function Jn(e){return e?"roster":"dark"}o(Jn,"televetEmptyRosterCause");var jt=Object.freeze({failed:0,refused:Object.freeze({size:0,type:0,unreadable:0})});function Xn(e){let{failed:t,refused:r}=e;return t<=0&&r.size<=0&&r.type<=0&&r.unreadable<=0}o(Xn,"isMediaShortfallEmpty");function Qn(e){let t=o(n=>Number.isFinite(n)&&n>0?Math.floor(n):0,"count"),r=ie.media;return [{n:t(e.failed),one:r.droppedTemplate,many:r.droppedPluralTemplate},{n:t(e.refused.size),one:r.refusedSizeTemplate,many:r.refusedSizePluralTemplate},{n:t(e.refused.type),one:r.refusedTypeTemplate,many:r.refusedTypePluralTemplate},{n:t(e.refused.unreadable),one:r.refusedUnreadableTemplate,many:r.refusedUnreadablePluralTemplate}].filter(n=>n.n>0).map(n=>Y(n.n===1?n.one:n.many,{n:String(n.n)}))}o(Qn,"televetMediaShortfallLines");function wr(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return t===0?jt:Object.freeze({failed:t,refused:jt.refused})}o(wr,"mediaShortfallFromUnsentPicks");function gu(e,t){let r=wr(t);return r.failed===0?e:Object.freeze({failed:e.failed+r.failed,refused:e.refused})}o(gu,"withUnsentPicks");function to(e){let[t,r]=react.useState(false),[n,l]=react.useState(false),[a,s]=react.useState(null),i=react.useRef(null),d=react.useRef(null),c=react.useRef(true);react.useEffect(()=>(c.current=true,()=>{c.current=false,d.current?.abort(),d.current=null;}),[]);let u=react.useCallback(()=>{d.current?.abort(),d.current=null,c.current&&l(false);},[]),p=react.useCallback(async T=>{if(d.current!==null)return false;let S=T.trim();if(a!==null&&a===S||!e)return true;let C=i.current!==null&&i.current.reason===S?i.current.emergency:null;if(C===null){let k=new AbortController;d.current=k,l(true);try{let B=await e(S,k.signal);if(k.signal.aborted||!c.current)return !1;B===null?C=!1:(C=B.isEmergency||B.fallback,i.current=Object.freeze({reason:S,emergency:C}));}catch{if(k.signal.aborted||!c.current)return false;C=false;}finally{d.current===k&&(d.current=null,c.current&&l(false));}}return C===true?(r(true),false):true},[a,e]),m=react.useCallback(T=>{s(T.trim()),r(false);},[]),y=react.useCallback(()=>r(false),[]),b=react.useCallback(()=>{u(),i.current=null,s(null),r(false);},[u]),h=react.useCallback(T=>a!==null&&a===T.trim(),[a]);return {open:t,checking:n,check:p,acknowledge:m,close:y,cancel:u,reset:b,isAcknowledged:h}}o(to,"useEarlyTriage");function Su(e){let t=e?.trim().toUpperCase()??"";return /^[A-Z]{2}$/.test(t)?t:null}o(Su,"normalizeStateCode");function ro(e,t){let r=Su(e),[n,l]=react.useState(()=>Object.freeze({})),a=react.useRef(0),s=react.useRef(null),i=react.useCallback(d=>{if(!t||r===null)return null;let c=`${r}:${d}`;s.current!==null&&s.current!==c&&(a.current+=1),s.current=c;let u=n[c]??"idle";return {joined:u==="joined",pending:u==="pending",failed:u==="failed",onPress:o(()=>{if(u==="pending"||u==="joined")return;let p=a.current+=1;l(m=>Object.freeze({...m,[c]:"pending"})),(async()=>{let m=false;try{m=await t(r,d);}catch{m=false;}a.current===p&&l(y=>Object.freeze({...y,[c]:m?"joined":"failed"}));})();},"onPress")}},[r,n,t]);return react.useMemo(()=>({actionFor:i}),[i])}o(ro,"useStateInterest");var vt=2;function Zl(e){return typeof e!="number"||!Number.isInteger(e)?vt:e<1?1:e>6?6:e}o(Zl,"headingLevel");function Ht(e){return e>=6?6:e+1}o(Ht,"nextHeadingLevel");function le(e){return `h${String(e)}`}o(le,"headingTag");var ku=Ht(vt),no=react.createContext(ku);function ye(){return react.useContext(no)}o(ye,"useNestedHeadingLevel");function xu(e,t){if(e===void 0)return {};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}o(xu,"slotBox");function ea(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(ea,"slotText");function ta(e,t){let r=xu(e,t),n={};return r.backgroundColor!==void 0&&(n.backgroundColor=r.backgroundColor),r.borderColor!==void 0&&(n.border=`${r.borderWidth??1}px solid ${r.borderColor}`),r.borderRadius!==void 0&&(n.borderRadius=r.borderRadius),n}o(ta,"slotBoxCss");var ae=44;function L(){let e=R();return react.useMemo(()=>_u(e),[e])}o(L,"useBookingStyles");function _({label:e,onPress:t,kind:r="primary",disabled:n=false,loading:l=false,fullWidth:a=true,accessibilityLabel:s,describedBy:i,testID:d,style:c}){let u=L(),p=n||l;return jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:p,"aria-busy":l||void 0,...s&&s!==e?{"aria-label":s}:{},...i?{"aria-describedby":i}:{},"data-testid":d,style:{...u.button,...r==="primary"?u.buttonPrimary:r==="danger"?u.buttonDanger:u.buttonSecondary,...a?u.buttonFull:u.buttonAuto,...p?u.buttonDisabled:null,...c},children:e})}o(_,"TelevetButton");function K({title:e,message:t,actionLabel:r,onAction:n,testID:l}){let a=L(),s=le(ye()),i=typeof r=="string"&&r.length>0&&typeof n=="function";return jsxRuntime.jsxs("div",{style:a.stateCard,"data-testid":l,children:[jsxRuntime.jsx(s,{style:a.stateTitle,children:e}),t?jsxRuntime.jsx("p",{style:a.stateMessage,children:t}):null,i?jsxRuntime.jsx(_,{label:r,onPress:n,kind:"secondary",fullWidth:false}):null]})}o(K,"TelevetStateCard");function me({height:e,width:t="100%",testID:r}){let n=L();return jsxRuntime.jsx("span",{"aria-hidden":"true","data-testid":r,style:{...n.skeleton,height:e,width:t}})}o(me,"TelevetSkeletonBlock");function q({message:e,assertive:t=false,testID:r,style:n}){let l=L();return jsxRuntime.jsx("p",{role:t?"alert":"status","data-testid":r,style:{...l.failure,...n},children:e})}o(q,"TelevetFailureLine");function _u(e){let{color:t,space:r,radius:n,type:l,slots:a}=e,{size:s,lineHeight:i}=l,d=o(c=>`${String(c)}px`,"rem");return {screen:{...ft,display:"flex",flexDirection:"column",minHeight:0,flex:"1 1 auto",gap:d(r.md),paddingLeft:d(r.xl),paddingRight:d(r.xl),boxSizing:"border-box"},stepFill:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:d(r.md)},list:{display:"flex",flexDirection:"column",gap:d(r.sm)},button:{minHeight:ae,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:d(r.sm),paddingLeft:d(r.xl),paddingRight:d(r.xl),paddingTop:d(r.sm),paddingBottom:d(r.sm),borderRadius:d(n.pill),borderStyle:"solid",borderWidth:0,cursor:"pointer",textAlign:"center",...v(e,"medium"),fontSize:d(s.body),lineHeight:String(i.snug),boxSizing:"border-box"},buttonFull:{alignSelf:"stretch",width:"100%"},buttonAuto:{alignSelf:"flex-start",minWidth:ae},buttonPrimary:{backgroundColor:t.primary,color:t.onPrimary,...ta(a.primaryButton),...ea(a.primaryButton)},buttonSecondary:{borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",color:t.brand,...a.primaryButton?.borderRadius===void 0?null:{borderRadius:d(a.primaryButton.borderRadius)},...a.primaryButton?.borderColor===void 0?null:{borderColor:a.primaryButton.borderColor}},buttonDanger:{backgroundColor:t.danger,color:t.onPrimary},buttonDisabled:{opacity:.45,cursor:"not-allowed"},stateCard:{minHeight:140,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:d(r.sm),padding:d(r.lg),borderRadius:d(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,boxSizing:"border-box"},stateTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:d(s.subtitle),lineHeight:String(i.snug)},stateMessage:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(i.normal)},skeleton:{display:"block",borderRadius:d(n.md),backgroundColor:t.skeleton,flexShrink:0},failure:{margin:0,...v(e,"regular"),color:t.danger,fontSize:d(s.caption),lineHeight:String(i.normal)},stepTitle:{margin:0,...v(e,"bold"),color:t.brand,fontSize:d(s.verdict),lineHeight:String(i.snug),textAlign:"center"},stepHelp:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(i.normal),textAlign:"center"},divider:{height:1,backgroundColor:t.brandBorder,flexShrink:0},scrollRoot:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},scrollBody:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},scrollFooter:{flexShrink:0,paddingTop:d(r.md),paddingBottom:d(r.lg)}}}o(_u,"makeBookingStyles");function Or({petName:e,primaryVet:t,onFindEmergencyVet:r}){return r?true:t!=null&&(e?.trim()??"").length>0}o(Or,"hasTelevetEmergencyExit");function Vt({petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:n}){let l=R(),a=react.useMemo(()=>Bu(l),[l]),s=e?.trim()??"",i=`${react.useId()}-primary-vet-hint`;return jsxRuntime.jsxs("div",{style:a.exits,"data-testid":`${n}-exits`,children:[r?jsxRuntime.jsx("button",{type:"button",onClick:()=>{tr(r);},style:{...a.card,...a.cardButton},"data-testid":`${n}-find-vet`,children:jsxRuntime.jsx("span",{style:a.title,children:dt.findEmergencyVet})}):null,null,t!=null&&s.length>0?jsxRuntime.jsx(Ou,{petName:s,vet:t,hintId:i,local:a,testIDPrefix:n}):null]})}o(Vt,"TelevetEmergencyExits");function Ou({petName:e,vet:t,hintId:r,local:n,testIDPrefix:l}){let a=Y(f.emergency.exitPrimaryVetTitle,{petName:e}),s=t.detail?.trim()??"",i=jsxRuntime.jsxs("span",{style:n.text,children:[jsxRuntime.jsx("span",{style:n.title,children:a}),s.length>0?jsxRuntime.jsx("span",{style:n.detail,children:s}):null]});if(!t.dial)return jsxRuntime.jsx("div",{style:n.card,"data-testid":`${l}-primary-vet`,children:i});let d=t.dial;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>{tr(d);},"aria-label":s.length>0?`${a}, ${s}`:a,"aria-describedby":r,style:{...n.card,...n.cardButton},"data-testid":`${l}-primary-vet-call`,children:[i,jsxRuntime.jsx("span",{id:r,style:Au,children:f.emergency.startCallHint})]})}o(Ou,"PrimaryVetCard");var Au=Object.freeze({position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});function Bu(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l;return {exits:{display:"flex",flexDirection:"column",gap:r.sm},card:{display:"flex",alignItems:"center",gap:r.sm,minHeight:ae,padding:r.lg,borderRadius:n.md,border:`1px solid ${t.brandBorder}`,background:t.surface,color:t.text.primary,textAlign:"start",textDecoration:"none",boxSizing:"border-box"},cardButton:{width:"100%",cursor:"pointer",font:"inherit",position:"relative"},text:{display:"flex",flexDirection:"column",gap:r.xs,flexShrink:1},title:{...v(e,"medium"),color:t.text.primary,fontSize:a.body,lineHeight:`${String(a.body*s.normal)}px`},detail:{...v(e,"regular"),color:t.text.metaCool,fontSize:a.caption,lineHeight:`${String(a.caption*s.normal)}px`}}}o(Bu,"makeExitStyles");function na({petName:e,primaryVet:t,onFindEmergencyVet:r,onContinue:n}){let l=R(),a=L(),s=react.useMemo(()=>ao(l),[l]),i=le(ye()),d=Or({petName:e,primaryVet:t,onFindEmergencyVet:r})?f.emergency.lede:f.emergency.ledeWithoutExits;return jsxRuntime.jsxs("section",{role:"alert",style:{...a.stepFill,...s.emergencyPanel},"data-testid":"televet-early-emergency",children:[jsxRuntime.jsx(i,{style:s.emergencyTitle,children:f.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:s.emergencyLede,children:d}),jsxRuntime.jsx(Vt,{petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:"televet-early-emergency"}),jsxRuntime.jsx(_,{label:f.emergency.keepBookingCta,kind:"secondary",onPress:n,testID:"televet-early-emergency-continue"})]})}o(na,"TelevetEarlyEmergency");function io({action:e,testIDPrefix:t}){let r=R(),n=react.useMemo(()=>ao(r),[r]),l=le(ye());return e===null?null:e.joined?jsxRuntime.jsxs("div",{role:"status","data-testid":`${t}-joined`,style:n.interestFeedback,children:[jsxRuntime.jsx(l,{style:n.interestJoinedTitle,children:f.stateInterest.joinedTitle}),jsxRuntime.jsx("p",{style:n.interestBody,children:f.stateInterest.joinedBody})]}):jsxRuntime.jsxs("div",{"data-testid":t,style:n.interestAction,children:[jsxRuntime.jsx(_,{label:e.pending?f.stateInterest.submitting:f.stateInterest.cta,kind:"secondary",loading:e.pending,disabled:e.pending,onPress:e.onPress,testID:`${t}-submit`}),e.failed?jsxRuntime.jsx(q,{message:f.stateInterest.failed,assertive:true,testID:`${t}-error`}):null]})}o(io,"TelevetStateInterestAction");function oa({cause:e,onRetry:t,stateInterest:r=null}){let n=Gn(e);return jsxRuntime.jsxs("div",{"data-testid":"televet-clinicians-empty",children:[jsxRuntime.jsx(K,{title:n.title,message:n.message,...n.retryLabel!==null&&t?{actionLabel:n.retryLabel,onAction:t}:{}}),n.interestReason!==null?jsxRuntime.jsx(io,{action:r??null,testIDPrefix:"televet-state-interest-no-licensed-vet"}):null]})}o(oa,"TelevetClinicianEmptyState");function Nu({onCheckAvailability:e}){return jsxRuntime.jsx(lo,{...e?{onCheckAvailability:e}:{}})}o(Nu,"TelevetEntitlementInterestState");function lo({onCheckAvailability:e,renderUnavailable:t}){let r=L();return jsxRuntime.jsxs("div",{"data-testid":"televet-booking-not-entitled",style:r.list,children:[t?t():jsxRuntime.jsx(K,{title:f.bookingPausedTitle}),e?jsxRuntime.jsx(_,{label:f.checkAvailabilityCta,kind:"secondary",onPress:e,testID:"televet-check-state-availability"}):null]})}o(lo,"EntitlementPausedState");function Ut({shortfall:e,testIDPrefix:t}){let r=R(),n=react.useMemo(()=>ao(r),[r]);if(Xn(e))return null;let l=Qn(e);return l.length===0?null:jsxRuntime.jsx("ul",{role:"status",style:n.mediaNotice,"data-testid":`${t}-media-notice`,children:l.map((a,s)=>jsxRuntime.jsx("li",{style:n.mediaLine,"data-testid":`${t}-media-line-${String(s)}`,children:a},a))})}o(Ut,"TelevetMediaDropNotice");function ao(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l;return {emergencyPanel:{display:"flex",flexDirection:"column",gap:r.sm,padding:r.lg,borderRadius:n.lg,border:`2px solid ${t.danger}`,background:t.surface},emergencyTitle:{...v(e,"medium"),margin:0,color:t.danger,fontSize:a.heading,lineHeight:`${String(a.heading*s.snug)}px`},emergencyLede:{...v(e,"regular"),margin:0,color:t.text.primary,fontSize:a.subtitle,lineHeight:`${String(a.subtitle*s.normal)}px`},interestAction:{display:"flex",flexDirection:"column",gap:r.sm,marginTop:r.sm},interestFeedback:{display:"flex",flexDirection:"column",gap:r.xs,marginTop:r.sm},interestJoinedTitle:{...v(e,"medium"),margin:0,color:t.brand,fontSize:a.body,lineHeight:`${String(a.body*s.snug)}px`},interestBody:{...v(e,"regular"),margin:0,color:t.text.metaCool,fontSize:a.body,lineHeight:`${String(a.body*s.normal)}px`},mediaNotice:{display:"flex",flexDirection:"column",gap:r.xs,margin:0,padding:0,listStyle:"none"},mediaLine:{...v(e,"regular"),color:t.text.metaCool,fontSize:a.caption,lineHeight:`${String(a.caption*s.normal)}px`}}}o(ao,"makeEdgeStyles");function ia(e){let{surfaceUnavailable:t,notEntitled:r,policyBlocked:n,triageOpen:l,step:a}=e;return t||r&&a!=="clinician"||n?true:a==="reason"&&l}o(ia,"televetBookingGateApplies");function la({state:e,petName:t,primaryVet:r,onFindEmergencyVet:n,stateInterest:l=null,onCheckAvailability:a,onAcknowledgeEmergency:s,renderUnavailable:i}){let d=L(),{surfaceUnavailable:c,notEntitled:u,policyBlocked:p,triageOpen:m,step:y}=e;return c?jsxRuntime.jsx("div",{style:d.stepFill,"data-testid":"televet-booking-unavailable",children:i?i():jsxRuntime.jsx(K,{title:f.bookingPausedTitle})}):u&&y!=="clinician"?jsxRuntime.jsx(lo,{...a?{onCheckAvailability:a}:{},...i?{renderUnavailable:i}:{}}):p?jsxRuntime.jsxs("div",{"data-testid":"televet-booking-state-blocked",children:[jsxRuntime.jsx(K,{title:f.stateBlockedTitle}),jsxRuntime.jsx(io,{action:l,testIDPrefix:"televet-state-interest-state-blocked"})]}):y==="reason"&&m?jsxRuntime.jsx(na,{...t!==void 0?{petName:t}:{},...r?{primaryVet:r}:{},onFindEmergencyVet:n,onContinue:s}):null}o(la,"TelevetBookingGate");function aa(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}o(aa,"televetClinicianOutcomeApplies");function sa({state:e,cause:t,locationStatus:r,onRequestLocation:n,onRetry:l,stateInterest:a=null,renderUnavailable:s}){return e.noState?jsxRuntime.jsx("div",{"data-testid":"televet-booking-location-unknown",children:jsxRuntime.jsx(K,{title:r==="blocked"?f.locationBlockedTitle:r==="unavailable"?f.locationUnavailableTitle:f.locationUnknownTitle,message:r==="blocked"?f.locationBlockedBody:r==="unavailable"?f.locationUnavailableBody:f.locationUnknownBody,actionLabel:n&&r!=="blocked"?f.locationUnknownCta:void 0,onAction:r==="blocked"?void 0:n})}):e.isEmpty?jsxRuntime.jsx(oa,{cause:t,onRetry:l,stateInterest:a}):jsxRuntime.jsx(lo,{...s?{renderUnavailable:s}:{}})}o(sa,"TelevetClinicianOutcome");function da(e){return `televet-consult-${e}`}o(da,"televetConsultCalendarKey");function uo({consult:e,petName:t,onDone:r,onAddToCalendar:n,canJoinInApp:l=false,lengthMinutes:a}){let s=R(),i=L(),d=react.useMemo(()=>Mu(s),[s]),c=`${react.useId()}-booked-title`,u=le(ye()),[p,m]=react.useState("idle"),y=o(async()=>{if(!n)return;m("saving");let h=new Date(e.scheduledAt);if(Number.isNaN(h.getTime())){m("failed");return}let T=typeof a=="number"&&Number.isFinite(a)&&a>0?a:tt,S=await rr(n,{key:da(e.consultId),title:f.visit.title,startDate:h,endDate:new Date(h.getTime()+T*6e4),alarmOffsetMinutes:-30});if(!S.ok){m("failed");return}m(S.value===true?"saved":S.value==="handed-off"?"idle":"failed");},"addToCalendar"),b=[f.booked.remindPromise,Y(f.booked.summaryPromise,{pet:t??""}),...l?[f.booked.joinPromise]:[]];return Oe()?jsxRuntime.jsxs("section",{style:d.screen,"aria-labelledby":c,"data-testid":"televet-booked",children:[jsxRuntime.jsx("div",{style:d.header,children:jsxRuntime.jsx(_,{label:f.doneCta,kind:"secondary",fullWidth:false,onPress:r,testID:"televet-booked-done"})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:d.avatar}),jsxRuntime.jsx(u,{id:c,style:d.title,children:e.clinicianName?Y(f.bookedHeadingTemplate,{vet:e.clinicianName}):f.bookedTitle}),jsxRuntime.jsx("p",{style:d.when,children:jsxRuntime.jsx("time",{dateTime:e.scheduledAt,children:Te(e.scheduledAt)})}),jsxRuntime.jsx("ol",{style:d.steps,"data-testid":"televet-booked-steps",children:b.map((h,T)=>jsxRuntime.jsxs("li",{style:d.step,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:d.stepNumber,children:String(T+1)}),jsxRuntime.jsx("span",{style:d.stepText,children:h.trim()})]},h))}),jsxRuntime.jsxs("div",{style:d.actions,children:[n?jsxRuntime.jsx(_,{label:p==="saved"?f.booked.calendarAdded:f.addToCalendarCta,kind:"primary",loading:p==="saving",disabled:p==="saving"||p==="saved",onPress:()=>{y();},testID:"televet-booked-calendar"}):null,p==="failed"?jsxRuntime.jsx("p",{role:"status",style:{...i.failure,...d.calendarNote},"data-testid":"televet-booked-calendar-failed",children:f.booked.calendarFailedBody}):null,jsxRuntime.jsx(_,{label:t?Y(f.booked.backToPet,{pet:t}):f.doneCta,kind:"secondary",onPress:r,testID:"televet-booked-back"})]})]}):jsxRuntime.jsx("div",{style:d.screen,"data-testid":"televet-booked-copy-unapproved"})}o(uo,"TelevetBookedScreen");function Mu(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {screen:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:i(r.md),paddingLeft:i(r.xl),paddingRight:i(r.xl),boxSizing:"border-box"},header:{display:"flex",justifyContent:"flex-end",paddingBottom:i(r.lg)},avatar:{alignSelf:"center",width:120,height:120,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,borderStyle:"solid",borderWidth:2,borderColor:t.success,boxSizing:"border-box"},title:{margin:0,textAlign:"center",...v(e,"bold"),color:t.brand,fontSize:i(a.verdict),lineHeight:String(s.tight),letterSpacing:"-0.7px",paddingTop:i(r.lg)},when:{margin:0,textAlign:"center",...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.subtitle),lineHeight:String(s.normal)},steps:{listStyle:"none",margin:0,marginTop:i(r.xl),padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,display:"flex",flexDirection:"column",gap:i(r.lg),boxSizing:"border-box"},step:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:i(r.md)},stepNumber:{width:26,height:26,flexShrink:0,borderRadius:"50%",backgroundColor:t.primary,display:"inline-flex",alignItems:"center",justifyContent:"center",...v(e,"medium"),color:t.onPrimary,fontSize:i(a.caption),lineHeight:"1"},stepText:{flex:"1 1 auto",minWidth:0,...v(e,"regular"),color:t.brand,fontSize:i(a.body),lineHeight:String(s.normal)},actions:{marginTop:"auto",paddingBottom:i(r.xl),display:"flex",flexDirection:"column",gap:i(r.md)},calendarNote:{textAlign:"center"}}}o(Mu,"makeStyles");function ua(){let e=[];return {register(t){return e=[...e,t],()=>{e=e.filter(r=>r!==t);}},dispatch(){for(let t of [...e].reverse())try{if(t())return !0}catch{}return false}}}o(ua,"createTelevetBackChannel");var co=react.createContext(null);function Wt(e,t=true){let r=react.useContext(co),n=react.useRef(e);n.current=e,react.useEffect(()=>{if(!(r===null||!t))return r.register(()=>n.current())},[r,t]);}o(Wt,"useTelevetBackChannel");var Tt=Object.freeze({position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});var pa='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';function fa(e){return e.tagName==="DIALOG"}o(fa,"isDialogElement");function Br(e,t,r){let n=react.useRef(null),l=react.useRef(false),a=react.useRef(null),s=react.useRef(r);s.current=r;let i=react.useCallback(()=>{if(!l.current)return;l.current=false;let u=s.current===void 0?a.current:s.current.current;u&&u.isConnected&&u.focus(),(!u||!u.isConnected||document.activeElement===u)&&(a.current=null);},[]);react.useEffect(()=>{if(!e){i();return}let u=n.current;if(!l.current){let m=typeof document>"u"?null:document.activeElement;m!==null&&u!==null&&u.contains(m)||(a.current=m instanceof HTMLElement?m:null);}if(l.current=true,u===null)return;if(!fa(u)){u.contains(document.activeElement)||(u.querySelector(pa)??u).focus();return}let p=u;typeof p.showModal=="function"?p.open||p.showModal():p.setAttribute("open","");},[e,i]),react.useEffect(()=>i,[i]);let d=react.useCallback(u=>{let p=n.current;if(p===null)return;if(u.key==="Escape"&&!fa(p)){u.preventDefault(),u.stopPropagation(),t();return}if(u.key!=="Tab")return;let m=Array.from(p.querySelectorAll(pa)),y=m[0],b=m[m.length-1];if(!y||!b){u.preventDefault();return}let h=document.activeElement;u.shiftKey&&(h===y||!p.contains(h))?(u.preventDefault(),b.focus()):!u.shiftKey&&(h===b||!p.contains(h))&&(u.preventDefault(),y.focus());},[t]),c=react.useCallback(u=>{u.preventDefault(),t();},[t]);return {dialogRef:n,onKeyDown:d,onCancel:c}}o(Br,"useModalDialog");var fo=["pet","issues","reason","triage","clinician","time","review","booked"];function yo({step:e,furthestIndex:t,title:r,canGoBack:n,isDirty:l,onBack:a,onClose:s,onConfirmDiscard:i,headingLevel:d=vt,triageOpen:c=false}){let u=R(),p=react.useMemo(()=>ga(u),[u]),[m,y]=react.useState(false),b=react.useRef(null),T=`${react.useId()}-close-hint`,S=le(d);react.useEffect(()=>{if(!l||typeof window>"u")return;let I=o(N=>{N.preventDefault(),N.returnValue="";},"onBeforeUnload");return window.addEventListener("beforeunload",I),()=>window.removeEventListener("beforeunload",I)},[l]);let C=react.useCallback(()=>{if(!l){s();return}let I={title:f.chrome.discardTitle,body:f.chrome.discardBody,confirmLabel:f.chrome.discardConfirmCta,keepLabel:f.chrome.discardKeepCta};if(i){Promise.resolve(i(I)).then(N=>{N&&s();},()=>{});return}y(true);},[l,s,i]);Wt(()=>(C(),true));let k=fo.length,B=fo.indexOf(e==="reason"&&c?"triage":e)+1;return jsxRuntime.jsxs("div",{style:p.wrap,children:[jsxRuntime.jsxs("header",{style:p.bar,children:[jsxRuntime.jsx("div",{style:p.side,children:n?jsxRuntime.jsx("button",{type:"button",onClick:a,"data-testid":"televet-booking-back",style:{...p.tap,...p.back},children:f.backLabel}):null}),jsxRuntime.jsx(S,{style:Tt,children:r??f.navTitle}),jsxRuntime.jsxs("div",{style:p.progress,children:[jsxRuntime.jsx("p",{style:Tt,"data-testid":"televet-booking-progress-label",children:Y(f.loading.progressTemplate,{step:String(B),total:String(k)})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:p.segments,"data-testid":"televet-booking-rail",children:fo.map((I,N)=>jsxRuntime.jsx("span",{"data-lit":N<B?"true":"false",style:{...p.segment,...N<B?p.segmentLit:null}},I))})]}),jsxRuntime.jsxs("div",{style:{...p.side,...p.sideRight},children:[jsxRuntime.jsx("button",{type:"button",ref:b,onClick:C,"aria-label":f.close,"aria-describedby":T,"data-testid":"televet-booking-close",style:{...p.tap,...p.closeTap},children:jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),jsxRuntime.jsx("span",{id:T,style:Tt,children:f.chrome.closeHint})]})]}),m?jsxRuntime.jsx(qu,{onKeep:()=>y(false),onLeave:()=>{y(false),s();},returnFocusTo:b}):null]})}o(yo,"TelevetBookingChrome");function qu({onKeep:e,onLeave:t,returnFocusTo:r}){let n=R(),l=react.useMemo(()=>ga(n),[n]),{dialogRef:a,onKeyDown:s,onCancel:i}=Br(true,e,r),d=react.useId(),c=`${d}-discard-title`,u=`${d}-discard-body`;return jsxRuntime.jsxs("dialog",{ref:a,onKeyDown:s,onCancel:i,"aria-labelledby":c,"aria-describedby":u,"data-testid":"televet-booking-discard",style:l.dialog,children:[jsxRuntime.jsx("h2",{id:c,style:l.dialogTitle,children:f.chrome.discardTitle}),jsxRuntime.jsx("p",{id:u,style:l.dialogBody,children:f.chrome.discardBody}),jsxRuntime.jsxs("div",{style:l.dialogActions,children:[jsxRuntime.jsx(_,{label:f.chrome.discardKeepCta,onPress:e,kind:"primary",fullWidth:false,testID:"televet-booking-discard-keep"}),jsxRuntime.jsx(_,{label:f.chrome.discardConfirmCta,onPress:t,kind:"secondary",fullWidth:false,testID:"televet-booking-discard-leave"})]})]})}o(qu,"DiscardDialog");var Yu="Back";function ga(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(c=>`${String(c)}px`,"rem"),d={background:"transparent",borderStyle:"none",padding:0,cursor:"pointer"};return {wrap:{backgroundColor:t.surface,flexShrink:0},bar:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:i(r.lg),paddingRight:i(r.lg),minHeight:56,boxSizing:"border-box"},side:{width:64,flexShrink:0,display:"flex",alignItems:"center"},sideRight:{justifyContent:"flex-end"},tap:{...d,minHeight:ae,minWidth:ae,display:"inline-flex",alignItems:"center",justifyContent:"center"},closeTap:{justifyContent:"flex-end",color:t.text.primary},back:{...v(e,"bold"),color:t.brand,fontSize:i(a.body),paddingLeft:i(r.sm),paddingRight:i(r.sm)},progress:{flex:"1 1 auto",minWidth:0,display:"flex",justifyContent:"center"},segments:{display:"flex",alignItems:"center",gap:i(r.xs),width:"100%",maxWidth:480},segment:{display:"block",flex:"1 1 0",height:3,borderRadius:i(n.pill),backgroundColor:t.brandBorder},segmentLit:{backgroundColor:t.success},dialog:{margin:"auto",maxWidth:420,width:"calc(100% - 32px)",boxSizing:"border-box",padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface,color:t.text.primary},dialogTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},dialogBody:{margin:0,paddingTop:i(r.sm),...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.body),lineHeight:String(s.normal)},dialogActions:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.sm),paddingTop:i(r.lg)}}}o(ga,"makeStyles");function va(e){let t=[],r=Gu(e.ageYears);r!==null&&t.push(`${String(r)} yr${r===1?"":"s"} old`);let n=e.weightKg;typeof n=="number"&&Number.isFinite(n)&&n>0&&t.push(`${String(Math.round(n))} kg`);let l=e.breed?.trim();return l&&t.push(l),t.join(" \xB7 ")}o(va,"formatTelevetPetMetaLine");function Gu(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.floor(e);return t>=0?t:null}o(Gu,"wholeYears");function mo({media:e,onChange:t,onPickMedia:r,listLabel:n}){let l=R(),a=react.useMemo(()=>ec(l),[l]),s=cr-e.length,[i,d]=react.useState(false);if(!r)return null;let c=o(async()=>{if(!(i||s<=0)){d(true);try{let u=await rr(r,s);if(!u.ok||u.value===null||u.value.length===0)return;let p=new Set(e.map(y=>y.uri)),m=u.value.filter(y=>typeof y?.uri=="string"&&y.uri.length>0&&!p.has(y.uri));if(m.length===0)return;t([...e,...m].slice(0,cr));}finally{d(false);}}},"pick");return jsxRuntime.jsxs("ul",{role:"list","aria-label":n,style:a.row,children:[e.map((u,p)=>jsxRuntime.jsxs("li",{style:a.thumb,children:[jsxRuntime.jsx("img",{src:u.uri,alt:u.filename,style:a.thumbImage}),u.mimeType.startsWith("video/")?jsxRuntime.jsx("span",{"aria-hidden":"true",style:a.videoBadge,"data-testid":`televet-intake-media-video-${String(p)}`,children:Zu}):null,jsxRuntime.jsx("button",{type:"button",onClick:()=>t(e.filter((m,y)=>y!==p)),"aria-label":`${f.removePhotoLabel}: ${u.filename}`,"data-testid":`televet-intake-media-remove-${String(p)}`,style:a.remove,children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:a.removeGlyph,children:Qu})})]},`${u.uri}-${String(p)}`)),s>0?jsxRuntime.jsx("li",{style:a.addItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>{c();},disabled:i,"aria-busy":i||void 0,"data-testid":"televet-intake-add-media",style:{...a.dropzone,...i?a.dropzoneBusy:null},children:jsxRuntime.jsx("span",{style:a.dropzoneText,children:f.addPhotoCta})})}):null]})}o(mo,"TelevetIntakeMedia");var Qu="\xD7",Zu="\u25B6",Nr=92;function ec(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {row:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.md),paddingTop:i(r.sm)},thumb:{position:"relative",width:Nr,height:Nr,borderRadius:i(n.md),backgroundColor:t.surfaceSubtle},thumbImage:{width:"100%",height:"100%",objectFit:"cover",borderRadius:i(n.md),display:"block"},videoBadge:{position:"absolute",left:6,bottom:6,paddingLeft:6,paddingRight:6,paddingTop:2,paddingBottom:2,borderRadius:i(n.sm),backgroundColor:t.shadow,color:t.text.onBrand,fontSize:i(a.nano),lineHeight:"1"},addItem:{display:"flex"},remove:{position:"absolute",top:-8,right:-8,width:ae-16,height:ae-16,borderRadius:"50%",borderStyle:"none",backgroundColor:t.text.metaCool,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},removeGlyph:{...v(e,"medium"),color:t.surface,fontSize:i(a.subtitle),lineHeight:"1"},dropzone:{width:Nr,height:Nr,borderRadius:i(n.md),borderWidth:1,borderStyle:"dashed",borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:i(r.sm),paddingRight:i(r.sm),cursor:"pointer",boxSizing:"border-box"},dropzoneBusy:{opacity:.6,cursor:"progress"},dropzoneText:{...v(e,"mono"),color:t.text.metaCool,fontSize:i(a.nano),lineHeight:String(s.normal),letterSpacing:"0.3px",textAlign:"center"}}}o(ec,"makeStyles");function vo({slots:e,selectedDayKey:t,onSelectDay:r,groupLabel:n}){let l=R(),a=react.useMemo(()=>nc(l),[l]),s=react.useMemo(()=>Lr(e),[e]),i=react.useRef(new Map),d=s[0],c=t??d?.key??null,u=react.useRef(null),p=react.useRef(false);react.useEffect(()=>{if(p.current)return;let y=u.current,b=c===null?void 0:i.current.get(c);if(!y||!b||(p.current=true,c===d?.key))return;let h=b.getBoundingClientRect().left-y.getBoundingClientRect().left;y.scrollLeft+=h-(y.clientWidth-b.clientWidth)/2;},[c,d]);let m=react.useCallback(y=>{let b=y.key==="ArrowRight"||y.key==="ArrowDown"?1:y.key==="ArrowLeft"||y.key==="ArrowUp"?-1:0,h=y.key==="Home"?0:y.key==="End"?s.length-1:null;if(b===0&&h===null)return;let T=s.findIndex(k=>k.key===c);if(T<0)return;let S=h??Math.min(s.length-1,Math.max(0,T+b)),C=s[S];C===void 0||C.key===c||(y.preventDefault(),r(C),i.current.get(C.key)?.focus());},[s,c,r]);return d===void 0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{"aria-hidden":"true",style:a.month,"data-testid":"televet-day-strip-month",children:ql(d.iso)}),jsxRuntime.jsx("div",{ref:u,role:"radiogroup","aria-label":n,onKeyDown:m,style:a.strip,"data-testid":"televet-day-strip",children:s.map(y=>{let b=y.key===c;return jsxRuntime.jsxs("button",{ref:h=>{h?i.current.set(y.key,h):i.current.delete(y.key);},type:"button",role:"radio","aria-checked":b,tabIndex:b?0:-1,onClick:()=>r(y),"aria-label":Yl(y.iso),"data-testid":`televet-day-${y.key}`,style:{...a.day,...b?a.daySelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...a.dayWeekday,...b?a.dayTextSelected:null},children:y.weekday}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...a.dayNumber,...b?a.dayTextSelected:null},children:y.dayNumber})]},y.key)})})]})}o(vo,"TelevetDayStrip");function Lr(e){let t=new Map;for(let r of e){let n=zt(r.startsAt);if(t.has(n))continue;let l=new Date(r.startsAt);Number.isNaN(l.getTime())||t.set(n,Object.freeze({key:n,iso:r.startsAt,weekday:l.toLocaleDateString(void 0,{weekday:"short"}),dayNumber:String(l.getDate())}));}return Object.freeze([...t.values()])}o(Lr,"televetDaysFromSlots");function nc(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {month:{margin:0,textAlign:"center",...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug),paddingBottom:i(r.md)},strip:{display:"flex",flexDirection:"row",gap:i(r.sm),paddingLeft:i(r.xs),paddingRight:i(r.xs),overflowX:"auto",overscrollBehaviorX:"contain",scrollSnapType:"x proximity"},day:{width:52,flexShrink:0,scrollSnapAlign:"center",minHeight:ae,paddingTop:i(r.md),paddingBottom:i(r.md),borderRadius:i(n.md),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",boxSizing:"border-box"},daySelected:{backgroundColor:t.primary,borderColor:t.primary},dayWeekday:{...v(e,"mono"),color:t.text.secondary,fontSize:i(a.tiny),lineHeight:String(s.tight)},dayNumber:{...v(e,"medium"),color:t.brand,fontSize:i(a.heading),lineHeight:String(s.tight)},dayTextSelected:{color:t.onPrimary}}}o(nc,"makeStyles");function $t({slots:e,busySlotId:t,onPick:r,selectedSlot:n=null,header:l,dayGroupLabel:a,timeGroupLabel:s,rowTestIdPrefix:i="televet-slot",testID:d="televet-slot-list"}){let c=R(),u=react.useMemo(()=>ac(c),[c]),p=react.useMemo(()=>Lr(e),[e]),m=`${react.useId()}-zone`,[y,b]=react.useState(null),h=n?zt(n.startsAt):null,T=lc(p,[y,h])??p[0]?.key??null,S=react.useMemo(()=>T?e.filter(I=>zt(I.startsAt)===T):[],[e,T]),C=S[0],k=t!==null,B=C?mt(C.startsAt):null;return jsxRuntime.jsxs("div",{style:u.root,"data-testid":d,children:[l,jsxRuntime.jsx(vo,{slots:e,selectedDayKey:T,onSelectDay:I=>b(I.key),groupLabel:a}),B?jsxRuntime.jsx("p",{id:m,style:u.zone,"data-testid":"televet-slot-zone",children:B}):null,jsxRuntime.jsx("div",{style:u.gridScroll,children:jsxRuntime.jsx("ul",{role:"list","aria-label":s,...B?{"aria-describedby":m}:{},"aria-busy":k||void 0,style:u.grid,children:S.map(I=>{let N=t===I.slotId;return jsxRuntime.jsx("li",{style:u.gridItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>r(I),disabled:k,"aria-busy":N||void 0,"aria-label":Te(I.startsAt),"data-testid":`${i}-${I.slotId}`,style:{...u.chip,...N?u.chipBusy:null,...k&&!N?u.chipDisabled:null},children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...u.chipLabel,...N?u.chipLabelBusy:null},children:yt(I.startsAt)})})},I.slotId)})})})]})}o($t,"TelevetSlotPicker");function lc(e,t){for(let r of t)if(r!==null&&e.some(n=>n.key===r))return r;return null}o(lc,"firstOffered");function ac(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {root:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},gridScroll:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},zone:{margin:0,textAlign:"center",...v(e,"mono"),color:t.text.secondary,fontSize:i(a.tiny),lineHeight:String(s.normal),letterSpacing:"0.4px",paddingTop:i(r.md),paddingBottom:i(r.md)},grid:{listStyle:"none",margin:0,padding:0,paddingBottom:i(r.xl),display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.md)},gridItem:{display:"flex",flexGrow:1,flexBasis:"28%",minWidth:96},chip:{width:"100%",minHeight:48,borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:i(r.md),paddingRight:i(r.md),cursor:"pointer",boxSizing:"border-box"},chipBusy:{backgroundColor:t.primary,borderColor:t.primary},chipDisabled:{opacity:.45,cursor:"not-allowed"},chipLabel:{...v(e,"regular"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.tight)},chipLabelBusy:{color:t.onPrimary}}}o(ac,"makeStyles");function we(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {marker:{minHeight:1},chipRow:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:i(r.sm)},chip:{minHeight:44,padding:`${i(r.sm)} ${i(r.lg)}`,borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brand,backgroundColor:t.surface,color:t.brand,cursor:"pointer",...v(e,"regular"),fontSize:i(a.body),lineHeight:String(s.snug)},chipOn:{borderColor:t.accent,backgroundColor:t.accent,color:t.onAccent,...v(e,"bold")},stepScroll:{paddingBottom:i(r.md)},visuallyHiddenHeading:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},petRow:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",gap:i(r.sm),minHeight:64,paddingLeft:i(r.md),paddingRight:i(r.md),paddingTop:i(r.sm),paddingBottom:i(r.sm),borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",textAlign:"left",cursor:"pointer",boxSizing:"border-box"},petRowSelected:{borderColor:t.primary},petDisc:{width:28,height:28,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...v(e,"medium"),color:t.brand,fontSize:i(a.caption),lineHeight:"1"},petRowText:{display:"flex",flexDirection:"column",minWidth:0,gap:2},petRowName:{...v(e,"medium"),color:t.brand,fontSize:i(a.body),lineHeight:String(s.snug),overflowWrap:"anywhere"},petRowMeta:{...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.caption),lineHeight:String(s.normal),overflowWrap:"anywhere"},vetRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:i(r.md)},vetAvatar:{width:64,height:64,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...v(e,"medium"),color:t.brand,fontSize:i(a.heading),lineHeight:"1"},vetIdentity:{display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,gap:2},vetName:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},vetCredentials:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.caption),lineHeight:String(s.normal)},vetRating:{margin:0,...v(e,"regular"),color:t.text.secondary,fontSize:i(a.caption),lineHeight:String(s.normal)},vetBio:{margin:0,...v(e,"regular"),color:t.brand,fontSize:i(a.body),lineHeight:String(s.normal)},reasonInput:{width:"100%",minHeight:120,resize:"vertical",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:i(n.md),padding:i(r.md),backgroundColor:t.surface,...v(e,"regular"),color:t.text.primary,fontSize:i(a.body),lineHeight:String(s.normal),boxSizing:"border-box"},emergencyBanner:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i(r.md),padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.errorRed,backgroundColor:t.badgeBgCritical,boxSizing:"border-box"},emergencyTitle:{margin:0,...v(e,"bold"),color:t.errorRed,fontSize:i(a.subtitle),lineHeight:String(s.snug)},emergencyLede:{margin:0,...v(e,"regular"),color:t.text.primary,fontSize:i(a.body),lineHeight:String(s.normal)}}}o(we,"makeLocalStyles");function it({label:e,value:t,last:r=false,testID:n}){let l=R(),a=react.useMemo(()=>So(l),[l]);return jsxRuntime.jsxs("div",{style:{...a.row,...r?a.rowLast:null},"data-testid":n,children:[jsxRuntime.jsx("dt",{style:a.rowLabel,children:e}),jsxRuntime.jsx("dd",{style:a.rowValue,children:t})]})}o(it,"TelevetSummaryRow");function Kt({label:e,checked:t,onToggle:r,testID:n}){let l=R(),a=react.useMemo(()=>So(l),[l]);return jsxRuntime.jsxs("label",{style:a.consent,children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.currentTarget.checked),"data-testid":n,style:Tt}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...a.box,...t?a.boxChecked:null},children:t?jsxRuntime.jsx("span",{style:a.tick,children:dc}):null}),jsxRuntime.jsx("span",{style:a.consentLabel,children:e})]})}o(Kt,"TelevetConsentCheckbox");var dc="\u2713";function To({children:e,testID:t}){let r=R(),n=react.useMemo(()=>So(r),[r]);return jsxRuntime.jsx("dl",{style:n.card,"data-testid":t,children:e})}o(To,"TelevetSummaryCard");function So(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {card:{margin:0,borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,paddingLeft:i(r.lg),paddingRight:i(r.lg),boxSizing:"border-box"},row:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:i(r.lg),paddingTop:i(r.lg),paddingBottom:i(r.lg),borderBottomStyle:"solid",borderBottomWidth:1,borderBottomColor:t.brandBorder},rowLast:{borderBottomWidth:0},rowLabel:{margin:0,flexShrink:0,...v(e,"regular"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},rowValue:{margin:0,marginInlineStart:0,minWidth:0,textAlign:"right",overflowWrap:"anywhere",...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},consent:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:i(r.md),minHeight:ae,padding:i(r.lg),borderRadius:i(n.md),backgroundColor:t.surfaceSubtle,cursor:"pointer",boxSizing:"border-box"},box:{width:22,height:22,flexShrink:0,borderRadius:i(n.xs),borderStyle:"solid",borderWidth:1.5,borderColor:t.brand,backgroundColor:t.surface,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},boxChecked:{backgroundColor:t.primary,borderColor:t.primary},tick:{...v(e,"bold"),color:t.onPrimary,fontSize:i(a.caption),lineHeight:"1"},consentLabel:{flex:"1 1 auto",minWidth:0,overflowWrap:"anywhere",...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.body),lineHeight:String(s.normal)}}}o(So,"makeStyles");function Eo({headingRef:e,when:t,lengthMinutes:r,clinician:n,petName:l,reason:a,shareRecords:s,onToggleShare:i,stateCode:d,stateAttested:c,onToggleStateAttest:u,cancellationTerms:p,termsAttested:m,onToggleTermsAttest:y,canConfirm:b,busy:h,failure:T,onConfirm:S,emergency:C,onAcknowledgeEmergency:k,onSeeOtherVets:B,mediaShortfall:I=jt,primaryVet:N,onFindEmergencyVet:z}){let j=L(),J=R(),D=react.useMemo(()=>we(J),[J]),X=Or({petName:l,primaryVet:N,onFindEmergencyVet:z})?f.emergency.lede:f.emergency.ledeWithoutExits;return jsxRuntime.jsxs("div",{style:j.scrollRoot,"data-testid":"televet-booking-review",children:[jsxRuntime.jsx("div",{style:j.scrollBody,"data-testid":"televet-booking-review-scroll",children:jsxRuntime.jsxs("div",{style:j.list,children:[jsxRuntime.jsx(lt,{headingRef:e,style:j.stepTitle,children:f.reviewHeading}),jsxRuntime.jsxs(To,{testID:"televet-review-summary",children:[l?jsxRuntime.jsx(it,{label:f.summaryPet,value:l,testID:"televet-review-row-pet"}):null,n?jsxRuntime.jsx(it,{label:f.summaryVet,value:n,testID:"televet-review-row-vet"}):null,jsxRuntime.jsx(it,{label:f.summaryWhen,value:t,testID:"televet-review-row-when"}),jsxRuntime.jsx(it,{label:f.summaryLength,value:Y(f.summaryLengthTemplate,{n:String(r)}),testID:"televet-review-row-length"}),a?jsxRuntime.jsx(it,{label:f.summaryReason,value:a,last:true,testID:"televet-review-row-reason"}):null]}),jsxRuntime.jsx(Kt,{label:f.shareRecordsOff,checked:s,onToggle:i,testID:"televet-review-share-records"}),p?jsxRuntime.jsx(Kt,{label:p,checked:m,onToggle:y,testID:"televet-review-terms-attest"}):null,d?jsxRuntime.jsx(Kt,{label:Y(f.stateAttestTemplate,{state:d}),checked:c,onToggle:u,testID:"televet-review-state-attest"}):null,jsxRuntime.jsx(Ut,{shortfall:I,testIDPrefix:"televet-review"}),C?jsxRuntime.jsxs("div",{role:"alert",style:D.emergencyBanner,"data-testid":"televet-review-emergency",children:[jsxRuntime.jsx(Ea,{style:D.emergencyTitle,children:f.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:D.emergencyLede,children:X}),C.length>0?jsxRuntime.jsx("p",{style:D.emergencyLede,"data-testid":"televet-review-emergency-categories",children:C.join(", ")}):null,jsxRuntime.jsx(Vt,{petName:l,primaryVet:N,onFindEmergencyVet:z,testIDPrefix:"televet-review-emergency"}),jsxRuntime.jsx(_,{label:f.emergency.keepBookingCta,kind:"secondary",loading:h,disabled:h,onPress:k,testID:"televet-review-emergency-ack"})]}):null,T==="failed"?jsxRuntime.jsx(q,{message:f.confirmFailed}):null,T==="clinician_unavailable"?jsxRuntime.jsxs("div",{style:j.list,"data-testid":"televet-review-clinician-unavailable",children:[jsxRuntime.jsx(q,{message:f.confirmFailed}),jsxRuntime.jsx(_,{label:f.seeOtherVetsCta,kind:"secondary",onPress:B,testID:"televet-review-see-other-vets"})]}):null,T==="rate_limited"?jsxRuntime.jsx(q,{message:f.confirmFailed,testID:"televet-review-rate-limited"}):null,T==="not_entitled"?jsxRuntime.jsx(q,{message:f.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]})}),C?null:jsxRuntime.jsx("div",{style:j.scrollFooter,children:jsxRuntime.jsx(_,{label:f.confirmCta,kind:"primary",loading:h,disabled:!b||h||!!d&&!c||!!p&&!m,onPress:S,testID:"televet-review-confirm"})})]})}o(Eo,"ReviewStep");var pc="\u25CB",fc="+";function We(e,t){return t?e.find(n=>n.petRef===t||n.petId===t)?.name??null:null}o(We,"nameOf");function lt({headingRef:e,style:t,id:r,children:n}){let l=le(ye());return jsxRuntime.jsx(l,{ref:e,tabIndex:-1,style:t,...r===void 0?{}:{id:r},children:n})}o(lt,"StepHeading");function Ea({style:e,children:t}){let r=le(Ht(ye()));return jsxRuntime.jsx(r,{style:e,children:t})}o(Ea,"SubHeading");function ka({headingRef:e,pets:t,isPending:r,isError:n,onRetry:l,selectedId:a,onSelect:s,onAddPet:i}){let d=L(),c=R(),u=react.useMemo(()=>we(c),[c]);return r?jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.pets,"aria-busy":"true",style:d.list,"data-testid":"televet-pets-loading",children:[0,1].map(p=>jsxRuntime.jsx(me,{height:64},p))}):n?jsxRuntime.jsx("div",{"data-testid":"televet-pets-error",children:jsxRuntime.jsx(K,{title:f.chrome.loadFailedTitle,actionLabel:f.chrome.retryCta,onAction:l})}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-pets-empty",children:jsxRuntime.jsx(K,{title:f.chrome.noPetsTitle,actionLabel:f.addPetCta,onAction:i})}):jsxRuntime.jsxs("div",{style:d.stepFill,children:[jsxRuntime.jsx(lt,{headingRef:e,style:d.stepTitle,children:f.petSelectTitle}),jsxRuntime.jsx("div",{style:{...d.scrollBody,...u.stepScroll},children:jsxRuntime.jsxs("ul",{role:"list",style:d.list,"data-testid":"televet-pets",children:[t.map(p=>{let m=a===p.petRef;return jsxRuntime.jsx(Ca,{name:p.name??"",meta:va(p),selected:m,onPress:()=>s(p.petRef),testID:`televet-pet-${p.petRef}`},p.petRef)}),i?jsxRuntime.jsx(Ca,{name:f.addPetCta,meta:"",selected:false,onPress:i,testID:"televet-pet-add",glyph:fc}):null]})})]})}o(ka,"PetStep");function Ca({name:e,meta:t,selected:r,onPress:n,testID:l,glyph:a}){let s=R(),i=react.useMemo(()=>we(s),[s]);return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button",onClick:n,"aria-pressed":r,"data-testid":l,style:{...i.petRow,...r?i.petRowSelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:i.petDisc,children:a??xa(e)}),jsxRuntime.jsxs("span",{style:i.petRowText,children:[jsxRuntime.jsx("span",{style:i.petRowName,children:e}),t?jsxRuntime.jsx("span",{style:i.petRowMeta,children:t}):null]})]})})}o(Ca,"PetRow");function xa(e){let t=e.trim();return t.length===0?pc:t.slice(0,1).toUpperCase()}o(xa,"initialOf");function Ra({headingRef:e,clinicians:t,isPending:r,isError:n,selectedId:l,onSelect:a,onRetry:s}){let i=L(),d=R(),c=react.useMemo(()=>we(d),[d]);if(r)return jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.clinicians,"aria-busy":"true",style:i.list,"data-testid":"televet-clinicians-loading",children:jsxRuntime.jsx(me,{height:96})});if(n)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-error",children:jsxRuntime.jsx(K,{title:f.chrome.loadFailedTitle,actionLabel:f.chrome.retryCta,onAction:s})});if(t.length===0)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-empty",children:jsxRuntime.jsx(K,{title:f.noCliniciansTitle,message:f.noCliniciansBody,actionLabel:f.noCliniciansRetryCta,onAction:s})});let u=t.find(p=>p.clinicianId===l)??t[0];return u===void 0?null:jsxRuntime.jsxs("div",{style:i.list,"data-testid":"televet-clinicians",children:[jsxRuntime.jsx(lt,{headingRef:e,style:i.stepTitle,children:f.yourVetTitle}),jsxRuntime.jsxs("div",{style:c.vetRow,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:c.vetAvatar,children:xa(u.displayName)}),jsxRuntime.jsxs("div",{style:c.vetIdentity,children:[jsxRuntime.jsx("p",{style:c.vetName,children:u.displayName}),u.credentials?jsxRuntime.jsx("p",{style:c.vetCredentials,children:u.credentials}):null,u.rating!==null&&u.ratingCount!==null?jsxRuntime.jsx("p",{style:c.vetRating,"data-testid":"televet-vet-rating",children:`\u2605 ${String(u.rating)} \xB7 ${String(u.ratingCount)} ${f.reviewsLabel}`}):null]})]}),u.bio?jsxRuntime.jsx("p",{style:c.vetBio,"data-testid":"televet-vet-bio",children:u.bio}):null,jsxRuntime.jsx("div",{style:i.divider}),jsxRuntime.jsx(_,{label:f.continueCta,kind:"primary",onPress:()=>a(u.clinicianId),testID:`televet-clinician-${u.clinicianId}`})]})}o(Ra,"ClinicianStep");function _a({headingRef:e,slots:t,enabled:r,isPending:n,isError:l,busySlotId:a,failure:s,selectedSlot:i,nextOpening:d,onPick:c,onRetry:u,onSeeOtherVets:p}){let m=L();return r?n?jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.slots,"aria-busy":"true",style:m.list,"data-testid":"televet-slots-loading",children:[0,1,2].map(y=>jsxRuntime.jsx(me,{height:48},y))}):l?jsxRuntime.jsx(K,{title:f.slotsErrorTitle,actionLabel:f.retryCta,onAction:u,testID:"televet-slots-error"}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-slots-empty",children:jsxRuntime.jsx(K,{title:f.noSlotsTitle,message:d?Y(f.nextOpeningTemplate,{when:Te(d.startsAt)}):void 0,actionLabel:d?f.seeOtherVetsCta:void 0,onAction:d?p:void 0})}):jsxRuntime.jsxs("div",{style:m.stepFill,"data-testid":"televet-slots",children:[jsxRuntime.jsx(lt,{headingRef:e,style:m.stepTitle,children:f.timeHeading}),s==="expired"?jsxRuntime.jsx(q,{message:f.holdExpired}):null,s==="taken"?jsxRuntime.jsx(q,{message:f.slotTaken}):null,s==="failed"||s==="rate_limited"?jsxRuntime.jsx(q,{message:f.confirmFailed,testID:"televet-slots-hold-failed"}):null,jsxRuntime.jsx($t,{slots:t,busySlotId:a,onPick:c,selectedSlot:i,dayGroupLabel:f.summaryWhen,timeGroupLabel:f.navTitle})]}):jsxRuntime.jsx("div",{"data-testid":"televet-slots-unavailable",children:jsxRuntime.jsx(K,{title:f.bookingPausedTitle})})}o(_a,"SlotStep");function Pa({headingRef:e,petName:t,chips:r,selected:n,onToggle:l,onNext:a}){let s=L(),i=R(),d=react.useMemo(()=>we(i),[i]),c=Y(f.issuesHeadingTemplate,{pet:t??""});return jsxRuntime.jsxs("div",{style:s.scrollRoot,"data-testid":"televet-booking-issues",children:[jsxRuntime.jsx("div",{style:s.scrollBody,children:jsxRuntime.jsxs("div",{style:s.list,children:[jsxRuntime.jsx(lt,{headingRef:e,style:s.stepTitle,children:c}),jsxRuntime.jsx("p",{style:s.stepHelp,children:f.issuesHint}),jsxRuntime.jsx("div",{role:"group","aria-label":c,style:d.chipRow,children:r.map(u=>{let p=n.includes(u.id);return jsxRuntime.jsx("button",{type:"button","aria-pressed":p,onClick:()=>l(u.id),style:{...d.chip,...p?d.chipOn:null},"data-testid":`televet-issue-${u.id}`,children:u.label},u.id)})})]})}),jsxRuntime.jsx("div",{style:s.scrollFooter,children:jsxRuntime.jsx(_,{label:f.continueCta,kind:"primary",onPress:a,testID:"televet-issues-next"})})]})}o(Pa,"IssuesStep");function wa({headingRef:e,value:t,composed:r,onChange:n,onNext:l,media:a,onChangeMedia:s,onPickMedia:i,checking:d=false}){let c=L(),u=R(),p=react.useMemo(()=>we(u),[u]),m=react.useId(),y=`${m}-reason-heading`,b=`${m}-reason-help`,h=(r??t).trim(),T=h.length>He,S=h.length>0&&!T;return jsxRuntime.jsxs("div",{style:c.scrollRoot,"data-testid":"televet-booking-reason",children:[jsxRuntime.jsx("div",{style:c.scrollBody,"data-testid":"televet-booking-reason-scroll",children:jsxRuntime.jsxs("div",{style:c.list,children:[jsxRuntime.jsx(lt,{headingRef:e,id:y,style:c.stepTitle,children:f.describeHeading}),jsxRuntime.jsx("p",{id:b,style:c.stepHelp,children:f.describeHelpLong}),jsxRuntime.jsx("textarea",{value:t,onChange:C=>n(C.currentTarget.value),"aria-labelledby":y,"aria-describedby":b,"aria-invalid":T||void 0,placeholder:f.reasonPlaceholder,style:p.reasonInput,"data-testid":"televet-reason-input"}),T?jsxRuntime.jsx(q,{message:f.reasonTooLong}):null,jsxRuntime.jsx(mo,{media:a,onChange:s,listLabel:f.addPhotoCta,...i?{onPickMedia:i}:{}})]})}),jsxRuntime.jsx("div",{style:c.scrollFooter,children:jsxRuntime.jsx(_,{label:f.continueCta,kind:"primary",disabled:!S,loading:d,onPress:l,testID:"televet-reason-next"})})]})}o(wa,"ReasonStep");function xo(e){let{petRef:t,usState:r,controller:n,onBooked:l,onExit:a,onAddPet:s,onPickMedia:i,onAddToCalendar:d,onConfirmDiscard:c,onRequestLocation:u,locationStatus:p="unknown",onTriageReason:m,onStateInterest:y,primaryVet:b,onFindEmergencyVet:h,canJoinInApp:T=false,renderUnavailable:S,headingLevel:C,style:k,testID:B}=st(e,["onBooked","onExit","onAddPet","onRequestLocation","onFindEmergencyVet"]),I=Zl(C??vt),N=Ht(I),z=L(),j=R(),J=react.useMemo(()=>we(j),[j]),D=he(n),X=xr(),$=X.pets,Q=$.length,ve=react.useMemo(()=>({ownedPetCount:Q,withIssues:true}),[Q]),[be,Le]=react.useReducer((H,Ge)=>$n(H,Ge,ve),void 0,()=>Un({ownedPetCount:0,withIssues:true},{petId:t??null,state:r??null})),O=react.useCallback(H=>Le(H),[]),[at,Fe]=react.useState(""),[W,$e]=react.useState([]),[Ie,V]=react.useState(null),[Ke,Qt]=react.useState(null),[Hr,Vo]=react.useState(false),[Vr,Uo]=react.useState(false),[Wo,Ja]=react.useState([]),[Ur,Xa]=react.useState(null),[Qa,Za]=react.useState(null),{draft:x}=be,re=Kn(be),$o=react.useMemo(()=>Vl($.find(H=>H.petRef===x.petId||H.petId===x.petId)?.species??null),[$,x.petId]),qe=Ul(W.map(H=>$o.find(Ge=>Ge.id===H)?.label??""),at),Ko=react.useRef(x.state);Ko.current!==x.state&&(Ko.current=x.state,Hr&&Vo(false),Vr&&Uo(false));let Zt=vn(x.state,D),qo=Ot(D),kt=bn(D),fe=hn(x.state,D),Me=At(x.clinicianId,D),Wr=Me.refetch,es=Tn(D).data??null,$r=Bt(D),Yo=En(D),Ee=to(m??null),Go=ro(x.state,y??null).actionFor("no_licensed_vet"),Kr=r??null;react.useEffect(()=>{Kr&&!x.state&&O({type:"patch",patch:{state:Kr}});},[Kr,x.state,O]),react.useEffect(()=>{t&&!x.petId&&O({type:"patch",patch:{petId:t}});},[t,x.petId,O]);let qr=$.length===1?$[0]?.petRef??null:null;react.useEffect(()=>{qr&&!x.petId&&O({type:"patch",patch:{petId:qr}});},[qr,x.petId,O]);let Jo=react.useRef(re);Jo.current=re;let Xo=react.useRef(0);react.useEffect(()=>{Q!==Xo.current&&(Xo.current=Q,O({type:"goTo",step:Jo.current}));},[Q,O]);let Yr=fe.data?.[0]?.clinicianId??null;react.useEffect(()=>{Yr&&!x.clinicianId&&O({type:"patch",patch:{clinicianId:Yr}});},[Yr,x.clinicianId,O]);let Ye=react.useRef(null),Qo=react.useRef(false);react.useEffect(()=>{if(!Qo.current){Qo.current=true;return}Ye.current?.focus();},[re]);let ts=Xl({draft:x,hold:$r,dispatch:O,setFailure:V,refetchSlots:Wr}),{submitBooking:rs,confirm:ns}=Jl({draft:x,reasonText:qe,book:Yo,stateAttested:Hr,termsAttested:Vr,cancellationPolicy:qo.data??null,triage:Ee,goTo:react.useCallback(H=>O({type:"goTo",step:H}),[O]),releaseSlot:react.useCallback(()=>{Za(x.slot),O({type:"patch",patch:Hl}),Wr();},[x.slot,O,Wr]),setFailure:V,setEmergency:Qt,setBookedConsult:Xa,...l?{onBooked:l}:{}}),os=Zt.enabled&&Zt.data!==null&&!Zt.data.wellnessAvailable,Zo=kt.enabled&&kt.data?.active===false||Ie==="not_entitled",is=kt.enabled&&kt.data!==null,ls=Jn(is),ei=wr(Wo.length),as=qe.trim().length>0||!!x.slot,ti={surfaceUnavailable:D===null||Ie==="unavailable"||kn(kt)||kn(Zt),notEntitled:Zo,policyBlocked:os,triageOpen:Ee.open,step:re},ss=ia(ti),ri={noState:!x.state,isPending:fe.enabled&&fe.isPending,isError:fe.isError,isEmpty:(fe.data?.length??0)===0,notEntitled:Zo},ds=aa(ri);return Oe()?jsxRuntime.jsx(no.Provider,{value:N,children:jsxRuntime.jsxs("div",{style:{...z.screen,...k},"data-testid":B??"televet-booking",children:[jsxRuntime.jsx(yo,{step:re,furthestIndex:be.furthestIndex,triageOpen:Ee.open,canGoBack:(Ee.open||Wn(be,ve))&&re!=="booked",isDirty:as,onBack:()=>{if(Ee.open){Ee.close();return}Ee.cancel(),O({type:"back"});},onClose:()=>a?.(),headingLevel:I,...c?{onConfirmDiscard:c}:{}}),ss?jsxRuntime.jsx(la,{state:ti,petName:We($,x.petId),...b?{primaryVet:b}:{},onFindEmergencyVet:h,stateInterest:Go,...y?{onCheckAvailability:o(()=>O({type:"goTo",step:"clinician"}),"onCheckAvailability")}:{},onAcknowledgeEmergency:()=>{Ee.acknowledge(qe),O({type:"next"});},...S?{renderUnavailable:S}:{}}):re==="time"?jsxRuntime.jsx(_a,{headingRef:Ye,slots:Me.data??[],enabled:Me.enabled,isPending:Me.enabled&&Me.isPending&&Me.data===null,isError:Me.isError,busySlotId:$r.isPending?$r.variables:null,failure:Ie,selectedSlot:x.slot??Qa,nextOpening:es,onPick:ts,onRetry:()=>Me.refetch(),onSeeOtherVets:()=>O({type:"goTo",step:"clinician"})}):re==="review"?jsxRuntime.jsx(Eo,{headingRef:Ye,when:x.slot?Te(x.slot.startsAt):"",lengthMinutes:(x.slot?un(x.slot):null)??tt,petName:We($,x.petId),reason:qe.trim(),clinician:fe.data?.find(H=>H.clinicianId===x.clinicianId)?.displayName??null,shareRecords:x.shareHealthRecords,stateCode:x.state,stateAttested:Hr,onToggleStateAttest:Vo,cancellationTerms:qo.data?.summary??null,termsAttested:Vr,onToggleTermsAttest:Uo,onToggleShare:H=>O({type:"patch",patch:{shareHealthRecords:H}}),canConfirm:Mt(x,qe),busy:Yo.isPending,failure:Ie,onConfirm:ns,emergency:Ke,onAcknowledgeEmergency:()=>rs(true),mediaShortfall:ei,primaryVet:b,onFindEmergencyVet:h,onSeeOtherVets:()=>O({type:"goTo",step:"clinician"})}):re==="booked"?jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-booked",children:Ur?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{consult:Ur,petName:We($,Ur.petId)??We($,x.petId),onDone:()=>a?.(),canJoinInApp:T,lengthMinutes:(x.slot?un(x.slot):null)??tt,...d?{onAddToCalendar:d}:{}}),jsxRuntime.jsx(Ut,{shortfall:ei,testIDPrefix:"televet-booked"})]}):null}):re==="clinician"&&ds?jsxRuntime.jsx(sa,{state:ri,cause:ls,locationStatus:p,...u?{onRequestLocation:u}:{},onRetry:()=>fe.refetch(),stateInterest:Go,...S?{renderUnavailable:S}:{}}):re==="clinician"?jsxRuntime.jsx(Ra,{headingRef:Ye,clinicians:fe.data??[],isPending:fe.enabled&&fe.isPending,isError:fe.isError,selectedId:x.clinicianId,onRetry:()=>fe.refetch(),onSelect:H=>{O({type:"patch",patch:{clinicianId:H}}),O({type:"next"});}}):re==="issues"?jsxRuntime.jsx(Pa,{headingRef:Ye,petName:We($,x.petId),chips:$o,selected:W,onToggle:H=>$e(Ge=>Ge.includes(H)?Ge.filter(us=>us!==H):[...Ge,H]),onNext:()=>O({type:"next"})}):re==="reason"?jsxRuntime.jsx(wa,{headingRef:Ye,value:at,composed:qe,onChange:Fe,media:Wo,onChangeMedia:Ja,...i?{onPickMedia:i}:{},checking:Ee.checking,onNext:()=>{Ee.check(qe).then(H=>{H&&O({type:"next"});});}}):re==="pet"?jsxRuntime.jsx(ka,{headingRef:Ye,pets:$,isPending:X.loading,isError:X.error!==null,onRetry:()=>{X.refresh();},onAddPet:s,selectedId:x.petId,onSelect:H=>{O({type:"patch",patch:{petId:H}}),O({type:"next"});}}):jsxRuntime.jsx("div",{style:J.marker,"data-testid":`televet-booking-step-${re}`})]})}):jsxRuntime.jsx("div",{style:{...z.screen,...k},"data-testid":B??"televet-booking",children:jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-copy-unapproved",children:S?S():null})})}o(xo,"EverfurTelevetBooking");var Oa=Symbol.for("@everfur/sdk/televet");function Aa(){let e=globalThis,t=e[Oa];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[Oa]=r,r}o(Aa,"televetGlobal");function Fr(){return Aa().dailyRegistered}o(Fr,"isEverfurDailyRegistered");function Ro(){let e=Aa(),t=e.noticeReceipts;if(t!==void 0)return t;let r=new Map;return e.noticeReceipts=r,r}o(Ro,"noticeReceipts");function Ba(e){let t=Ro(),r=t.get(e);r!==void 0?r.holders+=1:t.set(e,{holders:1,joined:false});}o(Ba,"markRecordingNoticeAccepted");function Na(e){let t=Ro(),r=t.get(e);r!==void 0&&(r.holders-=1,r.holders<=0&&t.delete(e));}o(Na,"clearRecordingNoticeAccepted");function Da(e){return Ro().get(e)?.joined===true}o(Da,"isTelevetCallJoined");var De=Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:De.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:De.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function La(e){switch(e){case "too_early":return "This visit has not opened yet.";case "too_late":return "This visit has ended.";case "room_not_ready":return "We are still setting up the video room. Try again in a moment.";case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return Jt}}o(La,"televetJoinRefusalWebCopy");var Jt="This visit cannot be joined right now.";function Fa(e){return e==="room_not_ready"||e==="unknown"}o(Fa,"televetJoinIsRetryable");function Ma(e){let t=null;return ()=>{if(t!==null)return t;let r=e();return t=r,r.then(void 0,()=>{t===r&&(t=null);}),r}}o(Ma,"memoizeTelevetLoader");var ja=Object.freeze({status:"joining"});function _o(e,t){let[r,n]=react.useState(0),[l,a]=react.useState(ja),s=react.useRef(null);react.useEffect(()=>{let d=t?.joinConsult;if(t===null||d===void 0){a(Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let c=`${e}#${String(r)}`,u=s.current;if(u===null||u.key!==c){let m;try{m=d.call(t,e);}catch(y){m=Promise.reject(y);}u={key:c,promise:m},s.current=u;}let p=true;return a(ja),u.promise.then(m=>{p&&(m.ok?a(Object.freeze({status:"ready",credential:m.value})):a(Object.freeze({status:"refused",refusal:sn(m.error),reason:an(m.error)})));},()=>{p&&a(Object.freeze({status:"refused",refusal:"unknown",reason:null}));}),()=>{p=false;}},[e,t,r]);let i=react.useCallback(()=>n(d=>d+1),[]);return {state:l,retry:i}}o(_o,"useTelevetJoin");var Va=Ma(()=>import('@everfur/sdk/web/televet/call'));function Po({consultId:e,controller:t,onLeave:r,style:n}){let l=L(),[a,s]=react.useState(null),i=a===e,[d]=react.useState(Fr);react.useEffect(()=>{if(d)return;let u=true;return Va().then(p=>{u&&Cc(p.EVERFUR_DAILY_SETUP);},()=>{}),()=>{u=false;}},[d]),Wt(()=>(r(),true),!i);let c=react.useCallback(()=>{s(null),r();},[r]);return d?i?jsxRuntime.jsx(Ec,{consultId:e,controller:t,onLeave:c,style:n},e):jsxRuntime.jsx(Ua,{onContinue:()=>s(e),onDecline:r,style:n}):jsxRuntime.jsxs("div",{style:{...l.stepFill,...n},"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(q,{message:Jt}),jsxRuntime.jsx(_,{label:De.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]})}o(Po,"TelevetJoinScreen");function Ua({onContinue:e,onDecline:t,busy:r=false,style:n}){let l=L(),a=`${react.useId()}-recording-notice`,s=react.useRef(null);return react.useEffect(()=>{let i=s.current;if(!i)return;let d=i.ownerDocument.activeElement;d!==null&&d!==i.ownerDocument.body||i.focus();},[]),jsxRuntime.jsx("div",{style:{...l.stepFill,...n},children:jsxRuntime.jsxs("div",{ref:s,role:"alertdialog","aria-labelledby":a,"aria-busy":r||void 0,tabIndex:-1,"data-testid":"everfur-vet-call-recording-notice",style:l.stateCard,children:[jsxRuntime.jsx("p",{id:a,style:l.stateTitle,children:De.recordingNoticeTitle}),jsxRuntime.jsx(_,{label:De.recordingNoticeCta,kind:"primary",loading:r,onPress:()=>e?.(),testID:"everfur-vet-call-recording-continue"}),jsxRuntime.jsx(_,{label:De.recordingNoticeDecline,kind:"secondary",disabled:r,onPress:()=>t?.(),testID:"everfur-vet-call-recording-decline"})]})})}o(Ua,"TelevetRecordingNotice");function Ec({consultId:e,controller:t,onLeave:r,style:n}){let l=L(),a=he(t),{state:s,retry:i}=_o(e,a),d=s.status==="ready"?s.credential:null,[c,u]=react.useState(null),[p,m]=react.useState(false),y=d!==null;react.useEffect(()=>{if(!y||c!==null)return;let S=true;return Va().then(C=>{S&&u(()=>C);},()=>{S&&m(true);}),()=>{S=false;}},[y,c]);let[b,h]=react.useState(null);if(react.useEffect(()=>{if(d===null)return;let S=d.roomUrl;return Ba(S),h(d),()=>{Na(S);}},[d]),Wt(()=>(s.status==="joining"||d!==null&&c!==null&&!p&&Da(d.roomUrl)||r(),true)),s.status==="refused"||p){let S=s.status==="refused"?s.refusal:"unavailable",C=s.status==="refused"?La(s.reason):Jt;return jsxRuntime.jsxs("div",{style:{...l.stepFill,...n},"data-testid":"televet-join-refused",children:[jsxRuntime.jsx(q,{message:C,testID:"televet-join-refused-message"}),Fa(S)&&s.status==="refused"?jsxRuntime.jsx(_,{label:f.retryCta,kind:"primary",onPress:i,testID:"televet-join-retry"}):null,jsxRuntime.jsx(_,{label:De.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-leave"})]})}if(d===null||c===null||b!==d)return jsxRuntime.jsx(Ua,{busy:true,style:n});let{EverfurVetCall:T}=c;return jsxRuntime.jsx(T,{roomUrl:d.roomUrl,token:d.token,onLeave:r,renderUnavailable:()=>jsxRuntime.jsxs("div",{style:l.stepFill,"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(q,{message:Jt}),jsxRuntime.jsx(_,{label:De.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]}),...n?{style:n}:{}})}o(Ec,"TelevetJoinRoom");var Ha=false;function Cc(e){if(Ha)return;Ha=true;let t=globalThis.console;try{t?.warn?.(e);}catch{}}o(Cc,"warnSetupOnce");var Rc=2e4;function Wa(e=true,t=Rc){let[r,n]=react.useState(()=>Date.now());return react.useEffect(()=>{if(!e)return;n(Date.now());let l=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(l)},[e,t]),r}o(Wa,"useNowMs");function _c(e){let t=e.trim().length;return t<1?w.cancellationReasonMissing:t>Ve?w.cancellationReasonTooLong(Ve):null}o(_c,"reasonRefusal");function Io({terms:e,submitting:t,failure:r,onConfirm:n,onDismiss:l,onRetryTerms:a,styles:s}){let[i,d]=react.useState(""),[c,u]=react.useState(null),p=react.useId(),m=react.useId(),y=e.status==="ready",b=o(()=>{if(t||!y)return;let h=_c(i);u(h),h||n(i.trim());},"confirm");return jsxRuntime.jsxs("form",{onSubmit:h=>{h.preventDefault(),b();},"aria-label":w.cancelConfirmCta,noValidate:true,style:s.form,"data-testid":"televet-visit-cancel-form",children:[jsxRuntime.jsx("p",{style:s.noticeTitle,children:w.cancelConfirmTitle}),e.status==="ready"?jsxRuntime.jsx("div",{style:s.notice,"data-testid":"televet-visit-cancel-terms",children:jsxRuntime.jsx("p",{style:s.note,children:e.summary})}):e.status==="loading"?jsxRuntime.jsx("div",{role:"status",style:s.notice,children:jsxRuntime.jsx("p",{style:s.note,children:w.loadingCancellationTerms})}):jsxRuntime.jsxs("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-terms-error",children:[jsxRuntime.jsx("p",{style:s.note,children:w.cancellationTermsUnavailable}),jsxRuntime.jsx(_,{label:w.retry,kind:"secondary",fullWidth:false,onPress:a})]}),jsxRuntime.jsx("label",{htmlFor:p,style:s.label,children:w.cancellationReasonLabel}),jsxRuntime.jsx("textarea",{id:p,value:i,onChange:h=>{d(h.target.value),c&&u(null);},maxLength:Ve,rows:3,disabled:t||!y,"aria-invalid":c?true:void 0,"aria-describedby":c?m:void 0,style:s.textarea,"data-testid":"televet-visit-cancel-reason"}),c?jsxRuntime.jsx("p",{id:m,role:"alert",style:s.fieldError,children:c}):null,r?jsxRuntime.jsx("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-failed",children:jsxRuntime.jsx("p",{style:s.note,children:r})}):null,jsxRuntime.jsxs("div",{style:s.actions,children:[jsxRuntime.jsx(_,{label:t?w.cancellingVisit:w.cancelConfirmCta,kind:"danger",fullWidth:false,disabled:t||!y,loading:t,onPress:b,testID:"televet-visit-cancel-yes"}),jsxRuntime.jsx(_,{label:w.cancelDismissCta,kind:"secondary",fullWidth:false,disabled:t,onPress:l,testID:"televet-visit-cancel-keep"})]})]})}o(Io,"TelevetCancelVisitForm");function qa(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"px");return {screen:{...ft,display:"flex",flexDirection:"column",gap:i(r.md),paddingLeft:i(r.xl),paddingRight:i(r.xl),boxSizing:"border-box"},topBar:{display:"flex",alignItems:"center",justifyContent:"flex-end",minHeight:44},topBarStart:{justifyContent:"flex-start"},iconButton:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,padding:0,border:0,borderRadius:i(n.pill),background:"transparent",color:t.text.primary,cursor:"pointer"},textButton:{display:"inline-flex",alignItems:"center",minHeight:44,padding:`0 ${i(r.sm)}`,border:0,borderRadius:i(n.pill),background:"transparent",color:t.brand,cursor:"pointer",...v(e,"bold"),fontSize:i(a.body)},panel:{display:"flex",flexDirection:"column",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:i(n.lg),backgroundColor:t.surface,overflow:"hidden"},panelBody:{display:"flex",flexDirection:"column",gap:i(r.md),padding:i(r.lg)},panelHeader:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:i(r.sm),padding:`${i(r.md)} ${i(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},panelTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},count:{...v(e,"mono"),color:t.text.metaCool,fontSize:i(a.caption)},bookTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},list:{listStyle:"none",margin:0,padding:0},row:{display:"flex",flexDirection:"column",gap:i(r.sm),padding:`${i(r.md)} ${i(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},rowHead:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:i(r.sm)},when:{margin:0,...v(e,"medium"),color:t.text.primary,fontSize:i(a.subtitle),lineHeight:String(s.snug)},pet:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.caption)},chip:{display:"inline-flex",alignItems:"center",padding:`2px ${i(r.sm)}`,borderRadius:i(n.pill),backgroundColor:t.surfaceSubtle,...v(e,"mono"),color:t.text.metaCool,fontSize:i(a.micro),letterSpacing:"0.04em",textTransform:"uppercase"},chipPositive:{backgroundColor:t.badgeBgPositive,color:t.brand},actions:{display:"flex",flexWrap:"wrap",gap:i(r.sm)},note:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.body),lineHeight:String(s.normal)},notice:{display:"flex",flexDirection:"column",gap:i(r.xs),padding:i(r.md),borderRadius:i(n.md),backgroundColor:t.surfaceSubtle},noticeTitle:{margin:0,...v(e,"medium"),color:t.text.primary,fontSize:i(a.body),lineHeight:String(s.snug)},noticeDanger:{backgroundColor:t.badgeBgCritical},form:{display:"flex",flexDirection:"column",gap:i(r.sm),marginTop:i(r.sm),paddingTop:i(r.md),borderTop:`1px solid ${t.brandBorder}`},label:{...v(e,"medium"),color:t.text.primary,fontSize:i(a.body)},textarea:{minHeight:96,padding:i(r.sm),borderRadius:i(n.md),border:`1px solid ${t.brandBorder}`,...v(e,"regular"),fontSize:i(a.body),color:t.text.primary,backgroundColor:t.surface,resize:"vertical",boxSizing:"border-box"},fieldError:{margin:0,...v(e,"regular"),color:t.danger,fontSize:i(a.caption)},empty:{display:"flex",flexDirection:"column",gap:i(r.xs),padding:i(r.lg)},skeletons:{display:"flex",flexDirection:"column",gap:i(r.sm),padding:i(r.lg)}}}o(qa,"makeVisitStyles");function Bo({controller:e,onJoin:t,onReschedule:r,onBook:n,onBack:l,isRoot:a=true,revision:s=0,returnedTo:i=false,nowMs:d,style:c}){let u=R(),p=react.useMemo(()=>qa(u),[u]),m=le(ye()),y=he(e),[b,h]=react.useState(0),T=gr(y,s+b),S=Ot(y),{pets:C}=xr(),[k,B]=react.useState({status:"idle"}),[I,N]=react.useState(null),z=T.data??[],j=Wa(z.some(W=>!sr.has(W.status))),J=d??j,{upcoming:D,past:X}=react.useMemo(()=>Nt(z,J),[z,J]),$=react.useRef(null),Q=react.useRef(null),ve=react.useRef(null),be=react.useRef(i),Le=!(T.enabled&&T.isPending);react.useEffect(()=>{!be.current||!Le||(be.current=false,!$.current?.contains(document.activeElement)&&(Q.current??ve.current)?.focus());},[Le]);let O=S.data!==null&&S.data!==void 0?{status:"ready",summary:S.data.summary}:S.enabled&&S.isPending?{status:"loading"}:{status:"error"},at=o((W,$e)=>{let Ie=y?.cancelConsult;if(O.status!=="ready"||!y||!Ie){B({status:"failed",consultId:W.consultId,message:w.cancelTermsFirst});return}B({status:"submitting",consultId:W.consultId}),Ie.call(y,W.consultId,$e).then(V=>{V.ok?(N(V.value),B({status:"idle"})):B({status:"failed",consultId:W.consultId,message:w.cancelFailed}),h(Ke=>Ke+1);},()=>B({status:"failed",consultId:W.consultId,message:w.cancelFailed}));},"cancelVisit"),Fe=o(W=>jsxRuntime.jsx(Ic,{consult:W,petName:We(C,W.petId),nowMs:J,styles:p,cancelling:k.status!=="idle"&&k.consultId===W.consultId?k:null,anyCancelInFlight:k.status==="submitting",terms:O,onJoin:t,onReschedule:r,onAskCancel:()=>{N(null),B({status:"asking",consultId:W.consultId});},onDismissCancel:()=>B({status:"idle"}),onCancel:$e=>at(W,$e),onRetryTerms:()=>S.refetch()},W.consultId),"renderRow");return jsxRuntime.jsxs("div",{ref:$,style:{...p.screen,...c},"data-testid":"televet-visits",children:[jsxRuntime.jsx("div",{style:a?p.topBar:{...p.topBar,...p.topBarStart},children:a?jsxRuntime.jsx("button",{type:"button",onClick:l,"aria-label":Oc,style:p.iconButton,"data-testid":"televet-visits-close",children:jsxRuntime.jsx(Bc,{})}):jsxRuntime.jsx("button",{type:"button",onClick:l,style:p.textButton,"data-testid":"televet-visits-back",children:Ac})}),I?jsxRuntime.jsxs("div",{role:"status",style:p.notice,"data-testid":"televet-visits-cancel-receipt",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:w.cancelledTitle}),I.summary?jsxRuntime.jsx("p",{style:p.note,children:I.summary}):null,jsxRuntime.jsx("p",{style:p.note,children:I.feeRecorded?w.cancellationFeeRecorded:w.cancellationFeeNotRecorded})]}):null,n?jsxRuntime.jsx("section",{style:p.panel,"data-testid":"televet-visits-book-card",children:jsxRuntime.jsxs("div",{style:p.panelBody,children:[jsxRuntime.jsx("p",{style:p.bookTitle,children:w.bookCardTitle}),jsxRuntime.jsx(_,{label:w.bookCardCta,onPress:n,testID:"televet-visits-book"})]})}):null,T.enabled&&T.isPending?jsxRuntime.jsxs("section",{style:p.panel,children:[jsxRuntime.jsx(Ao,{Title:m,title:w.pastTitle,count:null,styles:p}),jsxRuntime.jsx("div",{role:"progressbar","aria-label":w.loading,"aria-busy":"true",style:p.skeletons,"data-testid":"televet-visits-loading",children:[0,1,2].map(W=>jsxRuntime.jsx(me,{height:56},W))})]}):T.isError&&T.data===null?jsxRuntime.jsxs("div",{ref:ve,role:"alert",tabIndex:-1,style:{...p.notice,...p.noticeDanger},"data-testid":"televet-visits-error",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:w.loadErrorTitle}),jsxRuntime.jsx("p",{style:p.note,"data-testid":"televet-visits-error-body",children:w.loadErrorBody}),jsxRuntime.jsx(_,{label:w.retry,kind:"secondary",fullWidth:false,onPress:()=>T.refetch()})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[D.length>0?jsxRuntime.jsxs("section",{style:p.panel,"data-testid":"televet-visits-upcoming",children:[jsxRuntime.jsx(Ao,{Title:m,title:w.upcomingTitle,count:D.length,styles:p,headingRef:Q}),jsxRuntime.jsx("ul",{"aria-label":w.upcomingTitle,style:p.list,children:D.map(Fe)})]}):null,jsxRuntime.jsxs("section",{style:p.panel,"data-testid":"televet-visits-past",children:[jsxRuntime.jsx(Ao,{Title:m,title:w.pastTitle,count:X.length,styles:p,...D.length===0?{headingRef:Q}:{}}),z.length===0?jsxRuntime.jsxs("div",{style:p.empty,"data-testid":"televet-visits-empty",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:w.emptyTitle}),jsxRuntime.jsx("p",{style:p.note,children:w.emptyBody})]}):X.length===0?null:jsxRuntime.jsx("ul",{"aria-label":w.pastTitle,style:p.list,children:X.map(Fe)})]})]})]})}o(Bo,"TelevetVisitsScreen");function Ao({Title:e,title:t,count:r,styles:n,headingRef:l}){return jsxRuntime.jsxs("div",{style:n.panelHeader,children:[jsxRuntime.jsx(e,{style:n.panelTitle,...l?{ref:l,tabIndex:-1}:{},children:t}),r===null?null:jsxRuntime.jsx("span",{style:n.count,children:r})]})}o(Ao,"PanelHeader");function Ic({consult:e,petName:t,nowMs:r,styles:n,cancelling:l,anyCancelInFlight:a,terms:s,onJoin:i,onReschedule:d,onAskCancel:c,onDismissCancel:u,onCancel:p,onRetryTerms:m}){let y=Pn(e,r),b=sr.has(e.status),h=qi(e.status),T=_n(e),S=wn(e.status),C=e.consultId,k=react.useId(),B=!y.joinable&&!b;return jsxRuntime.jsxs("li",{style:n.row,"data-testid":`televet-visits-row-${C}`,children:[jsxRuntime.jsxs("div",{style:n.rowHead,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{style:n.when,children:$l(e.scheduledAt)}),t?jsxRuntime.jsx("p",{style:n.pet,children:t}):null]}),h?jsxRuntime.jsx("span",{style:y.joinable?{...n.chip,...n.chipPositive}:n.chip,"data-testid":`televet-visits-status-${C}`,children:h}):null]}),jsxRuntime.jsxs("div",{style:n.actions,children:[b?null:jsxRuntime.jsx(_,{label:w.joinCta,fullWidth:false,disabled:!y.joinable,onPress:()=>i(e,t),describedBy:B?k:void 0,testID:`televet-visits-join-${C}`}),S&&d?jsxRuntime.jsx(_,{label:w.rescheduleCta,kind:"secondary",fullWidth:false,onPress:()=>d(e),testID:`televet-visits-reschedule-${C}`}):null,S?jsxRuntime.jsx(_,{label:w.cancelCta,kind:"danger",fullWidth:false,disabled:a,onPress:c,testID:`televet-visits-cancel-${C}`}):null]}),B?jsxRuntime.jsx("p",{id:k,style:n.note,"data-testid":`televet-visits-join-note-${C}`,children:Yi(y.reason,T===null?void 0:Kl(new Date(T).toISOString()))}):null,l?jsxRuntime.jsx(Io,{terms:s,submitting:l.status==="submitting",failure:l.status==="failed"?l.message:null,onConfirm:p,onDismiss:u,onRetryTerms:m,styles:n}):null]})}o(Ic,"VisitRow");var Oc="Close",Ac="Back";function Bc(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}o(Bc,"CloseGlyph");function No(e){let{consult:t,onRescheduled:r,onCancel:n,controller:l,style:a,testID:s}=st(e,["onRescheduled","onCancel"]),i=L(),d=he(l),c=At(t?.clinicianId??null,d),u=Bt(d),p=Cn(t?.consultId??null,d),[m,y]=react.useState(null),b=react.useCallback(T=>{y(null),u.mutate(T.slotId,{onSuccess:o(()=>{p.mutate(T.slotId,{onSuccess:o(S=>r?.(S),"onSuccess"),onError:o(S=>y(ze(S).kind==="unavailable"?"unavailable":"failed"),"onError")});},"onSuccess"),onError:o(S=>y(ze(S).kind==="unavailable"?"unavailable":"taken"),"onError")});},[u,p,r]),h=u.isPending||p.isPending;return Oe()?t?jsxRuntime.jsxs("section",{style:{...i.stepFill,...a},"aria-label":f.rescheduleNavTitle,"data-testid":s??"televet-reschedule",children:[jsxRuntime.jsx("p",{style:i.stepHelp,children:Y(f.rescheduleFromTemplate,{when:Te(t.scheduledAt)})}),m==="taken"?jsxRuntime.jsx(q,{message:f.slotTaken}):null,m==="failed"?jsxRuntime.jsx(q,{message:f.rescheduleFailed}):null,m==="unavailable"?jsxRuntime.jsx(q,{message:f.bookingPausedTitle,testID:"televet-reschedule-unavailable"}):null,c.enabled?c.isPending?jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.slots,"aria-busy":"true",style:i.list,"data-testid":"televet-reschedule-slots-loading",children:[0,1,2].map(T=>jsxRuntime.jsx(me,{height:48},T))}):c.isError?jsxRuntime.jsx(K,{title:f.slotsErrorTitle,actionLabel:f.retryCta,onAction:()=>c.refetch(),testID:"televet-reschedule-slots-error"}):(c.data??[]).length===0?jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-empty",children:jsxRuntime.jsx(K,{title:f.noSlotsTitle})}):jsxRuntime.jsx($t,{slots:c.data??[],busySlotId:h?u.variables:null,onPick:b,dayGroupLabel:f.summaryWhen,timeGroupLabel:f.rescheduleNavTitle,rowTestIdPrefix:"televet-reschedule-slot",testID:"televet-reschedule-slots"}):jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-paused",children:jsxRuntime.jsx(K,{title:f.bookingPausedTitle})}),jsxRuntime.jsx(_,{label:f.keepExistingCta,kind:"secondary",disabled:h,onPress:()=>n?.(),testID:"televet-reschedule-keep"})]}):jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.consult,"aria-busy":"true",style:{...i.list,...a},"data-testid":"televet-reschedule-loading",children:[0,1].map(T=>jsxRuntime.jsx(me,{height:48},T))}):jsxRuntime.jsx("div",{style:{...i.stepFill,...a},"data-testid":"televet-reschedule-copy-unapproved"})}o(No,"EverfurTelevetReschedule");function Mo(e){let t=e.visitRef?.trim()??"";return t.length>0?Object.freeze({name:"visit",visitRef:t,intent:e.intent??null}):Fo}o(Mo,"televetScreenForRequest");var Fo=Object.freeze({name:"home"}),jc=Object.freeze({name:"visits"}),Hc=Object.freeze({name:"booking"});function Vc(e,t){switch(t.type){case "push":return Object.freeze({stack:Object.freeze([...e.stack,t.screen])});case "pop":return e.stack.length<=1?e:Object.freeze({stack:Object.freeze(e.stack.slice(0,-1))});case "land":return e.stack[0]?.name!=="home"?e:Object.freeze({stack:Object.freeze([t.screen,...e.stack.slice(1)])});default:return e}}o(Vc,"navReducer");function Ga(e){let{style:t,renderPending:r,className:n,...l}=st(e,["onExit","onBooked","onAddPet","onRequestLocation","onFindEmergencyVet"]);return jsxRuntime.jsx(ul,{capability:"televet",style:t,...n!==void 0?{className:n}:{},...r?{renderPending:r}:{},children:jsxRuntime.jsx(Uc,{...l,...t!==void 0?{style:t}:{}})})}o(Ga,"EverfurTelevetFlow");function Uc({petRef:e,usState:t,controller:r,onBooked:n,onExit:l,onAddPet:a,onPickMedia:s,onAddToCalendar:i,onConfirmDiscard:d,onRequestLocation:c,locationStatus:u,primaryVet:p,onFindEmergencyVet:m,onTriageReason:y,historyMode:b="memory",canJoinInApp:h=false,renderUnavailable:T,initialScreen:S,headingLevel:C,style:k}){let B=L(),[I,N]=react.useReducer(Vc,S??Fo,V=>Object.freeze({stack:Object.freeze([V])})),z=I.stack[I.stack.length-1]??Fo,j=I.stack.length,J=react.useRef(j),D=j<J.current;react.useEffect(()=>{J.current=j;},[j]);let[X,$]=react.useState(0),Q=react.useCallback(()=>$(V=>V+1),[]),ve=react.useRef(0),be=react.useRef(j);be.current=j,react.useEffect(()=>{if(b!=="browser"||typeof window>"u")return;let V=o(Ke=>{let Qt=Ke.state?.efTelevet;typeof Qt=="number"&&Qt<be.current&&(ve.current=Math.max(0,ve.current-1),N({type:"pop"}));},"onPopState");return window.addEventListener("popstate",V),()=>window.removeEventListener("popstate",V)},[b]);let Le=react.useCallback(V=>{b==="browser"&&typeof window<"u"&&(ve.current+=1,window.history.pushState({efTelevet:be.current+1},"")),N({type:"push",screen:V});},[b]),O=react.useCallback(()=>{if(b==="browser"&&typeof window<"u"&&ve.current>0){ve.current-=1,window.history.go(-1);return}N({type:"pop"});},[b]),at=react.useCallback(()=>T?T():jsxRuntime.jsx("div",{style:B.list,"data-testid":"televet-unavailable",children:Oe()?jsxRuntime.jsx(K,{title:f.bookingPausedTitle}):null}),[T,B.list]),Fe=react.useCallback(()=>{j>1?O():l?.();},[j,O,l]),W=react.useCallback(V=>N({type:"land",screen:V==="visits"?jc:Hc}),[]),$e=jsxRuntime.jsx(xo,{...e!==void 0?{petRef:e}:{},...t!==void 0?{usState:t}:{},...r?{controller:r}:{},onBooked:V=>{Q(),n?.(V);},onExit:Fe,...a?{onAddPet:a}:{},...s?{onPickMedia:s}:{},...i?{onAddToCalendar:i}:{},...d?{onConfirmDiscard:d}:{},...c?{onRequestLocation:c}:{},...u?{locationStatus:u}:{},...p?{primaryVet:p}:{},...m?{onFindEmergencyVet:m}:{},...y?{onTriageReason:y}:{},canJoinInApp:h,renderUnavailable:at,...C!==void 0?{headingLevel:C}:{},...k?{style:k}:{}}),Ie=jsxRuntime.jsx(Bo,{...r?{controller:r}:{},revision:X,isRoot:j<=1,returnedTo:D,onJoin:(V,Ke)=>Le({name:"call",consultId:V.consultId,clinicianName:V.clinicianName,petName:Ke}),onReschedule:V=>Le({name:"reschedule",consult:V}),onBook:()=>Le({name:"booking"}),onBack:Fe,...k?{style:k}:{}});switch(z.name){case "home":return jsxRuntime.jsx(Wc,{controller:r,onLand:W,style:k});case "booking":return $e;case "visits":case "visit":return Ie;case "reschedule":return jsxRuntime.jsx(No,{consult:z.consult,...r?{controller:r}:{},onRescheduled:()=>{Q(),O();},onCancel:()=>O(),...k?{style:k}:{}});case "call":return jsxRuntime.jsx(Po,{consultId:z.consultId,...r?{controller:r}:{},...z.clinicianName!==void 0?{clinicianName:z.clinicianName}:{},...z.petName!==void 0?{petName:z.petName}:{},onLeave:()=>{Q(),Fe();},...k?{style:k}:{}});default:return er(z)}}o(Uc,"TelevetFlowBody");function Wc({controller:e,onLand:t,style:r}){let n=L(),l=he(e),a=Ki(l);return react.useEffect(()=>{a!=="pending"&&t(a);},[a,t]),jsxRuntime.jsxs("div",{role:"progressbar","aria-label":w.loading,"aria-busy":"true",style:{...n.screen,...n.list,...r},"data-testid":"televet-landing-loading",children:[jsxRuntime.jsx(me,{height:72}),jsxRuntime.jsx(me,{height:72})]})}o(Wc,"TelevetLandingScreen");var zo=Ga;function qc({request:e,onClose:t,onAddToCalendar:r}){let n=R(),l=react.useMemo(()=>Yc(n),[n]),a=react.useMemo(()=>ua(),[]),s=react.useCallback(()=>{a.dispatch()||t();},[a,t]),{dialogRef:i,onKeyDown:d,onCancel:c}=Br(true,s),u=react.useMemo(()=>Mo(e),[e]);return jsxRuntime.jsx("dialog",{ref:i,onKeyDown:d,onCancel:c,"aria-label":f.visit.title,"data-testid":"everfur-televet-dialog",style:l,children:jsxRuntime.jsx(co.Provider,{value:a,children:jsxRuntime.jsx(zo,{...e.petRef!==void 0?{petRef:e.petRef}:{},...e.usState!==void 0?{usState:e.usState}:{},initialScreen:u,onExit:t,...r?{onAddToCalendar:r}:{},canJoinInApp:Fr(),historyMode:"memory"})})})}o(qc,"EverfurTelevetDialog");function Yc(e){let{color:t,radius:r,space:n}=e;return {position:"fixed",inset:0,boxSizing:"border-box",width:"100%",maxWidth:640,height:"100%",maxHeight:"100%",margin:"0 auto",padding:`${String(n.lg)}px 0`,border:0,borderRadius:r.lg,display:"flex",flexDirection:"column",overflowY:"auto",backgroundColor:t.surface,color:t.text.primary}}o(Yc,"dialogStyle");exports.BACK_LABEL=Yu;exports.CANCELLATION_POLICY_VERSION_MAX=ur;exports.CANCEL_REASON_MAX=Ve;exports.CONSULT_KINDS=xi;exports.CONSULT_MINUTES=tt;exports.CONSULT_STATUSES=ki;exports.EverfurTelevet=zo;exports.EverfurTelevetBooking=xo;exports.EverfurTelevetDialog=qc;exports.EverfurTelevetFlow=Ga;exports.EverfurTelevetReschedule=No;exports.MEDIA_REFS_MAX=cr;exports.NO_MEDIA_SHORTFALL=jt;exports.REASON_TEXT_MAX=He;exports.TELEVET_BOOKING_BASE=Ue;exports.TELEVET_BOOKING_COPY=ie;exports.TELEVET_BOOKING_COPY_WEB=f;exports.TELEVET_BOOKING_STEPS=Ft;exports.TELEVET_CONSULT_PAGE_LIMIT=Fi;exports.TELEVET_EMERGENCY_EXITS_WEB=dt;exports.TELEVET_JOIN_CLOSES_MINUTES_AFTER=Rn;exports.TELEVET_JOIN_OPENS_MINUTES_BEFORE=xn;exports.TERMINAL_CONSULT_STATUSES=sr;exports.TelevetBookedScreen=uo;exports.TelevetBookingChrome=yo;exports.TelevetCancelVisitForm=Io;exports.TelevetClinicianEmptyState=oa;exports.TelevetConsentCheckbox=Kt;exports.TelevetDayStrip=vo;exports.TelevetEarlyEmergency=na;exports.TelevetEmergencyExits=Vt;exports.TelevetEntitlementInterestState=Nu;exports.TelevetIntakeMedia=mo;exports.TelevetJoinScreen=Po;exports.TelevetMediaDropNotice=Ut;exports.TelevetSlotPicker=$t;exports.TelevetStateInterestAction=io;exports.TelevetSummaryCard=To;exports.TelevetSummaryRow=it;exports.TelevetVisitsScreen=Bo;exports.attestation=Yn;exports.canConfirm=Mt;exports.canManageTelevetVisit=wn;exports.createTelevetBookingController=yn;exports.currentStep=Kn;exports.emptyTelevetDraft=Ml;exports.formatVisitRange=fu;exports.formatWhen=Wl;exports.formatWhenWithDay=Te;exports.hasPreviousStep=Wn;exports.initialTelevetBookingState=Un;exports.isHoldExpired=Pr;exports.isMediaShortfallEmpty=Xn;exports.isSkipped=Rr;exports.isTelevetBookingCopyReady=Oe;exports.isWellFormedStateCode=Ce;exports.mediaShortfallFromUnsentPicks=wr;exports.parseVetCallCredential=ln;exports.splitTelevetVisits=Nt;exports.televetBookingKey=qn;exports.televetBookingReducer=$n;exports.televetBookingRefusal=ze;exports.televetCancelCall=Li;exports.televetConsultCalendarKey=da;exports.televetConsultCall=fr;exports.televetDaysFromSlots=Lr;exports.televetEmptyRosterCause=Jn;exports.televetEmptyRosterView=Gn;exports.televetHoldCall=Bi;exports.televetJoinCall=Di;exports.televetJoinDecision=Pn;exports.televetJoinOpensAtMs=_n;exports.televetMediaShortfallLines=Qn;exports.televetRescheduleCall=Ni;exports.televetScreenForRequest=Mo;exports.useEarlyTriage=to;exports.useStateInterest=ro;exports.useTelevetBookConsult=En;exports.useTelevetBookingAvailable=Sd;exports.useTelevetBookingController=he;exports.useTelevetBookingEntitlement=bn;exports.useTelevetCancellationPolicy=Ot;exports.useTelevetClinicians=hn;exports.useTelevetHoldSlot=Bt;exports.useTelevetJoin=_o;exports.useTelevetNextSlot=Tn;exports.useTelevetRescheduleConsult=Cn;exports.useTelevetSlots=At;exports.useTelevetStatePolicy=vn;exports.validateBookingBody=Mi;exports.vetCallJoinReason=an;exports.vetCallJoinRefusal=sn;exports.withUnsentPicks=gu;
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var ps=Object.defineProperty;var o=(e,t)=>ps(e,"name",{value:t,configurable:true});function tr(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(tr,"assertNever");function oi(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(oi,"errorFrame");function Gr(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(Gr,"reportHostFailure");function ms(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(ms,"isThenable");function rr(e,...t){if(typeof e=="function")try{let r=e(...t);return ms(r)&&Promise.resolve(r).then(void 0,Gr),r}catch(r){Gr(r);return}}o(rr,"callHost");var ii=new WeakMap;function gs(e){if(typeof e!="function")return;let t=ii.get(e);if(t!==void 0)return t;let r=o((...n)=>{rr(e,...n);},"guarded");return ii.set(e,r),r}o(gs,"guardHost");function st(e,t){let r=null;for(let n of t){let l=e[n];typeof l=="function"&&(r??={...e},r[n]=gs(l));}return r??e}o(st,"guardHostProps");function nr(e,...t){let r;try{r=e(...t);}catch(n){return Gr(n),Promise.resolve({ok:false,error:n})}return Promise.resolve(r).then(n=>({ok:true,value:n}),n=>({ok:false,error:n}))}o(nr,"callHostAsync");var g=o(e=>e,"DRAFT"),vs=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function bs(e){return vs.some(t=>e.toUpperCase().includes(t.toUpperCase()))}o(bs,"isPlaceholderCopy");function Y(e,t){let r=e;for(let[n,l]of Object.entries(t))r=r.split(`{${n}}`).join(l);return r}o(Y,"fill");var ie=Object.freeze({stateBlockedTitle:g("Not available in this state yet"),noCliniciansTitle:g("No vets available right now"),noCliniciansBody:g("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:g("Check again"),noCliniciansRegionBody:g("Video visits have to be with a vet licensed in your state, and we don\u2019t have one there yet."),yourVetTitle:g("Your Vet"),reviewsLabel:g("reviews"),rescheduleFromTemplate:g("Moving your visit on {when}"),rescheduleFailed:g("That did not move. Your original time is unchanged."),keepExistingCta:g("Keep my current time"),bookingPausedTitle:g("Booking is not available right now."),slotsErrorTitle:g("Could not load times"),noSlotsTitle:g("No times available"),nextOpeningTemplate:g("Next opening across our vets: {when}"),seeOtherVetsCta:g("See other vets"),retryCta:g("Try again"),holdExpired:g("That time is no longer held. Pick another."),slotTaken:g("That time was just taken. Pick another."),reasonPlaceholder:g("What is going on with your pet?"),reasonTooLong:g("That is too long. Please shorten it."),shareRecordsOff:g("Share health records with this vet"),confirmNotEntitled:g("A Pro membership is needed to book a video visit."),confirmFailed:g("That did not book. Try again."),checkAvailabilityCta:g("Check availability"),stateInterest:Object.freeze({cta:g("Add me to the list"),submitting:g("Adding you to the list\u2026"),joinedTitle:g("You are on the list"),joinedBody:g("We will let you know when this changes."),failed:g("That did not save. Try again.")}),media:Object.freeze({droppedTemplate:g("{n} attachment did not upload."),droppedPluralTemplate:g("{n} attachments did not upload."),refusedSizeTemplate:g("{n} attachment was too large to send."),refusedSizePluralTemplate:g("{n} attachments were too large to send."),refusedTypeTemplate:g("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:g("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:g("{n} attachment could not be read."),refusedUnreadablePluralTemplate:g("{n} attachments could not be read.")}),navTitle:g("Book a visit"),rescheduleNavTitle:g("Change your visit"),close:g("Close"),continueCta:g("Continue"),petSelectTitle:g("Who is this visit for?"),addPetCta:g("Add a pet"),locationUnknownTitle:g("We need your location to find a vet"),locationUnknownBody:g("Turn on location for Everfur, then try again."),locationUnknownCta:g("Allow location"),locationBlockedTitle:g("Location is turned off"),locationBlockedBody:g("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:g("Open Settings"),locationUnavailableTitle:g("We could not read your location"),locationUnavailableBody:g("Try again in a moment."),stateAttestTemplate:g("I confirm my pet and I are in {state} right now."),describeHeading:g("Tell the vet what you are seeing"),describeHelpLong:g("A few sentences is plenty. When it started, what changed, anything you've already tried."),addPhotoCta:g("ADD PHOTO OR VIDEO"),removePhotoLabel:g("Remove photo"),summaryPet:g("Pet"),summaryVet:g("Vet"),summaryWhen:g("When"),summaryLength:g("Length"),summaryReason:g("Reason"),summaryLengthTemplate:g("{n} minutes"),confirmCta:g("Confirm visit"),bookedTitle:g("You are booked."),addToCalendarCta:g("Add to calendar"),doneCta:g("Done"),booked:Object.freeze({remindPromise:g("We will notify you 30 minutes before."),summaryPromise:g("{pet}'s summary goes to the vet ahead of the call."),joinPromise:g("Join right here in the app. No links to hunt for."),backToPet:g("Back to {pet}"),calendarAdded:g("Added to your calendar"),calendarFailedBody:g("That did not save to your calendar.")}),chrome:Object.freeze({closeHint:g("Closes without saving"),discardTitle:g("Leave without booking?"),discardBody:g("Your answers will not be saved."),discardConfirmCta:g("Leave"),discardKeepCta:g("Keep going"),noPetsTitle:g("No pets on this account"),loadFailedTitle:g("Could not load"),retryCta:g("Try again")}),emergency:Object.freeze({bannerTitle:g("This cannot wait for a scheduled call."),keepBookingCta:g("I have handled this, keep booking"),lede:g("What you are describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:g("Call {petName}'s primary vet"),exitFindErTitle:g("Find an emergency vet near you"),startCallHint:g("Starts a phone call")}),visit:Object.freeze({title:g("Your visit")}),loading:Object.freeze({pets:"Loading pets. Nothing to read yet.",clinicians:"Loading vets. Nothing to read yet.",slots:"Loading times. Nothing to read yet.",consult:"Loading your visit. Nothing to read yet.",progressTemplate:"Step {step} of {total}"})});function li(e=ie){return typeof e=="string"?[e]:typeof e!="object"||e===null?[]:Object.values(e).flatMap(t=>li(t))}o(li,"televetBookingCopyValues");function Oe(){return li().every(e=>e.trim().length>0&&!bs(e))}o(Oe,"isTelevetBookingCopyReady");var dt=Object.freeze({findEmergencyVet:"Find an emergency vet near you",poisonControl:"ASPCA Animal Poison Control",poisonControlDetail:"(888) 426-4435 \xB7 a fee may apply",poisonControlTel:"tel:+18884264435"}),f=Object.freeze({...ie,petSelectTitle:"Who is this visit for?",describeHeading:"Type to the vet what you're seeing",describeHelpLong:"Describe the issues your pet is experiencing",reasonPlaceholder:"She's been scratching her left ear a lot this week...",yourVetTitle:"Which vet would you like to see?",timeHeading:"Pick a date and time",reviewHeading:"Does this look right?",issuesHeadingTemplate:"Select {pet}\u2019s main issues",issuesHint:"Can select more than 1",otherIssue:"Other",bookedHeadingTemplate:"You're booked with {vet}",addToCalendarCta:"Add to Calendar",backLabel:"Back",emergency:Object.freeze({...ie.emergency,bannerTitle:"This can't wait for a scheduled call.",lede:"What you're describing is the kind of thing vets want to see in person, now. Please call one of these first.",ledeWithoutExits:ie.emergency.lede,keepBookingCta:"I've handled this, continue with booking",exitPrimaryVetTitle:"Call {petName}'s primary vet"})});var Jr=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Jr.map(e=>e.wireCode));var Ts=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),si=Object.freeze(Jr.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Ts[e.wireCode]}))),Ss=new Map(si.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Es=Object.freeze(["http_envelope",...[...new Set(si.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function or(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let n of [t??"http_envelope",...Es]){let l=Ss.get(n+r);if(l)return l}}o(or,"contractErrorFor");function Cs(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Cs,"contractDocUrl");function di(e){return null}o(di,"publishedDocUrl");var ks=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function ui(e){return ks[e]}o(ui,"categoryFor");function ci(e){let t=or(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(ci,"fromWire");var xs=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Xr(e){return xs.has(e)}o(Xr,"isAutoRetryable");var Rs=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function pi(e){return Xr(e)||Rs.has(e)}o(pi,"isRetryableCode");var _s=500,Qr=8e3,fi=4;function yi(e,t=Math.random){let r=Math.max(0,e),n=Math.min(_s*2**r,Qr);return Math.floor(t()*n)}o(yi,"backoffDelayMs");var Ps=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Zr(e){return Ps[e]}o(Zr,"userFacingError");function mi(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}o(mi,"defineHidden");var ws=/^[a-z][a-z0-9_]{0,63}$/;function ue(e,t){let r=or(t?.wireCode,t?.wireEnvelope),n={code:e,category:ui(e),retryable:t?.retryable??pi(e),displayMessage:Zr(e)};if(t?.httpStatus!==void 0&&(n.httpStatus=t.httpStatus),t?.requestId&&(n.requestId=t.requestId),typeof t?.reasonCode=="string"&&ws.test(t.reasonCode)&&(n.reasonCode=t.reasonCode),r);return t?.wireMessage&&mi(n,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&mi(n,"raw",t.raw),Object.freeze(n)}o(ue,"makeEverfurError");function F(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}o(F,"ok");function w(e){return Object.freeze({ok:false,error:e})}o(w,"err");var ir=class ir extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,ir.prototype);}};o(ir,"EverfurConfigError");var Rt=ir;function Is(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}o(Is,"authHeaders");function _t(e,t){return {...e,headers:{...Os(e.headers),...Is(t)}}}o(_t,"withAuthHeaders");function Os(e){if(!e)return {};let t={};for(let[r,n]of Object.entries(e)){let l=r.toLowerCase();l==="authorization"||l==="x-everfur-partner-key"||(t[r]=n);}return t}o(Os,"stripAuthHeaders");async function gi(e,t){if(t.mode==="anonymous")return t.transport.request(_t(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return w(en())}let n=await t.transport.request(_t(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let l;try{l=await t.identity.currentToken({forceRefresh:!0});}catch{return w(en())}let a=await t.transport.request(_t(e,{mode:"personalized",token:l,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?w(en(a.error.httpStatus)):a}o(gi,"authedSend");function en(e){return ue("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(en,"authRejectedError");function vi(e){return ue("internalError",{retryable:true,wireMessage:As(e)})}o(vi,"networkError");function As(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(As,"describeCause");var tn=3e4,Bs=Qr*2,Ns="idempotency-key",Ds=new Set(["POST","PUT","PATCH","DELETE"]),Ls=Object.freeze({onEvent(){}}),Fs=Object.freeze({setTimeout:o((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Ms(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}o(Ms,"seededIdempotencyKey");function Pt(e){let t=e.observer??Ls,r=e.timers??Fs,n=e.rng??Math.random,l=e.sleep??((m,y)=>Xs(m,r,y)),a=e.maxAttempts??fi,s=e.unaryTimeoutMs??tn,i=e.newIdempotencyKey??rn(),d=o(m=>{try{t.onEvent(m);}catch{}},"emit");async function c(m,y,b){let T=b?.maxAttempts,h=Math.max(1,T??a),k=b?.idempotent??Ds.has(y.method),E=b?.idempotencyKey===void 0?null:Ms(b.idempotencyKey),C=k?E??i():null,N=zs(y,C),x=0;for(;;){let O=o(Q=>Object.freeze({call:m,method:y.method,path:y.path,attempt:x,...C?{idempotencyKey:C}:{},...Q}),"stamp");d(O({phase:"attempt"}));let z=Gs(s,r),j=Js(z.signal,y.signal),J;try{J=await gi({...N,signal:j.signal},e.auth);}catch(Q){J=w(vi(Q));}finally{j.dispose(),z.cancel();}if(J.ok)return d(O({phase:"settled",ok:true,reason:"ok"})),J;let D=J.error,X=Hs(D,x,{maxAttempts:h,rng:n,now:r.now(),aborted:y.signal?.aborted===true,...T!==void 0?{perCallMaxAttempts:T}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),$={ok:false,code:D.code,reason:X.reason,...D.httpStatus!==void 0?{httpStatus:D.httpStatus}:{},...D.requestId!==void 0?{requestId:D.requestId}:{}};if(!X.retry)return d(O({phase:"settled",...$})),w(D);if(d(O({phase:"retry",...$,delayMs:X.delayMs})),await l(X.delayMs,y.signal),y.signal?.aborted===true)return d(O({phase:"settled",...$,reason:"aborted"})),w(D);x+=1;}}o(c,"send");async function u(m){return _t(m,await Ys(e.auth))}o(u,"authorize");async function*p(m,y,b){d(Object.freeze({call:m,phase:"stream.open",method:y.method,path:y.path,attempt:0}));try{yield*e.auth.transport.stream(y,b);}catch{yield oi({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(p,"stream"),Object.freeze({send:c,authorize:u,stream:p})}o(Pt,"createRequestFunnel");function zs(e,t){let r={};for(let[n,l]of Object.entries(e.headers??{}))n.toLowerCase()!==Ns&&(r[n]=l);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}o(zs,"assembleHeaders");function rn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(rn,"defaultIdempotencyKeyFactory");var js=10;function Hs(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let n=Vs(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Xr(e.code))return {retry:false,reason:"terminal-code"};let l=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(r.policy===void 0)return null;let c;try{c=r.policy.maxAttempts(e.code);}catch{return null}return typeof c!="number"||!Number.isFinite(c)?null:Math.max(1,Math.min(js,Math.floor(c)))},"policyCeiling"),i=r.perCallMaxAttempts??s()??r.maxAttempts;if(t+1>=i)return {retry:false,reason:"attempts-exhausted"};let d=Us(e,r.now);return d!==null?d>Bs?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:l,delayMs:d}:{retry:true,reason:l,delayMs:yi(t,r.rng)}}o(Hs,"decideRetry");function Vs(e){let t=e.code==="unknown"?ci(qs(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}o(Vs,"throttleKind");function Us(e,t){let r=$s(e.raw);if(r!==null){let l=r-t;return l>0?l:0}let n=Ws(e.raw);return n===null?null:Math.round(n*1e3)}o(Us,"retryOverrideMs");function Ws(e){for(let t of nn(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}o(Ws,"findRetryAfterSeconds");function $s(e){for(let t of nn(e)){let r=t.resets_at,n=Ks(r);if(n!==null)return n}return null}o($s,"findResetsAt");function nn(e){if(!bi(e))return [];let t=[e];for(let r of ["error","detail"]){let n=e[r];bi(n)&&t.push(n);}return t}o(nn,"candidateScopes");function Ks(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}o(Ks,"parseInstantMs");function qs(e){for(let t of nn(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}o(qs,"rawWireCode");function bi(e){return typeof e=="object"&&e!==null}o(bi,"isRecord");async function Ys(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(Ys,"resolveDeviceAuth");function Gs(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:o(()=>t.clearTimeout(n),"cancel")}}o(Gs,"boundedSignal");function Js(e,t){let r=o(()=>{},"noop");if(!t)return {signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let l=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",l,{once:true}),t.addEventListener("abort",l,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",l),t.removeEventListener("abort",l);},"dispose")}}o(Js,"mergeSignals");function Xs(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let l=t.setTimeout(()=>{r?.removeEventListener("abort",a),n();},e),a=o(()=>{t.clearTimeout(l),n();},"onAbort");r?.addEventListener("abort",a,{once:true});})}o(Xs,"delayAbortable");var Ei="televet_booking_not_live";function lr(e){return ue("conflict",{retryable:false,reasonCode:Ei,wireMessage:`the booking was answered with a consult whose status is ${e}, which is not a live visit`})}o(lr,"televetBookingNotLiveError");var on="televet_booking_key_reused",hi="IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST";function ar(e){return e.httpStatus!==409||e.reasonCode===on||wt(e)?.code!==hi?e:ue(e.code,{retryable:false,httpStatus:409,...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:hi,reasonCode:on,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}o(ar,"foldTelevetBookingKeyReused");function wt(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let r=t,n=r.detail??r.error;return typeof n=="object"&&n!==null?n:r}o(wt,"details");function Qs(e){let t=wt(e)?.categories;return Array.isArray(t)?Object.freeze(t.filter(r=>typeof r=="string")):Object.freeze([])}o(Qs,"categoriesOf");function Ti(e){let t=wt(e)?.retry_after_seconds;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(Ti,"retryAfterOf");function Si(e){let t=e.wireMessage;if(typeof t=="string"&&t.trim().length>0)return t.trim();let r=wt(e)?.message;return typeof r=="string"&&r.trim().length>0?r.trim():null}o(Si,"messageOf");function Zs(e){let t=e.reasonCode;if(typeof t=="string"&&t.length>0)return t;let r=wt(e),n=r?.code??r?.error_code;return typeof n=="string"&&n.length>0?n:null}o(Zs,"codeOf");function ze(e){let t=e.httpStatus;if(t===402)return Object.freeze({kind:"not_entitled"});if(t===429||e.code==="rateLimited"||e.code==="quotaExceeded")return Object.freeze({kind:"rate_limited",retryAfterSeconds:Ti(e),message:Si(e)});if(t===404)return Object.freeze({kind:"unavailable"});switch(Zs(e)){case "televet_rate_limited":return Object.freeze({kind:"rate_limited",retryAfterSeconds:Ti(e),message:Si(e)});case "televet_emergency_ack_required":return Object.freeze({kind:"emergency",categories:Qs(e)});case "televet_not_entitled":return Object.freeze({kind:"not_entitled"});case "televet_slot_conflict":return Object.freeze({kind:"slot_taken"});case "televet_hold_invalid":return Object.freeze({kind:"slot_taken"});case Ei:return Object.freeze({kind:"slot_taken"});case on:return Object.freeze({kind:"slot_taken"});case "televet_clinician_cannot_prescribe":case "televet_clinician_unavailable":case "televet_clinician_not_bookable":return Object.freeze({kind:"clinician_unavailable"});case "televet_membership_conflict":return Object.freeze({kind:"not_entitled"});case "televet_registry_unavailable":return Object.freeze({kind:"failed"});}return Object.freeze({kind:"failed"})}o(ze,"televetBookingRefusal");function ed(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(ed,"isSafeRoomUrl");function td(e,t){return ed(e)&&t.trim().length>0}o(td,"isUsableRoomCredential");function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(sr,"isRecord");function ln(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}o(ln,"wholeNumber");function rd(e){if(!sr(e))return null;let t=ln(e.consult_minutes,1),r=ln(e.auto_end_minutes,0),n=ln(e.warn_before_seconds,0);return t===null||r===null||n===null?null:Object.freeze({consultMinutes:t,autoEndMinutes:r,warnBeforeSeconds:n})}o(rd,"parseCallLimits");function an(e){if(!sr(e))return null;let t=e.room_url??e.url,r=e.token;if(typeof t!="string"||typeof r!="string"||!td(t,r))return null;let n=e.recording_notice;return Object.freeze({roomUrl:t.trim(),token:r,recordingNotice:typeof n=="boolean"?n:true,callLimits:rd(e.call_limits)})}o(an,"parseVetCallCredential");function sn(e){let t=Ci(e.raw);return t!==null&&t.length>0?t:null}o(sn,"vetCallJoinReason");function Ci(e){if(!sr(e))return null;let t=e.detail??e.error,n=(sr(t)?t:e).reason;return typeof n=="string"?n:null}o(Ci,"reasonOf");function dn(e){if(e.httpStatus===404)return "unavailable";let t=Ci(e.raw);return t==="too_early"||t==="too_late"||t==="room_not_ready"?t:t!==null&&t.startsWith("status_")?"not_joinable":"unknown"}o(dn,"vetCallJoinRefusal");var xi=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],dr=new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),nd=new Set(["scheduled","in_progress","awaiting_summary"]);function ur(e){return nd.has(e.status)}o(ur,"isLiveConsult");var Ri=["wellness","prescription"],od=60;function cn(e){let t=Date.parse(e.startsAt),r=Date.parse(e.endsAt);if(Number.isNaN(t)||Number.isNaN(r))return null;let n=Math.round((r-t)/6e4);return n>0?Math.min(n,od):null}o(cn,"televetSlotMinutes");var cr=64,He=2e3,pr=10;function Ce(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}o(Ce,"isWellFormedStateCode");function Ae(e){return typeof e=="object"&&e!==null?e:null}o(Ae,"row");function Z(e){return typeof e=="string"&&e.length>0?e:null}o(Z,"str");function je(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}o(je,"trimmedOrNull");function ut(e,t){return typeof e=="boolean"?e:t}o(ut,"bool");function un(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(un,"num");function ki(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}o(ki,"closed");function ct(e,t){if(!Array.isArray(e))return Object.freeze([]);let r=[];for(let n of e){let l=t(n);l!==null&&r.push(l);}return Object.freeze(r)}o(ct,"parseList");function _i(e,t){let r=Ae(e);return r===null?null:Object.freeze({state:Z(r.state)??t,wellnessAvailable:ut(r.wellness_available,false),prescriptionsAvailable:ut(r.prescriptions_available,false),cancellationPolicyText:je(r.cancellation_policy_text)})}o(_i,"parseStatePolicy");function Pi(e){let t=Ae(e);if(t===null)return null;let r=je(t.summary),n=je(t.version);return r===null||n===null?null:Object.freeze({summary:r,version:n})}o(Pi,"parseCancellationPolicy");function wi(e){let t=Ae(e);if(t===null)return null;let r=Z(t.clinician_id),n=Z(t.display_name);return r===null||n===null?null:Object.freeze({clinicianId:r,displayName:n,credentials:je(t.credentials_text),rating:un(t.rating),ratingCount:un(t.rating_count),bio:je(t.bio),photoRef:Z(t.photo_ref),licensedStates:ct(t.licensed_states,l=>{let a=Ae(l),s=a===null?null:Z(a.state);return s===null?null:Object.freeze({state:s,canPrescribe:ut(a?.can_prescribe,false)})})})}o(wi,"parseClinician");function pn(e){let t=Ae(e);if(t===null)return null;let r=Z(t.slot_id),n=Z(t.starts_at);return r===null||n===null?null:Object.freeze({slotId:r,startsAt:n,endsAt:Z(t.ends_at)??n})}o(pn,"parseSlot");function Ii(e){let t=Ae(e);if(t===null)return null;let r=Z(t.slot_id),n=Z(t.hold_expires_at);return r===null||n===null?null:Object.freeze({slotId:r,expiresAt:n})}o(Ii,"parseSlotHold");function It(e){let t=Ae(e);if(t===null)return null;let r=Z(t.consult_id),n=Z(t.scheduled_at);return r===null||n===null?null:Object.freeze({consultId:r,petId:Z(t.pet_id)??"",clinicianId:Z(t.clinician_id)??"",clinicianName:je(t.display_name),reasonText:je(t.reason_text),mediaRefs:ct(t.media_refs,l=>Z(l)),status:ki(xi,t.status),kind:ki(Ri,t.kind),scheduledAt:n,emergencyFlagged:ut(t.emergency_flagged,false),hasRoom:Z(t.meeting_url)!==null})}o(It,"parseConsult");function Oi(e){let t=Ae(e);return Object.freeze({active:ut(t?.active,false)})}o(Oi,"parseBookingEntitlement");var Ve=240;function Ai(e){let t=Ae(e);if(t===null)return null;let r=un(t.fee_cents);return r===null||r<0?null:Object.freeze({feeCents:r,currency:Z(t.currency)??"usd",feeRecorded:ut(t.fee_recorded,r>0),summary:je(t.summary)})}o(Ai,"parseCancelReceipt");var Ue="/widget/v1/televet",id=`${Ue}/state-policy`,ld=`${Ue}/vets`,Bi=`${Ue}/slots`,ad=`${Ue}/slots/next`,fr=`${Ue}/consults`,sd=`${Ue}/entitlement`,dd=`${Ue}/cancellation-policy`;function Ni(e){return `${Bi}/${encodeURIComponent(e)}/hold`}o(Ni,"televetHoldCall");function Di(e){return `${fr}/${encodeURIComponent(e)}/reschedule`}o(Di,"televetRescheduleCall");function yr(e){return `${fr}/${encodeURIComponent(e)}`}o(yr,"televetConsultCall");function Li(e){return `${yr(e)}/join`}o(Li,"televetJoinCall");function Fi(e){return `${yr(e)}/cancel`}o(Fi,"televetCancelCall");var Mi=100;function ce(e){return w(ue("validationFailed",{retryable:false,wireMessage:e}))}o(ce,"invalid");function Je(e){return w(ue("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}o(Je,"unusable");function fn(e){return e.httpStatus===404}o(fn,"isDark");function pt(e,t,r){try{e?.track(t,r);}catch{}}o(pt,"safeTrack");function zi(e){if(e.pet_id.trim().length===0)return "pet_id is required";if(e.clinician_id.trim().length===0)return "clinician_id is required";if(e.slot_id.trim().length===0)return "slot_id is required";if(!Ce(e.state))return "state must be a two-letter US state code";let t=e.reason_text.trim();return t.length===0?"reason_text is required":t.length>He?`reason_text must be at most ${He} characters`:ud(e)}o(zi,"validateBookingBody");function ud(e){let t=e.state_attested===true,r=e.cancellation_policy_version?.trim()??"";return t!==r.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":r.length>cr?`cancellation_policy_version must be at most ${cr} characters`:null}o(ud,"attestationRefusal");function mn(e){let t=e.funnel??Pt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry;return {async statePolicy(n,l){let a=n.trim();if(!Ce(a))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.state_policy",{method:"GET",path:`${id}/${encodeURIComponent(a)}`,...l?{signal:l}:{}});if(!s.ok)return w(s.error);let i=_i(s.value,a);return i===null?Je("the state policy response was unreadable"):F(i)},async entitlement(n){let l=await t.send("televet.booking.entitlement",{method:"GET",path:sd,...n?{signal:n}:{}});return l.ok?F(Oi(l.value)):w(l.error)},async cancellationPolicy(n){let l=await t.send("televet.booking.cancellation_policy",{method:"GET",path:dd,...n?{signal:n}:{}});return l.ok?F(Pi(l.value)):F(null)},async clinicians(n,l){let a=n.trim();if(!Ce(a))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.clinicians",{method:"GET",path:ld,query:{state:a},...l?{signal:l}:{}});return s.ok?F(ct(yn(s.value,"vets"),wi)):fn(s.error)?F(Object.freeze([])):w(s.error)},async slots(n,l){let a=n.trim();if(a.length===0)return ce("clinicianId is required");let s=await t.send("televet.booking.slots",{method:"GET",path:Bi,query:{clinician_id:a},...l?{signal:l}:{}});return s.ok?F(ct(yn(s.value,"slots"),pn)):fn(s.error)?F(Object.freeze([])):w(s.error)},async nextSlot(n){let l=await t.send("televet.booking.next_slot",{method:"GET",path:ad,...n?{signal:n}:{}});return l.ok?F(pn(pd(l.value,"slot"))):F(null)},async holdSlot(n){let l=n.trim();if(l.length===0)return ce("slotId is required");let a=await t.send("televet.booking.hold",{method:"POST",path:Ni(l)},{idempotent:false,maxAttempts:1});if(!a.ok)return pt(r,"televet.booking.hold_failed",{status:a.error.httpStatus??null}),w(a.error);let s=Ii(a.value);return s===null?Je("the hold response carried no usable expiry"):F(s)},async book(n,l){let a=zi(n);if(a!==null)return ce(a);let s=l.trim();if(s.length===0)return ce("idempotencyKey is required");let i=await t.send("televet.booking.book",{method:"POST",path:fr,body:cd(n)},{idempotent:true,idempotencyKey:s,maxAttempts:1});if(!i.ok)return pt(r,"televet.booking.book_failed",{status:i.error.httpStatus??null}),w(ar(i.error));let d=It(i.value);return d===null?Je("the booking response was unreadable"):ur(d)?F(d):(pt(r,"televet.booking.book_failed",{status:null,consult_status:d.status}),w(lr(d.status)))},async reschedule(n,l){let a=n.trim(),s=l.trim();if(a.length===0)return ce("consultId is required");if(s.length===0)return ce("slotId is required");let i=await t.send("televet.booking.reschedule",{method:"POST",path:Di(a),body:{new_slot_id:s}},{idempotent:false,maxAttempts:1});if(!i.ok)return pt(r,"televet.booking.reschedule_failed",{status:i.error.httpStatus??null}),w(i.error);let d=It(i.value);return d===null?Je("the reschedule response was unreadable"):F(d)},async listConsults(n){let l=await t.send("televet.booking.consults",{method:"GET",path:fr,query:{limit:String(Mi)},...n?{signal:n}:{}});return l.ok?F(ct(yn(l.value,"consults"),It)):fn(l.error)?F(Object.freeze([])):w(l.error)},async getConsult(n,l){let a=n.trim();if(a.length===0)return ce("consultId is required");let s=await t.send("televet.booking.consult",{method:"GET",path:yr(a),...l?{signal:l}:{}});if(!s.ok)return w(s.error);let i=It(s.value);return i===null?Je("the consult response was unreadable"):F(i)},async joinConsult(n){let l=n.trim();if(l.length===0)return ce("consultId is required");let a=await t.send("televet.booking.join",{method:"POST",path:Li(l)},{idempotent:false,maxAttempts:1});if(!a.ok)return pt(r,"televet.booking.join_failed",{status:a.error.httpStatus??null}),w(a.error);let s=an(a.value);return s===null?Je("the join response carried no usable room credential"):F(s)},async cancelConsult(n,l){let a=n.trim(),s=l.trim();if(a.length===0)return ce("consultId is required");if(s.length===0)return ce("reason is required");if(s.length>Ve)return ce(`reason must be at most ${Ve} characters`);let i=await t.send("televet.booking.cancel",{method:"POST",path:Fi(a),body:{reason:s}},{idempotent:false,maxAttempts:1});if(!i.ok)return pt(r,"televet.booking.cancel_failed",{status:i.error.httpStatus??null}),w(i.error);let d=Ai(i.value);return d===null?Je("the cancel response was unreadable"):F(d)}}}o(mn,"createTelevetBookingController");function cd(e){let t=e.cancellation_policy_version?.trim()??"",r=e.state_attested===true&&t.length>0;return {pet_id:e.pet_id,clinician_id:e.clinician_id,slot_id:e.slot_id,state:e.state,reason_text:e.reason_text.trim(),species:e.species,media_refs:[...e.media_refs],emergency_acknowledged:e.emergency_acknowledged,share_health_records:e.share_health_records,...r?{state_attested:true,cancellation_policy_version:t}:{}}}o(cd,"bookingWireBody");function yn(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let r=e,n=r[t]??r.items??r.data;if(Array.isArray(n))return n}return e}o(yn,"rows");function pd(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=e,n=r[t]??r.data;if(typeof n=="object"&&n!==null)return n}return e}o(pd,"unwrap");var ji=Symbol.for("@everfur/sdk#EverfurContext@v1"),Hi=globalThis,Vi=Hi[ji]??(Hi[ji]=react.createContext(null));Vi.displayName??="EverfurContext";function Xe(){let e=react.useContext(Vi);if(e===null)throw new Rt("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(Xe,"useEverfurContext");var md=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function gd(e){return md[e]}o(gd,"requires");function Ui(e,t,r){let n=gd(e),l=new Map;for(let i of t)l.set(i.resource,i);if(r?.isPending===true&&n.some(i=>!l.has(i)))return gn({name:e,enabled:false,isPending:true,limits:{}});let a=vd(n,l);return n.filter(i=>l.get(i)?.granted!==true).length===0?gn({name:e,enabled:true,isPending:false,limits:a}):gn({name:e,enabled:false,isPending:false,limits:a,disabled:bd(n,l)})}o(Ui,"decideCapability");function vd(e,t){let r={};for(let n of e){let l=t.get(n)?.limits;if(l)for(let[a,s]of Object.entries(l)){let i=r[a];r[a]=i===void 0?s:Math.min(i,s);}}return r}o(vd,"mergeLimits");function bd(e,t){for(let r of e){let n=t.get(r)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Zr("accessDenied"),level:"user_entitlement",recoverable:false})}o(bd,"disabledFor");function gn(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),Object.freeze(t)}o(gn,"freezeDecision");function Ot(e){let{runtime:t}=Xe(),r=t.entitlements,n=react.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);return react.useMemo(()=>Ui(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ot,"useCapability");function he(e){let{runtime:t,userRef:r,scopeEpoch:n}=Xe();return react.useMemo(()=>{if(e)return e;if(r===null)return null;let{services:l}=t.registry;return mn({auth:l.authFor(r),telemetry:l.telemetry,...l.errorPolicy?{errorPolicy:l.errorPolicy}:{}})},[t,r,n,e])}o(he,"useTelevetBookingController");function Sd(){let{userRef:e}=Xe(),t=Ot("televet");return react.useMemo(()=>({available:t.enabled&&e!==null,isPending:t.isPending}),[t.enabled,t.isPending,e])}o(Sd,"useTelevetBookingAvailable");function Qe(e,t,r){let[n,l]=react.useState(()=>({key:e,data:null,isPending:t&&r!==null,error:null})),[a,s]=react.useState(0),i=react.useRef(r);i.current=r,react.useEffect(()=>{let u=i.current;if(!t||u===null){l({key:e,data:null,isPending:false,error:null});return}let p=new AbortController,m=true;return l(y=>y.key===e?{...y,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let y;try{y=await u(p.signal);}catch{m&&l({key:e,data:null,isPending:false,error:null});return}m&&(y.ok?l({key:e,data:y.value,isPending:false,error:null}):l({key:e,data:null,isPending:false,error:y.error}));})(),()=>{m=false,p.abort();}},[e,t,a]);let d=react.useCallback(()=>s(u=>u+1),[]),c=n.key===e;return react.useMemo(()=>({enabled:t,data:c?n.data:null,isPending:t&&(!c||n.isPending),isError:c&&n.error!==null,error:c?n.error:null,refetch:d}),[t,c,n.data,n.isPending,n.error,d])}o(Qe,"useTelevetRead");function bn(e,t){let r=e?.trim()??"",n=t?.statePolicy!==void 0&&Ce(r),l=t?.statePolicy;return Qe(`state-policy:${r}`,n,n&&l?a=>l.call(t,r,a):null)}o(bn,"useTelevetStatePolicy");function hn(e){let t=e?.entitlement!==void 0,r=e?.entitlement;return Qe("entitlement",t,t&&r?n=>r.call(e,n):null)}o(hn,"useTelevetBookingEntitlement");function At(e){let t=e?.cancellationPolicy!==void 0,r=e?.cancellationPolicy;return Qe("cancellation-policy",t,t&&r?n=>r.call(e,n):null)}o(At,"useTelevetCancellationPolicy");function Tn(e,t){let r=e?.trim()??"",n=t?.clinicians!==void 0&&Ce(r),l=t?.clinicians;return Qe(`clinicians:${r}`,n,n&&l?a=>l.call(t,r,a):null)}o(Tn,"useTelevetClinicians");function Bt(e,t){let r=e?.trim()??"",n=t!==null&&r.length>0;return Qe(`slots:${r}`,n,n&&t?l=>t.slots(r,l):null)}o(Bt,"useTelevetSlots");function Sn(e){let t=e?.nextSlot!==void 0,r=e?.nextSlot;return Qe("next-slot",t,t&&r?n=>r.call(e,n):null)}o(Sn,"useTelevetNextSlot");function En(e){let[t,r]=react.useState(null),n=react.useRef(true),l=react.useRef(false),a=react.useRef(e);a.current=e,react.useEffect(()=>(n.current=true,()=>{n.current=false;}),[]);let s=react.useCallback((...i)=>{let d=a.current;if(d===null||l.current)return;let c=i[i.length-1],u=typeof c=="object"&&c!==null&&("onSuccess"in c||"onError"in c),p=u?c:void 0,m=u?i.slice(0,-1):i;l.current=true,r({variables:m[0]??null}),(async()=>{let y=null;try{y=await d(...m);}catch{y=null;}l.current=false,n.current&&r(null),y!==null&&(y.ok?p?.onSuccess?.(y.value):p?.onError?.(y.error));})();},[]);return react.useMemo(()=>({isPending:t!==null,variables:t?.variables??null,mutate:s}),[t,s])}o(En,"useTelevetWrite");function Nt(e){return En(e?t=>e.holdSlot(t):null)}o(Nt,"useTelevetHoldSlot");function Cn(e){return En(e?(t,r)=>e.book(t,r):null)}o(Cn,"useTelevetBookConsult");function kn(e,t){return En(t&&e?r=>t.reschedule(e,r):null)}o(kn,"useTelevetRescheduleConsult");function vr(e,t=0){let r=e?.listConsults!==void 0,n=e?.listConsults;return Qe(`consults:${t}`,r,r&&n?l=>n.call(e,l):null)}o(vr,"useTelevetConsults");function xn(e){return e.error!==null&&e.error.httpStatus===404}o(xn,"televetReadIsDark");var Rn=15,_n=250,Ki=new Set(["scheduled","in_progress"]);function Ze(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}o(Ze,"startsAtMs");function Pn(e){let t=Ze(e);return t===null?null:t-Rn*6e4}o(Pn,"televetJoinOpensAtMs");function wn(e,t){if(!Ki.has(e.status))return {joinable:false,reason:`status_${e.status}`};if(!e.hasRoom)return {joinable:false,reason:"room_not_ready"};let r=Ze(e);return r===null||t<r-Rn*6e4?{joinable:false,reason:"too_early"}:t>r+_n*6e4?{joinable:false,reason:"too_late"}:{joinable:true}}o(wn,"televetJoinDecision");function Dt(e,t){let r=[],n=[];for(let l of e){let a=Ze(l);(Ki.has(l.status)&&a!==null&&a+_n*6e4>t?r:n).push(l);}return r.sort((l,a)=>(Ze(l)??0)-(Ze(a)??0)),n.sort((l,a)=>(Ze(a)??0)-(Ze(l)??0)),Object.freeze({upcoming:Object.freeze(r),past:Object.freeze(n)})}o(Dt,"splitTelevetVisits");function In(e){return e==="scheduled"}o(In,"canManageTelevetVisit");function qi(e){let t=vr(e);return t.enabled?t.isPending?"pending":t.isError||Dt(t.data??[],Date.now()).upcoming.length>0?"visits":"booking":"booking"}o(qi,"useTelevetLanding");var I=Object.freeze({bookCardTitle:"Book a video visit",bookCardCta:"Find a time",upcomingTitle:"Upcoming visits",pastTitle:"Past visits",emptyTitle:"No visits yet",emptyBody:"When you book a video visit, it will appear here.",loading:"Loading your visits\u2026",loadErrorTitle:"Could not load your visits",loadErrorBody:"Check your connection and try again.",retry:"Try again",joinCta:"Join visit",joining:"Joining\u2026",rescheduleCta:"Reschedule",cancelCta:"Cancel visit",cancelConfirmTitle:"Cancel this visit?",cancellationReasonLabel:"Why are you cancelling?",cancelConfirmCta:"Cancel visit",cancellingVisit:"Cancelling visit\u2026",cancelDismissCta:"Keep visit",cancelledTitle:"Visit cancelled",cancellationFeeRecorded:"A late cancellation fee was recorded for this visit.",cancellationFeeNotRecorded:"No late cancellation fee was recorded for this visit.",loadingCancellationTerms:"Loading cancellation terms\u2026",cancellationTermsUnavailable:"We could not confirm the current cancellation terms. Try again before continuing.",cancellationReasonMissing:"Tell us why you are cancelling.",cancellationReasonTooLong:o(e=>`Keep the reason to ${String(e)} characters or fewer.`,"cancellationReasonTooLong"),cancelTermsFirst:"We could not confirm the cancellation terms. Please try again before cancelling.",cancelFailed:"We could not cancel this visit. Refresh your visits to confirm its status before trying again."});function Yi(e){switch(e){case "scheduled":return "Scheduled";case "in_progress":return "In progress";case "awaiting_summary":return "Summary on its way";case "completed":return "Completed";case "cancelled_owner":return "Cancelled by you";case "cancelled_ops":return "Cancelled by Everfur";case "no_show_owner":return "Missed";case "no_show_vet":return "Vet couldn't attend";default:return null}}o(Yi,"televetVisitStatusWeb");function Gi(e,t){if(e==="too_early")return t?`This visit opens at ${t}. You can join from then.`:"This visit has not opened yet.";if(e==="too_late")return "This visit has ended.";if(e==="room_not_ready")return "We are still setting up the video room. Try again in a moment.";switch(e){case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return "This visit cannot be joined right now."}}o(Gi,"televetJoinBlockWeb");var Bn=class Bn extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(r,n){return Object.is(r.resetKey,n.key)?null:{failed:false,key:r.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Bn,"HostRenderBoundary");var On=Bn;function Cd({render:e}){return e()}o(Cd,"RenderHost");function An({render:e,fallback:t,resetKey:r}){return react.createElement(On,{fallback:t,resetKey:r,children:react.createElement(Cd,{render:e})})}o(An,"HostRender");function Ln(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Ln(e[t]);}return e}o(Ln,"deepFreeze");var kd=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Qi={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Zi={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Xi={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},xd={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Rd={regular:"400",medium:"500",bold:"700"},_d={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Pd=0,br="System",hr="monospace",wd=["content","heading","control","compact","badge"];function Id(e){let t={};for(let r of wd)t[r]=e;return t}o(Id,"authoredTierSizes");function el(){return {family:br,mono:hr,fontUrl:null,families:{regular:br,medium:br,bold:br,mono:hr,monoMedium:hr,monoBold:hr},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Xi,tierSizes:Id(Xi),lineHeight:xd,weight:Rd,letterSpacing:_d,scale:1,maxScale:Pd,scaleCaps:kd}}o(el,"baseType");var tl={},Nn=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Dn(e){return `cubic-bezier(${e.join(", ")})`}o(Dn,"cssCubicBezier");var rl={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Dn(Nn.standard),emphasized:Dn(Nn.emphasized),exit:Dn(Nn.exit)},reducedMotion:false},Od={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},nl=Ln({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Od,space:Qi,radius:Zi,type:el(),motion:rl,slots:tl}),Ad={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Ln({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ad,space:Qi,radius:Zi,type:el(),motion:rl,slots:tl});var ol=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),il=globalThis,Fn=il[ol]??(il[ol]=react.createContext(nl));Fn.displayName??="EverfurThemeContext";function _(){return react.useContext(Fn)}o(_,"useEverfurTheme");var ll=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var al='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Dd="System";function Ld(e){let t=e.trim();return t.length===0||t===Dd?al:`${sl(t)}, ${al}`}o(Ld,"cssFontFamily");function Fd(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${sl(t)}, ui-monospace, Menlo, Consolas, monospace`}o(Fd,"cssMonoFamily");function sl(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}o(sl,"quote");function v(e,t){let r=e.type,n=r.families[t];return {fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?Fd(n):Ld(n),fontWeight:r.namedFaces[t]?r.weight.regular:r.weight[ll[t]]}}o(v,"faceCss");var ft=Object.freeze({textAlign:"start"});var Md=48;function zd(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(zd,"selectView");function cl(e){let{capability:t,children:r,renderDisabled:n,renderPending:l,style:a,className:s}=e,i=Ot(t),d=react.useMemo(()=>zd(i),[i]);switch(d){case "enabled":return r;case "pending":return l?jsxRuntime.jsx(An,{render:l,fallback:jsxRuntime.jsx(dl,{capability:t,style:a,className:s})}):jsxRuntime.jsx(dl,{capability:t,style:a,className:s});case "disabled":return n?jsxRuntime.jsx(An,{render:()=>n(i),fallback:jsxRuntime.jsx(ul,{decision:i,style:a,className:s}),resetKey:i}):jsxRuntime.jsx(ul,{decision:i,style:a,className:s});default:return tr(d)}}o(cl,"CapabilityGate");function dl({capability:e,style:t,className:r}){let n=_(),l=react.useMemo(()=>pl(n),[n]);return jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${e}`,className:r,style:{...l.offstate,...t},children:jsxRuntime.jsx("div",{style:l.skeletonBar})})}o(dl,"PendingSkeleton");function ul({decision:e,style:t,className:r}){let n=_(),l=react.useMemo(()=>pl(n),[n]),a=e.disabled?.reason??"";return jsxRuntime.jsx("div",{className:r,style:{...l.offstate,...t},children:a.length>0?jsxRuntime.jsx("p",{style:l.offstateText,children:a}):null})}o(ul,"OffState");function pl(e){let{color:t,space:r,radius:n,type:l}=e;return {offstate:{...ft,boxSizing:"border-box",minHeight:Md,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${r.md}px ${r.lg}px`,backgroundColor:t.surfaceCream,borderRadius:n.md,border:`1px solid ${t.brandBorder}`},offstateText:{margin:0,...v(e,"regular"),fontSize:l.size.body,lineHeight:`${Math.round(l.size.body*l.lineHeight.normal)}px`,color:t.text.muted},skeletonBar:{height:r.md,borderRadius:n.xs,backgroundColor:t.brandSofter}}}o(pl,"makeStyles");function Tr(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}o(Tr,"hasLoneSurrogate");function Sr(e){return [...e].length}o(Sr,"serverLength");var fl=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function yl(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(fl,t)?fl[t]:null}o(yl,"canonicalPetSpecies");var ml=50,jd=128,zn=120,gl=120,Hd=2e3,vl=120,Vd=80,Tl=new Set(["male","female","unknown"]),Sl=new Set(["day","month","year"]),El=new Set(["low","medium","high","athletic"]),Cl=new Set(["indoor","outdoor","both"]),kl=new Set(["mild","moderate","severe"]),Ud=/^(\d{4})-(\d{2})-(\d{2})$/,xl=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],Rl=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...xl,...Rl].map(([e])=>e));function Wd(e){let t=Ud.exec(e);if(t===null)return false;let[r,n,l]=[Number(t[1]),Number(t[2]),Number(t[3])],a=new Date(Date.UTC(r,n-1,l));return a.getUTCFullYear()===r&&a.getUTCMonth()===n-1&&a.getUTCDate()===l}o(Wd,"isRealDate");var Ft=o(e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,"oneOf"),$d=o((e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,"boolean"),Cr=o((e,t)=>typeof t=="string"&&Wd(t)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),xe=o((e,t={})=>(r,n)=>{if(typeof n!="string")return `${r} must be a string`;if(Tr(n))return `${r} contains an unpaired surrogate and cannot be encoded`;let l=t.trimmed?n.trim():n;if(t.required&&l.length===0)return `${r} is required and must not be blank`;let a=Sr(l);return a<=e?null:`${r} is ${a} characters; the server accepts at most ${e}`},"text"),Kd={sex:Ft(Tl),spayedNeutered:$d,birthDate:Cr,birthDatePrecision:Ft(Sl),activityLevel:Ft(El),indoorOutdoor:Ft(Cl),foodBrand:xe(vl),foodType:xe(vl),microchipId:xe(Vd)},jn=["ref","ref",false,xe(jd,{required:true,trimmed:true})],Hn=["notes","notes",false,xe(Hd,{trimmed:true})],bl=[jn,["name","name",true,xe(zn,{required:true,trimmed:true})],["dose","dose",false,xe(gl,{trimmed:true})],["frequency","frequency",false,xe(gl,{trimmed:true})],["startDate","start_date",false,Cr],["endDate","end_date",false,Cr],Hn],qd={allergies:[jn,["allergen","allergen",true,xe(zn,{required:true,trimmed:true})],["severity","severity",false,Ft(kl)],Hn],medications:bl,supplements:bl,conditions:[jn,["conditionName","condition_name",true,xe(zn,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Cr],Hn]};function Yd(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return {error:`${n} must be an object`};let l=r,a={};for(let[d,c,u,p]of qd[e]){let m=l[d];if(m==null){if(u)return {error:`${n}.${d} is required`};m===null&&(a[c]=null);continue}let y=p(`${n}.${d}`,m);if(y!==null)return {error:y};a[c]=m;}let s=a.start_date,i=a.end_date;return typeof s=="string"&&typeof i=="string"&&i<s?{error:`${n}.endDate must not be before startDate`}:{item:a}}o(Yd,"itemToWire");function Gd(e,t){if(!Array.isArray(t))return {error:`${e} must be an array (send [] to clear it)`};if(t.length>ml)return {error:`${e} has ${t.length} items; the server accepts at most ${ml}`};let r=[],n=new Set;for(let l=0;l<t.length;l+=1){let a=Yd(e,l,t[l]);if("error"in a)return a;let s=a.item.ref;if(typeof s=="string"){let i=s.trim();if(n.has(i))return {error:`${e}: ref ${JSON.stringify(i)} is used twice; a ref names one item`};n.add(i);}r.push(a.item);}return {items:r}}o(Gd,"listToWire");function _l(e,t){let r=e,n={};for(let[s,i]of xl){let d=r[s];if(d!==void 0){if(d!==null){let c=Kd[s](s,d);if(c!==null)return {error:c}}n[i]=d;}}let l=r.birthDate!==void 0,a=r.birthDatePrecision!==void 0;if(l!==a||l&&r.birthDate===null!=(r.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[s,i]of Rl){let d=r[s];if(d===void 0)continue;let c=Gd(s,d);if("error"in c)return c;n[i]=c.items;}return Object.keys(n).length>0&&t!==void 0&&yl(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}o(_l,"petHealthToWire");var G=o(e=>typeof e=="string"?e:null,"str"),Lt=o((e,t)=>typeof t=="string"&&e.has(t)?t:null,"pick"),Jd=o(e=>typeof e=="boolean"?e:null,"bool");function Er(e,t){return Array.isArray(e)?Object.freeze(e.flatMap(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return [];let n=t(r);return n===null?[]:[n]})):Object.freeze([])}o(Er,"itemsFromWire");function hl(e){let t=G(e.name);return t===null||t.length===0?null:Object.freeze({ref:G(e.ref),name:t,dose:G(e.dose),frequency:G(e.frequency),startDate:G(e.start_date),endDate:G(e.end_date),notes:G(e.notes)})}o(hl,"medicationFromWire");function Pl(e){let t=e.profile_version;return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:Lt(Tl,e.sex),spayedNeutered:Jd(e.spayed_neutered),birthDate:G(e.birth_date),birthDatePrecision:Lt(Sl,e.birth_date_precision),activityLevel:Lt(El,e.activity_level),indoorOutdoor:Lt(Cl,e.indoor_outdoor),foodBrand:G(e.food_brand),foodType:G(e.food_type),microchipId:G(e.microchip_id),allergies:Er(e.allergies,r=>{let n=G(r.allergen);return n===null||n.length===0?null:Object.freeze({ref:G(r.ref),allergen:n,severity:Lt(kl,r.severity),notes:G(r.notes)})}),medications:Er(e.medications,hl),supplements:Er(e.supplements,hl),conditions:Er(e.conditions,r=>{let n=G(r.condition_name);return n===null||n.length===0?null:Object.freeze({ref:G(r.ref),conditionName:n,diagnosedDate:G(r.diagnosed_date),notes:G(r.notes)})})})}o(Pl,"petHealthFromWire");var Ol=100,Al=50,Bl=100,Nl=50,Dl=500,Xd=128,Qd=6e4;function _e(e){return ue("validationFailed",{retryable:false,wireMessage:e})}o(_e,"invalid");function et(e,t,r){if(typeof t!="string")return _e(`${e} must be a string`);let n=Sr(t);return n<=r?null:_e(`${e} is ${n} characters; the server accepts at most ${r}`)}o(et,"checkString");function kr(e,t,r){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=r?null:_e(`${e} must be a finite number between 0 and ${r}`)}o(kr,"outOfRange");function wl(e,t){if(typeof e!="string")return _e("pet_ref must be a string");if(e.trim().length===0)return _e("pet_ref must not be blank");if(Tr(e))return _e("pet_ref contains an unpaired surrogate and cannot be encoded");if(t!=null&&typeof t!="object")return _e("profile must be an object");let r=[et("pet_ref",e,Xd)];return t?.name!==void 0&&r.push(et("name",t.name,Ol)),t?.species!==void 0&&r.push(et("species",t.species,Al)),t?.breed!==void 0&&r.push(et("breed",t.breed,Bl)),t?.ageYears!==void 0&&r.push(kr("age_years",t.ageYears,Nl)),t?.weightKg!==void 0&&r.push(kr("weight_kg",t.weightKg,Dl)),r.find(n=>n!==null)??null}o(wl,"validate");function Ll(e,t){let r=_l(e,t);return "error"in r?{error:_e(r.error)}:r}o(Ll,"healthToWire");function Zd(e){if(typeof e!="object"||e===null)return {error:_e("patch must be an object")};let t=e,r=[["name","name",a=>et("name",a,Ol)],["species","species",a=>et("species",a,Al)],["breed","breed",a=>et("breed",a,Bl)],["ageYears","age_years",a=>kr("age_years",a,Nl)],["weightKg","weight_kg",a=>kr("weight_kg",a,Dl)]],n={};for(let[a,s,i]of r){let d=t[a];if(d!==void 0){if(d!==null){let c=i(d);if(c!==null)return {error:c}}n[s]=d;}}let l=Ll(t,t.species);return "error"in l?l:(Object.assign(n,l.body),Object.keys(n).length===0?{error:_e("patch must change at least one field")}:{body:n})}o(Zd,"patchToWire");function eu(e){if(e==null)return {body:{}};let t=Ll(e,e.species);return "error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}o(eu,"toWire");var Re=o(e=>typeof e=="string"?e:null,"str"),xr=o(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function Il(e,t){let r=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:Re(r.pet_ref)??t,name:Re(r.name),species:Re(r.species),breed:Re(r.breed),ageYears:xr(r.age_years),weightKg:xr(r.weight_kg)})}o(Il,"fromWire");function Fl(e){if(typeof e!="object"||e===null)return null;let t=e,r=Re(t.pet_ref);return r===null||r.length===0?null:Object.freeze({petId:Re(t.pet_id),petRef:r,name:Re(t.name),species:Re(t.species),breed:Re(t.breed),ageYears:xr(t.age_years),weightKg:xr(t.weight_kg),updatedAt:Re(t.updated_at)})}o(Fl,"widgetPetFromWire");function tu(e){let t=Fl(e);return t===null?null:Object.freeze({...t,...Pl(e)})}o(tu,"widgetPetProfileFromWire");function ru(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(t.flatMap(r=>{let n=Fl(r);return n===null?[]:[n]}))}o(ru,"petListFromWire");function Ml(e){return nu(Pt({auth:e}),Pt({auth:e,unaryTimeoutMs:Qd}))}o(Ml,"createPetsRepository");function nu(e,t=e){let r=o((l,a)=>a?{...l,signal:a}:l,"withSignal"),n=o(l=>wl(l,void 0)??`/widget/v1/pets/${encodeURIComponent(l)}`,"petPath");return {async list(l){let a=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},l?.signal));return a.ok?F(ru(a.value)):w(a.error)},async registerPet(l,a,s){let i=wl(l,a);if(i!==null)return w(i);let d=eu(a);if("error"in d)return w(d.error);let u={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(l)}`,body:d.body},p=await e.send("pets.registerPet",s?.signal?{...u,signal:s.signal}:u);return p.ok?F(Il(p.value,l)):w(p.error)},async updatePet(l,a,s){let i=n(l);if(typeof i!="string")return w(i);let d=Zd(a);if("error"in d)return w(d.error);let c=await e.send("pets.updatePet",r({method:"PATCH",path:i,body:d.body},s?.signal));return c.ok?F(Il(c.value,l)):w(c.error)},async getPetProfile(l,a){let s=n(l);if(typeof s!="string")return w(s);let i=await e.send("pets.getPetProfile",r({method:"GET",path:`${s}/profile`},a?.signal));if(!i.ok)return w(i.error);let d=tu(i.value);return d===null?w(ue("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):F(d)},async deletePet(l,a){let s=n(l);if(typeof s!="string")return w(s);let i=await e.send("pets.deletePet",r({method:"DELETE",path:s},a?.signal));return i.ok?F(void 0):w(i.error)},async eraseUserData(l){let a=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},l?.signal),{maxAttempts:1});return a.ok?F(void 0):w(a.error)}}}o(nu,"createPetsRepositoryOver");function Rr(){let{runtime:e,userRef:t,activePet:r,scopeEpoch:n}=Xe(),l=react.useMemo(()=>Ml(e.registry.services.authFor(t)),[e,t,n]),[a,s]=react.useState({repository:l,pets:[],loading:true,error:null}),i=a.repository===l?a:{pets:[],loading:true,error:null},d=react.useRef(0),c=react.useCallback(async()=>{let p=++d.current;s(y=>({...y,repository:l,loading:true,error:null,pets:y.repository===l?y.pets:[]}));let m=await l.list();p===d.current&&s(m.ok?{repository:l,pets:m.value,loading:false,error:null}:y=>({repository:l,pets:y.repository===l?y.pets:[],loading:false,error:m.error}));},[l]);react.useEffect(()=>(c(),()=>{d.current+=1;}),[c]);let u=react.useMemo(()=>r===null?null:i.pets.find(p=>p.petRef===r)??null,[r,i.pets]);return react.useMemo(()=>({pets:i.pets,activePet:u,loading:i.loading,error:i.error,refresh:c}),[i.pets,i.loading,i.error,u,c])}o(Rr,"useEverfurPets");var Mt=Object.freeze(["pet","issues","reason","clinician","time","review","booked"]),zl=Object.freeze({petId:null,state:null,clinicianId:null,slot:null,holdExpiresAt:null,shareHealthRecords:false,idempotencyKey:null});function Wn(e,t={}){let r=Object.freeze({...zl,...t}),n=Un(0,e);return Object.freeze({index:n,draft:r,furthestIndex:n})}o(Wn,"initialTelevetBookingState");function _r(e,t){return e==="pet"?t.ownedPetCount<=1:e==="issues"?t.withIssues!==true:false}o(_r,"isSkipped");function Pr(e){return Mt[e]}o(Pr,"stepAt");function Un(e,t){for(let r=e;r<Mt.length;r+=1){let n=Pr(r);if(n&&!_r(n,t))return r}return Mt.length-1}o(Un,"nextVisible");function jl(e,t){for(let r=e;r>=0;r-=1){let n=Pr(r);if(n&&!_r(n,t))return r}return null}o(jl,"previousVisible");function $n(e,t){return jl(e.index-1,t)!==null}o($n,"hasPreviousStep");function Kn(e,t,r){switch(t.type){case "patch":{let n={...e.draft,...t.patch};return ("petId"in t.patch&&t.patch.petId!==e.draft.petId||"state"in t.patch&&t.patch.state!==e.draft.state||"clinicianId"in t.patch&&t.patch.clinicianId!==e.draft.clinicianId)&&e.draft.slot?Object.freeze({...e,draft:Object.freeze({...n,slot:null,holdExpiresAt:null,idempotencyKey:null})}):Object.freeze({...e,draft:Object.freeze(n)})}case "next":{let n=Un(e.index+1,r);return Object.freeze({...e,index:n,furthestIndex:Math.max(e.furthestIndex,n)})}case "back":{if(Pr(e.index)==="booked")return e;let n=jl(e.index-1,r);return n===null?e:Object.freeze({...e,index:n})}case "goTo":{let n=Mt.indexOf(t.step);if(n<0)return e;let l=_r(t.step,r)?Un(n,r):n;return Object.freeze({...e,index:l,furthestIndex:Math.max(e.furthestIndex,l)})}default:return e}}o(Kn,"televetBookingReducer");function qn(e){return Pr(e.index)??"pet"}o(qn,"currentStep");function zt(e,t){let r=t.trim();return !!e.petId&&!!e.clinicianId&&!!e.slot&&Ce(e.state)&&r.length>0&&r.length<=He}o(zt,"canConfirm");function wr(e,t){if(!e.holdExpiresAt)return false;let r=Date.parse(e.holdExpiresAt);return Number.isNaN(r)?false:r<=t}o(wr,"isHoldExpired");function Hl(e,t,r){return e.slot?.slotId!==t||e.holdExpiresAt===null||e.idempotencyKey===null?false:!wr(e,r)}o(Hl,"holdsSlot");var Vl=Object.freeze({slot:null,holdExpiresAt:null,idempotencyKey:null}),su=rn();function Yn(e){return `televet.book.${su()}.${e}`}o(Yn,"televetBookingKey");function Gn(e,t,r){let n=r?.version?.trim()??"";return !e||!t||n.length===0?Object.freeze({}):Object.freeze({state_attested:true,cancellation_policy_version:n})}o(Gn,"attestation");var du=Object.freeze([{id:"itchy-skin",label:"Itchy skin and allergies"},{id:"upset-stomach",label:"Upset stomach"},{id:"ear-infections",label:"Ear infections"},{id:"anxiety",label:"Anxiety and behavior"},{id:"parasites",label:"Fleas, ticks, and heartworm"},{id:"joint-pain",label:"Joint pain and mobility"},{id:"eye-issues",label:"Eye issues"},{id:"urinary",label:"Urinary issues"},{id:"surgery-aftercare",label:"Surgery aftercare"},{id:"senior-dog-care",label:"Senior dog care",species:"dog"}]),uu="other";function cu(e){let t=e?.trim().toLowerCase()??"";return t.startsWith("dog")?"dog":t.startsWith("cat")?"cat":null}o(cu,"televetIssueSpecies");function Ul(e){let t=cu(e),r=du.filter(n=>!n.species||n.species===t).map(({id:n,label:l})=>Object.freeze({id:n,label:l}));return Object.freeze([...r,Object.freeze({id:uu,label:f.otherIssue})])}o(Ul,"televetIssueChips");function Wl(e,t){let r=e.filter(l=>l.trim().length>0),n=t.trim();return r.length===0?n:n.length===0?r.join(", "):`${r.join(", ")}
|
|
2
|
+
${n}`}o(Wl,"composeTelevetReason");function Be(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}o(Be,"parse");function yt(e){let t=Be(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}o(yt,"formatClock");function pu(e){let t=Be(e);return t?t.toLocaleDateString(void 0,{month:"long",day:"numeric"}):""}o(pu,"formatDate");var tt=10;function mt(e){let t=Be(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??"":""}o(mt,"formatZone");function fu(e){let t=Be(e);if(!t)return "";let r=new Date(t.getTime()+tt*6e4).toISOString(),n=mt(e),l=`${yt(e)} - ${yt(r)}`;return n&&n!==""?`${l} ${n}`:l}o(fu,"formatVisitRange");function $l(e){let t=pu(e),r=[yt(e),mt(e)].filter(Boolean).join(" ");return [t,r].filter(Boolean).join(", ")}o($l,"formatWhen");function Te(e){let t=Be(e);return t?[t.toLocaleDateString(void 0,{weekday:"short"}),$l(e)].filter(Boolean).join(", "):""}o(Te,"formatWhenWithDay");function Kl(e){let t=Be(e);if(!t)return "";let r=t.toLocaleString(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"}),n=mt(e);return n?`${r} ${n}`:r}o(Kl,"formatShortDateTimeWithZone");function ql(e){return [yt(e),mt(e)].filter(Boolean).join(" ")}o(ql,"formatClockWithZone");function jt(e){let t=Be(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:"unknown"}o(jt,"localDayKey");function Yl(e){let t=Be(e);return t===null?"":t.toLocaleDateString(void 0,{month:"long"})}o(Yl,"formatMonthLabel");function Gl(e){let t=Be(e);return t===null?"":t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}o(Gl,"formatFullDayLabel");function Xl(e){let{draft:t,reasonText:r,book:n,stateAttested:l,termsAttested:a,cancellationPolicy:s,triage:i,goTo:d,releaseSlot:c,setFailure:u,setEmergency:p,setBookedConsult:m,onBooked:y}=e,b=react.useCallback(h=>{if(!zt(t,r)||!t.idempotencyKey)return;if(wr(t,Date.now())){u("expired"),d("time");return}let k=o(E=>{let C=ze(E);if(C.kind==="emergency"){p(C.categories);return}if(C.kind==="rate_limited"){u("rate_limited");return}u(C.kind==="not_entitled"?"not_entitled":C.kind==="slot_taken"?"taken":C.kind==="clinician_unavailable"?"clinician_unavailable":C.kind==="unavailable"?"unavailable":"failed"),C.kind==="slot_taken"&&(c(),d("time"));},"refuse");u(null),p(null),n.mutate({pet_id:t.petId,clinician_id:t.clinicianId,slot_id:t.slot.slotId,state:t.state,reason_text:r.trim(),species:null,media_refs:[],emergency_acknowledged:h||i.isAcknowledged(r),share_health_records:t.shareHealthRecords,...Gn(l,a,s)},t.idempotencyKey,{onSuccess:o(E=>{if(!ur(E)){k(lr(E.status));return}m(E),d("booked"),y?.(E);},"onSuccess"),onError:o(E=>k(ar(E)),"onError")});},[t,r,n,l,a,s,i,d,c,u,p,m,y]),T=react.useCallback(()=>b(false),[b]);return {submitBooking:b,confirm:T}}o(Xl,"useBookingSubmit");function mu(e){if(e.httpStatus===409)return Object.freeze({failure:"taken"});switch(ze(e).kind){case "slot_taken":return Object.freeze({failure:"taken"});case "rate_limited":return Object.freeze({failure:"rate_limited"});case "not_entitled":return Object.freeze({failure:"not_entitled"});case "unavailable":return Object.freeze({failure:"unavailable"});default:return Object.freeze({failure:"failed"})}}o(mu,"televetHoldFailure");function Ql(e){let{draft:t,hold:r,dispatch:n,setFailure:l,refetchSlots:a}=e;return react.useCallback(s=>{if(l(null),Hl(t,s.slotId,Date.now())){n({type:"next"});return}r.mutate(s.slotId,{onSuccess:o(i=>{n({type:"patch",patch:{slot:s,holdExpiresAt:i.expiresAt,idempotencyKey:Yn(s.slotId)}}),n({type:"next"});},"onSuccess"),onError:o(i=>{let d=mu(i);l(d.failure),d.failure==="taken"&&a();},"onError")});},[t,r,n,l,a])}o(Ql,"useSlotHold");function Jn(e){return Object.freeze(e==="dark"?{title:ie.noCliniciansTitle,message:ie.noCliniciansBody,retryLabel:ie.noCliniciansRetryCta,interestReason:null}:{title:ie.noCliniciansTitle,message:ie.noCliniciansRegionBody,retryLabel:null,interestReason:"no_licensed_vet"})}o(Jn,"televetEmptyRosterView");function Xn(e){return e?"roster":"dark"}o(Xn,"televetEmptyRosterCause");var Ht=Object.freeze({failed:0,refused:Object.freeze({size:0,type:0,unreadable:0})});function Qn(e){let{failed:t,refused:r}=e;return t<=0&&r.size<=0&&r.type<=0&&r.unreadable<=0}o(Qn,"isMediaShortfallEmpty");function Zn(e){let t=o(n=>Number.isFinite(n)&&n>0?Math.floor(n):0,"count"),r=ie.media;return [{n:t(e.failed),one:r.droppedTemplate,many:r.droppedPluralTemplate},{n:t(e.refused.size),one:r.refusedSizeTemplate,many:r.refusedSizePluralTemplate},{n:t(e.refused.type),one:r.refusedTypeTemplate,many:r.refusedTypePluralTemplate},{n:t(e.refused.unreadable),one:r.refusedUnreadableTemplate,many:r.refusedUnreadablePluralTemplate}].filter(n=>n.n>0).map(n=>Y(n.n===1?n.one:n.many,{n:String(n.n)}))}o(Zn,"televetMediaShortfallLines");function Ir(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return t===0?Ht:Object.freeze({failed:t,refused:Ht.refused})}o(Ir,"mediaShortfallFromUnsentPicks");function gu(e,t){let r=Ir(t);return r.failed===0?e:Object.freeze({failed:e.failed+r.failed,refused:e.refused})}o(gu,"withUnsentPicks");function ro(e){let[t,r]=react.useState(false),[n,l]=react.useState(false),[a,s]=react.useState(null),i=react.useRef(null),d=react.useRef(null),c=react.useRef(true);react.useEffect(()=>(c.current=true,()=>{c.current=false,d.current?.abort(),d.current=null;}),[]);let u=react.useCallback(()=>{d.current?.abort(),d.current=null,c.current&&l(false);},[]),p=react.useCallback(async h=>{if(d.current!==null)return false;let k=h.trim();if(a!==null&&a===k||!e)return true;let E=i.current!==null&&i.current.reason===k?i.current.emergency:null;if(E===null){let C=new AbortController;d.current=C,l(true);try{let N=await e(k,C.signal);if(C.signal.aborted||!c.current)return !1;N===null?E=!1:(E=N.isEmergency||N.fallback,i.current=Object.freeze({reason:k,emergency:E}));}catch{if(C.signal.aborted||!c.current)return false;E=false;}finally{d.current===C&&(d.current=null,c.current&&l(false));}}return E===true?(r(true),false):true},[a,e]),m=react.useCallback(h=>{s(h.trim()),r(false);},[]),y=react.useCallback(()=>r(false),[]),b=react.useCallback(()=>{u(),i.current=null,s(null),r(false);},[u]),T=react.useCallback(h=>a!==null&&a===h.trim(),[a]);return {open:t,checking:n,check:p,acknowledge:m,close:y,cancel:u,reset:b,isAcknowledged:T}}o(ro,"useEarlyTriage");function Su(e){let t=e?.trim().toUpperCase()??"";return /^[A-Z]{2}$/.test(t)?t:null}o(Su,"normalizeStateCode");function no(e,t){let r=Su(e),[n,l]=react.useState(()=>Object.freeze({})),a=react.useRef(0),s=react.useRef(null),i=react.useCallback(d=>{if(!t||r===null)return null;let c=`${r}:${d}`;s.current!==null&&s.current!==c&&(a.current+=1),s.current=c;let u=n[c]??"idle";return {joined:u==="joined",pending:u==="pending",failed:u==="failed",onPress:o(()=>{if(u==="pending"||u==="joined")return;let p=a.current+=1;l(m=>Object.freeze({...m,[c]:"pending"})),(async()=>{let m=false;try{m=await t(r,d);}catch{m=false;}a.current===p&&l(y=>Object.freeze({...y,[c]:m?"joined":"failed"}));})();},"onPress")}},[r,n,t]);return react.useMemo(()=>({actionFor:i}),[i])}o(no,"useStateInterest");var vt=2;function ea(e){return typeof e!="number"||!Number.isInteger(e)?vt:e<1?1:e>6?6:e}o(ea,"headingLevel");function Vt(e){return e>=6?6:e+1}o(Vt,"nextHeadingLevel");function le(e){return `h${String(e)}`}o(le,"headingTag");var ku=Vt(vt),oo=react.createContext(ku);function ye(){return react.useContext(oo)}o(ye,"useNestedHeadingLevel");function xu(e,t){if(e===void 0)return {};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}o(xu,"slotBox");function ta(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(ta,"slotText");function ra(e,t){let r=xu(e,t),n={};return r.backgroundColor!==void 0&&(n.backgroundColor=r.backgroundColor),r.borderColor!==void 0&&(n.border=`${r.borderWidth??1}px solid ${r.borderColor}`),r.borderRadius!==void 0&&(n.borderRadius=r.borderRadius),n}o(ra,"slotBoxCss");var ae=44;function L(){let e=_();return react.useMemo(()=>_u(e),[e])}o(L,"useBookingStyles");function P({label:e,onPress:t,kind:r="primary",disabled:n=false,loading:l=false,fullWidth:a=true,accessibilityLabel:s,describedBy:i,testID:d,style:c}){let u=L(),p=n||l;return jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:p,"aria-busy":l||void 0,...s&&s!==e?{"aria-label":s}:{},...i?{"aria-describedby":i}:{},"data-testid":d,style:{...u.button,...r==="primary"?u.buttonPrimary:r==="danger"?u.buttonDanger:u.buttonSecondary,...a?u.buttonFull:u.buttonAuto,...p?u.buttonDisabled:null,...c},children:e})}o(P,"TelevetButton");function K({title:e,message:t,actionLabel:r,onAction:n,testID:l}){let a=L(),s=le(ye()),i=typeof r=="string"&&r.length>0&&typeof n=="function";return jsxRuntime.jsxs("div",{style:a.stateCard,"data-testid":l,children:[jsxRuntime.jsx(s,{style:a.stateTitle,children:e}),t?jsxRuntime.jsx("p",{style:a.stateMessage,children:t}):null,i?jsxRuntime.jsx(P,{label:r,onPress:n,kind:"secondary",fullWidth:false}):null]})}o(K,"TelevetStateCard");function me({height:e,width:t="100%",testID:r}){let n=L();return jsxRuntime.jsx("span",{"aria-hidden":"true","data-testid":r,style:{...n.skeleton,height:e,width:t}})}o(me,"TelevetSkeletonBlock");function q({message:e,assertive:t=false,testID:r,style:n}){let l=L();return jsxRuntime.jsx("p",{role:t?"alert":"status","data-testid":r,style:{...l.failure,...n},children:e})}o(q,"TelevetFailureLine");function _u(e){let{color:t,space:r,radius:n,type:l,slots:a}=e,{size:s,lineHeight:i}=l,d=o(c=>`${String(c)}px`,"rem");return {screen:{...ft,display:"flex",flexDirection:"column",minHeight:0,flex:"1 1 auto",gap:d(r.md),paddingLeft:d(r.xl),paddingRight:d(r.xl),boxSizing:"border-box"},stepFill:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:d(r.md)},list:{display:"flex",flexDirection:"column",gap:d(r.sm)},button:{minHeight:ae,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:d(r.sm),paddingLeft:d(r.xl),paddingRight:d(r.xl),paddingTop:d(r.sm),paddingBottom:d(r.sm),borderRadius:d(n.pill),borderStyle:"solid",borderWidth:0,cursor:"pointer",textAlign:"center",...v(e,"medium"),fontSize:d(s.body),lineHeight:String(i.snug),boxSizing:"border-box"},buttonFull:{alignSelf:"stretch",width:"100%"},buttonAuto:{alignSelf:"flex-start",minWidth:ae},buttonPrimary:{backgroundColor:t.primary,color:t.onPrimary,...ra(a.primaryButton),...ta(a.primaryButton)},buttonSecondary:{borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",color:t.brand,...a.primaryButton?.borderRadius===void 0?null:{borderRadius:d(a.primaryButton.borderRadius)},...a.primaryButton?.borderColor===void 0?null:{borderColor:a.primaryButton.borderColor}},buttonDanger:{backgroundColor:t.danger,color:t.onPrimary},buttonDisabled:{opacity:.45,cursor:"not-allowed"},stateCard:{minHeight:140,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:d(r.sm),padding:d(r.lg),borderRadius:d(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,boxSizing:"border-box"},stateTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:d(s.subtitle),lineHeight:String(i.snug)},stateMessage:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(i.normal)},skeleton:{display:"block",borderRadius:d(n.md),backgroundColor:t.skeleton,flexShrink:0},failure:{margin:0,...v(e,"regular"),color:t.danger,fontSize:d(s.caption),lineHeight:String(i.normal)},stepTitle:{margin:0,...v(e,"bold"),color:t.brand,fontSize:d(s.verdict),lineHeight:String(i.snug),textAlign:"center"},stepHelp:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(i.normal),textAlign:"center"},divider:{height:1,backgroundColor:t.brandBorder,flexShrink:0},scrollRoot:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},scrollBody:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},scrollFooter:{flexShrink:0,paddingTop:d(r.md),paddingBottom:d(r.lg)}}}o(_u,"makeBookingStyles");function Ar({petName:e,primaryVet:t,onFindEmergencyVet:r}){return r?true:t!=null&&(e?.trim()??"").length>0}o(Ar,"hasTelevetEmergencyExit");function Ut({petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:n}){let l=_(),a=react.useMemo(()=>Bu(l),[l]),s=e?.trim()??"",i=`${react.useId()}-primary-vet-hint`;return jsxRuntime.jsxs("div",{style:a.exits,"data-testid":`${n}-exits`,children:[r?jsxRuntime.jsx("button",{type:"button",onClick:()=>{rr(r);},style:{...a.card,...a.cardButton},"data-testid":`${n}-find-vet`,children:jsxRuntime.jsx("span",{style:a.title,children:dt.findEmergencyVet})}):null,null,t!=null&&s.length>0?jsxRuntime.jsx(Ou,{petName:s,vet:t,hintId:i,local:a,testIDPrefix:n}):null]})}o(Ut,"TelevetEmergencyExits");function Ou({petName:e,vet:t,hintId:r,local:n,testIDPrefix:l}){let a=Y(f.emergency.exitPrimaryVetTitle,{petName:e}),s=t.detail?.trim()??"",i=jsxRuntime.jsxs("span",{style:n.text,children:[jsxRuntime.jsx("span",{style:n.title,children:a}),s.length>0?jsxRuntime.jsx("span",{style:n.detail,children:s}):null]});if(!t.dial)return jsxRuntime.jsx("div",{style:n.card,"data-testid":`${l}-primary-vet`,children:i});let d=t.dial;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>{rr(d);},"aria-label":s.length>0?`${a}, ${s}`:a,"aria-describedby":r,style:{...n.card,...n.cardButton},"data-testid":`${l}-primary-vet-call`,children:[i,jsxRuntime.jsx("span",{id:r,style:Au,children:f.emergency.startCallHint})]})}o(Ou,"PrimaryVetCard");var Au=Object.freeze({position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});function Bu(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l;return {exits:{display:"flex",flexDirection:"column",gap:r.sm},card:{display:"flex",alignItems:"center",gap:r.sm,minHeight:ae,padding:r.lg,borderRadius:n.md,border:`1px solid ${t.brandBorder}`,background:t.surface,color:t.text.primary,textAlign:"start",textDecoration:"none",boxSizing:"border-box"},cardButton:{width:"100%",cursor:"pointer",font:"inherit",position:"relative"},text:{display:"flex",flexDirection:"column",gap:r.xs,flexShrink:1},title:{...v(e,"medium"),color:t.text.primary,fontSize:a.body,lineHeight:`${String(a.body*s.normal)}px`},detail:{...v(e,"regular"),color:t.text.metaCool,fontSize:a.caption,lineHeight:`${String(a.caption*s.normal)}px`}}}o(Bu,"makeExitStyles");function oa({petName:e,primaryVet:t,onFindEmergencyVet:r,onContinue:n}){let l=_(),a=L(),s=react.useMemo(()=>so(l),[l]),i=le(ye()),d=Ar({petName:e,primaryVet:t,onFindEmergencyVet:r})?f.emergency.lede:f.emergency.ledeWithoutExits;return jsxRuntime.jsxs("section",{role:"alert",style:{...a.stepFill,...s.emergencyPanel},"data-testid":"televet-early-emergency",children:[jsxRuntime.jsx(i,{style:s.emergencyTitle,children:f.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:s.emergencyLede,children:d}),jsxRuntime.jsx(Ut,{petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:"televet-early-emergency"}),jsxRuntime.jsx(P,{label:f.emergency.keepBookingCta,kind:"secondary",onPress:n,testID:"televet-early-emergency-continue"})]})}o(oa,"TelevetEarlyEmergency");function lo({action:e,testIDPrefix:t}){let r=_(),n=react.useMemo(()=>so(r),[r]),l=le(ye());return e===null?null:e.joined?jsxRuntime.jsxs("div",{role:"status","data-testid":`${t}-joined`,style:n.interestFeedback,children:[jsxRuntime.jsx(l,{style:n.interestJoinedTitle,children:f.stateInterest.joinedTitle}),jsxRuntime.jsx("p",{style:n.interestBody,children:f.stateInterest.joinedBody})]}):jsxRuntime.jsxs("div",{"data-testid":t,style:n.interestAction,children:[jsxRuntime.jsx(P,{label:e.pending?f.stateInterest.submitting:f.stateInterest.cta,kind:"secondary",loading:e.pending,disabled:e.pending,onPress:e.onPress,testID:`${t}-submit`}),e.failed?jsxRuntime.jsx(q,{message:f.stateInterest.failed,assertive:true,testID:`${t}-error`}):null]})}o(lo,"TelevetStateInterestAction");function ia({cause:e,onRetry:t,stateInterest:r=null}){let n=Jn(e);return jsxRuntime.jsxs("div",{"data-testid":"televet-clinicians-empty",children:[jsxRuntime.jsx(K,{title:n.title,message:n.message,...n.retryLabel!==null&&t?{actionLabel:n.retryLabel,onAction:t}:{}}),n.interestReason!==null?jsxRuntime.jsx(lo,{action:r??null,testIDPrefix:"televet-state-interest-no-licensed-vet"}):null]})}o(ia,"TelevetClinicianEmptyState");function Nu({onCheckAvailability:e}){return jsxRuntime.jsx(ao,{...e?{onCheckAvailability:e}:{}})}o(Nu,"TelevetEntitlementInterestState");function ao({onCheckAvailability:e,renderUnavailable:t}){let r=L();return jsxRuntime.jsxs("div",{"data-testid":"televet-booking-not-entitled",style:r.list,children:[t?t():jsxRuntime.jsx(K,{title:f.bookingPausedTitle}),e?jsxRuntime.jsx(P,{label:f.checkAvailabilityCta,kind:"secondary",onPress:e,testID:"televet-check-state-availability"}):null]})}o(ao,"EntitlementPausedState");function Wt({shortfall:e,testIDPrefix:t}){let r=_(),n=react.useMemo(()=>so(r),[r]);if(Qn(e))return null;let l=Zn(e);return l.length===0?null:jsxRuntime.jsx("ul",{role:"status",style:n.mediaNotice,"data-testid":`${t}-media-notice`,children:l.map((a,s)=>jsxRuntime.jsx("li",{style:n.mediaLine,"data-testid":`${t}-media-line-${String(s)}`,children:a},a))})}o(Wt,"TelevetMediaDropNotice");function so(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l;return {emergencyPanel:{display:"flex",flexDirection:"column",gap:r.sm,padding:r.lg,borderRadius:n.lg,border:`2px solid ${t.danger}`,background:t.surface},emergencyTitle:{...v(e,"medium"),margin:0,color:t.danger,fontSize:a.heading,lineHeight:`${String(a.heading*s.snug)}px`},emergencyLede:{...v(e,"regular"),margin:0,color:t.text.primary,fontSize:a.subtitle,lineHeight:`${String(a.subtitle*s.normal)}px`},interestAction:{display:"flex",flexDirection:"column",gap:r.sm,marginTop:r.sm},interestFeedback:{display:"flex",flexDirection:"column",gap:r.xs,marginTop:r.sm},interestJoinedTitle:{...v(e,"medium"),margin:0,color:t.brand,fontSize:a.body,lineHeight:`${String(a.body*s.snug)}px`},interestBody:{...v(e,"regular"),margin:0,color:t.text.metaCool,fontSize:a.body,lineHeight:`${String(a.body*s.normal)}px`},mediaNotice:{display:"flex",flexDirection:"column",gap:r.xs,margin:0,padding:0,listStyle:"none"},mediaLine:{...v(e,"regular"),color:t.text.metaCool,fontSize:a.caption,lineHeight:`${String(a.caption*s.normal)}px`}}}o(so,"makeEdgeStyles");function la(e){let{surfaceUnavailable:t,notEntitled:r,policyBlocked:n,triageOpen:l,step:a}=e;return t||r&&a!=="clinician"||n?true:a==="reason"&&l}o(la,"televetBookingGateApplies");function aa({state:e,petName:t,primaryVet:r,onFindEmergencyVet:n,stateInterest:l=null,onCheckAvailability:a,onAcknowledgeEmergency:s,renderUnavailable:i}){let d=L(),{surfaceUnavailable:c,notEntitled:u,policyBlocked:p,triageOpen:m,step:y}=e;return c?jsxRuntime.jsx("div",{style:d.stepFill,"data-testid":"televet-booking-unavailable",children:i?i():jsxRuntime.jsx(K,{title:f.bookingPausedTitle})}):u&&y!=="clinician"?jsxRuntime.jsx(ao,{...a?{onCheckAvailability:a}:{},...i?{renderUnavailable:i}:{}}):p?jsxRuntime.jsxs("div",{"data-testid":"televet-booking-state-blocked",children:[jsxRuntime.jsx(K,{title:f.stateBlockedTitle}),jsxRuntime.jsx(lo,{action:l,testIDPrefix:"televet-state-interest-state-blocked"})]}):y==="reason"&&m?jsxRuntime.jsx(oa,{...t!==void 0?{petName:t}:{},...r?{primaryVet:r}:{},onFindEmergencyVet:n,onContinue:s}):null}o(aa,"TelevetBookingGate");function sa(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}o(sa,"televetClinicianOutcomeApplies");function da({state:e,cause:t,locationStatus:r,onRequestLocation:n,onRetry:l,stateInterest:a=null,renderUnavailable:s}){return e.noState?jsxRuntime.jsx("div",{"data-testid":"televet-booking-location-unknown",children:jsxRuntime.jsx(K,{title:r==="blocked"?f.locationBlockedTitle:r==="unavailable"?f.locationUnavailableTitle:f.locationUnknownTitle,message:r==="blocked"?f.locationBlockedBody:r==="unavailable"?f.locationUnavailableBody:f.locationUnknownBody,actionLabel:n&&r!=="blocked"?f.locationUnknownCta:void 0,onAction:r==="blocked"?void 0:n})}):e.isEmpty?jsxRuntime.jsx(ia,{cause:t,onRetry:l,stateInterest:a}):jsxRuntime.jsx(ao,{...s?{renderUnavailable:s}:{}})}o(da,"TelevetClinicianOutcome");function ua(e){return `televet-consult-${e}`}o(ua,"televetConsultCalendarKey");function co({consult:e,petName:t,onDone:r,onAddToCalendar:n,canJoinInApp:l=false,lengthMinutes:a}){let s=_(),i=L(),d=react.useMemo(()=>Mu(s),[s]),c=`${react.useId()}-booked-title`,u=le(ye()),[p,m]=react.useState("idle"),y=o(async()=>{if(!n)return;m("saving");let T=new Date(e.scheduledAt);if(Number.isNaN(T.getTime())){m("failed");return}let h=typeof a=="number"&&Number.isFinite(a)&&a>0?a:tt,k=await nr(n,{key:ua(e.consultId),title:f.visit.title,startDate:T,endDate:new Date(T.getTime()+h*6e4),alarmOffsetMinutes:-30});if(!k.ok){m("failed");return}m(k.value===true?"saved":k.value==="handed-off"?"idle":"failed");},"addToCalendar"),b=[f.booked.remindPromise,Y(f.booked.summaryPromise,{pet:t??""}),...l?[f.booked.joinPromise]:[]];return Oe()?jsxRuntime.jsxs("section",{style:d.screen,"aria-labelledby":c,"data-testid":"televet-booked",children:[jsxRuntime.jsx("div",{style:d.header,children:jsxRuntime.jsx(P,{label:f.doneCta,kind:"secondary",fullWidth:false,onPress:r,testID:"televet-booked-done"})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:d.avatar}),jsxRuntime.jsx(u,{id:c,style:d.title,children:e.clinicianName?Y(f.bookedHeadingTemplate,{vet:e.clinicianName}):f.bookedTitle}),jsxRuntime.jsx("p",{style:d.when,children:jsxRuntime.jsx("time",{dateTime:e.scheduledAt,children:Te(e.scheduledAt)})}),jsxRuntime.jsx("ol",{style:d.steps,"data-testid":"televet-booked-steps",children:b.map((T,h)=>jsxRuntime.jsxs("li",{style:d.step,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:d.stepNumber,children:String(h+1)}),jsxRuntime.jsx("span",{style:d.stepText,children:T.trim()})]},T))}),jsxRuntime.jsxs("div",{style:d.actions,children:[n?jsxRuntime.jsx(P,{label:p==="saved"?f.booked.calendarAdded:f.addToCalendarCta,kind:"primary",loading:p==="saving",disabled:p==="saving"||p==="saved",onPress:()=>{y();},testID:"televet-booked-calendar"}):null,p==="failed"?jsxRuntime.jsx("p",{role:"status",style:{...i.failure,...d.calendarNote},"data-testid":"televet-booked-calendar-failed",children:f.booked.calendarFailedBody}):null,jsxRuntime.jsx(P,{label:t?Y(f.booked.backToPet,{pet:t}):f.doneCta,kind:"secondary",onPress:r,testID:"televet-booked-back"})]})]}):jsxRuntime.jsx("div",{style:d.screen,"data-testid":"televet-booked-copy-unapproved"})}o(co,"TelevetBookedScreen");function Mu(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {screen:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:i(r.md),paddingLeft:i(r.xl),paddingRight:i(r.xl),boxSizing:"border-box"},header:{display:"flex",justifyContent:"flex-end",paddingBottom:i(r.lg)},avatar:{alignSelf:"center",width:120,height:120,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,borderStyle:"solid",borderWidth:2,borderColor:t.success,boxSizing:"border-box"},title:{margin:0,textAlign:"center",...v(e,"bold"),color:t.brand,fontSize:i(a.verdict),lineHeight:String(s.tight),letterSpacing:"-0.7px",paddingTop:i(r.lg)},when:{margin:0,textAlign:"center",...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.subtitle),lineHeight:String(s.normal)},steps:{listStyle:"none",margin:0,marginTop:i(r.xl),padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,display:"flex",flexDirection:"column",gap:i(r.lg),boxSizing:"border-box"},step:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:i(r.md)},stepNumber:{width:26,height:26,flexShrink:0,borderRadius:"50%",backgroundColor:t.primary,display:"inline-flex",alignItems:"center",justifyContent:"center",...v(e,"medium"),color:t.onPrimary,fontSize:i(a.caption),lineHeight:"1"},stepText:{flex:"1 1 auto",minWidth:0,...v(e,"regular"),color:t.brand,fontSize:i(a.body),lineHeight:String(s.normal)},actions:{marginTop:"auto",paddingBottom:i(r.xl),display:"flex",flexDirection:"column",gap:i(r.md)},calendarNote:{textAlign:"center"}}}o(Mu,"makeStyles");function ca(){let e=[];return {register(t){return e=[...e,t],()=>{e=e.filter(r=>r!==t);}},dispatch(){for(let t of [...e].reverse())try{if(t())return !0}catch{}return false}}}o(ca,"createTelevetBackChannel");var po=react.createContext(null);function $t(e,t=true){let r=react.useContext(po),n=react.useRef(e);n.current=e,react.useEffect(()=>{if(!(r===null||!t))return r.register(()=>n.current())},[r,t]);}o($t,"useTelevetBackChannel");var Tt=Object.freeze({position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});var fa='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';function ya(e){return e.tagName==="DIALOG"}o(ya,"isDialogElement");function Nr(e,t,r){let n=react.useRef(null),l=react.useRef(false),a=react.useRef(null),s=react.useRef(r);s.current=r;let i=react.useCallback(()=>{if(!l.current)return;l.current=false;let u=s.current===void 0?a.current:s.current.current;u&&u.isConnected&&u.focus(),(!u||!u.isConnected||document.activeElement===u)&&(a.current=null);},[]);react.useEffect(()=>{if(!e){i();return}let u=n.current;if(!l.current){let m=typeof document>"u"?null:document.activeElement;m!==null&&u!==null&&u.contains(m)||(a.current=m instanceof HTMLElement?m:null);}if(l.current=true,u===null)return;if(!ya(u)){u.contains(document.activeElement)||(u.querySelector(fa)??u).focus();return}let p=u;typeof p.showModal=="function"?p.open||p.showModal():p.setAttribute("open","");},[e,i]),react.useEffect(()=>i,[i]);let d=react.useCallback(u=>{let p=n.current;if(p===null)return;if(u.key==="Escape"&&!ya(p)){u.preventDefault(),u.stopPropagation(),t();return}if(u.key!=="Tab")return;let m=Array.from(p.querySelectorAll(fa)),y=m[0],b=m[m.length-1];if(!y||!b){u.preventDefault();return}let T=document.activeElement;u.shiftKey&&(T===y||!p.contains(T))?(u.preventDefault(),b.focus()):!u.shiftKey&&(T===b||!p.contains(T))&&(u.preventDefault(),y.focus());},[t]),c=react.useCallback(u=>{u.preventDefault(),t();},[t]);return {dialogRef:n,onKeyDown:d,onCancel:c}}o(Nr,"useModalDialog");var yo=["pet","issues","reason","triage","clinician","time","review","booked"];function mo({step:e,furthestIndex:t,title:r,canGoBack:n,isDirty:l,onBack:a,onClose:s,onConfirmDiscard:i,headingLevel:d=vt,triageOpen:c=false}){let u=_(),p=react.useMemo(()=>va(u),[u]),[m,y]=react.useState(false),b=react.useRef(null),h=`${react.useId()}-close-hint`,k=le(d);react.useEffect(()=>{if(!l||typeof window>"u")return;let x=o(O=>{O.preventDefault(),O.returnValue="";},"onBeforeUnload");return window.addEventListener("beforeunload",x),()=>window.removeEventListener("beforeunload",x)},[l]);let E=react.useCallback(()=>{if(!l){s();return}let x={title:f.chrome.discardTitle,body:f.chrome.discardBody,confirmLabel:f.chrome.discardConfirmCta,keepLabel:f.chrome.discardKeepCta};if(i){Promise.resolve(i(x)).then(O=>{O&&s();},()=>{});return}y(true);},[l,s,i]);$t(()=>(E(),true));let C=yo.length,N=yo.indexOf(e==="reason"&&c?"triage":e)+1;return jsxRuntime.jsxs("div",{style:p.wrap,children:[jsxRuntime.jsxs("header",{style:p.bar,children:[jsxRuntime.jsx("div",{style:p.side,children:n?jsxRuntime.jsx("button",{type:"button",onClick:a,"data-testid":"televet-booking-back",style:{...p.tap,...p.back},children:f.backLabel}):null}),jsxRuntime.jsx(k,{style:Tt,children:r??f.navTitle}),jsxRuntime.jsxs("div",{style:p.progress,children:[jsxRuntime.jsx("p",{style:Tt,"data-testid":"televet-booking-progress-label",children:Y(f.loading.progressTemplate,{step:String(N),total:String(C)})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:p.segments,"data-testid":"televet-booking-rail",children:yo.map((x,O)=>jsxRuntime.jsx("span",{"data-lit":O<N?"true":"false",style:{...p.segment,...O<N?p.segmentLit:null}},x))})]}),jsxRuntime.jsxs("div",{style:{...p.side,...p.sideRight},children:[jsxRuntime.jsx("button",{type:"button",ref:b,onClick:E,"aria-label":f.close,"aria-describedby":h,"data-testid":"televet-booking-close",style:{...p.tap,...p.closeTap},children:jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),jsxRuntime.jsx("span",{id:h,style:Tt,children:f.chrome.closeHint})]})]}),m?jsxRuntime.jsx(qu,{onKeep:()=>y(false),onLeave:()=>{y(false),s();},returnFocusTo:b}):null]})}o(mo,"TelevetBookingChrome");function qu({onKeep:e,onLeave:t,returnFocusTo:r}){let n=_(),l=react.useMemo(()=>va(n),[n]),{dialogRef:a,onKeyDown:s,onCancel:i}=Nr(true,e,r),d=react.useId(),c=`${d}-discard-title`,u=`${d}-discard-body`;return jsxRuntime.jsxs("dialog",{ref:a,onKeyDown:s,onCancel:i,"aria-labelledby":c,"aria-describedby":u,"data-testid":"televet-booking-discard",style:l.dialog,children:[jsxRuntime.jsx("h2",{id:c,style:l.dialogTitle,children:f.chrome.discardTitle}),jsxRuntime.jsx("p",{id:u,style:l.dialogBody,children:f.chrome.discardBody}),jsxRuntime.jsxs("div",{style:l.dialogActions,children:[jsxRuntime.jsx(P,{label:f.chrome.discardKeepCta,onPress:e,kind:"primary",fullWidth:false,testID:"televet-booking-discard-keep"}),jsxRuntime.jsx(P,{label:f.chrome.discardConfirmCta,onPress:t,kind:"secondary",fullWidth:false,testID:"televet-booking-discard-leave"})]})]})}o(qu,"DiscardDialog");var Yu="Back";function va(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(c=>`${String(c)}px`,"rem"),d={background:"transparent",borderStyle:"none",padding:0,cursor:"pointer"};return {wrap:{backgroundColor:t.surface,flexShrink:0},bar:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:i(r.lg),paddingRight:i(r.lg),minHeight:56,boxSizing:"border-box"},side:{width:64,flexShrink:0,display:"flex",alignItems:"center"},sideRight:{justifyContent:"flex-end"},tap:{...d,minHeight:ae,minWidth:ae,display:"inline-flex",alignItems:"center",justifyContent:"center"},closeTap:{justifyContent:"flex-end",color:t.text.primary},back:{...v(e,"bold"),color:t.brand,fontSize:i(a.body),paddingLeft:i(r.sm),paddingRight:i(r.sm)},progress:{flex:"1 1 auto",minWidth:0,display:"flex",justifyContent:"center"},segments:{display:"flex",alignItems:"center",gap:i(r.xs),width:"100%",maxWidth:480},segment:{display:"block",flex:"1 1 0",height:3,borderRadius:i(n.pill),backgroundColor:t.brandBorder},segmentLit:{backgroundColor:t.success},dialog:{margin:"auto",maxWidth:420,width:"calc(100% - 32px)",boxSizing:"border-box",padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface,color:t.text.primary},dialogTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},dialogBody:{margin:0,paddingTop:i(r.sm),...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.body),lineHeight:String(s.normal)},dialogActions:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.sm),paddingTop:i(r.lg)}}}o(va,"makeStyles");function ba(e){let t=[],r=Gu(e.ageYears);r!==null&&t.push(`${String(r)} yr${r===1?"":"s"} old`);let n=e.weightKg;typeof n=="number"&&Number.isFinite(n)&&n>0&&t.push(`${String(Math.round(n))} kg`);let l=e.breed?.trim();return l&&t.push(l),t.join(" \xB7 ")}o(ba,"formatTelevetPetMetaLine");function Gu(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.floor(e);return t>=0?t:null}o(Gu,"wholeYears");function go({media:e,onChange:t,onPickMedia:r,listLabel:n}){let l=_(),a=react.useMemo(()=>ec(l),[l]),s=pr-e.length,[i,d]=react.useState(false);if(!r)return null;let c=o(async()=>{if(!(i||s<=0)){d(true);try{let u=await nr(r,s);if(!u.ok||u.value===null||u.value.length===0)return;let p=new Set(e.map(y=>y.uri)),m=u.value.filter(y=>typeof y?.uri=="string"&&y.uri.length>0&&!p.has(y.uri));if(m.length===0)return;t([...e,...m].slice(0,pr));}finally{d(false);}}},"pick");return jsxRuntime.jsxs("ul",{role:"list","aria-label":n,style:a.row,children:[e.map((u,p)=>jsxRuntime.jsxs("li",{style:a.thumb,children:[jsxRuntime.jsx("img",{src:u.uri,alt:u.filename,style:a.thumbImage}),u.mimeType.startsWith("video/")?jsxRuntime.jsx("span",{"aria-hidden":"true",style:a.videoBadge,"data-testid":`televet-intake-media-video-${String(p)}`,children:Zu}):null,jsxRuntime.jsx("button",{type:"button",onClick:()=>t(e.filter((m,y)=>y!==p)),"aria-label":`${f.removePhotoLabel}: ${u.filename}`,"data-testid":`televet-intake-media-remove-${String(p)}`,style:a.remove,children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:a.removeGlyph,children:Qu})})]},`${u.uri}-${String(p)}`)),s>0?jsxRuntime.jsx("li",{style:a.addItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>{c();},disabled:i,"aria-busy":i||void 0,"data-testid":"televet-intake-add-media",style:{...a.dropzone,...i?a.dropzoneBusy:null},children:jsxRuntime.jsx("span",{style:a.dropzoneText,children:f.addPhotoCta})})}):null]})}o(go,"TelevetIntakeMedia");var Qu="\xD7",Zu="\u25B6",Dr=92;function ec(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {row:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.md),paddingTop:i(r.sm)},thumb:{position:"relative",width:Dr,height:Dr,borderRadius:i(n.md),backgroundColor:t.surfaceSubtle},thumbImage:{width:"100%",height:"100%",objectFit:"cover",borderRadius:i(n.md),display:"block"},videoBadge:{position:"absolute",left:6,bottom:6,paddingLeft:6,paddingRight:6,paddingTop:2,paddingBottom:2,borderRadius:i(n.sm),backgroundColor:t.shadow,color:t.text.onBrand,fontSize:i(a.nano),lineHeight:"1"},addItem:{display:"flex"},remove:{position:"absolute",top:-8,right:-8,width:ae-16,height:ae-16,borderRadius:"50%",borderStyle:"none",backgroundColor:t.text.metaCool,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},removeGlyph:{...v(e,"medium"),color:t.surface,fontSize:i(a.subtitle),lineHeight:"1"},dropzone:{width:Dr,height:Dr,borderRadius:i(n.md),borderWidth:1,borderStyle:"dashed",borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:i(r.sm),paddingRight:i(r.sm),cursor:"pointer",boxSizing:"border-box"},dropzoneBusy:{opacity:.6,cursor:"progress"},dropzoneText:{...v(e,"mono"),color:t.text.metaCool,fontSize:i(a.nano),lineHeight:String(s.normal),letterSpacing:"0.3px",textAlign:"center"}}}o(ec,"makeStyles");function bo({slots:e,selectedDayKey:t,onSelectDay:r,groupLabel:n}){let l=_(),a=react.useMemo(()=>nc(l),[l]),s=react.useMemo(()=>Fr(e),[e]),i=react.useRef(new Map),d=s[0],c=t??d?.key??null,u=react.useRef(null),p=react.useRef(false);react.useEffect(()=>{if(p.current)return;let y=u.current,b=c===null?void 0:i.current.get(c);if(!y||!b||(p.current=true,c===d?.key))return;let T=b.getBoundingClientRect().left-y.getBoundingClientRect().left;y.scrollLeft+=T-(y.clientWidth-b.clientWidth)/2;},[c,d]);let m=react.useCallback(y=>{let b=y.key==="ArrowRight"||y.key==="ArrowDown"?1:y.key==="ArrowLeft"||y.key==="ArrowUp"?-1:0,T=y.key==="Home"?0:y.key==="End"?s.length-1:null;if(b===0&&T===null)return;let h=s.findIndex(C=>C.key===c);if(h<0)return;let k=T??Math.min(s.length-1,Math.max(0,h+b)),E=s[k];E===void 0||E.key===c||(y.preventDefault(),r(E),i.current.get(E.key)?.focus());},[s,c,r]);return d===void 0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{"aria-hidden":"true",style:a.month,"data-testid":"televet-day-strip-month",children:Yl(d.iso)}),jsxRuntime.jsx("div",{ref:u,role:"radiogroup","aria-label":n,onKeyDown:m,style:a.strip,"data-testid":"televet-day-strip",children:s.map(y=>{let b=y.key===c;return jsxRuntime.jsxs("button",{ref:T=>{T?i.current.set(y.key,T):i.current.delete(y.key);},type:"button",role:"radio","aria-checked":b,tabIndex:b?0:-1,onClick:()=>r(y),"aria-label":Gl(y.iso),"data-testid":`televet-day-${y.key}`,style:{...a.day,...b?a.daySelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...a.dayWeekday,...b?a.dayTextSelected:null},children:y.weekday}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...a.dayNumber,...b?a.dayTextSelected:null},children:y.dayNumber})]},y.key)})})]})}o(bo,"TelevetDayStrip");function Fr(e){let t=new Map;for(let r of e){let n=jt(r.startsAt);if(t.has(n))continue;let l=new Date(r.startsAt);Number.isNaN(l.getTime())||t.set(n,Object.freeze({key:n,iso:r.startsAt,weekday:l.toLocaleDateString(void 0,{weekday:"short"}),dayNumber:String(l.getDate())}));}return Object.freeze([...t.values()])}o(Fr,"televetDaysFromSlots");function nc(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {month:{margin:0,textAlign:"center",...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug),paddingBottom:i(r.md)},strip:{display:"flex",flexDirection:"row",gap:i(r.sm),paddingLeft:i(r.xs),paddingRight:i(r.xs),overflowX:"auto",overscrollBehaviorX:"contain",scrollSnapType:"x proximity"},day:{width:52,flexShrink:0,scrollSnapAlign:"center",minHeight:ae,paddingTop:i(r.md),paddingBottom:i(r.md),borderRadius:i(n.md),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",boxSizing:"border-box"},daySelected:{backgroundColor:t.primary,borderColor:t.primary},dayWeekday:{...v(e,"mono"),color:t.text.secondary,fontSize:i(a.tiny),lineHeight:String(s.tight)},dayNumber:{...v(e,"medium"),color:t.brand,fontSize:i(a.heading),lineHeight:String(s.tight)},dayTextSelected:{color:t.onPrimary}}}o(nc,"makeStyles");function Kt({slots:e,busySlotId:t,onPick:r,selectedSlot:n=null,header:l,dayGroupLabel:a,timeGroupLabel:s,rowTestIdPrefix:i="televet-slot",testID:d="televet-slot-list"}){let c=_(),u=react.useMemo(()=>ac(c),[c]),p=react.useMemo(()=>Fr(e),[e]),m=`${react.useId()}-zone`,[y,b]=react.useState(null),T=n?jt(n.startsAt):null,h=lc(p,[y,T])??p[0]?.key??null,k=react.useMemo(()=>h?e.filter(x=>jt(x.startsAt)===h):[],[e,h]),E=k[0],C=t!==null,N=E?mt(E.startsAt):null;return jsxRuntime.jsxs("div",{style:u.root,"data-testid":d,children:[l,jsxRuntime.jsx(bo,{slots:e,selectedDayKey:h,onSelectDay:x=>b(x.key),groupLabel:a}),N?jsxRuntime.jsx("p",{id:m,style:u.zone,"data-testid":"televet-slot-zone",children:N}):null,jsxRuntime.jsx("div",{style:u.gridScroll,children:jsxRuntime.jsx("ul",{role:"list","aria-label":s,...N?{"aria-describedby":m}:{},"aria-busy":C||void 0,style:u.grid,children:k.map(x=>{let O=t===x.slotId;return jsxRuntime.jsx("li",{style:u.gridItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>r(x),disabled:C,"aria-busy":O||void 0,"aria-label":Te(x.startsAt),"data-testid":`${i}-${x.slotId}`,style:{...u.chip,...O?u.chipBusy:null,...C&&!O?u.chipDisabled:null},children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...u.chipLabel,...O?u.chipLabelBusy:null},children:yt(x.startsAt)})})},x.slotId)})})})]})}o(Kt,"TelevetSlotPicker");function lc(e,t){for(let r of t)if(r!==null&&e.some(n=>n.key===r))return r;return null}o(lc,"firstOffered");function ac(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {root:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},gridScroll:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},zone:{margin:0,textAlign:"center",...v(e,"mono"),color:t.text.secondary,fontSize:i(a.tiny),lineHeight:String(s.normal),letterSpacing:"0.4px",paddingTop:i(r.md),paddingBottom:i(r.md)},grid:{listStyle:"none",margin:0,padding:0,paddingBottom:i(r.xl),display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.md)},gridItem:{display:"flex",flexGrow:1,flexBasis:"28%",minWidth:96},chip:{width:"100%",minHeight:48,borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:i(r.md),paddingRight:i(r.md),cursor:"pointer",boxSizing:"border-box"},chipBusy:{backgroundColor:t.primary,borderColor:t.primary},chipDisabled:{opacity:.45,cursor:"not-allowed"},chipLabel:{...v(e,"regular"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.tight)},chipLabelBusy:{color:t.onPrimary}}}o(ac,"makeStyles");function we(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {marker:{minHeight:1},chipRow:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:i(r.sm)},chip:{minHeight:44,padding:`${i(r.sm)} ${i(r.lg)}`,borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brand,backgroundColor:t.surface,color:t.brand,cursor:"pointer",...v(e,"regular"),fontSize:i(a.body),lineHeight:String(s.snug)},chipOn:{borderColor:t.accent,backgroundColor:t.accent,color:t.onAccent,...v(e,"bold")},stepScroll:{paddingBottom:i(r.md)},visuallyHiddenHeading:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},petRow:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",gap:i(r.sm),minHeight:64,paddingLeft:i(r.md),paddingRight:i(r.md),paddingTop:i(r.sm),paddingBottom:i(r.sm),borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",textAlign:"left",cursor:"pointer",boxSizing:"border-box"},petRowSelected:{borderColor:t.primary},petDisc:{width:28,height:28,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...v(e,"medium"),color:t.brand,fontSize:i(a.caption),lineHeight:"1"},petRowText:{display:"flex",flexDirection:"column",minWidth:0,gap:2},petRowName:{...v(e,"medium"),color:t.brand,fontSize:i(a.body),lineHeight:String(s.snug),overflowWrap:"anywhere"},petRowMeta:{...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.caption),lineHeight:String(s.normal),overflowWrap:"anywhere"},vetRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:i(r.md)},vetAvatar:{width:64,height:64,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...v(e,"medium"),color:t.brand,fontSize:i(a.heading),lineHeight:"1"},vetIdentity:{display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,gap:2},vetName:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},vetCredentials:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.caption),lineHeight:String(s.normal)},vetRating:{margin:0,...v(e,"regular"),color:t.text.secondary,fontSize:i(a.caption),lineHeight:String(s.normal)},vetBio:{margin:0,...v(e,"regular"),color:t.brand,fontSize:i(a.body),lineHeight:String(s.normal)},reasonInput:{width:"100%",minHeight:120,resize:"vertical",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:i(n.md),padding:i(r.md),backgroundColor:t.surface,...v(e,"regular"),color:t.text.primary,fontSize:i(a.body),lineHeight:String(s.normal),boxSizing:"border-box"},emergencyBanner:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i(r.md),padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.errorRed,backgroundColor:t.badgeBgCritical,boxSizing:"border-box"},emergencyTitle:{margin:0,...v(e,"bold"),color:t.errorRed,fontSize:i(a.subtitle),lineHeight:String(s.snug)},emergencyLede:{margin:0,...v(e,"regular"),color:t.text.primary,fontSize:i(a.body),lineHeight:String(s.normal)}}}o(we,"makeLocalStyles");function it({label:e,value:t,last:r=false,testID:n}){let l=_(),a=react.useMemo(()=>Eo(l),[l]);return jsxRuntime.jsxs("div",{style:{...a.row,...r?a.rowLast:null},"data-testid":n,children:[jsxRuntime.jsx("dt",{style:a.rowLabel,children:e}),jsxRuntime.jsx("dd",{style:a.rowValue,children:t})]})}o(it,"TelevetSummaryRow");function qt({label:e,checked:t,onToggle:r,testID:n}){let l=_(),a=react.useMemo(()=>Eo(l),[l]);return jsxRuntime.jsxs("label",{style:a.consent,children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.currentTarget.checked),"data-testid":n,style:Tt}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...a.box,...t?a.boxChecked:null},children:t?jsxRuntime.jsx("span",{style:a.tick,children:dc}):null}),jsxRuntime.jsx("span",{style:a.consentLabel,children:e})]})}o(qt,"TelevetConsentCheckbox");var dc="\u2713";function So({children:e,testID:t}){let r=_(),n=react.useMemo(()=>Eo(r),[r]);return jsxRuntime.jsx("dl",{style:n.card,"data-testid":t,children:e})}o(So,"TelevetSummaryCard");function Eo(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"rem");return {card:{margin:0,borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,paddingLeft:i(r.lg),paddingRight:i(r.lg),boxSizing:"border-box"},row:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:i(r.lg),paddingTop:i(r.lg),paddingBottom:i(r.lg),borderBottomStyle:"solid",borderBottomWidth:1,borderBottomColor:t.brandBorder},rowLast:{borderBottomWidth:0},rowLabel:{margin:0,flexShrink:0,...v(e,"regular"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},rowValue:{margin:0,marginInlineStart:0,minWidth:0,textAlign:"right",overflowWrap:"anywhere",...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},consent:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:i(r.md),minHeight:ae,padding:i(r.lg),borderRadius:i(n.md),backgroundColor:t.surfaceSubtle,cursor:"pointer",boxSizing:"border-box"},box:{width:22,height:22,flexShrink:0,borderRadius:i(n.xs),borderStyle:"solid",borderWidth:1.5,borderColor:t.brand,backgroundColor:t.surface,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},boxChecked:{backgroundColor:t.primary,borderColor:t.primary},tick:{...v(e,"bold"),color:t.onPrimary,fontSize:i(a.caption),lineHeight:"1"},consentLabel:{flex:"1 1 auto",minWidth:0,overflowWrap:"anywhere",...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.body),lineHeight:String(s.normal)}}}o(Eo,"makeStyles");function Co({headingRef:e,when:t,lengthMinutes:r,clinician:n,petName:l,reason:a,shareRecords:s,onToggleShare:i,stateCode:d,stateAttested:c,onToggleStateAttest:u,cancellationTerms:p,termsAttested:m,onToggleTermsAttest:y,canConfirm:b,busy:T,failure:h,onConfirm:k,emergency:E,onAcknowledgeEmergency:C,onSeeOtherVets:N,mediaShortfall:x=Ht,primaryVet:O,onFindEmergencyVet:z}){let j=L(),J=_(),D=react.useMemo(()=>we(J),[J]),X=Ar({petName:l,primaryVet:O,onFindEmergencyVet:z})?f.emergency.lede:f.emergency.ledeWithoutExits;return jsxRuntime.jsxs("div",{style:j.scrollRoot,"data-testid":"televet-booking-review",children:[jsxRuntime.jsx("div",{style:j.scrollBody,"data-testid":"televet-booking-review-scroll",children:jsxRuntime.jsxs("div",{style:j.list,children:[jsxRuntime.jsx(lt,{headingRef:e,style:j.stepTitle,children:f.reviewHeading}),jsxRuntime.jsxs(So,{testID:"televet-review-summary",children:[l?jsxRuntime.jsx(it,{label:f.summaryPet,value:l,testID:"televet-review-row-pet"}):null,n?jsxRuntime.jsx(it,{label:f.summaryVet,value:n,testID:"televet-review-row-vet"}):null,jsxRuntime.jsx(it,{label:f.summaryWhen,value:t,testID:"televet-review-row-when"}),jsxRuntime.jsx(it,{label:f.summaryLength,value:Y(f.summaryLengthTemplate,{n:String(r)}),testID:"televet-review-row-length"}),a?jsxRuntime.jsx(it,{label:f.summaryReason,value:a,last:true,testID:"televet-review-row-reason"}):null]}),jsxRuntime.jsx(qt,{label:f.shareRecordsOff,checked:s,onToggle:i,testID:"televet-review-share-records"}),p?jsxRuntime.jsx(qt,{label:p,checked:m,onToggle:y,testID:"televet-review-terms-attest"}):null,d?jsxRuntime.jsx(qt,{label:Y(f.stateAttestTemplate,{state:d}),checked:c,onToggle:u,testID:"televet-review-state-attest"}):null,jsxRuntime.jsx(Wt,{shortfall:x,testIDPrefix:"televet-review"}),E?jsxRuntime.jsxs("div",{role:"alert",style:D.emergencyBanner,"data-testid":"televet-review-emergency",children:[jsxRuntime.jsx(Ca,{style:D.emergencyTitle,children:f.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:D.emergencyLede,children:X}),E.length>0?jsxRuntime.jsx("p",{style:D.emergencyLede,"data-testid":"televet-review-emergency-categories",children:E.join(", ")}):null,jsxRuntime.jsx(Ut,{petName:l,primaryVet:O,onFindEmergencyVet:z,testIDPrefix:"televet-review-emergency"}),jsxRuntime.jsx(P,{label:f.emergency.keepBookingCta,kind:"secondary",loading:T,disabled:T,onPress:C,testID:"televet-review-emergency-ack"})]}):null,h==="failed"?jsxRuntime.jsx(q,{message:f.confirmFailed}):null,h==="clinician_unavailable"?jsxRuntime.jsxs("div",{style:j.list,"data-testid":"televet-review-clinician-unavailable",children:[jsxRuntime.jsx(q,{message:f.confirmFailed}),jsxRuntime.jsx(P,{label:f.seeOtherVetsCta,kind:"secondary",onPress:N,testID:"televet-review-see-other-vets"})]}):null,h==="rate_limited"?jsxRuntime.jsx(q,{message:f.confirmFailed,testID:"televet-review-rate-limited"}):null,h==="not_entitled"?jsxRuntime.jsx(q,{message:f.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]})}),E?null:jsxRuntime.jsx("div",{style:j.scrollFooter,children:jsxRuntime.jsx(P,{label:f.confirmCta,kind:"primary",loading:T,disabled:!b||T||!!d&&!c||!!p&&!m,onPress:k,testID:"televet-review-confirm"})})]})}o(Co,"ReviewStep");var pc="\u25CB",fc="+";function We(e,t){return t?e.find(n=>n.petRef===t||n.petId===t)?.name??null:null}o(We,"nameOf");function lt({headingRef:e,style:t,id:r,children:n}){let l=le(ye());return jsxRuntime.jsx(l,{ref:e,tabIndex:-1,style:t,...r===void 0?{}:{id:r},children:n})}o(lt,"StepHeading");function Ca({style:e,children:t}){let r=le(Vt(ye()));return jsxRuntime.jsx(r,{style:e,children:t})}o(Ca,"SubHeading");function xa({headingRef:e,pets:t,isPending:r,isError:n,onRetry:l,selectedId:a,onSelect:s,onAddPet:i}){let d=L(),c=_(),u=react.useMemo(()=>we(c),[c]);return r?jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.pets,"aria-busy":"true",style:d.list,"data-testid":"televet-pets-loading",children:[0,1].map(p=>jsxRuntime.jsx(me,{height:64},p))}):n?jsxRuntime.jsx("div",{"data-testid":"televet-pets-error",children:jsxRuntime.jsx(K,{title:f.chrome.loadFailedTitle,actionLabel:f.chrome.retryCta,onAction:l})}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-pets-empty",children:jsxRuntime.jsx(K,{title:f.chrome.noPetsTitle,actionLabel:f.addPetCta,onAction:i})}):jsxRuntime.jsxs("div",{style:d.stepFill,children:[jsxRuntime.jsx(lt,{headingRef:e,style:d.stepTitle,children:f.petSelectTitle}),jsxRuntime.jsx("div",{style:{...d.scrollBody,...u.stepScroll},children:jsxRuntime.jsxs("ul",{role:"list",style:d.list,"data-testid":"televet-pets",children:[t.map(p=>{let m=a===p.petRef;return jsxRuntime.jsx(ka,{name:p.name??"",meta:ba(p),selected:m,onPress:()=>s(p.petRef),testID:`televet-pet-${p.petRef}`},p.petRef)}),i?jsxRuntime.jsx(ka,{name:f.addPetCta,meta:"",selected:false,onPress:i,testID:"televet-pet-add",glyph:fc}):null]})})]})}o(xa,"PetStep");function ka({name:e,meta:t,selected:r,onPress:n,testID:l,glyph:a}){let s=_(),i=react.useMemo(()=>we(s),[s]);return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button",onClick:n,"aria-pressed":r,"data-testid":l,style:{...i.petRow,...r?i.petRowSelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:i.petDisc,children:a??Ra(e)}),jsxRuntime.jsxs("span",{style:i.petRowText,children:[jsxRuntime.jsx("span",{style:i.petRowName,children:e}),t?jsxRuntime.jsx("span",{style:i.petRowMeta,children:t}):null]})]})})}o(ka,"PetRow");function Ra(e){let t=e.trim();return t.length===0?pc:t.slice(0,1).toUpperCase()}o(Ra,"initialOf");function _a({headingRef:e,clinicians:t,isPending:r,isError:n,selectedId:l,onSelect:a,onRetry:s}){let i=L(),d=_(),c=react.useMemo(()=>we(d),[d]);if(r)return jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.clinicians,"aria-busy":"true",style:i.list,"data-testid":"televet-clinicians-loading",children:jsxRuntime.jsx(me,{height:96})});if(n)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-error",children:jsxRuntime.jsx(K,{title:f.chrome.loadFailedTitle,actionLabel:f.chrome.retryCta,onAction:s})});if(t.length===0)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-empty",children:jsxRuntime.jsx(K,{title:f.noCliniciansTitle,message:f.noCliniciansBody,actionLabel:f.noCliniciansRetryCta,onAction:s})});let u=t.find(p=>p.clinicianId===l)??t[0];return u===void 0?null:jsxRuntime.jsxs("div",{style:i.list,"data-testid":"televet-clinicians",children:[jsxRuntime.jsx(lt,{headingRef:e,style:i.stepTitle,children:f.yourVetTitle}),jsxRuntime.jsxs("div",{style:c.vetRow,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:c.vetAvatar,children:Ra(u.displayName)}),jsxRuntime.jsxs("div",{style:c.vetIdentity,children:[jsxRuntime.jsx("p",{style:c.vetName,children:u.displayName}),u.credentials?jsxRuntime.jsx("p",{style:c.vetCredentials,children:u.credentials}):null,u.rating!==null&&u.ratingCount!==null?jsxRuntime.jsx("p",{style:c.vetRating,"data-testid":"televet-vet-rating",children:`\u2605 ${String(u.rating)} \xB7 ${String(u.ratingCount)} ${f.reviewsLabel}`}):null]})]}),u.bio?jsxRuntime.jsx("p",{style:c.vetBio,"data-testid":"televet-vet-bio",children:u.bio}):null,jsxRuntime.jsx("div",{style:i.divider}),jsxRuntime.jsx(P,{label:f.continueCta,kind:"primary",onPress:()=>a(u.clinicianId),testID:`televet-clinician-${u.clinicianId}`})]})}o(_a,"ClinicianStep");function Pa({headingRef:e,slots:t,enabled:r,isPending:n,isError:l,busySlotId:a,failure:s,selectedSlot:i,nextOpening:d,onPick:c,onRetry:u,onSeeOtherVets:p}){let m=L();return r?n?jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.slots,"aria-busy":"true",style:m.list,"data-testid":"televet-slots-loading",children:[0,1,2].map(y=>jsxRuntime.jsx(me,{height:48},y))}):l?jsxRuntime.jsx(K,{title:f.slotsErrorTitle,actionLabel:f.retryCta,onAction:u,testID:"televet-slots-error"}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-slots-empty",children:jsxRuntime.jsx(K,{title:f.noSlotsTitle,message:d?Y(f.nextOpeningTemplate,{when:Te(d.startsAt)}):void 0,actionLabel:d?f.seeOtherVetsCta:void 0,onAction:d?p:void 0})}):jsxRuntime.jsxs("div",{style:m.stepFill,"data-testid":"televet-slots",children:[jsxRuntime.jsx(lt,{headingRef:e,style:m.stepTitle,children:f.timeHeading}),s==="expired"?jsxRuntime.jsx(q,{message:f.holdExpired}):null,s==="taken"?jsxRuntime.jsx(q,{message:f.slotTaken}):null,s==="failed"||s==="rate_limited"?jsxRuntime.jsx(q,{message:f.confirmFailed,testID:"televet-slots-hold-failed"}):null,jsxRuntime.jsx(Kt,{slots:t,busySlotId:a,onPick:c,selectedSlot:i,dayGroupLabel:f.summaryWhen,timeGroupLabel:f.navTitle})]}):jsxRuntime.jsx("div",{"data-testid":"televet-slots-unavailable",children:jsxRuntime.jsx(K,{title:f.bookingPausedTitle})})}o(Pa,"SlotStep");function wa({headingRef:e,petName:t,chips:r,selected:n,onToggle:l,onNext:a}){let s=L(),i=_(),d=react.useMemo(()=>we(i),[i]),c=Y(f.issuesHeadingTemplate,{pet:t??""});return jsxRuntime.jsxs("div",{style:s.scrollRoot,"data-testid":"televet-booking-issues",children:[jsxRuntime.jsx("div",{style:s.scrollBody,children:jsxRuntime.jsxs("div",{style:s.list,children:[jsxRuntime.jsx(lt,{headingRef:e,style:s.stepTitle,children:c}),jsxRuntime.jsx("p",{style:s.stepHelp,children:f.issuesHint}),jsxRuntime.jsx("div",{role:"group","aria-label":c,style:d.chipRow,children:r.map(u=>{let p=n.includes(u.id);return jsxRuntime.jsx("button",{type:"button","aria-pressed":p,onClick:()=>l(u.id),style:{...d.chip,...p?d.chipOn:null},"data-testid":`televet-issue-${u.id}`,children:u.label},u.id)})})]})}),jsxRuntime.jsx("div",{style:s.scrollFooter,children:jsxRuntime.jsx(P,{label:f.continueCta,kind:"primary",onPress:a,testID:"televet-issues-next"})})]})}o(wa,"IssuesStep");function Ia({headingRef:e,value:t,composed:r,onChange:n,onNext:l,media:a,onChangeMedia:s,onPickMedia:i,checking:d=false}){let c=L(),u=_(),p=react.useMemo(()=>we(u),[u]),m=react.useId(),y=`${m}-reason-heading`,b=`${m}-reason-help`,T=(r??t).trim(),h=T.length>He,k=T.length>0&&!h;return jsxRuntime.jsxs("div",{style:c.scrollRoot,"data-testid":"televet-booking-reason",children:[jsxRuntime.jsx("div",{style:c.scrollBody,"data-testid":"televet-booking-reason-scroll",children:jsxRuntime.jsxs("div",{style:c.list,children:[jsxRuntime.jsx(lt,{headingRef:e,id:y,style:c.stepTitle,children:f.describeHeading}),jsxRuntime.jsx("p",{id:b,style:c.stepHelp,children:f.describeHelpLong}),jsxRuntime.jsx("textarea",{value:t,onChange:E=>n(E.currentTarget.value),"aria-labelledby":y,"aria-describedby":b,"aria-invalid":h||void 0,placeholder:f.reasonPlaceholder,style:p.reasonInput,"data-testid":"televet-reason-input"}),h?jsxRuntime.jsx(q,{message:f.reasonTooLong}):null,jsxRuntime.jsx(go,{media:a,onChange:s,listLabel:f.addPhotoCta,...i?{onPickMedia:i}:{}})]})}),jsxRuntime.jsx("div",{style:c.scrollFooter,children:jsxRuntime.jsx(P,{label:f.continueCta,kind:"primary",disabled:!k,loading:d,onPress:l,testID:"televet-reason-next"})})]})}o(Ia,"ReasonStep");function Ro(e){let{petRef:t,usState:r,controller:n,onBooked:l,onExit:a,onAddPet:s,onPickMedia:i,onAddToCalendar:d,onConfirmDiscard:c,onRequestLocation:u,locationStatus:p="unknown",onTriageReason:m,onStateInterest:y,primaryVet:b,onFindEmergencyVet:T,canJoinInApp:h=false,renderUnavailable:k,headingLevel:E,style:C,testID:N}=st(e,["onBooked","onExit","onAddPet","onRequestLocation","onFindEmergencyVet"]),x=ea(E??vt),O=Vt(x),z=L(),j=_(),J=react.useMemo(()=>we(j),[j]),D=he(n),X=Rr(),$=X.pets,Q=$.length,ve=react.useMemo(()=>({ownedPetCount:Q,withIssues:true}),[Q]),[be,Le]=react.useReducer((H,Ge)=>Kn(H,Ge,ve),void 0,()=>Wn({ownedPetCount:0,withIssues:true},{petId:t??null,state:r??null})),A=react.useCallback(H=>Le(H),[]),[at,Fe]=react.useState(""),[W,$e]=react.useState([]),[Ie,V]=react.useState(null),[Ke,Zt]=react.useState(null),[Hr,Uo]=react.useState(false),[Vr,Wo]=react.useState(false),[$o,Xa]=react.useState([]),[Ur,Qa]=react.useState(null),[Za,es]=react.useState(null),{draft:R}=be,re=qn(be),Ko=react.useMemo(()=>Ul($.find(H=>H.petRef===R.petId||H.petId===R.petId)?.species??null),[$,R.petId]),qe=Wl(W.map(H=>Ko.find(Ge=>Ge.id===H)?.label??""),at),qo=react.useRef(R.state);qo.current!==R.state&&(qo.current=R.state,Hr&&Uo(false),Vr&&Wo(false));let er=bn(R.state,D),Yo=At(D),xt=hn(D),fe=Tn(R.state,D),Me=Bt(R.clinicianId,D),Wr=Me.refetch,ts=Sn(D).data??null,$r=Nt(D),Go=Cn(D),Ee=ro(m??null),Jo=no(R.state,y??null).actionFor("no_licensed_vet"),Kr=r??null;react.useEffect(()=>{Kr&&!R.state&&A({type:"patch",patch:{state:Kr}});},[Kr,R.state,A]),react.useEffect(()=>{t&&!R.petId&&A({type:"patch",patch:{petId:t}});},[t,R.petId,A]);let qr=$.length===1?$[0]?.petRef??null:null;react.useEffect(()=>{qr&&!R.petId&&A({type:"patch",patch:{petId:qr}});},[qr,R.petId,A]);let Xo=react.useRef(re);Xo.current=re;let Qo=react.useRef(0);react.useEffect(()=>{Q!==Qo.current&&(Qo.current=Q,A({type:"goTo",step:Xo.current}));},[Q,A]);let Yr=fe.data?.[0]?.clinicianId??null;react.useEffect(()=>{Yr&&!R.clinicianId&&A({type:"patch",patch:{clinicianId:Yr}});},[Yr,R.clinicianId,A]);let Ye=react.useRef(null),Zo=react.useRef(false);react.useEffect(()=>{if(!Zo.current){Zo.current=true;return}Ye.current?.focus();},[re]);let rs=Ql({draft:R,hold:$r,dispatch:A,setFailure:V,refetchSlots:Wr}),{submitBooking:ns,confirm:os}=Xl({draft:R,reasonText:qe,book:Go,stateAttested:Hr,termsAttested:Vr,cancellationPolicy:Yo.data??null,triage:Ee,goTo:react.useCallback(H=>A({type:"goTo",step:H}),[A]),releaseSlot:react.useCallback(()=>{es(R.slot),A({type:"patch",patch:Vl}),Wr();},[R.slot,A,Wr]),setFailure:V,setEmergency:Zt,setBookedConsult:Qa,...l?{onBooked:l}:{}}),is=er.enabled&&er.data!==null&&!er.data.wellnessAvailable,ei=xt.enabled&&xt.data?.active===false||Ie==="not_entitled",ls=xt.enabled&&xt.data!==null,as=Xn(ls),ti=Ir($o.length),ss=qe.trim().length>0||!!R.slot,ri={surfaceUnavailable:D===null||Ie==="unavailable"||xn(xt)||xn(er),notEntitled:ei,policyBlocked:is,triageOpen:Ee.open,step:re},ds=la(ri),ni={noState:!R.state,isPending:fe.enabled&&fe.isPending,isError:fe.isError,isEmpty:(fe.data?.length??0)===0,notEntitled:ei},us=sa(ni);return Oe()?jsxRuntime.jsx(oo.Provider,{value:O,children:jsxRuntime.jsxs("div",{style:{...z.screen,...C},"data-testid":N??"televet-booking",children:[jsxRuntime.jsx(mo,{step:re,furthestIndex:be.furthestIndex,triageOpen:Ee.open,canGoBack:(Ee.open||$n(be,ve))&&re!=="booked",isDirty:ss,onBack:()=>{if(Ee.open){Ee.close();return}Ee.cancel(),A({type:"back"});},onClose:()=>a?.(),headingLevel:x,...c?{onConfirmDiscard:c}:{}}),ds?jsxRuntime.jsx(aa,{state:ri,petName:We($,R.petId),...b?{primaryVet:b}:{},onFindEmergencyVet:T,stateInterest:Jo,...y?{onCheckAvailability:o(()=>A({type:"goTo",step:"clinician"}),"onCheckAvailability")}:{},onAcknowledgeEmergency:()=>{Ee.acknowledge(qe),A({type:"next"});},...k?{renderUnavailable:k}:{}}):re==="time"?jsxRuntime.jsx(Pa,{headingRef:Ye,slots:Me.data??[],enabled:Me.enabled,isPending:Me.enabled&&Me.isPending&&Me.data===null,isError:Me.isError,busySlotId:$r.isPending?$r.variables:null,failure:Ie,selectedSlot:R.slot??Za,nextOpening:ts,onPick:rs,onRetry:()=>Me.refetch(),onSeeOtherVets:()=>A({type:"goTo",step:"clinician"})}):re==="review"?jsxRuntime.jsx(Co,{headingRef:Ye,when:R.slot?Te(R.slot.startsAt):"",lengthMinutes:(R.slot?cn(R.slot):null)??tt,petName:We($,R.petId),reason:qe.trim(),clinician:fe.data?.find(H=>H.clinicianId===R.clinicianId)?.displayName??null,shareRecords:R.shareHealthRecords,stateCode:R.state,stateAttested:Hr,onToggleStateAttest:Uo,cancellationTerms:Yo.data?.summary??null,termsAttested:Vr,onToggleTermsAttest:Wo,onToggleShare:H=>A({type:"patch",patch:{shareHealthRecords:H}}),canConfirm:zt(R,qe),busy:Go.isPending,failure:Ie,onConfirm:os,emergency:Ke,onAcknowledgeEmergency:()=>ns(true),mediaShortfall:ti,primaryVet:b,onFindEmergencyVet:T,onSeeOtherVets:()=>A({type:"goTo",step:"clinician"})}):re==="booked"?jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-booked",children:Ur?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{consult:Ur,petName:We($,Ur.petId)??We($,R.petId),onDone:()=>a?.(),canJoinInApp:h,lengthMinutes:(R.slot?cn(R.slot):null)??tt,...d?{onAddToCalendar:d}:{}}),jsxRuntime.jsx(Wt,{shortfall:ti,testIDPrefix:"televet-booked"})]}):null}):re==="clinician"&&us?jsxRuntime.jsx(da,{state:ni,cause:as,locationStatus:p,...u?{onRequestLocation:u}:{},onRetry:()=>fe.refetch(),stateInterest:Jo,...k?{renderUnavailable:k}:{}}):re==="clinician"?jsxRuntime.jsx(_a,{headingRef:Ye,clinicians:fe.data??[],isPending:fe.enabled&&fe.isPending,isError:fe.isError,selectedId:R.clinicianId,onRetry:()=>fe.refetch(),onSelect:H=>{A({type:"patch",patch:{clinicianId:H}}),A({type:"next"});}}):re==="issues"?jsxRuntime.jsx(wa,{headingRef:Ye,petName:We($,R.petId),chips:Ko,selected:W,onToggle:H=>$e(Ge=>Ge.includes(H)?Ge.filter(cs=>cs!==H):[...Ge,H]),onNext:()=>A({type:"next"})}):re==="reason"?jsxRuntime.jsx(Ia,{headingRef:Ye,value:at,composed:qe,onChange:Fe,media:$o,onChangeMedia:Xa,...i?{onPickMedia:i}:{},checking:Ee.checking,onNext:()=>{Ee.check(qe).then(H=>{H&&A({type:"next"});});}}):re==="pet"?jsxRuntime.jsx(xa,{headingRef:Ye,pets:$,isPending:X.loading,isError:X.error!==null,onRetry:()=>{X.refresh();},onAddPet:s,selectedId:R.petId,onSelect:H=>{A({type:"patch",patch:{petId:H}}),A({type:"next"});}}):jsxRuntime.jsx("div",{style:J.marker,"data-testid":`televet-booking-step-${re}`})]})}):jsxRuntime.jsx("div",{style:{...z.screen,...C},"data-testid":N??"televet-booking",children:jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-copy-unapproved",children:k?k():null})})}o(Ro,"EverfurTelevetBooking");var Aa=Symbol.for("@everfur/sdk/televet");function Ba(){let e=globalThis,t=e[Aa];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[Aa]=r,r}o(Ba,"televetGlobal");function Mr(){return Ba().dailyRegistered}o(Mr,"isEverfurDailyRegistered");function _o(){let e=Ba(),t=e.noticeReceipts;if(t!==void 0)return t;let r=new Map;return e.noticeReceipts=r,r}o(_o,"noticeReceipts");function Na(e){let t=_o(),r=t.get(e);r!==void 0?r.holders+=1:t.set(e,{holders:1,joined:false});}o(Na,"markRecordingNoticeAccepted");function Da(e){let t=_o(),r=t.get(e);r!==void 0&&(r.holders-=1,r.holders<=0&&t.delete(e));}o(Da,"clearRecordingNoticeAccepted");function La(e){return _o().get(e)?.joined===true}o(La,"isTelevetCallJoined");var De=Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:De.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:De.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function Fa(e){switch(e){case "too_early":return "This visit has not opened yet.";case "too_late":return "This visit has ended.";case "room_not_ready":return "We are still setting up the video room. Try again in a moment.";case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return Xt}}o(Fa,"televetJoinRefusalWebCopy");var Xt="This visit cannot be joined right now.";function Ma(e){return e==="room_not_ready"||e==="unknown"}o(Ma,"televetJoinIsRetryable");function za(e){let t=null;return ()=>{if(t!==null)return t;let r=e();return t=r,r.then(void 0,()=>{t===r&&(t=null);}),r}}o(za,"memoizeTelevetLoader");var Ha=Object.freeze({status:"joining"});function Po(e,t){let[r,n]=react.useState(0),[l,a]=react.useState(Ha),s=react.useRef(null);react.useEffect(()=>{let d=t?.joinConsult;if(t===null||d===void 0){a(Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let c=`${e}#${String(r)}`,u=s.current;if(u===null||u.key!==c){let m;try{m=d.call(t,e);}catch(y){m=Promise.reject(y);}u={key:c,promise:m},s.current=u;}let p=true;return a(Ha),u.promise.then(m=>{p&&(m.ok?a(Object.freeze({status:"ready",credential:m.value})):a(Object.freeze({status:"refused",refusal:dn(m.error),reason:sn(m.error)})));},()=>{p&&a(Object.freeze({status:"refused",refusal:"unknown",reason:null}));}),()=>{p=false;}},[e,t,r]);let i=react.useCallback(()=>n(d=>d+1),[]);return {state:l,retry:i}}o(Po,"useTelevetJoin");var Ua=za(()=>import('@everfur/sdk/web/televet/call')),Ec=tn;function wo({consultId:e,controller:t,onLeave:r,style:n}){let l=L(),[a,s]=react.useState(null),i=a===e,[d]=react.useState(Mr);react.useEffect(()=>{if(d)return;let u=true;return Ua().then(p=>{u&&kc(p.EVERFUR_DAILY_SETUP);},()=>{}),()=>{u=false;}},[d]),$t(()=>(r(),true),!i);let c=react.useCallback(()=>{s(null),r();},[r]);return d?i?jsxRuntime.jsx(Cc,{consultId:e,controller:t,onLeave:c,style:n},e):jsxRuntime.jsx(Wa,{onContinue:()=>s(e),onDecline:r,style:n}):jsxRuntime.jsxs("div",{style:{...l.stepFill,...n},"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(q,{message:Xt}),jsxRuntime.jsx(P,{label:De.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]})}o(wo,"TelevetJoinScreen");function Wa({onContinue:e,onDecline:t,busy:r=false,declineHeld:n=false,style:l}){let a=L(),s=`${react.useId()}-recording-notice`,i=react.useRef(null);return react.useEffect(()=>{let d=i.current;if(!d)return;let c=d.ownerDocument.activeElement;c!==null&&c!==d.ownerDocument.body||d.focus();},[]),jsxRuntime.jsx("div",{style:{...a.stepFill,...l},children:jsxRuntime.jsxs("div",{ref:i,role:"alertdialog","aria-labelledby":s,"aria-busy":r||void 0,tabIndex:-1,"data-testid":"everfur-vet-call-recording-notice",style:a.stateCard,children:[jsxRuntime.jsx("p",{id:s,style:a.stateTitle,children:De.recordingNoticeTitle}),jsxRuntime.jsx(P,{label:De.recordingNoticeCta,kind:"primary",loading:r,onPress:()=>e?.(),testID:"everfur-vet-call-recording-continue"}),jsxRuntime.jsx(P,{label:De.recordingNoticeDecline,kind:"secondary",disabled:n,onPress:()=>t?.(),testID:"everfur-vet-call-recording-decline"})]})})}o(Wa,"TelevetRecordingNotice");function Cc({consultId:e,controller:t,onLeave:r,style:n}){let l=L(),a=he(t),{state:s,retry:i}=Po(e,a),d=s.status==="ready"?s.credential:null,[c,u]=react.useState(null),[p,m]=react.useState(false),y=d!==null;react.useEffect(()=>{if(!y||c!==null)return;let x=true;return Ua().then(O=>{x&&u(()=>O);},()=>{x&&m(true);}),()=>{x=false;}},[y,c]);let[b,T]=react.useState(null);react.useEffect(()=>{if(d===null)return;let x=d.roomUrl;return Na(x),T(d),()=>{Da(x);}},[d]);let h=s.status==="joining",[k,E]=react.useState(false);react.useEffect(()=>{if(!h){E(false);return}let x=setTimeout(()=>E(true),Ec);return ()=>{clearTimeout(x);}},[h]);let C=h&&!k;if($t(()=>(C||d!==null&&c!==null&&!p&&La(d.roomUrl)||r(),true)),s.status==="refused"||p){let x=s.status==="refused"?s.refusal:"unavailable",O=s.status==="refused"?Fa(s.reason):Xt;return jsxRuntime.jsxs("div",{style:{...l.stepFill,...n},"data-testid":"televet-join-refused",children:[jsxRuntime.jsx(q,{message:O,testID:"televet-join-refused-message"}),Ma(x)&&s.status==="refused"?jsxRuntime.jsx(P,{label:f.retryCta,kind:"primary",onPress:i,testID:"televet-join-retry"}):null,jsxRuntime.jsx(P,{label:De.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-leave"})]})}if(d===null||c===null||b!==d)return jsxRuntime.jsx(Wa,{busy:true,declineHeld:C,onDecline:r,style:n});let{EverfurVetCall:N}=c;return jsxRuntime.jsx(N,{roomUrl:d.roomUrl,token:d.token,onLeave:r,renderUnavailable:()=>jsxRuntime.jsxs("div",{style:l.stepFill,"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(q,{message:Xt}),jsxRuntime.jsx(P,{label:De.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]}),...n?{style:n}:{}})}o(Cc,"TelevetJoinRoom");var Va=false;function kc(e){if(Va)return;Va=true;let t=globalThis.console;try{t?.warn?.(e);}catch{}}o(kc,"warnSetupOnce");var _c=2e4;function $a(e=true,t=_c){let[r,n]=react.useState(()=>Date.now());return react.useEffect(()=>{if(!e)return;n(Date.now());let l=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(l)},[e,t]),r}o($a,"useNowMs");function Pc(e){let t=e.trim().length;return t<1?I.cancellationReasonMissing:t>Ve?I.cancellationReasonTooLong(Ve):null}o(Pc,"reasonRefusal");function Oo({terms:e,submitting:t,failure:r,onConfirm:n,onDismiss:l,onRetryTerms:a,styles:s}){let[i,d]=react.useState(""),[c,u]=react.useState(null),p=react.useId(),m=react.useId(),y=e.status==="ready",b=o(()=>{if(t||!y)return;let T=Pc(i);u(T),T||n(i.trim());},"confirm");return jsxRuntime.jsxs("form",{onSubmit:T=>{T.preventDefault(),b();},"aria-label":I.cancelConfirmCta,noValidate:true,style:s.form,"data-testid":"televet-visit-cancel-form",children:[jsxRuntime.jsx("p",{style:s.noticeTitle,children:I.cancelConfirmTitle}),e.status==="ready"?jsxRuntime.jsx("div",{style:s.notice,"data-testid":"televet-visit-cancel-terms",children:jsxRuntime.jsx("p",{style:s.note,children:e.summary})}):e.status==="loading"?jsxRuntime.jsx("div",{role:"status",style:s.notice,children:jsxRuntime.jsx("p",{style:s.note,children:I.loadingCancellationTerms})}):jsxRuntime.jsxs("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-terms-error",children:[jsxRuntime.jsx("p",{style:s.note,children:I.cancellationTermsUnavailable}),jsxRuntime.jsx(P,{label:I.retry,kind:"secondary",fullWidth:false,onPress:a})]}),jsxRuntime.jsx("label",{htmlFor:p,style:s.label,children:I.cancellationReasonLabel}),jsxRuntime.jsx("textarea",{id:p,value:i,onChange:T=>{d(T.target.value),c&&u(null);},maxLength:Ve,rows:3,disabled:t||!y,"aria-invalid":c?true:void 0,"aria-describedby":c?m:void 0,style:s.textarea,"data-testid":"televet-visit-cancel-reason"}),c?jsxRuntime.jsx("p",{id:m,role:"alert",style:s.fieldError,children:c}):null,r?jsxRuntime.jsx("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-failed",children:jsxRuntime.jsx("p",{style:s.note,children:r})}):null,jsxRuntime.jsxs("div",{style:s.actions,children:[jsxRuntime.jsx(P,{label:t?I.cancellingVisit:I.cancelConfirmCta,kind:"danger",fullWidth:false,disabled:t||!y,loading:t,onPress:b,testID:"televet-visit-cancel-yes"}),jsxRuntime.jsx(P,{label:I.cancelDismissCta,kind:"secondary",fullWidth:false,disabled:t,onPress:l,testID:"televet-visit-cancel-keep"})]})]})}o(Oo,"TelevetCancelVisitForm");function Ya(e){let{color:t,space:r,radius:n,type:l}=e,{size:a,lineHeight:s}=l,i=o(d=>`${String(d)}px`,"px");return {screen:{...ft,display:"flex",flexDirection:"column",gap:i(r.md),paddingLeft:i(r.xl),paddingRight:i(r.xl),boxSizing:"border-box"},topBar:{display:"flex",alignItems:"center",justifyContent:"flex-end",minHeight:44},topBarStart:{justifyContent:"flex-start"},iconButton:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,padding:0,border:0,borderRadius:i(n.pill),background:"transparent",color:t.text.primary,cursor:"pointer"},textButton:{display:"inline-flex",alignItems:"center",minHeight:44,padding:`0 ${i(r.sm)}`,border:0,borderRadius:i(n.pill),background:"transparent",color:t.brand,cursor:"pointer",...v(e,"bold"),fontSize:i(a.body)},panel:{display:"flex",flexDirection:"column",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:i(n.lg),backgroundColor:t.surface,overflow:"hidden"},panelBody:{display:"flex",flexDirection:"column",gap:i(r.md),padding:i(r.lg)},panelHeader:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:i(r.sm),padding:`${i(r.md)} ${i(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},panelTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},count:{...v(e,"mono"),color:t.text.metaCool,fontSize:i(a.caption)},bookTitle:{margin:0,...v(e,"medium"),color:t.brand,fontSize:i(a.subtitle),lineHeight:String(s.snug)},list:{listStyle:"none",margin:0,padding:0},row:{display:"flex",flexDirection:"column",gap:i(r.sm),padding:`${i(r.md)} ${i(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},rowHead:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:i(r.sm)},when:{margin:0,...v(e,"medium"),color:t.text.primary,fontSize:i(a.subtitle),lineHeight:String(s.snug)},pet:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.caption)},chip:{display:"inline-flex",alignItems:"center",padding:`2px ${i(r.sm)}`,borderRadius:i(n.pill),backgroundColor:t.surfaceSubtle,...v(e,"mono"),color:t.text.metaCool,fontSize:i(a.micro),letterSpacing:"0.04em",textTransform:"uppercase"},chipPositive:{backgroundColor:t.badgeBgPositive,color:t.brand},actions:{display:"flex",flexWrap:"wrap",gap:i(r.sm)},note:{margin:0,...v(e,"regular"),color:t.text.metaCool,fontSize:i(a.body),lineHeight:String(s.normal)},notice:{display:"flex",flexDirection:"column",gap:i(r.xs),padding:i(r.md),borderRadius:i(n.md),backgroundColor:t.surfaceSubtle},noticeTitle:{margin:0,...v(e,"medium"),color:t.text.primary,fontSize:i(a.body),lineHeight:String(s.snug)},noticeDanger:{backgroundColor:t.badgeBgCritical},form:{display:"flex",flexDirection:"column",gap:i(r.sm),marginTop:i(r.sm),paddingTop:i(r.md),borderTop:`1px solid ${t.brandBorder}`},label:{...v(e,"medium"),color:t.text.primary,fontSize:i(a.body)},textarea:{minHeight:96,padding:i(r.sm),borderRadius:i(n.md),border:`1px solid ${t.brandBorder}`,...v(e,"regular"),fontSize:i(a.body),color:t.text.primary,backgroundColor:t.surface,resize:"vertical",boxSizing:"border-box"},fieldError:{margin:0,...v(e,"regular"),color:t.danger,fontSize:i(a.caption)},empty:{display:"flex",flexDirection:"column",gap:i(r.xs),padding:i(r.lg)},skeletons:{display:"flex",flexDirection:"column",gap:i(r.sm),padding:i(r.lg)}}}o(Ya,"makeVisitStyles");function No({controller:e,onJoin:t,onReschedule:r,onBook:n,onBack:l,isRoot:a=true,revision:s=0,returnedTo:i=false,nowMs:d,style:c}){let u=_(),p=react.useMemo(()=>Ya(u),[u]),m=le(ye()),y=he(e),[b,T]=react.useState(0),h=vr(y,s+b),k=At(y),{pets:E}=Rr(),[C,N]=react.useState({status:"idle"}),[x,O]=react.useState(null),z=h.data??[],j=$a(z.some(W=>!dr.has(W.status))),J=d??j,{upcoming:D,past:X}=react.useMemo(()=>Dt(z,J),[z,J]),$=react.useRef(null),Q=react.useRef(null),ve=react.useRef(null),be=react.useRef(i),Le=!(h.enabled&&h.isPending);react.useEffect(()=>{!be.current||!Le||(be.current=false,!$.current?.contains(document.activeElement)&&(Q.current??ve.current)?.focus());},[Le]);let A=k.data!==null&&k.data!==void 0?{status:"ready",summary:k.data.summary}:k.enabled&&k.isPending?{status:"loading"}:{status:"error"},at=o((W,$e)=>{let Ie=y?.cancelConsult;if(A.status!=="ready"||!y||!Ie){N({status:"failed",consultId:W.consultId,message:I.cancelTermsFirst});return}N({status:"submitting",consultId:W.consultId}),Ie.call(y,W.consultId,$e).then(V=>{V.ok?(O(V.value),N({status:"idle"})):N({status:"failed",consultId:W.consultId,message:I.cancelFailed}),T(Ke=>Ke+1);},()=>N({status:"failed",consultId:W.consultId,message:I.cancelFailed}));},"cancelVisit"),Fe=o(W=>jsxRuntime.jsx(Oc,{consult:W,petName:We(E,W.petId),nowMs:J,styles:p,cancelling:C.status!=="idle"&&C.consultId===W.consultId?C:null,anyCancelInFlight:C.status==="submitting",terms:A,onJoin:t,onReschedule:r,onAskCancel:()=>{O(null),N({status:"asking",consultId:W.consultId});},onDismissCancel:()=>N({status:"idle"}),onCancel:$e=>at(W,$e),onRetryTerms:()=>k.refetch()},W.consultId),"renderRow");return jsxRuntime.jsxs("div",{ref:$,style:{...p.screen,...c},"data-testid":"televet-visits",children:[jsxRuntime.jsx("div",{style:a?p.topBar:{...p.topBar,...p.topBarStart},children:a?jsxRuntime.jsx("button",{type:"button",onClick:l,"aria-label":Ac,style:p.iconButton,"data-testid":"televet-visits-close",children:jsxRuntime.jsx(Nc,{})}):jsxRuntime.jsx("button",{type:"button",onClick:l,style:p.textButton,"data-testid":"televet-visits-back",children:Bc})}),x?jsxRuntime.jsxs("div",{role:"status",style:p.notice,"data-testid":"televet-visits-cancel-receipt",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:I.cancelledTitle}),x.summary?jsxRuntime.jsx("p",{style:p.note,children:x.summary}):null,jsxRuntime.jsx("p",{style:p.note,children:x.feeRecorded?I.cancellationFeeRecorded:I.cancellationFeeNotRecorded})]}):null,n?jsxRuntime.jsx("section",{style:p.panel,"data-testid":"televet-visits-book-card",children:jsxRuntime.jsxs("div",{style:p.panelBody,children:[jsxRuntime.jsx("p",{style:p.bookTitle,children:I.bookCardTitle}),jsxRuntime.jsx(P,{label:I.bookCardCta,onPress:n,testID:"televet-visits-book"})]})}):null,h.enabled&&h.isPending?jsxRuntime.jsxs("section",{style:p.panel,children:[jsxRuntime.jsx(Bo,{Title:m,title:I.pastTitle,count:null,styles:p}),jsxRuntime.jsx("div",{role:"progressbar","aria-label":I.loading,"aria-busy":"true",style:p.skeletons,"data-testid":"televet-visits-loading",children:[0,1,2].map(W=>jsxRuntime.jsx(me,{height:56},W))})]}):h.isError&&h.data===null?jsxRuntime.jsxs("div",{ref:ve,role:"alert",tabIndex:-1,style:{...p.notice,...p.noticeDanger},"data-testid":"televet-visits-error",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:I.loadErrorTitle}),jsxRuntime.jsx("p",{style:p.note,"data-testid":"televet-visits-error-body",children:I.loadErrorBody}),jsxRuntime.jsx(P,{label:I.retry,kind:"secondary",fullWidth:false,onPress:()=>h.refetch()})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[D.length>0?jsxRuntime.jsxs("section",{style:p.panel,"data-testid":"televet-visits-upcoming",children:[jsxRuntime.jsx(Bo,{Title:m,title:I.upcomingTitle,count:D.length,styles:p,headingRef:Q}),jsxRuntime.jsx("ul",{"aria-label":I.upcomingTitle,style:p.list,children:D.map(Fe)})]}):null,jsxRuntime.jsxs("section",{style:p.panel,"data-testid":"televet-visits-past",children:[jsxRuntime.jsx(Bo,{Title:m,title:I.pastTitle,count:X.length,styles:p,...D.length===0?{headingRef:Q}:{}}),z.length===0?jsxRuntime.jsxs("div",{style:p.empty,"data-testid":"televet-visits-empty",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:I.emptyTitle}),jsxRuntime.jsx("p",{style:p.note,children:I.emptyBody})]}):X.length===0?null:jsxRuntime.jsx("ul",{"aria-label":I.pastTitle,style:p.list,children:X.map(Fe)})]})]})]})}o(No,"TelevetVisitsScreen");function Bo({Title:e,title:t,count:r,styles:n,headingRef:l}){return jsxRuntime.jsxs("div",{style:n.panelHeader,children:[jsxRuntime.jsx(e,{style:n.panelTitle,...l?{ref:l,tabIndex:-1}:{},children:t}),r===null?null:jsxRuntime.jsx("span",{style:n.count,children:r})]})}o(Bo,"PanelHeader");function Oc({consult:e,petName:t,nowMs:r,styles:n,cancelling:l,anyCancelInFlight:a,terms:s,onJoin:i,onReschedule:d,onAskCancel:c,onDismissCancel:u,onCancel:p,onRetryTerms:m}){let y=wn(e,r),b=dr.has(e.status),T=Yi(e.status),h=Pn(e),k=In(e.status),E=e.consultId,C=react.useId(),N=!y.joinable&&!b;return jsxRuntime.jsxs("li",{style:n.row,"data-testid":`televet-visits-row-${E}`,children:[jsxRuntime.jsxs("div",{style:n.rowHead,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{style:n.when,children:Kl(e.scheduledAt)}),t?jsxRuntime.jsx("p",{style:n.pet,children:t}):null]}),T?jsxRuntime.jsx("span",{style:y.joinable?{...n.chip,...n.chipPositive}:n.chip,"data-testid":`televet-visits-status-${E}`,children:T}):null]}),jsxRuntime.jsxs("div",{style:n.actions,children:[b?null:jsxRuntime.jsx(P,{label:I.joinCta,fullWidth:false,disabled:!y.joinable,onPress:()=>i(e,t),describedBy:N?C:void 0,testID:`televet-visits-join-${E}`}),k&&d?jsxRuntime.jsx(P,{label:I.rescheduleCta,kind:"secondary",fullWidth:false,onPress:()=>d(e),testID:`televet-visits-reschedule-${E}`}):null,k?jsxRuntime.jsx(P,{label:I.cancelCta,kind:"danger",fullWidth:false,disabled:a,onPress:c,testID:`televet-visits-cancel-${E}`}):null]}),N?jsxRuntime.jsx("p",{id:C,style:n.note,"data-testid":`televet-visits-join-note-${E}`,children:Gi(y.reason,h===null?void 0:ql(new Date(h).toISOString()))}):null,l?jsxRuntime.jsx(Oo,{terms:s,submitting:l.status==="submitting",failure:l.status==="failed"?l.message:null,onConfirm:p,onDismiss:u,onRetryTerms:m,styles:n}):null]})}o(Oc,"VisitRow");var Ac="Close",Bc="Back";function Nc(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}o(Nc,"CloseGlyph");function Do(e){let{consult:t,onRescheduled:r,onCancel:n,controller:l,style:a,testID:s}=st(e,["onRescheduled","onCancel"]),i=L(),d=he(l),c=Bt(t?.clinicianId??null,d),u=Nt(d),p=kn(t?.consultId??null,d),[m,y]=react.useState(null),b=react.useCallback(h=>{y(null),u.mutate(h.slotId,{onSuccess:o(()=>{p.mutate(h.slotId,{onSuccess:o(k=>r?.(k),"onSuccess"),onError:o(k=>y(ze(k).kind==="unavailable"?"unavailable":"failed"),"onError")});},"onSuccess"),onError:o(k=>y(ze(k).kind==="unavailable"?"unavailable":"taken"),"onError")});},[u,p,r]),T=u.isPending||p.isPending;return Oe()?t?jsxRuntime.jsxs("section",{style:{...i.stepFill,...a},"aria-label":f.rescheduleNavTitle,"data-testid":s??"televet-reschedule",children:[jsxRuntime.jsx("p",{style:i.stepHelp,children:Y(f.rescheduleFromTemplate,{when:Te(t.scheduledAt)})}),m==="taken"?jsxRuntime.jsx(q,{message:f.slotTaken}):null,m==="failed"?jsxRuntime.jsx(q,{message:f.rescheduleFailed}):null,m==="unavailable"?jsxRuntime.jsx(q,{message:f.bookingPausedTitle,testID:"televet-reschedule-unavailable"}):null,c.enabled?c.isPending?jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.slots,"aria-busy":"true",style:i.list,"data-testid":"televet-reschedule-slots-loading",children:[0,1,2].map(h=>jsxRuntime.jsx(me,{height:48},h))}):c.isError?jsxRuntime.jsx(K,{title:f.slotsErrorTitle,actionLabel:f.retryCta,onAction:()=>c.refetch(),testID:"televet-reschedule-slots-error"}):(c.data??[]).length===0?jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-empty",children:jsxRuntime.jsx(K,{title:f.noSlotsTitle})}):jsxRuntime.jsx(Kt,{slots:c.data??[],busySlotId:T?u.variables:null,onPick:b,dayGroupLabel:f.summaryWhen,timeGroupLabel:f.rescheduleNavTitle,rowTestIdPrefix:"televet-reschedule-slot",testID:"televet-reschedule-slots"}):jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-paused",children:jsxRuntime.jsx(K,{title:f.bookingPausedTitle})}),jsxRuntime.jsx(P,{label:f.keepExistingCta,kind:"secondary",disabled:T,onPress:()=>n?.(),testID:"televet-reschedule-keep"})]}):jsxRuntime.jsx("div",{role:"progressbar","aria-label":f.loading.consult,"aria-busy":"true",style:{...i.list,...a},"data-testid":"televet-reschedule-loading",children:[0,1].map(h=>jsxRuntime.jsx(me,{height:48},h))}):jsxRuntime.jsx("div",{style:{...i.stepFill,...a},"data-testid":"televet-reschedule-copy-unapproved"})}o(Do,"EverfurTelevetReschedule");function zo(e){let t=e.visitRef?.trim()??"";return t.length>0?Object.freeze({name:"visit",visitRef:t,intent:e.intent??null}):Mo}o(zo,"televetScreenForRequest");var Mo=Object.freeze({name:"home"}),Hc=Object.freeze({name:"visits"}),Vc=Object.freeze({name:"booking"});function Uc(e,t){switch(t.type){case "push":return Object.freeze({stack:Object.freeze([...e.stack,t.screen])});case "pop":return e.stack.length<=1?e:Object.freeze({stack:Object.freeze(e.stack.slice(0,-1))});case "land":return e.stack[0]?.name!=="home"?e:Object.freeze({stack:Object.freeze([t.screen,...e.stack.slice(1)])});default:return e}}o(Uc,"navReducer");function Ja(e){let{style:t,renderPending:r,className:n,...l}=st(e,["onExit","onBooked","onAddPet","onRequestLocation","onFindEmergencyVet"]);return jsxRuntime.jsx(cl,{capability:"televet",style:t,...n!==void 0?{className:n}:{},...r?{renderPending:r}:{},children:jsxRuntime.jsx(Wc,{...l,...t!==void 0?{style:t}:{}})})}o(Ja,"EverfurTelevetFlow");function Wc({petRef:e,usState:t,controller:r,onBooked:n,onExit:l,onAddPet:a,onPickMedia:s,onAddToCalendar:i,onConfirmDiscard:d,onRequestLocation:c,locationStatus:u,primaryVet:p,onFindEmergencyVet:m,onTriageReason:y,historyMode:b="memory",canJoinInApp:T=false,renderUnavailable:h,initialScreen:k,headingLevel:E,style:C}){let N=L(),[x,O]=react.useReducer(Uc,k??Mo,V=>Object.freeze({stack:Object.freeze([V])})),z=x.stack[x.stack.length-1]??Mo,j=x.stack.length,J=react.useRef(j),D=j<J.current;react.useEffect(()=>{J.current=j;},[j]);let[X,$]=react.useState(0),Q=react.useCallback(()=>$(V=>V+1),[]),ve=react.useRef(0),be=react.useRef(j);be.current=j,react.useEffect(()=>{if(b!=="browser"||typeof window>"u")return;let V=o(Ke=>{let Zt=Ke.state?.efTelevet;typeof Zt=="number"&&Zt<be.current&&(ve.current=Math.max(0,ve.current-1),O({type:"pop"}));},"onPopState");return window.addEventListener("popstate",V),()=>window.removeEventListener("popstate",V)},[b]);let Le=react.useCallback(V=>{b==="browser"&&typeof window<"u"&&(ve.current+=1,window.history.pushState({efTelevet:be.current+1},"")),O({type:"push",screen:V});},[b]),A=react.useCallback(()=>{if(b==="browser"&&typeof window<"u"&&ve.current>0){ve.current-=1,window.history.go(-1);return}O({type:"pop"});},[b]),at=react.useCallback(()=>h?h():jsxRuntime.jsx("div",{style:N.list,"data-testid":"televet-unavailable",children:Oe()?jsxRuntime.jsx(K,{title:f.bookingPausedTitle}):null}),[h,N.list]),Fe=react.useCallback(()=>{j>1?A():l?.();},[j,A,l]),W=react.useCallback(V=>O({type:"land",screen:V==="visits"?Hc:Vc}),[]),$e=jsxRuntime.jsx(Ro,{...e!==void 0?{petRef:e}:{},...t!==void 0?{usState:t}:{},...r?{controller:r}:{},onBooked:V=>{Q(),n?.(V);},onExit:Fe,...a?{onAddPet:a}:{},...s?{onPickMedia:s}:{},...i?{onAddToCalendar:i}:{},...d?{onConfirmDiscard:d}:{},...c?{onRequestLocation:c}:{},...u?{locationStatus:u}:{},...p?{primaryVet:p}:{},...m?{onFindEmergencyVet:m}:{},...y?{onTriageReason:y}:{},canJoinInApp:T,renderUnavailable:at,...E!==void 0?{headingLevel:E}:{},...C?{style:C}:{}}),Ie=jsxRuntime.jsx(No,{...r?{controller:r}:{},revision:X,isRoot:j<=1,returnedTo:D,onJoin:(V,Ke)=>Le({name:"call",consultId:V.consultId,clinicianName:V.clinicianName,petName:Ke}),onReschedule:V=>Le({name:"reschedule",consult:V}),onBook:()=>Le({name:"booking"}),onBack:Fe,...C?{style:C}:{}});switch(z.name){case "home":return jsxRuntime.jsx($c,{controller:r,onLand:W,style:C});case "booking":return $e;case "visits":case "visit":return Ie;case "reschedule":return jsxRuntime.jsx(Do,{consult:z.consult,...r?{controller:r}:{},onRescheduled:()=>{Q(),A();},onCancel:()=>A(),...C?{style:C}:{}});case "call":return jsxRuntime.jsx(wo,{consultId:z.consultId,...r?{controller:r}:{},...z.clinicianName!==void 0?{clinicianName:z.clinicianName}:{},...z.petName!==void 0?{petName:z.petName}:{},onLeave:()=>{Q(),Fe();},...C?{style:C}:{}});default:return tr(z)}}o(Wc,"TelevetFlowBody");function $c({controller:e,onLand:t,style:r}){let n=L(),l=he(e),a=qi(l);return react.useEffect(()=>{a!=="pending"&&t(a);},[a,t]),jsxRuntime.jsxs("div",{role:"progressbar","aria-label":I.loading,"aria-busy":"true",style:{...n.screen,...n.list,...r},"data-testid":"televet-landing-loading",children:[jsxRuntime.jsx(me,{height:72}),jsxRuntime.jsx(me,{height:72})]})}o($c,"TelevetLandingScreen");var jo=Ja;function Yc({request:e,onClose:t,onAddToCalendar:r}){let n=_(),l=react.useMemo(()=>Gc(n),[n]),a=react.useMemo(()=>ca(),[]),s=react.useCallback(()=>{a.dispatch()||t();},[a,t]),{dialogRef:i,onKeyDown:d,onCancel:c}=Nr(true,s),u=react.useMemo(()=>zo(e),[e]);return jsxRuntime.jsx("dialog",{ref:i,onKeyDown:d,onCancel:c,"aria-label":f.visit.title,"data-testid":"everfur-televet-dialog",style:l,children:jsxRuntime.jsx(po.Provider,{value:a,children:jsxRuntime.jsx(jo,{...e.petRef!==void 0?{petRef:e.petRef}:{},...e.usState!==void 0?{usState:e.usState}:{},initialScreen:u,onExit:t,...r?{onAddToCalendar:r}:{},canJoinInApp:Mr(),historyMode:"memory"})})})}o(Yc,"EverfurTelevetDialog");function Gc(e){let{color:t,radius:r,space:n}=e;return {position:"fixed",inset:0,boxSizing:"border-box",width:"100%",maxWidth:640,height:"100%",maxHeight:"100%",margin:"0 auto",padding:`${String(n.lg)}px 0`,border:0,borderRadius:r.lg,display:"flex",flexDirection:"column",overflowY:"auto",backgroundColor:t.surface,color:t.text.primary}}o(Gc,"dialogStyle");exports.BACK_LABEL=Yu;exports.CANCELLATION_POLICY_VERSION_MAX=cr;exports.CANCEL_REASON_MAX=Ve;exports.CONSULT_KINDS=Ri;exports.CONSULT_MINUTES=tt;exports.CONSULT_STATUSES=xi;exports.EverfurTelevet=jo;exports.EverfurTelevetBooking=Ro;exports.EverfurTelevetDialog=Yc;exports.EverfurTelevetFlow=Ja;exports.EverfurTelevetReschedule=Do;exports.MEDIA_REFS_MAX=pr;exports.NO_MEDIA_SHORTFALL=Ht;exports.REASON_TEXT_MAX=He;exports.TELEVET_BOOKING_BASE=Ue;exports.TELEVET_BOOKING_COPY=ie;exports.TELEVET_BOOKING_COPY_WEB=f;exports.TELEVET_BOOKING_STEPS=Mt;exports.TELEVET_CONSULT_PAGE_LIMIT=Mi;exports.TELEVET_EMERGENCY_EXITS_WEB=dt;exports.TELEVET_JOIN_CLOSES_MINUTES_AFTER=_n;exports.TELEVET_JOIN_OPENS_MINUTES_BEFORE=Rn;exports.TERMINAL_CONSULT_STATUSES=dr;exports.TelevetBookedScreen=co;exports.TelevetBookingChrome=mo;exports.TelevetCancelVisitForm=Oo;exports.TelevetClinicianEmptyState=ia;exports.TelevetConsentCheckbox=qt;exports.TelevetDayStrip=bo;exports.TelevetEarlyEmergency=oa;exports.TelevetEmergencyExits=Ut;exports.TelevetEntitlementInterestState=Nu;exports.TelevetIntakeMedia=go;exports.TelevetJoinScreen=wo;exports.TelevetMediaDropNotice=Wt;exports.TelevetSlotPicker=Kt;exports.TelevetStateInterestAction=lo;exports.TelevetSummaryCard=So;exports.TelevetSummaryRow=it;exports.TelevetVisitsScreen=No;exports.attestation=Gn;exports.canConfirm=zt;exports.canManageTelevetVisit=In;exports.createTelevetBookingController=mn;exports.currentStep=qn;exports.emptyTelevetDraft=zl;exports.formatVisitRange=fu;exports.formatWhen=$l;exports.formatWhenWithDay=Te;exports.hasPreviousStep=$n;exports.initialTelevetBookingState=Wn;exports.isHoldExpired=wr;exports.isMediaShortfallEmpty=Qn;exports.isSkipped=_r;exports.isTelevetBookingCopyReady=Oe;exports.isWellFormedStateCode=Ce;exports.mediaShortfallFromUnsentPicks=Ir;exports.parseVetCallCredential=an;exports.splitTelevetVisits=Dt;exports.televetBookingKey=Yn;exports.televetBookingReducer=Kn;exports.televetBookingRefusal=ze;exports.televetCancelCall=Fi;exports.televetConsultCalendarKey=ua;exports.televetConsultCall=yr;exports.televetDaysFromSlots=Fr;exports.televetEmptyRosterCause=Xn;exports.televetEmptyRosterView=Jn;exports.televetHoldCall=Ni;exports.televetJoinCall=Li;exports.televetJoinDecision=wn;exports.televetJoinOpensAtMs=Pn;exports.televetMediaShortfallLines=Zn;exports.televetRescheduleCall=Di;exports.televetScreenForRequest=zo;exports.useEarlyTriage=ro;exports.useStateInterest=no;exports.useTelevetBookConsult=Cn;exports.useTelevetBookingAvailable=Sd;exports.useTelevetBookingController=he;exports.useTelevetBookingEntitlement=hn;exports.useTelevetCancellationPolicy=At;exports.useTelevetClinicians=Tn;exports.useTelevetHoldSlot=Nt;exports.useTelevetJoin=Po;exports.useTelevetNextSlot=Sn;exports.useTelevetRescheduleConsult=kn;exports.useTelevetSlots=Bt;exports.useTelevetStatePolicy=bn;exports.validateBookingBody=zi;exports.vetCallJoinReason=sn;exports.vetCallJoinRefusal=dn;exports.withUnsentPicks=gu;
|