@everfur/sdk 0.4.0 → 0.5.1

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.
Files changed (177) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/README.md +9 -8
  3. package/dist/{Chat-BZZ-Py5l.d.ts → Chat-Rzplrf5M.d.ts} +17 -3
  4. package/dist/{Chat-Dq4fffIO.d.cts → Chat-ypo6miKm.d.cts} +17 -3
  5. package/dist/{DepthViews-BG3E25MD.d.ts → DepthViews-CeTfPUBX.d.ts} +1 -1
  6. package/dist/{DepthViews-B_hIypI6.d.cts → DepthViews-ClykXOJj.d.cts} +1 -1
  7. package/dist/{DepthViews-CL75jyRA.d.cts → DepthViews-Cui3oonj.d.cts} +1 -1
  8. package/dist/{DepthViews-CkYri51q.d.ts → DepthViews-baYLMNQ-.d.ts} +1 -1
  9. package/dist/{ErrorPolicyPort-CwbfmxzJ.d.ts → ErrorPolicyPort-D22LUVrK.d.ts} +1 -1
  10. package/dist/{ErrorPolicyPort-CNf4uQZP.d.cts → ErrorPolicyPort-D6CybiqJ.d.cts} +1 -1
  11. package/dist/{EverfurResult-DN9pL2Ab.d.cts → EverfurError-DmELDpXp.d.cts} +1 -67
  12. package/dist/{EverfurResult-DN9pL2Ab.d.ts → EverfurError-DmELDpXp.d.ts} +1 -67
  13. package/dist/EverfurResult-SGvHKsCB.d.ts +69 -0
  14. package/dist/EverfurResult-ZtH-YV1h.d.cts +69 -0
  15. package/dist/animations/index.cjs +1 -1
  16. package/dist/animations/index.d.cts +6 -5
  17. package/dist/animations/index.d.ts +6 -5
  18. package/dist/animations/index.js +1 -1
  19. package/dist/{attachments-D_SECjr1.d.cts → attachments-CwsR-bPN.d.cts} +7 -6
  20. package/dist/{attachments-BrUWQYNK.d.ts → attachments-CzZ7in24.d.ts} +7 -6
  21. package/dist/{attachments-DpldrvIW.d.ts → attachments-D3HCBmOE.d.ts} +3 -3
  22. package/dist/{attachments-BorG422I.d.cts → attachments-Nk73Lll8.d.cts} +3 -3
  23. package/dist/{bookingCopy-SREvkG19.d.cts → bookingCopy-Dv8rKqyV.d.cts} +417 -14
  24. package/dist/{bookingCopy-CqtDYvCR.d.ts → bookingCopy-SDkXaxDf.d.ts} +417 -14
  25. package/dist/branding-Xb_wL8N1.d.cts +212 -0
  26. package/dist/branding-xpQ056sM.d.ts +212 -0
  27. package/dist/callCopy-rDH9JTFo.d.cts +45 -0
  28. package/dist/callCopy-rDH9JTFo.d.ts +45 -0
  29. package/dist/callRoom-7wrE3RP2.d.ts +62 -0
  30. package/dist/callRoom-B_EqaUzx.d.cts +62 -0
  31. package/dist/{casesRepository-v6QczS9N.d.ts → casesRepository-BTAecTnF.d.ts} +14 -2
  32. package/dist/{casesRepository-DwtZVsbj.d.cts → casesRepository-aryld7fJ.d.cts} +14 -2
  33. package/dist/chat/index.cjs +1 -1
  34. package/dist/chat/index.d.cts +12 -11
  35. package/dist/chat/index.d.ts +12 -11
  36. package/dist/chat/index.js +1 -1
  37. package/dist/client/index.cjs +5 -5
  38. package/dist/client/index.d.cts +14 -12
  39. package/dist/client/index.d.ts +14 -12
  40. package/dist/client/index.js +5 -5
  41. package/dist/{config-C7eb_IMD.d.ts → config-6qS7Sohy.d.cts} +3 -2
  42. package/dist/{config--Wu1Umhd.d.cts → config-X6BtwDwQ.d.ts} +3 -2
  43. package/dist/consent/index.cjs +1 -1
  44. package/dist/consent/index.d.cts +9 -8
  45. package/dist/consent/index.d.ts +9 -8
  46. package/dist/consent/index.js +1 -1
  47. package/dist/{context-CahAEha8.d.ts → context-7f3Nb_xE.d.ts} +9 -8
  48. package/dist/{context-CL3lyuy1.d.cts → context-CkqPM4Ml.d.cts} +9 -8
  49. package/dist/{copy-UeUJVk8X.d.cts → copy-Bd__Pw5s.d.cts} +5 -4
  50. package/dist/{copy-DdVFDL01.d.ts → copy-NgKgOOET.d.ts} +5 -4
  51. package/dist/core/index.cjs +9 -9
  52. package/dist/core/index.d.cts +19 -17
  53. package/dist/core/index.d.ts +19 -17
  54. package/dist/core/index.js +9 -9
  55. package/dist/{depth-DvPwPuT_.d.ts → depth-CYPH92jE.d.ts} +6 -5
  56. package/dist/{depth-D5HwcvKC.d.cts → depth-CyjaJJ6V.d.cts} +6 -5
  57. package/dist/{entitlementRepository-B7egEdW6.d.ts → entitlementRepository-DdeFuEKp.d.ts} +4 -4
  58. package/dist/{entitlementRepository-BpJ7tiwl.d.cts → entitlementRepository-Dl1qRLcJ.d.cts} +4 -4
  59. package/dist/{identity-C2-08BZW.d.cts → identity-DjqhDm5Z.d.cts} +2 -2
  60. package/dist/{identity-CEi9GRFZ.d.ts → identity-Dy_L7Yq4.d.ts} +2 -2
  61. package/dist/index.cjs +6 -6
  62. package/dist/index.d.cts +19 -17
  63. package/dist/index.d.ts +19 -17
  64. package/dist/index.js +6 -6
  65. package/dist/{models-D2EUxPZY.d.cts → models-Bn2z0NNo.d.cts} +1 -1
  66. package/dist/{models-B-Uh2LTf.d.ts → models-DSqA5Ahs.d.ts} +1 -1
  67. package/dist/notifications/index.cjs +2 -2
  68. package/dist/notifications/index.d.cts +5 -4
  69. package/dist/notifications/index.d.ts +5 -4
  70. package/dist/notifications/index.js +2 -2
  71. package/dist/{pets-JVCXgRgR.d.cts → pets-BSG2qbr_.d.cts} +2 -2
  72. package/dist/{pets-DJv2sj2H.d.ts → pets-D7cZutrX.d.ts} +2 -2
  73. package/dist/{petsRepository-B_gKbAzJ.d.cts → petsRepository-D1bnxDZg.d.cts} +2 -2
  74. package/dist/{petsRepository-Bk6GDwLs.d.ts → petsRepository-DhsX3GLw.d.ts} +2 -2
  75. package/dist/photo/index.cjs +1 -1
  76. package/dist/photo/index.d.cts +3 -2
  77. package/dist/photo/index.d.ts +3 -2
  78. package/dist/photo/index.js +1 -1
  79. package/dist/{ports-D7YW8qz9.d.ts → ports-C0m1G1fS.d.ts} +13 -6
  80. package/dist/{ports-BY2ph0_y.d.cts → ports-DNXyyzZF.d.cts} +13 -6
  81. package/dist/records/depth/index.cjs +2 -2
  82. package/dist/records/depth/index.d.cts +11 -10
  83. package/dist/records/depth/index.d.ts +11 -10
  84. package/dist/records/depth/index.js +2 -2
  85. package/dist/records/index.cjs +3 -3
  86. package/dist/records/index.d.cts +25 -14
  87. package/dist/records/index.d.ts +25 -14
  88. package/dist/records/index.js +3 -3
  89. package/dist/{requestFunnel-BjDpqqvm.d.cts → requestFunnel-Bqc1inM9.d.cts} +5 -4
  90. package/dist/{requestFunnel-DFMGcluw.d.ts → requestFunnel-FvE5yLDD.d.ts} +5 -4
  91. package/dist/{runtimeTypes-w5KqBMcs.d.ts → runtimeTypes-C0yPBz89.d.ts} +7 -7
  92. package/dist/{runtimeTypes-gZEJu-da.d.cts → runtimeTypes-RN-VXTFV.d.cts} +7 -7
  93. package/dist/server/events/index.cjs +1 -1
  94. package/dist/server/events/index.d.cts +4 -3
  95. package/dist/server/events/index.d.ts +4 -3
  96. package/dist/server/events/index.js +1 -1
  97. package/dist/server/index.cjs +1 -1
  98. package/dist/server/index.d.cts +5 -4
  99. package/dist/server/index.d.ts +5 -4
  100. package/dist/server/index.js +1 -1
  101. package/dist/televet/booking/index.cjs +1 -1
  102. package/dist/televet/booking/index.d.cts +310 -32
  103. package/dist/televet/booking/index.d.ts +310 -32
  104. package/dist/televet/booking/index.js +1 -1
  105. package/dist/televet/call/index.cjs +1 -1
  106. package/dist/televet/call/index.d.cts +25 -5
  107. package/dist/televet/call/index.d.ts +25 -5
  108. package/dist/televet/call/index.js +1 -1
  109. package/dist/televet/index.cjs +1 -1
  110. package/dist/televet/index.d.cts +41 -71
  111. package/dist/televet/index.d.ts +41 -71
  112. package/dist/televet/index.js +1 -1
  113. package/dist/televetGlobal-CEk0_cW9.d.cts +34 -0
  114. package/dist/televetGlobal-Cs9Wbqsy.d.ts +34 -0
  115. package/dist/testing/index.cjs +3 -3
  116. package/dist/testing/index.d.cts +3 -2
  117. package/dist/testing/index.d.ts +3 -2
  118. package/dist/testing/index.js +3 -3
  119. package/dist/testing/rn/index.cjs +1 -1
  120. package/dist/testing/rn/index.d.cts +13 -11
  121. package/dist/testing/rn/index.d.ts +13 -11
  122. package/dist/testing/rn/index.js +1 -1
  123. package/dist/testing/web/index.cjs +1 -1
  124. package/dist/testing/web/index.d.cts +14 -13
  125. package/dist/testing/web/index.d.ts +14 -13
  126. package/dist/testing/web/index.js +1 -1
  127. package/dist/{timelineRows-C15jxFFH.d.ts → timelineRows-D4U6A8zE.d.ts} +1 -1
  128. package/dist/{timelineRows-odO8g9r2.d.cts → timelineRows-DAB5dpjF.d.cts} +1 -1
  129. package/dist/{branding-CsRdeNwK.d.cts → tokens-CIngRkvt.d.cts} +7 -211
  130. package/dist/{branding-CsRdeNwK.d.ts → tokens-CIngRkvt.d.ts} +7 -211
  131. package/dist/{typeStyle-DmoyacDG.d.ts → typeStyle-DHJzDaUo.d.cts} +2 -1
  132. package/dist/{typeStyle-CKqVYD6L.d.cts → typeStyle-YPS_MXeI.d.ts} +2 -1
  133. package/dist/{useRecordsDepth-crhBllQK.d.ts → useRecordsDepth--ObtMyjH.d.ts} +24 -5
  134. package/dist/{useRecordsDepth-C6rjEaLn.d.cts → useRecordsDepth-B35y8bV-.d.cts} +24 -5
  135. package/dist/{useVetVisit-CjmMa896.d.ts → useVetVisit-BsjoDO-n.d.ts} +21 -6
  136. package/dist/{useVetVisit-Bc84hWUU.d.cts → useVetVisit-Ds8f1peV.d.cts} +21 -6
  137. package/dist/video/index.cjs +1 -1
  138. package/dist/video/index.d.cts +3 -2
  139. package/dist/video/index.d.ts +3 -2
  140. package/dist/video/index.js +1 -1
  141. package/dist/{view-DyitEO0m.d.cts → view-B-Toym_j.d.cts} +5 -4
  142. package/dist/{view-Bxwxp4xD.d.ts → view-D9JqNQai.d.ts} +5 -4
  143. package/dist/web/consent/index.cjs +1 -1
  144. package/dist/web/consent/index.d.cts +9 -8
  145. package/dist/web/consent/index.d.ts +9 -8
  146. package/dist/web/consent/index.js +1 -1
  147. package/dist/web/index.cjs +10 -10
  148. package/dist/web/index.d.cts +42 -19
  149. package/dist/web/index.d.ts +42 -19
  150. package/dist/web/index.js +10 -10
  151. package/dist/web/notifications/index.cjs +2 -2
  152. package/dist/web/notifications/index.d.cts +7 -6
  153. package/dist/web/notifications/index.d.ts +7 -6
  154. package/dist/web/notifications/index.js +2 -2
  155. package/dist/web/records/depth/index.cjs +2 -2
  156. package/dist/web/records/depth/index.d.cts +11 -10
  157. package/dist/web/records/depth/index.d.ts +11 -10
  158. package/dist/web/records/depth/index.js +2 -2
  159. package/dist/web/records/index.cjs +3 -3
  160. package/dist/web/records/index.d.cts +53 -35
  161. package/dist/web/records/index.d.ts +53 -35
  162. package/dist/web/records/index.js +3 -3
  163. package/dist/web/televet/booking/index.cjs +2 -1
  164. package/dist/web/televet/booking/index.d.cts +458 -33
  165. package/dist/web/televet/booking/index.d.ts +458 -33
  166. package/dist/web/televet/booking/index.js +2 -1
  167. package/dist/web/televet/call/index.cjs +1 -1
  168. package/dist/web/televet/call/index.d.cts +3 -1
  169. package/dist/web/televet/call/index.d.ts +3 -1
  170. package/dist/web/televet/call/index.js +1 -1
  171. package/dist/web/televet/index.cjs +1 -1
  172. package/dist/web/televet/index.d.cts +40 -74
  173. package/dist/web/televet/index.d.ts +40 -74
  174. package/dist/web/televet/index.js +1 -1
  175. package/package.json +3 -2
  176. package/dist/callCopy-DoQKG3-L.d.cts +0 -40
  177. package/dist/callCopy-DoQKG3-L.d.ts +0 -40
@@ -1 +1 @@
1
- import {createContext,useMemo,useContext}from'react';import {z}from'zod';var Ce=Object.defineProperty;var n=(e,t)=>Ce(e,"name",{value:t,configurable:true});function T(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(T,"ok");function l(e){return Object.freeze({ok:false,error:e})}n(l,"err");var x=class x extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,x.prototype);}};n(x,"EverfurConfigError");var R=x;var H=Symbol.for("@everfur/sdk#EverfurContext@v1"),W=globalThis,K=W[H]??(W[H]=createContext(null));K.displayName??="EverfurContext";function h(){let e=useContext(K);if(e===null)throw new R("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(h,"useEverfurContext");function ke(){let{runtime:e}=h();return useMemo(()=>({apply:n(t=>e.updateEntitlements(t),"apply")}),[e])}n(ke,"useEverfurTestEntitlements");var D=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(D.map(e=>e.wireCode));var Fe=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"}),G=Object.freeze(D.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Fe[e.wireCode]}))),Ie=new Map(G.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ae=Object.freeze(["http_envelope",...[...new Set(G.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function O(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...Ae]){let a=Ie.get(o+r);if(a)return a}}n(O,"contractErrorFor");function Pe(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(Pe,"contractDocUrl");function Q(e){return null}n(Q,"publishedDocUrl");var je=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 X(e){return je[e]}n(X,"categoryFor");function J(e){let t=O(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.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"}}n(J,"fromWire");var ze=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function U(e){return ze.has(e)}n(U,"isAutoRetryable");var qe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Z(e){return U(e)||qe.has(e)}n(Z,"isRetryableCode");var De=500,V=8e3,ee=4;function te(e,t=Math.random){let r=Math.max(0,e),o=Math.min(De*2**r,V);return Math.floor(t()*o)}n(te,"backoffDelayMs");var Ue=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 Ve(e){return Ue[e]}n(Ve,"userFacingError");function re(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(re,"defineHidden");var Me=/^[a-z][a-z0-9_]{0,63}$/;function y(e,t){let r=O(t?.wireCode,t?.wireEnvelope),o={code:e,category:X(e),retryable:t?.retryable??Z(e),displayMessage:Ve(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Me.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&re(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&re(o,"raw",t.raw),Object.freeze(o)}n(y,"makeEverfurError");function ne(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})}n(ne,"errorFrame");function Be(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}n(Be,"authHeaders");function S(e,t){return {...e,headers:{...Ye(e.headers),...Be(t)}}}n(S,"withAuthHeaders");function Ye(e){if(!e)return {};let t={};for(let[r,o]of Object.entries(e)){let a=r.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(t[r]=o);}return t}n(Ye,"stripAuthHeaders");async function oe(e,t){if(t.mode==="anonymous")return t.transport.request(S(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return l(M())}let o=await t.transport.request(S(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await t.identity.currentToken({forceRefresh:!0});}catch{return l(M())}let s=await t.transport.request(S(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?l(M(s.error.httpStatus)):s}n(oe,"authedSend");function M(e){return y("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(M,"authRejectedError");function ie(e){return y("internalError",{retryable:true,wireMessage:He(e)})}n(ie,"networkError");function He(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(He,"describeCause");var We=3e4,Ke=V*2,$e="idempotency-key",Ge=new Set(["POST","PUT","PATCH","DELETE"]),Qe=Object.freeze({onEvent(){}}),Xe=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Je(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}n(Je,"seededIdempotencyKey");function k(e){let t=e.observer??Qe,r=e.timers??Xe,o=e.rng??Math.random,a=e.sleep??((m,d)=>ct(m,r,d)),s=e.maxAttempts??ee,u=e.unaryTimeoutMs??We,p=e.newIdempotencyKey??et(),c=n(m=>{try{t.onEvent(m);}catch{}},"emit");async function f(m,d,b){let A=b?.maxAttempts,ge=Math.max(1,A??s),Re=b?.idempotent??Ge.has(d.method),Se=b?.idempotencyKey===void 0?null:Je(b.idempotencyKey),P=Re?Se??p():null,we=Ze(d,P),j=0;for(;;){let E=n(q=>Object.freeze({call:m,method:d.method,path:d.path,attempt:j,...P?{idempotencyKey:P}:{},...q}),"stamp");c(E({phase:"attempt"}));let B=ut(u,r),Y=dt(B.signal,d.signal),g;try{g=await oe({...we,signal:Y.signal},e.auth);}catch(q){g=l(ie(q));}finally{Y.dispose(),B.cancel();}if(g.ok)return c(E({phase:"settled",ok:true,reason:"ok"})),g;let v=g.error,C=rt(v,j,{maxAttempts:ge,rng:o,now:r.now(),aborted:d.signal?.aborted===true,...A!==void 0?{perCallMaxAttempts:A}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),z={ok:false,code:v.code,reason:C.reason,...v.httpStatus!==void 0?{httpStatus:v.httpStatus}:{},...v.requestId!==void 0?{requestId:v.requestId}:{}};if(!C.retry)return c(E({phase:"settled",...z})),l(v);if(c(E({phase:"retry",...z,delayMs:C.delayMs})),await a(C.delayMs,d.signal),d.signal?.aborted===true)return c(E({phase:"settled",...z,reason:"aborted"})),l(v);j+=1;}}n(f,"send");async function w(m){return S(m,await lt(e.auth))}n(w,"authorize");async function*Ee(m,d,b){c(Object.freeze({call:m,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,b);}catch{yield ne({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(Ee,"stream"),Object.freeze({send:f,authorize:w,stream:Ee})}n(k,"createRequestFunnel");function Ze(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==$e&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Ze,"assembleHeaders");function et(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(et,"defaultIdempotencyKeyFactory");var tt=10;function rt(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=nt(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!U(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let u=n(()=>{if(r.policy===void 0)return null;let f;try{f=r.policy.maxAttempts(e.code);}catch{return null}return typeof f!="number"||!Number.isFinite(f)?null:Math.max(1,Math.min(tt,Math.floor(f)))},"policyCeiling"),p=r.perCallMaxAttempts??u()??r.maxAttempts;if(t+1>=p)return {retry:false,reason:"attempts-exhausted"};let c=ot(e,r.now);return c!==null?c>Ke?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:c}:{retry:true,reason:a,delayMs:te(t,r.rng)}}n(rt,"decideRetry");function nt(e){let t=e.code==="unknown"?J(st(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(nt,"throttleKind");function ot(e,t){let r=it(e.raw);if(r===null)return null;let o=r-t;return o>0?o:0}n(ot,"retryOverrideMs");function it(e){for(let t of se(e)){let r=t.resets_at,o=at(r);if(o!==null)return o}return null}n(it,"findResetsAt");function se(e){if(!ae(e))return [];let t=[e];for(let r of ["error","detail"]){let o=e[r];ae(o)&&t.push(o);}return t}n(se,"candidateScopes");function at(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}n(at,"parseInstantMs");function st(e){for(let t of se(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(st,"rawWireCode");function ae(e){return typeof e=="object"&&e!==null}n(ae,"isRecord");async function lt(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}:{}}}n(lt,"resolveDeviceAuth");function ut(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(ut,"boundedSignal");function dt(e,t){let r=n(()=>{},"noop");if(!t)return {signal:e,dispose:r};let o=new AbortController;if(e.aborted||t.aborted)return o.abort(),{signal:o.signal,dispose:r};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a);},"dispose")}}n(dt,"mergeSignals");function ct(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(o=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",s),o();},e),s=n(()=>{t.clearTimeout(a),o();},"onAbort");r?.addEventListener("abort",s,{once:true});})}n(ct,"delayAbortable");function F(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let o=e.charCodeAt(t+1);if(!(o>=56320&&o<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}n(F,"hasLoneSurrogate");function le(e){return [...e].length}n(le,"serverLength");var ce=new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review","published","failed","revoked"]),ue=Object.freeze({submitted:"requested",sent:"requested",dispatching:"requested",awaiting_response:"awaiting_clinic",clinic_responded_no_records:"awaiting_clinic",records_received:"received",parsing_failed:"in_review",review_email_failed:"in_review",clinic_declined:"failed"});function pt(e){let t=Object.prototype.hasOwnProperty.call(ue,e)?ue[e]:void 0;if(t!==void 0)return t;let r=e;return ce.has(r)?r:"parsing"}n(pt,"normalizeStatus");var ft=z.object({request_id:z.string().min(1),pet_ref:z.string().min(1),status:z.string(),simple_status:z.string().nullish(),simple_status_detail:z.string().nullish(),status_label:z.string().optional(),dispatch_status:z.string().nullish(),can_retry_send:z.boolean().optional(),can_revoke:z.boolean().optional(),can_convert_to_upload:z.boolean().optional(),can_update_clinic_email:z.boolean().optional(),reminder_count:z.number().int().nonnegative().optional(),last_reminder_at:z.string().nullish(),waiting_expectation:z.string().nullish(),document_count:z.number().optional(),held_item_count:z.number().optional(),received_at:z.string().nullish(),parsing_started_at:z.string().nullish(),review_started_at:z.string().nullish(),created_at:z.string().optional(),updated_at:z.string().optional(),source:z.string().nullish().catch(null),action_needed_label:z.string().nullish().catch(null),failure_reason:z.string().nullish().catch(null),failure_code:z.string().nullish().catch(null),recovery_stage:z.string().nullish().catch(null),show_clinic_phone:z.boolean().optional().catch(void 0),clinic_name:z.string().nullish().catch(null),clinic_email:z.string().nullish().catch(null),clinic_phone:z.string().nullish().catch(null),converted_to_upload_at:z.string().nullish().catch(null),request_group_id:z.string().nullish().catch(null)}).passthrough();function pe(e){let t=ft.safeParse(e);if(!t.success)return null;let r=t.data,o=yt(r.simple_status),a=o==="requested"&&(r.status==="awaiting_upload"||r.simple_status_detail==="awaiting_owner_upload")?"awaiting_upload":o==="parsing"&&(r.simple_status_detail==="in_review"||r.simple_status_detail==="review_email_failed")?"in_review":o??pt(r.status);return Object.freeze({id:r.request_id,petRef:r.pet_ref,status:a,simpleStatus:o,simpleStatusDetail:r.simple_status_detail??null,statusLabel:r.status_label??"",dispatchStatus:r.dispatch_status??null,canRetrySend:r.can_retry_send===true,canRevoke:r.can_revoke===true,canConvertToUpload:r.can_convert_to_upload===true,canUpdateClinicEmail:r.can_update_clinic_email===true,reminderCount:r.reminder_count??0,lastReminderAt:r.last_reminder_at??null,waitingExpectation:r.waiting_expectation??null,documentCount:de(r.document_count,0),heldItemCount:de(r.held_item_count,0),receivedAt:r.received_at??null,parsingStartedAt:r.parsing_started_at??null,reviewStartedAt:r.review_started_at??null,createdAt:r.created_at??"",updatedAt:r.updated_at??"",wireStatus:r.status,source:r.source??null,actionNeededLabel:r.action_needed_label??null,failureReason:r.failure_reason??null,failureCode:r.failure_code??null,recoveryStage:r.recovery_stage??null,showClinicPhone:r.show_clinic_phone===true,clinicName:r.clinic_name??null,clinicEmail:r.clinic_email??null,clinicPhone:r.clinic_phone??null,convertedToUploadAt:r.converted_to_upload_at??null,requestGroupId:r.request_group_id??null})}n(pe,"mapRequestView");z.object({request_group_id:z.string().min(1),pet_ref:z.string().min(1),total:z.number().int().nonnegative(),responded:z.number().int().nonnegative(),pending:z.number().int().nonnegative(),members:z.array(z.unknown())});function yt(e){return !e||e==="awaiting_upload"||e==="in_review"?null:ce.has(e)?e:null}n(yt,"normalizeSimpleStatus");z.object({source_doc_id:z.string().min(1),request_id:z.string().min(1)});var mt=z.object({label:z.string(),value:z.string()}),vt=z.object({key:z.string(),category:z.string().optional(),label:z.string().optional(),value:z.string().nullish(),unit:z.string().nullish(),observed_at:z.string().nullish(),status:z.string().nullish(),origin:z.string().nullish(),canonical_key:z.string().nullish()}),_t=z.object({at:z.string(),value:z.number().nullish(),display:z.string().nullish(),origin:z.string().nullish()}),bt=z.object({key:z.string(),label:z.string().optional(),points:z.array(_t).optional()}),ht=z.object({title:z.string(),detail:z.string().nullish(),due_at:z.string().nullish()}),Et=z.object({doc_id:z.string(),title:z.string().nullish(),page_count:z.number().nullish(),received_at:z.string().nullish()});z.object({identity:z.array(mt).optional(),entities:z.array(vt).optional(),entity_series:z.array(bt).optional(),forward_looking:z.array(ht).optional(),documents:z.array(Et).optional()});z.object({pet_ref:z.string().optional(),granted:z.boolean().optional(),version:z.string().nullish(),granted_at:z.string().nullish()});function de(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}n(de,"numberOr");var gt="/widget/v1/records/sandbox/requests",fe=64,Rt=new Set(["records","no_records","declined"]),St=new Set(["applied","already_applied","not_applicable"]);function I(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(I,"invalid");function wt(e){return typeof e!="string"||e.length===0?I("request_id is required and must be a non-empty string"):F(e)?I("request_id contains an unpaired surrogate and cannot be encoded"):[...e].length>fe?I(`request_id is longer than ${fe} characters`):null}n(wt,"requestIdError");function Ct(e){if(typeof e!="object"||e===null)return null;let{result:t,request:r}=e;if(typeof t!="string"||!St.has(t))return null;let o=pe(r);return o===null?null:Object.freeze({result:t,request:o})}n(Ct,"mapActionResult");function ye(e){let t=e.funnel??k({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=n(async(o,a,s,u)=>{let p=wt(a);if(p!==null)return l(p);let c=`${gt}/${encodeURIComponent(a)}/${s}`,f=await t.send(o,u===void 0?{method:"POST",path:c}:{method:"POST",path:c,body:u});if(!f.ok)return l(f.error);let w=Ct(f.value);return w===null?l(y("internalError",{retryable:false})):T(w)},"run");return {simulateClinicReply(o,a){return typeof a!="string"||!Rt.has(a)?Promise.resolve(l(I("outcome must be records, no_records or declined"))):r("records.sandbox.clinicReply",o,"clinic-reply",{outcome:a})},publishSampleRecord(o){return r("records.sandbox.publishSample",o,"publish-sample")}}}n(ye,"createRecordsSandboxController");function Tt(){let{runtime:e,userRef:t,scopeEpoch:r}=h();return useMemo(()=>{let{services:o}=e.registry;return ye({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(Tt,"useEverfurRecordsSandbox");var L="/widget/v1/televet/sandbox/visits",Ot=128,me=64,be=new Set(["booked","cancelled","completed","no_show"]),kt=new Set(["applied","already_applied","not_applicable"]),ve=new Set(["rescheduled","reminder","followup_sent","message_received","ended"]),_e=new Set(["24h","30m"]);function _(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(_,"invalid");function N(e,t,r){return typeof t!="string"||t.length===0?_(`${e} is required and must be a non-empty string`):F(t)?_(`${e} contains an unpaired surrogate and cannot be encoded`):le(t)>r?_(`${e} is longer than ${r} characters`):null}n(N,"textError");function Ft(e){if(typeof e!="object"||e===null)return null;let{result:t,visit:r}=e;if(typeof t!="string"||!kt.has(t)||typeof r!="object"||r===null)return null;let{visit_ref:o,pet_ref:a,status:s,scheduled_at:u}=r;return typeof o!="string"||o.length===0||typeof a!="string"||a.length===0||typeof s!="string"||!be.has(s)||typeof u!="string"||u.length===0?null:Object.freeze({result:t,visit:Object.freeze({visitRef:o,petRef:a,status:s,scheduledAt:u})})}n(Ft,"mapActionResult");function he(e){let t=e.funnel??k({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=n(async(o,a,s)=>{let u=await t.send(o,{method:"POST",path:a,body:s},{idempotent:false,maxAttempts:1});if(!u.ok)return l(u.error);let p=Ft(u.value);return p===null?l(y("internalError",{retryable:false})):T(p)},"run");return {createVisit(o){let a=N("pet_ref",o,Ot);return a!==null?Promise.resolve(l(a)):r("televet.sandbox.createVisit",L,{pet_ref:o})},advanceVisit(o,a){let s=N("visit_ref",o,me);if(s!==null)return Promise.resolve(l(s));if(typeof a!="string"||!be.has(a))return Promise.resolve(l(_("to must be booked, cancelled, completed or no_show")));let u=`${L}/${encodeURIComponent(o)}/advance`;return r("televet.sandbox.advanceVisit",u,{to:a})},simulateVisitEvent(o,a,s){let u=N("visit_ref",o,me);if(u!==null)return Promise.resolve(l(u));if(typeof a!="string"||!ve.has(a))return Promise.resolve(l(_(`event must be one of ${[...ve].join(", ")}`)));if(a==="reminder"){if(typeof s!="string"||!_e.has(s))return Promise.resolve(l(_(`stage must be one of ${[..._e].join(", ")} for a reminder`)))}else if(s!==void 0)return Promise.resolve(l(_("stage is only for a reminder")));let p=`${L}/${encodeURIComponent(o)}/simulate`;return r("televet.sandbox.simulateVisitEvent",p,s===void 0?{event:a}:{event:a,stage:s})}}}n(he,"createVetVisitSandboxController");function At(){let{runtime:e,userRef:t,scopeEpoch:r}=h();return useMemo(()=>{let{services:o}=e.registry;return he({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(At,"useEverfurVetVisitSandbox");export{Tt as useEverfurRecordsSandbox,ke as useEverfurTestEntitlements,At as useEverfurVetVisitSandbox};
1
+ import {createContext,useMemo,useContext}from'react';import {z}from'zod';var Ce=Object.defineProperty;var n=(e,t)=>Ce(e,"name",{value:t,configurable:true});function T(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(T,"ok");function l(e){return Object.freeze({ok:false,error:e})}n(l,"err");var x=class x extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,x.prototype);}};n(x,"EverfurConfigError");var R=x;var W=Symbol.for("@everfur/sdk#EverfurContext@v1"),K=globalThis,$=K[W]??(K[W]=createContext(null));$.displayName??="EverfurContext";function h(){let e=useContext($);if(e===null)throw new R("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(h,"useEverfurContext");function ke(){let{runtime:e}=h();return useMemo(()=>({apply:n(t=>e.updateEntitlements(t),"apply")}),[e])}n(ke,"useEverfurTestEntitlements");var D=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(D.map(e=>e.wireCode));var Fe=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"}),Q=Object.freeze(D.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Fe[e.wireCode]}))),Ie=new Map(Q.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ae=Object.freeze(["http_envelope",...[...new Set(Q.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function O(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...Ae]){let a=Ie.get(o+r);if(a)return a}}n(O,"contractErrorFor");function Pe(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(Pe,"contractDocUrl");function X(e){return null}n(X,"publishedDocUrl");var je=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 J(e){return je[e]}n(J,"categoryFor");function Z(e){let t=O(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(Z,"fromWire");var ze=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function V(e){return ze.has(e)}n(V,"isAutoRetryable");var qe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ee(e){return V(e)||qe.has(e)}n(ee,"isRetryableCode");var De=500,U=8e3,te=4;function re(e,t=Math.random){let r=Math.max(0,e),o=Math.min(De*2**r,U);return Math.floor(t()*o)}n(re,"backoffDelayMs");var Ve=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 Ue(e){return Ve[e]}n(Ue,"userFacingError");function ne(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(ne,"defineHidden");var Me=/^[a-z][a-z0-9_]{0,63}$/;function y(e,t){let r=O(t?.wireCode,t?.wireEnvelope),o={code:e,category:J(e),retryable:t?.retryable??ee(e),displayMessage:Ue(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Me.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&ne(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&ne(o,"raw",t.raw),Object.freeze(o)}n(y,"makeEverfurError");function oe(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})}n(oe,"errorFrame");function Be(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}n(Be,"authHeaders");function S(e,t){return {...e,headers:{...Ye(e.headers),...Be(t)}}}n(S,"withAuthHeaders");function Ye(e){if(!e)return {};let t={};for(let[r,o]of Object.entries(e)){let a=r.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(t[r]=o);}return t}n(Ye,"stripAuthHeaders");async function ie(e,t){if(t.mode==="anonymous")return t.transport.request(S(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return l(M())}let o=await t.transport.request(S(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await t.identity.currentToken({forceRefresh:!0});}catch{return l(M())}let s=await t.transport.request(S(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?l(M(s.error.httpStatus)):s}n(ie,"authedSend");function M(e){return y("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(M,"authRejectedError");function ae(e){return y("internalError",{retryable:true,wireMessage:He(e)})}n(ae,"networkError");function He(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(He,"describeCause");var We=3e4,Ke=U*2,$e="idempotency-key",Ge=new Set(["POST","PUT","PATCH","DELETE"]),Qe=Object.freeze({onEvent(){}}),Xe=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Je(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}n(Je,"seededIdempotencyKey");function k(e){let t=e.observer??Qe,r=e.timers??Xe,o=e.rng??Math.random,a=e.sleep??((m,d)=>pt(m,r,d)),s=e.maxAttempts??te,u=e.unaryTimeoutMs??We,p=e.newIdempotencyKey??et(),c=n(m=>{try{t.onEvent(m);}catch{}},"emit");async function f(m,d,b){let A=b?.maxAttempts,ge=Math.max(1,A??s),Re=b?.idempotent??Ge.has(d.method),Se=b?.idempotencyKey===void 0?null:Je(b.idempotencyKey),P=Re?Se??p():null,we=Ze(d,P),j=0;for(;;){let E=n(q=>Object.freeze({call:m,method:d.method,path:d.path,attempt:j,...P?{idempotencyKey:P}:{},...q}),"stamp");c(E({phase:"attempt"}));let Y=dt(u,r),H=ct(Y.signal,d.signal),g;try{g=await ie({...we,signal:H.signal},e.auth);}catch(q){g=l(ae(q));}finally{H.dispose(),Y.cancel();}if(g.ok)return c(E({phase:"settled",ok:true,reason:"ok"})),g;let v=g.error,C=rt(v,j,{maxAttempts:ge,rng:o,now:r.now(),aborted:d.signal?.aborted===true,...A!==void 0?{perCallMaxAttempts:A}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),z={ok:false,code:v.code,reason:C.reason,...v.httpStatus!==void 0?{httpStatus:v.httpStatus}:{},...v.requestId!==void 0?{requestId:v.requestId}:{}};if(!C.retry)return c(E({phase:"settled",...z})),l(v);if(c(E({phase:"retry",...z,delayMs:C.delayMs})),await a(C.delayMs,d.signal),d.signal?.aborted===true)return c(E({phase:"settled",...z,reason:"aborted"})),l(v);j+=1;}}n(f,"send");async function w(m){return S(m,await ut(e.auth))}n(w,"authorize");async function*Ee(m,d,b){c(Object.freeze({call:m,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,b);}catch{yield oe({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(Ee,"stream"),Object.freeze({send:f,authorize:w,stream:Ee})}n(k,"createRequestFunnel");function Ze(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==$e&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Ze,"assembleHeaders");function et(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(et,"defaultIdempotencyKeyFactory");var tt=10;function rt(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=nt(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!V(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let u=n(()=>{if(r.policy===void 0)return null;let f;try{f=r.policy.maxAttempts(e.code);}catch{return null}return typeof f!="number"||!Number.isFinite(f)?null:Math.max(1,Math.min(tt,Math.floor(f)))},"policyCeiling"),p=r.perCallMaxAttempts??u()??r.maxAttempts;if(t+1>=p)return {retry:false,reason:"attempts-exhausted"};let c=ot(e,r.now);return c!==null?c>Ke?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:c}:{retry:true,reason:a,delayMs:re(t,r.rng)}}n(rt,"decideRetry");function nt(e){let t=e.code==="unknown"?Z(lt(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(nt,"throttleKind");function ot(e,t){let r=at(e.raw);if(r!==null){let a=r-t;return a>0?a:0}let o=it(e.raw);return o===null?null:Math.round(o*1e3)}n(ot,"retryOverrideMs");function it(e){for(let t of L(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}n(it,"findRetryAfterSeconds");function at(e){for(let t of L(e)){let r=t.resets_at,o=st(r);if(o!==null)return o}return null}n(at,"findResetsAt");function L(e){if(!se(e))return [];let t=[e];for(let r of ["error","detail"]){let o=e[r];se(o)&&t.push(o);}return t}n(L,"candidateScopes");function st(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}n(st,"parseInstantMs");function lt(e){for(let t of L(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(lt,"rawWireCode");function se(e){return typeof e=="object"&&e!==null}n(se,"isRecord");async function ut(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}:{}}}n(ut,"resolveDeviceAuth");function dt(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(dt,"boundedSignal");function ct(e,t){let r=n(()=>{},"noop");if(!t)return {signal:e,dispose:r};let o=new AbortController;if(e.aborted||t.aborted)return o.abort(),{signal:o.signal,dispose:r};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a);},"dispose")}}n(ct,"mergeSignals");function pt(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(o=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",s),o();},e),s=n(()=>{t.clearTimeout(a),o();},"onAbort");r?.addEventListener("abort",s,{once:true});})}n(pt,"delayAbortable");function F(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let o=e.charCodeAt(t+1);if(!(o>=56320&&o<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}n(F,"hasLoneSurrogate");function le(e){return [...e].length}n(le,"serverLength");var ce=new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review","published","failed","revoked"]),ue=Object.freeze({submitted:"requested",sent:"requested",dispatching:"requested",awaiting_response:"awaiting_clinic",clinic_responded_no_records:"awaiting_clinic",records_received:"received",parsing_failed:"in_review",review_email_failed:"in_review",clinic_declined:"failed"});function ft(e){let t=Object.prototype.hasOwnProperty.call(ue,e)?ue[e]:void 0;if(t!==void 0)return t;let r=e;return ce.has(r)?r:"parsing"}n(ft,"normalizeStatus");var yt=z.object({request_id:z.string().min(1),pet_ref:z.string().min(1),status:z.string(),simple_status:z.string().nullish(),simple_status_detail:z.string().nullish(),status_label:z.string().optional(),dispatch_status:z.string().nullish(),can_retry_send:z.boolean().optional(),can_revoke:z.boolean().optional(),can_convert_to_upload:z.boolean().optional(),can_update_clinic_email:z.boolean().optional(),reminder_count:z.number().int().nonnegative().optional(),last_reminder_at:z.string().nullish(),waiting_expectation:z.string().nullish(),document_count:z.number().optional(),held_item_count:z.number().optional(),received_at:z.string().nullish(),parsing_started_at:z.string().nullish(),review_started_at:z.string().nullish(),created_at:z.string().optional(),updated_at:z.string().optional(),source:z.string().nullish().catch(null),action_needed_label:z.string().nullish().catch(null),failure_reason:z.string().nullish().catch(null),failure_code:z.string().nullish().catch(null),recovery_stage:z.string().nullish().catch(null),show_clinic_phone:z.boolean().optional().catch(void 0),clinic_name:z.string().nullish().catch(null),clinic_email:z.string().nullish().catch(null),clinic_phone:z.string().nullish().catch(null),converted_to_upload_at:z.string().nullish().catch(null),request_group_id:z.string().nullish().catch(null)}).passthrough();function pe(e){let t=yt.safeParse(e);if(!t.success)return null;let r=t.data,o=mt(r.simple_status),a=o==="requested"&&(r.status==="awaiting_upload"||r.simple_status_detail==="awaiting_owner_upload")?"awaiting_upload":o==="parsing"&&(r.simple_status_detail==="in_review"||r.simple_status_detail==="review_email_failed")?"in_review":o??ft(r.status);return Object.freeze({id:r.request_id,petRef:r.pet_ref,status:a,simpleStatus:o,simpleStatusDetail:r.simple_status_detail??null,statusLabel:r.status_label??"",dispatchStatus:r.dispatch_status??null,canRetrySend:r.can_retry_send===true,canRevoke:r.can_revoke===true,canConvertToUpload:r.can_convert_to_upload===true,canUpdateClinicEmail:r.can_update_clinic_email===true,reminderCount:r.reminder_count??0,lastReminderAt:r.last_reminder_at??null,waitingExpectation:r.waiting_expectation??null,documentCount:de(r.document_count,0),heldItemCount:de(r.held_item_count,0),receivedAt:r.received_at??null,parsingStartedAt:r.parsing_started_at??null,reviewStartedAt:r.review_started_at??null,createdAt:r.created_at??"",updatedAt:r.updated_at??"",wireStatus:r.status,source:r.source??null,actionNeededLabel:r.action_needed_label??null,failureReason:r.failure_reason??null,failureCode:r.failure_code??null,recoveryStage:r.recovery_stage??null,showClinicPhone:r.show_clinic_phone===true,clinicName:r.clinic_name??null,clinicEmail:r.clinic_email??null,clinicPhone:r.clinic_phone??null,convertedToUploadAt:r.converted_to_upload_at??null,requestGroupId:r.request_group_id??null})}n(pe,"mapRequestView");z.object({request_group_id:z.string().min(1),pet_ref:z.string().min(1),total:z.number().int().nonnegative(),responded:z.number().int().nonnegative(),pending:z.number().int().nonnegative(),members:z.array(z.unknown())});function mt(e){return !e||e==="awaiting_upload"||e==="in_review"?null:ce.has(e)?e:null}n(mt,"normalizeSimpleStatus");z.object({source_doc_id:z.string().min(1),request_id:z.string().min(1)});var vt=z.object({label:z.string(),value:z.string()}),_t=z.object({key:z.string(),category:z.string().optional(),label:z.string().optional(),value:z.string().nullish(),unit:z.string().nullish(),observed_at:z.string().nullish(),status:z.string().nullish(),origin:z.string().nullish(),canonical_key:z.string().nullish()}),bt=z.object({at:z.string(),value:z.number().nullish(),display:z.string().nullish(),origin:z.string().nullish()}),ht=z.object({key:z.string(),label:z.string().optional(),points:z.array(bt).optional()}),Et=z.object({title:z.string(),detail:z.string().nullish(),due_at:z.string().nullish()}),gt=z.object({doc_id:z.string(),title:z.string().nullish(),page_count:z.number().nullish(),received_at:z.string().nullish()});z.object({identity:z.array(vt).optional(),entities:z.array(_t).optional(),entity_series:z.array(ht).optional(),forward_looking:z.array(Et).optional(),documents:z.array(gt).optional()});z.object({pet_ref:z.string().optional(),granted:z.boolean().optional(),version:z.string().nullish(),granted_at:z.string().nullish()});function de(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}n(de,"numberOr");var Rt="/widget/v1/records/sandbox/requests",fe=64,St=new Set(["records","no_records","declined"]),wt=new Set(["applied","already_applied","not_applicable"]);function I(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(I,"invalid");function Ct(e){return typeof e!="string"||e.length===0?I("request_id is required and must be a non-empty string"):F(e)?I("request_id contains an unpaired surrogate and cannot be encoded"):[...e].length>fe?I(`request_id is longer than ${fe} characters`):null}n(Ct,"requestIdError");function xt(e){if(typeof e!="object"||e===null)return null;let{result:t,request:r}=e;if(typeof t!="string"||!wt.has(t))return null;let o=pe(r);return o===null?null:Object.freeze({result:t,request:o})}n(xt,"mapActionResult");function ye(e){let t=e.funnel??k({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=n(async(o,a,s,u)=>{let p=Ct(a);if(p!==null)return l(p);let c=`${Rt}/${encodeURIComponent(a)}/${s}`,f=await t.send(o,u===void 0?{method:"POST",path:c}:{method:"POST",path:c,body:u});if(!f.ok)return l(f.error);let w=xt(f.value);return w===null?l(y("internalError",{retryable:false})):T(w)},"run");return {simulateClinicReply(o,a){return typeof a!="string"||!St.has(a)?Promise.resolve(l(I("outcome must be records, no_records or declined"))):r("records.sandbox.clinicReply",o,"clinic-reply",{outcome:a})},publishSampleRecord(o){return r("records.sandbox.publishSample",o,"publish-sample")}}}n(ye,"createRecordsSandboxController");function Ot(){let{runtime:e,userRef:t,scopeEpoch:r}=h();return useMemo(()=>{let{services:o}=e.registry;return ye({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(Ot,"useEverfurRecordsSandbox");var N="/widget/v1/televet/sandbox/visits",kt=128,me=64,be=new Set(["booked","cancelled","completed","no_show"]),Ft=new Set(["applied","already_applied","not_applicable"]),ve=new Set(["rescheduled","reminder","followup_sent","message_received","ended"]),_e=new Set(["24h","30m"]);function _(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(_,"invalid");function B(e,t,r){return typeof t!="string"||t.length===0?_(`${e} is required and must be a non-empty string`):F(t)?_(`${e} contains an unpaired surrogate and cannot be encoded`):le(t)>r?_(`${e} is longer than ${r} characters`):null}n(B,"textError");function It(e){if(typeof e!="object"||e===null)return null;let{result:t,visit:r}=e;if(typeof t!="string"||!Ft.has(t)||typeof r!="object"||r===null)return null;let{visit_ref:o,pet_ref:a,status:s,scheduled_at:u}=r;return typeof o!="string"||o.length===0||typeof a!="string"||a.length===0||typeof s!="string"||!be.has(s)||typeof u!="string"||u.length===0?null:Object.freeze({result:t,visit:Object.freeze({visitRef:o,petRef:a,status:s,scheduledAt:u})})}n(It,"mapActionResult");function he(e){let t=e.funnel??k({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=n(async(o,a,s)=>{let u=await t.send(o,{method:"POST",path:a,body:s},{idempotent:false,maxAttempts:1});if(!u.ok)return l(u.error);let p=It(u.value);return p===null?l(y("internalError",{retryable:false})):T(p)},"run");return {createVisit(o){let a=B("pet_ref",o,kt);return a!==null?Promise.resolve(l(a)):r("televet.sandbox.createVisit",N,{pet_ref:o})},advanceVisit(o,a){let s=B("visit_ref",o,me);if(s!==null)return Promise.resolve(l(s));if(typeof a!="string"||!be.has(a))return Promise.resolve(l(_("to must be booked, cancelled, completed or no_show")));let u=`${N}/${encodeURIComponent(o)}/advance`;return r("televet.sandbox.advanceVisit",u,{to:a})},simulateVisitEvent(o,a,s){let u=B("visit_ref",o,me);if(u!==null)return Promise.resolve(l(u));if(typeof a!="string"||!ve.has(a))return Promise.resolve(l(_(`event must be one of ${[...ve].join(", ")}`)));if(a==="reminder"){if(typeof s!="string"||!_e.has(s))return Promise.resolve(l(_(`stage must be one of ${[..._e].join(", ")} for a reminder`)))}else if(s!==void 0)return Promise.resolve(l(_("stage is only for a reminder")));let p=`${N}/${encodeURIComponent(o)}/simulate`;return r("televet.sandbox.simulateVisitEvent",p,s===void 0?{event:a}:{event:a,stage:s})}}}n(he,"createVetVisitSandboxController");function Pt(){let{runtime:e,userRef:t,scopeEpoch:r}=h();return useMemo(()=>{let{services:o}=e.registry;return he({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(Pt,"useEverfurVetVisitSandbox");export{Ot as useEverfurRecordsSandbox,ke as useEverfurTestEntitlements,Pt as useEverfurVetVisitSandbox};
@@ -1,4 +1,4 @@
1
- import { q as RecordsTimelineView } from './depth-DvPwPuT_.js';
1
+ import { q as RecordsTimelineView } from './depth-CYPH92jE.js';
2
2
 
3
3
  type TimelineRowKind = 'visit' | 'vaccine' | 'weight' | 'medication';
4
4
  interface TimelineRow {
@@ -1,4 +1,4 @@
1
- import { q as RecordsTimelineView } from './depth-D5HwcvKC.cjs';
1
+ import { q as RecordsTimelineView } from './depth-CyjaJJ6V.cjs';
2
2
 
3
3
  type TimelineRowKind = 'visit' | 'vaccine' | 'weight' | 'medication';
4
4
  interface TimelineRow {
@@ -59,109 +59,6 @@ type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
59
59
  */
60
60
  declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds): EverfurThemeSlots;
61
61
 
62
- /**
63
- * One slot's paint on the `theme` prop; colours in any form `parseColor` reads, the radius in dp/px. The console's
64
- * snake_case wire keys are accepted beside the camelCase ones.
65
- */
66
- interface EverfurThemeSlotInput {
67
- readonly backgroundColor?: string | number;
68
- readonly background_color?: string | number;
69
- readonly borderColor?: string | number;
70
- readonly border_color?: string | number;
71
- readonly borderRadius?: number | string;
72
- readonly border_radius?: number | string;
73
- readonly textColor?: string | number;
74
- readonly text_color?: string | number;
75
- }
76
- /** The `slots` map on the `theme` prop: any subset of the eight slot names. */
77
- type EverfurThemeSlotsInput = Readonly<Partial<Record<EverfurThemeSlotName, EverfurThemeSlotInput>>>;
78
- /**
79
- * The faces a theme names: the three text weights and the three mono weights (`EverfurFontFaceKey` on the tokens).
80
- * A missing weight falls back along its chain: bold -> medium -> regular, monoBold -> monoMedium -> mono.
81
- */
82
- type EverfurThemeFontFaceKey = 'regular' | 'medium' | 'bold' | 'mono' | 'monoMedium' | 'monoBold';
83
- /** The `fonts` map on the `theme` prop: a registered family name per face, any subset. */
84
- type EverfurThemeFontsInput = Readonly<Partial<Record<EverfurThemeFontFaceKey, string>>>;
85
- /** The `font_urls` map on the `theme` prop (web only): a brand-font URL per face, any subset. */
86
- type EverfurThemeFontUrlsInput = Readonly<Partial<Record<EverfurThemeFontFaceKey, string>>>;
87
- /**
88
- * The client `theme` prop. Any shape is tolerated (unknown keys are ignored, malformed values are dropped); the
89
- * named keys are the ones the resolver reads, in the console's snake_case with camelCase twins.
90
- */
91
- interface EverfurThemeInput {
92
- readonly display_name?: string;
93
- readonly displayName?: string;
94
- readonly logo_url?: string;
95
- readonly logoUrl?: string;
96
- /** The logo shown on the dark palette; absent, `logo_url` is shown on both. */
97
- readonly logo_url_dark?: string;
98
- readonly logoUrlDark?: string;
99
- readonly primary_color?: string | number;
100
- readonly primaryColor?: string | number;
101
- readonly accent_color?: string | number;
102
- readonly accentColor?: string | number;
103
- /** The primary fill on the dark palette; absent, it is derived from `primary_color` (`deriveDarkVariant`). */
104
- readonly primary_color_dark?: string | number;
105
- readonly primaryColorDark?: string | number;
106
- readonly accent_color_dark?: string | number;
107
- readonly accentColorDark?: string | number;
108
- /**
109
- * `light` or `dark` pins the palette; `auto` follows the device's scheme. Absent (here and in the console), the
110
- * theme is LIGHT, as Everfur's own apps are: the device scheme is never read unless someone chose `auto`.
111
- */
112
- readonly brightness?: string;
113
- /** The console's name for `brightness` (`light`, `dark` or `auto`); `brightness` wins when both are set. */
114
- readonly color_scheme?: string;
115
- readonly colorScheme?: string;
116
- readonly font_family?: string;
117
- readonly fontFamily?: string;
118
- readonly font_url?: string;
119
- readonly fontUrl?: string;
120
- /**
121
- * The family per face. Two conventions, the same rendering on React Native and the web:
122
- * - one registered face per weight, the way the Everfur app maps weight to family (`Azeret-Regular`,
123
- * `Azeret-Medium`, `Azeret-Bold`, `AzeretMono-Regular`): a name no other weight of its group uses is a NAMED
124
- * face, rendered with no weight of its own (React Native) or at the normal weight (the web);
125
- * - one family for every weight (`Azeret`): a name shared across the weights of a group is a BASE family, and
126
- * every face takes its numeric weight on both hosts.
127
- * A missing weight falls back along its chain (regular -> medium -> bold, mono -> monoMedium -> monoBold). The host
128
- * registers the faces itself (the native font files, or a web `@font-face`) and passes the NAMES only: the SDK
129
- * bundles no font. Beats `font_family` for the weights it names. On React Native, when the app's font registry can
130
- * tell (expo-font's), a named face that is not registered falls back to the platform font at its weight, with a
131
- * development warning.
132
- */
133
- readonly fonts?: EverfurThemeFontsInput;
134
- /**
135
- * Web only: the woff2 URL per face, loaded through the SDK's brand-font allow-list (a woff2 under `/fonts/`
136
- * on the Everfur SDK CDN). A URL on any other origin is refused, so a host that serves its own licensed
137
- * faces loads them with its own `@font-face` and passes `fonts` names only.
138
- */
139
- readonly font_urls?: EverfurThemeFontUrlsInput;
140
- readonly fontUrls?: EverfurThemeFontUrlsInput;
141
- readonly chat_placeholder?: string;
142
- readonly chatPlaceholder?: string;
143
- readonly placeholder?: string;
144
- /** Typed for completeness; INERT on the client. The server decides the attribution from the plan. */
145
- readonly hide_powered_by?: boolean;
146
- readonly hidePoweredBy?: boolean;
147
- /** `white`, `cream` or `subtle`. */
148
- readonly surface_style?: string;
149
- readonly surfaceStyle?: string;
150
- /** `sharp`, `default` or `round`. */
151
- readonly radius_scale?: string;
152
- readonly radiusScale?: string;
153
- /**
154
- * The cap on the CHROME text tiers (headings, controls, chips, badges): 1 to 3.1, or 0 for none (the default,
155
- * the tiers alone: headings 2, controls 1.8, chips 1.5, badges 1.3). Flowing content is never capped.
156
- */
157
- readonly accessibility_max_font_scale?: number | string;
158
- readonly accessibilityMaxFontScale?: number | string;
159
- /** Paint overrides at the named slots. */
160
- readonly slots?: EverfurThemeSlotsInput;
161
- /** Tolerated for any other key; ignored by the resolver. */
162
- readonly [key: string]: unknown;
163
- }
164
-
165
62
  /** Recursively freeze a plain object/array tree in place and return it (typed as the input). */
166
63
  declare function deepFreeze<T>(value: T): T;
167
64
  /** Foreground text tokens; the semantic text ramp over surfaces. */
@@ -184,7 +81,12 @@ interface EverfurColorTokens {
184
81
  readonly brandSofter: string;
185
82
  readonly brandBorder: string;
186
83
  readonly borderHairlineGreen: string;
187
- /** The brand at 55%: the edge of a floating card over the chat (the attachment popover, the Everfur app's). */
84
+ /**
85
+ * The brand at 55%: the edge of a FORM CONTROL (a text field, a text area, a radio) and of a floating card over
86
+ * the chat (the attachment popover, the Everfur app's). The resolver guarantees it reads at 3:1 (WCAG 1.4.11) on
87
+ * every ground a control sits on, pushing a partner brand that does not; `brandBorder` and `borderHairlineGreen`
88
+ * are decorative hairlines (1.4:1 and 1.6:1) and never the only edge of a control.
89
+ */
188
90
  readonly brandBorderStrong: string;
189
91
  /**
190
92
  * The brand as TEXT or ICON ink. The resolver derives it from `brand`, pushed toward black (light palette) or
@@ -457,110 +359,4 @@ declare const EVERFUR_LIGHT: EverfurTheme;
457
359
  /** The compiled DARK default (deeply frozen). */
458
360
  declare const EVERFUR_DARK: EverfurTheme;
459
361
 
460
- interface ClientBranding {
461
- readonly displayName: string | null;
462
- /** normalized (https-hardened downstream) logo URL */
463
- readonly logoUrl: string | null;
464
- /** normalized color string (#RRGGBB or rgba(...)) or null */
465
- readonly primaryColor: string | null;
466
- readonly accentColor: string | null;
467
- /**
468
- * `light` or `dark` pins the palette; `auto` follows the device's scheme (an explicit opt-in). null (absent)
469
- * resolves to LIGHT, as Everfur's own apps render. Read from `brightness`, or its console alias `color_scheme`
470
- * (`colorScheme`).
471
- */
472
- readonly brightness: 'light' | 'dark' | 'auto' | null;
473
- readonly fontFamily: string | null;
474
- readonly fontUrl: string | null;
475
- /**
476
- * fonts: one registered family per face (`regular` / `medium` / `bold` / `mono` / `monoMedium` / `monoBold`),
477
- * any subset. A name used by one face of its group only is a named face, rendered without a synthetic
478
- * `fontWeight`; a name repeated across the weights of a group is a base family and takes the numeric weights.
479
- * Absent/null names none (the base families stand).
480
- */
481
- readonly fonts?: Readonly<Partial<Record<EverfurFontFaceKey, string>>> | null;
482
- /** font_urls: the brand-font URL per face (web only), any subset; hardened https-only downstream. */
483
- readonly fontUrls?: Readonly<Partial<Record<EverfurFontFaceKey, string>>> | null;
484
- /** composer placeholder override (chat_placeholder/placeholder); null keeps the base. */
485
- readonly placeholder: string | null;
486
- /**
487
- * white-label switch (hide_powered_by): hide the powered-by attribution. null = unset (keep the base). Honoured
488
- * from SERVER branding only: `resolveTheme` ignores it on the client override (attribution is server-only).
489
- */
490
- readonly hidePoweredBy: boolean | null;
491
- /** primary_color_dark: the primary fill used when the resolved palette is dark. Absent/null derives one. */
492
- readonly primaryColorDark?: string | null;
493
- /** accent_color_dark: the accent fill used when the resolved palette is dark. Absent/null derives one. */
494
- readonly accentColorDark?: string | null;
495
- /**
496
- * surface_style: which compiled surface the chat ground (`chatGround`) uses. Absent/null keeps the palette's
497
- * white ground (the Everfur app's shell). The composer and the record cards keep their cream either way.
498
- */
499
- readonly surfaceStyle?: SurfaceStyle | null;
500
- /** radius_scale: scales the corner radii (the pill radius is never scaled). Absent/null keeps the palette radii. */
501
- readonly radiusScale?: RadiusScale | null;
502
- /** logo_url_dark: the logo shown on the dark palette. Absent/null keeps logoUrl on both palettes. */
503
- readonly logoUrlDark?: string | null;
504
- /** slots: paint overrides at the named slots (schema 2). Absent/null paints none. */
505
- readonly slots?: EverfurThemeSlots | null;
506
- /**
507
- * accessibility_max_font_scale: the tenant's cap on the CHROME text tiers (headings, controls, chips, badges),
508
- * 1..3.1, or 0 for none. Flowing content is never capped. Absent/null keeps the default (0, the tiers alone).
509
- */
510
- readonly accessibilityMaxFontScale?: number | null;
511
- /**
512
- * locked_fields: the wire names the tenant keeps server-wins (schema 2): a field, `slots` (every slot) or
513
- * `slots.<name>` (one slot); the wire also lists `hide_powered_by`, which is locked whether listed or not.
514
- * Meaningful on SERVER branding only; ignored on the client override. Absent/null locks nothing beyond the
515
- * attribution.
516
- */
517
- readonly lockedFields?: readonly ThemeLockName[] | null;
518
- /**
519
- * schema_version: the wire version the branding was written for. null when absent (schema 1); 0 when present but
520
- * not a positive integer. A version this SDK does not know (`THEME_SCHEMA_VERSIONS`) drops the server branding.
521
- */
522
- readonly schemaVersion?: number | null;
523
- }
524
- /** The compiled surface a branding may pick for the chat ground (`surface_style`). */
525
- type SurfaceStyle = 'white' | 'cream' | 'subtle';
526
- /** The corner-radius scale a branding may pick (`radius_scale`). */
527
- type RadiusScale = 'sharp' | 'default' | 'round';
528
- /**
529
- * The wire names a tenant may list in `locked_fields` (every cosmetic field). `hide_powered_by` is not listed:
530
- * it is server-wins unconditionally, so locking it is meaningless.
531
- */
532
- declare const LOCKABLE_THEME_FIELDS: readonly ["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"];
533
- type LockableThemeField = (typeof LOCKABLE_THEME_FIELDS)[number];
534
- /** The `locked_fields` key that locks one slot (`slots.<name>`), as EFBackend branding_slots.py emits it. */
535
- declare const SLOT_LOCK_PREFIX = "slots.";
536
- type SlotLockName = `${typeof SLOT_LOCK_PREFIX}${EverfurThemeSlotName}`;
537
- /** Everything `locked_fields` may name: a cosmetic field, one slot, or the (always locked) attribution. */
538
- type ThemeLockName = LockableThemeField | SlotLockName | 'hide_powered_by';
539
- /** The branding wire versions this SDK reads: 1 (absent on the wire) and 2 (the 18 Sep 2026 fields). */
540
- declare const THEME_SCHEMA_VERSIONS: readonly number[];
541
- /**
542
- * true when every field is null (no config) - treated by callers as "absent". The version stamp alone is not a
543
- * value: a branding that carries only `schema_version` is empty.
544
- */
545
- declare function isEmptyBranding(b: ClientBranding): boolean;
546
- /** true when the branding is absent or written for a wire version this SDK knows. */
547
- declare function isKnownBrandingSchema(b: ClientBranding | null): boolean;
548
- /** The names a server branding keeps server-wins: its `locked_fields`, plus the attribution always. */
549
- declare function lockedFieldsOf(b: ClientBranding | null): ReadonlySet<string>;
550
- /**
551
- * Parse an untrusted branding blob (from the entitlements render_hints, or the client `theme` prop) into a
552
- * normalized `ClientBranding`. Accepts BOTH snake_case and camelCase keys. Returns null when the input is not
553
- * an object OR when the result is empty (all fields null) - callers read null as "no config" (fail-closed to
554
- * the compiled default). Never throws.
555
- */
556
- declare function parseClientBranding(json: unknown): ClientBranding | null;
557
- /** The largest cap a tenant may set on the chrome tiers: iOS's largest accessibility text size (AX5, 310%). */
558
- declare const MAX_FONT_SCALE_CEILING = 3.1;
559
- /**
560
- * Return the URL only if it is an https URL with no embedded whitespace, else null (security invariant:
561
- * https-only; rejects http:, javascript:, data:, etc.). Uses a protocol-locked regex rather than the URL
562
- * constructor so it is portable + total on React Native (whose URL global is incomplete) and never throws.
563
- */
564
- declare function hardenHttpsUrl(url: string | null): string | null;
565
-
566
- export { guardSlotContrast as $, THEME_SLOT_NAMES as A, EASING_CURVES as B, type ClientBranding as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurThemeInput as E, EVERFUR_DARK as F, EVERFUR_LIGHT as G, type EverfurEasingCurve as H, type EverfurTextScaleTier as I, type LockableThemeField as J, SLOT_LOCK_PREFIX as K, LOCKABLE_THEME_FIELDS as L, MAX_FONT_SCALE_CEILING as M, SLOT_MIN_BORDER_CONTRAST as N, SLOT_MIN_CONTRAST as O, SYSTEM_FONT_FAMILY as P, SYSTEM_MONO_FAMILY as Q, type RadiusScale as R, type SurfaceStyle as S, THEME_SLOT_KEYS as T, type SlotGrounds as U, type SlotLockName as V, TEXT_SCALE_TIER_CAPS as W, THEME_SCHEMA_VERSIONS as X, type ThemeLockName as Y, cssCubicBezier as Z, deepFreeze as _, type EverfurTheme as a, hardenHttpsUrl as a0, isEmptyBranding as a1, isKnownBrandingSchema as a2, lockedFieldsOf as a3, mergeThemeSlots as a4, parseClientBranding as a5, parseThemeSlots as a6, type EverfurFontWeight as b, type EverfurFontFaceKey as c, type EverfurColorTokens as d, type EverfurFontFamilies as e, type EverfurLetterSpacingTokens as f, type EverfurLineHeightTokens as g, type EverfurMotionDurationTokens as h, type EverfurMotionTokens as i, type EverfurRadiusTokens as j, type EverfurSpaceTokens as k, type EverfurSpringToken as l, type EverfurTextColorTokens as m, type EverfurThemeFontFaceKey as n, type EverfurThemeFontUrlsInput as o, type EverfurThemeFontsInput as p, type EverfurThemeMeta as q, type EverfurThemeSlot as r, type EverfurThemeSlotInput as s, type EverfurThemeSlotKey as t, type EverfurThemeSlotName as u, type EverfurThemeSlots as v, type EverfurThemeSlotsInput as w, type EverfurTypeSizeTokens as x, type EverfurTypeTokens as y, type EverfurWeightTokens as z };
362
+ export { SLOT_MIN_CONTRAST as A, SYSTEM_FONT_FAMILY as B, SYSTEM_MONO_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurTheme as E, type SlotGrounds as F, TEXT_SCALE_TIER_CAPS as G, cssCubicBezier as H, deepFreeze as I, guardSlotContrast as J, mergeThemeSlots as K, parseThemeSlots as L, SLOT_MIN_BORDER_CONTRAST as S, THEME_SLOT_KEYS as T, type EverfurFontWeight as a, type EverfurFontFaceKey as b, type EverfurThemeSlotName as c, type EverfurThemeSlots as d, type EverfurColorTokens as e, type EverfurFontFamilies as f, type EverfurLetterSpacingTokens as g, type EverfurLineHeightTokens as h, type EverfurMotionDurationTokens as i, type EverfurMotionTokens as j, type EverfurRadiusTokens as k, type EverfurSpaceTokens as l, type EverfurSpringToken as m, type EverfurTextColorTokens as n, type EverfurThemeMeta as o, type EverfurThemeSlot as p, type EverfurThemeSlotKey as q, type EverfurTypeSizeTokens as r, type EverfurTypeTokens as s, type EverfurWeightTokens as t, THEME_SLOT_NAMES as u, EASING_CURVES as v, EVERFUR_DARK as w, EVERFUR_LIGHT as x, type EverfurEasingCurve as y, type EverfurTextScaleTier as z };