@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
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
3
3
|
import { P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
4
4
|
import { a as RecordsClinicTarget, b as RecordsAuthorizationSignature } from './clinicModels.d-BXgKZqDb.cjs';
|
|
5
|
-
import { R as RequestFunnel } from './requestFunnel.d-
|
|
6
|
-
import { A as AuthContext } from './identity.d-
|
|
7
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
5
|
+
import { R as RequestFunnel } from './requestFunnel.d-BwZDfWVD.cjs';
|
|
6
|
+
import { A as AuthContext } from './identity.d-DDpXOtas.cjs';
|
|
7
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BIdmYQnk.cjs';
|
|
8
8
|
import { e as RecordsRequestView } from './models.d-D75NFs32.cjs';
|
|
9
9
|
|
|
10
10
|
interface HttpRecordsClinicRepositoryDeps {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
3
3
|
import { P as PetRef } from './ids.d-B2GAAifq.js';
|
|
4
4
|
import { a as RecordsClinicTarget, b as RecordsAuthorizationSignature } from './clinicModels.d-CaS64-P-.js';
|
|
5
|
-
import { R as RequestFunnel } from './requestFunnel.d-
|
|
6
|
-
import { A as AuthContext } from './identity.d-
|
|
7
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
5
|
+
import { R as RequestFunnel } from './requestFunnel.d-DKBPTpsy.js';
|
|
6
|
+
import { A as AuthContext } from './identity.d-D4VtpqRr.js';
|
|
7
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BnI5qWg4.js';
|
|
8
8
|
import { e as RecordsRequestView } from './models.d-C7d9Li6n.js';
|
|
9
9
|
|
|
10
10
|
interface HttpRecordsClinicRepositoryDeps {
|
|
@@ -462,6 +462,12 @@ interface EverfurConfig {
|
|
|
462
462
|
readonly transport?: TransportPort;
|
|
463
463
|
/** Structured, redacted LogPort events when true. */
|
|
464
464
|
readonly debug?: boolean;
|
|
465
|
+
/**
|
|
466
|
+
* Your app's own version (for example `4.12.0` or `4.12.0 (812)`). Optional. When set, the React Native SDK sends it
|
|
467
|
+
* as `X-Everfur-App-Version` and every error it hands your hooks carries it, so a problem can be traced to one
|
|
468
|
+
* release of your app. Up to 64 characters of letters, digits, spaces and `. _ + - ( )`; anything else is ignored.
|
|
469
|
+
*/
|
|
470
|
+
readonly appVersion?: string;
|
|
465
471
|
}
|
|
466
472
|
/**
|
|
467
473
|
* The validated, frozen subset the Layer 1 transport / identity actually consume.
|
|
@@ -474,6 +480,8 @@ interface ResolvedClientConfig {
|
|
|
474
480
|
readonly sdkVersion: string;
|
|
475
481
|
readonly platform: SdkPlatform;
|
|
476
482
|
readonly debug: boolean;
|
|
483
|
+
/** The host app's version, normalized by `normalizeAppVersion`; null or absent when unknown or unusable. */
|
|
484
|
+
readonly appVersion?: string | null;
|
|
477
485
|
}
|
|
478
486
|
/**
|
|
479
487
|
* What the FACADE knows and partner config must not decide. Threaded from the runtime factory into
|
|
@@ -547,7 +555,7 @@ declare function resolveClientConfig(config: EverfurConfig, options?: ResolveCli
|
|
|
547
555
|
declare function tryResolveApiBaseUrl(apiBaseUrl?: string): BaseUrlOutcome;
|
|
548
556
|
/** Resolve the base URL, throwing on failure. Thin wrapper over `tryResolveApiBaseUrl`. */
|
|
549
557
|
declare function resolveApiBaseUrl(apiBaseUrl?: string): string;
|
|
550
|
-
/** The always-on SDK protocol headers (version / platform / contract
|
|
551
|
-
declare function buildBaseHeaders(cfg: Pick<ResolvedClientConfig, 'sdkVersion' | 'platform' | 'contractVersion'>): Record<string, string>;
|
|
558
|
+
/** The always-on SDK protocol headers (version / platform / contract, plus the host app version when known). */
|
|
559
|
+
declare function buildBaseHeaders(cfg: Pick<ResolvedClientConfig, 'sdkVersion' | 'platform' | 'contractVersion' | 'appVersion'>): Record<string, string>;
|
|
552
560
|
|
|
553
561
|
export { eventSourceByteSource as $, type AcceptedFrame as A, type ByteSource as B, type ClientConfigFailure as C, type DeltaFrame as D, type ErrorFrame as E, type Frame as F, SDK_PLATFORM as G, type HeartbeatFrame as H, type ServerRequestIdSource as I, type TransportDeps as J, acceptedFrame as K, analysisCompleteFrame as L, type MultipartBody as M, analysisStartedFrame as N, assertNever as O, bufferedTextByteSource as P, buildBaseHeaders as Q, type RawResponse as R, type SdkPlatform as S, type TransportPort as T, type UnknownFrame as U, checkPublishableKey as V, createHttpTransport as W, deltaFrame as X, doneFrame as Y, errorFrame as Z, errorFromResponse as _, type AnalysisCompleteFrame as a, eventSourceRequestId as a0, fetchByteSource as a1, getGlobalFetch as a2, heartbeatFrame as a3, networkError as a4, parseSse as a5, requestIdOf as a6, requestJson as a7, requestRaw as a8, resolveApiBaseUrl as a9, resolveClientConfig as aa, tryResolveApiBaseUrl as ab, tryResolveClientConfig as ac, unknownFrame as ad, type AnalysisStartedFrame as b, type DoneFrame as c, type EverfurRequest as d, type EverfurRequestBase as e, type FrameBase as f, type FrameKind as g, type FreeCapRefusal as h, type HttpMethod as i, type UrgencyLevel as j, type FetchLike as k, type EventSourceFactory as l, type ClientConfigFailureReason as m, type ClientConfigOutcome as n, DEFAULT_CONTRACT_VERSION as o, EMPTY_FRAME_ARRAYS as p, ENV_API_BASE_URL as q, type EventSourceInit as r, type EventSourceLike as s, type EventSourceMessage as t, type EverfurConfig as u, type FetchInit as v, type FetchResponseLike as w, type ReadableStreamLike as x, type ResolveClientConfigOptions as y, type ResolvedClientConfig as z };
|
|
@@ -462,6 +462,12 @@ interface EverfurConfig {
|
|
|
462
462
|
readonly transport?: TransportPort;
|
|
463
463
|
/** Structured, redacted LogPort events when true. */
|
|
464
464
|
readonly debug?: boolean;
|
|
465
|
+
/**
|
|
466
|
+
* Your app's own version (for example `4.12.0` or `4.12.0 (812)`). Optional. When set, the React Native SDK sends it
|
|
467
|
+
* as `X-Everfur-App-Version` and every error it hands your hooks carries it, so a problem can be traced to one
|
|
468
|
+
* release of your app. Up to 64 characters of letters, digits, spaces and `. _ + - ( )`; anything else is ignored.
|
|
469
|
+
*/
|
|
470
|
+
readonly appVersion?: string;
|
|
465
471
|
}
|
|
466
472
|
/**
|
|
467
473
|
* The validated, frozen subset the Layer 1 transport / identity actually consume.
|
|
@@ -474,6 +480,8 @@ interface ResolvedClientConfig {
|
|
|
474
480
|
readonly sdkVersion: string;
|
|
475
481
|
readonly platform: SdkPlatform;
|
|
476
482
|
readonly debug: boolean;
|
|
483
|
+
/** The host app's version, normalized by `normalizeAppVersion`; null or absent when unknown or unusable. */
|
|
484
|
+
readonly appVersion?: string | null;
|
|
477
485
|
}
|
|
478
486
|
/**
|
|
479
487
|
* What the FACADE knows and partner config must not decide. Threaded from the runtime factory into
|
|
@@ -547,7 +555,7 @@ declare function resolveClientConfig(config: EverfurConfig, options?: ResolveCli
|
|
|
547
555
|
declare function tryResolveApiBaseUrl(apiBaseUrl?: string): BaseUrlOutcome;
|
|
548
556
|
/** Resolve the base URL, throwing on failure. Thin wrapper over `tryResolveApiBaseUrl`. */
|
|
549
557
|
declare function resolveApiBaseUrl(apiBaseUrl?: string): string;
|
|
550
|
-
/** The always-on SDK protocol headers (version / platform / contract
|
|
551
|
-
declare function buildBaseHeaders(cfg: Pick<ResolvedClientConfig, 'sdkVersion' | 'platform' | 'contractVersion'>): Record<string, string>;
|
|
558
|
+
/** The always-on SDK protocol headers (version / platform / contract, plus the host app version when known). */
|
|
559
|
+
declare function buildBaseHeaders(cfg: Pick<ResolvedClientConfig, 'sdkVersion' | 'platform' | 'contractVersion' | 'appVersion'>): Record<string, string>;
|
|
552
560
|
|
|
553
561
|
export { eventSourceByteSource as $, type AcceptedFrame as A, type ByteSource as B, type ClientConfigFailure as C, type DeltaFrame as D, type ErrorFrame as E, type Frame as F, SDK_PLATFORM as G, type HeartbeatFrame as H, type ServerRequestIdSource as I, type TransportDeps as J, acceptedFrame as K, analysisCompleteFrame as L, type MultipartBody as M, analysisStartedFrame as N, assertNever as O, bufferedTextByteSource as P, buildBaseHeaders as Q, type RawResponse as R, type SdkPlatform as S, type TransportPort as T, type UnknownFrame as U, checkPublishableKey as V, createHttpTransport as W, deltaFrame as X, doneFrame as Y, errorFrame as Z, errorFromResponse as _, type AnalysisCompleteFrame as a, eventSourceRequestId as a0, fetchByteSource as a1, getGlobalFetch as a2, heartbeatFrame as a3, networkError as a4, parseSse as a5, requestIdOf as a6, requestJson as a7, requestRaw as a8, resolveApiBaseUrl as a9, resolveClientConfig as aa, tryResolveApiBaseUrl as ab, tryResolveClientConfig as ac, unknownFrame as ad, type AnalysisStartedFrame as b, type DoneFrame as c, type EverfurRequest as d, type EverfurRequestBase as e, type FrameBase as f, type FrameKind as g, type FreeCapRefusal as h, type HttpMethod as i, type UrgencyLevel as j, type FetchLike as k, type EventSourceFactory as l, type ClientConfigFailureReason as m, type ClientConfigOutcome as n, DEFAULT_CONTRACT_VERSION as o, EMPTY_FRAME_ARRAYS as p, ENV_API_BASE_URL as q, type EventSourceInit as r, type EventSourceLike as s, type EventSourceMessage as t, type EverfurConfig as u, type FetchInit as v, type FetchResponseLike as w, type ReadableStreamLike as x, type ResolveClientConfigOptions as y, type ResolvedClientConfig as z };
|
package/dist/consent/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
"use strict";var e=require("react"),t=require("react-native"),r=require("react/jsx-runtime");var n=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[n[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:a}=e.type;if(r===null&&a===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:a??e.type.weight[n[t]]};let o=face(e,t);return o.fontWeight===void 0||a===null?o:{fontFamily:o.fontFamily,fontWeight:a}}function a(e){return e<=450?"regular":e<=650?"medium":"bold"}var o={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=i.get(e);r===void 0&&(r=/* @__PURE__ */new Map,i.set(e,r));let n=r.get(t);if(n!==void 0)return n;let a=l(e,t);return r.set(t,a),a}var i=/* @__PURE__ */new WeakMap;function l(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=a(Number(n)),l=r.face==="mono"?face(e,o[i]):r.face==="heading"?headingFace(e,i):face(e,i),s=r.face==="heading"?e.type.headingWeight??n:n,d=l.fontWeight===void 0?l:{fontFamily:l.fontFamily,fontWeight:s},u=r.size,c={...d,fontSize:u,lineHeight:Math.round(u*r.lineHeight*100)/100};return r.letterSpacing!==0&&(c.letterSpacing=Math.round(u*r.letterSpacing*100)/100),r.uppercase&&(c.textTransform="uppercase"),/* @__PURE__ */Object.freeze(c)}var s=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),d=/* @__PURE__ */Object.freeze({transcript_exposure:/* @__PURE__ */Object.freeze({title:"Conversation sharing",body:e=>`Let ${e} read the conversations you have with Everfur.`}),partner_context:/* @__PURE__ */Object.freeze({title:"Pet details",body:e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`})});function consentRowView(e,t){if(e.status==="signed_out")return{kind:"signedOut"};let r=e.scopes.find(e=>e.scope===t);return r===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:r.loaded?{kind:"row",scope:r.scope,granted:r.granted,hasDecision:r.hasDecision,saving:r.saving,error:r.error}:r.error!==null?{kind:"failed",error:r.error}:{kind:"loading"}}var u=[{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}],c=/* @__PURE__ */Object.freeze(u.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(c.map(e=>e.wireCode));var p=/* @__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"}),f=/* @__PURE__ */Object.freeze(c.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:p[e.wireCode]}))),h=new Map(f.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),v=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(f.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...v]){let t=h.get(e+r);if(t)return t}}var b=/* @__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 b[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var _=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return _.has(e)}var y=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||y.has(e)}var g=500,m=8e3,w=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(g*2**r,m);return Math.floor(t()*n)}var C="This feature isn't available on your account right now.",E="Something in that request was not right. Check the details and try again.",S=/* @__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:E,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:E,unknown:"Something went wrong. Please try again."}),F="This session has ended. Please sign in again.",k="linked_account_read_only";function T(e,t,r){return e==="conflict"&&r===k?C:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?F:userFacingError(e)}function userFacingError(e){return S[e]}function x(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var I=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===k,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:T(e,t?.wireCode,n?k:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&I.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(a.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&x(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&x(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}function ok(e,t){/* @__PURE__ */
|
|
2
|
+
"use strict";var e=require("react"),t=require("react-native"),r=require("react/jsx-runtime");var n=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[n[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:a}=e.type;if(r===null&&a===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:a??e.type.weight[n[t]]};let o=face(e,t);return o.fontWeight===void 0||a===null?o:{fontFamily:o.fontFamily,fontWeight:a}}function a(e){return e<=450?"regular":e<=650?"medium":"bold"}var o={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=i.get(e);r===void 0&&(r=/* @__PURE__ */new Map,i.set(e,r));let n=r.get(t);if(n!==void 0)return n;let a=l(e,t);return r.set(t,a),a}var i=/* @__PURE__ */new WeakMap;function l(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=a(Number(n)),l=r.face==="mono"?face(e,o[i]):r.face==="heading"?headingFace(e,i):face(e,i),s=r.face==="heading"?e.type.headingWeight??n:n,d=l.fontWeight===void 0?l:{fontFamily:l.fontFamily,fontWeight:s},u=r.size,c={...d,fontSize:u,lineHeight:Math.round(u*r.lineHeight*100)/100};return r.letterSpacing!==0&&(c.letterSpacing=Math.round(u*r.letterSpacing*100)/100),r.uppercase&&(c.textTransform="uppercase"),/* @__PURE__ */Object.freeze(c)}var s=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),d=/* @__PURE__ */Object.freeze({transcript_exposure:/* @__PURE__ */Object.freeze({title:"Conversation sharing",body:e=>`Let ${e} read the conversations you have with Everfur.`}),partner_context:/* @__PURE__ */Object.freeze({title:"Pet details",body:e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`})});function consentRowView(e,t){if(e.status==="signed_out")return{kind:"signedOut"};let r=e.scopes.find(e=>e.scope===t);return r===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:r.loaded?{kind:"row",scope:r.scope,granted:r.granted,hasDecision:r.hasDecision,saving:r.saving,error:r.error}:r.error!==null?{kind:"failed",error:r.error}:{kind:"loading"}}var u=[{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}],c=/* @__PURE__ */Object.freeze(u.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(c.map(e=>e.wireCode));var p=/* @__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"}),f=/* @__PURE__ */Object.freeze(c.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:p[e.wireCode]}))),h=new Map(f.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),v=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(f.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...v]){let t=h.get(e+r);if(t)return t}}var b=/* @__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 b[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var _=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return _.has(e)}var y=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||y.has(e)}var g=500,m=8e3,w=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(g*2**r,m);return Math.floor(t()*n)}var C="This feature isn't available on your account right now.",E="Something in that request was not right. Check the details and try again.",S=/* @__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:E,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:E,unknown:"Something went wrong. Please try again."}),F="This session has ended. Please sign in again.",k="linked_account_read_only";function T(e,t,r){return e==="conflict"&&r===k?C:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?F:userFacingError(e)}function userFacingError(e){return S[e]}function x(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var I=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===k,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:T(e,t?.wireCode,n?k:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&I.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(a.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&x(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&x(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}function ok(e,t){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
4
4
|
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 errorFrame(e){/* @__PURE__ */
|
|
5
5
|
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",j="anonTokenInvalid";async function z(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function D(e,t){let r=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...r?{wireMessage:r}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[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:{...A(e.headers),...authHeaders(t)}}}function A(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===O||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await z(t),n=await t.transport.request(withAuthHeaders(e,N(t,r)));if(n.ok||q(n.error.raw)!==j||t.anonIdentity===void 0||t.userRef!==null)return n;let a=await t.anonIdentity.token({forceRefresh:true});return a===null||a===r?n:t.transport.request(withAuthHeaders(e,N(t,a)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(D(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(D(e,{wireCode:q(n.error.raw),requestId:n.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(M(o.error))):o}function N(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function M(e){let t=e.raw,r=q(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function q(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:L(e)})}function L(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var P=3e4,B=m*2,U="idempotency-key",H=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),V=/* @__PURE__ */Object.freeze({onEvent(){}}),K=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Y(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??V,r=e.timers??K,n=e.rng??Math.random,a=e.sleep??((e,t)=>se(e,r,t)),o=e.maxAttempts??w,i=e.unaryTimeoutMs??P,l=e.newIdempotencyKey??$(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??o),f=u?.idempotent??H.has(d.method),h=u?.idempotencyKey===void 0?null:Y(u.idempotencyKey),v=f?h??l():null,b=W(d,v),_=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:_,...v?{idempotencyKey:v}:{},...e});s(o({phase:"attempt"}));let l=ie(i,r),u=le(l.signal,d.signal),f;try{f=await authedSend({...b,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),l.cancel()}if(f.ok)return s(o({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=Q(h,_,{maxAttempts:p,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),g={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(o({phase:"settled",...g})),err(h);if(s(o({phase:"retry",...g,delayMs:y.delayMs})),await a(y.delayMs,d.signal),d.signal?.aborted===true)return s(o({phase:"settled",...g,reason:"aborted"})),err(h);_+=1}}async function u(t){return withAuthHeaders(t,await oe(e.auth))}async function*c(t,r,n){s(
|
package/dist/consent/index.d.cts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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
|
import { ReactNode } from 'react';
|
|
3
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
import { E as EverfurConsentScope } from '../copy.d
|
|
5
|
-
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d
|
|
4
|
+
import { E as EverfurConsentScope } from '../copy.d--F5A9cXK.cjs';
|
|
5
|
+
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d--F5A9cXK.cjs';
|
|
6
6
|
import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.cjs';
|
|
7
7
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.cjs';
|
|
8
|
-
export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-
|
|
9
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, h as FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../config.d-
|
|
8
|
+
export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-DDpXOtas.cjs';
|
|
9
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, h as FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../config.d-ClAI2RZ6.cjs';
|
|
10
10
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.cjs';
|
|
11
11
|
export { E as EverfurResult } from '../EverfurResult.d-BFH-3s6E.cjs';
|
|
12
|
-
export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-
|
|
13
|
-
import '../requestFunnel.d-
|
|
12
|
+
export { E as ErrorPolicyPort, a as EverfurErrorContext } from '../ErrorPolicyPort.d-BIdmYQnk.cjs';
|
|
13
|
+
import '../requestFunnel.d-BwZDfWVD.cjs';
|
|
14
14
|
|
|
15
15
|
interface EverfurConsentToggleProps {
|
|
16
16
|
/** Which act this row is. One row is one act; two acts are two rows, never one switch. */
|
package/dist/consent/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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
|
import { ReactNode } from 'react';
|
|
3
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
import { E as EverfurConsentScope } from '../copy.d-
|
|
5
|
-
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d-
|
|
4
|
+
import { E as EverfurConsentScope } from '../copy.d-DmxuFJFe.js';
|
|
5
|
+
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy.d-DmxuFJFe.js';
|
|
6
6
|
import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.js';
|
|
7
7
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.js';
|
|
8
|
-
export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-
|
|
9
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, h as FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../config.d-
|
|
8
|
+
export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-D4VtpqRr.js';
|
|
9
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, h as FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../config.d-B7Z-KTGq.js';
|
|
10
10
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.js';
|
|
11
11
|
export { E as EverfurResult } from '../EverfurResult.d-D_-254ZY.js';
|
|
12
|
-
export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-
|
|
13
|
-
import '../requestFunnel.d-
|
|
12
|
+
export { E as ErrorPolicyPort, a as EverfurErrorContext } from '../ErrorPolicyPort.d-BnI5qWg4.js';
|
|
13
|
+
import '../requestFunnel.d-DKBPTpsy.js';
|
|
14
14
|
|
|
15
15
|
interface EverfurConsentToggleProps {
|
|
16
16
|
/** Which act this row is. One row is one act; two acts are two rows, never one switch. */
|
package/dist/consent/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
import{createContext,forwardRef as e,createElement as t,useMemo as r,useState as n,useRef as a,useCallback as o,useEffect as i,useContext as l,Component as s}from"react";import{TextInput as d,View as u,ActivityIndicator as c,Pressable as p,StyleSheet as f,Text as h}from"react-native";import{jsxs as v,jsx as b}from"react/jsx-runtime";var _=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,n=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:n}:{fontFamily:n,fontWeight:r.weight[_[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:n}=e.type;if(r===null&&n===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:n??e.type.weight[_[t]]};let a=face(e,t);return a.fontWeight===void 0||n===null?a:{fontFamily:a.fontFamily,fontWeight:n}}function y(e){return e<=450?"regular":e<=650?"medium":"bold"}var g={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=m.get(e);r===void 0&&(r=/* @__PURE__ */new Map,m.set(e,r));let n=r.get(t);if(n!==void 0)return n;let a=w(e,t);return r.set(t,a),a}var m=/* @__PURE__ */new WeakMap;function w(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,a=y(Number(n)),o=r.face==="mono"?face(e,g[a]):r.face==="heading"?headingFace(e,a):face(e,a),i=r.face==="heading"?e.type.headingWeight??n:n,l=o.fontWeight===void 0?o:{fontFamily:o.fontFamily,fontWeight:i},s=r.size,d={...l,fontSize:s,lineHeight:Math.round(s*r.lineHeight*100)/100};return r.letterSpacing!==0&&(d.letterSpacing=Math.round(s*r.letterSpacing*100)/100),r.uppercase&&(d.textTransform="uppercase"),/* @__PURE__ */Object.freeze(d)}var C=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),E=/* @__PURE__ */Object.freeze({transcript_exposure:/* @__PURE__ */Object.freeze({title:"Conversation sharing",body:e=>`Let ${e} read the conversations you have with Everfur.`}),partner_context:/* @__PURE__ */Object.freeze({title:"Pet details",body:e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`})});function consentRowView(e,t){if(e.status==="signed_out")return{kind:"signedOut"};let r=e.scopes.find(e=>e.scope===t);return r===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:r.loaded?{kind:"row",scope:r.scope,granted:r.granted,hasDecision:r.hasDecision,saving:r.saving,error:r.error}:r.error!==null?{kind:"failed",error:r.error}:{kind:"loading"}}var F=[{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}],S=/* @__PURE__ */Object.freeze(F.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(S.map(e=>e.wireCode));var k=/* @__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"}),T=/* @__PURE__ */Object.freeze(S.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:k[e.wireCode]}))),I=new Map(T.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),R=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(T.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...R]){let t=I.get(e+r);if(t)return t}}var x=/* @__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 x[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var O=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return O.has(e)}var z=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||z.has(e)}var D=500,j=8e3,A=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(D*2**r,j);return Math.floor(t()*n)}var N="This feature isn't available on your account right now.",M="Something in that request was not right. Check the details and try again.",q=/* @__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:N,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:M,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:N,runtimeDisposed:M,unknown:"Something went wrong. Please try again."}),L="This session has ended. Please sign in again.",B="linked_account_read_only";function P(e,t,r){return e==="conflict"&&r===B?N:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?L:userFacingError(e)}function userFacingError(e){return q[e]}function U(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var H=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===B,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:P(e,t?.wireCode,n?B:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&H.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(a.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&U(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&U(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}function ok(e,t){/* @__PURE__ */
|
|
2
|
+
import{createContext,forwardRef as e,createElement as t,useMemo as r,useState as n,useRef as a,useCallback as o,useEffect as i,useContext as l,Component as s}from"react";import{TextInput as d,View as u,ActivityIndicator as c,Pressable as p,StyleSheet as f,Text as h}from"react-native";import{jsxs as v,jsx as b}from"react/jsx-runtime";var _=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,n=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:n}:{fontFamily:n,fontWeight:r.weight[_[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:n}=e.type;if(r===null&&n===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:n??e.type.weight[_[t]]};let a=face(e,t);return a.fontWeight===void 0||n===null?a:{fontFamily:a.fontFamily,fontWeight:n}}function y(e){return e<=450?"regular":e<=650?"medium":"bold"}var g={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=m.get(e);r===void 0&&(r=/* @__PURE__ */new Map,m.set(e,r));let n=r.get(t);if(n!==void 0)return n;let a=w(e,t);return r.set(t,a),a}var m=/* @__PURE__ */new WeakMap;function w(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,a=y(Number(n)),o=r.face==="mono"?face(e,g[a]):r.face==="heading"?headingFace(e,a):face(e,a),i=r.face==="heading"?e.type.headingWeight??n:n,l=o.fontWeight===void 0?o:{fontFamily:o.fontFamily,fontWeight:i},s=r.size,d={...l,fontSize:s,lineHeight:Math.round(s*r.lineHeight*100)/100};return r.letterSpacing!==0&&(d.letterSpacing=Math.round(s*r.letterSpacing*100)/100),r.uppercase&&(d.textTransform="uppercase"),/* @__PURE__ */Object.freeze(d)}var C=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),E=/* @__PURE__ */Object.freeze({transcript_exposure:/* @__PURE__ */Object.freeze({title:"Conversation sharing",body:e=>`Let ${e} read the conversations you have with Everfur.`}),partner_context:/* @__PURE__ */Object.freeze({title:"Pet details",body:e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`})});function consentRowView(e,t){if(e.status==="signed_out")return{kind:"signedOut"};let r=e.scopes.find(e=>e.scope===t);return r===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:r.loaded?{kind:"row",scope:r.scope,granted:r.granted,hasDecision:r.hasDecision,saving:r.saving,error:r.error}:r.error!==null?{kind:"failed",error:r.error}:{kind:"loading"}}var F=[{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}],S=/* @__PURE__ */Object.freeze(F.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(S.map(e=>e.wireCode));var k=/* @__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"}),T=/* @__PURE__ */Object.freeze(S.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:k[e.wireCode]}))),I=new Map(T.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),R=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(T.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...R]){let t=I.get(e+r);if(t)return t}}var x=/* @__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 x[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var z=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return z.has(e)}var O=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||O.has(e)}var D=500,j=8e3,A=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(D*2**r,j);return Math.floor(t()*n)}var N="This feature isn't available on your account right now.",M="Something in that request was not right. Check the details and try again.",q=/* @__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:N,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:M,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:N,runtimeDisposed:M,unknown:"Something went wrong. Please try again."}),L="This session has ended. Please sign in again.",B="linked_account_read_only";function P(e,t,r){return e==="conflict"&&r===B?N:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?L:userFacingError(e)}function userFacingError(e){return q[e]}function U(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var H=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===B,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:P(e,t?.wireCode,n?B:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&H.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(a.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&U(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&U(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}function ok(e,t){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
4
4
|
return Object.freeze({ok:false,error:e})}var K=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(e){/* @__PURE__ */
|
|
5
5
|
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 V="x-everfur-anon-token",Y="anonTokenInvalid";async function W(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function $(e,t){let r=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...r?{wireMessage:r}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[V]=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:{...G(e.headers),...authHeaders(t)}}}function G(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===V||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await W(t),n=await t.transport.request(withAuthHeaders(e,Q(t,r)));if(n.ok||Z(n.error.raw)!==Y||t.anonIdentity===void 0||t.userRef!==null)return n;let a=await t.anonIdentity.token({forceRefresh:true});return a===null||a===r?n:t.transport.request(withAuthHeaders(e,Q(t,a)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err($(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err($(e,{wireCode:Z(n.error.raw),requestId:n.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(X(o.error))):o}function Q(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function X(e){let t=e.raw,r=Z(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function Z(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:J(e)})}function J(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var ee=3e4,te=j*2,re="idempotency-key",ne=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),ae=/* @__PURE__ */Object.freeze({onEvent(){}}),oe=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function ie(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??ae,r=e.timers??oe,n=e.rng??Math.random,a=e.sleep??((e,t)=>Ce(e,r,t)),o=e.maxAttempts??A,i=e.unaryTimeoutMs??ee,l=e.newIdempotencyKey??se(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??o),f=u?.idempotent??ne.has(d.method),h=u?.idempotencyKey===void 0?null:ie(u.idempotencyKey),v=f?h??l():null,b=le(d,v),_=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:_,...v?{idempotencyKey:v}:{},...e});s(o({phase:"attempt"}));let l=me(i,r),u=we(l.signal,d.signal),f;try{f=await authedSend({...b,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),l.cancel()}if(f.ok)return s(o({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=ue(h,_,{maxAttempts:p,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),g={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(o({phase:"settled",...g})),err(h);if(s(o({phase:"retry",...g,delayMs:y.delayMs})),await a(y.delayMs,d.signal),d.signal?.aborted===true)return s(o({phase:"settled",...g,reason:"aborted"})),err(h);_+=1}}async function u(t){return withAuthHeaders(t,await ge(e.auth))}async function*c(t,r,n){s(
|
|
6
6
|
/* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:r.method,path:r.path,attempt:0}));try{yield*e.auth.transport.stream(r,n)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
7
|
-
return Object.freeze({send:d,authorize:u,stream:c})}function le(e,t){let r={};for(let[t,n]of Object.entries(e.headers??{}))t.toLowerCase()!==re&&(r[t]=n);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}function se(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var de=10;function ue(e,t,r){if(r.aborted)return{retry:false,reason:"aborted"};let n=ce(e);if(n==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if((()=>{if(r.policy===void 0)return false;try{return!r.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let o=()=>{if(r.policy===void 0)return null;let t;try{t=r.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(de,Math.floor(t)))},i=r.perCallMaxAttempts??o()??r.maxAttempts;if(t+1>=i)return{retry:false,reason:"attempts-exhausted"};let l=pe(e,r.now);return l!==null?l>te?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:l}:{retry:true,reason:a,delayMs:backoffDelayMs(t,r.rng)}}function ce(e){let t=e.code==="unknown"?fromWire(_e(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function pe(e,t){let r=he(e.raw);if(r!==null){let e=r-t;return e>0?e:0}let n=fe(e.raw);return n===null?null:Math.round(n*1e3)}function fe(e){for(let t of ve(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function he(e){for(let t of ve(e)){let e=t.resets_at,r=be(e);if(r!==null)return r}return null}function ve(e){if(!ye(e))return[];let t=[e];for(let r of["error","detail"]){let n=e[r];ye(n)&&t.push(n)}return t}function be(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 _e(e){for(let t of ve(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function ye(e){return typeof e=="object"&&e!==null}async function ge(e){if(e.mode==="anonymous"){let t=await W(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 me(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return{signal:r.signal,cancel:()=>t.clearTimeout(n)}}function we(e,t){let r=()=>{};if(!t)return{signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let a=()=>n.abort();return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a)}}}function Ce(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",o),n()},e),o=()=>{t.clearTimeout(a),n()};r?.addEventListener("abort",o,{once:true})})}var Ee="/widget/v1/consent",Fe=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),Se="records_content",ke=64,Te=new Set(Fe);function isEverfurConsentScope(e){return typeof e=="string"&&Te.has(e)}function Ie(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function Re(e){return isEverfurConsentScope(e)?null:Ie(e===Se?`'${Se}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/consent (all pets) or /widget/v1/records/pets/{pet_ref}/consent (one pet), which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${Fe.join(", ")}`)}function xe(e){if(typeof e!="object"||e===null)return Ie("write needs a decision object");let{scope:t,granted:r,consentVersion:n}=e,a=Re(t);return a!==null?a:typeof r!="boolean"?Ie("granted must be true to grant or false to withdraw"):n!==void 0&&(typeof n!="string"||n.length===0||n.length>ke)?Ie(`consentVersion must be 1..${ke} characters`):null}var
|
|
7
|
+
return Object.freeze({send:d,authorize:u,stream:c})}function le(e,t){let r={};for(let[t,n]of Object.entries(e.headers??{}))t.toLowerCase()!==re&&(r[t]=n);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}function se(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var de=10;function ue(e,t,r){if(r.aborted)return{retry:false,reason:"aborted"};let n=ce(e);if(n==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if((()=>{if(r.policy===void 0)return false;try{return!r.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let o=()=>{if(r.policy===void 0)return null;let t;try{t=r.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(de,Math.floor(t)))},i=r.perCallMaxAttempts??o()??r.maxAttempts;if(t+1>=i)return{retry:false,reason:"attempts-exhausted"};let l=pe(e,r.now);return l!==null?l>te?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:l}:{retry:true,reason:a,delayMs:backoffDelayMs(t,r.rng)}}function ce(e){let t=e.code==="unknown"?fromWire(_e(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function pe(e,t){let r=he(e.raw);if(r!==null){let e=r-t;return e>0?e:0}let n=fe(e.raw);return n===null?null:Math.round(n*1e3)}function fe(e){for(let t of ve(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function he(e){for(let t of ve(e)){let e=t.resets_at,r=be(e);if(r!==null)return r}return null}function ve(e){if(!ye(e))return[];let t=[e];for(let r of["error","detail"]){let n=e[r];ye(n)&&t.push(n)}return t}function be(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 _e(e){for(let t of ve(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function ye(e){return typeof e=="object"&&e!==null}async function ge(e){if(e.mode==="anonymous"){let t=await W(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 me(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return{signal:r.signal,cancel:()=>t.clearTimeout(n)}}function we(e,t){let r=()=>{};if(!t)return{signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let a=()=>n.abort();return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a)}}}function Ce(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",o),n()},e),o=()=>{t.clearTimeout(a),n()};r?.addEventListener("abort",o,{once:true})})}var Ee="/widget/v1/consent",Fe=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),Se="records_content",ke=64,Te=new Set(Fe);function isEverfurConsentScope(e){return typeof e=="string"&&Te.has(e)}function Ie(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function Re(e){return isEverfurConsentScope(e)?null:Ie(e===Se?`'${Se}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/consent (all pets) or /widget/v1/records/pets/{pet_ref}/consent (one pet), which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${Fe.join(", ")}`)}function xe(e){if(typeof e!="object"||e===null)return Ie("write needs a decision object");let{scope:t,granted:r,consentVersion:n}=e,a=Re(t);return a!==null?a:typeof r!="boolean"?Ie("granted must be true to grant or false to withdraw"):n!==void 0&&(typeof n!="string"||n.length===0||n.length>ke)?Ie(`consentVersion must be 1..${ke} characters`):null}var ze=e=>typeof e=="string"&&e.length>0?e:null;function Oe(e,t){if(typeof e!="object"||e===null)return null;let r=e;return typeof r.granted!="boolean"||typeof r.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:t,granted:r.granted,hasDecision:r.has_decision,consentVersion:ze(r.consent_version),actor:ze(r.actor),recordedAt:ze(r.recorded_at)})}function De(e){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response carried no granted/has_decision pair`})}function je(e){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function createConsentRepository(e){let t=()=>{let{services:t}=e.registry;return createConsentRepositoryOver({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})};return{read:(r,n)=>e.isDisposed?Promise.resolve(err(je("read"))):t().read(r,n),write:(r,n)=>e.isDisposed?Promise.resolve(err(je("write"))):t().write(r,n)}}function createConsentRepositoryOver(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=(e,t)=>t?{...e,signal:t}:e;return{async read(e,n){let a=Re(e);if(a!==null)return err(a);let o=await t.send("consent.read",r({method:"GET",path:Ee,query:{scope:e}},n?.signal));if(!o.ok)return err(o.error);let i=Oe(o.value,e);return i===null?err(De("consent.read")):ok(i)},async write(e,n){let a=xe(e);if(a!==null)return err(a);let o={scope:e.scope,granted:e.granted};e.consentVersion!==void 0&&(o.consent_version=e.consentVersion);let i=await t.send("consent.write",r({method:"PUT",path:Ee,body:o},n?.signal));if(!i.ok)return err(i.error);let l=Oe(i.value,e.scope);return l===null?err(De("consent.write")):ok(l)}}}var Ae=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Ne=globalThis,Me=Ne[Ae]??(Ne[Ae]=createContext(null));Me.displayName??="EverfurContext";function qe(){let e=l(Me);if(e===null)throw new K("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}function Le(e,t){/* @__PURE__ */
|
|
8
8
|
return Object.freeze({scope:e,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:t})}function Be(e){/* @__PURE__ */
|
|
9
9
|
return Object.freeze({scope:e.scope,granted:e.granted,hasDecision:e.hasDecision,consentVersion:e.consentVersion,recordedAt:e.recordedAt,loaded:true,saving:false,error:null})}function Pe(){return makeEverfurError("sessionRequired",{retryable:false,wireMessage:"a consent decision is authored by the member; sign a user in on the provider first"})}function useEverfurConsentRepository(){let{runtime:e}=qe();return r(()=>createConsentRepository(e),[e])}function useEverfurConsent(e){let{userRef:userRef}=qe(),t=useEverfurConsentRepository(),l=(e?.scopes??[]).filter(isEverfurConsentScope).join(","),s=r(()=>{let e=l.length===0?[]:l.split(",");return e.length===0?Fe:/* @__PURE__ */Object.freeze(e)},[l]),[d,u]=n(userRef===null?"signed_out":"loading"),[c,p]=n([]),[f,h]=n(null),v=a(0),b=o(async()=>{if(userRef===null){v.current+=1,u("signed_out"),p([]),h(null);return}let e=v.current+=1;u("loading"),h(null);let r=await Promise.all(s.map(e=>t.read(e)));if(e!==v.current)return;let n=r.map((e,t)=>{let r=s[t];return e.ok?Be(e.value):Le(r,e.error)}),a=r.find(e=>!e.ok),o=r.every(e=>!e.ok);p(/* @__PURE__ */Object.freeze(n)),u(o?"failed":"ready"),h(o&&a!==void 0&&!a.ok?a.error:null)},[t,s,userRef]);i(()=>{b()},[b]);let _=o(async(e,r)=>{if(userRef===null)return err(Pe());let n=v.current,a=null;p(t=>{let n=t.findIndex(t=>t.scope===e),o=n===-1?Le(e,null):t[n];a=o;let i=/* @__PURE__ */Object.freeze({...o,granted:r,hasDecision:true,saving:true,error:null});if(n===-1)/* @__PURE__ */return Object.freeze([...t,i]);let l=[...t];return l[n]=i,/* @__PURE__ */Object.freeze(l)});let o=await t.write({scope:e,granted:r});return n!==v.current||p(t=>{let r=t.findIndex(t=>t.scope===e);if(r===-1)return t;let n=[...t];return n[r]=o.ok?Be(o.value):/* @__PURE__ */Object.freeze({...a??Le(e,null),saving:false,error:o.error}),/* @__PURE__ */Object.freeze(n)}),o},[t,userRef]);return r(()=>({status:d,scopes:c,error:f,setConsent:_,refresh:b}),[d,c,f,_,b])}function Ue(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function He(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function Ke(e,...t){if(typeof e=="function")try{let r=e(...t);return He(r)&&Promise.resolve(r).then(void 0,Ue),r}catch(e){Ue(e);return}}var Ve=/* @__PURE__ */new WeakMap;function Ye(e){if(typeof e!="function")return;let t=Ve.get(e);if(t!==void 0)return t;let r=(...t)=>{Ke(e,...t)};return Ve.set(e,r),r}function We(e,t){let r=null;for(let n of t){let t=e[n];typeof t=="function"&&(r??={...e},r[n]=Ye(t))}return r??e}var $e=class extends s{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(e,t){return Object.is(e.resetKey,t.key)?null:{failed:false,key:e.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:e}){return e()}function HostRender({render:e,fallback:r,resetKey:n}){return t($e,{fallback:r,resetKey:n,children:t(RenderHost,{render:e})})}var Ge=/* @__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 Qe=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Qe(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var Xe=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var Ze={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Je={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},et={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},tt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},rt={regular:"400",medium:"500",bold:"700"},nt={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},at=0,ot="System",it="monospace",lt=["content","heading","control","compact","badge"];function st(e){let t={};for(let r of lt)t[r]=e;return t}var dt=[];function ut(){return{family:ot,mono:it,fontUrl:null,families:{regular:ot,medium:ot,bold:ot,mono:it,monoMedium:it,monoBold:it},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:et,tierSizes:st(et),lineHeight:tt,weight:rt,letterSpacing:nt,scale:1,maxScale:at,scaleCaps:Xe,headingFamily:null,headingWeight:null,fontSources:dt,roles:Ge,typeScale:1}}var ct={},pt=/* @__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 ft={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(pt.standard),emphasized:cssCubicBezier(pt.emphasized),exit:cssCubicBezier(pt.exit)},reducedMotion:false},ht={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)"},vt=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ht,space:Ze,radius:Je,type:ut(),motion:ft,slots:ct}),bt={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:bt,space:Ze,radius:Je,type:ut(),motion:ft,slots:ct});var _t=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),yt=globalThis,gt=yt[_t]??(yt[_t]=createContext(vt));gt.displayName??="EverfurThemeContext";function useEverfurTheme(){return l(gt)}function mt(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}function Text({tier:e,variant:r,...n}){let a=useEverfurTheme(),o=r===void 0?void 0:a.type.roles[r],i=mt(a.type,e??o?.tier??"content"),l=r===void 0?n:{...n,style:[{...textRole(a,r),color:a.color.text.primary,flexShrink:1},n.style]};return t(h,i===void 0?l:{maxFontSizeMultiplier:i,...l})}e(function(e,r){return t(d,{...e,...r===null?{}:{ref:r}})});function EverfurConsentToggle(e){let{scope:t,onChange:a,renderNotice:i,style:l}=We(e,["onChange"]),s=useEverfurTheme(),d=r(()=>wt(s),[s]),f=useEverfurConsent({scopes:[t]}),h=consentRowView(f,t),_=E[t],[y,g]=n(null),m=o(async e=>{g(e);let r=await f.setConsent(t,e);r.ok&&(g(null),a?.(r.value.granted))},[f,a,t]),w=(e,t)=>/* @__PURE__ */v(u,{style:d.notice,children:[
|
|
10
10
|
/* @__PURE__ */b(HostRender,{resetKey:e,render:()=>i?i(e):/* @__PURE__ */b(Text,{style:d.noticeText,children:e.displayMessage}),fallback:/* @__PURE__ */b(Text,{style:d.noticeText,children:e.displayMessage})}),
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { U as UserRef, P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
4
4
|
import { C as CapabilityName, a as CapabilityDecision } from './resolve.d-BTC3b6FW.cjs';
|
|
5
|
-
import { S as SecureStorePort, c as LogSink, a as EverfurEventHandler, g as EverfurRuntime } from './runtimeTypes.d-
|
|
6
|
-
import { T as TokenProvider } from './identity.d-
|
|
7
|
-
import { T as TransportPort } from './config.d-
|
|
5
|
+
import { S as SecureStorePort, c as LogSink, a as EverfurEventHandler, g as EverfurRuntime } from './runtimeTypes.d-CL4l7ta4.cjs';
|
|
6
|
+
import { T as TokenProvider } from './identity.d-DDpXOtas.cjs';
|
|
7
|
+
import { T as TransportPort } from './config.d-ClAI2RZ6.cjs';
|
|
8
8
|
import { K as KvPort, I as ImageCachePort } from './cacheEpoch.d-DknKn3S0.cjs';
|
|
9
9
|
import { T as TelemetryPort } from './TelemetryPort.d-BDNr00hu.cjs';
|
|
10
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
10
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BIdmYQnk.cjs';
|
|
11
11
|
import { C as CameraPort } from './CameraPort.d-Cv31Pz7g.cjs';
|
|
12
12
|
import { U as UploadTransport } from './ports.d-BX4f4UsB.cjs';
|
|
13
|
-
import { U as UploadPort } from './unreadStore.d-
|
|
14
|
-
import { E as EverfurThemeInput } from './branding.d-
|
|
13
|
+
import { U as UploadPort } from './unreadStore.d-Donv4bcF.cjs';
|
|
14
|
+
import { E as EverfurThemeInput } from './branding.d-CqDLKj1U.cjs';
|
|
15
15
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
16
|
-
import { b as WidgetPetProfile } from './petsRepository.d-
|
|
16
|
+
import { b as WidgetPetProfile } from './petsRepository.d-ai_tZ3lu.cjs';
|
|
17
17
|
import { n as EverfurTheme } from './tokens.d-DDiPRgye.cjs';
|
|
18
18
|
|
|
19
19
|
interface EverfurConfig {
|
|
@@ -52,6 +52,12 @@ interface EverfurConfig {
|
|
|
52
52
|
readonly imageCache?: ImageCachePort;
|
|
53
53
|
/** Structured, redacted LogPort events when true. */
|
|
54
54
|
readonly debug?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Your app's own version (for example `4.12.0` or `4.12.0 (812)`). Optional. On React Native it is sent as
|
|
57
|
+
* `X-Everfur-App-Version`, and every error the SDK hands your hooks carries it in its `context`. Up to 64
|
|
58
|
+
* characters of letters, digits, spaces and `. _ + - ( )`; anything else is ignored.
|
|
59
|
+
*/
|
|
60
|
+
readonly appVersion?: string;
|
|
55
61
|
/**
|
|
56
62
|
* Lifecycle events: `ready`, `error`, `session_expired`, `conversation_started`, `unread_changed` (see `EverfurClientEvent`).
|
|
57
63
|
* `unread_changed` arrives only while `useEverfurUnread` is mounted.
|