@everfur/sdk 0.17.0 → 0.18.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 +167 -26
- package/care/package.json +8 -0
- package/dist/{Chat.d-uETscjrL.d.ts → Chat.d-Bz4iJ7d2.d.ts} +1 -1
- package/dist/{Chat.d-BYY1U61e.d.cts → Chat.d-C2ddC2u7.d.cts} +1 -1
- package/dist/{DepthViews.d-BsZ73mzL.d.ts → DepthViews.d-C6-Kzs6H.d.ts} +1 -1
- package/dist/{DepthViews.d-D_Qp4glO.d.cts → DepthViews.d-Chjs8H9V.d.cts} +1 -1
- package/dist/{DepthViews.d-DL8MP_kA.d.cts → DepthViews.d-pFL_ZBZT.d.cts} +1 -1
- package/dist/{DepthViews.d-B4SE5GUD.d.ts → DepthViews.d-qXt9OMgz.d.ts} +1 -1
- package/dist/{RecordsPage.d-CYotk2R9.d.cts → RecordsPage.d-Cmny6Q7g.d.cts} +2 -2
- package/dist/{RecordsPage.d-D4gP4leq.d.ts → RecordsPage.d-sNRolVdy.d.ts} +2 -2
- package/dist/animations/index.d.cts +5 -5
- package/dist/animations/index.d.ts +5 -5
- package/dist/{appStateLifecycle.d-DJXdDOJY.d.cts → appStateLifecycle.d-Bt70TQog.d.cts} +7 -7
- package/dist/{appStateLifecycle.d-CXJzBS3c.d.ts → appStateLifecycle.d-Jdg9_PFt.d.ts} +7 -7
- package/dist/{attachments.d-B8kOCb6q.d.cts → attachments.d-BVp3r6Ms.d.cts} +5 -5
- package/dist/{attachments.d-C61URT8r.d.cts → attachments.d-CF4_n-DZ.d.cts} +2 -2
- package/dist/{attachments.d-BTIGzXWD.d.ts → attachments.d-DnSCMjH0.d.ts} +5 -5
- package/dist/{attachments.d-BgatKf7d.d.ts → attachments.d-DsUZpMad.d.ts} +2 -2
- package/dist/{bookingCopy.d-B-bSYgqS.d.cts → bookingCopy.d-BHqE9Ozq.d.cts} +16 -16
- package/dist/{bookingCopy.d-JQW2SLM-.d.ts → bookingCopy.d-Ca4AQGZ7.d.ts} +16 -16
- package/dist/{branding.d-Bbc6p1XY.d.cts → branding.d-BFauULV6.d.cts} +1 -1
- package/dist/{branding.d-y6c0UwhE.d.ts → branding.d-DpNGEdDL.d.ts} +1 -1
- package/dist/care/index.cjs +3 -0
- package/dist/care/index.d.cts +434 -0
- package/dist/care/index.d.ts +434 -0
- package/dist/care/index.js +3 -0
- package/dist/{casesRepository.d-CVG2EXcg.d.cts → casesRepository.d-DFwD2kiS.d.cts} +1 -1
- package/dist/{casesRepository.d-CHEjzT4h.d.ts → casesRepository.d-VzxEyq2N.d.ts} +1 -1
- package/dist/chat/index.cjs +14 -13
- package/dist/chat/index.d.cts +13 -13
- package/dist/chat/index.d.ts +13 -13
- package/dist/chat/index.js +14 -13
- package/dist/chat/lite/index.cjs +14 -13
- package/dist/chat/lite/index.d.cts +13 -13
- package/dist/chat/lite/index.d.ts +13 -13
- package/dist/chat/lite/index.js +14 -13
- package/dist/chunk-Y3Q4GW47.js +31 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +10 -10
- package/dist/client/index.d.ts +10 -10
- package/dist/client/index.js +1 -1
- package/dist/{clinicBatch.d-DdlFy4pD.d.cts → clinicBatch.d-CLqaih2C.d.cts} +2 -2
- package/dist/{clinicBatch.d-oNwH_dbI.d.ts → clinicBatch.d-DXDIL1lC.d.ts} +2 -2
- package/dist/{config.d-Cy_hJBJG.d.cts → config.d-7bCXvOGn.d.cts} +1 -1
- package/dist/{config.d-DopRLD4f.d.ts → config.d-cqyvpzDb.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-C42juGn6.d.cts → context.d-BeRanUXQ.d.cts} +7 -7
- package/dist/{context.d-Ban-Hhqu.d.ts → context.d-DAnmDYGr.d.ts} +7 -7
- package/dist/{copy.d-BTS5l6Ri.d.cts → copy.d-BPqs8swm.d.cts} +2 -2
- package/dist/{copy.d-qdbygul9.d.ts → copy.d-CxFzeuvo.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +17 -17
- package/dist/core/index.d.ts +17 -17
- package/dist/core/index.js +1 -1
- package/dist/{depth.d-BGkHm2Se.d.ts → depth.d-C6XbnFig.d.ts} +2 -2
- package/dist/{depth.d-BfVrhq9o.d.cts → depth.d-qHdXHDd-.d.cts} +2 -2
- package/dist/{entitlementRepository.d-npT7L_7_.d.cts → entitlementRepository.d-C6uTDswj.d.cts} +4 -4
- package/dist/{entitlementRepository.d-CjwqCyhS.d.ts → entitlementRepository.d-D_cc7g4l.d.ts} +4 -4
- package/dist/{focus.d-S0nq_k1A.d.ts → focus.d-DiWvQR2j.d.ts} +193 -21
- package/dist/{focus.d-DS7Ze1Pp.d.cts → focus.d-HSkMHd-i.d.cts} +193 -21
- package/dist/health-plan/index.cjs +261 -176
- package/dist/health-plan/index.d.cts +627 -19
- package/dist/health-plan/index.d.ts +627 -19
- package/dist/health-plan/index.js +261 -176
- package/dist/{idempotency.d-COIrwuCb.d.ts → idempotency.d-CF5AvlYp.d.ts} +18 -639
- package/dist/{idempotency.d-gfiN4Qnp.d.cts → idempotency.d-DrO2zEZO.d.cts} +18 -639
- package/dist/{identity.d-D76vXtkJ.d.cts → identity.d-84x0dV7-.d.cts} +1 -1
- package/dist/{identity.d-B3mFvvRq.d.ts → identity.d-BXztMVYM.d.ts} +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +12 -11
- package/dist/{introEvents.d-3FLEemX3.d.cts → introEvents.d-Cwv72ER-.d.cts} +11 -11
- package/dist/{introEvents.d-BYnr37bd.d.ts → introEvents.d-DYU3znJs.d.ts} +11 -11
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/omsErrors.d-VF5tnr20.d.cts +633 -0
- package/dist/omsErrors.d-VF5tnr20.d.ts +633 -0
- package/dist/omsFields.d-BHntKIAH.d.cts +153 -0
- package/dist/omsFields.d-Cvfw8wWU.d.ts +153 -0
- package/dist/{optInView.d-DXRUGDiD.d.cts → optInView.d-4Hl4HbQh.d.cts} +3 -3
- package/dist/{optInView.d-BqFMcum4.d.ts → optInView.d-pq8tUTf6.d.ts} +3 -3
- package/dist/{parse.d-CY22hFxb.d.ts → parse.d-BJhhYfkv.d.ts} +1 -1
- package/dist/{parse.d-rvA_aRSO.d.cts → parse.d-D0v06qxx.d.cts} +1 -1
- package/dist/{pets.d-Cicz-aIO.d.ts → pets.d-1_CHpfgB.d.ts} +1 -1
- package/dist/{pets.d-RoHTZsaV.d.cts → pets.d-C4n-MDC4.d.cts} +1 -1
- package/dist/{petsRepository.d-DtAZf_Ja.d.ts → petsRepository.d-BuomdFjZ.d.ts} +1 -1
- package/dist/{petsRepository.d-BxMyt6Aj.d.cts → petsRepository.d-Dd95xh-M.d.cts} +1 -1
- package/dist/{ports.d-D7cjFUoL.d.cts → ports.d-Bf3tp7Pn.d.cts} +4 -4
- package/dist/{ports.d-DrgKa73F.d.ts → ports.d-ChZHFd-q.d.ts} +4 -4
- package/dist/{presentation.d-vy8kTGfR.d.cts → presentation.d-Bs8xQ4gD.d.cts} +4 -4
- package/dist/{presentation.d-vy8kTGfR.d.ts → presentation.d-Bs8xQ4gD.d.ts} +4 -4
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +11 -10
- package/dist/records/index.d.cts +24 -23
- package/dist/records/index.d.ts +24 -23
- package/dist/records/index.js +11 -10
- package/dist/{requestFunnel.d-BdQf53zs.d.cts → requestFunnel.d-CWI2pD3V.d.cts} +2 -2
- package/dist/{requestFunnel.d-B5y7Py8Z.d.ts → requestFunnel.d-DcQIAs45.d.ts} +2 -2
- package/dist/{resolve.d-CoQWUy1Y.d.cts → resolve.d-BTC3b6FW.d.cts} +1 -1
- package/dist/{resolve.d-CoQWUy1Y.d.ts → resolve.d-BTC3b6FW.d.ts} +1 -1
- package/dist/{runtimeTypes.d-r4Q5vASZ.d.cts → runtimeTypes.d-CIOVzjEK.d.cts} +6 -6
- package/dist/{runtimeTypes.d-D5EDgS3Y.d.ts → runtimeTypes.d-rbuONrIv.d.ts} +6 -6
- package/dist/{screenProps.d-v4a4kzxA.d.cts → screenProps.d-CFZe27oI.d.cts} +1 -1
- package/dist/{screenProps.d-KLCrP43b.d.ts → screenProps.d-yUA4k6yK.d.ts} +1 -1
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +49 -6
- package/dist/server/events/index.d.ts +49 -6
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.cjs +6 -6
- package/dist/shop/index.d.cts +9 -8
- package/dist/shop/index.d.ts +9 -8
- package/dist/shop/index.js +6 -6
- package/dist/shop/orders-v2/index.d.cts +2 -2
- package/dist/shop/orders-v2/index.d.ts +2 -2
- package/dist/tabs/index.cjs +4 -4
- package/dist/tabs/index.d.cts +14 -14
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.js +4 -4
- package/dist/{tabsModel.d-B7QMug1u.d.ts → tabsModel.d-D9GWPFrL.d.cts} +1 -1
- package/dist/{tabsModel.d-B7QMug1u.d.cts → tabsModel.d-D9GWPFrL.d.ts} +1 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +85 -2
- package/dist/testing/index.d.ts +85 -2
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.d.cts +10 -10
- package/dist/testing/rn/index.d.ts +10 -10
- package/dist/testing/web/index.d.cts +10 -10
- package/dist/testing/web/index.d.ts +10 -10
- package/dist/texting/index.d.cts +6 -6
- package/dist/texting/index.d.ts +6 -6
- package/dist/{threadOptions.d-EFJaNBP1.d.cts → threadOptions.d-CRbFXnlq.d.cts} +66 -11
- package/dist/{threadOptions.d-GPJPprkn.d.cts → threadOptions.d-CW51PyVd.d.cts} +28 -1
- package/dist/{threadOptions.d-GPJPprkn.d.ts → threadOptions.d-CW51PyVd.d.ts} +28 -1
- package/dist/{threadOptions.d-B0folrKm.d.cts → threadOptions.d-U5YBUKM-.d.ts} +2 -2
- package/dist/{threadOptions.d-Crh_LiDe.d.ts → threadOptions.d-aK8FkszA.d.ts} +66 -11
- package/dist/{threadOptions.d-DTsJFkL-.d.ts → threadOptions.d-bEAFkIsC.d.cts} +2 -2
- package/dist/{timelineRows.d-DpSis9HR.d.ts → timelineRows.d-BbCLvjy1.d.ts} +1 -1
- package/dist/{timelineRows.d-6-Cw8xGd.d.cts → timelineRows.d-BvA_BoOe.d.cts} +1 -1
- package/dist/{typeStyle.d-B3Kdtjie.d.ts → typeStyle.d-B9Jo5mDX.d.ts} +1 -1
- package/dist/{typeStyle.d-DmlwyJq-.d.cts → typeStyle.d-Ckdh_S-t.d.cts} +1 -1
- package/dist/types.d-d3RdaeAA.d.cts +317 -0
- package/dist/types.d-d3RdaeAA.d.ts +317 -0
- package/dist/ui/index.cjs +68 -0
- package/dist/ui/index.d.cts +73 -0
- package/dist/ui/index.d.ts +73 -0
- package/dist/ui/index.js +68 -0
- package/dist/useHealthPlanSubscription.d-BN40CVK6.d.cts +756 -0
- package/dist/useHealthPlanSubscription.d-BYehTI7R.d.ts +756 -0
- package/dist/{usePresentation.d-CRG3Gaaq.d.ts → usePresentation.d-BfcyAEFt.d.ts} +66 -7
- package/dist/{usePresentation.d-C8rqY56C.d.cts → usePresentation.d-C39kKhoO.d.cts} +66 -7
- package/dist/{useRecordsDepth.d-DlRda5jp.d.ts → useRecordsDepth.d-B2ewVbRm.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-BYk7m7gF.d.cts → useRecordsDepth.d-CKXAAHXI.d.cts} +1 -1
- package/dist/{view.d-DuIXHr08.d.ts → view.d-BnUDSQXz.d.ts} +3 -3
- package/dist/{view.d-B31M8rCG.d.cts → view.d-CbcJKNJj.d.cts} +1 -1
- package/dist/{view.d-B31M8rCG.d.ts → view.d-CbcJKNJj.d.ts} +1 -1
- package/dist/{view.d-CLpEHKOp.d.cts → view.d-DTNPjiZ1.d.cts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +335 -180
- package/dist/web/health-plan/index.d.cts +576 -19
- package/dist/web/health-plan/index.d.ts +576 -19
- package/dist/web/health-plan/index.js +297 -162
- package/dist/web/health-plan/styles.css +233 -0
- package/dist/web/health-plan/today/index.cjs +7 -0
- package/dist/web/health-plan/today/index.d.cts +15 -0
- package/dist/web/health-plan/today/index.d.ts +15 -0
- package/dist/web/health-plan/today/index.js +7 -0
- package/dist/web/index.cjs +36 -33
- package/dist/web/index.d.cts +60 -37
- package/dist/web/index.d.ts +60 -37
- package/dist/web/index.js +36 -33
- package/dist/web/intro/index.cjs +2 -2
- package/dist/web/intro/index.d.cts +8 -8
- package/dist/web/intro/index.d.ts +8 -8
- package/dist/web/intro/index.js +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +13 -12
- package/dist/web/records-sheet/index.d.cts +13 -10
- package/dist/web/records-sheet/index.d.ts +13 -10
- package/dist/web/records-sheet/index.js +13 -12
- package/dist/web/shop/index.cjs +6 -6
- package/dist/web/shop/index.d.cts +8 -7
- package/dist/web/shop/index.d.ts +8 -7
- package/dist/web/shop/index.js +6 -6
- package/dist/web/shop/orders-v2/index.d.cts +1 -1
- package/dist/web/shop/orders-v2/index.d.ts +1 -1
- package/dist/web/televet/booking/index.cjs +1 -1
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +6 -6
- package/dist/web/texting/index.d.ts +6 -6
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +70 -0
- package/dist/web/ui/index.d.cts +78 -0
- package/dist/web/ui/index.d.ts +78 -0
- package/dist/web/ui/index.js +48 -0
- package/dist/web/ui/styles.css +244 -0
- package/package.json +71 -5
- package/ui/package.json +8 -0
- package/web/health-plan/today/native-blocked.cjs +12 -0
- package/web/health-plan/today/package.json +8 -0
- package/web/ui/native-blocked.cjs +12 -0
- package/web/ui/package.json +8 -0
- package/dist/useHealthPlanSubscription.d-DD30EkUR.d.ts +0 -205
- package/dist/useHealthPlanSubscription.d-DWrzUXf4.d.cts +0 -205
package/dist/web/intro/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _Everf
|
|
|
99
99
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf2(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf2(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf2(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
100
100
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
101
101
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var PROVIDERS=/* @__PURE__ */new Set(["expo","fcm","apns"]),PLATFORMS=/* @__PURE__ */new Set(["ios","android"]),TOKEN_MAX=4096,INSTALLATION_ID_MAX=128,DEVICE_ID_MAX=64,CONTROL_OR_SPACE=/[\0- ]/;function invalid(wireMessage,reasonCode){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage,...reasonCode?{reasonCode:reasonCode}:{}})}function validateRegister(input){if(typeof input!="object"||input===null)return invalid("registerDevice needs an input object");let{token:token,provider:provider,platform:platform,installationId:installationId}=input;return typeof provider!="string"||!PROVIDERS.has(provider)?invalid("provider must be expo, fcm or apns"):typeof platform!="string"||!PLATFORMS.has(platform)?invalid("platform must be ios or android"):typeof token!="string"||token.trim().length===0||token.length>TOKEN_MAX||CONTROL_OR_SPACE.test(token)?invalid(`token must be a push token of 1..${TOKEN_MAX} characters with no whitespace`,"token_invalid"):installationId!==void 0&&(typeof installationId!="string"||installationId.length===0||installationId.length>INSTALLATION_ID_MAX)?invalid(`installationId must be 1..${INSTALLATION_ID_MAX} characters`):null}function validateDeviceId(deviceId){return typeof deviceId!="string"||deviceId.length===0||deviceId.length>DEVICE_ID_MAX?invalid(`deviceId must be 1..${DEVICE_ID_MAX} characters`):CONTROL_OR_SPACE.test(deviceId)||deviceId.includes("/")||deviceId==="."||deviceId===".."?invalid("deviceId is not a device id"):null}function validatePreferences(input){if(typeof input!="object"||input===null)return invalid("setPreferences needs an input object");let{pushEnabled:pushEnabled,emailEnabled:emailEnabled}=input;return typeof pushEnabled!="boolean"||typeof emailEnabled!="boolean"?invalid("pushEnabled and emailEnabled must both be booleans: the route replaces both switches"):null}function str(value){return typeof value=="string"&&value.length>0?value:null}function parseDevice(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,deviceId=str(o.device_id),provider=str(o.provider),platform=str(o.platform),registeredAt=str(o.registered_at),lastSeenAt=str(o.last_seen_at);if(deviceId===null||provider===null||platform===null||registeredAt===null||lastSeenAt===null||!PROVIDERS.has(provider)||!PLATFORMS.has(platform))return null;let installation=o.installation_id;/* @__PURE__ */
|
|
102
|
-
return Object.freeze({deviceId:deviceId,provider:provider,platform:platform,installationId:typeof installation=="string"&&installation.length>0?installation:null,registeredAt:registeredAt,lastSeenAt:lastSeenAt})}function parsePreferences(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,updatedAt=str(o.updated_at);return typeof o.push_enabled!="boolean"||typeof o.email_enabled!="boolean"||updatedAt===null?null:/* @__PURE__ */Object.freeze({pushEnabled:o.push_enabled,emailEnabled:o.email_enabled,updatedAt:updatedAt})}function malformed(call){return makeEverfurError("internalError",{retryable:false,wireMessage:`${call}: the response was not the documented shape`})}var ROUTE_REASONS=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function refine(error){return foldWireReason(error,ROUTE_REASONS)}function disposed(verb){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createNotificationsClient(runtime){let over=()=>{let{services:services}=runtime.registry;return createNotificationsClientOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{registerDevice:(input,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("registerDevice"))):over().registerDevice(input,opts),unregisterDevice:(deviceId,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("unregisterDevice"))):over().unregisterDevice(deviceId,opts),setPreferences:(input,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("setPreferences"))):over().setPreferences(input,opts)}}function createNotificationsClientOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async registerDevice(input,opts){let bad=validateRegister(input);if(bad!==null)return err(bad);let body={token:input.token,provider:input.provider,platform:input.platform};input.installationId!==void 0&&(body.installation_id=input.installationId);let res=await funnel.send("notifications.registerDevice",withSignal({method:"POST",path:"/widget/v1/me/devices",body:body},opts?.signal));if(!res.ok)return err(refine(res.error));let device=parseDevice(res.value);return device===null?err(malformed("registerDevice")):ok(device)},async unregisterDevice(deviceId,opts){let bad=validateDeviceId(deviceId);if(bad!==null)return err(bad);let res=await funnel.send("notifications.unregisterDevice",withSignal({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(deviceId)}`},opts?.signal));return res.ok?ok(void 0):err(refine(res.error))},async setPreferences(input,opts){let bad=validatePreferences(input);if(bad!==null)return err(bad);let res=await funnel.send("notifications.setPreferences",withSignal({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:input.pushEnabled,email_enabled:input.emailEnabled}},opts?.signal));if(!res.ok)return err(refine(res.error));let preferences=parsePreferences(res.value);return preferences===null?err(malformed("setPreferences")):ok(preferences)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let int=Math.trunc(n)>>>0,a=int>>>24&255;return{r:int>>>16&255,g:int>>>8&255,b:int&255,a:a===0?1:a/255}}function byte(hex,at){return Number.parseInt(hex.slice(at,at+2),16)}function dup(nibble){return Number.parseInt(`${nibble??"0"}${nibble??"0"}`,16)}function clampByte(n){return Number.isFinite(n)?Math.min(255,Math.max(0,Math.round(n))):null}function rgbToHex(r,g,b){return`#${hex2(r)}${hex2(g)}${hex2(b)}`.toUpperCase()}function hex2(n){return n.toString(16).padStart(2,"0")}var NEAR_BLACK="#111111",WHITE="#FFFFFF",BLACK="#000000";function readableOn(background){let rgba=toRgba(background);if(rgba===null)return WHITE;let bg=relativeLuminance(rgba),black=relativeLuminance({r:17,g:17,b:17}),white=relativeLuminance({r:255,g:255,b:255});return luminanceContrast(bg,white)>=luminanceContrast(bg,black)?WHITE:NEAR_BLACK}function legibleOn(background,target){let first=readableOn(background);return contrastRatio(first,background)>=target?first:contrastRatio(WHITE,background)>=contrastRatio(BLACK,background)?WHITE:BLACK}function poleForGrounds(grounds){let worst=ink=>grounds.reduce((low,ground)=>Math.min(low,contrastRatio(ink,ground)),Number.POSITIVE_INFINITY);return worst(WHITE)>=worst(BLACK)?WHITE:BLACK}function relativeLuminance(rgba){let r=linearize(rgba.r/255),g=linearize(rgba.g/255),b=linearize(rgba.b/255);return.2126*r+.7152*g+.0722*b}function linearize(channel){return channel<=.03928?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function luminanceContrast(l1,l2){let lighter=Math.max(l1,l2),darker=Math.min(l1,l2);return(lighter+.05)/(darker+.05)}function contrastRatio(a,b){let fg=toRgba(a),bg=toRgba(b);if(fg===null||bg===null)return 1;let ground=bg.a>=1?bg:{...bg},fore=fg.a>=1?fg:composite(fg,ground);return luminanceContrast(relativeLuminance(fore),relativeLuminance(ground))}function composite(fg,bg){let a=fg.a,mix2=(f,g)=>Math.round(f*a+g*(1-a));return{r:mix2(fg.r,bg.r),g:mix2(fg.g,bg.g),b:mix2(fg.b,bg.b),a:1}}function flattenOnto(color,background){let fg=toRgba(color),bg=toRgba(background);if(fg===null||bg===null)return null;let out=fg.a>=1?fg:composite(fg,{...bg});return rgbToHex(out.r,out.g,out.b)}function withAlpha(color,alpha){let rgba=toRgba(color);if(rgba===null)return null;let a=Math.min(1,Math.max(0,alpha));return`rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${a})`}var PUSH_STEP=.05;function pushToContrast(color,grounds,pole,target){let first=grounds[0];if(first===void 0)return pole;let reads=candidate=>grounds.every(ground=>contrastRatio(candidate,ground)>=target);if(toRgba(color)===null)return pole;if(reads(color))return color;let flat=flattenOnto(color,first),from=flat===null?null:toRgba(flat),to=toRgba(pole);if(from===null||to===null)return pole;for(let step=1;step<1/PUSH_STEP;step+=1){let t=step*PUSH_STEP,mix2=(a,b)=>Math.round(a+(b-a)*t),candidate=rgbToHex(mix2(from.r,to.r),mix2(from.g,to.g),mix2(from.b,to.b));if(reads(candidate))return candidate}return pole}var RAPH_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...RAPH_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;function v3InkOn(fill,inks){for(let ink of inks)if(contrastRatio(ink,fill)>=V3_TEXT_CONTRAST)return ink;return legibleOn(fill,V3_TEXT_CONTRAST)}function mix(color,share,ground){let over=withAlpha(color,share);return(over===null?null:flattenOnto(over,ground))??ground}function askIntroColors(theme){let v=v3Palette(theme),c=theme.color,card=v.card;return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:card,onInk:v.dark?c.background:"#FFFFFF",primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,onAccent:v3InkOn(v.accent,[v.ink,v.onAccent]),accent2:mix(v.accent,.75,card),accent4:mix(v.accent,.17,card),accentChip:mix(v.accent,.47,card),link:v.link,linkChip:mix(v.link,.2,card),riskDot:v.riskDot,riskChip:v.dark?c.badgeBgCritical:"#FFD8D6",clearBg:v.clearBg,clearInk:v.clearInk,clearChip:v.dark?c.badgeBgPositive:"#DDEFC4",byInk:c.brandInk}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}function headingFaceCss(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type,base=faceCss(theme,fallback);return headingFamily===null&&headingWeight===null?base:headingFamily!==null?{fontFamily:cssFontFamily(headingFamily),fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]}:theme.type.namedFaces[fallback]||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function isWebDevelopment(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function askIntroTokens(theme){return{...askIntroColors(theme),sans:faceCss(theme,"regular").fontFamily,serif:headingFaceCss(theme,"bold").fontFamily,mono:cssMonoFamily(theme.type.mono)}}var warned=/* @__PURE__ */new Set;function warnUnknownRule(key){warned.has(key)||!isWebDevelopment()||(warned.add(key),globalThis.console?.warn?.(`[everfur] unknown style rule ${key}`))}var camel=prop=>prop.startsWith("--")?prop:prop.replace(/-([a-z])/g,(_m,ch)=>ch.toUpperCase());function askIntroSx(theme,rules,reduced){let tokens=askIntroTokens(theme),dark=theme.brightness==="dark",fill=value=>value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?tokens.line??whole:`#${key.slice(2)}`:tokens[key]??whole),cache2=/* @__PURE__ */new Map;return(...selectors)=>{let keys=selectors.filter(s=>typeof s=="string"&&s!==""),id=keys.join("|"),hit=cache2.get(id);if(hit!==void 0)return hit;let out={};for(let key of keys){let decls=rules[key];if(decls===void 0){warnUnknownRule(key);continue}for(let[prop,value]of decls)out[camel(prop)]=fill(value);if(theme.motion.reducedMotion)for(let[prop,value]of reduced[key]??[])out[camel(prop)]=fill(value)}let style=/* @__PURE__ */Object.freeze(out);return cache2.set(id,style),style}}function askIntroReset(theme){let tokens=askIntroTokens(theme);return{root:{boxSizing:"border-box",fontFamily:tokens.sans,fontSize:17,lineHeight:1.5,color:tokens.ink,WebkitFontSmoothing:"antialiased",textRendering:"optimizeLegibility",fontVariationSettings:'"SOFT" 0, "WONK" 0',fontVariantLigatures:"no-common-ligatures"},button:{boxSizing:"border-box",font:"inherit",color:"inherit",background:"none",border:0,padding:0,margin:0,cursor:"pointer",textAlign:"inherit",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},text:{margin:0,boxSizing:"border-box"},srOnly:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}}}var CLINIC_REQUEST_COPY=/* @__PURE__ */Object.freeze({title:"Request records",clinic:"Clinic",search:"Search clinics by name or location",placeholder:"Clinic name, city, or ZIP",email:"Clinic email",emailPlaceholder:"records@clinic.com",ownerName:"Your full name",scopeHeading:"What you’re authorizing",send:"Send request",sending:"Sending…",cancel:"Cancel",sign:"Signature",draw:"Draw your signature",type:"Type your name to sign",toType:"Can’t draw? Type your name instead",toDraw:"Draw your signature instead",clear:"Clear",drawHint:"Draw your signature in the box above.",clearA11y:"Clear signature",typedSignatureA11y:name=>`Typed signature: ${name}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var CLINIC_PICKER_COPY=/* @__PURE__ */Object.freeze({title:CLINIC_REQUEST_COPY.title,titleFor:petName=>{let name=petName?.trim()??"";return name.length>0?`Request ${name}’s records`:CLINIC_REQUEST_COPY.title},leadWeb:"Find the clinic that has them. We send a secure request and read every page they send back.",leadNative:"Find the clinic that has them.",searchLabelWeb:"Find the clinic",howItWorks:"How it works",howSteps:petName=>[{title:"We send a secure request",body:"With your permission, straight to the clinic’s records team."},{title:"The clinic sends the file",body:"Most clinics respond within 3 to 5 business days. We follow up for you."},{title:"Everfur reads every page",body:`Visits, vaccines, labs and prescriptions land in ${petName}’s records.`}],placeholder:CLINIC_REQUEST_COPY.placeholder,searchA11y:CLINIC_REQUEST_COPY.search,clearSearch:"Clear search",loading:"Loading clinics",uploadOwn:"I already have the records",uploadOwnStarting:"Setting up your upload…",noPet:"Add a pet first, then come back to request their records.",recentlyUsed:CLINIC_REQUEST_COPY.recentlyUsed,noMatch:query=>`No clinics match “${query}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:summary=>`Request records from ${summary}`,resultsCount:count=>count===1?"Showing 1 clinic":`Showing ${String(count)} clinics`,fallback:/* @__PURE__ */Object.freeze({title:"Can’t find your clinic?",subtitle:"Add it by email and we’ll request your records.",nameLabel:"Clinic name",namePlaceholder:"Your clinic’s name",emailLabel:"Clinic email",emailPlaceholder:"records@clinic.com",reviewNote:"We review every request by hand before reaching out to the clinic.",submit:"Continue"})});var KM_PER_MILE=1.609344;function milesLabel(km){return km===null||!Number.isFinite(km)?null:(km/KM_PER_MILE).toFixed(1)}function formatClinicDistanceLabel(km){let miles=milesLabel(km);return miles===null?"":`${miles} mi`}var CLINIC_SEARCH_DEBOUNCE_MS=300,CLINIC_SEARCH_MIN_CHARS=2;var RECORDS_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function useClinicPicker(controller,location){let[query,setQueryValue]=react.useState(""),[debouncedQuery,setDebounced]=react.useState(""),[clinics,setClinics]=react.useState([]),[cursor,setCursor]=react.useState(null),[recent,setRecent]=react.useState([]),[recentLoading,setRecentLoading]=react.useState(true),[initialLoading,setInitialLoading]=react.useState(false),[loadingMore,setLoadingMore]=react.useState(false),[error,setError]=react.useState(null),[pageError,setPageError]=react.useState(null),[attempt,setAttempt]=react.useState(0),generation=react.useRef(0),live=react.useRef(true),lat=location?.latitude,lng=location?.longitude,bias=react.useMemo(()=>void 0,[lat,lng]);react.useEffect(()=>(live.current=true,()=>{live.current=false,generation.current+=1}),[controller]),react.useEffect(()=>{let alive=true;return setRecentLoading(true),controller.recentClinics({limit:5}).then(result=>{alive&&(result.ok&&setRecent(result.value.clinics),setRecentLoading(false))}).catch(()=>{alive&&setRecentLoading(false)}),()=>{alive=false}},[controller]),react.useEffect(()=>{let trimmed=query.trim();if(trimmed.length<CLINIC_SEARCH_MIN_CHARS){setDebounced("");return}let handle=setTimeout(()=>setDebounced(trimmed),CLINIC_SEARCH_DEBOUNCE_MS);return()=>clearTimeout(handle)},[query]);let isSearchActive=debouncedQuery.length>=CLINIC_SEARCH_MIN_CHARS;react.useEffect(()=>{let revision=generation.current+=1;if(setClinics([]),setCursor(null),setError(null),setPageError(null),!isSearchActive){setInitialLoading(false);return}setInitialLoading(true),controller.searchClinics({query:debouncedQuery,limit:25,...bias?{location:bias}:{}}).then(result=>{!live.current||revision!==generation.current||(result.ok?(setClinics(result.value.clinics),setCursor(result.value.nextCursor)):setError(result.error),setInitialLoading(false))}).catch(()=>{live.current&&revision===generation.current&&setInitialLoading(false)})},[controller,debouncedQuery,isSearchActive,bias,attempt]);let loadMore=react.useCallback(()=>{if(!isSearchActive||cursor===null||loadingMore)return;let revision=generation.current;setLoadingMore(true),setPageError(null),controller.searchClinics({query:debouncedQuery,limit:25,cursor:cursor,...bias?{location:bias}:{}}).then(result=>{!live.current||revision!==generation.current||(result.ok?(setClinics(current=>[...current,...result.value.clinics]),setCursor(result.value.nextCursor)):setPageError(result.error),setLoadingMore(false))}).catch(()=>{live.current&&revision===generation.current&&setLoadingMore(false)})},[controller,cursor,debouncedQuery,isSearchActive,loadingMore,bias]),setQuery=react.useCallback(value=>setQueryValue(value),[]),retry=react.useCallback(()=>setAttempt(n=>n+1),[]);return react.useMemo(()=>({query:query,debouncedQuery:debouncedQuery,isSearchActive:isSearchActive,clinics:clinics,recent:recent,recentLoading:recentLoading,initialLoading:initialLoading,loadingMore:loadingMore,hasNextPage:cursor!==null,error:error,pageError:pageError,setQuery:setQuery,loadMore:loadMore,retry:retry}),[query,debouncedQuery,isSearchActive,clinics,recent,recentLoading,initialLoading,loadingMore,cursor,error,pageError,setQuery,loadMore,retry])}function clinicDraftFor(clinic,freeText,email,idempotencyKey){/* @__PURE__ */
|
|
102
|
+
return Object.freeze({deviceId:deviceId,provider:provider,platform:platform,installationId:typeof installation=="string"&&installation.length>0?installation:null,registeredAt:registeredAt,lastSeenAt:lastSeenAt})}function parsePreferences(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,updatedAt=str(o.updated_at);return typeof o.push_enabled!="boolean"||typeof o.email_enabled!="boolean"||updatedAt===null?null:/* @__PURE__ */Object.freeze({pushEnabled:o.push_enabled,emailEnabled:o.email_enabled,updatedAt:updatedAt})}function malformed(call){return makeEverfurError("internalError",{retryable:false,wireMessage:`${call}: the response was not the documented shape`})}var ROUTE_REASONS=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function refine(error){return foldWireReason(error,ROUTE_REASONS)}function disposed(verb){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createNotificationsClient(runtime){let over=()=>{let{services:services}=runtime.registry;return createNotificationsClientOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{registerDevice:(input,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("registerDevice"))):over().registerDevice(input,opts),unregisterDevice:(deviceId,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("unregisterDevice"))):over().unregisterDevice(deviceId,opts),setPreferences:(input,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("setPreferences"))):over().setPreferences(input,opts)}}function createNotificationsClientOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async registerDevice(input,opts){let bad=validateRegister(input);if(bad!==null)return err(bad);let body={token:input.token,provider:input.provider,platform:input.platform};input.installationId!==void 0&&(body.installation_id=input.installationId);let res=await funnel.send("notifications.registerDevice",withSignal({method:"POST",path:"/widget/v1/me/devices",body:body},opts?.signal));if(!res.ok)return err(refine(res.error));let device=parseDevice(res.value);return device===null?err(malformed("registerDevice")):ok(device)},async unregisterDevice(deviceId,opts){let bad=validateDeviceId(deviceId);if(bad!==null)return err(bad);let res=await funnel.send("notifications.unregisterDevice",withSignal({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(deviceId)}`},opts?.signal));return res.ok?ok(void 0):err(refine(res.error))},async setPreferences(input,opts){let bad=validatePreferences(input);if(bad!==null)return err(bad);let res=await funnel.send("notifications.setPreferences",withSignal({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:input.pushEnabled,email_enabled:input.emailEnabled}},opts?.signal));if(!res.ok)return err(refine(res.error));let preferences=parsePreferences(res.value);return preferences===null?err(malformed("setPreferences")):ok(preferences)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let int=Math.trunc(n)>>>0,a=int>>>24&255;return{r:int>>>16&255,g:int>>>8&255,b:int&255,a:a===0?1:a/255}}function byte(hex,at){return Number.parseInt(hex.slice(at,at+2),16)}function dup(nibble){return Number.parseInt(`${nibble??"0"}${nibble??"0"}`,16)}function clampByte(n){return Number.isFinite(n)?Math.min(255,Math.max(0,Math.round(n))):null}function rgbToHex(r,g,b){return`#${hex2(r)}${hex2(g)}${hex2(b)}`.toUpperCase()}function hex2(n){return n.toString(16).padStart(2,"0")}var NEAR_BLACK="#111111",WHITE="#FFFFFF",BLACK="#000000";function readableOn(background){let rgba=toRgba(background);if(rgba===null)return WHITE;let bg=relativeLuminance(rgba),black=relativeLuminance({r:17,g:17,b:17}),white=relativeLuminance({r:255,g:255,b:255});return luminanceContrast(bg,white)>=luminanceContrast(bg,black)?WHITE:NEAR_BLACK}function legibleOn(background,target){let first=readableOn(background);return contrastRatio(first,background)>=target?first:contrastRatio(WHITE,background)>=contrastRatio(BLACK,background)?WHITE:BLACK}function poleForGrounds(grounds){let worst=ink=>grounds.reduce((low,ground)=>Math.min(low,contrastRatio(ink,ground)),Number.POSITIVE_INFINITY);return worst(WHITE)>=worst(BLACK)?WHITE:BLACK}function relativeLuminance(rgba){let r=linearize(rgba.r/255),g=linearize(rgba.g/255),b=linearize(rgba.b/255);return.2126*r+.7152*g+.0722*b}function linearize(channel){return channel<=.03928?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function luminanceContrast(l1,l2){let lighter=Math.max(l1,l2),darker=Math.min(l1,l2);return(lighter+.05)/(darker+.05)}function contrastRatio(a,b){let fg=toRgba(a),bg=toRgba(b);if(fg===null||bg===null)return 1;let ground=bg.a>=1?bg:{...bg},fore=fg.a>=1?fg:composite(fg,ground);return luminanceContrast(relativeLuminance(fore),relativeLuminance(ground))}function composite(fg,bg){let a=fg.a,mix2=(f,g)=>Math.round(f*a+g*(1-a));return{r:mix2(fg.r,bg.r),g:mix2(fg.g,bg.g),b:mix2(fg.b,bg.b),a:1}}function flattenOnto(color,background){let fg=toRgba(color),bg=toRgba(background);if(fg===null||bg===null)return null;let out=fg.a>=1?fg:composite(fg,{...bg});return rgbToHex(out.r,out.g,out.b)}function withAlpha(color,alpha){let rgba=toRgba(color);if(rgba===null)return null;let a=Math.min(1,Math.max(0,alpha));return`rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${a})`}var PUSH_STEP=.05;function pushToContrast(color,grounds,pole,target){let first=grounds[0];if(first===void 0)return pole;let reads=candidate=>grounds.every(ground=>contrastRatio(candidate,ground)>=target);if(toRgba(color)===null)return pole;if(reads(color))return color;let flat=flattenOnto(color,first),from=flat===null?null:toRgba(flat),to=toRgba(pole);if(from===null||to===null)return pole;for(let step=1;step<1/PUSH_STEP;step+=1){let t=step*PUSH_STEP,mix2=(a,b)=>Math.round(a+(b-a)*t),candidate=rgbToHex(mix2(from.r,to.r),mix2(from.g,to.g),mix2(from.b,to.b));if(reads(candidate))return candidate}return pole}var DESIGN_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...DESIGN_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;function v3InkOn(fill,inks){for(let ink of inks)if(contrastRatio(ink,fill)>=V3_TEXT_CONTRAST)return ink;return legibleOn(fill,V3_TEXT_CONTRAST)}function mix(color,share,ground){let over=withAlpha(color,share);return(over===null?null:flattenOnto(over,ground))??ground}function askIntroColors(theme){let v=v3Palette(theme),c=theme.color,card=v.card;return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:card,onInk:v.dark?c.background:"#FFFFFF",primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,onAccent:v3InkOn(v.accent,[v.ink,v.onAccent]),accent2:mix(v.accent,.75,card),accent4:mix(v.accent,.17,card),accentChip:mix(v.accent,.47,card),link:v.link,linkChip:mix(v.link,.2,card),riskDot:v.riskDot,riskChip:v.dark?c.badgeBgCritical:"#FFD8D6",clearBg:v.clearBg,clearInk:v.clearInk,clearChip:v.dark?c.badgeBgPositive:"#DDEFC4",byInk:c.brandInk}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}function headingFaceCss(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type,base=faceCss(theme,fallback);return headingFamily===null&&headingWeight===null?base:headingFamily!==null?{fontFamily:cssFontFamily(headingFamily),fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]}:theme.type.namedFaces[fallback]||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function isWebDevelopment(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function askIntroTokens(theme){return{...askIntroColors(theme),sans:faceCss(theme,"regular").fontFamily,serif:headingFaceCss(theme,"bold").fontFamily,mono:cssMonoFamily(theme.type.mono)}}var warned=/* @__PURE__ */new Set;function warnUnknownRule(key){warned.has(key)||!isWebDevelopment()||(warned.add(key),globalThis.console?.warn?.(`[everfur] unknown style rule ${key}`))}var camel=prop=>prop.startsWith("--")?prop:prop.replace(/-([a-z])/g,(_m,ch)=>ch.toUpperCase());function askIntroSx(theme,rules,reduced){let tokens=askIntroTokens(theme),dark=theme.brightness==="dark",fill=value=>value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?tokens.line??whole:`#${key.slice(2)}`:tokens[key]??whole),cache2=/* @__PURE__ */new Map;return(...selectors)=>{let keys=selectors.filter(s=>typeof s=="string"&&s!==""),id=keys.join("|"),hit=cache2.get(id);if(hit!==void 0)return hit;let out={};for(let key of keys){let decls=rules[key];if(decls===void 0){warnUnknownRule(key);continue}for(let[prop,value]of decls)out[camel(prop)]=fill(value);if(theme.motion.reducedMotion)for(let[prop,value]of reduced[key]??[])out[camel(prop)]=fill(value)}let style=/* @__PURE__ */Object.freeze(out);return cache2.set(id,style),style}}function askIntroReset(theme){let tokens=askIntroTokens(theme);return{root:{boxSizing:"border-box",fontFamily:tokens.sans,fontSize:17,lineHeight:1.5,color:tokens.ink,WebkitFontSmoothing:"antialiased",textRendering:"optimizeLegibility",fontVariationSettings:'"SOFT" 0, "WONK" 0',fontVariantLigatures:"no-common-ligatures"},button:{boxSizing:"border-box",font:"inherit",color:"inherit",background:"none",border:0,padding:0,margin:0,cursor:"pointer",textAlign:"inherit",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},text:{margin:0,boxSizing:"border-box"},srOnly:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}}}var CLINIC_REQUEST_COPY=/* @__PURE__ */Object.freeze({title:"Request records",clinic:"Clinic",search:"Search clinics by name or location",placeholder:"Clinic name, city, or ZIP",email:"Clinic email",emailPlaceholder:"records@clinic.com",ownerName:"Your full name",scopeHeading:"What you’re authorizing",send:"Send request",sending:"Sending…",cancel:"Cancel",sign:"Signature",draw:"Draw your signature",type:"Type your name to sign",toType:"Can’t draw? Type your name instead",toDraw:"Draw your signature instead",clear:"Clear",drawHint:"Draw your signature in the box above.",clearA11y:"Clear signature",typedSignatureA11y:name=>`Typed signature: ${name}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var CLINIC_PICKER_COPY=/* @__PURE__ */Object.freeze({title:CLINIC_REQUEST_COPY.title,titleFor:petName=>{let name=petName?.trim()??"";return name.length>0?`Request ${name}’s records`:CLINIC_REQUEST_COPY.title},leadWeb:"Find the clinic that has them. We send a secure request and read every page they send back.",leadNative:"Find the clinic that has them.",searchLabelWeb:"Find the clinic",howItWorks:"How it works",howSteps:petName=>[{title:"We send a secure request",body:"With your permission, straight to the clinic’s records team."},{title:"The clinic sends the file",body:"Most clinics respond within 3 to 5 business days. We follow up for you."},{title:"Everfur reads every page",body:`Visits, vaccines, labs and prescriptions land in ${petName}’s records.`}],placeholder:CLINIC_REQUEST_COPY.placeholder,searchA11y:CLINIC_REQUEST_COPY.search,clearSearch:"Clear search",loading:"Loading clinics",uploadOwn:"I already have the records",uploadOwnStarting:"Setting up your upload…",noPet:"Add a pet first, then come back to request their records.",recentlyUsed:CLINIC_REQUEST_COPY.recentlyUsed,noMatch:query=>`No clinics match “${query}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:summary=>`Request records from ${summary}`,resultsCount:count=>count===1?"Showing 1 clinic":`Showing ${String(count)} clinics`,fallback:/* @__PURE__ */Object.freeze({title:"Can’t find your clinic?",subtitle:"Add it by email and we’ll request your records.",nameLabel:"Clinic name",namePlaceholder:"Your clinic’s name",emailLabel:"Clinic email",emailPlaceholder:"records@clinic.com",reviewNote:"We review every request by hand before reaching out to the clinic.",submit:"Continue"})});var KM_PER_MILE=1.609344;function milesLabel(km){return km===null||!Number.isFinite(km)?null:(km/KM_PER_MILE).toFixed(1)}function formatClinicDistanceLabel(km){let miles=milesLabel(km);return miles===null?"":`${miles} mi`}var CLINIC_SEARCH_DEBOUNCE_MS=300,CLINIC_SEARCH_MIN_CHARS=2;var RECORDS_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function useClinicPicker(controller,location){let[query,setQueryValue]=react.useState(""),[debouncedQuery,setDebounced]=react.useState(""),[clinics,setClinics]=react.useState([]),[cursor,setCursor]=react.useState(null),[recent,setRecent]=react.useState([]),[recentLoading,setRecentLoading]=react.useState(true),[initialLoading,setInitialLoading]=react.useState(false),[loadingMore,setLoadingMore]=react.useState(false),[error,setError]=react.useState(null),[pageError,setPageError]=react.useState(null),[attempt,setAttempt]=react.useState(0),generation=react.useRef(0),live=react.useRef(true),lat=location?.latitude,lng=location?.longitude,bias=react.useMemo(()=>void 0,[lat,lng]);react.useEffect(()=>(live.current=true,()=>{live.current=false,generation.current+=1}),[controller]),react.useEffect(()=>{let alive=true;return setRecentLoading(true),controller.recentClinics({limit:5}).then(result=>{alive&&(result.ok&&setRecent(result.value.clinics),setRecentLoading(false))}).catch(()=>{alive&&setRecentLoading(false)}),()=>{alive=false}},[controller]),react.useEffect(()=>{let trimmed=query.trim();if(trimmed.length<CLINIC_SEARCH_MIN_CHARS){setDebounced("");return}let handle=setTimeout(()=>setDebounced(trimmed),CLINIC_SEARCH_DEBOUNCE_MS);return()=>clearTimeout(handle)},[query]);let isSearchActive=debouncedQuery.length>=CLINIC_SEARCH_MIN_CHARS;react.useEffect(()=>{let revision=generation.current+=1;if(setClinics([]),setCursor(null),setError(null),setPageError(null),!isSearchActive){setInitialLoading(false);return}setInitialLoading(true),controller.searchClinics({query:debouncedQuery,limit:25,...bias?{location:bias}:{}}).then(result=>{!live.current||revision!==generation.current||(result.ok?(setClinics(result.value.clinics),setCursor(result.value.nextCursor)):setError(result.error),setInitialLoading(false))}).catch(()=>{live.current&&revision===generation.current&&setInitialLoading(false)})},[controller,debouncedQuery,isSearchActive,bias,attempt]);let loadMore=react.useCallback(()=>{if(!isSearchActive||cursor===null||loadingMore)return;let revision=generation.current;setLoadingMore(true),setPageError(null),controller.searchClinics({query:debouncedQuery,limit:25,cursor:cursor,...bias?{location:bias}:{}}).then(result=>{!live.current||revision!==generation.current||(result.ok?(setClinics(current=>[...current,...result.value.clinics]),setCursor(result.value.nextCursor)):setPageError(result.error),setLoadingMore(false))}).catch(()=>{live.current&&revision===generation.current&&setLoadingMore(false)})},[controller,cursor,debouncedQuery,isSearchActive,loadingMore,bias]),setQuery=react.useCallback(value=>setQueryValue(value),[]),retry=react.useCallback(()=>setAttempt(n=>n+1),[]);return react.useMemo(()=>({query:query,debouncedQuery:debouncedQuery,isSearchActive:isSearchActive,clinics:clinics,recent:recent,recentLoading:recentLoading,initialLoading:initialLoading,loadingMore:loadingMore,hasNextPage:cursor!==null,error:error,pageError:pageError,setQuery:setQuery,loadMore:loadMore,retry:retry}),[query,debouncedQuery,isSearchActive,clinics,recent,recentLoading,initialLoading,loadingMore,cursor,error,pageError,setQuery,loadMore,retry])}function clinicDraftFor(clinic,freeText,email,idempotencyKey){/* @__PURE__ */
|
|
103
103
|
return Object.freeze({key:clinic?.id??`free:${freeText??""}`,clinic:clinic,freeText:freeText,email:email,idempotencyKey:idempotencyKey})}var STROKE={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};function paths(name){switch(name){case"chat":/* @__PURE__ */
|
|
104
104
|
return jsxRuntime.jsx("path",{...STROKE,strokeLinecap:"butt",strokeWidth:1.7,d:"M5 5.2h14a1.6 1.6 0 0 1 1.6 1.6v8.6a1.6 1.6 0 0 1-1.6 1.6h-8.7l-4.8 3.6v-3.6H5a1.6 1.6 0 0 1-1.6-1.6V6.8A1.6 1.6 0 0 1 5 5.2z"});case"heartcheck":/* @__PURE__ */
|
|
105
105
|
return jsxRuntime.jsxs("g",{...STROKE,strokeWidth:1.8,children:[
|
|
@@ -130,7 +130,7 @@ return jsxRuntime.jsxs("button",{type:"button",role:"radio","aria-checked":on,st
|
|
|
130
130
|
/* @__PURE__ */,jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link",".in-none .in-link")},onClick:()=>setAdding(true),children:text.add})]}):null]}),
|
|
131
131
|
/* @__PURE__ */jsxRuntime.jsx("p",{style:{...reset.text,...sx(".in-p",".in-p--s")},children:text.more}),
|
|
132
132
|
/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",disabled:!ready,style:{...button,...sx(".emb-btn",".emb-btn--block",".in-body .emb-btn",!ready&&".emb-btn[disabled]")},onClick:request,children:text.request}),onUpload===void 0?null:/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link")},onClick:onUpload,children:text.upload})]})}}function consentFrameOver(m){return function({petRef:petRef,petName:petName,draft:draft,ownerName:ownerName,onCaptureSignature:onCaptureSignature,onCreated:onCreated}){/* @__PURE__ */
|
|
133
|
-
return jsxRuntime.jsx(m.EverfurRecordsConsent,{petRef:petRef,...petName===void 0?{}:{petName:petName},clinic:draft,...ownerName===void 0?{}:{ownerName:ownerName},...onCaptureSignature===void 0?{}:{onCaptureSignature:onCaptureSignature},onCreated:onCreated})}}var loading=null;function loadClinicFrames(){return loading===null&&(loading=import("@everfur/sdk/web/records").then(m=>({Clinic:clinicFrameOver(m),Consent:consentFrameOver(m)}),()=>(loading=null,null))),loading}function useClinicFrames(wanted){let[frames,setFrames]=react.useState(null);return react.useEffect(()=>{if(!wanted||frames!==null)return;let live=true;return loadClinicFrames().then(loaded=>{live&&loaded!==null&&setFrames(loaded)}),()=>{live=false}},[wanted,frames]),react.useMemo(()=>frames,[frames])}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`});return copy}healthPlanFocusCopyFor({sex:"female"});var EVERFUR_INTRO_COPY=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(name,sex){let words=healthPlanPetWords(name,sex);return{...words,subj:sex==="female"?"she":sex==="male"?"he":words.name}}var NUMBER_WORDS=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(n){return Number.isInteger(n)&&n>=1&&n<=10?NUMBER_WORDS[n]??null:null}var cap=s=>s===""?s:s.charAt(0).toUpperCase()+s.slice(1);function defaultIntroBlanks(p){return[{before:`Keep ${p.obj} at `,after:" lb",source:`From ${p.poss} vet visits`},{before:`${p.Poss} next shots are due `,after:"",source:`From ${p.poss} clinic`,width:"l"}]}function introFacts(page,petName){let name=page?.pet.name??petName??null,design=page?.page??null,byline=design?.byline?.name?.trim()??"";return{pet:introPetWords(name,page?.pet.sex??null),planTitle:design?.title.trim()??"",vetName:page?.vetReviewed===true&&byline!==""?byline:null,tips:design?.routine?.steps.length??0}}function introText(input){let{facts:facts,copy:copy,resultsPending:resultsPending}=input,p=facts.pet,n=numberWord(input.blanks),tips=numberWord(facts.tips),topic=copy.planTopic.trim(),vet=facts.vetName===null?null:facts.vetName.replace(/ /g," "),planFor=topic===""?"":`One plan for ${p.poss} ${topic}${vet===null?"":`, built with ${vet}`}.`,tipsLine=tips===null?"":`${cap(tips)} tips, one thing to add.`,planRow=resultsPending?`${p.Poss} plan arrives with ${p.poss} results.`:[planFor,tipsLine].filter(s=>s!=="").join(" "),recordsRow=[`What could go wrong for ${p.name}, and what's changed.`,copy.recordsRowMore.trim()].filter(s=>s!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${p.Name}'s tab`,records:`Request ${p.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:copy.eyebrow,title:`${p.Name}'s health, in three tabs.`,lede:resultsPending?copy.pendingLede:copy.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${p.name} any hour (the 2 am ones too).`,plan:planRow,records:recordsRow,next:"Next",seePlan:`See ${p.poss} plan`},ask:{title:copy.askTitle,lede:n===null?"":`${p.Poss} plan has ${n} blanks only ${p.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${input.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${p.poss} vet`,fine:`We send ${p.poss} clinic a secure request and read every page they send back.`,noVet:`${p.Name} doesn't have a vet yet`},clinic:{title:`Where does ${p.name} see ${p.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${p.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${p.subj} sees most.`,request:`Request ${p.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${p.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${p.Poss} records request`,sentStep:"Request sent",sentTo:clinic=>`Today, to ${clinic}`,clinicStep:`${p.Poss} clinic sends ${p.poss} records`,clinicEta:copy.clinicEta,blanksStep:n===null?"":`${p.Poss} ${n} blanks fill in`,blanksDetail:copy.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${p.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:copy.sentFine},noVet:{title:copy.noVetTitle,lede:n===null?"":`When ${p.subj} does, connect ${p.poss} vet in Records and ${p.poss} ${n} blanks fill in.`,seePlan:`See ${p.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${p.name}'s records are in.`,off:`Requested. ${p.Name}'s records will show up here when they're in.`,landed:`${p.Poss} records are in. ${p.Poss} plan now uses ${p.poss} weight and ${p.poss} visits.`},banner:{app:copy.appName,now:"now",title:`${p.Name}'s records are in`,body:copy.bannerBody}}}function keepClinicDraftKey(keys,draft){let clinic=`${draft.key}\n${draft.email}`,kept=keys.get(clinic);return kept===void 0?(keys.set(clinic,draft.idempotencyKey),draft):kept===draft.idempotencyKey?draft:/* @__PURE__ */Object.freeze({...draft,idempotencyKey:kept})}function isIntroSwipeOut(dy,ms){let v=ms>0?Math.abs(dy)/ms:0;return dy>90||dy>12&&v>.11}var EVERFUR_RECORDS_REQUESTED_EVENT="everfur:records-requested",EVERFUR_RECORDS_LANDED_EVENT="everfur:records-landed";function emitRecordsEvent(name,detail){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(name,{detail:detail}))}catch{}}var INTRO_RULES={".serif":[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]],".emb-btn":[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition-property","transform, opacity"],["transition-duration","160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".emb-btn svg":[["width","20px"],["height","20px"]],".emb-btn--block":[["width","100%"]],".emb-btn--ghost":[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]],".emb-btn--sm":[["min-height","40px"],["padding","0 16px"],["font-size","15px"]],".emb-btn--lg":[["min-height","56px"],["padding","0 28px"],["font-size","17px"]],".emb-btn[disabled]":[["opacity",".32"],["pointer-events","none"]],".cp-tag":[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]],".cp-tag--s":[["background","$card"],["color","$ink"]],".sh-track":[["list-style","none"],["margin","0"],["padding","0"]],".sh-track li":[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]],".sh-track li:last-child":[["padding-bottom","0"]],".sh-track li::before":[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]],".sh-track li:last-child::before":[["display","none"]],".sh-track li.is-done:has(+ li.is-done)::before":[["background","$primary"]],".sh-track__dot":[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]],".sh-track__dot svg":[["width","13px"],["height","13px"],["color","$card"]],".sh-track .is-done .sh-track__dot":[["background","$ink"],["box-shadow","none"]],".sh-track .is-now .sh-track__dot":[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]],".sh-track strong":[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]],".sh-track small":[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]],".sh-track li:not(.is-done):not(.is-now) strong":[["color","$ink3"],["font-weight","700"]],".ph-intro":[["position","absolute"],["inset","0"],["z-index","45"]],".in-dim":[["position","absolute"],["left","0"],["right","0"],["background","rgba(38, 37, 35, .5)"],["opacity","0"],["transition-property","opacity"],["transition-duration","240ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".in-dim--top":[["top","0"],["height","var(--in-t, 140px)"]],".in-dim--mid":[["top","var(--in-t, 140px)"],["height","var(--in-h, 46px)"]],".in-dim--bot":[["top","calc(var(--in-t, 140px) + var(--in-h, 46px))"],["bottom","0"]],".ph-intro.is-on .in-dim--top":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on .in-dim--bot":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["opacity","1"],["transition-duration","380ms"]],".in-sheet":[["position","absolute"],["left","0"],["right","0"],["bottom","0"],["max-height","calc(100% - var(--in-t, 140px) - var(--in-h, 46px) - 10px)"],["overflow","hidden auto"],["scrollbar-width","none"],["overscroll-behavior","contain"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 30px"],["box-shadow","0 -10px 30px rgba(38, 37, 35, .14)"],["transform","translateY(100%)"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"],["touch-action","pan-y"]],".ph-intro.is-all .in-sheet":[["max-height","calc(100% - 56px)"]],".ph-intro.is-on .in-sheet":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".in-sheet.is-drag":[["transition-property","none",1],["transition-duration","0s",1],["transition-timing-function","ease",1],["transition-delay","0s",1]],".in-grab":[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 8px"]],".in-top":[["display","flex"],["align-items","center"],["gap","12px"],["min-height","40px"]],".in-back":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"]],".in-x":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"],["margin","0 -10px 0 auto"]],".in-back svg":[["width","22px"],["height","22px"]],".in-x svg":[["width","22px"],["height","22px"]],".in-bars":[["flex","1"],["display","flex"],["gap","6px"]],".in-bars b":[["flex","1"],["height","4px"],["border-radius","2px"],["background","$line"],["overflow","hidden"],["position","relative"]],".in-bars b::after":[["position","absolute"],["inset","0"],["background","$ink"],["border-radius","2px"],["transform","scaleX(0)"],["transform-origin","left"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-bars b.on::after":[["transform","none"]],".in-skip":[["min-height","40px"],["padding","0 4px 0 10px"],["margin-right","-4px"],["font-size","15.5px"],["font-weight","700"],["color","$ink2"],["flex","none"]],'.in-sheet[data-mode="records"] .in-bars':[["display","none"]],'.in-sheet[data-mode="records"] .in-skip':[["display","none"]],'.in-sheet[data-mode="intro"] .in-x':[["display","none"]],'.in-sheet[data-mode="records"] .in-top':[["justify-content","space-between"]],".in-body":[["display","grid"],["gap","14px"],["padding-top","6px"]],".in-eyebrow":[["display","flex"],["align-items","center"],["flex-wrap","wrap"],["gap","4px 8px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".in-by":[["display","inline-flex"],["align-items","center"],["gap","5px"],["text-transform","none"],["letter-spacing","0"],["font-weight","500"],["font-size","13px"]],".in-by svg":[["width","54px"],["height","19px"],["color","$n_10462E"]],".in-h":[["font-size","29px"],["line-height","1.08"],["margin","-2px 0 0"],["outline","none"]],".in-p":[["font-size","16px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]],".in-p--s":[["font-size","15px"]],".in-rows":[["list-style","none"],["margin","2px 0 0"],["padding","0"],["display","grid"],["gap","9px"]],".in-rows li":[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","12px"],["align-items","start"],["background","$paper"],["border-radius","18px"],["padding","13px 14px"]],".in-rows b":[["display","block"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]],".in-rows li > span:last-child > span":[["display","block"],["font-size","15px"],["line-height","1.4"],["color","$ink2"],["text-wrap","pretty"],["margin-top","1px"]],".in-ic":[["width","40px"],["height","40px"],["border-radius","12px"],["display","grid"],["place-items","center"]],".in-ic svg":[["width","22px"],["height","22px"]],".in-ic--y":[["background","$accentChip"]],".in-ic--c":[["background","$linkChip"]],".in-ic--g":[["background","$clearChip"]],".in-rise .in-rows li":[["animation","inRow 260ms cubic-bezier(0.23, 1, 0.32, 1) both"],["animation-delay","calc(560ms + var(--i, 0) * 60ms)"]],".in-pair":[["display","grid"],["grid-template-columns","1fr 1.5fr"],["gap","10px"]],".in-stack":[["display","grid"],["gap","8px"]],".in-body .emb-btn":[["transition-property","transform, opacity"],["transition-duration","120ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".in-fine":[["font-size","13.5px"],["line-height","1.4"],["color","$ink3"],["text-align","center"],["text-wrap","pretty"]],".in-link":[["justify-self","center"],["min-height","40px"],["padding","0 8px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-underline-offset","3px"],["transition-property","transform"],["transition-duration","120ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".blanks":[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]],".blanks__h":[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".blanks__h em":[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$onAccent"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]],'.blanks[data-st="filled"] .blanks__h em':[["background","$clearBg"],["color","$clearInk"]],".blanks ol":[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]],".blanks li":[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]],".blanks li > b":[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"],["background","$accentChip"]],".blanks li > span":[["font-size","16px"],["font-weight","700"],["line-height","1.35"]],".blanks li > small":[["font-size","13.5px"],["color","$ink3"]],".blank":[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]],".blank--s":[["min-width","24px"]],".blank--l":[["min-width","64px"]],'.blanks[data-st="filled"] .blank':[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]],".blank.is-flash":[["animation","blankFlash 900ms ease-out both"],["animation-delay","calc(var(--i, 0) * 80ms)"]],".in-body .blank":[["animation","blankPulse 520ms ease-in-out both"],["animation-delay","calc(300ms + var(--i, 0) * 80ms)"]],".in-search":[["display","flex"],["align-items","center"],["gap","10px"],["height","50px"],["border-radius","14px"],["background","$paper"],["box-shadow","inset 0 0 0 1.5px $ink"],["padding","0 14px"]],".in-search svg":[["width","20px"],["height","20px"],["color","$ink3"],["flex","none"]],".in-search input":[["flex","1"],["min-width","0"],["border","0"],["background","none"],["font","inherit"],["font-size","16px"],["color","$ink"],["outline","none"]],".in-clinics":[["display","grid"],["gap","8px"]],".in-clinic":[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 24px"],["align-items","center"],["gap","10px"],["text-align","left"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["transition-property","transform, background-color, box-shadow"],["transition-duration","120ms, 160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease, ease"],["transition-delay","0s, 0s, 0s"]],".in-clinic b":[["display","block"],["font-size","16px"],["line-height","1.3"]],".in-clinic b .cp-tag":[["margin-left","6px"],["vertical-align","2px"],["box-shadow","inset 0 0 0 1px $line"]],".in-clinic small":[["display","block"],["font-size","14px"],["color","$ink3"],["margin-top","1px"]],'.in-clinic[aria-checked="true"]':[["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"]],".in-tick":[["width","24px"],["height","24px"],["border-radius","50%"],["display","grid"],["place-items","center"],["box-shadow","inset 0 0 0 1.5px $n_CFCBC4"]],".in-tick svg":[["width","14px"],["height","14px"],["color","$card"],["opacity","0"]],'.in-clinic[aria-checked="true"] .in-tick':[["background","$ink"],["box-shadow","none"]],'.in-clinic[aria-checked="true"] .in-tick svg':[["opacity","1"]],".in-none":[["font-size","15px"],["color","$ink2"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["display","grid"],["gap","4px"]],".in-none .in-link":[["justify-self","start"],["padding","0"]],".in-prog":[["display","grid"],["gap","7px"],["font-size","15px"],["color","$ink2"]],".in-prog__bar":[["height","5px"],["border-radius","3px"],["background","$tile"],["overflow","hidden"]],".in-prog__bar i":[["display","block"],["height","100%"],["width","0"],["background","$ink"],["border-radius","3px"],["transition-property","width"],["transition-duration","600ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-sent":[["background","$paper"],["border-radius","20px"],["padding","16px 16px 16px 14px"]],".in-sent .sh-track li":[["padding-bottom","14px"]],".in-sent .sh-track li:last-child":[["padding-bottom","0"]],".in-stack .emb-btn svg":[["width","20px"],["height","20px"]],".ph-banner":[["position","absolute"],["left","10px"],["right","10px"],["top","54px"],["z-index","55"],["display","grid"],["grid-template-columns","38px minmax(0, 1fr)"],["gap","11px"],["align-items","start"],["text-align","left"],["padding","12px 14px"],["border-radius","22px"],["background","rgba(250, 250, 249, .97)"],["box-shadow","0 14px 34px -10px rgba(38, 37, 35, .4), 0 0 0 1px rgba(38, 37, 35, .06)"],["transform","translateY(calc(-100% - 60px))"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".ph-banner.is-on":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".ph-banner__app":[["width","38px"],["height","38px"],["border-radius","10px"],["background","$accent"],["display","grid"],["place-items","center"]],".ph-banner__app svg":[["width","24px"],["height","23px"]],".ph-banner__meta":[["display","flex"],["justify-content","space-between"],["font-size","13px"],["color","$ink3"]],".ph-banner__meta strong":[["font-size","13px"],["font-weight","600"],["color","$ink3"]],".ph-banner__txt > strong":[["display","block"],["font-size","15.5px"],["font-weight","700"],["line-height","1.3"],["margin-top","1px"]],".ph-banner__txt > span:last-child":[["display","block"],["font-size","15px"],["line-height","1.35"],["color","$ink2"]]},INTRO_REDUCED_RULES={".in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".ph-intro.is-on .in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"],["opacity","1"]],".in-sheet.is-drag":[["opacity","1"]],".in-dim":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--top":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--bot":[["transition-duration","150ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["transition-duration","150ms"]],".in-rise .in-rows li":[["animation","none"]],".in-body .blank":[["animation","none"]],".blank.is-flash":[["animation-duration","900ms"]],".ph-banner":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"]],".ph-banner.is-on":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"],["opacity","1"],["visibility","visible"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, ease"],["transition-delay","0s, 0s"]]},EASE_OUT="cubic-bezier(0.23, 1, 0.32, 1)";var INTRO_KEYFRAMES={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function dragBlocked(target,sheet,frame){return frame==="sent"||frame==="consent"||sheet.scrollTop>0?true:target instanceof Element&&target.closest("button, input, textarea, select, a, canvas, label")!==null}var FOCUS_DELAY_MS=60;function focusableHeading(root){let heading=root?.querySelector("h1, h2, h3")??null;return heading!==null&&!heading.hasAttribute("tabindex")&&(heading.tabIndex=-1),heading}function EverfurIntro(props){let{petRef:petRef,onClose:onClose,onClosed:onClosed,onFrame:onFrame}=props,mode=props.mode??"intro",theme=useEverfurTheme(),reduced=theme.motion.reducedMotion,sx=react.useMemo(()=>askIntroSx(theme,INTRO_RULES,INTRO_REDUCED_RULES),[theme]),reset=react.useMemo(()=>askIntroReset(theme),[theme]),tokens=react.useMemo(()=>askIntroTokens(theme),[theme]),{runtime:runtime}=useEverfurContext(),copy=react.useMemo(()=>({...EVERFUR_INTRO_COPY,...props.copy}),[props.copy]),facts=react.useMemo(()=>introFacts(props.page??null,props.petName),[props.page,props.petName]),blanks=react.useMemo(()=>props.blanks??defaultIntroBlanks(facts.pet),[props.blanks,facts.pet]),text=react.useMemo(()=>introText({facts:facts,copy:copy,blanks:blanks.length,resultsPending:props.resultsPending===true}),[facts,copy,blanks.length,props.resultsPending]),[frame,setFrame]=react.useState(mode==="records"?"clinic":"tabs"),[on,setOn]=react.useState(false),[closing,setClosing]=react.useState(false),[dragging,setDragging]=react.useState(false),[draft,setDraft]=react.useState(null),draftKeys=react.useRef(/* @__PURE__ */new Map),[sentTo,setSentTo]=react.useState(""),[busy,setBusy]=react.useState(false),[dims,setDims]=react.useState(null),[host,setHost]=react.useState(null),sheetRef=react.useRef(null),bodyRef=react.useRef(null),titleRef=react.useRef(null),opener=react.useRef(null),frameChange=react.useRef(null),timers=react.useRef([]),titleId=react.useId(),frames=useClinicFrames(frame==="clinic"||frame==="consent"),later=react.useCallback((fn,ms)=>{timers.current.push(setTimeout(fn,ms))},[]);react.useEffect(()=>()=>timers.current.forEach(clearTimeout),[]);let focusTitle=react.useCallback(()=>{later(()=>titleRef.current?.focus({preventScroll:true}),FOCUS_DELAY_MS)},[later]);react.useEffect(()=>{onFrame?.(closing?null:frame)},[frame,closing,onFrame]),react.useEffect(()=>()=>onFrame?.(null),[onFrame]);let covered=props.container??host?.parentElement??null,tabBar=props.tabBar??null;react.useLayoutEffect(()=>{if(covered===null||tabBar===null)return;let place=()=>{let box=covered.getBoundingClientRect(),bar=tabBar.getBoundingClientRect();setDims({t:Math.round(bar.top-box.top),h:Math.round(bar.height)})};return place(),window.addEventListener("resize",place),()=>window.removeEventListener("resize",place)},[covered,tabBar]),react.useEffect(()=>{if(host===null)return;let parent=host.parentElement;opener.current=document.activeElement;let made=[];if(parent!==null)for(let child of Array.from(parent.children))child===host||!(child instanceof HTMLElement)||child.inert||(child.inert=true,made.push(child));let raf=requestAnimationFrame(()=>setOn(true));return focusTitle(),()=>{cancelAnimationFrame(raf);for(let child of made)child.inert=false;let active=document.activeElement,back=opener.current;(active===null||active===document.body||!active.isConnected)&&back instanceof HTMLElement&&back.isConnected&&back.focus({preventScroll:true})}},[host,focusTitle]),react.useLayoutEffect(()=>{if(host===null||reduced||frame!=="tabs")return;let rows=bodyRef.current?.querySelectorAll("li")??[],from=Object.fromEntries((INTRO_KEYFRAMES.inRow?.[0]?.[1]??[]).map(([k,v])=>[k,v]));rows.forEach((row,i)=>{if(typeof row.animate=="function")try{row.animate([from,{opacity:1,transform:"none"}],{duration:260,delay:560+i*60,easing:EASE_OUT,fill:"both"})}catch{}})},[host]),react.useEffect(()=>{if(frame!=="ask"||reduced)return;(bodyRef.current?.querySelectorAll("[data-blank]")??[]).forEach((mark,i)=>{if(typeof mark.animate=="function")try{let rest=tokens.accent4??"";mark.animate([{background:rest},{background:tokens.accent2??rest,offset:.5},{background:rest}],{duration:520,delay:300+i*80,easing:"ease-in-out",fill:"both"})}catch{}})},[frame,reduced,tokens]),react.useLayoutEffect(()=>{let change=frameChange.current;frameChange.current=null;let sheet=sheetRef.current,body2=bodyRef.current;if(!(change===null||sheet===null||body2===null)){sheet.scrollTop=0;try{if(reduced)typeof body2.animate=="function"&&body2.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let h1=sheet.offsetHeight;change.h0!==h1&&typeof sheet.animate=="function"&&sheet.animate([{height:`${change.h0}px`},{height:`${h1}px`}],{duration:240,easing:EASE_OUT}),typeof body2.animate=="function"&&body2.animate([{opacity:0,transform:`translateX(${change.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:EASE_OUT})}}catch{}focusTitle()}},[frame,reduced,focusTitle]);let go=react.useCallback((next,back=false)=>{frameChange.current={h0:sheetRef.current?.offsetHeight??0,back:back},setFrame(next)},[]),close=react.useCallback((exit,toast=null,notifications=null)=>{if(!closing){if(setClosing(true),setOn(false),onClose({exit:exit,toast:toast,notifications:notifications}),exit==="stay"){let back=opener.current;back instanceof HTMLElement&&back.isConnected&&back.focus({preventScroll:true})}later(()=>onClosed?.(),reduced?160:260)}},[closing,onClose,onClosed,later,reduced]),leave=react.useCallback(()=>close(mode==="records"?"stay":"ask"),[close,mode]),hostUpload=props.onUpload,upload=react.useMemo(()=>hostUpload===void 0?void 0:()=>{close("stay"),hostUpload()},[hostUpload,close]),afterSent=react.useCallback(notified=>close("plan",notified?text.toast.on:text.toast.off,notified),[close,text]),notify=react.useCallback(async()=>{if(busy)return;setBusy(true);let turnedOn=false;try{props.onEnableNotifications!==void 0?turnedOn=await props.onEnableNotifications()===!0:turnedOn=(await createNotificationsClient(runtime).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{turnedOn=false}setBusy(false),afterSent(turnedOn)},[busy,props,runtime,afterSent]);react.useEffect(()=>{if(closing)return;let onKey=event=>{event.key!=="Escape"||event.defaultPrevented||(event.preventDefault(),frame==="sent"?afterSent(false):leave())};return document.addEventListener("keydown",onKey),()=>document.removeEventListener("keydown",onKey)},[closing,frame,afterSent,leave]);let drag=react.useRef(null),onPointerDown=event=>{let sheet=sheetRef.current;if(!(drag.current!==null||sheet===null||closing||dragBlocked(event.target,sheet,frame))){drag.current={y:event.clientY,t:performance.now(),dy:0,id:event.pointerId};try{sheet.setPointerCapture(event.pointerId)}catch{}setDragging(true)}},onPointerMove=event=>{let d=drag.current,sheet=sheetRef.current;if(d===null||sheet===null)return;let dy=event.clientY-d.y;d.dy=dy>0?dy:dy/4,sheet.style.transform=`translateY(${d.dy}px)`},endDrag=()=>{let d=drag.current,sheet=sheetRef.current;d!==null&&(drag.current=null,setDragging(false),isIntroSwipeOut(d.dy,performance.now()-d.t)?leave():sheet!==null&&(sheet.style.transform="none"))},onCreated=react.useCallback(request=>{let clinicName=draft===null?"":draft.clinic?.name??draft.freeText??"",event={petRef:petRef,clinicName:clinicName,requestId:request.id,at:/* @__PURE__ */(new Date).toISOString()};setSentTo(clinicName),emitRecordsEvent(EVERFUR_RECORDS_REQUESTED_EVENT,{petRef:event.petRef,requestId:event.requestId,at:event.at}),props.onRequested?.(event),go("sent")},[draft,petRef,props,go]),all=frame!=="tabs",dimVars={"--in-t":`${dims?.t??0}px`,"--in-h":`${dims?.h??0}px`},showBack=frame==="clinic"&&mode!=="records"||frame==="novet"||frame==="consent",showSkip=frame!=="sent",button=reset.button,p=(style,children,focus=false)=>children===""?null:/* @__PURE__ */jsxRuntime.jsx("p",{style:{...reset.text,...style},...focus?{ref:el=>{titleRef.current=el},tabIndex:-1,id:titleId}:{},children:children}),title=words=>words===""?null:/* @__PURE__ */jsxRuntime.jsx("h3",{id:titleId,ref:el=>{titleRef.current=el},tabIndex:-1,style:{...reset.text,...sx(".serif",".in-h")},children:words}),btn=(label,onClick,...rules)=>/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".emb-btn",".in-body .emb-btn",...rules)},onClick:onClick,children:label}),link=(label,onClick)=>/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link")},onClick:onClick,children:label}),eyebrow=words=>{let lockup=theme.meta.hidePoweredBy?null:/* @__PURE__ */jsxRuntime.jsxs("span",{style:sx(".in-by"),children:[text.poweredBy,
|
|
133
|
+
return jsxRuntime.jsx(m.EverfurRecordsConsent,{petRef:petRef,...petName===void 0?{}:{petName:petName},clinic:draft,...ownerName===void 0?{}:{ownerName:ownerName},...onCaptureSignature===void 0?{}:{onCaptureSignature:onCaptureSignature},onCreated:onCreated})}}var loading=null;function loadClinicFrames(){return loading===null&&(loading=import("@everfur/sdk/web/records").then(m=>({Clinic:clinicFrameOver(m),Consent:consentFrameOver(m)}),()=>(loading=null,null))),loading}function useClinicFrames(wanted){let[frames,setFrames]=react.useState(null);return react.useEffect(()=>{if(!wanted||frames!==null)return;let live=true;return loadClinicFrames().then(loaded=>{live&&loaded!==null&&setFrames(loaded)}),()=>{live=false}},[wanted,frames]),react.useMemo(()=>frames,[frames])}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`,todayLabel:`${w.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${w.poss} report`,askReport:"Ask about it",fullOpen:`See ${w.poss} full plan`,fullOpenLine:`${w.Poss} vet, reviews and ${w.poss} checkup`,fullClose:`Show ${w.poss} brief plan`,fullCloseLine:`${w.Poss} risk, tips, pick and signs`,hopeNoted:phrases=>`Noted. When ${w.poss} results land, we'll start with ${phrases}.`,productLink:product=>`${product}, see the product`,productPhotos:product=>`${product} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${w.name}`,ratingLine:count=>`· ${count} reviews`,productOffer:p=>`${p.discountPercent}% off ${w.poss} first box`,productEvery:p=>`Every ${p.intervalDays} days`,productOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:p=>`On ${w.poss} plan, every ${p.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:count=>`${count} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:count=>`Read all ${count} reviews`,starsLabel:rating=>`${rating} out of 5 stars`,buyNow:"Buy now"});return copy}healthPlanFocusCopyFor({sex:"female"});var EVERFUR_INTRO_COPY=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(name,sex){let words=healthPlanPetWords(name,sex);return{...words,subj:sex==="female"?"she":sex==="male"?"he":words.name}}var NUMBER_WORDS=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(n){return Number.isInteger(n)&&n>=1&&n<=10?NUMBER_WORDS[n]??null:null}var cap=s=>s===""?s:s.charAt(0).toUpperCase()+s.slice(1);function defaultIntroBlanks(p){return[{before:`Keep ${p.obj} at `,after:" lb",source:`From ${p.poss} vet visits`},{before:`${p.Poss} next shots are due `,after:"",source:`From ${p.poss} clinic`,width:"l"}]}function introFacts(page,petName){let name=page?.pet.name??petName??null,design=page?.page??null,byline=design?.byline?.name?.trim()??"";return{pet:introPetWords(name,page?.pet.sex??null),planTitle:design?.title.trim()??"",vetName:page?.vetReviewed===true&&byline!==""?byline:null,tips:design?.routine?.steps.length??0}}function introText(input){let{facts:facts,copy:copy,resultsPending:resultsPending}=input,p=facts.pet,n=numberWord(input.blanks),tips=numberWord(facts.tips),topic=copy.planTopic.trim(),vet=facts.vetName===null?null:facts.vetName.replace(/ /g," "),planFor=topic===""?"":`One plan for ${p.poss} ${topic}${vet===null?"":`, built with ${vet}`}.`,tipsLine=tips===null?"":`${cap(tips)} tips, one thing to add.`,planRow=resultsPending?`${p.Poss} plan arrives with ${p.poss} results.`:[planFor,tipsLine].filter(s=>s!=="").join(" "),recordsRow=[`What could go wrong for ${p.name}, and what's changed.`,copy.recordsRowMore.trim()].filter(s=>s!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${p.Name}'s tab`,records:`Request ${p.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:copy.eyebrow,title:`${p.Name}'s health, in three tabs.`,lede:resultsPending?copy.pendingLede:copy.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${p.name} any hour (the 2 am ones too).`,plan:planRow,records:recordsRow,next:"Next",seePlan:`See ${p.poss} plan`},ask:{title:copy.askTitle,lede:n===null?"":`${p.Poss} plan has ${n} blanks only ${p.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${input.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${p.poss} vet`,fine:`We send ${p.poss} clinic a secure request and read every page they send back.`,noVet:`${p.Name} doesn't have a vet yet`},clinic:{title:`Where does ${p.name} see ${p.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${p.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${p.subj} sees most.`,request:`Request ${p.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${p.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${p.Poss} records request`,sentStep:"Request sent",sentTo:clinic=>`Today, to ${clinic}`,clinicStep:`${p.Poss} clinic sends ${p.poss} records`,clinicEta:copy.clinicEta,blanksStep:n===null?"":`${p.Poss} ${n} blanks fill in`,blanksDetail:copy.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${p.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:copy.sentFine},noVet:{title:copy.noVetTitle,lede:n===null?"":`When ${p.subj} does, connect ${p.poss} vet in Records and ${p.poss} ${n} blanks fill in.`,seePlan:`See ${p.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${p.name}'s records are in.`,off:`Requested. ${p.Name}'s records will show up here when they're in.`,landed:`${p.Poss} records are in. ${p.Poss} plan now uses ${p.poss} weight and ${p.poss} visits.`},banner:{app:copy.appName,now:"now",title:`${p.Name}'s records are in`,body:copy.bannerBody}}}function keepClinicDraftKey(keys,draft){let clinic=`${draft.key}\n${draft.email}`,kept=keys.get(clinic);return kept===void 0?(keys.set(clinic,draft.idempotencyKey),draft):kept===draft.idempotencyKey?draft:/* @__PURE__ */Object.freeze({...draft,idempotencyKey:kept})}function isIntroSwipeOut(dy,ms){let v=ms>0?Math.abs(dy)/ms:0;return dy>90||dy>12&&v>.11}var EVERFUR_RECORDS_REQUESTED_EVENT="everfur:records-requested",EVERFUR_RECORDS_LANDED_EVENT="everfur:records-landed";function emitRecordsEvent(name,detail){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(name,{detail:detail}))}catch{}}var INTRO_RULES={".serif":[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]],".emb-btn":[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition-property","transform, opacity"],["transition-duration","160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".emb-btn svg":[["width","20px"],["height","20px"]],".emb-btn--block":[["width","100%"]],".emb-btn--ghost":[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]],".emb-btn--sm":[["min-height","40px"],["padding","0 16px"],["font-size","15px"]],".emb-btn--lg":[["min-height","56px"],["padding","0 28px"],["font-size","17px"]],".emb-btn[disabled]":[["opacity",".32"],["pointer-events","none"]],".cp-tag":[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]],".cp-tag--s":[["background","$card"],["color","$ink"]],".sh-track":[["list-style","none"],["margin","0"],["padding","0"]],".sh-track li":[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]],".sh-track li:last-child":[["padding-bottom","0"]],".sh-track li::before":[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]],".sh-track li:last-child::before":[["display","none"]],".sh-track li.is-done:has(+ li.is-done)::before":[["background","$primary"]],".sh-track__dot":[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]],".sh-track__dot svg":[["width","13px"],["height","13px"],["color","$card"]],".sh-track .is-done .sh-track__dot":[["background","$ink"],["box-shadow","none"]],".sh-track .is-now .sh-track__dot":[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]],".sh-track strong":[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]],".sh-track small":[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]],".sh-track li:not(.is-done):not(.is-now) strong":[["color","$ink3"],["font-weight","700"]],".ph-intro":[["position","absolute"],["inset","0"],["z-index","45"]],".in-dim":[["position","absolute"],["left","0"],["right","0"],["background","rgba(38, 37, 35, .5)"],["opacity","0"],["transition-property","opacity"],["transition-duration","240ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".in-dim--top":[["top","0"],["height","var(--in-t, 140px)"]],".in-dim--mid":[["top","var(--in-t, 140px)"],["height","var(--in-h, 46px)"]],".in-dim--bot":[["top","calc(var(--in-t, 140px) + var(--in-h, 46px))"],["bottom","0"]],".ph-intro.is-on .in-dim--top":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on .in-dim--bot":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["opacity","1"],["transition-duration","380ms"]],".in-sheet":[["position","absolute"],["left","0"],["right","0"],["bottom","0"],["max-height","calc(100% - var(--in-t, 140px) - var(--in-h, 46px) - 10px)"],["overflow","hidden auto"],["scrollbar-width","none"],["overscroll-behavior","contain"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 30px"],["box-shadow","0 -10px 30px rgba(38, 37, 35, .14)"],["transform","translateY(100%)"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"],["touch-action","pan-y"]],".ph-intro.is-all .in-sheet":[["max-height","calc(100% - 56px)"]],".ph-intro.is-on .in-sheet":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".in-sheet.is-drag":[["transition-property","none",1],["transition-duration","0s",1],["transition-timing-function","ease",1],["transition-delay","0s",1]],".in-grab":[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 8px"]],".in-top":[["display","flex"],["align-items","center"],["gap","12px"],["min-height","40px"]],".in-back":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"]],".in-x":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"],["margin","0 -10px 0 auto"]],".in-back svg":[["width","22px"],["height","22px"]],".in-x svg":[["width","22px"],["height","22px"]],".in-bars":[["flex","1"],["display","flex"],["gap","6px"]],".in-bars b":[["flex","1"],["height","4px"],["border-radius","2px"],["background","$line"],["overflow","hidden"],["position","relative"]],".in-bars b::after":[["position","absolute"],["inset","0"],["background","$ink"],["border-radius","2px"],["transform","scaleX(0)"],["transform-origin","left"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-bars b.on::after":[["transform","none"]],".in-skip":[["min-height","40px"],["padding","0 4px 0 10px"],["margin-right","-4px"],["font-size","15.5px"],["font-weight","700"],["color","$ink2"],["flex","none"]],'.in-sheet[data-mode="records"] .in-bars':[["display","none"]],'.in-sheet[data-mode="records"] .in-skip':[["display","none"]],'.in-sheet[data-mode="intro"] .in-x':[["display","none"]],'.in-sheet[data-mode="records"] .in-top':[["justify-content","space-between"]],".in-body":[["display","grid"],["gap","14px"],["padding-top","6px"]],".in-eyebrow":[["display","flex"],["align-items","center"],["flex-wrap","wrap"],["gap","4px 8px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".in-by":[["display","inline-flex"],["align-items","center"],["gap","5px"],["text-transform","none"],["letter-spacing","0"],["font-weight","500"],["font-size","13px"]],".in-by svg":[["width","54px"],["height","19px"],["color","$n_10462E"]],".in-h":[["font-size","29px"],["line-height","1.08"],["margin","-2px 0 0"],["outline","none"]],".in-p":[["font-size","16px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]],".in-p--s":[["font-size","15px"]],".in-rows":[["list-style","none"],["margin","2px 0 0"],["padding","0"],["display","grid"],["gap","9px"]],".in-rows li":[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","12px"],["align-items","start"],["background","$paper"],["border-radius","18px"],["padding","13px 14px"]],".in-rows b":[["display","block"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]],".in-rows li > span:last-child > span":[["display","block"],["font-size","15px"],["line-height","1.4"],["color","$ink2"],["text-wrap","pretty"],["margin-top","1px"]],".in-ic":[["width","40px"],["height","40px"],["border-radius","12px"],["display","grid"],["place-items","center"]],".in-ic svg":[["width","22px"],["height","22px"]],".in-ic--y":[["background","$accentChip"]],".in-ic--c":[["background","$linkChip"]],".in-ic--g":[["background","$clearChip"]],".in-rise .in-rows li":[["animation","inRow 260ms cubic-bezier(0.23, 1, 0.32, 1) both"],["animation-delay","calc(560ms + var(--i, 0) * 60ms)"]],".in-pair":[["display","grid"],["grid-template-columns","1fr 1.5fr"],["gap","10px"]],".in-stack":[["display","grid"],["gap","8px"]],".in-body .emb-btn":[["transition-property","transform, opacity"],["transition-duration","120ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".in-fine":[["font-size","13.5px"],["line-height","1.4"],["color","$ink3"],["text-align","center"],["text-wrap","pretty"]],".in-link":[["justify-self","center"],["min-height","40px"],["padding","0 8px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-underline-offset","3px"],["transition-property","transform"],["transition-duration","120ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".blanks":[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]],".blanks__h":[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".blanks__h em":[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$onAccent"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]],'.blanks[data-st="filled"] .blanks__h em':[["background","$clearBg"],["color","$clearInk"]],".blanks ol":[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]],".blanks li":[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]],".blanks li > b":[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"],["background","$accentChip"]],".blanks li > span":[["font-size","16px"],["font-weight","700"],["line-height","1.35"]],".blanks li > small":[["font-size","13.5px"],["color","$ink3"]],".blank":[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]],".blank--s":[["min-width","24px"]],".blank--l":[["min-width","64px"]],'.blanks[data-st="filled"] .blank':[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]],".blank.is-flash":[["animation","blankFlash 900ms ease-out both"],["animation-delay","calc(var(--i, 0) * 80ms)"]],".in-body .blank":[["animation","blankPulse 520ms ease-in-out both"],["animation-delay","calc(300ms + var(--i, 0) * 80ms)"]],".in-search":[["display","flex"],["align-items","center"],["gap","10px"],["height","50px"],["border-radius","14px"],["background","$paper"],["box-shadow","inset 0 0 0 1.5px $ink"],["padding","0 14px"]],".in-search svg":[["width","20px"],["height","20px"],["color","$ink3"],["flex","none"]],".in-search input":[["flex","1"],["min-width","0"],["border","0"],["background","none"],["font","inherit"],["font-size","16px"],["color","$ink"],["outline","none"]],".in-clinics":[["display","grid"],["gap","8px"]],".in-clinic":[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 24px"],["align-items","center"],["gap","10px"],["text-align","left"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["transition-property","transform, background-color, box-shadow"],["transition-duration","120ms, 160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease, ease"],["transition-delay","0s, 0s, 0s"]],".in-clinic b":[["display","block"],["font-size","16px"],["line-height","1.3"]],".in-clinic b .cp-tag":[["margin-left","6px"],["vertical-align","2px"],["box-shadow","inset 0 0 0 1px $line"]],".in-clinic small":[["display","block"],["font-size","14px"],["color","$ink3"],["margin-top","1px"]],'.in-clinic[aria-checked="true"]':[["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"]],".in-tick":[["width","24px"],["height","24px"],["border-radius","50%"],["display","grid"],["place-items","center"],["box-shadow","inset 0 0 0 1.5px $n_CFCBC4"]],".in-tick svg":[["width","14px"],["height","14px"],["color","$card"],["opacity","0"]],'.in-clinic[aria-checked="true"] .in-tick':[["background","$ink"],["box-shadow","none"]],'.in-clinic[aria-checked="true"] .in-tick svg':[["opacity","1"]],".in-none":[["font-size","15px"],["color","$ink2"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["display","grid"],["gap","4px"]],".in-none .in-link":[["justify-self","start"],["padding","0"]],".in-prog":[["display","grid"],["gap","7px"],["font-size","15px"],["color","$ink2"]],".in-prog__bar":[["height","5px"],["border-radius","3px"],["background","$tile"],["overflow","hidden"]],".in-prog__bar i":[["display","block"],["height","100%"],["width","0"],["background","$ink"],["border-radius","3px"],["transition-property","width"],["transition-duration","600ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-sent":[["background","$paper"],["border-radius","20px"],["padding","16px 16px 16px 14px"]],".in-sent .sh-track li":[["padding-bottom","14px"]],".in-sent .sh-track li:last-child":[["padding-bottom","0"]],".in-stack .emb-btn svg":[["width","20px"],["height","20px"]],".ph-banner":[["position","absolute"],["left","10px"],["right","10px"],["top","54px"],["z-index","55"],["display","grid"],["grid-template-columns","38px minmax(0, 1fr)"],["gap","11px"],["align-items","start"],["text-align","left"],["padding","12px 14px"],["border-radius","22px"],["background","rgba(250, 250, 249, .97)"],["box-shadow","0 14px 34px -10px rgba(38, 37, 35, .4), 0 0 0 1px rgba(38, 37, 35, .06)"],["transform","translateY(calc(-100% - 60px))"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".ph-banner.is-on":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".ph-banner__app":[["width","38px"],["height","38px"],["border-radius","10px"],["background","$accent"],["display","grid"],["place-items","center"]],".ph-banner__app svg":[["width","24px"],["height","23px"]],".ph-banner__meta":[["display","flex"],["justify-content","space-between"],["font-size","13px"],["color","$ink3"]],".ph-banner__meta strong":[["font-size","13px"],["font-weight","600"],["color","$ink3"]],".ph-banner__txt > strong":[["display","block"],["font-size","15.5px"],["font-weight","700"],["line-height","1.3"],["margin-top","1px"]],".ph-banner__txt > span:last-child":[["display","block"],["font-size","15px"],["line-height","1.35"],["color","$ink2"]]},INTRO_REDUCED_RULES={".in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".ph-intro.is-on .in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"],["opacity","1"]],".in-sheet.is-drag":[["opacity","1"]],".in-dim":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--top":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--bot":[["transition-duration","150ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["transition-duration","150ms"]],".in-rise .in-rows li":[["animation","none"]],".in-body .blank":[["animation","none"]],".blank.is-flash":[["animation-duration","900ms"]],".ph-banner":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"]],".ph-banner.is-on":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"],["opacity","1"],["visibility","visible"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, ease"],["transition-delay","0s, 0s"]]},EASE_OUT="cubic-bezier(0.23, 1, 0.32, 1)";var INTRO_KEYFRAMES={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function dragBlocked(target,sheet,frame){return frame==="sent"||frame==="consent"||sheet.scrollTop>0?true:target instanceof Element&&target.closest("button, input, textarea, select, a, canvas, label")!==null}var FOCUS_DELAY_MS=60;function focusableHeading(root){let heading=root?.querySelector("h1, h2, h3")??null;return heading!==null&&!heading.hasAttribute("tabindex")&&(heading.tabIndex=-1),heading}function EverfurIntro(props){let{petRef:petRef,onClose:onClose,onClosed:onClosed,onFrame:onFrame}=props,mode=props.mode??"intro",theme=useEverfurTheme(),reduced=theme.motion.reducedMotion,sx=react.useMemo(()=>askIntroSx(theme,INTRO_RULES,INTRO_REDUCED_RULES),[theme]),reset=react.useMemo(()=>askIntroReset(theme),[theme]),tokens=react.useMemo(()=>askIntroTokens(theme),[theme]),{runtime:runtime}=useEverfurContext(),copy=react.useMemo(()=>({...EVERFUR_INTRO_COPY,...props.copy}),[props.copy]),facts=react.useMemo(()=>introFacts(props.page??null,props.petName),[props.page,props.petName]),blanks=react.useMemo(()=>props.blanks??defaultIntroBlanks(facts.pet),[props.blanks,facts.pet]),text=react.useMemo(()=>introText({facts:facts,copy:copy,blanks:blanks.length,resultsPending:props.resultsPending===true}),[facts,copy,blanks.length,props.resultsPending]),[frame,setFrame]=react.useState(mode==="records"?"clinic":"tabs"),[on,setOn]=react.useState(false),[closing,setClosing]=react.useState(false),[dragging,setDragging]=react.useState(false),[draft,setDraft]=react.useState(null),draftKeys=react.useRef(/* @__PURE__ */new Map),[sentTo,setSentTo]=react.useState(""),[busy,setBusy]=react.useState(false),[dims,setDims]=react.useState(null),[host,setHost]=react.useState(null),sheetRef=react.useRef(null),bodyRef=react.useRef(null),titleRef=react.useRef(null),opener=react.useRef(null),frameChange=react.useRef(null),timers=react.useRef([]),titleId=react.useId(),frames=useClinicFrames(frame==="clinic"||frame==="consent"),later=react.useCallback((fn,ms)=>{timers.current.push(setTimeout(fn,ms))},[]);react.useEffect(()=>()=>timers.current.forEach(clearTimeout),[]);let focusTitle=react.useCallback(()=>{later(()=>titleRef.current?.focus({preventScroll:true}),FOCUS_DELAY_MS)},[later]);react.useEffect(()=>{onFrame?.(closing?null:frame)},[frame,closing,onFrame]),react.useEffect(()=>()=>onFrame?.(null),[onFrame]);let covered=props.container??host?.parentElement??null,tabBar=props.tabBar??null;react.useLayoutEffect(()=>{if(covered===null||tabBar===null)return;let place=()=>{let box=covered.getBoundingClientRect(),bar=tabBar.getBoundingClientRect();setDims({t:Math.round(bar.top-box.top),h:Math.round(bar.height)})};return place(),window.addEventListener("resize",place),()=>window.removeEventListener("resize",place)},[covered,tabBar]),react.useEffect(()=>{if(host===null)return;let parent=host.parentElement;opener.current=document.activeElement;let made=[];if(parent!==null)for(let child of Array.from(parent.children))child===host||!(child instanceof HTMLElement)||child.inert||(child.inert=true,made.push(child));let raf=requestAnimationFrame(()=>setOn(true));return focusTitle(),()=>{cancelAnimationFrame(raf);for(let child of made)child.inert=false;let active=document.activeElement,back=opener.current;(active===null||active===document.body||!active.isConnected)&&back instanceof HTMLElement&&back.isConnected&&back.focus({preventScroll:true})}},[host,focusTitle]),react.useLayoutEffect(()=>{if(host===null||reduced||frame!=="tabs")return;let rows=bodyRef.current?.querySelectorAll("li")??[],from=Object.fromEntries((INTRO_KEYFRAMES.inRow?.[0]?.[1]??[]).map(([k,v])=>[k,v]));rows.forEach((row,i)=>{if(typeof row.animate=="function")try{row.animate([from,{opacity:1,transform:"none"}],{duration:260,delay:560+i*60,easing:EASE_OUT,fill:"both"})}catch{}})},[host]),react.useEffect(()=>{if(frame!=="ask"||reduced)return;(bodyRef.current?.querySelectorAll("[data-blank]")??[]).forEach((mark,i)=>{if(typeof mark.animate=="function")try{let rest=tokens.accent4??"";mark.animate([{background:rest},{background:tokens.accent2??rest,offset:.5},{background:rest}],{duration:520,delay:300+i*80,easing:"ease-in-out",fill:"both"})}catch{}})},[frame,reduced,tokens]),react.useLayoutEffect(()=>{let change=frameChange.current;frameChange.current=null;let sheet=sheetRef.current,body2=bodyRef.current;if(!(change===null||sheet===null||body2===null)){sheet.scrollTop=0;try{if(reduced)typeof body2.animate=="function"&&body2.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let h1=sheet.offsetHeight;change.h0!==h1&&typeof sheet.animate=="function"&&sheet.animate([{height:`${change.h0}px`},{height:`${h1}px`}],{duration:240,easing:EASE_OUT}),typeof body2.animate=="function"&&body2.animate([{opacity:0,transform:`translateX(${change.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:EASE_OUT})}}catch{}focusTitle()}},[frame,reduced,focusTitle]);let go=react.useCallback((next,back=false)=>{frameChange.current={h0:sheetRef.current?.offsetHeight??0,back:back},setFrame(next)},[]),close=react.useCallback((exit,toast=null,notifications=null)=>{if(!closing){if(setClosing(true),setOn(false),onClose({exit:exit,toast:toast,notifications:notifications}),exit==="stay"){let back=opener.current;back instanceof HTMLElement&&back.isConnected&&back.focus({preventScroll:true})}later(()=>onClosed?.(),reduced?160:260)}},[closing,onClose,onClosed,later,reduced]),leave=react.useCallback(()=>close(mode==="records"?"stay":"ask"),[close,mode]),hostUpload=props.onUpload,upload=react.useMemo(()=>hostUpload===void 0?void 0:()=>{close("stay"),hostUpload()},[hostUpload,close]),afterSent=react.useCallback(notified=>close("plan",notified?text.toast.on:text.toast.off,notified),[close,text]),notify=react.useCallback(async()=>{if(busy)return;setBusy(true);let turnedOn=false;try{props.onEnableNotifications!==void 0?turnedOn=await props.onEnableNotifications()===!0:turnedOn=(await createNotificationsClient(runtime).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{turnedOn=false}setBusy(false),afterSent(turnedOn)},[busy,props,runtime,afterSent]);react.useEffect(()=>{if(closing)return;let onKey=event=>{event.key!=="Escape"||event.defaultPrevented||(event.preventDefault(),frame==="sent"?afterSent(false):leave())};return document.addEventListener("keydown",onKey),()=>document.removeEventListener("keydown",onKey)},[closing,frame,afterSent,leave]);let drag=react.useRef(null),onPointerDown=event=>{let sheet=sheetRef.current;if(!(drag.current!==null||sheet===null||closing||dragBlocked(event.target,sheet,frame))){drag.current={y:event.clientY,t:performance.now(),dy:0,id:event.pointerId};try{sheet.setPointerCapture(event.pointerId)}catch{}setDragging(true)}},onPointerMove=event=>{let d=drag.current,sheet=sheetRef.current;if(d===null||sheet===null)return;let dy=event.clientY-d.y;d.dy=dy>0?dy:dy/4,sheet.style.transform=`translateY(${d.dy}px)`},endDrag=()=>{let d=drag.current,sheet=sheetRef.current;d!==null&&(drag.current=null,setDragging(false),isIntroSwipeOut(d.dy,performance.now()-d.t)?leave():sheet!==null&&(sheet.style.transform="none"))},onCreated=react.useCallback(request=>{let clinicName=draft===null?"":draft.clinic?.name??draft.freeText??"",event={petRef:petRef,clinicName:clinicName,requestId:request.id,at:/* @__PURE__ */(new Date).toISOString()};setSentTo(clinicName),emitRecordsEvent(EVERFUR_RECORDS_REQUESTED_EVENT,{petRef:event.petRef,requestId:event.requestId,at:event.at}),props.onRequested?.(event),go("sent")},[draft,petRef,props,go]),all=frame!=="tabs",dimVars={"--in-t":`${dims?.t??0}px`,"--in-h":`${dims?.h??0}px`},showBack=frame==="clinic"&&mode!=="records"||frame==="novet"||frame==="consent",showSkip=frame!=="sent",button=reset.button,p=(style,children,focus=false)=>children===""?null:/* @__PURE__ */jsxRuntime.jsx("p",{style:{...reset.text,...style},...focus?{ref:el=>{titleRef.current=el},tabIndex:-1,id:titleId}:{},children:children}),title=words=>words===""?null:/* @__PURE__ */jsxRuntime.jsx("h3",{id:titleId,ref:el=>{titleRef.current=el},tabIndex:-1,style:{...reset.text,...sx(".serif",".in-h")},children:words}),btn=(label,onClick,...rules)=>/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".emb-btn",".in-body .emb-btn",...rules)},onClick:onClick,children:label}),link=(label,onClick)=>/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link")},onClick:onClick,children:label}),eyebrow=words=>{let lockup=theme.meta.hidePoweredBy?null:/* @__PURE__ */jsxRuntime.jsxs("span",{style:sx(".in-by"),children:[text.poweredBy,
|
|
134
134
|
/* @__PURE__ */jsxRuntime.jsx(EverfurWordmark,{style:sx(".in-by svg")})]});return words===""&&lockup===null?null:/* @__PURE__ */jsxRuntime.jsxs("p",{style:{...reset.text,...sx(".in-eyebrow")},children:[words,lockup]})},body=null;if(frame==="tabs"){let rows=[["ask","chat",".in-ic--y",props.tabLabels?.ask??"Ask",text.tabs.ask],["plan","heartcheck",".in-ic--c",props.tabLabels?.plan??"Health Plan",text.tabs.plan],["records","file",".in-ic--g",props.tabLabels?.records??"Records",text.tabs.records]];body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[eyebrow(text.tabs.eyebrow),title(text.tabs.title),p(sx(".in-p"),text.tabs.lede),
|
|
135
135
|
/* @__PURE__ */jsxRuntime.jsx("ul",{style:sx(".in-rows"),children:rows.map(([key,icon,tint,label,line])=>/* @__PURE__ */jsxRuntime.jsxs("li",{style:sx(".in-rows li"),children:[
|
|
136
136
|
/* @__PURE__ */jsxRuntime.jsx("span",{style:sx(".in-ic",tint),children:/* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:icon,style:sx(".in-ic svg")})}),
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { H as HealthPlanPage } from '../../focus.d-
|
|
3
|
+
import { H as HealthPlanPage } from '../../focus.d-HSkMHd-i.cjs';
|
|
4
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
|
|
5
5
|
import { C as CaptureRecordsSignature } from '../../clinicRequestProps.d-1dCtouGA.cjs';
|
|
6
|
-
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-
|
|
7
|
-
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-
|
|
6
|
+
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-Cwv72ER-.cjs';
|
|
7
|
+
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-Cwv72ER-.cjs';
|
|
8
8
|
import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../../useIntroSeen.d-CTWFUthO.cjs';
|
|
9
9
|
export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../../useIntroSeen.d-CTWFUthO.cjs';
|
|
10
10
|
export { E as EVERFUR_RECORDS_LANDED_EVENT, a as EVERFUR_RECORDS_REQUESTED_EVENT } from '../../introEvents.d-dS3fJCH1.cjs';
|
|
11
11
|
import '../../EverfurError.d-8NHtlgzA.cjs';
|
|
12
12
|
import '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
13
|
-
import '../../requestFunnel.d-
|
|
13
|
+
import '../../requestFunnel.d-CWI2pD3V.cjs';
|
|
14
14
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
15
|
-
import '../../config.d-
|
|
16
|
-
import '../../identity.d-
|
|
15
|
+
import '../../config.d-7bCXvOGn.cjs';
|
|
16
|
+
import '../../identity.d-84x0dV7-.cjs';
|
|
17
17
|
import '../../clinicModels.d-BXgKZqDb.cjs';
|
|
18
18
|
import '../../models.d-BSqvbTE1.cjs';
|
|
19
19
|
|
|
@@ -59,7 +59,7 @@ interface EverfurIntroProps {
|
|
|
59
59
|
/** The consent step's owner name, and your own signature capture. */
|
|
60
60
|
readonly ownerName?: string;
|
|
61
61
|
readonly onCaptureSignature?: CaptureRecordsSignature;
|
|
62
|
-
/** The tab labels frame 1's rows carry. Defaults to
|
|
62
|
+
/** The tab labels frame 1's rows carry. Defaults to the design's: Ask, Health Plan, Records. */
|
|
63
63
|
readonly tabLabels?: EverfurIntroTabLabels;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -70,7 +70,7 @@ declare const RECORDS_BANNER_MS = 6000;
|
|
|
70
70
|
interface EverfurRecordsLandedBannerProps {
|
|
71
71
|
/** The banner's lines (`introText(...).banner`). */
|
|
72
72
|
readonly text: IntroText['banner'];
|
|
73
|
-
/** The partner's app tile (his
|
|
73
|
+
/** The partner's app tile (his partner mark). Absent: the tile is drawn plain, in the accent colour. */
|
|
74
74
|
readonly icon?: ReactNode;
|
|
75
75
|
/** Tapped, or its six seconds ran out: land the records (open the Health Plan, say they are in). */
|
|
76
76
|
readonly onLand: () => void;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { H as HealthPlanPage } from '../../focus.d-
|
|
3
|
+
import { H as HealthPlanPage } from '../../focus.d-DiWvQR2j.js';
|
|
4
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.js';
|
|
5
5
|
import { C as CaptureRecordsSignature } from '../../clinicRequestProps.d-CjsMg_OD.js';
|
|
6
|
-
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-
|
|
7
|
-
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-
|
|
6
|
+
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-DYU3znJs.js';
|
|
7
|
+
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-DYU3znJs.js';
|
|
8
8
|
import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../../useIntroSeen.d-CTWFUthO.js';
|
|
9
9
|
export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../../useIntroSeen.d-CTWFUthO.js';
|
|
10
10
|
export { E as EVERFUR_RECORDS_LANDED_EVENT, a as EVERFUR_RECORDS_REQUESTED_EVENT } from '../../introEvents.d-dS3fJCH1.js';
|
|
11
11
|
import '../../EverfurError.d-8NHtlgzA.js';
|
|
12
12
|
import '../../EverfurResult.d-D_-254ZY.js';
|
|
13
|
-
import '../../requestFunnel.d-
|
|
13
|
+
import '../../requestFunnel.d-DcQIAs45.js';
|
|
14
14
|
import '../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
15
|
-
import '../../config.d-
|
|
16
|
-
import '../../identity.d-
|
|
15
|
+
import '../../config.d-cqyvpzDb.js';
|
|
16
|
+
import '../../identity.d-BXztMVYM.js';
|
|
17
17
|
import '../../clinicModels.d-CaS64-P-.js';
|
|
18
18
|
import '../../models.d-DOwnr8fi.js';
|
|
19
19
|
|
|
@@ -59,7 +59,7 @@ interface EverfurIntroProps {
|
|
|
59
59
|
/** The consent step's owner name, and your own signature capture. */
|
|
60
60
|
readonly ownerName?: string;
|
|
61
61
|
readonly onCaptureSignature?: CaptureRecordsSignature;
|
|
62
|
-
/** The tab labels frame 1's rows carry. Defaults to
|
|
62
|
+
/** The tab labels frame 1's rows carry. Defaults to the design's: Ask, Health Plan, Records. */
|
|
63
63
|
readonly tabLabels?: EverfurIntroTabLabels;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -70,7 +70,7 @@ declare const RECORDS_BANNER_MS = 6000;
|
|
|
70
70
|
interface EverfurRecordsLandedBannerProps {
|
|
71
71
|
/** The banner's lines (`introText(...).banner`). */
|
|
72
72
|
readonly text: IntroText['banner'];
|
|
73
|
-
/** The partner's app tile (his
|
|
73
|
+
/** The partner's app tile (his partner mark). Absent: the tile is drawn plain, in the accent colour. */
|
|
74
74
|
readonly icon?: ReactNode;
|
|
75
75
|
/** Tapped, or its six seconds ran out: land the records (open the Health Plan, say they are in). */
|
|
76
76
|
readonly onLand: () => void;
|