@everfur/sdk 0.6.0 → 0.7.1

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 (156) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/dist/{Chat-CHqcgMyw.d.ts → Chat-CFi5cNUF.d.ts} +4 -4
  3. package/dist/{Chat-BoAvCWhI.d.cts → Chat-DQOsAumH.d.cts} +4 -4
  4. package/dist/{DepthViews-B0g83e_N.d.cts → DepthViews-C409ubw-.d.cts} +1 -1
  5. package/dist/{DepthViews-7Y8Ur058.d.ts → DepthViews-D81c95Ra.d.cts} +1 -1
  6. package/dist/{DepthViews-Dg2bIon_.d.ts → DepthViews-es8mIK0w.d.ts} +1 -1
  7. package/dist/{DepthViews-CT5mQld9.d.cts → DepthViews-uilL1NJZ.d.ts} +1 -1
  8. package/dist/IntakeMedia-BcjjUizr.d.ts +103 -0
  9. package/dist/IntakeMedia-CL_S2tZE.d.cts +103 -0
  10. package/dist/animations/index.cjs +1 -1
  11. package/dist/animations/index.d.cts +3 -3
  12. package/dist/animations/index.d.ts +3 -3
  13. package/dist/animations/index.js +1 -1
  14. package/dist/{attachments-C3HJNYQ7.d.cts → attachments-B2GjBgvF.d.cts} +2 -2
  15. package/dist/{attachments-rkox0ewd.d.cts → attachments-DI710no4.d.cts} +5 -5
  16. package/dist/{attachments-CfxsVg7W.d.ts → attachments-DNaSbmA3.d.ts} +2 -2
  17. package/dist/{attachments-CThFsH4b.d.ts → attachments-SF88N654.d.ts} +5 -5
  18. package/dist/{bookingCopy-Y3OGdoMT.d.ts → bookingCopy-D2N3RhsV.d.ts} +451 -50
  19. package/dist/{bookingCopy-Do3zMeXb.d.cts → bookingCopy-xlXxORCA.d.cts} +451 -50
  20. package/dist/{bookingTypes-DCs8mmBb.d.cts → bookingTypes-D4pD3tHs.d.cts} +13 -1
  21. package/dist/{bookingTypes-DCs8mmBb.d.ts → bookingTypes-D4pD3tHs.d.ts} +13 -1
  22. package/dist/{branding-DYWma2il.d.ts → branding-Bio5MM6g.d.cts} +3 -3
  23. package/dist/{branding-ChXm8gxI.d.cts → branding-ytH4jJq1.d.ts} +3 -3
  24. package/dist/{callCopy-CPe9mbwG.d.cts → callCopy-DHjem0R-.d.cts} +12 -1
  25. package/dist/{callCopy-CPe9mbwG.d.ts → callCopy-DHjem0R-.d.ts} +12 -1
  26. package/dist/{casesRepository-Jj6t60AY.d.cts → casesRepository-B-md8h1S.d.cts} +1 -1
  27. package/dist/{casesRepository-BbgXYPxa.d.ts → casesRepository-CC6951TK.d.ts} +1 -1
  28. package/dist/chat/index.cjs +1 -1
  29. package/dist/chat/index.d.cts +9 -9
  30. package/dist/chat/index.d.ts +9 -9
  31. package/dist/chat/index.js +1 -1
  32. package/dist/client/index.cjs +2 -2
  33. package/dist/client/index.d.cts +10 -10
  34. package/dist/client/index.d.ts +10 -10
  35. package/dist/client/index.js +2 -2
  36. package/dist/{config-Dfbj5mlx.d.ts → config-BM0sv5jx.d.ts} +1 -1
  37. package/dist/{config-BZX97FmW.d.cts → config-Daa1plhQ.d.cts} +1 -1
  38. package/dist/consent/index.cjs +1 -1
  39. package/dist/consent/index.d.cts +5 -5
  40. package/dist/consent/index.d.ts +5 -5
  41. package/dist/consent/index.js +1 -1
  42. package/dist/{context-Cbe0zYym.d.ts → context-CDV2pwGI.d.ts} +7 -7
  43. package/dist/{context-DJXnZ1Mx.d.cts → context-DQHtwcHN.d.cts} +7 -7
  44. package/dist/{copy-dKK5KoAQ.d.cts → copy-BEx5F71o.d.cts} +2 -2
  45. package/dist/{copy-DHekqSKE.d.ts → copy-Cl1l-qmY.d.ts} +2 -2
  46. package/dist/core/index.cjs +7 -7
  47. package/dist/core/index.d.cts +21 -21
  48. package/dist/core/index.d.ts +21 -21
  49. package/dist/core/index.js +7 -7
  50. package/dist/{depth-NmWSbvfi.d.cts → depth-CAAwiStc.d.cts} +132 -38
  51. package/dist/{depth-CrpRjWGB.d.ts → depth-DfNRVtrV.d.ts} +132 -38
  52. package/dist/{entitlementRepository-tVNazi8R.d.ts → entitlementRepository-CVWvND1P.d.ts} +3 -3
  53. package/dist/{entitlementRepository-iL-9vS1i.d.cts → entitlementRepository-DPvWjV-N.d.cts} +3 -3
  54. package/dist/{identity-B8rp0L9G.d.ts → identity-BhT7oJDS.d.ts} +1 -1
  55. package/dist/{identity-D7PO5s9m.d.cts → identity-DUlshgow.d.cts} +1 -1
  56. package/dist/index.cjs +6 -6
  57. package/dist/index.d.cts +17 -17
  58. package/dist/index.d.ts +17 -17
  59. package/dist/index.js +6 -6
  60. package/dist/notifications/index.d.cts +2 -2
  61. package/dist/notifications/index.d.ts +2 -2
  62. package/dist/{pets-BWx9BKea.d.cts → pets-Bneph9m1.d.cts} +1 -1
  63. package/dist/{pets-BQbXmICf.d.ts → pets-DjcLmRrW.d.ts} +1 -1
  64. package/dist/{petsRepository-SqIvEMiT.d.cts → petsRepository-BnVre3q7.d.cts} +1 -1
  65. package/dist/{petsRepository-0oBVydl6.d.ts → petsRepository-BwxmfX_s.d.ts} +1 -1
  66. package/dist/photo/index.cjs +1 -1
  67. package/dist/photo/index.js +1 -1
  68. package/dist/{ports-ChnzSy4E.d.cts → ports-BPKxFOSe.d.cts} +10 -9
  69. package/dist/{ports-iXPWd7Vt.d.ts → ports-Di9rdLO9.d.ts} +10 -9
  70. package/dist/records/depth/index.cjs +2 -2
  71. package/dist/records/depth/index.d.cts +7 -7
  72. package/dist/records/depth/index.d.ts +7 -7
  73. package/dist/records/depth/index.js +2 -2
  74. package/dist/records/index.cjs +3 -3
  75. package/dist/records/index.d.cts +19 -10
  76. package/dist/records/index.d.ts +19 -10
  77. package/dist/records/index.js +3 -3
  78. package/dist/{requestFunnel-CQzz2DIW.d.ts → requestFunnel-CiSX2pun.d.ts} +2 -2
  79. package/dist/{requestFunnel-DAwb7haa.d.cts → requestFunnel-DMR_1T3O.d.cts} +2 -2
  80. package/dist/{runtimeTypes-DB9-kigO.d.cts → runtimeTypes-2gJ5hYoE.d.cts} +5 -5
  81. package/dist/{runtimeTypes-BNOxfmfg.d.ts → runtimeTypes-CkMFCbHW.d.ts} +5 -5
  82. package/dist/server/events/index.cjs +1 -1
  83. package/dist/server/events/index.d.cts +2 -2
  84. package/dist/server/events/index.d.ts +2 -2
  85. package/dist/server/events/index.js +1 -1
  86. package/dist/server/index.cjs +1 -1
  87. package/dist/server/index.d.cts +3 -3
  88. package/dist/server/index.d.ts +3 -3
  89. package/dist/server/index.js +1 -1
  90. package/dist/televet/booking/index.cjs +4 -1
  91. package/dist/televet/booking/index.d.cts +116 -29
  92. package/dist/televet/booking/index.d.ts +116 -29
  93. package/dist/televet/booking/index.js +4 -1
  94. package/dist/televet/call/index.cjs +1 -1
  95. package/dist/televet/call/index.d.cts +1 -1
  96. package/dist/televet/call/index.d.ts +1 -1
  97. package/dist/televet/call/index.js +1 -1
  98. package/dist/televet/index.cjs +1 -1
  99. package/dist/televet/index.js +1 -1
  100. package/dist/testing/index.cjs +3 -3
  101. package/dist/testing/index.d.cts +1 -1
  102. package/dist/testing/index.d.ts +1 -1
  103. package/dist/testing/index.js +3 -3
  104. package/dist/testing/rn/index.cjs +1 -1
  105. package/dist/testing/rn/index.d.cts +14 -12
  106. package/dist/testing/rn/index.d.ts +14 -12
  107. package/dist/testing/rn/index.js +1 -1
  108. package/dist/testing/web/index.d.cts +9 -9
  109. package/dist/testing/web/index.d.ts +9 -9
  110. package/dist/{timelineRows-Dll2IGFg.d.ts → timelineRows-D3171ksh.d.ts} +1 -1
  111. package/dist/{timelineRows-BuNhzDbH.d.cts → timelineRows-DDnz4gx2.d.cts} +1 -1
  112. package/dist/{tokens-ARWZtMOU.d.cts → tokens-BYtbKwFh.d.cts} +6 -3
  113. package/dist/{tokens-ARWZtMOU.d.ts → tokens-BYtbKwFh.d.ts} +6 -3
  114. package/dist/{typeStyle-YCS8dt19.d.cts → typeStyle-BqfwxZH4.d.cts} +2 -2
  115. package/dist/{typeStyle-8iEqQmP_.d.ts → typeStyle-DKz02DGU.d.ts} +2 -2
  116. package/dist/{uploadTransport-C1p8FuG8.d.cts → uploadTransport-BM_pnEWj.d.cts} +5 -0
  117. package/dist/{uploadTransport-bZIKBTyK.d.ts → uploadTransport-C6kGP1Kd.d.ts} +5 -0
  118. package/dist/{useRecordsDepth-CNEHZJtj.d.cts → useRecordsDepth-COJ0wSYK.d.cts} +1 -1
  119. package/dist/{useRecordsDepth-CuNdne6E.d.ts → useRecordsDepth-Z9FF5X4E.d.ts} +1 -1
  120. package/dist/video/index.cjs +1 -1
  121. package/dist/video/index.js +1 -1
  122. package/dist/{view-DFy8EDwf.d.ts → view-DoQEHXJR.d.ts} +47 -5
  123. package/dist/{view-BhqWlYrZ.d.cts → view-nRy6SitU.d.cts} +47 -5
  124. package/dist/web/consent/index.cjs +1 -1
  125. package/dist/web/consent/index.d.cts +5 -5
  126. package/dist/web/consent/index.d.ts +5 -5
  127. package/dist/web/consent/index.js +1 -1
  128. package/dist/web/index.cjs +7 -7
  129. package/dist/web/index.d.cts +23 -22
  130. package/dist/web/index.d.ts +23 -22
  131. package/dist/web/index.js +7 -7
  132. package/dist/web/notifications/index.d.cts +3 -3
  133. package/dist/web/notifications/index.d.ts +3 -3
  134. package/dist/web/records/depth/index.cjs +2 -2
  135. package/dist/web/records/depth/index.d.cts +7 -7
  136. package/dist/web/records/depth/index.d.ts +7 -7
  137. package/dist/web/records/depth/index.js +2 -2
  138. package/dist/web/records/index.cjs +3 -3
  139. package/dist/web/records/index.d.cts +28 -17
  140. package/dist/web/records/index.d.ts +28 -17
  141. package/dist/web/records/index.js +3 -3
  142. package/dist/web/televet/booking/index.cjs +4 -2
  143. package/dist/web/televet/booking/index.d.cts +227 -123
  144. package/dist/web/televet/booking/index.d.ts +227 -123
  145. package/dist/web/televet/booking/index.js +4 -2
  146. package/dist/web/televet/call/index.cjs +1 -1
  147. package/dist/web/televet/call/index.d.cts +1 -1
  148. package/dist/web/televet/call/index.d.ts +1 -1
  149. package/dist/web/televet/call/index.js +1 -1
  150. package/dist/web/televet/index.cjs +3 -3
  151. package/dist/web/televet/index.d.cts +12 -4
  152. package/dist/web/televet/index.d.ts +12 -4
  153. package/dist/web/televet/index.js +3 -3
  154. package/package.json +1 -1
  155. package/dist/BookedScreen-BJPbXLCG.d.ts +0 -54
  156. package/dist/BookedScreen-Cnld-jB_.d.cts +0 -54
@@ -2,12 +2,12 @@ import { E as EverfurError } from '../../EverfurError-DmELDpXp.cjs';
2
2
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DmELDpXp.cjs';
3
3
  import { E as EverfurResult } from '../../EverfurResult-ZtH-YV1h.cjs';
4
4
  import { E as ErrorPolicyPort } from '../../ErrorPolicyPort-D6CybiqJ.cjs';
5
- import { A as AuthContext } from '../../identity-D7PO5s9m.cjs';
6
- export { I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-D7PO5s9m.cjs';
5
+ import { A as AuthContext } from '../../identity-DUlshgow.cjs';
6
+ export { I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-DUlshgow.cjs';
7
7
  import { U as UserRef, R as RecordsRequestId, P as PetRef, C as ConversationId } from '../../ids-B2GAAifq.cjs';
8
8
  export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.cjs';
9
9
  import { V as VetVisitIntent } from '../../visitIntent-D7_yVp1I.cjs';
10
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-BZX97FmW.cjs';
10
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-Daa1plhQ.cjs';
11
11
 
12
12
  /** The push providers the registration route accepts. `apns` is refused with `provider_unsupported` until APNs direct lands. */
13
13
  type PushProvider = 'expo' | 'fcm' | 'apns';
@@ -2,12 +2,12 @@ import { E as EverfurError } from '../../EverfurError-DmELDpXp.js';
2
2
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DmELDpXp.js';
3
3
  import { E as EverfurResult } from '../../EverfurResult-SGvHKsCB.js';
4
4
  import { E as ErrorPolicyPort } from '../../ErrorPolicyPort-D22LUVrK.js';
5
- import { A as AuthContext } from '../../identity-B8rp0L9G.js';
6
- export { I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-B8rp0L9G.js';
5
+ import { A as AuthContext } from '../../identity-BhT7oJDS.js';
6
+ export { I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-BhT7oJDS.js';
7
7
  import { U as UserRef, R as RecordsRequestId, P as PetRef, C as ConversationId } from '../../ids-B2GAAifq.js';
8
8
  export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
9
9
  import { V as VetVisitIntent } from '../../visitIntent-D7_yVp1I.js';
10
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-Dfbj5mlx.js';
10
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-BM0sv5jx.js';
11
11
 
12
12
  /** The push providers the registration route accepts. `apns` is refused with `provider_unsupported` until APNs direct lands. */
13
13
  type PushProvider = 'expo' | 'fcm' | 'apns';
@@ -1,2 +1,2 @@
1
- 'use strict';var react=require('react'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Pt=Object.defineProperty;var o=(e,r)=>Pt(e,"name",{value:r,configurable:true});function Ft(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(Ft,"slotBox");function U(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(U,"slotText");function L(e,r){let t=Ft(e,r),n={};return t.backgroundColor!==void 0&&(n.backgroundColor=t.backgroundColor),t.borderColor!==void 0&&(n.border=`${t.borderWidth??1}px solid ${t.borderColor}`),t.borderRadius!==void 0&&(n.borderRadius=t.borderRadius),n}o(L,"slotBoxCss");function Je(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(Je,"reportHostFailure");function Dt(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Dt,"isThenable");function It(e,...r){if(typeof e=="function")try{let t=e(...r);return Dt(t)&&Promise.resolve(t).then(void 0,Je),t}catch(t){Je(t);return}}o(It,"callHost");var Ze=new WeakMap;function J(e){if(typeof e!="function")return;let r=Ze.get(e);if(r!==void 0)return r;let t=o((...n)=>{It(e,...n);},"guarded");return Ze.set(e,t),t}o(J,"guardHost");function $(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o($,"ok");function O(e){return Object.freeze({ok:false,error:e})}o(O,"err");var ae=class ae extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,ae.prototype);}};o(ae,"EverfurConfigError");var Z=ae;var er=Symbol.for("@everfur/sdk#EverfurContext@v1"),rr=globalThis,tr=rr[er]??(rr[er]=react.createContext(null));tr.displayName??="EverfurContext";function M(){let e=react.useContext(tr);if(e===null)throw new Z("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(M,"useEverfurContext");var q=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 jt="your pet";function A(e){let r=e?.trim()??"";return r.length>0?r:jt}o(A,"petNameOr");var nr=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${A(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=>`${A(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${A(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 ${A(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${A(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${A(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 ${A(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${A(e)}\u2019s records`,"uploadDocumentA11y")});function or(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(or,"recordsEmptyVariantForError");function ar(e,r){return e===null?"":r?`${e} ${r}`:e}o(ar,"formatEntityValue");var ir=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function w(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let i=ir[Number(r[2])-1];return i===void 0?"-":`${i} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${ir[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(w,"formatRecordsDate");var h=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 dr(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(dr,"markerStatusLabel");function Nt(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(Nt,"trajectoryLabel");function se(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(se,"humanize");var sr=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 ur(e){return Object.prototype.hasOwnProperty.call(sr,e)?sr[e]:se(e)}o(ur,"bodySystemLabel");var lr=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 cr(e){return Object.prototype.hasOwnProperty.call(lr,e)?lr[e]:se(e)}o(cr,"soapSectionLabel");function pr(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(pr,"formatWeightKg");function fr(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(fr,"formatMarkerReading");function mr(e,r,t){let n=Nt(r,t);return e?`${h.measured(w(e))}${n?` \xB7 ${n}`:""}`:n}o(mr,"labDetailLine");var le=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function yr(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(yr,"toMillis");function _e(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:h.kind.visit,at:t.visitDate,date:w(t.visitDate),title:t.summary??h.clinicVisit,detail:t.veterinarian?h.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let i=[];return t.lot&&i.push(h.lot(t.lot)),t.expiresOn&&i.push(h.expires(w(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:h.kind.vaccine,at:t.administeredOn,date:w(t.administeredOn),title:t.product||h.kind.vaccine,detail:i.length?i.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:h.kind.weight,at:t.observedOn,date:w(t.observedOn),title:pr(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let i=[t.dose,t.route,t.frequency].filter(s=>!!s);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:h.kind.medication,at:t.startedOn,date:w(t.startedOn),title:t.drugName||h.kind.medication,detail:i.length?i.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let i=yr(t.at),s=yr(n.at);return i===null&&s===null?le[t.kind]-le[n.kind]:i===null?1:s===null?-1:s!==i?s-i:le[t.kind]-le[n.kind]}))}o(_e,"buildTimelineRows");var Ee=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(Ee.map(e=>e.wireCode));var Lt=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"}),br=Object.freeze(Ee.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Lt[e.wireCode]}))),Mt=new Map(br.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),qt=Object.freeze(["http_envelope",...[...new Set(br.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function de(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...qt]){let i=Mt.get(n+t);if(i)return i}}o(de,"contractErrorFor");function Bt(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Bt,"contractDocUrl");function hr(e){return null}o(hr,"publishedDocUrl");var Ut=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 vr(e){return Ut[e]}o(vr,"categoryFor");function Rr(e){let r=de(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":case "TELEVETRATELIMITED":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(Rr,"fromWire");var $t=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function xe(e){return $t.has(e)}o(xe,"isAutoRetryable");var Ht=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function _r(e){return xe(e)||Ht.has(e)}o(_r,"isRetryableCode");var Vt=500,Se=8e3,Er=4;function xr(e,r=Math.random){let t=Math.max(0,e),n=Math.min(Vt*2**t,Se);return Math.floor(r()*n)}o(xr,"backoffDelayMs");var Wt=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 Ce(e){return Wt[e]}o(Ce,"userFacingError");function Sr(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Sr,"defineHidden");var Yt=/^[a-z][a-z0-9_]{0,63}$/;function j(e,r){let t=de(r?.wireCode,r?.wireEnvelope),n={code:e,category:vr(e),retryable:r?.retryable??_r(e),displayMessage:Ce(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&Yt.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Sr(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Sr(n,"raw",r.raw),Object.freeze(n)}o(j,"makeEverfurError");function Cr(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Cr,"assertNever");function wr(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(wr,"errorFrame");function Xt(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(Xt,"authHeaders");function ee(e,r){return {...e,headers:{...Qt(e.headers),...Xt(r)}}}o(ee,"withAuthHeaders");function Qt(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let i=t.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[t]=n);}return r}o(Qt,"stripAuthHeaders");async function kr(e,r){if(r.mode==="anonymous")return r.transport.request(ee(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return O(we())}let n=await r.transport.request(ee(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return O(we())}let s=await r.transport.request(ee(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?O(we(s.error.httpStatus)):s}o(kr,"authedSend");function we(e){return j("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(we,"authRejectedError");function Tr(e){return j("internalError",{retryable:true,wireMessage:Jt(e)})}o(Tr,"networkError");function Jt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Jt,"describeCause");var Zt=3e4,en=Se*2,rn="idempotency-key",tn=new Set(["POST","PUT","PATCH","DELETE"]),nn=Object.freeze({onEvent(){}}),on=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function an(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(an,"seededIdempotencyKey");function Pr(e){let r=e.observer??nn,t=e.timers??on,n=e.rng??Math.random,i=e.sleep??((g,b)=>Rn(g,t,b)),s=e.maxAttempts??Er,c=e.unaryTimeoutMs??Zt,d=e.newIdempotencyKey??ln(),a=o(g=>{try{r.onEvent(g);}catch{}},"emit");async function u(g,b,E){let k=E?.maxAttempts,B=Math.max(1,k??s),ge=E?.idempotent??tn.has(b.method),G=E?.idempotencyKey===void 0?null:an(E.idempotencyKey),be=ge?G??d():null,Ot=sn(b,be),he=0;for(;;){let X=o(Re=>Object.freeze({call:g,method:b.method,path:b.path,attempt:he,...be?{idempotencyKey:be}:{},...Re}),"stamp");a(X({phase:"attempt"}));let Xe=hn(c,t),Qe=vn(Xe.signal,b.signal),Q;try{Q=await kr({...Ot,signal:Qe.signal},e.auth);}catch(Re){Q=O(Tr(Re));}finally{Qe.dispose(),Xe.cancel();}if(Q.ok)return a(X({phase:"settled",ok:true,reason:"ok"})),Q;let z=Q.error,ie=un(z,he,{maxAttempts:B,rng:n,now:t.now(),aborted:b.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),ve={ok:false,code:z.code,reason:ie.reason,...z.httpStatus!==void 0?{httpStatus:z.httpStatus}:{},...z.requestId!==void 0?{requestId:z.requestId}:{}};if(!ie.retry)return a(X({phase:"settled",...ve})),O(z);if(a(X({phase:"retry",...ve,delayMs:ie.delayMs})),await i(ie.delayMs,b.signal),b.signal?.aborted===true)return a(X({phase:"settled",...ve,reason:"aborted"})),O(z);he+=1;}}o(u,"send");async function f(g){return ee(g,await bn(e.auth))}o(f,"authorize");async function*v(g,b,E){a(Object.freeze({call:g,phase:"stream.open",method:b.method,path:b.path,attempt:0}));try{yield*e.auth.transport.stream(b,E);}catch{yield wr({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(v,"stream"),Object.freeze({send:u,authorize:f,stream:v})}o(Pr,"createRequestFunnel");function sn(e,r){let t={};for(let[n,i]of Object.entries(e.headers??{}))n.toLowerCase()!==rn&&(t[n]=i);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(sn,"assembleHeaders");function ln(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(ln,"defaultIdempotencyKeyFactory");var dn=10;function un(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=cn(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!xe(e.code))return {retry:false,reason:"terminal-code"};let i=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 c=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(dn,Math.floor(u)))},"policyCeiling"),d=t.perCallMaxAttempts??c()??t.maxAttempts;if(r+1>=d)return {retry:false,reason:"attempts-exhausted"};let a=pn(e,t.now);return a!==null?a>en?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:a}:{retry:true,reason:i,delayMs:xr(r,t.rng)}}o(un,"decideRetry");function cn(e){let r=e.code==="unknown"?Rr(gn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(cn,"throttleKind");function pn(e,r){let t=mn(e.raw);if(t!==null){let i=t-r;return i>0?i:0}let n=fn(e.raw);return n===null?null:Math.round(n*1e3)}o(pn,"retryOverrideMs");function fn(e){for(let r of ke(e)){let t=r.retry_after_seconds;if(typeof t=="number"&&Number.isFinite(t)&&t>=0)return t}return null}o(fn,"findRetryAfterSeconds");function mn(e){for(let r of ke(e)){let t=r.resets_at,n=yn(t);if(n!==null)return n}return null}o(mn,"findResetsAt");function ke(e){if(!Or(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Or(n)&&r.push(n);}return r}o(ke,"candidateScopes");function yn(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(yn,"parseInstantMs");function gn(e){for(let r of ke(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(gn,"rawWireCode");function Or(e){return typeof e=="object"&&e!==null}o(Or,"isRecord");async function bn(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(bn,"resolveDeviceAuth");function hn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(hn,"boundedSignal");function vn(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 i=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}o(vn,"mergeSignals");function Rn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let i=r.setTimeout(()=>{t?.removeEventListener("abort",s),n();},e),s=o(()=>{r.clearTimeout(i),n();},"onAbort");t?.addEventListener("abort",s,{once:true});})}o(Rn,"delayAbortable");function Fr(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(Fr,"hasLoneSurrogate");var Dr=64,Ir=512;function En(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(En,"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 xn=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Te=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()}),Sn=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),Cn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Sn).optional()}),wn=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),Oe=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 zr(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:En(e.origin),canonicalKey:e.canonical_key??null})}o(zr,"mapEntityRow");function Ar(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Ar,"mapDocumentRow");zod.z.object({identity:zod.z.array(xn).optional(),entities:zod.z.array(Te).optional(),entity_series:zod.z.array(Cn).optional(),forward_looking:zod.z.array(wn).optional(),documents:zod.z.array(Oe).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 R=zod.z.string().nullish(),ue=zod.z.number().nullish(),kn=zod.z.object({collected_at:R,at:R,value:ue,unit:R,qualitative_result:R,ref_low:ue,ref_high:ue,status:R,source_clinic:R,source_doc_id:R,doc_id:R,reviewed:zod.z.boolean().nullish()}),Tn=zod.z.object({collected_at:R,at:R,value:ue,unit:R,qualitative_result:R,status:R}),On=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:R,name:R,loinc_code:R,canonical_unit:R,unit:R,panel_name:R,panel:R,meaning_text:R,meaning:R,latest:Tn.nullish(),trajectory:R,points:zod.z.array(kn).optional()}),Pn=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()}),Fn=zod.z.object({markers:zod.z.array(On).optional(),summary:Pn.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:R});function Dn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Dn,"isObject");function jr(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(jr,"withheldMarkers");function Nr(e,r){let t=Dn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return jr(n);let i=Fn.safeParse(t);if(!i.success)return jr(n);let s=i.data,c=o(a=>Object.freeze({at:a.collected_at??a.at??null,value:a.value??null,unit:a.unit??null,qualitativeResult:a.qualitative_result??null,refLow:a.ref_low??null,refHigh:a.ref_high??null,status:a.status??null,sourceClinic:a.source_clinic??null,docId:a.source_doc_id??a.doc_id??null,reviewed:a.reviewed===true}),"point"),d=(s.markers??[]).map(a=>Object.freeze({markerId:a.marker_id,name:a.canonical_name??a.name??a.marker_id,loincCode:a.loinc_code??null,unit:a.canonical_unit??a.unit??null,panel:a.panel_name??a.panel??null,meaning:a.meaning_text??a.meaning??null,latest:a.latest?Object.freeze({at:a.latest.collected_at??a.latest.at??null,value:a.latest.value??null,unit:a.latest.unit??null,qualitativeResult:a.latest.qualitative_result??null,status:a.latest.status??null}):null,trajectory:a.trajectory??null,points:Object.freeze((a.points??[]).map(c))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(d),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(Nr,"mapRecordMarkers");var Lr=128,N=128;var In=zod.z.string().min(1).refine(e=>e.startsWith("https://")),zn=zod.z.object({source_doc_id:zod.z.string().min(1),file_name:zod.z.string().nullish(),doc_format:zod.z.string().nullish(),byte_size:zod.z.number().int().nonnegative().nullish(),received_at:zod.z.string().nullish(),download_url:In,expires_in_seconds:zod.z.number().int().nonnegative().nullish()}),An=zod.z.object({items:zod.z.array(zod.z.unknown()).optional()});function Mr(e){let r=An.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let i=zn.safeParse(n);i.success&&t.push(Object.freeze({sourceDocId:i.data.source_doc_id,fileName:i.data.file_name??null,docFormat:i.data.doc_format??null,byteSize:i.data.byte_size??null,receivedAt:i.data.received_at??null,downloadUrl:i.data.download_url,expiresInSeconds:i.data.expires_in_seconds??0}));}return Object.freeze(t)}o(Mr,"mapRequestDocuments");var jn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),re=zod.z.string().nullish(),Nn=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:re}),Ln=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()}),Mn=zod.z.object({download_url:jn,expires_at:re});function qn(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(qn,"resolveShareUrl");function qr(e,r){let t=Nn.safeParse(e);if(!t.success)return null;let n=qn(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(qr,"mapRecordShareLink");function Br(e){let r=Ln.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(Br,"mapRecordShareList");function Ur(e){let r=Mn.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(Ur,"mapRecordPdfLink");var Bn=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 $r(e){let r=Bn.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($r,"mapSignatureSuggestions");var y=zod.z.string().nullish(),te=zod.z.number().nullish(),Un=zod.z.object({at:y,value:te,unit:y,qualitative_result:y,ref_low:te,ref_high:te,status:y,doc_id:y}),$n=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:y,unit:y,panel:y,meaning:y,latest:zod.z.object({at:y,value:te,unit:y,qualitative_result:y,status:y}).nullish(),trajectory:y,points:zod.z.array(Un).optional()}),Hn=zod.z.object({encounter_id:zod.z.string(),date:y,type:y,clinic_name:y,veterinarian:y,doc_id:y}),Vn=zod.z.object({note_id:zod.z.string(),encounter_id:y,observed_on:y,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),Wn=zod.z.object({exam_id:zod.z.string(),encounter_id:y,observed_on:y,doc_id:y,systems:zod.z.record(zod.z.object({finding_status:y,finding:y})).optional()}),Yn=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:y,latest_record_at:y,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()}),Kn=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:y,severity:y,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:y,doc_id:y,collected_at:y})).optional()}),Gn=zod.z.object({lab_results:zod.z.array($n).optional(),encounters:zod.z.array(Hn).optional(),clinician_notes:zod.z.array(Vn).optional(),physical_exams:zod.z.array(Wn).optional(),completeness:Yn.nullish(),conflicts:zod.z.array(Kn).optional()}),Xn=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:y,veterinarian:y,summary:y,doc_id:y})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:y,lot:y,administered_on:y,expires_on:y,doc_id:y})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:y,weight_kg:te,doc_id:y})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:y,dose:y,route:y,frequency:y,sig:y,rx_number:y,started_on:y,stopped_on:y,doc_id:y})),disclaimer:zod.z.string().optional()}),Qn=zod.z.object({document:Oe,contributions:zod.z.array(Te),contribution_count:zod.z.number().int().nonnegative().optional()});function Fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Fe,"isObject");function De(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(De,"petOf");function Pe(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(Pe,"emptyDepth");function Vr(e,r){let t=Fe(r)?r:{},n=De(t,e);if(t.withheld===true)return Pe(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(a=>a in t))return Pe(n,false);let s=Gn.safeParse(t);if(!s.success)return Pe(n,true);let c=s.data,d=o(a=>Object.freeze({at:a.at??null,value:a.value??null,unit:a.unit??null,qualitativeResult:a.qualitative_result??null,refLow:a.ref_low??null,refHigh:a.ref_high??null,status:a.status??null,docId:a.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((c.lab_results??[]).map(a=>Object.freeze({markerId:a.marker_id,name:a.name,loincCode:a.loinc_code??null,unit:a.unit??null,panel:a.panel??null,meaning:a.meaning??null,latest:Object.freeze({at:a.latest?.at??null,value:a.latest?.value??null,unit:a.latest?.unit??null,qualitativeResult:a.latest?.qualitative_result??null,status:a.latest?.status??null}),trajectory:a.trajectory??null,points:Object.freeze((a.points??[]).map(d))}))),encounters:Object.freeze((c.encounters??[]).map(a=>Object.freeze({encounterId:a.encounter_id,date:a.date??null,type:a.type??null,clinicName:a.clinic_name??null,veterinarian:a.veterinarian??null,docId:a.doc_id??null}))),clinicianNotes:Object.freeze((c.clinician_notes??[]).map(a=>Object.freeze({noteId:a.note_id,encounterId:a.encounter_id??null,observedOn:a.observed_on??null,sections:Object.freeze((a.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((c.physical_exams??[]).map(a=>Object.freeze({examId:a.exam_id,encounterId:a.encounter_id??null,observedOn:a.observed_on??null,docId:a.doc_id??null,systems:Object.freeze(Object.entries(a.systems??{}).map(([u,f])=>Object.freeze({system:u,findingStatus:f.finding_status??null,finding:f.finding??null})))}))),completeness:c.completeness?Object.freeze({hasLabHistory:c.completeness.has_lab_history===true,hasVaccinationHistory:c.completeness.has_vaccination_history===true,hasWeightHistory:c.completeness.has_weight_history===true,hasVitalsHistory:c.completeness.has_vitals_history===true,hasPhysicalExamHistory:c.completeness.has_physical_exam_history===true,hasProcedureHistory:c.completeness.has_procedure_history===true,hasGeneticHistory:c.completeness.has_genetic_history===true,hasReproductiveHistory:c.completeness.has_reproductive_history===true,hasParasitePreventionHistory:c.completeness.has_parasite_prevention_history===true,earliestRecordAt:c.completeness.earliest_record_at??null,latestRecordAt:c.completeness.latest_record_at??null,documentsIngested:c.completeness.documents_ingested??0,documentsInReview:c.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...c.completeness.entities_pending_review??{}}),heldTotal:c.completeness.held_total??0}):null,conflicts:Object.freeze((c.conflicts??[]).map(a=>Object.freeze({conflictId:a.conflict_id,entityType:a.entity_type,field:a.field??null,severity:a.severity??"needs_review",candidates:Object.freeze((a.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(Vr,"mapRecordDepth");function Hr(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(Hr,"withheldTimeline");function Wr(e,r){let t=Fe(r)?r:{},n=De(t,e);if(t.withheld===true)return Hr(n);let i=Xn.safeParse(t);if(!i.success)return Hr(n);let s=i.data,c=s.visits.map(f=>Object.freeze({visitId:f.visit_id,visitDate:f.visit_date??null,veterinarian:f.veterinarian??null,summary:f.summary??null,docId:f.doc_id??null})),d=s.vaccines.map(f=>Object.freeze({vaccineId:f.vaccine_id,product:f.product??null,lot:f.lot??null,administeredOn:f.administered_on??null,expiresOn:f.expires_on??null,docId:f.doc_id??null})),a=s.weights.map(f=>Object.freeze({weightId:f.weight_id,observedOn:f.observed_on??null,weightKg:f.weight_kg??null,docId:f.doc_id??null})),u=s.medications.map(f=>Object.freeze({medicationId:f.medication_id,drugName:f.drug_name??null,dose:f.dose??null,route:f.route??null,frequency:f.frequency??null,sig:f.sig??null,rxNumber:f.rx_number??null,startedOn:f.started_on??null,stoppedOn:f.stopped_on??null,docId:f.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:c.length===0&&d.length===0&&a.length===0&&u.length===0,visits:Object.freeze(c),vaccines:Object.freeze(d),weights:Object.freeze(a),medications:Object.freeze(u),disclaimer:s.disclaimer??""})}o(Wr,"mapRecordsTimeline");function Yr(e,r){let t=Fe(r)?r:{},n=De(t,e),i=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return i();let s=Qn.safeParse(t);if(!s.success)return i();let c=Object.freeze(s.data.contributions.map(zr));return Object.freeze({petRef:n,withheld:false,document:Ar(s.data.document),contributions:c,contributionCount:s.data.contribution_count??c.length})}o(Yr,"mapDocumentContributions");var Jn="/widget/v1/records/pets";function Kr(e){let r=e.funnel??Pr({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((a,u)=>typeof a=="string"&&a.length>0&&!Fr(a)&&[...a].length<=u,"segment"),n=o(async(a,u,f,v)=>{if(!t(u,N))return I();let g=await r.send(a,{method:"GET",path:f});if(!g.ok)return g;let b=v(g.value);return b.petRef===u?$(b):O(j("internalError",{retryable:false}))},"read"),i=o(a=>`${Jn}/${encodeURIComponent(a)}`,"pet"),s=o(a=>`${i(a)}/everfur_record`,"record"),c=o(async(a,u,f)=>{let v=await r.send(a,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!v.ok)return v;let g=f(v.value);return g===null?O(j("internalError",{retryable:false})):$(g)},"parsed"),d=o((a,u)=>!t(a.entityType,Dr)||!t(a.canonicalKey,Ir)||a.idempotencyKey!==void 0&&!t(a.idempotencyKey,Lr)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:a.entityType,canonical_key:a.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...a.idempotencyKey!==void 0?{idempotency_key:a.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(a=>n("records.depth.record",a,`${i(a)}/record`,u=>Vr(a,u)),"getRecordDepth"),getTimeline:o(a=>n("records.depth.timeline",a,`${i(a)}/timeline`,u=>Wr(a,u)),"getTimeline"),getDocumentContributions(a,u){return t(u,64)?n("records.depth.contributions",a,`${i(a)}/documents/${encodeURIComponent(u)}/contributions`,f=>Yr(a,f)):I()},getMarkers:o(a=>n("records.depth.markers",a,`${i(a)}/markers`,u=>Nr(a,u)),"getMarkers"),createShare(a){return t(a,N)?c("records.share.create",{method:"POST",path:`${s(a)}/share`},u=>qr(u,e.apiBaseUrl)):I()},listShares(a){return t(a,N)?c("records.share.list",{method:"GET",path:`${s(a)}/shares`},Br):I()},async revokeShare(a,u){if(!t(a,N)||!t(u,64))return I();let f=await r.send("records.share.revoke",{method:"DELETE",path:`${s(a)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return f.ok?$(void 0):f},getPdfLink(a){return t(a,N)?c("records.pdf.link",{method:"GET",path:`${s(a)}/pdf-link`},Ur):I()},async editFact(a,u){let f=t(a,N)?d(u,u.correctedFields):null;if(f===null)return I();let v=await r.send("records.fact.edit",{method:"POST",path:`${s(a)}/facts/edit`,body:f},{idempotent:false,maxAttempts:1});return v.ok?$(void 0):v},async removeFact(a,u){let f=t(a,N)?d(u):null;if(f===null)return I();let v=await r.send("records.fact.remove",{method:"POST",path:`${s(a)}/facts/remove`,body:f},{idempotent:false,maxAttempts:1});return v.ok?$(void 0):v},listRequestDocuments(a){return t(a,64)?c("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(a)}/documents`},Mr):I()},listAuthorizationSignatures:o(()=>c("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},$r),"listAuthorizationSignatures")}}o(Kr,"createRecordsDepthClient");function I(){return Promise.resolve(O(j("validationFailed",{retryable:false})))}o(I,"invalid");var ro=new Map,Gr=new Set;function to(e){return ro.get(e)??0}o(to,"recordsConsentEpochOf");function no(e){return Gr.add(e),()=>{Gr.delete(e);}}o(no,"subscribe");function Xr(e){let r=react.useCallback(()=>to(e),[e]);return react.useSyncExternalStore(no,r,r)}o(Xr,"useRecordsConsentEpoch");function Jr(){let{runtime:e,userRef:r,scopeEpoch:t}=M();return react.useMemo(()=>{let{services:n}=e.registry;return Kr({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(Jr,"useEverfurRecordsDepthClient");function ne(e,r,t,n=""){let i=Jr(),{userRef:s}=M(),c=Xr(e),d=react.useMemo(()=>({}),[i,e,n,c]),[a,u]=react.useState({scope:d,value:null,error:null,loading:true}),f=react.useRef(0),v=react.useCallback(async()=>{let ge=f.current+=1;if(u({scope:d,value:null,error:null,loading:true}),s===null){u({scope:d,value:null,error:null,loading:false});return}let G=await r(i,e);ge===f.current&&(G.ok?u({scope:d,value:G.value,error:null,loading:false}):u({scope:d,value:null,error:G.error,loading:false}));},[i,e,r,d,s]);react.useEffect(()=>(v(),()=>{f.current+=1;}),[v]);let g=a.scope===d?a:{value:null,error:null,loading:true},b=react.useCallback(()=>{v();},[v]),E=g.error===null||g.error.httpStatus!==404,k=E?g.error:null,B=g.loading?"loading":k!==null?"error":g.value===null?"empty":g.value.withheld?"populated":t(g.value)?"empty":"populated";return react.useMemo(()=>({status:B,value:g.value,error:k,available:E,refresh:b}),[B,g.value,k,E,b])}o(ne,"useRecordsDepthRead");var je=class je 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(je,"HostRenderBoundary");var ze=je;function lo({render:e}){return e()}o(lo,"RenderHost");function Ae({render:e,fallback:r,resetKey:t}){return react.createElement(ze,{fallback:r,resetKey:t,children:react.createElement(lo,{render:e})})}o(Ae,"HostRender");function Me(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Me(e[r]);}return e}o(Me,"deepFreeze");var uo=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),rt={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},tt={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},et={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},co={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},po={regular:"400",medium:"500",bold:"700"},fo={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},mo=0,ce="System",pe="monospace",yo=["content","heading","control","compact","badge"];function go(e){let r={};for(let t of yo)r[t]=e;return r}o(go,"authoredTierSizes");function nt(){return {family:ce,mono:pe,fontUrl:null,families:{regular:ce,medium:ce,bold:ce,mono:pe,monoMedium:pe,monoBold:pe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:et,tierSizes:go(et),lineHeight:co,weight:po,letterSpacing:fo,scale:1,maxScale:mo,scaleCaps:uo}}o(nt,"baseType");var ot={},Ne=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Le(e){return `cubic-bezier(${e.join(", ")})`}o(Le,"cssCubicBezier");var it={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Le(Ne.standard),emphasized:Le(Ne.emphasized),exit:Le(Ne.exit)},reducedMotion:false},bo={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",onDanger:"#FFFFFF",errorRed:"#CC1600",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",bubbleVet:"#FFC3BC",onBubbleVet:"#111111",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},at=Me({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:bo,space:rt,radius:tt,type:nt(),motion:it,slots:ot}),ho={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",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#111111",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Me({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:ho,space:rt,radius:tt,type:nt(),motion:it,slots:ot});var st=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),lt=globalThis,qe=lt[st]??(lt[st]=react.createContext(at));qe.displayName??="EverfurThemeContext";function C(){return react.useContext(qe)}o(C,"useEverfurTheme");var dt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var ut='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',_o="System";function Eo(e){let r=e.trim();return r.length===0||r===_o?ut:`${ct(r)}, ${ut}`}o(Eo,"cssFontFamily");function xo(e){let r=e.trim();return r.length===0||r==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${ct(r)}, ui-monospace, Menlo, Consolas, monospace`}o(xo,"cssMonoFamily");function ct(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}o(ct,"quote");function _(e,r){let t=e.type,n=t.families[r];return {fontFamily:r==="mono"||r==="monoMedium"||r==="monoBold"?xo(n):Eo(n),fontWeight:t.namedFaces[r]?t.weight.regular:t.weight[dt[r]]}}o(_,"faceCss");var V=Object.freeze({textAlign:"start"});var So=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 So[e]}o(Co,"requires");function pt(e,r,t){let n=Co(e),i=new Map;for(let d of r)i.set(d.resource,d);if(t?.isPending===true&&n.some(d=>!i.has(d)))return Be({name:e,enabled:false,isPending:true,limits:{}});let s=wo(n,i);return n.filter(d=>i.get(d)?.granted!==true).length===0?Be({name:e,enabled:true,isPending:false,limits:s}):Be({name:e,enabled:false,isPending:false,limits:s,disabled:ko(n,i)})}o(pt,"decideCapability");function wo(e,r){let t={};for(let n of e){let i=r.get(n)?.limits;if(i)for(let[s,c]of Object.entries(i)){let d=t[s];t[s]=d===void 0?c:Math.min(d,c);}}return t}o(wo,"mergeLimits");function ko(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:Ce("accessDenied"),level:"user_entitlement",recoverable:false})}o(ko,"disabledFor");function Be(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(Be,"freezeDecision");function Ue(e){let{runtime:r}=M(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>pt(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ue,"useCapability");var Po=48;function Fo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Fo,"selectView");function yt(e){let{capability:r,children:t,renderDisabled:n,renderPending:i,style:s,className:c}=e,d=Ue(r),a=react.useMemo(()=>Fo(d),[d]);switch(a){case "enabled":return t;case "pending":return i?jsxRuntime.jsx(Ae,{render:i,fallback:jsxRuntime.jsx(ft,{capability:r,style:s,className:c})}):jsxRuntime.jsx(ft,{capability:r,style:s,className:c});case "disabled":return n?jsxRuntime.jsx(Ae,{render:()=>n(d),fallback:jsxRuntime.jsx(mt,{decision:d,style:s,className:c}),resetKey:d}):jsxRuntime.jsx(mt,{decision:d,style:s,className:c});default:return Cr(a)}}o(yt,"CapabilityGate");function ft({capability:e,style:r,className:t}){let n=C(),i=react.useMemo(()=>gt(n),[n]);return jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${e}`,className:t,style:{...i.offstate,...r},children:jsxRuntime.jsx("div",{style:i.skeletonBar})})}o(ft,"PendingSkeleton");function mt({decision:e,style:r,className:t}){let n=C(),i=react.useMemo(()=>gt(n),[n]),s=e.disabled?.reason??"";return jsxRuntime.jsx("div",{className:t,style:{...i.offstate,...r},children:s.length>0?jsxRuntime.jsx("p",{style:i.offstateText,children:s}):null})}o(mt,"OffState");function gt(e){let{color:r,space:t,radius:n,type:i}=e;return {offstate:{...V,boxSizing:"border-box",minHeight:Po,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${t.md}px ${t.lg}px`,backgroundColor:r.surfaceCream,borderRadius:n.md,border:`1px solid ${r.brandBorder}`},offstateText:{margin:0,..._(e,"regular"),fontSize:i.size.body,lineHeight:`${Math.round(i.size.body*i.lineHeight.normal)}px`,color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}}}o(gt,"makeStyles");var He=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 ht(e){let r=C(),t=react.useMemo(()=>Io(r),[r]);return jsxRuntime.jsxs("div",{role:"note",className:e.className,style:{...t.container,...e.style},children:[jsxRuntime.jsx("p",{style:t.title,children:He.title}),jsxRuntime.jsx("p",{style:t.body,children:He.body})]})}o(ht,"ClinicalDisclaimer");function Io(e){let{color:r,space:t,type:n}=e,i=`${Math.round(n.size.caption*n.lineHeight.snug)}px`;return {container:{...V,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.xs,padding:`${t.md}px ${t.lg}px`,borderTop:`1px solid ${r.borderHairlineGreen}`,backgroundColor:r.surfaceCream},title:{margin:0,..._(e,"bold"),fontSize:n.size.caption,lineHeight:i,color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{margin:0,..._(e,"regular"),fontSize:n.size.caption,lineHeight:i,color:r.text.muted}}}o(Io,"makeStyles");var Ao=120,jo=44;function No({reason:e,onExit:r,exitLabel:t,style:n,className:i}){let{color:s,space:c,radius:d,type:a}=C();return jsxRuntime.jsxs("div",{className:i,"data-testid":"records-gate-off",style:{boxSizing:"border-box",minHeight:Ao,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:c.md,padding:c.lg,borderRadius:d.md,border:`1px solid ${s.brandBorder}`,backgroundColor:s.surfaceCream,color:s.text.primary,...n},children:[e.length>0?jsxRuntime.jsx("p",{style:{margin:0,fontSize:a.size.bodyTight,color:s.text.muted},children:e}):null,jsxRuntime.jsx("button",{type:"button",onClick:r,"data-testid":"records-gate-off-exit",style:{minHeight:jo,padding:`0 ${c.lg}px`,borderRadius:d.pill,border:`1.5px solid ${s.brandInk}`,backgroundColor:"transparent",color:s.brandInk,font:"inherit",fontSize:a.size.body,cursor:"pointer"},children:t})]})}o(No,"RecordsGateOffState");function vt(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx(No,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(vt,"recordsGateExit");var Rt="data-ef-screen-heading";var qo=120,oe=44,We="Back";function Bo(){let e=C(),r=react.useMemo(()=>Uo(e),[e]);return {theme:e,styles:r}}o(Bo,"useScreenStyles");function fe({title:e,onBack:r,right:t,testID:n,variant:i="brand"}){let{styles:s}=Bo();return jsxRuntime.jsxs("header",{style:s.headerRow,"data-testid":n,children:[r?jsxRuntime.jsx("button",{type:"button",onClick:r,"aria-label":We,style:s.iconButton,"data-testid":n?`${n}-back`:void 0,children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:s.backChevron})}):jsxRuntime.jsx("span",{style:s.iconButton}),jsxRuntime.jsx("h2",{tabIndex:-1,[Rt]:"",style:i==="document"?s.documentTitle:s.headerTitle,children:e}),jsxRuntime.jsx("div",{style:s.headerRight,children:t??jsxRuntime.jsx("span",{style:s.iconButton})})]})}o(fe,"ScreenHeader");function Uo(e){let{color:r,space:t,radius:n,type:i,slots:s}=e,c=o((b,E)=>`${Math.round(b*E)}px`,"lh"),d=o((b,E,k,B="regular")=>({margin:0,..._(e,B),fontSize:b,lineHeight:c(b,E),color:k}),"text"),a=U(s.recordCard),u=`1px solid ${r.brandBorder}`,f=e.brightness==="dark"?r.errorRed:r.danger,v=o((b,E)=>({backgroundColor:b,color:E}),"tone"),g={boxSizing:"border-box",minHeight:oe,minWidth:oe,padding:`${t.md}px ${t.lg+t.xs/2}px`,borderRadius:n.pill,..._(e,"bold"),fontSize:i.size.body,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:t.sm,textDecoration:"none"};return {chipTones:{neutral:v(r.badgeBgNeutral,r.text.secondary),info:v(r.brandSoft,r.brandInk),warning:v(r.badgeBgCaution,r.warningStrong),critical:v(r.badgeBgCritical,r.danger),positive:v(r.badgeBgPositive,r.success)},root:{...V,boxSizing:"border-box",display:"flex",flexDirection:"column",minHeight:qo,height:"100%",backgroundColor:r.background,color:r.text.primary,..._(e,"regular")},body:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"},content:{display:"flex",flexDirection:"column",gap:t.lg,padding:`0 ${t.lg}px ${t.xxl}px`},contentTight:{display:"flex",flexDirection:"column",gap:t.lg,padding:`0 ${t.sm}px ${t.xxl}px`},inset:{padding:`0 ${t.sm}px`},headerRow:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:t.sm,padding:`${t.xs}px ${t.lg}px ${t.md}px`},iconButton:{boxSizing:"border-box",width:oe,height:oe,display:"inline-flex",alignItems:"center",justifyContent:"center",border:0,background:"transparent",cursor:"pointer",padding:0,color:r.brandInk,flexShrink:0},backChevron:{display:"block",width:t.md,height:t.md,borderLeft:`2px solid ${r.brandInk}`,borderBottom:`2px solid ${r.brandInk}`,transform:"rotate(45deg)",marginLeft:t.xs},headerTitle:{...d(i.size.heading,i.lineHeight.tight,r.brandInk,"bold"),flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},documentTitle:{...d(i.size.subtitle,i.lineHeight.snug,r.text.primary,"bold"),flex:1,textAlign:"center"},headerRight:{display:"flex",alignItems:"center",gap:t.sm+t.xs/2},section:{display:"flex",flexDirection:"column",gap:t.sm+t.xs/2},sectionHeader:{display:"flex",alignItems:"center",gap:t.sm,padding:`0 ${t.xs}px`},sectionTitle:{...d(i.size.body+1,i.lineHeight.snug,r.text.primary,"bold")},sectionCount:{...d(i.size.bodyTight,i.lineHeight.snug,r.text.muted,"medium")},card:{boxSizing:"border-box",borderRadius:n.lg-t.xs,border:u,backgroundColor:r.surface,padding:`${t.xs}px ${t.lg}px`,margin:0,listStyle:"none",...L(s.recordCard,1)},creamCard:{boxSizing:"border-box",borderRadius:n.lg-t.xs/2,border:u,backgroundColor:r.surfaceCream,padding:t.lg,display:"flex",flexDirection:"column",gap:t.md,...L(s.recordCard,1)},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:t.md,padding:`${t.md}px 0`},rowDivider:{borderTop:`1px solid ${r.borderHairlineGreen}`},rowMain:{flex:1,minWidth:0},rowRight:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:t.xs+t.xs/2},rowTitle:{...d(i.size.body,i.lineHeight.snug,r.text.primary,"medium"),...a},rowDetail:{...d(i.size.caption,i.lineHeight.normal,r.text.secondary),marginTop:t.xs/2,...a},rowValue:{...d(i.size.body+1,i.lineHeight.snug,r.text.primary,"bold"),marginTop:t.xs/2,...a},rowMuted:{...d(i.size.caption,i.lineHeight.normal,r.text.muted),...a},chip:{display:"inline-block",borderRadius:n.pill,padding:`${t.xs-1}px ${t.sm}px`,..._(e,"medium"),fontSize:i.size.tiny,lineHeight:c(i.size.tiny,i.lineHeight.snug),whiteSpace:"nowrap"},pill:g,pillPrimary:{border:0,backgroundColor:r.brand,color:r.onPrimary,...L(s.primaryButton),...U(s.primaryButton)},pillOutline:{border:`1.5px solid ${r.brandInk}`,backgroundColor:"transparent",color:r.brandInk},pillDanger:{border:`1.4px solid ${r.danger}`,backgroundColor:r.surface,color:r.danger,fontSize:i.size.bodyTight},pillAsk:{border:`1px solid ${r.borderRingCream}`,backgroundColor:r.surface,color:r.text.primary},pillLink:{border:0,backgroundColor:"transparent",color:r.linkInk,padding:`${t.sm}px`},pillDisabled:{opacity:.5,cursor:"default"},infoNote:{display:"flex",gap:t.sm,borderRadius:n.md-t.xs/2,backgroundColor:r.brandSoft,padding:`${t.sm+t.xs/2}px ${t.md}px`,...d(i.size.bodyTight,i.lineHeight.normal,r.text.primary)},cautionNote:{display:"flex",gap:t.sm,borderRadius:n.md-t.xs/2,backgroundColor:r.badgeBgCaution,padding:`${t.sm+t.xs/2}px ${t.md}px`,...d(i.size.bodyTight,i.lineHeight.normal,r.warningStrong)},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,...d(i.size.bodyTight,i.lineHeight.relaxed,r.text.primary)},errorBanner:{display:"flex",gap:t.sm,borderRadius:n.md-t.xs/2,backgroundColor:r.badgeBgCritical,padding:t.md,...d(i.size.bodyTight,i.lineHeight.normal,f)},errorText:d(i.size.bodyTight,i.lineHeight.normal,f),band:{display:"flex",alignItems:"flex-start",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,margin:0},bandText:{flex:1,...d(i.size.caption,i.lineHeight.normal,r.text.secondary)},infoGlyph:{boxSizing:"border-box",flexShrink:0,width:t.md+t.xs/2,height:t.md+t.xs/2,borderRadius:n.pill,border:`1px solid ${r.text.secondary}`,display:"inline-flex",alignItems:"center",justifyContent:"center",..._(e,"bold"),fontSize:i.size.small,color:r.text.secondary},chevron:{display:"inline-block",width:t.sm,height:t.sm,borderTop:`2px solid ${r.text.muted}`,borderRight:`2px solid ${r.text.muted}`,flexShrink:0},lead:{...d(i.size.body+1,i.lineHeight.snug,r.text.primary,"bold"),padding:`0 ${t.sm}px`},field:{boxSizing:"border-box",display:"block",width:"100%",minHeight:oe,padding:`${t.sm}px ${t.md}px`,border:`1px solid ${r.borderHairlineGreen}`,borderRadius:n.sm,color:r.text.primary,backgroundColor:r.surface,..._(e,"regular"),fontSize:i.size.body},fieldLabel:{...d(i.size.bodyTight,i.lineHeight.normal,r.text.secondary,"medium"),display:"block",marginBottom:t.xs},muted:d(i.size.caption,i.lineHeight.normal,r.text.muted),bodyText:d(i.size.body,i.lineHeight.normal,r.text.primary),mono:_(e,"mono"),plainList:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},dialogFrame:{boxSizing:"border-box",position:"fixed",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0,padding:0,border:0,backgroundColor:"transparent",overflow:"hidden"},dialogScrim:{boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",padding:t.lg,backgroundColor:"rgba(0,0,0,0.4)"},dialogScrimSide:{boxSizing:"border-box",display:"flex",alignItems:"stretch",justifyContent:"flex-end",width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.4)"},dialogPanel:{boxSizing:"border-box",width:"100%",maxWidth:560,maxHeight:"100%",overflowY:"auto",backgroundColor:r.surface,borderRadius:n.xl-1,padding:`${t.lg}px ${t.lg+t.xs+t.xs/2}px`,display:"flex",flexDirection:"column",gap:t.md,..._(e,"regular"),color:r.text.primary},dialogPanelSide:{boxSizing:"border-box",width:"min(100vw, 480px)",height:"100%",maxHeight:"100%",overflowY:"auto",backgroundColor:r.surface,padding:`${t.lg}px ${t.lg+t.xs+t.xs/2}px`,display:"flex",flexDirection:"column",gap:t.md,..._(e,"regular"),color:r.text.primary},sheetHeader:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:t.sm},sheetTitle:{...d(i.size.heading,i.lineHeight.snug,r.text.primary,"bold")},sheetHelper:d(i.size.bodyTight,i.lineHeight.normal,r.text.muted),closeGlyph:{fontSize:i.size.verdict,lineHeight:1,color:r.text.primary}}}o(Uo,"makeScreenStyles");var _t=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"})}),Ye=60;function Et(e){return `Try again in ${e}s`}o(Et,"coolingActionLabel");var xt="Try again, available shortly";function Y({width:e,height:r,radius:t,style:n}){let{color:i,radius:s}=C();return jsxRuntime.jsx("span",{"aria-hidden":"true",style:{display:"block",width:e,height:r,borderRadius:t??s.xs,backgroundColor:i.skeleton,flexShrink:0,...n}})}o(Y,"SkeletonBlock");var Wo=44,Ke=62;function Ct({testID:e}){let r=wt();return jsxRuntime.jsxs("div",{role:"progressbar","aria-label":h.loadingTimeline,"aria-busy":"true",style:r.timeline,"data-testid":e,children:[jsxRuntime.jsx("div",{style:r.timelineDisclaimer,children:jsxRuntime.jsx(Y,{width:"100%",height:Wo,radius:12})}),Array.from({length:6},(t,n)=>jsxRuntime.jsxs("div",{children:[n>0?jsxRuntime.jsx("div",{style:r.timelineSeparator}):null,jsxRuntime.jsxs("div",{style:r.timelineRow,children:[jsxRuntime.jsx(Y,{width:34,height:34,radius:17}),jsxRuntime.jsxs("div",{style:r.timelineBody,children:[jsxRuntime.jsxs("div",{style:r.timelineTop,children:[jsxRuntime.jsx(Y,{width:44,height:10,radius:5}),jsxRuntime.jsx(Y,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(Y,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(Y,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Ct,"TimelineSkeleton");function me({variant:e,onAction:r,message:t,testID:n}){let i=wt(),s=_t[e],[c,d]=react.useState(e==="rate_limited"?Ye:0);react.useEffect(()=>{e==="rate_limited"&&d(Ye);},[e]),react.useEffect(()=>{if(c<=0)return;let f=setTimeout(()=>d(v=>Math.max(0,v-1)),1e3);return ()=>clearTimeout(f)},[c]);let a=e==="rate_limited"&&c>0,u=a?Et(c):s.action;return jsxRuntime.jsxs("section",{role:"status",style:i.empty,"data-testid":n,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:i.emptyGlyph}),jsxRuntime.jsx("h3",{style:i.emptyTitle,children:s.title}),jsxRuntime.jsx("p",{style:i.emptyBody,children:t??s.body}),u!==null&&r?jsxRuntime.jsx("button",{type:"button",onClick:r,disabled:a,"aria-label":a?xt:u,style:{...i.emptyAction,...a?i.emptyActionDisabled:{}},"data-testid":n?`${n}-action`:`records-empty-${e}-action`,children:u}):null]})}o(me,"RecordsEmptyState");function wt(){let e=C();return react.useMemo(()=>Yo(e),[e])}o(wt,"useStyles");function Yo(e){let{color:r,space:t,radius:n,type:i}=e,s=`1px solid ${r.brandBorder}`;return {dashboard:{display:"flex",flexDirection:"column",gap:t.lg,padding:`${t.xs}px ${t.sm}px 0`,backgroundColor:r.background},inset:{padding:`0 ${t.sm}px`},summaryCard:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md+t.xs/2,borderRadius:n.lg-t.xs,border:s,backgroundColor:r.surface,padding:`${t.lg+t.xs}px ${t.lg}px`},badges:{display:"flex",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,border:s,backgroundColor:r.surface,padding:t.lg},dots:{display:"flex",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{display:"flex",justifyContent:"center"},actions:{display:"flex",flexDirection:"column",gap:t.sm+t.xs/2},actionRow:{display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,border:s,backgroundColor:r.surface,padding:t.lg},actionLeft:{flex:1,display:"flex",alignItems:"center",gap:t.md},request:{display:"flex",flexDirection:"column",gap:t.lg+t.xs/2,padding:`${t.xs}px ${t.lg}px 0`},railRow:{display:"flex",alignItems:"flex-start",gap:t.md},railColumn:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.xs/2,width:24},railBody:{flex:1,display:"flex",flexDirection:"column",gap:t.xs+t.xs/2,paddingBottom:t.lg+t.xs/2},statusCard:{display:"flex",flexDirection:"column",gap:t.sm,borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2},timeline:{backgroundColor:r.background},timelineDisclaimer:{padding:`${t.xs}px ${t.lg}px ${t.md}px`},timelineRow:{display:"flex",gap:t.md,padding:`${t.md+t.xs/2}px ${t.lg}px`},timelineBody:{flex:1,display:"flex",flexDirection:"column",gap:t.xs-1},timelineTop:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:1,backgroundColor:r.brandBorder,marginLeft:Ke},clinics:{display:"flex",flexDirection:"column",gap:t.md},clinicRow:{display:"flex",flexDirection:"column",gap:t.sm,borderRadius:n.lg-t.xs/2,border:s,backgroundColor:r.surface,padding:`${t.md+t.xs/2}px`},shares:{display:"flex",flexDirection:"column",gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,border:s},shareRow:{display:"flex",flexDirection:"column",gap:t.xs+t.xs/2},empty:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.sm+t.xs/2,padding:`${t.xxl}px ${t.xl}px`,textAlign:"center"},emptyGlyph:{boxSizing:"border-box",width:22,height:22,borderRadius:11,backgroundColor:r.brandSoft,border:s,marginBottom:t.xs},emptyTitle:{margin:0,..._(e,"bold"),fontSize:i.size.subtitle,lineHeight:`${Math.round(i.size.subtitle*i.lineHeight.snug)-1}px`,color:r.brandInk},emptyBody:{margin:0,..._(e,"regular"),fontSize:i.size.bodyTight,lineHeight:`${Math.round(i.size.bodyTight*i.lineHeight.normal)}px`,color:r.text.muted,maxWidth:320},emptyAction:{boxSizing:"border-box",marginTop:t.sm,minHeight:40,borderRadius:n.pill,padding:`0 ${t.lg+t.xs/2}px`,backgroundColor:r.brand,color:r.onPrimary,border:0,cursor:"pointer",..._(e,"bold"),fontSize:i.size.bodyTight},emptyActionDisabled:{opacity:.5,cursor:"default"}}}o(Yo,"makeStyles");var Jo=300,kt=120,Tt=44,Zo=o((e,r)=>e.getTimeline(r),"readTimeline"),ei=o(e=>e.isEmpty,"timelineEmpty"),ri=o((e,r)=>e.getRecordDepth(r),"readDepth"),ti=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),ni=o(e=>e.contributions.length===0,"contributionsEmpty");function oi({petRef:e,style:r,className:t,onBack:n}){let i=ne(e,Zo,ei);return jsxRuntime.jsx(Ge,{state:i,style:r,className:t,onBack:n,header:jsxRuntime.jsx(fe,{title:h.timeline,onBack:J(n),testID:"timeline-header"}),loading:jsxRuntime.jsx(Ct,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(me,{variant:"no_records",testID:"timeline-empty"}),render:s=>jsxRuntime.jsx(di,{timeline:s})})}o(oi,"EverfurRecordsTimeline");function ii({petRef:e,style:r,className:t,onBack:n}){let i=ne(e,ri,ti);return jsxRuntime.jsx(Ge,{state:i,style:r,className:t,onBack:n,header:n?jsxRuntime.jsx(fe,{title:q.records,onBack:J(n)}):null,render:s=>jsxRuntime.jsx(ui,{depth:s})})}o(ii,"EverfurRecordDepth");function ai({petRef:e,docId:r,style:t,className:n,onBack:i}){let s=react.useCallback((a,u)=>a.getDocumentContributions(u,r),[r]),c=ne(e,s,ni,r),d=c.value?.document?.title?.trim()||h.uploadedDocument;return jsxRuntime.jsx(Ge,{state:c,style:t,className:n,onBack:i,header:jsxRuntime.jsx(fe,{title:d,onBack:J(i),testID:"contributions-header"}),empty:jsxRuntime.jsx(me,{variant:"no_records",testID:"contributions-empty"}),render:a=>jsxRuntime.jsx(ci,{view:a})})}o(ai,"EverfurDocumentContributions");function Ge({state:e,style:r,className:t,header:n,loading:i,empty:s,render:c,onBack:d}){let{styles:a}=ye(),{userRef:u}=M();return jsxRuntime.jsx(yt,{capability:"records",style:r,className:t,...vt(J(d),We),children:jsxRuntime.jsxs("div",{className:t,style:{...a.container,...r},children:[n??null,jsxRuntime.jsx("div",{style:a.body,children:u===null?jsxRuntime.jsx("p",{role:"alert",style:a.alertText,children:q.sessionRequired}):si(e,c,a,i,s)}),jsxRuntime.jsx(ht,{})]})})}o(Ge,"DepthSurface");function si(e,r,t,n,i){switch(e.status){case "loading":return n??jsxRuntime.jsx(li,{styles:t});case "empty":return i??jsxRuntime.jsx("div",{style:t.centered,children:jsxRuntime.jsx("div",{role:"img","aria-label":q.empty,style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(me,{variant:or(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(si,"renderState");function li({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),Jo);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":q.loading,style:e.centered,children:r?jsxRuntime.jsx("div",{"aria-hidden":"true",style:e.spinner}):null})}o(li,"LoadingState");function di({timeline:e}){let{styles:r}=ye(),t=_e(e);return jsxRuntime.jsxs("section",{"aria-label":h.timeline,style:r.timelineList,children:[e.disclaimer.length>0?jsxRuntime.jsx("p",{role:"note","aria-label":nr.important(e.disclaimer),style:r.timelineBand,children:e.disclaimer}):null,jsxRuntime.jsx("ul",{style:r.plainList,children:t.map((n,i)=>jsxRuntime.jsx("li",{style:i>0?r.timelineSeparated:void 0,"data-testid":`records-timeline-row-${n.kind}`,children:jsxRuntime.jsxs("div",{style:r.timelineRow,"aria-label":[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:r.timelineBubble}),jsxRuntime.jsxs("div",{style:r.timelineBody,children:[jsxRuntime.jsxs("div",{style:r.topLine,children:[jsxRuntime.jsx("span",{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx("span",{style:r.date,children:n.date})]}),jsxRuntime.jsx("span",{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx("span",{style:r.rowDetail,children:n.detail}):null]})]})},n.key))})]})}o(di,"TimelineBody");function ui({depth:e}){let{styles:r}=ye();return jsxRuntime.jsxs("section",{"aria-label":q.records,style:r.list,children:[e.labResults.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.labResults} (${e.labResults.length})`}),jsxRuntime.jsx("ul",{style:r.card,children:e.labResults.map(t=>{let n=dr(t.latest.status),i=mr(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs("li",{style:r.row,children:[jsxRuntime.jsx("span",{style:r.rowTitle,children:t.name}),jsxRuntime.jsx("span",{style:r.rowValue,children:fr(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),i?jsxRuntime.jsx("span",{style:r.rowDetail,children:i}):null,jsxRuntime.jsx("span",{style:{...r.chip,...n.outOfRange?r.chipCritical:r.chipNeutral},children:n.label}),t.meaning?jsxRuntime.jsx("span",{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.visits} (${e.encounters.length})`}),jsxRuntime.jsx("ul",{style:r.card,children:e.encounters.map(t=>{let n=[t.date?w(t.date):null,t.clinicName,t.veterinarian].filter(i=>i&&i!=="-").join(" \xB7 ");return jsxRuntime.jsxs("li",{style:r.row,children:[jsxRuntime.jsx("span",{style:r.rowTitle,children:t.type?se(t.type):h.visit}),n?jsxRuntime.jsx("span",{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.physicalExams} (${e.physicalExams.length})`}),e.physicalExams.map(t=>jsxRuntime.jsxs("div",{style:r.card,children:[jsxRuntime.jsx("h4",{style:r.rowTitle,children:t.observedOn?w(t.observedOn):h.exam}),jsxRuntime.jsx("ul",{style:r.plainList,children:t.systems.map(n=>{let i=n.findingStatus==="abnormal",s=i?h.abnormal:n.findingStatus==="not_examined"?h.notExamined:h.normal;return jsxRuntime.jsxs("li",{style:r.row,children:[jsxRuntime.jsx("span",{style:r.rowTitle,children:ur(n.system)}),i&&n.finding?jsxRuntime.jsx("span",{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx("span",{style:{...r.chip,...i?r.chipCaution:r.chipNeutral},children:s})]},n.system)})})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.visitNotes} (${e.clinicianNotes.length})`}),e.clinicianNotes.map(t=>jsxRuntime.jsxs("div",{style:r.card,children:[jsxRuntime.jsx("h4",{style:r.rowTitle,children:t.observedOn?w(t.observedOn):h.visitNote}),jsxRuntime.jsx("dl",{style:r.plainList,children:t.sections.map((n,i)=>jsxRuntime.jsxs("div",{style:r.row,children:[jsxRuntime.jsx("dt",{style:r.kindLabel,children:cr(n.section)}),jsxRuntime.jsx("dd",{style:n.text?r.rowDetail:r.rowMuted,children:n.text||h.notRecorded})]},`${n.section}:${i}`))})]},t.noteId))]}):null]})}o(ui,"DepthBody");function ci({view:e}){let{styles:r}=ye();return jsxRuntime.jsxs("section",{"aria-label":q.records,style:r.list,children:[e.document?.receivedAt?jsxRuntime.jsx("p",{style:r.rowDetail,children:w(e.document.receivedAt)}):null,jsxRuntime.jsx("dl",{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs("div",{style:r.row,children:[jsxRuntime.jsx("dt",{style:r.rowTitle,children:t.label}),jsxRuntime.jsx("dd",{style:r.rowValue,children:ar(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx("dd",{style:r.rowDetail,children:w(t.observedAt)}):null]},t.key))})]})}o(ci,"ContributionsBody");function ye(){let e=C(),r=react.useMemo(()=>pi(e),[e]);return {theme:e,styles:r}}o(ye,"useDepthTheme");function pi(e){let{color:r,space:t,radius:n,type:i,slots:s}=e,c=o((g,b)=>`${Math.round(g*b)}px`,"lh"),d=o((g,b,E,k="regular")=>({margin:0,..._(e,k),fontSize:g,lineHeight:c(g,b),color:E}),"text"),a=U(s.recordCard),u=o((g,b,E,k="regular")=>({...d(g,b,E,k),...a}),"inCard"),f=`1px solid ${r.brandBorder}`,v=e.brightness==="dark"?r.errorRed:r.danger;return {container:{boxSizing:"border-box",display:"flex",flexDirection:"column",minHeight:kt,height:"100%",backgroundColor:r.background,color:r.text.primary,..._(e,"regular")},body:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"},centered:{boxSizing:"border-box",flex:"1 1 auto",minHeight:kt,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:t.lg,padding:t.xl,textAlign:"center"},spinner:{boxSizing:"border-box",width:24,height:24,borderRadius:n.pill,border:`3px solid ${r.brandSofter}`,borderTopColor:r.brandInk},emptyGlyph:{boxSizing:"border-box",width:40,height:40,borderRadius:n.lg,backgroundColor:r.brandSoft,border:f},alertText:d(i.size.subtitle,i.lineHeight.snug,r.text.secondary),errorText:d(i.size.subtitle,i.lineHeight.snug,v),primaryButton:{boxSizing:"border-box",minHeight:Tt,minWidth:Tt,padding:`${t.md}px ${t.xl}px`,borderRadius:n.pill,..._(e,"bold"),fontSize:i.size.body,border:0,cursor:"pointer",backgroundColor:r.primary,color:r.onPrimary,...L(s.primaryButton),...U(s.primaryButton)},list:{display:"flex",flexDirection:"column",gap:t.md,padding:t.lg},section:{display:"flex",flexDirection:"column",gap:t.sm},heading:{...d(i.size.heading,i.lineHeight.snug,r.text.primary,"bold")},card:{boxSizing:"border-box",listStyle:"none",display:"flex",flexDirection:"column",gap:t.sm,margin:0,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,border:f,...L(s.recordCard,1)},plainList:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:t.sm},row:{display:"flex",flexDirection:"column",gap:t.xs,padding:`${t.xs}px 0`,borderBottom:`1px solid ${r.borderHairlineGreen}`},topLine:{display:"flex",justifyContent:"space-between",gap:t.md},kindLabel:{...u(i.size.caption,i.lineHeight.normal,r.text.muted,"medium")},date:u(i.size.caption,i.lineHeight.normal,r.text.muted),rowTitle:{...u(i.size.body,i.lineHeight.normal,r.text.primary,"bold")},rowValue:{...u(i.size.body,i.lineHeight.normal,r.text.primary,"medium")},rowDetail:u(i.size.bodyTight,i.lineHeight.normal,r.text.muted),rowMuted:{...u(i.size.bodyTight,i.lineHeight.normal,r.text.muted),opacity:.7},chip:{...d(i.size.caption,i.lineHeight.normal,r.text.primary),alignSelf:"flex-start",padding:`${t.xs}px ${t.sm}px`,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:d(i.size.caption,i.lineHeight.normal,r.text.muted),timelineList:{display:"flex",flexDirection:"column",paddingBottom:t.xxl},timelineBand:{...d(i.size.caption,i.lineHeight.normal,r.text.secondary),borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,margin:`${t.xs}px ${t.lg}px ${t.md}px`},timelineSeparated:{borderTop:`1px solid ${r.brandBorder}`,marginLeft:Ke,paddingLeft:0},timelineRow:{display:"flex",gap:t.md,padding:`${t.md+t.xs/2}px ${t.lg}px`},timelineBubble:{boxSizing:"border-box",flexShrink:0,width:34,height:34,borderRadius:n.pill,backgroundColor:r.brandSoft,border:f},timelineBody:{flex:1,display:"flex",flexDirection:"column",gap:t.xs-1,minWidth:0},timelineKind:{..._(e,"mono"),fontSize:i.size.micro,lineHeight:`${i.size.bodyTight}px`,letterSpacing:i.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...d(i.size.body,i.lineHeight.normal,r.text.primary,"medium")}}}o(pi,"makeStyles");
2
- exports.EverfurDocumentContributions=ai;exports.EverfurRecordDepth=ii;exports.EverfurRecordsTimeline=oi;exports.buildTimelineRows=_e;exports.mapDocumentContributions=Yr;exports.mapRecordDepth=Vr;exports.mapRecordsTimeline=Wr;exports.useEverfurRecordsDepthClient=Jr;exports.useRecordsDepthRead=ne;
1
+ 'use strict';var react=require('react'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Ut=Object.defineProperty;var o=(e,r)=>Ut(e,"name",{value:r,configurable:true});function qt(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(qt,"slotBox");function $(e){return e?.textColor===void 0?{}:{color:e.textColor}}o($,"slotText");function L(e,r){let t=qt(e,r),n={};return t.backgroundColor!==void 0&&(n.backgroundColor=t.backgroundColor),t.borderColor!==void 0&&(n.border=`${t.borderWidth??1}px solid ${t.borderColor}`),t.borderRadius!==void 0&&(n.borderRadius=t.borderRadius),n}o(L,"slotBoxCss");function nr(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(nr,"reportHostFailure");function Bt(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Bt,"isThenable");function $t(e,...r){if(typeof e=="function")try{let t=e(...r);return Bt(t)&&Promise.resolve(t).then(void 0,nr),t}catch(t){nr(t);return}}o($t,"callHost");var or=new WeakMap;function re(e){if(typeof e!="function")return;let r=or.get(e);if(r!==void 0)return r;let t=o((...n)=>{$t(e,...n);},"guarded");return or.set(e,t),t}o(re,"guardHost");function H(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(H,"ok");function P(e){return Object.freeze({ok:false,error:e})}o(P,"err");var le=class le extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,le.prototype);}};o(le,"EverfurConfigError");var te=le;var ir=Symbol.for("@everfur/sdk#EverfurContext@v1"),ar=globalThis,sr=ar[ir]??(ar[ir]=react.createContext(null));sr.displayName??="EverfurContext";function M(){let e=react.useContext(sr);if(e===null)throw new te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(M,"useEverfurContext");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"}),lr="Everfur summarizes what your vet recorded. It is informational, not diagnostic.";var Wt="your pet";function I(e){let r=e?.trim()??"";return r.length>0?r:Wt}o(I,"petNameOr");var dr=Object.freeze({title:"Health records",titleWeb:o(e=>{let r=e?.trim()??"";return r.length>0?`${r}\u2019s Records`:"Health records"},"titleWeb"),titleNative:o(e=>{let r=e?.trim()??"";return r.length>0?r:"Health records"},"titleNative"),openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${I(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:"At a glance",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",askNamed:o(e=>{let r=e?.trim()??"";return r.length>0?`Ask about ${r}`:"Ask about this marker"},"askNamed"),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=>`${I(e)}\u2019s records are on the way`,"title"),anotherClinic:"Another clinic",anotherClinicSub:"Seen more than one vet? We ask each one.",uploadDocumentPhotoSub:"A PDF, or a photo of a paper record.",body:o(e=>`We\u2019re requesting ${I(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 ${I(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${I(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${I(e)}\u2019s records`,"title"),firstRecordTitle:o(e=>`Add ${I(e)}\u2019s first record`,"firstRecordTitle"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicSub:"We send a secure request and read every page they send back.",requestFromClinicA11y:o(e=>`Request ${I(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${I(e)}\u2019s records`,"uploadDocumentA11y")});function cr(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(cr,"recordsEmptyVariantForError");function pr(e,r){return e===null?"":r?`${e} ${r}`:e}o(pr,"formatEntityValue");var ur=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let i=ur[Number(r[2])-1];return i===void 0?"-":`${i} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${ur[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(k,"formatRecordsDate");var h=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 yr(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(yr,"markerStatusLabel");function Yt(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(Yt,"trajectoryLabel");function de(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(de,"humanize");var fr=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 gr(e){return Object.prototype.hasOwnProperty.call(fr,e)?fr[e]:de(e)}o(gr,"bodySystemLabel");var mr=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 br(e){return Object.prototype.hasOwnProperty.call(mr,e)?mr[e]:de(e)}o(br,"soapSectionLabel");function hr(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(hr,"formatWeightKg");function vr(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(vr,"formatMarkerReading");function Rr(e,r,t){let n=Yt(r,t);return e?`${h.measured(k(e))}${n?` \xB7 ${n}`:""}`:n}o(Rr,"labDetailLine");var ce=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function _r(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(_r,"toMillis");function Se(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:h.kind.visit,at:t.visitDate,date:k(t.visitDate),title:t.summary??h.clinicVisit,detail:t.veterinarian?h.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let i=[];return t.lot&&i.push(h.lot(t.lot)),t.expiresOn&&i.push(h.expires(k(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:h.kind.vaccine,at:t.administeredOn,date:k(t.administeredOn),title:t.product||h.kind.vaccine,detail:i.length?i.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:h.kind.weight,at:t.observedOn,date:k(t.observedOn),title:hr(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let i=[t.dose,t.route,t.frequency].filter(s=>!!s);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:h.kind.medication,at:t.startedOn,date:k(t.startedOn),title:t.drugName||h.kind.medication,detail:i.length?i.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let i=_r(t.at),s=_r(n.at);return i===null&&s===null?ce[t.kind]-ce[n.kind]:i===null?1:s===null?-1:s!==i?s-i:ce[t.kind]-ce[n.kind]}))}o(Se,"buildTimelineRows");var Ce=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(Ce.map(e=>e.wireCode));var Kt=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"}),xr=Object.freeze(Ce.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Kt[e.wireCode]}))),Gt=new Map(xr.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Xt=Object.freeze(["http_envelope",...[...new Set(xr.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ue(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...Xt]){let i=Gt.get(n+t);if(i)return i}}o(ue,"contractErrorFor");function Qt(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Qt,"contractDocUrl");function Sr(e){return null}o(Sr,"publishedDocUrl");var Jt=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 Cr(e){return Jt[e]}o(Cr,"categoryFor");function wr(e){let r=ue(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":case "TELEVETRATELIMITED":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(wr,"fromWire");var Zt=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function we(e){return Zt.has(e)}o(we,"isAutoRetryable");var en=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Tr(e){return we(e)||en.has(e)}o(Tr,"isRetryableCode");var rn=500,Te=8e3,kr=4;function Or(e,r=Math.random){let t=Math.max(0,e),n=Math.min(rn*2**t,Te);return Math.floor(r()*n)}o(Or,"backoffDelayMs");var tn=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 ke(e){return tn[e]}o(ke,"userFacingError");function Pr(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Pr,"defineHidden");var nn=/^[a-z][a-z0-9_]{0,63}$/;function N(e,r){let t=ue(r?.wireCode,r?.wireEnvelope),n={code:e,category:Cr(e),retryable:r?.retryable??Tr(e),displayMessage:ke(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&nn.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Pr(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Pr(n,"raw",r.raw),Object.freeze(n)}o(N,"makeEverfurError");function Fr(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Fr,"assertNever");function Ar(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(Ar,"errorFrame");function sn(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(sn,"authHeaders");function ne(e,r){return {...e,headers:{...ln(e.headers),...sn(r)}}}o(ne,"withAuthHeaders");function ln(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let i=t.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[t]=n);}return r}o(ln,"stripAuthHeaders");async function Dr(e,r){if(r.mode==="anonymous")return r.transport.request(ne(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return P(Oe())}let n=await r.transport.request(ne(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return P(Oe())}let s=await r.transport.request(ne(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?P(Oe(s.error.httpStatus)):s}o(Dr,"authedSend");function Oe(e){return N("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Oe,"authRejectedError");function Ir(e){return N("internalError",{retryable:true,wireMessage:dn(e)})}o(Ir,"networkError");function dn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(dn,"describeCause");var cn=3e4,un=Te*2,pn="idempotency-key",fn=new Set(["POST","PUT","PATCH","DELETE"]),mn=Object.freeze({onEvent(){}}),yn=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function gn(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(gn,"seededIdempotencyKey");function jr(e){let r=e.observer??mn,t=e.timers??yn,n=e.rng??Math.random,i=e.sleep??((g,v)=>Pn(g,t,v)),s=e.maxAttempts??kr,u=e.unaryTimeoutMs??cn,d=e.newIdempotencyKey??hn(),a=o(g=>{try{r.onEvent(g);}catch{}},"emit");async function c(g,v,E){let S=E?.maxAttempts,B=Math.max(1,S??s),Q=E?.idempotent??fn.has(v.method),J=E?.idempotencyKey===void 0?null:gn(E.idempotencyKey),Re=Q?J??d():null,Mt=bn(v,Re),_e=0;for(;;){let Z=o(xe=>Object.freeze({call:g,method:v.method,path:v.path,attempt:_e,...Re?{idempotencyKey:Re}:{},...xe}),"stamp");a(Z({phase:"attempt"}));let rr=kn(u,t),tr=On(rr.signal,v.signal),ee;try{ee=await Dr({...Mt,signal:tr.signal},e.auth);}catch(xe){ee=P(Ir(xe));}finally{tr.dispose(),rr.cancel();}if(ee.ok)return a(Z({phase:"settled",ok:true,reason:"ok"})),ee;let j=ee.error,se=Rn(j,_e,{maxAttempts:B,rng:n,now:t.now(),aborted:v.signal?.aborted===true,...S!==void 0?{perCallMaxAttempts:S}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Ee={ok:false,code:j.code,reason:se.reason,...j.httpStatus!==void 0?{httpStatus:j.httpStatus}:{},...j.requestId!==void 0?{requestId:j.requestId}:{}};if(!se.retry)return a(Z({phase:"settled",...Ee})),P(j);if(a(Z({phase:"retry",...Ee,delayMs:se.delayMs})),await i(se.delayMs,v.signal),v.signal?.aborted===true)return a(Z({phase:"settled",...Ee,reason:"aborted"})),P(j);_e+=1;}}o(c,"send");async function p(g){return ne(g,await Tn(e.auth))}o(p,"authorize");async function*b(g,v,E){a(Object.freeze({call:g,phase:"stream.open",method:v.method,path:v.path,attempt:0}));try{yield*e.auth.transport.stream(v,E);}catch{yield Ar({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(b,"stream"),Object.freeze({send:c,authorize:p,stream:b})}o(jr,"createRequestFunnel");function bn(e,r){let t={};for(let[n,i]of Object.entries(e.headers??{}))n.toLowerCase()!==pn&&(t[n]=i);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(bn,"assembleHeaders");function hn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(hn,"defaultIdempotencyKeyFactory");var vn=10;function Rn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=_n(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!we(e.code))return {retry:false,reason:"terminal-code"};let i=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 u=o(()=>{if(t.policy===void 0)return null;let c;try{c=t.policy.maxAttempts(e.code);}catch{return null}return typeof c!="number"||!Number.isFinite(c)?null:Math.max(1,Math.min(vn,Math.floor(c)))},"policyCeiling"),d=t.perCallMaxAttempts??u()??t.maxAttempts;if(r+1>=d)return {retry:false,reason:"attempts-exhausted"};let a=En(e,t.now);return a!==null?a>un?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:a}:{retry:true,reason:i,delayMs:Or(r,t.rng)}}o(Rn,"decideRetry");function _n(e){let r=e.code==="unknown"?wr(wn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(_n,"throttleKind");function En(e,r){let t=Sn(e.raw);if(t!==null){let i=t-r;return i>0?i:0}let n=xn(e.raw);return n===null?null:Math.round(n*1e3)}o(En,"retryOverrideMs");function xn(e){for(let r of Pe(e)){let t=r.retry_after_seconds;if(typeof t=="number"&&Number.isFinite(t)&&t>=0)return t}return null}o(xn,"findRetryAfterSeconds");function Sn(e){for(let r of Pe(e)){let t=r.resets_at,n=Cn(t);if(n!==null)return n}return null}o(Sn,"findResetsAt");function Pe(e){if(!zr(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];zr(n)&&r.push(n);}return r}o(Pe,"candidateScopes");function Cn(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(Cn,"parseInstantMs");function wn(e){for(let r of Pe(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(wn,"rawWireCode");function zr(e){return typeof e=="object"&&e!==null}o(zr,"isRecord");async function Tn(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(Tn,"resolveDeviceAuth");function kn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(kn,"boundedSignal");function On(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 i=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}o(On,"mergeSignals");function Pn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let i=r.setTimeout(()=>{t?.removeEventListener("abort",s),n();},e),s=o(()=>{r.clearTimeout(i),n();},"onAbort");t?.addEventListener("abort",s,{once:true});})}o(Pn,"delayAbortable");function Fe(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(Fe,"hasLoneSurrogate");var Nr=64,Lr=512;function An(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(An,"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 Dn=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Ae=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()}),In=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),zn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(In).optional()}),jn=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),De=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 Mr(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:An(e.origin),canonicalKey:e.canonical_key??null})}o(Mr,"mapEntityRow");function Ur(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Ur,"mapDocumentRow");zod.z.object({identity:zod.z.array(Dn).optional(),entities:zod.z.array(Ae).optional(),entity_series:zod.z.array(zn).optional(),forward_looking:zod.z.array(jn).optional(),documents:zod.z.array(De).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 R=zod.z.string().nullish(),pe=zod.z.number().nullish(),Nn=zod.z.object({collected_at:R,at:R,value:pe,unit:R,qualitative_result:R,ref_low:pe,ref_high:pe,status:R,source_clinic:R,source_doc_id:R,doc_id:R,reviewed:zod.z.boolean().nullish()}),Ln=zod.z.object({collected_at:R,at:R,value:pe,unit:R,qualitative_result:R,status:R}),Mn=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:R,name:R,loinc_code:R,canonical_unit:R,unit:R,panel_name:R,panel:R,meaning_text:R,meaning:R,latest:Ln.nullish(),trajectory:R,points:zod.z.array(Nn).optional()}),Un=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()}),qn=zod.z.object({markers:zod.z.array(Mn).optional(),summary:Un.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:R});function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Bn,"isObject");function qr(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(qr,"withheldMarkers");function Br(e,r){let t=Bn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return qr(n);let i=qn.safeParse(t);if(!i.success)return qr(n);let s=i.data,u=o(a=>Object.freeze({at:a.collected_at??a.at??null,value:a.value??null,unit:a.unit??null,qualitativeResult:a.qualitative_result??null,refLow:a.ref_low??null,refHigh:a.ref_high??null,status:a.status??null,sourceClinic:a.source_clinic??null,docId:a.source_doc_id??a.doc_id??null,reviewed:a.reviewed===true}),"point"),d=(s.markers??[]).map(a=>Object.freeze({markerId:a.marker_id,name:a.canonical_name??a.name??a.marker_id,loincCode:a.loinc_code??null,unit:a.canonical_unit??a.unit??null,panel:a.panel_name??a.panel??null,meaning:a.meaning_text??a.meaning??null,latest:a.latest?Object.freeze({at:a.latest.collected_at??a.latest.at??null,value:a.latest.value??null,unit:a.latest.unit??null,qualitativeResult:a.latest.qualitative_result??null,status:a.latest.status??null}):null,trajectory:a.trajectory??null,points:Object.freeze((a.points??[]).map(u))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(d),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(Br,"mapRecordMarkers");var $r=128,z=128;var $n=zod.z.string().min(1).refine(e=>e.startsWith("https://")),Hn=zod.z.object({source_doc_id:zod.z.string().min(1),file_name:zod.z.string().nullish(),doc_format:zod.z.string().nullish(),byte_size:zod.z.number().int().nonnegative().nullish(),received_at:zod.z.string().nullish(),download_url:$n,expires_in_seconds:zod.z.number().int().nonnegative().nullish()}),Vn=zod.z.object({items:zod.z.array(zod.z.unknown()).optional()});function Hr(e){let r=Vn.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let i=Hn.safeParse(n);i.success&&t.push(Object.freeze({sourceDocId:i.data.source_doc_id,fileName:i.data.file_name??null,docFormat:i.data.doc_format??null,byteSize:i.data.byte_size??null,receivedAt:i.data.received_at??null,downloadUrl:i.data.download_url,expiresInSeconds:i.data.expires_in_seconds??0}));}return Object.freeze(t)}o(Hr,"mapRequestDocuments");var fe=Object.freeze(["vet","groomer","boarding"]),Wn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),V=zod.z.string().nullish(),Ie=zod.z.unknown().optional(),Yn=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:V,audience:Ie}),Kn=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:V,created_at:V,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:V,audience:Ie})).optional()}),Gn=zod.z.object({download_url:Wn,expires_at:V}),Xn=zod.z.object({share_id:zod.z.string().min(1),expires_at:V,audience:Ie}),Qn=zod.z.object({audience:zod.z.string().min(1),sections:zod.z.array(zod.z.string()),entity_types:zod.z.array(zod.z.string()).nullable()}),Jn=254;function Vr(e){let r=e.trim();return r.length>0&&r.length<=Jn&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(r)}o(Vr,"isShareRecipientEmail");var Wr=o(e=>typeof e=="string"&&fe.includes(e),"isAudience");function ze(e){return Wr(e)?e:null}o(ze,"audienceOf");function Yr(e){let r=zod.z.array(Qn).safeParse(e);if(!r.success)return Object.freeze([]);let t=new Set,n=[];for(let i of r.data)!Wr(i.audience)||t.has(i.audience)||(t.add(i.audience),n.push(Object.freeze({audience:i.audience,sections:Object.freeze([...i.sections]),entityTypes:i.entity_types===null?null:Object.freeze([...i.entity_types])})));return Object.freeze(n)}o(Yr,"mapShareAudiences");function Zn(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(Zn,"resolveShareUrl");function Kr(e,r){let t=Yn.safeParse(e);if(!t.success)return null;let n=Zn(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null,audience:ze(t.data.audience)})}o(Kr,"mapRecordShareLink");function Gr(e){let r=Kn.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,audience:ze(t.audience)}))):null}o(Gr,"mapRecordShareList");function Xr(e){let r=Xn.safeParse(e);return r.success?Object.freeze({shareId:r.data.share_id,expiresAt:r.data.expires_at??null,audience:ze(r.data.audience)}):null}o(Xr,"mapRecordShareEmailReceipt");function Qr(e){let r=Gn.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(Qr,"mapRecordPdfLink");var Jr="application/pdf",eo=Object.freeze(["image/jpeg","image/png","image/heic","image/heif"]),me=Object.freeze({features:Object.freeze({}),uploadContentTypes:Object.freeze([Jr]),shareAudiences:Object.freeze([])}),ro=zod.z.object({features:zod.z.record(zod.z.boolean()),upload_content_types:zod.z.array(zod.z.string()).nullish(),share_audiences:zod.z.unknown().optional()});function Zr(e){let r=ro.safeParse(e);if(!r.success)return me;let t=r.data.upload_content_types??[],n=eo.filter(i=>t.includes(i));return Object.freeze({features:Object.freeze({...r.data.features}),uploadContentTypes:Object.freeze([Jr,...n]),shareAudiences:Yr(r.data.share_audiences)})}o(Zr,"mapRecordsFeatures");var to=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 et(e){let r=to.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(et,"mapSignatureSuggestions");var y=zod.z.string().nullish(),oe=zod.z.number().nullish(),no=zod.z.object({at:y,value:oe,unit:y,qualitative_result:y,ref_low:oe,ref_high:oe,status:y,doc_id:y}),oo=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:y,unit:y,panel:y,meaning:y,latest:zod.z.object({at:y,value:oe,unit:y,qualitative_result:y,status:y}).nullish(),trajectory:y,points:zod.z.array(no).optional()}),io=zod.z.object({encounter_id:zod.z.string(),date:y,type:y,clinic_name:y,veterinarian:y,doc_id:y}),ao=zod.z.object({note_id:zod.z.string(),encounter_id:y,observed_on:y,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),so=zod.z.object({exam_id:zod.z.string(),encounter_id:y,observed_on:y,doc_id:y,systems:zod.z.record(zod.z.object({finding_status:y,finding:y})).optional()}),lo=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:y,latest_record_at:y,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()}),co=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:y,severity:y,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:y,doc_id:y,collected_at:y})).optional()}),uo=zod.z.object({lab_results:zod.z.array(oo).optional(),encounters:zod.z.array(io).optional(),clinician_notes:zod.z.array(ao).optional(),physical_exams:zod.z.array(so).optional(),completeness:lo.nullish(),conflicts:zod.z.array(co).optional()}),po=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:y,veterinarian:y,summary:y,doc_id:y})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:y,lot:y,administered_on:y,expires_on:y,doc_id:y})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:y,weight_kg:oe,doc_id:y})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:y,dose:y,route:y,frequency:y,sig:y,rx_number:y,started_on:y,stopped_on:y,doc_id:y})),disclaimer:zod.z.string().optional()}),fo=zod.z.object({document:De,contributions:zod.z.array(Ae),contribution_count:zod.z.number().int().nonnegative().optional()});function Ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ne,"isObject");function Le(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(Le,"petOf");function je(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(je,"emptyDepth");function tt(e,r){let t=Ne(r)?r:{},n=Le(t,e);if(t.withheld===true)return je(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(a=>a in t))return je(n,false);let s=uo.safeParse(t);if(!s.success)return je(n,true);let u=s.data,d=o(a=>Object.freeze({at:a.at??null,value:a.value??null,unit:a.unit??null,qualitativeResult:a.qualitative_result??null,refLow:a.ref_low??null,refHigh:a.ref_high??null,status:a.status??null,docId:a.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((u.lab_results??[]).map(a=>Object.freeze({markerId:a.marker_id,name:a.name,loincCode:a.loinc_code??null,unit:a.unit??null,panel:a.panel??null,meaning:a.meaning??null,latest:Object.freeze({at:a.latest?.at??null,value:a.latest?.value??null,unit:a.latest?.unit??null,qualitativeResult:a.latest?.qualitative_result??null,status:a.latest?.status??null}),trajectory:a.trajectory??null,points:Object.freeze((a.points??[]).map(d))}))),encounters:Object.freeze((u.encounters??[]).map(a=>Object.freeze({encounterId:a.encounter_id,date:a.date??null,type:a.type??null,clinicName:a.clinic_name??null,veterinarian:a.veterinarian??null,docId:a.doc_id??null}))),clinicianNotes:Object.freeze((u.clinician_notes??[]).map(a=>Object.freeze({noteId:a.note_id,encounterId:a.encounter_id??null,observedOn:a.observed_on??null,sections:Object.freeze((a.sections??[]).map(c=>Object.freeze({section:c.section,text:c.text})))}))),physicalExams:Object.freeze((u.physical_exams??[]).map(a=>Object.freeze({examId:a.exam_id,encounterId:a.encounter_id??null,observedOn:a.observed_on??null,docId:a.doc_id??null,systems:Object.freeze(Object.entries(a.systems??{}).map(([c,p])=>Object.freeze({system:c,findingStatus:p.finding_status??null,finding:p.finding??null})))}))),completeness:u.completeness?Object.freeze({hasLabHistory:u.completeness.has_lab_history===true,hasVaccinationHistory:u.completeness.has_vaccination_history===true,hasWeightHistory:u.completeness.has_weight_history===true,hasVitalsHistory:u.completeness.has_vitals_history===true,hasPhysicalExamHistory:u.completeness.has_physical_exam_history===true,hasProcedureHistory:u.completeness.has_procedure_history===true,hasGeneticHistory:u.completeness.has_genetic_history===true,hasReproductiveHistory:u.completeness.has_reproductive_history===true,hasParasitePreventionHistory:u.completeness.has_parasite_prevention_history===true,earliestRecordAt:u.completeness.earliest_record_at??null,latestRecordAt:u.completeness.latest_record_at??null,documentsIngested:u.completeness.documents_ingested??0,documentsInReview:u.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...u.completeness.entities_pending_review??{}}),heldTotal:u.completeness.held_total??0}):null,conflicts:Object.freeze((u.conflicts??[]).map(a=>Object.freeze({conflictId:a.conflict_id,entityType:a.entity_type,field:a.field??null,severity:a.severity??"needs_review",candidates:Object.freeze((a.candidates??[]).map(c=>Object.freeze({value:c.value,docId:c.source_doc_id??c.doc_id??null,collectedAt:c.collected_at??null})))})))})}o(tt,"mapRecordDepth");function rt(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(rt,"withheldTimeline");function nt(e,r){let t=Ne(r)?r:{},n=Le(t,e);if(t.withheld===true)return rt(n);let i=po.safeParse(t);if(!i.success)return rt(n);let s=i.data,u=s.visits.map(p=>Object.freeze({visitId:p.visit_id,visitDate:p.visit_date??null,veterinarian:p.veterinarian??null,summary:p.summary??null,docId:p.doc_id??null})),d=s.vaccines.map(p=>Object.freeze({vaccineId:p.vaccine_id,product:p.product??null,lot:p.lot??null,administeredOn:p.administered_on??null,expiresOn:p.expires_on??null,docId:p.doc_id??null})),a=s.weights.map(p=>Object.freeze({weightId:p.weight_id,observedOn:p.observed_on??null,weightKg:p.weight_kg??null,docId:p.doc_id??null})),c=s.medications.map(p=>Object.freeze({medicationId:p.medication_id,drugName:p.drug_name??null,dose:p.dose??null,route:p.route??null,frequency:p.frequency??null,sig:p.sig??null,rxNumber:p.rx_number??null,startedOn:p.started_on??null,stoppedOn:p.stopped_on??null,docId:p.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:u.length===0&&d.length===0&&a.length===0&&c.length===0,visits:Object.freeze(u),vaccines:Object.freeze(d),weights:Object.freeze(a),medications:Object.freeze(c),disclaimer:s.disclaimer??""})}o(nt,"mapRecordsTimeline");function ot(e,r){let t=Ne(r)?r:{},n=Le(t,e),i=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return i();let s=fo.safeParse(t);if(!s.success)return i();let u=Object.freeze(s.data.contributions.map(Mr));return Object.freeze({petRef:n,withheld:false,document:Ur(s.data.document),contributions:u,contributionCount:s.data.contribution_count??u.length})}o(ot,"mapDocumentContributions");var mo="/widget/v1/records/pets";function it(e){let r=e.funnel??jr({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((a,c)=>typeof a=="string"&&a.length>0&&!Fe(a)&&[...a].length<=c,"segment"),n=o(async(a,c,p,b)=>{if(!t(c,z))return A();let g=await r.send(a,{method:"GET",path:p});if(!g.ok)return g;let v=b(g.value);return v.petRef===c?H(v):P(N("internalError",{retryable:false}))},"read"),i=o(a=>`${mo}/${encodeURIComponent(a)}`,"pet"),s=o(a=>`${i(a)}/everfur_record`,"record"),u=o(async(a,c,p)=>{let b=await r.send(a,c,c.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!b.ok)return b;let g=p(b.value);return g===null?P(N("internalError",{retryable:false})):H(g)},"parsed"),d=o((a,c)=>!t(a.entityType,Nr)||!t(a.canonicalKey,Lr)||a.idempotencyKey!==void 0&&!t(a.idempotencyKey,$r)||c!==void 0&&Object.keys(c).length===0?null:{entity_type:a.entityType,canonical_key:a.canonicalKey,...c!==void 0?{corrected_fields:c}:{},...a.idempotencyKey!==void 0?{idempotency_key:a.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(a=>n("records.depth.record",a,`${i(a)}/record`,c=>tt(a,c)),"getRecordDepth"),getTimeline:o(a=>n("records.depth.timeline",a,`${i(a)}/timeline`,c=>nt(a,c)),"getTimeline"),getDocumentContributions(a,c){return t(c,64)?n("records.depth.contributions",a,`${i(a)}/documents/${encodeURIComponent(c)}/contributions`,p=>ot(a,p)):A()},getMarkers:o(a=>n("records.depth.markers",a,`${i(a)}/markers`,c=>Br(a,c)),"getMarkers"),createShare(a,c){if(!t(a,z))return A();let p=c?.audience;return p!==void 0&&!fe.includes(p)?A():u("records.share.create",{method:"POST",path:`${s(a)}/share`,...p!==void 0?{body:{audience:p}}:{}},b=>Kr(b,e.apiBaseUrl))},emailShare(a,c){let p=c.recipientKind,b=typeof c.recipientEmail=="string"?c.recipientEmail.trim():"",g=p==="other"||fe.includes(p);return !t(a,z)||!g||!Vr(b)||Fe(b)?A():u("records.share.email",{method:"POST",path:`${s(a)}/share/email`,body:{recipient_email:b,recipient_kind:p}},Xr)},async readFeatures(){try{let a=await r.send("records.getFeatures",{method:"GET",path:"/widget/v1/records/features"});return a.ok?Zr(a.value):me}catch{return me}},listShares(a){return t(a,z)?u("records.share.list",{method:"GET",path:`${s(a)}/shares`},Gr):A()},async revokeShare(a,c){if(!t(a,z)||!t(c,64))return A();let p=await r.send("records.share.revoke",{method:"DELETE",path:`${s(a)}/shares/${encodeURIComponent(c)}`},{idempotent:false,maxAttempts:1});return p.ok?H(void 0):p},getPdfLink(a){return t(a,z)?u("records.pdf.link",{method:"GET",path:`${s(a)}/pdf-link`},Qr):A()},async editFact(a,c){let p=t(a,z)?d(c,c.correctedFields):null;if(p===null)return A();let b=await r.send("records.fact.edit",{method:"POST",path:`${s(a)}/facts/edit`,body:p},{idempotent:false,maxAttempts:1});return b.ok?H(void 0):b},async removeFact(a,c){let p=t(a,z)?d(c):null;if(p===null)return A();let b=await r.send("records.fact.remove",{method:"POST",path:`${s(a)}/facts/remove`,body:p},{idempotent:false,maxAttempts:1});return b.ok?H(void 0):b},listRequestDocuments(a){return t(a,64)?u("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(a)}/documents`},Hr):A()},listAuthorizationSignatures:o(()=>u("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},et),"listAuthorizationSignatures")}}o(it,"createRecordsDepthClient");function A(){return Promise.resolve(P(N("validationFailed",{retryable:false})))}o(A,"invalid");var bo=new Map,at=new Set;function ho(e){return bo.get(e)??0}o(ho,"recordsConsentEpochOf");function vo(e){return at.add(e),()=>{at.delete(e);}}o(vo,"subscribe");function st(e){let r=react.useCallback(()=>ho(e),[e]);return react.useSyncExternalStore(vo,r,r)}o(st,"useRecordsConsentEpoch");function dt(){let{runtime:e,userRef:r,scopeEpoch:t}=M();return react.useMemo(()=>{let{services:n}=e.registry;return it({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(dt,"useEverfurRecordsDepthClient");function ie(e,r,t,n=""){let i=dt(),{userRef:s}=M(),u=st(e),d=react.useMemo(()=>({}),[i,e,n,u]),[a,c]=react.useState({scope:d,value:null,error:null,loading:true}),p=react.useRef(0),b=react.useCallback(async()=>{let Q=p.current+=1;if(c({scope:d,value:null,error:null,loading:true}),s===null){c({scope:d,value:null,error:null,loading:false});return}let J=await r(i,e);Q===p.current&&(J.ok?c({scope:d,value:J.value,error:null,loading:false}):c({scope:d,value:null,error:J.error,loading:false}));},[i,e,r,d,s]);react.useEffect(()=>(b(),()=>{p.current+=1;}),[b]);let g=a.scope===d?a:{value:null,error:null,loading:true},v=react.useCallback(()=>{b();},[b]),E=g.error===null||g.error.httpStatus!==404,S=E?g.error:null,B=g.loading?"loading":S!==null?"error":g.value===null?"empty":g.value.withheld?"populated":t(g.value)?"empty":"populated";return react.useMemo(()=>({status:B,value:g.value,error:S,available:E,refresh:v}),[B,g.value,S,E,v])}o(ie,"useRecordsDepthRead");var Be=class Be 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(Be,"HostRenderBoundary");var Ue=Be;function So({render:e}){return e()}o(So,"RenderHost");function qe({render:e,fallback:r,resetKey:t}){return react.createElement(Ue,{fallback:r,resetKey:t,children:react.createElement(So,{render:e})})}o(qe,"HostRender");function Ve(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Ve(e[r]);}return e}o(Ve,"deepFreeze");var Co=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),pt={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},ft={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},ut={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},wo={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},To={regular:"400",medium:"500",bold:"700"},ko={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Oo=0,ye="System",ge="monospace",Po=["content","heading","control","compact","badge"];function Fo(e){let r={};for(let t of Po)r[t]=e;return r}o(Fo,"authoredTierSizes");function mt(){return {family:ye,mono:ge,fontUrl:null,families:{regular:ye,medium:ye,bold:ye,mono:ge,monoMedium:ge,monoBold:ge},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:ut,tierSizes:Fo(ut),lineHeight:wo,weight:To,letterSpacing:ko,scale:1,maxScale:Oo,scaleCaps:Co}}o(mt,"baseType");var yt={},$e=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function He(e){return `cubic-bezier(${e.join(", ")})`}o(He,"cssCubicBezier");var gt={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:He($e.standard),emphasized:He($e.emphasized),exit:He($e.exit)},reducedMotion:false},Ao={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},bt=Ve({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ao,space:pt,radius:ft,type:mt(),motion:gt,slots:yt}),Do={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Ve({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Do,space:pt,radius:ft,type:mt(),motion:gt,slots:yt});var ht=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),vt=globalThis,We=vt[ht]??(vt[ht]=react.createContext(bt));We.displayName??="EverfurThemeContext";function T(){return react.useContext(We)}o(T,"useEverfurTheme");var Rt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var _t='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',jo="System";function No(e){let r=e.trim();return r.length===0||r===jo?_t:`${Et(r)}, ${_t}`}o(No,"cssFontFamily");function Lo(e){let r=e.trim();return r.length===0||r==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${Et(r)}, ui-monospace, Menlo, Consolas, monospace`}o(Lo,"cssMonoFamily");function Et(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}o(Et,"quote");function _(e,r){let t=e.type,n=t.families[r];return {fontFamily:r==="mono"||r==="monoMedium"||r==="monoBold"?Lo(n):No(n),fontWeight:t.namedFaces[r]?t.weight.regular:t.weight[Rt[r]]}}o(_,"faceCss");var K=Object.freeze({textAlign:"start"});var Mo=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 Uo(e){return Mo[e]}o(Uo,"requires");function xt(e,r,t){let n=Uo(e),i=new Map;for(let d of r)i.set(d.resource,d);if(t?.isPending===true&&n.some(d=>!i.has(d)))return Ye({name:e,enabled:false,isPending:true,limits:{}});let s=qo(n,i);return n.filter(d=>i.get(d)?.granted!==true).length===0?Ye({name:e,enabled:true,isPending:false,limits:s}):Ye({name:e,enabled:false,isPending:false,limits:s,disabled:Bo(n,i)})}o(xt,"decideCapability");function qo(e,r){let t={};for(let n of e){let i=r.get(n)?.limits;if(i)for(let[s,u]of Object.entries(i)){let d=t[s];t[s]=d===void 0?u:Math.min(d,u);}}return t}o(qo,"mergeLimits");function Bo(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:ke("accessDenied"),level:"user_entitlement",recoverable:false})}o(Bo,"disabledFor");function Ye(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(Ye,"freezeDecision");function Ke(e){let{runtime:r}=M(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>xt(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ke,"useCapability");var Vo=48;function Wo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Wo,"selectView");function wt(e){let{capability:r,children:t,renderDisabled:n,renderPending:i,style:s,className:u}=e,d=Ke(r),a=react.useMemo(()=>Wo(d),[d]);switch(a){case "enabled":return t;case "pending":return i?jsxRuntime.jsx(qe,{render:i,fallback:jsxRuntime.jsx(St,{capability:r,style:s,className:u})}):jsxRuntime.jsx(St,{capability:r,style:s,className:u});case "disabled":return n?jsxRuntime.jsx(qe,{render:()=>n(d),fallback:jsxRuntime.jsx(Ct,{decision:d,style:s,className:u}),resetKey:d}):jsxRuntime.jsx(Ct,{decision:d,style:s,className:u});default:return Fr(a)}}o(wt,"CapabilityGate");function St({capability:e,style:r,className:t}){let n=T(),i=react.useMemo(()=>Tt(n),[n]);return jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${e}`,className:t,style:{...i.offstate,...r},children:jsxRuntime.jsx("div",{style:i.skeletonBar})})}o(St,"PendingSkeleton");function Ct({decision:e,style:r,className:t}){let n=T(),i=react.useMemo(()=>Tt(n),[n]),s=e.disabled?.reason??"";return jsxRuntime.jsx("div",{className:t,style:{...i.offstate,...r},children:s.length>0?jsxRuntime.jsx("p",{style:i.offstateText,children:s}):null})}o(Ct,"OffState");function Tt(e){let{color:r,space:t,radius:n,type:i}=e;return {offstate:{...K,boxSizing:"border-box",minHeight:Vo,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${t.md}px ${t.lg}px`,backgroundColor:r.surfaceCream,borderRadius:n.md,border:`1px solid ${r.brandBorder}`},offstateText:{margin:0,..._(e,"regular"),fontSize:i.size.body,lineHeight:`${Math.round(i.size.body*i.lineHeight.normal)}px`,color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}}}o(Tt,"makeStyles");function kt(e){let r=T(),t=react.useMemo(()=>Ko(r),[r]);return jsxRuntime.jsx("p",{role:"note",className:e.className,style:{...t,...e.style},"data-testid":"records-footnote",children:lr})}o(kt,"RecordsFootnote");function Ko(e){let{color:r,space:t,type:n}=e;return {...K,boxSizing:"border-box",margin:0,padding:`${t.md}px ${t.lg}px ${t.lg}px`,textAlign:"center",..._(e,"regular"),fontSize:n.size.caption,lineHeight:`${Math.round(n.size.caption*n.lineHeight.normal)}px`,color:r.text.muted,backgroundColor:r.background}}o(Ko,"footnoteStyle");var Xo=120,Qo=44;function Jo({reason:e,onExit:r,exitLabel:t,style:n,className:i}){let{color:s,space:u,radius:d,type:a}=T();return jsxRuntime.jsxs("div",{className:i,"data-testid":"records-gate-off",style:{boxSizing:"border-box",minHeight:Xo,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:u.md,padding:u.lg,borderRadius:d.md,border:`1px solid ${s.brandBorder}`,backgroundColor:s.surfaceCream,color:s.text.primary,...n},children:[e.length>0?jsxRuntime.jsx("p",{style:{margin:0,fontSize:a.size.bodyTight,color:s.text.muted},children:e}):null,jsxRuntime.jsx("button",{type:"button",onClick:r,"data-testid":"records-gate-off-exit",style:{minHeight:Qo,padding:`0 ${u.lg}px`,borderRadius:d.pill,border:`1.5px solid ${s.brandInk}`,backgroundColor:"transparent",color:s.brandInk,font:"inherit",fontSize:a.size.body,cursor:"pointer"},children:t})]})}o(Jo,"RecordsGateOffState");function Ot(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx(Jo,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Ot,"recordsGateExit");var Pt="data-ef-screen-heading";var ri=120,ae=44,ti=52,Qe="Back";function ni(){let e=T(),r=react.useMemo(()=>oi(e),[e]);return {theme:e,styles:r}}o(ni,"useScreenStyles");function be({title:e,onBack:r,right:t,testID:n,variant:i="brand"}){let{styles:s}=ni();return jsxRuntime.jsxs("header",{style:s.headerRow,"data-testid":n,children:[r?jsxRuntime.jsx("button",{type:"button",onClick:r,"aria-label":Qe,style:s.iconButton,"data-testid":n?`${n}-back`:void 0,children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:s.backChevron})}):jsxRuntime.jsx("span",{style:s.iconButton}),e.trim().length>0?jsxRuntime.jsx("h2",{tabIndex:-1,[Pt]:"",style:i==="document"?s.documentTitle:s.headerTitle,children:e}):jsxRuntime.jsx("span",{"aria-hidden":"true",style:s.headerTitle,"data-testid":n?`${n}-spacer`:void 0}),jsxRuntime.jsx("div",{style:s.headerRight,children:t??jsxRuntime.jsx("span",{style:s.iconButton})})]})}o(be,"ScreenHeader");function oi(e){let{color:r,space:t,radius:n,type:i,slots:s}=e,u=o((E,S)=>`${Math.round(E*S)}px`,"lh"),d=o((E,S,B,Q="regular")=>({margin:0,..._(e,Q),fontSize:E,lineHeight:u(E,S),color:B}),"text"),a=$(s.recordCard),c=e.brightness==="dark"?r.errorRed:r.danger,p=o((E,S)=>({backgroundColor:E,color:S,border:"1.5px solid transparent"}),"tone"),b=o((E,S)=>({backgroundColor:r.surface,color:S,border:`1.5px solid ${E}`}),"edge"),g=`1px solid ${r.borderRingCream}`,v={boxSizing:"border-box",minHeight:ti,minWidth:ae,padding:`${t.md}px ${t.lg+t.xs/2}px`,borderRadius:n.pill,..._(e,"bold"),fontSize:i.size.body,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:t.sm,textDecoration:"none"};return {chipTones:{neutral:b(r.brandBorderStrong,r.text.primary),info:p(r.brandSoft,r.brandInk),warning:b(r.cautionAccent,r.text.primary),critical:b(r.danger,r.danger),positive:b(r.success,r.brandInk)},root:{...K,boxSizing:"border-box",display:"flex",flexDirection:"column",minHeight:ri,height:"100%",backgroundColor:r.background,color:r.text.primary,..._(e,"regular")},body:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"},content:{display:"flex",flexDirection:"column",gap:t.lg,padding:`0 ${t.lg}px ${t.xxl}px`},contentTight:{display:"flex",flexDirection:"column",gap:t.lg,padding:`0 ${t.sm}px ${t.xxl}px`},inset:{padding:`0 ${t.sm}px`},headerRow:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:t.sm,padding:`${t.xs}px ${t.lg}px ${t.md}px`},iconButton:{boxSizing:"border-box",width:ae,height:ae,display:"inline-flex",alignItems:"center",justifyContent:"center",border:0,background:"transparent",cursor:"pointer",padding:0,color:r.brandInk,flexShrink:0},backChevron:{display:"block",width:t.md,height:t.md,borderLeft:`2px solid ${r.brandInk}`,borderBottom:`2px solid ${r.brandInk}`,transform:"rotate(45deg)",marginLeft:t.xs},headerTitle:{...d(i.size.heading,i.lineHeight.tight,r.brandInk,"bold"),flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},documentTitle:{...d(i.size.subtitle,i.lineHeight.snug,r.text.primary,"bold"),flex:1,textAlign:"center"},headerRight:{display:"flex",alignItems:"center",gap:t.sm+t.xs/2},section:{display:"flex",flexDirection:"column",gap:t.sm+t.xs/2},sectionHeader:{display:"flex",alignItems:"center",gap:t.sm,padding:`0 ${t.xs}px`},sectionTitle:{...d(i.size.subtitle,i.lineHeight.snug,r.text.primary,"bold"),letterSpacing:"-0.02em"},sectionCount:{...d(i.size.bodyTight,i.lineHeight.snug,r.text.muted,"medium")},card:{boxSizing:"border-box",borderRadius:n.lg,border:g,backgroundColor:r.surface,padding:`${t.xs}px ${t.lg}px`,margin:0,listStyle:"none",...L(s.recordCard,1)},creamCard:{boxSizing:"border-box",borderRadius:n.lg,border:g,backgroundColor:r.surfaceCream,padding:t.lg,display:"flex",flexDirection:"column",gap:t.md,...L(s.recordCard,1)},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:t.md,padding:`${t.md}px 0`},rowDivider:{borderTop:`1px solid ${r.borderHairlineGreen}`},rowMain:{flex:1,minWidth:0},rowRight:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:t.xs+t.xs/2},rowTitle:{...d(i.size.body,i.lineHeight.snug,r.text.primary,"medium"),...a},rowDetail:{...d(i.size.caption,i.lineHeight.normal,r.text.secondary),marginTop:t.xs/2,...a},rowValue:{...d(i.size.body+1,i.lineHeight.snug,r.text.primary,"bold"),marginTop:t.xs/2,...a},rowMuted:{...d(i.size.caption,i.lineHeight.normal,r.text.muted),...a},chip:{boxSizing:"border-box",display:"inline-flex",alignItems:"center",minHeight:24,borderRadius:n.pill,padding:`0 ${t.sm+t.xs/2}px`,..._(e,"monoBold"),fontSize:i.size.tiny+1,lineHeight:u(i.size.tiny+1,i.lineHeight.snug),letterSpacing:"0.06em",textTransform:"uppercase",whiteSpace:"nowrap"},pill:v,pillPrimary:{border:0,backgroundColor:r.brand,color:r.onPrimary,...L(s.primaryButton),...$(s.primaryButton)},pillOutline:{border:`1.5px solid ${r.brandInk}`,backgroundColor:"transparent",color:r.brandInk},pillDanger:{border:`1.4px solid ${r.danger}`,backgroundColor:r.surface,color:r.danger,fontSize:i.size.bodyTight},pillAsk:{border:`1px solid ${r.borderRingCream}`,backgroundColor:r.surface,color:r.text.primary},pillLink:{minHeight:ae,border:0,backgroundColor:"transparent",color:r.linkInk,padding:`${t.sm}px`},pillDisabled:{opacity:.5,cursor:"default"},infoNote:{display:"flex",gap:t.sm,borderRadius:n.md-t.xs/2,backgroundColor:r.brandSoft,padding:`${t.sm+t.xs/2}px ${t.md}px`,...d(i.size.bodyTight,i.lineHeight.normal,r.text.primary)},cautionNote:{display:"flex",gap:t.sm,borderRadius:n.md-t.xs/2,backgroundColor:r.badgeBgCaution,padding:`${t.sm+t.xs/2}px ${t.md}px`,...d(i.size.bodyTight,i.lineHeight.normal,r.warningStrong)},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,...d(i.size.bodyTight,i.lineHeight.relaxed,r.text.primary)},errorBanner:{display:"flex",gap:t.sm,borderRadius:n.md-t.xs/2,backgroundColor:r.badgeBgCritical,padding:t.md,...d(i.size.bodyTight,i.lineHeight.normal,c)},errorText:d(i.size.bodyTight,i.lineHeight.normal,c),band:{display:"flex",alignItems:"flex-start",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,margin:0},bandText:{flex:1,...d(i.size.caption,i.lineHeight.normal,r.text.secondary)},infoGlyph:{boxSizing:"border-box",flexShrink:0,width:t.md+t.xs/2,height:t.md+t.xs/2,borderRadius:n.pill,border:`1px solid ${r.text.secondary}`,display:"inline-flex",alignItems:"center",justifyContent:"center",..._(e,"bold"),fontSize:i.size.small,color:r.text.secondary},chevron:{display:"inline-block",width:t.sm,height:t.sm,borderTop:`2px solid ${r.text.muted}`,borderRight:`2px solid ${r.text.muted}`,flexShrink:0},chipSentence:{..._(e,"medium"),fontSize:i.size.caption,lineHeight:u(i.size.caption,i.lineHeight.normal),letterSpacing:"normal",textTransform:"none",whiteSpace:"normal",borderRadius:n.md,padding:`${t.xs}px ${t.sm+t.xs/2}px`},lead:{...d(i.size.body+1,i.lineHeight.snug,r.text.primary,"bold"),padding:`0 ${t.sm}px`},subLead:{...d(i.size.body,i.lineHeight.normal,r.text.muted),padding:`0 ${t.lg}px ${t.md}px`},field:{boxSizing:"border-box",display:"block",width:"100%",minHeight:ae,padding:`${t.sm}px ${t.md}px`,border:`1px solid ${r.borderHairlineGreen}`,borderRadius:n.sm,color:r.text.primary,backgroundColor:r.surface,..._(e,"regular"),fontSize:i.size.body},fieldLabel:{...d(i.size.bodyTight,i.lineHeight.normal,r.text.secondary,"medium"),display:"block",marginBottom:t.xs},muted:d(i.size.caption,i.lineHeight.normal,r.text.muted),bodyText:d(i.size.body,i.lineHeight.normal,r.text.primary),mono:_(e,"mono"),plainList:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},dialogFrame:{boxSizing:"border-box",position:"fixed",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",margin:0,padding:0,border:0,backgroundColor:"transparent",overflow:"hidden"},dialogScrim:{boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",padding:t.lg,backgroundColor:"rgba(0,0,0,0.4)"},dialogScrimSide:{boxSizing:"border-box",display:"flex",alignItems:"stretch",justifyContent:"flex-end",width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.4)"},dialogPanel:{boxSizing:"border-box",width:"100%",maxWidth:560,maxHeight:"100%",overflowY:"auto",backgroundColor:r.surface,borderRadius:n.xl-1,padding:`${t.lg}px ${t.lg+t.xs+t.xs/2}px`,display:"flex",flexDirection:"column",gap:t.md,..._(e,"regular"),color:r.text.primary},dialogPanelSide:{boxSizing:"border-box",width:"min(100vw, 480px)",height:"100%",maxHeight:"100%",overflowY:"auto",backgroundColor:r.surface,padding:`${t.lg}px ${t.lg+t.xs+t.xs/2}px`,display:"flex",flexDirection:"column",gap:t.md,..._(e,"regular"),color:r.text.primary},sheetHeader:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:t.sm},sheetTitle:{...d(i.size.heading,i.lineHeight.snug,r.text.primary,"bold")},sheetHelper:d(i.size.bodyTight,i.lineHeight.normal,r.text.muted),closeGlyph:{fontSize:i.size.verdict,lineHeight:1,color:r.text.primary}}}o(oi,"makeScreenStyles");var Ft=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Je=60;function At(e){return `Try again in ${e}s`}o(At,"coolingActionLabel");var Dt="Try again, available shortly";function G({width:e,height:r,radius:t,style:n}){let{color:i,radius:s}=T();return jsxRuntime.jsx("span",{"aria-hidden":"true",style:{display:"block",width:e,height:r,borderRadius:t??s.xs,backgroundColor:i.skeleton,flexShrink:0,...n}})}o(G,"SkeletonBlock");var li=44,Ze=62;function zt({testID:e}){let r=jt();return jsxRuntime.jsxs("div",{role:"progressbar","aria-label":h.loadingTimeline,"aria-busy":"true",style:r.timeline,"data-testid":e,children:[jsxRuntime.jsx("div",{style:r.timelineDisclaimer,children:jsxRuntime.jsx(G,{width:"100%",height:li,radius:12})}),Array.from({length:6},(t,n)=>jsxRuntime.jsxs("div",{children:[n>0?jsxRuntime.jsx("div",{style:r.timelineSeparator}):null,jsxRuntime.jsxs("div",{style:r.timelineRow,children:[jsxRuntime.jsx(G,{width:34,height:34,radius:17}),jsxRuntime.jsxs("div",{style:r.timelineBody,children:[jsxRuntime.jsxs("div",{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(zt,"TimelineSkeleton");function he({variant:e,onAction:r,message:t,testID:n}){let i=jt(),s=Ft[e],[u,d]=react.useState(e==="rate_limited"?Je:0);react.useEffect(()=>{e==="rate_limited"&&d(Je);},[e]),react.useEffect(()=>{if(u<=0)return;let p=setTimeout(()=>d(b=>Math.max(0,b-1)),1e3);return ()=>clearTimeout(p)},[u]);let a=e==="rate_limited"&&u>0,c=a?At(u):s.action;return jsxRuntime.jsxs("section",{role:"status",style:i.empty,"data-testid":n,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:i.emptyGlyph}),jsxRuntime.jsx("h3",{style:i.emptyTitle,children:s.title}),jsxRuntime.jsx("p",{style:i.emptyBody,children:t??s.body}),c!==null&&r?jsxRuntime.jsx("button",{type:"button",onClick:r,disabled:a,"aria-label":a?Dt:c,style:{...i.emptyAction,...a?i.emptyActionDisabled:{}},"data-testid":n?`${n}-action`:`records-empty-${e}-action`,children:c}):null]})}o(he,"RecordsEmptyState");function jt(){let e=T();return react.useMemo(()=>di(e),[e])}o(jt,"useStyles");function di(e){let{color:r,space:t,radius:n,type:i}=e,s=`1px solid ${r.brandBorder}`;return {dashboard:{display:"flex",flexDirection:"column",gap:t.lg,padding:`${t.xs}px ${t.sm}px 0`,backgroundColor:r.background},inset:{padding:`0 ${t.sm}px`},summaryCard:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md+t.xs/2,borderRadius:n.lg-t.xs,border:s,backgroundColor:r.surface,padding:`${t.lg+t.xs}px ${t.lg}px`},badges:{display:"flex",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,border:s,backgroundColor:r.surface,padding:t.lg},dots:{display:"flex",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{display:"flex",justifyContent:"center"},actions:{display:"flex",flexDirection:"column",gap:t.sm+t.xs/2},actionRow:{display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,border:s,backgroundColor:r.surface,padding:t.lg},actionLeft:{flex:1,display:"flex",alignItems:"center",gap:t.md},request:{display:"flex",flexDirection:"column",gap:t.lg+t.xs/2,padding:`${t.xs}px ${t.lg}px 0`},railRow:{display:"flex",alignItems:"flex-start",gap:t.md},railColumn:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.xs/2,width:24},railBody:{flex:1,display:"flex",flexDirection:"column",gap:t.xs+t.xs/2,paddingBottom:t.lg+t.xs/2},statusCard:{display:"flex",flexDirection:"column",gap:t.sm,borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2},timeline:{backgroundColor:r.background},timelineDisclaimer:{padding:`${t.xs}px ${t.lg}px ${t.md}px`},timelineRow:{display:"flex",gap:t.md,padding:`${t.md+t.xs/2}px ${t.lg}px`},timelineBody:{flex:1,display:"flex",flexDirection:"column",gap:t.xs-1},timelineTop:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:1,backgroundColor:r.brandBorder,marginLeft:Ze},clinics:{display:"flex",flexDirection:"column",gap:t.md},clinicRow:{display:"flex",flexDirection:"column",gap:t.sm,borderRadius:n.lg-t.xs/2,border:s,backgroundColor:r.surface,padding:`${t.md+t.xs/2}px`},shares:{display:"flex",flexDirection:"column",gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,border:s},shareRow:{display:"flex",flexDirection:"column",gap:t.xs+t.xs/2},empty:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.sm+t.xs/2,padding:`${t.xxl}px ${t.xl}px`,textAlign:"center"},emptyGlyph:{boxSizing:"border-box",width:22,height:22,borderRadius:11,backgroundColor:r.brandSoft,border:s,marginBottom:t.xs},emptyTitle:{margin:0,..._(e,"bold"),fontSize:i.size.subtitle,lineHeight:`${Math.round(i.size.subtitle*i.lineHeight.snug)-1}px`,color:r.brandInk},emptyBody:{margin:0,..._(e,"regular"),fontSize:i.size.bodyTight,lineHeight:`${Math.round(i.size.bodyTight*i.lineHeight.normal)}px`,color:r.text.muted,maxWidth:320},emptyAction:{boxSizing:"border-box",marginTop:t.sm,minHeight:40,borderRadius:n.pill,padding:`0 ${t.lg+t.xs/2}px`,backgroundColor:r.brand,color:r.onPrimary,border:0,cursor:"pointer",..._(e,"bold"),fontSize:i.size.bodyTight},emptyActionDisabled:{opacity:.5,cursor:"default"}}}o(di,"makeStyles");var mi=300,Nt=120,Lt=44,yi=o((e,r)=>e.getTimeline(r),"readTimeline"),gi=o(e=>e.isEmpty,"timelineEmpty"),bi=o((e,r)=>e.getRecordDepth(r),"readDepth"),hi=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),vi=o(e=>e.contributions.length===0,"contributionsEmpty");function Ri({petRef:e,style:r,className:t,onBack:n}){let i=ie(e,yi,gi);return jsxRuntime.jsx(er,{state:i,style:r,className:t,onBack:n,header:jsxRuntime.jsx(be,{title:h.timeline,onBack:re(n),testID:"timeline-header"}),loading:jsxRuntime.jsx(zt,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(he,{variant:"no_records",testID:"timeline-empty"}),render:s=>jsxRuntime.jsx(Ci,{timeline:s})})}o(Ri,"EverfurRecordsTimeline");function _i({petRef:e,style:r,className:t,onBack:n}){let i=ie(e,bi,hi);return jsxRuntime.jsx(er,{state:i,style:r,className:t,onBack:n,header:n?jsxRuntime.jsx(be,{title:U.records,onBack:re(n)}):null,render:s=>jsxRuntime.jsx(wi,{depth:s})})}o(_i,"EverfurRecordDepth");function Ei({petRef:e,docId:r,style:t,className:n,onBack:i}){let s=react.useCallback((a,c)=>a.getDocumentContributions(c,r),[r]),u=ie(e,s,vi,r),d=u.value?.document?.title?.trim()||h.uploadedDocument;return jsxRuntime.jsx(er,{state:u,style:t,className:n,onBack:i,header:jsxRuntime.jsx(be,{title:d,onBack:re(i),testID:"contributions-header"}),empty:jsxRuntime.jsx(he,{variant:"no_records",testID:"contributions-empty"}),render:a=>jsxRuntime.jsx(Ti,{view:a})})}o(Ei,"EverfurDocumentContributions");function er({state:e,style:r,className:t,header:n,loading:i,empty:s,render:u,onBack:d}){let{styles:a}=ve(),{userRef:c}=M();return jsxRuntime.jsx(wt,{capability:"records",style:r,className:t,...Ot(re(d),Qe),children:jsxRuntime.jsxs("div",{className:t,style:{...a.container,...r},children:[n??null,jsxRuntime.jsx("div",{style:a.body,children:c===null?jsxRuntime.jsx("p",{role:"alert",style:a.alertText,children:U.sessionRequired}):xi(e,u,a,i,s)}),jsxRuntime.jsx(kt,{})]})})}o(er,"DepthSurface");function xi(e,r,t,n,i){switch(e.status){case "loading":return n??jsxRuntime.jsx(Si,{styles:t});case "empty":return i??jsxRuntime.jsx("div",{style:t.centered,children:jsxRuntime.jsx("div",{role:"img","aria-label":U.empty,style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(he,{variant:cr(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(xi,"renderState");function Si({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),mi);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":U.loading,style:e.centered,children:r?jsxRuntime.jsx("div",{"aria-hidden":"true",style:e.spinner}):null})}o(Si,"LoadingState");function Ci({timeline:e}){let{styles:r}=ve(),t=Se(e);return jsxRuntime.jsxs("section",{"aria-label":h.timeline,style:r.timelineList,children:[e.disclaimer.length>0?jsxRuntime.jsx("p",{role:"note","aria-label":dr.important(e.disclaimer),style:r.timelineBand,children:e.disclaimer}):null,jsxRuntime.jsx("ul",{style:r.plainList,children:t.map((n,i)=>jsxRuntime.jsx("li",{style:i>0?r.timelineSeparated:void 0,"data-testid":`records-timeline-row-${n.kind}`,children:jsxRuntime.jsxs("div",{style:r.timelineRow,"aria-label":[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:r.timelineBubble}),jsxRuntime.jsxs("div",{style:r.timelineBody,children:[jsxRuntime.jsxs("div",{style:r.topLine,children:[jsxRuntime.jsx("span",{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx("span",{style:r.date,children:n.date})]}),jsxRuntime.jsx("span",{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx("span",{style:r.rowDetail,children:n.detail}):null]})]})},n.key))})]})}o(Ci,"TimelineBody");function wi({depth:e}){let{styles:r}=ve();return jsxRuntime.jsxs("section",{"aria-label":U.records,style:r.list,children:[e.labResults.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.labResults} (${e.labResults.length})`}),jsxRuntime.jsx("ul",{style:r.card,children:e.labResults.map(t=>{let n=yr(t.latest.status),i=Rr(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs("li",{style:r.row,children:[jsxRuntime.jsx("span",{style:r.rowTitle,children:t.name}),jsxRuntime.jsx("span",{style:r.rowValue,children:vr(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),i?jsxRuntime.jsx("span",{style:r.rowDetail,children:i}):null,jsxRuntime.jsx("span",{style:{...r.chip,...n.outOfRange?r.chipCritical:r.chipNeutral},children:n.label}),t.meaning?jsxRuntime.jsx("span",{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.visits} (${e.encounters.length})`}),jsxRuntime.jsx("ul",{style:r.card,children:e.encounters.map(t=>{let n=[t.date?k(t.date):null,t.clinicName,t.veterinarian].filter(i=>i&&i!=="-").join(" \xB7 ");return jsxRuntime.jsxs("li",{style:r.row,children:[jsxRuntime.jsx("span",{style:r.rowTitle,children:t.type?de(t.type):h.visit}),n?jsxRuntime.jsx("span",{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.physicalExams} (${e.physicalExams.length})`}),e.physicalExams.map(t=>jsxRuntime.jsxs("div",{style:r.card,children:[jsxRuntime.jsx("h4",{style:r.rowTitle,children:t.observedOn?k(t.observedOn):h.exam}),jsxRuntime.jsx("ul",{style:r.plainList,children:t.systems.map(n=>{let i=n.findingStatus==="abnormal",s=i?h.abnormal:n.findingStatus==="not_examined"?h.notExamined:h.normal;return jsxRuntime.jsxs("li",{style:r.row,children:[jsxRuntime.jsx("span",{style:r.rowTitle,children:gr(n.system)}),i&&n.finding?jsxRuntime.jsx("span",{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx("span",{style:{...r.chip,...i?r.chipCaution:r.chipNeutral},children:s})]},n.system)})})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs("div",{style:r.section,children:[jsxRuntime.jsx("h3",{style:r.heading,children:`${h.visitNotes} (${e.clinicianNotes.length})`}),e.clinicianNotes.map(t=>jsxRuntime.jsxs("div",{style:r.card,children:[jsxRuntime.jsx("h4",{style:r.rowTitle,children:t.observedOn?k(t.observedOn):h.visitNote}),jsxRuntime.jsx("dl",{style:r.plainList,children:t.sections.map((n,i)=>jsxRuntime.jsxs("div",{style:r.row,children:[jsxRuntime.jsx("dt",{style:r.kindLabel,children:br(n.section)}),jsxRuntime.jsx("dd",{style:n.text?r.rowDetail:r.rowMuted,children:n.text||h.notRecorded})]},`${n.section}:${i}`))})]},t.noteId))]}):null]})}o(wi,"DepthBody");function Ti({view:e}){let{styles:r}=ve();return jsxRuntime.jsxs("section",{"aria-label":U.records,style:r.list,children:[e.document?.receivedAt?jsxRuntime.jsx("p",{style:r.rowDetail,children:k(e.document.receivedAt)}):null,jsxRuntime.jsx("dl",{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs("div",{style:r.row,children:[jsxRuntime.jsx("dt",{style:r.rowTitle,children:t.label}),jsxRuntime.jsx("dd",{style:r.rowValue,children:pr(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx("dd",{style:r.rowDetail,children:k(t.observedAt)}):null]},t.key))})]})}o(Ti,"ContributionsBody");function ve(){let e=T(),r=react.useMemo(()=>ki(e),[e]);return {theme:e,styles:r}}o(ve,"useDepthTheme");function ki(e){let{color:r,space:t,radius:n,type:i,slots:s}=e,u=o((g,v)=>`${Math.round(g*v)}px`,"lh"),d=o((g,v,E,S="regular")=>({margin:0,..._(e,S),fontSize:g,lineHeight:u(g,v),color:E}),"text"),a=$(s.recordCard),c=o((g,v,E,S="regular")=>({...d(g,v,E,S),...a}),"inCard"),p=`1px solid ${r.brandBorder}`,b=e.brightness==="dark"?r.errorRed:r.danger;return {container:{boxSizing:"border-box",display:"flex",flexDirection:"column",minHeight:Nt,height:"100%",backgroundColor:r.background,color:r.text.primary,..._(e,"regular")},body:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"},centered:{boxSizing:"border-box",flex:"1 1 auto",minHeight:Nt,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:t.lg,padding:t.xl,textAlign:"center"},spinner:{boxSizing:"border-box",width:24,height:24,borderRadius:n.pill,border:`3px solid ${r.brandSofter}`,borderTopColor:r.brandInk},emptyGlyph:{boxSizing:"border-box",width:40,height:40,borderRadius:n.lg,backgroundColor:r.brandSoft,border:p},alertText:d(i.size.subtitle,i.lineHeight.snug,r.text.secondary),errorText:d(i.size.subtitle,i.lineHeight.snug,b),primaryButton:{boxSizing:"border-box",minHeight:Lt,minWidth:Lt,padding:`${t.md}px ${t.xl}px`,borderRadius:n.pill,..._(e,"bold"),fontSize:i.size.body,border:0,cursor:"pointer",backgroundColor:r.primary,color:r.onPrimary,...L(s.primaryButton),...$(s.primaryButton)},list:{display:"flex",flexDirection:"column",gap:t.md,padding:t.lg},section:{display:"flex",flexDirection:"column",gap:t.sm},heading:{...d(i.size.heading,i.lineHeight.snug,r.text.primary,"bold")},card:{boxSizing:"border-box",listStyle:"none",display:"flex",flexDirection:"column",gap:t.sm,margin:0,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,border:p,...L(s.recordCard,1)},plainList:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:t.sm},row:{display:"flex",flexDirection:"column",gap:t.xs,padding:`${t.xs}px 0`,borderBottom:`1px solid ${r.borderHairlineGreen}`},topLine:{display:"flex",justifyContent:"space-between",gap:t.md},kindLabel:{...c(i.size.caption,i.lineHeight.normal,r.text.muted,"medium")},date:c(i.size.caption,i.lineHeight.normal,r.text.muted),rowTitle:{...c(i.size.body,i.lineHeight.normal,r.text.primary,"bold")},rowValue:{...c(i.size.body,i.lineHeight.normal,r.text.primary,"medium")},rowDetail:c(i.size.bodyTight,i.lineHeight.normal,r.text.muted),rowMuted:{...c(i.size.bodyTight,i.lineHeight.normal,r.text.muted),opacity:.7},chip:{...d(i.size.caption,i.lineHeight.normal,r.text.primary),alignSelf:"flex-start",padding:`${t.xs}px ${t.sm}px`,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:d(i.size.caption,i.lineHeight.normal,r.text.muted),timelineList:{display:"flex",flexDirection:"column",paddingBottom:t.xxl},timelineBand:{...d(i.size.caption,i.lineHeight.normal,r.text.secondary),borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,margin:`${t.xs}px ${t.lg}px ${t.md}px`},timelineSeparated:{borderTop:`1px solid ${r.brandBorder}`,marginLeft:Ze,paddingLeft:0},timelineRow:{display:"flex",gap:t.md,padding:`${t.md+t.xs/2}px ${t.lg}px`},timelineBubble:{boxSizing:"border-box",flexShrink:0,width:34,height:34,borderRadius:n.pill,backgroundColor:r.brandSoft,border:p},timelineBody:{flex:1,display:"flex",flexDirection:"column",gap:t.xs-1,minWidth:0},timelineKind:{..._(e,"mono"),fontSize:i.size.micro,lineHeight:`${i.size.bodyTight}px`,letterSpacing:i.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...d(i.size.body,i.lineHeight.normal,r.text.primary,"medium")}}}o(ki,"makeStyles");
2
+ exports.EverfurDocumentContributions=Ei;exports.EverfurRecordDepth=_i;exports.EverfurRecordsTimeline=Ri;exports.buildTimelineRows=Se;exports.mapDocumentContributions=ot;exports.mapRecordDepth=tt;exports.mapRecordsTimeline=nt;exports.useEverfurRecordsDepthClient=dt;exports.useRecordsDepthRead=ie;
@@ -1,13 +1,13 @@
1
- export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../../DepthViews-CT5mQld9.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-CNEHZJtj.cjs';
3
- export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../../timelineRows-BuNhzDbH.cjs';
4
- export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../../depth-NmWSbvfi.cjs';
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../../DepthViews-D81c95Ra.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-COJ0wSYK.cjs';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../../timelineRows-DDnz4gx2.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 RecordShareAudience, m as RecordsClinic, n as RecordsDepthClient, o as RecordsRequestDocument, p as RecordsTimelineMedication, q as RecordsTimelineVaccine, r as RecordsTimelineView, s as RecordsTimelineVisit, t as RecordsTimelineWeight, u as mapDocumentContributions, v as mapRecordDepth, w as mapRecordsTimeline } from '../../../depth-CAAwiStc.cjs';
5
5
  export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../../ids-B2GAAifq.cjs';
6
6
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../../EverfurError-DmELDpXp.cjs';
7
7
  export { E as EverfurResult } from '../../../EverfurResult-ZtH-YV1h.cjs';
8
8
  export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../../models-Bn2z0NNo.cjs';
9
9
  import 'react';
10
- import '../../../requestFunnel-DAwb7haa.cjs';
10
+ import '../../../requestFunnel-DMR_1T3O.cjs';
11
11
  import '../../../ErrorPolicyPort-D6CybiqJ.cjs';
12
- import '../../../config-BZX97FmW.cjs';
13
- import '../../../identity-D7PO5s9m.cjs';
12
+ import '../../../config-Daa1plhQ.cjs';
13
+ import '../../../identity-DUlshgow.cjs';