@everfur/sdk 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +634 -0
  2. package/README.md +58 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-DPUD6dnc.d.cts +128 -0
  5. package/dist/Chat-DwAC2vhB.d.ts +128 -0
  6. package/dist/DepthViews-DNEM96Se.d.ts +16 -0
  7. package/dist/DepthViews-DP0R-DhB.d.cts +19 -0
  8. package/dist/DepthViews-D_3hl4xk.d.ts +19 -0
  9. package/dist/DepthViews-DbFhR4Du.d.cts +16 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-5NeobOCd.d.ts +256 -0
  21. package/dist/attachments-Bw3iMQgu.d.ts +146 -0
  22. package/dist/attachments-CQgFrEQ7.d.cts +146 -0
  23. package/dist/attachments-D8T5re7e.d.cts +256 -0
  24. package/dist/casesRepository-ClLv6qMl.d.ts +188 -0
  25. package/dist/casesRepository-DHwtGRYY.d.cts +188 -0
  26. package/dist/chat/index.cjs +1 -1170
  27. package/dist/chat/index.d.cts +31 -53
  28. package/dist/chat/index.d.ts +31 -53
  29. package/dist/chat/index.js +1 -1167
  30. package/dist/client/index.cjs +9 -2315
  31. package/dist/client/index.d.cts +77 -15
  32. package/dist/client/index.d.ts +77 -15
  33. package/dist/client/index.js +9 -2215
  34. package/dist/{config-CiJ0PVBB.d.ts → config-CzTZGlfF.d.cts} +63 -25
  35. package/dist/{config-BSjBdxrZ.d.cts → config-DW60uRb9.d.ts} +63 -25
  36. package/dist/consent/index.cjs +1 -0
  37. package/dist/consent/index.d.cts +33 -0
  38. package/dist/consent/index.d.ts +33 -0
  39. package/dist/consent/index.js +1 -0
  40. package/dist/context-DXhqHlPU.d.ts +159 -0
  41. package/dist/context-XvTzq1tE.d.cts +159 -0
  42. package/dist/copy-Mjoo91aS.d.ts +198 -0
  43. package/dist/copy-bKDNigLb.d.cts +198 -0
  44. package/dist/core/index.cjs +13 -3178
  45. package/dist/core/index.d.cts +58 -12
  46. package/dist/core/index.d.ts +58 -12
  47. package/dist/core/index.js +13 -3166
  48. package/dist/depth-CErXCU8J.d.cts +502 -0
  49. package/dist/depth-DjDcJ6kH.d.ts +502 -0
  50. package/dist/entitlementRepository-DKdXFgTo.d.cts +698 -0
  51. package/dist/entitlementRepository-DSbzuyAW.d.ts +698 -0
  52. package/dist/{identity-DK9zORrG.d.ts → identity-BMx2SUOM.d.ts} +19 -6
  53. package/dist/{identity-Brl-lDd6.d.cts → identity-DI4eVx9S.d.cts} +19 -6
  54. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  55. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  56. package/dist/index.cjs +12 -4494
  57. package/dist/index.d.cts +29 -121
  58. package/dist/index.d.ts +29 -121
  59. package/dist/index.js +12 -4470
  60. package/dist/models-B-Uh2LTf.d.ts +214 -0
  61. package/dist/models-D2EUxPZY.d.cts +214 -0
  62. package/dist/notifications/index.cjs +2 -0
  63. package/dist/notifications/index.d.cts +17 -0
  64. package/dist/notifications/index.d.ts +17 -0
  65. package/dist/notifications/index.js +2 -0
  66. package/dist/pets-CtQdRpWo.d.ts +92 -0
  67. package/dist/pets-aB8q0JyX.d.cts +92 -0
  68. package/dist/photo/index.cjs +1 -2189
  69. package/dist/photo/index.d.cts +6 -6
  70. package/dist/photo/index.d.ts +6 -6
  71. package/dist/photo/index.js +1 -2186
  72. package/dist/ports-BN6RHF9W.d.cts +48 -0
  73. package/dist/ports-BN6RHF9W.d.ts +48 -0
  74. package/dist/ports-DEBzEhbp.d.cts +386 -0
  75. package/dist/ports-DMolTRzU.d.ts +386 -0
  76. package/dist/profile-CSs1wlXT.d.cts +93 -0
  77. package/dist/profile-CSs1wlXT.d.ts +93 -0
  78. package/dist/records/depth/index.cjs +2 -0
  79. package/dist/records/depth/index.d.cts +13 -0
  80. package/dist/records/depth/index.d.ts +13 -0
  81. package/dist/records/depth/index.js +2 -0
  82. package/dist/records/index.cjs +3 -2839
  83. package/dist/records/index.d.cts +137 -203
  84. package/dist/records/index.d.ts +137 -203
  85. package/dist/records/index.js +3 -2833
  86. package/dist/requestFunnel-CjW7uDuA.d.ts +87 -0
  87. package/dist/requestFunnel-L-BQfi0z.d.cts +87 -0
  88. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  89. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  90. package/dist/{runtime-Bvr8yqXm.d.cts → runtime-B8s-_hv8.d.cts} +121 -59
  91. package/dist/{runtime-BIYzf9cK.d.ts → runtime-BR9ysG0J.d.ts} +121 -59
  92. package/dist/server/events/index.cjs +2 -0
  93. package/dist/server/events/index.d.cts +550 -0
  94. package/dist/server/events/index.d.ts +550 -0
  95. package/dist/server/events/index.js +2 -0
  96. package/dist/server/index.cjs +2 -533
  97. package/dist/server/index.d.cts +73 -18
  98. package/dist/server/index.d.ts +73 -18
  99. package/dist/server/index.js +2 -530
  100. package/dist/species-BXAIMh7I.d.cts +9 -0
  101. package/dist/species-BXAIMh7I.d.ts +9 -0
  102. package/dist/televet/index.cjs +1 -0
  103. package/dist/televet/index.d.cts +60 -0
  104. package/dist/televet/index.d.ts +60 -0
  105. package/dist/televet/index.js +1 -0
  106. package/dist/testing/index.cjs +5 -823
  107. package/dist/testing/index.d.cts +17 -3
  108. package/dist/testing/index.d.ts +17 -3
  109. package/dist/testing/index.js +5 -820
  110. package/dist/testing/rn/index.cjs +1 -449
  111. package/dist/testing/rn/index.d.cts +17 -29
  112. package/dist/testing/rn/index.d.ts +17 -29
  113. package/dist/testing/rn/index.js +1 -444
  114. package/dist/testing/web/index.cjs +1 -0
  115. package/dist/testing/web/index.d.cts +131 -0
  116. package/dist/testing/web/index.d.ts +131 -0
  117. package/dist/testing/web/index.js +1 -0
  118. package/dist/timelineRows-CaohZzXS.d.cts +19 -0
  119. package/dist/timelineRows-DZed6dAM.d.ts +19 -0
  120. package/dist/typeStyle-0TydiZ1w.d.cts +19 -0
  121. package/dist/typeStyle-CWMsoe6b.d.ts +19 -0
  122. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  123. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  124. package/dist/useRecordsDepth-BHBzJ76R.d.cts +237 -0
  125. package/dist/useRecordsDepth-BU-OhzH6.d.ts +237 -0
  126. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  127. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  128. package/dist/video/index.cjs +1 -1941
  129. package/dist/video/index.d.cts +4 -4
  130. package/dist/video/index.d.ts +4 -4
  131. package/dist/video/index.js +1 -1938
  132. package/dist/view-C3qPIXGX.d.cts +310 -0
  133. package/dist/view-DtSPYpKa.d.ts +310 -0
  134. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  135. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  136. package/dist/web/consent/index.cjs +1 -0
  137. package/dist/web/consent/index.d.cts +34 -0
  138. package/dist/web/consent/index.d.ts +34 -0
  139. package/dist/web/consent/index.js +1 -0
  140. package/dist/web/index.cjs +14 -0
  141. package/dist/web/index.d.cts +217 -0
  142. package/dist/web/index.d.ts +217 -0
  143. package/dist/web/index.js +14 -0
  144. package/dist/web/notifications/index.cjs +2 -0
  145. package/dist/web/notifications/index.d.cts +213 -0
  146. package/dist/web/notifications/index.d.ts +213 -0
  147. package/dist/web/notifications/index.js +2 -0
  148. package/dist/web/records/depth/index.cjs +2 -0
  149. package/dist/web/records/depth/index.d.cts +12 -0
  150. package/dist/web/records/depth/index.d.ts +12 -0
  151. package/dist/web/records/depth/index.js +2 -0
  152. package/dist/web/records/index.cjs +4 -0
  153. package/dist/web/records/index.d.cts +194 -0
  154. package/dist/web/records/index.d.ts +194 -0
  155. package/dist/web/records/index.js +4 -0
  156. package/dist/web/televet/index.cjs +1 -0
  157. package/dist/web/televet/index.d.cts +50 -0
  158. package/dist/web/televet/index.d.ts +50 -0
  159. package/dist/web/televet/index.js +1 -0
  160. package/notifications/package.json +8 -0
  161. package/package.json +197 -9
  162. package/records/depth/package.json +8 -0
  163. package/server/events/device-blocked.cjs +15 -0
  164. package/server/events/package.json +9 -0
  165. package/televet/package.json +8 -0
  166. package/testing/web/native-blocked.cjs +12 -0
  167. package/testing/web/package.json +8 -0
  168. package/web/consent/native-blocked.cjs +12 -0
  169. package/web/consent/package.json +8 -0
  170. package/web/native-blocked.cjs +12 -0
  171. package/web/notifications/native-blocked.cjs +12 -0
  172. package/web/notifications/package.json +8 -0
  173. package/web/package.json +8 -0
  174. package/web/records/depth/native-blocked.cjs +12 -0
  175. package/web/records/depth/package.json +8 -0
  176. package/web/records/native-blocked.cjs +12 -0
  177. package/web/records/package.json +8 -0
  178. package/web/televet/native-blocked.cjs +12 -0
  179. package/web/televet/package.json +8 -0
  180. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  181. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  182. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  183. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  184. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  185. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  186. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  187. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -0,0 +1,2 @@
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Ar=Object.defineProperty;var o=(e,r)=>Ar(e,"name",{value:r,configurable:true});function ke(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ke(e[r]);}return e}o(ke,"deepFreeze");var jr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),at={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},st={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},it={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Nr={regular:"400",medium:"500",bold:"700"},Lr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Mr=0,ue="System",pe="monospace",Vr=["content","heading","control","compact","badge"];function Br(e){let r={};for(let t of Vr)r[t]=e;return r}o(Br,"authoredTierSizes");function lt(){return {family:ue,mono:pe,fontUrl:null,families:{regular:ue,medium:ue,bold:ue,mono:pe,monoMedium:pe,monoBold:pe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:it,tierSizes:Br(it),lineHeight:zr,weight:Nr,letterSpacing:Lr,scale:1,maxScale:Mr,scaleCaps:jr}}o(lt,"baseType");var dt={},Se=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Te(e){return `cubic-bezier(${e.join(", ")})`}o(Te,"cssCubicBezier");var ct={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Te(Se.standard),emphasized:Te(Se.emphasized),exit:Te(Se.exit)},reducedMotion:false},qr={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)"},ut=ke({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qr,space:at,radius:st,type:lt(),motion:ct,slots:dt}),Ur={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)"};ke({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ur,space:at,radius:st,type:lt(),motion:ct,slots:dt});var pt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),yt=globalThis,Oe=yt[pt]??(yt[pt]=react.createContext(ut));Oe.displayName??="EverfurThemeContext";function w(){return react.useContext(Oe)}o(w,"useEverfurTheme");function Kr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Kr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Kr(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 Q(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(Q,"slotBox");function J(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(J,"slotText");var Xr=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[Xr[r]]}}o(S,"face");function mt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(mt,"reportHostFailure");function Qr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Qr,"isThenable");function Jr(e,...r){if(typeof e=="function")try{let t=e(...r);return Qr(t)&&Promise.resolve(t).then(void 0,mt),t}catch(t){mt(t);return}}o(Jr,"callHost");var gt=new WeakMap;function Z(e){if(typeof e!="function")return;let r=gt.get(e);if(r!==void 0)return r;let t=o((...n)=>{Jr(e,...n);},"guarded");return gt.set(e,t),t}o(Z,"guardHost");var U=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 Zr="your pet";function L(e){let r=e?.trim()??"";return r.length>0?r:Zr}o(L,"petNameOr");var bt=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${L(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=>`${L(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${L(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 ${L(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${L(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${L(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 ${L(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${L(e)}\u2019s records`,"uploadDocumentA11y")});function ht(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(ht,"recordsEmptyVariantForError");function vt(e,r){return e===null?"":r?`${e} ${r}`:e}o(vt,"formatEntityValue");var Rt=["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=Rt[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 `${Rt[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 wt(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(wt,"markerStatusLabel");function en(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(en,"trajectoryLabel");function ye(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(ye,"humanize");var _t=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 Fe(e){return Object.prototype.hasOwnProperty.call(_t,e)?_t[e]:ye(e)}o(Fe,"bodySystemLabel");var Et=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 xt(e){return Object.prototype.hasOwnProperty.call(Et,e)?Et[e]:ye(e)}o(xt,"soapSectionLabel");function Ct(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(Ct,"formatWeightKg");function Ie(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(Ie,"formatMarkerReading");function St(e,r,t){let n=en(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(St,"labDetailLine");var fe=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function Tt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(Tt,"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:Ct(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(s=>!!s);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=Tt(t.at),s=Tt(n.at);return a===null&&s===null?fe[t.kind]-fe[n.kind]:a===null?1:s===null?-1:s!==a?s-a:fe[t.kind]-fe[n.kind]}))}o(Pe,"buildTimelineRows");var De=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(De.map(e=>e.wireCode));var tn=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"}),Ot=Object.freeze(De.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:tn[e.wireCode]}))),rn=new Map(Ot.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),nn=Object.freeze(["http_envelope",...[...new Set(Ot.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function me(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...nn]){let a=rn.get(n+t);if(a)return a}}o(me,"contractErrorFor");function on(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(on,"contractDocUrl");function Ft(e){return null}o(Ft,"publishedDocUrl");var an=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 It(e){return an[e]}o(It,"categoryFor");function Pt(e){let r=me(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 sn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Ae(e){return sn.has(e)}o(Ae,"isAutoRetryable");var ln=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Dt(e){return Ae(e)||ln.has(e)}o(Dt,"isRetryableCode");var dn=500,je=8e3,At=4;function jt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(dn*2**t,je);return Math.floor(r()*n)}o(jt,"backoffDelayMs");var cn=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 ze(e){return cn[e]}o(ze,"userFacingError");function zt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(zt,"defineHidden");var un=/^[a-z][a-z0-9_]{0,63}$/;function M(e,r){let t=me(r?.wireCode,r?.wireEnvelope),n={code:e,category:It(e),retryable:r?.retryable??Dt(e),displayMessage:ze(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&un.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&zt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&zt(n,"raw",r.raw),Object.freeze(n)}o(M,"makeEverfurError");function H(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(H,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var ge=class ge extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,ge.prototype);}};o(ge,"EverfurConfigError");var ee=ge;function Nt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Nt,"assertNever");function Lt(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(Lt,"errorFrame");function fn(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(fn,"authHeaders");function te(e,r){return {...e,headers:{...mn(e.headers),...fn(r)}}}o(te,"withAuthHeaders");function mn(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(mn,"stripAuthHeaders");async function Mt(e,r){if(r.mode==="anonymous")return r.transport.request(te(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(Ne())}let n=await r.transport.request(te(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(Ne())}let s=await r.transport.request(te(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?F(Ne(s.error.httpStatus)):s}o(Mt,"authedSend");function Ne(e){return M("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Ne,"authRejectedError");function Vt(e){return M("internalError",{retryable:true,wireMessage:gn(e)})}o(Vt,"networkError");function gn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(gn,"describeCause");var bn=3e4,hn=je*2,Rn="idempotency-key",vn=new Set(["POST","PUT","PATCH","DELETE"]),_n=Object.freeze({onEvent(){}}),En=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function qt(e){let r=e.observer??_n,t=e.timers??En,n=e.rng??Math.random,a=e.sleep??((h,E)=>jn(h,t,E)),s=e.maxAttempts??At,l=e.unaryTimeoutMs??bn,c=e.newIdempotencyKey??xn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??s),P=C?.idempotent??vn.has(E.method)?c():null,Y=wn(E,P),we=0;for(;;){let K=o(Ce=>Object.freeze({call:h,method:E.method,path:E.path,attempt:we,...P?{idempotencyKey:P}:{},...Ce}),"stamp");i(K({phase:"attempt"}));let nt=Dn(l,t),ot=An(nt.signal,E.signal),X;try{X=await Mt({...Y,signal:ot.signal},e.auth);}catch(Ce){X=F(Vt(Ce));}finally{ot.dispose(),nt.cancel();}if(X.ok)return i(K({phase:"settled",ok:true,reason:"ok"})),X;let N=X.error,ce=Sn(N,we,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),xe={ok:false,code:N.code,reason:ce.reason,...N.httpStatus!==void 0?{httpStatus:N.httpStatus}:{},...N.requestId!==void 0?{requestId:N.requestId}:{}};if(!ce.retry)return i(K({phase:"settled",...xe})),F(N);if(i(K({phase:"retry",...xe,delayMs:ce.delayMs})),await a(ce.delayMs,E.signal),E.signal?.aborted===true)return i(K({phase:"settled",...xe,reason:"aborted"})),F(N);we+=1;}}o(u,"send");async function y(h){return te(h,await Pn(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 Lt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(qt,"createRequestFunnel");function wn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==Rn&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(wn,"assembleHeaders");function xn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(xn,"defaultIdempotencyKeyFactory");var Cn=10;function Sn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=Tn(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Ae(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 l=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(Cn,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??l()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=kn(e,t.now);return i!==null?i>hn?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:jt(r,t.rng)}}o(Sn,"decideRetry");function Tn(e){let r=e.code==="unknown"?Pt(In(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(Tn,"throttleKind");function kn(e,r){let t=On(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(kn,"retryOverrideMs");function On(e){for(let r of Ut(e)){let t=r.resets_at,n=Fn(t);if(n!==null)return n}return null}o(On,"findResetsAt");function Ut(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(Ut,"candidateScopes");function Fn(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(Fn,"parseInstantMs");function In(e){for(let r of Ut(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(In,"rawWireCode");function Bt(e){return typeof e=="object"&&e!==null}o(Bt,"isRecord");async function Pn(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(Pn,"resolveDeviceAuth");function Dn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Dn,"boundedSignal");function An(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(An,"mergeSignals");function jn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",s),n();},e),s=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",s,{once:true});})}o(jn,"delayAbortable");function Ht(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(Ht,"hasLoneSurrogate");var Wt=64,$t=512;function Nn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(Nn,"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 Ln=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Le=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()}),Mn=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),Vn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Mn).optional()}),Bn=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),Me=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 Gt(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:Nn(e.origin),canonicalKey:e.canonical_key??null})}o(Gt,"mapEntityRow");function Yt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Yt,"mapDocumentRow");zod.z.object({identity:zod.z.array(Ln).optional(),entities:zod.z.array(Le).optional(),entity_series:zod.z.array(Vn).optional(),forward_looking:zod.z.array(Bn).optional(),documents:zod.z.array(Me).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(),be=zod.z.number().nullish(),qn=zod.z.object({collected_at:v,at:v,value:be,unit:v,qualitative_result:v,ref_low:be,ref_high:be,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:zod.z.boolean().nullish()}),Un=zod.z.object({collected_at:v,at:v,value:be,unit:v,qualitative_result:v,status:v}),Hn=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:Un.nullish(),trajectory:v,points:zod.z.array(qn).optional()}),Wn=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()}),$n=zod.z.object({markers:zod.z.array(Hn).optional(),summary:Wn.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:v});function Gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Gn,"isObject");function Kt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Kt,"withheldMarkers");function Xt(e,r){let t=Gn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Kt(n);let a=$n.safeParse(t);if(!a.success)return Kt(n);let s=a.data,l=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=(s.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(l))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:s.summary?Object.freeze({totalMarkers:s.summary.total_markers,inRangeCount:s.summary.in_range_count,outOfRangeCount:s.summary.out_of_range_count,unknownCount:s.summary.unknown_count}):null,disclaimer:s.disclaimer??"",featuredMarkerId:s.featured_marker_id??null})}o(Xt,"mapRecordMarkers");var Qt=128,V=128;var Yn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),re=zod.z.string().nullish(),Kn=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:re}),Xn=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:re,created_at:re,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:re})).optional()}),Qn=zod.z.object({download_url:Yn,expires_at:re});function Jn(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(Jn,"resolveShareUrl");function Jt(e,r){let t=Kn.safeParse(e);if(!t.success)return null;let n=Jn(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(Jt,"mapRecordShareLink");function Zt(e){let r=Xn.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(Zt,"mapRecordShareList");function er(e){let r=Qn.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(er,"mapRecordPdfLink");var Zn=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 tr(e){let r=Zn.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(tr,"mapSignatureSuggestions");var m=zod.z.string().nullish(),ne=zod.z.number().nullish(),eo=zod.z.object({at:m,value:ne,unit:m,qualitative_result:m,ref_low:ne,ref_high:ne,status:m,doc_id:m}),to=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:ne,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:zod.z.array(eo).optional()}),ro=zod.z.object({encounter_id:zod.z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),no=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()}),oo=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()}),io=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()}),ao=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()}),so=zod.z.object({lab_results:zod.z.array(to).optional(),encounters:zod.z.array(ro).optional(),clinician_notes:zod.z.array(no).optional(),physical_exams:zod.z.array(oo).optional(),completeness:io.nullish(),conflicts:zod.z.array(ao).optional()}),lo=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:ne,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()}),co=zod.z.object({document:Me,contributions:zod.z.array(Le),contribution_count:zod.z.number().int().nonnegative().optional()});function Be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Be,"isObject");function qe(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(qe,"petOf");function Ve(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(Ve,"emptyDepth");function nr(e,r){let t=Be(r)?r:{},n=qe(t,e);if(t.withheld===true)return Ve(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return Ve(n,false);let s=so.safeParse(t);if(!s.success)return Ve(n,true);let l=s.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((l.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((l.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((l.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((l.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:l.completeness?Object.freeze({hasLabHistory:l.completeness.has_lab_history===true,hasVaccinationHistory:l.completeness.has_vaccination_history===true,hasWeightHistory:l.completeness.has_weight_history===true,hasVitalsHistory:l.completeness.has_vitals_history===true,hasPhysicalExamHistory:l.completeness.has_physical_exam_history===true,hasProcedureHistory:l.completeness.has_procedure_history===true,hasGeneticHistory:l.completeness.has_genetic_history===true,hasReproductiveHistory:l.completeness.has_reproductive_history===true,hasParasitePreventionHistory:l.completeness.has_parasite_prevention_history===true,earliestRecordAt:l.completeness.earliest_record_at??null,latestRecordAt:l.completeness.latest_record_at??null,documentsIngested:l.completeness.documents_ingested??0,documentsInReview:l.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...l.completeness.entities_pending_review??{}}),heldTotal:l.completeness.held_total??0}):null,conflicts:Object.freeze((l.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(nr,"mapRecordDepth");function rr(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(rr,"withheldTimeline");function or(e,r){let t=Be(r)?r:{},n=qe(t,e);if(t.withheld===true)return rr(n);let a=lo.safeParse(t);if(!a.success)return rr(n);let s=a.data,l=s.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=s.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=s.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=s.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:l.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(l),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:s.disclaimer??""})}o(or,"mapRecordsTimeline");function ir(e,r){let t=Be(r)?r:{},n=qe(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 s=co.safeParse(t);if(!s.success)return a();let l=Object.freeze(s.data.contributions.map(Gt));return Object.freeze({petRef:n,withheld:false,document:Yt(s.data.document),contributions:l,contributionCount:s.data.contribution_count??l.length})}o(ir,"mapDocumentContributions");var uo="/widget/v1/records/pets";function ar(e){let r=e.funnel??qt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Ht(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,V))return B();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?H(E):F(M("internalError",{retryable:false}))},"read"),a=o(i=>`${uo}/${encodeURIComponent(i)}`,"pet"),s=o(i=>`${a(i)}/everfur_record`,"record"),l=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(M("internalError",{retryable:false})):H(h)},"parsed"),c=o((i,u)=>!t(i.entityType,Wt)||!t(i.canonicalKey,$t)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Qt)||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=>nr(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>or(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>ir(i,y)):B()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Xt(i,u)),"getMarkers"),createShare(i){return t(i,V)?l("records.share.create",{method:"POST",path:`${s(i)}/share`},u=>Jt(u,e.apiBaseUrl)):B()},listShares(i){return t(i,V)?l("records.share.list",{method:"GET",path:`${s(i)}/shares`},Zt):B()},async revokeShare(i,u){if(!t(i,V)||!t(u,64))return B();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${s(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?H(void 0):y},getPdfLink(i){return t(i,V)?l("records.pdf.link",{method:"GET",path:`${s(i)}/pdf-link`},er):B()},async editFact(i,u){let y=t(i,V)?c(u,u.correctedFields):null;if(y===null)return B();let _=await r.send("records.fact.edit",{method:"POST",path:`${s(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?H(void 0):_},async removeFact(i,u){let y=t(i,V)?c(u):null;if(y===null)return B();let _=await r.send("records.fact.remove",{method:"POST",path:`${s(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?H(void 0):_},listAuthorizationSignatures:o(()=>l("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},tr),"listAuthorizationSignatures")}}o(ar,"createRecordsDepthClient");function B(){return Promise.resolve(F(M("validationFailed",{retryable:false})))}o(B,"invalid");var sr=Symbol.for("@everfur/sdk#EverfurContext@v1"),lr=globalThis,dr=lr[sr]??(lr[sr]=react.createContext(null));dr.displayName??="EverfurContext";function oe(){let e=react.useContext(dr);if(e===null)throw new ee("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(oe,"useEverfurContext");var go=new Map,cr=new Set;function bo(e){return go.get(e)??0}o(bo,"recordsConsentEpochOf");function ho(e){return cr.add(e),()=>{cr.delete(e);}}o(ho,"subscribe");function ur(e){let r=react.useCallback(()=>bo(e),[e]);return react.useSyncExternalStore(ho,r,r)}o(ur,"useRecordsConsentEpoch");function yr(){let{runtime:e,userRef:r,scopeEpoch:t}=oe();return react.useMemo(()=>{let{services:n}=e.registry;return ar({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(yr,"useEverfurRecordsDepthClient");function ie(e,r,t,n=""){let a=yr(),{userRef:s}=oe(),l=ur(e),c=react.useMemo(()=>({}),[a,e,n,l]),[i,u]=react.useState({scope:c,value:null,error:null,loading:true}),y=react.useRef(0),_=react.useCallback(async()=>{let z=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),s===null){u({scope:c,value:null,error:null,loading:false});return}let P=await r(a,e);z===y.current&&(P.ok?u({scope:c,value:P.value,error:null,loading:false}):u({scope:c,value:null,error:P.error,loading:false}));},[a,e,r,c,s]);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(ie,"useRecordsDepthRead");var $e=class $e 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($e,"HostRenderBoundary");var He=$e;function wo({render:e}){return e()}o(wo,"RenderHost");function We({render:e,fallback:r,resetKey:t}){return react.createElement(He,{fallback:r,resetKey:t,children:react.createElement(wo,{render:e})})}o(We,"HostRender");var xo=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 Co(e){return xo[e]}o(Co,"requires");function mr(e,r,t){let n=Co(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 Ge({name:e,enabled:false,isPending:true,limits:{}});let s=So(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ge({name:e,enabled:true,isPending:false,limits:s}):Ge({name:e,enabled:false,isPending:false,limits:s,disabled:To(n,a)})}o(mr,"decideCapability");function So(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[s,l]of Object.entries(a)){let c=t[s];t[s]=c===void 0?l:Math.min(c,l);}}return t}o(So,"mergeLimits");function To(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:ze("accessDenied"),level:"user_entitlement",recoverable:false})}o(To,"disabledFor");function Ge(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(Ge,"freezeDecision");function Ye(e){let{runtime:r}=oe(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>mr(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ye,"useCapability");var Fo=48;function Io(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Io,"selectView");function Rr(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:s}=e,l=Ye(r),c=react.useMemo(()=>Io(l),[l]);switch(c){case "enabled":return t;case "pending":return a?jsxRuntime.jsx(We,{render:a,fallback:jsxRuntime.jsx(br,{capability:r,style:s})}):jsxRuntime.jsx(br,{capability:r,style:s});case "disabled":return n?jsxRuntime.jsx(We,{render:()=>n(l),fallback:jsxRuntime.jsx(hr,{decision:l,style:s}),resetKey:l}):jsxRuntime.jsx(hr,{decision:l,style:s});default:return Nt(c)}}o(Rr,"CapabilityGate");function br({capability:e,style:r}){let t=w(),n=react.useMemo(()=>vr(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(br,"PendingSkeleton");function hr({decision:e,style:r}){let t=w(),n=react.useMemo(()=>vr(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(hr,"OffState");function vr(e){let{color:r,space:t,radius:n,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:Fo,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(vr,"makeStyles");var ae=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 wr(e){let r=w(),t=react.useMemo(()=>Ao(r),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${ae.title}. ${ae.body}`,children:[jsxRuntime.jsx(g,{style:t.title,children:ae.title}),jsxRuntime.jsx(g,{style:t.body,children:ae.body})]})}o(wr,"ClinicalDisclaimer");function Ao(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(Ao,"makeStyles");var xr=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"})}),Qe=60;function Cr(e){return `Try again in ${e}s`}o(Cr,"coolingActionLabel");var Sr="Try again, available shortly";function he({variant:e,onAction:r,message:t,testID:n}){let a=Mo(),s=xr[e],[l,c]=react.useState(e==="rate_limited"?Qe:0);react.useEffect(()=>{e==="rate_limited"&&c(Qe);},[e]),react.useEffect(()=>{if(l<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[l]);let i=e==="rate_limited"&&l>0,u=i?Cr(l):s.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:s.title}),jsxRuntime.jsx(g,{style:a.body,children:t??s.body}),u!==null&&r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?Sr: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(he,"RecordsEmptyState");function Mo(){let e=w();return react.useMemo(()=>Vo(e),[e])}o(Mo,"useStyles");function Vo(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,l=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:l,height:l,borderRadius:l/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",...Q(s.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,...J(s.primaryButton)}})}o(Vo,"makeStyles");var Ho=120,Wo=44;function $o({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:s,radius:l,type:c}=w();return jsxRuntime.jsxs(reactNative.View,{testID:"records-gate-off",style:[{minHeight:Ho,justifyContent:"center",gap:s.md,padding:s.lg,borderRadius:l.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:Wo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:s.lg,borderRadius:l.pill,borderWidth:1.5,borderColor:a.brand},children:jsxRuntime.jsx(g,{style:{fontSize:c.size.body,color:a.brand},children:t})})]})}o($o,"RecordsGateOffState");function Fr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx($o,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Fr,"recordsGateExit");var Je="Back";function ve({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let s=Qo();return jsxRuntime.jsxs(reactNative.View,{style:s.row,testID:n,children:[r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:Je,hitSlop:12,style:s.back,testID:n?`${n}-back`:void 0,children:jsxRuntime.jsx(reactNative.View,{style:s.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsxRuntime.jsx(reactNative.View,{style:s.back}),jsxRuntime.jsx(g,{style:a==="document"?s.documentTitle:s.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsxRuntime.jsx(reactNative.View,{style:s.right,children:t??jsxRuntime.jsx(reactNative.View,{style:s.back})})]})}o(ve,"ScreenHeader");function Qo(){let e=w();return react.useMemo(()=>Jo(e),[e])}o(Qo,"useStyles");function Jo(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,s=t.md,l=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:s,height:s,borderLeftWidth:l,borderBottomWidth:l,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:l,borderRadius:l,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:l,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:l,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:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:l},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:l,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:l,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:l,borderBottomWidth:l,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:l,borderRightWidth:l,borderBottomWidth:l,borderColor:r.brandInk}})}o(Jo,"makeStyles");function G({width:e,height:r,radius:t,style:n}){let{color:a,radius:s}=w();return jsxRuntime.jsx(reactNative.View,{style:[{width:e,height:r,borderRadius:t??s.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(G,"SkeletonBlock");var ti=44,ri=24,Ze=34,ni=6;function Pr({testID:e}){let r=oi();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(G,{width:"100%",height:ti,radius:12})}),Array.from({length:ni},(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(G,{width:Ze,height:Ze,radius:Ze/2}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.timelineTop,children:[jsxRuntime.jsx(G,{width:44,height:10,radius:5}),jsxRuntime.jsx(G,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(G,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(G,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Pr,"TimelineSkeleton");var et=62;function oi(){let e=w();return react.useMemo(()=>ii(e),[e])}o(oi,"useStyles");function ii(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:ri},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:et},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(ii,"makeStyles");var ui=300,pi=o((e,r)=>e.getTimeline(r),"readTimeline"),yi=o(e=>e.isEmpty,"timelineEmpty"),fi=o((e,r)=>e.getRecordDepth(r),"readDepth"),mi=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),gi=o(e=>e.contributions.length===0,"contributionsEmpty");function bi({petRef:e,style:r,onBack:t}){let n=ie(e,pi,yi);return jsxRuntime.jsx(rt,{state:n,style:r,onBack:t,header:jsxRuntime.jsx(ve,{title:b.timeline,onBack:Z(t),testID:"timeline-header"}),loading:jsxRuntime.jsx(Pr,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(he,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsxRuntime.jsx(Ei,{timeline:a})})}o(bi,"EverfurRecordsTimeline");function hi({petRef:e,style:r,onBack:t}){let n=ie(e,fi,mi);return jsxRuntime.jsx(rt,{state:n,style:r,onBack:t,header:t?jsxRuntime.jsx(ve,{title:U.records,onBack:Z(t)}):null,render:a=>jsxRuntime.jsx(wi,{depth:a})})}o(hi,"EverfurRecordDepth");function Ri({petRef:e,docId:r,style:t,onBack:n}){let a=react.useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),s=ie(e,a,gi,r),l=s.value?.document?.title?.trim()||b.uploadedDocument;return jsxRuntime.jsx(rt,{state:s,style:t,onBack:n,header:jsxRuntime.jsx(ve,{title:l,onBack:Z(n),testID:"contributions-header"}),empty:jsxRuntime.jsx(he,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsxRuntime.jsx(xi,{view:c})})}o(Ri,"EverfurDocumentContributions");function rt({state:e,style:r,header:t,loading:n,empty:a,render:s,onBack:l}){let c=Ee();return jsxRuntime.jsx(Rr,{capability:"records",style:r,...Fr(Z(l),Je),children:jsxRuntime.jsxs(reactNative.View,{style:[c.container,r],children:[t??null,jsxRuntime.jsx(reactNative.View,{style:c.body,children:vi(e,s,c,n,a)}),jsxRuntime.jsx(wr,{})]})})}o(rt,"DepthSurface");function vi(e,r,t,n,a){switch(e.status){case "loading":return n??jsxRuntime.jsx(_i,{styles:t});case "empty":return a??jsxRuntime.jsx(reactNative.View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:U.empty,children:jsxRuntime.jsx(reactNative.View,{style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(he,{variant:ht(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(vi,"renderState");function _i({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),ui);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx(reactNative.View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:U.loading,children:r?jsxRuntime.jsx(reactNative.ActivityIndicator,{}):null})}o(_i,"LoadingState");function Ei({timeline:e}){let r=Ee(),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:bt.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(Ei,"TimelineBody");function _e({title:e,count:r,styles:t}){return jsxRuntime.jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(_e,"SectionHeader");function wi({depth:e}){let r=Ee();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:U.records,children:[e.labResults.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(_e,{title:b.labResults,count:e.labResults.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.labResults.map(t=>{let n=wt(t.latest.status),a=St(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,Ie(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:Ie(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(_e,{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?ye(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(_e,{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",s=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Fe(n.system),s,a?n.finding:null].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:Fe(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:s})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(_e,{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:xt(n.section)}),jsxRuntime.jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(wi,"DepthBody");function xi({view:e}){let r=Ee();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:U.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:vt(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(xi,"ContributionsBody");function Ee(){let e=w();return react.useMemo(()=>Ci(e),[e])}o(Ee,"useStyles");function Ci(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,{size:l,lineHeight:c}=a,i=o((I,z)=>Math.round(I*z),"lh"),u=reactNative.StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=J(s.recordCard),C=o((I,z,P,Y="regular")=>({...S(e,Y),fontSize:I,lineHeight:i(I,z),color:P}),"text"),k=o((I,z,P,Y="regular")=>({...C(I,z,P,Y),...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(l.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,...Q(s.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:l.body,...J(s.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(l.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,...Q(s.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(l.caption,c.normal,r.text.muted,"medium")},date:k(l.caption,c.normal,r.text.muted),rowTitle:{...k(l.body,c.normal,r.text.primary,"bold")},rowValue:{...k(l.body,c.normal,r.text.primary,"medium")},rowDetail:k(l.bodyTight,c.normal,r.text.muted),rowMuted:{...k(l.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(l.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(l.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(l.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:et},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:l.micro,lineHeight:l.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(l.body,c.normal,r.text.primary,"medium")}})}o(Ci,"makeStyles");
2
+ exports.EverfurDocumentContributions=Ri;exports.EverfurRecordDepth=hi;exports.EverfurRecordsTimeline=bi;exports.buildTimelineRows=Pe;exports.mapDocumentContributions=ir;exports.mapRecordDepth=nr;exports.mapRecordsTimeline=or;exports.useEverfurRecordsDepthClient=yr;exports.useRecordsDepthRead=ie;
@@ -0,0 +1,13 @@
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-DP0R-DhB.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-BHBzJ76R.cjs';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-CaohZzXS.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 RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../depth-CErXCU8J.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-L-BQfi0z.cjs';
11
+ import '../../ErrorPolicyPort-CNf4uQZP.cjs';
12
+ import '../../config-CzTZGlfF.cjs';
13
+ import '../../identity-DI4eVx9S.cjs';
@@ -0,0 +1,13 @@
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-D_3hl4xk.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-BU-OhzH6.js';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-DZed6dAM.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 RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../depth-DjDcJ6kH.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-CjW7uDuA.js';
11
+ import '../../ErrorPolicyPort-CwbfmxzJ.js';
12
+ import '../../config-DW60uRb9.js';
13
+ import '../../identity-BMx2SUOM.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 Ar=Object.defineProperty;var o=(e,r)=>Ar(e,"name",{value:r,configurable:true});function ke(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ke(e[r]);}return e}o(ke,"deepFreeze");var jr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),at={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},st={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},it={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Nr={regular:"400",medium:"500",bold:"700"},Lr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Mr=0,ue="System",pe="monospace",Vr=["content","heading","control","compact","badge"];function Br(e){let r={};for(let t of Vr)r[t]=e;return r}o(Br,"authoredTierSizes");function lt(){return {family:ue,mono:pe,fontUrl:null,families:{regular:ue,medium:ue,bold:ue,mono:pe,monoMedium:pe,monoBold:pe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:it,tierSizes:Br(it),lineHeight:zr,weight:Nr,letterSpacing:Lr,scale:1,maxScale:Mr,scaleCaps:jr}}o(lt,"baseType");var dt={},Se=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Te(e){return `cubic-bezier(${e.join(", ")})`}o(Te,"cssCubicBezier");var ct={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Te(Se.standard),emphasized:Te(Se.emphasized),exit:Te(Se.exit)},reducedMotion:false},qr={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)"},ut=ke({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qr,space:at,radius:st,type:lt(),motion:ct,slots:dt}),Ur={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)"};ke({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ur,space:at,radius:st,type:lt(),motion:ct,slots:dt});var pt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),yt=globalThis,Oe=yt[pt]??(yt[pt]=createContext(ut));Oe.displayName??="EverfurThemeContext";function w(){return useContext(Oe)}o(w,"useEverfurTheme");function Kr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Kr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Kr(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 Q(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(Q,"slotBox");function J(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(J,"slotText");var Xr=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[Xr[r]]}}o(S,"face");function mt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(mt,"reportHostFailure");function Qr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Qr,"isThenable");function Jr(e,...r){if(typeof e=="function")try{let t=e(...r);return Qr(t)&&Promise.resolve(t).then(void 0,mt),t}catch(t){mt(t);return}}o(Jr,"callHost");var gt=new WeakMap;function Z(e){if(typeof e!="function")return;let r=gt.get(e);if(r!==void 0)return r;let t=o((...n)=>{Jr(e,...n);},"guarded");return gt.set(e,t),t}o(Z,"guardHost");var U=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 Zr="your pet";function L(e){let r=e?.trim()??"";return r.length>0?r:Zr}o(L,"petNameOr");var bt=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${L(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=>`${L(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${L(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 ${L(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${L(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${L(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 ${L(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${L(e)}\u2019s records`,"uploadDocumentA11y")});function ht(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(ht,"recordsEmptyVariantForError");function vt(e,r){return e===null?"":r?`${e} ${r}`:e}o(vt,"formatEntityValue");var Rt=["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=Rt[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 `${Rt[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 wt(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(wt,"markerStatusLabel");function en(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(en,"trajectoryLabel");function ye(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(ye,"humanize");var _t=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 Fe(e){return Object.prototype.hasOwnProperty.call(_t,e)?_t[e]:ye(e)}o(Fe,"bodySystemLabel");var Et=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 xt(e){return Object.prototype.hasOwnProperty.call(Et,e)?Et[e]:ye(e)}o(xt,"soapSectionLabel");function Ct(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(Ct,"formatWeightKg");function Ie(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(Ie,"formatMarkerReading");function St(e,r,t){let n=en(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(St,"labDetailLine");var fe=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function Tt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(Tt,"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:Ct(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(s=>!!s);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=Tt(t.at),s=Tt(n.at);return a===null&&s===null?fe[t.kind]-fe[n.kind]:a===null?1:s===null?-1:s!==a?s-a:fe[t.kind]-fe[n.kind]}))}o(Pe,"buildTimelineRows");var De=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(De.map(e=>e.wireCode));var tn=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"}),Ot=Object.freeze(De.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:tn[e.wireCode]}))),rn=new Map(Ot.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),nn=Object.freeze(["http_envelope",...[...new Set(Ot.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function me(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...nn]){let a=rn.get(n+t);if(a)return a}}o(me,"contractErrorFor");function on(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(on,"contractDocUrl");function Ft(e){return null}o(Ft,"publishedDocUrl");var an=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 It(e){return an[e]}o(It,"categoryFor");function Pt(e){let r=me(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 sn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Ae(e){return sn.has(e)}o(Ae,"isAutoRetryable");var ln=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Dt(e){return Ae(e)||ln.has(e)}o(Dt,"isRetryableCode");var dn=500,je=8e3,At=4;function jt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(dn*2**t,je);return Math.floor(r()*n)}o(jt,"backoffDelayMs");var cn=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 ze(e){return cn[e]}o(ze,"userFacingError");function zt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(zt,"defineHidden");var un=/^[a-z][a-z0-9_]{0,63}$/;function M(e,r){let t=me(r?.wireCode,r?.wireEnvelope),n={code:e,category:It(e),retryable:r?.retryable??Dt(e),displayMessage:ze(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&un.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&zt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&zt(n,"raw",r.raw),Object.freeze(n)}o(M,"makeEverfurError");function H(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(H,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var ge=class ge extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,ge.prototype);}};o(ge,"EverfurConfigError");var ee=ge;function Nt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Nt,"assertNever");function Lt(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(Lt,"errorFrame");function fn(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(fn,"authHeaders");function te(e,r){return {...e,headers:{...mn(e.headers),...fn(r)}}}o(te,"withAuthHeaders");function mn(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(mn,"stripAuthHeaders");async function Mt(e,r){if(r.mode==="anonymous")return r.transport.request(te(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(Ne())}let n=await r.transport.request(te(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(Ne())}let s=await r.transport.request(te(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?F(Ne(s.error.httpStatus)):s}o(Mt,"authedSend");function Ne(e){return M("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Ne,"authRejectedError");function Vt(e){return M("internalError",{retryable:true,wireMessage:gn(e)})}o(Vt,"networkError");function gn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(gn,"describeCause");var bn=3e4,hn=je*2,Rn="idempotency-key",vn=new Set(["POST","PUT","PATCH","DELETE"]),_n=Object.freeze({onEvent(){}}),En=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function qt(e){let r=e.observer??_n,t=e.timers??En,n=e.rng??Math.random,a=e.sleep??((h,E)=>jn(h,t,E)),s=e.maxAttempts??At,l=e.unaryTimeoutMs??bn,c=e.newIdempotencyKey??xn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??s),P=C?.idempotent??vn.has(E.method)?c():null,Y=wn(E,P),we=0;for(;;){let K=o(Ce=>Object.freeze({call:h,method:E.method,path:E.path,attempt:we,...P?{idempotencyKey:P}:{},...Ce}),"stamp");i(K({phase:"attempt"}));let nt=Dn(l,t),ot=An(nt.signal,E.signal),X;try{X=await Mt({...Y,signal:ot.signal},e.auth);}catch(Ce){X=F(Vt(Ce));}finally{ot.dispose(),nt.cancel();}if(X.ok)return i(K({phase:"settled",ok:true,reason:"ok"})),X;let N=X.error,ce=Sn(N,we,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),xe={ok:false,code:N.code,reason:ce.reason,...N.httpStatus!==void 0?{httpStatus:N.httpStatus}:{},...N.requestId!==void 0?{requestId:N.requestId}:{}};if(!ce.retry)return i(K({phase:"settled",...xe})),F(N);if(i(K({phase:"retry",...xe,delayMs:ce.delayMs})),await a(ce.delayMs,E.signal),E.signal?.aborted===true)return i(K({phase:"settled",...xe,reason:"aborted"})),F(N);we+=1;}}o(u,"send");async function y(h){return te(h,await Pn(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 Lt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(qt,"createRequestFunnel");function wn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==Rn&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(wn,"assembleHeaders");function xn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(xn,"defaultIdempotencyKeyFactory");var Cn=10;function Sn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=Tn(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Ae(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 l=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(Cn,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??l()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=kn(e,t.now);return i!==null?i>hn?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:jt(r,t.rng)}}o(Sn,"decideRetry");function Tn(e){let r=e.code==="unknown"?Pt(In(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(Tn,"throttleKind");function kn(e,r){let t=On(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(kn,"retryOverrideMs");function On(e){for(let r of Ut(e)){let t=r.resets_at,n=Fn(t);if(n!==null)return n}return null}o(On,"findResetsAt");function Ut(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(Ut,"candidateScopes");function Fn(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(Fn,"parseInstantMs");function In(e){for(let r of Ut(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(In,"rawWireCode");function Bt(e){return typeof e=="object"&&e!==null}o(Bt,"isRecord");async function Pn(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(Pn,"resolveDeviceAuth");function Dn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Dn,"boundedSignal");function An(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(An,"mergeSignals");function jn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",s),n();},e),s=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",s,{once:true});})}o(jn,"delayAbortable");function Ht(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(Ht,"hasLoneSurrogate");var Wt=64,$t=512;function Nn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(Nn,"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 Ln=z.object({label:z.string(),value:z.string()}),Le=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()}),Mn=z.object({at:z.string(),value:z.number().nullish(),display:z.string().nullish(),origin:z.string().nullish()}),Vn=z.object({key:z.string(),label:z.string().optional(),points:z.array(Mn).optional()}),Bn=z.object({title:z.string(),detail:z.string().nullish(),due_at:z.string().nullish()}),Me=z.object({doc_id:z.string(),title:z.string().nullish(),page_count:z.number().nullish(),received_at:z.string().nullish()});function Gt(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:Nn(e.origin),canonicalKey:e.canonical_key??null})}o(Gt,"mapEntityRow");function Yt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Yt,"mapDocumentRow");z.object({identity:z.array(Ln).optional(),entities:z.array(Le).optional(),entity_series:z.array(Vn).optional(),forward_looking:z.array(Bn).optional(),documents:z.array(Me).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(),be=z.number().nullish(),qn=z.object({collected_at:v,at:v,value:be,unit:v,qualitative_result:v,ref_low:be,ref_high:be,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:z.boolean().nullish()}),Un=z.object({collected_at:v,at:v,value:be,unit:v,qualitative_result:v,status:v}),Hn=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:Un.nullish(),trajectory:v,points:z.array(qn).optional()}),Wn=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()}),$n=z.object({markers:z.array(Hn).optional(),summary:Wn.nullish(),disclaimer:z.string().optional(),featured_marker_id:v});function Gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Gn,"isObject");function Kt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Kt,"withheldMarkers");function Xt(e,r){let t=Gn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Kt(n);let a=$n.safeParse(t);if(!a.success)return Kt(n);let s=a.data,l=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=(s.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(l))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:s.summary?Object.freeze({totalMarkers:s.summary.total_markers,inRangeCount:s.summary.in_range_count,outOfRangeCount:s.summary.out_of_range_count,unknownCount:s.summary.unknown_count}):null,disclaimer:s.disclaimer??"",featuredMarkerId:s.featured_marker_id??null})}o(Xt,"mapRecordMarkers");var Qt=128,V=128;var Yn=z.string().min(1).refine(e=>e.startsWith("https://")),re=z.string().nullish(),Kn=z.object({share_id:z.string().min(1),share_url:z.string().min(1),expires_at:re}),Xn=z.object({shares:z.array(z.object({share_id:z.string().min(1),expires_at:re,created_at:re,view_count:z.number().int().nonnegative().nullish(),last_viewed_at:re})).optional()}),Qn=z.object({download_url:Yn,expires_at:re});function Jn(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(Jn,"resolveShareUrl");function Jt(e,r){let t=Kn.safeParse(e);if(!t.success)return null;let n=Jn(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(Jt,"mapRecordShareLink");function Zt(e){let r=Xn.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(Zt,"mapRecordShareList");function er(e){let r=Qn.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(er,"mapRecordPdfLink");var Zn=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 tr(e){let r=Zn.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(tr,"mapSignatureSuggestions");var m=z.string().nullish(),ne=z.number().nullish(),eo=z.object({at:m,value:ne,unit:m,qualitative_result:m,ref_low:ne,ref_high:ne,status:m,doc_id:m}),to=z.object({marker_id:z.string(),name:z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:z.object({at:m,value:ne,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:z.array(eo).optional()}),ro=z.object({encounter_id:z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),no=z.object({note_id:z.string(),encounter_id:m,observed_on:m,sections:z.array(z.object({section:z.string(),text:z.string()})).optional()}),oo=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()}),io=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()}),ao=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()}),so=z.object({lab_results:z.array(to).optional(),encounters:z.array(ro).optional(),clinician_notes:z.array(no).optional(),physical_exams:z.array(oo).optional(),completeness:io.nullish(),conflicts:z.array(ao).optional()}),lo=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:ne,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()}),co=z.object({document:Me,contributions:z.array(Le),contribution_count:z.number().int().nonnegative().optional()});function Be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Be,"isObject");function qe(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(qe,"petOf");function Ve(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(Ve,"emptyDepth");function nr(e,r){let t=Be(r)?r:{},n=qe(t,e);if(t.withheld===true)return Ve(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return Ve(n,false);let s=so.safeParse(t);if(!s.success)return Ve(n,true);let l=s.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((l.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((l.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((l.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((l.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:l.completeness?Object.freeze({hasLabHistory:l.completeness.has_lab_history===true,hasVaccinationHistory:l.completeness.has_vaccination_history===true,hasWeightHistory:l.completeness.has_weight_history===true,hasVitalsHistory:l.completeness.has_vitals_history===true,hasPhysicalExamHistory:l.completeness.has_physical_exam_history===true,hasProcedureHistory:l.completeness.has_procedure_history===true,hasGeneticHistory:l.completeness.has_genetic_history===true,hasReproductiveHistory:l.completeness.has_reproductive_history===true,hasParasitePreventionHistory:l.completeness.has_parasite_prevention_history===true,earliestRecordAt:l.completeness.earliest_record_at??null,latestRecordAt:l.completeness.latest_record_at??null,documentsIngested:l.completeness.documents_ingested??0,documentsInReview:l.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...l.completeness.entities_pending_review??{}}),heldTotal:l.completeness.held_total??0}):null,conflicts:Object.freeze((l.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(nr,"mapRecordDepth");function rr(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(rr,"withheldTimeline");function or(e,r){let t=Be(r)?r:{},n=qe(t,e);if(t.withheld===true)return rr(n);let a=lo.safeParse(t);if(!a.success)return rr(n);let s=a.data,l=s.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=s.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=s.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=s.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:l.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(l),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:s.disclaimer??""})}o(or,"mapRecordsTimeline");function ir(e,r){let t=Be(r)?r:{},n=qe(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 s=co.safeParse(t);if(!s.success)return a();let l=Object.freeze(s.data.contributions.map(Gt));return Object.freeze({petRef:n,withheld:false,document:Yt(s.data.document),contributions:l,contributionCount:s.data.contribution_count??l.length})}o(ir,"mapDocumentContributions");var uo="/widget/v1/records/pets";function ar(e){let r=e.funnel??qt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Ht(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,V))return B();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?H(E):F(M("internalError",{retryable:false}))},"read"),a=o(i=>`${uo}/${encodeURIComponent(i)}`,"pet"),s=o(i=>`${a(i)}/everfur_record`,"record"),l=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(M("internalError",{retryable:false})):H(h)},"parsed"),c=o((i,u)=>!t(i.entityType,Wt)||!t(i.canonicalKey,$t)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Qt)||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=>nr(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>or(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>ir(i,y)):B()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Xt(i,u)),"getMarkers"),createShare(i){return t(i,V)?l("records.share.create",{method:"POST",path:`${s(i)}/share`},u=>Jt(u,e.apiBaseUrl)):B()},listShares(i){return t(i,V)?l("records.share.list",{method:"GET",path:`${s(i)}/shares`},Zt):B()},async revokeShare(i,u){if(!t(i,V)||!t(u,64))return B();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${s(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?H(void 0):y},getPdfLink(i){return t(i,V)?l("records.pdf.link",{method:"GET",path:`${s(i)}/pdf-link`},er):B()},async editFact(i,u){let y=t(i,V)?c(u,u.correctedFields):null;if(y===null)return B();let _=await r.send("records.fact.edit",{method:"POST",path:`${s(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?H(void 0):_},async removeFact(i,u){let y=t(i,V)?c(u):null;if(y===null)return B();let _=await r.send("records.fact.remove",{method:"POST",path:`${s(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?H(void 0):_},listAuthorizationSignatures:o(()=>l("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},tr),"listAuthorizationSignatures")}}o(ar,"createRecordsDepthClient");function B(){return Promise.resolve(F(M("validationFailed",{retryable:false})))}o(B,"invalid");var sr=Symbol.for("@everfur/sdk#EverfurContext@v1"),lr=globalThis,dr=lr[sr]??(lr[sr]=createContext(null));dr.displayName??="EverfurContext";function oe(){let e=useContext(dr);if(e===null)throw new ee("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(oe,"useEverfurContext");var go=new Map,cr=new Set;function bo(e){return go.get(e)??0}o(bo,"recordsConsentEpochOf");function ho(e){return cr.add(e),()=>{cr.delete(e);}}o(ho,"subscribe");function ur(e){let r=useCallback(()=>bo(e),[e]);return useSyncExternalStore(ho,r,r)}o(ur,"useRecordsConsentEpoch");function yr(){let{runtime:e,userRef:r,scopeEpoch:t}=oe();return useMemo(()=>{let{services:n}=e.registry;return ar({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(yr,"useEverfurRecordsDepthClient");function ie(e,r,t,n=""){let a=yr(),{userRef:s}=oe(),l=ur(e),c=useMemo(()=>({}),[a,e,n,l]),[i,u]=useState({scope:c,value:null,error:null,loading:true}),y=useRef(0),_=useCallback(async()=>{let z=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),s===null){u({scope:c,value:null,error:null,loading:false});return}let P=await r(a,e);z===y.current&&(P.ok?u({scope:c,value:P.value,error:null,loading:false}):u({scope:c,value:null,error:P.error,loading:false}));},[a,e,r,c,s]);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(ie,"useRecordsDepthRead");var $e=class $e 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($e,"HostRenderBoundary");var He=$e;function wo({render:e}){return e()}o(wo,"RenderHost");function We({render:e,fallback:r,resetKey:t}){return createElement(He,{fallback:r,resetKey:t,children:createElement(wo,{render:e})})}o(We,"HostRender");var xo=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 Co(e){return xo[e]}o(Co,"requires");function mr(e,r,t){let n=Co(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 Ge({name:e,enabled:false,isPending:true,limits:{}});let s=So(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ge({name:e,enabled:true,isPending:false,limits:s}):Ge({name:e,enabled:false,isPending:false,limits:s,disabled:To(n,a)})}o(mr,"decideCapability");function So(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[s,l]of Object.entries(a)){let c=t[s];t[s]=c===void 0?l:Math.min(c,l);}}return t}o(So,"mergeLimits");function To(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:ze("accessDenied"),level:"user_entitlement",recoverable:false})}o(To,"disabledFor");function Ge(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(Ge,"freezeDecision");function Ye(e){let{runtime:r}=oe(),t=r.entitlements,n=useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return useMemo(()=>mr(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ye,"useCapability");var Fo=48;function Io(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Io,"selectView");function Rr(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:s}=e,l=Ye(r),c=useMemo(()=>Io(l),[l]);switch(c){case "enabled":return t;case "pending":return a?jsx(We,{render:a,fallback:jsx(br,{capability:r,style:s})}):jsx(br,{capability:r,style:s});case "disabled":return n?jsx(We,{render:()=>n(l),fallback:jsx(hr,{decision:l,style:s}),resetKey:l}):jsx(hr,{decision:l,style:s});default:return Nt(c)}}o(Rr,"CapabilityGate");function br({capability:e,style:r}){let t=w(),n=useMemo(()=>vr(t),[t]);return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsx(View,{style:n.skeletonBar})})}o(br,"PendingSkeleton");function hr({decision:e,style:r}){let t=w(),n=useMemo(()=>vr(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(hr,"OffState");function vr(e){let{color:r,space:t,radius:n,type:a}=e;return StyleSheet.create({offstate:{minHeight:Fo,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(vr,"makeStyles");var ae=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 wr(e){let r=w(),t=useMemo(()=>Ao(r),[r]);return jsxs(View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${ae.title}. ${ae.body}`,children:[jsx(g,{style:t.title,children:ae.title}),jsx(g,{style:t.body,children:ae.body})]})}o(wr,"ClinicalDisclaimer");function Ao(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(Ao,"makeStyles");var xr=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"})}),Qe=60;function Cr(e){return `Try again in ${e}s`}o(Cr,"coolingActionLabel");var Sr="Try again, available shortly";function he({variant:e,onAction:r,message:t,testID:n}){let a=Mo(),s=xr[e],[l,c]=useState(e==="rate_limited"?Qe:0);useEffect(()=>{e==="rate_limited"&&c(Qe);},[e]),useEffect(()=>{if(l<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[l]);let i=e==="rate_limited"&&l>0,u=i?Cr(l):s.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:s.title}),jsx(g,{style:a.body,children:t??s.body}),u!==null&&r?jsx(Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?Sr: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(he,"RecordsEmptyState");function Mo(){let e=w();return useMemo(()=>Vo(e),[e])}o(Mo,"useStyles");function Vo(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,l=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:l,height:l,borderRadius:l/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",...Q(s.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,...J(s.primaryButton)}})}o(Vo,"makeStyles");var Ho=120,Wo=44;function $o({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:s,radius:l,type:c}=w();return jsxs(View,{testID:"records-gate-off",style:[{minHeight:Ho,justifyContent:"center",gap:s.md,padding:s.lg,borderRadius:l.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:Wo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:s.lg,borderRadius:l.pill,borderWidth:1.5,borderColor:a.brand},children:jsx(g,{style:{fontSize:c.size.body,color:a.brand},children:t})})]})}o($o,"RecordsGateOffState");function Fr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsx($o,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Fr,"recordsGateExit");var Je="Back";function ve({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let s=Qo();return jsxs(View,{style:s.row,testID:n,children:[r?jsx(Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:Je,hitSlop:12,style:s.back,testID:n?`${n}-back`:void 0,children:jsx(View,{style:s.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsx(View,{style:s.back}),jsx(g,{style:a==="document"?s.documentTitle:s.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsx(View,{style:s.right,children:t??jsx(View,{style:s.back})})]})}o(ve,"ScreenHeader");function Qo(){let e=w();return useMemo(()=>Jo(e),[e])}o(Qo,"useStyles");function Jo(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,s=t.md,l=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:s,height:s,borderLeftWidth:l,borderBottomWidth:l,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:l,borderRadius:l,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:l,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:l,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:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:l},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:l,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:l,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:l,borderBottomWidth:l,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:l,borderRightWidth:l,borderBottomWidth:l,borderColor:r.brandInk}})}o(Jo,"makeStyles");function G({width:e,height:r,radius:t,style:n}){let{color:a,radius:s}=w();return jsx(View,{style:[{width:e,height:r,borderRadius:t??s.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(G,"SkeletonBlock");var ti=44,ri=24,Ze=34,ni=6;function Pr({testID:e}){let r=oi();return jsxs(View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:b.loadingTimeline,testID:e,children:[jsx(View,{style:r.timelineDisclaimer,children:jsx(G,{width:"100%",height:ti,radius:12})}),Array.from({length:ni},(t,n)=>jsxs(View,{children:[n>0?jsx(View,{style:r.timelineSeparator}):null,jsxs(View,{style:r.timelineRow,children:[jsx(G,{width:Ze,height:Ze,radius:Ze/2}),jsxs(View,{style:r.timelineBody,children:[jsxs(View,{style:r.timelineTop,children:[jsx(G,{width:44,height:10,radius:5}),jsx(G,{width:56,height:12,radius:6})]}),jsx(G,{width:"70%",height:14,radius:7}),n%2===0?jsx(G,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Pr,"TimelineSkeleton");var et=62;function oi(){let e=w();return useMemo(()=>ii(e),[e])}o(oi,"useStyles");function ii(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:ri},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:et},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(ii,"makeStyles");var ui=300,pi=o((e,r)=>e.getTimeline(r),"readTimeline"),yi=o(e=>e.isEmpty,"timelineEmpty"),fi=o((e,r)=>e.getRecordDepth(r),"readDepth"),mi=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),gi=o(e=>e.contributions.length===0,"contributionsEmpty");function bi({petRef:e,style:r,onBack:t}){let n=ie(e,pi,yi);return jsx(rt,{state:n,style:r,onBack:t,header:jsx(ve,{title:b.timeline,onBack:Z(t),testID:"timeline-header"}),loading:jsx(Pr,{testID:"timeline-loading"}),empty:jsx(he,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsx(Ei,{timeline:a})})}o(bi,"EverfurRecordsTimeline");function hi({petRef:e,style:r,onBack:t}){let n=ie(e,fi,mi);return jsx(rt,{state:n,style:r,onBack:t,header:t?jsx(ve,{title:U.records,onBack:Z(t)}):null,render:a=>jsx(wi,{depth:a})})}o(hi,"EverfurRecordDepth");function Ri({petRef:e,docId:r,style:t,onBack:n}){let a=useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),s=ie(e,a,gi,r),l=s.value?.document?.title?.trim()||b.uploadedDocument;return jsx(rt,{state:s,style:t,onBack:n,header:jsx(ve,{title:l,onBack:Z(n),testID:"contributions-header"}),empty:jsx(he,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsx(xi,{view:c})})}o(Ri,"EverfurDocumentContributions");function rt({state:e,style:r,header:t,loading:n,empty:a,render:s,onBack:l}){let c=Ee();return jsx(Rr,{capability:"records",style:r,...Fr(Z(l),Je),children:jsxs(View,{style:[c.container,r],children:[t??null,jsx(View,{style:c.body,children:vi(e,s,c,n,a)}),jsx(wr,{})]})})}o(rt,"DepthSurface");function vi(e,r,t,n,a){switch(e.status){case "loading":return n??jsx(_i,{styles:t});case "empty":return a??jsx(View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:U.empty,children:jsx(View,{style:t.emptyGlyph})});case "error":return e.error?jsx(he,{variant:ht(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(vi,"renderState");function _i({styles:e}){let[r,t]=useState(false);return useEffect(()=>{let n=setTimeout(()=>t(true),ui);return ()=>clearTimeout(n)},[]),jsx(View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:U.loading,children:r?jsx(ActivityIndicator,{}):null})}o(_i,"LoadingState");function Ei({timeline:e}){let r=Ee(),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:bt.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(Ei,"TimelineBody");function _e({title:e,count:r,styles:t}){return jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(_e,"SectionHeader");function wi({depth:e}){let r=Ee();return jsxs(ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:U.records,children:[e.labResults.length>0?jsxs(View,{style:r.section,children:[jsx(_e,{title:b.labResults,count:e.labResults.length,styles:r}),jsx(View,{style:r.card,children:e.labResults.map(t=>{let n=wt(t.latest.status),a=St(t.latest.at,t.trajectory,t.points.length);return jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,Ie(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:Ie(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(_e,{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?ye(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(_e,{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",s=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxs(View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Fe(n.system),s,a?n.finding:null].filter(Boolean).join(", "),children:[jsx(g,{style:r.rowTitle,children:Fe(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:s})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxs(View,{style:r.section,children:[jsx(_e,{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:xt(n.section)}),jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(wi,"DepthBody");function xi({view:e}){let r=Ee();return jsxs(ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:U.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:vt(t.value,t.unit)}),t.observedAt?jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(xi,"ContributionsBody");function Ee(){let e=w();return useMemo(()=>Ci(e),[e])}o(Ee,"useStyles");function Ci(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,{size:l,lineHeight:c}=a,i=o((I,z)=>Math.round(I*z),"lh"),u=StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=J(s.recordCard),C=o((I,z,P,Y="regular")=>({...S(e,Y),fontSize:I,lineHeight:i(I,z),color:P}),"text"),k=o((I,z,P,Y="regular")=>({...C(I,z,P,Y),...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(l.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,...Q(s.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:l.body,...J(s.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(l.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,...Q(s.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(l.caption,c.normal,r.text.muted,"medium")},date:k(l.caption,c.normal,r.text.muted),rowTitle:{...k(l.body,c.normal,r.text.primary,"bold")},rowValue:{...k(l.body,c.normal,r.text.primary,"medium")},rowDetail:k(l.bodyTight,c.normal,r.text.muted),rowMuted:{...k(l.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(l.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(l.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(l.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:et},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:l.micro,lineHeight:l.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(l.body,c.normal,r.text.primary,"medium")}})}o(Ci,"makeStyles");
2
+ export{Ri as EverfurDocumentContributions,hi as EverfurRecordDepth,bi as EverfurRecordsTimeline,Pe as buildTimelineRows,ir as mapDocumentContributions,nr as mapRecordDepth,or as mapRecordsTimeline,yr as useEverfurRecordsDepthClient,ie as useRecordsDepthRead};