1import{j as e,w as q,ao as kn,bH as Dn,bI as In,am as de,br as Ln,bJ as On,aR as Mn,aU as Bn,bK as Fn,b7 as Vn,b1 as zn,ax as Un,aA as $n,an as nt,bL as Gn,b0 as Hn,y as at,bq as Wn,bM as qn,bN as Ys,i as Yn,bO as ze,X as Xn}from"./vendor-ui-DhwAFPcH.js";import{a as l,L as Y,u as rt,h as lt}from"./vendor-react-B5040HA_.js";import{u as Kn,P as Qn}from"./usePlacesAutocomplete-BJ064Wqp.js";import{l as Xs,P as Zn}from"./PlusEditablePetPhoto-X3Pmm1GD.js";import{P as v,a as le,p as Jn}from"./PlusInput-C1CZCQvl.js";import{P as ea}from"./PlusPill-ChxGYqZI.js";import{H as B,k as ce,ae as ve,P as je,w as sa,b1 as ta,ab as na,a7 as qe,K as aa,M as ra,s as la,b7 as oa,af as ot,u as ia,ax as da,b8 as Ks,a8 as ca,aM as ua,aj as pa,b9 as ma,b5 as xa,b6 as ha,b4 as fa}from"./index-B-lFFyPG.js";import{P as ba,a as it,t as ga,l as ya}from"./passportLinks-BZ3d0WeH.js";import{P as dt}from"./PlusTextLink-DvLwJcho.js";import{c as va,u as ja,b as Na}from"./usePlusPassportPdf-Q3i0G4TS.js";import{f as F}from"./passportContact-DnK-yDxy.js";import{u as ct,a as Pa,b as wa,P as Ea,c as Sa,d as Ca,e as Ta}from"./usePlusPassportTitle-8rlskAtt.js";import{a as Aa}from"./useTrackFeatureVisit-L9LBRXnd.js";import{i as ut,f as Ra,s as _a}from"./prescriptionStatus-CBPvrbTa.js";import{d as ka}from"./dancingdog-D7BDwhrs.js";import{y as Da}from"./yellowbackgroundpattern-BUfCnHj9.js";import{u as Ia,a as La,b as Oa,c as Ma,d as Ba,e as Fa,p as Va,f as za,g as Ua,h as $a,U as Qs,A as Ga,s as Ha,i as Zs,j as Wa,k as qa}from"./usePlusPetDocuments-Jo1NTJou.js";import{u as Ya}from"./householdRowDeletion-fOUZAJXV.js";import{ap as Xa,aq as Ka,ar as Qa,as as Za,at as Ja,_ as er,l as sr}from"./lemonadeQuote-DQOAxNhY.js";import{P as tr,a as nr}from"./PlusTopBar-JmEUQrKU.js";import{P as ar}from"./PlusErrorState-CvM5GXRt.js";import{f as pt,n as mt}from"./ownerPhone-Cj2GmpJ9.js";import{m as rr}from"./logo_mobile-Bt5VixWL.js";import{P as lr}from"./PlusPassportUnlock-XLL9MMHp.js";import{b as X,P as or,a as Ue}from"./PlusSkeleton-CPWLpt8u.js";import{u as ir,P as dr,p as cr}from"./plusWelcome-B-w7EGjU.js";import{p as ur,b as xt}from"./locationTypes-54otQMmi.js";import{f as pr}from"./money-C1jVN98N.js";import{v as mr,a as xr}from"./vaccineExpiry-1lrfFVpk.js";import{P as hr,a as fr}from"./plusStyles-c7wYrMpB.js";import{u as br}from"./usePlusAccountGate-CURDTLAA.js";import{u as gr}from"./usePlusAddPet-BGhnEldB.js";import{a as yr}from"./usePlusBreedOptions-DYLgw0Pj.js";import{u as vr,b as jr,a as Nr}from"./usePlusVaccines-B-dRDiLO.js";import{u as Pr}from"./usePlusHiddenCareTeamRoles-O2ijGUQQ.js";import{u as wr}from"./usePlusHubPlanAction-CIOHfT8H.js";import{u as Er}from"./usePlusInsurance-hoxwT6sv.js";import{u as Sr}from"./usePlusOwnerProfile-7FBbu7Rm.js";import{c as Cr}from"./clarityMasking-D7XpGDea.js";import"./vendor-supabase-DcqDzb1Y.js";import"./formatDate-C1YDOIKi.js";import"./usePlusCareTeamMutations-C3jSsAcg.js";import"./imageConversion-BgfVu3O2.js";import"./types-CAanMygJ.js";import"./hero-pets-new-D0ywH176.js";import"./PlusSignUpForm-7maomaqB.js";import"./PlusCheckbox-C-MQnkct.js";import"./mascot_dog-BuYP3GdN.js";import"./freePlanPetLimit-DGN_CgXi.js";import"./usePlusHouseholds-Cj9bsruz.js";import"./ensurePlusAuth-FDCpHdoV.js";import"./breedDatabase-CHQVr430.js";import"./placesContent-BqGlcMFy.js";const ht="plus-passport-section-heading m-0 font-plus-header text-plus-h4 font-semibold text-plus-text-primary";function Js({item:s,isLast:t,action:r}){return e.jsxs("div",{className:"flex break-inside-avoid flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-plus-body text-plus-body-md font-semibold text-plus-text-primary",children:va(s)}),s.startedAt&&e.jsx("span",{className:"shrink-0 font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:F(s.startedAt)})]}),s.veterinarianName&&e.jsxs("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:["With ",s.veterinarianName," · FirstVet"]}),!s.veterinarianName&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:"FirstVet"}),s.diagnosis&&e.jsxs("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-primary",children:["Diagnosis: ",s.diagnosis]}),s.recommendation&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:s.recommendation}),r,!t&&e.jsx("div",{className:"mt-3 border-t border-plus-border"})]})}
1function Tr({petId:s,petName:t,headingLevel:r=4}){const i=r===2?"h2":"h4",{consultations:a,unattributed:o,assign:d,isAssigning:c,assignError:p}=ct(s);return e.jsx("div",{className:B("mt-8 border-t border-plus-border pt-8 print:mt-5 print:pt-5"),children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(i,{className:ht,children:ba.consultations}),e.jsxs("div",{className:"flex flex-col gap-3",children:[a.length===0&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:it.consultations}),a.map((u,x)=>e.jsx(Js,{item:u,isLast:x===a.length-1&&o.length===0},u.id)),o.length>0&&e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-plus-primary/10 px-4 py-3 print:hidden",children:[e.jsx("span",{className:"font-plus-body text-plus-body-sm font-semibold text-plus-text-primary",children:o.length===1?"A consultation is not linked to a pet yet.":`${o.length} consultations are not linked to a pet yet.`}),o.map((u,x)=>e.jsx(Js,{item:u,isLast:x===o.length-1,action:e.jsx("div",{className:"mt-1",children:e.jsx(dt,{label:c?"Addingâ¦":`Add to ${t}'s record`,icon:q,iconPosition:"left",size:"small",color:"primary",onClick:()=>{c||d(u.id).catch(()=>{})}})})},u.id)),p&&e.jsx("span",{role:"alert",className:"font-plus-body text-plus-body-sm font-normal text-plus-error",children:"We couldn't link that consultation. Please try again."})]})]})]})})}function Ar(s){if(s.length===0)return null;if(s.length===1)return`Add your ${s[0]} to complete your passport.`;const t=s.slice(0,-1).join(", "),r=s[s.length-1];return`Add your ${t} and ${r} to reach 100%.`}function Rr(s){const t=[{label:"age",value:s.age||s.birthday},{label:"weight",value:s.weight},{label:"sex",value:s.sex},{label:"zip",value:s.zip},{label:"chip ID",value:s.chipId},{label:"photo",value:s.photo},{label:"primary vet",value:s.primaryVetName,skipped:s.primaryVetHidden},{label:"insurance",value:s.insuranceProvider},{label:"care and feeding notes",value:s.careNotes}].filter(a=>!a.skipped),r=t.filter(a=>!!a.value).length,i=t.filter(a=>!a.value).map(a=>a.label);return{percent:Math.round(r/t.length*100),filledCount:r,totalCount:t.length,missingFields:i,missingSummary:Ar(i)}}const _r="/assets/onboarding2_breedguide_bgart-CUsCw3pd.png",kr="/assets/passport-GY7ejrBb.png";function Dr({petName:s,currentProvider:t,pendingProvider:r,isResolving:i,onConfirm:a,onDismiss:o}){return!r||r.trim().toLowerCase()===t.trim().toLowerCase()?null:e.jsxs("div",{role:"status",className:"flex flex-col gap-3 rounded-2xl bg-plus-fill-yellow p-4 print:hidden",children:[e.jsx("p",{className:"m-0 font-plus-body text-plus-body-md font-semibold text-plus-text-primary",children:Xa(r)}),e.jsx("p",{className:"m-0 font-plus-body text-plus-body-sm font-normal text-plus-text-secondary [overflow-wrap:anywhere]",children:Ka(s,r,t)}),e.jsx("p",{className:"m-0 font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:Qa}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(ce,{label:Za(r),variant:"primary",disabled:i,onClick:a}),e.jsx(ce,{label:Ja(t),variant:"outline",disabled:i,onClick:o})]})]})}function ft(s){return s?.toLowerCase()==="cat"?"cat":"dog"}function Ir(s){return ft(s)==="cat"?"e.g. half a sachet of wet food morning and evening, dry food left out to graze. Litter box scooped daily, spare box upstairs. Fresh water away from the food bowl.":"e.g. one cup of dry food morning and evening, nothing with chicken in it. Fresh water topped up at bedtime. Fed alone, away from the other dog."}function Lr(s){return ft(s)==="cat"?"e.g. hides under the bed when visitors come, dislikes being picked up, headbutts you at 6am":"e.g. anxious in thunderstorms, pulls toward other dogs on the lead, sleeps through the doorbell"}const Or=["Accident + Illness","Accident Only","Wellness","Other"];function Mr({initial:s,active:t,onSave:r,onDone:i}){const[a,o]=l.useState(""),[d,c]=l.useState(""),[p,u]=l.useState(""),[x,f]=l.useState(""),[j,P]=l.useState(""),[y,w]=l.useState(""),[m,S]=l.useState(""),[b,N]=l.useState(""),[R,U]=l.useState(""),$=l.useRef(null);return l.useEffect(()=>{t&&(o(s?.provider??""),c(pt(s?.providerPhone)??""),u(s?.policyNumber??""),f(s?.coverageType??""),P(s?.premium!=null?String(s.premium):""),w(s?.renewalDate??""),S(""),N(""),U(""))},[t,s]),{provider:a,setProvider:o,providerPhone:d,setProviderPhone:c,policyNumber:p,setPolicyNumber:u,coverageType:x,setCoverageType:f,premium:j,setPremium:P,renewalDate:y,setRenewalDate:w,providerError:m,setProviderError:S,providerPhoneError:b,setProviderPhoneError:N,saveError:R,providerInputRef:$,handleSave:async()=>{const K=a.trim();if(!K){S("Provider name is required");return}const Q=mt(d);if(Q===null){N("Enter a valid US phone number, like (888) 234-1234.");return}N("");const I=j.trim()?Number(j):null;if(I!=null&&(Number.isNaN(I)||I<0)){U("Monthly premium must be a positive number");return}U("");try{await r({provider:K,providerPhone:Q,policyNumber:p.trim(),coverageType:x.trim(),premium:I,renewalDate:y||void 0}),i()}catch{U("Could not save insurance details. Please try again.")}}}}function Br({form:s}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t=>{s.providerInputRef.current=t?.querySelector("input")??null},children:e.jsx(v,{label:"Provider",placeholder:"e.g. Lemonade",value:s.provider,onCh
1ange:t=>{s.setProvider(t),s.providerError&&s.setProviderError("")},error:s.providerError,maxLength:80})}),e.jsx(v,{label:"Phone",type:"tel",inputMode:"tel",placeholder:"(888) 234-1234",value:s.providerPhone,onChange:t=>{s.setProviderPhone(t),s.providerPhoneError&&s.setProviderPhoneError("")},error:s.providerPhoneError,maxLength:20}),e.jsx(v,{label:"Policy number",placeholder:"Optional",value:s.policyNumber,onChange:s.setPolicyNumber,maxLength:60}),e.jsx(v,{label:"Coverage type",type:"dropdown",options:Or,placeholder:"Select coverage",value:s.coverageType,onChange:s.setCoverageType}),e.jsx(v,{label:"Monthly premium ($)",placeholder:"Optional",value:s.premium,onChange:s.setPremium,inputMode:"numeric",maxLength:8}),e.jsx(v,{label:"Renewal date",type:"date",value:s.renewalDate,onChange:s.setRenewalDate})]})}const Fr="text-plus-button";function bt({source:s,className:t}){const r=B("inline-flex h-12 items-center justify-center whitespace-nowrap rounded-full","border-0 bg-plus-surface px-6 font-plus-body font-normal","text-plus-primary no-underline transition duration-150 ease-out hover:-translate-y-0.5",t);return e.jsx(Y,{to:je.petPassport,onClick:()=>ve.passportViewClicked(s),className:`${r} ${Fr}`,children:e.jsx("span",{className:"truncate",children:"View passport"})})}function Vr({onShare:s,onMenuOpen:t,isShared:r,isSharing:i}){const a=rt();return e.jsx("div",{className:"plus-root sticky top-0 z-[95] bg-plus-tertiary md:hidden print:hidden",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 py-7",children:[e.jsx("button",{type:"button","aria-label":"Pet Simple dashboard",onClick:()=>a(je.dashboard),className:"shrink-0 cursor-pointer border-0 bg-transparent p-0",children:e.jsx("img",{src:rr,alt:"Pet Simple",className:"h-10 w-auto"})}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:s,disabled:i,"aria-label":r?"Sharing options":"Share a link",className:"flex h-11 w-11 shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-plus-surface p-0 text-plus-primary disabled:cursor-not-allowed disabled:opacity-60",children:i?e.jsx(kn,{size:20,className:"animate-spin"}):e.jsx(Dn,{size:20,"aria-hidden":!0})}),e.jsx(bt,{source:"hub_mobile_bar",className:"h-11 min-w-0 px-3"}),e.jsx("button",{type:"button",onClick:t,"aria-label":"Open menu",className:"flex h-11 w-11 shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-plus-surface p-0",children:e.jsx(In,{size:24,className:"text-plus-primary"})})]})]})})}const zr={primary:"bg-plus-primary",secondary:"bg-plus-secondary",tertiary:"bg-plus-tertiary"},Ur="m-0 min-w-0 font-plus-header text-plus-h3-mobile font-semibold text-plus-text-primary md:text-plus-h3",et="ml-auto flex shrink-0 cursor-pointer items-center rounded-lg border-0 bg-transparent p-2 text-plus-text-secondary transition-colors hover:bg-plus-background hover:text-plus-text-primary print:hidden";function V({section:s,title:t,icon:r,accent:i,edit:a}){const o=()=>{a&&ve.passportSectionEditClicked(s,a.destination)};return e.jsxs("div",{className:"flex items-center gap-3 md:gap-4","data-passport-section":s,
1children:[e.jsx("span",{"aria-hidden":"true",className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full md:h-12 md:w-12 print:hidden ${zr[i]}`,children:e.jsx(r,{size:20,className:"text-plus-surface"})}),e.jsx("h3",{className:Ur,children:t}),a?.destination==="care_team"&&e.jsx(Y,{to:a.to,"aria-label":a.label,onClick:o,className:et,children:e.jsx(de,{size:20})}),a?.destination==="inline"&&e.jsx("button",{type:"button","aria-label":a.label,"data-print-hide":"true",onClick:()=>{o(),a.onClick()},className:et,children:e.jsx(de,{size:20})})]})}const z="flex min-w-0 flex-col gap-4 md:gap-5 print:gap-3",D="min-w-0 rounded-2xl bg-plus-background p-5 md:border md:border-plus-border md:p-6 print:border-0 print:p-0",Xe="m-0 font-plus-header text-plus-body-md font-semibold text-plus-secondary",ue="min-w-0 font-plus-body text-plus-body-md font-medium text-plus-text-primary [overflow-wrap:anywhere]",g="font-plus-body text-plus-body-sm font-normal text-plus-text-secondary [overflow-wrap:anywhere]",Ye="font-plus-body text-plus-body-sm font-normal text-plus-secondary [overflow-wrap:anywhere]",Ne="mt-1 -ml-1 inline-flex w-fit cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-1 py-1.5 font-plus-body text-plus-body-sm font-normal text-plus-text-secondary no-underline transition-colors hover:bg-plus-surface hover:text-plus-text-primary print:hidden",Ke="grid grid-cols-1 gap-x-10 gap-y-8 md:grid-cols-2 print:grid-cols-2 print:gap-y-5",ie="flex cursor-pointer items-center rounded-lg border-0 bg-transparent p-1.5 text-plus-text-secondary transition-colors hover:bg-plus-surface hover:text-plus-text-primary",gt="w-full min-w-0 rounded-xl border border-plus-border bg-plus-surface px-4 py-3 font-plus-body text-plus-body-md font-normal text-plus-text-primary",yt=`${gt} resize-none outline-none transition-colors duration-150 focus:border-plus-secondary`,$r="No allergies recorded.",Gr="Edit allergies";function Hr({allergies:s,editForm:t,onEdit:r,found:i}
1){return e.jsxs("section",{className:z,children:[e.jsx(V,{section:"allergies",title:"Allergies",icon:Ln,accent:"secondary",edit:t?null:{label:Gr,destination:"inline",onClick:r}}),t??e.jsx("div",{className:`${gt} print:border-0 print:px-0`,children:s.length>0?e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:s.map(a=>e.jsx("li",{className:"font-plus-body text-plus-body-md font-normal text-plus-text-primary [overflow-wrap:anywhere]",children:a},a))}):e.jsx("span",{className:g,children:$r})}),i]})}const $e="Primary vet",Wr="Emergency vet",qr=["park"],W="min-h-10 md:min-h-0 print:min-h-0",Yr="grid min-w-0 break-inside-avoid grid-cols-1 gap-x-8 gap-y-2 py-5 first:pt-0 last:pb-0 md:grid-cols-[minmax(0,1fr)_minmax(0,12rem)_minmax(0,13rem)] md:items-start print:grid-cols-[minmax(0,1fr)_minmax(0,12rem)] print:items-start print:py-3",Xr=`${Ye} ${W} inline-flex items-center gap-1.5 rounded-xl border border-dashed border-plus-border bg-plus-surface px-4 py-2 no-underline transition-colors hover:border-plus-secondary`;function oe(s,t){return`${s}?category=${t}`}function Ge(s,t){return`${oe(s,t)}&edit=1`}function vt(s){return s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()}function jt({phone:s,providerName:t,addPhoneHref:r}){if(s){const i=ga(s);return i?e.jsxs("a",{href:i,className:`${Ye} ${W} mt-1 inline-flex w-fit items-center gap-1.5 py-1.5 no-underline hover:underline print:mt-0 print:py-0 print:text-plus-text-secondary`,children:[e.jsx(Mn,{size:16,"aria-hidden":"true",className:"shrink-0"}),s]}):e.jsx("span",{className:Ye,children:s})}return e.jsxs(Y,{to:r,"aria-label":`Add phone for ${t}`,className:`${Ne} ${W}`,children:[e.jsx(q,{size:16,"aria-hidden":"true"}),"Add phone"]})}function Nt({href:s}){return e.jsxs(Y,{to:s,className:`${Ne} ${W}`,children:[e.jsx(Bn,{size:16,"aria-hidden":"true"}),"Change in Care Team"]})}function st({label:s,member:t,href:r,addPhoneHref:i,afterAddress:a,labelAction:o}){return e.jsxs("div",{className:"flex min-w-0 break-inside-avoid flex-col gap-1","data-care-team-role":s,children:[e.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-2",children:[e.jsx("h4",{className:Xe,children:s}),o]}),t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:ue,children:t.name}),t.address&&e.jsx("span",{className:g,children:t.address}),a,e.jsx(jt,{phone:t.phone,providerName:t.name,addPhoneHref:i}),e.jsx(Nt,{href:r})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:g,children:["No ",s.toLowerCase()," saved yet."]}),e.jsxs(Y,{to:r,className:`${Ne} ${W}`,children:[e.jsx(q,{size:16,"aria-hidden":"true"}),"Add in Care Team"]})]})]})}function Kr({role:s,member:t,href:r,addPhoneHref:i}){const a=vt(xt[s]),o=!qr.includes(s);return e.jsxs("li",{className:Yr,"data-care-team-role":a,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("h4",{className:Xe,children:a}),e.jsx("span",{className:ue,children:t.name}),t.address&&e.jsx("span",{className:g,children:t.address})]}),e.jsx("div",{className:o?"flex min-w-0 md:pt-6 print:pt-7":"hidden min-w-0 md:flex md:pt-6",children:o&&e.jsx(jt,{phone:t.phone,providerName:t.name,addPhoneHref:i})}),e.jsx("div",{className:"flex min-w-0 md:justify-end md:pt-6 print:hidden",children:e.jsx(Nt,{href:r})})]})}function Qr({member:s,onEdit:t}){return s.lastVisit?e.jsxs("span",{className:"flex flex-col pt-2",children:[e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:"Last visit"}),e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-primary",children:F(s.lastVisit)})]}):s.doctorName?null:e.jsxs("button",{type:"button",onClick:t,"data-print-hide":"true",className:`${Ne} ${W}`,children:[e.jsx(q,{size:16}),"Add doctor and last visit"]})}function Zr({team:s,petType:t,hiddenRoles:r,isLoading:i,careTeamHref:a,onEditPrimaryVet:o,primaryVetForm:d,primaryVetFound:c}){const p=s.vet??null,u=s.emergencyVet??null,x=m=>!!s[m]||!r.includes(m),f=!!d||x("vet"),j=x("emergencyVet"),P=ur(t).filter(x),y=P.filter(m=>!!s[m]),w=P.filter(m=>!s[m]);return e.jsxs("section",{className:z,children:[e.jsx(V,{section:"care_team",title:"Care team",icon:On,accent:"primary",edit:{label:"Edit care team",destination:"care_team",to:a}}),i?e.jsx("div",{className:D,children:e.jsx(X,{lines:2})}):e.jsxs(e.Fragment,{children:[(f||j||c)&&e.jsxs("div",{className:D,"data-print-plain":"true",children:[e.jsxs("div",{className:Ke,children:[f?d?e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsx("h4",{className:Xe,children:$e}),d]}):e.jsx(st,{label:$e,member:p,href:oe(a,"vet"),addPhoneHref:Ge(a,"vet"),labelAction:p&&e.jsx("button",{type:"button",onClick:o,"aria-label":`Edit doctor and last visit for ${$e}`,className:"flex min-h-10 min-w-10 cursor-pointer items-center justify-center rounded-lg border-0 bg-transparent p-2 text-plus-text-secondary md:min-
1h-0 md:min-w-0 transition-colors hover:bg-plus-surface hover:text-plus-text-primary print:hidden",children:e.jsx(de,{size:16})}),afterAddress:p&&e.jsxs(e.Fragment,{children:[p.doctorName&&e.jsx("span",{className:g,children:p.doctorName}),e.jsx(Qr,{member:p,onEdit:o})]})}):null,j&&e.jsx(st,{label:Wr,member:u,href:oe(a,"emergencyVet"),addPhoneHref:Ge(a,"emergencyVet")})]}),c]}),P.length>0&&e.jsxs("div",{className:y.length>0?D:`${D} print:hidden`,"data-print-plain":"true",children:[y.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col divide-y divide-plus-border p-0",children:y.map(m=>e.jsx(Kr,{role:m,member:s[m],href:oe(a,m),addPhoneHref:Ge(a,m)},m))}),w.length>0&&e.jsxs("div",{className:`flex flex-wrap items-center gap-3 print:hidden ${y.length>0?"mt-5 border-t border-plus-border pt-5":""}`,children:[e.jsx("span",{className:g,children:"Add to team:"}),w.map(m=>{const S=vt(xt[m]);return e.jsxs(Y,{to:oe(a,m),"aria-label":`Add ${S.toLowerCase()} to Care Team`,className:Xr,children:[e.jsx(q,{size:16,"aria-hidden":"true"}),S]},m)})]})]})]})]})}function te({children:s,error:t,isSaving:r,onSave:i,onCancel:a}){const o=l.useRef(null);return l.useEffect(()=>{const d=document.activeElement,c=d instanceof HTMLElement?d.getAttribute("aria-label"):null;return o.current?.querySelector('input:not([type="hidden"]), select, textarea')?.focus(),()=>{c&&requestAnimationFrame(()=>{document.querySelector(`[aria-label="${CSS.escape(c)}"]`)?.focus()})}},[]),e.jsxs("div",{ref:o,className:"flex flex-col gap-4","data-print-hide":"true",onKeyDown:d=>{d.key!=="Escape"||r||(d.stopPropagation(),a())},children:[e.jsx("div",{className:"flex flex-col gap-4",children:s}),t&&e.jsx("span",{role:"alert",className:"font-plus-body text-plus-body-sm font-normal text-plus-error",children:t}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ce,{label:r?"Savingâ¦":"Save",variant:"primary",onClick:i,disabled:r,minWidth:"110px"}),e.jsx(ce,{label:"Cancel",variant:"outline",onClick:a,disabled:r,minWidth:"110px"})]})]})}const Pt="plus_passport_insurance",Jr=`Not covered yet. ${ta}`,el="Get a quote";function sl({onSeePrice:s,onAddProvider:t}){return e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between md:gap-8",children:[e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[e.jsx("span",{className:`${g} hidden print:block`,children:it.insurance}),e.jsx("span",{className:`${g} print:hidden`,children:Jr}),e.jsx("div",{className:"print:hidden",children:e.jsx(dt,{label:"Add a provider you already have",icon:q,iconPosition:"left",color:"textSecondary",size:"small",onClick:t})})]}),e.jsx("div",{className:"shrink-0 print:hidden",children:e.jsx(ce,{label:el,variant:"outline",onClick:s})})]})}function tl({insurance:s}){return e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between md:gap-8",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:ue,children:s.provider}),s.coverageType&&e.jsx("span",{className:g,children:s.coverageType}),s.policyNumber&&e.jsxs("span",{className:g,children:["Policy ",s.policyNumber]}),s.providerPhone&&e.jsx("span",{className:g,children:pt(s.providerPhone)}),s.premium!=null&&e.jsxs("span",{className:g,children:[pr(s.premium,2),"/mo"]})]}),s.renewalDate&&e.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-0.5 md:items-end",children:[e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:"Renews"}),e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-primary",children:F(s.renewalDate)})]})]})}function nl({insurance:s,isLoading:t,editForm:r,onEdit:i,onSeePrice:a,notice:o,found:d}){const c=!t&&!r&&!s,p=l.useRef(!1);return l.useEffect(()=>{!c||p.current||(p.current=!0,sa.trackViewPromotion("lemonade",er,Pt))},[c]),e.jsxs("section",{className:z,children:[e.jsx(V,{section:"insurance",title:"Insurance",icon:s?Fn:Vn,accent:"primary",edit:t||r||!s?null:{label:"Edit insurance",destination:"inline",onClick:i}}),e.jsxs("div",{className:D,"data-print-plain":"true",children:[t?e.jsx(X,{lines:1}):r??(s?e.jsxs(e.Fragment,{children:[e.jsx(tl,{insurance:s}),o]}
1):e.jsx(sl,{onSeePrice:a,onAddProvider:i})),d]})]})}const al={positive:"border-plus-dark-green bg-plus-dark-green text-plus-surface",warning:"border-plus-tertiary bg-plus-fill-yellow text-plus-text-primary",critical:"border-plus-primary/40 bg-plus-fill-coral text-plus-text-primary",neutral:"border-plus-border bg-plus-surface text-plus-text-secondary"};function wt({label:s,tone:t}){return e.jsx("span",{className:`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border px-2.5 py-0.5 font-plus-body text-plus-body-xs font-medium print:border-plus-border print:bg-transparent print:text-plus-text-primary ${al[t]}`,children:s})}const rl="No medications recorded.",ll="Edit medications";function ol({prescription:s,onToggleStatus:t,onEdit:r,onRemove:i,canRemove:a}){const o=ut(s.status),d=Ra(s.startedOn,s.endedOn,F);return e.jsxs("div",{className:"flex min-w-0 break-inside-avoid items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("span",{className:ue,children:s.medication}),s.dosage&&e.jsx("span",{className:g,children:s.dosage}),!o&&s.refillDue&&e.jsxs("span",{className:g,children:["Next refill: ",F(s.refillDue)]}),o&&d&&e.jsx("span",{className:g,children:d}),s.prescribedBy&&e.jsxs("span",{className:g,children:["Prescribed by ",s.prescribedBy]})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[e.jsx(wt,{label:o?"Discontinued":"Active",tone:o?"neutral":"positive"}),e.jsxs("div",{className:"flex items-center gap-0.5 print:hidden",children:[e.jsx("button",{type:"button",onClick:()=>t(s),"aria-label":o?`Mark ${s.medication} active again`:`Mark ${s.medication} discontinued`,title:o?"Mark active again":"Mark discontinued",className:ie,children:o?e.jsx(Un,{size:16}):e.jsx($n,{size:16})}),e.jsx("button",{type:"button",onClick:()=>r(s),"aria-label":`Edit ${s.medication}`,className:ie,children:e.jsx(de,{size:16})}),(a?.(s)??!0)&&e.jsx("button",{type:"button",onClick:()=>i(s),"aria-label":`Remove ${s.medication}`,className:ie,children:e.jsx(nt,{size:16})})]})]})]})}function il({prescriptions:s,isLoading:t,editForm:r,onEdit:i,onToggleStatus:a,onEditPrescription:o,onRemove:d,canRemove:c,found:p}){return e.jsxs("section",{className:z,children:[e.jsx(V,{section:"medications",title:"Health & medications",icon:zn,accent:"tertiary",edit:t||r?null:{label:ll,destination:"inline",onClick:i}}),e.jsxs("div",{className:D,"data-print-plain":"true",children:[t?e.jsx(X,{lines:2}):r||(s.length>0?e.jsx("div",{className:Ke,children:s.map(u=>e.jsx(ol,{prescription:u,onToggleStatus:a,onEdit:o,onRemove:d,canRemove:c},u.id))}):e.jsx("span",{className:g,children:rl})),p]})]})}function tt({section:s,title:t,icon:r,accent:i,editLabel:a,fieldId:o,ariaLabel:d,description:c,placeholder:p,value:u,error:x,onChange:f,onCommit:j}){return e.jsxs("section",{className:z,children:[e.jsx(V,{section:s,title:t,icon:r,accent:i,edit:{label:a,destination:"inline",onClick:()=>document.getElementById(o)?.focus()}}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-2",children:[c&&e.jsx("p",{className:`m-0 ${g}`,children:c}),e.jsx("textarea",{id:o,"aria-label":d,value:u,onChange:P=>f(P.target.value),onBlur:j,placeholder:p,rows:5,className:`${yt} print:hidden`}),e.jsx("p",{className:"m-0 hidden whitespace-pre-line font-plus-body text-plus-body-md font-normal text-plus-text-primary print:block",children:u}),x&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-error",children:x})]})]})}function dl({id:s,address:t,fieldClassName:r,onCommitPlace:i,onCommitText:a}){const[o,d]=l.useState(t??""),[c,p]=l.useState(!1),{predictions:u,loading:x,error:f,search:j,getDetails:P,reset:y}=Kn("address"),w=l.useRef(null);l.useEffect(()=>{d(t??"")},[t]),l.useEffect(()=>{function b(N){w.current&&!w.current.contains(N.target)&&p(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);async function m(b){p(!1),y();const N=await P(b.placeId);N&&(d(N.address),i(N))}function S(){const b=o.trim();b!==(t??"")&&a(b)}return e.jsxs("div",{ref:w,className:"relative w-full",children:[e.jsx(le,{id:s,autoComplete:"off",value:o,onChange:b=>{d(b),p(!0),j(b)},onBlur:S,placeholder:"Start typing your address",fieldClassName:r}),c&&(u.length>0||x)&&e.jsxs("ul",{className:"absolute z-20 mt-1 flex w-full list-none flex-col overflow-hidden rounded-xl border border-plus-border bg-plus-surface p-0 shadow-lg print:hidden",children:[x&&u.length===0&&e.jsx("li",{className:"px-4 py-3 font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:"Searchingâ¦"}),u.map(b=>e.jsx("li",{children:e.jsxs("button",{type:"button",onMouseDown:N=>N.preventDefault(),onClick:()=>{m(b)},className:"flex w-full cursor-pointer flex-col items-start gap-0.5 border-0 bg-transparent px-4 py-2.5 text-left transition-colors hover:bg-plus-background",children:[e.jsx("span",{className:"font-plus-body text-plus-body-sm font-medium text-plus-text-primary",children:b.mainText}),b.secondaryText&&e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:b.secondaryText})]})},b.placeId))]}),f&&e.jsx("span",{className:"mt-1 block font-plus-body text-plus-body-xs font-normal text-plus-text-secondary print:hidden",children:"Address search is unavailable right now. You can still type your address in full."})]})}const ne=`${Jn("sm","sm")} w-full rounded-lg border border-plus-border bg-plus-surface px-3 font-plus-body text-plus-body-sm font-normal text-plus-text-primary outline-none transition-colors focus:border-plus-secondary`,ae="font-plus-body text-plus-body-sm font-normal text-plus-text-primary",re="flex min-w-0 flex-col gap-1.5",He="owner-first-name";function cl({firstName:s,lastName:t,phone:r,email:i,address:a,isLoading:o,error:d,onFirstNameCommit:c,onLastNameCommit:p,onPhoneCommit:u,onAddressPlaceCommit:x,onAddressTextCommit:f}){const[j,P]=l.useState(s??""),[y,w]=l.useState(t??""),[m,S]=l.useState(r??""),[b,N]=l.useState(null);return l.useEffect(()=>{P(s??"")},[s]),l.useEffect(()=>{w(t??"")},[t]),l.useEffect(()=>{S(r??"")},[r]),e.jsxs("section",{className:z,children:[e.jsx(V,{section:"owner_
1contact",title:"Owner contact",icon:Gn,accent:"secondary",edit:o?null:{label:"Edit owner contact",destination:"inline",onClick:()=>document.getElementById(He)?.focus()}}),e.jsxs("div",{className:D,"data-print-plain":"true",children:[o?e.jsx(X,{lines:1}):e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4 print:grid-cols-2",children:[e.jsxs("div",{className:re,children:[e.jsx("label",{className:ae,htmlFor:He,children:"First name"}),e.jsx(le,{id:He,value:j,onChange:P,onBlur:()=>{j!==(s??"")&&c(j)},placeholder:"Your first name",fieldClassName:ne})]}),e.jsxs("div",{className:re,children:[e.jsx("label",{className:ae,htmlFor:"owner-last-name",children:"Last name"}),e.jsx(le,{id:"owner-last-name",value:y,onChange:w,onBlur:()=>{y!==(t??"")&&p(y)},placeholder:"Your last name",fieldClassName:ne})]}),e.jsxs("div",{className:re,children:[e.jsx("label",{className:ae,htmlFor:"owner-phone",children:"Phone"}),e.jsx(le,{id:"owner-phone",value:m,inputMode:"tel",onChange:R=>{S(R),N(null)},onBlur:()=>{if(m===(r??""))return;const R=mt(m);if(R===null){N("Enter a valid US phone number, like (415) 555-0192.");return}u(R)},ariaInvalid:b?!0:void 0,placeholder:"(415) 555-0192",fieldClassName:ne}),b&&e.jsx("p",{className:"m-0 font-plus-body text-plus-body-xs font-normal text-plus-error",children:b})]}),e.jsxs("div",{className:re,children:[e.jsx("label",{className:ae,htmlFor:"owner-email",children:"Email"}),e.jsx(le,{id:"owner-email",value:i??"",onChange:()=>{},readOnly:!0,inputMode:"email",placeholder:"No email on file",fieldClassName:`${ne} cursor-default print:hidden`}),e.jsx("p",{className:"m-0 hidden font-plus-body text-plus-body-sm font-normal text-plus-text-primary [overflow-wrap:anywhere] print:block",children:i??""})]}),e.jsxs("div",{className:`${re} md:col-span-2 xl:col-span-4 print:col-span-2`,children:[e.jsx("label",{className:ae,htmlFor:"owner-address",children:"Address"}),e.jsx(dl,{id:"owner-address",address:a,fieldClassName:ne,onCommitPlace:x,onCommitText:f})]})]}),d&&e.jsx("span",{className:"mt-3 block font-plus-body text-plus-body-sm font-normal text-plus-error",children:d})]})]})}const ul="No vaccines recorded.",pl="Edit vaccinations";function ml(s){const t=xr(s);return t==="expired"?"critical":t==="expiring"?"warning":t==="current"?"positive":"neutral"}function xl({vaccine:s,sourceDocument:t,onEdit:r,onRemove:i,canRemove:a}){const o=mr(s.expiresAt),d=[s.dateGiven?`Given ${F(s.dateGiven)}`:null,s.expiresAt?`Expires ${F(s.expiresAt)}`:null].filter(Boolean).join(" · ");return e.jsxs("div",{className:"flex min-w-0 break-inside-avoid items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("span",{className:ue,children:s.name}),d&&e.jsx("span",{className:g,children:d}),s.administeredBy&&e.jsxs("span",{className:g,children:["Administered by ",s.administeredBy]}),t&&(t.signedUrl?e.jsxs("a",{href:t.signedUrl,target:"_blank",rel:"noreferrer noopener",className:`${g} no-underline hover:underline`,children:["From ",t.fileName]}):e.jsxs("span",{className:g,children:["From ",t.fileName]}))]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[o&&e.jsx(wt,{label:o,tone:ml(s.expiresAt)}),e.jsxs("div",{className:"flex items-center gap-0.5 print:hidden",children:[e.jsx("button",{type:"button",onClick:()=>r(s),"aria-label":`Edit ${s.name}`,className:ie,children:e.jsx(de,{size:16})}),(a?.(s)??!0)&&e.jsx("button",{type:"button",onClick:()=>i(s),"aria-label":`Remove ${s.name}`,className:ie,children:e.jsx(nt,{size:16})})]})]})]})}function hl({vaccines:s,isLoading:t,editForm:r,onEdit:i,onEditVaccine:a,onRemove:o,canRemove:d,sourceDocumentFor:c,found:p}){return e.jsxs("section",{className:z,children:[e.jsx(V,{section:"vaccinations",title:"Vaccinations",icon:Hn,accent:"secondary",edit:t||r?null:{label:pl,destination:"inline",onClick:i}}),e.jsxs("div",{className:D,"data-print-plain":"true",children:[t?e.jsx(X,{lines:2}):r||(s.length>0?e.jsx("div",{className:Ke,children:s.map(u=>e.jsx(xl,{vaccine:u,sourceDocument:c?.(u)??null,onEdit:a,onRemove:o,canRemove:d},u.id))}):e.jsx("span",{className:g,children:ul})),p]})]})}function fl(){const[s,t]=lt(),{pets:r,activePetId:i,isLoading:a,selectActivePet:o}=na(),[d,c]=l.useState(!1),p=l.useRef(null),u=s.get(Xs);return l.useEffect(()=>{if(!u){p.current=null;return}if(a||p.current===u)return;p.current=u;const x=new URLSearchParams(s);x.delete(Xs),t(x,{replace:!0}),!(u===i||!r.some(f=>f.id===u))&&(c(!0),o(u).catch(f=>{qe(f,{component:"usePlusPetFromLink",action:"selectActivePet"})}).finally(()=>c(!1)))}),d||u!==null}function bl(){const s=aa(),t=ra({mutationFn:async({resourceId:r,doctorName:i,lastVisit:a})=>{const{error:o}=await la.from("local_resources").update({doctor_name:i||null,last_visit:a||null}).eq("id",r);
1if(o)throw o},onSuccess:()=>{s.invalidateQueries({queryKey:["plus-care-team"]})}});return{updateVetRecord:t.mutateAsync,isSaving:t.isPending}}const gl=je.petPassport,yl=100,vl=250,jl=1e4,Nl=15e3;function Pl(){const s=l.useRef(null),t=l.useRef(null),[r,i]=l.useState(!1),a=l.useCallback(()=>{t.current!==null&&(window.clearTimeout(t.current),t.current=null)},[]),o=l.useCallback(()=>{a(),s.current?.remove(),s.current=null,i(!1)},[a]);return l.useEffect(()=>o,[o]),{print:l.useCallback(()=>{if(s.current)return;i(!0);const c=document.createElement("iframe");c.setAttribute("aria-hidden","true"),c.setAttribute(oa,""),c.style.cssText="position:fixed;left:-10000px;top:0;width:1024px;height:1400px;border:0;",c.src=gl,c.onload=()=>{a();const p=Date.now(),u=()=>{i(!1),ve.passportPrinted("hub");try{c.contentWindow?.focus(),c.contentWindow?.print()}finally{o()}},x=()=>{if(!s.current)return;if(c.contentDocument?.documentElement?.dataset.passportReady==="true"||Date.now()-p>jl){window.setTimeout(u,vl);return}window.setTimeout(x,yl)};x()},c.onerror=o,document.body.appendChild(c),s.current=c,t.current=window.setTimeout(o,Nl)},[o,a]),isPreparing:r,cleanUp:o}}const wl=[{key:"age",label:"Age",type:"age-or-birthday",span:"col-span-2 xl:col-span-5"},{key:"weight",label:"Weight (lbs)",...pa,placeholder:"e.g. 42",span:"col-span-1 xl:col-span-3"},{key:"sex",label:"Sex",type:"dropdown",options:["Male","Female"],placeholder:"â",span:"col-span-1 xl:col-span-3"},{key:"zip",label:"Zip",type:"text",span:"col-span-1 xl:col-span-4"},{key:"chipId",label:"Chip ID",type:"text",wrap:!0,span:"col-span-1 xl:col-span-5"},{key:"neutered",label:"Neutered / Spayed",type:"dropdown",options:["Yes","No","Unknown"],placeholder:"â",span:"col-span-2 xl:col-span-4"}],We={name:"",dateGiven:"",expiresAt:"",administeredBy:""},El="passport-care-notes",Sl="passport-behavior-notes",Cl="documents_upload",Tl="border-b border-plus-border py-6 md:border-0 md:py-0 print:border-0 print:py-0";function Al({title:s,documents:t,isLoading:r,noteFor:i,uploadAvailability:a,isUploading:o,busyLabel:d,uploadError:c,onUpload:p,onUpsell:u}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{size:20,className:"text-plus-secondary"}),e.jsx("h4",{className:ht,children:s})]}),r?e.jsx(X,{lines:1}):t.length>0&&e.jsx("div",{className:"flex flex-col gap-2",children:t.map(x=>{const f=i(x);return e.jsxs("div",{className:"flex flex-col gap-1 rounded-xl border border-plus-border bg-plus-surface px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ys,{size:20,className:"text-plus-secondary"}),e.jsx("a",{href:x.signedUrl??void 0,target:"_blank",rel:"noreferrer",className:"flex-1 truncate font-plus-body text-plus-body-sm font-medium text-plus-primary no-underline",children:x.file_name}),x.file_size!=null&&e.jsx("span",{className:"shrink-0 font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:za(x.file_size)})]}),f&&e.jsx("span",{className:B("pl-8 font-plus-body text-plus-body-xs font-normal",f.tone==="error"?"text-plus-error":"text-plus-text-secondary"),children:f.message})]},x.id)})}),e.jsx(Rl,{availability:a,isBusy:o,busyLabel:d,error:c,onFile:p,onUpsell:u})]})}function Rl({availability:s,isBusy:t,busyLabel:r,error:i,onFile:a,onUpsell:o}){const d=$a({onFile:a});return s==="resolving"?null:s==="needs_plus"?e.jsxs("button",{type:"button",onClick:o,className:"flex w-full cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-plus-border bg-plus-background p-5 transition-colors hover:border-plus-primary hover:bg-plus-primary/5 md:p-8",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-plus-primary",children:e.jsx(ze,{size:20,className:"text-white"})}),e.jsx("span",{className:"font-plus-body text-plus-body-md font-semibold text-plus-text-primary",children:"Vet record uploads are part of Plus"}),e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:"Upload a re
1cord and we read it for you, filling the passport in"}),e.jsx(ea,{label:"See what's in Plus",variant:"coral",size:"large"})]}):s==="not_launched"?e.jsxs("div",{"aria-disabled":!0,title:"Coming soon",className:"flex cursor-not-allowed flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-plus-border bg-plus-background p-5 opacity-40 md:p-8",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-plus-primary",children:e.jsx(ze,{size:20,className:"text-white"})}),e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:"Document upload, coming soon"}),e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:Qs})]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",disabled:t,onClick:d.openPicker,...d.dropHandlers,className:B("flex w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed bg-plus-background p-5 transition-colors md:p-8",t?"cursor-not-allowed opacity-60":"cursor-pointer",d.isDragOver?"border-plus-primary bg-plus-primary/5":"border-plus-border"),children:[e.jsx("input",{ref:d.inputRef,type:"file",accept:Ga,className:"hidden",onChange:d.onInputChange}),e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-plus-primary",children:e.jsx(ze,{size:20,className:"text-white"})}),e.jsx("span",{className:"font-plus-body text-plus-body-md font-semibold text-plus-text-primary",children:r??"Upload a vet record and we will read it for you"}),e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:Qs})]}),(d.error||i)&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-error",children:d.error??i})]})}function _l({suggestion:s,petName:t,target:r,isPending:i,onConfirm:a,onDismiss:o}){const[d,c]=l.useState(!1),p=Ha(s,r),u=p.length>0&&!d,x=p.some(f=>f.current===f.incoming);return e.jsxs("div",{className:"flex flex-col gap-2 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[e.jsx("span",{className:"font-plus-body text-plus-body-sm font-semibold text-plus-text-primary",children:Zs(s)}),e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-text-secondary",children:Wa(s)})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o(s),disabled:i,"aria-label":`Dismiss ${Zs(s)}`,className:"cursor-pointer rounded-full border border-plus-border bg-transparent p-2 text-plus-text-secondary disabled:opacity-50",children:e.jsx(Xn,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>u?c(!0):a(s),disabled:i,className:"cursor-pointer rounded-full border border-plus-primary bg-plus-surface p-2 font-plus-body text-plus-button font-normal text-plus-primary disabled:opacity-50 md:px-4 md:py-2",children:[e.jsx("span",{className:"hidden md:inline",children:i?"Savingâ¦":"Confirm"}),e.jsx(at,{size:16,className:"md:hidden"})]})]})]}),p.length>0&&d&&e.jsxs("div",{className:"flex flex-col gap-2 rounded-xl bg-plus-background p-3",children:[e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:qa(t,p)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(!1),className:"cursor-pointer rounded-full border border-plus-border bg-transparent px-3 py-1.5 font-plus-body text-plus-button font-normal text-plus-text-secondary",children:"Keep current"}),e.jsx("button",{type:"button",onClick:()=>a(s),disabled:i,className:"cursor-pointer rounded-full border-0 bg-plus-primary px-3 py-1.5 font-plus-body text-plus-button font-normal text-white disabled:opacity-50",children:x?"Add anyway":"Replace"})]})]})]})}function kl({items:s,petName:t,target:r,pendingId:i,error:a,onConfirm:o,onDismiss:d}){return s.length===0?null:e.jsxs("div",{className:"mt-3 border-t border-dashed border-plus-border pt-3","data-print-hide":"true",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Yn,{size:14,className:"text-plus-secondary"}),e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary",children:"Read from your documents â nothing is saved until you confirm it."})]}),e.jsx("div",{className:"divide-y divide-plus-border",children:s.map(c=>e.jsx(_l,{suggestion:c,petName:t,target:r,isPending:i===c.id,onConfirm:o,onDismiss:d},c.id))}),a&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-error",children:a})]})}function Dl(s){const[t,r,i]=s.split("/");return!t||!r||!i?null:`${i}-${t.padStart(2,"0")}-${r.padStart(2,"0")}`}function Oo(){const{hasAccount:s,isResolving:t}=br();return t?e.jsx(ot,{}):s?e.jsx(Il,{}):e.jsx(lr,{})}function Il(){return fl()?e.jsx(ot,{}):e.jsx(Ll,{})}function Ll(){Aa("passport");const{user:s}=ia(),t=da(),r=ir("passport"),{requestAddPet:i,upgradeOpen:a,closeUpgrade:o,upgradePlacement:d}=gr(),[c,p]=l.useState(!1),u=rt(),{team:x,isLoading:f}=vr(t.petId),{hiddenRoles:j,isLoading:P}=Pr(t.petId),y=Ia(t.petId),w=bl(),m=Sr(),[S,b]=l.useState(!1),{actions:N,modals:R}=wr(),[U,$]=l.useState(!1),[Pe,K]=l.useState(""),[Q,I]=l.useState(""),[Et,we]=l.useState(null),[St,Qe]=l.useState(null),[Ze,Ct]=l.useState(null),Je=l.useRef(null);function C(n,h=null){Je.current=h,Ct(n)}const[Tt,Ee]=l.useState(!1),[es,ss]=l.useState(""),[At,Se]=l.useState(null),[Ce,ts]=l.useState(t.values.behavioralNotes??""),[Rt,ns]=l.useState(null),[Te,as]=l.useState(t.values.careNotes??""),[_t,rs]=l.useState(null),[kt,ls]=l.useState(!1),[os,is]=l.useState(null),[Ae,ds]=l.useState(""),[cs,us]=l.useState(""),[ps,ms]=l.useState(""),[xs,hs]=l.useState(""),[Dt,Re]=l.useState(null),[It,fs]=l.useState(!1),[bs,gs]=l.useState(null),[T,G]=l.useState(We),[Lt,pe]=l.useState(null),[ys,me]=l.useState(!1),[Ot,vs]=l.useState(!1),[Mt,_e]=l.useState(!1),{share:Bt,isSharing:js,error:Ns,shareUrl:xe,accessCode:Ft,copyLink:Vt,copyCode:zt,revoke:Ut,isRevoking:$t,canRevoke:Gt,clearError:Ht}=Pa(t.petId),{download:Wt,isGenerating:qt,error:Ps,clearError:Yt}=ja("owner"),{print:Xt,isPreparing:Kt}=Pl(),[ws,he]=l.useState(t.breed),[Qt,Es]=l.useState(null),ke=l.useRef(t.breed),De=yr(t.petType),Ss=t.breed&&!De.options.includes(t.breed)?[t.breed,...De.options]:De.options,[Z,Cs]=l.useState({age:t.values.age,weight:Ks(t.raw.weight),sex:t.values.sex,neutered:t.values.neutered,zip:t.values.zip,chipId:t.values.chipId}),{age:Ie,sex:Ts,neutered:As,zip:Rs,chipId:_s,birthday:Zt,behavioralNotes:ks,careNotes:Ds}=t.values,Le=Ks(t.raw.weight);l.useEffect(()=>{Cs({age:Ie,weight:Le,sex:Ts,neutered:As,zip:Rs,chipId:_s})},[Ie,Le,Ts,As,Rs,_s]),l.useEffect(()=>{ts(ks??"")},[ks]),l.useEffect(()=>{he(t.breed)},[t.breed]),l.useEffect(()=>{as(Ds??"")},[Ds]),l.useEffect(()=>{ve.passportViewed()},[]);const{prescriptions:Oe,isLoading:Jt}=jr(t.petId),H=La(t.petId),Is=_a(Oe),en=[...Is.current,...Is.past],{vaccines:Me,isLoading:sn}=Nr(t.petId),{consultations:tn}=ct(t.petId),J=Oa(t.petId),{canDelete:Ls}=Ya(t.petId),{insurance:_,isLoading:Os,save:nn,isSaving:an,pendingProvider:rn,confirmPendingProvider:ln,dismissPendingProvider:on,isResolvingPending:dn}=Er(t.petId),Be=Mr({initial:_,active:ys,onSave:nn,onDone:()=>me(!1)}),fe=Ma(t.petId),cn=Ba(t.petId),be=Fa(t.petId),[un,Ms]=l.useState(null);async function pn(n){Ms(null);try{const h=await y.upload({file:n,documentType:"vet"});h&&await be.parse(h)}catch{Ms("We could not read that document. Please try again.")}}const[Fe,ge]=l.useState(null),A=t.isLoading||f||P,E=t.name||"your pet";wa(t.name);const ee=t.values.photo,Ve=(t.values.allergies??"").split(",").map(n=>
1n.trim()).filter(Boolean),L=x.vet??null,[ye,Bs]=lt(),Fs=l.useRef(!1),Vs=l.useRef(!1),mn=je.careTeam,O=Rr({...t.values,photo:ee,primaryVetName:L?.name,primaryVetHidden:j.includes("vet"),insuranceProvider:_?.provider});function xn(){Xt()}function zs(){Yt(),_e(!0),xe||Bt()}function hn(){Ht(),Wt(Na({petName:E,breed:t.breed,petType:t.petType,values:t.values,team:x,prescriptions:Oe,vaccines:Me,consultations:tn,insurance:_,owner:{displayName:m.displayName,phone:m.phone,address:m.address,email:s?.email??null},allergies:Ve}))}const fn={weight:t.raw.weight,birthday:Dl(t.values.birthday),chipId:t.values.chipId||null,allergens:Ve,vaccineNames:Me.map(n=>n.name),medicationNames:Oe.map(n=>n.medication),vetName:L?.name??null,insuranceProvider:_?.provider??null,ownerPhone:m.phone};async function bn(n){ge(null);try{await fe.confirm(n)}catch(h){ge({id:n.id,message:Ua(h,E)})}}async function gn(n){ge(null);try{await fe.dismiss(n)}catch{ge({id:n.id,message:"Could not dismiss this. Please try again."})}}function M(n){const h=fe.suggestionsFor(n),k=Fe&&h.some(se=>se.id===Fe.id)?Fe.message:null;return e.jsx(kl,{items:h,petName:E,target:fn,pendingId:fe.pendingId,error:k,onConfirm:se=>{bn(se)},onDismiss:se=>{gn(se)}})}async function yn(n){C(null);try{await t.save({age:n})}catch{C("Could not save. Please try again.")}}async function vn(n){C(null);try{await t.save({birthday:n})}catch{C("Could not save. Please try again.")}}async function jn(n){C(null);try{await t.save({birthday:"",age:n})}catch{C("Could not save. Please try again.")}}async function Nn(n){if(n==="weight"?Z.weight.trim()===Le:Z[n]===t.values[n]){Je.current===n&&C(null);return}const k=fa(n,Z[n]);if(k){C(k,n);return}C(null);try{await t.save({[n]:Z[n]})}catch{C("Could not save. Please try again.")}}async function Us(n){if(!(n===t.breed||n===ke.current)){ke.current=n,Es(null),he(n);try{await t.saveBreed(n)}catch(h){ke.current=t.breed,he(t.breed),Es(h instanceof ha?xa(n,`${E}'s`):"Could not save. Please try again.")}}}function $s(){K(L?.doctorName??""),I(L?.lastVisit??""),we(null),$(!0)}l.useEffect(()=>{if(Fs.current||ye.get("edit")!=="vet"||!L)return;Fs.current=!0,$s();const n=new URLSearchParams(ye);n.delete("edit"),Bs(n,{replace:!0})}),l.useEffect(()=>{if(Vs.current||ye.get("edit")!=="insurance"||A||Os)return;Vs.current=!0,_||me(!0),document.querySelector('[data-passport-section="insurance"]')?.scrollIntoView?.({behavior:"smooth",block:"start"});const n=new URLSearchParams(ye);n.delete("edit"),Bs(n,{replace:!0})});async function Pn(){if(we(null),!L){$(!1);return}try{await w.updateVetRecord({resourceId:L.id,doctorName:Pe,lastVisit:Q}),$(!1)}catch{we("Could not save the vet record. Please try again.")}}async function wn(n,h){Qe(null);try{await m.save(n)}catch{Qe(h)}}const En=n=>wn({phone:n},"Could not save the phone number. Please try again.");function Sn(){ss(t.values.allergies??""),Se(null),Ee(!0)}async function Cn(){Se(null);try{await t.save({allergies:es}),Ee(!1)}catch{Se("Could not save. Please try again.")}}async function Tn(){if(Ce!==(t.values.behavioralNotes??"")){ns(null);try{await t.save({behavioralNotes:Ce})}catch{ns("Could not save. Please try again.")}}}async function An(){if(Te!==(t.values.careNotes??"")){rs(null);try{await t.save({careNotes:Te})}catch{rs("Could not save. Please try again.")}}}function Gs(n){pe(null),gs(n?.id??null),G(n?{name:n.name,dateGiven:n.dateGiven??"",expiresAt:n.expiresAt??"",administeredBy:n.administeredBy??""}:We),fs(!0)}function Hs(){fs(!1),gs(null),G(We),pe(null)}async function Rn(){if(!T.name.trim())return;pe(null);const n={name:T.name.trim(),dateGiven:T.dateGiven||void 0,expiresAt:T.expiresAt||void 0,administeredBy:T.administeredBy.trim()||void 0};try{bs?await J.update({id:bs,...n}):await J.add(n),Hs()}catch{pe("Could not save. Please try again.")}}function Ws(n){ds(n?.medication??""),us(n?.dosage??""),ms(n?.prescribedBy??""),hs(n?.refillDue??""),is(n?.id??null),Re(null),ls(!0)}function qs(){ls(!1),is(null)}async function _n(){if(!Ae.trim())return;Re(null);const n={medication:Ae.trim(),dosage:cs.trim()||void 0,prescribedBy:ps.trim()||void 0,refillDue:xs.trim()||void 0};try{os?await H.update({id:os,...n}):await H.add(n),qs()}catch{Re("Could not save. Please try again.")}}return e.jsxs("div",{className:"plus-passport-editor plus-root flex min-h-screen flex-col bg-plus-background print:bg-white",children:[e.jsx(ca,{placement:c?Cl:d,isOpen:a||c,onClose:()=>{p(!1),o()},petName:t.name}),e.jsx(or,{}),R,e.jsxs("div",{className:"flex flex-1",children:[e.jsx("div",{className:"print:hidden",children:e.jsx(tr,{activePage:"documents",onNavigate:()=>{},open:S,onOpenChange:b})}
1),e.jsxs("div",{id:ua,tabIndex:-1,className:"flex min-w-0 flex-1 flex-col focus:outline-none","data-testid":"plus-hub-content-column",children:[e.jsx(Vr,{onShare:zs,onMenuOpen:()=>b(!0),isShared:!!xe,isSharing:!t.petId||js}),e.jsx("div",{"aria-hidden":!0,className:"h-5 bg-plus-tertiary md:hidden print:hidden"}),e.jsx("div",{className:"hidden md:block print:hidden",children:e.jsx(nr,{actions:[{label:"+ Add a Pet",variant:"outline",onClick:i},...N]})}),e.jsx("div",{className:B("relative -mt-5 flex flex-col gap-6 rounded-t-[20px] bg-plus-surface px-8 pb-8 pt-6 md:mt-0 md:rounded-none md:bg-transparent md:pb-8 print:mt-0 print:max-w-full print:rounded-none print:bg-transparent print:p-0",fr,hr),children:t.error?e.jsx(ar,{onRetry:()=>{t.refetch()}}):e.jsxs("div",{...Cr,className:"relative z-[1] flex w-full flex-col gap-6 md:gap-8 print:gap-5",children:[e.jsxs("div",{className:"contents md:flex md:flex-col md:gap-1.5",children:[e.jsxs("div",{className:"hidden flex-wrap items-center justify-between gap-4 md:flex print:flex",children:[e.jsx("h2",{className:"m-0 min-w-0 font-plus-header text-plus-h2 font-semibold text-plus-text-primary [overflow-wrap:anywhere]",children:A?e.jsx(Ue,{width:"220px",height:"28px",marginBottom:"0"}):e.jsxs(e.Fragment,{children:[E,"'s Passport"]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 print:hidden",children:[e.jsx(Ea,{onShare:zs,onEmail:()=>vs(!0),onDownloadPdf:hn,onPrint:xn,isShared:!!xe,isSharing:!t.petId||js,isGenerating:!t.petId||qt,isPrinting:Kt}),e.jsx(bt,{source:"hub_header"})]})]}),e.jsxs("div",{className:"contents md:relative md:block md:rounded-2xl md:bg-plus-tertiary md:p-6 lg:p-8","data-print-plain":"true",children:[e.jsx("div",{className:"hidden bg-cover bg-center opacity-50 md:absolute md:inset-0 md:z-0 md:block md:rounded-2xl",style:{backgroundImage:`url(${Da})`},"data-print-hide":"true"}),e.jsx("img",{src:_r,alt:"","aria-hidden":"true","data-print-hide":"true",className:"pointer-events-none hidden w-[433px] lg:-right-14 lg:-top-[233px] lg:absolute lg:-z-10 lg:block"}),e.jsx("img",{src:ya,alt:"","aria-hidden":"true","data-print-hide":"true",className:"pointer-events-none hidden w-[90px] lg:-bottom-7 lg:absolute lg:-left-2 lg:z-[2] lg:block"}),e.jsx("img",{src:ka,alt:"","aria-hidden":"true","data-print-hide":"true",className:"pointer-events-none hidden w-[210px] lg:-bottom-[108px] lg:absolute lg:-right-8 lg:z-[2] lg:block"}),e.jsxs("div",{className:"contents md:relative md:z-[1] md:flex md:min-w-0 md:items-start md:gap-8 md:rounded-2xl md:bg-plus-surface md:p-6 lg:gap-10 lg:p-8","data-print-plain":"true",children:[e.jsxs("div",{className:B("order-1 flex flex-col items-center gap-3 md:order-none md:shrink-0 md:items-start",!ee&&"print:hidden"),children:[e.jsxs("div",{className:"relative shrink-0",children:[A?e.jsx(Ue,{width:"142px",height:"142px",borderRadius:"50%",marginBottom:"0"}):e.jsx(Zn,{photoUrl:ee,petName:E,onUploaded:n=>t.savePhoto(n),isSaving:t.isSavingPhoto,iconSize:32,className:"h-[142px] w-[142px]",children:ee?e.jsx("img",{src:ee,alt:E,className:"h-full w-full rounded-full object-cover"}):e.jsx("div",{className:"h-full w-full rounded-full bg-plus-border/20"})}),e.jsx("img",{src:kr,alt:"",className:"pointer-events-none absolute -bottom-2 -right-2 z-[2] h-auto w-16 object-contain"})]}),e.jsx("h2",{className:"m-0 max-w-full text-center font-plus-header text-plus-h3-mobile font-semibold text-plus-text-primary [overflow-wrap:anywhere] md:hidden print:hidden",children:A?e.jsx(Ue,{width:"160px",height:"28px",marginBottom:"0"}):e.jsxs(e.Fragment,{children:[E,"'s Passport"]})})]}),!A&&e.jsxs("div",{className:"order-3 w-full min-w-0 md:order-none md:flex-1",children:[e.jsxs("div",{className:"grid grid-cols-2 items-start gap-x-4 gap-y-5 xl:grid-cols-12 xl:gap-x-4 xl:gap-y-6",children:[e.jsx("div",{className:"col-span-2 min-w-0 xl:col-span-4",children:e.jsx(v,{label:"Breed",placeholder:"Select a breed",value:ws,onChange:n=>{he(n),Ss.includes(n)&&Us(n)},onBlur:()=>{Us(ws)},error:Qt??void 0,type:"combobox",wrap:!0,options:Ss,size:"sm",textSize:"sm",labelSize:"sm"})}),wl.map(n=>n.type==="age-or-birthday"?e.jsx(Qn,{className:n.span,age:Ie,birthday:Zt,onCommitAge:h=>{yn(h)},onCommitBirthday:h=>{vn(h)},onRemoveBirthday:h=>{jn(h)},size:"sm",textSize:"sm",labelSize:"sm"},n.key):e.jsx("div",{className:B("min-w-0",n.span),children:e.jsx(v,{label:n.label,placeholder:n.placeholder,value:Z[n.key],onChange:h=>Cs(k=>({...k,[n.key]:h})),onBlur:()=>{Nn(n.key)},type:n.type,options:n.options,rightIcon:n.rightIcon,helperText:n.helperText,inputMode:n.inputMode,maxLength:n.maxLength,min:n.min,max:n.max,step:n.step,wrap:n.wrap,clearable:n.type==="dropdown"&&!ma(n.key),fullOpacity:!0,size:"sm",textSize:"sm",labelSize:"sm"})},n.key))]}),Ze&&e.jsx("span",{className:"mt-2 block font-plus-body text-plus-body-sm font-normal text-plus-error",children:Ze}),M("profile")]})]})]})]}),e.jsxs("div",{className:"contents md:flex md:flex-col md:gap-10 md:rounded-2xl md:bg-plus-surface md:p-10 lg:p-[60px]","data-
1print-plain":"true",children:[!A&&O.percent>=100&&e.jsxs("div",{className:"order-2 flex items-center gap-2 font-plus-body text-plus-body-sm font-normal text-plus-text-secondary md:order-none","data-print-hide":"true",children:[e.jsx(at,{size:16,className:"shrink-0 text-plus-secondary"}),e.jsxs("span",{children:[E,"'s passport is complete."]})]}),!A&&O.percent<100&&e.jsxs("div",{className:"order-2 flex flex-col gap-0.5 md:order-none","data-print-hide":"true",children:[e.jsx("span",{id:"passport-completeness-label",className:"font-plus-body text-plus-body-md font-normal text-plus-text-primary",children:"Passport completeness"}),e.jsxs("div",{className:"flex w-full items-center gap-4",children:[e.jsx("div",{role:"progressbar","aria-labelledby":"passport-completeness-label","aria-valuenow":O.percent,"aria-valuemin":0,"aria-valuemax":100,className:"h-3 min-w-0 flex-1 overflow-hidden rounded-full bg-plus-border",children:e.jsx("div",{className:"h-full rounded-full bg-plus-primary transition-all duration-500",style:{width:`${O.percent}%`}})}),e.jsxs("span",{"aria-hidden":"true",className:"shrink-0 font-plus-body text-plus-h4 font-semibold text-plus-primary",children:[O.percent,"%"]})]}),O.missingSummary&&e.jsx("span",{className:"font-plus-body text-plus-body-xs font-normal text-plus-text-secondary md:text-plus-body-sm",children:O.missingSummary})]}),e.jsxs("div",{className:"order-4 flex flex-col gap-8 md:order-none md:gap-10",children:[(Ns||Ps)&&e.jsx("span",{className:"font-plus-body text-plus-body-sm font-normal text-plus-error",children:Ns??Ps}),e.jsx(Sa,{petName:E}),e.jsxs("div",{className:"flex flex-col gap-8 md:gap-10 print:gap-8","data-testid":"passport-sections",children:[e.jsxs("div",{children:[e.jsx(cl,{firstName:m.firstName,lastName:m.lastName,phone:m.phone,email:s?.email??null,address:m.address,isLoading:m.isLoading,error:St,onFirstNameCommit:n=>{m.save({firstName:n}).catch(()=>{})},onLastNameCommit:n=>{m.save({lastName:n}).catch(()=>{})},onPhoneCommit:n=>{En(n)},onAddressPlaceCommit:n=>{m.save({address:n.address,latitude:n.lat,longitude:n.lng,street:n.components.street,streetNumber:n.components.streetNumber,city:n.components.city,state:n.components.state,postalCode:n.components.postalCode}).catch(()=>{})},onAddressTextCommit:n=>{m.save({address:n,latitude:null,longitude:null,street:null,streetNumber:null,city:null,state:null,postalCode:null}).catch(()=>{})}}),M("ownerContact")]}),e.jsx(Zr,{team:x,petType:t.petType,hiddenRoles:j,isLoading:A,careTeamHref:mn,onEditPrimaryVet:$s,primaryVetForm:U?e.jsxs(te,{isSaving:w.isSaving,error:Et,onCancel:()=>$(!1),onSave:()=>{Pn()},children:[e.jsx(v,{label:"Vet / doctor name",placeholder:"e.g. Dr. Sarah Chen",value:Pe,onChange:K}),e.jsx(v,{label:"Last visit",type:"date",value:Q,onChange:I})]}):null,primaryVetFound:M("primaryVet")}),e.jsx(il,{prescriptions:en,isLoading:Jt,onEdit:()=>Ws(),onEditPrescription:Ws,onToggleStatus:n=>{H.setStatus(ut(n.status)?{id:n.id,status:"active"}:{id:n.id,status:"discontinued",endedOn:new Date().toISOString().slice(0,10)})},onRemove:n=>{H.remove(n.id)},canRemove:Ls,editForm:kt?e.jsxs(te,{isSaving:H.isAdding||H.isUpdating,error:Dt,onCancel:qs,onSave:()=>{_n()},children:[e.jsx(v,{label:"Medication name",placeholder:"e.g. Apoquel",value:Ae,onChange:ds}),e.jsx(v,{label:"Dosage (optional)",placeholder:"e.g. 16mg daily",value:cs,onChange:us}),e.jsx(v,{label:"Prescribed by (optional)",placeholder:"e.g. Dr. Reyes",value:ps,onChange:ms}),e.jsx(v,{label:"Refill due (optional)",type:"date",value:xs,onChange:hs})]}):null,found:M("medications")}),e.jsx(hl,{vaccines:Me,isLoading:sn,onEdit:()=>Gs(),onEditVaccine:Gs,onRemove:n=>{J.remove(n.id)},canRemove:Ls,sourceDocumentFor:n=>{if(!n.sourceDocumentId)return null;const h=y.documents.find(k=>k.id===n.sourceDocumentId);return h?{fileName:h.file_name,signedUrl:h.signedUrl??null}:null},editForm:It?e.jsxs(te,{isSaving:J.isAdding||J.isUpdating,error:Lt,onCancel:Hs,onSave:()=>{Rn()},children:[e.jsx(v,{label:"Vaccine name",placeholder:"e.g. Rabies",value:T.name,onChange:n=>G(h=>({...h,name:n}))}),e.jsx(v,{label:"Date given (optional)",type:"date",value:T.dateGiven,onChange:n=>G(h=>({...h,dateGiven:n}
1))}),e.jsx(v,{label:"Expires (optional)",type:"date",value:T.expiresAt,onChange:n=>G(h=>({...h,expiresAt:n}))}),e.jsx(v,{label:"Administered by (optional)",placeholder:"e.g. Bay Animal Hospital",value:T.administeredBy,onChange:n=>G(h=>({...h,administeredBy:n}))})]}):null,found:M("vaccines")}),e.jsx(nl,{notice:_?e.jsx(Dr,{petName:E,currentProvider:_.provider,pendingProvider:rn,isResolving:dn,onConfirm:()=>{ln().catch(n=>qe(n,{where:"PetDocuments.confirmPendingProvider"}))},onDismiss:()=>{on().catch(n=>qe(n,{where:"PetDocuments.dismissPendingProvider"}))}}):null,insurance:_,isLoading:A||Os,onEdit:()=>me(!0),onSeePrice:()=>u(sr(Pt)),editForm:ys?e.jsx(te,{isSaving:an,error:Be.saveError,onCancel:()=>me(!1),onSave:()=>{Be.handleSave()},children:e.jsx(Br,{form:Be})}):null,found:M("insurance")}),e.jsx(tt,{section:"care_feeding",title:"Care & feeding",icon:Wn,accent:"tertiary",editLabel:"Edit care and feeding",fieldId:El,ariaLabel:"Care and feeding notes",description:`What someone looking after ${E} needs to know.`,placeholder:Ir(t.petType),value:Te,error:_t,onChange:as,onCommit:()=>{An()}}),e.jsx(Hr,{allergies:Ve,onEdit:Sn,editForm:Tt?e.jsx(te,{error:At,onCancel:()=>Ee(!1),onSave:()=>{Cn()},children:e.jsx("textarea",{"aria-label":"Allergies",value:es,onChange:n=>ss(n.target.value),placeholder:"e.g. Chicken, Dairy, Pollen",rows:5,className:yt})}):null,found:M("allergies")}),e.jsx(tt,{section:"behavior_notes",title:"Behavior notes",icon:qn,accent:"primary",editLabel:"Edit behavior notes",fieldId:Sl,ariaLabel:"Behavioral notes",placeholder:Lr(t.petType),value:Ce,error:Rt,onChange:ts,onCommit:()=>{Tn()}})]}),e.jsx("div",{className:Tl,children:e.jsx(Tr,{petId:t.petId,petName:E})}),e.jsx("div",{className:"pt-6 md:pt-0 print:hidden",children:e.jsx(Al,{title:"Documents",documents:y.documents,isLoading:y.isLoading,noteFor:n=>Va(n.extraction_status,n.extraction_error,cn.outcomeFor(n.id)),uploadAvailability:be.availability,onUpsell:()=>p(!0),isUploading:y.isUploading||be.isParsing,busyLabel:y.isUploading?"Uploadingâ¦":be.isParsing?"Reading your documentâ¦":null,uploadError:un,onUpload:n=>{pn(n)}})})]})]})]})})]})]}),e.jsx(Ca,{open:Ot,onClose:()=>vs(!1)}),e.jsx(Ta,{open:Mt,onClose:()=>_e(!1),petName:E,shareUrl:xe,accessCode:Ft,onCopyLink:()=>Vt(),onCopyCode:()=>zt(),onRevoke:()=>{Ut(),_e(!1)},isRevoking:$t,canRevoke:Gt}),r.show&&t.name&&e.jsx(dr,{message:cr("passport",t.name),petType:t.petType==="cat"?"cat":"dog",onDismiss:r.dismiss})]})}export{Oo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.