@everfur/sdk 0.1.1 → 0.4.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 (219) hide show
  1. package/CHANGELOG.md +703 -4
  2. package/README.md +63 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-BZZ-Py5l.d.ts +128 -0
  5. package/dist/Chat-Dq4fffIO.d.cts +128 -0
  6. package/dist/DepthViews-BG3E25MD.d.ts +16 -0
  7. package/dist/DepthViews-B_hIypI6.d.cts +19 -0
  8. package/dist/DepthViews-CL75jyRA.d.cts +16 -0
  9. package/dist/DepthViews-CkYri51q.d.ts +19 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-BorG422I.d.cts +146 -0
  21. package/dist/attachments-BrUWQYNK.d.ts +257 -0
  22. package/dist/attachments-D_SECjr1.d.cts +257 -0
  23. package/dist/attachments-DpldrvIW.d.ts +146 -0
  24. package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
  25. package/dist/bookingCopy-SREvkG19.d.cts +732 -0
  26. package/dist/branding-CsRdeNwK.d.cts +566 -0
  27. package/dist/branding-CsRdeNwK.d.ts +566 -0
  28. package/dist/callCopy-DoQKG3-L.d.cts +40 -0
  29. package/dist/callCopy-DoQKG3-L.d.ts +40 -0
  30. package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
  31. package/dist/casesRepository-v6QczS9N.d.ts +51 -0
  32. package/dist/chat/index.cjs +1 -1170
  33. package/dist/chat/index.d.cts +32 -53
  34. package/dist/chat/index.d.ts +32 -53
  35. package/dist/chat/index.js +1 -1167
  36. package/dist/client/index.cjs +9 -2315
  37. package/dist/client/index.d.cts +80 -16
  38. package/dist/client/index.d.ts +80 -16
  39. package/dist/client/index.js +9 -2215
  40. package/dist/{config-CiJ0PVBB.d.ts → config--Wu1Umhd.d.cts} +64 -26
  41. package/dist/{config-BSjBdxrZ.d.cts → config-C7eb_IMD.d.ts} +64 -26
  42. package/dist/consent/index.cjs +1 -0
  43. package/dist/consent/index.d.cts +33 -0
  44. package/dist/consent/index.d.ts +33 -0
  45. package/dist/consent/index.js +1 -0
  46. package/dist/context-CL3lyuy1.d.cts +159 -0
  47. package/dist/context-CahAEha8.d.ts +159 -0
  48. package/dist/copy-DdVFDL01.d.ts +198 -0
  49. package/dist/copy-UeUJVk8X.d.cts +198 -0
  50. package/dist/core/index.cjs +13 -3178
  51. package/dist/core/index.d.cts +164 -29
  52. package/dist/core/index.d.ts +164 -29
  53. package/dist/core/index.js +13 -3166
  54. package/dist/depth-D5HwcvKC.d.cts +533 -0
  55. package/dist/depth-DvPwPuT_.d.ts +533 -0
  56. package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
  57. package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
  58. package/dist/{identity-Brl-lDd6.d.cts → identity-C2-08BZW.d.cts} +20 -7
  59. package/dist/{identity-DK9zORrG.d.ts → identity-CEi9GRFZ.d.ts} +20 -7
  60. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  61. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  62. package/dist/index.cjs +12 -4494
  63. package/dist/index.d.cts +30 -121
  64. package/dist/index.d.ts +30 -121
  65. package/dist/index.js +12 -4470
  66. package/dist/models-B-Uh2LTf.d.ts +214 -0
  67. package/dist/models-D2EUxPZY.d.cts +214 -0
  68. package/dist/notifications/index.cjs +2 -0
  69. package/dist/notifications/index.d.cts +17 -0
  70. package/dist/notifications/index.d.ts +17 -0
  71. package/dist/notifications/index.js +2 -0
  72. package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
  73. package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
  74. package/dist/pets-DJv2sj2H.d.ts +92 -0
  75. package/dist/pets-JVCXgRgR.d.cts +92 -0
  76. package/dist/petsRepository-B_gKbAzJ.d.cts +142 -0
  77. package/dist/petsRepository-Bk6GDwLs.d.ts +142 -0
  78. package/dist/photo/index.cjs +1 -2189
  79. package/dist/photo/index.d.cts +6 -6
  80. package/dist/photo/index.d.ts +6 -6
  81. package/dist/photo/index.js +1 -2186
  82. package/dist/ports-BN6RHF9W.d.cts +48 -0
  83. package/dist/ports-BN6RHF9W.d.ts +48 -0
  84. package/dist/ports-BY2ph0_y.d.cts +376 -0
  85. package/dist/ports-D7YW8qz9.d.ts +376 -0
  86. package/dist/profile-CSs1wlXT.d.cts +93 -0
  87. package/dist/profile-CSs1wlXT.d.ts +93 -0
  88. package/dist/records/depth/index.cjs +2 -0
  89. package/dist/records/depth/index.d.cts +13 -0
  90. package/dist/records/depth/index.d.ts +13 -0
  91. package/dist/records/depth/index.js +2 -0
  92. package/dist/records/index.cjs +3 -2839
  93. package/dist/records/index.d.cts +137 -203
  94. package/dist/records/index.d.ts +137 -203
  95. package/dist/records/index.js +3 -2833
  96. package/dist/requestFunnel-BjDpqqvm.d.cts +110 -0
  97. package/dist/requestFunnel-DFMGcluw.d.ts +110 -0
  98. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  99. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  100. package/dist/{runtime-Bvr8yqXm.d.cts → runtimeTypes-gZEJu-da.d.cts} +104 -132
  101. package/dist/{runtime-BIYzf9cK.d.ts → runtimeTypes-w5KqBMcs.d.ts} +104 -132
  102. package/dist/server/events/index.cjs +2 -0
  103. package/dist/server/events/index.d.cts +550 -0
  104. package/dist/server/events/index.d.ts +550 -0
  105. package/dist/server/events/index.js +2 -0
  106. package/dist/server/index.cjs +2 -533
  107. package/dist/server/index.d.cts +73 -18
  108. package/dist/server/index.d.ts +73 -18
  109. package/dist/server/index.js +2 -530
  110. package/dist/species-BXAIMh7I.d.cts +9 -0
  111. package/dist/species-BXAIMh7I.d.ts +9 -0
  112. package/dist/televet/booking/index.cjs +1 -0
  113. package/dist/televet/booking/index.d.cts +294 -0
  114. package/dist/televet/booking/index.d.ts +294 -0
  115. package/dist/televet/booking/index.js +1 -0
  116. package/dist/televet/call/index.cjs +1 -0
  117. package/dist/televet/call/index.d.cts +141 -0
  118. package/dist/televet/call/index.d.ts +141 -0
  119. package/dist/televet/call/index.js +1 -0
  120. package/dist/televet/index.cjs +1 -0
  121. package/dist/televet/index.d.cts +142 -0
  122. package/dist/televet/index.d.ts +142 -0
  123. package/dist/televet/index.js +1 -0
  124. package/dist/testing/index.cjs +5 -823
  125. package/dist/testing/index.d.cts +18 -4
  126. package/dist/testing/index.d.ts +18 -4
  127. package/dist/testing/index.js +5 -820
  128. package/dist/testing/rn/index.cjs +1 -449
  129. package/dist/testing/rn/index.d.cts +18 -29
  130. package/dist/testing/rn/index.d.ts +18 -29
  131. package/dist/testing/rn/index.js +1 -444
  132. package/dist/testing/web/index.cjs +1 -0
  133. package/dist/testing/web/index.d.cts +132 -0
  134. package/dist/testing/web/index.d.ts +132 -0
  135. package/dist/testing/web/index.js +1 -0
  136. package/dist/timelineRows-C15jxFFH.d.ts +19 -0
  137. package/dist/timelineRows-odO8g9r2.d.cts +19 -0
  138. package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
  139. package/dist/typeStyle-DmoyacDG.d.ts +111 -0
  140. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  141. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  142. package/dist/useRecordsDepth-C6rjEaLn.d.cts +237 -0
  143. package/dist/useRecordsDepth-crhBllQK.d.ts +237 -0
  144. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  145. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  146. package/dist/video/index.cjs +1 -1941
  147. package/dist/video/index.d.cts +4 -4
  148. package/dist/video/index.d.ts +4 -4
  149. package/dist/video/index.js +1 -1938
  150. package/dist/view-Bxwxp4xD.d.ts +310 -0
  151. package/dist/view-DyitEO0m.d.cts +310 -0
  152. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  153. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  154. package/dist/web/consent/index.cjs +1 -0
  155. package/dist/web/consent/index.d.cts +34 -0
  156. package/dist/web/consent/index.d.ts +34 -0
  157. package/dist/web/consent/index.js +1 -0
  158. package/dist/web/index.cjs +14 -0
  159. package/dist/web/index.d.cts +218 -0
  160. package/dist/web/index.d.ts +218 -0
  161. package/dist/web/index.js +14 -0
  162. package/dist/web/notifications/index.cjs +2 -0
  163. package/dist/web/notifications/index.d.cts +213 -0
  164. package/dist/web/notifications/index.d.ts +213 -0
  165. package/dist/web/notifications/index.js +2 -0
  166. package/dist/web/records/depth/index.cjs +2 -0
  167. package/dist/web/records/depth/index.d.cts +12 -0
  168. package/dist/web/records/depth/index.d.ts +12 -0
  169. package/dist/web/records/depth/index.js +2 -0
  170. package/dist/web/records/index.cjs +4 -0
  171. package/dist/web/records/index.d.cts +285 -0
  172. package/dist/web/records/index.d.ts +285 -0
  173. package/dist/web/records/index.js +4 -0
  174. package/dist/web/televet/booking/index.cjs +1 -0
  175. package/dist/web/televet/booking/index.d.cts +349 -0
  176. package/dist/web/televet/booking/index.d.ts +349 -0
  177. package/dist/web/televet/booking/index.js +1 -0
  178. package/dist/web/televet/call/index.cjs +1 -0
  179. package/dist/web/televet/call/index.d.cts +142 -0
  180. package/dist/web/televet/call/index.d.ts +142 -0
  181. package/dist/web/televet/call/index.js +1 -0
  182. package/dist/web/televet/index.cjs +1 -0
  183. package/dist/web/televet/index.d.cts +136 -0
  184. package/dist/web/televet/index.d.ts +136 -0
  185. package/dist/web/televet/index.js +1 -0
  186. package/notifications/package.json +8 -0
  187. package/package.json +266 -10
  188. package/records/depth/package.json +8 -0
  189. package/server/events/device-blocked.cjs +15 -0
  190. package/server/events/package.json +9 -0
  191. package/televet/booking/package.json +8 -0
  192. package/televet/call/package.json +8 -0
  193. package/televet/package.json +8 -0
  194. package/testing/web/native-blocked.cjs +12 -0
  195. package/testing/web/package.json +8 -0
  196. package/web/consent/native-blocked.cjs +12 -0
  197. package/web/consent/package.json +8 -0
  198. package/web/native-blocked.cjs +12 -0
  199. package/web/notifications/native-blocked.cjs +12 -0
  200. package/web/notifications/package.json +8 -0
  201. package/web/package.json +8 -0
  202. package/web/records/depth/native-blocked.cjs +12 -0
  203. package/web/records/depth/package.json +8 -0
  204. package/web/records/native-blocked.cjs +12 -0
  205. package/web/records/package.json +8 -0
  206. package/web/televet/booking/native-blocked.cjs +12 -0
  207. package/web/televet/booking/package.json +8 -0
  208. package/web/televet/call/native-blocked.cjs +12 -0
  209. package/web/televet/call/package.json +8 -0
  210. package/web/televet/native-blocked.cjs +12 -0
  211. package/web/televet/package.json +8 -0
  212. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  213. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  214. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  215. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  216. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  217. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  218. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  219. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -0,0 +1,2 @@
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Nr=Object.defineProperty;var o=(e,r)=>Nr(e,"name",{value:r,configurable:true});function Oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Oe(e[r]);}return e}o(Oe,"deepFreeze");var Lr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),st={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},lt={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},at={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Mr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Vr={regular:"400",medium:"500",bold:"700"},qr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Br=0,pe="System",ye="monospace",Ur=["content","heading","control","compact","badge"];function Hr(e){let r={};for(let t of Ur)r[t]=e;return r}o(Hr,"authoredTierSizes");function dt(){return {family:pe,mono:ye,fontUrl:null,families:{regular:pe,medium:pe,bold:pe,mono:ye,monoMedium:ye,monoBold:ye},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:at,tierSizes:Hr(at),lineHeight:Mr,weight:Vr,letterSpacing:qr,scale:1,maxScale:Br,scaleCaps:Lr}}o(dt,"baseType");var ct={},Te=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ke(e){return `cubic-bezier(${e.join(", ")})`}o(ke,"cssCubicBezier");var ut={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ke(Te.standard),emphasized:ke(Te.emphasized),exit:ke(Te.exit)},reducedMotion:false},Wr={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},pt=Oe({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Wr,space:st,radius:lt,type:dt(),motion:ut,slots:ct}),$r={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Oe({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:$r,space:st,radius:lt,type:dt(),motion:ut,slots:ct});var yt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ft=globalThis,Fe=ft[yt]??(ft[yt]=react.createContext(pt));Fe.displayName??="EverfurThemeContext";function w(){return react.useContext(Fe)}o(w,"useEverfurTheme");function Jr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Jr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Jr(t,e);return react.createElement(reactNative.Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(g,"Text");react.forwardRef(o(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function J(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}o(J,"slotBox");function Z(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(Z,"slotText");var Zr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function S(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[Zr[r]]}}o(S,"face");function gt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(gt,"reportHostFailure");function en(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(en,"isThenable");function tn(e,...r){if(typeof e=="function")try{let t=e(...r);return en(t)&&Promise.resolve(t).then(void 0,gt),t}catch(t){gt(t);return}}o(tn,"callHost");var bt=new WeakMap;function ee(e){if(typeof e!="function")return;let r=bt.get(e);if(r!==void 0)return r;let t=o((...n)=>{tn(e,...n);},"guarded");return bt.set(e,t),t}o(ee,"guardHost");var W=Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});var rn="your pet";function V(e){let r=e?.trim()??"";return r.length>0?r:rn}o(V,"petNameOr");var ht=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${V(e)}\u2019s lab trends`,"lead"),retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:o(e=>`Important: ${e}`,"important")});Object.freeze({title:"Marker Summary",marker:"Marker",markers:"Markers",outOfRange:"OUT OF RANGE",inRange:"IN RANGE",noRange:"NO RANGE",subtitle:"Summary of your pet\u2019s biomarkers",ask:"Ask about these markers",askA11y:"Ask Everfur about these markers",a11y:o((e,r,t,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${r} in range, ${t} out of range${n>0?`, ${n} without a range`:""}.`,"a11y")});Object.freeze({counter:o((e,r)=>`${e+1} of ${r}`,"counter"),a11y:o((e,r,t)=>e!==null?`${e}, marker ${r+1} of ${t}. Swipe left or right to see more markers.`:`Marker ${r+1} of ${t}`,"a11y")});Object.freeze({tapHint:"Tap a point to see where it came from.",singleHint:"One reading so far: we\u2019ll plot a trend as more come in.",empty:"No readings for this marker yet.",ask:"Ask about this marker",askA11y:o(e=>`Ask Everfur about ${e}`,"askA11y"),status:o(e=>`Status: ${e}`,"status"),latestA11y:o((e,r,t)=>`Latest reading ${e}, ${r}, collected ${t}`,"latestA11y"),readingsA11y:o(e=>`${e} readings, oldest to newest`,"readingsA11y")});Object.freeze({title:o(e=>`${V(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${V(e)}\u2019s records from your vet. This usually takes a few days; we\u2019ll show lab trends here as soon as they arrive.`,"body"),a11y:o(e=>`Records request in progress for ${V(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${V(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${V(e)}\u2019s records`,"title"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicA11y:o(e=>`Request ${V(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${V(e)}\u2019s records`,"uploadDocumentA11y")});function Rt(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(Rt,"recordsEmptyVariantForError");function _t(e,r){return e===null?"":r?`${e} ${r}`:e}o(_t,"formatEntityValue");var vt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let a=vt[Number(r[2])-1];return a===void 0?"-":`${a} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${vt[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(O,"formatRecordsDate");var b=Object.freeze({timeline:"Timeline",loadingTimeline:"Loading timeline",labResults:"Blood & lab work",visits:"Visits",physicalExams:"Physical exams",visitNotes:"Visit notes",visit:"Visit",exam:"Exam",visitNote:"Visit note",notRecorded:"Not recorded",abnormal:"Abnormal",notExamined:"Not examined",normal:"Normal",measured:o(e=>`Measured ${e}`,"measured"),uploadedDocument:"Uploaded document",kind:Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:o(e=>`Dr. ${e}`,"doctor"),lot:o(e=>`Lot ${e}`,"lot"),expires:o(e=>`Expires ${e}`,"expires")});function xt(e){switch(e){case "above":return {label:"Above range",outOfRange:true};case "below":return {label:"Below range",outOfRange:true};case "in_range":return {label:"In range",outOfRange:false};default:return {label:"No range on file",outOfRange:false}}}o(xt,"markerStatusLabel");function nn(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(nn,"trajectoryLabel");function fe(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(fe,"humanize");var Et=Object.freeze({general:"General / attitude",eent:"Eyes, ears, nose & throat",oral_dental:"Oral & dental",cardiovascular:"Cardiovascular",respiratory:"Respiratory",gastrointestinal:"GI / abdomen",urogenital:"Urogenital",musculoskeletal:"Musculoskeletal",neurologic:"Neurologic",integument:"Skin & coat",lymphatic:"Lymph nodes"});function Ie(e){return Object.prototype.hasOwnProperty.call(Et,e)?Et[e]:fe(e)}o(Ie,"bodySystemLabel");var wt=Object.freeze({reason_for_visit:"Reason for visit",subjective:"Subjective",objective:"Objective",assessment:"Assessment",plan:"Plan",discharge_instructions:"Discharge instructions",follow_up:"Follow-up",remarks:"Notes"});function Ct(e){return Object.prototype.hasOwnProperty.call(wt,e)?wt[e]:fe(e)}o(Ct,"soapSectionLabel");function St(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(St,"formatWeightKg");function De(e,r,t){if((e===null||!Number.isFinite(e))&&t)return t;if(e===null||!Number.isFinite(e))return "-";let n=e.toFixed(3).replace(/\.?0+$/,"");return r?`${n} ${r}`:n}o(De,"formatMarkerReading");function Tt(e,r,t){let n=nn(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(Tt,"labDetailLine");var me=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function kt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(kt,"toMillis");function Pe(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:b.kind.visit,at:t.visitDate,date:O(t.visitDate),title:t.summary??b.clinicVisit,detail:t.veterinarian?b.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let a=[];return t.lot&&a.push(b.lot(t.lot)),t.expiresOn&&a.push(b.expires(O(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:b.kind.vaccine,at:t.administeredOn,date:O(t.administeredOn),title:t.product||b.kind.vaccine,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:b.kind.weight,at:t.observedOn,date:O(t.observedOn),title:St(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(l=>!!l);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:b.kind.medication,at:t.startedOn,date:O(t.startedOn),title:t.drugName||b.kind.medication,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let a=kt(t.at),l=kt(n.at);return a===null&&l===null?me[t.kind]-me[n.kind]:a===null?1:l===null?-1:l!==a?l-a:me[t.kind]-me[n.kind]}))}o(Pe,"buildTimelineRows");var Ae=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Ae.map(e=>e.wireCode));var on=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),Ft=Object.freeze(Ae.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:on[e.wireCode]}))),an=new Map(Ft.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),sn=Object.freeze(["http_envelope",...[...new Set(Ft.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ge(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...sn]){let a=an.get(n+t);if(a)return a}}o(ge,"contractErrorFor");function ln(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(ln,"contractDocUrl");function It(e){return null}o(It,"publishedDocUrl");var dn=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Dt(e){return dn[e]}o(Dt,"categoryFor");function Pt(e){let r=ge(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Pt,"fromWire");var cn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function je(e){return cn.has(e)}o(je,"isAutoRetryable");var un=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function At(e){return je(e)||un.has(e)}o(At,"isRetryableCode");var pn=500,ze=8e3,jt=4;function zt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(pn*2**t,ze);return Math.floor(r()*n)}o(zt,"backoffDelayMs");var yn=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Ne(e){return yn[e]}o(Ne,"userFacingError");function Nt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Nt,"defineHidden");var fn=/^[a-z][a-z0-9_]{0,63}$/;function q(e,r){let t=ge(r?.wireCode,r?.wireEnvelope),n={code:e,category:Dt(e),retryable:r?.retryable??At(e),displayMessage:Ne(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&fn.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Nt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Nt(n,"raw",r.raw),Object.freeze(n)}o(q,"makeEverfurError");function $(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o($,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var be=class be extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,be.prototype);}};o(be,"EverfurConfigError");var te=be;function Lt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Lt,"assertNever");function Mt(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Mt,"errorFrame");function bn(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(bn,"authHeaders");function re(e,r){return {...e,headers:{...hn(e.headers),...bn(r)}}}o(re,"withAuthHeaders");function hn(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=n);}return r}o(hn,"stripAuthHeaders");async function Vt(e,r){if(r.mode==="anonymous")return r.transport.request(re(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return F(Le())}let n=await r.transport.request(re(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return F(Le())}let l=await r.transport.request(re(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?F(Le(l.error.httpStatus)):l}o(Vt,"authedSend");function Le(e){return q("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Le,"authRejectedError");function qt(e){return q("internalError",{retryable:true,wireMessage:Rn(e)})}o(qt,"networkError");function Rn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Rn,"describeCause");var vn=3e4,_n=ze*2,En="idempotency-key",wn=new Set(["POST","PUT","PATCH","DELETE"]),xn=Object.freeze({onEvent(){}}),Cn=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Sn(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(Sn,"seededIdempotencyKey");function Ut(e){let r=e.observer??xn,t=e.timers??Cn,n=e.rng??Math.random,a=e.sleep??((h,E)=>Mn(h,t,E)),l=e.maxAttempts??jt,s=e.unaryTimeoutMs??vn,c=e.newIdempotencyKey??kn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??l),j=C?.idempotent??wn.has(E.method),z=C?.idempotencyKey===void 0?null:Sn(C.idempotencyKey),H=j?z??c():null,zr=Tn(E,H),xe=0;for(;;){let X=o(Se=>Object.freeze({call:h,method:E.method,path:E.path,attempt:xe,...H?{idempotencyKey:H}:{},...Se}),"stamp");i(X({phase:"attempt"}));let ot=Nn(s,t),it=Ln(ot.signal,E.signal),Q;try{Q=await Vt({...zr,signal:it.signal},e.auth);}catch(Se){Q=F(qt(Se));}finally{it.dispose(),ot.cancel();}if(Q.ok)return i(X({phase:"settled",ok:true,reason:"ok"})),Q;let M=Q.error,ue=Fn(M,xe,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Ce={ok:false,code:M.code,reason:ue.reason,...M.httpStatus!==void 0?{httpStatus:M.httpStatus}:{},...M.requestId!==void 0?{requestId:M.requestId}:{}};if(!ue.retry)return i(X({phase:"settled",...Ce})),F(M);if(i(X({phase:"retry",...Ce,delayMs:ue.delayMs})),await a(ue.delayMs,E.signal),E.signal?.aborted===true)return i(X({phase:"settled",...Ce,reason:"aborted"})),F(M);xe+=1;}}o(u,"send");async function y(h){return re(h,await zn(e.auth))}o(y,"authorize");async function*_(h,E,C){i(Object.freeze({call:h,phase:"stream.open",method:E.method,path:E.path,attempt:0}));try{yield*e.auth.transport.stream(E,C);}catch{yield Mt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(Ut,"createRequestFunnel");function Tn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==En&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(Tn,"assembleHeaders");function kn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(kn,"defaultIdempotencyKeyFactory");var On=10;function Fn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=In(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!je(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(On,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??s()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=Dn(e,t.now);return i!==null?i>_n?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:zt(r,t.rng)}}o(Fn,"decideRetry");function In(e){let r=e.code==="unknown"?Pt(jn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(In,"throttleKind");function Dn(e,r){let t=Pn(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(Dn,"retryOverrideMs");function Pn(e){for(let r of Ht(e)){let t=r.resets_at,n=An(t);if(n!==null)return n}return null}o(Pn,"findResetsAt");function Ht(e){if(!Bt(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Bt(n)&&r.push(n);}return r}o(Ht,"candidateScopes");function An(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(An,"parseInstantMs");function jn(e){for(let r of Ht(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(jn,"rawWireCode");function Bt(e){return typeof e=="object"&&e!==null}o(Bt,"isRecord");async function zn(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(zn,"resolveDeviceAuth");function Nn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Nn,"boundedSignal");function Ln(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}o(Ln,"mergeSignals");function Mn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",l),n();},e),l=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",l,{once:true});})}o(Mn,"delayAbortable");function Wt(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(Wt,"hasLoneSurrogate");var $t=64,Gt=512;function qn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(qn,"normalizeOrigin");zod.z.object({request_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),status:zod.z.string(),simple_status:zod.z.string().nullish(),simple_status_detail:zod.z.string().nullish(),status_label:zod.z.string().optional(),dispatch_status:zod.z.string().nullish(),can_retry_send:zod.z.boolean().optional(),can_revoke:zod.z.boolean().optional(),can_convert_to_upload:zod.z.boolean().optional(),can_update_clinic_email:zod.z.boolean().optional(),reminder_count:zod.z.number().int().nonnegative().optional(),last_reminder_at:zod.z.string().nullish(),waiting_expectation:zod.z.string().nullish(),document_count:zod.z.number().optional(),held_item_count:zod.z.number().optional(),received_at:zod.z.string().nullish(),parsing_started_at:zod.z.string().nullish(),review_started_at:zod.z.string().nullish(),created_at:zod.z.string().optional(),updated_at:zod.z.string().optional(),source:zod.z.string().nullish().catch(null),action_needed_label:zod.z.string().nullish().catch(null),failure_reason:zod.z.string().nullish().catch(null),failure_code:zod.z.string().nullish().catch(null),recovery_stage:zod.z.string().nullish().catch(null),show_clinic_phone:zod.z.boolean().optional().catch(void 0),clinic_name:zod.z.string().nullish().catch(null),clinic_email:zod.z.string().nullish().catch(null),clinic_phone:zod.z.string().nullish().catch(null),converted_to_upload_at:zod.z.string().nullish().catch(null),request_group_id:zod.z.string().nullish().catch(null)}).passthrough();zod.z.object({request_group_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),total:zod.z.number().int().nonnegative(),responded:zod.z.number().int().nonnegative(),pending:zod.z.number().int().nonnegative(),members:zod.z.array(zod.z.unknown())});zod.z.object({source_doc_id:zod.z.string().min(1),request_id:zod.z.string().min(1)});var Bn=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Me=zod.z.object({key:zod.z.string(),category:zod.z.string().optional(),label:zod.z.string().optional(),value:zod.z.string().nullish(),unit:zod.z.string().nullish(),observed_at:zod.z.string().nullish(),status:zod.z.string().nullish(),origin:zod.z.string().nullish(),canonical_key:zod.z.string().nullish()}),Un=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),Hn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Un).optional()}),Wn=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),Ve=zod.z.object({doc_id:zod.z.string(),title:zod.z.string().nullish(),page_count:zod.z.number().nullish(),received_at:zod.z.string().nullish()});function Yt(e){return Object.freeze({key:e.key,category:e.category??"",label:e.label??e.key,value:e.value??null,unit:e.unit??null,observedAt:e.observed_at??null,status:e.status??null,origin:qn(e.origin),canonicalKey:e.canonical_key??null})}o(Yt,"mapEntityRow");function Kt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Kt,"mapDocumentRow");zod.z.object({identity:zod.z.array(Bn).optional(),entities:zod.z.array(Me).optional(),entity_series:zod.z.array(Hn).optional(),forward_looking:zod.z.array(Wn).optional(),documents:zod.z.array(Ve).optional()});zod.z.object({pet_ref:zod.z.string().optional(),granted:zod.z.boolean().optional(),version:zod.z.string().nullish(),granted_at:zod.z.string().nullish()});var v=zod.z.string().nullish(),he=zod.z.number().nullish(),$n=zod.z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,ref_low:he,ref_high:he,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:zod.z.boolean().nullish()}),Gn=zod.z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,status:v}),Yn=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:v,name:v,loinc_code:v,canonical_unit:v,unit:v,panel_name:v,panel:v,meaning_text:v,meaning:v,latest:Gn.nullish(),trajectory:v,points:zod.z.array($n).optional()}),Kn=zod.z.object({total_markers:zod.z.number().int().nonnegative(),in_range_count:zod.z.number().int().nonnegative(),out_of_range_count:zod.z.number().int().nonnegative(),unknown_count:zod.z.number().int().nonnegative()}),Xn=zod.z.object({markers:zod.z.array(Yn).optional(),summary:Kn.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:v});function Qn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Qn,"isObject");function Xt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Xt,"withheldMarkers");function Qt(e,r){let t=Qn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Xt(n);let a=Xn.safeParse(t);if(!a.success)return Xt(n);let l=a.data,s=o(i=>Object.freeze({at:i.collected_at??i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,sourceClinic:i.source_clinic??null,docId:i.source_doc_id??i.doc_id??null,reviewed:i.reviewed===true}),"point"),c=(l.markers??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.canonical_name??i.name??i.marker_id,loincCode:i.loinc_code??null,unit:i.canonical_unit??i.unit??null,panel:i.panel_name??i.panel??null,meaning:i.meaning_text??i.meaning??null,latest:i.latest?Object.freeze({at:i.latest.collected_at??i.latest.at??null,value:i.latest.value??null,unit:i.latest.unit??null,qualitativeResult:i.latest.qualitative_result??null,status:i.latest.status??null}):null,trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(s))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:l.summary?Object.freeze({totalMarkers:l.summary.total_markers,inRangeCount:l.summary.in_range_count,outOfRangeCount:l.summary.out_of_range_count,unknownCount:l.summary.unknown_count}):null,disclaimer:l.disclaimer??"",featuredMarkerId:l.featured_marker_id??null})}o(Qt,"mapRecordMarkers");var Jt=128,B=128;var Jn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),Zn=zod.z.object({source_doc_id:zod.z.string().min(1),file_name:zod.z.string().nullish(),doc_format:zod.z.string().nullish(),byte_size:zod.z.number().int().nonnegative().nullish(),received_at:zod.z.string().nullish(),download_url:Jn,expires_in_seconds:zod.z.number().int().nonnegative().nullish()}),eo=zod.z.object({items:zod.z.array(zod.z.unknown()).optional()});function Zt(e){let r=eo.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let a=Zn.safeParse(n);a.success&&t.push(Object.freeze({sourceDocId:a.data.source_doc_id,fileName:a.data.file_name??null,docFormat:a.data.doc_format??null,byteSize:a.data.byte_size??null,receivedAt:a.data.received_at??null,downloadUrl:a.data.download_url,expiresInSeconds:a.data.expires_in_seconds??0}));}return Object.freeze(t)}o(Zt,"mapRequestDocuments");var to=zod.z.string().min(1).refine(e=>e.startsWith("https://")),ne=zod.z.string().nullish(),ro=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:ne}),no=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:ne,created_at:ne,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:ne})).optional()}),oo=zod.z.object({download_url:to,expires_at:ne});function io(e,r){let t=e.trim();if(t.length===0)return null;try{let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?new URL(t):r!==void 0?new URL(t,r):null;return n===null||n.protocol!=="https:"?null:n.toString()}catch{return null}}o(io,"resolveShareUrl");function er(e,r){let t=ro.safeParse(e);if(!t.success)return null;let n=io(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null})}o(er,"mapRecordShareLink");function tr(e){let r=no.safeParse(e);return r.success?Object.freeze((r.data.shares??[]).map(t=>Object.freeze({shareId:t.share_id,expiresAt:t.expires_at??null,createdAt:t.created_at??null,viewCount:t.view_count??0,lastViewedAt:t.last_viewed_at??null}))):null}o(tr,"mapRecordShareList");function rr(e){let r=oo.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(rr,"mapRecordPdfLink");var ao=zod.z.object({signatures:zod.z.array(zod.z.object({signature_id:zod.z.string().min(1),preview_url:zod.z.string().min(1).refine(e=>e.startsWith("https://")),created_at:zod.z.string().nullish()})).optional()});function nr(e){let r=ao.safeParse(e);return r.success?Object.freeze((r.data.signatures??[]).map(t=>Object.freeze({signatureId:t.signature_id,previewUrl:t.preview_url,createdAt:t.created_at??null}))):null}o(nr,"mapSignatureSuggestions");var m=zod.z.string().nullish(),oe=zod.z.number().nullish(),so=zod.z.object({at:m,value:oe,unit:m,qualitative_result:m,ref_low:oe,ref_high:oe,status:m,doc_id:m}),lo=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:zod.z.object({at:m,value:oe,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:zod.z.array(so).optional()}),co=zod.z.object({encounter_id:zod.z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),uo=zod.z.object({note_id:zod.z.string(),encounter_id:m,observed_on:m,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),po=zod.z.object({exam_id:zod.z.string(),encounter_id:m,observed_on:m,doc_id:m,systems:zod.z.record(zod.z.object({finding_status:m,finding:m})).optional()}),yo=zod.z.object({has_lab_history:zod.z.boolean().optional(),has_vaccination_history:zod.z.boolean().optional(),has_weight_history:zod.z.boolean().optional(),has_vitals_history:zod.z.boolean().optional(),has_physical_exam_history:zod.z.boolean().optional(),has_procedure_history:zod.z.boolean().optional(),has_genetic_history:zod.z.boolean().optional(),has_reproductive_history:zod.z.boolean().optional(),has_parasite_prevention_history:zod.z.boolean().optional(),earliest_record_at:m,latest_record_at:m,documents_ingested:zod.z.number().int().nonnegative().optional(),documents_in_review:zod.z.number().int().nonnegative().optional(),entities_pending_review:zod.z.record(zod.z.number().int().nonnegative()).optional(),held_total:zod.z.number().int().nonnegative().optional()}),fo=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:m,severity:m,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:m,doc_id:m,collected_at:m})).optional()}),mo=zod.z.object({lab_results:zod.z.array(lo).optional(),encounters:zod.z.array(co).optional(),clinician_notes:zod.z.array(uo).optional(),physical_exams:zod.z.array(po).optional(),completeness:yo.nullish(),conflicts:zod.z.array(fo).optional()}),go=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:m,veterinarian:m,summary:m,doc_id:m})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:m,lot:m,administered_on:m,expires_on:m,doc_id:m})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:m,weight_kg:oe,doc_id:m})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:m,dose:m,route:m,frequency:m,sig:m,rx_number:m,started_on:m,stopped_on:m,doc_id:m})),disclaimer:zod.z.string().optional()}),bo=zod.z.object({document:Ve,contributions:zod.z.array(Me),contribution_count:zod.z.number().int().nonnegative().optional()});function Be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Be,"isObject");function Ue(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(Ue,"petOf");function qe(e,r){return Object.freeze({petRef:e,available:false,withheld:r,labResults:Object.freeze([]),encounters:Object.freeze([]),clinicianNotes:Object.freeze([]),physicalExams:Object.freeze([]),completeness:null,conflicts:Object.freeze([])})}o(qe,"emptyDepth");function ir(e,r){let t=Be(r)?r:{},n=Ue(t,e);if(t.withheld===true)return qe(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return qe(n,false);let l=mo.safeParse(t);if(!l.success)return qe(n,true);let s=l.data,c=o(i=>Object.freeze({at:i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,docId:i.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((s.lab_results??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.name,loincCode:i.loinc_code??null,unit:i.unit??null,panel:i.panel??null,meaning:i.meaning??null,latest:Object.freeze({at:i.latest?.at??null,value:i.latest?.value??null,unit:i.latest?.unit??null,qualitativeResult:i.latest?.qualitative_result??null,status:i.latest?.status??null}),trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(c))}))),encounters:Object.freeze((s.encounters??[]).map(i=>Object.freeze({encounterId:i.encounter_id,date:i.date??null,type:i.type??null,clinicName:i.clinic_name??null,veterinarian:i.veterinarian??null,docId:i.doc_id??null}))),clinicianNotes:Object.freeze((s.clinician_notes??[]).map(i=>Object.freeze({noteId:i.note_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,sections:Object.freeze((i.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((s.physical_exams??[]).map(i=>Object.freeze({examId:i.exam_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,docId:i.doc_id??null,systems:Object.freeze(Object.entries(i.systems??{}).map(([u,y])=>Object.freeze({system:u,findingStatus:y.finding_status??null,finding:y.finding??null})))}))),completeness:s.completeness?Object.freeze({hasLabHistory:s.completeness.has_lab_history===true,hasVaccinationHistory:s.completeness.has_vaccination_history===true,hasWeightHistory:s.completeness.has_weight_history===true,hasVitalsHistory:s.completeness.has_vitals_history===true,hasPhysicalExamHistory:s.completeness.has_physical_exam_history===true,hasProcedureHistory:s.completeness.has_procedure_history===true,hasGeneticHistory:s.completeness.has_genetic_history===true,hasReproductiveHistory:s.completeness.has_reproductive_history===true,hasParasitePreventionHistory:s.completeness.has_parasite_prevention_history===true,earliestRecordAt:s.completeness.earliest_record_at??null,latestRecordAt:s.completeness.latest_record_at??null,documentsIngested:s.completeness.documents_ingested??0,documentsInReview:s.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...s.completeness.entities_pending_review??{}}),heldTotal:s.completeness.held_total??0}):null,conflicts:Object.freeze((s.conflicts??[]).map(i=>Object.freeze({conflictId:i.conflict_id,entityType:i.entity_type,field:i.field??null,severity:i.severity??"needs_review",candidates:Object.freeze((i.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(ir,"mapRecordDepth");function or(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(or,"withheldTimeline");function ar(e,r){let t=Be(r)?r:{},n=Ue(t,e);if(t.withheld===true)return or(n);let a=go.safeParse(t);if(!a.success)return or(n);let l=a.data,s=l.visits.map(y=>Object.freeze({visitId:y.visit_id,visitDate:y.visit_date??null,veterinarian:y.veterinarian??null,summary:y.summary??null,docId:y.doc_id??null})),c=l.vaccines.map(y=>Object.freeze({vaccineId:y.vaccine_id,product:y.product??null,lot:y.lot??null,administeredOn:y.administered_on??null,expiresOn:y.expires_on??null,docId:y.doc_id??null})),i=l.weights.map(y=>Object.freeze({weightId:y.weight_id,observedOn:y.observed_on??null,weightKg:y.weight_kg??null,docId:y.doc_id??null})),u=l.medications.map(y=>Object.freeze({medicationId:y.medication_id,drugName:y.drug_name??null,dose:y.dose??null,route:y.route??null,frequency:y.frequency??null,sig:y.sig??null,rxNumber:y.rx_number??null,startedOn:y.started_on??null,stoppedOn:y.stopped_on??null,docId:y.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:s.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(s),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:l.disclaimer??""})}o(ar,"mapRecordsTimeline");function sr(e,r){let t=Be(r)?r:{},n=Ue(t,e),a=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return a();let l=bo.safeParse(t);if(!l.success)return a();let s=Object.freeze(l.data.contributions.map(Yt));return Object.freeze({petRef:n,withheld:false,document:Kt(l.data.document),contributions:s,contributionCount:l.data.contribution_count??s.length})}o(sr,"mapDocumentContributions");var ho="/widget/v1/records/pets";function lr(e){let r=e.funnel??Ut({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Wt(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,B))return N();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?$(E):F(q("internalError",{retryable:false}))},"read"),a=o(i=>`${ho}/${encodeURIComponent(i)}`,"pet"),l=o(i=>`${a(i)}/everfur_record`,"record"),s=o(async(i,u,y)=>{let _=await r.send(i,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!_.ok)return _;let h=y(_.value);return h===null?F(q("internalError",{retryable:false})):$(h)},"parsed"),c=o((i,u)=>!t(i.entityType,$t)||!t(i.canonicalKey,Gt)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Jt)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:i.entityType,canonical_key:i.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...i.idempotencyKey!==void 0?{idempotency_key:i.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(i=>n("records.depth.record",i,`${a(i)}/record`,u=>ir(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>ar(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>sr(i,y)):N()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Qt(i,u)),"getMarkers"),createShare(i){return t(i,B)?s("records.share.create",{method:"POST",path:`${l(i)}/share`},u=>er(u,e.apiBaseUrl)):N()},listShares(i){return t(i,B)?s("records.share.list",{method:"GET",path:`${l(i)}/shares`},tr):N()},async revokeShare(i,u){if(!t(i,B)||!t(u,64))return N();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${l(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?$(void 0):y},getPdfLink(i){return t(i,B)?s("records.pdf.link",{method:"GET",path:`${l(i)}/pdf-link`},rr):N()},async editFact(i,u){let y=t(i,B)?c(u,u.correctedFields):null;if(y===null)return N();let _=await r.send("records.fact.edit",{method:"POST",path:`${l(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},async removeFact(i,u){let y=t(i,B)?c(u):null;if(y===null)return N();let _=await r.send("records.fact.remove",{method:"POST",path:`${l(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},listRequestDocuments(i){return t(i,64)?s("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(i)}/documents`},Zt):N()},listAuthorizationSignatures:o(()=>s("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},nr),"listAuthorizationSignatures")}}o(lr,"createRecordsDepthClient");function N(){return Promise.resolve(F(q("validationFailed",{retryable:false})))}o(N,"invalid");var dr=Symbol.for("@everfur/sdk#EverfurContext@v1"),cr=globalThis,ur=cr[dr]??(cr[dr]=react.createContext(null));ur.displayName??="EverfurContext";function ie(){let e=react.useContext(ur);if(e===null)throw new te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(ie,"useEverfurContext");var wo=new Map,pr=new Set;function xo(e){return wo.get(e)??0}o(xo,"recordsConsentEpochOf");function Co(e){return pr.add(e),()=>{pr.delete(e);}}o(Co,"subscribe");function yr(e){let r=react.useCallback(()=>xo(e),[e]);return react.useSyncExternalStore(Co,r,r)}o(yr,"useRecordsConsentEpoch");function mr(){let{runtime:e,userRef:r,scopeEpoch:t}=ie();return react.useMemo(()=>{let{services:n}=e.registry;return lr({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(mr,"useEverfurRecordsDepthClient");function ae(e,r,t,n=""){let a=mr(),{userRef:l}=ie(),s=yr(e),c=react.useMemo(()=>({}),[a,e,n,s]),[i,u]=react.useState({scope:c,value:null,error:null,loading:true}),y=react.useRef(0),_=react.useCallback(async()=>{let j=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),l===null){u({scope:c,value:null,error:null,loading:false});return}let z=await r(a,e);j===y.current&&(z.ok?u({scope:c,value:z.value,error:null,loading:false}):u({scope:c,value:null,error:z.error,loading:false}));},[a,e,r,c,l]);react.useEffect(()=>(_(),()=>{y.current+=1;}),[_]);let h=i.scope===c?i:{value:null,error:null,loading:true},E=react.useCallback(()=>{_();},[_]),C=h.error===null||h.error.httpStatus!==404,k=C?h.error:null,I=h.loading?"loading":k!==null?"error":h.value===null?"empty":h.value.withheld?"populated":t(h.value)?"empty":"populated";return react.useMemo(()=>({status:I,value:h.value,error:k,available:C,refresh:E}),[I,h.value,k,C,E])}o(ae,"useRecordsDepthRead");var Ge=class Ge extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Ge,"HostRenderBoundary");var We=Ge;function Fo({render:e}){return e()}o(Fo,"RenderHost");function $e({render:e,fallback:r,resetKey:t}){return react.createElement(We,{fallback:r,resetKey:t,children:react.createElement(Fo,{render:e})})}o($e,"HostRender");var Io=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function Do(e){return Io[e]}o(Do,"requires");function br(e,r,t){let n=Do(e),a=new Map;for(let c of r)a.set(c.resource,c);if(t?.isPending===true&&n.some(c=>!a.has(c)))return Ye({name:e,enabled:false,isPending:true,limits:{}});let l=Po(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ye({name:e,enabled:true,isPending:false,limits:l}):Ye({name:e,enabled:false,isPending:false,limits:l,disabled:Ao(n,a)})}o(br,"decideCapability");function Po(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[l,s]of Object.entries(a)){let c=t[l];t[l]=c===void 0?s:Math.min(c,s);}}return t}o(Po,"mergeLimits");function Ao(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Ne("accessDenied"),level:"user_entitlement",recoverable:false})}o(Ao,"disabledFor");function Ye(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(Ye,"freezeDecision");function Ke(e){let{runtime:r}=ie(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>br(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ke,"useCapability");var No=48;function Lo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Lo,"selectView");function _r(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:l}=e,s=Ke(r),c=react.useMemo(()=>Lo(s),[s]);switch(c){case "enabled":return t;case "pending":return a?jsxRuntime.jsx($e,{render:a,fallback:jsxRuntime.jsx(Rr,{capability:r,style:l})}):jsxRuntime.jsx(Rr,{capability:r,style:l});case "disabled":return n?jsxRuntime.jsx($e,{render:()=>n(s),fallback:jsxRuntime.jsx(vr,{decision:s,style:l}),resetKey:s}):jsxRuntime.jsx(vr,{decision:s,style:l});default:return Lt(c)}}o(_r,"CapabilityGate");function Rr({capability:e,style:r}){let t=w(),n=react.useMemo(()=>Er(t),[t]);return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:n.skeletonBar})})}o(Rr,"PendingSkeleton");function vr({decision:e,style:r}){let t=w(),n=react.useMemo(()=>Er(t),[t]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx(g,{style:n.offstateText,children:a}):null})}o(vr,"OffState");function Er(e){let{color:r,space:t,radius:n,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:No,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...S(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Er,"makeStyles");var se=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function Cr(e){let r=w(),t=react.useMemo(()=>qo(r),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${se.title}. ${se.body}`,children:[jsxRuntime.jsx(g,{style:t.title,children:se.title}),jsxRuntime.jsx(g,{style:t.body,children:se.body})]})}o(Cr,"ClinicalDisclaimer");function qo(e){let{color:r,space:t,type:n}=e;return reactNative.StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:reactNative.StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...S(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...S(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(qo,"makeStyles");var Sr=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Je=60;function Tr(e){return `Try again in ${e}s`}o(Tr,"coolingActionLabel");var kr="Try again, available shortly";function Re({variant:e,onAction:r,message:t,testID:n}){let a=$o(),l=Sr[e],[s,c]=react.useState(e==="rate_limited"?Je:0);react.useEffect(()=>{e==="rate_limited"&&c(Je);},[e]),react.useEffect(()=>{if(s<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[s]);let i=e==="rate_limited"&&s>0,u=i?Tr(s):l.action;return jsxRuntime.jsxs(reactNative.View,{style:a.container,accessibilityRole:"summary",testID:n,children:[jsxRuntime.jsx(reactNative.View,{style:a.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(g,{style:a.title,children:l.title}),jsxRuntime.jsx(g,{style:a.body,children:t??l.body}),u!==null&&r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?kr:u,accessibilityState:{disabled:i},style:[a.action,i?a.actionDisabled:null],testID:n?`${n}-action`:`records-empty-${e}-action`,children:jsxRuntime.jsx(g,{style:a.actionLabel,children:u})}):null]})}o(Re,"RecordsEmptyState");function $o(){let e=w();return react.useMemo(()=>Go(e),[e])}o($o,"useStyles");function Go(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,s=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({container:{paddingVertical:t.xxl,paddingHorizontal:t.xl,alignItems:"center",gap:t.sm+t.xs/2},glyph:{width:s,height:s,borderRadius:s/2,backgroundColor:r.brandSoft,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder,marginBottom:t.xs},title:{...S(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...S(e,"regular"),fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.normal),color:r.text.muted,textAlign:"center",maxWidth:320},action:{marginTop:t.sm,minHeight:t.xxl+t.sm,borderRadius:n.pill,paddingHorizontal:t.lg+t.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...J(l.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...Z(l.primaryButton)}})}o(Go,"makeStyles");var Qo=120,Jo=44;function Zo({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:l,radius:s,type:c}=w();return jsxRuntime.jsxs(reactNative.View,{testID:"records-gate-off",style:[{minHeight:Qo,justifyContent:"center",gap:l.md,padding:l.lg,borderRadius:s.md,borderWidth:1,borderColor:a.brandBorder,backgroundColor:a.surfaceCream},n],children:[e.length>0?jsxRuntime.jsx(g,{style:{fontSize:c.size.bodyTight,color:a.text.muted},children:e}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,testID:"records-gate-off-exit",style:{minHeight:Jo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:l.lg,borderRadius:s.pill,borderWidth:1.5,borderColor:a.brand},children:jsxRuntime.jsx(g,{style:{fontSize:c.size.body,color:a.brand},children:t})})]})}o(Zo,"RecordsGateOffState");function Dr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx(Zo,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Dr,"recordsGateExit");var Ze="Back";function _e({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let l=oi();return jsxRuntime.jsxs(reactNative.View,{style:l.row,testID:n,children:[r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:Ze,hitSlop:12,style:l.back,testID:n?`${n}-back`:void 0,children:jsxRuntime.jsx(reactNative.View,{style:l.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsxRuntime.jsx(reactNative.View,{style:l.back}),jsxRuntime.jsx(g,{style:a==="document"?l.documentTitle:l.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsxRuntime.jsx(reactNative.View,{style:l.right,children:t??jsxRuntime.jsx(reactNative.View,{style:l.back})})]})}o(_e,"ScreenHeader");function oi(){let e=w();return react.useMemo(()=>ii(e),[e])}o(oi,"useStyles");function ii(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,l=t.md,s=t.xs/2,c=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md,gap:t.sm},back:{width:a,height:a,alignItems:"center",justifyContent:"center"},chevron:{width:l,height:l,borderLeftWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginLeft:t.xs},title:{flex:1,...S(e,"bold"),fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.tight)+1,color:r.brandInk},documentTitle:{flex:1,textAlign:"center",...S(e,"bold"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.snug),color:r.text.primary},right:{flexDirection:"row",alignItems:"center",gap:t.sm+t.xs/2},listGlyph:{width:c,height:c,justifyContent:"space-evenly"},listBar:{height:s,borderRadius:s,backgroundColor:r.brandInk},shareGlyph:{width:c-t.xs,height:c-t.xs},shareDot:{position:"absolute",width:t.xs+t.xs/2,height:t.xs+t.xs/2,borderRadius:t.xs,borderWidth:s,borderColor:r.brandInk},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:t.xs+t.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:t.xs,top:t.sm,width:t.sm+t.xs/2,height:s,backgroundColor:r.brandInk},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:c-t.xs,height:c-t.xs},sendBody:{position:"absolute",left:0,top:0,right:0,bottom:0,borderWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:s},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:s,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:s,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginTop:-t.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:t.xs+t.xs/2,borderLeftWidth:s,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk}})}o(ii,"makeStyles");function K({width:e,height:r,radius:t,style:n}){let{color:a,radius:l}=w();return jsxRuntime.jsx(reactNative.View,{style:[{width:e,height:r,borderRadius:t??l.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(K,"SkeletonBlock");var li=44,di=24,et=34,ci=6;function Ar({testID:e}){let r=ui();return jsxRuntime.jsxs(reactNative.View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:b.loadingTimeline,testID:e,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineDisclaimer,children:jsxRuntime.jsx(K,{width:"100%",height:li,radius:12})}),Array.from({length:ci},(t,n)=>jsxRuntime.jsxs(reactNative.View,{children:[n>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,children:[jsxRuntime.jsx(K,{width:et,height:et,radius:et/2}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.timelineTop,children:[jsxRuntime.jsx(K,{width:44,height:10,radius:5}),jsxRuntime.jsx(K,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(K,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(K,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Ar,"TimelineSkeleton");var tt=62;function ui(){let e=w();return react.useMemo(()=>pi(e),[e])}o(ui,"useStyles");function pi(e){let{color:r,space:t,radius:n}=e,a=reactNative.StyleSheet.hairlineWidth;return reactNative.StyleSheet.create({dashboard:{flex:1,paddingHorizontal:t.sm,paddingTop:t.xs,gap:t.lg,backgroundColor:r.background},inset:{paddingHorizontal:t.sm},summaryCard:{alignItems:"center",borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg+t.xs,gap:t.md+t.xs/2},badges:{flexDirection:"row",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:t.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{alignSelf:"center"},actions:{gap:t.sm+t.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:t.md},request:{paddingHorizontal:t.lg,paddingTop:t.xs,gap:t.lg+t.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:t.md},railColumn:{alignItems:"center",width:di},connector:{marginVertical:t.xs/2},railBody:{flex:1,paddingBottom:t.lg+t.xs/2,gap:t.xs+t.xs/2},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,gap:t.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBody:{flex:1,gap:t.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:tt},clinics:{gap:t.md},clinicRow:{borderRadius:n.lg-t.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.md+t.xs/2,paddingVertical:t.md+t.xs/2,gap:t.sm},shares:{gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:t.xs+t.xs/2}})}o(pi,"makeStyles");var hi=300,Ri=o((e,r)=>e.getTimeline(r),"readTimeline"),vi=o(e=>e.isEmpty,"timelineEmpty"),_i=o((e,r)=>e.getRecordDepth(r),"readDepth"),Ei=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),wi=o(e=>e.contributions.length===0,"contributionsEmpty");function xi({petRef:e,style:r,onBack:t}){let n=ae(e,Ri,vi);return jsxRuntime.jsx(nt,{state:n,style:r,onBack:t,header:jsxRuntime.jsx(_e,{title:b.timeline,onBack:ee(t),testID:"timeline-header"}),loading:jsxRuntime.jsx(Ar,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(Re,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsxRuntime.jsx(Oi,{timeline:a})})}o(xi,"EverfurRecordsTimeline");function Ci({petRef:e,style:r,onBack:t}){let n=ae(e,_i,Ei);return jsxRuntime.jsx(nt,{state:n,style:r,onBack:t,header:t?jsxRuntime.jsx(_e,{title:W.records,onBack:ee(t)}):null,render:a=>jsxRuntime.jsx(Fi,{depth:a})})}o(Ci,"EverfurRecordDepth");function Si({petRef:e,docId:r,style:t,onBack:n}){let a=react.useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),l=ae(e,a,wi,r),s=l.value?.document?.title?.trim()||b.uploadedDocument;return jsxRuntime.jsx(nt,{state:l,style:t,onBack:n,header:jsxRuntime.jsx(_e,{title:s,onBack:ee(n),testID:"contributions-header"}),empty:jsxRuntime.jsx(Re,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsxRuntime.jsx(Ii,{view:c})})}o(Si,"EverfurDocumentContributions");function nt({state:e,style:r,header:t,loading:n,empty:a,render:l,onBack:s}){let c=we();return jsxRuntime.jsx(_r,{capability:"records",style:r,...Dr(ee(s),Ze),children:jsxRuntime.jsxs(reactNative.View,{style:[c.container,r],children:[t??null,jsxRuntime.jsx(reactNative.View,{style:c.body,children:Ti(e,l,c,n,a)}),jsxRuntime.jsx(Cr,{})]})})}o(nt,"DepthSurface");function Ti(e,r,t,n,a){switch(e.status){case "loading":return n??jsxRuntime.jsx(ki,{styles:t});case "empty":return a??jsxRuntime.jsx(reactNative.View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:W.empty,children:jsxRuntime.jsx(reactNative.View,{style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(Re,{variant:Rt(e.error),message:e.error.displayMessage,onAction:e.error.retryable?e.refresh:void 0,testID:"depth-error"}):null;case "populated":return e.value===null||e.value.withheld?null:r(e.value);default:return null}}o(Ti,"renderState");function ki({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),hi);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx(reactNative.View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:W.loading,children:r?jsxRuntime.jsx(reactNative.ActivityIndicator,{}):null})}o(ki,"LoadingState");function Oi({timeline:e}){let r=we(),t=Pe(e);return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.timelineContent,accessibilityLabel:b.timeline,children:[e.disclaimer.length>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:ht.important(e.disclaimer),children:jsxRuntime.jsx(g,{style:r.timelineBandText,children:e.disclaimer})}):null,t.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{children:[a>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${n.kind}`,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.topLine,children:[jsxRuntime.jsx(g,{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx(g,{style:r.date,children:n.date})]}),jsxRuntime.jsx(g,{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.detail}):null]})]})]},n.key))]})}o(Oi,"TimelineBody");function Ee({title:e,count:r,styles:t}){return jsxRuntime.jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(Ee,"SectionHeader");function Fi({depth:e}){let r=we();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.labResults.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.labResults,count:e.labResults.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.labResults.map(t=>{let n=xt(t.latest.status),a=Tt(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,De(t.latest.value,t.latest.unit,t.latest.qualitativeResult),n.label,a].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.name}),jsxRuntime.jsx(g,{style:r.rowValue,children:De(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),a?jsxRuntime.jsx(g,{style:r.rowDetail,children:a}):null,jsxRuntime.jsx(g,{style:[r.chip,n.outOfRange?r.chipCritical:r.chipNeutral],children:n.label}),t.meaning?jsxRuntime.jsx(g,{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.visits,count:e.encounters.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.encounters.map(t=>{let n=[t.date?O(t.date):null,t.clinicName,t.veterinarian].filter(a=>a&&a!=="-").join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.type?fe(t.type):b.visit}),n?jsxRuntime.jsx(g,{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.physicalExams,count:e.physicalExams.length,styles:r}),e.physicalExams.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.exam}),t.systems.map(n=>{let a=n.findingStatus==="abnormal",l=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Ie(n.system),l,a?n.finding:null].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:Ie(n.system)}),a&&n.finding?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx(g,{style:[r.chip,a?r.chipCaution:r.chipNeutral],children:l})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.visitNotes,count:e.clinicianNotes.length,styles:r}),e.clinicianNotes.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.visitNote}),t.sections.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.kindLabel,children:Ct(n.section)}),jsxRuntime.jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(Fi,"DepthBody");function Ii({view:e}){let r=we();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.document?.receivedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(e.document.receivedAt)}):null,jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.label}),jsxRuntime.jsx(g,{style:r.rowValue,children:_t(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(Ii,"ContributionsBody");function we(){let e=w();return react.useMemo(()=>Di(e),[e])}o(we,"useStyles");function Di(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,{size:s,lineHeight:c}=a,i=o((I,j)=>Math.round(I*j),"lh"),u=reactNative.StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=Z(l.recordCard),C=o((I,j,z,H="regular")=>({...S(e,H),fontSize:I,lineHeight:i(I,j),color:z}),"text"),k=o((I,j,z,H="regular")=>({...C(I,j,z,H),...E}),"inCard");return reactNative.StyleSheet.create({container:{flex:1,minHeight:y,backgroundColor:r.background},body:{flex:1},centered:{minHeight:y,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl,gap:t.lg},emptyGlyph:{width:t.xxl+t.sm,height:t.xxl+t.sm,borderRadius:n.lg,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},errorText:{...C(s.subtitle,c.snug,h),textAlign:"center",marginBottom:t.md},primaryButton:{minHeight:_,minWidth:_,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,...J(l.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:s.body,...Z(l.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(s.heading,c.snug,r.text.primary,"bold")},card:{gap:t.sm,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:u,borderColor:r.brandBorder,...J(l.recordCard,u)},row:{gap:t.xs,paddingVertical:t.xs,borderBottomWidth:u,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:t.md},kindLabel:{...k(s.caption,c.normal,r.text.muted,"medium")},date:k(s.caption,c.normal,r.text.muted),rowTitle:{...k(s.body,c.normal,r.text.primary,"bold")},rowValue:{...k(s.body,c.normal,r.text.primary,"medium")},rowDetail:k(s.bodyTight,c.normal,r.text.muted),rowMuted:{...k(s.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(s.caption,c.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:t.sm,paddingVertical:t.xs,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...C(s.caption,c.normal,r.text.muted),marginTop:t.md},timelineContent:{paddingBottom:t.xxl},timelineBand:{flexDirection:"row",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,marginHorizontal:t.lg,marginTop:t.xs,marginBottom:t.md},timelineBandText:{flex:1,...C(s.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:tt},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBubble:{width:t.xxl+t.xs/2,height:t.xxl+t.xs/2,borderRadius:n.pill,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},timelineBody:{flex:1,gap:t.xs-1},timelineKind:{...S(e,"mono"),fontSize:s.micro,lineHeight:s.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(s.body,c.normal,r.text.primary,"medium")}})}o(Di,"makeStyles");
2
+ exports.EverfurDocumentContributions=Si;exports.EverfurRecordDepth=Ci;exports.EverfurRecordsTimeline=xi;exports.buildTimelineRows=Pe;exports.mapDocumentContributions=sr;exports.mapRecordDepth=ir;exports.mapRecordsTimeline=ar;exports.useEverfurRecordsDepthClient=mr;exports.useRecordsDepthRead=ae;
@@ -0,0 +1,13 @@
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-B_hIypI6.cjs';
2
+ export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-C6rjEaLn.cjs';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-odO8g9r2.cjs';
4
+ export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../depth-D5HwcvKC.cjs';
5
+ export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../ids-B2GAAifq.cjs';
6
+ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.cjs';
7
+ export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../models-D2EUxPZY.cjs';
8
+ import 'react';
9
+ import 'react-native';
10
+ import '../../requestFunnel-BjDpqqvm.cjs';
11
+ import '../../ErrorPolicyPort-CNf4uQZP.cjs';
12
+ import '../../config--Wu1Umhd.cjs';
13
+ import '../../identity-C2-08BZW.cjs';
@@ -0,0 +1,13 @@
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-CkYri51q.js';
2
+ export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-crhBllQK.js';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-C15jxFFH.js';
4
+ export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../depth-DvPwPuT_.js';
5
+ export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../ids-B2GAAifq.js';
6
+ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.js';
7
+ export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../models-B-Uh2LTf.js';
8
+ import 'react';
9
+ import 'react-native';
10
+ import '../../requestFunnel-DFMGcluw.js';
11
+ import '../../ErrorPolicyPort-CwbfmxzJ.js';
12
+ import '../../config-C7eb_IMD.js';
13
+ import '../../identity-CEi9GRFZ.js';
@@ -0,0 +1,2 @@
1
+ import {createContext,forwardRef,createElement,useMemo,useState,useRef,useCallback,useEffect,useContext,useSyncExternalStore,Component}from'react';import {TextInput,View,ActivityIndicator,ScrollView,StyleSheet,Text,Pressable}from'react-native';import {z}from'zod';import {jsx,jsxs}from'react/jsx-runtime';var Nr=Object.defineProperty;var o=(e,r)=>Nr(e,"name",{value:r,configurable:true});function Oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Oe(e[r]);}return e}o(Oe,"deepFreeze");var Lr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),st={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},lt={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},at={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Mr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Vr={regular:"400",medium:"500",bold:"700"},qr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Br=0,pe="System",ye="monospace",Ur=["content","heading","control","compact","badge"];function Hr(e){let r={};for(let t of Ur)r[t]=e;return r}o(Hr,"authoredTierSizes");function dt(){return {family:pe,mono:ye,fontUrl:null,families:{regular:pe,medium:pe,bold:pe,mono:ye,monoMedium:ye,monoBold:ye},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:at,tierSizes:Hr(at),lineHeight:Mr,weight:Vr,letterSpacing:qr,scale:1,maxScale:Br,scaleCaps:Lr}}o(dt,"baseType");var ct={},Te=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ke(e){return `cubic-bezier(${e.join(", ")})`}o(ke,"cssCubicBezier");var ut={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ke(Te.standard),emphasized:ke(Te.emphasized),exit:ke(Te.exit)},reducedMotion:false},Wr={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},pt=Oe({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Wr,space:st,radius:lt,type:dt(),motion:ut,slots:ct}),$r={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Oe({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:$r,space:st,radius:lt,type:dt(),motion:ut,slots:ct});var yt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ft=globalThis,Fe=ft[yt]??(ft[yt]=createContext(pt));Fe.displayName??="EverfurThemeContext";function w(){return useContext(Fe)}o(w,"useEverfurTheme");function Jr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Jr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Jr(t,e);return createElement(Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(g,"Text");forwardRef(o(function(r,t){return createElement(TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function J(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}o(J,"slotBox");function Z(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(Z,"slotText");var Zr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function S(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[Zr[r]]}}o(S,"face");function gt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(gt,"reportHostFailure");function en(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(en,"isThenable");function tn(e,...r){if(typeof e=="function")try{let t=e(...r);return en(t)&&Promise.resolve(t).then(void 0,gt),t}catch(t){gt(t);return}}o(tn,"callHost");var bt=new WeakMap;function ee(e){if(typeof e!="function")return;let r=bt.get(e);if(r!==void 0)return r;let t=o((...n)=>{tn(e,...n);},"guarded");return bt.set(e,t),t}o(ee,"guardHost");var W=Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});var rn="your pet";function V(e){let r=e?.trim()??"";return r.length>0?r:rn}o(V,"petNameOr");var ht=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${V(e)}\u2019s lab trends`,"lead"),retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:o(e=>`Important: ${e}`,"important")});Object.freeze({title:"Marker Summary",marker:"Marker",markers:"Markers",outOfRange:"OUT OF RANGE",inRange:"IN RANGE",noRange:"NO RANGE",subtitle:"Summary of your pet\u2019s biomarkers",ask:"Ask about these markers",askA11y:"Ask Everfur about these markers",a11y:o((e,r,t,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${r} in range, ${t} out of range${n>0?`, ${n} without a range`:""}.`,"a11y")});Object.freeze({counter:o((e,r)=>`${e+1} of ${r}`,"counter"),a11y:o((e,r,t)=>e!==null?`${e}, marker ${r+1} of ${t}. Swipe left or right to see more markers.`:`Marker ${r+1} of ${t}`,"a11y")});Object.freeze({tapHint:"Tap a point to see where it came from.",singleHint:"One reading so far: we\u2019ll plot a trend as more come in.",empty:"No readings for this marker yet.",ask:"Ask about this marker",askA11y:o(e=>`Ask Everfur about ${e}`,"askA11y"),status:o(e=>`Status: ${e}`,"status"),latestA11y:o((e,r,t)=>`Latest reading ${e}, ${r}, collected ${t}`,"latestA11y"),readingsA11y:o(e=>`${e} readings, oldest to newest`,"readingsA11y")});Object.freeze({title:o(e=>`${V(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${V(e)}\u2019s records from your vet. This usually takes a few days; we\u2019ll show lab trends here as soon as they arrive.`,"body"),a11y:o(e=>`Records request in progress for ${V(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${V(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${V(e)}\u2019s records`,"title"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicA11y:o(e=>`Request ${V(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${V(e)}\u2019s records`,"uploadDocumentA11y")});function Rt(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(Rt,"recordsEmptyVariantForError");function _t(e,r){return e===null?"":r?`${e} ${r}`:e}o(_t,"formatEntityValue");var vt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let a=vt[Number(r[2])-1];return a===void 0?"-":`${a} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${vt[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(O,"formatRecordsDate");var b=Object.freeze({timeline:"Timeline",loadingTimeline:"Loading timeline",labResults:"Blood & lab work",visits:"Visits",physicalExams:"Physical exams",visitNotes:"Visit notes",visit:"Visit",exam:"Exam",visitNote:"Visit note",notRecorded:"Not recorded",abnormal:"Abnormal",notExamined:"Not examined",normal:"Normal",measured:o(e=>`Measured ${e}`,"measured"),uploadedDocument:"Uploaded document",kind:Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:o(e=>`Dr. ${e}`,"doctor"),lot:o(e=>`Lot ${e}`,"lot"),expires:o(e=>`Expires ${e}`,"expires")});function xt(e){switch(e){case "above":return {label:"Above range",outOfRange:true};case "below":return {label:"Below range",outOfRange:true};case "in_range":return {label:"In range",outOfRange:false};default:return {label:"No range on file",outOfRange:false}}}o(xt,"markerStatusLabel");function nn(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(nn,"trajectoryLabel");function fe(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(fe,"humanize");var Et=Object.freeze({general:"General / attitude",eent:"Eyes, ears, nose & throat",oral_dental:"Oral & dental",cardiovascular:"Cardiovascular",respiratory:"Respiratory",gastrointestinal:"GI / abdomen",urogenital:"Urogenital",musculoskeletal:"Musculoskeletal",neurologic:"Neurologic",integument:"Skin & coat",lymphatic:"Lymph nodes"});function Ie(e){return Object.prototype.hasOwnProperty.call(Et,e)?Et[e]:fe(e)}o(Ie,"bodySystemLabel");var wt=Object.freeze({reason_for_visit:"Reason for visit",subjective:"Subjective",objective:"Objective",assessment:"Assessment",plan:"Plan",discharge_instructions:"Discharge instructions",follow_up:"Follow-up",remarks:"Notes"});function Ct(e){return Object.prototype.hasOwnProperty.call(wt,e)?wt[e]:fe(e)}o(Ct,"soapSectionLabel");function St(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(St,"formatWeightKg");function De(e,r,t){if((e===null||!Number.isFinite(e))&&t)return t;if(e===null||!Number.isFinite(e))return "-";let n=e.toFixed(3).replace(/\.?0+$/,"");return r?`${n} ${r}`:n}o(De,"formatMarkerReading");function Tt(e,r,t){let n=nn(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(Tt,"labDetailLine");var me=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function kt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(kt,"toMillis");function Pe(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:b.kind.visit,at:t.visitDate,date:O(t.visitDate),title:t.summary??b.clinicVisit,detail:t.veterinarian?b.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let a=[];return t.lot&&a.push(b.lot(t.lot)),t.expiresOn&&a.push(b.expires(O(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:b.kind.vaccine,at:t.administeredOn,date:O(t.administeredOn),title:t.product||b.kind.vaccine,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:b.kind.weight,at:t.observedOn,date:O(t.observedOn),title:St(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(l=>!!l);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:b.kind.medication,at:t.startedOn,date:O(t.startedOn),title:t.drugName||b.kind.medication,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let a=kt(t.at),l=kt(n.at);return a===null&&l===null?me[t.kind]-me[n.kind]:a===null?1:l===null?-1:l!==a?l-a:me[t.kind]-me[n.kind]}))}o(Pe,"buildTimelineRows");var Ae=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Ae.map(e=>e.wireCode));var on=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),Ft=Object.freeze(Ae.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:on[e.wireCode]}))),an=new Map(Ft.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),sn=Object.freeze(["http_envelope",...[...new Set(Ft.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ge(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...sn]){let a=an.get(n+t);if(a)return a}}o(ge,"contractErrorFor");function ln(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(ln,"contractDocUrl");function It(e){return null}o(It,"publishedDocUrl");var dn=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Dt(e){return dn[e]}o(Dt,"categoryFor");function Pt(e){let r=ge(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Pt,"fromWire");var cn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function je(e){return cn.has(e)}o(je,"isAutoRetryable");var un=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function At(e){return je(e)||un.has(e)}o(At,"isRetryableCode");var pn=500,ze=8e3,jt=4;function zt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(pn*2**t,ze);return Math.floor(r()*n)}o(zt,"backoffDelayMs");var yn=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Ne(e){return yn[e]}o(Ne,"userFacingError");function Nt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Nt,"defineHidden");var fn=/^[a-z][a-z0-9_]{0,63}$/;function q(e,r){let t=ge(r?.wireCode,r?.wireEnvelope),n={code:e,category:Dt(e),retryable:r?.retryable??At(e),displayMessage:Ne(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&fn.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Nt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Nt(n,"raw",r.raw),Object.freeze(n)}o(q,"makeEverfurError");function $(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o($,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var be=class be extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,be.prototype);}};o(be,"EverfurConfigError");var te=be;function Lt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Lt,"assertNever");function Mt(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Mt,"errorFrame");function bn(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(bn,"authHeaders");function re(e,r){return {...e,headers:{...hn(e.headers),...bn(r)}}}o(re,"withAuthHeaders");function hn(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=n);}return r}o(hn,"stripAuthHeaders");async function Vt(e,r){if(r.mode==="anonymous")return r.transport.request(re(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return F(Le())}let n=await r.transport.request(re(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return F(Le())}let l=await r.transport.request(re(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?F(Le(l.error.httpStatus)):l}o(Vt,"authedSend");function Le(e){return q("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Le,"authRejectedError");function qt(e){return q("internalError",{retryable:true,wireMessage:Rn(e)})}o(qt,"networkError");function Rn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Rn,"describeCause");var vn=3e4,_n=ze*2,En="idempotency-key",wn=new Set(["POST","PUT","PATCH","DELETE"]),xn=Object.freeze({onEvent(){}}),Cn=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Sn(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(Sn,"seededIdempotencyKey");function Ut(e){let r=e.observer??xn,t=e.timers??Cn,n=e.rng??Math.random,a=e.sleep??((h,E)=>Mn(h,t,E)),l=e.maxAttempts??jt,s=e.unaryTimeoutMs??vn,c=e.newIdempotencyKey??kn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??l),j=C?.idempotent??wn.has(E.method),z=C?.idempotencyKey===void 0?null:Sn(C.idempotencyKey),H=j?z??c():null,zr=Tn(E,H),xe=0;for(;;){let X=o(Se=>Object.freeze({call:h,method:E.method,path:E.path,attempt:xe,...H?{idempotencyKey:H}:{},...Se}),"stamp");i(X({phase:"attempt"}));let ot=Nn(s,t),it=Ln(ot.signal,E.signal),Q;try{Q=await Vt({...zr,signal:it.signal},e.auth);}catch(Se){Q=F(qt(Se));}finally{it.dispose(),ot.cancel();}if(Q.ok)return i(X({phase:"settled",ok:true,reason:"ok"})),Q;let M=Q.error,ue=Fn(M,xe,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Ce={ok:false,code:M.code,reason:ue.reason,...M.httpStatus!==void 0?{httpStatus:M.httpStatus}:{},...M.requestId!==void 0?{requestId:M.requestId}:{}};if(!ue.retry)return i(X({phase:"settled",...Ce})),F(M);if(i(X({phase:"retry",...Ce,delayMs:ue.delayMs})),await a(ue.delayMs,E.signal),E.signal?.aborted===true)return i(X({phase:"settled",...Ce,reason:"aborted"})),F(M);xe+=1;}}o(u,"send");async function y(h){return re(h,await zn(e.auth))}o(y,"authorize");async function*_(h,E,C){i(Object.freeze({call:h,phase:"stream.open",method:E.method,path:E.path,attempt:0}));try{yield*e.auth.transport.stream(E,C);}catch{yield Mt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(Ut,"createRequestFunnel");function Tn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==En&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(Tn,"assembleHeaders");function kn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(kn,"defaultIdempotencyKeyFactory");var On=10;function Fn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=In(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!je(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(On,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??s()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=Dn(e,t.now);return i!==null?i>_n?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:zt(r,t.rng)}}o(Fn,"decideRetry");function In(e){let r=e.code==="unknown"?Pt(jn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(In,"throttleKind");function Dn(e,r){let t=Pn(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(Dn,"retryOverrideMs");function Pn(e){for(let r of Ht(e)){let t=r.resets_at,n=An(t);if(n!==null)return n}return null}o(Pn,"findResetsAt");function Ht(e){if(!Bt(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Bt(n)&&r.push(n);}return r}o(Ht,"candidateScopes");function An(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(An,"parseInstantMs");function jn(e){for(let r of Ht(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(jn,"rawWireCode");function Bt(e){return typeof e=="object"&&e!==null}o(Bt,"isRecord");async function zn(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(zn,"resolveDeviceAuth");function Nn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Nn,"boundedSignal");function Ln(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}o(Ln,"mergeSignals");function Mn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",l),n();},e),l=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",l,{once:true});})}o(Mn,"delayAbortable");function Wt(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(Wt,"hasLoneSurrogate");var $t=64,Gt=512;function qn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(qn,"normalizeOrigin");z.object({request_id:z.string().min(1),pet_ref:z.string().min(1),status:z.string(),simple_status:z.string().nullish(),simple_status_detail:z.string().nullish(),status_label:z.string().optional(),dispatch_status:z.string().nullish(),can_retry_send:z.boolean().optional(),can_revoke:z.boolean().optional(),can_convert_to_upload:z.boolean().optional(),can_update_clinic_email:z.boolean().optional(),reminder_count:z.number().int().nonnegative().optional(),last_reminder_at:z.string().nullish(),waiting_expectation:z.string().nullish(),document_count:z.number().optional(),held_item_count:z.number().optional(),received_at:z.string().nullish(),parsing_started_at:z.string().nullish(),review_started_at:z.string().nullish(),created_at:z.string().optional(),updated_at:z.string().optional(),source:z.string().nullish().catch(null),action_needed_label:z.string().nullish().catch(null),failure_reason:z.string().nullish().catch(null),failure_code:z.string().nullish().catch(null),recovery_stage:z.string().nullish().catch(null),show_clinic_phone:z.boolean().optional().catch(void 0),clinic_name:z.string().nullish().catch(null),clinic_email:z.string().nullish().catch(null),clinic_phone:z.string().nullish().catch(null),converted_to_upload_at:z.string().nullish().catch(null),request_group_id:z.string().nullish().catch(null)}).passthrough();z.object({request_group_id:z.string().min(1),pet_ref:z.string().min(1),total:z.number().int().nonnegative(),responded:z.number().int().nonnegative(),pending:z.number().int().nonnegative(),members:z.array(z.unknown())});z.object({source_doc_id:z.string().min(1),request_id:z.string().min(1)});var Bn=z.object({label:z.string(),value:z.string()}),Me=z.object({key:z.string(),category:z.string().optional(),label:z.string().optional(),value:z.string().nullish(),unit:z.string().nullish(),observed_at:z.string().nullish(),status:z.string().nullish(),origin:z.string().nullish(),canonical_key:z.string().nullish()}),Un=z.object({at:z.string(),value:z.number().nullish(),display:z.string().nullish(),origin:z.string().nullish()}),Hn=z.object({key:z.string(),label:z.string().optional(),points:z.array(Un).optional()}),Wn=z.object({title:z.string(),detail:z.string().nullish(),due_at:z.string().nullish()}),Ve=z.object({doc_id:z.string(),title:z.string().nullish(),page_count:z.number().nullish(),received_at:z.string().nullish()});function Yt(e){return Object.freeze({key:e.key,category:e.category??"",label:e.label??e.key,value:e.value??null,unit:e.unit??null,observedAt:e.observed_at??null,status:e.status??null,origin:qn(e.origin),canonicalKey:e.canonical_key??null})}o(Yt,"mapEntityRow");function Kt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Kt,"mapDocumentRow");z.object({identity:z.array(Bn).optional(),entities:z.array(Me).optional(),entity_series:z.array(Hn).optional(),forward_looking:z.array(Wn).optional(),documents:z.array(Ve).optional()});z.object({pet_ref:z.string().optional(),granted:z.boolean().optional(),version:z.string().nullish(),granted_at:z.string().nullish()});var v=z.string().nullish(),he=z.number().nullish(),$n=z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,ref_low:he,ref_high:he,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:z.boolean().nullish()}),Gn=z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,status:v}),Yn=z.object({marker_id:z.string().min(1),canonical_name:v,name:v,loinc_code:v,canonical_unit:v,unit:v,panel_name:v,panel:v,meaning_text:v,meaning:v,latest:Gn.nullish(),trajectory:v,points:z.array($n).optional()}),Kn=z.object({total_markers:z.number().int().nonnegative(),in_range_count:z.number().int().nonnegative(),out_of_range_count:z.number().int().nonnegative(),unknown_count:z.number().int().nonnegative()}),Xn=z.object({markers:z.array(Yn).optional(),summary:Kn.nullish(),disclaimer:z.string().optional(),featured_marker_id:v});function Qn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Qn,"isObject");function Xt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Xt,"withheldMarkers");function Qt(e,r){let t=Qn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Xt(n);let a=Xn.safeParse(t);if(!a.success)return Xt(n);let l=a.data,s=o(i=>Object.freeze({at:i.collected_at??i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,sourceClinic:i.source_clinic??null,docId:i.source_doc_id??i.doc_id??null,reviewed:i.reviewed===true}),"point"),c=(l.markers??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.canonical_name??i.name??i.marker_id,loincCode:i.loinc_code??null,unit:i.canonical_unit??i.unit??null,panel:i.panel_name??i.panel??null,meaning:i.meaning_text??i.meaning??null,latest:i.latest?Object.freeze({at:i.latest.collected_at??i.latest.at??null,value:i.latest.value??null,unit:i.latest.unit??null,qualitativeResult:i.latest.qualitative_result??null,status:i.latest.status??null}):null,trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(s))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:l.summary?Object.freeze({totalMarkers:l.summary.total_markers,inRangeCount:l.summary.in_range_count,outOfRangeCount:l.summary.out_of_range_count,unknownCount:l.summary.unknown_count}):null,disclaimer:l.disclaimer??"",featuredMarkerId:l.featured_marker_id??null})}o(Qt,"mapRecordMarkers");var Jt=128,B=128;var Jn=z.string().min(1).refine(e=>e.startsWith("https://")),Zn=z.object({source_doc_id:z.string().min(1),file_name:z.string().nullish(),doc_format:z.string().nullish(),byte_size:z.number().int().nonnegative().nullish(),received_at:z.string().nullish(),download_url:Jn,expires_in_seconds:z.number().int().nonnegative().nullish()}),eo=z.object({items:z.array(z.unknown()).optional()});function Zt(e){let r=eo.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let a=Zn.safeParse(n);a.success&&t.push(Object.freeze({sourceDocId:a.data.source_doc_id,fileName:a.data.file_name??null,docFormat:a.data.doc_format??null,byteSize:a.data.byte_size??null,receivedAt:a.data.received_at??null,downloadUrl:a.data.download_url,expiresInSeconds:a.data.expires_in_seconds??0}));}return Object.freeze(t)}o(Zt,"mapRequestDocuments");var to=z.string().min(1).refine(e=>e.startsWith("https://")),ne=z.string().nullish(),ro=z.object({share_id:z.string().min(1),share_url:z.string().min(1),expires_at:ne}),no=z.object({shares:z.array(z.object({share_id:z.string().min(1),expires_at:ne,created_at:ne,view_count:z.number().int().nonnegative().nullish(),last_viewed_at:ne})).optional()}),oo=z.object({download_url:to,expires_at:ne});function io(e,r){let t=e.trim();if(t.length===0)return null;try{let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?new URL(t):r!==void 0?new URL(t,r):null;return n===null||n.protocol!=="https:"?null:n.toString()}catch{return null}}o(io,"resolveShareUrl");function er(e,r){let t=ro.safeParse(e);if(!t.success)return null;let n=io(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null})}o(er,"mapRecordShareLink");function tr(e){let r=no.safeParse(e);return r.success?Object.freeze((r.data.shares??[]).map(t=>Object.freeze({shareId:t.share_id,expiresAt:t.expires_at??null,createdAt:t.created_at??null,viewCount:t.view_count??0,lastViewedAt:t.last_viewed_at??null}))):null}o(tr,"mapRecordShareList");function rr(e){let r=oo.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(rr,"mapRecordPdfLink");var ao=z.object({signatures:z.array(z.object({signature_id:z.string().min(1),preview_url:z.string().min(1).refine(e=>e.startsWith("https://")),created_at:z.string().nullish()})).optional()});function nr(e){let r=ao.safeParse(e);return r.success?Object.freeze((r.data.signatures??[]).map(t=>Object.freeze({signatureId:t.signature_id,previewUrl:t.preview_url,createdAt:t.created_at??null}))):null}o(nr,"mapSignatureSuggestions");var m=z.string().nullish(),oe=z.number().nullish(),so=z.object({at:m,value:oe,unit:m,qualitative_result:m,ref_low:oe,ref_high:oe,status:m,doc_id:m}),lo=z.object({marker_id:z.string(),name:z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:z.object({at:m,value:oe,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:z.array(so).optional()}),co=z.object({encounter_id:z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),uo=z.object({note_id:z.string(),encounter_id:m,observed_on:m,sections:z.array(z.object({section:z.string(),text:z.string()})).optional()}),po=z.object({exam_id:z.string(),encounter_id:m,observed_on:m,doc_id:m,systems:z.record(z.object({finding_status:m,finding:m})).optional()}),yo=z.object({has_lab_history:z.boolean().optional(),has_vaccination_history:z.boolean().optional(),has_weight_history:z.boolean().optional(),has_vitals_history:z.boolean().optional(),has_physical_exam_history:z.boolean().optional(),has_procedure_history:z.boolean().optional(),has_genetic_history:z.boolean().optional(),has_reproductive_history:z.boolean().optional(),has_parasite_prevention_history:z.boolean().optional(),earliest_record_at:m,latest_record_at:m,documents_ingested:z.number().int().nonnegative().optional(),documents_in_review:z.number().int().nonnegative().optional(),entities_pending_review:z.record(z.number().int().nonnegative()).optional(),held_total:z.number().int().nonnegative().optional()}),fo=z.object({conflict_id:z.string(),entity_type:z.string(),field:m,severity:m,candidates:z.array(z.object({value:z.string(),source_doc_id:m,doc_id:m,collected_at:m})).optional()}),mo=z.object({lab_results:z.array(lo).optional(),encounters:z.array(co).optional(),clinician_notes:z.array(uo).optional(),physical_exams:z.array(po).optional(),completeness:yo.nullish(),conflicts:z.array(fo).optional()}),go=z.object({visits:z.array(z.object({visit_id:z.string(),visit_date:m,veterinarian:m,summary:m,doc_id:m})),vaccines:z.array(z.object({vaccine_id:z.string(),product:m,lot:m,administered_on:m,expires_on:m,doc_id:m})),weights:z.array(z.object({weight_id:z.string(),observed_on:m,weight_kg:oe,doc_id:m})),medications:z.array(z.object({medication_id:z.string(),drug_name:m,dose:m,route:m,frequency:m,sig:m,rx_number:m,started_on:m,stopped_on:m,doc_id:m})),disclaimer:z.string().optional()}),bo=z.object({document:Ve,contributions:z.array(Me),contribution_count:z.number().int().nonnegative().optional()});function Be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Be,"isObject");function Ue(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(Ue,"petOf");function qe(e,r){return Object.freeze({petRef:e,available:false,withheld:r,labResults:Object.freeze([]),encounters:Object.freeze([]),clinicianNotes:Object.freeze([]),physicalExams:Object.freeze([]),completeness:null,conflicts:Object.freeze([])})}o(qe,"emptyDepth");function ir(e,r){let t=Be(r)?r:{},n=Ue(t,e);if(t.withheld===true)return qe(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return qe(n,false);let l=mo.safeParse(t);if(!l.success)return qe(n,true);let s=l.data,c=o(i=>Object.freeze({at:i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,docId:i.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((s.lab_results??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.name,loincCode:i.loinc_code??null,unit:i.unit??null,panel:i.panel??null,meaning:i.meaning??null,latest:Object.freeze({at:i.latest?.at??null,value:i.latest?.value??null,unit:i.latest?.unit??null,qualitativeResult:i.latest?.qualitative_result??null,status:i.latest?.status??null}),trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(c))}))),encounters:Object.freeze((s.encounters??[]).map(i=>Object.freeze({encounterId:i.encounter_id,date:i.date??null,type:i.type??null,clinicName:i.clinic_name??null,veterinarian:i.veterinarian??null,docId:i.doc_id??null}))),clinicianNotes:Object.freeze((s.clinician_notes??[]).map(i=>Object.freeze({noteId:i.note_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,sections:Object.freeze((i.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((s.physical_exams??[]).map(i=>Object.freeze({examId:i.exam_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,docId:i.doc_id??null,systems:Object.freeze(Object.entries(i.systems??{}).map(([u,y])=>Object.freeze({system:u,findingStatus:y.finding_status??null,finding:y.finding??null})))}))),completeness:s.completeness?Object.freeze({hasLabHistory:s.completeness.has_lab_history===true,hasVaccinationHistory:s.completeness.has_vaccination_history===true,hasWeightHistory:s.completeness.has_weight_history===true,hasVitalsHistory:s.completeness.has_vitals_history===true,hasPhysicalExamHistory:s.completeness.has_physical_exam_history===true,hasProcedureHistory:s.completeness.has_procedure_history===true,hasGeneticHistory:s.completeness.has_genetic_history===true,hasReproductiveHistory:s.completeness.has_reproductive_history===true,hasParasitePreventionHistory:s.completeness.has_parasite_prevention_history===true,earliestRecordAt:s.completeness.earliest_record_at??null,latestRecordAt:s.completeness.latest_record_at??null,documentsIngested:s.completeness.documents_ingested??0,documentsInReview:s.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...s.completeness.entities_pending_review??{}}),heldTotal:s.completeness.held_total??0}):null,conflicts:Object.freeze((s.conflicts??[]).map(i=>Object.freeze({conflictId:i.conflict_id,entityType:i.entity_type,field:i.field??null,severity:i.severity??"needs_review",candidates:Object.freeze((i.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(ir,"mapRecordDepth");function or(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(or,"withheldTimeline");function ar(e,r){let t=Be(r)?r:{},n=Ue(t,e);if(t.withheld===true)return or(n);let a=go.safeParse(t);if(!a.success)return or(n);let l=a.data,s=l.visits.map(y=>Object.freeze({visitId:y.visit_id,visitDate:y.visit_date??null,veterinarian:y.veterinarian??null,summary:y.summary??null,docId:y.doc_id??null})),c=l.vaccines.map(y=>Object.freeze({vaccineId:y.vaccine_id,product:y.product??null,lot:y.lot??null,administeredOn:y.administered_on??null,expiresOn:y.expires_on??null,docId:y.doc_id??null})),i=l.weights.map(y=>Object.freeze({weightId:y.weight_id,observedOn:y.observed_on??null,weightKg:y.weight_kg??null,docId:y.doc_id??null})),u=l.medications.map(y=>Object.freeze({medicationId:y.medication_id,drugName:y.drug_name??null,dose:y.dose??null,route:y.route??null,frequency:y.frequency??null,sig:y.sig??null,rxNumber:y.rx_number??null,startedOn:y.started_on??null,stoppedOn:y.stopped_on??null,docId:y.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:s.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(s),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:l.disclaimer??""})}o(ar,"mapRecordsTimeline");function sr(e,r){let t=Be(r)?r:{},n=Ue(t,e),a=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return a();let l=bo.safeParse(t);if(!l.success)return a();let s=Object.freeze(l.data.contributions.map(Yt));return Object.freeze({petRef:n,withheld:false,document:Kt(l.data.document),contributions:s,contributionCount:l.data.contribution_count??s.length})}o(sr,"mapDocumentContributions");var ho="/widget/v1/records/pets";function lr(e){let r=e.funnel??Ut({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Wt(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,B))return N();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?$(E):F(q("internalError",{retryable:false}))},"read"),a=o(i=>`${ho}/${encodeURIComponent(i)}`,"pet"),l=o(i=>`${a(i)}/everfur_record`,"record"),s=o(async(i,u,y)=>{let _=await r.send(i,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!_.ok)return _;let h=y(_.value);return h===null?F(q("internalError",{retryable:false})):$(h)},"parsed"),c=o((i,u)=>!t(i.entityType,$t)||!t(i.canonicalKey,Gt)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Jt)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:i.entityType,canonical_key:i.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...i.idempotencyKey!==void 0?{idempotency_key:i.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(i=>n("records.depth.record",i,`${a(i)}/record`,u=>ir(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>ar(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>sr(i,y)):N()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Qt(i,u)),"getMarkers"),createShare(i){return t(i,B)?s("records.share.create",{method:"POST",path:`${l(i)}/share`},u=>er(u,e.apiBaseUrl)):N()},listShares(i){return t(i,B)?s("records.share.list",{method:"GET",path:`${l(i)}/shares`},tr):N()},async revokeShare(i,u){if(!t(i,B)||!t(u,64))return N();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${l(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?$(void 0):y},getPdfLink(i){return t(i,B)?s("records.pdf.link",{method:"GET",path:`${l(i)}/pdf-link`},rr):N()},async editFact(i,u){let y=t(i,B)?c(u,u.correctedFields):null;if(y===null)return N();let _=await r.send("records.fact.edit",{method:"POST",path:`${l(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},async removeFact(i,u){let y=t(i,B)?c(u):null;if(y===null)return N();let _=await r.send("records.fact.remove",{method:"POST",path:`${l(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},listRequestDocuments(i){return t(i,64)?s("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(i)}/documents`},Zt):N()},listAuthorizationSignatures:o(()=>s("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},nr),"listAuthorizationSignatures")}}o(lr,"createRecordsDepthClient");function N(){return Promise.resolve(F(q("validationFailed",{retryable:false})))}o(N,"invalid");var dr=Symbol.for("@everfur/sdk#EverfurContext@v1"),cr=globalThis,ur=cr[dr]??(cr[dr]=createContext(null));ur.displayName??="EverfurContext";function ie(){let e=useContext(ur);if(e===null)throw new te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(ie,"useEverfurContext");var wo=new Map,pr=new Set;function xo(e){return wo.get(e)??0}o(xo,"recordsConsentEpochOf");function Co(e){return pr.add(e),()=>{pr.delete(e);}}o(Co,"subscribe");function yr(e){let r=useCallback(()=>xo(e),[e]);return useSyncExternalStore(Co,r,r)}o(yr,"useRecordsConsentEpoch");function mr(){let{runtime:e,userRef:r,scopeEpoch:t}=ie();return useMemo(()=>{let{services:n}=e.registry;return lr({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(mr,"useEverfurRecordsDepthClient");function ae(e,r,t,n=""){let a=mr(),{userRef:l}=ie(),s=yr(e),c=useMemo(()=>({}),[a,e,n,s]),[i,u]=useState({scope:c,value:null,error:null,loading:true}),y=useRef(0),_=useCallback(async()=>{let j=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),l===null){u({scope:c,value:null,error:null,loading:false});return}let z=await r(a,e);j===y.current&&(z.ok?u({scope:c,value:z.value,error:null,loading:false}):u({scope:c,value:null,error:z.error,loading:false}));},[a,e,r,c,l]);useEffect(()=>(_(),()=>{y.current+=1;}),[_]);let h=i.scope===c?i:{value:null,error:null,loading:true},E=useCallback(()=>{_();},[_]),C=h.error===null||h.error.httpStatus!==404,k=C?h.error:null,I=h.loading?"loading":k!==null?"error":h.value===null?"empty":h.value.withheld?"populated":t(h.value)?"empty":"populated";return useMemo(()=>({status:I,value:h.value,error:k,available:C,refresh:E}),[I,h.value,k,C,E])}o(ae,"useRecordsDepthRead");var Ge=class Ge extends Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Ge,"HostRenderBoundary");var We=Ge;function Fo({render:e}){return e()}o(Fo,"RenderHost");function $e({render:e,fallback:r,resetKey:t}){return createElement(We,{fallback:r,resetKey:t,children:createElement(Fo,{render:e})})}o($e,"HostRender");var Io=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function Do(e){return Io[e]}o(Do,"requires");function br(e,r,t){let n=Do(e),a=new Map;for(let c of r)a.set(c.resource,c);if(t?.isPending===true&&n.some(c=>!a.has(c)))return Ye({name:e,enabled:false,isPending:true,limits:{}});let l=Po(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ye({name:e,enabled:true,isPending:false,limits:l}):Ye({name:e,enabled:false,isPending:false,limits:l,disabled:Ao(n,a)})}o(br,"decideCapability");function Po(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[l,s]of Object.entries(a)){let c=t[l];t[l]=c===void 0?s:Math.min(c,s);}}return t}o(Po,"mergeLimits");function Ao(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Ne("accessDenied"),level:"user_entitlement",recoverable:false})}o(Ao,"disabledFor");function Ye(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(Ye,"freezeDecision");function Ke(e){let{runtime:r}=ie(),t=r.entitlements,n=useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return useMemo(()=>br(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ke,"useCapability");var No=48;function Lo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Lo,"selectView");function _r(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:l}=e,s=Ke(r),c=useMemo(()=>Lo(s),[s]);switch(c){case "enabled":return t;case "pending":return a?jsx($e,{render:a,fallback:jsx(Rr,{capability:r,style:l})}):jsx(Rr,{capability:r,style:l});case "disabled":return n?jsx($e,{render:()=>n(s),fallback:jsx(vr,{decision:s,style:l}),resetKey:s}):jsx(vr,{decision:s,style:l});default:return Lt(c)}}o(_r,"CapabilityGate");function Rr({capability:e,style:r}){let t=w(),n=useMemo(()=>Er(t),[t]);return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsx(View,{style:n.skeletonBar})})}o(Rr,"PendingSkeleton");function vr({decision:e,style:r}){let t=w(),n=useMemo(()=>Er(t),[t]),a=e.disabled?.reason??"";return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsx(g,{style:n.offstateText,children:a}):null})}o(vr,"OffState");function Er(e){let{color:r,space:t,radius:n,type:a}=e;return StyleSheet.create({offstate:{minHeight:No,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...S(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Er,"makeStyles");var se=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function Cr(e){let r=w(),t=useMemo(()=>qo(r),[r]);return jsxs(View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${se.title}. ${se.body}`,children:[jsx(g,{style:t.title,children:se.title}),jsx(g,{style:t.body,children:se.body})]})}o(Cr,"ClinicalDisclaimer");function qo(e){let{color:r,space:t,type:n}=e;return StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...S(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...S(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(qo,"makeStyles");var Sr=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Je=60;function Tr(e){return `Try again in ${e}s`}o(Tr,"coolingActionLabel");var kr="Try again, available shortly";function Re({variant:e,onAction:r,message:t,testID:n}){let a=$o(),l=Sr[e],[s,c]=useState(e==="rate_limited"?Je:0);useEffect(()=>{e==="rate_limited"&&c(Je);},[e]),useEffect(()=>{if(s<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[s]);let i=e==="rate_limited"&&s>0,u=i?Tr(s):l.action;return jsxs(View,{style:a.container,accessibilityRole:"summary",testID:n,children:[jsx(View,{style:a.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsx(g,{style:a.title,children:l.title}),jsx(g,{style:a.body,children:t??l.body}),u!==null&&r?jsx(Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?kr:u,accessibilityState:{disabled:i},style:[a.action,i?a.actionDisabled:null],testID:n?`${n}-action`:`records-empty-${e}-action`,children:jsx(g,{style:a.actionLabel,children:u})}):null]})}o(Re,"RecordsEmptyState");function $o(){let e=w();return useMemo(()=>Go(e),[e])}o($o,"useStyles");function Go(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,s=t.lg+t.xs+t.xs/2;return StyleSheet.create({container:{paddingVertical:t.xxl,paddingHorizontal:t.xl,alignItems:"center",gap:t.sm+t.xs/2},glyph:{width:s,height:s,borderRadius:s/2,backgroundColor:r.brandSoft,borderWidth:StyleSheet.hairlineWidth,borderColor:r.brandBorder,marginBottom:t.xs},title:{...S(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...S(e,"regular"),fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.normal),color:r.text.muted,textAlign:"center",maxWidth:320},action:{marginTop:t.sm,minHeight:t.xxl+t.sm,borderRadius:n.pill,paddingHorizontal:t.lg+t.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...J(l.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...Z(l.primaryButton)}})}o(Go,"makeStyles");var Qo=120,Jo=44;function Zo({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:l,radius:s,type:c}=w();return jsxs(View,{testID:"records-gate-off",style:[{minHeight:Qo,justifyContent:"center",gap:l.md,padding:l.lg,borderRadius:s.md,borderWidth:1,borderColor:a.brandBorder,backgroundColor:a.surfaceCream},n],children:[e.length>0?jsx(g,{style:{fontSize:c.size.bodyTight,color:a.text.muted},children:e}):null,jsx(Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,testID:"records-gate-off-exit",style:{minHeight:Jo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:l.lg,borderRadius:s.pill,borderWidth:1.5,borderColor:a.brand},children:jsx(g,{style:{fontSize:c.size.body,color:a.brand},children:t})})]})}o(Zo,"RecordsGateOffState");function Dr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsx(Zo,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Dr,"recordsGateExit");var Ze="Back";function _e({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let l=oi();return jsxs(View,{style:l.row,testID:n,children:[r?jsx(Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:Ze,hitSlop:12,style:l.back,testID:n?`${n}-back`:void 0,children:jsx(View,{style:l.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsx(View,{style:l.back}),jsx(g,{style:a==="document"?l.documentTitle:l.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsx(View,{style:l.right,children:t??jsx(View,{style:l.back})})]})}o(_e,"ScreenHeader");function oi(){let e=w();return useMemo(()=>ii(e),[e])}o(oi,"useStyles");function ii(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,l=t.md,s=t.xs/2,c=t.lg+t.xs+t.xs/2;return StyleSheet.create({row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md,gap:t.sm},back:{width:a,height:a,alignItems:"center",justifyContent:"center"},chevron:{width:l,height:l,borderLeftWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginLeft:t.xs},title:{flex:1,...S(e,"bold"),fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.tight)+1,color:r.brandInk},documentTitle:{flex:1,textAlign:"center",...S(e,"bold"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.snug),color:r.text.primary},right:{flexDirection:"row",alignItems:"center",gap:t.sm+t.xs/2},listGlyph:{width:c,height:c,justifyContent:"space-evenly"},listBar:{height:s,borderRadius:s,backgroundColor:r.brandInk},shareGlyph:{width:c-t.xs,height:c-t.xs},shareDot:{position:"absolute",width:t.xs+t.xs/2,height:t.xs+t.xs/2,borderRadius:t.xs,borderWidth:s,borderColor:r.brandInk},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:t.xs+t.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:t.xs,top:t.sm,width:t.sm+t.xs/2,height:s,backgroundColor:r.brandInk},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:c-t.xs,height:c-t.xs},sendBody:{position:"absolute",left:0,top:0,right:0,bottom:0,borderWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:s},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:s,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:s,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginTop:-t.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:t.xs+t.xs/2,borderLeftWidth:s,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk}})}o(ii,"makeStyles");function K({width:e,height:r,radius:t,style:n}){let{color:a,radius:l}=w();return jsx(View,{style:[{width:e,height:r,borderRadius:t??l.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(K,"SkeletonBlock");var li=44,di=24,et=34,ci=6;function Ar({testID:e}){let r=ui();return jsxs(View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:b.loadingTimeline,testID:e,children:[jsx(View,{style:r.timelineDisclaimer,children:jsx(K,{width:"100%",height:li,radius:12})}),Array.from({length:ci},(t,n)=>jsxs(View,{children:[n>0?jsx(View,{style:r.timelineSeparator}):null,jsxs(View,{style:r.timelineRow,children:[jsx(K,{width:et,height:et,radius:et/2}),jsxs(View,{style:r.timelineBody,children:[jsxs(View,{style:r.timelineTop,children:[jsx(K,{width:44,height:10,radius:5}),jsx(K,{width:56,height:12,radius:6})]}),jsx(K,{width:"70%",height:14,radius:7}),n%2===0?jsx(K,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Ar,"TimelineSkeleton");var tt=62;function ui(){let e=w();return useMemo(()=>pi(e),[e])}o(ui,"useStyles");function pi(e){let{color:r,space:t,radius:n}=e,a=StyleSheet.hairlineWidth;return StyleSheet.create({dashboard:{flex:1,paddingHorizontal:t.sm,paddingTop:t.xs,gap:t.lg,backgroundColor:r.background},inset:{paddingHorizontal:t.sm},summaryCard:{alignItems:"center",borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg+t.xs,gap:t.md+t.xs/2},badges:{flexDirection:"row",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:t.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{alignSelf:"center"},actions:{gap:t.sm+t.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:t.md},request:{paddingHorizontal:t.lg,paddingTop:t.xs,gap:t.lg+t.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:t.md},railColumn:{alignItems:"center",width:di},connector:{marginVertical:t.xs/2},railBody:{flex:1,paddingBottom:t.lg+t.xs/2,gap:t.xs+t.xs/2},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,gap:t.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBody:{flex:1,gap:t.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:tt},clinics:{gap:t.md},clinicRow:{borderRadius:n.lg-t.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.md+t.xs/2,paddingVertical:t.md+t.xs/2,gap:t.sm},shares:{gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:t.xs+t.xs/2}})}o(pi,"makeStyles");var hi=300,Ri=o((e,r)=>e.getTimeline(r),"readTimeline"),vi=o(e=>e.isEmpty,"timelineEmpty"),_i=o((e,r)=>e.getRecordDepth(r),"readDepth"),Ei=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),wi=o(e=>e.contributions.length===0,"contributionsEmpty");function xi({petRef:e,style:r,onBack:t}){let n=ae(e,Ri,vi);return jsx(nt,{state:n,style:r,onBack:t,header:jsx(_e,{title:b.timeline,onBack:ee(t),testID:"timeline-header"}),loading:jsx(Ar,{testID:"timeline-loading"}),empty:jsx(Re,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsx(Oi,{timeline:a})})}o(xi,"EverfurRecordsTimeline");function Ci({petRef:e,style:r,onBack:t}){let n=ae(e,_i,Ei);return jsx(nt,{state:n,style:r,onBack:t,header:t?jsx(_e,{title:W.records,onBack:ee(t)}):null,render:a=>jsx(Fi,{depth:a})})}o(Ci,"EverfurRecordDepth");function Si({petRef:e,docId:r,style:t,onBack:n}){let a=useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),l=ae(e,a,wi,r),s=l.value?.document?.title?.trim()||b.uploadedDocument;return jsx(nt,{state:l,style:t,onBack:n,header:jsx(_e,{title:s,onBack:ee(n),testID:"contributions-header"}),empty:jsx(Re,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsx(Ii,{view:c})})}o(Si,"EverfurDocumentContributions");function nt({state:e,style:r,header:t,loading:n,empty:a,render:l,onBack:s}){let c=we();return jsx(_r,{capability:"records",style:r,...Dr(ee(s),Ze),children:jsxs(View,{style:[c.container,r],children:[t??null,jsx(View,{style:c.body,children:Ti(e,l,c,n,a)}),jsx(Cr,{})]})})}o(nt,"DepthSurface");function Ti(e,r,t,n,a){switch(e.status){case "loading":return n??jsx(ki,{styles:t});case "empty":return a??jsx(View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:W.empty,children:jsx(View,{style:t.emptyGlyph})});case "error":return e.error?jsx(Re,{variant:Rt(e.error),message:e.error.displayMessage,onAction:e.error.retryable?e.refresh:void 0,testID:"depth-error"}):null;case "populated":return e.value===null||e.value.withheld?null:r(e.value);default:return null}}o(Ti,"renderState");function ki({styles:e}){let[r,t]=useState(false);return useEffect(()=>{let n=setTimeout(()=>t(true),hi);return ()=>clearTimeout(n)},[]),jsx(View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:W.loading,children:r?jsx(ActivityIndicator,{}):null})}o(ki,"LoadingState");function Oi({timeline:e}){let r=we(),t=Pe(e);return jsxs(ScrollView,{style:r.list,contentContainerStyle:r.timelineContent,accessibilityLabel:b.timeline,children:[e.disclaimer.length>0?jsx(View,{style:r.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:ht.important(e.disclaimer),children:jsx(g,{style:r.timelineBandText,children:e.disclaimer})}):null,t.map((n,a)=>jsxs(View,{children:[a>0?jsx(View,{style:r.timelineSeparator}):null,jsxs(View,{style:r.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${n.kind}`,children:[jsx(View,{style:r.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxs(View,{style:r.timelineBody,children:[jsxs(View,{style:r.topLine,children:[jsx(g,{style:r.timelineKind,children:n.kindLabel}),jsx(g,{style:r.date,children:n.date})]}),jsx(g,{style:r.timelineTitle,children:n.title}),n.detail?jsx(g,{style:r.rowDetail,children:n.detail}):null]})]})]},n.key))]})}o(Oi,"TimelineBody");function Ee({title:e,count:r,styles:t}){return jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(Ee,"SectionHeader");function Fi({depth:e}){let r=we();return jsxs(ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.labResults.length>0?jsxs(View,{style:r.section,children:[jsx(Ee,{title:b.labResults,count:e.labResults.length,styles:r}),jsx(View,{style:r.card,children:e.labResults.map(t=>{let n=xt(t.latest.status),a=Tt(t.latest.at,t.trajectory,t.points.length);return jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,De(t.latest.value,t.latest.unit,t.latest.qualitativeResult),n.label,a].filter(Boolean).join(", "),children:[jsx(g,{style:r.rowTitle,children:t.name}),jsx(g,{style:r.rowValue,children:De(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),a?jsx(g,{style:r.rowDetail,children:a}):null,jsx(g,{style:[r.chip,n.outOfRange?r.chipCritical:r.chipNeutral],children:n.label}),t.meaning?jsx(g,{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxs(View,{style:r.section,children:[jsx(Ee,{title:b.visits,count:e.encounters.length,styles:r}),jsx(View,{style:r.card,children:e.encounters.map(t=>{let n=[t.date?O(t.date):null,t.clinicName,t.veterinarian].filter(a=>a&&a!=="-").join(" \xB7 ");return jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsx(g,{style:r.rowTitle,children:t.type?fe(t.type):b.visit}),n?jsx(g,{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxs(View,{style:r.section,children:[jsx(Ee,{title:b.physicalExams,count:e.physicalExams.length,styles:r}),e.physicalExams.map(t=>jsxs(View,{style:r.card,children:[jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.exam}),t.systems.map(n=>{let a=n.findingStatus==="abnormal",l=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Ie(n.system),l,a?n.finding:null].filter(Boolean).join(", "),children:[jsx(g,{style:r.rowTitle,children:Ie(n.system)}),a&&n.finding?jsx(g,{style:r.rowDetail,children:n.finding}):null,jsx(g,{style:[r.chip,a?r.chipCaution:r.chipNeutral],children:l})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxs(View,{style:r.section,children:[jsx(Ee,{title:b.visitNotes,count:e.clinicianNotes.length,styles:r}),e.clinicianNotes.map(t=>jsxs(View,{style:r.card,children:[jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.visitNote}),t.sections.map((n,a)=>jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsx(g,{style:r.kindLabel,children:Ct(n.section)}),jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(Fi,"DepthBody");function Ii({view:e}){let r=we();return jsxs(ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.document?.receivedAt?jsx(g,{style:r.rowDetail,children:O(e.document.receivedAt)}):null,jsx(View,{style:r.card,children:e.contributions.map(t=>jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsx(g,{style:r.rowTitle,children:t.label}),jsx(g,{style:r.rowValue,children:_t(t.value,t.unit)}),t.observedAt?jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(Ii,"ContributionsBody");function we(){let e=w();return useMemo(()=>Di(e),[e])}o(we,"useStyles");function Di(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,{size:s,lineHeight:c}=a,i=o((I,j)=>Math.round(I*j),"lh"),u=StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=Z(l.recordCard),C=o((I,j,z,H="regular")=>({...S(e,H),fontSize:I,lineHeight:i(I,j),color:z}),"text"),k=o((I,j,z,H="regular")=>({...C(I,j,z,H),...E}),"inCard");return StyleSheet.create({container:{flex:1,minHeight:y,backgroundColor:r.background},body:{flex:1},centered:{minHeight:y,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl,gap:t.lg},emptyGlyph:{width:t.xxl+t.sm,height:t.xxl+t.sm,borderRadius:n.lg,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},errorText:{...C(s.subtitle,c.snug,h),textAlign:"center",marginBottom:t.md},primaryButton:{minHeight:_,minWidth:_,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,...J(l.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:s.body,...Z(l.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(s.heading,c.snug,r.text.primary,"bold")},card:{gap:t.sm,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:u,borderColor:r.brandBorder,...J(l.recordCard,u)},row:{gap:t.xs,paddingVertical:t.xs,borderBottomWidth:u,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:t.md},kindLabel:{...k(s.caption,c.normal,r.text.muted,"medium")},date:k(s.caption,c.normal,r.text.muted),rowTitle:{...k(s.body,c.normal,r.text.primary,"bold")},rowValue:{...k(s.body,c.normal,r.text.primary,"medium")},rowDetail:k(s.bodyTight,c.normal,r.text.muted),rowMuted:{...k(s.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(s.caption,c.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:t.sm,paddingVertical:t.xs,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...C(s.caption,c.normal,r.text.muted),marginTop:t.md},timelineContent:{paddingBottom:t.xxl},timelineBand:{flexDirection:"row",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,marginHorizontal:t.lg,marginTop:t.xs,marginBottom:t.md},timelineBandText:{flex:1,...C(s.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:tt},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBubble:{width:t.xxl+t.xs/2,height:t.xxl+t.xs/2,borderRadius:n.pill,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},timelineBody:{flex:1,gap:t.xs-1},timelineKind:{...S(e,"mono"),fontSize:s.micro,lineHeight:s.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(s.body,c.normal,r.text.primary,"medium")}})}o(Di,"makeStyles");
2
+ export{Si as EverfurDocumentContributions,Ci as EverfurRecordDepth,xi as EverfurRecordsTimeline,Pe as buildTimelineRows,sr as mapDocumentContributions,ir as mapRecordDepth,ar as mapRecordsTimeline,mr as useEverfurRecordsDepthClient,ae as useRecordsDepthRead};