@everfur/sdk 0.18.2 → 0.19.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 (222) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +6 -5
  3. package/dist/{Chat.d-BkLu9G00.d.ts → Chat.d-BHovj6Ku.d.ts} +1 -1
  4. package/dist/{Chat.d-B7iUVGmB.d.cts → Chat.d-BO-XtVYe.d.cts} +1 -1
  5. package/dist/{DepthViews.d-BiS-GTEf.d.cts → DepthViews.d-BwIkdmWZ.d.cts} +1 -1
  6. package/dist/{DepthViews.d-C-zs_BnZ.d.cts → DepthViews.d-Bx85LeiP.d.cts} +1 -1
  7. package/dist/{DepthViews.d-hXV6Ef0y.d.ts → DepthViews.d-CBUunxP1.d.ts} +1 -1
  8. package/dist/{DepthViews.d-C0DVqywN.d.ts → DepthViews.d-DKoZgF8l.d.ts} +1 -1
  9. package/dist/{IntakeMedia.d-4a89XrP7.d.ts → IntakeMedia.d-B_ZVDxh3.d.ts} +1 -1
  10. package/dist/{IntakeMedia.d-JJCUvQu7.d.cts → IntakeMedia.d-CnGzpllr.d.cts} +1 -1
  11. package/dist/{IntakeMedia.d-DGxrhgIW.d.ts → IntakeMedia.d-DNUAks9E.d.ts} +1 -1
  12. package/dist/{IntakeMedia.d-DUPR4lVM.d.cts → IntakeMedia.d-Dqc5V_YH.d.cts} +1 -1
  13. package/dist/{RecordsPage.d-BG_RDR1V.d.ts → RecordsPage.d-CsvBhU0f.d.ts} +1 -1
  14. package/dist/{RecordsPage.d-5rHMTDyY.d.cts → RecordsPage.d-DRFp2LXH.d.cts} +1 -1
  15. package/dist/animations/index.cjs +1 -94
  16. package/dist/animations/index.d.cts +3 -3
  17. package/dist/animations/index.d.ts +3 -3
  18. package/dist/animations/index.js +1 -94
  19. package/dist/{attachments.d-_mgNU-ur.d.ts → attachments.d-DOZjCdkb.d.ts} +2 -2
  20. package/dist/{attachments.d-DFbXLAYK.d.cts → attachments.d-DWUsHPf9.d.cts} +2 -2
  21. package/dist/{bookingCopy.d-RU8lNYJ4.d.ts → bookingCopy.d-BlMWlvgv.d.ts} +10 -3
  22. package/dist/{bookingCopy.d-0K1trjxx.d.cts → bookingCopy.d-tvO7y6MK.d.cts} +10 -3
  23. package/dist/{casesRepository.d-D2SQFL27.d.ts → casesRepository.d-C7qbrOL-.d.ts} +1 -1
  24. package/dist/{casesRepository.d-D7vIZ9oX.d.cts → casesRepository.d-sSo6oakf.d.cts} +1 -1
  25. package/dist/chat/index.cjs +29 -119
  26. package/dist/chat/index.d.cts +11 -10
  27. package/dist/chat/index.d.ts +11 -10
  28. package/dist/chat/index.js +30 -120
  29. package/dist/chat/lite/index.cjs +29 -119
  30. package/dist/chat/lite/index.d.cts +11 -10
  31. package/dist/chat/lite/index.d.ts +11 -10
  32. package/dist/chat/lite/index.js +30 -120
  33. package/dist/{attachments.d-D7f7OfPE.d.ts → chatHandoffToken.d-C4tEyuCT.d.ts} +33 -9
  34. package/dist/{attachments.d-HmRqizDG.d.cts → chatHandoffToken.d-D6GUoBvs.d.cts} +33 -9
  35. package/dist/{ports.d-RKc2C07X.d.ts → chatTypes.d-BI4vidgu.d.ts} +41 -52
  36. package/dist/{ports.d-CB9YZT2L.d.cts → chatTypes.d-CSyw9em_.d.cts} +41 -52
  37. package/dist/client/index.cjs +2 -95
  38. package/dist/client/index.d.cts +7 -7
  39. package/dist/client/index.d.ts +7 -7
  40. package/dist/client/index.js +2 -95
  41. package/dist/{clinicBatch.d-BN1jfVGo.d.cts → clinicBatch.d-BxA_uGBb.d.cts} +2 -2
  42. package/dist/{clinicBatch.d-BhaCdstU.d.ts → clinicBatch.d-T5oSAhY-.d.ts} +2 -2
  43. package/dist/{config.d-D_k_rNZZ.d.ts → config.d-N5Xzy53V.d.ts} +1 -1
  44. package/dist/{config.d-BFTqU7ft.d.cts → config.d-jCmrhM4a.d.cts} +1 -1
  45. package/dist/consent/index.cjs +1 -94
  46. package/dist/consent/index.d.cts +5 -5
  47. package/dist/consent/index.d.ts +5 -5
  48. package/dist/consent/index.js +1 -94
  49. package/dist/{context.d-B4LODPF1.d.ts → context.d-BJEpEERH.d.ts} +7 -6
  50. package/dist/{context.d-D2fhrjAM.d.cts → context.d-l4HkFJI8.d.cts} +7 -6
  51. package/dist/{copy.d-Bn9eIgkW.d.ts → copy.d-hFRaovog.d.ts} +2 -2
  52. package/dist/{copy.d-DjYhMxxS.d.cts → copy.d-hS49oJ4w.d.cts} +2 -2
  53. package/dist/core/index.cjs +6 -99
  54. package/dist/core/index.d.cts +14 -13
  55. package/dist/core/index.d.ts +14 -13
  56. package/dist/core/index.js +6 -99
  57. package/dist/{depth.d-CsKZkLNi.d.cts → depth.d-BYwddMNU.d.cts} +2 -2
  58. package/dist/{depth.d-DlaIV8TV.d.ts → depth.d-C99_xup2.d.ts} +2 -2
  59. package/dist/{entitlementRepository.d-CpIRpfzy.d.cts → entitlementRepository.d-CiU_QIPL.d.cts} +2 -2
  60. package/dist/{entitlementRepository.d-C5d_6QMi.d.ts → entitlementRepository.d-qZAlET7C.d.ts} +2 -2
  61. package/dist/{focus.d-DOlAaNIU.d.ts → focus.d-CG6KhDBK.d.ts} +2 -2
  62. package/dist/{focus.d-DdBbwzjP.d.cts → focus.d-RJMXplJc.d.cts} +2 -2
  63. package/dist/health-plan/index.cjs +1 -94
  64. package/dist/health-plan/index.d.cts +9 -9
  65. package/dist/health-plan/index.d.ts +9 -9
  66. package/dist/health-plan/index.js +1 -94
  67. package/dist/{idempotency.d-CmQc1OUv.d.ts → idempotency.d-D-ZWpO9p.d.ts} +1 -1
  68. package/dist/{idempotency.d-P4O5lNBq.d.cts → idempotency.d-DJyOZDPb.d.cts} +1 -1
  69. package/dist/{identity.d-BmbAwQYx.d.cts → identity.d-CA7mW59I.d.cts} +1 -1
  70. package/dist/{identity.d-BZXPu9Hi.d.ts → identity.d-DIOnFzXL.d.ts} +1 -1
  71. package/dist/index.cjs +30 -120
  72. package/dist/index.d.cts +14 -13
  73. package/dist/index.d.ts +14 -13
  74. package/dist/index.js +31 -121
  75. package/dist/{introEvents.d-Bqw2Hcpt.d.cts → introEvents.d-7wNDMhEF.d.cts} +1 -1
  76. package/dist/{introEvents.d-Cy8yxOoe.d.ts → introEvents.d-BjqfFgE1.d.ts} +1 -1
  77. package/dist/notifications/inbox/index.cjs +44 -0
  78. package/dist/notifications/inbox/index.d.cts +50 -0
  79. package/dist/notifications/inbox/index.d.ts +50 -0
  80. package/dist/notifications/inbox/index.js +44 -0
  81. package/dist/notifications/index.cjs +18 -98
  82. package/dist/notifications/index.d.cts +12 -6
  83. package/dist/notifications/index.d.ts +12 -6
  84. package/dist/notifications/index.js +18 -98
  85. package/dist/{optInView.d-wGSNOB86.d.ts → optInView.d-B5v4cDDW.d.ts} +2 -2
  86. package/dist/{optInView.d-DXj2w4KU.d.cts → optInView.d-BQhHPleh.d.cts} +2 -2
  87. package/dist/parse.d-DYsx1Q2V.d.cts +168 -0
  88. package/dist/parse.d-Do0sdAgm.d.ts +168 -0
  89. package/dist/{pets.d-CP13kAFa.d.cts → pets.d-DRqMaP8A.d.cts} +1 -1
  90. package/dist/{pets.d-tqGZP3Co.d.ts → pets.d-DVrOb-Bj.d.ts} +1 -1
  91. package/dist/{petsRepository.d-CLyzuoo4.d.ts → petsRepository.d-CpYWRWFq.d.ts} +1 -1
  92. package/dist/{petsRepository.d-CyerzD5G.d.cts → petsRepository.d-tZADfKA1.d.cts} +1 -1
  93. package/dist/photo/index.cjs +1 -94
  94. package/dist/photo/index.js +1 -94
  95. package/dist/records/depth/index.cjs +1 -94
  96. package/dist/records/depth/index.d.cts +9 -9
  97. package/dist/records/depth/index.d.ts +9 -9
  98. package/dist/records/depth/index.js +1 -94
  99. package/dist/records/index.cjs +2 -95
  100. package/dist/records/index.d.cts +10 -10
  101. package/dist/records/index.d.ts +10 -10
  102. package/dist/records/index.js +2 -95
  103. package/dist/{requestFunnel.d-BPWf5SQf.d.ts → requestFunnel.d-B8OVGh0p.d.ts} +2 -2
  104. package/dist/{requestFunnel.d-DocT7FXR.d.cts → requestFunnel.d-C4abgvt9.d.cts} +2 -2
  105. package/dist/{parse.d-MQST1RP3.d.ts → route.d-BAZqGLfl.d.ts} +90 -53
  106. package/dist/{parse.d-C9_UMXfA.d.cts → route.d-CTf8h9vS.d.cts} +90 -53
  107. package/dist/{runtimeTypes.d-CkwEMpy8.d.cts → runtimeTypes.d-DbaQKGLv.d.cts} +39 -5
  108. package/dist/{runtimeTypes.d-D4Cjjf_C.d.ts → runtimeTypes.d-DrIz5e6L.d.ts} +39 -5
  109. package/dist/{screenProps.d-DNTTp7hU.d.ts → screenProps.d-BP8LAZWn.d.ts} +1 -1
  110. package/dist/{screenProps.d-Byla6nJL.d.cts → screenProps.d-Di3wYGCn.d.cts} +1 -1
  111. package/dist/server/events/index.cjs +2 -95
  112. package/dist/server/events/index.d.cts +122 -4
  113. package/dist/server/events/index.d.ts +122 -4
  114. package/dist/server/events/index.js +2 -95
  115. package/dist/server/index.cjs +2 -95
  116. package/dist/server/index.d.cts +3 -3
  117. package/dist/server/index.d.ts +3 -3
  118. package/dist/server/index.js +2 -95
  119. package/dist/shop/index.d.cts +3 -3
  120. package/dist/shop/index.d.ts +3 -3
  121. package/dist/tabs/index.cjs +3 -96
  122. package/dist/tabs/index.d.cts +6 -6
  123. package/dist/tabs/index.d.ts +6 -6
  124. package/dist/tabs/index.js +3 -96
  125. package/dist/televet/booking/index.cjs +11 -103
  126. package/dist/televet/booking/index.d.cts +13 -11
  127. package/dist/televet/booking/index.d.ts +13 -11
  128. package/dist/televet/booking/index.js +11 -103
  129. package/dist/televet/index.cjs +1 -94
  130. package/dist/televet/index.d.cts +3 -3
  131. package/dist/televet/index.d.ts +3 -3
  132. package/dist/televet/index.js +1 -94
  133. package/dist/{televetGlobal.d-CC-DrqkQ.d.ts → televetGlobal.d-B0_jbCtC.d.ts} +7 -0
  134. package/dist/{televetGlobal.d-CKwDCbmN.d.cts → televetGlobal.d-BWYJR391.d.cts} +7 -0
  135. package/dist/testing/index.cjs +1 -94
  136. package/dist/testing/index.d.cts +1 -1
  137. package/dist/testing/index.d.ts +1 -1
  138. package/dist/testing/index.js +1 -94
  139. package/dist/testing/rn/index.cjs +1 -94
  140. package/dist/testing/rn/index.d.cts +8 -7
  141. package/dist/testing/rn/index.d.ts +8 -7
  142. package/dist/testing/rn/index.js +1 -94
  143. package/dist/testing/web/index.cjs +1 -94
  144. package/dist/testing/web/index.d.cts +8 -7
  145. package/dist/testing/web/index.d.ts +8 -7
  146. package/dist/testing/web/index.js +1 -94
  147. package/dist/texting/index.cjs +1 -94
  148. package/dist/texting/index.d.cts +5 -5
  149. package/dist/texting/index.d.ts +5 -5
  150. package/dist/texting/index.js +1 -94
  151. package/dist/{threadOptions.d-jgk_sHrj.d.ts → threadOptions.d-Cwmyu8pc.d.ts} +2 -2
  152. package/dist/{threadOptions.d-CIrevUL8.d.cts → threadOptions.d-REwBuXAY.d.cts} +2 -2
  153. package/dist/{timelineRows.d-BST14weg.d.ts → timelineRows.d-CTlGQTB0.d.ts} +1 -1
  154. package/dist/{timelineRows.d-BEjiHpkP.d.cts → timelineRows.d-CongJG58.d.cts} +1 -1
  155. package/dist/unreadStore.d-gCsleb6l.d.ts +74 -0
  156. package/dist/unreadStore.d-w5x6lEpR.d.cts +74 -0
  157. package/dist/{useHealthPlanSubscription.d-C9kh4mvk.d.ts → useHealthPlanSubscription.d-BSo5kFT9.d.ts} +2 -2
  158. package/dist/{useHealthPlanSubscription.d-CYJi9ZNE.d.cts → useHealthPlanSubscription.d-Br7GKHTt.d.cts} +2 -2
  159. package/dist/useInboxUnread.d-Blxu00eY.d.ts +206 -0
  160. package/dist/useInboxUnread.d-pi6FNnK-.d.cts +206 -0
  161. package/dist/{usePresentation.d-COEh8Xa1.d.cts → usePresentation.d-C6ci1s3j.d.cts} +1 -1
  162. package/dist/{usePresentation.d-WA3sfMpz.d.ts → usePresentation.d-yd9Gh4GB.d.ts} +1 -1
  163. package/dist/{useRecordsDepth.d-DZfdRdIU.d.cts → useRecordsDepth.d-BIDVPfx7.d.cts} +1 -1
  164. package/dist/{useRecordsDepth.d-CAYnVYl1.d.ts → useRecordsDepth.d-C5snbNxR.d.ts} +1 -1
  165. package/dist/{appStateLifecycle.d-_TM06yEk.d.cts → useUnread.d-CORommFJ.d.cts} +49 -14
  166. package/dist/{appStateLifecycle.d-7H_2a9it.d.ts → useUnread.d-w0dKMnx7.d.ts} +49 -14
  167. package/dist/video/index.cjs +1 -94
  168. package/dist/video/index.js +1 -94
  169. package/dist/{view.d-D8soknYh.d.ts → view.d-CK2UN4qn.d.ts} +3 -3
  170. package/dist/{view.d-eM315KIZ.d.cts → view.d-DUhKppyl.d.cts} +3 -3
  171. package/dist/web/consent/index.cjs +1 -94
  172. package/dist/web/consent/index.d.cts +5 -5
  173. package/dist/web/consent/index.d.ts +5 -5
  174. package/dist/web/consent/index.js +1 -94
  175. package/dist/web/health-plan/index.cjs +1 -94
  176. package/dist/web/health-plan/index.d.cts +11 -11
  177. package/dist/web/health-plan/index.d.ts +11 -11
  178. package/dist/web/health-plan/index.js +1 -94
  179. package/dist/web/inbox/index.cjs +49 -0
  180. package/dist/web/inbox/index.d.cts +191 -0
  181. package/dist/web/inbox/index.d.ts +191 -0
  182. package/dist/web/inbox/index.js +49 -0
  183. package/dist/web/index.cjs +28 -118
  184. package/dist/web/index.d.cts +76 -36
  185. package/dist/web/index.d.ts +76 -36
  186. package/dist/web/index.js +28 -118
  187. package/dist/web/intro/index.cjs +3 -96
  188. package/dist/web/intro/index.d.cts +6 -6
  189. package/dist/web/intro/index.d.ts +6 -6
  190. package/dist/web/intro/index.js +3 -96
  191. package/dist/web/notifications/index.cjs +16 -96
  192. package/dist/web/notifications/index.d.cts +8 -3
  193. package/dist/web/notifications/index.d.ts +8 -3
  194. package/dist/web/notifications/index.js +16 -96
  195. package/dist/web/records/depth/index.cjs +1 -94
  196. package/dist/web/records/depth/index.d.cts +9 -9
  197. package/dist/web/records/depth/index.d.ts +9 -9
  198. package/dist/web/records/depth/index.js +1 -94
  199. package/dist/web/records/index.cjs +1 -94
  200. package/dist/web/records/index.d.cts +11 -11
  201. package/dist/web/records/index.d.ts +11 -11
  202. package/dist/web/records/index.js +1 -94
  203. package/dist/web/records-sheet/index.cjs +2 -95
  204. package/dist/web/records-sheet/index.js +2 -95
  205. package/dist/web/shop/index.d.cts +3 -3
  206. package/dist/web/shop/index.d.ts +3 -3
  207. package/dist/web/televet/booking/index.cjs +9 -102
  208. package/dist/web/televet/booking/index.d.cts +18 -11
  209. package/dist/web/televet/booking/index.d.ts +18 -11
  210. package/dist/web/televet/booking/index.js +9 -102
  211. package/dist/web/televet/index.cjs +1 -94
  212. package/dist/web/televet/index.d.cts +3 -3
  213. package/dist/web/televet/index.d.ts +3 -3
  214. package/dist/web/televet/index.js +1 -94
  215. package/dist/web/texting/index.cjs +1 -94
  216. package/dist/web/texting/index.d.cts +5 -5
  217. package/dist/web/texting/index.d.ts +5 -5
  218. package/dist/web/texting/index.js +1 -94
  219. package/notifications/inbox/package.json +8 -0
  220. package/package.json +29 -1
  221. package/web/inbox/native-blocked.cjs +12 -0
  222. package/web/inbox/package.json +8 -0
@@ -1,100 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  "use strict";var zod=require("zod");function ok(value,warning){/* @__PURE__ */
3
3
  return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
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)}};var KNOWN_PARTNER_ROUTES=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","DELETE /widget/v1/me/sms-identity","GET /widget/v1/me/sms-identity","POST /widget/v1/me/sms-identity/verification","POST /widget/v1/me/sms-identity/verification/confirm","PUT /widget/v1/me/sms-identity/selected-pet","GET /widget/v1/pets/{pet_ref}/plan","PUT /widget/v1/pets/{pet_ref}/plan/items/{product_id}","DELETE /widget/v1/pets/{pet_ref}/plan/items/{product_id}","GET /widget/v1/me/intro","PUT /widget/v1/me/intro","GET /widget/v1/pets/{pet_ref}/plan/page","POST /widget/v1/pets/{pet_ref}/plan/events","POST /widget/v1/pets/{pet_ref}/plan/checkout","GET /widget/v1/pets/{pet_ref}/plan/checkout/{checkout_id}","GET /widget/v1/pets/{pet_ref}/plan/subscriptions","POST /widget/v1/pets/{pet_ref}/plan/subscriptions","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/quote","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/offer","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","PATCH /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/skip","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/cancel","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/restart","POST /widget/v1/sessions/revoke","POST /widget/v1/identity/{provider}/session","POST /widget/v1/pets/{pet_ref}/restore","GET /widget/v1/pets/{pet_ref}/card","GET /widget/v1/pets/{pet_ref}/state","GET /widget/v1/diagnostics","GET /widget/v1/records/clinics/{clinic_id}/vets/suggest","PUT /widget/v1/records/clinics/{clinic_id}/vets","GET /widget/v1/records/pets/{pet_ref}/record_mismatches","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/features","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share/email","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","DELETE /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/join","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule","POST /widget/v1/televet/attachments/initiate","GET /widget/v1/televet/messages/threads","GET /widget/v1/televet/messages/threads/{pet_ref}/messages","POST /widget/v1/televet/messages/threads/{pet_ref}/messages","PUT /widget/v1/televet/messages/threads/{pet_ref}/read","GET /widget/v1/televet/consults/{consult_id}/summary","GET /widget/v1/pets/{pet_ref}/profile","GET /widget/v1/embed-config","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent","POST /widget/v1/televet/consults/triage"],KNOWN_ABSENT_ROUTES=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","POST /widget/v1/televet/state-interest"];function pathMatches(template,path){let templateParts=template.split("/"),[withoutQuery=""]=path.split("?"),pathParts=withoutQuery.split("/");return templateParts.length!==pathParts.length?false:templateParts.every((seg,i)=>{let actual=pathParts[i];return actual===void 0?false:seg.startsWith("{")&&seg.endsWith("}")?actual.length>0:seg===actual})}function classifyRoute(method,path){let matches=list=>list.some(entry=>{let[entryMethod,template]=entry.split(" ");return entryMethod===void 0||template===void 0?false:entryMethod===method.toUpperCase()&&pathMatches(template,path)});return matches(KNOWN_PARTNER_ROUTES)?"known":matches(KNOWN_ABSENT_ROUTES)?"absent":"unknown"}var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
5
- /* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
6
- /* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
7
- /* @__PURE__ */Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),
8
- /* @__PURE__ */Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),
9
- /* @__PURE__ */Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),
10
- /* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),
11
- /* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),
12
- /* @__PURE__ */Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),
13
- /* @__PURE__ */Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),
14
- /* @__PURE__ */Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),
15
- /* @__PURE__ */Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),
16
- /* @__PURE__ */Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),
17
- /* @__PURE__ */Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),
18
- /* @__PURE__ */Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),
19
- /* @__PURE__ */Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),
20
- /* @__PURE__ */Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),
21
- /* @__PURE__ */Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),
22
- /* @__PURE__ */Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),
23
- /* @__PURE__ */Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),
24
- /* @__PURE__ */Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),
25
- /* @__PURE__ */Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),
26
- /* @__PURE__ */Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),
27
- /* @__PURE__ */Object.freeze({wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false}),
28
- /* @__PURE__ */Object.freeze({wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false}),
29
- /* @__PURE__ */Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
30
- /* @__PURE__ */Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),
31
- /* @__PURE__ */Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),
32
- /* @__PURE__ */Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
33
- /* @__PURE__ */Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
34
- /* @__PURE__ */Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
35
- /* @__PURE__ */Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
36
- /* @__PURE__ */Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
37
- /* @__PURE__ */Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),
38
- /* @__PURE__ */Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),
39
- /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
40
- /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),
41
- /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),
42
- /* @__PURE__ */Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),
43
- /* @__PURE__ */Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),
44
- /* @__PURE__ */Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),
45
- /* @__PURE__ */Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),
46
- /* @__PURE__ */Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),
47
- /* @__PURE__ */Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),
48
- /* @__PURE__ */Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),
49
- /* @__PURE__ */Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),
50
- /* @__PURE__ */Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),
51
- /* @__PURE__ */Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),
52
- /* @__PURE__ */Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),
53
- /* @__PURE__ */Object.freeze({wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false}),
54
- /* @__PURE__ */Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
55
- /* @__PURE__ */Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
56
- /* @__PURE__ */Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),
57
- /* @__PURE__ */Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
58
- /* @__PURE__ */Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),
59
- /* @__PURE__ */Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
60
- /* @__PURE__ */Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
61
- /* @__PURE__ */Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),
62
- /* @__PURE__ */Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),
63
- /* @__PURE__ */Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),
64
- /* @__PURE__ */Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),
65
- /* @__PURE__ */Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
66
- /* @__PURE__ */Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),
67
- /* @__PURE__ */Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
68
- /* @__PURE__ */Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),
69
- /* @__PURE__ */Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
70
- /* @__PURE__ */Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
71
- /* @__PURE__ */Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
72
- /* @__PURE__ */Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),
73
- /* @__PURE__ */Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
74
- /* @__PURE__ */Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),
75
- /* @__PURE__ */Object.freeze({wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false}),
76
- /* @__PURE__ */Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),
77
- /* @__PURE__ */Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),
78
- /* @__PURE__ */Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
79
- /* @__PURE__ */Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
80
- /* @__PURE__ */Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),
81
- /* @__PURE__ */Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
82
- /* @__PURE__ */Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),
83
- /* @__PURE__ */Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),
84
- /* @__PURE__ */Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
85
- /* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),
86
- /* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
87
- /* @__PURE__ */Object.freeze({wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false}),
88
- /* @__PURE__ */Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),
89
- /* @__PURE__ */Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),
90
- /* @__PURE__ */Object.freeze({wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
91
- /* @__PURE__ */Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),
92
- /* @__PURE__ */Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),
93
- /* @__PURE__ */Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
94
- /* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
95
- /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
96
- /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
97
- /* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict"}),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(wire2){let contractRow=contractErrorFor(wire2);if(contractRow)return contractRow.normalized;let upper=(wire2??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function acceptedFrame(streamId,lastEventId,serverRequestId=null){/* @__PURE__ */
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)}};var KNOWN_PARTNER_ROUTES=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","GET /widget/v1/inbox","GET /widget/v1/inbox/{item_id}","POST /widget/v1/inbox/read","GET /widget/v1/inbox/unread-count","GET /widget/v1/notifications/web-push/config","POST /widget/v1/notifications/web-push/subscriptions","DELETE /widget/v1/notifications/web-push/subscriptions/{subscription_id}","DELETE /widget/v1/me/sms-identity","GET /widget/v1/me/sms-identity","POST /widget/v1/me/sms-identity/verification","POST /widget/v1/me/sms-identity/verification/confirm","PUT /widget/v1/me/sms-identity/selected-pet","GET /widget/v1/pets/{pet_ref}/plan","PUT /widget/v1/pets/{pet_ref}/plan/items/{product_id}","DELETE /widget/v1/pets/{pet_ref}/plan/items/{product_id}","GET /widget/v1/me/intro","PUT /widget/v1/me/intro","GET /widget/v1/pets/{pet_ref}/plan/page","POST /widget/v1/pets/{pet_ref}/plan/events","POST /widget/v1/pets/{pet_ref}/plan/checkout","GET /widget/v1/pets/{pet_ref}/plan/checkout/{checkout_id}","GET /widget/v1/pets/{pet_ref}/plan/subscriptions","POST /widget/v1/pets/{pet_ref}/plan/subscriptions","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/quote","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/offer","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","PATCH /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/skip","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/cancel","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/restart","POST /widget/v1/sessions/revoke","POST /widget/v1/identity/{provider}/session","POST /widget/v1/pets/{pet_ref}/restore","GET /widget/v1/pets/{pet_ref}/card","GET /widget/v1/pets/{pet_ref}/state","GET /widget/v1/diagnostics","GET /widget/v1/records/clinics/{clinic_id}/vets/suggest","PUT /widget/v1/records/clinics/{clinic_id}/vets","GET /widget/v1/records/pets/{pet_ref}/record_mismatches","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/features","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share/email","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","DELETE /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/join","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule","POST /widget/v1/televet/attachments/initiate","GET /widget/v1/televet/messages/threads","GET /widget/v1/televet/messages/threads/{pet_ref}/messages","POST /widget/v1/televet/messages/threads/{pet_ref}/messages","PUT /widget/v1/televet/messages/threads/{pet_ref}/read","GET /widget/v1/televet/consults/{consult_id}/summary","GET /widget/v1/pets/{pet_ref}/profile","GET /widget/v1/embed-config","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent","POST /widget/v1/televet/consults/triage"],KNOWN_ABSENT_ROUTES=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","POST /widget/v1/televet/state-interest"];function pathMatches(template,path){let templateParts=template.split("/"),[withoutQuery=""]=path.split("?"),pathParts=withoutQuery.split("/");return templateParts.length!==pathParts.length?false:templateParts.every((seg,i)=>{let actual=pathParts[i];return actual===void 0?false:seg.startsWith("{")&&seg.endsWith("}")?actual.length>0:seg===actual})}function classifyRoute(method,path){let matches=list=>list.some(entry=>{let[entryMethod,template]=entry.split(" ");return entryMethod===void 0||template===void 0?false:entryMethod===method.toUpperCase()&&pathMatches(template,path)});return matches(KNOWN_PARTNER_ROUTES)?"known":matches(KNOWN_ABSENT_ROUTES)?"absent":"unknown"}var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}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(wire2){let contractRow=contractErrorFor(wire2);if(contractRow)return contractRow.normalized;let upper=(wire2??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function acceptedFrame(streamId,lastEventId,serverRequestId=null){/* @__PURE__ */
98
5
  return Object.freeze({kind:"accepted",streamId:streamId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function heartbeatFrame(lastEventId,serverRequestId=null){/* @__PURE__ */
99
6
  return Object.freeze({kind:"heartbeat",lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function deltaFrame(delta,lastEventId,serverRequestId=null){/* @__PURE__ */
100
7
  return Object.freeze({kind:"delta",delta:delta,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function doneFrame(fields,serverRequestId=null){/* @__PURE__ */
@@ -1,6 +1,6 @@
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
- import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-BFTqU7ft.cjs';
3
+ import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-jCmrhM4a.cjs';
4
4
  import { C as CareOmsOrderSummary, a as CareOmsShopConfig, b as CareOmsOrder, c as CareOmsQuote } from '../omsFields.d-BHntKIAH.cjs';
5
5
  import { k as OmsAddressDetail, a as OmsBuyAgainItem, l as OmsPaymentMethod, f as OmsPlan, m as OmsPlanSkipWarning, n as OmsPrescription } from '../omsErrors.d-VF5tnr20.cjs';
6
6
  import '../EverfurError.d-8NHtlgzA.cjs';
@@ -1,6 +1,6 @@
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
- import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-D_k_rNZZ.js';
3
+ import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-N5Xzy53V.js';
4
4
  import { C as CareOmsOrderSummary, a as CareOmsShopConfig, b as CareOmsOrder, c as CareOmsQuote } from '../omsFields.d-Cvfw8wWU.js';
5
5
  import { k as OmsAddressDetail, a as OmsBuyAgainItem, l as OmsPaymentMethod, f as OmsPlan, m as OmsPlanSkipWarning, n as OmsPrescription } from '../omsErrors.d-VF5tnr20.js';
6
6
  import '../EverfurError.d-8NHtlgzA.js';
@@ -1,100 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import{z}from"zod";function ok(value,warning){/* @__PURE__ */
3
3
  return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
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)}};var KNOWN_PARTNER_ROUTES=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","DELETE /widget/v1/me/sms-identity","GET /widget/v1/me/sms-identity","POST /widget/v1/me/sms-identity/verification","POST /widget/v1/me/sms-identity/verification/confirm","PUT /widget/v1/me/sms-identity/selected-pet","GET /widget/v1/pets/{pet_ref}/plan","PUT /widget/v1/pets/{pet_ref}/plan/items/{product_id}","DELETE /widget/v1/pets/{pet_ref}/plan/items/{product_id}","GET /widget/v1/me/intro","PUT /widget/v1/me/intro","GET /widget/v1/pets/{pet_ref}/plan/page","POST /widget/v1/pets/{pet_ref}/plan/events","POST /widget/v1/pets/{pet_ref}/plan/checkout","GET /widget/v1/pets/{pet_ref}/plan/checkout/{checkout_id}","GET /widget/v1/pets/{pet_ref}/plan/subscriptions","POST /widget/v1/pets/{pet_ref}/plan/subscriptions","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/quote","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/offer","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","PATCH /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/skip","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/cancel","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/restart","POST /widget/v1/sessions/revoke","POST /widget/v1/identity/{provider}/session","POST /widget/v1/pets/{pet_ref}/restore","GET /widget/v1/pets/{pet_ref}/card","GET /widget/v1/pets/{pet_ref}/state","GET /widget/v1/diagnostics","GET /widget/v1/records/clinics/{clinic_id}/vets/suggest","PUT /widget/v1/records/clinics/{clinic_id}/vets","GET /widget/v1/records/pets/{pet_ref}/record_mismatches","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/features","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share/email","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","DELETE /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/join","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule","POST /widget/v1/televet/attachments/initiate","GET /widget/v1/televet/messages/threads","GET /widget/v1/televet/messages/threads/{pet_ref}/messages","POST /widget/v1/televet/messages/threads/{pet_ref}/messages","PUT /widget/v1/televet/messages/threads/{pet_ref}/read","GET /widget/v1/televet/consults/{consult_id}/summary","GET /widget/v1/pets/{pet_ref}/profile","GET /widget/v1/embed-config","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent","POST /widget/v1/televet/consults/triage"],KNOWN_ABSENT_ROUTES=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","POST /widget/v1/televet/state-interest"];function pathMatches(template,path){let templateParts=template.split("/"),[withoutQuery=""]=path.split("?"),pathParts=withoutQuery.split("/");return templateParts.length!==pathParts.length?false:templateParts.every((seg,i)=>{let actual=pathParts[i];return actual===void 0?false:seg.startsWith("{")&&seg.endsWith("}")?actual.length>0:seg===actual})}function classifyRoute(method,path){let matches=list=>list.some(entry=>{let[entryMethod,template]=entry.split(" ");return entryMethod===void 0||template===void 0?false:entryMethod===method.toUpperCase()&&pathMatches(template,path)});return matches(KNOWN_PARTNER_ROUTES)?"known":matches(KNOWN_ABSENT_ROUTES)?"absent":"unknown"}var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
5
- /* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
6
- /* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
7
- /* @__PURE__ */Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),
8
- /* @__PURE__ */Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),
9
- /* @__PURE__ */Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),
10
- /* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),
11
- /* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),
12
- /* @__PURE__ */Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),
13
- /* @__PURE__ */Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),
14
- /* @__PURE__ */Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),
15
- /* @__PURE__ */Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),
16
- /* @__PURE__ */Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),
17
- /* @__PURE__ */Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),
18
- /* @__PURE__ */Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),
19
- /* @__PURE__ */Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),
20
- /* @__PURE__ */Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),
21
- /* @__PURE__ */Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),
22
- /* @__PURE__ */Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),
23
- /* @__PURE__ */Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),
24
- /* @__PURE__ */Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),
25
- /* @__PURE__ */Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),
26
- /* @__PURE__ */Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),
27
- /* @__PURE__ */Object.freeze({wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false}),
28
- /* @__PURE__ */Object.freeze({wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false}),
29
- /* @__PURE__ */Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
30
- /* @__PURE__ */Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),
31
- /* @__PURE__ */Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),
32
- /* @__PURE__ */Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
33
- /* @__PURE__ */Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
34
- /* @__PURE__ */Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
35
- /* @__PURE__ */Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
36
- /* @__PURE__ */Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
37
- /* @__PURE__ */Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),
38
- /* @__PURE__ */Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),
39
- /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
40
- /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),
41
- /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),
42
- /* @__PURE__ */Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),
43
- /* @__PURE__ */Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),
44
- /* @__PURE__ */Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),
45
- /* @__PURE__ */Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),
46
- /* @__PURE__ */Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),
47
- /* @__PURE__ */Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),
48
- /* @__PURE__ */Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),
49
- /* @__PURE__ */Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),
50
- /* @__PURE__ */Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),
51
- /* @__PURE__ */Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),
52
- /* @__PURE__ */Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),
53
- /* @__PURE__ */Object.freeze({wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false}),
54
- /* @__PURE__ */Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
55
- /* @__PURE__ */Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
56
- /* @__PURE__ */Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),
57
- /* @__PURE__ */Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
58
- /* @__PURE__ */Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),
59
- /* @__PURE__ */Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
60
- /* @__PURE__ */Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
61
- /* @__PURE__ */Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),
62
- /* @__PURE__ */Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),
63
- /* @__PURE__ */Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),
64
- /* @__PURE__ */Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),
65
- /* @__PURE__ */Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
66
- /* @__PURE__ */Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),
67
- /* @__PURE__ */Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
68
- /* @__PURE__ */Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),
69
- /* @__PURE__ */Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
70
- /* @__PURE__ */Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
71
- /* @__PURE__ */Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
72
- /* @__PURE__ */Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),
73
- /* @__PURE__ */Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
74
- /* @__PURE__ */Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),
75
- /* @__PURE__ */Object.freeze({wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false}),
76
- /* @__PURE__ */Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),
77
- /* @__PURE__ */Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),
78
- /* @__PURE__ */Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
79
- /* @__PURE__ */Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
80
- /* @__PURE__ */Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),
81
- /* @__PURE__ */Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
82
- /* @__PURE__ */Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),
83
- /* @__PURE__ */Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),
84
- /* @__PURE__ */Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
85
- /* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),
86
- /* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
87
- /* @__PURE__ */Object.freeze({wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false}),
88
- /* @__PURE__ */Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),
89
- /* @__PURE__ */Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),
90
- /* @__PURE__ */Object.freeze({wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
91
- /* @__PURE__ */Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),
92
- /* @__PURE__ */Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),
93
- /* @__PURE__ */Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
94
- /* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
95
- /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
96
- /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
97
- /* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict"}),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(wire2){let contractRow=contractErrorFor(wire2);if(contractRow)return contractRow.normalized;let upper=(wire2??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function acceptedFrame(streamId,lastEventId,serverRequestId=null){/* @__PURE__ */
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)}};var KNOWN_PARTNER_ROUTES=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","GET /widget/v1/inbox","GET /widget/v1/inbox/{item_id}","POST /widget/v1/inbox/read","GET /widget/v1/inbox/unread-count","GET /widget/v1/notifications/web-push/config","POST /widget/v1/notifications/web-push/subscriptions","DELETE /widget/v1/notifications/web-push/subscriptions/{subscription_id}","DELETE /widget/v1/me/sms-identity","GET /widget/v1/me/sms-identity","POST /widget/v1/me/sms-identity/verification","POST /widget/v1/me/sms-identity/verification/confirm","PUT /widget/v1/me/sms-identity/selected-pet","GET /widget/v1/pets/{pet_ref}/plan","PUT /widget/v1/pets/{pet_ref}/plan/items/{product_id}","DELETE /widget/v1/pets/{pet_ref}/plan/items/{product_id}","GET /widget/v1/me/intro","PUT /widget/v1/me/intro","GET /widget/v1/pets/{pet_ref}/plan/page","POST /widget/v1/pets/{pet_ref}/plan/events","POST /widget/v1/pets/{pet_ref}/plan/checkout","GET /widget/v1/pets/{pet_ref}/plan/checkout/{checkout_id}","GET /widget/v1/pets/{pet_ref}/plan/subscriptions","POST /widget/v1/pets/{pet_ref}/plan/subscriptions","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/quote","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/offer","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/one-box","GET /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","PATCH /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/skip","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/cancel","POST /widget/v1/pets/{pet_ref}/plan/subscriptions/{subscription_id}/restart","POST /widget/v1/sessions/revoke","POST /widget/v1/identity/{provider}/session","POST /widget/v1/pets/{pet_ref}/restore","GET /widget/v1/pets/{pet_ref}/card","GET /widget/v1/pets/{pet_ref}/state","GET /widget/v1/diagnostics","GET /widget/v1/records/clinics/{clinic_id}/vets/suggest","PUT /widget/v1/records/clinics/{clinic_id}/vets","GET /widget/v1/records/pets/{pet_ref}/record_mismatches","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/features","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share/email","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","DELETE /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/join","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule","POST /widget/v1/televet/attachments/initiate","GET /widget/v1/televet/messages/threads","GET /widget/v1/televet/messages/threads/{pet_ref}/messages","POST /widget/v1/televet/messages/threads/{pet_ref}/messages","PUT /widget/v1/televet/messages/threads/{pet_ref}/read","GET /widget/v1/televet/consults/{consult_id}/summary","GET /widget/v1/pets/{pet_ref}/profile","GET /widget/v1/embed-config","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent","POST /widget/v1/televet/consults/triage"],KNOWN_ABSENT_ROUTES=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","POST /widget/v1/televet/state-interest"];function pathMatches(template,path){let templateParts=template.split("/"),[withoutQuery=""]=path.split("?"),pathParts=withoutQuery.split("/");return templateParts.length!==pathParts.length?false:templateParts.every((seg,i)=>{let actual=pathParts[i];return actual===void 0?false:seg.startsWith("{")&&seg.endsWith("}")?actual.length>0:seg===actual})}function classifyRoute(method,path){let matches=list=>list.some(entry=>{let[entryMethod,template]=entry.split(" ");return entryMethod===void 0||template===void 0?false:entryMethod===method.toUpperCase()&&pathMatches(template,path)});return matches(KNOWN_PARTNER_ROUTES)?"known":matches(KNOWN_ABSENT_ROUTES)?"absent":"unknown"}var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}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(wire2){let contractRow=contractErrorFor(wire2);if(contractRow)return contractRow.normalized;let upper=(wire2??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function acceptedFrame(streamId,lastEventId,serverRequestId=null){/* @__PURE__ */
98
5
  return Object.freeze({kind:"accepted",streamId:streamId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function heartbeatFrame(lastEventId,serverRequestId=null){/* @__PURE__ */
99
6
  return Object.freeze({kind:"heartbeat",lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function deltaFrame(delta,lastEventId,serverRequestId=null){/* @__PURE__ */
100
7
  return Object.freeze({kind:"delta",delta:delta,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function doneFrame(fields,serverRequestId=null){/* @__PURE__ */