@everfur/sdk 0.19.0 → 0.21.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 (203) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/{Chat.d-BHovj6Ku.d.ts → Chat.d-CoGJrK3t.d.ts} +1 -1
  3. package/dist/{Chat.d-BO-XtVYe.d.cts → Chat.d-JDtlG_EW.d.cts} +1 -1
  4. package/dist/{DepthViews.d-DKoZgF8l.d.ts → DepthViews.d-CNQn-eEr.d.ts} +1 -1
  5. package/dist/{DepthViews.d-CBUunxP1.d.ts → DepthViews.d-D31VlFKU.d.ts} +1 -1
  6. package/dist/{DepthViews.d-BwIkdmWZ.d.cts → DepthViews.d-XTv4s3ru.d.cts} +1 -1
  7. package/dist/{DepthViews.d-Bx85LeiP.d.cts → DepthViews.d-zxM_xbP9.d.cts} +1 -1
  8. package/dist/{RecordsPage.d-DRFp2LXH.d.cts → RecordsPage.d-CSZHrtWJ.d.cts} +11 -5
  9. package/dist/{RecordsPage.d-CsvBhU0f.d.ts → RecordsPage.d-D_y-ZB3S.d.ts} +11 -5
  10. package/dist/animations/index.d.cts +3 -3
  11. package/dist/animations/index.d.ts +3 -3
  12. package/dist/{attachments.d-DWUsHPf9.d.cts → attachments.d-D74wbmQU.d.cts} +1 -1
  13. package/dist/{attachments.d-DOZjCdkb.d.ts → attachments.d-Dm6NUJTR.d.ts} +1 -1
  14. package/dist/{bookingCopy.d-BlMWlvgv.d.ts → bookingCopy.d-DMmLKY5Q.d.ts} +2 -2
  15. package/dist/{bookingCopy.d-tvO7y6MK.d.cts → bookingCopy.d-iaYDPvPd.d.cts} +2 -2
  16. package/dist/{casesRepository.d-C7qbrOL-.d.ts → casesRepository.d-CCJJQXnl.d.ts} +1 -1
  17. package/dist/{casesRepository.d-sSo6oakf.d.cts → casesRepository.d-G2dahIKO.d.cts} +1 -1
  18. package/dist/chat/index.d.cts +10 -10
  19. package/dist/chat/index.d.ts +10 -10
  20. package/dist/chat/lite/index.d.cts +10 -10
  21. package/dist/chat/lite/index.d.ts +10 -10
  22. package/dist/{chatHandoffToken.d-C4tEyuCT.d.ts → chatHandoffToken.d-DVv9tl8h.d.ts} +5 -5
  23. package/dist/{chatHandoffToken.d-D6GUoBvs.d.cts → chatHandoffToken.d-xmnHrTA5.d.cts} +5 -5
  24. package/dist/{chatTypes.d-CSyw9em_.d.cts → chatTypes.d-CQC7GTdE.d.cts} +4 -4
  25. package/dist/{chatTypes.d-BI4vidgu.d.ts → chatTypes.d-hS1AilYl.d.ts} +4 -4
  26. package/dist/chunk-2NA7TPUA.js +5 -0
  27. package/dist/chunk-IJU5TV5N.js +12 -0
  28. package/dist/chunk-TFX6WMDN.js +30 -0
  29. package/dist/chunk-WZNPR5TY.js +34 -0
  30. package/dist/client/index.cjs +1 -1
  31. package/dist/client/index.d.cts +6 -6
  32. package/dist/client/index.d.ts +6 -6
  33. package/dist/client/index.js +1 -1
  34. package/dist/{clinicBatch.d-BxA_uGBb.d.cts → clinicBatch.d-4PFwKJfw.d.cts} +3 -3
  35. package/dist/{clinicBatch.d-T5oSAhY-.d.ts → clinicBatch.d-BpP2NBb3.d.ts} +3 -3
  36. package/dist/{clinicRequestProps.d-CjsMg_OD.d.ts → clinicRequestProps.d-BuMuGoVZ.d.ts} +1 -1
  37. package/dist/{clinicRequestProps.d-1dCtouGA.d.cts → clinicRequestProps.d-DjzUdDFx.d.cts} +1 -1
  38. package/dist/{config.d-N5Xzy53V.d.ts → config.d-D9igq-vT.d.ts} +1 -1
  39. package/dist/{config.d-jCmrhM4a.d.cts → config.d-cX5E6DAw.d.cts} +1 -1
  40. package/dist/consent/index.cjs +1 -1
  41. package/dist/consent/index.d.cts +5 -5
  42. package/dist/consent/index.d.ts +5 -5
  43. package/dist/consent/index.js +1 -1
  44. package/dist/{context.d-l4HkFJI8.d.cts → context.d-BrRRNw9I.d.cts} +4 -4
  45. package/dist/{context.d-BJEpEERH.d.ts → context.d-hPfsEsNf.d.ts} +4 -4
  46. package/dist/{copy.d-hFRaovog.d.ts → copy.d-CDlirTR4.d.ts} +2 -2
  47. package/dist/{copy.d-hS49oJ4w.d.cts → copy.d-DWjSkbrZ.d.cts} +2 -2
  48. package/dist/core/index.cjs +1 -1
  49. package/dist/core/index.d.cts +14 -14
  50. package/dist/core/index.d.ts +14 -14
  51. package/dist/core/index.js +1 -1
  52. package/dist/{depth.d-C99_xup2.d.ts → depth.d-CfBorxcQ.d.ts} +3 -3
  53. package/dist/{depth.d-BYwddMNU.d.cts → depth.d-KkrGx98U.d.cts} +3 -3
  54. package/dist/{entitlementRepository.d-CiU_QIPL.d.cts → entitlementRepository.d-BvnWpcQH.d.cts} +2 -2
  55. package/dist/{entitlementRepository.d-qZAlET7C.d.ts → entitlementRepository.d-DpQrIgW6.d.ts} +2 -2
  56. package/dist/{focus.d-RJMXplJc.d.cts → focus.d-9loikWy8.d.cts} +2 -2
  57. package/dist/{focus.d-CG6KhDBK.d.ts → focus.d-CYwVLDvR.d.ts} +2 -2
  58. package/dist/health-plan/index.cjs +53 -37
  59. package/dist/health-plan/index.d.cts +10 -10
  60. package/dist/health-plan/index.d.ts +10 -10
  61. package/dist/health-plan/index.js +54 -38
  62. package/dist/{idempotency.d-DJyOZDPb.d.cts → idempotency.d-CVKkUhY4.d.cts} +1 -1
  63. package/dist/{idempotency.d-D-ZWpO9p.d.ts → idempotency.d-DGQ_xML5.d.ts} +1 -1
  64. package/dist/{identity.d-CA7mW59I.d.cts → identity.d-Bnl5Z0MM.d.cts} +1 -1
  65. package/dist/{identity.d-DIOnFzXL.d.ts → identity.d-DR5YwO6E.d.ts} +1 -1
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.d.cts +13 -13
  68. package/dist/index.d.ts +13 -13
  69. package/dist/index.js +1 -1
  70. package/dist/{introEvents.d-BjqfFgE1.d.ts → introEvents.d-D_yL7lnE.d.ts} +1 -1
  71. package/dist/{introEvents.d-7wNDMhEF.d.cts → introEvents.d-JmPqEqMQ.d.cts} +1 -1
  72. package/dist/{models.d-BSqvbTE1.d.cts → models.d-BN53M9sU.d.cts} +52 -1
  73. package/dist/{models.d-DOwnr8fi.d.ts → models.d-Bhq9p6Wa.d.ts} +52 -1
  74. package/dist/notifications/inbox/index.d.cts +4 -4
  75. package/dist/notifications/inbox/index.d.ts +4 -4
  76. package/dist/notifications/index.d.cts +7 -7
  77. package/dist/notifications/index.d.ts +7 -7
  78. package/dist/{optInView.d-BQhHPleh.d.cts → optInView.d-BizcW_QG.d.cts} +2 -2
  79. package/dist/{optInView.d-B5v4cDDW.d.ts → optInView.d-CZvKlq-o.d.ts} +2 -2
  80. package/dist/{pets.d-DRqMaP8A.d.cts → pets.d-C4CWxQPh.d.cts} +1 -1
  81. package/dist/{pets.d-DVrOb-Bj.d.ts → pets.d-uCzgFbGi.d.ts} +1 -1
  82. package/dist/{petsRepository.d-tZADfKA1.d.cts → petsRepository.d-DOcVv9bd.d.cts} +1 -1
  83. package/dist/{petsRepository.d-CpYWRWFq.d.ts → petsRepository.d-DRW7NkKm.d.ts} +1 -1
  84. package/dist/records/depth/index.cjs +1 -1
  85. package/dist/records/depth/index.d.cts +11 -11
  86. package/dist/records/depth/index.d.ts +11 -11
  87. package/dist/records/depth/index.js +1 -1
  88. package/dist/records/index.cjs +16 -14
  89. package/dist/records/index.d.cts +47 -17
  90. package/dist/records/index.d.ts +47 -17
  91. package/dist/records/index.js +16 -14
  92. package/dist/{requestFunnel.d-B8OVGh0p.d.ts → requestFunnel.d-BYLycQMI.d.ts} +2 -2
  93. package/dist/{requestFunnel.d-C4abgvt9.d.cts → requestFunnel.d-CQ0O8fMG.d.cts} +2 -2
  94. package/dist/{route.d-BAZqGLfl.d.ts → route.d-DFJ0gXj8.d.ts} +2 -2
  95. package/dist/{route.d-CTf8h9vS.d.cts → route.d-q9yndhFy.d.cts} +2 -2
  96. package/dist/{runtimeTypes.d-DbaQKGLv.d.cts → runtimeTypes.d-3LRuzxr7.d.cts} +4 -4
  97. package/dist/{runtimeTypes.d-DrIz5e6L.d.ts → runtimeTypes.d-BJHYj2MI.d.ts} +4 -4
  98. package/dist/{screenProps.d-Di3wYGCn.d.cts → screenProps.d-DfAmuKkr.d.cts} +2 -2
  99. package/dist/{screenProps.d-BP8LAZWn.d.ts → screenProps.d-tVzlXGaN.d.ts} +2 -2
  100. package/dist/server/events/index.cjs +1 -1
  101. package/dist/server/events/index.d.cts +2 -2
  102. package/dist/server/events/index.d.ts +2 -2
  103. package/dist/server/events/index.js +1 -1
  104. package/dist/server/index.cjs +1 -1
  105. package/dist/server/index.d.cts +3 -3
  106. package/dist/server/index.d.ts +3 -3
  107. package/dist/server/index.js +1 -1
  108. package/dist/{sheetSeam.d-BBuEIVsa.d.cts → sheetSeam.d-B9iQqG_I.d.cts} +2 -2
  109. package/dist/{sheetSeam.d-B09jf4YC.d.ts → sheetSeam.d-CtuKILqp.d.ts} +2 -2
  110. package/dist/shop/index.cjs +187 -145
  111. package/dist/shop/index.d.cts +3 -3
  112. package/dist/shop/index.d.ts +3 -3
  113. package/dist/shop/index.js +188 -146
  114. package/dist/tabs/index.cjs +1 -1
  115. package/dist/tabs/index.d.cts +8 -8
  116. package/dist/tabs/index.d.ts +8 -8
  117. package/dist/tabs/index.js +1 -1
  118. package/dist/televet/booking/index.d.cts +6 -6
  119. package/dist/televet/booking/index.d.ts +6 -6
  120. package/dist/testing/index.cjs +1 -1
  121. package/dist/testing/index.d.cts +1 -1
  122. package/dist/testing/index.d.ts +1 -1
  123. package/dist/testing/index.js +1 -1
  124. package/dist/testing/rn/index.d.cts +8 -8
  125. package/dist/testing/rn/index.d.ts +8 -8
  126. package/dist/testing/web/index.d.cts +9 -9
  127. package/dist/testing/web/index.d.ts +9 -9
  128. package/dist/texting/index.d.cts +5 -5
  129. package/dist/texting/index.d.ts +5 -5
  130. package/dist/{threadOptions.d-Cwmyu8pc.d.ts → threadOptions.d-DfH26dy7.d.ts} +2 -2
  131. package/dist/{threadOptions.d-REwBuXAY.d.cts → threadOptions.d-I6G3BdlP.d.cts} +2 -2
  132. package/dist/{timelineRows.d-CTlGQTB0.d.ts → timelineRows.d-CugnCOfZ.d.ts} +1 -1
  133. package/dist/{timelineRows.d-CongJG58.d.cts → timelineRows.d-uSfr2IP3.d.cts} +1 -1
  134. package/dist/{types.d-d3RdaeAA.d.cts → types.d-BOKzNuuF.d.cts} +87 -85
  135. package/dist/{types.d-d3RdaeAA.d.ts → types.d-BOKzNuuF.d.ts} +87 -85
  136. package/dist/ui/index.cjs +98 -46
  137. package/dist/ui/index.d.cts +4 -3
  138. package/dist/ui/index.d.ts +4 -3
  139. package/dist/ui/index.js +98 -46
  140. package/dist/{useHealthPlanSubscription.d-BSo5kFT9.d.ts → useHealthPlanSubscription.d-CVVQIFpG.d.ts} +2 -2
  141. package/dist/{useHealthPlanSubscription.d-Br7GKHTt.d.cts → useHealthPlanSubscription.d-DylPMm_m.d.cts} +2 -2
  142. package/dist/{useInboxUnread.d-Blxu00eY.d.ts → useInboxUnread.d-DDoSII8D.d.ts} +1 -1
  143. package/dist/{useInboxUnread.d-pi6FNnK-.d.cts → useInboxUnread.d-Dq3CCAa3.d.cts} +1 -1
  144. package/dist/{usePresentation.d-yd9Gh4GB.d.ts → usePresentation.d-CDNK4MDY.d.ts} +2 -2
  145. package/dist/{usePresentation.d-C6ci1s3j.d.cts → usePresentation.d-CrobH0d_.d.cts} +2 -2
  146. package/dist/{useRecords.d-BYNX01El.d.cts → useRecords.d-BMSW4aRD.d.cts} +46 -3
  147. package/dist/{useRecords.d-DWk61a4c.d.ts → useRecords.d-Cv1nhZrv.d.ts} +46 -3
  148. package/dist/{useRecordsDepth.d-C5snbNxR.d.ts → useRecordsDepth.d-BvBYIPii.d.ts} +1 -1
  149. package/dist/{useRecordsDepth.d-BIDVPfx7.d.cts → useRecordsDepth.d-Cd5Vyb7D.d.cts} +1 -1
  150. package/dist/{useUnread.d-CORommFJ.d.cts → useUnread.d-B4Yqcteg.d.cts} +3 -3
  151. package/dist/{useUnread.d-w0dKMnx7.d.ts → useUnread.d-ElAEfgl1.d.ts} +3 -3
  152. package/dist/{view.d-CK2UN4qn.d.ts → view.d-2RWoY9kd.d.ts} +5 -5
  153. package/dist/{view.d-DUhKppyl.d.cts → view.d-utmOR2ee.d.cts} +5 -5
  154. package/dist/web/consent/index.cjs +1 -1
  155. package/dist/web/consent/index.d.cts +5 -5
  156. package/dist/web/consent/index.d.ts +5 -5
  157. package/dist/web/consent/index.js +1 -1
  158. package/dist/web/health-plan/index.cjs +43 -16
  159. package/dist/web/health-plan/index.d.cts +12 -12
  160. package/dist/web/health-plan/index.d.ts +12 -12
  161. package/dist/web/health-plan/index.js +32 -27
  162. package/dist/web/health-plan/styles.css +160 -1
  163. package/dist/web/inbox/index.cjs +1 -1
  164. package/dist/web/inbox/index.d.cts +5 -5
  165. package/dist/web/inbox/index.d.ts +5 -5
  166. package/dist/web/inbox/index.js +1 -1
  167. package/dist/web/index.cjs +1 -1
  168. package/dist/web/index.d.cts +27 -27
  169. package/dist/web/index.d.ts +27 -27
  170. package/dist/web/index.js +1 -1
  171. package/dist/web/intro/index.cjs +1 -1
  172. package/dist/web/intro/index.d.cts +8 -8
  173. package/dist/web/intro/index.d.ts +8 -8
  174. package/dist/web/intro/index.js +1 -1
  175. package/dist/web/notifications/index.d.cts +6 -6
  176. package/dist/web/notifications/index.d.ts +6 -6
  177. package/dist/web/records/depth/index.cjs +1 -1
  178. package/dist/web/records/depth/index.d.cts +11 -11
  179. package/dist/web/records/depth/index.d.ts +11 -11
  180. package/dist/web/records/depth/index.js +1 -1
  181. package/dist/web/records/index.cjs +15 -13
  182. package/dist/web/records/index.d.cts +43 -19
  183. package/dist/web/records/index.d.ts +43 -19
  184. package/dist/web/records/index.js +15 -13
  185. package/dist/web/records-sheet/index.cjs +1 -1
  186. package/dist/web/records-sheet/index.d.cts +4 -4
  187. package/dist/web/records-sheet/index.d.ts +4 -4
  188. package/dist/web/records-sheet/index.js +1 -1
  189. package/dist/web/shop/index.cjs +110 -88
  190. package/dist/web/shop/index.d.cts +3 -3
  191. package/dist/web/shop/index.d.ts +3 -3
  192. package/dist/web/shop/index.js +67 -81
  193. package/dist/web/televet/booking/index.d.cts +6 -6
  194. package/dist/web/televet/booking/index.d.ts +6 -6
  195. package/dist/web/texting/index.d.cts +5 -5
  196. package/dist/web/texting/index.d.ts +5 -5
  197. package/dist/web/ui/index.cjs +96 -57
  198. package/dist/web/ui/index.d.cts +4 -3
  199. package/dist/web/ui/index.d.ts +4 -3
  200. package/dist/web/ui/index.js +41 -46
  201. package/dist/web/ui/styles.css +481 -1
  202. package/package.json +5 -5
  203. package/dist/chunk-Y3Q4GW47.js +0 -31
@@ -1,7 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  "use strict";var zod=require("zod");var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",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",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}function contractDocUrl(entry){return entry.envelope==="sse_frame"?`/errors#sse-${entry.wireCode}`:entry.envelope==="oauth_error"?`/errors#oauth-${entry.wireCode}`:`/errors#${entry.wireCode}`}var DOC_SITE_ORIGIN=null;function publishedDocUrl(entry){return null}var EVERFUR_ERROR_CODES=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),EVERFUR_ERROR_CATEGORIES=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function shouldRetry(code,frameRetryable=false){return frameRetryable||isAutoRetryable(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}function canRecreateOnNotFound(code){return code==="conversationNotFound"}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function isLinkedAccountReadOnly(error){return error!=null&&error.code==="conflict"&&error.reasonCode===LINKED_ACCOUNT_READ_ONLY}function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
3
3
  return Object.freeze(warning===void 0?{ok:true,value:value}:{ok:true,value:value,warning:warning})}function err(error){/* @__PURE__ */
4
- return Object.freeze({ok:false,error:error})}function isOk(r){return r.ok}function isErr(r){return!r.ok}var EverfurThrownError=class _EverfurThrownError extends Error{constructor(error){super(`${error.code}: ${error.displayMessage}`),this.name="EverfurThrownError",this.error=error,this.code=error.code,this.category=error.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(r){if(r.ok)return r.value;throw new EverfurThrownError(r.error)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.19.0",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
4
+ return Object.freeze({ok:false,error:error})}function isOk(r){return r.ok}function isErr(r){return!r.ok}var EverfurThrownError=class _EverfurThrownError extends Error{constructor(error){super(`${error.code}: ${error.displayMessage}`),this.name="EverfurThrownError",this.error=error,this.code=error.code,this.category=error.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(r){if(r.ok)return r.value;throw new EverfurThrownError(r.error)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.21.0",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
5
5
  return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:reason,message:message})})}function checkPublishableKey(raw){let publishableKey=typeof raw=="string"?raw.trim():"";return publishableKey.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(publishableKey)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(config,options){let keyFailure=checkPublishableKey(config?.publishableKey);if(keyFailure!==null)/* @__PURE__ */
6
6
  return Object.freeze({ok:false,failure:keyFailure});let publishableKey=config.publishableKey.trim(),baseUrl=tryResolveApiBaseUrl(config.apiBaseUrl);if(!baseUrl.ok)return baseUrl;let contractVersion=config.contractVersion?.trim()||DEFAULT_CONTRACT_VERSION;/* @__PURE__ */
7
7
  return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:publishableKey,apiBaseUrl:baseUrl.value,contractVersion:contractVersion,sdkVersion:SDK_VERSION,platform:options?.platform??SDK_PLATFORM,debug:config.debug===true})})}function resolveClientConfig(config,options){let outcome=tryResolveClientConfig(config,options);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.config}function tryResolveApiBaseUrl(apiBaseUrl){let explicit=apiBaseUrl?.trim(),candidate=explicit&&explicit.length>0?explicit:readEnv(ENV_API_BASE_URL);return candidate?normalizeBaseUrl(candidate):configFailure("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${ENV_API_BASE_URL}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(apiBaseUrl){let outcome=tryResolveApiBaseUrl(apiBaseUrl);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.value}function buildBaseHeaders(cfg){return{"X-Everfur-SDK-Version":cfg.sdkVersion,"X-Everfur-SDK-Platform":cfg.platform,"X-Everfur-Contract":cfg.contractVersion}}function hostOf(authority){return authority.slice(authority.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function isPrintableHost(host){return host.length===0||host.includes("@")?false:host.startsWith("[")&&host.endsWith("]")?true:!host.includes(":")}function canEchoOrigin(rawTrimmed,host){let schemeEnd=rawTrimmed.indexOf("://");return schemeEnd<0||rawTrimmed.slice(schemeEnd+3).includes("@")?false:isPrintableHost(host)}function safeOrigin(scheme,host){return`${scheme}://${host}`}function normalizeBaseUrl(raw){let trimmed=raw.trim(),match=ABSOLUTE_URL.exec(trimmed);if(match===null||match[2]===void 0||match[2].length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let scheme=(match[1]??"").toLowerCase(),host=hostOf(match[2]);if(host.length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let shown=canEchoOrigin(trimmed,host)?`: ${safeOrigin(scheme,host)}`:"";if(scheme!=="https"){if(!(scheme==="http"&&isLoopbackHost(host)))return scheme==="http"?configFailure("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${shown}`):configFailure("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${shown}`)}let value=trimmed.endsWith("/")?trimmed.slice(0,-1):trimmed;/* @__PURE__ */
@@ -2,19 +2,19 @@
2
2
  import { b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.cjs';
3
3
  export { A as AUTO_RETRYABLE_CODES, B as BACKOFF_BASE_MS, d as BACKOFF_CAP_MS, e as EVERFUR_ERROR_CATEGORIES, f as EVERFUR_ERROR_CODES, E as EverfurError, a as EverfurErrorCategory, L as LINKED_ACCOUNT_READ_ONLY, M as MAX_RETRY_ATTEMPTS, g as MakeEverfurErrorOptions, R as RETRYABLE_CONTRACT_CODES, h as backoffDelayMs, j as canRecreateOnNotFound, c as categoryFor, k as fromHttpStatus, l as fromWire, m as isAutoRetryable, n as isLinkedAccountReadOnly, i as isRetryableCode, o as makeEverfurError, s as shouldRetry, u as userFacingError } from '../EverfurError.d-8NHtlgzA.cjs';
4
4
  export { a as EverfurConfigError, E as EverfurResult, b as EverfurThrownError, e as err, i as isErr, c as isOk, o as ok, u as unwrap } from '../EverfurResult.d-BFH-3s6E.cjs';
5
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config.d-jCmrhM4a.cjs';
5
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config.d-cX5E6DAw.cjs';
6
6
  export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids.d-B2GAAifq.cjs';
7
- export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity.d-CA7mW59I.cjs';
7
+ export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity.d-Bnl5Z0MM.cjs';
8
8
  export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve.d-BTC3b6FW.cjs';
9
- export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-CiU_QIPL.cjs';
9
+ export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-BvnWpcQH.cjs';
10
10
  import { m as EverfurTheme } from '../tokens.d-BUVqme2D.cjs';
11
11
  export { D as DEFAULT_MAX_FONT_SCALE, y as EASING_CURVES, z as EVERFUR_DARK, A as EVERFUR_LIGHT, E as EverfurColorTokens, B as EverfurEasingCurve, a as EverfurFontFaceKey, b as EverfurFontFamilies, c as EverfurFontSource, d as EverfurFontWeight, e as EverfurLetterSpacingTokens, f as EverfurLineHeightTokens, g as EverfurMotionDurationTokens, h as EverfurMotionTokens, i as EverfurRadiusTokens, j as EverfurSpaceTokens, k as EverfurSpringToken, l as EverfurTextColorTokens, C as EverfurTextScaleTier, n as EverfurThemeMeta, o as EverfurThemeSlot, p as EverfurThemeSlotKey, q as EverfurThemeSlotName, r as EverfurThemeSlots, s as EverfurTypeSizeTokens, t as EverfurTypeTokens, u as EverfurWeightTokens, S as SLOT_MIN_BORDER_CONTRAST, F as SLOT_MIN_CONTRAST, G as SYSTEM_FONT_FAMILY, H as SYSTEM_MONO_FAMILY, I as SlotGrounds, J as SlotSurrounds, K as TEXT_SCALE_TIER_CAPS, T as THEME_SLOT_KEYS, v as THEME_SLOT_KEYS_BY_SLOT, w as THEME_SLOT_NAMES, L as cssCubicBezier, M as deepFreeze, N as guardSlotContrast, O as mergeThemeSlots, P as parseThemeSlots, x as themeSlotKeysFor } from '../tokens.d-BUVqme2D.cjs';
12
12
  export { E as EverfurFaceStyle, a as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as themeAdjustments, w as withServerBranding } from '../typeStyle.d-Ckdh_S-t.cjs';
13
13
  export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, C as ClientBranding, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, h as EverfurThemeFontFaceKey, i as EverfurThemeFontUrlsInput, j as EverfurThemeFontsInput, E as EverfurThemeInput, k as EverfurThemeSlotInput, l as EverfurThemeSlotsInput, L as LOCKABLE_THEME_FIELDS, n as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, o as SLOT_LOCK_PREFIX, p as SlotLockName, S as SurfaceStyle, T as THEME_SCHEMA_VERSIONS, q as ThemeLockName, m as expandAppearance, r as hardenBrandAssetUrl, s as hardenHttpsUrl, t as isEmptyBranding, u as isKnownBrandingSchema, v as lockedFieldsOf, w as parseClientBranding, x as parsePx } from '../branding.d-BFauULV6.cjs';
14
14
  export { D as DEFAULT_PRESENTATION, E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, l as EverfurPresentationField, i as EverfurPresentationInput, j as EverfurSafetyDisclaimerPlacement, P as PRESENTATION_LOCK, k as PRESENTATION_LOCK_PREFIX, m as PRESENTATION_WIRE_NAMES, n as isPresentationFieldLocked, o as isPresentationLockName, p as parsePresentation, r as resolvePresentation } from '../presentation.d-Bs8xQ4gD.cjs';
15
- export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel.d-C4abgvt9.cjs';
16
- export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository.d-tZADfKA1.cjs';
17
- export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository.d-sSo6oakf.cjs';
15
+ export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel.d-CQ0O8fMG.cjs';
16
+ export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository.d-DOcVv9bd.cjs';
17
+ export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository.d-G2dahIKO.cjs';
18
18
  import '../ErrorPolicyPort.d-DirW9hgO.cjs';
19
19
  import '../profile.d-CSs1wlXT.cjs';
20
20
 
@@ -2,19 +2,19 @@
2
2
  import { b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.js';
3
3
  export { A as AUTO_RETRYABLE_CODES, B as BACKOFF_BASE_MS, d as BACKOFF_CAP_MS, e as EVERFUR_ERROR_CATEGORIES, f as EVERFUR_ERROR_CODES, E as EverfurError, a as EverfurErrorCategory, L as LINKED_ACCOUNT_READ_ONLY, M as MAX_RETRY_ATTEMPTS, g as MakeEverfurErrorOptions, R as RETRYABLE_CONTRACT_CODES, h as backoffDelayMs, j as canRecreateOnNotFound, c as categoryFor, k as fromHttpStatus, l as fromWire, m as isAutoRetryable, n as isLinkedAccountReadOnly, i as isRetryableCode, o as makeEverfurError, s as shouldRetry, u as userFacingError } from '../EverfurError.d-8NHtlgzA.js';
4
4
  export { a as EverfurConfigError, E as EverfurResult, b as EverfurThrownError, e as err, i as isErr, c as isOk, o as ok, u as unwrap } from '../EverfurResult.d-D_-254ZY.js';
5
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config.d-N5Xzy53V.js';
5
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config.d-D9igq-vT.js';
6
6
  export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids.d-B2GAAifq.js';
7
- export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity.d-DIOnFzXL.js';
7
+ export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity.d-DR5YwO6E.js';
8
8
  export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve.d-BTC3b6FW.js';
9
- export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-qZAlET7C.js';
9
+ export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-DpQrIgW6.js';
10
10
  import { m as EverfurTheme } from '../tokens.d-BUVqme2D.js';
11
11
  export { D as DEFAULT_MAX_FONT_SCALE, y as EASING_CURVES, z as EVERFUR_DARK, A as EVERFUR_LIGHT, E as EverfurColorTokens, B as EverfurEasingCurve, a as EverfurFontFaceKey, b as EverfurFontFamilies, c as EverfurFontSource, d as EverfurFontWeight, e as EverfurLetterSpacingTokens, f as EverfurLineHeightTokens, g as EverfurMotionDurationTokens, h as EverfurMotionTokens, i as EverfurRadiusTokens, j as EverfurSpaceTokens, k as EverfurSpringToken, l as EverfurTextColorTokens, C as EverfurTextScaleTier, n as EverfurThemeMeta, o as EverfurThemeSlot, p as EverfurThemeSlotKey, q as EverfurThemeSlotName, r as EverfurThemeSlots, s as EverfurTypeSizeTokens, t as EverfurTypeTokens, u as EverfurWeightTokens, S as SLOT_MIN_BORDER_CONTRAST, F as SLOT_MIN_CONTRAST, G as SYSTEM_FONT_FAMILY, H as SYSTEM_MONO_FAMILY, I as SlotGrounds, J as SlotSurrounds, K as TEXT_SCALE_TIER_CAPS, T as THEME_SLOT_KEYS, v as THEME_SLOT_KEYS_BY_SLOT, w as THEME_SLOT_NAMES, L as cssCubicBezier, M as deepFreeze, N as guardSlotContrast, O as mergeThemeSlots, P as parseThemeSlots, x as themeSlotKeysFor } from '../tokens.d-BUVqme2D.js';
12
12
  export { E as EverfurFaceStyle, a as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as themeAdjustments, w as withServerBranding } from '../typeStyle.d-B9Jo5mDX.js';
13
13
  export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, C as ClientBranding, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, h as EverfurThemeFontFaceKey, i as EverfurThemeFontUrlsInput, j as EverfurThemeFontsInput, E as EverfurThemeInput, k as EverfurThemeSlotInput, l as EverfurThemeSlotsInput, L as LOCKABLE_THEME_FIELDS, n as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, o as SLOT_LOCK_PREFIX, p as SlotLockName, S as SurfaceStyle, T as THEME_SCHEMA_VERSIONS, q as ThemeLockName, m as expandAppearance, r as hardenBrandAssetUrl, s as hardenHttpsUrl, t as isEmptyBranding, u as isKnownBrandingSchema, v as lockedFieldsOf, w as parseClientBranding, x as parsePx } from '../branding.d-DpNGEdDL.js';
14
14
  export { D as DEFAULT_PRESENTATION, E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, l as EverfurPresentationField, i as EverfurPresentationInput, j as EverfurSafetyDisclaimerPlacement, P as PRESENTATION_LOCK, k as PRESENTATION_LOCK_PREFIX, m as PRESENTATION_WIRE_NAMES, n as isPresentationFieldLocked, o as isPresentationLockName, p as parsePresentation, r as resolvePresentation } from '../presentation.d-Bs8xQ4gD.js';
15
- export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel.d-B8OVGh0p.js';
16
- export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository.d-CpYWRWFq.js';
17
- export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository.d-C7qbrOL-.js';
15
+ export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel.d-BYLycQMI.js';
16
+ export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository.d-DRW7NkKm.js';
17
+ export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository.d-CCJJQXnl.js';
18
18
  import '../ErrorPolicyPort.d-68yrE3BE.js';
19
19
  import '../profile.d-CSs1wlXT.js';
20
20
 
@@ -1,7 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import{z}from"zod";var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",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",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}function contractDocUrl(entry){return entry.envelope==="sse_frame"?`/errors#sse-${entry.wireCode}`:entry.envelope==="oauth_error"?`/errors#oauth-${entry.wireCode}`:`/errors#${entry.wireCode}`}var DOC_SITE_ORIGIN=null;function publishedDocUrl(entry){return null}var EVERFUR_ERROR_CODES=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),EVERFUR_ERROR_CATEGORIES=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function shouldRetry(code,frameRetryable=false){return frameRetryable||isAutoRetryable(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}function canRecreateOnNotFound(code){return code==="conversationNotFound"}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function isLinkedAccountReadOnly(error){return error!=null&&error.code==="conflict"&&error.reasonCode===LINKED_ACCOUNT_READ_ONLY}function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
3
3
  return Object.freeze(warning===void 0?{ok:true,value:value}:{ok:true,value:value,warning:warning})}function err(error){/* @__PURE__ */
4
- return Object.freeze({ok:false,error:error})}function isOk(r){return r.ok}function isErr(r){return!r.ok}var EverfurThrownError=class _EverfurThrownError extends Error{constructor(error){super(`${error.code}: ${error.displayMessage}`),this.name="EverfurThrownError",this.error=error,this.code=error.code,this.category=error.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(r){if(r.ok)return r.value;throw new EverfurThrownError(r.error)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.19.0",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
4
+ return Object.freeze({ok:false,error:error})}function isOk(r){return r.ok}function isErr(r){return!r.ok}var EverfurThrownError=class _EverfurThrownError extends Error{constructor(error){super(`${error.code}: ${error.displayMessage}`),this.name="EverfurThrownError",this.error=error,this.code=error.code,this.category=error.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(r){if(r.ok)return r.value;throw new EverfurThrownError(r.error)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.21.0",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
5
5
  return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:reason,message:message})})}function checkPublishableKey(raw){let publishableKey=typeof raw=="string"?raw.trim():"";return publishableKey.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(publishableKey)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(config,options){let keyFailure=checkPublishableKey(config?.publishableKey);if(keyFailure!==null)/* @__PURE__ */
6
6
  return Object.freeze({ok:false,failure:keyFailure});let publishableKey=config.publishableKey.trim(),baseUrl=tryResolveApiBaseUrl(config.apiBaseUrl);if(!baseUrl.ok)return baseUrl;let contractVersion=config.contractVersion?.trim()||DEFAULT_CONTRACT_VERSION;/* @__PURE__ */
7
7
  return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:publishableKey,apiBaseUrl:baseUrl.value,contractVersion:contractVersion,sdkVersion:SDK_VERSION,platform:options?.platform??SDK_PLATFORM,debug:config.debug===true})})}function resolveClientConfig(config,options){let outcome=tryResolveClientConfig(config,options);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.config}function tryResolveApiBaseUrl(apiBaseUrl){let explicit=apiBaseUrl?.trim(),candidate=explicit&&explicit.length>0?explicit:readEnv(ENV_API_BASE_URL);return candidate?normalizeBaseUrl(candidate):configFailure("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${ENV_API_BASE_URL}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(apiBaseUrl){let outcome=tryResolveApiBaseUrl(apiBaseUrl);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.value}function buildBaseHeaders(cfg){return{"X-Everfur-SDK-Version":cfg.sdkVersion,"X-Everfur-SDK-Platform":cfg.platform,"X-Everfur-Contract":cfg.contractVersion}}function hostOf(authority){return authority.slice(authority.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function isPrintableHost(host){return host.length===0||host.includes("@")?false:host.startsWith("[")&&host.endsWith("]")?true:!host.includes(":")}function canEchoOrigin(rawTrimmed,host){let schemeEnd=rawTrimmed.indexOf("://");return schemeEnd<0||rawTrimmed.slice(schemeEnd+3).includes("@")?false:isPrintableHost(host)}function safeOrigin(scheme,host){return`${scheme}://${host}`}function normalizeBaseUrl(raw){let trimmed=raw.trim(),match=ABSOLUTE_URL.exec(trimmed);if(match===null||match[2]===void 0||match[2].length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let scheme=(match[1]??"").toLowerCase(),host=hostOf(match[2]);if(host.length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let shown=canEchoOrigin(trimmed,host)?`: ${safeOrigin(scheme,host)}`:"";if(scheme!=="https"){if(!(scheme==="http"&&isLoopbackHost(host)))return scheme==="http"?configFailure("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${shown}`):configFailure("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${shown}`)}let value=trimmed.endsWith("/")?trimmed.slice(0,-1):trimmed;/* @__PURE__ */
@@ -2,10 +2,10 @@
2
2
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
4
4
  import { a as RecordsClinicTarget, b as RecordsAuthorizationSignature } from './clinicModels.d-BXgKZqDb.cjs';
5
- import { R as RequestFunnel } from './requestFunnel.d-C4abgvt9.cjs';
6
- import { A as AuthContext } from './identity.d-CA7mW59I.cjs';
5
+ import { R as RequestFunnel } from './requestFunnel.d-CQ0O8fMG.cjs';
6
+ import { A as AuthContext } from './identity.d-Bnl5Z0MM.cjs';
7
7
  import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-DirW9hgO.cjs';
8
- import { d as RecordsRequestView } from './models.d-BSqvbTE1.cjs';
8
+ import { e as RecordsRequestView } from './models.d-BN53M9sU.cjs';
9
9
 
10
10
  interface HttpRecordsClinicRepositoryDeps {
11
11
  readonly auth: AuthContext;
@@ -2,10 +2,10 @@
2
2
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.js';
4
4
  import { a as RecordsClinicTarget, b as RecordsAuthorizationSignature } from './clinicModels.d-CaS64-P-.js';
5
- import { R as RequestFunnel } from './requestFunnel.d-B8OVGh0p.js';
6
- import { A as AuthContext } from './identity.d-DIOnFzXL.js';
5
+ import { R as RequestFunnel } from './requestFunnel.d-BYLycQMI.js';
6
+ import { A as AuthContext } from './identity.d-DR5YwO6E.js';
7
7
  import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-68yrE3BE.js';
8
- import { d as RecordsRequestView } from './models.d-DOwnr8fi.js';
8
+ import { e as RecordsRequestView } from './models.d-Bhq9p6Wa.js';
9
9
 
10
10
  interface HttpRecordsClinicRepositoryDeps {
11
11
  readonly auth: AuthContext;
@@ -2,7 +2,7 @@
2
2
  import { R as RecordsRequestId, P as PetRef } from './ids.d-B2GAAifq.js';
3
3
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
4
4
  import { c as RecordsClinicSearchInput, d as RecordsClinicSearchPage, e as RecordsRecentClinicsInput, f as RecordsAuthorizationCopy, C as CreateClinicRequestInput, g as RecordsSignatureUploadPolicy } from './clinicModels.d-CaS64-P-.js';
5
- import { e as RecordsRequestGroupView, d as RecordsRequestView } from './models.d-DOwnr8fi.js';
5
+ import { f as RecordsRequestGroupView, e as RecordsRequestView } from './models.d-Bhq9p6Wa.js';
6
6
 
7
7
  interface RecordsClinicController {
8
8
  searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
@@ -2,7 +2,7 @@
2
2
  import { R as RecordsRequestId, P as PetRef } from './ids.d-B2GAAifq.cjs';
3
3
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
4
4
  import { c as RecordsClinicSearchInput, d as RecordsClinicSearchPage, e as RecordsRecentClinicsInput, f as RecordsAuthorizationCopy, C as CreateClinicRequestInput, g as RecordsSignatureUploadPolicy } from './clinicModels.d-BXgKZqDb.cjs';
5
- import { e as RecordsRequestGroupView, d as RecordsRequestView } from './models.d-BSqvbTE1.cjs';
5
+ import { f as RecordsRequestGroupView, e as RecordsRequestView } from './models.d-BN53M9sU.cjs';
6
6
 
7
7
  interface RecordsClinicController {
8
8
  searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
@@ -410,7 +410,7 @@ declare function getGlobalFetch(): FetchLike;
410
410
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
411
411
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
412
412
  */
413
- declare const SDK_VERSION = "0.19.0";
413
+ declare const SDK_VERSION = "0.21.0";
414
414
  /**
415
415
  * The platforms this package ships an entry point for, as the wire names them (X-Everfur-SDK-Platform).
416
416
  *
@@ -410,7 +410,7 @@ declare function getGlobalFetch(): FetchLike;
410
410
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
411
411
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
412
412
  */
413
- declare const SDK_VERSION = "0.19.0";
413
+ declare const SDK_VERSION = "0.21.0";
414
414
  /**
415
415
  * The platforms this package ships an entry point for, as the wire names them (X-Everfur-SDK-Platform).
416
416
  *
@@ -4,7 +4,7 @@ return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
4
4
  return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
5
5
  return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled2;try{settled2=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled2=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled2.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled2;let error=settled2.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
6
6
  /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
7
- return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var CONSENT_PATH="/widget/v1/consent",EVERFUR_CONSENT_SCOPES=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),RECORDS_CONTENT_SCOPE="records_content",CONSENT_VERSION_MAX=64,SCOPES=new Set(EVERFUR_CONSENT_SCOPES);function isEverfurConsentScope(value){return typeof value=="string"&&SCOPES.has(value)}function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function validateScope(scope){return isEverfurConsentScope(scope)?null:invalid(scope===RECORDS_CONTENT_SCOPE?`'${RECORDS_CONTENT_SCOPE}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/pets/{pet_ref}/consent, which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${EVERFUR_CONSENT_SCOPES.join(", ")}`)}function validateDecision(decision){if(typeof decision!="object"||decision===null)return invalid("write needs a decision object");let{scope:scope,granted:granted,consentVersion:consentVersion}=decision,badScope=validateScope(scope);return badScope!==null?badScope:typeof granted!="boolean"?invalid("granted must be true to grant or false to withdraw"):consentVersion!==void 0&&(typeof consentVersion!="string"||consentVersion.length===0||consentVersion.length>CONSENT_VERSION_MAX)?invalid(`consentVersion must be 1..${CONSENT_VERSION_MAX} characters`):null}var str=value=>typeof value=="string"&&value.length>0?value:null;function verdictFromWire(raw,scope){if(typeof raw!="object"||raw===null)return null;let o=raw;return typeof o.granted!="boolean"||typeof o.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:scope,granted:o.granted,hasDecision:o.has_decision,consentVersion:str(o.consent_version),actor:str(o.actor),recordedAt:str(o.recorded_at)})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no granted/has_decision pair`})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createConsentRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createConsentRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(scope,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(scope,opts),write:(decision,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("write"))):over().write(decision,opts)}}function createConsentRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async read(scope,opts){let bad=validateScope(scope);if(bad!==null)return err(bad);let res=await funnel.send("consent.read",withSignal({method:"GET",path:CONSENT_PATH,query:{scope:scope}},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,scope);return verdict===null?err(malformed("consent.read")):ok(verdict)},async write(decision,opts){let bad=validateDecision(decision);if(bad!==null)return err(bad);let body={scope:decision.scope,granted:decision.granted};decision.consentVersion!==void 0&&(body.consent_version=decision.consentVersion);let res=await funnel.send("consent.write",withSignal({method:"PUT",path:CONSENT_PATH,body:body},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,decision.scope);return verdict===null?err(malformed("consent.write")):ok(verdict)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function blank(scope,error){/* @__PURE__ */
7
+ return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var CONSENT_PATH="/widget/v1/consent",EVERFUR_CONSENT_SCOPES=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),RECORDS_CONTENT_SCOPE="records_content",CONSENT_VERSION_MAX=64,SCOPES=new Set(EVERFUR_CONSENT_SCOPES);function isEverfurConsentScope(value){return typeof value=="string"&&SCOPES.has(value)}function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function validateScope(scope){return isEverfurConsentScope(scope)?null:invalid(scope===RECORDS_CONTENT_SCOPE?`'${RECORDS_CONTENT_SCOPE}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/consent (all pets) or /widget/v1/records/pets/{pet_ref}/consent (one pet), which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${EVERFUR_CONSENT_SCOPES.join(", ")}`)}function validateDecision(decision){if(typeof decision!="object"||decision===null)return invalid("write needs a decision object");let{scope:scope,granted:granted,consentVersion:consentVersion}=decision,badScope=validateScope(scope);return badScope!==null?badScope:typeof granted!="boolean"?invalid("granted must be true to grant or false to withdraw"):consentVersion!==void 0&&(typeof consentVersion!="string"||consentVersion.length===0||consentVersion.length>CONSENT_VERSION_MAX)?invalid(`consentVersion must be 1..${CONSENT_VERSION_MAX} characters`):null}var str=value=>typeof value=="string"&&value.length>0?value:null;function verdictFromWire(raw,scope){if(typeof raw!="object"||raw===null)return null;let o=raw;return typeof o.granted!="boolean"||typeof o.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:scope,granted:o.granted,hasDecision:o.has_decision,consentVersion:str(o.consent_version),actor:str(o.actor),recordedAt:str(o.recorded_at)})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no granted/has_decision pair`})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createConsentRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createConsentRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(scope,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(scope,opts),write:(decision,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("write"))):over().write(decision,opts)}}function createConsentRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async read(scope,opts){let bad=validateScope(scope);if(bad!==null)return err(bad);let res=await funnel.send("consent.read",withSignal({method:"GET",path:CONSENT_PATH,query:{scope:scope}},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,scope);return verdict===null?err(malformed("consent.read")):ok(verdict)},async write(decision,opts){let bad=validateDecision(decision);if(bad!==null)return err(bad);let body={scope:decision.scope,granted:decision.granted};decision.consentVersion!==void 0&&(body.consent_version=decision.consentVersion);let res=await funnel.send("consent.write",withSignal({method:"PUT",path:CONSENT_PATH,body:body},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,decision.scope);return verdict===null?err(malformed("consent.write")):ok(verdict)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function blank(scope,error){/* @__PURE__ */
8
8
  return Object.freeze({scope:scope,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:error})}function settled(verdict){/* @__PURE__ */
9
9
  return Object.freeze({scope:verdict.scope,granted:verdict.granted,hasDecision:verdict.hasDecision,consentVersion:verdict.consentVersion,recordedAt:verdict.recordedAt,loaded:true,saving:false,error:null})}function noMember(){return makeEverfurError("sessionRequired",{retryable:false,wireMessage:"a consent decision is authored by the member; sign a user in on the provider first"})}function useEverfurConsentRepository(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createConsentRepository(runtime),[runtime])}function useEverfurConsent(options){let{userRef:userRef}=useEverfurContext(),repository=useEverfurConsentRepository(),requestedKey=(options?.scopes??[]).filter(isEverfurConsentScope).join(","),requested=react.useMemo(()=>{let named=requestedKey.length===0?[]:requestedKey.split(",");return named.length===0?EVERFUR_CONSENT_SCOPES:/* @__PURE__ */Object.freeze(named)},[requestedKey]),[status,setStatus]=react.useState(userRef===null?"signed_out":"loading"),[scopes,setScopes]=react.useState([]),[error,setError]=react.useState(null),generation=react.useRef(0),readAll=react.useCallback(async()=>{if(userRef===null){generation.current+=1,setStatus("signed_out"),setScopes([]),setError(null);return}let gen=generation.current+=1;setStatus("loading"),setError(null);let results=await Promise.all(requested.map(scope=>repository.read(scope)));if(gen!==generation.current)return;let next=results.map((result,index)=>{let scope=requested[index];return result.ok?settled(result.value):blank(scope,result.error)}),firstFailure=results.find(result=>!result.ok),everyFailed=results.every(result=>!result.ok);setScopes(/* @__PURE__ */Object.freeze(next)),setStatus(everyFailed?"failed":"ready"),setError(everyFailed&&firstFailure!==void 0&&!firstFailure.ok?firstFailure.error:null)},[repository,requested,userRef]);react.useEffect(()=>{readAll()},[readAll]);let setConsent=react.useCallback(async(scope,granted)=>{if(userRef===null)return err(noMember());let gen=generation.current,previous=null;setScopes(current=>{let index=current.findIndex(entry=>entry.scope===scope),before=index===-1?blank(scope,null):current[index];previous=before;let optimistic=/* @__PURE__ */Object.freeze({...before,granted:granted,hasDecision:true,saving:true,error:null});if(index===-1)/* @__PURE__ */return Object.freeze([...current,optimistic]);let next=[...current];return next[index]=optimistic,/* @__PURE__ */Object.freeze(next)});let result=await repository.write({scope:scope,granted:granted});return gen!==generation.current||setScopes(current=>{let index=current.findIndex(entry=>entry.scope===scope);if(index===-1)return current;let next=[...current];return next[index]=result.ok?settled(result.value):/* @__PURE__ */Object.freeze({...previous??blank(scope,null),saving:false,error:result.error}),/* @__PURE__ */Object.freeze(next)}),result},[repository,userRef]);return react.useMemo(()=>({status:status,scopes:scopes,error:error,setConsent:setConsent,refresh:readAll}),[status,scopes,error,setConsent,readAll])}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var HostRenderBoundary=class extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(props,state){return Object.is(props.resetKey,state.key)?null:{failed:false,key:props.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:render}){return render()}function HostRender({render:render,fallback:fallback,resetKey:resetKey}){return react.createElement(HostRenderBoundary,{fallback:fallback,resetKey:resetKey,children:react.createElement(RenderHost,{render:render})})}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return react.createElement(reactNative.Text,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}react.forwardRef(function(props,ref){return react.createElement(reactNative.TextInput,{...props,...ref===null?{}:{ref:ref}})});function EverfurConsentToggle(props){let{scope:scope,onChange:onChange,renderNotice:renderNotice,style:style}=guardHostProps(props,["onChange"]),theme=useEverfurTheme(),styles=react.useMemo(()=>makeStyles(theme),[theme]),consent=useEverfurConsent({scopes:[scope]}),view=consentRowView(consent,scope),copy=CONSENT_SCOPE_COPY[scope],[attempt,setAttempt]=react.useState(null),decide=react.useCallback(async granted=>{setAttempt(granted);let result=await consent.setConsent(scope,granted);result.ok&&(setAttempt(null),onChange?.(result.value.granted))},[consent,onChange,scope]),notice=(error,onRetry)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.notice,children:[
10
10
  /* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:error,render:()=>renderNotice?renderNotice(error):/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.noticeText,children:error.displayMessage}),fallback:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.noticeText,children:error.displayMessage})}),
@@ -1,16 +1,16 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { ReactNode } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
- import { E as EverfurConsentScope } from '../copy.d-hS49oJ4w.cjs';
5
- export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d-hS49oJ4w.cjs';
4
+ import { E as EverfurConsentScope } from '../copy.d-DWjSkbrZ.cjs';
5
+ export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d-DWjSkbrZ.cjs';
6
6
  import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.cjs';
7
7
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.cjs';
8
- export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-CA7mW59I.cjs';
9
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-jCmrhM4a.cjs';
8
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-Bnl5Z0MM.cjs';
9
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-cX5E6DAw.cjs';
10
10
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.cjs';
11
11
  export { E as EverfurResult } from '../EverfurResult.d-BFH-3s6E.cjs';
12
12
  export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-DirW9hgO.cjs';
13
- import '../requestFunnel.d-C4abgvt9.cjs';
13
+ import '../requestFunnel.d-CQ0O8fMG.cjs';
14
14
 
15
15
  interface EverfurConsentToggleProps {
16
16
  /** Which act this row is. One row is one act; two acts are two rows, never one switch. */
@@ -1,16 +1,16 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { ReactNode } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
- import { E as EverfurConsentScope } from '../copy.d-hFRaovog.js';
5
- export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d-hFRaovog.js';
4
+ import { E as EverfurConsentScope } from '../copy.d-CDlirTR4.js';
5
+ export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d-CDlirTR4.js';
6
6
  import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.js';
7
7
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.js';
8
- export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-DIOnFzXL.js';
9
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-N5Xzy53V.js';
8
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-DR5YwO6E.js';
9
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-D9igq-vT.js';
10
10
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.js';
11
11
  export { E as EverfurResult } from '../EverfurResult.d-D_-254ZY.js';
12
12
  export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-68yrE3BE.js';
13
- import '../requestFunnel.d-B8OVGh0p.js';
13
+ import '../requestFunnel.d-BYLycQMI.js';
14
14
 
15
15
  interface EverfurConsentToggleProps {
16
16
  /** Which act this row is. One row is one act; two acts are two rows, never one switch. */
@@ -4,7 +4,7 @@ return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
4
4
  return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
5
5
  return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled2;try{settled2=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled2=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled2.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled2;let error=settled2.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
6
6
  /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
7
- return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var CONSENT_PATH="/widget/v1/consent",EVERFUR_CONSENT_SCOPES=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),RECORDS_CONTENT_SCOPE="records_content",CONSENT_VERSION_MAX=64,SCOPES=new Set(EVERFUR_CONSENT_SCOPES);function isEverfurConsentScope(value){return typeof value=="string"&&SCOPES.has(value)}function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function validateScope(scope){return isEverfurConsentScope(scope)?null:invalid(scope===RECORDS_CONTENT_SCOPE?`'${RECORDS_CONTENT_SCOPE}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/pets/{pet_ref}/consent, which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${EVERFUR_CONSENT_SCOPES.join(", ")}`)}function validateDecision(decision){if(typeof decision!="object"||decision===null)return invalid("write needs a decision object");let{scope:scope,granted:granted,consentVersion:consentVersion}=decision,badScope=validateScope(scope);return badScope!==null?badScope:typeof granted!="boolean"?invalid("granted must be true to grant or false to withdraw"):consentVersion!==void 0&&(typeof consentVersion!="string"||consentVersion.length===0||consentVersion.length>CONSENT_VERSION_MAX)?invalid(`consentVersion must be 1..${CONSENT_VERSION_MAX} characters`):null}var str=value=>typeof value=="string"&&value.length>0?value:null;function verdictFromWire(raw,scope){if(typeof raw!="object"||raw===null)return null;let o=raw;return typeof o.granted!="boolean"||typeof o.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:scope,granted:o.granted,hasDecision:o.has_decision,consentVersion:str(o.consent_version),actor:str(o.actor),recordedAt:str(o.recorded_at)})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no granted/has_decision pair`})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createConsentRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createConsentRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(scope,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(scope,opts),write:(decision,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("write"))):over().write(decision,opts)}}function createConsentRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async read(scope,opts){let bad=validateScope(scope);if(bad!==null)return err(bad);let res=await funnel.send("consent.read",withSignal({method:"GET",path:CONSENT_PATH,query:{scope:scope}},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,scope);return verdict===null?err(malformed("consent.read")):ok(verdict)},async write(decision,opts){let bad=validateDecision(decision);if(bad!==null)return err(bad);let body={scope:decision.scope,granted:decision.granted};decision.consentVersion!==void 0&&(body.consent_version=decision.consentVersion);let res=await funnel.send("consent.write",withSignal({method:"PUT",path:CONSENT_PATH,body:body},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,decision.scope);return verdict===null?err(malformed("consent.write")):ok(verdict)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function blank(scope,error){/* @__PURE__ */
7
+ return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var CONSENT_PATH="/widget/v1/consent",EVERFUR_CONSENT_SCOPES=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),RECORDS_CONTENT_SCOPE="records_content",CONSENT_VERSION_MAX=64,SCOPES=new Set(EVERFUR_CONSENT_SCOPES);function isEverfurConsentScope(value){return typeof value=="string"&&SCOPES.has(value)}function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function validateScope(scope){return isEverfurConsentScope(scope)?null:invalid(scope===RECORDS_CONTENT_SCOPE?`'${RECORDS_CONTENT_SCOPE}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/consent (all pets) or /widget/v1/records/pets/{pet_ref}/consent (one pet), which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${EVERFUR_CONSENT_SCOPES.join(", ")}`)}function validateDecision(decision){if(typeof decision!="object"||decision===null)return invalid("write needs a decision object");let{scope:scope,granted:granted,consentVersion:consentVersion}=decision,badScope=validateScope(scope);return badScope!==null?badScope:typeof granted!="boolean"?invalid("granted must be true to grant or false to withdraw"):consentVersion!==void 0&&(typeof consentVersion!="string"||consentVersion.length===0||consentVersion.length>CONSENT_VERSION_MAX)?invalid(`consentVersion must be 1..${CONSENT_VERSION_MAX} characters`):null}var str=value=>typeof value=="string"&&value.length>0?value:null;function verdictFromWire(raw,scope){if(typeof raw!="object"||raw===null)return null;let o=raw;return typeof o.granted!="boolean"||typeof o.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:scope,granted:o.granted,hasDecision:o.has_decision,consentVersion:str(o.consent_version),actor:str(o.actor),recordedAt:str(o.recorded_at)})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no granted/has_decision pair`})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createConsentRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createConsentRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(scope,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(scope,opts),write:(decision,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("write"))):over().write(decision,opts)}}function createConsentRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async read(scope,opts){let bad=validateScope(scope);if(bad!==null)return err(bad);let res=await funnel.send("consent.read",withSignal({method:"GET",path:CONSENT_PATH,query:{scope:scope}},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,scope);return verdict===null?err(malformed("consent.read")):ok(verdict)},async write(decision,opts){let bad=validateDecision(decision);if(bad!==null)return err(bad);let body={scope:decision.scope,granted:decision.granted};decision.consentVersion!==void 0&&(body.consent_version=decision.consentVersion);let res=await funnel.send("consent.write",withSignal({method:"PUT",path:CONSENT_PATH,body:body},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,decision.scope);return verdict===null?err(malformed("consent.write")):ok(verdict)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function blank(scope,error){/* @__PURE__ */
8
8
  return Object.freeze({scope:scope,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:error})}function settled(verdict){/* @__PURE__ */
9
9
  return Object.freeze({scope:verdict.scope,granted:verdict.granted,hasDecision:verdict.hasDecision,consentVersion:verdict.consentVersion,recordedAt:verdict.recordedAt,loaded:true,saving:false,error:null})}function noMember(){return makeEverfurError("sessionRequired",{retryable:false,wireMessage:"a consent decision is authored by the member; sign a user in on the provider first"})}function useEverfurConsentRepository(){let{runtime:runtime}=useEverfurContext();return useMemo(()=>createConsentRepository(runtime),[runtime])}function useEverfurConsent(options){let{userRef:userRef}=useEverfurContext(),repository=useEverfurConsentRepository(),requestedKey=(options?.scopes??[]).filter(isEverfurConsentScope).join(","),requested=useMemo(()=>{let named=requestedKey.length===0?[]:requestedKey.split(",");return named.length===0?EVERFUR_CONSENT_SCOPES:/* @__PURE__ */Object.freeze(named)},[requestedKey]),[status,setStatus]=useState(userRef===null?"signed_out":"loading"),[scopes,setScopes]=useState([]),[error,setError]=useState(null),generation=useRef(0),readAll=useCallback(async()=>{if(userRef===null){generation.current+=1,setStatus("signed_out"),setScopes([]),setError(null);return}let gen=generation.current+=1;setStatus("loading"),setError(null);let results=await Promise.all(requested.map(scope=>repository.read(scope)));if(gen!==generation.current)return;let next=results.map((result,index)=>{let scope=requested[index];return result.ok?settled(result.value):blank(scope,result.error)}),firstFailure=results.find(result=>!result.ok),everyFailed=results.every(result=>!result.ok);setScopes(/* @__PURE__ */Object.freeze(next)),setStatus(everyFailed?"failed":"ready"),setError(everyFailed&&firstFailure!==void 0&&!firstFailure.ok?firstFailure.error:null)},[repository,requested,userRef]);useEffect(()=>{readAll()},[readAll]);let setConsent=useCallback(async(scope,granted)=>{if(userRef===null)return err(noMember());let gen=generation.current,previous=null;setScopes(current=>{let index=current.findIndex(entry=>entry.scope===scope),before=index===-1?blank(scope,null):current[index];previous=before;let optimistic=/* @__PURE__ */Object.freeze({...before,granted:granted,hasDecision:true,saving:true,error:null});if(index===-1)/* @__PURE__ */return Object.freeze([...current,optimistic]);let next=[...current];return next[index]=optimistic,/* @__PURE__ */Object.freeze(next)});let result=await repository.write({scope:scope,granted:granted});return gen!==generation.current||setScopes(current=>{let index=current.findIndex(entry=>entry.scope===scope);if(index===-1)return current;let next=[...current];return next[index]=result.ok?settled(result.value):/* @__PURE__ */Object.freeze({...previous??blank(scope,null),saving:false,error:result.error}),/* @__PURE__ */Object.freeze(next)}),result},[repository,userRef]);return useMemo(()=>({status:status,scopes:scopes,error:error,setConsent:setConsent,refresh:readAll}),[status,scopes,error,setConsent,readAll])}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var HostRenderBoundary=class extends Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(props,state){return Object.is(props.resetKey,state.key)?null:{failed:false,key:props.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:render}){return render()}function HostRender({render:render,fallback:fallback,resetKey:resetKey}){return createElement(HostRenderBoundary,{fallback:fallback,resetKey:resetKey,children:createElement(RenderHost,{render:render})})}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return createElement(Text$1,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}forwardRef(function(props,ref){return createElement(TextInput,{...props,...ref===null?{}:{ref:ref}})});function EverfurConsentToggle(props){let{scope:scope,onChange:onChange,renderNotice:renderNotice,style:style}=guardHostProps(props,["onChange"]),theme=useEverfurTheme(),styles=useMemo(()=>makeStyles(theme),[theme]),consent=useEverfurConsent({scopes:[scope]}),view=consentRowView(consent,scope),copy=CONSENT_SCOPE_COPY[scope],[attempt,setAttempt]=useState(null),decide=useCallback(async granted=>{setAttempt(granted);let result=await consent.setConsent(scope,granted);result.ok&&(setAttempt(null),onChange?.(result.value.granted))},[consent,onChange,scope]),notice=(error,onRetry)=>/* @__PURE__ */jsxs(View,{style:styles.notice,children:[
10
10
  /* @__PURE__ */jsx(HostRender,{resetKey:error,render:()=>renderNotice?renderNotice(error):/* @__PURE__ */jsx(Text,{style:styles.noticeText,children:error.displayMessage}),fallback:/* @__PURE__ */jsx(Text,{style:styles.noticeText,children:error.displayMessage})}),