@everfur/sdk 0.5.8 → 0.6.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/CHANGELOG.md +89 -0
- package/dist/{Chat-z0C6qgrU.d.cts → Chat-BoAvCWhI.d.cts} +3 -3
- package/dist/{Chat-V_fRV7kR.d.ts → Chat-CHqcgMyw.d.ts} +3 -3
- package/dist/{DepthViews-B-rnrFpR.d.ts → DepthViews-7Y8Ur058.d.ts} +1 -1
- package/dist/{DepthViews-CmIFMqoE.d.cts → DepthViews-B0g83e_N.d.cts} +1 -1
- package/dist/{DepthViews-DQo49-QL.d.cts → DepthViews-CT5mQld9.d.cts} +1 -1
- package/dist/{DepthViews-R8bKbJ6t.d.ts → DepthViews-Dg2bIon_.d.ts} +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-D9wvXx_d.d.cts → attachments-C3HJNYQ7.d.cts} +2 -2
- package/dist/{attachments-BxewZK83.d.ts → attachments-CThFsH4b.d.ts} +5 -5
- package/dist/{attachments-CXLSLEvy.d.ts → attachments-CfxsVg7W.d.ts} +2 -2
- package/dist/{attachments-HXsnkA6A.d.cts → attachments-rkox0ewd.d.cts} +5 -5
- package/dist/{bookingCopy-DpqgkSZ_.d.cts → bookingCopy-Do3zMeXb.d.cts} +2 -2
- package/dist/{bookingCopy-DJnAMiJw.d.ts → bookingCopy-Y3OGdoMT.d.ts} +2 -2
- package/dist/{branding-xpQ056sM.d.ts → branding-ChXm8gxI.d.cts} +136 -4
- package/dist/{branding-Xb_wL8N1.d.cts → branding-DYWma2il.d.ts} +136 -4
- package/dist/{casesRepository-s5EjE3Md.d.ts → casesRepository-BbgXYPxa.d.ts} +1 -1
- package/dist/{casesRepository-C2gzlgJW.d.cts → casesRepository-Jj6t60AY.d.cts} +1 -1
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.d.cts +9 -9
- package/dist/chat/index.d.ts +9 -9
- package/dist/chat/index.js +1 -1
- package/dist/client/index.cjs +6 -6
- package/dist/client/index.d.cts +10 -10
- package/dist/client/index.d.ts +10 -10
- package/dist/client/index.js +6 -6
- package/dist/{config-CBJgbICJ.d.cts → config-BZX97FmW.d.cts} +1 -1
- package/dist/{config-CQ4VFCgE.d.ts → config-Dfbj5mlx.d.ts} +1 -1
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +1 -1
- package/dist/{context-CQohsg_w.d.ts → context-Cbe0zYym.d.ts} +7 -7
- package/dist/{context-t2PM_Hwc.d.cts → context-DJXnZ1Mx.d.cts} +7 -7
- package/dist/{copy-DfWmYRTc.d.ts → copy-DHekqSKE.d.ts} +2 -2
- package/dist/{copy-BuawMcCw.d.cts → copy-dKK5KoAQ.d.cts} +2 -2
- package/dist/core/index.cjs +9 -9
- package/dist/core/index.d.cts +15 -15
- package/dist/core/index.d.ts +15 -15
- package/dist/core/index.js +9 -9
- package/dist/{depth-Cvw1LdWV.d.ts → depth-CrpRjWGB.d.ts} +2 -2
- package/dist/{depth-DXK5Y7sO.d.cts → depth-NmWSbvfi.d.cts} +2 -2
- package/dist/{entitlementRepository-CatKDVru.d.cts → entitlementRepository-iL-9vS1i.d.cts} +3 -3
- package/dist/{entitlementRepository-MhuhRhmI.d.ts → entitlementRepository-tVNazi8R.d.ts} +3 -3
- package/dist/{identity-vvueVndA.d.ts → identity-B8rp0L9G.d.ts} +1 -1
- package/dist/{identity-DczAiVsf.d.cts → identity-D7PO5s9m.d.cts} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +6 -6
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/{pets-BP2lkMbR.d.ts → pets-BQbXmICf.d.ts} +1 -1
- package/dist/{pets-BRsxDv4g.d.cts → pets-BWx9BKea.d.cts} +1 -1
- package/dist/{petsRepository-C4oEuH9r.d.ts → petsRepository-0oBVydl6.d.ts} +1 -1
- package/dist/{petsRepository-DeQqFxAV.d.cts → petsRepository-SqIvEMiT.d.cts} +1 -1
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +1 -1
- package/dist/{ports-D0YSZnxV.d.cts → ports-ChnzSy4E.d.cts} +25 -6
- package/dist/{ports-DOoFLAKN.d.ts → ports-iXPWd7Vt.d.ts} +25 -6
- package/dist/records/depth/index.cjs +1 -1
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +1 -1
- package/dist/records/index.cjs +2 -2
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +2 -2
- package/dist/{requestFunnel-D6UOCs0L.d.ts → requestFunnel-CQzz2DIW.d.ts} +2 -2
- package/dist/{requestFunnel-BGpcJ_po.d.cts → requestFunnel-DAwb7haa.d.cts} +2 -2
- package/dist/{runtimeTypes-Bi-_nYuC.d.ts → runtimeTypes-BNOxfmfg.d.ts} +5 -5
- package/dist/{runtimeTypes-wFAjfnu3.d.cts → runtimeTypes-DB9-kigO.d.cts} +5 -5
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.cjs +1 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/televet/booking/index.js +1 -1
- package/dist/televet/call/index.cjs +1 -1
- package/dist/televet/call/index.js +1 -1
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +9 -9
- package/dist/testing/rn/index.d.ts +9 -9
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.d.cts +9 -9
- package/dist/testing/web/index.d.ts +9 -9
- package/dist/{timelineRows-CRy4jphH.d.cts → timelineRows-BuNhzDbH.d.cts} +1 -1
- package/dist/{timelineRows-BzaTUbq_.d.ts → timelineRows-Dll2IGFg.d.ts} +1 -1
- package/dist/{tokens-CIngRkvt.d.cts → tokens-ARWZtMOU.d.cts} +14 -2
- package/dist/{tokens-CIngRkvt.d.ts → tokens-ARWZtMOU.d.ts} +14 -2
- package/dist/{typeStyle-YPS_MXeI.d.ts → typeStyle-8iEqQmP_.d.ts} +2 -2
- package/dist/{typeStyle-DHJzDaUo.d.cts → typeStyle-YCS8dt19.d.cts} +2 -2
- package/dist/{useRecordsDepth-DIeDEXgB.d.cts → useRecordsDepth-CNEHZJtj.d.cts} +1 -1
- package/dist/{useRecordsDepth-UNvpPiHN.d.ts → useRecordsDepth-CuNdne6E.d.ts} +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view-D4bOSC88.d.cts → view-BhqWlYrZ.d.cts} +2 -2
- package/dist/{view-DvY7eq4Q.d.ts → view-DFy8EDwf.d.ts} +2 -2
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +1 -1
- package/dist/web/index.cjs +7 -7
- package/dist/web/index.d.cts +19 -19
- package/dist/web/index.d.ts +19 -19
- package/dist/web/index.js +7 -7
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.cjs +1 -1
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/depth/index.js +1 -1
- package/dist/web/records/index.cjs +3 -3
- package/dist/web/records/index.d.cts +9 -9
- package/dist/web/records/index.d.ts +9 -9
- package/dist/web/records/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +2 -2
- package/dist/web/televet/booking/index.d.cts +7 -7
- package/dist/web/televet/booking/index.d.ts +7 -7
- package/dist/web/televet/booking/index.js +2 -2
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.cjs +3 -3
- package/dist/web/televet/index.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,95 @@ changes that has not been earned by any production integration yet.
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.6.0] - 2026-09-29
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Appearance: the Stripe-shaped theme, and the global variables it needs (web and React Native).** The `theme`
|
|
18
|
+
prop accepts `appearance: { theme, variables, rules }`: presets `everfur`, `minimal`, `night`
|
|
19
|
+
(`APPEARANCE_PRESETS`); the variables `colorPrimary`, `colorAccent`, `colorBackground`, `colorText`,
|
|
20
|
+
`colorDanger`, `fontFamily`, `fontSizeBase`, `borderRadius`, `spacingUnit`, `colorScheme`; and `rules` for the
|
|
21
|
+
nine slots. It expands onto the flat branding fields (`expandAppearance`), so precedence, locks and the
|
|
22
|
+
contrast guard are the flat fields' own. Eight new flat fields, additive on wire schema 2 (an older SDK ignores
|
|
23
|
+
them): `background_color` / `background_color_dark` (the ground family: surface, page, chat, assistant reply,
|
|
24
|
+
with the cream, subtle and ring grounds derived), `text_color` / `text_color_dark`, `danger_color`,
|
|
25
|
+
`font_size_base` (px, 12 to 20), `border_radius` (px, 0 to 32; locks with `radius_scale`), `spacing_unit` (px,
|
|
26
|
+
3 to 6). Body, muted, meta and danger inks are now pushed to 4.5:1 on every ground with the pole the grounds call
|
|
27
|
+
for (unchanged on every compiled palette). The frame protocol carries a theme one level deeper so
|
|
28
|
+
`appearance.rules` reaches the iframe. The cross-repo contract is `contract/appearance/appearance_v1.json`.
|
|
29
|
+
- **`danger_color_dark`** (`colorDanger` under a dark `colorScheme`, and `dangerColorDark`): the dark palette's
|
|
30
|
+
danger colour. Without it the dark palette derives one from `danger_color` with the brand colours' algorithm
|
|
31
|
+
(`#B00020` -> `#FF4769`, the value EFBackend's fold now puts on the wire), then pushes it only as far as its
|
|
32
|
+
critical wash needs. A `danger_color` lock keeps its dark twin, as the other colour locks do, and a `fonts` lock
|
|
33
|
+
keeps `font_urls` (EFBackend `WIRE_LOCK_NAMES`).
|
|
34
|
+
- **`EverfurColorTokens.onDanger`**: the label on a danger fill (the Cancel visit button, web and React Native).
|
|
35
|
+
It is `onPrimary` wherever that already reads at 4.5:1 on the danger fill (every compiled palette and every dark
|
|
36
|
+
partner brand), else the legible pole: a light partner primary's near-black label read 2.92:1 on the red.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- **Visual change: the default light error red is darker, so safety text reads at AA (web and React Native).** The
|
|
41
|
+
compiled light `errorRed` moves from `#FF1B00` to `#CC1600`, the same hue at 40% lightness. It inks the booking
|
|
42
|
+
EMERGENCY title and its banner edge, the consent toggle's error and other error text. `#FF1B00` read 3.88:1 on
|
|
43
|
+
white, 3.76:1 on the cream `#FDFBF8`, 3.22:1 on `#EFE9E3` and 3.07:1 on the critical wash; `#CC1600` reads
|
|
44
|
+
5.70:1, 5.52:1, 4.74:1 and 4.51:1. The dark palette (`#FF6B5B`), `danger` (`#B91C1C`) and the thumbs-down stroke
|
|
45
|
+
(an icon, 3:1) are unchanged. A partner `danger_color` / `colorDanger` still overrides it exactly as before, and
|
|
46
|
+
a partner who set the old `#FF1B00` already saw `#CC1600`, the value the contrast guard pushes it to. This is
|
|
47
|
+
the one light colour where the SDK now differs from the Everfur app's `colors.errorRed`, on purpose.
|
|
48
|
+
- **The contrast guard covers every ink painted as text.** `errorRed` (the records error line, the consent
|
|
49
|
+
toggle's error, the booking emergency title on its critical wash), `warningStrong` and `text.timestamp` are
|
|
50
|
+
pushed to 4.5:1, and `text.placeholder` and `composerBorder` to 3:1, on the grounds each is drawn on. Measured
|
|
51
|
+
before: `colorDanger: '#FFB3B3'` put the emergency title at 1.7:1 on white; `auto` with `danger_color: '#B00020'`
|
|
52
|
+
put `errorRed` at 2.26:1 on the dark surface; a dark `background_color` on the light palette left the
|
|
53
|
+
placeholder and the timestamp at 1.26:1. Everfur's compiled values on Everfur's compiled grounds are kept exactly.
|
|
54
|
+
- **When a partner background flips the pole, the inks and brand tints the partner did not set start from the
|
|
55
|
+
other compiled palette** (a navy page gets the dark palette's placeholder, muted ink, warning and hairlines,
|
|
56
|
+
already legible there) and each ink is pushed toward the pole of its own grounds. High contrast follows the
|
|
57
|
+
grounds' pole too.
|
|
58
|
+
- **Brand as ink is `brandInk` everywhere (web and React Native).** Titles, outline pills, chevrons, glyphs and
|
|
59
|
+
selected edges that painted `color.brand` (1.52:1 for "Medical records" on a dark partner background) paint
|
|
60
|
+
`brandInk`; `brand` stays the fill. Identical on every compiled palette and every partner brand that already
|
|
61
|
+
reads.
|
|
62
|
+
- **`font_size_base` reaches the web conversation and the composer field** (15/22 and 17/28 bubbles, the 16/26
|
|
63
|
+
field, never under 16 px so iOS does not zoom) and the React Native bubble and field line heights. No derived
|
|
64
|
+
type size drops under 10 px (`nano` was 6.9 px at a base of 12); the compiled scale is unchanged.
|
|
65
|
+
- **The web chat's empty state fits a short box.** In the phone-width quickstart box (600 px at 390 wide) the last
|
|
66
|
+
starter chip was cut off at the composer; the 12% lead now gives its height up first and the 480 px floor is the
|
|
67
|
+
region's basis. A tall box, and a box with no height of its own, render pixel-identically.
|
|
68
|
+
- **On a partner ground with Everfur's brand** (a `background_color` and no `primary_color`) the web history rail
|
|
69
|
+
and the React Native history drawer take the partner's ground instead of Everfur green.
|
|
70
|
+
- **Leniency:** `parsePx` caps its input at 16 characters and no longer backtracks quadratically on a run of
|
|
71
|
+
spaces; Stripe-style `.Class` rule keys (`.Input`, `.Tab:hover`) are documented as ignored (`rules` reads the
|
|
72
|
+
nine slot names).
|
|
73
|
+
- **Contract:** `contract/appearance/appearance_v1.json` routes `colorDanger` by scheme and carries the shared
|
|
74
|
+
`background_derivation` vectors (EFBackend `sdk_palette.background_family` runs the same); the SDK runs them and
|
|
75
|
+
pins the file's SHA-256, so a step change or a contract edit fails CI until both sides are refreshed. Vendored
|
|
76
|
+
from EFBackend main at 3a071a6 (#1764) with `tests/integration/fixtures/branding_wire_v2.json` (`danger_color_dark`
|
|
77
|
+
in `sdk_parsed_keys`, the derived dark danger case) and the platform contract projection (digest b0d50f5).
|
|
78
|
+
|
|
79
|
+
## [0.5.9] - 2026-09-29
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- **A vet's message looks like a vet's message (web and React Native).** `ChatMessage.role` gains `'vet'`
|
|
84
|
+
(`ChatMessageRole`), with `ChatMessage.sender` (`ChatMessageSender`: `displayName`, `specialty`) naming the
|
|
85
|
+
clinician when the wire does. The prebuilt chat draws it as its own filled bubble in the design system's pink
|
|
86
|
+
(`bubbleVet` #FFC3BC under `onBubbleVet` #111111, 12:1, so it clears `SLOT_MIN_CONTRAST` on both palettes), on
|
|
87
|
+
the other party's side as Everfur's own owner/vet thread places it, under the vet's name (or `Your vet`, the
|
|
88
|
+
consumer app's unnamed-clinician words, marked draft copy pending approval). It takes no AI feedback, no copy
|
|
89
|
+
control, no citations and no follow-ups. A new `vetBubble` theme slot repaints it beside `userBubble` and
|
|
90
|
+
`assistantBubble`. The history mapper reads a `role: 'vet'` row with the televet wire's `sender` and
|
|
91
|
+
`sender_display_name`; the widget history route does not send one yet, so until the backend does, nothing
|
|
92
|
+
changes on screen, and every other unknown role is still dropped.
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- **Follow-ups are capped at three, under the latest reply only (web and React Native).** A reply that carried no
|
|
97
|
+
follow-ups of its own fell back to the whole suggested-prompt catalog (up to fourteen strings) and the surfaces
|
|
98
|
+
drew every one, in the empty state as well. The surfaces now draw at most three, de-duplicated by case and
|
|
99
|
+
whitespace, and only when the latest message is a settled assistant reply, as the consumer apps do; the empty
|
|
100
|
+
state shows its starter chips only. `ChatSnapshot.suggestedPrompts` is unchanged for a host that draws its own.
|
|
101
|
+
|
|
13
102
|
## [0.5.8] - 2026-09-29
|
|
14
103
|
|
|
15
104
|
### Fixed
|
|
@@ -2,9 +2,9 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { P as PetRef, C as ConversationId } from './ids-B2GAAifq.cjs';
|
|
4
4
|
import { F as FileHandle } from './ports-BN6RHF9W.cjs';
|
|
5
|
-
import { a as ChatCheckinTarget } from './ports-
|
|
6
|
-
import { W as WidgetPet, P as PetProfileInput } from './petsRepository-
|
|
7
|
-
import { U as UrgencyDisplayLevel, L as LifecyclePort, E as EverfurChatDraftStore } from './attachments-
|
|
5
|
+
import { a as ChatCheckinTarget } from './ports-ChnzSy4E.cjs';
|
|
6
|
+
import { W as WidgetPet, P as PetProfileInput } from './petsRepository-SqIvEMiT.cjs';
|
|
7
|
+
import { U as UrgencyDisplayLevel, L as LifecyclePort, E as EverfurChatDraftStore } from './attachments-rkox0ewd.cjs';
|
|
8
8
|
|
|
9
9
|
/** Where a picked image comes from: the host's photo library, or its camera. */
|
|
10
10
|
type AttachmentSource = 'photo' | 'camera';
|
|
@@ -2,9 +2,9 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { P as PetRef, C as ConversationId } from './ids-B2GAAifq.js';
|
|
4
4
|
import { F as FileHandle } from './ports-BN6RHF9W.js';
|
|
5
|
-
import { a as ChatCheckinTarget } from './ports-
|
|
6
|
-
import { W as WidgetPet, P as PetProfileInput } from './petsRepository-
|
|
7
|
-
import { U as UrgencyDisplayLevel, L as LifecyclePort, E as EverfurChatDraftStore } from './attachments-
|
|
5
|
+
import { a as ChatCheckinTarget } from './ports-iXPWd7Vt.js';
|
|
6
|
+
import { W as WidgetPet, P as PetProfileInput } from './petsRepository-0oBVydl6.js';
|
|
7
|
+
import { U as UrgencyDisplayLevel, L as LifecyclePort, E as EverfurChatDraftStore } from './attachments-CThFsH4b.js';
|
|
8
8
|
|
|
9
9
|
/** Where a picked image comes from: the host's photo library, or its camera. */
|
|
10
10
|
type AttachmentSource = 'photo' | 'camera';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { f as RecordsScreenBaseProps } from './useRecordsDepth-
|
|
2
|
+
import { f as RecordsScreenBaseProps } from './useRecordsDepth-CuNdne6E.js';
|
|
3
3
|
|
|
4
4
|
interface EverfurRecordsDepthProps extends Pick<RecordsScreenBaseProps, 'petRef' | 'petName' | 'onNavigate' | 'onBack'> {
|
|
5
5
|
readonly style?: CSSProperties;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { f as RecordsScreenBaseProps } from './useRecordsDepth-
|
|
3
|
+
import { f as RecordsScreenBaseProps } from './useRecordsDepth-CNEHZJtj.cjs';
|
|
4
4
|
|
|
5
5
|
interface EverfurRecordsDepthProps extends Pick<RecordsScreenBaseProps, 'petRef' | 'petName' | 'onNavigate' | 'onBack'> {
|
|
6
6
|
readonly style?: StyleProp<ViewStyle>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { f as RecordsScreenBaseProps } from './useRecordsDepth-
|
|
2
|
+
import { f as RecordsScreenBaseProps } from './useRecordsDepth-CNEHZJtj.cjs';
|
|
3
3
|
|
|
4
4
|
interface EverfurRecordsDepthProps extends Pick<RecordsScreenBaseProps, 'petRef' | 'petName' | 'onNavigate' | 'onBack'> {
|
|
5
5
|
readonly style?: CSSProperties;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { f as RecordsScreenBaseProps } from './useRecordsDepth-
|
|
3
|
+
import { f as RecordsScreenBaseProps } from './useRecordsDepth-CuNdne6E.js';
|
|
4
4
|
|
|
5
5
|
interface EverfurRecordsDepthProps extends Pick<RecordsScreenBaseProps, 'petRef' | 'petName' | 'onNavigate' | 'onBack'> {
|
|
6
6
|
readonly style?: StyleProp<ViewStyle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var react=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');var Mt=Object.defineProperty;var n=(e,t)=>Mt(e,"name",{value:t,configurable:true});function ie(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))ie(e[t]);}return e}n(ie,"deepFreeze");var Dt=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Be={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ke={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ue={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},jt={regular:"400",medium:"500",bold:"700"},Nt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Lt=0,G="System",Y="monospace",Ut=["content","heading","control","compact","badge"];function Bt(e){let t={};for(let r of Ut)t[r]=e;return t}n(Bt,"authoredTierSizes");function qe(){return {family:G,mono:Y,fontUrl:null,families:{regular:G,medium:G,bold:G,mono:Y,monoMedium:Y,monoBold:Y},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ue,tierSizes:Bt(Ue),lineHeight:zt,weight:jt,letterSpacing:Nt,scale:1,maxScale:Lt,scaleCaps:Dt}}n(qe,"baseType");var Ve={},oe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ae(e){return `cubic-bezier(${e.join(", ")})`}n(ae,"cssCubicBezier");var He={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ae(oe.standard),emphasized:ae(oe.emphasized),exit:ae(oe.exit)},reducedMotion:false},Kt={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},We=ie({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Kt,space:Be,radius:Ke,type:qe(),motion:He,slots:Ve}),qt={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ie({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qt,space:Be,radius:Ke,type:qe(),motion:He,slots:Ve});var Ge=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Ye=globalThis,se=Ye[Ge]??(Ye[Ge]=react.createContext(We));se.displayName??="EverfurThemeContext";function M(){return react.useContext(se)}n(M,"useEverfurTheme");function $t(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}n($t,"tierMultiplier");function $({tier:e="content",...t}){let{type:r}=M(),o=$t(r,e);return react.createElement(reactNative.Text,o===void 0?t:{maxFontSizeMultiplier:o,...t})}n($,"Text");react.forwardRef(n(function(t,r){return react.createElement(reactNative.TextInput,{...t,...r===null?{}:{ref:r}})},"TextInput"));function Q(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}n(Q,"assertNever");function Qe(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(Qe,"errorFrame");var Jt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function Xe(e,t){let r=e.type,o=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:o}:{fontFamily:o,fontWeight:r.weight[Jt[t]]}}n(Xe,"face");var ue=class ue extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(r,o){return Object.is(r.resetKey,o.key)?null:{failed:false,key:r.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};n(ue,"HostRenderBoundary");var le=ue;function er({render:e}){return e()}n(er,"RenderHost");function de({render:e,fallback:t,resetKey:r}){return react.createElement(le,{fallback:t,resetKey:r,children:react.createElement(er,{render:e})})}n(de,"HostRender");var ce=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(ce.map(e=>e.wireCode));var tr=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),et=Object.freeze(ce.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:tr[e.wireCode]}))),rr=new Map(et.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),nr=Object.freeze(["http_envelope",...[...new Set(et.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function X(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...nr]){let a=rr.get(o+r);if(a)return a}}n(X,"contractErrorFor");function or(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(or,"contractDocUrl");function tt(e){return null}n(tt,"publishedDocUrl");var ar=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function rt(e){return ar[e]}n(rt,"categoryFor");function nt(e){let t=X(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(nt,"fromWire");var ir=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function pe(e){return ir.has(e)}n(pe,"isAutoRetryable");var sr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ot(e){return pe(e)||sr.has(e)}n(ot,"isRetryableCode");var lr=500,fe=8e3,at=4;function it(e,t=Math.random){let r=Math.max(0,e),o=Math.min(lr*2**r,fe);return Math.floor(t()*o)}n(it,"backoffDelayMs");var dr=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function U(e){return dr[e]}n(U,"userFacingError");function st(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(st,"defineHidden");var ur=/^[a-z][a-z0-9_]{0,63}$/;function N(e,t){let r=X(t?.wireCode,t?.wireEnvelope),o={code:e,category:rt(e),retryable:t?.retryable??ot(e),displayMessage:U(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&ur.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&st(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&st(o,"raw",t.raw),Object.freeze(o)}n(N,"makeEverfurError");var cr=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function pr(e){return cr[e]}n(pr,"requires");function lt(e,t,r){let o=pr(e),a=new Map;for(let c of t)a.set(c.resource,c);if(r?.isPending===true&&o.some(c=>!a.has(c)))return ye({name:e,enabled:false,isPending:true,limits:{}});let s=fr(o,a);return o.filter(c=>a.get(c)?.granted!==true).length===0?ye({name:e,enabled:true,isPending:false,limits:s}):ye({name:e,enabled:false,isPending:false,limits:s,disabled:yr(o,a)})}n(lt,"decideCapability");function fr(e,t){let r={};for(let o of e){let a=t.get(o)?.limits;if(a)for(let[s,d]of Object.entries(a)){let c=r[s];r[s]=c===void 0?d:Math.min(c,d);}}return r}n(fr,"mergeLimits");function yr(e,t){for(let r of e){let o=t.get(r)?.disabled;if(o)return Object.freeze({reason:o.reason,level:o.level,recoverable:o.recoverable})}return Object.freeze({reason:U("accessDenied"),level:"user_entitlement",recoverable:false})}n(yr,"disabledFor");function ye(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),Object.freeze(t)}n(ye,"freezeDecision");function me(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(me,"ok");function P(e){return Object.freeze({ok:false,error:e})}n(P,"err");var J=class J extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,J.prototype);}};n(J,"EverfurConfigError");var B=J;var dt=Symbol.for("@everfur/sdk#EverfurContext@v1"),ut=globalThis,ct=ut[dt]??(ut[dt]=react.createContext(null));ct.displayName??="EverfurContext";function Z(){let e=react.useContext(ct);if(e===null)throw new B("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(Z,"useEverfurContext");function K(e){let{runtime:t}=Z(),r=t.entitlements,o=react.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);return react.useMemo(()=>lt(e,o.decisions,{isPending:o.isPending}),[e,o])}n(K,"useCapability");var Er=48;function hr(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}n(hr,"selectView");function mt(e){let{capability:t,children:r,renderDisabled:o,renderPending:a,style:s}=e,d=K(t),c=react.useMemo(()=>hr(d),[d]);switch(c){case "enabled":return r;case "pending":return a?jsxRuntime.jsx(de,{render:a,fallback:jsxRuntime.jsx(ft,{capability:t,style:s})}):jsxRuntime.jsx(ft,{capability:t,style:s});case "disabled":return o?jsxRuntime.jsx(de,{render:()=>o(d),fallback:jsxRuntime.jsx(yt,{decision:d,style:s}),resetKey:d}):jsxRuntime.jsx(yt,{decision:d,style:s});default:return Q(c)}}n(mt,"CapabilityGate");function ft({capability:e,style:t}){let r=M(),o=react.useMemo(()=>bt(r),[r]);return jsxRuntime.jsx(reactNative.View,{style:[o.offstate,t],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:o.skeletonBar})})}n(ft,"PendingSkeleton");function yt({decision:e,style:t}){let r=M(),o=react.useMemo(()=>bt(r),[r]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[o.offstate,t],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx($,{style:o.offstateText,children:a}):null})}n(yt,"OffState");function bt(e){let{color:t,space:r,radius:o,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:Er,justifyContent:"center",paddingHorizontal:r.lg,paddingVertical:r.md,backgroundColor:t.surfaceCream,borderRadius:o.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brandBorder},offstateText:{...Xe(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:t.text.muted},skeletonBar:{height:r.md,borderRadius:o.xs,backgroundColor:t.brandSofter}})}n(bt,"makeStyles");function _r(){let e=new Uint8Array(16),t=globalThis.crypto;if(typeof t?.getRandomValues=="function")t.getRandomValues(e);else for(let o=0;o<e.length;o+=1)e[o]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=[];for(let o=0;o<e.length;o+=1)r.push(e[o].toString(16).padStart(2,"0"));return r.slice(0,4).join("")+"-"+r.slice(4,6).join("")+"-"+r.slice(6,8).join("")+"-"+r.slice(8,10).join("")+"-"+r.slice(10,16).join("")}n(_r,"newSessionId");function Sr(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}n(Sr,"authHeaders");function q(e,t){return {...e,headers:{...Rr(e.headers),...Sr(t)}}}n(q,"withAuthHeaders");function Rr(e){if(!e)return {};let t={};for(let[r,o]of Object.entries(e)){let a=r.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(t[r]=o);}return t}n(Rr,"stripAuthHeaders");async function vt(e,t){if(t.mode==="anonymous")return t.transport.request(q(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return P(ge())}let o=await t.transport.request(q(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await t.identity.currentToken({forceRefresh:!0});}catch{return P(ge())}let s=await t.transport.request(q(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?P(ge(s.error.httpStatus)):s}n(vt,"authedSend");function ge(e){return N("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(ge,"authRejectedError");function gt(e){return N("internalError",{retryable:true,wireMessage:Tr(e)})}n(gt,"networkError");function Tr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Tr,"describeCause");var Cr=3e4,wr=fe*2,kr="idempotency-key",xr=new Set(["POST","PUT","PATCH","DELETE"]),Fr=Object.freeze({onEvent(){}}),Pr=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Or(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}n(Or,"seededIdempotencyKey");function ht(e){let t=e.observer??Fr,r=e.timers??Pr,o=e.rng??Math.random,a=e.sleep??((y,p)=>Hr(y,r,p)),s=e.maxAttempts??at,d=e.unaryTimeoutMs??Cr,c=e.newIdempotencyKey??Ir(),m=n(y=>{try{t.onEvent(y);}catch{}},"emit");async function f(y,p,_){let S=_?.maxAttempts,F=Math.max(1,S??s),I=_?.idempotent??xr.has(p.method),E=_?.idempotencyKey===void 0?null:Or(_.idempotencyKey),C=I?E??c():null,z=Ar(p,C),l=0;for(;;){let v=n(T=>Object.freeze({call:y,method:p.method,path:p.path,attempt:l,...C?{idempotencyKey:C}:{},...T}),"stamp");m(v({phase:"attempt"}));let O=qr(d,r),j=Vr(O.signal,p.signal),i;try{i=await vt({...z,signal:j.signal},e.auth);}catch(T){i=P(gt(T));}finally{j.dispose(),O.cancel();}if(i.ok)return m(v({phase:"settled",ok:true,reason:"ok"})),i;let u=i.error,g=Dr(u,l,{maxAttempts:F,rng:o,now:r.now(),aborted:p.signal?.aborted===true,...S!==void 0?{perCallMaxAttempts:S}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),R={ok:false,code:u.code,reason:g.reason,...u.httpStatus!==void 0?{httpStatus:u.httpStatus}:{},...u.requestId!==void 0?{requestId:u.requestId}:{}};if(!g.retry)return m(v({phase:"settled",...R})),P(u);if(m(v({phase:"retry",...R,delayMs:g.delayMs})),await a(g.delayMs,p.signal),p.signal?.aborted===true)return m(v({phase:"settled",...R,reason:"aborted"})),P(u);l+=1;}}n(f,"send");async function b(y){return q(y,await Kr(e.auth))}n(b,"authorize");async function*h(y,p,_){m(Object.freeze({call:y,phase:"stream.open",method:p.method,path:p.path,attempt:0}));try{yield*e.auth.transport.stream(p,_);}catch{yield Qe({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(h,"stream"),Object.freeze({send:f,authorize:b,stream:h})}n(ht,"createRequestFunnel");function Ar(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==kr&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Ar,"assembleHeaders");function Ir(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Ir,"defaultIdempotencyKeyFactory");var Mr=10;function Dr(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=zr(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!pe(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let d=n(()=>{if(r.policy===void 0)return null;let f;try{f=r.policy.maxAttempts(e.code);}catch{return null}return typeof f!="number"||!Number.isFinite(f)?null:Math.max(1,Math.min(Mr,Math.floor(f)))},"policyCeiling"),c=r.perCallMaxAttempts??d()??r.maxAttempts;if(t+1>=c)return {retry:false,reason:"attempts-exhausted"};let m=jr(e,r.now);return m!==null?m>wr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:m}:{retry:true,reason:a,delayMs:it(t,r.rng)}}n(Dr,"decideRetry");function zr(e){let t=e.code==="unknown"?nt(Br(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(zr,"throttleKind");function jr(e,t){let r=Lr(e.raw);if(r!==null){let a=r-t;return a>0?a:0}let o=Nr(e.raw);return o===null?null:Math.round(o*1e3)}n(jr,"retryOverrideMs");function Nr(e){for(let t of Ee(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}n(Nr,"findRetryAfterSeconds");function Lr(e){for(let t of Ee(e)){let r=t.resets_at,o=Ur(r);if(o!==null)return o}return null}n(Lr,"findResetsAt");function Ee(e){if(!Et(e))return [];let t=[e];for(let r of ["error","detail"]){let o=e[r];Et(o)&&t.push(o);}return t}n(Ee,"candidateScopes");function Ur(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}n(Ur,"parseInstantMs");function Br(e){for(let t of Ee(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(Br,"rawWireCode");function Et(e){return typeof e=="object"&&e!==null}n(Et,"isRecord");async function Kr(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}n(Kr,"resolveDeviceAuth");function qr(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(qr,"boundedSignal");function Vr(e,t){let r=n(()=>{},"noop");if(!t)return {signal:e,dispose:r};let o=new AbortController;if(e.aborted||t.aborted)return o.abort(),{signal:o.signal,dispose:r};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a);},"dispose")}}n(Vr,"mergeSignals");function Hr(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(o=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",s),o();},e),s=n(()=>{t.clearTimeout(a),o();},"onAbort");r?.addEventListener("abort",s,{once:true});})}n(Hr,"delayAbortable");function _t(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let o=e.charCodeAt(t+1);if(!(o>=56320&&o<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}n(_t,"hasLoneSurrogate");function he(e){let t={url:e.url,kind:e.kind,expiresAt:e.expires_at};return typeof e.loop_duration_ms=="number"&&(t.loopDurationMs=e.loop_duration_ms),typeof e.cache_key=="string"&&e.cache_key.length>0&&(t.cacheKey=e.cache_key),Object.freeze(t)}n(he,"mapTier");function _e(e){let t={};e.tiers.animation&&(t.animation=he(e.tiers.animation)),e.tiers.image&&(t.image=he(e.tiers.image));let r={};e.overlays.weather_alert&&(r.weatherAlert=he(e.overlays.weather_alert));let o={category:e.category,tiers:Object.freeze(t),overlays:Object.freeze(r),idle:"bundled",ttlSeconds:e.ttl_seconds,degraded:e.degraded};return typeof e.cache_epoch=="number"&&(o.cacheEpoch=e.cache_epoch),Object.freeze(o)}n(_e,"mapPetStateResponse");var Wr=zod.z.enum(["webp","video"]),Gr=zod.z.enum(["health","attention","moment","activity","mood","idle"]),Se=zod.z.object({url:zod.z.string(),kind:Wr.default("webp"),loop_duration_ms:zod.z.number().nullish(),expires_at:zod.z.string(),cache_key:zod.z.string().nullish()}),St=zod.z.object({category:Gr,tiers:zod.z.object({animation:Se.optional(),image:Se.optional()}).default({}),overlays:zod.z.object({weather_alert:Se.optional()}).default({}),idle:zod.z.literal("bundled").default("bundled"),ttl_seconds:zod.z.number(),degraded:zod.z.boolean().default(false),cache_epoch:zod.z.number().default(0)});function Re(e){let t=St.safeParse(e);return t.success?t.data:null}n(Re,"parsePetStateWire");function Te(e){return Yr(ht({auth:e}))}n(Te,"createPetStateRepository");function Yr(e){return {async getState(t,r){if(_t(t))return P(N("validationFailed",{retryable:false,wireMessage:"pet_ref contains an unpaired surrogate and cannot be encoded"}));let o=`/widget/v1/pets/${encodeURIComponent(t)}/state`,a=await e.send("animations.getState",r?.signal?{method:"GET",path:o,signal:r.signal}:{method:"GET",path:o});if(a.ok){let s=Re(a.value);return s===null?P(N("internalError",{retryable:true})):me(_e(s))}return a.error.httpStatus===404?me(null):P(a.error)}}}n(Yr,"createPetStateRepositoryOver");function Ce(e){if(e===void 0)return "bundled:none";if(typeof e=="number")return `bundled:${e}`;if("kind"in e)return `bundled:${e.id}`;let t=e.uri,r=t.indexOf("?");return r===-1?t:t.slice(0,r)}n(Ce,"stableMediaKey");function we(e){return e.hasPhoto&&!e.photoFailed?"photo":e.canAnimate&&!e.animationFailed?"animation":e.hasImage&&!e.imageFailed?"image":"idle"}n(we,"selectTier");function ke(e,t){switch(e){case "photo":return {failed:V({...t,photo:true}),reason:"network_error"};case "animation":return {failed:V({...t,animation:true}),reason:"network_error"};case "image":return {failed:V({...t,image:true}),reason:"network_error"};case "idle":return {failed:V(t),reason:"idle_asset_failed"};default:return {failed:V(t),reason:"network_error"}}}n(ke,"retireTier");var H=Object.freeze({photo:false,animation:false,image:false});function V(e){return Object.freeze({photo:e.photo,animation:e.animation,image:e.image})}n(V,"freezeFailed");function $r(e){switch(e){case "activity":case "mood":case "moment":case "idle":return true;case "health":case "attention":return false;default:return false}}n($r,"isLoaderSafeCategory");var xe="everfur.petState.cacheEpoch";function Fe(e){let t=0,r=false,o=null,a=n(async s=>{if(r||(t=await Qr(e.kv),r=true),s<=t)return false;try{await e.kv.setItem(xe,String(s));}catch{}t=s;try{await e.cache.clearMemoryCache();}catch{}try{await e.cache.clearDiskCache();}catch{}return true},"run");return {async sync(s){return typeof s!="number"||!Number.isFinite(s)||s<=0||r&&s<=t?false:o||(o=a(s).finally(()=>{o=null;}),o)}}}n(Fe,"createCacheEpochGuard");async function Qr(e){let t;try{t=await e.getItem(xe);}catch{return 0}if(t===null)return 0;let r=Number(t);return Number.isFinite(r)&&r>0?r:0}n(Qr,"readStoredEpoch");var Pe=1,Oe="everfur.manifest.lastKnownGood",L=Object.freeze({kind:"bundled",id:"everfur-idle"}),W=Object.freeze({schemaVersion:Pe,revision:"compiled-default",surfaces:Object.freeze({animations:Object.freeze({enabled:true,idle:L})})}),Xr=zod.z.object({kind:zod.z.literal("bundled"),id:zod.z.string().min(1)}),Jr=zod.z.object({enabled:zod.z.boolean().default(true),idle:Xr.optional()}),Zr=zod.z.object({schema_version:zod.z.number().int(),revision:zod.z.string().default(""),surfaces:zod.z.object({animations:Jr.optional()}).default({})});function Ae(e){let t=Zr.safeParse(e);if(!t.success)return {ok:false,reason:"unparseable"};if(t.data.schema_version>Pe)return {ok:false,reason:"newer_schema"};let r=t.data.surfaces.animations,o={};return r&&(o.animations=Object.freeze({enabled:r.enabled,idle:r.idle?Object.freeze({...r.idle}):L})),{ok:true,manifest:Object.freeze({schemaVersion:t.data.schema_version,revision:t.data.revision,surfaces:Object.freeze(o)})}}n(Ae,"parseManifest");async function en(e,t,r){if(e!=null){let a=Ae(e);if(a.ok)return await tn(t,e),r.track("manifest.fallback",{source:"live"}),Object.freeze({manifest:a.manifest,source:"live"});a.reason==="newer_schema"&&r.track("manifest.refused_newer",{});}let o=await rn(t);return o?(r.track("manifest.fallback",{source:"last-known-good"}),Object.freeze({manifest:o,source:"last-known-good"})):(r.track("manifest.fallback",{source:"compiled-default"}),Object.freeze({manifest:W,source:"compiled-default"}))}n(en,"resolveManifest");function Ie(e){return e.surfaces.animations??W.surfaces.animations??{enabled:true,idle:L}}n(Ie,"animationsSurfaceOf");async function tn(e,t){try{await e.setItem(Oe,JSON.stringify(t));}catch{}}n(tn,"writeLastKnownGood");async function rn(e){let t;try{t=await e.getItem(Oe);}catch{return null}if(t===null)return null;let r;try{r=JSON.parse(t);}catch{return null}let o=Ae(r);return o.ok?o.manifest:null}n(rn,"readLastKnownGood");var Rt=Object.freeze({data:null,isPending:false,isError:false,error:null,isDark:false});function Me(e){let{repo:t,cacheEpoch:r,timers:o}=e,a=new Set,s=new Map,d=Rt,c=null,m=null,f=false,b=null,h=null,y=null,p=0,_=n(()=>{for(let i of a)i();},"emit"),S=n(i=>{d=Object.freeze({...d,...i}),_();},"patch"),F=n(()=>{h!==null&&(o.clearTimeout(h),h=null);},"clearRemint"),I=n(i=>i?Math.max(1,i.ttlSeconds)*1e3:6e4,"staleMs"),E=n(i=>{let u=s.get(i);u!==void 0&&(s.delete(i),s.set(i,u));},"touchWarm"),C=n((i,u)=>{for(s.delete(i),s.set(i,Object.freeze({data:u,fetchedAt:o.now()}));s.size>32;){let g=s.keys().next().value;if(g===void 0||g===i)break;s.delete(g);}},"setWarm"),z=n(i=>{let u=s.get(i);return u?!!(u.data.tiers.animation||u.data.tiers.image):false},"hasGoodTiers"),l=n((i,u)=>{if(F(),!f)return;let g=Math.max(1,u)*1e3,R=p;h=o.setTimeout(()=>{h=null,!(R!==p||c!==i||!f)&&v(i,0);},g);},"scheduleRemint"),v=n(async(i,u)=>{if(c!==i||b===i||!f)return;let g=p;y?.abort();let R=new AbortController;y=R;let T=await t.getState(i,{signal:R.signal});if(!(g!==p||c!==i)){if(T.ok){let w=T.value;if(w===null){O(i);return}r.sync(w.cacheEpoch);let ne=!!(w.tiers.animation||w.tiers.image);if(w.degraded&&!ne&&z(i)){S({isError:false,error:null,isPending:false,isDark:false}),l(i,w.ttlSeconds);return}C(i,w),m=i,S({data:w,isPending:false,isError:false,error:null,isDark:false}),l(i,w.ttlSeconds);return}if(Tt(T.error)){j(i,T.error);return}if(S({isError:true,error:T.error,isPending:d.data===null&&m!==i}),u<2){F();let w=500*(u+1),ne=p;h=o.setTimeout(()=>{h=null,!(ne!==p||c!==i||!f)&&v(i,u+1);},w);}else l(i,5);}},"fetchOnce"),O=n(i=>{b=i,s.delete(i),F(),m=i,S({data:null,isPending:false,isError:false,error:null,isDark:true});},"onTerminalDark"),j=n((i,u)=>{b=i,s.delete(i),F(),m=i,S({data:null,isPending:false,isError:false,error:u,isDark:true});},"onTerminalDisabled");return {observe(i,u){let g=u.isFocused!==f;if(f=u.isFocused,i!==c){if(p+=1,y?.abort(),y=null,F(),b=null,c=i,i===null){m=null,d=Rt,_();return}let T=s.get(i),w=T&&o.now()-T.fetchedAt<I(T.data)?T:null;w?(E(i),m=i,S({data:w.data,isPending:false,isError:false,error:null,isDark:false})):S({isPending:true,isError:false,error:null,isDark:false}),f&&v(i,0);return}if(!g||i===null)return;if(!f){F();return}let R=s.get(i);!R||o.now()-R.fetchedAt>=I(R.data)?b!==i&&v(i,0):l(i,R.data.ttlSeconds);},getSnapshot(){return d},subscribe(i){return a.add(i),()=>{a.delete(i);}},getCachedPetStateMedia(i){let u=s.get(i);return !u||o.now()-u.fetchedAt>=I(u.data)?null:(E(i),u.data)},dispose(){p+=1,y?.abort(),y=null,F(),a.clear(),s.clear();}}}n(Me,"createPetStateStore");function Tt(e){if(typeof e!="object"||e===null)return false;let t=e,r=typeof t.status=="number"?t.status:t.httpStatus;return r===403||r===404}n(Tt,"isTerminalPetStateError");var Ct=Object.freeze({track(){},trackExpectedFailure(){}});function ee(e){let t=e.telemetry??Ct,r=e.timers??an(e.now),o=Me({repo:e.repo,cacheEpoch:Fe({kv:e.kv,cache:e.cache}),timers:r}),a=new Set,s=H,d="none",c=false,m=null,f=null,b=false,h=0,y="",p=on(S()),_=false;function S(){let l=e.manifest?e.manifest():W;return Ie(l)}n(S,"surface");let F=n(()=>{for(let l of a)l();},"emit"),I=o.subscribe(()=>{E();});function E(){let l=o.getSnapshot();(l.data!==f||l.isDark!==b)&&(f=l.data,b=l.isDark,s=H,d=l.isDark?"dark_or_missing":"none",h+=1),C(l);}n(E,"onStoreChange");function C(l=o.getSnapshot()){let v=S(),O=nn(v,l,{failed:s,fallbackReason:d,paused:c,photoUrl:m,reducedMotion:e.reducedMotion()});p=O,z(O),F();}n(C,"recompute");function z(l){if(l.kind!=="ready")return;let v=`${l.category}|${l.tier}|${l.fallbackReason}|${l.reducedMotion?1:0}`;v!==y&&(y=v,t.track("pet_state_shown",{category:l.category,tier:l.tier,fallback_reason:l.fallbackReason,reduced_motion:l.reducedMotion}),l.fallbackReason==="idle_asset_failed"&&t.trackExpectedFailure("idle_asset_failed",{category:l.category}));}return n(z,"maybeEmitShown"),{observe(l,v){_||(m=v.photoUrl??null,s=H,o.observe(l,{isFocused:v.isFocused}),E());},getState(){return p},subscribe(l){return a.add(l),()=>{a.delete(l);}},onMediaError(){if(_||p.kind!=="ready")return;let l=ke(p.tier,s);s=l.failed,d=l.reason,C();},setPaused(l){_||c===l||(c=l,C());},dispose(){_||(_=true,I(),o.dispose(),a.clear());}}}n(ee,"createAnimationController");function nn(e,t,r){let o=e.idle;if(!e.enabled)return Object.freeze({kind:"disabled",reason:U("accessDenied"),level:"partner_config",source:o,idle:e.idle});if(t.isPending&&t.data===null&&!t.isDark)return Object.freeze({kind:"pending",showSkeleton:true,source:o});let a=t.data,s=a?.category??"idle",d=a?.tiers.animation,c=a?.tiers.image,m=!!d&&d?.kind==="webp"&&!r.reducedMotion&&!r.failed.animation,f=we({hasPhoto:r.photoUrl!==null&&r.photoUrl.length>0,photoFailed:r.failed.photo,canAnimate:m,animationFailed:r.failed.animation,hasImage:!!c,imageFailed:r.failed.image}),b=o,h=null,y=false;f==="photo"&&r.photoUrl?b=De(r.photoUrl,void 0):f==="animation"&&d?(b=De(d.url,d.cacheKey),h=d.loopDurationMs??null,y=d.cacheKey!==void 0):f==="image"&&c&&(b=De(c.url,c.cacheKey),y=c.cacheKey!==void 0);let p=b.kind==="uri"?b.cacheKey:`bundled:${b.id}`;return Object.freeze({kind:"ready",tier:f,source:b,recyclingKey:p,category:s,loopDurationMs:h,paused:r.paused,reducedMotion:r.reducedMotion,cacheHit:y,fallbackReason:r.fallbackReason,isDark:t.isDark,isTransientError:t.isError})}n(nn,"buildView");function De(e,t){return Object.freeze({kind:"uri",uri:e,cacheKey:t??Ce({uri:e})})}n(De,"uriSource");function on(e){return Object.freeze({kind:"pending",showSkeleton:true,source:e.idle})}n(on,"pendingView");function an(e){return {setTimeout:n((t,r)=>setTimeout(t,r),"setTimeout"),clearTimeout:n(t=>clearTimeout(t),"clearTimeout"),now:e}}n(an,"defaultTimers");var un=Object.freeze({kind:"pending",showSkeleton:true,source:L}),cn=n(()=>{},"NOOP_UNSUBSCRIBE");function je(e){let{petRef:t,repo:r,cache:o,kv:a,isFocused:s=true,photoUrl:d=null,telemetry:c,reducedMotion:m,manifest:f,timers:b,now:h}=e,{runtime:y,userRef:p}=Z(),_=K("animations"),S=pn(m),I=r!==void 0&&o!==void 0&&a!==void 0?"override":`${p??""}|${t??""}`,[E,C]=react.useState(null);react.useEffect(()=>{if(r!==void 0&&o!==void 0&&a!==void 0){let g={repo:r,cache:o,kv:a,reducedMotion:S,now:h??kt,...c?{telemetry:c}:{},...f?{manifest:f}:{},...b?{timers:b}:{}},R=ee(g);return C(R),()=>{C(T=>T===R?null:T),R.dispose();}}let{services:i}=y.registry,u=y.registry.acquire("animations",`${p??""}|${t??""}`,()=>ee({repo:Te(i.authFor(p)),cache:i.imageCache,kv:i.kv,reducedMotion:S,now:h??kt,telemetry:i.telemetry,...f?{manifest:f}:{},...b?{timers:b}:{}}),g=>g.dispose());return C(u),()=>{C(g=>g===u?null:g),y.registry.release(u);}},[I,r,o,a,y]),react.useEffect(()=>{E?.observe(t,{isFocused:s,photoUrl:d});},[E,t,s,d]);let z=react.useCallback(i=>E?E.subscribe(i):cn,[E]),l=react.useCallback(()=>E?E.getState():un,[E]),v=react.useSyncExternalStore(z,l,l),O=react.useCallback(()=>{E?.onMediaError();},[E]),j=react.useCallback(i=>{E?.setPaused(i);},[E]);return react.useMemo(()=>({capability:_,state:v,onMediaError:O,setPaused:j}),[_,v,O,j])}n(je,"useAnimations");function pn(e){let t=react.useRef(true);return react.useEffect(()=>{if(e)return;let r=true,o=reactNative.AccessibilityInfo.isReduceMotionEnabled?.();o&&typeof o.then=="function"&&o.then(s=>{r&&(t.current=s);});let a=reactNative.AccessibilityInfo.addEventListener?.("reduceMotionChanged",s=>{t.current=s;});return ()=>{r=false,a?.remove?.();}},[e]),react.useMemo(()=>e??(()=>t.current),[e])}n(pn,"useSystemReducedMotion");function kt(){return Date.now()}n(kt,"defaultNow");var gn=200,En=300,Ne=120;function hn(e){let{style:t,accessibilityLabel:r}=e,o={accessibilityLabel:r,decorative:At(e)};return jsxRuntime.jsx(mt,{capability:"animations",style:t,renderPending:()=>jsxRuntime.jsx(re,{style:t,a11y:o,busy:true}),renderDisabled:a=>jsxRuntime.jsx(re,{style:t,a11y:o,reason:a.disabled?.reason??""}),children:jsxRuntime.jsx(_n,{...e})})}n(hn,"PetStateView");function At(e){return e.decorative===true||e.accessibilityLabel===void 0}n(At,"isDecorative");function _n(e){let t=Le(),r={accessibilityLabel:e.accessibilityLabel,decorative:At(e)},o=je(Tn(e));return jsxRuntime.jsx(reactNative.View,{style:[t.container,e.style],children:Sn(o.state,o.onMediaError,r)})}n(_n,"PetStateBody");function Sn(e,t,r){switch(e.kind){case "pending":return jsxRuntime.jsx(Pt,{source:e.source,recyclingKey:"pending",reducedMotion:true,a11y:r,busy:true,onMediaError:t});case "disabled":return jsxRuntime.jsx(re,{a11y:r,reason:e.reason});case "ready":return jsxRuntime.jsx(Pt,{source:e.source,recyclingKey:e.recyclingKey,reducedMotion:e.reducedMotion,a11y:r,onMediaError:t});default:return Q(e)}}n(Sn,"renderState");function Pt({source:e,recyclingKey:t,reducedMotion:r,a11y:o,busy:a,onMediaError:s}){let d=Le();return e.kind==="uri"?jsxRuntime.jsx(reactNative.Image,{source:{uri:e.uri},onError:s,fadeDuration:r?0:gn,style:d.media,...It(o)},t):jsxRuntime.jsx(re,{a11y:o,busy:a})}n(Pt,"MediaNode");function re({style:e,a11y:t,busy:r,reason:o}){let a=Le();return jsxRuntime.jsxs(reactNative.View,{style:[a.idlePlaceholder,e],...It(t),children:[r?jsxRuntime.jsx(Rn,{}):null,o&&o.length>0?jsxRuntime.jsx($,{style:a.reasonText,children:o}):null]})}n(re,"IdleRegion");function Rn(){let e=M(),[t,r]=react.useState(false);return react.useEffect(()=>{let o=setTimeout(()=>r(true),En);return ()=>clearTimeout(o)},[]),t?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:e.color.brand}):null}n(Rn,"DelayedSpinner");function It(e){if(e.decorative)return {accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};let t=e.accessibilityLabel;return t!==void 0?{accessible:true,accessibilityRole:"image",accessibilityLabel:t}:{accessible:true,accessibilityRole:"image"}}n(It,"a11yProps");function Tn(e){let t={petRef:e.petRef,repo:e.repo,cache:e.cache,kv:e.kv};return e.isFocused!==void 0&&(t.isFocused=e.isFocused),e.photoUrl!==void 0&&(t.photoUrl=e.photoUrl),e.telemetry!==void 0&&(t.telemetry=e.telemetry),e.reducedMotion!==void 0&&(t.reducedMotion=e.reducedMotion),e.manifest!==void 0&&(t.manifest=e.manifest),e.timers!==void 0&&(t.timers=e.timers),e.now!==void 0&&(t.now=e.now),t}n(Tn,"buildParams");function Le(){let e=M();return react.useMemo(()=>Cn(e),[e])}n(Le,"useStyles");function Cn(e){return reactNative.StyleSheet.create({container:{minHeight:Ne,width:"100%",backgroundColor:e.color.surfaceCream,borderRadius:e.radius.lg,overflow:"hidden"},media:{minHeight:Ne,width:"100%"},idlePlaceholder:{minHeight:Ne,width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:e.color.surfaceCream,borderRadius:e.radius.lg,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:e.color.borderRingCream,padding:e.space.lg},reasonText:{marginTop:e.space.sm,fontFamily:e.type.family,fontSize:e.type.size.bodyTight,lineHeight:Math.round(e.type.size.bodyTight*e.type.lineHeight.normal),fontWeight:e.type.weight.medium,color:e.color.text.muted,textAlign:"center"}})}n(Cn,"makeStyles");exports.CACHE_EPOCH_STORAGE_KEY=xe;exports.COMPILED_DEFAULT_IDLE=L;exports.COMPILED_DEFAULT_MANIFEST=W;exports.MANIFEST_LKG_STORAGE_KEY=Oe;exports.NO_FAILURES=H;exports.PetStateView=hn;exports.SUPPORTED_SCHEMA_VERSION=Pe;exports.animationsSurfaceOf=Ie;exports.createAnimationController=ee;exports.createCacheEpochGuard=Fe;exports.createPetStateRepository=Te;exports.createPetStateStore=Me;exports.isLoaderSafeCategory=$r;exports.isTerminalPetStateError=Tt;exports.mapPetStateResponse=_e;exports.newSessionId=_r;exports.parseManifest=Ae;exports.parsePetStateWire=Re;exports.petStateResponseWireSchema=St;exports.resolveManifest=en;exports.retireTier=ke;exports.selectTier=we;exports.stableMediaKey=Ce;exports.useAnimations=je;
|
|
1
|
+
'use strict';var react=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');var Mt=Object.defineProperty;var n=(e,t)=>Mt(e,"name",{value:t,configurable:true});function ie(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))ie(e[t]);}return e}n(ie,"deepFreeze");var Dt=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Be={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ke={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ue={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},jt={regular:"400",medium:"500",bold:"700"},Nt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Lt=0,G="System",Y="monospace",Ut=["content","heading","control","compact","badge"];function Bt(e){let t={};for(let r of Ut)t[r]=e;return t}n(Bt,"authoredTierSizes");function qe(){return {family:G,mono:Y,fontUrl:null,families:{regular:G,medium:G,bold:G,mono:Y,monoMedium:Y,monoBold:Y},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ue,tierSizes:Bt(Ue),lineHeight:zt,weight:jt,letterSpacing:Nt,scale:1,maxScale:Lt,scaleCaps:Dt}}n(qe,"baseType");var Ve={},oe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ae(e){return `cubic-bezier(${e.join(", ")})`}n(ae,"cssCubicBezier");var He={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ae(oe.standard),emphasized:ae(oe.emphasized),exit:ae(oe.exit)},reducedMotion:false},Kt={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",onDanger:"#FFFFFF",errorRed:"#CC1600",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#111111",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},We=ie({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Kt,space:Be,radius:Ke,type:qe(),motion:He,slots:Ve}),qt={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#111111",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ie({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qt,space:Be,radius:Ke,type:qe(),motion:He,slots:Ve});var Ge=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Ye=globalThis,se=Ye[Ge]??(Ye[Ge]=react.createContext(We));se.displayName??="EverfurThemeContext";function M(){return react.useContext(se)}n(M,"useEverfurTheme");function $t(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}n($t,"tierMultiplier");function $({tier:e="content",...t}){let{type:r}=M(),o=$t(r,e);return react.createElement(reactNative.Text,o===void 0?t:{maxFontSizeMultiplier:o,...t})}n($,"Text");react.forwardRef(n(function(t,r){return react.createElement(reactNative.TextInput,{...t,...r===null?{}:{ref:r}})},"TextInput"));function Q(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}n(Q,"assertNever");function Qe(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(Qe,"errorFrame");var Jt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function Xe(e,t){let r=e.type,o=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:o}:{fontFamily:o,fontWeight:r.weight[Jt[t]]}}n(Xe,"face");var ue=class ue extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(r,o){return Object.is(r.resetKey,o.key)?null:{failed:false,key:r.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};n(ue,"HostRenderBoundary");var le=ue;function er({render:e}){return e()}n(er,"RenderHost");function de({render:e,fallback:t,resetKey:r}){return react.createElement(le,{fallback:t,resetKey:r,children:react.createElement(er,{render:e})})}n(de,"HostRender");var ce=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(ce.map(e=>e.wireCode));var tr=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),et=Object.freeze(ce.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:tr[e.wireCode]}))),rr=new Map(et.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),nr=Object.freeze(["http_envelope",...[...new Set(et.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function X(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...nr]){let a=rr.get(o+r);if(a)return a}}n(X,"contractErrorFor");function or(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(or,"contractDocUrl");function tt(e){return null}n(tt,"publishedDocUrl");var ar=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function rt(e){return ar[e]}n(rt,"categoryFor");function nt(e){let t=X(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(nt,"fromWire");var ir=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function pe(e){return ir.has(e)}n(pe,"isAutoRetryable");var sr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ot(e){return pe(e)||sr.has(e)}n(ot,"isRetryableCode");var lr=500,fe=8e3,at=4;function it(e,t=Math.random){let r=Math.max(0,e),o=Math.min(lr*2**r,fe);return Math.floor(t()*o)}n(it,"backoffDelayMs");var dr=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function U(e){return dr[e]}n(U,"userFacingError");function st(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(st,"defineHidden");var ur=/^[a-z][a-z0-9_]{0,63}$/;function N(e,t){let r=X(t?.wireCode,t?.wireEnvelope),o={code:e,category:rt(e),retryable:t?.retryable??ot(e),displayMessage:U(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&ur.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&st(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&st(o,"raw",t.raw),Object.freeze(o)}n(N,"makeEverfurError");var cr=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function pr(e){return cr[e]}n(pr,"requires");function lt(e,t,r){let o=pr(e),a=new Map;for(let c of t)a.set(c.resource,c);if(r?.isPending===true&&o.some(c=>!a.has(c)))return ye({name:e,enabled:false,isPending:true,limits:{}});let s=fr(o,a);return o.filter(c=>a.get(c)?.granted!==true).length===0?ye({name:e,enabled:true,isPending:false,limits:s}):ye({name:e,enabled:false,isPending:false,limits:s,disabled:yr(o,a)})}n(lt,"decideCapability");function fr(e,t){let r={};for(let o of e){let a=t.get(o)?.limits;if(a)for(let[s,d]of Object.entries(a)){let c=r[s];r[s]=c===void 0?d:Math.min(c,d);}}return r}n(fr,"mergeLimits");function yr(e,t){for(let r of e){let o=t.get(r)?.disabled;if(o)return Object.freeze({reason:o.reason,level:o.level,recoverable:o.recoverable})}return Object.freeze({reason:U("accessDenied"),level:"user_entitlement",recoverable:false})}n(yr,"disabledFor");function ye(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),Object.freeze(t)}n(ye,"freezeDecision");function me(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(me,"ok");function P(e){return Object.freeze({ok:false,error:e})}n(P,"err");var J=class J extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,J.prototype);}};n(J,"EverfurConfigError");var B=J;var dt=Symbol.for("@everfur/sdk#EverfurContext@v1"),ut=globalThis,ct=ut[dt]??(ut[dt]=react.createContext(null));ct.displayName??="EverfurContext";function Z(){let e=react.useContext(ct);if(e===null)throw new B("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(Z,"useEverfurContext");function K(e){let{runtime:t}=Z(),r=t.entitlements,o=react.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);return react.useMemo(()=>lt(e,o.decisions,{isPending:o.isPending}),[e,o])}n(K,"useCapability");var Er=48;function hr(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}n(hr,"selectView");function mt(e){let{capability:t,children:r,renderDisabled:o,renderPending:a,style:s}=e,d=K(t),c=react.useMemo(()=>hr(d),[d]);switch(c){case "enabled":return r;case "pending":return a?jsxRuntime.jsx(de,{render:a,fallback:jsxRuntime.jsx(ft,{capability:t,style:s})}):jsxRuntime.jsx(ft,{capability:t,style:s});case "disabled":return o?jsxRuntime.jsx(de,{render:()=>o(d),fallback:jsxRuntime.jsx(yt,{decision:d,style:s}),resetKey:d}):jsxRuntime.jsx(yt,{decision:d,style:s});default:return Q(c)}}n(mt,"CapabilityGate");function ft({capability:e,style:t}){let r=M(),o=react.useMemo(()=>bt(r),[r]);return jsxRuntime.jsx(reactNative.View,{style:[o.offstate,t],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:o.skeletonBar})})}n(ft,"PendingSkeleton");function yt({decision:e,style:t}){let r=M(),o=react.useMemo(()=>bt(r),[r]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[o.offstate,t],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx($,{style:o.offstateText,children:a}):null})}n(yt,"OffState");function bt(e){let{color:t,space:r,radius:o,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:Er,justifyContent:"center",paddingHorizontal:r.lg,paddingVertical:r.md,backgroundColor:t.surfaceCream,borderRadius:o.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brandBorder},offstateText:{...Xe(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:t.text.muted},skeletonBar:{height:r.md,borderRadius:o.xs,backgroundColor:t.brandSofter}})}n(bt,"makeStyles");function _r(){let e=new Uint8Array(16),t=globalThis.crypto;if(typeof t?.getRandomValues=="function")t.getRandomValues(e);else for(let o=0;o<e.length;o+=1)e[o]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=[];for(let o=0;o<e.length;o+=1)r.push(e[o].toString(16).padStart(2,"0"));return r.slice(0,4).join("")+"-"+r.slice(4,6).join("")+"-"+r.slice(6,8).join("")+"-"+r.slice(8,10).join("")+"-"+r.slice(10,16).join("")}n(_r,"newSessionId");function Sr(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}n(Sr,"authHeaders");function q(e,t){return {...e,headers:{...Rr(e.headers),...Sr(t)}}}n(q,"withAuthHeaders");function Rr(e){if(!e)return {};let t={};for(let[r,o]of Object.entries(e)){let a=r.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(t[r]=o);}return t}n(Rr,"stripAuthHeaders");async function vt(e,t){if(t.mode==="anonymous")return t.transport.request(q(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return P(ge())}let o=await t.transport.request(q(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await t.identity.currentToken({forceRefresh:!0});}catch{return P(ge())}let s=await t.transport.request(q(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?P(ge(s.error.httpStatus)):s}n(vt,"authedSend");function ge(e){return N("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(ge,"authRejectedError");function gt(e){return N("internalError",{retryable:true,wireMessage:Tr(e)})}n(gt,"networkError");function Tr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Tr,"describeCause");var Cr=3e4,wr=fe*2,kr="idempotency-key",Fr=new Set(["POST","PUT","PATCH","DELETE"]),xr=Object.freeze({onEvent(){}}),Pr=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Or(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}n(Or,"seededIdempotencyKey");function ht(e){let t=e.observer??xr,r=e.timers??Pr,o=e.rng??Math.random,a=e.sleep??((y,p)=>Hr(y,r,p)),s=e.maxAttempts??at,d=e.unaryTimeoutMs??Cr,c=e.newIdempotencyKey??Ir(),m=n(y=>{try{t.onEvent(y);}catch{}},"emit");async function f(y,p,_){let S=_?.maxAttempts,x=Math.max(1,S??s),I=_?.idempotent??Fr.has(p.method),E=_?.idempotencyKey===void 0?null:Or(_.idempotencyKey),C=I?E??c():null,z=Ar(p,C),l=0;for(;;){let v=n(T=>Object.freeze({call:y,method:p.method,path:p.path,attempt:l,...C?{idempotencyKey:C}:{},...T}),"stamp");m(v({phase:"attempt"}));let O=qr(d,r),j=Vr(O.signal,p.signal),i;try{i=await vt({...z,signal:j.signal},e.auth);}catch(T){i=P(gt(T));}finally{j.dispose(),O.cancel();}if(i.ok)return m(v({phase:"settled",ok:true,reason:"ok"})),i;let u=i.error,g=Dr(u,l,{maxAttempts:x,rng:o,now:r.now(),aborted:p.signal?.aborted===true,...S!==void 0?{perCallMaxAttempts:S}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),R={ok:false,code:u.code,reason:g.reason,...u.httpStatus!==void 0?{httpStatus:u.httpStatus}:{},...u.requestId!==void 0?{requestId:u.requestId}:{}};if(!g.retry)return m(v({phase:"settled",...R})),P(u);if(m(v({phase:"retry",...R,delayMs:g.delayMs})),await a(g.delayMs,p.signal),p.signal?.aborted===true)return m(v({phase:"settled",...R,reason:"aborted"})),P(u);l+=1;}}n(f,"send");async function b(y){return q(y,await Kr(e.auth))}n(b,"authorize");async function*h(y,p,_){m(Object.freeze({call:y,phase:"stream.open",method:p.method,path:p.path,attempt:0}));try{yield*e.auth.transport.stream(p,_);}catch{yield Qe({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(h,"stream"),Object.freeze({send:f,authorize:b,stream:h})}n(ht,"createRequestFunnel");function Ar(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==kr&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Ar,"assembleHeaders");function Ir(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Ir,"defaultIdempotencyKeyFactory");var Mr=10;function Dr(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=zr(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!pe(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let d=n(()=>{if(r.policy===void 0)return null;let f;try{f=r.policy.maxAttempts(e.code);}catch{return null}return typeof f!="number"||!Number.isFinite(f)?null:Math.max(1,Math.min(Mr,Math.floor(f)))},"policyCeiling"),c=r.perCallMaxAttempts??d()??r.maxAttempts;if(t+1>=c)return {retry:false,reason:"attempts-exhausted"};let m=jr(e,r.now);return m!==null?m>wr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:m}:{retry:true,reason:a,delayMs:it(t,r.rng)}}n(Dr,"decideRetry");function zr(e){let t=e.code==="unknown"?nt(Br(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(zr,"throttleKind");function jr(e,t){let r=Lr(e.raw);if(r!==null){let a=r-t;return a>0?a:0}let o=Nr(e.raw);return o===null?null:Math.round(o*1e3)}n(jr,"retryOverrideMs");function Nr(e){for(let t of Ee(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}n(Nr,"findRetryAfterSeconds");function Lr(e){for(let t of Ee(e)){let r=t.resets_at,o=Ur(r);if(o!==null)return o}return null}n(Lr,"findResetsAt");function Ee(e){if(!Et(e))return [];let t=[e];for(let r of ["error","detail"]){let o=e[r];Et(o)&&t.push(o);}return t}n(Ee,"candidateScopes");function Ur(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}n(Ur,"parseInstantMs");function Br(e){for(let t of Ee(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(Br,"rawWireCode");function Et(e){return typeof e=="object"&&e!==null}n(Et,"isRecord");async function Kr(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}n(Kr,"resolveDeviceAuth");function qr(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(qr,"boundedSignal");function Vr(e,t){let r=n(()=>{},"noop");if(!t)return {signal:e,dispose:r};let o=new AbortController;if(e.aborted||t.aborted)return o.abort(),{signal:o.signal,dispose:r};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a);},"dispose")}}n(Vr,"mergeSignals");function Hr(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(o=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",s),o();},e),s=n(()=>{t.clearTimeout(a),o();},"onAbort");r?.addEventListener("abort",s,{once:true});})}n(Hr,"delayAbortable");function _t(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let o=e.charCodeAt(t+1);if(!(o>=56320&&o<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}n(_t,"hasLoneSurrogate");function he(e){let t={url:e.url,kind:e.kind,expiresAt:e.expires_at};return typeof e.loop_duration_ms=="number"&&(t.loopDurationMs=e.loop_duration_ms),typeof e.cache_key=="string"&&e.cache_key.length>0&&(t.cacheKey=e.cache_key),Object.freeze(t)}n(he,"mapTier");function _e(e){let t={};e.tiers.animation&&(t.animation=he(e.tiers.animation)),e.tiers.image&&(t.image=he(e.tiers.image));let r={};e.overlays.weather_alert&&(r.weatherAlert=he(e.overlays.weather_alert));let o={category:e.category,tiers:Object.freeze(t),overlays:Object.freeze(r),idle:"bundled",ttlSeconds:e.ttl_seconds,degraded:e.degraded};return typeof e.cache_epoch=="number"&&(o.cacheEpoch=e.cache_epoch),Object.freeze(o)}n(_e,"mapPetStateResponse");var Wr=zod.z.enum(["webp","video"]),Gr=zod.z.enum(["health","attention","moment","activity","mood","idle"]),Se=zod.z.object({url:zod.z.string(),kind:Wr.default("webp"),loop_duration_ms:zod.z.number().nullish(),expires_at:zod.z.string(),cache_key:zod.z.string().nullish()}),St=zod.z.object({category:Gr,tiers:zod.z.object({animation:Se.optional(),image:Se.optional()}).default({}),overlays:zod.z.object({weather_alert:Se.optional()}).default({}),idle:zod.z.literal("bundled").default("bundled"),ttl_seconds:zod.z.number(),degraded:zod.z.boolean().default(false),cache_epoch:zod.z.number().default(0)});function Re(e){let t=St.safeParse(e);return t.success?t.data:null}n(Re,"parsePetStateWire");function Te(e){return Yr(ht({auth:e}))}n(Te,"createPetStateRepository");function Yr(e){return {async getState(t,r){if(_t(t))return P(N("validationFailed",{retryable:false,wireMessage:"pet_ref contains an unpaired surrogate and cannot be encoded"}));let o=`/widget/v1/pets/${encodeURIComponent(t)}/state`,a=await e.send("animations.getState",r?.signal?{method:"GET",path:o,signal:r.signal}:{method:"GET",path:o});if(a.ok){let s=Re(a.value);return s===null?P(N("internalError",{retryable:true})):me(_e(s))}return a.error.httpStatus===404?me(null):P(a.error)}}}n(Yr,"createPetStateRepositoryOver");function Ce(e){if(e===void 0)return "bundled:none";if(typeof e=="number")return `bundled:${e}`;if("kind"in e)return `bundled:${e.id}`;let t=e.uri,r=t.indexOf("?");return r===-1?t:t.slice(0,r)}n(Ce,"stableMediaKey");function we(e){return e.hasPhoto&&!e.photoFailed?"photo":e.canAnimate&&!e.animationFailed?"animation":e.hasImage&&!e.imageFailed?"image":"idle"}n(we,"selectTier");function ke(e,t){switch(e){case "photo":return {failed:V({...t,photo:true}),reason:"network_error"};case "animation":return {failed:V({...t,animation:true}),reason:"network_error"};case "image":return {failed:V({...t,image:true}),reason:"network_error"};case "idle":return {failed:V(t),reason:"idle_asset_failed"};default:return {failed:V(t),reason:"network_error"}}}n(ke,"retireTier");var H=Object.freeze({photo:false,animation:false,image:false});function V(e){return Object.freeze({photo:e.photo,animation:e.animation,image:e.image})}n(V,"freezeFailed");function $r(e){switch(e){case "activity":case "mood":case "moment":case "idle":return true;case "health":case "attention":return false;default:return false}}n($r,"isLoaderSafeCategory");var Fe="everfur.petState.cacheEpoch";function xe(e){let t=0,r=false,o=null,a=n(async s=>{if(r||(t=await Qr(e.kv),r=true),s<=t)return false;try{await e.kv.setItem(Fe,String(s));}catch{}t=s;try{await e.cache.clearMemoryCache();}catch{}try{await e.cache.clearDiskCache();}catch{}return true},"run");return {async sync(s){return typeof s!="number"||!Number.isFinite(s)||s<=0||r&&s<=t?false:o||(o=a(s).finally(()=>{o=null;}),o)}}}n(xe,"createCacheEpochGuard");async function Qr(e){let t;try{t=await e.getItem(Fe);}catch{return 0}if(t===null)return 0;let r=Number(t);return Number.isFinite(r)&&r>0?r:0}n(Qr,"readStoredEpoch");var Pe=1,Oe="everfur.manifest.lastKnownGood",L=Object.freeze({kind:"bundled",id:"everfur-idle"}),W=Object.freeze({schemaVersion:Pe,revision:"compiled-default",surfaces:Object.freeze({animations:Object.freeze({enabled:true,idle:L})})}),Xr=zod.z.object({kind:zod.z.literal("bundled"),id:zod.z.string().min(1)}),Jr=zod.z.object({enabled:zod.z.boolean().default(true),idle:Xr.optional()}),Zr=zod.z.object({schema_version:zod.z.number().int(),revision:zod.z.string().default(""),surfaces:zod.z.object({animations:Jr.optional()}).default({})});function Ae(e){let t=Zr.safeParse(e);if(!t.success)return {ok:false,reason:"unparseable"};if(t.data.schema_version>Pe)return {ok:false,reason:"newer_schema"};let r=t.data.surfaces.animations,o={};return r&&(o.animations=Object.freeze({enabled:r.enabled,idle:r.idle?Object.freeze({...r.idle}):L})),{ok:true,manifest:Object.freeze({schemaVersion:t.data.schema_version,revision:t.data.revision,surfaces:Object.freeze(o)})}}n(Ae,"parseManifest");async function en(e,t,r){if(e!=null){let a=Ae(e);if(a.ok)return await tn(t,e),r.track("manifest.fallback",{source:"live"}),Object.freeze({manifest:a.manifest,source:"live"});a.reason==="newer_schema"&&r.track("manifest.refused_newer",{});}let o=await rn(t);return o?(r.track("manifest.fallback",{source:"last-known-good"}),Object.freeze({manifest:o,source:"last-known-good"})):(r.track("manifest.fallback",{source:"compiled-default"}),Object.freeze({manifest:W,source:"compiled-default"}))}n(en,"resolveManifest");function Ie(e){return e.surfaces.animations??W.surfaces.animations??{enabled:true,idle:L}}n(Ie,"animationsSurfaceOf");async function tn(e,t){try{await e.setItem(Oe,JSON.stringify(t));}catch{}}n(tn,"writeLastKnownGood");async function rn(e){let t;try{t=await e.getItem(Oe);}catch{return null}if(t===null)return null;let r;try{r=JSON.parse(t);}catch{return null}let o=Ae(r);return o.ok?o.manifest:null}n(rn,"readLastKnownGood");var Rt=Object.freeze({data:null,isPending:false,isError:false,error:null,isDark:false});function Me(e){let{repo:t,cacheEpoch:r,timers:o}=e,a=new Set,s=new Map,d=Rt,c=null,m=null,f=false,b=null,h=null,y=null,p=0,_=n(()=>{for(let i of a)i();},"emit"),S=n(i=>{d=Object.freeze({...d,...i}),_();},"patch"),x=n(()=>{h!==null&&(o.clearTimeout(h),h=null);},"clearRemint"),I=n(i=>i?Math.max(1,i.ttlSeconds)*1e3:6e4,"staleMs"),E=n(i=>{let u=s.get(i);u!==void 0&&(s.delete(i),s.set(i,u));},"touchWarm"),C=n((i,u)=>{for(s.delete(i),s.set(i,Object.freeze({data:u,fetchedAt:o.now()}));s.size>32;){let g=s.keys().next().value;if(g===void 0||g===i)break;s.delete(g);}},"setWarm"),z=n(i=>{let u=s.get(i);return u?!!(u.data.tiers.animation||u.data.tiers.image):false},"hasGoodTiers"),l=n((i,u)=>{if(x(),!f)return;let g=Math.max(1,u)*1e3,R=p;h=o.setTimeout(()=>{h=null,!(R!==p||c!==i||!f)&&v(i,0);},g);},"scheduleRemint"),v=n(async(i,u)=>{if(c!==i||b===i||!f)return;let g=p;y?.abort();let R=new AbortController;y=R;let T=await t.getState(i,{signal:R.signal});if(!(g!==p||c!==i)){if(T.ok){let w=T.value;if(w===null){O(i);return}r.sync(w.cacheEpoch);let ne=!!(w.tiers.animation||w.tiers.image);if(w.degraded&&!ne&&z(i)){S({isError:false,error:null,isPending:false,isDark:false}),l(i,w.ttlSeconds);return}C(i,w),m=i,S({data:w,isPending:false,isError:false,error:null,isDark:false}),l(i,w.ttlSeconds);return}if(Tt(T.error)){j(i,T.error);return}if(S({isError:true,error:T.error,isPending:d.data===null&&m!==i}),u<2){x();let w=500*(u+1),ne=p;h=o.setTimeout(()=>{h=null,!(ne!==p||c!==i||!f)&&v(i,u+1);},w);}else l(i,5);}},"fetchOnce"),O=n(i=>{b=i,s.delete(i),x(),m=i,S({data:null,isPending:false,isError:false,error:null,isDark:true});},"onTerminalDark"),j=n((i,u)=>{b=i,s.delete(i),x(),m=i,S({data:null,isPending:false,isError:false,error:u,isDark:true});},"onTerminalDisabled");return {observe(i,u){let g=u.isFocused!==f;if(f=u.isFocused,i!==c){if(p+=1,y?.abort(),y=null,x(),b=null,c=i,i===null){m=null,d=Rt,_();return}let T=s.get(i),w=T&&o.now()-T.fetchedAt<I(T.data)?T:null;w?(E(i),m=i,S({data:w.data,isPending:false,isError:false,error:null,isDark:false})):S({isPending:true,isError:false,error:null,isDark:false}),f&&v(i,0);return}if(!g||i===null)return;if(!f){x();return}let R=s.get(i);!R||o.now()-R.fetchedAt>=I(R.data)?b!==i&&v(i,0):l(i,R.data.ttlSeconds);},getSnapshot(){return d},subscribe(i){return a.add(i),()=>{a.delete(i);}},getCachedPetStateMedia(i){let u=s.get(i);return !u||o.now()-u.fetchedAt>=I(u.data)?null:(E(i),u.data)},dispose(){p+=1,y?.abort(),y=null,x(),a.clear(),s.clear();}}}n(Me,"createPetStateStore");function Tt(e){if(typeof e!="object"||e===null)return false;let t=e,r=typeof t.status=="number"?t.status:t.httpStatus;return r===403||r===404}n(Tt,"isTerminalPetStateError");var Ct=Object.freeze({track(){},trackExpectedFailure(){}});function ee(e){let t=e.telemetry??Ct,r=e.timers??an(e.now),o=Me({repo:e.repo,cacheEpoch:xe({kv:e.kv,cache:e.cache}),timers:r}),a=new Set,s=H,d="none",c=false,m=null,f=null,b=false,h=0,y="",p=on(S()),_=false;function S(){let l=e.manifest?e.manifest():W;return Ie(l)}n(S,"surface");let x=n(()=>{for(let l of a)l();},"emit"),I=o.subscribe(()=>{E();});function E(){let l=o.getSnapshot();(l.data!==f||l.isDark!==b)&&(f=l.data,b=l.isDark,s=H,d=l.isDark?"dark_or_missing":"none",h+=1),C(l);}n(E,"onStoreChange");function C(l=o.getSnapshot()){let v=S(),O=nn(v,l,{failed:s,fallbackReason:d,paused:c,photoUrl:m,reducedMotion:e.reducedMotion()});p=O,z(O),x();}n(C,"recompute");function z(l){if(l.kind!=="ready")return;let v=`${l.category}|${l.tier}|${l.fallbackReason}|${l.reducedMotion?1:0}`;v!==y&&(y=v,t.track("pet_state_shown",{category:l.category,tier:l.tier,fallback_reason:l.fallbackReason,reduced_motion:l.reducedMotion}),l.fallbackReason==="idle_asset_failed"&&t.trackExpectedFailure("idle_asset_failed",{category:l.category}));}return n(z,"maybeEmitShown"),{observe(l,v){_||(m=v.photoUrl??null,s=H,o.observe(l,{isFocused:v.isFocused}),E());},getState(){return p},subscribe(l){return a.add(l),()=>{a.delete(l);}},onMediaError(){if(_||p.kind!=="ready")return;let l=ke(p.tier,s);s=l.failed,d=l.reason,C();},setPaused(l){_||c===l||(c=l,C());},dispose(){_||(_=true,I(),o.dispose(),a.clear());}}}n(ee,"createAnimationController");function nn(e,t,r){let o=e.idle;if(!e.enabled)return Object.freeze({kind:"disabled",reason:U("accessDenied"),level:"partner_config",source:o,idle:e.idle});if(t.isPending&&t.data===null&&!t.isDark)return Object.freeze({kind:"pending",showSkeleton:true,source:o});let a=t.data,s=a?.category??"idle",d=a?.tiers.animation,c=a?.tiers.image,m=!!d&&d?.kind==="webp"&&!r.reducedMotion&&!r.failed.animation,f=we({hasPhoto:r.photoUrl!==null&&r.photoUrl.length>0,photoFailed:r.failed.photo,canAnimate:m,animationFailed:r.failed.animation,hasImage:!!c,imageFailed:r.failed.image}),b=o,h=null,y=false;f==="photo"&&r.photoUrl?b=De(r.photoUrl,void 0):f==="animation"&&d?(b=De(d.url,d.cacheKey),h=d.loopDurationMs??null,y=d.cacheKey!==void 0):f==="image"&&c&&(b=De(c.url,c.cacheKey),y=c.cacheKey!==void 0);let p=b.kind==="uri"?b.cacheKey:`bundled:${b.id}`;return Object.freeze({kind:"ready",tier:f,source:b,recyclingKey:p,category:s,loopDurationMs:h,paused:r.paused,reducedMotion:r.reducedMotion,cacheHit:y,fallbackReason:r.fallbackReason,isDark:t.isDark,isTransientError:t.isError})}n(nn,"buildView");function De(e,t){return Object.freeze({kind:"uri",uri:e,cacheKey:t??Ce({uri:e})})}n(De,"uriSource");function on(e){return Object.freeze({kind:"pending",showSkeleton:true,source:e.idle})}n(on,"pendingView");function an(e){return {setTimeout:n((t,r)=>setTimeout(t,r),"setTimeout"),clearTimeout:n(t=>clearTimeout(t),"clearTimeout"),now:e}}n(an,"defaultTimers");var un=Object.freeze({kind:"pending",showSkeleton:true,source:L}),cn=n(()=>{},"NOOP_UNSUBSCRIBE");function je(e){let{petRef:t,repo:r,cache:o,kv:a,isFocused:s=true,photoUrl:d=null,telemetry:c,reducedMotion:m,manifest:f,timers:b,now:h}=e,{runtime:y,userRef:p}=Z(),_=K("animations"),S=pn(m),I=r!==void 0&&o!==void 0&&a!==void 0?"override":`${p??""}|${t??""}`,[E,C]=react.useState(null);react.useEffect(()=>{if(r!==void 0&&o!==void 0&&a!==void 0){let g={repo:r,cache:o,kv:a,reducedMotion:S,now:h??kt,...c?{telemetry:c}:{},...f?{manifest:f}:{},...b?{timers:b}:{}},R=ee(g);return C(R),()=>{C(T=>T===R?null:T),R.dispose();}}let{services:i}=y.registry,u=y.registry.acquire("animations",`${p??""}|${t??""}`,()=>ee({repo:Te(i.authFor(p)),cache:i.imageCache,kv:i.kv,reducedMotion:S,now:h??kt,telemetry:i.telemetry,...f?{manifest:f}:{},...b?{timers:b}:{}}),g=>g.dispose());return C(u),()=>{C(g=>g===u?null:g),y.registry.release(u);}},[I,r,o,a,y]),react.useEffect(()=>{E?.observe(t,{isFocused:s,photoUrl:d});},[E,t,s,d]);let z=react.useCallback(i=>E?E.subscribe(i):cn,[E]),l=react.useCallback(()=>E?E.getState():un,[E]),v=react.useSyncExternalStore(z,l,l),O=react.useCallback(()=>{E?.onMediaError();},[E]),j=react.useCallback(i=>{E?.setPaused(i);},[E]);return react.useMemo(()=>({capability:_,state:v,onMediaError:O,setPaused:j}),[_,v,O,j])}n(je,"useAnimations");function pn(e){let t=react.useRef(true);return react.useEffect(()=>{if(e)return;let r=true,o=reactNative.AccessibilityInfo.isReduceMotionEnabled?.();o&&typeof o.then=="function"&&o.then(s=>{r&&(t.current=s);});let a=reactNative.AccessibilityInfo.addEventListener?.("reduceMotionChanged",s=>{t.current=s;});return ()=>{r=false,a?.remove?.();}},[e]),react.useMemo(()=>e??(()=>t.current),[e])}n(pn,"useSystemReducedMotion");function kt(){return Date.now()}n(kt,"defaultNow");var gn=200,En=300,Ne=120;function hn(e){let{style:t,accessibilityLabel:r}=e,o={accessibilityLabel:r,decorative:At(e)};return jsxRuntime.jsx(mt,{capability:"animations",style:t,renderPending:()=>jsxRuntime.jsx(re,{style:t,a11y:o,busy:true}),renderDisabled:a=>jsxRuntime.jsx(re,{style:t,a11y:o,reason:a.disabled?.reason??""}),children:jsxRuntime.jsx(_n,{...e})})}n(hn,"PetStateView");function At(e){return e.decorative===true||e.accessibilityLabel===void 0}n(At,"isDecorative");function _n(e){let t=Le(),r={accessibilityLabel:e.accessibilityLabel,decorative:At(e)},o=je(Tn(e));return jsxRuntime.jsx(reactNative.View,{style:[t.container,e.style],children:Sn(o.state,o.onMediaError,r)})}n(_n,"PetStateBody");function Sn(e,t,r){switch(e.kind){case "pending":return jsxRuntime.jsx(Pt,{source:e.source,recyclingKey:"pending",reducedMotion:true,a11y:r,busy:true,onMediaError:t});case "disabled":return jsxRuntime.jsx(re,{a11y:r,reason:e.reason});case "ready":return jsxRuntime.jsx(Pt,{source:e.source,recyclingKey:e.recyclingKey,reducedMotion:e.reducedMotion,a11y:r,onMediaError:t});default:return Q(e)}}n(Sn,"renderState");function Pt({source:e,recyclingKey:t,reducedMotion:r,a11y:o,busy:a,onMediaError:s}){let d=Le();return e.kind==="uri"?jsxRuntime.jsx(reactNative.Image,{source:{uri:e.uri},onError:s,fadeDuration:r?0:gn,style:d.media,...It(o)},t):jsxRuntime.jsx(re,{a11y:o,busy:a})}n(Pt,"MediaNode");function re({style:e,a11y:t,busy:r,reason:o}){let a=Le();return jsxRuntime.jsxs(reactNative.View,{style:[a.idlePlaceholder,e],...It(t),children:[r?jsxRuntime.jsx(Rn,{}):null,o&&o.length>0?jsxRuntime.jsx($,{style:a.reasonText,children:o}):null]})}n(re,"IdleRegion");function Rn(){let e=M(),[t,r]=react.useState(false);return react.useEffect(()=>{let o=setTimeout(()=>r(true),En);return ()=>clearTimeout(o)},[]),t?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:e.color.brandInk}):null}n(Rn,"DelayedSpinner");function It(e){if(e.decorative)return {accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};let t=e.accessibilityLabel;return t!==void 0?{accessible:true,accessibilityRole:"image",accessibilityLabel:t}:{accessible:true,accessibilityRole:"image"}}n(It,"a11yProps");function Tn(e){let t={petRef:e.petRef,repo:e.repo,cache:e.cache,kv:e.kv};return e.isFocused!==void 0&&(t.isFocused=e.isFocused),e.photoUrl!==void 0&&(t.photoUrl=e.photoUrl),e.telemetry!==void 0&&(t.telemetry=e.telemetry),e.reducedMotion!==void 0&&(t.reducedMotion=e.reducedMotion),e.manifest!==void 0&&(t.manifest=e.manifest),e.timers!==void 0&&(t.timers=e.timers),e.now!==void 0&&(t.now=e.now),t}n(Tn,"buildParams");function Le(){let e=M();return react.useMemo(()=>Cn(e),[e])}n(Le,"useStyles");function Cn(e){return reactNative.StyleSheet.create({container:{minHeight:Ne,width:"100%",backgroundColor:e.color.surfaceCream,borderRadius:e.radius.lg,overflow:"hidden"},media:{minHeight:Ne,width:"100%"},idlePlaceholder:{minHeight:Ne,width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:e.color.surfaceCream,borderRadius:e.radius.lg,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:e.color.borderRingCream,padding:e.space.lg},reasonText:{marginTop:e.space.sm,fontFamily:e.type.family,fontSize:e.type.size.bodyTight,lineHeight:Math.round(e.type.size.bodyTight*e.type.lineHeight.normal),fontWeight:e.type.weight.medium,color:e.color.text.muted,textAlign:"center"}})}n(Cn,"makeStyles");exports.CACHE_EPOCH_STORAGE_KEY=Fe;exports.COMPILED_DEFAULT_IDLE=L;exports.COMPILED_DEFAULT_MANIFEST=W;exports.MANIFEST_LKG_STORAGE_KEY=Oe;exports.NO_FAILURES=H;exports.PetStateView=hn;exports.SUPPORTED_SCHEMA_VERSION=Pe;exports.animationsSurfaceOf=Ie;exports.createAnimationController=ee;exports.createCacheEpochGuard=xe;exports.createPetStateRepository=Te;exports.createPetStateStore=Me;exports.isLoaderSafeCategory=$r;exports.isTerminalPetStateError=Tt;exports.mapPetStateResponse=_e;exports.newSessionId=_r;exports.parseManifest=Ae;exports.parsePetStateWire=Re;exports.petStateResponseWireSchema=St;exports.resolveManifest=en;exports.retireTier=ke;exports.selectTier=we;exports.stableMediaKey=Ce;exports.useAnimations=je;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { E as EverfurResult } from '../EverfurResult-ZtH-YV1h.cjs';
|
|
4
|
-
import { A as AuthContext } from '../identity-
|
|
5
|
-
export { I as IdentityProvider, n as newSessionId } from '../identity-
|
|
4
|
+
import { A as AuthContext } from '../identity-D7PO5s9m.cjs';
|
|
5
|
+
export { I as IdentityProvider, n as newSessionId } from '../identity-D7PO5s9m.cjs';
|
|
6
6
|
import { P as PetRef } from '../ids-B2GAAifq.cjs';
|
|
7
7
|
export { B as Brand, U as UserRef, _ as __brand } from '../ids-B2GAAifq.cjs';
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -13,7 +13,7 @@ import { E as EverfurError } from '../EverfurError-DmELDpXp.cjs';
|
|
|
13
13
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError-DmELDpXp.cjs';
|
|
14
14
|
import { D as DisabledLevel, a as CapabilityDecision } from '../resolve-D4Ywz5OS.cjs';
|
|
15
15
|
export { b as CapabilityDisabled, C as CapabilityName } from '../resolve-D4Ywz5OS.cjs';
|
|
16
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config-
|
|
16
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config-BZX97FmW.cjs';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The full /state payload. `degraded` + `cache_epoch` + `cache_key` are additive fields an older backend
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { E as EverfurResult } from '../EverfurResult-SGvHKsCB.js';
|
|
4
|
-
import { A as AuthContext } from '../identity-
|
|
5
|
-
export { I as IdentityProvider, n as newSessionId } from '../identity-
|
|
4
|
+
import { A as AuthContext } from '../identity-B8rp0L9G.js';
|
|
5
|
+
export { I as IdentityProvider, n as newSessionId } from '../identity-B8rp0L9G.js';
|
|
6
6
|
import { P as PetRef } from '../ids-B2GAAifq.js';
|
|
7
7
|
export { B as Brand, U as UserRef, _ as __brand } from '../ids-B2GAAifq.js';
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -13,7 +13,7 @@ import { E as EverfurError } from '../EverfurError-DmELDpXp.js';
|
|
|
13
13
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError-DmELDpXp.js';
|
|
14
14
|
import { D as DisabledLevel, a as CapabilityDecision } from '../resolve-D4Ywz5OS.js';
|
|
15
15
|
export { b as CapabilityDisabled, C as CapabilityName } from '../resolve-D4Ywz5OS.js';
|
|
16
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config-
|
|
16
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config-Dfbj5mlx.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The full /state payload. `degraded` + `cache_epoch` + `cache_key` are additive fields an older backend
|