@everfur/sdk 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/{Chat-BOX-03ho.d.ts → Chat-Rzplrf5M.d.ts} +3 -3
- package/dist/{Chat-TA-aTcVF.d.cts → Chat-ypo6miKm.d.cts} +3 -3
- package/dist/{DepthViews-D2dRqWRq.d.ts → DepthViews-CeTfPUBX.d.ts} +1 -1
- package/dist/{DepthViews-DSFyaSeL.d.cts → DepthViews-ClykXOJj.d.cts} +1 -1
- package/dist/{DepthViews-Cviea-ri.d.cts → DepthViews-Cui3oonj.d.cts} +1 -1
- package/dist/{DepthViews-CgjX2AJ5.d.ts → DepthViews-baYLMNQ-.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-DHvnITuE.d.cts → attachments-CwsR-bPN.d.cts} +5 -5
- package/dist/{attachments-C_vtFu2f.d.ts → attachments-CzZ7in24.d.ts} +5 -5
- package/dist/{attachments-oD5U2fXI.d.ts → attachments-D3HCBmOE.d.ts} +2 -2
- package/dist/{attachments-pIdGOQfm.d.cts → attachments-Nk73Lll8.d.cts} +2 -2
- package/dist/{bookingCopy-DfuA13dh.d.cts → bookingCopy-Dv8rKqyV.d.cts} +2 -2
- package/dist/{bookingCopy-CJir9mjb.d.ts → bookingCopy-SDkXaxDf.d.ts} +2 -2
- package/dist/{casesRepository-DHgIYKN9.d.ts → casesRepository-BTAecTnF.d.ts} +1 -1
- package/dist/{casesRepository-B-Eg8ZJ3.d.cts → casesRepository-aryld7fJ.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 +5 -5
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +5 -5
- package/dist/{config-DAFbf721.d.cts → config-6qS7Sohy.d.cts} +1 -1
- package/dist/{config-ClI7QxB0.d.ts → config-X6BtwDwQ.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-CZbgF_OH.d.ts → context-7f3Nb_xE.d.ts} +5 -5
- package/dist/{context-B-dUM1Qf.d.cts → context-CkqPM4Ml.d.cts} +5 -5
- package/dist/{copy-CneuYdrO.d.cts → copy-Bd__Pw5s.d.cts} +2 -2
- package/dist/{copy-CeRH3NXy.d.ts → copy-NgKgOOET.d.ts} +2 -2
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +12 -12
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.js +7 -7
- package/dist/{depth-DO3Ko_qs.d.ts → depth-CYPH92jE.d.ts} +2 -2
- package/dist/{depth-B3NFKlF9.d.cts → depth-CyjaJJ6V.d.cts} +2 -2
- package/dist/{entitlementRepository-74kW5mK0.d.ts → entitlementRepository-DdeFuEKp.d.ts} +2 -2
- package/dist/{entitlementRepository-m6zLUmiB.d.cts → entitlementRepository-Dl1qRLcJ.d.cts} +2 -2
- package/dist/{identity-C7uxGwfT.d.cts → identity-DjqhDm5Z.d.cts} +1 -1
- package/dist/{identity-CLAUq-K4.d.ts → identity-Dy_L7Yq4.d.ts} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +6 -6
- package/dist/notifications/index.cjs +2 -2
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +2 -2
- package/dist/{pets-BoB5B7kp.d.cts → pets-BSG2qbr_.d.cts} +1 -1
- package/dist/{pets-w4M9d-Dn.d.ts → pets-D7cZutrX.d.ts} +1 -1
- package/dist/{petsRepository-DZZoEG3r.d.cts → petsRepository-D1bnxDZg.d.cts} +1 -1
- package/dist/{petsRepository-BjKJ8UsN.d.ts → petsRepository-DhsX3GLw.d.ts} +1 -1
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +1 -1
- package/dist/{ports-BO3bzTJg.d.ts → ports-C0m1G1fS.d.ts} +4 -4
- package/dist/{ports-C2EVK416.d.cts → ports-DNXyyzZF.d.cts} +4 -4
- package/dist/records/depth/index.cjs +2 -2
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +2 -2
- package/dist/records/index.cjs +3 -3
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +3 -3
- package/dist/{requestFunnel-Djjwgoe9.d.cts → requestFunnel-Bqc1inM9.d.cts} +2 -2
- package/dist/{requestFunnel-D7ipek3e.d.ts → requestFunnel-FvE5yLDD.d.ts} +2 -2
- package/dist/{runtimeTypes-CTL3yToK.d.ts → runtimeTypes-C0yPBz89.d.ts} +4 -4
- package/dist/{runtimeTypes-D2C9uD85.d.cts → runtimeTypes-RN-VXTFV.d.cts} +4 -4
- 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 +20 -14
- package/dist/televet/booking/index.d.ts +20 -14
- package/dist/televet/booking/index.js +1 -1
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-7yFNK_rU.d.ts → timelineRows-D4U6A8zE.d.ts} +1 -1
- package/dist/{timelineRows-CzR1T2DR.d.cts → timelineRows-DAB5dpjF.d.cts} +1 -1
- package/dist/{useRecordsDepth-DFF7Faxx.d.ts → useRecordsDepth--ObtMyjH.d.ts} +1 -1
- package/dist/{useRecordsDepth-Bnw36jPr.d.cts → useRecordsDepth-B35y8bV-.d.cts} +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view-CaJs8WFH.d.cts → view-B-Toym_j.d.cts} +2 -2
- package/dist/{view-BqcOYFTr.d.ts → view-D9JqNQai.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 +14 -14
- package/dist/web/index.d.ts +14 -14
- package/dist/web/index.js +7 -7
- package/dist/web/notifications/index.cjs +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/notifications/index.js +2 -2
- package/dist/web/records/depth/index.cjs +2 -2
- 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 +2 -2
- 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 +12 -8
- package/dist/web/televet/booking/index.d.ts +12 -8
- 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 +1 -1
- package/dist/web/televet/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,44 @@ changes that has not been earned by any production integration yet.
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.5.1] - 2026-09-23
|
|
14
|
+
|
|
15
|
+
Fixes from the partner end-to-end run of 2026-09-23 (a Vite React web app and an Expo app, built through the
|
|
16
|
+
MCP planner, against staging). No public signature changes.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **A partner member is told booking is paused, never that they need Pro.** On the partner plane the televet
|
|
21
|
+
entitlement read answers whether YOUR allowance is on, not whether the member has a plan. When it answered
|
|
22
|
+
`active: false` (allowance not set yet, suspended, set to 0 or used up) the booking flow opened, on both
|
|
23
|
+
platforms and from every vet entry, on "A Pro membership is needed to book a video visit.", with Close as the
|
|
24
|
+
only control. That state now renders what the unavailable branch renders: your `renderUnavailable` when you
|
|
25
|
+
pass one, else the paused card ("Booking is not available right now."). A 402 at Confirm joins the same state
|
|
26
|
+
instead of printing the membership sentence under Confirm. The test id `televet-booking-not-entitled` and the
|
|
27
|
+
optional "Check availability" escape are unchanged. The exported `TelevetEntitlementInterestState` draws the
|
|
28
|
+
paused card too. `confirmNotEntitled` stays in the copy deck and no screen renders it.
|
|
29
|
+
- **Close on an untouched booking leaves without asking.** The auto-matched vet counted as an answer, so every
|
|
30
|
+
booking with a non-empty roster asked "Leave without booking? Your answers will not be saved." of a member who
|
|
31
|
+
had entered nothing. Typed text and a held slot still ask. Both platforms.
|
|
32
|
+
- **A rate-limited televet read settles after one request.** The televet 429 names its wait as
|
|
33
|
+
`retry_after_seconds` in the body; the request funnel read only `resets_at`, so each such 429 was retried up to
|
|
34
|
+
the attempt ceiling against a window that could have minutes left. A numeric `retry_after_seconds` is now the
|
|
35
|
+
retry override, a wait past the retry budget settles on the first 429, and `televet_rate_limited` normalizes to
|
|
36
|
+
`rateLimited`. The visits list shows the server's own sentence for a rate limit instead of "Check your
|
|
37
|
+
connection and try again." (web), or under its title (React Native); no sentence is written by the SDK.
|
|
38
|
+
- The upload progress line no longer reads "Uploading 2 of 1..." while the last file is being confirmed; the
|
|
39
|
+
counter is held to the total, on the card and in the queue's live region.
|
|
40
|
+
- Web surfaces stop a host page's inherited `text-align` at their root. A stock Vite app's `#root` centers text,
|
|
41
|
+
which centered chat replies, the records timeline and the clinic request form. Chat, every records screen, the
|
|
42
|
+
clinic request composer, the booking flow, the visits list, the call and its lobby, the capability off-state
|
|
43
|
+
and the clinical disclaimer set `text-align: start` on their root; your `style` prop still wins.
|
|
44
|
+
- The web full record's two header actions draw the consumer's icons (Feather `send` and `share-2`, as the
|
|
45
|
+
React Native SDK already does) instead of a rotated square and an empty circle. Their accessible names are
|
|
46
|
+
unchanged.
|
|
47
|
+
- The web records entry's size line moves 90_300 -> 94_800 gzip bytes (measured 90_326, plus 5%): main held it
|
|
48
|
+
by 350 bytes and the icons (+290) with the text-align reset and the counter clamp (+86) crossed it by 26.
|
|
49
|
+
Every other entry holds its line on the same build.
|
|
50
|
+
|
|
13
51
|
## [0.5.0] - 2026-09-23
|
|
14
52
|
|
|
15
53
|
0.4.1 was tagged but never published to npm: its fixes (the five televet refusal screens and the rest
|
|
@@ -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-C0m1G1fS.js';
|
|
6
|
+
import { W as WidgetPet, P as PetProfileInput } from './petsRepository-DhsX3GLw.js';
|
|
7
|
+
import { U as UrgencyDisplayLevel, L as LifecyclePort, E as EverfurChatDraftStore } from './attachments-CzZ7in24.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';
|
|
@@ -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-DNXyyzZF.cjs';
|
|
6
|
+
import { W as WidgetPet, P as PetProfileInput } from './petsRepository-D1bnxDZg.cjs';
|
|
7
|
+
import { U as UrgencyDisplayLevel, L as LifecyclePort, E as EverfurChatDraftStore } from './attachments-CwsR-bPN.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';
|
|
@@ -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--ObtMyjH.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-B35y8bV-.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-B35y8bV-.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--ObtMyjH.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}),Ue={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Be={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Le={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 Ke(){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:Le,tierSizes:Bt(Le),lineHeight:zt,weight:jt,letterSpacing:Nt,scale:1,maxScale:Lt,scaleCaps:Dt}}n(Ke,"baseType");var qe={},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 Ve={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)"},He=ie({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Kt,space:Ue,radius:Be,type:Ke(),motion:Ve,slots:qe}),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:Ue,radius:Be,type:Ke(),motion:Ve,slots:qe});var We=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Ge=globalThis,se=Ge[We]??(Ge[We]=react.createContext(He));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 $e(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($e,"errorFrame");var Jt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function Qe(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(Qe,"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"}),Ze=Object.freeze(ce.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:tr[e.wireCode]}))),rr=new Map(Ze.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),nr=Object.freeze(["http_envelope",...[...new Set(Ze.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 et(e){return null}n(et,"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 tt(e){return ar[e]}n(tt,"categoryFor");function rt(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":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(rt,"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 nt(e){return pe(e)||sr.has(e)}n(nt,"isRetryableCode");var lr=500,fe=8e3,ot=4;function at(e,t=Math.random){let r=Math.max(0,e),o=Math.min(lr*2**r,fe);return Math.floor(t()*o)}n(at,"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 it(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(it,"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:tt(e),retryable:t?.retryable??nt(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&&it(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&it(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 st(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(st,"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 lt=Symbol.for("@everfur/sdk#EverfurContext@v1"),dt=globalThis,ut=dt[lt]??(dt[lt]=react.createContext(null));ut.displayName??="EverfurContext";function Z(){let e=react.useContext(ut);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(()=>st(e,o.decisions,{isPending:o.isPending}),[e,o])}n(K,"useCapability");var hr=48;function Er(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}n(Er,"selectView");function yt(e){let{capability:t,children:r,renderDisabled:o,renderPending:a,style:s}=e,d=K(t),c=react.useMemo(()=>Er(d),[d]);switch(c){case "enabled":return r;case "pending":return a?jsxRuntime.jsx(de,{render:a,fallback:jsxRuntime.jsx(pt,{capability:t,style:s})}):jsxRuntime.jsx(pt,{capability:t,style:s});case "disabled":return o?jsxRuntime.jsx(de,{render:()=>o(d),fallback:jsxRuntime.jsx(ft,{decision:d,style:s}),resetKey:d}):jsxRuntime.jsx(ft,{decision:d,style:s});default:return Q(c)}}n(yt,"CapabilityGate");function pt({capability:e,style:t}){let r=M(),o=react.useMemo(()=>mt(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(pt,"PendingSkeleton");function ft({decision:e,style:t}){let r=M(),o=react.useMemo(()=>mt(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(ft,"OffState");function mt(e){let{color:t,space:r,radius:o,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:hr,justifyContent:"center",paddingHorizontal:r.lg,paddingVertical:r.md,backgroundColor:t.surfaceCream,borderRadius:o.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brandBorder},offstateText:{...Qe(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(mt,"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 bt(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(bt,"authedSend");function ge(e){return N("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(ge,"authRejectedError");function vt(e){return N("internalError",{retryable:true,wireMessage:Tr(e)})}n(vt,"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)=>Vr(y,r,p)),s=e.maxAttempts??ot,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),h=_?.idempotencyKey===void 0?null:Or(_.idempotencyKey),C=I?h??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=Kr(d,r),j=qr(O.signal,p.signal),i;try{i=await bt({...z,signal:j.signal},e.auth);}catch(T){i=P(vt(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 Br(e.auth))}n(b,"authorize");async function*E(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 $e({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(E,"stream"),Object.freeze({send:f,authorize:b,stream:E})}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:at(t,r.rng)}}n(Dr,"decideRetry");function zr(e){let t=e.code==="unknown"?rt(Ur(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(zr,"throttleKind");function jr(e,t){let r=Nr(e.raw);if(r===null)return null;let o=r-t;return o>0?o:0}n(jr,"retryOverrideMs");function Nr(e){for(let t of Et(e)){let r=t.resets_at,o=Lr(r);if(o!==null)return o}return null}n(Nr,"findResetsAt");function Et(e){if(!gt(e))return [];let t=[e];for(let r of ["error","detail"]){let o=e[r];gt(o)&&t.push(o);}return t}n(Et,"candidateScopes");function Lr(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(Lr,"parseInstantMs");function Ur(e){for(let t of Et(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(Ur,"rawWireCode");function gt(e){return typeof e=="object"&&e!==null}n(gt,"isRecord");async function Br(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(Br,"resolveDeviceAuth");function Kr(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(Kr,"boundedSignal");function qr(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(qr,"mergeSignals");function Vr(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(Vr,"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 Ee(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(Ee,"mapPetStateResponse");var Hr=zod.z.enum(["webp","video"]),Wr=zod.z.enum(["health","attention","moment","activity","mood","idle"]),_e=zod.z.object({url:zod.z.string(),kind:Hr.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:Wr,tiers:zod.z.object({animation:_e.optional(),image:_e.optional()}).default({}),overlays:zod.z.object({weather_alert:_e.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 Se(e){let t=St.safeParse(e);return t.success?t.data:null}n(Se,"parsePetStateWire");function Re(e){return Gr(ht({auth:e}))}n(Re,"createPetStateRepository");function Gr(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=Se(a.value);return s===null?P(N("internalError",{retryable:true})):me(Ee(s))}return a.error.httpStatus===404?me(null):P(a.error)}}}n(Gr,"createPetStateRepositoryOver");function Te(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(Te,"stableMediaKey");function Ce(e){return e.hasPhoto&&!e.photoFailed?"photo":e.canAnimate&&!e.animationFailed?"animation":e.hasImage&&!e.imageFailed?"image":"idle"}n(Ce,"selectTier");function we(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(we,"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 Yr(e){switch(e){case "activity":case "mood":case "moment":case "idle":return true;case "health":case "attention":return false;default:return false}}n(Yr,"isLoaderSafeCategory");var ke="everfur.petState.cacheEpoch";function xe(e){let t=0,r=false,o=null,a=n(async s=>{if(r||(t=await $r(e.kv),r=true),s<=t)return false;try{await e.kv.setItem(ke,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 $r(e){let t;try{t=await e.getItem(ke);}catch{return 0}if(t===null)return 0;let r=Number(t);return Number.isFinite(r)&&r>0?r:0}n($r,"readStoredEpoch");var Fe=1,Pe="everfur.manifest.lastKnownGood",L=Object.freeze({kind:"bundled",id:"everfur-idle"}),W=Object.freeze({schemaVersion:Fe,revision:"compiled-default",surfaces:Object.freeze({animations:Object.freeze({enabled:true,idle:L})})}),Qr=zod.z.object({kind:zod.z.literal("bundled"),id:zod.z.string().min(1)}),Xr=zod.z.object({enabled:zod.z.boolean().default(true),idle:Qr.optional()}),Jr=zod.z.object({schema_version:zod.z.number().int(),revision:zod.z.string().default(""),surfaces:zod.z.object({animations:Xr.optional()}).default({})});function Oe(e){let t=Jr.safeParse(e);if(!t.success)return {ok:false,reason:"unparseable"};if(t.data.schema_version>Fe)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(Oe,"parseManifest");async function Zr(e,t,r){if(e!=null){let a=Oe(e);if(a.ok)return await en(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 tn(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(Zr,"resolveManifest");function Ae(e){return e.surfaces.animations??W.surfaces.animations??{enabled:true,idle:L}}n(Ae,"animationsSurfaceOf");async function en(e,t){try{await e.setItem(Pe,JSON.stringify(t));}catch{}}n(en,"writeLastKnownGood");async function tn(e){let t;try{t=await e.getItem(Pe);}catch{return null}if(t===null)return null;let r;try{r=JSON.parse(t);}catch{return null}let o=Oe(r);return o.ok?o.manifest:null}n(tn,"readLastKnownGood");var Rt=Object.freeze({data:null,isPending:false,isError:false,error:null,isDark:false});function Ie(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,E=null,y=null,p=0,_=n(()=>{for(let i of a)i();},"emit"),S=n(i=>{d=Object.freeze({...d,...i}),_();},"patch"),F=n(()=>{E!==null&&(o.clearTimeout(E),E=null);},"clearRemint"),I=n(i=>i?Math.max(1,i.ttlSeconds)*1e3:6e4,"staleMs"),h=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;E=o.setTimeout(()=>{E=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;E=o.setTimeout(()=>{E=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?(h(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:(h(i),u.data)},dispose(){p+=1,y?.abort(),y=null,F(),a.clear(),s.clear();}}}n(Ie,"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??on(e.now),o=Ie({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,E=0,y="",p=nn(S()),_=false;function S(){let l=e.manifest?e.manifest():W;return Ae(l)}n(S,"surface");let F=n(()=>{for(let l of a)l();},"emit"),I=o.subscribe(()=>{h();});function h(){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",E+=1),C(l);}n(h,"onStoreChange");function C(l=o.getSnapshot()){let v=S(),O=rn(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}),h());},getState(){return p},subscribe(l){return a.add(l),()=>{a.delete(l);}},onMediaError(){if(_||p.kind!=="ready")return;let l=we(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 rn(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=Ce({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,E=null,y=false;f==="photo"&&r.photoUrl?b=Me(r.photoUrl,void 0):f==="animation"&&d?(b=Me(d.url,d.cacheKey),E=d.loopDurationMs??null,y=d.cacheKey!==void 0):f==="image"&&c&&(b=Me(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:E,paused:r.paused,reducedMotion:r.reducedMotion,cacheHit:y,fallbackReason:r.fallbackReason,isDark:t.isDark,isTransientError:t.isError})}n(rn,"buildView");function Me(e,t){return Object.freeze({kind:"uri",uri:e,cacheKey:t??Te({uri:e})})}n(Me,"uriSource");function nn(e){return Object.freeze({kind:"pending",showSkeleton:true,source:e.idle})}n(nn,"pendingView");function on(e){return {setTimeout:n((t,r)=>setTimeout(t,r),"setTimeout"),clearTimeout:n(t=>clearTimeout(t),"clearTimeout"),now:e}}n(on,"defaultTimers");var dn=Object.freeze({kind:"pending",showSkeleton:true,source:L}),un=n(()=>{},"NOOP_UNSUBSCRIBE");function ze(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:E}=e,{runtime:y,userRef:p}=Z(),_=K("animations"),S=cn(m),I=r!==void 0&&o!==void 0&&a!==void 0?"override":`${p??""}|${t??""}`,[h,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:E??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:Re(i.authFor(p)),cache:i.imageCache,kv:i.kv,reducedMotion:S,now:E??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(()=>{h?.observe(t,{isFocused:s,photoUrl:d});},[h,t,s,d]);let z=react.useCallback(i=>h?h.subscribe(i):un,[h]),l=react.useCallback(()=>h?h.getState():dn,[h]),v=react.useSyncExternalStore(z,l,l),O=react.useCallback(()=>{h?.onMediaError();},[h]),j=react.useCallback(i=>{h?.setPaused(i);},[h]);return react.useMemo(()=>({capability:_,state:v,onMediaError:O,setPaused:j}),[_,v,O,j])}n(ze,"useAnimations");function cn(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(cn,"useSystemReducedMotion");function kt(){return Date.now()}n(kt,"defaultNow");var vn=200,gn=300,je=120;function hn(e){let{style:t,accessibilityLabel:r}=e,o={accessibilityLabel:r,decorative:At(e)};return jsxRuntime.jsx(yt,{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(En,{...e})})}n(hn,"PetStateView");function At(e){return e.decorative===true||e.accessibilityLabel===void 0}n(At,"isDecorative");function En(e){let t=Ne(),r={accessibilityLabel:e.accessibilityLabel,decorative:At(e)},o=ze(Rn(e));return jsxRuntime.jsx(reactNative.View,{style:[t.container,e.style],children:_n(o.state,o.onMediaError,r)})}n(En,"PetStateBody");function _n(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(_n,"renderState");function Pt({source:e,recyclingKey:t,reducedMotion:r,a11y:o,busy:a,onMediaError:s}){let d=Ne();return e.kind==="uri"?jsxRuntime.jsx(reactNative.Image,{source:{uri:e.uri},onError:s,fadeDuration:r?0:vn,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=Ne();return jsxRuntime.jsxs(reactNative.View,{style:[a.idlePlaceholder,e],...It(t),children:[r?jsxRuntime.jsx(Sn,{}):null,o&&o.length>0?jsxRuntime.jsx($,{style:a.reasonText,children:o}):null]})}n(re,"IdleRegion");function Sn(){let e=M(),[t,r]=react.useState(false);return react.useEffect(()=>{let o=setTimeout(()=>r(true),gn);return ()=>clearTimeout(o)},[]),t?jsxRuntime.jsx(reactNative.ActivityIndicator,{color:e.color.brand}):null}n(Sn,"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 Rn(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(Rn,"buildParams");function Ne(){let e=M();return react.useMemo(()=>Tn(e),[e])}n(Ne,"useStyles");function Tn(e){return reactNative.StyleSheet.create({container:{minHeight:je,width:"100%",backgroundColor:e.color.surfaceCream,borderRadius:e.radius.lg,overflow:"hidden"},media:{minHeight:je,width:"100%"},idlePlaceholder:{minHeight:je,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(Tn,"makeStyles");exports.CACHE_EPOCH_STORAGE_KEY=ke;exports.COMPILED_DEFAULT_IDLE=L;exports.COMPILED_DEFAULT_MANIFEST=W;exports.MANIFEST_LKG_STORAGE_KEY=Pe;exports.NO_FAILURES=H;exports.PetStateView=hn;exports.SUPPORTED_SCHEMA_VERSION=Fe;exports.animationsSurfaceOf=Ae;exports.createAnimationController=ee;exports.createCacheEpochGuard=xe;exports.createPetStateRepository=Re;exports.createPetStateStore=Ie;exports.isLoaderSafeCategory=Yr;exports.isTerminalPetStateError=Tt;exports.mapPetStateResponse=Ee;exports.newSessionId=_r;exports.parseManifest=Oe;exports.parsePetStateWire=Se;exports.petStateResponseWireSchema=St;exports.resolveManifest=Zr;exports.retireTier=we;exports.selectTier=Ce;exports.stableMediaKey=Te;exports.useAnimations=ze;
|
|
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,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-DjqhDm5Z.cjs';
|
|
5
|
+
export { I as IdentityProvider, n as newSessionId } from '../identity-DjqhDm5Z.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-6qS7Sohy.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-Dy_L7Yq4.js';
|
|
5
|
+
export { I as IdentityProvider, n as newSessionId } from '../identity-Dy_L7Yq4.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-X6BtwDwQ.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The full /state payload. `degraded` + `cache_epoch` + `cache_key` are additive fields an older backend
|