@everfur/sdk 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +220 -0
- package/README.md +9 -8
- package/dist/{Chat-BZZ-Py5l.d.ts → Chat-Rzplrf5M.d.ts} +17 -3
- package/dist/{Chat-Dq4fffIO.d.cts → Chat-ypo6miKm.d.cts} +17 -3
- package/dist/{DepthViews-BG3E25MD.d.ts → DepthViews-CeTfPUBX.d.ts} +1 -1
- package/dist/{DepthViews-B_hIypI6.d.cts → DepthViews-ClykXOJj.d.cts} +1 -1
- package/dist/{DepthViews-CL75jyRA.d.cts → DepthViews-Cui3oonj.d.cts} +1 -1
- package/dist/{DepthViews-CkYri51q.d.ts → DepthViews-baYLMNQ-.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-CwbfmxzJ.d.ts → ErrorPolicyPort-D22LUVrK.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-CNf4uQZP.d.cts → ErrorPolicyPort-D6CybiqJ.d.cts} +1 -1
- package/dist/{EverfurResult-DN9pL2Ab.d.cts → EverfurError-DmELDpXp.d.cts} +1 -67
- package/dist/{EverfurResult-DN9pL2Ab.d.ts → EverfurError-DmELDpXp.d.ts} +1 -67
- package/dist/EverfurResult-SGvHKsCB.d.ts +69 -0
- package/dist/EverfurResult-ZtH-YV1h.d.cts +69 -0
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +6 -5
- package/dist/animations/index.d.ts +6 -5
- package/dist/animations/index.js +1 -1
- package/dist/{attachments-D_SECjr1.d.cts → attachments-CwsR-bPN.d.cts} +7 -6
- package/dist/{attachments-BrUWQYNK.d.ts → attachments-CzZ7in24.d.ts} +7 -6
- package/dist/{attachments-DpldrvIW.d.ts → attachments-D3HCBmOE.d.ts} +3 -3
- package/dist/{attachments-BorG422I.d.cts → attachments-Nk73Lll8.d.cts} +3 -3
- package/dist/{bookingCopy-SREvkG19.d.cts → bookingCopy-Dv8rKqyV.d.cts} +417 -14
- package/dist/{bookingCopy-CqtDYvCR.d.ts → bookingCopy-SDkXaxDf.d.ts} +417 -14
- package/dist/branding-Xb_wL8N1.d.cts +212 -0
- package/dist/branding-xpQ056sM.d.ts +212 -0
- package/dist/callCopy-rDH9JTFo.d.cts +45 -0
- package/dist/callCopy-rDH9JTFo.d.ts +45 -0
- package/dist/callRoom-7wrE3RP2.d.ts +62 -0
- package/dist/callRoom-B_EqaUzx.d.cts +62 -0
- package/dist/{casesRepository-v6QczS9N.d.ts → casesRepository-BTAecTnF.d.ts} +14 -2
- package/dist/{casesRepository-DwtZVsbj.d.cts → casesRepository-aryld7fJ.d.cts} +14 -2
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.d.cts +12 -11
- package/dist/chat/index.d.ts +12 -11
- package/dist/chat/index.js +1 -1
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.d.cts +14 -12
- package/dist/client/index.d.ts +14 -12
- package/dist/client/index.js +5 -5
- package/dist/{config-C7eb_IMD.d.ts → config-6qS7Sohy.d.cts} +3 -2
- package/dist/{config--Wu1Umhd.d.cts → config-X6BtwDwQ.d.ts} +3 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +9 -8
- package/dist/consent/index.d.ts +9 -8
- package/dist/consent/index.js +1 -1
- package/dist/{context-CahAEha8.d.ts → context-7f3Nb_xE.d.ts} +9 -8
- package/dist/{context-CL3lyuy1.d.cts → context-CkqPM4Ml.d.cts} +9 -8
- package/dist/{copy-UeUJVk8X.d.cts → copy-Bd__Pw5s.d.cts} +5 -4
- package/dist/{copy-DdVFDL01.d.ts → copy-NgKgOOET.d.ts} +5 -4
- package/dist/core/index.cjs +9 -9
- package/dist/core/index.d.cts +19 -17
- package/dist/core/index.d.ts +19 -17
- package/dist/core/index.js +9 -9
- package/dist/{depth-DvPwPuT_.d.ts → depth-CYPH92jE.d.ts} +6 -5
- package/dist/{depth-D5HwcvKC.d.cts → depth-CyjaJJ6V.d.cts} +6 -5
- package/dist/{entitlementRepository-B7egEdW6.d.ts → entitlementRepository-DdeFuEKp.d.ts} +4 -4
- package/dist/{entitlementRepository-BpJ7tiwl.d.cts → entitlementRepository-Dl1qRLcJ.d.cts} +4 -4
- package/dist/{identity-C2-08BZW.d.cts → identity-DjqhDm5Z.d.cts} +2 -2
- package/dist/{identity-CEi9GRFZ.d.ts → identity-Dy_L7Yq4.d.ts} +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +19 -17
- package/dist/index.d.ts +19 -17
- package/dist/index.js +6 -6
- package/dist/{models-D2EUxPZY.d.cts → models-Bn2z0NNo.d.cts} +1 -1
- package/dist/{models-B-Uh2LTf.d.ts → models-DSqA5Ahs.d.ts} +1 -1
- package/dist/notifications/index.cjs +2 -2
- package/dist/notifications/index.d.cts +5 -4
- package/dist/notifications/index.d.ts +5 -4
- package/dist/notifications/index.js +2 -2
- package/dist/{pets-JVCXgRgR.d.cts → pets-BSG2qbr_.d.cts} +2 -2
- package/dist/{pets-DJv2sj2H.d.ts → pets-D7cZutrX.d.ts} +2 -2
- package/dist/{petsRepository-B_gKbAzJ.d.cts → petsRepository-D1bnxDZg.d.cts} +2 -2
- package/dist/{petsRepository-Bk6GDwLs.d.ts → petsRepository-DhsX3GLw.d.ts} +2 -2
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.d.cts +3 -2
- package/dist/photo/index.d.ts +3 -2
- package/dist/photo/index.js +1 -1
- package/dist/{ports-D7YW8qz9.d.ts → ports-C0m1G1fS.d.ts} +13 -6
- package/dist/{ports-BY2ph0_y.d.cts → ports-DNXyyzZF.d.cts} +13 -6
- package/dist/records/depth/index.cjs +2 -2
- package/dist/records/depth/index.d.cts +11 -10
- package/dist/records/depth/index.d.ts +11 -10
- package/dist/records/depth/index.js +2 -2
- package/dist/records/index.cjs +3 -3
- package/dist/records/index.d.cts +25 -14
- package/dist/records/index.d.ts +25 -14
- package/dist/records/index.js +3 -3
- package/dist/{requestFunnel-BjDpqqvm.d.cts → requestFunnel-Bqc1inM9.d.cts} +5 -4
- package/dist/{requestFunnel-DFMGcluw.d.ts → requestFunnel-FvE5yLDD.d.ts} +5 -4
- package/dist/{runtimeTypes-w5KqBMcs.d.ts → runtimeTypes-C0yPBz89.d.ts} +7 -7
- package/dist/{runtimeTypes-gZEJu-da.d.cts → runtimeTypes-RN-VXTFV.d.cts} +7 -7
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +4 -3
- package/dist/server/events/index.d.ts +4 -3
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +5 -4
- package/dist/server/index.d.ts +5 -4
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.cjs +1 -1
- package/dist/televet/booking/index.d.cts +310 -32
- package/dist/televet/booking/index.d.ts +310 -32
- package/dist/televet/booking/index.js +1 -1
- package/dist/televet/call/index.cjs +1 -1
- package/dist/televet/call/index.d.cts +25 -5
- package/dist/televet/call/index.d.ts +25 -5
- package/dist/televet/call/index.js +1 -1
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.d.cts +41 -71
- package/dist/televet/index.d.ts +41 -71
- package/dist/televet/index.js +1 -1
- package/dist/televetGlobal-CEk0_cW9.d.cts +34 -0
- package/dist/televetGlobal-Cs9Wbqsy.d.ts +34 -0
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +3 -2
- package/dist/testing/index.d.ts +3 -2
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +13 -11
- package/dist/testing/rn/index.d.ts +13 -11
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +14 -13
- package/dist/testing/web/index.d.ts +14 -13
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-C15jxFFH.d.ts → timelineRows-D4U6A8zE.d.ts} +1 -1
- package/dist/{timelineRows-odO8g9r2.d.cts → timelineRows-DAB5dpjF.d.cts} +1 -1
- package/dist/{branding-CsRdeNwK.d.cts → tokens-CIngRkvt.d.cts} +7 -211
- package/dist/{branding-CsRdeNwK.d.ts → tokens-CIngRkvt.d.ts} +7 -211
- package/dist/{typeStyle-DmoyacDG.d.ts → typeStyle-DHJzDaUo.d.cts} +2 -1
- package/dist/{typeStyle-CKqVYD6L.d.cts → typeStyle-YPS_MXeI.d.ts} +2 -1
- package/dist/{useRecordsDepth-crhBllQK.d.ts → useRecordsDepth--ObtMyjH.d.ts} +24 -5
- package/dist/{useRecordsDepth-C6rjEaLn.d.cts → useRecordsDepth-B35y8bV-.d.cts} +24 -5
- package/dist/{useVetVisit-CjmMa896.d.ts → useVetVisit-BsjoDO-n.d.ts} +21 -6
- package/dist/{useVetVisit-Bc84hWUU.d.cts → useVetVisit-Ds8f1peV.d.cts} +21 -6
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.cts +3 -2
- package/dist/video/index.d.ts +3 -2
- package/dist/video/index.js +1 -1
- package/dist/{view-DyitEO0m.d.cts → view-B-Toym_j.d.cts} +5 -4
- package/dist/{view-Bxwxp4xD.d.ts → view-D9JqNQai.d.ts} +5 -4
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +9 -8
- package/dist/web/consent/index.d.ts +9 -8
- package/dist/web/consent/index.js +1 -1
- package/dist/web/index.cjs +10 -10
- package/dist/web/index.d.cts +42 -19
- package/dist/web/index.d.ts +42 -19
- package/dist/web/index.js +10 -10
- package/dist/web/notifications/index.cjs +2 -2
- package/dist/web/notifications/index.d.cts +7 -6
- package/dist/web/notifications/index.d.ts +7 -6
- package/dist/web/notifications/index.js +2 -2
- package/dist/web/records/depth/index.cjs +2 -2
- package/dist/web/records/depth/index.d.cts +11 -10
- package/dist/web/records/depth/index.d.ts +11 -10
- package/dist/web/records/depth/index.js +2 -2
- package/dist/web/records/index.cjs +3 -3
- package/dist/web/records/index.d.cts +53 -35
- package/dist/web/records/index.d.ts +53 -35
- package/dist/web/records/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +2 -1
- package/dist/web/televet/booking/index.d.cts +458 -33
- package/dist/web/televet/booking/index.d.ts +458 -33
- package/dist/web/televet/booking/index.js +2 -1
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.d.cts +3 -1
- package/dist/web/televet/call/index.d.ts +3 -1
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.d.cts +40 -74
- package/dist/web/televet/index.d.ts +40 -74
- package/dist/web/televet/index.js +1 -1
- package/package.json +3 -2
- package/dist/callCopy-DoQKG3-L.d.cts +0 -40
- package/dist/callCopy-DoQKG3-L.d.ts +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var react=require('react'),reactNative=require('react-native'),reactNativeSafeAreaContext=require('react-native-safe-area-context'),jsxRuntime=require('react/jsx-runtime');var fr=Object.defineProperty;var n=(e,r)=>fr(e,"name",{value:r,configurable:true});var yr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function y(e,r){let t=e.type,a=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:a}:{fontFamily:a,fontWeight:t.weight[yr[r]]}}n(y,"face");var De=Object.freeze({track(){},trackExpectedFailure(){}});function Fe(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}n(Fe,"isSafeRoomUrl");function te(e,r){return Fe(e)&&r.trim().length>0}n(te,"isUsableRoomCredential");function Le(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n(Le,"reportHostFailure");function mr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(mr,"isThenable");function ne(e,...r){if(typeof e=="function")try{let t=e(...r);return mr(t)&&Promise.resolve(t).then(void 0,Le),t}catch(t){Le(t);return}}n(ne,"callHost");var Ve=new WeakMap;function pr(e){if(typeof e!="function")return;let r=Ve.get(e);if(r!==void 0)return r;let t=n((...a)=>{ne(e,...a);},"guarded");return Ve.set(e,t),t}n(pr,"guardHost");function Oe(e,r){let t=null;for(let a of r){let o=e[a];typeof o=="function"&&(t??={...e},t[a]=pr(o));}return t??e}n(Oe,"guardHostProps");var A=10,l=Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:n(e=>{let r=e?.trim()??"";return r.length>0?`${r} is joining`:l.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:n(e=>{let r=e?.trim()??"";return r.length>0?`Have ${r} nearby and somewhere well lit.`:l.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:n(e=>`${e} MINUTE VISIT`,"lobbyDuration"),joinFailedReason:"That did not open. Try again."});function Ie(e){let r=Math.max(0,Math.floor(e/1e3)),t=String(r%60).padStart(2,"0"),a=Math.floor(r%3600/60),o=Math.floor(r/3600);return o>0?`${o}:${String(a).padStart(2,"0")}:${t}`:`${a}:${t}`}n(Ie,"formatElapsed");function le(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))le(e[r]);}return e}n(le,"deepFreeze");var gr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Pe={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Me={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ae={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},br={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},vr={regular:"400",medium:"500",bold:"700"},Tr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},hr=0,z="System",j="monospace",Er=["content","heading","control","compact","badge"];function Cr(e){let r={};for(let t of Er)r[t]=e;return r}n(Cr,"authoredTierSizes");function Be(){return {family:z,mono:j,fontUrl:null,families:{regular:z,medium:z,bold:z,mono:j,monoMedium:j,monoBold:j},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ae,tierSizes:Cr(Ae),lineHeight:br,weight:vr,letterSpacing:Tr,scale:1,maxScale:hr,scaleCaps:gr}}n(Be,"baseType");var Ne={},oe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ae(e){return `cubic-bezier(${e.join(", ")})`}n(ae,"cssCubicBezier");var _e={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ae(oe.standard),emphasized:ae(oe.emphasized),exit:ae(oe.exit)},reducedMotion:false},xr={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ze=le({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:xr,space:Pe,radius:Me,type:Be(),motion:_e,slots:Ne}),kr={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};le({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:kr,space:Pe,radius:Me,type:Be(),motion:_e,slots:Ne});var je=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),He=globalThis,ie=He[je]??(He[je]=react.createContext(ze));ie.displayName??="EverfurThemeContext";function k(){return react.useContext(ie)}n(k,"useEverfurTheme");function Lr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}n(Lr,"tierMultiplier");function m({tier:e="content",...r}){let{type:t}=k(),a=Lr(t,e);return react.createElement(reactNative.Text,a===void 0?r:{maxFontSizeMultiplier:a,...r})}n(m,"Text");react.forwardRef(n(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function We(e,r,t){let a;try{a=r();}catch(p){return se(`optional peer '${e}' is not installed: ${Or(p)}`)}let o=Vr(a);return o==null?se(`optional peer '${e}' resolved to no module`):t&&!t(o)?se(`optional peer '${e}' is present but failed its shape check`):Object.freeze({available:true,module:o})}n(We,"optionalModule");function Vr(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}n(Vr,"unwrapDefault");function se(e){return Object.freeze({available:false,module:null,reason:e})}n(se,"frozenUnavailable");function Or(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}n(Or,"describe");var de="[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then, fall back to VetVisitButton, which opens the visit in the browser and needs no native module.",ue="@daily-co/react-native-daily-js",Ir=`optional peer '${ue}' has no registered loader`,Ge=`optional peer '${ue}' is present but failed its shape check`;function U(e){return typeof e=="object"&&e!==null}n(U,"isRecordLike");function Ar(e){return U(e)&&"box"in e}n(Ar,"isDailyBox");function Pr(e){let r=U(e.default)?e.default:{},t=e.createCallObject??r.createCallObject,a=e.DailyMediaView??r.DailyMediaView,o={createCallObject:t,DailyMediaView:a};return $e(o)?o:null}n(Pr,"normalizeDailyModule");function $e(e){if(!U(e)||typeof e.createCallObject!="function")return false;let r=e.DailyMediaView;return typeof r=="function"||typeof r=="object"&&r!==null}n($e,"isEverfurDailyModule");var Ye=null,g=null;function H(e){return Object.freeze({available:false,module:null,reason:e})}n(H,"unavailable");function Mr(e){Ye=e,g=null;}n(Mr,"registerEverfurDaily");function ce(){if(g!==null)return g;let e=Ye;if(e===null)return g=H(Ir),g;let r=We(ue,()=>({box:e()}),Ar);if(!r.available)return g=H(r.reason),g;let t=r.module.box;if(!U(t))return g=H(Ge),g;let a=Pr(t);return g=a===null?H(Ge):Object.freeze({available:true,module:a}),g}n(ce,"loadEverfurDaily");var v=Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),Ke=3,Xe=180,Ze=420,qe=.35,Ur=.6,Wr=360,Gr=132,$r=184,Yr=44;function Kr({reducedMotion:e,styles:r}){let t=react.useRef(Array.from({length:Ke},()=>new reactNative.Animated.Value(qe))).current;return react.useEffect(()=>{if(e)return;let a=t.map((o,p)=>reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.delay(p*Xe),reactNative.Animated.timing(o,{toValue:1,duration:Ze,useNativeDriver:true}),reactNative.Animated.timing(o,{toValue:qe,duration:Ze,useNativeDriver:true}),reactNative.Animated.delay((Ke-p-1)*Xe)])));for(let o of a)o.start();return ()=>{for(let o of a)o.stop();}},[e,t]),jsxRuntime.jsx(reactNative.View,{style:r.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:t.map((a,o)=>jsxRuntime.jsx(reactNative.Animated.View,{style:[r.dot,{opacity:e?Ur:a}]},o))})}n(Kr,"WaitingDots");function Je({label:e,active:r,onPress:t,testID:a,styles:o}){return jsxRuntime.jsx(reactNative.Pressable,{onPress:t,testID:a,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[o.control,r?null:o.controlOff],children:jsxRuntime.jsx(m,{tier:"control",style:o.controlLabel,children:e})})}n(Je,"LobbyControl");function fe(e){let{clinicianName:r,petName:t,micOn:a,cameraOn:o,onToggleMic:p,onToggleCamera:L,onLeave:Y,style:M}=e,T=k(),i=react.useMemo(()=>Xr(T),[T]),h=reactNativeSafeAreaContext.useSafeAreaInsets(),{width:s}=reactNative.useWindowDimensions(),x=s<Wr?Gr:$r;return jsxRuntime.jsxs(reactNative.View,{style:[i.root,{paddingTop:h.top+T.space.sm,paddingBottom:h.bottom+T.space.lg},M],testID:"everfur-vet-lobby",children:[jsxRuntime.jsx(reactNative.View,{style:i.topRow,children:jsxRuntime.jsx(reactNative.Pressable,{onPress:Y,accessibilityRole:"button",accessibilityLabel:l.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:i.leaveHit,children:jsxRuntime.jsx(m,{tier:"control",style:i.leaveLabel,children:l.leaveCta})})}),jsxRuntime.jsxs(reactNative.View,{style:i.center,children:[jsxRuntime.jsxs(reactNative.View,{style:[i.avatar,{width:x,height:x,borderRadius:x/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsxRuntime.jsx(reactNative.View,{style:i.avatarGlyphHead}),jsxRuntime.jsx(reactNative.View,{style:i.avatarGlyphBody})]}),jsxRuntime.jsxs(reactNative.View,{accessibilityLiveRegion:"polite",accessible:true,children:[jsxRuntime.jsx(m,{tier:"heading",style:i.title,testID:"everfur-vet-lobby-title",children:l.lobbyTitle(r)}),jsxRuntime.jsx(m,{style:i.subtitle,testID:"everfur-vet-lobby-subtitle",children:l.lobbySubtitle})]}),jsxRuntime.jsx(Kr,{reducedMotion:T.motion.reducedMotion,styles:i})]}),jsxRuntime.jsxs(reactNative.View,{style:i.prepCard,testID:"everfur-vet-lobby-prep",children:[jsxRuntime.jsx(m,{tier:"badge",style:i.prepLabel,children:l.lobbyPrepLabel}),jsxRuntime.jsx(m,{style:i.prepBody,children:l.lobbyPrep(t)})]}),jsxRuntime.jsxs(reactNative.View,{style:i.controls,children:[jsxRuntime.jsx(Je,{label:a?l.muteCta:l.unmuteCta,active:a,onPress:p,testID:"everfur-vet-lobby-mic",styles:i}),jsxRuntime.jsx(Je,{label:o?l.cameraOffCta:l.cameraOnCta,active:o,onPress:L,testID:"everfur-vet-lobby-camera",styles:i})]}),jsxRuntime.jsx(m,{tier:"badge",style:i.duration,testID:"everfur-vet-lobby-duration",children:l.lobbyDuration(10)})]})}n(fe,"EverfurVetCallLobby");function Xr(e){let{color:r,space:t,radius:a,type:o}=e;return reactNative.StyleSheet.create({root:{flex:1,backgroundColor:r.brand,paddingHorizontal:t.lg},topRow:{flexDirection:"row",alignItems:"center"},leaveHit:{minHeight:Yr,justifyContent:"center",paddingVertical:t.xs,paddingRight:t.md},leaveLabel:{...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:r.success,backgroundColor:v.surface,marginBottom:t.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:v.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:v.glyph},title:{...y(e,"bold"),color:r.text.onBrand,fontSize:o.size.heading,lineHeight:Math.round(o.size.heading*o.lineHeight.snug),textAlign:"center",paddingHorizontal:t.sm},subtitle:{...y(e,"regular"),color:v.textSecondary,fontSize:o.size.body,textAlign:"center",marginTop:t.xs},dotRow:{flexDirection:"row",gap:t.xs,marginTop:t.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:r.success},prepCard:{borderRadius:a.lg,borderWidth:1,borderColor:v.hairline,backgroundColor:v.surface,padding:t.lg,marginBottom:t.lg},prepLabel:{...y(e,"medium"),color:r.accent,fontSize:o.size.micro,letterSpacing:1.2,marginBottom:t.sm},prepBody:{...y(e,"regular"),color:r.text.onBrand,fontSize:o.size.subtitle,lineHeight:Math.round(o.size.subtitle*o.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:t.lg,marginBottom:t.lg},control:{minWidth:96,minHeight:48,paddingHorizontal:t.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:v.surfaceRaised},controlOff:{backgroundColor:v.surfaceActive},controlLabel:{...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.caption},duration:{...y(e,"medium"),color:v.textTertiary,fontSize:o.size.micro,letterSpacing:1.6,textAlign:"center"}})}n(Xr,"makeStyles");function me(e){return e??null}n(me,"asTrack");function qr(e){return !!e?.videoTrack}n(qr,"hasVideo");function pe({label:e,onPress:r,testID:t,muted:a=false,danger:o=false,styles:p}){return jsxRuntime.jsx(reactNative.Pressable,{onPress:r,testID:t,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:a},style:[p.control,a?p.controlMuted:null,o?p.controlDanger:null],children:jsxRuntime.jsx(m,{tier:"control",style:[p.controlLabel,a?p.controlLabelMuted:null],children:e})})}n(pe,"CallControl");function Jr(e){let{roomUrl:r,token:t,onLeave:a,clinicianName:o,petName:p,daily:L,telemetry:Y,onUnavailable:M,renderUnavailable:T,style:i}=Oe(e,["onLeave"]),h=k(),s=react.useMemo(()=>tt(h),[h]),x=reactNativeSafeAreaContext.useSafeAreaInsets(),ge=Y??De,K=react.useRef(ge);react.useEffect(()=>{K.current=ge;});let X=react.useRef(a);react.useEffect(()=>{X.current=a;});let V=react.useRef(null),[ar,B]=react.useState("joining"),[Z,lr]=react.useState(null),[be,ir]=react.useState(null),[q,sr]=react.useState(true),[N,dr]=react.useState(true),[O,ur]=react.useState(null),[ve,Te]=react.useState(0),he=te(r,t),R=react.useMemo(()=>he?L?{available:true,module:L,reason:""}:ce():null,[he,L]),I=R?.available?R.module:null,E=react.useMemo(()=>R===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:R.available?null:{reason:"dailyMissing",detail:`${de} (${R.reason})`},[R]),J=react.useRef(false);react.useEffect(()=>{if(E===null){J.current=false;return}if(ne(M,E.reason,E.detail),!J.current){J.current=true;try{globalThis.console?.warn?.(E.detail);}catch{}}},[E,M]);let _=react.useCallback(async()=>{let u=V.current;if(V.current=null,!!u){try{await u.leave();}catch{}try{await u.destroy();}catch{}}},[]);react.useEffect(()=>{if(I===null)return;let u=false,f=I.createCallObject();V.current=f;let ee=n(()=>{let D=Object.values(f.participants());ir(D.find(re=>re.local)??null),lr(D.find(re=>!re.local)??null);},"syncParticipants"),we=["participant-joined","participant-updated","participant-left"];for(let D of we)f.on(D,ee);let Se=n(()=>{u||(B("left"),X.current());},"onLeftMeeting"),Re=n(()=>{u||B("error");},"onError");return f.on("left-meeting",Se),f.on("error",Re),f.join({url:r,token:t}).then(()=>{u||(B("joined"),ur(Date.now()),ee(),K.current.track("televet.call.joined",{provider:"daily"}));}).catch(()=>{u||(B("error"),K.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}));}),()=>{u=true;for(let D of we)f.off(D,ee);f.off("left-meeting",Se),f.off("error",Re),_();}},[I,r,t,_]),react.useEffect(()=>{if(O===null)return;Te(Date.now()-O);let u=setInterval(()=>{Te(Date.now()-O);},1e3);return ()=>{clearInterval(u);}},[O]);let Ee=react.useCallback(()=>{let u=V.current;u&&sr(f=>(u.setLocalAudio(!f),!f));},[]),Ce=react.useCallback(()=>{let u=V.current;u&&dr(f=>(u.setLocalVideo(!f),!f));},[]),Q=react.useCallback(()=>{_().then(()=>X.current());},[_]);if(E!==null)return T?jsxRuntime.jsx(jsxRuntime.Fragment,{children:T(E.reason,E.detail)}):null;if(I===null)return null;if(ar==="error")return jsxRuntime.jsxs(reactNative.View,{style:[s.centered,i],testID:"everfur-vet-call-error",children:[jsxRuntime.jsx(m,{style:s.status,accessibilityLiveRegion:"polite",children:l.joinFailedReason}),jsxRuntime.jsx(reactNative.Pressable,{onPress:Q,accessibilityRole:"button",accessibilityLabel:l.leaveCta,testID:"everfur-vet-call-error-leave",style:s.errorLeaveHit,children:jsxRuntime.jsx(m,{tier:"control",style:s.errorLeave,children:l.leaveCta})})]});if(!qr(Z))return jsxRuntime.jsx(fe,{clinicianName:o,petName:p,micOn:q,cameraOn:N,onToggleMic:Ee,onToggleCamera:Ce,onLeave:Q,style:i});let xe=I.DailyMediaView,ke=o?.trim()??"",cr=ve>=10*6e4;return jsxRuntime.jsxs(reactNative.View,{style:[s.root,i],testID:"everfur-vet-call",children:[jsxRuntime.jsx(reactNative.View,{style:s.fill,testID:"everfur-vet-call-remote",children:jsxRuntime.jsx(xe,{videoTrack:me(Z?.videoTrack),audioTrack:me(Z?.audioTrack),mirror:false,objectFit:"cover",style:s.fill})}),jsxRuntime.jsxs(reactNative.View,{style:[s.statusRow,{top:x.top+h.space.sm}],pointerEvents:"none",children:[ke.length>0?jsxRuntime.jsx(m,{tier:"compact",style:s.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:ke}):null,O!==null?jsxRuntime.jsx(m,{tier:"badge",style:[s.statusMeta,cr?s.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:Ie(ve)}):null]}),jsxRuntime.jsx(reactNative.View,{style:[s.selfView,{top:x.top+h.space.sm}],testID:"everfur-vet-call-self",children:be?.videoTrack&&N?jsxRuntime.jsx(xe,{videoTrack:me(be.videoTrack),audioTrack:null,mirror:true,objectFit:"cover",style:s.fill}):jsxRuntime.jsx(reactNative.View,{style:s.selfViewOff,testID:"everfur-vet-call-self-off",children:jsxRuntime.jsx(m,{tier:"badge",style:s.selfViewOffLabel,children:l.cameraOnCta})})}),jsxRuntime.jsxs(reactNative.View,{style:[s.controlBar,{bottom:x.bottom+h.space.lg}],children:[jsxRuntime.jsx(pe,{label:q?l.muteCta:l.unmuteCta,muted:!q,onPress:Ee,testID:"everfur-vet-call-mic",styles:s}),jsxRuntime.jsx(pe,{label:N?l.cameraOffCta:l.cameraOnCta,muted:!N,onPress:Ce,testID:"everfur-vet-call-camera",styles:s}),jsxRuntime.jsx(pe,{label:l.leaveCta,danger:true,onPress:Q,testID:"everfur-vet-call-leave",styles:s})]})]})}n(Jr,"EverfurVetCall");var rr="#141414",Qr="#1B1B1B",et="rgba(20,20,20,0.62)",rt="#141414",tr=104,nr={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function tt(e){let{color:r,space:t,radius:a,type:o}=e;return reactNative.StyleSheet.create({root:{flex:1,backgroundColor:rr},fill:{...reactNative.StyleSheet.absoluteFillObject},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:t.lg,padding:t.xl,backgroundColor:rr},statusRow:{position:"absolute",left:t.md,right:tr+t.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.body,...nr},statusMeta:{...y(e,"mono"),color:r.text.onBrand,fontSize:o.size.caption,...nr},statusMetaOver:{color:r.danger},selfView:{position:"absolute",right:t.md,width:tr,height:148,borderRadius:a.lg,overflow:"hidden",backgroundColor:Qr,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xs},selfViewOffLabel:{...y(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:o.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:t.md},control:{minWidth:76,minHeight:56,paddingHorizontal:t.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:et},controlMuted:{backgroundColor:r.text.onBrand},controlDanger:{backgroundColor:r.danger},controlLabel:{...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.caption},controlLabelMuted:{color:rt},status:{...y(e,"medium"),fontSize:o.size.subtitle,lineHeight:Math.round(o.size.subtitle*o.lineHeight.relaxed),color:r.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:t.lg},errorLeave:{...y(e,"medium"),color:r.surface,fontSize:o.size.body,textDecorationLine:"underline"}})}n(tt,"makeStyles");exports.EVERFUR_DAILY_SETUP=de;exports.EverfurVetCall=Jr;exports.EverfurVetCallLobby=fe;exports.VET_CALL_CONSULT_MINUTES=A;exports.VET_CALL_COPY=l;exports.isEverfurDailyModule=$e;exports.isSafeRoomUrl=Fe;exports.isUsableRoomCredential=te;exports.loadEverfurDaily=ce;exports.registerEverfurDaily=Mr;
|
|
1
|
+
'use strict';var react=require('react'),reactNative=require('react-native'),reactNativeSafeAreaContext=require('react-native-safe-area-context'),jsxRuntime=require('react/jsx-runtime');var Nt=Object.defineProperty;var o=(e,t)=>Nt(e,"name",{value:t,configurable:true});var Mt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function b(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[Mt[t]]}}o(b,"face");var $e=Object.freeze({track(){},trackExpectedFailure(){}});function Ye(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(Ye,"isSafeRoomUrl");function be(e,t){return Ye(e)&&t.trim().length>0}o(be,"isUsableRoomCredential");function qe(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(qe,"reportHostFailure");function _t(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(_t,"isThenable");function ge(e,...t){if(typeof e=="function")try{let r=e(...t);return _t(r)&&Promise.resolve(r).then(void 0,qe),r}catch(r){qe(r);return}}o(ge,"callHost");var Ke=new WeakMap;function jt(e){if(typeof e!="function")return;let t=Ke.get(e);if(t!==void 0)return t;let r=o((...a)=>{ge(e,...a);},"guarded");return Ke.set(e,r),r}o(jt,"guardHost");function Je(e,t){let r=null;for(let a of t){let n=e[a];typeof n=="function"&&(r??={...e},r[a]=jt(n));}return r??e}o(Je,"guardHostProps");var W=10,i=Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:i.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:i.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function Ze(e){let t=Math.max(0,Math.floor(e/1e3)),r=String(t%60).padStart(2,"0"),a=Math.floor(t%3600/60),n=Math.floor(t/3600);return n>0?`${n}:${String(a).padStart(2,"0")}:${r}`:`${a}:${r}`}o(Ze,"formatElapsed");function Ce(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Ce(e[t]);}return e}o(Ce,"deepFreeze");var Ht=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Qe={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},et={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Xe={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Ut={regular:"400",medium:"500",bold:"700"},Wt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Gt=0,re="System",oe="monospace",$t=["content","heading","control","compact","badge"];function Yt(e){let t={};for(let r of $t)t[r]=e;return t}o(Yt,"authoredTierSizes");function tt(){return {family:re,mono:oe,fontUrl:null,families:{regular:re,medium:re,bold:re,mono:oe,monoMedium:oe,monoBold:oe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Xe,tierSizes:Yt(Xe),lineHeight:zt,weight:Ut,letterSpacing:Wt,scale:1,maxScale:Gt,scaleCaps:Ht}}o(tt,"baseType");var rt={},he=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ve(e){return `cubic-bezier(${e.join(", ")})`}o(ve,"cssCubicBezier");var ot={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ve(he.standard),emphasized:ve(he.emphasized),exit:ve(he.exit)},reducedMotion:false},qt={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},nt=Ce({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qt,space:Qe,radius:et,type:tt(),motion:ot,slots:rt}),Kt={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Ce({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Kt,space:Qe,radius:et,type:tt(),motion:ot,slots:rt});var at=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),lt=globalThis,Te=lt[at]??(lt[at]=react.createContext(nt));Te.displayName??="EverfurThemeContext";function O(){return react.useContext(Te)}o(O,"useEverfurTheme");function tr(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}o(tr,"tierMultiplier");function g({tier:e="content",...t}){let{type:r}=O(),a=tr(r,e);return react.createElement(reactNative.Text,a===void 0?t:{maxFontSizeMultiplier:a,...t})}o(g,"Text");react.forwardRef(o(function(t,r){return react.createElement(reactNative.TextInput,{...t,...r===null?{}:{ref:r}})},"TextInput"));function st(e,t,r){let a;try{a=t();}catch(h){return xe(`optional peer '${e}' is not installed: ${or(h)}`)}let n=rr(a);return n==null?xe(`optional peer '${e}' resolved to no module`):r&&!r(n)?xe(`optional peer '${e}' is present but failed its shape check`):Object.freeze({available:true,module:n})}o(st,"optionalModule");function rr(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}o(rr,"unwrapDefault");function xe(e){return Object.freeze({available:false,module:null,reason:e})}o(xe,"frozenUnavailable");function or(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}o(or,"describe");var dt=Symbol.for("@everfur/sdk/televet");function nr(){let e=globalThis,t=e[dt];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[dt]=r,r}o(nr,"televetGlobal");function ut(e){nr().dailyRegistered=e;}o(ut,"markEverfurDailyRegistered");var Ee=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,ke="@daily-co/react-native-daily-js",ar=`optional peer '${ke}' has no registered loader`,ct=`optional peer '${ke}' is present but failed its shape check`;function ae(e){return typeof e=="object"&&e!==null}o(ae,"isRecordLike");function lr(e){return ae(e)&&"box"in e}o(lr,"isDailyBox");function ir(e){let t=ae(e.default)?e.default:{},r=e.createCallObject??t.createCallObject,a=e.DailyMediaView??t.DailyMediaView,n={createCallObject:r,DailyMediaView:a};return ft(n)?n:null}o(ir,"normalizeDailyModule");function ft(e){if(!ae(e)||typeof e.createCallObject!="function")return false;let t=e.DailyMediaView;return typeof t=="function"||typeof t=="object"&&t!==null}o(ft,"isEverfurDailyModule");var yt=null,T=null;function ne(e){return Object.freeze({available:false,module:null,reason:e})}o(ne,"unavailable");function sr(e){yt=e,T=null,ut(e!==null);}o(sr,"registerEverfurDaily");function we(){if(T!==null)return T;let e=yt;if(e===null)return T=ne(ar),T;let t=st(ke,()=>({box:e()}),lr);if(!t.available)return T=ne(t.reason),T;let r=t.module.box;if(!ae(r))return T=ne(ct),T;let a=ir(r);return T=a===null?ne(ct):Object.freeze({available:true,module:a}),T}o(we,"loadEverfurDaily");function _({label:e,glyph:t,onPress:r,testID:a,muted:n=false,style:h}){return jsxRuntime.jsx(reactNative.Pressable,{onPress:r,testID:a,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:n},style:h,children:t})}o(_,"CallControl");function G({children:e,testID:t}){return jsxRuntime.jsx(reactNative.View,{style:c.box,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:t,children:e})}o(G,"GlyphBox");function Re({color:e}){return jsxRuntime.jsx(reactNative.View,{style:[c.slash,{backgroundColor:e}]})}o(Re,"Slash");function le({color:e,off:t=false}){return jsxRuntime.jsxs(G,{testID:t?"glyph-mic-off":"glyph-mic",children:[jsxRuntime.jsxs(reactNative.View,{style:c.column,children:[jsxRuntime.jsx(reactNative.View,{style:[c.micCapsule,{borderColor:e}]}),jsxRuntime.jsx(reactNative.View,{style:[c.micCradle,{borderColor:e}]}),jsxRuntime.jsx(reactNative.View,{style:[c.micStem,{backgroundColor:e}]})]}),t?jsxRuntime.jsx(Re,{color:e}):null]})}o(le,"MicGlyph");function ie({color:e,off:t=false}){return jsxRuntime.jsxs(G,{testID:t?"glyph-camera-off":"glyph-camera",children:[jsxRuntime.jsxs(reactNative.View,{style:c.row,children:[jsxRuntime.jsx(reactNative.View,{style:[c.cameraBody,{borderColor:e}]}),jsxRuntime.jsx(reactNative.View,{style:[c.cameraLens,{borderRightColor:e}]})]}),t?jsxRuntime.jsx(Re,{color:e}):null]})}o(ie,"CameraGlyph");function pt({color:e,off:t=false}){return jsxRuntime.jsxs(G,{testID:t?"glyph-speaker-off":"glyph-speaker",children:[jsxRuntime.jsxs(reactNative.View,{style:c.row,children:[jsxRuntime.jsx(reactNative.View,{style:[c.speakerBox,{backgroundColor:e}]}),jsxRuntime.jsx(reactNative.View,{style:[c.speakerCone,{borderRightColor:e}]}),t?null:jsxRuntime.jsx(reactNative.View,{style:[c.speakerWave,{borderColor:e}]})]}),t?jsxRuntime.jsx(Re,{color:e}):null]})}o(pt,"SpeakerGlyph");function se({color:e}){return jsxRuntime.jsx(G,{testID:"glyph-switch-camera",children:jsxRuntime.jsxs(reactNative.View,{style:[c.switchBody,{borderColor:e}],children:[jsxRuntime.jsx(reactNative.View,{style:[c.switchTurn,{borderColor:e,borderTopColor:"transparent"}]}),jsxRuntime.jsx(reactNative.View,{style:[c.switchHead,{borderBottomColor:e}]})]})})}o(se,"SwitchCameraGlyph");function mt({color:e}){return jsxRuntime.jsx(G,{testID:"glyph-leave",children:jsxRuntime.jsxs(reactNative.View,{style:c.column,children:[jsxRuntime.jsx(reactNative.View,{style:[c.receiver,{borderColor:e}]}),jsxRuntime.jsxs(reactNative.View,{style:c.receiverPads,children:[jsxRuntime.jsx(reactNative.View,{style:[c.receiverPad,{backgroundColor:e}]}),jsxRuntime.jsx(reactNative.View,{style:[c.receiverPad,{backgroundColor:e}]})]})]})})}o(mt,"LeaveGlyph");var c=reactNative.StyleSheet.create({box:{width:24,height:24,alignItems:"center",justifyContent:"center"},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"center"},slash:{position:"absolute",width:2,height:28,borderRadius:1,transform:[{rotate:"-45deg"}]},micCapsule:{width:10,height:14,borderRadius:5,borderWidth:2},micCradle:{width:16,height:8,marginTop:-5,borderWidth:2,borderTopWidth:0,borderBottomLeftRadius:8,borderBottomRightRadius:8},micStem:{width:2,height:3},cameraBody:{width:14,height:12,borderRadius:3,borderWidth:2},cameraLens:{width:0,height:0,marginLeft:1,borderTopWidth:5,borderBottomWidth:5,borderRightWidth:6,borderTopColor:"transparent",borderBottomColor:"transparent"},speakerBox:{width:4,height:8,borderRadius:1},speakerCone:{width:0,height:0,borderTopWidth:7,borderBottomWidth:7,borderRightWidth:7,borderTopColor:"transparent",borderBottomColor:"transparent",transform:[{rotate:"180deg"}]},speakerWave:{width:7,height:12,marginLeft:2,borderWidth:2,borderLeftWidth:0,borderTopRightRadius:6,borderBottomRightRadius:6},switchBody:{width:20,height:15,borderRadius:3,borderWidth:2,alignItems:"center",justifyContent:"center"},switchTurn:{width:9,height:9,borderRadius:4.5,borderWidth:2},switchHead:{position:"absolute",top:2,right:4,width:0,height:0,borderLeftWidth:3,borderRightWidth:3,borderBottomWidth:4,borderLeftColor:"transparent",borderRightColor:"transparent"},receiver:{width:22,height:10,borderWidth:3,borderBottomWidth:0,borderTopLeftRadius:11,borderTopRightRadius:11},receiverPads:{flexDirection:"row",width:22,justifyContent:"space-between",marginTop:-1},receiverPad:{width:5,height:4,borderRadius:1}});var S=Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),bt=3,gt=180,ht=420,vt=.35,gr=.6,hr=360,vr=132,Cr=184,Tr=44;function xr({reducedMotion:e,styles:t}){let r=react.useRef(Array.from({length:bt},()=>new reactNative.Animated.Value(vt))).current;return react.useEffect(()=>{if(e)return;let a=r.map((n,h)=>reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.delay(h*gt),reactNative.Animated.timing(n,{toValue:1,duration:ht,useNativeDriver:true}),reactNative.Animated.timing(n,{toValue:vt,duration:ht,useNativeDriver:true}),reactNative.Animated.delay((bt-h-1)*gt)])));for(let n of a)n.start();return ()=>{for(let n of a)n.stop();}},[e,r]),jsxRuntime.jsx(reactNative.View,{style:t.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:r.map((a,n)=>jsxRuntime.jsx(reactNative.Animated.View,{style:[t.dot,{opacity:e?gr:a}]},n))})}o(xr,"WaitingDots");function Se({label:e,glyph:t,active:r,onPress:a,testID:n,styles:h}){return jsxRuntime.jsx(reactNative.Pressable,{onPress:a,testID:n,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[h.control,r?null:h.controlOff],children:t})}o(Se,"LobbyControl");function De(e){let{clinicianName:t,petName:r,micOn:a,cameraOn:n,onToggleMic:h,onToggleCamera:k,onSwitchCamera:q,onLeave:K,style:J}=e,v=O(),s=react.useMemo(()=>Er(v),[v]),l=reactNativeSafeAreaContext.useSafeAreaInsets(),{width:F}=reactNative.useWindowDimensions(),P=F<hr?vr:Cr;return jsxRuntime.jsxs(reactNative.View,{style:[s.root,{paddingTop:l.top+v.space.sm,paddingBottom:l.bottom+v.space.lg},J],testID:"everfur-vet-lobby",children:[jsxRuntime.jsx(reactNative.View,{style:s.topRow,children:jsxRuntime.jsx(reactNative.Pressable,{onPress:K,accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:s.leaveHit,children:jsxRuntime.jsx(g,{tier:"control",style:s.leaveLabel,children:i.leaveCta})})}),jsxRuntime.jsxs(reactNative.View,{style:s.center,children:[jsxRuntime.jsxs(reactNative.View,{style:[s.avatar,{width:P,height:P,borderRadius:P/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsxRuntime.jsx(reactNative.View,{style:s.avatarGlyphHead}),jsxRuntime.jsx(reactNative.View,{style:s.avatarGlyphBody})]}),jsxRuntime.jsxs(reactNative.View,{accessibilityLiveRegion:"polite",accessible:true,children:[jsxRuntime.jsx(g,{tier:"heading",style:s.title,testID:"everfur-vet-lobby-title",children:i.lobbyTitle(t)}),jsxRuntime.jsx(g,{style:s.subtitle,testID:"everfur-vet-lobby-subtitle",children:i.lobbySubtitle})]}),jsxRuntime.jsx(xr,{reducedMotion:v.motion.reducedMotion,styles:s})]}),jsxRuntime.jsxs(reactNative.View,{style:s.prepCard,testID:"everfur-vet-lobby-prep",children:[jsxRuntime.jsx(g,{tier:"badge",style:s.prepLabel,children:i.lobbyPrepLabel}),jsxRuntime.jsx(g,{style:s.prepBody,children:i.lobbyPrep(r)})]}),jsxRuntime.jsxs(reactNative.View,{style:s.controls,children:[jsxRuntime.jsx(Se,{label:a?i.muteCta:i.unmuteCta,glyph:jsxRuntime.jsx(le,{color:v.color.text.onBrand,off:!a}),active:a,onPress:h,testID:"everfur-vet-lobby-mic",styles:s}),jsxRuntime.jsx(Se,{label:n?i.cameraOffCta:i.cameraOnCta,glyph:jsxRuntime.jsx(ie,{color:v.color.text.onBrand,off:!n}),active:n,onPress:k,testID:"everfur-vet-lobby-camera",styles:s}),n&&q?jsxRuntime.jsx(Se,{label:i.switchCameraCta,glyph:jsxRuntime.jsx(se,{color:v.color.text.onBrand}),active:true,onPress:q,testID:"everfur-vet-lobby-switch-camera",styles:s}):null]}),jsxRuntime.jsx(g,{tier:"badge",style:s.duration,testID:"everfur-vet-lobby-duration",children:i.lobbyDuration(10)})]})}o(De,"EverfurVetCallLobby");function Er(e){let{color:t,space:r,radius:a,type:n}=e;return reactNative.StyleSheet.create({root:{flex:1,backgroundColor:t.brand,paddingHorizontal:r.lg},topRow:{flexDirection:"row",alignItems:"center"},leaveHit:{minHeight:Tr,justifyContent:"center",paddingVertical:r.xs,paddingRight:r.md},leaveLabel:{...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:t.success,backgroundColor:S.surface,marginBottom:r.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:S.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:S.glyph},title:{...b(e,"bold"),color:t.text.onBrand,fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.snug),textAlign:"center",paddingHorizontal:r.sm},subtitle:{...b(e,"regular"),color:S.textSecondary,fontSize:n.size.body,textAlign:"center",marginTop:r.xs},dotRow:{flexDirection:"row",gap:r.xs,marginTop:r.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:t.success},prepCard:{borderRadius:a.lg,borderWidth:1,borderColor:S.hairline,backgroundColor:S.surface,padding:r.lg,marginBottom:r.lg},prepLabel:{...b(e,"medium"),color:t.accent,fontSize:n.size.micro,letterSpacing:1.2,marginBottom:r.sm},prepBody:{...b(e,"regular"),color:t.text.onBrand,fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:r.lg,marginBottom:r.lg},control:{minWidth:64,minHeight:48,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:S.surfaceRaised},controlOff:{backgroundColor:S.surfaceActive},duration:{...b(e,"medium"),color:S.textTertiary,fontSize:n.size.micro,letterSpacing:1.6,textAlign:"center"}})}o(Er,"makeStyles");function Tt(e){let[t,r]=react.useState(true),a=react.useRef(true),n=react.useCallback(()=>{let h=e.current;if(!h?.setNativeInCallAudioMode)return;let k=!a.current;a.current=k,r(k),h.setNativeInCallAudioMode(k?"video":"voice");},[e]);return {speakerOn:t,toggleSpeaker:n}}o(Tt,"useSpeakerRoute");function Ie(e){return e??null}o(Ie,"asTrack");function Dr(e){return !!e?.videoTrack}o(Dr,"hasVideo");function Lr({styles:e}){return jsxRuntime.jsxs(reactNative.View,{style:e.remoteOffAvatar,accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsxRuntime.jsx(reactNative.View,{style:e.remoteOffHead}),jsxRuntime.jsx(reactNative.View,{style:e.remoteOffBody})]})}o(Lr,"PersonMark");function Vr(e){let{roomUrl:t,token:r,onLeave:a,clinicianName:n,petName:h,daily:k,telemetry:q,onUnavailable:K,renderUnavailable:J,style:v}=Je(e,["onLeave"]),s=O(),l=react.useMemo(()=>Ir(s),[s]),F=reactNativeSafeAreaContext.useSafeAreaInsets(),P=q??$e,ue=react.useRef(P);react.useEffect(()=>{ue.current=P;});let Z=react.useRef(a);react.useEffect(()=>{Z.current=a;});let I=react.useRef(null),[ce,wt]=react.useState(false),[Rt,X]=react.useState("joining"),[Q,St]=react.useState(null),[Be,Dt]=react.useState(null),[B,Lt]=react.useState(true),[w,Vt]=react.useState(true),{speakerOn:H,toggleSpeaker:Ft}=Tt(I),[It,Ot]=react.useState(true),[fe,Pt]=react.useState({flip:false,speaker:false}),[z,Bt]=react.useState(null),[Ae,Ne]=react.useState(0),Me=be(t,r),A=react.useMemo(()=>Me?k?{available:true,module:k,reason:""}:we():null,[Me,k]),U=A?.available?A.module:null,L=react.useMemo(()=>A===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:A.available?null:{reason:"dailyMissing",detail:`${Ee} (${A.reason})`},[A]),ye=react.useRef(false);react.useEffect(()=>{if(L===null){ye.current=false;return}if(ge(K,L.reason,L.detail),!ye.current){ye.current=true;try{globalThis.console?.warn?.(L.detail);}catch{}}},[L,K]);let ee=react.useCallback(async()=>{let y=I.current;if(I.current=null,!!y){try{await y.leave();}catch{}try{await y.destroy();}catch{}}},[]);react.useEffect(()=>{if(U===null||!ce)return;let y=false,m=U.createCallObject();I.current=m,Pt({flip:typeof m.cycleCamera=="function",speaker:typeof m.setNativeInCallAudioMode=="function"});let N=o(()=>{let M=Object.values(m.participants());Dt(M.find(me=>me.local)??null),St(M.find(me=>!me.local)??null);},"syncParticipants"),Ue=["participant-joined","participant-updated","participant-left"];for(let M of Ue)m.on(M,N);let We=o(()=>{y||(X("left"),Z.current());},"onLeftMeeting"),Ge=o(()=>{y||X("error");},"onError");return m.on("left-meeting",We),m.on("error",Ge),m.join({url:t,token:r}).then(()=>{y||(X("joined"),Bt(Date.now()),N(),ue.current.track("televet.call.joined",{provider:"daily"}));}).catch(()=>{y||(X("error"),ue.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}));}),()=>{y=true;for(let M of Ue)m.off(M,N);m.off("left-meeting",We),m.off("error",Ge),ee();}},[U,ce,t,r,ee]),react.useEffect(()=>{if(z===null)return;Ne(Date.now()-z);let y=setInterval(()=>{Ne(Date.now()-z);},1e3);return ()=>{clearInterval(y);}},[z]);let _e=react.useCallback(()=>{let y=I.current;y&&Lt(m=>(y.setLocalAudio(!m),!m));},[]),je=react.useCallback(()=>{let y=I.current;y&&Vt(m=>(y.setLocalVideo(!m),!m));},[]),He=react.useCallback(()=>{let y=I.current;y?.cycleCamera&&y.cycleCamera().then(m=>{let N=m?.device?.facingMode;N&&Ot(N==="user");},()=>{});},[]),pe=react.useCallback(()=>{ee().then(()=>Z.current());},[ee]);if(L!==null)return J?jsxRuntime.jsx(jsxRuntime.Fragment,{children:J(L.reason,L.detail)}):null;if(U===null)return null;if(!ce)return jsxRuntime.jsxs(reactNative.View,{style:[l.notice,{paddingTop:F.top+s.space.xl,paddingBottom:F.bottom+s.space.xl},v],testID:"everfur-vet-call-recording-notice",children:[jsxRuntime.jsx(g,{style:l.noticeTitle,accessibilityRole:"header",children:i.recordingNoticeTitle}),jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>wt(true),accessibilityRole:"button",accessibilityLabel:i.recordingNoticeCta,testID:"everfur-vet-call-recording-continue",style:l.noticeContinue,children:jsxRuntime.jsx(g,{tier:"control",style:l.noticeContinueLabel,children:i.recordingNoticeCta})}),jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>Z.current(),accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-call-recording-leave",style:l.errorLeaveHit,children:jsxRuntime.jsx(g,{tier:"control",style:l.noticeLeave,children:i.leaveCta})})]});if(Rt==="error")return jsxRuntime.jsxs(reactNative.View,{style:[l.centered,v],testID:"everfur-vet-call-error",children:[jsxRuntime.jsx(g,{style:l.status,accessibilityLiveRegion:"polite",children:i.joinFailedReason}),jsxRuntime.jsx(reactNative.Pressable,{onPress:pe,accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-call-error-leave",style:l.errorLeaveHit,children:jsxRuntime.jsx(g,{tier:"control",style:l.errorLeave,children:i.leaveCta})})]});if(Q===null)return jsxRuntime.jsx(De,{clinicianName:n,petName:h,micOn:B,cameraOn:w,onToggleMic:_e,onToggleCamera:je,...fe.flip?{onSwitchCamera:He}:{},onLeave:pe,style:v});let ze=U.DailyMediaView,te=n?.trim()??"",At=Ae>=10*6e4;return jsxRuntime.jsxs(reactNative.View,{style:[l.root,v],testID:"everfur-vet-call",children:[jsxRuntime.jsxs(reactNative.View,{style:l.fill,testID:"everfur-vet-call-remote",children:[jsxRuntime.jsx(ze,{videoTrack:Ie(Q.videoTrack),audioTrack:Ie(Q.audioTrack),mirror:false,objectFit:"cover",style:l.fill}),Dr(Q)?null:jsxRuntime.jsxs(reactNative.View,{style:l.remoteOff,testID:"everfur-vet-call-remote-camera-off",children:[jsxRuntime.jsx(Lr,{styles:l}),te.length>0?jsxRuntime.jsx(g,{style:l.remoteOffName,numberOfLines:1,children:te}):null]})]}),jsxRuntime.jsxs(reactNative.View,{style:[l.statusRow,{top:F.top+s.space.sm}],pointerEvents:"none",children:[te.length>0?jsxRuntime.jsx(g,{tier:"compact",style:l.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:te}):null,z!==null?jsxRuntime.jsx(g,{tier:"badge",style:[l.statusMeta,At?l.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:Ze(Ae)}):null]}),jsxRuntime.jsxs(reactNative.View,{style:[l.selfView,{top:F.top+s.space.sm}],testID:"everfur-vet-call-self",children:[jsxRuntime.jsx(ze,{videoTrack:w?Ie(Be?.videoTrack):null,audioTrack:null,mirror:It,objectFit:"cover",style:l.fill}),Be?.videoTrack&&w?null:jsxRuntime.jsx(reactNative.View,{style:[l.selfViewOff,l.fill],testID:"everfur-vet-call-self-off",children:jsxRuntime.jsx(g,{tier:"badge",style:l.selfViewOffLabel,children:i.selfCameraOffLabel})})]}),jsxRuntime.jsxs(reactNative.View,{style:[l.controlBar,{bottom:F.bottom+s.space.lg}],children:[fe.speaker?jsxRuntime.jsx(_,{label:H?i.speakerOffCta:i.speakerOnCta,glyph:jsxRuntime.jsx(pt,{color:H?s.color.text.onBrand:Pe,off:!H}),muted:!H,onPress:Ft,testID:"everfur-vet-call-speaker",style:[l.control,H?null:l.controlMuted]}):null,jsxRuntime.jsx(_,{label:B?i.muteCta:i.unmuteCta,glyph:jsxRuntime.jsx(le,{color:B?s.color.text.onBrand:Pe,off:!B}),muted:!B,onPress:_e,testID:"everfur-vet-call-mic",style:[l.control,B?null:l.controlMuted]}),jsxRuntime.jsx(_,{label:w?i.cameraOffCta:i.cameraOnCta,glyph:jsxRuntime.jsx(ie,{color:w?s.color.text.onBrand:Pe,off:!w}),muted:!w,onPress:je,testID:"everfur-vet-call-camera",style:[l.control,w?null:l.controlMuted]}),fe.flip&&w?jsxRuntime.jsx(_,{label:i.switchCameraCta,glyph:jsxRuntime.jsx(se,{color:s.color.text.onBrand}),onPress:He,testID:"everfur-vet-call-switch-camera",style:l.control}):null,jsxRuntime.jsx(_,{label:i.leaveCta,glyph:jsxRuntime.jsx(mt,{color:s.color.text.onBrand}),onPress:pe,testID:"everfur-vet-call-leave",style:[l.control,l.controlDanger]})]})]})}o(Vr,"EverfurVetCall");var Oe="#141414",xt="#1B1B1B",Fr="rgba(20,20,20,0.62)",Pe="#141414",Et=104,kt={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function Ir(e){let{color:t,space:r,radius:a,type:n}=e;return reactNative.StyleSheet.create({root:{flex:1,backgroundColor:Oe},fill:{...reactNative.StyleSheet.absoluteFillObject},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:r.lg,padding:r.xl,backgroundColor:Oe},statusRow:{position:"absolute",left:r.md,right:Et+r.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.body,...kt},statusMeta:{...b(e,"mono"),color:t.text.onBrand,fontSize:n.size.caption,...kt},statusMetaOver:{color:t.danger},selfView:{position:"absolute",right:r.md,width:Et,height:148,borderRadius:a.lg,overflow:"hidden",backgroundColor:xt,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{alignItems:"center",justifyContent:"center",paddingHorizontal:r.xs,backgroundColor:xt},remoteOff:{...reactNative.StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center",gap:r.md,backgroundColor:Oe},remoteOffAvatar:{width:96,height:96,borderRadius:a.pill,overflow:"hidden",alignItems:"center",justifyContent:"flex-end",backgroundColor:"rgba(255,255,255,0.14)"},remoteOffHead:{width:36,height:36,borderRadius:18,marginBottom:6,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffBody:{width:64,height:28,borderTopLeftRadius:32,borderTopRightRadius:32,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffName:{...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.subtitle,paddingHorizontal:r.xl},notice:{flex:1,justifyContent:"center",gap:r.lg,paddingHorizontal:r.xl,backgroundColor:t.surface},noticeTitle:{...b(e,"medium"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed),color:t.text.primary},noticeContinue:{minHeight:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.xl,borderRadius:a.pill,backgroundColor:t.primary},noticeContinueLabel:{...b(e,"medium"),color:t.onPrimary,fontSize:n.size.body},noticeLeave:{...b(e,"medium"),color:t.brand,fontSize:n.size.body},selfViewOffLabel:{...b(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:n.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:r.sm},control:{minWidth:54,minHeight:56,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:Fr},controlMuted:{backgroundColor:t.text.onBrand},controlDanger:{backgroundColor:t.danger},status:{...b(e,"medium"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed),color:t.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.lg},errorLeave:{...b(e,"medium"),color:t.surface,fontSize:n.size.body,textDecorationLine:"underline"}})}o(Ir,"makeStyles");exports.EVERFUR_DAILY_SETUP=Ee;exports.EverfurVetCall=Vr;exports.EverfurVetCallLobby=De;exports.VET_CALL_CONSULT_MINUTES=W;exports.VET_CALL_COPY=i;exports.isEverfurDailyModule=ft;exports.isSafeRoomUrl=Ye;exports.isUsableRoomCredential=be;exports.loadEverfurDaily=we;exports.registerEverfurDaily=sr;
|
|
@@ -2,7 +2,9 @@ import { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { T as TelemetryPort } from '../../TelemetryPort-BDNr00hu.cjs';
|
|
4
4
|
import { O as OptionalModule } from '../../optionalModule-DbJmsq5f.cjs';
|
|
5
|
-
export { V as
|
|
5
|
+
export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../callRoom-B_EqaUzx.cjs';
|
|
6
|
+
export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../callCopy-rDH9JTFo.cjs';
|
|
7
|
+
import '../../EverfurError-DmELDpXp.cjs';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* A participant's media track. Daily types this `MediaStreamTrack | false | null`: `false` means the track
|
|
@@ -19,9 +21,14 @@ interface VetCallParticipant {
|
|
|
19
21
|
type VetCallEvent = 'participant-joined' | 'participant-updated' | 'participant-left' | 'left-meeting' | 'error';
|
|
20
22
|
type VetCallHandler = (...args: readonly unknown[]) => void;
|
|
21
23
|
/**
|
|
22
|
-
* The Daily call object, narrowed to the
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* The Daily call object, narrowed to the members the call surface actually calls. Narrow on purpose: the SDK
|
|
25
|
+
* never asks for host powers. `is_owner` is the CLINICIAN's and the server decides it when it mints the token;
|
|
26
|
+
* it starts recording and grants admit/eject, and nothing here requests either.
|
|
27
|
+
*
|
|
28
|
+
* THE LAST TWO ARE OPTIONAL, and a control is drawn only when its method is there: `cycleCamera` is the front
|
|
29
|
+
* and back flip and `setNativeInCallAudioMode` the loudspeaker and earpiece routes, both of which the consumer
|
|
30
|
+
* app calls on the same native module (TelevetCallScreen.tsx:559-581). A module version without them keeps
|
|
31
|
+
* the call working and simply offers fewer controls, rather than failing its shape check.
|
|
25
32
|
*/
|
|
26
33
|
interface VetCallObject {
|
|
27
34
|
join(options: {
|
|
@@ -35,6 +42,14 @@ interface VetCallObject {
|
|
|
35
42
|
setLocalVideo(enabled: boolean): unknown;
|
|
36
43
|
on(event: VetCallEvent, handler: VetCallHandler): unknown;
|
|
37
44
|
off(event: VetCallEvent, handler: VetCallHandler): unknown;
|
|
45
|
+
/** The front/back flip. Resolves with the facing mode it landed on (`device.facingMode`). */
|
|
46
|
+
cycleCamera?(): Promise<{
|
|
47
|
+
readonly device?: {
|
|
48
|
+
readonly facingMode?: string;
|
|
49
|
+
} | null;
|
|
50
|
+
} | null | undefined>;
|
|
51
|
+
/** `'video'` routes the call to the loudspeaker (Daily's default), `'voice'` to the earpiece. */
|
|
52
|
+
setNativeInCallAudioMode?(mode: 'video' | 'voice'): unknown;
|
|
38
53
|
}
|
|
39
54
|
/** The props the call surface renders `DailyMediaView` with. */
|
|
40
55
|
interface VetCallMediaViewProps {
|
|
@@ -132,10 +147,15 @@ interface EverfurVetCallLobbyProps {
|
|
|
132
147
|
readonly cameraOn: boolean;
|
|
133
148
|
readonly onToggleMic: () => void;
|
|
134
149
|
readonly onToggleCamera: () => void;
|
|
150
|
+
/** The front/back flip. Absent (a native module without `cycleCamera`), the control is not drawn. */
|
|
151
|
+
readonly onSwitchCamera?: (() => void) | undefined;
|
|
135
152
|
readonly onLeave: () => void;
|
|
136
153
|
readonly style?: StyleProp<ViewStyle>;
|
|
137
154
|
}
|
|
138
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* The waiting room shown until the clinician is IN the room (present, with or without a camera). Mounted by
|
|
157
|
+
* `EverfurVetCall`.
|
|
158
|
+
*/
|
|
139
159
|
declare function EverfurVetCallLobby(props: EverfurVetCallLobbyProps): ReactNode;
|
|
140
160
|
|
|
141
161
|
export { EVERFUR_DAILY_SETUP, type EverfurDailyLoader, type EverfurDailyModule, EverfurVetCall, EverfurVetCallLobby, type EverfurVetCallLobbyProps, type EverfurVetCallProps, OptionalModule, TelemetryPort, type VetCallEvent, type VetCallHandler, type VetCallMediaViewProps, type VetCallObject, type VetCallParticipant, type VetCallTrack, type VetCallUnavailableReason, isEverfurDailyModule, loadEverfurDaily, registerEverfurDaily };
|
|
@@ -2,7 +2,9 @@ import { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { T as TelemetryPort } from '../../TelemetryPort-BDNr00hu.js';
|
|
4
4
|
import { O as OptionalModule } from '../../optionalModule-DbJmsq5f.js';
|
|
5
|
-
export { V as
|
|
5
|
+
export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../callRoom-7wrE3RP2.js';
|
|
6
|
+
export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../callCopy-rDH9JTFo.js';
|
|
7
|
+
import '../../EverfurError-DmELDpXp.js';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* A participant's media track. Daily types this `MediaStreamTrack | false | null`: `false` means the track
|
|
@@ -19,9 +21,14 @@ interface VetCallParticipant {
|
|
|
19
21
|
type VetCallEvent = 'participant-joined' | 'participant-updated' | 'participant-left' | 'left-meeting' | 'error';
|
|
20
22
|
type VetCallHandler = (...args: readonly unknown[]) => void;
|
|
21
23
|
/**
|
|
22
|
-
* The Daily call object, narrowed to the
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* The Daily call object, narrowed to the members the call surface actually calls. Narrow on purpose: the SDK
|
|
25
|
+
* never asks for host powers. `is_owner` is the CLINICIAN's and the server decides it when it mints the token;
|
|
26
|
+
* it starts recording and grants admit/eject, and nothing here requests either.
|
|
27
|
+
*
|
|
28
|
+
* THE LAST TWO ARE OPTIONAL, and a control is drawn only when its method is there: `cycleCamera` is the front
|
|
29
|
+
* and back flip and `setNativeInCallAudioMode` the loudspeaker and earpiece routes, both of which the consumer
|
|
30
|
+
* app calls on the same native module (TelevetCallScreen.tsx:559-581). A module version without them keeps
|
|
31
|
+
* the call working and simply offers fewer controls, rather than failing its shape check.
|
|
25
32
|
*/
|
|
26
33
|
interface VetCallObject {
|
|
27
34
|
join(options: {
|
|
@@ -35,6 +42,14 @@ interface VetCallObject {
|
|
|
35
42
|
setLocalVideo(enabled: boolean): unknown;
|
|
36
43
|
on(event: VetCallEvent, handler: VetCallHandler): unknown;
|
|
37
44
|
off(event: VetCallEvent, handler: VetCallHandler): unknown;
|
|
45
|
+
/** The front/back flip. Resolves with the facing mode it landed on (`device.facingMode`). */
|
|
46
|
+
cycleCamera?(): Promise<{
|
|
47
|
+
readonly device?: {
|
|
48
|
+
readonly facingMode?: string;
|
|
49
|
+
} | null;
|
|
50
|
+
} | null | undefined>;
|
|
51
|
+
/** `'video'` routes the call to the loudspeaker (Daily's default), `'voice'` to the earpiece. */
|
|
52
|
+
setNativeInCallAudioMode?(mode: 'video' | 'voice'): unknown;
|
|
38
53
|
}
|
|
39
54
|
/** The props the call surface renders `DailyMediaView` with. */
|
|
40
55
|
interface VetCallMediaViewProps {
|
|
@@ -132,10 +147,15 @@ interface EverfurVetCallLobbyProps {
|
|
|
132
147
|
readonly cameraOn: boolean;
|
|
133
148
|
readonly onToggleMic: () => void;
|
|
134
149
|
readonly onToggleCamera: () => void;
|
|
150
|
+
/** The front/back flip. Absent (a native module without `cycleCamera`), the control is not drawn. */
|
|
151
|
+
readonly onSwitchCamera?: (() => void) | undefined;
|
|
135
152
|
readonly onLeave: () => void;
|
|
136
153
|
readonly style?: StyleProp<ViewStyle>;
|
|
137
154
|
}
|
|
138
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* The waiting room shown until the clinician is IN the room (present, with or without a camera). Mounted by
|
|
157
|
+
* `EverfurVetCall`.
|
|
158
|
+
*/
|
|
139
159
|
declare function EverfurVetCallLobby(props: EverfurVetCallLobbyProps): ReactNode;
|
|
140
160
|
|
|
141
161
|
export { EVERFUR_DAILY_SETUP, type EverfurDailyLoader, type EverfurDailyModule, EverfurVetCall, EverfurVetCallLobby, type EverfurVetCallLobbyProps, type EverfurVetCallProps, OptionalModule, TelemetryPort, type VetCallEvent, type VetCallHandler, type VetCallMediaViewProps, type VetCallObject, type VetCallParticipant, type VetCallTrack, type VetCallUnavailableReason, isEverfurDailyModule, loadEverfurDaily, registerEverfurDaily };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {createContext,forwardRef,createElement,useMemo,useRef,useEffect,useState,useCallback,useContext}from'react';import {TextInput,useWindowDimensions,View,Pressable,StyleSheet,Text,Animated}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var fr=Object.defineProperty;var n=(e,r)=>fr(e,"name",{value:r,configurable:true});var yr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function y(e,r){let t=e.type,a=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:a}:{fontFamily:a,fontWeight:t.weight[yr[r]]}}n(y,"face");var De=Object.freeze({track(){},trackExpectedFailure(){}});function Fe(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}n(Fe,"isSafeRoomUrl");function te(e,r){return Fe(e)&&r.trim().length>0}n(te,"isUsableRoomCredential");function Le(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n(Le,"reportHostFailure");function mr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(mr,"isThenable");function ne(e,...r){if(typeof e=="function")try{let t=e(...r);return mr(t)&&Promise.resolve(t).then(void 0,Le),t}catch(t){Le(t);return}}n(ne,"callHost");var Ve=new WeakMap;function pr(e){if(typeof e!="function")return;let r=Ve.get(e);if(r!==void 0)return r;let t=n((...a)=>{ne(e,...a);},"guarded");return Ve.set(e,t),t}n(pr,"guardHost");function Oe(e,r){let t=null;for(let a of r){let o=e[a];typeof o=="function"&&(t??={...e},t[a]=pr(o));}return t??e}n(Oe,"guardHostProps");var A=10,l=Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:n(e=>{let r=e?.trim()??"";return r.length>0?`${r} is joining`:l.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:n(e=>{let r=e?.trim()??"";return r.length>0?`Have ${r} nearby and somewhere well lit.`:l.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:n(e=>`${e} MINUTE VISIT`,"lobbyDuration"),joinFailedReason:"That did not open. Try again."});function Ie(e){let r=Math.max(0,Math.floor(e/1e3)),t=String(r%60).padStart(2,"0"),a=Math.floor(r%3600/60),o=Math.floor(r/3600);return o>0?`${o}:${String(a).padStart(2,"0")}:${t}`:`${a}:${t}`}n(Ie,"formatElapsed");function le(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))le(e[r]);}return e}n(le,"deepFreeze");var gr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Pe={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Me={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ae={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},br={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},vr={regular:"400",medium:"500",bold:"700"},Tr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},hr=0,z="System",j="monospace",Er=["content","heading","control","compact","badge"];function Cr(e){let r={};for(let t of Er)r[t]=e;return r}n(Cr,"authoredTierSizes");function Be(){return {family:z,mono:j,fontUrl:null,families:{regular:z,medium:z,bold:z,mono:j,monoMedium:j,monoBold:j},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ae,tierSizes:Cr(Ae),lineHeight:br,weight:vr,letterSpacing:Tr,scale:1,maxScale:hr,scaleCaps:gr}}n(Be,"baseType");var Ne={},oe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ae(e){return `cubic-bezier(${e.join(", ")})`}n(ae,"cssCubicBezier");var _e={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ae(oe.standard),emphasized:ae(oe.emphasized),exit:ae(oe.exit)},reducedMotion:false},xr={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ze=le({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:xr,space:Pe,radius:Me,type:Be(),motion:_e,slots:Ne}),kr={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};le({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:kr,space:Pe,radius:Me,type:Be(),motion:_e,slots:Ne});var je=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),He=globalThis,ie=He[je]??(He[je]=createContext(ze));ie.displayName??="EverfurThemeContext";function k(){return useContext(ie)}n(k,"useEverfurTheme");function Lr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}n(Lr,"tierMultiplier");function m({tier:e="content",...r}){let{type:t}=k(),a=Lr(t,e);return createElement(Text,a===void 0?r:{maxFontSizeMultiplier:a,...r})}n(m,"Text");forwardRef(n(function(r,t){return createElement(TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function We(e,r,t){let a;try{a=r();}catch(p){return se(`optional peer '${e}' is not installed: ${Or(p)}`)}let o=Vr(a);return o==null?se(`optional peer '${e}' resolved to no module`):t&&!t(o)?se(`optional peer '${e}' is present but failed its shape check`):Object.freeze({available:true,module:o})}n(We,"optionalModule");function Vr(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}n(Vr,"unwrapDefault");function se(e){return Object.freeze({available:false,module:null,reason:e})}n(se,"frozenUnavailable");function Or(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}n(Or,"describe");var de="[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then, fall back to VetVisitButton, which opens the visit in the browser and needs no native module.",ue="@daily-co/react-native-daily-js",Ir=`optional peer '${ue}' has no registered loader`,Ge=`optional peer '${ue}' is present but failed its shape check`;function U(e){return typeof e=="object"&&e!==null}n(U,"isRecordLike");function Ar(e){return U(e)&&"box"in e}n(Ar,"isDailyBox");function Pr(e){let r=U(e.default)?e.default:{},t=e.createCallObject??r.createCallObject,a=e.DailyMediaView??r.DailyMediaView,o={createCallObject:t,DailyMediaView:a};return $e(o)?o:null}n(Pr,"normalizeDailyModule");function $e(e){if(!U(e)||typeof e.createCallObject!="function")return false;let r=e.DailyMediaView;return typeof r=="function"||typeof r=="object"&&r!==null}n($e,"isEverfurDailyModule");var Ye=null,g=null;function H(e){return Object.freeze({available:false,module:null,reason:e})}n(H,"unavailable");function Mr(e){Ye=e,g=null;}n(Mr,"registerEverfurDaily");function ce(){if(g!==null)return g;let e=Ye;if(e===null)return g=H(Ir),g;let r=We(ue,()=>({box:e()}),Ar);if(!r.available)return g=H(r.reason),g;let t=r.module.box;if(!U(t))return g=H(Ge),g;let a=Pr(t);return g=a===null?H(Ge):Object.freeze({available:true,module:a}),g}n(ce,"loadEverfurDaily");var v=Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),Ke=3,Xe=180,Ze=420,qe=.35,Ur=.6,Wr=360,Gr=132,$r=184,Yr=44;function Kr({reducedMotion:e,styles:r}){let t=useRef(Array.from({length:Ke},()=>new Animated.Value(qe))).current;return useEffect(()=>{if(e)return;let a=t.map((o,p)=>Animated.loop(Animated.sequence([Animated.delay(p*Xe),Animated.timing(o,{toValue:1,duration:Ze,useNativeDriver:true}),Animated.timing(o,{toValue:qe,duration:Ze,useNativeDriver:true}),Animated.delay((Ke-p-1)*Xe)])));for(let o of a)o.start();return ()=>{for(let o of a)o.stop();}},[e,t]),jsx(View,{style:r.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:t.map((a,o)=>jsx(Animated.View,{style:[r.dot,{opacity:e?Ur:a}]},o))})}n(Kr,"WaitingDots");function Je({label:e,active:r,onPress:t,testID:a,styles:o}){return jsx(Pressable,{onPress:t,testID:a,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[o.control,r?null:o.controlOff],children:jsx(m,{tier:"control",style:o.controlLabel,children:e})})}n(Je,"LobbyControl");function fe(e){let{clinicianName:r,petName:t,micOn:a,cameraOn:o,onToggleMic:p,onToggleCamera:L,onLeave:Y,style:M}=e,T=k(),i=useMemo(()=>Xr(T),[T]),h=useSafeAreaInsets(),{width:s}=useWindowDimensions(),x=s<Wr?Gr:$r;return jsxs(View,{style:[i.root,{paddingTop:h.top+T.space.sm,paddingBottom:h.bottom+T.space.lg},M],testID:"everfur-vet-lobby",children:[jsx(View,{style:i.topRow,children:jsx(Pressable,{onPress:Y,accessibilityRole:"button",accessibilityLabel:l.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:i.leaveHit,children:jsx(m,{tier:"control",style:i.leaveLabel,children:l.leaveCta})})}),jsxs(View,{style:i.center,children:[jsxs(View,{style:[i.avatar,{width:x,height:x,borderRadius:x/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsx(View,{style:i.avatarGlyphHead}),jsx(View,{style:i.avatarGlyphBody})]}),jsxs(View,{accessibilityLiveRegion:"polite",accessible:true,children:[jsx(m,{tier:"heading",style:i.title,testID:"everfur-vet-lobby-title",children:l.lobbyTitle(r)}),jsx(m,{style:i.subtitle,testID:"everfur-vet-lobby-subtitle",children:l.lobbySubtitle})]}),jsx(Kr,{reducedMotion:T.motion.reducedMotion,styles:i})]}),jsxs(View,{style:i.prepCard,testID:"everfur-vet-lobby-prep",children:[jsx(m,{tier:"badge",style:i.prepLabel,children:l.lobbyPrepLabel}),jsx(m,{style:i.prepBody,children:l.lobbyPrep(t)})]}),jsxs(View,{style:i.controls,children:[jsx(Je,{label:a?l.muteCta:l.unmuteCta,active:a,onPress:p,testID:"everfur-vet-lobby-mic",styles:i}),jsx(Je,{label:o?l.cameraOffCta:l.cameraOnCta,active:o,onPress:L,testID:"everfur-vet-lobby-camera",styles:i})]}),jsx(m,{tier:"badge",style:i.duration,testID:"everfur-vet-lobby-duration",children:l.lobbyDuration(10)})]})}n(fe,"EverfurVetCallLobby");function Xr(e){let{color:r,space:t,radius:a,type:o}=e;return StyleSheet.create({root:{flex:1,backgroundColor:r.brand,paddingHorizontal:t.lg},topRow:{flexDirection:"row",alignItems:"center"},leaveHit:{minHeight:Yr,justifyContent:"center",paddingVertical:t.xs,paddingRight:t.md},leaveLabel:{...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:r.success,backgroundColor:v.surface,marginBottom:t.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:v.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:v.glyph},title:{...y(e,"bold"),color:r.text.onBrand,fontSize:o.size.heading,lineHeight:Math.round(o.size.heading*o.lineHeight.snug),textAlign:"center",paddingHorizontal:t.sm},subtitle:{...y(e,"regular"),color:v.textSecondary,fontSize:o.size.body,textAlign:"center",marginTop:t.xs},dotRow:{flexDirection:"row",gap:t.xs,marginTop:t.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:r.success},prepCard:{borderRadius:a.lg,borderWidth:1,borderColor:v.hairline,backgroundColor:v.surface,padding:t.lg,marginBottom:t.lg},prepLabel:{...y(e,"medium"),color:r.accent,fontSize:o.size.micro,letterSpacing:1.2,marginBottom:t.sm},prepBody:{...y(e,"regular"),color:r.text.onBrand,fontSize:o.size.subtitle,lineHeight:Math.round(o.size.subtitle*o.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:t.lg,marginBottom:t.lg},control:{minWidth:96,minHeight:48,paddingHorizontal:t.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:v.surfaceRaised},controlOff:{backgroundColor:v.surfaceActive},controlLabel:{...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.caption},duration:{...y(e,"medium"),color:v.textTertiary,fontSize:o.size.micro,letterSpacing:1.6,textAlign:"center"}})}n(Xr,"makeStyles");function me(e){return e??null}n(me,"asTrack");function qr(e){return !!e?.videoTrack}n(qr,"hasVideo");function pe({label:e,onPress:r,testID:t,muted:a=false,danger:o=false,styles:p}){return jsx(Pressable,{onPress:r,testID:t,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:a},style:[p.control,a?p.controlMuted:null,o?p.controlDanger:null],children:jsx(m,{tier:"control",style:[p.controlLabel,a?p.controlLabelMuted:null],children:e})})}n(pe,"CallControl");function Jr(e){let{roomUrl:r,token:t,onLeave:a,clinicianName:o,petName:p,daily:L,telemetry:Y,onUnavailable:M,renderUnavailable:T,style:i}=Oe(e,["onLeave"]),h=k(),s=useMemo(()=>tt(h),[h]),x=useSafeAreaInsets(),ge=Y??De,K=useRef(ge);useEffect(()=>{K.current=ge;});let X=useRef(a);useEffect(()=>{X.current=a;});let V=useRef(null),[ar,B]=useState("joining"),[Z,lr]=useState(null),[be,ir]=useState(null),[q,sr]=useState(true),[N,dr]=useState(true),[O,ur]=useState(null),[ve,Te]=useState(0),he=te(r,t),R=useMemo(()=>he?L?{available:true,module:L,reason:""}:ce():null,[he,L]),I=R?.available?R.module:null,E=useMemo(()=>R===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:R.available?null:{reason:"dailyMissing",detail:`${de} (${R.reason})`},[R]),J=useRef(false);useEffect(()=>{if(E===null){J.current=false;return}if(ne(M,E.reason,E.detail),!J.current){J.current=true;try{globalThis.console?.warn?.(E.detail);}catch{}}},[E,M]);let _=useCallback(async()=>{let u=V.current;if(V.current=null,!!u){try{await u.leave();}catch{}try{await u.destroy();}catch{}}},[]);useEffect(()=>{if(I===null)return;let u=false,f=I.createCallObject();V.current=f;let ee=n(()=>{let D=Object.values(f.participants());ir(D.find(re=>re.local)??null),lr(D.find(re=>!re.local)??null);},"syncParticipants"),we=["participant-joined","participant-updated","participant-left"];for(let D of we)f.on(D,ee);let Se=n(()=>{u||(B("left"),X.current());},"onLeftMeeting"),Re=n(()=>{u||B("error");},"onError");return f.on("left-meeting",Se),f.on("error",Re),f.join({url:r,token:t}).then(()=>{u||(B("joined"),ur(Date.now()),ee(),K.current.track("televet.call.joined",{provider:"daily"}));}).catch(()=>{u||(B("error"),K.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}));}),()=>{u=true;for(let D of we)f.off(D,ee);f.off("left-meeting",Se),f.off("error",Re),_();}},[I,r,t,_]),useEffect(()=>{if(O===null)return;Te(Date.now()-O);let u=setInterval(()=>{Te(Date.now()-O);},1e3);return ()=>{clearInterval(u);}},[O]);let Ee=useCallback(()=>{let u=V.current;u&&sr(f=>(u.setLocalAudio(!f),!f));},[]),Ce=useCallback(()=>{let u=V.current;u&&dr(f=>(u.setLocalVideo(!f),!f));},[]),Q=useCallback(()=>{_().then(()=>X.current());},[_]);if(E!==null)return T?jsx(Fragment,{children:T(E.reason,E.detail)}):null;if(I===null)return null;if(ar==="error")return jsxs(View,{style:[s.centered,i],testID:"everfur-vet-call-error",children:[jsx(m,{style:s.status,accessibilityLiveRegion:"polite",children:l.joinFailedReason}),jsx(Pressable,{onPress:Q,accessibilityRole:"button",accessibilityLabel:l.leaveCta,testID:"everfur-vet-call-error-leave",style:s.errorLeaveHit,children:jsx(m,{tier:"control",style:s.errorLeave,children:l.leaveCta})})]});if(!qr(Z))return jsx(fe,{clinicianName:o,petName:p,micOn:q,cameraOn:N,onToggleMic:Ee,onToggleCamera:Ce,onLeave:Q,style:i});let xe=I.DailyMediaView,ke=o?.trim()??"",cr=ve>=10*6e4;return jsxs(View,{style:[s.root,i],testID:"everfur-vet-call",children:[jsx(View,{style:s.fill,testID:"everfur-vet-call-remote",children:jsx(xe,{videoTrack:me(Z?.videoTrack),audioTrack:me(Z?.audioTrack),mirror:false,objectFit:"cover",style:s.fill})}),jsxs(View,{style:[s.statusRow,{top:x.top+h.space.sm}],pointerEvents:"none",children:[ke.length>0?jsx(m,{tier:"compact",style:s.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:ke}):null,O!==null?jsx(m,{tier:"badge",style:[s.statusMeta,cr?s.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:Ie(ve)}):null]}),jsx(View,{style:[s.selfView,{top:x.top+h.space.sm}],testID:"everfur-vet-call-self",children:be?.videoTrack&&N?jsx(xe,{videoTrack:me(be.videoTrack),audioTrack:null,mirror:true,objectFit:"cover",style:s.fill}):jsx(View,{style:s.selfViewOff,testID:"everfur-vet-call-self-off",children:jsx(m,{tier:"badge",style:s.selfViewOffLabel,children:l.cameraOnCta})})}),jsxs(View,{style:[s.controlBar,{bottom:x.bottom+h.space.lg}],children:[jsx(pe,{label:q?l.muteCta:l.unmuteCta,muted:!q,onPress:Ee,testID:"everfur-vet-call-mic",styles:s}),jsx(pe,{label:N?l.cameraOffCta:l.cameraOnCta,muted:!N,onPress:Ce,testID:"everfur-vet-call-camera",styles:s}),jsx(pe,{label:l.leaveCta,danger:true,onPress:Q,testID:"everfur-vet-call-leave",styles:s})]})]})}n(Jr,"EverfurVetCall");var rr="#141414",Qr="#1B1B1B",et="rgba(20,20,20,0.62)",rt="#141414",tr=104,nr={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function tt(e){let{color:r,space:t,radius:a,type:o}=e;return StyleSheet.create({root:{flex:1,backgroundColor:rr},fill:{...StyleSheet.absoluteFillObject},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:t.lg,padding:t.xl,backgroundColor:rr},statusRow:{position:"absolute",left:t.md,right:tr+t.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.body,...nr},statusMeta:{...y(e,"mono"),color:r.text.onBrand,fontSize:o.size.caption,...nr},statusMetaOver:{color:r.danger},selfView:{position:"absolute",right:t.md,width:tr,height:148,borderRadius:a.lg,overflow:"hidden",backgroundColor:Qr,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xs},selfViewOffLabel:{...y(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:o.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:t.md},control:{minWidth:76,minHeight:56,paddingHorizontal:t.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:et},controlMuted:{backgroundColor:r.text.onBrand},controlDanger:{backgroundColor:r.danger},controlLabel:{...y(e,"medium"),color:r.text.onBrand,fontSize:o.size.caption},controlLabelMuted:{color:rt},status:{...y(e,"medium"),fontSize:o.size.subtitle,lineHeight:Math.round(o.size.subtitle*o.lineHeight.relaxed),color:r.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:t.lg},errorLeave:{...y(e,"medium"),color:r.surface,fontSize:o.size.body,textDecorationLine:"underline"}})}n(tt,"makeStyles");export{de as EVERFUR_DAILY_SETUP,Jr as EverfurVetCall,fe as EverfurVetCallLobby,A as VET_CALL_CONSULT_MINUTES,l as VET_CALL_COPY,$e as isEverfurDailyModule,Fe as isSafeRoomUrl,te as isUsableRoomCredential,ce as loadEverfurDaily,Mr as registerEverfurDaily};
|
|
1
|
+
import {createContext,forwardRef,createElement,useMemo,useRef,useEffect,useState,useCallback,useContext}from'react';import {StyleSheet,TextInput,useWindowDimensions,View,Pressable,Text,Animated}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var Nt=Object.defineProperty;var o=(e,t)=>Nt(e,"name",{value:t,configurable:true});var Mt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function b(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[Mt[t]]}}o(b,"face");var $e=Object.freeze({track(){},trackExpectedFailure(){}});function Ye(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(Ye,"isSafeRoomUrl");function be(e,t){return Ye(e)&&t.trim().length>0}o(be,"isUsableRoomCredential");function qe(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(qe,"reportHostFailure");function _t(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(_t,"isThenable");function ge(e,...t){if(typeof e=="function")try{let r=e(...t);return _t(r)&&Promise.resolve(r).then(void 0,qe),r}catch(r){qe(r);return}}o(ge,"callHost");var Ke=new WeakMap;function jt(e){if(typeof e!="function")return;let t=Ke.get(e);if(t!==void 0)return t;let r=o((...a)=>{ge(e,...a);},"guarded");return Ke.set(e,r),r}o(jt,"guardHost");function Je(e,t){let r=null;for(let a of t){let n=e[a];typeof n=="function"&&(r??={...e},r[a]=jt(n));}return r??e}o(Je,"guardHostProps");var W=10,i=Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:i.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:i.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function Ze(e){let t=Math.max(0,Math.floor(e/1e3)),r=String(t%60).padStart(2,"0"),a=Math.floor(t%3600/60),n=Math.floor(t/3600);return n>0?`${n}:${String(a).padStart(2,"0")}:${r}`:`${a}:${r}`}o(Ze,"formatElapsed");function Ce(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Ce(e[t]);}return e}o(Ce,"deepFreeze");var Ht=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Qe={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},et={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Xe={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Ut={regular:"400",medium:"500",bold:"700"},Wt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Gt=0,re="System",oe="monospace",$t=["content","heading","control","compact","badge"];function Yt(e){let t={};for(let r of $t)t[r]=e;return t}o(Yt,"authoredTierSizes");function tt(){return {family:re,mono:oe,fontUrl:null,families:{regular:re,medium:re,bold:re,mono:oe,monoMedium:oe,monoBold:oe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Xe,tierSizes:Yt(Xe),lineHeight:zt,weight:Ut,letterSpacing:Wt,scale:1,maxScale:Gt,scaleCaps:Ht}}o(tt,"baseType");var rt={},he=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ve(e){return `cubic-bezier(${e.join(", ")})`}o(ve,"cssCubicBezier");var ot={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ve(he.standard),emphasized:ve(he.emphasized),exit:ve(he.exit)},reducedMotion:false},qt={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},nt=Ce({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qt,space:Qe,radius:et,type:tt(),motion:ot,slots:rt}),Kt={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Ce({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Kt,space:Qe,radius:et,type:tt(),motion:ot,slots:rt});var at=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),lt=globalThis,Te=lt[at]??(lt[at]=createContext(nt));Te.displayName??="EverfurThemeContext";function O(){return useContext(Te)}o(O,"useEverfurTheme");function tr(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}o(tr,"tierMultiplier");function g({tier:e="content",...t}){let{type:r}=O(),a=tr(r,e);return createElement(Text,a===void 0?t:{maxFontSizeMultiplier:a,...t})}o(g,"Text");forwardRef(o(function(t,r){return createElement(TextInput,{...t,...r===null?{}:{ref:r}})},"TextInput"));function st(e,t,r){let a;try{a=t();}catch(h){return xe(`optional peer '${e}' is not installed: ${or(h)}`)}let n=rr(a);return n==null?xe(`optional peer '${e}' resolved to no module`):r&&!r(n)?xe(`optional peer '${e}' is present but failed its shape check`):Object.freeze({available:true,module:n})}o(st,"optionalModule");function rr(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}o(rr,"unwrapDefault");function xe(e){return Object.freeze({available:false,module:null,reason:e})}o(xe,"frozenUnavailable");function or(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}o(or,"describe");var dt=Symbol.for("@everfur/sdk/televet");function nr(){let e=globalThis,t=e[dt];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[dt]=r,r}o(nr,"televetGlobal");function ut(e){nr().dailyRegistered=e;}o(ut,"markEverfurDailyRegistered");var Ee=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,ke="@daily-co/react-native-daily-js",ar=`optional peer '${ke}' has no registered loader`,ct=`optional peer '${ke}' is present but failed its shape check`;function ae(e){return typeof e=="object"&&e!==null}o(ae,"isRecordLike");function lr(e){return ae(e)&&"box"in e}o(lr,"isDailyBox");function ir(e){let t=ae(e.default)?e.default:{},r=e.createCallObject??t.createCallObject,a=e.DailyMediaView??t.DailyMediaView,n={createCallObject:r,DailyMediaView:a};return ft(n)?n:null}o(ir,"normalizeDailyModule");function ft(e){if(!ae(e)||typeof e.createCallObject!="function")return false;let t=e.DailyMediaView;return typeof t=="function"||typeof t=="object"&&t!==null}o(ft,"isEverfurDailyModule");var yt=null,T=null;function ne(e){return Object.freeze({available:false,module:null,reason:e})}o(ne,"unavailable");function sr(e){yt=e,T=null,ut(e!==null);}o(sr,"registerEverfurDaily");function we(){if(T!==null)return T;let e=yt;if(e===null)return T=ne(ar),T;let t=st(ke,()=>({box:e()}),lr);if(!t.available)return T=ne(t.reason),T;let r=t.module.box;if(!ae(r))return T=ne(ct),T;let a=ir(r);return T=a===null?ne(ct):Object.freeze({available:true,module:a}),T}o(we,"loadEverfurDaily");function _({label:e,glyph:t,onPress:r,testID:a,muted:n=false,style:h}){return jsx(Pressable,{onPress:r,testID:a,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:n},style:h,children:t})}o(_,"CallControl");function G({children:e,testID:t}){return jsx(View,{style:c.box,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:t,children:e})}o(G,"GlyphBox");function Re({color:e}){return jsx(View,{style:[c.slash,{backgroundColor:e}]})}o(Re,"Slash");function le({color:e,off:t=false}){return jsxs(G,{testID:t?"glyph-mic-off":"glyph-mic",children:[jsxs(View,{style:c.column,children:[jsx(View,{style:[c.micCapsule,{borderColor:e}]}),jsx(View,{style:[c.micCradle,{borderColor:e}]}),jsx(View,{style:[c.micStem,{backgroundColor:e}]})]}),t?jsx(Re,{color:e}):null]})}o(le,"MicGlyph");function ie({color:e,off:t=false}){return jsxs(G,{testID:t?"glyph-camera-off":"glyph-camera",children:[jsxs(View,{style:c.row,children:[jsx(View,{style:[c.cameraBody,{borderColor:e}]}),jsx(View,{style:[c.cameraLens,{borderRightColor:e}]})]}),t?jsx(Re,{color:e}):null]})}o(ie,"CameraGlyph");function pt({color:e,off:t=false}){return jsxs(G,{testID:t?"glyph-speaker-off":"glyph-speaker",children:[jsxs(View,{style:c.row,children:[jsx(View,{style:[c.speakerBox,{backgroundColor:e}]}),jsx(View,{style:[c.speakerCone,{borderRightColor:e}]}),t?null:jsx(View,{style:[c.speakerWave,{borderColor:e}]})]}),t?jsx(Re,{color:e}):null]})}o(pt,"SpeakerGlyph");function se({color:e}){return jsx(G,{testID:"glyph-switch-camera",children:jsxs(View,{style:[c.switchBody,{borderColor:e}],children:[jsx(View,{style:[c.switchTurn,{borderColor:e,borderTopColor:"transparent"}]}),jsx(View,{style:[c.switchHead,{borderBottomColor:e}]})]})})}o(se,"SwitchCameraGlyph");function mt({color:e}){return jsx(G,{testID:"glyph-leave",children:jsxs(View,{style:c.column,children:[jsx(View,{style:[c.receiver,{borderColor:e}]}),jsxs(View,{style:c.receiverPads,children:[jsx(View,{style:[c.receiverPad,{backgroundColor:e}]}),jsx(View,{style:[c.receiverPad,{backgroundColor:e}]})]})]})})}o(mt,"LeaveGlyph");var c=StyleSheet.create({box:{width:24,height:24,alignItems:"center",justifyContent:"center"},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"center"},slash:{position:"absolute",width:2,height:28,borderRadius:1,transform:[{rotate:"-45deg"}]},micCapsule:{width:10,height:14,borderRadius:5,borderWidth:2},micCradle:{width:16,height:8,marginTop:-5,borderWidth:2,borderTopWidth:0,borderBottomLeftRadius:8,borderBottomRightRadius:8},micStem:{width:2,height:3},cameraBody:{width:14,height:12,borderRadius:3,borderWidth:2},cameraLens:{width:0,height:0,marginLeft:1,borderTopWidth:5,borderBottomWidth:5,borderRightWidth:6,borderTopColor:"transparent",borderBottomColor:"transparent"},speakerBox:{width:4,height:8,borderRadius:1},speakerCone:{width:0,height:0,borderTopWidth:7,borderBottomWidth:7,borderRightWidth:7,borderTopColor:"transparent",borderBottomColor:"transparent",transform:[{rotate:"180deg"}]},speakerWave:{width:7,height:12,marginLeft:2,borderWidth:2,borderLeftWidth:0,borderTopRightRadius:6,borderBottomRightRadius:6},switchBody:{width:20,height:15,borderRadius:3,borderWidth:2,alignItems:"center",justifyContent:"center"},switchTurn:{width:9,height:9,borderRadius:4.5,borderWidth:2},switchHead:{position:"absolute",top:2,right:4,width:0,height:0,borderLeftWidth:3,borderRightWidth:3,borderBottomWidth:4,borderLeftColor:"transparent",borderRightColor:"transparent"},receiver:{width:22,height:10,borderWidth:3,borderBottomWidth:0,borderTopLeftRadius:11,borderTopRightRadius:11},receiverPads:{flexDirection:"row",width:22,justifyContent:"space-between",marginTop:-1},receiverPad:{width:5,height:4,borderRadius:1}});var S=Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),bt=3,gt=180,ht=420,vt=.35,gr=.6,hr=360,vr=132,Cr=184,Tr=44;function xr({reducedMotion:e,styles:t}){let r=useRef(Array.from({length:bt},()=>new Animated.Value(vt))).current;return useEffect(()=>{if(e)return;let a=r.map((n,h)=>Animated.loop(Animated.sequence([Animated.delay(h*gt),Animated.timing(n,{toValue:1,duration:ht,useNativeDriver:true}),Animated.timing(n,{toValue:vt,duration:ht,useNativeDriver:true}),Animated.delay((bt-h-1)*gt)])));for(let n of a)n.start();return ()=>{for(let n of a)n.stop();}},[e,r]),jsx(View,{style:t.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:r.map((a,n)=>jsx(Animated.View,{style:[t.dot,{opacity:e?gr:a}]},n))})}o(xr,"WaitingDots");function Se({label:e,glyph:t,active:r,onPress:a,testID:n,styles:h}){return jsx(Pressable,{onPress:a,testID:n,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[h.control,r?null:h.controlOff],children:t})}o(Se,"LobbyControl");function De(e){let{clinicianName:t,petName:r,micOn:a,cameraOn:n,onToggleMic:h,onToggleCamera:k,onSwitchCamera:q,onLeave:K,style:J}=e,v=O(),s=useMemo(()=>Er(v),[v]),l=useSafeAreaInsets(),{width:F}=useWindowDimensions(),P=F<hr?vr:Cr;return jsxs(View,{style:[s.root,{paddingTop:l.top+v.space.sm,paddingBottom:l.bottom+v.space.lg},J],testID:"everfur-vet-lobby",children:[jsx(View,{style:s.topRow,children:jsx(Pressable,{onPress:K,accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:s.leaveHit,children:jsx(g,{tier:"control",style:s.leaveLabel,children:i.leaveCta})})}),jsxs(View,{style:s.center,children:[jsxs(View,{style:[s.avatar,{width:P,height:P,borderRadius:P/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsx(View,{style:s.avatarGlyphHead}),jsx(View,{style:s.avatarGlyphBody})]}),jsxs(View,{accessibilityLiveRegion:"polite",accessible:true,children:[jsx(g,{tier:"heading",style:s.title,testID:"everfur-vet-lobby-title",children:i.lobbyTitle(t)}),jsx(g,{style:s.subtitle,testID:"everfur-vet-lobby-subtitle",children:i.lobbySubtitle})]}),jsx(xr,{reducedMotion:v.motion.reducedMotion,styles:s})]}),jsxs(View,{style:s.prepCard,testID:"everfur-vet-lobby-prep",children:[jsx(g,{tier:"badge",style:s.prepLabel,children:i.lobbyPrepLabel}),jsx(g,{style:s.prepBody,children:i.lobbyPrep(r)})]}),jsxs(View,{style:s.controls,children:[jsx(Se,{label:a?i.muteCta:i.unmuteCta,glyph:jsx(le,{color:v.color.text.onBrand,off:!a}),active:a,onPress:h,testID:"everfur-vet-lobby-mic",styles:s}),jsx(Se,{label:n?i.cameraOffCta:i.cameraOnCta,glyph:jsx(ie,{color:v.color.text.onBrand,off:!n}),active:n,onPress:k,testID:"everfur-vet-lobby-camera",styles:s}),n&&q?jsx(Se,{label:i.switchCameraCta,glyph:jsx(se,{color:v.color.text.onBrand}),active:true,onPress:q,testID:"everfur-vet-lobby-switch-camera",styles:s}):null]}),jsx(g,{tier:"badge",style:s.duration,testID:"everfur-vet-lobby-duration",children:i.lobbyDuration(10)})]})}o(De,"EverfurVetCallLobby");function Er(e){let{color:t,space:r,radius:a,type:n}=e;return StyleSheet.create({root:{flex:1,backgroundColor:t.brand,paddingHorizontal:r.lg},topRow:{flexDirection:"row",alignItems:"center"},leaveHit:{minHeight:Tr,justifyContent:"center",paddingVertical:r.xs,paddingRight:r.md},leaveLabel:{...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:t.success,backgroundColor:S.surface,marginBottom:r.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:S.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:S.glyph},title:{...b(e,"bold"),color:t.text.onBrand,fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.snug),textAlign:"center",paddingHorizontal:r.sm},subtitle:{...b(e,"regular"),color:S.textSecondary,fontSize:n.size.body,textAlign:"center",marginTop:r.xs},dotRow:{flexDirection:"row",gap:r.xs,marginTop:r.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:t.success},prepCard:{borderRadius:a.lg,borderWidth:1,borderColor:S.hairline,backgroundColor:S.surface,padding:r.lg,marginBottom:r.lg},prepLabel:{...b(e,"medium"),color:t.accent,fontSize:n.size.micro,letterSpacing:1.2,marginBottom:r.sm},prepBody:{...b(e,"regular"),color:t.text.onBrand,fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:r.lg,marginBottom:r.lg},control:{minWidth:64,minHeight:48,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:S.surfaceRaised},controlOff:{backgroundColor:S.surfaceActive},duration:{...b(e,"medium"),color:S.textTertiary,fontSize:n.size.micro,letterSpacing:1.6,textAlign:"center"}})}o(Er,"makeStyles");function Tt(e){let[t,r]=useState(true),a=useRef(true),n=useCallback(()=>{let h=e.current;if(!h?.setNativeInCallAudioMode)return;let k=!a.current;a.current=k,r(k),h.setNativeInCallAudioMode(k?"video":"voice");},[e]);return {speakerOn:t,toggleSpeaker:n}}o(Tt,"useSpeakerRoute");function Ie(e){return e??null}o(Ie,"asTrack");function Dr(e){return !!e?.videoTrack}o(Dr,"hasVideo");function Lr({styles:e}){return jsxs(View,{style:e.remoteOffAvatar,accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsx(View,{style:e.remoteOffHead}),jsx(View,{style:e.remoteOffBody})]})}o(Lr,"PersonMark");function Vr(e){let{roomUrl:t,token:r,onLeave:a,clinicianName:n,petName:h,daily:k,telemetry:q,onUnavailable:K,renderUnavailable:J,style:v}=Je(e,["onLeave"]),s=O(),l=useMemo(()=>Ir(s),[s]),F=useSafeAreaInsets(),P=q??$e,ue=useRef(P);useEffect(()=>{ue.current=P;});let Z=useRef(a);useEffect(()=>{Z.current=a;});let I=useRef(null),[ce,wt]=useState(false),[Rt,X]=useState("joining"),[Q,St]=useState(null),[Be,Dt]=useState(null),[B,Lt]=useState(true),[w,Vt]=useState(true),{speakerOn:H,toggleSpeaker:Ft}=Tt(I),[It,Ot]=useState(true),[fe,Pt]=useState({flip:false,speaker:false}),[z,Bt]=useState(null),[Ae,Ne]=useState(0),Me=be(t,r),A=useMemo(()=>Me?k?{available:true,module:k,reason:""}:we():null,[Me,k]),U=A?.available?A.module:null,L=useMemo(()=>A===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:A.available?null:{reason:"dailyMissing",detail:`${Ee} (${A.reason})`},[A]),ye=useRef(false);useEffect(()=>{if(L===null){ye.current=false;return}if(ge(K,L.reason,L.detail),!ye.current){ye.current=true;try{globalThis.console?.warn?.(L.detail);}catch{}}},[L,K]);let ee=useCallback(async()=>{let y=I.current;if(I.current=null,!!y){try{await y.leave();}catch{}try{await y.destroy();}catch{}}},[]);useEffect(()=>{if(U===null||!ce)return;let y=false,m=U.createCallObject();I.current=m,Pt({flip:typeof m.cycleCamera=="function",speaker:typeof m.setNativeInCallAudioMode=="function"});let N=o(()=>{let M=Object.values(m.participants());Dt(M.find(me=>me.local)??null),St(M.find(me=>!me.local)??null);},"syncParticipants"),Ue=["participant-joined","participant-updated","participant-left"];for(let M of Ue)m.on(M,N);let We=o(()=>{y||(X("left"),Z.current());},"onLeftMeeting"),Ge=o(()=>{y||X("error");},"onError");return m.on("left-meeting",We),m.on("error",Ge),m.join({url:t,token:r}).then(()=>{y||(X("joined"),Bt(Date.now()),N(),ue.current.track("televet.call.joined",{provider:"daily"}));}).catch(()=>{y||(X("error"),ue.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}));}),()=>{y=true;for(let M of Ue)m.off(M,N);m.off("left-meeting",We),m.off("error",Ge),ee();}},[U,ce,t,r,ee]),useEffect(()=>{if(z===null)return;Ne(Date.now()-z);let y=setInterval(()=>{Ne(Date.now()-z);},1e3);return ()=>{clearInterval(y);}},[z]);let _e=useCallback(()=>{let y=I.current;y&&Lt(m=>(y.setLocalAudio(!m),!m));},[]),je=useCallback(()=>{let y=I.current;y&&Vt(m=>(y.setLocalVideo(!m),!m));},[]),He=useCallback(()=>{let y=I.current;y?.cycleCamera&&y.cycleCamera().then(m=>{let N=m?.device?.facingMode;N&&Ot(N==="user");},()=>{});},[]),pe=useCallback(()=>{ee().then(()=>Z.current());},[ee]);if(L!==null)return J?jsx(Fragment,{children:J(L.reason,L.detail)}):null;if(U===null)return null;if(!ce)return jsxs(View,{style:[l.notice,{paddingTop:F.top+s.space.xl,paddingBottom:F.bottom+s.space.xl},v],testID:"everfur-vet-call-recording-notice",children:[jsx(g,{style:l.noticeTitle,accessibilityRole:"header",children:i.recordingNoticeTitle}),jsx(Pressable,{onPress:()=>wt(true),accessibilityRole:"button",accessibilityLabel:i.recordingNoticeCta,testID:"everfur-vet-call-recording-continue",style:l.noticeContinue,children:jsx(g,{tier:"control",style:l.noticeContinueLabel,children:i.recordingNoticeCta})}),jsx(Pressable,{onPress:()=>Z.current(),accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-call-recording-leave",style:l.errorLeaveHit,children:jsx(g,{tier:"control",style:l.noticeLeave,children:i.leaveCta})})]});if(Rt==="error")return jsxs(View,{style:[l.centered,v],testID:"everfur-vet-call-error",children:[jsx(g,{style:l.status,accessibilityLiveRegion:"polite",children:i.joinFailedReason}),jsx(Pressable,{onPress:pe,accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-call-error-leave",style:l.errorLeaveHit,children:jsx(g,{tier:"control",style:l.errorLeave,children:i.leaveCta})})]});if(Q===null)return jsx(De,{clinicianName:n,petName:h,micOn:B,cameraOn:w,onToggleMic:_e,onToggleCamera:je,...fe.flip?{onSwitchCamera:He}:{},onLeave:pe,style:v});let ze=U.DailyMediaView,te=n?.trim()??"",At=Ae>=10*6e4;return jsxs(View,{style:[l.root,v],testID:"everfur-vet-call",children:[jsxs(View,{style:l.fill,testID:"everfur-vet-call-remote",children:[jsx(ze,{videoTrack:Ie(Q.videoTrack),audioTrack:Ie(Q.audioTrack),mirror:false,objectFit:"cover",style:l.fill}),Dr(Q)?null:jsxs(View,{style:l.remoteOff,testID:"everfur-vet-call-remote-camera-off",children:[jsx(Lr,{styles:l}),te.length>0?jsx(g,{style:l.remoteOffName,numberOfLines:1,children:te}):null]})]}),jsxs(View,{style:[l.statusRow,{top:F.top+s.space.sm}],pointerEvents:"none",children:[te.length>0?jsx(g,{tier:"compact",style:l.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:te}):null,z!==null?jsx(g,{tier:"badge",style:[l.statusMeta,At?l.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:Ze(Ae)}):null]}),jsxs(View,{style:[l.selfView,{top:F.top+s.space.sm}],testID:"everfur-vet-call-self",children:[jsx(ze,{videoTrack:w?Ie(Be?.videoTrack):null,audioTrack:null,mirror:It,objectFit:"cover",style:l.fill}),Be?.videoTrack&&w?null:jsx(View,{style:[l.selfViewOff,l.fill],testID:"everfur-vet-call-self-off",children:jsx(g,{tier:"badge",style:l.selfViewOffLabel,children:i.selfCameraOffLabel})})]}),jsxs(View,{style:[l.controlBar,{bottom:F.bottom+s.space.lg}],children:[fe.speaker?jsx(_,{label:H?i.speakerOffCta:i.speakerOnCta,glyph:jsx(pt,{color:H?s.color.text.onBrand:Pe,off:!H}),muted:!H,onPress:Ft,testID:"everfur-vet-call-speaker",style:[l.control,H?null:l.controlMuted]}):null,jsx(_,{label:B?i.muteCta:i.unmuteCta,glyph:jsx(le,{color:B?s.color.text.onBrand:Pe,off:!B}),muted:!B,onPress:_e,testID:"everfur-vet-call-mic",style:[l.control,B?null:l.controlMuted]}),jsx(_,{label:w?i.cameraOffCta:i.cameraOnCta,glyph:jsx(ie,{color:w?s.color.text.onBrand:Pe,off:!w}),muted:!w,onPress:je,testID:"everfur-vet-call-camera",style:[l.control,w?null:l.controlMuted]}),fe.flip&&w?jsx(_,{label:i.switchCameraCta,glyph:jsx(se,{color:s.color.text.onBrand}),onPress:He,testID:"everfur-vet-call-switch-camera",style:l.control}):null,jsx(_,{label:i.leaveCta,glyph:jsx(mt,{color:s.color.text.onBrand}),onPress:pe,testID:"everfur-vet-call-leave",style:[l.control,l.controlDanger]})]})]})}o(Vr,"EverfurVetCall");var Oe="#141414",xt="#1B1B1B",Fr="rgba(20,20,20,0.62)",Pe="#141414",Et=104,kt={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function Ir(e){let{color:t,space:r,radius:a,type:n}=e;return StyleSheet.create({root:{flex:1,backgroundColor:Oe},fill:{...StyleSheet.absoluteFillObject},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:r.lg,padding:r.xl,backgroundColor:Oe},statusRow:{position:"absolute",left:r.md,right:Et+r.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.body,...kt},statusMeta:{...b(e,"mono"),color:t.text.onBrand,fontSize:n.size.caption,...kt},statusMetaOver:{color:t.danger},selfView:{position:"absolute",right:r.md,width:Et,height:148,borderRadius:a.lg,overflow:"hidden",backgroundColor:xt,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{alignItems:"center",justifyContent:"center",paddingHorizontal:r.xs,backgroundColor:xt},remoteOff:{...StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center",gap:r.md,backgroundColor:Oe},remoteOffAvatar:{width:96,height:96,borderRadius:a.pill,overflow:"hidden",alignItems:"center",justifyContent:"flex-end",backgroundColor:"rgba(255,255,255,0.14)"},remoteOffHead:{width:36,height:36,borderRadius:18,marginBottom:6,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffBody:{width:64,height:28,borderTopLeftRadius:32,borderTopRightRadius:32,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffName:{...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.subtitle,paddingHorizontal:r.xl},notice:{flex:1,justifyContent:"center",gap:r.lg,paddingHorizontal:r.xl,backgroundColor:t.surface},noticeTitle:{...b(e,"medium"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed),color:t.text.primary},noticeContinue:{minHeight:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.xl,borderRadius:a.pill,backgroundColor:t.primary},noticeContinueLabel:{...b(e,"medium"),color:t.onPrimary,fontSize:n.size.body},noticeLeave:{...b(e,"medium"),color:t.brand,fontSize:n.size.body},selfViewOffLabel:{...b(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:n.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:r.sm},control:{minWidth:54,minHeight:56,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:Fr},controlMuted:{backgroundColor:t.text.onBrand},controlDanger:{backgroundColor:t.danger},status:{...b(e,"medium"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed),color:t.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.lg},errorLeave:{...b(e,"medium"),color:t.surface,fontSize:n.size.body,textDecorationLine:"underline"}})}o(Ir,"makeStyles");export{Ee as EVERFUR_DAILY_SETUP,Vr as EverfurVetCall,De as EverfurVetCallLobby,W as VET_CALL_CONSULT_MINUTES,i as VET_CALL_COPY,ft as isEverfurDailyModule,Ye as isSafeRoomUrl,be as isUsableRoomCredential,we as loadEverfurDaily,sr as registerEverfurDaily};
|