import{r as m,j as e,a1 as le,I as A,T as M,a2 as ye,a3 as ke,a4 as ce,a5 as we,z as q,a6 as Ce,a7 as de,a8 as Se,a9 as me,aa as Pe,i as Me,ab as Re,ac as ue,y as G,ad as xe,ae as ge,af as pe,Y as U,ag as Fe,ah as Ee,ai as Ie,R as Te,Q as he,m as Ae,aj as De,C as _,ak as ze,a as O}from"./0-vendor-react-DWOJpYrt.js";import{B as E,I as j,C as F,A as Z,a as X,b as Ve,c as K,d as W,e as Q}from"./page-comunicacion-DmHQUHoW.js";import{c as P,B as Y}from"./page-ajustes-DgawOEJM.js";import{a as be}from"./1-vendor-utils-Delnuc0l.js";const Le={smartPerfusions:!0},H=s=>typeof s=="number"&&Number.isFinite(s),L=(s,t,r)=>({value:s,interpretation:t,severity:r}),Oe=s=>{const{weightKg:t,doseMcgKgMin:r,concentrationMcgMl:o,doseRange:a}=s;if(!H(t)||!H(r)||!H(o)||t<=0||r<=0||o<=0)return L("N/A","Datos insuficientes para calcular ml/h","amber");const i=r*t*60/o;if(a){if(r>a.max)return L(i,"Dosis por encima del rango habitual","red");if(r{if(!H(s)||!H(t)||s<=0||t<=0)return L("N/A","Datos insuficientes para gotas/min","amber");const r=s*t/60;return L(r,"Goteo estimado","green")},w=s=>typeof s=="number"&&Number.isFinite(s),N=(s,t,r)=>({value:s,interpretation:t,severity:r}),Fs=(s,t)=>{if(!w(s)||!w(t))return N("N/A","Insufficient data for MAP","amber");const r=(2*t+s)/3;return r<65?N(r,"MAP low (hypotension risk)","red"):r<75?N(r,"MAP borderline","amber"):N(r,"MAP adequate","green")},Es=(s,t)=>{if(!w(s)||!w(t)||t<=0)return N("N/A","Insufficient data for Shock Index","amber");const r=s/t;return r>=1?N(r,"Shock Index high (possible shock)","red"):r>=.7?N(r,"Shock Index elevated","amber"):N(r,"Shock Index normal","green")},Is=s=>{const{respiratoryRate:t,systolicBP:r,gcs:o}=s;if(!w(t)||!w(r)||!w(o))return N("N/A","Insufficient data for qSOFA","amber");const a=(t>=22?1:0)+(r<=100?1:0)+(o<15?1:0);return a>=2?N(a,"qSOFA high risk","red"):a===1?N(a,"qSOFA elevated risk","amber"):N(a,"qSOFA low risk","green")},qe=s=>s<=8?3:s<=11?1:s<=20?0:s<=24?2:3,He=s=>s>=96?0:s>=94?1:s>=92?2:3,$e=s=>s<=90?3:s<=100?2:s<=110?1:s<=219?0:3,Ge=s=>s<=40?3:s<=50?1:s<=90?0:s<=110?1:s<=130?2:3,_e=s=>s<=35?3:s<=36?1:s<=38?0:s<=39?1:2,Ue=s=>s<15?3:0,Ts=s=>{const{respiratoryRate:t,oxygenSaturation:r,systolicBP:o,heartRate:a,temperatureC:i,gcs:n}=s;if(!w(t)||!w(r)||!w(o)||!w(a)||!w(i)||!w(n))return N("N/A","Insufficient data for NEWS2","amber");const d=qe(t)+He(r)+$e(o)+Ge(a)+_e(i)+Ue(n);return d>=7?N(d,"NEWS2 high risk","red"):d>=5?N(d,"NEWS2 medium risk","amber"):N(d,"NEWS2 low risk","green")},ee="patient_context_v1",Ke=1440*60*1e3,$={patient:{},vitals:{},clinicalFlags:{}},fe=m.createContext(void 0),se=typeof window<"u",We=()=>{if(!se)return null;try{const s=window.localStorage.getItem(ee);return s?JSON.parse(s):null}catch{return null}},Qe=s=>{if(se)try{const t={data:s,expiresAt:Date.now()+Ke};window.localStorage.setItem(ee,JSON.stringify(t))}catch{}},ae=()=>{if(se)try{window.localStorage.removeItem(ee)}catch{}},As=({children:s})=>{const[t,r]=m.useState($);m.useEffect(()=>{const a=We();if(a){if(a.expiresAt<=Date.now()){ae(),r($);return}r(a.data||$)}},[]),m.useEffect(()=>{Qe(t)},[t]);const o=m.useMemo(()=>({state:t,setPatientBasics:a=>{r(i=>({...i,patient:{...i.patient,...a}}))},updateVitals:a=>{r(i=>({...i,vitals:{...i.vitals,...a}}))},setClinicalFlags:a=>{r(i=>({...i,clinicalFlags:{...a}}))},resetPatient:()=>{r($),ae()}}),[t]);return e.jsx(fe.Provider,{value:o,children:s})},Ye=()=>{const s=m.useContext(fe);if(!s)throw new Error("usePatient must be used within PatientContextProvider");return s},Je=[{name:"Apertura Ocular",options:[{label:"Espontánea",value:4},{label:"A la orden verbal",value:3},{label:"Al dolor",value:2},{label:"No abre",value:1}]},{name:"Respuesta Verbal",options:[{label:"Orientado",value:5},{label:"Confuso",value:4},{label:"Palabras inapropiadas",value:3},{label:"Sonidos incomprensibles",value:2},{label:"Sin respuesta",value:1}]},{name:"Respuesta Motora",options:[{label:"Obedece órdenes",value:6},{label:"Localiza el dolor",value:5},{label:"Retirada al dolor",value:4},{label:"Flexión anormal (decorticación)",value:3},{label:"Extensión anormal (descerebración)",value:2},{label:"Sin respuesta",value:1}]}],Ze=s=>s<=8?{severity:"TCE Grave - IOT",color:"critical"}:s<=12?{severity:"TCE Moderado",color:"high"}:{severity:"TCE Leve",color:"low"},Xe=[{id:"dopamina",name:"Perfusión Dopamina",drugName:"Dopamina",preparation:"200mg en 100ml SG5% = 2000 mcg/ml",unit:"ml/h",doseRange:"2-20 mcg/kg/min",columns:["5 mcg/kg/min","10 mcg/kg/min","15 mcg/kg/min","20 mcg/kg/min"],rows:[{weight:50,doses:{"5 mcg/kg/min":"7.5","10 mcg/kg/min":"15","15 mcg/kg/min":"22.5","20 mcg/kg/min":"30"}},{weight:60,doses:{"5 mcg/kg/min":"9","10 mcg/kg/min":"18","15 mcg/kg/min":"27","20 mcg/kg/min":"36"}},{weight:70,doses:{"5 mcg/kg/min":"10.5","10 mcg/kg/min":"21","15 mcg/kg/min":"31.5","20 mcg/kg/min":"42"}},{weight:80,doses:{"5 mcg/kg/min":"12","10 mcg/kg/min":"24","15 mcg/kg/min":"36","20 mcg/kg/min":"48"}},{weight:90,doses:{"5 mcg/kg/min":"13.5","10 mcg/kg/min":"27","15 mcg/kg/min":"40.5","20 mcg/kg/min":"54"}},{weight:100,doses:{"5 mcg/kg/min":"15","10 mcg/kg/min":"30","15 mcg/kg/min":"45","20 mcg/kg/min":"60"}}]},{id:"noradrenalina",name:"Perfusión Noradrenalina",drugName:"Noradrenalina",preparation:"8mg en 100ml SG5% = 80 mcg/ml",unit:"ml/h",doseRange:"0.05-1 mcg/kg/min",columns:["0.1 mcg/kg/min","0.2 mcg/kg/min","0.3 mcg/kg/min","0.5 mcg/kg/min"],rows:[{weight:50,doses:{"0.1 mcg/kg/min":"3.75","0.2 mcg/kg/min":"7.5","0.3 mcg/kg/min":"11.25","0.5 mcg/kg/min":"18.75"}},{weight:60,doses:{"0.1 mcg/kg/min":"4.5","0.2 mcg/kg/min":"9","0.3 mcg/kg/min":"13.5","0.5 mcg/kg/min":"22.5"}},{weight:70,doses:{"0.1 mcg/kg/min":"5.25","0.2 mcg/kg/min":"10.5","0.3 mcg/kg/min":"15.75","0.5 mcg/kg/min":"26.25"}},{weight:80,doses:{"0.1 mcg/kg/min":"6","0.2 mcg/kg/min":"12","0.3 mcg/kg/min":"18","0.5 mcg/kg/min":"30"}},{weight:90,doses:{"0.1 mcg/kg/min":"6.75","0.2 mcg/kg/min":"13.5","0.3 mcg/kg/min":"20.25","0.5 mcg/kg/min":"33.75"}},{weight:100,doses:{"0.1 mcg/kg/min":"7.5","0.2 mcg/kg/min":"15","0.3 mcg/kg/min":"22.5","0.5 mcg/kg/min":"37.5"}}]},{id:"adrenalina",name:"Perfusión Adrenalina",drugName:"Adrenalina",preparation:"1mg en 100ml SG5% = 10 mcg/ml",unit:"ml/h",doseRange:"0.05-0.5 mcg/kg/min",columns:["0.1 mcg/kg/min","0.2 mcg/kg/min","0.3 mcg/kg/min","0.5 mcg/kg/min"],rows:[{weight:50,doses:{"0.1 mcg/kg/min":"30","0.2 mcg/kg/min":"60","0.3 mcg/kg/min":"90","0.5 mcg/kg/min":"150"}},{weight:60,doses:{"0.1 mcg/kg/min":"36","0.2 mcg/kg/min":"72","0.3 mcg/kg/min":"108","0.5 mcg/kg/min":"180"}},{weight:70,doses:{"0.1 mcg/kg/min":"42","0.2 mcg/kg/min":"84","0.3 mcg/kg/min":"126","0.5 mcg/kg/min":"210"}},{weight:80,doses:{"0.1 mcg/kg/min":"48","0.2 mcg/kg/min":"96","0.3 mcg/kg/min":"144","0.5 mcg/kg/min":"240"}},{weight:90,doses:{"0.1 mcg/kg/min":"54","0.2 mcg/kg/min":"108","0.3 mcg/kg/min":"162","0.5 mcg/kg/min":"270"}},{weight:100,doses:{"0.1 mcg/kg/min":"60","0.2 mcg/kg/min":"120","0.3 mcg/kg/min":"180","0.5 mcg/kg/min":"300"}}]},{id:"dobutamina",name:"Perfusión Dobutamina",drugName:"Dobutamina",preparation:"250mg en 250ml SG5% = 1000 mcg/ml",unit:"ml/h",doseRange:"2.5-15 mcg/kg/min",columns:["5 mcg/kg/min","10 mcg/kg/min","15 mcg/kg/min"],rows:[{weight:50,doses:{"5 mcg/kg/min":"15","10 mcg/kg/min":"30","15 mcg/kg/min":"45"}},{weight:60,doses:{"5 mcg/kg/min":"18","10 mcg/kg/min":"36","15 mcg/kg/min":"54"}},{weight:70,doses:{"5 mcg/kg/min":"21","10 mcg/kg/min":"42","15 mcg/kg/min":"63"}},{weight:80,doses:{"5 mcg/kg/min":"24","10 mcg/kg/min":"48","15 mcg/kg/min":"72"}},{weight:90,doses:{"5 mcg/kg/min":"27","10 mcg/kg/min":"54","15 mcg/kg/min":"81"}},{weight:100,doses:{"5 mcg/kg/min":"30","10 mcg/kg/min":"60","15 mcg/kg/min":"90"}}]},{id:"nitroglicerina",name:"Perfusión Nitroglicerina",drugName:"Nitroglicerina",preparation:"50mg en 250ml SG5% = 200 mcg/ml",unit:"ml/h",doseRange:"0.1-0.5 mcg/kg/min",columns:["0.1 mcg/kg/min","0.2 mcg/kg/min","0.3 mcg/kg/min","0.5 mcg/kg/min"],rows:[{weight:50,doses:{"0.1 mcg/kg/min":"15","0.2 mcg/kg/min":"30","0.3 mcg/kg/min":"45","0.5 mcg/kg/min":"75"}},{weight:60,doses:{"0.1 mcg/kg/min":"18","0.2 mcg/kg/min":"36","0.3 mcg/kg/min":"54","0.5 mcg/kg/min":"90"}},{weight:70,doses:{"0.1 mcg/kg/min":"21","0.2 mcg/kg/min":"42","0.3 mcg/kg/min":"63","0.5 mcg/kg/min":"105"}},{weight:80,doses:{"0.1 mcg/kg/min":"24","0.2 mcg/kg/min":"48","0.3 mcg/kg/min":"72","0.5 mcg/kg/min":"120"}},{weight:90,doses:{"0.1 mcg/kg/min":"27","0.2 mcg/kg/min":"54","0.3 mcg/kg/min":"81","0.5 mcg/kg/min":"135"}},{weight:100,doses:{"0.1 mcg/kg/min":"30","0.2 mcg/kg/min":"60","0.3 mcg/kg/min":"90","0.5 mcg/kg/min":"150"}}]},{id:"furosemida",name:"Perfusión Furosemida",drugName:"Furosemida",preparation:"250mg en 250ml SG5% = 1000 mcg/ml (1 mg/ml)",unit:"ml/h",doseRange:"0.1-0.4 mg/kg/h",columns:["0.1 mg/kg/h","0.2 mg/kg/h","0.3 mg/kg/h","0.4 mg/kg/h"],rows:[{weight:50,doses:{"0.1 mg/kg/h":"5","0.2 mg/kg/h":"10","0.3 mg/kg/h":"15","0.4 mg/kg/h":"20"}},{weight:60,doses:{"0.1 mg/kg/h":"6","0.2 mg/kg/h":"12","0.3 mg/kg/h":"18","0.4 mg/kg/h":"24"}},{weight:70,doses:{"0.1 mg/kg/h":"7","0.2 mg/kg/h":"14","0.3 mg/kg/h":"21","0.4 mg/kg/h":"28"}},{weight:80,doses:{"0.1 mg/kg/h":"8","0.2 mg/kg/h":"16","0.3 mg/kg/h":"24","0.4 mg/kg/h":"32"}},{weight:90,doses:{"0.1 mg/kg/h":"9","0.2 mg/kg/h":"18","0.3 mg/kg/h":"27","0.4 mg/kg/h":"36"}},{weight:100,doses:{"0.1 mg/kg/h":"10","0.2 mg/kg/h":"20","0.3 mg/kg/h":"30","0.4 mg/kg/h":"40"}}]}],es=(s,t,r=0)=>{const o=4*s*t,a=o/1e3,i=o*.5,n=o*.5,d=i/8,u=n/16;let x=o;if(r<8){const p=r/8*i;x=o-p}else r<24?x=(24-r)/16*n:x=0;const l=s*40;return{total24h:Math.round(o),total24hLiters:a,first8h:Math.round(i),next16h:Math.round(n),rateFirst8h:d,rateNext16h:u,remaining24h:Math.round(x),maintenance:Math.round(l)}},ss=()=>{const[s,t]=m.useState({"Apertura Ocular":4,"Respuesta Verbal":5,"Respuesta Motora":6}),r=Object.values(s).reduce((i,n)=>i+n,0),o=Ze(r),a=(i,n)=>{t(d=>({...d,[i]:n}))};return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"🧠 Escala de Glasgow (GCS)"}),e.jsx("div",{className:"space-y-6",children:Je.map(i=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:i.name}),e.jsx("span",{className:"text-xl font-bold text-primary",children:s[i.name]})]}),e.jsx("div",{className:"space-y-2",children:i.options.map(n=>e.jsxs("button",{onClick:()=>a(i.name,n.value),className:P("w-full flex items-center justify-between p-3 rounded-lg border transition-colors text-left",s[i.name]===n.value?"bg-primary/10 border-primary text-foreground":"bg-muted border-border text-muted-foreground hover:border-primary/50"),children:[e.jsx("span",{className:"text-sm",children:n.label}),e.jsx("span",{className:"font-bold",children:n.value})]},n.value))})]},i.name))}),e.jsxs("div",{className:"mt-6 p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Puntuación Total"}),e.jsx("p",{className:"text-5xl font-bold text-foreground mb-2",children:r}),e.jsx(E,{variant:o.color==="critical"?"critical":o.color==="high"?"high":"low",className:"text-sm px-3 py-1",children:o.severity})]}),e.jsxs("div",{className:"mt-4 text-center text-sm text-muted-foreground",children:[e.jsx("p",{children:"Rango: 3 (mínimo) - 15 (máximo)"}),e.jsx("p",{className:"mt-1",children:"≤8: Grave (IOT) | 9-12: Moderado | 13-15: Leve"})]})]})},as=be("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),b=m.forwardRef(({className:s,...t},r)=>e.jsx(le,{ref:r,className:P(as(),s),...t}));b.displayName=le.displayName;const rs=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),[a,i]=m.useState(""),n=parseFloat(s)||0,d=parseFloat(r)||0,u=parseFloat(a)||0,x=n>0&&d>0&&d<=100&&u>=0,l=x?es(n,d,u):null;return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"🔥 Fórmula de Parkland (Quemados)"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Fórmula de Parkland:"}),e.jsx("p",{children:"4 ml × peso (kg) × % superficie corporal quemada"}),e.jsx("p",{className:"mt-2 text-xs",children:"Aplicable para quemaduras >20% SCQ en adultos"})]})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"weight",className:"text-sm font-semibold text-foreground mb-2 block",children:"Peso del paciente (kg)"}),e.jsx(j,{id:"weight",type:"number",inputMode:"decimal",placeholder:"Ej: 70",value:s,onChange:p=>t(p.target.value),className:"w-full",min:"0",step:"0.1"})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"burnPercentage",className:"text-sm font-semibold text-foreground mb-2 block",children:"Superficie Corporal Quemada (%)"}),e.jsx(j,{id:"burnPercentage",type:"number",inputMode:"decimal",placeholder:"Ej: 30",value:r,onChange:p=>o(p.target.value),className:"w-full",min:"0",max:"100",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Usar regla de los 9 o palma de la mano (1% SCQ)"})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"hoursSinceBurn",className:"text-sm font-semibold text-foreground mb-2 block",children:"Tiempo desde la quemadura (horas)"}),e.jsx(j,{id:"hoursSinceBurn",type:"number",inputMode:"decimal",placeholder:"Ej: 2",value:a,onChange:p=>i(p.target.value),className:"w-full",min:"0",step:"0.5"})]})]}),l&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Total de líquidos en primeras 24h"}),e.jsxs("p",{className:"text-3xl font-bold text-foreground mb-2",children:[l.total24h.toLocaleString("es-ES",{maximumFractionDigits:0})," ml"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["≈ ",l.total24hLiters.toFixed(1)," litros"]})]}),u<8?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"p-4 bg-[hsl(var(--emergency-high))]/10 border border-[hsl(var(--emergency-high))]/30 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-high))]"}),e.jsx("p",{className:"font-semibold text-foreground",children:"Primeras 8 horas"})]}),e.jsxs("p",{className:"text-2xl font-bold text-foreground mb-1",children:[l.first8h.toLocaleString("es-ES",{maximumFractionDigits:0})," ml"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Velocidad: ",l.rateFirst8h.toFixed(1)," ml/h"]}),u>0&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Ya transcurridas: ",u.toFixed(1),"h | Restante: ",(8-u).toFixed(1),"h"]})]}),e.jsxs("div",{className:"p-4 bg-muted/50 border border-border rounded-lg",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Siguientes 16 horas"}),e.jsxs("p",{className:"text-xl font-bold text-foreground",children:[l.next16h.toLocaleString("es-ES",{maximumFractionDigits:0})," ml"]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Velocidad: ",l.rateNext16h.toFixed(1)," ml/h"]})]})]}):u<24?e.jsxs("div",{className:"p-4 bg-muted/50 border border-border rounded-lg",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Restante de primeras 24h"}),e.jsxs("p",{className:"text-xl font-bold text-foreground",children:[l.remaining24h.toLocaleString("es-ES",{maximumFractionDigits:0})," ml"]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["En ",(24-u).toFixed(1)," horas restantes"]})]}):e.jsxs("div",{className:"p-4 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-medium))]"}),e.jsx("p",{className:"font-semibold text-foreground",children:"Pasadas primeras 24h"})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Mantenimiento según necesidades: ~",l.maintenance.toLocaleString("es-ES")," ml/día"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Considerar pérdidas por evaporación y necesidades basales"})]}),e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border-l-4 border-[hsl(var(--emergency-medium))] rounded-r-lg",children:[e.jsx("p",{className:"text-sm text-foreground font-semibold mb-1",children:"⚠️ Consideraciones importantes:"}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"Usar Ringer Lactato como solución de elección"}),e.jsx("li",{children:"Monitorizar diuresis objetivo: 0.5-1 ml/kg/h"}),e.jsx("li",{children:"Ajustar según respuesta clínica y analítica"}),e.jsx("li",{children:"En pediatría: añadir glucosa al mantenimiento"}),d<20&&e.jsx("li",{className:"text-[hsl(var(--emergency-medium))] font-semibold",children:"Quemaduras <20% pueden requerir menos líquidos"})]})]})})]}),!x&&(s||r||a)&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, completa todos los campos con valores válidos"})})]})]})},z=ye,V=ke,I=m.forwardRef(({className:s,children:t,...r},o)=>e.jsxs(ce,{ref:o,className:P("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...r,children:[t,e.jsx(we,{asChild:!0,children:e.jsx(q,{className:"h-4 w-4 opacity-50"})})]}));I.displayName=ce.displayName;const je=m.forwardRef(({className:s,...t},r)=>e.jsx(ue,{ref:r,className:P("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(G,{className:"h-4 w-4"})}));je.displayName=ue.displayName;const ve=m.forwardRef(({className:s,...t},r)=>e.jsx(xe,{ref:r,className:P("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(q,{className:"h-4 w-4"})}));ve.displayName=xe.displayName;const T=m.forwardRef(({className:s,children:t,position:r="popper",...o},a)=>e.jsx(Ce,{children:e.jsxs(de,{ref:a,className:P("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:r,...o,children:[e.jsx(je,{}),e.jsx(Se,{className:P("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),e.jsx(ve,{})]})}));T.displayName=de.displayName;const ts=m.forwardRef(({className:s,...t},r)=>e.jsx(ge,{ref:r,className:P("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...t}));ts.displayName=ge.displayName;const C=m.forwardRef(({className:s,children:t,...r},o)=>e.jsxs(me,{ref:o,className:P("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",s),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Pe,{children:e.jsx(Me,{className:"h-4 w-4"})})}),e.jsx(Re,{children:t})]}));C.displayName=me.displayName;const is=m.forwardRef(({className:s,...t},r)=>e.jsx(pe,{ref:r,className:P("-mx-1 my-1 h-px bg-muted",s),...t}));is.displayName=pe.displayName;const re=[{id:"adrenalina-anafilaxia",name:"Adrenalina (Anafilaxia)",presentation:"Ampolla 1 mg/1 ml (1:1000)",concentration:"1 mg/ml",dosePerKg:"0.01 mg/kg",maxDose:"0.5 mg",route:"IM",indication:"Anafilaxia grave",notes:["Sitio IM: tercio medio del vasto externo (muslo lateral)","Repetir a los 5 min si no mejora","Efectos adversos esperados (temblor, taquicardia) son normales"],warning:"⚠️ CONCENTRACIÓN CRÍTICA: Usar ampolla 1:1000 (1 mg/ml) para IM"},{id:"adrenalina-pcr",name:"Adrenalina (PCR)",presentation:"Ampolla 1 mg/10 ml (1:10.000)",concentration:"0.1 mg/ml",dosePerKg:"0.01 mg/kg",route:"IV/IO",indication:"Parada cardiorrespiratoria",notes:["Administrar durante pausa mínima en compresiones","Lavado con 20 ml SSF","Repetir cada 3-5 minutos"],warning:"⚠️ CONCENTRACIÓN CRÍTICA: Usar ampolla 1:10.000 (0.1 mg/ml) para IV/IO"},{id:"amiodarona",name:"Amiodarona",presentation:"Ampolla 150 mg/3 ml",concentration:"50 mg/ml",dosePerKg:"5 mg/kg",maxDose:"300 mg",route:"IV/IO",indication:"FV/TVSP refractaria",notes:["Diluir en SG5% (precipita con SSF)","Segunda dosis: 150 mg si persiste FV/TVSP"]},{id:"atropina",name:"Atropina",presentation:"Ampolla 1 mg/1 ml",concentration:"1 mg/ml",dosePerKg:"0.02 mg/kg",minDose:"0.1 mg",maxDose:"0.5 mg",route:"IV/IO",indication:"Bradicardia sintomática",notes:["Dosis <0.5 mg pueden causar bradicardia paradójica","Repetir cada 3-5 min si es necesario"]},{id:"midazolam-crisis",name:"Midazolam (Crisis)",presentation:"Ampolla 5 mg/1 ml o 10 mg/2 ml",concentration:"5 mg/ml",dosePerKg:"0.2-0.3 mg/kg",maxDose:"10 mg",route:"Intranasal/Bucal",indication:"Crisis convulsiva",notes:["Vía intranasal o bucal preferida en pediatría","Monitorizar respiración"]},{id:"salbutamol-nebulizacion",name:"Salbutamol (Nebulización)",presentation:"Ampolla 2.5 mg/2.5 ml",concentration:"1 mg/ml",dosePerKg:"0.15 mg/kg",route:"Nebulizado",indication:"Crisis asmática / Broncoespasmo",notes:["<20 kg: 2.5 mg","≥20 kg: 5 mg","Repetir cada 20 min si es necesario"]},{id:"furosemida",name:"Furosemida",presentation:"Ampolla 20 mg/2 ml",concentration:"10 mg/ml",dosePerKg:"1-2 mg/kg",maxDose:"40 mg",route:"IV/IO",indication:"Edema pulmonar / Insuficiencia cardíaca",notes:["Administrar lentamente","Monitorizar diuresis"]},{id:"morfina",name:"Morfina",presentation:"Ampolla 10 mg/1 ml",concentration:"10 mg/ml",dosePerKg:"0.1-0.2 mg/kg",maxDose:"10 mg",route:"IV/IO",indication:"Dolor severo",notes:["Administrar lentamente","Monitorizar respiración","Tener naloxona disponible"],warning:"⚠️ Monitorizar respiración. Tener naloxona disponible"},{id:"naloxona",name:"Naloxona",presentation:"Ampolla 0.4 mg/1 ml",concentration:"0.4 mg/ml",dosePerKg:"0.01-0.1 mg/kg",route:"IV/IO/IM",indication:"Intoxicación opioides / Depresión respiratoria",notes:["Dosis inicial: 0.01 mg/kg","Repetir si es necesario","Efecto corto, puede requerir múltiples dosis"]},{id:"glucosa",name:"Glucosa (Dextrosa)",presentation:"Ampolla 50% 25 g/50 ml",concentration:"0.5 g/ml",dosePerKg:"0.5-1 g/kg",route:"IV/IO",indication:"Hipoglucemia",notes:["Diluir al 10% o 25% según protocolo","Administrar lentamente","Monitorizar glucemia"]}],ns=(s,t)=>{const r=s.dosePerKg.match(/([\d.]+)\s*mg\/kg/);if(!r)return{doseMg:0,doseMl:0,isValid:!1,message:"Error al parsear dosis por kg"};const o=parseFloat(r[1]);let a=t*o;if(s.minDose){const x=s.minDose.match(/([\d.]+)\s*mg/);if(x){const l=parseFloat(x[1]);al&&(i=`⚠️ Dosis calculada (${a.toFixed(2)} mg) excede el máximo (${l} mg). Usar dosis máxima: ${l} mg`,a=l)}}const n=s.concentration.match(/([\d.]+)\s*mg\/ml/);if(!n)return{doseMg:a,doseMl:0,isValid:!1,message:"Error al parsear concentración"};const d=parseFloat(n[1]),u=a/d;return{doseMg:Math.round(a*100)/100,doseMl:Math.round(u*1e3)/1e3,isValid:!0,warning:i}},os=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),a=re.find(u=>u.id===s),i=parseFloat(r)||0,n=a&&i>0&&i<=200,d=n&&a?ns(a,i):null;return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"⚖️ Dosis Pediátricas por Peso"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-medium))] mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"⚠️ CRÍTICO:"}),e.jsx("p",{children:"En pediatría, SIEMPRE calcular dosis por peso. Un error decimal puede ser grave."}),e.jsx("p",{className:"mt-1",children:"Verificar cálculo con compañero antes de administrar."})]})]})}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"drug",className:"text-sm font-semibold text-foreground mb-2 block",children:"Fármaco"}),e.jsxs(z,{value:s,onValueChange:t,children:[e.jsx(I,{id:"drug",className:"w-full",children:e.jsx(V,{placeholder:"Selecciona un fármaco"})}),e.jsx(T,{children:re.map(u=>e.jsxs(C,{value:u.id,children:[u.name," - ",u.indication]},u.id))})]})]}),a&&e.jsxs("div",{className:"p-4 bg-muted/50 border border-border rounded-lg space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:a.name}),e.jsx(E,{variant:"info",className:"text-xs",children:a.route})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Presentación:"})," ",a.presentation]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Concentración:"})," ",a.concentration]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Dosis:"})," ",a.dosePerKg,a.maxDose&&` (máx: ${a.maxDose})`,a.minDose&&` (mín: ${a.minDose})`]}),a.warning&&e.jsx("div",{className:"mt-2 p-2 bg-[hsl(var(--emergency-high))]/10 border border-[hsl(var(--emergency-high))]/30 rounded text-xs text-[hsl(var(--emergency-high))]",children:a.warning})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"weight",className:"text-sm font-semibold text-foreground mb-2 block",children:"Peso del paciente (kg)"}),e.jsx(j,{id:"weight",type:"number",inputMode:"decimal",placeholder:"Ej: 25",value:r,onChange:u=>o(u.target.value),className:"w-full",min:"0",max:"200",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Si no se conoce el peso exacto, usar estimación por edad o Broselow si está disponible"})]}),d&&d.isValid&&a&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(U,{className:"w-5 h-5 text-primary"}),e.jsx("p",{className:"text-muted-foreground text-sm font-semibold",children:"Dosis Calculada"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Dosis en mg"}),e.jsxs("p",{className:"text-2xl font-bold text-foreground",children:[d.doseMg.toFixed(2)," mg"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Volumen en ml"}),e.jsxs("p",{className:"text-2xl font-bold text-foreground",children:[d.doseMl.toFixed(3)," ml"]})]})]})]}),d.warning&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-high))]/10 border border-[hsl(var(--emergency-high))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-[hsl(var(--emergency-high))] font-semibold",children:d.warning})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"p-3 bg-muted/50 border border-border rounded-lg",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Cálculo:"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[i," kg × ",a.dosePerKg," = ",d.doseMg.toFixed(2)," mg"]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[d.doseMg.toFixed(2)," mg ÷ ",a.concentration," = ",d.doseMl.toFixed(3)," ml"]})]}),a.notes&&a.notes.length>0&&e.jsx("div",{className:"p-3 bg-[hsl(var(--info))]/10 border border-[hsl(var(--info))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-4 h-4 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Notas importantes:"}),e.jsx("ul",{className:"text-xs text-muted-foreground space-y-0.5 list-disc list-inside",children:a.notes.map((u,x)=>e.jsx("li",{children:u},x))})]})]})}),e.jsxs("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border-l-4 border-[hsl(var(--emergency-medium))] rounded-r-lg",children:[e.jsx("p",{className:"text-xs text-foreground font-semibold mb-1",children:"⚠️ Verificación obligatoria:"}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Verificar cálculo con compañero antes de preparar"}),e.jsx("li",{children:"Leer etiqueta del fármaco en voz alta"}),e.jsx("li",{children:"Confirmar concentración y presentación"}),e.jsx("li",{children:'Documentar dosis exacta en mg y ml (no "1 ampolla")'})]})]})]})]}),!n&&(s||r)&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, selecciona un fármaco e ingresa un peso válido (0-200 kg)"})})]})]})},ls=()=>{const[s,t]=m.useState(!1),[r,o]=m.useState(0),[a,i]=m.useState(0),[n,d]=m.useState(0),u=m.useRef(null);m.useRef(null);const x=120;m.useEffect(()=>(s?u.current=setInterval(()=>{o(y=>{const S=y+1;return S-n>=x&&(i(Ne=>Ne+1),d(S),l()),S})},1e3):u.current&&clearInterval(u.current),()=>{u.current&&clearInterval(u.current)}),[s,n]);const l=()=>{if(typeof Audio<"u"){const y=new(window.AudioContext||window.webkitAudioContext),S=y.createOscillator(),D=y.createGain();S.connect(D),D.connect(y.destination),S.frequency.value=800,S.type="sine",D.gain.setValueAtTime(.3,y.currentTime),D.gain.exponentialRampToValueAtTime(.01,y.currentTime+.5),S.start(y.currentTime),S.stop(y.currentTime+.5)}},p=()=>{t(!0),r===0&&d(0)},c=()=>{t(!1)},h=()=>{t(!1),o(0),i(0),d(0)},g=y=>{const S=Math.floor(y/60),D=y%60;return`${S.toString().padStart(2,"0")}:${D.toString().padStart(2,"0")}`},k=r-n,v=x-k,f=k/x*100;return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"⏱️ Temporizador de RCP"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Ciclos de RCP:"}),e.jsx("p",{children:"Cada 2 minutos (120 segundos) se debe cambiar de reanimador para mantener calidad de compresiones."})]})]})}),e.jsxs("div",{className:"p-6 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx(Fe,{className:"w-6 h-6 text-primary"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Tiempo Total"})]}),e.jsx("p",{className:"text-5xl font-bold text-foreground mb-2",children:g(r)}),e.jsxs(E,{variant:"info",className:"text-sm px-3 py-1",children:["Ciclos completados: ",a]})]}),s&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Tiempo hasta cambio de reanimador"}),e.jsx("span",{className:"font-bold text-foreground",children:g(v)})]}),e.jsx("div",{className:"w-full bg-muted rounded-full h-3 overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all duration-1000",style:{width:`${f}%`}})}),v<=10&&v>0&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-high))]/10 border border-[hsl(var(--emergency-high))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h5 text-[hsl(var(--emergency-high))]"}),e.jsxs("p",{className:"text-sm text-[hsl(var(--emergency-high))] font-semibold",children:["¡Cambio de reanimador en ",v," segundos!"]})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[s?e.jsxs(Y,{onClick:c,variant:"outline",className:"flex-1",children:[e.jsx(Ie,{className:"w-4 h-4 mr-2"}),"Pausar"]}):e.jsxs(Y,{onClick:p,className:"flex-1 bg-primary text-primary-foreground",children:[e.jsx(Ee,{className:"w-4 h-4 mr-2"}),"Iniciar"]}),e.jsxs(Y,{onClick:h,variant:"outline",className:"flex-1",children:[e.jsx(Te,{className:"w-4 h-4 mr-2"}),"Reiniciar"]})]}),e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"Uso:"})," Iniciar cuando comience RCP. El temporizador alertará cada 2 minutos para cambio de reanimador. Pausar durante desfibrilación si es necesario."]})})]})]})},te=[{id:"d",name:"D (340L)",capacity:340,pressure:2e3,factor:.16},{id:"e",name:"E (680L)",capacity:680,pressure:2e3,factor:.28},{id:"m",name:"M (3450L)",capacity:3450,pressure:2e3,factor:1.56},{id:"g",name:"G (6800L)",capacity:6800,pressure:2e3,factor:3.14},{id:"h",name:"H (6900L)",capacity:6900,pressure:2200,factor:3.14}],cs=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),[a,i]=m.useState(""),n=te.find(g=>g.id===s),d=parseFloat(r)||0,u=parseFloat(a)||0,x=n&&d>0&&d<=n.pressure&&u>0&&u<=15,p=x?(()=>{if(!n||!x)return 0;const g=d/n.pressure;return n.capacity*g/u})():0,c=Math.floor(p/60),h=Math.floor(p%60);return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"💨 Calculadora de Duración de Botella de Oxígeno"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Fórmula:"}),e.jsx("p",{children:"Tiempo = (Presión actual / Presión llena) × Capacidad (L) / Flujo (L/min)"}),e.jsx("p",{className:"mt-2 text-xs",children:"Presión estándar: 2000 PSI (botellas D, E, M, G) o 2200 PSI (botella H)"})]})]})}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"bottle",className:"text-sm font-semibold text-foreground mb-2 block",children:"Tamaño de Botella"}),e.jsxs(z,{value:s,onValueChange:t,children:[e.jsx(I,{id:"bottle",className:"w-full",children:e.jsx(V,{placeholder:"Selecciona el tamaño de botella"})}),e.jsx(T,{children:te.map(g=>e.jsxs(C,{value:g.id,children:[g.name," - ",g.capacity,"L @ ",g.pressure," PSI"]},g.id))})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"pressure",className:"text-sm font-semibold text-foreground mb-2 block",children:"Presión Actual (PSI)"}),e.jsx(j,{id:"pressure",type:"number",inputMode:"decimal",placeholder:`Ej: ${n?n.pressure:"2000"}`,value:r,onChange:g=>o(g.target.value),className:"w-full",min:"0",max:n?n.pressure:2200,step:"50"}),n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Presión máxima: ",n.pressure," PSI"]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"flow",className:"text-sm font-semibold text-foreground mb-2 block",children:"Flujo de Oxígeno (L/min)"}),e.jsx(j,{id:"flow",type:"number",inputMode:"decimal",placeholder:"Ej: 10",value:a,onChange:g=>i(g.target.value),className:"w-full",min:"0",max:"15",step:"0.5"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rango típico: 1-15 L/min"})]}),x&&p>0&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Duración Estimada"}),e.jsxs("p",{className:"text-4xl font-bold text-foreground mb-2",children:[c>0&&`${c}h `,h," min"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["≈ ",p.toFixed(1)," minutos totales"]})]}),p<30&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-high))]/10 border border-[hsl(var(--emergency-high))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-high))]"}),e.jsx("p",{className:"text-sm text-[hsl(var(--emergency-high))] font-semibold",children:"⚠️ Botella con poca duración. Considerar cambio o reducir flujo si es posible."})]})}),e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"Nota:"})," Este cálculo es una estimación. La duración real puede variar según temperatura, uso intermitente y otros factores. Verificar presión periódicamente durante el uso."]})})]}),!x&&(s||r||a)&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, completa todos los campos con valores válidos"})})]})]})},ds=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),[a,i]=m.useState("20"),[n,d]=m.useState("drops"),u=parseFloat(s)||0,x=parseFloat(r)||0,l=parseFloat(a)||20,p=u>0&&x>0&&l>0,c=()=>{if(!p)return 0;const v=x;return u*l/v},h=()=>{if(!p)return 0;const v=x/60;return u/v},g=p?c():0,k=p?h():0;return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"💉 Calculadora de Goteo"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Fórmulas:"}),e.jsxs("p",{children:[e.jsx("strong",{children:"Gotas/min:"})," (Volumen × Factor goteo) / Tiempo (min)"]}),e.jsxs("p",{children:[e.jsx("strong",{children:"ml/h:"})," Volumen / Tiempo (h)"]}),e.jsx("p",{className:"mt-2 text-xs",children:"Factor goteo: 20 gotas/ml (macrogoteo) o 60 gotas/ml (microgoteo)"})]})]})}),e.jsxs("div",{children:[e.jsx(b,{className:"text-sm font-semibold text-foreground mb-2 block",children:"Tipo de Cálculo"}),e.jsxs(z,{value:n,onValueChange:v=>d(v),children:[e.jsx(I,{className:"w-full",children:e.jsx(V,{})}),e.jsxs(T,{children:[e.jsx(C,{value:"drops",children:"Gotas por minuto"}),e.jsx(C,{value:"mlh",children:"Mililitros por hora"})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"volume",className:"text-sm font-semibold text-foreground mb-2 block",children:"Volumen Total (ml)"}),e.jsx(j,{id:"volume",type:"number",inputMode:"decimal",placeholder:"Ej: 500",value:s,onChange:v=>t(v.target.value),className:"w-full",min:"0",step:"1"})]}),e.jsxs("div",{children:[e.jsxs(b,{htmlFor:"time",className:"text-sm font-semibold text-foreground mb-2 block",children:["Tiempo de Infusión (","minutos",")"]}),e.jsx(j,{id:"time",type:"number",inputMode:"decimal",placeholder:"Ej: 60",value:r,onChange:v=>o(v.target.value),className:"w-full",min:"0",step:"1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n==="drops"?"Tiempo total en minutos para administrar el volumen":"Tiempo total en minutos (se convertirá a horas)"})]}),n==="drops"&&e.jsxs("div",{children:[e.jsx(b,{htmlFor:"factor",className:"text-sm font-semibold text-foreground mb-2 block",children:"Factor de Goteo (gotas/ml)"}),e.jsxs(z,{value:a,onValueChange:i,children:[e.jsx(I,{id:"factor",className:"w-full",children:e.jsx(V,{})}),e.jsxs(T,{children:[e.jsx(C,{value:"20",children:"20 gotas/ml (Macrogoteo)"}),e.jsx(C,{value:"60",children:"60 gotas/ml (Microgoteo)"}),e.jsx(C,{value:"15",children:"15 gotas/ml (Algunos sistemas)"})]})]})]}),p&&e.jsxs("div",{className:"mt-6 space-y-4",children:[n==="drops"?e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Velocidad de Goteo"}),e.jsxs("p",{className:"text-4xl font-bold text-foreground mb-2",children:[Math.round(g)," gotas/min"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Equivalente: ",k.toFixed(1)," ml/h"]})]}):e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Velocidad de Infusión"}),e.jsxs("p",{className:"text-4xl font-bold text-foreground mb-2",children:[k.toFixed(1)," ml/h"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Con factor ",l," gotas/ml: ",Math.round(k*l/60)," gotas/min"]})]}),e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"Cálculo:"})," ",u," ml ÷ ",x," min = ",k.toFixed(2)," ml/h",n==="drops"&&` × ${l} gotas/ml = ${Math.round(g)} gotas/min`]})})]}),!p&&(s||r)&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, completa todos los campos con valores válidos"})})]})]})},ms=(s,t)=>Math.sqrt(s*t/3600),us=(s,t)=>.007184*Math.pow(s,.725)*Math.pow(t,.425),xs=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),[a,i]=m.useState("mosteller"),n=parseFloat(s)||0,d=parseFloat(r)||0,u=n>0&&d>0&&n<=250&&d<=300,x=u?ms(n,d):0,l=u?us(n,d):0,p=a==="mosteller"?x:l;return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"📐 Calculadora de Superficie Corporal (SC)"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Fórmulas:"}),e.jsxs("p",{children:[e.jsx("strong",{children:"Mosteller:"})," SC = √[(altura (cm) × peso (kg)) / 3600]"]}),e.jsxs("p",{children:[e.jsx("strong",{children:"DuBois:"})," SC = 0.007184 × altura (cm)^0.725 × peso (kg)^0.425"]}),e.jsx("p",{className:"mt-2 text-xs",children:"La fórmula de Mosteller es más común y fácil de calcular."})]})]})}),e.jsxs("div",{children:[e.jsx(b,{className:"text-sm font-semibold text-foreground mb-2 block",children:"Fórmula a Utilizar"}),e.jsxs(z,{value:a,onValueChange:c=>i(c),children:[e.jsx(I,{className:"w-full",children:e.jsx(V,{})}),e.jsxs(T,{children:[e.jsx(C,{value:"mosteller",children:"Mosteller (Recomendada)"}),e.jsx(C,{value:"dubois",children:"DuBois"})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"height",className:"text-sm font-semibold text-foreground mb-2 block",children:"Altura (cm)"}),e.jsx(j,{id:"height",type:"number",inputMode:"decimal",placeholder:"Ej: 170",value:s,onChange:c=>t(c.target.value),className:"w-full",min:"0",max:"250",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rango típico: 50-250 cm"})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"weight",className:"text-sm font-semibold text-foreground mb-2 block",children:"Peso (kg)"}),e.jsx(j,{id:"weight",type:"number",inputMode:"decimal",placeholder:"Ej: 70",value:r,onChange:c=>o(c.target.value),className:"w-full",min:"0",max:"300",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rango típico: 3-300 kg"})]}),u&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Superficie Corporal"}),e.jsxs("p",{className:"text-4xl font-bold text-foreground mb-2",children:[p.toFixed(2)," m²"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Fórmula: ",a==="mosteller"?"Mosteller":"DuBois"]})]}),a==="mosteller"&&e.jsx("div",{className:"p-3 bg-muted/50 border border-border rounded-lg",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"DuBois:"})," ",l.toFixed(2)," m²",Math.abs(x-l)>.1&&e.jsxs("span",{className:"text-[hsl(var(--emergency-medium))] ml-2",children:["(Diferencia: ",Math.abs(x-l).toFixed(2)," m²)"]})]})}),a==="dubois"&&e.jsx("div",{className:"p-3 bg-muted/50 border border-border rounded-lg",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"Mosteller:"})," ",x.toFixed(2)," m²",Math.abs(x-l)>.1&&e.jsxs("span",{className:"text-[hsl(var(--emergency-medium))] ml-2",children:["(Diferencia: ",Math.abs(x-l).toFixed(2)," m²)"]})]})}),e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"Uso clínico:"})," La superficie corporal se utiliza para dosificación de fármacos quimioterápicos, ajuste de dosis en pediatría y cálculo de requerimientos calóricos."]})})]}),!u&&(s||r)&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, completa todos los campos con valores válidos"})})]})]})},gs=(s,t)=>{const r=t/100,o=s/(r*r);let a,i;return o<18.5?(a="Bajo peso",i="info"):o<25?(a="Peso normal",i="success"):o<30?(a="Sobrepeso",i="warning"):o<35?(a="Obesidad grado I",i="high"):o<40?(a="Obesidad grado II",i="high"):(a="Obesidad grado III (mórbida)",i="critical"),{bmi:o,category:a,color:i}},ps=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),a=parseFloat(s)||0,i=parseFloat(r)||0,n=a>0&&i>0&&a<=250&&i<=300,d=n?gs(i,a):null;return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"🧮 Calculadora de Índice de Masa Corporal (IMC)"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Fórmula:"}),e.jsx("p",{children:"IMC = peso (kg) / altura (m)²"}),e.jsx("p",{className:"mt-2 text-xs",children:"El IMC es un indicador útil pero no debe ser el único criterio para evaluar el estado nutricional."})]})]})}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"height",className:"text-sm font-semibold text-foreground mb-2 block",children:"Altura (cm)"}),e.jsx(j,{id:"height",type:"number",inputMode:"decimal",placeholder:"Ej: 170",value:s,onChange:u=>t(u.target.value),className:"w-full",min:"0",max:"250",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rango típico: 50-250 cm"})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"weight",className:"text-sm font-semibold text-foreground mb-2 block",children:"Peso (kg)"}),e.jsx(j,{id:"weight",type:"number",inputMode:"decimal",placeholder:"Ej: 70",value:r,onChange:u=>o(u.target.value),className:"w-full",min:"0",max:"300",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rango típico: 3-300 kg"})]}),d&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Índice de Masa Corporal"}),e.jsx("p",{className:"text-4xl font-bold text-foreground mb-2",children:d.bmi.toFixed(1)}),e.jsx(E,{variant:d.color,className:"text-sm px-3 py-1",children:d.category})]}),e.jsxs("div",{className:"p-3 bg-muted/50 border border-border rounded-lg",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-2",children:"Clasificación IMC (OMS):"}),e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"< 18.5"}),e.jsx("span",{children:"Bajo peso"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"18.5 - 24.9"}),e.jsx("span",{children:"Peso normal"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"25.0 - 29.9"}),e.jsx("span",{children:"Sobrepeso"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"30.0 - 34.9"}),e.jsx("span",{children:"Obesidad grado I"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"35.0 - 39.9"}),e.jsx("span",{children:"Obesidad grado II"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"≥ 40.0"}),e.jsx("span",{children:"Obesidad grado III"})]})]})]}),d.bmi>=30&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-high))]/10 border border-[hsl(var(--emergency-high))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-high))]"}),e.jsx("p",{className:"text-sm text-[hsl(var(--emergency-high))] font-semibold",children:"⚠️ Obesidad: Considerar factores de riesgo cardiovascular y metabólicos adicionales."})]})}),d.bmi<18.5&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-medium))]"}),e.jsx("p",{className:"text-sm text-[hsl(var(--emergency-medium))] font-semibold",children:"⚠️ Bajo peso: Evaluar estado nutricional y posibles causas."})]})}),e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("strong",{children:"Limitaciones del IMC:"})," No tiene en cuenta masa muscular, distribución de grasa, edad, sexo ni composición corporal. En pacientes con mucho músculo o edemas puede ser menos preciso."]})})]}),!n&&(s||r)&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, completa todos los campos con valores válidos"})})]})]})},B=[{name:"Pediátrico",description:"Lactantes y niños pequeños",chinToSternumRange:{min:0,max:8},ageRange:"0-3 años",color:"info"},{name:"Pequeño",description:"Niños y adolescentes",chinToSternumRange:{min:8,max:12},ageRange:"4-12 años",color:"info"},{name:"Mediano",description:"Adultos de tamaño promedio",chinToSternumRange:{min:12,max:16},ageRange:"Adultos",color:"default"},{name:"Grande",description:"Adultos de gran tamaño",chinToSternumRange:{min:16,max:25},ageRange:"Adultos grandes",color:"default"}],hs=()=>{const[s,t]=m.useState(""),[r,o]=m.useState(""),[a,i]=m.useState(""),n=parseFloat(s)||0,d=n>0&&n<=30,x=(()=>{if(!d)return null;for(const l of B)if(n>=l.chinToSternumRange.min&&n<=l.chinToSternumRange.max)return l;return n<8?B[0]:n>16?B[3]:B[2]})();return e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-4",children:"📏 Calculadora de Talla de Collarín Cervical"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"p-3 bg-muted/50 rounded-lg border border-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Método de medición:"}),e.jsx("p",{children:"Mide la distancia desde el ángulo de la mandíbula (punto superior) hasta el hombro/trapecio (punto inferior)."}),e.jsxs("p",{className:"mt-2 text-xs",children:[e.jsx("strong",{children:"Importante:"})," El collarín debe quedar ajustado pero no comprimir la vía aérea."]})]})]})}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"distance",className:"text-sm font-semibold text-foreground mb-2 block",children:"Distancia Mentón-Esternón (cm)"}),e.jsx(j,{id:"distance",type:"number",inputMode:"decimal",placeholder:"Ej: 14",value:s,onChange:l=>t(l.target.value),className:"w-full",min:"0",max:"30",step:"0.1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Medir desde el ángulo de la mandíbula hasta el hombro/trapecio"})]}),e.jsxs("div",{children:[e.jsxs(b,{htmlFor:"height",className:"text-sm font-semibold text-foreground mb-2 block",children:["Altura del Paciente (cm) ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(Opcional)"})]}),e.jsx(j,{id:"height",type:"number",inputMode:"decimal",placeholder:"Ej: 170",value:r,onChange:l=>o(l.target.value),className:"w-full",min:"0",max:"250",step:"0.1"})]}),e.jsxs("div",{children:[e.jsxs(b,{htmlFor:"age",className:"text-sm font-semibold text-foreground mb-2 block",children:["Edad Aproximada (años) ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(Opcional)"})]}),e.jsx(j,{id:"age",type:"number",inputMode:"decimal",placeholder:"Ej: 35",value:a,onChange:l=>i(l.target.value),className:"w-full",min:"0",max:"120",step:"1"})]}),x&&e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 bg-card border-2 border-primary rounded-xl text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm mb-1",children:"Talla Recomendada"}),e.jsx("p",{className:"text-3xl font-bold text-foreground mb-2",children:x.name}),e.jsx(E,{variant:x.color,className:"text-sm px-3 py-1",children:x.description})]}),e.jsxs("div",{className:"p-3 bg-muted/50 border border-border rounded-lg",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-2",children:"Rangos de Tallas:"}),e.jsx("div",{className:"space-y-2",children:B.map(l=>e.jsx("div",{className:`p-2 rounded border ${l.name===x.name?"bg-primary/10 border-primary":"bg-background border-border"}`,children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:l.name}),l.ageRange&&e.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["(",l.ageRange,")"]})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[l.chinToSternumRange.min,"-",l.chinToSternumRange.max," cm"]})]})},l.name))})]}),n<8&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-medium))]"}),e.jsx("p",{className:"text-sm text-[hsl(var(--emergency-medium))] font-semibold",children:"⚠️ Distancia muy pequeña. Verificar medición y considerar collarín pediátrico."})]})}),n>20&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5 text-[hsl(var(--emergency-medium))]"}),e.jsx("p",{className:"text-sm text-[hsl(var(--emergency-medium))] font-semibold",children:"⚠️ Distancia muy grande. Verificar medición y considerar collarín extra grande si está disponible."})]})}),e.jsxs("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border-l-4 border-[hsl(var(--emergency-medium))] rounded-r-lg",children:[e.jsx("p",{className:"text-xs text-foreground font-semibold mb-1",children:"⚠️ Verificaciones importantes:"}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"El collarín debe quedar ajustado pero sin comprimir la vía aérea"}),e.jsx("li",{children:"Collarín demasiado grande → hiperextensión cervical"}),e.jsx("li",{children:"Collarín pequeño → flexión cervical"}),e.jsx("li",{children:"El collarín es parte de un sistema completo de inmovilización"}),e.jsx("li",{children:"Mantener control manual durante la colocación"})]})]})]}),!d&&s&&e.jsx("div",{className:"p-3 bg-[hsl(var(--emergency-medium))]/10 border border-[hsl(var(--emergency-medium))]/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, ingresa una distancia válida (0-30 cm)"})})]})]})},bs=({table:s})=>e.jsxs("div",{className:"card-procedure",children:[e.jsx("h3",{className:"font-bold text-foreground text-lg mb-2",children:s.name}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.preparation}),e.jsx("div",{className:"overflow-x-auto -mx-4 px-4",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-3 px-2 font-semibold text-muted-foreground",children:"Peso (kg)"}),s.columns.map(t=>e.jsx("th",{className:"text-center py-3 px-2 font-semibold text-muted-foreground",children:t},t))]})}),e.jsx("tbody",{children:s.rows.map(t=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-3 px-2 font-bold text-foreground",children:t.weight}),s.columns.map(r=>e.jsxs("td",{className:"text-center py-3 px-2 text-foreground",children:[t.doses[r]," ",s.unit]},r))]},t.weight))})]})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-4 text-center",children:["Rango de dosis: ",s.doseRange]})]}),R={objective:"Proporcionar los conocimientos anatómicos y la terminología esencial para que el TES pueda realizar una valoración precisa, comunicarse efectivamente con el equipo y otros profesionales sanitarios, y fundamentar técnicamente todas las maniobras de movilización, inmovilización y manejo de material.",principles:["El conocimiento anatómico es la base del razonamiento clínico operativo y la seguridad del paciente","El uso de terminología precisa y estandarizada elimina ambigüedades y errores en la comunicación, especialmente con coordinación médica y personal de urgencias hospitalarias",'"Ver, palpar, localizar": La anatomía de superficie es tu herramienta para evaluar sin equipos complejos',"Toda maniobra de inmovilización o movilización debe respetar y proteger la integridad anatómica"],directionalTerms:[{id:"anterior",term:"Anterior / Ventral",definition:"Hacia la parte delantera del cuerpo",example:"Herida incisa en región anterior del muslo",category:"direccion",critical:!0},{id:"posterior",term:"Posterior / Dorsal",definition:"Hacia la parte trasera del cuerpo",example:"Hematoma en región posterior del tórax",category:"direccion",critical:!0},{id:"superior",term:"Superior / Craneal / Cefálico",definition:"Hacia la cabeza",example:"El dolor se irradia en dirección craneal",category:"direccion"},{id:"inferior",term:"Inferior / Caudal",definition:"Hacia los pies",example:"Edema en extremidad inferior izquierda",category:"direccion"},{id:"medial",term:"Medial",definition:"Hacia la línea media del cuerpo",example:"Pulso medial al tendón de Aquiles (tibial posterior)",category:"direccion",critical:!0},{id:"lateral",term:"Lateral",definition:"Alejado de la línea media del cuerpo",example:"Deformidad lateral en tercio medio de clavícula",category:"direccion",critical:!0},{id:"proximal",term:"Proximal",definition:"Más cerca del punto de unión con el tronco",example:"Fractura en el tercio proximal del húmero",category:"direccion",critical:!0},{id:"distal",term:"Distal",definition:"Más lejos del punto de unión con el tronco",example:"Cuerpo extraño en falange distal",category:"direccion",critical:!0},{id:"supino",term:"Supino",definition:"Posición del paciente: acostado sobre su espalda, cara hacia arriba",example:"Colocar al paciente supino para valoración ABC",category:"posiciones",critical:!0},{id:"prono",term:"Prono",definition:"Posición del paciente: acostado sobre su estómago",example:"Encontrar al paciente prono. Realizar giro en bloque",category:"posiciones",critical:!0}],positions:[{id:"fowler",name:"Posición de Fowler",description:"Paciente semisentado",indication:"Paciente consciente con disnea, para facilitar la respiración"},{id:"trendelenburg",name:"Trendelenburg",description:"Paciente supino con la cabeza por debajo del plano de los pies",indication:"Uso en controversia. Históricamente para shock, actualmente se desaconseja salvo indicación específica"},{id:"antishock",name:"Antishock (Trendelenburg Modificada)",description:"Paciente supino con las extremidades inferiores elevadas 15-30º",indication:"Valoración y manejo inicial del shock (sin trauma craneal/RA medular)"},{id:"decubito_lateral",name:"Decúbito Lateral (PLS)",description:"De lado, con vía aérea protegida",indication:"Paciente inconsciente con respiración espontánea"}],landmarks:[{id:"mastoides",name:"Apófisis mastoides",location:"Prominencia ósea detrás de la oreja",purpose:"Referencia para colocación de collarín, evitar compresión durante inmovilización",region:"cabeza_cuello"},{id:"angulo_mandibular",name:"Ángulo mandibular",location:"Punto donde la mandíbula forma un ángulo hacia atrás",purpose:"Punto de referencia superior para medir talla de collarín cervical",region:"cabeza_cuello"},{id:"clavicula",name:"Clavícula",location:"Hueso horizontal en la parte superior del tórax, entre esternón y hombro",purpose:"Referencia para colocación de collarín (parte inferior)",region:"cabeza_cuello"},{id:"espina_escapula",name:"Espina de la escápula",location:"Proyección ósea posterior del omóplato",purpose:"Referencia para inmovilización de hombro, punto de apoyo",region:"cabeza_cuello"},{id:"escotadura_supraesternal",name:"Escotadura supraesternal",location:"Depresión superior del esternón",purpose:"Referencia para evaluación de vía aérea, referencia anatómica",region:"torax"},{id:"angulo_louis",name:"Ángulo de Louis (2ª costilla)",location:"Unión del manubrio y cuerpo del esternón",purpose:"Referencia para localización de espacios intercostales, colocación de electrodos",region:"torax"},{id:"apendice_xifoides",name:"Apéndice xifoides",location:"Extremo inferior del esternón",purpose:"Referencia para compresiones torácicas, límite superior del abdomen",region:"torax"},{id:"borde_costal",name:"Borde costal",location:"Borde inferior de las costillas",purpose:"Referencia para evaluación abdominal, límites anatómicos",region:"torax"},{id:"cresta_iliaca",name:"Cresta ilíaca",location:"Borde superior del hueso ilíaco, palpable en la cintura",purpose:"Referencia para colocación de cinturón pélvico, referencia para inmovilización pélvica",region:"pelvis"},{id:"eias",name:"Espina ilíaca anterosuperior (EIAS)",location:"Proyección anterior de la cresta ilíaca",purpose:"Referencia anatómica para evaluaciones y procedimientos pélvicos",region:"pelvis"},{id:"sinfisis_pubis",name:"Sínfisis del pubis",location:"Unión anterior de los huesos pélvicos",purpose:"Referencia para evaluación pélvica, límite anterior de la pelvis",region:"pelvis"},{id:"tuberculo_mayor",name:"Tubérculo del mayor (húmero)",location:"Prominencia ósea en la parte superior del húmero",purpose:"Referencia para inmovilización de brazo, puntos de referencia",region:"extremidades"},{id:"epicondilos",name:"Epicóndilos",location:"Prominencias óseas en la parte inferior del húmero, en el codo",purpose:"Referencia para inmovilización de codo, puntos de presión que requieren acolchado",region:"extremidades"},{id:"cabeza_perone",name:"Cabeza del peroné",location:"Extremo superior del peroné, lateral a la rodilla",purpose:"Referencia para inmovilización de rodilla, punto de riesgo del nervio peroneo",region:"extremidades"},{id:"maleolos",name:"Maléolos (tobillo)",location:"Prominencias óseas medial y lateral del tobillo",purpose:"Referencia para inmovilización de tobillo, pulso tibial posterior (detrás del maléolo medial)",region:"extremidades"}],applicationSteps:[{id:"observacion",step:1,title:"Observación Global",instruction:'Antes de tocar, observar la postura antálgica, deformidades evidentes, asimetrías. Pensar: "¿Qué estructura interna puede estar lesionada?"',critical:!0},{id:"comunicacion",step:2,title:"Comunicación Inicial",instruction:'Usar términos anatómicos correctos desde el primer mensaje a coordinación: "Hombre 40 años, supino en calzada. Deformidad evidente en tercio distal de tibia derecha, actitud antálgica"',critical:!0},{id:"palpacion_circulacion",step:3,title:"Palpación Sistemática - Circulación",instruction:'Durante la "C" (Circulación): Palpar el pulso femoral (ingle), pedio (empeine) y tibial posterior (detrás del maléolo medial). Conocer su ubicación exacta',critical:!0},{id:"palpacion_neurologico",step:4,title:"Palpación Sistemática - Neurológico",instruction:'Durante la "D" (Discapacidad - Neurológico): Evaluar sensibilidad y movimiento en dermatomas y miótomos clave. Decir "Mueva los dedos de los pies" (no "mueva lo de abajo")',critical:!0},{id:"palpacion_exposicion",step:5,title:"Palpación Sistemática - Exposición",instruction:"Durante la Exposición: Palpar la columna vertebral, las crestas ilíacas y todas las extremidades buscando puntos dolorosos, crepitación o inestabilidad",critical:!0},{id:"descripcion",step:6,title:"Descripción Precisa de Lesiones",instruction:'Utilizar la terminología para ser inequívoco: "Herida punzante de 3 cm, longitudinal, en borde medial del antebrazo derecho, 10 cm distal al pliegue del codo". Evitar "herida en el brazo"',critical:!0},{id:"decisiones",step:7,title:"Toma de Decisiones de Inmovilización",instruction:"Basarse en la anatomía: El collarín cervical se ajusta desde la base del mentón hasta la parte superior del tórax. El cinturón pélvico es a nivel de los trocánteres mayores. Las férulas deben inmovilizar la articulación proximal y distal a la fractura",critical:!0},{id:"documentacion",step:8,title:"Documentación",instruction:"Registrar en la Hoja de Intervención utilizando la nomenclatura correcta. Es la base legal y clínica de la actuación",critical:!0}],criticalErrors:['Utilizar términos coloquiales o imprecisos ("hueso de la risa", "corva") en la comunicación profesional',"No palpar puntos de referencia óseos clave antes de aplicar un dispositivo de inmovilización, llevando a una colocación incorrecta e inefectiva",'Confundir "proximal" con "distal" en la descripción de una lesión o al dar una orden. Puede conducir a un tratamiento erróneo','Describir una lesión en referencia a un objeto externo ("herida cerca de la puerta") en lugar de usar referencias anatómicas del propio paciente',"No considerar la anatomía tridimensional. Una herida de entrada anterior en el tórax puede tener una trayectoria con salida posterior"],keyPoints:["Habla anatómicamente, comunica con precisión. Tu lenguaje define tu profesionalidad",'"Proximal y distal" son tus palabras clave en trauma osteoarticular. Úsalas siempre',"La palpación es tu TAC portátil. Entrénate para identificar estructuras bajo la piel","Un gráfico mental del cuerpo te guía en la exploración. No explores al azar; sigue un orden lógico (cabeza-pies, anterior-posterior)","La documentación anatómica correcta protege al paciente y al TES. Es tu mejor respaldo","Repasa mentalmente la anatomía subyacente en cada procedimiento. Al colocar una férula de tracción, piensa en el trayecto del nervio ciático. Al mover un paciente, piensa en la integridad de su columna"]},fs=({onClose:s})=>{const[t,r]=m.useState(""),[o,a]=m.useState("todos"),[i,n]=m.useState(new Set(["principles"])),d=c=>{const h=new Set(i);h.has(c)?h.delete(c):h.add(c),n(h)},u=m.useMemo(()=>o==="posiciones"?[]:o==="landmarks"?[]:o==="todos"?R.directionalTerms:R.directionalTerms.filter(c=>c.category===o),[o]),x=m.useMemo(()=>{if(!t.trim())return u;const c=t.toLowerCase();return u.filter(h=>h.term.toLowerCase().includes(c)||h.definition.toLowerCase().includes(c)||h.example&&h.example.toLowerCase().includes(c))},[u,t]),l=[{id:"todos",label:"Todos"},{id:"direccion",label:"Dirección"},{id:"posiciones",label:"Posiciones"},{id:"landmarks",label:"Puntos de Referencia"}],p={cabeza_cuello:"Cabeza y Cuello",torax:"Tórax",pelvis:"Pelvis",extremidades:"Extremidades"};return e.jsxs(F,{className:"p-6 bg-blue-50 border-blue-200",children:[s&&e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(he,{className:"w-6 h-6 text-blue-900"}),e.jsx("h2",{className:"text-xl font-bold text-blue-900",children:"Anatomía Operativa"})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Z,{className:"bg-blue-100 border-blue-300",children:e.jsxs(X,{className:"text-blue-900",children:[e.jsx("strong",{children:"Objetivo:"})," ",R.objective]})}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>d("principles"),className:"w-full flex items-center justify-between text-left mb-2",children:[e.jsx("h3",{className:"font-bold text-lg text-blue-900",children:"Principios TES"}),i.has("principles")?e.jsx(G,{className:"w-5 h-5 text-blue-700"}):e.jsx(q,{className:"w-5 h-5 text-blue-700"})]}),i.has("principles")&&e.jsx("ul",{className:"space-y-2 mt-3 pl-4",children:R.principles.map((c,h)=>e.jsxs("li",{className:"text-blue-900 text-sm flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 font-bold",children:"•"}),e.jsx("span",{children:c})]},h))})]}),e.jsx("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide -mx-4 px-4 pb-2",children:l.map(c=>e.jsx("button",{onClick:()=>a(c.id),className:`px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-colors ${o===c.id?"bg-blue-600 text-white":"bg-white text-blue-900 hover:bg-blue-100"}`,children:c.label},c.id))}),(o==="todos"||o==="direccion")&&e.jsxs("div",{className:"relative",children:[e.jsx(Ae,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),e.jsx(j,{type:"text",placeholder:"Buscar término anatómico...",value:t,onChange:c=>r(c.target.value),className:"pl-10 bg-white"})]}),o==="posiciones"&&e.jsx("div",{className:"space-y-3",children:R.positions.map(c=>e.jsxs(F,{className:"p-4 bg-white",children:[e.jsx("h4",{className:"font-semibold text-gray-900 mb-2",children:c.name}),e.jsx("p",{className:"text-sm text-gray-700 mb-2",children:c.description}),e.jsx("div",{className:"mt-2 p-2 bg-blue-50 rounded border-l-4 border-blue-400",children:e.jsxs("p",{className:"text-xs text-blue-900",children:[e.jsx("strong",{children:"Indicación:"})," ",c.indication]})})]},c.id))}),o==="landmarks"&&e.jsx("div",{className:"space-y-4",children:["cabeza_cuello","torax","pelvis","extremidades"].map(c=>{const h=R.landmarks.filter(g=>g.region===c);return h.length===0?null:e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(De,{className:"w-5 h-5 text-blue-600"}),p[c]]}),e.jsx("div",{className:"space-y-2",children:h.map(g=>e.jsxs(F,{className:"p-4 bg-white",children:[e.jsx("h5",{className:"font-semibold text-gray-900 mb-1",children:g.name}),e.jsxs("p",{className:"text-sm text-gray-600 mb-1",children:[e.jsx("strong",{children:"Localización:"})," ",g.location]}),e.jsx("p",{className:"text-sm text-gray-700",children:g.purpose})]},g.id))})]},c)})}),(o==="todos"||o==="direccion")&&e.jsx("div",{className:"space-y-2",children:x.length===0?e.jsx("p",{className:"text-center text-gray-500 py-4",children:"No se encontraron términos"}):x.map(c=>e.jsx(F,{className:`p-4 ${c.critical?"bg-red-50 border-red-200":"bg-white"}`,children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(E,{variant:c.critical?"destructive":"outline",className:"font-semibold",children:c.term}),c.critical&&e.jsx(E,{variant:"destructive",className:"text-xs",children:"Crítico"})]}),e.jsx("p",{className:"text-sm text-gray-700 mb-2",children:c.definition}),c.example&&e.jsx("div",{className:"mt-2 p-2 bg-gray-50 rounded border-l-2 border-gray-300",children:e.jsxs("p",{className:"text-xs text-gray-600",children:[e.jsx("strong",{children:"Ejemplo:"}),' "',c.example,'"']})})]})})},c.id))}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>d("application"),className:"w-full flex items-center justify-between text-left mb-2",children:[e.jsx("h3",{className:"font-bold text-lg text-blue-900",children:"Aplicación en Escena (Paso a Paso)"}),i.has("application")?e.jsx(G,{className:"w-5 h-5 text-blue-700"}):e.jsx(q,{className:"w-5 h-5 text-blue-700"})]}),i.has("application")&&e.jsx("div",{className:"space-y-3 mt-3",children:R.applicationSteps.map(c=>e.jsx(F,{className:`p-4 ${c.critical?"bg-yellow-50 border-yellow-300":"bg-white"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(E,{className:`${c.critical?"bg-yellow-600":"bg-blue-600"} text-white`,children:c.step}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-semibold text-gray-900 mb-1",children:c.title}),e.jsx("p",{className:"text-sm text-gray-700",children:c.instruction})]})]})},c.id))})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>d("errors"),className:"w-full flex items-center justify-between text-left mb-2",children:[e.jsxs("h3",{className:"font-semibold text-red-900 flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5"}),"Errores Críticos a Evitar"]}),i.has("errors")?e.jsx(G,{className:"w-5 h-5 text-red-700"}):e.jsx(q,{className:"w-5 h-5 text-red-700"})]}),i.has("errors")&&e.jsx("ul",{className:"space-y-2 mt-3",children:R.criticalErrors.map((c,h)=>e.jsx("li",{className:"p-3 bg-red-50 rounded-lg border-l-4 border-red-500 text-red-900 text-sm",children:c},h))})]}),e.jsx(Z,{className:"bg-green-50 border-green-400",children:e.jsxs(X,{children:[e.jsx("strong",{className:"text-green-900",children:"Puntos Clave TES"}),e.jsx("ul",{className:"list-disc list-inside mt-2 text-green-800 space-y-1",children:R.keyPoints.map((c,h)=>e.jsx("li",{className:"text-sm",children:c},h))})]})})]})]})},js=be("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ie({className:s,variant:t,...r}){return e.jsx("div",{className:P(js({variant:t}),s),...r})}const J=[{id:"dopamina",name:"Dopamina",doseRange:{min:2,max:20},concentrations:[{label:"Estándar 2000 mcg/ml",value:2e3},{label:"Concentrada 4000 mcg/ml",value:4e3}]},{id:"noradrenalina",name:"Noradrenalina",doseRange:{min:.05,max:1},concentrations:[{label:"Estándar 80 mcg/ml",value:80},{label:"Concentrada 160 mcg/ml",value:160}]},{id:"adrenalina",name:"Adrenalina",doseRange:{min:.05,max:.5},concentrations:[{label:"Estándar 10 mcg/ml",value:10},{label:"Concentrada 20 mcg/ml",value:20}]}],ne=s=>typeof s!="number"?s:Number.isInteger(s)?s.toString():s.toFixed(2),oe={green:"border-emerald-500/40 text-emerald-300 bg-emerald-500/10",amber:"border-amber-500/40 text-amber-300 bg-amber-500/10",red:"border-red-500/40 text-red-300 bg-red-500/10"},vs=()=>{const{state:s,setPatientBasics:t}=Ye(),[r,o]=m.useState("noradrenalina"),[a,i]=m.useState(""),[n,d]=m.useState(""),[u,x]=m.useState(""),l=m.useMemo(()=>J.find(f=>f.id===r)??J[0],[r]);m.useEffect(()=>{s.patient.weight&&n===""&&d(s.patient.weight.toString())},[s.patient.weight,n]),m.useEffect(()=>{!u&&l.concentrations.length>0&&x(l.concentrations[0].value.toString())},[u,l]);const p=Number(n),c=Number(a),h=Number(u),g=m.useMemo(()=>Oe({weightKg:Number.isFinite(p)?p:void 0,doseMcgKgMin:Number.isFinite(c)?c:void 0,concentrationMcgMl:Number.isFinite(h)?h:void 0,doseRange:l.doseRange}),[p,c,h,l]),k=m.useMemo(()=>{const f=typeof g.value=="number"?g.value:void 0;return Be(f)},[g]),v=f=>{d(f);const y=Number(f);Number.isFinite(y)&&t({weight:y})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Z,{children:[e.jsx(Ve,{children:"Modo avanzado"}),e.jsx(X,{children:"Calcula ml/h y gotas/min a partir de peso, dosis y concentración."})]}),e.jsxs(F,{children:[e.jsx(K,{children:e.jsx(W,{className:"text-base",children:"Parámetros"})}),e.jsxs(Q,{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Fármaco"}),e.jsxs(z,{value:r,onValueChange:f=>o(f),children:[e.jsx(I,{children:e.jsx(V,{placeholder:"Selecciona fármaco"})}),e.jsx(T,{children:J.map(f=>e.jsx(C,{value:f.id,children:f.name},f.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Peso (kg)"}),e.jsx(j,{type:"number",inputMode:"numeric",value:n,onChange:f=>v(f.target.value),placeholder:"Ej: 70"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Dosis (mcg/kg/min)"}),e.jsx(j,{type:"number",inputMode:"decimal",value:a,onChange:f=>i(f.target.value),placeholder:`Rango ${l.doseRange.min}-${l.doseRange.max}`})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"Concentración"}),e.jsxs(z,{value:u,onValueChange:x,children:[e.jsx(I,{children:e.jsx(V,{placeholder:"Selecciona concentración"})}),e.jsx(T,{children:l.concentrations.map(f=>e.jsx(C,{value:f.value.toString(),children:f.label},f.value))})]})]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(F,{children:[e.jsxs(K,{className:"flex flex-row items-center justify-between space-y-0",children:[e.jsx(W,{className:"text-base",children:"Resultado ml/h"}),e.jsx(ie,{className:`border ${oe[g.severity]}`,children:g.severity.toUpperCase()})]}),e.jsxs(Q,{className:"space-y-2",children:[e.jsxs("div",{className:"text-2xl font-semibold",children:[ne(g.value)," ml/h"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g.interpretation})]})]}),e.jsxs(F,{children:[e.jsxs(K,{className:"flex flex-row items-center justify-between space-y-0",children:[e.jsx(W,{className:"text-base",children:"Goteo"}),e.jsx(ie,{className:`border ${oe[k.severity]}`,children:k.severity.toUpperCase()})]}),e.jsxs(Q,{className:"space-y-2",children:[e.jsxs("div",{className:"text-2xl font-semibold",children:[ne(k.value)," gotas/min"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:k.interpretation})]})]})]})]})},Ns=[{id:"calculadoras",label:"Calculadoras",icon:U},{id:"anatomia",label:"Anatomía",icon:he},{id:"codigos",label:"Códigos",icon:_},{id:"perfusiones",label:"Perfusiones",icon:ze}],ys=[{name:"Código Ictus",description:"Activación ante sospecha de ictus agudo",path:"/ictus",color:"bg-secondary"},{name:"Código IAM",description:"SCACEST - Infarto con elevación ST",path:"/patologias",color:"bg-primary"},{name:"Código Sepsis",description:"Sospecha de sepsis severa / shock séptico",path:"/shock",color:"bg-emergency-high"},{name:"Código Parada",description:"PCR - Parada cardiorrespiratoria",path:"/rcp",color:"bg-primary"}],ks=[{name:"Checklist Sepsis",description:"Sepsis: checklist interactiva con temporizadores",path:"/checklists/sepsis",color:"bg-emergency-high"},{name:"Checklist Ictus",description:"Ictus: checklist interactiva con tiempos clave",path:"/checklists/ictus",color:"bg-secondary"},{name:"Checklist Parada",description:"Parada: checklist interactiva con RCP",path:"/checklists/parada",color:"bg-primary"},{name:"Checklist Parto",description:"Parto inminente: pasos operativos",path:"/checklists/parto",color:"bg-emergency-high"},{name:"Checklist Anafilaxia",description:"Adrenalina IM y soporte vital",path:"/checklists/anafilaxia",color:"bg-emergency-high"},{name:"Checklist Intoxicaciones",description:"ABCDE, antidotos y descontaminacion",path:"/checklists/intoxicaciones",color:"bg-secondary"},{name:"Checklist Convulsiones",description:"Crisis > 5 min: control de tiempos",path:"/checklists/convulsiones",color:"bg-warning"},{name:"Checklist Termicas",description:"Hipo/Hipertermia: manejo inicial",path:"/checklists/termicas",color:"bg-warning"}],ws=[{name:"Pathway Shock Séptico",description:"Flujo guiado para reconocimiento y tratamiento inicial",path:"/pathways/shock-septico",color:"bg-emergency-high"}],Cs=()=>{const[s,t]=m.useState("calculadoras"),[r,o]=m.useState("tabla");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Herramientas"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Calculadoras, tablas y códigos"})]}),e.jsx("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide -mx-4 px-4",children:Ns.map(a=>{const i=a.icon;return e.jsxs("button",{onClick:()=>t(a.id),className:`flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-colors ${s===a.id?"bg-secondary text-secondary-foreground":"bg-muted text-muted-foreground hover:bg-accent"}`,children:[e.jsx(i,{className:"w-4 h-4"}),a.label]},a.id)})}),s==="calculadoras"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(O,{to:"/advanced/vitals",className:"block card-procedure hover:border-primary/50",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-secondary flex items-center justify-center",children:e.jsx(U,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-foreground",children:"Panel de constantes"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Calcula MAP, Shock Index, qSOFA y NEWS2"})]})]})}),e.jsx(O,{to:"/advanced/broselow",className:"block card-procedure hover:border-primary/50",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary flex items-center justify-center",children:e.jsx(U,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-foreground",children:"Pediatría rápida (Broselow)"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Zona, peso estimado y material sugerido"})]})]})}),e.jsx(ss,{}),e.jsx(rs,{}),e.jsx(os,{}),e.jsx(ls,{}),e.jsx(cs,{}),e.jsx(ds,{}),e.jsx(xs,{}),e.jsx(ps,{}),e.jsx(hs,{})]}),s==="perfusiones"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o("tabla"),className:`px-4 py-2 rounded-full text-sm font-medium transition-colors ${r==="tabla"?"bg-secondary text-secondary-foreground":"bg-muted text-muted-foreground hover:bg-accent"}`,children:"Tabla"}),e.jsx("button",{type:"button",onClick:()=>o("avanzado"),className:`px-4 py-2 rounded-full text-sm font-medium transition-colors ${r==="avanzado"?"bg-secondary text-secondary-foreground":"bg-muted text-muted-foreground hover:bg-accent"}`,children:"Modo avanzado"})]}),r==="avanzado"&&Le.smartPerfusions?e.jsx(vs,{}):Xe.map(a=>e.jsx(bs,{table:a},a.id))]}),s==="anatomia"&&e.jsx("div",{className:"space-y-4",children:e.jsx(fs,{})}),s==="codigos"&&e.jsxs("div",{className:"space-y-3",children:[ys.map(a=>e.jsx(O,{to:a.path,className:"block card-procedure hover:border-primary/50",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-lg ${a.color} flex items-center justify-center`,children:e.jsx(_,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-foreground",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:a.description})]})]})},a.name)),ks.map(a=>e.jsx(O,{to:a.path,className:"block card-procedure hover:border-primary/50",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-lg ${a.color} flex items-center justify-center`,children:e.jsx(_,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-foreground",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:a.description})]})]})},a.name)),ws.map(a=>e.jsx(O,{to:a.path,className:"block card-procedure hover:border-primary/50",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-lg ${a.color} flex items-center justify-center`,children:e.jsx(_,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-foreground",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:a.description})]})]})},a.name))]})]})},Ds=Object.freeze(Object.defineProperty({__proto__:null,default:Cs},Symbol.toStringTag,{value:"Module"}));export{ie as B,Ds as H,b as L,As as P,ls as R,Fs as a,Es as b,Is as c,Ts as d,Ye as u};