@everfur/sdk 0.9.0 → 0.9.2
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 +94 -0
- package/README.md +1 -1
- package/dist/{Chat-Cb3Y8VwS.d.cts → Chat-B7oN62ww.d.cts} +3 -3
- package/dist/{Chat-ClhB_8sp.d.ts → Chat-Cugs9Dsl.d.ts} +3 -3
- package/dist/{DepthViews-DDiPxyzg.d.cts → DepthViews-C6qFJ3fV.d.ts} +1 -1
- package/dist/{DepthViews-CSCS-tZg.d.ts → DepthViews-CUNmy99u.d.cts} +1 -1
- package/dist/{DepthViews-CW1z8pnl.d.cts → DepthViews-CiYBIBEZ.d.ts} +1 -1
- package/dist/{DepthViews-BSkuUGBB.d.ts → DepthViews-GxV7wSzT.d.cts} +1 -1
- package/dist/{ErrorPolicyPort-NFDPe-5w.d.cts → ErrorPolicyPort-10s3HJCt.d.cts} +1 -1
- package/dist/{ErrorPolicyPort-DwSnmGcX.d.ts → ErrorPolicyPort-C3nNSS_j.d.ts} +1 -1
- package/dist/{EverfurError-pEXDbUJ1.d.cts → EverfurError-DeBqRpQV.d.cts} +1 -1
- package/dist/{EverfurError-pEXDbUJ1.d.ts → EverfurError-DeBqRpQV.d.ts} +1 -1
- package/dist/{EverfurResult-dtl8ERAw.d.cts → EverfurResult-COlXj1wq.d.cts} +1 -1
- package/dist/{EverfurResult-sKkoXew0.d.ts → EverfurResult-ClPTS0P2.d.ts} +1 -1
- package/dist/{IntakeMedia-BFZfBLjB.d.cts → IntakeMedia-B-_vA9ZB.d.cts} +2 -1
- package/dist/{IntakeMedia-C8GlN_GK.d.ts → IntakeMedia-CIoTXAWs.d.ts} +2 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +6 -6
- package/dist/animations/index.d.ts +6 -6
- package/dist/animations/index.js +1 -1
- package/dist/{attachments-DAUy3vPR.d.ts → attachments-20X7Vuip.d.ts} +3 -3
- package/dist/{attachments-BD70jZZL.d.cts → attachments-CkaPnIUw.d.cts} +3 -3
- package/dist/{attachments-CC7aHpwZ.d.ts → attachments-DN2cNGwe.d.ts} +7 -7
- package/dist/{attachments-DaOaIBNf.d.cts → attachments-HXFmzk-D.d.cts} +7 -7
- package/dist/{bookingCopy-CUW9Gdzc.d.ts → bookingCopy-B5igVNE0.d.ts} +7 -6
- package/dist/{bookingCopy-oEjqkiNA.d.cts → bookingCopy-pJpizqgz.d.cts} +7 -6
- package/dist/{branding-ctD0B2Th.d.cts → branding-BCfwLj0h.d.cts} +1 -1
- package/dist/{branding-aGleD_ki.d.ts → branding-DJf4h12Q.d.ts} +1 -1
- package/dist/{callCopy-DHjem0R-.d.cts → callCopy-Bw6oZT54.d.cts} +7 -2
- package/dist/{callCopy-DHjem0R-.d.ts → callCopy-Bw6oZT54.d.ts} +7 -2
- package/dist/{callRoom-B1qq_D-4.d.ts → callRoom-B92eH_ij.d.ts} +1 -1
- package/dist/{callRoom-DfZTWFXh.d.cts → callRoom-BhIdadyV.d.cts} +1 -1
- package/dist/{casesRepository-Bzs7aw4t.d.cts → casesRepository-DFoK5N1O.d.cts} +2 -2
- package/dist/{casesRepository-CywqL6mj.d.ts → casesRepository-qAkKKgji.d.ts} +2 -2
- package/dist/chat/index.cjs +9 -9
- package/dist/chat/index.d.cts +12 -12
- package/dist/chat/index.d.ts +12 -12
- package/dist/chat/index.js +9 -9
- package/dist/client/index.cjs +4 -4
- package/dist/client/index.d.cts +14 -14
- package/dist/client/index.d.ts +14 -14
- package/dist/client/index.js +4 -4
- package/dist/{config-BysLVhku.d.ts → config-BB7e52FP.d.ts} +3 -3
- package/dist/{config-EZzEyS-c.d.cts → config-u6rK4mKt.d.cts} +3 -3
- package/dist/consent/index.cjs +2 -2
- package/dist/consent/index.d.cts +9 -9
- package/dist/consent/index.d.ts +9 -9
- package/dist/consent/index.js +2 -2
- package/dist/{context-DUwYArkM.d.cts → context-BZ1k4qE3.d.cts} +9 -9
- package/dist/{context-DpfgbnOU.d.ts → context-CJYmubjx.d.ts} +9 -9
- package/dist/{copy-LxZGnFXJ.d.ts → copy-CtfctY-J.d.ts} +5 -5
- package/dist/{copy-DK4r9oGz.d.cts → copy-DCO_lUXd.d.cts} +5 -5
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.d.cts +19 -19
- package/dist/core/index.d.ts +19 -19
- package/dist/core/index.js +4 -4
- package/dist/{depth-DAd77kRe.d.cts → depth-C_ym3qyi.d.cts} +6 -6
- package/dist/{depth-Mk7quUNa.d.ts → depth-_vMRMm4x.d.ts} +6 -6
- package/dist/{entitlementRepository-Dra_4FU_.d.cts → entitlementRepository-DA04yM54.d.cts} +4 -4
- package/dist/{entitlementRepository-CrD0O7VR.d.ts → entitlementRepository-tSY9WWad.d.ts} +4 -4
- package/dist/{identity-75whJXyP.d.cts → identity-CUynm8S2.d.cts} +2 -2
- package/dist/{identity-BiyMDMrR.d.ts → identity-D5uywCtp.d.ts} +2 -2
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +14 -14
- package/dist/{models-DzvqEjMm.d.cts → models-A4A5S7AG.d.cts} +1 -1
- package/dist/{models-CrbUwbuS.d.ts → models-CnXY5LuO.d.ts} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.d.cts +5 -5
- package/dist/notifications/index.d.ts +5 -5
- package/dist/notifications/index.js +1 -1
- package/dist/{pets-DoXxTw4x.d.cts → pets-BrdkpNJH.d.cts} +2 -2
- package/dist/{pets-W2BuLYko.d.ts → pets-mnbN0kZG.d.ts} +2 -2
- package/dist/{petsRepository-yyoo0k2I.d.cts → petsRepository-CQgzEFyz.d.cts} +2 -2
- package/dist/{petsRepository-ByMzq1Z9.d.ts → petsRepository-RGI_xPK1.d.ts} +2 -2
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.d.cts +3 -3
- package/dist/photo/index.d.ts +3 -3
- package/dist/photo/index.js +1 -1
- package/dist/{ports-zYl8S_lI.d.ts → ports-Cu_Wc5Aw.d.ts} +7 -7
- package/dist/{ports-BeVJYP0_.d.cts → ports-DibY-h60.d.cts} +7 -7
- package/dist/records/depth/index.cjs +7 -5
- package/dist/records/depth/index.d.cts +11 -11
- package/dist/records/depth/index.d.ts +11 -11
- package/dist/records/depth/index.js +7 -5
- package/dist/records/index.cjs +23 -21
- package/dist/records/index.d.cts +14 -14
- package/dist/records/index.d.ts +14 -14
- package/dist/records/index.js +23 -21
- package/dist/{requestFunnel-BPeBZdKp.d.ts → requestFunnel-BkSFsLKh.d.ts} +5 -5
- package/dist/{requestFunnel-DHeSzCT6.d.cts → requestFunnel-nmhlEdbM.d.cts} +5 -5
- package/dist/{runtimeTypes-Cc207nbn.d.ts → runtimeTypes-CU2xVmiQ.d.ts} +7 -7
- package/dist/{runtimeTypes-DgMizQKz.d.cts → runtimeTypes-CWG1Cm4N.d.cts} +7 -7
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +4 -4
- package/dist/server/events/index.d.ts +4 -4
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +2 -2
- package/dist/server/index.d.cts +5 -5
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +2 -2
- package/dist/televet/booking/index.cjs +9 -8
- package/dist/televet/booking/index.d.cts +12 -12
- package/dist/televet/booking/index.d.ts +12 -12
- package/dist/televet/booking/index.js +9 -8
- package/dist/televet/call/index.cjs +3 -5
- package/dist/televet/call/index.d.cts +3 -3
- package/dist/televet/call/index.d.ts +3 -3
- package/dist/televet/call/index.js +3 -5
- package/dist/televet/index.cjs +2 -2
- package/dist/televet/index.d.cts +7 -7
- package/dist/televet/index.d.ts +7 -7
- package/dist/televet/index.js +2 -2
- package/dist/testing/index.cjs +2 -2
- package/dist/testing/index.d.cts +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +2 -2
- package/dist/testing/rn/index.cjs +2 -2
- package/dist/testing/rn/index.d.cts +13 -13
- package/dist/testing/rn/index.d.ts +13 -13
- package/dist/testing/rn/index.js +2 -2
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +14 -14
- package/dist/testing/web/index.d.ts +14 -14
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-DUQIWSjc.d.cts → timelineRows-CYF_I5Aq.d.cts} +1 -1
- package/dist/{timelineRows-D22vGN9t.d.ts → timelineRows-PWRoTntZ.d.ts} +1 -1
- package/dist/{tokens-RAKZj7M8.d.cts → tokens-DLj8OnLH.d.cts} +4 -2
- package/dist/{tokens-RAKZj7M8.d.ts → tokens-DLj8OnLH.d.ts} +4 -2
- package/dist/{typeStyle-DVj8iCC1.d.ts → typeStyle-BxVyF71R.d.ts} +2 -2
- package/dist/{typeStyle-Nt7w0rhE.d.cts → typeStyle-DJedEu14.d.cts} +2 -2
- package/dist/{useRecordsDepth-Mbysp548.d.cts → useRecordsDepth-Cg4cc4bQ.d.cts} +4 -4
- package/dist/{useRecordsDepth-C0Qfoghi.d.ts → useRecordsDepth-eS9BJv_a.d.ts} +4 -4
- package/dist/{useVetVisit-RPBOabl8.d.ts → useVetVisit-DmWa7lt1.d.ts} +2 -2
- package/dist/{useVetVisit-BQX_aTJs.d.cts → useVetVisit-PtBjNwZr.d.cts} +2 -2
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.cts +3 -3
- package/dist/video/index.d.ts +3 -3
- package/dist/video/index.js +1 -1
- package/dist/{view-CskIgOFV.d.cts → view-D4UOm-yo.d.cts} +11 -5
- package/dist/{view-DqKXtxEZ.d.ts → view-n_oSGiiT.d.ts} +11 -5
- package/dist/web/consent/index.cjs +2 -2
- package/dist/web/consent/index.d.cts +9 -9
- package/dist/web/consent/index.d.ts +9 -9
- package/dist/web/consent/index.js +2 -2
- package/dist/web/index.cjs +10 -10
- package/dist/web/index.d.cts +22 -22
- package/dist/web/index.d.ts +22 -22
- package/dist/web/index.js +10 -10
- package/dist/web/notifications/index.cjs +1 -1
- package/dist/web/notifications/index.d.cts +7 -7
- package/dist/web/notifications/index.d.ts +7 -7
- package/dist/web/notifications/index.js +1 -1
- package/dist/web/records/depth/index.cjs +6 -5
- package/dist/web/records/depth/index.d.cts +11 -11
- package/dist/web/records/depth/index.d.ts +11 -11
- package/dist/web/records/depth/index.js +7 -6
- package/dist/web/records/index.cjs +13 -11
- package/dist/web/records/index.d.cts +15 -15
- package/dist/web/records/index.d.ts +15 -15
- package/dist/web/records/index.js +13 -11
- package/dist/web/televet/booking/index.cjs +6 -6
- package/dist/web/televet/booking/index.d.cts +14 -11
- package/dist/web/televet/booking/index.d.ts +14 -11
- package/dist/web/televet/booking/index.js +6 -6
- package/dist/web/televet/call/index.cjs +3 -5
- package/dist/web/televet/call/index.d.cts +3 -3
- package/dist/web/televet/call/index.d.ts +3 -3
- package/dist/web/televet/call/index.js +3 -5
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.d.cts +5 -5
- package/dist/web/televet/index.d.ts +5 -5
- package/dist/web/televet/index.js +1 -1
- package/package.json +1 -1
|
@@ -22,8 +22,13 @@ declare const VET_CALL_COPY: Readonly<{
|
|
|
22
22
|
speakerOnCta: "Speaker on";
|
|
23
23
|
/** The lobby: the member is in the room and the clinician is not. */
|
|
24
24
|
lobbyTitleNoName: "Your vet is joining";
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Since 0.9.2. Always an empty string, and no SDK surface draws it. The owner dropped
|
|
27
|
+
* "Usually under a minute" (2026-10-04, Q10): a timing promise nothing measures. Kept only so a host that
|
|
28
|
+
* read it still builds on `^0.9.0`; drop the line from your lobby. It may be removed in a later minor release.
|
|
29
|
+
*/
|
|
30
|
+
lobbySubtitle: "";
|
|
31
|
+
lobbyPrepLabel: "While you wait";
|
|
27
32
|
lobbyPrepNoPet: "Have your pet nearby and somewhere well lit.";
|
|
28
33
|
/** `{name}` is DATA from the consult, never a key. Absent, `lobbyTitleNoName` is used instead. */
|
|
29
34
|
lobbyTitle: (clinicianName: string | null | undefined) => string;
|
|
@@ -22,8 +22,13 @@ declare const VET_CALL_COPY: Readonly<{
|
|
|
22
22
|
speakerOnCta: "Speaker on";
|
|
23
23
|
/** The lobby: the member is in the room and the clinician is not. */
|
|
24
24
|
lobbyTitleNoName: "Your vet is joining";
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Since 0.9.2. Always an empty string, and no SDK surface draws it. The owner dropped
|
|
27
|
+
* "Usually under a minute" (2026-10-04, Q10): a timing promise nothing measures. Kept only so a host that
|
|
28
|
+
* read it still builds on `^0.9.0`; drop the line from your lobby. It may be removed in a later minor release.
|
|
29
|
+
*/
|
|
30
|
+
lobbySubtitle: "";
|
|
31
|
+
lobbyPrepLabel: "While you wait";
|
|
27
32
|
lobbyPrepNoPet: "Have your pet nearby and somewhere well lit.";
|
|
28
33
|
/** `{name}` is DATA from the consult, never a key. Absent, `lobbyTitleNoName` is used instead. */
|
|
29
34
|
lobbyTitle: (clinicianName: string | null | undefined) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EverfurError } from './EverfurError-
|
|
1
|
+
import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
|
|
2
2
|
|
|
3
3
|
/** The phases the in-app call surface moves through. The consumer app's `CallPhase`, verbatim. */
|
|
4
4
|
type VetCallPhase = 'joining' | 'joined' | 'left' | 'error';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EverfurError } from './EverfurError-
|
|
1
|
+
import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
|
|
2
2
|
|
|
3
3
|
/** The phases the in-app call surface moves through. The consumer app's `CallPhase`, verbatim. */
|
|
4
4
|
type VetCallPhase = 'joining' | 'joined' | 'left' | 'error';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
2
|
-
import { A as AuthContext } from './identity-
|
|
1
|
+
import { E as EverfurResult } from './EverfurResult-COlXj1wq.cjs';
|
|
2
|
+
import { A as AuthContext } from './identity-CUynm8S2.cjs';
|
|
3
3
|
import { P as PetRef } from './ids-B2GAAifq.cjs';
|
|
4
4
|
|
|
5
5
|
/** The owner's answer to a check-in, the wire values of the consumer `CheckinResponse` enum. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
2
|
-
import { A as AuthContext } from './identity-
|
|
1
|
+
import { E as EverfurResult } from './EverfurResult-ClPTS0P2.js';
|
|
2
|
+
import { A as AuthContext } from './identity-D5uywCtp.js';
|
|
3
3
|
import { P as PetRef } from './ids-B2GAAifq.js';
|
|
4
4
|
|
|
5
5
|
/** The owner's answer to a check-in, the wire values of the consumer `CheckinResponse` enum. */
|
package/dist/chat/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var react=require("react"),reactNative=require("react-native"),reactNativeSafeAreaContext=require("react-native-safe-area-context"),jsxRuntime=require("react/jsx-runtime");var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
1
|
+
"use strict";var react=require("react"),reactNative=require("react-native"),reactNativeSafeAreaContext=require("react-native-safe-area-context"),jsxRuntime=require("react/jsx-runtime"),bookingExperience=require("@everfur/sdk/televet/booking");function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=="default"){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}})}})}n.default=e;return Object.freeze(n)}var bookingExperience__namespace=/*#__PURE__*/_interopNamespace(bookingExperience);var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
2
2
|
/* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
3
3
|
/* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
|
|
4
4
|
/* @__PURE__ */Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
/* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
86
86
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
87
87
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
88
|
-
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.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 row=BY_KEY.get(candidate+key);if(row)return row}}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",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"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.",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:
|
|
88
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.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 row=BY_KEY.get(candidate+key);if(row)return row}}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 row=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)),row);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__ */
|
|
89
89
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
90
|
-
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)}};var CHAT_COPY=/* @__PURE__ */Object.freeze({placeholder:"Ask anything about {petName}…",placeholderFollowUpWeb:"Ask a follow-up…",placeholderUrgentWeb:"Tell us what’s happening…",composerLabel:"Message",attachPhotoOrFileNative:"Add a photo or file",footnoteNative:"Educational, not a diagnosis. Emergency? Call a vet.",footnoteWeb:"Everfur’s assistant isn’t a vet and doesn’t diagnose. Your vet makes the calls. Not for emergencies: if {petName} is in distress, go to the nearest emergency animal hospital now.",suggestions:"Suggestions",reading:"Reading {petName}’s records…",answered:"Everfur answered.",assistantName:"Everfur",followUpsHeadingNative:"Follow-up questions",turnFailedTitleWeb:"Everfur couldn’t answer that just now.",send:"Send",stop:"Stop",retry:"Try again",poweredBy:"powered by everfur",senderUser:"You",senderAssistant:"Assistant",senderVet:"Your vet",loading:"Loading",empty:"No messages yet",transcript:"Chat with Everfur",emptyTitle:"What can we help {petName} with today?",emptyTitlePetFallback:"your pet",copied:"Copied",copyUserMessage:"Copy your message",copyAssistantMessage:"Copy assistant message",feedbackHelpful:"Helpful",feedbackNeutral:"Neutral",feedbackNotHelpful:"Not helpful",feedbackTitle:"What went wrong?",feedbackSubtitle:"Your feedback helps make answers more reliable.",feedbackReasonInaccurate:"Inaccurate",feedbackReasonOutdated:"Out of date",feedbackReasonUnsafe:"Unsafe advice",feedbackReasonUnclear:"Confusing or unclear",feedbackReasonOther:"Something else",feedbackNotesPlaceholder:"Add details (optional)",feedbackSubmit:"Submit feedback",feedbackSkip:"Skip",feedbackSkipA11y:"Skip feedback",feedbackThanks:"Thanks for the feedback",feedbackFailed:"Couldn't send feedback. Please try again.",turnFailedTitle:"Message failed",turnRetry:"Retry",turnUnreachableTitle:"Couldn't reach this chat",turnStartNewChat:"Start a new chat",reconnecting:"Reconnecting…",turnStoppedTitle:"Response stopped",turnStoppedBody:"You stopped this response before it finished. Tap retry to try again.",sourceSingular:"source",sourcePlural:"sources",showSources:"Show",hideSources:"Hide",openSource:"Open source",urgencyGeneralReason:"Just general info about {petName}. Nothing here needs action right now.",findVet:"Find a vet",findVetA11y:"Find a vet near you",nearestEmergencyVet:"Nearest emergency vet",poisonControlWeb:"ASPCA Poison Control",poisonControlNative:"ASPCA Animal Poison Control, (888) 426-4435",showLatestVetAlert:"Show latest vet alert",dismissBanner:"Dismiss {label} banner",openHistoryNative:"Chats and vet messages",openHistoryWeb:"Chats",showChatsWeb:"Show chats",hideChatsWeb:"Hide chats",newReplySuffix:", a new reply",yourPets:"Your pets",yourPet:"Your pet",switchActivePet:"{name}. Switch pet",petCurrentlyActive:"{name}, currently active",switchToPet:"Switch to {name}",activePrefix:"Active · ",close:"Close",addAnotherPet:"Add a pet",addPet:"Add a pet",attachmentPhoto:"Photo",attachmentCamera:"Camera",closeAttachmentPicker:"Close attachment picker",addAttachment:"Add attachment, {used} of {total} used",attachmentsFull:"Attachments full, {used} of {total} used",retryUpload:"Retry uploading {filename}",removeAttachment:"Remove {filename}",previewAttachment:"Preview {filename}",closePreview:"Close preview",attachedImage:"Attached image: {filename}, opens a full-screen preview",attachmentTooLarge:"Files must be under {max}. {filename} is {size}.",attachmentTooMany:"You can attach up to {max} files per message.",attachmentUnsupported:"{filename} isn't a supported file type yet.",attachmentNetwork:"Couldn't reach the server. Check your connection and try again.",attachmentServer:"Upload failed{status}. Please try again.",attachmentCancelled:"Upload cancelled.",attachmentRateLimited:"Slow down. Please wait a moment and try again.",attachmentQuota:"Daily image limit reached. Try again tomorrow.",attachmentConflict:"Something went wrong. Tap to retry.",attachmentUnknown:"Something went wrong. Please try again.",attachmentsFailedBlocked:"Some attachments failed to upload. Remove or retry them before sending.",dictate:"Dictate a message",stopDictation:"Stop dictation",listening:"Listening",micBlocked:"Microphone access is blocked. Allow it in your browser settings to dictate.",noSpeech:"We didn't catch that. Tap the mic and try again.",dictationUnavailable:"Voice typing isn't available right now."});function fillCopy(template,values){return template.replace(/\{(\w+)\}/g,(match,key)=>{let value=values[key];return value===void 0?match:String(value)})}function petNameSlot(name){return name?.trim()||CHAT_COPY.emptyTitlePetFallback}function forPet(template,name){return fillCopy(template,{petName:petNameSlot(name)})}var POISON_CONTROL_TEL="tel:+18884264435";var FEEDBACK_REASONS=/* @__PURE__ */Object.freeze([
|
|
90
|
+
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)}};var EMERGENCY_ER_LINE="Go to the nearest emergency vet now.";var CHAT_COPY=/* @__PURE__ */Object.freeze({placeholder:"Ask anything about {petName}…",placeholderFollowUpWeb:"Ask a follow-up…",placeholderUrgentWeb:"Tell us what’s happening…",composerLabel:"Message",attachPhotoOrFileNative:"Add a photo or file",footnoteNative:"Educational, not a diagnosis. Emergency? Call a vet.",footnoteWeb:"Everfur’s assistant isn’t a vet and doesn’t diagnose. Your vet makes the calls. Not for emergencies: if {petName} is in distress, go to the nearest emergency animal hospital now.",suggestions:"Suggestions",reading:"Reading {petName}’s records…",answered:"Everfur answered.",assistantName:"Everfur",followUpsHeadingNative:"Follow-up questions",turnFailedTitleWeb:"Everfur couldn’t answer that just now.",send:"Send",stop:"Stop",retry:"Try again",poweredBy:"powered by everfur",senderUser:"You",senderAssistant:"Assistant",senderVet:"Your vet",loading:"Loading",empty:"No messages yet",transcript:"Chat with Everfur",emptyTitle:"What can we help {petName} with today?",emptyTitlePetFallback:"your pet",copied:"Copied",copyUserMessage:"Copy your message",copyAssistantMessage:"Copy assistant message",feedbackHelpful:"Helpful",feedbackNeutral:"Neutral",feedbackNotHelpful:"Not helpful",feedbackTitle:"What went wrong?",feedbackSubtitle:"Your feedback helps make answers more reliable.",feedbackReasonInaccurate:"Inaccurate",feedbackReasonOutdated:"Out of date",feedbackReasonUnsafe:"Unsafe advice",feedbackReasonUnclear:"Confusing or unclear",feedbackReasonOther:"Something else",feedbackNotesPlaceholder:"Add details (optional)",feedbackSubmit:"Submit feedback",feedbackSkip:"Skip",feedbackSkipA11y:"Skip feedback",feedbackThanks:"Thanks for the feedback",feedbackFailed:"Couldn't send feedback. Please try again.",turnFailedTitle:"Message failed",turnRetry:"Retry",turnUnreachableTitle:"Couldn't reach this chat",turnStartNewChat:"Start a new chat",reconnecting:"Reconnecting…",turnStoppedTitle:"Response stopped",turnStoppedBody:"You stopped this response before it finished. Tap retry to try again.",sourceSingular:"source",sourcePlural:"sources",showSources:"Show",hideSources:"Hide",openSource:"Open source",urgencyGeneralReason:"Just general info about {petName}. Nothing here needs action right now.",findVet:"Find a vet",findVetA11y:"Find a vet near you",nearestEmergencyVet:"Nearest emergency vet",goToNearestEmergencyVet:EMERGENCY_ER_LINE,poisonControlWeb:"ASPCA Poison Control",poisonControlNative:"ASPCA Animal Poison Control, (888) 426-4435",showLatestVetAlert:"Show latest vet alert",dismissBanner:"Dismiss {label} banner",openHistoryNative:"Chats and vet messages",openHistoryWeb:"Chats",showChatsWeb:"Show chats",hideChatsWeb:"Hide chats",newReplySuffix:", a new reply",yourPets:"Your pets",yourPet:"Your pet",switchActivePet:"{name}. Switch pet",petCurrentlyActive:"{name}, currently active",switchToPet:"Switch to {name}",activePrefix:"Active · ",close:"Close",addAnotherPet:"Add a pet",addPet:"Add a pet",attachmentPhoto:"Photo",attachmentCamera:"Camera",closeAttachmentPicker:"Close attachment picker",addAttachment:"Add attachment, {used} of {total} used",attachmentsFull:"Attachments full, {used} of {total} used",retryUpload:"Retry uploading {filename}",removeAttachment:"Remove {filename}",previewAttachment:"Preview {filename}",closePreview:"Close preview",attachedImage:"Attached image: {filename}, opens a full-screen preview",attachmentTooLarge:"Files must be under {max}. {filename} is {size}.",attachmentTooMany:"You can attach up to {max} files per message.",attachmentUnsupported:"{filename} isn't a supported file type yet.",attachmentNetwork:"Couldn't reach the server. Check your connection and try again.",attachmentServer:"Upload failed{status}. Please try again.",attachmentCancelled:"Upload cancelled.",attachmentRateLimited:"Slow down. Please wait a moment and try again.",attachmentQuota:"Daily image limit reached. Try again tomorrow.",attachmentConflict:"Something went wrong. Tap to retry.",attachmentUnknown:"Something went wrong. Please try again.",attachmentsFailedBlocked:"Some attachments failed to upload. Remove or retry them before sending.",dictate:"Dictate a message",stopDictation:"Stop dictation",listening:"Listening",micBlocked:"Microphone access is blocked. Allow it in your browser settings to dictate.",noSpeech:"We didn't catch that. Tap the mic and try again.",dictationUnavailable:"Voice typing isn't available right now."});function fillCopy(template,values){return template.replace(/\{(\w+)\}/g,(match,key)=>{let value=values[key];return value===void 0?match:String(value)})}function petNameSlot(name){return name?.trim()||CHAT_COPY.emptyTitlePetFallback}function forPet(template,name){return fillCopy(template,{petName:petNameSlot(name)})}var POISON_CONTROL_TEL="tel:+18884264435";var FEEDBACK_REASONS=/* @__PURE__ */Object.freeze([
|
|
91
91
|
/* @__PURE__ */Object.freeze({key:"inaccurate",label:CHAT_COPY.feedbackReasonInaccurate,feedbackType:"wrong"}),
|
|
92
92
|
/* @__PURE__ */Object.freeze({key:"outdated",label:CHAT_COPY.feedbackReasonOutdated,feedbackType:"outdated"}),
|
|
93
93
|
/* @__PURE__ */Object.freeze({key:"unsafe",label:CHAT_COPY.feedbackReasonUnsafe,feedbackType:"dangerous"}),
|
|
@@ -170,7 +170,7 @@ return jsxRuntime.jsxs(reactNative.View,{style:styles2.anchor,pointerEvents:"box
|
|
|
170
170
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:row.previewUri},style:styles2.thumbImage,resizeMode:"cover",accessibilityIgnoresInvertColors:true}),uploading?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.uploadingOverlay,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:theme.color.surface})}):null,flash?/* @__PURE__ */jsxRuntime.jsx(SuccessFlash,{styles:styles2,onDone:()=>setFlash(false)}):null]})}),failed?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:fillCopy(CHAT_COPY.retryUpload,{filename:row.filename}),style:styles2.failedOverlay,onPress:()=>onRetry(row.id),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.failedInner,children:/* @__PURE__ */jsxRuntime.jsx(CloseGlyph,{size:SUCCESS_GLYPH,color:theme.color.surface,strokeWidth:2})})}):null,
|
|
171
171
|
/* @__PURE__ */jsxRuntime.jsx(PressScale,{accessibilityRole:"button",accessibilityLabel:fillCopy(CHAT_COPY.removeAttachment,{filename:row.filename}),hitSlop:6,containerStyle:styles2.removeSlot,style:styles2.removeButton,onPress:()=>onRemove(row.id),children:/* @__PURE__ */jsxRuntime.jsx(CloseGlyph,{size:REMOVE_GLYPH,color:theme.color.surface,strokeWidth:1.5})})]})}function SuccessFlash({styles:styles2,onDone:onDone}){let theme=useEverfurTheme(),motion=useChatMotion(),opacity=react.useRef(null);opacity.current===null&&(opacity.current=new reactNative.Animated.Value(0));let value=opacity.current;return react.useEffect(()=>{let animation=reactNative.Animated.sequence([reactNative.Animated.timing(value,{toValue:1,duration:SUCCESS_FLASH_FADE_IN_MS,useNativeDriver:true}),reactNative.Animated.delay(motion.uploadFlashMs),reactNative.Animated.timing(value,{toValue:0,duration:SUCCESS_FLASH_FADE_OUT_MS,useNativeDriver:true})]);return animation.start(({finished:finished})=>{finished&&onDone()}),()=>animation.stop()},[value,motion.uploadFlashMs,onDone]),/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:[styles2.successOverlay,{opacity:value}],children:/* @__PURE__ */jsxRuntime.jsx(CheckGlyph,{size:SUCCESS_GLYPH,color:theme.color.surface,strokeWidth:2})})}function SentImages({images:images,onPreview:onPreview}){let theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles3(theme),[theme]);if(images.length===0)return null;let single=images.length===1;/* @__PURE__ */
|
|
172
172
|
return jsxRuntime.jsx(reactNative.View,{style:single?styles2.sentSingle:styles2.sentGrid,children:images.map((image,index)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:fillCopy(CHAT_COPY.attachedImage,{filename:image.filename}),onPress:()=>onPreview(image),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:image.uri},style:single?styles2.singleImage:styles2.gridImage,resizeMode:"cover",accessibilityIgnoresInvertColors:true})},`${image.uri}-${index}`))})}function makeStyles3(theme){let c=theme.color,t=theme.type;return reactNative.StyleSheet.create({strip:{gap:6,paddingBottom:8},cards:{flexDirection:"row",flexWrap:"wrap",gap:8},card:{width:THUMB_SIZE,height:THUMB_SIZE,overflow:"visible"},thumbHit:{width:"100%",height:"100%"},thumb:{width:"100%",height:"100%",borderRadius:CARD_RADIUS,overflow:"hidden",backgroundColor:c.composerFill,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:c.brandBorder},thumbImage:{width:"100%",height:"100%"},uploadingOverlay:{...ABSOLUTE_FILL,alignItems:"center",justifyContent:"center",backgroundColor:withAlpha(theme.color.brandInk,UPLOADING_ALPHA)??theme.color.brandSofter},successOverlay:{...ABSOLUTE_FILL,alignItems:"center",justifyContent:"center",backgroundColor:SUCCESS_OVERLAY},failedOverlay:{...ABSOLUTE_FILL,borderRadius:CARD_RADIUS,overflow:"hidden"},failedInner:{flex:1,alignItems:"center",justifyContent:"center",backgroundColor:FAILED_OVERLAY},removeSlot:{position:"absolute",top:4,right:4},removeButton:{width:REMOVE_SIZE,height:REMOVE_SIZE,borderRadius:REMOVE_SIZE/2,backgroundColor:REMOVE_BG,borderWidth:1.5,borderColor:c.surface,alignItems:"center",justifyContent:"center"},rejected:{...face(theme,"regular"),fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,color:c.danger},sentSingle:{marginBottom:6},sentGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,marginBottom:6},singleImage:{width:SINGLE_IMAGE,height:SINGLE_IMAGE,borderRadius:SINGLE_IMAGE_RADIUS,backgroundColor:IMAGE_ON_BRAND},gridImage:{width:GRID_IMAGE,height:GRID_IMAGE,borderRadius:GRID_IMAGE_RADIUS,backgroundColor:IMAGE_ON_BRAND}})}var FILE_FIELD="file",NOT_SENT="multipart upload failed";function postRnMultipart(post){let form;try{form=new FormData;for(let[name,value]of Object.entries(post.fields))form.append(name,value);form.append(FILE_FIELD,post.file)}catch{return Promise.reject(new Error(NOT_SENT))}return post.fetch!==void 0?postWithFetch(post.fetch,post.url,form,post.signal):postWithXhr(post.url,form,post.signal)}function stored(status){return status>=200&&status<300}function postWithXhr(url,form,signal){return new Promise((resolve,reject)=>{let Xhr=globalThis.XMLHttpRequest;if(typeof Xhr!="function"||signal?.aborted===true){reject(new Error(NOT_SENT));return}let onAbort=null,release=()=>{onAbort!==null&&signal?.removeEventListener("abort",onAbort)},fail=()=>{release(),reject(new Error(NOT_SENT))};try{let xhr=new Xhr;xhr.open("POST",url),xhr.withCredentials=!1,xhr.onload=()=>{release(),resolve(stored(xhr.status))},xhr.onerror=fail,xhr.ontimeout=fail,xhr.onabort=fail,signal!==void 0&&(onAbort=()=>{try{xhr.abort()}finally{fail()}},signal.addEventListener("abort",onAbort,{once:!0})),xhr.send(form)}catch{fail()}})}function postWithFetch(send,url,form,signal){return Promise.resolve().then(()=>send(url,{method:"POST",body:form,credentials:"omit",...signal?{signal:signal}:{}})).then(res=>res.ok)}var NO_URI="chat attachment upload: the file handle has no uri",FAILED="chat attachment upload failed";function filePartOf(file){return{uri:file.uri,name:sanitizeFilename(file.name),type:file.mimeType}}function createRnChatAttachmentTransport(options={}){/* @__PURE__ */
|
|
173
|
-
return Object.freeze({postMultipart(policy,file,opts){if(typeof file.uri!="string"||file.uri.length===0)return Promise.reject(new Error(NO_URI));let{signal:signal,onProgress:onProgress}=opts,failed=()=>Promise.reject(new Error(FAILED));return signal?.aborted===true?failed():postRnMultipart({url:policy.upload_url,fields:policy.upload_fields,file:filePartOf(file),signal:signal,fetch:options.fetch}).then(stored2=>{if(!stored2)return failed();onProgress?.(1)},failed)}})}function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function ownGroundSlot(slot){return slot===void 0||slot.backgroundColor!==void 0?slot:slot.borderRadius===void 0?void 0:{borderRadius:slot.borderRadius}}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var listeners=/* @__PURE__ */new WeakMap;function subscribePetsChanged(runtime,listener){let set=listeners.get(runtime);return set===void 0&&(set=/* @__PURE__ */new Set,listeners.set(runtime,set)),set.add(listener),()=>{set?.delete(listener)}}function useEverfurPets(){let{runtime:runtime,userRef:userRef,activePet:activePetRef,scopeEpoch:scopeEpoch}=useEverfurContext(),repository=react.useMemo(()=>createPetsRepository(runtime.registry.services.authFor(userRef)),[runtime,userRef,scopeEpoch]),[state,setState]=react.useState({repository:repository,pets:[],loading:true,error:null}),current=state.repository===repository?state:{pets:[],loading:true,error:null},generation=react.useRef(0),load=react.useCallback(async()=>{let request=++generation.current;setState(previous=>({...previous,repository:repository,loading:true,error:null,pets:previous.repository===repository?previous.pets:[]}));let result=await repository.list();request===generation.current&&setState(result.ok?{repository:repository,pets:result.value,loading:false,error:null}:previous=>({repository:repository,pets:previous.repository===repository?previous.pets:[],loading:false,error:result.error}))},[repository]);react.useEffect(()=>(load(),()=>{generation.current+=1}),[load]),react.useEffect(()=>subscribePetsChanged(runtime,()=>{load()}),[runtime,load]);let activePet=react.useMemo(()=>activePetRef===null?null:current.pets.find(pet=>pet.petRef===activePetRef)??null,[activePetRef,current.pets]);return react.useMemo(()=>({pets:current.pets,activePet:activePet,loading:current.loading,error:current.error,refresh:load}),[current.pets,current.loading,current.error,activePet,load])}function headerPetOf(pets,activePetRef){if(activePetRef!==null){let active=pets.find(pet=>pet.petRef===activePetRef);if(active!==void 0)return active}return pets[0]??null}var TELEVET_COPY=/* @__PURE__ */Object.freeze({visitButton:"Vet"});var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function publish(next){let g=televetGlobal();g.snapshot=/* @__PURE__ */Object.freeze({...g.snapshot,...next});for(let listener of[...g.listeners])try{listener()}catch{}}function callTelevetPresenter(request){let present=televetGlobal().presenter;if(present===null)return"absent";try{return present(request)===!1?"declined":"presented"}catch(cause){return console.warn("[everfur] Your registerEverfurTelevetFlow presenter threw; the in-app visit opened instead.",cause),"threw"}}function subscribeTelevetExperience(listener){let g=televetGlobal();return g.listeners.add(listener),()=>{g.listeners.delete(listener)}}function televetExperienceSnapshot(){return televetGlobal().snapshot}function hasTelevetHost(){return televetGlobal().hosts.length>0}function presentTelevetExperience(request){if(!hasTelevetHost())return false;let frozen=/* @__PURE__ */Object.freeze({...request});return publish({request:frozen,serial:televetGlobal().snapshot.serial+1}),true}function dismissTelevetExperience(){televetGlobal().snapshot.request!==null&&publish({request:null})}function claimTelevetHost(){let g=televetGlobal(),id=g.nextHost;return g.nextHost+=1,g.hosts=[...g.hosts,id],publish({activeHost:g.hosts[0]??null}),id}function releaseTelevetHost(id){let g=televetGlobal();g.hosts=g.hosts.filter(host=>host!==id);let activeHost=g.hosts[0]??null;publish(activeHost===null?{activeHost:activeHost,request:null}:{activeHost:activeHost})}var warned=false;function openVetVisitInApp(request,onStartInApp){return onStartInApp!==void 0?(callHost(onStartInApp,request),"onStartInApp"):callTelevetPresenter(request)==="presented"?"presenter":presentTelevetExperience(request)?"experience":(warned||(warned=true,console.warn("[everfur] A vet visit had nowhere to open: mount <EverfurTelevetHost /> in your EverfurProvider, or pass prefer: 'redirect'.")),null)}function memoizeTelevetLoader(load){let pending=null;return()=>{if(pending!==null)return pending;let started=load();return pending=started,started.then(void 0,()=>{pending===started&&(pending=null)}),started}}function useTelevetExperienceHost(load){let[id,setId]=react.useState(null);react.useEffect(()=>{let claimed=claimTelevetHost();return setId(claimed),()=>{releaseTelevetHost(claimed)}},[]);let snapshot=react.useSyncExternalStore(subscribeTelevetExperience,televetExperienceSnapshot,televetExperienceSnapshot),request=id!==null&&snapshot.activeHost===id?snapshot.request:null,[module,setModule]=react.useState(null),wanted=request!==null&&module===null;return react.useEffect(()=>{if(!wanted)return;let live=true;return load().then(loaded=>{live&&setModule(()=>loaded)},cause=>{live&&(console.warn("[everfur] The in-app vet visit could not load its screens.",cause),dismissTelevetExperience())}),()=>{live=false}},[wanted,load]),request===null||module===null?null:{module:module,request:request,serial:snapshot.serial,dismiss:dismissTelevetExperience}}var loadExperience=memoizeTelevetLoader(()=>
|
|
173
|
+
return Object.freeze({postMultipart(policy,file,opts){if(typeof file.uri!="string"||file.uri.length===0)return Promise.reject(new Error(NO_URI));let{signal:signal,onProgress:onProgress}=opts,failed=()=>Promise.reject(new Error(FAILED));return signal?.aborted===true?failed():postRnMultipart({url:policy.upload_url,fields:policy.upload_fields,file:filePartOf(file),signal:signal,fetch:options.fetch}).then(stored2=>{if(!stored2)return failed();onProgress?.(1)},failed)}})}function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function ownGroundSlot(slot){return slot===void 0||slot.backgroundColor!==void 0?slot:slot.borderRadius===void 0?void 0:{borderRadius:slot.borderRadius}}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var listeners=/* @__PURE__ */new WeakMap;function subscribePetsChanged(runtime,listener){let set=listeners.get(runtime);return set===void 0&&(set=/* @__PURE__ */new Set,listeners.set(runtime,set)),set.add(listener),()=>{set?.delete(listener)}}function useEverfurPets(){let{runtime:runtime,userRef:userRef,activePet:activePetRef,scopeEpoch:scopeEpoch}=useEverfurContext(),repository=react.useMemo(()=>createPetsRepository(runtime.registry.services.authFor(userRef)),[runtime,userRef,scopeEpoch]),[state,setState]=react.useState({repository:repository,pets:[],loading:true,error:null}),current=state.repository===repository?state:{pets:[],loading:true,error:null},generation=react.useRef(0),load=react.useCallback(async()=>{let request=++generation.current;setState(previous=>({...previous,repository:repository,loading:true,error:null,pets:previous.repository===repository?previous.pets:[]}));let result=await repository.list();request===generation.current&&setState(result.ok?{repository:repository,pets:result.value,loading:false,error:null}:previous=>({repository:repository,pets:previous.repository===repository?previous.pets:[],loading:false,error:result.error}))},[repository]);react.useEffect(()=>(load(),()=>{generation.current+=1}),[load]),react.useEffect(()=>subscribePetsChanged(runtime,()=>{load()}),[runtime,load]);let activePet=react.useMemo(()=>activePetRef===null?null:current.pets.find(pet=>pet.petRef===activePetRef)??null,[activePetRef,current.pets]);return react.useMemo(()=>({pets:current.pets,activePet:activePet,loading:current.loading,error:current.error,refresh:load}),[current.pets,current.loading,current.error,activePet,load])}function headerPetOf(pets,activePetRef){if(activePetRef!==null){let active=pets.find(pet=>pet.petRef===activePetRef);if(active!==void 0)return active}return pets[0]??null}var TELEVET_COPY=/* @__PURE__ */Object.freeze({visitButton:"Vet"});var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function publish(next){let g=televetGlobal();g.snapshot=/* @__PURE__ */Object.freeze({...g.snapshot,...next});for(let listener of[...g.listeners])try{listener()}catch{}}function callTelevetPresenter(request){let present=televetGlobal().presenter;if(present===null)return"absent";try{return present(request)===!1?"declined":"presented"}catch(cause){return console.warn("[everfur] Your registerEverfurTelevetFlow presenter threw; the in-app visit opened instead.",cause),"threw"}}function subscribeTelevetExperience(listener){let g=televetGlobal();return g.listeners.add(listener),()=>{g.listeners.delete(listener)}}function televetExperienceSnapshot(){return televetGlobal().snapshot}function hasTelevetHost(){return televetGlobal().hosts.length>0}function presentTelevetExperience(request){if(!hasTelevetHost())return false;let frozen=/* @__PURE__ */Object.freeze({...request});return publish({request:frozen,serial:televetGlobal().snapshot.serial+1}),true}function dismissTelevetExperience(){televetGlobal().snapshot.request!==null&&publish({request:null})}function claimTelevetHost(){let g=televetGlobal(),id=g.nextHost;return g.nextHost+=1,g.hosts=[...g.hosts,id],publish({activeHost:g.hosts[0]??null}),id}function releaseTelevetHost(id){let g=televetGlobal();g.hosts=g.hosts.filter(host=>host!==id);let activeHost=g.hosts[0]??null;publish(activeHost===null?{activeHost:activeHost,request:null}:{activeHost:activeHost})}var warned=false;function openVetVisitInApp(request,onStartInApp){return onStartInApp!==void 0?(callHost(onStartInApp,request),"onStartInApp"):callTelevetPresenter(request)==="presented"?"presenter":presentTelevetExperience(request)?"experience":(warned||(warned=true,console.warn("[everfur] A vet visit had nowhere to open: mount <EverfurTelevetHost /> in your EverfurProvider, or pass prefer: 'redirect'.")),null)}function memoizeTelevetLoader(load){let pending=null;return()=>{if(pending!==null)return pending;let started=load();return pending=started,started.then(void 0,()=>{pending===started&&(pending=null)}),started}}function useTelevetExperienceHost(load){let[id,setId]=react.useState(null);react.useEffect(()=>{let claimed=claimTelevetHost();return setId(claimed),()=>{releaseTelevetHost(claimed)}},[]);let snapshot=react.useSyncExternalStore(subscribeTelevetExperience,televetExperienceSnapshot,televetExperienceSnapshot),request=id!==null&&snapshot.activeHost===id?snapshot.request:null,[module,setModule]=react.useState(null),wanted=request!==null&&module===null;return react.useEffect(()=>{if(!wanted)return;let live=true;return load().then(loaded=>{live&&setModule(()=>loaded)},cause=>{live&&(console.warn("[everfur] The in-app vet visit could not load its screens.",cause),dismissTelevetExperience())}),()=>{live=false}},[wanted,load]),request===null||module===null?null:{module:module,request:request,serial:snapshot.serial,dismiss:dismissTelevetExperience}}var loadExperience=memoizeTelevetLoader(()=>Promise.resolve(bookingExperience__namespace));function EverfurTelevetHost({onAddToCalendar:onAddToCalendar,onPickMedia:onPickMedia,primaryVet:primaryVet,onFindEmergencyVet:onFindEmergencyVet}={}){let host=useTelevetExperienceHost(loadExperience);if(host===null)return null;let{EverfurTelevetModal:EverfurTelevetModal}=host.module;/* @__PURE__ */
|
|
174
174
|
return jsxRuntime.jsx(EverfurTelevetModal,{request:host.request,onClose:host.dismiss,...onAddToCalendar?{onAddToCalendar:onAddToCalendar}:{},...onPickMedia?{onPickMedia:onPickMedia}:{},...primaryVet?{primaryVet:primaryVet}:{},...onFindEmergencyVet?{onFindEmergencyVet:onFindEmergencyVet}:{}},host.serial)}var VET_VISIT_INTENTS=/* @__PURE__ */Object.freeze(["visit","join","summary","messages"]);function isVetVisitIntent(value){return typeof value=="string"&&VET_VISIT_INTENTS.includes(value)}var VET_VISIT_HANDOFF_PATH="/widget/v1/televet/handoffs",VET_VISIT_AVAILABILITY_PATH="/widget/v1/televet/availability",VET_VISIT_CHAT_ENTRY_PATH="/widget/v1/televet/chat-entry",RETURN_KEY=/^[a-z0-9][a-z0-9_-]{0,39}$/,FLOW_ID=/^[A-Za-z0-9_-]{22}$/;var STATE_MAX=32,PET_REF_MAX2=128,VISIT_REF_MAX=64;function vetVisitErrorReasonOf(error){let status=error.httpStatus;switch(error.code){case"sessionRequired":return"sessionRequired";case"authExpired":case"authRejected":return"authRejected";case"sdkUpdateRequired":return"sdkUpdateRequired";case"validationFailed":return"invalidRequest";case"rateLimited":case"quotaExceeded":return"rateLimited"}return status===void 0?error.code==="internalError"?"network":"unknown":status===429?"rateLimited":status===404?"unavailable":status===403?"accessDenied":status===401?"authRejected":status===400||status===422?"invalidRequest":status>=500?"serverError":"unknown"}function invalid2(wireMessage){return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage}))}function unusable(wireMessage){return err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:wireMessage}))}function handoffBody(petRef,options){let body={};petRef!==void 0&&(body.pet_ref=petRef);let returnTo=options?.returnTo;if(returnTo!=null){if(typeof returnTo!="string"||!RETURN_KEY.test(returnTo))return{ok:false,message:"returnTo must be a registered return destination key"};body.return_to=returnTo}let entry=options?.entry;if(entry!=null){if(entry!=="chat"||petRef===void 0)return{ok:false,message:"entry 'chat' needs the pet the chat is about"};body.entry=entry}let visitRef=options?.visitRef,intent=options?.intent,named=visitRef!=null;if(named){let trimmed=typeof visitRef=="string"?visitRef.trim():"";if(trimmed.length<1||[...trimmed].length>VISIT_REF_MAX)return{ok:false,message:`visitRef must be 1..${VISIT_REF_MAX} characters`};body.visit_ref=trimmed}if(intent!=null){if(!named)return{ok:false,message:"intent needs the visitRef it opens"};if(!isVetVisitIntent(intent))return{ok:false,message:`intent must be one of ${VET_VISIT_INTENTS.join(", ")}`};body.intent=intent}return{ok:true,body:body}}function parseVisitEcho(wire){if(typeof wire!="object"||wire===null)return null;let{visit_ref:visitRef,intent:intent}=wire;return typeof visitRef!="string"||visitRef.length===0||!isVetVisitIntent(intent)?null:/* @__PURE__ */Object.freeze({visitRef:visitRef,intent:intent})}function createVetVisitController(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),telemetry=deps.telemetry,failed=error=>(safeTrack(telemetry,"televet.visit.handoff_failed",{reason:vetVisitErrorReasonOf(error)}),err(error));return{async createHandoff(petRef,options){let pet;if(petRef!=null){let length=typeof petRef=="string"?[...petRef].length:0;if(length<1||length>PET_REF_MAX2)return failed(makeEverfurError("validationFailed",{retryable:false,wireMessage:`pet_ref must be 1..${PET_REF_MAX2} characters`}));pet=petRef}let built=handoffBody(pet,options);if(!built.ok){let refused=invalid2(built.message);return refused.ok?refused:failed(refused.error)}let body=built.body,res=await funnel.send("televet.visit.handoff",{method:"POST",path:VET_VISIT_HANDOFF_PATH,body:body},{idempotent:false,maxAttempts:1});if(!res.ok)return failed(res.error);let parsed=parseHandoff(res.value),wantsReturn=body.return_to!==void 0,flowId=wantsReturn?res.value?.flow_id:void 0;if(wantsReturn&&(typeof flowId!="string"||!FLOW_ID.test(flowId))){let refused=unusable("the handoff response carried no usable return flow id");return refused.ok?refused:failed(refused.error)}let wantsVisit=body.visit_ref!==void 0,visit=wantsVisit?parseVisitEcho(res.value?.visit):null;if(wantsVisit&&visit===null){let refused=unusable("the handoff response did not confirm the visit it opens");return refused.ok?refused:failed(refused.error)}let handoff=parsed===null?null:/* @__PURE__ */Object.freeze({...parsed,...wantsReturn?{flowId:flowId}:{},...visit!==null?{visit:visit}:{}});return handoff===null?failed(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the handoff response carried no usable visit url"})):(safeTrack(telemetry,"televet.visit.handoff_created",{pet_scoped:body.pet_ref!==void 0}),ok(handoff))},async checkAvailability(state){if(typeof state!="string"||state.length>STATE_MAX)return invalid2(`state must be at most ${STATE_MAX} characters`);let res=await funnel.send("televet.visit.availability",{method:"POST",path:VET_VISIT_AVAILABILITY_PATH,body:{state:state}},{idempotent:false,maxAttempts:1});if(!res.ok)return err(res.error);let available=res.value?.available;return typeof available!="boolean"?unusable("the availability response carried no usable answer"):ok(/* @__PURE__ */Object.freeze({available:available}))},async chatEntryOpen(){try{let res=await funnel.send("televet.visit.chat_entry",{method:"GET",path:VET_VISIT_CHAT_ENTRY_PATH},{maxAttempts:1});return res.ok&&res.value?.open===!0}catch{return false}}}}function parseHandoff(wire){if(typeof wire!="object"||wire===null)return null;let{url:url,expires_at:expiresAt}=wire;return typeof url!="string"||typeof expiresAt!="string"||expiresAt.length===0||!isOpenableVisitUrl(url)?null:/* @__PURE__ */Object.freeze({url:url,expiresAt:expiresAt})}var LOOPBACK_HOSTS=/* @__PURE__ */new Set(["localhost","127.0.0.1","[::1]"]),ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/,UNSAFE_CHAR=/[\s\u0000-\u001f\u007f]/;function isOpenableVisitUrl(raw){if(UNSAFE_CHAR.test(raw))return false;let match=ABSOLUTE_URL.exec(raw);if(match===null)return false;let scheme=(match[1]??"").toLowerCase(),authority=match[2]??"";if(authority.length===0||authority.includes("@"))return false;let host=authority.replace(/:\d+$/,"").toLowerCase(),secure=scheme==="https",loopback=scheme==="http"&&LOOPBACK_HOSTS.has(host);if(!secure&&!loopback)return false;let hashAt=raw.indexOf("#");if(hashAt<0)return false;let fragment=raw.slice(hashAt);return fragment.startsWith("#h=")&&fragment.length>3}function safeTrack(telemetry,event,props){if(telemetry)try{telemetry.track(event,props)}catch{}}var IDLE2=/* @__PURE__ */Object.freeze({status:"idle",error:null,errorReason:null});function usePreflight(controllerRef,enabled,question){let{usState:usState,chat:chat,scope:scope}=question,needed=enabled&&(usState!==null||chat),key=`${usState??""}|${chat?"chat":""}`,[settled,setSettled]=react.useState(null);if(react.useEffect(()=>{if(!needed)return;let live=true,controller=controllerRef.current;return setSettled(null),(async()=>{try{if(chat&&!(controller.chatEntryOpen&&await controller.chatEntryOpen()))return!1;if(usState===null)return!0;if(!controller.checkAvailability)return!1;let answer=await controller.checkAvailability(usState);return answer.ok&&answer.value.available}catch{return false}})().then(open=>{live&&setSettled({key:key,open:open})}),()=>{live=false}},[needed,key,usState,chat,scope,controllerRef]),!needed)return null;let current=settled!==null&&settled.key===key;return{open:current&&settled.open,pending:!current}}var OPENING=/* @__PURE__ */Object.freeze({status:"opening",error:null,errorReason:null});function useVetVisitWith(opener,opts={}){let{runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch}=useEverfurContext(),capability=useCapability("televet"),signedIn=capability.enabled&&userRef!==null,usState=opts.usState??null,chat=opts.entry==="chat",defaultPet=opts.petRef??null,redirect=opts.prefer==="redirect",controller=react.useMemo(()=>{if(opts.controller)return opts.controller;let{services:services}=runtime.registry;return createVetVisitController({auth:services.authFor(userRef),telemetry:services.telemetry,...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},[runtime,userRef,scopeEpoch,opts.controller]),preflightController=react.useRef(controller);preflightController.current=controller;let scope=react.useMemo(()=>({runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch}),[runtime,userRef,scopeEpoch]),preflight=usePreflight(preflightController,signedIn,{usState:usState,chat:chat,scope:scope}),available=signedIn&&(preflight===null||preflight.open)&&(!chat||defaultPet!==null),returnTo=opts.returnTo??null,[settled,setSettled]=react.useState(IDLE2),inFlight2=react.useRef(null),scopeRef=react.useRef({runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch});scopeRef.current={runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch};let controllerRef=react.useRef(controller);controllerRef.current=controller;let availableRef=react.useRef(available);availableRef.current=available;let start=react.useCallback((petRef,visit)=>{if(inFlight2.current)return inFlight2.current;let fail=(reason,error)=>(setSettled({status:reason==="cancelled"?"idle":"error",error:error,errorReason:reason==="cancelled"?null:reason}),/* @__PURE__ */Object.freeze({opened:false,reason:reason,error:error}));if(!availableRef.current)return Promise.resolve(fail("unavailable",null));let prepared=opener.prepare();if(!prepared.ok)return Promise.resolve(fail(prepared.reason,null));let started=scopeRef.current,controller2=controllerRef.current;setSettled(OPENING);let tracked=(async()=>{let result,named={...returnTo!==null?{returnTo:returnTo}:{},...chat?{entry:"chat"}:{},...visit!==null?{visitRef:visit.visitRef}:{},...visit!==null&&visit.intent!==null&&visit.intent!==void 0?{intent:visit.intent}:{}},options=Object.keys(named).length===0?void 0:named,pet=petRef===void 0?defaultPet:petRef;try{result=await(options===void 0?controller2.createHandoff(pet):controller2.createHandoff(pet,options))}catch{return opener.abandon(prepared.value),fail("unknown",null)}let current=scopeRef.current;if(current.runtime!==started.runtime||current.userRef!==started.userRef||current.scopeEpoch!==started.scopeEpoch)return opener.abandon(prepared.value),fail("cancelled",null);if(!result.ok)return opener.abandon(prepared.value),fail(vetVisitErrorReasonOf(result.error),result.error);let openFailure=await opener.finish(prepared.value,result.value);return openFailure!==null?fail(openFailure,null):(setSettled(IDLE2),/* @__PURE__ */Object.freeze(result.value.flowId===void 0?{opened:true}:{opened:true,flowId:result.value.flowId}))})().finally(()=>{inFlight2.current===tracked&&(inFlight2.current=null)});return inFlight2.current=tracked,tracked},[opener,defaultPet,returnTo,chat]),openInApp=react.useCallback((petRef,visit)=>{if(!availableRef.current)return setSettled({status:"error",error:null,errorReason:"unavailable"}),Promise.resolve(/* @__PURE__ */Object.freeze({opened:false,reason:"unavailable",error:null}));let pet=petRef===void 0?defaultPet:petRef,request={...pet!==null?{petRef:pet}:{},...usState!==null?{usState:usState}:{},...visit!==null?{visitRef:visit.visitRef,intent:visit.intent}:{}};return openVetVisitInApp(request)===null?(setSettled({status:"error",error:null,errorReason:"unavailable"}),Promise.resolve(/* @__PURE__ */Object.freeze({opened:false,reason:"unavailable",error:null}))):(setSettled(IDLE2),Promise.resolve(/* @__PURE__ */Object.freeze({opened:true})))},[defaultPet,usState]),open=react.useCallback(petRef=>redirect?start(petRef,null):openInApp(petRef,null),[redirect,start,openInApp]),openVisit=react.useCallback((visitRef,intent)=>redirect?start(void 0,{visitRef:visitRef,intent:intent??null}):openInApp(void 0,{visitRef:visitRef,intent:intent??null}),[redirect,start,openInApp]);return{available:available,isPending:capability.isPending||(preflight?.pending??false),status:settled.status,error:settled.error,errorReason:settled.errorReason,open:open,openVisit:openVisit}}var defaultOpenUrl=url=>reactNative.Linking.openURL(url);function useVetVisit(opts={}){let{openUrl:openUrl,...rest}=opts,opener=react.useMemo(()=>{let openImpl=openUrl??defaultOpenUrl;return{prepare:()=>({ok:true,value:null}),async finish(_prepared,handoff){try{return await openImpl(handoff.url),null}catch{return"openFailed"}},abandon:()=>{}}},[openUrl]);return useVetVisitWith(opener,rest)}var MIN_TOUCH_TARGET=44,BUSY_OPACITY=.6;function VetVisitButton(props){let{petRef:petRef,label:label,openUrl:openUrl,onOpened:onOpened,onError:onError,style:style,labelStyle:labelStyle,controller:controller,returnTo:returnTo,usState:usState,entry:entry,visitRef:visitRef,intent:intent,onStartInApp:onStartInApp,prefer:prefer}=props,redirecting=prefer==="redirect",visit=useVetVisit({...returnTo!==void 0?{returnTo:returnTo}:{},...usState!==void 0?{usState:usState}:{},...entry!==void 0?{entry:entry}:{},...petRef!==void 0?{petRef:petRef}:{},...openUrl!==void 0?{openUrl:openUrl}:{},...controller!==void 0?{controller:controller}:{},prefer:redirecting?"redirect":"in-app"}),theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles4(theme),[theme]),settling=react.useRef(false);if(!visit.available)/* @__PURE__ */
|
|
175
175
|
return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[null,
|
|
176
176
|
/* @__PURE__ */jsxRuntime.jsx(EverfurTelevetHost,{})]});let busy=visit.status==="opening",text3=label??TELEVET_COPY.visitButton;/* @__PURE__ */
|
|
@@ -250,16 +250,16 @@ return jsxRuntime.jsxs(PressScale,{accessibilityRole:"button",accessibilityLabel
|
|
|
250
250
|
return Object.freeze({...tier,borderColor:borderColor,backgroundColor:fill,textColor:textColor,reasonColor:readOn(c.text.primary,[fill],SLOT_MIN_CONTRAST),pillColor:c.surface})}function withBannerSlot(tier,slot){if(slot===void 0)return tier;let next={...tier};return slot.backgroundColor!==void 0&&(next.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(next.borderColor=slot.borderColor),slot.textColor!==void 0&&(next.textColor=slot.textColor,next.reasonColor=slot.textColor),/* @__PURE__ */Object.freeze(next)}function chatVetVisitOptions(petRef,vet){let options={entry:"chat",petRef:petRef};return vet?.returnTo!==void 0&&(options.returnTo=vet.returnTo),vet?.usState!==void 0&&(options.usState=vet.usState),vet?.prefer!==void 0&&(options.prefer=vet.prefer),options}var CARD_EDGE=.75,EMERGENCY_EDGE=1.5,EMERGENCY_EDGE_ALPHA=.4,CARD_PAD_X_EXTRA=4,REASON_LEAD=1.5,CLOSE_SIZE2=22,CLOSE_GLYPH3=14,CLOSE_HIT_SLOP2=8,INFO_GLYPH=20,INFO_HIT_SLOP=10,PIN_GLYPH=13,PILL_LABEL_SIZE=12,PILL_LABEL_LINE=15,ACTION_MIN_HEIGHT=44,ACTION_PAD_X=14,ACTION_EDGE=1.25,ACTION_LABEL_SIZE=14,ACTION_GLYPH_GAP=6,COMPACT_REASON_LINES=2;function tierPaint(theme,tier){let c=theme.color;if(tier.level==="emergency")return{card:{backgroundColor:c.badgeBgCritical,borderColor:withAlpha(c.danger,EMERGENCY_EDGE_ALPHA)??c.danger,borderWidth:EMERGENCY_EDGE},label:c.danger,reason:c.text.primary,close:c.danger,action:{fill:c.surface,edge:c.danger,ink:c.danger}};let radius=theme.slots.banner?.borderRadius;return{card:{backgroundColor:tier.backgroundColor,borderColor:tier.borderColor,borderWidth:CARD_EDGE,...radius===void 0?{}:{borderRadius:radius}},label:tier.textColor,reason:tier.reasonColor,close:tier.textColor,action:null}}function UrgencyBanner({surface:surface,petRef:petRef,renderVetAction:renderVetAction,onFindVet:onFindVet,vet:vet,compact:compact=false}){let theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles10(theme),[theme]),motion=useChatMotion(),tier=surface.tier===null?null:themedUrgencyTier(surface.tier,theme),source=surface.source;/* @__PURE__ */
|
|
251
251
|
return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
|
|
252
252
|
/* @__PURE__ */jsxRuntime.jsx(FadePresence,{visible:surface.showBanner&&tier!==null,inMs:motion.bannerInMs,outMs:motion.bannerOutMs,style:styles2.pinned,children:tier!==null&&source!==null?/* @__PURE__ */jsxRuntime.jsx(BannerCard,{tier:tier,reason:source.reason,surface:surface,petRef:petRef,renderVetAction:renderVetAction,onFindVet:onFindVet,vet:vet,styles:styles2,compact:compact}):null}),
|
|
253
|
-
/* @__PURE__ */jsxRuntime.jsx(FadePresence,{visible:surface.showCompactIcon,inMs:motion.iconInMs,outMs:motion.iconOutMs,style:styles2.indicatorRow,children:/* @__PURE__ */jsxRuntime.jsx(PressScale,{accessibilityRole:"button",accessibilityLabel:CHAT_COPY.showLatestVetAlert,hitSlop:INFO_HIT_SLOP,onPress:surface.expand,children:/* @__PURE__ */jsxRuntime.jsx(InfoGlyph,{size:INFO_GLYPH,color:theme.color.text.muted,strokeWidth:2})})})]})}function BannerCard({tier:tier,reason:reason,surface:surface,petRef:petRef,renderVetAction:renderVetAction,onFindVet:onFindVet,vet:vet,styles:styles2,compact:compact}){let theme=useEverfurTheme(),paint=tierPaint(theme,tier),builtIn=/* @__PURE__ */jsxRuntime.jsx(VetAction,{tier:tier,paint:paint,petRef:petRef,onFindVet:onFindVet,vet:vet,styles:styles2}),vetAction=surface.showVetAction?renderVetAction!==void 0?/* @__PURE__ */jsxRuntime.jsx(HostRender,{render:()=>renderVetAction(tier.level),fallback:builtIn,resetKey:tier.level}):builtIn:null,poison=paint.action!==null?/* @__PURE__ */jsxRuntime.jsx(PoisonControl,{paint:paint.action,styles:styles2}):null;/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */jsxRuntime.jsx(FadePresence,{visible:surface.showCompactIcon,inMs:motion.iconInMs,outMs:motion.iconOutMs,style:styles2.indicatorRow,children:/* @__PURE__ */jsxRuntime.jsx(PressScale,{accessibilityRole:"button",accessibilityLabel:CHAT_COPY.showLatestVetAlert,hitSlop:INFO_HIT_SLOP,onPress:surface.expand,children:/* @__PURE__ */jsxRuntime.jsx(InfoGlyph,{size:INFO_GLYPH,color:theme.color.text.muted,strokeWidth:2})})})]})}function BannerCard({tier:tier,reason:reason,surface:surface,petRef:petRef,renderVetAction:renderVetAction,onFindVet:onFindVet,vet:vet,styles:styles2,compact:compact}){let theme=useEverfurTheme(),paint=tierPaint(theme,tier),builtIn=/* @__PURE__ */jsxRuntime.jsx(VetAction,{tier:tier,paint:paint,petRef:petRef,onFindVet:onFindVet,vet:vet,styles:styles2}),vetAction=surface.showVetAction?renderVetAction!==void 0?/* @__PURE__ */jsxRuntime.jsx(HostRender,{render:()=>renderVetAction(tier.level),fallback:builtIn,resetKey:tier.level}):builtIn:null,poison=paint.action!==null?/* @__PURE__ */jsxRuntime.jsx(PoisonControl,{paint:paint.action,styles:styles2}):null,erLine=tier.level==="emergency"&&onFindVet===void 0;/* @__PURE__ */
|
|
254
254
|
return jsxRuntime.jsxs(reactNative.View,{accessibilityRole:"alert",style:[styles2.card,paint.card,compact?styles2.cardCompact:null],testID:compact?"chat-urgency-compact":void 0,children:[
|
|
255
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.label,{color:paint.label}],children:tier.label}),reason!==null?/* @__PURE__ */jsxRuntime.jsx(Text,{style:[styles2.reason,{color:paint.reason}],numberOfLines:compact?COMPACT_REASON_LINES:void 0,accessibilityLabel:compact?reason:void 0,children:reason}):null,vetAction!==null||poison!==null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.actions,children:[vetAction,poison]}):null,surface.dismissLabel!==null?/* @__PURE__ */jsxRuntime.jsx(PressScale,{accessibilityRole:"button",accessibilityLabel:surface.dismissLabel,hitSlop:CLOSE_HIT_SLOP2,containerStyle:styles2.closeSlot,style:styles2.closeButton,onPress:surface.dismiss,children:/* @__PURE__ */jsxRuntime.jsx(CloseGlyph,{size:CLOSE_GLYPH3,color:paint.close,strokeWidth:1.5})}):null]})}function PoisonControl({paint:paint,styles:styles2}){let call=()=>{try{reactNative.Linking.openURL(POISON_CONTROL_TEL).catch(()=>{})}catch{}};/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.label,{color:paint.label}],children:tier.label}),reason!==null?/* @__PURE__ */jsxRuntime.jsx(Text,{style:[styles2.reason,{color:paint.reason}],numberOfLines:compact?COMPACT_REASON_LINES:void 0,accessibilityLabel:compact?reason:void 0,children:reason}):null,erLine?/* @__PURE__ */jsxRuntime.jsx(Text,{style:[styles2.reason,styles2.erLine,{color:paint.reason}],children:CHAT_COPY.goToNearestEmergencyVet}):null,vetAction!==null||poison!==null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.actions,children:[vetAction,poison]}):null,surface.dismissLabel!==null?/* @__PURE__ */jsxRuntime.jsx(PressScale,{accessibilityRole:"button",accessibilityLabel:surface.dismissLabel,hitSlop:CLOSE_HIT_SLOP2,containerStyle:styles2.closeSlot,style:styles2.closeButton,onPress:surface.dismiss,children:/* @__PURE__ */jsxRuntime.jsx(CloseGlyph,{size:CLOSE_GLYPH3,color:paint.close,strokeWidth:1.5})}):null]})}function PoisonControl({paint:paint,styles:styles2}){let call=()=>{try{reactNative.Linking.openURL(POISON_CONTROL_TEL).catch(()=>{})}catch{}};/* @__PURE__ */
|
|
256
256
|
return jsxRuntime.jsx(PressScale,{accessibilityRole:"button",accessibilityLabel:CHAT_COPY.poisonControlNative,hitSlop:0,style:[styles2.action,{backgroundColor:paint.fill,borderColor:paint.edge}],onPress:call,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.actionLabel,{color:paint.ink}],children:CHAT_COPY.poisonControlNative})})}function VetAction({tier:tier,paint:paint,petRef:petRef,onFindVet:onFindVet,vet:vet,styles:styles2}){let theme=useEverfurTheme(),visit=useVetVisit(chatVetVisitOptions(petRef,vet)),busy=visit.status==="opening",hostFinder=!visit.available&&onFindVet!==void 0,onPress=visit.available?()=>{visit.open()}:onFindVet!==void 0?()=>{callHost(onFindVet,tier.level)}:null;if(onPress===null)return null;let action=paint.action;if(action!==null){let label=hostFinder?CHAT_COPY.nearestEmergencyVet:CHAT_COPY.findVet,ink2=ownGroundSlot(theme.slots.vetVisitButton)?.textColor??action.ink;/* @__PURE__ */
|
|
257
257
|
return jsxRuntime.jsxs(PressScale,{accessibilityRole:"button",accessibilityLabel:hostFinder?CHAT_COPY.nearestEmergencyVet:CHAT_COPY.findVetA11y,accessibilityState:{busy:busy},hitSlop:0,style:[styles2.action,{backgroundColor:action.fill,borderColor:action.edge},styles2.findVetSlotBox,busy?styles2.findVetBusy:null],onPress:onPress,children:[
|
|
258
258
|
/* @__PURE__ */jsxRuntime.jsx(MapPinGlyph,{size:PIN_GLYPH,color:ink2,strokeWidth:1.5}),
|
|
259
259
|
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.actionLabel,{color:ink2}],children:label})]})}let ink=ownGroundSlot(theme.slots.vetVisitButton)?.textColor??tier.textColor;/* @__PURE__ */
|
|
260
260
|
return jsxRuntime.jsxs(PressScale,{accessibilityRole:"button",accessibilityLabel:CHAT_COPY.findVetA11y,accessibilityState:{busy:busy},style:[styles2.findVetButton,{borderColor:tier.borderColor,backgroundColor:tier.pillColor},styles2.findVetSlotBox,busy?styles2.findVetBusy:null],onPress:onPress,children:[
|
|
261
261
|
/* @__PURE__ */jsxRuntime.jsx(MapPinGlyph,{size:PIN_GLYPH,color:ink,strokeWidth:1.5}),
|
|
262
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.findVetLabel,{color:ink}],children:CHAT_COPY.findVet})]})}function makeStyles10(theme){let pill=ownGroundSlot(theme.slots.vetVisitButton),s=theme.space,t=theme.type;return reactNative.StyleSheet.create({pinned:{marginTop:0,marginBottom:s.xs,paddingHorizontal:s.lg},card:{borderRadius:theme.radius.lg,paddingHorizontal:s.lg+CARD_PAD_X_EXTRA,paddingVertical:s.lg,gap:s.sm},cardCompact:{paddingVertical:s.md,gap:s.xs},label:{...face(theme,"bold"),fontSize:t.size.body,paddingRight:CLOSE_SIZE2},reason:{...face(theme,"regular"),fontSize:t.size.bodyTight,lineHeight:Math.round(t.size.bodyTight*REASON_LEAD),paddingRight:CLOSE_SIZE2},actions:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:s.sm},action:{flexDirection:"row",alignItems:"center",gap:ACTION_GLYPH_GAP,minHeight:ACTION_MIN_HEIGHT,paddingHorizontal:ACTION_PAD_X,borderRadius:theme.radius.pill,borderWidth:ACTION_EDGE},actionLabel:{...face(theme,"bold"),fontSize:ACTION_LABEL_SIZE},findVetButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:theme.radius.pill,borderWidth:1},findVetSlotBox:{...slotBox(pill,1)},findVetBusy:{opacity:.6},findVetLabel:{...face(theme,"monoBold"),fontSize:PILL_LABEL_SIZE,lineHeight:PILL_LABEL_LINE},closeSlot:{position:"absolute",top:s.md,right:s.md},closeButton:{width:CLOSE_SIZE2,height:CLOSE_SIZE2,borderRadius:CLOSE_SIZE2/2,alignItems:"center",justifyContent:"center"},indicatorRow:{alignItems:"flex-end",paddingHorizontal:s.lg,paddingTop:2,paddingBottom:s.xs}})}function useChatPets(){let pets=useEverfurPets(),{handle:handle}=useEverfurContext(),setActivePet=react.useCallback(petRef=>handle.setActivePet(petRef),[handle]);return react.useMemo(()=>({...pets,setActivePet:setActivePet}),[pets,setActivePet])}function announceAnswered(){try{let announce=reactNative.AccessibilityInfo?.announceForAccessibility;typeof announce=="function"&&announce.call(reactNative.AccessibilityInfo,CHAT_COPY.answered)}catch{}}function useSettleAnnouncement(chat){let wasStreaming=react.useRef(false),scope=react.useRef({send:chat.send,id:chat.conversationId});react.useEffect(()=>{let previous=scope.current;if((previous.send!==chat.send||previous.id!==null&&previous.id!==chat.conversationId)&&(wasStreaming.current=false),scope.current={send:chat.send,id:chat.conversationId},wasStreaming.current&&!chat.isStreaming){let last=chat.messages[chat.messages.length-1];last!==void 0&&last.role==="assistant"&&announceAnswered()}wasStreaming.current=chat.isStreaming},[chat.isStreaming,chat.messages,chat.send,chat.conversationId])}var SPINNER_DELAY_MS=300,THANKS_VISIBLE_MS=3e3,MIN_SURFACE_HEIGHT=120,MIN_TOUCH_TARGET5=44,INPUT_MAX_HEIGHT=120,BUBBLE_MAX_WIDTH="88%",BUBBLE_MAX_WIDTH_CAP=520,HALF_STEP2=2,BUBBLE_EDGE_WIDTH=.5,BUBBLE_LEAD_USER=1.5,BUBBLE_LEAD_ASSISTANT=1.6,PENDING_OPACITY=.6,COMPOSER_MIN_HEIGHT=56,COMPOSER_BORDER_WIDTH=1.5,COMPOSER_PADDING_RIGHT=5,COMPOSER_PADDING_VERTICAL=5,INPUT_MIN_HEIGHT=36,INPUT_LINE_HEIGHT=20,APP_BODY_SIZE=14,SEND_CONTROL_SIZE=MIN_TOUCH_TARGET5,TEXT_ACTION_HIT_SLOP=4,SEND_GLYPH_SIZE=24,STOP_GLYPH_SIZE=22,SEND_DISABLED_OPACITY=.4,ATTACH_CONTROL_SIZE=MIN_TOUCH_TARGET5,ATTACH_GLYPH_SIZE=20,ATTACH_DISABLED_OPACITY=.4,EMPTY_MIN_HEIGHT=480,FOLLOW_UP_HEADING_SIZE=12,FOLLOW_UP_HEADING_TRACKING=.72,FOLLOW_UP_ROW_MIN_HEIGHT=48,RULE_WIDTH=1,FOOTNOTE_SIZE=12,FOOTNOTE_LINE=18,EMPTY_PADDING_TOP="12%",ASSISTANT_AVATAR_SIZE=20;function useChatTheme(){let theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles11(theme),[theme]);return{theme:theme,styles:styles2}}function makeStyles11(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type,userLine=Math.round(t.size.body*BUBBLE_LEAD_USER),assistantLine=Math.round(t.size.body*BUBBLE_LEAD_ASSISTANT),inputLine=Math.round(INPUT_LINE_HEIGHT*t.size.body/APP_BODY_SIZE),rule=c.borderRingCream,slots=theme.slots;return reactNative.StyleSheet.create({container:{flex:1,minHeight:MIN_SURFACE_HEIGHT,backgroundColor:c.chatGround},body:{flex:1},centered:{minHeight:MIN_SURFACE_HEIGHT,flexGrow:1,alignItems:"center",justifyContent:"center",padding:s.xl},emptyContent:{flexGrow:1,alignItems:"stretch",justifyContent:"flex-start",paddingTop:EMPTY_PADDING_TOP,paddingHorizontal:s.lg,paddingBottom:s.lg,minHeight:EMPTY_MIN_HEIGHT,gap:s.lg},errorText:{...face(theme,"regular"),fontSize:t.size.subtitle,lineHeight:t.size.subtitle*t.lineHeight.snug,color:c.danger,textAlign:"center",marginBottom:s.md},retryButton:{minHeight:MIN_TOUCH_TARGET5,minWidth:MIN_TOUCH_TARGET5,alignItems:"center",justifyContent:"center",paddingHorizontal:s.xl,paddingVertical:s.sm,borderRadius:r.pill,backgroundColor:c.brand,...slotBox(slots.primaryButton)},retryLabel:{...face(theme,"medium"),color:c.onPrimary,fontSize:t.size.body,...slotText(slots.primaryButton)},setupNotice:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.sm,paddingHorizontal:s.lg,paddingVertical:s.sm,backgroundColor:c.surfaceCream},setupNoticeText:{...face(theme,"regular"),color:c.danger,fontSize:t.size.caption,flexShrink:1},turnNotice:{gap:s.xs,padding:s.md,borderRadius:r.lg,backgroundColor:c.surfaceCream,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:c.brandBorder,alignItems:"flex-start",...slotBox(slots.card,reactNative.StyleSheet.hairlineWidth)},turnNoticeError:{borderColor:c.danger},turnNoticeTitle:{...headingFace(theme,"bold"),color:c.text.primary,fontSize:t.size.body,...slotText(slots.card)},turnNoticeTitleError:{color:c.danger},turnNoticeBody:{...face(theme,"regular"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,...slotText(slots.card)},turnNoticeAction:{minHeight:MIN_TOUCH_TARGET5,justifyContent:"center"},turnNoticeActionLabel:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.body},setupNoticeAction:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.caption},reconnectingCaption:{...face(theme,"medium"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,textTransform:"uppercase",letterSpacing:.5},readingLine:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.bodyTight,lineHeight:Math.round(t.size.bodyTight*t.lineHeight.relaxed)},list:{flex:1},listContent:{padding:s.lg,gap:s.xl},rowBlock:{gap:s.sm},rowBlockUser:{},rowBlockAssistant:{paddingRight:s.xl},row:{flexDirection:"row"},rowUser:{justifyContent:"flex-end"},rowAssistant:{justifyContent:"flex-start"},bubble:{maxWidth:BUBBLE_MAX_WIDTH,alignItems:"flex-start"},bubbleSideUser:{alignItems:"flex-end"},bubbleUser:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP2,backgroundColor:c.bubbleUser,...c.primaryEdge!==c.primary&&c.bubbleUser===c.primary?{borderWidth:BUBBLE_EDGE_WIDTH,borderColor:c.primaryEdge}:{},borderRadius:r.lg,borderBottomRightRadius:r.xs,...slotBox(slots.userBubble,BUBBLE_EDGE_WIDTH)},bubbleAssistant:slots.assistantBubble?.backgroundColor===void 0?{...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)}:{paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP2,borderRadius:r.lg,...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)},bubbleVet:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP2,backgroundColor:c.bubbleVet,borderRadius:r.lg,borderTopLeftRadius:r.xs,...slotBox(slots.vetBubble,BUBBLE_EDGE_WIDTH)},bubblePending:{opacity:PENDING_OPACITY},bubbleTextUser:{...face(theme,"regular"),color:c.onPrimary,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.userBubble)},bubbleTextAssistant:{...face(theme,"regular"),color:c.text.primary,fontSize:t.size.body,lineHeight:assistantLine,...slotText(slots.assistantBubble)},bubbleTextVet:{...face(theme,"regular"),color:c.onBubbleVet,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.vetBubble)},assistantName:{...face(theme,"bold"),color:c.brandInk,fontSize:t.size.bodyTight,marginBottom:s.xs},assistantSender:{flexDirection:"row",alignItems:"center",gap:s.sm,marginBottom:s.xs},assistantAvatar:{width:ASSISTANT_AVATAR_SIZE,height:ASSISTANT_AVATAR_SIZE,borderRadius:ASSISTANT_AVATAR_SIZE/2},assistantNameInRow:{marginBottom:0},vetHeader:{flexDirection:"row",alignItems:"baseline",gap:s.sm,marginBottom:s.xs},vetSender:{...face(theme,"bold"),color:c.text.primary,fontSize:t.size.bodyTight},vetTime:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.caption},bubbleBold:face(theme,"bold"),bubbleItalic:{fontStyle:"italic"},bubbleCode:face(theme,"mono"),followUps:{alignSelf:"stretch",marginTop:s.md},followUpsHeading:{...face(theme,"monoBold"),color:c.text.muted,fontSize:FOLLOW_UP_HEADING_SIZE,textTransform:"uppercase",letterSpacing:FOLLOW_UP_HEADING_TRACKING,paddingBottom:s.sm,borderBottomWidth:RULE_WIDTH,borderBottomColor:rule},followUpSlot:{alignSelf:"stretch"},followUpSlotRuled:{borderTopWidth:RULE_WIDTH,borderTopColor:rule},followUpRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.md,minHeight:FOLLOW_UP_ROW_MIN_HEIGHT,paddingVertical:s.sm+HALF_STEP2,...slots.chip?.backgroundColor!==void 0||slots.chip?.borderColor!==void 0?{paddingHorizontal:s.md}:{},...slotBox(slots.chip)},followUpText:{...face(theme,"bold"),flex:1,color:c.brandInk,fontSize:t.size.bodyTight,...slotText(slots.chip)},composerOuter:{position:"relative"},composer:{marginHorizontal:s.md,marginTop:s.xs,minHeight:COMPOSER_MIN_HEIGHT,justifyContent:"center",paddingLeft:s.sm,paddingRight:COMPOSER_PADDING_RIGHT,paddingVertical:COMPOSER_PADDING_VERTICAL,backgroundColor:c.composerFill,borderWidth:COMPOSER_BORDER_WIDTH,borderColor:c.composerBorder,borderRadius:r.pill,...slotBox(slots.composerInput,COMPOSER_BORDER_WIDTH)},composerRow:{flexDirection:"row",alignItems:"center",gap:s.xs,minHeight:INPUT_MIN_HEIGHT},attachControl:{width:ATTACH_CONTROL_SIZE,height:ATTACH_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},attachControlDisabled:{opacity:ATTACH_DISABLED_OPACITY},input:{flex:1,minHeight:INPUT_MIN_HEIGHT,maxHeight:INPUT_MAX_HEIGHT,paddingHorizontal:0,paddingVertical:0,...face(theme,"regular"),fontSize:t.size.body,lineHeight:inputLine,color:c.text.primary,...slotText(slots.composerInput)},sendControl:{minHeight:SEND_CONTROL_SIZE,minWidth:SEND_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},sendDisc:{width:SEND_CONTROL_SIZE,height:SEND_CONTROL_SIZE,borderRadius:SEND_CONTROL_SIZE/2,alignItems:"center",justifyContent:"center",...slotBox(slots.sendButton)},sendControlDisabled:{opacity:SEND_DISABLED_OPACITY},footnote:{...face(theme,"regular"),color:c.text.muted,fontSize:FOOTNOTE_SIZE,lineHeight:FOOTNOTE_LINE,textAlign:"center",marginTop:s.sm,marginBottom:s.xs,paddingHorizontal:s.lg},poweredBy:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.micro,textAlign:"center",paddingBottom:s.xs}})}var LIVE=/* @__PURE__ */Object.freeze({kind:"live"}),FOLDED=/* @__PURE__ */Object.freeze({kind:"folded"});function askOf(message){if(message.role!=="assistant"||message.checkin===void 0)return null;let caseId=message.checkin.caseId,origin=parseCheckinOrigin(message.proactiveOriginRef);return{caseId:caseId,dueDay:origin!==null&&origin.caseId===caseId?origin.dueDay:""}}function placeCheckins(messages){let placements=/* @__PURE__ */new Map,newestByCase=/* @__PURE__ */new Map;for(let message of messages){let ask=askOf(message);if(ask===null)continue;let current=newestByCase.get(ask.caseId);(current===void 0||ask.dueDay>=current.dueDay)&&newestByCase.set(ask.caseId,{messageId:message.id,dueDay:ask.dueDay})}if(newestByCase.size===0)return placements;let leader=null;for(let message of messages){let ask=askOf(message);if(ask===null){leader=null;continue}if(newestByCase.get(ask.caseId)?.messageId===message.id){placements.set(message.id,LIVE),leader=null;continue}if(leader!==null&&leader.caseId===ask.caseId){leader.days.push(ask.dueDay),placements.set(message.id,FOLDED);continue}let days=[ask.dueDay];leader={id:message.id,caseId:ask.caseId,days:days},placements.set(message.id,{kind:"past",runDueDays:days})}return placements}var MS_PER_DAY=864e5,MAX_WATCH_DAY=365;function checkinDayNumber(openedAtIso,dueDay){if(typeof openedAtIso!="string"||typeof dueDay!="string")return null;let opened=Date.parse(openedAtIso),due=Date.parse(dueDay);if(Number.isNaN(opened)||Number.isNaN(due))return null;let elapsed=Math.floor(due/MS_PER_DAY)-Math.floor(opened/MS_PER_DAY);return elapsed<1||elapsed>MAX_WATCH_DAY?null:elapsed}function checkinDueDay(message){return askOf(message)?.dueDay||null}function formatMessageTime(createdAt){if(!createdAt)return null;let parsed=new Date(createdAt);return Number.isNaN(parsed.getTime())?null:parsed.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function AssistantSender({avatarUrl:avatarUrl,named:named,styles:styles2}){let image=useBrandImage(avatarUrl);return image.shown?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.assistantSender,testID:"everfur-assistant-sender",children:[
|
|
262
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.findVetLabel,{color:ink}],children:CHAT_COPY.findVet})]})}function makeStyles10(theme){let pill=ownGroundSlot(theme.slots.vetVisitButton),s=theme.space,t=theme.type;return reactNative.StyleSheet.create({pinned:{marginTop:0,marginBottom:s.xs,paddingHorizontal:s.lg},card:{borderRadius:theme.radius.lg,paddingHorizontal:s.lg+CARD_PAD_X_EXTRA,paddingVertical:s.lg,gap:s.sm},cardCompact:{paddingVertical:s.md,gap:s.xs},label:{...face(theme,"bold"),fontSize:t.size.body,paddingRight:CLOSE_SIZE2},reason:{...face(theme,"regular"),fontSize:t.size.bodyTight,lineHeight:Math.round(t.size.bodyTight*REASON_LEAD),paddingRight:CLOSE_SIZE2},erLine:{...face(theme,"bold")},actions:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:s.sm},action:{flexDirection:"row",alignItems:"center",gap:ACTION_GLYPH_GAP,minHeight:ACTION_MIN_HEIGHT,paddingHorizontal:ACTION_PAD_X,borderRadius:theme.radius.pill,borderWidth:ACTION_EDGE},actionLabel:{...face(theme,"bold"),fontSize:ACTION_LABEL_SIZE},findVetButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:theme.radius.pill,borderWidth:1},findVetSlotBox:{...slotBox(pill,1)},findVetBusy:{opacity:.6},findVetLabel:{...face(theme,"monoBold"),fontSize:PILL_LABEL_SIZE,lineHeight:PILL_LABEL_LINE},closeSlot:{position:"absolute",top:s.md,right:s.md},closeButton:{width:CLOSE_SIZE2,height:CLOSE_SIZE2,borderRadius:CLOSE_SIZE2/2,alignItems:"center",justifyContent:"center"},indicatorRow:{alignItems:"flex-end",paddingHorizontal:s.lg,paddingTop:2,paddingBottom:s.xs}})}function useChatPets(){let pets=useEverfurPets(),{handle:handle}=useEverfurContext(),setActivePet=react.useCallback(petRef=>handle.setActivePet(petRef),[handle]);return react.useMemo(()=>({...pets,setActivePet:setActivePet}),[pets,setActivePet])}function announceAnswered(){try{let announce=reactNative.AccessibilityInfo?.announceForAccessibility;typeof announce=="function"&&announce.call(reactNative.AccessibilityInfo,CHAT_COPY.answered)}catch{}}function useSettleAnnouncement(chat){let wasStreaming=react.useRef(false),scope=react.useRef({send:chat.send,id:chat.conversationId});react.useEffect(()=>{let previous=scope.current;if((previous.send!==chat.send||previous.id!==null&&previous.id!==chat.conversationId)&&(wasStreaming.current=false),scope.current={send:chat.send,id:chat.conversationId},wasStreaming.current&&!chat.isStreaming){let last=chat.messages[chat.messages.length-1];last!==void 0&&last.role==="assistant"&&announceAnswered()}wasStreaming.current=chat.isStreaming},[chat.isStreaming,chat.messages,chat.send,chat.conversationId])}var SPINNER_DELAY_MS=300,THANKS_VISIBLE_MS=3e3,MIN_SURFACE_HEIGHT=120,MIN_TOUCH_TARGET5=44,INPUT_MAX_HEIGHT=120,BUBBLE_MAX_WIDTH="88%",BUBBLE_MAX_WIDTH_CAP=520,HALF_STEP2=2,BUBBLE_EDGE_WIDTH=.5,BUBBLE_LEAD_USER=1.5,BUBBLE_LEAD_ASSISTANT=1.6,PENDING_OPACITY=.6,COMPOSER_MIN_HEIGHT=56,COMPOSER_BORDER_WIDTH=1.5,COMPOSER_PADDING_RIGHT=5,COMPOSER_PADDING_VERTICAL=5,INPUT_MIN_HEIGHT=36,INPUT_LINE_HEIGHT=20,APP_BODY_SIZE=14,SEND_CONTROL_SIZE=MIN_TOUCH_TARGET5,TEXT_ACTION_HIT_SLOP=4,SEND_GLYPH_SIZE=24,STOP_GLYPH_SIZE=22,SEND_DISABLED_OPACITY=.4,ATTACH_CONTROL_SIZE=MIN_TOUCH_TARGET5,ATTACH_GLYPH_SIZE=20,ATTACH_DISABLED_OPACITY=.4,EMPTY_MIN_HEIGHT=480,FOLLOW_UP_HEADING_SIZE=12,FOLLOW_UP_HEADING_TRACKING=.72,FOLLOW_UP_ROW_MIN_HEIGHT=48,RULE_WIDTH=1,FOOTNOTE_SIZE=12,FOOTNOTE_LINE=18,EMPTY_PADDING_TOP="12%",ASSISTANT_AVATAR_SIZE=20;function useChatTheme(){let theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles11(theme),[theme]);return{theme:theme,styles:styles2}}function makeStyles11(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type,userLine=Math.round(t.size.body*BUBBLE_LEAD_USER),assistantLine=Math.round(t.size.body*BUBBLE_LEAD_ASSISTANT),inputLine=Math.round(INPUT_LINE_HEIGHT*t.size.body/APP_BODY_SIZE),rule=c.borderRingCream,slots=theme.slots;return reactNative.StyleSheet.create({container:{flex:1,minHeight:MIN_SURFACE_HEIGHT,backgroundColor:c.chatGround},body:{flex:1},centered:{minHeight:MIN_SURFACE_HEIGHT,flexGrow:1,alignItems:"center",justifyContent:"center",padding:s.xl},emptyContent:{flexGrow:1,alignItems:"stretch",justifyContent:"flex-start",paddingTop:EMPTY_PADDING_TOP,paddingHorizontal:s.lg,paddingBottom:s.lg,minHeight:EMPTY_MIN_HEIGHT,gap:s.lg},errorText:{...face(theme,"regular"),fontSize:t.size.subtitle,lineHeight:t.size.subtitle*t.lineHeight.snug,color:c.danger,textAlign:"center",marginBottom:s.md},retryButton:{minHeight:MIN_TOUCH_TARGET5,minWidth:MIN_TOUCH_TARGET5,alignItems:"center",justifyContent:"center",paddingHorizontal:s.xl,paddingVertical:s.sm,borderRadius:r.pill,backgroundColor:c.brand,...slotBox(slots.primaryButton)},retryLabel:{...face(theme,"medium"),color:c.onPrimary,fontSize:t.size.body,...slotText(slots.primaryButton)},setupNotice:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.sm,paddingHorizontal:s.lg,paddingVertical:s.sm,backgroundColor:c.surfaceCream},setupNoticeText:{...face(theme,"regular"),color:c.danger,fontSize:t.size.caption,flexShrink:1},turnNotice:{gap:s.xs,padding:s.md,borderRadius:r.lg,backgroundColor:c.surfaceCream,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:c.brandBorder,alignItems:"flex-start",...slotBox(slots.card,reactNative.StyleSheet.hairlineWidth)},turnNoticeError:{borderColor:c.danger},turnNoticeTitle:{...headingFace(theme,"bold"),color:c.text.primary,fontSize:t.size.body,...slotText(slots.card)},turnNoticeTitleError:{color:c.danger},turnNoticeBody:{...face(theme,"regular"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,...slotText(slots.card)},turnNoticeAction:{minHeight:MIN_TOUCH_TARGET5,justifyContent:"center"},turnNoticeActionLabel:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.body},setupNoticeAction:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.caption},reconnectingCaption:{...face(theme,"medium"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,textTransform:"uppercase",letterSpacing:.5},readingLine:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.bodyTight,lineHeight:Math.round(t.size.bodyTight*t.lineHeight.relaxed)},list:{flex:1},listContent:{padding:s.lg,gap:s.xl},rowBlock:{gap:s.sm},rowBlockUser:{},rowBlockAssistant:{paddingRight:s.xl},row:{flexDirection:"row"},rowUser:{justifyContent:"flex-end"},rowAssistant:{justifyContent:"flex-start"},bubble:{maxWidth:BUBBLE_MAX_WIDTH,alignItems:"flex-start"},bubbleSideUser:{alignItems:"flex-end"},bubbleUser:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP2,backgroundColor:c.bubbleUser,...c.primaryEdge!==c.primary&&c.bubbleUser===c.primary?{borderWidth:BUBBLE_EDGE_WIDTH,borderColor:c.primaryEdge}:{},borderRadius:r.lg,borderBottomRightRadius:r.xs,...slotBox(slots.userBubble,BUBBLE_EDGE_WIDTH)},bubbleAssistant:slots.assistantBubble?.backgroundColor===void 0?{...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)}:{paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP2,borderRadius:r.lg,...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)},bubbleVet:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP2,backgroundColor:c.bubbleVet,borderRadius:r.lg,borderTopLeftRadius:r.xs,...slotBox(slots.vetBubble,BUBBLE_EDGE_WIDTH)},bubblePending:{opacity:PENDING_OPACITY},bubbleTextUser:{...face(theme,"regular"),color:c.onPrimary,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.userBubble)},bubbleTextAssistant:{...face(theme,"regular"),color:c.text.primary,fontSize:t.size.body,lineHeight:assistantLine,...slotText(slots.assistantBubble)},bubbleTextVet:{...face(theme,"regular"),color:c.onBubbleVet,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.vetBubble)},assistantName:{...face(theme,"bold"),color:c.brandInk,fontSize:t.size.bodyTight,marginBottom:s.xs},assistantSender:{flexDirection:"row",alignItems:"center",gap:s.sm,marginBottom:s.xs},assistantAvatar:{width:ASSISTANT_AVATAR_SIZE,height:ASSISTANT_AVATAR_SIZE,borderRadius:ASSISTANT_AVATAR_SIZE/2},assistantNameInRow:{marginBottom:0},vetHeader:{flexDirection:"row",alignItems:"baseline",gap:s.sm,marginBottom:s.xs},vetSender:{...face(theme,"bold"),color:c.text.primary,fontSize:t.size.bodyTight},vetTime:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.caption},bubbleBold:face(theme,"bold"),bubbleItalic:{fontStyle:"italic"},bubbleCode:face(theme,"mono"),followUps:{alignSelf:"stretch",marginTop:s.md},followUpsHeading:{...face(theme,"monoBold"),color:c.text.muted,fontSize:FOLLOW_UP_HEADING_SIZE,textTransform:"uppercase",letterSpacing:FOLLOW_UP_HEADING_TRACKING,paddingBottom:s.sm,borderBottomWidth:RULE_WIDTH,borderBottomColor:rule},followUpSlot:{alignSelf:"stretch"},followUpSlotRuled:{borderTopWidth:RULE_WIDTH,borderTopColor:rule},followUpRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.md,minHeight:FOLLOW_UP_ROW_MIN_HEIGHT,paddingVertical:s.sm+HALF_STEP2,...slots.chip?.backgroundColor!==void 0||slots.chip?.borderColor!==void 0?{paddingHorizontal:s.md}:{},...slotBox(slots.chip)},followUpText:{...face(theme,"bold"),flex:1,color:c.brandInk,fontSize:t.size.bodyTight,...slotText(slots.chip)},composerOuter:{position:"relative"},composer:{marginHorizontal:s.md,marginTop:s.xs,minHeight:COMPOSER_MIN_HEIGHT,justifyContent:"center",paddingLeft:s.sm,paddingRight:COMPOSER_PADDING_RIGHT,paddingVertical:COMPOSER_PADDING_VERTICAL,backgroundColor:c.composerFill,borderWidth:COMPOSER_BORDER_WIDTH,borderColor:c.composerBorder,borderRadius:r.pill,...slotBox(slots.composerInput,COMPOSER_BORDER_WIDTH)},composerRow:{flexDirection:"row",alignItems:"center",gap:s.xs,minHeight:INPUT_MIN_HEIGHT},attachControl:{width:ATTACH_CONTROL_SIZE,height:ATTACH_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},attachControlDisabled:{opacity:ATTACH_DISABLED_OPACITY},input:{flex:1,minHeight:INPUT_MIN_HEIGHT,maxHeight:INPUT_MAX_HEIGHT,paddingHorizontal:0,paddingVertical:0,...face(theme,"regular"),fontSize:t.size.body,lineHeight:inputLine,color:c.text.primary,...slotText(slots.composerInput)},sendControl:{minHeight:SEND_CONTROL_SIZE,minWidth:SEND_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},sendDisc:{width:SEND_CONTROL_SIZE,height:SEND_CONTROL_SIZE,borderRadius:SEND_CONTROL_SIZE/2,alignItems:"center",justifyContent:"center",...slotBox(slots.sendButton)},sendControlDisabled:{opacity:SEND_DISABLED_OPACITY},footnote:{...face(theme,"regular"),color:c.text.muted,fontSize:FOOTNOTE_SIZE,lineHeight:FOOTNOTE_LINE,textAlign:"center",marginTop:s.sm,marginBottom:s.xs,paddingHorizontal:s.lg},poweredBy:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.micro,textAlign:"center",paddingBottom:s.xs}})}var LIVE=/* @__PURE__ */Object.freeze({kind:"live"}),FOLDED=/* @__PURE__ */Object.freeze({kind:"folded"});function askOf(message){if(message.role!=="assistant"||message.checkin===void 0)return null;let caseId=message.checkin.caseId,origin=parseCheckinOrigin(message.proactiveOriginRef);return{caseId:caseId,dueDay:origin!==null&&origin.caseId===caseId?origin.dueDay:""}}function placeCheckins(messages){let placements=/* @__PURE__ */new Map,newestByCase=/* @__PURE__ */new Map;for(let message of messages){let ask=askOf(message);if(ask===null)continue;let current=newestByCase.get(ask.caseId);(current===void 0||ask.dueDay>=current.dueDay)&&newestByCase.set(ask.caseId,{messageId:message.id,dueDay:ask.dueDay})}if(newestByCase.size===0)return placements;let leader=null;for(let message of messages){let ask=askOf(message);if(ask===null){leader=null;continue}if(newestByCase.get(ask.caseId)?.messageId===message.id){placements.set(message.id,LIVE),leader=null;continue}if(leader!==null&&leader.caseId===ask.caseId){leader.days.push(ask.dueDay),placements.set(message.id,FOLDED);continue}let days=[ask.dueDay];leader={id:message.id,caseId:ask.caseId,days:days},placements.set(message.id,{kind:"past",runDueDays:days})}return placements}var MS_PER_DAY=864e5,MAX_WATCH_DAY=365;function checkinDayNumber(openedAtIso,dueDay){if(typeof openedAtIso!="string"||typeof dueDay!="string")return null;let opened=Date.parse(openedAtIso),due=Date.parse(dueDay);if(Number.isNaN(opened)||Number.isNaN(due))return null;let elapsed=Math.floor(due/MS_PER_DAY)-Math.floor(opened/MS_PER_DAY);return elapsed<1||elapsed>MAX_WATCH_DAY?null:elapsed}function checkinDueDay(message){return askOf(message)?.dueDay||null}function formatMessageTime(createdAt){if(!createdAt)return null;let parsed=new Date(createdAt);return Number.isNaN(parsed.getTime())?null:parsed.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function AssistantSender({avatarUrl:avatarUrl,named:named,styles:styles2}){let image=useBrandImage(avatarUrl);return image.shown?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.assistantSender,testID:"everfur-assistant-sender",children:[
|
|
263
263
|
/* @__PURE__ */jsxRuntime.jsx(BrandImage,{uri:avatarUrl,decorative:true,style:styles2.assistantAvatar,resizeMode:"cover",onError:image.onError,testID:"everfur-assistant-avatar"}),named?/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:[styles2.assistantName,styles2.assistantNameInRow],children:CHAT_COPY.assistantName}):null]}):named?/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles2.assistantName,children:CHAT_COPY.assistantName}):null}var CHECKIN_COPY=/* @__PURE__ */Object.freeze({eyebrow:"Checking in",logged:"Logged",findVet:"Find a vet now",day:"Day {day}",daySeparator:" · ",answers:/* @__PURE__ */Object.freeze({better:"Better",same:"Same",worse:"Worse"})}),CHECKIN_OPTIONS=/* @__PURE__ */Object.freeze(CHECKIN_ANSWERS.map(answer=>/* @__PURE__ */Object.freeze({answer:answer,label:CHECKIN_COPY.answers[answer]})));function useCheckinCard(checkin,answerCheckin){let[pending,setPending]=react.useState(null),[error,setError]=react.useState(null),[tapped,setTapped]=react.useState(null),choose=react.useCallback(answer2=>{answerCheckin!==null&&(setPending(answer2),setError(null),answerCheckin(checkin.caseId,answer2).then(result=>{setPending(null),result.ok?setTapped(answer2):setError(result.error)}))},[answerCheckin,checkin.caseId]),answer=tapped??checkin.answer;return{answer:answer,answerable:!isCheckinSettled(checkin),escalated:answer==="worse",pending:pending,error:error,choose:choose}}var MIN_TOUCH_TARGET6=44,PENDING_OPACITY2=.6;function CheckinCard({message:message,checkin:checkin,onAnswer:onAnswer,petRef:petRef,onFindVet:onFindVet,vet:vet,onLayout:onLayout}){let theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles12(theme),[theme]),state=useCheckinCard(checkin,onAnswer),settled=state.answer!==null||state.pending!==null,answerable=onAnswer!==null&&state.answerable,day=checkinDayNumber(checkin.openedAt,checkinDueDay(message));/* @__PURE__ */
|
|
264
264
|
return jsxRuntime.jsxs(reactNative.View,{style:styles2.card,accessibilityLabel:CHECKIN_COPY.eyebrow,onLayout:onLayout,children:[
|
|
265
265
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.head,children:[
|
|
@@ -328,8 +328,8 @@ return jsxRuntime.jsxs(reactNative.KeyboardAvoidingView,{style:[styles2.containe
|
|
|
328
328
|
/* @__PURE__ */jsxRuntime.jsx(EverfurTelevetHost,{})]})}function PetSetupNotice({petRef:petRef,pet:pet,onRegistered:onRegistered}){let{styles:styles2}=useChatTheme(),setup=useChatPetRegistration(petRef,pet,onRegistered);return setup.status!=="failed"||setup.error===null?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.setupNotice,accessible:true,accessibilityRole:"alert",children:[
|
|
329
329
|
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:styles2.setupNoticeText,children:setup.error.displayMessage}),
|
|
330
330
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:setup.retry,accessibilityRole:"button",accessibilityLabel:CHAT_COPY.retry,hitSlop:TEXT_ACTION_HIT_SLOP,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles2.setupNoticeAction,children:CHAT_COPY.retry})})]})}function ComposerWithAttachments({attachments:attachments,...rest}){let transport=react.useMemo(()=>createRnChatAttachmentTransport(),[]),state=useChatAttachments({maxPerMessage:attachments.maxPerMessage??DEFAULT_MAX_PER_MESSAGE,transport:transport}),bound=react.useMemo(()=>({state:state,sources:attachments.sources??DEFAULT_SOURCES,pick:attachments.pick}),[state,attachments.sources,attachments.pick]);/* @__PURE__ */
|
|
331
|
-
return jsxRuntime.jsx(Composer,{...rest,attachments:bound})}function Composer({send:send,stop:stop,isStreaming:isStreaming,conversationId:conversationId,attachments:attachments,seed:seed,draftStore:draftStore,onStage:onStage,onPreview:onPreview,petName:petName}){let{theme:theme,styles:styles2}=useChatTheme(),motion=useChatMotion(),[draft,setDraft]=useChatDraft(send,conversationId,seed);usePersistedDraft(draftStore,conversationId===null?null:String(conversationId),draft,setDraft);let[pickerOpen,setPickerOpen]=react.useState(false),[pickFailed,setPickFailed]=react.useState(false);react.useEffect(()=>{setPickFailed(false)},[conversationId]);let placeholder=theme.meta.placeholder??forPet(CHAT_COPY.placeholder,petName),uploading=attachments?.state.uploading??false,uploadFailed=attachments?.state.failed??false,sendBlocked=uploading||uploadFailed,rows=attachments?.state.attachments??NO_ROWS;useAnimateLayoutOn(rows.length,motion);let onSend=react.useCallback(()=>{
|
|
331
|
+
return jsxRuntime.jsx(Composer,{...rest,attachments:bound})}function Composer({send:send,stop:stop,isStreaming:isStreaming,conversationId:conversationId,attachments:attachments,seed:seed,draftStore:draftStore,onStage:onStage,onPreview:onPreview,petName:petName}){let{theme:theme,styles:styles2}=useChatTheme(),motion=useChatMotion(),[draft,setDraft]=useChatDraft(send,conversationId,seed);usePersistedDraft(draftStore,conversationId===null?null:String(conversationId),draft,setDraft);let[pickerOpen,setPickerOpen]=react.useState(false),[pickFailed,setPickFailed]=react.useState(false);react.useEffect(()=>{setPickFailed(false)},[conversationId]);let placeholder=theme.meta.placeholder??forPet(CHAT_COPY.placeholder,petName),uploading=attachments?.state.uploading??false,uploadFailed=attachments?.state.failed??false,sendBlocked=uploading||uploadFailed,rows=attachments?.state.attachments??NO_ROWS;useAnimateLayoutOn(rows.length,motion);let onSend=react.useCallback(()=>{let text3=draft.trim();if(text3.length===0||sendBlocked||[...text3].length>MESSAGE_MAX_CHARS)return;let keys=attachments?.state.s3Keys??NO_KEYS;attachments!==null&&keys.length>0?(onStage(attachments.state.attachments.filter(row=>row.status==="uploaded").map(row=>({uri:row.previewUri,filename:row.filename}))),send(text3,{imageS3Keys:keys}),attachments.state.clear()):send(text3),setDraft(""),setPickFailed(false)},[draft,send,sendBlocked,attachments,onStage]),onStop=react.useCallback(()=>{stop()},[stop]),pickFrom=react.useCallback(source=>{setPickerOpen(false),attachments!==null&&(setPickFailed(false),attachments.state.dismissRejected(),callHostAsync(attachments.pick,source).then(outcome=>{if(!outcome.ok){setPickFailed(true);return}outcome.value!==null&&attachments.state.add(outcome.value)}))},[attachments]),sendDisabled=react.useMemo(()=>[...draft.trim()].length>MESSAGE_MAX_CHARS,[draft])||sendBlocked,slotsFull=attachments!==null&&rows.length>=attachments.state.maxPerMessage,sendInk=theme.slots.sendButton?.textColor??theme.color.brandInk;/* @__PURE__ */
|
|
332
332
|
return jsxRuntime.jsxs(reactNative.View,{style:styles2.composerOuter,children:[attachments!==null&&pickerOpen?/* @__PURE__ */jsxRuntime.jsx(AttachmentPickerPopover,{sources:attachments.sources,full:slotsFull,onPick:pickFrom,onClose:()=>setPickerOpen(false)}):null,
|
|
333
333
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.composer,children:[attachments!==null?/* @__PURE__ */jsxRuntime.jsx(AttachmentStrip,{attachments:rows,rejected:pickFailed?PICK_FAILED:attachments.state.rejected,uploadFailed:uploadFailed,onRetry:attachments.state.retry,onRemove:attachments.state.remove,onPreview:row=>onPreview({uri:row.previewUri,label:row.filename})}):null,
|
|
334
334
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.composerRow,children:[attachments!==null?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:slotsFull?attachControlLabel(rows.length,attachments.state.maxPerMessage):CHAT_COPY.attachPhotoOrFileNative,accessibilityState:{disabled:slotsFull,expanded:pickerOpen},disabled:slotsFull,style:[styles2.attachControl,slotsFull?styles2.attachControlDisabled:null],onPress:()=>setPickerOpen(open=>!open),children:/* @__PURE__ */jsxRuntime.jsx(UploadGlyph,{size:ATTACH_GLYPH_SIZE,color:slotsFull?theme.color.text.muted:theme.color.brandInk,strokeWidth:1.75})}):null,
|
|
335
|
-
/* @__PURE__ */jsxRuntime.jsx(TextInput,{style:styles2.input,value:draft,onChangeText:setDraft,placeholder:placeholder,placeholderTextColor:theme.slots.composerInput?.textColor??theme.color.text.placeholder,accessibilityLabel:CHAT_COPY.composerLabel,onSubmitEditing:onSend,returnKeyType:"send",blurOnSubmit:false,multiline:true,editable:true}),isStreaming?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onStop,accessibilityRole:"button",accessibilityLabel:CHAT_COPY.stop,style:styles2.sendControl,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.sendDisc,testID:"everfur-stop-disc",children:/* @__PURE__ */jsxRuntime.jsx(StopGlyph,{size:STOP_GLYPH_SIZE,color:sendInk,testID:"everfur-stop-glyph"})})}):/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onSend,disabled:sendDisabled,accessibilityRole:"button",accessibilityLabel:CHAT_COPY.send,accessibilityState:{disabled:sendDisabled,busy:uploading},style:[styles2.sendControl,sendDisabled?styles2.sendControlDisabled:null],children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.sendDisc,testID:"everfur-send-disc",children:/* @__PURE__ */jsxRuntime.jsx(SendGlyph,{size:SEND_GLYPH_SIZE,color:sendInk,testID:"everfur-send-glyph"})})})]})]})]})}var NO_ROWS=/* @__PURE__ */Object.freeze([]),NO_KEYS=/* @__PURE__ */Object.freeze([]),PICK_FAILED=/* @__PURE__ */Object.freeze({code:"unknown",retryable:true,filename:""});exports.EverfurChat=EverfurChat;exports.createRnChatAttachmentTransport=createRnChatAttachmentTransport;exports.useChatAttachments=useChatAttachments;exports.useEverfurChat=useEverfurChat;exports.useEverfurPets=useEverfurPets;
|
|
335
|
+
/* @__PURE__ */jsxRuntime.jsx(TextInput,{style:styles2.input,value:draft,onChangeText:setDraft,placeholder:placeholder,placeholderTextColor:theme.slots.composerInput?.textColor??theme.color.text.placeholder,accessibilityLabel:CHAT_COPY.composerLabel,onSubmitEditing:onSend,returnKeyType:"send",...SUBMIT_ON_RETURN,blurOnSubmit:false,multiline:true,editable:true}),isStreaming?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onStop,accessibilityRole:"button",accessibilityLabel:CHAT_COPY.stop,style:styles2.sendControl,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.sendDisc,testID:"everfur-stop-disc",children:/* @__PURE__ */jsxRuntime.jsx(StopGlyph,{size:STOP_GLYPH_SIZE,color:sendInk,testID:"everfur-stop-glyph"})})}):/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onSend,disabled:sendDisabled,accessibilityRole:"button",accessibilityLabel:CHAT_COPY.send,accessibilityState:{disabled:sendDisabled,busy:uploading},style:[styles2.sendControl,sendDisabled?styles2.sendControlDisabled:null],children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.sendDisc,testID:"everfur-send-disc",children:/* @__PURE__ */jsxRuntime.jsx(SendGlyph,{size:SEND_GLYPH_SIZE,color:sendInk,testID:"everfur-send-glyph"})})})]})]})]})}var NO_ROWS=/* @__PURE__ */Object.freeze([]),NO_KEYS=/* @__PURE__ */Object.freeze([]),SUBMIT_ON_RETURN=/* @__PURE__ */Object.freeze({submitBehavior:"submit"}),PICK_FAILED=/* @__PURE__ */Object.freeze({code:"unknown",retryable:true,filename:""});exports.EverfurChat=EverfurChat;exports.createRnChatAttachmentTransport=createRnChatAttachmentTransport;exports.useChatAttachments=useChatAttachments;exports.useEverfurChat=useEverfurChat;exports.useEverfurPets=useEverfurPets;
|
package/dist/chat/index.d.cts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { C as ChatFeedbackReason, a as ChatFeedbackReasonOption, b as ChatSentiment, E as EverfurChatDraftStore, L as LifecyclePort, U as UrgencyDisplayLevel, c as UseChatAttachmentsOptions, d as UseChatAttachmentsState, e as UseEverfurChatState, f as UseEverfurPetsState, u as useChatAttachments, g as useEverfurChat, h as useEverfurPets } from '../attachments-
|
|
2
|
-
export { A as AttachmentSource, E as EverfurChat, a as EverfurChatAttachments, b as EverfurChatProps, R as RenderVetAction } from '../Chat-
|
|
1
|
+
export { C as ChatFeedbackReason, a as ChatFeedbackReasonOption, b as ChatSentiment, E as EverfurChatDraftStore, L as LifecyclePort, U as UrgencyDisplayLevel, c as UseChatAttachmentsOptions, d as UseChatAttachmentsState, e as UseEverfurChatState, f as UseEverfurPetsState, u as useChatAttachments, g as useEverfurChat, h as useEverfurPets } from '../attachments-HXFmzk-D.cjs';
|
|
2
|
+
export { A as AttachmentSource, E as EverfurChat, a as EverfurChatAttachments, b as EverfurChatProps, R as RenderVetAction } from '../Chat-B7oN62ww.cjs';
|
|
3
3
|
import { U as UploadTransport } from '../ports-BN6RHF9W.cjs';
|
|
4
|
-
export { C as ChatCheckin, a as ChatCheckinTarget, b as ChatConversation, c as ChatConversationListOptions, d as ChatConversationPage, e as ChatFeedbackReceipt, f as ChatFeedbackType, g as ChatHistoryOptions, h as ChatMessagePage } from '../ports-
|
|
5
|
-
export { C as CheckinAnswer, a as CheckinOutcome, W as WatchCase } from '../casesRepository-
|
|
6
|
-
export { P as EverfurChatPet, W as WidgetPet } from '../petsRepository-
|
|
7
|
-
export { A as AttachmentError, a as AttachmentErrorCode, b as AttachmentOutcome, c as AttachmentQueue, d as AttachmentState, e as AttachmentStatus } from '../attachments-
|
|
8
|
-
import '../EverfurError-
|
|
9
|
-
import '../EverfurResult-
|
|
4
|
+
export { C as ChatCheckin, a as ChatCheckinTarget, b as ChatConversation, c as ChatConversationListOptions, d as ChatConversationPage, e as ChatFeedbackReceipt, f as ChatFeedbackType, g as ChatHistoryOptions, h as ChatMessagePage } from '../ports-DibY-h60.cjs';
|
|
5
|
+
export { C as CheckinAnswer, a as CheckinOutcome, W as WatchCase } from '../casesRepository-DFoK5N1O.cjs';
|
|
6
|
+
export { P as EverfurChatPet, W as WidgetPet } from '../petsRepository-CQgzEFyz.cjs';
|
|
7
|
+
export { A as AttachmentError, a as AttachmentErrorCode, b as AttachmentOutcome, c as AttachmentQueue, d as AttachmentState, e as AttachmentStatus } from '../attachments-CkaPnIUw.cjs';
|
|
8
|
+
import '../EverfurError-DeBqRpQV.cjs';
|
|
9
|
+
import '../EverfurResult-COlXj1wq.cjs';
|
|
10
10
|
import '../ids-B2GAAifq.cjs';
|
|
11
|
-
import '../config-
|
|
11
|
+
import '../config-u6rK4mKt.cjs';
|
|
12
12
|
import 'react';
|
|
13
13
|
import 'react-native';
|
|
14
|
-
import '../identity-
|
|
15
|
-
import '../requestFunnel-
|
|
16
|
-
import '../ErrorPolicyPort-
|
|
14
|
+
import '../identity-CUynm8S2.cjs';
|
|
15
|
+
import '../requestFunnel-nmhlEdbM.cjs';
|
|
16
|
+
import '../ErrorPolicyPort-10s3HJCt.cjs';
|
|
17
17
|
import '../TelemetryPort-BDNr00hu.cjs';
|
|
18
18
|
import '../profile-CSs1wlXT.cjs';
|
|
19
19
|
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { C as ChatFeedbackReason, a as ChatFeedbackReasonOption, b as ChatSentiment, E as EverfurChatDraftStore, L as LifecyclePort, U as UrgencyDisplayLevel, c as UseChatAttachmentsOptions, d as UseChatAttachmentsState, e as UseEverfurChatState, f as UseEverfurPetsState, u as useChatAttachments, g as useEverfurChat, h as useEverfurPets } from '../attachments-
|
|
2
|
-
export { A as AttachmentSource, E as EverfurChat, a as EverfurChatAttachments, b as EverfurChatProps, R as RenderVetAction } from '../Chat-
|
|
1
|
+
export { C as ChatFeedbackReason, a as ChatFeedbackReasonOption, b as ChatSentiment, E as EverfurChatDraftStore, L as LifecyclePort, U as UrgencyDisplayLevel, c as UseChatAttachmentsOptions, d as UseChatAttachmentsState, e as UseEverfurChatState, f as UseEverfurPetsState, u as useChatAttachments, g as useEverfurChat, h as useEverfurPets } from '../attachments-DN2cNGwe.js';
|
|
2
|
+
export { A as AttachmentSource, E as EverfurChat, a as EverfurChatAttachments, b as EverfurChatProps, R as RenderVetAction } from '../Chat-Cugs9Dsl.js';
|
|
3
3
|
import { U as UploadTransport } from '../ports-BN6RHF9W.js';
|
|
4
|
-
export { C as ChatCheckin, a as ChatCheckinTarget, b as ChatConversation, c as ChatConversationListOptions, d as ChatConversationPage, e as ChatFeedbackReceipt, f as ChatFeedbackType, g as ChatHistoryOptions, h as ChatMessagePage } from '../ports-
|
|
5
|
-
export { C as CheckinAnswer, a as CheckinOutcome, W as WatchCase } from '../casesRepository-
|
|
6
|
-
export { P as EverfurChatPet, W as WidgetPet } from '../petsRepository-
|
|
7
|
-
export { A as AttachmentError, a as AttachmentErrorCode, b as AttachmentOutcome, c as AttachmentQueue, d as AttachmentState, e as AttachmentStatus } from '../attachments-
|
|
8
|
-
import '../EverfurError-
|
|
9
|
-
import '../EverfurResult-
|
|
4
|
+
export { C as ChatCheckin, a as ChatCheckinTarget, b as ChatConversation, c as ChatConversationListOptions, d as ChatConversationPage, e as ChatFeedbackReceipt, f as ChatFeedbackType, g as ChatHistoryOptions, h as ChatMessagePage } from '../ports-Cu_Wc5Aw.js';
|
|
5
|
+
export { C as CheckinAnswer, a as CheckinOutcome, W as WatchCase } from '../casesRepository-qAkKKgji.js';
|
|
6
|
+
export { P as EverfurChatPet, W as WidgetPet } from '../petsRepository-RGI_xPK1.js';
|
|
7
|
+
export { A as AttachmentError, a as AttachmentErrorCode, b as AttachmentOutcome, c as AttachmentQueue, d as AttachmentState, e as AttachmentStatus } from '../attachments-20X7Vuip.js';
|
|
8
|
+
import '../EverfurError-DeBqRpQV.js';
|
|
9
|
+
import '../EverfurResult-ClPTS0P2.js';
|
|
10
10
|
import '../ids-B2GAAifq.js';
|
|
11
|
-
import '../config-
|
|
11
|
+
import '../config-BB7e52FP.js';
|
|
12
12
|
import 'react';
|
|
13
13
|
import 'react-native';
|
|
14
|
-
import '../identity-
|
|
15
|
-
import '../requestFunnel-
|
|
16
|
-
import '../ErrorPolicyPort-
|
|
14
|
+
import '../identity-D5uywCtp.js';
|
|
15
|
+
import '../requestFunnel-BkSFsLKh.js';
|
|
16
|
+
import '../ErrorPolicyPort-C3nNSS_j.js';
|
|
17
17
|
import '../TelemetryPort-BDNr00hu.js';
|
|
18
18
|
import '../profile-CSs1wlXT.js';
|
|
19
19
|
|