1import{j as e,r as g,u as ve,e as Ht,c as te,b as $t}from"./vendor-query-C4ayO_eo.js";import{G as Vt}from"./GestorShellLayout-CGbMbJeU.js";import{c as _e,i as _t,a3 as Ut,h as P,F as Ae,B as be,a4 as Qt,V as he,f as Z,v as ue,k as xe,t as T,Y as Wt,C as Gt,I as ie,M as Pe,X as Rt,y as B,D as He,l as Ve,m as Ue,o as Qe,p as We,a5 as bt,a6 as vt,a7 as St,a8 as Ge,s as Kt}from"./index-yS6ofWYh.js";import{S as lt,U as Ne,A as mt,e as xt,f as pt}from"./EditionWorkspaceShell-BYJVPAZI.js";import{C as Zt}from"./clock-3-CjKz5CCF.js";import{P as zt}from"./printer-CtdYO1bx.js";import{S as re,a as de,b as le,c as me,d as $}from"./select-CM7vtRnF.js";import{C as Xt}from"./camera-C2xaro01.js";import{A as Ke,b as Ze,c as Xe,d as Ye,e as Je,f as et,g as tt,h as st}from"./alert-dialog-BU5MlB3n.js";import{B as X}from"./badge-RB3ch8ZS.js";import{E as at,a as nt,b as ot,c as ct,d as it}from"./empty-DNWyOKG7.js";import{P as Ee}from"./progress-DeNfZz9Q.js";import{S as F}from"./skeleton-z15qrhFW.js";import{m as rt}from"./gestor-shell-CyuDQSWy.js";import{D as Yt}from"./download-wxpTeJuc.js";import{C as Jt}from"./calendar-clock-CeObCNAR.js";import{A as es}from"./arrow-right-DjbqgwaF.js";import{L as ts}from"./list-filter-DjniWGqJ.js";import{H as gt}from"./history-DOx-KF9L.js";import{S as ss}from"./separator-ZcYs1WDS.js";import{S as jt}from"./switch-Blp7W2_Z.js";import{Q as ht}from"./qr-code-Tx9eA0iV.js";import{C as kt}from"./circle-help-C68qQYPC.js";import{C as dt}from"./checkbox-B_0rTCp3.js";import{S as Pt}from"./settings-2-BE8L-sF_.js";import{L as as}from"./list-2xEQxC22.js";import{U as ns}from"./users-round-CXfdLtox.js";import{C as os}from"./chevron-down-D7z_Z5LK.js";import{C as cs}from"./chevron-right-C2whJNVE.js";import{M as It}from"./mail-D3Z8cln8.js";import{a as is}from"./vendor-router-DbtTIEJL.js";import"./vendor-react-BN0qJr-I.js";import"./useDocumentTitle-Bqbu5V78.js";import"./BrandLogo-DWlr10Qy.js";import"./tabs-eP_sswMI.js";import"./vendor-radix-BAnQwfUX.js";import"./vendor-charts-CXIS9Jzh.js";import"./ChangePasswordForm-DSnZd371.js";import"./PasswordInput-7IxX-vjU.js";import"./eye-CPG8F1Q_.js";import"./zod-Cc3op9xX.js";import"./vendor-forms-sj2LMdtI.js";import"./vendor-motion-z3Lk3cLW.js";import"./key-round-DI8WhKaD.js";import"./menu-DSl-9rUU.js";import"./book-open-Dql9XRty.js";import"./shield-check-L89AdJcQ.js";import"./sliders-horizontal-Ce3WT4b6.js";import"./user-round-SWPhkCBB.js";import"./plus-C3-2KUzD.js";import"./package-BY2-SZKg.js";import"./badge-check-DxWrwvia.js";import"./arrow-left-Dq5OvYnI.js";import"./map-pin-TX1uXekM.js";import"./calendar-check-BFSjlyY6.js";import"./file-text-Bmv7QqUp.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const rs=_e("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const ds=_e("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/** 12 * @license lucide-react v0.453.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const ls=_e("CameraOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16",key:"qmtpty"}],["path",{d:"M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5",key:"1ufyfc"}],["path",{d:"M14.121 15.121A3 3 0 1 1 9.88 10.88",key:"11zox6"}]]);/** 17 * @license lucide-react v0.453.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const Nt=_e("UserRoundX",[["path",{d:"M2 21a8 8 0 0 1 11.873-7",key:"74fkxq"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m17 17 5 5",key:"p7ous7"}],["path",{d:"m22 17-5 5",key:"gqnmv0"}]]);function Q(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function ms(a){return new Date(`${a}T00:00:00`).toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"}).toUpperCase()}function xs(a,t){const s=t*.14;return a.length>30?s*.62:a.length>22?s*.76:a.length>16?s*.88:s}function ps({accreditation:a,editionName:t,widthMm:s,heightMm:n,showPhoto:o=!0}){const c=a.member,i=c?.userName??"Sin nombre",m=c?.entity?.name??"",h=a.badgeLabel??"",b=c?.editionRoleColor??"#1c1917",y=Math.max(n*.07,2),S=o?c?.avatarUrl??null:null,l=o?c?.entity?.logoUrl??null:null,x=n*.42,w=i.trim().charAt(0).toUpperCase()||"?",E=o?S?`<img class="photo" src="${Q(S)}" alt="">`:`<div class="photo photo--initial" style="background:${Q(b)}">${Q(w)}</div>`:"",C=l?`<img class="logo" src="${Q(l)}" alt="">`:"",N=h?`<div class="chip" style="background:${Q(b)}">${Q(h.toUpperCase())}</div>`:'<div class="chip chip--blank"></div>';return` 22 <div class="badge"> 23 <div class="day">${Q(ms(a.accreditationDate))}</div> 24 <div class="who"> 25 ${E} 26 <div class="who-text"> 27 <div class="name">${Q(i)}</div> 28 ${m?`<div class="entity">${C}<span>${Q(m)}</span></div>`:""} 29 </div> 30 </div> 31 <div class="foot"> 32 ${N}
33 <span class="edition">${Q(t)}</span> 34 </div> 35 </div> 36 <style> 37 * { margin: 0; padding: 0; box-sizing: border-box; } 38 html, body { 39 width: ${s}mm; 40 height: ${n}mm; 41 background: #fff; 42 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 43 Helvetica, Arial, sans-serif; 44 color: #000; 45 -webkit-print-color-adjust: exact; 46 print-color-adjust: exact; 47 } 48 .badge { 49 width: ${s}mm; 50 height: ${n}mm; 51 padding: ${y}mm; 52 display: flex; 53 flex-direction: column; 54 justify-content: space-between; 55 overflow: hidden; 56 } 57 .day { 58 font-size: ${n*.075}mm; 59 font-weight: 800; 60 letter-spacing: 0.02em; 61 border-bottom: 0.3mm solid #d6d3d1; 62 padding-bottom: ${y*.35}mm; 63 white-space: nowrap; 64 overflow: hidden; 65 text-overflow: ellipsis; 66 } 67 .foot { 68 display: flex; 69 align-items: center; 70 gap: ${y*.5}mm; 71 } 72 .edition { 73 font-size: ${n*.05}mm; 74 color: #78716c; 75 text-align: right; 76 line-height: 1.15; 77 flex: 0 1 auto; 78 max-width: 38%; 79 overflow: hidden; 80 display: -webkit-box; 81 -webkit-line-clamp: 2; 82 -webkit-box-orient: vertical; 83 } 84 .who { 85 flex: 1; 86 display: flex; 87 align-items: center; 88 gap: ${y*.7}mm; 89 min-height: 0; 90 } 91 .who-text { flex: 1; min-width: 0; } 92 .photo { 93 width: ${x}mm; 94 height: ${x}mm; 95 flex-shrink: 0; 96 border-radius: 1.2mm; 97 object-fit: cover; 98 display: block; 99 } 100 .photo--initial { 101 display: flex; 102 align-items: center; 103 justify-content: center; 104 color: #fff; 105 font-weight: 800; 106 font-size: ${x*.55}mm; 107 } 108 .logo { 109 width: ${n*.09}mm; 110 height: ${n*.09}mm; 111 object-fit: contain; 112 flex-shrink: 0; 113 } 114 .name { 115 font-size: ${xs(i,n)}mm; 116 font-weight: 800; 117 line-height: 1.08; 118 display: -webkit-box; 119 -webkit-line-clamp: 2; 120 -webkit-box-orient: vertical; 121 overflow: hidden; 122 } 123 .entity { 124 margin-top: ${y*.25}mm; 125 display: flex; 126 align-items: center; 127 gap: ${y*.3}mm; 128 font-size: ${n*.072}mm; 129 color: #44403c; 130 min-width: 0; 131 } 132 .entity span { 133 white-space: nowrap; 134 overflow: hidden; 135 text-overflow: ellipsis; 136 } 137 .chip { 138 flex: 1 1 auto; 139 min-width: 0; 140 border-radius: 1mm; 141 padding: ${y*.35}mm ${y*.5}mm; 142 text-align: center; 143 font-size: ${n*.085}mm; 144 font-weight: 800; 145 letter-spacing: 0.05em; 146 color: #fff; 147 white-space: nowrap; 148 overflow: hidden; 149 text-overflow: ellipsis; 150 } 151 .chip--blank { 152 background: #fff; 153 border: 0.3mm dashed #a8a29e; 154 height: ${n*.17}mm; 155 } 156 </style> 157 `}function Mt(a){const{widthMm:t,heightMm:s}=a;return`<!doctype html><html lang="es"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title></title><base href="${window.location.origin}/"><style> 158 /* Keep the print sheet at the physical label size instead of A4. */ 159 @page { 160 size: ${t}mm ${s}mm; 161 margin: 0 !important; 162 } 163 html, body { 164 width: ${t}mm !important; 165 height: ${s}mm !important; 166 min-width: ${t}mm; 167 min-height: ${s}mm; 168 margin: 0 !important; 169 padding: 0 !important; 170 overflow: hidden; 171 } 172 @media print { 173 html, body { 174 margin: 0 !important; 175 padding: 0 !important; 176 overflow: hidden !important; 177 } 178 body { 179 -webkit-print-color-adjust: exact; 180 print-color-adjust: exact; 181 } 182 } 183 </style></head><body>${ps(a)}</body></html>`}async function gs(a,t=3e3){const s=Array.from(a.images);s.length!==0&&await Promise.race([Promise.all(s.map(n=>new Promise(o=>{if(n.complete)return o();n.addEventListener("load",()=>o(),{once:!0}),n.addEventListener("error",()=>o(),{once:!0})}))),new Promise(n=>window.setTimeout(n,t))])}function hs(a){return new Promise(t=>{const s=document.createElement("iframe");s.setAttribute("aria-hidden","true"),s.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;",document.body.appendChild(s);let n=!1;const o=()=>{n||(n=!0,s.remove(),t())},c=s.contentDocument;if(!c||!s.contentWindow){o();return}c.open(),c.write(Mt(a)),c.close();const i=s.contentWindow;i.addEventListener("afterprint",o,{once:!0}),gs(c).then(()=>{i.focus(),i.print(),window.setTimeout(o,1500)})})}function us({data:a,className:t}){return e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationBadge.tsx:354",className:t,style:{width:`${a.widthMm}mm`,height:`${a.heightMm}mm`},children:e.jsx("iframe",{"data-loc":"src/components/gestor/accreditations/AccreditationBadge.tsx:358",title:"Vista previa del papelito",className:"pointer-events-none h-full w-full border-0",srcDoc:Mt(a)})})}function Et({member:a,badgeLabel:t}){if(!a)return null;const s=(a.userName??"?").trim().charAt(0).toUpperCase();return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:46",className:"flex min-w-0 items-center gap-4 sm:gap-5",children:[a.avatarUrl?e.jsx("img",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:48",src:a.avatarUrl,alt:"",className:"size-16 shrink-0 rounded-2xl object-cover shadow-sm sm:size-20"}):e.jsx("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:54",className:"flex size-16 shrink-0 items-center justify-center rounded-2xl text-2xl font-bold text-white shadow-sm sm:size-20 sm:text-3xl",style:{backgroundColor:a.editionRoleColor??"#57534e"},"aria-hidden":"true",children:s}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:62",className:"min-w-0",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:63",className:"truncate text-xl font-bold leading-tight text-stone-950 sm:text-3xl",children:a.userName??"Sin nombre"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:66",className:"mt-1 flex min-w-0 items-center gap-2 text-sm text-stone-600 sm:text-base",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:67",className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-md border border-stone-200 bg-white text-stone-400",children:a.entity?.logoUrl?e.jsx("img",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:69",src:a.entity.logoUrl,alt:"",className:"size-full object-contain"}):e.jsx(be,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:75",className:"size-3.5","aria-hidden":"true"})}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:78",className:"truncate",children:a.entity?.name??a.userEmail??"Sin entidad"})]}),t&&e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:83",className:"mt-2 inline-flex max-w-full truncate rounded-full px-3 py-1 text-xs font-semibold text-white sm:text-sm",style:{backgroundColor:a.editionRoleColor??"#1c1917"},children:t})]})]})}function ys({state:a,isPending:t,onPrint:s,onReset:n}){const o=g.useRef(null);if(g.useEffect(()=>{a.kind!=="idle"&&o.current?.focus()},[a]),t)return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:114",className:"flex min-h-[340px] flex-col items-center justify-center gap-3 rounded-2xl border border-stone-200 bg-[#fffefa] text-stone-500",role:"status","aria-live":"polite",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:119",className:"flex size-12 items-center justify-center rounded-full bg-stone-100",children:e.jsx(_t,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:120",className:"size-6 animate-spin motion-reduce:animate-none","aria-hidden":"true"})}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:125",className:"text-lg font-semibold text-stone-700",children:"Validando entradaâ¦"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:128",className:"text-sm",children:"Mantén el QR dentro del encuadre."})]});if(a.kind==="idle")return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:135",className:"flex min-h-[340px] flex-col items-center justify-center rounded-2xl border border-dashed border-stone-300 bg-[#fffefa] px-6 text-center",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:136",className:"flex size-14 items-center justify-center rounded-2xl bg-[#185428]/10 text-[#185428]",children:e.jsx(lt,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:137",className:"size-7","aria-hidden":"true"})}),e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:139",className:"mt-4 text-lg font-semibold text-stone-900",children:"Esperando a la siguiente persona"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:142",className:"mt-1 max-w-md text-sm leading-6 text-stone-500",children:"Escanea su entrada QR. Si no la tiene a mano, búscala por nombre, correo o entidad."}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:146",className:"mt-5 grid w-full max-w-lg gap-2 text-left text-xs text-stone-600 sm:grid-cols-3",children:[["1","Identifica"],["2","Comprueba el resultado"],["3","Imprime la etiqueta"]].map(([y,S])=>e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:152",className:"flex items-center gap-2 rounded-lg bg-stone-100/80 px-3 py-2",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:156",className:"flex size-5 items-center justify-center rounded-full bg-white font-bold text-[#185428]",children:y}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:159",className:"font-medium",children:S})]},y))})]});if(a.kind==="blocked")return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:169",ref:o,tabIndex:-1,
183className:"min-h-[340px] rounded-2xl border-2 border-rose-300 bg-rose-50 p-5 outline-none sm:p-7",role:"alert","aria-live":"assertive",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:176",className:"flex items-start gap-3 text-rose-800",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:177",className:"flex size-11 shrink-0 items-center justify-center rounded-full bg-rose-100",children:e.jsx(Ut,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:178",className:"size-6","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:180",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:181",className:"text-xs font-bold uppercase tracking-[0.15em] text-rose-600",children:"Acceso bloqueado"}),e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:184",className:"mt-1 text-2xl font-bold",children:"No se puede acreditar"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:185",className:"mt-2 text-base leading-6 text-rose-800",children:a.message})]})]}),a.member&&e.jsx("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:192",className:"mt-6 border-t border-rose-200 pt-5",children:e.jsx(Et,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:193",member:a.member})}),e.jsx(P,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:197",variant:"outline",size:"lg",className:"mt-6 border-rose-300 bg-white text-rose-800 hover:bg-rose-100 hover:text-rose-900",onClick:n,children:"Siguiente persona"})]});const{accreditation:c,alreadyAccredited:i}=a,m=c.accreditedAt?new Date(c.accreditedAt).toLocaleTimeString("es-ES",{hour:"2-digit",minute:"2-digit"}):null,h=i?{eyebrow:"Acreditación existente",title:"Ya acreditado hoy",border:"border-amber-300",background:"bg-amber-50",iconBackground:"bg-amber-100",text:"text-amber-900",detail:"text-amber-700",icon:Zt}:{eyebrow:"Acceso confirmado",title:"Acreditado",border:"border-emerald-400",background:"bg-emerald-50",iconBackground:"bg-emerald-100",text:"text-emerald-900",detail:"text-emerald-700",icon:Ae},b=h.icon;return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:240",ref:o,tabIndex:-1,className:`min-h-[340px] rounded-2xl border-2 ${h.border} ${h.background} p-5 outline-none sm:p-7`,role:"status","aria-live":"assertive",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:247",className:`flex items-start gap-3 ${h.text}`,children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:248",className:`flex size-11 shrink-0 items-center justify-center rounded-full ${h.iconBackground}`,children:e.jsx(b,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:251",className:"size-6","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:253",className:"min-w-0 flex-1",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:254",className:`text-xs font-bold uppercase tracking-[0.15em] ${h.detail}`,children:h.eyebrow}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:259",className:"mt-1 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:260",className:"text-2xl font-bold sm:text-3xl",children:h.title}),m&&e.jsx("span",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:262",className:"tabular-nums text-base font-semibold",children:m})]})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:270",className:`mt-6 border-t ${h.border} pt-5`,children:[e.jsx(Et,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:271",member:c.member,badgeLabel:c.badgeLabel}),c.accreditedBy?.name&&e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:276",className:"mt-4 text-xs text-stone-500",children:["Registrado por ",e.jsx("strong",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:277",children:c.accreditedBy.name})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:282",className:"mt-6 flex flex-col-reverse gap-2 sm:flex-row",children:[e.jsx(P,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:283",size:"lg",variant:"outline",onClick:n,children:"Siguiente persona"}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:286",size:"lg",onClick:()=>s(c),children:[e.jsx(zt,{"data-loc":"src/components/gestor/accreditations/DeskIdentityPanel.tsx:287",className:"size-4","aria-hidden":"true"}),c.badgePrintCount>0?`Reimprimir (${c.badgePrintCount})`:"Imprimir etiqueta"]})]})]})}class u{constructor(t,s,n,o,c){this._legacyCanvasSize=u.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement("canvas"),n&&typeof n=="object"?this._onDecode=s:(console.warn(n||o||c?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=s),s=typeof n=="object"?n:{},this._onDecodeError=s.onDecodeError||(typeof n=="function"?n:this._onDecodeError),this._calculateScanRegion=s.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=s.preferredCamera||c||this._preferredCamera,this._legacyCanvasSize=typeof n=="number"?n:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=s.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInl
183ine=!0,t.muted=!0;let i=!1;if(t.hidden&&(t.hidden=!1,i=!0),document.body.contains(t)||(document.body.appendChild(t),i=!0),n=t.parentElement,s.highlightScanRegion||s.highlightCodeOutline){if(o=!!s.overlay,this.$overlay=s.overlay||document.createElement("div"),c=this.$overlay.style,c.position="absolute",c.display="none",c.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&s.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}n.insertBefore(this.$overlay,this.$video.nextSibling)}s.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let m=window.getComputedStyle(t);m.display==="none"&&(t.style.setProperty("display","block","important"),i=!0),m.visibility!=="visible"&&(t.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),t.style.opacity="0",t.style.width="0",t.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener("play",this._onPlay),t.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=u.createQrEngine()}static set WORKER_PATH(t){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await u.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let s=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),n;try{t&&(await s()).every(o=>!o.label)&&(n=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await s()).map((o,c)=>({id:o.deviceId,label:o.label||(c===0?"Default Camera":`Camera ${c+1}`)}))}finally{n&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),u._stopVideoStream(n))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return"torch"in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),u._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(t){throw this._flashOn=!1,t}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),u._postWorkerMessage(this._qrEnginePromise,"close")}
183async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:s}=await this._getCameraStream();!this._active||this._paused?u._stopVideoStream(t):(this._setVideoMirror(s),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(t){if(!this._paused)throw this._active=!1,t}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let s=()=>{this.$video.srcObject instanceof MediaStream&&(u._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(s(),!0):(await new Promise(n=>setTimeout(n,300)),this._paused?(s(),!0):!1)}async setCamera(t){t!==this._preferredCamera&&(this._preferredCamera=t,await this._restartVideoStream())}static async scanImage(t,s,n,o,c=!1,i=!1){let m,h=!1;s&&("scanRegion"in s||"qrEngine"in s||"canvas"in s||"disallowCanvasResizing"in s||"alsoTryWithoutScanRegion"in s||"returnDetailedScanResult"in s)?(m=s.scanRegion,n=s.qrEngine,o=s.canvas,c=s.disallowCanvasResizing||!1,i=s.alsoTryWithoutScanRegion||!1,h=!0):console.warn(s||n||o||c||i?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),s=!!n;try{let b,y;[n,b]=await Promise.all([n||u.createQrEngine(),u._loadImage(t)]),[o,y]=u._drawToCanvas(b,m,o,c);let S;if(n instanceof Worker){let l=n;s||u._postWorkerMessageSync(l,"inversionMode","both"),S=await new Promise((x,w)=>{let E,C,N,I=-1;C=R=>{R.data.id===I&&(l.removeEventListener("message",C),l.removeEventListener("error",N),clearTimeout(E),R.data.data!==null?x({data:R.data.data,cornerPoints:u._convertPoints(R.data.cornerPoints,m)}):w(u.NO_QR_CODE_FOUND))},N=R=>{l.removeEventListener("message",C),l.removeEventListener("error",N),clearTimeout(E),w("Scanner error: "+(R?R.message||R:"Unknown Error"))},l.addEventListener("message",C),l.addEventListener("error",N),E=setTimeout(()=>N("timeout"),1e4);let D=y.getImageData(0,0,o.width,o.height);I=u._postWorkerMessageSync(l,"decode",D,[D.data.buffer])})}else S=await Promise.race([new Promise((l,x)=>window.setTimeout(()=>x("Scanner error: timeout"),1e4)),(async()=>{try{var[l]=await n.detect(o);if(!l)throw u.NO_QR_CODE_FOUND;return{data:l.rawValue,cornerPoints:u._convertPoints(l.cornerPoints,m)}}catch(x){if(l=x.message||x,/not implemented|service unavailable/.test(l))return u._disableBarcodeDetector=!0,u.scanImage(t,{scanRegion:m,canvas:o,disallowCanvasResizing:c,alsoTryWithoutScanRegion:i});throw`Scanner error: ${l}`}})()]);return h?S:S.data}catch(b){if(!m||!i)throw b;let y=await u.scanImage(t,{qrEngine:n,canvas:o,disallowCanvasResizing:c});return h?y:y.data}finally{s||u._postWorkerMessage(n,"close")}}setGrayscaleWeights(t,s,n,o=!0){u._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:t,green:s,blue:n,useIntegerApproximation:o})}setInversionMode(t){u._postWorkerMessage(this._qrEnginePromise,"inversionMode",t)}static async createQrEngine(t){if(t&&console.warn("Specifying a worker path is not required and not supported anymore."),t=()=>Qt(()=>import("./qr-scanner-worker.min-D85Z9gVD.js"),[]).then(n=>n.createWorker()),!(!u._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return t();let s=navigator.userAgentData;return s&&s.brands.some(({brand:n})=>/Chromium/i.test(n))&&/mac ?OS/i.test(s.platform)&&await s.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:n,platformVersion:o})=>/arm/i.test(n||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?t():new BarcodeDetector({formats:["qr_code"]}
183)}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(t){let s=Math.round(.6666666666666666*Math.min(t.videoWidth,t.videoHeight));return{x:Math.round((t.videoWidth-s)/2),y:Math.round((t.videoHeight-s)/2),width:s,height:s,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var t=this.$video,s=t.videoWidth,n=t.videoHeight,o=t.offsetWidth,c=t.offsetHeight,i=t.offsetLeft,m=t.offsetTop,h=window.getComputedStyle(t),b=h.objectFit,y=s/n,S=o/c;switch(b){case"none":var l=s,x=n;break;case"fill":l=o,x=c;break;default:(b==="cover"?y>S:y<S)?(x=c,l=x*y):(l=o,x=l/y),b==="scale-down"&&(l=Math.min(l,s),x=Math.min(x,n))}var[w,E]=h.objectPosition.split(" ").map((N,I)=>{const D=parseFloat(N);return N.endsWith("%")?(I?c-x:o-l)*D/100:D});h=this._scanRegion.width||s,S=this._scanRegion.height||n,b=this._scanRegion.x||0;var C=this._scanRegion.y||0;y=this.$overlay.style,y.width=`${h/s*l}px`,y.height=`${S/n*x}px`,y.top=`${m+E+C/n*x}px`,n=/scaleX\(-1\)/.test(t.style.transform),y.left=`${i+(n?o-w-l:w)+(n?s-b-h:b)/s*l}px`,y.transform=t.style.transform}})}static _convertPoints(t,s){if(!s)return t;let n=s.x||0,o=s.y||0,c=s.width&&s.downScaledWidth?s.width/s.downScaledWidth:1;s=s.height&&s.downScaledHeight?s.height/s.downScaledHeight:1;for(let i of t)i.x=i.x*c+n,i.y=i.y*s+o;return t}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,s=1e3/this._maxScansPerSecond;t<s&&await new Promise(o=>setTimeout(o,s-t)),this._lastScanTimestamp=Date.now();try{var n=await u.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!u._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=u.createQrEngine()),n?(this._onDecode?this._onDecode(n):this._legacyOnDecode&&this._legacyOnDecode(n.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",n.cornerPoints.map(({x:o,y:c})=>`${o},${c}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(t){t!==u.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let t=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",s=[{width:{min:1024}},{width:{min:768}},{}],n=s.map(o=>Object.assign({},o,{[t]:{exact:this._preferredCamera}}));for(let o of[...n,...s])try{let c=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),i=this._getFacingMode(c)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:c,facingMode:i}}catch{}throw"Camera not found."}async _restartVideoStream(){let t=this._paused;await this.pause(!0)&&!t&&this._active&&await this.start()}static _stopVideoStream(t){for(let s of t.getTracks())s.stop(),t.removeTrack(s)}_setVideoMirror(t){this.$video.style.transform="scaleX("+(t==="user"?-1:1)+")"}_getFacingMode(t){return(t=t.getVideoTracks()[0])?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(t,s,n,o=!1){n=n||document.createElement("canvas");let c=s&&s.x?s.x:0,i=s&&s.y?s.y:0,m=s&&s.width?s.width:t.videoWidth||t.width,h=s&&s.height?s.height:t.videoHeight||t.height;return o||(o=s&&s.downScaledWidth?s.downScaledWidth:m,s=s&&s.downScaledHeight?s.downScaledHeight:h,n.width!==o&&(n.width=o),n.height!==s&&(n.height=s)),s=n.getContext("2d",{alpha:!1}),s.imageSmoothingEnabled=!1,s.drawImage(t,c,i,m,h,0,0,n.width,n.height),[n,s]}static async _loadImage(t){if(t instanceof Image)return await u._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||"OffscreenCanvas"in window&&t instanceof OffscreenCanvas||"ImageBitmap"in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t=="string"){let s=new Image;s.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await u._awaitImageLoad(s),s}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(s.src)}}else throw"Unsupported image type."}
183static async _awaitImageLoad(t){t.complete&&t.naturalWidth!==0||await new Promise((s,n)=>{let o=c=>{t.removeEventListener("load",o),t.removeEventListener("error",o),c instanceof ErrorEvent?n("Image load error"):s()};t.addEventListener("load",o),t.addEventListener("error",o)})}static async _postWorkerMessage(t,s,n,o){return u._postWorkerMessageSync(await t,s,n,o)}static _postWorkerMessageSync(t,s,n,o){if(!(t instanceof Worker))return-1;let c=u._workerMessageId++;return t.postMessage({id:c,type:s,data:n},o),c}}u.DEFAULT_CANVAS_SIZE=400;u.NO_QR_CODE_FOUND="No QR code found";u._disableBarcodeDetector=!1;u._workerMessageId=0;function fs({onScan:a,paused:t=!1}){const s=g.useRef(null),n=g.useRef(null),o=g.useRef(a),[c,i]=g.useState("loading"),[m,h]=g.useState([]),[b,y]=g.useState("");g.useEffect(()=>{o.current=a},[a]),g.useEffect(()=>{let x=!1,w=null;async function E(){const C=s.current;if(C)try{const N=await u.hasCamera();if(x)return;if(!N){i("unsupported");return}if(w=new u(C,D=>o.current(D.data),{preferredCamera:"environment",highlightScanRegion:!0,highlightCodeOutline:!0,maxScansPerSecond:5}),n.current=w,await w.start(),x)return;i("ready");const I=await u.listCameras(!0);x||h(I.map((D,R)=>({id:D.id,label:D.label||`Cámara ${R+1}`})))}catch{x||i("denied")}}return E(),()=>{x=!0,w?.destroy(),n.current=null}},[]),g.useEffect(()=>{const x=n.current;x&&(t?x.pause():c==="ready"&&x.start().catch(()=>i("denied")))},[t,c]);async function S(){i("loading");const x=n.current;if(!x){i("unsupported");return}try{await x.start(),i("ready");const w=await u.listCameras(!0);h(w.map((E,C)=>({id:E.id,label:E.label||`Cámara ${C+1}`})))}catch{i("denied")}}async function l(x){y(x);try{await n.current?.setCamera(x)}catch{i("denied")}}return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:143",className:"relative aspect-[4/3] w-full overflow-hidden rounded-xl bg-stone-950",children:[e.jsx("video",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:144",ref:s,className:"h-full w-full object-cover",muted:!0,playsInline:!0,"aria-label":"Vista de la cámara para escanear entradas QR"}),c==="ready"&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:153",className:"pointer-events-none absolute left-3 top-3 inline-flex items-center gap-1.5 rounded-full bg-stone-950/75 px-2.5 py-1 text-[11px] font-semibold text-white backdrop-blur",children:[e.jsx(Ae,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:154",className:"size-3.5 text-lime-300","aria-hidden":"true"}),"Cámara lista"]}),c==="loading"&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:160",className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-stone-950/92 text-stone-100",role:"status",children:[e.jsx(_t,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:164",className:"size-6 animate-spin","aria-hidden":"true"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:165",className:"text-sm",children:"Iniciando cámaraâ¦"})]}),(c==="denied"||c==="unsupported")&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:170",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-stone-950/95 px-6 text-center text-stone-100",role:"alert",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:174",className:"flex size-10 items-center justify-center rounded-full bg-white/10",children:e.jsx(ls,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:175",className:"size-5","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:177",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:178",className:"font-semibold",children:c==="unsupported"?"No se ha detectado una cámara":"No se puede usar la cámara"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:183",className:"mt-1 max-w-sm text-xs leading-5 text-stone-300",children:c==="unsupported"?"Conecta una cámara o utiliza la zona de búsqueda manual.":"Comprueba el permiso del navegador. También puedes buscar por nombre o pegar el contenido del QR."})]}),c==="denied"&&e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:190",size:"sm",variant:"secondary",onClick:()=>void S(),children:[e.jsx(he,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:191",className:"size-3.5","aria-hidden":"true"}),"Reintentar"]})]}),c==="ready"&&m.length>1&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:199",className:"absolute bottom-3 left-3 right-3 flex items-center gap-2 rounded-lg bg-stone-950/80 p-2 backdrop-blur",children:[e.jsx(Xt,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:200",className:"ml-1 size-4 shrink-0 text-stone-300","aria-hidden":!0}),e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:201",htmlFor:"accreditation-camera",className:"sr-only",children:"Cámara del lector"}),e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:204",value:b,onValueChange:l,children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:205",id:"accreditation-camera",className:"h-8 flex-1 border-white/15 bg-white/10 text-xs text-white","aria-label":"Cambiar cámara",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:210",placeholder:"Cambiar cámara"})}),e.jsx(me,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:212",children:m.map(x=>e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassScanner.tsx:214",value:x.id,children:x.label},x.id))})]})]})]})}const Re={board:(a,t)=>["gestor","edition","day-accreditations",a,t??"today"],search:(a,t,s)=>["gestor","edition","day-accreditations","search",a,t??"today",s]};function Lt(a){return a?`?date=${encodeURIComponent(a)}`:""}function bs(a,t){return ve({queryKey:Re.board(a,t),queryFn:()=>ue(`/gestor/editions/${a}/day-accreditations${Lt(t)}`),enabled:!!a,staleTime:1e3*15})}function vs(a,t,s){return Ht({queries:t.map(n=>({queryKey:Re.board(a,n),queryFn:()=>ue(`/gestor/editions/${a}/day-accreditations${Lt(n)}`),enabled:!!a&&s,staleTime:1e3*30}))})}function Ss(a,t,s){const n=s.trim();return ve({queryKey:Re.search(a,t,n),queryFn:()=>ue(`/gestor/editions/${a}/day-accreditations/search?q=${encodeURIComponent(n)}${t?`&date=${encodeURIComponent(t)}`:""}`),enabled:!!a&&n.length>=2,staleTime:1e3*10})}function ze(a,t){const s=$t();return()=>{s.invalidateQueries({queryKey:Re.board(a,t)}),s.invalidateQueries({queryKey:["gestor","edition","day-accreditations","search",a]})}}function js(a,t,s){const n=ze(a,t);return te({mutationFn:o=>xe(`/gestor/editions/${a}/day-accreditations/scan`,{qrPayload:o,accreditationDate:t??void 0,deskLabel:s||void 0}),onSuccess:o=>{o.accredited&&!o.alreadyAccredited&&n()},onError:o=>{T.error(o instanceof Error?o.message:"No se pudo validar la entrada")}})}function ks(a,t,s){const n=ze(a,t);return te({mutationFn:({membershipId:o,method:c="search",badgeLabelOverride:i})=>xe(`/gestor/editions/${a}/day-accreditations`,{editionMembershipId:o,accreditationDate:t??void 0,method:c,deskLabel:s||void 0,badgeLabelOverride:i||void 0}),onSuccess:o=>{o.accredited&&!o.alreadyAccredited&&n()},onError:o=>{T.error(o instanceof Error?o.message:"No se pudo acreditar")}})}function Ps(a,t){const s=ze(a,t);return te({mutationFn:n=>xe(`/gestor/editions/${a}/day-accreditations/${n}/printed`,{}),onSuccess:s,onError:n=>{T.error(n instanceof Error?n.message:"No se pudo registrar la impresión")}})}function Ns(a,t){const s=ze(a,t);return te({mutationFn:({accreditationId:n,notes:o})=>xe(`/gestor/editions/${a}/day-accreditations/${n}/revoke`,{notes:o?.trim()||void 0}),onSuccess:()=>{T.success("Acreditación anulada"),s()},onError:n=>{T.error(n instanceof Error?n.message:"No se pudo anular")}})}const Ce={targets:a=>["gestor","edition","entry-pass-targets",a],passes:a=>["gestor","edition","entry-passes",a]};function Tt(a){return ve({queryKey:Ce.targets(a),queryFn:()=>ue(`/gestor/editions/${a}/entry-pass-targets`),enabled:!!a,staleTime:1e3*60})}function Es(a,t=!0){return ve({queryKey:Ce.passes(a),queryFn:()=>ue(`/gestor/editions/${a}/entry-passes`),enabled:!!a&&t,staleTime:1e3*30})}function Ie(a){const t=$t();return()=>{t.invalidateQueries({queryKey:Ce.targets(a)}),t.invalidateQueries({queryKey:Ce.passes(a)}),t.invalidateQueries({queryKey:["gestor","edition","day-accreditations","search",a]})}}function ws(a){const t=Ie(a);return te({mutationFn:({membershipIds:s,send:n})=>xe(`/gestor/editions/${a}/entry-passes/bulk`,n===void 0?{membershipIds:s}:{membershipIds:s,send:n}),onSuccess:({summary:s},{send:n})=>{const o=[];s.issuedCount>0&&o.push(`${s.issuedCount} activadas`),s.alreadyIssuedCount>0&&o.push(`${s.alreadyIssuedCount} ya activas`),s.sentCount>0&&o.push(`${s.sentCount} enviadas`),T.success(o.join(" · ")||"Sin cambios"),t()},onError:s=>{T.error(s instanceof Error?s.message:"No se pudieron activar las entradas")}})}function Ds(a){const t=Ie(a);return te({mutationFn:s=>xe(`/gestor/editions/${a}/entry-passes/${s}/revoke`,{}),onSuccess:()=>{T.success("Entrada revocada"),t()},onError:s=>{T.error(s instanceof Error?s.message:"No se pudo revocar la entrada")}})}function As(a){const t=Ie(a);return te({mutationFn:s=>xe(`/gestor/editions/${a}/entry-passes/${s}/send`,{}),onSuccess:()=>{T.success("Entrada encolada para envÃo"),t()},onError:s=>{T.error(s instanceof Error?s.message:"No se pudo enviar la entrada")}})}function Cs(a){const t=Ie(a);return te({mutationFn:s=>Wt(`/gestor/editions/${a}/entry-pass-settings`,s),onSuccess:()=>{T.success("Reglas de entrada actualizadas"),t()},onError:s=>{T.error(s instanceof Error?s.message:"No se pudieron actualizar las reglas")}})}const $s="av-entry:v1:",Te="__none__";function _s(){const a=g.useRef(null);return g.useCallback(t=>{try{a.current??=new AudioContext;const s=a.current,n=s.createOscillator(),o=s.createGain();n.connect(o),o.connect(s.destination),n.frequency.value=t==="ok"?880:t==="warn"?560:220,o.gain.setValueAtTime(.15,s.currentTime),o.gain.exponentialRampToValueAtTime(.001,s.currentTime+.25),n.start(),n.stop(s.currentTime+.25)}catch{}navigator.vibrate&&navigator.vibrate(t==="ok"?60:t==="warn"?[40,40]:[90,60,90])},[])}function wt(a,t=!1){return new Date(`${a}T00:00:00`).toLocaleDateString("es-ES",{weekday:t?"long":"short",day:"numeric",month:t?"long":"short"})}function Ot(a){return a?new Date(a).toLocaleTimeString("es-ES",{hour:"2-digit",minute:"2-digit"}):"â"}function ut({name:a,email:t,avatarUrl:s,roleColor:n,className:o="size-9 rounded-xl"}){const c=(a??t??"?").trim().charAt(0).toUpperCase();return e.jsxs(mt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:149",className:o,children:[s&&e.jsx(xt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:150",src:s,alt:""}),e.jsx(pt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:151",className:"rounded-[inherit] text-xs font-bold text-white",style:{backgroundColor:n??"#78716c"},children:c})]})}function yt({name:a,logoUrl:t,className:s="size-6 rounded-md"}){return e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:171",className:B("flex shrink-0 items-center justify-center overflow-hidden border border-stone-200 bg-stone-50 text-stone-400",s),title:a??"Sin entidad",children:t?e.jsx("img",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:179",src:t,alt:"",className:"size-full object-contain"}):e.jsx(Ne,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:181",className:"size-3.5","aria-hidden":"true"})})}function Rs({days:a,activeDay:t,today:s,onChange:n}){const o=new Intl.DateTimeFormat("es-ES",{weekday:"short",day:"numeric",month:"short"});return e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:205",className:"flex min-w-0 flex-wrap items-center gap-1.5",role:"radiogroup","aria-label":"DÃa de acreditación",children:a.map(c=>{const i=c===t,m=c===s,h=o.format(new Date(`${c}T00:00:00`)).replace(/\./g,"");return e.jsxs("button",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:217",type:"button",role:"radio","aria-checked":i,"aria-current":m?"date":void 0,onClick:()=>n(c),className:B("inline-flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-semibold capitalize transition-colors duration-150 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-[#55b04d]/45 motion-reduce:transition-none",i?"border-[#185428] bg-[#185428] text-white shadow-[0_2px_6px_rgba(24,84,40,0.2)]":"border-stone-200 bg-white text-stone-600 hover:border-[#55b04d] hover:bg-[#f1efe7] hover:text-[#185428]"),children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:231",className:"tabular-nums",children:h}),m&&e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:233",className:B("rounded-full px-1.5 py-px text-[9px] font-bold uppercase tracking-[0.08em]",i?"bg-white/20 text-[#c3d83e]":"bg-[#185428]/10 text-[#185428]"),children:"Hoy"})]},c)})})}function zs({data:a}){const b=Math.max(1,...a.map(l=>l.count)),y=a.map((l,x)=>({...l,x:a.length===1?24+266/2:24+x/(a.length-1)*266,y:114-l.count/b*96})),S=y.map((l,x)=>`${x===0?"M":"L"} ${l.x} ${l.y}`).join(" ");return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:278",className:"mt-3",children:[e.jsxs("svg",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:279",viewBox:"0 0 300 142",className:"h-44 w-full overflow-visible",role:"img","aria-label":"Curva de llegadas por hora",children:[[0,.5,1].map(l
183=>{const x=18+96*l,w=Math.round(b*(1-l));return e.jsxs("g",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:289","aria-hidden":"true",children:[e.jsx("line",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:290",x1:24,x2:290,y1:x,y2:x,stroke:"#ebe8dc",strokeDasharray:"3 3"}),e.jsx("text",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:298",x:17,y:x+3,textAnchor:"end",fontSize:"9",fill:"#a8a29e",children:w})]},l)}),e.jsx("path",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:310",d:S,fill:"none",stroke:"#25543b",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"}),y.map(l=>e.jsxs("g",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:320","aria-hidden":"true",children:[e.jsx("circle",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:321",cx:l.x,cy:l.y,r:"4",fill:"#fffefa",stroke:"#25543b",strokeWidth:"2.5"}),e.jsx("text",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:329",x:l.x,y:Math.max(l.y-9,9),textAnchor:"middle",fontSize:"9",fontWeight:"700",fill:"#25543b",children:l.count}),e.jsxs("text",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:339",x:l.x,y:134,textAnchor:"middle",fontSize:"9",fill:"#78716c",children:[l.hour,"h"]})]},l.hour))]}),e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:351",className:"sr-only",children:a.map(l=>e.jsxs("li",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:353",children:[l.hour,":00: ",l.count," llegadas"]},l.hour))})]})}function Dt(a,t){const s=t.trim().toLowerCase();return s?[a.userName,a.userEmail,a.entity?.name,a.editionRole,...a.additionalSearchTerms??[]].filter(Boolean).some(n=>n.toLowerCase().includes(s)):!0}function $e(a,t){return(a??"Sin nombre").localeCompare(t??"Sin nombre","es",{sensitivity:"base"})}function Oe(a,t){const s=a.accreditedAt?Date.parse(a.accreditedAt):0;return(t.accreditedAt?Date.parse(t.accreditedAt):0)-s}function Is(a,t){return[...a].sort((s,n)=>{if(t==="nameAsc")return $e(s.member?.userName,n.member?.userName)||Oe(s,n);if(t==="nameDesc")return $e(n.member?.userName,s.member?.userName)||Oe(s,n);const o=Oe(s,n);return t==="oldest"?-o:o})}function Ms(a,t){return[...a].sort((s,n)=>t==="nameDesc"?$e(n.userName,s.userName):$e(s.userName,n.userName))}function Ls({entry:a,isPending:t,onPrint:s,onRevoke:n}){return e.jsxs("li",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:442",className:"grid gap-3 px-4 py-3 transition-colors hover:bg-[#f8f6f1] sm:grid-cols-[minmax(0,1fr)_8rem_13rem] sm:items-center",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:443",className:"flex min-w-0 items-center gap-3",children:[e.jsx(ut,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:444",name:a.member?.userName??null,email:a.member?.userEmail,avatarUrl:a.member?.avatarUrl,roleColor:a.member?.editionRoleColor,className:"size-10 rounded-xl"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:451",className:"min-w-0",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:452",className:"truncate text-sm font-semibold text-stone-900",children:a.member?.userName??"Sin nombre"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:455",className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(yt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:456",name:a.member?.entity?.name??null,logoUrl:a.member?.entity?.logoUrl}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:460",className:"truncate text-xs text-stone-500",children:a.member?.entity?.name??a.member?.userEmail})]})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:466",className:"flex items-center gap-2 sm:block",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:467",className:"text-sm font-semibold tabular-nums text-stone-800",children:Ot(a.accreditedAt)}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:470",className:"text-xs text-stone-400 sm:mt-0.5 sm:block",children:a.deskLabel??rt(a.method)}),a.accreditedBy?.name&&e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:474",className:"hidden text-[10px] text-stone-400 sm:mt-0.5 sm:block",children:["por ",a.accreditedBy.name]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:479",className:"flex items-center justify-end gap-1",children:[e.jsx(X,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:480",variant:"outline",className:"hidden w-24 justify-center rounded-full text-xs sm:inline-flex",children:a.badgePrintCount>0?`${a.badgePrintCount} impresa${a.badgePrintCount===1?"":"s"}`:"Sin imprimir"}),e.jsx(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:488",size:"icon-sm",variant:"ghost","aria-label":`Imprimir etiqueta de ${a.member?.userName??"la persona"}`,title:"Imprimir etiqueta",onClick:s,children:e.jsx(zt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:495",className:"size-4","aria-hidden":"true"})}),e.jsx(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:497",size:"sm",variant:"ghost",className:"text-rose-700 hover:bg-rose-50 hover:text-rose-800",disabled:t,onClick:n,children:"Anular"})]})]})}function Ts({target:a}){return e.jsxs("li",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:513",className:"grid gap-3 px-4 py-3 transition-colors hover:bg-[#f8f6f1] sm:grid-cols-[minmax(0,1fr)_10rem] sm:items-center",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:514",className:"flex min-w-0 items-center gap-3",children:[e.jsx(ut,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:515",name:a.userName,email:a.userEmail,avatarUrl:a.avatarUrl,roleColor:a.editionRoleColor,className:"size-9 rounded-xl"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:522",className:"min-w-0",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:523",className:"truncate text-sm font-semibold text-stone-900",children:a.userName??"Sin nombre"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:526",className:"flex items-center gap-1.5",children:[e.jsx(yt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:527",name:a.entity?.name??null,logoUrl:a.entity?.logoUrl}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:531",className:"truncate text-xs text-stone-500",children:a.entity?.name??a.userEmail})]})]})]}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:537",className:"truncate text-xs text-stone-500",children:a.editionRole??a.applicantType??"Sin rol"})]})}function Os({slug:a,view:t}){const s=_s(),[n,o]=g.useState(void 0),[c,i]=g.useState(()=>typeof window>"u"?"":window.localStorage.getItem(`accreditation-desk-label:${a}`)??""),[m,h]=g.useState(""),[b,y]=g.useState(""),[S,l]=g.useState({kind:"idle"}),[x,w]=g.useState("arrived"),[E,C]=g.useState(""),[N,I]=g.useState("recent"),[D,R]=g.useState("all"),[A,se]=g.useState("all"),[M,H]=g.useState(null),[ae,Y]=g.useState(null),W=bs(a,n),J=Tt(a),p=W.data,ye=p?.accreditationDate,
183ne=vs(a,p?.availableDays??[],t==="log");g.useEffect(()=>{if(n!==void 0||!p)return;const{availableDays:r,today:f}=p;if(r.includes(f)){o(f);return}if(r.length===0){o(p.accreditationDate);return}const k=Date.parse(`${f}T00:00:00`),L=[...r].sort((ke,ft)=>{const Ft=Math.abs(Date.parse(`${ke}T00:00:00`)-k),Bt=Math.abs(Date.parse(`${ft}T00:00:00`)-k);return Ft-Bt||(ke>ft?-1:1)})[0];o(L)},[p,n]),g.useEffect(()=>{const r=`accreditation-desk-label:${a}`;c.trim()?window.localStorage.setItem(r,c):window.localStorage.removeItem(r)},[c,a]);const V=js(a,n,c||null),O=ks(a,n,c||null),G=Ps(a,n),z=Ns(a,n),U=m.trim().startsWith($s),ee=Ss(a,n,U?"":m),Se=g.useMemo(()=>(ee.data?.results??[]).filter(r=>r.hasEntryPass),[ee.data?.results]),oe=V.isPending||O.isPending||S.kind!=="idle",pe=g.useCallback((r,f)=>{if(r.blocked){l({kind:"blocked",message:r.message,member:r.member}),s("error");return}l({kind:"ok",accreditation:r.accreditation,alreadyAccredited:r.alreadyAccredited}),f?.preserveSearch||h(""),y(""),s(r.alreadyAccredited?"warn":"ok")},[s]),je=g.useCallback(r=>{V.isPending||O.isPending||V.mutate(r,{onSuccess:f=>pe(f)})},[O.isPending,pe,V]);function fe(){const r=m.trim();!r||!U||(je(r),h(""))}async function ce(r){!p||ae||G.isPending||(await hs({accreditation:r,editionName:p.edition.name,widthMm:p.badgeWidthMm,heightMm:p.badgeHeightMm,showPhoto:p.badgeShowPhoto}),Y(r))}const K=g.useMemo(()=>{const r=new Set((p?.accreditations??[]).map(f=>f.editionMembershipId));return(J.data?.targets??[]).filter(f=>f.entryPass?.status==="issued"&&!r.has(f.membershipId))},[p?.accreditations,J.data?.targets]),ge=g.useMemo(()=>{const r=(p?.accreditations??[]).filter(f=>{const k=A==="all"?!0:A===Te?!f.member?.entity:f.member?.entity?.id===A,L=D==="all"||D==="printed"&&f.badgePrintCount>0||D==="unprinted"&&f.badgePrintCount===0;return k&&L&&Dt({userName:f.member?.userName??null,userEmail:f.member?.userEmail??null,entity:f.member?.entity??null,editionRole:f.member?.editionRole??null,additionalSearchTerms:[f.deskLabel,f.accreditedBy?.name,f.accreditedBy?.email,rt(f.method)]},E)});return Is(r,N)},[p?.accreditations,A,D,E,N]),d=g.useMemo(()=>Ms(K.filter(r=>(A==="all"?!0:A===Te?!r.entity:r.entity?.id===A)&&Dt(r,E)),N),[A,E,N,K]),v=g.useMemo(()=>{const r=new Map,f=k=>{k?.id&&k.name&&r.set(k.id,k.name)};for(const k of p?.accreditations??[])f(k.member?.entity);for(const k of K)f(k.entity);return[...r.entries()].sort((k,L)=>k[1].localeCompare(L[1],"es",{sensitivity:"base"}))},[p?.accreditations,K]),j=x==="arrived"?N==="recent":N==="nameAsc",q=!!E.trim()||!j||A!=="all"||x==="arrived"&&D!=="all",_=g.useMemo(()=>{if(!p)return null;const f=[["Nombre","Email","Entidad","Rol","Hora","Método","Puesto","Impreso"],...p.accreditations.map(k=>[k.member?.userName??"",k.member?.userEmail??"",k.member?.entity?.name??"",k.member?.editionRole??"",Ot(k.accreditedAt),rt(k.method),k.deskLabel??"",k.badgePrintCount>0?"sÃ":"no"])].map(k=>k.map(L=>`"${String(L).replace(/"/g,'""')}"`).join(",")).join(` 184`);return`data:text/csv;charset=utf-8,${encodeURIComponent(f)}`},[p]),Me=p?J.isSuccess?p.summary.accreditedCount+K.length:p.summary.expectedCount:0,Le=p&&Me>0?Math.round(p.summary.accreditedCount/Me*100):0,qt=Math.max(1,...p?.byRole.map(r=>r.count)??[1]);return W.isLoading&&!p?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:837",className:"space-y-4",role:"status","aria-label":"Cargando mostrador",children:[e.jsx(F,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:838",className:"h-16 rounded-xl"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:839",className:"grid gap-4 lg:grid-cols-[380px_1fr]",children:[e.jsx(F,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:840",className:"aspect-[4/3] rounded-xl"}),e.jsx(F,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:841",className:"h-[340px] rounded-xl"})]})]}):W.isError||!p?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:849",className:"rounded-xl border border-rose-200 bg-rose-50 p-6",role:"alert",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:853",className:"font-semibold text-rose-900",children:"No se ha podido abrir el mostrador"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:856",className:"mt-1 text-sm text-rose-700",children:"No podemos determinar el dÃa operativo ni cargar las acreditaciones."}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:859",variant:"outline",className:"mt-4 border-rose-300 bg-white",onClick:()=>void W.refetch(),children:[e.jsx(he,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:864",className:"size-4","aria-hidden":"true"}),"Reintentar"]})]}):e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:872",className:"space-y-4",children:[e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:873",className:"overflow-hidden rounded-xl border border-[#d8d5c9] bg-[#fffefa]","aria-label":"DÃa de acreditación",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:877",className:"flex flex-wrap items-center gap-x-4 gap-y-3 px-4 py-3 sm:px-5",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:878",className:"flex shrink-0 items-center gap-2.5",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:879",className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-[#185428] text-white",children:e.jsx(Gt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:880",className:"size-4","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:882",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:883",className:"text-[10px] font-bold uppercase tracking-[0.14em] text-[#185428]",children:"Calendario operativo"}),e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:886",className:"text-xs text-stone-500",children:[p.availableDays.length," ",p.availableDays.length===1?"jornada":"jornadas"]})]})]}),e.jsx(Rs,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:893",days:p.availableDays,activeDay:ye??p.accreditationDate,today:p.today,onChange:r=>{o(r),l({kind:"idle"})}}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:903",className:"ml-auto flex flex-wrap items-center gap-2",children:[e.jsxs(X,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:904",variant:"outline",className:"rounded-full border-emerald-200 bg-emerald-50 px-3 py-1 text-emerald-800",children:[e.jsx(Ne,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:908",className:"size-3.5","aria-hidden":"true"}),p.summary.accreditedCount," de ",Me," ","acreditados"]}),t==="desk"&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:913",className:"flex items-center gap-2 rounded-lg border border-stone-200 bg-white px-2.5 py-1",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:914",htmlFor:"desk-label",className:"text-xs font-semibold text-stone-600",children:"Puesto"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:920",id:"desk-label",className:"h-7 w-[130px] border-0 bg-transparent px-1 shadow-none focus-visible:ring-0",placeholder:"Mostrador 1",value:c,onChange:r=>i(r.target.value)})]}),t==="log"&&_&&e.jsx(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:930",size:"sm",variant:"outline",asChild:!0,children:e.jsxs("a",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:931",href:_,download:`acreditaciones-${ye??"dia"}.csv`,children:[e.jsx(Yt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:935",className:"size-3.5","aria-hidden":"true"}),"Exportar CSV"]})})]})]}),p.accreditationDate!==p.today&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:944",className:"flex items-center gap-2 border-t border-amber-200 bg-amber-50 px-4 py-2 text-xs text-amber-900 sm:px-5",role:"alert",children:[e.jsx(Jt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:948",className:"size-3.5 shrink-0","aria-hidden":"true"}),e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:949",children:[e.jsx("strong",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:950",children:"Atención:"})," estás acreditando para"," ",wt(p.accreditationDate,!0),", no para hoy. Las nuevas llegadas se guardarán en ese dÃa."]})]})]}),t==="desk"?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:959",className:"grid gap-4 lg:grid-cols-[minmax(0,1.15fr)_minmax(340px,0.85fr)] lg:items-start",children:[e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:960",className:"flex min-h-0 flex-col overflow-hidden rounded-xl border border-[#d8d5c9] bg-[#fffefa]",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:961",className:"border-b border-stone-200 bg-[#f8f6f1] p-4 sm:p-5",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:962",className:"flex items-start gap-3",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:963",className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-[#185428] text-white",children:e.jsx(Pe,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:964",className:"size-5","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:966",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:967",className:"text-[10px] font-bold uppercase tracking-[0.16em] text-[#185428]",children:"Identificación manual"}),e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:970",className:"mt-1 text-base font-semibold text-stone-900",children:"Busca a la persona"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:973",className:"mt-0.5 text-xs leading-5 text-stone-500",children:"Por nombre, correo o entidad. Selecciona un resultado para validar el acceso."})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:980",className:"mt-4 flex gap-2",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:981",className:"relative flex-1",children:[e.jsx(Pe,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:982",className:"pointer-events-none absolute left-3.5 to
184p-1/2 size-4 -translate-y-1/2 text-stone-400","aria-hidden":"true"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:986",id:"manual-accreditation-search",className:"h-11 bg-white pl-10 text-base",placeholder:"Nombre, correo o entidadâ¦",value:m,onChange:r=>h(r.target.value),onKeyDown:r=>{r.key==="Enter"&&fe()},autoComplete:"off",autoFocus:!0})]}),U&&e.jsx(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1000",className:"h-11",onClick:fe,children:"Validar QR"})]}),p.badgeLabelSource==="custom"&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1007",className:"mt-3 space-y-1.5",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1008",htmlFor:"badge-label-override",className:"text-xs font-semibold text-stone-600",children:"Texto personalizado de la etiqueta"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1014",id:"badge-label-override",className:"bg-white",placeholder:"Ej. Speaker, Jurado, Prensaâ¦",value:b,onChange:r=>y(r.target.value)})]})]}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1027",className:"flex h-[380px] flex-col overflow-hidden",role:"region","aria-label":"Resultados de búsqueda manual",children:m.trim().length<2?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1033",className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1034",className:"flex size-12 items-center justify-center rounded-2xl bg-stone-100 text-stone-500",children:e.jsx(Ne,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1035",className:"size-5","aria-hidden":"true"})}),e.jsx("h3",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1037",className:"mt-3 text-sm font-semibold text-stone-800",children:"Empieza a escribir para buscar"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1040",className:"mt-1 max-w-sm text-xs leading-5 text-stone-500",children:"Con dos caracteres verás coincidencias y podrás acreditar sin que la persona enseñe su QR."})]}):U?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1046",className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1047",className:"flex size-12 items-center justify-center rounded-2xl bg-[#185428]/10 text-[#185428]",children:e.jsx(lt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1048",className:"size-5","aria-hidden":"true"})}),e.jsx("h3",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1050",className:"mt-3 text-sm font-semibold text-stone-800",children:"Contenido QR detectado"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1053",className:"mt-1 max-w-sm text-xs leading-5 text-stone-500",children:"Pulsa «Validar QR» para comprobar esta entrada."})]}):ee.isLoading?e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1058",className:"flex h-full items-center justify-center text-sm text-stone-500",role:"status",children:"Buscando personasâ¦"}):ee.isError?e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1065",className:"p-5 text-sm text-rose-700",role:"alert",children:"No se ha podido completar la búsqueda."}):Se.length===0?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1069",className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[e.jsx(Nt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1070",className:"size-6 text-stone-400","aria-hidden":"true"}),e.jsx("h3",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1074",className:"mt-3 text-sm font-semibold text-stone-800",children:"No hay personas con entrada activa"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1077",className:"mt-1 text-xs text-stone-500",children:"Solo se muestran personas con una entrada QR activa para identificarlas en el mostrador."})]}):e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1083",className:"min-h-0 flex-1 divide-y divide-stone-100 overflow-y-auto",children:Se.map(r=>e.jsx("li",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1086",children:e.jsxs("button",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1087",type:"button",className:"flex w-full items-center justify-between gap-4 px-4 py-3.5 text-left transition-colors hover:bg-stone-50 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-[#55b04d]/45",disabled:O.isPending||V.isPending,onClick:()=>O.mutate({membershipId:r.membershipId,badgeLabelOverride:b.trim()||void 0},{onSuccess:f=>pe(f,{preserveSearch:!0})}),children:[e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1107",className:"flex min-w-0 items-center gap-3",children:[e.jsx(ut,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1108",n
184ame:r.userName,email:r.userEmail,avatarUrl:r.avatarUrl,roleColor:r.editionRoleColor,className:"size-10 rounded-xl"}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1115",className:"min-w-0",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1116",className:"block truncate text-sm font-semibold text-stone-900",children:r.userName??"Sin nombre"}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1119",className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(yt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1120",name:r.entity?.name??null,logoUrl:r.entity?.logoUrl}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1124",className:"truncate text-xs text-stone-500",children:r.entity?.name??r.userEmail})]})]})]}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1130",className:"flex shrink-0 items-center gap-1.5",children:[!r.hasEntryPass&&e.jsx(X,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1132",variant:"outline",className:"rounded-full border-amber-300 bg-amber-50 text-amber-800",children:"Sin entrada"}),r.alreadyAccredited&&e.jsx(X,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1140",className:"rounded-full bg-amber-100 text-amber-800",children:"Ya acreditado"}),e.jsx(es,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1144",className:"size-4 text-stone-400","aria-hidden":"true"})]})]})},r.membershipId))})})]}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1158",className:"h-full",children:e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1159",className:"h-full rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-3 sm:p-4",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1160",className:"mb-3",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1161",className:"text-[10px] font-bold uppercase tracking-[0.16em] text-[#185428]",children:"Escáner"}),e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1164",className:"mt-1 text-sm font-semibold text-stone-900",children:"Lee la entrada con la cámara"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1167",className:"mt-0.5 text-xs text-stone-500",children:"El resultado se abrirá automáticamente al detectar el QR."})]}),e.jsx(fs,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1171",onScan:je,paused:oe})]})})]}):e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1176",className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px] xl:items-start",children:[e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1177",className:"overflow-hidden rounded-xl border border-[#d8d5c9] bg-[#fffefa]",children:[e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1178",className:"border-b border-stone-200 bg-[#f8f6f1] p-3 sm:p-4",children:e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1179",className:"flex flex-col gap-3",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1180",className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1181",className:"inline-flex w-fit rounded-lg border border-stone-200 bg-white p-0.5","aria-label":"Estado de llegada",children:[e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1185",size:"sm",variant:x==="arrived"?"secondary":"ghost",className:"h-8 rounded-md","aria-pressed":x==="arrived",onClick:()=>w("arrived"),children:[e.jsx(Ae,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1192",className:"size-3.5","aria-hidden":"true"}),"Acreditados",e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1194",className:"tabular-nums",children:p.summary.accreditedCount})]}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1198",size:"sm",variant:x==="pending"?"secondary":"ghost",className:"h-8 rounded-md","aria-pressed":x==="pending",onClick:()=>{w("pending"),(N==="recent"||N==="oldest")&&I("nameAsc")},children:[e.jsx(Nt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1210",className:"size-3.5","aria-hidden":"true"}),"Sin llegar",e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1212",className:"tabular-nums",children:K.length})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1218",className:"relative min-w-0 md:w-72",children:[e.jsx(Pe,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1219",className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-stone-400","aria-hidden":"true"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1223",value:E,onChange:r=>C(r.target.value),className:"bg-white pl-9",placeholder:"Buscar nombre, entidad o gestorâ¦","aria-label":"Buscar en el registro del dÃa"})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1233",className:"flex flex-wrap items-center gap-2 border-t border-stone-200 pt-3",children:[e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1234",className:"inline-flex items-center gap-1.5 text-xs font-semibold text-stone-600",children:[e.jsx(ts,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1235",className:"size-3.5","aria-hidden":"true"}),"Filtrar y ordenar"]}),e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1239",value:A,onValueChange:se,children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1243",size:"sm",className:"w-full bg-white sm:w-[210px]","aria-label":"Filtrar por entidad",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1248",placeholder:"Entidad"})}),e.jsxs(me,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1250",children:[e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1251",value:"all",children:"Todas las entidades"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1252",value:Te,children:"Sin entidad"}),v.map(([r,f])=>e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1256",value:r,children:f},r))]})]}),x==="arrived"&&e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1264",value:D,onValueChange:r=>R(r),children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1270",size:"sm",className:"w-full bg-white sm:w-[150px]","aria-label":"Filtrar por impresión",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1275",placeholder:"Impresión"})}),e.jsxs(me,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1277",children:[e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1278",value:"all",children:"Todas las etiquetas"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1279",value:"unprinted",children:"Sin imprimir"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1280",value:"printed",children:"Ya impresas"})]})]}),e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1285",value:N,onValueChange:r=>I(r),children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1289",size:"sm",className:"w-full bg-white sm:w-[175px]","aria-label":"Ordenar registro",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1294",placeholder:"Ordenar"})}),e.jsxs(me,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1296",children:[x==="arrived"&&e.jsxs(e.Fragment,{children:[e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1299",value:"recent",children:e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1300",className:"inline-flex items-center gap-2",children:[e.jsx(rs,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1301",className:"size-3.5","aria-hidden":"true"}),"Más recientes"]})}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1308",value:"oldest",children:e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1309",className:"inline-flex items-center gap-2",children:[e.jsx(ds,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1310",className:"size-3.5","aria-hidden":"true"}),"Más antiguas"]})})]}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1319",value:"nameAsc",children:"Nombre A-Z"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1320",value:"nameDesc",children:"Nombre Z-A"})]})]}),q&&e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1325",size:"sm",variant:"ghost",className:"text-stone-600",onClick:()=>{C(""),I(x==="arrived"?"recent":"nameAsc"),R("all"),se("all")},children:[e.jsx(Rt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1338",className:"size-3.5","aria-hidden":"true"}),"Limpiar"]}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1343",className:"text-xs text-stone-400 sm:ml-auto",children:x==="arrived"?`${ge.length} visibles`:`${d.length} pendientes`})]})]})}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1352",className:"av-view-transition",children:x==="arrived"?ge.length===0?e.jsx(at,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1355",className:"min-h-64 border-0",children:e.jsxs(nt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1356",children:[e.jsx(ot,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1357",variant:"icon",children:e.jsx(gt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1358","aria-hidden":"true"})}),e.jsx(ct,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1360",children:q?"No hay coincidencias":"TodavÃa no hay llegadas"}),e.jsx(it,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1365",children:q?"Prueba con otros filtros o limpia la búsqueda.":"Las acreditaciones aparecerán aquà en cuanto se registren en el mostrador."})]})}):e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1373",className:"divide-y divide-stone-100",children:ge.map(r=>e.jsx(Ls,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1375",entry:r,isPending:z.isPending,onPrint:()=>void ce(r),onRevoke:()=>H(r)},r.id))}):J.isLoading?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1386",className:"space-y-2 p-4",role:"status",children:[e.jsx(F,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1387",className:"h-14"}),e.jsx(F,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1388",className:"h-14"}),e.jsx(F,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1389",className:"h-14"})]}):J.isError?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1392",className:"p-6",role:"alert",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1393",className:"text-sm text-rose-700",children:"No se ha podido calcular quién falta por llegar."}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1396",variant:"outline",size:"sm",className:"mt-3",onClick:()=>void J.refetch(),children:[e.jsx(he,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1402",className:"size-3.5","aria-hidden":"true"}),"Reintentar"]})]}):d.length===0?e.jsx(at,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1407",className:"min-h-64 border-0",children:e.jsxs(nt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1408",children:[e.jsx(ot,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1409",variant:"icon",children:e.jsx(Ae,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1410","aria-hidden":"true"})}),e.jsx(ct,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1412",children:q?"No hay coincidencias":"Todo el mund
184o ha llegado"}),e.jsx(it,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1417",children:q?"Prueba con otros filtros o limpia la búsqueda.":"No quedan personas con entrada activa pendientes de acreditación para este dÃa."})]})}):e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1425",className:"divide-y divide-stone-100",children:d.map(r=>e.jsx(Ts,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1427",target:r},r.membershipId))})},x)]}),e.jsxs("aside",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1434",className:"space-y-4","aria-label":"Resumen del dÃa",children:[e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1435",className:"rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-4",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1436",className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1437",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1438",className:"text-[10px] font-bold uppercase tracking-[0.15em] text-stone-400",children:"Progreso del dÃa"}),e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1441",className:"mt-1 text-2xl font-bold tabular-nums text-stone-900",children:[Le,"%"]})]}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1445",className:"flex size-9 items-center justify-center rounded-lg bg-emerald-50 text-emerald-700",children:e.jsx(Ne,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1446",className:"size-4","aria-hidden":"true"})})]}),e.jsx(Ee,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1449",value:Le,className:"mt-3 h-2.5 bg-stone-200","aria-label":`${Le}% de llegadas registradas`}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1454",className:"mt-3 grid grid-cols-3 gap-2 text-center",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1455",className:"rounded-lg bg-stone-50 px-2 py-2",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1456",className:"text-lg font-bold tabular-nums text-stone-900",children:p.summary.accreditedCount}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1459",className:"text-[10px] text-stone-500",children:"Llegadas"})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1461",className:"rounded-lg bg-stone-50 px-2 py-2",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1462",className:"text-lg font-bold tabular-nums text-stone-900",children:K.length}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1465",className:"text-[10px] text-stone-500",children:"Pendientes"})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1467",className:"rounded-lg bg-stone-50 px-2 py-2",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1468",className:"text-lg font-bold tabular-nums text-stone-900",children:p.summary.printedCount}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1471",className:"text-[10px] text-stone-500",children:"Impresas"})]})]})]}),e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1476",className:"rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-4",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1477",className:"text-sm font-semibold text-stone-900",children:"Llegadas por hora"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1480",className:"mt-0.5 text-xs text-stone-500",children:"Ritmo de acceso durante el dÃa"}),p.byHour.length===0?e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1484",className:"py-8 text-center text-sm text-stone-400",children:"Sin datos todavÃa."}):e.jsx(zs,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1488",data:p.byHour})]}),p.availableDays.length>1&&e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1493",className:"rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-4",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1494",className:"text-sm font-semibold text-stone-900",children:"Comparativa por dÃa"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1497",className:"mt-0.5 text-xs text-stone-500",children:"Llegadas registradas sobre miembros esperados"}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1500",className:"mt-4 space-y-3",children:p.availableDays.map((r,f)=>{const k=ne[f],L=k?.data,ke=L&&L.summary.expectedCount>0?Math.round(L.summary.accreditedCount/L.summary.expectedCount*100):0;return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1513",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1514",className:"mb-1.5 flex items-center justify-between gap-2 text-xs",children:[e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1515",className:B("font-medium",r===ye?"text-[#185428]":"text-stone-600"),children:[wt(r),r===p.today?" · hoy":""]}),k?.isLoading?e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1527",className:"text-stone-400",children:"Cargandoâ¦"}):e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1529",className:"tabular-nums text-stone-500",children:[L?.summary.accreditedCount??0," /"," ",L?.summary.expectedCount??0]})]}),e.jsx(Ee,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1535",value:ke,className:"h-1.5 bg-stone-200"})]},r)})})]}),p.byRole.length>0&&e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1547",className:"rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-4",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1548",className:"text-sm font-semibold text-stone-900",children:"Llegadas por rol"}),e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1551",className:"mt-3 space-y-3",children:p.byRole.map(r=>e.jsxs("li",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1553",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1554",className:"mb-1 flex items-center justify-between gap-2 text-xs",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1555",className:"truncate text-stone-600",children:r.label}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1558",className:"font-semibold tabular-nums text-stone-800",children:r.count})]}),e.jsx(Ee,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1562",value:r.count/qt*100,className:"h-1.5 bg-stone-200"})]},r.label))})]})]})]}),e.jsx(He,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1575",open:t==="desk"&&oe,onOpenChange:r=>{!r&&!V.isPending&&!O.isPending&&(l({kind:"idle"}),window.requestAnimationFrame(()=>document.getElementById("manual-accreditation-search")?.focus()))},children:e.jsxs(Ve,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1586",className:"max-h-[92dvh] gap-0 overflow-y-auto border-0 bg-transparent p-0 shadow-none sm:max-w-3xl",children:[e.jsxs(Ue,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1587",className:"sr-only",children:[e.jsx(Qe,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1588",children:"Resultado de la acreditación"}),e.jsx(We,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1589",children:"Información de la persona, estado del acceso y opción de imprimir la etiqueta."})]}),e.jsx(ys,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1594",state:S,isPending:V.isPending||O.isPending,onPrint:ce,onReset:()=>{l({kind:"idle"}),window.requestAnimationFrame(()=>document.getElementById("manual-accreditation-search")?.focus())}})]})}),e.jsx(Ke,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1608",open:!!ae,onOpenChange:r=>{!r&&!G.isPending&&Y(null)},children:e.jsxs(Ze,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1614",children:[e.jsxs(Xe,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1615",children:[e.jsx(Ye,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1616",children:"¿Se ha impreso la etiqueta?"}),e.jsx(Je,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1617",children:"El navegador no puede saber si has confirmado o cancelado el diálogo de impresión. Registra la impresión solo si la etiqueta ha salido correctamente para que el contador sea fiable."})]}),e.jsxs(et,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1623",children:[e.jsx(tt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1624",disabled:G.isPending,children:"No, no se imprimió"}),e.jsx(st,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1627",disabled:G.isPending,onClick:r=>{r.preventDefault(),ae&&G.mutate(ae.id,{onSuccess:()=>Y(null)})},children:G.isPending?"Registrandoâ¦":"SÃ, registrar impresión"})]})]})}),e.jsx(Ke,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1645",open:!!M,onOpenChange:r=>{!r&&!z.isPending&&H(null)},children:e.jsxs(Ze,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1651",children:[e.jsxs(Xe,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1652",children:[e.jsx(Ye,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1653",children:"¿Anular esta acreditación?"}),e.jsxs(Je,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1654",children:["La llegada de"," ",e.jsx("strong",{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1656",children:M?.member?.userName??"esta persona"})," ","seguirá en el historial, pero dejará de contar como acreditada en este dÃa. Si vuelve a escanearse hoy, el mismo registro
184se reabrirá."]})]}),e.jsxs(et,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1662",children:[e.jsx(tt,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1663",disabled:z.isPending,children:"Conservar acreditación"}),e.jsx(st,{"data-loc":"src/components/gestor/accreditations/AccreditationDeskSection.tsx:1666",className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:z.isPending,onClick:r=>{r.preventDefault(),M&&z.mutate({accreditationId:M.id},{onSuccess:()=>H(null)})},children:z.isPending?"Anulandoâ¦":"SÃ, anular"})]})]})})]})}const At=96/25.4;function qs({data:a}){const t=g.useRef(null),[s,n]=g.useState(0);g.useLayoutEffect(()=>{const m=t.current;if(!m)return;const h=new ResizeObserver(b=>{n(b[0]?.contentRect.width??0)});return h.observe(m),()=>h.disconnect()},[]);const o=a.widthMm*At,c=a.heightMm*At,i=s>0?Math.min(1,s/o):1;return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:57",ref:t,className:"w-full",children:[e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:58",className:"mx-auto transition-[width,height] duration-200 motion-reduce:transition-none",style:{width:o*i,height:c*i},children:e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:65",style:{width:o,height:c,transform:`scale(${i})`,transformOrigin:"top left"},children:e.jsx(us,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:73",className:"rounded-sm bg-white shadow-[0_12px_30px_rgba(28,25,23,0.15)]",data:a})})}),i<.995&&e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:80",className:"mt-3 text-center text-[10px] font-semibold uppercase tracking-[0.1em] text-stone-400",children:["Mostrada al ",Math.round(i*100),"% del tamaño real"]})]})}const Fs=[{key:"autoIssueOnApproval",label:"Activar al aprobar solicitud",desc:"Se genera la entrada cuando se aprueba la participación",tooltip:"Activa esto si quieres emitir el pase QR en el momento en que el gestor aprueba una solicitud de participación."},{key:"autoIssueOnPayment",label:"Activar al confirmar pago",desc:"Se genera la entrada cuando el pago es confirmado",tooltip:"Ãtil para eventos de pago. La entrada se activa en cuanto el sistema registra el pago confirmado."},{key:"autoSendOnIssue",label:"Enviar por email al activar",desc:"El miembro recibe su QR automáticamente",tooltip:"Cuando una entrada se activa automáticamente, se encola también el email con el QR para el asistente."}],Bs=[{value:"edition_role",label:"Rol de edición",desc:"Speaker, Jurado, Startup⦠con su color"},{value:"applicant_type",label:"Tipo de participante",desc:"startup / inversor / asistente en esta edición"},{value:"custom",label:"Manual",desc:"Se escribe a mano en el mostrador"}],Hs=[{label:"Compacta",description:"62 à 29 mm",width:62,height:29},{label:"Estándar",description:"62 à 40 mm",width:62,height:40},{label:"Apaisada",description:"100 à 50 mm",width:100,height:50}],qe={id:"preview",editionMembershipId:"preview",entryPassId:null,accreditationDate:new Date().toISOString().slice(0,10),accreditedAt:new Date().toISOString(),accreditedByUserId:null,accreditedBy:null,method:"qr",deskLabel:null,notes:null,badgeLabel:null,badgeLabelOverride:null,badgePrintedAt:null,badgePrintCount:0,revokedAt:null,member:{membershipId:"preview",userId:"preview",userName:"Laura MartÃnez",userEmail:"[email protected]",avatarUrl:null,editionRole:"Startup",editionRoleColor:"#25543b",applicantType:"startup",entity:{id:"preview",name:"Fintech Solutions SL",type:"startup",logoUrl:null}}};function Vs({editionName:a,settings:t,summary:s,isLoading:n,onUpdateSettings:o,isPending:c}){return n||!t?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:220",className:"space-y-3",children:[e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:221",className:"h-5 w-40 animate-pulse rounded bg-stone-100"}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:222",className:"h-24 animate-pulse rounded bg-stone-100"})]}):e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:228",className:"grid gap-5 pt-6 lg:grid-cols-[minmax(0,1fr)_minmax(360px,440px)] lg:items-start",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:229",className:"space-y-5",children:[e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:230",className:"rounded-2xl border border-stone-200 bg-white p-5","aria-labelledby":"automatic-entry-rules",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:234",className:"flex items-start gap-3",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:235",className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#185428]/10 text-[#185428]",children:e.jsx(ht,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:236",className:"size-4","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:238",className:"min-w-0",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:239",id:"automatic-entry-rules",className:"text-sm font-semibold text-stone-900",children:"Activación y envÃo del QR"}),e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:245",className:"mt-0.5 text-xs leading-5 text-stone-500",children:["Elige qué acciones debe realizar la plataforma sin intervención del equipo gestor.",s&&` Ahora mismo: ${s.issuedCount} activas, ${s.notIssuedCount} sin activar y ${s.revokedCount} revocadas.`]})]})]}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:254",className:"mt-4 space-y-2",children:Fs.map(i=>e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:256",className:"flex items-start justify-between gap-4 roun
184ded-xl border border-stone-200 px-4 py-3.5",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:260",className:"min-w-0",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:261",className:"flex items-center gap-1.5",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:262",htmlFor:`entry-rule-${i.key}`,className:"text-sm font-medium text-stone-800",children:i.label}),e.jsxs(bt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:268",children:[e.jsx(vt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:269",asChild:!0,children:e.jsx("button",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:270",type:"button",className:"rounded-full text-stone-400 hover:text-stone-600 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-[#55b04d]/45","aria-label":`Ayuda sobre ${i.label}`,children:e.jsx(kt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:275",className:"size-3.5","aria-hidden":"true"})})}),e.jsx(St,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:278",className:"max-w-xs",children:i.tooltip})]})]}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:283",className:"mt-0.5 text-xs leading-5 text-stone-500",children:i.desc})]}),e.jsx(jt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:287",id:`entry-rule-${i.key}`,checked:t[i.key],disabled:c,onCheckedChange:m=>o({[i.key]:m})})]},i.key))})]}),e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:300",className:"rounded-2xl border border-stone-200 bg-white p-5","aria-labelledby":"printed-badge-rules",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:304",className:"flex items-start gap-3",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:305",className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#185428]/10 text-[#185428]",children:e.jsx(Ge,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:306",className:"size-4","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:308",className:"min-w-0",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:309",id:"printed-badge-rules",className:"text-sm font-semibold text-stone-900",children:"Contenido y formato de la etiqueta"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:315",className:"mt-0.5 text-xs leading-5 text-stone-500",children:"Configura la etiqueta diaria que se imprime al acreditar a una persona. La vista previa se actualiza al instante."})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:322",className:"mt-5 space-y-5",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:323",className:"space-y-1.5",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:324",htmlFor:"badge-label-source",className:"text-xs font-semibold text-stone-600",children:"Texto identificativo"}),e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:330",value:t.badgeLabelSource,disabled:c,onValueChange:i=>o({badgeLabelSource:i}),children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:339",id:"badge-label-source",className:"bg-white",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:340"})}),e.jsx(me,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:342",children:Bs.map(i=>e.jsxs($,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:344",value:i.value,children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:345",className:"font-medium",children:i.label}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:346",className:"ml-2 text-xs text-stone-500",children:i.desc})]},i.value))})]}),t.badgeLabelSource==="custom"&&e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:354",className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-800",children:"El texto se pedirá en la búsqueda manual del mostrador antes de acreditar a cada persona."})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:361",className:"flex items-start justify-between gap-4 roun
184ded-xl border border-stone-200 bg-stone-50/70 p-4",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:362",className:"min-w-0",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:363",className:"flex items-center gap-1.5",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:364",htmlFor:"badge-show-photo",className:"text-sm font-medium text-stone-800",children:"Incluir foto y logo"}),e.jsxs(bt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:370",children:[e.jsx(vt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:371",asChild:!0,children:e.jsx("button",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:372",type:"button",className:"rounded-full text-stone-400 hover:text-stone-600 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-[#55b04d]/45","aria-label":"Ayuda sobre foto y logo",children:e.jsx(kt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:377",className:"size-3.5","aria-hidden":"true"})})}),e.jsx(St,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:380",className:"max-w-xs",children:"DesactÃvalo para impresoras térmicas monocromas. La etiqueta no sustituirá la foto por un bloque de color."})]})]}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:386",className:"mt-0.5 text-xs leading-5 text-stone-500",children:"DesactÃvalo si necesitas una etiqueta más limpia o monocromática."})]}),e.jsx(jt,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:391",id:"badge-show-photo",checked:t.badgeShowPhoto,disabled:c,onCheckedChange:i=>o({badgeShowPhoto:i})})]}),e.jsx(ss,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:401"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:403",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:404",className:"text-xs font-semibold text-stone-600",children:"Tamaño de impresión"}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:407",className:"mt-2 grid gap-2 sm:grid-cols-3",children:Hs.map(i=>{const m=t.badgeWidthMm===i.width&&t.badgeHeightMm===i.height;return e.jsx(P,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:413",type:"button",variant:m?"secondary":"outline",className:"h-auto justify-start px-3 py-2.5 text-left",disabled:c,"aria-pressed":m,onClick:()=>o({badgeWidthMm:i.width,badgeHeightMm:i.height}),children:e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:427",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:428",className:"block text-xs font-semibold",children:i.label}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:431",className:"block text-[10px] font-normal text-stone-500",children:i.description})]})},i.label)})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:440",className:"mt-3 grid grid-cols-2 gap-3",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:441",className:"space-y-1.5",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:442",htmlFor:"badge-width",className:"text-xs text-stone-500",children:"Ancho personalizado (mm)"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:448",id:"badge-width",type:"number",min:20,max:210,defaultValue:t.badgeWidthMm,disabled:c,className:"bg-white",onBlur:i=>{const m=Number(i.target.value);m&&m!==t.badgeWidthMm&&o({badgeWidthMm:m})}},t.badgeWidthMm)]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:465",className:"space-y-1.5",children:[e.jsx(Z,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:466",htmlFor:"badge-height",className:"text-xs text-stone-500",children:"Alto personalizado (mm)"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:472",id:"badge-height",type:"number",min:15,max:297,defaultValue:t.badgeHeightMm,disabled:c,
184className:"bg-white",onBlur:i=>{const m=Number(i.target.value);m&&m!==t.badgeHeightMm&&o({badgeHeightMm:m})}},t.badgeHeightMm)]})]})]})]})]})]}),e.jsx("aside",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:495",className:"lg:sticky lg:top-6","aria-label":"Vista previa",children:e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:496",className:"rounded-2xl border border-[#185428]/20 bg-[#eef3ec] p-4 sm:p-5",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:497",className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:498",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:499",className:"text-sm font-semibold text-stone-900",children:"Vista previa"}),e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:502",className:"mt-0.5 text-xs leading-5 text-stone-500",children:["Etiqueta de ",t.badgeWidthMm," à ",t.badgeHeightMm," ","mm"]})]}),e.jsx(X,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:507",className:"rounded-full bg-white text-[#185428]",children:"Impresión"})]}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:511",className:"mt-4 flex min-h-56 items-center justify-center rounded-xl border border-white/80 bg-white/70 p-4 sm:p-5",children:e.jsx(qs,{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:512",data:{accreditation:{...qe,badgeLabel:t.badgeLabelSource==="edition_role"?qe.member.editionRole:t.badgeLabelSource==="applicant_type"?qe.member.applicantType:null},editionName:a??"Tu edición",widthMm:t.badgeWidthMm,heightMm:t.badgeHeightMm,showPhoto:t.badgeShowPhoto}})}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassSettingsPanel.tsx:530",className:"mt-3 text-xs leading-5 text-stone-500",children:"La impresión respeta las medidas reales configuradas; aquà se ajusta al ancho disponible. Los cambios se guardan automáticamente al seleccionar cada opción."})]})})]})}function we(a){return!a.entryPass||a.entryPass.status==="expired"?"none":a.entryPass.status==="issued"?"issued":"revoked"}const De={issued:{label:"Activa",className:"border-emerald-200 bg-emerald-50 text-emerald-800"},revoked:{label:"Revocada",className:"border-rose-200 bg-rose-50 text-rose-700"},none:{label:"Sin activar",className:"border-stone-200 bg-stone-100 text-stone-600"}},Ct={issued:"Entrada activada",reissued:"Entrada reactivada con un QR nuevo",sent:"Entrada enviada por email",revoked:"Entrada revocada",expired:"Entrada caducada",linked_accreditation:"Vinculada a una acreditación"},Us={manual:"Activación manual",approval:"Aprobación de solicitud",accreditation:"Acreditación",payment:"Confirmación de pago"};function Fe(a){return a?new Date(a).toLocaleString("es-ES",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Sin fecha"}function Qs({entryPass:a}){if(!a)return e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:128",className:"p-6 text-sm text-stone-500",children:"No se ha podido cargar el detalle de esta entrada."});const t=a.status==="issued"?De.issued:a.status==="revoked"?De.revoked:De.none;return e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:142",className:"px-5 pb-8 sm:px-6",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:143",className:"flex items-center gap-3 border-b border-stone-200 py-5",children:[e.jsxs(mt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:144",className:"size-11 rounded-xl",children:[a.member.avatarUrl&&e.jsx(xt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:146",src:a.member.avatarUrl,alt:""}),e.jsx(pt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:148",className:"rounded-xl bg-[#185428] text-sm font-bold text-white",children:(a.member.userName??a.member.userEmail??"?").trim().charAt(0).toUpperCase()})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:155",className:"min-w-0",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:156",className:"truncate text-sm font-semibold text-stone-900",children:a.member.userName??"Sin nombre"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:159",className:"flex min-w-0 items-center gap-1.5 text-xs text-stone-500",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:160",className:"flex size-5 shrink-0 items-center justify-center overflow-hidden rounded border border-stone-200 bg-stone-50",children:a.member.entity?.logoUrl?e.jsx("img",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:162",src:a.member.entity.logoUrl,alt:"",className:"size-full object-contain"}):e.jsx(be,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:168",className:"size-3","aria-hidden":"true"})}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:171",className:"truncate",children:a.member.entity?.name??a.member.userEmail??"Sin entidad"})]})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:179",className:"grid gap-3 pt-5 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:180",className:"rounded-xl border border-stone-200 bg-stone-50 p-4",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:181",className:"text-[10px] font-bold uppercase tracking-[0.14em] text-stone-400",children:"Estado actual"}),e.jsx(X,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:184",variant:"outline",className:B("mt-2 rounded-full",t.className),children:t.label})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:191",className:"rounded-xl border border-stone-200 bg-stone-50 p-4",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:192",className:"text-[10px] font-bold uppercase tracking-[0.14em] text-stone-400",children:"Origen"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:195",className:"mt-2 text-sm font-medium text-stone-800",children:Us[a.source]??a.source})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:199",className:"rounded-xl border border-stone-200 bg-stone-50 p-4",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:200",className:"text-[10px] font-bold uppercase tracking-[0.14em] text-stone-400",children:"Activada"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:203",className:"mt-2 text-sm text-stone-700",children:Fe(a.issuedAt)})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:207",className:"rounded-xl border border-stone-200 bg-stone-50 p-4",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:208",className:"text-[10px] font-bold uppercase tracking-[0.14em] text-stone-400",children:"EnvÃos"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:211",className:"mt-2 text-sm text-stone-700",children:a.sendCount===0?"TodavÃa no se ha enviado":`${a.sendCount} envÃo${a.sendCount===1?"":"s"} · ${Fe(a.lastSentAt)}`})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:219",className:"mt-5 rounded-xl border border-stone-200 p-5",children:[e.jsx("h3",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:220",className:"text-sm font-semibold text-stone-900",children:"Historial completo"}),a.history.length===0?e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:224",className:"mt-3 text-sm text-stone-500",children:"No hay movimientos registrados."}):e.jsx("ol",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:228",className:"relative mt-4 space-y-5 border-l border-stone-200 pl-5",children:a.history.map(s=>e.jsxs("li",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:230",className:"relative",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:231",className:B("absolute -left-[1.58rem] top-0.5 size-3 rounded-full border-2 border-white",s.eventType==="revoked"?"bg-rose-500":s.eventType==="sent"?"bg-blue-500":"bg-emerald-500"),"aria-hidden":"true"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:242",className:"text-sm font-medium text-stone-800",children:Ct[s.eventType]??s.summary??s.eventType}),s.summary&&s.summary!==Ct[s.eventType]&&e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:249",className:"mt-0.5 text-xs leading-5 text-stone-500",children:s.summary}),e.jsxs("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:253",className:"mt-1 text-xs text-stone-400",children:[Fe(s.createdAt),s.actorName?` · ${s.actorName}`:""]})]},s.id))})]})]})}function Ws({target:a,selected:t,mutationsPending:s,onSelect:n,onActivate:o,onSend:c,onRevoke:i,onHistory:m}){const h=we(a),b=De[h],y=(a.userName??a.userEmail??"?").trim().charAt(0).toUpperCase();return e.jsxs("li",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:293",className:"grid grid-cols-[2.25rem_minmax(0,1fr)] gap-x-3 gap-y-3 px-4 py-3.5 transition-colors hover:bg-stone-50/70 lg:grid-cols-[2.25rem_minmax(260px,1.2fr)_minmax(180px,0.8fr)_7.5rem_19rem] lg:items-center",children:[e.jsx(dt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:294",checked:t,onCheckedChange:n,"aria-label":`Seleccionar ${a.userName??a.userEmail??"miembro"}`,className:"mt-1 lg:mt-0"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:301",className:"flex min-w-0 items-center gap-3",children:[e.jsxs(mt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:302",className:"size-10 shrink-0 rounded-xl",children:[a.avatarUrl&&e.jsx(xt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:303",src:a.avatarUrl,alt:""}),e.jsx(pt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:304",className:"rounded-xl text-xs font-bold text-white",style:{backgroundColor:a.editionRoleColor??"#78716c"},children:y})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:311",className:"min-w-0",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:312",className:"truncate text-sm font-semibold text-stone-900",children:a.userName??"Sin nombre"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:315",className:"truncate text-xs text-stone-500",children:a.userEmail})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:319",className:"col-start-2 min-w-0 lg:col-start-auto",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:320",className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:321",className:"flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-stone-200 bg-stone-50 text-stone-400",children:a.entity?.logoUrl?e.jsx("img",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:323",src:a.entity.logoUrl,alt:"",className:"size-full object-contain"}):e.jsx(be,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:329",className:"size-3.5","aria-hidden":"true"})}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:332",className:"truncate text-sm text-stone-700",children:a.entity?.name??"Sin entidad"})]}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:336",className:"truncate text-xs text-stone-400",children:a.editionRole??a.applicantType??"Sin rol asignado"})]}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:341",className:"col-start-2 lg:col-start-auto",children:e.jsx(X,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:342",variant:"outline",className:B("rounded-full",b.className),children:b.label})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:350",className:"col-start-2 flex flex-wrap items-center gap-1 lg:col-start-auto lg:grid lg:grid-cols-[7.5rem_6.75rem_4.5rem] lg:justify-end lg:justify-items-stretch",children:[a.entryPass?e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:352",size:"sm",variant:"ghost","aria-label":`Ver historial de ${a.userName??"la entrada"}`,onClick:m,children:[e.jsx(gt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:358",className:"size-4","aria-hidden":"true"}),"Ver historial"]}):e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:362",className:"hidden lg:block","aria-hidden":"true"}),h==="issued"?e.jsxs(e.Fragment,{children:[e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:366",size:"sm",variant:"outline",disabled:s,onClick:c,children:[e.jsx(It,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:372",className:"size-3.5","aria-hidden":"true"}),a.entryPass.sendCount>0?"Reenviar":"Enviar"]}),e.jsx(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:375",size:"sm",variant:"ghost",className:"text-rose-700 hover:bg-rose-50 hover:text-rose-800",disabled:s,onClick:i,children:"Revocar"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:387",size:"sm",disabled:s,onClick:o,children:[e.jsx(ht,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:388",className:"size-3.5","aria-hidden":"true"}),h==="revoked"?"Reactivar":"Activar"]}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:391",className:"hidden lg:block","aria-hidden":"true"})]})]})]})}function Gs({slug:a}){const[t,s]=g.useState(""),[n,o]=g.useState("none"),[c,i]=g.useState("all"),[m,h]=g.useState("people"),[b,y]=g.useState(new Set),[S,l]=g.useState(new Set),[x,w]=g.useState(!1),[E,C]=g.useState(null),[N,I]=g.useState(null),[D,R]=g.useState(null),A=Tt(a
184),se=Es(a,!!E),M=ws(a),H=Ds(a),ae=As(a),Y=Cs(a),W=g.useMemo(()=>A.data?.targets??[],[A.data?.targets]),J=g.useMemo(()=>{const d=new Map;for(const v of W)v.entity?.id&&d.set(v.entity.id,v.entity.name??"â");return[...d.entries()].sort((v,j)=>v[1].localeCompare(j[1]))},[W]),p=g.useMemo(()=>{const d=t.trim().toLowerCase();return W.filter(v=>n!=="all"&&we(v)!==n||c!=="all"&&v.entity?.id!==c?!1:d?[v.userName,v.userEmail,v.entity?.name,v.editionRole].filter(Boolean).some(j=>j.toLowerCase().includes(d)):!0)},[W,t,n,c]),ye=g.useMemo(()=>{const d=new Map;for(const v of p){const j=v.entity?.id??"without-entity",q=v.entity?.name??"Sin entidad",_=d.get(j)??{id:j,name:q,entity:v.entity,targets:[]};_.targets.push(v),d.set(j,_)}return[...d.values()].sort((v,j)=>v.name.localeCompare(j.name))},[p]),ne=g.useMemo(()=>p.map(d=>d.membershipId),[p]),V=ne.filter(d=>S.has(d)).length,O=ne.length>0&&V===ne.length,G=V>0&&!O,z=A.data?.summary,U=z&&z.totalMembers>0?Math.round(z.issuedCount/z.totalMembers*100):0,ee=t.trim()!==""||n!=="all"||c!=="all",Se=M.isPending||H.isPending||ae.isPending,oe=se.data?.entryPasses.find(d=>d.id===E)??null;function pe(){l(d=>{const v=new Set(d);if(O)for(const j of ne)v.delete(j);else for(const j of ne)v.add(j);return v})}function je(d){l(v=>{const j=new Set(v);return j.has(d)?j.delete(d):j.add(d),j})}function fe(d){y(v=>{const j=new Set(v);return j.has(d)?j.delete(d):j.add(d),j})}function ce(d,v,j){R(j),M.mutate({membershipIds:d,send:v},{onSuccess:()=>l(new Set),onSettled:()=>R(null)})}function K(){s(""),o("all"),i("all")}function ge(d){return e.jsx(Ws,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:558",target:d,selected:S.has(d.membershipId),mutationsPending:Se,onSelect:()=>je(d.membershipId),onActivate:()=>ce([d.membershipId],void 0,`Activando la entrada de ${d.userName??"1 persona"}â¦`),onSend:()=>ae.mutate(d.entryPass.id),onRevoke:()=>I(d),onHistory:()=>C(d.entryPass.id)},d.membershipId)}return A.isLoading?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:580",className:"space-y-4",role:"status","aria-label":"Cargando entradas",children:[e.jsx(F,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:581",className:"h-32 rounded-xl"}),e.jsx(F,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:582",className:"h-16 rounded-xl"}),e.jsx(F,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:583",className:"h-80 rounded-xl"})]}):A.isError?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:590",className:"rounded-xl border border-rose-200 bg-rose-50 p-6",role:"alert",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:594",className:"font-semibold text-rose-900",children:"No se han podido cargar las entradas"}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:597",className:"mt-1 text-sm text-rose-700",children:"Revisa la conexión y vuelve a intentarlo."}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:600",variant:"outline",className:"mt-4 border-rose-300 bg-white",onClick:()=>void A.refetch(),children:[e.jsx(he,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:605",className:"size-4","aria-hidden":"true"}),"Reintentar"]})]}):e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:613",className:"space-y-4",children:[e.jsx("section",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:614",className:"rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-4 sm:p-5","aria-labelledby":"entry-readiness-title",children:e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:618",className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:619",className:"min-w-0 flex-1",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:620",className:"flex flex-wrap items-center gap-2",children:[e.jsx("h2",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:621",id:"entry-readiness-title",className:"text-base font-semibold text-stone-900",children:"Preparación antes del evento"}),e.jsx(X,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:627",variant:"outline",className:B("rounded-full",U===100?"border-emerald-200 bg-emerald-50 text-emerald-800":"border-amber-200 bg-amber-50 text-amber-800"),children:U===100?"Todo preparado":`${U}% listo`})]}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:639",className:"mt-1 text-sm text-stone-500",children:"Activa y envÃa el QR permanente. La acreditación diaria se registra después, cuando la persona llega a puerta."}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:643",className:"mt-4 flex items-center gap-3",children:[e.jsx(Ee,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:644",value:U,className:"h-2.5 max-w-xl bg-stone-200","aria-label":`${U}% de entradas activas`}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:649",className:"shrink-0 text-sm font-semibold tabular-nums text-stone-800",children:[z?.issuedCount??0," / ",z?.totalMembers??0]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:653",className:"mt-3 flex flex-wrap gap-x-5 gap-y-1 text-xs text-stone-500",children:[e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:654",children:[e.jsx("strong",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:655",className:"font-semibold text-stone-800",children:z?.notIssuedCount??0})," ","sin activar"]}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:660",children:[e.jsx("strong",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:661",className:"font-semibold text-rose-700",children:z?.revokedCount??0})," ","revocadas"]})]})]}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:668",variant:"outline",className:"shrink-0",onClick:()=>w(!0),children:[e.jsx(Pt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:673",className:"size-4","aria-hidden":"true"}),"Reglas y etiqueta"]})]})}),M.isPending&&D&&S.size===0&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:680",className:"flex items-center gap-3 rounded-xl border border-blue-200 bg-blue-50 px-4 py-3 text-sm text-blue-900",role:"status","aria-live":"polite",children:[e.jsx(he,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:685",className:"size-4 shrink-0 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:689",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:690",className:"font-semibold",children:D}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:691",className:"mt-0.5 text-xs text-blue-700",children:"Mantén esta página abierta hasta que termine la operación."})]})]}),e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:698",className:"overflow-hidden rounded-xl border border-[#d8d5c9] bg-[#fffefa]",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:699",className:"border-b border-stone-200 bg-[#f8f6f1] p-3 sm:p-4",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:700",className:"flex flex-col gap-3 xl:flex-row xl:items-center",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:701",className:"relative min-w-[220px] flex-1",children:[e.jsx(Pe,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:702",className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-stone-400","aria-hidden":"true"}),e.jsx(ie,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:706",className:"bg-white pl-9","aria-label":"Buscar miembros",placeholder:"Buscar por nombre, correo o entidadâ¦",value:t,onChange:d=>s(d.target.value)})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:714",className:"flex flex-wrap gap-2",children:[e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:715",value:n,onValueChange:d=>o(d),children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:721",className:"w-[178px] bg-white","aria-label":"Filtrar por estado",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:725"})}),e.jsxs(me,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:727",children:[e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:728",value:"all",children:"Todos los estados"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:729",value:"none",children:"Sin activar"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:730",value:"issued",children:"Activa"}),e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:731",value:"revoked",children:"Revocada"})]})]}),e.jsxs(re,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:734",value:c,onValueChange:i,children:[e.jsx(de,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:738",className:"w-[220px] bg-white","aria-label":"Filtrar por entidad",children:e.jsx(le,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:742",placeholder:"Entidad"})}),e.jsxs(me,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:744",children:[e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:745",value:"all",children:"Todas las entidades"}),J.map(([d,v])=>e.jsx($,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:747",value:d,children:v},d))]})]}),ee&&e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:754",variant:"ghost",size:"sm",onClick:K,children:[e.jsx(Rt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:755",className:"size-3.5","aria-hidden":"true"}),t.trim()===""&&c==="all"&&n==="none"?"Ver todos":"Limpiar filtros"]})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:766",className:"mt-3 flex flex-wrap items-center justify-between gap-2 border-t border-stone-200 pt-3",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:767",className:"flex items-center gap-2",children:[m==="entities"&&e.jsx(dt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:769",checked:O?!0:G?"indeterminate":!1,onCheckedChange:pe,"aria-label":"Seleccionar todos los resultados visibles"}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:777",className:"text-xs text-stone-500",children:[p.length," resultado",p.length===1?"":"s",n==="none"&&" sin activar"]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:782",className:"inline-flex rounded-lg border border-stone-200 bg-white p-0.5","aria-label":"Agrupar listado",children:[e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:786",size:"sm",variant:m==="people"?"secondary":"ghost",className:"h-7 rounded-md px-2.5 text-xs","aria-pressed":m==="people",onClick:()=>h("people"),children:[e.jsx(as,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:793",className:"size-3.5","aria-hidden":"true"}),"Personas"]}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:796",size:"sm",variant:m==="entities"?"secondary":"ghost",className:"h-7 rounded-md px-2.5 text-xs","aria-pressed":m==="entities",onClick:()=>h("entities"),children:[e.jsx(be,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:803",className:"size-3.5","aria-hidden":"true"}),"Entidades"]})]})]})]}),p.length===0?e.jsx(at,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:811",className:"min-h-64 border-0",children:e.jsxs(nt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:812",children:[e.jsx(ot,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:813",variant:"icon",children:e.jsx(ns,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:814","aria-hidden":"true"})}),e.jsx(ct,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:816",children:n==="none"&&t.trim()===""&&c==="all"?"No quedan entradas por activar":ee?"Sin coincidencias":"TodavÃa no hay miembros"}),e.jsx(it,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:825",children:n==="none"&&t.trim()===""&&c==="all"?"Todas las personas disponibles ya tienen una entrada activa o revocada.":ee?"Prueba con otros filtros o limpia la búsqueda.":"Los miembros activos y con participación aprobada aparecerán aquÃ."})]})}):m==="people"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:838",className:"hidden grid-cols-[2.25rem_minmax(260px,1.2fr)_minmax(180px,0.8fr)_7.5rem_19rem] items-center gap-x-3 border-b border-stone-200 bg-stone-50/80 px-4 py-2.5 text-[10px] font-bold uppercase tracking-[0.12em] text-stone-500 lg:grid",children:[e.jsx(dt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:839",checked:O?!0:G?"indeterminate":!1,onCheckedChange:pe,"aria-label":"Seleccionar todos los resultados visibles"}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:846",children:"Persona"}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:847",children:"Entidad y rol"}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:848",children:"Estado"}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:849",className:"text-right",children:"Acciones"})]}),e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:851",className:"divide-y divide-stone-100",children:p.map(ge)})]}):e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:856",className:"divide-y divide-stone-200",children:ye.map(d=>{const v=d.targets.filter(_=>we(_)==="issued").length,j=d.targets.filter(_=>we(_)!=="issued").map(_=>_.membershipId),q=b.has(d.id);return e.jsxs("section",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:866","aria-labelledby":`group-${d.id}`,children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:867",role:"button",tabIndex:0,"aria-expanded":q,"aria-controls":`group-content-${d.id}`,"aria-labelledby":`group-${d.id}`,className:"flex cursor-pointer flex-wrap items-center justify-between gap-3 bg-stone-50 px-4 py-3 transition-colors hover:bg-stone-100/80 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-[#55b04d]/45",onClick:()=>fe(d.id),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),fe(d.id))},children:[e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:882",className:"flex min-w-0 items-center gap-3 text-left",children:[q?e.jsx(os,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:884",className:"size-4 shrink-0 text-[#185428]","aria-hidden":"true"}):e.jsx(cs,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:889",className:"size-4 shrink-0 text-stone-400","aria-hidden":"true"}),e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:894",className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-stone-200 bg-white tex
184t-stone-500",children:d.entity?.logoUrl?e.jsx("img",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:896",src:d.entity.logoUrl,alt:"",className:"size-full object-contain"}):e.jsx(be,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:902",className:"size-4","aria-hidden":"true"})}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:905",className:"min-w-0",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:906",id:`group-${d.id}`,className:"block truncate text-sm font-semibold text-stone-900",children:d.name}),e.jsxs("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:912",className:"block text-xs text-stone-500",children:[v," de ",d.targets.length," entradas activas"]})]})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:918",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:919",className:"text-xs text-stone-400",children:q?"Ocultar personas":"Ver personas"}),j.length>0&&e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:923",size:"sm",variant:"outline",disabled:M.isPending,onClick:_=>{_.stopPropagation(),ce(j,void 0,`Activando ${j.length} entradas de ${d.name}â¦`)},children:[e.jsx(Ge,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:936",className:"size-3.5","aria-hidden":"true"}),"Activar pendientes (",j.length,")"]})]})]}),q&&e.jsx("ul",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:943",id:`group-content-${d.id}`,className:"divide-y divide-stone-100",children:d.targets.map(ge)})]},d.id)})})]}),S.size>0&&e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:958",className:"sticky bottom-3 z-20 flex flex-col gap-3 rounded-xl border border-[#185428]/30 bg-[#0e321a] px-4 py-3 text-white shadow-lg sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:959",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:960",className:"text-sm font-semibold",children:M.isPending?D??"Procesando selecciónâ¦":`${S.size} persona${S.size===1?"":"s"} seleccionada${S.size===1?"":"s"}`}),e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:965",className:"mt-0.5 text-xs text-white/65",children:M.isPending?"La operación puede tardar si incluye muchos envÃos.":"Las entradas que ya estén activas no se duplicarán."})]}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:971",className:"flex flex-wrap gap-2",children:[e.jsx(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:972",size:"sm",variant:"ghost",className:"text-white hover:bg-white/10 hover:text-white",disabled:M.isPending,onClick:()=>l(new Set),children:"Cancelar"}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:981",size:"sm",variant:"outline",className:"border-white/25 bg-transparent text-white hover:bg-white/10 hover:text-white",disabled:M.isPending,onClick:()=>ce([...S],void 0,`Activando ${S.size} entradasâ¦`),children:[e.jsx(Ge,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:994",className:"size-3.5","aria-hidden":"true"}),"Activar"]}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:997",size:"sm",className:"bg-[#c3d83e] text-[#0e321a] hover:bg-[#d2e35d]",disabled:M.isPending,onClick:()=>ce([...S],!0,`Activando y enviando ${S.size} entradasâ¦`),children:[e.jsx(It,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1009",className:"size-3.5","aria-hidden":"true"}),"Activar y enviar"]})]})]}),e.jsx(He,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1016",open:x,onOpenChange:w,children:e.jsxs(Ve,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1017",className:"flex h-[min(900px,92dvh)] w-[calc(100vw-1.5rem)] max-w-none flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:max-w-[min(1120px,calc(100vw-3rem))]",children:[e.jsx(Ue,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1018",className:"border-b border-stone-200 bg-stone-50/80 px-5 py-5 pr-14 text-left sm:px-6",children:e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1019",className:"flex items-start gap-3",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1020",className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-[#185428] text-white",children:e.jsx(Pt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1021",className:"size-5","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1023",className:"min-w-0",children:[e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1024",className:"flex flex-wrap items-center gap-2",children:[e.jsx(Qe,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1025",children:"Reglas y etiquetas"}),e.jsx(X,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1026",variant:"outline",className:B("rounded-full",Y.
184isPending?"border-blue-200 bg-blue-50 text-blue-700":"border-emerald-200 bg-emerald-50 text-emerald-700"),children:Y.isPending?"Guardandoâ¦":"Guardado automático"})]}),e.jsx(We,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1040",className:"mt-1 max-w-2xl",children:"Define cuándo se activa y envÃa el QR y cómo saldrá la etiqueta que se imprime en el mostrador."})]})]})}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1047",className:"min-h-0 flex-1 overflow-y-auto px-5 pb-6 sm:px-6",children:e.jsx(Vs,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1048",editionName:A.data?.edition.name,settings:A.data?.settings,summary:z,isLoading:A.isLoading,onUpdateSettings:d=>Y.mutate(d),isPending:Y.isPending})})]})}),e.jsx(He,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1060",open:!!E,onOpenChange:d=>{d||C(null)},children:e.jsxs(Ve,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1066",className:"flex h-[min(720px,86dvh)] w-[calc(100vw-1.5rem)] max-w-none flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:max-w-[min(920px,calc(100vw-3rem))]",children:[e.jsx(Ue,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1067",className:"border-b border-stone-200 bg-stone-50/80 px-5 py-5 pr-14 text-left sm:px-6",children:e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1068",className:"flex items-start gap-3",children:[e.jsx("span",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1069",className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-[#185428] text-white",children:e.jsx(gt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1070",className:"size-5","aria-hidden":"true"})}),e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1072",className:"min-w-0",children:[e.jsx(Qe,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1073",children:oe?.member.userName??"Historial de entrada"}),e.jsxs(We,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1076",className:"mt-1",children:[oe?.member.userEmail?`${oe.member.userEmail} · `:"","Cambios de estado y envÃos del pase QR."]})]})]})}),e.jsx("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1085",className:"min-h-0 flex-1 overflow-y-auto",children:se.isLoading?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1087",className:"space-y-3 p-5",role:"status",children:[e.jsx(F,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1088",className:"h-24"}),e.jsx(F,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1089",className:"h-48"})]}):se.isError?e.jsxs("div",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1092",className:"p-5",role:"alert",children:[e.jsx("p",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1093",className:"text-sm text-rose-700",children:"No se ha podido cargar el historial."}),e.jsxs(P,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1096",variant:"outline",size:"sm",className:"mt-3",onClick:()=>void se.refetch(),children:[e.jsx(he,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1102",className:"size-3.5","aria-hidden":"true"}),"Reintentar"]})]}):e.jsx(Qs,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1107",entryPass:oe})})]})}),e.jsx(Ke,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1113",open:!!N,onOpenChange:d=>{!d&&!H.isPending&&I(null)},children:e.jsxs(Ze,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1119",children:[e.jsxs(Xe,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1120",children:[e.jsx(Ye,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1121",children:"¿Revocar esta entrada?"}),e.jsxs(Je,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1122",children:["El QR que ya tenga"," ",e.jsx("strong",{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1124",children:N?.userName??"esta persona"})," dejará de funcionar inmediatamente. Si la reactivas más adelante, se generará un QR diferente y tendrás que volver a enviarlo."]})]}),e.jsxs(et,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1129",children:[e.jsx(tt,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1130",disabled:H.isPending,children:"Conservar entrada"}),e.jsx(st,{"data-loc":"src/components/gestor/accreditations/EntryPassesSection.tsx:1133",className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:H.isPending,onClick:d=>{d.preventDefault(),N?.entryPass&&H.mutate(N.entryPass.id,{onSuccess:()=>I(null)})},children:H.isPending?"Revocandoâ¦":"SÃ, revocar entrada"})]})]})})]})}const Be=[{key:"passes",label:"Preparar entradas",description:"Activación, envÃo y reglas QR",icon:ht},{key:"log",label:"Registro del dÃa",description:"Llegadas, pendientes y seguimiento",icon:Kt},{key:"desk",label:"Mostrador",description:"Buscar, escanear e imprimir",icon:lt}];function Xa(){const{slug:a}=is(),[t,s]=g.useState("passes"),n=ve({queryKey:["gestor","edition",a],queryFn:()=>ue(`/gestor/editions/${a}`),enabled:!!a});
184function o(c,i){const m=Be.length-1,h=c.key==="ArrowRight"?i===m?0:i+1:c.key==="ArrowLeft"?i===0?m:i-1:c.key==="Home"?0:c.key==="End"?m:null;if(h===null)return;c.preventDefault();const b=Be[h].key;s(b),window.requestAnimationFrame(()=>{document.getElementById(`accreditations-tab-${b}`)?.focus()})}return e.jsx(Vt,{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:85",title:"Acreditaciones",subtitle:"Activa las entradas QR de los miembros y acredÃtalos en puerta cada dÃa del evento.",breadcrumbs:[{label:"Gestor",href:"/gestor"},{label:"Ediciones",href:"/gestor/ediciones"},{label:n.data?.edition.name??a,href:`/gestor/edicion/${a}/overview`},{label:"Acreditaciones"}],edition:n.data?.edition,currentSectionKey:"accreditations",children:e.jsxs("div",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:100",className:"space-y-4",children:[e.jsx("nav",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:101",className:"rounded-xl border border-[#d8d5c9] bg-[#fffefa] p-1.5","aria-label":"Ãreas de acreditaciones",children:e.jsx("div",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:105",className:"grid gap-1 sm:grid-cols-3",role:"tablist","aria-label":"Flujo de acreditaciones",children:Be.map((c,i)=>{const m=c.icon,h=t===c.key;return e.jsxs("button",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:114",id:`accreditations-tab-${c.key}`,type:"button",role:"tab","aria-selected":h,"aria-controls":"accreditations-workspace-panel",tabIndex:h?0:-1,className:B("flex min-h-14 items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors duration-150 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-[#55b04d]/45 motion-reduce:transition-none",h?"bg-[#f1efe7] text-[#185428] shadow-[0_1px_2px_rgba(17,26,20,0.06)]":"text-stone-600 hover:bg-[#f6f4ec] hover:text-[#185428]"),onClick:()=>s(c.key),onKeyDown:b=>o(b,i),children:[e.jsx("span",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:131",className:B("flex size-9 shrink-0 items-center justify-center rounded-lg",h?"bg-[#185428] text-white":"bg-stone-100 text-stone-500"),children:e.jsx(m,{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:139",className:"size-4","aria-hidden":"true"})}),e.jsxs("span",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:141",className:"min-w-0",children:[e.jsx("span",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:142",className:"block text-sm font-semibold",children:c.label}),e.jsx("span",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:145",className:"mt-0.5 hidden truncate text-xs font-normal text-stone-500 md:block",children:c.description})]})]},c.key)})})}),e.jsx("div",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:155",id:"accreditations-workspace-panel",role:"tabpanel","aria-labelledby":`accreditations-tab-${t}`,tabIndex:0,className:"focus:outline-none",children:e.jsx("div",{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:162",className:"av-view-transition",children:t==="passes"?e.jsx(Gs,{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:164",slug:a}):e.jsx(Os,{"data-loc":"src/pages/gestor/GestorAccreditations.tsx:166",slug:a,view:t})},t)})]})})}export{Xa 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.