@everfur/sdk 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +634 -0
  2. package/README.md +58 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-DPUD6dnc.d.cts +128 -0
  5. package/dist/Chat-DwAC2vhB.d.ts +128 -0
  6. package/dist/DepthViews-DNEM96Se.d.ts +16 -0
  7. package/dist/DepthViews-DP0R-DhB.d.cts +19 -0
  8. package/dist/DepthViews-D_3hl4xk.d.ts +19 -0
  9. package/dist/DepthViews-DbFhR4Du.d.cts +16 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-5NeobOCd.d.ts +256 -0
  21. package/dist/attachments-Bw3iMQgu.d.ts +146 -0
  22. package/dist/attachments-CQgFrEQ7.d.cts +146 -0
  23. package/dist/attachments-D8T5re7e.d.cts +256 -0
  24. package/dist/casesRepository-ClLv6qMl.d.ts +188 -0
  25. package/dist/casesRepository-DHwtGRYY.d.cts +188 -0
  26. package/dist/chat/index.cjs +1 -1170
  27. package/dist/chat/index.d.cts +31 -53
  28. package/dist/chat/index.d.ts +31 -53
  29. package/dist/chat/index.js +1 -1167
  30. package/dist/client/index.cjs +9 -2315
  31. package/dist/client/index.d.cts +77 -15
  32. package/dist/client/index.d.ts +77 -15
  33. package/dist/client/index.js +9 -2215
  34. package/dist/{config-CiJ0PVBB.d.ts → config-CzTZGlfF.d.cts} +63 -25
  35. package/dist/{config-BSjBdxrZ.d.cts → config-DW60uRb9.d.ts} +63 -25
  36. package/dist/consent/index.cjs +1 -0
  37. package/dist/consent/index.d.cts +33 -0
  38. package/dist/consent/index.d.ts +33 -0
  39. package/dist/consent/index.js +1 -0
  40. package/dist/context-DXhqHlPU.d.ts +159 -0
  41. package/dist/context-XvTzq1tE.d.cts +159 -0
  42. package/dist/copy-Mjoo91aS.d.ts +198 -0
  43. package/dist/copy-bKDNigLb.d.cts +198 -0
  44. package/dist/core/index.cjs +13 -3178
  45. package/dist/core/index.d.cts +58 -12
  46. package/dist/core/index.d.ts +58 -12
  47. package/dist/core/index.js +13 -3166
  48. package/dist/depth-CErXCU8J.d.cts +502 -0
  49. package/dist/depth-DjDcJ6kH.d.ts +502 -0
  50. package/dist/entitlementRepository-DKdXFgTo.d.cts +698 -0
  51. package/dist/entitlementRepository-DSbzuyAW.d.ts +698 -0
  52. package/dist/{identity-DK9zORrG.d.ts → identity-BMx2SUOM.d.ts} +19 -6
  53. package/dist/{identity-Brl-lDd6.d.cts → identity-DI4eVx9S.d.cts} +19 -6
  54. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  55. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  56. package/dist/index.cjs +12 -4494
  57. package/dist/index.d.cts +29 -121
  58. package/dist/index.d.ts +29 -121
  59. package/dist/index.js +12 -4470
  60. package/dist/models-B-Uh2LTf.d.ts +214 -0
  61. package/dist/models-D2EUxPZY.d.cts +214 -0
  62. package/dist/notifications/index.cjs +2 -0
  63. package/dist/notifications/index.d.cts +17 -0
  64. package/dist/notifications/index.d.ts +17 -0
  65. package/dist/notifications/index.js +2 -0
  66. package/dist/pets-CtQdRpWo.d.ts +92 -0
  67. package/dist/pets-aB8q0JyX.d.cts +92 -0
  68. package/dist/photo/index.cjs +1 -2189
  69. package/dist/photo/index.d.cts +6 -6
  70. package/dist/photo/index.d.ts +6 -6
  71. package/dist/photo/index.js +1 -2186
  72. package/dist/ports-BN6RHF9W.d.cts +48 -0
  73. package/dist/ports-BN6RHF9W.d.ts +48 -0
  74. package/dist/ports-DEBzEhbp.d.cts +386 -0
  75. package/dist/ports-DMolTRzU.d.ts +386 -0
  76. package/dist/profile-CSs1wlXT.d.cts +93 -0
  77. package/dist/profile-CSs1wlXT.d.ts +93 -0
  78. package/dist/records/depth/index.cjs +2 -0
  79. package/dist/records/depth/index.d.cts +13 -0
  80. package/dist/records/depth/index.d.ts +13 -0
  81. package/dist/records/depth/index.js +2 -0
  82. package/dist/records/index.cjs +3 -2839
  83. package/dist/records/index.d.cts +137 -203
  84. package/dist/records/index.d.ts +137 -203
  85. package/dist/records/index.js +3 -2833
  86. package/dist/requestFunnel-CjW7uDuA.d.ts +87 -0
  87. package/dist/requestFunnel-L-BQfi0z.d.cts +87 -0
  88. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  89. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  90. package/dist/{runtime-Bvr8yqXm.d.cts → runtime-B8s-_hv8.d.cts} +121 -59
  91. package/dist/{runtime-BIYzf9cK.d.ts → runtime-BR9ysG0J.d.ts} +121 -59
  92. package/dist/server/events/index.cjs +2 -0
  93. package/dist/server/events/index.d.cts +550 -0
  94. package/dist/server/events/index.d.ts +550 -0
  95. package/dist/server/events/index.js +2 -0
  96. package/dist/server/index.cjs +2 -533
  97. package/dist/server/index.d.cts +73 -18
  98. package/dist/server/index.d.ts +73 -18
  99. package/dist/server/index.js +2 -530
  100. package/dist/species-BXAIMh7I.d.cts +9 -0
  101. package/dist/species-BXAIMh7I.d.ts +9 -0
  102. package/dist/televet/index.cjs +1 -0
  103. package/dist/televet/index.d.cts +60 -0
  104. package/dist/televet/index.d.ts +60 -0
  105. package/dist/televet/index.js +1 -0
  106. package/dist/testing/index.cjs +5 -823
  107. package/dist/testing/index.d.cts +17 -3
  108. package/dist/testing/index.d.ts +17 -3
  109. package/dist/testing/index.js +5 -820
  110. package/dist/testing/rn/index.cjs +1 -449
  111. package/dist/testing/rn/index.d.cts +17 -29
  112. package/dist/testing/rn/index.d.ts +17 -29
  113. package/dist/testing/rn/index.js +1 -444
  114. package/dist/testing/web/index.cjs +1 -0
  115. package/dist/testing/web/index.d.cts +131 -0
  116. package/dist/testing/web/index.d.ts +131 -0
  117. package/dist/testing/web/index.js +1 -0
  118. package/dist/timelineRows-CaohZzXS.d.cts +19 -0
  119. package/dist/timelineRows-DZed6dAM.d.ts +19 -0
  120. package/dist/typeStyle-0TydiZ1w.d.cts +19 -0
  121. package/dist/typeStyle-CWMsoe6b.d.ts +19 -0
  122. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  123. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  124. package/dist/useRecordsDepth-BHBzJ76R.d.cts +237 -0
  125. package/dist/useRecordsDepth-BU-OhzH6.d.ts +237 -0
  126. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  127. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  128. package/dist/video/index.cjs +1 -1941
  129. package/dist/video/index.d.cts +4 -4
  130. package/dist/video/index.d.ts +4 -4
  131. package/dist/video/index.js +1 -1938
  132. package/dist/view-C3qPIXGX.d.cts +310 -0
  133. package/dist/view-DtSPYpKa.d.ts +310 -0
  134. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  135. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  136. package/dist/web/consent/index.cjs +1 -0
  137. package/dist/web/consent/index.d.cts +34 -0
  138. package/dist/web/consent/index.d.ts +34 -0
  139. package/dist/web/consent/index.js +1 -0
  140. package/dist/web/index.cjs +14 -0
  141. package/dist/web/index.d.cts +217 -0
  142. package/dist/web/index.d.ts +217 -0
  143. package/dist/web/index.js +14 -0
  144. package/dist/web/notifications/index.cjs +2 -0
  145. package/dist/web/notifications/index.d.cts +213 -0
  146. package/dist/web/notifications/index.d.ts +213 -0
  147. package/dist/web/notifications/index.js +2 -0
  148. package/dist/web/records/depth/index.cjs +2 -0
  149. package/dist/web/records/depth/index.d.cts +12 -0
  150. package/dist/web/records/depth/index.d.ts +12 -0
  151. package/dist/web/records/depth/index.js +2 -0
  152. package/dist/web/records/index.cjs +4 -0
  153. package/dist/web/records/index.d.cts +194 -0
  154. package/dist/web/records/index.d.ts +194 -0
  155. package/dist/web/records/index.js +4 -0
  156. package/dist/web/televet/index.cjs +1 -0
  157. package/dist/web/televet/index.d.cts +50 -0
  158. package/dist/web/televet/index.d.ts +50 -0
  159. package/dist/web/televet/index.js +1 -0
  160. package/notifications/package.json +8 -0
  161. package/package.json +197 -9
  162. package/records/depth/package.json +8 -0
  163. package/server/events/device-blocked.cjs +15 -0
  164. package/server/events/package.json +9 -0
  165. package/televet/package.json +8 -0
  166. package/testing/web/native-blocked.cjs +12 -0
  167. package/testing/web/package.json +8 -0
  168. package/web/consent/native-blocked.cjs +12 -0
  169. package/web/consent/package.json +8 -0
  170. package/web/native-blocked.cjs +12 -0
  171. package/web/notifications/native-blocked.cjs +12 -0
  172. package/web/notifications/package.json +8 -0
  173. package/web/package.json +8 -0
  174. package/web/records/depth/native-blocked.cjs +12 -0
  175. package/web/records/depth/package.json +8 -0
  176. package/web/records/native-blocked.cjs +12 -0
  177. package/web/records/package.json +8 -0
  178. package/web/televet/native-blocked.cjs +12 -0
  179. package/web/televet/package.json +8 -0
  180. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  181. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  182. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  183. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  184. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  185. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  186. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  187. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),zod=require('zod');var Se=Object.defineProperty;var n=(e,t)=>Se(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 g=x;var H=Symbol.for("@everfur/sdk#EverfurContext@v1"),W=globalThis,$=W[H]??(W[H]=react.createContext(null));$.displayName??="EverfurContext";function b(){let e=react.useContext($);if(e===null)throw new g("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(b,"useEverfurContext");function Te(){let{runtime:e}=b();return react.useMemo(()=>({apply:n(t=>e.updateEntitlements(t),"apply")}),[e])}n(Te,"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 Oe=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:Oe[e.wireCode]}))),ke=new Map(G.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Fe=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",...Fe]){let a=ke.get(o+r);if(a)return a}}n(O,"contractErrorFor");function Ie(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(Ie,"contractDocUrl");function Q(e){return null}n(Q,"publishedDocUrl");var Ae=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 Ae[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 Pe=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function U(e){return Pe.has(e)}n(U,"isAutoRetryable");var je=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Z(e){return U(e)||je.has(e)}n(Z,"isRetryableCode");var ze=500,V=8e3,ee=4;function te(e,t=Math.random){let r=Math.max(0,e),o=Math.min(ze*2**r,V);return Math.floor(t()*o)}n(te,"backoffDelayMs");var qe=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 De(e){return qe[e]}n(De,"userFacingError");function re(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(re,"defineHidden");var Ue=/^[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:De(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Ue.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 Le(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(Le,"authHeaders");function R(e,t){return {...e,headers:{...Ne(e.headers),...Le(t)}}}n(R,"withAuthHeaders");function Ne(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(Ne,"stripAuthHeaders");async function oe(e,t){if(t.mode==="anonymous")return t.transport.request(R(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(R(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(R(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:Be(e)})}n(ie,"networkError");function Be(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Be,"describeCause");var Ye=3e4,He=V*2,We="idempotency-key",$e=new Set(["POST","PUT","PATCH","DELETE"]),Ke=Object.freeze({onEvent(){}}),Ge=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function k(e){let t=e.observer??Ke,r=e.timers??Ge,o=e.rng??Math.random,a=e.sleep??((m,d)=>lt(m,r,d)),s=e.maxAttempts??ee,u=e.unaryTimeoutMs??Ye,p=e.newIdempotencyKey??Xe(),c=n(m=>{try{t.onEvent(m);}catch{}},"emit");async function f(m,d,w){let A=w?.maxAttempts,ge=Math.max(1,A??s),P=w?.idempotent??$e.has(d.method)?p():null,Re=Qe(d,P),j=0;for(;;){let h=n(q=>Object.freeze({call:m,method:d.method,path:d.path,attempt:j,...P?{idempotencyKey:P}:{},...q}),"stamp");c(h({phase:"attempt"}));let B=at(u,r),Y=st(B.signal,d.signal),E;try{E=await oe({...Re,signal:Y.signal},e.auth);}catch(q){E=l(ie(q));}finally{Y.dispose(),B.cancel();}if(E.ok)return c(h({phase:"settled",ok:true,reason:"ok"})),E;let v=E.error,C=Ze(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(h({phase:"settled",...z})),l(v);if(c(h({phase:"retry",...z,delayMs:C.delayMs})),await a(C.delayMs,d.signal),d.signal?.aborted===true)return c(h({phase:"settled",...z,reason:"aborted"})),l(v);j+=1;}}n(f,"send");async function S(m){return R(m,await it(e.auth))}n(S,"authorize");async function*Ee(m,d,w){c(Object.freeze({call:m,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,w);}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:S,stream:Ee})}n(k,"createRequestFunnel");function Qe(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==We&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Qe,"assembleHeaders");function Xe(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Xe,"defaultIdempotencyKeyFactory");var Je=10;function Ze(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=et(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(Je,Math.floor(f)))},"policyCeiling"),p=r.perCallMaxAttempts??u()??r.maxAttempts;if(t+1>=p)return {retry:false,reason:"attempts-exhausted"};let c=tt(e,r.now);return c!==null?c>He?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:c}:{retry:true,reason:a,delayMs:te(t,r.rng)}}n(Ze,"decideRetry");function et(e){let t=e.code==="unknown"?J(ot(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(et,"throttleKind");function tt(e,t){let r=rt(e.raw);if(r===null)return null;let o=r-t;return o>0?o:0}n(tt,"retryOverrideMs");function rt(e){for(let t of se(e)){let r=t.resets_at,o=nt(r);if(o!==null)return o}return null}n(rt,"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 nt(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(nt,"parseInstantMs");function ot(e){for(let t of se(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(ot,"rawWireCode");function ae(e){return typeof e=="object"&&e!==null}n(ae,"isRecord");async function it(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(it,"resolveDeviceAuth");function at(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(at,"boundedSignal");function st(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(st,"mergeSignals");function lt(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(lt,"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 ut(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(ut,"normalizeStatus");var dt=zod.z.object({request_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),status:zod.z.string(),simple_status:zod.z.string().nullish(),simple_status_detail:zod.z.string().nullish(),status_label:zod.z.string().optional(),dispatch_status:zod.z.string().nullish(),can_retry_send:zod.z.boolean().optional(),can_revoke:zod.z.boolean().optional(),can_convert_to_upload:zod.z.boolean().optional(),can_update_clinic_email:zod.z.boolean().optional(),reminder_count:zod.z.number().int().nonnegative().optional(),last_reminder_at:zod.z.string().nullish(),waiting_expectation:zod.z.string().nullish(),document_count:zod.z.number().optional(),held_item_count:zod.z.number().optional(),received_at:zod.z.string().nullish(),parsing_started_at:zod.z.string().nullish(),review_started_at:zod.z.string().nullish(),created_at:zod.z.string().optional(),updated_at:zod.z.string().optional(),source:zod.z.string().nullish().catch(null),action_needed_label:zod.z.string().nullish().catch(null),failure_reason:zod.z.string().nullish().catch(null),failure_code:zod.z.string().nullish().catch(null),recovery_stage:zod.z.string().nullish().catch(null),show_clinic_phone:zod.z.boolean().optional().catch(void 0),clinic_name:zod.z.string().nullish().catch(null),clinic_email:zod.z.string().nullish().catch(null),clinic_phone:zod.z.string().nullish().catch(null),converted_to_upload_at:zod.z.string().nullish().catch(null),request_group_id:zod.z.string().nullish().catch(null)}).passthrough();function pe(e){let t=dt.safeParse(e);if(!t.success)return null;let r=t.data,o=ct(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??ut(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");zod.z.object({request_group_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),total:zod.z.number().int().nonnegative(),responded:zod.z.number().int().nonnegative(),pending:zod.z.number().int().nonnegative(),members:zod.z.array(zod.z.unknown())});function ct(e){return !e||e==="awaiting_upload"||e==="in_review"?null:ce.has(e)?e:null}n(ct,"normalizeSimpleStatus");zod.z.object({source_doc_id:zod.z.string().min(1),request_id:zod.z.string().min(1)});var pt=zod.z.object({label:zod.z.string(),value:zod.z.string()}),ft=zod.z.object({key:zod.z.string(),category:zod.z.string().optional(),label:zod.z.string().optional(),value:zod.z.string().nullish(),unit:zod.z.string().nullish(),observed_at:zod.z.string().nullish(),status:zod.z.string().nullish(),origin:zod.z.string().nullish(),canonical_key:zod.z.string().nullish()}),yt=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),mt=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(yt).optional()}),vt=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),_t=zod.z.object({doc_id:zod.z.string(),title:zod.z.string().nullish(),page_count:zod.z.number().nullish(),received_at:zod.z.string().nullish()});zod.z.object({identity:zod.z.array(pt).optional(),entities:zod.z.array(ft).optional(),entity_series:zod.z.array(mt).optional(),forward_looking:zod.z.array(vt).optional(),documents:zod.z.array(_t).optional()});zod.z.object({pet_ref:zod.z.string().optional(),granted:zod.z.boolean().optional(),version:zod.z.string().nullish(),granted_at:zod.z.string().nullish()});function de(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}n(de,"numberOr");var bt="/widget/v1/records/sandbox/requests",fe=64,ht=new Set(["records","no_records","declined"]),Et=new Set(["applied","already_applied","not_applicable"]);function I(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(I,"invalid");function gt(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(gt,"requestIdError");function Rt(e){if(typeof e!="object"||e===null)return null;let{result:t,request:r}=e;if(typeof t!="string"||!Et.has(t))return null;let o=pe(r);return o===null?null:Object.freeze({result:t,request:o})}n(Rt,"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=gt(a);if(p!==null)return l(p);let c=`${bt}/${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 S=Rt(f.value);return S===null?l(y("internalError",{retryable:false})):T(S)},"run");return {simulateClinicReply(o,a){return typeof a!="string"||!ht.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 wt(){let{runtime:e,userRef:t,scopeEpoch:r}=b();return react.useMemo(()=>{let{services:o}=e.registry;return ye({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(wt,"useEverfurRecordsSandbox");var L="/widget/v1/televet/sandbox/visits",Ct=128,me=64,be=new Set(["booked","cancelled","completed","no_show"]),xt=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 Tt(e){if(typeof e!="object"||e===null)return null;let{result:t,visit:r}=e;if(typeof t!="string"||!xt.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(Tt,"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=Tt(u.value);return p===null?l(y("internalError",{retryable:false})):T(p)},"run");return {createVisit(o){let a=N("pet_ref",o,Ct);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 kt(){let{runtime:e,userRef:t,scopeEpoch:r}=b();return react.useMemo(()=>{let{services:o}=e.registry;return he({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(kt,"useEverfurVetVisitSandbox");exports.useEverfurRecordsSandbox=wt;exports.useEverfurTestEntitlements=Te;exports.useEverfurVetVisitSandbox=kt;
@@ -0,0 +1,131 @@
1
+ import { E as EntitlementSnapshot } from '../../runtime-B8s-_hv8.cjs';
2
+ import { c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.cjs';
3
+ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurResult-DN9pL2Ab.cjs';
4
+ import { R as RecordsRequestId, P as PetRef } from '../../ids-B2GAAifq.cjs';
5
+ export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.cjs';
6
+ import { d as RecordsRequestView } from '../../models-D2EUxPZY.cjs';
7
+ export { c as RecordsRequestStatus, e as RecordsSimpleStatus } from '../../models-D2EUxPZY.cjs';
8
+ export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../entitlementRepository-DKdXFgTo.cjs';
9
+ export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.cjs';
10
+ import '../../config-CzTZGlfF.cjs';
11
+ import '../../casesRepository-DHwtGRYY.cjs';
12
+ import '../../identity-DI4eVx9S.cjs';
13
+ import '../../profile-CSs1wlXT.cjs';
14
+ import '../../cacheEpoch-DknKn3S0.cjs';
15
+ import '../../TelemetryPort-BDNr00hu.cjs';
16
+ import '../../ports-DEBzEhbp.cjs';
17
+ import '../../requestFunnel-L-BQfi0z.cjs';
18
+ import '../../ErrorPolicyPort-CNf4uQZP.cjs';
19
+ import '../../ports-BN6RHF9W.cjs';
20
+ import '../../CameraPort-Cv31Pz7g.cjs';
21
+
22
+ /** The testing seam handle: apply a resolved verdict to THIS provider's runtime. */
23
+ interface EverfurTestEntitlements {
24
+ /**
25
+ * Replace the entitlement verdict the current <EverfurProvider>'s runtime renders. Drives the SDK's own
26
+ * `useCapability` / `CapabilityGate` across every subpath (they read this one store), so a test/demo can
27
+ * flip a capability on or off and watch the real gates react. Render-only: the server stays authoritative.
28
+ */
29
+ apply(snapshot: EntitlementSnapshot): void;
30
+ }
31
+ /**
32
+ * TEST / DEMO ONLY. Obtain a handle to push a simulated server entitlement verdict into the enclosing
33
+ * <EverfurProvider>'s runtime. Must be called inside an <EverfurProvider>.
34
+ *
35
+ * @throws {EverfurConfigError} kind 'not-initialized' when called outside an <EverfurProvider>.
36
+ */
37
+ declare function useEverfurTestEntitlements(): EverfurTestEntitlements;
38
+
39
+ /** The clinic reply to simulate: records arrive, the clinic has none, or the clinic declines. */
40
+ type RecordsSandboxClinicReply = 'records' | 'no_records' | 'declined';
41
+ /**
42
+ * What the server did: `applied` moved the request, `already_applied` found it already there (nothing written
43
+ * twice), `not_applicable` means the real transition rules refuse it from the request's current state.
44
+ */
45
+ type RecordsSandboxResult = 'applied' | 'already_applied' | 'not_applicable';
46
+ /** The settled outcome of one test-mode action. */
47
+ interface RecordsSandboxActionResult {
48
+ /** What the server did with the action. */
49
+ readonly result: RecordsSandboxResult;
50
+ /** The request as it stands after the action. */
51
+ readonly request: RecordsRequestView;
52
+ }
53
+ /** Records test mode. Answers only for a sandbox tenant's signed user and that user's own request. */
54
+ interface RecordsSandboxController {
55
+ /** Simulate the clinic's reply to a clinic request. */
56
+ simulateClinicReply(requestId: RecordsRequestId, outcome: RecordsSandboxClinicReply): Promise<EverfurResult<RecordsSandboxActionResult>>;
57
+ /** Attach a synthetic sample document to the request and publish a sample record for its pet. */
58
+ publishSampleRecord(requestId: RecordsRequestId): Promise<EverfurResult<RecordsSandboxActionResult>>;
59
+ }
60
+
61
+ /**
62
+ * Drive a records request through test mode: `simulateClinicReply(requestId, outcome)` and
63
+ * `publishSampleRecord(requestId)`. Sandbox tenants only; anywhere else every call settles to the not-found error.
64
+ * Re-scoped with the provider's user, so a call is always made as the current user.
65
+ */
66
+ declare function useEverfurRecordsSandbox(): RecordsSandboxController;
67
+
68
+ /** A partner-visible visit status: exactly what the `visit.*` webhook events carry. */
69
+ type VetVisitSandboxStatus = 'booked' | 'cancelled' | 'completed' | 'no_show';
70
+ /**
71
+ * What the server did: `applied` created or moved the visit, `already_applied` found it already there (nothing
72
+ * written, no event sent twice), `not_applicable` means the visit rules refuse the move from its current status.
73
+ */
74
+ type VetVisitSandboxResult = 'applied' | 'already_applied' | 'not_applicable';
75
+ /** A simulated visit as the server reports it. */
76
+ interface VetVisitSandboxVisit {
77
+ /** The visit reference, the same value the `visit.*` webhook events carry as `visit_ref`. */
78
+ readonly visitRef: string;
79
+ /** Your pet reference the visit was created for. */
80
+ readonly petRef: PetRef;
81
+ /** The partner-visible status the visit is now in. */
82
+ readonly status: VetVisitSandboxStatus;
83
+ /** ISO-8601 timestamp the simulated visit is scheduled for. */
84
+ readonly scheduledAt: string;
85
+ }
86
+ /**
87
+ * The visit NOTIFICATION events test mode can raise, exactly the `visit.*` types that are not a status change
88
+ * (`partner_televet_sandbox_types.SandboxVisitEvent`). Each sends the same webhook, push and email a real
89
+ * visit sends, with `livemode: false`, so the routing a tap does can be exercised end to end:
90
+ *
91
+ * - `rescheduled`: the owner moved the visit one slot (`visit.rescheduled`);
92
+ * - `reminder`: a lead-time reminder (`visit.reminder`), the one event that takes a `stage`;
93
+ * - `followup_sent`: the after-visit follow-up (`visit.followup_sent`);
94
+ * - `message_received`: the vet wrote in the thread (`visit.message_received`);
95
+ * - `ended`: the call ended before the note was signed (`visit.ended`).
96
+ *
97
+ * The simulated visit must be in a status the real producer acts from, or the server answers
98
+ * `not_applicable` and writes nothing: `followup_sent` needs a completed visit, the rest a scheduled one,
99
+ * and `message_received` works from either.
100
+ */
101
+ type VetVisitSandboxEvent = 'rescheduled' | 'reminder' | 'followup_sent' | 'message_received' | 'ended';
102
+ /** A reminder's lead time (`partner_visit_events.VISIT_REMINDER_STAGES`), and only a reminder has one. */
103
+ type VetVisitSandboxReminderStage = '24h' | '30m';
104
+ /** The settled outcome of one test-mode action. */
105
+ interface VetVisitSandboxActionResult {
106
+ /** What the server did with the action. */
107
+ readonly result: VetVisitSandboxResult;
108
+ /** The visit as it stands after the action. */
109
+ readonly visit: VetVisitSandboxVisit;
110
+ }
111
+ /** Vet visit test mode. Answers only for a sandbox tenant's signed user and that user's own pets and visits. */
112
+ interface VetVisitSandboxController {
113
+ /** Create a simulated visit, status `booked`, for one of the signed user's registered pets. */
114
+ createVisit(petRef: PetRef): Promise<EverfurResult<VetVisitSandboxActionResult>>;
115
+ /** Move a simulated visit to `to`. */
116
+ advanceVisit(visitRef: string, to: VetVisitSandboxStatus): Promise<EverfurResult<VetVisitSandboxActionResult>>;
117
+ /**
118
+ * Raise one visit notification event for a simulated visit, so you can test what a tap on it opens without
119
+ * waiting for a real appointment. `stage` is REQUIRED for `reminder` and refused for every other event.
120
+ */
121
+ simulateVisitEvent(visitRef: string, event: VetVisitSandboxEvent, stage?: VetVisitSandboxReminderStage): Promise<EverfurResult<VetVisitSandboxActionResult>>;
122
+ }
123
+
124
+ /**
125
+ * Drive a simulated vet visit through test mode: `createVisit(petRef)` and `advanceVisit(visitRef, to)`.
126
+ * Sandbox tenants only; anywhere else every call settles to the not-found error. Re-scoped with the provider's
127
+ * user, so a call is always made as the current user.
128
+ */
129
+ declare function useEverfurVetVisitSandbox(): VetVisitSandboxController;
130
+
131
+ export { EntitlementSnapshot, EverfurResult, type EverfurTestEntitlements, PetRef, RecordsRequestId, RecordsRequestView, type RecordsSandboxActionResult, type RecordsSandboxClinicReply, type RecordsSandboxController, type RecordsSandboxResult, type VetVisitSandboxActionResult, type VetVisitSandboxController, type VetVisitSandboxEvent, type VetVisitSandboxReminderStage, type VetVisitSandboxResult, type VetVisitSandboxStatus, type VetVisitSandboxVisit, useEverfurRecordsSandbox, useEverfurTestEntitlements, useEverfurVetVisitSandbox };
@@ -0,0 +1,131 @@
1
+ import { E as EntitlementSnapshot } from '../../runtime-BR9ysG0J.js';
2
+ import { c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.js';
3
+ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurResult-DN9pL2Ab.js';
4
+ import { R as RecordsRequestId, P as PetRef } from '../../ids-B2GAAifq.js';
5
+ export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
6
+ import { d as RecordsRequestView } from '../../models-B-Uh2LTf.js';
7
+ export { c as RecordsRequestStatus, e as RecordsSimpleStatus } from '../../models-B-Uh2LTf.js';
8
+ export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../entitlementRepository-DSbzuyAW.js';
9
+ export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.js';
10
+ import '../../config-DW60uRb9.js';
11
+ import '../../casesRepository-ClLv6qMl.js';
12
+ import '../../identity-BMx2SUOM.js';
13
+ import '../../profile-CSs1wlXT.js';
14
+ import '../../cacheEpoch-DknKn3S0.js';
15
+ import '../../TelemetryPort-BDNr00hu.js';
16
+ import '../../ports-DMolTRzU.js';
17
+ import '../../requestFunnel-CjW7uDuA.js';
18
+ import '../../ErrorPolicyPort-CwbfmxzJ.js';
19
+ import '../../ports-BN6RHF9W.js';
20
+ import '../../CameraPort-Cv31Pz7g.js';
21
+
22
+ /** The testing seam handle: apply a resolved verdict to THIS provider's runtime. */
23
+ interface EverfurTestEntitlements {
24
+ /**
25
+ * Replace the entitlement verdict the current <EverfurProvider>'s runtime renders. Drives the SDK's own
26
+ * `useCapability` / `CapabilityGate` across every subpath (they read this one store), so a test/demo can
27
+ * flip a capability on or off and watch the real gates react. Render-only: the server stays authoritative.
28
+ */
29
+ apply(snapshot: EntitlementSnapshot): void;
30
+ }
31
+ /**
32
+ * TEST / DEMO ONLY. Obtain a handle to push a simulated server entitlement verdict into the enclosing
33
+ * <EverfurProvider>'s runtime. Must be called inside an <EverfurProvider>.
34
+ *
35
+ * @throws {EverfurConfigError} kind 'not-initialized' when called outside an <EverfurProvider>.
36
+ */
37
+ declare function useEverfurTestEntitlements(): EverfurTestEntitlements;
38
+
39
+ /** The clinic reply to simulate: records arrive, the clinic has none, or the clinic declines. */
40
+ type RecordsSandboxClinicReply = 'records' | 'no_records' | 'declined';
41
+ /**
42
+ * What the server did: `applied` moved the request, `already_applied` found it already there (nothing written
43
+ * twice), `not_applicable` means the real transition rules refuse it from the request's current state.
44
+ */
45
+ type RecordsSandboxResult = 'applied' | 'already_applied' | 'not_applicable';
46
+ /** The settled outcome of one test-mode action. */
47
+ interface RecordsSandboxActionResult {
48
+ /** What the server did with the action. */
49
+ readonly result: RecordsSandboxResult;
50
+ /** The request as it stands after the action. */
51
+ readonly request: RecordsRequestView;
52
+ }
53
+ /** Records test mode. Answers only for a sandbox tenant's signed user and that user's own request. */
54
+ interface RecordsSandboxController {
55
+ /** Simulate the clinic's reply to a clinic request. */
56
+ simulateClinicReply(requestId: RecordsRequestId, outcome: RecordsSandboxClinicReply): Promise<EverfurResult<RecordsSandboxActionResult>>;
57
+ /** Attach a synthetic sample document to the request and publish a sample record for its pet. */
58
+ publishSampleRecord(requestId: RecordsRequestId): Promise<EverfurResult<RecordsSandboxActionResult>>;
59
+ }
60
+
61
+ /**
62
+ * Drive a records request through test mode: `simulateClinicReply(requestId, outcome)` and
63
+ * `publishSampleRecord(requestId)`. Sandbox tenants only; anywhere else every call settles to the not-found error.
64
+ * Re-scoped with the provider's user, so a call is always made as the current user.
65
+ */
66
+ declare function useEverfurRecordsSandbox(): RecordsSandboxController;
67
+
68
+ /** A partner-visible visit status: exactly what the `visit.*` webhook events carry. */
69
+ type VetVisitSandboxStatus = 'booked' | 'cancelled' | 'completed' | 'no_show';
70
+ /**
71
+ * What the server did: `applied` created or moved the visit, `already_applied` found it already there (nothing
72
+ * written, no event sent twice), `not_applicable` means the visit rules refuse the move from its current status.
73
+ */
74
+ type VetVisitSandboxResult = 'applied' | 'already_applied' | 'not_applicable';
75
+ /** A simulated visit as the server reports it. */
76
+ interface VetVisitSandboxVisit {
77
+ /** The visit reference, the same value the `visit.*` webhook events carry as `visit_ref`. */
78
+ readonly visitRef: string;
79
+ /** Your pet reference the visit was created for. */
80
+ readonly petRef: PetRef;
81
+ /** The partner-visible status the visit is now in. */
82
+ readonly status: VetVisitSandboxStatus;
83
+ /** ISO-8601 timestamp the simulated visit is scheduled for. */
84
+ readonly scheduledAt: string;
85
+ }
86
+ /**
87
+ * The visit NOTIFICATION events test mode can raise, exactly the `visit.*` types that are not a status change
88
+ * (`partner_televet_sandbox_types.SandboxVisitEvent`). Each sends the same webhook, push and email a real
89
+ * visit sends, with `livemode: false`, so the routing a tap does can be exercised end to end:
90
+ *
91
+ * - `rescheduled`: the owner moved the visit one slot (`visit.rescheduled`);
92
+ * - `reminder`: a lead-time reminder (`visit.reminder`), the one event that takes a `stage`;
93
+ * - `followup_sent`: the after-visit follow-up (`visit.followup_sent`);
94
+ * - `message_received`: the vet wrote in the thread (`visit.message_received`);
95
+ * - `ended`: the call ended before the note was signed (`visit.ended`).
96
+ *
97
+ * The simulated visit must be in a status the real producer acts from, or the server answers
98
+ * `not_applicable` and writes nothing: `followup_sent` needs a completed visit, the rest a scheduled one,
99
+ * and `message_received` works from either.
100
+ */
101
+ type VetVisitSandboxEvent = 'rescheduled' | 'reminder' | 'followup_sent' | 'message_received' | 'ended';
102
+ /** A reminder's lead time (`partner_visit_events.VISIT_REMINDER_STAGES`), and only a reminder has one. */
103
+ type VetVisitSandboxReminderStage = '24h' | '30m';
104
+ /** The settled outcome of one test-mode action. */
105
+ interface VetVisitSandboxActionResult {
106
+ /** What the server did with the action. */
107
+ readonly result: VetVisitSandboxResult;
108
+ /** The visit as it stands after the action. */
109
+ readonly visit: VetVisitSandboxVisit;
110
+ }
111
+ /** Vet visit test mode. Answers only for a sandbox tenant's signed user and that user's own pets and visits. */
112
+ interface VetVisitSandboxController {
113
+ /** Create a simulated visit, status `booked`, for one of the signed user's registered pets. */
114
+ createVisit(petRef: PetRef): Promise<EverfurResult<VetVisitSandboxActionResult>>;
115
+ /** Move a simulated visit to `to`. */
116
+ advanceVisit(visitRef: string, to: VetVisitSandboxStatus): Promise<EverfurResult<VetVisitSandboxActionResult>>;
117
+ /**
118
+ * Raise one visit notification event for a simulated visit, so you can test what a tap on it opens without
119
+ * waiting for a real appointment. `stage` is REQUIRED for `reminder` and refused for every other event.
120
+ */
121
+ simulateVisitEvent(visitRef: string, event: VetVisitSandboxEvent, stage?: VetVisitSandboxReminderStage): Promise<EverfurResult<VetVisitSandboxActionResult>>;
122
+ }
123
+
124
+ /**
125
+ * Drive a simulated vet visit through test mode: `createVisit(petRef)` and `advanceVisit(visitRef, to)`.
126
+ * Sandbox tenants only; anywhere else every call settles to the not-found error. Re-scoped with the provider's
127
+ * user, so a call is always made as the current user.
128
+ */
129
+ declare function useEverfurVetVisitSandbox(): VetVisitSandboxController;
130
+
131
+ export { EntitlementSnapshot, EverfurResult, type EverfurTestEntitlements, PetRef, RecordsRequestId, RecordsRequestView, type RecordsSandboxActionResult, type RecordsSandboxClinicReply, type RecordsSandboxController, type RecordsSandboxResult, type VetVisitSandboxActionResult, type VetVisitSandboxController, type VetVisitSandboxEvent, type VetVisitSandboxReminderStage, type VetVisitSandboxResult, type VetVisitSandboxStatus, type VetVisitSandboxVisit, useEverfurRecordsSandbox, useEverfurTestEntitlements, useEverfurVetVisitSandbox };
@@ -0,0 +1 @@
1
+ import {createContext,useMemo,useContext}from'react';import {z}from'zod';var Se=Object.defineProperty;var n=(e,t)=>Se(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 g=x;var H=Symbol.for("@everfur/sdk#EverfurContext@v1"),W=globalThis,$=W[H]??(W[H]=createContext(null));$.displayName??="EverfurContext";function b(){let e=useContext($);if(e===null)throw new g("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(b,"useEverfurContext");function Te(){let{runtime:e}=b();return useMemo(()=>({apply:n(t=>e.updateEntitlements(t),"apply")}),[e])}n(Te,"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 Oe=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:Oe[e.wireCode]}))),ke=new Map(G.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Fe=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",...Fe]){let a=ke.get(o+r);if(a)return a}}n(O,"contractErrorFor");function Ie(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(Ie,"contractDocUrl");function Q(e){return null}n(Q,"publishedDocUrl");var Ae=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 Ae[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 Pe=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function U(e){return Pe.has(e)}n(U,"isAutoRetryable");var je=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Z(e){return U(e)||je.has(e)}n(Z,"isRetryableCode");var ze=500,V=8e3,ee=4;function te(e,t=Math.random){let r=Math.max(0,e),o=Math.min(ze*2**r,V);return Math.floor(t()*o)}n(te,"backoffDelayMs");var qe=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 De(e){return qe[e]}n(De,"userFacingError");function re(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(re,"defineHidden");var Ue=/^[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:De(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Ue.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 Le(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(Le,"authHeaders");function R(e,t){return {...e,headers:{...Ne(e.headers),...Le(t)}}}n(R,"withAuthHeaders");function Ne(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(Ne,"stripAuthHeaders");async function oe(e,t){if(t.mode==="anonymous")return t.transport.request(R(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(R(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(R(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:Be(e)})}n(ie,"networkError");function Be(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Be,"describeCause");var Ye=3e4,He=V*2,We="idempotency-key",$e=new Set(["POST","PUT","PATCH","DELETE"]),Ke=Object.freeze({onEvent(){}}),Ge=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function k(e){let t=e.observer??Ke,r=e.timers??Ge,o=e.rng??Math.random,a=e.sleep??((m,d)=>lt(m,r,d)),s=e.maxAttempts??ee,u=e.unaryTimeoutMs??Ye,p=e.newIdempotencyKey??Xe(),c=n(m=>{try{t.onEvent(m);}catch{}},"emit");async function f(m,d,w){let A=w?.maxAttempts,ge=Math.max(1,A??s),P=w?.idempotent??$e.has(d.method)?p():null,Re=Qe(d,P),j=0;for(;;){let h=n(q=>Object.freeze({call:m,method:d.method,path:d.path,attempt:j,...P?{idempotencyKey:P}:{},...q}),"stamp");c(h({phase:"attempt"}));let B=at(u,r),Y=st(B.signal,d.signal),E;try{E=await oe({...Re,signal:Y.signal},e.auth);}catch(q){E=l(ie(q));}finally{Y.dispose(),B.cancel();}if(E.ok)return c(h({phase:"settled",ok:true,reason:"ok"})),E;let v=E.error,C=Ze(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(h({phase:"settled",...z})),l(v);if(c(h({phase:"retry",...z,delayMs:C.delayMs})),await a(C.delayMs,d.signal),d.signal?.aborted===true)return c(h({phase:"settled",...z,reason:"aborted"})),l(v);j+=1;}}n(f,"send");async function S(m){return R(m,await it(e.auth))}n(S,"authorize");async function*Ee(m,d,w){c(Object.freeze({call:m,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,w);}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:S,stream:Ee})}n(k,"createRequestFunnel");function Qe(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==We&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Qe,"assembleHeaders");function Xe(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Xe,"defaultIdempotencyKeyFactory");var Je=10;function Ze(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=et(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(Je,Math.floor(f)))},"policyCeiling"),p=r.perCallMaxAttempts??u()??r.maxAttempts;if(t+1>=p)return {retry:false,reason:"attempts-exhausted"};let c=tt(e,r.now);return c!==null?c>He?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:c}:{retry:true,reason:a,delayMs:te(t,r.rng)}}n(Ze,"decideRetry");function et(e){let t=e.code==="unknown"?J(ot(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(et,"throttleKind");function tt(e,t){let r=rt(e.raw);if(r===null)return null;let o=r-t;return o>0?o:0}n(tt,"retryOverrideMs");function rt(e){for(let t of se(e)){let r=t.resets_at,o=nt(r);if(o!==null)return o}return null}n(rt,"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 nt(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(nt,"parseInstantMs");function ot(e){for(let t of se(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(ot,"rawWireCode");function ae(e){return typeof e=="object"&&e!==null}n(ae,"isRecord");async function it(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(it,"resolveDeviceAuth");function at(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(at,"boundedSignal");function st(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(st,"mergeSignals");function lt(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(lt,"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 ut(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(ut,"normalizeStatus");var dt=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=dt.safeParse(e);if(!t.success)return null;let r=t.data,o=ct(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??ut(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 ct(e){return !e||e==="awaiting_upload"||e==="in_review"?null:ce.has(e)?e:null}n(ct,"normalizeSimpleStatus");z.object({source_doc_id:z.string().min(1),request_id:z.string().min(1)});var pt=z.object({label:z.string(),value:z.string()}),ft=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()}),yt=z.object({at:z.string(),value:z.number().nullish(),display:z.string().nullish(),origin:z.string().nullish()}),mt=z.object({key:z.string(),label:z.string().optional(),points:z.array(yt).optional()}),vt=z.object({title:z.string(),detail:z.string().nullish(),due_at:z.string().nullish()}),_t=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(pt).optional(),entities:z.array(ft).optional(),entity_series:z.array(mt).optional(),forward_looking:z.array(vt).optional(),documents:z.array(_t).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 bt="/widget/v1/records/sandbox/requests",fe=64,ht=new Set(["records","no_records","declined"]),Et=new Set(["applied","already_applied","not_applicable"]);function I(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(I,"invalid");function gt(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(gt,"requestIdError");function Rt(e){if(typeof e!="object"||e===null)return null;let{result:t,request:r}=e;if(typeof t!="string"||!Et.has(t))return null;let o=pe(r);return o===null?null:Object.freeze({result:t,request:o})}n(Rt,"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=gt(a);if(p!==null)return l(p);let c=`${bt}/${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 S=Rt(f.value);return S===null?l(y("internalError",{retryable:false})):T(S)},"run");return {simulateClinicReply(o,a){return typeof a!="string"||!ht.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 wt(){let{runtime:e,userRef:t,scopeEpoch:r}=b();return useMemo(()=>{let{services:o}=e.registry;return ye({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(wt,"useEverfurRecordsSandbox");var L="/widget/v1/televet/sandbox/visits",Ct=128,me=64,be=new Set(["booked","cancelled","completed","no_show"]),xt=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 Tt(e){if(typeof e!="object"||e===null)return null;let{result:t,visit:r}=e;if(typeof t!="string"||!xt.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(Tt,"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=Tt(u.value);return p===null?l(y("internalError",{retryable:false})):T(p)},"run");return {createVisit(o){let a=N("pet_ref",o,Ct);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 kt(){let{runtime:e,userRef:t,scopeEpoch:r}=b();return useMemo(()=>{let{services:o}=e.registry;return he({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(kt,"useEverfurVetVisitSandbox");export{wt as useEverfurRecordsSandbox,Te as useEverfurTestEntitlements,kt as useEverfurVetVisitSandbox};
@@ -0,0 +1,19 @@
1
+ import { p as RecordsTimelineView } from './depth-CErXCU8J.cjs';
2
+
3
+ type TimelineRowKind = 'visit' | 'vaccine' | 'weight' | 'medication';
4
+ interface TimelineRow {
5
+ /** Stable list key: the kind, the array index and the BE id (ids are not unique across rails). */
6
+ readonly key: string;
7
+ readonly kind: TimelineRowKind;
8
+ readonly kindLabel: string;
9
+ /** ISO, or null when the BE row carries no date (sinks to the bottom). */
10
+ readonly at: string | null;
11
+ readonly date: string;
12
+ readonly title: string;
13
+ readonly detail: string | null;
14
+ readonly docId: string | null;
15
+ }
16
+ /** Merge the four rails into one newest-first list; a dateless entry sinks rather than being dropped. */
17
+ declare function buildTimelineRows(timeline: RecordsTimelineView): readonly TimelineRow[];
18
+
19
+ export { type TimelineRow as T, type TimelineRowKind as a, buildTimelineRows as b };
@@ -0,0 +1,19 @@
1
+ import { p as RecordsTimelineView } from './depth-DjDcJ6kH.js';
2
+
3
+ type TimelineRowKind = 'visit' | 'vaccine' | 'weight' | 'medication';
4
+ interface TimelineRow {
5
+ /** Stable list key: the kind, the array index and the BE id (ids are not unique across rails). */
6
+ readonly key: string;
7
+ readonly kind: TimelineRowKind;
8
+ readonly kindLabel: string;
9
+ /** ISO, or null when the BE row carries no date (sinks to the bottom). */
10
+ readonly at: string | null;
11
+ readonly date: string;
12
+ readonly title: string;
13
+ readonly detail: string | null;
14
+ readonly docId: string | null;
15
+ }
16
+ /** Merge the four rails into one newest-first list; a dateless entry sinks rather than being dropped. */
17
+ declare function buildTimelineRows(timeline: RecordsTimelineView): readonly TimelineRow[];
18
+
19
+ export { type TimelineRow as T, type TimelineRowKind as a, buildTimelineRows as b };
@@ -0,0 +1,19 @@
1
+ import { E as EverfurFontWeight, a as EverfurTheme, b as EverfurFontFaceKey } from './entitlementRepository-DKdXFgTo.cjs';
2
+
3
+ /**
4
+ * The text style a surface spreads for one face. `fontWeight` is present ONLY for a base family (the platform
5
+ * font, the legacy `font_family`, or a `fonts` name repeated across weights); a named face carries its weight
6
+ * itself. The regular mono face carries no weight (code renders in the regular mono face); its medium and bold
7
+ * twins (`monoMedium`, `monoBold`) take theirs when the mono family is a base family.
8
+ */
9
+ interface EverfurFaceStyle {
10
+ readonly fontFamily: string;
11
+ readonly fontWeight?: EverfurFontWeight;
12
+ }
13
+ /**
14
+ * The family (and, for a base family, the numeric weight) of one face of the theme. Spread it into a style:
15
+ * `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
16
+ */
17
+ declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
18
+
19
+ export { type EverfurFaceStyle as E, face as f };
@@ -0,0 +1,19 @@
1
+ import { E as EverfurFontWeight, a as EverfurTheme, b as EverfurFontFaceKey } from './entitlementRepository-DSbzuyAW.js';
2
+
3
+ /**
4
+ * The text style a surface spreads for one face. `fontWeight` is present ONLY for a base family (the platform
5
+ * font, the legacy `font_family`, or a `fonts` name repeated across weights); a named face carries its weight
6
+ * itself. The regular mono face carries no weight (code renders in the regular mono face); its medium and bold
7
+ * twins (`monoMedium`, `monoBold`) take theirs when the mono family is a base family.
8
+ */
9
+ interface EverfurFaceStyle {
10
+ readonly fontFamily: string;
11
+ readonly fontWeight?: EverfurFontWeight;
12
+ }
13
+ /**
14
+ * The family (and, for a base family, the numeric weight) of one face of the theme. Spread it into a style:
15
+ * `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
16
+ */
17
+ declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
18
+
19
+ export { type EverfurFaceStyle as E, face as f };
@@ -0,0 +1,38 @@
1
+ import { F as FileHandle, U as UploadTransport } from './ports-BN6RHF9W.js';
2
+
3
+ /** The subset of `fetch` this adapter calls. */
4
+ type RnRecordsUploadFetch = (url: string, init: {
5
+ readonly method: 'POST';
6
+ readonly body: FormData;
7
+ readonly credentials: 'omit';
8
+ readonly signal?: AbortSignal;
9
+ }) => Promise<{
10
+ readonly ok: boolean;
11
+ }>;
12
+ interface RnRecordsUploadTransportOptions {
13
+ /** Test seam: the fetch to use. Defaults to the global `fetch`. A host has no reason to set it. */
14
+ readonly fetch?: RnRecordsUploadFetch;
15
+ }
16
+ /**
17
+ * A host-supplied document picker for React Native records upload. Open your own picker (for example
18
+ * `expo-document-picker`, which the SDK does not depend on) limited to PDF, and resolve:
19
+ *
20
+ * - `null` when the user cancels,
21
+ * - one `FileHandle`, or SEVERAL (a multi-select pick): each with the local `uri`, `mimeType: 'application/pdf'`
22
+ * and `sizeBytes`. A batch uploads one file at a time with a live row per file; a non-PDF or oversize file in
23
+ * it is skipped with a reason before any request is made (the single-file path refuses it the same way).
24
+ * `name` is optional, rendered in the rows locally, and never sent.
25
+ */
26
+ type RecordsDocumentPicker = () => Promise<FileHandle | readonly FileHandle[] | null>;
27
+ /**
28
+ * Create the React Native records upload transport. Pass it as `uploadTransport` on the `EverfurConfig`, or
29
+ * to `<EverfurRecords uploadTransport={...} />`:
30
+ *
31
+ * ```tsx
32
+ * const uploadTransport = createRnRecordsUploadTransport();
33
+ * <EverfurProvider config={{ publishableKey, apiBaseUrl, uploadTransport }} ...>
34
+ * ```
35
+ */
36
+ declare function createRnRecordsUploadTransport(options?: RnRecordsUploadTransportOptions): UploadTransport;
37
+
38
+ export { type RecordsDocumentPicker as R, type RnRecordsUploadFetch as a, type RnRecordsUploadTransportOptions as b, createRnRecordsUploadTransport as c };
@@ -0,0 +1,38 @@
1
+ import { F as FileHandle, U as UploadTransport } from './ports-BN6RHF9W.cjs';
2
+
3
+ /** The subset of `fetch` this adapter calls. */
4
+ type RnRecordsUploadFetch = (url: string, init: {
5
+ readonly method: 'POST';
6
+ readonly body: FormData;
7
+ readonly credentials: 'omit';
8
+ readonly signal?: AbortSignal;
9
+ }) => Promise<{
10
+ readonly ok: boolean;
11
+ }>;
12
+ interface RnRecordsUploadTransportOptions {
13
+ /** Test seam: the fetch to use. Defaults to the global `fetch`. A host has no reason to set it. */
14
+ readonly fetch?: RnRecordsUploadFetch;
15
+ }
16
+ /**
17
+ * A host-supplied document picker for React Native records upload. Open your own picker (for example
18
+ * `expo-document-picker`, which the SDK does not depend on) limited to PDF, and resolve:
19
+ *
20
+ * - `null` when the user cancels,
21
+ * - one `FileHandle`, or SEVERAL (a multi-select pick): each with the local `uri`, `mimeType: 'application/pdf'`
22
+ * and `sizeBytes`. A batch uploads one file at a time with a live row per file; a non-PDF or oversize file in
23
+ * it is skipped with a reason before any request is made (the single-file path refuses it the same way).
24
+ * `name` is optional, rendered in the rows locally, and never sent.
25
+ */
26
+ type RecordsDocumentPicker = () => Promise<FileHandle | readonly FileHandle[] | null>;
27
+ /**
28
+ * Create the React Native records upload transport. Pass it as `uploadTransport` on the `EverfurConfig`, or
29
+ * to `<EverfurRecords uploadTransport={...} />`:
30
+ *
31
+ * ```tsx
32
+ * const uploadTransport = createRnRecordsUploadTransport();
33
+ * <EverfurProvider config={{ publishableKey, apiBaseUrl, uploadTransport }} ...>
34
+ * ```
35
+ */
36
+ declare function createRnRecordsUploadTransport(options?: RnRecordsUploadTransportOptions): UploadTransport;
37
+
38
+ export { type RecordsDocumentPicker as R, type RnRecordsUploadFetch as a, type RnRecordsUploadTransportOptions as b, createRnRecordsUploadTransport as c };