@everfur/sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -4
- package/README.md +6 -1
- package/dist/{Chat-DwAC2vhB.d.ts → Chat-BZZ-Py5l.d.ts} +3 -3
- package/dist/{Chat-DPUD6dnc.d.cts → Chat-Dq4fffIO.d.cts} +3 -3
- package/dist/{DepthViews-DNEM96Se.d.ts → DepthViews-BG3E25MD.d.ts} +1 -1
- package/dist/{DepthViews-DP0R-DhB.d.cts → DepthViews-B_hIypI6.d.cts} +1 -1
- package/dist/{DepthViews-DbFhR4Du.d.cts → DepthViews-CL75jyRA.d.cts} +1 -1
- package/dist/{DepthViews-D_3hl4xk.d.ts → DepthViews-CkYri51q.d.ts} +1 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -1
- package/dist/{attachments-CQgFrEQ7.d.cts → attachments-BorG422I.d.cts} +2 -2
- package/dist/{attachments-5NeobOCd.d.ts → attachments-BrUWQYNK.d.ts} +5 -4
- package/dist/{attachments-D8T5re7e.d.cts → attachments-D_SECjr1.d.cts} +5 -4
- package/dist/{attachments-Bw3iMQgu.d.ts → attachments-DpldrvIW.d.ts} +2 -2
- package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
- package/dist/bookingCopy-SREvkG19.d.cts +732 -0
- package/dist/{entitlementRepository-DSbzuyAW.d.ts → branding-CsRdeNwK.d.cts} +1 -133
- package/dist/{entitlementRepository-DKdXFgTo.d.cts → branding-CsRdeNwK.d.ts} +1 -133
- package/dist/callCopy-DoQKG3-L.d.cts +40 -0
- package/dist/callCopy-DoQKG3-L.d.ts +40 -0
- package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
- package/dist/casesRepository-v6QczS9N.d.ts +51 -0
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.d.cts +9 -8
- package/dist/chat/index.d.ts +9 -8
- package/dist/chat/index.js +1 -1
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.d.cts +10 -8
- package/dist/client/index.d.ts +10 -8
- package/dist/client/index.js +5 -5
- package/dist/{config-CzTZGlfF.d.cts → config--Wu1Umhd.d.cts} +2 -2
- package/dist/{config-DW60uRb9.d.ts → config-C7eb_IMD.d.ts} +2 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +1 -1
- package/dist/{context-XvTzq1tE.d.cts → context-CL3lyuy1.d.cts} +6 -6
- package/dist/{context-DXhqHlPU.d.ts → context-CahAEha8.d.ts} +6 -6
- package/dist/{copy-Mjoo91aS.d.ts → copy-DdVFDL01.d.ts} +2 -2
- package/dist/{copy-bKDNigLb.d.cts → copy-UeUJVk8X.d.cts} +2 -2
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +118 -29
- package/dist/core/index.d.ts +118 -29
- package/dist/core/index.js +7 -7
- package/dist/{depth-CErXCU8J.d.cts → depth-D5HwcvKC.d.cts} +34 -3
- package/dist/{depth-DjDcJ6kH.d.ts → depth-DvPwPuT_.d.ts} +34 -3
- package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
- package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
- package/dist/{identity-DI4eVx9S.d.cts → identity-C2-08BZW.d.cts} +2 -2
- package/dist/{identity-BMx2SUOM.d.ts → identity-CEi9GRFZ.d.ts} +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +6 -6
- package/dist/notifications/index.cjs +2 -2
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +2 -2
- package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
- package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
- package/dist/{pets-CtQdRpWo.d.ts → pets-DJv2sj2H.d.ts} +1 -1
- package/dist/{pets-aB8q0JyX.d.cts → pets-JVCXgRgR.d.cts} +1 -1
- package/dist/{casesRepository-DHwtGRYY.d.cts → petsRepository-B_gKbAzJ.d.cts} +2 -48
- package/dist/{casesRepository-ClLv6qMl.d.ts → petsRepository-Bk6GDwLs.d.ts} +2 -48
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +1 -1
- package/dist/{ports-DEBzEhbp.d.cts → ports-BY2ph0_y.d.cts} +5 -15
- package/dist/{ports-DMolTRzU.d.ts → ports-D7YW8qz9.d.ts} +5 -15
- package/dist/records/depth/index.cjs +2 -2
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +2 -2
- package/dist/records/index.cjs +3 -3
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +3 -3
- package/dist/{requestFunnel-L-BQfi0z.d.cts → requestFunnel-BjDpqqvm.d.cts} +25 -2
- package/dist/{requestFunnel-CjW7uDuA.d.ts → requestFunnel-DFMGcluw.d.ts} +25 -2
- package/dist/{runtime-B8s-_hv8.d.cts → runtimeTypes-gZEJu-da.d.cts} +9 -99
- package/dist/{runtime-BR9ysG0J.d.ts → runtimeTypes-w5KqBMcs.d.ts} +9 -99
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.cjs +1 -0
- package/dist/televet/booking/index.d.cts +294 -0
- package/dist/televet/booking/index.d.ts +294 -0
- package/dist/televet/booking/index.js +1 -0
- package/dist/televet/call/index.cjs +1 -0
- package/dist/televet/call/index.d.cts +141 -0
- package/dist/televet/call/index.d.ts +141 -0
- package/dist/televet/call/index.js +1 -0
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.d.cts +87 -5
- package/dist/televet/index.d.ts +87 -5
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +2 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +9 -8
- package/dist/testing/rn/index.d.ts +9 -8
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +9 -8
- package/dist/testing/web/index.d.ts +9 -8
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-DZed6dAM.d.ts → timelineRows-C15jxFFH.d.ts} +1 -1
- package/dist/{timelineRows-CaohZzXS.d.cts → timelineRows-odO8g9r2.d.cts} +1 -1
- package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
- package/dist/typeStyle-DmoyacDG.d.ts +111 -0
- package/dist/{useRecordsDepth-BHBzJ76R.d.cts → useRecordsDepth-C6rjEaLn.d.cts} +1 -1
- package/dist/{useRecordsDepth-BU-OhzH6.d.ts → useRecordsDepth-crhBllQK.d.ts} +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view-DtSPYpKa.d.ts → view-Bxwxp4xD.d.ts} +2 -2
- package/dist/{view-C3qPIXGX.d.cts → view-DyitEO0m.d.cts} +2 -2
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +1 -1
- package/dist/web/index.cjs +7 -7
- package/dist/web/index.d.cts +18 -17
- package/dist/web/index.d.ts +18 -17
- package/dist/web/index.js +7 -7
- package/dist/web/notifications/index.cjs +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/notifications/index.js +2 -2
- package/dist/web/records/depth/index.cjs +2 -2
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/depth/index.js +2 -2
- package/dist/web/records/index.cjs +3 -3
- package/dist/web/records/index.d.cts +102 -11
- package/dist/web/records/index.d.ts +102 -11
- package/dist/web/records/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +1 -0
- package/dist/web/televet/booking/index.d.cts +349 -0
- package/dist/web/televet/booking/index.d.ts +349 -0
- package/dist/web/televet/booking/index.js +1 -0
- package/dist/web/televet/call/index.cjs +1 -0
- package/dist/web/televet/call/index.d.cts +142 -0
- package/dist/web/televet/call/index.d.ts +142 -0
- package/dist/web/televet/call/index.js +1 -0
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.d.cts +90 -4
- package/dist/web/televet/index.d.ts +90 -4
- package/dist/web/televet/index.js +1 -1
- package/package.json +72 -4
- package/televet/booking/package.json +8 -0
- package/televet/call/package.json +8 -0
- package/web/televet/booking/native-blocked.cjs +12 -0
- package/web/televet/booking/package.json +8 -0
- package/web/televet/call/native-blocked.cjs +12 -0
- package/web/televet/call/package.json +8 -0
- package/dist/typeStyle-0TydiZ1w.d.cts +0 -19
- package/dist/typeStyle-CWMsoe6b.d.ts +0 -19
package/dist/client/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use strict';var zod=require('zod');var at=Object.defineProperty;var t=(e,r)=>at(e,"name",{value:r,configurable:true});var Ae=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Ae.map(e=>e.wireCode));var st=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"}),_r=Object.freeze(Ae.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:st[e.wireCode]}))),lt=new Map(_r.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),ut=Object.freeze(["http_envelope",...[...new Set(_r.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function pe(e,r){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let o of [r??"http_envelope",...ut]){let i=lt.get(o+n);if(i)return i}}t(pe,"contractErrorFor");function dt(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}t(dt,"contractDocUrl");var vr=null;function Rr(e){return null}t(Rr,"publishedDocUrl");var xa=Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","unknown"]),wa=Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),ct=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Cr(e){return ct[e]}t(Cr,"categoryFor");function X(e){let r=pe(e);if(r)return r.normalized;let n=(e??"").trim().toUpperCase(),o=n.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(n.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}t(X,"fromWire");function Tr(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}t(Tr,"fromHttpStatus");var ft=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function z(e){return ft.has(e)}t(z,"isAutoRetryable");var pt=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function kr(e){return z(e)||pt.has(e)}t(kr,"isRetryableCode");function Oa(e,r=false){return r||z(e)}t(Oa,"shouldRetry");var yt=500,Ie=8e3,Sr=4;function Fr(e,r=Math.random){let n=Math.max(0,e),o=Math.min(yt*2**n,Ie);return Math.floor(r()*o)}t(Fr,"backoffDelayMs");function Aa(e){return e==="conversationNotFound"}t(Aa,"canRecreateOnNotFound");var mt=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Pe(e){return mt[e]}t(Pe,"userFacingError");function xr(e,r,n){Object.defineProperty(e,r,{value:n,enumerable:false,writable:false,configurable:false});}t(xr,"defineHidden");var gt=/^[a-z][a-z0-9_]{0,63}$/;function C(e,r){let n=pe(r?.wireCode,r?.wireEnvelope),o={code:e,category:Cr(e),retryable:r?.retryable??kr(e),displayMessage:Pe(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&>.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),n);return r?.wireMessage&&xr(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&xr(o,"raw",r.raw),Object.freeze(o)}t(C,"makeEverfurError");function T(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}t(T,"ok");function y(e){return Object.freeze({ok:false,error:e})}t(y,"err");function za(e){return e.ok}t(za,"isOk");function Ba(e){return !e.ok}t(Ba,"isErr");var ye=class ye extends Error{constructor(r){super(`${r.code}: ${r.displayMessage}`),this.name="EverfurThrownError",this.error=r,this.code=r.code,this.category=r.category,Object.setPrototypeOf(this,ye.prototype);}};t(ye,"EverfurThrownError");var De=ye;function ja(e){if(e.ok)return e.value;throw new De(e.error)}t(ja,"unwrap");var me=class me extends Error{constructor(r,n){super(n),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,me.prototype);}};t(me,"EverfurConfigError");var h=me;var bt="0.3.0",ht="react-native",Et="2026-09-19",wr="EVERFUR_API_BASE_URL";function ne(e,r){return Object.freeze({ok:false,failure:Object.freeze({reason:e,message:r})})}t(ne,"configFailure");function vt(e){let r=typeof e=="string"?e.trim():"";return r.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(r)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}t(vt,"checkPublishableKey");function _t(e,r){let n=vt(e?.publishableKey);if(n!==null)return Object.freeze({ok:false,failure:n});let o=e.publishableKey.trim(),i=Or(e.apiBaseUrl);if(!i.ok)return i;let a=e.contractVersion?.trim()||Et;return Object.freeze({ok:true,config:Object.freeze({publishableKey:o,apiBaseUrl:i.value,contractVersion:a,sdkVersion:bt,platform:r?.platform??ht,debug:e.debug===true})})}t(_t,"tryResolveClientConfig");function Ka(e,r){let n=_t(e,r);if(!n.ok)throw new h("invalid-argument",n.failure.message);return n.config}t(Ka,"resolveClientConfig");function Or(e){let r=e?.trim(),n=r&&r.length>0?r:wt(wr);return n?Ft(n):ne("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${wr}. The SDK never ships a hardcoded host.`)}t(Or,"tryResolveApiBaseUrl");function $a(e){let r=Or(e);if(!r.ok)throw new h("invalid-argument",r.failure.message);return r.value}t($a,"resolveApiBaseUrl");function Ar(e){return {"X-Everfur-SDK-Version":e.sdkVersion,"X-Everfur-SDK-Platform":e.platform,"X-Everfur-Contract":e.contractVersion}}t(Ar,"buildBaseHeaders");var Rt=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;function Ct(e){return e.slice(e.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}t(Ct,"hostOf");function Tt(e){return e.length===0||e.includes("@")?false:e.startsWith("[")&&e.endsWith("]")?true:!e.includes(":")}t(Tt,"isPrintableHost");function kt(e,r){let n=e.indexOf("://");return n<0||e.slice(n+3).includes("@")?false:Tt(r)}t(kt,"canEchoOrigin");function St(e,r){return `${e}://${r}`}t(St,"safeOrigin");function Ft(e){let r=e.trim(),n=Rt.exec(r);if(n===null||n[2]===void 0||n[2].length===0)return ne("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let o=(n[1]??"").toLowerCase(),i=Ct(n[2]);if(i.length===0)return ne("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let a=kt(r,i)?`: ${St(o,i)}`:"";if(o!=="https"){if(!(o==="http"&&xt(i)))return o==="http"?ne("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${a}`):ne("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${a}`)}let s=r.endsWith("/")?r.slice(0,-1):r;return Object.freeze({ok:true,value:s})}t(Ft,"normalizeBaseUrl");function xt(e){let r=e.toLowerCase();return r==="localhost"||r==="127.0.0.1"||r==="[::1]"||r==="::1"}t(xt,"isLoopbackHost");function wt(e){let n=globalThis.process?.env?.[e];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}t(wt,"readEnv");function Q(e){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>=55296&&n<=56319){let o=e.charCodeAt(r+1);if(!(o>=56320&&o<=57343))return true;r+=1;}else if(n>=56320&&n<=57343)return true}return false}t(Q,"hasLoneSurrogate");function B(e){return [...e].length}t(B,"serverLength");var Ir=128,Pr=128,Dr=/[\u0000-\u001F\u007F]/,Ot=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ja(e){let r=e,n=B(r);if(n===0||n>Pr)throw new h("invalid-argument",`petRef must be 1..${Pr} characters`);if(Dr.test(r))throw new h("invalid-argument","petRef must be printable (no control characters)");return r}t(Ja,"petRef");function Za(e){let r=e,n=B(r);if(n===0||n>Ir)throw new h("invalid-argument",`userRef must be 1..${Ir} characters`);if(r.includes("@"))throw new h("invalid-argument","userRef must not contain '@'");if(Dr.test(r))throw new h("invalid-argument","userRef must be printable (no control characters)");return r}t(Za,"userRef");function es(e){if(!Ot.test(e))throw new h("invalid-argument","conversationId must be a UUID");return e}t(es,"conversationId");function rs(e){return e}t(rs,"unsafePetRef");function ns(e){return e}t(ns,"unsafeUserRef");function ts(e){return e}t(ts,"unsafeConversationId");function os(e){return e}t(os,"unsafeResponseId");function is(e){return e}t(is,"unsafeClientId");function as(e){return e}t(as,"unsafeDocumentId");function ss(e){return e}t(ss,"unsafeJobId");function ls(e){return e}t(ls,"unsafeRecordsRequestId");function ps(e,r,n){let o=null,i=null,a=false,s=t(()=>i||(i=(async()=>{try{let l=await r(),u=typeof l=="string"?l:l?.token;if(typeof u!="string"||u.length===0)throw new h("invalid-argument","TokenProvider returned an empty token");return o=u,n?.(typeof l=="string"?null:At(l.expiresAt)),u}finally{i=null;}})(),i),"load");return {userRef:e,async currentToken(l){if(a)throw new h("not-initialized","This identity was cleared (sign-out); mint a new one.");return l?.forceRefresh&&(o=null),o!==null?o:s()},hasToken(){return !a&&o!==null},clear(){a=true,o=null;}}}t(ps,"createIdentityProvider");function At(e){if(e===void 0)return null;let r=typeof e=="number"?e<1e11?e*1e3:e:new Date(e).getTime();return Number.isFinite(r)?r:null}t(At,"expiryMs");function ys(){let e=new Uint8Array(16),r=globalThis.crypto;if(typeof r?.getRandomValues=="function")r.getRandomValues(e);else for(let o=0;o<e.length;o+=1)e[o]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=[];for(let o=0;o<e.length;o+=1)n.push(e[o].toString(16).padStart(2,"0"));return n.slice(0,4).join("")+"-"+n.slice(4,6).join("")+"-"+n.slice(6,8).join("")+"-"+n.slice(8,10).join("")+"-"+n.slice(10,16).join("")}t(ys,"newSessionId");function It(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}t(It,"authHeaders");function te(e,r){return {...e,headers:{...Pt(e.headers),...It(r)}}}t(te,"withAuthHeaders");function Pt(e){if(!e)return {};let r={};for(let[n,o]of Object.entries(e)){let i=n.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[n]=o);}return r}t(Pt,"stripAuthHeaders");async function Mr(e,r){if(r.mode==="anonymous")return r.transport.request(te(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let n;try{n=await r.identity.currentToken();}catch{return y(Me())}let o=await r.transport.request(te(e,{mode:"personalized",token:n,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return y(Me())}let a=await r.transport.request(te(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?y(Me(a.error.httpStatus)):a}t(Mr,"authedSend");function Me(e){return C("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}t(Me,"authRejectedError");function bs(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}t(bs,"assertNever");var Dt=Object.freeze([]),Mt=Object.freeze([]);function Nr(e,r,n=null){return Object.freeze({kind:"accepted",streamId:e,lastEventId:r,serverRequestId:n,terminal:false})}t(Nr,"acceptedFrame");function Lr(e,r=null){return Object.freeze({kind:"heartbeat",lastEventId:e,serverRequestId:r,terminal:false})}t(Lr,"heartbeatFrame");function zr(e,r,n=null){return Object.freeze({kind:"delta",delta:e,lastEventId:r,serverRequestId:n,terminal:false})}t(zr,"deltaFrame");function Br(e,r=null){return Object.freeze({kind:"done",terminal:true,conversationId:e.conversationId,messageId:e.messageId,title:e.title,followUpQuestions:Object.freeze([...e.followUpQuestions]),citations:Object.freeze([...e.citations]),citationStatus:e.citationStatus,urgencyLevel:e.urgencyLevel,urgencyReason:e.urgencyReason,urgencyProvided:e.urgencyProvided??e.urgencyLevel!==null,resultId:e.resultId,lastEventId:e.lastEventId,serverRequestId:r})}t(Br,"doneFrame");function D(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}t(D,"errorFrame");function jr(e,r,n=null){return Object.freeze({kind:"analysisStarted",requestId:e,lastEventId:r,serverRequestId:n,terminal:false})}t(jr,"analysisStartedFrame");function Ur(e,r=null){return Object.freeze({kind:"analysisComplete",terminal:false,resultId:e.resultId,analysisType:e.analysisType,modelVersion:e.modelVersion,confidence:e.confidence,detections:Object.freeze([...e.detections]),interpretation:e.interpretation,lastEventId:e.lastEventId,serverRequestId:r})}t(Ur,"analysisCompleteFrame");function qr(e,r,n=null){return Object.freeze({kind:"unknown",raw:{...e},lastEventId:r,serverRequestId:n,terminal:false})}t(qr,"unknownFrame");var hs=Object.freeze({strings:Dt,maps:Mt});var Hr=`
|
|
1
|
+
'use strict';var zod=require('zod');var ft=Object.defineProperty;var t=(e,r)=>ft(e,"name",{value:r,configurable:true});var Pe=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Pe.map(e=>e.wireCode));var pt=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"}),Tr=Object.freeze(Pe.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:pt[e.wireCode]}))),yt=new Map(Tr.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),mt=Object.freeze(["http_envelope",...[...new Set(Tr.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ge(e,r){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let o of [r??"http_envelope",...mt]){let i=yt.get(o+n);if(i)return i}}t(ge,"contractErrorFor");function gt(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}t(gt,"contractDocUrl");var Cr=null;function kr(e){return null}t(kr,"publishedDocUrl");var Oa=Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","unknown"]),Aa=Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),bt=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Sr(e){return bt[e]}t(Sr,"categoryFor");function X(e){let r=ge(e);if(r)return r.normalized;let n=(e??"").trim().toUpperCase(),o=n.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(n.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}t(X,"fromWire");function Fr(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}t(Fr,"fromHttpStatus");var ht=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function z(e){return ht.has(e)}t(z,"isAutoRetryable");var Et=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function xr(e){return z(e)||Et.has(e)}t(xr,"isRetryableCode");function Ia(e,r=false){return r||z(e)}t(Ia,"shouldRetry");var vt=500,De=8e3,wr=4;function Or(e,r=Math.random){let n=Math.max(0,e),o=Math.min(vt*2**n,De);return Math.floor(r()*o)}t(Or,"backoffDelayMs");function Pa(e){return e==="conversationNotFound"}t(Pa,"canRecreateOnNotFound");var _t=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Me(e){return _t[e]}t(Me,"userFacingError");function Ar(e,r,n){Object.defineProperty(e,r,{value:n,enumerable:false,writable:false,configurable:false});}t(Ar,"defineHidden");var Rt=/^[a-z][a-z0-9_]{0,63}$/;function C(e,r){let n=ge(r?.wireCode,r?.wireEnvelope),o={code:e,category:Sr(e),retryable:r?.retryable??xr(e),displayMessage:Me(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&&Rt.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),n);return r?.wireMessage&&Ar(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Ar(o,"raw",r.raw),Object.freeze(o)}t(C,"makeEverfurError");function k(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}t(k,"ok");function y(e){return Object.freeze({ok:false,error:e})}t(y,"err");function ja(e){return e.ok}t(ja,"isOk");function Ua(e){return !e.ok}t(Ua,"isErr");var be=class be extends Error{constructor(r){super(`${r.code}: ${r.displayMessage}`),this.name="EverfurThrownError",this.error=r,this.code=r.code,this.category=r.category,Object.setPrototypeOf(this,be.prototype);}};t(be,"EverfurThrownError");var Le=be;function qa(e){if(e.ok)return e.value;throw new Le(e.error)}t(qa,"unwrap");var he=class he extends Error{constructor(r,n){super(n),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,he.prototype);}};t(he,"EverfurConfigError");var E=he;var Ct="0.4.0",Tt="react-native",kt="2026-09-19",Ir="EVERFUR_API_BASE_URL";function ne(e,r){return Object.freeze({ok:false,failure:Object.freeze({reason:e,message:r})})}t(ne,"configFailure");function St(e){let r=typeof e=="string"?e.trim():"";return r.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(r)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}t(St,"checkPublishableKey");function Ft(e,r){let n=St(e?.publishableKey);if(n!==null)return Object.freeze({ok:false,failure:n});let o=e.publishableKey.trim(),i=Pr(e.apiBaseUrl);if(!i.ok)return i;let a=e.contractVersion?.trim()||kt;return Object.freeze({ok:true,config:Object.freeze({publishableKey:o,apiBaseUrl:i.value,contractVersion:a,sdkVersion:Ct,platform:r?.platform??Tt,debug:e.debug===true})})}t(Ft,"tryResolveClientConfig");function Wa(e,r){let n=Ft(e,r);if(!n.ok)throw new E("invalid-argument",n.failure.message);return n.config}t(Wa,"resolveClientConfig");function Pr(e){let r=e?.trim(),n=r&&r.length>0?r:Mt(Ir);return n?Pt(n):ne("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${Ir}. The SDK never ships a hardcoded host.`)}t(Pr,"tryResolveApiBaseUrl");function Ga(e){let r=Pr(e);if(!r.ok)throw new E("invalid-argument",r.failure.message);return r.value}t(Ga,"resolveApiBaseUrl");function Dr(e){return {"X-Everfur-SDK-Version":e.sdkVersion,"X-Everfur-SDK-Platform":e.platform,"X-Everfur-Contract":e.contractVersion}}t(Dr,"buildBaseHeaders");var xt=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;function wt(e){return e.slice(e.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}t(wt,"hostOf");function Ot(e){return e.length===0||e.includes("@")?false:e.startsWith("[")&&e.endsWith("]")?true:!e.includes(":")}t(Ot,"isPrintableHost");function At(e,r){let n=e.indexOf("://");return n<0||e.slice(n+3).includes("@")?false:Ot(r)}t(At,"canEchoOrigin");function It(e,r){return `${e}://${r}`}t(It,"safeOrigin");function Pt(e){let r=e.trim(),n=xt.exec(r);if(n===null||n[2]===void 0||n[2].length===0)return ne("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let o=(n[1]??"").toLowerCase(),i=wt(n[2]);if(i.length===0)return ne("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let a=At(r,i)?`: ${It(o,i)}`:"";if(o!=="https"){if(!(o==="http"&&Dt(i)))return o==="http"?ne("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${a}`):ne("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${a}`)}let s=r.endsWith("/")?r.slice(0,-1):r;return Object.freeze({ok:true,value:s})}t(Pt,"normalizeBaseUrl");function Dt(e){let r=e.toLowerCase();return r==="localhost"||r==="127.0.0.1"||r==="[::1]"||r==="::1"}t(Dt,"isLoopbackHost");function Mt(e){let n=globalThis.process?.env?.[e];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}t(Mt,"readEnv");function Q(e){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>=55296&&n<=56319){let o=e.charCodeAt(r+1);if(!(o>=56320&&o<=57343))return true;r+=1;}else if(n>=56320&&n<=57343)return true}return false}t(Q,"hasLoneSurrogate");function B(e){return [...e].length}t(B,"serverLength");var Mr=128,Lr=128,Nr=/[\u0000-\u001F\u007F]/,Lt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function es(e){let r=e,n=B(r);if(n===0||n>Lr)throw new E("invalid-argument",`petRef must be 1..${Lr} characters`);if(Nr.test(r))throw new E("invalid-argument","petRef must be printable (no control characters)");return r}t(es,"petRef");function rs(e){let r=e,n=B(r);if(n===0||n>Mr)throw new E("invalid-argument",`userRef must be 1..${Mr} characters`);if(r.includes("@"))throw new E("invalid-argument","userRef must not contain '@'");if(Nr.test(r))throw new E("invalid-argument","userRef must be printable (no control characters)");return r}t(rs,"userRef");function ns(e){if(!Lt.test(e))throw new E("invalid-argument","conversationId must be a UUID");return e}t(ns,"conversationId");function ts(e){return e}t(ts,"unsafePetRef");function os(e){return e}t(os,"unsafeUserRef");function is(e){return e}t(is,"unsafeConversationId");function as(e){return e}t(as,"unsafeResponseId");function ss(e){return e}t(ss,"unsafeClientId");function ls(e){return e}t(ls,"unsafeDocumentId");function us(e){return e}t(us,"unsafeJobId");function ds(e){return e}t(ds,"unsafeRecordsRequestId");function ms(e,r,n){let o=null,i=null,a=false,s=t(()=>i||(i=(async()=>{try{let l=await r(),u=typeof l=="string"?l:l?.token;if(typeof u!="string"||u.length===0)throw new E("invalid-argument","TokenProvider returned an empty token");return o=u,n?.(typeof l=="string"?null:Nt(l.expiresAt)),u}finally{i=null;}})(),i),"load");return {userRef:e,async currentToken(l){if(a)throw new E("not-initialized","This identity was cleared (sign-out); mint a new one.");return l?.forceRefresh&&(o=null),o!==null?o:s()},hasToken(){return !a&&o!==null},clear(){a=true,o=null;}}}t(ms,"createIdentityProvider");function Nt(e){if(e===void 0)return null;let r=typeof e=="number"?e<1e11?e*1e3:e:new Date(e).getTime();return Number.isFinite(r)?r:null}t(Nt,"expiryMs");function gs(){let e=new Uint8Array(16),r=globalThis.crypto;if(typeof r?.getRandomValues=="function")r.getRandomValues(e);else for(let o=0;o<e.length;o+=1)e[o]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=[];for(let o=0;o<e.length;o+=1)n.push(e[o].toString(16).padStart(2,"0"));return n.slice(0,4).join("")+"-"+n.slice(4,6).join("")+"-"+n.slice(6,8).join("")+"-"+n.slice(8,10).join("")+"-"+n.slice(10,16).join("")}t(gs,"newSessionId");function zt(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}t(zt,"authHeaders");function te(e,r){return {...e,headers:{...Bt(e.headers),...zt(r)}}}t(te,"withAuthHeaders");function Bt(e){if(!e)return {};let r={};for(let[n,o]of Object.entries(e)){let i=n.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[n]=o);}return r}t(Bt,"stripAuthHeaders");async function zr(e,r){if(r.mode==="anonymous")return r.transport.request(te(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let n;try{n=await r.identity.currentToken();}catch{return y(Ne())}let o=await r.transport.request(te(e,{mode:"personalized",token:n,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return y(Ne())}let a=await r.transport.request(te(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?y(Ne(a.error.httpStatus)):a}t(zr,"authedSend");function Ne(e){return C("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}t(Ne,"authRejectedError");function Es(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}t(Es,"assertNever");var jt=Object.freeze([]),Ut=Object.freeze([]);function Br(e,r,n=null){return Object.freeze({kind:"accepted",streamId:e,lastEventId:r,serverRequestId:n,terminal:false})}t(Br,"acceptedFrame");function jr(e,r=null){return Object.freeze({kind:"heartbeat",lastEventId:e,serverRequestId:r,terminal:false})}t(jr,"heartbeatFrame");function Ur(e,r,n=null){return Object.freeze({kind:"delta",delta:e,lastEventId:r,serverRequestId:n,terminal:false})}t(Ur,"deltaFrame");function qr(e,r=null){return Object.freeze({kind:"done",terminal:true,conversationId:e.conversationId,messageId:e.messageId,title:e.title,followUpQuestions:Object.freeze([...e.followUpQuestions]),citations:Object.freeze([...e.citations]),citationStatus:e.citationStatus,urgencyLevel:e.urgencyLevel,urgencyReason:e.urgencyReason,urgencyProvided:e.urgencyProvided??e.urgencyLevel!==null,resultId:e.resultId,lastEventId:e.lastEventId,serverRequestId:r})}t(qr,"doneFrame");function D(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}t(D,"errorFrame");function Hr(e,r,n=null){return Object.freeze({kind:"analysisStarted",requestId:e,lastEventId:r,serverRequestId:n,terminal:false})}t(Hr,"analysisStartedFrame");function Kr(e,r=null){return Object.freeze({kind:"analysisComplete",terminal:false,resultId:e.resultId,analysisType:e.analysisType,modelVersion:e.modelVersion,confidence:e.confidence,detections:Object.freeze([...e.detections]),interpretation:e.interpretation,lastEventId:e.lastEventId,serverRequestId:r})}t(Kr,"analysisCompleteFrame");function $r(e,r,n=null){return Object.freeze({kind:"unknown",raw:{...e},lastEventId:r,serverRequestId:n,terminal:false})}t($r,"unknownFrame");var vs=Object.freeze({strings:jt,maps:Ut});var Wr=`
|
|
2
2
|
|
|
3
|
-
`,
|
|
3
|
+
`,qt=1048576,Ht=zod.z.record(zod.z.string(),zod.z.unknown()),Kt=["emergency","schedule_soon","home_care"];async function*Ee(e,r=null){let n=null,o=t(()=>(n!==null||(n=typeof r=="function"?r():r),n),"requestIdNow"),i=new TextDecoder("utf-8"),a="",s=0,l=false;for await(let u of e){for(a+=i.decode(u,{stream:true});;){let d=a.indexOf(Wr,s);if(d===-1)break;let f=a.slice(0,d);a=a.slice(d+Wr.length),s=0;let c=Gr(f,o());if(c!==null&&(c.kind==="delta"&&(l=true),yield c,c.terminal))return}if(s=a.length>0?a.length-1:0,a.length>qt){yield D({code:l?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:o()});return}}if(a+=i.decode(),a.trim().length>0){let u=Gr(a,o());if(u!==null&&(u.kind==="delta"&&(l=true),yield u,u.terminal))return}yield D({code:l?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:o()});}t(Ee,"parseSse");function Gr(e,r){let n=null,o=[];for(let s of e.split(`
|
|
4
4
|
`)){let l=s.replace(/\s+$/,"");l.length===0||l.startsWith(":")||(l.startsWith("id:")?n=l.slice(3).trim():l.startsWith("data:")&&o.push(l.slice(5).replace(/^ /,"")));}if(o.length===0)return null;let i;try{i=JSON.parse(o.join(`
|
|
5
|
-
`));}catch{return null}if(typeof i!="object"||i===null||Array.isArray(i))return null;let a=
|
|
5
|
+
`));}catch{return null}if(typeof i!="object"||i===null||Array.isArray(i))return null;let a=Ht.safeParse(i);return a.success?$t(a.data,n,r):null}t(Gr,"parseBlock");function $t(e,r,n){let o=e.type,i=e.event;if(o==="error"||"error"in e)return D({code:v(e.code)??"unknown",retryable:e.retryable===true,wireMessage:v(e.error),synthesized:false,lastEventId:r,serverRequestId:n});if(o==="done"||e.done===true)return qr({conversationId:v(e.conversation_id)??"",messageId:v(e.message_id),title:v(e.title),followUpQuestions:Yt(e.follow_up_questions),citations:Yr(e.citations),citationStatus:v(e.citation_status),urgencyLevel:Vr(e.urgency_level),urgencyReason:v(e.urgency_reason),urgencyProvided:Gt(e),resultId:v(e.result_id),lastEventId:r},n);if(o==="accepted"||e.status==="reasoning")return Br(v(e.stream_id),r,n);if(o==="heartbeat"||e.heartbeat===true)return jr(r,n);if(o==="text.delta"||"delta"in e||"token"in e){let a=v(e.delta)??v(e.token)??"";return Ur(a,r,n)}return i==="analysis_started"?Hr(v(e.request_id),r,n):i==="analysis_complete"?Kr({resultId:v(e.result_id),analysisType:v(e.analysis_type),modelVersion:v(e.model_version),confidence:Wt(e.confidence),detections:Yr(e.detections),interpretation:v(e.interpretation),lastEventId:r},n):$r(e,r,n)}t($t,"frameFromWire");function v(e){return typeof e=="string"?e:null}t(v,"asString");function Wt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}t(Wt,"asNumber");function Vr(e){return typeof e=="string"&&Kt.includes(e)?e:null}t(Vr,"asUrgency");function Gt(e){if(!Object.prototype.hasOwnProperty.call(e,"urgency_level"))return false;let r=e.urgency_level;return r===null||Vr(r)!==null}t(Gt,"urgencySlotProvided");function Yt(e){return Array.isArray(e)?e.map(r=>typeof r=="string"?r:String(r)):[]}t(Yt,"asStringList");function Vt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}t(Vt,"isPlainObject");function Yr(e){return Array.isArray(e)?e.filter(Vt):[]}t(Yr,"asMapList");var Xt=3e4,Jr="x-request-id";async function*Be(e){if(!e)return;let r=e.getReader();try{for(;;){let{done:n,value:o}=await r.read();if(n)break;o&&o.length>0&&(yield o);}}finally{await r.cancel?.();}}t(Be,"fetchByteSource");async function*Ds(e,r=[]){let n=new TextEncoder().encode(e),o=[...new Set(r)].filter(a=>a>0&&a<n.length).sort((a,s)=>a-s),i=0;for(let a of o)yield n.subarray(i,a),i=a;yield n.subarray(i);}t(Ds,"bufferedTextByteSource");function Qt(e){let r=new TextEncoder,n=Zt(),o=false,i=t(u=>{let d="";u.lastEventId&&(d+=`id: ${u.lastEventId}
|
|
6
6
|
`);let f=u.data??"";for(let c of f.split(`
|
|
7
7
|
`))d+=`data: ${c}
|
|
8
8
|
`;d+=`
|
|
9
|
-
`,n.push(r.encode(d));},"onMessage"),a=t(()=>{l(),n.end();},"onDone"),s=t(u=>{let d=typeof u.xhrStatus=="number"?u.xhrStatus:0;if(d>=400){let f=
|
|
9
|
+
`,n.push(r.encode(d));},"onMessage"),a=t(()=>{l(),n.end();},"onDone"),s=t(u=>{let d=typeof u.xhrStatus=="number"?u.xhrStatus:0;if(d>=400){let f=en(d),c=z(X(f));n.push(r.encode(`data: ${JSON.stringify({type:"error",code:f,retryable:c})}
|
|
10
10
|
|
|
11
|
-
`));}l(),n.end();},"onError");e.addEventListener("message",i),e.addEventListener("done",a),e.addEventListener("error",s);function l(){if(!o){o=true,e.removeEventListener("message",i),e.removeEventListener("done",a),e.removeEventListener("error",s);try{e.close();}catch{}}}return t(l,"cleanup"),Wt(n.source,l)}t($t,"eventSourceByteSource");async function*Wt(e,r){try{yield*e;}finally{r();}}t(Wt,"sourceWithCleanup");function Gt(){let e=[],r=false,n=null,o=t(()=>{if(n){let a=n;n=null,a();}},"signal");async function*i(){for(;;){let a=e.shift();if(a!==void 0){yield a;continue}if(r)return;await new Promise(s=>{n=s;});}}return t(i,"gen"),{source:i(),push:t(a=>{e.push(a),o();},"push"),end:t(()=>{r=true,o();},"end")}}t(Gt,"createByteQueue");async function Yt(e,r){let n=r.fetchImpl??Be(),o=je(r.config.apiBaseUrl,e.path,e.query),i=Ue(r.config,e.headers,"application/json",e.body!==void 0&&e.multipart===void 0),a=Zt(Kt),s=eo(a.signal,e.signal),l;try{l=await n(o,qe({...e,signal:s},i));}catch(d){return y(be(d))}finally{a.cancel();}let u=await He(l);return l.ok?T(u):y(Xr(l.status,u,ze(l)))}t(Yt,"requestJson");async function Ps(e,r,n){let o=r.fetchImpl??Be(),i=je(r.config.apiBaseUrl,e.path,e.query),a=Ue(r.config,e.headers,"text/event-stream",e.body!==void 0&&e.multipart===void 0),s;try{s=await o(i,qe(e,a));}catch(u){return y(be(u))}if(!s.ok)return y(Xr(s.status,await He(s),ze(s)));let l=n?n(s):Le(s.body);return T({ok:s.ok,status:s.status,headers:ro(s),bytes:l})}t(Ps,"requestRaw");function Ds(e){return {request:t(r=>Yt(r,e),"request"),stream:t((r,n)=>Vt(Jt(r,n),e),"stream")}}t(Ds,"createHttpTransport");async function*Vt(e,r){let n=je(r.config.apiBaseUrl,e.path,e.query),o=Ue(r.config,e.headers,"text/event-stream",e.body!==void 0&&e.multipart===void 0);if(r.eventSourceFactory){let l=r.eventSourceFactory(n,Xt(e,o));yield*ge($t(l),()=>Qt(l));return}let i=r.fetchImpl??Be(),a;try{a=await i(n,qe(e,o));}catch(l){yield Gr("",true,rn(l));return}let s=ze(a);if(!a.ok){let l=await He(a),u=Jr(l)??Qr(a.status),d=en(l)||z(X(u));yield Gr(u,d,Zr(l),s);return}if(a.body){yield*ge(Le(a.body),s);return}yield*ge(Le(null),s);}t(Vt,"streamFrames");function Xt(e,r){return {method:e.method,headers:r,pollingInterval:0,...e.body!==void 0?{body:JSON.stringify(e.body)}:{}}}t(Xt,"buildEventSourceInit");function Xr(e,r,n){let o=Jr(r),i=o?X(o):Tr(e),a=Zr(r);return C(i,{httpStatus:e,...en(r)?{retryable:true}:{},...n?{requestId:n}:{},...o?{wireCode:o}:{},...Yr(r)?{reasonCode:Yr(r)}:{},...a?{wireMessage:a}:{},...r!=null?{raw:r}:{}})}t(Xr,"errorFromResponse");function be(e){return C("internalError",{retryable:true,wireMessage:rn(e)})}t(be,"networkError");function ze(e){let r=e.headers.get(Vr);return typeof r=="string"&&r.length>0?r:null}t(ze,"requestIdOf");function Qt(e){if(typeof e.getResponseHeader!="function")return null;let r;try{r=e.getResponseHeader(Vr);}catch{return null}return typeof r=="string"&&r.length>0?r:null}t(Qt,"eventSourceRequestId");function Qr(e){return e===401?"AUTH_EXPIRED":e===403?"ACCESS_DENIED":e===404?"NOT_FOUND":e===409?"IDEMPOTENCY_CONFLICT":e===421?"MISDIRECTED_REQUEST":e===429?"RATE_LIMITED":e===400||e===422?"INVALID_REQUEST":e===503||e>=500?"INTERNAL_ERROR":""}t(Qr,"statusToWireCode");function Gr(e,r,n,o=null){return D({code:e,retryable:r,wireMessage:n,synthesized:true,lastEventId:null,serverRequestId:o})}t(Gr,"syntheticErrorFrame");function Be(){let e=globalThis.fetch;if(typeof e!="function")throw new h("missing-peer-dependency","global fetch is unavailable; provide config.transport or an injected fetch implementation");return e}t(Be,"getGlobalFetch");function je(e,r,n){let o=r.startsWith("/")?r:`/${r}`,i=`${e}${o}`;if(n){let a=Object.entries(n).filter(s=>s[1]!==void 0).map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");a&&(i+=`?${a}`);}return i}t(je,"buildUrl");function Ue(e,r,n,o){let i={...Ar(e),accept:n};return o&&(i["content-type"]="application/json"),r&&Object.assign(i,r),i}t(Ue,"mergeHeaders");function qe(e,r){let n={method:e.method,headers:r};return e.multipart!==void 0?n.body=e.multipart:e.body!==void 0&&(n.body=JSON.stringify(e.body)),e.signal&&(n.signal=e.signal),n}t(qe,"buildInit");function Jt(e,r){return e.signal?e:{...e,signal:r}}t(Jt,"withSignal");function Zt(e){let r=new AbortController,n=setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:t(()=>clearTimeout(n),"cancel")}}t(Zt,"timeoutSignal");function eo(e,r){if(!r)return e;let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),n.signal;let o=t(()=>n.abort(),"onAbort");return e.addEventListener("abort",o,{once:true}),r.addEventListener("abort",o,{once:true}),n.signal}t(eo,"mergeAbortSignals");async function He(e){try{return await e.json()}catch{return null}}t(He,"safeJson");function ro(e){let r={};return e.headers.forEach?.((n,o)=>{r[o.toLowerCase()]=n;}),r}t(ro,"collectHeaders");function Yr(e){let r=e,n=r?.error?.reason_code??r?.reason_code;return typeof n=="string"&&n.length>0?n:null}t(Yr,"extractReasonCode");function Jr(e){let r=e,n=r?.error?.code??r?.code;return typeof n=="string"&&n.length>0?n:null}t(Jr,"extractWireCode");function Zr(e){let r=e,n=r?.error?.message??r?.message;return typeof n=="string"&&n.length>0?n:null}t(Zr,"extractWireMessage");function en(e){let r=e;return r?.error?.retryable===true||r?.retryable===true}t(en,"extractRetryable");function rn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}t(rn,"describeCause");function zs(e){if(e.length===0)return nn({granted:[],asGrant:{allow:[],deny:[]}});let r=null,n=new Set;for(let i of e){let a=new Set(i.allow);r=r===null?a:no(r,a);for(let s of i.deny)n.add(s);}let o=[...r??new Set].filter(i=>!n.has(i)).sort();return nn({granted:o,asGrant:{allow:o,deny:[]}})}t(zs,"resolveEntitlements");function no(e,r){let n=new Set;for(let o of e)r.has(o)&&n.add(o);return n}t(no,"intersect");function nn(e){return Object.freeze({granted:Object.freeze([...e.granted]),asGrant:Object.freeze({allow:Object.freeze([...e.asGrant.allow]),deny:Object.freeze([...e.asGrant.deny])})})}t(nn,"freezeResolved");var $e=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function to(e){return $e[e]}t(to,"requires");function Bs(e,r){let n=Object.freeze({reason:r,level:e,recoverable:false}),o=[],i=new Set;for(let a of Object.keys($e))for(let s of $e[a])i.has(s)||(i.add(s),o.push(Object.freeze({resource:s,granted:false,disabled:n})));return Object.freeze(o)}t(Bs,"deniedDecisionsFor");function js(e,r,n){let o=to(e),i=new Map;for(let l of r)i.set(l.resource,l);if(n?.isPending===true&&o.some(l=>!i.has(l)))return Ke({name:e,enabled:false,isPending:true,limits:{}});let a=oo(o,i);return o.filter(l=>i.get(l)?.granted!==true).length===0?Ke({name:e,enabled:true,isPending:false,limits:a}):Ke({name:e,enabled:false,isPending:false,limits:a,disabled:io(o,i)})}t(js,"decideCapability");function oo(e,r){let n={};for(let o of e){let i=r.get(o)?.limits;if(i)for(let[a,s]of Object.entries(i)){let l=n[a];n[a]=l===void 0?s:Math.min(l,s);}}return n}t(oo,"mergeLimits");function io(e,r){for(let n of e){let o=r.get(n)?.disabled;if(o)return Object.freeze({reason:o.reason,level:o.level,recoverable:o.recoverable})}return Object.freeze({reason:Pe("accessDenied"),level:"user_entitlement",recoverable:false})}t(io,"disabledFor");function Ke(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}t(Ke,"freezeDecision");var ao=3e4,so=Ie*2,lo="idempotency-key",uo=new Set(["POST","PUT","PATCH","DELETE"]),co=Object.freeze({onEvent(){}}),fo=Object.freeze({setTimeout:t((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:t(e=>clearTimeout(e),"clearTimeout"),now:t(()=>Date.now(),"now")});function M(e){let r=e.observer??co,n=e.timers??fo,o=e.rng??Math.random,i=e.sleep??((p,m)=>ko(p,n,m)),a=e.maxAttempts??Sr,s=e.unaryTimeoutMs??ao,l=e.newIdempotencyKey??yo(),u=t(p=>{try{r.onEvent(p);}catch{}},"emit");async function d(p,m,R){let F=R?.maxAttempts,de=Math.max(1,F??a),Y=R?.idempotent??uo.has(m.method)?l():null,ce=po(m,Y),V=0;for(;;){let ee=t(Oe=>Object.freeze({call:p,method:m.method,path:m.path,attempt:V,...Y?{idempotencyKey:Y}:{},...Oe}),"stamp");u(ee({phase:"attempt"}));let hr=Co(s,n),Er=To(hr.signal,m.signal),re;try{re=await Mr({...ce,signal:Er.signal},e.auth);}catch(Oe){re=y(be(Oe));}finally{Er.dispose(),hr.cancel();}if(re.ok)return u(ee({phase:"settled",ok:true,reason:"ok"})),re;let P=re.error,fe=go(P,V,{maxAttempts:de,rng:o,now:n.now(),aborted:m.signal?.aborted===true,...F!==void 0?{perCallMaxAttempts:F}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),we={ok:false,code:P.code,reason:fe.reason,...P.httpStatus!==void 0?{httpStatus:P.httpStatus}:{},...P.requestId!==void 0?{requestId:P.requestId}:{}};if(!fe.retry)return u(ee({phase:"settled",...we})),y(P);if(u(ee({phase:"retry",...we,delayMs:fe.delayMs})),await i(fe.delayMs,m.signal),m.signal?.aborted===true)return u(ee({phase:"settled",...we,reason:"aborted"})),y(P);V+=1;}}t(d,"send");async function f(p){return te(p,await Ro(e.auth))}t(f,"authorize");async function*c(p,m,R){u(Object.freeze({call:p,phase:"stream.open",method:m.method,path:m.path,attempt:0}));try{yield*e.auth.transport.stream(m,R);}catch{yield D({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return t(c,"stream"),Object.freeze({send:d,authorize:f,stream:c})}t(M,"createRequestFunnel");function po(e,r){let n={};for(let[o,i]of Object.entries(e.headers??{}))o.toLowerCase()!==lo&&(n[o]=i);return r!==null&&(n["Idempotency-Key"]=r),{...e,headers:n}}t(po,"assembleHeaders");function yo(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}t(yo,"defaultIdempotencyKeyFactory");var mo=10;function go(e,r,n){if(n.aborted)return {retry:false,reason:"aborted"};let o=bo(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!z(e.code))return {retry:false,reason:"terminal-code"};let i=o==="burst"?"burst-throttle":"retryable-code";if(t(()=>{if(n.policy===void 0)return false;try{return !n.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=t(()=>{if(n.policy===void 0)return null;let d;try{d=n.policy.maxAttempts(e.code);}catch{return null}return typeof d!="number"||!Number.isFinite(d)?null:Math.max(1,Math.min(mo,Math.floor(d)))},"policyCeiling"),l=n.perCallMaxAttempts??s()??n.maxAttempts;if(r+1>=l)return {retry:false,reason:"attempts-exhausted"};let u=ho(e,n.now);return u!==null?u>so?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:u}:{retry:true,reason:i,delayMs:Fr(r,n.rng)}}t(go,"decideRetry");function bo(e){let r=e.code==="unknown"?X(_o(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}t(bo,"throttleKind");function ho(e,r){let n=Eo(e.raw);if(n===null)return null;let o=n-r;return o>0?o:0}t(ho,"retryOverrideMs");function Eo(e){for(let r of on(e)){let n=r.resets_at,o=vo(n);if(o!==null)return o}return null}t(Eo,"findResetsAt");function on(e){if(!tn(e))return [];let r=[e];for(let n of ["error","detail"]){let o=e[n];tn(o)&&r.push(o);}return r}t(on,"candidateScopes");function vo(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}t(vo,"parseInstantMs");function _o(e){for(let r of on(e)){let n=r.code;if(typeof n=="string"&&n.length>0)return n}return null}t(_o,"rawWireCode");function tn(e){return typeof e=="object"&&e!==null}t(tn,"isRecord");async function Ro(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}t(Ro,"resolveDeviceAuth");function Co(e,r){let n=new AbortController,o=r.setTimeout(()=>n.abort(),e);return {signal:n.signal,cancel:t(()=>r.clearTimeout(o),"cancel")}}t(Co,"boundedSignal");function To(e,r){let n=t(()=>{},"noop");if(!r)return {signal:e,dispose:n};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:n};let i=t(()=>o.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:o.signal,dispose:t(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}t(To,"mergeSignals");function ko(e,r,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(o=>{let i=r.setTimeout(()=>{n?.removeEventListener("abort",a),o();},e),a=t(()=>{r.clearTimeout(i),o();},"onAbort");n?.addEventListener("abort",a,{once:true});})}t(ko,"delayAbortable");function k(e){let r=v(e);return r===null?null:Fo(r)}t(k,"parseColor");function v(e){if(typeof e=="number")return an(e);if(typeof e!="string")return null;let r=e.trim();if(r.length===0)return null;if(r.startsWith("#"))return We(r.slice(1));if(r.toLowerCase().startsWith("0x"))return We(r.slice(2));if(r.toLowerCase().startsWith("rgb"))return So(r);if(/^[0-9a-fA-F]+$/.test(r)){let n=We(r);if(n!==null)return n}return /^\d+$/.test(r)?an(Number.parseInt(r,10)):null}t(v,"toRgba");function We(e){let r=e.trim();if(!/^[0-9a-fA-F]+$/.test(r))return null;if(r.length===3)return {r:Ge(r[0]),g:Ge(r[1]),b:Ge(r[2]),a:1};if(r.length===6)return {r:j(r,0),g:j(r,2),b:j(r,4),a:1};if(r.length===8){let n=j(r,0);return {r:j(r,2),g:j(r,4),b:j(r,6),a:n/255}}return null}t(We,"fromHex");function So(e){let r=e.indexOf("("),n=e.indexOf(")");if(r<0||n<0||n<r)return null;let o=e.slice(r+1,n).split(",").map(u=>u.trim());if(o.length<3)return null;let i=Ye(Number(o[0])),a=Ye(Number(o[1])),s=Ye(Number(o[2]));if(i===null||a===null||s===null)return null;let l=1;if(o.length>=4){let u=Number(o[3]);if(!Number.isFinite(u))return null;l=Math.min(1,Math.max(0,u));}return {r:i,g:a,b:s,a:l}}t(So,"fromRgbFunc");function an(e){if(!Number.isFinite(e))return null;let r=Math.trunc(e)>>>0,n=r>>>24&255;return {r:r>>>16&255,g:r>>>8&255,b:r&255,a:n===0?1:n/255}}t(an,"argbIntToRgba");function j(e,r){return Number.parseInt(e.slice(r,r+2),16)}t(j,"byte");function Ge(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}t(Ge,"dup");function Ye(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}t(Ye,"clampByte");function Fo(e){if(e.a>=1)return q(e.r,e.g,e.b);let r=Math.round(e.a*1e3)/1e3;return `rgba(${e.r},${e.g},${e.b},${r})`}t(Fo,"normalizeRgba");function q(e,r,n){return `#${Ve(e)}${Ve(r)}${Ve(n)}`.toUpperCase()}t(q,"rgbToHex");function Ve(e){return e.toString(16).padStart(2,"0")}t(Ve,"hex2");var xo="#111111",J="#FFFFFF",he="#000000";function ln(e){let r=v(e);if(r===null)return J;let n=U(r),o=U({r:17,g:17,b:17}),i=U({r:255,g:255,b:255});return Je(n,i)>=Je(n,o)?J:xo}t(ln,"readableOn");function oe(e,r){let n=ln(e);return _(n,e)>=r?n:_(J,e)>=_(he,e)?J:he}t(oe,"legibleOn");function ie(e){let r=t(n=>e.reduce((o,i)=>Math.min(o,_(n,i)),Number.POSITIVE_INFINITY),"worst");return r(J)>=r(he)?J:he}t(ie,"poleForGrounds");function U(e){let r=Xe(e.r/255),n=Xe(e.g/255),o=Xe(e.b/255);return .2126*r+.7152*n+.0722*o}t(U,"relativeLuminance");function Xe(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}t(Xe,"linearize");function Je(e,r){let n=Math.max(e,r),o=Math.min(e,r);return (n+.05)/(o+.05)}t(Je,"luminanceContrast");function _(e,r){let n=v(e),o=v(r);if(n===null||o===null)return 1;let i=o.a>=1?o:{...o},a=n.a>=1?n:un(n,i);return Je(U(a),U(i))}t(_,"contrastRatio");function un(e,r){let n=e.a,o=t((i,a)=>Math.round(i*n+a*(1-n)),"mix");return {r:o(e.r,r.r),g:o(e.g,r.g),b:o(e.b,r.b),a:1}}t(un,"composite");function H(e,r){let n=v(e),o=v(r);if(n===null||o===null)return null;let i=n.a>=1?n:un(n,{...o});return q(i.r,i.g,i.b)}t(H,"flattenOnto");var sn=.05;function K(e,r,n,o){let i=r[0];if(i===void 0)return n;let a=t(d=>r.every(f=>_(d,f)>=o),"reads");if(v(e)===null)return n;if(a(e))return e;let s=H(e,i),l=s===null?null:v(s),u=v(n);if(l===null||u===null)return n;for(let d=1;d<1/sn;d+=1){let f=d*sn,c=t((m,R)=>Math.round(m+(R-m)*f),"mix"),p=q(c(l.r,u.r),c(l.g,u.g),c(l.b,u.b));if(a(p))return p}return n}t(K,"pushToContrast");function dn(e,r,n){let o=e/255,i=r/255,a=n/255,s=Math.max(o,i,a),l=Math.min(o,i,a),u=(s+l)/2;if(s===l)return {h:0,s:0,l:u};let d=s-l,f=d/(1-Math.abs(2*u-1)),c;return s===o?(c=(i-a)/d*60,c<0&&(c=c+360)):s===i?c=((a-o)/d+2)*60:c=((o-i)/d+4)*60,{h:c,s:f,l:u}}t(dn,"rgbToHsl");function Ze(e){let{h:r,s:n,l:o}=e,i=(1-Math.abs(2*o-1))*n,a=r/60,s=i*(1-Math.abs(a%2-1)),l=o-i/2,u=Math.floor(a)%6,d=[[i,s,0],[s,i,0],[0,i,s],[0,s,i],[s,0,i],[i,0,s]],[f,c,p]=d[u];return {r:Qe(f+l),g:Qe(c+l),b:Qe(p+l)}}t(Ze,"hslToRgb");function Qe(e){return Math.min(255,Math.max(0,Math.floor(e*255+.5)))}t(Qe,"channel");function A(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))A(e[r]);}return e}t(A,"deepFreeze");var Ee=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),fn={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},pn={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},cn={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},wo={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Oo={regular:"400",medium:"500",bold:"700"},Ao={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},nr=0,$="System",N="monospace",Io=["content","heading","control","compact","badge"];function Po(e){let r={};for(let n of Io)r[n]=e;return r}t(Po,"authoredTierSizes");function yn(){return {family:$,mono:N,fontUrl:null,families:{regular:$,medium:$,bold:$,mono:N,monoMedium:N,monoBold:N},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:cn,tierSizes:Po(cn),lineHeight:wo,weight:Oo,letterSpacing:Ao,scale:1,maxScale:nr,scaleCaps:Ee}}t(yn,"baseType");var mn={},er=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function rr(e){return `cubic-bezier(${e.join(", ")})`}t(rr,"cssCubicBezier");var gn={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:rr(er.standard),emphasized:rr(er.emphasized),exit:rr(er.exit)},reducedMotion:false},Do={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ae=A({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Do,space:fn,radius:pn,type:yn(),motion:gn,slots:mn}),Mo={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"},ve=A({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Mo,space:fn,radius:pn,type:yn(),motion:gn,slots:mn});var No="#23272C",bn=4.5,Lo=.6,tr=.9,zo=.02,Bo="#FFFFFF",jo="#111111";function Uo(e){return _(e,No)>=bn&&Math.max(_(e,Bo),_(e,jo))>=bn}t(Uo,"readsOnDark");function vn(e){let r=v(e);if(r===null)return null;let{h:n,s:o,l:i}=dn(r.r,r.g,r.b),a=Math.min(Math.max(i,Lo),tr);for(let l=0;;l+=1){let u=a+l*zo;if(u>tr)break;let d=Ze({h:n,s:o,l:u}),f=q(d.r,d.g,d.b);if(Uo(f))return f}let s=Ze({h:n,s:o,l:tr});return q(s.r,s.g,s.b)}t(vn,"deriveDarkVariant");var qo=7,hn=.05,Ho="#000000",Ko="#FFFFFF";function $o(e,r,n,o){let i=H(e,r);if(i===null)return n;if(_(i,r)>=o)return i;let a=v(i),s=v(n);if(a===null||s===null)return n;for(let l=1;l<1/hn;l+=1){let u=l*hn,d=t((c,p)=>Math.round(c+(p-c)*u),"mix"),f=q(d(a.r,s.r),d(a.g,s.g),d(a.b,s.b));if(_(f,r)>=o)return f}return n}t($o,"pushContrast");function Wo(e,r){let n=[e.surface,e.surfaceCream,e.surfaceSubtle,e.background,e.chatGround,e.composerFill],o=n[0],i=En(o);for(let a of n){let s=En(a);(r?s>i:s<i)&&(o=a,i=s);}return o}t(Wo,"hardestGround");function En(e){let r=v(e);return r===null?0:U(r)}t(En,"luminanceOf");function L(e,r){return H(e,r)??k(e)??r}t(L,"solid");function _n(e){let r=e.color,n=e.brightness==="dark",o=n?Ko:Ho,i=Wo(r,n),a=t(l=>$o(l,i,o,qo),"text"),s={...r,brandSoft:L(r.brandSoft,r.surface),brandSofter:L(r.brandSofter,r.surface),brandBorder:a(r.brandBorder),borderHairlineGreen:a(r.borderHairlineGreen),brandBorderStrong:a(r.brandBorderStrong),brandInk:a(r.brandInk),linkInk:a(r.linkInk),borderRingCream:a(r.borderRingCream),composerBorder:a(r.composerBorder),text:{primary:a(r.text.primary),secondary:a(r.text.secondary),muted:a(r.text.muted),placeholder:a(r.text.placeholder),onBrand:r.text.onBrand,metaCool:a(r.text.metaCool),timestamp:a(r.text.timestamp)},badgeBgPositive:L(r.badgeBgPositive,r.surface),badgeBgCaution:L(r.badgeBgCaution,r.surface),badgeBgCritical:L(r.badgeBgCritical,r.surface),badgeBgNeutral:L(r.badgeBgNeutral,r.surface),checkupCardLowRiskBg:L(r.checkupCardLowRiskBg,r.surface),checkupCardConcernBg:L(r.checkupCardConcernBg,r.surface)};return A({...e,highContrast:true,color:s})}t(_n,"deriveHighContrast");var se=Object.freeze(["composerInput","sendButton","userBubble","assistantBubble","recordCard","vetVisitButton","primaryButton","link"]),il=Object.freeze(["backgroundColor","borderColor","borderRadius","textColor"]),S=4.5,Go=Object.freeze({});function Yo(e){return se.includes(e)}t(Yo,"isSlotName");function Vo(e){let r=typeof e=="number"?e:typeof e=="string"?Number(e.trim()):Number.NaN;return Number.isFinite(r)?Math.max(0,r):null}t(Vo,"parseRadius");function Rn(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let r={},n=false;for(let[o,i]of Object.entries(e)){if(!Yo(o)||i===null||typeof i!="object")continue;let a=Xo(i);a!==null&&(r[o]=a,n=true);}return n?Object.freeze(r):null}t(Rn,"parseThemeSlots");function _e(e,r,n){return e[r]!==void 0?e[r]:e[n]}t(_e,"pick");function Xo(e){let r={},n=k(_e(e,"background_color","backgroundColor"));n!==null&&(r.backgroundColor=n);let o=k(_e(e,"border_color","borderColor"));o!==null&&(r.borderColor=o);let i=Vo(_e(e,"border_radius","borderRadius"));i!==null&&(r.borderRadius=i);let a=k(_e(e,"text_color","textColor"));return a!==null&&(r.textColor=a),Object.keys(r).length===0?null:Object.freeze(r)}t(Xo,"parseSlot");function Cn(e,r){return r===null||Object.keys(r).length===0?e??Go:e===null||Object.keys(e).length===0?r:Object.freeze({...e,...r})}t(Cn,"mergeThemeSlots");var Qo=3;function Jo(e,r){return e===void 0?r:r.length===0?[e]:r.map(n=>H(e,n)??n)}t(Jo,"seatsOf");function Zo(e,r){let n=ie(e);return e.every(o=>_(n,o)>=r)}t(Zo,"someInkReads");function ei(e,r){let n=r[0];return n===void 0?null:H(e,n)}t(ei,"collapseUnsatisfiableFill");function ri(e){let r=oe(e[0],S);return e.every(n=>_(r,n)>=S)?r:ie(e)}t(ri,"inkFor");function Tn(e,r){let n=false,o={};for(let i of se){let a=e[i];if(a===void 0)continue;let s=a.backgroundColor,l=r?.[i]??[],u=Jo(s,l),d={...a},f=false;if(s!==void 0&&u.length>1&&!Zo(u,S)){let c=ei(s,l);c!==null&&(d.backgroundColor=c,u=[c],f=true);}if(u.length>0){let c=a.textColor;if(s!==void 0)(c===void 0||u.some(p=>_(c,p)<S))&&(d.textColor=ri(u),f=true);else if(c!==void 0){let p=K(c,u,ie(u),S);p!==c&&(d.textColor=p,f=true);}if(a.borderColor!==void 0){let p=K(a.borderColor,u,ie(u),Qo);p!==a.borderColor&&(d.borderColor=p,f=true);}}o[i]=f?Object.freeze(d):a,n=n||f;}return n?Object.freeze(o):e}t(Tn,"guardSlotContrast");var ni=Object.freeze(["display_name","logo_url","logo_url_dark","primary_color","accent_color","primary_color_dark","accent_color_dark","brightness","color_scheme","font_family","font_url","fonts","font_urls","chat_placeholder","surface_style","radius_scale","accessibility_max_font_scale","slots"]),Re="slots.",ti=Object.freeze([1,2]);function ir(e){return Object.keys(e).every(r=>r==="schemaVersion"||(e[r]??null)===null)}t(ir,"isEmptyBranding");function oi(e){let r=e?.schemaVersion??null;return r===null||ti.includes(r)}t(oi,"isKnownBrandingSchema");function ii(e){return new Set(["hide_powered_by",...e?.lockedFields??[]])}t(ii,"lockedFieldsOf");function ai(e){return e==="hide_powered_by"||ni.includes(e)?true:e.startsWith(Re)&&se.includes(e.slice(Re.length))}t(ai,"isThemeLockName");function Z(e){if(e===null||typeof e!="object")return null;let r=e,n={displayName:W(g(r,"display_name","displayName")),logoUrl:W(g(r,"logo_url","logoUrl")),primaryColor:k(g(r,"primary_color","primaryColor")),accentColor:k(g(r,"accent_color","accentColor")),brightness:di(g(r,"brightness","color_scheme","colorScheme")),fontFamily:W(g(r,"font_family","fontFamily")),fontUrl:W(g(r,"font_url","fontUrl")),fonts:kn(g(r,"fonts")),fontUrls:kn(g(r,"font_urls","fontUrls")),placeholder:W(g(r,"chat_placeholder","placeholder","chatPlaceholder")),hidePoweredBy:si(g(r,"hide_powered_by","hidePoweredBy")),primaryColorDark:k(g(r,"primary_color_dark","primaryColorDark")),accentColorDark:k(g(r,"accent_color_dark","accentColorDark")),surfaceStyle:Sn(g(r,"surface_style","surfaceStyle"),li),radiusScale:Sn(g(r,"radius_scale","radiusScale"),ui),logoUrlDark:W(g(r,"logo_url_dark","logoUrlDark")),slots:Rn(g(r,"slots")),accessibilityMaxFontScale:pi(g(r,"accessibility_max_font_scale","accessibilityMaxFontScale")),lockedFields:mi(g(r,"locked_fields","lockedFields")),schemaVersion:yi(g(r,"schema_version","schemaVersion"))};return ir(n)?null:Object.freeze(n)}t(Z,"parseClientBranding");function si(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true")return true;if(r==="false")return false}return null}t(si,"parseBool");function g(e,...r){for(let n of r)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n];if(o!==void 0)return o}}t(g,"pick");function W(e){if(typeof e!="string")return null;let r=e.trim();return r.length===0?null:r}t(W,"parseNonEmptyString");var Ce=["regular","medium","bold","mono","monoMedium","monoBold"];function kn(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let r=e,n={};for(let o of Ce){let i=W(g(r,o));i!==null&&(n[o]=i);}return Object.keys(n).length===0?null:Object.freeze(n)}t(kn,"parseFaceMap");var li=["white","cream","subtle"],ui=["sharp","default","round"];function Sn(e,r){if(typeof e!="string")return null;let n=e.trim().toLowerCase();return r.includes(n)?n:null}t(Sn,"parseEnum");function di(e){if(typeof e!="string")return null;let r=e.trim().toLowerCase();return r==="light"||r==="dark"||r==="auto"?r:null}t(di,"parseBrightness");function In(e){let r=typeof e=="number"?e:typeof e=="string"?Number(e.trim()):Number.NaN;return Number.isFinite(r)&&(typeof e!="string"||e.trim().length>0)?r:null}t(In,"parseNumber");var ci=1,fi=3.1;function pi(e){let r=In(e);return r===null?null:r<=0?0:Math.min(fi,Math.max(ci,r))}t(pi,"parseMaxFontScale");function yi(e){if(e==null)return null;let r=In(e);return r!==null&&Number.isInteger(r)&&r>=1?r:0}t(yi,"parseSchemaVersion");function Pn(e){let r=e.trim();return r.startsWith(Re)?r:r.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase()}t(Pn,"toWireName");function mi(e){if(!Array.isArray(e))return null;let r=[];for(let n of e){if(typeof n!="string")continue;let o=Pn(n);ai(o)&&!r.includes(o)&&r.push(o);}return r.length===0?null:Object.freeze(r)}t(mi,"parseLockedFields");function Fn(e){if(e===null)return null;let r=e.trim();return r.length===0?null:/^https:\/\/\S+$/i.test(r)?r:null}t(Fn,"hardenHttpsUrl");function xn(e,r){if(r===null||ir(r))return e;let n=(r.brightness==="light"||r.brightness==="dark")&&r.brightness!==e.brightness?r.brightness==="dark"?ve:ae:e,o=n.brightness==="dark"?ve:ae,i=n.brightness==="dark",a=i?r.primaryColorDark??wn(r.primaryColor):r.primaryColor,s=i?r.accentColorDark??wn(r.accentColor):r.accentColor,l=a??n.color.primary,u=s??n.color.accent,d=a!==null&&vi(r,l,o,i),f=d?o.color.primary:l,c=a!==null&&!d?v(f):null,p=t(F=>Math.round(F+(255-F)*.4),"lift"),m=c!==null?{brand:f,bubbleUser:f,brandInk:f,text:{...n.color.text,secondary:f},brandSoft:`rgba(${c.r}, ${c.g}, ${c.b}, 0.10)`,brandSofter:`rgba(${c.r}, ${c.g}, ${c.b}, 0.15)`,brandBorder:`rgba(${c.r}, ${c.g}, ${c.b}, 0.20)`,borderHairlineGreen:`rgba(${c.r}, ${c.g}, ${c.b}, 0.28)`,brandBorderStrong:`rgba(${c.r}, ${c.g}, ${c.b}, 0.55)`,composerBorder:`rgba(${c.r}, ${c.g}, ${c.b}, 0.75)`,accentEdge:`rgb(${p(c.r)}, ${p(c.g)}, ${p(c.b)})`}:d?_i(o,n.color.text):{},R={brightness:n.brightness,highContrast:n.highContrast,meta:{displayName:r.displayName??n.meta.displayName,logoUrl:(i?r.logoUrlDark??r.logoUrl:r.logoUrl)??n.meta.logoUrl,placeholder:r.placeholder??n.meta.placeholder,hidePoweredBy:r.hidePoweredBy??n.meta.hidePoweredBy},color:{...n.color,...m,...Ei(r.surfaceStyle??null,o),primary:f,accent:u,onPrimary:n.color.onPrimary,onAccent:n.color.onAccent},space:n.space,radius:Ci(r.radiusScale??null,n.radius,o),type:{...n.type,...hi(n.type,r),maxScale:r.accessibilityMaxFontScale??n.type.maxScale},motion:n.motion,slots:Cn(n.slots,r.slots??null)};return A(R)}t(xn,"withServerBranding");var gi={regular:["regular"],medium:["medium","regular"],bold:["bold","medium","regular"],mono:["mono"],monoMedium:["monoMedium","mono"],monoBold:["monoBold","monoMedium","mono"]},bi=[["regular","medium","bold"],["mono","monoMedium","monoBold"]];function or(e){return e==="mono"||e==="monoMedium"||e==="monoBold"}t(or,"isMonoFace");function hi(e,r){let n=r.fonts??{},o=r.fontUrls??{},i={...e.families},a={...e.namedFaces},s={...e.fontUrls};for(let l of Ce){let u=gi[l].map(c=>n[c]).find(c=>c!==void 0),d=or(l)?null:r.fontFamily;u!==void 0?(i[l]=u,a[l]=true):d!==null&&(i[l]=d,a[l]=false);let f=o[l]??(l==="regular"?r.fontUrl:null)??null;f!==null?s[l]=f:u!==void 0&&delete s[l];}for(let l of bi)for(let u of l)a[u]&&l.some(d=>d!==u&&i[d]===i[u])&&(a[u]=false);return {family:i.regular,mono:i.mono,fontUrl:s.regular??null,families:i,namedFaces:a,fontUrls:s}}t(hi,"mergeFaces");function wn(e){return e===null?null:vn(e)}t(wn,"darkVariantOf");function Ei(e,r){if(e===null)return {};let n=r.color;return {chatGround:e==="white"?n.surface:e==="subtle"?n.surfaceSubtle:n.surfaceCream}}t(Ei,"surfaceOf");function On(e,r){return e==null?false:k(e)===k(r)}t(On,"sameColor");function vi(e,r,n,o){return On(r,n.color.primary)?true:o&&(e.primaryColorDark??null)===null&&On(e.primaryColor,ae.color.primary)}t(vi,"isCompiledPrimary");function _i(e,r){let n=e.color;return {text:{...r,secondary:n.text.secondary},brand:n.brand,bubbleUser:n.bubbleUser,brandInk:n.brandInk,brandSoft:n.brandSoft,brandSofter:n.brandSofter,brandBorder:n.brandBorder,borderHairlineGreen:n.borderHairlineGreen,brandBorderStrong:n.brandBorderStrong,composerBorder:n.composerBorder,accentEdge:n.accentEdge}}t(_i,"compiledBrandFamily");var Ri={sharp:.5,default:1,round:1.5};function Ci(e,r,n){if(e===null)return r;let o=Ri[e],i=n.radius,a=t(s=>Math.round(s*o),"s");return {tile:a(i.tile),xs:a(i.xs),sm:a(i.sm),md:a(i.md),lg:a(i.lg),xl:a(i.xl),pill:i.pill}}t(Ci,"radiusOf");var Ti="Everfur",ki=.5;function Si(e){let r=e?.branding??null,n=oi(r)?r:null,o=Oi(e?.clientOverride??null,ii(n)),i=e?.colorScheme==="dark"?"dark":"light",a=o?.brightness??n?.brightness??"light",u=xn((a==="auto"?i:a)==="dark"?ve:ae,An(n)),d=xn(u,An(o));return Ui(d,e)}t(Si,"resolveTheme");function fl(e,r,n){return Si({...n,branding:Z(r),clientOverride:Z(e)})}t(fl,"previewTheme");function Fi(e){return e==="placeholder"?"chat_placeholder":Pn(e)}t(Fi,"wireNameOf");var xi={brightness:["color_scheme"],fontUrl:["font_family"],fonts:["font_family"],fontUrls:["font_url","font_family"],primaryColorDark:["primary_color"],accentColorDark:["accent_color"],logoUrlDark:["logo_url"]};function wi(e,r){return r.has(Fi(e))?true:(xi[e]??[]).some(n=>r.has(n))}t(wi,"isLocked");function Oi(e,r){if(e===null)return null;let n=false,o={...e};for(let s of Object.keys(e))(e[s]??null)!==null&&(wi(s,r)||s==="lockedFields")&&(o[s]=null,n=true);let i=o.slots??null;if(i!==null){let s={},l=false;for(let u of se){let d=i[u];d!==void 0&&(r.has(`${Re}${u}`)?l=true:s[u]=d);}l&&(o.slots=Object.keys(s).length===0?null:Object.freeze(s),n=true);}if(!n)return e;let a=Object.freeze(o);return ir(a)?null:a}t(Oi,"withoutFields");function An(e){return e===null||e.brightness===null?e:Object.freeze({...e,brightness:null})}t(An,"withoutBrightness");function Ai(e,r){if(r===1)return e;let n={};for(let[o,i]of Object.entries(e))n[o]=Math.round(i*r*10)/10;return n}t(Ai,"scaledSizes");function Ii(e){return e===void 0||!Number.isFinite(e)?1:Math.max(ki,e)}t(Ii,"effectiveScale");var Dn=["content","heading","control","compact","badge"];function Pi(e){if(!(e>0))return Ee;let r={};for(let n of Dn){let o=Ee[n];r[n]=o===0?0:Math.min(o,e);}return r}t(Pi,"tierCaps");function Di(e,r){return r>0?Math.min(e,r):e}t(Di,"capped");function Mi(e,r,n,o){let i={};for(let a of Dn)i[a]=o?Ai(e,Di(r,n[a])):e;return i}t(Mi,"sizesByTier");function Ni(e){return e==="dark"?"#FFFFFF":"#000000"}t(Ni,"inkPole");function Li(e){return [e.surface,e.surfaceCream,e.surfaceSubtle,e.background,e.chatGround,e.composerFill]}t(Li,"textGrounds");function Mn(e){return [e.chatGround,e.surface,e.surfaceCream]}t(Mn,"linkGrounds");function zi(e){return {composerInput:[e.composerFill],sendButton:[e.composerFill],userBubble:[e.bubbleUser],assistantBubble:[e.chatGround,e.surfaceCream],recordCard:[e.surface],vetVisitButton:[e.primary],primaryButton:[e.brand],link:Mn(e)}}t(zi,"slotGrounds");function Bi(e,r){try{let n=e(r);return n===!0||n===!1?n:null}catch{return null}}t(Bi,"registration");function ji(e,r){let n=r?.isFontRegistered,o=r?.platformMonoFamily?.trim()||null;if(n===void 0&&o===null)return {family:e.family,mono:e.mono,families:e.families,namedFaces:e.namedFaces};let i={...e.families},a={...e.namedFaces};for(let s of Ce)!(i[s]===$||i[s]===N)&&n!==void 0&&Bi(n,i[s])===false&&(i[s]=or(s)?N:$,a[s]=false),o!==null&&or(s)&&i[s]===N&&(i[s]=o);return {family:i.regular,mono:i.mono,families:i,namedFaces:a}}t(ji,"platformFaces");function Ui(e,r){let n=e.color.primary,o=e.color.accent,i=e.meta.displayName.trim().length===0?Ti:e.meta.displayName,a=Fn(e.meta.logoUrl),s={};for(let ce of Ce){let V=e.type.fontUrls[ce];V!==void 0&&(s[ce]=Fn(V));}let l=s.regular??null,d=r?.reducedMotion===true?{duration:{instant:0,fast:0,normal:0,slow:0},spring:{gentle:{damping:100,stiffness:1e3}},easing:e.motion.easing,reducedMotion:true}:e.motion,f=Number.isFinite(e.type.maxScale)?e.type.maxScale:nr,c=Ii(r?.textScale),p=Pi(f),m=Mi(e.type.size,c,p,r?.scaleTypeSizes===true),R=e.color,F=Ni(e.brightness),de=Li(R),xe={...R,primary:n,accent:o,onPrimary:oe(n,S),onAccent:oe(o,S),brandInk:K(R.brandInk,de,F,S),linkInk:K(e.slots.link?.textColor??o,Mn(R),F,S),text:{...R.text,secondary:K(R.text.secondary,de,F,S)}},Y={brightness:e.brightness,highContrast:false,meta:{displayName:i,logoUrl:a,placeholder:e.meta.placeholder,hidePoweredBy:e.meta.hidePoweredBy},color:xe,space:e.space,radius:e.radius,type:{...e.type,...ji(e.type,r),fontUrl:l,fontUrls:s,size:m.content,tierSizes:m,scale:c,maxScale:f,scaleCaps:p},motion:d,slots:Tn(e.slots,zi(xe))};return r?.highContrast===true?_n(A(Y)):A(Y)}t(Ui,"finalize");var Nn="/widget/v1/entitlements",qi=304,Hi=Object.freeze({kind:"notModified"});async function hl(e,r={},n=M({auth:e})){let o=await n.send("entitlements.fetch",$i(r));return o.ok?Wi(o.value):o.error.httpStatus===qi?Hi:{kind:"failed",error:o.error}}t(hl,"fetchEntitlements");var Ki=64;function $i(e){let r={};return ar(e.cachedRevision)&&(r["if-none-match"]=`"${e.cachedRevision}"`),e.region&&e.region.length<=Ki?{method:"GET",path:Nn,headers:r,query:{region:e.region}}:{method:"GET",path:Nn,headers:r}}t($i,"buildRequest");function Wi(e){if(e===null||typeof e!="object"||!ar(e.revision))return Ln();let r=typeof e.region=="string"?e.region:"",n=ar(e.ttl_seconds)?e.ttl_seconds:0;return Object.freeze({kind:"updated",revision:e.revision,region:r,ttlSeconds:n,decisions:Yi(e.capabilities),branding:Gi(e)})}t(Wi,"parseUpdated");function Gi(e){let r=Z(e.branding);if(r!==null)return r;let n=e.render_hints;if(n!==null&&typeof n=="object"){let o=Z(n.branding);return o!==null?o:Z(n)}return null}t(Gi,"parseBranding");function Yi(e){if(e===null||typeof e!="object")return Object.freeze([]);let r=[];for(let[n,o]of Object.entries(e))Vi(o)&&r.push(Object.freeze({resource:n,granted:true}));return Object.freeze(r)}t(Yi,"mapCapabilities");function Vi(e){return typeof e=="object"&&e!==null&&e.enabled===true}t(Vi,"isEnabled");function Ln(){return {kind:"failed",error:C("internalError",{retryable:true,wireMessage:"malformed entitlements response"})}}t(Ln,"malformed");function ar(e){return typeof e=="number"&&Number.isFinite(e)}t(ar,"isFiniteNumber");var Xi=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function Qi(e,r){let n=e.type,o=n.families[r];return r==="mono"||n.namedFaces[r]?{fontFamily:o}:{fontFamily:o,fontWeight:n.weight[Xi[r]]}}t(Qi,"face");var zn=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function Bn(e){if(typeof e!="string")return null;let r=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(zn,r)?zn[r]:null}t(Bn,"canonicalPetSpecies");var jn=50,Ji=128,sr=120,Un=120,Zi=2e3,qn=120,ea=80,$n=new Set(["male","female","unknown"]),Wn=new Set(["day","month","year"]),Gn=new Set(["low","medium","high","athletic"]),Yn=new Set(["indoor","outdoor","both"]),Vn=new Set(["mild","moderate","severe"]),ra=/^(\d{4})-(\d{2})-(\d{2})$/,Xn=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],Qn=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...Xn,...Qn].map(([e])=>e));function na(e){let r=ra.exec(e);if(r===null)return false;let[n,o,i]=[Number(r[1]),Number(r[2]),Number(r[3])],a=new Date(Date.UTC(n,o-1,i));return a.getUTCFullYear()===n&&a.getUTCMonth()===o-1&&a.getUTCDate()===i}t(na,"isRealDate");var ue=t(e=>(r,n)=>typeof n=="string"&&e.has(n)?null:`${r} must be one of ${[...e].join(", ")}`,"oneOf"),ta=t((e,r)=>typeof r=="boolean"?null:`${e} must be true or false`,"boolean"),ke=t((e,r)=>typeof r=="string"&&na(r)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),x=t((e,r={})=>(n,o)=>{if(typeof o!="string")return `${n} must be a string`;if(Q(o))return `${n} contains an unpaired surrogate and cannot be encoded`;let i=r.trimmed?o.trim():o;if(r.required&&i.length===0)return `${n} is required and must not be blank`;let a=B(i);return a<=e?null:`${n} is ${a} characters; the server accepts at most ${e}`},"text"),oa={sex:ue($n),spayedNeutered:ta,birthDate:ke,birthDatePrecision:ue(Wn),activityLevel:ue(Gn),indoorOutdoor:ue(Yn),foodBrand:x(qn),foodType:x(qn),microchipId:x(ea)},lr=["ref","ref",false,x(Ji,{required:true,trimmed:true})],ur=["notes","notes",false,x(Zi,{trimmed:true})],Hn=[lr,["name","name",true,x(sr,{required:true,trimmed:true})],["dose","dose",false,x(Un,{trimmed:true})],["frequency","frequency",false,x(Un,{trimmed:true})],["startDate","start_date",false,ke],["endDate","end_date",false,ke],ur],ia={allergies:[lr,["allergen","allergen",true,x(sr,{required:true,trimmed:true})],["severity","severity",false,ue(Vn)],ur],medications:Hn,supplements:Hn,conditions:[lr,["conditionName","condition_name",true,x(sr,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,ke],ur]};function aa(e,r,n){let o=`${e}[${r}]`;if(typeof n!="object"||n===null||Array.isArray(n))return {error:`${o} must be an object`};let i=n,a={};for(let[u,d,f,c]of ia[e]){let p=i[u];if(p==null){if(f)return {error:`${o}.${u} is required`};p===null&&(a[d]=null);continue}let m=c(`${o}.${u}`,p);if(m!==null)return {error:m};a[d]=p;}let s=a.start_date,l=a.end_date;return typeof s=="string"&&typeof l=="string"&&l<s?{error:`${o}.endDate must not be before startDate`}:{item:a}}t(aa,"itemToWire");function sa(e,r){if(!Array.isArray(r))return {error:`${e} must be an array (send [] to clear it)`};if(r.length>jn)return {error:`${e} has ${r.length} items; the server accepts at most ${jn}`};let n=[],o=new Set;for(let i=0;i<r.length;i+=1){let a=aa(e,i,r[i]);if("error"in a)return a;let s=a.item.ref;if(typeof s=="string"){let l=s.trim();if(o.has(l))return {error:`${e}: ref ${JSON.stringify(l)} is used twice; a ref names one item`};o.add(l);}n.push(a.item);}return {items:n}}t(sa,"listToWire");function Jn(e,r){let n=e,o={};for(let[s,l]of Xn){let u=n[s];if(u!==void 0){if(u!==null){let d=oa[s](s,u);if(d!==null)return {error:d}}o[l]=u;}}let i=n.birthDate!==void 0,a=n.birthDatePrecision!==void 0;if(i!==a||i&&n.birthDate===null!=(n.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[s,l]of Qn){let u=n[s];if(u===void 0)continue;let d=sa(s,u);if("error"in d)return d;o[l]=d.items;}return Object.keys(o).length>0&&r!==void 0&&Bn(r)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:o}}t(Jn,"petHealthToWire");var b=t(e=>typeof e=="string"?e:null,"str"),le=t((e,r)=>typeof r=="string"&&e.has(r)?r:null,"pick"),la=t(e=>typeof e=="boolean"?e:null,"bool");function Te(e,r){return Array.isArray(e)?Object.freeze(e.flatMap(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return [];let o=r(n);return o===null?[]:[o]})):Object.freeze([])}t(Te,"itemsFromWire");function Kn(e){let r=b(e.name);return r===null||r.length===0?null:Object.freeze({ref:b(e.ref),name:r,dose:b(e.dose),frequency:b(e.frequency),startDate:b(e.start_date),endDate:b(e.end_date),notes:b(e.notes)})}t(Kn,"medicationFromWire");function Zn(e){let r=e.profile_version;return Object.freeze({profileVersion:typeof r=="number"&&Number.isInteger(r)&&r>=0?r:0,sex:le($n,e.sex),spayedNeutered:la(e.spayed_neutered),birthDate:b(e.birth_date),birthDatePrecision:le(Wn,e.birth_date_precision),activityLevel:le(Gn,e.activity_level),indoorOutdoor:le(Yn,e.indoor_outdoor),foodBrand:b(e.food_brand),foodType:b(e.food_type),microchipId:b(e.microchip_id),allergies:Te(e.allergies,n=>{let o=b(n.allergen);return o===null||o.length===0?null:Object.freeze({ref:b(n.ref),allergen:o,severity:le(Vn,n.severity),notes:b(n.notes)})}),medications:Te(e.medications,Kn),supplements:Te(e.supplements,Kn),conditions:Te(e.conditions,n=>{let o=b(n.condition_name);return o===null||o.length===0?null:Object.freeze({ref:b(n.ref),conditionName:o,diagnosedDate:b(n.diagnosed_date),notes:b(n.notes)})})})}t(Zn,"petHealthFromWire");var dr=100,cr=50,fr=100,pr=50,yr=500,ua=128,da=6e4;function O(e){return C("validationFailed",{retryable:false,wireMessage:e})}t(O,"invalid");function G(e,r,n){if(typeof r!="string")return O(`${e} must be a string`);let o=B(r);return o<=n?null:O(`${e} is ${o} characters; the server accepts at most ${n}`)}t(G,"checkString");function Se(e,r,n){return typeof r=="number"&&Number.isFinite(r)&&r>=0&&r<=n?null:O(`${e} must be a finite number between 0 and ${n}`)}t(Se,"outOfRange");function et(e,r){if(typeof e!="string")return O("pet_ref must be a string");if(e.trim().length===0)return O("pet_ref must not be blank");if(Q(e))return O("pet_ref contains an unpaired surrogate and cannot be encoded");if(r!=null&&typeof r!="object")return O("profile must be an object");let n=[G("pet_ref",e,ua)];return r?.name!==void 0&&n.push(G("name",r.name,dr)),r?.species!==void 0&&n.push(G("species",r.species,cr)),r?.breed!==void 0&&n.push(G("breed",r.breed,fr)),r?.ageYears!==void 0&&n.push(Se("age_years",r.ageYears,pr)),r?.weightKg!==void 0&&n.push(Se("weight_kg",r.weightKg,yr)),n.find(o=>o!==null)??null}t(et,"validate");function nt(e,r){let n=Jn(e,r);return "error"in n?{error:O(n.error)}:n}t(nt,"healthToWire");function ca(e){if(typeof e!="object"||e===null)return {error:O("patch must be an object")};let r=e,n=[["name","name",a=>G("name",a,dr)],["species","species",a=>G("species",a,cr)],["breed","breed",a=>G("breed",a,fr)],["ageYears","age_years",a=>Se("age_years",a,pr)],["weightKg","weight_kg",a=>Se("weight_kg",a,yr)]],o={};for(let[a,s,l]of n){let u=r[a];if(u!==void 0){if(u!==null){let d=l(u);if(d!==null)return {error:d}}o[s]=u;}}let i=nt(r,r.species);return "error"in i?i:(Object.assign(o,i.body),Object.keys(o).length===0?{error:O("patch must change at least one field")}:{body:o})}t(ca,"patchToWire");function fa(e){if(e==null)return {body:{}};let r=nt(e,e.species);return "error"in r?r:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...r.body}}}t(fa,"toWire");var w=t(e=>typeof e=="string"?e:null,"str"),Fe=t(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function rt(e,r){let n=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:w(n.pet_ref)??r,name:w(n.name),species:w(n.species),breed:w(n.breed),ageYears:Fe(n.age_years),weightKg:Fe(n.weight_kg)})}t(rt,"fromWire");function mr(e){if(typeof e!="object"||e===null)return null;let r=e,n=w(r.pet_ref);return n===null||n.length===0?null:Object.freeze({petId:w(r.pet_id),petRef:n,name:w(r.name),species:w(r.species),breed:w(r.breed),ageYears:Fe(r.age_years),weightKg:Fe(r.weight_kg),updatedAt:w(r.updated_at)})}t(mr,"widgetPetFromWire");function pa(e){let r=mr(e);return r===null?null:Object.freeze({...r,...Zn(e)})}t(pa,"widgetPetProfileFromWire");function ya(e){let r=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(r.flatMap(n=>{let o=mr(n);return o===null?[]:[o]}))}t(ya,"petListFromWire");function ma(e){return ga(M({auth:e}),M({auth:e,unaryTimeoutMs:da}))}t(ma,"createPetsRepository");function ga(e,r=e){let n=t((i,a)=>a?{...i,signal:a}:i,"withSignal"),o=t(i=>et(i,void 0)??`/widget/v1/pets/${encodeURIComponent(i)}`,"petPath");return {async list(i){let a=await e.send("pets.list",n({method:"GET",path:"/widget/v1/pets"},i?.signal));return a.ok?T(ya(a.value)):y(a.error)},async registerPet(i,a,s){let l=et(i,a);if(l!==null)return y(l);let u=fa(a);if("error"in u)return y(u.error);let f={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(i)}`,body:u.body},c=await e.send("pets.registerPet",s?.signal?{...f,signal:s.signal}:f);return c.ok?T(rt(c.value,i)):y(c.error)},async updatePet(i,a,s){let l=o(i);if(typeof l!="string")return y(l);let u=ca(a);if("error"in u)return y(u.error);let d=await e.send("pets.updatePet",n({method:"PATCH",path:l,body:u.body},s?.signal));return d.ok?T(rt(d.value,i)):y(d.error)},async getPetProfile(i,a){let s=o(i);if(typeof s!="string")return y(s);let l=await e.send("pets.getPetProfile",n({method:"GET",path:`${s}/profile`},a?.signal));if(!l.ok)return y(l.error);let u=pa(l.value);return u===null?y(C("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):T(u)},async deletePet(i,a){let s=o(i);if(typeof s!="string")return y(s);let l=await e.send("pets.deletePet",n({method:"DELETE",path:s},a?.signal));return l.ok?T(void 0):y(l.error)},async eraseUserData(i){let a=await r.send("pets.eraseUserData",n({method:"DELETE",path:"/widget/v1/me"},i?.signal),{maxAttempts:1});return a.ok?T(void 0):y(a.error)}}}t(ga,"createPetsRepositoryOver");var br=Object.freeze(["better","same","worse"]),ba=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tt(e){return y(C("validationFailed",{retryable:false,wireMessage:e}))}t(tt,"invalid");function gr(){return y(C("internalError",{retryable:false}))}t(gr,"malformed");function ot(e){return typeof e!="string"||e.trim().length===0?C("validationFailed",{retryable:false,wireMessage:"pet_ref must not be blank"}):Q(e)?C("validationFailed",{retryable:false,wireMessage:"pet_ref contains an unpaired surrogate and cannot be encoded"}):`/widget/v1/pets/${encodeURIComponent(e)}/cases`}t(ot,"petPath");var I=t(e=>typeof e=="string"?e:null,"str");function it(e){if(typeof e!="object"||e===null)return null;let r=e,n=I(r.case_id),o=I(r.status);if(n===null||o===null)return null;let i=I(r.last_response);return Object.freeze({caseId:n,status:o,bodyLocation:I(r.body_location),lastResponse:i!==null&&br.includes(i)?i:null,checkInDueAt:I(r.check_in_due_at),openedAt:I(r.opened_at),resolvedAt:I(r.resolved_at),resolutionText:I(r.resolution_text)})}t(it,"caseFromWire");function ha(e){return Ea(M({auth:e}))}t(ha,"createCasesRepository");function Ea(e){return {async list(r,n){let o=ot(r);if(typeof o!="string")return y(o);let i=await e.send("cases.list",{method:"GET",path:o,...n?.signal?{signal:n.signal}:{}});if(!i.ok)return y(i.error);let a=typeof i.value=="object"&&i.value!==null?i.value.cases:null;if(!Array.isArray(a))return gr();let s=a.map(it);return s.every(l=>l!==null)?T(Object.freeze(s)):gr()},async checkin(r,n,o,i){let a=ot(r);if(typeof a!="string")return y(a);if(typeof n!="string"||!ba.test(n))return tt("case_id must be a UUID");if(!br.includes(o))return tt("response must be one of better, same, worse");let s=await e.send("cases.checkin",{method:"POST",path:`${a}/${n}/checkin`,body:{response:o},...i?.signal?{signal:i.signal}:{}});if(!s.ok)return y(s.error);let l=typeof s.value=="object"&&s.value!==null?s.value:{},u=it(l.case);return u===null?gr():T(Object.freeze({case:u,ctaDeepLink:I(l.cta_deep_link)}))}}}t(Ea,"createCasesRepositoryOver");exports.AUTO_RETRYABLE_CODES=ft;exports.BACKOFF_BASE_MS=yt;exports.BACKOFF_CAP_MS=Ie;exports.CHECKIN_ANSWERS=br;exports.CONTRACT_ERROR_ROWS=_r;exports.DARK_VARIANT_GROUND=No;exports.DARK_VARIANT_LIGHTNESS_CEILING=tr;exports.DARK_VARIANT_LIGHTNESS_FLOOR=Lo;exports.DARK_VARIANT_LIGHTNESS_STEP=zo;exports.DARK_VARIANT_TARGET_RATIO=bn;exports.DEFAULT_CONTRACT_VERSION=Et;exports.DEFAULT_MAX_FONT_SCALE=nr;exports.DOC_SITE_ORIGIN=vr;exports.EASING_CURVES=er;exports.EMPTY_FRAME_ARRAYS=hs;exports.ENTITLEMENTS_PATH=Nn;exports.ENV_API_BASE_URL=wr;exports.EVERFUR_DARK=ve;exports.EVERFUR_ERROR_CATEGORIES=wa;exports.EVERFUR_ERROR_CODES=xa;exports.EVERFUR_LIGHT=ae;exports.EverfurConfigError=h;exports.EverfurThrownError=De;exports.HIGH_CONTRAST_TARGET_RATIO=qo;exports.LOCKABLE_THEME_FIELDS=ni;exports.MAX_FONT_SCALE_CEILING=fi;exports.MAX_RETRY_ATTEMPTS=Sr;exports.PET_AGE_YEARS_MAX=pr;exports.PET_BREED_MAX=fr;exports.PET_NAME_MAX=dr;exports.PET_SPECIES_MAX=cr;exports.PET_WEIGHT_KG_MAX=yr;exports.RETRYABLE_CONTRACT_CODES=pt;exports.SDK_PLATFORM=ht;exports.SDK_VERSION=bt;exports.SLOT_LOCK_PREFIX=Re;exports.SLOT_MIN_BORDER_CONTRAST=Qo;exports.SLOT_MIN_CONTRAST=S;exports.SYSTEM_FONT_FAMILY=$;exports.SYSTEM_MONO_FAMILY=N;exports.TEXT_SCALE_FLOOR=ki;exports.TEXT_SCALE_TIER_CAPS=Ee;exports.THEME_SCHEMA_VERSIONS=ti;exports.THEME_SLOT_KEYS=il;exports.THEME_SLOT_NAMES=se;exports.acceptedFrame=Nr;exports.analysisCompleteFrame=Ur;exports.analysisStartedFrame=jr;exports.assertNever=bs;exports.authHeaders=It;exports.authedSend=Mr;exports.backoffDelayMs=Fr;exports.bufferedTextByteSource=Is;exports.buildBaseHeaders=Ar;exports.canRecreateOnNotFound=Aa;exports.categoryFor=Cr;exports.checkPublishableKey=vt;exports.contractDocUrl=dt;exports.contractErrorFor=pe;exports.contrastRatio=_;exports.conversationId=es;exports.createCasesRepository=ha;exports.createHttpTransport=Ds;exports.createIdentityProvider=ps;exports.createPetsRepository=ma;exports.createRequestFunnel=M;exports.cssCubicBezier=rr;exports.decideCapability=js;exports.deepFreeze=A;exports.deltaFrame=zr;exports.deniedDecisionsFor=Bs;exports.deriveDarkVariant=vn;exports.deriveHighContrast=_n;exports.doneFrame=Br;exports.err=y;exports.errorFrame=D;exports.errorFromResponse=Xr;exports.eventSourceByteSource=$t;exports.eventSourceRequestId=Qt;exports.face=Qi;exports.fetchByteSource=Le;exports.fetchEntitlements=hl;exports.fromHttpStatus=Tr;exports.fromWire=X;exports.getGlobalFetch=Be;exports.guardSlotContrast=Tn;exports.hardenHttpsUrl=Fn;exports.heartbeatFrame=Lr;exports.isAutoRetryable=z;exports.isEmptyBranding=ir;exports.isErr=Ba;exports.isKnownBrandingSchema=oi;exports.isOk=za;exports.isRetryableCode=kr;exports.lockedFieldsOf=ii;exports.makeEverfurError=C;exports.mergeThemeSlots=Cn;exports.networkError=be;exports.newSessionId=ys;exports.ok=T;exports.parseClientBranding=Z;exports.parseColor=k;exports.parseSse=ge;exports.parseThemeSlots=Rn;exports.petRef=Ja;exports.previewTheme=fl;exports.publishedDocUrl=Rr;exports.readableOn=ln;exports.requestIdOf=ze;exports.requestJson=Yt;exports.requestRaw=Ps;exports.requires=to;exports.resolveApiBaseUrl=$a;exports.resolveClientConfig=Ka;exports.resolveEntitlements=zs;exports.resolveTheme=Si;exports.shouldRetry=Oa;exports.tryResolveApiBaseUrl=Or;exports.tryResolveClientConfig=_t;exports.unknownFrame=qr;exports.unsafeClientId=is;exports.unsafeConversationId=ts;exports.unsafeDocumentId=as;exports.unsafeJobId=ss;exports.unsafePetRef=rs;exports.unsafeRecordsRequestId=ls;exports.unsafeResponseId=os;exports.unsafeUserRef=ns;exports.unwrap=ja;exports.userFacingError=Pe;exports.userRef=Za;exports.widgetPetFromWire=mr;exports.withAuthHeaders=te;exports.withServerBranding=xn;
|
|
11
|
+
`));}l(),n.end();},"onError");e.addEventListener("message",i),e.addEventListener("done",a),e.addEventListener("error",s);function l(){if(!o){o=true,e.removeEventListener("message",i),e.removeEventListener("done",a),e.removeEventListener("error",s);try{e.close();}catch{}}}return t(l,"cleanup"),Jt(n.source,l)}t(Qt,"eventSourceByteSource");async function*Jt(e,r){try{yield*e;}finally{r();}}t(Jt,"sourceWithCleanup");function Zt(){let e=[],r=false,n=null,o=t(()=>{if(n){let a=n;n=null,a();}},"signal");async function*i(){for(;;){let a=e.shift();if(a!==void 0){yield a;continue}if(r)return;await new Promise(s=>{n=s;});}}return t(i,"gen"),{source:i(),push:t(a=>{e.push(a),o();},"push"),end:t(()=>{r=true,o();},"end")}}t(Zt,"createByteQueue");async function eo(e,r){let n=r.fetchImpl??Ue(),o=qe(r.config.apiBaseUrl,e.path,e.query),i=He(r.config,e.headers,"application/json",e.body!==void 0&&e.multipart===void 0),a=io(Xt),s=ao(a.signal,e.signal),l;try{l=await n(o,Ke({...e,signal:s},i));}catch(d){return y(ve(d))}finally{a.cancel();}let u=await $e(l);return l.ok?k(u):y(Zr(l.status,u,je(l)))}t(eo,"requestJson");async function Ms(e,r,n){let o=r.fetchImpl??Ue(),i=qe(r.config.apiBaseUrl,e.path,e.query),a=He(r.config,e.headers,"text/event-stream",e.body!==void 0&&e.multipart===void 0),s;try{s=await o(i,Ke(e,a));}catch(u){return y(ve(u))}if(!s.ok)return y(Zr(s.status,await $e(s),je(s)));let l=n?n(s):Be(s.body);return k({ok:s.ok,status:s.status,headers:so(s),bytes:l})}t(Ms,"requestRaw");function Ls(e){return {request:t(r=>eo(r,e),"request"),stream:t((r,n)=>ro(oo(r,n),e),"stream")}}t(Ls,"createHttpTransport");async function*ro(e,r){let n=qe(r.config.apiBaseUrl,e.path,e.query),o=He(r.config,e.headers,"text/event-stream",e.body!==void 0&&e.multipart===void 0);if(r.eventSourceFactory){let l=r.eventSourceFactory(n,no(e,o));yield*Ee(Qt(l),()=>to(l));return}let i=r.fetchImpl??Ue(),a;try{a=await i(n,Ke(e,o));}catch(l){yield Xr("",true,on(l));return}let s=je(a);if(!a.ok){let l=await $e(a),u=rn(l)??en(a.status),d=tn(l)||z(X(u));yield Xr(u,d,nn(l),s);return}if(a.body){yield*Ee(Be(a.body),s);return}yield*Ee(Be(null),s);}t(ro,"streamFrames");function no(e,r){return {method:e.method,headers:r,pollingInterval:0,...e.body!==void 0?{body:JSON.stringify(e.body)}:{}}}t(no,"buildEventSourceInit");function Zr(e,r,n){let o=rn(r),i=o?X(o):Fr(e),a=nn(r);return C(i,{httpStatus:e,...tn(r)?{retryable:true}:{},...n?{requestId:n}:{},...o?{wireCode:o}:{},...Qr(r)?{reasonCode:Qr(r)}:{},...a?{wireMessage:a}:{},...r!=null?{raw:r}:{}})}t(Zr,"errorFromResponse");function ve(e){return C("internalError",{retryable:true,wireMessage:on(e)})}t(ve,"networkError");function je(e){let r=e.headers.get(Jr);return typeof r=="string"&&r.length>0?r:null}t(je,"requestIdOf");function to(e){if(typeof e.getResponseHeader!="function")return null;let r;try{r=e.getResponseHeader(Jr);}catch{return null}return typeof r=="string"&&r.length>0?r:null}t(to,"eventSourceRequestId");function en(e){return e===401?"AUTH_EXPIRED":e===403?"ACCESS_DENIED":e===404?"NOT_FOUND":e===409?"IDEMPOTENCY_CONFLICT":e===421?"MISDIRECTED_REQUEST":e===429?"RATE_LIMITED":e===400||e===422?"INVALID_REQUEST":e===503||e>=500?"INTERNAL_ERROR":""}t(en,"statusToWireCode");function Xr(e,r,n,o=null){return D({code:e,retryable:r,wireMessage:n,synthesized:true,lastEventId:null,serverRequestId:o})}t(Xr,"syntheticErrorFrame");function Ue(){let e=globalThis.fetch;if(typeof e!="function")throw new E("missing-peer-dependency","global fetch is unavailable; provide config.transport or an injected fetch implementation");return e}t(Ue,"getGlobalFetch");function qe(e,r,n){let o=r.startsWith("/")?r:`/${r}`,i=`${e}${o}`;if(n){let a=Object.entries(n).filter(s=>s[1]!==void 0).map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");a&&(i+=`?${a}`);}return i}t(qe,"buildUrl");function He(e,r,n,o){let i={...Dr(e),accept:n};return o&&(i["content-type"]="application/json"),r&&Object.assign(i,r),i}t(He,"mergeHeaders");function Ke(e,r){let n={method:e.method,headers:r};return e.multipart!==void 0?n.body=e.multipart:e.body!==void 0&&(n.body=JSON.stringify(e.body)),e.signal&&(n.signal=e.signal),n}t(Ke,"buildInit");function oo(e,r){return e.signal?e:{...e,signal:r}}t(oo,"withSignal");function io(e){let r=new AbortController,n=setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:t(()=>clearTimeout(n),"cancel")}}t(io,"timeoutSignal");function ao(e,r){if(!r)return e;let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),n.signal;let o=t(()=>n.abort(),"onAbort");return e.addEventListener("abort",o,{once:true}),r.addEventListener("abort",o,{once:true}),n.signal}t(ao,"mergeAbortSignals");async function $e(e){try{return await e.json()}catch{return null}}t($e,"safeJson");function so(e){let r={};return e.headers.forEach?.((n,o)=>{r[o.toLowerCase()]=n;}),r}t(so,"collectHeaders");function Qr(e){let r=e,n=r?.error?.reason_code??r?.reason_code;return typeof n=="string"&&n.length>0?n:null}t(Qr,"extractReasonCode");function rn(e){let r=e,n=r?.error?.code??r?.code;return typeof n=="string"&&n.length>0?n:null}t(rn,"extractWireCode");function nn(e){let r=e,n=r?.error?.message??r?.message;return typeof n=="string"&&n.length>0?n:null}t(nn,"extractWireMessage");function tn(e){let r=e;return r?.error?.retryable===true||r?.retryable===true}t(tn,"extractRetryable");function on(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}t(on,"describeCause");function js(e){if(e.length===0)return an({granted:[],asGrant:{allow:[],deny:[]}});let r=null,n=new Set;for(let i of e){let a=new Set(i.allow);r=r===null?a:lo(r,a);for(let s of i.deny)n.add(s);}let o=[...r??new Set].filter(i=>!n.has(i)).sort();return an({granted:o,asGrant:{allow:o,deny:[]}})}t(js,"resolveEntitlements");function lo(e,r){let n=new Set;for(let o of e)r.has(o)&&n.add(o);return n}t(lo,"intersect");function an(e){return Object.freeze({granted:Object.freeze([...e.granted]),asGrant:Object.freeze({allow:Object.freeze([...e.asGrant.allow]),deny:Object.freeze([...e.asGrant.deny])})})}t(an,"freezeResolved");var Ge=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function uo(e){return Ge[e]}t(uo,"requires");function Us(e,r){let n=Object.freeze({reason:r,level:e,recoverable:false}),o=[],i=new Set;for(let a of Object.keys(Ge))for(let s of Ge[a])i.has(s)||(i.add(s),o.push(Object.freeze({resource:s,granted:false,disabled:n})));return Object.freeze(o)}t(Us,"deniedDecisionsFor");function qs(e,r,n){let o=uo(e),i=new Map;for(let l of r)i.set(l.resource,l);if(n?.isPending===true&&o.some(l=>!i.has(l)))return We({name:e,enabled:false,isPending:true,limits:{}});let a=co(o,i);return o.filter(l=>i.get(l)?.granted!==true).length===0?We({name:e,enabled:true,isPending:false,limits:a}):We({name:e,enabled:false,isPending:false,limits:a,disabled:fo(o,i)})}t(qs,"decideCapability");function co(e,r){let n={};for(let o of e){let i=r.get(o)?.limits;if(i)for(let[a,s]of Object.entries(i)){let l=n[a];n[a]=l===void 0?s:Math.min(l,s);}}return n}t(co,"mergeLimits");function fo(e,r){for(let n of e){let o=r.get(n)?.disabled;if(o)return Object.freeze({reason:o.reason,level:o.level,recoverable:o.recoverable})}return Object.freeze({reason:Me("accessDenied"),level:"user_entitlement",recoverable:false})}t(fo,"disabledFor");function We(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}t(We,"freezeDecision");var po=3e4,yo=De*2,mo="idempotency-key",go=new Set(["POST","PUT","PATCH","DELETE"]),bo=Object.freeze({onEvent(){}}),ho=Object.freeze({setTimeout:t((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:t(e=>clearTimeout(e),"clearTimeout"),now:t(()=>Date.now(),"now")});function Eo(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}t(Eo,"seededIdempotencyKey");function M(e){let r=e.observer??bo,n=e.timers??ho,o=e.rng??Math.random,i=e.sleep??((p,m)=>Io(p,n,m)),a=e.maxAttempts??wr,s=e.unaryTimeoutMs??po,l=e.newIdempotencyKey??_o(),u=t(p=>{try{r.onEvent(p);}catch{}},"emit");async function d(p,m,h){let F=h?.maxAttempts,ce=Math.max(1,F??a),fe=h?.idempotent??go.has(m.method),pe=h?.idempotencyKey===void 0?null:Eo(h.idempotencyKey),V=fe?pe??l():null,ye=vo(m,V),Oe=0;for(;;){let ee=t(Ie=>Object.freeze({call:p,method:m.method,path:m.path,attempt:Oe,...V?{idempotencyKey:V}:{},...Ie}),"stamp");u(ee({phase:"attempt"}));let _r=Oo(s,n),Rr=Ao(_r.signal,m.signal),re;try{re=await zr({...ye,signal:Rr.signal},e.auth);}catch(Ie){re=y(ve(Ie));}finally{Rr.dispose(),_r.cancel();}if(re.ok)return u(ee({phase:"settled",ok:true,reason:"ok"})),re;let P=re.error,me=Co(P,Oe,{maxAttempts:ce,rng:o,now:n.now(),aborted:m.signal?.aborted===true,...F!==void 0?{perCallMaxAttempts:F}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Ae={ok:false,code:P.code,reason:me.reason,...P.httpStatus!==void 0?{httpStatus:P.httpStatus}:{},...P.requestId!==void 0?{requestId:P.requestId}:{}};if(!me.retry)return u(ee({phase:"settled",...Ae})),y(P);if(u(ee({phase:"retry",...Ae,delayMs:me.delayMs})),await i(me.delayMs,m.signal),m.signal?.aborted===true)return u(ee({phase:"settled",...Ae,reason:"aborted"})),y(P);Oe+=1;}}t(d,"send");async function f(p){return te(p,await wo(e.auth))}t(f,"authorize");async function*c(p,m,h){u(Object.freeze({call:p,phase:"stream.open",method:m.method,path:m.path,attempt:0}));try{yield*e.auth.transport.stream(m,h);}catch{yield D({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return t(c,"stream"),Object.freeze({send:d,authorize:f,stream:c})}t(M,"createRequestFunnel");function vo(e,r){let n={};for(let[o,i]of Object.entries(e.headers??{}))o.toLowerCase()!==mo&&(n[o]=i);return r!==null&&(n["Idempotency-Key"]=r),{...e,headers:n}}t(vo,"assembleHeaders");function _o(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}t(_o,"defaultIdempotencyKeyFactory");var Ro=10;function Co(e,r,n){if(n.aborted)return {retry:false,reason:"aborted"};let o=To(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!z(e.code))return {retry:false,reason:"terminal-code"};let i=o==="burst"?"burst-throttle":"retryable-code";if(t(()=>{if(n.policy===void 0)return false;try{return !n.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=t(()=>{if(n.policy===void 0)return null;let d;try{d=n.policy.maxAttempts(e.code);}catch{return null}return typeof d!="number"||!Number.isFinite(d)?null:Math.max(1,Math.min(Ro,Math.floor(d)))},"policyCeiling"),l=n.perCallMaxAttempts??s()??n.maxAttempts;if(r+1>=l)return {retry:false,reason:"attempts-exhausted"};let u=ko(e,n.now);return u!==null?u>yo?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:u}:{retry:true,reason:i,delayMs:Or(r,n.rng)}}t(Co,"decideRetry");function To(e){let r=e.code==="unknown"?X(xo(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}t(To,"throttleKind");function ko(e,r){let n=So(e.raw);if(n===null)return null;let o=n-r;return o>0?o:0}t(ko,"retryOverrideMs");function So(e){for(let r of ln(e)){let n=r.resets_at,o=Fo(n);if(o!==null)return o}return null}t(So,"findResetsAt");function ln(e){if(!sn(e))return [];let r=[e];for(let n of ["error","detail"]){let o=e[n];sn(o)&&r.push(o);}return r}t(ln,"candidateScopes");function Fo(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}t(Fo,"parseInstantMs");function xo(e){for(let r of ln(e)){let n=r.code;if(typeof n=="string"&&n.length>0)return n}return null}t(xo,"rawWireCode");function sn(e){return typeof e=="object"&&e!==null}t(sn,"isRecord");async function wo(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}t(wo,"resolveDeviceAuth");function Oo(e,r){let n=new AbortController,o=r.setTimeout(()=>n.abort(),e);return {signal:n.signal,cancel:t(()=>r.clearTimeout(o),"cancel")}}t(Oo,"boundedSignal");function Ao(e,r){let n=t(()=>{},"noop");if(!r)return {signal:e,dispose:n};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:n};let i=t(()=>o.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:o.signal,dispose:t(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}t(Ao,"mergeSignals");function Io(e,r,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(o=>{let i=r.setTimeout(()=>{n?.removeEventListener("abort",a),o();},e),a=t(()=>{r.clearTimeout(i),o();},"onAbort");n?.addEventListener("abort",a,{once:true});})}t(Io,"delayAbortable");function T(e){let r=_(e);return r===null?null:Do(r)}t(T,"parseColor");function _(e){if(typeof e=="number")return un(e);if(typeof e!="string")return null;let r=e.trim();if(r.length===0)return null;if(r.startsWith("#"))return Ye(r.slice(1));if(r.toLowerCase().startsWith("0x"))return Ye(r.slice(2));if(r.toLowerCase().startsWith("rgb"))return Po(r);if(/^[0-9a-fA-F]+$/.test(r)){let n=Ye(r);if(n!==null)return n}return /^\d+$/.test(r)?un(Number.parseInt(r,10)):null}t(_,"toRgba");function Ye(e){let r=e.trim();if(!/^[0-9a-fA-F]+$/.test(r))return null;if(r.length===3)return {r:Ve(r[0]),g:Ve(r[1]),b:Ve(r[2]),a:1};if(r.length===6)return {r:j(r,0),g:j(r,2),b:j(r,4),a:1};if(r.length===8){let n=j(r,0);return {r:j(r,2),g:j(r,4),b:j(r,6),a:n/255}}return null}t(Ye,"fromHex");function Po(e){let r=e.indexOf("("),n=e.indexOf(")");if(r<0||n<0||n<r)return null;let o=e.slice(r+1,n).split(",").map(u=>u.trim());if(o.length<3)return null;let i=Xe(Number(o[0])),a=Xe(Number(o[1])),s=Xe(Number(o[2]));if(i===null||a===null||s===null)return null;let l=1;if(o.length>=4){let u=Number(o[3]);if(!Number.isFinite(u))return null;l=Math.min(1,Math.max(0,u));}return {r:i,g:a,b:s,a:l}}t(Po,"fromRgbFunc");function un(e){if(!Number.isFinite(e))return null;let r=Math.trunc(e)>>>0,n=r>>>24&255;return {r:r>>>16&255,g:r>>>8&255,b:r&255,a:n===0?1:n/255}}t(un,"argbIntToRgba");function j(e,r){return Number.parseInt(e.slice(r,r+2),16)}t(j,"byte");function Ve(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}t(Ve,"dup");function Xe(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}t(Xe,"clampByte");function Do(e){if(e.a>=1)return q(e.r,e.g,e.b);let r=Math.round(e.a*1e3)/1e3;return `rgba(${e.r},${e.g},${e.b},${r})`}t(Do,"normalizeRgba");function q(e,r,n){return `#${Qe(e)}${Qe(r)}${Qe(n)}`.toUpperCase()}t(q,"rgbToHex");function Qe(e){return e.toString(16).padStart(2,"0")}t(Qe,"hex2");var Mo="#111111",J="#FFFFFF",_e="#000000";function cn(e){let r=_(e);if(r===null)return J;let n=U(r),o=U({r:17,g:17,b:17}),i=U({r:255,g:255,b:255});return er(n,i)>=er(n,o)?J:Mo}t(cn,"readableOn");function oe(e,r){let n=cn(e);return R(n,e)>=r?n:R(J,e)>=R(_e,e)?J:_e}t(oe,"legibleOn");function ie(e){let r=t(n=>e.reduce((o,i)=>Math.min(o,R(n,i)),Number.POSITIVE_INFINITY),"worst");return r(J)>=r(_e)?J:_e}t(ie,"poleForGrounds");function U(e){let r=Je(e.r/255),n=Je(e.g/255),o=Je(e.b/255);return .2126*r+.7152*n+.0722*o}t(U,"relativeLuminance");function Je(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}t(Je,"linearize");function er(e,r){let n=Math.max(e,r),o=Math.min(e,r);return (n+.05)/(o+.05)}t(er,"luminanceContrast");function R(e,r){let n=_(e),o=_(r);if(n===null||o===null)return 1;let i=o.a>=1?o:{...o},a=n.a>=1?n:fn(n,i);return er(U(a),U(i))}t(R,"contrastRatio");function fn(e,r){let n=e.a,o=t((i,a)=>Math.round(i*n+a*(1-n)),"mix");return {r:o(e.r,r.r),g:o(e.g,r.g),b:o(e.b,r.b),a:1}}t(fn,"composite");function H(e,r){let n=_(e),o=_(r);if(n===null||o===null)return null;let i=n.a>=1?n:fn(n,{...o});return q(i.r,i.g,i.b)}t(H,"flattenOnto");var dn=.05;function K(e,r,n,o){let i=r[0];if(i===void 0)return n;let a=t(d=>r.every(f=>R(d,f)>=o),"reads");if(_(e)===null)return n;if(a(e))return e;let s=H(e,i),l=s===null?null:_(s),u=_(n);if(l===null||u===null)return n;for(let d=1;d<1/dn;d+=1){let f=d*dn,c=t((m,h)=>Math.round(m+(h-m)*f),"mix"),p=q(c(l.r,u.r),c(l.g,u.g),c(l.b,u.b));if(a(p))return p}return n}t(K,"pushToContrast");function pn(e,r,n){let o=e/255,i=r/255,a=n/255,s=Math.max(o,i,a),l=Math.min(o,i,a),u=(s+l)/2;if(s===l)return {h:0,s:0,l:u};let d=s-l,f=d/(1-Math.abs(2*u-1)),c;return s===o?(c=(i-a)/d*60,c<0&&(c=c+360)):s===i?c=((a-o)/d+2)*60:c=((o-i)/d+4)*60,{h:c,s:f,l:u}}t(pn,"rgbToHsl");function rr(e){let{h:r,s:n,l:o}=e,i=(1-Math.abs(2*o-1))*n,a=r/60,s=i*(1-Math.abs(a%2-1)),l=o-i/2,u=Math.floor(a)%6,d=[[i,s,0],[s,i,0],[0,i,s],[0,s,i],[s,0,i],[i,0,s]],[f,c,p]=d[u];return {r:Ze(f+l),g:Ze(c+l),b:Ze(p+l)}}t(rr,"hslToRgb");function Ze(e){return Math.min(255,Math.max(0,Math.floor(e*255+.5)))}t(Ze,"channel");function A(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))A(e[r]);}return e}t(A,"deepFreeze");var Re=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),mn={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},gn={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},yn={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Lo={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},No={regular:"400",medium:"500",bold:"700"},zo={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},or=0,$="System",L="monospace",Bo=["content","heading","control","compact","badge"];function jo(e){let r={};for(let n of Bo)r[n]=e;return r}t(jo,"authoredTierSizes");function bn(){return {family:$,mono:L,fontUrl:null,families:{regular:$,medium:$,bold:$,mono:L,monoMedium:L,monoBold:L},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:yn,tierSizes:jo(yn),lineHeight:Lo,weight:No,letterSpacing:zo,scale:1,maxScale:or,scaleCaps:Re}}t(bn,"baseType");var hn={},nr=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function tr(e){return `cubic-bezier(${e.join(", ")})`}t(tr,"cssCubicBezier");var En={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:tr(nr.standard),emphasized:tr(nr.emphasized),exit:tr(nr.exit)},reducedMotion:false},Uo={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ae=A({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Uo,space:mn,radius:gn,type:bn(),motion:En,slots:hn}),qo={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"},Ce=A({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qo,space:mn,radius:gn,type:bn(),motion:En,slots:hn});var Ho="#23272C",vn=4.5,Ko=.6,ir=.9,$o=.02,Wo="#FFFFFF",Go="#111111";function Yo(e){return R(e,Ho)>=vn&&Math.max(R(e,Wo),R(e,Go))>=vn}t(Yo,"readsOnDark");function Cn(e){let r=_(e);if(r===null)return null;let{h:n,s:o,l:i}=pn(r.r,r.g,r.b),a=Math.min(Math.max(i,Ko),ir);for(let l=0;;l+=1){let u=a+l*$o;if(u>ir)break;let d=rr({h:n,s:o,l:u}),f=q(d.r,d.g,d.b);if(Yo(f))return f}let s=rr({h:n,s:o,l:ir});return q(s.r,s.g,s.b)}t(Cn,"deriveDarkVariant");var Vo=7,_n=.05,Xo="#000000",Qo="#FFFFFF";function Jo(e,r,n,o){let i=H(e,r);if(i===null)return n;if(R(i,r)>=o)return i;let a=_(i),s=_(n);if(a===null||s===null)return n;for(let l=1;l<1/_n;l+=1){let u=l*_n,d=t((c,p)=>Math.round(c+(p-c)*u),"mix"),f=q(d(a.r,s.r),d(a.g,s.g),d(a.b,s.b));if(R(f,r)>=o)return f}return n}t(Jo,"pushContrast");function Zo(e,r){let n=[e.surface,e.surfaceCream,e.surfaceSubtle,e.background,e.chatGround,e.composerFill],o=n[0],i=Rn(o);for(let a of n){let s=Rn(a);(r?s>i:s<i)&&(o=a,i=s);}return o}t(Zo,"hardestGround");function Rn(e){let r=_(e);return r===null?0:U(r)}t(Rn,"luminanceOf");function N(e,r){return H(e,r)??T(e)??r}t(N,"solid");function Tn(e){let r=e.color,n=e.brightness==="dark",o=n?Qo:Xo,i=Zo(r,n),a=t(l=>Jo(l,i,o,Vo),"text"),s={...r,brandSoft:N(r.brandSoft,r.surface),brandSofter:N(r.brandSofter,r.surface),brandBorder:a(r.brandBorder),borderHairlineGreen:a(r.borderHairlineGreen),brandBorderStrong:a(r.brandBorderStrong),brandInk:a(r.brandInk),linkInk:a(r.linkInk),borderRingCream:a(r.borderRingCream),composerBorder:a(r.composerBorder),text:{primary:a(r.text.primary),secondary:a(r.text.secondary),muted:a(r.text.muted),placeholder:a(r.text.placeholder),onBrand:r.text.onBrand,metaCool:a(r.text.metaCool),timestamp:a(r.text.timestamp)},badgeBgPositive:N(r.badgeBgPositive,r.surface),badgeBgCaution:N(r.badgeBgCaution,r.surface),badgeBgCritical:N(r.badgeBgCritical,r.surface),badgeBgNeutral:N(r.badgeBgNeutral,r.surface),checkupCardLowRiskBg:N(r.checkupCardLowRiskBg,r.surface),checkupCardConcernBg:N(r.checkupCardConcernBg,r.surface)};return A({...e,highContrast:true,color:s})}t(Tn,"deriveHighContrast");var Z=Object.freeze(["composerInput","sendButton","userBubble","assistantBubble","recordCard","vetVisitButton","primaryButton","link"]),sl=Object.freeze(["backgroundColor","borderColor","borderRadius","textColor"]),S=4.5,ei=Object.freeze({});function ri(e){return Z.includes(e)}t(ri,"isSlotName");function ni(e){let r=typeof e=="number"?e:typeof e=="string"?Number(e.trim()):Number.NaN;return Number.isFinite(r)?Math.max(0,r):null}t(ni,"parseRadius");function kn(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let r={},n=false;for(let[o,i]of Object.entries(e)){if(!ri(o)||i===null||typeof i!="object")continue;let a=ti(i);a!==null&&(r[o]=a,n=true);}return n?Object.freeze(r):null}t(kn,"parseThemeSlots");function Te(e,r,n){return e[r]!==void 0?e[r]:e[n]}t(Te,"pick");function ti(e){let r={},n=T(Te(e,"background_color","backgroundColor"));n!==null&&(r.backgroundColor=n);let o=T(Te(e,"border_color","borderColor"));o!==null&&(r.borderColor=o);let i=ni(Te(e,"border_radius","borderRadius"));i!==null&&(r.borderRadius=i);let a=T(Te(e,"text_color","textColor"));return a!==null&&(r.textColor=a),Object.keys(r).length===0?null:Object.freeze(r)}t(ti,"parseSlot");function Sn(e,r){return r===null||Object.keys(r).length===0?e??ei:e===null||Object.keys(e).length===0?r:Object.freeze({...e,...r})}t(Sn,"mergeThemeSlots");var oi=3;function ii(e,r){return e===void 0?r:r.length===0?[e]:r.map(n=>H(e,n)??n)}t(ii,"seatsOf");function ai(e,r){let n=ie(e);return e.every(o=>R(n,o)>=r)}t(ai,"someInkReads");function si(e,r){let n=r[0];return n===void 0?null:H(e,n)}t(si,"collapseUnsatisfiableFill");function li(e){let r=oe(e[0],S);return e.every(n=>R(r,n)>=S)?r:ie(e)}t(li,"inkFor");function Fn(e,r){let n=false,o={};for(let i of Z){let a=e[i];if(a===void 0)continue;let s=a.backgroundColor,l=r?.[i]??[],u=ii(s,l),d={...a},f=false;if(s!==void 0&&u.length>1&&!ai(u,S)){let c=si(s,l);c!==null&&(d.backgroundColor=c,u=[c],f=true);}if(u.length>0){let c=a.textColor;if(s!==void 0)(c===void 0||u.some(p=>R(c,p)<S))&&(d.textColor=li(u),f=true);else if(c!==void 0){let p=K(c,u,ie(u),S);p!==c&&(d.textColor=p,f=true);}if(a.borderColor!==void 0){let p=K(a.borderColor,u,ie(u),oi);p!==a.borderColor&&(d.borderColor=p,f=true);}}o[i]=f?Object.freeze(d):a,n=n||f;}return n?Object.freeze(o):e}t(Fn,"guardSlotContrast");var On=Object.freeze(["display_name","logo_url","logo_url_dark","primary_color","accent_color","primary_color_dark","accent_color_dark","brightness","color_scheme","font_family","font_url","fonts","font_urls","chat_placeholder","surface_style","radius_scale","accessibility_max_font_scale","slots"]),se="slots.",An=Object.freeze([1,2]);function ke(e){return Object.keys(e).every(r=>r==="schemaVersion"||(e[r]??null)===null)}t(ke,"isEmptyBranding");function In(e){let r=e?.schemaVersion??null;return r===null||An.includes(r)}t(In,"isKnownBrandingSchema");function Pn(e){return new Set(["hide_powered_by",...e?.lockedFields??[]])}t(Pn,"lockedFieldsOf");function ui(e){return e==="hide_powered_by"||On.includes(e)?true:e.startsWith(se)&&Z.includes(e.slice(se.length))}t(ui,"isThemeLockName");function G(e){if(e===null||typeof e!="object")return null;let r=e,n={displayName:W(g(r,"display_name","displayName")),logoUrl:W(g(r,"logo_url","logoUrl")),primaryColor:T(g(r,"primary_color","primaryColor")),accentColor:T(g(r,"accent_color","accentColor")),brightness:pi(g(r,"brightness","color_scheme","colorScheme")),fontFamily:W(g(r,"font_family","fontFamily")),fontUrl:W(g(r,"font_url","fontUrl")),fonts:xn(g(r,"fonts")),fontUrls:xn(g(r,"font_urls","fontUrls")),placeholder:W(g(r,"chat_placeholder","placeholder","chatPlaceholder")),hidePoweredBy:di(g(r,"hide_powered_by","hidePoweredBy")),primaryColorDark:T(g(r,"primary_color_dark","primaryColorDark")),accentColorDark:T(g(r,"accent_color_dark","accentColorDark")),surfaceStyle:wn(g(r,"surface_style","surfaceStyle"),ci),radiusScale:wn(g(r,"radius_scale","radiusScale"),fi),logoUrlDark:W(g(r,"logo_url_dark","logoUrlDark")),slots:kn(g(r,"slots")),accessibilityMaxFontScale:mi(g(r,"accessibility_max_font_scale","accessibilityMaxFontScale")),lockedFields:bi(g(r,"locked_fields","lockedFields")),schemaVersion:gi(g(r,"schema_version","schemaVersion"))};return ke(n)?null:Object.freeze(n)}t(G,"parseClientBranding");function di(e){if(typeof e=="boolean")return e;if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true")return true;if(r==="false")return false}return null}t(di,"parseBool");function g(e,...r){for(let n of r)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n];if(o!==void 0)return o}}t(g,"pick");function W(e){if(typeof e!="string")return null;let r=e.trim();return r.length===0?null:r}t(W,"parseNonEmptyString");var le=["regular","medium","bold","mono","monoMedium","monoBold"];function xn(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let r=e,n={};for(let o of le){let i=W(g(r,o));i!==null&&(n[o]=i);}return Object.keys(n).length===0?null:Object.freeze(n)}t(xn,"parseFaceMap");var ci=["white","cream","subtle"],fi=["sharp","default","round"];function wn(e,r){if(typeof e!="string")return null;let n=e.trim().toLowerCase();return r.includes(n)?n:null}t(wn,"parseEnum");function pi(e){if(typeof e!="string")return null;let r=e.trim().toLowerCase();return r==="light"||r==="dark"||r==="auto"?r:null}t(pi,"parseBrightness");function Dn(e){let r=typeof e=="number"?e:typeof e=="string"?Number(e.trim()):Number.NaN;return Number.isFinite(r)&&(typeof e!="string"||e.trim().length>0)?r:null}t(Dn,"parseNumber");var yi=1,Mn=3.1;function mi(e){let r=Dn(e);return r===null?null:r<=0?0:Math.min(Mn,Math.max(yi,r))}t(mi,"parseMaxFontScale");function gi(e){if(e==null)return null;let r=Dn(e);return r!==null&&Number.isInteger(r)&&r>=1?r:0}t(gi,"parseSchemaVersion");function ar(e){let r=e.trim();return r.startsWith(se)?r:r.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase()}t(ar,"toWireName");function bi(e){if(!Array.isArray(e))return null;let r=[];for(let n of e){if(typeof n!="string")continue;let o=ar(n);ui(o)&&!r.includes(o)&&r.push(o);}return r.length===0?null:Object.freeze(r)}t(bi,"parseLockedFields");function sr(e){if(e===null)return null;let r=e.trim();return r.length===0?null:/^https:\/\/\S+$/i.test(r)?r:null}t(sr,"hardenHttpsUrl");function Ln(e,r){if(r===null||ke(r))return e;let n=(r.brightness==="light"||r.brightness==="dark")&&r.brightness!==e.brightness?r.brightness==="dark"?Ce:ae:e,o=n.brightness==="dark"?Ce:ae,i=n.brightness==="dark",a=i?r.primaryColorDark??Nn(r.primaryColor):r.primaryColor,s=i?r.accentColorDark??Nn(r.accentColor):r.accentColor,l=a??n.color.primary,u=s??n.color.accent,d=a!==null&&Ri(r,l,o,i),f=d?o.color.primary:l,c=a!==null&&!d?_(f):null,p=t(F=>Math.round(F+(255-F)*.4),"lift"),m=c!==null?{brand:f,bubbleUser:f,brandInk:f,text:{...n.color.text,secondary:f},brandSoft:`rgba(${c.r}, ${c.g}, ${c.b}, 0.10)`,brandSofter:`rgba(${c.r}, ${c.g}, ${c.b}, 0.15)`,brandBorder:`rgba(${c.r}, ${c.g}, ${c.b}, 0.20)`,borderHairlineGreen:`rgba(${c.r}, ${c.g}, ${c.b}, 0.28)`,brandBorderStrong:`rgba(${c.r}, ${c.g}, ${c.b}, 0.55)`,composerBorder:`rgba(${c.r}, ${c.g}, ${c.b}, 0.75)`,accentEdge:`rgb(${p(c.r)}, ${p(c.g)}, ${p(c.b)})`}:d?Ci(o,n.color.text):{},h={brightness:n.brightness,highContrast:n.highContrast,meta:{displayName:r.displayName??n.meta.displayName,logoUrl:(i?r.logoUrlDark??r.logoUrl:r.logoUrl)??n.meta.logoUrl,placeholder:r.placeholder??n.meta.placeholder,hidePoweredBy:r.hidePoweredBy??n.meta.hidePoweredBy},color:{...n.color,...m,..._i(r.surfaceStyle??null,o),primary:f,accent:u,onPrimary:n.color.onPrimary,onAccent:n.color.onAccent},space:n.space,radius:ki(r.radiusScale??null,n.radius,o),type:{...n.type,...vi(n.type,r),maxScale:r.accessibilityMaxFontScale??n.type.maxScale},motion:n.motion,slots:Sn(n.slots,r.slots??null)};return A(h)}t(Ln,"withServerBranding");var hi={regular:["regular"],medium:["medium","regular"],bold:["bold","medium","regular"],mono:["mono"],monoMedium:["monoMedium","mono"],monoBold:["monoBold","monoMedium","mono"]},Ei=[["regular","medium","bold"],["mono","monoMedium","monoBold"]];function lr(e){return e==="mono"||e==="monoMedium"||e==="monoBold"}t(lr,"isMonoFace");function vi(e,r){let n=r.fonts??{},o=r.fontUrls??{},i={...e.families},a={...e.namedFaces},s={...e.fontUrls};for(let l of le){let u=hi[l].map(c=>n[c]).find(c=>c!==void 0),d=lr(l)?null:r.fontFamily;u!==void 0?(i[l]=u,a[l]=true):d!==null&&(i[l]=d,a[l]=false);let f=o[l]??(l==="regular"?r.fontUrl:null)??null;f!==null?s[l]=f:u!==void 0&&delete s[l];}for(let l of Ei)for(let u of l)a[u]&&l.some(d=>d!==u&&i[d]===i[u])&&(a[u]=false);return {family:i.regular,mono:i.mono,fontUrl:s.regular??null,families:i,namedFaces:a,fontUrls:s}}t(vi,"mergeFaces");function Nn(e){return e===null?null:Cn(e)}t(Nn,"darkVariantOf");function _i(e,r){if(e===null)return {};let n=r.color;return {chatGround:e==="white"?n.surface:e==="subtle"?n.surfaceSubtle:n.surfaceCream}}t(_i,"surfaceOf");function zn(e,r){return e==null?false:T(e)===T(r)}t(zn,"sameColor");function Ri(e,r,n,o){return zn(r,n.color.primary)?true:o&&(e.primaryColorDark??null)===null&&zn(e.primaryColor,ae.color.primary)}t(Ri,"isCompiledPrimary");function Ci(e,r){let n=e.color;return {text:{...r,secondary:n.text.secondary},brand:n.brand,bubbleUser:n.bubbleUser,brandInk:n.brandInk,brandSoft:n.brandSoft,brandSofter:n.brandSofter,brandBorder:n.brandBorder,borderHairlineGreen:n.borderHairlineGreen,brandBorderStrong:n.brandBorderStrong,composerBorder:n.composerBorder,accentEdge:n.accentEdge}}t(Ci,"compiledBrandFamily");var Ti={sharp:.5,default:1,round:1.5};function ki(e,r,n){if(e===null)return r;let o=Ti[e],i=n.radius,a=t(s=>Math.round(s*o),"s");return {tile:a(i.tile),xs:a(i.xs),sm:a(i.sm),md:a(i.md),lg:a(i.lg),xl:a(i.xl),pill:i.pill}}t(ki,"radiusOf");var Si="Everfur",Fi=.5;function xi(e){let r=e?.branding??null,n=In(r)?r:null,o=Ii(e?.clientOverride??null,Pn(n)),i=e?.colorScheme==="dark"?"dark":"light",a=o?.brightness??n?.brightness??"light",u=Ln((a==="auto"?i:a)==="dark"?Ce:ae,Bn(n)),d=Ln(u,Bn(o));return Hi(d,e)}t(xi,"resolveTheme");function El(e,r,n){return xi({...n,branding:G(r),clientOverride:G(e)})}t(El,"previewTheme");function wi(e){return e==="placeholder"?"chat_placeholder":ar(e)}t(wi,"wireNameOf");var Oi={brightness:["color_scheme"],fontUrl:["font_family"],fonts:["font_family"],fontUrls:["font_url","font_family"],primaryColorDark:["primary_color"],accentColorDark:["accent_color"],logoUrlDark:["logo_url"]};function Ai(e,r){return r.has(wi(e))?true:(Oi[e]??[]).some(n=>r.has(n))}t(Ai,"isLocked");function Ii(e,r){if(e===null)return null;let n=false,o={...e};for(let s of Object.keys(e))(e[s]??null)!==null&&(Ai(s,r)||s==="lockedFields")&&(o[s]=null,n=true);let i=o.slots??null;if(i!==null){let s={},l=false;for(let u of Z){let d=i[u];d!==void 0&&(r.has(`${se}${u}`)?l=true:s[u]=d);}l&&(o.slots=Object.keys(s).length===0?null:Object.freeze(s),n=true);}if(!n)return e;let a=Object.freeze(o);return ke(a)?null:a}t(Ii,"withoutFields");function Bn(e){return e===null||e.brightness===null?e:Object.freeze({...e,brightness:null})}t(Bn,"withoutBrightness");function Pi(e,r){if(r===1)return e;let n={};for(let[o,i]of Object.entries(e))n[o]=Math.round(i*r*10)/10;return n}t(Pi,"scaledSizes");function Di(e){return e===void 0||!Number.isFinite(e)?1:Math.max(Fi,e)}t(Di,"effectiveScale");var jn=["content","heading","control","compact","badge"];function Mi(e){if(!(e>0))return Re;let r={};for(let n of jn){let o=Re[n];r[n]=o===0?0:Math.min(o,e);}return r}t(Mi,"tierCaps");function Li(e,r){return r>0?Math.min(e,r):e}t(Li,"capped");function Ni(e,r,n,o){let i={};for(let a of jn)i[a]=o?Pi(e,Li(r,n[a])):e;return i}t(Ni,"sizesByTier");function zi(e){return e==="dark"?"#FFFFFF":"#000000"}t(zi,"inkPole");function Bi(e){return [e.surface,e.surfaceCream,e.surfaceSubtle,e.background,e.chatGround,e.composerFill]}t(Bi,"textGrounds");function Un(e){return [e.chatGround,e.surface,e.surfaceCream]}t(Un,"linkGrounds");function ji(e){return {composerInput:[e.composerFill],sendButton:[e.composerFill],userBubble:[e.bubbleUser],assistantBubble:[e.chatGround,e.surfaceCream],recordCard:[e.surface],vetVisitButton:[e.primary],primaryButton:[e.brand],link:Un(e)}}t(ji,"slotGrounds");function Ui(e,r){try{let n=e(r);return n===!0||n===!1?n:null}catch{return null}}t(Ui,"registration");function qi(e,r){let n=r?.isFontRegistered,o=r?.platformMonoFamily?.trim()||null;if(n===void 0&&o===null)return {family:e.family,mono:e.mono,families:e.families,namedFaces:e.namedFaces};let i={...e.families},a={...e.namedFaces};for(let s of le)!(i[s]===$||i[s]===L)&&n!==void 0&&Ui(n,i[s])===false&&(i[s]=lr(s)?L:$,a[s]=false),o!==null&&lr(s)&&i[s]===L&&(i[s]=o);return {family:i.regular,mono:i.mono,families:i,namedFaces:a}}t(qi,"platformFaces");function Hi(e,r){let n=e.color.primary,o=e.color.accent,i=e.meta.displayName.trim().length===0?Si:e.meta.displayName,a=sr(e.meta.logoUrl),s={};for(let V of le){let ye=e.type.fontUrls[V];ye!==void 0&&(s[V]=sr(ye));}let l=s.regular??null,d=r?.reducedMotion===true?{duration:{instant:0,fast:0,normal:0,slow:0},spring:{gentle:{damping:100,stiffness:1e3}},easing:e.motion.easing,reducedMotion:true}:e.motion,f=Number.isFinite(e.type.maxScale)?e.type.maxScale:or,c=Di(r?.textScale),p=Mi(f),m=Ni(e.type.size,c,p,r?.scaleTypeSizes===true),h=e.color,F=zi(e.brightness),ce=Bi(h),fe={...h,primary:n,accent:o,onPrimary:oe(n,S),onAccent:oe(o,S),brandInk:K(h.brandInk,ce,F,S),linkInk:K(e.slots.link?.textColor??o,Un(h),F,S),text:{...h.text,secondary:K(h.text.secondary,ce,F,S)}},pe={brightness:e.brightness,highContrast:false,meta:{displayName:i,logoUrl:a,placeholder:e.meta.placeholder,hidePoweredBy:e.meta.hidePoweredBy},color:fe,space:e.space,radius:e.radius,type:{...e.type,...qi(e.type,r),fontUrl:l,fontUrls:s,size:m.content,tierSizes:m,scale:c,maxScale:f,scaleCaps:p},motion:d,slots:Fn(e.slots,ji(fe))};return r?.highContrast===true?Tn(A(pe)):A(pe)}t(Hi,"finalize");var qn="/widget/v1/entitlements",Ki=304,$i=Object.freeze({kind:"notModified"});async function kl(e,r={},n=M({auth:e})){let o=await n.send("entitlements.fetch",Gi(r));return o.ok?Yi(o.value):o.error.httpStatus===Ki?$i:{kind:"failed",error:o.error}}t(kl,"fetchEntitlements");var Wi=64;function Gi(e){let r={};return ur(e.cachedRevision)&&(r["if-none-match"]=`"${e.cachedRevision}"`),e.region&&e.region.length<=Wi?{method:"GET",path:qn,headers:r,query:{region:e.region}}:{method:"GET",path:qn,headers:r}}t(Gi,"buildRequest");function Yi(e){if(e===null||typeof e!="object"||!ur(e.revision))return Hn();let r=typeof e.region=="string"?e.region:"",n=ur(e.ttl_seconds)?e.ttl_seconds:0;return Object.freeze({kind:"updated",revision:e.revision,region:r,ttlSeconds:n,decisions:Xi(e.capabilities),branding:Vi(e)})}t(Yi,"parseUpdated");function Vi(e){let r=G(e.branding);if(r!==null)return r;let n=e.render_hints;if(n!==null&&typeof n=="object"){let o=G(n.branding);return o!==null?o:G(n)}return null}t(Vi,"parseBranding");function Xi(e){if(e===null||typeof e!="object")return Object.freeze([]);let r=[];for(let[n,o]of Object.entries(e))Qi(o)&&r.push(Object.freeze({resource:n,granted:true}));return Object.freeze(r)}t(Xi,"mapCapabilities");function Qi(e){return typeof e=="object"&&e!==null&&e.enabled===true}t(Qi,"isEnabled");function Hn(){return {kind:"failed",error:C("internalError",{retryable:true,wireMessage:"malformed entitlements response"})}}t(Hn,"malformed");function ur(e){return typeof e=="number"&&Number.isFinite(e)}t(ur,"isFiniteNumber");var Ji=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function Zi(e,r){let n=e.type,o=n.families[r];return r==="mono"||n.namedFaces[r]?{fontFamily:o}:{fontFamily:o,fontWeight:n.weight[Ji[r]]}}t(Zi,"face");var Kn=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function $n(e){if(typeof e!="string")return null;let r=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Kn,r)?Kn[r]:null}t($n,"canonicalPetSpecies");var Wn=50,ea=128,dr=120,Gn=120,ra=2e3,Yn=120,na=80,Qn=new Set(["male","female","unknown"]),Jn=new Set(["day","month","year"]),Zn=new Set(["low","medium","high","athletic"]),et=new Set(["indoor","outdoor","both"]),rt=new Set(["mild","moderate","severe"]),ta=/^(\d{4})-(\d{2})-(\d{2})$/,nt=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],tt=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...nt,...tt].map(([e])=>e));function oa(e){let r=ta.exec(e);if(r===null)return false;let[n,o,i]=[Number(r[1]),Number(r[2]),Number(r[3])],a=new Date(Date.UTC(n,o-1,i));return a.getUTCFullYear()===n&&a.getUTCMonth()===o-1&&a.getUTCDate()===i}t(oa,"isRealDate");var de=t(e=>(r,n)=>typeof n=="string"&&e.has(n)?null:`${r} must be one of ${[...e].join(", ")}`,"oneOf"),ia=t((e,r)=>typeof r=="boolean"?null:`${e} must be true or false`,"boolean"),Fe=t((e,r)=>typeof r=="string"&&oa(r)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),x=t((e,r={})=>(n,o)=>{if(typeof o!="string")return `${n} must be a string`;if(Q(o))return `${n} contains an unpaired surrogate and cannot be encoded`;let i=r.trimmed?o.trim():o;if(r.required&&i.length===0)return `${n} is required and must not be blank`;let a=B(i);return a<=e?null:`${n} is ${a} characters; the server accepts at most ${e}`},"text"),aa={sex:de(Qn),spayedNeutered:ia,birthDate:Fe,birthDatePrecision:de(Jn),activityLevel:de(Zn),indoorOutdoor:de(et),foodBrand:x(Yn),foodType:x(Yn),microchipId:x(na)},cr=["ref","ref",false,x(ea,{required:true,trimmed:true})],fr=["notes","notes",false,x(ra,{trimmed:true})],Vn=[cr,["name","name",true,x(dr,{required:true,trimmed:true})],["dose","dose",false,x(Gn,{trimmed:true})],["frequency","frequency",false,x(Gn,{trimmed:true})],["startDate","start_date",false,Fe],["endDate","end_date",false,Fe],fr],sa={allergies:[cr,["allergen","allergen",true,x(dr,{required:true,trimmed:true})],["severity","severity",false,de(rt)],fr],medications:Vn,supplements:Vn,conditions:[cr,["conditionName","condition_name",true,x(dr,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Fe],fr]};function la(e,r,n){let o=`${e}[${r}]`;if(typeof n!="object"||n===null||Array.isArray(n))return {error:`${o} must be an object`};let i=n,a={};for(let[u,d,f,c]of sa[e]){let p=i[u];if(p==null){if(f)return {error:`${o}.${u} is required`};p===null&&(a[d]=null);continue}let m=c(`${o}.${u}`,p);if(m!==null)return {error:m};a[d]=p;}let s=a.start_date,l=a.end_date;return typeof s=="string"&&typeof l=="string"&&l<s?{error:`${o}.endDate must not be before startDate`}:{item:a}}t(la,"itemToWire");function ua(e,r){if(!Array.isArray(r))return {error:`${e} must be an array (send [] to clear it)`};if(r.length>Wn)return {error:`${e} has ${r.length} items; the server accepts at most ${Wn}`};let n=[],o=new Set;for(let i=0;i<r.length;i+=1){let a=la(e,i,r[i]);if("error"in a)return a;let s=a.item.ref;if(typeof s=="string"){let l=s.trim();if(o.has(l))return {error:`${e}: ref ${JSON.stringify(l)} is used twice; a ref names one item`};o.add(l);}n.push(a.item);}return {items:n}}t(ua,"listToWire");function ot(e,r){let n=e,o={};for(let[s,l]of nt){let u=n[s];if(u!==void 0){if(u!==null){let d=aa[s](s,u);if(d!==null)return {error:d}}o[l]=u;}}let i=n.birthDate!==void 0,a=n.birthDatePrecision!==void 0;if(i!==a||i&&n.birthDate===null!=(n.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[s,l]of tt){let u=n[s];if(u===void 0)continue;let d=ua(s,u);if("error"in d)return d;o[l]=d.items;}return Object.keys(o).length>0&&r!==void 0&&$n(r)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:o}}t(ot,"petHealthToWire");var b=t(e=>typeof e=="string"?e:null,"str"),ue=t((e,r)=>typeof r=="string"&&e.has(r)?r:null,"pick"),da=t(e=>typeof e=="boolean"?e:null,"bool");function Se(e,r){return Array.isArray(e)?Object.freeze(e.flatMap(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return [];let o=r(n);return o===null?[]:[o]})):Object.freeze([])}t(Se,"itemsFromWire");function Xn(e){let r=b(e.name);return r===null||r.length===0?null:Object.freeze({ref:b(e.ref),name:r,dose:b(e.dose),frequency:b(e.frequency),startDate:b(e.start_date),endDate:b(e.end_date),notes:b(e.notes)})}t(Xn,"medicationFromWire");function it(e){let r=e.profile_version;return Object.freeze({profileVersion:typeof r=="number"&&Number.isInteger(r)&&r>=0?r:0,sex:ue(Qn,e.sex),spayedNeutered:da(e.spayed_neutered),birthDate:b(e.birth_date),birthDatePrecision:ue(Jn,e.birth_date_precision),activityLevel:ue(Zn,e.activity_level),indoorOutdoor:ue(et,e.indoor_outdoor),foodBrand:b(e.food_brand),foodType:b(e.food_type),microchipId:b(e.microchip_id),allergies:Se(e.allergies,n=>{let o=b(n.allergen);return o===null||o.length===0?null:Object.freeze({ref:b(n.ref),allergen:o,severity:ue(rt,n.severity),notes:b(n.notes)})}),medications:Se(e.medications,Xn),supplements:Se(e.supplements,Xn),conditions:Se(e.conditions,n=>{let o=b(n.condition_name);return o===null||o.length===0?null:Object.freeze({ref:b(n.ref),conditionName:o,diagnosedDate:b(n.diagnosed_date),notes:b(n.notes)})})})}t(it,"petHealthFromWire");var pr=100,yr=50,mr=100,gr=50,br=500,ca=128,fa=6e4;function O(e){return C("validationFailed",{retryable:false,wireMessage:e})}t(O,"invalid");function Y(e,r,n){if(typeof r!="string")return O(`${e} must be a string`);let o=B(r);return o<=n?null:O(`${e} is ${o} characters; the server accepts at most ${n}`)}t(Y,"checkString");function xe(e,r,n){return typeof r=="number"&&Number.isFinite(r)&&r>=0&&r<=n?null:O(`${e} must be a finite number between 0 and ${n}`)}t(xe,"outOfRange");function at(e,r){if(typeof e!="string")return O("pet_ref must be a string");if(e.trim().length===0)return O("pet_ref must not be blank");if(Q(e))return O("pet_ref contains an unpaired surrogate and cannot be encoded");if(r!=null&&typeof r!="object")return O("profile must be an object");let n=[Y("pet_ref",e,ca)];return r?.name!==void 0&&n.push(Y("name",r.name,pr)),r?.species!==void 0&&n.push(Y("species",r.species,yr)),r?.breed!==void 0&&n.push(Y("breed",r.breed,mr)),r?.ageYears!==void 0&&n.push(xe("age_years",r.ageYears,gr)),r?.weightKg!==void 0&&n.push(xe("weight_kg",r.weightKg,br)),n.find(o=>o!==null)??null}t(at,"validate");function lt(e,r){let n=ot(e,r);return "error"in n?{error:O(n.error)}:n}t(lt,"healthToWire");function pa(e){if(typeof e!="object"||e===null)return {error:O("patch must be an object")};let r=e,n=[["name","name",a=>Y("name",a,pr)],["species","species",a=>Y("species",a,yr)],["breed","breed",a=>Y("breed",a,mr)],["ageYears","age_years",a=>xe("age_years",a,gr)],["weightKg","weight_kg",a=>xe("weight_kg",a,br)]],o={};for(let[a,s,l]of n){let u=r[a];if(u!==void 0){if(u!==null){let d=l(u);if(d!==null)return {error:d}}o[s]=u;}}let i=lt(r,r.species);return "error"in i?i:(Object.assign(o,i.body),Object.keys(o).length===0?{error:O("patch must change at least one field")}:{body:o})}t(pa,"patchToWire");function ya(e){if(e==null)return {body:{}};let r=lt(e,e.species);return "error"in r?r:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...r.body}}}t(ya,"toWire");var w=t(e=>typeof e=="string"?e:null,"str"),we=t(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function st(e,r){let n=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:w(n.pet_ref)??r,name:w(n.name),species:w(n.species),breed:w(n.breed),ageYears:we(n.age_years),weightKg:we(n.weight_kg)})}t(st,"fromWire");function hr(e){if(typeof e!="object"||e===null)return null;let r=e,n=w(r.pet_ref);return n===null||n.length===0?null:Object.freeze({petId:w(r.pet_id),petRef:n,name:w(r.name),species:w(r.species),breed:w(r.breed),ageYears:we(r.age_years),weightKg:we(r.weight_kg),updatedAt:w(r.updated_at)})}t(hr,"widgetPetFromWire");function ma(e){let r=hr(e);return r===null?null:Object.freeze({...r,...it(e)})}t(ma,"widgetPetProfileFromWire");function ga(e){let r=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(r.flatMap(n=>{let o=hr(n);return o===null?[]:[o]}))}t(ga,"petListFromWire");function ba(e){return ha(M({auth:e}),M({auth:e,unaryTimeoutMs:fa}))}t(ba,"createPetsRepository");function ha(e,r=e){let n=t((i,a)=>a?{...i,signal:a}:i,"withSignal"),o=t(i=>at(i,void 0)??`/widget/v1/pets/${encodeURIComponent(i)}`,"petPath");return {async list(i){let a=await e.send("pets.list",n({method:"GET",path:"/widget/v1/pets"},i?.signal));return a.ok?k(ga(a.value)):y(a.error)},async registerPet(i,a,s){let l=at(i,a);if(l!==null)return y(l);let u=ya(a);if("error"in u)return y(u.error);let f={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(i)}`,body:u.body},c=await e.send("pets.registerPet",s?.signal?{...f,signal:s.signal}:f);return c.ok?k(st(c.value,i)):y(c.error)},async updatePet(i,a,s){let l=o(i);if(typeof l!="string")return y(l);let u=pa(a);if("error"in u)return y(u.error);let d=await e.send("pets.updatePet",n({method:"PATCH",path:l,body:u.body},s?.signal));return d.ok?k(st(d.value,i)):y(d.error)},async getPetProfile(i,a){let s=o(i);if(typeof s!="string")return y(s);let l=await e.send("pets.getPetProfile",n({method:"GET",path:`${s}/profile`},a?.signal));if(!l.ok)return y(l.error);let u=ma(l.value);return u===null?y(C("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):k(u)},async deletePet(i,a){let s=o(i);if(typeof s!="string")return y(s);let l=await e.send("pets.deletePet",n({method:"DELETE",path:s},a?.signal));return l.ok?k(void 0):y(l.error)},async eraseUserData(i){let a=await r.send("pets.eraseUserData",n({method:"DELETE",path:"/widget/v1/me"},i?.signal),{maxAttempts:1});return a.ok?k(void 0):y(a.error)}}}t(ha,"createPetsRepositoryOver");var vr=Object.freeze(["better","same","worse"]),Ea=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ut(e){return y(C("validationFailed",{retryable:false,wireMessage:e}))}t(ut,"invalid");function Er(){return y(C("internalError",{retryable:false}))}t(Er,"malformed");function dt(e){return typeof e!="string"||e.trim().length===0?C("validationFailed",{retryable:false,wireMessage:"pet_ref must not be blank"}):Q(e)?C("validationFailed",{retryable:false,wireMessage:"pet_ref contains an unpaired surrogate and cannot be encoded"}):`/widget/v1/pets/${encodeURIComponent(e)}/cases`}t(dt,"petPath");var I=t(e=>typeof e=="string"?e:null,"str");function ct(e){if(typeof e!="object"||e===null)return null;let r=e,n=I(r.case_id),o=I(r.status);if(n===null||o===null)return null;let i=I(r.last_response);return Object.freeze({caseId:n,status:o,bodyLocation:I(r.body_location),lastResponse:i!==null&&vr.includes(i)?i:null,checkInDueAt:I(r.check_in_due_at),openedAt:I(r.opened_at),resolvedAt:I(r.resolved_at),resolutionText:I(r.resolution_text)})}t(ct,"caseFromWire");function va(e){return _a(M({auth:e}))}t(va,"createCasesRepository");function _a(e){return {async list(r,n){let o=dt(r);if(typeof o!="string")return y(o);let i=await e.send("cases.list",{method:"GET",path:o,...n?.signal?{signal:n.signal}:{}});if(!i.ok)return y(i.error);let a=typeof i.value=="object"&&i.value!==null?i.value.cases:null;if(!Array.isArray(a))return Er();let s=a.map(ct);return s.every(l=>l!==null)?k(Object.freeze(s)):Er()},async checkin(r,n,o,i){let a=dt(r);if(typeof a!="string")return y(a);if(typeof n!="string"||!Ea.test(n))return ut("case_id must be a UUID");if(!vr.includes(o))return ut("response must be one of better, same, worse");let s=await e.send("cases.checkin",{method:"POST",path:`${a}/${n}/checkin`,body:{response:o},...i?.signal?{signal:i.signal}:{}});if(!s.ok)return y(s.error);let l=typeof s.value=="object"&&s.value!==null?s.value:{},u=ct(l.case);return u===null?Er():k(Object.freeze({case:u,ctaDeepLink:I(l.cta_deep_link)}))}}}t(_a,"createCasesRepositoryOver");exports.AUTO_RETRYABLE_CODES=ht;exports.BACKOFF_BASE_MS=vt;exports.BACKOFF_CAP_MS=De;exports.CHECKIN_ANSWERS=vr;exports.CONTRACT_ERROR_ROWS=Tr;exports.DARK_VARIANT_GROUND=Ho;exports.DARK_VARIANT_LIGHTNESS_CEILING=ir;exports.DARK_VARIANT_LIGHTNESS_FLOOR=Ko;exports.DARK_VARIANT_LIGHTNESS_STEP=$o;exports.DARK_VARIANT_TARGET_RATIO=vn;exports.DEFAULT_CONTRACT_VERSION=kt;exports.DEFAULT_MAX_FONT_SCALE=or;exports.DOC_SITE_ORIGIN=Cr;exports.EASING_CURVES=nr;exports.EMPTY_FRAME_ARRAYS=vs;exports.ENTITLEMENTS_PATH=qn;exports.ENV_API_BASE_URL=Ir;exports.EVERFUR_DARK=Ce;exports.EVERFUR_ERROR_CATEGORIES=Aa;exports.EVERFUR_ERROR_CODES=Oa;exports.EVERFUR_LIGHT=ae;exports.EverfurConfigError=E;exports.EverfurThrownError=Le;exports.HIGH_CONTRAST_TARGET_RATIO=Vo;exports.LOCKABLE_THEME_FIELDS=On;exports.MAX_FONT_SCALE_CEILING=Mn;exports.MAX_RETRY_ATTEMPTS=wr;exports.PET_AGE_YEARS_MAX=gr;exports.PET_BREED_MAX=mr;exports.PET_NAME_MAX=pr;exports.PET_SPECIES_MAX=yr;exports.PET_WEIGHT_KG_MAX=br;exports.RETRYABLE_CONTRACT_CODES=Et;exports.SDK_PLATFORM=Tt;exports.SDK_VERSION=Ct;exports.SLOT_LOCK_PREFIX=se;exports.SLOT_MIN_BORDER_CONTRAST=oi;exports.SLOT_MIN_CONTRAST=S;exports.SYSTEM_FONT_FAMILY=$;exports.SYSTEM_MONO_FAMILY=L;exports.TEXT_SCALE_FLOOR=Fi;exports.TEXT_SCALE_TIER_CAPS=Re;exports.THEME_SCHEMA_VERSIONS=An;exports.THEME_SLOT_KEYS=sl;exports.THEME_SLOT_NAMES=Z;exports.acceptedFrame=Br;exports.analysisCompleteFrame=Kr;exports.analysisStartedFrame=Hr;exports.assertNever=Es;exports.authHeaders=zt;exports.authedSend=zr;exports.backoffDelayMs=Or;exports.bufferedTextByteSource=Ds;exports.buildBaseHeaders=Dr;exports.canRecreateOnNotFound=Pa;exports.categoryFor=Sr;exports.checkPublishableKey=St;exports.contractDocUrl=gt;exports.contractErrorFor=ge;exports.contrastRatio=R;exports.conversationId=ns;exports.createCasesRepository=va;exports.createHttpTransport=Ls;exports.createIdentityProvider=ms;exports.createPetsRepository=ba;exports.createRequestFunnel=M;exports.cssCubicBezier=tr;exports.decideCapability=qs;exports.deepFreeze=A;exports.deltaFrame=Ur;exports.deniedDecisionsFor=Us;exports.deriveDarkVariant=Cn;exports.deriveHighContrast=Tn;exports.doneFrame=qr;exports.err=y;exports.errorFrame=D;exports.errorFromResponse=Zr;exports.eventSourceByteSource=Qt;exports.eventSourceRequestId=to;exports.face=Zi;exports.fetchByteSource=Be;exports.fetchEntitlements=kl;exports.fromHttpStatus=Fr;exports.fromWire=X;exports.getGlobalFetch=Ue;exports.guardSlotContrast=Fn;exports.hardenHttpsUrl=sr;exports.heartbeatFrame=jr;exports.isAutoRetryable=z;exports.isEmptyBranding=ke;exports.isErr=Ua;exports.isKnownBrandingSchema=In;exports.isOk=ja;exports.isRetryableCode=xr;exports.lockedFieldsOf=Pn;exports.makeEverfurError=C;exports.mergeThemeSlots=Sn;exports.networkError=ve;exports.newSessionId=gs;exports.ok=k;exports.parseClientBranding=G;exports.parseColor=T;exports.parseSse=Ee;exports.parseThemeSlots=kn;exports.petRef=es;exports.previewTheme=El;exports.publishedDocUrl=kr;exports.readableOn=cn;exports.requestIdOf=je;exports.requestJson=eo;exports.requestRaw=Ms;exports.requires=uo;exports.resolveApiBaseUrl=Ga;exports.resolveClientConfig=Wa;exports.resolveEntitlements=js;exports.resolveTheme=xi;exports.shouldRetry=Ia;exports.tryResolveApiBaseUrl=Pr;exports.tryResolveClientConfig=Ft;exports.unknownFrame=$r;exports.unsafeClientId=ss;exports.unsafeConversationId=is;exports.unsafeDocumentId=ls;exports.unsafeJobId=us;exports.unsafePetRef=ts;exports.unsafeRecordsRequestId=ds;exports.unsafeResponseId=as;exports.unsafeUserRef=os;exports.unwrap=qa;exports.userFacingError=Me;exports.userRef=rs;exports.widgetPetFromWire=hr;exports.withAuthHeaders=te;exports.withServerBranding=Ln;
|
package/dist/client/index.d.cts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { b as EverfurErrorCode } from '../EverfurResult-DN9pL2Ab.cjs';
|
|
2
2
|
export { A as AUTO_RETRYABLE_CODES, B as BACKOFF_BASE_MS, k as BACKOFF_CAP_MS, l as EVERFUR_ERROR_CATEGORIES, m as EVERFUR_ERROR_CODES, d as EverfurConfigError, E as EverfurError, a as EverfurErrorCategory, c as EverfurResult, e as EverfurThrownError, M as MAX_RETRY_ATTEMPTS, n as MakeEverfurErrorOptions, R as RETRYABLE_CONTRACT_CODES, o as backoffDelayMs, p as canRecreateOnNotFound, f as categoryFor, q as err, r as fromHttpStatus, s as fromWire, t as isAutoRetryable, i as isErr, g as isOk, h as isRetryableCode, v as makeEverfurError, w as ok, x as shouldRetry, u as unwrap, j as userFacingError } from '../EverfurResult-DN9pL2Ab.cjs';
|
|
3
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config
|
|
3
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config--Wu1Umhd.cjs';
|
|
4
4
|
export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids-B2GAAifq.cjs';
|
|
5
|
-
export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity-
|
|
5
|
+
export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity-C2-08BZW.cjs';
|
|
6
6
|
export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve-D4Ywz5OS.cjs';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { F as
|
|
10
|
-
export { E as EverfurFaceStyle, f as face } from '../typeStyle-
|
|
11
|
-
export {
|
|
7
|
+
export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository-BpJ7tiwl.cjs';
|
|
8
|
+
import { a as EverfurTheme } from '../branding-CsRdeNwK.cjs';
|
|
9
|
+
export { C as ClientBranding, D as DEFAULT_MAX_FONT_SCALE, B as EASING_CURVES, F as EVERFUR_DARK, G as EVERFUR_LIGHT, d as EverfurColorTokens, H as EverfurEasingCurve, c as EverfurFontFaceKey, e as EverfurFontFamilies, b as EverfurFontWeight, f as EverfurLetterSpacingTokens, g as EverfurLineHeightTokens, h as EverfurMotionDurationTokens, i as EverfurMotionTokens, j as EverfurRadiusTokens, k as EverfurSpaceTokens, l as EverfurSpringToken, m as EverfurTextColorTokens, I as EverfurTextScaleTier, n as EverfurThemeFontFaceKey, o as EverfurThemeFontUrlsInput, p as EverfurThemeFontsInput, E as EverfurThemeInput, q as EverfurThemeMeta, r as EverfurThemeSlot, s as EverfurThemeSlotInput, t as EverfurThemeSlotKey, u as EverfurThemeSlotName, v as EverfurThemeSlots, w as EverfurThemeSlotsInput, x as EverfurTypeSizeTokens, y as EverfurTypeTokens, z as EverfurWeightTokens, L as LOCKABLE_THEME_FIELDS, J as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, K as SLOT_LOCK_PREFIX, N as SLOT_MIN_BORDER_CONTRAST, O as SLOT_MIN_CONTRAST, P as SYSTEM_FONT_FAMILY, Q as SYSTEM_MONO_FAMILY, U as SlotGrounds, V as SlotLockName, S as SurfaceStyle, W as TEXT_SCALE_TIER_CAPS, X as THEME_SCHEMA_VERSIONS, T as THEME_SLOT_KEYS, A as THEME_SLOT_NAMES, Y as ThemeLockName, Z as cssCubicBezier, _ as deepFreeze, $ as guardSlotContrast, a0 as hardenHttpsUrl, a1 as isEmptyBranding, a2 as isKnownBrandingSchema, a3 as lockedFieldsOf, a4 as mergeThemeSlots, a5 as parseClientBranding, a6 as parseThemeSlots } from '../branding-CsRdeNwK.cjs';
|
|
10
|
+
export { E as EverfurFaceStyle, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, p as previewTheme, r as resolveTheme, w as withServerBranding } from '../typeStyle-CKqVYD6L.cjs';
|
|
11
|
+
export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel-BjDpqqvm.cjs';
|
|
12
|
+
export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository-B_gKbAzJ.cjs';
|
|
13
|
+
export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository-DwtZVsbj.cjs';
|
|
12
14
|
import '../ErrorPolicyPort-CNf4uQZP.cjs';
|
|
13
15
|
import '../profile-CSs1wlXT.cjs';
|
|
14
16
|
|
|
@@ -62,7 +64,7 @@ declare function contractDocUrl(entry: ContractErrorRow): string;
|
|
|
62
64
|
* Is the `/errors` reference page actually published?
|
|
63
65
|
*
|
|
64
66
|
* Measured 2026-08-23: it is NOT. `everfur-frontend` has no `errors` route, so every `docUrl` the SDK
|
|
65
|
-
* emitted was a dangling pointer
|
|
67
|
+
* emitted was a dangling pointer: a partner received the string `/errors#RATE_LIMITED`, with no origin to
|
|
66
68
|
* resolve it against and no page behind it if they guessed one. Handing out a link that cannot be opened is
|
|
67
69
|
* worse than handing out none: it reads as documentation that exists.
|
|
68
70
|
*
|