@everfur/sdk 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/dist/{Chat.d-CTVJ_qWQ.d.cts → Chat.d-CGuvQApZ.d.cts} +1 -1
  3. package/dist/{Chat.d-Bt0fKiOQ.d.ts → Chat.d-DQkMkRlv.d.ts} +1 -1
  4. package/dist/{DepthViews.d-BHb0Xb-C.d.cts → DepthViews.d-Bs79si_g.d.cts} +1 -1
  5. package/dist/{DepthViews.d-Dq8eWBvw.d.cts → DepthViews.d-C9HdQhC2.d.cts} +1 -1
  6. package/dist/{DepthViews.d-BW3HrhnC.d.ts → DepthViews.d-DrCO-wqQ.d.ts} +1 -1
  7. package/dist/{DepthViews.d-BIfqdrvX.d.ts → DepthViews.d-v8fVFY4g.d.ts} +1 -1
  8. package/dist/{LifecyclePort.d-Cr1p33a7.d.cts → LifecyclePort.d-Cb9NtmP-.d.cts} +5 -0
  9. package/dist/{LifecyclePort.d-Cr1p33a7.d.ts → LifecyclePort.d-Cb9NtmP-.d.ts} +5 -0
  10. package/dist/{RecordsPage.d-Bs-dghTH.d.ts → RecordsPage.d-BDZ8JRSw.d.ts} +1 -1
  11. package/dist/{RecordsPage.d-CLrw-AvZ.d.cts → RecordsPage.d-a_h8Hlxr.d.cts} +1 -1
  12. package/dist/animations/index.cjs +1 -1
  13. package/dist/animations/index.d.cts +3 -3
  14. package/dist/animations/index.d.ts +3 -3
  15. package/dist/animations/index.js +1 -1
  16. package/dist/{attachments.d-DTGYmW8Y.d.cts → attachments.d-DjwKMpb0.d.cts} +1 -1
  17. package/dist/{attachments.d-DjxmIsNp.d.ts → attachments.d-HxQiuR6k.d.ts} +1 -1
  18. package/dist/{bookingCopy.d-D952V8Tq.d.cts → bookingCopy.d-CX1IaYNX.d.cts} +2 -2
  19. package/dist/{bookingCopy.d-CX-DMiwi.d.ts → bookingCopy.d-DFhHqNkX.d.ts} +2 -2
  20. package/dist/{branding.d-SCzhpyTt.d.ts → branding.d-CNeG_CY3.d.ts} +7 -2
  21. package/dist/{branding.d-eGlNC86j.d.cts → branding.d-KOXyiUqX.d.cts} +7 -2
  22. package/dist/{casesRepository.d-bWJHZD-_.d.cts → casesRepository.d-BvHziaN3.d.cts} +1 -1
  23. package/dist/{casesRepository.d-CnJZlUZ4.d.ts → casesRepository.d-CsXp5ZbO.d.ts} +1 -1
  24. package/dist/chat/index.cjs +34 -34
  25. package/dist/chat/index.d.cts +11 -11
  26. package/dist/chat/index.d.ts +11 -11
  27. package/dist/chat/index.js +35 -35
  28. package/dist/chat/lite/index.cjs +34 -34
  29. package/dist/chat/lite/index.d.cts +11 -11
  30. package/dist/chat/lite/index.d.ts +11 -11
  31. package/dist/chat/lite/index.js +35 -35
  32. package/dist/{chatHandoffToken.d-BCEdhZpd.d.ts → chatHandoffToken.d-D8ziljrV.d.ts} +11 -6
  33. package/dist/{chatHandoffToken.d-uKnSnIzN.d.cts → chatHandoffToken.d-N8D7LgiG.d.cts} +11 -6
  34. package/dist/{chatTypes.d-DbdF3ij5.d.ts → checkin.d-C6v2akWa.d.ts} +69 -37
  35. package/dist/{chatTypes.d-CFyYBzps.d.cts → checkin.d-CVo0MpeG.d.cts} +69 -37
  36. package/dist/{chunk-LWPM4GD3.js → chunk-4YMKIILX.js} +5 -5
  37. package/dist/{chunk-ZZTNGAS7.js → chunk-D5AYE7FR.js} +3 -3
  38. package/dist/chunk-LFCCBV3J.js +47 -0
  39. package/dist/{chunk-5TWMQIT4.js → chunk-OMWBGNXK.js} +1 -1
  40. package/dist/client/index.cjs +21 -8
  41. package/dist/client/index.d.cts +83 -15
  42. package/dist/client/index.d.ts +83 -15
  43. package/dist/client/index.js +21 -8
  44. package/dist/{clinicBatch.d-C_kZtYt-.d.ts → clinicBatch.d-DUCpGy47.d.ts} +2 -2
  45. package/dist/{clinicBatch.d-e3Cn5HhA.d.cts → clinicBatch.d-h4AzQhUH.d.cts} +2 -2
  46. package/dist/{config.d--6siaeNg.d.ts → config.d-Ds1iysW4.d.ts} +20 -1
  47. package/dist/{config.d-Ba21AaZg.d.cts → config.d-DwLvHCYP.d.cts} +20 -1
  48. package/dist/consent/index.cjs +2 -2
  49. package/dist/consent/index.d.cts +5 -5
  50. package/dist/consent/index.d.ts +5 -5
  51. package/dist/consent/index.js +2 -2
  52. package/dist/{context.d-Bl07_JGt.d.ts → context.d-CsoglkHv.d.ts} +6 -6
  53. package/dist/{context.d-CzMV_7jD.d.cts → context.d-_IdRcaaC.d.cts} +6 -6
  54. package/dist/{copy.d-GokMma80.d.ts → copy.d-CprpMJD2.d.ts} +2 -2
  55. package/dist/{copy.d-zWWCn3wB.d.cts → copy.d-Du3C9Itf.d.cts} +2 -2
  56. package/dist/core/index.cjs +15 -13
  57. package/dist/core/index.d.cts +18 -16
  58. package/dist/core/index.d.ts +18 -16
  59. package/dist/core/index.js +15 -13
  60. package/dist/{depth.d-C_HL8yAz.d.ts → depth.d-4CAnnHdv.d.ts} +2 -2
  61. package/dist/{depth.d-De5pT7vA.d.cts → depth.d-B45A8uzH.d.cts} +2 -2
  62. package/dist/{entitlementRepository.d-DLMRDNUe.d.ts → entitlementRepository.d-BVKx1U_k.d.ts} +4 -4
  63. package/dist/{entitlementRepository.d-B4ffomns.d.cts → entitlementRepository.d-Cp2ZU7pQ.d.cts} +4 -4
  64. package/dist/{focus.d-7G0BBmA9.d.ts → focus.d-BmER-Wo9.d.ts} +1 -1
  65. package/dist/{focus.d-B0qweva0.d.cts → focus.d-DkRwLTEB.d.cts} +1 -1
  66. package/dist/health-plan/index.cjs +14 -9
  67. package/dist/health-plan/index.d.cts +14 -14
  68. package/dist/health-plan/index.d.ts +14 -14
  69. package/dist/health-plan/index.js +14 -9
  70. package/dist/{healthPlanRepository.d-fPbLceBr.d.cts → healthPlanRepository.d-B3je3K9s.d.cts} +2 -2
  71. package/dist/{healthPlanRepository.d-CdCyUWph.d.ts → healthPlanRepository.d-D8a8n9Jj.d.ts} +2 -2
  72. package/dist/{idempotency.d-IDta7Jjj.d.cts → idempotency.d-CqQ4xvQT.d.cts} +1 -1
  73. package/dist/{idempotency.d-CoUlC-Yd.d.ts → idempotency.d-Cs5pjjdA.d.ts} +1 -1
  74. package/dist/{identity.d-B7dPRGqm.d.ts → identity.d-Bj7WLFXU.d.ts} +1 -1
  75. package/dist/{identity.d-_MK9Y7a4.d.cts → identity.d-Dg3l3zT5.d.cts} +1 -1
  76. package/dist/{inbox.d-CuuPTWyW.d.ts → inbox.d-DVfTwkEB.d.ts} +1 -1
  77. package/dist/{inbox.d-ChNXTovj.d.cts → inbox.d-DYCjhSnO.d.cts} +1 -1
  78. package/dist/index.cjs +45 -44
  79. package/dist/index.d.cts +20 -18
  80. package/dist/index.d.ts +20 -18
  81. package/dist/index.js +46 -45
  82. package/dist/{introEvents.d-D6Ay0ORN.d.ts → introEvents.d-CmC7ag_3.d.ts} +1 -1
  83. package/dist/{introEvents.d-JvAWRKYu.d.cts → introEvents.d-Wc0-QPLf.d.cts} +1 -1
  84. package/dist/{layout.d-D3d4QMeO.d.ts → layout.d-BZbIqvZ_.d.ts} +2 -2
  85. package/dist/{layout.d-ByfOEhpG.d.cts → layout.d-yLooG8Z0.d.cts} +2 -2
  86. package/dist/models.d-DHAQqrQr.d.ts +182 -0
  87. package/dist/models.d-Dml2f9-U.d.cts +182 -0
  88. package/dist/notifications/inbox/index.cjs +3 -3
  89. package/dist/notifications/inbox/index.d.cts +7 -7
  90. package/dist/notifications/inbox/index.d.ts +7 -7
  91. package/dist/notifications/inbox/index.js +3 -3
  92. package/dist/notifications/index.cjs +2 -2
  93. package/dist/notifications/index.d.cts +7 -7
  94. package/dist/notifications/index.d.ts +7 -7
  95. package/dist/notifications/index.js +2 -2
  96. package/dist/{optInView.d-BpFTJaaX.d.ts → optInView.d-B_yFAfKk.d.ts} +2 -2
  97. package/dist/{optInView.d-Bxvg0WLJ.d.cts → optInView.d-Td2Uv3iq.d.cts} +2 -2
  98. package/dist/parse.d-DtHmpAMT.d.cts +282 -0
  99. package/dist/parse.d-DtHmpAMT.d.ts +282 -0
  100. package/dist/{pets.d-BtbJcf8T.d.cts → pets.d-CE8_oDjM.d.cts} +1 -1
  101. package/dist/{pets.d-Br960ekh.d.ts → pets.d-UFpQT-q3.d.ts} +1 -1
  102. package/dist/{petsRepository.d-Bj9rPnCr.d.cts → petsRepository.d-BVSrxwKa.d.cts} +1 -1
  103. package/dist/{petsRepository.d-CSOth5XE.d.ts → petsRepository.d-BvmFXjTc.d.ts} +1 -1
  104. package/dist/photo/index.cjs +2 -2
  105. package/dist/photo/index.js +2 -2
  106. package/dist/records/depth/index.cjs +2 -2
  107. package/dist/records/depth/index.d.cts +9 -9
  108. package/dist/records/depth/index.d.ts +9 -9
  109. package/dist/records/depth/index.js +2 -2
  110. package/dist/records/index.cjs +4 -4
  111. package/dist/records/index.d.cts +11 -11
  112. package/dist/records/index.d.ts +11 -11
  113. package/dist/records/index.js +4 -4
  114. package/dist/{requestFunnel.d-LSnmCusf.d.ts → requestFunnel.d-D8UsEFed.d.ts} +2 -2
  115. package/dist/{requestFunnel.d-BwO-jFLX.d.cts → requestFunnel.d-fmBVWfsj.d.cts} +2 -2
  116. package/dist/{route.d-Bzyamuxa.d.ts → route.d-BnWvGpNN.d.ts} +2 -2
  117. package/dist/{route.d-D70-OHBc.d.cts → route.d-DOXnhbtt.d.cts} +2 -2
  118. package/dist/{runtimeTypes.d-6nkdToBS.d.cts → runtimeTypes.d-BlejmEU1.d.cts} +34 -6
  119. package/dist/{runtimeTypes.d-Byb55WsJ.d.ts → runtimeTypes.d-C6fYXNx2.d.ts} +34 -6
  120. package/dist/{screenProps.d-DB5IMaGZ.d.cts → screenProps.d-BfYg9Eaz.d.cts} +1 -1
  121. package/dist/{screenProps.d-HGSPNGHt.d.ts → screenProps.d-Bp0vHiov.d.ts} +1 -1
  122. package/dist/sdkConfigStore.d-BHrzkVpP.d.cts +45 -0
  123. package/dist/sdkConfigStore.d-VPvsIL8E.d.ts +45 -0
  124. package/dist/server/events/index.cjs +3 -2
  125. package/dist/server/events/index.d.cts +2 -2
  126. package/dist/server/events/index.d.ts +2 -2
  127. package/dist/server/events/index.js +3 -2
  128. package/dist/server/index.cjs +5 -4
  129. package/dist/server/index.d.cts +9 -3
  130. package/dist/server/index.d.ts +9 -3
  131. package/dist/server/index.js +5 -4
  132. package/dist/shop/index.cjs +12 -6
  133. package/dist/shop/index.d.cts +3 -3
  134. package/dist/shop/index.d.ts +3 -3
  135. package/dist/shop/index.js +13 -7
  136. package/dist/slots/index.cjs +15 -16
  137. package/dist/slots/index.d.cts +6 -6
  138. package/dist/slots/index.d.ts +6 -6
  139. package/dist/slots/index.js +15 -16
  140. package/dist/slots/weather-glyphs/index.cjs +1 -1
  141. package/dist/slots/weather-glyphs/index.js +1 -1
  142. package/dist/tabs/index.cjs +79 -13
  143. package/dist/tabs/index.d.cts +129 -10
  144. package/dist/tabs/index.d.ts +129 -10
  145. package/dist/tabs/index.js +79 -13
  146. package/dist/televet/booking/index.cjs +2 -2
  147. package/dist/televet/booking/index.d.cts +6 -6
  148. package/dist/televet/booking/index.d.ts +6 -6
  149. package/dist/televet/booking/index.js +2 -2
  150. package/dist/televet/index.cjs +2 -2
  151. package/dist/televet/index.js +2 -2
  152. package/dist/testing/index.cjs +4 -3
  153. package/dist/testing/index.d.cts +1 -1
  154. package/dist/testing/index.d.ts +1 -1
  155. package/dist/testing/index.js +4 -3
  156. package/dist/testing/rn/index.cjs +3 -3
  157. package/dist/testing/rn/index.d.cts +11 -9
  158. package/dist/testing/rn/index.d.ts +11 -9
  159. package/dist/testing/rn/index.js +3 -3
  160. package/dist/testing/web/index.cjs +2 -2
  161. package/dist/testing/web/index.d.cts +11 -9
  162. package/dist/testing/web/index.d.ts +11 -9
  163. package/dist/testing/web/index.js +2 -2
  164. package/dist/texting/index.cjs +4 -4
  165. package/dist/texting/index.d.cts +22 -8
  166. package/dist/texting/index.d.ts +22 -8
  167. package/dist/texting/index.js +4 -4
  168. package/dist/{threadOptions.d-E-ZxhUSg.d.cts → threadOptions.d-B9OndNS2.d.cts} +5 -5
  169. package/dist/{threadOptions.d-Cjps2yaN.d.ts → threadOptions.d-BlpnY5xP.d.ts} +5 -5
  170. package/dist/{timelineRows.d-CPS4admm.d.ts → timelineRows.d-BPOMlI-P.d.ts} +1 -1
  171. package/dist/{timelineRows.d-BJRCgmdv.d.cts → timelineRows.d-BmHu_XLI.d.cts} +1 -1
  172. package/dist/{tokens.d-DH1mYjZl.d.cts → tokens.d-DxM-tKjz.d.cts} +2 -0
  173. package/dist/{tokens.d-DH1mYjZl.d.ts → tokens.d-DxM-tKjz.d.ts} +2 -0
  174. package/dist/{typeStyle.d-CuKAr0Ly.d.cts → typeStyle.d-DmdB2TfH.d.cts} +2 -2
  175. package/dist/{typeStyle.d-ZszGrWPf.d.ts → typeStyle.d-Ma1uBgn-.d.ts} +2 -2
  176. package/dist/ui/index.cjs +5 -4
  177. package/dist/ui/index.js +5 -4
  178. package/dist/{useHealthPlanSubscription.d-SQfx-45x.d.ts → useHealthPlanSubscription.d-BAU8x02a.d.ts} +4 -4
  179. package/dist/{useHealthPlanSubscription.d-zjsvvlhz.d.cts → useHealthPlanSubscription.d-CuJMQc_d.d.cts} +4 -4
  180. package/dist/{useInboxUnread.d-BxFKFU4o.d.ts → useInboxUnread.d-BUpXjNnT.d.ts} +2 -2
  181. package/dist/{useInboxUnread.d-7p3IWs_A.d.cts → useInboxUnread.d-By1CkCy2.d.cts} +2 -2
  182. package/dist/{usePresentation.d-DUHlQyV5.d.cts → usePresentation.d-CgEJRm6Q.d.cts} +2 -2
  183. package/dist/{usePresentation.d-CoyGEJOl.d.ts → usePresentation.d-kSW7ttTl.d.ts} +2 -2
  184. package/dist/{useRecordsDepth.d-Bk8BSerZ.d.cts → useRecordsDepth.d-BHQgBRBw.d.cts} +1 -1
  185. package/dist/{useRecordsDepth.d-BinUa8W9.d.ts → useRecordsDepth.d-diEF_tFF.d.ts} +1 -1
  186. package/dist/{useUnread.d-D-p7oEW_.d.cts → useUnread.d-CoQKIHVD.d.cts} +31 -17
  187. package/dist/{useUnread.d-CFzIPmZt.d.ts → useUnread.d-aRej_wU8.d.ts} +31 -17
  188. package/dist/video/index.cjs +2 -2
  189. package/dist/video/index.js +2 -2
  190. package/dist/{view.d-CaH6dZPJ.d.ts → view.d-CevohC1l.d.ts} +3 -3
  191. package/dist/{view.d-DV4b1cov.d.cts → view.d-DgXlfcxR.d.cts} +3 -3
  192. package/dist/web/consent/index.cjs +2 -2
  193. package/dist/web/consent/index.d.cts +5 -5
  194. package/dist/web/consent/index.d.ts +5 -5
  195. package/dist/web/consent/index.js +2 -2
  196. package/dist/web/health-plan/index.cjs +11 -11
  197. package/dist/web/health-plan/index.d.cts +16 -16
  198. package/dist/web/health-plan/index.d.ts +16 -16
  199. package/dist/web/health-plan/index.js +7 -7
  200. package/dist/web/health-plan/styles.css +59 -0
  201. package/dist/web/inbox/index.cjs +3 -3
  202. package/dist/web/inbox/index.d.cts +8 -8
  203. package/dist/web/inbox/index.d.ts +8 -8
  204. package/dist/web/inbox/index.js +3 -3
  205. package/dist/web/index.cjs +52 -51
  206. package/dist/web/index.d.cts +59 -44
  207. package/dist/web/index.d.ts +59 -44
  208. package/dist/web/index.js +52 -51
  209. package/dist/web/intro/index.cjs +2 -2
  210. package/dist/web/intro/index.d.cts +7 -7
  211. package/dist/web/intro/index.d.ts +7 -7
  212. package/dist/web/intro/index.js +2 -2
  213. package/dist/web/notifications/index.cjs +2 -2
  214. package/dist/web/notifications/index.d.cts +6 -6
  215. package/dist/web/notifications/index.d.ts +6 -6
  216. package/dist/web/notifications/index.js +2 -2
  217. package/dist/web/records/depth/index.cjs +2 -2
  218. package/dist/web/records/depth/index.d.cts +9 -9
  219. package/dist/web/records/depth/index.d.ts +9 -9
  220. package/dist/web/records/depth/index.js +2 -2
  221. package/dist/web/records/index.cjs +4 -4
  222. package/dist/web/records/index.d.cts +11 -11
  223. package/dist/web/records/index.d.ts +11 -11
  224. package/dist/web/records/index.js +4 -4
  225. package/dist/web/records-sheet/index.cjs +4 -4
  226. package/dist/web/records-sheet/index.js +4 -4
  227. package/dist/web/shop/index.cjs +9 -9
  228. package/dist/web/shop/index.d.cts +3 -3
  229. package/dist/web/shop/index.d.ts +3 -3
  230. package/dist/web/shop/index.js +4 -4
  231. package/dist/web/televet/booking/index.cjs +2 -2
  232. package/dist/web/televet/booking/index.d.cts +7 -7
  233. package/dist/web/televet/booking/index.d.ts +7 -7
  234. package/dist/web/televet/booking/index.js +2 -2
  235. package/dist/web/televet/call/index.cjs +1 -1
  236. package/dist/web/televet/call/index.js +1 -1
  237. package/dist/web/televet/index.cjs +2 -2
  238. package/dist/web/televet/index.js +2 -2
  239. package/dist/web/texting/index.cjs +4 -4
  240. package/dist/web/texting/index.d.cts +22 -8
  241. package/dist/web/texting/index.d.ts +22 -8
  242. package/dist/web/texting/index.js +4 -4
  243. package/dist/web/ui/index.cjs +8 -8
  244. package/dist/web/ui/index.js +1 -1
  245. package/dist/web/ui/styles.css +66 -0
  246. package/package.json +10 -6
  247. package/dist/chunk-PDZTFXOO.js +0 -47
@@ -1,11 +1,11 @@
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
- import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, j as HealthPlanPageRepository, H as HealthPlanPage, i as HealthPlanSubscriptionRepository, p as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-7G0BBmA9.js';
3
- import { H as HealthPlanItem, a as HealthPlan, b as HealthPlanRepository } from './healthPlanRepository.d-CdCyUWph.js';
2
+ import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, j as HealthPlanPageRepository, H as HealthPlanPage, i as HealthPlanSubscriptionRepository, p as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-BmER-Wo9.js';
3
+ import { H as HealthPlanItem, a as HealthPlan, b as HealthPlanRepository } from './healthPlanRepository.d-D8a8n9Jj.js';
4
4
  import { ReactNode } from 'react';
5
5
  import { P as PetRef } from './ids.d-B2GAAifq.js';
6
- import { b as HealthPlanCart } from './layout.d-D3d4QMeO.js';
6
+ import { b as HealthPlanCart } from './layout.d-BZbIqvZ_.js';
7
7
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
8
- import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.js';
8
+ import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.js';
9
9
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
10
10
 
11
11
  /**
@@ -1,11 +1,11 @@
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
- import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, j as HealthPlanPageRepository, H as HealthPlanPage, i as HealthPlanSubscriptionRepository, p as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-B0qweva0.cjs';
3
- import { H as HealthPlanItem, a as HealthPlan, b as HealthPlanRepository } from './healthPlanRepository.d-fPbLceBr.cjs';
2
+ import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, j as HealthPlanPageRepository, H as HealthPlanPage, i as HealthPlanSubscriptionRepository, p as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-DkRwLTEB.cjs';
3
+ import { H as HealthPlanItem, a as HealthPlan, b as HealthPlanRepository } from './healthPlanRepository.d-B3je3K9s.cjs';
4
4
  import { ReactNode } from 'react';
5
5
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
6
- import { b as HealthPlanCart } from './layout.d-ByfOEhpG.cjs';
6
+ import { b as HealthPlanCart } from './layout.d-yLooG8Z0.cjs';
7
7
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
8
- import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
8
+ import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.cjs';
9
9
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
10
10
 
11
11
  /**
@@ -1,9 +1,9 @@
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 { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.js';
4
- import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-CuuPTWyW.js';
4
+ import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-DVfTwkEB.js';
5
5
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
6
- import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.js';
6
+ import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.js';
7
7
 
8
8
  /** The words of the inbox. Every key is a plain string. */
9
9
  interface EverfurInboxCopy {
@@ -1,9 +1,9 @@
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 { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
4
- import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-ChNXTovj.cjs';
4
+ import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-DYCjhSnO.cjs';
5
5
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
6
- import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
6
+ import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.cjs';
7
7
 
8
8
  /** The words of the inbox. Every key is a plain string. */
9
9
  interface EverfurInboxCopy {
@@ -1,8 +1,8 @@
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
- import { c as HealthPlanReasonKind } from './healthPlanRepository.d-fPbLceBr.cjs';
2
+ import { c as HealthPlanReasonKind } from './healthPlanRepository.d-B3je3K9s.cjs';
3
3
  import { e as RecordsRequestView, g as RecordsView } from './models.d-BN53M9sU.cjs';
4
4
  import { ReactNode } from 'react';
5
- import { b as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-B0qweva0.cjs';
5
+ import { b as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-DkRwLTEB.cjs';
6
6
  import { c as EverfurChatTopCardRow, a as EverfurChatTopCard } from './threadOptions.d-CW51PyVd.cjs';
7
7
  import { i as EverfurPresentationInput, h as EverfurPresentation } from './presentation.d-tJe7zo12.cjs';
8
8
 
@@ -1,8 +1,8 @@
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
- import { c as HealthPlanReasonKind } from './healthPlanRepository.d-CdCyUWph.js';
2
+ import { c as HealthPlanReasonKind } from './healthPlanRepository.d-D8a8n9Jj.js';
3
3
  import { e as RecordsRequestView, g as RecordsView } from './models.d-Bhq9p6Wa.js';
4
4
  import { ReactNode } from 'react';
5
- import { b as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-7G0BBmA9.js';
5
+ import { b as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-BmER-Wo9.js';
6
6
  import { c as EverfurChatTopCardRow, a as EverfurChatTopCard } from './threadOptions.d-CW51PyVd.js';
7
7
  import { i as EverfurPresentationInput, h as EverfurPresentation } from './presentation.d-tJe7zo12.js';
8
8
 
@@ -2,7 +2,7 @@
2
2
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
3
3
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
4
4
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
5
- import { l as RecordsDepthClient } from './depth.d-De5pT7vA.cjs';
5
+ import { l as RecordsDepthClient } from './depth.d-B45A8uzH.cjs';
6
6
 
7
7
  type RecordsDepthStatus = 'loading' | 'empty' | 'error' | 'populated';
8
8
  /** One depth read as a render state. `withheld` (no consent, or a fail-closed parse) renders nothing. */
@@ -2,7 +2,7 @@
2
2
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
3
3
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
4
4
  import { P as PetRef } from './ids.d-B2GAAifq.js';
5
- import { l as RecordsDepthClient } from './depth.d-C_HL8yAz.js';
5
+ import { l as RecordsDepthClient } from './depth.d-4CAnnHdv.js';
6
6
 
7
7
  type RecordsDepthStatus = 'loading' | 'empty' | 'error' | 'populated';
8
8
  /** One depth read as a render state. `withheld` (no consent, or a fail-closed parse) renders nothing. */
@@ -3,11 +3,11 @@ import { ReactNode } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
4
  import { P as PetRef, C as ConversationId } from './ids.d-B2GAAifq.cjs';
5
5
  import { i as EverfurPresentationInput } from './presentation.d-tJe7zo12.cjs';
6
- import { a as ChatCheckinTarget } from './chatTypes.d-CFyYBzps.cjs';
7
- import { W as WidgetPet, P as PetProfileInput } from './petsRepository.d-Bj9rPnCr.cjs';
6
+ import { a as ChatCheckinTarget } from './checkin.d-CVo0MpeG.cjs';
7
+ import { W as WidgetPet, P as PetProfileInput } from './petsRepository.d-BVSrxwKa.cjs';
8
8
  import { E as EverfurStarterPrompt } from './quickPrompts.d-NM_81Jc1.cjs';
9
- import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
10
- import { U as UrgencyDisplayLevel, E as EverfurChatDraftStore, b as ChatFollowUpPolicy, i as UseEverfurUnreadOptions, d as EverfurUnreadState } from './chatHandoffToken.d-uKnSnIzN.cjs';
9
+ import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.cjs';
10
+ import { U as UrgencyDisplayLevel, E as EverfurChatDraftStore, b as ChatFollowUpPolicy, i as UseEverfurUnreadOptions, d as EverfurUnreadState } from './chatHandoffToken.d-N8D7LgiG.cjs';
11
11
  import { F as FileHandle } from './ports.d-BX4f4UsB.cjs';
12
12
  import { g as EverfurChatOpeningCard, a as EverfurChatAnswerCards, f as EverfurChatHistorySheet, e as EverfurChatHistoryBar, c as EverfurChatEmptyState } from './threadOptions.d-bEAFkIsC.cjs';
13
13
  import { E as EverfurChatEmptyHeaderContext, a as EverfurChatTopCard } from './threadOptions.d-CW51PyVd.cjs';
@@ -120,15 +120,29 @@ interface EverfurChatProps {
120
120
  */
121
121
  readonly composerSeed?: string;
122
122
  /**
123
- * Your app's lifecycle signals. Everfur has no socket and no polling here, so a message the platform
124
- * writes into the thread (a follow-up check-in, a reminder) is not visible until something re-reads it.
125
- * Tell Everfur when your app comes back to the foreground, when connectivity returns and when a push
126
- * announced a change, and the thread and the unread dot catch up on that signal alone. Absent, Everfur uses
127
- * React Native's own signal (AppState returning to `active` from the background; see `createAppStateLifecycle`).
128
- * Pass your own port to add connectivity or a push announcement, or `null` to turn the re-read off, in which
129
- * case chat refreshes only when the user does something.
123
+ * Your app's lifecycle signals. Everfur has no socket here, so a message the platform writes into the thread (a
124
+ * follow-up check-in, a reminder) shows when something re-reads it: your app coming back to the foreground,
125
+ * connectivity returning, a push you announce, and a short poll while the chat is on screen (`refreshIntervalMs`).
126
+ * Absent, Everfur uses React Native's own signal (AppState returning to `active` from the background; see
127
+ * `createAppStateLifecycle`). Pass your own port to add connectivity or a push announcement (`onAnnounced`, call
128
+ * it when a chat push arrives), or `null` to turn every re-read off, the poll included, in which case chat
129
+ * refreshes only when the user does something.
130
130
  */
131
131
  readonly lifecycle?: LifecyclePort | null;
132
+ /**
133
+ * How often, in milliseconds, the open chat re-reads its thread while it is mounted and your app is active, so a
134
+ * reply or a check-in the platform wrote shows without the member doing anything. Default 30 000 (30 s); the floor
135
+ * is 15 s (the refresh window), and a tick within it after another refresh does nothing. `null` turns the poll off
136
+ * and keeps the other signals.
137
+ */
138
+ readonly refreshIntervalMs?: number | null;
139
+ /**
140
+ * Let the refresh signals and the poll also re-read the pet's thread list while NO thread is open (a blank
141
+ * chat), so a check-in the platform queues while the chat sits blank appears without the member doing anything.
142
+ * Default false, as before 1.2.0: a blank chat reads its list when it opens or starts a thread, and
143
+ * `openUnreadOnRefresh` (which needs the same read) turns this on by itself.
144
+ */
145
+ readonly refreshesBlankThread?: boolean;
132
146
  /**
133
147
  * With no thread open (a blank chat), let a refresh (your app coming back, connectivity returning, a push you
134
148
  * announce through `lifecycle`) open the newest thread when it has an unread reply, as the chat already does when
@@ -168,13 +182,13 @@ interface EverfurChatProps {
168
182
  */
169
183
  readonly onOpenUrl?: (url: string, kind: 'citation' | 'message') => void | Promise<void>;
170
184
  /**
171
- * Turns links in messages on. Absent (the default), every address in a reply stays plain text, as before this
172
- * option existed. Given, an https address in a settled reply is a link when its host is Everfur's own (everfur.com
173
- * and its subdomains) or one listed here; pass `[]` for Everfur's own alone. An entry is a host matched exactly
174
- * (`shop.example.com`) or `*.` and a host for its subdomains (`*.example.com`). Any other address, and anything
175
- * that is not https, stays plain text.
185
+ * Which https addresses in a settled reply are links. Absent (the default), Everfur's own hosts (everfur.com and
186
+ * its subdomains) are links, so a follow-up the platform writes can be opened; given, those plus the hosts listed
187
+ * here. An entry is a host matched exactly (`shop.example.com`) or `*.` and a host for its subdomains
188
+ * (`*.example.com`). `false` turns every link off and leaves each address as plain text. Any other address, and
189
+ * anything that is not https, stays plain text.
176
190
  */
177
- readonly linkHosts?: readonly string[];
191
+ readonly linkHosts?: readonly string[] | false;
178
192
  /**
179
193
  * How far the top of the view that holds this chat sits below the top of the screen, in points: React
180
194
  * Native's `KeyboardAvoidingView` prop of the same name, which the chat's own avoiding view receives, so the
@@ -3,11 +3,11 @@ import { ReactNode } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
4
  import { P as PetRef, C as ConversationId } from './ids.d-B2GAAifq.js';
5
5
  import { i as EverfurPresentationInput } from './presentation.d-tJe7zo12.js';
6
- import { a as ChatCheckinTarget } from './chatTypes.d-DbdF3ij5.js';
7
- import { W as WidgetPet, P as PetProfileInput } from './petsRepository.d-CSOth5XE.js';
6
+ import { a as ChatCheckinTarget } from './checkin.d-C6v2akWa.js';
7
+ import { W as WidgetPet, P as PetProfileInput } from './petsRepository.d-BvmFXjTc.js';
8
8
  import { E as EverfurStarterPrompt } from './quickPrompts.d-NM_81Jc1.js';
9
- import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.js';
10
- import { U as UrgencyDisplayLevel, E as EverfurChatDraftStore, b as ChatFollowUpPolicy, i as UseEverfurUnreadOptions, d as EverfurUnreadState } from './chatHandoffToken.d-BCEdhZpd.js';
9
+ import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.js';
10
+ import { U as UrgencyDisplayLevel, E as EverfurChatDraftStore, b as ChatFollowUpPolicy, i as UseEverfurUnreadOptions, d as EverfurUnreadState } from './chatHandoffToken.d-D8ziljrV.js';
11
11
  import { F as FileHandle } from './ports.d-BX4f4UsB.js';
12
12
  import { g as EverfurChatOpeningCard, a as EverfurChatAnswerCards, f as EverfurChatHistorySheet, e as EverfurChatHistoryBar, c as EverfurChatEmptyState } from './threadOptions.d-U5YBUKM-.js';
13
13
  import { E as EverfurChatEmptyHeaderContext, a as EverfurChatTopCard } from './threadOptions.d-CW51PyVd.js';
@@ -120,15 +120,29 @@ interface EverfurChatProps {
120
120
  */
121
121
  readonly composerSeed?: string;
122
122
  /**
123
- * Your app's lifecycle signals. Everfur has no socket and no polling here, so a message the platform
124
- * writes into the thread (a follow-up check-in, a reminder) is not visible until something re-reads it.
125
- * Tell Everfur when your app comes back to the foreground, when connectivity returns and when a push
126
- * announced a change, and the thread and the unread dot catch up on that signal alone. Absent, Everfur uses
127
- * React Native's own signal (AppState returning to `active` from the background; see `createAppStateLifecycle`).
128
- * Pass your own port to add connectivity or a push announcement, or `null` to turn the re-read off, in which
129
- * case chat refreshes only when the user does something.
123
+ * Your app's lifecycle signals. Everfur has no socket here, so a message the platform writes into the thread (a
124
+ * follow-up check-in, a reminder) shows when something re-reads it: your app coming back to the foreground,
125
+ * connectivity returning, a push you announce, and a short poll while the chat is on screen (`refreshIntervalMs`).
126
+ * Absent, Everfur uses React Native's own signal (AppState returning to `active` from the background; see
127
+ * `createAppStateLifecycle`). Pass your own port to add connectivity or a push announcement (`onAnnounced`, call
128
+ * it when a chat push arrives), or `null` to turn every re-read off, the poll included, in which case chat
129
+ * refreshes only when the user does something.
130
130
  */
131
131
  readonly lifecycle?: LifecyclePort | null;
132
+ /**
133
+ * How often, in milliseconds, the open chat re-reads its thread while it is mounted and your app is active, so a
134
+ * reply or a check-in the platform wrote shows without the member doing anything. Default 30 000 (30 s); the floor
135
+ * is 15 s (the refresh window), and a tick within it after another refresh does nothing. `null` turns the poll off
136
+ * and keeps the other signals.
137
+ */
138
+ readonly refreshIntervalMs?: number | null;
139
+ /**
140
+ * Let the refresh signals and the poll also re-read the pet's thread list while NO thread is open (a blank
141
+ * chat), so a check-in the platform queues while the chat sits blank appears without the member doing anything.
142
+ * Default false, as before 1.2.0: a blank chat reads its list when it opens or starts a thread, and
143
+ * `openUnreadOnRefresh` (which needs the same read) turns this on by itself.
144
+ */
145
+ readonly refreshesBlankThread?: boolean;
132
146
  /**
133
147
  * With no thread open (a blank chat), let a refresh (your app coming back, connectivity returning, a push you
134
148
  * announce through `lifecycle`) open the newest thread when it has an unread reply, as the chat already does when
@@ -168,13 +182,13 @@ interface EverfurChatProps {
168
182
  */
169
183
  readonly onOpenUrl?: (url: string, kind: 'citation' | 'message') => void | Promise<void>;
170
184
  /**
171
- * Turns links in messages on. Absent (the default), every address in a reply stays plain text, as before this
172
- * option existed. Given, an https address in a settled reply is a link when its host is Everfur's own (everfur.com
173
- * and its subdomains) or one listed here; pass `[]` for Everfur's own alone. An entry is a host matched exactly
174
- * (`shop.example.com`) or `*.` and a host for its subdomains (`*.example.com`). Any other address, and anything
175
- * that is not https, stays plain text.
185
+ * Which https addresses in a settled reply are links. Absent (the default), Everfur's own hosts (everfur.com and
186
+ * its subdomains) are links, so a follow-up the platform writes can be opened; given, those plus the hosts listed
187
+ * here. An entry is a host matched exactly (`shop.example.com`) or `*.` and a host for its subdomains
188
+ * (`*.example.com`). `false` turns every link off and leaves each address as plain text. Any other address, and
189
+ * anything that is not https, stays plain text.
176
190
  */
177
- readonly linkHosts?: readonly string[];
191
+ readonly linkHosts?: readonly string[] | false;
178
192
  /**
179
193
  * How far the top of the view that holds this chat sits below the top of the screen, in points: React
180
194
  * Native's `KeyboardAvoidingView` prop of the same name, which the chat's own avoiding view receives, so the
@@ -1,8 +1,8 @@
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
- "use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime");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:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,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",anonTokenInvalid:"authRejected",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}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="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__ */
2
+ "use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime");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:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,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:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{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:"environment_mismatch",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:"not_found",envelope:"http_envelope",httpStatus:404,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:"restricted_key",envelope:"http_envelope",httpStatus:403,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:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,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",anonTokenInvalid:"authRejected",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",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="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({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 assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
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),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.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(
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,...fields.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...fields.freeCap})}:{}})}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),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.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
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 noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function fileHandleFromMedia(source){let handle={uri:source.uri,mimeType:source.mimeType},size=mediaByteSize(source);return size!==null&&(handle.sizeBytes=size),/* @__PURE__ */Object.freeze(handle)}function mediaByteSize(source){let candidate=source.byteSize??source.sizeBytes;return typeof candidate=="number"&&Number.isFinite(candidate)&&candidate>=0?candidate:null}function mediaDurationMs(source){let seconds=source.durationSeconds;return typeof seconds=="number"&&Number.isFinite(seconds)&&seconds>=0?Math.round(seconds*1e3):null}function captureOptionsFor(mode,maxDurationSeconds){/* @__PURE__ */
8
8
  return Object.freeze({mode:mode,maxDurationSeconds:maxDurationSeconds})}function isCaptureAvailable(camera){return camera!=null&&camera.isAvailable===true}var defaultTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function delayAbortable2(ms,signal,timers){return new Promise(resolve=>{if(signal.aborted){resolve();return}let holder={handle:void 0},done=()=>{timers.clearTimeout(holder.handle),signal.removeEventListener("abort",done),resolve()};holder.handle=timers.setTimeout(done,ms),signal.addEventListener("abort",done,{once:true})})}function mergeSignals2(a,b){if(!b)return a;let ctrl=new AbortController;if(a.aborted||b.aborted)return ctrl.abort(),ctrl.signal;let onAbort=()=>ctrl.abort();return a.addEventListener("abort",onAbort,{once:true}),b.addEventListener("abort",onAbort,{once:true}),ctrl.signal}var MediaStore=class{constructor(initial){this.listeners=/* @__PURE__ */new Set;this.epoch=0;this.inFlight=null;this.snapshot=/* @__PURE__ */Object.freeze({...initial})}subscribe(listener){return this.listeners.add(listener),()=>{this.listeners.delete(listener)}}getSnapshot(){return this.snapshot}patch(partial){this.snapshot=/* @__PURE__ */Object.freeze({...this.snapshot,...partial});for(let listener of this.listeners)listener()}beginOperation(external){this.inFlight?.abort();let ctrl=new AbortController;this.inFlight=ctrl;let epoch=this.epoch;return{signal:external?mergeSignals2(ctrl.signal,external):ctrl.signal,epoch:epoch,settle:()=>{this.inFlight===ctrl&&(this.inFlight=null)}}}alive(epoch){return epoch===this.epoch}rescope(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null}dispose(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null,this.listeners.clear()}};function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function isRecord2(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}var CONSUMER_SAFE_DETECTION_KEYS=/* @__PURE__ */Object.freeze(["primary_label","primary_confidence","subtype_label","subtype_display","subtype_confidence","risk_tier","confidence_tier","copy_short","disease_name","disease_framing","model_version","skin_v2","eye_v2","llm_checkup"]),OPERATOR_INTERNAL_KEYS=/* @__PURE__ */Object.freeze(["decision_audit","decision_thresholds","per_class_auroc","ood_layers","gate1_score","possible_conditions","top_class"]),BOOLEAN_KEYS=/* @__PURE__ */new Set(["skin_v2","eye_v2","llm_checkup"]),CONFIDENCE_KEYS=/* @__PURE__ */new Set(["primary_confidence","subtype_confidence"]),RISK_TIER_VALUES=/* @__PURE__ */new Set(["low_risk","concern","uncertain"]),CONFIDENCE_TIER_VALUES=/* @__PURE__ */new Set(["possible","probable"]),STRING_LIMITS=/* @__PURE__ */Object.freeze({primary_label:64,subtype_label:64,subtype_display:128,copy_short:512,disease_name:128,disease_framing:512,model_version:64});function projectDetectionMetadata(raw){let source=isRecord2(raw)?raw:{},out={};for(let key of CONSUMER_SAFE_DETECTION_KEYS){if(!(key in source))continue;let value=source[key],accepted=acceptKey(key,value);accepted!==DROP&&(out[key]=accepted)}let dropped=0;for(let key of OPERATOR_INTERNAL_KEYS)key in source&&(dropped+=1);/* @__PURE__ */