@everfur/sdk 0.9.3 → 0.11.0
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 +82 -0
- package/README.md +17 -8
- package/dist/{Chat-Dy1L27a8.d.ts → Chat-CPW5ehw-.d.ts} +3 -3
- package/dist/{Chat-Bkv-MLLu.d.cts → Chat-qAuYAzFN.d.cts} +3 -3
- package/dist/{DepthViews-CBalhef3.d.cts → DepthViews-BpzrZ9UP.d.cts} +1 -1
- package/dist/{DepthViews-eRdy2ayE.d.cts → DepthViews-CAtWjn-B.d.cts} +1 -1
- package/dist/{DepthViews-De6yb5Tq.d.ts → DepthViews-CkahN4Y5.d.ts} +1 -1
- package/dist/{DepthViews-BwyzpEyX.d.ts → DepthViews-Dq0g7VtA.d.ts} +1 -1
- package/dist/animations/index.cjs +4 -2
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +4 -2
- package/dist/{attachments-BAcQdIz7.d.ts → attachments-37PYsEhe.d.ts} +5 -5
- package/dist/{attachments-tPWJ0DJI.d.cts → attachments-BZ8W4vcl.d.cts} +5 -5
- package/dist/{attachments-Brt7ivEo.d.ts → attachments-DGlHsBbQ.d.ts} +2 -2
- package/dist/{attachments-DhGAelCA.d.cts → attachments-xhie8PDh.d.cts} +2 -2
- package/dist/{bookingCopy-CJLAgEgK.d.ts → bookingCopy-CS3QZma_.d.ts} +2 -2
- package/dist/{bookingCopy-Ds2JGcPE.d.cts → bookingCopy-DDHuE_sf.d.cts} +2 -2
- package/dist/{casesRepository-DjhMfm_n.d.ts → casesRepository-CgpSKb2U.d.ts} +1 -1
- package/dist/{casesRepository-D0aQSXkb.d.cts → casesRepository-DNK5gHlI.d.cts} +1 -1
- package/dist/chat/index.cjs +10 -8
- package/dist/chat/index.d.cts +9 -9
- package/dist/chat/index.d.ts +9 -9
- package/dist/chat/index.js +10 -8
- package/dist/client/index.cjs +5 -3
- package/dist/client/index.d.cts +7 -7
- package/dist/client/index.d.ts +7 -7
- package/dist/client/index.js +5 -3
- package/dist/{config-DeUmccwl.d.ts → config-Cp9Zo6xK.d.ts} +1 -1
- package/dist/{config-C68HTCf4.d.cts → config-DJHqL-U3.d.cts} +1 -1
- package/dist/consent/index.cjs +4 -2
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +4 -2
- package/dist/{context-D_2sCvoo.d.ts → context-CHGBKxFG.d.ts} +13 -5
- package/dist/{context-DY9pcjdK.d.cts → context-C_3Em1sq.d.cts} +13 -5
- package/dist/{copy-wAnv8ldC.d.ts → copy-CaslsF6f.d.ts} +2 -2
- package/dist/{copy-tYW0C83H.d.cts → copy-Fbdk6p43.d.cts} +2 -2
- package/dist/core/index.cjs +9 -8
- package/dist/core/index.d.cts +12 -12
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.js +9 -8
- package/dist/{depth-C7RIscDR.d.ts → depth-DwS8HfHo.d.ts} +2 -2
- package/dist/{depth-jbSWsweM.d.cts → depth-DxqHB-Xi.d.cts} +2 -2
- package/dist/{entitlementRepository-Ccc6K6wB.d.cts → entitlementRepository-Do9RzJ8e.d.cts} +2 -2
- package/dist/{entitlementRepository-D7Fc7OdG.d.ts → entitlementRepository-DosFNBqA.d.ts} +2 -2
- package/dist/{identity-BTT6YtH5.d.ts → identity-5Jc-BTMj.d.ts} +8 -2
- package/dist/{identity-ScajqjK5.d.cts → identity-VHQ_4xWJ.d.cts} +8 -2
- package/dist/index.cjs +10 -9
- package/dist/index.d.cts +15 -14
- package/dist/index.d.ts +15 -14
- package/dist/index.js +10 -9
- package/dist/notifications/index.cjs +4 -2
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +4 -2
- package/dist/{pets-uKMldfz0.d.cts → pets-DiBD6Xds.d.cts} +1 -1
- package/dist/{pets-CqeoV1Jv.d.ts → pets-wh2Kb7z8.d.ts} +1 -1
- package/dist/{petsRepository-BdfbY9Oe.d.ts → petsRepository-DzvGKxqu.d.ts} +1 -1
- package/dist/{petsRepository-BYe7_MUo.d.cts → petsRepository-NivC5Xzk.d.cts} +1 -1
- package/dist/photo/index.cjs +4 -2
- package/dist/photo/index.js +4 -2
- package/dist/{ports-D4FQKTBS.d.ts → ports-BoPJsZIH.d.ts} +6 -4
- package/dist/{ports-okLpXkpu.d.cts → ports-CLWTzmGi.d.cts} +6 -4
- package/dist/records/depth/index.cjs +6 -4
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +6 -4
- package/dist/records/index.cjs +10 -8
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +10 -8
- package/dist/{requestFunnel-u8qnM5Ll.d.cts → requestFunnel-B8lodGM0.d.cts} +2 -2
- package/dist/{requestFunnel-Dhaj0yUq.d.ts → requestFunnel-CybT6svX.d.ts} +2 -2
- package/dist/{runtimeTypes-C67itXfp.d.cts → runtimeTypes-BCgI1pA_.d.cts} +29 -5
- package/dist/{runtimeTypes-BFes64Vp.d.ts → runtimeTypes-TqeLgyFl.d.ts} +29 -5
- package/dist/server/events/index.cjs +4 -2
- package/dist/server/events/index.d.cts +25 -6
- package/dist/server/events/index.d.ts +25 -6
- package/dist/server/events/index.js +4 -2
- package/dist/server/index.cjs +6 -4
- package/dist/server/index.d.cts +5 -4
- package/dist/server/index.d.ts +5 -4
- package/dist/server/index.js +6 -4
- package/dist/televet/booking/index.cjs +21 -16
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/televet/booking/index.js +22 -17
- package/dist/televet/index.cjs +4 -2
- package/dist/televet/index.js +4 -2
- package/dist/testing/index.cjs +3 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -1
- package/dist/testing/rn/index.cjs +4 -2
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/rn/index.js +4 -2
- package/dist/testing/web/index.cjs +4 -2
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/testing/web/index.js +4 -2
- package/dist/{timelineRows-CDSO3ElK.d.cts → timelineRows-B-dwSEbF.d.cts} +1 -1
- package/dist/{timelineRows-pd4wYVbe.d.ts → timelineRows-KniW4F-u.d.ts} +1 -1
- package/dist/{useRecordsDepth-CqSMkcyR.d.ts → useRecordsDepth-C1ooUNq4.d.ts} +1 -1
- package/dist/{useRecordsDepth-W3UAKQRN.d.cts → useRecordsDepth-CRC3tIAW.d.cts} +1 -1
- package/dist/video/index.cjs +4 -2
- package/dist/video/index.js +4 -2
- package/dist/{view-CKfIaJYp.d.ts → view-DkPxUatd.d.ts} +2 -2
- package/dist/{view-h7RPJAEe.d.cts → view-qFBv8ZoE.d.cts} +2 -2
- package/dist/web/consent/index.cjs +4 -2
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +4 -2
- package/dist/web/index.cjs +10 -9
- package/dist/web/index.d.cts +17 -16
- package/dist/web/index.d.ts +17 -16
- package/dist/web/index.js +10 -9
- package/dist/web/notifications/index.cjs +4 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/notifications/index.js +4 -2
- package/dist/web/records/depth/index.cjs +6 -4
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/depth/index.js +6 -4
- package/dist/web/records/index.cjs +14 -12
- package/dist/web/records/index.d.cts +9 -9
- package/dist/web/records/index.d.ts +9 -9
- package/dist/web/records/index.js +14 -12
- package/dist/web/televet/booking/index.cjs +7 -5
- 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 +7 -5
- package/dist/web/televet/index.cjs +4 -2
- package/dist/web/televet/index.js +4 -2
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { P as PetRef } from '../../ids-B2GAAifq.cjs';
|
|
4
4
|
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.cjs';
|
|
5
|
-
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy-
|
|
6
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aq as televetJoinOpensAtMs, ar as televetJoinReadiness, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../bookingCopy-
|
|
5
|
+
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy-DDHuE_sf.cjs';
|
|
6
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aq as televetJoinOpensAtMs, ar as televetJoinReadiness, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../bookingCopy-DDHuE_sf.cjs';
|
|
7
7
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal-C5dTUACe.cjs';
|
|
8
8
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal-C5dTUACe.cjs';
|
|
9
9
|
import { V as VetVisitIntent } from '../../visitIntent-D7_yVp1I.cjs';
|
|
@@ -12,11 +12,11 @@ export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCa
|
|
|
12
12
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../callRoom-BhIdadyV.cjs';
|
|
13
13
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DeBqRpQV.cjs';
|
|
14
14
|
export { E as EverfurResult } from '../../EverfurResult-COlXj1wq.cjs';
|
|
15
|
-
export { W as WidgetPet } from '../../petsRepository-
|
|
16
|
-
import '../../requestFunnel-
|
|
15
|
+
export { W as WidgetPet } from '../../petsRepository-NivC5Xzk.cjs';
|
|
16
|
+
import '../../requestFunnel-B8lodGM0.cjs';
|
|
17
17
|
import '../../ErrorPolicyPort-10s3HJCt.cjs';
|
|
18
|
-
import '../../config-
|
|
19
|
-
import '../../identity-
|
|
18
|
+
import '../../config-DJHqL-U3.cjs';
|
|
19
|
+
import '../../identity-VHQ_4xWJ.cjs';
|
|
20
20
|
import '../../TelemetryPort-BDNr00hu.cjs';
|
|
21
21
|
import '../../profile-CSs1wlXT.cjs';
|
|
22
22
|
|
|
@@ -2,8 +2,8 @@ import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { P as PetRef } from '../../ids-B2GAAifq.js';
|
|
4
4
|
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
|
|
5
|
-
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy-
|
|
6
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aq as televetJoinOpensAtMs, ar as televetJoinReadiness, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../bookingCopy-
|
|
5
|
+
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy-CS3QZma_.js';
|
|
6
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aq as televetJoinOpensAtMs, ar as televetJoinReadiness, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../bookingCopy-CS3QZma_.js';
|
|
7
7
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal-CnjrfhT4.js';
|
|
8
8
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal-CnjrfhT4.js';
|
|
9
9
|
import { V as VetVisitIntent } from '../../visitIntent-D7_yVp1I.js';
|
|
@@ -12,11 +12,11 @@ export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCa
|
|
|
12
12
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../callRoom-B92eH_ij.js';
|
|
13
13
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DeBqRpQV.js';
|
|
14
14
|
export { E as EverfurResult } from '../../EverfurResult-ClPTS0P2.js';
|
|
15
|
-
export { W as WidgetPet } from '../../petsRepository-
|
|
16
|
-
import '../../requestFunnel-
|
|
15
|
+
export { W as WidgetPet } from '../../petsRepository-DzvGKxqu.js';
|
|
16
|
+
import '../../requestFunnel-CybT6svX.js';
|
|
17
17
|
import '../../ErrorPolicyPort-C3nNSS_j.js';
|
|
18
|
-
import '../../config-
|
|
19
|
-
import '../../identity-
|
|
18
|
+
import '../../config-Cp9Zo6xK.js';
|
|
19
|
+
import '../../identity-5Jc-BTMj.js';
|
|
20
20
|
import '../../TelemetryPort-BDNr00hu.js';
|
|
21
21
|
import '../../profile-CSs1wlXT.js';
|
|
22
22
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createContext,forwardRef,createElement,useMemo,useState,useRef,useEffect,useCallback,useReducer,useContext,useSyncExternalStore,Component}from"react";import{TextInput as TextInput$1,StyleSheet,View,Pressable,Linking,Animated,Alert,BackHandler,Image,ActivityIndicator,ScrollView,Modal,StatusBar,Text as Text$1}from"react-native";import{z}from"zod";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as callModule from"@everfur/sdk/televet/call";import{useSafeAreaInsets}from"react-native-safe-area-context";function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
1
|
+
import{createContext,forwardRef,createElement,useMemo,useState,useRef,useEffect,useCallback,useReducer,useContext,useSyncExternalStore,Component}from"react";import{TextInput as TextInput$1,StyleSheet,View,Pressable,Linking,Animated,Alert,BackHandler,Image,ActivityIndicator,ScrollView,Platform,KeyboardAvoidingView,Modal,StatusBar,Text as Text$1,Dimensions}from"react-native";import{z}from"zod";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as callModule from"@everfur/sdk/televet/call";import{useSafeAreaInsets}from"react-native-safe-area-context";function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
2
2
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}function callHostAsync(fn,...args){let started;try{started=fn(...args)}catch(error){return reportHostFailure(error),Promise.resolve({ok:false,error:error})}return Promise.resolve(started).then(value=>({ok:true,value:value}),error=>({ok:false,error:error}))}function createTelevetBackChannel(){let handlers=[];return{register(handler){return handlers=[...handlers,handler],()=>{handlers=handlers.filter(h=>h!==handler)}},dispatch(){for(let handler of[...handlers].reverse())try{if(handler())return!0}catch{}return false}}}var TelevetBackChannelContext=createContext(null);function useTelevetBackChannel(handler,enabled=true){let channel=useContext(TelevetBackChannelContext),current=useRef(handler);current.current=handler,useEffect(()=>{if(!(channel===null||!enabled))return channel.register(()=>current.current())},[channel,enabled])}var EMERGENCY_ER_LINE="Go to the nearest emergency vet now.";var DRAFT=s=>s,PLACEHOLDER_MARKERS=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function isPlaceholderCopy(value){return PLACEHOLDER_MARKERS.some(m=>value.toUpperCase().includes(m.toUpperCase()))}function fill(template,slots){let out=template;for(let[key,value]of Object.entries(slots))out=out.split(`{${key}}`).join(value);return out}var TELEVET_BOOKING_COPY=/* @__PURE__ */Object.freeze({stateBlockedTitle:DRAFT("Not available in this state yet"),noCliniciansTitle:DRAFT("No vets available right now"),noCliniciansBody:DRAFT("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:DRAFT("Check again"),noCliniciansRegionBody:DRAFT("Video visits have to be with a vet licensed in your state, and we don’t have one there yet."),yourVetTitle:DRAFT("Your vet"),licensedPillTemplate:DRAFT("Licensed in {state}"),reviewsLabel:DRAFT("reviews"),rescheduleFromTemplate:DRAFT("Moving your visit on {when}"),rescheduleFailed:DRAFT("That did not move. Your original time is unchanged."),rescheduleStepLabel:DRAFT("Reschedule"),rescheduleTitleTemplate:DRAFT("Pick a new time for {pet}"),rescheduleNowLabel:DRAFT("Now"),rescheduleMoveTemplate:DRAFT("Move to {when}"),rescheduleMoving:DRAFT("Moving…"),rescheduleKeepLabel:DRAFT("Keep the visit as it is"),keepExistingCta:DRAFT("Keep my current time"),bookingPausedTitle:DRAFT("Booking is not available right now."),slotsErrorTitle:DRAFT("Could not load times"),noSlotsTitle:DRAFT("No times available"),nextOpeningTemplate:DRAFT("Next opening across our vets: {when}"),seeOtherVetsCta:DRAFT("See other vets"),retryCta:DRAFT("Try again"),holdExpired:DRAFT("That time is no longer held. Pick another."),slotTaken:DRAFT("That time was just taken. Pick another."),reasonPlaceholder:DRAFT("What is going on with your pet?"),reasonTooLong:DRAFT("That is too long. Please shorten it."),shareRecordsOff:DRAFT("Share health records with this vet"),confirmNotEntitled:DRAFT("A Pro membership is needed to book a video visit."),confirmFailed:DRAFT("That did not book. Try again."),checkAvailabilityCta:DRAFT("Check availability"),stateInterest:/* @__PURE__ */Object.freeze({cta:DRAFT("Add me to the list"),submitting:DRAFT("Adding you to the list…"),joinedTitle:DRAFT("You are on the list"),joinedBody:DRAFT("We will let you know when this changes."),failed:DRAFT("That did not save. Try again.")}),media:/* @__PURE__ */Object.freeze({droppedTemplate:DRAFT("{n} attachment did not upload."),droppedPluralTemplate:DRAFT("{n} attachments did not upload."),refusedSizeTemplate:DRAFT("{n} attachment was too large to send."),refusedSizePluralTemplate:DRAFT("{n} attachments were too large to send."),refusedTypeTemplate:DRAFT("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:DRAFT("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:DRAFT("{n} attachment could not be read."),refusedUnreadablePluralTemplate:DRAFT("{n} attachments could not be read.")}),navTitle:DRAFT("Book a visit"),petFallback:"your pet",whereTitleTemplate:DRAFT("Where will {pet} be during the visit?"),whereLeadTemplate:DRAFT("Pick where {pronoun} be for the call, not where you live. It decides what the vet can do."),wherePronounFallback:"they’ll",whereFormLabelTemplate:DRAFT("Where {pet} will be"),whereLegend:DRAFT("State"),wherePrescribeMetaTemplate:DRAFT("Video visit, and prescriptions if {pet} needs them"),whereWellnessMeta:DRAFT("Wellness visit: advice and a care plan, no prescriptions yet"),whereAnotherState:DRAFT("Another state"),whereWhichState:DRAFT("Which state?"),whereLicensedTemplate:DRAFT("{vet} is licensed in {state}, so a prescription can be part of {pet}’s plan."),whereAskEveryTime:DRAFT("We ask every time: state rules require it."),issuesTitleTemplate:DRAFT("What’s going on with {pet}?"),issuesHint:DRAFT("Pick as many as you like."),issuesFormLabel:DRAFT("What’s going on"),issuesLegend:DRAFT("Main issues"),issuesPickOne:DRAFT("Pick at least one. Not sure? Choose Something else."),otherIssue:DRAFT("Something else"),describeHeadingTemplate:DRAFT("Tell {vet} what you’re seeing"),describeFieldLabel:DRAFT("What you’re seeing"),emergencyCheck:/* @__PURE__ */Object.freeze({titleTemplate:DRAFT("Is {pet} doing any of these right now?"),lead:DRAFT("A scheduled video visit isn’t the right place for an emergency."),signs:/* @__PURE__ */Object.freeze([DRAFT("Trouble breathing, or blue, grey or very pale gums"),DRAFT("Collapsed, or can’t stand up"),DRAFT("A seizure"),DRAFT("Ate something toxic, like grapes, chocolate, xylitol or medicine"),DRAFT("A swollen, hard belly, or retching with nothing coming up"),DRAFT("Bleeding that won’t stop"),DRAFT("Straining to pee with nothing coming out")]),formLabel:DRAFT("Emergency check"),legend:DRAFT("Any of these now?"),noneCta:DRAFT("No, none of these"),someCta:DRAFT("Yes, at least one")}),timeHeading:DRAFT("Pick a time"),timeMorning:DRAFT("Morning"),timeAfternoon:DRAFT("Afternoon"),timeEvening:DRAFT("Evening"),timeLegendTemplate:DRAFT("Time on {day}"),dayLegend:DRAFT("Day"),reviewHeading:DRAFT("Does this look right?"),summaryWhere:DRAFT("Where"),changeCta:DRAFT("Change"),whereAttestTemplate:DRAFT("{pet} and I will be in {state} during the visit."),attestBoth:DRAFT("Check both boxes to book the visit."),bookedStepLabel:DRAFT("Booked"),bookedTitleTemplate:DRAFT("You’re booked with {vet}"),bookedLeadTemplate:DRAFT("{when}, for {pet}."),footnote:DRAFT("Video visits are with a licensed veterinarian. Prescriptions where allowed, starting with California. In an emergency, go to the nearest emergency animal hospital."),rescheduleNavTitle:DRAFT("Change your visit"),close:DRAFT("Close"),continueCta:DRAFT("Continue"),petSelectTitle:DRAFT("Who is this visit for?"),addPetCta:DRAFT("Add a pet"),addAnotherPetCta:DRAFT("Add another pet"),locationUnknownTitle:DRAFT("We need your location to find a vet"),locationUnknownBody:DRAFT("Turn on location for Everfur, then try again."),locationUnknownCta:DRAFT("Allow location"),locationBlockedTitle:DRAFT("Location is turned off"),locationBlockedBody:DRAFT("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:DRAFT("Open Settings"),locationUnavailableTitle:DRAFT("We could not read your location"),locationUnavailableBody:DRAFT("Try again in a moment."),stateAttestTemplate:DRAFT("I confirm my pet and I are in {state} right now."),describeHeading:DRAFT("Tell the vet what you are seeing"),describeHelpLong:DRAFT("When it started, what’s changed, what you’ve tried. Anything helps."),addPhotoCta:DRAFT("Add photos or videos"),addPhotoMeta:DRAFT("Optional. A close-up in good light helps."),removePhotoLabel:DRAFT("Remove photo"),summaryPet:DRAFT("Pet"),summaryVet:DRAFT("Vet"),summaryWhen:DRAFT("When"),summaryLength:DRAFT("Length"),summaryReason:DRAFT("About"),summaryLengthTemplate:DRAFT("{n} minutes"),confirmCta:DRAFT("Book the visit"),confirmBusy:DRAFT("Booking…"),bookedTitle:DRAFT("You are booked."),addToCalendarCta:DRAFT("Add to calendar"),doneCta:DRAFT("Done"),booked:/* @__PURE__ */Object.freeze({remindPromise:DRAFT("We will notify you 30 minutes before."),summaryPromise:DRAFT("{pet}'s summary goes to the vet ahead of the call."),recordsPromiseTemplate:DRAFT("{pet}’s records and your notes go to {vet} ahead of the call."),recordsPhotoPromiseTemplate:DRAFT("{pet}’s records, your notes and the photo go to {vet} ahead of the call."),stepsLabel:DRAFT("What happens next"),joinPromise:DRAFT("Join right here in the app. No links to hunt for."),backToPet:DRAFT("Back to {pet}"),calendarAdded:DRAFT("Added to your calendar"),calendarFailedBody:DRAFT("That did not save to your calendar.")}),chrome:/* @__PURE__ */Object.freeze({closeHint:DRAFT("Closes without saving"),discardTitle:DRAFT("Leave without booking?"),discardBody:DRAFT("Your answers will not be saved."),discardConfirmCta:DRAFT("Leave"),discardKeepCta:DRAFT("Keep going"),noPetsTitle:DRAFT("No pets on this account"),loadFailedTitle:DRAFT("Could not load"),retryCta:DRAFT("Try again")}),emergency:/* @__PURE__ */Object.freeze({bannerTitle:DRAFT("This can’t wait for a scheduled visit."),keepBookingCta:DRAFT("I’ve handled this, continue booking"),lede:DRAFT("What you’re describing is the kind of thing vets want to see in person, now. Call one of these first."),ledeWithoutExits:DRAFT("What you’re describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:DRAFT("Call {petName}’s regular vet"),exitFindErTitle:DRAFT("Find an emergency vet near you"),exitGoToErTitle:EMERGENCY_ER_LINE,startCallHint:DRAFT("Starts a phone call"),poisonControl:DRAFT("ASPCA Animal Poison Control"),poisonControlDetail:DRAFT("(888) 426-4435 · a fee may apply"),poisonControlTel:"tel:+18884264435"}),visit:/* @__PURE__ */Object.freeze({title:DRAFT("Your visit")}),loading:/* @__PURE__ */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 televetBookingCopyValues(node=TELEVET_BOOKING_COPY){return typeof node=="string"?[node]:typeof node!="object"||node===null?[]:Object.values(node).flatMap(v=>televetBookingCopyValues(v))}function isTelevetBookingCopyReady(){return televetBookingCopyValues().every(value=>value.trim().length>0&&!isPlaceholderCopy(value))}var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
3
3
|
/* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
4
4
|
/* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
|
|
@@ -67,6 +67,7 @@ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fiel
|
|
|
67
67
|
/* @__PURE__ */Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
68
68
|
/* @__PURE__ */Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
69
69
|
/* @__PURE__ */Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
70
|
+
/* @__PURE__ */Object.freeze({wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false}),
|
|
70
71
|
/* @__PURE__ */Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),
|
|
71
72
|
/* @__PURE__ */Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),
|
|
72
73
|
/* @__PURE__ */Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
@@ -78,6 +79,7 @@ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fiel
|
|
|
78
79
|
/* @__PURE__ */Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
79
80
|
/* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),
|
|
80
81
|
/* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
|
|
82
|
+
/* @__PURE__ */Object.freeze({wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
81
83
|
/* @__PURE__ */Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
82
84
|
/* @__PURE__ */Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),
|
|
83
85
|
/* @__PURE__ */Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),
|
|
@@ -86,9 +88,9 @@ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fiel
|
|
|
86
88
|
/* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
87
89
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
88
90
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
89
|
-
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row2=>row2.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row2=BY_KEY.get(candidate+key);if(row2)return row2}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row2=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row2);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row2=>row2.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row2=BY_KEY.get(candidate+key);if(row2)return row2}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row2=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row2);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
|
|
90
92
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
91
|
-
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp2=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp2({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp2({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp2({phase:"settled",...settledEvent})),err(error);if(emit(stamp2({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp2({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
93
|
+
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(authRejectedError(retry.error.httpStatus))):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp2=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp2({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp2({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp2({phase:"settled",...settledEvent})),err(error);if(emit(stamp2({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp2({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
92
94
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
93
95
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var TELEVET_ATTACHMENT_MIME_TYPES=/* @__PURE__ */Object.freeze(["image/jpeg","image/png","image/webp","image/heic","image/heif","application/pdf","text/csv","video/mp4","video/quicktime"]),TELEVET_ATTACHMENT_MAX_BYTES=25*1024*1024,TELEVET_ATTACHMENT_VIDEO_MAX_BYTES=200*1024*1024,SUFFIX_TYPES=[[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".png","image/png"],[".webp","image/webp"],[".heic","image/heic"],[".heif","image/heif"],[".pdf","application/pdf"],[".csv","text/csv"],[".mp4","video/mp4"],[".mov","video/quicktime"]];function televetAttachmentContentType(filename,mimeType){let direct=(mimeType??"").trim().toLowerCase();if(direct==="image/jpg")return"image/jpeg";if(TELEVET_ATTACHMENT_MIME_TYPES.includes(direct))return direct;if(direct.length>0)return null;let name=filename.toLowerCase();return SUFFIX_TYPES.find(([suffix])=>name.endsWith(suffix))?.[1]??null}function televetAttachmentRefusal(pick2){let type=televetAttachmentContentType(pick2.filename,pick2.mimeType);if(type===null)return"type";if(!Number.isFinite(pick2.fileSize)||pick2.fileSize<=0)return"unreadable";let ceiling=type.startsWith("video/")?TELEVET_ATTACHMENT_VIDEO_MAX_BYTES:TELEVET_ATTACHMENT_MAX_BYTES;return pick2.fileSize<=ceiling?null:"size"}function parseTelevetAttachmentPolicy(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,str4=v=>typeof v=="string"&&v.length>0?v:null,num3=v=>typeof v=="number"&&Number.isFinite(v)?v:null,uploadUrl=str4(o.upload_url),s3Key=str4(o.s3_key);if(uploadUrl===null||s3Key===null)return null;let fields={},rawFields=o.upload_fields;if(typeof rawFields=="object"&&rawFields!==null)for(let[key,value]of Object.entries(rawFields))typeof value=="string"&&(fields[key]=value);/* @__PURE__ */
|
|
94
96
|
return Object.freeze({upload_id:str4(o.upload_id)??"",upload_url:uploadUrl,upload_fields:/* @__PURE__ */Object.freeze(fields),expires_in_seconds:num3(o.expires_in_seconds)??0,max_content_length:num3(o.max_content_length)??TELEVET_ATTACHMENT_MAX_BYTES,s3_key:s3Key,purpose:str4(o.purpose)})}function wireCodeOf(raw){if(typeof raw!="object"||raw===null)return null;let scopes=[raw,raw.detail,raw.error];for(let scope of scopes)if(!(typeof scope!="object"||scope===null))for(let key of["error","code"]){let value=scope[key];if(typeof value=="string"&&value.length>0)return value}return null}function televetAttachmentInitiateFailure(error){if(error.httpStatus===404)return"dark";if(error.httpStatus===400){let code=wireCodeOf(error.raw);if(code==="FILE_TOO_LARGE")return"size";if(code==="INVALID_CONTENT_TYPE")return"type"}return"failed"}var TELEVET_BOOKING_NOT_LIVE="televet_booking_not_live";function televetBookingNotLiveError(status){return makeEverfurError("conflict",{retryable:false,reasonCode:TELEVET_BOOKING_NOT_LIVE,wireMessage:`the booking was answered with a consult whose status is ${status}, which is not a live visit`})}var TELEVET_BOOKING_KEY_REUSED="televet_booking_key_reused",KEY_REUSED_WIRE_CODE="IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST";function foldTelevetBookingKeyReused(error){return error.httpStatus!==409||error.reasonCode===TELEVET_BOOKING_KEY_REUSED||details(error)?.code!==KEY_REUSED_WIRE_CODE?error:makeEverfurError(error.code,{retryable:false,httpStatus:409,...error.requestId!==void 0?{requestId:error.requestId}:{},wireCode:KEY_REUSED_WIRE_CODE,reasonCode:TELEVET_BOOKING_KEY_REUSED,...error.wireMessage!==void 0?{wireMessage:error.wireMessage}:{},raw:error.raw})}function details(error){let raw=error.raw;if(typeof raw!="object"||raw===null)return null;let direct=raw,nested=direct.detail??direct.error;return typeof nested=="object"&&nested!==null?nested:direct}function categoriesOf(error){let raw=details(error)?.categories;return Array.isArray(raw)?/* @__PURE__ */Object.freeze(raw.filter(c=>typeof c=="string")):/* @__PURE__ */Object.freeze([])}function retryAfterOf(error){let raw=details(error)?.retry_after_seconds;return typeof raw=="number"&&Number.isFinite(raw)&&raw>0?raw:null}function messageOf(error){let wire=error.wireMessage;if(typeof wire=="string"&&wire.trim().length>0)return wire.trim();let raw=details(error)?.message;return typeof raw=="string"&&raw.trim().length>0?raw.trim():null}function codeOf(error){let reason=error.reasonCode;if(typeof reason=="string"&&reason.length>0)return reason;let raw=details(error),code=raw?.code??raw?.error_code;return typeof code=="string"&&code.length>0?code:null}function televetBookingRefusal(error){let status=error.httpStatus;if(status===402)/* @__PURE__ */return Object.freeze({kind:"not_entitled"});if(status===429||error.code==="rateLimited"||error.code==="quotaExceeded")/* @__PURE__ */
|
|
@@ -160,8 +162,8 @@ return jsxs(View,{testID:"televet-booking-not-entitled",style:styles2.list,child
|
|
|
160
162
|
/* @__PURE__ */jsxs(View,{testID:"televet-booking-state-blocked",children:[
|
|
161
163
|
/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_BOOKING_COPY.stateBlockedTitle}),
|
|
162
164
|
/* @__PURE__ */jsx(TelevetStateInterestAction,{action:stateInterest,testIDPrefix:"televet-state-interest-state-blocked"})]}):step==="reason"&&triageOpen?/* @__PURE__ */jsx(TelevetEarlyEmergency,{...petName!==void 0?{petName:petName}:{},...primaryVet?{primaryVet:primaryVet}:{},onFindEmergencyVet:onFindEmergencyVet,onContinue:onAcknowledgeEmergency}):null}var warnedNoStateSeam=false;function warnNoStateSeamOnce(){if(!warnedNoStateSeam){warnedNoStateSeam=true;try{globalThis.console?.warn?.("[everfur] The vet booking has no US state for this member, so it cannot list vets. Pass the member's two-letter state as `usState` (on EverfurTelevet, VetVisitButton or EverfurChat as `vetUsState`), or pass `onRequestLocation` so the booking can ask your app to resolve one. The SDK never reads a device location itself.")}catch{}}}function televetClinicianOutcomeApplies(state){return state.noState?true:state.isPending||state.isError?false:state.isEmpty||state.notEntitled}function TelevetClinicianOutcome({state:state,cause:cause,locationStatus:locationStatus,onRequestLocation:onRequestLocation,onRetry:onRetry,stateInterest:stateInterest=null,renderUnavailable:renderUnavailable}){let hostCannotLocate=state.noState&&!onRequestLocation;return useEffect(()=>{hostCannotLocate&&warnNoStateSeamOnce()},[hostCannotLocate]),state.noState?
|
|
163
|
-
/* @__PURE__ */jsx(View,{testID:"televet-booking-location-unknown",children:/* @__PURE__ */jsx(TelevetStateCard,{title:locationStatus==="blocked"?TELEVET_BOOKING_COPY.locationBlockedTitle:locationStatus==="unavailable"?TELEVET_BOOKING_COPY.locationUnavailableTitle:TELEVET_BOOKING_COPY.locationUnknownTitle,message:locationStatus==="blocked"?TELEVET_BOOKING_COPY.locationBlockedBody:locationStatus==="unavailable"?TELEVET_BOOKING_COPY.locationUnavailableBody:onRequestLocation?TELEVET_BOOKING_COPY.locationUnknownBody:void 0,actionLabel:onRequestLocation?locationStatus==="blocked"?TELEVET_BOOKING_COPY.locationBlockedCta:TELEVET_BOOKING_COPY.locationUnknownCta:void 0,onAction:onRequestLocation})}):state.isEmpty?/* @__PURE__ */jsx(TelevetClinicianEmptyState,{cause:cause,onRetry:onRetry,stateInterest:stateInterest}):/* @__PURE__ */jsx(EntitlementPausedState,{...renderUnavailable?{renderUnavailable:renderUnavailable}:{}})}function televetConsultCalendarKey(consultId){return`televet-consult-${consultId}`}function TelevetBookedScreen({consult:consult,petName:petName,onDone:onDone,onAddToCalendar:onAddToCalendar,canJoinInApp:canJoinInApp=false,sharedRecords:sharedRecords=false,sentPhoto:sentPhoto=false}){let theme=useEverfurTheme(),shared=useBookingStyles(),styles2=useMemo(()=>makeStyles2(theme),[theme]),[calendarState,setCalendarState]=useState("idle"),addToCalendar=async()=>{if(!onAddToCalendar)return;setCalendarState("saving");let start=new Date(consult.scheduledAt);if(Number.isNaN(start.getTime())){setCalendarState("failed");return}let outcome=await callHostAsync(onAddToCalendar,{key:televetConsultCalendarKey(consult.consultId),title:TELEVET_BOOKING_COPY.visit.title,startDate:start,endDate:new Date(start.getTime()+CONSULT_MINUTES*6e4),alarmOffsetMinutes:-30});setCalendarState(outcome.ok&&outcome.value===true?"saved":"failed")},vetName=consult.clinicianName?.trim()??"",steps=[TELEVET_BOOKING_COPY.booked.remindPromise,sharedRecords&&vetName.length>0?fill(sentPhoto?TELEVET_BOOKING_COPY.booked.recordsPhotoPromiseTemplate:TELEVET_BOOKING_COPY.booked.recordsPromiseTemplate,{pet:petName??TELEVET_BOOKING_COPY.petFallback,vet:vetName}):fill(TELEVET_BOOKING_COPY.booked.summaryPromise,{pet:petName??""}),...canJoinInApp?[TELEVET_BOOKING_COPY.booked.joinPromise]:[]],settle=useRef(new Animated.Value(theme.motion.reducedMotion?1:0)).current;return useEffect(()=>{theme.motion.reducedMotion||Animated.spring(settle,{toValue:1,damping:14,stiffness:180,mass:1,useNativeDriver:true}).start()},[settle,theme.motion.reducedMotion]),isTelevetBookingCopyReady()?/* @__PURE__ */jsxs(View,{style:styles2.screen,testID:"televet-booked",children:[
|
|
164
|
-
/* @__PURE__ */jsx(Animated.View,{style:[styles2.avatar,{opacity:settle,transform:[{scale:settle.interpolate({inputRange:[0,1],outputRange:[.92,1]})}]}],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsx(Text,{tier:"heading",style:styles2.avatarText,children:vetName.length>0?vetName
|
|
165
|
+
/* @__PURE__ */jsx(View,{testID:"televet-booking-location-unknown",children:/* @__PURE__ */jsx(TelevetStateCard,{title:locationStatus==="blocked"?TELEVET_BOOKING_COPY.locationBlockedTitle:locationStatus==="unavailable"?TELEVET_BOOKING_COPY.locationUnavailableTitle:TELEVET_BOOKING_COPY.locationUnknownTitle,message:locationStatus==="blocked"?TELEVET_BOOKING_COPY.locationBlockedBody:locationStatus==="unavailable"?TELEVET_BOOKING_COPY.locationUnavailableBody:onRequestLocation?TELEVET_BOOKING_COPY.locationUnknownBody:void 0,actionLabel:onRequestLocation?locationStatus==="blocked"?TELEVET_BOOKING_COPY.locationBlockedCta:TELEVET_BOOKING_COPY.locationUnknownCta:void 0,onAction:onRequestLocation})}):state.isEmpty?/* @__PURE__ */jsx(TelevetClinicianEmptyState,{cause:cause,onRetry:onRetry,stateInterest:stateInterest}):/* @__PURE__ */jsx(EntitlementPausedState,{...renderUnavailable?{renderUnavailable:renderUnavailable}:{}})}function clinicianInitial(displayName){return displayName.trim().replace(/^dr\.?\s+/i,"").slice(0,1).toUpperCase()}function televetConsultCalendarKey(consultId){return`televet-consult-${consultId}`}function TelevetBookedScreen({consult:consult,petName:petName,onDone:onDone,onAddToCalendar:onAddToCalendar,canJoinInApp:canJoinInApp=false,sharedRecords:sharedRecords=false,sentPhoto:sentPhoto=false}){let theme=useEverfurTheme(),shared=useBookingStyles(),styles2=useMemo(()=>makeStyles2(theme),[theme]),[calendarState,setCalendarState]=useState("idle"),addToCalendar=async()=>{if(!onAddToCalendar)return;setCalendarState("saving");let start=new Date(consult.scheduledAt);if(Number.isNaN(start.getTime())){setCalendarState("failed");return}let outcome=await callHostAsync(onAddToCalendar,{key:televetConsultCalendarKey(consult.consultId),title:TELEVET_BOOKING_COPY.visit.title,startDate:start,endDate:new Date(start.getTime()+CONSULT_MINUTES*6e4),alarmOffsetMinutes:-30});setCalendarState(outcome.ok&&outcome.value===true?"saved":"failed")},vetName=consult.clinicianName?.trim()??"",steps=[TELEVET_BOOKING_COPY.booked.remindPromise,sharedRecords&&vetName.length>0?fill(sentPhoto?TELEVET_BOOKING_COPY.booked.recordsPhotoPromiseTemplate:TELEVET_BOOKING_COPY.booked.recordsPromiseTemplate,{pet:petName??TELEVET_BOOKING_COPY.petFallback,vet:vetName}):fill(TELEVET_BOOKING_COPY.booked.summaryPromise,{pet:petName??""}),...canJoinInApp?[TELEVET_BOOKING_COPY.booked.joinPromise]:[]],settle=useRef(new Animated.Value(theme.motion.reducedMotion?1:0)).current;return useEffect(()=>{theme.motion.reducedMotion||Animated.spring(settle,{toValue:1,damping:14,stiffness:180,mass:1,useNativeDriver:true}).start()},[settle,theme.motion.reducedMotion]),isTelevetBookingCopyReady()?/* @__PURE__ */jsxs(View,{style:styles2.screen,testID:"televet-booked",children:[
|
|
166
|
+
/* @__PURE__ */jsx(Animated.View,{style:[styles2.avatar,{opacity:settle,transform:[{scale:settle.interpolate({inputRange:[0,1],outputRange:[.92,1]})}]}],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsx(Text,{tier:"heading",style:styles2.avatarText,children:vetName.length>0?clinicianInitial(vetName):""})}),
|
|
165
167
|
/* @__PURE__ */jsx(Text,{tier:"heading",style:styles2.title,accessibilityRole:"header",children:vetName.length>0?fill(TELEVET_BOOKING_COPY.bookedTitleTemplate,{vet:vetName}):TELEVET_BOOKING_COPY.bookedTitle}),
|
|
166
168
|
/* @__PURE__ */jsx(Text,{style:styles2.when,children:petName?fill(TELEVET_BOOKING_COPY.bookedLeadTemplate,{when:formatBookedWhen(consult.scheduledAt),pet:petName}):formatBookedWhen(consult.scheduledAt)}),
|
|
167
169
|
/* @__PURE__ */jsx(View,{style:styles2.steps,accessibilityLabel:TELEVET_BOOKING_COPY.booked.stepsLabel,testID:"televet-booked-steps",children:steps.map((step,i)=>/* @__PURE__ */jsxs(View,{style:[styles2.step,i===steps.length-1?styles2.stepLast:null],children:[
|
|
@@ -176,7 +178,7 @@ return jsxs(View,{style:styles2.wrap,children:[
|
|
|
176
178
|
/* @__PURE__ */jsxs(View,{style:styles2.center,accessibilityRole:"header",accessibilityLabel:`${title??TELEVET_BOOKING_COPY.navTitle}, ${label}`,children:[
|
|
177
179
|
/* @__PURE__ */jsx(Text,{tier:"compact",style:styles2.stepLabel,testID:"televet-booking-progress-label",children:label}),
|
|
178
180
|
/* @__PURE__ */jsx(View,{style:styles2.segments,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:"televet-booking-rail",children:segments.map((name,index)=>/* @__PURE__ */jsx(View,{style:[styles2.segment,index<current?styles2.segmentDone:null]},name))})]}),
|
|
179
|
-
/* @__PURE__ */jsx(Pressable,{onPress:confirmClose,accessibilityRole:"button",accessibilityLabel:TELEVET_BOOKING_COPY.close,accessibilityHint:TELEVET_BOOKING_COPY.chrome.closeHint,testID:"televet-booking-close",style:styles2.ring,children:/* @__PURE__ */jsx(Text,{tier:"control",style:styles2.close,accessibilityElementsHidden:true,importantForAccessibility:"no",children:CLOSE_GLYPH})})]})]})}var CLOSE_GLYPH="×",BACK_LABEL="Back",LOGO_HEIGHT=28,LOGO_MAX_WIDTH=160;function makeStyles3(theme){let{space:space,type:type}=theme,look=televetLook(theme),header=theme.slots.header,ink=header?.textColor??look.ink;return StyleSheet.create({wrap:{...slotBox(insetSlot(header,theme.radius.lg))},logoBar:{alignItems:"center",paddingTop:space.sm},logo:{height:LOGO_HEIGHT,width:LOGO_MAX_WIDTH},bar:{flexDirection:"row",alignItems:"center",gap:space.md,paddingVertical:space.sm,minHeight:60},ring:{width:MIN_TOUCH_TARGET,height:MIN_TOUCH_TARGET,borderRadius:MIN_TOUCH_TARGET/2,borderWidth:1.5,borderColor:look.line,alignItems:"center",justifyContent:"center"},chevron:{width:10,height:10,marginLeft:4,borderLeftWidth:2,borderBottomWidth:2,borderColor:ink,transform:[{rotate:"45deg"}]},close:{...face(theme,"regular"),color:ink,fontSize:24,lineHeight:26},center:{flex:1,alignItems:"center",gap:6},stepLabel:{...face(theme,"monoBold"),color:ink,fontSize:12,lineHeight:16,letterSpacing:1.2,textTransform:"uppercase"},segments:{flexDirection:"row",gap:4,alignSelf:"stretch"},segment:{flex:1,height:4,borderRadius:2,backgroundColor:look.mist},segmentDone:{backgroundColor:look.go},title:{...headingFace(theme,"medium"),color:ink,fontSize:type.size.subtitle}})}function formatTelevetPetMetaLine(pet){let parts=[],breed=pet.breed?.trim();breed&&parts.push(breed);let years=wholeYears(pet.ageYears);years!==null&&parts.push(`${String(years)} year${years===1?"":"s"}`);let weight=pet.weightKg;return typeof weight=="number"&&Number.isFinite(weight)&&weight>0&&parts.push(`${String(Math.round(weight))} kg`),parts.join(" · ")}function wholeYears(ageYears){if(typeof ageYears!="number"||!Number.isFinite(ageYears))return null;let years=Math.floor(ageYears);return years>=0?years:null}function TelevetIntakeMedia({media:media,onChange:onChange,onPickMedia:onPickMedia,meta:meta}){let theme=useEverfurTheme(),styles2=useMemo(()=>makeStyles4(theme),[theme]),remaining=MEDIA_REFS_MAX-media.length,[busy,setBusy]=useState(false);if(!onPickMedia)return null;let pick2=async()=>{if(!(busy||remaining<=0)){setBusy(true);try{let outcome=await callHostAsync(onPickMedia,remaining);if(!outcome.ok||outcome.value===null||outcome.value.length===0)return;let existing=new Set(media.map(m=>m.uri)),fresh2=outcome.value.filter(p=>typeof p?.uri=="string"&&p.uri.length>0&&!existing.has(p.uri));if(fresh2.length===0)return;onChange([...media,...fresh2].slice(0,MEDIA_REFS_MAX))}finally{setBusy(false)}}};/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */jsx(Pressable,{onPress:confirmClose,accessibilityRole:"button",accessibilityLabel:TELEVET_BOOKING_COPY.close,accessibilityHint:TELEVET_BOOKING_COPY.chrome.closeHint,testID:"televet-booking-close",style:styles2.ring,children:/* @__PURE__ */jsx(Text,{tier:"control",style:styles2.close,accessibilityElementsHidden:true,importantForAccessibility:"no",children:CLOSE_GLYPH})})]})]})}var CLOSE_GLYPH="×",BACK_LABEL="Back",LOGO_HEIGHT=28,LOGO_MAX_WIDTH=160;function makeStyles3(theme){let{space:space,type:type}=theme,look=televetLook(theme),header=theme.slots.header,ink=header?.textColor??look.ink;return StyleSheet.create({wrap:{...slotBox(insetSlot(header,theme.radius.lg))},logoBar:{alignItems:"center",paddingTop:space.sm},logo:{height:LOGO_HEIGHT,width:LOGO_MAX_WIDTH},bar:{flexDirection:"row",alignItems:"center",gap:space.md,paddingVertical:space.sm,minHeight:60},ring:{width:MIN_TOUCH_TARGET,height:MIN_TOUCH_TARGET,borderRadius:MIN_TOUCH_TARGET/2,borderWidth:1.5,borderColor:look.line,alignItems:"center",justifyContent:"center"},chevron:{width:10,height:10,marginLeft:4,borderLeftWidth:2,borderBottomWidth:2,borderColor:ink,transform:[{rotate:"45deg"}]},close:{...face(theme,"regular"),color:ink,fontSize:24,lineHeight:26},center:{flex:1,alignItems:"center",gap:6},stepLabel:{...face(theme,"monoBold"),color:ink,fontSize:12,lineHeight:16,letterSpacing:1.2,textTransform:"uppercase"},segments:{flexDirection:"row",gap:4,alignSelf:"stretch"},segment:{flex:1,height:4,borderRadius:2,backgroundColor:look.mist},segmentDone:{backgroundColor:look.go},title:{...headingFace(theme,"medium"),color:ink,fontSize:type.size.subtitle}})}function formatTelevetPetMetaLine(pet){let parts=[],breed=pet.breed?.trim();breed&&parts.push(breed);let years=wholeYears(pet.ageYears);years!==null&&parts.push(`${String(years)} year${years===1?"":"s"}`);let weight=pet.weightKg;return typeof weight=="number"&&Number.isFinite(weight)&&weight>0&&parts.push(`${String(Math.round(weight))} kg`),parts.join(" · ")}function wholeYears(ageYears){if(typeof ageYears!="number"||!Number.isFinite(ageYears))return null;let years=Math.floor(ageYears);return years>=0?years:null}var NO_PROPS=/* @__PURE__ */Object.freeze({}),REMEASURE_INTERVAL_MS=100,REMEASURE_ATTEMPTS=20;function readWindowTops(chatTopInWindow,chatTopInParent,chatHeight,windowHeight){return![chatTopInWindow,chatTopInParent,chatHeight,windowHeight].every(Number.isFinite)||chatTopInWindow+chatHeight>windowHeight+1?null:{chatTop:Math.max(0,chatTopInWindow),parentTop:Math.max(0,chatTopInWindow-chatTopInParent)}}function useChatKeyboardOffset(hostOffset,lifts){let hostGiven=typeof hostOffset=="number",probeRef=useRef(null),[reading,setReading]=useState(null),frame=useRef(null),retry=useRef(null),mounted=useRef(true),stopRetry=useCallback(()=>{retry.current!==null&&clearTimeout(retry.current),retry.current=null},[]);useEffect(()=>(mounted.current=true,()=>{mounted.current=false,stopRetry()}),[stopRetry]);let measure=useCallback(function measureAt(attempt){probeRef.current?.measureInWindow((_x,windowY)=>{let at=frame.current;if(!mounted.current||at===null)return;let next=readWindowTops(windowY,at.y,at.height,Dimensions.get("window").height);if(next!==null){setReading(last=>last!==null&&last.chatTop===next.chatTop&&last.parentTop===next.parentTop?last:next);return}attempt>=REMEASURE_ATTEMPTS||(retry.current=setTimeout(()=>{retry.current=null,measureAt(attempt+1)},REMEASURE_INTERVAL_MS))})},[]),onLayout=useCallback(event=>{let{y:y,height:height}=event.nativeEvent.layout;frame.current={y:y,height:height},stopRetry(),measure(0)},[measure,stopRetry]);return useMemo(()=>{if(!lifts)return{avoidingProps:NO_PROPS,probeRef:null,topInWindow:null};let measured=reading?.parentTop??0;return{avoidingProps:measured>0?{keyboardVerticalOffset:measured,onLayout:onLayout}:{onLayout:onLayout},probeRef:probeRef,topInWindow:reading?.chatTop??null}},[lifts,hostGiven,hostOffset,reading,onLayout])}function KeyboardOffsetProbe({probeRef:probeRef}){return probeRef===null?null:/* @__PURE__ */jsx(View,{ref:probeRef,collapsable:false,pointerEvents:"none",style:PROBE_STYLE})}var PROBE_STYLE=/* @__PURE__ */Object.freeze({position:"absolute",top:0,left:0,width:0,height:0});function TelevetIntakeMedia({media:media,onChange:onChange,onPickMedia:onPickMedia,meta:meta}){let theme=useEverfurTheme(),styles2=useMemo(()=>makeStyles4(theme),[theme]),remaining=MEDIA_REFS_MAX-media.length,[busy,setBusy]=useState(false);if(!onPickMedia)return null;let pick2=async()=>{if(!(busy||remaining<=0)){setBusy(true);try{let outcome=await callHostAsync(onPickMedia,remaining);if(!outcome.ok||outcome.value===null||outcome.value.length===0)return;let existing=new Set(media.map(m=>m.uri)),fresh2=outcome.value.filter(p=>typeof p?.uri=="string"&&p.uri.length>0&&!existing.has(p.uri));if(fresh2.length===0)return;onChange([...media,...fresh2].slice(0,MEDIA_REFS_MAX))}finally{setBusy(false)}}};/* @__PURE__ */
|
|
180
182
|
return jsxs(View,{children:[
|
|
181
183
|
/* @__PURE__ */jsxs(View,{style:styles2.row,children:[media.map((m,i)=>/* @__PURE__ */jsxs(View,{style:styles2.thumb,children:[
|
|
182
184
|
/* @__PURE__ */jsx(Image,{source:{uri:m.uri},style:styles2.thumbImage,resizeMode:"cover"}),m.mimeType?.startsWith("video/")?/* @__PURE__ */jsx(View,{style:styles2.videoBadge,testID:`televet-intake-media-video-${String(i)}`,children:/* @__PURE__ */jsx(Text,{tier:"badge",style:styles2.videoBadgeText,children:VIDEO_GLYPH})}):null,
|
|
@@ -194,7 +196,7 @@ return jsxs(View,{style:styles2.root,testID:testID,children:[Header?/* @__PURE__
|
|
|
194
196
|
/* @__PURE__ */jsx(ScrollView,{style:styles2.gridScroll,contentContainerStyle:styles2.groups,showsVerticalScrollIndicator:false,children:groups(times,periodLabels).map(group=>/* @__PURE__ */jsxs(View,{style:styles2.group,children:[group.label?/* @__PURE__ */jsx(Text,{tier:"compact",style:styles2.period,accessibilityRole:"header",testID:`televet-slot-period-${group.key}`,children:group.label}):null,
|
|
195
197
|
/* @__PURE__ */jsx(View,{style:styles2.grid,children:group.slots.map(slot=>{let index=times.indexOf(slot),busy=busySlotId===slot.slotId,blocked=busySlotId!==null,picked=selectedSlot?.slotId===slot.slotId,chipZone=mixedZones?zones[index]??"":"";/* @__PURE__ */
|
|
196
198
|
return jsxs(Pressable,{onPress:()=>onPick(slot),disabled:blocked,accessibilityRole:"button",accessibilityLabel:[formatClock(slot.startsAt),chipZone].filter(part=>part.length>0).join(" "),accessibilityState:{disabled:blocked,busy:busy,selected:picked},testID:`${rowTestIdPrefix}-${slot.slotId}`,style:({pressed:pressed})=>[styles2.chip,picked?styles2.chipPicked:null,busy?styles2.chipBusy:null,blocked&&!busy?styles2.chipDisabled:null,pressed&&!theme.motion.reducedMotion?styles2.chipPressed:null],children:[
|
|
197
|
-
/* @__PURE__ */jsx(Text,{tier:"compact",style:[styles2.chipLabel,picked?styles2.chipLabelPicked:null,busy?styles2.chipLabelBusy:null],children:formatClock(slot.startsAt)}),chipZone.length>0?/* @__PURE__ */jsx(Text,{tier:"compact",style:[styles2.chipZone,picked?styles2.chipLabelPicked:null,busy?styles2.chipLabelBusy:null],testID:`${rowTestIdPrefix}-${slot.slotId}-zone`,children:chipZone}):null]},slot.slotId)})})]},group.key))})]})}function groups(times,labels){return labels?["morning","afternoon","evening"].map(period=>({key:period,label:labels[period],slots:times.filter(s=>televetDayPeriod(s.startsAt)===period)})).filter(group=>group.slots.length>0):[{key:"all",label:null,slots:times}]}function firstOffered(days,keys){for(let key of keys)if(key!==null&&days.some(day=>day.key===key))return key;return null}function makeStyles6(theme){let{color:color,space:space,radius:radius,type:type}=theme,{size:size,lineHeight:lineHeight}=type,look=televetLook(theme),chip=theme.slots.chip,chipText=slotText(chip);return StyleSheet.create({root:{flex:1,minHeight:0},groups:{gap:space.lg,paddingBottom:space.xl},group:{gap:space.sm},period:{...face(theme,"monoBold"),color:look.muted,fontSize:12,lineHeight:16,letterSpacing:.96,textTransform:"uppercase"},gridScroll:{flex:1},zone:{textAlign:"center",...face(theme,"mono"),color:color.text.muted,fontSize:size.tiny,lineHeight:size.tiny*lineHeight.normal,letterSpacing:.4,paddingVertical:space.md},grid:{flexDirection:"row",flexWrap:"wrap",gap:space.sm},chip:{minWidth:96,flexGrow:1,flexBasis:"
|
|
199
|
+
/* @__PURE__ */jsx(Text,{tier:"compact",style:[styles2.chipLabel,picked?styles2.chipLabelPicked:null,busy?styles2.chipLabelBusy:null],children:formatClock(slot.startsAt)}),chipZone.length>0?/* @__PURE__ */jsx(Text,{tier:"compact",style:[styles2.chipZone,picked?styles2.chipLabelPicked:null,busy?styles2.chipLabelBusy:null],testID:`${rowTestIdPrefix}-${slot.slotId}-zone`,children:chipZone}):null]},slot.slotId)})})]},group.key))})]})}function groups(times,labels){return labels?["morning","afternoon","evening"].map(period=>({key:period,label:labels[period],slots:times.filter(s=>televetDayPeriod(s.startsAt)===period)})).filter(group=>group.slots.length>0):[{key:"all",label:null,slots:times}]}function firstOffered(days,keys){for(let key of keys)if(key!==null&&days.some(day=>day.key===key))return key;return null}function makeStyles6(theme){let{color:color,space:space,radius:radius,type:type}=theme,{size:size,lineHeight:lineHeight}=type,look=televetLook(theme),chip=theme.slots.chip,chipText=slotText(chip);return StyleSheet.create({root:{flex:1,minHeight:0},groups:{gap:space.lg,paddingBottom:space.xl},group:{gap:space.sm},period:{...face(theme,"monoBold"),color:look.muted,fontSize:12,lineHeight:16,letterSpacing:.96,textTransform:"uppercase"},gridScroll:{flex:1},zone:{textAlign:"center",...face(theme,"mono"),color:color.text.muted,fontSize:size.tiny,lineHeight:size.tiny*lineHeight.normal,letterSpacing:.4,paddingVertical:space.md},grid:{flexDirection:"row",flexWrap:"wrap",gap:space.sm},chip:{minWidth:96,flexGrow:1,flexBasis:"auto",minHeight:44,borderRadius:radius.pill,borderWidth:1.5,borderColor:look.line,backgroundColor:look.surface,alignItems:"center",justifyContent:"center",paddingHorizontal:space.md,...slotBox(chip,1.5)},chipPicked:{borderColor:look.ink,backgroundColor:look.pink},chipLabelPicked:{color:look.onPink},chipPressed:{transform:[{scale:.95}]},chipBusy:{backgroundColor:color.primary,borderColor:color.primary},chipDisabled:{opacity:.45},chipLabel:{...face(theme,"bold"),color:look.ink,fontSize:size.bodyTight,lineHeight:size.bodyTight*lineHeight.snug,fontVariant:["tabular-nums"],...chipText},chipLabelBusy:{color:color.onPrimary},chipZone:{...face(theme,"mono"),color:color.text.muted,fontSize:size.tiny,lineHeight:size.tiny*lineHeight.normal,letterSpacing:.4,...chipText}})}function TelevetSummaryRow({label:label,value:value,last:last=false,action:action,testID:testID}){let theme=useEverfurTheme(),styles2=useMemo(()=>makeStyles7(theme),[theme]);/* @__PURE__ */
|
|
198
200
|
return jsxs(View,{style:[styles2.row,last?styles2.rowLast:null],testID:testID,children:[
|
|
199
201
|
/* @__PURE__ */jsx(Text,{style:styles2.rowLabel,children:label}),
|
|
200
202
|
/* @__PURE__ */jsx(Text,{style:styles2.rowValue,children:value}),action??null]})}function TelevetConsentCheckbox({label:label,checked:checked,onToggle:onToggle,testID:testID}){let theme=useEverfurTheme(),styles2=useMemo(()=>makeStyles7(theme),[theme]);/* @__PURE__ */
|
|
@@ -215,11 +217,12 @@ return jsxs(View,{style:styles2.scrollRoot,testID:"televet-booking-review",child
|
|
|
215
217
|
/* @__PURE__ */jsx(TelevetEmergencyExits,{petName:petName,primaryVet:primaryVet,onFindEmergencyVet:onFindEmergencyVet}),
|
|
216
218
|
/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_BOOKING_COPY.emergency.keepBookingCta,kind:"secondary",loading:busy,disabled:busy,onPress:onAcknowledgeEmergency,testID:"televet-review-emergency-ack"})]}):null,failure2==="failed"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.confirmFailed}):null,failure2==="clinician_unavailable"?/* @__PURE__ */jsxs(View,{style:styles2.list,testID:"televet-review-clinician-unavailable",children:[
|
|
217
219
|
/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.confirmFailed}),
|
|
218
|
-
/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_BOOKING_COPY.seeOtherVetsCta,kind:"secondary",onPress:onSeeOtherVets,testID:"televet-review-see-other-vets"})]}):null,failure2==="rate_limited"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.confirmFailed,testID:"televet-review-rate-limited"}):null,failure2==="not_entitled"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]}),emergency?null:/* @__PURE__ */jsx(View,{style:styles2.scrollFooter,children:/* @__PURE__ */jsx(TelevetButton,{label:busy?TELEVET_BOOKING_COPY.confirmBusy:TELEVET_BOOKING_COPY.confirmCta,kind:"primary",loading:busy,disabled:!ready||busy||!!stateCode&&!stateAttested||!!cancellationTerms&&!termsAttested,onPress:onConfirm,testID:"televet-review-confirm"})})]})}var PERSON_GLYPH="○";function nameOf(pets,petId){return petId?pets.find(p=>p.petRef===petId||p.petId===petId)?.name??null:null}function TelevetStepFrame({heading:heading,lead:lead,testID:testID,scrollTestID:scrollTestID,scrollRef:scrollRef,footer:footer,children:children}){let styles2=useBookingStyles(),theme=useEverfurTheme(),local=useMemo(()=>makeLocalStyles(theme),[theme]);/* @__PURE__ */
|
|
219
|
-
return
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_BOOKING_COPY.seeOtherVetsCta,kind:"secondary",onPress:onSeeOtherVets,testID:"televet-review-see-other-vets"})]}):null,failure2==="rate_limited"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.confirmFailed,testID:"televet-review-rate-limited"}):null,failure2==="not_entitled"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]}),emergency?null:/* @__PURE__ */jsx(View,{style:styles2.scrollFooter,children:/* @__PURE__ */jsx(TelevetButton,{label:busy?TELEVET_BOOKING_COPY.confirmBusy:TELEVET_BOOKING_COPY.confirmCta,kind:"primary",loading:busy,disabled:!ready||busy||!!stateCode&&!stateAttested||!!cancellationTerms&&!termsAttested,onPress:onConfirm,testID:"televet-review-confirm"})})]})}var PERSON_GLYPH="○";function nameOf(pets,petId){return petId?pets.find(p=>p.petRef===petId||p.petId===petId)?.name??null:null}function TelevetStepFrame({heading:heading,lead:lead,testID:testID,scrollTestID:scrollTestID,scrollRef:scrollRef,footer:footer,children:children}){let styles2=useBookingStyles(),theme=useEverfurTheme(),local=useMemo(()=>makeLocalStyles(theme),[theme]),ios=Platform.OS==="ios",keyboard=useChatKeyboardOffset(void 0,ios);/* @__PURE__ */
|
|
221
|
+
return jsx(View,{style:styles2.scrollRoot,testID:testID,children:/* @__PURE__ */jsxs(KeyboardAvoidingView,{behavior:ios?"padding":void 0,style:local.avoider,...keyboard.avoidingProps,children:[
|
|
222
|
+
/* @__PURE__ */jsx(KeyboardOffsetProbe,{probeRef:keyboard.probeRef}),
|
|
223
|
+
/* @__PURE__ */jsxs(ScrollView,{...scrollRef?{ref:scrollRef}:{},style:styles2.scrollBody,contentContainerStyle:local.body,keyboardShouldPersistTaps:"handled",keyboardDismissMode:ios?"interactive":"on-drag",showsVerticalScrollIndicator:false,...scrollTestID?{testID:scrollTestID}:{},children:[
|
|
221
224
|
/* @__PURE__ */jsxs(View,{style:local.head,children:[
|
|
222
|
-
/* @__PURE__ */jsx(Text,{tier:"heading",style:styles2.stepTitle,accessibilityRole:"header",children:heading}),lead?/* @__PURE__ */jsx(Text,{style:styles2.stepHelp,children:lead}):null]}),children]}),footer?/* @__PURE__ */jsx(View,{style:styles2.scrollFooter,children:footer}):null]})}function TelevetChoiceRow({title:title,meta:meta,selected:selected,onPress:onPress,testID:testID,leading:leading}){let theme=useEverfurTheme(),local=useMemo(()=>makeLocalStyles(theme),[theme]);/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */jsx(Text,{tier:"heading",style:styles2.stepTitle,accessibilityRole:"header",children:heading}),lead?/* @__PURE__ */jsx(Text,{style:styles2.stepHelp,children:lead}):null]}),children]}),footer?/* @__PURE__ */jsx(View,{style:styles2.scrollFooter,children:footer}):null]})})}function TelevetChoiceRow({title:title,meta:meta,selected:selected,onPress:onPress,testID:testID,leading:leading}){let theme=useEverfurTheme(),local=useMemo(()=>makeLocalStyles(theme),[theme]);/* @__PURE__ */
|
|
223
226
|
return jsxs(Pressable,{onPress:onPress,accessibilityRole:"radio",accessibilityLabel:meta?`${title}, ${meta}`:title,accessibilityState:{checked:selected,selected:selected},testID:testID,style:({pressed:pressed})=>[local.choice,selected?local.choiceSelected:null,pressed&&!theme.motion.reducedMotion?local.pressed:null],children:[leading??/* @__PURE__ */jsx(View,{style:local.radio,children:/* @__PURE__ */jsx(View,{style:[local.radioDot,selected?local.radioDotOn:null]})}),
|
|
224
227
|
/* @__PURE__ */jsxs(View,{style:local.choiceText,children:[
|
|
225
228
|
/* @__PURE__ */jsx(Text,{style:local.choiceTitle,children:title}),meta?/* @__PURE__ */jsx(Text,{tier:"compact",style:local.choiceMeta,children:meta}):null]})]})}function PetStep({pets:pets,isPending:isPending,isError:isError,error:error,onRetry:onRetry,selectedId:selectedId,onSelect:onSelect,onNext:onNext,onAddPet:onAddPet}){let styles2=useBookingStyles(),theme=useEverfurTheme(),local=useMemo(()=>makeLocalStyles(theme),[theme]);return isPending?/* @__PURE__ */jsx(View,{style:styles2.list,testID:"televet-pets-loading",children:[0,1].map(i=>/* @__PURE__ */jsx(TelevetSkeletonBlock,{height:72},i))}):isError?/* @__PURE__ */jsx(View,{testID:"televet-pets-error",children:/* @__PURE__ */jsx(TelevetLoadFailed,{error:error,title:TELEVET_BOOKING_COPY.chrome.loadFailedTitle,actionLabel:TELEVET_BOOKING_COPY.chrome.retryCta,onRetry:onRetry})}):pets.length===0?/* @__PURE__ */jsx(View,{testID:"televet-pets-empty",children:/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_BOOKING_COPY.chrome.noPetsTitle,actionLabel:TELEVET_BOOKING_COPY.addPetCta,onAction:onAddPet})}):/* @__PURE__ */jsxs(TelevetStepFrame,{heading:TELEVET_BOOKING_COPY.petSelectTitle,testID:"televet-booking-pets",footer:onNext?/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_BOOKING_COPY.continueCta,kind:"primary",disabled:!selectedId,onPress:onNext,testID:"televet-pets-next"}):null,children:[
|
|
@@ -228,7 +231,7 @@ return jsx(View,{style:styles2.list,testID:"televet-clinicians-loading",children
|
|
|
228
231
|
return jsx(View,{testID:"televet-clinicians-error",children:/* @__PURE__ */jsx(TelevetLoadFailed,{error:error,title:TELEVET_BOOKING_COPY.chrome.loadFailedTitle,actionLabel:TELEVET_BOOKING_COPY.chrome.retryCta,onRetry:onRetry})});if(clinicians.length===0)/* @__PURE__ */
|
|
229
232
|
return jsx(View,{testID:"televet-clinicians-empty",children:/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_BOOKING_COPY.noCliniciansTitle,message:TELEVET_BOOKING_COPY.noCliniciansBody,actionLabel:TELEVET_BOOKING_COPY.noCliniciansRetryCta,onAction:onRetry})});let vet=clinicians.find(c=>c.clinicianId===selectedId)??clinicians[0];if(vet===void 0)return null;let code=stateCode?.trim().toUpperCase()??"",licensedHere=code.length>0&&vet.licensedStates.some(l=>l.state.trim().toUpperCase()===code);/* @__PURE__ */
|
|
230
233
|
return jsx(TelevetStepFrame,{heading:TELEVET_BOOKING_COPY.yourVetTitle,testID:"televet-clinicians",footer:/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_BOOKING_COPY.continueCta,kind:"primary",onPress:()=>onSelect(vet.clinicianId),testID:`televet-clinician-${vet.clinicianId}`}),children:/* @__PURE__ */jsxs(View,{style:local.meet,children:[
|
|
231
|
-
/* @__PURE__ */jsx(View,{style:local.vetAvatar,children:/* @__PURE__ */jsx(Text,{tier:"heading",style:local.vetAvatarText,children:
|
|
234
|
+
/* @__PURE__ */jsx(View,{style:local.vetAvatar,children:/* @__PURE__ */jsx(Text,{tier:"heading",style:local.vetAvatarText,children:clinicianInitial(vet.displayName)||PERSON_GLYPH})}),
|
|
232
235
|
/* @__PURE__ */jsx(Text,{style:local.vetName,children:vet.credentials?`${vet.displayName}, ${vet.credentials}`:vet.displayName}),licensedHere&&stateName?/* @__PURE__ */jsx(View,{style:local.pill,testID:"televet-vet-licensed",children:/* @__PURE__ */jsx(Text,{tier:"badge",style:local.pillText,children:fill(TELEVET_BOOKING_COPY.licensedPillTemplate,{state:stateName})})}):null,vet.rating!==null&&vet.ratingCount!==null?/* @__PURE__ */jsx(Text,{tier:"compact",style:local.vetRating,testID:"televet-vet-rating",children:`★ ${String(vet.rating)} · ${String(vet.ratingCount)} ${TELEVET_BOOKING_COPY.reviewsLabel}`}):null,vet.bio?/* @__PURE__ */jsx(Text,{style:local.vetBio,testID:"televet-vet-bio",children:vet.bio}):null]})})}function SlotStep({slots:slots,enabled:enabled,isPending:isPending,isError:isError,error:error,busySlotId:busySlotId,failure:failure2,selectedSlot:selectedSlot,nextOpening:nextOpening,onPick:onPick,onRetry:onRetry,onSeeOtherVets:onSeeOtherVets}){let styles2=useBookingStyles();return enabled?isPending?/* @__PURE__ */jsx(View,{style:styles2.list,testID:"televet-slots-loading",children:[0,1,2].map(i=>/* @__PURE__ */jsx(TelevetSkeletonBlock,{height:48},i))}):isError?/* @__PURE__ */jsx(TelevetLoadFailed,{error:error,title:TELEVET_BOOKING_COPY.slotsErrorTitle,actionLabel:TELEVET_BOOKING_COPY.retryCta,onRetry:onRetry,testID:"televet-slots-error"}):slots.length===0?/* @__PURE__ */jsx(View,{testID:"televet-slots-empty",children:/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_BOOKING_COPY.noSlotsTitle,message:nextOpening?fill(TELEVET_BOOKING_COPY.nextOpeningTemplate,{when:formatWhenWithDay(nextOpening.startsAt)}):void 0,actionLabel:nextOpening?TELEVET_BOOKING_COPY.seeOtherVetsCta:void 0,onAction:nextOpening?onSeeOtherVets:void 0})}):
|
|
233
236
|
/* @__PURE__ */jsxs(View,{style:styles2.stepFillBox,testID:"televet-slots",children:[
|
|
234
237
|
/* @__PURE__ */jsx(Text,{tier:"heading",style:styles2.stepTitle,accessibilityRole:"header",children:TELEVET_BOOKING_COPY.timeHeading}),failure2==="expired"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.holdExpired}):null,failure2==="taken"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.slotTaken}):null,failure2==="failed"||failure2==="rate_limited"?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.confirmFailed,testID:"televet-slots-hold-failed"}):null,
|
|
@@ -237,7 +240,7 @@ return jsxs(TelevetStepFrame,{heading:heading,lead:TELEVET_BOOKING_COPY.describe
|
|
|
237
240
|
/* @__PURE__ */jsxs(View,{style:local.field,children:[
|
|
238
241
|
/* @__PURE__ */jsx(Text,{tier:"compact",style:local.fieldLabel,children:TELEVET_BOOKING_COPY.describeFieldLabel}),
|
|
239
242
|
/* @__PURE__ */jsx(TextInput,{value:value,onChangeText:onChange,multiline:true,accessibilityLabel:TELEVET_BOOKING_COPY.describeFieldLabel,placeholder:TELEVET_BOOKING_COPY.reasonPlaceholder,placeholderTextColor:theme.color.text.placeholder,style:local.reasonInput,testID:"televet-reason-input"})]}),(composed??value).trim().length>REASON_TEXT_MAX?/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_BOOKING_COPY.reasonTooLong}):null,
|
|
240
|
-
/* @__PURE__ */jsx(TelevetIntakeMedia,{media:media,onChange:onChangeMedia,meta:mediaLive?TELEVET_BOOKING_COPY.addPhotoMeta:null,...onPickMedia?{onPickMedia:onPickMedia}:{}})]})}function makeLocalStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme,{size:size,lineHeight:lineHeight}=type,look=televetLook(theme),card=theme.slots.card,cardText=slotText(card);return StyleSheet.create({marker:{minHeight:1},spacer:{height:space.md},body:{gap:space.xl,paddingBottom:space.xl},head:{gap:space.sm},pressed:{transform:[{scale:.98}]},choices:{gap:space.md},choice:{flexDirection:"row",alignItems:"center",gap:space.lg,minHeight:64,paddingVertical:space.lg,paddingHorizontal:18,borderRadius:radius.lg,borderWidth:1.5,borderColor:look.line,backgroundColor:look.surface,...slotBox(card,1.5)},choiceSelected:{borderColor:look.ink,backgroundColor:look.pinkSoft},radio:{width:22,height:22,borderRadius:11,borderWidth:1.5,borderColor:look.ink,alignItems:"center",justifyContent:"center"},radioDot:{width:10,height:10,borderRadius:5,backgroundColor:"transparent"},radioDotOn:{backgroundColor:look.ink},choiceText:{flex:1,gap:2},choiceTitle:{...face(theme,"bold"),color:look.ink,fontSize:size.body,lineHeight:size.body*lineHeight.snug},choiceMeta:{...face(theme,"regular"),color:look.muted,fontSize:size.caption,lineHeight:size.caption*lineHeight.normal},petDisc:{width:48,height:48,borderRadius:24,backgroundColor:look.mist,alignItems:"center",justifyContent:"center"},petDiscGlyph:{...face(theme,"medium"),color:look.ink,fontSize:size.subtitle,lineHeight:size.subtitle},meet:{alignItems:"center",gap:6,paddingVertical:space.xxl,paddingHorizontal:space.xl,borderRadius:radius.lg,borderWidth:1,borderColor:look.line,...slotBox(card,1)},vetAvatar:{width:104,height:104,borderRadius:52,borderWidth:4,borderColor:look.go,backgroundColor:look.mist,alignItems:"center",justifyContent:"center",marginBottom:space.sm},vetAvatarText:{...face(theme,"medium"),color:look.ink,fontSize:36,lineHeight:40},vetName:{...headingFace(theme,"medium"),color:look.ink,fontSize:size.heading,lineHeight:size.heading*lineHeight.snug,textAlign:"center",...cardText},pill:{height:24,paddingHorizontal:10,borderRadius:radius.pill,borderWidth:1.5,borderColor:look.line,justifyContent:"center",marginVertical:space.xs},pillText:{...face(theme,"monoBold"),color:look.muted,fontSize:11,letterSpacing:.9,textTransform:"uppercase"},vetRating:{...face(theme,"regular"),color:look.muted,fontSize:size.caption,lineHeight:size.caption*lineHeight.normal,...cardText},vetBio:{...face(theme,"regular"),color:look.text,fontSize:size.bodyTight,lineHeight:size.bodyTight*lineHeight.relaxed,textAlign:"center",...cardText},field:{gap:space.sm},fieldLabel:{...face(theme,"bold"),color:look.ink,fontSize:size.bodyTight,lineHeight:size.bodyTight*lineHeight.snug},reasonInput:{minHeight:140,textAlignVertical:"top",borderWidth:1.5,borderColor:look.line,borderRadius:radius.lg,paddingVertical:space.lg,paddingHorizontal:18,backgroundColor:look.surface,...face(theme,"regular"),color:color.text.primary,fontSize:size.body,lineHeight:size.body*lineHeight.relaxed,...slotBox(theme.slots.input,1.5),...slotText(theme.slots.input)},emergencyBanner:{gap:space.md,padding:18,borderRadius:radius.lg,borderWidth:1.5,borderColor:look.alert,backgroundColor:look.alertWash},emergencyTitle:{...face(theme,"bold"),color:color.errorRed,fontSize:size.subtitle,lineHeight:size.subtitle*lineHeight.snug},emergencyLede:{...face(theme,"regular"),color:look.text,fontSize:size.body,lineHeight:size.body*lineHeight.relaxed}})}function TelevetLoadFailed({error:error,title:title,actionLabel:actionLabel,onRetry:onRetry,testID:testID}){let wait=useRateLimitWait(error),test=testID===void 0?{}:{testID:testID};return wait.rateLimited?/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_RATE_LIMITED_COPY.title,message:TELEVET_RATE_LIMITED_COPY.body,...wait.waiting?{}:{actionLabel:actionLabel,onAction:onRetry},testID:testID===void 0?"televet-rate-limited":`${testID}-rate-limited`}):/* @__PURE__ */jsx(TelevetStateCard,{title:title,actionLabel:actionLabel,onAction:onRetry,...test})}function TelevetVisitSimulator({petId:petId,roster:roster,onAddPet:onAddPet,onPickPet:onPickPet}){return petId===null?/* @__PURE__ */jsx(PetStep,{pets:roster.pets,isPending:roster.loading,isError:roster.error!==null,onRetry:()=>{roster.refresh()},onAddPet:onAddPet,selectedId:null,onSelect:onPickPet}):/* @__PURE__ */jsx(SimulatorScreen,{petRef:petId})}function SimulatorScreen({petRef:petRef}){let styles2=useBookingStyles(),sim=useTelevetVisitSimulator(petRef);/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */jsx(TelevetIntakeMedia,{media:media,onChange:onChangeMedia,meta:mediaLive?TELEVET_BOOKING_COPY.addPhotoMeta:null,...onPickMedia?{onPickMedia:onPickMedia}:{}})]})}function makeLocalStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme,{size:size,lineHeight:lineHeight}=type,look=televetLook(theme),card=theme.slots.card,cardText=slotText(card);return StyleSheet.create({marker:{minHeight:1},spacer:{height:space.md},body:{gap:space.xl,paddingBottom:space.xl},avoider:{flex:1,minHeight:0},head:{gap:space.sm},pressed:{transform:[{scale:.98}]},choices:{gap:space.md},choice:{flexDirection:"row",alignItems:"center",gap:space.lg,minHeight:64,paddingVertical:space.lg,paddingHorizontal:18,borderRadius:radius.lg,borderWidth:1.5,borderColor:look.line,backgroundColor:look.surface,...slotBox(card,1.5)},choiceSelected:{borderColor:look.ink,backgroundColor:look.pinkSoft},radio:{width:22,height:22,borderRadius:11,borderWidth:1.5,borderColor:look.ink,alignItems:"center",justifyContent:"center"},radioDot:{width:10,height:10,borderRadius:5,backgroundColor:"transparent"},radioDotOn:{backgroundColor:look.ink},choiceText:{flex:1,gap:2},choiceTitle:{...face(theme,"bold"),color:look.ink,fontSize:size.body,lineHeight:size.body*lineHeight.snug},choiceMeta:{...face(theme,"regular"),color:look.muted,fontSize:size.caption,lineHeight:size.caption*lineHeight.normal},petDisc:{width:48,height:48,borderRadius:24,backgroundColor:look.mist,alignItems:"center",justifyContent:"center"},petDiscGlyph:{...face(theme,"medium"),color:look.ink,fontSize:size.subtitle,lineHeight:size.subtitle},meet:{alignItems:"center",gap:6,paddingVertical:space.xxl,paddingHorizontal:space.xl,borderRadius:radius.lg,borderWidth:1,borderColor:look.line,...slotBox(card,1)},vetAvatar:{width:104,height:104,borderRadius:52,borderWidth:4,borderColor:look.go,backgroundColor:look.mist,alignItems:"center",justifyContent:"center",marginBottom:space.sm},vetAvatarText:{...face(theme,"medium"),color:look.ink,fontSize:36,lineHeight:40},vetName:{...headingFace(theme,"medium"),color:look.ink,fontSize:size.heading,lineHeight:size.heading*lineHeight.snug,textAlign:"center",...cardText},pill:{height:24,paddingHorizontal:10,borderRadius:radius.pill,borderWidth:1.5,borderColor:look.line,justifyContent:"center",marginVertical:space.xs},pillText:{...face(theme,"monoBold"),color:look.muted,fontSize:11,letterSpacing:.9,textTransform:"uppercase"},vetRating:{...face(theme,"regular"),color:look.muted,fontSize:size.caption,lineHeight:size.caption*lineHeight.normal,...cardText},vetBio:{...face(theme,"regular"),color:look.text,fontSize:size.bodyTight,lineHeight:size.bodyTight*lineHeight.relaxed,textAlign:"center",...cardText},field:{gap:space.sm},fieldLabel:{...face(theme,"bold"),color:look.ink,fontSize:size.bodyTight,lineHeight:size.bodyTight*lineHeight.snug},reasonInput:{minHeight:140,textAlignVertical:"top",borderWidth:1.5,borderColor:look.line,borderRadius:radius.lg,paddingVertical:space.lg,paddingHorizontal:18,backgroundColor:look.surface,...face(theme,"regular"),color:color.text.primary,fontSize:size.body,lineHeight:size.body*lineHeight.relaxed,...slotBox(theme.slots.input,1.5),...slotText(theme.slots.input)},emergencyBanner:{gap:space.md,padding:18,borderRadius:radius.lg,borderWidth:1.5,borderColor:look.alert,backgroundColor:look.alertWash},emergencyTitle:{...face(theme,"bold"),color:color.errorRed,fontSize:size.subtitle,lineHeight:size.subtitle*lineHeight.snug},emergencyLede:{...face(theme,"regular"),color:look.text,fontSize:size.body,lineHeight:size.body*lineHeight.relaxed}})}function TelevetLoadFailed({error:error,title:title,actionLabel:actionLabel,onRetry:onRetry,testID:testID}){let wait=useRateLimitWait(error),test=testID===void 0?{}:{testID:testID};return wait.rateLimited?/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_RATE_LIMITED_COPY.title,message:TELEVET_RATE_LIMITED_COPY.body,...wait.waiting?{}:{actionLabel:actionLabel,onAction:onRetry},testID:testID===void 0?"televet-rate-limited":`${testID}-rate-limited`}):/* @__PURE__ */jsx(TelevetStateCard,{title:title,actionLabel:actionLabel,onAction:onRetry,...test})}function TelevetVisitSimulator({petId:petId,roster:roster,onAddPet:onAddPet,onPickPet:onPickPet}){return petId===null?/* @__PURE__ */jsx(PetStep,{pets:roster.pets,isPending:roster.loading,isError:roster.error!==null,onRetry:()=>{roster.refresh()},onAddPet:onAddPet,selectedId:null,onSelect:onPickPet}):/* @__PURE__ */jsx(SimulatorScreen,{petRef:petId})}function SimulatorScreen({petRef:petRef}){let styles2=useBookingStyles(),sim=useTelevetVisitSimulator(petRef);/* @__PURE__ */
|
|
241
244
|
return jsx(View,{style:styles2.stepFill,testID:"televet-simulator",children:/* @__PURE__ */jsxs(ScrollView,{contentContainerStyle:styles2.list,children:[
|
|
242
245
|
/* @__PURE__ */jsx(TelevetStateCard,{title:TELEVET_SIMULATOR_COPY.title}),
|
|
243
246
|
/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_SIMULATOR_COPY.create,onPress:sim.create,kind:"secondary",disabled:sim.busy,testID:"televet-simulator-create"}),sim.visitLine!==null?/* @__PURE__ */jsxs(Fragment,{children:[
|
|
@@ -348,17 +351,19 @@ return jsxs(View,{style:[styles2.screen,style],testID:"televet-visits",children:
|
|
|
348
351
|
return jsxs(View,{style:styles2.bookCard,testID:"televet-visits-book-card",children:[
|
|
349
352
|
/* @__PURE__ */jsx(Text,{style:styles2.bookTitle,children:title}),
|
|
350
353
|
/* @__PURE__ */jsx(Text,{style:styles2.bookSubtitle,children:TELEVET_VISITS_COPY_NATIVE.bookCardSubtitle}),
|
|
351
|
-
/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_VISITS_COPY_NATIVE.bookCta,kind:"primary",onPress:onBook,testID:"televet-visits-book"})]})}var LOAD_OLDER_WITHIN=48;function TelevetVetThreadScreen({petRef:petRef,petName:petName,vetName:vetName,ownerCanStart:ownerCanStart,controller:injected,onBack:onBack,style:style}){let visit=useVisitStyles(),styles2=useVetThreadStyles(),controller=useTelevetBookingController(injected),thread=useVetThread(controller,petRef,{ownerCanStart:ownerCanStart}),[draft,setDraft]=useState(""),scrollRef=useRef(null),named=vetName?.trim()||newestVetName(thread.messages),vet=vetNameOr(named),newest=thread.messages[thread.messages.length-1]?.messageId;useEffect(()=>{thread.status==="ready"&&scrollRef.current?.scrollToEnd?.({animated:false})},[thread.status,newest]);let submit=()=>{let words=draft;words.trim().length===0||thread.sending||thread.send(words).then(landed=>{landed&&setDraft("")})},canSend=draft.trim().length>0&&!thread.sending;/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */jsx(TelevetButton,{label:TELEVET_VISITS_COPY_NATIVE.bookCta,kind:"primary",onPress:onBook,testID:"televet-visits-book"})]})}var LOAD_OLDER_WITHIN=48,AVOIDER=/* @__PURE__ */Object.freeze({flex:1,minHeight:0});function TelevetVetThreadScreen({petRef:petRef,petName:petName,vetName:vetName,ownerCanStart:ownerCanStart,controller:injected,onBack:onBack,style:style}){let visit=useVisitStyles(),styles2=useVetThreadStyles(),controller=useTelevetBookingController(injected),thread=useVetThread(controller,petRef,{ownerCanStart:ownerCanStart}),[draft,setDraft]=useState(""),scrollRef=useRef(null),ios=Platform.OS==="ios",keyboard=useChatKeyboardOffset(void 0,ios),named=vetName?.trim()||newestVetName(thread.messages),vet=vetNameOr(named),newest=thread.messages[thread.messages.length-1]?.messageId;useEffect(()=>{thread.status==="ready"&&scrollRef.current?.scrollToEnd?.({animated:false})},[thread.status,newest]);let submit=()=>{let words=draft;words.trim().length===0||thread.sending||thread.send(words).then(landed=>{landed&&setDraft("")})},canSend=draft.trim().length>0&&!thread.sending;/* @__PURE__ */
|
|
352
355
|
return jsxs(View,{style:[visit.screen,style],testID:"televet-vet-thread",children:[
|
|
353
356
|
/* @__PURE__ */jsx(TelevetVisitBackRow,{onBack:onBack,testID:"televet-vet-thread-back"}),
|
|
354
357
|
/* @__PURE__ */jsxs(View,{style:styles2.head,children:[
|
|
355
|
-
/* @__PURE__ */jsx(Text,{style:styles2.screenTitle,accessibilityRole:"header",children:sentenceCase(petNameOr(petName))}),named?/* @__PURE__ */jsx(Text,{style:styles2.meta,children:fillVetCopy(VET_MESSAGES_COPY.threadMetaTemplateNative,{vet:named})}):null]}),
|
|
358
|
+
/* @__PURE__ */jsx(Text,{style:styles2.screenTitle,accessibilityRole:"header",children:sentenceCase(petNameOr(petName))}),named?/* @__PURE__ */jsx(Text,{style:styles2.meta,children:fillVetCopy(VET_MESSAGES_COPY.threadMetaTemplateNative,{vet:named})}):null]}),
|
|
359
|
+
/* @__PURE__ */jsxs(KeyboardAvoidingView,{behavior:ios?"padding":void 0,style:AVOIDER,...keyboard.avoidingProps,children:[
|
|
360
|
+
/* @__PURE__ */jsx(KeyboardOffsetProbe,{probeRef:keyboard.probeRef}),thread.status==="loading"?/* @__PURE__ */jsxs(View,{style:visit.stack,testID:"televet-vet-thread-loading",accessibilityLabel:VET_MESSAGES_COPY.loading,children:[
|
|
356
361
|
/* @__PURE__ */jsx(TelevetSkeletonBlock,{height:56}),
|
|
357
|
-
/* @__PURE__ */jsx(TelevetSkeletonBlock,{height:56})]}):thread.status==="error"?/* @__PURE__ */jsx(TelevetStateCard,{title:VET_MESSAGES_COPY.loadFailed,actionLabel:VET_MESSAGES_COPY.retry,onAction:thread.retry,testID:"televet-vet-thread-error"}):/* @__PURE__ */jsxs(ScrollView,{ref:scrollRef,accessibilityLabel:fillVetCopy(VET_MESSAGES_COPY.threadLogTemplate,{vet:vet}),contentContainerStyle:styles2.log,scrollEventThrottle:64,onScroll:event=>{event.nativeEvent.contentOffset.y<=LOAD_OLDER_WITHIN&&thread.loadOlder()},testID:"televet-vet-thread-log",children:[thread.messages.length===0?/* @__PURE__ */jsx(Text,{style:styles2.system,children:VET_MESSAGES_COPY.empty}):null,thread.messages.map((message,index)=>/* @__PURE__ */jsx(ThreadItem,{message:message,previous:thread.messages[index-1],vet:vet,styles:styles2},message.messageId))]}),thread.status==="ready"&&thread.canWrite?/* @__PURE__ */jsxs(View,{style:visit.stack,children:[
|
|
362
|
+
/* @__PURE__ */jsx(TelevetSkeletonBlock,{height:56})]}):thread.status==="error"?/* @__PURE__ */jsx(TelevetStateCard,{title:VET_MESSAGES_COPY.loadFailed,actionLabel:VET_MESSAGES_COPY.retry,onAction:thread.retry,testID:"televet-vet-thread-error"}):/* @__PURE__ */jsxs(ScrollView,{ref:scrollRef,accessibilityLabel:fillVetCopy(VET_MESSAGES_COPY.threadLogTemplate,{vet:vet}),contentContainerStyle:styles2.log,scrollEventThrottle:64,keyboardShouldPersistTaps:"handled",keyboardDismissMode:ios?"interactive":"on-drag",onScroll:event=>{event.nativeEvent.contentOffset.y<=LOAD_OLDER_WITHIN&&thread.loadOlder()},testID:"televet-vet-thread-log",children:[thread.messages.length===0?/* @__PURE__ */jsx(Text,{style:styles2.system,children:VET_MESSAGES_COPY.empty}):null,thread.messages.map((message,index)=>/* @__PURE__ */jsx(ThreadItem,{message:message,previous:thread.messages[index-1],vet:vet,styles:styles2},message.messageId))]}),thread.status==="ready"&&thread.canWrite?/* @__PURE__ */jsxs(View,{style:visit.stack,children:[
|
|
358
363
|
/* @__PURE__ */jsxs(View,{style:styles2.composer,children:[
|
|
359
364
|
/* @__PURE__ */jsx(TextInput,{value:draft,onChangeText:setDraft,multiline:true,accessibilityLabel:sentenceCase(fillVetCopy(VET_MESSAGES_COPY.composerLabelTemplateNative,{vet:vet})),placeholder:fillVetCopy(VET_MESSAGES_COPY.composerPlaceholderTemplate,{vet:vet}),style:styles2.field,testID:"televet-vet-thread-field"}),
|
|
360
365
|
/* @__PURE__ */jsx(Pressable,{onPress:submit,disabled:!canSend,accessibilityRole:"button",accessibilityLabel:VET_MESSAGES_COPY.send,accessibilityState:{disabled:!canSend,busy:thread.sending},style:[styles2.send,canSend?null:styles2.sendDisabled],testID:"televet-vet-thread-send",children:/* @__PURE__ */jsx(Text,{tier:"control",style:styles2.sendLabel,children:VET_MESSAGES_COPY.send})})]}),thread.sendFailure==="notSent"?/* @__PURE__ */jsx(Text,{style:styles2.failure,accessibilityLiveRegion:"assertive",testID:"televet-vet-thread-failure",children:VET_MESSAGES_COPY.notSent}):thread.sentCount>0?/* @__PURE__ */jsx(Text,{style:styles2.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-status",children:VET_MESSAGES_COPY.sent}):null,
|
|
361
|
-
/* @__PURE__ */jsx(Text,{style:styles2.note,children:sentenceCase(fillVetCopy(VET_MESSAGES_COPY.composerNoteTemplate,{vet:vet}))})]}):null,thread.sendFailure==="vetWritesFirst"?/* @__PURE__ */jsx(Text,{style:styles2.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-vet-first",children:VET_MESSAGES_COPY.vetWritesFirst}):null]})}function ThreadItem({message:message,previous:previous,vet:vet,styles:styles2}){let day=formatDayLong(message.createdAt),newDay=previous===void 0||formatDayLong(previous.createdAt)!==day,attachments=message.attachmentCount>0?fillVetCopy(VET_MESSAGES_COPY.attachmentsTemplate,{n:String(message.attachmentCount)}):null;/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */jsx(Text,{style:styles2.note,children:sentenceCase(fillVetCopy(VET_MESSAGES_COPY.composerNoteTemplate,{vet:vet}))})]}):null,thread.sendFailure==="vetWritesFirst"?/* @__PURE__ */jsx(Text,{style:styles2.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-vet-first",children:VET_MESSAGES_COPY.vetWritesFirst}):null]})]})}function ThreadItem({message:message,previous:previous,vet:vet,styles:styles2}){let day=formatDayLong(message.createdAt),newDay=previous===void 0||formatDayLong(previous.createdAt)!==day,attachments=message.attachmentCount>0?fillVetCopy(VET_MESSAGES_COPY.attachmentsTemplate,{n:String(message.attachmentCount)}):null;/* @__PURE__ */
|
|
362
367
|
return jsxs(Fragment,{children:[newDay?/* @__PURE__ */jsx(Text,{style:styles2.day,children:day}):null,message.role==="system"?/* @__PURE__ */jsx(Text,{style:styles2.system,children:message.content}):/* @__PURE__ */jsxs(View,{style:[styles2.item,message.role==="owner"?styles2.itemMine:null],testID:`televet-vet-thread-message-${message.messageId}`,children:[message.role==="vet"?/* @__PURE__ */jsxs(View,{style:styles2.whoRow,children:[
|
|
363
368
|
/* @__PURE__ */jsx(Text,{style:styles2.who,children:message.senderName??sentenceCase(vet)}),
|
|
364
369
|
/* @__PURE__ */jsx(Text,{style:styles2.time,children:formatClock(message.createdAt)})]}):null,message.content.length>0?/* @__PURE__ */jsx(Text,{style:message.role==="owner"?styles2.bubbleMine:styles2.bubbleVet,children:message.content}):null,attachments?/* @__PURE__ */jsx(Text,{style:styles2.attachments,children:attachments}):null]})]})}function newestVetName(messages){for(let i=messages.length-1;i>=0;i-=1){let name=messages[i]?.role==="vet"?messages[i]?.senderName:null;if(name)return name}return null}function TelevetVisitSummaryScreen({consult:consult,controller:injected,onBack:onBack,onMessageVet:onMessageVet,onBook:onBook,style:style}){let visit=useVisitStyles(),styles2=useVetThreadStyles(),controller=useTelevetBookingController(injected),read=useVisitSummary(controller,consult.consultId),{pets:pets}=useEverfurPets(),petName=nameOf(pets,consult.petId),summary=read.summary,named=summary?.approvedByName??consult.clinicianName,vet=vetNameOr(named),title=petName&&consult.clinicianName?fillVetCopy(TELEVET_VISITS_COPY_NATIVE.visitTitleTemplate,{pet:petName,vet:consult.clinicianName}):sentenceCase(petNameOr(petName)),meta=[formatDate(consult.scheduledAt),named].filter(Boolean).join(" · "),threadPetRef=vetThreadPetRef(pets,consult.petId),messageVet=onMessageVet&&threadPetRef!==null?()=>onMessageVet({petRef:threadPetRef,petName:petName,vetName:named??null}):void 0;/* @__PURE__ */
|