@everfur/sdk 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Chat.d-B4GybUU4.d.ts → Chat.d-BIr_4AJt.d.ts} +1 -1
- package/dist/{Chat.d-DPM2ncxi.d.cts → Chat.d-BhevtXn9.d.cts} +1 -1
- package/dist/{DepthViews.d-BGspxovy.d.cts → DepthViews.d-C8KdfzwR.d.cts} +1 -1
- package/dist/{DepthViews.d-BaLh7Lsi.d.cts → DepthViews.d-DWQ-J208.d.cts} +1 -1
- package/dist/{DepthViews.d-BIHVrf9r.d.ts → DepthViews.d-DYVUq4Xk.d.ts} +1 -1
- package/dist/{DepthViews.d-CEVk9poG.d.ts → DepthViews.d-oKr9R0Ql.d.ts} +1 -1
- package/dist/{IntakeMedia.d-CwSkSLNM.d.ts → IntakeMedia.d-B-ZZK6vd.d.ts} +1 -1
- package/dist/{IntakeMedia.d-LRXO38_z.d.cts → IntakeMedia.d-CuVkzIsO.d.cts} +1 -1
- package/dist/{IntakeMedia.d-DmaeGU6T.d.cts → IntakeMedia.d-CyF6NPHx.d.cts} +1 -1
- package/dist/{IntakeMedia.d-Dyb9R8b0.d.ts → IntakeMedia.d-vU8g9OM5.d.ts} +1 -1
- package/dist/{RecordsPage.d-D10RIgdc.d.ts → RecordsPage.d-DU8Nswzh.d.ts} +1 -1
- package/dist/{RecordsPage.d-DbhYNSbq.d.cts → RecordsPage.d-DzPhqMHW.d.cts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{attachments.d-CF4lLuGK.d.cts → attachments.d-0nOPDIng.d.cts} +1 -1
- package/dist/{attachments.d-BlukNfIf.d.ts → attachments.d-BlyI-RCY.d.ts} +1 -1
- package/dist/{bookingCopy.d-Bn8bdo89.d.ts → bookingCopy.d-ClL8OxBS.d.ts} +3 -3
- package/dist/{bookingCopy.d-Dg7bPM-U.d.cts → bookingCopy.d-DUVqhF5f.d.cts} +3 -3
- package/dist/{branding.d-XrZYClN4.d.ts → branding.d-D0LV3aFE.d.ts} +1 -1
- package/dist/{branding.d-CqDLKj1U.d.cts → branding.d-DzSPLZKl.d.cts} +1 -1
- package/dist/{casesRepository.d-CVuKTkJo.d.cts → casesRepository.d-DnanKXJ1.d.cts} +1 -1
- package/dist/{casesRepository.d-Dn1fK1b2.d.ts → casesRepository.d-_4QucKVC.d.ts} +1 -1
- package/dist/chat/index.cjs +239 -238
- package/dist/chat/index.d.cts +11 -11
- package/dist/chat/index.d.ts +11 -11
- package/dist/chat/index.js +241 -240
- package/dist/chat/lite/index.cjs +239 -238
- package/dist/chat/lite/index.d.cts +11 -11
- package/dist/chat/lite/index.d.ts +11 -11
- package/dist/chat/lite/index.js +239 -238
- package/dist/{chatHandoffToken.d-zdp23Ukr.d.ts → chatHandoffToken.d-BoZGGbIB.d.ts} +5 -5
- package/dist/{chatHandoffToken.d-Cap2z62P.d.cts → chatHandoffToken.d-DhhGdLNH.d.cts} +5 -5
- package/dist/{checkin.d-CuIUahcd.d.cts → checkin.d-DB-HlK7r.d.cts} +9 -4
- package/dist/{checkin.d-BoZXWjxX.d.ts → checkin.d-DogrR06X.d.ts} +9 -4
- package/dist/{chunk-ZSCVH4UW.js → chunk-6E3J6IVM.js} +16 -16
- package/dist/{chunk-CQUKIPRU.js → chunk-J5ZUBY3S.js} +1 -1
- package/dist/{chunk-RF4N4WUN.js → chunk-LPHBCDJP.js} +18 -18
- package/dist/{chunk-DBQYQLJT.js → chunk-ULQDOC75.js} +1 -1
- package/dist/client/index.cjs +28 -27
- package/dist/client/index.d.cts +13 -13
- package/dist/client/index.d.ts +13 -13
- package/dist/client/index.js +25 -24
- package/dist/{clinicBatch.d-C0xx5L4j.d.cts → clinicBatch.d-BvPF6vXS.d.cts} +2 -2
- package/dist/{clinicBatch.d-DNi4UURs.d.ts → clinicBatch.d-CF0GIvpx.d.ts} +2 -2
- package/dist/{config.d-B7Z-KTGq.d.ts → config.d-Bc41Ax6M.d.ts} +5 -1
- package/dist/{config.d-ClAI2RZ6.d.cts → config.d-Bn6GEGfl.d.cts} +5 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-D7zX6Q0J.d.ts → context.d-0QfLaI3W.d.ts} +5 -5
- package/dist/{context.d-guaLkx5t.d.cts → context.d-CyQpedoU.d.cts} +5 -5
- package/dist/{copy.d--F5A9cXK.d.cts → copy.d-B55PpLxr.d.cts} +2 -2
- package/dist/{copy.d-DmxuFJFe.d.ts → copy.d-B8wIE6cH.d.ts} +2 -2
- package/dist/core/index.cjs +32 -31
- package/dist/core/index.d.cts +16 -16
- package/dist/core/index.d.ts +16 -16
- package/dist/core/index.js +32 -31
- package/dist/{depth.d-CgzYE6_n.d.ts → depth.d-CrtZXnLy.d.ts} +2 -2
- package/dist/{depth.d-DLaP0o8Y.d.cts → depth.d-Cxz6VisZ.d.cts} +2 -2
- package/dist/{entitlementRepository.d-CkUTlVAb.d.ts → entitlementRepository.d-BaZTIe1B.d.ts} +3 -3
- package/dist/{entitlementRepository.d-DVTp-BB9.d.cts → entitlementRepository.d-YeNG2TKI.d.cts} +3 -3
- package/dist/{focus.d-u-HYvim0.d.ts → focus.d-520VEHKB.d.ts} +1 -1
- package/dist/{focus.d-CLTjm6In.d.cts → focus.d-DoempN1I.d.cts} +1 -1
- package/dist/health-plan/index.cjs +236 -235
- package/dist/health-plan/index.d.cts +15 -15
- package/dist/health-plan/index.d.ts +15 -15
- package/dist/health-plan/index.js +236 -235
- package/dist/{healthPlanRepository.d-CwRXeoM7.d.ts → healthPlanRepository.d-BHu9LO0r.d.ts} +2 -2
- package/dist/{healthPlanRepository.d-B22kjrYa.d.cts → healthPlanRepository.d-tUR1f_5s.d.cts} +2 -2
- package/dist/{idempotency.d-DrxKLPPe.d.cts → idempotency.d-CcFLvzYW.d.cts} +1 -1
- package/dist/{idempotency.d-CbB07p64.d.ts → idempotency.d-CvqKG3Uq.d.ts} +1 -1
- package/dist/{identity.d-D4VtpqRr.d.ts → identity.d-Bex_XJZx.d.ts} +1 -1
- package/dist/{identity.d-DDpXOtas.d.cts → identity.d-Dm0Buvn8.d.cts} +1 -1
- package/dist/{inbox.d-B2JXK0uI.d.ts → inbox.d-9ajb0oiJ.d.ts} +1 -1
- package/dist/{inbox.d-CwA1ogzV.d.cts → inbox.d-CGCYOZIq.d.cts} +1 -1
- package/dist/index.cjs +362 -361
- package/dist/index.d.cts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.js +253 -252
- package/dist/{introEvents.d-DW3gLljE.d.ts → introEvents.d-CuVaufTy.d.ts} +1 -1
- package/dist/{introEvents.d-B7acmGwf.d.cts → introEvents.d-DU6feqx4.d.cts} +1 -1
- package/dist/{layout.d-C8y_ki1V.d.ts → layout.d-BQ5IVS-m.d.ts} +1 -1
- package/dist/{layout.d-DfaFM_lp.d.cts → layout.d-CSPr33BP.d.cts} +1 -1
- package/dist/notifications/inbox/index.d.cts +6 -6
- package/dist/notifications/inbox/index.d.ts +6 -6
- package/dist/notifications/index.d.cts +7 -7
- package/dist/notifications/index.d.ts +7 -7
- package/dist/{optInView.d-Cps7aLQN.d.ts → optInView.d-DpGXnpGw.d.ts} +21 -3
- package/dist/{optInView.d-ChJyJMBA.d.cts → optInView.d-dLjrI3co.d.cts} +21 -3
- package/dist/{pets.d-BpLObpfM.d.ts → pets.d-CHdSIoBf.d.ts} +1 -1
- package/dist/{pets.d-DXhzTNuI.d.cts → pets.d-jnhrJhqm.d.cts} +1 -1
- package/dist/{petsRepository.d-ai_tZ3lu.d.cts → petsRepository.d-BeKRiNao.d.cts} +1 -1
- package/dist/{petsRepository.d-_QfM7F6T.d.ts → petsRepository.d-BjwB1vku.d.ts} +1 -1
- package/dist/{presentation.d-BkIvMtIl.d.cts → presentation.d-Br3TnwA6.d.cts} +17 -1
- package/dist/{presentation.d-BkIvMtIl.d.ts → presentation.d-Br3TnwA6.d.ts} +17 -1
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +237 -228
- package/dist/records/index.d.cts +39 -12
- package/dist/records/index.d.ts +39 -12
- package/dist/records/index.js +155 -146
- package/dist/{requestFunnel.d-DKBPTpsy.d.ts → requestFunnel.d-C_NMgz9R.d.ts} +2 -2
- package/dist/{requestFunnel.d-BwZDfWVD.d.cts → requestFunnel.d-DoJWLySc.d.cts} +2 -2
- package/dist/{route.d-QBCoO62z.d.cts → route.d-BW2abFVK.d.cts} +2 -2
- package/dist/{route.d-B3u14HJT.d.ts → route.d-Olr_gXaa.d.ts} +2 -2
- package/dist/{runtimeTypes.d-hjN6xvxm.d.ts → runtimeTypes.d-Bp2VW6YE.d.ts} +6 -6
- package/dist/{runtimeTypes.d-BSxuUCOX.d.cts → runtimeTypes.d-StvJY45N.d.cts} +6 -6
- package/dist/{screenProps.d-fHBKArt_.d.ts → screenProps.d-BTLSji0N.d.ts} +1 -1
- package/dist/{screenProps.d-6xmE1C-V.d.cts → screenProps.d-B_5Bh7aQ.d.cts} +1 -1
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +19 -5
- package/dist/server/events/index.d.ts +19 -5
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/slots/index.cjs +200 -199
- package/dist/slots/index.d.cts +5 -5
- package/dist/slots/index.d.ts +5 -5
- package/dist/slots/index.js +200 -199
- package/dist/tabs/index.cjs +200 -190
- package/dist/tabs/index.d.cts +68 -11
- package/dist/tabs/index.d.ts +68 -11
- package/dist/tabs/index.js +201 -191
- package/dist/tabs-bar/index.cjs +247 -0
- package/dist/tabs-bar/index.d.cts +10 -0
- package/dist/tabs-bar/index.d.ts +10 -0
- package/dist/tabs-bar/index.js +247 -0
- package/dist/{tabsModel.d-D9GWPFrL.d.ts → tabsModel.d-B4MSQB57.d.cts} +5 -2
- package/dist/{tabsModel.d-D9GWPFrL.d.cts → tabsModel.d-C8pd-DP3.d.ts} +5 -2
- package/dist/televet/booking/index.cjs +147 -145
- package/dist/televet/booking/index.d.cts +10 -10
- package/dist/televet/booking/index.d.ts +10 -10
- package/dist/televet/booking/index.js +163 -161
- package/dist/televet/call/index.cjs +52 -52
- package/dist/televet/call/index.d.cts +5 -0
- package/dist/televet/call/index.d.ts +5 -0
- package/dist/televet/call/index.js +25 -25
- package/dist/televet/index.d.cts +3 -3
- package/dist/televet/index.d.ts +3 -3
- package/dist/{televetGlobal.d-gZrXPaLl.d.cts → televetGlobal.d-B_I_fy7O.d.cts} +9 -0
- package/dist/{televetGlobal.d-DkJkV55Y.d.ts → televetGlobal.d-DN7o45WJ.d.ts} +9 -0
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.d.cts +9 -9
- package/dist/testing/rn/index.d.ts +9 -9
- package/dist/testing/web/index.d.cts +9 -9
- package/dist/testing/web/index.d.ts +9 -9
- package/dist/texting/index.cjs +32 -27
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/texting/index.js +52 -47
- package/dist/{threadOptions.d-NSlFx-Lp.d.ts → threadOptions.d-D_3hk79R.d.ts} +5 -5
- package/dist/{threadOptions.d-Dc57dm7h.d.cts → threadOptions.d-D_GU6lp9.d.cts} +5 -5
- package/dist/{timelineRows.d-CthNM5hV.d.ts → timelineRows.d-BbVuARtc.d.ts} +1 -1
- package/dist/{timelineRows.d-7w8NsNi4.d.cts → timelineRows.d-BiLAAbYl.d.cts} +1 -1
- package/dist/{typeStyle.d-8mcLhtbH.d.ts → typeStyle.d-DSk99BuZ.d.ts} +1 -1
- package/dist/{typeStyle.d-CLrQZW-r.d.cts → typeStyle.d-DqR6mWCF.d.cts} +1 -1
- package/dist/{useHealthPlanSubscription.d-CV7M21HS.d.ts → useHealthPlanSubscription.d-CpE6l1VW.d.ts} +3 -3
- package/dist/{useHealthPlanSubscription.d-SA9-SuKe.d.cts → useHealthPlanSubscription.d-DRiWDJXq.d.cts} +3 -3
- package/dist/{useInboxUnread.d-0DrQPn7J.d.ts → useInboxUnread.d-BV7PkWDH.d.ts} +1 -1
- package/dist/{useInboxUnread.d-CRcOTkmu.d.cts → useInboxUnread.d-CElyXBkY.d.cts} +1 -1
- package/dist/{usePresentation.d-BJzFicRQ.d.cts → usePresentation.d-BcazazQH.d.cts} +3 -3
- package/dist/{usePresentation.d-DgSGIWS-.d.ts → usePresentation.d-CMOypLlH.d.ts} +3 -3
- package/dist/{useRecordsDepth.d-ZX2rhcUx.d.ts → useRecordsDepth.d-Bka4KQhq.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-C9W45gwS.d.cts → useRecordsDepth.d-TgmpxKdX.d.cts} +1 -1
- package/dist/{useUnread.d-4SbFChbd.d.ts → useUnread.d-CGqaP-dB.d.ts} +27 -5
- package/dist/{useUnread.d-B0YhhR_D.d.cts → useUnread.d-DVVnYNPU.d.cts} +27 -5
- package/dist/{view.d-3lxzyJlL.d.cts → view.d-CwruYhQy.d.cts} +3 -3
- package/dist/{view.d-DRiYNQJ8.d.ts → view.d-DamH8TQF.d.ts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +9 -8
- package/dist/web/health-plan/index.d.cts +16 -16
- package/dist/web/health-plan/index.d.ts +16 -16
- package/dist/web/health-plan/index.js +49 -48
- package/dist/web/inbox/index.d.cts +7 -7
- package/dist/web/inbox/index.d.ts +7 -7
- package/dist/web/index.cjs +185 -184
- package/dist/web/index.d.cts +32 -32
- package/dist/web/index.d.ts +32 -32
- package/dist/web/index.js +179 -178
- package/dist/web/intro/index.d.cts +7 -7
- package/dist/web/intro/index.d.ts +7 -7
- package/dist/web/notifications/index.d.cts +6 -6
- package/dist/web/notifications/index.d.ts +6 -6
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records-sheet/index.cjs +111 -110
- package/dist/web/records-sheet/index.js +111 -110
- package/dist/web/shop/index.cjs +1 -1
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/shop/index.js +1 -1
- package/dist/web/televet/booking/index.cjs +3 -3
- package/dist/web/televet/booking/index.d.cts +10 -10
- package/dist/web/televet/booking/index.d.ts +10 -10
- package/dist/web/televet/booking/index.js +69 -69
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.d.cts +3 -3
- package/dist/web/televet/index.d.ts +3 -3
- package/dist/web/texting/index.cjs +34 -29
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/dist/web/texting/index.js +45 -40
- package/dist/web/ui/index.cjs +1 -1
- package/dist/web/ui/index.js +41 -41
- package/package.json +16 -1
- package/tabs-bar/package.json +8 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import{createContext,forwardRef as e,createElement as t,useState as r,useMemo as n,useEffect as i,useContext as a,useCallback as l,useRef as o,useSyncExternalStore as s,Component as d}from"react";import{TextInput as u,Image as c,View as p,Pressable as h,StyleSheet as f,ScrollView as g,Text as b,Linking as m}from"react-native";import{jsx as y,jsxs as v,Fragment as w}from"react/jsx-runtime";import{z as A}from"zod";import{EverfurPoweredBy as k}from"@everfur/sdk/chat";import{EverfurTelevetHost as _}from"@everfur/sdk/televet";function parseColor(e){let t=S(e);return t===null?null:I(t)}function S(e){if(typeof e=="number")return R(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return C(t.slice(1));if(t.toLowerCase().startsWith("0x"))return C(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return T(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=C(t);if(e!==null)return e}return/^\d+$/.test(t)?R(Number.parseInt(t,10)):null}function C(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:O(t[0]),g:O(t[1]),b:O(t[2]),a:1};if(t.length===6)return{r:z(t,0),g:z(t,2),b:z(t,4),a:1};if(t.length===8){let e=z(t,0);return{r:z(t,2),g:z(t,4),b:z(t,6),a:e/255}}return null}function T(e){let t=e.indexOf("("),r=e.indexOf(")");if(t<0||r<0||r<t)return null;let n=e.slice(t+1,r).split(",").map(e=>e.trim());if(n.length<3)return null;let i=E(Number(n[0])),a=E(Number(n[1])),l=E(Number(n[2]));if(i===null||a===null||l===null)return null;let o=1;if(n.length>=4){let e=Number(n[3]);if(!Number.isFinite(e))return null;o=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:l,a:o}}function R(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,r=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:r===0?1:r/255}}function z(e,t){return Number.parseInt(e.slice(t,t+2),16)}function O(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function E(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function I(e){if(e.a>=1)return j(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function j(e,t,r){return`#${x(e)}${x(t)}${x(r)}`.toUpperCase()}function x(e){return e.toString(16).padStart(2,"0")}var F="#111111",D="#FFFFFF",B="#000000";function readableOn(e){let t=S(e);if(t===null)return D;let r=N(t),n=N({r:17,g:17,b:17}),i=N({r:255,g:255,b:255});return U(r,i)>=U(r,n)?D:F}function P(e,t){let r=readableOn(e);return contrastRatio(r,e)>=t?r:contrastRatio(D,e)>=contrastRatio(B,e)?D:B}function H(e){let t=t=>e.reduce((e,r)=>Math.min(e,contrastRatio(t,r)),Number.POSITIVE_INFINITY);return t(D)>=t(B)?D:B}function N(e){let t=M(e.r/255),r=M(e.g/255),n=M(e.b/255);return.2126*t+.7152*r+.0722*n}function M(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function U(e,t){let r=Math.max(e,t),n=Math.min(e,t);return(r+.05)/(n+.05)}function contrastRatio(e,t){let r=S(e),n=S(t);if(r===null||n===null)return 1;let i=n.a>=1?n:{...n},a=r.a>=1?r:L(r,i);return U(N(a),N(i))}function L(e,t){let r=e.a,n=(e,t)=>Math.round(e*r+t*(1-r));return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function W(e,t){let r=S(e),n=S(t);if(r===null||n===null)return null;let i=r.a>=1?r:L(r,{...n});return j(i.r,i.g,i.b)}function V(e,t){let r=S(e);if(r===null)return null;let n=Math.min(1,Math.max(0,t));return`rgba(${r.r}, ${r.g}, ${r.b}, ${n})`}var q=.05;function G(e,t,r,n){let i=t[0];if(i===void 0)return r;let a=e=>t.every(t=>contrastRatio(e,t)>=n);if(S(e)===null)return r;if(a(e))return e;let l=W(e,i),o=l===null?null:S(l),s=S(r);if(o===null||s===null)return r;for(let e=1;e<1/q;e+=1){let t=e*q,r=(e,r)=>Math.round(e+(r-e)*t),n=j(r(o.r,s.r),r(o.g,s.g),r(o.b,s.b));if(a(n))return n}return r}function K(e,t,r){let n=e/255,i=t/255,a=r/255,l=Math.max(n,i,a),o=Math.min(n,i,a),s=(l+o)/2;if(l===o)return{h:0,s:0,l:s};let d=l-o,u=d/(1-Math.abs(2*s-1)),c;return l===n?(c=(i-a)/d*60,c<0&&(c=c+360)):l===i?c=((a-n)/d+2)*60:c=((n-i)/d+4)*60,{h:c,s:u,l:s}}function Q(e){let{h:t,s:r,l:n}=e,i=(1-Math.abs(2*n-1))*r,a=t/60,l=i*(1-Math.abs(a%2-1)),o=n-i/2,s=Math.floor(a)%6,d=[[i,l,0],[l,i,0],[0,i,l],[0,l,i],[l,0,i],[i,0,l]],[u,c,p]=d[s];return{r:Y(u+o),g:Y(c+o),b:Y(p+o)}}function Y(e){return Math.min(255,Math.max(0,Math.floor(e*255+.5)))}var $=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,n=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:n}:{fontFamily:n,fontWeight:r.weight[$[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:n}=e.type;if(r===null&&n===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:n??e.type.weight[$[t]]};let i=face(e,t);return i.fontWeight===void 0||n===null?i:{fontFamily:i.fontFamily,fontWeight:n}}function J(e){return e<=450?"regular":e<=650?"medium":"bold"}var Z={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=X.get(e);r===void 0&&(r=/* @__PURE__ */new Map,X.set(e,r));let n=r.get(t);if(n!==void 0)return n;let i=ee(e,t);return r.set(t,i),i}var X=/* @__PURE__ */new WeakMap;function ee(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=J(Number(n)),a=r.face==="mono"?face(e,Z[i]):r.face==="heading"?headingFace(e,i):face(e,i),l=r.face==="heading"?e.type.headingWeight??n:n,o=a.fontWeight===void 0?a:{fontFamily:a.fontFamily,fontWeight:l},s=r.size,d={...o,fontSize:s,lineHeight:Math.round(s*r.lineHeight*100)/100};return r.letterSpacing!==0&&(d.letterSpacing=Math.round(s*r.letterSpacing*100)/100),r.uppercase&&(d.textTransform="uppercase"),/* @__PURE__ */Object.freeze(d)}var te="Go to the nearest emergency vet now.";var re=/* @__PURE__ */Object.freeze({placeholder:"Ask anything about {petName}…",placeholderFollowUpWeb:"Ask a follow-up…",placeholderUrgentWeb:"Tell us what’s happening…",composerLabel:"Message",attachPhotoOrFileNative:"Add a photo or file",suggestions:"Suggestions",reading:"Reading {petName}’s records…",answered:"Everfur answered.",assistantName:"Everfur",followUpsHeadingNative:"Follow-up questions",turnFailedTitleWeb:"Everfur couldn’t answer that just now.",send:"Send",stop:"Stop",retry:"Try again",poweredBy:"powered by everfur",senderUser:"You",senderAssistant:"Assistant",senderVet:"Your vet",loading:"Loading",empty:"No messages yet",transcript:"Chat with Everfur",emptyTitle:"What can we help {petName} with today?",emptyTitlePetFallback:"your pet",copied:"Copied",copyUserMessage:"Copy your message",copyAssistantMessage:"Copy assistant message",feedbackHelpful:"Helpful",feedbackNeutral:"Neutral",feedbackNotHelpful:"Not helpful",feedbackTitle:"What went wrong?",feedbackSubtitle:"Your feedback helps make answers more reliable.",feedbackReasonInaccurate:"Inaccurate",feedbackReasonOutdated:"Out of date",feedbackReasonUnsafe:"Unsafe advice",feedbackReasonUnclear:"Confusing or unclear",feedbackReasonOther:"Something else",feedbackNotesPlaceholder:"Add details (optional)",feedbackSubmit:"Submit feedback",feedbackSkip:"Skip",feedbackSkipA11y:"Skip feedback",feedbackThanks:"Thanks for the feedback",feedbackFailed:"Couldn't send feedback. Please try again.",turnFailedTitle:"Message failed",turnRetry:"Retry",turnUnreachableTitle:"Couldn't reach this chat",turnStartNewChat:"Start a new chat",reconnecting:"Reconnecting…",turnStoppedTitle:"Response stopped",turnStoppedBody:"You stopped this response before it finished. Tap retry to try again.",sourceSingular:"source",sourcePlural:"sources",showSources:"Show",hideSources:"Hide",sourcesHeading:"Sources",openSource:"Open source",urgencyGeneralReason:"Just general info about {petName}. Nothing here needs action right now.",findVet:"Find a vet",findVetA11y:"Find a vet near you",nearestEmergencyVet:"Nearest emergency vet",goToNearestEmergencyVet:te,poisonControlWeb:"ASPCA Poison Control",poisonControlNative:"ASPCA Animal Poison Control, (888) 426-4435",showLatestVetAlert:"Show latest vet alert",dismissBanner:"Dismiss {label} banner",openHistoryNative:"Chats and vet messages",openHistoryWeb:"Chats",showChatsWeb:"Show chats",hideChatsWeb:"Hide chats",newReplySuffix:", a new reply",yourPets:"Your pets",yourPet:"Your pet",switchActivePet:"{name}. Switch pet",petCurrentlyActive:"{name}, currently active",switchToPet:"Switch to {name}",activePrefix:"Active · ",close:"Close",addAnotherPet:"Add a pet",addPet:"Add a pet",capReached:"You've used your {cap} free messages this month.",attachmentPhoto:"Photo",attachmentCamera:"Camera",closeAttachmentPicker:"Close attachment picker",addAttachment:"Add attachment, {used} of {total} used",attachmentsFull:"Attachments full, {used} of {total} used",retryUpload:"Retry uploading {filename}",removeAttachment:"Remove {filename}",previewAttachment:"Preview {filename}",closePreview:"Close preview",attachedImage:"Attached image: {filename}, opens a full-screen preview",attachmentTooLarge:"Files must be under {max}. {filename} is {size}.",attachmentTooMany:"You can attach up to {max} files per message.",attachmentUnsupported:"{filename} isn't a supported file type yet.",attachmentNetwork:"Couldn't reach the server. Check your connection and try again.",attachmentServer:"Upload failed{status}. Please try again.",attachmentCancelled:"Upload cancelled.",attachmentRateLimited:"Slow down. Please wait a moment and try again.",attachmentQuota:"Daily image limit reached. Try again tomorrow.",attachmentConflict:"Something went wrong. Tap to retry.",attachmentUnknown:"Something went wrong. Please try again.",attachmentsFailedBlocked:"Some attachments failed to upload. Remove or retry them before sending.",dictate:"Dictate a message",stopDictation:"Stop dictation",listening:"Listening",micBlocked:"Microphone access is blocked. Allow it in your browser settings to dictate.",noSpeech:"We didn't catch that. Tap the mic and try again.",dictationUnavailable:"Voice typing isn't available right now."});function ne(e,t){return e.replace(/\{(\w+)\}/g,(e,r)=>{let n=t[r];return n===void 0?e:String(n)})}var ie="tel:+18884264435";var ae=/* @__PURE__ */Object.freeze({brightGreen:"#07C168",watchYellow:"#F2C763",red:"#C03410",amber:"#F2C763"});var le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function oe(e){if(e==null||e.length===0)return null;let t=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);return Number.isNaN(t)?null:t}function se(e){let t=new Date(e);return`${le[t.getUTCMonth()]??""} ${t.getUTCDate()}`}var de=/* @__PURE__ */Object.freeze({allClear:"All clear",monitor:"Monitor at home",seeVetNow:"See a vet now",privacy:"Confidential. {partner} can't see this chat.",privacyEmpty:"Everfur is a separate provider. Your chats are confidential, and {partner} can't see them.",educational:"Educational, not a diagnosis.",emergency:"Emergency? Call a vet.",panelOn:e=>`${e} blood panel`}),ue=/* @__PURE__ */Object.freeze({1:"Nothing here needs a vet right now.",2:"Watch for changes, and book a vet if it gets worse.",3:"Get help now at the nearest emergency vet."}),ce="Find an emergency vet";function pe(e){if(e.role!=="assistant")return null;let t=e.urgencyLevel,r=typeof e.urgencyReason=="string"&&e.urgencyReason.trim().length>0?e.urgencyReason.trim():null;return t==="emergency"?/* @__PURE__ */Object.freeze({step:3,tier:t,label:de.seeVetNow,reason:r,color:ae.red}):t==="home_care"||t==="schedule_soon"?/* @__PURE__ */Object.freeze({step:2,tier:t,label:de.monitor,reason:r,color:ae.watchYellow}):t==null&&e.urgencyProvided===true?/* @__PURE__ */Object.freeze({step:1,tier:"general",label:de.allClear,reason:r,color:ae.brightGreen}):null}var he=[{turn:-10,s:.55,l:.73},{turn:-100,s:.62,l:.64},{turn:91,s:1,l:.71},{turn:95,s:1,l:.95}];function fe(e){let t=S(e);if(t===null)return ge;let{h:r}=K(t.r,t.g,t.b);/* @__PURE__ */
|
|
3
|
+
return Object.freeze(he.map(({turn:e,s:t,l:n})=>{let{r:i,g:a,b:l}=Q({h:((r+e)%360+360)%360,s:t,l:n});return j(i,a,l)}))}var ge=/* @__PURE__ */Object.freeze([]);function be(e,t=false){return ne(t?de.privacyEmpty:de.privacy,{partner:e})}function me(e){let t=e.trim();return t.length===0||t==="Everfur"?null:t}var ye=`${de.educational} ${de.emergency}`;function ve(e){if(typeof e!="string")return null;let t=e.trim();return t.length===0?null:t}function we(e,t){let r=ve(e.source_doc_id),n=ve(e.title),i=ve(e.kind);if(r===null||n===null||i===null)return null;let a=ve(e.observed_on),l=oe(a),o=l===null?null:se(l),s=o===null?null:e.panel_kind==="blood_panel"?de.panelOn(o):o,d=ve(e.clinic_short_name)??ve(e.clinic_name),u=[s,d].filter(e=>e!==null).join(" · "),c=ve(e.entity_id);/* @__PURE__ */
|
|
4
|
+
return Object.freeze({key:`${r}-${c??"doc"}-${t}`,title:n,meta:u.length===0?null:u,kind:i,sourceDocId:r,entityId:c,encounterId:ve(e.encounter_id),observedOn:a})}function Ae(e){let t=e.recordCitations;return t===void 0||t.length===0?ke:/* @__PURE__ */Object.freeze(t.map(we).filter(e=>e!==null))}var ke=/* @__PURE__ */Object.freeze([]);function _e(petRef,e){let t={entry:"chat",petRef:petRef};return e?.returnTo!==void 0&&(t.returnTo=e.returnTo),e?.usState!==void 0&&(t.usState=e.usState),e?.prefer!==void 0&&(t.prefer=e.prefer),t}function Se(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function Ce(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function Te(e,...t){if(typeof e=="function")try{let r=e(...t);return Ce(r)&&Promise.resolve(r).then(void 0,Se),r}catch(e){Se(e);return}}var Re=class extends d{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(e,t){return Object.is(e.resetKey,t.key)?null:{failed:false,key:e.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:e}){return e()}function HostRender({render:e,fallback:r,resetKey:n}){return t(Re,{fallback:r,resetKey:n,children:t(RenderHost,{render:e})})}var ze=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],Oe=/* @__PURE__ */Object.freeze(ze.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(Oe.map(e=>e.wireCode));var Ee=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),Ie=/* @__PURE__ */Object.freeze(Oe.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Ee[e.wireCode]}))),je=new Map(Ie.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),xe=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(Ie.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...xe]){let t=je.get(e+r);if(t)return t}}var Fe=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(e){return Fe[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.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"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var De=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return De.has(e)}var Be=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||Be.has(e)}var Pe=500,He=8e3,Ne=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(Pe*2**r,He);return Math.floor(t()*n)}var Me="This feature isn't available on your account right now.",Ue="Something in that request was not right. Check the details and try again.",Le=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:Me,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:Ue,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:Me,runtimeDisposed:Ue,unknown:"Something went wrong. Please try again."}),We="This session has ended. Please sign in again.",Ve="linked_account_read_only";function qe(e,t,r){return e==="conflict"&&r===Ve?Me:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?We:userFacingError(e)}function userFacingError(e){return Le[e]}function Ge(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var Ke=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===Ve,i={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:qe(e,t?.wireCode,n?Ve:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&Ke.test(t.reasonCode)&&(i.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(i.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&Ge(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Ge(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
5
|
+
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
6
|
+
return Object.freeze({ok:false,error:e})}var Qe=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(e){/* @__PURE__ */
|
|
7
|
+
return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var Ye="x-everfur-anon-token",$e="anonTokenInvalid";async function Je(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function Ze(e,t){let r=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...r?{wireMessage:r}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[Ye]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...Xe(e.headers),...authHeaders(t)}}}function Xe(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===Ye||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await Je(t),n=await t.transport.request(withAuthHeaders(e,et(t,r)));if(n.ok||rt(n.error.raw)!==$e||t.anonIdentity===void 0||t.userRef!==null)return n;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===r?n:t.transport.request(withAuthHeaders(e,et(t,i)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(Ze(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(Ze(e,{wireCode:rt(n.error.raw),requestId:n.error.requestId}))}let a=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!a.ok&&a.error.httpStatus===401?(t.identity.reportRejected?.(),err(tt(a.error))):a}function et(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function tt(e){let t=e.raw,r=rt(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function rt(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}var nt=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;function it(e,t){let r=globalThis.URL;if(typeof r=="function"){let n;try{n=t===void 0?new r(e):new r(e,t)}catch{return null}try{if(n.protocol)return n}catch{}}return st(e,t)}var at=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,lt=/[\s\u0000-\u001f\u007f\\]/,ot={"http:":"80","https:":"443"};function st(e,t){let r=e.trim();if(t!==void 0&&!nt.test(r)){let e=st(t);if(e===null||!r.startsWith("/")||r.startsWith("//"))return null;r=e.origin+r}let n=lt.test(r)?null:at.exec(r);if(n===null)return null;let[,i="",a="",l="",o="",s="",d="",u="",c=""]=n,p=`${i.toLowerCase()}:`,h=Number(s);if(h>65535)return null;let f=s===""||String(h)===ot[p]?"":String(h),g=ot[p]!==void 0,b=o.toLowerCase()+(f&&`:${f}`),m=d||(g?"/":""),y=a||l?`${a}${l&&`:${l}`}@`:"";return{href:`${p}//${y}${b}${m}${u}${c}`,protocol:p,username:a,password:l,hostname:o.toLowerCase(),port:f,origin:g?`${p}//${b}`:"null",pathname:m,search:u==="?"?"":u,hash:c==="#"?"":c}}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:dt(e)})}function dt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var ut=3e4,ct=He*2,pt="idempotency-key",ht=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),ft=/* @__PURE__ */Object.freeze({onEvent(){}}),gt=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function bt(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??ft,r=e.timers??gt,n=e.rng??Math.random,i=e.sleep??((e,t)=>jt(e,r,t)),a=e.maxAttempts??Ne,l=e.unaryTimeoutMs??ut,o=e.newIdempotencyKey??yt(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??a),h=u?.idempotent??ht.has(d.method),f=u?.idempotencyKey===void 0?null:bt(u.idempotencyKey),g=h?f??o():null,b=mt(d,g),m=0;for(;;){let a=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:m,...g?{idempotencyKey:g}:{},...e});s(a({phase:"attempt"}));let o=Et(l,r),u=It(o.signal,d.signal),h;try{h=await authedSend({...b,signal:u.signal},e.auth)}catch(e){h=err(networkError(e))}finally{u.dispose(),o.cancel()}if(h.ok)return s(a({phase:"settled",ok:true,reason:"ok"})),h;let f=h.error,y=wt(f,m,{maxAttempts:p,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:f.code,reason:y.reason,...f.httpStatus!==void 0?{httpStatus:f.httpStatus}:{},...f.requestId!==void 0?{requestId:f.requestId}:{}};if(!y.retry)return s(a({phase:"settled",...v})),err(f);if(s(a({phase:"retry",...v,delayMs:y.delayMs})),await i(y.delayMs,d.signal),d.signal?.aborted===true)return s(a({phase:"settled",...v,reason:"aborted"})),err(f);m+=1}}async function u(t){return withAuthHeaders(t,await Ot(e.auth))}async function*c(t,r,n){s(
|
|
8
|
+
/* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:r.method,path:r.path,attempt:0}));try{yield*e.auth.transport.stream(r,n)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
9
|
+
return Object.freeze({send:d,authorize:u,stream:c})}function mt(e,t){let r={};for(let[t,n]of Object.entries(e.headers??{}))t.toLowerCase()!==pt&&(r[t]=n);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}function yt(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var vt=10;function wt(e,t,r){if(r.aborted)return{retry:false,reason:"aborted"};let n=At(e);if(n==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if((()=>{if(r.policy===void 0)return false;try{return!r.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let a=()=>{if(r.policy===void 0)return null;let t;try{t=r.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(vt,Math.floor(t)))},l=r.perCallMaxAttempts??a()??r.maxAttempts;if(t+1>=l)return{retry:false,reason:"attempts-exhausted"};let o=kt(e,r.now);return o!==null?o>ct?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:o}:{retry:true,reason:i,delayMs:backoffDelayMs(t,r.rng)}}function At(e){let t=e.code==="unknown"?fromWire(Rt(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function kt(e,t){let r=St(e.raw);if(r!==null){let e=r-t;return e>0?e:0}let n=_t(e.raw);return n===null?null:Math.round(n*1e3)}function _t(e){for(let t of Ct(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function St(e){for(let t of Ct(e)){let e=t.resets_at,r=Tt(e);if(r!==null)return r}return null}function Ct(e){if(!zt(e))return[];let t=[e];for(let r of["error","detail"]){let n=e[r];zt(n)&&t.push(n)}return t}function Tt(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 t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function Rt(e){for(let t of Ct(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function zt(e){return typeof e=="object"&&e!==null}async function Ot(e){if(e.mode==="anonymous"){let t=await Je(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function Et(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return{signal:r.signal,cancel:()=>t.clearTimeout(n)}}function It(e,t){let r=()=>{};if(!t)return{signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let i=()=>n.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function jt(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let i=t.setTimeout(()=>{r?.removeEventListener("abort",a),n()},e),a=()=>{t.clearTimeout(i),n()};r?.addEventListener("abort",a,{once:true})})}var xt=/* @__PURE__ */Object.freeze(["visit","join","summary","messages"]);function isVetVisitIntent(e){return typeof e=="string"&&xt.includes(e)}var Ft="/widget/v1/televet/handoffs",Dt="/widget/v1/televet/availability",Bt="/widget/v1/televet/chat-entry",Pt=/^[a-z0-9][a-z0-9_-]{0,39}$/,Ht=/^[A-Za-z0-9_-]{22}$/;var Nt=32,Mt=128,Ut=64;function vetVisitErrorReasonOf(e){let t=e.httpStatus;switch(e.code){case"sessionRequired":return"sessionRequired";case"authExpired":case"authRejected":return"authRejected";case"sdkUpdateRequired":return"sdkUpdateRequired";case"validationFailed":return"invalidRequest";case"rateLimited":case"quotaExceeded":return"rateLimited"}return t===void 0?e.code==="internalError"?"network":"unknown":t===429?"rateLimited":t===404?"unavailable":t===403?"accessDenied":t===401?"authRejected":t===400||t===422?"invalidRequest":t>=500?"serverError":"unknown"}function Lt(e){return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:e}))}function Wt(e){return err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}function Vt(petRef,e){let t={};petRef!==void 0&&(t.pet_ref=petRef);let r=e?.returnTo;if(r!=null){if(typeof r!="string"||!Pt.test(r))return{ok:false,message:"returnTo must be a registered return destination key"};t.return_to=r}let n=e?.entry;if(n!=null){if(n!=="chat"||petRef===void 0)return{ok:false,message:"entry 'chat' needs the pet the chat is about"};t.entry=n}let i=e?.visitRef,a=e?.intent,l=i!=null;if(l){let e=typeof i=="string"?i.trim():"";if(e.length<1||[...e].length>Ut)return{ok:false,message:`visitRef must be 1..${Ut} characters`};t.visit_ref=e}if(a!=null){if(!l)return{ok:false,message:"intent needs the visitRef it opens"};if(!isVetVisitIntent(a))return{ok:false,message:`intent must be one of ${xt.join(", ")}`};t.intent=a}return{ok:true,body:t}}function qt(e){if(typeof e!="object"||e===null)return null;let{visit_ref:t,intent:r}=e;return typeof t!="string"||t.length===0||!isVetVisitIntent(r)?null:/* @__PURE__ */Object.freeze({visitRef:t,intent:r})}function Gt(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry,n=e=>(Zt(r,"televet.visit.handoff_failed",{reason:vetVisitErrorReasonOf(e)}),err(e));return{async createHandoff(petRef,e){let i;if(petRef!=null){let e=typeof petRef=="string"?[...petRef].length:0;if(e<1||e>Mt)return n(makeEverfurError("validationFailed",{retryable:false,wireMessage:`pet_ref must be 1..${Mt} characters`}));i=petRef}let a=Vt(i,e);if(!a.ok){let e=Lt(a.message);return e.ok?e:n(e.error)}let l=a.body,o=await t.send("televet.visit.handoff",{method:"POST",path:Ft,body:l},{idempotent:false,maxAttempts:1});if(!o.ok)return n(o.error);let s=Kt(o.value),d=l.return_to!==void 0,u=d?o.value?.flow_id:void 0;if(d&&(typeof u!="string"||!Ht.test(u))){let e=Wt("the handoff response carried no usable return flow id");return e.ok?e:n(e.error)}let c=l.visit_ref!==void 0,p=c?qt(o.value?.visit):null;if(c&&p===null){let e=Wt("the handoff response did not confirm the visit it opens");return e.ok?e:n(e.error)}let h=s===null?null:/* @__PURE__ */Object.freeze({...s,...d?{flowId:u}:{},...p!==null?{visit:p}:{}});return h===null?n(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the handoff response carried no usable visit url"})):(Zt(r,"televet.visit.handoff_created",{pet_scoped:l.pet_ref!==void 0}),ok(h))},async checkAvailability(e){if(typeof e!="string"||e.length>Nt)return Lt(`state must be at most ${Nt} characters`);let r=await t.send("televet.visit.availability",{method:"POST",path:Dt,body:{state:e}},{idempotent:false,maxAttempts:1});if(!r.ok)return err(r.error);let n=r.value?.available;return typeof n!="boolean"?Wt("the availability response carried no usable answer"):ok(/* @__PURE__ */Object.freeze({available:n}))},async chatEntryOpen(){try{let e=await t.send("televet.visit.chat_entry",{method:"GET",path:Bt},{maxAttempts:1});return e.ok&&e.value?.open===!0}catch{return false}}}}function Kt(e){if(typeof e!="object"||e===null)return null;let{url:t,expires_at:r}=e;return typeof t!="string"||typeof r!="string"||r.length===0||!Jt(t)?null:/* @__PURE__ */Object.freeze({url:t,expiresAt:r})}var Qt=/* @__PURE__ */new Set(["localhost","127.0.0.1","[::1]"]),Yt=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/,$t=/[\s\u0000-\u001f\u007f]/;function Jt(e){if($t.test(e))return false;let t=Yt.exec(e);if(t===null)return false;let r=(t[1]??"").toLowerCase(),n=t[2]??"";if(n.length===0||n.includes("@"))return false;let i=n.replace(/:\d+$/,"").toLowerCase(),a=r==="https",l=r==="http"&&Qt.has(i);if(!a&&!l)return false;let o=e.indexOf("#");if(o<0)return false;let s=e.slice(o);return s.startsWith("#h=")&&s.length>3}function Zt(e,t,r){if(e)try{e.track(t,r)}catch{}}var Xt=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),er=globalThis,tr=er[Xt]??(er[Xt]=createContext(null));tr.displayName??="EverfurContext";function rr(){let e=a(tr);if(e===null)throw new Qe("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}var nr=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(e){return nr[e]}function decideCapability(e,t,r){let n=requires(e),i=/* @__PURE__ */new Map;for(let e of t)i.set(e.resource,e);if(r?.isPending===true&&n.some(e=>!i.has(e)))return lr({name:e,enabled:false,isPending:true,limits:{}});let a=ir(n,i);return n.filter(e=>i.get(e)?.granted!==true).length===0?lr({name:e,enabled:true,isPending:false,limits:a}):lr({name:e,enabled:false,isPending:false,limits:a,disabled:ar(n,i)})}function ir(e,t){let r={};for(let n of e){let e=t.get(n)?.limits;if(e)for(let[t,n]of Object.entries(e)){let e=r[t];r[t]=e===void 0?n:Math.min(e,n)}}return r}function ar(e,t){for(let r of e){let e=t.get(r)?.disabled;if(e)/* @__PURE__ */
|
|
10
|
+
return Object.freeze({reason:e.reason,level:e.level,recoverable:e.recoverable})}/* @__PURE__ */
|
|
11
|
+
return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitlement",recoverable:false})}function lr(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:/* @__PURE__ */Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),/* @__PURE__ */Object.freeze(t)}function useCapability(e){let{runtime:t}=rr(),r=t.entitlements,i=s(r.subscribe,r.getSnapshot,r.getSnapshot);return n(()=>decideCapability(e,i.decisions,{isPending:i.isPending}),[e,i])}var or=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function sr(){let e=globalThis,t=e[or];if(t!==void 0)return t;let r={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return e[or]=r,r}function dr(e){let t=sr();t.snapshot=/* @__PURE__ */Object.freeze({...t.snapshot,...e});for(let e of[...t.listeners])try{e()}catch{}}function ur(e){let t=sr().presenter;if(t===null)return"absent";try{return t(e)===!1?"declined":"presented"}catch(e){return console.warn("[everfur] Your registerEverfurTelevetFlow presenter threw; the in-app visit opened instead.",e),"threw"}}function cr(){return sr().hosts.length>0}function pr(e){if(!cr())return false;let t=/* @__PURE__ */Object.freeze({...e});return dr({request:t,serial:sr().snapshot.serial+1}),true}var hr=false;function fr(e,t){return t!==void 0?(Te(t,e),"onStartInApp"):ur(e)==="presented"?"presenter":pr(e)?"experience":(hr||(hr=true,console.warn("[everfur] A vet visit had nowhere to open: mount <EverfurTelevetHost /> in your EverfurProvider, or pass prefer: 'redirect'.")),null)}var gr=/* @__PURE__ */Object.freeze({status:"idle",error:null,errorReason:null});function br(e,t,n){let{usState:a,chat:l,scope:o}=n,s=t&&(a!==null||l),d=`${a??""}|${l?"chat":""}`,[u,c]=r(null);if(i(()=>{if(!s)return;let t=true,r=e.current;return c(null),(async()=>{try{if(l&&!(r.chatEntryOpen&&await r.chatEntryOpen()))return!1;if(a===null)return!0;if(!r.checkAvailability)return!1;let e=await r.checkAvailability(a);return e.ok&&e.value.available}catch{return false}})().then(e=>{t&&c({key:d,open:e})}),()=>{t=false}},[s,d,a,l,o,e]),!s)return null;let p=u!==null&&u.key===d;return{open:p&&u.open,pending:!p}}var mr=/* @__PURE__ */Object.freeze({status:"opening",error:null,errorReason:null});function yr(e,t={}){let{runtime:i,userRef:userRef,scopeEpoch:a}=rr(),s=useCapability("televet"),d=s.enabled&&userRef!==null,u=t.usState??null,c=t.entry==="chat",p=t.petRef??null,h=t.prefer==="redirect",f=n(()=>{if(t.controller)return t.controller;let{services:e}=i.registry;return Gt({auth:e.authFor(userRef),telemetry:e.telemetry,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}})},[i,userRef,a,t.controller]),g=o(f);g.current=f;let b=n(()=>({runtime:i,userRef:userRef,scopeEpoch:a}),[i,userRef,a]),m=br(g,d,{usState:u,chat:c,scope:b}),y=d&&(m===null||m.open)&&(!c||p!==null),v=t.returnTo??null,[w,A]=r(gr),k=o(null),_=o({runtime:i,userRef:userRef,scopeEpoch:a});_.current={runtime:i,userRef:userRef,scopeEpoch:a};let S=o(f);S.current=f;let C=o(y);C.current=y;let T=l((petRef,t)=>{if(k.current)return k.current;let r=(e,t)=>(A({status:e==="cancelled"?"idle":"error",error:t,errorReason:e==="cancelled"?null:e}),/* @__PURE__ */Object.freeze({opened:false,reason:e,error:t}));if(!C.current)return Promise.resolve(r("unavailable",null));let n=e.prepare();if(!n.ok)return Promise.resolve(r(n.reason,null));let i=_.current,a=S.current;A(mr);let l=(async()=>{let l,o={...v!==null?{returnTo:v}:{},...c?{entry:"chat"}:{},...t!==null?{visitRef:t.visitRef}:{},...t!==null&&t.intent!==null&&t.intent!==void 0?{intent:t.intent}:{}},s=Object.keys(o).length===0?void 0:o,d=petRef===void 0?p:petRef;try{l=await(s===void 0?a.createHandoff(d):a.createHandoff(d,s))}catch{return e.abandon(n.value),r("unknown",null)}let u=_.current;if(u.runtime!==i.runtime||u.userRef!==i.userRef||u.scopeEpoch!==i.scopeEpoch)return e.abandon(n.value),r("cancelled",null);if(!l.ok)return e.abandon(n.value),r(vetVisitErrorReasonOf(l.error),l.error);let h=await e.finish(n.value,l.value);return h!==null?r(h,null):(A(gr),/* @__PURE__ */Object.freeze(l.value.flowId===void 0?{opened:true}:{opened:true,flowId:l.value.flowId}))})().finally(()=>{k.current===l&&(k.current=null)});return k.current=l,l},[e,p,v,c]),R=l((petRef,e)=>{if(!C.current)return A({status:"error",error:null,errorReason:"unavailable"}),Promise.resolve(/* @__PURE__ */Object.freeze({opened:false,reason:"unavailable",error:null}));let t=petRef===void 0?p:petRef,r={...t!==null?{petRef:t}:{},...u!==null?{usState:u}:{},...e!==null&&"consultId"in e?{consultId:e.consultId}:{},...e!==null&&"visitRef"in e?{visitRef:e.visitRef,intent:e.intent}:{}};return fr(r)===null?(A({status:"error",error:null,errorReason:"unavailable"}),Promise.resolve(/* @__PURE__ */Object.freeze({opened:false,reason:"unavailable",error:null}))):(A(gr),Promise.resolve(/* @__PURE__ */Object.freeze({opened:true})))},[p,u]),z=l(petRef=>h?T(petRef,null):R(petRef,null),[h,T,R]),O=l((e,t)=>h?T(void 0,{visitRef:e,intent:t??null}):R(void 0,{visitRef:e,intent:t??null}),[h,T,R]),E=l(e=>h?T(void 0,null):R(void 0,{consultId:e.trim()}),[h,T,R]);return{available:y,isPending:s.isPending||(m?.pending??false),status:w.status,error:w.error,errorReason:w.errorReason,open:z,openVisit:O,joinVisit:E}}var vr=e=>m.openURL(e);function useVetVisit(e={}){let{openUrl:t,...r}=e,i=n(()=>{let e=t??vr;return{prepare:()=>({ok:true,value:null}),async finish(t,r){try{return await e(r.url),null}catch{return"openFailed"}},abandon:()=>{}}},[t]);return yr(i,r)}var wr=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var Ar=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Ar(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var kr=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var _r={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Sr={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Cr={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Tr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Rr={regular:"400",medium:"500",bold:"700"},zr={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},Or=0,Er="System",Ir="monospace",jr=["content","heading","control","compact","badge"];function xr(e){let t={};for(let r of jr)t[r]=e;return t}var Fr=[];function Dr(){return{family:Er,mono:Ir,fontUrl:null,families:{regular:Er,medium:Er,bold:Er,mono:Ir,monoMedium:Ir,monoBold:Ir},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Cr,tierSizes:xr(Cr),lineHeight:Tr,weight:Rr,letterSpacing:zr,scale:1,maxScale:Or,scaleCaps:kr,headingFamily:null,headingWeight:null,fontSources:Fr,roles:wr,typeScale:1}}var Br={},Pr=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(e){return`cubic-bezier(${e.join(", ")})`}var Hr={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(Pr.standard),emphasized:cssCubicBezier(Pr.emphasized),exit:cssCubicBezier(Pr.exit)},reducedMotion:false},Nr={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",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},Mr=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:Nr,space:_r,radius:Sr,type:Dr(),motion:Hr,slots:Br}),Ur={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#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",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"},Lr=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:Ur,space:_r,radius:Sr,type:Dr(),motion:Hr,slots:Br});var Wr=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Vr=globalThis,qr=Vr[Wr]??(Vr[Wr]=createContext(Mr));qr.displayName??="EverfurThemeContext";function useEverfurTheme(){return a(qr)}function Gr(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}function Text({tier:e,variant:r,...n}){let i=useEverfurTheme(),a=r===void 0?void 0:i.type.roles[r],l=Gr(i.type,e??a?.tier??"content"),o=r===void 0?n:{...n,style:[{...textRole(i,r),color:i.color.text.primary,flexShrink:1},n.style]};return t(b,l===void 0?o:{maxFontSizeMultiplier:l,...o})}e(function(e,r){return t(u,{...e,...r===null?{}:{ref:r}})});var Kr=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),Qr=/* @__PURE__ */new WeakMap;function Yr(e){let t=Qr.get(e);if(t!==void 0)return t;let r=e.color,n=e.brightness==="dark",i=n?{dark:n,ink:r.text.primary,ink2:r.text.secondary,ink3:r.text.muted,paper:r.background,card:r.surface,line:r.borderRingCream,tile:r.surfaceSubtle,shadow:r.shadow,riskBg:r.badgeBgCritical,riskInk:r.danger,riskDot:r.danger,clearBg:r.badgeBgPositive,clearInk:r.success,clearDot:r.success,watchDot:r.warningStrong}:{dark:n,...Kr},a=(e,t)=>G(e,t,H(t),$r),l=(e,t)=>contrastRatio(e,t)>=$r?e:P(t,$r),o=[i.card,i.paper].map(e=>W(r.brandSoft,e)??e),s={primary:r.primary,onPrimary:l(r.onPrimary,r.primary),accent:r.accent,onAccent:l(r.onAccent,r.accent),link:a(r.linkInk,[i.card,i.paper,i.tile]),badge:r.brandSoft,onBadge:a(r.brandInk,o)},d=/* @__PURE__ */Object.freeze({...i,...s});return Qr.set(e,d),d}var $r=4.5;function Jr(e,t){for(let r of t)if(contrastRatio(r,e)>=$r)return r;return P(e,$r)}var Zr={chat:{width:22,height:22,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAQAAABJXchjAAAB/ElEQVR4Ae3BPWicZQAA4CfvvUMxNSqp/dHJUeogiSUpWRQKDi6djFKV/k1OHdqhTipSih1LQzYR2rg5iZNQDiFYijlCK4KLUDi4SgsNDRVqEyV8HHfvXQ+a9vvgBb/nUavVarXaNo15nFedMe1NO5VnXct1F3QMGTPsIxe9qBr3nPC9AQ2Djrhsh6rsMO8PNyWC1D4LqrZot0SUOmlC1+/+Up7dXleYcNx5faLUrK5pK8o15VeFgxJBakbhmhVlW3FNYVYiSL2k0FGFjsKkRJCBIANBBoIMBBkIMhBkIMhAkIEgA0EGggwEGQgyEGQgyECQgSADQQaCDAQZCDIQpNYU9qjCXoU1iSC1qjBrv7K9YUahJRGlVr2tcNM3bmn7UduwA94VbcdrPtHVkohSC04aVzhmy0O73NfvBVe85+k9cEmiIXVX22H9Gn5zQ8+sq97yLI76WSIa9K1/LHpezyt6zjrnWaz51JIB0bAlTWdMmTKu38uWHPK01rVc97XbhkSP03bKjF8Uxmx5x3f26HrotItKEj2Jhi+cFXTdclhLaaJRNnTt0zSn5wcfu6dE0SgNXaf0PPKZC0oWbUfb+5aVLhpl06CffOiOCkSjBP02fe4r/6pENMqGntvmNVUmGuVPDzxnS9MHOirUMMrfls2Z9KWj1tVqtf+v/wAyK17WT9+2hwAAAABJRU5ErkJggg=="},heartcheck:{width:22,height:22,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAQAAABJXchjAAAEgklEQVR4Ae3Bf4yWdQEA8M/zPgzFzsmlOSkk2QAHaHMRdCIXevxydWCTGZIzmYySQJcJS3MTl1lsxvqDwpuyGs2kLIhByLU7qqkUFgWtA71onHbUnQFGlngRd+duz757ee953vfe91b/vZ+PqqqqqqqqqmGKlOd6k4w1zlg9jnldh90GG6XBeFcZ70KdOh33qpeVITK0Ot9UZ7CTvm2jUxLvc5+VLjXYfvc6YAiR0iZbb5HiNlkr8oSVittprT8pIVLKNK1GK+2gyHVK+4c5DioqVtx0e11iKGNcYSijLNWsWxGRYj6qVY28Zs971VHdxvuQmy2T9l17tOkwxkRXazRf3r80OCBTpJgjJgu2e8whhabZbpy8Drc6pNCHPWqhoM21MsWyfd5dgofdq9tgXb5vocskDrvBMYN12arPTRKX6/Y7GWJZauxwkcR9Nsh2xnPmGoPfavCmbC94ywKJGZqclRLLstSnJdosU9wZz+j0lLV6FLffUpcZ8B5H/FFKTpZ6wTqlva3JLkNZJ6iXISdLvcRZO/wv/FivxCwZctLea5LEK/pU6iarXKpQr3aJqS6WkpNWL2hTqa/7uW856gMKtQnqpeSk9QhGqcw6DxpQ6xGFRgrOSclJ6xBMUInVHhWMVGii4JiUnLRj+iUmKt89Ngp6rVdogqBDSk7aOX+VGGWM8txpk6DPEu3Od6ULJF7TKyUnS4dggUJ32uE2g91mi0jwOdsUWiA4JkNOllbBauf7jO+5xXO+5HyNtooEa2w22P2CVhlysjytT2Ka6YIRHpNYb43gY7aJBettMFidKRJ9npIhJ0uXPYJV8voFT1hjQJ09RgqaPCRtpWCnUzLEsv3bUolrbHfCgD6nfVIwX48ee9UInrVc2hSb5CS+6M8yxLId9VkXG5Bzvc36DTjkQrMEc92hRvBTt+szWOxn3i/RbaVMsWz93rJQYoy37ZPYq8ZMwUjBrzQ6K+1BdwhWOyRTrJjfW+BKidl+6E2JFjVmKvQHc5yRNsGPxBIv+IIiYsW9ZIURBsRm2CxocYF6eUfc6J/SInuMk3jHPKcVESvulH4NEmPVahbsVWOmRKfZ/i7Lk24RPOx5RcVK+bVbXS5R55wXBS0iN+Koef4iyzprBAfdrV9RsVL6/MYKkUSD1x0S/NJOP/BVf5PlHt8Q9JrvDSXESuvyhkbBIoe9Iuj2mh5ZFtsiEizXoqTYUA74rzkSkU85qF1pi/xEJHjAk4YQG9qLatUJljjhgOJWeEYkeNzjhhQrR7OrXCcR+YSLtMoS2eBrIkGTB5QhVp5dJrlWcIOpdupVaKQd7pK31XJliZWn3zZX+Ihgqtm2+4+8Wi3myGtytzLFyrfbO+aKJD7odi87LjHTL0wR9Puyh5QtVol9jlhkhMRoy/R7Sc5XfMclgrOWeFoFIpWaZZfR8vaLTZd3WqN9KhKp3GTNxsnWaZ52FYpV7qQtrjFJ2m7zHVex2HD0eNZJH1dolfv1GIbI8E21zdUS7RY7bJhiw3fCZrVmYKPFulRVVVX937wLjmYiRAD5+2oAAAAASUVORK5CYII="},file:{width:22,height:22,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAQAAABJXchjAAACN0lEQVR4Ae3BP4scZRwA4Of9Zc5NQkStch6IcqARK4tTsXJFDuQsFOFABW0sYqmfQRDyAcTGIoiS8rTYJIho0MIPEPwTo6ggnN0hmHDN7lgsw2bvMu/MnBsZYZ/H0tJSnyXN3rFhTdLGr875UUdJk+88posbtnytk2Py3va6bu7yqm/8roOQt6G74y4b6iDknXYUJ1z0rNYKeWHqL/fK+8GjZk645HlXtBLulIHLhloJeaW2xqZuqgxc8pwWQl7SVpj6zcvGpo4b2dQoLN6ObWNTAyObGoRFSaYSdmwbm1oxsikr3Bk7to1NrRjZlBHySm1NTJ00NDS05wOVFZ/bUquwaA/6yu18bM2+2wr/lfs8rEZYlO81GagRFuW8G/KSGoVFGTnlaQMHveKsBoW8pItvHfaUSlIj9EDogdADoQdCDxTySoedcb96u6651USlVKPQzUlXrcv7yRmdhLxk3pZ1TR7xoplQSWqEbibaSDoJeaV5F+1q8odPzUxUSjUK3exb84Z19a77xK2SSlKjkJcc9pEukkahB0IPhB4o5JUO+tALVtX702feMlNqFPKSeU9406qcVWc9biZpFPJK8za08aSZUqOQl8z7QhtfmkkaFfJK8657zUtOq7drx89mJiqlGoW85KALLugiVJIaoQdCD4QeCD0QeiD0QOiBQl5p6h5XHM0DKhM1Cnl7Ks/4t/bUCHnXLM4vaoS89920GO+qdUze33Y85JS7Hd2+q95zztLS0v/TP569YMkUqobUAAAAAElFTkSuQmCC"},back:{width:22,height:22,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAQAAABJXchjAAACGklEQVR4Ae3Bra4eRQAA0LPf9AXYKwbRkPIASzAoSLoXBGRUDaS8HcFNr6rBIO6aipqKu7ICjeimwQwO0hCyg5v9wX3nuLq6urpqFJztme/87r0NOmfqvfSVD35wp1lwnt69L/zjez97r9HFWW5MPrN6qtnFOW7cG9TeanZxht69Qe1XrzS7OK43GdRmz23QOao3GdRmo8UGnWN6k0FtNlps0jmiNxnUZqPFRp39epNBbTZabNbZqzcZ1GajxQ6dfXqTQW02WuzS2aM3GdRmo8VOne16k0FtNlrs1tmqNxnUZqPFAZ1tepNBbTZaHNLZojcZ1GajxUGddr3JoDYbLQ7rtOpNBrXZaHGCR9p8ZDKoPbi1OMVFmzuD2oNbi5NctHjsG7XZrcVpLloU//XOqYIWxac+t3oiyYqTBG0mSbSKvnWnOEXQ5k8vJNHqY0lWnCBoVWRJtIqSrDgsaFdkSbSKkqw4KNiiyJJoFSVZcUiwTZEl0SpKsuKAYKsiS6JVlGTFbsF2RZZEqyjJip2CPYosiVZRkhW7BPsUWRKtoiQrdgj2KrIkWkVJVmwW7FdkSbSKkqzYKDiiyJJoFSVZsUlwTJEl0SpKsmKD4KgiS6JVlGRFs+C4IkuiVfTUT/7SKDhDkSXR6rHX3mp0cY7FrQe1G80uzvLO1x786w+/aBacp3jhS5/44EdvNOuc7ZknXvrN1dXV1dX/4G9ZtJHJgYcMcQAAAABJRU5ErkJggg=="},x:{width:22,height:22,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAQAAABJXchjAAACb0lEQVR4Ae3BPaokVRgA0DP3y3SMBM3E2FQ0MprEBdzb/QpEcAmCoShmJmLoGgpeoQgDGohoJJi/TxNxViDjAmoQKYp+81dd1ZlS59jtdrvdbvdfFs75yDc+kB7Y7p77PvXILxaFZR/60l2veF9K2zTfetVd7/rLrxYUyz4xCb1mi6YXJp9ZVKwVes1aTS+sFJb94WhWHN1I5x1cK07e87sFYdlvblTFrEppWdMrZqMrX1sUzkmpKiZFldLzNb0wG3UGZ4TzUqqKSVGl9GxNL8xGncFZYY2UqmJSVCk9remF2agzWCGsk1JVTIoqpcc1vTAbdQarhLVSqopJUaV00vTCbNQZrBTWS6kqJkWV0qTphdmoM1gtbJFSVUyKKiWaXpiNOoMNwjYpHc2Koxtv6IXZqDPY5I7tmmvPdzDYKGyXblTF00ZXBpuFS6RUFY8bdQYXCJdJqSpORp3BRYpL3fHQbQ9dLFym6b3othdUKV0gXKLphScVVUqbhe2aa8WzFEc30kZhq+babQfXqmJWpbRJ2KbpFbPRlUFKVTEpqpQ2CFs0vTAbdQb/SqkqJkWV0mphvaYXZqPOYJZSVUyKKqWVwlpNL8xGncFtKVXFpKhSWiWs0/TCbNQZPCmlqpgUVUorhDWaXpiNOoNnSakqJkWV0lnhvKYXZqPO4HlSqopJUaV0Rjin6YXZqDNYklJVTIoqpUVh2T33FSdXBuekdDQrjn72wIKw7HsvOzkYrJFuHJ285SsLimWvOTkYrDU4OHndorDsJe+YHAy2SDeOJl/40YKw7Ad/e9OfDr6zVfrJ2x752Od2u91ut9v9f/0DIGjD825hJnwAAAAASUVORK5CYII="},search:{width:20,height:20,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAQAAACQ9RH5AAADJklEQVR4Ae3BXWhVdQAA8N89By2n82PWFBfLQfQQ5MWupuWTRaXlQ1hBZvjWLMMK+0IShEgiI0gU+rBArKiQwNvUagoavWgGQiwqH0qFWRKOyu85W8ifg657ds49wl5iv59hw4YNu1IlRTWZqAk9jutxxUrqNc4C95tvtEtO2mGr7f5WWEk9rrHSE0ZJd9oGr+lRSEm+1V40SrZT1nhVAbFsDbZ6zAh5RrrTNJ/rU6eSLM2+NN3lDtjhiG6RKVrNN93lvnOvP9SlJMt+MyROWO8dRww01eOWaZTY71Z1KRncFg9KfGCZk9KN8a5FEh97RB1ig1niJYm1ntRrML0+02CO4GYHdckVS9fgCw2CDVbIs0uzmYLbveW8HLF0L7tbsNti/fJ95Q6tLmrUb7cckTQjPS0451EX1OOCh50VPCWWI5LmHqMEax1Vr25vCsa6S45ImoWCfusUsV5ioRyRWrEHBHsdV8RR3woWKskUqdWqUbBPUXsFE10nU6RWo8Svijok0ShTpNZYiV8UdUiiUaZIrbMS/YrqlTgvU6TWMYlmRU2W+F2mSK1jEs2Kmizo95tMkVq9fhLMVtRtgi79MkXSdAruM0ERE8wTdMoRSdMpGGG5IlaIBTvliKTZo0/wgmb1utbzgnP2yBFJc8r7gtE+EalH7FNXCd5zTo5IupVOCOZ6Qz3WmSv40yq5YunOOm2eYLYGu2R73TMSz/lGrthg9pnpRsEcN9ipV7oxNlkqcdhidYgNrmqBSYJplpvoZ38ZaKrVPlJxyXiTbZerJMsk28xwuQN2OKJbZIpW802XZqN2OUqyXW2zh9TnsOslNmqXKZatzxY/mmWcbIe1W6pNWVDRokOGWL4fvK3PLCOkO+0Vi3yPqjZlQUWLDoOK1aPP1zbo8o9WI11yUtUaS3XqE1S1KQsqWnQYRElRTSZqwnE9etQq2WSJxEbtUsWKOqNHt249zkhX1aYsqGjRIUVsKFS1KQsqWnSoERsaVW3KgooWHf4jNlSq2pQFFQd1GSA2dKpa3CIYb7MBYkNpmzZlF63SZYDY0NrqkJs860PDhg373/kXh1m18JaQSPQAAAAASUVORK5CYII="},bell:{width:20,height:20,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAQAAACQ9RH5AAACX0lEQVR4Ae3BX2hVdQAA4O/87n2oxCw3ckG6IB+kZUE9tL0YI0iSQYiROOwhgmjTAqF66o9URNRDFG3BeggiiShBgxp7irB/BGUEYlhCkVzTxpAgshKMw+GitrPfPT+7cHq436enp6enp6rMxVhrSL9+Z82bd8hRyTJpBtznbje70Nfe9YYTEmSqW+Yxj7hMud+94EV/qChT1QbvGBDXco9PVZKpZtKU833lB8ew2nVucb5Jr6kgU8UzHtd20sv2+Mk517rXw/q1Pe0pHWU6G7dH26Neddpil9jlOW3j3tZBQycj9mvIHTdqrzPKnPGJOXdZJjdmTktUQ1zTASvlThlxSMwx+2x3KZpGTTkrIojbZo3CnY7q5HtjCmuNiwridihM+UIVn5lRmBQVxAy4Ve60Z1W1219yw64WEcRsVXjfL6o67gO5zGYRQcyIwqwUswrDIoKY1QoHpTioMCgiiFmj0JKipTAoIoi5RuFXKVoKgyKCmgQ1CWoS1CSoSVCToCZBTYKaBDUJahLUJKhJsLRp/9W0JQVL2WlCYa9U+xUm7LCEhnIbvSWTO2LMn9J8aIs+uY0O+FGJTJnrfe5yhe+ckG6VdQq/GXbYIpky37hJ98zaZJGgzCrdNKpEUGZGN+1SIlNuwDrd8a0FXbDcg7b6t20esFySphR9PjaEFWacM2EaD7nNgsqCFFcZknvFjdrWe0nuBldK0JBi3v1WoOkOJy3os8nr+uV+9qQEmTRbvKfcZvskaEhz2BWGLfa8KUkaUs1p2uBCuz0hUeZirLTd7Ub87UsfedMpPf9f/wDy4XMuWu1V4gAAAABJRU5ErkJggg=="},check:{width:14,height:14,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAQAAABvygHQAAABdUlEQVR4Ae3BvWpTYQAA0NN8ubVUcNZFaJUOgpti8QcKesHSpa1Cqr6APoHPIYib7jZILelVIVtFXAQfQa2DD5EvKJePyk2atGk66JBzTExM/FdmLegTnMxtnzx1zo6K4CSWvHcGV7T88lfN+JZ8cEryW0XduO4oTEuavqqoG0+uZVrS9kiPKePIFTJJ24qOHlOOL1fIJG0rOvpMOa5cIZMU1nQcUNNvwYzhlr2TSbat6hgg6PXKS4998d0gd7XUJS33RAMFVYueY1bDZ9/0y+3IJIU10RA1VTXJjMJNvXKFTFJYFQ0VVP102SWlugc++mHfsh2ZZNu66BBBr7euuqiUadi1p5RrySSFddGhgl5dTTfMKWU27NqTK2SSwqroCEG/rk3XXFDKNJz2QiZ5477oSMFBUdN1c0rTbqlJtjREIwgGiZoWzatqaugaSTBY1LRo3r5ND3WNKBgm2rTkvNKWDV0jC4aLXjtrzjNPdE1MTPwjfwDF5lTRg1trxQAAAABJRU5ErkJggg=="},wordmark:{width:54,height:19,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKIAAAA5CAQAAAAfWjgQAAAIE0lEQVR4Ae3BC5hWZYEA4HeO89jITFeQBNFgKSREQiwYaoNAN0V5EAxyiREGTc0NL6UmmJuYEhQaFCQSXgbLFtYL5mVdtBDaEk1xXVwuQjgRTGPgKLcZ6Fm3y+l7Tuf/Z/75x5EZYabet8Dfgi8Ybwh+bbH5XtXCCrR3JZ5QKtN1ZmhRR2jvVvuYbMN9xFItKNK+fdMADfXXogq1Z8f7isQ+S1Q5V29UaFGF2rOrJJ402h5Md7Xp7tKiCrRffawTvOwkdVpNpP2aL/FZdVpRpL0aZJhgkTVaVaS9uklihlYWaZ/6OE1wl61aWaR9ukJiulYXaY+Oc6Fgtd9odZH26BKJ2d4GkfanyHmCzZZ5GxSqr4vBRuqhQKzOC+ap1pJ6GGy4Dwr+2/94yGvenCGGi+31gEq5naWbYI6W1smpejrS/1nnWVX+okCmo93gEg1VuE6V2FRnyOX/nSqYq7/69hsh+LArXKS+Hea5SeLLRsm2wFJ80iInSD2iXI33eEAkUy9dBC/YLdN898l0qz6yzfAE7nGsbJNV4mrXK5aaZZo/K5QabZFOcil3lnFWobeh8utvqPpqBRe7TS6d3eh8Z3tRrJehsj2CUX4s20irDPGaKmVy6y/bg7INMEi228UG6SlbMRabKNtU/ZxFocQV5gheM929XkFPk3zR+3C0lU7zUwdjgS8IXjLXA3agh0ku9T70sMonbJDbYD9GjWttwkfNFjvRnUabqUzrm2ciqk23CZcZI3amC9xRIBjvR4LNRtgi9V5LfFqsTn+bMcCPnCB42UA1GurlJbG9Jrtf7GtuECx3hky9PeW9Ylv0t09QrMJYwRwTdPaSESpR4gmlEu+3Q6qDWsG9PivW21L9BF8yV0ODVeglOM8PJXq7V1/BlW7BKqPsQanVEuv0jcS6WCTYZrAtMr1utG1iHSwWe94IewW/VyOXTQ6IjXe/2Ag3CNY4R7aNRgt6ukmi1mUSl+jsdaepFPucUqkBMpVLzBJsNFV+q90ol41ulZiB9c60R+wGqRMVRWLfUiyYokZ9+31FMNgEsUpLBB9WKpcyRdjgUUGFxBh16vuZWwWX6yrxukQRvmq7YIBMnWWaKFjpeYlqTdkht50SRShXJ+gnUxShjzJBtYfkssRuwQWCuyUmyOVyse8JJuks+Hfb5LJQ4mK57LRAYptM26VOMEgwX3NEmvaAZyW2S9WqizBB4t805knBMMHPbRBMVKy+431U7B7BuRL3ym2tHYJ/kkuF1J1SlVZInSuocr+WNkdqrtRCIpwhsUZjnpP4lGCe4F3K1HeJ2J12CYZI/JfGrBUMlssyqWqnqBR71HCZLhXM1tJe8XOpe1yoBlWmuZJC9JHYpjGvSnQX3O3rOoldbKFsnxe7TXCKYonfacxvJT5ks2x1Vsv0vH/Q0DidxGp8X0t7Srbb3e6vCnVVJDHPLrkdK9FRUKvCVWInK/W01DidsNazgp5Sq/xRbr0l3q2+F70ZUwQ/tF/z/FFT1sujUInURzStQGKRqwSf87TURWLflThSaoimlahvm6b1N0QwR3OVaMrL8ij0B6lVmrZBYpPlThebbJpawQlOw05L5fKYDvJ7w071VWlaueBBWzVXB02pkUehGqlrPKM5ljhdrMRYiwWTxRbbJ1Endaa34g1N6aBMcLPmO1ZTdssj8rrdEt01T4VqwSSJiWILpTZIddU6husotswvNF8/Tfm9PCI8KzFQPjOttFI/me4SDDNAbIwueNSvpDbYJTFIPg9b6XFvxYWCad6KUgclwt0S4+VTZqihsi2QuEJskliFbMskxmtcNyMNdbLmO94osZ96SfP11cNBifCwA4IuyjRmmG7Yaa1M2z0o+Aw+5Gy86j7ZbpMY53iNmST2guabIpghv0guUx2kCLt8Q2K2TnKbL1ahvtmCDv7Zv4h9V32/9JjELLl1dZ3Y7ZpvvNhaT8pll8QADZ1sgoMUid3ofwXHWKJIQxX6oNbN6ntKpWCK88SWaOhSuwTjzdJQRw8pwjpLJd4hcZR8RugmNl1uv1YrOMcxshWpwB6JSKYjJUrkEQnOUSU41SrdZRroZyaJXWyHhm4VfEJHLLNZQ1ucaY/gGsu9X6ZhnnOKWLnUaInROmrc5WIvW6YxqwRHuUOxVHc/0Q9XS4yWaazEFHkUSBznPgMlVnheLd7pHw0UXGaeXEpUK5E43eNyO8lDugsOeMx6b+AYY3UU2+1cy/Flo/AOpVI7rRfc4QcyHWu72GQVGjPI0xJbXW+r2BDTFGGm76uU2KRa0FFfqUq/EVxkkyyFEtsMMsVsRWLDDZfpt86zQm773Kdc8CuPa8yLTvYdE8WKjDFGpo0+Y71YL0PVd7Shgp/IdqHYHks17hnX+KbgAypkmula3aV66SWXHnoIOqinUKb5/sO1Sp0o0zrL3Gy3xn1PuWChfHaZZK6vGqyrTMvd5kFvzefFZtovn2/ZZ4b3yHbAdW5x0Ark0t8xPuYIPGeDLZr2SUeIrbHXm/FxXfXFG56x1SaZPqibxm2xTep0/4n9unlNU44yxlinehe2esoKj3hF8Clv3hp7ZSnQtj1sJL7tSodQpC072kixmx1SkbbsfLH5qh1SkbbsfBwwyyEWabsG6oWZqhxikbbrcuyxwCEXaauKnY2v2emQi7RVZym20XccBiJt1QX4osNCpG06zqfdYYXDQqRtKvOqf3WYiLRN5a5W7TARaYvOsE+Fw0akLbreVIeRSNtzkp2e8HcHZZwPOKz8CdAtAnYO9l4QAAAAAElFTkSuQmCC"}};function ShellIcon({name:e,style:t}){let r=Zr[e];/* @__PURE__ */
|
|
12
|
+
return y(c,{source:{uri:r.uri,width:r.width*3,height:r.height*3},style:[{width:r.width,height:r.height},t],resizeMode:"contain",accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"})}var Xr={back:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAApklEQVR42u3X2wnAIAwFUEfrCI7gSB0to7hBCoWi4KslyaVIyP89UDVJAwfbCg44sBsQmZj4sAIS57vIBnjijYASnznqA3V80j9kQfwbQBS/BoTxK0AcPwcU4meASvwYUIofAWrxfUAxvgecVfzXoraNtEAWFf0AMP9E5ocMuKaAhwZoFYBmB2jXgIEDGJmAoQ9YWwCLF2B1BCy/hYh2gP9CObAncAGPRPsoFGy6mAAAAABJRU5ErkJggg==",x:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAuElEQVR42u2W0Q2AIAxEO5ojdIQbmREcwQ3QGGIwfnjFXDSx4be8JxYOrJp2WApSkIK3BFMt23Aa43v9xAvmuuwDFB6tusQFjAJHbUDgx6Q7BbpKjzQZlIKosgeTqY9gl4/BNZrVMQXYLvF7pAfReOYkX2EBPBcVZ2AIz2ZRDw3h+bDDGD6SphjBf0gg/kXiJou3qfigiaNCHHbiuBZfOOIrU37py58t8oeXxwKtKfxPr+sUpOBfghWoSQRXFeZ6ggAAAABJRU5ErkJggg==",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAuUlEQVR42u3WwQnAIAxAUUdzBEfIyI7QEbpBCoVSazWJiUILwbPvH9RgwLB2BQ94wAN/CyTMmDGuCgDu58prAhe/KHDzO6b5gZKH+YdM8DMCJG8PMLw1wPK2gIC3BES8PiDk60A8Z0max9eBTbRpgO8FqI1DfB1I7OZB/n3INDDMt25RH1Hw7WvahlR87x28MSXff2hPUM1TL7lE1Tw9KsDOc7MIrDw/7MDGS6YpWHj/m3rAAx74RuAAA4CwKDobqwgAAAAASUVORK5CYII=",clock:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAB60lEQVR42s2YW5XDIBCGkRAJIwEJSEACEpAQCUiohEhAAhIioQ6mu92G+2USsuf08NYCXzLzzy0M2f8u9h0AjhoNbujwiU90uKFBjfwOgMbtfWlrbaiuA+TniUfLoTwPALSky49lEc4AVPGMKwoEXN7/Lj94gWvxfpIK0Mkx87m2/p4m2aspgDVxIQx1AokM1hEgNo4iq123DZXr/di2V1X+q6u6ZgTu/ixvAcBv2humOQKtbqrq6XiLrT9DtI7/W/EefFcBiL7cCIDYg7wEuJJ+GsC8omwOkP4wTAEgt0NONl05jgEMH6kl8qN8GsDTXamD90FAUQDMy1UEwEoyEBVg4rSRekDdAlCxF1KJilsAIpZqajW4BQC+ingA7SCLUqHu7Fri+84B4hrWgxQARzQRj5JyG1IxkSWF2VFccghvhJotZSrJFWxPEHlZ+vv9UQbaeqIpDBDXqOo6AHhjKw2iGqmC15IdTLe71WQXkqyZBjxiDwSAuOkdIE/8ZbHbpgA2v6VmO3n5+m7RZ1ELyCfdu9X7omXYePWtH04vV1tHWpbiveZXXmp+FbX5nW/fNWUAUdkAAuQBRFJHqDzvU0aohtfaZc+cGgKbgxbdur1ZGa4P4oC6My071CMZUIOo9imBFIxf8jFkYr0AYMAg9i3sbUkAAAAASUVORK5CYII=",pen:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABc0lEQVR42u2YXXHDMAyAAyEQAqEQAkEQDCEQAmEQDMEQAsEQDCEMtKVtWlv+k+zsobudXtqc7/sSVbHkDjj8bgyfJFjR4I4WNc7XCwAd7l5oHNMCQE2W0rAIEV4l1ulYMN4fsR62gLfeZ6CCjYWnAh+v7rd5SkwoUGw8FPBHzM/vLhSYV+4m9k+bwh/PkBScC3vxR7kmU3Qu7cW/r689gjp+f7wJbQIOHuh7wBckMHmtXCDCywVCvFQgxssEDXiJgIOHUsMpCxrxXEEznifI5Xgp5Z4vmIV3Dz8burel1wVWmBwbNqWa4Fbdc2hyCKcmWMIWzsi9ULBFaahVjkgwRlfrlSMSKK/5TbgEc0euMEUC/ZokLJktsnUvE+RmPFXYErsFzh9tewUrQX9V4A1l+hjHNlzwxpw3hAJ5/AvaBU48/KZi8ifr/vE9xmt/sg4FwDyA8GJOnTLNZXiTPsaOFynMeYRtO8aWwqGmTeij/kr4o4Jvg7C7lkr1CiIAAAAASUVORK5CYII=",flask:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA80lEQVR42u2Y0RGDIBBEKcHSKMESrgRLoQRLsARLoAQ6IB/GjEnkuL3DiZNh9kvGubeLHgouu2vlfg3wec2J0Zq9DcCX3xD3Blw+RZv2cqXrDuiADuiAPwAMRcDQBkDPcstrZHmOUBtA/Cq3I2MLAJ3OeJJm0PiHMuj8Axl0/oEMWv/iDLIGIxYftQCqdqwgg96/MEO5fKj+0x0VcEACBQIIBhAGSLAiAiBkxeczOH0Lyd4lu/+KIbv/SoYW/llTLfyzGT5vHOUfw8LCPvKAoPJ/zBB4wKxosXfNPMCbAb72kG0ZgqQPJsH2+3zPPN3wMMSsB4KFCBZh7xAAAAAAAElFTkSuQmCC",upload:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA70lEQVR42u3Y2w2DMAxA0YzACBmlI2QERmKEjJBRMgIjsIH7UGhCMK0dO+pHI/8god4DqHJRDZi+YwagCyywwQZLL2B+5Z8z9wBynkW05RlEa55MtOeJhCRPIjj5GTn6SnDy5n1s6AQnXwJk4jrvkEAJHAnHB1bk+o5AScR2oLz9GshEbH1Ex6d7BnbC6WxTDFBd1wMYwACEgIP4GCcGqk4+ET8vLTJQdUQfplyE6Pb1gYYvwgD+CtjfIqwob1NlPQMhnfICwoJPlYDtok1xbtg2DWr5gK/rSYkIMF3/HjjwxVspd1bw9aYafyX8HrgDBMqfZ6rS37gAAAAASUVORK5CYII=",send:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABUUlEQVR42tWYXZXDIBCFIwEJSEACEiIBCZGABCREQiREAhKQEAfT08223Z4dwvz1oee+zzfhAnPJBNNnNX0jwMECFSr4TwAirHD8qtoCPGRoz+LGgBm2t9KnsgUgQEFKn1J6cFp5dLVrdtFfK3tKMsC97zYsfpfgHOBW4io8gIdC7PuhQAck2FmlnydgDAgEKy8N7gNGW5BoMA6IDCtxrT3A/9tEpogBnLpvxOAXwJt0fmrBAMWs/AEOA1Sz8is+Mu0AEQcsRuVbf+jb7KF8lSoszoAfxZYAi+JbNnouipAFxs/c4OUgwUpeuCZPdoF0t2ZddEwSgzkANyi/68Nvpc4wKaBQZ5gUMFNCiu59QAgpOsBOm2FyQOYazAUErsH88EuaYRrAxjOYD0g8g/kAPwop+ndyuw4pekCmnmD5S7/S11/6CEw/PwryeHm+9mfIm27kASLl57KzfwAAAABJRU5ErkJggg==",plane:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAB5klEQVR42tWYe5HDIBDGIwEJSEBCJCABCUhAAhIiAQmREAlIqIO9a3tHeXzbQh4zd8MfnYaZ/W32Yx9kounaNf1HgKCFbnQjcwVg/jH+XKcCJDmKmfFTAZpCZfq+whkARR6Yfi55DCDI0sYav9F65BSVUuJl9gHufkfgbQvckQdIykiOJJnmuR8DSPLA70D6sWtAgFQ/wNAK/RZpP0c+f7e+UqGglIHmAp/LGkuBeQA+ghvZ5DcyP9cCY8AMs3Ip/Ebmp/S+CwdA1QT5jc2L9G9GAAH99q/T8MH8RLYV+AWQjedrLlSH+SlpZhHAd/rNm1fpiUCALfmtO/KiNc8I3ALuEXTgvHwyP2GBXwAL0smCQHHmTcpwtukHWHIjLaRhUSiPwG8E3LupAuVAHjjPmldlD3s3tqjvwITeVpKWz3tw31w0k2PbYZsfvzt6dPASZGipAudY4eP+yU5lbdI2uysv8EjLNEyc5TuBRwAC1fpM4PX48LvBXOWlHwZ4EGvNvNcugAb1PtRDyrH7QV2QRTukHAOsVUI53MP2A1xV8+MngUcBqsjZDoHHh988qQLXw44AQioYXQKPA0zW7zoEHgfIrAVxxe/gPbnueuJsgMPXjDNv+vmIc9GnBEPbYwwQVwH+1teWL776IYZCDSScAAAAAElFTkSuQmCC",thermo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABEUlEQVR42u2Y0RGDIAyGHcERGMERGIERHIERHMERMgIjOAIjMEI3SKsVhFbaVGLPBy5PJHd8kBjkp8HmXGuuBFAI6NAhoOIHtGjwFpnBlhcwJdM/EYyA/m362Xo+gE8PoHgY/LIHGsCvWSwjsY4cPyA3roAKqIAKqIAKqIB/AEwWYDgAEKbbbhEu+MZSgIouWjJ4ZeRVZYBtrV3i70LElQD6lytXbIK2B1r+4UCUBLBv2Y/NV8IeB/gktBnNQKgCrcRiNyrKAZYEmI4DfA8Pu9GB0s/Uz1RmS/xF6dAbTSd+Hfy2rJPjQ2FCvUgonUhCWXrYjbsCkO2w+4wYuX44p8vYuWs1wtoXFgF7bqV/3deWO9DRY6fHWdUWAAAAAElFTkSuQmCC",heart:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABnklEQVR42u1YUbGEMAxEAhIqAQlIiIRKQAISTgISkFAJlYAEHOxjuKMNHC1NC/N+bvLHbbNtutl0rkL1bFQ/gjwChQ4jLGbMsDDoUX9havQwDjOig0ojUAt4PokRrcO0QYy6IuhPF25hoKBgopg+TFBfLE0NwwvKCXh6ix60AhsQhtNEw/KLWjdGC9ruKE4IeJLu5GZMeJef6HbkBwJie1cByb0c5oWQ+vw52j2B/0FFVK1XhI4g1LFM789NpDjS8IVqPEH/fTkFYbhg35+2tqFbCMi1nSOw/FDF0Ti5OIKtavcYXP3JNnmC6WkC80iJjCcYbhMp1+TgCTQ/VHFsBde8k+fbhEp7yRx9xhYT2L1fHW+e+WBW+ElXH+1a3+BHfh7q+MDRhTZnQiNzKqDwFZhCI5O7uVRPmq1UsVdFm0XB07dX7yIO1uL0OuVlp0WnuNjQ9SIqSR9+/KZRJJQzbW+Umz7+fI9TJIoh/QIpT2sSjVCOlGUqJ3mnSBuJpI0otwJhn+e4jchv8/xSYOd5liyYFjlDRTSMfn8l/D/BH1NivdcXKo3hAAAAAElFTkSuQmCC",wind:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABKUlEQVR42u2XURWEIBBFiUAEIhiBCEYwghGMQAQiEMEIRDCCDWZ3UXB21QWB+ePM3x7kLu895gwMGG2xBmgAXwMYWGAFC0N9AAcDK6oFeF2A+tr+U6YuYD4B1nShUhZJt6UCgcQydU0WIIIf3geimPIg0u/vk5NyeadtyAfw4Mf3CXoX4aNsODHzC+yFkf8K/8vuckWHAU+3N5EYb6fIBuhTBDbRencBh7Cufy7RAmr77ITAkk376omq2UksJAWgwy5QACbKE3AYg2Oy5B7Ey5bcg5S8CUpAhVZxX3NJs2tjCx0gx+S7xncJyM+QpgZE54sa90DSmHzMSJoqRccIw+sCBCXAj5FYormmRI8H4acAlRfTnOwkPkZyTO5B78+pMf7Wae26AcrrBTxT9TetOhN4AAAAAElFTkSuQmCC",shield:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABp0lEQVR42u1YXdXDIAythEpAAhKQgAQkIAEJk1AJlYCESkDCHOT7uo2ewpI0tOVtJ68ll/xwk9sBhr7WekCB6gegIcETnpBA9wDwL+fZ/L0AI8yF+9Xm+wDcJzW1JbDXAQzEwqXeKvG2COYcgPovZIClSsqIJmyBAJrqLv7GdFk98dVXRLV7/NiM3E8hhX+boQEiUsgH0/UaHkgDRBogbW4jTOCFD0qDhwni7jQJkO9wlnmQ8z+AHwBjFhZYqnd7I4DbeKgLgNsRXQcAt6MFex3AvHJtUffujiKnwhnn/iLA6pB3fxLAopzv7nwHTuheAJDTMbIQjlxuDudBHvKaaU3HDJ7DiTah3b2HcIL3MdEA6Cdim7EY8SC/qyBZL/NZxe1FuQqhGSCg7DTQO/TYqBuIJqB7OTYBRIooOR3gT2gHL1l+I0HG9GxjoubzKYlivwYr6fpukKX9WPmYFn1gigXYCZSPaVU4pZJZqnrYQpwwurNF+q2r/KqT65V9vqLRLCEAxUKwhQS+TUAoUiILVSQJgoxMWujAfObFdCRdr/wM6f63pdn+ALhR+qd3tqBGAAAAAElFTkSuQmCC",folder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA0UlEQVR42u3XYQ2DMBQE4EpAQiVMAhIqoRKQgIRKqAQkTAISKqEObmkWtm5spdfCv5f7S94HlIR7CuraKAEYwMAjIH5lhcPYDwxYdqPzzL1AeXyK6wHs4fgU2w5s9++hd5dorC9CtwKhOEBnB35rA7YB/y6re4XPBHgYFlBwBJGyYOAAhZkmSCCdxYQ7QVgWqIuGz5/hfOD91YWrgI95AggggAACCCAAAYT27ln30y+V31NqiyFbW11GbgGJPdXxeIWKfeW3tASy+VnfZREXoCcPD/L3p4ydi6oAAAAASUVORK5CYII=",video:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA/UlEQVR42u2WbQ2EMAyGJ2ESJgEJJ2ESkDAJJwEJlTAJSEACEs5BL5fdvhghg2tJLmn6g7BkffL2Y61CxWtKAAIQwL0Ai4ArvjptRUDbD9Dou12X5lH3AeZL7gOidaszNnzGy+4/NlbOzTcWUAJieABNd/oMQqNB41SAIQNias2pCjEp3eHfNWWQAPHobBHmexaXneCRAeZN2skB2RZ81P5oAa4JHSEAipYjB4TAKD7AwbkAYg4ML6AsUcXXB3PSwdjJjhsQdJADht23lLhMn0cAmoGz1bHSj8xaRzEy7U9Dv37ooo6pXls86doybNeWGxYv9tVR1ncBCOCfAW+vMPhHdvkQLwAAAABJRU5ErkJggg==",calendar:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAw0lEQVR42u2Y4Q2EIAyFGcERGOVGYARHYwRGcARGYAQ2eGruNAZ7GApoTJr3yxTfFyhKi4LqK/UswMAvMuz4JcAjIsKz45eA+BM3/gTAwCLsL5YqwKYZOT4McGzroxwGGjA1sf8iCMDYzH7VeAZsy2Oh2UnWsOkczoN11S7Se7r/Amo/tMQnD+D8KooAHAmgHtBKAuADZJsKQAACEIAA3g0IRPFbrkzxS5Xv5faZ8t00PfI/VAvl+rZQNzSB3dvYd962zFzZpFaPSZ6KAAAAAElFTkSuQmCC",alert:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABZElEQVR42u2YURHDIAxAKwEJlTAJk4CESaiESqiESqgEJCABCXWQbXeFdiWEZGTbzy5fS+/yOPLISjvoPhvdH6AJGMDBCgEWGPQBBjysh/BgdAGv5Z/hNAFjVv4ZgxagTyVnMNA/ehB/Gx3AvJULKRO2zKQBuKT13lLulnKXdoBDm+q5ra6VL631mvK2DRBSe89PlqwzbwBGwpeepyt9emOJEX0+cXSV6WnBP8JKdJXp6bc5JNBVpmcsJ9BVpmcOqOoq0zMHVHWV6YkBKrrK9MQAFV15etIAUldKT8sGELpypycNIHQVrAU5aAxd+dMTGxUMXfnTk//PPZQAtelZC1RXnp7cQHTl6ckNRBGenpwmF3SVvYiUNS3qytOTD8h0Pa+f1rO+RUdd7Q6Ym/QsDftpB7x/vKhxH74IiFu0KCD21/vDFln0gtEa9qipVy/vXs+BUUa4uNn5NbU1Ttfc/6eE3wPuQ37zZ7PSYt0AAAAASUVORK5CYII=",lock:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABB0lEQVR42u2YYRGEIBCFiUAEIhDBCEYgghGMQgQiGMEIRLDBO+9m5BARBOHmbo7Zn6vvY2F9y0hA6gb5HoCAwowFC2YoiJIAivEl7Ma4ZgoAOq/4Ft1dwBCUf4a4A+gtoWk9BQ4KCg6Bycr0uQBmiQzB2lgeQBoB7s1zk5c5ABpY/bEKmg4QZu9DVc6xoz5/dbrUJdsyVDogvP/uOeh8QOwrjzx3F0AaoAHI0T8ldNSiz0JDut6672mVLW2Hsp3JZw4lEB6AKCa/c7A3QBlvZ9mXFGZmiDoCLkynSwjH/NLbMrFtG6ABGqAB/gyga9t19YHTFx2ZnW/oq7pD/wPXluoXr9/82/IAyuAw5vnBvsIAAAAASUVORK5CYII=",info:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAByklEQVR42s2YbbWEIBCGjWAEIhCBCEYgAhGIQAQjGMEIRDDCNnjv3T2rDh/CqHjOnvm3izz4zjAfduiete43ABIGDhM8XnjBY4KDgWwBMJg+mx7ZBH0dMHxPXDOP4TxAYGZtvtoMcQagkzNaKAj0n3/7f7yCTd5v4AJM8Jj7bpt/TxesNRyADVwoqnEigjCwNQAVR7Oj3RwLFcf7umzhRflmCsv2rDwCiG3RwpAmlSr7NF0y58/ANkl8lwGocrixTKdH3P/0KT17t4v3douoOQYMG7uk/prsSp6IdIjJrihBHdBhDJVYf+a5ty4RdTUBqC3AWhSZNVzVDrAsgbjmaNoIPaCbADT1QhiiqglA0VANVaslCI6T91D1OyDw+80wfRckst85wIV1oQ9EE0BGopmZRXkAmTp5YuZRHmDNa2N60WwTgKUtQPhSvglgoYLHj4rbgGyy25Osuw0YqQd2gGpecGRcMqcmJXOOd8lp91DR70gL+Ejb8k5SrRqvvn3rKDmtY9i+nKlvmtv83m/fDWcA0dEAItgDyMAdoaii3BHqwGvHZc+dGgIPBy2+uqVZWVwfxAVMYVr2MLUw4F6i3KcE1mX8kY8hN+wPRgP8lxBvX3sAAAAASUVORK5CYII=",file:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAA2ElEQVR42u3YwQ3DIAwFUEbICIySERghI3UERmCEjsAIjJAN3EuqlMjFdgyiqqx/4oCfEkDCOHBj42YAASIU2BnJEKTAAolV+swmA57C8iRRD7cb5QmiHr5/TwTf/HABgU/0xNKdZUkCn+iYgKMJLUASeoAgegBNQgfgeYwGdj2QRwOBINQAd/ENMOAfgECe2fpmIQYy8/Lyu8DwX2Tb1M6BnQPbpjOAwmxA8PhjdtG3UHj5eMxO34Fwswmss7ba2KQun3o34tfyS8+nhM8UiNjDwpTHkK55Ad1ZtxaRaIyXAAAAAElFTkSuQmCC"};function TabsIcon({name:e,size:t,color:r}){/* @__PURE__ */
|
|
13
|
+
return y(c,{source:{uri:Xr[e],width:48,height:48},style:{width:t,height:t,tintColor:r},resizeMode:"contain",accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"})}var en={pointerEvents:"none",accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};function tn(e){return{width:e,height:e,alignItems:"center",justifyContent:"center"}}function rn(e,t){return t??Math.max(1.5,Math.round(e/11*10)/10)}var nn={down:{rotate:"45deg",marginTop:-.4,marginLeft:0},up:{rotate:"225deg",marginTop:.4,marginLeft:0},right:{rotate:"-45deg",marginTop:0,marginLeft:-.4}};function ChevronGlyph({size:e,color:t,strokeWidth:r,direction:n}){let i=rn(e,r),a=e*.46,l=nn[n];/* @__PURE__ */
|
|
14
|
+
return y(p,{style:tn(e),...en,children:/* @__PURE__ */y(p,{style:{width:a,height:a,borderRightWidth:i,borderBottomWidth:i,borderColor:t,marginTop:a*l.marginTop,marginLeft:a*l.marginLeft,transform:[{rotate:l.rotate}]}})})}function SearchGlyph({size:e,color:t,strokeWidth:r}){let n=rn(e,r),i=e/24,a=16*i+n,l=11*i-a/2,o=11+8/Math.SQRT2,s=(21-o)*Math.SQRT2*i,d=(o+21)/2*i;/* @__PURE__ */
|
|
15
|
+
return v(p,{style:tn(e),...en,children:[
|
|
16
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:l,left:l,width:a,height:a,borderRadius:a,borderWidth:n,borderColor:t}}),
|
|
17
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:d-n/2,left:d-(s+n)/2,width:s+n,height:n,borderRadius:n,backgroundColor:t,transform:[{rotate:"45deg"}]}})]})}function Ring({size:e,strokeWidth:t,color:r,children:n}){/* @__PURE__ */
|
|
18
|
+
return y(p,{style:[tn(e),{borderRadius:e/2,borderWidth:t??f.hairlineWidth,borderColor:r}],children:n})}var an=/* @__PURE__ */Symbol.for("everfur.sdk.rn.chatTabsAsk.v1");function ln(){let e=globalThis;return e[an]??=createContext(null)}var on=ln();function sn(){return a(on)}var dn=4.5,un=.05,cn=.2,pn=.3;function hn(e){let t={alignItems:"center",justifyContent:"center"},r=e.color,n=contrastRatio(r.primary,r.surface)>=dn?r.primary:r.brandInk,i=r.text.primary;/* @__PURE__ */
|
|
19
|
+
return Object.freeze({accent:n,ink:r.text.primary,muted:r.text.muted,line:r.surfaceSubtle,mist:V(n,un)??r.surfaceSubtle,soft:V(n,cn)??r.brandBorder,track:V(r.text.muted,pn)??r.surfaceSubtle,pastels:e.brightness==="light"?fe(r.primary):/* @__PURE__ */Object.freeze([]),partner:me(e.meta.displayName),composer:{bar:{marginHorizontal:16,marginTop:10,marginBottom:6,minHeight:52,borderRadius:26,borderWidth:1.5,borderColor:n,backgroundColor:r.surface},input:{...face(e,"regular"),fontSize:16,lineHeight:22,color:i},send:{width:40,height:40,...t},stopDisc:{backgroundColor:n}},placeholder:(e,t)=>t?fn:e.replace(/\u2026$/,""),history:{bar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",paddingHorizontal:16,paddingTop:4,paddingBottom:0,gap:8},control:{flexDirection:"row",alignItems:"center",gap:8,minHeight:36},label:{...face(e,"bold"),fontSize:15,lineHeight:20,color:n}},userBubble:{backgroundColor:i},userText:{...face(e,"medium"),color:r.surface,fontSize:16,lineHeight:22},Byline:()=>/* @__PURE__ */y(ShellIcon,{name:"wordmark",style:{width:43,height:15,tintColor:i}}),Icon:TabsIcon})}var fn="Ask a follow-up",gn=16,bn=6,mn=[1,2,3];function SeverityCard({message:e,spaced:t=false}){let r=sn(),i=n(()=>pe(e),[e]),a=yn();if(r===null||i===null)return null;let l=i.step===3,o=i.tier==="emergency"&&r.onFindVet===void 0,s=i.reason??(o?null:ue[i.step]),d=l||i.tier==="schedule_soon";/* @__PURE__ */
|
|
20
|
+
return v(p,{style:[a.severity,{backgroundColor:r.paint.mist},l?a.severityRed:null,t?a.severitySpaced:null],...l?{accessibilityRole:"alert"}:{accessibilityLiveRegion:"polite"},testID:`everfur-severity-${i.step}`,children:[
|
|
21
|
+
/* @__PURE__ */v(p,{style:a.level,children:[
|
|
22
|
+
/* @__PURE__ */y(p,{style:a.meter,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:mn.map(e=>/* @__PURE__ */y(p,{style:[a.step,{backgroundColor:e<=i.step?i.color:r.paint.track}]},e))}),
|
|
23
|
+
/* @__PURE__ */y(Text,{tier:"control",style:[a.levelLabel,{color:l?i.color:r.paint.ink}],children:i.label})]}),s!==null?/* @__PURE__ */y(Text,{style:[a.levelLine,{color:r.paint.ink}],children:s}):null,o?/* @__PURE__ */y(Text,{style:[a.levelLine,a.bold,{color:r.paint.ink}],children:re.goToNearestEmergencyVet}):null,d?/* @__PURE__ */y(SeverityVetAction,{severity:i,ask:r,styles:a}):null,i.tier==="emergency"?/* @__PURE__ */y(PoisonControl,{ink:r.paint.accent,styles:a}):null]})}function SeverityVetAction({severity:e,ask:t,styles:r}){let n=useVetVisit(_e(t.petRef,t.vet)),i=useEverfurTheme(),a=e.tier,l=t.onFindVet,o=e.tier==="emergency"&&l!==void 0?{label:ce,a11y:ce,press:()=>{Te(l,a)}}:n.available?{label:re.findVet,a11y:re.findVetA11y,press:()=>{n.open()}}:l!==void 0?{label:re.findVet,a11y:re.findVetA11y,press:()=>{Te(l,a)}}:null,s=o===null?null:/* @__PURE__ */y(h,{onPress:o.press,accessibilityRole:"button",accessibilityLabel:o.a11y,accessibilityState:{busy:n.status==="opening"},style:[r.vetButton,{backgroundColor:i.color.primary}],testID:"everfur-severity-vet",children:/* @__PURE__ */y(Text,{tier:"control",style:[r.vetButtonLabel,{color:i.color.onPrimary}],children:o.label})}),d=t.renderVetAction;return d!==void 0?/* @__PURE__ */y(HostRender,{render:()=>d(a),fallback:s,resetKey:a}):s}function PoisonControl({ink:e,styles:t}){/* @__PURE__ */
|
|
24
|
+
return y(h,{onPress:()=>{try{m.openURL(ie).catch(()=>{})}catch{}},accessibilityRole:"button",accessibilityLabel:re.poisonControlNative,style:t.poison,children:/* @__PURE__ */y(Text,{tier:"compact",style:[t.poisonLabel,{color:e}],children:re.poisonControlNative})})}function AnswerRecordCards({message:e,spaced:t=false}){let r=sn(),i=n(()=>Ae(e),[e]),a=yn();return r===null||i.length===0?null:/* @__PURE__ */y(p,{style:[a.records,t?a.recordsSpaced:null],testID:"everfur-answer-records",children:i.map(e=>/* @__PURE__ */y(RecordCard,{card:e,ask:r,styles:a},e.key))})}function RecordCard({card:e,ask:t,styles:r}){let n=t.onOpenRecord,i=/* @__PURE__ */v(w,{children:[
|
|
25
|
+
/* @__PURE__ */y(TabsIcon,{name:"flask",size:20,color:t.paint.accent}),
|
|
26
|
+
/* @__PURE__ */v(p,{style:r.recordWords,children:[
|
|
27
|
+
/* @__PURE__ */y(Text,{tier:"control",style:[r.recordTitle,{color:t.paint.ink}],children:e.title}),e.meta!==null?/* @__PURE__ */y(Text,{tier:"compact",style:[r.recordMeta,{color:t.paint.muted}],children:e.meta}):null]}),n!==void 0?/* @__PURE__ */y(ChevronGlyph,{size:18,color:t.paint.muted,strokeWidth:2,direction:"right"}):null]}),a=[r.record,{borderColor:t.paint.soft}];if(n===void 0)/* @__PURE__ */return y(p,{style:a,children:i});let l=/* @__PURE__ */Object.freeze({kind:e.kind,sourceDocId:e.sourceDocId,entityId:e.entityId,encounterId:e.encounterId,observedOn:e.observedOn,title:e.title});/* @__PURE__ */
|
|
28
|
+
return y(h,{onPress:()=>{Te(n,l)},accessibilityRole:"button",accessibilityLabel:e.meta===null?e.title:`${e.title}, ${e.meta}`,style:a,children:i})}function PrivacyLine({empty:e=false}){let t=sn(),r=yn();return t===null||t.paint.partner===null?null:/* @__PURE__ */v(p,{style:[r.privacy,e?null:{marginTop:-7}],testID:"everfur-ask-privacy",children:[
|
|
29
|
+
/* @__PURE__ */y(TabsIcon,{name:"lock",size:14,color:t.paint.muted}),
|
|
30
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:[r.privacyText,{color:t.paint.muted}],children:be(t.paint.partner,e)})]})}function AskBarDisclaimer(){let e=sn(),t=yn();return e===null?null:/* @__PURE__ */y(Text,{tier:"compact",style:[t.disclaimer,{color:e.paint.muted}],testID:"everfur-ask-disclaimer",children:ye})}function yn(){let e=useEverfurTheme();return n(()=>vn(e),[e])}function vn(e){return f.create({severity:{alignSelf:"stretch",borderRadius:14,paddingHorizontal:14,paddingVertical:12,gap:6},severityRed:{gap:8},severitySpaced:{marginBottom:8},level:{flexDirection:"row",alignItems:"center",gap:10},meter:{flexDirection:"row",gap:3},step:{width:gn,height:bn,borderRadius:bn/2},levelLabel:{...face(e,"bold"),fontSize:15,flexShrink:1},levelLine:{...face(e,"regular"),fontSize:14,lineHeight:20},bold:face(e,"bold"),vetButton:{alignSelf:"stretch",minHeight:44,paddingVertical:11,paddingHorizontal:16,borderRadius:e.radius.pill,alignItems:"center",justifyContent:"center"},vetButtonLabel:{...face(e,"bold"),fontSize:15,textAlign:"center"},poison:{alignSelf:"center",minHeight:32,justifyContent:"center",paddingHorizontal:8},poisonLabel:{...face(e,"bold"),fontSize:13,textAlign:"center"},records:{gap:8,alignSelf:"stretch"},recordsSpaced:{marginTop:8},record:{flexDirection:"row",alignItems:"center",gap:12,paddingLeft:14,paddingRight:12,paddingVertical:11,minHeight:44,borderRadius:14,borderWidth:1,backgroundColor:e.color.surface},recordWords:{flex:1,minWidth:0,gap:2},recordTitle:{...face(e,"bold"),fontSize:15,lineHeight:20},recordMeta:{...face(e,"regular"),fontSize:13,lineHeight:18},privacy:{flexDirection:"row",alignItems:"flex-start",gap:6,alignSelf:"stretch",paddingHorizontal:16,paddingVertical:6},privacyText:{...face(e,"regular"),fontSize:12,lineHeight:16,flex:1,marginTop:-1},disclaimer:{...face(e,"regular"),fontSize:12,lineHeight:16,textAlign:"center",paddingHorizontal:16,paddingBottom:6}})}function wn(e){return f.create({followUps:{gap:0,marginTop:0,paddingTop:6},label:{fontSize:13,lineHeight:18,color:e.muted,marginTop:0,marginBottom:4},row:{minHeight:44,paddingTop:9,paddingBottom:9,paddingLeft:0,paddingRight:0,borderRadius:0,borderWidth:0,borderTopWidth:f.hairlineWidth,borderTopColor:e.line,backgroundColor:"transparent"},rowText:{fontSize:15,lineHeight:20,color:e.accent}})}var An="your pet";function kn(e){let t=e?.trim()??"";return t.length>0?t:An}var _n=/* @__PURE__ */Object.freeze({title:"Health records",titleWeb:e=>{let t=e?.trim()??"";return t.length>0?`${t}’s Records`:"Health records"},titleNative:e=>{let t=e?.trim()??"";return t.length>0?t:"Health records"},openTimeline:"Open timeline",loading:"Loading health records",lead:e=>`${kn(e)}’s lab trends`,retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:e=>`Important: ${e}`}),Sn=/* @__PURE__ */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’s biomarkers",ask:"Ask about these markers",a11y:(e,t,r,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${t} in range, ${r} out of range${n>0?`, ${n} without a range`:""}.`});var Cn=/* @__PURE__ */Object.freeze({vitalsFrom:(e,t,r)=>`Vitals from ${e.poss} ${t}, ${r}`,vitalsSource:e=>`Where ${e.name}'s vitals come from`,temperature:"Temperature",heartRate:"Heart rate",breathing:"Breathing",upcomingCare:"Upcoming care",overdueBy:e=>`Overdue · due by ${e}`,dueSoon:"Due soon",later:"Later",noDate:"No date",dueIn:(e,t)=>`Due ${e} · in ${t} ${t===1?"day":"days"}`,dueToday:e=>`Due ${e} · today`,overdueByDays:(e,t)=>`Overdue by ${t} ${t===1?"day":"days"} · due ${e}`,recordsHistory:"Records & history",labs:"Labs & bloodwork",results:"results",screenings:"Screenings",screeningsClear:"All clear",screeningsToReview:e=>`${e} to review`,noScreenings:"No screenings yet",visits:"Visits & records",timeline:"Timeline",events:e=>`${e} ${e===1?"event":"events"}`,weight:"Weight",vetVisits:e=>`${e} vet ${e===1?"visit":"visits"}`,history:"History",theirClinic:e=>`${e.Poss} clinic`,bloodPanel:"Blood panel",aboveRange:"above range",belowRange:"below range",othersInRange:"Other values in range.",addRecords:e=>`Add ${e.name}'s records`,moreThanOneClinic:"Records can come from more than one clinic over a lifetime.",visitsCount:e=>`${e} ${e===1?"visit":"visits"}`,panelsCount:e=>`${e} blood ${e===1?"panel":"panels"}`,requestFromClinic:"Request from a clinic",uploadDocument:"Upload a document",onFileNow:"On file now",firstRecord:e=>`Add ${e.name}'s first record`,firstLead:e=>`Records can come from more than one clinic over a lifetime. Start with the one ${e.subj} sees most, and this page fills in from there.`,requestFromTheirClinic:e=>`Request from ${e.poss} clinic`,requestDetail:"We send a secure request and read every page they send back.",uploadDetail:"A PDF, or a photo of a paper record.",findClinic:e=>`Find ${e.name}'s clinic`,chooseFile:"Choose a file",sayBeats:/* @__PURE__ */Object.freeze(["Hmmm","I wonder","what I may be","hiding"]),sayStill:"I wonder what I may be hiding",sample:"Sample",peekLead:e=>`A sneak peek at how ${e.name}'s records will read. Every number links back to the page it came from.`,sampleNote:e=>`Sample data until ${e.poss} records arrive.`,onTheWay:e=>`${e.Name}'s records are on the way`,clinicsTake:"Clinics usually take 2 to 5 days.",anotherClinic:"Another clinic",anotherClinicDetail:"Seen more than one vet? We ask each one.",noDueDate:"No due date on file",noLabs:e=>`No lab results on file for ${e.name} yet. They show up here when a record includes a blood or urine panel.`,noVisits:e=>`No visits in ${e.name}'s records yet. They show up here when a record includes one.`,oneReading:"One reading so far: we'll plot a trend as more come in.",takingNow:"Taking now",noCurrentMeds:"No current medications on file.",noVetTitle:e=>`When ${e.name} has a vet, start here.`,requestedFrom:e=>`Requested from ${e}. Clinics usually take 2 to 5 days.`,onTheWayFrom:(e,t)=>`${e.Name}'s records from ${t} are on the way.`,readingUpload:"We're reading the document you uploaded.",seeWhereItStands:"See where it stands",topRisk:e=>`${e.Poss} top risk`,seePlan:e=>`See ${e.poss} Health Plan`,panelOn:e=>`${e} blood panel`,latestReading:"Latest reading",rangeLine:(e,t,r)=>`range ${e} to ${t}${r?` ${r}`:""}`,noRange:"No range on the report",above:"Above",inRange:"In range",below:"Below",high:"High",belowRangePill:"Below range",changeUp:(e,t)=>`Up ${e}${t?` ${t}`:""}`,changeDown:(e,t)=>`Down ${e}${t?` ${t}`:""}`,changeSince:(e,t)=>` since ${e}, about ${t}%.`,whatIs:e=>`What ${e} is`,otherValues:e=>`Other ${e} values`,panelTitle:(e,t)=>`${e} · ${t}`,askAboutThis:"Ask about this"});function Tn(e){return`${se(e)}, ${new Date(e).getUTCFullYear()}`}var Rn=e=>new Date(e).toISOString().slice(0,10);function zn(e){return String(Math.round(e*100)/100)}({temp:Cn.temperature,heart:Cn.heartRate,breath:Cn.breathing});function On(e){return e==null?null:/above|high/i.test(e)?"above":/below|low/i.test(e)?"below":/in_range|normal|in range/i.test(e)?"in":null}function En(e){let t=e.points.filter(e=>e.value!==null);return t[t.length-1]??e.points[e.points.length-1]??null}function In(e){return e===null||e.refLow===null||e.refHigh===null||!Number.isFinite(e.refLow)||!Number.isFinite(e.refHigh)||e.refHigh<=e.refLow?null:{low:e.refLow,high:e.refHigh}}function jn(e,t=En(e)){let r=In(t),n=t?.unit??e.unit,i=t?.value??null;return{markerId:e.markerId,name:e.name,value:i===null?t?.qualitativeResult??"":zn(i),unit:n,range:r===null?null:`${zn(r.low)} to ${zn(r.high)}${n?` ${n}`:""}`,at:r===null||i===null?null:Math.round(Math.min(100,Math.max(0,20+60*(i-r.low)/(r.high-r.low)))),flag:On(t?.status??e.latest?.status??null)}}function xn(e){return e==="above"?Cn.high:e==="below"?Cn.belowRangePill:e==="in"?Cn.inRange:null}var Fn=e=>{let t=e.replace(/\s+panel$/i,"").trim()||e;return t.length>1&&t[1]===t[1]?.toUpperCase()?t:t.charAt(0).toLowerCase()+t.slice(1)};function Dn(e,t){let r=e.markers.find(e=>e.markerId===t);if(r===void 0)return null;let n=En(r),i=jn(r,n),a=oe(n?.at??r.latest?.at??null),l=In(n),o=[a===null?null:se(a),l===null?Cn.noRange:Cn.rangeLine(zn(l.low),zn(l.high),i.unit)].filter(e=>e!==null).join(" · "),s=r.points.flatMap(e=>{let t=oe(e.at);return e.value===null||t===null?[]:[{p:e,ms:t,v:e.value}]}),d=[];if(s.length>0){let e=s.map(e=>e.v),t=l?.low??Math.min(...e),r=l?.high??Math.max(...e);d=s.map((e,n)=>({x:s.length===1?50:Math.round((18+64*n/(s.length-1))*100)/100,y:r>t?Math.min(98,Math.max(2,Math.round((75-50*(e.v-t)/(r-t))*10)/10)):50,label:zn(e.v),out:On(e.p.status)==="above"||On(e.p.status)==="below",tick:se(e.ms)}))}let u=s[0],c=s[s.length-1],p=null;if(u!==void 0&&c!==void 0&&s.length>=2&&c.v!==u.v){let e=Math.abs(c.v-u.v),t=u.v!==0?Math.round(e/Math.abs(u.v)*100):null,r=c.v>u.v?Cn.changeUp(zn(e),i.unit):Cn.changeDown(zn(e),i.unit);p=t===null?null:{lead:r,rest:Cn.changeSince(se(u.ms),t)}}let h=[],f=a===null?null:Rn(a),g=e.markers.filter(e=>e.markerId!==r.markerId),b=g.filter(e=>e.panel!==null&&e.panel===r.panel);if(b.length>0&&r.panel!==null){let e=b.map(e=>jn(e));h.push({title:Cn.otherValues(Fn(r.panel)),allInRange:e.every(e=>e.flag==="in"),rows:e})}if(f!==null&&a!==null){let e=/* @__PURE__ */new Map;for(let t of g){if(t.panel===null||t.panel===r.panel)continue;let n=[...t.points].reverse().find(e=>{let t=oe(e.at);return t!==null&&Rn(t)===f});n!==void 0&&e.set(t.panel,[...e.get(t.panel)??[],jn(t,n)])}for(let[t,r]of e)h.push({title:Cn.panelTitle(t,se(a)),allInRange:r.every(e=>e.flag==="in"),rows:r})}return{markerId:r.markerId,name:r.name,meta:a===null?null:Cn.panelOn(Tn(a)),pill:xn(i.flag),flagged:i.flag==="above"||i.flag==="below",latest:`${i.value}${i.unit?` ${i.unit}`:""}`,latestSub:o,hasRange:l!==null,chart:d,change:p,meaning:(r.meaning??"").split(/\n\s*\n/).map(e=>e.trim()).filter(e=>e.length>0),groups:h}}var Bn=/* @__PURE__ */Object.freeze({vitalsFromLabel:e=>`Where ${e}’s vitals come from`,vitalsFrom:(e,t)=>`From ${e}’s exam, ${t}. `,examNotes:"Exam notes",onTheWayFrom:(e,t)=>`${e}’s records from ${t} are on the way.`,readingUpload:"We’re reading the document you uploaded.",uploadFormatHint:"Upload PDF records you already have, up to 25 MB each. You can pick several at once. We'll read them and add the results to your records.",uploadLimitHint:"PDFs up to 25 MB each. You can pick several at once.",results:e=>e===1?"result":"results",noScreenings:"No screenings yet",screeningsToReview:e=>`${e} to review`,screeningsClear:"All clear",noVisits:"No visits yet",oneReading:"One reading so far: we’ll plot a trend as more come in.",uploadedDocument:"Uploaded document"});var Pn=/* @__PURE__ */Object.freeze({recordsHistory:"Records & history",upcomingCare:"Upcoming care",viewAll:"View all",vitalsFrom:(e,t)=>`Vitals from ${e} ${t} visit`,labsTitle:"Labs & bloodwork",toWatch:e=>`${e} ${Bn.results(e)} to watch.`,aboveOn:(e,t)=>` ${e} was above range on ${t}.`,belowOn:(e,t)=>` ${e} was below range on ${t}.`,atAGlance:Sn.title,markers:"markers",inRange:e=>`${e} ${Sn.inRange}`,outOfRange:(e,t)=>`${e} ${Sn.outOfRange}${t.length>0?`: ${t.join(", ")}`:""}`,toWatchTag:e=>`${e} to watch`,panelMeta:(e,t)=>[e,`${t} ${t===1?"marker":"markers"}`].filter(e=>e!==null).join(" · "),high:Cn.high,below:Cn.belowRangePill,panels:"Marker groups",askAbout:(e,t)=>`Ask about ${e}’s ${t}`,labsWord:"labs",latestReading:Cn.latestReading,aboveRange:"Above range",inRangeWord:"In range",belowRange:"Below range",vetNoted:"What the vet noted",fromRecord:"From the record",wordForWord:"Word for word",viewSource:"View source"});function Hn(e){let t=e.points.map(e=>oe(e.at)).filter(e=>e!==null),r=oe(e.latest?.at??null);return r!==null&&t.push(r),t.length>0?Math.max(...t):null}function Nn(e){if(e===null||e.withheld||e.markers.length===0)return null;let t=e.markers.map(e=>{let t=jn(e);return{marker:e,row:{...t,flagged:t.flag==="above"||t.flag==="below"},ms:Hn(e)}}),r=t.filter(e=>e.row.flagged),n=e.summary?.totalMarkers??t.length,i=e.summary?.inRangeCount??t.filter(e=>e.row.flag==="in").length,a=e.summary?.outOfRangeCount??r.length,l=null;for(let t of e.markers)for(let e of t.points){let t=oe(e.at);t!==null&&(l===null||t>l.ms)&&(l={ms:t,clinic:e.sourceClinic?.trim()||null})}let o=[`${n} ${Bn.results(n)}`,l?.clinic??null,l===null?null:Tn(l.ms)].filter(e=>e!==null).join(" · "),s=r[0],d=s===void 0?null:{count:r.length,markerId:s.marker.markerId,name:s.marker.name,side:s.row.flag==="below"?"below":"above",date:s.ms===null?null:se(s.ms)},u=/* @__PURE__ */new Map;for(let e of t){let t=e.marker.panel?.trim()||Pn.labsTitle,r=u.get(t)??{title:t,rows:[],ms:null};r.rows.push(e.row),e.ms!==null&&(r.ms===null||e.ms>r.ms)&&(r.ms=e.ms),u.set(t,r)}let c=[...u.values()].map(e=>({key:e.title,title:e.title,meta:Pn.panelMeta(e.ms===null?null:se(e.ms),e.rows.length),toWatch:e.rows.filter(e=>e.flagged).length,rows:e.rows}));return{total:n,inRange:i,outOfRange:a,outNames:r.map(e=>e.marker.name),meta:o,watch:d,panels:c}}function Mn(e){return(e.panels.find(e=>e.toWatch>0)??e.panels[0])?.key??null}function Un(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}function Ln(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1}else if(r>=56320&&r<=57343)return true}return false}function Wn(e){return[...e].length}function Vn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var qn=64,Gn=512;function Kn(e){return e==="owner_reported"||e==="clinic_document"?e:null}var Qn=/* @__PURE__ */A.object({key:/* @__PURE__ */A.string(),category:/* @__PURE__ */A.string().optional(),label:/* @__PURE__ */A.string().optional(),value:/* @__PURE__ */A.string().nullish(),unit:/* @__PURE__ */A.string().nullish(),observed_at:/* @__PURE__ */A.string().nullish(),status:/* @__PURE__ */A.string().nullish(),origin:/* @__PURE__ */A.string().nullish(),canonical_key:/* @__PURE__ */A.string().nullish()});var Yn=/* @__PURE__ */A.object({doc_id:/* @__PURE__ */A.string(),title:/* @__PURE__ */A.string().nullish(),document_class:/* @__PURE__ */A.string().nullish(),page_count:/* @__PURE__ */A.number().nullish(),received_at:/* @__PURE__ */A.string().nullish()});function $n(e){/* @__PURE__ */
|
|
31
|
+
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:Kn(e.origin),canonicalKey:e.canonical_key??null})}function Jn(e){/* @__PURE__ */
|
|
32
|
+
return Object.freeze({docId:e.doc_id,title:e.title??null,documentClass:e.document_class??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}var Zn=/* @__PURE__ */A.string().nullish(),Xn=/* @__PURE__ */A.number().nullish(),ei=/* @__PURE__ */A.object({collected_at:Zn,at:Zn,value:Xn,unit:Zn,qualitative_result:Zn,ref_low:Xn,ref_high:Xn,status:Zn,source_clinic:Zn,source_doc_id:Zn,doc_id:Zn,reviewed:/* @__PURE__ */A.boolean().nullish()}),ti=/* @__PURE__ */A.object({collected_at:Zn,at:Zn,value:Xn,unit:Zn,qualitative_result:Zn,status:Zn}),ri=/* @__PURE__ */A.object({marker_id:/* @__PURE__ */A.string().min(1),canonical_name:Zn,name:Zn,loinc_code:Zn,canonical_unit:Zn,unit:Zn,panel_name:Zn,panel:Zn,meaning_text:Zn,meaning:Zn,latest:/* @__PURE__ */ti.nullish(),trajectory:Zn,points:/* @__PURE__ */A.array(ei).optional()}),ni=/* @__PURE__ */A.object({total_markers:/* @__PURE__ */A.number().int().nonnegative(),in_range_count:/* @__PURE__ */A.number().int().nonnegative(),out_of_range_count:/* @__PURE__ */A.number().int().nonnegative(),unknown_count:/* @__PURE__ */A.number().int().nonnegative()}),ii=/* @__PURE__ */A.object({markers:/* @__PURE__ */A.array(ri).optional(),summary:/* @__PURE__ */ni.nullish(),disclaimer:/* @__PURE__ */A.string().optional(),featured_marker_id:Zn});function ai(e){/* @__PURE__ */
|
|
33
|
+
return Object.freeze({petRef:e,withheld:true,markers:/* @__PURE__ */Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}function mapRecordMarkers(petRef,e){let t=Vn(e)?e:{},r=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:petRef;if(t.withheld===true)return ai(r);let n=ii.safeParse(t);if(!n.success)return ai(r);let i=n.data,a=e=>/* @__PURE__ */Object.freeze({at:e.collected_at??e.at??null,value:e.value??null,unit:e.unit??null,qualitativeResult:e.qualitative_result??null,refLow:e.ref_low??null,refHigh:e.ref_high??null,status:e.status??null,sourceClinic:e.source_clinic??null,docId:e.source_doc_id??e.doc_id??null,reviewed:e.reviewed===true}),l=(i.markers??[]).map(e=>/* @__PURE__ */Object.freeze({markerId:e.marker_id,name:e.canonical_name??e.name??e.marker_id,loincCode:e.loinc_code??null,unit:e.canonical_unit??e.unit??null,panel:e.panel_name??e.panel??null,meaning:e.meaning_text??e.meaning??null,latest:e.latest?/* @__PURE__ */Object.freeze({at:e.latest.collected_at??e.latest.at??null,value:e.latest.value??null,unit:e.latest.unit??null,qualitativeResult:e.latest.qualitative_result??null,status:e.latest.status??null}):null,trajectory:e.trajectory??null,points:/* @__PURE__ */Object.freeze((e.points??[]).map(a))}));/* @__PURE__ */
|
|
34
|
+
return Object.freeze({petRef:r,withheld:false,markers:/* @__PURE__ */Object.freeze(l),summary:i.summary?/* @__PURE__ */Object.freeze({totalMarkers:i.summary.total_markers,inRangeCount:i.summary.in_range_count,outOfRangeCount:i.summary.out_of_range_count,unknownCount:i.summary.unknown_count}):null,disclaimer:i.disclaimer??"",featuredMarkerId:i.featured_marker_id??null})}var li=128,oi=128;var si=/* @__PURE__ */A.string().min(1).refine(e=>e.startsWith("https://")),di=/* @__PURE__ */A.object({source_doc_id:/* @__PURE__ */A.string().min(1),file_name:/* @__PURE__ */A.string().nullish(),doc_format:/* @__PURE__ */A.string().nullish(),byte_size:/* @__PURE__ */A.number().int().nonnegative().nullish(),received_at:/* @__PURE__ */A.string().nullish(),download_url:si,expires_in_seconds:/* @__PURE__ */A.number().int().nonnegative().nullish()}),ui=/* @__PURE__ */A.object({items:/* @__PURE__ */A.array(/* @__PURE__ */A.unknown()).optional()});function ci(e){let t=ui.safeParse(e);if(!t.success)return null;let r=[];for(let e of t.data.items??[]){let t=di.safeParse(e);t.success&&r.push(
|
|
35
|
+
/* @__PURE__ */Object.freeze({sourceDocId:t.data.source_doc_id,fileName:t.data.file_name??null,docFormat:t.data.doc_format??null,byteSize:t.data.byte_size??null,receivedAt:t.data.received_at??null,downloadUrl:t.data.download_url,expiresInSeconds:t.data.expires_in_seconds??0}))}/* @__PURE__ */
|
|
36
|
+
return Object.freeze(r)}var pi=/* @__PURE__ */Object.freeze(["vet","groomer","boarding"]),hi=/* @__PURE__ */A.string().min(1).refine(e=>e.startsWith("https://")),fi=/* @__PURE__ */A.string().nullish(),gi=/* @__PURE__ */A.unknown().optional(),bi=/* @__PURE__ */A.object({share_id:/* @__PURE__ */A.string().min(1),share_url:/* @__PURE__ */A.string().min(1),expires_at:fi,audience:gi}),mi=/* @__PURE__ */A.object({shares:/* @__PURE__ */A.array(/* @__PURE__ */A.object({share_id:/* @__PURE__ */A.string().min(1),expires_at:fi,created_at:fi,view_count:/* @__PURE__ */A.number().int().nonnegative().nullish(),last_viewed_at:fi,audience:gi})).optional()}),yi=/* @__PURE__ */A.object({download_url:hi,expires_at:fi}),vi=/* @__PURE__ */A.object({share_id:/* @__PURE__ */A.string().min(1),expires_at:fi,audience:gi}),wi=/* @__PURE__ */A.object({audience:/* @__PURE__ */A.string().min(1),sections:/* @__PURE__ */A.array(/* @__PURE__ */A.string()),entity_types:/* @__PURE__ */A.array(/* @__PURE__ */A.string()).nullable()}),Ai=254;function isShareRecipientEmail(e){let t=e.trim();return t.length>0&&t.length<=Ai&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)}var ki=e=>typeof e=="string"&&pi.includes(e);function _i(e){return ki(e)?e:null}function mapShareAudiences(e){let t=A.array(wi).safeParse(e);if(!t.success)/* @__PURE__ */return Object.freeze([]);let r=/* @__PURE__ */new Set,n=[];for(let e of t.data)!ki(e.audience)||r.has(e.audience)||(r.add(e.audience),n.push(/* @__PURE__ */Object.freeze({audience:e.audience,sections:/* @__PURE__ */Object.freeze([...e.sections]),entityTypes:e.entity_types===null?null:/* @__PURE__ */Object.freeze([...e.entity_types])}))/* @__PURE__ */);return Object.freeze(n)}function resolveShareUrl(e,t){let r=e.trim();if(r.length===0)return null;let n=/^[a-z][a-z0-9+.-]*:/i.test(r)?it(r):t!==void 0?it(r,t):null;return n===null||n.protocol!=="https:"?null:n.href}function mapRecordShareLink(e,t){let r=bi.safeParse(e);if(!r.success)return null;let n=resolveShareUrl(r.data.share_url,t);return n===null?null:/* @__PURE__ */Object.freeze({shareId:r.data.share_id,shareUrl:n,expiresAt:r.data.expires_at??null,audience:_i(r.data.audience)})}function mapRecordShareList(e){let t=mi.safeParse(e);return t.success?/* @__PURE__ */Object.freeze((t.data.shares??[]).map(e=>/* @__PURE__ */Object.freeze({shareId:e.share_id,expiresAt:e.expires_at??null,createdAt:e.created_at??null,viewCount:e.view_count??0,lastViewedAt:e.last_viewed_at??null,audience:_i(e.audience)}))):null}function mapRecordShareEmailReceipt(e){let t=vi.safeParse(e);return t.success?/* @__PURE__ */Object.freeze({shareId:t.data.share_id,expiresAt:t.data.expires_at??null,audience:_i(t.data.audience)}):null}function mapRecordPdfLink(e){let t=yi.safeParse(e);return t.success?/* @__PURE__ */Object.freeze({downloadUrl:t.data.download_url,expiresAt:t.data.expires_at??null}):null}var Si="application/pdf",Ci=/* @__PURE__ */Object.freeze(["image/jpeg","image/png","image/heic","image/heif"]);var Ti=/* @__PURE__ */Object.freeze({features:/* @__PURE__ */Object.freeze({}),uploadContentTypes:/* @__PURE__ */Object.freeze([Si]),shareAudiences:/* @__PURE__ */Object.freeze([])}),Ri=/* @__PURE__ */A.object({features:/* @__PURE__ */A.record(/* @__PURE__ */A.boolean()),upload_content_types:/* @__PURE__ */A.array(/* @__PURE__ */A.string()).nullish(),share_audiences:/* @__PURE__ */A.unknown().optional()});function zi(e){let t=Ri.safeParse(e);if(!t.success)return Ti;let r=t.data.upload_content_types??[],n=Ci.filter(e=>r.includes(e));/* @__PURE__ */
|
|
37
|
+
return Object.freeze({features:/* @__PURE__ */Object.freeze({...t.data.features}),uploadContentTypes:/* @__PURE__ */Object.freeze([Si,...n]),shareAudiences:mapShareAudiences(t.data.share_audiences)})}var Oi=/* @__PURE__ */A.object({signatures:/* @__PURE__ */A.array(/* @__PURE__ */A.object({signature_id:/* @__PURE__ */A.string().min(1),preview_url:/* @__PURE__ */A.string().min(1).refine(e=>e.startsWith("https://")),created_at:/* @__PURE__ */A.string().nullish()})).optional()});function mapSignatureSuggestions(e){let t=Oi.safeParse(e);return t.success?/* @__PURE__ */Object.freeze((t.data.signatures??[]).map(e=>/* @__PURE__ */Object.freeze({signatureId:e.signature_id,previewUrl:e.preview_url,createdAt:e.created_at??null}))):null}function Ei(e){return e.code!=="conversationNotFound"?e:makeEverfurError("resourceNotFound",{retryable:false,...e.httpStatus===void 0?{}:{httpStatus:e.httpStatus},...e.requestId===void 0?{}:{requestId:e.requestId},...e.reasonCode===void 0?{}:{reasonCode:e.reasonCode},...e.wireMessage===void 0?{}:{wireMessage:e.wireMessage},...e.raw===void 0?{}:{raw:e.raw}})}function Ii(e){return e.ok?e:err(Ei(e.error))}function ji(e){return{send:async(...t)=>Ii(await e.send(...t)),authorize:t=>e.authorize(t),stream:(t,r,n)=>e.stream(t,r,n)}}var xi=/* @__PURE__ */A.string().nullish(),Fi=/* @__PURE__ */A.number().nullish(),Di=/* @__PURE__ */A.object({at:xi,value:Fi,unit:xi,qualitative_result:xi,ref_low:Fi,ref_high:Fi,status:xi,doc_id:xi}),Bi=/* @__PURE__ */A.object({marker_id:/* @__PURE__ */A.string(),name:/* @__PURE__ */A.string(),loinc_code:xi,unit:xi,panel:xi,meaning:xi,latest:/* @__PURE__ */A.object({at:xi,value:Fi,unit:xi,qualitative_result:xi,status:xi}).nullish(),trajectory:xi,points:/* @__PURE__ */A.array(Di).optional()}),Pi=/* @__PURE__ */A.object({encounter_id:/* @__PURE__ */A.string(),date:xi,type:xi,clinic_name:xi,veterinarian:xi,doc_id:xi}),Hi=/* @__PURE__ */A.object({note_id:/* @__PURE__ */A.string(),encounter_id:xi,observed_on:xi,sections:/* @__PURE__ */A.array(/* @__PURE__ */A.object({section:/* @__PURE__ */A.string(),text:/* @__PURE__ */A.string()})).optional()}),Ni=/* @__PURE__ */A.object({exam_id:/* @__PURE__ */A.string(),encounter_id:xi,observed_on:xi,doc_id:xi,systems:/* @__PURE__ */A.record(/* @__PURE__ */A.object({finding_status:xi,finding:xi})).optional()}),Mi=/* @__PURE__ */A.object({has_lab_history:/* @__PURE__ */A.boolean().optional(),has_vaccination_history:/* @__PURE__ */A.boolean().optional(),has_weight_history:/* @__PURE__ */A.boolean().optional(),has_vitals_history:/* @__PURE__ */A.boolean().optional(),has_physical_exam_history:/* @__PURE__ */A.boolean().optional(),has_procedure_history:/* @__PURE__ */A.boolean().optional(),has_genetic_history:/* @__PURE__ */A.boolean().optional(),has_reproductive_history:/* @__PURE__ */A.boolean().optional(),has_parasite_prevention_history:/* @__PURE__ */A.boolean().optional(),earliest_record_at:xi,latest_record_at:xi,documents_ingested:/* @__PURE__ */A.number().int().nonnegative().optional(),documents_in_review:/* @__PURE__ */A.number().int().nonnegative().optional(),entities_pending_review:/* @__PURE__ */A.record(/* @__PURE__ */A.number().int().nonnegative()).optional(),held_total:/* @__PURE__ */A.number().int().nonnegative().optional()}),Ui=/* @__PURE__ */A.object({conflict_id:/* @__PURE__ */A.string(),entity_type:/* @__PURE__ */A.string(),field:xi,severity:xi,candidates:/* @__PURE__ */A.array(/* @__PURE__ */A.object({value:/* @__PURE__ */A.string(),source_doc_id:xi,doc_id:xi,collected_at:xi})).optional()}),Li=/* @__PURE__ */A.object({lab_results:/* @__PURE__ */A.array(Bi).optional(),encounters:/* @__PURE__ */A.array(Pi).optional(),clinician_notes:/* @__PURE__ */A.array(Hi).optional(),physical_exams:/* @__PURE__ */A.array(Ni).optional(),completeness:/* @__PURE__ */Mi.nullish(),conflicts:/* @__PURE__ */A.array(Ui).optional()}),Wi=/* @__PURE__ */A.object({visits:/* @__PURE__ */A.array(/* @__PURE__ */A.object({visit_id:/* @__PURE__ */A.string(),visit_date:xi,veterinarian:xi,summary:xi,doc_id:xi})),vaccines:/* @__PURE__ */A.array(/* @__PURE__ */A.object({vaccine_id:/* @__PURE__ */A.string(),product:xi,lot:xi,administered_on:xi,expires_on:xi,doc_id:xi})),weights:/* @__PURE__ */A.array(/* @__PURE__ */A.object({weight_id:/* @__PURE__ */A.string(),observed_on:xi,weight_kg:Fi,doc_id:xi})),medications:/* @__PURE__ */A.array(/* @__PURE__ */A.object({medication_id:/* @__PURE__ */A.string(),drug_name:xi,dose:xi,route:xi,frequency:xi,sig:xi,rx_number:xi,started_on:xi,stopped_on:xi,doc_id:xi})),disclaimer:/* @__PURE__ */A.string().optional()}),Vi=/* @__PURE__ */A.object({document:Yn,contributions:/* @__PURE__ */A.array(Qn),contribution_count:/* @__PURE__ */A.number().int().nonnegative().optional()});function qi(e,petRef){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:petRef}function Gi(e,t){/* @__PURE__ */
|
|
38
|
+
return Object.freeze({petRef:e,available:false,withheld:t,labResults:/* @__PURE__ */Object.freeze([]),encounters:/* @__PURE__ */Object.freeze([]),clinicianNotes:/* @__PURE__ */Object.freeze([]),physicalExams:/* @__PURE__ */Object.freeze([]),completeness:null,conflicts:/* @__PURE__ */Object.freeze([])})}function mapRecordDepth(petRef,e){let t=Vn(e)?e:{},r=qi(t,petRef);if(t.withheld===true)return Gi(r,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(e=>e in t))return Gi(r,false);let n=Li.safeParse(t);if(!n.success)return Gi(r,true);let i=n.data,a=e=>/* @__PURE__ */Object.freeze({at:e.at??null,value:e.value??null,unit:e.unit??null,qualitativeResult:e.qualitative_result??null,refLow:e.ref_low??null,refHigh:e.ref_high??null,status:e.status??null,docId:e.doc_id??null});/* @__PURE__ */
|
|
39
|
+
return Object.freeze({petRef:r,available:true,withheld:false,labResults:/* @__PURE__ */Object.freeze((i.lab_results??[]).map(e=>/* @__PURE__ */Object.freeze({markerId:e.marker_id,name:e.name,loincCode:e.loinc_code??null,unit:e.unit??null,panel:e.panel??null,meaning:e.meaning??null,latest:/* @__PURE__ */Object.freeze({at:e.latest?.at??null,value:e.latest?.value??null,unit:e.latest?.unit??null,qualitativeResult:e.latest?.qualitative_result??null,status:e.latest?.status??null}),trajectory:e.trajectory??null,points:/* @__PURE__ */Object.freeze((e.points??[]).map(a))}))),encounters:/* @__PURE__ */Object.freeze((i.encounters??[]).map(e=>/* @__PURE__ */Object.freeze({encounterId:e.encounter_id,date:e.date??null,type:e.type??null,clinicName:e.clinic_name??null,veterinarian:e.veterinarian??null,docId:e.doc_id??null}))),clinicianNotes:/* @__PURE__ */Object.freeze((i.clinician_notes??[]).map(e=>/* @__PURE__ */Object.freeze({noteId:e.note_id,encounterId:e.encounter_id??null,observedOn:e.observed_on??null,sections:/* @__PURE__ */Object.freeze((e.sections??[]).map(e=>/* @__PURE__ */Object.freeze({section:e.section,text:e.text})))}))),physicalExams:/* @__PURE__ */Object.freeze((i.physical_exams??[]).map(e=>/* @__PURE__ */Object.freeze({examId:e.exam_id,encounterId:e.encounter_id??null,observedOn:e.observed_on??null,docId:e.doc_id??null,systems:/* @__PURE__ */Object.freeze(Object.entries(e.systems??{}).map(([e,t])=>/* @__PURE__ */Object.freeze({system:e,findingStatus:t.finding_status??null,finding:t.finding??null})))}))),completeness:i.completeness?/* @__PURE__ */Object.freeze({hasLabHistory:i.completeness.has_lab_history===true,hasVaccinationHistory:i.completeness.has_vaccination_history===true,hasWeightHistory:i.completeness.has_weight_history===true,hasVitalsHistory:i.completeness.has_vitals_history===true,hasPhysicalExamHistory:i.completeness.has_physical_exam_history===true,hasProcedureHistory:i.completeness.has_procedure_history===true,hasGeneticHistory:i.completeness.has_genetic_history===true,hasReproductiveHistory:i.completeness.has_reproductive_history===true,hasParasitePreventionHistory:i.completeness.has_parasite_prevention_history===true,earliestRecordAt:i.completeness.earliest_record_at??null,latestRecordAt:i.completeness.latest_record_at??null,documentsIngested:i.completeness.documents_ingested??0,documentsInReview:i.completeness.documents_in_review??0,entitiesPendingReview:/* @__PURE__ */Object.freeze({...i.completeness.entities_pending_review??{}}),heldTotal:i.completeness.held_total??0}):null,conflicts:/* @__PURE__ */Object.freeze((i.conflicts??[]).map(e=>/* @__PURE__ */Object.freeze({conflictId:e.conflict_id,entityType:e.entity_type,field:e.field??null,severity:e.severity??"needs_review",candidates:/* @__PURE__ */Object.freeze((e.candidates??[]).map(e=>/* @__PURE__ */Object.freeze({value:e.value,docId:e.source_doc_id??e.doc_id??null,collectedAt:e.collected_at??null})))})))})}function Ki(e){/* @__PURE__ */
|
|
40
|
+
return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:/* @__PURE__ */Object.freeze([]),vaccines:/* @__PURE__ */Object.freeze([]),weights:/* @__PURE__ */Object.freeze([]),medications:/* @__PURE__ */Object.freeze([]),disclaimer:""})}function mapRecordsTimeline(petRef,e){let t=Vn(e)?e:{},r=qi(t,petRef);if(t.withheld===true)return Ki(r);let n=Wi.safeParse(t);if(!n.success)return Ki(r);let i=n.data,a=i.visits.map(e=>/* @__PURE__ */Object.freeze({visitId:e.visit_id,visitDate:e.visit_date??null,veterinarian:e.veterinarian??null,summary:e.summary??null,docId:e.doc_id??null})),l=i.vaccines.map(e=>/* @__PURE__ */Object.freeze({vaccineId:e.vaccine_id,product:e.product??null,lot:e.lot??null,administeredOn:e.administered_on??null,expiresOn:e.expires_on??null,docId:e.doc_id??null})),o=i.weights.map(e=>/* @__PURE__ */Object.freeze({weightId:e.weight_id,observedOn:e.observed_on??null,weightKg:e.weight_kg??null,docId:e.doc_id??null})),s=i.medications.map(e=>/* @__PURE__ */Object.freeze({medicationId:e.medication_id,drugName:e.drug_name??null,dose:e.dose??null,route:e.route??null,frequency:e.frequency??null,sig:e.sig??null,rxNumber:e.rx_number??null,startedOn:e.started_on??null,stoppedOn:e.stopped_on??null,docId:e.doc_id??null}));/* @__PURE__ */
|
|
41
|
+
return Object.freeze({petRef:r,withheld:false,isEmpty:a.length===0&&l.length===0&&o.length===0&&s.length===0,visits:/* @__PURE__ */Object.freeze(a),vaccines:/* @__PURE__ */Object.freeze(l),weights:/* @__PURE__ */Object.freeze(o),medications:/* @__PURE__ */Object.freeze(s),disclaimer:i.disclaimer??""})}function mapDocumentContributions(petRef,e){let t=Vn(e)?e:{},r=qi(t,petRef),n=()=>/* @__PURE__ */Object.freeze({petRef:r,withheld:true,document:null,contributions:/* @__PURE__ */Object.freeze([]),contributionCount:0});if(t.withheld===true)return n();let i=Vi.safeParse(t);if(!i.success)return n();let a=/* @__PURE__ */Object.freeze(i.data.contributions.map($n));/* @__PURE__ */
|
|
42
|
+
return Object.freeze({petRef:r,withheld:false,document:Jn(i.data.document),contributions:a,contributionCount:i.data.contribution_count??a.length})}var Qi="/widget/v1/records/pets";function createRecordsDepthClient(e){let t=ji(e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}})),r=(e,t)=>typeof e=="string"&&e.length>0&&!Ln(e)&&[...e].length<=t,n=async(e,petRef,n,i)=>{if(!r(petRef,oi))return Yi();let a=await t.send(e,{method:"GET",path:n});if(!a.ok)return a;let l=i(a.value);return l.petRef===petRef?ok(l):err(makeEverfurError("internalError",{retryable:false}))},i=petRef=>`${Qi}/${encodeURIComponent(petRef)}`,a=petRef=>`${i(petRef)}/everfur_record`,l=async(e,r,n)=>{let i=await t.send(e,r,r.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!i.ok)return i;let a=n(i.value);return a===null?err(makeEverfurError("internalError",{retryable:false})):ok(a)},o=(e,t)=>!r(e.entityType,qn)||!r(e.canonicalKey,Gn)||e.idempotencyKey!==void 0&&!r(e.idempotencyKey,li)||t!==void 0&&Object.keys(t).length===0?null:{entity_type:e.entityType,canonical_key:e.canonicalKey,...t!==void 0?{corrected_fields:t}:{},...e.idempotencyKey!==void 0?{idempotency_key:e.idempotencyKey}:{}};return{getRecordDepth:petRef=>n("records.depth.record",petRef,`${i(petRef)}/record`,e=>mapRecordDepth(petRef,e)),getTimeline:petRef=>n("records.depth.timeline",petRef,`${i(petRef)}/timeline`,e=>mapRecordsTimeline(petRef,e)),getDocumentContributions(petRef,e){return r(e,64)?n("records.depth.contributions",petRef,`${i(petRef)}/documents/${encodeURIComponent(e)}/contributions`,e=>mapDocumentContributions(petRef,e)):Yi()},getMarkers:petRef=>n("records.depth.markers",petRef,`${i(petRef)}/markers`,e=>mapRecordMarkers(petRef,e)),createShare(petRef,t){if(!r(petRef,oi))return Yi();let n=t?.audience;return n!==void 0&&!pi.includes(n)?Yi():l("records.share.create",{method:"POST",path:`${a(petRef)}/share`,...n!==void 0?{body:{audience:n}}:{}},t=>mapRecordShareLink(t,e.apiBaseUrl))},emailShare(petRef,e){let t=e.recipientKind,n=typeof e.recipientEmail=="string"?e.recipientEmail.trim():"",i=t==="other"||pi.includes(t);return!r(petRef,oi)||!i||!isShareRecipientEmail(n)||Ln(n)?Yi():l("records.share.email",{method:"POST",path:`${a(petRef)}/share/email`,body:{recipient_email:n,recipient_kind:t}},mapRecordShareEmailReceipt)},async readFeatures(){try{let e=await t.send("records.getFeatures",{method:"GET",path:"/widget/v1/records/features"});return e.ok?zi(e.value):Ti}catch{return Ti}},listShares(petRef){return r(petRef,oi)?l("records.share.list",{method:"GET",path:`${a(petRef)}/shares`},mapRecordShareList):Yi()},async revokeShare(petRef,e){if(!r(petRef,oi)||!r(e,64))return Yi();let n=await t.send("records.share.revoke",{method:"DELETE",path:`${a(petRef)}/shares/${encodeURIComponent(e)}`},{idempotent:false,maxAttempts:1});return n.ok?ok(void 0):n},getPdfLink(petRef){return r(petRef,oi)?l("records.pdf.link",{method:"GET",path:`${a(petRef)}/pdf-link`},mapRecordPdfLink):Yi()},async editFact(petRef,e){let n=r(petRef,oi)?o(e,e.correctedFields):null;if(n===null)return Yi();let i=await t.send("records.fact.edit",{method:"POST",path:`${a(petRef)}/facts/edit`,body:n},{idempotent:false,maxAttempts:1});return i.ok?ok(void 0):i},async removeFact(petRef,e){let n=r(petRef,oi)?o(e):null;if(n===null)return Yi();let i=await t.send("records.fact.remove",{method:"POST",path:`${a(petRef)}/facts/remove`,body:n},{idempotent:false,maxAttempts:1});return i.ok?ok(void 0):i},listRequestDocuments(e){return r(e,64)?l("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(e)}/documents`},ci):Yi()},listAuthorizationSignatures:()=>l("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},mapSignatureSuggestions)}}function Yi(){return Promise.resolve(err(makeEverfurError("validationFailed",{retryable:false})))}var $i=/* @__PURE__ */new Map,Ji=/* @__PURE__ */new Set;function Zi(petRef){return $i.get(petRef)??0}function Xi(e){return Ji.add(e),()=>{Ji.delete(e)}}function ea(petRef){let e=l(()=>Zi(petRef),[petRef]);return s(Xi,e,e)}function useEverfurRecordsDepthClient(){let{runtime:e,userRef:userRef,scopeEpoch:t}=rr();return n(()=>{let{services:t}=e.registry;return createRecordsDepthClient({auth:t.authFor(userRef),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{},...typeof t.apiBaseUrl=="string"?{apiBaseUrl:t.apiBaseUrl}:{}})},[e,userRef,t])}function useRecordsDepthRead(petRef,e,t,a=""){let s=useEverfurRecordsDepthClient(),{userRef:userRef}=rr(),d=ea(petRef),u=n(()=>({}),[s,petRef,a,d]),[c,p]=r({scope:u,value:null,error:null,loading:true}),h=o(0),f=l(async()=>{let t=h.current+=1;if(p({scope:u,value:null,error:null,loading:true}),userRef===null){p({scope:u,value:null,error:null,loading:false});return}let r=await e(s,petRef);t===h.current&&(r.ok?p({scope:u,value:r.value,error:null,loading:false}):p({scope:u,value:null,error:r.error,loading:false}))},[s,petRef,e,u,userRef]);i(()=>(f(),()=>{h.current+=1}),[f]);let g=c.scope===u?c:{value:null,error:null,loading:true},b=l(()=>{f()},[f]),m=g.error===null||g.error.httpStatus!==404,y=m?g.error:null,v=g.loading?"loading":y!==null?"error":g.value===null?"empty":g.value.withheld?"populated":t(g.value)?"empty":"populated";return n(()=>({status:v,value:g.value,error:y,available:m,refresh:b}),[v,g.value,y,m,b])}var ta=(e,petRef)=>e.getMarkers(petRef),ra=e=>e.markers.length===0;function useRecordsMarkers(petRef){let e=useRecordsDepthRead(petRef,ta,ra);return n(()=>{let t=e.available&&e.value!==null&&!e.value.withheld?e.value:null;return{status:e.status,markers:t,available:e.available,error:e.error,refresh:e.refresh}},[e])}function na(e,t){if(e===void 0)return{};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}function ia(e){return e?.textColor===void 0?{}:{color:e.textColor}}var aa=/* @__PURE__ */Object.freeze({idle:/* @__PURE__ */Object.freeze({title:"Find your pet’s clinic",body:"Search for the clinic that holds your pet’s records. We’ll request them on your behalf once you sign the authorization.",action:null}),no_requests:/* @__PURE__ */Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you’ll be able to track every step here.",action:null}),no_records:/* @__PURE__ */Object.freeze({title:"Nothing to show just yet",body:"Once your pet’s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:/* @__PURE__ */Object.freeze({title:"Slow down a moment",body:"You’ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:/* @__PURE__ */Object.freeze({title:"Records search is temporarily down",body:"We’re working on it. Please try again in a few minutes.",action:"Try again"}),error:/* @__PURE__ */Object.freeze({title:"Couldn’t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),la=60;function oa(e){return`Try again in ${e}s`}var sa="Try again, available shortly";var da={pointerEvents:"none",accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};function ua(e){return{width:e,height:e,alignItems:"center",justifyContent:"center"}}function ca(e){return Math.max(1.5,Math.round(e/11*10)/10)}function pa(e,t,r,n,i=0){return{position:"absolute",top:n.top-t/2,left:n.left-r/2,width:r,height:t,borderRadius:t,backgroundColor:e,transform:[{rotate:`${i}deg`}]}}function InboxGlyph({size:e,color:t}){let r=ca(e);/* @__PURE__ */
|
|
43
|
+
return v(p,{style:ua(e),...da,children:[
|
|
44
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:e*.2,left:e*.06,width:e*.88,height:e*.66,borderWidth:r,borderColor:t,borderRadius:e*.12}}),
|
|
45
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.26,{top:e*.54,left:e*.2})}),
|
|
46
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.26,{top:e*.54,left:e*.8})}),
|
|
47
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:e*.54-r/2,left:e*.34,width:e*.32,height:e*.14,borderBottomWidth:r,borderLeftWidth:r,borderRightWidth:r,borderColor:t,borderBottomLeftRadius:r,borderBottomRightRadius:r}})]})}function ActivityGlyph({size:e,color:t}){let r=ca(e),n=e*.5;/* @__PURE__ */
|
|
48
|
+
return v(p,{style:ua(e),...da,children:[
|
|
49
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.24,{top:n,left:e*.12})}),
|
|
50
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.42,{top:e*.32,left:e*.32},-68)}),
|
|
51
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.62,{top:e*.5,left:e*.5},72)}),
|
|
52
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.42,{top:e*.68,left:e*.68},-68)}),
|
|
53
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*.14,{top:n,left:e*.9})})]})}function ClockGlyph({size:e,color:t}){let r=ca(e),n=e/2;/* @__PURE__ */
|
|
54
|
+
return v(p,{style:ua(e),...da,children:[
|
|
55
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:e*.04,left:e*.04,width:e*.92,height:e*.92,borderRadius:e,borderWidth:r,borderColor:t}}),
|
|
56
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:e*.24,left:n-r/2,width:r,height:n-e*.24+r/2,borderRadius:r,backgroundColor:t}}),
|
|
57
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:n-r/2,left:n-r/2,width:e*.22,height:r,borderRadius:r,backgroundColor:t}})]})}function ToolGlyph({size:e,color:t}){let r=ca(e),n=e*.42;/* @__PURE__ */
|
|
58
|
+
return v(p,{style:ua(e),...da,children:[
|
|
59
|
+
/* @__PURE__ */y(p,{style:pa(t,r*1.2,e*.62,{top:e*.62,left:e*.38},-45)}),
|
|
60
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:e*.06,right:e*.06,width:n,height:n,borderRadius:n,borderWidth:r,borderColor:t,borderTopColor:"transparent",transform:[{rotate:"45deg"}]}})]})}function WifiOffGlyph({size:e,color:t}){let r=ca(e),n=(n,i)=>({position:"absolute",top:e*i,left:(e-n)/2,width:n,height:n,borderRadius:n,borderWidth:r,borderColor:"transparent",borderTopColor:t});/* @__PURE__ */
|
|
61
|
+
return v(p,{style:ua(e),...da,children:[
|
|
62
|
+
/* @__PURE__ */y(p,{style:n(e*.96,.12)}),
|
|
63
|
+
/* @__PURE__ */y(p,{style:n(e*.56,.38)}),
|
|
64
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",top:e*.78,left:e/2-r,width:r*2,height:r*2,borderRadius:r,backgroundColor:t}}),
|
|
65
|
+
/* @__PURE__ */y(p,{style:pa(t,r,e*1.1,{top:e/2,left:e/2},45)})]})}function RecordsEmptyGlyph({variant:e,size:t,color:r}){switch(e){case"idle":/* @__PURE__ */
|
|
66
|
+
return y(SearchGlyph,{size:t,color:r});case"no_requests":/* @__PURE__ */
|
|
67
|
+
return y(InboxGlyph,{size:t,color:r});case"no_records":/* @__PURE__ */
|
|
68
|
+
return y(ActivityGlyph,{size:t,color:r});case"rate_limited":/* @__PURE__ */
|
|
69
|
+
return y(ClockGlyph,{size:t,color:r});case"service_unavailable":/* @__PURE__ */
|
|
70
|
+
return y(ToolGlyph,{size:t,color:r});case"error":/* @__PURE__ */
|
|
71
|
+
return y(WifiOffGlyph,{size:t,color:r});default:return null}}function RecordsEmptyState({variant:e,onAction:t,message:n,testID:a}){let l=ha(),o=useEverfurTheme(),s=aa[e],[d,u]=r(e==="rate_limited"?la:0);i(()=>{e==="rate_limited"&&u(la)},[e]),i(()=>{if(d<=0)return;let e=setTimeout(()=>u(e=>Math.max(0,e-1)),1e3);return()=>clearTimeout(e)},[d]);let c=e==="rate_limited"&&d>0,f=c?oa(d):s.action;/* @__PURE__ */
|
|
72
|
+
return v(p,{style:l.container,accessibilityRole:"summary",testID:a,children:[
|
|
73
|
+
/* @__PURE__ */y(p,{style:l.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:"records-empty-glyph",children:/* @__PURE__ */y(RecordsEmptyGlyph,{variant:e,size:fa,color:o.color.brandInk})}),
|
|
74
|
+
/* @__PURE__ */y(Text,{style:l.title,children:s.title}),
|
|
75
|
+
/* @__PURE__ */y(Text,{style:l.body,children:n??s.body}),f!==null&&t?/* @__PURE__ */y(h,{onPress:t,disabled:c,accessibilityRole:"button",accessibilityLabel:c?sa:f,accessibilityState:{disabled:c},style:[l.action,c?l.actionDisabled:null],testID:a?`${a}-action`:`records-empty-${e}-action`,children:/* @__PURE__ */y(Text,{style:l.actionLabel,children:f})}):null]})}function ha(){let e=useEverfurTheme();return n(()=>ba(e),[e])}var fa=22,ga=48;function ba(e){let{color:t,space:r,radius:n,type:i,slots:a}=e;return f.create({container:{paddingVertical:r.xxl,paddingHorizontal:r.xl,alignItems:"center",gap:r.sm+r.xs/2},glyph:{width:ga,height:ga,alignItems:"center",justifyContent:"center",marginBottom:r.xs},title:{...headingFace(e,"bold"),fontSize:i.size.subtitle,lineHeight:Math.round(i.size.subtitle*i.lineHeight.snug)-1,color:t.brandInk,textAlign:"center"},body:{...face(e,"regular"),fontSize:i.size.bodyTight,lineHeight:Math.round(i.size.bodyTight*i.lineHeight.normal),color:t.text.muted,textAlign:"center",maxWidth:320},action:{marginTop:r.sm,minHeight:r.xxl+r.sm,borderRadius:n.pill,paddingHorizontal:r.lg+r.xs/2,backgroundColor:t.brand,alignItems:"center",justifyContent:"center",...na(a.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...face(e,"bold"),color:t.onPrimary,fontSize:i.size.bodyTight,lineHeight:Math.round(i.size.bodyTight*i.lineHeight.snug)-1,...ia(a.primaryButton)}})}var ma=/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",text:"#000000",bg:"#FFFFFF",white:"#FFFFFF",mist:"#F1F5F2",charcoal:"#3D3D3D",alert:"#C03410",alertDeep:"#6D1D14",pink:"#FFC3BC",yellow:"#F2C763",skyBlue:"#4E98C9",tintSage:"#E6ECE8",tintPink:"#FFEAE8",tintPinkSoft:"#FFF6F5",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintYellowEdge:"#F6D892",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoGrey:"#6B6B6B",icoSage:"#819E90",icoBlue:"#4E98C9",barTrack:"#ECECEC",pillPlainEdge:"rgba(16, 70, 46, 0.2)"}),ya=/* @__PURE__ */Object.freeze({screenTitle:/* @__PURE__ */Object.freeze({size:22,lineHeight:26.4,face:"medium",color:"ink",letterSpacing:-.33}),cardTitle:/* @__PURE__ */Object.freeze({size:18,lineHeight:22.5,face:"bold",color:"ink",letterSpacing:-.36}),body:/* @__PURE__ */Object.freeze({size:17,lineHeight:26.35,face:"regular",color:"text",letterSpacing:0}),bodySm:/* @__PURE__ */Object.freeze({size:15,lineHeight:21.75,face:"regular",color:"text",letterSpacing:0}),bodySmBold:/* @__PURE__ */Object.freeze({size:15,lineHeight:21.75,face:"bold",color:"ink",letterSpacing:0}),fine:/* @__PURE__ */Object.freeze({size:13,lineHeight:18.2,face:"regular",color:"muted",letterSpacing:0}),labelMono:/* @__PURE__ */Object.freeze({size:12,lineHeight:16.8,face:"monoBold",color:"muted",letterSpacing:.72,upper:true}),pill:/* @__PURE__ */Object.freeze({size:12,lineHeight:14.4,face:"monoBold",color:"ink",letterSpacing:.72,upper:true}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:18,face:"bold",color:"ink",letterSpacing:0}),buttonRow:/* @__PURE__ */Object.freeze({size:14,lineHeight:16.8,face:"bold",color:"ink",letterSpacing:0}),chip:/* @__PURE__ */Object.freeze({size:14,lineHeight:16.8,face:"medium",color:"ink",letterSpacing:0}),hand:/* @__PURE__ */Object.freeze({size:22,lineHeight:26.4,face:"hand",color:"ink",letterSpacing:0})}),va=/* @__PURE__ */Object.freeze({surface:"#FFFFFF",textPrimary:"#111111",textMuted:"#6E6660",border:"#C8BEB4",brand:"#10462E",brandSoft:"rgba(16, 70, 46, 0.1)",danger:"#B91C1C"});var wa=/* @__PURE__ */Object.freeze({screen:{gap:12,padX:16,padBottom:24,legalTop:20},hero:{nameSize:22,nameLineHeight:26,nameTracking:-.44,metaTop:2,metaLineHeight:18,metaTracking:.26,stageHeight:280,stageTop:4,grassFraction:.46,petBottom:40,petBoxHeight:224,petTop:16,sayWidth:230,sayHeight:61,sayFontSize:22,sayArcPath:"M 12 60 Q 120 -4 228 60",sayViewBox:[240,64],vitalsTop:8,vitalsLeft:8,vitalMinHeight:40,vitalPadX:8,vitalGap:6,vitalIcon:22,vitalValueSize:17,vitalUnitSize:13,lawnOverlap:26,lawnRadius:28},card:{pad:16,radius:20,border:1,headGap:8,headBottom:12},button:{md:52,sm:46,row:36,padMd:24,padSm:16,padRow:14,iconMd:22,iconSm:20,iconRow:17,edge:1.5,gap:8,mdLabel:17,textGap:6,textMinHeight:24},pill:{minHeight:24,padX:10,edgeThin:1.25,edgeThick:1.5},upcoming:{listGap:4,bleed:8,rowPadY:10,rowPadX:8,rowGap:12,rowRadius:10,icon:20,maxRows:4},tiles:{top:8,titleBottom:12,gap:12,pad:16,radius:20,innerGap:8,icon:22,chevron:20,titleLineHeight:19,footMinHeight:28,numSize:20,numLineHeight:22,numTracking:-.4,countGap:8},weight:{headGap:4,headBottom:16,numSize:32,numLineHeight:34,numTracking:-.64,numGap:8},chart:{height:176,plotTop:24,axisBand:20,rightInset:14,indicatorWidth:8,plotLeft:62,dataLeft:76,dot:6,dotRing:1.5,lineWidth:2,labelGap:7,labelMax:12,labelMin:9,labelCharWidth:.62,edgePad:4,legendX:14,legendLine:14.4,legendSize:12,legendTracking:.24,monthY:172,monthSize:12,maxTicks:5,maxValues:8,bandFrom:.3,bandTo:.7,reach:.88,bandPct:.1,lineColor:"#111111",gridColor:"#EAEAEA",bandColor:"#D8F3E3"},add:{gap:12,headGap:8,icon:26,sourcesGap:6,sourcesTop:4,sourcePadY:10,sourcePadX:14,sourceRadius:10,sourceColumnGap:12,actsGap:12,actsTop:4},peek:{top:12,headGap:12,leadTop:8,labsTop:16,chipsTop:10,chipsGap:8,slideTop:16,slideGap:4,slideLeadTop:2,slideLeadBottom:8,markerPad:12,markerGap:8,markerRadius:10,markerTopGap:12,barHeight:8,barDot:12,barDotRing:2,valueGap:4,fromMinHeight:40,fromGap:6,fromIcon:16,fromChevron:18,moreGap:12,moreTop:16,morePad:16,moreInnerGap:12,moreRadius:20,moreIcon:22,moreHeadGap:8,rowsGap:6,rowMinHeight:44,rowPadY:8,rowPadX:14,rowRadius:10,roundButton:36,chipHeight:36,chipPadX:14},onTheWay:{dot:28,titleSize:22,titleLineHeight:25,titleTracking:-.44,wayIcon:26,wayPad:16,wayRadius:20},inProgress:{radius:18,pad:18,gap:16,titleSize:16,titleLineHeight:20,statusRadius:14,statusPad:14,statusSize:13,statusLineHeight:19}});var Aa=/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",alert:"#C03410",alertDeep:"#6D1D14",tintSage:"#E6ECE8",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoSage:"#819E90",efWhite:"#FFFFFF",efBlack:"#000000",efCharcoal:"#3D3D3D",efSkyBlue:"#4E98C9",embCyan1:"#E0FDFF",bgMist:"#F1F5F2",paper:"#F8F7F4",embB1:"#FFCE34",embB2:"#5CC8F2",embB3:"#FF6665",embB4:"#A55BD8",embRiskDot:"#E5372B",embRiskInk:"#B0231B",embClearDot:"#5FA82B",embInk2:"#4A4845",embInk3:"#6B6863",embTealInk:"#00707C",embYellow:"#FFCE34",watch:"#F9E6B9",barTrack:"#ECECEC",topCard:"#FFCE34",topKicker:"#4A4845",topInk:"#262523",plainEdge:"rgba(16, 70, 46, 0.2)"}),ka=/* @__PURE__ */Object.freeze({".rec-note":/* @__PURE__ */Object.freeze({fontSize:12.5}),".efh":/* @__PURE__ */Object.freeze({gap:12,fontSize:15}),".efh-sheet":/* @__PURE__ */Object.freeze({marginTop:20,paddingTop:20,paddingBottom:28,paddingLeft:16,borderTopLeftRadius:28}),".efh-ico":/* @__PURE__ */Object.freeze({width:22}),".efh-label":/* @__PURE__ */Object.freeze({fontSize:12}),".efh-pill":/* @__PURE__ */Object.freeze({minHeight:24,paddingLeft:10,fontSize:12,letterSpacing:.72}),".efh-card":/* @__PURE__ */Object.freeze({paddingTop:16,borderRadius:20}),".efh-card__title":/* @__PURE__ */Object.freeze({fontSize:18}),".efh-btn":/* @__PURE__ */Object.freeze({minHeight:48,paddingLeft:20,fontSize:16}),".efh-btn--row":/* @__PURE__ */Object.freeze({minHeight:40,paddingLeft:16,fontSize:15}),".efh-head":/* @__PURE__ */Object.freeze({marginBottom:8}),".efh-name":/* @__PURE__ */Object.freeze({fontSize:22}),".efh-meta":/* @__PURE__ */Object.freeze({fontSize:13}),".efh-stage":/* @__PURE__ */Object.freeze({height:236,marginTop:4,marginLeft:-16}),".efh-stage__grass":/* @__PURE__ */Object.freeze({height:"44%"}),".efh-stage__pet":/* @__PURE__ */Object.freeze({left:"58%",bottom:22,height:"86%"}),".efh-stage .efh-vitals":/* @__PURE__ */Object.freeze({top:14,left:16,gap:12}),".efh-head__from":/* @__PURE__ */Object.freeze({marginTop:12}),".efh-due":/* @__PURE__ */Object.freeze({marginLeft:-12}),".efh-due li":/* @__PURE__ */Object.freeze({gap:12,paddingTop:12,paddingLeft:12,borderRadius:10}),".efh-due__title":/* @__PURE__ */Object.freeze({fontSize:17,lineHeight:22.1}),".efh-sec":/* @__PURE__ */Object.freeze({marginTop:8,marginBottom:12}),".efh-tiles":/* @__PURE__ */Object.freeze({gap:10}),".efh-tile":/* @__PURE__ */Object.freeze({gap:8,paddingTop:16,borderRadius:20}),".efh-tile__title":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:18.75,letterSpacing:-.15}),".efh-tile__foot":/* @__PURE__ */Object.freeze({gap:8,minHeight:28}),".efh-tile__foot .efh-pill":/* @__PURE__ */Object.freeze({minHeight:22,paddingLeft:7,fontSize:10.5,letterSpacing:.21}),".efh-tile__foot:has(.efh-pill + .efh-pill)":/* @__PURE__ */Object.freeze({gap:6}),".efh-tile__num":/* @__PURE__ */Object.freeze({fontSize:20,lineHeight:20,letterSpacing:-.4}),".efh-wt":/* @__PURE__ */Object.freeze({gap:8}),".efh-wt b":/* @__PURE__ */Object.freeze({fontSize:32,lineHeight:32,letterSpacing:-.64}),".efh-emb":/* @__PURE__ */Object.freeze({gap:8,marginTop:12,fontSize:15,lineHeight:19.5}),".efh-wchart":/* @__PURE__ */Object.freeze({marginTop:20}),".efh-wchart__plot":/* @__PURE__ */Object.freeze({height:148}),".efh-wkey":/* @__PURE__ */Object.freeze({rowGap:4,columnGap:16,marginTop:12,fontSize:13,lineHeight:18.2}),".efh-wkey span":/* @__PURE__ */Object.freeze({gap:6}),".efh-key":/* @__PURE__ */Object.freeze({rowGap:8,columnGap:16,fontSize:13,lineHeight:18.2}),".efh-key span":/* @__PURE__ */Object.freeze({gap:6}),".efh-key span::before":/* @__PURE__ */Object.freeze({width:10}),".efh-tl__dot":/* @__PURE__ */Object.freeze({width:16,marginTop:3}),".efh-tl__year":/* @__PURE__ */Object.freeze({marginTop:20,marginBottom:12,marginLeft:40}),".efh-tl .efh-tl__year":/* @__PURE__ */Object.freeze({marginTop:4}),".efh-tl__item":/* @__PURE__ */Object.freeze({gap:16,paddingBottom:24}),".efh-tl__item::before":/* @__PURE__ */Object.freeze({left:11,top:22,bottom:-2}),".efh-tl__date":/* @__PURE__ */Object.freeze({fontSize:12,lineHeight:16.8,letterSpacing:.48}),".efh-tl__title":/* @__PURE__ */Object.freeze({marginTop:2,fontSize:17,lineHeight:22.1}),".efh-tl__text":/* @__PURE__ */Object.freeze({marginTop:2,lineHeight:22.5}),".efh-add":/* @__PURE__ */Object.freeze({gap:12}),".efh-add > p":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:22.5}),".efh-sheet .rec-note":/* @__PURE__ */Object.freeze({marginTop:4}),".efh-lab":/* @__PURE__ */Object.freeze({paddingTop:8,paddingBottom:96,paddingLeft:16}),".efh-titles":/* @__PURE__ */Object.freeze({gap:2,paddingTop:4}),".efh-title":/* @__PURE__ */Object.freeze({fontSize:22}),".efh-smeta":/* @__PURE__ */Object.freeze({fontSize:13}),".efh-mk__name":/* @__PURE__ */Object.freeze({fontSize:17}),".efh-mk__line":/* @__PURE__ */Object.freeze({rowGap:0,columnGap:6,marginTop:1,fontSize:13,lineHeight:18.2}),".efh-mk__line b":/* @__PURE__ */Object.freeze({fontSize:17}),".efh-none":/* @__PURE__ */Object.freeze({paddingTop:0}),".efh-none__scene":/* @__PURE__ */Object.freeze({marginBottom:16,marginLeft:-16}),".efh-none__t":/* @__PURE__ */Object.freeze({fontSize:22,lineHeight:25.3,letterSpacing:-.44}),".efh-none__lead":/* @__PURE__ */Object.freeze({marginTop:8,fontSize:15,lineHeight:22.5}),".efh-ways":/* @__PURE__ */Object.freeze({gap:12,marginTop:16}),".efh-way":/* @__PURE__ */Object.freeze({columnGap:12,paddingTop:16,borderRadius:20}),".efh-way__w":/* @__PURE__ */Object.freeze({gap:2}),".efh-way__t":/* @__PURE__ */Object.freeze({fontSize:16,lineHeight:20.8}),".efh-way__x":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:21.75}),".efh-peek__labs .efh-card__title":/* @__PURE__ */Object.freeze({marginBottom:8}),".efh-peek__g":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:21.75,marginBottom:6}),".efh-peek__g b":/* @__PURE__ */Object.freeze({fontSize:16}),".dot":/* @__PURE__ */Object.freeze({width:9}),".rec-top":/* @__PURE__ */Object.freeze({gap:8,paddingTop:16,paddingRight:18,paddingBottom:18,paddingLeft:18,borderRadius:22}),".rec-top__k":/* @__PURE__ */Object.freeze({gap:7,fontSize:10.5,letterSpacing:.63}),".rec-top .emb-btn":/* @__PURE__ */Object.freeze({marginTop:4}),".mixbar":/* @__PURE__ */Object.freeze({gap:2,height:10}),".mixlegend":/* @__PURE__ */Object.freeze({rowGap:6,columnGap:14,marginTop:12,fontSize:13.5}),".mixlegend li":/* @__PURE__ */Object.freeze({gap:7}),".mixlegend i":/* @__PURE__ */Object.freeze({width:9}),".mixlegend b":/* @__PURE__ */Object.freeze({fontSize:12}),".askbar":/* @__PURE__ */Object.freeze({gap:6,height:52,paddingRight:6,paddingLeft:8,borderWidth:1.5}),".askbar input":/* @__PURE__ */Object.freeze({fontSize:16}),".askbar__add":/* @__PURE__ */Object.freeze({width:38}),".askbar__add svg":/* @__PURE__ */Object.freeze({width:22}),".askbar__send":/* @__PURE__ */Object.freeze({width:40}),".askbar__send svg":/* @__PURE__ */Object.freeze({width:20}),".ph-head":/* @__PURE__ */Object.freeze({height:58,paddingLeft:14}),".ph-back":/* @__PURE__ */Object.freeze({width:44,marginLeft:-6}),".ph-back svg":/* @__PURE__ */Object.freeze({width:26}),".ph-title":/* @__PURE__ */Object.freeze({fontSize:17}),".emb-card":/* @__PURE__ */Object.freeze({borderRadius:22}),".emb-tile":/* @__PURE__ */Object.freeze({width:46,height:46,borderRadius:13}),".ask-pill":/* @__PURE__ */Object.freeze({right:16,bottom:16,gap:8,minHeight:48,paddingRight:18,paddingLeft:14,fontSize:15.5}),".ask-pill svg":/* @__PURE__ */Object.freeze({width:22}),".ph-askbar":/* @__PURE__ */Object.freeze({paddingTop:10,paddingRight:14,paddingBottom:10,paddingLeft:14}),".rec":/* @__PURE__ */Object.freeze({paddingTop:18,paddingLeft:16}),".rec-dna":/* @__PURE__ */Object.freeze({paddingTop:16,marginTop:16}),".rec-dna__top":/* @__PURE__ */Object.freeze({gap:12,marginBottom:14}),".rec-dna__top h3":/* @__PURE__ */Object.freeze({fontSize:17}),".rec-dna__top p":/* @__PURE__ */Object.freeze({fontSize:10.5,letterSpacing:.53,marginTop:2}),".rec-dna__risk":/* @__PURE__ */Object.freeze({gap:10,marginTop:14,paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:14,borderRadius:14}),".rec-dna__risk small":/* @__PURE__ */Object.freeze({fontSize:13}),".rec-dna__risk strong":/* @__PURE__ */Object.freeze({marginTop:1,fontSize:16,lineHeight:20}),".rec-dna__clear":/* @__PURE__ */Object.freeze({gap:7,minHeight:36,marginTop:4,paddingLeft:4,fontSize:14}),".rec-dna__clear .dot":/* @__PURE__ */Object.freeze({width:7})});var _a=ka;function Sa(e,t){let r=_a[e]?.[t];return typeof r=="number"?r:Number.NaN}var Ca=Sa;function Ta(e,t){let r=_a[e]?.[t];return typeof r=="string"&&r.endsWith("%")?Number(r.slice(0,-1))/100:Number.NaN}
|
|
76
|
+
/* @__PURE__ */Object.freeze({gap:Ca(".efh","gap"),sheetPadTop:Ca(".efh-sheet","paddingTop"),sheetPadX:Ca(".efh-sheet","paddingLeft"),sheetPadBottom:Ca(".efh-sheet","paddingBottom"),sheetRadius:Ca(".efh-sheet","borderTopLeftRadius"),sheetGap:Ca(".efh-sheet","marginTop"),cardPad:Ca(".efh-card","paddingTop"),cardRadius:Ca(".efh-card","borderRadius"),name:Ca(".efh-name","fontSize"),cardTitle:Ca(".efh-card__title","fontSize"),rowTitle:Ca(".efh-mk__name","fontSize"),body:Ca(".efh","fontSize"),small:Ca(".efh-meta","fontSize"),mono:Ca(".efh-label","fontSize"),tileNum:Ca(".efh-tile__num","fontSize"),big:Ca(".efh-wt b","fontSize"),button:Ca(".efh-btn","minHeight"),rowButton:Ca(".efh-btn--row","minHeight"),pill:Ca(".efh-pill","minHeight"),plot:Ca(".efh-wchart__plot","height"),rowRadius:Ca(".efh-due li","borderRadius"),tileGap:Ca(".efh-tiles","gap"),icon:Ca(".efh-ico","width")});function Ra(e,t){return e.trim().toLowerCase()===t.trim().toLowerCase()}function za(e,t,r){let n=V(e,r);return(n!==null?W(n,t):null)??t}var Oa=(e,t)=>parseColor(e)===parseColor(t);function Ea(e){if(e.brightness!=="light")return false;let t=e.color,r=Mr.color;return Oa(t.primary,r.primary)&&Oa(t.brandInk,r.brandInk)&&Oa(t.onPrimary,r.onPrimary)&&Oa(t.accent,r.accent)&&Oa(t.accentEdge,r.accentEdge)}function Ia(e){let t=e.color,r=Aa,n=Yr(e),i=e.brightness==="dark",a=Ea(e),l=(i?Lr:Mr).color,o=!Oa(t.accent,l.accent),s=i?t.surface:r.efWhite,d=(e,t)=>za(e,s,i?.18:t),u=a?r.tintSage:d(n.primary,.105),c=a?r.topCard:o?n.accent:u;return{tintSage:u,chevron:a?r.icoSage:za(t.brandInk,s,.527),rowGround:a?r.bgMist:d(n.primary,.059),tintPartner:o?d(n.accent,.14):r.embCyan1,topFill:c,plainEdge:a?r.plainEdge:V(t.brandInk,.2)??t.structureEdge,topKicker:Jr(c,[o?n.onAccent:i?n.ink3:r.topKicker,r.topInk]),topInk:Jr(c,[o?n.onAccent:i?n.ink:r.topInk,r.topInk])}}function recordsSheetLook(e){let t=e.color,r=Aa,n=Yr(e),i=Ia(e),a=Ea(e)?r.go:Ra(t.accent,t.primary)?t.onPrimary:t.accent;return e.brightness==="dark"?/* @__PURE__ */Object.freeze({dark:true,paper:n.paper,ground:t.background,card:n.card,text:n.ink,muted:n.ink3,line:t.structureEdge,ink:t.brandInk,fill:n.primary,onFill:n.onPrimary,accentOnFill:a,accent:n.accent,go:t.success,goTint:t.badgeBgPositive,alert:n.riskInk,alertDeep:n.riskInk,alertTint:t.badgeBgCritical,watch:t.badgeBgCaution,wind:r.efSkyBlue,tintBlue:t.surfaceSubtle,tintYellow:t.surfaceSubtle,barTrack:t.structureEdge,...i}):/* @__PURE__ */Object.freeze({dark:false,paper:n.paper,ground:r.efWhite,card:r.efWhite,text:r.efBlack,muted:r.muted,line:r.line,ink:t.brandInk,fill:n.primary,onFill:n.onPrimary,accentOnFill:a,accent:n.accent,go:r.go,goTint:r.tintGo,alert:r.alert,alertDeep:r.alertDeep,alertTint:r.tintRed,watch:r.watch,wind:r.efSkyBlue,tintBlue:r.tintBlue,tintYellow:r.tintYellow,barTrack:r.barTrack,...i})}function ja(e){return Ea(e)}function xa(e){let t=(e.brightness==="dark"?Lr:Mr).color;return!Oa(e.color.accent,t.accent)}function Fa(e){let t=recordsSheetLook(e);if(t.dark)/* @__PURE__ */
|
|
77
|
+
return Object.freeze({dark:true,bg:t.ground,white:t.card,text:t.text,muted:t.muted,line:t.line,charcoal:t.muted,ink:t.ink,fill:t.fill,onFill:t.onFill,accentOnFill:t.accentOnFill,go:t.go,alert:t.alert,alertDeep:t.alertDeep,yellow:t.watch,tintSage:t.tintSage,tintPink:t.tintPartner,tintPinkSoft:t.card,tintBlue:t.tintBlue,tintYellow:t.tintYellow,tintYellowEdge:t.watch,tintRed:t.alertTint,tintGo:t.goTint,icoGrey:t.muted,icoSage:t.chevron,icoBlue:t.wind,barTrack:t.barTrack,pillPlainEdge:t.plainEdge,chartLine:t.text,chartGrid:t.line,chartBand:t.goTint,legacyText:t.text,legacyMuted:t.muted,legacyBorder:t.line,brand:t.ink,brandSoft:V(t.ink,.1)??t.tintSage,watch:t.watch,tintPartner:t.tintPartner,mist:t.rowGround});let r=ja(e),n=r?ma.ink:t.ink;/* @__PURE__ */
|
|
78
|
+
return Object.freeze({dark:false,bg:ma.bg,white:ma.white,text:ma.text,muted:ma.muted,line:ma.line,charcoal:ma.charcoal,ink:n,fill:r?ma.ink:t.fill,onFill:r?ma.white:t.onFill,accentOnFill:r?ma.go:t.accentOnFill,go:ma.go,alert:ma.alert,alertDeep:ma.alertDeep,yellow:ma.yellow,tintSage:r?ma.tintSage:t.tintSage,tintPink:r||!xa(e)?ma.tintPink:t.tintPartner,tintPinkSoft:ma.tintPinkSoft,tintBlue:ma.tintBlue,tintYellow:ma.tintYellow,tintYellowEdge:ma.tintYellowEdge,tintRed:ma.tintRed,tintGo:ma.tintGo,icoGrey:ma.icoGrey,icoSage:r?ma.icoSage:t.chevron,icoBlue:ma.icoBlue,barTrack:ma.barTrack,pillPlainEdge:r?ma.pillPlainEdge:t.plainEdge,chartLine:wa.chart.lineColor,chartGrid:wa.chart.gridColor,chartBand:wa.chart.bandColor,legacyText:va.textPrimary,legacyMuted:va.textMuted,legacyBorder:va.border,brand:r?va.brand:n,brandSoft:r?va.brandSoft:V(n,.1)??t.tintSage,watch:t.watch,tintPartner:t.tintPartner,mist:t.rowGround})}var Da=/* @__PURE__ */Symbol.for("everfur.sdk.rn.recordsHubKit.v1"),Ba=globalThis[Da]??=createContext(null);function Pa(e,t){let r=Fa(e),n=r=>r==="hand"?t!==null?{fontFamily:t}:face(e,"regular"):face(e,r),i=/* @__PURE__ */new Map;return{theme:e,look:r,type:e=>{let t=i.get(e);if(t!==void 0)return t;let a=ya[e],l={...n(a.face),fontSize:a.size,lineHeight:a.lineHeight,color:r[a.color],...a.letterSpacing!==0?{letterSpacing:a.letterSpacing}:{},...a.upper===true?{textTransform:"uppercase"}:{}};return i.set(e,l),l},face:n}}function Ha(){let e=useEverfurTheme(),t=n(()=>Pa(e,null),[e]);return a(Ba)??t}function HubText({variant:e="bodySm",color:t,style:r,children:n,tier:i,...a}){let{type:l}=Ha();/* @__PURE__ */
|
|
79
|
+
return y(Text,{tier:i??(e==="screenTitle"||e==="cardTitle"?"heading":e==="button"||e==="buttonRow"?"control":e==="pill"||e==="labelMono"||e==="chip"?"compact":"content"),...a,style:[l(e),t!==void 0?{color:t}:null,r],children:n})}function HubPill({label:e,tone:t="plain",small:r=false,testID:n}){let{look:i}=Ha(),a={stable:{bg:i.tintGo,fg:i.ink},overdue:{bg:i.white,fg:i.alert,edge:i.alert,w:wa.pill.edgeThin},soon:{bg:i.white,fg:i.ink,edge:i.tintYellowEdge,w:wa.pill.edgeThin},later:{bg:i.white,fg:i.muted,edge:i.line,w:wa.pill.edgeThin},clear:{bg:i.white,fg:i.go,edge:i.go,w:wa.pill.edgeThick},plain:{bg:i.white,fg:i.ink,edge:i.pillPlainEdge,w:wa.pill.edgeThick},high:{bg:i.white,fg:i.alert,edge:i.alert,w:wa.pill.edgeThin},watch:{bg:i.watch,fg:i.ink}}[t],l=r?Sa(".efh-tile__foot .efh-pill","fontSize"):Sa(".efh-pill","fontSize");/* @__PURE__ */
|
|
80
|
+
return y(p,{testID:n,style:[{alignSelf:"flex-start",maxWidth:"100%",borderRadius:999,justifyContent:"center",backgroundColor:a.bg,minHeight:r?Sa(".efh-tile__foot .efh-pill","minHeight"):Sa(".efh-pill","minHeight"),paddingHorizontal:r?Sa(".efh-tile__foot .efh-pill","paddingLeft"):Sa(".efh-pill","paddingLeft")},a.edge!==void 0?{borderWidth:a.w,borderColor:a.edge}:null],children:/* @__PURE__ */y(HubText,{variant:"pill",color:a.fg,numberOfLines:1,style:{fontSize:l,lineHeight:l,letterSpacing:r?Sa(".efh-tile__foot .efh-pill","letterSpacing"):Sa(".efh-pill","letterSpacing")},children:e})})}var Na="Back";function RecordsPushHeader({title:e,onBack:t,right:r,testID:i,look:a}){let l=useEverfurTheme(),o=n(()=>a===void 0?recordsSheetLook(l):null,[a,l]),s=a??o,d=l.slots.header,u=d?.textColor??(s.dark?s.text:Aa.topInk),c=Sa(".ph-back","width"),f=Sa(".ph-head","paddingLeft"),g={minWidth:c+Sa(".ph-back","marginLeft"),flexShrink:0};/* @__PURE__ */
|
|
81
|
+
return v(p,{style:{minHeight:Sa(".ph-head","height"),paddingHorizontal:f,flexDirection:"row",alignItems:"center",gap:8,backgroundColor:s.paper,...na(d)},testID:i,children:[
|
|
82
|
+
/* @__PURE__ */y(p,{style:[g,{alignItems:"flex-start"}],children:t!==void 0?/* @__PURE__ */y(h,{onPress:t,accessibilityRole:"button",accessibilityLabel:Na,hitSlop:6,style:{width:c,height:c,marginLeft:Sa(".ph-back","marginLeft"),alignItems:"center",justifyContent:"center"},testID:i!==void 0?`${i}-back`:void 0,children:/* @__PURE__ */y(p,{style:{transform:[{scaleX:-1}]},accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */y(ChevronGlyph,{size:Sa(".ph-back svg","width"),color:u,direction:"right"})})}):null}),e.trim().length>0?/* @__PURE__ */y(Text,{accessibilityRole:"header",numberOfLines:1,tier:"heading",style:{...face(l,"bold"),flex:1,minWidth:0,textAlign:"center",fontSize:Sa(".ph-title","fontSize"),lineHeight:Sa(".ph-title","fontSize")*1.2,color:u},children:e}):/* @__PURE__ */y(p,{style:{flex:1},accessibilityElementsHidden:true,importantForAccessibility:"no",testID:i!==void 0?`${i}-spacer`:void 0}),
|
|
83
|
+
/* @__PURE__ */y(p,{style:[g,{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:4}],children:r})]})}var Ma="Everfur summarizes what your vet recorded. It is informational, not diagnostic.";function Ua(e){return[e.surface,e.surfaceCream,e.surfaceSubtle,e.background,e.chatGround,e.composerFill]}function La(e){if(e.brightness!=="light")return false;let t=Mr.color,r=e.color,n=(e,t)=>parseColor(e)===parseColor(t),i=new Set(Ua(t));return n(r.brand,t.brand)&&n(r.accent,t.accent)&&Ua(r).every(e=>i.has(e))}function SkeletonBlock({width:e,height:t,radius:r,style:n}){let{color:i,radius:a}=useEverfurTheme();/* @__PURE__ */
|
|
84
|
+
return y(p,{style:[{width:e,height:t,borderRadius:r??a.xs,backgroundColor:i.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}function LabSkeleton({testID:e="everfur-records-lab-loading"}){/* @__PURE__ */
|
|
85
|
+
return v(p,{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:_n.loading,testID:e,style:{paddingTop:Sa(".efh-lab","paddingTop")+Sa(".efh-titles","paddingTop"),paddingHorizontal:Sa(".efh-lab","paddingLeft"),gap:16},children:[
|
|
86
|
+
/* @__PURE__ */v(p,{style:{gap:Sa(".efh-titles","gap")+6},children:[
|
|
87
|
+
/* @__PURE__ */y(SkeletonBlock,{width:90,height:Sa(".efh-title","fontSize"),radius:6}),
|
|
88
|
+
/* @__PURE__ */y(SkeletonBlock,{width:"70%",height:Sa(".efh-smeta","fontSize"),radius:6})]}),
|
|
89
|
+
/* @__PURE__ */y(SkeletonBlock,{width:"100%",height:260,radius:20}),
|
|
90
|
+
/* @__PURE__ */y(SkeletonBlock,{width:"100%",height:120,radius:20})]})}var Wa=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var Va={accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",pointerEvents:"none"};Sa(".efh-stage","height")*Ta(".efh-stage__pet","height");var qa=createContext(null);qa.Provider;function ChartLine({points:e,color:t}){let[n,i]=r(null),a=e=>{let{width:t,height:r}=e.nativeEvent.layout;(n===null||n.w!==t||n.h!==r)&&i({w:t,h:r})},l=n===null?[]:e.slice(1).map((t,r)=>{let i=e[r]??t,a=i.x/100*n.w,l=i.y/100*n.h,o=t.x/100*n.w,s=t.y/100*n.h,d=Math.hypot(o-a,s-l),u=Math.atan2(s-l,o-a)*180/Math.PI;return{key:r,left:(a+o)/2-d/2,top:(l+s)/2-.75,length:d,angle:u}});/* @__PURE__ */
|
|
91
|
+
return y(p,{style:Wa,onLayout:a,...Va,children:l.map(e=>/* @__PURE__ */y(p,{style:{position:"absolute",left:e.left,top:e.top,width:e.length,height:1.5,backgroundColor:t,transform:[{rotate:`${e.angle}deg`}]}},e.key))})}var Ga=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Ga,t)?Ga[t]:null}var Ka=/* @__PURE__ */Object.freeze([
|
|
92
|
+
/* @__PURE__ */Object.freeze({background:"#ffbdbd",foreground:"#6d1d14"}),
|
|
93
|
+
/* @__PURE__ */Object.freeze({background:"#a0c4f6",foreground:"#0b3a73"}),
|
|
94
|
+
/* @__PURE__ */Object.freeze({background:"#fbc558",foreground:"#10462e"}),
|
|
95
|
+
/* @__PURE__ */Object.freeze({background:"#bde7c5",foreground:"#0e3b22"}),
|
|
96
|
+
/* @__PURE__ */Object.freeze({background:"#dcc7f4",foreground:"#3a1d6a"}),
|
|
97
|
+
/* @__PURE__ */Object.freeze({background:"#ffd8a8",foreground:"#5a2a04"})]);function Qa(e){let t=0;for(let r=0;r<e.length;r+=1)t=t*31+e.charCodeAt(r)>>>0;return Ka[t%Ka.length]}function Ya(e){let t=(e??"").trim();return(Array.from(t)[0]??"?").toUpperCase()}function $a(e){return{...Qa(e.petRef),initial:Ya(e.name)}}function Ja(e,t,r){let n=$a(e);return t?n:{background:r.fill,foreground:r.ink,initial:n.initial}}function Za(e){return Math.max(12,Math.round(e*.42))}function PetDisc({pet:e,size:t,ringStroke:r}){let i=useEverfurTheme(),a=n(()=>Xa(i),[i]),l=t-r*2,o=e===null?null:Ja(e,La(i),{fill:i.color.highlight,ink:i.color.onHighlight}),s=Za(l);/* @__PURE__ */
|
|
98
|
+
return y(Ring,{size:t,strokeWidth:r,color:i.color.mark,children:/* @__PURE__ */y(p,{style:[a.disc,{width:l,height:l,borderRadius:l/2},o===null?a.discEmpty:{backgroundColor:o.background}],children:/* @__PURE__ */y(Text,{tier:"badge",style:[a.letter,{fontSize:s,lineHeight:Math.round(s*1.2),color:o===null?i.color.text.muted:o.foreground}],children:o===null?Ya(null):o.initial})})})}function Xa(e){return f.create({disc:{alignItems:"center",justifyContent:"center",overflow:"hidden"},discEmpty:{backgroundColor:e.color.brandSoft},letter:{...face(e,"bold"),textAlign:"center",includeFontPadding:false}})}function el(e){let[t,n]=r(null);return{shown:e!==null&&t!==e,onError:()=>n(e)}}function BrandImage({uri:e,label:t,decorative:r=false,style:n,resizeMode:i="contain",fallback:a=null,onError:l,testID:o}){let s=el(e);if(e===null||!s.shown)return a;let d=r?{accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"}:{accessible:true,accessibilityRole:"image",...t===void 0?{}:{accessibilityLabel:t}};/* @__PURE__ */
|
|
99
|
+
return y(c,{source:{uri:e},style:n,resizeMode:i,...d,onError:()=>{s.onError(),l?.()},...o===void 0?{}:{testID:o}})}var tl=/* @__PURE__ */Object.freeze({temperature:"Temperature",heartRate:"Heart rate",breathing:"Breathing",vitalsLabel:e=>`Vitals at ${e}’s last exam`,vitalLabel:(e,t,r,n=true)=>`${e}, ${t} ${r}.${n?" More about it":""}`,sayLine:"I wonder what I may be hiding",sayPhrases:["Hmmm","I wonder","what I may be","hiding"],upcomingCare:"Upcoming Care",viewAll:"View all →",dueSoon:"Due soon",later:"Later",nothingDue:e=>`Nothing due for ${e} right now.`,overdueBy:e=>`Overdue by ${e} ${e===1?"day":"days"}`,dueToday:"Due today",dueIn:e=>`Due in ${e} ${e===1?"day":"days"}`,noDueDate:"No due date on file",withDue:(e,t)=>`${e} · due ${t}`,dueOn:e=>`Due ${e}`,thisDay:(e,t)=>`${e} · this ${t}`,inWeeks:(e,t)=>`${e} · in ${t} ${t===1?"week":"weeks"}`,recordsHistory:"Records & History",labs:"Labs & bloodwork",labsA11y:(e,t)=>`Labs and bloodwork, ${e} ${t}`,labsA11yUnknown:"Labs and bloodwork",labsCountUnknown:"--",screenings:"Screenings",screeningsA11y:e=>`Screenings${e!==null?`, ${e}`:""}`,toReview:e=>`${e} to review`,allClear:"All clear",visits:"Visits & records",visitsA11y:e=>`Visits and records${e!==null?`, latest ${e}`:""}`,timeline:"Timeline",events:e=>`${e} events`,timelineA11y:e=>`Timeline${e>0?`, ${e} events`:""}`,weight:"Weight",estimatedRange:"Estimated Optimal Adult Range",noWeights:e=>`No weights on file yet. They show up here from ${e}’s vet visits.`,legendOver:["OVER","WEIGHT"],legendStable:["STABLE"],legendUnder:["UNDER","WEIGHT"],trendSummary:(e,t,r,n,i)=>`${e===1?"1 reading":`${e} readings`}, latest ${t}${e===1?"":`, trend ${r}`}.${n!==null&&i!==null?` Healthy range ${n} to ${i}.`:""}`,pointLabel:(e,t,r)=>e!==null?`${e}, ${t} ${r}`:`${t} ${r}`,addRecords:e=>`Add ${e}’s records`,moreThanOneClinic:"Records can come from more than one clinic over a lifetime.",onFileNow:"On file now",videoVisit:"Everfur video visit",requestFromClinic:"Request from a clinic",uploadDocument:"Upload a document",onTheWay:e=>`${e}’s records are on the way`,clinicsTake:"Clinics usually take 2 to 5 days.",requestSentTo:e=>e!==null?`Request sent to ${e}`:"Request sent",signedRelease:e=>`${e} · you signed the release`,waitingFor:e=>`Waiting for ${e} records`,inHealthTab:e=>`In ${e} Health tab`,everyPageRead:"Every page read: vaccines, labs, visits, meds",today:"Today",anotherClinic:"Another clinic",anotherClinicText:"Seen more than one vet? We ask each one.",uploadText:"A PDF, or a photo of a paper record.",requestTitle:e=>`${e}’s records request`,requestA11y:(e,t)=>`Records request for ${e}. ${t}`,sample:"Sample",peekLead:e=>`A sneak peek at how ${e}’s records will read. Every number links back to the page it came from.`,previousGroup:"Previous group",nextGroup:"Next group",markerGroups:"Marker groups",sampleNotTheirs:e=>`This is a sample, not ${e}’s result.`,sampleNote:e=>` Add ${e} records to see ${e} own numbers. Anything outside the range gets flagged like this, with what it measures and what to ask ${e} vet.`,columns:["Test","Result","Unit","Range"],slideOf:(e,t,r)=>`${e}, ${t} of ${r}`,high:"High",legal:Ma,noVetTitle:e=>`When ${e.name} has a vet, start here.`});var rl=16,nl=8,il=64,al=26,ll=32,ol=34,sl=88,dl=14,ul=16,cl=22,pl=17,hl=22,fl=72,gl=6,bl=14,ml=20;function yl(){let{theme:e,look:t}=Ha();return n(()=>{let r={...t,ink:e.color.text.primary},n=e.color.brandBorder,i={...face(e,"mono"),color:r.muted,textTransform:"uppercase"};return{theme:e,look:r,edge:n,section:{...headingFace(e,"bold"),fontSize:pl,lineHeight:hl,color:r.ink},label:{...face(e,"bold"),fontSize:15,lineHeight:20,color:r.ink},body:{...face(e,"regular"),fontSize:14,lineHeight:20,color:r.ink},fine:{...face(e,"regular"),fontSize:13,lineHeight:18,color:r.muted},monoTile:{...i,fontSize:11,lineHeight:14,letterSpacing:.44},monoMeta:{...i,fontSize:12,lineHeight:16,letterSpacing:.24},tile:{minHeight:sl,padding:dl,borderRadius:ul,backgroundColor:r.mist,justifyContent:"space-between"},card:{padding:rl,borderRadius:ml,borderWidth:1,borderColor:n,backgroundColor:r.white}}},[e,t])}function TabsPetHead({petRef:petRef,name:e,meta:t,pill:r,photoUrl:n,onShare:i,shareLabel:a}){let l=yl(),o=/* @__PURE__ */y(PetDisc,{pet:{petRef:petRef,name:e},size:il,ringStroke:0});/* @__PURE__ */
|
|
100
|
+
return v(p,{style:{flexDirection:"row",alignItems:"center",gap:12,marginTop:-8,marginBottom:8},testID:"everfur-records-tabs-head",children:[n!==null&&n.length>0?/* @__PURE__ */y(BrandImage,{uri:n,label:e,decorative:true,style:{width:il,height:il,borderRadius:il/2},resizeMode:"cover",fallback:o,testID:"everfur-records-tabs-photo"}):o,
|
|
101
|
+
/* @__PURE__ */v(p,{style:{flex:1,minWidth:0,gap:4},children:[
|
|
102
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",columnGap:nl},children:[
|
|
103
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:{...headingFace(l.theme,"bold"),fontSize:al,lineHeight:ll,color:l.look.ink},children:e}),r?.tone==="stable"?/* @__PURE__ */y(p,{style:{minHeight:24,paddingHorizontal:10,borderRadius:999,justifyContent:"center",backgroundColor:l.look.tintGo},testID:"everfur-records-tabs-pill",children:/* @__PURE__ */y(Text,{tier:"compact",numberOfLines:1,style:[l.monoMeta,{color:l.look.ink}],children:r.label})}):r!==null?/* @__PURE__ */y(HubPill,{label:r.label,tone:r.tone,testID:"everfur-records-tabs-pill"}):null]}),t!==null?/* @__PURE__ */y(Text,{tier:"compact",style:l.monoMeta,testID:"everfur-records-tabs-meta",children:t}):null]}),i!==void 0?/* @__PURE__ */y(h,{onPress:i,accessibilityRole:"button",accessibilityLabel:a,hitSlop:6,style:{width:ol,height:ol,borderRadius:ol/2,borderWidth:1,borderColor:l.edge,backgroundColor:l.look.white,alignItems:"center",justifyContent:"center",alignSelf:"flex-start"},testID:"everfur-records-tabs-share",children:/* @__PURE__ */y(TabsIcon,{name:"plane",size:18,color:l.theme.color.primary})}):null]})}var vl={temp:"thermo",heart:"heart",breath:"wind"};function TabsVitals({title:e,vitals:t}){let r=yl();return t.length===0?null:/* @__PURE__ */v(p,{style:{gap:10},testID:"everfur-records-tabs-vitals",children:[e!==null?/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:r.section,children:e}):null,
|
|
104
|
+
/* @__PURE__ */y(p,{style:{flexDirection:"row",gap:nl},children:t.map(e=>/* @__PURE__ */v(p,{accessible:true,accessibilityLabel:`${e.label}, ${e.value}${e.unit?` ${e.unit}`:""}`,style:[r.tile,{flex:1,flexBasis:0,minWidth:0}],testID:`everfur-records-tabs-vital-${e.kind}`,children:[
|
|
105
|
+
/* @__PURE__ */y(TabsIcon,{name:vl[e.kind],size:cl,color:r.theme.color.primary}),
|
|
106
|
+
/* @__PURE__ */v(p,{children:[
|
|
107
|
+
/* @__PURE__ */y(Text,{style:r.label,numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.8,children:e.unit?`${e.value} ${e.unit}`:e.value}),
|
|
108
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:r.monoTile,numberOfLines:1,children:e.label})]})]},e.kind))})]})}function wl(e){let t=e===null?null:/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);return t===null?e:Tn(Date.UTC(Number(t[3]),Number(t[1])-1,Number(t[2])))}function TabsTiles({tiles:e,labsUnknown:t,screeningsWords:r,onOpenLabs:n,onOpenScreenings:i,onOpenVisits:a,onOpenTimeline:l}){let o=yl(),s=wl(e.visitDate),d=r??e.screeningsPill?.label??null,u=[{key:"labs",icon:"flask",title:tl.labs,foot:t?tl.labsCountUnknown:`${e.labsTotal} ${e.labsNoun}`,label:t?tl.labsA11yUnknown:tl.labsA11y(e.labsTotal,e.labsNoun),onOpen:n},{key:"screenings",icon:"shield",title:tl.screenings,foot:d??Bn.noScreenings,label:tl.screeningsA11y(d),onOpen:i,alert:r===null&&e.screeningsPill?.tone==="high"},{key:"record",icon:"folder",title:tl.visits,foot:s??Bn.noVisits,label:tl.visitsA11y(s),onOpen:a},{key:"timeline",icon:"clock",title:tl.timeline,foot:tl.events(e.timelineCount),label:tl.timelineA11y(e.timelineCount),onOpen:l}];/* @__PURE__ */
|
|
109
|
+
return v(p,{style:{gap:10,marginTop:15},testID:"everfur-records-tabs-tiles",children:[
|
|
110
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:o.section,children:Pn.recordsHistory}),
|
|
111
|
+
/* @__PURE__ */y(p,{style:{flexDirection:"row",flexWrap:"wrap",gap:nl},children:u.map(e=>/* @__PURE__ */v(h,{onPress:e.onOpen,disabled:e.onOpen===void 0,accessibilityRole:"button",accessibilityLabel:e.label,accessibilityState:{disabled:e.onOpen===void 0},style:[o.tile,{flexGrow:1,flexBasis:"45%",minWidth:0}],testID:`everfur-records-sheet-tile-${e.key}`,children:[
|
|
112
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[
|
|
113
|
+
/* @__PURE__ */y(TabsIcon,{name:e.icon,size:cl,color:o.theme.color.primary}),e.onOpen!==void 0?/* @__PURE__ */y(ChevronGlyph,{size:14,color:o.look.muted,direction:"right"}):null]}),
|
|
114
|
+
/* @__PURE__ */v(p,{children:[
|
|
115
|
+
/* @__PURE__ */y(Text,{style:o.label,numberOfLines:2,children:e.title}),
|
|
116
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:[o.monoTile,e.alert===true?{color:o.look.alert}:null],numberOfLines:1,children:e.foot})]})]},e.key))})]})}function TabsUpcoming({rows:e,emptyText:t,onViewAll:r,renderAction:n}){let i=yl();/* @__PURE__ */
|
|
117
|
+
return v(p,{style:{gap:10,marginTop:16},testID:"everfur-records-tabs-upcoming",children:[
|
|
118
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:nl},children:[
|
|
119
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:[i.section,{flexShrink:1}],children:Pn.upcomingCare}),r!==void 0&&e.length>0?/* @__PURE__ */y(h,{onPress:r,accessibilityRole:"button",hitSlop:8,testID:"everfur-records-tabs-view-all",children:/* @__PURE__ */y(Text,{tier:"control",style:{...face(i.theme,"bold"),fontSize:14,lineHeight:20,color:i.theme.color.primary},children:Pn.viewAll})}):null]}),e.length===0?/* @__PURE__ */y(Text,{style:i.fine,children:t}):/* @__PURE__ */y(p,{style:{gap:nl},children:e.map(e=>{let t=e.tone==="overdue";/* @__PURE__ */
|
|
120
|
+
return v(p,{style:{borderRadius:bl,paddingHorizontal:12,paddingVertical:10,backgroundColor:t?i.look.tintRed:i.look.mist,gap:nl},testID:`everfur-records-tabs-care-${t?"overdue":e.tone}`,children:[
|
|
121
|
+
/* @__PURE__ */v(p,{style:{gap:1},children:[
|
|
122
|
+
/* @__PURE__ */y(Text,{style:[i.label,t?{color:i.look.alertDeep}:null],children:e.label}),
|
|
123
|
+
/* @__PURE__ */y(Text,{style:[i.fine,t?{color:i.look.alert}:null],children:e.when})]}),n?.(e)??null]},e.key)})})]})}function TabsLabsScreen({petRef:petRef,onOpenMarker:e,foot:t,style:r}){let i=useRecordsMarkers(petRef),a=n(()=>Nn(i.markers),[i.markers]);return a===null?i.status==="loading"?/* @__PURE__ */y(LabSkeleton,{}):i.status==="error"?/* @__PURE__ */y(RecordsEmptyState,{variant:Un(i.error),onAction:i.refresh,testID:"everfur-records-labs-error"}):/* @__PURE__ */y(RecordsEmptyState,{variant:"no_records",testID:"everfur-records-labs-empty"}):/* @__PURE__ */y(LabsBody,{model:a,onOpenMarker:e,foot:t,style:r})}function LabsBody({model:e,onOpenMarker:t,foot:n,style:i}){let a=yl(),[l,o]=r(()=>Mn(e)),s=e.panels.find(e=>e.key===l)??e.panels[0]??null,d=e.watch;/* @__PURE__ */
|
|
124
|
+
return v(g,{contentContainerStyle:[{padding:rl,gap:12},i],testID:"everfur-records-labs",children:[
|
|
125
|
+
/* @__PURE__ */v(p,{style:{gap:4},children:[
|
|
126
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:{...headingFace(a.theme,"bold"),fontSize:24,lineHeight:28,color:a.look.ink},children:Pn.labsTitle}),
|
|
127
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:a.monoMeta,testID:"everfur-records-labs-meta",children:e.meta})]}),d!==null?/* @__PURE__ */v(h,{onPress:()=>t(d.markerId),accessibilityRole:"button",style:{flexDirection:"row",alignItems:"center",gap:10,paddingLeft:14,paddingRight:12,paddingVertical:12,borderRadius:ul,backgroundColor:a.look.tintRed},testID:"everfur-records-labs-watch",children:[
|
|
128
|
+
/* @__PURE__ */y(TabsIcon,{name:"alert",size:20,color:a.look.alert}),
|
|
129
|
+
/* @__PURE__ */v(Text,{style:[a.body,{flex:1,minWidth:0,color:a.look.alertDeep}],children:[
|
|
130
|
+
/* @__PURE__ */y(Text,{style:{...face(a.theme,"bold")},children:Pn.toWatch(d.count)}),d.date!==null?d.side==="above"?Pn.aboveOn(d.name,d.date):Pn.belowOn(d.name,d.date):""]}),
|
|
131
|
+
/* @__PURE__ */y(ChevronGlyph,{size:14,color:a.look.alertDeep,direction:"right"})]}):null,
|
|
132
|
+
/* @__PURE__ */y(Glance,{model:e}),e.panels.length>1?/* @__PURE__ */v(g,{horizontal:true,showsHorizontalScrollIndicator:false,accessibilityLabel:Pn.panels,contentContainerStyle:{gap:nl},style:{marginHorizontal:-rl},testID:"everfur-records-labs-chips",children:[
|
|
133
|
+
/* @__PURE__ */y(p,{style:{width:rl-nl}}),e.panels.map(e=>{let t=e.key===s?.key;/* @__PURE__ */
|
|
134
|
+
return y(h,{onPress:()=>o(e.key),accessibilityRole:"button",accessibilityState:{selected:t},hitSlop:4,style:{minHeight:36,paddingHorizontal:14,borderRadius:999,justifyContent:"center",borderWidth:1,borderColor:t?a.theme.color.primary:a.edge,backgroundColor:t?a.theme.color.primary:a.look.white},testID:`everfur-records-labs-chip-${e.key}`,children:/* @__PURE__ */y(Text,{tier:"compact",numberOfLines:1,style:{...face(a.theme,t?"bold":"medium"),fontSize:14,lineHeight:20,color:t?a.theme.color.onPrimary:a.look.ink},children:e.title})},e.key)}),
|
|
135
|
+
/* @__PURE__ */y(p,{style:{width:rl-nl}})]}):null,s!==null?/* @__PURE__ */y(PanelCard,{panel:s,onOpenMarker:t}):null,n]})}function Glance({model:e}){let t=yl(),r=e.inRange+e.outOfRange,n=r>0?e.outOfRange/r:0;/* @__PURE__ */
|
|
136
|
+
return v(p,{style:[t.card,{flexDirection:"row",alignItems:"center",gap:18}],testID:"everfur-records-labs-glance",children:[
|
|
137
|
+
/* @__PURE__ */v(p,{style:{width:fl,height:fl,alignItems:"center",justifyContent:"center"},accessible:true,accessibilityLabel:`${e.total} ${Pn.markers}`,children:[
|
|
138
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",width:fl,height:fl,borderRadius:fl/2,borderWidth:gl,borderColor:e.inRange>0?t.look.go:t.look.line}}),n>0?n>=.25?/* @__PURE__ */y(p,{style:{position:"absolute",width:fl,height:fl,borderRadius:fl/2,borderWidth:gl,borderColor:"transparent",borderTopColor:t.look.alert,borderRightColor:n>=.5?t.look.alert:"transparent",transform:[{rotate:"45deg"}]},testID:"everfur-records-labs-ring-out"}):/* @__PURE__ */y(p,{style:{position:"absolute",top:0,width:gl,height:gl,borderRadius:gl/2,backgroundColor:t.look.alert},testID:"everfur-records-labs-ring-out"}):null,
|
|
139
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:{...headingFace(t.theme,"bold"),fontSize:22,lineHeight:26,color:t.look.ink},children:e.total}),
|
|
140
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:{...face(t.theme,"regular"),fontSize:11,lineHeight:14,color:t.look.muted},children:Pn.markers})]}),
|
|
141
|
+
/* @__PURE__ */v(p,{style:{flex:1,minWidth:0,gap:6},children:[
|
|
142
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:t.section,children:Pn.atAGlance}),
|
|
143
|
+
/* @__PURE__ */y(Dot,{color:t.look.go,text:Pn.inRange(e.inRange)}),e.outOfRange>0?/* @__PURE__ */y(Dot,{color:t.look.alert,text:Pn.outOfRange(e.outOfRange,e.outNames)}):null]})]})}function Dot({color:e,text:t}){let r=yl();/* @__PURE__ */
|
|
144
|
+
return v(p,{style:{flexDirection:"row",alignItems:"center",gap:nl},children:[
|
|
145
|
+
/* @__PURE__ */y(p,{style:{width:8,height:8,borderRadius:4,backgroundColor:e}}),
|
|
146
|
+
/* @__PURE__ */y(Text,{style:[r.body,{flexShrink:1}],children:t})]})}function PanelCard({panel:e,onOpenMarker:t}){let r=yl();/* @__PURE__ */
|
|
147
|
+
return v(p,{style:[r.card,{gap:6}],testID:`everfur-records-labs-panel-${e.key}`,children:[
|
|
148
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:nl},children:[
|
|
149
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:[r.section,{flexShrink:1}],children:e.title}),e.toWatch>0?/* @__PURE__ */y(HubPill,{label:Pn.toWatchTag(e.toWatch),tone:"high",small:true}):null]}),
|
|
150
|
+
/* @__PURE__ */y(Text,{tier:"compact",style:r.monoTile,children:e.meta}),
|
|
151
|
+
/* @__PURE__ */y(p,{style:{gap:2,marginTop:4},children:e.rows.map(e=>/* @__PURE__ */v(h,{onPress:()=>t(e.markerId),accessibilityRole:"button",accessibilityLabel:[e.name,e.flagged?e.flag==="above"?Pn.high:Pn.below:null,`${e.value}${e.unit?` ${e.unit}`:""}`,e.range].filter(e=>e!==null).join(", "),style:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:12,paddingVertical:10,borderRadius:12,backgroundColor:e.flagged?r.look.tintRed:"transparent"},testID:`everfur-records-labs-row-${e.markerId}`,children:[
|
|
152
|
+
/* @__PURE__ */v(p,{style:{flex:1,minWidth:0,gap:2},children:[
|
|
153
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:nl},children:[
|
|
154
|
+
/* @__PURE__ */y(Text,{style:r.label,children:e.name}),e.flagged?/* @__PURE__ */y(HubPill,{label:e.flag==="above"?Pn.high:Pn.below,tone:"high",small:true}):null]}),
|
|
155
|
+
/* @__PURE__ */v(Text,{style:{...face(r.theme,"regular"),fontSize:12,lineHeight:20,color:r.look.muted},children:[
|
|
156
|
+
/* @__PURE__ */y(Text,{style:{...headingFace(r.theme,"bold"),fontSize:15,color:e.flagged?r.look.alert:r.look.ink},children:e.value}),[e.unit,e.range!==null?e.range.replace(e.unit!==null?` ${e.unit}`:"",""):null].filter(e=>e!==null&&e.length>0).map((t,r)=>r===0&&e.unit!==null?` ${t}`:` · ${t}`).join("")]})]}),e.at!==null?/* @__PURE__ */y(RangeBar,{at:e.at,flagged:e.flagged}):null]},e.markerId))})]})}function RangeBar({at:e,flagged:t}){let r=yl();/* @__PURE__ */
|
|
157
|
+
return v(p,{style:{width:90,height:12,justifyContent:"center"},accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:[
|
|
158
|
+
/* @__PURE__ */y(p,{style:{height:4,borderRadius:2,backgroundColor:r.edge}}),
|
|
159
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",left:"20%",right:"20%",height:4,borderRadius:2,backgroundColor:r.look.tintGo}}),
|
|
160
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",left:`${e}%`,marginLeft:-4,width:8,height:8,borderRadius:4,backgroundColor:t?r.look.alert:r.look.go}})]})}function TabsDeepScreen({petRef:petRef,petName:e,markerId:t,title:r,onBack:a,onOpenMarker:l,shellPush:o,vetNote:s,foot:d}){let{look:u}=Ha(),c=useRecordsMarkers(petRef),h=c.markers,f=n(()=>t===null||h===null||h.withheld?null:Dn(h,t),[t,h]),g=t===null?Pn.labsWord:f?.name??null,b=g!==null&&e!==""?Pn.askAbout(e,g):void 0;i(()=>{if(o!==void 0)return o({title:r,onBack:a,...b===void 0?{}:{askPlaceholder:b}})},[o===void 0,r,b]);let m;return t===null?m=/* @__PURE__ */y(TabsLabsScreen,{petRef:petRef,onOpenMarker:l,foot:d}):f!==null?m=/* @__PURE__ */y(MarkerBody,{model:f,note:s?.(t)??null,foot:d}):c.status==="loading"?m=/* @__PURE__ */y(LabSkeleton,{}):c.status==="error"?m=/* @__PURE__ */y(RecordsEmptyState,{variant:Un(c.error),onAction:c.refresh,testID:"everfur-records-lab-error"}):m=/* @__PURE__ */y(RecordsEmptyState,{variant:"no_records",testID:"everfur-records-lab-empty"}),/* @__PURE__ */v(p,{style:{flex:1,backgroundColor:u.white},testID:t===null?"everfur-records-sheet-labs":"everfur-records-sheet-marker",children:[o===void 0?/* @__PURE__ */y(RecordsPushHeader,{title:r,onBack:a,testID:t===null?"everfur-records-labs-header":"everfur-records-lab-header"}):null,m]})}var Al=16,kl=150,_l=4,Sl=66,Cl=11;function MarkerBody({model:e,note:t,foot:r}){let{theme:n,look:i}=Ha(),a=n.color.brandBorder,l=n.color.text.primary,o={padding:Al,borderRadius:20,borderWidth:1,borderColor:a,backgroundColor:i.white},s={...headingFace(n,"bold"),fontSize:17,lineHeight:22,color:l},d=face(n,"mono"),u=e.flagged?i.alert:l,c=e.pill===null?null:e.flagged&&e.pill===Pn.high?Pn.aboveRange:e.pill;/* @__PURE__ */
|
|
161
|
+
return v(g,{contentContainerStyle:{padding:Al,paddingTop:14,gap:16},testID:`everfur-records-lab-${e.markerId}`,children:[
|
|
162
|
+
/* @__PURE__ */v(p,{style:{gap:4},children:[
|
|
163
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:{...headingFace(n,"bold"),fontWeight:"800",fontSize:26,lineHeight:32,color:l},children:e.name}),e.meta!==null?/* @__PURE__ */y(Text,{tier:"compact",style:{...d,fontSize:12,lineHeight:16,color:i.muted},children:e.meta}):null]}),
|
|
164
|
+
/* @__PURE__ */v(p,{style:[o,{gap:4}],children:[
|
|
165
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},children:[
|
|
166
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:s,children:Pn.latestReading}),c!==null?/* @__PURE__ */y(HubPill,{label:c,tone:e.flagged?"high":"later",small:true}):null]}),
|
|
167
|
+
/* @__PURE__ */y(Text,{style:{...headingFace(n,"bold"),fontWeight:"800",fontSize:34,lineHeight:42,color:u},children:e.latest}),
|
|
168
|
+
/* @__PURE__ */y(Text,{style:{...face(n,"regular"),fontSize:13,lineHeight:18,color:i.muted},children:e.latestSub}),
|
|
169
|
+
/* @__PURE__ */y(MarkerChart,{model:e})]}),t!==null?/* @__PURE__ */v(p,{style:[o,{gap:10}],testID:"everfur-records-lab-vet-note",children:[
|
|
170
|
+
/* @__PURE__ */y(Text,{tier:"heading",accessibilityRole:"header",style:s,children:Pn.vetNoted}),
|
|
171
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"center",gap:8},children:[
|
|
172
|
+
/* @__PURE__ */y(Text,{style:{...face(n,"bold"),fontSize:13,lineHeight:18,color:l},children:Pn.fromRecord}),
|
|
173
|
+
/* @__PURE__ */y(HubPill,{label:Pn.wordForWord,tone:"later",small:true})]}),
|
|
174
|
+
/* @__PURE__ */y(p,{style:{padding:14,borderRadius:12,backgroundColor:i.mist},children:/* @__PURE__ */y(Text,{style:{...face(n,"regular"),fontSize:16,lineHeight:23,color:l},children:`“${t.quote}”`})}),t.source!==void 0||t.onViewSource!==void 0?/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"flex-start",gap:6},children:[
|
|
175
|
+
/* @__PURE__ */y(TabsIcon,{name:"file",size:14,color:i.muted}),
|
|
176
|
+
/* @__PURE__ */v(Text,{style:{...face(n,"regular"),flex:1,fontSize:12,lineHeight:17,color:i.muted},children:[t.source!==void 0?`${t.source} `:"",t.onViewSource!==void 0?/* @__PURE__ */y(Text,{onPress:t.onViewSource,accessibilityRole:"link",style:{...face(n,"bold"),color:n.color.primary,textDecorationLine:"underline"},children:Pn.viewSource}):null]})]}):null]}):null,e.meaning.length>0?/* @__PURE__ */y(p,{style:[o,{gap:8}],children:e.meaning.map((e,t)=>/* @__PURE__ */y(Text,{style:{...face(n,"regular"),fontSize:14,lineHeight:20,color:l},children:e},t))}):null,r]})}function MarkerChart({model:e}){let{theme:t,look:r}=Ha();if(e.chart.length===0)return null;let n=e.hasRange,i=t.color.text.primary,a={...face(t,"mono"),fontSize:9,lineHeight:11,letterSpacing:.36,color:r.muted,textTransform:"uppercase"},l=n?Sl+_l:0;/* @__PURE__ */
|
|
177
|
+
return v(p,{style:{marginTop:8},accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:[
|
|
178
|
+
/* @__PURE__ */v(p,{style:{height:kl,marginBottom:-22},children:[n?/* @__PURE__ */v(w,{children:[
|
|
179
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",left:0,top:4,width:_l,height:36,backgroundColor:t.color.brandBorder}}),
|
|
180
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",left:0,top:40,width:_l,height:52,backgroundColor:r.go}}),
|
|
181
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",left:0,top:92,width:_l,height:28,backgroundColor:t.color.brandBorder}}),
|
|
182
|
+
/* @__PURE__ */y(Text,{style:[a,{position:"absolute",left:10,top:6,width:44}],children:Pn.aboveRange}),
|
|
183
|
+
/* @__PURE__ */y(Text,{style:[a,{position:"absolute",left:10,top:50,width:44}],children:Pn.inRangeWord}),
|
|
184
|
+
/* @__PURE__ */y(Text,{style:[a,{position:"absolute",left:10,top:91,width:44}],children:Pn.belowRange}),
|
|
185
|
+
/* @__PURE__ */y(p,{style:{position:"absolute",left:l+6,right:0,top:40,height:52,backgroundColor:r.tintGo}})]}):null,
|
|
186
|
+
/* @__PURE__ */v(p,{style:{position:"absolute",left:l+6,right:0,top:0,bottom:0},children:[e.chart.length>1?/* @__PURE__ */y(ChartLine,{points:e.chart,color:i}):null,e.chart.map((t,n)=>{let i=n===e.chart.length-1;/* @__PURE__ */
|
|
187
|
+
return y(p,{style:{position:"absolute",left:`${t.x}%`,top:`${t.y}%`,width:Cl,height:Cl,marginLeft:-Cl/2,marginTop:-Cl/2,borderRadius:Cl/2,borderWidth:1.5,borderColor:r.white,backgroundColor:t.out&&i?ae.watchYellow:t.out?r.alert:r.go}},n)}),e.chart.map((e,r)=>/* @__PURE__ */y(Text,{style:{...face(t,"monoMedium"),position:"absolute",left:`${e.x}%`,top:`${e.y}%`,width:40,marginLeft:-20,marginTop:-22,textAlign:"center",fontSize:10,lineHeight:14,color:i},children:e.label},`v${r}`))]})]}),
|
|
188
|
+
/* @__PURE__ */y(p,{style:{height:16,marginLeft:l+6},children:e.chart.map((e,n)=>/* @__PURE__ */y(Text,{style:{...face(t,"mono"),position:"absolute",left:`${e.x}%`,width:56,marginLeft:-28,textAlign:"center",fontSize:10,lineHeight:14,color:r.muted},children:e.tick},n))})]})}var Tl=/* @__PURE__ */Object.freeze(["ask","plan","records"]),Rl=Tl,zl=/* @__PURE__ */Object.freeze(["ask","records"]);function Ol(e,t){if(El(e,Rl))return t.listAll;if(El(e,zl))return t.listNoPlan;let r=e.map(e=>t[e]);return r.length<=1?r[0]??"":`${r.slice(0,-1).join(", ")} and ${r[r.length-1]??""}`}function El(e,t){return e.length===t.length&&e.every((e,r)=>e===t[r])}function Il(e,t){return e.replace(/\{([a-zA-Z]+)\}/g,(e,r)=>t[r]??(r==="pet"?t.petName:void 0)??"")}var jl=60,xl=16,Fl=32,Dl=14,Bl=34,Pl=18,Hl=14,Nl=120,Ml=26,Ul=10,Ll=9,Wl=11,Vl=43,ql=15,Gl=40,Kl=15,Ql=20,Yl=3,$l=6;function TabsBarHeader({options:e,pushed:t,petRef:petRef,petName:r,copy:n,onClose:i,onAddToCalendar:a}){let l=useEverfurTheme(),o=l.slots.header?.backgroundColor??l.color.surface,s=l.slots.header?.textColor??l.color.text.primary,d=l.color.text.muted,u=V(s,.11)??l.color.surfaceSubtle,c={width:Bl,height:Bl,borderRadius:Bl/2,backgroundColor:o,borderWidth:1,borderColor:u,alignItems:"center",justifyContent:"center"},f=e.mark??(l.meta.logoUrl===null?null:/* @__PURE__ */y(BrandImage,{uri:l.meta.logoUrl,label:l.meta.displayName,decorative:true,style:{height:Hl,width:Nl},resizeMode:"contain"})),g=t!==null?/* @__PURE__ */y(h,{onPress:t.onBack,accessibilityRole:"button",accessibilityLabel:n.back,hitSlop:4,style:c,testID:"everfur-tabsbar-back",children:/* @__PURE__ */y(TabsIcon,{name:"back",size:Pl,color:s})}):/* @__PURE__ */y(PetPicker,{options:e,petRef:petRef,petName:r,ink:s,copy:n});/* @__PURE__ */
|
|
189
|
+
return v(p,{style:[{height:jl,flexDirection:"row",alignItems:"center",paddingHorizontal:xl,backgroundColor:o},t!==null?{borderBottomWidth:1,borderBottomColor:l.color.surfaceSubtle}:null],testID:"everfur-tabsbar-header",children:[a===void 0?null:/* @__PURE__ */y(_,{onAddToCalendar:a}),
|
|
190
|
+
/* @__PURE__ */y(p,{style:{flex:1,flexBasis:0,flexDirection:"row",alignItems:"center"},children:g}),
|
|
191
|
+
/* @__PURE__ */y(k,{children:/* @__PURE__ */v(p,{accessible:true,accessibilityLabel:Il("{name}, {by}",{name:l.meta.displayName,by:n.poweredByLabel}),style:{flexDirection:"row",alignItems:"center",flexShrink:1},testID:"everfur-tabsbar-lockup",children:[f,
|
|
192
|
+
/* @__PURE__ */y(p,{style:{width:1,height:Ml,marginHorizontal:Ul,backgroundColor:l.color.brandBorder}}),
|
|
193
|
+
/* @__PURE__ */v(p,{children:[
|
|
194
|
+
/* @__PURE__ */y(Text,{tier:"badge",style:{...face(l,"mono"),fontSize:Ll,lineHeight:Wl,color:d},children:n.poweredBy}),
|
|
195
|
+
/* @__PURE__ */y(ShellIcon,{name:"wordmark",style:{width:Vl,height:ql,marginTop:4,tintColor:s}})]})]})}),
|
|
196
|
+
/* @__PURE__ */y(p,{style:{flex:1,flexBasis:0,flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},children:i===void 0?null:/* @__PURE__ */y(h,{onPress:i,accessibilityRole:"button",accessibilityLabel:n.close,hitSlop:4,style:c,testID:"everfur-tabsbar-close",children:/* @__PURE__ */y(TabsIcon,{name:"x",size:Pl,color:s})})})]})}function PetPicker({options:e,petRef:petRef,petName:t,ink:r,copy:n}){let i=/* @__PURE__ */y(PetDisc,{pet:petRef===null?null:{petRef:petRef,name:t},size:Fl,ringStroke:0}),a=e.petPhotoUrl!==void 0&&e.petPhotoUrl!==null&&e.petPhotoUrl!==""?/* @__PURE__ */y(BrandImage,{uri:e.petPhotoUrl,label:t,decorative:true,style:{width:Fl,height:Fl,borderRadius:Fl/2},resizeMode:"cover",fallback:i}):i,l=/* @__PURE__ */v(w,{children:[a,e.onPet===void 0?null:/* @__PURE__ */y(Chevron,{color:r})]}),o={flexDirection:"row",alignItems:"center",gap:2};return e.onPet===void 0?/* @__PURE__ */y(p,{accessible:t.trim()!=="",...t.trim()===""?{}:{accessibilityLabel:t},style:o,testID:"everfur-tabsbar-pet",children:l}):/* @__PURE__ */y(h,{onPress:e.onPet,accessibilityRole:"button",accessibilityLabel:t.trim()===""?n.choosePet:Il(n.switchPet,{petName:t}),hitSlop:4,style:o,testID:"everfur-tabsbar-pet",children:l})}function Chevron({color:e}){let t=Dl*.45;/* @__PURE__ */
|
|
197
|
+
return y(p,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",style:{width:Dl,height:Dl,alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */y(p,{style:{width:t,height:t,borderRightWidth:2,borderBottomWidth:2,borderColor:e,transform:[{translateY:-t/4},{rotate:"45deg"}]}})})}function TabsAskBar({placeholder:e,field:t,send:n,onAsk:i,onUpload:a,uploadLabel:l,testID:o}){let s=useEverfurTheme(),d=hn(s),[c,f]=r(""),g=()=>{let e=c.trim();e!==""&&(f(""),i(e))};/* @__PURE__ */
|
|
198
|
+
return y(p,{style:{paddingHorizontal:xl,paddingTop:10,paddingBottom:10,backgroundColor:s.color.surface},testID:o,children:/* @__PURE__ */v(p,{style:{minHeight:52,borderRadius:26,borderWidth:1.5,borderColor:d.accent,flexDirection:"row",alignItems:"center",paddingLeft:a===void 0?16:2,paddingRight:2},children:[a===void 0?null:/* @__PURE__ */y(h,{onPress:a,accessibilityRole:"button",accessibilityLabel:l,style:{width:44,height:44,alignItems:"center",justifyContent:"center"},testID:`${o}-upload`,children:/* @__PURE__ */y(TabsIcon,{name:"upload",size:20,color:d.accent})}),
|
|
199
|
+
/* @__PURE__ */y(u,{value:c,onChangeText:f,placeholder:d.placeholder(e,false),placeholderTextColor:d.muted,accessibilityLabel:t,onSubmitEditing:g,returnKeyType:"send",style:{...face(s,"regular"),flex:1,minWidth:0,fontSize:16,lineHeight:22,paddingVertical:12,color:d.ink},testID:`${o}-input`}),
|
|
200
|
+
/* @__PURE__ */y(h,{onPress:g,disabled:c.trim()==="",accessibilityRole:"button",accessibilityLabel:n,accessibilityState:{disabled:c.trim()===""},style:{width:44,height:44,alignItems:"center",justifyContent:"center"},testID:`${o}-send`,children:/* @__PURE__ */y(TabsIcon,{name:"send",size:22,color:d.accent})})]})})}function SubTabs({tabs:e,sub:t,copy:r,badges:n,onOpen:i,barRef:a}){let l=useEverfurTheme(),o=l.color.primary;/* @__PURE__ */
|
|
201
|
+
return v(p,{ref:a,accessibilityRole:"tablist",accessibilityLabel:Ol(e,r),style:{minHeight:Gl,flexDirection:"row",backgroundColor:l.slots.header?.backgroundColor??l.color.surface},testID:"everfur-tabs-bar",children:[
|
|
202
|
+
/* @__PURE__ */y(p,{pointerEvents:"none",style:{position:"absolute",left:0,right:0,bottom:0,height:1,backgroundColor:l.color.surfaceSubtle}}),e.map(e=>{let a=t===e;/* @__PURE__ */
|
|
203
|
+
return v(h,{accessibilityRole:"tab",accessibilityState:{selected:a},onPress:()=>i(e),style:{flex:1,flexBasis:0,alignItems:"center",justifyContent:"center",paddingVertical:(Gl-Ql)/2},testID:`everfur-tab-${e}`,children:[
|
|
204
|
+
/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"flex-start",maxWidth:"100%"},children:[
|
|
205
|
+
/* @__PURE__ */y(Text,{tier:"compact",numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.8,style:{...face(l,a?"bold":"medium"),fontSize:Kl,lineHeight:Ql,color:a?o:l.color.text.muted,flexShrink:1},children:r[e]}),n?.[e]===true?/* @__PURE__ */y(p,{style:{width:$l,height:$l,borderRadius:$l/2,marginLeft:2,marginTop:3,backgroundColor:l.color.danger},testID:`everfur-tab-${e}-new`}):null]}),a?/* @__PURE__ */y(p,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",style:{position:"absolute",left:0,right:0,bottom:0,height:Yl,borderTopLeftRadius:2,borderTopRightRadius:2,backgroundColor:o}}):null]},e)})]})}var Jl=/* @__PURE__ */Symbol.for("everfur.sdk.tabsBar.v1");function Zl(e){let t=globalThis;t[Jl]??=/* @__PURE__ */Object.freeze(e)}createContext(false);var Xl=34,eo=18,to=3;function ro(e){let t=e.color;/* @__PURE__ */
|
|
206
|
+
return Object.freeze({...e,color:/* @__PURE__ */Object.freeze({...t,highlight:t.primary,onHighlight:t.onPrimary,mark:t.primary,borderRingCream:t.brandBorder})})}var no={booked:{screen:["bookedScreen"],avatar:["bookedAvatar"],title:["bookedTitle"],when:["bookedWhen"],steps:["bookedSteps","bookedStepsBg"],stepNumberText:["bookedStepNumber"],stepText:["bookedStepText"]},day:{month:["month"],strip:["dayStrip"],day:["day"],daySelected:["daySelected"],dayWeekday:["dayWeekday"],dayNumber:["dayNumber"],dayTextSelected:["dayTextSelected"]},pick:{pickRow:["pickRow"],pick:["pick"],pickOn:["pickOn"],pickLabel:["pickLabel"],pickLabelOn:["pickLabelOn"]},frame:{screen:["screen"]},scroll:{scrollFooter:["footer"]},choice:{choiceSelected:["choiceSelected"]},chrome:{ring:["ring"],bar:["bar"],stepLabel:["stepLabel"],segments:["segments"],segment:["segment"],segmentDone:["segmentDone"]},slot:{period:["period"],grid:["grid"],chip:["chip"],chipPicked:["chipPicked"],chipLabel:["chipLabel"],chipLabelPicked:["chipLabelPicked"]}};function io(e,t,r){let n={...t},i=r;for(let[t,r]of Object.entries(no[e]))n[t]=[n[t],...r.map(e=>i[e])];return n}function ao(e){let{color:t,space:r,type:n}=e,{size:i,lineHeight:a}=n;return f.create({bar:{minHeight:52,paddingVertical:r.xs},ring:{width:Xl,height:Xl,borderRadius:Xl/2,borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface},stepLabel:{...face(e,"monoMedium"),color:t.text.muted,fontSize:11,lineHeight:14,letterSpacing:.88},segments:{alignSelf:"center",gap:to},segment:{flexGrow:0,flexShrink:0,flexBasis:eo,width:eo,height:3,borderRadius:2,backgroundColor:t.brandBorder},segmentDone:{backgroundColor:t.primary},stepTitle:{...headingFace(e,"bold"),fontWeight:"800",color:t.text.primary,letterSpacing:0},stepHelp:{color:t.text.muted,fontSize:i.bodyTight,lineHeight:i.bodyTight*a.snug},footer:{borderTopWidth:f.hairlineWidth,borderTopColor:t.brandBorder,marginHorizontal:-16,paddingHorizontal:16},screen:{paddingHorizontal:16},pick:{borderWidth:1.5,borderColor:t.brandBorder,backgroundColor:t.surface,minHeight:44,paddingHorizontal:15,gap:6},pickRow:{gap:8},pickOn:{borderColor:t.primary,backgroundColor:t.primary},pickLabel:{...face(e,"medium"),color:t.text.primary},pickLabelOn:{...face(e,"bold"),color:t.onPrimary},choiceSelected:{borderColor:t.primary,borderWidth:1.5,backgroundColor:t.surface},dayStrip:{gap:6.5,paddingHorizontal:0},day:{width:46,minHeight:58,borderRadius:14,borderWidth:1.5,borderColor:t.brandBorder,backgroundColor:t.surface},daySelected:{borderColor:t.primary,backgroundColor:t.primary},dayWeekday:{...face(e,"mono"),color:t.text.muted,fontSize:10,lineHeight:14,letterSpacing:.4},dayNumber:{...face(e,"bold"),color:t.text.primary,fontSize:18,lineHeight:24},dayTextSelected:{color:t.onPrimary},month:{...headingFace(e,"bold"),fontSize:17,lineHeight:22,color:t.text.primary},grid:{columnGap:11,rowGap:11},chip:{minWidth:0,flexBasis:"30%",flexGrow:1,flexShrink:1,maxWidth:"32%",minHeight:44,borderWidth:1.5,borderColor:t.brandBorder,backgroundColor:t.surface,paddingHorizontal:4},chipLabel:{...face(e,"medium"),color:t.text.primary,fontSize:15,lineHeight:20},chipPicked:{borderColor:t.primary,backgroundColor:t.primary},chipLabelPicked:{color:t.onPrimary},bookedAvatar:{width:96,height:96,borderRadius:48,borderWidth:2,borderColor:t.primary},bookedTitle:{...headingFace(e,"bold"),fontWeight:"800",fontSize:22,lineHeight:28,letterSpacing:0,color:t.text.primary},bookedWhen:{...face(e,"regular"),fontSize:14,lineHeight:20,color:t.text.primary},bookedSteps:{borderRadius:20,borderColor:t.brandBorder,paddingHorizontal:16},bookedStepNumber:{...face(e,"monoMedium"),color:t.text.muted,fontSize:11},bookedStepText:{...face(e,"regular"),color:t.text.primary,fontSize:15,lineHeight:22},bookedScreen:{paddingHorizontal:0},bookedStepsBg:{backgroundColor:t.surface},period:{...face(e,"bold"),color:t.text.primary,fontSize:i.bodyTight,lineHeight:i.bodyTight*a.snug,letterSpacing:0,textTransform:"none"}})}var lo=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"];var oo=/* @__PURE__ */new Set(["scheduled","in_progress","awaiting_summary"]);function so(e){return oo.has(e.status)}var uo=["wellness","prescription"];var co=64,po=2e3;function isWellFormedStateCode(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}function ho(e){return typeof e=="object"&&e!==null?e:null}function fo(e){return typeof e=="string"&&e.length>0?e:null}function go(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function bo(e,t){return typeof e=="boolean"?e:t}function mo(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function yo(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}function vo(e,t){if(!Array.isArray(e))/* @__PURE__ */return Object.freeze([]);let r=[];for(let n of e){let e=t(n);e!==null&&r.push(e)}/* @__PURE__ */
|
|
207
|
+
return Object.freeze(r)}function wo(e,t){let r=ho(e);return r===null?null:/* @__PURE__ */Object.freeze({state:fo(r.state)??t,wellnessAvailable:bo(r.wellness_available,false),prescriptionsAvailable:bo(r.prescriptions_available,false),cancellationPolicyText:go(r.cancellation_policy_text)})}function Ao(e){let t=ho(e);if(t===null)return null;let r=go(t.summary),n=go(t.version);return r===null||n===null?null:/* @__PURE__ */Object.freeze({summary:r,version:n})}function ko(e){let t=ho(e);if(t===null)return null;let r=fo(t.clinician_id),n=fo(t.display_name);return r===null||n===null?null:/* @__PURE__ */Object.freeze({clinicianId:r,displayName:n,credentials:go(t.credentials_text),rating:mo(t.rating),ratingCount:mo(t.rating_count),bio:go(t.bio),photoRef:fo(t.photo_ref),licensedStates:vo(t.licensed_states,e=>{let t=ho(e),r=t===null?null:fo(t.state);return r===null?null:/* @__PURE__ */Object.freeze({state:r,canPrescribe:bo(t?.can_prescribe,false)})}),role:_o(t.clinician_role)})}function _o(e){let t=fo(e)?.trim().toLowerCase();return t==="vet"||t==="vet_tech"?t:null}function So(e){let t=ho(e);if(t===null)return null;let r=fo(t.slot_id),n=fo(t.starts_at);return r===null||n===null?null:/* @__PURE__ */Object.freeze({slotId:r,startsAt:n,endsAt:fo(t.ends_at)??n})}function Co(e){let t=ho(e);if(t===null)return null;let r=t.is_emergency===true,n=t.fallback===true;return r||n?/* @__PURE__ */Object.freeze({isEmergency:r,fallback:n}):t.is_emergency===false&&t.fallback===false?/* @__PURE__ */Object.freeze({isEmergency:false,fallback:false}):null}function To(e){let t=ho(e);if(t===null)return null;let r=fo(t.slot_id),n=fo(t.hold_expires_at);return r===null||n===null?null:/* @__PURE__ */Object.freeze({slotId:r,expiresAt:n})}function Ro(e){let t=ho(e);if(t===null)return null;let r=fo(t.consult_id),n=fo(t.scheduled_at);return r===null||n===null?null:/* @__PURE__ */Object.freeze({consultId:r,petId:fo(t.pet_id)??"",clinicianId:fo(t.clinician_id)??"",clinicianName:go(t.display_name),reasonText:go(t.reason_text),mediaRefs:vo(t.media_refs,e=>fo(e)),status:yo(lo,t.status),kind:yo(uo,t.kind),scheduledAt:n,emergencyFlagged:bo(t.emergency_flagged,false),hasRoom:fo(t.meeting_url)!==null})}function zo(e){let t=ho(e);/* @__PURE__ */
|
|
208
|
+
return Object.freeze({active:bo(t?.active,false)})}var Oo=240;function Eo(e){let t=ho(e);if(t===null)return null;let r=mo(t.fee_cents);return r===null||r<0?null:/* @__PURE__ */Object.freeze({feeCents:r,currency:fo(t.currency)??"usd",feeRecorded:bo(t.fee_recorded,r>0),summary:go(t.summary)})}var Io=250,jo=/* @__PURE__ */new Set(["scheduled","in_progress"]);function xo(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}function splitTelevetVisits(e,t){let r=[],n=[];for(let i of e){let e=xo(i);(jo.has(i.status)&&e!==null&&e+Io*6e4>t?r:n).push(i)}return r.sort((e,t)=>(xo(e)??0)-(xo(t)??0)),n.sort((e,t)=>(xo(t)??0)-(xo(e)??0)),/* @__PURE__ */Object.freeze({upcoming:/* @__PURE__ */Object.freeze(r),past:/* @__PURE__ */Object.freeze(n)})}var Fo=50,Do=128,Bo=120,Po=120,Ho=2e3,No=120,Mo=80,Uo=/* @__PURE__ */new Set(["male","female","unknown"]),Lo=/* @__PURE__ */new Set(["day","month","year"]),Wo=/* @__PURE__ */new Set(["low","medium","high","athletic"]),Vo=/* @__PURE__ */new Set(["indoor","outdoor","both"]),qo=/* @__PURE__ */new Set(["mild","moderate","severe"]),Go=/^(\d{4})-(\d{2})-(\d{2})$/,Ko=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],Qo=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...Ko,...Qo].map(([e])=>e));function Yo(e){let t=Go.exec(e);if(t===null)return false;let[r,n,i]=[Number(t[1]),Number(t[2]),Number(t[3])],a=new Date(Date.UTC(r,n-1,i));return a.getUTCFullYear()===r&&a.getUTCMonth()===n-1&&a.getUTCDate()===i}var $o=e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,Jo=(e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,Zo=(e,t)=>typeof t=="string"&&Yo(t)?null:`${e} must be a real date written YYYY-MM-DD`,Xo=(e,t={})=>(r,n)=>{if(typeof n!="string")return`${r} must be a string`;if(Ln(n))return`${r} contains an unpaired surrogate and cannot be encoded`;let i=t.trimmed?n.trim():n;if(t.required&&i.length===0)return`${r} is required and must not be blank`;let a=Wn(i);return a<=e?null:`${r} is ${a} characters; the server accepts at most ${e}`},es={sex:$o(Uo),spayedNeutered:Jo,birthDate:Zo,birthDatePrecision:$o(Lo),activityLevel:$o(Wo),indoorOutdoor:$o(Vo),foodBrand:Xo(No),foodType:Xo(No),microchipId:Xo(Mo)},ts=["ref","ref",false,Xo(Do,{required:true,trimmed:true})],rs=["notes","notes",false,Xo(Ho,{trimmed:true})],ns=[ts,["name","name",true,Xo(Bo,{required:true,trimmed:true})],["dose","dose",false,Xo(Po,{trimmed:true})],["frequency","frequency",false,Xo(Po,{trimmed:true})],["startDate","start_date",false,Zo],["endDate","end_date",false,Zo],rs],is={allergies:[ts,["allergen","allergen",true,Xo(Bo,{required:true,trimmed:true})],["severity","severity",false,$o(qo)],rs],medications:ns,supplements:ns,conditions:[ts,["conditionName","condition_name",true,Xo(Bo,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Zo],rs]};function as(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return{error:`${n} must be an object`};let i=r,a={};for(let[t,r,l,o]of is[e]){let e=i[t];if(e==null){if(l)return{error:`${n}.${t} is required`};e===null&&(a[r]=null);continue}let s=o(`${n}.${t}`,e);if(s!==null)return{error:s};a[r]=e}let l=a.start_date,o=a.end_date;return typeof l=="string"&&typeof o=="string"&&o<l?{error:`${n}.endDate must not be before startDate`}:{item:a}}function ls(e,t){if(!Array.isArray(t))return{error:`${e} must be an array (send [] to clear it)`};if(t.length>Fo)return{error:`${e} has ${t.length} items; the server accepts at most ${Fo}`};let r=[],n=/* @__PURE__ */new Set;for(let i=0;i<t.length;i+=1){let a=as(e,i,t[i]);if("error"in a)return a;let l=a.item.ref;if(typeof l=="string"){let t=l.trim();if(n.has(t))return{error:`${e}: ref ${JSON.stringify(t)} is used twice; a ref names one item`};n.add(t)}r.push(a.item)}return{items:r}}function os(e,t){let r=e,n={};for(let[e,t]of Ko){let i=r[e];if(i!==void 0){if(i!==null){let t=es[e](e,i);if(t!==null)return{error:t}}n[t]=i}}let i=r.birthDate!==void 0,a=r.birthDatePrecision!==void 0;if(i!==a||i&&r.birthDate===null!=(r.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[e,t]of Qo){let i=r[e];if(i===void 0)continue;let a=ls(e,i);if("error"in a)return a;n[t]=a.items}return Object.keys(n).length>0&&t!==void 0&&canonicalPetSpecies(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}var ss=e=>typeof e=="string"?e:null,ds=(e,t)=>typeof t=="string"&&e.has(t)?t:null,us=e=>typeof e=="boolean"?e:null;function cs(e,t){return Array.isArray(e)?/* @__PURE__ */Object.freeze(e.flatMap(e=>{if(typeof e!="object"||e===null||Array.isArray(e))return[];let r=t(e);return r===null?[]:[r]})):/* @__PURE__ */Object.freeze([])}function ps(e){let t=ss(e.name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:ss(e.ref),name:t,dose:ss(e.dose),frequency:ss(e.frequency),startDate:ss(e.start_date),endDate:ss(e.end_date),notes:ss(e.notes)})}function hs(e){let t=e.profile_version;/* @__PURE__ */
|
|
209
|
+
return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:ds(Uo,e.sex),spayedNeutered:us(e.spayed_neutered),birthDate:ss(e.birth_date),birthDatePrecision:ds(Lo,e.birth_date_precision),activityLevel:ds(Wo,e.activity_level),indoorOutdoor:ds(Vo,e.indoor_outdoor),foodBrand:ss(e.food_brand),foodType:ss(e.food_type),microchipId:ss(e.microchip_id),allergies:cs(e.allergies,e=>{let t=ss(e.allergen);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:ss(e.ref),allergen:t,severity:ds(qo,e.severity),notes:ss(e.notes)})}),medications:cs(e.medications,ps),supplements:cs(e.supplements,ps),conditions:cs(e.conditions,e=>{let t=ss(e.condition_name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:ss(e.ref),conditionName:t,diagnosedDate:ss(e.diagnosed_date),notes:ss(e.notes)})})})}var fs=100,gs=50,bs=100,ms=50,ys=500,vs=128,ws=6e4;function As(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function ks(e,t,r){if(typeof t!="string")return As(`${e} must be a string`);let n=Wn(t);return n<=r?null:As(`${e} is ${n} characters; the server accepts at most ${r}`)}function _s(e,t,r){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=r?null:As(`${e} must be a finite number between 0 and ${r}`)}function Ss(petRef,e){if(typeof petRef!="string")return As("pet_ref must be a string");if(petRef.trim().length===0)return As("pet_ref must not be blank");if(Ln(petRef))return As("pet_ref contains an unpaired surrogate and cannot be encoded");if(e!=null&&typeof e!="object")return As("profile must be an object");let t=[ks("pet_ref",petRef,vs)];return e?.name!==void 0&&t.push(ks("name",e.name,fs)),e?.species!==void 0&&t.push(ks("species",e.species,gs)),e?.breed!==void 0&&t.push(ks("breed",e.breed,bs)),e?.ageYears!==void 0&&t.push(_s("age_years",e.ageYears,ms)),e?.weightKg!==void 0&&t.push(_s("weight_kg",e.weightKg,ys)),t.find(e=>e!==null)??null}function Cs(e,t){let r=os(e,t);return"error"in r?{error:As(r.error)}:r}function Ts(e){if(typeof e!="object"||e===null)return{error:As("patch must be an object")};let t=e,r=[["name","name",e=>ks("name",e,fs)],["species","species",e=>ks("species",e,gs)],["breed","breed",e=>ks("breed",e,bs)],["ageYears","age_years",e=>_s("age_years",e,ms)],["weightKg","weight_kg",e=>_s("weight_kg",e,ys)]],n={};for(let[e,i,a]of r){let r=t[e];if(r!==void 0){if(r!==null){let e=a(r);if(e!==null)return{error:e}}n[i]=r}}let i=Cs(t,t.species);return"error"in i?i:(Object.assign(n,i.body),Object.keys(n).length===0?{error:As("patch must change at least one field")}:{body:n})}function Rs(e){if(e==null)return{body:{}};let t=Cs(e,e.species);return"error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}var zs=e=>typeof e=="string"?e:null,Os=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function Es(e,petRef){let t=typeof e=="object"&&e!==null?e:{};/* @__PURE__ */
|
|
210
|
+
return Object.freeze({petRef:zs(t.pet_ref)??petRef,name:zs(t.name),species:zs(t.species),breed:zs(t.breed),ageYears:Os(t.age_years),weightKg:Os(t.weight_kg)})}function widgetPetFromWire(e){if(typeof e!="object"||e===null)return null;let t=e,petRef=zs(t.pet_ref);return petRef===null||petRef.length===0?null:/* @__PURE__ */Object.freeze({petId:zs(t.pet_id),petRef:petRef,name:zs(t.name),species:zs(t.species),breed:zs(t.breed),ageYears:Os(t.age_years),weightKg:Os(t.weight_kg),updatedAt:zs(t.updated_at)})}function Is(e){let t=widgetPetFromWire(e);return t===null?null:/* @__PURE__ */Object.freeze({...t,...hs(e)})}function js(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];/* @__PURE__ */
|
|
211
|
+
return Object.freeze(t.flatMap(e=>{let t=widgetPetFromWire(e);return t===null?[]:[t]}))}function createPetsRepository(e){return xs(createRequestFunnel({auth:e}),createRequestFunnel({auth:e,unaryTimeoutMs:ws}))}function xs(e,t=e){let r=(e,t)=>t?{...e,signal:t}:e,n=petRef=>Ss(petRef,void 0)??`/widget/v1/pets/${encodeURIComponent(petRef)}`;return{async list(t){let n=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},t?.signal));return n.ok?ok(js(n.value)):err(n.error)},async registerPet(petRef,t,r){let n=Ss(petRef,t);if(n!==null)return err(n);let i=Rs(t);if("error"in i)return err(i.error);let a={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(petRef)}`,body:i.body},l=await e.send("pets.registerPet",r?.signal?{...a,signal:r.signal}:a);return l.ok?ok(Es(l.value,petRef)):err(l.error)},async updatePet(petRef,t,i){let a=n(petRef);if(typeof a!="string")return err(a);let l=Ts(t);if("error"in l)return err(l.error);let o=await e.send("pets.updatePet",r({method:"PATCH",path:a,body:l.body},i?.signal));return o.ok?ok(Es(o.value,petRef)):err(o.error)},async getPetProfile(petRef,t){let i=n(petRef);if(typeof i!="string")return err(i);let a=await e.send("pets.getPetProfile",r({method:"GET",path:`${i}/profile`},t?.signal));if(!a.ok)return err(a.error);let l=Is(a.value);return l===null?err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):ok(l)},async deletePet(petRef,t){let i=n(petRef);if(typeof i!="string")return err(i);let a=await e.send("pets.deletePet",r({method:"DELETE",path:i},t?.signal));return a.ok?ok(void 0):err(a.error)},async eraseUserData(e){let n=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},e?.signal),{maxAttempts:1});return n.ok?ok(void 0):err(n.error)}}}var Fs=/* @__PURE__ */new WeakMap;function Ds(e,t){let r=Fs.get(e);return r===void 0&&(r=/* @__PURE__ */new Set,Fs.set(e,r)),r.add(t),()=>{r?.delete(t)}}function useEverfurPets(){let{runtime:e,userRef:userRef,activePet:t,scopeEpoch:a}=rr(),s=n(()=>createPetsRepository(e.registry.services.authFor(userRef)),[e,userRef,a]),[d,u]=r({repository:s,pets:[],loading:true,error:null}),c=d.repository===s?d:{pets:[],loading:true,error:null},p=o(0),h=l(async()=>{let e=++p.current;u(e=>({...e,repository:s,loading:true,error:null,pets:e.repository===s?e.pets:[]}));let t=await s.list();e===p.current&&u(t.ok?{repository:s,pets:t.value,loading:false,error:null}:e=>({repository:s,pets:e.repository===s?e.pets:[],loading:false,error:t.error}))},[s]);i(()=>(h(),()=>{p.current+=1}),[h]),i(()=>Ds(e,()=>{h()}),[e,h]);let f=n(()=>t===null?null:c.pets.find(e=>e.petRef===t)??null,[t,c.pets]);return n(()=>({pets:c.pets,activePet:f,loading:c.loading,error:c.error,refresh:h}),[c.pets,c.loading,c.error,f,h])}function Bs(e,t){let r=e;for(let[e,n]of Object.entries(t))r=r.split(`{${e}}`).join(n);return r}function Ps(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Hs(e){let t=Ps(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}function Ns(e){let t=Ps(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(e=>e.type==="timeZoneName")?.value??"":""}function Ms(e){return[Hs(e),Ns(e)].filter(Boolean).join(" ")}function Us(e){return e.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}function Ls(e,t=false){let r=Ps(e);return r?`${Us(r)} at ${t?Ms(e):Hs(e)}`:""}var Ws=25*1024*1024;function Vs(e){if(typeof e!="object"||e===null)return null;let t=e,r=e=>typeof e=="string"&&e.length>0?e:null,n=e=>typeof e=="number"&&Number.isFinite(e)?e:null,i=r(t.upload_url),a=r(t.s3_key);if(i===null||a===null)return null;let l={},o=t.upload_fields;if(typeof o=="object"&&o!==null)for(let[e,t]of Object.entries(o))typeof t=="string"&&(l[e]=t);/* @__PURE__ */
|
|
212
|
+
return Object.freeze({upload_id:r(t.upload_id)??"",upload_url:i,upload_fields:/* @__PURE__ */Object.freeze(l),expires_in_seconds:n(t.expires_in_seconds)??0,max_content_length:n(t.max_content_length)??Ws,s3_key:a,purpose:r(t.purpose)})}var qs="televet_booking_not_live";function Gs(e){return makeEverfurError("conflict",{retryable:false,reasonCode:qs,wireMessage:`the booking was answered with a consult whose status is ${e}, which is not a live visit`})}var Ks="televet_booking_key_reused",Qs="IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST";function Ys(e){return e.httpStatus!==409||e.reasonCode===Ks||$s(e)?.code!==Qs?e:makeEverfurError(e.code,{retryable:false,httpStatus:409,...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:Qs,reasonCode:Ks,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}function $s(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let r=t,n=r.detail??r.error;return typeof n=="object"&&n!==null?n:r}function isSafeRoomUrl(e){return it(e.trim())?.protocol==="https:"}function isUsableRoomCredential(e,t){return isSafeRoomUrl(e)&&t.trim().length>0}function Js(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}function Zs(e){if(!Vn(e))return null;let t=Js(e.consult_minutes,1),r=Js(e.auto_end_minutes,0),n=Js(e.warn_before_seconds,0);return t===null||r===null||n===null?null:/* @__PURE__ */Object.freeze({consultMinutes:t,autoEndMinutes:r,warnBeforeSeconds:n})}function parseVetCallCredential(e){if(!Vn(e))return null;let t=e.room_url??e.url,r=e.token;if(typeof t!="string"||typeof r!="string"||!isUsableRoomCredential(t,r))return null;let n=e.recording_notice;/* @__PURE__ */
|
|
213
|
+
return Object.freeze({roomUrl:t.trim(),token:r,recordingNotice:typeof n=="boolean"?n:true,callLimits:Zs(e.call_limits)})}var Xs="/widget/v1/televet",ed=`${Xs}/messages/threads`;function televetThreadMessagesCall(petRef){return`${ed}/${encodeURIComponent(petRef)}/messages`}function televetThreadReadCall(petRef){return`${ed}/${encodeURIComponent(petRef)}/read`}function televetVisitSummaryCall(e){return`${Xs}/consults/${encodeURIComponent(e)}/summary`}var td=4e3,rd=50,nd=100,id=/* @__PURE__ */A.string().min(1).refine(e=>!Number.isNaN(Date.parse(e))),ad=/* @__PURE__ */A.string().nullish(),ld=/* @__PURE__ */A.object({message_id:/* @__PURE__ */A.string().min(1),pet_ref:/* @__PURE__ */A.string().min(1),role:/* @__PURE__ */A.enum(["owner","vet","system"]),content:/* @__PURE__ */A.string(),created_at:id,sender:/* @__PURE__ */A.object({display_name:ad,specialty:ad}).nullish(),sender_display_name:ad,attachment_count:/* @__PURE__ */A.number().int().nonnegative().nullish()}),od=/* @__PURE__ */A.object({pet_ref:/* @__PURE__ */A.string().min(1),last_message_at:id,unread_count:/* @__PURE__ */A.number().int().nonnegative().nullish(),owner_can_start:/* @__PURE__ */A.boolean().nullish(),last_message:/* @__PURE__ */ld.nullish()}),sd=/* @__PURE__ */A.object({drug:/* @__PURE__ */A.string().nullish(),strength:ad,form:ad,sig:ad,quantity:/* @__PURE__ */A.union([/* @__PURE__ */A.string(),/* @__PURE__ */A.number()]).nullish(),refills:/* @__PURE__ */A.number().int().nonnegative().nullish()}).passthrough(),dd=/* @__PURE__ */A.object({consult_id:/* @__PURE__ */A.string().min(1),findings_text:/* @__PURE__ */A.string().nullish(),next_steps_text:/* @__PURE__ */A.string().nullish(),medications:/* @__PURE__ */A.array(/* @__PURE__ */A.unknown()).nullish(),product_refs:/* @__PURE__ */A.array(/* @__PURE__ */A.string()).nullish(),action_items:/* @__PURE__ */A.array(/* @__PURE__ */A.string()).nullish(),approved_at:id,approved_by_display_name:ad,credentials_text:ad});function ud(e){let t=e?.trim()??"";return t.length>0?t:null}function cd(e){let t=e.role==="vet";/* @__PURE__ */
|
|
214
|
+
return Object.freeze({messageId:e.message_id,petRef:e.pet_ref,role:e.role,content:e.content,createdAt:e.created_at,senderName:t?ud(e.sender?.display_name)??ud(e.sender_display_name):null,senderSpecialty:t?ud(e.sender?.specialty):null,attachmentCount:e.attachment_count??0})}function pd(e){let t=ld.safeParse(e);return t.success?cd(t.data):null}function hd(e){let t=A.array(ld).safeParse(e);return t.success?/* @__PURE__ */Object.freeze(t.data.map(cd)):null}function fd(e){let t=A.array(od).safeParse(e);return t.success?/* @__PURE__ */Object.freeze(t.data.map(e=>/* @__PURE__ */Object.freeze({petRef:e.pet_ref,lastMessageAt:e.last_message_at,unreadCount:e.unread_count??0,ownerCanStart:e.owner_can_start??true,lastMessage:e.last_message?cd(e.last_message):null}))):null}function gd(e){let t=sd.safeParse(e);if(!t.success)return null;let r=ud(t.data.drug);if(r===null)return null;let n=t.data.quantity;/* @__PURE__ */
|
|
215
|
+
return Object.freeze({drug:r,strength:ud(t.data.strength),form:ud(t.data.form),sig:ud(t.data.sig),quantity:n==null?null:ud(String(n)),refills:t.data.refills??null})}function bd(e){let t=dd.safeParse(e);if(!t.success)return null;let r=t.data;/* @__PURE__ */
|
|
216
|
+
return Object.freeze({consultId:r.consult_id,findingsText:r.findings_text??"",nextStepsText:r.next_steps_text??"",medications:/* @__PURE__ */Object.freeze((r.medications??[]).map(gd).filter(e=>e!==null)),productRefs:/* @__PURE__ */Object.freeze([...r.product_refs??[]]),actionItems:/* @__PURE__ */Object.freeze((r.action_items??[]).filter(e=>e.trim().length>0)),approvedAt:r.approved_at,approvedByName:ud(r.approved_by_display_name),credentialsText:ud(r.credentials_text)})}function isVetMessagesDark(e){return e.httpStatus===404}function md(e){return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:e}))}function yd(e){return err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}function vd(e){return e===void 0||!Number.isFinite(e)?rd:Math.min(nd,Math.max(1,Math.trunc(e)))}function wd(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function Ad(e,t,r){try{e?.track(t,r)}catch{}}function kd(e,t){return{async listVetThreads(t){let r=await e.send("televet.messages.threads",{method:"GET",path:ed,...t?{signal:t}:{}});if(!r.ok)return err(r.error);let n=fd(r.value);return n===null?yd("the vet thread list was unreadable"):ok(n)},async listVetMessages(petRef,t={},r){let n=petRef.trim();if(n.length===0)return md("petRef is required");let i=t.before?.trim();if(i!==void 0&&i.length>0&&!wd(i))return md("before must be an ISO date-time");let a=await e.send("televet.messages.thread",{method:"GET",path:televetThreadMessagesCall(n),query:{...i?{before:i}:{},limit:vd(t.limit)},...r?{signal:r}:{}});if(!a.ok)return err(a.error);let l=hd(a.value);return l===null?yd("the vet thread page was unreadable"):ok(l)},async sendVetMessage(petRef,r){let n=petRef.trim();if(n.length===0)return md("petRef is required");if(r.trim().length===0)return md("content must not be blank");if(r.length>td)return md(`content must be at most ${td} characters`);let i=await e.send("televet.messages.send",{method:"POST",path:televetThreadMessagesCall(n),body:{content:r}},{idempotent:false,maxAttempts:1});if(!i.ok)return Ad(t,"televet.messages.send_failed",{status:i.error.httpStatus??null}),err(i.error);let a=pd(i.value);return a===null?yd("the sent message was unreadable"):ok(a)},async markVetThreadRead(petRef,t){let r=petRef.trim();if(r.length===0)return md("petRef is required");if(!wd(t))return md("readAt must be an ISO date-time");let n=await e.send("televet.messages.read",{method:"PUT",path:televetThreadReadCall(r),body:{read_at:t}});return n.ok?ok(void 0):err(n.error)},async visitSummary(t,r){let n=t.trim();if(n.length===0)return md("consultId is required");let i=await e.send("televet.messages.summary",{method:"GET",path:televetVisitSummaryCall(n),...r?{signal:r}:{}});if(!i.ok)return err(i.error);let a=bd(i.value);return a===null?yd("the visit summary was unreadable"):ok(a)}}}var _d="/widget/v1/televet",Sd=`${_d}/state-policy`,Cd=`${_d}/vets`,Td=`${_d}/slots`,Rd=`${_d}/slots/next`,zd=`${_d}/consults`,Od=`${_d}/entitlement`,Ed=`${_d}/cancellation-policy`,Id=`${_d}/attachments/initiate`,jd=`${zd}/triage`;function televetHoldCall(e){return`${Td}/${encodeURIComponent(e)}/hold`}function televetRescheduleCall(e){return`${zd}/${encodeURIComponent(e)}/reschedule`}function televetConsultCall(e){return`${zd}/${encodeURIComponent(e)}`}function televetJoinCall(e){return`${televetConsultCall(e)}/join`}function televetCancelCall(e){return`${televetConsultCall(e)}/cancel`}var xd=100;function Fd(e){return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:e}))}function Dd(e){return err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}function Bd(e){return e.httpStatus===404}function Pd(e,t,r){try{e?.track(t,r)}catch{}}function validateBookingBody(e){if(e.pet_id.trim().length===0)return"pet_id is required";if(e.clinician_id.trim().length===0)return"clinician_id is required";if(e.slot_id.trim().length===0)return"slot_id is required";if(!isWellFormedStateCode(e.state))return"state must be a two-letter US state code";let t=e.reason_text.trim();return t.length===0?"reason_text is required":t.length>po?`reason_text must be at most ${po} characters`:Hd(e)}function Hd(e){let t=e.state_attested===true,r=e.cancellation_policy_version?.trim()??"";return t!==r.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":r.length>co?`cancellation_policy_version must be at most ${co} characters`:null}function createTelevetBookingController(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry;return{...kd(t,r),async statePolicy(e,r){let n=e.trim();if(!isWellFormedStateCode(n))return Fd("state must be a two-letter US state code");let i=await t.send("televet.booking.state_policy",{method:"GET",path:`${Sd}/${encodeURIComponent(n)}`,...r?{signal:r}:{}});if(!i.ok)return err(i.error);let a=wo(i.value,n);return a===null?Dd("the state policy response was unreadable"):ok(a)},async entitlement(e){let r=await t.send("televet.booking.entitlement",{method:"GET",path:Od,...e?{signal:e}:{}});return r.ok?ok(zo(r.value)):err(r.error)},async cancellationPolicy(e){let r=await t.send("televet.booking.cancellation_policy",{method:"GET",path:Ed,...e?{signal:e}:{}});return r.ok?ok(Ao(r.value)):ok(null)},async clinicians(e,r){let n=e.trim();if(!isWellFormedStateCode(n))return Fd("state must be a two-letter US state code");let i=await t.send("televet.booking.clinicians",{method:"GET",path:Cd,query:{state:n},...r?{signal:r}:{}});return i.ok?ok(vo(Md(i.value,"vets"),ko)):Bd(i.error)?ok(/* @__PURE__ */Object.freeze([])):err(i.error)},async slots(e,r){let n=e.trim();if(n.length===0)return Fd("clinicianId is required");let i=await t.send("televet.booking.slots",{method:"GET",path:Td,query:{clinician_id:n},...r?{signal:r}:{}});return i.ok?ok(vo(Md(i.value,"slots"),So)):Bd(i.error)?ok(/* @__PURE__ */Object.freeze([])):err(i.error)},async nextSlot(e){let r=await t.send("televet.booking.next_slot",{method:"GET",path:Rd,...e?{signal:e}:{}});return r.ok?ok(So(unwrap(r.value,"slot"))):ok(null)},async holdSlot(e){let n=e.trim();if(n.length===0)return Fd("slotId is required");let i=await t.send("televet.booking.hold",{method:"POST",path:televetHoldCall(n)},{idempotent:false,maxAttempts:1});if(!i.ok)return Pd(r,"televet.booking.hold_failed",{status:i.error.httpStatus??null}),err(i.error);let a=To(i.value);return a===null?Dd("the hold response carried no usable expiry"):ok(a)},async releaseHold(e){let r=e.trim();if(r.length===0)return Fd("slotId is required");let n=await t.send("televet.booking.release_hold",{method:"DELETE",path:televetHoldCall(r)},{idempotent:false,maxAttempts:1});return!n.ok&&n.error.httpStatus!==404?err(n.error):ok(void 0)},async book(e,n){let i=validateBookingBody(e);if(i!==null)return Fd(i);let a=n.trim();if(a.length===0)return Fd("idempotencyKey is required");let l=await t.send("televet.booking.book",{method:"POST",path:zd,body:Nd(e)},{idempotent:true,idempotencyKey:a,maxAttempts:1});if(!l.ok)return Pd(r,"televet.booking.book_failed",{status:l.error.httpStatus??null}),err(Ys(l.error));let o=Ro(l.value);return o===null?Dd("the booking response was unreadable"):so(o)?ok(o):(Pd(r,"televet.booking.book_failed",{status:null,consult_status:o.status}),err(Gs(o.status)))},async reschedule(e,n){let i=e.trim(),a=n.trim();if(i.length===0)return Fd("consultId is required");if(a.length===0)return Fd("slotId is required");let l=await t.send("televet.booking.reschedule",{method:"POST",path:televetRescheduleCall(i),body:{new_slot_id:a}},{idempotent:false,maxAttempts:1});if(!l.ok)return Pd(r,"televet.booking.reschedule_failed",{status:l.error.httpStatus??null}),err(l.error);let o=Ro(l.value);return o===null?Dd("the reschedule response was unreadable"):ok(o)},async triage(e,n){let i=e.trim();if(i.length===0)return ok(null);let a=await t.send("televet.booking.triage",{method:"POST",path:jd,body:{reason_text:i},...n?{signal:n}:{}},{idempotent:false,maxAttempts:1});return a.ok?ok(Co(a.value)):(Pd(r,"televet.booking.triage_unavailable",{status:a.error.httpStatus??null}),ok(null))},async listConsults(e){let r=await t.send("televet.booking.consults",{method:"GET",path:zd,query:{limit:String(xd)},...e?{signal:e}:{}});return r.ok?ok(vo(Md(r.value,"consults"),Ro)):Bd(r.error)?ok(/* @__PURE__ */Object.freeze([])):err(r.error)},async getConsult(e,r){let n=e.trim();if(n.length===0)return Fd("consultId is required");let i=await t.send("televet.booking.consult",{method:"GET",path:televetConsultCall(n),...r?{signal:r}:{}});if(!i.ok)return err(i.error);let a=Ro(i.value);return a===null?Dd("the consult response was unreadable"):ok(a)},async joinConsult(e){let n=e.trim();if(n.length===0)return Fd("consultId is required");let i=await t.send("televet.booking.join",{method:"POST",path:televetJoinCall(n)},{idempotent:false,maxAttempts:1});if(!i.ok)return Pd(r,"televet.booking.join_failed",{status:i.error.httpStatus??null}),err(i.error);let a=parseVetCallCredential(i.value);return a===null?Dd("the join response carried no usable room credential"):ok(a)},async cancelConsult(e,n){let i=e.trim(),a=n.trim();if(i.length===0)return Fd("consultId is required");if(a.length===0)return Fd("reason is required");if(a.length>Oo)return Fd(`reason must be at most ${Oo} characters`);let l=await t.send("televet.booking.cancel",{method:"POST",path:televetCancelCall(i),body:{reason:a}},{idempotent:false,maxAttempts:1});if(!l.ok)return Pd(r,"televet.booking.cancel_failed",{status:l.error.httpStatus??null}),err(l.error);let o=Eo(l.value);return o===null?Dd("the cancel response was unreadable"):ok(o)},async initiateAttachment(e,r){let n=await t.send("televet.booking.attachment_initiate",{method:"POST",path:Id,body:{filename:e.filename,content_type:e.contentType,file_size:e.fileSize},...r?{signal:r}:{}});if(!n.ok)return err(n.error);let i=Vs(n.value);return i===null?Dd("the attachment presign was unreadable"):ok(i)}}}function Nd(e){let t=e.cancellation_policy_version?.trim()??"",r=e.state_attested===true&&t.length>0;return{pet_id:e.pet_id,clinician_id:e.clinician_id,slot_id:e.slot_id,state:e.state,reason_text:e.reason_text.trim(),species:e.species,media_refs:[...e.media_refs],emergency_acknowledged:e.emergency_acknowledged,share_health_records:e.share_health_records,...r?{state_attested:true,cancellation_policy_version:t}:{}}}function Md(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let r=e,n=r[t]??r.items??r.data;if(Array.isArray(n))return n}return e}function unwrap(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=e,n=r[t]??r.data;if(typeof n=="object"&&n!==null)return n}return e}
|
|
217
|
+
/* @__PURE__ */Object.freeze({title:aa.rate_limited.title,body:aa.rate_limited.body});function Ud(e){return e!=null&&(e.code==="rateLimited"||e.httpStatus===429)}function Ld(e,t){return kt(e,t)??la*1e3}var Wd=3e4;function Vd(e={}){let t=e.now??Date.now,r=/* @__PURE__ */new Map,n=e=>e!==void 0&&e.settled!==null&&t()<e.keptUntil?e.settled:null,i=(e,t,n)=>{let i=t.promise;t.waiters+=1;let a=()=>{t.waiters-=1,t.waiters===0&&t.promise!==null&&(t.abort.abort(),r.get(e)===t&&r.delete(e))};return n.aborted?(a(),i):(n.addEventListener("abort",a,{once:true}),i.finally(()=>n.removeEventListener("abort",a)))},a=(e,n,i,a)=>{if(n.promise=null,r.get(e)!==n||n.abort.signal.aborted){r.get(e)===n&&r.delete(e);return}i.ok&&a>0?(n.settled=i,n.keptUntil=t()+a):!i.ok&&Ud(i.error)?(n.settled=i,n.keptUntil=t()+Ld(i.error,t())):r.delete(e)};/* @__PURE__ */
|
|
218
|
+
return Object.freeze({read(e,t,l){let o=r.get(e);if(o?.promise)return i(e,o,l.signal);let s=n(o);if(s!==null&&(l.force!==true||!s.ok&&Ud(s.error)))return Promise.resolve(s);let d={abort:new AbortController,promise:null,settled:null,keptUntil:0,waiters:0};return r.set(e,d),d.promise=t(d.abort.signal).then(t=>(a(e,d,t,l.freshMs),t),t=>{throw d.promise=null,r.get(e)===d&&r.delete(e),t}),i(e,d,l.signal)},peek(e){return n(r.get(e))},invalidate(e){for(let t of[...r.keys()])e.some(e=>t.startsWith(e))&&r.delete(t)}})}var qd=globalThis[/* @__PURE__ */Symbol.for("everfur.sdk.televetReadCaches.v1")]??=/* @__PURE__ */new WeakMap;function Gd(e){let t=qd.get(e);return t===void 0&&(t=Vd(),qd.set(e,t)),t}function useTelevetBookingController(e){let{runtime:t,userRef:userRef,scopeEpoch:r}=rr();return n(()=>e||(userRef===null?null:Qd(t,`${userRef}\0${r}`,()=>{let{services:e}=t.registry;return createTelevetBookingController({auth:e.authFor(userRef),telemetry:e.telemetry,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}})})),[t,userRef,r,e])}var Kd=globalThis[/* @__PURE__ */Symbol.for("everfur.sdk.televetBookingControllers.v1")]??=/* @__PURE__ */new WeakMap;function Qd(e,t,r){let n=Kd.get(e);if(n!==void 0&&n.scope===t)return n.controller;let i=r();return Kd.set(e,{scope:t,controller:i}),i}function useTelevetBookingAvailable(){let{userRef:userRef}=rr(),e=useCapability("televet");return n(()=>({available:e.enabled&&userRef!==null,isPending:e.isPending}),[e.enabled,e.isPending,userRef])}function Yd(e,t,a,s,d=Wd,u=false){let[c,p]=r(()=>{let r=t&&a!==null&&s!==null&&!u?Gd(s).peek(e):null;return r!==null?r.ok?{key:e,data:r.value,isPending:false,error:null}:{key:e,data:null,isPending:false,error:r.error}:{key:e,data:null,isPending:t&&a!==null,error:null}}),[h,f]=r(0),g=o(a);g.current=a;let b=o(s);b.current=s;let m=o(u);i(()=>{let r=g.current;if(!t||r===null){p({key:e,data:null,isPending:false,error:null});return}let n=m.current;m.current=false;let i=b.current===null?null:Gd(b.current),a=n||i===null?null:i.peek(e);if(a!==null){p(a.ok?{key:e,data:a.value,isPending:false,error:null}:{key:e,data:null,isPending:false,error:a.error});return}let l=new AbortController,o=true;return p(t=>t.key===e?{...t,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let t;try{t=i===null?await r(l.signal):await i.read(e,r,{signal:l.signal,freshMs:d,force:n})}catch{o&&p({key:e,data:null,isPending:false,error:null});return}o&&(t.ok?p({key:e,data:t.value,isPending:false,error:null}):p({key:e,data:null,isPending:false,error:t.error}))})(),()=>{o=false,l.abort()}},[e,t,h]);let y=l(()=>{m.current=true,f(e=>e+1)},[]),v=c.key===e;return n(()=>({enabled:t,data:v?c.data:null,isPending:t&&(!v||c.isPending),isError:v&&c.error!==null,error:v?c.error:null,refetch:y}),[t,v,c.data,c.isPending,c.error,y])}function useTelevetNextSlot(e){let t=e?.nextSlot!==void 0,r=e?.nextSlot;return Yd("next-slot",t,t&&r?t=>r.call(e,t):null,e)}function $d(e,t=0,r){let n=e?.listConsults!==void 0,i=e?.listConsults;return Yd(`consults:${t}`,n,n&&i?t=>i.call(e,t):null,e,Wd,r?.reread===true)}function Jd(e){return e.httpStatus!==void 0&&!isVetMessagesDark(e)}function useVetThreads(e,t=0){let a=e?.listVetThreads,o=a!==void 0,[s,d]=r(()=>({availability:o?"pending":"dark",threads:[],isPending:o,error:null})),[u,c]=r(0);i(()=>{if(!e||!a){d({availability:"dark",threads:[],isPending:false,error:null});return}let t=new AbortController,r=true;return d(e=>({...e,isPending:true})),a.call(e,t.signal).then(e=>{r&&(e.ok?d({availability:"lit",threads:e.value,isPending:false,error:null}):isVetMessagesDark(e.error)?d({availability:"dark",threads:[],isPending:false,error:null}):d(t=>({availability:Jd(e.error)?"lit":t.availability,threads:t.threads,isPending:false,error:e.error})))},()=>{r&&d(e=>({...e,isPending:false}))}),()=>{r=false,t.abort()}},[e,a,t,u]);let p=l(()=>c(e=>e+1),[]);return n(()=>({...s,refetch:p}),[s,p])}var Zd="your pet",Xd=/* @__PURE__ */Object.freeze({messagesTitle:"Messages",newPillNative:"New",newPillWeb:"New reply",previewOwnerTemplate:"You: {text}",previewVetTemplateWeb:"{vet}: {text}",threadMetaTemplateNative:"With {vet}",threadLogTemplate:"Messages with {vet}",composerLabelTemplateNative:"Message {vet}",composerLabelWeb:"Message",composerPlaceholderTemplate:"Message {vet}…",send:"Send",composerNoteTemplate:"{vet} usually replies within a day. Emergency? Call a vet.",sent:"Sent",bookVisitWeb:"Book a visit",empty:"No messages yet",loading:"Loading",loadFailed:"Could not load",retry:"Try again",notSent:"Not sent",vetWritesFirst:"Your vet will write first. You can reply once they do.",attachmentsTemplate:"{n} attached",runningLateTemplate:"Running late? Message {vet}",sawTitleTemplate:"What {vet} saw",summaryLabel:"Summary",fromVetTemplate:"From {vet}",planTitleTemplate:"{pet}’s plan",wordForWord:"Word for word",fromThisVisitTitle:"From this visit",messageVetTemplate:"Message {vet}",bookFollowUp:"Book a follow-up",summaryFootnoteTemplate:"A summary of your video visit, written by {vet}. In an emergency, go to the nearest emergency animal hospital.",summaryPending:"Summary on its way"});function eu(e,t){let r=e;for(let[e,n]of Object.entries(t))r=r.split(`{${e}}`).join(n);return r}function tu(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function ru(e){let t=e?.trim()??"";return t.length>0?t:Zd}function nu(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}var iu=/* @__PURE__ */Object.freeze({pastTitle:"Past video visits",upcomingTitle:"Next video visit",bookedPill:"Booked",visitTitleTemplate:"{pet} with {vet}",minutesTemplate:"{n} minutes",emptyTitle:"No visits yet",bookCta:"Find a time",bookCardTitle:"Book a video visit",bookAnotherTitle:"Book another visit",bookCardSubtitle:"Get help for your pet from home.",loadErrorTitle:"Could not load your visits",retryCta:"Try again",statusCompleted:"Completed",statusCancelled:"Cancelled",statusMissed:"Missed",manageCta:"Manage",getReadyCta:"Get ready",joinCta:"Join the visit",joinDisabledReason:"You can join closer to the time.",joinOverReason:"This visit has ended.",vetUnassigned:"Your vet",rescheduleCta:"Reschedule",cancelCta:"Cancel",cancelConfirmTitleTemplate:"Cancel {pet}’s visit?",cancelConfirmTitle:"Cancel this visit?",cancelConfirmBody:"You can book another one afterwards.",cancelConfirmCta:"Cancel the visit",cancelKeepCta:"Keep the visit",cancelWhyTitle:"What changed?",cancelWhyOptional:"Optional",cancelWhyBetterTemplate:"{pet} is better",cancelWhyTime:"The time doesn’t work",cancelWhyRegularVet:"We’ll see our regular vet",cancelWhyOther:"Something else",cancelWhyTimeHint:"Another time might be easier.",cancelMoveInstead:"Move the visit instead",summaryWhen:"When",summaryVet:"Vet",summaryAbout:"About",cancelFailedTitle:"Could not cancel",cancelReason:"Cancelled by the pet parent in the app.",cancelPolicyErrorTitle:"Could not load what you need to agree to",phaseCancelled:"This visit was cancelled",phaseCancelledBody:"You can book another visit when you are ready.",notFoundTitle:"Not found",notFoundBody:"This visit is no longer available.",staleTitle:"Could not load your visits",staleRetry:"Try again"});function au(e,t){return t?e.find(e=>e.petRef===t||e.petId===t)?.name??null:null}var lu=/* @__PURE__ */Object.freeze({bookTitle:iu.bookCardTitle,bookWith:"With an Everfur vet.",bookCta:iu.bookCta,opening:"Next opening {when}",messagesTitle:Xd.messagesTitle,allChats:"All chats",newPill:Xd.newPillNative,pastTitle:iu.pastTitle,allVisits:"All visits",visitTitle:iu.visitTitleTemplate,privacy:"Everfur is a separate provider. Your visits and messages are confidential, and {partner} can't see them."}),ou=2;function EverfurVetHome({petRef:petRef=null,usState:e,onStartInApp:t,vetPhotoUrl:r,controller:i,nowMs:a,style:l}){let o=useEverfurTheme(),s=n(()=>su(o),[o]),{available:d}=useTelevetBookingAvailable(),u=useTelevetBookingController(i),f=useTelevetNextSlot(u),b=$d(u),m=useVetThreads(u,0),{pets:w}=useEverfurPets(),A=a??Date.now(),k=n(()=>splitTelevetVisits(b.data??[],A).past,[b.data,A]),_=r=>{fr({petRef:petRef,...e!==void 0?{usState:e}:{},...r},t)},S=f.data?.startsAt??null,C=S===null?"":Ls(S,true),T=C===""?lu.bookWith:`${lu.bookWith} ${Bs(lu.opening,{when:C})}.`,R=m.availability==="lit"?m.threads.slice(0,ou):[],z=k.slice(0,ou),O=o.meta.displayName.trim(),E=O===""||O==="Everfur"?null:Bs(lu.privacy,{partner:O});/* @__PURE__ */
|
|
219
|
+
return v(g,{style:[s.screen,l],contentContainerStyle:s.content,testID:"everfur-vet-home",children:[d?/* @__PURE__ */v(p,{style:s.card,testID:"everfur-vet-home-book",children:[
|
|
220
|
+
/* @__PURE__ */v(p,{style:s.bookHead,children:[r?/* @__PURE__ */y(c,{source:{uri:r},style:s.photo,accessibilityIgnoresInvertColors:true,testID:"everfur-vet-home-photo"}):null,
|
|
221
|
+
/* @__PURE__ */v(p,{style:s.grow,children:[
|
|
222
|
+
/* @__PURE__ */y(Text,{style:s.bookTitle,accessibilityRole:"header",children:lu.bookTitle}),
|
|
223
|
+
/* @__PURE__ */y(Text,{style:s.muted,testID:"everfur-vet-home-opening",children:T})]})]}),
|
|
224
|
+
/* @__PURE__ */v(h,{onPress:()=>_({start:"booking"}),accessibilityRole:"button",accessibilityLabel:lu.bookCta,style:({pressed:e})=>[s.primary,e?s.pressed:null],testID:"everfur-vet-home-find-time",children:[
|
|
225
|
+
/* @__PURE__ */y(VideoGlyph,{color:o.color.onPrimary}),
|
|
226
|
+
/* @__PURE__ */y(Text,{tier:"control",style:s.primaryLabel,children:lu.bookCta})]})]}):null,R.length>0?/* @__PURE__ */v(p,{style:s.card,testID:"everfur-vet-home-messages",children:[
|
|
227
|
+
/* @__PURE__ */y(CardHead,{title:lu.messagesTitle,action:lu.allChats,onAction:()=>_({start:"visits"}),styles:s,testID:"everfur-vet-home-all-chats"}),R.map(e=>/* @__PURE__ */y(ThreadRow,{thread:e,pets:w,styles:s,onOpen:t=>_({start:"messages",petRef:e.petRef,petName:t})},e.petRef))]}):null,z.length>0?/* @__PURE__ */v(p,{style:s.card,testID:"everfur-vet-home-past",children:[
|
|
228
|
+
/* @__PURE__ */y(CardHead,{title:lu.pastTitle,action:lu.allVisits,onAction:()=>_({start:"visits"}),styles:s,testID:"everfur-vet-home-all-visits"}),z.map(e=>/* @__PURE__ */y(PastRow,{consult:e,petName:au(w,e.petId),styles:s,onOpen:()=>_({start:"visits"})},e.consultId))]}):null,E!==null?/* @__PURE__ */v(p,{style:s.privacy,testID:"everfur-vet-home-privacy",children:[
|
|
229
|
+
/* @__PURE__ */y(LockGlyph,{color:o.color.text.muted}),
|
|
230
|
+
/* @__PURE__ */y(Text,{style:s.privacyText,children:E})]}):null]})}function CardHead({title:e,action:t,onAction:r,styles:n,testID:i}){/* @__PURE__ */
|
|
231
|
+
return v(p,{style:n.head,children:[
|
|
232
|
+
/* @__PURE__ */y(Text,{style:n.headTitle,accessibilityRole:"header",children:e}),
|
|
233
|
+
/* @__PURE__ */y(h,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,hitSlop:12,testID:i,children:/* @__PURE__ */y(Text,{tier:"control",style:n.headAction,children:t})})]})}function ThreadRow({thread:e,pets:t,styles:r,onOpen:n}){let i=t.find(t=>t.petRef===e.petRef)?.name??null,a=tu(ru(i)),l=e.lastMessage,o=l?l.content.split(`\n`)[0]?.trim()??"":"",s=l?l.role==="owner"?eu(Xd.previewOwnerTemplate,{text:o}):o:"",d=e.unreadCount>0,u=nu(e.lastMessageAt);/* @__PURE__ */
|
|
234
|
+
return v(h,{onPress:()=>n(i),accessibilityRole:"button",accessibilityLabel:[a,s,d?lu.newPill:u].filter(Boolean).join(", "),style:({pressed:e})=>[r.row,e?r.pressed:null],testID:`everfur-vet-home-thread-${e.petRef}`,children:[
|
|
235
|
+
/* @__PURE__ */y(p,{style:r.avatar,children:/* @__PURE__ */y(Text,{style:r.avatarText,children:a.charAt(0).toUpperCase()})}),
|
|
236
|
+
/* @__PURE__ */v(p,{style:r.grow,children:[
|
|
237
|
+
/* @__PURE__ */y(Text,{style:r.rowTitle,numberOfLines:1,children:a}),s!==""?/* @__PURE__ */y(Text,{style:r.rowMeta,numberOfLines:1,children:s}):null]}),d?/* @__PURE__ */v(p,{style:r.newPill,testID:`everfur-vet-home-new-${e.petRef}`,children:[
|
|
238
|
+
/* @__PURE__ */y(p,{style:r.newDot}),
|
|
239
|
+
/* @__PURE__ */y(Text,{tier:"badge",style:r.newText,children:lu.newPill.toUpperCase()})]}):u!==""?/* @__PURE__ */y(Text,{tier:"badge",style:r.day,children:u}):null]})}function PastRow({consult:e,petName:t,styles:r,onOpen:n}){let i=useEverfurTheme(),a=e.clinicianName,l=e.reasonText?.split(`\n`)[0]?.trim()??"",o=l!==""?tu(l):t&&a?Bs(lu.visitTitle,{pet:t,vet:a}):t??a??"",s=e.scheduledAt?nu(e.scheduledAt):"",d=[t,s,a].filter(e=>typeof e=="string"&&e!=="").join(" · ");/* @__PURE__ */
|
|
240
|
+
return v(h,{onPress:n,accessibilityRole:"button",accessibilityLabel:[o,d].filter(Boolean).join(", "),style:({pressed:e})=>[r.row,e?r.pressed:null],testID:`everfur-vet-home-past-${e.consultId}`,children:[
|
|
241
|
+
/* @__PURE__ */y(p,{style:r.pastIcon,children:/* @__PURE__ */y(VideoGlyph,{color:i.color.primary})}),
|
|
242
|
+
/* @__PURE__ */v(p,{style:r.grow,children:[o!==""?/* @__PURE__ */y(Text,{style:r.rowTitle,numberOfLines:1,children:o}):null,d!==""?/* @__PURE__ */y(Text,{style:r.rowMeta,numberOfLines:1,children:d}):null]}),
|
|
243
|
+
/* @__PURE__ */y(p,{style:[r.chevron,{borderColor:i.color.text.muted}]})]})}function VetPrivacy(){let e=useEverfurTheme(),t=e.meta.displayName.trim();return t===""||t==="Everfur"?null:/* @__PURE__ */v(p,{style:{flexDirection:"row",alignItems:"flex-start",gap:8,paddingHorizontal:2,paddingVertical:8},testID:"everfur-vet-privacy",children:[
|
|
244
|
+
/* @__PURE__ */y(LockGlyph,{color:e.color.text.muted}),
|
|
245
|
+
/* @__PURE__ */y(Text,{style:{...face(e,"regular"),flex:1,color:e.color.text.muted,fontSize:12,lineHeight:16},children:Bs(lu.privacy,{partner:t})})]})}function VideoGlyph({color:e}){/* @__PURE__ */
|
|
246
|
+
return y(TabsIcon,{name:"video",size:20,color:e})}function LockGlyph({color:e}){/* @__PURE__ */
|
|
247
|
+
return y(TabsIcon,{name:"lock",size:14,color:e})}function su(e){let{color:t,space:r,radius:n,type:i}=e,{size:a}=i;return f.create({screen:{flex:1,minHeight:0,backgroundColor:t.surface},content:{flexGrow:1,padding:16,gap:12},card:{backgroundColor:t.surface,borderWidth:1,borderColor:t.brandBorder,borderRadius:20,padding:16,gap:12},bookHead:{flexDirection:"row",alignItems:"flex-start",gap:12},photo:{width:58,height:58,borderRadius:29,backgroundColor:t.surfaceSubtle},grow:{flex:1,minWidth:0},bookTitle:{...headingFace(e,"bold"),fontWeight:"800",color:t.text.primary,fontSize:20,lineHeight:26},muted:{...face(e,"regular"),color:t.text.muted,fontSize:14,lineHeight:20,marginTop:2},primary:{minHeight:48,borderRadius:n.pill,backgroundColor:t.primary,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:r.sm,paddingHorizontal:r.lg},primaryLabel:{...face(e,"bold"),color:t.onPrimary,fontSize:16,lineHeight:22},pressed:{opacity:.85},head:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:r.sm},headTitle:{...headingFace(e,"bold"),fontWeight:"800",color:t.text.primary,fontSize:17,lineHeight:22},headAction:{...face(e,"bold"),color:t.primary,fontSize:14,lineHeight:18},row:{flexDirection:"row",alignItems:"center",gap:r.md,minHeight:44},avatar:{width:36,height:36,borderRadius:18,backgroundColor:t.surfaceSubtle,alignItems:"center",justifyContent:"center"},pastIcon:{width:20,alignItems:"center",justifyContent:"center"},avatarText:{...face(e,"bold"),color:t.text.primary,fontSize:a.bodyTight,lineHeight:18},rowTitle:{...face(e,"bold"),color:t.text.primary,fontSize:15,lineHeight:20},rowMeta:{...face(e,"regular"),color:t.text.muted,fontSize:13,lineHeight:18},newPill:{flexDirection:"row",alignItems:"center",gap:r.xs,borderWidth:1,borderColor:t.primary,borderRadius:n.pill,paddingHorizontal:r.sm,paddingVertical:2},newDot:{width:6,height:6,borderRadius:3,backgroundColor:t.danger},newText:{...face(e,"monoMedium"),color:t.primary,fontSize:a.micro,lineHeight:14,letterSpacing:.6},day:{...face(e,"mono"),color:t.text.muted,fontSize:12,lineHeight:16},chevron:{width:8,height:8,borderTopWidth:1.75,borderRightWidth:1.75,transform:[{rotate:"45deg"}],marginRight:r.xs},privacy:{marginTop:"auto",flexDirection:"row",alignItems:"flex-start",gap:r.sm,paddingHorizontal:r.xs},privacyText:{...face(e,"regular"),flex:1,color:t.text.muted,fontSize:12,lineHeight:16}})}function installEverfurTabsBar(){Zl({ask:{SeverityCard:SeverityCard,AnswerRecordCards:AnswerRecordCards,PrivacyLine:PrivacyLine,AskBarDisclaimer:AskBarDisclaimer,paint:hn,followUpStyles:wn},records:{TabsPetHead:TabsPetHead,TabsVitals:TabsVitals,TabsTiles:TabsTiles,TabsUpcoming:TabsUpcoming,TabsDeepScreen:TabsDeepScreen,vitalsFrom:Pn.vitalsFrom},vet:{VetHome:EverfurVetHome,VetPrivacy:VetPrivacy,theme:ro,styles:ao,overlay:io},header:{TabsBarHeader:TabsBarHeader,SubTabs:SubTabs,TabsAskBar:TabsAskBar,Icon:TabsIcon,askWords:{vet:re.placeholder,upload:re.attachPhotoOrFileNative}}})}export{installEverfurTabsBar};
|