@everfur/sdk 1.4.0 → 1.5.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/README.md +2 -2
- package/dist/{Chat.d-BXuEjJsg.d.ts → Chat.d-BCfyvzX8.d.ts} +1 -1
- package/dist/{Chat.d-D9n8tSDD.d.cts → Chat.d-Od44h51D.d.cts} +1 -1
- package/dist/{DepthViews.d-PmjccZLr.d.cts → DepthViews.d-BGspxovy.d.cts} +1 -1
- package/dist/{DepthViews.d-aOChkwU2.d.ts → DepthViews.d-BIHVrf9r.d.ts} +1 -1
- package/dist/{DepthViews.d-ktxIIsnb.d.cts → DepthViews.d-BaLh7Lsi.d.cts} +1 -1
- package/dist/{DepthViews.d-CpF_Y_z9.d.ts → DepthViews.d-CEVk9poG.d.ts} +1 -1
- package/dist/ErrorPolicyPort.d-BIdmYQnk.d.cts +43 -0
- package/dist/ErrorPolicyPort.d-BnI5qWg4.d.ts +43 -0
- package/dist/{RecordsPage.d-BfMSOsg_.d.ts → RecordsPage.d-D10RIgdc.d.ts} +1 -1
- package/dist/{RecordsPage.d-DWjFpZs1.d.cts → RecordsPage.d-DbhYNSbq.d.cts} +1 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -1
- package/dist/{attachments.d-DjWUR-h9.d.ts → attachments.d-BlukNfIf.d.ts} +2 -2
- package/dist/{attachments.d-Bsg6duaq.d.cts → attachments.d-CF4lLuGK.d.cts} +2 -2
- package/dist/{bookingCopy.d-ITpabqPr.d.ts → bookingCopy.d-BuDv16WP.d.ts} +12 -12
- package/dist/{bookingCopy.d-B39JAmIZ.d.cts → bookingCopy.d-rnBSqOSN.d.cts} +12 -12
- package/dist/{branding.d-Bzs4HJoN.d.cts → branding.d-CqDLKj1U.d.cts} +1 -1
- package/dist/{branding.d-CiC6xfGT.d.ts → branding.d-XrZYClN4.d.ts} +1 -1
- package/dist/{callCopy.d-Bw6oZT54.d.cts → callCopy.d-BQxpwXqT.d.cts} +3 -3
- package/dist/{callCopy.d-Bw6oZT54.d.ts → callCopy.d-BQxpwXqT.d.ts} +3 -3
- package/dist/{callRoom.d-B1DoYdJe.d.cts → callRoom.d-9Dm7XnUr.d.cts} +1 -1
- package/dist/{callRoom.d-Dqm1rUqT.d.ts → callRoom.d-t-khijDv.d.ts} +1 -1
- package/dist/{casesRepository.d-De4ZtgJ_.d.cts → casesRepository.d-CVuKTkJo.d.cts} +1 -1
- package/dist/{casesRepository.d-DsEeFd0F.d.ts → casesRepository.d-Dn1fK1b2.d.ts} +1 -1
- package/dist/chat/index.cjs +195 -195
- package/dist/chat/index.d.cts +14 -14
- package/dist/chat/index.d.ts +14 -14
- package/dist/chat/index.js +203 -203
- package/dist/chat/lite/index.cjs +206 -206
- package/dist/chat/lite/index.d.cts +14 -14
- package/dist/chat/lite/index.d.ts +14 -14
- package/dist/chat/lite/index.js +206 -206
- package/dist/{chatHandoffToken.d-sbumx0He.d.cts → chatHandoffToken.d-BjfmIxXk.d.cts} +7 -7
- package/dist/{chatHandoffToken.d-YJY6TZbj.d.ts → chatHandoffToken.d-CFiI6IMc.d.ts} +7 -7
- package/dist/{checkin.d-DxpoRutq.d.cts → checkin.d-BP3ZWBfX.d.cts} +19 -7
- package/dist/{checkin.d-C6vh9KVr.d.ts → checkin.d-CokpahFL.d.ts} +19 -7
- package/dist/{chunk-FZ6DAQFH.js → chunk-4KFFE42Z.js} +20 -20
- package/dist/{chunk-ZPIOCHKW.js → chunk-6IHY7HS7.js} +1 -1
- package/dist/{chunk-II4QDD6F.js → chunk-BMYNDBUR.js} +1 -1
- package/dist/{chunk-AJEELSFO.js → chunk-HHCGXQJR.js} +13 -13
- package/dist/client/index.cjs +31 -31
- package/dist/client/index.d.cts +24 -21
- package/dist/client/index.d.ts +24 -21
- package/dist/client/index.js +31 -31
- package/dist/{clinicBatch.d-B3YJc8IO.d.cts → clinicBatch.d-C0xx5L4j.d.cts} +3 -3
- package/dist/{clinicBatch.d-DhvQuPHV.d.ts → clinicBatch.d-DNi4UURs.d.ts} +3 -3
- package/dist/{config.d-DRoQ2lAx.d.ts → config.d-B7Z-KTGq.d.ts} +10 -2
- package/dist/{config.d-BiVy0fLx.d.cts → config.d-ClAI2RZ6.d.cts} +10 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/consent/index.js +2 -2
- package/dist/{context.d-Cq2C4vdh.d.cts → context.d-Bj6-xYPA.d.cts} +13 -7
- package/dist/{context.d-D1l56nFr.d.ts → context.d-DS1GXUEY.d.ts} +13 -7
- package/dist/{copy.d-Ce_8KuZg.d.cts → copy.d--F5A9cXK.d.cts} +3 -3
- package/dist/{copy.d-BP36f_63.d.ts → copy.d-DmxuFJFe.d.ts} +3 -3
- package/dist/core/index.cjs +42 -41
- package/dist/core/index.d.cts +20 -20
- package/dist/core/index.d.ts +20 -20
- package/dist/core/index.js +42 -41
- package/dist/{depth.d-DzMMmRN4.d.ts → depth.d-CgzYE6_n.d.ts} +3 -3
- package/dist/{depth.d-BtlcIqPJ.d.cts → depth.d-DLaP0o8Y.d.cts} +3 -3
- package/dist/{entitlementRepository.d-x2YFdgYD.d.ts → entitlementRepository.d-CkUTlVAb.d.ts} +3 -3
- package/dist/{entitlementRepository.d-CEDU1gZE.d.cts → entitlementRepository.d-DVTp-BB9.d.cts} +3 -3
- package/dist/{focus.d-BX7oahFk.d.cts → focus.d-CLTjm6In.d.cts} +1 -1
- package/dist/{focus.d-armXecf0.d.ts → focus.d-u-HYvim0.d.ts} +1 -1
- package/dist/health-plan/index.cjs +1 -1
- package/dist/health-plan/index.d.cts +17 -17
- package/dist/health-plan/index.d.ts +17 -17
- package/dist/health-plan/index.js +1 -1
- package/dist/{healthPlanRepository.d-DBx7-NLE.d.cts → healthPlanRepository.d-B22kjrYa.d.cts} +3 -3
- package/dist/{healthPlanRepository.d-C7K9dJK5.d.ts → healthPlanRepository.d-CwRXeoM7.d.ts} +3 -3
- package/dist/{idempotency.d-Dak2-pON.d.cts → idempotency.d-CFVMhWcv.d.cts} +1 -1
- package/dist/{idempotency.d-symqJ8Tt.d.ts → idempotency.d-dOFfV91-.d.ts} +1 -1
- package/dist/{identity.d-DOKJFaiz.d.ts → identity.d-D4VtpqRr.d.ts} +1 -1
- package/dist/{identity.d-DIH9h3Le.d.cts → identity.d-DDpXOtas.d.cts} +1 -1
- package/dist/{inbox.d-AuGKeaZv.d.cts → inbox.d-CPcMMz-Y.d.cts} +2 -2
- package/dist/{inbox.d-B5b57OXc.d.ts → inbox.d-DJ9xgU1Z.d.ts} +2 -2
- package/dist/index.cjs +248 -247
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.js +247 -246
- package/dist/{introEvents.d-ehik7PEn.d.cts → introEvents.d-B7acmGwf.d.cts} +1 -1
- package/dist/{introEvents.d-S4Q4BOSt.d.ts → introEvents.d-DW3gLljE.d.ts} +1 -1
- package/dist/{layout.d-Bm2_1wa4.d.ts → layout.d-C8y_ki1V.d.ts} +1 -1
- package/dist/{layout.d-CFF-nBXf.d.cts → layout.d-DfaFM_lp.d.cts} +1 -1
- package/dist/{models.d-DOwpK1ZF.d.ts → models.d-BKmOfoqV.d.cts} +2 -2
- package/dist/{models.d-Su_BBBTW.d.cts → models.d-BULqCO2R.d.ts} +2 -2
- package/dist/notifications/inbox/index.cjs +9 -9
- package/dist/notifications/inbox/index.d.cts +7 -7
- package/dist/notifications/inbox/index.d.ts +7 -7
- package/dist/notifications/inbox/index.js +9 -9
- package/dist/notifications/index.cjs +3 -3
- package/dist/notifications/index.d.cts +8 -8
- package/dist/notifications/index.d.ts +8 -8
- package/dist/notifications/index.js +6 -6
- package/dist/{optInView.d-DbGx1A9R.d.cts → optInView.d-ByDJMrMv.d.cts} +13 -13
- package/dist/{optInView.d-xnIxCLlH.d.ts → optInView.d-DVshLxbD.d.ts} +13 -13
- package/dist/{parse.d-DtHmpAMT.d.cts → parse.d-BDZ7ffgj.d.cts} +4 -1
- package/dist/{parse.d-DtHmpAMT.d.ts → parse.d-BDZ7ffgj.d.ts} +4 -1
- package/dist/{pets.d-BEqKykpu.d.ts → pets.d-BpLObpfM.d.ts} +1 -1
- package/dist/{pets.d-BS6sLxY-.d.cts → pets.d-DXhzTNuI.d.cts} +1 -1
- package/dist/{petsRepository.d-iHrHkXM2.d.ts → petsRepository.d-_QfM7F6T.d.ts} +1 -1
- package/dist/{petsRepository.d-DB5CNKsK.d.cts → petsRepository.d-ai_tZ3lu.d.cts} +1 -1
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +23 -23
- package/dist/{presentation.d-CWGjwq8Z.d.cts → presentation.d-BkIvMtIl.d.cts} +3 -3
- package/dist/{presentation.d-CWGjwq8Z.d.ts → presentation.d-BkIvMtIl.d.ts} +3 -3
- package/dist/records/depth/index.cjs +1 -1
- package/dist/records/depth/index.d.cts +10 -10
- package/dist/records/depth/index.d.ts +10 -10
- package/dist/records/depth/index.js +1 -1
- package/dist/records/index.cjs +2 -2
- package/dist/records/index.d.cts +13 -13
- package/dist/records/index.d.ts +13 -13
- package/dist/records/index.js +71 -71
- package/dist/{requestFunnel.d-SySe6xHp.d.cts → requestFunnel.d-BwZDfWVD.d.cts} +3 -3
- package/dist/{requestFunnel.d-CehftayS.d.ts → requestFunnel.d-DKBPTpsy.d.ts} +3 -3
- package/dist/{route.d-9wclfD-y.d.cts → route.d-DCzQh4ix.d.cts} +3 -3
- package/dist/{route.d-IP_gkOWL.d.ts → route.d-DSYEd2MR.d.ts} +3 -3
- package/dist/{runtimeTypes.d-BdUe3tYs.d.ts → runtimeTypes.d-BzUig75K.d.ts} +15 -11
- package/dist/{runtimeTypes.d-_UZ6rMUY.d.cts → runtimeTypes.d-CL4l7ta4.d.cts} +15 -11
- package/dist/{screenProps.d-Bd2yphad.d.cts → screenProps.d-6xmE1C-V.d.cts} +2 -2
- package/dist/{screenProps.d-D9Vi-Afl.d.ts → screenProps.d-fHBKArt_.d.ts} +2 -2
- package/dist/{sdkConfigStore.d-VPvsIL8E.d.ts → sdkConfigStore.d-BNCVVEWC.d.ts} +1 -1
- package/dist/{sdkConfigStore.d-BHrzkVpP.d.cts → sdkConfigStore.d-C2BAr9kI.d.cts} +1 -1
- package/dist/server/events/index.cjs +4 -4
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +4 -4
- package/dist/server/index.cjs +9 -9
- package/dist/server/index.d.cts +18 -4
- package/dist/server/index.d.ts +18 -4
- package/dist/server/index.js +9 -9
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/slots/index.cjs +1 -1
- package/dist/slots/index.d.cts +6 -6
- package/dist/slots/index.d.ts +6 -6
- package/dist/slots/index.js +1 -1
- package/dist/tabs/index.cjs +88 -85
- package/dist/tabs/index.d.cts +15 -15
- package/dist/tabs/index.d.ts +15 -15
- package/dist/tabs/index.js +87 -84
- package/dist/televet/booking/index.cjs +41 -41
- package/dist/televet/booking/index.d.cts +8 -8
- package/dist/televet/booking/index.d.ts +8 -8
- package/dist/televet/booking/index.js +4 -4
- package/dist/televet/call/index.d.cts +2 -2
- package/dist/televet/call/index.d.ts +2 -2
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.cjs +8 -8
- package/dist/testing/rn/index.d.cts +13 -13
- package/dist/testing/rn/index.d.ts +13 -13
- package/dist/testing/rn/index.js +9 -9
- package/dist/testing/web/index.cjs +3 -3
- package/dist/testing/web/index.d.cts +13 -13
- package/dist/testing/web/index.d.ts +13 -13
- package/dist/testing/web/index.js +1 -1
- package/dist/texting/index.cjs +1 -1
- package/dist/texting/index.d.cts +6 -6
- package/dist/texting/index.d.ts +6 -6
- package/dist/texting/index.js +26 -26
- package/dist/{threadOptions.d-bEAFkIsC.d.cts → threadOptions.d-Bqy5d5Fx.d.cts} +1 -1
- package/dist/{threadOptions.d-U5YBUKM-.d.ts → threadOptions.d-DOEIpk1t.d.ts} +1 -1
- package/dist/{threadOptions.d-BW0rePcs.d.cts → threadOptions.d-Dc57dm7h.d.cts} +7 -7
- package/dist/{threadOptions.d-CrAb71J2.d.ts → threadOptions.d-NSlFx-Lp.d.ts} +7 -7
- package/dist/{timelineRows.d-DXppCSCg.d.cts → timelineRows.d-7w8NsNi4.d.cts} +1 -1
- package/dist/{timelineRows.d-9Uhf4q5d.d.ts → timelineRows.d-CthNM5hV.d.ts} +1 -1
- package/dist/{typeStyle.d-rzVzCfLz.d.ts → typeStyle.d-8mcLhtbH.d.ts} +1 -1
- package/dist/{typeStyle.d-B-YgiWcS.d.cts → typeStyle.d-CLrQZW-r.d.cts} +1 -1
- package/dist/{unreadStore.d-gCsleb6l.d.ts → unreadStore.d-CLnChKca.d.ts} +17 -9
- package/dist/{unreadStore.d-w5x6lEpR.d.cts → unreadStore.d-Donv4bcF.d.cts} +17 -9
- package/dist/{useHealthPlanSubscription.d-CRBPMlsc.d.ts → useHealthPlanSubscription.d-CV7M21HS.d.ts} +3 -3
- package/dist/{useHealthPlanSubscription.d-DfjTYv1u.d.cts → useHealthPlanSubscription.d-SA9-SuKe.d.cts} +3 -3
- package/dist/{useInboxUnread.d-CP3KwSkn.d.ts → useInboxUnread.d-CXiaR3BZ.d.ts} +1 -1
- package/dist/{useInboxUnread.d-DiE_NbtS.d.cts → useInboxUnread.d-DERpMelw.d.cts} +1 -1
- package/dist/{usePresentation.d-DefUwatV.d.cts → usePresentation.d-BJzFicRQ.d.cts} +3 -3
- package/dist/{usePresentation.d-w5_oWKmh.d.ts → usePresentation.d-DgSGIWS-.d.ts} +3 -3
- package/dist/{useRecordsDepth.d-l6D0ZS4l.d.cts → useRecordsDepth.d-C9W45gwS.d.cts} +1 -1
- package/dist/{useRecordsDepth.d-DG2GiAyt.d.ts → useRecordsDepth.d-ZX2rhcUx.d.ts} +1 -1
- package/dist/{useUnread.d-xDOpYyqx.d.ts → useUnread.d-CedFK4k6.d.ts} +5 -5
- package/dist/{useUnread.d-DeRDFtTb.d.cts → useUnread.d-DST1GMmL.d.cts} +5 -5
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view.d-ufGX_MKK.d.cts → view.d-3lxzyJlL.d.cts} +6 -6
- package/dist/{view.d-iTInze7B.d.ts → view.d-DRiYNQJ8.d.ts} +6 -6
- package/dist/web/consent/index.cjs +3 -3
- package/dist/web/consent/index.d.cts +6 -6
- package/dist/web/consent/index.d.ts +6 -6
- package/dist/web/consent/index.js +5 -5
- package/dist/web/health-plan/index.cjs +2 -2
- package/dist/web/health-plan/index.d.cts +17 -17
- package/dist/web/health-plan/index.d.ts +17 -17
- package/dist/web/health-plan/index.js +1 -1
- package/dist/web/inbox/index.cjs +5 -5
- package/dist/web/inbox/index.d.cts +9 -8
- package/dist/web/inbox/index.d.ts +9 -8
- package/dist/web/inbox/index.js +5 -5
- package/dist/web/index.cjs +196 -195
- package/dist/web/index.d.cts +34 -34
- package/dist/web/index.d.ts +34 -34
- package/dist/web/index.js +196 -195
- package/dist/web/intro/index.cjs +10 -10
- package/dist/web/intro/index.d.cts +8 -8
- package/dist/web/intro/index.d.ts +8 -8
- package/dist/web/intro/index.js +6 -6
- package/dist/web/notifications/index.cjs +5 -5
- package/dist/web/notifications/index.d.cts +7 -7
- package/dist/web/notifications/index.d.ts +7 -7
- package/dist/web/notifications/index.js +1 -1
- package/dist/web/records/depth/index.cjs +1 -1
- package/dist/web/records/depth/index.d.cts +10 -10
- package/dist/web/records/depth/index.d.ts +10 -10
- package/dist/web/records/depth/index.js +1 -1
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +13 -13
- package/dist/web/records/index.d.ts +13 -13
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +2 -2
- package/dist/web/records-sheet/index.js +2 -2
- 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 +15 -15
- package/dist/web/televet/booking/index.cjs +7 -7
- package/dist/web/televet/booking/index.d.cts +9 -9
- package/dist/web/televet/booking/index.d.ts +9 -9
- package/dist/web/televet/booking/index.js +69 -69
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.d.cts +2 -2
- package/dist/web/televet/call/index.d.ts +2 -2
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.cjs +6 -6
- package/dist/web/televet/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +6 -6
- package/dist/web/texting/index.d.ts +6 -6
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +1 -1
- package/dist/web/ui/index.js +32 -32
- package/package.json +1 -32
- package/dist/ErrorPolicyPort.d-68yrE3BE.d.ts +0 -23
- package/dist/ErrorPolicyPort.d-DirW9hgO.d.cts +0 -23
package/dist/web/intro/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
"use client";
|
|
3
|
-
import{createContext,useMemo as e,useState as t,useRef as n,useId as r,useCallback as i,useEffect as a,useLayoutEffect as o,useContext as l}from"react";import{createPortal as s}from"react-dom";import{jsxs as d,Fragment as c,jsx as u}from"react/jsx-runtime";var p=[{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:"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}],h=/* @__PURE__ */Object.freeze(p.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(h.map(e=>e.wireCode));var f=/* @__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"}),b=/* @__PURE__ */Object.freeze(h.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:f[e.wireCode]}))),m=new Map(b.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),y=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(b.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let e of[t??"http_envelope",...y]){let t=m.get(e+n);if(t)return t}}var g=/* @__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 g[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(n.startsWith("AUTH"))return"authExpired";switch(r){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 v=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return v.has(e)}var w=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||w.has(e)}var k=500,_=8e3,x=4;function backoffDelayMs(e,t=Math.random){let n=Math.max(0,e),r=Math.min(k*2**n,_);return Math.floor(t()*r)}var C="This feature isn't available on your account right now.",S="Something in that request was not right. Check the details and try again.",$=/* @__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:C,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:S,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:C,runtimeDisposed:S,unknown:"Something went wrong. Please try again."}),E="This session has ended. Please sign in again.",F="linked_account_read_only";function T(e,t,n){return e==="conflict"&&n===F?C:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?E:userFacingError(e)}function userFacingError(e){return $[e]}function I(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false})}var D=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let n=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===F,i={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:T(e,t?.wireCode,r?F:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&D.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)),n);return t?.wireMessage&&I(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&I(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
3
|
+
import{createContext,useMemo as e,useState as t,useRef as n,useId as r,useCallback as i,useEffect as a,useLayoutEffect as o,useContext as l}from"react";import{createPortal as s}from"react-dom";import{jsxs as d,Fragment as c,jsx as u}from"react/jsx-runtime";var p=[{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}],h=/* @__PURE__ */Object.freeze(p.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(h.map(e=>e.wireCode));var f=/* @__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"}),b=/* @__PURE__ */Object.freeze(h.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:f[e.wireCode]}))),m=new Map(b.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),y=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(b.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let e of[t??"http_envelope",...y]){let t=m.get(e+n);if(t)return t}}var g=/* @__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 g[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(n.startsWith("AUTH"))return"authExpired";switch(r){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 v=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return v.has(e)}var w=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||w.has(e)}var k=500,_=8e3,x=4;function backoffDelayMs(e,t=Math.random){let n=Math.max(0,e),r=Math.min(k*2**n,_);return Math.floor(t()*r)}var C="This feature isn't available on your account right now.",S="Something in that request was not right. Check the details and try again.",$=/* @__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:C,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:S,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:C,runtimeDisposed:S,unknown:"Something went wrong. Please try again."}),E="This session has ended. Please sign in again.",F="linked_account_read_only";function T(e,t,n){return e==="conflict"&&n===F?C:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?E:userFacingError(e)}function userFacingError(e){return $[e]}function I(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false})}var D=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let n=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===F,i={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:T(e,t?.wireCode,r?F:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&D.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)),n);return t?.wireMessage&&I(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&I(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
4
4
|
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
5
|
-
return Object.freeze({ok:false,error:e})}var R=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function P(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let n=t.code;return typeof n=="string"&&n.length>0?n:null}function
|
|
6
|
-
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
|
|
5
|
+
return Object.freeze({ok:false,error:e})}var R=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function P(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let n=t.code;return typeof n=="string"&&n.length>0?n:null}function z(e,t){let n=P(e);if(n===null)return e;let r=t[n];return r===void 0?e:makeEverfurError(r.code,{retryable:r.retryable,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:n,reasonCode:n,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}function errorFrame(e){/* @__PURE__ */
|
|
6
|
+
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 O="x-everfur-anon-token",A="anonTokenInvalid";async function N(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function M(e,t){let n=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}:{},...n?{wireMessage:n}:{},...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[O]=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:{...L(e.headers),...authHeaders(t)}}}function L(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===O||(t[n]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let n=await N(t),r=await t.transport.request(withAuthHeaders(e,j(t,n)));if(r.ok||q(r.error.raw)!==A||t.anonIdentity===void 0||t.userRef!==null)return r;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===n?r:t.transport.request(withAuthHeaders(e,j(t,i)))}let n;try{n=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(M(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(M(e,{wireCode:q(r.error.raw),requestId:r.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(B(a.error))):a}function j(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function B(e){let t=e.raw,n=q(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...n?{wireCode:n}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function q(e){if(typeof e!="object"||e===null)return null;let t=e,n=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof n=="string"&&n.length>0?n:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:U(e)})}function U(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var W=3e4,H=_*2,V="idempotency-key",K=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Y=/* @__PURE__ */Object.freeze({onEvent(){}}),G=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Q(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??Y,n=e.timers??G,r=e.rng??Math.random,i=e.sleep??((e,t)=>pe(e,n,t)),a=e.maxAttempts??x,o=e.unaryTimeoutMs??W,l=e.newIdempotencyKey??X(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,c){let u=c?.maxAttempts,p=Math.max(1,u??a),h=c?.idempotent??K.has(d.method),f=c?.idempotencyKey===void 0?null:Q(c.idempotencyKey),b=h?f??l():null,m=Z(d,b),y=0;for(;;){let a=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:y,...b?{idempotencyKey:b}:{},...e});s(a({phase:"attempt"}));let l=ce(o,n),c=ue(l.signal,d.signal),h;try{h=await authedSend({...m,signal:c.signal},e.auth)}catch(e){h=err(networkError(e))}finally{c.dispose(),l.cancel()}if(h.ok)return s(a({phase:"settled",ok:true,reason:"ok"})),h;let f=h.error,g=ee(f,y,{maxAttempts:p,rng:r,now:n.now(),aborted:d.signal?.aborted===true,...u!==void 0?{perCallMaxAttempts:u}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:f.code,reason:g.reason,...f.httpStatus!==void 0?{httpStatus:f.httpStatus}:{},...f.requestId!==void 0?{requestId:f.requestId}:{}};if(!g.retry)return s(a({phase:"settled",...v})),err(f);if(s(a({phase:"retry",...v,delayMs:g.delayMs})),await i(g.delayMs,d.signal),d.signal?.aborted===true)return s(a({phase:"settled",...v,reason:"aborted"})),err(f);y+=1}}async function c(t){return withAuthHeaders(t,await de(e.auth))}async function*u(t,n,r){s(
|
|
7
7
|
/* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:n.method,path:n.path,attempt:0}));try{yield*e.auth.transport.stream(n,r)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
8
8
|
return Object.freeze({send:d,authorize:c,stream:u})}function Z(e,t){let n={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==V&&(n[t]=r);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}function X(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var J=10;function ee(e,t,n){if(n.aborted)return{retry:false,reason:"aborted"};let r=te(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(n.policy===void 0)return false;try{return!n.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let a=()=>{if(n.policy===void 0)return null;let t;try{t=n.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(J,Math.floor(t)))},o=n.perCallMaxAttempts??a()??n.maxAttempts;if(t+1>=o)return{retry:false,reason:"attempts-exhausted"};let l=ne(e,n.now);return l!==null?l>H?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:l}:{retry:true,reason:i,delayMs:backoffDelayMs(t,n.rng)}}function te(e){let t=e.code==="unknown"?fromWire(le(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function ne(e,t){let n=ie(e.raw);if(n!==null){let e=n-t;return e>0?e:0}let r=re(e.raw);return r===null?null:Math.round(r*1e3)}function re(e){for(let t of ae(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function ie(e){for(let t of ae(e)){let e=t.resets_at,n=oe(e);if(n!==null)return n}return null}function ae(e){if(!se(e))return[];let t=[e];for(let n of["error","detail"]){let r=e[n];se(r)&&t.push(r)}return t}function oe(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 le(e){for(let t of ae(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function se(e){return typeof e=="object"&&e!==null}async function de(e){if(e.mode==="anonymous"){let t=await N(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 ce(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return{signal:n.signal,cancel:()=>t.clearTimeout(r)}}function ue(e,t){let n=()=>{};if(!t)return{signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let i=()=>r.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function pe(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let i=t.setTimeout(()=>{n?.removeEventListener("abort",a),r()},e),a=()=>{t.clearTimeout(i),r()};n?.addEventListener("abort",a,{once:true})})}var he=/* @__PURE__ */new Set(["expo","fcm","apns"]),fe=/* @__PURE__ */new Set(["ios","android"]),be=4096,me=128,ye=64,ge=/[\0- ]/;function ve(e,t){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e,...t?{reasonCode:t}:{}})}function we(e){if(typeof e!="object"||e===null)return ve("registerDevice needs an input object");let{token:t,provider:n,platform:r,installationId:i}=e;return typeof n!="string"||!he.has(n)?ve("provider must be expo, fcm or apns"):typeof r!="string"||!fe.has(r)?ve("platform must be ios or android"):typeof t!="string"||t.trim().length===0||t.length>be||ge.test(t)?ve(`token must be a push token of 1..${be} characters with no whitespace`,"token_invalid"):i!==void 0&&(typeof i!="string"||i.length===0||i.length>me)?ve(`installationId must be 1..${me} characters`):null}var ke=/^[A-Za-z][A-Za-z0-9_+-]*(\/[A-Za-z0-9_+-]+){0,2}$/,_e=64,xe=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/,Ce=35;function Se(e){return e.httpStatus===400&&e.code==="validationFailed"}function $e(e){let t={...e};return delete t.timezone,delete t.locale,t}function Ee(e,t,n){return typeof e=="string"&&e.length<=n&&t.test(e)?e:null}function Fe(e){return typeof e!="string"||e.length===0||e.length>ye?ve(`deviceId must be 1..${ye} characters`):ge.test(e)||e.includes("/")||e==="."||e===".."?ve("deviceId is not a device id"):null}function Te(e){if(typeof e!="object"||e===null)return ve("setPreferences needs an input object");let{pushEnabled:t,emailEnabled:n}=e;return typeof t!="boolean"||typeof n!="boolean"?ve("pushEnabled and emailEnabled must both be booleans: the route replaces both switches"):null}function Ie(e){return typeof e=="string"&&e.length>0?e:null}function De(e){if(typeof e!="object"||e===null)return null;let t=e,n=Ie(t.device_id),r=Ie(t.provider),i=Ie(t.platform),a=Ie(t.registered_at),o=Ie(t.last_seen_at);if(n===null||r===null||i===null||a===null||o===null||!he.has(r)||!fe.has(i))return null;let l=t.installation_id;/* @__PURE__ */
|
|
9
|
-
return Object.freeze({deviceId:n,provider:r,platform:i,installationId:typeof l=="string"&&l.length>0?l:null,registeredAt:a,lastSeenAt:o})}function Re(e){if(typeof e!="object"||e===null)return null;let t=e,n=Ie(t.updated_at);return typeof t.push_enabled!="boolean"||typeof t.email_enabled!="boolean"||n===null?null:/* @__PURE__ */Object.freeze({pushEnabled:t.push_enabled,emailEnabled:t.email_enabled,updatedAt:n})}function Pe(e){return makeEverfurError("internalError",{retryable:false,wireMessage:`${e}: the response was not the documented shape`})}var Oe=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function ze(e){return O(e,Oe)}function Ae(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function createNotificationsClient(e){let t=()=>{let{services:t}=e.registry;return Ne({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})};return{registerDevice:(n,r)=>e.isDisposed?Promise.resolve(err(Ae("registerDevice"))):t().registerDevice(n,r),unregisterDevice:(n,r)=>e.isDisposed?Promise.resolve(err(Ae("unregisterDevice"))):t().unregisterDevice(n,r),setPreferences:(n,r)=>e.isDisposed?Promise.resolve(err(Ae("setPreferences"))):t().setPreferences(n,r)}}function Ne(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),n=(e,t)=>t?{...e,signal:t}:e;return{async registerDevice(e,r){let i=we(e);if(i!==null)return err(i);let a={token:e.token,provider:e.provider,platform:e.platform};e.installationId!==void 0&&(a.installation_id=e.installationId);let o=Ee(e.timezone,ke,_e);o!==null&&(a.timezone=o);let l=Ee(e.locale,xe,Ce);l!==null&&(a.locale=l);let s=e=>t.send("notifications.registerDevice",n({method:"POST",path:"/widget/v1/me/devices",body:e},r?.signal)),d=await s(a);if(!d.ok&&Se(d.error)&&(o!==null||l!==null)&&(d=await s($e(a))),!d.ok)return err(ze(d.error));let c=De(d.value);return c===null?err(Pe("registerDevice")):ok(c)},async unregisterDevice(e,r){let i=Fe(e);if(i!==null)return err(i);let a=await t.send("notifications.unregisterDevice",n({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(e)}`},r?.signal));return a.ok?ok(void 0):err(ze(a.error))},async setPreferences(e,r){let i=Te(e);if(i!==null)return err(i);let a=await t.send("notifications.setPreferences",n({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:e.pushEnabled,email_enabled:e.emailEnabled}},r?.signal));if(!a.ok)return err(ze(a.error));let o=Re(a.value);return o===null?err(Pe("setPreferences")):ok(o)}}}var Me=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Le=globalThis,je=Le[Me]??(Le[Me]=createContext(null));je.displayName??="EverfurContext";function Be(){let e=l(je);if(e===null)throw new R("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}var qe=/* @__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 Ue=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Ue(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var We=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var He={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ve={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ke={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Ye={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Ge={regular:"400",medium:"500",bold:"700"},Qe={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},Ze=0,Xe="System",Je="monospace",et=["content","heading","control","compact","badge"];function tt(e){let t={};for(let n of et)t[n]=e;return t}var nt=[];function rt(){return{family:Xe,mono:Je,fontUrl:null,families:{regular:Xe,medium:Xe,bold:Xe,mono:Je,monoMedium:Je,monoBold:Je},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ke,tierSizes:tt(Ke),lineHeight:Ye,weight:Ge,letterSpacing:Qe,scale:1,maxScale:Ze,scaleCaps:We,headingFamily:null,headingWeight:null,fontSources:nt,roles:qe,typeScale:1}}var it={},at=/* @__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 ot={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(at.standard),emphasized:cssCubicBezier(at.emphasized),exit:cssCubicBezier(at.exit)},reducedMotion:false},lt={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)"},st=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:lt,space:He,radius:Ve,type:rt(),motion:ot,slots:it}),dt={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)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:dt,space:He,radius:Ve,type:rt(),motion:ot,slots:it});var ct=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ut=globalThis,pt=ut[ct]??(ut[ct]=createContext(st));pt.displayName??="EverfurThemeContext";function useEverfurTheme(){return l(pt)}function ht(e){if(typeof e=="number")return mt(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return ft(t.slice(1));if(t.toLowerCase().startsWith("0x"))return ft(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return bt(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=ft(t);if(e!==null)return e}return/^\d+$/.test(t)?mt(Number.parseInt(t,10)):null}function ft(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:gt(t[0]),g:gt(t[1]),b:gt(t[2]),a:1};if(t.length===6)return{r:yt(t,0),g:yt(t,2),b:yt(t,4),a:1};if(t.length===8){let e=yt(t,0);return{r:yt(t,2),g:yt(t,4),b:yt(t,6),a:e/255}}return null}function bt(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let i=vt(Number(r[0])),a=vt(Number(r[1])),o=vt(Number(r[2]));if(i===null||a===null||o===null)return null;let l=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;l=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:o,a:l}}function mt(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function yt(e,t){return Number.parseInt(e.slice(t,t+2),16)}function gt(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function vt(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function wt(e,t,n){return`#${kt(e)}${kt(t)}${kt(n)}`.toUpperCase()}function kt(e){return e.toString(16).padStart(2,"0")}var _t="#111111",xt="#FFFFFF",Ct="#000000";function readableOn(e){let t=ht(e);if(t===null)return xt;let n=Et(t),r=Et({r:17,g:17,b:17}),i=Et({r:255,g:255,b:255});return Tt(n,i)>=Tt(n,r)?xt:_t}function St(e,t){let n=readableOn(e);return contrastRatio(n,e)>=t?n:contrastRatio(xt,e)>=contrastRatio(Ct,e)?xt:Ct}function $t(e){let t=t=>e.reduce((e,n)=>Math.min(e,contrastRatio(t,n)),Number.POSITIVE_INFINITY);return t(xt)>=t(Ct)?xt:Ct}function Et(e){let t=Ft(e.r/255),n=Ft(e.g/255),r=Ft(e.b/255);return.2126*t+.7152*n+.0722*r}function Ft(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Tt(e,t){let n=Math.max(e,t),r=Math.min(e,t);return(n+.05)/(r+.05)}function contrastRatio(e,t){let n=ht(e),r=ht(t);if(n===null||r===null)return 1;let i=r.a>=1?r:{...r},a=n.a>=1?n:It(n,i);return Tt(Et(a),Et(i))}function It(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function Dt(e,t){let n=ht(e),r=ht(t);if(n===null||r===null)return null;let i=n.a>=1?n:It(n,{...r});return wt(i.r,i.g,i.b)}function Rt(e,t){let n=ht(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Pt=.05;function Ot(e,t,n,r){let i=t[0];if(i===void 0)return n;let a=e=>t.every(t=>contrastRatio(e,t)>=r);if(ht(e)===null)return n;if(a(e))return e;let o=Dt(e,i),l=o===null?null:ht(o),s=ht(n);if(l===null||s===null)return n;for(let e=1;e<1/Pt;e+=1){let t=e*Pt,n=(e,n)=>Math.round(e+(n-e)*t),r=wt(n(l.r,s.r),n(l.g,s.g),n(l.b,s.b));if(a(r))return r}return n}var zt=/* @__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"}),At=/* @__PURE__ */new WeakMap;function Nt(e){let t=At.get(e);if(t!==void 0)return t;let n=e.color,r=e.brightness==="dark",i=r?{dark:r,ink:n.text.primary,ink2:n.text.secondary,ink3:n.text.muted,paper:n.background,card:n.surface,line:n.borderRingCream,tile:n.surfaceSubtle,shadow:n.shadow,riskBg:n.badgeBgCritical,riskInk:n.danger,riskDot:n.danger,clearBg:n.badgeBgPositive,clearInk:n.success,clearDot:n.success,watchDot:n.warningStrong}:{dark:r,...zt},a=(e,t)=>Ot(e,t,$t(t),Mt),o=(e,t)=>contrastRatio(e,t)>=Mt?e:St(t,Mt),l=[i.card,i.paper].map(e=>Dt(n.brandSoft,e)??e),s={primary:n.primary,onPrimary:o(n.onPrimary,n.primary),accent:n.accent,onAccent:o(n.onAccent,n.accent),link:a(n.linkInk,[i.card,i.paper,i.tile]),badge:n.brandSoft,onBadge:a(n.brandInk,l)},d=/* @__PURE__ */Object.freeze({...i,...s});return At.set(e,d),d}var Mt=4.5;function Lt(e,t){for(let n of t)if(contrastRatio(n,e)>=Mt)return n;return St(e,Mt)}function jt(e,t,n){let r=Rt(e,t);return(r===null?null:Dt(r,n))??n}function Bt(e){let t=Nt(e),n=e.color,r=t.card;return{ink:t.ink,ink2:t.ink2,ink3:t.ink3,paper:t.paper,tile:t.tile,line:t.line,card:r,onInk:t.dark?n.background:"#FFFFFF",primary:t.primary,onPrimary:t.onPrimary,accent:t.accent,onAccent:Lt(t.accent,[t.ink,t.onAccent]),accent2:jt(t.accent,.75,r),accent4:jt(t.accent,.17,r),accentChip:jt(t.accent,.47,r),link:t.link,linkChip:jt(t.link,.2,r),riskDot:t.riskDot,riskChip:t.dark?n.badgeBgCritical:"#FFD8D6",clearBg:t.clearBg,clearInk:t.clearInk,clearChip:t.dark?n.badgeBgPositive:"#DDEFC4",byInk:n.brandInk}}var qt=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var Ut='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Wt="System";function Ht(e){let t=e.trim();return t.length===0||t===Wt?Ut:`${Kt(t)}, ${Ut}`}function Vt(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${Kt(t)}, ui-monospace, Menlo, Consolas, monospace`}function Kt(e){return`"${e.replace(/[\\"]/g,"\\$&")}"`}function faceCss(e,t){let n=e.type,r=n.families[t];return{fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?Vt(r):Ht(r),fontWeight:n.namedFaces[t]?n.weight.regular:n.weight[qt[t]]}}function headingFaceCss(e,t="bold"){let{headingFamily:n,headingWeight:r}=e.type,i=faceCss(e,t);return n===null&&r===null?i:n!==null?{fontFamily:Ht(n),fontWeight:r??e.type.weight[qt[t]]}:e.type.namedFaces[t]||r===null?i:{fontFamily:i.fontFamily,fontWeight:r}}function Yt(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function Gt(e){return{...Bt(e),sans:faceCss(e,"regular").fontFamily,serif:headingFaceCss(e,"bold").fontFamily,mono:Vt(e.type.mono)}}var Qt=/* @__PURE__ */new Set;function Zt(e){Qt.has(e)||!Yt()||(Qt.add(e),globalThis.console?.warn?.(`[everfur] unknown style rule ${e}`))}var Xt=e=>e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());function Jt(e,t,n){let r=Gt(e),i=e.brightness==="dark",a=e=>e.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(e,t)=>t.startsWith("n_")?i?r.line??e:`#${t.slice(2)}`:r[t]??e),o=/* @__PURE__ */new Map;return(...r)=>{let i=r.filter(e=>typeof e=="string"&&e!==""),l=i.join("|"),s=o.get(l);if(s!==void 0)return s;let d={};for(let r of i){let i=t[r];if(i===void 0){Zt(r);continue}for(let[e,t]of i)d[Xt(e)]=a(t);if(e.motion.reducedMotion)for(let[e,t]of n[r]??[])d[Xt(e)]=a(t)}let c=/* @__PURE__ */Object.freeze(d);return o.set(l,c),c}}function en(e){let t=Gt(e);return{root:{boxSizing:"border-box",fontFamily:t.sans,fontSize:17,lineHeight:1.5,color:t.ink,WebkitFontSmoothing:"antialiased",textRendering:"optimizeLegibility",fontVariationSettings:'"SOFT" 0, "WONK" 0',fontVariantLigatures:"no-common-ligatures"},button:{boxSizing:"border-box",font:"inherit",color:"inherit",background:"none",border:0,padding:0,margin:0,cursor:"pointer",textAlign:"inherit",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},text:{margin:0,boxSizing:"border-box"},srOnly:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}}}var tn=/* @__PURE__ */Object.freeze({title:"Request records",clinic:"Clinic",search:"Search clinics by name or location",placeholder:"Clinic name, city, or ZIP",email:"Clinic email",emailPlaceholder:"records@clinic.com",ownerName:"Your full name",scopeHeading:"What you’re authorizing",send:"Send request",sending:"Sending…",cancel:"Cancel",sign:"Signature",draw:"Draw your signature",type:"Type your name to sign",toType:"Can’t draw? Type your name instead",toDraw:"Draw your signature instead",clear:"Clear",drawHint:"Draw your signature in the box above.",clearA11y:"Clear signature",typedSignatureA11y:e=>`Typed signature: ${e}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var nn=/* @__PURE__ */Object.freeze({title:tn.title,titleFor:e=>{let t=e?.trim()??"";return t.length>0?`Request ${t}’s records`:tn.title},leadWeb:"Find the clinic that has them. We send a secure request and read every page they send back.",leadNative:"Find the clinic that has them.",searchLabelWeb:"Find the clinic",howItWorks:"How it works",howSteps:e=>[{title:"We send a secure request",body:"With your permission, straight to the clinic’s records team."},{title:"The clinic sends the file",body:"Most clinics respond within 3 to 5 business days. We follow up for you."},{title:"Everfur reads every page",body:`Visits, vaccines, labs and prescriptions land in ${e}’s records.`}],placeholder:tn.placeholder,searchA11y:tn.search,clearSearch:"Clear search",loading:"Loading clinics",uploadOwn:"I already have the records",uploadOwnStarting:"Setting up your upload…",noPet:"Add a pet first, then come back to request their records.",recentlyUsed:tn.recentlyUsed,noMatch:e=>`No clinics match “${e}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:e=>`Request records from ${e}`,resultsCount:e=>e===1?"Showing 1 clinic":`Showing ${String(e)} clinics`,fallback:/* @__PURE__ */Object.freeze({title:"Can’t find your clinic?",subtitle:"Add it by email and we’ll request your records.",nameLabel:"Clinic name",namePlaceholder:"Your clinic’s name",emailLabel:"Clinic email",emailPlaceholder:"records@clinic.com",reviewNote:"We review every request by hand before reaching out to the clinic.",submit:"Continue"})});var rn=1.609344;function an(e){return e===null||!Number.isFinite(e)?null:(e/rn).toFixed(1)}function on(e){let t=an(e);return t===null?"":`${t} mi`}var ln=300,sn=2;var dn=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",allPetsConsent:"This covers all your pets. You can withdraw it at any time.",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function cn(r,o){let[l,s]=t(""),[d,c]=t(""),[u,p]=t([]),[h,f]=t(null),[b,m]=t([]),[y,g]=t(true),[v,w]=t(false),[k,_]=t(false),[x,C]=t(null),[S,$]=t(null),[E,F]=t(0),T=n(0),I=n(true),D=o?.latitude,R=o?.longitude,P=e(()=>void 0,[D,R]);a(()=>(I.current=true,()=>{I.current=false,T.current+=1}),[r]),a(()=>{let e=true;return g(true),r.recentClinics({limit:5}).then(t=>{e&&(t.ok&&m(t.value.clinics),g(false))}).catch(()=>{e&&g(false)}),()=>{e=false}},[r]),a(()=>{let e=l.trim();if(e.length<sn){c("");return}let t=setTimeout(()=>c(e),ln);return()=>clearTimeout(t)},[l]);let O=d.length>=sn;a(()=>{let e=T.current+=1;if(p([]),f(null),C(null),$(null),!O){w(false);return}w(true),r.searchClinics({query:d,limit:25,...P?{location:P}:{}}).then(t=>{!I.current||e!==T.current||(t.ok?(p(t.value.clinics),f(t.value.nextCursor)):C(t.error),w(false))}).catch(()=>{I.current&&e===T.current&&w(false)})},[r,d,O,P,E]);let z=i(()=>{if(!O||h===null||k)return;let e=T.current;_(true),$(null),r.searchClinics({query:d,limit:25,cursor:h,...P?{location:P}:{}}).then(t=>{!I.current||e!==T.current||(t.ok?(p(e=>[...e,...t.value.clinics]),f(t.value.nextCursor)):$(t.error),_(false))}).catch(()=>{I.current&&e===T.current&&_(false)})},[r,h,d,O,k,P]),A=i(e=>s(e),[]),N=i(()=>F(e=>e+1),[]);return e(()=>({query:l,debouncedQuery:d,isSearchActive:O,clinics:u,recent:b,recentLoading:y,initialLoading:v,loadingMore:k,hasNextPage:h!==null,error:x,pageError:S,setQuery:A,loadMore:z,retry:N}),[l,d,O,u,b,y,v,k,h,x,S,A,z,N])}function un(e,t,n,r){/* @__PURE__ */
|
|
9
|
+
return Object.freeze({deviceId:n,provider:r,platform:i,installationId:typeof l=="string"&&l.length>0?l:null,registeredAt:a,lastSeenAt:o})}function Re(e){if(typeof e!="object"||e===null)return null;let t=e,n=Ie(t.updated_at);return typeof t.push_enabled!="boolean"||typeof t.email_enabled!="boolean"||n===null?null:/* @__PURE__ */Object.freeze({pushEnabled:t.push_enabled,emailEnabled:t.email_enabled,updatedAt:n})}function Pe(e){return makeEverfurError("internalError",{retryable:false,wireMessage:`${e}: the response was not the documented shape`})}var ze=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function Oe(e){return z(e,ze)}function Ae(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function createNotificationsClient(e){let t=()=>{let{services:t}=e.registry;return Ne({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})};return{registerDevice:(n,r)=>e.isDisposed?Promise.resolve(err(Ae("registerDevice"))):t().registerDevice(n,r),unregisterDevice:(n,r)=>e.isDisposed?Promise.resolve(err(Ae("unregisterDevice"))):t().unregisterDevice(n,r),setPreferences:(n,r)=>e.isDisposed?Promise.resolve(err(Ae("setPreferences"))):t().setPreferences(n,r)}}function Ne(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),n=(e,t)=>t?{...e,signal:t}:e;return{async registerDevice(e,r){let i=we(e);if(i!==null)return err(i);let a={token:e.token,provider:e.provider,platform:e.platform};e.installationId!==void 0&&(a.installation_id=e.installationId);let o=Ee(e.timezone,ke,_e);o!==null&&(a.timezone=o);let l=Ee(e.locale,xe,Ce);l!==null&&(a.locale=l);let s=e=>t.send("notifications.registerDevice",n({method:"POST",path:"/widget/v1/me/devices",body:e},r?.signal)),d=await s(a);if(!d.ok&&Se(d.error)&&(o!==null||l!==null)&&(d=await s($e(a))),!d.ok)return err(Oe(d.error));let c=De(d.value);return c===null?err(Pe("registerDevice")):ok(c)},async unregisterDevice(e,r){let i=Fe(e);if(i!==null)return err(i);let a=await t.send("notifications.unregisterDevice",n({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(e)}`},r?.signal));return a.ok?ok(void 0):err(Oe(a.error))},async setPreferences(e,r){let i=Te(e);if(i!==null)return err(i);let a=await t.send("notifications.setPreferences",n({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:e.pushEnabled,email_enabled:e.emailEnabled}},r?.signal));if(!a.ok)return err(Oe(a.error));let o=Re(a.value);return o===null?err(Pe("setPreferences")):ok(o)}}}var Me=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Le=globalThis,je=Le[Me]??(Le[Me]=createContext(null));je.displayName??="EverfurContext";function Be(){let e=l(je);if(e===null)throw new R("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}var qe=/* @__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 Ue=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Ue(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var We=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var He={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ve={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ke={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Ye={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Ge={regular:"400",medium:"500",bold:"700"},Qe={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},Ze=0,Xe="System",Je="monospace",et=["content","heading","control","compact","badge"];function tt(e){let t={};for(let n of et)t[n]=e;return t}var nt=[];function rt(){return{family:Xe,mono:Je,fontUrl:null,families:{regular:Xe,medium:Xe,bold:Xe,mono:Je,monoMedium:Je,monoBold:Je},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ke,tierSizes:tt(Ke),lineHeight:Ye,weight:Ge,letterSpacing:Qe,scale:1,maxScale:Ze,scaleCaps:We,headingFamily:null,headingWeight:null,fontSources:nt,roles:qe,typeScale:1}}var it={},at=/* @__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 ot={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(at.standard),emphasized:cssCubicBezier(at.emphasized),exit:cssCubicBezier(at.exit)},reducedMotion:false},lt={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)"},st=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:lt,space:He,radius:Ve,type:rt(),motion:ot,slots:it}),dt={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)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:dt,space:He,radius:Ve,type:rt(),motion:ot,slots:it});var ct=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ut=globalThis,pt=ut[ct]??(ut[ct]=createContext(st));pt.displayName??="EverfurThemeContext";function useEverfurTheme(){return l(pt)}function ht(e){if(typeof e=="number")return mt(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return ft(t.slice(1));if(t.toLowerCase().startsWith("0x"))return ft(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return bt(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=ft(t);if(e!==null)return e}return/^\d+$/.test(t)?mt(Number.parseInt(t,10)):null}function ft(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:gt(t[0]),g:gt(t[1]),b:gt(t[2]),a:1};if(t.length===6)return{r:yt(t,0),g:yt(t,2),b:yt(t,4),a:1};if(t.length===8){let e=yt(t,0);return{r:yt(t,2),g:yt(t,4),b:yt(t,6),a:e/255}}return null}function bt(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let i=vt(Number(r[0])),a=vt(Number(r[1])),o=vt(Number(r[2]));if(i===null||a===null||o===null)return null;let l=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;l=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:o,a:l}}function mt(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function yt(e,t){return Number.parseInt(e.slice(t,t+2),16)}function gt(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function vt(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function wt(e,t,n){return`#${kt(e)}${kt(t)}${kt(n)}`.toUpperCase()}function kt(e){return e.toString(16).padStart(2,"0")}var _t="#111111",xt="#FFFFFF",Ct="#000000";function readableOn(e){let t=ht(e);if(t===null)return xt;let n=Et(t),r=Et({r:17,g:17,b:17}),i=Et({r:255,g:255,b:255});return Tt(n,i)>=Tt(n,r)?xt:_t}function St(e,t){let n=readableOn(e);return contrastRatio(n,e)>=t?n:contrastRatio(xt,e)>=contrastRatio(Ct,e)?xt:Ct}function $t(e){let t=t=>e.reduce((e,n)=>Math.min(e,contrastRatio(t,n)),Number.POSITIVE_INFINITY);return t(xt)>=t(Ct)?xt:Ct}function Et(e){let t=Ft(e.r/255),n=Ft(e.g/255),r=Ft(e.b/255);return.2126*t+.7152*n+.0722*r}function Ft(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Tt(e,t){let n=Math.max(e,t),r=Math.min(e,t);return(n+.05)/(r+.05)}function contrastRatio(e,t){let n=ht(e),r=ht(t);if(n===null||r===null)return 1;let i=r.a>=1?r:{...r},a=n.a>=1?n:It(n,i);return Tt(Et(a),Et(i))}function It(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function Dt(e,t){let n=ht(e),r=ht(t);if(n===null||r===null)return null;let i=n.a>=1?n:It(n,{...r});return wt(i.r,i.g,i.b)}function Rt(e,t){let n=ht(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Pt=.05;function zt(e,t,n,r){let i=t[0];if(i===void 0)return n;let a=e=>t.every(t=>contrastRatio(e,t)>=r);if(ht(e)===null)return n;if(a(e))return e;let o=Dt(e,i),l=o===null?null:ht(o),s=ht(n);if(l===null||s===null)return n;for(let e=1;e<1/Pt;e+=1){let t=e*Pt,n=(e,n)=>Math.round(e+(n-e)*t),r=wt(n(l.r,s.r),n(l.g,s.g),n(l.b,s.b));if(a(r))return r}return n}var Ot=/* @__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"}),At=/* @__PURE__ */new WeakMap;function Nt(e){let t=At.get(e);if(t!==void 0)return t;let n=e.color,r=e.brightness==="dark",i=r?{dark:r,ink:n.text.primary,ink2:n.text.secondary,ink3:n.text.muted,paper:n.background,card:n.surface,line:n.borderRingCream,tile:n.surfaceSubtle,shadow:n.shadow,riskBg:n.badgeBgCritical,riskInk:n.danger,riskDot:n.danger,clearBg:n.badgeBgPositive,clearInk:n.success,clearDot:n.success,watchDot:n.warningStrong}:{dark:r,...Ot},a=(e,t)=>zt(e,t,$t(t),Mt),o=(e,t)=>contrastRatio(e,t)>=Mt?e:St(t,Mt),l=[i.card,i.paper].map(e=>Dt(n.brandSoft,e)??e),s={primary:n.primary,onPrimary:o(n.onPrimary,n.primary),accent:n.accent,onAccent:o(n.onAccent,n.accent),link:a(n.linkInk,[i.card,i.paper,i.tile]),badge:n.brandSoft,onBadge:a(n.brandInk,l)},d=/* @__PURE__ */Object.freeze({...i,...s});return At.set(e,d),d}var Mt=4.5;function Lt(e,t){for(let n of t)if(contrastRatio(n,e)>=Mt)return n;return St(e,Mt)}function jt(e,t,n){let r=Rt(e,t);return(r===null?null:Dt(r,n))??n}function Bt(e){let t=Nt(e),n=e.color,r=t.card;return{ink:t.ink,ink2:t.ink2,ink3:t.ink3,paper:t.paper,tile:t.tile,line:t.line,card:r,onInk:t.dark?n.background:"#FFFFFF",primary:t.primary,onPrimary:t.onPrimary,accent:t.accent,onAccent:Lt(t.accent,[t.ink,t.onAccent]),accent2:jt(t.accent,.75,r),accent4:jt(t.accent,.17,r),accentChip:jt(t.accent,.47,r),link:t.link,linkChip:jt(t.link,.2,r),riskDot:t.riskDot,riskChip:t.dark?n.badgeBgCritical:"#FFD8D6",clearBg:t.clearBg,clearInk:t.clearInk,clearChip:t.dark?n.badgeBgPositive:"#DDEFC4",byInk:n.brandInk}}var qt=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var Ut='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Wt="System";function Ht(e){let t=e.trim();return t.length===0||t===Wt?Ut:`${Kt(t)}, ${Ut}`}function Vt(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${Kt(t)}, ui-monospace, Menlo, Consolas, monospace`}function Kt(e){return`"${e.replace(/[\\"]/g,"\\$&")}"`}function faceCss(e,t){let n=e.type,r=n.families[t];return{fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?Vt(r):Ht(r),fontWeight:n.namedFaces[t]?n.weight.regular:n.weight[qt[t]]}}function headingFaceCss(e,t="bold"){let{headingFamily:n,headingWeight:r}=e.type,i=faceCss(e,t);return n===null&&r===null?i:n!==null?{fontFamily:Ht(n),fontWeight:r??e.type.weight[qt[t]]}:e.type.namedFaces[t]||r===null?i:{fontFamily:i.fontFamily,fontWeight:r}}function Yt(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function Gt(e){return{...Bt(e),sans:faceCss(e,"regular").fontFamily,serif:headingFaceCss(e,"bold").fontFamily,mono:Vt(e.type.mono)}}var Qt=/* @__PURE__ */new Set;function Zt(e){Qt.has(e)||!Yt()||(Qt.add(e),globalThis.console?.warn?.(`[everfur] unknown style rule ${e}`))}var Xt=e=>e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());function Jt(e,t,n){let r=Gt(e),i=e.brightness==="dark",a=e=>e.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(e,t)=>t.startsWith("n_")?i?r.line??e:`#${t.slice(2)}`:r[t]??e),o=/* @__PURE__ */new Map;return(...r)=>{let i=r.filter(e=>typeof e=="string"&&e!==""),l=i.join("|"),s=o.get(l);if(s!==void 0)return s;let d={};for(let r of i){let i=t[r];if(i===void 0){Zt(r);continue}for(let[e,t]of i)d[Xt(e)]=a(t);if(e.motion.reducedMotion)for(let[e,t]of n[r]??[])d[Xt(e)]=a(t)}let c=/* @__PURE__ */Object.freeze(d);return o.set(l,c),c}}function en(e){let t=Gt(e);return{root:{boxSizing:"border-box",fontFamily:t.sans,fontSize:17,lineHeight:1.5,color:t.ink,WebkitFontSmoothing:"antialiased",textRendering:"optimizeLegibility",fontVariationSettings:'"SOFT" 0, "WONK" 0',fontVariantLigatures:"no-common-ligatures"},button:{boxSizing:"border-box",font:"inherit",color:"inherit",background:"none",border:0,padding:0,margin:0,cursor:"pointer",textAlign:"inherit",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},text:{margin:0,boxSizing:"border-box"},srOnly:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}}}var tn=/* @__PURE__ */Object.freeze({title:"Request records",clinic:"Clinic",search:"Search clinics by name or location",placeholder:"Clinic name, city, or ZIP",email:"Clinic email",emailPlaceholder:"records@clinic.com",ownerName:"Your full name",scopeHeading:"What you’re authorizing",send:"Send request",sending:"Sending…",cancel:"Cancel",sign:"Signature",draw:"Draw your signature",type:"Type your name to sign",toType:"Can’t draw? Type your name instead",toDraw:"Draw your signature instead",clear:"Clear",drawHint:"Draw your signature in the box above.",clearA11y:"Clear signature",typedSignatureA11y:e=>`Typed signature: ${e}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var nn=/* @__PURE__ */Object.freeze({title:tn.title,titleFor:e=>{let t=e?.trim()??"";return t.length>0?`Request ${t}’s records`:tn.title},leadWeb:"Find the clinic that has them. We send a secure request and read every page they send back.",leadNative:"Find the clinic that has them.",searchLabelWeb:"Find the clinic",howItWorks:"How it works",howSteps:e=>[{title:"We send a secure request",body:"With your permission, straight to the clinic’s records team."},{title:"The clinic sends the file",body:"Most clinics respond within 3 to 5 business days. We follow up for you."},{title:"Everfur reads every page",body:`Visits, vaccines, labs and prescriptions land in ${e}’s records.`}],placeholder:tn.placeholder,searchA11y:tn.search,clearSearch:"Clear search",loading:"Loading clinics",uploadOwn:"I already have the records",uploadOwnStarting:"Setting up your upload…",noPet:"Add a pet first, then come back to request their records.",recentlyUsed:tn.recentlyUsed,noMatch:e=>`No clinics match “${e}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:e=>`Request records from ${e}`,resultsCount:e=>e===1?"Showing 1 clinic":`Showing ${String(e)} clinics`,fallback:/* @__PURE__ */Object.freeze({title:"Can’t find your clinic?",subtitle:"Add it by email and we’ll request your records.",nameLabel:"Clinic name",namePlaceholder:"Your clinic’s name",emailLabel:"Clinic email",emailPlaceholder:"records@clinic.com",reviewNote:"We review every request by hand before reaching out to the clinic.",submit:"Continue"})});var rn=1.609344;function an(e){return e===null||!Number.isFinite(e)?null:(e/rn).toFixed(1)}function on(e){let t=an(e);return t===null?"":`${t} mi`}var ln=300,sn=2;var dn=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",allPetsConsent:"This covers all your pets. You can withdraw it at any time.",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function cn(r,o){let[l,s]=t(""),[d,c]=t(""),[u,p]=t([]),[h,f]=t(null),[b,m]=t([]),[y,g]=t(true),[v,w]=t(false),[k,_]=t(false),[x,C]=t(null),[S,$]=t(null),[E,F]=t(0),T=n(0),I=n(true),D=o?.latitude,R=o?.longitude,P=e(()=>void 0,[D,R]);a(()=>(I.current=true,()=>{I.current=false,T.current+=1}),[r]),a(()=>{let e=true;return g(true),r.recentClinics({limit:5}).then(t=>{e&&(t.ok&&m(t.value.clinics),g(false))}).catch(()=>{e&&g(false)}),()=>{e=false}},[r]),a(()=>{let e=l.trim();if(e.length<sn){c("");return}let t=setTimeout(()=>c(e),ln);return()=>clearTimeout(t)},[l]);let z=d.length>=sn;a(()=>{let e=T.current+=1;if(p([]),f(null),C(null),$(null),!z){w(false);return}w(true),r.searchClinics({query:d,limit:25,...P?{location:P}:{}}).then(t=>{!I.current||e!==T.current||(t.ok?(p(t.value.clinics),f(t.value.nextCursor)):C(t.error),w(false))}).catch(()=>{I.current&&e===T.current&&w(false)})},[r,d,z,P,E]);let O=i(()=>{if(!z||h===null||k)return;let e=T.current;_(true),$(null),r.searchClinics({query:d,limit:25,cursor:h,...P?{location:P}:{}}).then(t=>{!I.current||e!==T.current||(t.ok?(p(e=>[...e,...t.value.clinics]),f(t.value.nextCursor)):$(t.error),_(false))}).catch(()=>{I.current&&e===T.current&&_(false)})},[r,h,d,z,k,P]),A=i(e=>s(e),[]),N=i(()=>F(e=>e+1),[]);return e(()=>({query:l,debouncedQuery:d,isSearchActive:z,clinics:u,recent:b,recentLoading:y,initialLoading:v,loadingMore:k,hasNextPage:h!==null,error:x,pageError:S,setQuery:A,loadMore:O,retry:N}),[l,d,z,u,b,y,v,k,h,x,S,A,O,N])}function un(e,t,n,r){/* @__PURE__ */
|
|
10
10
|
return Object.freeze({key:e?.id??`free:${t??""}`,clinic:e,freeText:t,email:n,idempotencyKey:r})}var pn={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};function hn(e){switch(e){case"chat":/* @__PURE__ */
|
|
11
11
|
return u("path",{...pn,strokeLinecap:"butt",strokeWidth:1.7,d:"M5 5.2h14a1.6 1.6 0 0 1 1.6 1.6v8.6a1.6 1.6 0 0 1-1.6 1.6h-8.7l-4.8 3.6v-3.6H5a1.6 1.6 0 0 1-1.6-1.6V6.8A1.6 1.6 0 0 1 5 5.2z"});case"heartcheck":/* @__PURE__ */
|
|
12
12
|
return d("g",{...pn,strokeWidth:1.8,children:[
|
|
@@ -37,7 +37,7 @@ return d("button",{type:"button",role:"radio","aria-checked":t,style:{...D,...r(
|
|
|
37
37
|
/* @__PURE__ */,u("button",{type:"button",style:{...D,...r(".in-link",".in-none .in-link")},onClick:()=>v(true),children:a.add})]}):null]}),
|
|
38
38
|
/* @__PURE__ */u("p",{style:{...i.text,...r(".in-p",".in-p--s")},children:a.more}),
|
|
39
39
|
/* @__PURE__ */u("button",{type:"button",disabled:!I,style:{...D,...r(".emb-btn",".emb-btn--block",".in-body .emb-btn",!I&&".emb-btn[disabled]")},onClick:T,children:a.request}),p===void 0?null:/* @__PURE__ */u("button",{type:"button",style:{...D,...r(".in-link")},onClick:p,children:a.upload})]})}}function gn(e){return function({petRef:petRef,petName:t,draft:n,ownerName:r,onCaptureSignature:i,onCreated:a}){/* @__PURE__ */
|
|
40
|
-
return u(e.EverfurRecordsConsent,{petRef:petRef,...t===void 0?{}:{petName:t},clinic:n,...r===void 0?{}:{ownerName:r},...i===void 0?{}:{onCaptureSignature:i},onCreated:a})}}var vn=null;function wn(){return vn===null&&(vn=import("@everfur/sdk/web/records").then(e=>({Clinic:yn(e),Consent:gn(e)}),()=>(vn=null,null))),vn}function kn(n){let[r,i]=t(null);return a(()=>{if(!n||r!==null)return;let e=true;return wn().then(t=>{e&&t!==null&&i(t)}),()=>{e=false}},[n,r]),e(()=>r,[r])}function healthPlanPetWords(e,t){let n=e?.trim()??"",r=n===""?"your pet":n,i=n===""?"Your pet":n;return t==="female"?{name:r,Name:i,poss:"her",Poss:"Her",obj:"her"}:t==="male"?{name:r,Name:i,poss:"his",Poss:"His",obj:"him"}:{name:r,Name:i,poss:`${r}'s`,Poss:`${i}'s`,obj:r}}var _n=e=>e===null?"":`${e.productName} renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(e){let t=healthPlanPetWords(e.name,e.sex),n=e=>e.petName?.trim()||t.name,NameOf=e=>e.petName?.trim()||t.Name,r=/* @__PURE__ */Object.freeze({jumpKicker:(e,n)=>n?`In ${t.poss} plan, every ${e.intervalDays} days`:e.offer?`${e.discountPercent}% off ${t.poss} first box`:e.intervalDays>0?`Ships every ${e.intervalDays} days`:r.onceLine(e),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:e=>e.offer?`First box, then ${e.box??""}`:`${e.box??""} every ${e.intervalDays} days`,priceLine:e=>e.offer?`${e.discountPercent}% off the first box. Ships every ${e.intervalDays} days.`:e.intervalDays>0?`Ships every ${e.intervalDays} days.`:r.onceOffer(e),once:"One box",onceLine:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:e=>`Buy one box, ${e.once??e.box??""}`,subscribed:"Subscribed",subscribedLine:(e,t)=>t===null?`Every ${e.intervalDays} days`:`Every ${e.intervalDays} days · next box ${t}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:e=>`Checkout: ${e.productName}`,checkoutOffer:e=>`${e.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:e=>`${e} days`,buyOnceOption:"Buy once",checkoutGo:(e,t,n)=>`${t?"Subscribe":"Buy now"} · ${n} today`,renews:e=>`Renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:e=>`${NameOf(e)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:e=>`${e.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${t.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:e=>e===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${e}`,refill:`A text 3 days before ${t.poss} next box. Reply SKIP to skip it.`,nextBoxShips:e=>`${t.Poss} next box ships, ${e.box??""}.`,startedDone:`Back to ${t.poss} plan`,manageKicker:"Your subscription",manageTitle:e=>`Manage ${e.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(e,n)=>n===null?"Skipped.":`Skipped. ${t.Poss} next box ships ${n}.`,cancelled:e=>`${e.productName} is cancelled. Restart it from ${t.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:e=>e>0?`Cart, ${e} item${e>1?"s":""}`:"Cart, empty",addToCart:e=>`Add to cart · ${e}`,viewCart:"View cart",addedToCart:(e,t)=>`${e.productName} is in your cart${t?", as a subscription":""}.`,removedFromCart:e=>`${e} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:e=>`${NameOf(e)}'s plan pick lands here when you add it.`,seeOrders:`See ${t.poss} orders`,quantityLabel:e=>`How many: ${e}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:e=>e.offer?`First box ${e.discountPercent}% off, then ${e.box??""} every ${e.intervalDays} days`:`Every ${e.intervalDays} days`,cartOnceLine:(e,n)=>n?`An extra box. ${t.Poss} plan keeps shipping.`:e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",cartModeLabel:e=>`How to buy ${e}`,cartModeSubscribe:e=>e.offer?`Subscribe, ${e.discountPercent}% off the first box`:"Subscribe",cartModeOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:e=>`Then ${e.productName}`,renewsEvery:e=>`${e.box??""} every ${e.intervalDays} days`,checkoutCart:e=>`Checkout · ${e}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:e=>`Subscription, every ${e.intervalDays} days`,cartItemQuantity:e=>`Qty ${e}`,placeOrder:(e,t)=>`${t?"Place order and subscribe":"Place order"} · ${e}`,cartFine:e=>`${e===null?"":`${_n(e)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${t.Poss} subscription`,nextBox:e=>`Next box ${e}`,everyDays:e=>`Every ${e} days`,ordersHeading:e=>e?"Orders":`${t.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:e=>`The boxes from ${n(e)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:e=>e===null?"Order":`Order ${e}`,arrivesBy:e=>`Arrives by ${e}`,deliveredOn:e=>`Delivered ${e}`,expected:e=>`Expected ${e}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:e=>`Track on ${e}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(e,t)=>`Qty ${e}${t?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${t.poss} weight to size ${t.poss} dose`,addWeightBody:`From a home scale or ${t.poss} last vet visit.`,connectRecordsTitle:`Connect ${t.poss} vet records`,connectRecordsBody:`${t.Poss} weight, visits and labs make ${t.poss} plan sharper.`,weightKicker:`${t.Poss} weight`,weightTitle:e=>`Add ${n(e)}'s weight`,weightBody:`From a home scale or ${t.poss} last vet visit. ${t.Poss} plan uses it to size ${t.poss} dose.`,weightField:`${t.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${t.poss} weight in pounds, like 14.1.`,weightSave:`Save ${t.poss} weight`,weightSaved:e=>`Saved: ${e} lb. ${t.Poss} dose is sized for ${t.obj}.`,weightSavedKg:e=>`Saved: ${e} kg. ${t.Poss} dose is sized for ${t.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:e=>`Built with ${e}`,fromVet:e=>`From ${e}`,waitVetTips:e=>`Free tips from ${e}, built around that risk`,signalsFit:e=>`${e} of ${e} signals fit ${t.Name}`,signalsValue:e=>`${e}/${e}`,noPick:`No supplement for this one. ${t.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${t.poss} next checkup`,savedForCheckup:`Saved for ${t.poss} next checkup`,blanksLabel:`${t.Poss} three blanks`,blanksAsked:e=>`Asked ${e}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${t.poss} vet records`,blanksFilled:(e,t)=>`${e} of ${t} filled`,blanksWeight:`Keep ${t.obj} at `,blanksWeightSource:`From ${t.poss} vet visits`,blanksDose:(e,t)=>`${e} of ${t}`,blanksDoseSource:`Sized to ${t.poss} weight`,blanksShots:`${t.Poss} next shots are due `,blanksShotsSource:`From ${t.poss} clinic`,blankEmpty:"blank",recordsLanded:`${t.Poss} records are in. ${t.Poss} plan now uses ${t.poss} weight and ${t.poss} visits.`,todayLabel:`${t.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${t.poss} report`,askReport:"Ask about it",fullOpen:`See ${t.poss} full plan`,fullOpenLine:`${t.Poss} vet, reviews and ${t.poss} checkup`,fullClose:`Show ${t.poss} brief plan`,fullCloseLine:`${t.Poss} risk, tips, pick and signs`,hopeNoted:e=>`Noted. When ${t.poss} results land, we'll start with ${e}.`,productLink:e=>`${e}, see the product`,productPhotos:e=>`${e} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${t.name}`,ratingLine:e=>`· ${e} reviews`,productOffer:e=>`${e.discountPercent}% off ${t.poss} first box`,productEvery:e=>`Every ${e.intervalDays} days`,productOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:e=>`On ${t.poss} plan, every ${e.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:e=>`${e} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:e=>`Read all ${e} reviews`,starsLabel:e=>`${e} out of 5 stars`,buyNow:"Buy now"});return r}healthPlanFocusCopyFor({sex:"female"});var xn=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(e,t){let n=healthPlanPetWords(e,t);return{...n,subj:t==="female"?"she":t==="male"?"he":n.name}}var Cn=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(e){return Number.isInteger(e)&&e>=1&&e<=10?Cn[e]??null:null}var Sn=e=>e===""?e:e.charAt(0).toUpperCase()+e.slice(1);function defaultIntroBlanks(e){return[{before:`Keep ${e.obj} at `,after:" lb",source:`From ${e.poss} vet visits`},{before:`${e.Poss} next shots are due `,after:"",source:`From ${e.poss} clinic`,width:"l"}]}function introFacts(e,t){let n=e?.pet.name??t??null,r=e?.page??null,i=r?.byline?.name?.trim()??"";return{pet:introPetWords(n,e?.pet.sex??null),planTitle:r?.title.trim()??"",vetName:e?.vetReviewed===true&&i!==""?i:null,tips:r?.routine?.steps.length??0}}function introText(e){let{facts:t,copy:n,resultsPending:r}=e,i=t.pet,a=numberWord(e.blanks),o=numberWord(t.tips),l=n.planTopic.trim(),s=t.vetName===null?null:t.vetName.replace(/ /g," "),d=l===""?"":`One plan for ${i.poss} ${l}${s===null?"":`, built with ${s}`}.`,c=o===null?"":`${Sn(o)} tips, one thing to add.`,u=r?`${i.Poss} plan arrives with ${i.poss} results.`:[d,c].filter(e=>e!=="").join(" "),p=[`What could go wrong for ${i.name}, and what's changed.`,n.recordsRowMore.trim()].filter(e=>e!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${i.Name}'s tab`,records:`Request ${i.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:n.eyebrow,title:`${i.Name}'s health, in three tabs.`,lede:r?n.pendingLede:n.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${i.name} any hour (the 2 am ones too).`,plan:u,records:p,next:"Next",seePlan:`See ${i.poss} plan`},ask:{title:n.askTitle,lede:a===null?"":`${i.Poss} plan has ${a} blanks only ${i.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${e.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${i.poss} vet`,fine:`We send ${i.poss} clinic a secure request and read every page they send back.`,noVet:`${i.Name} doesn't have a vet yet`},clinic:{title:`Where does ${i.name} see ${i.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${i.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${i.subj} sees most.`,request:`Request ${i.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${i.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${i.Poss} records request`,sentStep:"Request sent",sentTo:e=>`Today, to ${e}`,clinicStep:`${i.Poss} clinic sends ${i.poss} records`,clinicEta:n.clinicEta,blanksStep:a===null?"":`${i.Poss} ${a} blanks fill in`,blanksDetail:n.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${i.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:n.sentFine},noVet:{title:n.noVetTitle,lede:a===null?"":`When ${i.subj} does, connect ${i.poss} vet in Records and ${i.poss} ${a} blanks fill in.`,seePlan:`See ${i.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${i.name}'s records are in.`,off:`Requested. ${i.Name}'s records will show up here when they're in.`,landed:`${i.Poss} records are in. ${i.Poss} plan now uses ${i.poss} weight and ${i.poss} visits.`},banner:{app:n.appName,now:"now",title:`${i.Name}'s records are in`,body:n.bannerBody}}}function $n(e,t){let n=`${t.key}\n${t.email}`,r=e.get(n);return r===void 0?(e.set(n,t.idempotencyKey),t):r===t.idempotencyKey?t:/* @__PURE__ */Object.freeze({...t,idempotencyKey:r})}function isIntroSwipeOut(e,t){let n=t>0?Math.abs(e)/t:0;return e>90||e>12&&n>.11}var En="everfur:records-requested",Fn="everfur:records-landed";function Tn(e,t){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(e,{detail:t}))}catch{}}var In={".serif":[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]],".emb-btn":[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition-property","transform, opacity"],["transition-duration","160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".emb-btn svg":[["width","20px"],["height","20px"]],".emb-btn--block":[["width","100%"]],".emb-btn--ghost":[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]],".emb-btn--sm":[["min-height","40px"],["padding","0 16px"],["font-size","15px"]],".emb-btn--lg":[["min-height","56px"],["padding","0 28px"],["font-size","17px"]],".emb-btn[disabled]":[["opacity",".32"],["pointer-events","none"]],".cp-tag":[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]],".cp-tag--s":[["background","$card"],["color","$ink"]],".sh-track":[["list-style","none"],["margin","0"],["padding","0"]],".sh-track li":[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]],".sh-track li:last-child":[["padding-bottom","0"]],".sh-track li::before":[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]],".sh-track li:last-child::before":[["display","none"]],".sh-track li.is-done:has(+ li.is-done)::before":[["background","$primary"]],".sh-track__dot":[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]],".sh-track__dot svg":[["width","13px"],["height","13px"],["color","$card"]],".sh-track .is-done .sh-track__dot":[["background","$ink"],["box-shadow","none"]],".sh-track .is-now .sh-track__dot":[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]],".sh-track strong":[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]],".sh-track small":[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]],".sh-track li:not(.is-done):not(.is-now) strong":[["color","$ink3"],["font-weight","700"]],".ph-intro":[["position","absolute"],["inset","0"],["z-index","45"]],".in-dim":[["position","absolute"],["left","0"],["right","0"],["background","rgba(38, 37, 35, .5)"],["opacity","0"],["transition-property","opacity"],["transition-duration","240ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".in-dim--top":[["top","0"],["height","var(--in-t, 140px)"]],".in-dim--mid":[["top","var(--in-t, 140px)"],["height","var(--in-h, 46px)"]],".in-dim--bot":[["top","calc(var(--in-t, 140px) + var(--in-h, 46px))"],["bottom","0"]],".ph-intro.is-on .in-dim--top":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on .in-dim--bot":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["opacity","1"],["transition-duration","380ms"]],".in-sheet":[["position","absolute"],["left","0"],["right","0"],["bottom","0"],["max-height","calc(100% - var(--in-t, 140px) - var(--in-h, 46px) - 10px)"],["overflow","hidden auto"],["scrollbar-width","none"],["overscroll-behavior","contain"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 30px"],["box-shadow","0 -10px 30px rgba(38, 37, 35, .14)"],["transform","translateY(100%)"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"],["touch-action","pan-y"]],".ph-intro.is-all .in-sheet":[["max-height","calc(100% - 56px)"]],".ph-intro.is-on .in-sheet":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".in-sheet.is-drag":[["transition-property","none",1],["transition-duration","0s",1],["transition-timing-function","ease",1],["transition-delay","0s",1]],".in-grab":[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 8px"]],".in-top":[["display","flex"],["align-items","center"],["gap","12px"],["min-height","40px"]],".in-back":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"]],".in-x":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"],["margin","0 -10px 0 auto"]],".in-back svg":[["width","22px"],["height","22px"]],".in-x svg":[["width","22px"],["height","22px"]],".in-bars":[["flex","1"],["display","flex"],["gap","6px"]],".in-bars b":[["flex","1"],["height","4px"],["border-radius","2px"],["background","$line"],["overflow","hidden"],["position","relative"]],".in-bars b::after":[["position","absolute"],["inset","0"],["background","$ink"],["border-radius","2px"],["transform","scaleX(0)"],["transform-origin","left"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-bars b.on::after":[["transform","none"]],".in-skip":[["min-height","40px"],["padding","0 4px 0 10px"],["margin-right","-4px"],["font-size","15.5px"],["font-weight","700"],["color","$ink2"],["flex","none"]],'.in-sheet[data-mode="records"] .in-bars':[["display","none"]],'.in-sheet[data-mode="records"] .in-skip':[["display","none"]],'.in-sheet[data-mode="intro"] .in-x':[["display","none"]],'.in-sheet[data-mode="records"] .in-top':[["justify-content","space-between"]],".in-body":[["display","grid"],["gap","14px"],["padding-top","6px"]],".in-eyebrow":[["display","flex"],["align-items","center"],["flex-wrap","wrap"],["gap","4px 8px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".in-by":[["display","inline-flex"],["align-items","center"],["gap","5px"],["text-transform","none"],["letter-spacing","0"],["font-weight","500"],["font-size","13px"]],".in-by svg":[["width","54px"],["height","19px"],["color","$n_10462E"]],".in-h":[["font-size","29px"],["line-height","1.08"],["margin","-2px 0 0"],["outline","none"]],".in-p":[["font-size","16px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]],".in-p--s":[["font-size","15px"]],".in-rows":[["list-style","none"],["margin","2px 0 0"],["padding","0"],["display","grid"],["gap","9px"]],".in-rows li":[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","12px"],["align-items","start"],["background","$paper"],["border-radius","18px"],["padding","13px 14px"]],".in-rows b":[["display","block"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]],".in-rows li > span:last-child > span":[["display","block"],["font-size","15px"],["line-height","1.4"],["color","$ink2"],["text-wrap","pretty"],["margin-top","1px"]],".in-ic":[["width","40px"],["height","40px"],["border-radius","12px"],["display","grid"],["place-items","center"]],".in-ic svg":[["width","22px"],["height","22px"]],".in-ic--y":[["background","$accentChip"]],".in-ic--c":[["background","$linkChip"]],".in-ic--g":[["background","$clearChip"]],".in-rise .in-rows li":[["animation","inRow 260ms cubic-bezier(0.23, 1, 0.32, 1) both"],["animation-delay","calc(560ms + var(--i, 0) * 60ms)"]],".in-pair":[["display","grid"],["grid-template-columns","1fr 1.5fr"],["gap","10px"]],".in-stack":[["display","grid"],["gap","8px"]],".in-body .emb-btn":[["transition-property","transform, opacity"],["transition-duration","120ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".in-fine":[["font-size","13.5px"],["line-height","1.4"],["color","$ink3"],["text-align","center"],["text-wrap","pretty"]],".in-link":[["justify-self","center"],["min-height","40px"],["padding","0 8px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-underline-offset","3px"],["transition-property","transform"],["transition-duration","120ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".blanks":[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]],".blanks__h":[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".blanks__h em":[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$onAccent"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]],'.blanks[data-st="filled"] .blanks__h em':[["background","$clearBg"],["color","$clearInk"]],".blanks ol":[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]],".blanks li":[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]],".blanks li > b":[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"],["background","$accentChip"]],".blanks li > span":[["font-size","16px"],["font-weight","700"],["line-height","1.35"]],".blanks li > small":[["font-size","13.5px"],["color","$ink3"]],".blank":[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]],".blank--s":[["min-width","24px"]],".blank--l":[["min-width","64px"]],'.blanks[data-st="filled"] .blank':[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]],".blank.is-flash":[["animation","blankFlash 900ms ease-out both"],["animation-delay","calc(var(--i, 0) * 80ms)"]],".in-body .blank":[["animation","blankPulse 520ms ease-in-out both"],["animation-delay","calc(300ms + var(--i, 0) * 80ms)"]],".in-search":[["display","flex"],["align-items","center"],["gap","10px"],["height","50px"],["border-radius","14px"],["background","$paper"],["box-shadow","inset 0 0 0 1.5px $ink"],["padding","0 14px"]],".in-search svg":[["width","20px"],["height","20px"],["color","$ink3"],["flex","none"]],".in-search input":[["flex","1"],["min-width","0"],["border","0"],["background","none"],["font","inherit"],["font-size","16px"],["color","$ink"],["outline","none"]],".in-clinics":[["display","grid"],["gap","8px"]],".in-clinic":[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 24px"],["align-items","center"],["gap","10px"],["text-align","left"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["transition-property","transform, background-color, box-shadow"],["transition-duration","120ms, 160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease, ease"],["transition-delay","0s, 0s, 0s"]],".in-clinic b":[["display","block"],["font-size","16px"],["line-height","1.3"]],".in-clinic b .cp-tag":[["margin-left","6px"],["vertical-align","2px"],["box-shadow","inset 0 0 0 1px $line"]],".in-clinic small":[["display","block"],["font-size","14px"],["color","$ink3"],["margin-top","1px"]],'.in-clinic[aria-checked="true"]':[["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"]],".in-tick":[["width","24px"],["height","24px"],["border-radius","50%"],["display","grid"],["place-items","center"],["box-shadow","inset 0 0 0 1.5px $n_CFCBC4"]],".in-tick svg":[["width","14px"],["height","14px"],["color","$card"],["opacity","0"]],'.in-clinic[aria-checked="true"] .in-tick':[["background","$ink"],["box-shadow","none"]],'.in-clinic[aria-checked="true"] .in-tick svg':[["opacity","1"]],".in-none":[["font-size","15px"],["color","$ink2"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["display","grid"],["gap","4px"]],".in-none .in-link":[["justify-self","start"],["padding","0"]],".in-prog":[["display","grid"],["gap","7px"],["font-size","15px"],["color","$ink2"]],".in-prog__bar":[["height","5px"],["border-radius","3px"],["background","$tile"],["overflow","hidden"]],".in-prog__bar i":[["display","block"],["height","100%"],["width","0"],["background","$ink"],["border-radius","3px"],["transition-property","width"],["transition-duration","600ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-sent":[["background","$paper"],["border-radius","20px"],["padding","16px 16px 16px 14px"]],".in-sent .sh-track li":[["padding-bottom","14px"]],".in-sent .sh-track li:last-child":[["padding-bottom","0"]],".in-stack .emb-btn svg":[["width","20px"],["height","20px"]],".ph-banner":[["position","absolute"],["left","10px"],["right","10px"],["top","54px"],["z-index","55"],["display","grid"],["grid-template-columns","38px minmax(0, 1fr)"],["gap","11px"],["align-items","start"],["text-align","left"],["padding","12px 14px"],["border-radius","22px"],["background","rgba(250, 250, 249, .97)"],["box-shadow","0 14px 34px -10px rgba(38, 37, 35, .4), 0 0 0 1px rgba(38, 37, 35, .06)"],["transform","translateY(calc(-100% - 60px))"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".ph-banner.is-on":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".ph-banner__app":[["width","38px"],["height","38px"],["border-radius","10px"],["background","$accent"],["display","grid"],["place-items","center"]],".ph-banner__app svg":[["width","24px"],["height","23px"]],".ph-banner__meta":[["display","flex"],["justify-content","space-between"],["font-size","13px"],["color","$ink3"]],".ph-banner__meta strong":[["font-size","13px"],["font-weight","600"],["color","$ink3"]],".ph-banner__txt > strong":[["display","block"],["font-size","15.5px"],["font-weight","700"],["line-height","1.3"],["margin-top","1px"]],".ph-banner__txt > span:last-child":[["display","block"],["font-size","15px"],["line-height","1.35"],["color","$ink2"]]},Dn={".in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".ph-intro.is-on .in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"],["opacity","1"]],".in-sheet.is-drag":[["opacity","1"]],".in-dim":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--top":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--bot":[["transition-duration","150ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["transition-duration","150ms"]],".in-rise .in-rows li":[["animation","none"]],".in-body .blank":[["animation","none"]],".blank.is-flash":[["animation-duration","900ms"]],".ph-banner":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"]],".ph-banner.is-on":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"],["opacity","1"],["visibility","visible"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, ease"],["transition-delay","0s, 0s"]]},Rn="cubic-bezier(0.23, 1, 0.32, 1)";var Pn={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function On(e,t,n){return n==="sent"||n==="consent"||t.scrollTop>0?true:e instanceof Element&&e.closest("button, input, textarea, select, a, canvas, label")!==null}var zn=60;function An(e){let t=e?.querySelector("h1, h2, h3")??null;return t!==null&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),t}function EverfurIntro(l){let{petRef:petRef,onClose:p,onClosed:h,onFrame:f}=l,b=l.mode??"intro",m=useEverfurTheme(),y=m.motion.reducedMotion,g=e(()=>Jt(m,In,Dn),[m]),v=e(()=>en(m),[m]),w=e(()=>Gt(m),[m]),{runtime:k}=Be(),_=e(()=>({...xn,...l.copy}),[l.copy]),x=e(()=>introFacts(l.page??null,l.petName),[l.page,l.petName]),C=e(()=>l.blanks??defaultIntroBlanks(x.pet),[l.blanks,x.pet]),S=e(()=>introText({facts:x,copy:_,blanks:C.length,resultsPending:l.resultsPending===true}),[x,_,C.length,l.resultsPending]),[$,E]=t(b==="records"?"clinic":"tabs"),[F,T]=t(false),[I,D]=t(false),[R,P]=t(false),[O,z]=t(null),A=n(/* @__PURE__ */new Map),[N,M]=t(""),[L,j]=t(false),[B,q]=t(null),[U,W]=t(null),H=n(null),V=n(null),K=n(null),Y=n(null),G=n(null),Q=n([]),Z=r(),X=kn($==="clinic"||$==="consent"),J=i((e,t)=>{Q.current.push(setTimeout(e,t))},[]);a(()=>()=>Q.current.forEach(clearTimeout),[]);let ee=i(()=>{J(()=>K.current?.focus({preventScroll:true}),zn)},[J]);a(()=>{f?.(I?null:$)},[$,I,f]),a(()=>()=>f?.(null),[f]);let te=l.container??U?.parentElement??null,ne=l.tabBar??null;o(()=>{if(te===null||ne===null)return;let e=()=>{let e=te.getBoundingClientRect(),t=ne.getBoundingClientRect();q({t:Math.round(t.top-e.top),h:Math.round(t.height)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[te,ne]),a(()=>{if(U===null)return;let e=U.parentElement;Y.current=document.activeElement;let t=[];if(e!==null)for(let n of Array.from(e.children))n===U||!(n instanceof HTMLElement)||n.inert||(n.inert=true,t.push(n));let n=requestAnimationFrame(()=>T(true));return ee(),()=>{cancelAnimationFrame(n);for(let e of t)e.inert=false;let e=document.activeElement,r=Y.current;(e===null||e===document.body||!e.isConnected)&&r instanceof HTMLElement&&r.isConnected&&r.focus({preventScroll:true})}},[U,ee]),o(()=>{if(U===null||y||$!=="tabs")return;let e=V.current?.querySelectorAll("li")??[],t=Object.fromEntries((Pn.inRow?.[0]?.[1]??[]).map(([e,t])=>[e,t]));e.forEach((e,n)=>{if(typeof e.animate=="function")try{e.animate([t,{opacity:1,transform:"none"}],{duration:260,delay:560+n*60,easing:Rn,fill:"both"})}catch{}})},[U]),a(()=>{if($!=="ask"||y)return;(V.current?.querySelectorAll("[data-blank]")??[]).forEach((e,t)=>{if(typeof e.animate=="function")try{let n=w.accent4??"";e.animate([{background:n},{background:w.accent2??n,offset:.5},{background:n}],{duration:520,delay:300+t*80,easing:"ease-in-out",fill:"both"})}catch{}})},[$,y,w]),o(()=>{let e=G.current;G.current=null;let t=H.current,n=V.current;if(!(e===null||t===null||n===null)){t.scrollTop=0;try{if(y)typeof n.animate=="function"&&n.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let r=t.offsetHeight;e.h0!==r&&typeof t.animate=="function"&&t.animate([{height:`${e.h0}px`},{height:`${r}px`}],{duration:240,easing:Rn}),typeof n.animate=="function"&&n.animate([{opacity:0,transform:`translateX(${e.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:Rn})}}catch{}ee()}},[$,y,ee]);let re=i((e,t=false)=>{G.current={h0:H.current?.offsetHeight??0,back:t},E(e)},[]),ie=i((e,t=null,n=null)=>{if(!I){if(D(true),T(false),p({exit:e,toast:t,notifications:n}),e==="stay"){let e=Y.current;e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:true})}J(()=>h?.(),y?160:260)}},[I,p,h,J,y]),ae=i(()=>ie(b==="records"?"stay":"ask"),[ie,b]),oe=l.onUpload,le=e(()=>oe===void 0?void 0:()=>{ie("stay"),oe()},[oe,ie]),se=i(e=>ie("plan",e?S.toast.on:S.toast.off,e),[ie,S]),de=i(async()=>{if(L)return;j(true);let e=false;try{l.onEnableNotifications!==void 0?e=await l.onEnableNotifications()===!0:e=(await createNotificationsClient(k).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{e=false}j(false),se(e)},[L,l,k,se]);a(()=>{if(I)return;let e=e=>{e.key!=="Escape"||e.defaultPrevented||(e.preventDefault(),$==="sent"?se(false):ae())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[I,$,se,ae]);let ce=n(null),ue=e=>{let t=H.current;if(!(ce.current!==null||t===null||I||On(e.target,t,$))){ce.current={y:e.clientY,t:performance.now(),dy:0,id:e.pointerId};try{t.setPointerCapture(e.pointerId)}catch{}P(true)}},pe=e=>{let t=ce.current,n=H.current;if(t===null||n===null)return;let r=e.clientY-t.y;t.dy=r>0?r:r/4,n.style.transform=`translateY(${t.dy}px)`},he=()=>{let e=ce.current,t=H.current;e!==null&&(ce.current=null,P(false),isIntroSwipeOut(e.dy,performance.now()-e.t)?ae():t!==null&&(t.style.transform="none"))},fe=i(e=>{let t=O===null?"":O.clinic?.name??O.freeText??"",n={petRef:petRef,clinicName:t,requestId:e.id,at:/* @__PURE__ */(new Date).toISOString()};M(t),Tn(En,{petRef:n.petRef,requestId:n.requestId,at:n.at}),l.onRequested?.(n),re("sent")},[O,petRef,l,re]),be=$!=="tabs",me={"--in-t":`${B?.t??0}px`,"--in-h":`${B?.h??0}px`},ye=$==="clinic"&&b!=="records"||$==="novet"||$==="consent",ge=$!=="sent",ve=v.button,we=(e,t,n=false)=>t===""?null:/* @__PURE__ */u("p",{style:{...v.text,...e},...n?{ref:e=>{K.current=e},tabIndex:-1,id:Z}:{},children:t}),ke=e=>e===""?null:/* @__PURE__ */u("h3",{id:Z,ref:e=>{K.current=e},tabIndex:-1,style:{...v.text,...g(".serif",".in-h")},children:e}),_e=(e,t,...n)=>/* @__PURE__ */u("button",{type:"button",style:{...ve,...g(".emb-btn",".in-body .emb-btn",...n)},onClick:t,children:e}),xe=(e,t)=>/* @__PURE__ */u("button",{type:"button",style:{...ve,...g(".in-link")},onClick:t,children:e}),Ce=e=>{let t=m.meta.hidePoweredBy?null:/* @__PURE__ */d("span",{style:g(".in-by"),children:[S.poweredBy,
|
|
40
|
+
return u(e.EverfurRecordsConsent,{petRef:petRef,...t===void 0?{}:{petName:t},clinic:n,...r===void 0?{}:{ownerName:r},...i===void 0?{}:{onCaptureSignature:i},onCreated:a})}}var vn=null;function wn(){return vn===null&&(vn=import("@everfur/sdk/web/records").then(e=>({Clinic:yn(e),Consent:gn(e)}),()=>(vn=null,null))),vn}function kn(n){let[r,i]=t(null);return a(()=>{if(!n||r!==null)return;let e=true;return wn().then(t=>{e&&t!==null&&i(t)}),()=>{e=false}},[n,r]),e(()=>r,[r])}function healthPlanPetWords(e,t){let n=e?.trim()??"",r=n===""?"your pet":n,i=n===""?"Your pet":n;return t==="female"?{name:r,Name:i,poss:"her",Poss:"Her",obj:"her"}:t==="male"?{name:r,Name:i,poss:"his",Poss:"His",obj:"him"}:{name:r,Name:i,poss:`${r}'s`,Poss:`${i}'s`,obj:r}}var _n=e=>e===null?"":`${e.productName} renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(e){let t=healthPlanPetWords(e.name,e.sex),n=e=>e.petName?.trim()||t.name,NameOf=e=>e.petName?.trim()||t.Name,r=/* @__PURE__ */Object.freeze({jumpKicker:(e,n)=>n?`In ${t.poss} plan, every ${e.intervalDays} days`:e.offer?`${e.discountPercent}% off ${t.poss} first box`:e.intervalDays>0?`Ships every ${e.intervalDays} days`:r.onceLine(e),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:e=>e.offer?`First box, then ${e.box??""}`:`${e.box??""} every ${e.intervalDays} days`,priceLine:e=>e.offer?`${e.discountPercent}% off the first box. Ships every ${e.intervalDays} days.`:e.intervalDays>0?`Ships every ${e.intervalDays} days.`:r.onceOffer(e),once:"One box",onceLine:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:e=>`Buy one box, ${e.once??e.box??""}`,subscribed:"Subscribed",subscribedLine:(e,t)=>t===null?`Every ${e.intervalDays} days`:`Every ${e.intervalDays} days · next box ${t}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:e=>`Checkout: ${e.productName}`,checkoutOffer:e=>`${e.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:e=>`${e} days`,buyOnceOption:"Buy once",checkoutGo:(e,t,n)=>`${t?"Subscribe":"Buy now"} · ${n} today`,renews:e=>`Renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:e=>`${NameOf(e)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:e=>`${e.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${t.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:e=>e===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${e}`,refill:`A text 3 days before ${t.poss} next box. Reply SKIP to skip it.`,nextBoxShips:e=>`${t.Poss} next box ships, ${e.box??""}.`,startedDone:`Back to ${t.poss} plan`,manageKicker:"Your subscription",manageTitle:e=>`Manage ${e.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(e,n)=>n===null?"Skipped.":`Skipped. ${t.Poss} next box ships ${n}.`,cancelled:e=>`${e.productName} is cancelled. Restart it from ${t.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:e=>e>0?`Cart, ${e} item${e>1?"s":""}`:"Cart, empty",addToCart:e=>`Add to cart · ${e}`,viewCart:"View cart",addedToCart:(e,t)=>`${e.productName} is in your cart${t?", as a subscription":""}.`,removedFromCart:e=>`${e} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:e=>`${NameOf(e)}'s plan pick lands here when you add it.`,seeOrders:`See ${t.poss} orders`,quantityLabel:e=>`How many: ${e}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:e=>e.offer?`First box ${e.discountPercent}% off, then ${e.box??""} every ${e.intervalDays} days`:`Every ${e.intervalDays} days`,cartOnceLine:(e,n)=>n?`An extra box. ${t.Poss} plan keeps shipping.`:e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",cartModeLabel:e=>`How to buy ${e}`,cartModeSubscribe:e=>e.offer?`Subscribe, ${e.discountPercent}% off the first box`:"Subscribe",cartModeOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:e=>`Then ${e.productName}`,renewsEvery:e=>`${e.box??""} every ${e.intervalDays} days`,checkoutCart:e=>`Checkout · ${e}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:e=>`Subscription, every ${e.intervalDays} days`,cartItemQuantity:e=>`Qty ${e}`,placeOrder:(e,t)=>`${t?"Place order and subscribe":"Place order"} · ${e}`,cartFine:e=>`${e===null?"":`${_n(e)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${t.Poss} subscription`,nextBox:e=>`Next box ${e}`,everyDays:e=>`Every ${e} days`,ordersHeading:e=>e?"Orders":`${t.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:e=>`The boxes from ${n(e)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:e=>e===null?"Order":`Order ${e}`,arrivesBy:e=>`Arrives by ${e}`,deliveredOn:e=>`Delivered ${e}`,expected:e=>`Expected ${e}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:e=>`Track on ${e}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(e,t)=>`Qty ${e}${t?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${t.poss} weight to size ${t.poss} dose`,addWeightBody:`From a home scale or ${t.poss} last vet visit.`,connectRecordsTitle:`Connect ${t.poss} vet records`,connectRecordsBody:`${t.Poss} weight, visits and labs make ${t.poss} plan sharper.`,weightKicker:`${t.Poss} weight`,weightTitle:e=>`Add ${n(e)}'s weight`,weightBody:`From a home scale or ${t.poss} last vet visit. ${t.Poss} plan uses it to size ${t.poss} dose.`,weightField:`${t.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${t.poss} weight in pounds, like 14.1.`,weightSave:`Save ${t.poss} weight`,weightSaved:e=>`Saved: ${e} lb. ${t.Poss} dose is sized for ${t.obj}.`,weightSavedKg:e=>`Saved: ${e} kg. ${t.Poss} dose is sized for ${t.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:e=>`Built with ${e}`,fromVet:e=>`From ${e}`,waitVetTips:e=>`Free tips from ${e}, built around that risk`,signalsFit:e=>`${e} of ${e} signals fit ${t.Name}`,signalsValue:e=>`${e}/${e}`,noPick:`No supplement for this one. ${t.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${t.poss} next checkup`,savedForCheckup:`Saved for ${t.poss} next checkup`,blanksLabel:`${t.Poss} three blanks`,blanksAsked:e=>`Asked ${e}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${t.poss} vet records`,blanksFilled:(e,t)=>`${e} of ${t} filled`,blanksWeight:`Keep ${t.obj} at `,blanksWeightSource:`From ${t.poss} vet visits`,blanksDose:(e,t)=>`${e} of ${t}`,blanksDoseSource:`Sized to ${t.poss} weight`,blanksShots:`${t.Poss} next shots are due `,blanksShotsSource:`From ${t.poss} clinic`,blankEmpty:"blank",recordsLanded:`${t.Poss} records are in. ${t.Poss} plan now uses ${t.poss} weight and ${t.poss} visits.`,todayLabel:`${t.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${t.poss} report`,askReport:"Ask about it",fullOpen:`See ${t.poss} full plan`,fullOpenLine:`${t.Poss} vet, reviews and ${t.poss} checkup`,fullClose:`Show ${t.poss} brief plan`,fullCloseLine:`${t.Poss} risk, tips, pick and signs`,hopeNoted:e=>`Noted. When ${t.poss} results land, we'll start with ${e}.`,productLink:e=>`${e}, see the product`,productPhotos:e=>`${e} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${t.name}`,ratingLine:e=>`· ${e} reviews`,productOffer:e=>`${e.discountPercent}% off ${t.poss} first box`,productEvery:e=>`Every ${e.intervalDays} days`,productOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:e=>`On ${t.poss} plan, every ${e.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:e=>`${e} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:e=>`Read all ${e} reviews`,starsLabel:e=>`${e} out of 5 stars`,buyNow:"Buy now"});return r}healthPlanFocusCopyFor({sex:"female"});var xn=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(e,t){let n=healthPlanPetWords(e,t);return{...n,subj:t==="female"?"she":t==="male"?"he":n.name}}var Cn=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(e){return Number.isInteger(e)&&e>=1&&e<=10?Cn[e]??null:null}var Sn=e=>e===""?e:e.charAt(0).toUpperCase()+e.slice(1);function defaultIntroBlanks(e){return[{before:`Keep ${e.obj} at `,after:" lb",source:`From ${e.poss} vet visits`},{before:`${e.Poss} next shots are due `,after:"",source:`From ${e.poss} clinic`,width:"l"}]}function introFacts(e,t){let n=e?.pet.name??t??null,r=e?.page??null,i=r?.byline?.name?.trim()??"";return{pet:introPetWords(n,e?.pet.sex??null),planTitle:r?.title.trim()??"",vetName:e?.vetReviewed===true&&i!==""?i:null,tips:r?.routine?.steps.length??0}}function introText(e){let{facts:t,copy:n,resultsPending:r}=e,i=t.pet,a=numberWord(e.blanks),o=numberWord(t.tips),l=n.planTopic.trim(),s=t.vetName===null?null:t.vetName.replace(/ /g," "),d=l===""?"":`One plan for ${i.poss} ${l}${s===null?"":`, built with ${s}`}.`,c=o===null?"":`${Sn(o)} tips, one thing to add.`,u=r?`${i.Poss} plan arrives with ${i.poss} results.`:[d,c].filter(e=>e!=="").join(" "),p=[`What could go wrong for ${i.name}, and what's changed.`,n.recordsRowMore.trim()].filter(e=>e!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${i.Name}'s tab`,records:`Request ${i.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:n.eyebrow,title:`${i.Name}'s health, in three tabs.`,lede:r?n.pendingLede:n.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${i.name} any hour (the 2 am ones too).`,plan:u,records:p,next:"Next",seePlan:`See ${i.poss} plan`},ask:{title:n.askTitle,lede:a===null?"":`${i.Poss} plan has ${a} blanks only ${i.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${e.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${i.poss} vet`,fine:`We send ${i.poss} clinic a secure request and read every page they send back.`,noVet:`${i.Name} doesn't have a vet yet`},clinic:{title:`Where does ${i.name} see ${i.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${i.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${i.subj} sees most.`,request:`Request ${i.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${i.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${i.Poss} records request`,sentStep:"Request sent",sentTo:e=>`Today, to ${e}`,clinicStep:`${i.Poss} clinic sends ${i.poss} records`,clinicEta:n.clinicEta,blanksStep:a===null?"":`${i.Poss} ${a} blanks fill in`,blanksDetail:n.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${i.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:n.sentFine},noVet:{title:n.noVetTitle,lede:a===null?"":`When ${i.subj} does, connect ${i.poss} vet in Records and ${i.poss} ${a} blanks fill in.`,seePlan:`See ${i.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${i.name}'s records are in.`,off:`Requested. ${i.Name}'s records will show up here when they're in.`,landed:`${i.Poss} records are in. ${i.Poss} plan now uses ${i.poss} weight and ${i.poss} visits.`},banner:{app:n.appName,now:"now",title:`${i.Name}'s records are in`,body:n.bannerBody}}}function $n(e,t){let n=`${t.key}\n${t.email}`,r=e.get(n);return r===void 0?(e.set(n,t.idempotencyKey),t):r===t.idempotencyKey?t:/* @__PURE__ */Object.freeze({...t,idempotencyKey:r})}function isIntroSwipeOut(e,t){let n=t>0?Math.abs(e)/t:0;return e>90||e>12&&n>.11}var En="everfur:records-requested",Fn="everfur:records-landed";function Tn(e,t){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(e,{detail:t}))}catch{}}var In={".serif":[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]],".emb-btn":[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition-property","transform, opacity"],["transition-duration","160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".emb-btn svg":[["width","20px"],["height","20px"]],".emb-btn--block":[["width","100%"]],".emb-btn--ghost":[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]],".emb-btn--sm":[["min-height","40px"],["padding","0 16px"],["font-size","15px"]],".emb-btn--lg":[["min-height","56px"],["padding","0 28px"],["font-size","17px"]],".emb-btn[disabled]":[["opacity",".32"],["pointer-events","none"]],".cp-tag":[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]],".cp-tag--s":[["background","$card"],["color","$ink"]],".sh-track":[["list-style","none"],["margin","0"],["padding","0"]],".sh-track li":[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]],".sh-track li:last-child":[["padding-bottom","0"]],".sh-track li::before":[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]],".sh-track li:last-child::before":[["display","none"]],".sh-track li.is-done:has(+ li.is-done)::before":[["background","$primary"]],".sh-track__dot":[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]],".sh-track__dot svg":[["width","13px"],["height","13px"],["color","$card"]],".sh-track .is-done .sh-track__dot":[["background","$ink"],["box-shadow","none"]],".sh-track .is-now .sh-track__dot":[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]],".sh-track strong":[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]],".sh-track small":[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]],".sh-track li:not(.is-done):not(.is-now) strong":[["color","$ink3"],["font-weight","700"]],".ph-intro":[["position","absolute"],["inset","0"],["z-index","45"]],".in-dim":[["position","absolute"],["left","0"],["right","0"],["background","rgba(38, 37, 35, .5)"],["opacity","0"],["transition-property","opacity"],["transition-duration","240ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".in-dim--top":[["top","0"],["height","var(--in-t, 140px)"]],".in-dim--mid":[["top","var(--in-t, 140px)"],["height","var(--in-h, 46px)"]],".in-dim--bot":[["top","calc(var(--in-t, 140px) + var(--in-h, 46px))"],["bottom","0"]],".ph-intro.is-on .in-dim--top":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on .in-dim--bot":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["opacity","1"],["transition-duration","380ms"]],".in-sheet":[["position","absolute"],["left","0"],["right","0"],["bottom","0"],["max-height","calc(100% - var(--in-t, 140px) - var(--in-h, 46px) - 10px)"],["overflow","hidden auto"],["scrollbar-width","none"],["overscroll-behavior","contain"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 30px"],["box-shadow","0 -10px 30px rgba(38, 37, 35, .14)"],["transform","translateY(100%)"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"],["touch-action","pan-y"]],".ph-intro.is-all .in-sheet":[["max-height","calc(100% - 56px)"]],".ph-intro.is-on .in-sheet":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".in-sheet.is-drag":[["transition-property","none",1],["transition-duration","0s",1],["transition-timing-function","ease",1],["transition-delay","0s",1]],".in-grab":[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 8px"]],".in-top":[["display","flex"],["align-items","center"],["gap","12px"],["min-height","40px"]],".in-back":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"]],".in-x":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"],["margin","0 -10px 0 auto"]],".in-back svg":[["width","22px"],["height","22px"]],".in-x svg":[["width","22px"],["height","22px"]],".in-bars":[["flex","1"],["display","flex"],["gap","6px"]],".in-bars b":[["flex","1"],["height","4px"],["border-radius","2px"],["background","$line"],["overflow","hidden"],["position","relative"]],".in-bars b::after":[["position","absolute"],["inset","0"],["background","$ink"],["border-radius","2px"],["transform","scaleX(0)"],["transform-origin","left"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-bars b.on::after":[["transform","none"]],".in-skip":[["min-height","40px"],["padding","0 4px 0 10px"],["margin-right","-4px"],["font-size","15.5px"],["font-weight","700"],["color","$ink2"],["flex","none"]],'.in-sheet[data-mode="records"] .in-bars':[["display","none"]],'.in-sheet[data-mode="records"] .in-skip':[["display","none"]],'.in-sheet[data-mode="intro"] .in-x':[["display","none"]],'.in-sheet[data-mode="records"] .in-top':[["justify-content","space-between"]],".in-body":[["display","grid"],["gap","14px"],["padding-top","6px"]],".in-eyebrow":[["display","flex"],["align-items","center"],["flex-wrap","wrap"],["gap","4px 8px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".in-by":[["display","inline-flex"],["align-items","center"],["gap","5px"],["text-transform","none"],["letter-spacing","0"],["font-weight","500"],["font-size","13px"]],".in-by svg":[["width","54px"],["height","19px"],["color","$n_10462E"]],".in-h":[["font-size","29px"],["line-height","1.08"],["margin","-2px 0 0"],["outline","none"]],".in-p":[["font-size","16px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]],".in-p--s":[["font-size","15px"]],".in-rows":[["list-style","none"],["margin","2px 0 0"],["padding","0"],["display","grid"],["gap","9px"]],".in-rows li":[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","12px"],["align-items","start"],["background","$paper"],["border-radius","18px"],["padding","13px 14px"]],".in-rows b":[["display","block"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]],".in-rows li > span:last-child > span":[["display","block"],["font-size","15px"],["line-height","1.4"],["color","$ink2"],["text-wrap","pretty"],["margin-top","1px"]],".in-ic":[["width","40px"],["height","40px"],["border-radius","12px"],["display","grid"],["place-items","center"]],".in-ic svg":[["width","22px"],["height","22px"]],".in-ic--y":[["background","$accentChip"]],".in-ic--c":[["background","$linkChip"]],".in-ic--g":[["background","$clearChip"]],".in-rise .in-rows li":[["animation","inRow 260ms cubic-bezier(0.23, 1, 0.32, 1) both"],["animation-delay","calc(560ms + var(--i, 0) * 60ms)"]],".in-pair":[["display","grid"],["grid-template-columns","1fr 1.5fr"],["gap","10px"]],".in-stack":[["display","grid"],["gap","8px"]],".in-body .emb-btn":[["transition-property","transform, opacity"],["transition-duration","120ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".in-fine":[["font-size","13.5px"],["line-height","1.4"],["color","$ink3"],["text-align","center"],["text-wrap","pretty"]],".in-link":[["justify-self","center"],["min-height","40px"],["padding","0 8px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-underline-offset","3px"],["transition-property","transform"],["transition-duration","120ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".blanks":[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]],".blanks__h":[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".blanks__h em":[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$onAccent"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]],'.blanks[data-st="filled"] .blanks__h em':[["background","$clearBg"],["color","$clearInk"]],".blanks ol":[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]],".blanks li":[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]],".blanks li > b":[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"],["background","$accentChip"]],".blanks li > span":[["font-size","16px"],["font-weight","700"],["line-height","1.35"]],".blanks li > small":[["font-size","13.5px"],["color","$ink3"]],".blank":[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]],".blank--s":[["min-width","24px"]],".blank--l":[["min-width","64px"]],'.blanks[data-st="filled"] .blank':[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]],".blank.is-flash":[["animation","blankFlash 900ms ease-out both"],["animation-delay","calc(var(--i, 0) * 80ms)"]],".in-body .blank":[["animation","blankPulse 520ms ease-in-out both"],["animation-delay","calc(300ms + var(--i, 0) * 80ms)"]],".in-search":[["display","flex"],["align-items","center"],["gap","10px"],["height","50px"],["border-radius","14px"],["background","$paper"],["box-shadow","inset 0 0 0 1.5px $ink"],["padding","0 14px"]],".in-search svg":[["width","20px"],["height","20px"],["color","$ink3"],["flex","none"]],".in-search input":[["flex","1"],["min-width","0"],["border","0"],["background","none"],["font","inherit"],["font-size","16px"],["color","$ink"],["outline","none"]],".in-clinics":[["display","grid"],["gap","8px"]],".in-clinic":[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 24px"],["align-items","center"],["gap","10px"],["text-align","left"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["transition-property","transform, background-color, box-shadow"],["transition-duration","120ms, 160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease, ease"],["transition-delay","0s, 0s, 0s"]],".in-clinic b":[["display","block"],["font-size","16px"],["line-height","1.3"]],".in-clinic b .cp-tag":[["margin-left","6px"],["vertical-align","2px"],["box-shadow","inset 0 0 0 1px $line"]],".in-clinic small":[["display","block"],["font-size","14px"],["color","$ink3"],["margin-top","1px"]],'.in-clinic[aria-checked="true"]':[["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"]],".in-tick":[["width","24px"],["height","24px"],["border-radius","50%"],["display","grid"],["place-items","center"],["box-shadow","inset 0 0 0 1.5px $n_CFCBC4"]],".in-tick svg":[["width","14px"],["height","14px"],["color","$card"],["opacity","0"]],'.in-clinic[aria-checked="true"] .in-tick':[["background","$ink"],["box-shadow","none"]],'.in-clinic[aria-checked="true"] .in-tick svg':[["opacity","1"]],".in-none":[["font-size","15px"],["color","$ink2"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["display","grid"],["gap","4px"]],".in-none .in-link":[["justify-self","start"],["padding","0"]],".in-prog":[["display","grid"],["gap","7px"],["font-size","15px"],["color","$ink2"]],".in-prog__bar":[["height","5px"],["border-radius","3px"],["background","$tile"],["overflow","hidden"]],".in-prog__bar i":[["display","block"],["height","100%"],["width","0"],["background","$ink"],["border-radius","3px"],["transition-property","width"],["transition-duration","600ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-sent":[["background","$paper"],["border-radius","20px"],["padding","16px 16px 16px 14px"]],".in-sent .sh-track li":[["padding-bottom","14px"]],".in-sent .sh-track li:last-child":[["padding-bottom","0"]],".in-stack .emb-btn svg":[["width","20px"],["height","20px"]],".ph-banner":[["position","absolute"],["left","10px"],["right","10px"],["top","54px"],["z-index","55"],["display","grid"],["grid-template-columns","38px minmax(0, 1fr)"],["gap","11px"],["align-items","start"],["text-align","left"],["padding","12px 14px"],["border-radius","22px"],["background","rgba(250, 250, 249, .97)"],["box-shadow","0 14px 34px -10px rgba(38, 37, 35, .4), 0 0 0 1px rgba(38, 37, 35, .06)"],["transform","translateY(calc(-100% - 60px))"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".ph-banner.is-on":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".ph-banner__app":[["width","38px"],["height","38px"],["border-radius","10px"],["background","$accent"],["display","grid"],["place-items","center"]],".ph-banner__app svg":[["width","24px"],["height","23px"]],".ph-banner__meta":[["display","flex"],["justify-content","space-between"],["font-size","13px"],["color","$ink3"]],".ph-banner__meta strong":[["font-size","13px"],["font-weight","600"],["color","$ink3"]],".ph-banner__txt > strong":[["display","block"],["font-size","15.5px"],["font-weight","700"],["line-height","1.3"],["margin-top","1px"]],".ph-banner__txt > span:last-child":[["display","block"],["font-size","15px"],["line-height","1.35"],["color","$ink2"]]},Dn={".in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".ph-intro.is-on .in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"],["opacity","1"]],".in-sheet.is-drag":[["opacity","1"]],".in-dim":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--top":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--bot":[["transition-duration","150ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["transition-duration","150ms"]],".in-rise .in-rows li":[["animation","none"]],".in-body .blank":[["animation","none"]],".blank.is-flash":[["animation-duration","900ms"]],".ph-banner":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"]],".ph-banner.is-on":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"],["opacity","1"],["visibility","visible"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, ease"],["transition-delay","0s, 0s"]]},Rn="cubic-bezier(0.23, 1, 0.32, 1)";var Pn={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function zn(e,t,n){return n==="sent"||n==="consent"||t.scrollTop>0?true:e instanceof Element&&e.closest("button, input, textarea, select, a, canvas, label")!==null}var On=60;function An(e){let t=e?.querySelector("h1, h2, h3")??null;return t!==null&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),t}function EverfurIntro(l){let{petRef:petRef,onClose:p,onClosed:h,onFrame:f}=l,b=l.mode??"intro",m=useEverfurTheme(),y=m.motion.reducedMotion,g=e(()=>Jt(m,In,Dn),[m]),v=e(()=>en(m),[m]),w=e(()=>Gt(m),[m]),{runtime:k}=Be(),_=e(()=>({...xn,...l.copy}),[l.copy]),x=e(()=>introFacts(l.page??null,l.petName),[l.page,l.petName]),C=e(()=>l.blanks??defaultIntroBlanks(x.pet),[l.blanks,x.pet]),S=e(()=>introText({facts:x,copy:_,blanks:C.length,resultsPending:l.resultsPending===true}),[x,_,C.length,l.resultsPending]),[$,E]=t(b==="records"?"clinic":"tabs"),[F,T]=t(false),[I,D]=t(false),[R,P]=t(false),[z,O]=t(null),A=n(/* @__PURE__ */new Map),[N,M]=t(""),[L,j]=t(false),[B,q]=t(null),[U,W]=t(null),H=n(null),V=n(null),K=n(null),Y=n(null),G=n(null),Q=n([]),Z=r(),X=kn($==="clinic"||$==="consent"),J=i((e,t)=>{Q.current.push(setTimeout(e,t))},[]);a(()=>()=>Q.current.forEach(clearTimeout),[]);let ee=i(()=>{J(()=>K.current?.focus({preventScroll:true}),On)},[J]);a(()=>{f?.(I?null:$)},[$,I,f]),a(()=>()=>f?.(null),[f]);let te=l.container??U?.parentElement??null,ne=l.tabBar??null;o(()=>{if(te===null||ne===null)return;let e=()=>{let e=te.getBoundingClientRect(),t=ne.getBoundingClientRect();q({t:Math.round(t.top-e.top),h:Math.round(t.height)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[te,ne]),a(()=>{if(U===null)return;let e=U.parentElement;Y.current=document.activeElement;let t=[];if(e!==null)for(let n of Array.from(e.children))n===U||!(n instanceof HTMLElement)||n.inert||(n.inert=true,t.push(n));let n=requestAnimationFrame(()=>T(true));return ee(),()=>{cancelAnimationFrame(n);for(let e of t)e.inert=false;let e=document.activeElement,r=Y.current;(e===null||e===document.body||!e.isConnected)&&r instanceof HTMLElement&&r.isConnected&&r.focus({preventScroll:true})}},[U,ee]),o(()=>{if(U===null||y||$!=="tabs")return;let e=V.current?.querySelectorAll("li")??[],t=Object.fromEntries((Pn.inRow?.[0]?.[1]??[]).map(([e,t])=>[e,t]));e.forEach((e,n)=>{if(typeof e.animate=="function")try{e.animate([t,{opacity:1,transform:"none"}],{duration:260,delay:560+n*60,easing:Rn,fill:"both"})}catch{}})},[U]),a(()=>{if($!=="ask"||y)return;(V.current?.querySelectorAll("[data-blank]")??[]).forEach((e,t)=>{if(typeof e.animate=="function")try{let n=w.accent4??"";e.animate([{background:n},{background:w.accent2??n,offset:.5},{background:n}],{duration:520,delay:300+t*80,easing:"ease-in-out",fill:"both"})}catch{}})},[$,y,w]),o(()=>{let e=G.current;G.current=null;let t=H.current,n=V.current;if(!(e===null||t===null||n===null)){t.scrollTop=0;try{if(y)typeof n.animate=="function"&&n.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let r=t.offsetHeight;e.h0!==r&&typeof t.animate=="function"&&t.animate([{height:`${e.h0}px`},{height:`${r}px`}],{duration:240,easing:Rn}),typeof n.animate=="function"&&n.animate([{opacity:0,transform:`translateX(${e.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:Rn})}}catch{}ee()}},[$,y,ee]);let re=i((e,t=false)=>{G.current={h0:H.current?.offsetHeight??0,back:t},E(e)},[]),ie=i((e,t=null,n=null)=>{if(!I){if(D(true),T(false),p({exit:e,toast:t,notifications:n}),e==="stay"){let e=Y.current;e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:true})}J(()=>h?.(),y?160:260)}},[I,p,h,J,y]),ae=i(()=>ie(b==="records"?"stay":"ask"),[ie,b]),oe=l.onUpload,le=e(()=>oe===void 0?void 0:()=>{ie("stay"),oe()},[oe,ie]),se=i(e=>ie("plan",e?S.toast.on:S.toast.off,e),[ie,S]),de=i(async()=>{if(L)return;j(true);let e=false;try{l.onEnableNotifications!==void 0?e=await l.onEnableNotifications()===!0:e=(await createNotificationsClient(k).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{e=false}j(false),se(e)},[L,l,k,se]);a(()=>{if(I)return;let e=e=>{e.key!=="Escape"||e.defaultPrevented||(e.preventDefault(),$==="sent"?se(false):ae())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[I,$,se,ae]);let ce=n(null),ue=e=>{let t=H.current;if(!(ce.current!==null||t===null||I||zn(e.target,t,$))){ce.current={y:e.clientY,t:performance.now(),dy:0,id:e.pointerId};try{t.setPointerCapture(e.pointerId)}catch{}P(true)}},pe=e=>{let t=ce.current,n=H.current;if(t===null||n===null)return;let r=e.clientY-t.y;t.dy=r>0?r:r/4,n.style.transform=`translateY(${t.dy}px)`},he=()=>{let e=ce.current,t=H.current;e!==null&&(ce.current=null,P(false),isIntroSwipeOut(e.dy,performance.now()-e.t)?ae():t!==null&&(t.style.transform="none"))},fe=i(e=>{let t=z===null?"":z.clinic?.name??z.freeText??"",n={petRef:petRef,clinicName:t,requestId:e.id,at:/* @__PURE__ */(new Date).toISOString()};M(t),Tn(En,{petRef:n.petRef,requestId:n.requestId,at:n.at}),l.onRequested?.(n),re("sent")},[z,petRef,l,re]),be=$!=="tabs",me={"--in-t":`${B?.t??0}px`,"--in-h":`${B?.h??0}px`},ye=$==="clinic"&&b!=="records"||$==="novet"||$==="consent",ge=$!=="sent",ve=v.button,we=(e,t,n=false)=>t===""?null:/* @__PURE__ */u("p",{style:{...v.text,...e},...n?{ref:e=>{K.current=e},tabIndex:-1,id:Z}:{},children:t}),ke=e=>e===""?null:/* @__PURE__ */u("h3",{id:Z,ref:e=>{K.current=e},tabIndex:-1,style:{...v.text,...g(".serif",".in-h")},children:e}),_e=(e,t,...n)=>/* @__PURE__ */u("button",{type:"button",style:{...ve,...g(".emb-btn",".in-body .emb-btn",...n)},onClick:t,children:e}),xe=(e,t)=>/* @__PURE__ */u("button",{type:"button",style:{...ve,...g(".in-link")},onClick:t,children:e}),Ce=e=>{let t=m.meta.hidePoweredBy?null:/* @__PURE__ */d("span",{style:g(".in-by"),children:[S.poweredBy,
|
|
41
41
|
/* @__PURE__ */u(EverfurWordmark,{style:g(".in-by svg")})]});return e===""&&t===null?null:/* @__PURE__ */d("p",{style:{...v.text,...g(".in-eyebrow")},children:[e,t]})},Se=null;if($==="tabs"){let e=[["ask","chat",".in-ic--y",l.tabLabels?.ask??"Ask",S.tabs.ask],["plan","heartcheck",".in-ic--c",l.tabLabels?.plan??"Health Plan",S.tabs.plan],["records","file",".in-ic--g",l.tabLabels?.records??"Records",S.tabs.records]];Se=/* @__PURE__ */d(c,{children:[Ce(S.tabs.eyebrow),ke(S.tabs.title),we(g(".in-p"),S.tabs.lede),
|
|
42
42
|
/* @__PURE__ */u("ul",{style:g(".in-rows"),children:e.map(([e,t,n,r,i])=>/* @__PURE__ */d("li",{style:g(".in-rows li"),children:[
|
|
43
43
|
/* @__PURE__ */u("span",{style:g(".in-ic",n),children:/* @__PURE__ */u(IntroIcon,{name:t,style:g(".in-ic svg")})}),
|
|
@@ -52,7 +52,7 @@ return u(e.EverfurRecordsConsent,{petRef:petRef,...t===void 0?{}:{petName:t},cli
|
|
|
52
52
|
/* @__PURE__ */d("span",{style:g(".blanks li > span"),children:[e.before,
|
|
53
53
|
/* @__PURE__ */u("i",{"data-blank":"",style:g(".blank",e.width==="s"&&".blank--s",e.width==="l"&&".blank--l"),children:/* @__PURE__ */u("span",{style:v.srOnly,children:S.ask.blankLabel})}),e.after]}),
|
|
54
54
|
/* @__PURE__ */u("small",{style:g(".blanks li > small"),children:e.source})]},t))})]}),
|
|
55
|
-
/* @__PURE__ */d("div",{style:g(".in-pair"),children:[_e(S.ask.later,ae,".emb-btn--ghost"),_e(S.ask.connect,()=>re("clinic"))]}),we(g(".in-fine"),S.ask.fine),xe(S.ask.noVet,()=>re("novet"))]});else if($==="clinic")Se=X===null?ke(S.clinic.title):/* @__PURE__ */u(X.Clinic,{sx:g,reset:v,text:S.clinic,titleId:Z,titleRef:e=>{K.current=e},onPick:e=>{
|
|
55
|
+
/* @__PURE__ */d("div",{style:g(".in-pair"),children:[_e(S.ask.later,ae,".emb-btn--ghost"),_e(S.ask.connect,()=>re("clinic"))]}),we(g(".in-fine"),S.ask.fine),xe(S.ask.noVet,()=>re("novet"))]});else if($==="clinic")Se=X===null?ke(S.clinic.title):/* @__PURE__ */u(X.Clinic,{sx:g,reset:v,text:S.clinic,titleId:Z,titleRef:e=>{K.current=e},onPick:e=>{O($n(A.current,e)),re("consent")},...le===void 0?{}:{onUpload:le}});else if($==="consent")Se=X===null||z===null?null:/* @__PURE__ */u("div",{ref:e=>{K.current=An(e)},children:/* @__PURE__ */u(X.Consent,{petRef:petRef,...x.pet.name==="your pet"?{}:{petName:x.pet.name},draft:z,...l.ownerName===void 0?{}:{ownerName:l.ownerName},...l.onCaptureSignature===void 0?{}:{onCaptureSignature:l.onCaptureSignature},onCreated:fe})});else if($==="sent"){let e=[[S.sent.sentStep,N===""?"":S.sent.sentTo(N),"done"],[S.sent.clinicStep,S.sent.clinicEta,"now"],[S.sent.blanksStep,S.sent.blanksDetail,""]].filter(([e])=>e!=="");Se=/* @__PURE__ */d(c,{children:[Ce(S.sent.eyebrow),ke(S.sent.title),
|
|
56
56
|
/* @__PURE__ */u("div",{style:g(".in-sent"),children:/* @__PURE__ */u("ol",{"aria-label":S.sent.track,style:g(".sh-track"),children:e.map(([t,n,r],i)=>{let a=i===e.length-1,o=e[i+1]?.[2]==="done";/* @__PURE__ */
|
|
57
57
|
return d("li",{style:g(".sh-track li",".in-sent .sh-track li",a&&".sh-track li:last-child",a&&".in-sent .sh-track li:last-child"),children:[a?null:/* @__PURE__ */u("span",{"aria-hidden":"true",style:g(".sh-track li::before",r==="done"&&o&&".sh-track li.is-done:has(+ li.is-done)::before")}),
|
|
58
58
|
/* @__PURE__ */u("span",{style:g(".sh-track__dot",r==="done"&&".sh-track .is-done .sh-track__dot",r==="now"&&".sh-track .is-now .sh-track__dot"),children:r==="done"?/* @__PURE__ */u(IntroIcon,{name:"check",style:g(".sh-track__dot svg")}):null}),
|