codigo0/dist/assets/BroselowQuick-Cnc3TNmR.js

2 lines
7.8 KiB
JavaScript
Raw Normal View History

import{r as n,j as e,T as w,a as y}from"./0-vendor-react-DWOJpYrt.js";import{C as u,c as p,d as f,e as j,I as C}from"./page-comunicacion-DmHQUHoW.js";import{L as b,R as K}from"./page-herramientas-DcKR8MlC.js";import{B as m}from"./page-ajustes-DgawOEJM.js";import"./1-vendor-utils-Delnuc0l.js";import"./2-vendor-markdown-BQlHAcA7.js";const N=[{id:"grey",colorName:"Gris",colorHex:"#9CA3AF",lengthMinCm:46,lengthMaxCm:59,weightMinKg:3,weightMaxKg:5,equipment:{ettUncuffed:"3.0",ettCuffed:"3.0",laryngoscopeBlade:"0",suctionCatheter:"6-8 Fr",ivCatheter:"24G"}},{id:"pink",colorName:"Rosa",colorHex:"#F9A8D4",lengthMinCm:60,lengthMaxCm:66,weightMinKg:5,weightMaxKg:6,equipment:{ettUncuffed:"3.5",ettCuffed:"3.0",laryngoscopeBlade:"1",suctionCatheter:"8 Fr",ivCatheter:"24G"}},{id:"red",colorName:"Rojo",colorHex:"#F87171",lengthMinCm:67,lengthMaxCm:74,weightMinKg:6,weightMaxKg:8,equipment:{ettUncuffed:"3.5-4.0",ettCuffed:"3.5",laryngoscopeBlade:"1",suctionCatheter:"8 Fr",ivCatheter:"22G"}},{id:"purple",colorName:"Púrpura",colorHex:"#A78BFA",lengthMinCm:75,lengthMaxCm:84,weightMinKg:8,weightMaxKg:10,equipment:{ettUncuffed:"4.0",ettCuffed:"3.5",laryngoscopeBlade:"1",suctionCatheter:"8-10 Fr",ivCatheter:"22G"}},{id:"yellow",colorName:"Amarillo",colorHex:"#FACC15",lengthMinCm:85,lengthMaxCm:94,weightMinKg:10,weightMaxKg:12,equipment:{ettUncuffed:"4.5",ettCuffed:"4.0",laryngoscopeBlade:"2",suctionCatheter:"10 Fr",ivCatheter:"22G"}},{id:"white",colorName:"Blanco",colorHex:"#E5E7EB",lengthMinCm:95,lengthMaxCm:104,weightMinKg:12,weightMaxKg:14,equipment:{ettUncuffed:"5.0",ettCuffed:"4.5",laryngoscopeBlade:"2",suctionCatheter:"10 Fr",ivCatheter:"20-22G"}},{id:"blue",colorName:"Azul",colorHex:"#60A5FA",lengthMinCm:105,lengthMaxCm:114,weightMinKg:14,weightMaxKg:18,equipment:{ettUncuffed:"5.5",ettCuffed:"5.0",laryngoscopeBlade:"2",suctionCatheter:"12 Fr",ivCatheter:"20G"}},{id:"orange",colorName:"Naranja",colorHex:"#FDBA74",lengthMinCm:115,lengthMaxCm:124,weightMinKg:18,weightMaxKg:23,equipment:{ettUncuffed:"6.0",ettCuffed:"5.5",laryngoscopeBlade:"3",suctionCatheter:"12 Fr",ivCatheter:"20G"}},{id:"green",colorName:"Verde",colorHex:"#4ADE80",lengthMinCm:125,lengthMaxCm:134,weightMinKg:23,weightMaxKg:29,equipment:{ettUncuffed:"6.5",ettCuffed:"6.0",laryngoscopeBlade:"3",suctionCatheter:"12-14 Fr",ivCatheter:"18-20G"}}],B=r=>N.find(s=>r>=s.lengthMinCm&&r<=s.lengthMaxCm),F=r=>N.find(s=>r>=s.weightMinKg&&r<=s.weightMaxKg),A=r=>Math.round((r.weightMinKg+r.weightMaxKg)/2*10)/10,G=()=>{const[r,s]=n.useState(""),[g,h]=n.useState(""),[a,x]=n.useState("length"),o=Number(r),i=Number(g),d=n.useMemo(()=>{if(!(!Number.isFinite(o)||o<=0))return B(o)},[o]),l=n.useMemo(()=>{if(!(!Number.isFinite(i)||i<=0))return F(i)},[i]),t=a==="length"?d:l,M=d&&l&&d.id!==l.id,v=()=>{s(""),h("")};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h1",{className:"text-xl font-semibold text-foreground",children:"Pediatría rápida (Broselow)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Estimación rápida por talla/peso para dosis y material. Usar siempre cinta Broselow oficial y protocolos locales."})]}),e.jsxs(u,{children:[e.jsxs(p,{className:"space-y-1",children:[e.jsx(f,{className:"text-base",children:"Entrada principal"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Selecciona el modo (talla o peso) y completa el valor disponible."})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(m,{type:"button",variant:a==="length"?"default":"outline",onClick:()=>x("length"),children:"Por talla"}),e.jsx(m,{type:"button",variant:a==="weight"?"default":"outline",onClick:()=>x("weight"),children:"Por peso"}),e.jsx(m,{type:"button",variant:"outline",onClick:v,children:"Limpiar"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"length",children:"Talla (cm)"}),e.jsx(C,{id:"length",type:"number",inputMode:"decimal",placeholder:"Ej: 92",value:r,onChange:c=>s(c.target.value),disabled:a!==