corekit-ui 0.2.41 → 0.2.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- (function(K,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom"),require("xlsx")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom","xlsx"],a):(K=typeof globalThis<"u"?globalThis:K||self,a(K.CoreKitUI={},K.jsxRuntime,K.React,K.app,K.storage,K.ReactDOM,K.XLSX))})(this,(function(K,a,_,ca,lt,$r,El){"use strict";function la(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const z=la(_),da=la($r),br=la(El);function jo(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=jo(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=jo(e))&&(n&&(n+=" "),n+=t);return n}const Ho=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Uo=te,Cl=(e,t)=>r=>{var n;if(t?.variants==null)return Uo(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const f=r?.[u],p=s?.[u];if(f===null)return null;const h=Ho(f)||Ho(p);return o[u][h]}),c=r&&Object.entries(r).reduce((u,f)=>{let[p,h]=f;return h===void 0||(u[p]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:p,className:h,...d}=f;return Object.entries(d).every(v=>{let[g,b]=v;return Array.isArray(b)?b.includes({...s,...c}[g]):{...s,...c}[g]===b})?[...u,p,h]:u},[]);return Uo(e,i,l,r?.class,r?.className)},xe={boton:"_boton_irvjn_1",animated:"_animated_irvjn_87",disabled:"_disabled_irvjn_87",loading:"_loading_irvjn_87",xs:"_xs_irvjn_121",sm:"_sm_irvjn_135",md:"_md_irvjn_149",lg:"_lg_irvjn_163",full_width:"_full_width_irvjn_177",icon_only:"_icon_only_irvjn_185",radius_none:"_radius_none_irvjn_233",radius_sm:"_radius_sm_irvjn_241",radius_md:"_radius_md_irvjn_249",radius_lg:"_radius_lg_irvjn_257",radius_full:"_radius_full_irvjn_265",content:"_content_irvjn_273",spinner:"_spinner_irvjn_275",start_content:"_start_content_irvjn_277",end_content:"_end_content_irvjn_279",content_item:"_content_item_irvjn_291",only_loading:"_only_loading_irvjn_323",spinner_icon:"_spinner_icon_irvjn_343",ripple:"_ripple_irvjn_379",solid:"_solid_irvjn_431",bordered:"_bordered_irvjn_449",ghost:"_ghost_irvjn_469",light:"_light_irvjn_493",light_active:"_light_active_irvjn_511",faded:"_faded_irvjn_531",shadow:"_shadow_irvjn_551",outline:"_outline_irvjn_625",muted:"_muted_irvjn_649",contrast:"_contrast_irvjn_667",tap_animating:"_tap_animating_irvjn_713",default:"_default_irvjn_731",primary:"_primary_irvjn_741",secondary:"_secondary_irvjn_751",success:"_success_irvjn_761",warning:"_warning_irvjn_771",danger:"_danger_irvjn_781",info:"_info_irvjn_791"},Sl=Cl(xe.boton,{variants:{variant:{solid:xe.solid,bordered:xe.bordered,ghost:xe.ghost,light:xe.light,"light-active":xe.light_active,faded:xe.faded,shadow:xe.shadow,outline:xe.outline,muted:xe.muted,contrast:xe.contrast},color:{default:xe.default,primary:xe.primary,secondary:xe.secondary,success:xe.success,warning:xe.warning,danger:xe.danger,info:xe.info},size:{xs:xe.xs,sm:xe.sm,md:xe.md,lg:xe.lg},radius:{none:xe.radius_none,sm:xe.radius_sm,md:xe.radius_md,lg:xe.radius_lg,full:xe.radius_full},fullWidth:{true:xe.full_width},isIconOnly:{true:xe.icon_only},isLoading:{true:xe.loading},onlyLoading:{true:xe.only_loading},isDisabled:{true:xe.disabled},disableAnimation:{true:xe.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"lg",disableAnimation:!0}}),He=_.forwardRef(({variant:e="solid",color:t="default",size:r="md",radius:n="lg",fullWidth:o=!1,isLoading:s=!1,onlyLoading:i=!1,isDisabled:c=!1,isIconOnly:l=!1,disableRipple:u=!1,disableAnimation:f=!0,animationTap:p=!1,customColor:h,startContent:d,endContent:v,spinner:g,spinnerPlacement:b="end",permisos:w,permiso:m,children:y,className:k,onClick:T,style:C,type:S="button",href:M,target:D,rel:O,"aria-label":H,...V},N)=>{const x=m&&w?!w.includes(m):!1,A=c||s||x,$=_.useRef(null),F=P=>{if(A){P.preventDefault();return}if(T?.(P),p&&!A&&P.currentTarget instanceof HTMLElement){const Y=P.currentTarget;$.current&&(clearTimeout($.current),$.current=null),Y.classList.remove(xe.tap_animating),Y.offsetWidth,Y.classList.add(xe.tap_animating),$.current=setTimeout(()=>{Y.classList.remove(xe.tap_animating),$.current=null},230)}if(u||A||!(P.currentTarget instanceof HTMLElement))return;const U=P.currentTarget,B=document.createElement("span"),q=U.getBoundingClientRect(),X=Math.max(q.width,q.height);B.className=xe.ripple,B.style.width=`${X}px`,B.style.height=`${X}px`,B.style.left=`${P.clientX-q.left}px`,B.style.top=`${P.clientY-q.top}px`,B.addEventListener("animationend",()=>B.remove(),{once:!0}),U.appendChild(B)},E=h?{"--btn-color":h,"--btn-text-color":h,...C}:C,I=Sl({variant:e,color:h?void 0:t,size:r,radius:n,fullWidth:o,isIconOnly:l,isLoading:s,onlyLoading:i,isDisabled:A,disableAnimation:f}),L=s&&a.jsx("span",{className:xe.spinner,"aria-hidden":i?void 0:"true",children:g||a.jsx("span",{className:xe.spinner_icon})}),R=i&&!H?"Cargando":H,j=a.jsxs(a.Fragment,{children:[b==="start"&&L,d&&!i&&a.jsx("span",{className:te(xe.start_content,xe.content_item),children:d}),y&&!i&&a.jsx("span",{className:xe.content,children:y}),v&&!i&&a.jsx("span",{className:te(xe.end_content,xe.content_item),children:v}),b==="end"&&L]});if(M&&!A){const P=D==="_blank"?O??"noopener noreferrer":O;return a.jsx("a",{...V,ref:N,href:M,target:D,rel:P,"aria-label":R,"aria-busy":s,className:te(I,k),onClick:T?F:void 0,style:E,children:j})}return a.jsx("button",{...V,ref:N,type:S,"aria-label":R,"aria-busy":s,className:te(I,k),disabled:A,onClick:F,style:E,children:j})});He.displayName="Boton";const ct={badge:"_badge_15p9c_1",badge_clickable:"_badge_clickable_15p9c_23",badge_loading:"_badge_loading_15p9c_35",badge_disabled:"_badge_disabled_15p9c_41",content:"_content_15p9c_47",size_sm:"_size_sm_15p9c_57",size_md:"_size_md_15p9c_63",size_lg:"_size_lg_15p9c_69",size_xl:"_size_xl_15p9c_75",radius_none:"_radius_none_15p9c_81",radius_sm:"_radius_sm_15p9c_85",radius_md:"_radius_md_15p9c_89",radius_lg:"_radius_lg_15p9c_93",radius_full:"_radius_full_15p9c_97",dot:"_dot_15p9c_101",dot_wrapper:"_dot_wrapper_15p9c_109",dot_pulse:"_dot_pulse_15p9c_125",badgePulse:"_badgePulse_15p9c_1",icon:"_icon_15p9c_146",avatar:"_avatar_15p9c_152",spinner:"_spinner_15p9c_168",spinner_icon:"_spinner_icon_15p9c_178",badgeSpain:"_badgeSpain_15p9c_1",dismiss_button:"_dismiss_button_15p9c_196",variant_solid:"_variant_solid_15p9c_226",color_default:"_color_default_15p9c_226",color_primary:"_color_primary_15p9c_231",color_secondary:"_color_secondary_15p9c_236",color_success:"_color_success_15p9c_241",color_warning:"_color_warning_15p9c_246",color_danger:"_color_danger_15p9c_251",color_info:"_color_info_15p9c_256",color_brand:"_color_brand_15p9c_261",variant_soft:"_variant_soft_15p9c_266",variant_outline:"_variant_outline_15p9c_306",variant_glass:"_variant_glass_15p9c_358",variant_text:"_variant_text_15p9c_437",badge_custom:"_badge_custom_15p9c_475"},Tl=()=>a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:a.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),ua=_.forwardRef(function({variant:t="solid",color:r="default",size:n="md",radius:o="lg",children:s,startIcon:i,endIcon:c,avatar:l,dot:u,pulse:f,count:p,max:h=99,maxWidth:d,dismissible:v,onDismiss:g,isLoading:b,isDisabled:w,customColor:m,className:y,onClick:k,onKeyDown:T,style:C,"data-testid":S,...M},D){const O=!!k,H=_.useMemo(()=>m?{solid:{"--badge-custom-bg":m,"--badge-custom-text":"white","--badge-custom-border":"transparent"},soft:{"--badge-custom-bg":`color-mix(in oklab, ${m} 15%, transparent)`,"--badge-custom-text":m,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":m,"--badge-custom-border":m},glass:{"--badge-custom-bg":`color-mix(in oklab, ${m} 14%, transparent)`,"--badge-custom-text":m,"--badge-custom-border":"rgb(255 255 255 / 25%)"},text:{"--badge-custom-bg":"transparent","--badge-custom-text":m,"--badge-custom-border":"var(--surface-fourth)"}}[t]:void 0,[m,t]),V=te(ct.badge,ct[`size_${n}`],ct[`radius_${o}`],ct[`variant_${t}`],!m&&ct[`color_${r}`],m&&ct.badge_custom,O&&ct.badge_clickable,b&&ct.badge_loading,w&&ct.badge_disabled,y),N=_.useMemo(()=>t==="solid"?"currentcolor":m||{default:"light-dark(oklch(9% 0 0deg), oklch(95% 0 0deg))",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[r],[t,r,m]),x=b||w,A=p!==void 0?p>h?`${h}+`:p:s;return a.jsxs("span",{...M,ref:D,className:V,style:{...H,...C},onClick:x?void 0:k,onKeyDown:$=>{T?.($),O&&!x&&!$.defaultPrevented&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),k?.())},role:O?"button":void 0,tabIndex:O&&!x?0:void 0,"aria-disabled":w||void 0,"aria-busy":b||void 0,"data-testid":S,children:[b?a.jsx("span",{className:ct.spinner,"aria-hidden":"true",children:a.jsx("span",{className:ct.spinner_icon})}):a.jsxs(a.Fragment,{children:[l&&a.jsx("span",{className:ct.avatar,children:l}),u&&(f?a.jsxs("span",{className:ct.dot_wrapper,style:{color:N},children:[a.jsx("span",{className:ct.dot_pulse}),a.jsx("span",{className:ct.dot,style:{backgroundColor:N}})]}):a.jsx("span",{className:ct.dot,style:{backgroundColor:N}})),i&&a.jsx("span",{className:ct.icon,children:i})]}),a.jsx("span",{className:ct.content,style:d?{maxWidth:d}:void 0,children:A}),!b&&c&&a.jsx("span",{className:ct.icon,children:c}),!b&&v&&a.jsx("button",{type:"button",className:ct.dismiss_button,disabled:w,onClick:$=>{$.stopPropagation(),g?.()},"aria-label":"Eliminar badge",children:a.jsx(Tl,{})})]})});ua.displayName="Badge";const Ue={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},fa=_.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:r,label:n,description:o,size:s="md",color:i="primary",customColor:c,variant:l="default",isDisabled:u=!1,isReadOnly:f=!1,isInvalid:p=!1,isRequired:h=!1,showIcons:d=!1,labelPlacement:v="right",labelPosition:g="inline",justifyEnd:b=!1,children:w,className:m="",name:y,"data-testid":k,...T},C)=>{const[S,M]=_.useState(t),D=_.useId(),O=T.id||D,H=k??(y?`toggle-${y}`:O),V=o?`${O}-desc`:void 0,N=e!==void 0?e:S,x=R=>{if(u||f)return;const j=R.target.checked;e===void 0&&M(j),r&&r(j)},A=w||n,$=[Ue.contenedor_toggle,Ue[`tam_${s}`],!c&&Ue[`color_${i}`],Ue[`variante_${l}`],Ue[`label_${v}`],Ue[`posicion_${g}`],N&&Ue.seleccionado,u&&Ue.deshabilitado,f&&Ue.solo_lectura,p&&Ue.invalido,d&&Ue.con_iconos,b&&Ue.justify_end,m].filter(Boolean).join(" "),F=c?{"--toggle-custom-color":c}:void 0,E=()=>A?a.jsxs("div",{className:Ue.contenedor_label,children:[a.jsxs("span",{className:Ue.texto_label,children:[A,h&&a.jsx("span",{className:Ue.marca_requerido,children:" *"})]}),o&&a.jsx("span",{id:V,className:Ue.texto_descripcion,children:o})]}):null,I=()=>l!=="moon"?null:a.jsx("div",{className:Ue.icono_moon,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:a.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),L=()=>!d||l==="moon"?null:a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:Ue.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"2,6 5,9 10,3"})}),a.jsxs("svg",{className:Ue.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),a.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return a.jsxs("div",{className:$,style:F,children:[g==="top"&&E(),a.jsxs("label",{className:Ue.envoltorio_toggle,htmlFor:O,children:[g==="inline"&&v==="left"&&E(),a.jsxs("div",{className:Ue.pista_toggle,children:[a.jsx("input",{...T,ref:C,type:"checkbox",id:O,checked:N,disabled:u,readOnly:f,required:h,"aria-invalid":p,"aria-required":h||void 0,"aria-describedby":V,className:Ue.input,onChange:x,"data-testid":H,name:y}),a.jsx("div",{className:Ue.fondo_pista,children:a.jsxs("div",{className:Ue.pulgar_toggle,children:[I(),L()]})})]}),g==="inline"&&v==="right"&&E()]})]})});fa.displayName="Toggle";const Al=e=>typeof e=="string"&&/^https?:\/\//i.test(e);function Nl({firebasePath:e,firebaseStorage:t,onSubidaExitosa:r,onError:n}){const[o,s]=_.useState(!1),i=_.useCallback(()=>{if(t&&typeof t=="object")return t;if(!ca.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return lt.getStorage()},[t]),c=_.useCallback(async u=>{if(!e)return u;s(!0);try{let f;try{f=lt.ref(i(),e)}catch(h){const d=h instanceof Error?h.message:String(h);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${e}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${d}`)}await lt.uploadString(f,u,"data_url");const p=await lt.getDownloadURL(f);return r?.(p),p}finally{s(!1)}},[e,i,r]),l=_.useCallback(async u=>{const f=i(),p=Al(u)?lt.ref(f,u):e?lt.ref(f,e):null;if(!p)return!0;s(!0);try{return await lt.deleteObject(p),!0}catch(h){return(typeof h=="object"&&h!==null&&"code"in h?String(h.code):"")==="storage/object-not-found"?!0:(console.error("Error al eliminar la firma de Firebase:",h),n?.(h instanceof Error?h:new Error(String(h))),!1)}finally{s(!1)}},[e,i,n]);return{subiendo:o,subirFirma:c,eliminarFirma:l}}const Il=400;function Ml({isOpen:e,ancho:t,contenedorLienzoRef:r,alCerrar:n}){const[o,s]=_.useState(!!e),[i,c]=_.useState(!1),[l,u]=_.useState(t);_.useEffect(()=>{e&&(s(!0),c(!1))},[e]);const f=_.useCallback(h=>{i||(c(!0),setTimeout(()=>{s(!1),c(!1),h?.()},Il))},[i]),p=_.useCallback(()=>{f(n)},[f,n]);return _.useEffect(()=>{if(!o)return;const h=()=>{const d=r.current;d&&u(Math.max(1,Math.floor(d.clientWidth)))};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[t,o,r]),_.useEffect(()=>{if(!o){document.body.style.overflow="";return}const h=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",h>0&&(document.body.style.paddingRight=`${h}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[o]),{modalAbierto:o,setModalAbierto:s,isClosing:i,anchoCanvas:l,cerrarConAnimacion:f,cerrar:p}}const Fl=({className:e})=>a.jsxs("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),a.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]}),Ol=({className:e})=>a.jsx("svg",{className:e,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M3 6.524c0-.395.327-.714.73-.714h4.788c.006-.842.098-1.995.932-2.793A3.68 3.68 0 0 1 12 2a3.68 3.68 0 0 1 2.55 1.017c.834.798.926 1.951.932 2.793h4.788c.403 0 .73.32.73.714a.72.72 0 0 1-.73.714H3.73A.72.72 0 0 1 3 6.524M11.607 22h.787c2.707 0 4.06 0 4.94-.863s.971-2.28 1.151-5.111l.26-4.08c.098-1.537.146-2.306-.295-2.792c-.442-.487-1.187-.487-2.679-.487H8.23c-1.491 0-2.237 0-2.679.487c-.441.486-.392 1.255-.295 2.791l.26 4.08c.18 2.833.27 4.249 1.15 5.112S8.9 22 11.607 22"})}),$l=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Dl=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Ll=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Pl=({className:e})=>a.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),a.jsx("path",{d:"M15 19h6"}),a.jsx("path",{d:"M18 16v6"})]}),zl=({className:e})=>a.jsxs("svg",{className:e,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[a.jsx("path",{opacity:".5",d:"M14.952 3c-1.037 0-1.872.835-3.542 2.505l-4.91 4.91l7.085 7.085l4.91-4.91C20.165 10.92 21 10.085 21 9.048c0-1.038-.835-1.873-2.505-3.543S15.99 3 14.952 3"}),a.jsx("path",{d:"M13.585 17.5L6.5 10.415l-.995.995C3.835 13.08 3 13.915 3 14.952c0 1.038.835 1.873 2.505 3.543S8.01 21 9.048 21c1.037 0 1.872-.835 3.542-2.505z"}),a.jsx("path",{opacity:".5",d:"M9.033 21H9zm.03 0c.796-.006 1.476-.506 2.51-1.5H21a.75.75 0 0 1 0 1.5z"})]}),Bl=({className:e})=>a.jsxs("svg",{className:e,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("path",{d:"M12 6.5V12l3.5 2"})]}),Vl=({className:e})=>a.jsxs("svg",{className:e,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd","aria-hidden":"true",children:[a.jsx("path",{d:"M15.326 22.704h-2.26a7.4 7.4 0 0 1-1.419-.21a7.4 7.4 0 0 1-1.11-.63a1.5 1.5 0 0 0-.51-.13c-.43 0-.89.4-1.36.62a.23.23 0 0 1-.26 0c-.1-.06-.06-.19-.06-.32a9 9 0 0 0 0-1.36a.56.56 0 0 0-.32-.46a.54.54 0 0 0-.63.11c-.06.06-.22.46-.3.61l-.589.77a3.4 3.4 0 0 1-1 .74a1.11 1.11 0 0 1-1 0a2.34 2.34 0 0 1-1.13-1.6a17 17 0 0 0 1.57-3c.19-.449.36-.919.51-1.389s.24-1 .33-1.44c0 0 .07-.54.1-.74a1 1 0 0 0 0-.12a.5.5 0 0 0-.091-.393a.55.55 0 0 0-.599-.206a3.36 3.36 0 0 0-2 1.47a7.26 7.26 0 0 0-1.16 3.199a7.1 7.1 0 0 0 .15 2.89A8.3 8.3 0 0 1 .18 23.113a.35.35 0 1 0 .4.57a8.7 8.7 0 0 0 1.86-1.64c.3.67.814 1.221 1.46 1.57a2.3 2.3 0 0 0 1.68.13a4 4 0 0 0 1.759-1.18c.074.26.236.487.46.64a1.2 1.2 0 0 0 1 .19c.292-.104.562-.26.8-.46c.14-.09.24-.22.38-.22s.64.35 1 .52q.2.103.419.16c.53.101 1.07.158 1.61.17c.76 0 1.54 0 2.3-.07a.39.39 0 0 0 .277-.664a.4.4 0 0 0-.258-.126M3.27 18.454a6.3 6.3 0 0 1 .92-2.659q.16-.263.37-.49a9 9 0 0 1-.19.91q-.133.665-.34 1.31a20 20 0 0 1-.77 1.83a7 7 0 0 1 .01-.9"}),a.jsx("path",{d:"M23.935 5.367a.38.38 0 0 0-.55 0q-.629.492-1.18 1.07c-.65.65-1.25 1.34-1.91 2a.35.35 0 0 0-.13-.44c-.56-.5-1.09-1-1.67-1.49l-.75-.59a9 9 0 0 0-.799-.53c-.56-.34-1.14-.62-1.71-.92c.43-1.3.91-2.589 1.37-3.829a.36.36 0 0 0-.19-.46a.35.35 0 0 0-.45.19c-.6 1.28-1.22 2.59-1.78 3.93c-.39.9-.74 1.81-1 2.719a.72.72 0 0 0 .37.77l.37.21l1.35.7l2.51 1.49c0 .67-.13 1.64-.25 2.619c-.09.77-.21 1.52-.32 2.08c0 .3 0 .69-.15.64a3.5 3.5 0 0 1-.77.42c-.49.21-1.11.38-1.73.63a17.6 17.6 0 0 1-4.479 1.119c-.19-1.4-.65-4.78-.64-5.24a2.67 2.67 0 0 1 .7-1.999a10 10 0 0 1 3.24-2a.35.35 0 0 0 .19-.46a.34.34 0 0 0-.45-.2a10.2 10.2 0 0 0-3.86 1.78a3.71 3.71 0 0 0-1.15 2.9c0 .5.75 3.76 1.06 5.089l.12.51c0 .15-.38 1.48 6.41-.54a5.4 5.4 0 0 0 2.439-1.26c.131-.18.217-.39.25-.61a10 10 0 0 0 .17-1.55c.05-1.12 0-2.489 0-3.479h.07a.74.74 0 0 0 .68.05q.668-.428 1.22-1c.85-.85 1.549-1.84 2.339-2.749q.459-.569 1-1.06a.4.4 0 0 0 .06-.51m-4.18 3.54c-.81.84-.23.83-2.46-.58q-.659-.42-1.379-.81l-1.4-.69c.13-.52.3-1 .46-1.56c.41.38.8.78 1.23 1.14c.25.21.5.4.76.58s.52.36.8.53c.64.39 1.29.74 1.94 1.11a.37.37 0 0 0 .27.06z"}),a.jsx("path",{d:"M11.387 16.825c.258-.184.475-.419.64-.69c.15-.24.26-.32.39-.57c.3-.6.54-1.2.8-1.79c2.21.56 2.52-.9 2.57-1.35a1.92 1.92 0 0 0-.92-1.829a2.21 2.21 0 0 0-1.91-.17a2 2 0 0 0-1.09 1.57a1.41 1.41 0 0 0 .6 1.44c-.37.48-.75.95-1.12 1.45l-.48.69a2.7 2.7 0 0 0-.35.89c-.13.699.33.719.87.36m1.64-4.549a.9.9 0 0 1 .44-.63a1 1 0 0 1 .82.07a.77.77 0 0 1 .45.68c0 .58-.55 1-1.51.42a.43.43 0 0 1-.2-.54"})]}),jl=({className:e})=>a.jsx("svg",{className:e,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}),ge={backdrop:"_backdrop_i868n_1",visible:"_visible_i868n_41",modal:"_modal_i868n_65",cuerpo_modal:"_cuerpo_modal_i868n_107",encabezado:"_encabezado_i868n_155",titulo:"_titulo_i868n_169",boton_cerrar:"_boton_cerrar_i868n_183",texto_esc:"_texto_esc_i868n_233",icono_x:"_icono_x_i868n_247",contenedor_lienzo:"_contenedor_lienzo_i868n_259",area_firma:"_area_firma_i868n_269",superficie_lienzo:"_superficie_lienzo_i868n_283",lienzo:"_lienzo_i868n_291",lienzo_deshabilitado:"_lienzo_deshabilitado_i868n_321",barra_acciones:"_barra_acciones_i868n_331",grupo_izquierda:"_grupo_izquierda_i868n_351",grupo_derecha:"_grupo_derecha_i868n_363",separador:"_separador_i868n_375",boton_accion:"_boton_accion_i868n_387",contenedor_guardar:"_contenedor_guardar_i868n_447",boton_texto_con_icono:"_boton_texto_con_icono_i868n_459",accion_texto:"_accion_texto_i868n_471",icono_boton_accion:"_icono_boton_accion_i868n_481",icono:"_icono_i868n_247",contenedor_consentimiento:"_contenedor_consentimiento_i868n_507",texto_consentimiento:"_texto_consentimiento_i868n_521",consentimiento_fila:"_consentimiento_fila_i868n_537",toggle_consentimiento:"_toggle_consentimiento_i868n_551",contenedor_subir_oculto:"_contenedor_subir_oculto_i868n_559",boton_adjuntar:"_boton_adjuntar_i868n_571",input_archivo:"_input_archivo_i868n_611",input_validacion_firma:"_input_validacion_firma_i868n_619",bloque_firma:"_bloque_firma_i868n_647",bloque_encabezado:"_bloque_encabezado_i868n_675",bloque_titulo:"_bloque_titulo_i868n_687",marca_requerido:"_marca_requerido_i868n_703",bloque_preview:"_bloque_preview_i868n_713",bloque_preview_imagen:"_bloque_preview_imagen_i868n_743",bloque_preview_placeholder:"_bloque_preview_placeholder_i868n_757",placeholder_icono:"_placeholder_icono_i868n_781",placeholder_texto:"_placeholder_texto_i868n_813",placeholder_sugerencia:"_placeholder_sugerencia_i868n_829",placeholder_linea:"_placeholder_linea_i868n_845",bloque_acciones:"_bloque_acciones_i868n_859",accion_agregar_firma:"_accion_agregar_firma_i868n_873",accion_eliminar_firma:"_accion_eliminar_firma_i868n_875"},Hl=8,Ul=1.2,dr=4.2,Wl=1.8,Wo=(e,t,r)=>Math.max(t,Math.min(r,e)),Gl=(e,t)=>{const r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)},Go=e=>Number.isFinite(e)?e:performance.now(),ql=()=>{const e=_.useRef(null),[t,r]=_.useState(!0),[n,o]=_.useState(!1),[s,i]=_.useState([]),c=_.useRef([]),l=_.useRef({color:"#111827",enabled:!0}),u=_.useRef(null),f=_.useRef([]),p=_.useRef(0),h=_.useRef(dr),d=_.useRef(!1),v=_.useCallback(()=>e.current?.getContext("2d")??null,[]),g=_.useCallback(()=>v(),[v]),b=_.useCallback(()=>{const N=e.current,x=v();N&&x&&x.clearRect(0,0,N.width,N.height),r(!0),c.current=[],i([]),f.current=[],u.current=null,h.current=dr,d.current=!1},[v]),w=_.useCallback(()=>{d.current=!0,r(!1)},[]),m=_.useCallback((N,x)=>{const A=Math.max(1,x.t-N.t),F=Gl(N,x)/A,I=(dr-F*Wl)*Wo(x.pressure||.5,.35,1),L=Wo(I,Ul,dr),j=h.current+(L-h.current)*.25;return h.current=j,j},[]),y=_.useCallback((N,x)=>{N.strokeStyle=l.current.color,N.lineWidth=x,N.lineCap="round",N.lineJoin="round"},[]),k=_.useCallback((N,x)=>{const A=g();if(!A)return;const $=m(N,x);y(A,$),A.beginPath(),A.moveTo(N.x,N.y),A.quadraticCurveTo(N.x,N.y,x.x,x.y),A.stroke(),r(!1)},[m,g,y]),T=_.useCallback(N=>{const x=e.current;if(!x)return{pressure:.5,t:performance.now(),x:0,y:0};const A=x.getBoundingClientRect(),$=x.width/A.width,F=x.height/A.height;return{pressure:N.pressure&&N.pressure>0?N.pressure:.5,t:N.timeStamp||performance.now(),x:(N.clientX-A.left)*$,y:(N.clientY-A.top)*F}},[]),C=_.useCallback(N=>{if(!l.current.enabled)return;N.preventDefault();const x=e.current;if(!x)return;x.setPointerCapture(N.pointerId);const A=T(N);o(!0),u.current=A,f.current=[A],p.current=Go(N.timeStamp)},[T]),S=_.useCallback(N=>{if(!n||!l.current.enabled)return;N.preventDefault();const x=Go(N.timeStamp);if(x-p.current<Hl)return;p.current=x;const A=T(N),$=u.current;$&&(k($,A),u.current=A,f.current.push(A))},[k,n,T]),M=_.useCallback(N=>{if(N&&e.current?.hasPointerCapture(N.pointerId)&&e.current.releasePointerCapture(N.pointerId),n&&f.current.length>0){const x=[...c.current,{puntos:[...f.current]}];c.current=x,i(x)}o(!1),u.current=null,f.current=[]},[n]),D=_.useCallback((N,x,A)=>{if(!(x.puntos.length<2))for(let $=1;$<x.puntos.length;$++){const F=x.puntos[$-1],E=x.puntos[$],I=m(F,E);N.strokeStyle=A??l.current.color,N.lineWidth=I,N.lineCap="round",N.lineJoin="round",N.beginPath(),N.moveTo(F.x,F.y),N.quadraticCurveTo(F.x,F.y,E.x,E.y),N.stroke()}},[m]),O=_.useCallback(()=>{if(c.current.length===0)return;const N=c.current.slice(0,-1);c.current=N,i(N);const x=e.current;if(!x)return;const A=v();A&&(A.clearRect(0,0,x.width,x.height),h.current=dr,N.forEach($=>D(A,$)),r(N.length===0&&!d.current))},[v,D]),H=_.useCallback((N={})=>{const x=e.current;if(!x||t&&c.current.length===0&&!d.current)return null;const{backgroundColor:A,format:$,quality:F,strokeColor:E}=N;if(!A&&!E)return x.toDataURL("image/png");const I=document.createElement("canvas");I.width=x.width,I.height=x.height;const L=I.getContext("2d");if(!L)return null;A&&(L.fillStyle=A,L.fillRect(0,0,I.width,I.height)),E&&c.current.length>0&&!d.current?(h.current=dr,c.current.forEach(P=>D(L,P,E))):L.drawImage(x,0,0);const R=$??"image/png",j=F??.85;return R==="image/png"?I.toDataURL(R):I.toDataURL(R,j)},[t,D]),V=_.useCallback(N=>{const x=e.current,A=v();if(!x||!A)return;if(l.current={color:N.color,enabled:N.enabled??!0},x.style.touchAction="none",x.style.userSelect="none",!l.current.enabled)return()=>{};const $=L=>C(L),F=L=>S(L),E=L=>M(L),I=L=>M(L);return x.addEventListener("pointerdown",$,{passive:!1}),x.addEventListener("pointermove",F,{passive:!1}),x.addEventListener("pointerup",E,{passive:!1}),x.addEventListener("pointerleave",E,{passive:!1}),x.addEventListener("pointercancel",I,{passive:!1}),()=>{x.removeEventListener("pointerdown",$),x.removeEventListener("pointermove",F),x.removeEventListener("pointerup",E),x.removeEventListener("pointerleave",E),x.removeEventListener("pointercancel",I)}},[M,C,S,v]);return _.useEffect(()=>{h.current=dr},[s.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:O,estaVacio:t,limpiarCanvas:b,marcarConContenido:w,obtenerDatosFirma:H,puedeDeshacer:s.length>0}},qo=_.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:r,className:n,closeOnBackdropClick:o=!1,firmaInicial:s=null,isOpen:i=!1,isRequired:c=!1,mostrarBotonSubir:l=!0,name:u,onClose:f,onConfirm:p,readonly:h=!1,readonlyPostGuardado:d=!1,requiredMessage:v="Se debe registrar una firma para continuar",textoAdjuntar:g="Adjuntar firma",textoConsentimiento:b="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:m="Eliminar firma",textoEstadoGuardada:y="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:T="Guardar firma",textoLimpiar:C="Limpiar",textoModificar:S="Modificar firma",textoReemplazarFirma:M="Reemplazar firma",textoSolicitarFirma:D="Agregar firma",tituloBloque:O="Firma del responsable",titulo:H="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:N=!0,firebasePath:x,firebaseStorage:A,onFirebaseUploadSuccess:$,onFirebaseUploadError:F,fondoTransparente:E=!0,id:I,"data-testid":L},R)=>{const{canvasRef:j,configurarCanvas:P,deshacerUltimoTrazo:U,estaVacio:B,limpiarCanvas:q,marcarConContenido:X,obtenerDatosFirma:Y,puedeDeshacer:Q}=ql(),oe=_.useRef(null),se=_.useRef(null),ne=_.useRef(null),ie=_.useId(),ae=I??`signature-${ie}`,fe=`${ae}-bloque-title`,de=`${ae}-toggle`,Z=`${ae}-texto`,ue=`${ae}-dialog-title`,pe=`${ae}-dialog-description`,[he,we]=_.useState(s),[W,ee]=_.useState(!1),[J,ce]=_.useState(!!s),[ve,ke]=_.useState(!1),De=_.useCallback(()=>{ee(!1),ke(!1),q()},[q]),{modalAbierto:at,setModalAbierto:Qe,isClosing:Ae,anchoCanvas:Xe,cerrarConAnimacion:ot,cerrar:Ye}=Ml({isOpen:i,ancho:t,contenedorLienzoRef:ne,alCerrar:()=>{De(),f?.()}}),{subiendo:st,subirFirma:it,eliminarFirma:Ce}=Nl({firebasePath:x,firebaseStorage:A,onSubidaExitosa:$,onError:F}),Me=Math.round(Xe*e/Math.max(1,t)),Ne=h||d&&J,Et=!h&&!(d&&J),Fe=_.useCallback(qe=>{const Ie=j.current,Xt=Ie?.getContext("2d");if(!Ie||!Xt)return;const Mt=new Image;Mt.onload=()=>{Xt.clearRect(0,0,Ie.width,Ie.height);const St=Ie.width/Ie.height,on=Mt.width/Mt.height;let sn=Ie.width,cn=Ie.height,ln=0,dn=0;on>St?(cn=Ie.width/on,dn=(Ie.height-cn)/2):(sn=Ie.height*on,ln=(Ie.width-sn)/2),Xt.drawImage(Mt,ln,dn,sn,cn),X(),ke(!0)},Mt.src=qe},[j,X]),ft=_.useCallback(()=>{q(),we(null),ke(!1),ce(!1)},[q]),lr=_.useCallback(()=>{Ne||(q(),ke(!1))},[Ne,q]),Kt=_.useCallback(async()=>{Ne||st||await Ce(he)&&(ft(),p?.(""))},[Ne,st,Ce,he,ft,p]),Ee=_.useCallback(()=>{h||(q(),ce(!1),ke(!1),ee(!1))},[q,h]),ze=_.useCallback(qe=>{if(Ne)return;const Ie=qe.target.files?.[0];if(!Ie)return;const Xt=new FileReader;Xt.onload=Mt=>{const St=Mt.target?.result;typeof St=="string"&&(q(),Fe(St))},Xt.readAsDataURL(Ie)},[Ne,Fe,q]),xt=_.useCallback(()=>{Ne||oe.current?.click()},[Ne]),Ze=_.useCallback(async()=>{if(Ne||Ae||st)return;const qe=Y(E?{format:"image/png",strokeColor:"#111827"}:{backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!(!qe||!W))try{const Ie=await it(qe);ot(()=>{we(Ie),ce(!0),p?.(Ie),De(),f?.()})}catch(Ie){console.error("Error al subir la firma a Firebase:",Ie),F?.(Ie instanceof Error?Ie:new Error(String(Ie)))}},[Ne,Ae,st,Y,E,W,it,ot,p,De,f,F]);_.useEffect(()=>{we(s),ce(!!s)},[s]),_.useImperativeHandle(R,()=>({limpiar:q,obtenerDatosFirma:Y,estaVacio:()=>B}),[B,q,Y]),_.useEffect(()=>{if(!at)return;const qe=P({color:"#111827",enabled:!Ne});return()=>{qe?.()}},[Ne,P,at]),_.useEffect(()=>{at||De()},[De,at]),_.useEffect(()=>{if(!at)return;const qe=Ie=>{if(Ie.key==="Escape"){Ye();return}if(Ie.ctrlKey&&Ie.key.toLowerCase()==="z"){Ie.preventDefault(),!Ne&&Q&&U();return}Ie.ctrlKey&&Ie.key==="Enter"&&(Ie.preventDefault(),Ne||Ze())};return document.addEventListener("keydown",qe),()=>document.removeEventListener("keydown",qe)},[Ne,U,Ye,Ze,at,Q]),_.useEffect(()=>{const qe=se.current;if(!qe)return;if(c&&!!!he){qe.setCustomValidity(v);return}qe.setCustomValidity("")},[he,c,v]);const Ct=_.useCallback(qe=>{Ae||!o||qe.target===qe.currentTarget&&Ye()},[o,Ae,Ye]),It=Ne,sa=Ne||ve,ia=Ne||!J&&(B&&!ve||!W),an=()=>{h||(he&&Ee(),Qe(!0))};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{id:ae,className:`${ge.bloque_firma} ${n||""}`,"data-testid":L??(u?`signature-${u}`:ae),role:"group","aria-labelledby":fe,children:[a.jsxs("div",{className:ge.bloque_encabezado,children:[a.jsxs("span",{id:fe,className:ge.bloque_titulo,children:[O,c&&a.jsx("span",{className:ge.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx(ua,{color:he?"success":"warning",size:"sm",variant:"soft",startIcon:he?a.jsx(jl,{}):a.jsx(Bl,{}),children:he?y:k})]}),a.jsxs("div",{className:ge.bloque_preview,style:r?{aspectRatio:r}:void 0,children:[(c||u)&&a.jsx("input",{ref:se,className:ge.input_validacion_firma,"aria-hidden":"true",name:u,required:c,tabIndex:-1,type:"text",value:he?"signed":"",onChange:()=>{},onInvalid:qe=>{c&&!he&&qe.currentTarget.setCustomValidity(v)},onInput:qe=>{qe.currentTarget.setCustomValidity("")}}),he?a.jsx("img",{src:he,alt:"Firma guardada",className:ge.bloque_preview_imagen}):a.jsxs("span",{className:ge.bloque_preview_placeholder,children:[a.jsx(Vl,{className:ge.placeholder_icono}),a.jsx("span",{className:ge.placeholder_texto,children:"Sin firma registrada"}),!h&&a.jsx("span",{className:ge.placeholder_sugerencia,children:"El botón “Agregar firma” permite firmar a mano o adjuntar una imagen"}),a.jsx("span",{className:ge.placeholder_linea,"aria-hidden":"true"})]})]}),!h&&(V||N&&!!he)&&a.jsxs("div",{className:ge.bloque_acciones,children:[V&&a.jsx(He,{color:"primary",size:"sm",variant:"outline",onClick:an,className:ge.accion_agregar_firma,isDisabled:Ne||Ae,children:a.jsxs("span",{className:ge.boton_texto_con_icono,children:[he?a.jsx(Ll,{className:ge.icono_boton_accion}):a.jsx(Pl,{className:ge.icono_boton_accion}),a.jsx("span",{className:ge.accion_texto,children:he?M:D})]})}),N&&he&&a.jsx(He,{color:"danger",size:"sm",variant:"bordered",onClick:Kt,className:ge.accion_eliminar_firma,isDisabled:Ne||Ae||st,children:a.jsxs("span",{className:ge.boton_texto_con_icono,children:[a.jsx(Ol,{className:ge.icono_boton_accion}),a.jsx("span",{className:ge.accion_texto,children:m})]})})]})]}),at&&a.jsx("div",{className:`${ge.backdrop} ${Ae?"":ge.visible}`,onClick:Ct,children:a.jsxs("div",{className:`${ge.modal} ${Ae?"":ge.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":ue,"aria-describedby":pe,children:[a.jsxs("header",{className:ge.encabezado,children:[a.jsx("h2",{id:ue,className:ge.titulo,children:H}),a.jsxs("button",{className:ge.boton_cerrar,onClick:Ye,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:ge.texto_esc,children:"ESC"}),a.jsx(Fl,{className:ge.icono_x})]})]}),a.jsxs("div",{className:ge.cuerpo_modal,children:[a.jsx("div",{className:ge.contenedor_lienzo,ref:ne,children:a.jsxs("div",{className:ge.area_firma,children:[a.jsx("div",{className:ge.superficie_lienzo,children:a.jsx("canvas",{ref:j,className:`${ge.lienzo} ${It?ge.lienzo_deshabilitado:""}`,width:Xe,height:Me,style:{height:`${Me}px`,pointerEvents:sa?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Et&&a.jsxs("div",{className:ge.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[a.jsxs("div",{className:ge.grupo_izquierda,children:[a.jsxs("button",{className:ge.boton_accion,onClick:U,type:"button",disabled:!Q||It,"aria-label":w,children:[a.jsx($l,{className:ge.icono,"aria-hidden":"true"}),a.jsx("span",{children:w})]}),a.jsx("span",{className:ge.separador,"aria-hidden":"true",children:"|"}),a.jsxs("button",{className:ge.boton_accion,onClick:lr,type:"button",disabled:B&&!ve||It,"aria-label":C,children:[a.jsx(zl,{className:ge.icono,"aria-hidden":"true"}),a.jsx("span",{children:C})]})]}),l&&a.jsx("div",{className:ge.grupo_derecha,children:a.jsxs("button",{className:ge.boton_adjuntar,onClick:xt,type:"button",disabled:Ne,children:[a.jsx(Dl,{className:ge.icono,"aria-hidden":"true"}),g]})})]})]})}),Et&&a.jsxs(a.Fragment,{children:[a.jsx("div",{id:pe,className:ge.contenedor_consentimiento,children:a.jsxs("div",{className:ge.consentimiento_fila,children:[a.jsx(fa,{id:de,isSelected:W,onChange:ee,color:"primary",size:"md",isDisabled:Ne,"aria-describedby":Z,className:ge.toggle_consentimiento}),a.jsx("label",{htmlFor:de,id:Z,className:ge.texto_consentimiento,children:b})]})}),a.jsx("div",{className:ge.contenedor_guardar,children:a.jsx(He,{color:"primary",variant:"light-active",radius:"full",onClick:J&&!d?Ee:Ze,type:"button",isLoading:st,isDisabled:ia||st,children:st?"Guardando...":J&&!d?S:T})})]}),Et&&l&&a.jsx("div",{className:ge.contenedor_subir_oculto,children:a.jsx("input",{ref:oe,type:"file",accept:"image/*",className:ge.input_archivo,onChange:ze,"aria-label":"Subir imagen de firma"})})]})]})})]})});qo.displayName="Signature";const Rl=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Kl=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Xl=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),a.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),a.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),a.jsx("path",{d:"m2 2 20 20"})]}),We={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},Ro=_.forwardRef((e,t)=>{const{type:r="text",value:n,defaultValue:o,placeholder:s,variant:i="bordered",color:c="default",size:l="md",radius:u="md",fullWidth:f=!0,disableAnimation:p=!1,label:h,description:d,errorMessage:v,startContent:g,endContent:b,isRequired:w=!1,isReadOnly:m=!1,isDisabled:y=!1,isClearable:k=!1,isInvalid:T,validationState:C,validate:S,className:M,classNames:D,style:O,onChange:H,onClear:V,onValueChange:N,onFocus:x,onBlur:A,onKeyDown:$,id:F,name:E,autoComplete:I,autoFocus:L,maxLength:R,minLength:j,pattern:P,"data-testid":U,...B}=e,q=_.useRef(null),X=_.useId(),Y=F??`input-text-${X}`;_.useImperativeHandle(t,()=>q.current);const Q=n!==void 0,[oe,se]=_.useState(o??""),ne=Q?n:oe,[ie,ae]=_.useState(!1),[fe,de]=_.useState(!1),Z=_.useMemo(()=>{if(!S)return null;const Ce=S(ne);return Ce===!0||Ce==null?null:typeof Ce=="string"?Ce:typeof Ce=="object"&&"message"in Ce?Ce.message??"Entrada inválida":"Entrada inválida"},[ne,S]),ue=_.useMemo(()=>T!==void 0?T:C==="invalid"?!0:C==="valid"?!1:!!Z,[T,C,Z]),pe=C==="valid"&&!ue,he={invalido:ue,mensaje:Z},we=ne.length>0,W=r==="password",ee=W&&fe?"text":r,J=k&&we&&!m&&!y,ce=_.useCallback(Ce=>{if(y||m)return;const Me=Ce.target.value;Q||se(Me),H?.(Me),N?.(Me)},[Q,y,m,H,N]),ve=_.useCallback(Ce=>{ae(!0),x?.(Ce)},[x]),ke=_.useCallback(Ce=>{ae(!1),A?.(Ce)},[A]),De=_.useCallback(()=>{y||m||(Q||se(""),H?.(""),N?.(""),V?.(),q.current?.focus())},[Q,y,m,H,N,V]),at=_.useCallback(Ce=>{Ce.key==="Escape"&&k&&we&&De(),$?.(Ce)},[k,we,De,$]),Qe=_.useCallback(()=>{de(Ce=>!Ce),requestAnimationFrame(()=>q.current?.focus())},[]),Ae=U??(E?`input-${E}`:Y),Xe=d?`${Y}-desc`:void 0,ot=ue?`${Y}-err`:void 0,Ye=[Xe,ot].filter(Boolean).join(" ")||void 0,st=typeof v=="function"?v(he):v??Z,it=te(We.contenedor_base,We[`variante_${i}`],We[`tam_${l}`],We[`radio_${u}`],We[`color_${c}`],{[We.ancho_total]:f,[We.sin_animacion]:p,[We.deshabilitado]:y,[We.solo_lectura]:m,[We.invalido]:ue,[We.valido]:pe,[We.enfocado]:ie,[We.tiene_contenido]:we},M,D?.base);return a.jsxs("div",{className:it,style:O,children:[h&&a.jsxs("label",{className:te(We.etiqueta,D?.label),htmlFor:Y,children:[h,w&&a.jsx("span",{className:We.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:te(We.envoltorio_input,D?.inputWrapper),children:[g&&a.jsx("span",{className:We.contenido_inicio,children:g}),a.jsx("div",{className:te(We.envoltorio_interno,D?.innerWrapper),children:a.jsx("input",{...B,ref:q,id:Y,name:E,type:ee,value:Q?ne:void 0,defaultValue:Q?void 0:o,placeholder:s,disabled:y,readOnly:m,required:w,autoComplete:I,autoFocus:L,maxLength:R,minLength:j,pattern:P,"aria-invalid":ue||void 0,"aria-describedby":Ye,"aria-required":w,"data-testid":Ae,className:te(We.entrada,D?.input),onChange:ce,onFocus:ve,onBlur:ke,onKeyDown:at})}),J&&a.jsx("button",{type:"button",className:te(We.boton_limpiar,D?.clearButton),onClick:De,tabIndex:-1,"aria-label":"Limpiar campo",children:a.jsx(Rl,{size:"0.75em"})}),W&&a.jsx("button",{type:"button",className:We.boton_password,onClick:Qe,tabIndex:-1,"aria-label":fe?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":fe,children:fe?a.jsx(Xl,{}):a.jsx(Kl,{})}),b&&a.jsx("span",{className:We.contenido_final,children:b})]}),d&&!ue&&a.jsx("div",{id:Xe,className:te(We.descripcion,D?.description),children:d}),ue&&st&&a.jsx("div",{id:ot,className:te(We.mensaje_error,D?.errorMessage),role:"alert",children:st})]})});Ro.displayName="InputText";function ur(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dr(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:r=!1,separadorDecimal:n=".",escalaDecimal:o,decimalesFijos:s=!1,prefijo:i="",sufijo:c=""}=t;let l;o!==void 0?l=s?e.toFixed(o):String(Math.round(e*Math.pow(10,o))/Math.pow(10,o)):l=String(e);const[u,f]=l.split(".");let p=u;if(r){const d=typeof r=="string"?r:",";p=u.replace(/\B(?=(\d{3})+(?!\d))/g,d)}let h=p;return f!==void 0?h+=n+f:s&&o&&o>0&&(h+=n+"0".repeat(o)),`${i}${h}${c}`}function Ko(e,t){if(!e||e.trim()==="")return;const{separadorMiles:r=!1,separadorDecimal:n=".",prefijo:o="",sufijo:s="",permitirNegativo:i=!0}=t;let c=e;if(o&&(c=c.replace(new RegExp(`^${ur(o)}`),"")),s&&(c=c.replace(new RegExp(`${ur(s)}$`),"")),r){const u=typeof r=="string"?r:",";c=c.replace(new RegExp(ur(u),"g"),"")}n!=="."&&(c=c.replace(new RegExp(ur(n)),".")),i||(c=c.replace(/-/g,""));const l=parseFloat(c);return Number.isNaN(l)?void 0:l}function ha(e,t,r){let n=e;return t!==void 0&&n<t&&(n=t),r!==void 0&&n>r&&(n=r),n}function Xo(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Yo(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}function Yl(e,t){if(!e)return e;const{separadorMiles:r=!1,separadorDecimal:n=".",escalaDecimal:o,decimalesFijos:s=!1,prefijo:i="",sufijo:c=""}=t,l=e.startsWith("-"),u=l?e.slice(1):e,[f,p]=u.split(n);let h=p??"";o!==void 0&&(h=h.slice(0,o),s&&(h=h.padEnd(o,"0")));let d=f||"";if(r&&d){const g=typeof r=="string"?r:",";d=d.replace(/\B(?=(\d{3})+(?!\d))/g,g)}let v=(l?"-":"")+d;return p!==void 0?v+=n+h:s&&o&&o>0&&(v+=n+"0".repeat(o)),`${i}${v}${c}`}function Zo(e,t){const{separadorMiles:r,prefijo:n="",sufijo:o=""}=t;let s=e;if(n&&(s=s.replace(new RegExp(`^${ur(n)}`),"")),o&&(s=s.replace(new RegExp(`${ur(o)}$`),"")),r){const i=typeof r=="string"?r:",";s=s.replace(new RegExp(ur(i),"g"),"")}return s}const Zl=e=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[a.jsx("path",{d:"M5 12h14"}),a.jsx("path",{d:"M12 5v14"})]}),Jl=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:a.jsx("path",{d:"M5 12h14"})}),Ge={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},Jo=_.forwardRef((e,t)=>{const{value:r,defaultValue:n,placeholder:o,variant:s="bordered",color:i="default",size:c="md",radius:l="md",fullWidth:u=!0,disableAnimation:f=!1,label:p,description:h,errorMessage:d,startContent:v,endContent:g,isRequired:b=!1,isReadOnly:w=!1,isDisabled:m=!1,isInvalid:y,validationState:k,validate:T,className:C,classNames:S,style:M,min:D,max:O,step:H=1,decimalScale:V,fixedDecimalScale:N=!1,thousandSeparator:x=!1,decimalSeparator:A=".",prefix:$="",suffix:F="",allowNegative:E=!0,allowDecimal:I=!0,hideControls:L=!1,clampBehavior:R="error",onChange:j,onValueChange:P,onFocus:U,onBlur:B,onKeyDown:q,id:X,name:Y,"data-testid":Q,...oe}=e,se=_.useRef(null),ne=_.useId(),ie=X??`input-numeric-${ne}`;_.useImperativeHandle(t,()=>se.current);const ae=r!==void 0,[fe,de]=_.useState(n),[Z,ue]=_.useState(""),[pe,he]=_.useState(!1),we=ae?r===""?void 0:r:fe,W=_.useMemo(()=>({separadorMiles:x,separadorDecimal:A,escalaDecimal:I?V:0,decimalesFijos:N,prefijo:$,sufijo:F,permitirNegativo:E}),[x,A,V,N,$,F,E,I]),ee=_.useRef(we);ee.current=we;const J=_.useRef(W);J.current=W;const ce=_.useRef(pe);ce.current=pe;const ve=_.useRef(""),ke=_.useMemo(()=>{if(R==="error"&&we!==void 0){if(D!==void 0&&we<D)return`El valor debe ser mayor o igual a ${D}`;if(O!==void 0&&we>O)return`El valor debe ser menor o igual a ${O}`}if(!T)return null;const Ee=Xo(T(we));return Ee.invalido?Ee.mensaje:null},[we,T,R,D,O]),De=_.useMemo(()=>y!==void 0?y:k==="invalid"?!0:k==="valid"?!1:!!ke,[y,k,ke]),at=k==="valid"&&!De,Qe={invalido:De,mensaje:ke},Ae=_.useCallback(Ee=>{ae||de(Ee),j?.(Ee),P?.(Dr(Ee,W),Ee)},[ae,j,P,W]),Xe=_.useCallback(Ee=>{let ze=(we??0)+H*Ee;R!=="error"&&(ze=ha(ze,D,O)),V!==void 0&&(ze=Yo(ze,V)),Ae(ze),ue(Dr(ze,W))},[we,H,D,O,R,V,Ae,W]),ot=_.useCallback(Ee=>{if(m||w)return;const ze=A===","?",":".";let xt="0-9";I&&(xt+=ze),E&&(xt+="-");let Ze=Ee.target.value.replace(new RegExp(`[^${xt}]`,"g"),"");if(I){const Ct=Ze.split(ze);Ct.length>2&&(Ze=Ct[0]+ze+Ct.slice(1).join(""))}if(E&&Ze.includes("-")){const Ct=Ze.replace(/-/g,"");Ze=Ze.startsWith("-")?"-"+Ct:Ct}ve.current=Ze,ue(Ze),Ae(Ko(Ze,W))},[m,w,W,Ae,A,E,I]),Ye=_.useCallback(Ee=>{const ze=Zo(ve.current,J.current);ve.current=ze,he(!0),ze&&ue(ze),U?.(Ee)},[U]),st=_.useCallback(Ee=>{const ze=ee.current,xt=J.current;if(he(!1),R==="blur"&&ze!==void 0){const Ze=ha(ze,D,O);if(Ze!==ze){Ae(Ze),ue(Dr(Ze,xt)),B?.(Ee);return}}R!=="error"&&ue(Yl(ve.current,xt)),B?.(Ee)},[R,D,O,Ae,B]),it=_.useCallback(Ee=>{Ee.key==="ArrowUp"?(Ee.preventDefault(),Xe(1)):Ee.key==="ArrowDown"&&(Ee.preventDefault(),Xe(-1));const ze=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],xt=Ee.ctrlKey||Ee.metaKey,Ze=I&&(Ee.key===A||Ee.key==="."||Ee.key===","),Ct=Ee.key==="-"&&E,It=/^[0-9]$/.test(Ee.key);!ze.includes(Ee.key)&&!xt&&!Ze&&!Ct&&!It&&Ee.preventDefault(),q?.(Ee)},[Xe,q,A,E,I]);_.useEffect(()=>{if(!ce.current){const Ee=Dr(we,W);ve.current=Zo(Ee,W),ue(Ee)}},[we,W]),_.useLayoutEffect(()=>{se.current&&se.current.setCustomValidity(R==="error"&&ke?ke:"")},[R,ke]);const Ce=Q??(Y?`input-${Y}`:ie),Me=h?`${ie}-desc`:void 0,Ne=De?`${ie}-err`:void 0,Et=[Me,Ne].filter(Boolean).join(" ")||void 0,Fe=typeof d=="function"?d(Qe):d??ke,ft=O===void 0||(we??0)<O,lr=D===void 0||(we??0)>D,Kt=te(Ge.contenedor_base,Ge[`variante_${s}`],Ge[`tam_${c}`],Ge[`radio_${l}`],Ge[`color_${i}`],{[Ge.ancho_total]:u,[Ge.sin_animacion]:f,[Ge.deshabilitado]:m,[Ge.solo_lectura]:w,[Ge.invalido]:De,[Ge.valido]:at,[Ge.enfocado]:pe},C,S?.base);return a.jsxs("div",{className:Kt,style:M,children:[p&&a.jsxs("label",{className:te(Ge.etiqueta,S?.label),htmlFor:ie,children:[p,b&&a.jsx("span",{className:Ge.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:te(Ge.envoltorio_input,S?.inputWrapper),children:[a.jsxs("div",{className:te(Ge.envoltorio_interno,S?.innerWrapper),children:[v&&a.jsx("span",{className:Ge.contenido_inicio,children:v}),a.jsx("input",{...oe,ref:se,id:ie,name:Y,type:"text",inputMode:"decimal",value:Z,placeholder:o,disabled:m,readOnly:w,required:b,"aria-invalid":De||void 0,"aria-describedby":Et,"aria-required":b,"data-testid":Ce,className:te(Ge.entrada,S?.input),onChange:ot,onFocus:Ye,onBlur:st,onKeyDown:it}),g&&a.jsx("span",{className:Ge.contenido_final,children:g})]}),!L&&!w&&!m&&a.jsxs("div",{className:te(Ge.controles,S?.controls),children:[a.jsx("button",{type:"button",tabIndex:-1,className:te(Ge.boton_control,S?.controlButton),disabled:!lr,onClick:()=>Xe(-1),"aria-label":"Decrementar valor",children:a.jsx(Jl,{})}),a.jsx("button",{type:"button",tabIndex:-1,className:te(Ge.boton_control,S?.controlButton),disabled:!ft,onClick:()=>Xe(1),"aria-label":"Incrementar valor",children:a.jsx(Zl,{})})]})]}),h&&!De&&a.jsx("div",{id:Me,className:te(Ge.descripcion,S?.description),children:h}),De&&Fe&&a.jsx("div",{id:Ne,className:te(Ge.mensaje_error,S?.errorMessage),role:"alert",children:Fe})]})});Jo.displayName="InputNumeric";function Ql(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function _a(e,t="es-CO"){if(!e)return"";const r=new Date(e+"T00:00:00");return Number.isNaN(r.getTime())?"":r.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function ed(){return new Date().toISOString().split("T")[0]}function td(e,t,r){if(!e)return!0;const n=new Date(e).getTime();return!(t&&n<new Date(t).getTime()||r&&n>new Date(r).getTime())}const Je={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},rd=()=>a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),nd=()=>a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 2v4"}),a.jsx("path",{d:"M16 2v4"}),a.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),a.jsx("path",{d:"M3 10h18"}),a.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),ad=()=>a.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),od=({tipo:e,onClick:t,onMouseDown:r})=>a.jsx("button",{type:"button",tabIndex:-1,className:Je.boton_icono,onMouseDown:r,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?a.jsx(rd,{}):a.jsx(nd,{})}),Qo=_.forwardRef((e,t)=>{const{type:r="date",value:n,defaultValue:o,placeholder:s,variant:i="bordered",color:c="default",size:l="md",radius:u="md",fullWidth:f=!0,disableAnimation:p=!1,label:h,description:d,errorMessage:v,startContent:g,isRequired:b=!1,isReadOnly:w=!1,isDisabled:m=!1,isInvalid:y,validationState:k,validate:T,className:C,classNames:S,style:M,min:D,max:O,isClearable:H=!1,onChange:V,onFocus:N,onBlur:x,id:A,name:$,"data-testid":F,...E}=e,I=_.useRef(null),L=_.useId(),R=A??`input-date-${L}`;_.useImperativeHandle(t,()=>I.current);const j=n!==void 0,[P,U]=_.useState(o??""),B=j?n:P,[q,X]=_.useState(!1),Y=_.useRef(!1),Q=_.useMemo(()=>{if(B&&r!=="time"&&(D||O)){if(D&&B<D)return`La fecha debe ser ${r==="date"?_a(D):D} o posterior`;if(O&&B>O)return`La fecha debe ser ${r==="date"?_a(O):O} o anterior`}if(!T)return null;const ce=Ql(T(B));return ce.invalido?ce.mensaje:null},[B,T,D,O,r]),oe=_.useMemo(()=>y!==void 0?y:k==="invalid"?!0:k==="valid"?!1:!!Q,[y,k,Q]),se=k==="valid"&&!oe,ne={invalido:oe,mensaje:Q},ie=_.useCallback(ce=>{if(m||w)return;Y.current=!1;const ve=ce.target.value;j||U(ve),V?.(ve)},[j,m,w,V]),ae=_.useCallback(ce=>{X(!0),N?.(ce)},[N]),fe=_.useCallback(ce=>{X(!1),Y.current=!1,x?.(ce)},[x]),de=_.useCallback(ce=>{ce.preventDefault()},[]),Z=_.useCallback(ce=>{if(ce.preventDefault(),ce.stopPropagation(),!(!I.current||m||w)){if(Y.current){Y.current=!1,I.current.blur();return}I.current.focus();try{I.current.showPicker?.(),Y.current=!0}catch{}}},[m,w]),ue=_.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation(),Y.current=!1,j||U(""),V?.(""),I.current?.focus()},[j,V]),pe=F??($?`input-${$}`:R),he=d?`${R}-desc`:void 0,we=oe?`${R}-err`:void 0,W=[he,we].filter(Boolean).join(" ")||void 0,ee=typeof v=="function"?v(ne):v??Q,J=te(Je.contenedor_base,Je[`variante_${i}`],Je[`tam_${l}`],Je[`radio_${u}`],Je[`color_${c}`],{[Je.ancho_total]:f,[Je.sin_animacion]:p,[Je.deshabilitado]:m,[Je.solo_lectura]:w,[Je.invalido]:oe,[Je.valido]:se,[Je.enfocado]:q},C,S?.base);return a.jsxs("div",{className:J,style:M,children:[h&&a.jsxs("label",{className:te(Je.etiqueta,S?.label),htmlFor:R,children:[h,b&&a.jsx("span",{className:Je.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx("div",{className:te(Je.envoltorio_input,S?.inputWrapper),children:a.jsxs("div",{className:te(Je.envoltorio_interno,S?.innerWrapper),children:[g&&a.jsx("span",{className:Je.contenido_inicio,children:g}),a.jsx("input",{...E,ref:I,id:R,name:$,type:r,value:j?B:void 0,defaultValue:j?void 0:o,placeholder:s,disabled:m,readOnly:w,required:b,min:D,max:O,"aria-invalid":oe||void 0,"aria-describedby":W,"aria-required":b,"data-testid":pe,className:te(Je.entrada,S?.input),onChange:ie,onFocus:ae,onBlur:fe}),H&&B&&!m&&!w&&a.jsx("button",{type:"button",tabIndex:-1,className:te(Je.boton_limpiar,S?.clearButton),onMouseDown:ce=>ce.preventDefault(),onClick:ue,"aria-label":"Limpiar fecha",children:a.jsx(ad,{})}),a.jsx(od,{tipo:r,onClick:Z,onMouseDown:de})]})}),d&&!oe&&a.jsx("div",{id:he,className:te(Je.descripcion,S?.description),children:d}),oe&&ee&&a.jsx("div",{id:we,className:te(Je.mensaje_error,S?.errorMessage),role:"alert",children:ee})]})});Qo.displayName="InputDate";const sd={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function un({mostrar:e,children:t,tipo:r="desvanecerDeslizar",className:n,...o}){const[s,i]=_.useState(e),[c,l]=_.useState(e?"entrada":null);e&&!s?(i(!0),l("entrada")):!e&&s&&c!=="salida"&&l("salida");const u=()=>{c==="entrada"?l(null):c==="salida"&&(i(!1),l(null))};if(!s)return null;const f=sd[r||"desvanecer"],p=c?`transicion_${f}_${c}`:"";return a.jsx("div",{...o,onAnimationEnd:u,className:`${p} ${n||""}`.trim(),children:t})}const Bt={badges_wrap:"_badges_wrap_1dfuw_15",badges_wrap_visible:"_badges_wrap_visible_1dfuw_23",acciones_grupo:"_acciones_grupo_1dfuw_33",badge_voz:"_badge_voz_1dfuw_41",badge_sm:"_badge_sm_1dfuw_73",badge_md:"_badge_md_1dfuw_85",badge_lg:"_badge_lg_1dfuw_97",badge_estirada:"_badge_estirada_1dfuw_109",badge_icono:"_badge_icono_1dfuw_129",badge_texto:"_badge_texto_1dfuw_155",badge_mic:"_badge_mic_1dfuw_165",badge_tts:"_badge_tts_1dfuw_173",badge_ondas:"_badge_ondas_1dfuw_181",badgeOnda:"_badgeOnda_1dfuw_1",badge_eq:"_badge_eq_1dfuw_219",badgeEq:"_badgeEq_1dfuw_1"};function pa(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:a.jsxs("g",{fill:"currentColor",children:[a.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),a.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function ga(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:a.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function es(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),a.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function va({tipo:e,texto:t,size:r="md",estirar:n}){const o=e==="mic";return a.jsxs("span",{className:te(Bt.badge_voz,o?Bt.badge_mic:Bt.badge_tts,Bt[`badge_${r}`],n&&Bt.badge_estirada),"data-tipo":e,children:[a.jsx("span",{className:Bt.badge_icono,children:o?a.jsx(pa,{}):a.jsx(ga,{})}),a.jsx("span",{className:Bt.badge_texto,children:t}),o?a.jsxs("span",{className:Bt.badge_ondas,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}):a.jsxs("span",{className:Bt.badge_eq,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})}function ts({value:e,onChange:t,isDisabled:r,isReadOnly:n,onDictadoCompleto:o,idioma:s="es-ES"}){const[i,c]=_.useState(!1),[l,u]=_.useState(!1),[f,p]=_.useState(null),h=_.useRef(null),d=_.useRef(null),v=_.useRef(null),g=_.useRef(""),b=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),m=_.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),b&&window.speechSynthesis.cancel(),d.current=null,c(!1)},[b]),y=_.useCallback(()=>{if(!b||!e)return;if(m(),h.current){try{h.current.stop()}catch(S){console.error("Error stopping recognition:",S)}h.current=null,u(!1)}const C=new SpeechSynthesisUtterance(e);C.lang=s,C.onstart=()=>c(!0),C.onend=()=>{c(!1),d.current=null},C.onerror=()=>{c(!1),d.current=null},d.current=C,window.speechSynthesis.speak(C)},[b,e,s,m]),k=_.useCallback(()=>{if(h.current)try{h.current.stop()}catch(C){console.error("Error stopping recognition:",C)}u(!1),p(null)},[]),T=_.useCallback(()=>{if(!w||r||n)return;m();const C=window,S=C.SpeechRecognition||C.webkitSpeechRecognition;if(!S){p("Navegador no compatible");return}try{const M=new S;M.continuous=!0,M.interimResults=!0,M.lang=s,M.onstart=()=>{u(!0),p(null),g.current=e||""},M.onend=()=>{u(!1),h.current=null,o?.()},M.onerror=D=>{D.error!=="no-speech"&&(u(!1),h.current=null,D.error!=="aborted"&&p("Error al reconocer voz"))},M.onresult=D=>{try{let O="";for(let N=0;N<D.results.length;N++)O+=D.results[N][0].transcript;const H=g.current&&O?" ":"",V=g.current+H+O;t(V)}catch{p("Error procesando dictado")}},h.current=M,M.start()}catch{p("No se pudo iniciar dictado"),u(!1)}},[w,r,n,e,t,s,m,o]);return _.useEffect(()=>()=>{v.current&&clearTimeout(v.current),b&&window.speechSynthesis.cancel(),h.current&&h.current.abort()},[b]),{puedeHablar:b,puedeEscuchar:w,hablando:i,escuchando:l,errorDictado:f,escuchar:y,detenerHablar:m,dictar:T,detenerDictado:k}}function id({size:e="1em",className:t}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Be={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},rs=_.forwardRef((e,t)=>{const{children:r,variant:n="bordered",color:o="default",size:s="md",radius:i="md",fullWidth:c=!0,disableAnimation:l=!1,label:u,description:f,errorMessage:p,value:h,defaultValue:d,placeholder:v,isRequired:g=!1,isReadOnly:b=!1,isDisabled:w=!1,isClearable:m=!1,isInvalid:y,validationState:k,validate:T,minRows:C=4,maxRows:S=10,disableAutosize:M=!1,hideVoiceActions:D=!1,className:O,classNames:H,style:V,onChange:N,onClear:x,onFocus:A,onBlur:$,id:F,name:E,rows:I,"data-testid":L,...R}=e,j=_.useRef(null),P=_.useId(),U=F??`textarea-${P}`;_.useImperativeHandle(t,()=>j.current);const B=h!==void 0,[q,X]=_.useState(d??""),Y=B?h:q,[Q,oe]=_.useState(!1),se=_.useMemo(()=>{if(!T)return null;const Fe=T(Y);return Fe===!0||Fe==null?null:typeof Fe=="string"?Fe:typeof Fe=="object"&&"message"in Fe?Fe.message??"Entrada inválida":"Entrada inválida"},[Y,T]),ne=_.useMemo(()=>y!==void 0?y:k==="invalid"?!0:k==="valid"?!1:!!se,[y,k,se]),ie=k==="valid"&&!ne,ae={invalido:ne,mensaje:se},fe=Y.length>0,de=_.useCallback(()=>{if(!j.current||M)return;const Fe=j.current,ft=window.getComputedStyle(Fe),lr=parseFloat(ft.lineHeight)||parseFloat(ft.fontSize)*1.5,Kt=parseFloat(ft.paddingTop)||0,Ee=parseFloat(ft.paddingBottom)||0,ze=parseFloat(ft.borderTopWidth)||0,xt=parseFloat(ft.borderBottomWidth)||0,Ze=C*lr+Kt+Ee+ze+xt,Ct=S*lr+Kt+Ee+ze+xt;Fe.style.height="auto";const It=Fe.scrollHeight;Fe.style.height=`${Math.min(Math.max(It,Ze),Ct)}px`},[M,C,S]);_.useEffect(()=>{M||de()},[Y,de,M]);const Z=_.useCallback(Fe=>{B||X(Fe),N?.(Fe)},[B,N]),{puedeHablar:ue,hablando:pe,escuchar:he,detenerHablar:we,puedeEscuchar:W,escuchando:ee,errorDictado:J,dictar:ce,detenerDictado:ve}=ts({isDisabled:w||D,isReadOnly:b,value:Y,onChange:Z}),ke=_.useCallback(Fe=>{if(w||b)return;const ft=Fe.target.value;B||X(ft),N?.(ft)},[B,w,b,N]),De=_.useCallback(Fe=>{oe(!0),A?.(Fe)},[A]),at=_.useCallback(Fe=>{oe(!1),$?.(Fe)},[$]),Qe=_.useCallback(()=>{w||b||(B||X(""),N?.(""),x?.(),j.current?.focus())},[B,w,b,N,x]),Ae=_.useCallback(()=>{pe?we():he()},[pe,he,we]),Xe=_.useCallback(()=>{ee?ve():ce()},[ee,ce,ve]),ot=L??(E?`textarea-${E}`:U),Ye=f?`${U}-desc`:void 0,st=ne||J?`${U}-err`:void 0,it=[Ye,st].filter(Boolean).join(" ")||void 0,Ce=typeof p=="function"?p(ae):p??se,Me=m&&fe&&!b&&!w,Ne=!D||Me,Et=te(Be.contenedor_base,Be[`variante_${n}`],Be[`tam_${s}`],Be[`radio_${i}`],Be[`color_${o}`],{[Be.ancho_total]:c,[Be.sin_animacion]:l,[Be.deshabilitado]:w,[Be.solo_lectura]:b,[Be.invalido]:ne,[Be.valido]:ie,[Be.enfocado]:Q},O,H?.base);return a.jsxs("div",{className:Et,style:V,children:[u&&a.jsxs("label",{className:te(Be.etiqueta,H?.label),htmlFor:U,children:[u,g&&a.jsx("span",{className:Be.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:te(Be.envoltorio_input,H?.inputWrapper),children:[a.jsx("textarea",{...R,ref:j,id:U,name:E,placeholder:v,value:B?Y:void 0,defaultValue:B?void 0:d,onChange:ke,onFocus:De,onBlur:at,className:te(Be.entrada,M&&Be.sin_autosize,H?.input),readOnly:b,disabled:w,rows:I??C,"aria-invalid":ne||void 0,"aria-describedby":it,"aria-required":g,required:g,"data-testid":ot}),Ne&&a.jsxs("div",{className:te(Be.barra_acciones,H?.actions),children:[a.jsxs("div",{className:Be.badges_contenedor,"aria-live":"polite",role:"status",children:[a.jsx(un,{mostrar:ee,children:a.jsx(va,{tipo:"mic",texto:"Escuchando...",size:s==="lg"?"md":"sm"})}),a.jsx(un,{mostrar:pe,children:a.jsx(va,{tipo:"tts",texto:"Leyendo...",size:s==="lg"?"md":"sm"})})]}),a.jsxs("div",{className:Be.botones_grupo,children:[!D&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:te(Be.boton_accion,pe&&Be.boton_activo_tts),onClick:Ae,disabled:!ue||!pe&&(!Y||ee),title:pe?"Detener lectura":"Leer texto","aria-pressed":pe,"aria-label":pe?"Detener lectura":"Leer texto",children:a.jsx(ga,{})}),W&&a.jsx("button",{type:"button",className:te(Be.boton_accion,ee&&Be.boton_activo_mic),onClick:Xe,disabled:w||b||pe,title:ee?"Detener dictado":"Dictar texto","aria-pressed":ee,"aria-label":ee?"Detener dictado":"Dictar texto",children:ee?a.jsx(es,{}):a.jsx(pa,{})})]}),Me&&a.jsx("button",{type:"button",className:Be.boton_limpiar,onClick:Qe,title:"Limpiar campo","aria-label":"Limpiar campo",children:a.jsx(id,{size:"0.75em"})})]})]})]}),f&&!ne&&a.jsx("div",{id:Ye,className:te(Be.descripcion,H?.description),children:f}),ne&&Ce||J?a.jsxs("div",{id:st,className:te(Be.mensaje_error,H?.errorMessage),role:"alert",children:[Ce,Ce&&J&&a.jsx("br",{}),J&&a.jsxs("span",{children:["Error de voz: ",J]})]}):null,r]})});rs.displayName="TextArea";function fn(){return typeof window<"u"}function Yt(e){return ma(e)?(e.nodeName||"").toLowerCase():"#document"}function kt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dt(e){var t;return(t=(ma(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ma(e){return fn()?e instanceof Node||e instanceof kt(e).Node:!1}function Ve(e){return fn()?e instanceof Element||e instanceof kt(e).Element:!1}function et(e){return fn()?e instanceof HTMLElement||e instanceof kt(e).HTMLElement:!1}function hn(e){return!fn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kt(e).ShadowRoot}const cd=new Set(["inline","contents"]);function Lr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!cd.has(o)}const ld=new Set(["table","td","th"]);function dd(e){return ld.has(Yt(e))}const ud=[":popover-open",":modal"];function _n(e){return ud.some(t=>{try{return e.matches(t)}catch{return!1}})}const fd=["transform","translate","scale","rotate","perspective"],hd=["transform","translate","scale","rotate","perspective","filter"],_d=["paint","layout","strict","content"];function ba(e){const t=pn(),r=Ve(e)?Tt(e):e;return fd.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||hd.some(n=>(r.willChange||"").includes(n))||_d.some(n=>(r.contain||"").includes(n))}function pd(e){let t=jt(e);for(;et(t)&&!Vt(t);){if(ba(t))return t;if(_n(t))return null;t=jt(t)}return null}function pn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gd=new Set(["html","body","#document"]);function Vt(e){return gd.has(Yt(e))}function Tt(e){return kt(e).getComputedStyle(e)}function gn(e){return Ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if(Yt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hn(e)&&e.host||Dt(e);return hn(t)?t.host:t}function ns(e){const t=jt(e);return Vt(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&Lr(t)?t:ns(t)}function Zt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ns(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=kt(o);if(s){const c=wa(i);return t.concat(i,i.visualViewport||[],Lr(o)?o:[],c&&r?Zt(c):[])}return t.concat(o,Zt(o,[],r))}function wa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Jt=Math.min,At=Math.max,vn=Math.round,wr=Math.floor,Lt=e=>({x:e,y:e}),vd={left:"right",right:"left",bottom:"top",top:"bottom"},md={start:"end",end:"start"};function ya(e,t,r){return At(e,Jt(t,r))}function yr(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function xr(e){return e.split("-")[1]}function as(e){return e==="x"?"y":"x"}function xa(e){return e==="y"?"height":"width"}const bd=new Set(["top","bottom"]);function Ht(e){return bd.has(Qt(e))?"y":"x"}function ka(e){return as(Ht(e))}function wd(e,t,r){r===void 0&&(r=!1);const n=xr(e),o=ka(e),s=xa(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=mn(i)),[i,mn(i)]}function yd(e){const t=mn(e);return[Ea(e),t,Ea(t)]}function Ea(e){return e.replace(/start|end/g,t=>md[t])}const os=["left","right"],ss=["right","left"],xd=["top","bottom"],kd=["bottom","top"];function Ed(e,t,r){switch(e){case"top":case"bottom":return r?t?ss:os:t?os:ss;case"left":case"right":return t?xd:kd;default:return[]}}function Cd(e,t,r,n){const o=xr(e);let s=Ed(Qt(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ea)))),s}function mn(e){return e.replace(/left|right|bottom|top/g,t=>vd[t])}function Sd(e){return{top:0,right:0,bottom:0,left:0,...e}}function is(e){return typeof e!="number"?Sd(e):{top:e,right:e,bottom:e,left:e}}function bn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}/*!
1
+ (function(Z,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom"),require("xlsx")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom","xlsx"],n):(Z=typeof globalThis<"u"?globalThis:Z||self,n(Z.CoreKitUI={},Z.jsxRuntime,Z.React,Z.app,Z.storage,Z.ReactDOM,Z.XLSX))})(this,(function(Z,n,_,Ea,ut,Kr,Gl){"use strict";function Ca(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const j=Ca(_),Sa=Ca(Kr),Fr=Ca(Gl);function os(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=os(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function ne(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=os(e))&&(a&&(a+=" "),a+=t);return a}const ss=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,is=ne,Rl=(e,t)=>r=>{var a;if(t?.variants==null)return is(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(d=>{const h=r?.[d],g=s?.[d];if(h===null)return null;const f=ss(h)||ss(g);return o[d][f]}),c=r&&Object.entries(r).reduce((d,h)=>{let[g,f]=h;return f===void 0||(d[g]=f),d},{}),l=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,h)=>{let{class:g,className:f,...u}=h;return Object.entries(u).every(v=>{let[p,m]=v;return Array.isArray(m)?m.includes({...s,...c}[p]):{...s,...c}[p]===m})?[...d,g,f]:d},[]);return is(e,i,l,r?.class,r?.className)},Te={boton:"_boton_irvjn_1",animated:"_animated_irvjn_87",disabled:"_disabled_irvjn_87",loading:"_loading_irvjn_87",xs:"_xs_irvjn_121",sm:"_sm_irvjn_135",md:"_md_irvjn_149",lg:"_lg_irvjn_163",full_width:"_full_width_irvjn_177",icon_only:"_icon_only_irvjn_185",radius_none:"_radius_none_irvjn_233",radius_sm:"_radius_sm_irvjn_241",radius_md:"_radius_md_irvjn_249",radius_lg:"_radius_lg_irvjn_257",radius_full:"_radius_full_irvjn_265",content:"_content_irvjn_273",spinner:"_spinner_irvjn_275",start_content:"_start_content_irvjn_277",end_content:"_end_content_irvjn_279",content_item:"_content_item_irvjn_291",only_loading:"_only_loading_irvjn_323",spinner_icon:"_spinner_icon_irvjn_343",ripple:"_ripple_irvjn_379",solid:"_solid_irvjn_431",bordered:"_bordered_irvjn_449",ghost:"_ghost_irvjn_469",light:"_light_irvjn_493",light_active:"_light_active_irvjn_511",faded:"_faded_irvjn_531",shadow:"_shadow_irvjn_551",outline:"_outline_irvjn_625",muted:"_muted_irvjn_649",contrast:"_contrast_irvjn_667",tap_animating:"_tap_animating_irvjn_713",default:"_default_irvjn_731",primary:"_primary_irvjn_741",secondary:"_secondary_irvjn_751",success:"_success_irvjn_761",warning:"_warning_irvjn_771",danger:"_danger_irvjn_781",info:"_info_irvjn_791"},Xl=Rl(Te.boton,{variants:{variant:{solid:Te.solid,bordered:Te.bordered,ghost:Te.ghost,light:Te.light,"light-active":Te.light_active,faded:Te.faded,shadow:Te.shadow,outline:Te.outline,muted:Te.muted,contrast:Te.contrast},color:{default:Te.default,primary:Te.primary,secondary:Te.secondary,success:Te.success,warning:Te.warning,danger:Te.danger,info:Te.info},size:{xs:Te.xs,sm:Te.sm,md:Te.md,lg:Te.lg},radius:{none:Te.radius_none,sm:Te.radius_sm,md:Te.radius_md,lg:Te.radius_lg,full:Te.radius_full},fullWidth:{true:Te.full_width},isIconOnly:{true:Te.icon_only},isLoading:{true:Te.loading},onlyLoading:{true:Te.only_loading},isDisabled:{true:Te.disabled},disableAnimation:{true:Te.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"lg",disableAnimation:!0}}),Ye=_.forwardRef(({variant:e="solid",color:t="default",size:r="md",radius:a="lg",fullWidth:o=!1,isLoading:s=!1,onlyLoading:i=!1,isDisabled:c=!1,isIconOnly:l=!1,disableRipple:d=!1,disableAnimation:h=!0,animationTap:g=!1,customColor:f,startContent:u,endContent:v,spinner:p,spinnerPlacement:m="end",permisos:w,permiso:b,children:y,className:E,onClick:S,style:C,type:T="button",href:F,target:D,rel:M,"aria-label":U,...V},N)=>{const k=b&&w?!w.includes(b):!1,A=c||s||k,O=_.useRef(null),$=z=>{if(A){z.preventDefault();return}if(S?.(z),g&&!A&&z.currentTarget instanceof HTMLElement){const Q=z.currentTarget;O.current&&(clearTimeout(O.current),O.current=null),Q.classList.remove(Te.tap_animating),Q.offsetWidth,Q.classList.add(Te.tap_animating),O.current=setTimeout(()=>{Q.classList.remove(Te.tap_animating),O.current=null},230)}if(d||A||!(z.currentTarget instanceof HTMLElement))return;const q=z.currentTarget,B=document.createElement("span"),K=q.getBoundingClientRect(),Y=Math.max(K.width,K.height);B.className=Te.ripple,B.style.width=`${Y}px`,B.style.height=`${Y}px`,B.style.left=`${z.clientX-K.left}px`,B.style.top=`${z.clientY-K.top}px`,B.addEventListener("animationend",()=>B.remove(),{once:!0}),q.appendChild(B)},x=f?{"--btn-color":f,"--btn-text-color":f,...C}:C,I=Xl({variant:e,color:f?void 0:t,size:r,radius:a,fullWidth:o,isIconOnly:l,isLoading:s,onlyLoading:i,isDisabled:A,disableAnimation:h}),L=s&&n.jsx("span",{className:Te.spinner,"aria-hidden":i?void 0:"true",children:p||n.jsx("span",{className:Te.spinner_icon})}),X=i&&!U?"Cargando":U,H=n.jsxs(n.Fragment,{children:[m==="start"&&L,u&&!i&&n.jsx("span",{className:ne(Te.start_content,Te.content_item),children:u}),y&&!i&&n.jsx("span",{className:Te.content,children:y}),v&&!i&&n.jsx("span",{className:ne(Te.end_content,Te.content_item),children:v}),m==="end"&&L]});if(F&&!A){const z=D==="_blank"?M??"noopener noreferrer":M;return n.jsx("a",{...V,ref:N,href:F,target:D,rel:z,"aria-label":X,"aria-busy":s,className:ne(I,E),onClick:S?$:void 0,style:x,children:H})}return n.jsx("button",{...V,ref:N,type:T,"aria-label":X,"aria-busy":s,className:ne(I,E),disabled:A,onClick:$,style:x,children:H})});Ye.displayName="Boton";const dt={badge:"_badge_blo9f_1",badge_clickable:"_badge_clickable_blo9f_45",badge_loading:"_badge_loading_blo9f_69",badge_disabled:"_badge_disabled_blo9f_81",content:"_content_blo9f_93",size_sm:"_size_sm_blo9f_113",size_md:"_size_md_blo9f_125",size_lg:"_size_lg_blo9f_137",size_xl:"_size_xl_blo9f_149",radius_none:"_radius_none_blo9f_161",radius_sm:"_radius_sm_blo9f_169",radius_md:"_radius_md_blo9f_177",radius_lg:"_radius_lg_blo9f_185",radius_full:"_radius_full_blo9f_193",dot:"_dot_blo9f_201",dot_wrapper:"_dot_wrapper_blo9f_217",dot_pulse:"_dot_pulse_blo9f_249",badgePulse:"_badgePulse_blo9f_1",icon:"_icon_blo9f_291",avatar:"_avatar_blo9f_303",spinner:"_spinner_blo9f_335",spinner_icon:"_spinner_icon_blo9f_355",badgeSpain:"_badgeSpain_blo9f_1",dismiss_button:"_dismiss_button_blo9f_391",variant_solid:"_variant_solid_blo9f_451",color_default:"_color_default_blo9f_451",color_primary:"_color_primary_blo9f_461",color_secondary:"_color_secondary_blo9f_471",color_success:"_color_success_blo9f_481",color_warning:"_color_warning_blo9f_491",color_danger:"_color_danger_blo9f_501",color_info:"_color_info_blo9f_511",color_brand:"_color_brand_blo9f_521",variant_soft:"_variant_soft_blo9f_531",variant_outline:"_variant_outline_blo9f_611",variant_glass:"_variant_glass_blo9f_715",variant_text:"_variant_text_blo9f_873",badge_custom:"_badge_custom_blo9f_949"},Kl=()=>n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:n.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),Ta=_.forwardRef(function({variant:t="solid",color:r="default",size:a="md",radius:o="lg",children:s,startIcon:i,endIcon:c,avatar:l,dot:d,pulse:h,count:g,max:f=99,maxWidth:u,dismissible:v,onDismiss:p,isLoading:m,isDisabled:w,customColor:b,className:y,onClick:E,onKeyDown:S,style:C,"data-testid":T,...F},D){const M=!!E,U=_.useMemo(()=>b?{solid:{"--badge-custom-bg":b,"--badge-custom-text":"white","--badge-custom-border":"transparent"},soft:{"--badge-custom-bg":`color-mix(in oklab, ${b} 15%, transparent)`,"--badge-custom-text":b,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":b,"--badge-custom-border":b},glass:{"--badge-custom-bg":`color-mix(in oklab, ${b} 14%, transparent)`,"--badge-custom-text":b,"--badge-custom-border":"rgb(255 255 255 / 25%)"},text:{"--badge-custom-bg":"transparent","--badge-custom-text":b,"--badge-custom-border":"var(--surface-fourth)"}}[t]:void 0,[b,t]),V=ne(dt.badge,dt[`size_${a}`],dt[`radius_${o}`],dt[`variant_${t}`],!b&&dt[`color_${r}`],b&&dt.badge_custom,M&&dt.badge_clickable,m&&dt.badge_loading,w&&dt.badge_disabled,y),N=_.useMemo(()=>t==="solid"?"currentcolor":b||{default:"light-dark(oklch(9% 0 0deg), oklch(95% 0 0deg))",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[r],[t,r,b]),k=m||w,A=g!==void 0?g>f?`${f}+`:g:s;return n.jsxs("span",{...F,ref:D,className:V,style:{...U,...C},onClick:k?void 0:E,onKeyDown:O=>{S?.(O),M&&!k&&!O.defaultPrevented&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),E?.())},role:M?"button":void 0,tabIndex:M&&!k?0:void 0,"aria-disabled":w||void 0,"aria-busy":m||void 0,"data-testid":T,children:[m?n.jsx("span",{className:dt.spinner,"aria-hidden":"true",children:n.jsx("span",{className:dt.spinner_icon})}):n.jsxs(n.Fragment,{children:[l&&n.jsx("span",{className:dt.avatar,children:l}),d&&(h?n.jsxs("span",{className:dt.dot_wrapper,style:{color:N},children:[n.jsx("span",{className:dt.dot_pulse}),n.jsx("span",{className:dt.dot,style:{backgroundColor:N}})]}):n.jsx("span",{className:dt.dot,style:{backgroundColor:N}})),i&&n.jsx("span",{className:dt.icon,children:i})]}),n.jsx("span",{className:dt.content,style:u?{maxWidth:u}:void 0,children:A}),!m&&c&&n.jsx("span",{className:dt.icon,children:c}),!m&&v&&n.jsx("button",{type:"button",className:dt.dismiss_button,disabled:w,onClick:O=>{O.stopPropagation(),p?.()},"aria-label":"Eliminar badge",children:n.jsx(Kl,{})})]})});Ta.displayName="Badge";const Je={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},Aa=_.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:r,label:a,description:o,size:s="md",color:i="primary",customColor:c,variant:l="default",isDisabled:d=!1,isReadOnly:h=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:u=!1,labelPlacement:v="right",labelPosition:p="inline",justifyEnd:m=!1,children:w,className:b="",name:y,"data-testid":E,...S},C)=>{const[T,F]=_.useState(t),D=_.useId(),M=S.id||D,U=E??(y?`toggle-${y}`:M),V=o?`${M}-desc`:void 0,N=e!==void 0?e:T,k=X=>{if(d||h)return;const H=X.target.checked;e===void 0&&F(H),r&&r(H)},A=w||a,O=[Je.contenedor_toggle,Je[`tam_${s}`],!c&&Je[`color_${i}`],Je[`variante_${l}`],Je[`label_${v}`],Je[`posicion_${p}`],N&&Je.seleccionado,d&&Je.deshabilitado,h&&Je.solo_lectura,g&&Je.invalido,u&&Je.con_iconos,m&&Je.justify_end,b].filter(Boolean).join(" "),$=c?{"--toggle-custom-color":c}:void 0,x=()=>A?n.jsxs("div",{className:Je.contenedor_label,children:[n.jsxs("span",{className:Je.texto_label,children:[A,f&&n.jsx("span",{className:Je.marca_requerido,children:" *"})]}),o&&n.jsx("span",{id:V,className:Je.texto_descripcion,children:o})]}):null,I=()=>l!=="moon"?null:n.jsx("div",{className:Je.icono_moon,children:n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:n.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),L=()=>!u||l==="moon"?null:n.jsxs(n.Fragment,{children:[n.jsx("svg",{className:Je.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})}),n.jsxs("svg",{className:Je.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[n.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),n.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return n.jsxs("div",{className:O,style:$,children:[p==="top"&&x(),n.jsxs("label",{className:Je.envoltorio_toggle,htmlFor:M,children:[p==="inline"&&v==="left"&&x(),n.jsxs("div",{className:Je.pista_toggle,children:[n.jsx("input",{...S,ref:C,type:"checkbox",id:M,checked:N,disabled:d,readOnly:h,required:f,"aria-invalid":g,"aria-required":f||void 0,"aria-describedby":V,className:Je.input,onChange:k,"data-testid":U,name:y}),n.jsx("div",{className:Je.fondo_pista,children:n.jsxs("div",{className:Je.pulgar_toggle,children:[I(),L()]})})]}),p==="inline"&&v==="right"&&x()]})]})});Aa.displayName="Toggle";const Yl=e=>typeof e=="string"&&/^https?:\/\//i.test(e);function Zl({firebasePath:e,firebaseStorage:t,onSubidaExitosa:r,onError:a}){const[o,s]=_.useState(!1),i=_.useCallback(()=>{if(t&&typeof t=="object")return t;if(!Ea.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return ut.getStorage()},[t]),c=_.useCallback(async d=>{if(!e)return d;s(!0);try{let h;try{h=ut.ref(i(),e)}catch(f){const u=f instanceof Error?f.message:String(f);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${e}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${u}`)}await ut.uploadString(h,d,"data_url");const g=await ut.getDownloadURL(h);return r?.(g),g}finally{s(!1)}},[e,i,r]),l=_.useCallback(async d=>{const h=i(),g=Yl(d)?ut.ref(h,d):e?ut.ref(h,e):null;if(!g)return!0;s(!0);try{return await ut.deleteObject(g),!0}catch(f){return(typeof f=="object"&&f!==null&&"code"in f?String(f.code):"")==="storage/object-not-found"?!0:(console.error("Error al eliminar la firma de Firebase:",f),a?.(f instanceof Error?f:new Error(String(f))),!1)}finally{s(!1)}},[e,i,a]);return{subiendo:o,subirFirma:c,eliminarFirma:l}}const Jl=400;function Ql({isOpen:e,ancho:t,contenedorLienzoRef:r,alCerrar:a}){const[o,s]=_.useState(!!e),[i,c]=_.useState(!1),[l,d]=_.useState(t);_.useEffect(()=>{e&&(s(!0),c(!1))},[e]);const h=_.useCallback(f=>{i||(c(!0),setTimeout(()=>{s(!1),c(!1),f?.()},Jl))},[i]),g=_.useCallback(()=>{h(a)},[h,a]);return _.useEffect(()=>{if(!o)return;const f=()=>{const u=r.current;u&&d(Math.max(1,Math.floor(u.clientWidth)))};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[t,o,r]),_.useEffect(()=>{if(!o){document.body.style.overflow="";return}const f=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",f>0&&(document.body.style.paddingRight=`${f}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[o]),{modalAbierto:o,setModalAbierto:s,isClosing:i,anchoCanvas:l,cerrarConAnimacion:h,cerrar:g}}const ed=({className:e})=>n.jsxs("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),n.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]}),td=({className:e})=>n.jsx("svg",{className:e,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M3 6.524c0-.395.327-.714.73-.714h4.788c.006-.842.098-1.995.932-2.793A3.68 3.68 0 0 1 12 2a3.68 3.68 0 0 1 2.55 1.017c.834.798.926 1.951.932 2.793h4.788c.403 0 .73.32.73.714a.72.72 0 0 1-.73.714H3.73A.72.72 0 0 1 3 6.524M11.607 22h.787c2.707 0 4.06 0 4.94-.863s.971-2.28 1.151-5.111l.26-4.08c.098-1.537.146-2.306-.295-2.792c-.442-.487-1.187-.487-2.679-.487H8.23c-1.491 0-2.237 0-2.679.487c-.441.486-.392 1.255-.295 2.791l.26 4.08c.18 2.833.27 4.249 1.15 5.112S8.9 22 11.607 22"})}),rd=({className:e})=>n.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),nd=({className:e})=>n.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),ad=({className:e})=>n.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),od=({className:e})=>n.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),n.jsx("path",{d:"M15 19h6"}),n.jsx("path",{d:"M18 16v6"})]}),sd=({className:e})=>n.jsxs("svg",{className:e,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[n.jsx("path",{opacity:".5",d:"M14.952 3c-1.037 0-1.872.835-3.542 2.505l-4.91 4.91l7.085 7.085l4.91-4.91C20.165 10.92 21 10.085 21 9.048c0-1.038-.835-1.873-2.505-3.543S15.99 3 14.952 3"}),n.jsx("path",{d:"M13.585 17.5L6.5 10.415l-.995.995C3.835 13.08 3 13.915 3 14.952c0 1.038.835 1.873 2.505 3.543S8.01 21 9.048 21c1.037 0 1.872-.835 3.542-2.505z"}),n.jsx("path",{opacity:".5",d:"M9.033 21H9zm.03 0c.796-.006 1.476-.506 2.51-1.5H21a.75.75 0 0 1 0 1.5z"})]}),id=({className:e})=>n.jsxs("svg",{className:e,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("path",{d:"M12 6.5V12l3.5 2"})]}),cd=({className:e})=>n.jsxs("svg",{className:e,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd","aria-hidden":"true",children:[n.jsx("path",{d:"M15.326 22.704h-2.26a7.4 7.4 0 0 1-1.419-.21a7.4 7.4 0 0 1-1.11-.63a1.5 1.5 0 0 0-.51-.13c-.43 0-.89.4-1.36.62a.23.23 0 0 1-.26 0c-.1-.06-.06-.19-.06-.32a9 9 0 0 0 0-1.36a.56.56 0 0 0-.32-.46a.54.54 0 0 0-.63.11c-.06.06-.22.46-.3.61l-.589.77a3.4 3.4 0 0 1-1 .74a1.11 1.11 0 0 1-1 0a2.34 2.34 0 0 1-1.13-1.6a17 17 0 0 0 1.57-3c.19-.449.36-.919.51-1.389s.24-1 .33-1.44c0 0 .07-.54.1-.74a1 1 0 0 0 0-.12a.5.5 0 0 0-.091-.393a.55.55 0 0 0-.599-.206a3.36 3.36 0 0 0-2 1.47a7.26 7.26 0 0 0-1.16 3.199a7.1 7.1 0 0 0 .15 2.89A8.3 8.3 0 0 1 .18 23.113a.35.35 0 1 0 .4.57a8.7 8.7 0 0 0 1.86-1.64c.3.67.814 1.221 1.46 1.57a2.3 2.3 0 0 0 1.68.13a4 4 0 0 0 1.759-1.18c.074.26.236.487.46.64a1.2 1.2 0 0 0 1 .19c.292-.104.562-.26.8-.46c.14-.09.24-.22.38-.22s.64.35 1 .52q.2.103.419.16c.53.101 1.07.158 1.61.17c.76 0 1.54 0 2.3-.07a.39.39 0 0 0 .277-.664a.4.4 0 0 0-.258-.126M3.27 18.454a6.3 6.3 0 0 1 .92-2.659q.16-.263.37-.49a9 9 0 0 1-.19.91q-.133.665-.34 1.31a20 20 0 0 1-.77 1.83a7 7 0 0 1 .01-.9"}),n.jsx("path",{d:"M23.935 5.367a.38.38 0 0 0-.55 0q-.629.492-1.18 1.07c-.65.65-1.25 1.34-1.91 2a.35.35 0 0 0-.13-.44c-.56-.5-1.09-1-1.67-1.49l-.75-.59a9 9 0 0 0-.799-.53c-.56-.34-1.14-.62-1.71-.92c.43-1.3.91-2.589 1.37-3.829a.36.36 0 0 0-.19-.46a.35.35 0 0 0-.45.19c-.6 1.28-1.22 2.59-1.78 3.93c-.39.9-.74 1.81-1 2.719a.72.72 0 0 0 .37.77l.37.21l1.35.7l2.51 1.49c0 .67-.13 1.64-.25 2.619c-.09.77-.21 1.52-.32 2.08c0 .3 0 .69-.15.64a3.5 3.5 0 0 1-.77.42c-.49.21-1.11.38-1.73.63a17.6 17.6 0 0 1-4.479 1.119c-.19-1.4-.65-4.78-.64-5.24a2.67 2.67 0 0 1 .7-1.999a10 10 0 0 1 3.24-2a.35.35 0 0 0 .19-.46a.34.34 0 0 0-.45-.2a10.2 10.2 0 0 0-3.86 1.78a3.71 3.71 0 0 0-1.15 2.9c0 .5.75 3.76 1.06 5.089l.12.51c0 .15-.38 1.48 6.41-.54a5.4 5.4 0 0 0 2.439-1.26c.131-.18.217-.39.25-.61a10 10 0 0 0 .17-1.55c.05-1.12 0-2.489 0-3.479h.07a.74.74 0 0 0 .68.05q.668-.428 1.22-1c.85-.85 1.549-1.84 2.339-2.749q.459-.569 1-1.06a.4.4 0 0 0 .06-.51m-4.18 3.54c-.81.84-.23.83-2.46-.58q-.659-.42-1.379-.81l-1.4-.69c.13-.52.3-1 .46-1.56c.41.38.8.78 1.23 1.14c.25.21.5.4.76.58s.52.36.8.53c.64.39 1.29.74 1.94 1.11a.37.37 0 0 0 .27.06z"}),n.jsx("path",{d:"M11.387 16.825c.258-.184.475-.419.64-.69c.15-.24.26-.32.39-.57c.3-.6.54-1.2.8-1.79c2.21.56 2.52-.9 2.57-1.35a1.92 1.92 0 0 0-.92-1.829a2.21 2.21 0 0 0-1.91-.17a2 2 0 0 0-1.09 1.57a1.41 1.41 0 0 0 .6 1.44c-.37.48-.75.95-1.12 1.45l-.48.69a2.7 2.7 0 0 0-.35.89c-.13.699.33.719.87.36m1.64-4.549a.9.9 0 0 1 .44-.63a1 1 0 0 1 .82.07a.77.77 0 0 1 .45.68c0 .58-.55 1-1.51.42a.43.43 0 0 1-.2-.54"})]}),ld=({className:e})=>n.jsx("svg",{className:e,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("path",{d:"M20 6L9 17l-5-5"})}),be={backdrop:"_backdrop_i868n_1",visible:"_visible_i868n_41",modal:"_modal_i868n_65",cuerpo_modal:"_cuerpo_modal_i868n_107",encabezado:"_encabezado_i868n_155",titulo:"_titulo_i868n_169",boton_cerrar:"_boton_cerrar_i868n_183",texto_esc:"_texto_esc_i868n_233",icono_x:"_icono_x_i868n_247",contenedor_lienzo:"_contenedor_lienzo_i868n_259",area_firma:"_area_firma_i868n_269",superficie_lienzo:"_superficie_lienzo_i868n_283",lienzo:"_lienzo_i868n_291",lienzo_deshabilitado:"_lienzo_deshabilitado_i868n_321",barra_acciones:"_barra_acciones_i868n_331",grupo_izquierda:"_grupo_izquierda_i868n_351",grupo_derecha:"_grupo_derecha_i868n_363",separador:"_separador_i868n_375",boton_accion:"_boton_accion_i868n_387",contenedor_guardar:"_contenedor_guardar_i868n_447",boton_texto_con_icono:"_boton_texto_con_icono_i868n_459",accion_texto:"_accion_texto_i868n_471",icono_boton_accion:"_icono_boton_accion_i868n_481",icono:"_icono_i868n_247",contenedor_consentimiento:"_contenedor_consentimiento_i868n_507",texto_consentimiento:"_texto_consentimiento_i868n_521",consentimiento_fila:"_consentimiento_fila_i868n_537",toggle_consentimiento:"_toggle_consentimiento_i868n_551",contenedor_subir_oculto:"_contenedor_subir_oculto_i868n_559",boton_adjuntar:"_boton_adjuntar_i868n_571",input_archivo:"_input_archivo_i868n_611",input_validacion_firma:"_input_validacion_firma_i868n_619",bloque_firma:"_bloque_firma_i868n_647",bloque_encabezado:"_bloque_encabezado_i868n_675",bloque_titulo:"_bloque_titulo_i868n_687",marca_requerido:"_marca_requerido_i868n_703",bloque_preview:"_bloque_preview_i868n_713",bloque_preview_imagen:"_bloque_preview_imagen_i868n_743",bloque_preview_placeholder:"_bloque_preview_placeholder_i868n_757",placeholder_icono:"_placeholder_icono_i868n_781",placeholder_texto:"_placeholder_texto_i868n_813",placeholder_sugerencia:"_placeholder_sugerencia_i868n_829",placeholder_linea:"_placeholder_linea_i868n_845",bloque_acciones:"_bloque_acciones_i868n_859",accion_agregar_firma:"_accion_agregar_firma_i868n_873",accion_eliminar_firma:"_accion_eliminar_firma_i868n_875"},dd=8,ud=1.2,wr=4.2,fd=1.8,cs=(e,t,r)=>Math.max(t,Math.min(r,e)),hd=(e,t)=>{const r=t.x-e.x,a=t.y-e.y;return Math.sqrt(r*r+a*a)},ls=e=>Number.isFinite(e)?e:performance.now(),_d=()=>{const e=_.useRef(null),[t,r]=_.useState(!0),[a,o]=_.useState(!1),[s,i]=_.useState([]),c=_.useRef([]),l=_.useRef({color:"#111827",enabled:!0}),d=_.useRef(null),h=_.useRef([]),g=_.useRef(0),f=_.useRef(wr),u=_.useRef(!1),v=_.useCallback(()=>e.current?.getContext("2d")??null,[]),p=_.useCallback(()=>v(),[v]),m=_.useCallback(()=>{const N=e.current,k=v();N&&k&&k.clearRect(0,0,N.width,N.height),r(!0),c.current=[],i([]),h.current=[],d.current=null,f.current=wr,u.current=!1},[v]),w=_.useCallback(()=>{u.current=!0,r(!1)},[]),b=_.useCallback((N,k)=>{const A=Math.max(1,k.t-N.t),$=hd(N,k)/A,I=(wr-$*fd)*cs(k.pressure||.5,.35,1),L=cs(I,ud,wr),H=f.current+(L-f.current)*.25;return f.current=H,H},[]),y=_.useCallback((N,k)=>{N.strokeStyle=l.current.color,N.lineWidth=k,N.lineCap="round",N.lineJoin="round"},[]),E=_.useCallback((N,k)=>{const A=p();if(!A)return;const O=b(N,k);y(A,O),A.beginPath(),A.moveTo(N.x,N.y),A.quadraticCurveTo(N.x,N.y,k.x,k.y),A.stroke(),r(!1)},[b,p,y]),S=_.useCallback(N=>{const k=e.current;if(!k)return{pressure:.5,t:performance.now(),x:0,y:0};const A=k.getBoundingClientRect(),O=k.width/A.width,$=k.height/A.height;return{pressure:N.pressure&&N.pressure>0?N.pressure:.5,t:N.timeStamp||performance.now(),x:(N.clientX-A.left)*O,y:(N.clientY-A.top)*$}},[]),C=_.useCallback(N=>{if(!l.current.enabled)return;N.preventDefault();const k=e.current;if(!k)return;k.setPointerCapture(N.pointerId);const A=S(N);o(!0),d.current=A,h.current=[A],g.current=ls(N.timeStamp)},[S]),T=_.useCallback(N=>{if(!a||!l.current.enabled)return;N.preventDefault();const k=ls(N.timeStamp);if(k-g.current<dd)return;g.current=k;const A=S(N),O=d.current;O&&(E(O,A),d.current=A,h.current.push(A))},[E,a,S]),F=_.useCallback(N=>{if(N&&e.current?.hasPointerCapture(N.pointerId)&&e.current.releasePointerCapture(N.pointerId),a&&h.current.length>0){const k=[...c.current,{puntos:[...h.current]}];c.current=k,i(k)}o(!1),d.current=null,h.current=[]},[a]),D=_.useCallback((N,k,A)=>{if(!(k.puntos.length<2))for(let O=1;O<k.puntos.length;O++){const $=k.puntos[O-1],x=k.puntos[O],I=b($,x);N.strokeStyle=A??l.current.color,N.lineWidth=I,N.lineCap="round",N.lineJoin="round",N.beginPath(),N.moveTo($.x,$.y),N.quadraticCurveTo($.x,$.y,x.x,x.y),N.stroke()}},[b]),M=_.useCallback(()=>{if(c.current.length===0)return;const N=c.current.slice(0,-1);c.current=N,i(N);const k=e.current;if(!k)return;const A=v();A&&(A.clearRect(0,0,k.width,k.height),f.current=wr,N.forEach(O=>D(A,O)),r(N.length===0&&!u.current))},[v,D]),U=_.useCallback((N={})=>{const k=e.current;if(!k||t&&c.current.length===0&&!u.current)return null;const{backgroundColor:A,format:O,quality:$,strokeColor:x}=N;if(!A&&!x)return k.toDataURL("image/png");const I=document.createElement("canvas");I.width=k.width,I.height=k.height;const L=I.getContext("2d");if(!L)return null;A&&(L.fillStyle=A,L.fillRect(0,0,I.width,I.height)),x&&c.current.length>0&&!u.current?(f.current=wr,c.current.forEach(z=>D(L,z,x))):L.drawImage(k,0,0);const X=O??"image/png",H=$??.85;return X==="image/png"?I.toDataURL(X):I.toDataURL(X,H)},[t,D]),V=_.useCallback(N=>{const k=e.current,A=v();if(!k||!A)return;if(l.current={color:N.color,enabled:N.enabled??!0},k.style.touchAction="none",k.style.userSelect="none",!l.current.enabled)return()=>{};const O=L=>C(L),$=L=>T(L),x=L=>F(L),I=L=>F(L);return k.addEventListener("pointerdown",O,{passive:!1}),k.addEventListener("pointermove",$,{passive:!1}),k.addEventListener("pointerup",x,{passive:!1}),k.addEventListener("pointerleave",x,{passive:!1}),k.addEventListener("pointercancel",I,{passive:!1}),()=>{k.removeEventListener("pointerdown",O),k.removeEventListener("pointermove",$),k.removeEventListener("pointerup",x),k.removeEventListener("pointerleave",x),k.removeEventListener("pointercancel",I)}},[F,C,T,v]);return _.useEffect(()=>{f.current=wr},[s.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:M,estaVacio:t,limpiarCanvas:m,marcarConContenido:w,obtenerDatosFirma:U,puedeDeshacer:s.length>0}},ds=_.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:r,className:a,closeOnBackdropClick:o=!1,firmaInicial:s=null,isOpen:i=!1,isRequired:c=!1,mostrarBotonSubir:l=!0,name:d,onClose:h,onConfirm:g,readonly:f=!1,readonlyPostGuardado:u=!1,requiredMessage:v="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:m="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:b="Eliminar firma",textoEstadoGuardada:y="Guardada",textoEstadoPendiente:E="Pendiente",textoGuardar:S="Guardar firma",textoLimpiar:C="Limpiar",textoModificar:T="Modificar firma",textoReemplazarFirma:F="Reemplazar firma",textoSolicitarFirma:D="Agregar firma",tituloBloque:M="Firma del responsable",titulo:U="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:N=!0,firebasePath:k,firebaseStorage:A,onFirebaseUploadSuccess:O,onFirebaseUploadError:$,fondoTransparente:x=!0,id:I,"data-testid":L},X)=>{const{canvasRef:H,configurarCanvas:z,deshacerUltimoTrazo:q,estaVacio:B,limpiarCanvas:K,marcarConContenido:Y,obtenerDatosFirma:Q,puedeDeshacer:ee}=_d(),se=_.useRef(null),ce=_.useRef(null),ae=_.useRef(null),de=_.useId(),oe=I??`signature-${de}`,fe=`${oe}-bloque-title`,pe=`${oe}-toggle`,te=`${oe}-texto`,ue=`${oe}-dialog-title`,ge=`${oe}-dialog-description`,[ve,J]=_.useState(s),[P,G]=_.useState(!1),[W,re]=_.useState(!!s),[le,he]=_.useState(!1),Ce=_.useCallback(()=>{G(!1),he(!1),K()},[K]),{modalAbierto:Ne,setModalAbierto:Ie,isClosing:Ee,anchoCanvas:Ze,cerrarConAnimacion:tt,cerrar:Fe}=Ql({isOpen:i,ancho:t,contenedorLienzoRef:ae,alCerrar:()=>{Ce(),h?.()}}),{subiendo:De,subirFirma:rt,eliminarFirma:Ae}=Zl({firebasePath:k,firebaseStorage:A,onSubidaExitosa:O,onError:$}),Le=Math.round(Ze*e/Math.max(1,t)),$e=f||u&&W,_t=!f&&!(u&&W),Pe=_.useCallback(Xe=>{const Oe=H.current,Dt=Oe?.getContext("2d");if(!Oe||!Dt)return;const Nt=new Image;Nt.onload=()=>{Dt.clearRect(0,0,Oe.width,Oe.height);const Et=Oe.width/Oe.height,tr=Nt.width/Nt.height;let rr=Oe.width,mr=Oe.height,Mt=0,br=0;tr>Et?(mr=Oe.width/tr,br=(Oe.height-mr)/2):(rr=Oe.height*tr,Mt=(Oe.width-rr)/2),Dt.drawImage(Nt,Mt,br,rr,mr),Y(),he(!0)},Nt.src=Xe},[H,Y]),lt=_.useCallback(()=>{K(),J(null),he(!1),re(!1)},[K]),Wt=_.useCallback(()=>{$e||(K(),he(!1))},[$e,K]),Bt=_.useCallback(async()=>{$e||De||await Ae(ve)&&(lt(),g?.(""))},[$e,De,Ae,ve,lt,g]),Se=_.useCallback(()=>{f||(K(),re(!1),he(!1),G(!1))},[K,f]),je=_.useCallback(Xe=>{if($e)return;const Oe=Xe.target.files?.[0];if(!Oe)return;const Dt=new FileReader;Dt.onload=Nt=>{const Et=Nt.target?.result;typeof Et=="string"&&(K(),Pe(Et))},Dt.readAsDataURL(Oe)},[$e,Pe,K]),kt=_.useCallback(()=>{$e||se.current?.click()},[$e]),Re=_.useCallback(async()=>{if($e||Ee||De)return;const Xe=Q(x?{format:"image/png",strokeColor:"#111827"}:{backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!(!Xe||!P))try{const Oe=await rt(Xe);tt(()=>{J(Oe),re(!0),g?.(Oe),Ce(),h?.()})}catch(Oe){console.error("Error al subir la firma a Firebase:",Oe),$?.(Oe instanceof Error?Oe:new Error(String(Oe)))}},[$e,Ee,De,Q,x,P,rt,tt,g,Ce,h,$]);_.useEffect(()=>{J(s),re(!!s)},[s]),_.useImperativeHandle(X,()=>({limpiar:K,obtenerDatosFirma:Q,estaVacio:()=>B}),[B,K,Q]),_.useEffect(()=>{if(!Ne)return;const Xe=z({color:"#111827",enabled:!$e});return()=>{Xe?.()}},[$e,z,Ne]),_.useEffect(()=>{Ne||Ce()},[Ce,Ne]),_.useEffect(()=>{if(!Ne)return;const Xe=Oe=>{if(Oe.key==="Escape"){Fe();return}if(Oe.ctrlKey&&Oe.key.toLowerCase()==="z"){Oe.preventDefault(),!$e&&ee&&q();return}Oe.ctrlKey&&Oe.key==="Enter"&&(Oe.preventDefault(),$e||Re())};return document.addEventListener("keydown",Xe),()=>document.removeEventListener("keydown",Xe)},[$e,q,Fe,Re,Ne,ee]),_.useEffect(()=>{const Xe=ce.current;if(!Xe)return;if(c&&!!!ve){Xe.setCustomValidity(v);return}Xe.setCustomValidity("")},[ve,c,v]);const xt=_.useCallback(Xe=>{Ee||!o||Xe.target===Xe.currentTarget&&Fe()},[o,Ee,Fe]),At=$e,Nr=$e||le,Xr=$e||!W&&(B&&!le||!P),Ir=()=>{f||(ve&&Se(),Ie(!0))};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{id:oe,className:`${be.bloque_firma} ${a||""}`,"data-testid":L??(d?`signature-${d}`:oe),role:"group","aria-labelledby":fe,children:[n.jsxs("div",{className:be.bloque_encabezado,children:[n.jsxs("span",{id:fe,className:be.bloque_titulo,children:[M,c&&n.jsx("span",{className:be.marca_requerido,"aria-hidden":"true",children:"*"})]}),n.jsx(Ta,{color:ve?"success":"warning",size:"sm",variant:"soft",startIcon:ve?n.jsx(ld,{}):n.jsx(id,{}),children:ve?y:E})]}),n.jsxs("div",{className:be.bloque_preview,style:r?{aspectRatio:r}:void 0,children:[(c||d)&&n.jsx("input",{ref:ce,className:be.input_validacion_firma,"aria-hidden":"true",name:d,required:c,tabIndex:-1,type:"text",value:ve?"signed":"",onChange:()=>{},onInvalid:Xe=>{c&&!ve&&Xe.currentTarget.setCustomValidity(v)},onInput:Xe=>{Xe.currentTarget.setCustomValidity("")}}),ve?n.jsx("img",{src:ve,alt:"Firma guardada",className:be.bloque_preview_imagen}):n.jsxs("span",{className:be.bloque_preview_placeholder,children:[n.jsx(cd,{className:be.placeholder_icono}),n.jsx("span",{className:be.placeholder_texto,children:"Sin firma registrada"}),!f&&n.jsx("span",{className:be.placeholder_sugerencia,children:"El botón “Agregar firma” permite firmar a mano o adjuntar una imagen"}),n.jsx("span",{className:be.placeholder_linea,"aria-hidden":"true"})]})]}),!f&&(V||N&&!!ve)&&n.jsxs("div",{className:be.bloque_acciones,children:[V&&n.jsx(Ye,{color:"primary",size:"sm",variant:"outline",onClick:Ir,className:be.accion_agregar_firma,isDisabled:$e||Ee,children:n.jsxs("span",{className:be.boton_texto_con_icono,children:[ve?n.jsx(ad,{className:be.icono_boton_accion}):n.jsx(od,{className:be.icono_boton_accion}),n.jsx("span",{className:be.accion_texto,children:ve?F:D})]})}),N&&ve&&n.jsx(Ye,{color:"danger",size:"sm",variant:"bordered",onClick:Bt,className:be.accion_eliminar_firma,isDisabled:$e||Ee||De,children:n.jsxs("span",{className:be.boton_texto_con_icono,children:[n.jsx(td,{className:be.icono_boton_accion}),n.jsx("span",{className:be.accion_texto,children:b})]})})]})]}),Ne&&n.jsx("div",{className:`${be.backdrop} ${Ee?"":be.visible}`,onClick:xt,children:n.jsxs("div",{className:`${be.modal} ${Ee?"":be.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":ue,"aria-describedby":ge,children:[n.jsxs("header",{className:be.encabezado,children:[n.jsx("h2",{id:ue,className:be.titulo,children:U}),n.jsxs("button",{className:be.boton_cerrar,onClick:Fe,type:"button","aria-label":"Cerrar",children:[n.jsx("span",{className:be.texto_esc,children:"ESC"}),n.jsx(ed,{className:be.icono_x})]})]}),n.jsxs("div",{className:be.cuerpo_modal,children:[n.jsx("div",{className:be.contenedor_lienzo,ref:ae,children:n.jsxs("div",{className:be.area_firma,children:[n.jsx("div",{className:be.superficie_lienzo,children:n.jsx("canvas",{ref:H,className:`${be.lienzo} ${At?be.lienzo_deshabilitado:""}`,width:Ze,height:Le,style:{height:`${Le}px`,pointerEvents:Nr?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),_t&&n.jsxs("div",{className:be.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[n.jsxs("div",{className:be.grupo_izquierda,children:[n.jsxs("button",{className:be.boton_accion,onClick:q,type:"button",disabled:!ee||At,"aria-label":w,children:[n.jsx(rd,{className:be.icono,"aria-hidden":"true"}),n.jsx("span",{children:w})]}),n.jsx("span",{className:be.separador,"aria-hidden":"true",children:"|"}),n.jsxs("button",{className:be.boton_accion,onClick:Wt,type:"button",disabled:B&&!le||At,"aria-label":C,children:[n.jsx(sd,{className:be.icono,"aria-hidden":"true"}),n.jsx("span",{children:C})]})]}),l&&n.jsx("div",{className:be.grupo_derecha,children:n.jsxs("button",{className:be.boton_adjuntar,onClick:kt,type:"button",disabled:$e,children:[n.jsx(nd,{className:be.icono,"aria-hidden":"true"}),p]})})]})]})}),_t&&n.jsxs(n.Fragment,{children:[n.jsx("div",{id:ge,className:be.contenedor_consentimiento,children:n.jsxs("div",{className:be.consentimiento_fila,children:[n.jsx(Aa,{id:pe,isSelected:P,onChange:G,color:"primary",size:"md",isDisabled:$e,"aria-describedby":te,className:be.toggle_consentimiento}),n.jsx("label",{htmlFor:pe,id:te,className:be.texto_consentimiento,children:m})]})}),n.jsx("div",{className:be.contenedor_guardar,children:n.jsx(Ye,{color:"primary",variant:"light-active",radius:"full",onClick:W&&!u?Se:Re,type:"button",isLoading:De,isDisabled:Xr||De,children:De?"Guardando...":W&&!u?T:S})})]}),_t&&l&&n.jsx("div",{className:be.contenedor_subir_oculto,children:n.jsx("input",{ref:se,type:"file",accept:"image/*",className:be.input_archivo,onChange:je,"aria-label":"Subir imagen de firma"})})]})]})})]})});ds.displayName="Signature";const pd=({size:e="1em",...t})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]}),gd=({size:e="1em",...t})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[n.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),vd=({size:e="1em",...t})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[n.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),n.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),n.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),n.jsx("path",{d:"m2 2 20 20"})]}),Qe={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},us=_.forwardRef((e,t)=>{const{type:r="text",value:a,defaultValue:o,placeholder:s,variant:i="bordered",color:c="default",size:l="md",radius:d="md",fullWidth:h=!0,disableAnimation:g=!1,label:f,description:u,errorMessage:v,startContent:p,endContent:m,isRequired:w=!1,isReadOnly:b=!1,isDisabled:y=!1,isClearable:E=!1,isInvalid:S,validationState:C,validate:T,className:F,classNames:D,style:M,onChange:U,onClear:V,onValueChange:N,onFocus:k,onBlur:A,onKeyDown:O,id:$,name:x,autoComplete:I,autoFocus:L,maxLength:X,minLength:H,pattern:z,"data-testid":q,...B}=e,K=_.useRef(null),Y=_.useId(),Q=$??`input-text-${Y}`;_.useImperativeHandle(t,()=>K.current);const ee=a!==void 0,[se,ce]=_.useState(o??""),ae=ee?a:se,[de,oe]=_.useState(!1),[fe,pe]=_.useState(!1),te=_.useMemo(()=>{if(!T)return null;const Ae=T(ae);return Ae===!0||Ae==null?null:typeof Ae=="string"?Ae:typeof Ae=="object"&&"message"in Ae?Ae.message??"Entrada inválida":"Entrada inválida"},[ae,T]),ue=_.useMemo(()=>S!==void 0?S:C==="invalid"?!0:C==="valid"?!1:!!te,[S,C,te]),ge=C==="valid"&&!ue,ve={invalido:ue,mensaje:te},J=ae.length>0,P=r==="password",G=P&&fe?"text":r,W=E&&J&&!b&&!y,re=_.useCallback(Ae=>{if(y||b)return;const Le=Ae.target.value;ee||ce(Le),U?.(Le),N?.(Le)},[ee,y,b,U,N]),le=_.useCallback(Ae=>{oe(!0),k?.(Ae)},[k]),he=_.useCallback(Ae=>{oe(!1),A?.(Ae)},[A]),Ce=_.useCallback(()=>{y||b||(ee||ce(""),U?.(""),N?.(""),V?.(),K.current?.focus())},[ee,y,b,U,N,V]),Ne=_.useCallback(Ae=>{Ae.key==="Escape"&&E&&J&&Ce(),O?.(Ae)},[E,J,Ce,O]),Ie=_.useCallback(()=>{pe(Ae=>!Ae),requestAnimationFrame(()=>K.current?.focus())},[]),Ee=q??(x?`input-${x}`:Q),Ze=u?`${Q}-desc`:void 0,tt=ue?`${Q}-err`:void 0,Fe=[Ze,tt].filter(Boolean).join(" ")||void 0,De=typeof v=="function"?v(ve):v??te,rt=ne(Qe.contenedor_base,Qe[`variante_${i}`],Qe[`tam_${l}`],Qe[`radio_${d}`],Qe[`color_${c}`],{[Qe.ancho_total]:h,[Qe.sin_animacion]:g,[Qe.deshabilitado]:y,[Qe.solo_lectura]:b,[Qe.invalido]:ue,[Qe.valido]:ge,[Qe.enfocado]:de,[Qe.tiene_contenido]:J},F,D?.base);return n.jsxs("div",{className:rt,style:M,children:[f&&n.jsxs("label",{className:ne(Qe.etiqueta,D?.label),htmlFor:Q,children:[f,w&&n.jsx("span",{className:Qe.marca_requerido,"aria-hidden":"true",children:"*"})]}),n.jsxs("div",{className:ne(Qe.envoltorio_input,D?.inputWrapper),children:[p&&n.jsx("span",{className:Qe.contenido_inicio,children:p}),n.jsx("div",{className:ne(Qe.envoltorio_interno,D?.innerWrapper),children:n.jsx("input",{...B,ref:K,id:Q,name:x,type:G,value:ee?ae:void 0,defaultValue:ee?void 0:o,placeholder:s,disabled:y,readOnly:b,required:w,autoComplete:I,autoFocus:L,maxLength:X,minLength:H,pattern:z,"aria-invalid":ue||void 0,"aria-describedby":Fe,"aria-required":w,"data-testid":Ee,className:ne(Qe.entrada,D?.input),onChange:re,onFocus:le,onBlur:he,onKeyDown:Ne})}),W&&n.jsx("button",{type:"button",className:ne(Qe.boton_limpiar,D?.clearButton),onClick:Ce,tabIndex:-1,"aria-label":"Limpiar campo",children:n.jsx(pd,{size:"0.75em"})}),P&&n.jsx("button",{type:"button",className:Qe.boton_password,onClick:Ie,tabIndex:-1,"aria-label":fe?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":fe,children:fe?n.jsx(vd,{}):n.jsx(gd,{})}),m&&n.jsx("span",{className:Qe.contenido_final,children:m})]}),u&&!ue&&n.jsx("div",{id:Ze,className:ne(Qe.descripcion,D?.description),children:u}),ue&&De&&n.jsx("div",{id:tt,className:ne(Qe.mensaje_error,D?.errorMessage),role:"alert",children:De})]})});us.displayName="InputText";function yr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yr(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:r=!1,separadorDecimal:a=".",escalaDecimal:o,decimalesFijos:s=!1,prefijo:i="",sufijo:c=""}=t;let l;o!==void 0?l=s?e.toFixed(o):String(Math.round(e*Math.pow(10,o))/Math.pow(10,o)):l=String(e);const[d,h]=l.split(".");let g=d;if(r){const u=typeof r=="string"?r:",";g=d.replace(/\B(?=(\d{3})+(?!\d))/g,u)}let f=g;return h!==void 0?f+=a+h:s&&o&&o>0&&(f+=a+"0".repeat(o)),`${i}${f}${c}`}function fs(e,t){if(!e||e.trim()==="")return;const{separadorMiles:r=!1,separadorDecimal:a=".",prefijo:o="",sufijo:s="",permitirNegativo:i=!0}=t;let c=e;if(o&&(c=c.replace(new RegExp(`^${yr(o)}`),"")),s&&(c=c.replace(new RegExp(`${yr(s)}$`),"")),r){const d=typeof r=="string"?r:",";c=c.replace(new RegExp(yr(d),"g"),"")}a!=="."&&(c=c.replace(new RegExp(yr(a)),".")),i||(c=c.replace(/-/g,""));const l=parseFloat(c);return Number.isNaN(l)?void 0:l}function Na(e,t,r){let a=e;return t!==void 0&&a<t&&(a=t),r!==void 0&&a>r&&(a=r),a}function hs(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function _s(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}function md(e,t){if(!e)return e;const{separadorMiles:r=!1,separadorDecimal:a=".",escalaDecimal:o,decimalesFijos:s=!1,prefijo:i="",sufijo:c=""}=t,l=e.startsWith("-"),d=l?e.slice(1):e,[h,g]=d.split(a);let f=g??"";o!==void 0&&(f=f.slice(0,o),s&&(f=f.padEnd(o,"0")));let u=h||"";if(r&&u){const p=typeof r=="string"?r:",";u=u.replace(/\B(?=(\d{3})+(?!\d))/g,p)}let v=(l?"-":"")+u;return g!==void 0?v+=a+f:s&&o&&o>0&&(v+=a+"0".repeat(o)),`${i}${v}${c}`}function ps(e,t){const{separadorMiles:r,prefijo:a="",sufijo:o=""}=t;let s=e;if(a&&(s=s.replace(new RegExp(`^${yr(a)}`),"")),o&&(s=s.replace(new RegExp(`${yr(o)}$`),"")),r){const i=typeof r=="string"?r:",";s=s.replace(new RegExp(yr(i),"g"),"")}return s}const bd=e=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[n.jsx("path",{d:"M5 12h14"}),n.jsx("path",{d:"M12 5v14"})]}),wd=e=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:n.jsx("path",{d:"M5 12h14"})}),et={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},gs=_.forwardRef((e,t)=>{const{value:r,defaultValue:a,placeholder:o,variant:s="bordered",color:i="default",size:c="md",radius:l="md",fullWidth:d=!0,disableAnimation:h=!1,label:g,description:f,errorMessage:u,startContent:v,endContent:p,isRequired:m=!1,isReadOnly:w=!1,isDisabled:b=!1,isInvalid:y,validationState:E,validate:S,className:C,classNames:T,style:F,min:D,max:M,step:U=1,decimalScale:V,fixedDecimalScale:N=!1,thousandSeparator:k=!1,decimalSeparator:A=".",prefix:O="",suffix:$="",allowNegative:x=!0,allowDecimal:I=!0,hideControls:L=!1,clampBehavior:X="error",onChange:H,onValueChange:z,onFocus:q,onBlur:B,onKeyDown:K,id:Y,name:Q,"data-testid":ee,...se}=e,ce=_.useRef(null),ae=_.useId(),de=Y??`input-numeric-${ae}`;_.useImperativeHandle(t,()=>ce.current);const oe=r!==void 0,[fe,pe]=_.useState(a),[te,ue]=_.useState(""),[ge,ve]=_.useState(!1),J=oe?r===""?void 0:r:fe,P=_.useMemo(()=>({separadorMiles:k,separadorDecimal:A,escalaDecimal:I?V:0,decimalesFijos:N,prefijo:O,sufijo:$,permitirNegativo:x}),[k,A,V,N,O,$,x,I]),G=_.useRef(J);G.current=J;const W=_.useRef(P);W.current=P;const re=_.useRef(ge);re.current=ge;const le=_.useRef(""),he=_.useMemo(()=>{if(X==="error"&&J!==void 0){if(D!==void 0&&J<D)return`El valor debe ser mayor o igual a ${D}`;if(M!==void 0&&J>M)return`El valor debe ser menor o igual a ${M}`}if(!S)return null;const Se=hs(S(J));return Se.invalido?Se.mensaje:null},[J,S,X,D,M]),Ce=_.useMemo(()=>y!==void 0?y:E==="invalid"?!0:E==="valid"?!1:!!he,[y,E,he]),Ne=E==="valid"&&!Ce,Ie={invalido:Ce,mensaje:he},Ee=_.useCallback(Se=>{oe||pe(Se),H?.(Se),z?.(Yr(Se,P),Se)},[oe,H,z,P]),Ze=_.useCallback(Se=>{let je=(J??0)+U*Se;X!=="error"&&(je=Na(je,D,M)),V!==void 0&&(je=_s(je,V)),Ee(je),ue(Yr(je,P))},[J,U,D,M,X,V,Ee,P]),tt=_.useCallback(Se=>{if(b||w)return;const je=A===","?",":".";let kt="0-9";I&&(kt+=je),x&&(kt+="-");let Re=Se.target.value.replace(new RegExp(`[^${kt}]`,"g"),"");if(I){const xt=Re.split(je);xt.length>2&&(Re=xt[0]+je+xt.slice(1).join(""))}if(x&&Re.includes("-")){const xt=Re.replace(/-/g,"");Re=Re.startsWith("-")?"-"+xt:xt}le.current=Re,ue(Re),Ee(fs(Re,P))},[b,w,P,Ee,A,x,I]),Fe=_.useCallback(Se=>{const je=ps(le.current,W.current);le.current=je,ve(!0),je&&ue(je),q?.(Se)},[q]),De=_.useCallback(Se=>{const je=G.current,kt=W.current;if(ve(!1),X==="blur"&&je!==void 0){const Re=Na(je,D,M);if(Re!==je){Ee(Re),ue(Yr(Re,kt)),B?.(Se);return}}X!=="error"&&ue(md(le.current,kt)),B?.(Se)},[X,D,M,Ee,B]),rt=_.useCallback(Se=>{Se.key==="ArrowUp"?(Se.preventDefault(),Ze(1)):Se.key==="ArrowDown"&&(Se.preventDefault(),Ze(-1));const je=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],kt=Se.ctrlKey||Se.metaKey,Re=I&&(Se.key===A||Se.key==="."||Se.key===","),xt=Se.key==="-"&&x,At=/^[0-9]$/.test(Se.key);!je.includes(Se.key)&&!kt&&!Re&&!xt&&!At&&Se.preventDefault(),K?.(Se)},[Ze,K,A,x,I]);_.useEffect(()=>{if(!re.current){const Se=Yr(J,P);le.current=ps(Se,P),ue(Se)}},[J,P]),_.useLayoutEffect(()=>{ce.current&&ce.current.setCustomValidity(X==="error"&&he?he:"")},[X,he]);const Ae=ee??(Q?`input-${Q}`:de),Le=f?`${de}-desc`:void 0,$e=Ce?`${de}-err`:void 0,_t=[Le,$e].filter(Boolean).join(" ")||void 0,Pe=typeof u=="function"?u(Ie):u??he,lt=M===void 0||(J??0)<M,Wt=D===void 0||(J??0)>D,Bt=ne(et.contenedor_base,et[`variante_${s}`],et[`tam_${c}`],et[`radio_${l}`],et[`color_${i}`],{[et.ancho_total]:d,[et.sin_animacion]:h,[et.deshabilitado]:b,[et.solo_lectura]:w,[et.invalido]:Ce,[et.valido]:Ne,[et.enfocado]:ge},C,T?.base);return n.jsxs("div",{className:Bt,style:F,children:[g&&n.jsxs("label",{className:ne(et.etiqueta,T?.label),htmlFor:de,children:[g,m&&n.jsx("span",{className:et.marca_requerido,"aria-hidden":"true",children:"*"})]}),n.jsxs("div",{className:ne(et.envoltorio_input,T?.inputWrapper),children:[n.jsxs("div",{className:ne(et.envoltorio_interno,T?.innerWrapper),children:[v&&n.jsx("span",{className:et.contenido_inicio,children:v}),n.jsx("input",{...se,ref:ce,id:de,name:Q,type:"text",inputMode:"decimal",value:te,placeholder:o,disabled:b,readOnly:w,required:m,"aria-invalid":Ce||void 0,"aria-describedby":_t,"aria-required":m,"data-testid":Ae,className:ne(et.entrada,T?.input),onChange:tt,onFocus:Fe,onBlur:De,onKeyDown:rt}),p&&n.jsx("span",{className:et.contenido_final,children:p})]}),!L&&!w&&!b&&n.jsxs("div",{className:ne(et.controles,T?.controls),children:[n.jsx("button",{type:"button",tabIndex:-1,className:ne(et.boton_control,T?.controlButton),disabled:!Wt,onClick:()=>Ze(-1),"aria-label":"Decrementar valor",children:n.jsx(wd,{})}),n.jsx("button",{type:"button",tabIndex:-1,className:ne(et.boton_control,T?.controlButton),disabled:!lt,onClick:()=>Ze(1),"aria-label":"Incrementar valor",children:n.jsx(bd,{})})]})]}),f&&!Ce&&n.jsx("div",{id:Le,className:ne(et.descripcion,T?.description),children:f}),Ce&&Pe&&n.jsx("div",{id:$e,className:ne(et.mensaje_error,T?.errorMessage),role:"alert",children:Pe})]})});gs.displayName="InputNumeric";function yd(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Ia(e,t="es-CO"){if(!e)return"";const r=new Date(e+"T00:00:00");return Number.isNaN(r.getTime())?"":r.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function kd(){return new Date().toISOString().split("T")[0]}function xd(e,t,r){if(!e)return!0;const a=new Date(e).getTime();return!(t&&a<new Date(t).getTime()||r&&a>new Date(r).getTime())}const at={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},Ed=()=>n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]}),Cd=()=>n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[n.jsx("path",{d:"M8 2v4"}),n.jsx("path",{d:"M16 2v4"}),n.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),n.jsx("path",{d:"M3 10h18"}),n.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),n.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),n.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),n.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),n.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),n.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),Sd=()=>n.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]}),Td=({tipo:e,onClick:t,onMouseDown:r})=>n.jsx("button",{type:"button",tabIndex:-1,className:at.boton_icono,onMouseDown:r,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?n.jsx(Ed,{}):n.jsx(Cd,{})}),vs=_.forwardRef((e,t)=>{const{type:r="date",value:a,defaultValue:o,placeholder:s,variant:i="bordered",color:c="default",size:l="md",radius:d="md",fullWidth:h=!0,disableAnimation:g=!1,label:f,description:u,errorMessage:v,startContent:p,isRequired:m=!1,isReadOnly:w=!1,isDisabled:b=!1,isInvalid:y,validationState:E,validate:S,className:C,classNames:T,style:F,min:D,max:M,isClearable:U=!1,onChange:V,onFocus:N,onBlur:k,id:A,name:O,"data-testid":$,...x}=e,I=_.useRef(null),L=_.useId(),X=A??`input-date-${L}`;_.useImperativeHandle(t,()=>I.current);const H=a!==void 0,[z,q]=_.useState(o??""),B=H?a:z,[K,Y]=_.useState(!1),Q=_.useRef(!1),ee=_.useMemo(()=>{if(B&&r!=="time"&&(D||M)){if(D&&B<D)return`La fecha debe ser ${r==="date"?Ia(D):D} o posterior`;if(M&&B>M)return`La fecha debe ser ${r==="date"?Ia(M):M} o anterior`}if(!S)return null;const re=yd(S(B));return re.invalido?re.mensaje:null},[B,S,D,M,r]),se=_.useMemo(()=>y!==void 0?y:E==="invalid"?!0:E==="valid"?!1:!!ee,[y,E,ee]),ce=E==="valid"&&!se,ae={invalido:se,mensaje:ee},de=_.useCallback(re=>{if(b||w)return;Q.current=!1;const le=re.target.value;H||q(le),V?.(le)},[H,b,w,V]),oe=_.useCallback(re=>{Y(!0),N?.(re)},[N]),fe=_.useCallback(re=>{Y(!1),Q.current=!1,k?.(re)},[k]),pe=_.useCallback(re=>{re.preventDefault()},[]),te=_.useCallback(re=>{if(re.preventDefault(),re.stopPropagation(),!(!I.current||b||w)){if(Q.current){Q.current=!1,I.current.blur();return}I.current.focus();try{I.current.showPicker?.(),Q.current=!0}catch{}}},[b,w]),ue=_.useCallback(re=>{re.preventDefault(),re.stopPropagation(),Q.current=!1,H||q(""),V?.(""),I.current?.focus()},[H,V]),ge=$??(O?`input-${O}`:X),ve=u?`${X}-desc`:void 0,J=se?`${X}-err`:void 0,P=[ve,J].filter(Boolean).join(" ")||void 0,G=typeof v=="function"?v(ae):v??ee,W=ne(at.contenedor_base,at[`variante_${i}`],at[`tam_${l}`],at[`radio_${d}`],at[`color_${c}`],{[at.ancho_total]:h,[at.sin_animacion]:g,[at.deshabilitado]:b,[at.solo_lectura]:w,[at.invalido]:se,[at.valido]:ce,[at.enfocado]:K},C,T?.base);return n.jsxs("div",{className:W,style:F,children:[f&&n.jsxs("label",{className:ne(at.etiqueta,T?.label),htmlFor:X,children:[f,m&&n.jsx("span",{className:at.marca_requerido,"aria-hidden":"true",children:"*"})]}),n.jsx("div",{className:ne(at.envoltorio_input,T?.inputWrapper),children:n.jsxs("div",{className:ne(at.envoltorio_interno,T?.innerWrapper),children:[p&&n.jsx("span",{className:at.contenido_inicio,children:p}),n.jsx("input",{...x,ref:I,id:X,name:O,type:r,value:H?B:void 0,defaultValue:H?void 0:o,placeholder:s,disabled:b,readOnly:w,required:m,min:D,max:M,"aria-invalid":se||void 0,"aria-describedby":P,"aria-required":m,"data-testid":ge,className:ne(at.entrada,T?.input),onChange:de,onFocus:oe,onBlur:fe}),U&&B&&!b&&!w&&n.jsx("button",{type:"button",tabIndex:-1,className:ne(at.boton_limpiar,T?.clearButton),onMouseDown:re=>re.preventDefault(),onClick:ue,"aria-label":"Limpiar fecha",children:n.jsx(Sd,{})}),n.jsx(Td,{tipo:r,onClick:te,onMouseDown:pe})]})}),u&&!se&&n.jsx("div",{id:ve,className:ne(at.descripcion,T?.description),children:u}),se&&G&&n.jsx("div",{id:J,className:ne(at.mensaje_error,T?.errorMessage),role:"alert",children:G})]})});vs.displayName="InputDate";const Ad={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function xn({mostrar:e,children:t,tipo:r="desvanecerDeslizar",className:a,...o}){const[s,i]=_.useState(e),[c,l]=_.useState(e?"entrada":null);e&&!s?(i(!0),l("entrada")):!e&&s&&c!=="salida"&&l("salida");const d=()=>{c==="entrada"?l(null):c==="salida"&&(i(!1),l(null))};if(!s)return null;const h=Ad[r||"desvanecer"],g=c?`transicion_${h}_${c}`:"";return n.jsx("div",{...o,onAnimationEnd:d,className:`${g} ${a||""}`.trim(),children:t})}const qt={badges_wrap:"_badges_wrap_1dfuw_15",badges_wrap_visible:"_badges_wrap_visible_1dfuw_23",acciones_grupo:"_acciones_grupo_1dfuw_33",badge_voz:"_badge_voz_1dfuw_41",badge_sm:"_badge_sm_1dfuw_73",badge_md:"_badge_md_1dfuw_85",badge_lg:"_badge_lg_1dfuw_97",badge_estirada:"_badge_estirada_1dfuw_109",badge_icono:"_badge_icono_1dfuw_129",badge_texto:"_badge_texto_1dfuw_155",badge_mic:"_badge_mic_1dfuw_165",badge_tts:"_badge_tts_1dfuw_173",badge_ondas:"_badge_ondas_1dfuw_181",badgeOnda:"_badgeOnda_1dfuw_1",badge_eq:"_badge_eq_1dfuw_219",badgeEq:"_badgeEq_1dfuw_1"};function Ma(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:n.jsxs("g",{fill:"currentColor",children:[n.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),n.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Fa(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:n.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function ms(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[n.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),n.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function $a({tipo:e,texto:t,size:r="md",estirar:a}){const o=e==="mic";return n.jsxs("span",{className:ne(qt.badge_voz,o?qt.badge_mic:qt.badge_tts,qt[`badge_${r}`],a&&qt.badge_estirada),"data-tipo":e,children:[n.jsx("span",{className:qt.badge_icono,children:o?n.jsx(Ma,{}):n.jsx(Fa,{})}),n.jsx("span",{className:qt.badge_texto,children:t}),o?n.jsxs("span",{className:qt.badge_ondas,"aria-hidden":"true",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]}):n.jsxs("span",{className:qt.badge_eq,"aria-hidden":"true",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})]})}function bs({value:e,onChange:t,isDisabled:r,isReadOnly:a,onDictadoCompleto:o,idioma:s="es-ES"}){const[i,c]=_.useState(!1),[l,d]=_.useState(!1),[h,g]=_.useState(null),f=_.useRef(null),u=_.useRef(null),v=_.useRef(null),p=_.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),b=_.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),m&&window.speechSynthesis.cancel(),u.current=null,c(!1)},[m]),y=_.useCallback(()=>{if(!m||!e)return;if(b(),f.current){try{f.current.stop()}catch(T){console.error("Error stopping recognition:",T)}f.current=null,d(!1)}const C=new SpeechSynthesisUtterance(e);C.lang=s,C.onstart=()=>c(!0),C.onend=()=>{c(!1),u.current=null},C.onerror=()=>{c(!1),u.current=null},u.current=C,window.speechSynthesis.speak(C)},[m,e,s,b]),E=_.useCallback(()=>{if(f.current)try{f.current.stop()}catch(C){console.error("Error stopping recognition:",C)}d(!1),g(null)},[]),S=_.useCallback(()=>{if(!w||r||a)return;b();const C=window,T=C.SpeechRecognition||C.webkitSpeechRecognition;if(!T){g("Navegador no compatible");return}try{const F=new T;F.continuous=!0,F.interimResults=!0,F.lang=s,F.onstart=()=>{d(!0),g(null),p.current=e||""},F.onend=()=>{d(!1),f.current=null,o?.()},F.onerror=D=>{D.error!=="no-speech"&&(d(!1),f.current=null,D.error!=="aborted"&&g("Error al reconocer voz"))},F.onresult=D=>{try{let M="";for(let N=0;N<D.results.length;N++)M+=D.results[N][0].transcript;const U=p.current&&M?" ":"",V=p.current+U+M;t(V)}catch{g("Error procesando dictado")}},f.current=F,F.start()}catch{g("No se pudo iniciar dictado"),d(!1)}},[w,r,a,e,t,s,b,o]);return _.useEffect(()=>()=>{v.current&&clearTimeout(v.current),m&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:w,hablando:i,escuchando:l,errorDictado:h,escuchar:y,detenerHablar:b,dictar:S,detenerDictado:E}}function Nd({size:e="1em",className:t}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const We={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},ws=_.forwardRef((e,t)=>{const{children:r,variant:a="bordered",color:o="default",size:s="md",radius:i="md",fullWidth:c=!0,disableAnimation:l=!1,label:d,description:h,errorMessage:g,value:f,defaultValue:u,placeholder:v,isRequired:p=!1,isReadOnly:m=!1,isDisabled:w=!1,isClearable:b=!1,isInvalid:y,validationState:E,validate:S,minRows:C=4,maxRows:T=10,disableAutosize:F=!1,hideVoiceActions:D=!1,className:M,classNames:U,style:V,onChange:N,onClear:k,onFocus:A,onBlur:O,id:$,name:x,rows:I,"data-testid":L,...X}=e,H=_.useRef(null),z=_.useId(),q=$??`textarea-${z}`;_.useImperativeHandle(t,()=>H.current);const B=f!==void 0,[K,Y]=_.useState(u??""),Q=B?f:K,[ee,se]=_.useState(!1),ce=_.useMemo(()=>{if(!S)return null;const Pe=S(Q);return Pe===!0||Pe==null?null:typeof Pe=="string"?Pe:typeof Pe=="object"&&"message"in Pe?Pe.message??"Entrada inválida":"Entrada inválida"},[Q,S]),ae=_.useMemo(()=>y!==void 0?y:E==="invalid"?!0:E==="valid"?!1:!!ce,[y,E,ce]),de=E==="valid"&&!ae,oe={invalido:ae,mensaje:ce},fe=Q.length>0,pe=_.useCallback(()=>{if(!H.current||F)return;const Pe=H.current,lt=window.getComputedStyle(Pe),Wt=parseFloat(lt.lineHeight)||parseFloat(lt.fontSize)*1.5,Bt=parseFloat(lt.paddingTop)||0,Se=parseFloat(lt.paddingBottom)||0,je=parseFloat(lt.borderTopWidth)||0,kt=parseFloat(lt.borderBottomWidth)||0,Re=C*Wt+Bt+Se+je+kt,xt=T*Wt+Bt+Se+je+kt;Pe.style.height="auto";const At=Pe.scrollHeight;Pe.style.height=`${Math.min(Math.max(At,Re),xt)}px`},[F,C,T]);_.useEffect(()=>{F||pe()},[Q,pe,F]);const te=_.useCallback(Pe=>{B||Y(Pe),N?.(Pe)},[B,N]),{puedeHablar:ue,hablando:ge,escuchar:ve,detenerHablar:J,puedeEscuchar:P,escuchando:G,errorDictado:W,dictar:re,detenerDictado:le}=bs({isDisabled:w||D,isReadOnly:m,value:Q,onChange:te}),he=_.useCallback(Pe=>{if(w||m)return;const lt=Pe.target.value;B||Y(lt),N?.(lt)},[B,w,m,N]),Ce=_.useCallback(Pe=>{se(!0),A?.(Pe)},[A]),Ne=_.useCallback(Pe=>{se(!1),O?.(Pe)},[O]),Ie=_.useCallback(()=>{w||m||(B||Y(""),N?.(""),k?.(),H.current?.focus())},[B,w,m,N,k]),Ee=_.useCallback(()=>{ge?J():ve()},[ge,ve,J]),Ze=_.useCallback(()=>{G?le():re()},[G,re,le]),tt=L??(x?`textarea-${x}`:q),Fe=h?`${q}-desc`:void 0,De=ae||W?`${q}-err`:void 0,rt=[Fe,De].filter(Boolean).join(" ")||void 0,Ae=typeof g=="function"?g(oe):g??ce,Le=b&&fe&&!m&&!w,$e=!D||Le,_t=ne(We.contenedor_base,We[`variante_${a}`],We[`tam_${s}`],We[`radio_${i}`],We[`color_${o}`],{[We.ancho_total]:c,[We.sin_animacion]:l,[We.deshabilitado]:w,[We.solo_lectura]:m,[We.invalido]:ae,[We.valido]:de,[We.enfocado]:ee},M,U?.base);return n.jsxs("div",{className:_t,style:V,children:[d&&n.jsxs("label",{className:ne(We.etiqueta,U?.label),htmlFor:q,children:[d,p&&n.jsx("span",{className:We.marca_requerido,"aria-hidden":"true",children:"*"})]}),n.jsxs("div",{className:ne(We.envoltorio_input,U?.inputWrapper),children:[n.jsx("textarea",{...X,ref:H,id:q,name:x,placeholder:v,value:B?Q:void 0,defaultValue:B?void 0:u,onChange:he,onFocus:Ce,onBlur:Ne,className:ne(We.entrada,F&&We.sin_autosize,U?.input),readOnly:m,disabled:w,rows:I??C,"aria-invalid":ae||void 0,"aria-describedby":rt,"aria-required":p,required:p,"data-testid":tt}),$e&&n.jsxs("div",{className:ne(We.barra_acciones,U?.actions),children:[n.jsxs("div",{className:We.badges_contenedor,"aria-live":"polite",role:"status",children:[n.jsx(xn,{mostrar:G,children:n.jsx($a,{tipo:"mic",texto:"Escuchando...",size:s==="lg"?"md":"sm"})}),n.jsx(xn,{mostrar:ge,children:n.jsx($a,{tipo:"tts",texto:"Leyendo...",size:s==="lg"?"md":"sm"})})]}),n.jsxs("div",{className:We.botones_grupo,children:[!D&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:ne(We.boton_accion,ge&&We.boton_activo_tts),onClick:Ee,disabled:!ue||!ge&&(!Q||G),title:ge?"Detener lectura":"Leer texto","aria-pressed":ge,"aria-label":ge?"Detener lectura":"Leer texto",children:n.jsx(Fa,{})}),P&&n.jsx("button",{type:"button",className:ne(We.boton_accion,G&&We.boton_activo_mic),onClick:Ze,disabled:w||m||ge,title:G?"Detener dictado":"Dictar texto","aria-pressed":G,"aria-label":G?"Detener dictado":"Dictar texto",children:G?n.jsx(ms,{}):n.jsx(Ma,{})})]}),Le&&n.jsx("button",{type:"button",className:We.boton_limpiar,onClick:Ie,title:"Limpiar campo","aria-label":"Limpiar campo",children:n.jsx(Nd,{size:"0.75em"})})]})]})]}),h&&!ae&&n.jsx("div",{id:Fe,className:ne(We.descripcion,U?.description),children:h}),ae&&Ae||W?n.jsxs("div",{id:De,className:ne(We.mensaje_error,U?.errorMessage),role:"alert",children:[Ae,Ae&&W&&n.jsx("br",{}),W&&n.jsxs("span",{children:["Error de voz: ",W]})]}):null,r]})});ws.displayName="TextArea";function En(){return typeof window<"u"}function or(e){return Oa(e)?(e.nodeName||"").toLowerCase():"#document"}function It(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vt(e){var t;return(t=(Oa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Oa(e){return En()?e instanceof Node||e instanceof It(e).Node:!1}function qe(e){return En()?e instanceof Element||e instanceof It(e).Element:!1}function ot(e){return En()?e instanceof HTMLElement||e instanceof It(e).HTMLElement:!1}function Cn(e){return!En()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof It(e).ShadowRoot}const Id=new Set(["inline","contents"]);function Zr(e){const{overflow:t,overflowX:r,overflowY:a,display:o}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!Id.has(o)}const Md=new Set(["table","td","th"]);function Fd(e){return Md.has(or(e))}const $d=[":popover-open",":modal"];function Sn(e){return $d.some(t=>{try{return e.matches(t)}catch{return!1}})}const Od=["transform","translate","scale","rotate","perspective"],Dd=["transform","translate","scale","rotate","perspective","filter"],Ld=["paint","layout","strict","content"];function Da(e){const t=Tn(),r=qe(e)?Ft(e):e;return Od.some(a=>r[a]?r[a]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Dd.some(a=>(r.willChange||"").includes(a))||Ld.some(a=>(r.contain||"").includes(a))}function Pd(e){let t=Rt(e);for(;ot(t)&&!Gt(t);){if(Da(t))return t;if(Sn(t))return null;t=Rt(t)}return null}function Tn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zd=new Set(["html","body","#document"]);function Gt(e){return zd.has(or(e))}function Ft(e){return It(e).getComputedStyle(e)}function An(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(or(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||Vt(e);return Cn(t)?t.host:t}function ys(e){const t=Rt(e);return Gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ot(t)&&Zr(t)?t:ys(t)}function sr(e,t,r){var a;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ys(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),i=It(o);if(s){const c=La(i);return t.concat(i,i.visualViewport||[],Zr(o)?o:[],c&&r?sr(c):[])}return t.concat(o,sr(o,[],r))}function La(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ir=Math.min,$t=Math.max,Nn=Math.round,$r=Math.floor,jt=e=>({x:e,y:e}),Bd={left:"right",right:"left",bottom:"top",top:"bottom"},Vd={start:"end",end:"start"};function Pa(e,t,r){return $t(e,ir(t,r))}function Or(e,t){return typeof e=="function"?e(t):e}function cr(e){return e.split("-")[0]}function Dr(e){return e.split("-")[1]}function ks(e){return e==="x"?"y":"x"}function za(e){return e==="y"?"height":"width"}const jd=new Set(["top","bottom"]);function Xt(e){return jd.has(cr(e))?"y":"x"}function Ba(e){return ks(Xt(e))}function Hd(e,t,r){r===void 0&&(r=!1);const a=Dr(e),o=Ba(e),s=za(o);let i=o==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=In(i)),[i,In(i)]}function Ud(e){const t=In(e);return[Va(e),t,Va(t)]}function Va(e){return e.replace(/start|end/g,t=>Vd[t])}const xs=["left","right"],Es=["right","left"],Wd=["top","bottom"],qd=["bottom","top"];function Gd(e,t,r){switch(e){case"top":case"bottom":return r?t?Es:xs:t?xs:Es;case"left":case"right":return t?Wd:qd;default:return[]}}function Rd(e,t,r,a){const o=Dr(e);let s=Gd(cr(e),r==="start",a);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Va)))),s}function In(e){return e.replace(/left|right|bottom|top/g,t=>Bd[t])}function Xd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cs(e){return typeof e!="number"?Xd(e):{top:e,right:e,bottom:e,left:e}}function Mn(e){const{x:t,y:r,width:a,height:o}=e;return{width:a,height:o,top:r,left:t,right:t+a,bottom:r+o,x:t,y:r}}/*!
2
2
  * tabbable 6.3.0
3
3
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
- */var Td=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],wn=Td.join(","),cs=typeof Element>"u",kr=cs?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yn=!cs&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Pr=function(t,r){var n;r===void 0&&(r=!0);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),s=o===""||o==="true",i=s||r&&t&&Pr(t.parentNode);return i},Ad=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},ls=function(t,r,n){if(Pr(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(wn));return r&&kr.call(t,wn)&&o.unshift(t),o=o.filter(n),o},xn=function(t,r,n){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Pr(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),l=c.length?c:i.children,u=xn(l,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var f=kr.call(i,wn);f&&n.filter(i)&&(r||!t.includes(i))&&o.push(i);var p=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),h=!Pr(p,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(p&&h){var d=xn(p===!0?i.children:p.children,!0,n);n.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},ds=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},us=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ad(t))&&!ds(t)?0:t.tabIndex},Nd=function(t,r){var n=us(t);return n<0&&r&&!ds(t)?0:n},Id=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},fs=function(t){return t.tagName==="INPUT"},Md=function(t){return fs(t)&&t.type==="hidden"},Fd=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},Od=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},$d=function(t){if(!t.name)return!0;var r=t.form||yn(t),n=function(c){return r.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=n(window.CSS.escape(t.name));else try{o=n(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Od(o,t.form);return!s||s===t},Dd=function(t){return fs(t)&&t.type==="radio"},Ld=function(t){return Dd(t)&&!$d(t)},Pd=function(t){var r,n=t&&yn(t),o=(r=n)===null||r===void 0?void 0:r.host,s=!1;if(n&&n!==t){var i,c,l;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var u,f,p;n=yn(o),o=(u=n)===null||u===void 0?void 0:u.host,s=!!((f=o)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},hs=function(t){var r=t.getBoundingClientRect(),n=r.width,o=r.height;return n===0&&o===0},zd=function(t,r){var n=r.displayCheck,o=r.getShadowRoot;if(n==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=kr.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(kr.call(c,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var u=t.parentElement,f=yn(t);if(u&&!u.shadowRoot&&o(u)===!0)return hs(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(Pd(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return hs(t);return!1},Bd=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var o=r.children.item(n);if(o.tagName==="LEGEND")return kr.call(r,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}r=r.parentElement}return!1},Ca=function(t,r){return!(r.disabled||Pr(r)||Md(r)||zd(r,t)||Fd(r)||Bd(r))},Sa=function(t,r){return!(Ld(r)||us(r)<0||!Ca(t,r))},Vd=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},_s=function(t){var r=[],n=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,l=Nd(c,i),u=i?_s(o.candidates):c;l===0?i?r.push.apply(r,u):r.push(c):n.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:u})}),n.sort(Id).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(r)},kn=function(t,r){r=r||{};var n;return r.getShadowRoot?n=xn([t],r.includeContainer,{filter:Sa.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:Vd}):n=ls(t,r.includeContainer,Sa.bind(null,r)),_s(n)},jd=function(t,r){r=r||{};var n;return r.getShadowRoot?n=xn([t],r.includeContainer,{filter:Ca.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=ls(t,r.includeContainer,Ca.bind(null,r)),n},ps=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return kr.call(t,wn)===!1?!1:Sa(r,t)};function gs(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function vs(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function ms(){return/apple/i.test(navigator.vendor)}function Ta(){const e=/android/i;return e.test(gs())||e.test(vs())}function Hd(){return gs().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function bs(){return vs().includes("jsdom/")}const ws="data-floating-ui-focusable",Ud="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Aa="ArrowLeft",Na="ArrowRight",Wd="ArrowUp",Gd="ArrowDown";function Pt(e){let t=e.activeElement;for(;((r=t)==null||(r=r.shadowRoot)==null?void 0:r.activeElement)!=null;){var r;t=t.shadowRoot.activeElement}return t}function _t(e,t){if(!e||!t)return!1;const r=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&hn(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ut(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ia(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function qd(e){return e.matches("html,body")}function pt(e){return e?.ownerDocument||document}function Ma(e){return et(e)&&e.matches(Ud)}function Fa(e){return e?e.getAttribute("role")==="combobox"&&Ma(e):!1}function Rd(e){if(!e||bs())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function En(e){return e?e.hasAttribute(ws)?e:e.querySelector("["+ws+"]")||e:null}function fr(e,t,r){return r===void 0&&(r=!0),e.filter(o=>{var s;return o.parentId===t&&(!r||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...fr(e,o.id,r)])}function Kd(e,t){let r,n=-1;function o(s,i){i>n&&(r=s,n=i),fr(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===r)}function ys(e,t){var r;let n=[],o=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s?.parentId,s&&(n=n.concat(s))}return n}function gt(e){e.preventDefault(),e.stopPropagation()}function Xd(e){return"nativeEvent"in e}function xs(e){return e.mozInputSource===0&&e.isTrusted?!0:Ta()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ks(e){return bs()?!1:!Ta()&&e.width===0&&e.height===0||Ta()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function zr(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}var Yd=typeof document<"u",Zd=function(){},je=Yd?_.useLayoutEffect:Zd;const Jd={...z};function ht(e){const t=z.useRef(e);return je(()=>{t.current=e}),t}const Qd=Jd.useInsertionEffect||(e=>e());function tt(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Qd(()=>{t.current=e}),z.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Cn(e,t,r){return Math.floor(e/t)!==r}function Br(e,t){return t<0||t>=e.current.length}function Oa(e,t){return bt(e,{disabledIndices:t})}function Es(e,t){return bt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function bt(e,t){let{startingIndex:r=-1,decrement:n=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t,i=r;do i+=n?-s:s;while(i>=0&&i<=e.current.length-1&&Sn(e,i,o));return i}function eu(e,t){let{event:r,orientation:n,loop:o,rtl:s,cols:i,disabledIndices:c,minIndex:l,maxIndex:u,prevIndex:f,stopEvent:p=!1}=t,h=f;if(r.key===Wd){if(p&&gt(r),f===-1)h=u;else if(h=bt(e,{startingIndex:h,amount:i,decrement:!0,disabledIndices:c}),o&&(f-i<l||h<0)){const d=f%i,v=u%i,g=u-(v-d);v===d?h=u:h=v>d?g:g-i}Br(e,h)&&(h=f)}if(r.key===Gd&&(p&&gt(r),f===-1?h=l:(h=bt(e,{startingIndex:f,amount:i,disabledIndices:c}),o&&f+i>u&&(h=bt(e,{startingIndex:f%i-i,amount:i,disabledIndices:c}))),Br(e,h)&&(h=f)),n==="both"){const d=wr(f/i);r.key===(s?Aa:Na)&&(p&&gt(r),f%i!==i-1?(h=bt(e,{startingIndex:f,disabledIndices:c}),o&&Cn(h,i,d)&&(h=bt(e,{startingIndex:f-f%i-1,disabledIndices:c}))):o&&(h=bt(e,{startingIndex:f-f%i-1,disabledIndices:c})),Cn(h,i,d)&&(h=f)),r.key===(s?Na:Aa)&&(p&&gt(r),f%i!==0?(h=bt(e,{startingIndex:f,decrement:!0,disabledIndices:c}),o&&Cn(h,i,d)&&(h=bt(e,{startingIndex:f+(i-f%i),decrement:!0,disabledIndices:c}))):o&&(h=bt(e,{startingIndex:f+(i-f%i),decrement:!0,disabledIndices:c})),Cn(h,i,d)&&(h=f));const v=wr(u/i)===d;Br(e,h)&&(o&&v?h=r.key===(s?Na:Aa)?u:bt(e,{startingIndex:f-f%i-1,disabledIndices:c}):h=f)}return h}function tu(e,t,r){const n=[];let o=0;return e.forEach((s,i)=>{let{width:c,height:l}=s;if(c>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let u=!1;for(r&&(o=0);!u;){const f=[];for(let p=0;p<c;p++)for(let h=0;h<l;h++)f.push(o+p+h*t);o%t+c<=t&&f.every(p=>n[p]==null)?(f.forEach(p=>{n[p]=i}),u=!0):o++}}),[...n]}function ru(e,t,r,n,o){if(e===-1)return-1;const s=r.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*n:s;case"br":return r.lastIndexOf(e)}}function nu(e,t){return t.flatMap((r,n)=>e.includes(r)?[n]:[])}function Sn(e,t,r){if(typeof r=="function")return r(t);if(r)return r.includes(t);const n=e.current[t];return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}const Vr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cs(e,t){const r=kn(e,Vr()),n=r.length;if(n===0)return;const o=Pt(pt(e)),s=r.indexOf(o),i=s===-1?t===1?0:n-1:s+t;return r[i]}function Ss(e){return Cs(pt(e).body,1)||e}function Ts(e){return Cs(pt(e).body,-1)||e}function jr(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!_t(r,n)}function au(e){kn(e,Vr()).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function As(e){e.querySelectorAll("[data-tabindex]").forEach(r=>{const n=r.dataset.tabindex;delete r.dataset.tabindex,n?r.setAttribute("tabindex",n):r.removeAttribute("tabindex")})}function Ns(e,t,r){let{reference:n,floating:o}=e;const s=Ht(t),i=ka(t),c=xa(i),l=Qt(t),u=s==="y",f=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[c]/2-o[c]/2;let d;switch(l){case"top":d={x:f,y:n.y-o.height};break;case"bottom":d={x:f,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:p};break;case"left":d={x:n.x-o.width,y:p};break;default:d={x:n.x,y:n.y}}switch(xr(t)){case"start":d[i]-=h*(r&&u?-1:1);break;case"end":d[i]+=h*(r&&u?-1:1);break}return d}const ou=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,c=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=Ns(u,n,l),h=n,d={},v=0;for(let g=0;g<c.length;g++){const{name:b,fn:w}=c[g],{x:m,y,data:k,reset:T}=await w({x:f,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:d,rects:u,platform:i,elements:{reference:e,floating:t}});f=m??f,p=y??p,d={...d,[b]:{...d[b],...k}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(u=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:f,y:p}=Ns(u,h,l)),g=-1)}return{x:f,y:p,placement:h,strategy:o,middlewareData:d}};async function $a(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:d=0}=yr(t,e),v=is(d),b=c[h?p==="floating"?"reference":"floating":p],w=bn(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(b)))==null||r?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),m=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),k=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},T=bn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:m,offsetParent:y,strategy:l}):m);return{top:(w.top-T.top+v.top)/k.y,bottom:(T.bottom-w.bottom+v.bottom)/k.y,left:(w.left-T.left+v.left)/k.x,right:(T.right-w.right+v.right)/k.x}}const su=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=yr(e,t)||{};if(u==null)return{};const p=is(f),h={x:r,y:n},d=ka(o),v=xa(d),g=await i.getDimensions(u),b=d==="y",w=b?"top":"left",m=b?"bottom":"right",y=b?"clientHeight":"clientWidth",k=s.reference[v]+s.reference[d]-h[d]-s.floating[v],T=h[d]-s.reference[d],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let S=C?C[y]:0;(!S||!await(i.isElement==null?void 0:i.isElement(C)))&&(S=c.floating[y]||s.floating[v]);const M=k/2-T/2,D=S/2-g[v]/2-1,O=Jt(p[w],D),H=Jt(p[m],D),V=O,N=S-g[v]-H,x=S/2-g[v]/2+M,A=ya(V,x,N),$=!l.arrow&&xr(o)!=null&&x!==A&&s.reference[v]/2-(x<V?O:H)-g[v]/2<0,F=$?x<V?x-V:x-N:0;return{[d]:h[d]+F,data:{[d]:A,centerOffset:x-A-F,...$&&{alignmentOffset:F}},reset:$}}}),iu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...b}=yr(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const w=Qt(o),m=Ht(c),y=Qt(c)===c,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=h||(y||!g?[mn(c)]:yd(c)),C=v!=="none";!h&&C&&T.push(...Cd(c,g,v,k));const S=[c,...T],M=await $a(t,b),D=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&D.push(M[w]),p){const x=wd(o,i,k);D.push(M[x[0]],M[x[1]])}if(O=[...O,{placement:o,overflows:D}],!D.every(x=>x<=0)){var H,V;const x=(((H=s.flip)==null?void 0:H.index)||0)+1,A=S[x];if(A&&(!(p==="alignment"?m!==Ht(A):!1)||O.every(E=>Ht(E.placement)===m?E.overflows[0]>0:!0)))return{data:{index:x,overflows:O},reset:{placement:A}};let $=(V=O.filter(F=>F.overflows[0]<=0).sort((F,E)=>F.overflows[1]-E.overflows[1])[0])==null?void 0:V.placement;if(!$)switch(d){case"bestFit":{var N;const F=(N=O.filter(E=>{if(C){const I=Ht(E.placement);return I===m||I==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(I=>I>0).reduce((I,L)=>I+L,0)]).sort((E,I)=>E[1]-I[1])[0])==null?void 0:N[0];F&&($=F);break}case"initialPlacement":$=c;break}if(o!==$)return{reset:{placement:$}}}return{}}}},cu=new Set(["left","top"]);async function lu(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Qt(r),c=xr(r),l=Ht(r)==="y",u=cu.has(i)?-1:1,f=s&&l?-1:1,p=yr(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof v=="number"&&(d=c==="end"?v*-1:v),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const du=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:c}=t,l=await lu(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},uu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:b=>{let{x:w,y:m}=b;return{x:w,y:m}}},...l}=yr(e,t),u={x:r,y:n},f=await $a(t,l),p=Ht(Qt(o)),h=as(p);let d=u[h],v=u[p];if(s){const b=h==="y"?"top":"left",w=h==="y"?"bottom":"right",m=d+f[b],y=d-f[w];d=ya(m,d,y)}if(i){const b=p==="y"?"top":"left",w=p==="y"?"bottom":"right",m=v+f[b],y=v-f[w];v=ya(m,v,y)}const g=c.fn({...t,[h]:d,[p]:v});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:s,[p]:i}}}}}},fu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...u}=yr(e,t),f=await $a(t,u),p=Qt(o),h=xr(o),d=Ht(o)==="y",{width:v,height:g}=s.floating;let b,w;p==="top"||p==="bottom"?(b=p,w=h===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(w=p,b=h==="end"?"top":"bottom");const m=g-f.top-f.bottom,y=v-f.left-f.right,k=Jt(g-f[b],m),T=Jt(v-f[w],y),C=!t.middlewareData.shift;let S=k,M=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(M=y),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=m),C&&!h){const O=At(f.left,0),H=At(f.right,0),V=At(f.top,0),N=At(f.bottom,0);d?M=v-2*(O!==0||H!==0?O+H:At(f.left,f.right)):S=g-2*(V!==0||N!==0?V+N:At(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:S});const D=await i.getDimensions(c.floating);return v!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}};function Is(e){const t=Tt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=vn(r)!==s||vn(n)!==i;return c&&(r=s,n=i),{width:r,height:n,$:c}}function Da(e){return Ve(e)?e:e.contextElement}function Er(e){const t=Da(e);if(!et(t))return Lt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Is(t);let i=(s?vn(r.width):r.width)/n,c=(s?vn(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const hu=Lt(0);function Ms(e){const t=kt(e);return!pn()||!t.visualViewport?hu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _u(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==kt(e)?!1:t}function hr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Da(e);let i=Lt(1);t&&(n?Ve(n)&&(i=Er(n)):i=Er(e));const c=_u(s,r,n)?Ms(s):Lt(0);let l=(o.left+c.x)/i.x,u=(o.top+c.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const h=kt(s),d=n&&Ve(n)?kt(n):n;let v=h,g=wa(v);for(;g&&n&&d!==v;){const b=Er(g),w=g.getBoundingClientRect(),m=Tt(g),y=w.left+(g.clientLeft+parseFloat(m.paddingLeft))*b.x,k=w.top+(g.clientTop+parseFloat(m.paddingTop))*b.y;l*=b.x,u*=b.y,f*=b.x,p*=b.y,l+=y,u+=k,v=kt(g),g=wa(v)}}return bn({width:f,height:p,x:l,y:u})}function Tn(e,t){const r=gn(e).scrollLeft;return t?t.left+r:hr(Dt(e)).left+r}function Fs(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function pu(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Dt(n),c=t?_n(t.floating):!1;if(n===i||c&&s)return r;let l={scrollLeft:0,scrollTop:0},u=Lt(1);const f=Lt(0),p=et(n);if((p||!p&&!s)&&((Yt(n)!=="body"||Lr(i))&&(l=gn(n)),et(n))){const d=hr(n);u=Er(n),f.x=d.x+n.clientLeft,f.y=d.y+n.clientTop}const h=i&&!p&&!s?Fs(i,l):Lt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:r.y*u.y-l.scrollTop*u.y+f.y+h.y}}function gu(e){return Array.from(e.getClientRects())}function vu(e){const t=Dt(e),r=gn(e),n=e.ownerDocument.body,o=At(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=At(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Tn(e);const c=-r.scrollTop;return Tt(n).direction==="rtl"&&(i+=At(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Os=25;function mu(e,t){const r=kt(e),n=Dt(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,c=0,l=0;if(o){s=o.width,i=o.height;const f=pn();(!f||f&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const u=Tn(n);if(u<=0){const f=n.ownerDocument,p=f.body,h=getComputedStyle(p),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(n.clientWidth-p.clientWidth-d);v<=Os&&(s-=v)}else u<=Os&&(s+=u);return{width:s,height:i,x:c,y:l}}const bu=new Set(["absolute","fixed"]);function wu(e,t){const r=hr(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=et(e)?Er(e):Lt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,u=n*s.y;return{width:i,height:c,x:l,y:u}}function $s(e,t,r){let n;if(t==="viewport")n=mu(e,r);else if(t==="document")n=vu(Dt(e));else if(Ve(t))n=wu(t,r);else{const o=Ms(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return bn(n)}function Ds(e,t){const r=jt(e);return r===t||!Ve(r)||Vt(r)?!1:Tt(r).position==="fixed"||Ds(r,t)}function yu(e,t){const r=t.get(e);if(r)return r;let n=Zt(e,[],!1).filter(c=>Ve(c)&&Yt(c)!=="body"),o=null;const s=Tt(e).position==="fixed";let i=s?jt(e):e;for(;Ve(i)&&!Vt(i);){const c=Tt(i),l=ba(i);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&bu.has(o.position)||Lr(i)&&!l&&Ds(e,i))?n=n.filter(f=>f!==i):o=c,i=jt(i)}return t.set(e,n),n}function xu(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?_n(t)?[]:yu(t,this._c):[].concat(r),n],c=i[0],l=i.reduce((u,f)=>{const p=$s(t,f,o);return u.top=At(p.top,u.top),u.right=Jt(p.right,u.right),u.bottom=Jt(p.bottom,u.bottom),u.left=At(p.left,u.left),u},$s(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ku(e){const{width:t,height:r}=Is(e);return{width:t,height:r}}function Eu(e,t,r){const n=et(t),o=Dt(t),s=r==="fixed",i=hr(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=Lt(0);function u(){l.x=Tn(o)}if(n||!n&&!s)if((Yt(t)!=="body"||Lr(o))&&(c=gn(t)),n){const d=hr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&u();s&&!n&&o&&u();const f=o&&!n&&!s?Fs(o,c):Lt(0),p=i.left+c.scrollLeft-l.x-f.x,h=i.top+c.scrollTop-l.y-f.y;return{x:p,y:h,width:i.width,height:i.height}}function La(e){return Tt(e).position==="static"}function Ls(e,t){if(!et(e)||Tt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Dt(e)===r&&(r=r.ownerDocument.body),r}function Ps(e,t){const r=kt(e);if(_n(e))return r;if(!et(e)){let o=jt(e);for(;o&&!Vt(o);){if(Ve(o)&&!La(o))return o;o=jt(o)}return r}let n=Ls(e,t);for(;n&&dd(n)&&La(n);)n=Ls(n,t);return n&&Vt(n)&&La(n)&&!ba(n)?r:n||pd(e)||r}const Cu=async function(e){const t=this.getOffsetParent||Ps,r=this.getDimensions,n=await r(e.floating);return{reference:Eu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Su(e){return Tt(e).direction==="rtl"}const Tu={convertOffsetParentRelativeRectToViewportRelativeRect:pu,getDocumentElement:Dt,getClippingRect:xu,getOffsetParent:Ps,getElementRects:Cu,getClientRects:gu,getDimensions:ku,getScale:Er,isElement:Ve,isRTL:Su};function zs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Au(e,t){let r=null,n;const o=Dt(e);function s(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:h,height:d}=u;if(c||t(),!h||!d)return;const v=wr(p),g=wr(o.clientWidth-(f+h)),b=wr(o.clientHeight-(p+d)),w=wr(f),y={rootMargin:-v+"px "+-g+"px "+-b+"px "+-w+"px",threshold:At(0,Jt(1,l))||1};let k=!0;function T(C){const S=C[0].intersectionRatio;if(S!==l){if(!k)return i();S?i(!1,S):n=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!zs(u,e.getBoundingClientRect())&&i(),k=!1}try{r=new IntersectionObserver(T,{...y,root:o.ownerDocument})}catch{r=new IntersectionObserver(T,y)}r.observe(e)}return i(!0),s}function An(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Da(e),f=o||s?[...u?Zt(u):[],...Zt(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",r,{passive:!0}),s&&w.addEventListener("resize",r)});const p=u&&c?Au(u,r):null;let h=-1,d=null;i&&(d=new ResizeObserver(w=>{let[m]=w;m&&m.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(t)})),r()}),u&&!l&&d.observe(u),d.observe(t));let v,g=l?hr(e):null;l&&b();function b(){const w=hr(e);g&&!zs(g,w)&&r(),g=w,v=requestAnimationFrame(b)}return r(),()=>{var w;f.forEach(m=>{o&&m.removeEventListener("scroll",r),s&&m.removeEventListener("resize",r)}),p?.(),(w=d)==null||w.disconnect(),d=null,l&&cancelAnimationFrame(v)}}const Nu=du,Iu=uu,Mu=iu,Fu=fu,Bs=su,Ou=(e,t,r)=>{const n=new Map,o={platform:Tu,...r},s={...o.platform,_c:n};return ou(e,t,{...o,platform:s})};var $u=typeof document<"u",Du=function(){},Nn=$u?_.useLayoutEffect:Du;function In(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!In(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!In(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Vs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function js(e,t){const r=Vs(e);return Math.round(t*r)/r}function Pa(e){const t=z.useRef(e);return Nn(()=>{t.current=e}),t}function Lu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,p]=z.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=z.useState(n);In(h,n)||d(n);const[v,g]=z.useState(null),[b,w]=z.useState(null),m=z.useCallback(E=>{E!==C.current&&(C.current=E,g(E))},[]),y=z.useCallback(E=>{E!==S.current&&(S.current=E,w(E))},[]),k=s||v,T=i||b,C=z.useRef(null),S=z.useRef(null),M=z.useRef(f),D=l!=null,O=Pa(l),H=Pa(o),V=Pa(u),N=z.useCallback(()=>{if(!C.current||!S.current)return;const E={placement:t,strategy:r,middleware:h};H.current&&(E.platform=H.current),Ou(C.current,S.current,E).then(I=>{const L={...I,isPositioned:V.current!==!1};x.current&&!In(M.current,L)&&(M.current=L,da.flushSync(()=>{p(L)}))})},[h,t,r,H,V]);Nn(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(E=>({...E,isPositioned:!1})))},[u]);const x=z.useRef(!1);Nn(()=>(x.current=!0,()=>{x.current=!1}),[]),Nn(()=>{if(k&&(C.current=k),T&&(S.current=T),k&&T){if(O.current)return O.current(k,T,N);N()}},[k,T,N,O,D]);const A=z.useMemo(()=>({reference:C,floating:S,setReference:m,setFloating:y}),[m,y]),$=z.useMemo(()=>({reference:k,floating:T}),[k,T]),F=z.useMemo(()=>{const E={position:r,left:0,top:0};if(!$.floating)return E;const I=js($.floating,f.x),L=js($.floating,f.y);return c?{...E,transform:"translate("+I+"px, "+L+"px)",...Vs($.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:L}},[r,c,$.floating,f.x,f.y]);return z.useMemo(()=>({...f,update:N,refs:A,elements:$,floatingStyles:F}),[f,N,A,$,F])}const Pu=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Bs({element:n.current,padding:o}).fn(r):{}:n?Bs({element:n,padding:o}).fn(r):{}}}},Mn=(e,t)=>({...Nu(e),options:[e,t]}),Fn=(e,t)=>({...Iu(e),options:[e,t]}),On=(e,t)=>({...Mu(e),options:[e,t]}),Hs=(e,t)=>({...Fu(e),options:[e,t]}),zu=(e,t)=>({...Pu(e),options:[e,t]});function za(e){const t=z.useRef(void 0),r=z.useCallback(n=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,c=i(n);return typeof c=="function"?c:()=>{i(null)}}return s.current=n,()=>{s.current=null}}});return()=>{o.forEach(s=>s?.())}},e);return z.useMemo(()=>e.every(n=>n==null)?null:n=>{t.current&&(t.current(),t.current=void 0),n!=null&&(t.current=r(n))},e)}const Bu="data-floating-ui-focusable",Us="active",Ws="selected",Hr="ArrowLeft",Ur="ArrowRight",Gs="ArrowUp",$n="ArrowDown",Vu={...z};let qs=!1,ju=0;const Rs=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ju++;function Hu(){const[e,t]=z.useState(()=>qs?Rs():void 0);return je(()=>{e==null&&t(Rs())},[]),z.useEffect(()=>{qs=!0},[]),e}const Wr=Vu.useId||Hu;let Gr;process.env.NODE_ENV!=="production"&&(Gr=new Set);function Dn(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=Gr)!=null&&e.has(o))){var s;(s=Gr)==null||s.add(o),console.warn(o)}}function Uu(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o="Floating UI: "+r.join(" ");if(!((e=Gr)!=null&&e.has(o))){var s;(s=Gr)==null||s.add(o),console.error(o)}}const Wu=z.forwardRef(function(t,r){const{context:{placement:n,elements:{floating:o},middlewareData:{arrow:s,shift:i}},width:c=14,height:l=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:p,stroke:h,d,style:{transform:v,...g}={},...b}=t;process.env.NODE_ENV!=="production"&&(r||Dn("The `ref` prop is required for `FloatingArrow`."));const w=Wr(),[m,y]=z.useState(!1);if(je(()=>{if(!o)return;Tt(o).direction==="rtl"&&y(!0)},[o]),!o)return null;const[k,T]=n.split("-"),C=k==="top"||k==="bottom";let S=p;(C&&i!=null&&i.x||!C&&i!=null&&i.y)&&(S=null);const M=f*2,D=M/2,O=c/2*(u/-8+1),H=l/2*u/4,V=!!d,N=S&&T==="end"?"bottom":"top";let x=S&&T==="end"?"right":"left";S&&m&&(x=T==="end"?"left":"right");const A=s?.x!=null?S||s.x:"",$=s?.y!=null?S||s.y:"",F=d||"M0,0"+(" H"+c)+(" L"+(c-O)+","+(l-H))+(" Q"+c/2+","+l+" "+O+","+(l-H))+" Z",E={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[k];return a.jsxs("svg",{...b,"aria-hidden":!0,ref:r,width:V?c:c+M,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[x]:A,[N]:$,[k]:C||V?"100%":"calc(100% - "+M/2+"px)",transform:[E,v].filter(I=>!!I).join(" "),...g},children:[M>0&&a.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:h,strokeWidth:M+(d?0:1),d:F}),a.jsx("path",{stroke:M&&!d?b.fill:"none",d:F}),a.jsx("clipPath",{id:w,children:a.jsx("rect",{x:-D,y:D*(V?-1:1),width:c+M,height:c})})]})});function Ks(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var n;(n=e.get(t))==null||n.delete(r)}}}const Xs=z.createContext(null),Ys=z.createContext(null),Cr=()=>{var e;return((e=z.useContext(Xs))==null?void 0:e.id)||null},_r=()=>z.useContext(Ys);function Zs(e){const t=Wr(),r=_r(),o=Cr();return je(()=>{if(!t)return;const s={id:t,parentId:o};return r?.addNode(s),()=>{r?.removeNode(s)}},[r,t,o]),t}function Js(e){const{children:t,id:r}=e,n=Cr();return a.jsx(Xs.Provider,{value:z.useMemo(()=>({id:r,parentId:n}),[r,n]),children:t})}function Gu(e){const{children:t}=e,r=z.useRef([]),n=z.useCallback(i=>{r.current=[...r.current,i]},[]),o=z.useCallback(i=>{r.current=r.current.filter(c=>c!==i)},[]),[s]=z.useState(()=>Ks());return a.jsx(Ys.Provider,{value:z.useMemo(()=>({nodesRef:r,addNode:n,removeNode:o,events:s}),[n,o,s]),children:t})}function pr(e){return"data-floating-ui-"+e}function vt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Qs=pr("safe-polygon");function Ba(e,t,r){if(r&&!zr(r))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const n=e();return typeof n=="number"?n:n?.[t]}return e?.[t]}function Va(e){return typeof e=="function"?e():e}function ja(e,t){t===void 0&&(t={});const{open:r,onOpenChange:n,dataRef:o,events:s,elements:i}=e,{enabled:c=!0,delay:l=0,handleClose:u=null,mouseOnly:f=!1,restMs:p=0,move:h=!0}=t,d=_r(),v=Cr(),g=ht(u),b=ht(l),w=ht(r),m=ht(p),y=z.useRef(),k=z.useRef(-1),T=z.useRef(),C=z.useRef(-1),S=z.useRef(!0),M=z.useRef(!1),D=z.useRef(()=>{}),O=z.useRef(!1),H=tt(()=>{var F;const E=(F=o.current.openEvent)==null?void 0:F.type;return E?.includes("mouse")&&E!=="mousedown"});z.useEffect(()=>{if(!c)return;function F(E){let{open:I}=E;I||(vt(k),vt(C),S.current=!0,O.current=!1)}return s.on("openchange",F),()=>{s.off("openchange",F)}},[c,s]),z.useEffect(()=>{if(!c||!g.current||!r)return;function F(I){H()&&n(!1,I,"hover")}const E=pt(i.floating).documentElement;return E.addEventListener("mouseleave",F),()=>{E.removeEventListener("mouseleave",F)}},[i.floating,r,n,c,g,H]);const V=z.useCallback(function(F,E,I){E===void 0&&(E=!0),I===void 0&&(I="hover");const L=Ba(b.current,"close",y.current);L&&!T.current?(vt(k),k.current=window.setTimeout(()=>n(!1,F,I),L)):E&&(vt(k),n(!1,F,I))},[b,n]),N=tt(()=>{D.current(),T.current=void 0}),x=tt(()=>{if(M.current){const F=pt(i.floating).body;F.style.pointerEvents="",F.removeAttribute(Qs),M.current=!1}}),A=tt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);z.useEffect(()=>{if(!c)return;function F(j){if(vt(k),S.current=!1,f&&!zr(y.current)||Va(m.current)>0&&!Ba(b.current,"open"))return;const P=Ba(b.current,"open",y.current);P?k.current=window.setTimeout(()=>{w.current||n(!0,j,"hover")},P):r||n(!0,j,"hover")}function E(j){if(A()){x();return}D.current();const P=pt(i.floating);if(vt(C),O.current=!1,g.current&&o.current.floatingContext){r||vt(k),T.current=g.current({...o.current.floatingContext,tree:d,x:j.clientX,y:j.clientY,onClose(){x(),N(),A()||V(j,!0,"safe-polygon")}});const B=T.current;P.addEventListener("mousemove",B),D.current=()=>{P.removeEventListener("mousemove",B)};return}(y.current==="touch"?!_t(i.floating,j.relatedTarget):!0)&&V(j)}function I(j){A()||o.current.floatingContext&&(g.current==null||g.current({...o.current.floatingContext,tree:d,x:j.clientX,y:j.clientY,onClose(){x(),N(),A()||V(j)}})(j))}function L(){vt(k)}function R(j){A()||V(j,!1)}if(Ve(i.domReference)){const j=i.domReference,P=i.floating;return r&&j.addEventListener("mouseleave",I),h&&j.addEventListener("mousemove",F,{once:!0}),j.addEventListener("mouseenter",F),j.addEventListener("mouseleave",E),P&&(P.addEventListener("mouseleave",I),P.addEventListener("mouseenter",L),P.addEventListener("mouseleave",R)),()=>{r&&j.removeEventListener("mouseleave",I),h&&j.removeEventListener("mousemove",F),j.removeEventListener("mouseenter",F),j.removeEventListener("mouseleave",E),P&&(P.removeEventListener("mouseleave",I),P.removeEventListener("mouseenter",L),P.removeEventListener("mouseleave",R))}}},[i,c,e,f,h,V,N,x,n,r,w,d,b,g,o,A,m]),je(()=>{var F;if(c&&r&&(F=g.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&H()){M.current=!0;const I=i.floating;if(Ve(i.domReference)&&I){var E;const L=pt(i.floating).body;L.setAttribute(Qs,"");const R=i.domReference,j=d==null||(E=d.nodesRef.current.find(P=>P.id===v))==null||(E=E.context)==null?void 0:E.elements.floating;return j&&(j.style.pointerEvents=""),L.style.pointerEvents="none",R.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{L.style.pointerEvents="",R.style.pointerEvents="",I.style.pointerEvents=""}}}},[c,r,v,i,d,g,H]),je(()=>{r||(y.current=void 0,O.current=!1,N(),x())},[r,N,x]),z.useEffect(()=>()=>{N(),vt(k),vt(C),x()},[c,i.domReference,N,x]);const $=z.useMemo(()=>{function F(E){y.current=E.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(E){const{nativeEvent:I}=E;function L(){!S.current&&!w.current&&n(!0,I,"hover")}f&&!zr(y.current)||r||Va(m.current)===0||O.current&&E.movementX**2+E.movementY**2<2||(vt(C),y.current==="touch"?L():(O.current=!0,C.current=window.setTimeout(L,Va(m.current))))}}},[f,n,r,w,m]);return z.useMemo(()=>c?{reference:$}:{},[c,$])}let ei=0;function gr(e,t){t===void 0&&(t={});const{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(ei);const s=()=>e?.focus({preventScroll:r});o?s():ei=requestAnimationFrame(s)}function Ha(e,t){if(!e||!t)return!1;const r=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&hn(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qu(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ru(e){return e?.ownerDocument||document}const Sr={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ti(e){return e==="inert"?Sr.inert:e==="aria-hidden"?Sr["aria-hidden"]:Sr.none}let Ln=new WeakSet,Pn={},Ua=0;const Ku=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ri=e=>e&&(e.host||ri(e.parentNode)),Xu=(e,t)=>t.map(r=>{if(e.contains(r))return r;const n=ri(r);return e.contains(n)?n:null}).filter(r=>r!=null);function Yu(e,t,r,n){const o="data-floating-ui-inert",s=n?"inert":r?"aria-hidden":null,i=Xu(t,e),c=new Set,l=new Set(i),u=[];Pn[o]||(Pn[o]=new WeakMap);const f=Pn[o];i.forEach(p),h(t),c.clear();function p(d){!d||c.has(d)||(c.add(d),d.parentNode&&p(d.parentNode))}function h(d){!d||l.has(d)||[].forEach.call(d.children,v=>{if(Yt(v)!=="script")if(c.has(v))h(v);else{const g=s?v.getAttribute(s):null,b=g!==null&&g!=="false",w=ti(s),m=(w.get(v)||0)+1,y=(f.get(v)||0)+1;w.set(v,m),f.set(v,y),u.push(v),m===1&&b&&Ln.add(v),y===1&&v.setAttribute(o,""),!b&&s&&v.setAttribute(s,s==="inert"?"":"true")}})}return Ua++,()=>{u.forEach(d=>{const v=ti(s),b=(v.get(d)||0)-1,w=(f.get(d)||0)-1;v.set(d,b),f.set(d,w),b||(!Ln.has(d)&&s&&d.removeAttribute(s),Ln.delete(d)),w||d.removeAttribute(o)}),Ua--,Ua||(Sr.inert=new WeakMap,Sr["aria-hidden"]=new WeakMap,Sr.none=new WeakMap,Ln=new WeakSet,Pn={})}}function ni(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);const n=Ru(e[0]).body;return Yu(e.concat(Array.from(n.querySelectorAll('[aria-live],[role="status"],output'))),n,t,r)}const zn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Bn=z.forwardRef(function(t,r){const[n,o]=z.useState();je(()=>{ms()&&o("button")},[]);const s={ref:r,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[pr("focus-guard")]:"",style:zn};return a.jsx("span",{...t,...s})}),ai=z.createContext(null),oi=pr("portal");function Zu(e){e===void 0&&(e={});const{id:t,root:r}=e,n=Wr(),o=si(),[s,i]=z.useState(null),c=z.useRef(null);return je(()=>()=>{s?.remove(),queueMicrotask(()=>{c.current=null})},[s]),je(()=>{if(!n||c.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=n,u.setAttribute(oi,""),l.appendChild(u),c.current=u,i(u)},[t,n]),je(()=>{if(r===null||!n||c.current)return;let l=r||o?.portalNode;l&&!ma(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const f=document.createElement("div");f.id=n,f.setAttribute(oi,""),l=u||l,l.appendChild(f),c.current=f,i(f)},[t,r,n,o]),s}function Vn(e){const{children:t,id:r,root:n,preserveTabOrder:o=!0}=e,s=Zu({id:r,root:n}),[i,c]=z.useState(null),l=z.useRef(null),u=z.useRef(null),f=z.useRef(null),p=z.useRef(null),h=i?.modal,d=i?.open,v=!!i&&!i.modal&&i.open&&o&&!!(n||s);return z.useEffect(()=>{if(!s||!o||h)return;function g(b){s&&jr(b)&&(b.type==="focusin"?As:au)(s)}return s.addEventListener("focusin",g,!0),s.addEventListener("focusout",g,!0),()=>{s.removeEventListener("focusin",g,!0),s.removeEventListener("focusout",g,!0)}},[s,o,h]),z.useEffect(()=>{s&&(d||As(s))},[d,s]),a.jsxs(ai.Provider,{value:z.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:c}),[o,s]),children:[v&&s&&a.jsx(Bn,{"data-type":"outside",ref:l,onFocus:g=>{if(jr(g,s)){var b;(b=f.current)==null||b.focus()}else{const w=i?i.domReference:null,m=Ts(w);m?.focus()}}}),v&&s&&a.jsx("span",{"aria-owns":s.id,style:zn}),s&&da.createPortal(t,s),v&&s&&a.jsx(Bn,{"data-type":"outside",ref:u,onFocus:g=>{if(jr(g,s)){var b;(b=p.current)==null||b.focus()}else{const w=i?i.domReference:null,m=Ss(w);m?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const si=()=>z.useContext(ai);function ii(e){return z.useMemo(()=>t=>{e.forEach(r=>{r&&(r.current=t)})},e)}const Ju=20;let er=[];function Wa(){er=er.filter(e=>e.isConnected)}function Qu(e){Wa(),e&&Yt(e)!=="body"&&(er.push(e),er.length>Ju&&(er=er.slice(-20)))}function ci(){return Wa(),er[er.length-1]}function ef(e){const t=Vr();return ps(e,t)?e:kn(e,t)[0]||e}function li(e,t){var r;if(!t.current.includes("floating")&&!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=Vr(),s=jd(e,n).filter(c=>{const l=c.getAttribute("data-tabindex")||"";return ps(c,n)||c.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const tf=z.forwardRef(function(t,r){return a.jsx("button",{...t,type:"button",ref:r,tabIndex:-1,style:zn})});function Ga(e){const{context:t,children:r,disabled:n=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:p=!0,outsideElementsInert:h=!1,getInsideElements:d=()=>[]}=e,{open:v,onOpenChange:g,events:b,dataRef:w,elements:{domReference:m,floating:y}}=t,k=tt(()=>{var ne;return(ne=w.current.floatingContext)==null?void 0:ne.nodeId}),T=tt(d),C=typeof i=="number"&&i<0,S=Fa(m)&&C,M=Ku(),D=M?s:!0,O=!D||M&&h,H=ht(o),V=ht(i),N=ht(c),x=_r(),A=si(),$=z.useRef(null),F=z.useRef(null),E=z.useRef(!1),I=z.useRef(!1),L=z.useRef(-1),R=z.useRef(-1),j=A!=null,P=En(y),U=tt(function(ne){return ne===void 0&&(ne=P),ne?kn(ne,Vr()):[]}),B=tt(ne=>{const ie=U(ne);return H.current.map(ae=>m&&ae==="reference"?m:P&&ae==="floating"?P:ie).filter(Boolean).flat()});z.useEffect(()=>{if(n||!u)return;function ne(ae){if(ae.key==="Tab"){_t(P,Pt(pt(P)))&&U().length===0&&!S&&gt(ae);const fe=B(),de=Ut(ae);H.current[0]==="reference"&&de===m&&(gt(ae),ae.shiftKey?gr(fe[fe.length-1]):gr(fe[1])),H.current[1]==="floating"&&de===P&&ae.shiftKey&&(gt(ae),gr(fe[0]))}}const ie=pt(P);return ie.addEventListener("keydown",ne),()=>{ie.removeEventListener("keydown",ne)}},[n,m,P,u,H,S,U,B]),z.useEffect(()=>{if(n||!y)return;function ne(ie){const ae=Ut(ie),de=U().indexOf(ae);de!==-1&&(L.current=de)}return y.addEventListener("focusin",ne),()=>{y.removeEventListener("focusin",ne)}},[n,y,U]),z.useEffect(()=>{if(n||!p)return;function ne(){I.current=!0,setTimeout(()=>{I.current=!1})}function ie(de){const Z=de.relatedTarget,ue=de.currentTarget,pe=Ut(de);queueMicrotask(()=>{const he=k(),we=!(_t(m,Z)||_t(y,Z)||_t(Z,y)||_t(A?.portalNode,Z)||Z!=null&&Z.hasAttribute(pr("focus-guard"))||x&&(fr(x.nodesRef.current,he).find(W=>{var ee,J;return _t((ee=W.context)==null?void 0:ee.elements.floating,Z)||_t((J=W.context)==null?void 0:J.elements.domReference,Z)})||ys(x.nodesRef.current,he).find(W=>{var ee,J,ce;return[(ee=W.context)==null?void 0:ee.elements.floating,En((J=W.context)==null?void 0:J.elements.floating)].includes(Z)||((ce=W.context)==null?void 0:ce.elements.domReference)===Z})));if(ue===m&&P&&li(P,H),l&&ue!==m&&!(pe!=null&&pe.isConnected)&&Pt(pt(P))===pt(P).body){et(P)&&P.focus();const W=L.current,ee=U(),J=ee[W]||ee[ee.length-1]||P;et(J)&&J.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(S||!u)&&Z&&we&&!I.current&&Z!==ci()&&(E.current=!0,g(!1,de,"focus-out"))})}const ae=!!(!x&&A);function fe(){vt(R),w.current.insideReactTree=!0,R.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(y&&et(m))return m.addEventListener("focusout",ie),m.addEventListener("pointerdown",ne),y.addEventListener("focusout",ie),ae&&y.addEventListener("focusout",fe,!0),()=>{m.removeEventListener("focusout",ie),m.removeEventListener("pointerdown",ne),y.removeEventListener("focusout",ie),ae&&y.removeEventListener("focusout",fe,!0)}},[n,m,y,P,u,x,A,g,p,l,U,S,k,H,w]);const q=z.useRef(null),X=z.useRef(null),Y=ii([q,A?.beforeInsideRef]),Q=ii([X,A?.afterInsideRef]);z.useEffect(()=>{var ne,ie;if(n||!y)return;const ae=Array.from((A==null||(ne=A.portalNode)==null?void 0:ne.querySelectorAll("["+pr("portal")+"]"))||[]),de=(ie=(x?ys(x.nodesRef.current,k()):[]).find(pe=>{var he;return Fa(((he=pe.context)==null?void 0:he.elements.domReference)||null)}))==null||(ie=ie.context)==null?void 0:ie.elements.domReference,Z=[y,de,...ae,...T(),$.current,F.current,q.current,X.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,H.current.includes("reference")||S?m:null].filter(pe=>pe!=null),ue=u||S?ni(Z,!O,O):ni(Z);return()=>{ue()}},[n,m,y,u,H,A,S,D,O,x,k,T]),je(()=>{if(n||!et(P))return;const ne=pt(P),ie=Pt(ne);queueMicrotask(()=>{const ae=B(P),fe=V.current,de=(typeof fe=="number"?ae[fe]:fe.current)||P,Z=_t(P,ie);!C&&!Z&&v&&gr(de,{preventScroll:de===P})})},[n,v,P,C,B,V]),je(()=>{if(n||!P)return;const ne=pt(P),ie=Pt(ne);Qu(ie);function ae(Z){let{reason:ue,event:pe,nested:he}=Z;if(["hover","safe-polygon"].includes(ue)&&pe.type==="mouseleave"&&(E.current=!0),ue==="outside-press")if(he)E.current=!1;else if(xs(pe)||ks(pe))E.current=!1;else{let we=!1;document.createElement("div").focus({get preventScroll(){return we=!0,!1}}),we?E.current=!1:E.current=!0}}b.on("openchange",ae);const fe=ne.createElement("span");fe.setAttribute("tabindex","-1"),fe.setAttribute("aria-hidden","true"),Object.assign(fe.style,zn),j&&m&&m.insertAdjacentElement("afterend",fe);function de(){if(typeof N.current=="boolean"){const Z=m||ci();return Z&&Z.isConnected?Z:fe}return N.current.current||fe}return()=>{b.off("openchange",ae);const Z=Pt(ne),ue=_t(y,Z)||x&&fr(x.nodesRef.current,k(),!1).some(he=>{var we;return _t((we=he.context)==null?void 0:we.elements.floating,Z)}),pe=de();queueMicrotask(()=>{const he=ef(pe);N.current&&!E.current&&et(he)&&(!(he!==Z&&Z!==ne.body)||ue)&&he.focus({preventScroll:!0}),fe.remove()})}},[n,y,P,N,w,b,x,j,m,k]),z.useEffect(()=>(queueMicrotask(()=>{E.current=!1}),()=>{queueMicrotask(Wa)}),[n]),je(()=>{if(!n&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:p,open:v,onOpenChange:g,domReference:m}),()=>{A.setFocusManagerState(null)}},[n,A,u,v,g,p,m]),je(()=>{n||P&&li(P,H)},[n,P,H]);function oe(ne){return n||!f||!u?null:a.jsx(tf,{ref:ne==="start"?$:F,onClick:ie=>g(!1,ie.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const se=!n&&D&&(u?!S:!0)&&(j||u);return a.jsxs(a.Fragment,{children:[se&&a.jsx(Bn,{"data-type":"inside",ref:Y,onFocus:ne=>{if(u){const ae=B();gr(o[0]==="reference"?ae[0]:ae[ae.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(E.current=!1,jr(ne,A.portalNode)){const ae=Ss(m);ae?.focus()}else{var ie;(ie=A.beforeOutsideRef.current)==null||ie.focus()}}}),!S&&oe("start"),r,oe("end"),se&&a.jsx(Bn,{"data-type":"inside",ref:Q,onFocus:ne=>{if(u)gr(B()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(p&&(E.current=!0),jr(ne,A.portalNode)){const ae=Ts(m);ae?.focus()}else{var ie;(ie=A.afterOutsideRef.current)==null||ie.focus()}}})]})}function di(e){return et(e.target)&&e.target.tagName==="BUTTON"}function rf(e){return et(e.target)&&e.target.tagName==="A"}function ui(e){return Ma(e)}function fi(e,t){t===void 0&&(t={});const{open:r,onOpenChange:n,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:p=!0}=t,h=z.useRef(),d=z.useRef(!1),v=z.useMemo(()=>({onPointerDown(g){h.current=g.pointerType},onMouseDown(g){const b=h.current;g.button===0&&c!=="click"&&(zr(b,!0)&&u||(r&&l&&(!(o.current.openEvent&&p)||o.current.openEvent.type==="mousedown")?n(!1,g.nativeEvent,"click"):(g.preventDefault(),n(!0,g.nativeEvent,"click"))))},onClick(g){const b=h.current;if(c==="mousedown"&&h.current){h.current=void 0;return}zr(b,!0)&&u||(r&&l&&(!(o.current.openEvent&&p)||o.current.openEvent.type==="click")?n(!1,g.nativeEvent,"click"):n(!0,g.nativeEvent,"click"))},onKeyDown(g){h.current=void 0,!(g.defaultPrevented||!f||di(g))&&(g.key===" "&&!ui(s)&&(g.preventDefault(),d.current=!0),!rf(g)&&g.key==="Enter"&&n(!(r&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!f||di(g)||ui(s)||g.key===" "&&d.current&&(d.current=!1,n(!(r&&l),g.nativeEvent,"click"))}}),[o,s,c,u,f,n,r,p,l]);return z.useMemo(()=>i?{reference:v}:{},[i,v])}const nf={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},af={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hi=e=>{var t,r;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(r=e?.outsidePress)!=null?r:!0}};function jn(e,t){t===void 0&&(t={});const{open:r,onOpenChange:n,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:v}=t,g=_r(),b=tt(typeof l=="function"?l:()=>!1),w=typeof l=="function"?b:l,m=z.useRef(!1),{escapeKey:y,outsidePress:k}=hi(d),{escapeKey:T,outsidePress:C}=hi(v),S=z.useRef(!1),M=tt(x=>{var A;if(!r||!i||!c||x.key!=="Escape"||S.current)return;const $=(A=s.current.floatingContext)==null?void 0:A.nodeId,F=g?fr(g.nodesRef.current,$):[];if(!y&&(x.stopPropagation(),F.length>0)){let E=!0;if(F.forEach(I=>{var L;if((L=I.context)!=null&&L.open&&!I.context.dataRef.current.__escapeKeyBubbles){E=!1;return}}),!E)return}n(!1,Xd(x)?x.nativeEvent:x,"escape-key")}),D=tt(x=>{var A;const $=()=>{var F;M(x),(F=Ut(x))==null||F.removeEventListener("keydown",$)};(A=Ut(x))==null||A.addEventListener("keydown",$)}),O=tt(x=>{var A;const $=s.current.insideReactTree;s.current.insideReactTree=!1;const F=m.current;if(m.current=!1,u==="click"&&F||$||typeof w=="function"&&!w(x))return;const E=Ut(x),I="["+pr("inert")+"]",L=pt(o.floating).querySelectorAll(I);let R=Ve(E)?E:null;for(;R&&!Vt(R);){const B=jt(R);if(Vt(B)||!Ve(B))break;R=B}if(L.length&&Ve(E)&&!qd(E)&&!_t(E,o.floating)&&Array.from(L).every(B=>!_t(R,B)))return;if(et(E)&&N){const B=Vt(E),q=Tt(E),X=/auto|scroll/,Y=B||X.test(q.overflowX),Q=B||X.test(q.overflowY),oe=Y&&E.clientWidth>0&&E.scrollWidth>E.clientWidth,se=Q&&E.clientHeight>0&&E.scrollHeight>E.clientHeight,ne=q.direction==="rtl",ie=se&&(ne?x.offsetX<=E.offsetWidth-E.clientWidth:x.offsetX>E.clientWidth),ae=oe&&x.offsetY>E.clientHeight;if(ie||ae)return}const j=(A=s.current.floatingContext)==null?void 0:A.nodeId,P=g&&fr(g.nodesRef.current,j).some(B=>{var q;return Ia(x,(q=B.context)==null?void 0:q.elements.floating)});if(Ia(x,o.floating)||Ia(x,o.domReference)||P)return;const U=g?fr(g.nodesRef.current,j):[];if(U.length>0){let B=!0;if(U.forEach(q=>{var X;if((X=q.context)!=null&&X.open&&!q.context.dataRef.current.__outsidePressBubbles){B=!1;return}}),!B)return}n(!1,x,"outside-press")}),H=tt(x=>{var A;const $=()=>{var F;O(x),(F=Ut(x))==null||F.removeEventListener(u,$)};(A=Ut(x))==null||A.addEventListener(u,$)});z.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=y,s.current.__outsidePressBubbles=k;let x=-1;function A(L){n(!1,L,"ancestor-scroll")}function $(){window.clearTimeout(x),S.current=!0}function F(){x=window.setTimeout(()=>{S.current=!1},pn()?5:0)}const E=pt(o.floating);c&&(E.addEventListener("keydown",T?D:M,T),E.addEventListener("compositionstart",$),E.addEventListener("compositionend",F)),w&&E.addEventListener(u,C?H:O,C);let I=[];return h&&(Ve(o.domReference)&&(I=Zt(o.domReference)),Ve(o.floating)&&(I=I.concat(Zt(o.floating))),!Ve(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(Zt(o.reference.contextElement)))),I=I.filter(L=>{var R;return L!==((R=E.defaultView)==null?void 0:R.visualViewport)}),I.forEach(L=>{L.addEventListener("scroll",A,{passive:!0})}),()=>{c&&(E.removeEventListener("keydown",T?D:M,T),E.removeEventListener("compositionstart",$),E.removeEventListener("compositionend",F)),w&&E.removeEventListener(u,C?H:O,C),I.forEach(L=>{L.removeEventListener("scroll",A)}),window.clearTimeout(x)}},[s,o,c,w,u,r,n,h,i,y,k,M,T,D,O,C,H]),z.useEffect(()=>{s.current.insideReactTree=!1},[s,w,u]);const V=z.useMemo(()=>({onKeyDown:M,...f&&{[nf[p]]:x=>{n(!1,x.nativeEvent,"reference-press")},...p!=="click"&&{onClick(x){n(!1,x.nativeEvent,"reference-press")}}}}),[M,n,f,p]),N=z.useMemo(()=>({onKeyDown:M,onMouseDown(){m.current=!0},onMouseUp(){m.current=!0},[af[u]]:()=>{s.current.insideReactTree=!0}}),[M,u,s]);return z.useMemo(()=>i?{reference:V,floating:N}:{},[i,V,N])}function of(e){const{open:t=!1,onOpenChange:r,elements:n}=e,o=Wr(),s=z.useRef({}),[i]=z.useState(()=>Ks()),c=Cr()!=null;if(process.env.NODE_ENV!=="production"){const d=n.reference;d&&!Ve(d)&&Uu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=z.useState(n.reference),f=tt((d,v,g)=>{s.current.openEvent=d?v:void 0,i.emit("openchange",{open:d,event:v,reason:g,nested:c}),r?.(d,v,g)}),p=z.useMemo(()=>({setPositionReference:u}),[]),h=z.useMemo(()=>({reference:l||n.reference||null,floating:n.floating||null,domReference:n.reference}),[l,n.reference,n.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:f,elements:h,events:i,floatingId:o,refs:p}),[t,f,h,i,o,p])}function Hn(e){e===void 0&&(e={});const{nodeId:t}=e,r=of({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,o=n.elements,[s,i]=z.useState(null),[c,l]=z.useState(null),f=o?.domReference||s,p=z.useRef(null),h=_r();je(()=>{f&&(p.current=f)},[f]);const d=Lu({...e,elements:{...o,...c&&{reference:c}}}),v=z.useCallback(y=>{const k=Ve(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;l(k),d.refs.setReference(k)},[d.refs]),g=z.useCallback(y=>{(Ve(y)||y===null)&&(p.current=y,i(y)),(Ve(d.refs.reference.current)||d.refs.reference.current===null||y!==null&&!Ve(y))&&d.refs.setReference(y)},[d.refs]),b=z.useMemo(()=>({...d.refs,setReference:g,setPositionReference:v,domReference:p}),[d.refs,g,v]),w=z.useMemo(()=>({...d.elements,domReference:f}),[d.elements,f]),m=z.useMemo(()=>({...d,...n,refs:b,elements:w,nodeId:t}),[d,b,w,t,n]);return je(()=>{n.dataRef.current.floatingContext=m;const y=h?.nodesRef.current.find(k=>k.id===t);y&&(y.context=m)}),z.useMemo(()=>({...d,context:m,refs:b,elements:w}),[d,b,w,m])}function qa(){return Hd()&&ms()}function sf(e,t){t===void 0&&(t={});const{open:r,onOpenChange:n,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:l=!0}=t,u=z.useRef(!1),f=z.useRef(-1),p=z.useRef(!0);z.useEffect(()=>{if(!c)return;const d=kt(i.domReference);function v(){!r&&et(i.domReference)&&i.domReference===Pt(pt(i.domReference))&&(u.current=!0)}function g(){p.current=!0}function b(){p.current=!1}return d.addEventListener("blur",v),qa()&&(d.addEventListener("keydown",g,!0),d.addEventListener("pointerdown",b,!0)),()=>{d.removeEventListener("blur",v),qa()&&(d.removeEventListener("keydown",g,!0),d.removeEventListener("pointerdown",b,!0))}},[i.domReference,r,c]),z.useEffect(()=>{if(!c)return;function d(v){let{reason:g}=v;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,c]),z.useEffect(()=>()=>{vt(f)},[]);const h=z.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(d){if(u.current)return;const v=Ut(d.nativeEvent);if(l&&Ve(v)){if(qa()&&!d.relatedTarget){if(!p.current&&!Ma(v))return}else if(!Rd(v))return}n(!0,d.nativeEvent,"focus")},onBlur(d){u.current=!1;const v=d.relatedTarget,g=d.nativeEvent,b=Ve(v)&&v.hasAttribute(pr("focus-guard"))&&v.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var w;const m=Pt(i.domReference?i.domReference.ownerDocument:document);!v&&m===i.domReference||_t((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,m)||_t(i.domReference,m)||b||n(!1,g,"focus")})}}),[s,i.domReference,n,l]);return z.useMemo(()=>c?{reference:h}:{},[c,h])}function Ra(e,t,r){const n=new Map,o=r==="item";let s=e;if(o&&e){const{[Us]:i,[Ws]:c,...l}=e;s=l}return{...r==="floating"&&{tabIndex:-1,[Bu]:""},...s,...t.map(i=>{const c=i?i[r]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(l=>{let[u,f]=l;if(!(o&&[Us,Ws].includes(u)))if(u.indexOf("on")===0){if(n.has(u)||n.set(u,[]),typeof f=="function"){var p;(p=n.get(u))==null||p.push(f),i[u]=function(){for(var h,d=arguments.length,v=new Array(d),g=0;g<d;g++)v[g]=arguments[g];return(h=n.get(u))==null?void 0:h.map(b=>b(...v)).find(b=>b!==void 0)}}}else i[u]=f}),i),{})}}function Un(e){e===void 0&&(e=[]);const t=e.map(c=>c?.reference),r=e.map(c=>c?.floating),n=e.map(c=>c?.item),o=z.useCallback(c=>Ra(c,e,"reference"),t),s=z.useCallback(c=>Ra(c,e,"floating"),r),i=z.useCallback(c=>Ra(c,e,"item"),n);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const cf="Escape";function Wn(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function Gn(e,t){return Wn(t,e===Gs||e===$n,e===Hr||e===Ur)}function Ka(e,t,r){return Wn(t,e===$n,r?e===Hr:e===Ur)||e==="Enter"||e===" "||e===""}function _i(e,t,r){return Wn(t,r?e===Hr:e===Ur,e===$n)}function pi(e,t,r,n){const o=r?e===Ur:e===Hr,s=e===Gs;return t==="both"||t==="horizontal"&&n&&n>1?e===cf:Wn(t,o,s)}function Xa(e,t){const{open:r,onOpenChange:n,elements:o,floatingId:s}=e,{listRef:i,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:p=!1,loop:h=!1,nested:d=!1,rtl:v=!1,virtual:g=!1,focusItemOnOpen:b="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:m=!0,disabledIndices:y=void 0,orientation:k="vertical",parentOrientation:T,cols:C=1,scrollItemIntoView:S=!0,virtualItemRef:M,itemSizes:D,dense:O=!1}=t;process.env.NODE_ENV!=="production"&&(p&&(h||Dn("`useListNavigation` looping must be enabled to allow escaping."),g||Dn("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&C>1&&Dn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const H=En(o.floating),V=ht(H),N=Cr(),x=_r();je(()=>{e.dataRef.current.orientation=k},[e,k]);const A=tt(()=>{l(E.current===-1?null:E.current)}),$=Fa(o.domReference),F=z.useRef(b),E=z.useRef(f??-1),I=z.useRef(null),L=z.useRef(!0),R=z.useRef(A),j=z.useRef(!!o.floating),P=z.useRef(r),U=z.useRef(!1),B=z.useRef(!1),q=ht(y),X=ht(r),Y=ht(S),Q=ht(f),[oe,se]=z.useState(),[ne,ie]=z.useState(),ae=tt(()=>{function W(ve){if(g){var ke;(ke=ve.id)!=null&&ke.endsWith("-fui-option")&&(ve.id=s+"-"+Math.random().toString(16).slice(2,10)),se(ve.id),x?.events.emit("virtualfocus",ve),M&&(M.current=ve)}else gr(ve,{sync:U.current,preventScroll:!0})}const ee=i.current[E.current],J=B.current;ee&&W(ee),(U.current?ve=>ve():requestAnimationFrame)(()=>{const ve=i.current[E.current]||ee;if(!ve)return;ee||W(ve);const ke=Y.current;ke&&de&&(J||!L.current)&&(ve.scrollIntoView==null||ve.scrollIntoView(typeof ke=="boolean"?{block:"nearest",inline:"nearest"}:ke))})});je(()=>{u&&(r&&o.floating?F.current&&f!=null&&(B.current=!0,E.current=f,A()):j.current&&(E.current=-1,R.current()))},[u,r,o.floating,f,A]),je(()=>{if(u&&r&&o.floating)if(c==null){if(U.current=!1,Q.current!=null)return;if(j.current&&(E.current=-1,ae()),(!P.current||!j.current)&&F.current&&(I.current!=null||F.current===!0&&I.current==null)){let W=0;const ee=()=>{i.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(ee),W++):(E.current=I.current==null||Ka(I.current,k,v)||d?Oa(i,q.current):Es(i,q.current),I.current=null,A())};ee()}}else Br(i,c)||(E.current=c,ae(),B.current=!1)},[u,r,o.floating,c,Q,d,i,k,v,A,ae,q]),je(()=>{var W;if(!u||o.floating||!x||g||!j.current)return;const ee=x.nodesRef.current,J=(W=ee.find(ke=>ke.id===N))==null||(W=W.context)==null?void 0:W.elements.floating,ce=Pt(pt(o.floating)),ve=ee.some(ke=>ke.context&&_t(ke.context.elements.floating,ce));J&&!ve&&L.current&&J.focus({preventScroll:!0})},[u,o.floating,x,N,g]),je(()=>{if(!u||!x||!g||N)return;function W(ee){ie(ee.id),M&&(M.current=ee)}return x.events.on("virtualfocus",W),()=>{x.events.off("virtualfocus",W)}},[u,x,g,N,M]),je(()=>{R.current=A,P.current=r,j.current=!!o.floating}),je(()=>{r||(I.current=null,F.current=b)},[r,b]);const fe=c!=null,de=z.useMemo(()=>{function W(J){if(!X.current)return;const ce=i.current.indexOf(J);ce!==-1&&E.current!==ce&&(E.current=ce,A())}return{onFocus(J){let{currentTarget:ce}=J;U.current=!0,W(ce)},onClick:J=>{let{currentTarget:ce}=J;return ce.focus({preventScroll:!0})},onMouseMove(J){let{currentTarget:ce}=J;U.current=!0,B.current=!1,w&&W(ce)},onPointerLeave(J){let{pointerType:ce}=J;if(!(!L.current||ce==="touch")&&(U.current=!0,!!w&&(E.current=-1,A(),!g))){var ve;(ve=V.current)==null||ve.focus({preventScroll:!0})}}}},[X,V,w,i,A,g]),Z=z.useCallback(()=>{var W;return T??(x==null||(W=x.nodesRef.current.find(ee=>ee.id===N))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[N,x,T]),ue=tt(W=>{if(L.current=!1,U.current=!0,W.which===229||!X.current&&W.currentTarget===V.current)return;if(d&&pi(W.key,k,v,C)){Gn(W.key,Z())||gt(W),n(!1,W.nativeEvent,"list-navigation"),et(o.domReference)&&(g?x?.events.emit("virtualfocus",o.domReference):o.domReference.focus());return}const ee=E.current,J=Oa(i,y),ce=Es(i,y);if($||(W.key==="Home"&&(gt(W),E.current=J,A()),W.key==="End"&&(gt(W),E.current=ce,A())),C>1){const ve=D||Array.from({length:i.current.length},()=>({width:1,height:1})),ke=tu(ve,C,O),De=ke.findIndex(Ae=>Ae!=null&&!Sn(i,Ae,y)),at=ke.reduce((Ae,Xe,ot)=>Xe!=null&&!Sn(i,Xe,y)?ot:Ae,-1),Qe=ke[eu({current:ke.map(Ae=>Ae!=null?i.current[Ae]:null)},{event:W,orientation:k,loop:h,rtl:v,cols:C,disabledIndices:nu([...(typeof y!="function"?y:null)||i.current.map((Ae,Xe)=>Sn(i,Xe,y)?Xe:void 0),void 0],ke),minIndex:De,maxIndex:at,prevIndex:ru(E.current>ce?J:E.current,ve,ke,C,W.key===$n?"bl":W.key===(v?Hr:Ur)?"tr":"tl"),stopEvent:!0})];if(Qe!=null&&(E.current=Qe,A()),k==="both")return}if(Gn(W.key,k)){if(gt(W),r&&!g&&Pt(W.currentTarget.ownerDocument)===W.currentTarget){E.current=Ka(W.key,k,v)?J:ce,A();return}Ka(W.key,k,v)?h?E.current=ee>=ce?p&&ee!==i.current.length?-1:J:bt(i,{startingIndex:ee,disabledIndices:y}):E.current=Math.min(ce,bt(i,{startingIndex:ee,disabledIndices:y})):h?E.current=ee<=J?p&&ee!==-1?i.current.length:ce:bt(i,{startingIndex:ee,decrement:!0,disabledIndices:y}):E.current=Math.max(J,bt(i,{startingIndex:ee,decrement:!0,disabledIndices:y})),Br(i,E.current)&&(E.current=-1),A()}}),pe=z.useMemo(()=>g&&r&&fe&&{"aria-activedescendant":ne||oe},[g,r,fe,ne,oe]),he=z.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...$?{}:pe,onKeyDown:ue,onPointerMove(){L.current=!0}}),[pe,ue,k,$]),we=z.useMemo(()=>{function W(J){b==="auto"&&xs(J.nativeEvent)&&(F.current=!0)}function ee(J){F.current=b,b==="auto"&&ks(J.nativeEvent)&&(F.current=!0)}return{...pe,onKeyDown(J){L.current=!1;const ce=J.key.startsWith("Arrow"),ve=["Home","End"].includes(J.key),ke=ce||ve,De=_i(J.key,k,v),at=pi(J.key,k,v,C),Qe=_i(J.key,Z(),v),Ae=Gn(J.key,k),Xe=(d?Qe:Ae)||J.key==="Enter"||J.key.trim()==="";if(g&&r){const it=x?.nodesRef.current.find(Me=>Me.parentId==null),Ce=x&&it?Kd(x.nodesRef.current,it.id):null;if(ke&&Ce&&M){const Me=new KeyboardEvent("keydown",{key:J.key,bubbles:!0});if(De||at){var ot,Ye;const Ne=((ot=Ce.context)==null?void 0:ot.elements.domReference)===J.currentTarget,Et=at&&!Ne?(Ye=Ce.context)==null?void 0:Ye.elements.domReference:De?i.current.find(Fe=>Fe?.id===oe):null;Et&&(gt(J),Et.dispatchEvent(Me),ie(void 0))}if((Ae||ve)&&Ce.context&&Ce.context.open&&Ce.parentId&&J.currentTarget!==Ce.context.elements.domReference){var st;gt(J),(st=Ce.context.elements.domReference)==null||st.dispatchEvent(Me);return}}return ue(J)}if(!(!r&&!m&&ce)){if(Xe){const it=Gn(J.key,Z());I.current=d&&it?null:J.key}if(d){Qe&&(gt(J),r?(E.current=Oa(i,q.current),A()):n(!0,J.nativeEvent,"list-navigation"));return}Ae&&(f!=null&&(E.current=f),gt(J),!r&&m?n(!0,J.nativeEvent,"list-navigation"):ue(J),r&&A())}},onFocus(){r&&!g&&(E.current=-1,A())},onPointerDown:ee,onPointerEnter:ee,onMouseDown:W,onClick:W}},[oe,pe,C,ue,q,b,i,d,A,n,r,m,k,Z,v,f,x,g,M]);return z.useMemo(()=>u?{reference:we,floating:he,item:de}:{},[u,we,he,de])}const lf=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function qn(e,t){var r,n;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:c=!0,role:l="dialog"}=t,u=Wr(),f=((r=s.domReference)==null?void 0:r.id)||u,p=z.useMemo(()=>{var m;return((m=En(s.floating))==null?void 0:m.id)||i},[s.floating,i]),h=(n=lf.get(l))!=null?n:l,v=Cr()!=null,g=z.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?p:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":o?p:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:f},...h==="menu"&&v&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,p,v,o,f,l]),b=z.useMemo(()=>{const m={id:p,...h&&{role:h}};return h==="tooltip"||l==="label"?m:{...m,...h==="menu"&&{"aria-labelledby":f}}},[h,p,f,l]),w=z.useCallback(m=>{let{active:y,selected:k}=m;const T={role:"option",...y&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...T,"aria-selected":k}}return{}},[p,l]);return z.useMemo(()=>c?{reference:g,floating:b,item:w}:{},[c,g,b,w])}const gi=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,r)=>(r?"-":"")+t.toLowerCase());function Tr(e,t){return typeof e=="function"?e(t):e}function df(e,t){const[r,n]=z.useState(e);return e&&!r&&n(!0),z.useEffect(()=>{if(!e&&r){const o=setTimeout(()=>n(!1),t);return()=>clearTimeout(o)}},[e,r,t]),r}function uf(e,t){t===void 0&&(t={});const{open:r,elements:{floating:n}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[c,l]=z.useState("unmounted"),u=df(r,i);return!u&&c==="close"&&l("unmounted"),je(()=>{if(n){if(r){l("initial");const f=requestAnimationFrame(()=>{da.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(f)}}l("close")}},[r,n]),{isMounted:u,status:c}}function Rn(e,t){t===void 0&&(t={});const{initial:r={opacity:0},open:n,close:o,common:s,duration:i=250}=t,c=e.placement,l=c.split("-")[0],u=z.useMemo(()=>({side:l,placement:c}),[l,c]),f=typeof i=="number",p=(f?i:i.open)||0,h=(f?i:i.close)||0,[d,v]=z.useState(()=>({...Tr(s,u),...Tr(r,u)})),{isMounted:g,status:b}=uf(e,{duration:i}),w=ht(r),m=ht(n),y=ht(o),k=ht(s);return je(()=>{const T=Tr(w.current,u),C=Tr(y.current,u),S=Tr(k.current,u),M=Tr(m.current,u)||Object.keys(T).reduce((D,O)=>(D[O]="",D),{});if(b==="initial"&&v(D=>({transitionProperty:D.transitionProperty,...S,...T})),b==="open"&&v({transitionProperty:Object.keys(M).map(gi).join(","),transitionDuration:p+"ms",...S,...M}),b==="close"){const D=C||T;v({transitionProperty:Object.keys(D).map(gi).join(","),transitionDuration:h+"ms",...S,...D})}},[h,y,w,m,k,p,b,u]),{isMounted:g,styles:d}}function vi(e,t){var r;const{open:n,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:c,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:p=750,ignoreKeys:h=[],selectedIndex:d=null}=t,v=z.useRef(-1),g=z.useRef(""),b=z.useRef((r=d??i)!=null?r:-1),w=z.useRef(null),m=tt(c),y=tt(l),k=ht(f),T=ht(h);je(()=>{n&&(vt(v),w.current=null,g.current="")},[n]),je(()=>{if(n&&g.current===""){var O;b.current=(O=d??i)!=null?O:-1}},[n,d,i]);const C=tt(O=>{O?o.current.typing||(o.current.typing=O,y(O)):o.current.typing&&(o.current.typing=O,y(O))}),S=tt(O=>{function H($,F,E){const I=k.current?k.current(F,E):F.find(L=>L?.toLocaleLowerCase().indexOf(E.toLocaleLowerCase())===0);return I?$.indexOf(I):-1}const V=s.current;if(g.current.length>0&&g.current[0]!==" "&&(H(V,V,g.current)===-1?C(!1):O.key===" "&&gt(O)),V==null||T.current.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;n&&O.key!==" "&&(gt(O),C(!0)),V.every($=>{var F,E;return $?((F=$[0])==null?void 0:F.toLocaleLowerCase())!==((E=$[1])==null?void 0:E.toLocaleLowerCase()):!0})&&g.current===O.key&&(g.current="",b.current=w.current),g.current+=O.key,vt(v),v.current=window.setTimeout(()=>{g.current="",b.current=w.current,C(!1)},p);const x=b.current,A=H(V,[...V.slice((x||0)+1),...V.slice(0,(x||0)+1)],g.current);A!==-1?(m(A),w.current=A):O.key!==" "&&(g.current="",C(!1))}),M=z.useMemo(()=>({onKeyDown:S}),[S]),D=z.useMemo(()=>({onKeyDown:S,onKeyUp(O){O.key===" "&&C(!1)}}),[S,C]);return z.useMemo(()=>u?{reference:M,floating:D}:{},[u,M,D])}function mi(e,t,r){return r===void 0&&(r=!0),e.filter(o=>{var s;return o.parentId===t&&(!r||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...mi(e,o.id,r)])}function bi(e,t){const[r,n]=e;let o=!1;const s=t.length;for(let i=0,c=s-1;i<s;c=i++){const[l,u]=t[i]||[0,0],[f,p]=t[c]||[0,0];u>=n!=p>=n&&r<=(f-l)*(n-u)/(p-u)+l&&(o=!o)}return o}function ff(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function wi(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:r=!1,requireIntent:n=!0}=e,o={current:-1};let s=!1,i=null,c=null,l=typeof performance<"u"?performance.now():0;function u(p,h){const d=performance.now(),v=d-l;if(i===null||c===null||v===0)return i=p,c=h,l=d,null;const g=p-i,b=h-c,m=Math.sqrt(g*g+b*b)/v;return i=p,c=h,l=d,m}const f=p=>{let{x:h,y:d,placement:v,elements:g,onClose:b,nodeId:w,tree:m}=p;return function(k){function T(){vt(o),b()}if(vt(o),!g.domReference||!g.floating||v==null||h==null||d==null)return;const{clientX:C,clientY:S}=k,M=[C,S],D=qu(k),O=k.type==="mouseleave",H=Ha(g.floating,D),V=Ha(g.domReference,D),N=g.domReference.getBoundingClientRect(),x=g.floating.getBoundingClientRect(),A=v.split("-")[0],$=h>x.right-x.width/2,F=d>x.bottom-x.height/2,E=ff(M,N),I=x.width>N.width,L=x.height>N.height,R=(I?N:x).left,j=(I?N:x).right,P=(L?N:x).top,U=(L?N:x).bottom;if(H&&(s=!0,!O))return;if(V&&(s=!1),V&&!O){s=!0;return}if(O&&Ve(k.relatedTarget)&&Ha(g.floating,k.relatedTarget)||m&&mi(m.nodesRef.current,w).length)return;if(A==="top"&&d>=N.bottom-1||A==="bottom"&&d<=N.top+1||A==="left"&&h>=N.right-1||A==="right"&&h<=N.left+1)return T();let B=[];switch(A){case"top":B=[[R,N.top+1],[R,x.bottom-1],[j,x.bottom-1],[j,N.top+1]];break;case"bottom":B=[[R,x.top+1],[R,N.bottom-1],[j,N.bottom-1],[j,x.top+1]];break;case"left":B=[[x.right-1,U],[x.right-1,P],[N.left+1,P],[N.left+1,U]];break;case"right":B=[[N.right-1,U],[N.right-1,P],[x.left+1,P],[x.left+1,U]];break}function q(X){let[Y,Q]=X;switch(A){case"top":{const oe=[I?Y+t/2:$?Y+t*4:Y-t*4,Q+t+1],se=[I?Y-t/2:$?Y+t*4:Y-t*4,Q+t+1],ne=[[x.left,$||I?x.bottom-t:x.top],[x.right,$?I?x.bottom-t:x.top:x.bottom-t]];return[oe,se,...ne]}case"bottom":{const oe=[I?Y+t/2:$?Y+t*4:Y-t*4,Q-t],se=[I?Y-t/2:$?Y+t*4:Y-t*4,Q-t],ne=[[x.left,$||I?x.top+t:x.bottom],[x.right,$?I?x.top+t:x.bottom:x.top+t]];return[oe,se,...ne]}case"left":{const oe=[Y+t+1,L?Q+t/2:F?Q+t*4:Q-t*4],se=[Y+t+1,L?Q-t/2:F?Q+t*4:Q-t*4];return[...[[F||L?x.right-t:x.left,x.top],[F?L?x.right-t:x.left:x.right-t,x.bottom]],oe,se]}case"right":{const oe=[Y-t,L?Q+t/2:F?Q+t*4:Q-t*4],se=[Y-t,L?Q-t/2:F?Q+t*4:Q-t*4],ne=[[F||L?x.left+t:x.right,x.top],[F?L?x.left+t:x.right:x.left+t,x.bottom]];return[oe,se,...ne]}}}if(!bi([C,S],B)){if(s&&!E)return T();if(!O&&n){const X=u(k.clientX,k.clientY);if(X!==null&&X<.1)return T()}bi([C,S],q([h,d]))?!s&&n&&(o.current=window.setTimeout(T,40)):T()}}};return f.__options={blockPointerEvents:r},f}function hf(e,t){const[r,n]=z.useState(e);return z.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}function Ya(e){const t=z.useCallback(o=>{const s=window.matchMedia(e);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[e]),r=()=>window.matchMedia(e).matches,n=()=>{throw Error("useMediaQuery is a client-only hook")};return z.useSyncExternalStore(t,r,n)}function Za(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function qr(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Kn(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function yi(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function xi(e,t,r,n){if(!t.trim())return e;const o=yi(t.trim());return n?e.filter(s=>n(s,t)):e.filter(s=>yi(Za(s,r)).includes(o))}function _f(e){if(e.length===0)return!1;const t=e[0];return typeof t=="object"&&t!==null&&"grupo"in t&&"opciones"in t&&Array.isArray(t.opciones)}function pf(e){const t=[];let r=0;for(const n of e){t.push({tipo:"grupo",datos:null,nombreGrupo:n.grupo,indice:r++});for(const o of n.opciones)t.push({tipo:"opcion",datos:o,indice:r++})}return t}function gf(e,t,r,n){return t.trim()?e.map(o=>({...o,opciones:xi(o.opciones,t,r,n)})).filter(o=>o.opciones.length>0):e}function vf(e){return e.map((t,r)=>t.tipo==="grupo"||t.datos&&Kn(t.datos)?r:null).filter(t=>t!==null)}function mf(e,t){if(!t)return null;const r=t(e);return r===!0||r==null?null:typeof r=="string"?r:typeof r=="object"&&"message"in r?r.message??"Selección inválida":"Selección inválida"}function bf(e,t,r){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!r}function wf(e,t="Opción"){return Array.from({length:e},(r,n)=>`${t} ${n+1}`)}function yf(e){return Array.from({length:e},(t,r)=>({id:`usr-${r+1}`,nombre:`Usuario ${r+1}`,email:`usuario${r+1}@test.com`}))}function xf({options:e,optionLabelKey:t,optionValueKey:r,valorBusqueda:n,habilitarBusqueda:o,filterFn:s}){const i=_.useCallback(h=>Za(h,t),[t]),c=_.useCallback(h=>qr(h,r),[r]),l=_.useMemo(()=>_f(e),[e]),u=_.useMemo(()=>{if(!o||!n.trim())return e;try{return l?gf(e,n,t,s):xi(e,n,t,s)}catch{return e}},[e,n,o,s,t,l]),f=_.useMemo(()=>l?pf(u):u.map((h,d)=>({tipo:"opcion",datos:h,indice:d})),[u,l]),p=_.useMemo(()=>{try{return vf(f)}catch{return[]}},[f]);return{obtenerLabel:i,obtenerValor:c,tieneGrupos:l,listaPlana:f,indicesDeshabilitados:p}}function Ar(e,t,r){let n=r.initialDeps??[],o;function s(){var i,c,l,u;let f;r.key&&((i=r.debug)!=null&&i.call(r))&&(f=Date.now());const p=e();if(!(p.length!==n.length||p.some((v,g)=>n[g]!==v)))return o;n=p;let d;if(r.key&&((c=r.debug)!=null&&c.call(r))&&(d=Date.now()),o=t(...p),r.key&&((l=r.debug)!=null&&l.call(r))){const v=Math.round((Date.now()-f)*100)/100,g=Math.round((Date.now()-d)*100)/100,b=g/16,w=(m,y)=>{for(m=String(m);m.length<y;)m=" "+m;return m};console.info(`%c⏱ ${w(g,5)} /${w(v,5)} ms`,`
4
+ */var Kd=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Fn=Kd.join(","),Ss=typeof Element>"u",Lr=Ss?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$n=!Ss&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Jr=function(t,r){var a;r===void 0&&(r=!0);var o=t==null||(a=t.getAttribute)===null||a===void 0?void 0:a.call(t,"inert"),s=o===""||o==="true",i=s||r&&t&&Jr(t.parentNode);return i},Yd=function(t){var r,a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return a===""||a==="true"},Ts=function(t,r,a){if(Jr(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Fn));return r&&Lr.call(t,Fn)&&o.unshift(t),o=o.filter(a),o},On=function(t,r,a){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Jr(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),l=c.length?c:i.children,d=On(l,!0,a);a.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else{var h=Lr.call(i,Fn);h&&a.filter(i)&&(r||!t.includes(i))&&o.push(i);var g=i.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(i),f=!Jr(g,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(i));if(g&&f){var u=On(g===!0?i.children:g.children,!0,a);a.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else s.unshift.apply(s,i.children)}}return o},As=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ns=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Yd(t))&&!As(t)?0:t.tabIndex},Zd=function(t,r){var a=Ns(t);return a<0&&r&&!As(t)?0:a},Jd=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},Is=function(t){return t.tagName==="INPUT"},Qd=function(t){return Is(t)&&t.type==="hidden"},eu=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(a){return a.tagName==="SUMMARY"});return r},tu=function(t,r){for(var a=0;a<t.length;a++)if(t[a].checked&&t[a].form===r)return t[a]},ru=function(t){if(!t.name)return!0;var r=t.form||$n(t),a=function(c){return r.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=a(window.CSS.escape(t.name));else try{o=a(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=tu(o,t.form);return!s||s===t},nu=function(t){return Is(t)&&t.type==="radio"},au=function(t){return nu(t)&&!ru(t)},ou=function(t){var r,a=t&&$n(t),o=(r=a)===null||r===void 0?void 0:r.host,s=!1;if(a&&a!==t){var i,c,l;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var d,h,g;a=$n(o),o=(d=a)===null||d===void 0?void 0:d.host,s=!!((h=o)!==null&&h!==void 0&&(g=h.ownerDocument)!==null&&g!==void 0&&g.contains(o))}}return s},Ms=function(t){var r=t.getBoundingClientRect(),a=r.width,o=r.height;return a===0&&o===0},su=function(t,r){var a=r.displayCheck,o=r.getShadowRoot;if(a==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Lr.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Lr.call(c,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var d=t.parentElement,h=$n(t);if(d&&!d.shadowRoot&&o(d)===!0)return Ms(t);t.assignedSlot?t=t.assignedSlot:!d&&h!==t.ownerDocument?t=h.host:t=d}t=l}if(ou(t))return!t.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return Ms(t);return!1},iu=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var a=0;a<r.children.length;a++){var o=r.children.item(a);if(o.tagName==="LEGEND")return Lr.call(r,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}r=r.parentElement}return!1},ja=function(t,r){return!(r.disabled||Jr(r)||Qd(r)||su(r,t)||eu(r)||iu(r))},Ha=function(t,r){return!(au(r)||Ns(r)<0||!ja(t,r))},cu=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},Fs=function(t){var r=[],a=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,l=Zd(c,i),d=i?Fs(o.candidates):c;l===0?i?r.push.apply(r,d):r.push(c):a.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:d})}),a.sort(Jd).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(r)},Dn=function(t,r){r=r||{};var a;return r.getShadowRoot?a=On([t],r.includeContainer,{filter:Ha.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:cu}):a=Ts(t,r.includeContainer,Ha.bind(null,r)),Fs(a)},lu=function(t,r){r=r||{};var a;return r.getShadowRoot?a=On([t],r.includeContainer,{filter:ja.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):a=Ts(t,r.includeContainer,ja.bind(null,r)),a},$s=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Lr.call(t,Fn)===!1?!1:Ha(r,t)};function Os(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ds(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:a}=t;return r+"/"+a}).join(" "):navigator.userAgent}function Ls(){return/apple/i.test(navigator.vendor)}function Ua(){const e=/android/i;return e.test(Os())||e.test(Ds())}function du(){return Os().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ps(){return Ds().includes("jsdom/")}const zs="data-floating-ui-focusable",uu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wa="ArrowLeft",qa="ArrowRight",fu="ArrowUp",hu="ArrowDown";function Ht(e){let t=e.activeElement;for(;((r=t)==null||(r=r.shadowRoot)==null?void 0:r.activeElement)!=null;){var r;t=t.shadowRoot.activeElement}return t}function mt(e,t){if(!e||!t)return!1;const r=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&Cn(r)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Kt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ga(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function _u(e){return e.matches("html,body")}function bt(e){return e?.ownerDocument||document}function Ra(e){return ot(e)&&e.matches(uu)}function Xa(e){return e?e.getAttribute("role")==="combobox"&&Ra(e):!1}function pu(e){if(!e||Ps())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ln(e){return e?e.hasAttribute(zs)?e:e.querySelector("["+zs+"]")||e:null}function kr(e,t,r){return r===void 0&&(r=!0),e.filter(o=>{var s;return o.parentId===t&&(!r||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...kr(e,o.id,r)])}function gu(e,t){let r,a=-1;function o(s,i){i>a&&(r=s,a=i),kr(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===r)}function Bs(e,t){var r;let a=[],o=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s?.parentId,s&&(a=a.concat(s))}return a}function wt(e){e.preventDefault(),e.stopPropagation()}function vu(e){return"nativeEvent"in e}function Vs(e){return e.mozInputSource===0&&e.isTrusted?!0:Ua()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function js(e){return Ps()?!1:!Ua()&&e.width===0&&e.height===0||Ua()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Qr(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}var mu=typeof document<"u",bu=function(){},Ge=mu?_.useLayoutEffect:bu;const wu={...j};function gt(e){const t=j.useRef(e);return Ge(()=>{t.current=e}),t}const yu=wu.useInsertionEffect||(e=>e());function st(e){const t=j.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return yu(()=>{t.current=e}),j.useCallback(function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return t.current==null?void 0:t.current(...a)},[])}function Pn(e,t,r){return Math.floor(e/t)!==r}function en(e,t){return t<0||t>=e.current.length}function Ka(e,t){return Ct(e,{disabledIndices:t})}function Hs(e,t){return Ct(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ct(e,t){let{startingIndex:r=-1,decrement:a=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t,i=r;do i+=a?-s:s;while(i>=0&&i<=e.current.length-1&&zn(e,i,o));return i}function ku(e,t){let{event:r,orientation:a,loop:o,rtl:s,cols:i,disabledIndices:c,minIndex:l,maxIndex:d,prevIndex:h,stopEvent:g=!1}=t,f=h;if(r.key===fu){if(g&&wt(r),h===-1)f=d;else if(f=Ct(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:c}),o&&(h-i<l||f<0)){const u=h%i,v=d%i,p=d-(v-u);v===u?f=d:f=v>u?p:p-i}en(e,f)&&(f=h)}if(r.key===hu&&(g&&wt(r),h===-1?f=l:(f=Ct(e,{startingIndex:h,amount:i,disabledIndices:c}),o&&h+i>d&&(f=Ct(e,{startingIndex:h%i-i,amount:i,disabledIndices:c}))),en(e,f)&&(f=h)),a==="both"){const u=$r(h/i);r.key===(s?Wa:qa)&&(g&&wt(r),h%i!==i-1?(f=Ct(e,{startingIndex:h,disabledIndices:c}),o&&Pn(f,i,u)&&(f=Ct(e,{startingIndex:h-h%i-1,disabledIndices:c}))):o&&(f=Ct(e,{startingIndex:h-h%i-1,disabledIndices:c})),Pn(f,i,u)&&(f=h)),r.key===(s?qa:Wa)&&(g&&wt(r),h%i!==0?(f=Ct(e,{startingIndex:h,decrement:!0,disabledIndices:c}),o&&Pn(f,i,u)&&(f=Ct(e,{startingIndex:h+(i-h%i),decrement:!0,disabledIndices:c}))):o&&(f=Ct(e,{startingIndex:h+(i-h%i),decrement:!0,disabledIndices:c})),Pn(f,i,u)&&(f=h));const v=$r(d/i)===u;en(e,f)&&(o&&v?f=r.key===(s?qa:Wa)?d:Ct(e,{startingIndex:h-h%i-1,disabledIndices:c}):f=h)}return f}function xu(e,t,r){const a=[];let o=0;return e.forEach((s,i)=>{let{width:c,height:l}=s;if(c>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let d=!1;for(r&&(o=0);!d;){const h=[];for(let g=0;g<c;g++)for(let f=0;f<l;f++)h.push(o+g+f*t);o%t+c<=t&&h.every(g=>a[g]==null)?(h.forEach(g=>{a[g]=i}),d=!0):o++}}),[...a]}function Eu(e,t,r,a,o){if(e===-1)return-1;const s=r.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*a:s;case"br":return r.lastIndexOf(e)}}function Cu(e,t){return t.flatMap((r,a)=>e.includes(r)?[a]:[])}function zn(e,t,r){if(typeof r=="function")return r(t);if(r)return r.includes(t);const a=e.current[t];return a==null||a.hasAttribute("disabled")||a.getAttribute("aria-disabled")==="true"}const tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Us(e,t){const r=Dn(e,tn()),a=r.length;if(a===0)return;const o=Ht(bt(e)),s=r.indexOf(o),i=s===-1?t===1?0:a-1:s+t;return r[i]}function Ws(e){return Us(bt(e).body,1)||e}function qs(e){return Us(bt(e).body,-1)||e}function rn(e,t){const r=t||e.currentTarget,a=e.relatedTarget;return!a||!mt(r,a)}function Su(e){Dn(e,tn()).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function Gs(e){e.querySelectorAll("[data-tabindex]").forEach(r=>{const a=r.dataset.tabindex;delete r.dataset.tabindex,a?r.setAttribute("tabindex",a):r.removeAttribute("tabindex")})}function Rs(e,t,r){let{reference:a,floating:o}=e;const s=Xt(t),i=Ba(t),c=za(i),l=cr(t),d=s==="y",h=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,f=a[c]/2-o[c]/2;let u;switch(l){case"top":u={x:h,y:a.y-o.height};break;case"bottom":u={x:h,y:a.y+a.height};break;case"right":u={x:a.x+a.width,y:g};break;case"left":u={x:a.x-o.width,y:g};break;default:u={x:a.x,y:a.y}}switch(Dr(t)){case"start":u[i]-=f*(r&&d?-1:1);break;case"end":u[i]+=f*(r&&d?-1:1);break}return u}const Tu=async(e,t,r)=>{const{placement:a="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,c=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:g}=Rs(d,a,l),f=a,u={},v=0;for(let p=0;p<c.length;p++){const{name:m,fn:w}=c[p],{x:b,y,data:E,reset:S}=await w({x:h,y:g,initialPlacement:a,placement:f,strategy:o,middlewareData:u,rects:d,platform:i,elements:{reference:e,floating:t}});h=b??h,g=y??g,u={...u,[m]:{...u[m],...E}},S&&v<=50&&(v++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(d=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:h,y:g}=Rs(d,f,l)),p=-1)}return{x:h,y:g,placement:f,strategy:o,middlewareData:u}};async function Ya(e,t){var r;t===void 0&&(t={});const{x:a,y:o,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:f=!1,padding:u=0}=Or(t,e),v=Cs(u),m=c[f?g==="floating"?"reference":"floating":g],w=Mn(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(m)))==null||r?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:l})),b=g==="floating"?{x:a,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),E=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},S=Mn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:y,strategy:l}):b);return{top:(w.top-S.top+v.top)/E.y,bottom:(S.bottom-w.bottom+v.bottom)/E.y,left:(w.left-S.left+v.left)/E.x,right:(S.right-w.right+v.right)/E.x}}const Au=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:a,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:d,padding:h=0}=Or(e,t)||{};if(d==null)return{};const g=Cs(h),f={x:r,y:a},u=Ba(o),v=za(u),p=await i.getDimensions(d),m=u==="y",w=m?"top":"left",b=m?"bottom":"right",y=m?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[u]-f[u]-s.floating[v],S=f[u]-s.reference[u],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let T=C?C[y]:0;(!T||!await(i.isElement==null?void 0:i.isElement(C)))&&(T=c.floating[y]||s.floating[v]);const F=E/2-S/2,D=T/2-p[v]/2-1,M=ir(g[w],D),U=ir(g[b],D),V=M,N=T-p[v]-U,k=T/2-p[v]/2+F,A=Pa(V,k,N),O=!l.arrow&&Dr(o)!=null&&k!==A&&s.reference[v]/2-(k<V?M:U)-p[v]/2<0,$=O?k<V?k-V:k-N:0;return{[u]:f[u]+$,data:{[u]:A,centerOffset:k-A-$,...O&&{alignmentOffset:$}},reset:O}}}),Nu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,a;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:d}=t,{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...m}=Or(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const w=cr(o),b=Xt(c),y=cr(c)===c,E=await(l.isRTL==null?void 0:l.isRTL(d.floating)),S=f||(y||!p?[In(c)]:Ud(c)),C=v!=="none";!f&&C&&S.push(...Rd(c,p,v,E));const T=[c,...S],F=await Ya(t,m),D=[];let M=((a=s.flip)==null?void 0:a.overflows)||[];if(h&&D.push(F[w]),g){const k=Hd(o,i,E);D.push(F[k[0]],F[k[1]])}if(M=[...M,{placement:o,overflows:D}],!D.every(k=>k<=0)){var U,V;const k=(((U=s.flip)==null?void 0:U.index)||0)+1,A=T[k];if(A&&(!(g==="alignment"?b!==Xt(A):!1)||M.every(x=>Xt(x.placement)===b?x.overflows[0]>0:!0)))return{data:{index:k,overflows:M},reset:{placement:A}};let O=(V=M.filter($=>$.overflows[0]<=0).sort(($,x)=>$.overflows[1]-x.overflows[1])[0])==null?void 0:V.placement;if(!O)switch(u){case"bestFit":{var N;const $=(N=M.filter(x=>{if(C){const I=Xt(x.placement);return I===b||I==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(I=>I>0).reduce((I,L)=>I+L,0)]).sort((x,I)=>x[1]-I[1])[0])==null?void 0:N[0];$&&(O=$);break}case"initialPlacement":O=c;break}if(o!==O)return{reset:{placement:O}}}return{}}}},Iu=new Set(["left","top"]);async function Mu(e,t){const{placement:r,platform:a,elements:o}=e,s=await(a.isRTL==null?void 0:a.isRTL(o.floating)),i=cr(r),c=Dr(r),l=Xt(r)==="y",d=Iu.has(i)?-1:1,h=s&&l?-1:1,g=Or(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof v=="number"&&(u=c==="end"?v*-1:v),l?{x:u*h,y:f*d}:{x:f*d,y:u*h}}const Fu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,a;const{x:o,y:s,placement:i,middlewareData:c}=t,l=await Mu(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(a=c.arrow)!=null&&a.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},$u=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:a,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:m=>{let{x:w,y:b}=m;return{x:w,y:b}}},...l}=Or(e,t),d={x:r,y:a},h=await Ya(t,l),g=Xt(cr(o)),f=ks(g);let u=d[f],v=d[g];if(s){const m=f==="y"?"top":"left",w=f==="y"?"bottom":"right",b=u+h[m],y=u-h[w];u=Pa(b,u,y)}if(i){const m=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+h[m],y=v-h[w];v=Pa(b,v,y)}const p=c.fn({...t,[f]:u,[g]:v});return{...p,data:{x:p.x-r,y:p.y-a,enabled:{[f]:s,[g]:i}}}}}},Ou=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,a;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...d}=Or(e,t),h=await Ya(t,d),g=cr(o),f=Dr(o),u=Xt(o)==="y",{width:v,height:p}=s.floating;let m,w;g==="top"||g==="bottom"?(m=g,w=f===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(w=g,m=f==="end"?"top":"bottom");const b=p-h.top-h.bottom,y=v-h.left-h.right,E=ir(p-h[m],b),S=ir(v-h[w],y),C=!t.middlewareData.shift;let T=E,F=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(F=y),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(T=b),C&&!f){const M=$t(h.left,0),U=$t(h.right,0),V=$t(h.top,0),N=$t(h.bottom,0);u?F=v-2*(M!==0||U!==0?M+U:$t(h.left,h.right)):T=p-2*(V!==0||N!==0?V+N:$t(h.top,h.bottom))}await l({...t,availableWidth:F,availableHeight:T});const D=await i.getDimensions(c.floating);return v!==D.width||p!==D.height?{reset:{rects:!0}}:{}}}};function Xs(e){const t=Ft(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const o=ot(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:a,c=Nn(r)!==s||Nn(a)!==i;return c&&(r=s,a=i),{width:r,height:a,$:c}}function Za(e){return qe(e)?e:e.contextElement}function Pr(e){const t=Za(e);if(!ot(t))return jt(1);const r=t.getBoundingClientRect(),{width:a,height:o,$:s}=Xs(t);let i=(s?Nn(r.width):r.width)/a,c=(s?Nn(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Du=jt(0);function Ks(e){const t=It(e);return!Tn()||!t.visualViewport?Du:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Lu(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==It(e)?!1:t}function xr(e,t,r,a){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Za(e);let i=jt(1);t&&(a?qe(a)&&(i=Pr(a)):i=Pr(e));const c=Lu(s,r,a)?Ks(s):jt(0);let l=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,h=o.width/i.x,g=o.height/i.y;if(s){const f=It(s),u=a&&qe(a)?It(a):a;let v=f,p=La(v);for(;p&&a&&u!==v;){const m=Pr(p),w=p.getBoundingClientRect(),b=Ft(p),y=w.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,E=w.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;l*=m.x,d*=m.y,h*=m.x,g*=m.y,l+=y,d+=E,v=It(p),p=La(v)}}return Mn({width:h,height:g,x:l,y:d})}function Bn(e,t){const r=An(e).scrollLeft;return t?t.left+r:xr(Vt(e)).left+r}function Ys(e,t){const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-Bn(e,r),o=r.top+t.scrollTop;return{x:a,y:o}}function Pu(e){let{elements:t,rect:r,offsetParent:a,strategy:o}=e;const s=o==="fixed",i=Vt(a),c=t?Sn(t.floating):!1;if(a===i||c&&s)return r;let l={scrollLeft:0,scrollTop:0},d=jt(1);const h=jt(0),g=ot(a);if((g||!g&&!s)&&((or(a)!=="body"||Zr(i))&&(l=An(a)),ot(a))){const u=xr(a);d=Pr(a),h.x=u.x+a.clientLeft,h.y=u.y+a.clientTop}const f=i&&!g&&!s?Ys(i,l):jt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+h.x+f.x,y:r.y*d.y-l.scrollTop*d.y+h.y+f.y}}function zu(e){return Array.from(e.getClientRects())}function Bu(e){const t=Vt(e),r=An(e),a=e.ownerDocument.body,o=$t(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=$t(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-r.scrollLeft+Bn(e);const c=-r.scrollTop;return Ft(a).direction==="rtl"&&(i+=$t(t.clientWidth,a.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Zs=25;function Vu(e,t){const r=It(e),a=Vt(e),o=r.visualViewport;let s=a.clientWidth,i=a.clientHeight,c=0,l=0;if(o){s=o.width,i=o.height;const h=Tn();(!h||h&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const d=Bn(a);if(d<=0){const h=a.ownerDocument,g=h.body,f=getComputedStyle(g),u=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,v=Math.abs(a.clientWidth-g.clientWidth-u);v<=Zs&&(s-=v)}else d<=Zs&&(s+=d);return{width:s,height:i,x:c,y:l}}const ju=new Set(["absolute","fixed"]);function Hu(e,t){const r=xr(e,!0,t==="fixed"),a=r.top+e.clientTop,o=r.left+e.clientLeft,s=ot(e)?Pr(e):jt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,d=a*s.y;return{width:i,height:c,x:l,y:d}}function Js(e,t,r){let a;if(t==="viewport")a=Vu(e,r);else if(t==="document")a=Bu(Vt(e));else if(qe(t))a=Hu(t,r);else{const o=Ks(e);a={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Mn(a)}function Qs(e,t){const r=Rt(e);return r===t||!qe(r)||Gt(r)?!1:Ft(r).position==="fixed"||Qs(r,t)}function Uu(e,t){const r=t.get(e);if(r)return r;let a=sr(e,[],!1).filter(c=>qe(c)&&or(c)!=="body"),o=null;const s=Ft(e).position==="fixed";let i=s?Rt(e):e;for(;qe(i)&&!Gt(i);){const c=Ft(i),l=Da(i);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&ju.has(o.position)||Zr(i)&&!l&&Qs(e,i))?a=a.filter(h=>h!==i):o=c,i=Rt(i)}return t.set(e,a),a}function Wu(e){let{element:t,boundary:r,rootBoundary:a,strategy:o}=e;const i=[...r==="clippingAncestors"?Sn(t)?[]:Uu(t,this._c):[].concat(r),a],c=i[0],l=i.reduce((d,h)=>{const g=Js(t,h,o);return d.top=$t(g.top,d.top),d.right=ir(g.right,d.right),d.bottom=ir(g.bottom,d.bottom),d.left=$t(g.left,d.left),d},Js(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qu(e){const{width:t,height:r}=Xs(e);return{width:t,height:r}}function Gu(e,t,r){const a=ot(t),o=Vt(t),s=r==="fixed",i=xr(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=jt(0);function d(){l.x=Bn(o)}if(a||!a&&!s)if((or(t)!=="body"||Zr(o))&&(c=An(t)),a){const u=xr(t,!0,s,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&d();s&&!a&&o&&d();const h=o&&!a&&!s?Ys(o,c):jt(0),g=i.left+c.scrollLeft-l.x-h.x,f=i.top+c.scrollTop-l.y-h.y;return{x:g,y:f,width:i.width,height:i.height}}function Ja(e){return Ft(e).position==="static"}function ei(e,t){if(!ot(e)||Ft(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Vt(e)===r&&(r=r.ownerDocument.body),r}function ti(e,t){const r=It(e);if(Sn(e))return r;if(!ot(e)){let o=Rt(e);for(;o&&!Gt(o);){if(qe(o)&&!Ja(o))return o;o=Rt(o)}return r}let a=ei(e,t);for(;a&&Fd(a)&&Ja(a);)a=ei(a,t);return a&&Gt(a)&&Ja(a)&&!Da(a)?r:a||Pd(e)||r}const Ru=async function(e){const t=this.getOffsetParent||ti,r=this.getDimensions,a=await r(e.floating);return{reference:Gu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Xu(e){return Ft(e).direction==="rtl"}const Ku={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:Vt,getClippingRect:Wu,getOffsetParent:ti,getElementRects:Ru,getClientRects:zu,getDimensions:qu,getScale:Pr,isElement:qe,isRTL:Xu};function ri(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yu(e,t){let r=null,a;const o=Vt(e);function s(){var c;clearTimeout(a),(c=r)==null||c.disconnect(),r=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:h,top:g,width:f,height:u}=d;if(c||t(),!f||!u)return;const v=$r(g),p=$r(o.clientWidth-(h+f)),m=$r(o.clientHeight-(g+u)),w=$r(h),y={rootMargin:-v+"px "+-p+"px "+-m+"px "+-w+"px",threshold:$t(0,ir(1,l))||1};let E=!0;function S(C){const T=C[0].intersectionRatio;if(T!==l){if(!E)return i();T?i(!1,T):a=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!ri(d,e.getBoundingClientRect())&&i(),E=!1}try{r=new IntersectionObserver(S,{...y,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,y)}r.observe(e)}return i(!0),s}function Vn(e,t,r,a){a===void 0&&(a={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=a,d=Za(e),h=o||s?[...d?sr(d):[],...sr(t)]:[];h.forEach(w=>{o&&w.addEventListener("scroll",r,{passive:!0}),s&&w.addEventListener("resize",r)});const g=d&&c?Yu(d,r):null;let f=-1,u=null;i&&(u=new ResizeObserver(w=>{let[b]=w;b&&b.target===d&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=u)==null||y.observe(t)})),r()}),d&&!l&&u.observe(d),u.observe(t));let v,p=l?xr(e):null;l&&m();function m(){const w=xr(e);p&&!ri(p,w)&&r(),p=w,v=requestAnimationFrame(m)}return r(),()=>{var w;h.forEach(b=>{o&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),g?.(),(w=u)==null||w.disconnect(),u=null,l&&cancelAnimationFrame(v)}}const Zu=Fu,Ju=$u,Qu=Nu,ef=Ou,ni=Au,tf=(e,t,r)=>{const a=new Map,o={platform:Ku,...r},s={...o.platform,_c:a};return Tu(e,t,{...o,platform:s})};var rf=typeof document<"u",nf=function(){},jn=rf?_.useLayoutEffect:nf;function Hn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,a,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;a--!==0;)if(!Hn(e[a],t[a]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(t,o[a]))return!1;for(a=r;a--!==0;){const s=o[a];if(!(s==="_owner"&&e.$$typeof)&&!Hn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ai(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oi(e,t){const r=ai(e);return Math.round(t*r)/r}function Qa(e){const t=j.useRef(e);return jn(()=>{t.current=e}),t}function af(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[h,g]=j.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,u]=j.useState(a);Hn(f,a)||u(a);const[v,p]=j.useState(null),[m,w]=j.useState(null),b=j.useCallback(x=>{x!==C.current&&(C.current=x,p(x))},[]),y=j.useCallback(x=>{x!==T.current&&(T.current=x,w(x))},[]),E=s||v,S=i||m,C=j.useRef(null),T=j.useRef(null),F=j.useRef(h),D=l!=null,M=Qa(l),U=Qa(o),V=Qa(d),N=j.useCallback(()=>{if(!C.current||!T.current)return;const x={placement:t,strategy:r,middleware:f};U.current&&(x.platform=U.current),tf(C.current,T.current,x).then(I=>{const L={...I,isPositioned:V.current!==!1};k.current&&!Hn(F.current,L)&&(F.current=L,Sa.flushSync(()=>{g(L)}))})},[f,t,r,U,V]);jn(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,g(x=>({...x,isPositioned:!1})))},[d]);const k=j.useRef(!1);jn(()=>(k.current=!0,()=>{k.current=!1}),[]),jn(()=>{if(E&&(C.current=E),S&&(T.current=S),E&&S){if(M.current)return M.current(E,S,N);N()}},[E,S,N,M,D]);const A=j.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:y}),[b,y]),O=j.useMemo(()=>({reference:E,floating:S}),[E,S]),$=j.useMemo(()=>{const x={position:r,left:0,top:0};if(!O.floating)return x;const I=oi(O.floating,h.x),L=oi(O.floating,h.y);return c?{...x,transform:"translate("+I+"px, "+L+"px)",...ai(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:L}},[r,c,O.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:N,refs:A,elements:O,floatingStyles:$}),[h,N,A,O,$])}const of=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:a,padding:o}=typeof e=="function"?e(r):e;return a&&t(a)?a.current!=null?ni({element:a.current,padding:o}).fn(r):{}:a?ni({element:a,padding:o}).fn(r):{}}}},Un=(e,t)=>({...Zu(e),options:[e,t]}),Wn=(e,t)=>({...Ju(e),options:[e,t]}),qn=(e,t)=>({...Qu(e),options:[e,t]}),si=(e,t)=>({...ef(e),options:[e,t]}),sf=(e,t)=>({...of(e),options:[e,t]});function eo(e){const t=j.useRef(void 0),r=j.useCallback(a=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,c=i(a);return typeof c=="function"?c:()=>{i(null)}}return s.current=a,()=>{s.current=null}}});return()=>{o.forEach(s=>s?.())}},e);return j.useMemo(()=>e.every(a=>a==null)?null:a=>{t.current&&(t.current(),t.current=void 0),a!=null&&(t.current=r(a))},e)}const cf="data-floating-ui-focusable",ii="active",ci="selected",nn="ArrowLeft",an="ArrowRight",li="ArrowUp",Gn="ArrowDown",lf={...j};let di=!1,df=0;const ui=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+df++;function uf(){const[e,t]=j.useState(()=>di?ui():void 0);return Ge(()=>{e==null&&t(ui())},[]),j.useEffect(()=>{di=!0},[]),e}const on=lf.useId||uf;let sn;process.env.NODE_ENV!=="production"&&(sn=new Set);function Rn(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];const o="Floating UI: "+r.join(" ");if(!((e=sn)!=null&&e.has(o))){var s;(s=sn)==null||s.add(o),console.warn(o)}}function ff(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];const o="Floating UI: "+r.join(" ");if(!((e=sn)!=null&&e.has(o))){var s;(s=sn)==null||s.add(o),console.error(o)}}const hf=j.forwardRef(function(t,r){const{context:{placement:a,elements:{floating:o},middlewareData:{arrow:s,shift:i}},width:c=14,height:l=7,tipRadius:d=0,strokeWidth:h=0,staticOffset:g,stroke:f,d:u,style:{transform:v,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(r||Rn("The `ref` prop is required for `FloatingArrow`."));const w=on(),[b,y]=j.useState(!1);if(Ge(()=>{if(!o)return;Ft(o).direction==="rtl"&&y(!0)},[o]),!o)return null;const[E,S]=a.split("-"),C=E==="top"||E==="bottom";let T=g;(C&&i!=null&&i.x||!C&&i!=null&&i.y)&&(T=null);const F=h*2,D=F/2,M=c/2*(d/-8+1),U=l/2*d/4,V=!!u,N=T&&S==="end"?"bottom":"top";let k=T&&S==="end"?"right":"left";T&&b&&(k=S==="end"?"left":"right");const A=s?.x!=null?T||s.x:"",O=s?.y!=null?T||s.y:"",$=u||"M0,0"+(" H"+c)+(" L"+(c-M)+","+(l-U))+(" Q"+c/2+","+l+" "+M+","+(l-U))+" Z",x={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[E];return n.jsxs("svg",{...m,"aria-hidden":!0,ref:r,width:V?c:c+F,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[k]:A,[N]:O,[E]:C||V?"100%":"calc(100% - "+F/2+"px)",transform:[x,v].filter(I=>!!I).join(" "),...p},children:[F>0&&n.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,strokeWidth:F+(u?0:1),d:$}),n.jsx("path",{stroke:F&&!u?m.fill:"none",d:$}),n.jsx("clipPath",{id:w,children:n.jsx("rect",{x:-D,y:D*(V?-1:1),width:c+F,height:c})})]})});function fi(){const e=new Map;return{emit(t,r){var a;(a=e.get(t))==null||a.forEach(o=>o(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var a;(a=e.get(t))==null||a.delete(r)}}}const hi=j.createContext(null),_i=j.createContext(null),zr=()=>{var e;return((e=j.useContext(hi))==null?void 0:e.id)||null},Er=()=>j.useContext(_i);function pi(e){const t=on(),r=Er(),o=zr();return Ge(()=>{if(!t)return;const s={id:t,parentId:o};return r?.addNode(s),()=>{r?.removeNode(s)}},[r,t,o]),t}function gi(e){const{children:t,id:r}=e,a=zr();return n.jsx(hi.Provider,{value:j.useMemo(()=>({id:r,parentId:a}),[r,a]),children:t})}function _f(e){const{children:t}=e,r=j.useRef([]),a=j.useCallback(i=>{r.current=[...r.current,i]},[]),o=j.useCallback(i=>{r.current=r.current.filter(c=>c!==i)},[]),[s]=j.useState(()=>fi());return n.jsx(_i.Provider,{value:j.useMemo(()=>({nodesRef:r,addNode:a,removeNode:o,events:s}),[a,o,s]),children:t})}function Cr(e){return"data-floating-ui-"+e}function yt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const vi=Cr("safe-polygon");function to(e,t,r){if(r&&!Qr(r))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const a=e();return typeof a=="number"?a:a?.[t]}return e?.[t]}function ro(e){return typeof e=="function"?e():e}function no(e,t){t===void 0&&(t={});const{open:r,onOpenChange:a,dataRef:o,events:s,elements:i}=e,{enabled:c=!0,delay:l=0,handleClose:d=null,mouseOnly:h=!1,restMs:g=0,move:f=!0}=t,u=Er(),v=zr(),p=gt(d),m=gt(l),w=gt(r),b=gt(g),y=j.useRef(),E=j.useRef(-1),S=j.useRef(),C=j.useRef(-1),T=j.useRef(!0),F=j.useRef(!1),D=j.useRef(()=>{}),M=j.useRef(!1),U=st(()=>{var $;const x=($=o.current.openEvent)==null?void 0:$.type;return x?.includes("mouse")&&x!=="mousedown"});j.useEffect(()=>{if(!c)return;function $(x){let{open:I}=x;I||(yt(E),yt(C),T.current=!0,M.current=!1)}return s.on("openchange",$),()=>{s.off("openchange",$)}},[c,s]),j.useEffect(()=>{if(!c||!p.current||!r)return;function $(I){U()&&a(!1,I,"hover")}const x=bt(i.floating).documentElement;return x.addEventListener("mouseleave",$),()=>{x.removeEventListener("mouseleave",$)}},[i.floating,r,a,c,p,U]);const V=j.useCallback(function($,x,I){x===void 0&&(x=!0),I===void 0&&(I="hover");const L=to(m.current,"close",y.current);L&&!S.current?(yt(E),E.current=window.setTimeout(()=>a(!1,$,I),L)):x&&(yt(E),a(!1,$,I))},[m,a]),N=st(()=>{D.current(),S.current=void 0}),k=st(()=>{if(F.current){const $=bt(i.floating).body;$.style.pointerEvents="",$.removeAttribute(vi),F.current=!1}}),A=st(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);j.useEffect(()=>{if(!c)return;function $(H){if(yt(E),T.current=!1,h&&!Qr(y.current)||ro(b.current)>0&&!to(m.current,"open"))return;const z=to(m.current,"open",y.current);z?E.current=window.setTimeout(()=>{w.current||a(!0,H,"hover")},z):r||a(!0,H,"hover")}function x(H){if(A()){k();return}D.current();const z=bt(i.floating);if(yt(C),M.current=!1,p.current&&o.current.floatingContext){r||yt(E),S.current=p.current({...o.current.floatingContext,tree:u,x:H.clientX,y:H.clientY,onClose(){k(),N(),A()||V(H,!0,"safe-polygon")}});const B=S.current;z.addEventListener("mousemove",B),D.current=()=>{z.removeEventListener("mousemove",B)};return}(y.current==="touch"?!mt(i.floating,H.relatedTarget):!0)&&V(H)}function I(H){A()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:u,x:H.clientX,y:H.clientY,onClose(){k(),N(),A()||V(H)}})(H))}function L(){yt(E)}function X(H){A()||V(H,!1)}if(qe(i.domReference)){const H=i.domReference,z=i.floating;return r&&H.addEventListener("mouseleave",I),f&&H.addEventListener("mousemove",$,{once:!0}),H.addEventListener("mouseenter",$),H.addEventListener("mouseleave",x),z&&(z.addEventListener("mouseleave",I),z.addEventListener("mouseenter",L),z.addEventListener("mouseleave",X)),()=>{r&&H.removeEventListener("mouseleave",I),f&&H.removeEventListener("mousemove",$),H.removeEventListener("mouseenter",$),H.removeEventListener("mouseleave",x),z&&(z.removeEventListener("mouseleave",I),z.removeEventListener("mouseenter",L),z.removeEventListener("mouseleave",X))}}},[i,c,e,h,f,V,N,k,a,r,w,u,m,p,o,A,b]),Ge(()=>{var $;if(c&&r&&($=p.current)!=null&&($=$.__options)!=null&&$.blockPointerEvents&&U()){F.current=!0;const I=i.floating;if(qe(i.domReference)&&I){var x;const L=bt(i.floating).body;L.setAttribute(vi,"");const X=i.domReference,H=u==null||(x=u.nodesRef.current.find(z=>z.id===v))==null||(x=x.context)==null?void 0:x.elements.floating;return H&&(H.style.pointerEvents=""),L.style.pointerEvents="none",X.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{L.style.pointerEvents="",X.style.pointerEvents="",I.style.pointerEvents=""}}}},[c,r,v,i,u,p,U]),Ge(()=>{r||(y.current=void 0,M.current=!1,N(),k())},[r,N,k]),j.useEffect(()=>()=>{N(),yt(E),yt(C),k()},[c,i.domReference,N,k]);const O=j.useMemo(()=>{function $(x){y.current=x.pointerType}return{onPointerDown:$,onPointerEnter:$,onMouseMove(x){const{nativeEvent:I}=x;function L(){!T.current&&!w.current&&a(!0,I,"hover")}h&&!Qr(y.current)||r||ro(b.current)===0||M.current&&x.movementX**2+x.movementY**2<2||(yt(C),y.current==="touch"?L():(M.current=!0,C.current=window.setTimeout(L,ro(b.current))))}}},[h,a,r,w,b]);return j.useMemo(()=>c?{reference:O}:{},[c,O])}let mi=0;function Sr(e,t){t===void 0&&(t={});const{preventScroll:r=!1,cancelPrevious:a=!0,sync:o=!1}=t;a&&cancelAnimationFrame(mi);const s=()=>e?.focus({preventScroll:r});o?s():mi=requestAnimationFrame(s)}function ao(e,t){if(!e||!t)return!1;const r=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&Cn(r)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function pf(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gf(e){return e?.ownerDocument||document}const Br={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function bi(e){return e==="inert"?Br.inert:e==="aria-hidden"?Br["aria-hidden"]:Br.none}let Xn=new WeakSet,Kn={},oo=0;const vf=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,wi=e=>e&&(e.host||wi(e.parentNode)),mf=(e,t)=>t.map(r=>{if(e.contains(r))return r;const a=wi(r);return e.contains(a)?a:null}).filter(r=>r!=null);function bf(e,t,r,a){const o="data-floating-ui-inert",s=a?"inert":r?"aria-hidden":null,i=mf(t,e),c=new Set,l=new Set(i),d=[];Kn[o]||(Kn[o]=new WeakMap);const h=Kn[o];i.forEach(g),f(t),c.clear();function g(u){!u||c.has(u)||(c.add(u),u.parentNode&&g(u.parentNode))}function f(u){!u||l.has(u)||[].forEach.call(u.children,v=>{if(or(v)!=="script")if(c.has(v))f(v);else{const p=s?v.getAttribute(s):null,m=p!==null&&p!=="false",w=bi(s),b=(w.get(v)||0)+1,y=(h.get(v)||0)+1;w.set(v,b),h.set(v,y),d.push(v),b===1&&m&&Xn.add(v),y===1&&v.setAttribute(o,""),!m&&s&&v.setAttribute(s,s==="inert"?"":"true")}})}return oo++,()=>{d.forEach(u=>{const v=bi(s),m=(v.get(u)||0)-1,w=(h.get(u)||0)-1;v.set(u,m),h.set(u,w),m||(!Xn.has(u)&&s&&u.removeAttribute(s),Xn.delete(u)),w||u.removeAttribute(o)}),oo--,oo||(Br.inert=new WeakMap,Br["aria-hidden"]=new WeakMap,Br.none=new WeakMap,Xn=new WeakSet,Kn={})}}function yi(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=gf(e[0]).body;return bf(e.concat(Array.from(a.querySelectorAll('[aria-live],[role="status"],output'))),a,t,r)}const Yn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Zn=j.forwardRef(function(t,r){const[a,o]=j.useState();Ge(()=>{Ls()&&o("button")},[]);const s={ref:r,tabIndex:0,role:a,"aria-hidden":a?void 0:!0,[Cr("focus-guard")]:"",style:Yn};return n.jsx("span",{...t,...s})}),ki=j.createContext(null),xi=Cr("portal");function wf(e){e===void 0&&(e={});const{id:t,root:r}=e,a=on(),o=Ei(),[s,i]=j.useState(null),c=j.useRef(null);return Ge(()=>()=>{s?.remove(),queueMicrotask(()=>{c.current=null})},[s]),Ge(()=>{if(!a||c.current)return;const l=t?document.getElementById(t):null;if(!l)return;const d=document.createElement("div");d.id=a,d.setAttribute(xi,""),l.appendChild(d),c.current=d,i(d)},[t,a]),Ge(()=>{if(r===null||!a||c.current)return;let l=r||o?.portalNode;l&&!Oa(l)&&(l=l.current),l=l||document.body;let d=null;t&&(d=document.createElement("div"),d.id=t,l.appendChild(d));const h=document.createElement("div");h.id=a,h.setAttribute(xi,""),l=d||l,l.appendChild(h),c.current=h,i(h)},[t,r,a,o]),s}function Jn(e){const{children:t,id:r,root:a,preserveTabOrder:o=!0}=e,s=wf({id:r,root:a}),[i,c]=j.useState(null),l=j.useRef(null),d=j.useRef(null),h=j.useRef(null),g=j.useRef(null),f=i?.modal,u=i?.open,v=!!i&&!i.modal&&i.open&&o&&!!(a||s);return j.useEffect(()=>{if(!s||!o||f)return;function p(m){s&&rn(m)&&(m.type==="focusin"?Gs:Su)(s)}return s.addEventListener("focusin",p,!0),s.addEventListener("focusout",p,!0),()=>{s.removeEventListener("focusin",p,!0),s.removeEventListener("focusout",p,!0)}},[s,o,f]),j.useEffect(()=>{s&&(u||Gs(s))},[u,s]),n.jsxs(ki.Provider,{value:j.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:d,beforeInsideRef:h,afterInsideRef:g,portalNode:s,setFocusManagerState:c}),[o,s]),children:[v&&s&&n.jsx(Zn,{"data-type":"outside",ref:l,onFocus:p=>{if(rn(p,s)){var m;(m=h.current)==null||m.focus()}else{const w=i?i.domReference:null,b=qs(w);b?.focus()}}}),v&&s&&n.jsx("span",{"aria-owns":s.id,style:Yn}),s&&Sa.createPortal(t,s),v&&s&&n.jsx(Zn,{"data-type":"outside",ref:d,onFocus:p=>{if(rn(p,s)){var m;(m=g.current)==null||m.focus()}else{const w=i?i.domReference:null,b=Ws(w);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const Ei=()=>j.useContext(ki);function Ci(e){return j.useMemo(()=>t=>{e.forEach(r=>{r&&(r.current=t)})},e)}const yf=20;let lr=[];function so(){lr=lr.filter(e=>e.isConnected)}function kf(e){so(),e&&or(e)!=="body"&&(lr.push(e),lr.length>yf&&(lr=lr.slice(-20)))}function Si(){return so(),lr[lr.length-1]}function xf(e){const t=tn();return $s(e,t)?e:Dn(e,t)[0]||e}function Ti(e,t){var r;if(!t.current.includes("floating")&&!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const a=tn(),s=lu(e,a).filter(c=>{const l=c.getAttribute("data-tabindex")||"";return $s(c,a)||c.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Ef=j.forwardRef(function(t,r){return n.jsx("button",{...t,type:"button",ref:r,tabIndex:-1,style:Yn})});function io(e){const{context:t,children:r,disabled:a=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:c=!0,restoreFocus:l=!1,modal:d=!0,visuallyHiddenDismiss:h=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:u=()=>[]}=e,{open:v,onOpenChange:p,events:m,dataRef:w,elements:{domReference:b,floating:y}}=t,E=st(()=>{var ae;return(ae=w.current.floatingContext)==null?void 0:ae.nodeId}),S=st(u),C=typeof i=="number"&&i<0,T=Xa(b)&&C,F=vf(),D=F?s:!0,M=!D||F&&f,U=gt(o),V=gt(i),N=gt(c),k=Er(),A=Ei(),O=j.useRef(null),$=j.useRef(null),x=j.useRef(!1),I=j.useRef(!1),L=j.useRef(-1),X=j.useRef(-1),H=A!=null,z=Ln(y),q=st(function(ae){return ae===void 0&&(ae=z),ae?Dn(ae,tn()):[]}),B=st(ae=>{const de=q(ae);return U.current.map(oe=>b&&oe==="reference"?b:z&&oe==="floating"?z:de).filter(Boolean).flat()});j.useEffect(()=>{if(a||!d)return;function ae(oe){if(oe.key==="Tab"){mt(z,Ht(bt(z)))&&q().length===0&&!T&&wt(oe);const fe=B(),pe=Kt(oe);U.current[0]==="reference"&&pe===b&&(wt(oe),oe.shiftKey?Sr(fe[fe.length-1]):Sr(fe[1])),U.current[1]==="floating"&&pe===z&&oe.shiftKey&&(wt(oe),Sr(fe[0]))}}const de=bt(z);return de.addEventListener("keydown",ae),()=>{de.removeEventListener("keydown",ae)}},[a,b,z,d,U,T,q,B]),j.useEffect(()=>{if(a||!y)return;function ae(de){const oe=Kt(de),pe=q().indexOf(oe);pe!==-1&&(L.current=pe)}return y.addEventListener("focusin",ae),()=>{y.removeEventListener("focusin",ae)}},[a,y,q]),j.useEffect(()=>{if(a||!g)return;function ae(){I.current=!0,setTimeout(()=>{I.current=!1})}function de(pe){const te=pe.relatedTarget,ue=pe.currentTarget,ge=Kt(pe);queueMicrotask(()=>{const ve=E(),J=!(mt(b,te)||mt(y,te)||mt(te,y)||mt(A?.portalNode,te)||te!=null&&te.hasAttribute(Cr("focus-guard"))||k&&(kr(k.nodesRef.current,ve).find(P=>{var G,W;return mt((G=P.context)==null?void 0:G.elements.floating,te)||mt((W=P.context)==null?void 0:W.elements.domReference,te)})||Bs(k.nodesRef.current,ve).find(P=>{var G,W,re;return[(G=P.context)==null?void 0:G.elements.floating,Ln((W=P.context)==null?void 0:W.elements.floating)].includes(te)||((re=P.context)==null?void 0:re.elements.domReference)===te})));if(ue===b&&z&&Ti(z,U),l&&ue!==b&&!(ge!=null&&ge.isConnected)&&Ht(bt(z))===bt(z).body){ot(z)&&z.focus();const P=L.current,G=q(),W=G[P]||G[G.length-1]||z;ot(W)&&W.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(T||!d)&&te&&J&&!I.current&&te!==Si()&&(x.current=!0,p(!1,pe,"focus-out"))})}const oe=!!(!k&&A);function fe(){yt(X),w.current.insideReactTree=!0,X.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(y&&ot(b))return b.addEventListener("focusout",de),b.addEventListener("pointerdown",ae),y.addEventListener("focusout",de),oe&&y.addEventListener("focusout",fe,!0),()=>{b.removeEventListener("focusout",de),b.removeEventListener("pointerdown",ae),y.removeEventListener("focusout",de),oe&&y.removeEventListener("focusout",fe,!0)}},[a,b,y,z,d,k,A,p,g,l,q,T,E,U,w]);const K=j.useRef(null),Y=j.useRef(null),Q=Ci([K,A?.beforeInsideRef]),ee=Ci([Y,A?.afterInsideRef]);j.useEffect(()=>{var ae,de;if(a||!y)return;const oe=Array.from((A==null||(ae=A.portalNode)==null?void 0:ae.querySelectorAll("["+Cr("portal")+"]"))||[]),pe=(de=(k?Bs(k.nodesRef.current,E()):[]).find(ge=>{var ve;return Xa(((ve=ge.context)==null?void 0:ve.elements.domReference)||null)}))==null||(de=de.context)==null?void 0:de.elements.domReference,te=[y,pe,...oe,...S(),O.current,$.current,K.current,Y.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,U.current.includes("reference")||T?b:null].filter(ge=>ge!=null),ue=d||T?yi(te,!M,M):yi(te);return()=>{ue()}},[a,b,y,d,U,A,T,D,M,k,E,S]),Ge(()=>{if(a||!ot(z))return;const ae=bt(z),de=Ht(ae);queueMicrotask(()=>{const oe=B(z),fe=V.current,pe=(typeof fe=="number"?oe[fe]:fe.current)||z,te=mt(z,de);!C&&!te&&v&&Sr(pe,{preventScroll:pe===z})})},[a,v,z,C,B,V]),Ge(()=>{if(a||!z)return;const ae=bt(z),de=Ht(ae);kf(de);function oe(te){let{reason:ue,event:ge,nested:ve}=te;if(["hover","safe-polygon"].includes(ue)&&ge.type==="mouseleave"&&(x.current=!0),ue==="outside-press")if(ve)x.current=!1;else if(Vs(ge)||js(ge))x.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?x.current=!1:x.current=!0}}m.on("openchange",oe);const fe=ae.createElement("span");fe.setAttribute("tabindex","-1"),fe.setAttribute("aria-hidden","true"),Object.assign(fe.style,Yn),H&&b&&b.insertAdjacentElement("afterend",fe);function pe(){if(typeof N.current=="boolean"){const te=b||Si();return te&&te.isConnected?te:fe}return N.current.current||fe}return()=>{m.off("openchange",oe);const te=Ht(ae),ue=mt(y,te)||k&&kr(k.nodesRef.current,E(),!1).some(ve=>{var J;return mt((J=ve.context)==null?void 0:J.elements.floating,te)}),ge=pe();queueMicrotask(()=>{const ve=xf(ge);N.current&&!x.current&&ot(ve)&&(!(ve!==te&&te!==ae.body)||ue)&&ve.focus({preventScroll:!0}),fe.remove()})}},[a,y,z,N,w,m,k,H,b,E]),j.useEffect(()=>(queueMicrotask(()=>{x.current=!1}),()=>{queueMicrotask(so)}),[a]),Ge(()=>{if(!a&&A)return A.setFocusManagerState({modal:d,closeOnFocusOut:g,open:v,onOpenChange:p,domReference:b}),()=>{A.setFocusManagerState(null)}},[a,A,d,v,p,g,b]),Ge(()=>{a||z&&Ti(z,U)},[a,z,U]);function se(ae){return a||!h||!d?null:n.jsx(Ef,{ref:ae==="start"?O:$,onClick:de=>p(!1,de.nativeEvent),children:typeof h=="string"?h:"Dismiss"})}const ce=!a&&D&&(d?!T:!0)&&(H||d);return n.jsxs(n.Fragment,{children:[ce&&n.jsx(Zn,{"data-type":"inside",ref:Q,onFocus:ae=>{if(d){const oe=B();Sr(o[0]==="reference"?oe[0]:oe[oe.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(x.current=!1,rn(ae,A.portalNode)){const oe=Ws(b);oe?.focus()}else{var de;(de=A.beforeOutsideRef.current)==null||de.focus()}}}),!T&&se("start"),r,se("end"),ce&&n.jsx(Zn,{"data-type":"inside",ref:ee,onFocus:ae=>{if(d)Sr(B()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(g&&(x.current=!0),rn(ae,A.portalNode)){const oe=qs(b);oe?.focus()}else{var de;(de=A.afterOutsideRef.current)==null||de.focus()}}})]})}function Ai(e){return ot(e.target)&&e.target.tagName==="BUTTON"}function Cf(e){return ot(e.target)&&e.target.tagName==="A"}function Ni(e){return Ra(e)}function Ii(e,t){t===void 0&&(t={});const{open:r,onOpenChange:a,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:l=!0,ignoreMouse:d=!1,keyboardHandlers:h=!0,stickIfOpen:g=!0}=t,f=j.useRef(),u=j.useRef(!1),v=j.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const m=f.current;p.button===0&&c!=="click"&&(Qr(m,!0)&&d||(r&&l&&(!(o.current.openEvent&&g)||o.current.openEvent.type==="mousedown")?a(!1,p.nativeEvent,"click"):(p.preventDefault(),a(!0,p.nativeEvent,"click"))))},onClick(p){const m=f.current;if(c==="mousedown"&&f.current){f.current=void 0;return}Qr(m,!0)&&d||(r&&l&&(!(o.current.openEvent&&g)||o.current.openEvent.type==="click")?a(!1,p.nativeEvent,"click"):a(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!h||Ai(p))&&(p.key===" "&&!Ni(s)&&(p.preventDefault(),u.current=!0),!Cf(p)&&p.key==="Enter"&&a(!(r&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!h||Ai(p)||Ni(s)||p.key===" "&&u.current&&(u.current=!1,a(!(r&&l),p.nativeEvent,"click"))}}),[o,s,c,d,h,a,r,g,l]);return j.useMemo(()=>i?{reference:v}:{},[i,v])}const Sf={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Tf={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Mi=e=>{var t,r;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(r=e?.outsidePress)!=null?r:!0}};function Qn(e,t){t===void 0&&(t={});const{open:r,onOpenChange:a,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:u,capture:v}=t,p=Er(),m=st(typeof l=="function"?l:()=>!1),w=typeof l=="function"?m:l,b=j.useRef(!1),{escapeKey:y,outsidePress:E}=Mi(u),{escapeKey:S,outsidePress:C}=Mi(v),T=j.useRef(!1),F=st(k=>{var A;if(!r||!i||!c||k.key!=="Escape"||T.current)return;const O=(A=s.current.floatingContext)==null?void 0:A.nodeId,$=p?kr(p.nodesRef.current,O):[];if(!y&&(k.stopPropagation(),$.length>0)){let x=!0;if($.forEach(I=>{var L;if((L=I.context)!=null&&L.open&&!I.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}a(!1,vu(k)?k.nativeEvent:k,"escape-key")}),D=st(k=>{var A;const O=()=>{var $;F(k),($=Kt(k))==null||$.removeEventListener("keydown",O)};(A=Kt(k))==null||A.addEventListener("keydown",O)}),M=st(k=>{var A;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const $=b.current;if(b.current=!1,d==="click"&&$||O||typeof w=="function"&&!w(k))return;const x=Kt(k),I="["+Cr("inert")+"]",L=bt(o.floating).querySelectorAll(I);let X=qe(x)?x:null;for(;X&&!Gt(X);){const B=Rt(X);if(Gt(B)||!qe(B))break;X=B}if(L.length&&qe(x)&&!_u(x)&&!mt(x,o.floating)&&Array.from(L).every(B=>!mt(X,B)))return;if(ot(x)&&N){const B=Gt(x),K=Ft(x),Y=/auto|scroll/,Q=B||Y.test(K.overflowX),ee=B||Y.test(K.overflowY),se=Q&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,ce=ee&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,ae=K.direction==="rtl",de=ce&&(ae?k.offsetX<=x.offsetWidth-x.clientWidth:k.offsetX>x.clientWidth),oe=se&&k.offsetY>x.clientHeight;if(de||oe)return}const H=(A=s.current.floatingContext)==null?void 0:A.nodeId,z=p&&kr(p.nodesRef.current,H).some(B=>{var K;return Ga(k,(K=B.context)==null?void 0:K.elements.floating)});if(Ga(k,o.floating)||Ga(k,o.domReference)||z)return;const q=p?kr(p.nodesRef.current,H):[];if(q.length>0){let B=!0;if(q.forEach(K=>{var Y;if((Y=K.context)!=null&&Y.open&&!K.context.dataRef.current.__outsidePressBubbles){B=!1;return}}),!B)return}a(!1,k,"outside-press")}),U=st(k=>{var A;const O=()=>{var $;M(k),($=Kt(k))==null||$.removeEventListener(d,O)};(A=Kt(k))==null||A.addEventListener(d,O)});j.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=y,s.current.__outsidePressBubbles=E;let k=-1;function A(L){a(!1,L,"ancestor-scroll")}function O(){window.clearTimeout(k),T.current=!0}function $(){k=window.setTimeout(()=>{T.current=!1},Tn()?5:0)}const x=bt(o.floating);c&&(x.addEventListener("keydown",S?D:F,S),x.addEventListener("compositionstart",O),x.addEventListener("compositionend",$)),w&&x.addEventListener(d,C?U:M,C);let I=[];return f&&(qe(o.domReference)&&(I=sr(o.domReference)),qe(o.floating)&&(I=I.concat(sr(o.floating))),!qe(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(sr(o.reference.contextElement)))),I=I.filter(L=>{var X;return L!==((X=x.defaultView)==null?void 0:X.visualViewport)}),I.forEach(L=>{L.addEventListener("scroll",A,{passive:!0})}),()=>{c&&(x.removeEventListener("keydown",S?D:F,S),x.removeEventListener("compositionstart",O),x.removeEventListener("compositionend",$)),w&&x.removeEventListener(d,C?U:M,C),I.forEach(L=>{L.removeEventListener("scroll",A)}),window.clearTimeout(k)}},[s,o,c,w,d,r,a,f,i,y,E,F,S,D,M,C,U]),j.useEffect(()=>{s.current.insideReactTree=!1},[s,w,d]);const V=j.useMemo(()=>({onKeyDown:F,...h&&{[Sf[g]]:k=>{a(!1,k.nativeEvent,"reference-press")},...g!=="click"&&{onClick(k){a(!1,k.nativeEvent,"reference-press")}}}}),[F,a,h,g]),N=j.useMemo(()=>({onKeyDown:F,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Tf[d]]:()=>{s.current.insideReactTree=!0}}),[F,d,s]);return j.useMemo(()=>i?{reference:V,floating:N}:{},[i,V,N])}function Af(e){const{open:t=!1,onOpenChange:r,elements:a}=e,o=on(),s=j.useRef({}),[i]=j.useState(()=>fi()),c=zr()!=null;if(process.env.NODE_ENV!=="production"){const u=a.reference;u&&!qe(u)&&ff("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,d]=j.useState(a.reference),h=st((u,v,p)=>{s.current.openEvent=u?v:void 0,i.emit("openchange",{open:u,event:v,reason:p,nested:c}),r?.(u,v,p)}),g=j.useMemo(()=>({setPositionReference:d}),[]),f=j.useMemo(()=>({reference:l||a.reference||null,floating:a.floating||null,domReference:a.reference}),[l,a.reference,a.floating]);return j.useMemo(()=>({dataRef:s,open:t,onOpenChange:h,elements:f,events:i,floatingId:o,refs:g}),[t,h,f,i,o,g])}function ea(e){e===void 0&&(e={});const{nodeId:t}=e,r=Af({...e,elements:{reference:null,floating:null,...e.elements}}),a=e.rootContext||r,o=a.elements,[s,i]=j.useState(null),[c,l]=j.useState(null),h=o?.domReference||s,g=j.useRef(null),f=Er();Ge(()=>{h&&(g.current=h)},[h]);const u=af({...e,elements:{...o,...c&&{reference:c}}}),v=j.useCallback(y=>{const E=qe(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;l(E),u.refs.setReference(E)},[u.refs]),p=j.useCallback(y=>{(qe(y)||y===null)&&(g.current=y,i(y)),(qe(u.refs.reference.current)||u.refs.reference.current===null||y!==null&&!qe(y))&&u.refs.setReference(y)},[u.refs]),m=j.useMemo(()=>({...u.refs,setReference:p,setPositionReference:v,domReference:g}),[u.refs,p,v]),w=j.useMemo(()=>({...u.elements,domReference:h}),[u.elements,h]),b=j.useMemo(()=>({...u,...a,refs:m,elements:w,nodeId:t}),[u,m,w,t,a]);return Ge(()=>{a.dataRef.current.floatingContext=b;const y=f?.nodesRef.current.find(E=>E.id===t);y&&(y.context=b)}),j.useMemo(()=>({...u,context:b,refs:m,elements:w}),[u,m,w,b])}function co(){return du()&&Ls()}function Nf(e,t){t===void 0&&(t={});const{open:r,onOpenChange:a,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:l=!0}=t,d=j.useRef(!1),h=j.useRef(-1),g=j.useRef(!0);j.useEffect(()=>{if(!c)return;const u=It(i.domReference);function v(){!r&&ot(i.domReference)&&i.domReference===Ht(bt(i.domReference))&&(d.current=!0)}function p(){g.current=!0}function m(){g.current=!1}return u.addEventListener("blur",v),co()&&(u.addEventListener("keydown",p,!0),u.addEventListener("pointerdown",m,!0)),()=>{u.removeEventListener("blur",v),co()&&(u.removeEventListener("keydown",p,!0),u.removeEventListener("pointerdown",m,!0))}},[i.domReference,r,c]),j.useEffect(()=>{if(!c)return;function u(v){let{reason:p}=v;(p==="reference-press"||p==="escape-key")&&(d.current=!0)}return o.on("openchange",u),()=>{o.off("openchange",u)}},[o,c]),j.useEffect(()=>()=>{yt(h)},[]);const f=j.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(u){if(d.current)return;const v=Kt(u.nativeEvent);if(l&&qe(v)){if(co()&&!u.relatedTarget){if(!g.current&&!Ra(v))return}else if(!pu(v))return}a(!0,u.nativeEvent,"focus")},onBlur(u){d.current=!1;const v=u.relatedTarget,p=u.nativeEvent,m=qe(v)&&v.hasAttribute(Cr("focus-guard"))&&v.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{var w;const b=Ht(i.domReference?i.domReference.ownerDocument:document);!v&&b===i.domReference||mt((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,b)||mt(i.domReference,b)||m||a(!1,p,"focus")})}}),[s,i.domReference,a,l]);return j.useMemo(()=>c?{reference:f}:{},[c,f])}function lo(e,t,r){const a=new Map,o=r==="item";let s=e;if(o&&e){const{[ii]:i,[ci]:c,...l}=e;s=l}return{...r==="floating"&&{tabIndex:-1,[cf]:""},...s,...t.map(i=>{const c=i?i[r]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(l=>{let[d,h]=l;if(!(o&&[ii,ci].includes(d)))if(d.indexOf("on")===0){if(a.has(d)||a.set(d,[]),typeof h=="function"){var g;(g=a.get(d))==null||g.push(h),i[d]=function(){for(var f,u=arguments.length,v=new Array(u),p=0;p<u;p++)v[p]=arguments[p];return(f=a.get(d))==null?void 0:f.map(m=>m(...v)).find(m=>m!==void 0)}}}else i[d]=h}),i),{})}}function ta(e){e===void 0&&(e=[]);const t=e.map(c=>c?.reference),r=e.map(c=>c?.floating),a=e.map(c=>c?.item),o=j.useCallback(c=>lo(c,e,"reference"),t),s=j.useCallback(c=>lo(c,e,"floating"),r),i=j.useCallback(c=>lo(c,e,"item"),a);return j.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const If="Escape";function ra(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function na(e,t){return ra(t,e===li||e===Gn,e===nn||e===an)}function uo(e,t,r){return ra(t,e===Gn,r?e===nn:e===an)||e==="Enter"||e===" "||e===""}function Fi(e,t,r){return ra(t,r?e===nn:e===an,e===Gn)}function $i(e,t,r,a){const o=r?e===an:e===nn,s=e===li;return t==="both"||t==="horizontal"&&a&&a>1?e===If:ra(t,o,s)}function fo(e,t){const{open:r,onOpenChange:a,elements:o,floatingId:s}=e,{listRef:i,activeIndex:c,onNavigate:l=()=>{},enabled:d=!0,selectedIndex:h=null,allowEscape:g=!1,loop:f=!1,nested:u=!1,rtl:v=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:b=!0,disabledIndices:y=void 0,orientation:E="vertical",parentOrientation:S,cols:C=1,scrollItemIntoView:T=!0,virtualItemRef:F,itemSizes:D,dense:M=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(f||Rn("`useListNavigation` looping must be enabled to allow escaping."),p||Rn("`useListNavigation` must be virtual to allow escaping.")),E==="vertical"&&C>1&&Rn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const U=Ln(o.floating),V=gt(U),N=zr(),k=Er();Ge(()=>{e.dataRef.current.orientation=E},[e,E]);const A=st(()=>{l(x.current===-1?null:x.current)}),O=Xa(o.domReference),$=j.useRef(m),x=j.useRef(h??-1),I=j.useRef(null),L=j.useRef(!0),X=j.useRef(A),H=j.useRef(!!o.floating),z=j.useRef(r),q=j.useRef(!1),B=j.useRef(!1),K=gt(y),Y=gt(r),Q=gt(T),ee=gt(h),[se,ce]=j.useState(),[ae,de]=j.useState(),oe=st(()=>{function P(le){if(p){var he;(he=le.id)!=null&&he.endsWith("-fui-option")&&(le.id=s+"-"+Math.random().toString(16).slice(2,10)),ce(le.id),k?.events.emit("virtualfocus",le),F&&(F.current=le)}else Sr(le,{sync:q.current,preventScroll:!0})}const G=i.current[x.current],W=B.current;G&&P(G),(q.current?le=>le():requestAnimationFrame)(()=>{const le=i.current[x.current]||G;if(!le)return;G||P(le);const he=Q.current;he&&pe&&(W||!L.current)&&(le.scrollIntoView==null||le.scrollIntoView(typeof he=="boolean"?{block:"nearest",inline:"nearest"}:he))})});Ge(()=>{d&&(r&&o.floating?$.current&&h!=null&&(B.current=!0,x.current=h,A()):H.current&&(x.current=-1,X.current()))},[d,r,o.floating,h,A]),Ge(()=>{if(d&&r&&o.floating)if(c==null){if(q.current=!1,ee.current!=null)return;if(H.current&&(x.current=-1,oe()),(!z.current||!H.current)&&$.current&&(I.current!=null||$.current===!0&&I.current==null)){let P=0;const G=()=>{i.current[0]==null?(P<2&&(P?requestAnimationFrame:queueMicrotask)(G),P++):(x.current=I.current==null||uo(I.current,E,v)||u?Ka(i,K.current):Hs(i,K.current),I.current=null,A())};G()}}else en(i,c)||(x.current=c,oe(),B.current=!1)},[d,r,o.floating,c,ee,u,i,E,v,A,oe,K]),Ge(()=>{var P;if(!d||o.floating||!k||p||!H.current)return;const G=k.nodesRef.current,W=(P=G.find(he=>he.id===N))==null||(P=P.context)==null?void 0:P.elements.floating,re=Ht(bt(o.floating)),le=G.some(he=>he.context&&mt(he.context.elements.floating,re));W&&!le&&L.current&&W.focus({preventScroll:!0})},[d,o.floating,k,N,p]),Ge(()=>{if(!d||!k||!p||N)return;function P(G){de(G.id),F&&(F.current=G)}return k.events.on("virtualfocus",P),()=>{k.events.off("virtualfocus",P)}},[d,k,p,N,F]),Ge(()=>{X.current=A,z.current=r,H.current=!!o.floating}),Ge(()=>{r||(I.current=null,$.current=m)},[r,m]);const fe=c!=null,pe=j.useMemo(()=>{function P(W){if(!Y.current)return;const re=i.current.indexOf(W);re!==-1&&x.current!==re&&(x.current=re,A())}return{onFocus(W){let{currentTarget:re}=W;q.current=!0,P(re)},onClick:W=>{let{currentTarget:re}=W;return re.focus({preventScroll:!0})},onMouseMove(W){let{currentTarget:re}=W;q.current=!0,B.current=!1,w&&P(re)},onPointerLeave(W){let{pointerType:re}=W;if(!(!L.current||re==="touch")&&(q.current=!0,!!w&&(x.current=-1,A(),!p))){var le;(le=V.current)==null||le.focus({preventScroll:!0})}}}},[Y,V,w,i,A,p]),te=j.useCallback(()=>{var P;return S??(k==null||(P=k.nodesRef.current.find(G=>G.id===N))==null||(P=P.context)==null||(P=P.dataRef)==null?void 0:P.current.orientation)},[N,k,S]),ue=st(P=>{if(L.current=!1,q.current=!0,P.which===229||!Y.current&&P.currentTarget===V.current)return;if(u&&$i(P.key,E,v,C)){na(P.key,te())||wt(P),a(!1,P.nativeEvent,"list-navigation"),ot(o.domReference)&&(p?k?.events.emit("virtualfocus",o.domReference):o.domReference.focus());return}const G=x.current,W=Ka(i,y),re=Hs(i,y);if(O||(P.key==="Home"&&(wt(P),x.current=W,A()),P.key==="End"&&(wt(P),x.current=re,A())),C>1){const le=D||Array.from({length:i.current.length},()=>({width:1,height:1})),he=xu(le,C,M),Ce=he.findIndex(Ee=>Ee!=null&&!zn(i,Ee,y)),Ne=he.reduce((Ee,Ze,tt)=>Ze!=null&&!zn(i,Ze,y)?tt:Ee,-1),Ie=he[ku({current:he.map(Ee=>Ee!=null?i.current[Ee]:null)},{event:P,orientation:E,loop:f,rtl:v,cols:C,disabledIndices:Cu([...(typeof y!="function"?y:null)||i.current.map((Ee,Ze)=>zn(i,Ze,y)?Ze:void 0),void 0],he),minIndex:Ce,maxIndex:Ne,prevIndex:Eu(x.current>re?W:x.current,le,he,C,P.key===Gn?"bl":P.key===(v?nn:an)?"tr":"tl"),stopEvent:!0})];if(Ie!=null&&(x.current=Ie,A()),E==="both")return}if(na(P.key,E)){if(wt(P),r&&!p&&Ht(P.currentTarget.ownerDocument)===P.currentTarget){x.current=uo(P.key,E,v)?W:re,A();return}uo(P.key,E,v)?f?x.current=G>=re?g&&G!==i.current.length?-1:W:Ct(i,{startingIndex:G,disabledIndices:y}):x.current=Math.min(re,Ct(i,{startingIndex:G,disabledIndices:y})):f?x.current=G<=W?g&&G!==-1?i.current.length:re:Ct(i,{startingIndex:G,decrement:!0,disabledIndices:y}):x.current=Math.max(W,Ct(i,{startingIndex:G,decrement:!0,disabledIndices:y})),en(i,x.current)&&(x.current=-1),A()}}),ge=j.useMemo(()=>p&&r&&fe&&{"aria-activedescendant":ae||se},[p,r,fe,ae,se]),ve=j.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...O?{}:ge,onKeyDown:ue,onPointerMove(){L.current=!0}}),[ge,ue,E,O]),J=j.useMemo(()=>{function P(W){m==="auto"&&Vs(W.nativeEvent)&&($.current=!0)}function G(W){$.current=m,m==="auto"&&js(W.nativeEvent)&&($.current=!0)}return{...ge,onKeyDown(W){L.current=!1;const re=W.key.startsWith("Arrow"),le=["Home","End"].includes(W.key),he=re||le,Ce=Fi(W.key,E,v),Ne=$i(W.key,E,v,C),Ie=Fi(W.key,te(),v),Ee=na(W.key,E),Ze=(u?Ie:Ee)||W.key==="Enter"||W.key.trim()==="";if(p&&r){const rt=k?.nodesRef.current.find(Le=>Le.parentId==null),Ae=k&&rt?gu(k.nodesRef.current,rt.id):null;if(he&&Ae&&F){const Le=new KeyboardEvent("keydown",{key:W.key,bubbles:!0});if(Ce||Ne){var tt,Fe;const $e=((tt=Ae.context)==null?void 0:tt.elements.domReference)===W.currentTarget,_t=Ne&&!$e?(Fe=Ae.context)==null?void 0:Fe.elements.domReference:Ce?i.current.find(Pe=>Pe?.id===se):null;_t&&(wt(W),_t.dispatchEvent(Le),de(void 0))}if((Ee||le)&&Ae.context&&Ae.context.open&&Ae.parentId&&W.currentTarget!==Ae.context.elements.domReference){var De;wt(W),(De=Ae.context.elements.domReference)==null||De.dispatchEvent(Le);return}}return ue(W)}if(!(!r&&!b&&re)){if(Ze){const rt=na(W.key,te());I.current=u&&rt?null:W.key}if(u){Ie&&(wt(W),r?(x.current=Ka(i,K.current),A()):a(!0,W.nativeEvent,"list-navigation"));return}Ee&&(h!=null&&(x.current=h),wt(W),!r&&b?a(!0,W.nativeEvent,"list-navigation"):ue(W),r&&A())}},onFocus(){r&&!p&&(x.current=-1,A())},onPointerDown:G,onPointerEnter:G,onMouseDown:P,onClick:P}},[se,ge,C,ue,K,m,i,u,A,a,r,b,E,te,v,h,k,p,F]);return j.useMemo(()=>d?{reference:J,floating:ve,item:pe}:{},[d,J,ve,pe])}const Mf=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function aa(e,t){var r,a;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:c=!0,role:l="dialog"}=t,d=on(),h=((r=s.domReference)==null?void 0:r.id)||d,g=j.useMemo(()=>{var b;return((b=Ln(s.floating))==null?void 0:b.id)||i},[s.floating,i]),f=(a=Mf.get(l))!=null?a:l,v=zr()!=null,p=j.useMemo(()=>f==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?g:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":o?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:h},...f==="menu"&&v&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[f,g,v,o,h,l]),m=j.useMemo(()=>{const b={id:g,...f&&{role:f}};return f==="tooltip"||l==="label"?b:{...b,...f==="menu"&&{"aria-labelledby":h}}},[f,g,h,l]),w=j.useCallback(b=>{let{active:y,selected:E}=b;const S={role:"option",...y&&{id:g+"-fui-option"}};switch(l){case"select":case"combobox":return{...S,"aria-selected":E}}return{}},[g,l]);return j.useMemo(()=>c?{reference:p,floating:m,item:w}:{},[c,p,m,w])}const Oi=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,r)=>(r?"-":"")+t.toLowerCase());function Vr(e,t){return typeof e=="function"?e(t):e}function Ff(e,t){const[r,a]=j.useState(e);return e&&!r&&a(!0),j.useEffect(()=>{if(!e&&r){const o=setTimeout(()=>a(!1),t);return()=>clearTimeout(o)}},[e,r,t]),r}function $f(e,t){t===void 0&&(t={});const{open:r,elements:{floating:a}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[c,l]=j.useState("unmounted"),d=Ff(r,i);return!d&&c==="close"&&l("unmounted"),Ge(()=>{if(a){if(r){l("initial");const h=requestAnimationFrame(()=>{Sa.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(h)}}l("close")}},[r,a]),{isMounted:d,status:c}}function oa(e,t){t===void 0&&(t={});const{initial:r={opacity:0},open:a,close:o,common:s,duration:i=250}=t,c=e.placement,l=c.split("-")[0],d=j.useMemo(()=>({side:l,placement:c}),[l,c]),h=typeof i=="number",g=(h?i:i.open)||0,f=(h?i:i.close)||0,[u,v]=j.useState(()=>({...Vr(s,d),...Vr(r,d)})),{isMounted:p,status:m}=$f(e,{duration:i}),w=gt(r),b=gt(a),y=gt(o),E=gt(s);return Ge(()=>{const S=Vr(w.current,d),C=Vr(y.current,d),T=Vr(E.current,d),F=Vr(b.current,d)||Object.keys(S).reduce((D,M)=>(D[M]="",D),{});if(m==="initial"&&v(D=>({transitionProperty:D.transitionProperty,...T,...S})),m==="open"&&v({transitionProperty:Object.keys(F).map(Oi).join(","),transitionDuration:g+"ms",...T,...F}),m==="close"){const D=C||S;v({transitionProperty:Object.keys(D).map(Oi).join(","),transitionDuration:f+"ms",...T,...D})}},[f,y,w,b,E,g,m,d]),{isMounted:p,styles:u}}function Di(e,t){var r;const{open:a,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:c,onTypingChange:l,enabled:d=!0,findMatch:h=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:u=null}=t,v=j.useRef(-1),p=j.useRef(""),m=j.useRef((r=u??i)!=null?r:-1),w=j.useRef(null),b=st(c),y=st(l),E=gt(h),S=gt(f);Ge(()=>{a&&(yt(v),w.current=null,p.current="")},[a]),Ge(()=>{if(a&&p.current===""){var M;m.current=(M=u??i)!=null?M:-1}},[a,u,i]);const C=st(M=>{M?o.current.typing||(o.current.typing=M,y(M)):o.current.typing&&(o.current.typing=M,y(M))}),T=st(M=>{function U(O,$,x){const I=E.current?E.current($,x):$.find(L=>L?.toLocaleLowerCase().indexOf(x.toLocaleLowerCase())===0);return I?O.indexOf(I):-1}const V=s.current;if(p.current.length>0&&p.current[0]!==" "&&(U(V,V,p.current)===-1?C(!1):M.key===" "&&wt(M)),V==null||S.current.includes(M.key)||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;a&&M.key!==" "&&(wt(M),C(!0)),V.every(O=>{var $,x;return O?(($=O[0])==null?void 0:$.toLocaleLowerCase())!==((x=O[1])==null?void 0:x.toLocaleLowerCase()):!0})&&p.current===M.key&&(p.current="",m.current=w.current),p.current+=M.key,yt(v),v.current=window.setTimeout(()=>{p.current="",m.current=w.current,C(!1)},g);const k=m.current,A=U(V,[...V.slice((k||0)+1),...V.slice(0,(k||0)+1)],p.current);A!==-1?(b(A),w.current=A):M.key!==" "&&(p.current="",C(!1))}),F=j.useMemo(()=>({onKeyDown:T}),[T]),D=j.useMemo(()=>({onKeyDown:T,onKeyUp(M){M.key===" "&&C(!1)}}),[T,C]);return j.useMemo(()=>d?{reference:F,floating:D}:{},[d,F,D])}function Li(e,t,r){return r===void 0&&(r=!0),e.filter(o=>{var s;return o.parentId===t&&(!r||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...Li(e,o.id,r)])}function Pi(e,t){const[r,a]=e;let o=!1;const s=t.length;for(let i=0,c=s-1;i<s;c=i++){const[l,d]=t[i]||[0,0],[h,g]=t[c]||[0,0];d>=a!=g>=a&&r<=(h-l)*(a-d)/(g-d)+l&&(o=!o)}return o}function Of(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function zi(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:r=!1,requireIntent:a=!0}=e,o={current:-1};let s=!1,i=null,c=null,l=typeof performance<"u"?performance.now():0;function d(g,f){const u=performance.now(),v=u-l;if(i===null||c===null||v===0)return i=g,c=f,l=u,null;const p=g-i,m=f-c,b=Math.sqrt(p*p+m*m)/v;return i=g,c=f,l=u,b}const h=g=>{let{x:f,y:u,placement:v,elements:p,onClose:m,nodeId:w,tree:b}=g;return function(E){function S(){yt(o),m()}if(yt(o),!p.domReference||!p.floating||v==null||f==null||u==null)return;const{clientX:C,clientY:T}=E,F=[C,T],D=pf(E),M=E.type==="mouseleave",U=ao(p.floating,D),V=ao(p.domReference,D),N=p.domReference.getBoundingClientRect(),k=p.floating.getBoundingClientRect(),A=v.split("-")[0],O=f>k.right-k.width/2,$=u>k.bottom-k.height/2,x=Of(F,N),I=k.width>N.width,L=k.height>N.height,X=(I?N:k).left,H=(I?N:k).right,z=(L?N:k).top,q=(L?N:k).bottom;if(U&&(s=!0,!M))return;if(V&&(s=!1),V&&!M){s=!0;return}if(M&&qe(E.relatedTarget)&&ao(p.floating,E.relatedTarget)||b&&Li(b.nodesRef.current,w).length)return;if(A==="top"&&u>=N.bottom-1||A==="bottom"&&u<=N.top+1||A==="left"&&f>=N.right-1||A==="right"&&f<=N.left+1)return S();let B=[];switch(A){case"top":B=[[X,N.top+1],[X,k.bottom-1],[H,k.bottom-1],[H,N.top+1]];break;case"bottom":B=[[X,k.top+1],[X,N.bottom-1],[H,N.bottom-1],[H,k.top+1]];break;case"left":B=[[k.right-1,q],[k.right-1,z],[N.left+1,z],[N.left+1,q]];break;case"right":B=[[N.right-1,q],[N.right-1,z],[k.left+1,z],[k.left+1,q]];break}function K(Y){let[Q,ee]=Y;switch(A){case"top":{const se=[I?Q+t/2:O?Q+t*4:Q-t*4,ee+t+1],ce=[I?Q-t/2:O?Q+t*4:Q-t*4,ee+t+1],ae=[[k.left,O||I?k.bottom-t:k.top],[k.right,O?I?k.bottom-t:k.top:k.bottom-t]];return[se,ce,...ae]}case"bottom":{const se=[I?Q+t/2:O?Q+t*4:Q-t*4,ee-t],ce=[I?Q-t/2:O?Q+t*4:Q-t*4,ee-t],ae=[[k.left,O||I?k.top+t:k.bottom],[k.right,O?I?k.top+t:k.bottom:k.top+t]];return[se,ce,...ae]}case"left":{const se=[Q+t+1,L?ee+t/2:$?ee+t*4:ee-t*4],ce=[Q+t+1,L?ee-t/2:$?ee+t*4:ee-t*4];return[...[[$||L?k.right-t:k.left,k.top],[$?L?k.right-t:k.left:k.right-t,k.bottom]],se,ce]}case"right":{const se=[Q-t,L?ee+t/2:$?ee+t*4:ee-t*4],ce=[Q-t,L?ee-t/2:$?ee+t*4:ee-t*4],ae=[[$||L?k.left+t:k.right,k.top],[$?L?k.left+t:k.right:k.left+t,k.bottom]];return[se,ce,...ae]}}}if(!Pi([C,T],B)){if(s&&!x)return S();if(!M&&a){const Y=d(E.clientX,E.clientY);if(Y!==null&&Y<.1)return S()}Pi([C,T],K([f,u]))?!s&&a&&(o.current=window.setTimeout(S,40)):S()}}};return h.__options={blockPointerEvents:r},h}function Df(e,t){const[r,a]=j.useState(e);return j.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}function ho(e){const t=j.useCallback(o=>{const s=window.matchMedia(e);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[e]),r=()=>window.matchMedia(e).matches,a=()=>{throw Error("useMediaQuery is a client-only hook")};return j.useSyncExternalStore(t,r,a)}function _o(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function cn(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function sa(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Bi(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Vi(e,t,r,a){if(!t.trim())return e;const o=Bi(t.trim());return a?e.filter(s=>a(s,t)):e.filter(s=>Bi(_o(s,r)).includes(o))}function Lf(e){if(e.length===0)return!1;const t=e[0];return typeof t=="object"&&t!==null&&"grupo"in t&&"opciones"in t&&Array.isArray(t.opciones)}function Pf(e){const t=[];let r=0;for(const a of e){t.push({tipo:"grupo",datos:null,nombreGrupo:a.grupo,indice:r++});for(const o of a.opciones)t.push({tipo:"opcion",datos:o,indice:r++})}return t}function zf(e,t,r,a){return t.trim()?e.map(o=>({...o,opciones:Vi(o.opciones,t,r,a)})).filter(o=>o.opciones.length>0):e}function Bf(e){return e.map((t,r)=>t.tipo==="grupo"||t.datos&&sa(t.datos)?r:null).filter(t=>t!==null)}function Vf(e,t){if(!t)return null;const r=t(e);return r===!0||r==null?null:typeof r=="string"?r:typeof r=="object"&&"message"in r?r.message??"Selección inválida":"Selección inválida"}function jf(e,t,r){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!r}function Hf(e,t="Opción"){return Array.from({length:e},(r,a)=>`${t} ${a+1}`)}function Uf(e){return Array.from({length:e},(t,r)=>({id:`usr-${r+1}`,nombre:`Usuario ${r+1}`,email:`usuario${r+1}@test.com`}))}function Wf({options:e,optionLabelKey:t,optionValueKey:r,valorBusqueda:a,habilitarBusqueda:o,filterFn:s}){const i=_.useCallback(f=>_o(f,t),[t]),c=_.useCallback(f=>cn(f,r),[r]),l=_.useMemo(()=>Lf(e),[e]),d=_.useMemo(()=>{if(!o||!a.trim())return e;try{return l?zf(e,a,t,s):Vi(e,a,t,s)}catch{return e}},[e,a,o,s,t,l]),h=_.useMemo(()=>l?Pf(d):d.map((f,u)=>({tipo:"opcion",datos:f,indice:u})),[d,l]),g=_.useMemo(()=>{try{return Bf(h)}catch{return[]}},[h]);return{obtenerLabel:i,obtenerValor:c,tieneGrupos:l,listaPlana:h,indicesDeshabilitados:g}}function jr(e,t,r){let a=r.initialDeps??[],o;function s(){var i,c,l,d;let h;r.key&&((i=r.debug)!=null&&i.call(r))&&(h=Date.now());const g=e();if(!(g.length!==a.length||g.some((v,p)=>a[p]!==v)))return o;a=g;let u;if(r.key&&((c=r.debug)!=null&&c.call(r))&&(u=Date.now()),o=t(...g),r.key&&((l=r.debug)!=null&&l.call(r))){const v=Math.round((Date.now()-h)*100)/100,p=Math.round((Date.now()-u)*100)/100,m=p/16,w=(b,y)=>{for(b=String(b);b.length<y;)b=" "+b;return b};console.info(`%c⏱ ${w(p,5)} /${w(v,5)} ms`,`
5
5
  font-size: .6rem;
6
6
  font-weight: bold;
7
- color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return(u=r?.onChange)==null||u.call(r,o),o}return s.updateDeps=i=>{n=i},s}function ki(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const kf=(e,t)=>Math.abs(e-t)<1.01,Ef=(e,t,r)=>{let n;return function(...o){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,o),r)}},Ei=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Cf=e=>e,Sf=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let o=t;o<=r;o++)n.push(o);return n},Tf=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const o=i=>{const{width:c,height:l}=i;t({width:Math.round(c),height:Math.round(l)})};if(o(Ei(r)),!n.ResizeObserver)return()=>{};const s=new n.ResizeObserver(i=>{const c=()=>{const l=i[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(Ei(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return s.observe(r,{box:"border-box"}),()=>{s.unobserve(r)}},Ci={passive:!0},Si=typeof window>"u"?!0:"onscrollend"in window,Af=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let o=0;const s=e.options.useScrollendEvent&&Si?()=>{}:Ef(n,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=f=>()=>{const{horizontal:p,isRtl:h}=e.options;o=p?r.scrollLeft*(h&&-1||1):r.scrollTop,s(),t(o,f)},c=i(!0),l=i(!1);l(),r.addEventListener("scroll",c,Ci);const u=e.options.useScrollendEvent&&Si;return u&&r.addEventListener("scrollend",l,Ci),()=>{r.removeEventListener("scroll",c),u&&r.removeEventListener("scrollend",l)}},Nf=(e,t,r)=>{if(t?.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},If=(e,{adjustments:t=0,behavior:r},n)=>{var o,s;const i=e+t;(s=(o=n.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[n.options.horizontal?"left":"top"]:i,behavior:r})};class Mf{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let r=null;const n=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(o=>{o.forEach(s=>{const i=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=n())==null||o.disconnect(),r=null},observe:o=>{var s;return(s=n())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=n())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([n,o])=>{typeof o>"u"&&delete r[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Cf,rangeExtractor:Sf,onChange:()=>{},measureElement:Nf,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var n,o;(o=(n=this.options).onChange)==null||o.call(n,this,r)},this.maybeNotify=Ar(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,n)=>{const o=new Map,s=new Map;for(let i=n-1;i>=0;i--){const c=r[i];if(o.has(c.lane))continue;const l=s.get(c.lane);if(l==null||c.end>l.end?s.set(c.lane,c):c.end<l.end&&o.set(c.lane,!0),o.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=Ar(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(r,n,o,s,i)=>(this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:n,scrollMargin:o,getItemKey:s,enabled:i}),{key:!1}),this.getMeasurements=Ar(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:n,scrollMargin:o,getItemKey:s,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let f=l;f<r;f++){const p=s(f),h=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),d=h?h.end+this.options.gap:n+o,v=c.get(p),g=typeof v=="number"?v:this.options.estimateSize(f),b=d+g,w=h?h.lane:f%this.options.lanes;u[f]={index:f,start:d,size:g,end:b,key:p,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ar(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,n,o,s)=>this.range=r.length>0&&n>0?Ff({measurements:r,outerSize:n,scrollOffset:o,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Ar(()=>{let r=null,n=null;const o=this.calculateRange();return o&&(r=o.startIndex,n=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,n]},(r,n,o,s,i)=>s===null||i===null?[]:r({startIndex:s,endIndex:i,overscan:n,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=r=>{const n=this.options.indexAttribute,o=r.getAttribute(n);return o?parseInt(o,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(r,n)=>{const o=this.indexFromElement(r),s=this.measurementsCache[o];if(!s)return;const i=s.key,c=this.elementsCache.get(i);c!==r&&(c&&this.observer.unobserve(c),this.observer.observe(r),this.elementsCache.set(i,r)),r.isConnected&&this.resizeItem(o,this.options.measureElement(r,n,this))},this.resizeItem=(r,n)=>{const o=this.measurementsCache[r];if(!o)return;const s=this.itemSizeCache.get(o.key)??o.size,i=n-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.measureElement=r=>{if(!r){this.elementsCache.forEach((n,o)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(o))});return}this._measureElement(r,void 0)},this.getVirtualItems=Ar(()=>[this.getVirtualIndexes(),this.getMeasurements()],(r,n)=>{const o=[];for(let s=0,i=r.length;s<i;s++){const c=r[s],l=n[c];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const n=this.getMeasurements();if(n.length!==0)return ki(n[Ti(0,n.length-1,o=>ki(n[o]).start,r)])},this.getOffsetForAlignment=(r,n,o=0)=>{const s=this.getSize(),i=this.getScrollOffset();n==="auto"&&(n=r>=i+s?"end":"start"),n==="center"?r+=(o-s)/2:n==="end"&&(r-=s);const c=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(c,r),0)},this.getOffsetForIndex=(r,n="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const o=this.measurementsCache[r];if(!o)return;const s=this.getSize(),i=this.getScrollOffset();if(n==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)n="end";else if(o.start<=i+this.options.scrollPaddingStart)n="start";else return[i,n];const c=n==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,n,o.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(r,{align:n="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(r,n),{adjustments:void 0,behavior:o})},this.scrollToIndex=(r,{align:n="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),r=Math.max(0,Math.min(r,this.options.count-1));let s=0;const i=10,c=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(r,u);if(!f){console.warn("Failed to get offset for index:",r);return}const[p,h]=f;this._scrollToOffset(p,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const d=this.getScrollOffset(),v=this.getOffsetForIndex(r,h);if(!v){console.warn("Failed to get offset for index:",r);return}kf(v[0],d)||l(h)})},l=u=>{this.targetWindow&&(s++,s<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,i),this.targetWindow.requestAnimationFrame(()=>c(u))):console.warn(`Failed to scroll to index ${r} after ${i} attempts.`))};c(n)},this.scrollBy=(r,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+r,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var r;const n=this.getMeasurements();let o;if(n.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((r=n[n.length-1])==null?void 0:r.end)??0;else{const s=Array(this.options.lanes).fill(null);let i=n.length-1;for(;i>=0&&s.some(c=>c===null);){const c=n[i];s[c.lane]===null&&(s[c.lane]=c.end),i--}o=Math.max(...s.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:n,behavior:o})=>{this.options.scrollToFn(r,{behavior:o,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Ti=(e,t,r,n)=>{for(;e<=t;){const o=(e+t)/2|0,s=r(o);if(s<n)e=o+1;else if(s>n)t=o-1;else return o}return e>0?e-1:0};function Ff({measurements:e,outerSize:t,scrollOffset:r,lanes:n}){const o=e.length-1,s=l=>e[l].start;if(e.length<=n)return{startIndex:0,endIndex:o};let i=Ti(0,o,s,r),c=i;if(n===1)for(;c<o&&e[c].end<r+t;)c++;else if(n>1){const l=Array(n).fill(0);for(;c<o&&l.some(f=>f<r+t);){const f=e[c];l[f.lane]=f.end,c++}const u=Array(n).fill(r+t);for(;i>=0&&u.some(f=>f>=r);){const f=e[i];u[f.lane]=f.start,i--}i=Math.max(0,i-i%n),c=Math.min(o,c+(n-1-c%n))}return{startIndex:i,endIndex:c}}const Ai=typeof document<"u"?z.useLayoutEffect:z.useEffect;function Of(e){const t=z.useReducer(()=>({}),{})[1],r={...e,onChange:(o,s)=>{var i;s?$r.flushSync(t):t(),(i=e.onChange)==null||i.call(e,o,s)}},[n]=z.useState(()=>new Mf(r));return n.setOptions(r),Ai(()=>n._didMount(),[]),Ai(()=>n._willUpdate()),n}function $f(e){return Of({observeElementRect:Tf,observeElementOffset:Af,scrollToFn:If,...e})}const Ja=320,Ni=100,Df=200,Lf=5;function Pf({estaAbierto:e,setEstaAbierto:t,estaDeshabilitado:r,isReadOnly:n,isVirtualized:o,disableAnimation:s,estimatedOptionHeight:i,habilitarBusqueda:c,listaPlana:l,indicesDeshabilitados:u,obtenerLabel:f,verificarSeleccionada:p,refLista:h,refContenedorLista:d,refInputBusqueda:v,onOpen:g,onClose:b,alAbrir:w}){const[m,y]=_.useState("bottom-start"),[k,T]=_.useState(null),C=o&&l.length>Ni,{refs:S,floatingStyles:M,context:D,placement:O}=Hn({open:e,onOpenChange:B=>{r||n||(B&&y("bottom-start"),t(B),B?(g?.(),w?.(),T(null)):b?.())},strategy:"fixed",transform:!1,placement:m,middleware:[Mn(4),On({padding:8}),Fn({padding:8}),Hs({apply({rects:B,elements:q,availableHeight:X}){Object.assign(q.floating.style,{minWidth:`${B.reference.width}px`,width:"max-content",maxWidth:`min(${Math.max(B.reference.width,280)}px, calc(100vw - 16px))`,maxHeight:`${X}px`})},padding:8})],whileElementsMounted:An});_.useLayoutEffect(()=>{if(!e)return;const B=O.startsWith("top")?"top-start":"bottom-start";y(q=>q===B?q:B)},[e,O]);const H=m.startsWith("top"),V=s||l.length>Df?0:300,{isMounted:N,styles:x}=Rn(D,{duration:{open:V,close:Math.round(V*.5)},initial:{opacity:0,transform:H?"translateY(6px) scale(0.96)":"translateY(-6px) scale(0.96)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:H?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)"},common:{transformOrigin:H?"bottom center":"top center"}}),A=$f({count:l.length,getScrollElement:()=>d.current,estimateSize:()=>i,overscan:Lf,enabled:o&&e&&l.length>Ni}),$=fi(D,{enabled:!r&&!n}),F=jn(D),E=qn(D,{role:"listbox"}),I=Xa(D,{listRef:h,activeIndex:k,onNavigate:T,loop:!0,virtual:o,focusItemOnHover:!c,disabledIndices:u}),L=_.useRef([]);_.useEffect(()=>{L.current=l.map(B=>B.tipo==="opcion"&&B.datos?f(B.datos):null)},[l,f]);const R=vi(D,{listRef:L,activeIndex:k,onMatch:e?T:void 0,enabled:!c}),{getReferenceProps:j,getFloatingProps:P,getItemProps:U}=Un([$,F,E,I,R]);return _.useEffect(()=>{e&&c&&requestAnimationFrame(()=>v.current?.focus())},[e,c,v]),_.useEffect(()=>{if(!e)return;const B=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",B>0&&(document.body.style.paddingRight=`${B}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e]),_.useEffect(()=>()=>{h.current=[]},[l.length,h]),_.useEffect(()=>{if(!e)return;const B=l.findIndex(q=>q.tipo==="opcion"&&q.datos!=null&&p(q.datos));B!==-1&&requestAnimationFrame(()=>{C?A.scrollToIndex(B,{align:"center"}):h.current[B]?.scrollIntoView({block:"nearest"})})},[e]),{refs:S,context:D,floatingStyles:M,estilosTransicion:x,estaMontado:N,indiceActivo:k,setIndiceActivo:T,virtualizador:A,usaVirtualizacion:C,getReferenceProps:j,getFloatingProps:P,getItemProps:U}}function zf({value:e,defaultValue:t,isMultiple:r,optionValueKey:n,obtenerValor:o,onChange:s,onValueChange:i,onClear:c,cerrarDropdown:l,refTrigger:u}){const f=e!==void 0,[p,h]=_.useState(t??null),d=f?e:p,v=_.useMemo(()=>{const T=new Set;if(!d)return T;try{if(r&&Array.isArray(d))for(const C of d)T.add(qr(C,n));else T.add(qr(d,n))}catch{}return T},[d,r,n]),g=_.useCallback(T=>{try{return v.has(qr(T,n))}catch{return!1}},[v,n]),b=r?Array.isArray(d)&&d.length>0:d!=null&&d!=="",w=_.useCallback(T=>{f||h(T),s?.(T),i?.(T)},[f,s,i]),m=_.useCallback(T=>{if(!Kn(T))if(r){const C=Array.isArray(d)?d:[],S=C.some(M=>o(M)===o(T));w(S?C.filter(M=>o(M)!==o(T)):[...C,T])}else w(T),l()},[r,d,o,w,l]),y=_.useCallback(T=>{T.stopPropagation(),w(r?[]:null),c?.(),u.current?.focus()},[r,w,c,u]),k=_.useCallback((T,C)=>{C.stopPropagation(),!(!r||!Array.isArray(d))&&w(d.filter(S=>o(S)!==o(T)))},[r,d,o,w]);return{valorActual:d,tieneValor:b,verificarSeleccionada:g,actualizarValor:w,manejarSeleccion:m,manejarLimpiar:y,manejarRemoverChip:k}}const Ii=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),Mi=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Bf=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"M20 6 9 17l-5-5"})}),Vf=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...t,children:[a.jsx("path",{fill:"currentColor",d:"M10 18a7.95 7.95 0 0 0 4.897-1.688l4.396 4.396l1.414-1.414l-4.396-4.396A7.95 7.95 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8s3.589 8 8 8m0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6s-6-2.691-6-6s2.691-6 6-6"}),a.jsx("path",{fill:"currentColor",d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.98 3.98 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002"})]}),jf=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),le={contenedor_base:"_contenedor_base_1h7dd_1",tam_sm:"_tam_sm_1h7dd_43",tam_lg:"_tam_lg_1h7dd_57",radio_none:"_radio_none_1h7dd_71",radio_sm:"_radio_sm_1h7dd_79",radio_md:"_radio_md_1h7dd_87",radio_lg:"_radio_lg_1h7dd_95",radio_full:"_radio_full_1h7dd_103",color_default:"_color_default_1h7dd_111",color_primary:"_color_primary_1h7dd_113",color_secondary:"_color_secondary_1h7dd_121",color_success:"_color_success_1h7dd_129",color_warning:"_color_warning_1h7dd_137",color_danger:"_color_danger_1h7dd_145",etiqueta:"_etiqueta_1h7dd_153",marca_requerido:"_marca_requerido_1h7dd_169",trigger:"_trigger_1h7dd_179",trigger_expandido:"_trigger_expandido_1h7dd_215",variante_bordered:"_variante_bordered_1h7dd_225",variante_faded:"_variante_faded_1h7dd_235",variante_underlined:"_variante_underlined_1h7dd_245",variante_ghost:"_variante_ghost_1h7dd_261",deshabilitado:"_deshabilitado_1h7dd_273",solo_lectura:"_solo_lectura_1h7dd_293",valor_texto:"_valor_texto_1h7dd_309",abierto:"_abierto_1h7dd_337",valido:"_valido_1h7dd_345",invalido:"_invalido_1h7dd_353",contenido_inicio:"_contenido_inicio_1h7dd_405",contenido_final:"_contenido_final_1h7dd_407",valor_wrapper:"_valor_wrapper_1h7dd_425",mostrar_todos:"_mostrar_todos_1h7dd_445",valor_wrapper_expandido:"_valor_wrapper_expandido_1h7dd_455",placeholder:"_placeholder_1h7dd_471",chip_multi:"_chip_multi_1h7dd_481",chip_texto:"_chip_texto_1h7dd_515",chip_cerrar:"_chip_cerrar_1h7dd_527",contador_multi:"_contador_multi_1h7dd_567",acciones:"_acciones_1h7dd_581",boton_limpiar:"_boton_limpiar_1h7dd_595",tiene_valor:"_tiene_valor_1h7dd_647",icono_chevron:"_icono_chevron_1h7dd_657",icono_spinner:"_icono_spinner_1h7dd_679",girarSpinner:"_girarSpinner_1h7dd_1",menu:"_menu_1h7dd_713",buscador_wrapper:"_buscador_wrapper_1h7dd_749",buscador_interno:"_buscador_interno_1h7dd_763",icono_buscar:"_icono_buscar_1h7dd_809",input_busqueda:"_input_busqueda_1h7dd_841",lista_opciones:"_lista_opciones_1h7dd_885",lista_virtual:"_lista_virtual_1h7dd_969",contenedor_virtual:"_contenedor_virtual_1h7dd_981",encabezado_grupo:"_encabezado_grupo_1h7dd_989",opcion_virtual:"_opcion_virtual_1h7dd_1021",opcion:"_opcion_1h7dd_1021",activo:"_activo_1h7dd_1065",seleccionado:"_seleccionado_1h7dd_1081",opcion_check:"_opcion_check_1h7dd_1139",opcion_contenido:"_opcion_contenido_1h7dd_1167",sin_resultados:"_sin_resultados_1h7dd_1183",descripcion:"_descripcion_1h7dd_1207",mensaje_error:"_mensaje_error_1h7dd_1219",ancho_total:"_ancho_total_1h7dd_1231",sin_animacion:"_sin_animacion_1h7dd_1239",contenedor_nativo:"_contenedor_nativo_1h7dd_1249",select_nativo:"_select_nativo_1h7dd_1257",input_validacion:"_input_validacion_1h7dd_1285"};function Hf(e){const{options:t=[],value:r,onChange:n,onValueChange:o,optionLabelKey:s="label",optionValueKey:i="id",label:c,placeholder:l="Seleccione una opción",description:u,errorMessage:f,isRequired:p=!1,isInvalid:h,id:d,name:v,"data-testid":g,classNames:b,startContent:w,endContent:m,esInvalido:y,estaDeshabilitadoReal:k,clasesBase:T,renderizarValorMostrado:C}=e,S=_.useId(),M=d??`select-nativo-${S}`,D=u&&!y?`${M}-desc`:void 0,O=y?`${M}-err`:void 0,H=_.useCallback(E=>Za(E,s),[s]),V=_.useCallback(E=>qr(E,i),[i]),N=_.useCallback(E=>{n?.(E),o?.(E)},[n,o]),x=_.useCallback(E=>{const I=E.target.value;if(!I){N(null);return}const L=t.find(R=>V(R)===I);L&&N(L)},[t,V,N]),A=typeof h=="string"?h:null,$=typeof f=="function"?f({invalido:y,mensaje:A}):f??A,F=[D,$?O:void 0].filter(Boolean).join(" ")||void 0;return a.jsxs("div",{className:T,children:[c&&a.jsxs("label",{className:te(le.etiqueta,b?.label),htmlFor:M,children:[c,p&&a.jsx("span",{className:le.marca_requerido,children:"*"})]}),a.jsxs("div",{className:le.contenedor_nativo,children:[a.jsxs("div",{className:te(le.trigger,b?.trigger),children:[w&&a.jsx("span",{className:le.contenido_inicio,children:w}),a.jsx("div",{className:te(le.valor_wrapper,b?.value),children:C()}),a.jsxs("div",{className:le.acciones,children:[m&&a.jsx("span",{className:le.contenido_final,children:m}),a.jsx("span",{className:le.icono_chevron,children:a.jsx(Ii,{size:"1em"})})]})]}),a.jsxs("select",{id:M,name:v,"data-testid":g??(v?`select-${v}`:M),className:le.select_nativo,value:r?V(r):"",onChange:x,disabled:k,required:p,"aria-describedby":F,"aria-invalid":y||void 0,"aria-required":p||void 0,children:[a.jsx("option",{value:"",children:l}),t.map(E=>a.jsx("option",{value:V(E),disabled:Kn(E),children:H(E)},V(E)))]})]}),u&&!y&&a.jsx("div",{id:D,className:te(le.descripcion,b?.description),children:u}),y&&$&&a.jsx("div",{id:O,className:te(le.mensaje_error,b?.errorMessage),role:"alert",children:$})]})}const Uf="(max-width: 768px)",Wf=44;function Gf(e,t){const{options:r=[],value:n,defaultValue:o,onChange:s,onValueChange:i,optionLabelKey:c="label",optionValueKey:l="id",renderOption:u,renderValue:f,variant:p="bordered",color:h="default",size:d="md",radius:v="md",fullWidth:g=!0,disableAnimation:b=!1,label:w,placeholder:m="",description:y,errorMessage:k,emptyMessage:T="No hay opciones",noResultsMessage:C="Sin resultados",isRequired:S=!1,isDisabled:M=!1,isReadOnly:D=!1,isLoading:O=!1,isClearable:H=!0,isInvalid:V,validationState:N,isMultiple:x=!1,mostrarTodos:A=!1,isSearchable:$,isVirtualized:F=!1,estimatedOptionHeight:E=Wf,filterFn:I,validate:L,onOpen:R,onClose:j,onSearchChange:P,onClear:U,onFocus:B,onBlur:q,id:X,name:Y,"data-testid":Q,className:oe,classNames:se,style:ne,startContent:ie,endContent:ae,menuZIndex:fe,portalContainer:de}=e,Z=_.useRef(null),ue=_.useRef([]),pe=_.useRef(null),he=_.useRef(null),we=_.useId(),W=X??`select-${we}`,ee=Ya(Uf),J=$??(r.length>4&&!ee),ce=ee&&!J&&!x,[ve,ke]=_.useState(!1),[De,at]=_.useState(""),Qe=M||O,Ae=_.useCallback(()=>ke(!1),[]),Xe=_.useCallback(()=>at(""),[]),{obtenerLabel:ot,obtenerValor:Ye,tieneGrupos:st,listaPlana:it,indicesDeshabilitados:Ce}=xf({options:r,optionLabelKey:c,optionValueKey:l,valorBusqueda:De,habilitarBusqueda:J,filterFn:I}),{valorActual:Me,tieneValor:Ne,verificarSeleccionada:Et,actualizarValor:Fe,manejarSeleccion:ft,manejarLimpiar:lr,manejarRemoverChip:Kt}=zf({value:n,defaultValue:o,isMultiple:x,optionValueKey:l,obtenerValor:Ye,onChange:s,onValueChange:i,onClear:U,cerrarDropdown:Ae,refTrigger:Z}),{refs:Ee,context:ze,floatingStyles:xt,estilosTransicion:Ze,estaMontado:Ct,indiceActivo:It,setIndiceActivo:sa,virtualizador:ia,usaVirtualizacion:an,getReferenceProps:qe,getFloatingProps:Ie,getItemProps:Xt}=Pf({estaAbierto:ve,setEstaAbierto:ke,estaDeshabilitado:Qe,isReadOnly:D,isVirtualized:F,disableAnimation:b,estimatedOptionHeight:E,habilitarBusqueda:J,listaPlana:it,indicesDeshabilitados:Ce,obtenerLabel:ot,verificarSeleccionada:Et,refLista:ue,refContenedorLista:pe,refInputBusqueda:he,onOpen:R,onClose:j,alAbrir:Xe}),Mt=_.useMemo(()=>mf(Me,L),[Me,L]),St=_.useMemo(()=>bf(V,N,Mt),[V,N,Mt]),on=N==="valid"&&!St,sn=_.useCallback(Re=>{const mt=Re.target.value;at(mt),P?.(mt),sa(0)},[P,sa]),cn=_.useCallback(Re=>{if(Re.key==="Enter"&&It!==null){Re.preventDefault();const mt=it[It];mt?.tipo==="opcion"&&mt.datos&&ft(mt.datos)}},[It,it,ft]);_.useImperativeHandle(t,()=>({focus:()=>Z.current?.focus(),blur:()=>Z.current?.blur(),open:()=>ke(!0),close:()=>ke(!1),clear:()=>Fe(x?[]:null)}));const ln=_.useCallback(()=>{if(f)return f(Me??null);if(!Ne)return a.jsx("span",{className:le.placeholder,children:m});if(x&&Array.isArray(Me)){if(Me.length===0)return a.jsx("span",{className:le.placeholder,children:m});const Re=A?Me:Me.slice(0,2),mt=A?0:Math.max(0,Me.length-2);return a.jsxs(a.Fragment,{children:[Re.map(Or=>a.jsxs("span",{className:le.chip_multi,children:[a.jsx("span",{className:le.chip_texto,children:ot(Or)}),!D&&!Qe&&a.jsx("button",{type:"button",className:le.chip_cerrar,onClick:$t=>Kt(Or,$t),children:a.jsx(Mi,{size:"1em"})})]},Ye(Or))),mt>0&&a.jsxs("span",{className:le.contador_multi,children:["+",mt]})]})}return a.jsx("span",{className:le.valor_texto,children:ot(Me)})},[f,Me,Ne,m,x,A,D,Qe,Ye,ot,Kt]),dn=_.useCallback((Re,mt,Or)=>{try{if(Re.tipo==="grupo")return a.jsx("li",{className:te(le.encabezado_grupo,F&&le.opcion_virtual),style:Or,children:Re.nombreGrupo},`grupo-${Re.nombreGrupo}`);const $t=Re.datos;if(!$t)return null;const xl=Et($t),kl=It===mt,Ep=Kn($t),Cp=u?u($t,{isSelected:xl,isActive:kl}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:le.opcion_check,children:a.jsx(Bf,{size:"1em"})}),a.jsx("span",{className:le.opcion_contenido,children:ot($t)})]}),Sp=Ye($t);return a.jsx("li",{ref:Tp=>{ue.current[mt]=Tp},className:te(le.opcion,F&&le.opcion_virtual,{[le.activo]:kl,[le.seleccionado]:xl,[le.deshabilitado]:Ep},se?.option),style:Or,...Xt({onClick:()=>ft($t)}),children:Cp},Sp)}catch($t){return console.error("Error rendering select item:",$t),null}},[F,It,Et,u,ot,Ye,se?.option,Xt,ft]),Vo=typeof k=="function"?k({invalido:St,mensaje:Mt}):k??Mt,bl=y&&!St?`${W}-desc`:void 0,wl=St&&Vo?`${W}-err`:void 0,kp=[bl,wl].filter(Boolean).join(" ")||void 0,yl=te(le.contenedor_base,le[`variante_${p}`],le[`tam_${d}`],le[`radio_${v}`],le[`color_${h}`],{[le.ancho_total]:g,[le.sin_animacion]:b,[le.deshabilitado]:Qe,[le.solo_lectura]:D,[le.invalido]:St,[le.valido]:on,[le.abierto]:ve,[le.tiene_valor]:Ne},se?.base,oe);return ce&&!st?a.jsx(Hf,{...e,value:Me,onChange:Fe,onValueChange:void 0,esInvalido:St,estaDeshabilitadoReal:Qe,clasesBase:yl,renderizarValorMostrado:ln}):a.jsxs("div",{className:yl,style:ne,children:[w&&a.jsxs("label",{id:`${W}-label`,className:te(le.etiqueta,se?.label),children:[w,S&&a.jsx("span",{className:le.marca_requerido,children:"*"})]}),a.jsxs("div",{ref:Re=>{Ee.setReference(Re),Z.current=Re},id:W,tabIndex:Qe?-1:0,className:te(le.trigger,A&&x&&le.trigger_expandido,se?.trigger),"data-testid":Q??(Y?`select-${Y}`:W),"aria-labelledby":w?`${W}-label`:void 0,"aria-describedby":kp,"aria-invalid":St||void 0,"aria-required":S||void 0,"aria-disabled":Qe||void 0,onFocus:B,onBlur:q,...qe(),children:[ie&&a.jsx("span",{className:le.contenido_inicio,children:ie}),a.jsx("div",{className:te(le.valor_wrapper,A&&x&&le.mostrar_todos,A&&x&&le.valor_wrapper_expandido,se?.value),children:ln()}),a.jsxs("div",{className:le.acciones,children:[H&&Ne&&!D&&!Qe&&a.jsx("button",{type:"button",className:te(le.boton_limpiar,se?.clearButton),onClick:lr,tabIndex:-1,children:a.jsx(Mi,{size:"1em"})}),ae&&a.jsx("span",{className:le.contenido_final,children:ae}),O?a.jsx("span",{className:le.icono_spinner,children:a.jsx(jf,{size:"1em"})}):a.jsx("span",{className:le.icono_chevron,children:a.jsx(Ii,{size:"1em"})})]})]}),(Y||S)&&a.jsx("input",{type:"text",name:Y,required:S,value:x&&Array.isArray(Me)?Me.map(Ye).join(","):Me?Ye(Me):"",onChange:()=>{},onFocus:Re=>Re.target.blur(),"aria-hidden":"true",tabIndex:-1,className:le.input_validacion}),Ct&&a.jsx(Vn,{root:de,children:a.jsx(Ga,{context:ze,modal:!1,initialFocus:J?he:-1,children:a.jsxs("div",{ref:Ee.setFloating,style:{...xt,...Ze,zIndex:fe??"var(--z-popover)",transitionTimingFunction:ze.open?"cubic-bezier(0.32, 0.72, 0, 1)":"cubic-bezier(0.4, 0, 1, 1)"},className:te(le.menu,se?.menu),...Ie(),children:[J&&a.jsx("div",{className:le.buscador_wrapper,children:a.jsxs("div",{className:le.buscador_interno,children:[a.jsx("span",{className:le.icono_buscar,children:a.jsx(Vf,{size:"1.6em"})}),a.jsx("input",{ref:he,type:"text",className:te(le.input_busqueda,se?.searchInput),placeholder:"Buscar...",value:De,onChange:sn,onKeyDown:cn})]})}),a.jsx("ul",{ref:pe,className:te(le.lista_opciones,F&&le.lista_virtual),style:{height:an?`${Ja}px`:`${Math.min(it.length*E,Ja)}px`,maxHeight:`${Ja}px`,overflow:"auto",position:an?"relative":void 0},children:it.length===0?a.jsx("li",{className:le.sin_resultados,children:De?C:T}):an?a.jsx(a.Fragment,{children:a.jsx("div",{style:{height:`${ia.getTotalSize()}px`,position:"relative",width:"100%"},children:ia.getVirtualItems().map(Re=>{const mt=it[Re.index];return mt?a.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${Re.size}px`,transform:`translateY(${Re.start}px)`},children:dn(mt,Re.index)},`virtual-${Re.index}`):null})})}):it.map((Re,mt)=>dn(Re,mt))})]})})}),y&&!St&&a.jsx("div",{id:bl,className:te(le.descripcion,se?.description),children:y}),St&&Vo&&a.jsx("div",{id:wl,className:te(le.mensaje_error,se?.errorMessage),role:"alert",children:Vo})]})}const qf=_.forwardRef(Gf),Fi=_.memo(qf);Fi.displayName="SelectBase";function Rf(e,t){const{options:r=[],value:n,onChange:o,onValueChange:s,optionValueKey:i,optionLabelKey:c="label",isMultiple:l=!1,devolverObjeto:u=!1,...f}=e,p=_.useMemo(()=>r.length>0&&typeof r[0]=="object",[r]),h=_.useMemo(()=>{if(!p||!i)return null;const g=new Map;for(const b of r)g.set(String(b[i]),b);return g},[r,i,p]),d=_.useMemo(()=>{if(n==null||!p||u)return n;const g=b=>h?.get(String(b));return l&&Array.isArray(n)?n.map(g).filter(b=>b!==void 0):g(n)??null},[n,h,l,u,p]),v=_.useCallback(g=>{const b=o||s;if(!b)return;if(g===null){b(l?[]:u||!p?null:"");return}if(u||!p){b(g);return}const w=m=>typeof m=="string"?m:m[i];b(l&&Array.isArray(g)?g.map(w):w(g))},[o,s,u,l,i,p]);return a.jsx(Fi,{...f,ref:t,options:r,value:d,onChange:v,optionValueKey:i,optionLabelKey:c,isMultiple:l})}const Oi=_.forwardRef(Rf);Oi.displayName="Select";const Rr={tooltip:"_tooltip_aqvwg_1",tooltip_positioner:"_tooltip_positioner_aqvwg_53",enterAnimation:"_enterAnimation_aqvwg_1",exitAnimation:"_exitAnimation_aqvwg_1",arrow:"_arrow_aqvwg_81",size_sm:"_size_sm_aqvwg_91",size_md:"_size_md_aqvwg_101",size_lg:"_size_lg_aqvwg_111",variant_default:"_variant_default_aqvwg_121",variant_dark:"_variant_dark_aqvwg_141",variant_light:"_variant_light_aqvwg_153",variant_brand:"_variant_brand_aqvwg_165",variant_success:"_variant_success_aqvwg_181",variant_warning:"_variant_warning_aqvwg_193",variant_danger:"_variant_danger_aqvwg_205",variant_info:"_variant_info_aqvwg_217",fadeOnly:"_fadeOnly_aqvwg_1"},Kf=Number.parseInt(_.version,10)>=19;function $i(e){return Kf?e.props.ref??null:e.ref??null}function tr({content:e,children:t,placement:r="top",variant:n="default",size:o="md",offset:s=8,delayShow:i=100,delayHide:c=0,isDisabled:l=!1,showArrow:u=!1,maxWidth:f="320px",isInteractive:p=!1,className:h="",onOpen:d,onClose:v,isOpen:g,onOpenChange:b}){const[w,m]=_.useState(!1),y=_.useRef(null),k=g!==void 0?g:w,T=_.useCallback(R=>{l||(b?b(R):m(R),R?d?.():v?.())},[l,b,d,v]),{refs:C,floatingStyles:S,context:M,isPositioned:D}=Hn({open:k,onOpenChange:T,placement:r,strategy:"fixed",middleware:[Mn(s+(u?8:0)),On({fallbackAxisSideDirection:"start",padding:8}),Fn({padding:8}),u?zu({element:y}):void 0].filter(Boolean),whileElementsMounted:An}),O=ja(M,{delay:{open:i,close:p?200:c||100},enabled:!l,move:!1,handleClose:null}),H=sf(M,{enabled:!l}),V=jn(M,{enabled:!l}),N=qn(M,{role:"tooltip"}),{getReferenceProps:x,getFloatingProps:A}=Un([O,H,V,N]),{isMounted:$,styles:F}=Rn(M,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),E=_.useMemo(()=>[Rr.tooltip,Rr[`size_${o}`],Rr[`variant_${n}`],h].filter(Boolean).join(" "),[o,n,h]),I=za([C.setReference,$i(t)]),L=_.useMemo(()=>_.cloneElement(t,x({...t.props,ref:I})),[t,x,I]);return!e||l?t:a.jsxs(a.Fragment,{children:[L,$&&a.jsx(Vn,{children:a.jsx("div",{ref:C.setFloating,className:Rr.tooltip_positioner,style:{...S,maxWidth:f,zIndex:9999,pointerEvents:"none"},children:a.jsxs("div",{className:E,style:{...F,pointerEvents:p?"auto":"none",visibility:D||!k?"visible":"hidden"},...A(),children:[e,u&&a.jsx(Wu,{ref:y,context:M,className:Rr.arrow})]})})})]})}/**
7
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,r?.key)}return(d=r?.onChange)==null||d.call(r,o),o}return s.updateDeps=i=>{a=i},s}function ji(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const qf=(e,t)=>Math.abs(e-t)<1.01,Gf=(e,t,r)=>{let a;return function(...o){e.clearTimeout(a),a=e.setTimeout(()=>t.apply(this,o),r)}},Hi=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Rf=e=>e,Xf=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),a=[];for(let o=t;o<=r;o++)a.push(o);return a},Kf=(e,t)=>{const r=e.scrollElement;if(!r)return;const a=e.targetWindow;if(!a)return;const o=i=>{const{width:c,height:l}=i;t({width:Math.round(c),height:Math.round(l)})};if(o(Hi(r)),!a.ResizeObserver)return()=>{};const s=new a.ResizeObserver(i=>{const c=()=>{const l=i[0];if(l?.borderBoxSize){const d=l.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(Hi(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return s.observe(r,{box:"border-box"}),()=>{s.unobserve(r)}},Ui={passive:!0},Wi=typeof window>"u"?!0:"onscrollend"in window,Yf=(e,t)=>{const r=e.scrollElement;if(!r)return;const a=e.targetWindow;if(!a)return;let o=0;const s=e.options.useScrollendEvent&&Wi?()=>{}:Gf(a,()=>{t(o,!1)},e.options.isScrollingResetDelay),i=h=>()=>{const{horizontal:g,isRtl:f}=e.options;o=g?r.scrollLeft*(f&&-1||1):r.scrollTop,s(),t(o,h)},c=i(!0),l=i(!1);l(),r.addEventListener("scroll",c,Ui);const d=e.options.useScrollendEvent&&Wi;return d&&r.addEventListener("scrollend",l,Ui),()=>{r.removeEventListener("scroll",c),d&&r.removeEventListener("scrollend",l)}},Zf=(e,t,r)=>{if(t?.borderBoxSize){const a=t.borderBoxSize[0];if(a)return Math.round(a[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Jf=(e,{adjustments:t=0,behavior:r},a)=>{var o,s;const i=e+t;(s=(o=a.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[a.options.horizontal?"left":"top"]:i,behavior:r})};class Qf{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let r=null;const a=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(o=>{o.forEach(s=>{const i=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=a())==null||o.disconnect(),r=null},observe:o=>{var s;return(s=a())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=a())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([a,o])=>{typeof o>"u"&&delete r[a]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rf,rangeExtractor:Xf,onChange:()=>{},measureElement:Zf,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var a,o;(o=(a=this.options).onChange)==null||o.call(a,this,r)},this.maybeNotify=jr(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const a=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==a){if(this.cleanup(),!a){this.maybeNotify();return}this.scrollElement=a,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,a)=>{const o=new Map,s=new Map;for(let i=a-1;i>=0;i--){const c=r[i];if(o.has(c.lane))continue;const l=s.get(c.lane);if(l==null||c.end>l.end?s.set(c.lane,c):c.end<l.end&&o.set(c.lane,!0),o.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=jr(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(r,a,o,s,i)=>(this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:a,scrollMargin:o,getItemKey:s,enabled:i}),{key:!1}),this.getMeasurements=jr(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:a,scrollMargin:o,getItemKey:s,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,l);for(let h=l;h<r;h++){const g=s(h),f=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h),u=f?f.end+this.options.gap:a+o,v=c.get(g),p=typeof v=="number"?v:this.options.estimateSize(h),m=u+p,w=f?f.lane:h%this.options.lanes;d[h]={index:h,start:u,size:p,end:m,key:g,lane:w}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=jr(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,a,o,s)=>this.range=r.length>0&&a>0?e1({measurements:r,outerSize:a,scrollOffset:o,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=jr(()=>{let r=null,a=null;const o=this.calculateRange();return o&&(r=o.startIndex,a=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,a]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,a]},(r,a,o,s,i)=>s===null||i===null?[]:r({startIndex:s,endIndex:i,overscan:a,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=r=>{const a=this.options.indexAttribute,o=r.getAttribute(a);return o?parseInt(o,10):(console.warn(`Missing attribute name '${a}={index}' on measured element.`),-1)},this._measureElement=(r,a)=>{const o=this.indexFromElement(r),s=this.measurementsCache[o];if(!s)return;const i=s.key,c=this.elementsCache.get(i);c!==r&&(c&&this.observer.unobserve(c),this.observer.observe(r),this.elementsCache.set(i,r)),r.isConnected&&this.resizeItem(o,this.options.measureElement(r,a,this))},this.resizeItem=(r,a)=>{const o=this.measurementsCache[r];if(!o)return;const s=this.itemSizeCache.get(o.key)??o.size,i=a-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,i,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,a)),this.notify(!1))},this.measureElement=r=>{if(!r){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}this._measureElement(r,void 0)},this.getVirtualItems=jr(()=>[this.getVirtualIndexes(),this.getMeasurements()],(r,a)=>{const o=[];for(let s=0,i=r.length;s<i;s++){const c=r[s],l=a[c];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const a=this.getMeasurements();if(a.length!==0)return ji(a[qi(0,a.length-1,o=>ji(a[o]).start,r)])},this.getOffsetForAlignment=(r,a,o=0)=>{const s=this.getSize(),i=this.getScrollOffset();a==="auto"&&(a=r>=i+s?"end":"start"),a==="center"?r+=(o-s)/2:a==="end"&&(r-=s);const c=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(c,r),0)},this.getOffsetForIndex=(r,a="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const o=this.measurementsCache[r];if(!o)return;const s=this.getSize(),i=this.getScrollOffset();if(a==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)a="end";else if(o.start<=i+this.options.scrollPaddingStart)a="start";else return[i,a];const c=a==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,a,o.size),a]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(r,{align:a="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(r,a),{adjustments:void 0,behavior:o})},this.scrollToIndex=(r,{align:a="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),r=Math.max(0,Math.min(r,this.options.count-1));let s=0;const i=10,c=d=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(r,d);if(!h){console.warn("Failed to get offset for index:",r);return}const[g,f]=h;this._scrollToOffset(g,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const u=this.getScrollOffset(),v=this.getOffsetForIndex(r,f);if(!v){console.warn("Failed to get offset for index:",r);return}qf(v[0],u)||l(f)})},l=d=>{this.targetWindow&&(s++,s<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,i),this.targetWindow.requestAnimationFrame(()=>c(d))):console.warn(`Failed to scroll to index ${r} after ${i} attempts.`))};c(a)},this.scrollBy=(r,{behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+r,{adjustments:void 0,behavior:a})},this.getTotalSize=()=>{var r;const a=this.getMeasurements();let o;if(a.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((r=a[a.length-1])==null?void 0:r.end)??0;else{const s=Array(this.options.lanes).fill(null);let i=a.length-1;for(;i>=0&&s.some(c=>c===null);){const c=a[i];s[c.lane]===null&&(s[c.lane]=c.end),i--}o=Math.max(...s.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:a,behavior:o})=>{this.options.scrollToFn(r,{behavior:o,adjustments:a},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const qi=(e,t,r,a)=>{for(;e<=t;){const o=(e+t)/2|0,s=r(o);if(s<a)e=o+1;else if(s>a)t=o-1;else return o}return e>0?e-1:0};function e1({measurements:e,outerSize:t,scrollOffset:r,lanes:a}){const o=e.length-1,s=l=>e[l].start;if(e.length<=a)return{startIndex:0,endIndex:o};let i=qi(0,o,s,r),c=i;if(a===1)for(;c<o&&e[c].end<r+t;)c++;else if(a>1){const l=Array(a).fill(0);for(;c<o&&l.some(h=>h<r+t);){const h=e[c];l[h.lane]=h.end,c++}const d=Array(a).fill(r+t);for(;i>=0&&d.some(h=>h>=r);){const h=e[i];d[h.lane]=h.start,i--}i=Math.max(0,i-i%a),c=Math.min(o,c+(a-1-c%a))}return{startIndex:i,endIndex:c}}const Gi=typeof document<"u"?j.useLayoutEffect:j.useEffect;function t1(e){const t=j.useReducer(()=>({}),{})[1],r={...e,onChange:(o,s)=>{var i;s?Kr.flushSync(t):t(),(i=e.onChange)==null||i.call(e,o,s)}},[a]=j.useState(()=>new Qf(r));return a.setOptions(r),Gi(()=>a._didMount(),[]),Gi(()=>a._willUpdate()),a}function r1(e){return t1({observeElementRect:Kf,observeElementOffset:Yf,scrollToFn:Jf,...e})}const po=320,Ri=100,n1=200,a1=5;function o1({estaAbierto:e,setEstaAbierto:t,estaDeshabilitado:r,isReadOnly:a,isVirtualized:o,disableAnimation:s,estimatedOptionHeight:i,habilitarBusqueda:c,listaPlana:l,indicesDeshabilitados:d,obtenerLabel:h,verificarSeleccionada:g,refLista:f,refContenedorLista:u,refInputBusqueda:v,onOpen:p,onClose:m,alAbrir:w}){const[b,y]=_.useState("bottom-start"),[E,S]=_.useState(null),C=o&&l.length>Ri,{refs:T,floatingStyles:F,context:D,placement:M}=ea({open:e,onOpenChange:B=>{r||a||(B&&y("bottom-start"),t(B),B?(p?.(),w?.(),S(null)):m?.())},strategy:"fixed",transform:!1,placement:b,middleware:[Un(4),qn({padding:8}),Wn({padding:8}),si({apply({rects:B,elements:K,availableHeight:Y}){Object.assign(K.floating.style,{minWidth:`${B.reference.width}px`,width:"max-content",maxWidth:`min(${Math.max(B.reference.width,280)}px, calc(100vw - 16px))`,maxHeight:`${Y}px`})},padding:8})],whileElementsMounted:Vn});_.useLayoutEffect(()=>{if(!e)return;const B=M.startsWith("top")?"top-start":"bottom-start";y(K=>K===B?K:B)},[e,M]);const U=b.startsWith("top"),V=s||l.length>n1?0:300,{isMounted:N,styles:k}=oa(D,{duration:{open:V,close:Math.round(V*.5)},initial:{opacity:0,transform:U?"translateY(6px) scale(0.96)":"translateY(-6px) scale(0.96)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:U?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)"},common:{transformOrigin:U?"bottom center":"top center"}}),A=r1({count:l.length,getScrollElement:()=>u.current,estimateSize:()=>i,overscan:a1,enabled:o&&e&&l.length>Ri}),O=Ii(D,{enabled:!r&&!a}),$=Qn(D),x=aa(D,{role:"listbox"}),I=fo(D,{listRef:f,activeIndex:E,onNavigate:S,loop:!0,virtual:o,focusItemOnHover:!c,disabledIndices:d}),L=_.useRef([]);_.useEffect(()=>{L.current=l.map(B=>B.tipo==="opcion"&&B.datos?h(B.datos):null)},[l,h]);const X=Di(D,{listRef:L,activeIndex:E,onMatch:e?S:void 0,enabled:!c}),{getReferenceProps:H,getFloatingProps:z,getItemProps:q}=ta([O,$,x,I,X]);return _.useEffect(()=>{e&&c&&requestAnimationFrame(()=>v.current?.focus())},[e,c,v]),_.useEffect(()=>{if(!e)return;const B=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",B>0&&(document.body.style.paddingRight=`${B}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e]),_.useEffect(()=>()=>{f.current=[]},[l.length,f]),_.useEffect(()=>{if(!e)return;const B=l.findIndex(K=>K.tipo==="opcion"&&K.datos!=null&&g(K.datos));B!==-1&&requestAnimationFrame(()=>{C?A.scrollToIndex(B,{align:"center"}):f.current[B]?.scrollIntoView({block:"nearest"})})},[e]),{refs:T,context:D,floatingStyles:F,estilosTransicion:k,estaMontado:N,indiceActivo:E,setIndiceActivo:S,virtualizador:A,usaVirtualizacion:C,getReferenceProps:H,getFloatingProps:z,getItemProps:q}}function s1({value:e,defaultValue:t,isMultiple:r,optionValueKey:a,obtenerValor:o,onChange:s,onValueChange:i,onClear:c,cerrarDropdown:l,refTrigger:d}){const h=e!==void 0,[g,f]=_.useState(t??null),u=h?e:g,v=_.useMemo(()=>{const S=new Set;if(!u)return S;try{if(r&&Array.isArray(u))for(const C of u)S.add(cn(C,a));else S.add(cn(u,a))}catch{}return S},[u,r,a]),p=_.useCallback(S=>{try{return v.has(cn(S,a))}catch{return!1}},[v,a]),m=r?Array.isArray(u)&&u.length>0:u!=null&&u!=="",w=_.useCallback(S=>{h||f(S),s?.(S),i?.(S)},[h,s,i]),b=_.useCallback(S=>{if(!sa(S))if(r){const C=Array.isArray(u)?u:[],T=C.some(F=>o(F)===o(S));w(T?C.filter(F=>o(F)!==o(S)):[...C,S])}else w(S),l()},[r,u,o,w,l]),y=_.useCallback(S=>{S.stopPropagation(),w(r?[]:null),c?.(),d.current?.focus()},[r,w,c,d]),E=_.useCallback((S,C)=>{C.stopPropagation(),!(!r||!Array.isArray(u))&&w(u.filter(T=>o(T)!==o(S)))},[r,u,o,w]);return{valorActual:u,tieneValor:m,verificarSeleccionada:p,actualizarValor:w,manejarSeleccion:b,manejarLimpiar:y,manejarRemoverChip:E}}const Xi=({size:e="1em",...t})=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:n.jsx("path",{d:"m6 9 6 6 6-6"})}),Ki=({size:e="1em",...t})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]}),i1=({size:e="1em",...t})=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}),c1=({size:e="1em",...t})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...t,children:[n.jsx("path",{fill:"currentColor",d:"M10 18a7.95 7.95 0 0 0 4.897-1.688l4.396 4.396l1.414-1.414l-4.396-4.396A7.95 7.95 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8s3.589 8 8 8m0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6s-6-2.691-6-6s2.691-6 6-6"}),n.jsx("path",{fill:"currentColor",d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.98 3.98 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002"})]}),l1=({size:e="1em",...t})=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:n.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),_e={contenedor_base:"_contenedor_base_1h7dd_1",tam_sm:"_tam_sm_1h7dd_43",tam_lg:"_tam_lg_1h7dd_57",radio_none:"_radio_none_1h7dd_71",radio_sm:"_radio_sm_1h7dd_79",radio_md:"_radio_md_1h7dd_87",radio_lg:"_radio_lg_1h7dd_95",radio_full:"_radio_full_1h7dd_103",color_default:"_color_default_1h7dd_111",color_primary:"_color_primary_1h7dd_113",color_secondary:"_color_secondary_1h7dd_121",color_success:"_color_success_1h7dd_129",color_warning:"_color_warning_1h7dd_137",color_danger:"_color_danger_1h7dd_145",etiqueta:"_etiqueta_1h7dd_153",marca_requerido:"_marca_requerido_1h7dd_169",trigger:"_trigger_1h7dd_179",trigger_expandido:"_trigger_expandido_1h7dd_215",variante_bordered:"_variante_bordered_1h7dd_225",variante_faded:"_variante_faded_1h7dd_235",variante_underlined:"_variante_underlined_1h7dd_245",variante_ghost:"_variante_ghost_1h7dd_261",deshabilitado:"_deshabilitado_1h7dd_273",solo_lectura:"_solo_lectura_1h7dd_293",valor_texto:"_valor_texto_1h7dd_309",abierto:"_abierto_1h7dd_337",valido:"_valido_1h7dd_345",invalido:"_invalido_1h7dd_353",contenido_inicio:"_contenido_inicio_1h7dd_405",contenido_final:"_contenido_final_1h7dd_407",valor_wrapper:"_valor_wrapper_1h7dd_425",mostrar_todos:"_mostrar_todos_1h7dd_445",valor_wrapper_expandido:"_valor_wrapper_expandido_1h7dd_455",placeholder:"_placeholder_1h7dd_471",chip_multi:"_chip_multi_1h7dd_481",chip_texto:"_chip_texto_1h7dd_515",chip_cerrar:"_chip_cerrar_1h7dd_527",contador_multi:"_contador_multi_1h7dd_567",acciones:"_acciones_1h7dd_581",boton_limpiar:"_boton_limpiar_1h7dd_595",tiene_valor:"_tiene_valor_1h7dd_647",icono_chevron:"_icono_chevron_1h7dd_657",icono_spinner:"_icono_spinner_1h7dd_679",girarSpinner:"_girarSpinner_1h7dd_1",menu:"_menu_1h7dd_713",buscador_wrapper:"_buscador_wrapper_1h7dd_749",buscador_interno:"_buscador_interno_1h7dd_763",icono_buscar:"_icono_buscar_1h7dd_809",input_busqueda:"_input_busqueda_1h7dd_841",lista_opciones:"_lista_opciones_1h7dd_885",lista_virtual:"_lista_virtual_1h7dd_969",contenedor_virtual:"_contenedor_virtual_1h7dd_981",encabezado_grupo:"_encabezado_grupo_1h7dd_989",opcion_virtual:"_opcion_virtual_1h7dd_1021",opcion:"_opcion_1h7dd_1021",activo:"_activo_1h7dd_1065",seleccionado:"_seleccionado_1h7dd_1081",opcion_check:"_opcion_check_1h7dd_1139",opcion_contenido:"_opcion_contenido_1h7dd_1167",sin_resultados:"_sin_resultados_1h7dd_1183",descripcion:"_descripcion_1h7dd_1207",mensaje_error:"_mensaje_error_1h7dd_1219",ancho_total:"_ancho_total_1h7dd_1231",sin_animacion:"_sin_animacion_1h7dd_1239",contenedor_nativo:"_contenedor_nativo_1h7dd_1249",select_nativo:"_select_nativo_1h7dd_1257",input_validacion:"_input_validacion_1h7dd_1285"};function d1(e){const{options:t=[],value:r,onChange:a,onValueChange:o,optionLabelKey:s="label",optionValueKey:i="id",label:c,placeholder:l="Seleccione una opción",description:d,errorMessage:h,isRequired:g=!1,isInvalid:f,id:u,name:v,"data-testid":p,classNames:m,startContent:w,endContent:b,esInvalido:y,estaDeshabilitadoReal:E,clasesBase:S,renderizarValorMostrado:C}=e,T=_.useId(),F=u??`select-nativo-${T}`,D=d&&!y?`${F}-desc`:void 0,M=y?`${F}-err`:void 0,U=_.useCallback(x=>_o(x,s),[s]),V=_.useCallback(x=>cn(x,i),[i]),N=_.useCallback(x=>{a?.(x),o?.(x)},[a,o]),k=_.useCallback(x=>{const I=x.target.value;if(!I){N(null);return}const L=t.find(X=>V(X)===I);L&&N(L)},[t,V,N]),A=typeof f=="string"?f:null,O=typeof h=="function"?h({invalido:y,mensaje:A}):h??A,$=[D,O?M:void 0].filter(Boolean).join(" ")||void 0;return n.jsxs("div",{className:S,children:[c&&n.jsxs("label",{className:ne(_e.etiqueta,m?.label),htmlFor:F,children:[c,g&&n.jsx("span",{className:_e.marca_requerido,children:"*"})]}),n.jsxs("div",{className:_e.contenedor_nativo,children:[n.jsxs("div",{className:ne(_e.trigger,m?.trigger),children:[w&&n.jsx("span",{className:_e.contenido_inicio,children:w}),n.jsx("div",{className:ne(_e.valor_wrapper,m?.value),children:C()}),n.jsxs("div",{className:_e.acciones,children:[b&&n.jsx("span",{className:_e.contenido_final,children:b}),n.jsx("span",{className:_e.icono_chevron,children:n.jsx(Xi,{size:"1em"})})]})]}),n.jsxs("select",{id:F,name:v,"data-testid":p??(v?`select-${v}`:F),className:_e.select_nativo,value:r?V(r):"",onChange:k,disabled:E,required:g,"aria-describedby":$,"aria-invalid":y||void 0,"aria-required":g||void 0,children:[n.jsx("option",{value:"",children:l}),t.map(x=>n.jsx("option",{value:V(x),disabled:sa(x),children:U(x)},V(x)))]})]}),d&&!y&&n.jsx("div",{id:D,className:ne(_e.descripcion,m?.description),children:d}),y&&O&&n.jsx("div",{id:M,className:ne(_e.mensaje_error,m?.errorMessage),role:"alert",children:O})]})}const u1="(max-width: 768px)",f1=44;function h1(e,t){const{options:r=[],value:a,defaultValue:o,onChange:s,onValueChange:i,optionLabelKey:c="label",optionValueKey:l="id",renderOption:d,renderValue:h,variant:g="bordered",color:f="default",size:u="md",radius:v="md",fullWidth:p=!0,disableAnimation:m=!1,label:w,placeholder:b="",description:y,errorMessage:E,emptyMessage:S="No hay opciones",noResultsMessage:C="Sin resultados",isRequired:T=!1,isDisabled:F=!1,isReadOnly:D=!1,isLoading:M=!1,isClearable:U=!0,isInvalid:V,validationState:N,isMultiple:k=!1,mostrarTodos:A=!1,isSearchable:O,isVirtualized:$=!1,estimatedOptionHeight:x=f1,filterFn:I,validate:L,onOpen:X,onClose:H,onSearchChange:z,onClear:q,onFocus:B,onBlur:K,id:Y,name:Q,"data-testid":ee,className:se,classNames:ce,style:ae,startContent:de,endContent:oe,menuZIndex:fe,portalContainer:pe}=e,te=_.useRef(null),ue=_.useRef([]),ge=_.useRef(null),ve=_.useRef(null),J=_.useId(),P=Y??`select-${J}`,G=ho(u1),W=O??(r.length>4&&!G),re=G&&!W&&!k,[le,he]=_.useState(!1),[Ce,Ne]=_.useState(""),Ie=F||M,Ee=_.useCallback(()=>he(!1),[]),Ze=_.useCallback(()=>Ne(""),[]),{obtenerLabel:tt,obtenerValor:Fe,tieneGrupos:De,listaPlana:rt,indicesDeshabilitados:Ae}=Wf({options:r,optionLabelKey:c,optionValueKey:l,valorBusqueda:Ce,habilitarBusqueda:W,filterFn:I}),{valorActual:Le,tieneValor:$e,verificarSeleccionada:_t,actualizarValor:Pe,manejarSeleccion:lt,manejarLimpiar:Wt,manejarRemoverChip:Bt}=s1({value:a,defaultValue:o,isMultiple:k,optionValueKey:l,obtenerValor:Fe,onChange:s,onValueChange:i,onClear:q,cerrarDropdown:Ee,refTrigger:te}),{refs:Se,context:je,floatingStyles:kt,estilosTransicion:Re,estaMontado:xt,indiceActivo:At,setIndiceActivo:Nr,virtualizador:Xr,usaVirtualizacion:Ir,getReferenceProps:Xe,getFloatingProps:Oe,getItemProps:Dt}=o1({estaAbierto:le,setEstaAbierto:he,estaDeshabilitado:Ie,isReadOnly:D,isVirtualized:$,disableAnimation:m,estimatedOptionHeight:x,habilitarBusqueda:W,listaPlana:rt,indicesDeshabilitados:Ae,obtenerLabel:tt,verificarSeleccionada:_t,refLista:ue,refContenedorLista:ge,refInputBusqueda:ve,onOpen:X,onClose:H,alAbrir:Ze}),Nt=_.useMemo(()=>Vf(Le,L),[Le,L]),Et=_.useMemo(()=>jf(V,N,Nt),[V,N,Nt]),tr=N==="valid"&&!Et,rr=_.useCallback(Ke=>{const pt=Ke.target.value;Ne(pt),z?.(pt),Nr(0)},[z,Nr]),mr=_.useCallback(Ke=>{if(Ke.key==="Enter"&&At!==null){Ke.preventDefault();const pt=rt[At];pt?.tipo==="opcion"&&pt.datos&&lt(pt.datos)}},[At,rt,lt]);_.useImperativeHandle(t,()=>({focus:()=>te.current?.focus(),blur:()=>te.current?.blur(),open:()=>he(!0),close:()=>he(!1),clear:()=>Pe(k?[]:null)}));const Mt=_.useCallback(()=>{if(h)return h(Le??null);if(!$e)return n.jsx("span",{className:_e.placeholder,children:b});if(k&&Array.isArray(Le)){if(Le.length===0)return n.jsx("span",{className:_e.placeholder,children:b});const Ke=A?Le:Le.slice(0,2),pt=A?0:Math.max(0,Le.length-2);return n.jsxs(n.Fragment,{children:[Ke.map(nr=>n.jsxs("span",{className:_e.chip_multi,children:[n.jsx("span",{className:_e.chip_texto,children:tt(nr)}),!D&&!Ie&&n.jsx("button",{type:"button",className:_e.chip_cerrar,onClick:Lt=>Bt(nr,Lt),children:n.jsx(Ki,{size:"1em"})})]},Fe(nr))),pt>0&&n.jsxs("span",{className:_e.contador_multi,children:["+",pt]})]})}return n.jsx("span",{className:_e.valor_texto,children:tt(Le)})},[h,Le,$e,b,k,A,D,Ie,Fe,tt,Bt]),br=_.useCallback((Ke,pt,nr)=>{try{if(Ke.tipo==="grupo")return n.jsx("li",{className:ne(_e.encabezado_grupo,$&&_e.opcion_virtual),style:nr,children:Ke.nombreGrupo},`grupo-${Ke.nombreGrupo}`);const Lt=Ke.datos;if(!Lt)return null;const wa=_t(Lt),kn=At===pt,ya=sa(Lt),as=d?d(Lt,{isSelected:wa,isActive:kn}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:_e.opcion_check,children:n.jsx(i1,{size:"1em"})}),n.jsx("span",{className:_e.opcion_contenido,children:tt(Lt)})]}),ka=Fe(Lt);return n.jsx("li",{ref:xa=>{ue.current[pt]=xa},className:ne(_e.opcion,$&&_e.opcion_virtual,{[_e.activo]:kn,[_e.seleccionado]:wa,[_e.deshabilitado]:ya},ce?.option),style:nr,...Dt({onClick:()=>lt(Lt)}),children:as},ka)}catch(Lt){return console.error("Error rendering select item:",Lt),null}},[$,At,_t,d,tt,Fe,ce?.option,Dt,lt]),wn=typeof E=="function"?E({invalido:Et,mensaje:Nt}):E??Nt,ma=y&&!Et?`${P}-desc`:void 0,yn=Et&&wn?`${P}-err`:void 0,Mr=[ma,yn].filter(Boolean).join(" ")||void 0,ba=ne(_e.contenedor_base,_e[`variante_${g}`],_e[`tam_${u}`],_e[`radio_${v}`],_e[`color_${f}`],{[_e.ancho_total]:p,[_e.sin_animacion]:m,[_e.deshabilitado]:Ie,[_e.solo_lectura]:D,[_e.invalido]:Et,[_e.valido]:tr,[_e.abierto]:le,[_e.tiene_valor]:$e},ce?.base,se);return re&&!De?n.jsx(d1,{...e,value:Le,onChange:Pe,onValueChange:void 0,esInvalido:Et,estaDeshabilitadoReal:Ie,clasesBase:ba,renderizarValorMostrado:Mt}):n.jsxs("div",{className:ba,style:ae,children:[w&&n.jsxs("label",{id:`${P}-label`,className:ne(_e.etiqueta,ce?.label),children:[w,T&&n.jsx("span",{className:_e.marca_requerido,children:"*"})]}),n.jsxs("div",{ref:Ke=>{Se.setReference(Ke),te.current=Ke},id:P,tabIndex:Ie?-1:0,className:ne(_e.trigger,A&&k&&_e.trigger_expandido,ce?.trigger),"data-testid":ee??(Q?`select-${Q}`:P),"aria-labelledby":w?`${P}-label`:void 0,"aria-describedby":Mr,"aria-invalid":Et||void 0,"aria-required":T||void 0,"aria-disabled":Ie||void 0,onFocus:B,onBlur:K,...Xe(),children:[de&&n.jsx("span",{className:_e.contenido_inicio,children:de}),n.jsx("div",{className:ne(_e.valor_wrapper,A&&k&&_e.mostrar_todos,A&&k&&_e.valor_wrapper_expandido,ce?.value),children:Mt()}),n.jsxs("div",{className:_e.acciones,children:[U&&$e&&!D&&!Ie&&n.jsx("button",{type:"button",className:ne(_e.boton_limpiar,ce?.clearButton),onClick:Wt,tabIndex:-1,children:n.jsx(Ki,{size:"1em"})}),oe&&n.jsx("span",{className:_e.contenido_final,children:oe}),M?n.jsx("span",{className:_e.icono_spinner,children:n.jsx(l1,{size:"1em"})}):n.jsx("span",{className:_e.icono_chevron,children:n.jsx(Xi,{size:"1em"})})]})]}),(Q||T)&&n.jsx("input",{type:"text",name:Q,required:T,value:k&&Array.isArray(Le)?Le.map(Fe).join(","):Le?Fe(Le):"",onChange:()=>{},onFocus:Ke=>Ke.target.blur(),"aria-hidden":"true",tabIndex:-1,className:_e.input_validacion}),xt&&n.jsx(Jn,{root:pe,children:n.jsx(io,{context:je,modal:!1,initialFocus:W?ve:-1,children:n.jsxs("div",{ref:Se.setFloating,style:{...kt,...Re,zIndex:fe??"var(--z-popover)",transitionTimingFunction:je.open?"cubic-bezier(0.32, 0.72, 0, 1)":"cubic-bezier(0.4, 0, 1, 1)"},className:ne(_e.menu,ce?.menu),...Oe(),children:[W&&n.jsx("div",{className:_e.buscador_wrapper,children:n.jsxs("div",{className:_e.buscador_interno,children:[n.jsx("span",{className:_e.icono_buscar,children:n.jsx(c1,{size:"1.6em"})}),n.jsx("input",{ref:ve,type:"text",className:ne(_e.input_busqueda,ce?.searchInput),placeholder:"Buscar...",value:Ce,onChange:rr,onKeyDown:mr})]})}),n.jsx("ul",{ref:ge,className:ne(_e.lista_opciones,$&&_e.lista_virtual),style:{height:Ir?`${po}px`:`${Math.min(rt.length*x,po)}px`,maxHeight:`${po}px`,overflow:"auto",position:Ir?"relative":void 0},children:rt.length===0?n.jsx("li",{className:_e.sin_resultados,children:Ce?C:S}):Ir?n.jsx(n.Fragment,{children:n.jsx("div",{style:{height:`${Xr.getTotalSize()}px`,position:"relative",width:"100%"},children:Xr.getVirtualItems().map(Ke=>{const pt=rt[Ke.index];return pt?n.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${Ke.size}px`,transform:`translateY(${Ke.start}px)`},children:br(pt,Ke.index)},`virtual-${Ke.index}`):null})})}):rt.map((Ke,pt)=>br(Ke,pt))})]})})}),y&&!Et&&n.jsx("div",{id:ma,className:ne(_e.descripcion,ce?.description),children:y}),Et&&wn&&n.jsx("div",{id:yn,className:ne(_e.mensaje_error,ce?.errorMessage),role:"alert",children:wn})]})}const _1=_.forwardRef(h1),Yi=_.memo(_1);Yi.displayName="SelectBase";function p1(e,t){const{options:r=[],value:a,onChange:o,onValueChange:s,optionValueKey:i,optionLabelKey:c="label",isMultiple:l=!1,devolverObjeto:d=!1,...h}=e,g=_.useMemo(()=>r.length>0&&typeof r[0]=="object",[r]),f=_.useMemo(()=>{if(!g||!i)return null;const p=new Map;for(const m of r)p.set(String(m[i]),m);return p},[r,i,g]),u=_.useMemo(()=>{if(a==null||!g||d)return a;const p=m=>f?.get(String(m));return l&&Array.isArray(a)?a.map(p).filter(m=>m!==void 0):p(a)??null},[a,f,l,d,g]),v=_.useCallback(p=>{const m=o||s;if(!m)return;if(p===null){m(l?[]:d||!g?null:"");return}if(d||!g){m(p);return}const w=b=>typeof b=="string"?b:b[i];m(l&&Array.isArray(p)?p.map(w):w(p))},[o,s,d,l,i,g]);return n.jsx(Yi,{...h,ref:t,options:r,value:u,onChange:v,optionValueKey:i,optionLabelKey:c,isMultiple:l})}const Zi=_.forwardRef(p1);Zi.displayName="Select";const ln={tooltip:"_tooltip_aqvwg_1",tooltip_positioner:"_tooltip_positioner_aqvwg_53",enterAnimation:"_enterAnimation_aqvwg_1",exitAnimation:"_exitAnimation_aqvwg_1",arrow:"_arrow_aqvwg_81",size_sm:"_size_sm_aqvwg_91",size_md:"_size_md_aqvwg_101",size_lg:"_size_lg_aqvwg_111",variant_default:"_variant_default_aqvwg_121",variant_dark:"_variant_dark_aqvwg_141",variant_light:"_variant_light_aqvwg_153",variant_brand:"_variant_brand_aqvwg_165",variant_success:"_variant_success_aqvwg_181",variant_warning:"_variant_warning_aqvwg_193",variant_danger:"_variant_danger_aqvwg_205",variant_info:"_variant_info_aqvwg_217",fadeOnly:"_fadeOnly_aqvwg_1"},g1=Number.parseInt(_.version,10)>=19;function Ji(e){return g1?e.props.ref??null:e.ref??null}function dr({content:e,children:t,placement:r="top",variant:a="default",size:o="md",offset:s=8,delayShow:i=100,delayHide:c=0,isDisabled:l=!1,showArrow:d=!1,maxWidth:h="320px",isInteractive:g=!1,className:f="",onOpen:u,onClose:v,isOpen:p,onOpenChange:m}){const[w,b]=_.useState(!1),y=_.useRef(null),E=p!==void 0?p:w,S=_.useCallback(X=>{l||(m?m(X):b(X),X?u?.():v?.())},[l,m,u,v]),{refs:C,floatingStyles:T,context:F,isPositioned:D}=ea({open:E,onOpenChange:S,placement:r,strategy:"fixed",middleware:[Un(s+(d?8:0)),qn({fallbackAxisSideDirection:"start",padding:8}),Wn({padding:8}),d?sf({element:y}):void 0].filter(Boolean),whileElementsMounted:Vn}),M=no(F,{delay:{open:i,close:g?200:c||100},enabled:!l,move:!1,handleClose:null}),U=Nf(F,{enabled:!l}),V=Qn(F,{enabled:!l}),N=aa(F,{role:"tooltip"}),{getReferenceProps:k,getFloatingProps:A}=ta([M,U,V,N]),{isMounted:O,styles:$}=oa(F,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=_.useMemo(()=>[ln.tooltip,ln[`size_${o}`],ln[`variant_${a}`],f].filter(Boolean).join(" "),[o,a,f]),I=eo([C.setReference,Ji(t)]),L=_.useMemo(()=>_.cloneElement(t,k({...t.props,ref:I})),[t,k,I]);return!e||l?t:n.jsxs(n.Fragment,{children:[L,O&&n.jsx(Jn,{children:n.jsx("div",{ref:C.setFloating,className:ln.tooltip_positioner,style:{...T,maxWidth:h,zIndex:9999,pointerEvents:"none"},children:n.jsxs("div",{className:x,style:{...$,pointerEvents:g?"auto":"none",visibility:D||!E?"visible":"hidden"},...A(),children:[e,d&&n.jsx(hf,{ref:y,context:F,className:ln.arrow})]})})})]})}/**
8
8
  * table-core
9
9
  *
10
10
  * Copyright (c) TanStack
@@ -13,10 +13,10 @@
13
13
  * LICENSE.md file in the root directory of this source tree.
14
14
  *
15
15
  * @license MIT
16
- */function rr(e,t){return typeof e=="function"?e(t):e}function Nt(e,t){return r=>{t.setState(n=>({...n,[e]:rr(r,n[e])}))}}function Xn(e){return e instanceof Function}function Xf(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Yf(e,t){const r=[],n=o=>{o.forEach(s=>{r.push(s);const i=t(s);i!=null&&i.length&&n(i)})};return n(e),r}function me(e,t,r){let n=[],o;return s=>{let i;r.key&&r.debug&&(i=Date.now());const c=e(s);if(!(c.length!==n.length||c.some((f,p)=>n[p]!==f)))return o;n=c;let u;if(r.key&&r.debug&&(u=Date.now()),o=t(...c),r==null||r.onChange==null||r.onChange(o),r.key&&r.debug&&r!=null&&r.debug()){const f=Math.round((Date.now()-i)*100)/100,p=Math.round((Date.now()-u)*100)/100,h=p/16,d=(v,g)=>{for(v=String(v);v.length<g;)v=" "+v;return v};console.info(`%c⏱ ${d(p,5)} /${d(f,5)} ms`,`
16
+ */function ur(e,t){return typeof e=="function"?e(t):e}function Ot(e,t){return r=>{t.setState(a=>({...a,[e]:ur(r,a[e])}))}}function ia(e){return e instanceof Function}function v1(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function m1(e,t){const r=[],a=o=>{o.forEach(s=>{r.push(s);const i=t(s);i!=null&&i.length&&a(i)})};return a(e),r}function ye(e,t,r){let a=[],o;return s=>{let i;r.key&&r.debug&&(i=Date.now());const c=e(s);if(!(c.length!==a.length||c.some((h,g)=>a[g]!==h)))return o;a=c;let d;if(r.key&&r.debug&&(d=Date.now()),o=t(...c),r==null||r.onChange==null||r.onChange(o),r.key&&r.debug&&r!=null&&r.debug()){const h=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-d)*100)/100,f=g/16,u=(v,p)=>{for(v=String(v);v.length<p;)v=" "+v;return v};console.info(`%c⏱ ${u(g,5)} /${u(h,5)} ms`,`
17
17
  font-size: .6rem;
18
18
  font-weight: bold;
19
- color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,r?.key)}return o}}function be(e,t,r,n){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&r,onChange:n}}function Zf(e,t,r,n){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(n),renderValue:o,getContext:me(()=>[e,r,t,s],(i,c,l,u)=>({table:i,column:c,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),be(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,r,t,e)},{}),s}function Jf(e,t,r,n){var o,s;const c={...e._getDefaultColumnDef(),...t},l=c.accessorKey;let u=(o=(s=c.id)!=null?s:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,f;if(c.accessorFn?f=c.accessorFn:l&&(l.includes(".")?f=h=>{let d=h;for(const g of l.split(".")){var v;d=(v=d)==null?void 0:v[g],process.env.NODE_ENV!=="production"&&d===void 0&&console.warn(`"${g}" in deeply nested key "${l}" returned undefined.`)}return d}:f=h=>h[c.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(c.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let p={id:`${String(u)}`,accessorFn:f,parent:n,depth:r,columnDef:c,columns:[],getFlatColumns:me(()=>[!0],()=>{var h;return[p,...(h=p.columns)==null?void 0:h.flatMap(d=>d.getFlatColumns())]},be(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:me(()=>[e._getOrderColumnsFn()],h=>{var d;if((d=p.columns)!=null&&d.length){let v=p.columns.flatMap(g=>g.getLeafColumns());return h(v)}return[p]},be(e.options,"debugColumns","column.getLeafColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(p,e);return p}const wt="debugHeaders";function Di(e,t,r){var n;let s={id:(n=r.id)!=null?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],c=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(c),i.push(l)};return c(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Qf={createTable:e=>{e.getHeaderGroups=me(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,o)=>{var s,i;const c=(s=n?.map(p=>r.find(h=>h.id===p)).filter(Boolean))!=null?s:[],l=(i=o?.map(p=>r.find(h=>h.id===p)).filter(Boolean))!=null?i:[],u=r.filter(p=>!(n!=null&&n.includes(p.id))&&!(o!=null&&o.includes(p.id)));return Yn(t,[...c,...u,...l],e)},be(e.options,wt,"getHeaderGroups")),e.getCenterHeaderGroups=me(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,o)=>(r=r.filter(s=>!(n!=null&&n.includes(s.id))&&!(o!=null&&o.includes(s.id))),Yn(t,r,e,"center")),be(e.options,wt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=me(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,n)=>{var o;const s=(o=n?.map(i=>r.find(c=>c.id===i)).filter(Boolean))!=null?o:[];return Yn(t,s,e,"left")},be(e.options,wt,"getLeftHeaderGroups")),e.getRightHeaderGroups=me(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,n)=>{var o;const s=(o=n?.map(i=>r.find(c=>c.id===i)).filter(Boolean))!=null?o:[];return Yn(t,s,e,"right")},be(e.options,wt,"getRightHeaderGroups")),e.getFooterGroups=me(()=>[e.getHeaderGroups()],t=>[...t].reverse(),be(e.options,wt,"getFooterGroups")),e.getLeftFooterGroups=me(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),be(e.options,wt,"getLeftFooterGroups")),e.getCenterFooterGroups=me(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),be(e.options,wt,"getCenterFooterGroups")),e.getRightFooterGroups=me(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),be(e.options,wt,"getRightFooterGroups")),e.getFlatHeaders=me(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),be(e.options,wt,"getFlatHeaders")),e.getLeftFlatHeaders=me(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),be(e.options,wt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=me(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),be(e.options,wt,"getCenterFlatHeaders")),e.getRightFlatHeaders=me(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),be(e.options,wt,"getRightFlatHeaders")),e.getCenterLeafHeaders=me(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),be(e.options,wt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=me(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),be(e.options,wt,"getLeftLeafHeaders")),e.getRightLeafHeaders=me(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),be(e.options,wt,"getRightLeafHeaders")),e.getLeafHeaders=me(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,n)=>{var o,s,i,c,l,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(c=r[0])==null?void 0:c.headers)!=null?i:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[]].map(f=>f.getLeafHeaders()).flat()},be(e.options,wt,"getLeafHeaders"))}};function Yn(e,t,r,n){var o,s;let i=0;const c=function(h,d){d===void 0&&(d=1),i=Math.max(i,d),h.filter(v=>v.getIsVisible()).forEach(v=>{var g;(g=v.columns)!=null&&g.length&&c(v.columns,d+1)},0)};c(e);let l=[];const u=(h,d)=>{const v={depth:d,id:[n,`${d}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(b=>{const w=[...g].reverse()[0],m=b.column.depth===v.depth;let y,k=!1;if(m&&b.column.parent?y=b.column.parent:(y=b.column,k=!0),w&&w?.column===y)w.subHeaders.push(b);else{const T=Di(r,y,{id:[n,d,y.id,b?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${g.filter(C=>C.column===y).length}`:void 0,depth:d,index:g.length});T.subHeaders.push(b),g.push(T)}v.headers.push(b),b.headerGroup=v}),l.push(v),d>0&&u(g,d-1)},f=t.map((h,d)=>Di(r,h,{depth:i,index:d}));u(f,i-1),l.reverse();const p=h=>h.filter(v=>v.column.getIsVisible()).map(v=>{let g=0,b=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],p(v.subHeaders).forEach(y=>{let{colSpan:k,rowSpan:T}=y;g+=k,w.push(T)})):g=1;const m=Math.min(...w);return b=b+m,v.colSpan=g,v.rowSpan=b,{colSpan:g,rowSpan:b}});return p((o=(s=l[0])==null?void 0:s.headers)!=null?o:[]),l}const Qa=(e,t,r,n,o,s,i)=>{let c={id:t,index:n,original:r,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(c._valuesCache.hasOwnProperty(l))return c._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return c._valuesCache[l]=u.accessorFn(c.original,n),c._valuesCache[l]},getUniqueValues:l=>{if(c._uniqueValuesCache.hasOwnProperty(l))return c._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(c._uniqueValuesCache[l]=u.columnDef.getUniqueValues(c.original,n),c._uniqueValuesCache[l]):(c._uniqueValuesCache[l]=[c.getValue(l)],c._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=c.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Yf(c.subRows,l=>l.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let l=[],u=c;for(;;){const f=u.getParentRow();if(!f)break;l.push(f),u=f}return l.reverse()},getAllCells:me(()=>[e.getAllLeafColumns()],l=>l.map(u=>Zf(e,c,u,u.id)),be(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:me(()=>[c.getAllCells()],l=>l.reduce((u,f)=>(u[f.column.id]=f,u),{}),be(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(c,e)}return c},e1={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Li=(e,t,r)=>{var n,o;const s=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};Li.autoRemove=e=>Ft(e);const Pi=(e,t,r)=>{var n;return!!(!((n=e.getValue(t))==null||(n=n.toString())==null)&&n.includes(r))};Pi.autoRemove=e=>Ft(e);const zi=(e,t,r)=>{var n;return((n=e.getValue(t))==null||(n=n.toString())==null?void 0:n.toLowerCase())===r?.toLowerCase()};zi.autoRemove=e=>Ft(e);const Bi=(e,t,r)=>{var n;return(n=e.getValue(t))==null?void 0:n.includes(r)};Bi.autoRemove=e=>Ft(e);const Vi=(e,t,r)=>!r.some(n=>{var o;return!((o=e.getValue(t))!=null&&o.includes(n))});Vi.autoRemove=e=>Ft(e)||!(e!=null&&e.length);const ji=(e,t,r)=>r.some(n=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)});ji.autoRemove=e=>Ft(e)||!(e!=null&&e.length);const Hi=(e,t,r)=>e.getValue(t)===r;Hi.autoRemove=e=>Ft(e);const Ui=(e,t,r)=>e.getValue(t)==r;Ui.autoRemove=e=>Ft(e);const eo=(e,t,r)=>{let[n,o]=r;const s=e.getValue(t);return s>=n&&s<=o};eo.resolveFilterValue=e=>{let[t,r]=e,n=typeof t!="number"?parseFloat(t):t,o=typeof r!="number"?parseFloat(r):r,s=t===null||Number.isNaN(n)?-1/0:n,i=r===null||Number.isNaN(o)?1/0:o;if(s>i){const c=s;s=i,i=c}return[s,i]},eo.autoRemove=e=>Ft(e)||Ft(e[0])&&Ft(e[1]);const Wt={includesString:Li,includesStringSensitive:Pi,equalsString:zi,arrIncludes:Bi,arrIncludesAll:Vi,arrIncludesSome:ji,equals:Hi,weakEquals:Ui,inNumberRange:eo};function Ft(e){return e==null||e===""}const t1={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Nt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r?.getValue(e.id);return typeof n=="string"?Wt.includesString:typeof n=="number"?Wt.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?Wt.equals:Array.isArray(n)?Wt.arrIncludes:Wt.weakEquals},e.getFilterFn=()=>{var r,n;return Xn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(n=t.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?r:Wt[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,o;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((n=t.options.enableColumnFilters)!=null?n:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(n=>n.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,n;return(r=(n=t.getState().columnFilters)==null?void 0:n.findIndex(o=>o.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(n=>{const o=e.getFilterFn(),s=n?.find(f=>f.id===e.id),i=rr(r,s?s.value:void 0);if(Wi(o,i,e)){var c;return(c=n?.filter(f=>f.id!==e.id))!=null?c:[]}const l={id:e.id,value:i};if(s){var u;return(u=n?.map(f=>f.id===e.id?l:f))!=null?u:[]}return n!=null&&n.length?[...n,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),n=o=>{var s;return(s=rr(t,o))==null?void 0:s.filter(i=>{const c=r.find(l=>l.id===i.id);if(c){const l=c.getFilterFn();if(Wi(l,i.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:(r=(n=e.initialState)==null?void 0:n.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Wi(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const to={sum:(e,t,r)=>r.reduce((n,o)=>{const s=o.getValue(e);return n+(typeof s=="number"?s:0)},0),min:(e,t,r)=>{let n;return r.forEach(o=>{const s=o.getValue(e);s!=null&&(n>s||n===void 0&&s>=s)&&(n=s)}),n},max:(e,t,r)=>{let n;return r.forEach(o=>{const s=o.getValue(e);s!=null&&(n<s||n===void 0&&s>=s)&&(n=s)}),n},extent:(e,t,r)=>{let n,o;return r.forEach(s=>{const i=s.getValue(e);i!=null&&(n===void 0?i>=i&&(n=o=i):(n>i&&(n=i),o<i&&(o=i)))}),[n,o]},mean:(e,t)=>{let r=0,n=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++r,n+=s)}),r)return n/r},median:(e,t)=>{if(!t.length)return;const r=t.map(s=>s.getValue(e));if(!Xf(r))return;if(r.length===1)return r[0];const n=Math.floor(r.length/2),o=r.sort((s,i)=>s-i);return r.length%2!==0?o[n]:(o[n-1]+o[n])/2},unique:(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(r=>r.getValue(e))).size,count:(e,t)=>t.length},r1={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Nt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(n=>n!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,n;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((n=t.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r?.getValue(e.id);if(typeof n=="number")return to.sum;if(Object.prototype.toString.call(n)==="[object Date]")return to.extent},e.getAggregationFn=()=>{var r,n;if(!e)throw new Error;return Xn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(n=t.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?r:to[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:(r=(n=e.initialState)==null?void 0:n.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const n=t.getColumn(r);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=r.subRows)!=null&&o.length)}}};function n1(e,t,r){if(!(t!=null&&t.length)||!r)return e;const n=e.filter(s=>!t.includes(s.id));return r==="remove"?n:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...n]}const a1={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Nt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=me(r=>[Kr(t,r)],r=>r.findIndex(n=>n.id===e.id),be(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var n;return((n=Kr(t,r)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;const o=Kr(t,r);return((n=o[o.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=me(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,n)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],c=[...o];for(;c.length&&i.length;){const l=i.shift(),u=c.findIndex(f=>f.id===l);u>-1&&s.push(c.splice(u,1)[0])}s=[...s,...c]}return n1(s,r,n)},be(e.options,"debugTable","_getOrderColumnsFn"))}},ro=()=>({left:[],right:[]}),o1={getInitialState:e=>({columnPinning:ro(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Nt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const n=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(r==="right"){var c,l;return{left:((c=o?.left)!=null?c:[]).filter(p=>!(n!=null&&n.includes(p))),right:[...((l=o?.right)!=null?l:[]).filter(p=>!(n!=null&&n.includes(p))),...n]}}if(r==="left"){var u,f;return{left:[...((u=o?.left)!=null?u:[]).filter(p=>!(n!=null&&n.includes(p))),...n],right:((f=o?.right)!=null?f:[]).filter(p=>!(n!=null&&n.includes(p)))}}return{left:((s=o?.left)!=null?s:[]).filter(p=>!(n!=null&&n.includes(p))),right:((i=o?.right)!=null?i:[]).filter(p=>!(n!=null&&n.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var o,s,i;return((o=n.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(c=>c.id),{left:n,right:o}=t.getState().columnPinning,s=r.some(c=>n?.includes(c)),i=r.some(c=>o?.includes(c));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var r,n;const o=e.getIsPinned();return o?(r=(n=t.getState().columnPinning)==null||(n=n[o])==null?void 0:n.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=me(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,n,o)=>{const s=[...n??[],...o??[]];return r.filter(i=>!s.includes(i.column.id))},be(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=me(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,n)=>(n??[]).map(s=>r.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),be(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=me(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,n)=>(n??[]).map(s=>r.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),be(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?ro():(r=(n=e.initialState)==null?void 0:n.columnPinning)!=null?r:ro())},e.getIsSomeColumnsPinned=t=>{var r;const n=e.getState().columnPinning;if(!t){var o,s;return!!((o=n.left)!=null&&o.length||(s=n.right)!=null&&s.length)}return!!((r=n[t])!=null&&r.length)},e.getLeftLeafColumns=me(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(n=>t.find(o=>o.id===n)).filter(Boolean),be(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=me(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(n=>t.find(o=>o.id===n)).filter(Boolean),be(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=me(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n)=>{const o=[...r??[],...n??[]];return t.filter(s=>!o.includes(s.id))},be(e.options,"debugColumns","getCenterLeafColumns"))}};function s1(e){return e||(typeof document<"u"?document:null)}const Zn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},no=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),i1={getDefaultColumnDef:()=>Zn,getInitialState:e=>({columnSizing:{},columnSizingInfo:no(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Nt("columnSizing",e),onColumnSizingInfoChange:Nt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Zn.minSize,(n=s??e.columnDef.size)!=null?n:Zn.size),(o=e.columnDef.maxSize)!=null?o:Zn.maxSize)},e.getStart=me(r=>[r,Kr(t,r),t.getState().columnSizing],(r,n)=>n.slice(0,e.getIndex(r)).reduce((o,s)=>o+s.getSize(),0),be(t.options,"debugColumns","getStart")),e.getAfter=me(r=>[r,Kr(t,r),t.getState().columnSizing],(r,n)=>n.slice(e.getIndex(r)+1).reduce((o,s)=>o+s.getSize(),0),be(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:n,...o}=r;return o})},e.getCanResize=()=>{var r,n;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((n=t.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let r=0;const n=o=>{if(o.subHeaders.length)o.subHeaders.forEach(n);else{var s;r+=(s=o.column.getSize())!=null?s:0}};return n(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const n=t.getColumn(e.column.id),o=n?.getCanResize();return s=>{if(!n||!o||(s.persist==null||s.persist(),ao(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),c=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[n.id,n.getSize()]],l=ao(s)?Math.round(s.touches[0].clientX):s.clientX,u={},f=(w,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(y=>{var k,T;const C=t.options.columnResizeDirection==="rtl"?-1:1,S=(m-((k=y?.startOffset)!=null?k:0))*C,M=Math.max(S/((T=y?.startSize)!=null?T:0),-.999999);return y.columnSizingStart.forEach(D=>{let[O,H]=D;u[O]=Math.round(Math.max(H+H*M,0)*100)/100}),{...y,deltaOffset:S,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(y=>({...y,...u})))},p=w=>f("move",w),h=w=>{f("end",w),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=s1(r),v={moveHandler:w=>p(w.clientX),upHandler:w=>{d?.removeEventListener("mousemove",v.moveHandler),d?.removeEventListener("mouseup",v.upHandler),h(w.clientX)}},g={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),p(w.touches[0].clientX),!1),upHandler:w=>{var m;d?.removeEventListener("touchmove",g.moveHandler),d?.removeEventListener("touchend",g.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((m=w.touches[0])==null?void 0:m.clientX)}},b=c1()?{passive:!1}:!1;ao(s)?(d?.addEventListener("touchmove",g.moveHandler,b),d?.addEventListener("touchend",g.upHandler,b)):(d?.addEventListener("mousemove",v.moveHandler,b),d?.addEventListener("mouseup",v.upHandler,b)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?no():(r=e.initialState.columnSizingInfo)!=null?r:no())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((n,o)=>n+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((n,o)=>n+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((n,o)=>n+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((n,o)=>n+o.getSize(),0))!=null?t:0}}};let Jn=null;function c1(){if(typeof Jn=="boolean")return Jn;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return Jn=e,Jn}function ao(e){return e.type==="touchstart"}const l1={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Nt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(n=>({...n,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,n;const o=e.columns;return(r=o.length?o.some(s=>s.getIsVisible()):(n=t.getState().columnVisibility)==null?void 0:n[e.id])!=null?r:!0},e.getCanHide=()=>{var r,n;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((n=t.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=me(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(n=>n.column.getIsVisible()),be(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=me(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,n,o)=>[...r,...n,...o],be(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(r,n)=>me(()=>[n(),n().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),be(e.options,"debugColumns",r));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var n;e.setColumnVisibility(r?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=r=>{var n;r=(n=r)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:r||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var n;e.toggleAllColumnsVisible((n=r.target)==null?void 0:n.checked)}}};function Kr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const d1={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},u1={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Nt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const n=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,o,s;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((n=t.options.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wt.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:n}=e.options;return Xn(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[n])!=null?t:Wt[n]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},f1={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Nt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,o;if(!t){e._queue(()=>{t=!0});return}if((n=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var o,s;e.setExpanded(n?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");n=Math.max(n,i.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded(n=>{var o;const s=n===!0?!0:!!(n!=null&&n[e.id]);let i={};if(n===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{i[c]=!0}):i=n,r=(o=r)!=null?o:!s,!s&&r)return{...i,[e.id]:!0};if(s&&!r){const{[e.id]:c,...l}=i;return l}return n})},e.getIsExpanded=()=>{var r;const n=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:n===!0||n?.[e.id])},e.getCanExpand=()=>{var r,n,o;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((n=t.options.enableExpanding)!=null?n:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)n=t.getRow(n.parentId,!0),r=n.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},oo=0,so=10,io=()=>({pageIndex:oo,pageSize:so}),h1={getInitialState:e=>({...e,pagination:{...io(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Nt("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,o;if(!t){e._queue(()=>{t=!0});return}if((n=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=n=>{const o=s=>rr(n,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=n=>{var o;e.setPagination(n?io():(o=e.initialState.pagination)!=null?o:io())},e.setPageIndex=n=>{e.setPagination(o=>{let s=rr(n,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=n=>{var o,s;e.setPageIndex(n?oo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:oo)},e.resetPageSize=n=>{var o,s;e.setPageSize(n?so:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:so)},e.setPageSize=n=>{e.setPagination(o=>{const s=Math.max(1,rr(n,o.pageSize)),i=o.pageSize*o.pageIndex,c=Math.floor(i/s);return{...o,pageIndex:c,pageSize:s}})},e.setPageCount=n=>e.setPagination(o=>{var s;let i=rr(n,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=me(()=>[e.getPageCount()],n=>{let o=[];return n&&n>0&&(o=[...new Array(n)].fill(null).map((s,i)=>i)),o},be(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:n<o-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},co=()=>({top:[],bottom:[]}),_1={getInitialState:e=>({rowPinning:co(),...e}),getDefaultOptions:e=>({onRowPinningChange:Nt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,o)=>{const s=n?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],i=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],c=new Set([...i,e.id,...s]);t.setRowPinning(l=>{var u,f;if(r==="bottom"){var p,h;return{top:((p=l?.top)!=null?p:[]).filter(g=>!(c!=null&&c.has(g))),bottom:[...((h=l?.bottom)!=null?h:[]).filter(g=>!(c!=null&&c.has(g))),...Array.from(c)]}}if(r==="top"){var d,v;return{top:[...((d=l?.top)!=null?d:[]).filter(g=>!(c!=null&&c.has(g))),...Array.from(c)],bottom:((v=l?.bottom)!=null?v:[]).filter(g=>!(c!=null&&c.has(g)))}}return{top:((u=l?.top)!=null?u:[]).filter(g=>!(c!=null&&c.has(g))),bottom:((f=l?.bottom)!=null?f:[]).filter(g=>!(c!=null&&c.has(g)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:o}=t.options;return typeof n=="function"?n(e):(r=n??o)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:n,bottom:o}=t.getState().rowPinning,s=r.some(c=>n?.includes(c)),i=r.some(c=>o?.includes(c));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var r,n;const o=e.getIsPinned();if(!o)return-1;const s=(r=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:r.map(i=>{let{id:c}=i;return c});return(n=s?.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?co():(r=(n=e.initialState)==null?void 0:n.rowPinning)!=null?r:co())},e.getIsSomeRowsPinned=t=>{var r;const n=e.getState().rowPinning;if(!t){var o,s;return!!((o=n.top)!=null&&o.length||(s=n.bottom)!=null&&s.length)}return!!((r=n[t])!=null&&r.length)},e._getPinnedRows=(t,r,n)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(i=>{const c=e.getRow(i,!0);return c.getIsAllParentsExpanded()?c:null}):(r??[]).map(i=>t.find(c=>c.id===i))).filter(Boolean).map(i=>({...i,position:n}))},e.getTopRows=me(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),be(e.options,"debugRows","getTopRows")),e.getBottomRows=me(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),be(e.options,"debugRows","getBottomRows")),e.getCenterRows=me(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,n)=>{const o=new Set([...r??[],...n??[]]);return t.filter(s=>!o.has(s.id))},be(e.options,"debugRows","getCenterRows"))}},p1={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Nt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const n={...r},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(n[s.id]=!0)}):o.forEach(s=>{delete n[s.id]}),n})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const n=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach(s=>{lo(o,s.id,n,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=me(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?uo(e,r):{rows:[],flatRows:[],rowsById:{}},be(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=me(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?uo(e,r):{rows:[],flatRows:[],rowsById:{}},be(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=me(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?uo(e,r):{rows:[],flatRows:[],rowsById:{}},be(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let n=!!(t.length&&Object.keys(r).length);return n&&t.some(o=>o.getCanSelect()&&!r[o.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:r}=e.getState();let n=!!t.length;return n&&t.some(o=>!r[o.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(r=typeof r<"u"?r:!o,e.getCanSelect()&&o===r)return s;const c={...s};return lo(c,e.id,r,(i=n?.selectChildren)!=null?i:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return fo(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return ho(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return ho(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return n=>{var o;r&&e.toggleSelected((o=n.target)==null?void 0:o.checked)}}}},lo=(e,t,r,n,o)=>{var s;const i=o.getRow(t,!0);r?(i.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),i.getCanSelect()&&(e[t]=!0)):delete e[t],n&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(c=>lo(e,c.id,r,n,o))};function uo(e,t){const r=e.getState().rowSelection,n=[],o={},s=function(i,c){return i.map(l=>{var u;const f=fo(l,r);if(f&&(n.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:s(l.subRows)}),f)return l}).filter(Boolean)};return{rows:s(t.rows),flatRows:n,rowsById:o}}function fo(e,t){var r;return(r=t[e.id])!=null?r:!1}function ho(e,t,r){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(fo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const c=ho(i,t);c==="all"?s=!0:(c==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const _o=/([0-9]+)/gm,g1=(e,t,r)=>Gi(nr(e.getValue(r)).toLowerCase(),nr(t.getValue(r)).toLowerCase()),v1=(e,t,r)=>Gi(nr(e.getValue(r)),nr(t.getValue(r))),m1=(e,t,r)=>po(nr(e.getValue(r)).toLowerCase(),nr(t.getValue(r)).toLowerCase()),b1=(e,t,r)=>po(nr(e.getValue(r)),nr(t.getValue(r))),w1=(e,t,r)=>{const n=e.getValue(r),o=t.getValue(r);return n>o?1:n<o?-1:0},y1=(e,t,r)=>po(e.getValue(r),t.getValue(r));function po(e,t){return e===t?0:e>t?1:-1}function nr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Gi(e,t){const r=e.split(_o).filter(Boolean),n=t.split(_o).filter(Boolean);for(;r.length&&n.length;){const o=r.shift(),s=n.shift(),i=parseInt(o,10),c=parseInt(s,10),l=[i,c].sort();if(isNaN(l[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(l[1]))return isNaN(i)?-1:1;if(i>c)return 1;if(c>i)return-1}return r.length-n.length}const Xr={alphanumeric:g1,alphanumericCaseSensitive:v1,text:m1,textCaseSensitive:b1,datetime:w1,basic:y1},x1=[Qf,l1,a1,o1,e1,t1,d1,u1,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Nt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const o of r){const s=o?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return Xr.datetime;if(typeof s=="string"&&(n=!0,s.split(_o).length>1))return Xr.alphanumeric}return n?Xr.text:Xr.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw new Error;return Xn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(n=t.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?r:Xr[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{const o=e.getNextSortingOrder(),s=typeof r<"u"&&r!==null;t.setSorting(i=>{const c=i?.find(d=>d.id===e.id),l=i?.findIndex(d=>d.id===e.id);let u=[],f,p=s?r:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&n?c?f="toggle":f="add":i!=null&&i.length&&l!==i.length-1?f="replace":c?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var h;u=[...i,{id:e.id,desc:p}],u.splice(0,u.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=i.map(d=>d.id===e.id?{...d,desc:p}:d):f==="remove"?u=i.filter(d=>d.id!==e.id):u=[{id:e.id,desc:p}];return u})},e.getFirstSortDir=()=>{var r,n;return((r=(n=e.columnDef.sortDescFirst)!=null?n:t.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var n,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((n=t.options.enableSortingRemoval)==null||n)&&(!(r&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var r,n;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((n=t.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return(r=(n=e.columnDef.enableMultiSort)!=null?n:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const n=(r=t.getState().sorting)==null?void 0:r.find(o=>o.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,n;return(r=(n=t.getState().sorting)==null?void 0:n.findIndex(o=>o.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.setSorting(r=>r!=null&&r.length?r.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return n=>{r&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:(r=(n=e.initialState)==null?void 0:n.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},r1,f1,h1,_1,p1,i1];function k1(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const n=[...x1,...(t=e._features)!=null?t:[]];let o={_features:n};const s=o._features.reduce((h,d)=>Object.assign(h,d.getDefaultOptions==null?void 0:d.getDefaultOptions(o)),{}),i=h=>o.options.mergeOptions?o.options.mergeOptions(s,h):{...s,...h};let l={...{},...(r=e.initialState)!=null?r:{}};o._features.forEach(h=>{var d;l=(d=h.getInitialState==null?void 0:h.getInitialState(l))!=null?d:l});const u=[];let f=!1;const p={_features:n,options:{...s,...e},initialState:l,_queue:h=>{u.push(h),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{o.setState(o.initialState)},setOptions:h=>{const d=rr(h,o.options);o.options=i(d)},getState:()=>o.options.state,setState:h=>{o.options.onStateChange==null||o.options.onStateChange(h)},_getRowId:(h,d,v)=>{var g;return(g=o.options.getRowId==null?void 0:o.options.getRowId(h,d,v))!=null?g:`${v?[v.id,d].join("."):d}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(h,d)=>{let v=(d?o.getPrePaginationRowModel():o.getRowModel()).rowsById[h];if(!v&&(v=o.getCoreRowModel().rowsById[h],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return v},_getDefaultColumnDef:me(()=>[o.options.defaultColumn],h=>{var d;return h=(d=h)!=null?d:{},{header:v=>{const g=v.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:v=>{var g,b;return(g=(b=v.renderValue())==null||b.toString==null?void 0:b.toString())!=null?g:null},...o._features.reduce((v,g)=>Object.assign(v,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},be(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:me(()=>[o._getColumnDefs()],h=>{const d=function(v,g,b){return b===void 0&&(b=0),v.map(w=>{const m=Jf(o,w,b,g),y=w;return m.columns=y.columns?d(y.columns,m,b+1):[],m})};return d(h)},be(e,"debugColumns","getAllColumns")),getAllFlatColumns:me(()=>[o.getAllColumns()],h=>h.flatMap(d=>d.getFlatColumns()),be(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:me(()=>[o.getAllFlatColumns()],h=>h.reduce((d,v)=>(d[v.id]=v,d),{}),be(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:me(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(h,d)=>{let v=h.flatMap(g=>g.getLeafColumns());return d(v)},be(e,"debugColumns","getAllLeafColumns")),getColumn:h=>{const d=o._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!d&&console.error(`[Table] Column with id '${h}' does not exist.`),d}};Object.assign(o,p);for(let h=0;h<o._features.length;h++){const d=o._features[h];d==null||d.createTable==null||d.createTable(o)}return o}function E1(){return e=>me(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(o,s,i){s===void 0&&(s=0);const c=[];for(let u=0;u<o.length;u++){const f=Qa(e,e._getRowId(o[u],u,i),o[u],u,s,void 0,i?.id);if(r.flatRows.push(f),r.rowsById[f.id]=f,c.push(f),e.options.getSubRows){var l;f.originalSubRows=e.options.getSubRows(o[u],u),(l=f.originalSubRows)!=null&&l.length&&(f.subRows=n(f.originalSubRows,s+1,f))}}return c};return r.rows=n(t),r},be(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function C1(e){const t=[],r=n=>{var o;t.push(n),(o=n.subRows)!=null&&o.length&&n.getIsExpanded()&&n.subRows.forEach(r)};return e.rows.forEach(r),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function S1(e,t,r){return r.options.filterFromLeafRows?T1(e,t,r):A1(e,t,r)}function T1(e,t,r){var n;const o=[],s={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,c=function(l,u){u===void 0&&(u=0);const f=[];for(let h=0;h<l.length;h++){var p;let d=l[h];const v=Qa(r,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(v.columnFilters=d.columnFilters,(p=d.subRows)!=null&&p.length&&u<i){if(v.subRows=c(d.subRows,u+1),d=v,t(d)&&!v.subRows.length){f.push(d),s[d.id]=d,o.push(d);continue}if(t(d)||v.subRows.length){f.push(d),s[d.id]=d,o.push(d);continue}}else d=v,t(d)&&(f.push(d),s[d.id]=d,o.push(d))}return f};return{rows:c(e),flatRows:o,rowsById:s}}function A1(e,t,r){var n;const o=[],s={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,c=function(l,u){u===void 0&&(u=0);const f=[];for(let h=0;h<l.length;h++){let d=l[h];if(t(d)){var p;if((p=d.subRows)!=null&&p.length&&u<i){const g=Qa(r,d.id,d.original,d.index,d.depth,void 0,d.parentId);g.subRows=c(d.subRows,u+1),d=g}f.push(d),o.push(d),s[d.id]=d}}return f};return{rows:c(e),flatRows:o,rowsById:s}}function N1(){return e=>me(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,n)=>{if(!t.rows.length||!(r!=null&&r.length)&&!n){for(let h=0;h<t.flatRows.length;h++)t.flatRows[h].columnFilters={},t.flatRows[h].columnFiltersMeta={};return t}const o=[],s=[];(r??[]).forEach(h=>{var d;const v=e.getColumn(h.id);if(!v)return;const g=v.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:h.id,filterFn:g,resolvedValue:(d=g.resolveFilterValue==null?void 0:g.resolveFilterValue(h.value))!=null?d:h.value})});const i=(r??[]).map(h=>h.id),c=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());n&&c&&l.length&&(i.push("__global__"),l.forEach(h=>{var d;s.push({id:h.id,filterFn:c,resolvedValue:(d=c.resolveFilterValue==null?void 0:c.resolveFilterValue(n))!=null?d:n})}));let u,f;for(let h=0;h<t.flatRows.length;h++){const d=t.flatRows[h];if(d.columnFilters={},o.length)for(let v=0;v<o.length;v++){u=o[v];const g=u.id;d.columnFilters[g]=u.filterFn(d,g,u.resolvedValue,b=>{d.columnFiltersMeta[g]=b})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const g=f.id;if(f.filterFn(d,g,f.resolvedValue,b=>{d.columnFiltersMeta[g]=b})){d.columnFilters.__global__=!0;break}}d.columnFilters.__global__!==!0&&(d.columnFilters.__global__=!1)}}const p=h=>{for(let d=0;d<i.length;d++)if(h.columnFilters[i[d]]===!1)return!1;return!0};return S1(t.rows,p,e)},be(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function I1(e){return t=>me(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(r,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:s}=r;let{rows:i,flatRows:c,rowsById:l}=n;const u=o*s,f=u+o;i=i.slice(u,f);let p;t.options.paginateExpandedRows?p={rows:i,flatRows:c,rowsById:l}:p=C1({rows:i,flatRows:c,rowsById:l}),p.flatRows=[];const h=d=>{p.flatRows.push(d),d.subRows.length&&d.subRows.forEach(h)};return p.rows.forEach(h),p},be(t.options,"debugTable","getPaginationRowModel"))}function M1(){return e=>me(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const n=e.getState().sorting,o=[],s=n.filter(l=>{var u;return(u=e.getColumn(l.id))==null?void 0:u.getCanSort()}),i={};s.forEach(l=>{const u=e.getColumn(l.id);u&&(i[l.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const c=l=>{const u=l.map(f=>({...f}));return u.sort((f,p)=>{for(let d=0;d<s.length;d+=1){var h;const v=s[d],g=i[v.id],b=g.sortUndefined,w=(h=v?.desc)!=null?h:!1;let m=0;if(b){const y=f.getValue(v.id),k=p.getValue(v.id),T=y===void 0,C=k===void 0;if(T||C){if(b==="first")return T?-1:1;if(b==="last")return T?1:-1;m=T&&C?0:T?b:-b}}if(m===0&&(m=g.sortingFn(f,p,v.id)),m!==0)return w&&(m*=-1),g.invertSorting&&(m*=-1),m}return f.index-p.index}),u.forEach(f=>{var p;o.push(f),(p=f.subRows)!=null&&p.length&&(f.subRows=c(f.subRows))}),u};return{rows:c(r.rows),flatRows:o,rowsById:r.rowsById}},be(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
19
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,r?.key)}return o}}function ke(e,t,r,a){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&r,onChange:a}}function b1(e,t,r,a){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(a),renderValue:o,getContext:ye(()=>[e,r,t,s],(i,c,l,d)=>({table:i,column:c,row:l,cell:d,getValue:d.getValue,renderValue:d.renderValue}),ke(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,r,t,e)},{}),s}function w1(e,t,r,a){var o,s;const c={...e._getDefaultColumnDef(),...t},l=c.accessorKey;let d=(o=(s=c.id)!=null?s:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,h;if(c.accessorFn?h=c.accessorFn:l&&(l.includes(".")?h=f=>{let u=f;for(const p of l.split(".")){var v;u=(v=u)==null?void 0:v[p],process.env.NODE_ENV!=="production"&&u===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return u}:h=f=>f[c.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(c.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(d)}`,accessorFn:h,parent:a,depth:r,columnDef:c,columns:[],getFlatColumns:ye(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(u=>u.getFlatColumns())]},ke(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ye(()=>[e._getOrderColumnsFn()],f=>{var u;if((u=g.columns)!=null&&u.length){let v=g.columns.flatMap(p=>p.getLeafColumns());return f(v)}return[g]},ke(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const St="debugHeaders";function Qi(e,t,r){var a;let s={id:(a=r.id)!=null?a:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],c=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(c),i.push(l)};return c(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const y1={createTable:e=>{e.getHeaderGroups=ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,a,o)=>{var s,i;const c=(s=a?.map(g=>r.find(f=>f.id===g)).filter(Boolean))!=null?s:[],l=(i=o?.map(g=>r.find(f=>f.id===g)).filter(Boolean))!=null?i:[],d=r.filter(g=>!(a!=null&&a.includes(g.id))&&!(o!=null&&o.includes(g.id)));return ca(t,[...c,...d,...l],e)},ke(e.options,St,"getHeaderGroups")),e.getCenterHeaderGroups=ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,a,o)=>(r=r.filter(s=>!(a!=null&&a.includes(s.id))&&!(o!=null&&o.includes(s.id))),ca(t,r,e,"center")),ke(e.options,St,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,a)=>{var o;const s=(o=a?.map(i=>r.find(c=>c.id===i)).filter(Boolean))!=null?o:[];return ca(t,s,e,"left")},ke(e.options,St,"getLeftHeaderGroups")),e.getRightHeaderGroups=ye(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,a)=>{var o;const s=(o=a?.map(i=>r.find(c=>c.id===i)).filter(Boolean))!=null?o:[];return ca(t,s,e,"right")},ke(e.options,St,"getRightHeaderGroups")),e.getFooterGroups=ye(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ke(e.options,St,"getFooterGroups")),e.getLeftFooterGroups=ye(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ke(e.options,St,"getLeftFooterGroups")),e.getCenterFooterGroups=ye(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ke(e.options,St,"getCenterFooterGroups")),e.getRightFooterGroups=ye(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ke(e.options,St,"getRightFooterGroups")),e.getFlatHeaders=ye(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),ke(e.options,St,"getFlatHeaders")),e.getLeftFlatHeaders=ye(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),ke(e.options,St,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ye(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),ke(e.options,St,"getCenterFlatHeaders")),e.getRightFlatHeaders=ye(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),ke(e.options,St,"getRightFlatHeaders")),e.getCenterLeafHeaders=ye(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),ke(e.options,St,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ye(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),ke(e.options,St,"getLeftLeafHeaders")),e.getRightLeafHeaders=ye(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),ke(e.options,St,"getRightLeafHeaders")),e.getLeafHeaders=ye(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,a)=>{var o,s,i,c,l,d;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(c=r[0])==null?void 0:c.headers)!=null?i:[],...(l=(d=a[0])==null?void 0:d.headers)!=null?l:[]].map(h=>h.getLeafHeaders()).flat()},ke(e.options,St,"getLeafHeaders"))}};function ca(e,t,r,a){var o,s;let i=0;const c=function(f,u){u===void 0&&(u=1),i=Math.max(i,u),f.filter(v=>v.getIsVisible()).forEach(v=>{var p;(p=v.columns)!=null&&p.length&&c(v.columns,u+1)},0)};c(e);let l=[];const d=(f,u)=>{const v={depth:u,id:[a,`${u}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(m=>{const w=[...p].reverse()[0],b=m.column.depth===v.depth;let y,E=!1;if(b&&m.column.parent?y=m.column.parent:(y=m.column,E=!0),w&&w?.column===y)w.subHeaders.push(m);else{const S=Qi(r,y,{id:[a,u,y.id,m?.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${p.filter(C=>C.column===y).length}`:void 0,depth:u,index:p.length});S.subHeaders.push(m),p.push(S)}v.headers.push(m),m.headerGroup=v}),l.push(v),u>0&&d(p,u-1)},h=t.map((f,u)=>Qi(r,f,{depth:i,index:u}));d(h,i-1),l.reverse();const g=f=>f.filter(v=>v.column.getIsVisible()).map(v=>{let p=0,m=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(y=>{let{colSpan:E,rowSpan:S}=y;p+=E,w.push(S)})):p=1;const b=Math.min(...w);return m=m+b,v.colSpan=p,v.rowSpan=m,{colSpan:p,rowSpan:m}});return g((o=(s=l[0])==null?void 0:s.headers)!=null?o:[]),l}const go=(e,t,r,a,o,s,i)=>{let c={id:t,index:a,original:r,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(c._valuesCache.hasOwnProperty(l))return c._valuesCache[l];const d=e.getColumn(l);if(d!=null&&d.accessorFn)return c._valuesCache[l]=d.accessorFn(c.original,a),c._valuesCache[l]},getUniqueValues:l=>{if(c._uniqueValuesCache.hasOwnProperty(l))return c._uniqueValuesCache[l];const d=e.getColumn(l);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(c._uniqueValuesCache[l]=d.columnDef.getUniqueValues(c.original,a),c._uniqueValuesCache[l]):(c._uniqueValuesCache[l]=[c.getValue(l)],c._uniqueValuesCache[l])},renderValue:l=>{var d;return(d=c.getValue(l))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>m1(c.subRows,l=>l.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let l=[],d=c;for(;;){const h=d.getParentRow();if(!h)break;l.push(h),d=h}return l.reverse()},getAllCells:ye(()=>[e.getAllLeafColumns()],l=>l.map(d=>b1(e,c,d,d.id)),ke(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ye(()=>[c.getAllCells()],l=>l.reduce((d,h)=>(d[h.column.id]=h,d),{}),ke(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const d=e._features[l];d==null||d.createRow==null||d.createRow(c,e)}return c},k1={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},ec=(e,t,r)=>{var a,o;const s=r==null||(a=r.toString())==null?void 0:a.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};ec.autoRemove=e=>Pt(e);const tc=(e,t,r)=>{var a;return!!(!((a=e.getValue(t))==null||(a=a.toString())==null)&&a.includes(r))};tc.autoRemove=e=>Pt(e);const rc=(e,t,r)=>{var a;return((a=e.getValue(t))==null||(a=a.toString())==null?void 0:a.toLowerCase())===r?.toLowerCase()};rc.autoRemove=e=>Pt(e);const nc=(e,t,r)=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)};nc.autoRemove=e=>Pt(e);const ac=(e,t,r)=>!r.some(a=>{var o;return!((o=e.getValue(t))!=null&&o.includes(a))});ac.autoRemove=e=>Pt(e)||!(e!=null&&e.length);const oc=(e,t,r)=>r.some(a=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(a)});oc.autoRemove=e=>Pt(e)||!(e!=null&&e.length);const sc=(e,t,r)=>e.getValue(t)===r;sc.autoRemove=e=>Pt(e);const ic=(e,t,r)=>e.getValue(t)==r;ic.autoRemove=e=>Pt(e);const vo=(e,t,r)=>{let[a,o]=r;const s=e.getValue(t);return s>=a&&s<=o};vo.resolveFilterValue=e=>{let[t,r]=e,a=typeof t!="number"?parseFloat(t):t,o=typeof r!="number"?parseFloat(r):r,s=t===null||Number.isNaN(a)?-1/0:a,i=r===null||Number.isNaN(o)?1/0:o;if(s>i){const c=s;s=i,i=c}return[s,i]},vo.autoRemove=e=>Pt(e)||Pt(e[0])&&Pt(e[1]);const Yt={includesString:ec,includesStringSensitive:tc,equalsString:rc,arrIncludes:nc,arrIncludesAll:ac,arrIncludesSome:oc,equals:sc,weakEquals:ic,inNumberRange:vo};function Pt(e){return e==null||e===""}const x1={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ot("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],a=r?.getValue(e.id);return typeof a=="string"?Yt.includesString:typeof a=="number"?Yt.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?Yt.equals:Array.isArray(a)?Yt.arrIncludes:Yt.weakEquals},e.getFilterFn=()=>{var r,a;return ia(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(a=t.options.filterFns)==null?void 0:a[e.columnDef.filterFn])!=null?r:Yt[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,a,o;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((a=t.options.enableColumnFilters)!=null?a:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(a=>a.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,a;return(r=(a=t.getState().columnFilters)==null?void 0:a.findIndex(o=>o.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(a=>{const o=e.getFilterFn(),s=a?.find(h=>h.id===e.id),i=ur(r,s?s.value:void 0);if(cc(o,i,e)){var c;return(c=a?.filter(h=>h.id!==e.id))!=null?c:[]}const l={id:e.id,value:i};if(s){var d;return(d=a?.map(h=>h.id===e.id?l:h))!=null?d:[]}return a!=null&&a.length?[...a,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),a=o=>{var s;return(s=ur(t,o))==null?void 0:s.filter(i=>{const c=r.find(l=>l.id===i.id);if(c){const l=c.getFilterFn();if(cc(l,i.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(a)},e.resetColumnFilters=t=>{var r,a;e.setColumnFilters(t?[]:(r=(a=e.initialState)==null?void 0:a.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function cc(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const mo={sum:(e,t,r)=>r.reduce((a,o)=>{const s=o.getValue(e);return a+(typeof s=="number"?s:0)},0),min:(e,t,r)=>{let a;return r.forEach(o=>{const s=o.getValue(e);s!=null&&(a>s||a===void 0&&s>=s)&&(a=s)}),a},max:(e,t,r)=>{let a;return r.forEach(o=>{const s=o.getValue(e);s!=null&&(a<s||a===void 0&&s>=s)&&(a=s)}),a},extent:(e,t,r)=>{let a,o;return r.forEach(s=>{const i=s.getValue(e);i!=null&&(a===void 0?i>=i&&(a=o=i):(a>i&&(a=i),o<i&&(o=i)))}),[a,o]},mean:(e,t)=>{let r=0,a=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++r,a+=s)}),r)return a/r},median:(e,t)=>{if(!t.length)return;const r=t.map(s=>s.getValue(e));if(!v1(r))return;if(r.length===1)return r[0];const a=Math.floor(r.length/2),o=r.sort((s,i)=>s-i);return r.length%2!==0?o[a]:(o[a-1]+o[a])/2},unique:(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(r=>r.getValue(e))).size,count:(e,t)=>t.length},E1={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ot("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(a=>a!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,a;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((a=t.options.enableGrouping)!=null?a:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],a=r?.getValue(e.id);if(typeof a=="number")return mo.sum;if(Object.prototype.toString.call(a)==="[object Date]")return mo.extent},e.getAggregationFn=()=>{var r,a;if(!e)throw new Error;return ia(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(a=t.options.aggregationFns)==null?void 0:a[e.columnDef.aggregationFn])!=null?r:mo[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,a;e.setGrouping(t?[]:(r=(a=e.initialState)==null?void 0:a.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const a=t.getColumn(r);return a!=null&&a.columnDef.getGroupingValue?(e._groupingValuesCache[r]=a.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,a)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=r.subRows)!=null&&o.length)}}};function C1(e,t,r){if(!(t!=null&&t.length)||!r)return e;const a=e.filter(s=>!t.includes(s.id));return r==="remove"?a:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...a]}const S1={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ot("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ye(r=>[dn(t,r)],r=>r.findIndex(a=>a.id===e.id),ke(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var a;return((a=dn(t,r)[0])==null?void 0:a.id)===e.id},e.getIsLastColumn=r=>{var a;const o=dn(t,r);return((a=o[o.length-1])==null?void 0:a.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=ye(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,a)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],c=[...o];for(;c.length&&i.length;){const l=i.shift(),d=c.findIndex(h=>h.id===l);d>-1&&s.push(c.splice(d,1)[0])}s=[...s,...c]}return C1(s,r,a)},ke(e.options,"debugTable","_getOrderColumnsFn"))}},bo=()=>({left:[],right:[]}),T1={getInitialState:e=>({columnPinning:bo(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ot("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const a=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(r==="right"){var c,l;return{left:((c=o?.left)!=null?c:[]).filter(g=>!(a!=null&&a.includes(g))),right:[...((l=o?.right)!=null?l:[]).filter(g=>!(a!=null&&a.includes(g))),...a]}}if(r==="left"){var d,h;return{left:[...((d=o?.left)!=null?d:[]).filter(g=>!(a!=null&&a.includes(g))),...a],right:((h=o?.right)!=null?h:[]).filter(g=>!(a!=null&&a.includes(g)))}}return{left:((s=o?.left)!=null?s:[]).filter(g=>!(a!=null&&a.includes(g))),right:((i=o?.right)!=null?i:[]).filter(g=>!(a!=null&&a.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(a=>{var o,s,i;return((o=a.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(c=>c.id),{left:a,right:o}=t.getState().columnPinning,s=r.some(c=>a?.includes(c)),i=r.some(c=>o?.includes(c));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var r,a;const o=e.getIsPinned();return o?(r=(a=t.getState().columnPinning)==null||(a=a[o])==null?void 0:a.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ye(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,a,o)=>{const s=[...a??[],...o??[]];return r.filter(i=>!s.includes(i.column.id))},ke(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ye(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,a)=>(a??[]).map(s=>r.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),ke(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ye(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,a)=>(a??[]).map(s=>r.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),ke(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,a;return e.setColumnPinning(t?bo():(r=(a=e.initialState)==null?void 0:a.columnPinning)!=null?r:bo())},e.getIsSomeColumnsPinned=t=>{var r;const a=e.getState().columnPinning;if(!t){var o,s;return!!((o=a.left)!=null&&o.length||(s=a.right)!=null&&s.length)}return!!((r=a[t])!=null&&r.length)},e.getLeftLeafColumns=ye(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(a=>t.find(o=>o.id===a)).filter(Boolean),ke(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ye(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(a=>t.find(o=>o.id===a)).filter(Boolean),ke(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ye(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,a)=>{const o=[...r??[],...a??[]];return t.filter(s=>!o.includes(s.id))},ke(e.options,"debugColumns","getCenterLeafColumns"))}};function A1(e){return e||(typeof document<"u"?document:null)}const la={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},wo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),N1={getDefaultColumnDef:()=>la,getInitialState:e=>({columnSizing:{},columnSizingInfo:wo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ot("columnSizing",e),onColumnSizingInfoChange:Ot("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,a,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:la.minSize,(a=s??e.columnDef.size)!=null?a:la.size),(o=e.columnDef.maxSize)!=null?o:la.maxSize)},e.getStart=ye(r=>[r,dn(t,r),t.getState().columnSizing],(r,a)=>a.slice(0,e.getIndex(r)).reduce((o,s)=>o+s.getSize(),0),ke(t.options,"debugColumns","getStart")),e.getAfter=ye(r=>[r,dn(t,r),t.getState().columnSizing],(r,a)=>a.slice(e.getIndex(r)+1).reduce((o,s)=>o+s.getSize(),0),ke(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:a,...o}=r;return o})},e.getCanResize=()=>{var r,a;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((a=t.options.enableColumnResizing)!=null?a:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let r=0;const a=o=>{if(o.subHeaders.length)o.subHeaders.forEach(a);else{var s;r+=(s=o.column.getSize())!=null?s:0}};return a(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const a=t.getColumn(e.column.id),o=a?.getCanResize();return s=>{if(!a||!o||(s.persist==null||s.persist(),yo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),c=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[a.id,a.getSize()]],l=yo(s)?Math.round(s.touches[0].clientX):s.clientX,d={},h=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(y=>{var E,S;const C=t.options.columnResizeDirection==="rtl"?-1:1,T=(b-((E=y?.startOffset)!=null?E:0))*C,F=Math.max(T/((S=y?.startSize)!=null?S:0),-.999999);return y.columnSizingStart.forEach(D=>{let[M,U]=D;d[M]=Math.round(Math.max(U+U*F,0)*100)/100}),{...y,deltaOffset:T,deltaPercentage:F}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(y=>({...y,...d})))},g=w=>h("move",w),f=w=>{h("end",w),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},u=A1(r),v={moveHandler:w=>g(w.clientX),upHandler:w=>{u?.removeEventListener("mousemove",v.moveHandler),u?.removeEventListener("mouseup",v.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var b;u?.removeEventListener("touchmove",p.moveHandler),u?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((b=w.touches[0])==null?void 0:b.clientX)}},m=I1()?{passive:!1}:!1;yo(s)?(u?.addEventListener("touchmove",p.moveHandler,m),u?.addEventListener("touchend",p.upHandler,m)):(u?.addEventListener("mousemove",v.moveHandler,m),u?.addEventListener("mouseup",v.upHandler,m)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:a.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?wo():(r=e.initialState.columnSizingInfo)!=null?r:wo())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((a,o)=>a+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((a,o)=>a+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((a,o)=>a+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((a,o)=>a+o.getSize(),0))!=null?t:0}}};let da=null;function I1(){if(typeof da=="boolean")return da;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return da=e,da}function yo(e){return e.type==="touchstart"}const M1={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ot("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(a=>({...a,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,a;const o=e.columns;return(r=o.length?o.some(s=>s.getIsVisible()):(a=t.getState().columnVisibility)==null?void 0:a[e.id])!=null?r:!0},e.getCanHide=()=>{var r,a;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((a=t.options.enableHiding)!=null?a:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ye(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(a=>a.column.getIsVisible()),ke(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ye(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,a,o)=>[...r,...a,...o],ke(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(r,a)=>ye(()=>[a(),a().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),ke(e.options,"debugColumns",r));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var a;e.setColumnVisibility(r?{}:(a=e.initialState.columnVisibility)!=null?a:{})},e.toggleAllColumnsVisible=r=>{var a;r=(a=r)!=null?a:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:r||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var a;e.toggleAllColumnsVisible((a=r.target)==null?void 0:a.checked)}}};function dn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const F1={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},$1={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ot("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const a=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,a,o,s;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableGlobalFilter)!=null?a:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Yt.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:a}=e.options;return ia(a)?a:a==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[a])!=null?t:Yt[a]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},O1={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ot("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var a,o;if(!t){e._queue(()=>{t=!0});return}if((a=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?a:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=a=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(a),e.toggleAllRowsExpanded=a=>{a??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=a=>{var o,s;e.setExpanded(a?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const a=e.getState().expanded;return a===!0||Object.values(a).some(Boolean)},e.getIsAllRowsExpanded=()=>{const a=e.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let a=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");a=Math.max(a,i.length)}),a},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded(a=>{var o;const s=a===!0?!0:!!(a!=null&&a[e.id]);let i={};if(a===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{i[c]=!0}):i=a,r=(o=r)!=null?o:!s,!s&&r)return{...i,[e.id]:!0};if(s&&!r){const{[e.id]:c,...l}=i;return l}return a})},e.getIsExpanded=()=>{var r;const a=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:a===!0||a?.[e.id])},e.getCanExpand=()=>{var r,a,o;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((a=t.options.enableExpanding)!=null?a:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,a=e;for(;r&&a.parentId;)a=t.getRow(a.parentId,!0),r=a.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},ko=0,xo=10,Eo=()=>({pageIndex:ko,pageSize:xo}),D1={getInitialState:e=>({...e,pagination:{...Eo(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ot("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var a,o;if(!t){e._queue(()=>{t=!0});return}if((a=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?a:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=a=>{const o=s=>ur(a,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=a=>{var o;e.setPagination(a?Eo():(o=e.initialState.pagination)!=null?o:Eo())},e.setPageIndex=a=>{e.setPagination(o=>{let s=ur(a,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=a=>{var o,s;e.setPageIndex(a?ko:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:ko)},e.resetPageSize=a=>{var o,s;e.setPageSize(a?xo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:xo)},e.setPageSize=a=>{e.setPagination(o=>{const s=Math.max(1,ur(a,o.pageSize)),i=o.pageSize*o.pageIndex,c=Math.floor(i/s);return{...o,pageIndex:c,pageSize:s}})},e.setPageCount=a=>e.setPagination(o=>{var s;let i=ur(a,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=ye(()=>[e.getPageCount()],a=>{let o=[];return a&&a>0&&(o=[...new Array(a)].fill(null).map((s,i)=>i)),o},ke(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:a}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:a<o-1},e.previousPage=()=>e.setPageIndex(a=>a-1),e.nextPage=()=>e.setPageIndex(a=>a+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var a;return(a=e.options.pageCount)!=null?a:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var a;return(a=e.options.rowCount)!=null?a:e.getPrePaginationRowModel().rows.length}}},Co=()=>({top:[],bottom:[]}),L1={getInitialState:e=>({rowPinning:Co(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ot("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,a,o)=>{const s=a?e.getLeafRows().map(l=>{let{id:d}=l;return d}):[],i=o?e.getParentRows().map(l=>{let{id:d}=l;return d}):[],c=new Set([...i,e.id,...s]);t.setRowPinning(l=>{var d,h;if(r==="bottom"){var g,f;return{top:((g=l?.top)!=null?g:[]).filter(p=>!(c!=null&&c.has(p))),bottom:[...((f=l?.bottom)!=null?f:[]).filter(p=>!(c!=null&&c.has(p))),...Array.from(c)]}}if(r==="top"){var u,v;return{top:[...((u=l?.top)!=null?u:[]).filter(p=>!(c!=null&&c.has(p))),...Array.from(c)],bottom:((v=l?.bottom)!=null?v:[]).filter(p=>!(c!=null&&c.has(p)))}}return{top:((d=l?.top)!=null?d:[]).filter(p=>!(c!=null&&c.has(p))),bottom:((h=l?.bottom)!=null?h:[]).filter(p=>!(c!=null&&c.has(p)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:a,enablePinning:o}=t.options;return typeof a=="function"?a(e):(r=a??o)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:a,bottom:o}=t.getState().rowPinning,s=r.some(c=>a?.includes(c)),i=r.some(c=>o?.includes(c));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var r,a;const o=e.getIsPinned();if(!o)return-1;const s=(r=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:r.map(i=>{let{id:c}=i;return c});return(a=s?.indexOf(e.id))!=null?a:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,a;return e.setRowPinning(t?Co():(r=(a=e.initialState)==null?void 0:a.rowPinning)!=null?r:Co())},e.getIsSomeRowsPinned=t=>{var r;const a=e.getState().rowPinning;if(!t){var o,s;return!!((o=a.top)!=null&&o.length||(s=a.bottom)!=null&&s.length)}return!!((r=a[t])!=null&&r.length)},e._getPinnedRows=(t,r,a)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(i=>{const c=e.getRow(i,!0);return c.getIsAllParentsExpanded()?c:null}):(r??[]).map(i=>t.find(c=>c.id===i))).filter(Boolean).map(i=>({...i,position:a}))},e.getTopRows=ye(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),ke(e.options,"debugRows","getTopRows")),e.getBottomRows=ye(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),ke(e.options,"debugRows","getBottomRows")),e.getCenterRows=ye(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,a)=>{const o=new Set([...r??[],...a??[]]);return t.filter(s=>!o.has(s.id))},ke(e.options,"debugRows","getCenterRows"))}},P1={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ot("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const a={...r},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(a[s.id]=!0)}):o.forEach(s=>{delete a[s.id]}),a})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const a=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach(s=>{So(o,s.id,a,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ye(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?To(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ye(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?To(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ye(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?To(e,r):{rows:[],flatRows:[],rowsById:{}},ke(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let a=!!(t.length&&Object.keys(r).length);return a&&t.some(o=>o.getCanSelect()&&!r[o.id])&&(a=!1),a},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:r}=e.getState();let a=!!t.length;return a&&t.some(o=>!r[o.id])&&(a=!1),a},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,a)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(r=typeof r<"u"?r:!o,e.getCanSelect()&&o===r)return s;const c={...s};return So(c,e.id,r,(i=a?.selectChildren)!=null?i:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return Ao(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return No(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return No(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return a=>{var o;r&&e.toggleSelected((o=a.target)==null?void 0:o.checked)}}}},So=(e,t,r,a,o)=>{var s;const i=o.getRow(t,!0);r?(i.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),i.getCanSelect()&&(e[t]=!0)):delete e[t],a&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(c=>So(e,c.id,r,a,o))};function To(e,t){const r=e.getState().rowSelection,a=[],o={},s=function(i,c){return i.map(l=>{var d;const h=Ao(l,r);if(h&&(a.push(l),o[l.id]=l),(d=l.subRows)!=null&&d.length&&(l={...l,subRows:s(l.subRows)}),h)return l}).filter(Boolean)};return{rows:s(t.rows),flatRows:a,rowsById:o}}function Ao(e,t){var r;return(r=t[e.id])!=null?r:!1}function No(e,t,r){var a;if(!((a=e.subRows)!=null&&a.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Ao(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const c=No(i,t);c==="all"?s=!0:(c==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Io=/([0-9]+)/gm,z1=(e,t,r)=>lc(fr(e.getValue(r)).toLowerCase(),fr(t.getValue(r)).toLowerCase()),B1=(e,t,r)=>lc(fr(e.getValue(r)),fr(t.getValue(r))),V1=(e,t,r)=>Mo(fr(e.getValue(r)).toLowerCase(),fr(t.getValue(r)).toLowerCase()),j1=(e,t,r)=>Mo(fr(e.getValue(r)),fr(t.getValue(r))),H1=(e,t,r)=>{const a=e.getValue(r),o=t.getValue(r);return a>o?1:a<o?-1:0},U1=(e,t,r)=>Mo(e.getValue(r),t.getValue(r));function Mo(e,t){return e===t?0:e>t?1:-1}function fr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function lc(e,t){const r=e.split(Io).filter(Boolean),a=t.split(Io).filter(Boolean);for(;r.length&&a.length;){const o=r.shift(),s=a.shift(),i=parseInt(o,10),c=parseInt(s,10),l=[i,c].sort();if(isNaN(l[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(l[1]))return isNaN(i)?-1:1;if(i>c)return 1;if(c>i)return-1}return r.length-a.length}const un={alphanumeric:z1,alphanumericCaseSensitive:B1,text:V1,textCaseSensitive:j1,datetime:H1,basic:U1},W1=[y1,M1,S1,T1,k1,x1,F1,$1,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ot("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const o of r){const s=o?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return un.datetime;if(typeof s=="string"&&(a=!0,s.split(Io).length>1))return un.alphanumeric}return a?un.text:un.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,a;if(!e)throw new Error;return ia(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(a=t.options.sortingFns)==null?void 0:a[e.columnDef.sortingFn])!=null?r:un[e.columnDef.sortingFn]},e.toggleSorting=(r,a)=>{const o=e.getNextSortingOrder(),s=typeof r<"u"&&r!==null;t.setSorting(i=>{const c=i?.find(u=>u.id===e.id),l=i?.findIndex(u=>u.id===e.id);let d=[],h,g=s?r:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&a?c?h="toggle":h="add":i!=null&&i.length&&l!==i.length-1?h="replace":c?h="toggle":h="replace",h==="toggle"&&(s||o||(h="remove")),h==="add"){var f;d=[...i,{id:e.id,desc:g}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else h==="toggle"?d=i.map(u=>u.id===e.id?{...u,desc:g}:u):h==="remove"?d=i.filter(u=>u.id!==e.id):d=[{id:e.id,desc:g}];return d})},e.getFirstSortDir=()=>{var r,a;return((r=(a=e.columnDef.sortDescFirst)!=null?a:t.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var a,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((a=t.options.enableSortingRemoval)==null||a)&&(!(r&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var r,a;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((a=t.options.enableSorting)!=null?a:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,a;return(r=(a=e.columnDef.enableMultiSort)!=null?a:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const a=(r=t.getState().sorting)==null?void 0:r.find(o=>o.id===e.id);return a?a.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,a;return(r=(a=t.getState().sorting)==null?void 0:a.findIndex(o=>o.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.setSorting(r=>r!=null&&r.length?r.filter(a=>a.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return a=>{r&&(a.persist==null||a.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(a):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,a;e.setSorting(t?[]:(r=(a=e.initialState)==null?void 0:a.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},E1,O1,D1,L1,P1,N1];function q1(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const a=[...W1,...(t=e._features)!=null?t:[]];let o={_features:a};const s=o._features.reduce((f,u)=>Object.assign(f,u.getDefaultOptions==null?void 0:u.getDefaultOptions(o)),{}),i=f=>o.options.mergeOptions?o.options.mergeOptions(s,f):{...s,...f};let l={...{},...(r=e.initialState)!=null?r:{}};o._features.forEach(f=>{var u;l=(u=f.getInitialState==null?void 0:f.getInitialState(l))!=null?u:l});const d=[];let h=!1;const g={_features:a,options:{...s,...e},initialState:l,_queue:f=>{d.push(f),h||(h=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();h=!1}).catch(u=>setTimeout(()=>{throw u})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const u=ur(f,o.options);o.options=i(u)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,u,v)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(f,u,v))!=null?p:`${v?[v.id,u].join("."):u}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,u)=>{let v=(u?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!v&&(v=o.getCoreRowModel().rowsById[f],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return v},_getDefaultColumnDef:ye(()=>[o.options.defaultColumn],f=>{var u;return f=(u=f)!=null?u:{},{header:v=>{const p=v.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:v=>{var p,m;return(p=(m=v.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((v,p)=>Object.assign(v,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},ke(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ye(()=>[o._getColumnDefs()],f=>{const u=function(v,p,m){return m===void 0&&(m=0),v.map(w=>{const b=w1(o,w,m,p),y=w;return b.columns=y.columns?u(y.columns,b,m+1):[],b})};return u(f)},ke(e,"debugColumns","getAllColumns")),getAllFlatColumns:ye(()=>[o.getAllColumns()],f=>f.flatMap(u=>u.getFlatColumns()),ke(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ye(()=>[o.getAllFlatColumns()],f=>f.reduce((u,v)=>(u[v.id]=v,u),{}),ke(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ye(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,u)=>{let v=f.flatMap(p=>p.getLeafColumns());return u(v)},ke(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const u=o._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!u&&console.error(`[Table] Column with id '${f}' does not exist.`),u}};Object.assign(o,g);for(let f=0;f<o._features.length;f++){const u=o._features[f];u==null||u.createTable==null||u.createTable(o)}return o}function G1(){return e=>ye(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},a=function(o,s,i){s===void 0&&(s=0);const c=[];for(let d=0;d<o.length;d++){const h=go(e,e._getRowId(o[d],d,i),o[d],d,s,void 0,i?.id);if(r.flatRows.push(h),r.rowsById[h.id]=h,c.push(h),e.options.getSubRows){var l;h.originalSubRows=e.options.getSubRows(o[d],d),(l=h.originalSubRows)!=null&&l.length&&(h.subRows=a(h.originalSubRows,s+1,h))}}return c};return r.rows=a(t),r},ke(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function R1(e){const t=[],r=a=>{var o;t.push(a),(o=a.subRows)!=null&&o.length&&a.getIsExpanded()&&a.subRows.forEach(r)};return e.rows.forEach(r),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function X1(e,t,r){return r.options.filterFromLeafRows?K1(e,t,r):Y1(e,t,r)}function K1(e,t,r){var a;const o=[],s={},i=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,c=function(l,d){d===void 0&&(d=0);const h=[];for(let f=0;f<l.length;f++){var g;let u=l[f];const v=go(r,u.id,u.original,u.index,u.depth,void 0,u.parentId);if(v.columnFilters=u.columnFilters,(g=u.subRows)!=null&&g.length&&d<i){if(v.subRows=c(u.subRows,d+1),u=v,t(u)&&!v.subRows.length){h.push(u),s[u.id]=u,o.push(u);continue}if(t(u)||v.subRows.length){h.push(u),s[u.id]=u,o.push(u);continue}}else u=v,t(u)&&(h.push(u),s[u.id]=u,o.push(u))}return h};return{rows:c(e),flatRows:o,rowsById:s}}function Y1(e,t,r){var a;const o=[],s={},i=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,c=function(l,d){d===void 0&&(d=0);const h=[];for(let f=0;f<l.length;f++){let u=l[f];if(t(u)){var g;if((g=u.subRows)!=null&&g.length&&d<i){const p=go(r,u.id,u.original,u.index,u.depth,void 0,u.parentId);p.subRows=c(u.subRows,d+1),u=p}h.push(u),o.push(u),s[u.id]=u}}return h};return{rows:c(e),flatRows:o,rowsById:s}}function Z1(){return e=>ye(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,a)=>{if(!t.rows.length||!(r!=null&&r.length)&&!a){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],s=[];(r??[]).forEach(f=>{var u;const v=e.getColumn(f.id);if(!v)return;const p=v.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:f.id,filterFn:p,resolvedValue:(u=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?u:f.value})});const i=(r??[]).map(f=>f.id),c=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());a&&c&&l.length&&(i.push("__global__"),l.forEach(f=>{var u;s.push({id:f.id,filterFn:c,resolvedValue:(u=c.resolveFilterValue==null?void 0:c.resolveFilterValue(a))!=null?u:a})}));let d,h;for(let f=0;f<t.flatRows.length;f++){const u=t.flatRows[f];if(u.columnFilters={},o.length)for(let v=0;v<o.length;v++){d=o[v];const p=d.id;u.columnFilters[p]=d.filterFn(u,p,d.resolvedValue,m=>{u.columnFiltersMeta[p]=m})}if(s.length){for(let v=0;v<s.length;v++){h=s[v];const p=h.id;if(h.filterFn(u,p,h.resolvedValue,m=>{u.columnFiltersMeta[p]=m})){u.columnFilters.__global__=!0;break}}u.columnFilters.__global__!==!0&&(u.columnFilters.__global__=!1)}}const g=f=>{for(let u=0;u<i.length;u++)if(f.columnFilters[i[u]]===!1)return!1;return!0};return X1(t.rows,g,e)},ke(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function J1(e){return t=>ye(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(r,a)=>{if(!a.rows.length)return a;const{pageSize:o,pageIndex:s}=r;let{rows:i,flatRows:c,rowsById:l}=a;const d=o*s,h=d+o;i=i.slice(d,h);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:c,rowsById:l}:g=R1({rows:i,flatRows:c,rowsById:l}),g.flatRows=[];const f=u=>{g.flatRows.push(u),u.subRows.length&&u.subRows.forEach(f)};return g.rows.forEach(f),g},ke(t.options,"debugTable","getPaginationRowModel"))}function Q1(){return e=>ye(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const a=e.getState().sorting,o=[],s=a.filter(l=>{var d;return(d=e.getColumn(l.id))==null?void 0:d.getCanSort()}),i={};s.forEach(l=>{const d=e.getColumn(l.id);d&&(i[l.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const c=l=>{const d=l.map(h=>({...h}));return d.sort((h,g)=>{for(let u=0;u<s.length;u+=1){var f;const v=s[u],p=i[v.id],m=p.sortUndefined,w=(f=v?.desc)!=null?f:!1;let b=0;if(m){const y=h.getValue(v.id),E=g.getValue(v.id),S=y===void 0,C=E===void 0;if(S||C){if(m==="first")return S?-1:1;if(m==="last")return S?1:-1;b=S&&C?0:S?m:-m}}if(b===0&&(b=p.sortingFn(h,g,v.id)),b!==0)return w&&(b*=-1),p.invertSorting&&(b*=-1),b}return h.index-g.index}),d.forEach(h=>{var g;o.push(h),(g=h.subRows)!=null&&g.length&&(h.subRows=c(h.subRows))}),d};return{rows:c(r.rows),flatRows:o,rowsById:r.rowsById}},ke(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
20
20
  * react-table
21
21
  *
22
22
  * Copyright (c) TanStack
@@ -25,7 +25,7 @@
25
25
  * LICENSE.md file in the root directory of this source tree.
26
26
  *
27
27
  * @license MIT
28
- */function Nr(e,t){return e?F1(e)?z.createElement(e,t):e:null}function F1(e){return O1(e)||typeof e=="function"||$1(e)}function O1(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function $1(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function D1(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=z.useState(()=>({current:k1(t)})),[n,o]=z.useState(()=>r.current.initialState);return r.current.setOptions(s=>({...s,...e,state:{...n,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),r.current}const Oe={checkbox_container:"_checkbox_container_3c4gu_1",checkbox_wrapper:"_checkbox_wrapper_3c4gu_13",label_text:"_label_text_3c4gu_33",hint_text:"_hint_text_3c4gu_51",checkbox:"_checkbox_3c4gu_1",input:"_input_3c4gu_99",checkbox_svg:"_checkbox_svg_3c4gu_153",custom_icon:"_custom_icon_3c4gu_195",checked:"_checked_3c4gu_225",indeterminate:"_indeterminate_3c4gu_227",radius_none:"_radius_none_3c4gu_235",radius_sm:"_radius_sm_3c4gu_243",radius_md:"_radius_md_3c4gu_251",radius_lg:"_radius_lg_3c4gu_259",radius_full:"_radius_full_3c4gu_267",sm:"_sm_3c4gu_275",lg:"_lg_3c4gu_301",secondary:"_secondary_3c4gu_327",success:"_success_3c4gu_335",warning:"_warning_3c4gu_343",danger:"_danger_3c4gu_351",solid:"_solid_3c4gu_377",outline:"_outline_3c4gu_391",disabled:"_disabled_3c4gu_439",readonly:"_readonly_3c4gu_509",no_animation:"_no_animation_3c4gu_589",line_through:"_line_through_3c4gu_607",lineThrough:"_lineThrough_3c4gu_1",checkbox_group:"_checkbox_group_3c4gu_651",label:"_label_3c4gu_33",marca_requerido:"_marca_requerido_3c4gu_679",description:"_description_3c4gu_687",checkboxes:"_checkboxes_3c4gu_701",vertical:"_vertical_3c4gu_711",horizontal:"_horizontal_3c4gu_719",grid:"_grid_3c4gu_727",error_message:"_error_message_3c4gu_737",invalid:"_invalid_3c4gu_749"},qi=_.createContext(null),Ri=()=>_.useContext(qi),Ir=_.forwardRef((e,t)=>{const{children:r,label:n,hint:o,isSelected:s,defaultChecked:i,isIndeterminate:c=!1,isDisabled:l=!1,isReadOnly:u=!1,isRequired:f=!1,lineThrough:p=!1,onlyIcon:h=!1,disableAnimation:d=!1,customCheckIcon:v,size:g="md",color:b="primary",customColor:w,radius:m="md",variant:y="solid",className:k="",classNames:T={},onChange:C,value:S,name:M,id:D,...O}=e,H=Ri(),V=_.useId(),N=D||V,x=_.useRef(null),A=s!==void 0,[$,F]=_.useState(i??!1),E=!!H,I=E&&S?H.value.includes(S):!1,L=E?I:A?s:$,R=!!H?.maxSelectionReached&&!L,j=l||H?.isDisabled||R,P=u||H?.isReadOnly,U=H?!1:f,B=M||H?.name,q=o?`${N}-hint`:void 0;_.useEffect(()=>{const Q=x.current||(t&&typeof t=="object"?t.current:null);Q&&(Q.indeterminate=c??!1)},[c,t]);const X=Q=>{if(j||P)return;const oe=Q.target.checked;E&&S?H.onChange(S):(A||F(oe),C?.(oe))},Y=n||r;return a.jsxs("div",{className:te(Oe.checkbox_container,{[Oe.disabled]:j,[Oe.readonly]:P},T.base,k),children:[a.jsxs("label",{className:te(Oe.checkbox_wrapper,Oe[g],!w&&Oe[b],Oe[y],Oe[`radius_${m}`],{[Oe.checked]:L,[Oe.indeterminate]:c,[Oe.disabled]:j,[Oe.readonly]:P,[Oe.line_through]:p&&L,[Oe.no_animation]:d}),style:w?{"--checkbox-custom-color":w}:void 0,children:[a.jsxs("span",{className:Oe.checkbox,children:[a.jsx("input",{"data-testid":B?`checkbox-${B}${S?`-${S}`:""}`:N,...O,ref:Q=>{x.current=Q,typeof t=="function"?t(Q):t&&(t.current=Q)},id:N,type:"checkbox",className:Oe.input,checked:L,onChange:X,disabled:j,readOnly:P,required:U,"aria-required":U||void 0,"aria-describedby":q,value:S,name:B}),v?a.jsx("span",{className:Oe.custom_icon,children:v}):a.jsx("svg",{className:Oe.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:a.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:c?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!h&&Y&&a.jsx("span",{className:te(Oe.label_text,T.label),children:Y})]}),o&&a.jsx("span",{id:q,className:te(Oe.hint_text,T.label),children:o})]})});Ir.displayName="Checkbox";const Ki=({label:e,children:t,description:r,errorMessage:n,isInvalid:o=!1,orientation:s="vertical",className:i,value:c,defaultValue:l=[],onChange:u,isDisabled:f=!1,isReadOnly:p=!1,isRequired:h=!1,minSelection:d,maxSelection:v,requiredMessage:g,name:b,options:w,optionValueKey:m,optionLabelKey:y,optionDisabledKey:k,optionDescriptionKey:T,columns:C,id:S,"data-testid":M})=>{const D=c!==void 0,[O,H]=_.useState(l),V=D?c:O,N=_.useRef(null),x=_.useId(),A=S??`checkbox-group-${x}`,$=e?`${A}-label`:void 0,F=r?`${A}-desc`:void 0,E=o&&n?`${A}-err`:void 0,I=[F,E].filter(Boolean).join(" ")||void 0,L=h?d??1:d??0,R=v!==void 0&&V.length>=v;_.useEffect(()=>{if(!N.current||L===0)return;L-V.length<=0?N.current.setCustomValidity(""):N.current.setCustomValidity(g??(L===1?"Selecciona al menos una opción":`Selecciona al menos ${L} opciones`))},[V,L,g]);const j=U=>{if(f||p)return;const B=V.includes(U);if(!B&&R)return;const q=B?V.filter(X=>X!==U):[...V,U];D||H(q),u?.(q)},P=a.jsx("input",{ref:N,type:"checkbox",required:!0,checked:V.length>=L,onChange:()=>{},"aria-hidden":"true",tabIndex:-1,style:{height:"1px",left:0,opacity:0,pointerEvents:"none",position:"absolute",top:"100%",width:"1px"}});return a.jsxs("div",{className:te(Oe.checkbox_group,Oe[s],{[Oe.invalid]:o,[Oe.disabled]:f,[Oe.readonly]:p},i),id:A,role:"group","aria-required":h||L>0,"aria-invalid":o,"aria-labelledby":$,"aria-describedby":I,"data-testid":M??(b?`checkbox-group-${b}`:A),children:[L>0&&!e&&P,e&&a.jsxs("div",{id:$,className:Oe.label,style:{position:"relative"},children:[e,(h||L>0)&&a.jsx("span",{className:Oe.marca_requerido,children:" *"}),L>0&&P]}),r&&a.jsx("div",{id:F,className:Oe.description,children:r}),a.jsx(qi.Provider,{value:{value:V,onChange:j,isDisabled:f,isReadOnly:p,isRequired:h,name:b,maxSelectionReached:R},children:a.jsx("div",{className:te(Oe.checkboxes,!C&&Oe[s],C&&Oe.grid),style:C?{gridTemplateColumns:typeof C=="number"?`repeat(${C}, 1fr)`:C}:void 0,children:w&&w.length>0?w.map((U,B)=>{let q,X,Y=!1,Q;if(typeof U=="object"&&U!==null){const oe=m??"value",se=y??"label",ne=k??"isDisabled",ie=T??"description",ae=U[oe];q=String(ae!==void 0?ae:B),X=U[se];const fe=U[ne];Y=typeof fe=="boolean"?fe:!1;const de=U[ie];Q=typeof de=="string"?de:void 0}else q=String(U),X=U;return a.jsx(Ir,{value:q,isDisabled:Y,hint:Q,children:X},q)}):t})}),n&&o&&a.jsx("div",{id:E,className:Oe.error_message,role:"alert",children:n})]})};Ki.displayName="CheckboxGroup";const go=_.createContext(null),vo=()=>{const e=_.useContext(go);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Yr=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,Xi=e=>e.type==="checkbox",Yi=e=>e.type==="radio",Zi=e=>e.type==="separator",Ji=e=>e.type==="label",Se={menu:"_menu_1fn41_1",variant_default:"_variant_default_1fn41_55",variant_elevated:"_variant_elevated_1fn41_65",variant_bordered:"_variant_bordered_1fn41_75",variant_glass:"_variant_glass_1fn41_89",size_sm:"_size_sm_1fn41_103",size_md:"_size_md_1fn41_119",size_lg:"_size_lg_1fn41_133",item:"_item_1fn41_149",disabled:"_disabled_1fn41_207",active:"_active_1fn41_209",loading:"_loading_1fn41_255",spinner_item:"_spinner_item_1fn41_267",spinItem:"_spinItem_1fn41_1",danger:"_danger_1fn41_299",has_submenu:"_has_submenu_1fn41_313",submenu_open:"_submenu_open_1fn41_321",indicator:"_indicator_1fn41_329",start_icon:"_start_icon_1fn41_361",content:"_content_1fn41_409",label_text:"_label_text_1fn41_429",description:"_description_1fn41_443",shortcut:"_shortcut_1fn41_461",end_icon:"_end_icon_1fn41_485",submenu_arrow:"_submenu_arrow_1fn41_519",separator:"_separator_1fn41_555",label:"_label_1fn41_429",context_menu_trigger:"_context_menu_trigger_1fn41_663"},L1=()=>a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),P1=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),z1=({marcado:e})=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&a.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),mo=_.forwardRef(({item:e,index:t,activeIndex:r,getItemProps:n},o)=>{const s=vo();if(Zi(e))return a.jsx("div",{className:te(Se.separator,s.classNames?.separator),role:"separator"});if(Ji(e))return a.jsx("div",{className:te(Se.label,s.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const i=t===r,c=Xi(e),l=Yi(e),u=S=>{"isDisabled"in e&&e.isDisabled||(c?e.onCheckedChange?.(!e.isChecked):l&&s.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(S),s.closeOnSelect&&!Yr(e)&&s.cerrarMenu())},f=S=>{u(S)},p=S=>{"isDisabled"in e&&e.isDisabled||(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),u(S))},h=c?e.isChecked:!1,d=l?s.radioValue===e.value:!1,v="label"in e?e.label:void 0,g="description"in e?e.description:void 0,b="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,m="endIcon"in e?e.endIcon:void 0,y="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,T="isDanger"in e?e.isDanger:!1,C="className"in e?e.className:void 0;return a.jsxs("div",{ref:o,role:c?"menuitemcheckbox":l?"menuitemradio":"menuitem","aria-checked":c?h:l?d:void 0,"aria-disabled":y||k,tabIndex:i?0:-1,className:te(Se.item,Se[`size_${s.size}`],i&&Se.active,y&&Se.disabled,k&&Se.loading,T&&Se.danger,Yr(e)&&Se.has_submenu,C,s.classNames?.item),...n({onClick:f,onKeyDown:p}),children:[k?a.jsx("span",{className:Se.indicator,children:a.jsx("span",{className:Se.spinner_item})}):(c||l)&&a.jsxs("span",{className:Se.indicator,children:[c&&h&&a.jsx(L1,{}),l&&a.jsx(z1,{marcado:d})]}),!k&&w&&a.jsx("span",{className:Se.start_icon,children:w}),a.jsxs("span",{className:Se.content,children:[a.jsx("span",{className:Se.label_text,children:v}),g&&a.jsx("span",{className:Se.description,children:g})]}),b&&a.jsx("kbd",{className:Se.shortcut,children:b}),m&&a.jsx("span",{className:Se.end_icon,children:m}),Yr(e)&&a.jsx("span",{className:Se.submenu_arrow,children:a.jsx(P1,{})})]})});mo.displayName="MenuItem";const B1=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),Qn=({items:e,activeIndex:t,getItemProps:r,listRef:n})=>a.jsx(a.Fragment,{children:(e??[]).map((o,s)=>Yr(o)?a.jsx(bo,{ref:i=>{n.current[s]=i},item:o,index:s,activeIndex:t,getItemProps:r},o.id):a.jsx(mo,{ref:i=>{n.current[s]=i},item:o,index:s,activeIndex:t,getItemProps:r},o.id))});Qn.displayName="MenuList";const bo=_.forwardRef(({item:e,index:t,activeIndex:r,getItemProps:n},o)=>{const s=vo(),[i,c]=_.useState(!1),l=_r(),u=Zs(),f=_.useRef([]),[p,h]=_.useState(null),{refs:d,floatingStyles:v,context:g,isPositioned:b}=Hn({nodeId:u,open:i,onOpenChange:c,placement:"right-start",middleware:[Mn({mainAxis:4,alignmentAxis:-4}),On(),Fn({padding:8})],whileElementsMounted:An}),{isMounted:w,styles:m}=Rn(g,{duration:s.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:s.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),y=ja(g,{enabled:!e.isDisabled,delay:{open:75},handleClose:wi({blockPointerEvents:!0})}),k=qn(g,{role:"menu"}),T=jn(g,{bubbles:!0}),C=Xa(g,{listRef:f,activeIndex:p,onNavigate:h,nested:!0}),{getReferenceProps:S,getFloatingProps:M,getItemProps:D}=Un([y,k,T,C]);_.useEffect(()=>{if(!l)return;const V=()=>c(!1);return l.events.on("click",V),()=>{l.events.off("click",V)}},[l]);const O=t===r,H=za([d.setReference,o]);return a.jsxs(Js,{id:u,children:[a.jsxs("div",{ref:H,role:"menuitem","aria-haspopup":"menu","aria-expanded":i,"aria-disabled":e.isDisabled,tabIndex:O?0:-1,className:te(Se.item,Se[`size_${s.size}`],O&&Se.active,e.isDisabled&&Se.disabled,e.isDanger&&Se.danger,Se.has_submenu,i&&Se.submenu_open,e.className,s.classNames?.item),...S(n()),children:[e.startIcon&&a.jsx("span",{className:Se.start_icon,children:e.startIcon}),a.jsxs("span",{className:Se.content,children:[a.jsx("span",{className:Se.label_text,children:e.label}),e.description&&a.jsx("span",{className:Se.description,children:e.description})]}),e.shortcut&&a.jsx("kbd",{className:Se.shortcut,children:e.shortcut}),a.jsx("span",{className:Se.submenu_arrow,children:a.jsx(B1,{})})]}),w&&a.jsx(Vn,{root:s.portalContainer,children:a.jsx(Ga,{context:g,modal:!1,initialFocus:-1,returnFocus:!1,children:a.jsx("div",{ref:d.setFloating,style:{...v,pointerEvents:"none",zIndex:s.zIndex??"var(--z-dropdown)"},children:a.jsx("div",{className:te(Se.menu,Se[`variant_${s.variant}`],s.classNames?.menu),style:{...m,pointerEvents:"auto",visibility:b||!i?"visible":"hidden"},...M(),children:a.jsx(Qn,{items:e.children,activeIndex:p,getItemProps:D,listRef:f})})})})})]})});bo.displayName="Submenu";const Qi=_.forwardRef(({children:e,items:t,triggerAction:r="click",placement:n="bottom-start",variant:o="default",size:s="md",isDisabled:i=!1,offset:c=4,minWidth:l="180px",matchTriggerWidth:u=!1,disableAnimation:f=!1,closeOnClickOutside:p=!0,closeOnEscape:h=!0,closeOnSelect:d=!0,className:v,classNames:g,style:b,onOpen:w,onClose:m,onOpenChange:y,onContextMenu:k,isOpen:T,zIndex:C,portalContainer:S,radioValue:M,onRadioChange:D},O)=>{const[H,V]=_.useState(!1),[N,x]=_.useState(null),[A,$]=_.useState(0),F=_.useRef([]),E=_.useRef([]),I=Zs(),L=T!==void 0,R=L?T:H,j=_.useCallback(ee=>{i&&ee||(L||V(ee),y?.(ee),ee?w?.():m?.())},[i,L,y,w,m]);_.useEffect(()=>{E.current=(t??[]).filter(ee=>ee.type!=="separator"&&ee.type!=="label").map(ee=>"label"in ee&&typeof ee.label=="string"?ee.label:"")},[t]);const{refs:P,floatingStyles:U,context:B,isPositioned:q}=Hn({nodeId:I,open:R,onOpenChange:j,placement:n,strategy:"fixed",middleware:[Mn(c),On({fallbackAxisSideDirection:"start",padding:8}),Fn({padding:8}),u?Hs({apply({rects:ee,elements:J}){Object.assign(J.floating.style,{minWidth:`${ee.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:(ee,J,ce)=>An(ee,J,ce,{animationFrame:!1})}),X=fi(B,{enabled:!i&&(r==="click"||r==="both"),toggle:!0}),Y=ja(B,{enabled:!i&&r==="hover",delay:{open:150,close:150},handleClose:wi()}),Q=jn(B,{enabled:h||p,escapeKey:h,outsidePress:p}),oe=qn(B,{role:"menu"}),se=Xa(B,{listRef:F,activeIndex:N,onNavigate:x,loop:!0}),ne=vi(B,{listRef:E,activeIndex:N,onMatch:x,enabled:R}),{getReferenceProps:ie,getFloatingProps:ae,getItemProps:fe}=Un([X,Y,Q,oe,se,ne]),{isMounted:de,styles:Z}=Rn(B,{duration:f?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:f?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});_.useImperativeHandle(O,()=>({open:()=>j(!0),close:()=>j(!1),toggle:()=>j(!R),isOpen:R}),[j,R]);const ue=_.useMemo(()=>({radioValue:M,onRadioChange:D,cerrarMenu:()=>j(!1),closeOnSelect:d,size:s,variant:o,disableAnimation:f,classNames:g,portalContainer:S,zIndex:C}),[M,D,j,d,s,o,f,g,S,C]),pe=_.isValidElement(e)?e:null,he=za([P.setReference,pe?$i(pe):null]);if(!pe)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const we=r==="contextmenu"||r==="both"?{onContextMenu:ee=>{ee.preventDefault();const J={x:ee.clientX,y:ee.clientY};k?.(ee,J),j(!1),$(ce=>ce+1),requestAnimationFrame(()=>{P.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:J.x,y:J.y,top:J.y,left:J.x,right:J.x,bottom:J.y}}}),j(!0)})},onClick:()=>{R&&r==="contextmenu"&&j(!1)}}:{},W=_.cloneElement(e,ie({...e.props,...we,ref:he,"aria-haspopup":"menu","aria-expanded":R}));return a.jsx(go.Provider,{value:ue,children:a.jsxs(Js,{id:I,children:[W,de&&a.jsx(Vn,{root:S,children:a.jsx(Ga,{context:B,modal:!1,initialFocus:-1,returnFocus:!0,children:a.jsx("div",{ref:P.setFloating,style:{...U,zIndex:C??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:a.jsx("div",{role:"menu","aria-orientation":"vertical",className:te(Se.menu,Se[`variant_${o}`],Se[`size_${s}`],v,g?.menu),style:{...Z,minWidth:l,...b,transform:[Z.transform,b?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:q||!R?"visible":"hidden"},...ae(),children:a.jsx(Qn,{items:t,activeIndex:N,getItemProps:fe,listRef:F})},A)})})})]})})});Qi.displayName="DropdownMenuInner";const Zr=_.forwardRef((e,t)=>a.jsx(Gu,{children:a.jsx(Qi,{...e,ref:t})}));Zr.displayName="DropdownMenu";const ec=_.forwardRef(({isEnabled:e=!0,children:t,...r},n)=>a.jsx(Zr,{...r,ref:n,triggerAction:"contextmenu",isDisabled:!e||r.isDisabled,children:t}));ec.displayName="ContextMenu";const ar={contenedor:"_contenedor_1leqv_1",lista:"_lista_1leqv_13",item:"_item_1leqv_45",item_dragging:"_item_dragging_1leqv_75",item_deshabilitado:"_item_deshabilitado_1leqv_85",icono_drag:"_icono_drag_1leqv_95",nombre:"_nombre_1leqv_147",checkbox:"_checkbox_1leqv_177"};function tc(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function rc(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function V1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function j1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function H1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M10.97 20.344L9 21v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4h16v2.172a2 2 0 0 1-.586 1.414L15 12v1.5m3.42 2.11a2.1 2.1 0 0 1 2.97 2.97L18 22h-3v-3z"})})}function U1(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[a.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),a.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function W1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function G1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function q1(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[a.jsx("circle",{cx:"5.5",cy:"4",r:"1.2",fill:"currentColor"}),a.jsx("circle",{cx:"5.5",cy:"8",r:"1.2",fill:"currentColor"}),a.jsx("circle",{cx:"5.5",cy:"12",r:"1.2",fill:"currentColor"}),a.jsx("circle",{cx:"10.5",cy:"4",r:"1.2",fill:"currentColor",opacity:".35"}),a.jsx("circle",{cx:"10.5",cy:"8",r:"1.2",fill:"currentColor",opacity:".35"}),a.jsx("circle",{cx:"10.5",cy:"12",r:"1.2",fill:"currentColor",opacity:".35"})]})}function R1(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function K1(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function X1(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),a.jsx("path",{fill:"currentColor",d:"M13 7a1 1 0 1 0-2 0v4H7a1 1 0 1 0 0 2h4v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V7Z"})]})}function Y1(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),a.jsx("path",{fill:"currentColor",d:"M7 12a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"})]})}function Z1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function J1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",children:[a.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function Q1(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:a.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function eh(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:a.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}function th(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0 12c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2"})})}function rh(){const e=or(),[t,r]=_.useState(null);if(!e)return null;const{state:n,todasLasColumnas:o,etiquetaColumna:s,cambiarOrdenColumnas:i}=e,{ordenColumnas:c,maxColumnasVisibles:l=10}=n,f=o.filter(v=>v.getIsVisible()).length>=l,p=v=>g=>{r(v),g.dataTransfer.effectAllowed="move",g.dataTransfer.setData("text/plain",v)},h=v=>g=>{g.preventDefault(),!(!t||t===v)&&i?.(b=>{const w=[...b],m=w.indexOf(t),y=w.indexOf(v);return m===-1||y===-1?b:(w.splice(m,1),w.splice(y,0,t),w)})},d=()=>r(null);return a.jsx("div",{className:ar.contenedor,children:a.jsx("ul",{className:ar.lista,children:c.map(v=>{const g=o.find(k=>k.id===v);if(!g)return null;const b=g.getCanHide?.()??!0,w=g.getIsVisible(),m=t===g.id,y=!b||!w&&f;return a.jsxs("li",{className:`${ar.item} ${m?ar.item_dragging:""} ${y?ar.item_deshabilitado:""}`,draggable:!y,onDragStart:p(g.id),onDragOver:h(g.id),onDrop:d,onDragEnd:d,title:!w&&f?`Límite de ${l} columnas visibles alcanzado`:void 0,children:[a.jsx("span",{className:ar.icono_drag,"aria-label":"Arrastrar columna",children:a.jsx(q1,{})}),a.jsx("span",{className:ar.nombre,children:s(g.id)}),a.jsx(Ir,{size:"md",color:"primary",isSelected:w,isDisabled:y,onChange:k=>g.toggleVisibility(k),className:ar.checkbox})]},g.id)})})})}const Jr={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function nh(){const e=or(),[t,r]=_.useState(""),n=_.useRef(null),o=e?.state.table?.getState().pagination.pageSize??10;if(_.useEffect(()=>r(String(o)),[o]),!e)return null;const{cambiarPageSize:s}=e,i=p=>Math.max(wo,Math.min(yo,p)),c=p=>{const h=o+p;h>=wo&&h<=yo&&s?.(h)},l=()=>{const p=parseInt(t,10),h=!isNaN(p)&&p>0?i(p):o;s?.(h),r(String(h))},u=p=>{({Enter:()=>{l(),n.current?.blur()},Escape:()=>{r(String(o)),n.current?.blur()},ArrowUp:()=>{p.preventDefault(),c(1),setTimeout(()=>n.current?.select(),0)},ArrowDown:()=>{p.preventDefault(),c(-1),setTimeout(()=>n.current?.select(),0)}})[p.key]?.()},f=p=>{const h=p.target.value;(h===""||/^\d+$/.test(h))&&r(h)};return a.jsxs("div",{className:Jr.contenido,children:[a.jsx("p",{className:Jr.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),a.jsxs("div",{className:Jr.control,children:[a.jsx(He,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>c(-1),"aria-label":"Disminuir filas",disabled:o<=wo,children:a.jsx(Y1,{style:{fontSize:"var(--gaps-6)"}})}),a.jsx("div",{className:Jr.valor,children:a.jsx("input",{ref:n,type:"text",inputMode:"numeric",value:t,onChange:f,onKeyDown:u,onFocus:()=>n.current?.select(),onBlur:l,className:Jr.input,"aria-label":"Número de filas por página"})}),a.jsx(He,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>c(1),"aria-label":"Aumentar filas",disabled:o>=yo,children:a.jsx(X1,{})})]})]})}const yt={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function ah({navegar:e}){const t=or();return a.jsxs("div",{className:yt.contenedor,children:[a.jsx("nav",{className:yt.menu,children:ih.map(({id:r,icono:n,nombre:o,descripcion:s})=>a.jsxs("button",{type:"button",className:yt.item,onClick:()=>e(r),children:[a.jsx("div",{className:yt.icono_contenedor,children:a.jsx(n,{})}),a.jsxs("div",{className:yt.texto,children:[a.jsx("span",{className:yt.nombre,children:o}),a.jsx("span",{className:yt.descripcion,children:s})]}),a.jsx(rc,{className:yt.chevron})]},r))}),a.jsx("div",{className:yt.divider}),a.jsx("div",{className:yt.menu,children:a.jsxs("button",{type:"button",className:yt.item,onClick:t?.restaurarConfiguracion,children:[a.jsx("div",{className:yt.icono_contenedor,children:a.jsx(G1,{className:yt.icono_restaurar})}),a.jsxs("div",{className:yt.texto,children:[a.jsx("span",{className:yt.nombre,children:"Restaurar configuración"}),a.jsx("span",{className:yt.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const wo=1,yo=200,nc=250,oh=200,ac=3,sh={panelPrincipal:{component:ah},panelColumnas:{component:rh,titulo:"Columnas visibles"},panelFilas:{component:nh,titulo:"Filas por página"}},ih=[{id:"panelColumnas",icono:R1,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:K1,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}],Le={contenedor:"_contenedor_16k0y_1",contenedor_superior:"_contenedor_superior_16k0y_17",input_con_icono:"_input_con_icono_16k0y_35",icono_busqueda:"_icono_busqueda_16k0y_49",input_busqueda:"_input_busqueda_16k0y_75",contenedor_acciones_botones:"_contenedor_acciones_botones_16k0y_147",contenedor_acciones:"_contenedor_acciones_16k0y_147",columna:"_columna_16k0y_183",encabezados:"_encabezados_16k0y_203",contenido_encabezado:"_contenido_encabezado_16k0y_229",icono_orden:"_icono_orden_16k0y_243",boton_basico:"_boton_basico_16k0y_323",texto_filtros:"_texto_filtros_16k0y_347",menu_configuraciones:"_menu_configuraciones_16k0y_379",tabla_card:"_tabla_card_16k0y_427",wrapper_scroll_tabla:"_wrapper_scroll_tabla_16k0y_439",contenedor_tabla:"_contenedor_tabla_16k0y_453",contenedor_datos:"_contenedor_datos_16k0y_467",datos:"_datos_16k0y_501",seleccionada:"_seleccionada_16k0y_549",boton_acciones:"_boton_acciones_16k0y_609"};function oc(e){return"contenido"in e}function ch({fila:e,controls:t}){const r=t.filter(l=>!l.visible||l.visible(e)),n=r.filter(l=>!oc(l)),o=r.filter(oc),s=n.slice(0,ac-1),c=n.slice(ac-1).map(l=>({id:l.id,label:l.nombre,startIcon:l.icono,onSelect:()=>l.evento(e)}));return a.jsxs("div",{className:Le.contenedor_acciones,children:[o.map(l=>a.jsx(tr,{content:l.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx("span",{children:l.contenido(e,Le.boton_acciones)})},l.id)),s.map(l=>a.jsx(tr,{content:l.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx(He,{id:l.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>l.evento(e),className:Le.boton_acciones,"data-testid":`tabla-accion-${l.id}`,children:l.icono})},l.id)),c.length>0&&a.jsx(tr,{content:"Más opciones",variant:"default",size:"sm",placement:"top",children:a.jsx("div",{style:{display:"inline-flex"},children:a.jsx(Zr,{items:c,placement:"bottom-end",size:"md",children:a.jsx(He,{size:"sm",radius:"md",variant:"light",isIconOnly:!0,className:Le.boton_acciones,"aria-label":"Más opciones","data-testid":"tabla-accion-mas-opciones",children:a.jsx(th,{})})})})})]})}function lh(e,t,r=3){const n=Math.floor(r/2);let o=e-n;o<1&&(o=1),o+r-1>t&&(o=Math.max(1,t-r+1));const s=Math.min(r,t);return Array.from({length:s},(i,c)=>o+c)}function dh(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function Mr(e,t){const r=new Map;t.getFlatHeaders().forEach(i=>r.set(i.column.id,i));const n=r.get(e);if(n)return Nr(n.column.columnDef.header,n.getContext());const o=t.getAllLeafColumns().find(i=>i.id===e),s=o?.columnDef.header;return typeof s=="string"||typeof s=="number"?s:o?.id??e}function sc(e,t){const r=e.getVisibleCells().find(n=>n.column.id===t);return r?Nr(r.column.columnDef.cell,r.getContext()):null}function ic(e,t){return t?e.getVisibleCells().map(n=>n.column.id).includes(t):!1}function uh(e,t,r){return e.getVisibleCells().filter(n=>n.column.id!=="actions"&&n.column.id!==t&&n.column.id!==r)}function fh(e,t){if(t===0)return"";if(t===1)return xo(e[0].nombre.toLowerCase());if(t===2)return`${xo(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const r=e.slice(0,2).map(o=>o.nombre.toLowerCase()),n=t-2;return`${xo(r.join(", "))} y ${n>1?`otros ${n}`:"otro"} más`}function xo(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function cc(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const lc=_.createContext(null),ko=lc;function ea(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}function hh({children:e,data:t,columns:r,controls:n,loading:o,primerasColumnas:s,tamanioPaginaInicial:i=10,filtros:c,descargarExcel:l,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:p,maxColumnasVisibles:h=10,...d}){const[v,g]=_.useState(""),b=hf(v,200),w=Ya("only screen and (max-width: 830px)"),[m,y]=_.useState({pageIndex:0,pageSize:i}),[k,T]=_.useState({}),C=_.useMemo(()=>{const P={},U=new Set;r.forEach(q=>{const X="accessorKey"in q?String(q.accessorKey):q.id;X&&q.meta?.isHidden&&(P[X]=!1,U.add(X))});let B=0;return r.forEach(q=>{const X="accessorKey"in q?String(q.accessorKey):q.id;!X||U.has(X)||(B<h?B++:P[X]=!1)}),P},[r,h]),[S,M]=_.useState(()=>C);_.useEffect(()=>{M(C)},[C]);const D=_.useMemo(()=>{const P=[];return f.length>0&&!w&&P.push({id:"select",header:({table:U})=>a.jsx(Ir,{color:"secondary",isSelected:U.getIsAllPageRowsSelected(),isIndeterminate:U.getIsSomePageRowsSelected()&&!U.getIsAllPageRowsSelected(),onChange:B=>U.toggleAllPageRowsSelected(!!B)}),cell:({row:U})=>a.jsx(Ir,{color:"primary",isSelected:U.getIsSelected(),isDisabled:!U.getCanSelect(),onChange:B=>U.toggleSelected(B)}),enableSorting:!1,enableHiding:!1}),P.push(...r),n?.length&&P.push({id:"actions",header:"Acciones",cell:U=>a.jsx(ch,{fila:U.row.original,controls:n}),enableSorting:!1,enableHiding:!1}),P},[r,n,f.length,w]),O=_.useMemo(()=>{const P=D.map(B=>"accessorKey"in B&&B.accessorKey!=null?String(B.accessorKey):"id"in B&&B.id!=null?String(B.id):"").filter(Boolean),U=P.indexOf("actions");return U>-1&&U<P.length-1&&(P.splice(U,1),P.push("actions")),P},[D]),[H,V]=_.useState(()=>O);_.useEffect(()=>{V(P=>ea(P,O)?P:O)},[O]);const N=_.useCallback((P,U,B)=>{if(!B)return!0;const q=cc(String(B)),X=P.getValue(U);return X==null?!1:cc(String(X)).includes(q)},[]),x=D1({data:t,columns:D,state:{pagination:m,globalFilter:b,columnOrder:H,rowSelection:k,columnVisibility:S},onColumnVisibilityChange:M,globalFilterFn:N,enableRowSelection:f.length>0,onRowSelectionChange:T,onPaginationChange:y,onColumnOrderChange:P=>{V(U=>{const B=typeof P=="function"?P(U):P;return ea(U,B)?U:B})},getCoreRowModel:E1(),getSortedRowModel:M1(),getFilteredRowModel:N1(),getPaginationRowModel:I1(),autoResetPageIndex:!1}),A=x.getPageCount();_.useEffect(()=>{const P=dh(m.pageIndex,A);P!==m.pageIndex&&y(U=>({...U,pageIndex:P}))},[m.pageIndex,A]);const $=_.useRef(b);_.useEffect(()=>{$.current!==b&&y(U=>U.pageIndex===0?U:{...U,pageIndex:0}),$.current=b},[b]);const F=_.useMemo(()=>x.getAllLeafColumns().filter(P=>P.id!=="actions"&&P.id!=="select"&&P.getCanHide?.()),[x]),E=_.useCallback(P=>{const B=r.find(q=>"accessorKey"in q?String(q.accessorKey)===P:String(q.id)===P)?.header;return typeof B=="string"||typeof B=="number"?String(B):P},[r]),I=_.useCallback(()=>{M(C),x.setPageSize(i),x.setPageIndex(0),x.resetRowSelection(),V(P=>ea(P,O)?P:O)},[x,i,O,C]),L=_.useCallback(P=>{const U=Math.max(1,Math.min(200,P));x.setPageSize(U),x.setPageIndex(0)},[x]),R=_.useCallback(P=>{V(U=>{const B=typeof P=="function"?P(U):P;return ea(U,B)?U:B})},[]),j=_.useMemo(()=>({state:{ordenColumnas:H,table:x,columns:D,controls:n,loading:o,primerasColumnas:[String(s[0]),String(s[1])],inputBusqueda:v,setInputBusqueda:g,filtros:c,descargarExcel:l,actualizarTabla:u,selectorFilas:f,sinDatosProps:p,maxColumnasVisibles:h,...d},todasLasColumnas:F,etiquetaColumna:E,restaurarConfiguracion:I,cambiarPageSize:L,cambiarOrdenColumnas:R}),[H,x,D,n,o,v,c,s,l,u,f,p,h,d,F,E,I,L,R]);return a.jsx(lc.Provider,{value:j,children:e})}function _h(){const e=_.useContext(ko);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function or(){const e=_.useContext(ko);return e||null}const Gt={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"},ph=({titulo:e,onBack:t})=>a.jsxs("header",{className:Gt.header,children:[a.jsx(He,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:a.jsx(tc,{})}),a.jsx("h3",{className:Gt.titulo,children:e})]});function gh(e,t,r){const n=_.useRef(r);n.current=r;const o=_.useRef(e);o.current=e;const s=_.useCallback(i=>{const c=i.target;n.current.some(u=>u.current?.contains(c))||o.current()},[]);_.useEffect(()=>{if(!t)return;const i=setTimeout(()=>{document.addEventListener("mousedown",s)},100);return()=>{clearTimeout(i),document.removeEventListener("mousedown",s)}},[t,s])}function dc(e,t){_.useEffect(()=>{if(!t)return;const r=n=>{n.key==="Escape"&&e()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,e])}function vh(e,t,r,{width:n,offsetRight:o=0,offsetLeft:s=0,offsetTop:i=0,offsetBottom:c=0,shiftPadding:l=8}){const[u,f]=_.useState({top:0,left:0}),p=Ya("only screen and (max-width: 480px)"),h=_.useCallback(()=>{if(!e.current)return{top:0,left:0};const d=e.current.getBoundingClientRect(),v=l;let g=d.bottom+i,b=0;p?b=d.right-n-s+o:b=d.right-n+o-s;const w=t.current?.offsetHeight||400;g+w>window.innerHeight-v&&(g=d.top-w-c,g<v&&(g=v));const m=v,y=window.innerWidth-n-v;return b=Math.max(m,Math.min(b,y)),{top:g,left:b}},[p,n,o,s,i,c,l,e,t]);return _.useEffect(()=>{if(!r||!e.current)return;const d=()=>{f(h())};return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[r,h,e]),u}function mh(e){_.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function bh(){const[e,t]=_.useState(!1),[r,n]=_.useState(!1),[o,s]=_.useState("panelPrincipal"),[i,c]=_.useState(null),l=_.useRef(null),u=_.useRef(null),f=_.useRef(null);mh(r),gh(()=>h(),r,[l,u]),dc(()=>h(),r);const p=vh(l,u,r,{width:nc,offsetRight:6,offsetTop:-2,shiftPadding:8});_.useEffect(()=>{e&&(n(!0),c(null))},[e]),_.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function h(){r&&(t(!1),f.current=window.setTimeout(()=>{n(!1),s("panelPrincipal"),c(null)},oh))}function d(b){c(b==="panelPrincipal"?"backward":"forward"),s(b)}const v=sh[o],g=v.component;return a.jsxs("div",{ref:l,className:Gt.contenedor,children:[a.jsx(He,{isIconOnly:!0,variant:"light",onClick:()=>r?h():t(!0),"aria-haspopup":"dialog","aria-expanded":r,"aria-label":"Configurar tabla",children:a.jsx(W1,{})}),r&&l.current&&$r.createPortal(a.jsx("div",{ref:u,className:`${Gt.popover} ${e?Gt.popover_entrada:Gt.popover_salida}`,role:"dialog",style:{top:`${p.top}px`,left:`${p.left}px`,width:nc},children:a.jsx("div",{className:Gt.ventana,children:a.jsxs("div",{className:te([Gt.panel,Gt[`panel_${i}`]]),children:[v.titulo&&a.jsx(ph,{titulo:v.titulo,onBack:()=>d("panelPrincipal")}),a.jsx(g,{navegar:d})]},o)})}),document.body)]})}function wh(){const e=or();if(!e)return null;const{state:t}=e,{inputBusqueda:r,setInputBusqueda:n,loading:o,filtros:s,actualizarTabla:i,descargarExcel:c,paginacion:l}=t,{abrirFiltros:u,filtrosAplicados:f=[]}=s||{},p=f?.length||0;return a.jsxs("section",{className:Le.contenedor_superior,children:[a.jsxs("div",{className:Le.input_con_icono,id:"buscador-tabla",children:[a.jsx(V1,{className:Le.icono_busqueda}),a.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:r??"",onChange:h=>n&&n(h.target.value),className:Le.input_busqueda})]}),a.jsxs("div",{className:Le.contenedor_acciones_botones,children:[a.jsxs("div",{className:Le.contenedor_acciones,children:[l?.hayMasDatos&&a.jsxs(He,{id:"cargar-mas-datos",variant:"light",className:Le.boton_basico,disabled:o,onClick:l.onCargarMasDatos,children:[a.jsx(J1,{}),o?"Actualizando...":"Más datos"]}),u!==void 0&&a.jsxs(He,{id:"boton-filtros",onClick:u,variant:"light",className:Le.boton_basico,children:[a.jsx(H1,{})," Filtros"]}),p>0?a.jsxs("div",{className:Le.texto_filtros,id:"filtros-aplicados",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.4em",height:"1.4em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M6 12h12m-9 6h2m4 0l2 2l4-4"})}),a.jsx("p",{children:fh(f,p)})]}):null]}),c!==void 0?a.jsxs(He,{onClick:c,color:"success",variant:"faded",children:[a.jsx(j1,{})," Excel"]}):null]}),a.jsxs("div",{className:Le.contenedor_acciones,children:[i!==void 0&&a.jsx(tr,{content:"Actualiza los últimos datos guardados",children:a.jsx(He,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:Le.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:a.jsx(U1,{})})}),a.jsx("div",{className:Le.menu_configuraciones,id:"configuraciones-tabla",children:a.jsx(bh,{})})]})]})}const zt={contenedor_paginacion:"_contenedor_paginacion_mu230_1",info_paginacion:"_info_paginacion_mu230_23",contenedor_botones:"_contenedor_botones_mu230_39",boton_paginacion:"_boton_paginacion_mu230_97",pagina_activa:"_pagina_activa_mu230_143",boton_num_paginacion:"_boton_num_paginacion_mu230_155"};function yh(){const e=or();if(!e)return null;const{state:t}=e,{table:r}=t,n=r.getPrePaginationRowModel().rows.length,o=r.getPageCount()||1,{pageIndex:s}=r.getState().pagination,i=s+1,c=lh(i,o),l=r.getCanPreviousPage(),u=r.getCanNextPage(),f=o>1,p=s===0,h=s===o-1,d=()=>{l&&r.previousPage()},v=()=>{u&&r.nextPage()},g=m=>{r.setPageIndex(m-1)},b=()=>{p||r.firstPage()},w=()=>{h||r.lastPage()};return a.jsxs("section",{className:zt.contenedor_paginacion,id:"paginacion-tabla",children:[a.jsxs("p",{className:zt.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",n]}),f&&a.jsxs("div",{className:zt.contenedor_botones,id:"paginacion-numerador-pags",children:[!p&&a.jsx(Q1,{id:"paginacion-flecha-inicio",onClick:b,"aria-label":"Ir a la primera página","aria-disabled":p,className:zt.boton_paginacion}),l&&a.jsx(tc,{id:"paginacion-flecha-izq",onClick:d,"aria-disabled":!l,className:zt.boton_paginacion}),a.jsx("div",{id:"paginacion-numero-pag",children:c.map(m=>a.jsx("button",{type:"button",onClick:()=>g(m),"aria-current":m===i?"page":void 0,className:m===i?zt.pagina_activa:zt.boton_num_paginacion,children:m},m))}),u&&a.jsx(rc,{id:"paginacion-flecha-der",onClick:v,"aria-disabled":!u,className:zt.boton_paginacion}),!h&&a.jsx(eh,{id:"paginacion-flecha-fin",onClick:w,"aria-label":"Ir a la última página","aria-disabled":h,className:zt.boton_paginacion})]}),a.jsxs("p",{className:zt.info_paginacion,id:"paginacion-total-pags",children:["Página ",i," de ",o]})]})}const Te={contenedor_tabla_cards:"_contenedor_tabla_cards_1ltc4_1",contenedor_card:"_contenedor_card_1ltc4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1ltc4_25",contenedor_columna_card:"_contenedor_columna_card_1ltc4_47",card_label:"_card_label_1ltc4_57",card_valor:"_card_valor_1ltc4_69",card_segundo_valor:"_card_segundo_valor_1ltc4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1ltc4_93",contenedor_fila_card:"_contenedor_fila_card_1ltc4_105",card_fila_label:"_card_fila_label_1ltc4_119",card_fila_valor:"_card_fila_valor_1ltc4_137",contenedor_acciones_card:"_contenedor_acciones_card_1ltc4_157",boton_acciones:"_boton_acciones_1ltc4_175",boton_card:"_boton_card_1ltc4_211",boton_personalizado:"_boton_personalizado_1ltc4_241"};function uc(e,t){if(t)return e.find(r=>r.accessorKey===t||r.id!==void 0&&r.id===String(t))}function fc(e){if(e)return e.id??e.accessorKey}const qt={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function xh({filas:e,cantidadControles:t=0,table:r,idPrimeraColumna:n,idSegundaColumna:o}){const i=r.getAllLeafColumns().filter(l=>l.id!=="actions"&&l.id!==n&&l.id!==o),c=["25vw","30vw","20vw","28vw","22vw","26vw"];return a.jsx("section",{className:Te.contenedor_tabla_cards,children:Array.from({length:e}).map((l,u)=>a.jsxs("article",{className:Te.contenedor_card,children:[a.jsxs("div",{className:Te.contenedor_encabezado_card,children:[a.jsx("div",{className:Te.contenedor_columna_card,children:n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Te.card_label,children:Mr(n,r)}),a.jsx("div",{className:Te.card_valor,children:a.jsx("div",{className:`${qt.skeleton_elemento} ${qt.skeleton_elemento_encabezado}`})})]})}),a.jsx("div",{className:Te.contenedor_columna_card,children:o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Te.card_label,children:Mr(o,r)}),a.jsx("div",{className:Te.card_segundo_valor,children:a.jsx("div",{className:`${qt.skeleton_elemento} ${qt.skeleton_elemento_encabezado_segundo}`})})]})})]}),a.jsx("div",{className:Te.contenedor_contenido_cards,children:i.map((f,p)=>a.jsxs("div",{className:Te.contenedor_fila_card,children:[a.jsx("div",{className:Te.card_fila_label,children:Mr(f.id,r)}),a.jsx("div",{className:Te.card_fila_valor,children:a.jsx("div",{className:`${qt.skeleton_elemento} ${qt.skeleton_elemento_contenido}`,style:{width:c[p%c.length]}})})]},f.id))}),t>0&&a.jsx("div",{className:Te.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((f,p)=>a.jsx("div",{className:qt.skeleton_accion,children:a.jsx("div",{className:`${qt.skeleton_elemento} ${qt.skeleton_elemento_encabezado}`})},`accion-${p}`))})]},`skeleton-card-${u}`))})}const vr={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function hc(){const e=_.useContext(ko),{sinDatosProps:t}=e?.state||{},{botonAccion:r,titulo:n="No se encontraron coincidencias",descripcion:o='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return a.jsxs("div",{className:vr.contenedor,children:[a.jsx(kh,{}),a.jsxs("div",{className:vr.envolvedor_contenido,children:[a.jsx(Eh,{}),a.jsx("h3",{className:vr.titulo,children:n}),a.jsx("p",{className:vr.descripcion,children:o}),r]})]})}function kh(){return a.jsx("div",{className:vr.envolvedor_cuadricula,children:a.jsxs("svg",{className:vr.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("defs",{children:a.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:a.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),a.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Eh(){return a.jsxs("svg",{className:vr.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),a.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),a.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),a.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Ch=({fila:e,controls:t})=>(t?.length??0)>0?a.jsx("div",{className:Te.contenedor_acciones_card,children:t?.filter(n=>!n.visible||n.visible(e.original)).map(n=>"contenido"in n?a.jsxs("span",{className:`${Te.boton_personalizado} ${Te.boton_acciones} ${Te.boton_card}`,onClick:o=>{const s=o.currentTarget.querySelector("button");s&&!s.contains(o.target)&&s.click()},children:[n.contenido(e.original)," ",n.nombre]},n.id):a.jsxs("button",{id:n.id,type:"button",title:n.nombre,onClick:()=>n.evento(e.original),className:`${Te.boton_acciones} ${Te.boton_card}`,children:[n.icono," ",n.nombre]},n.id))}):null,Sh=({columnasRestantes:e,table:t})=>e.length===0?null:a.jsx("div",{className:Te.contenedor_contenido_cards,children:e.map(r=>a.jsxs("div",{className:Te.contenedor_fila_card,children:[a.jsx("div",{className:Te.card_fila_label,children:Mr(r.column.id,t)}),a.jsx("div",{className:Te.card_fila_valor,children:Nr(r.column.columnDef.cell,r.getContext())})]},r.id))}),Th=({fila:e,table:t,idPrimeraColumna:r,idSegundaColumna:n})=>{const o=ic(e,r),s=ic(e,n);return a.jsxs("div",{className:Te.contenedor_encabezado_card,children:[a.jsx("div",{className:Te.contenedor_columna_card,children:r&&o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Te.card_label,children:Mr(r,t)}),a.jsx("div",{className:Te.card_valor,children:sc(e,r)})]})}),a.jsx("div",{className:Te.contenedor_columna_card,children:n&&s&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Te.card_label,children:Mr(n,t)}),a.jsx("div",{className:Te.card_segundo_valor,children:sc(e,n)})]})})]})};function Ah(){const e=or();if(!e)return null;const{state:t}=e,{table:r,controls:n,primerasColumnas:o,loading:s,columns:i}=t;if(!r)return null;const c=i&&o?uc(i,o[0]):void 0,l=i&&o?uc(i,o[1]):void 0,u=fc(c),f=fc(l);if(s)return a.jsx(xh,{filas:3,cantidadControles:n?.length??0,table:r,idPrimeraColumna:u,idSegundaColumna:f});const p=r.getRowModel().rows;return p.length===0?a.jsx("article",{className:Te.contenedor_card,children:a.jsx(hc,{})}):a.jsx("section",{className:Te.contenedor_tabla_cards,children:p.map(h=>{const d=uh(h,u,f);return a.jsxs("article",{id:`tabla-card-${h.id}`,className:Te.contenedor_card,children:[a.jsx(Th,{fila:h,table:r,idPrimeraColumna:u,idSegundaColumna:f}),a.jsx(Sh,{columnasRestantes:d,table:r}),a.jsx(Ch,{fila:h,controls:n})]},h.id)})})}const _c={filas:"_filas_17736_1",columnas:"_columnas_17736_33"},Nh=({columnas:e,filas:t})=>a.jsx(a.Fragment,{children:Array.from({length:t}).map((r,n)=>a.jsx("tr",{className:_c.filas,children:Array.from({length:e}).map((o,s)=>a.jsx("td",{className:_c.columnas},`sk-cell-${n}-${s}`))},`sk-row-${n}`))}),mr={contenedor:"_contenedor_5uhpi_1",barra:"_barra_5uhpi_21",info:"_info_5uhpi_49",btn_cerrar:"_btn_cerrar_5uhpi_63",contador:"_contador_5uhpi_79",separador:"_separador_5uhpi_97",acciones:"_acciones_5uhpi_111"};function Ih({totalSeleccionadas:e,acciones:t,filasSeleccionadas:r,onLimpiarSeleccion:n}){const[o,s]=_.useState(0),[i,c]=_.useState([]),[l,u]=_.useState([]),f=e>0,p=_.useRef(null);return dc(n,f),_.useEffect(()=>{f&&(s(e),c(t),u(r))},[e,t,r,f]),a.jsx(un,{mostrar:f,tipo:"escalar",className:mr.contenedor,children:a.jsxs("div",{ref:p,className:mr.barra,children:[a.jsxs("div",{className:mr.info,children:[a.jsx(He,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:n,"aria-label":"Limpiar selección",className:mr.btn_cerrar,children:a.jsx(Z1,{})}),a.jsxs("p",{className:mr.contador,children:[o," filas seleccionadas"]})]}),a.jsx("div",{className:mr.separador}),a.jsx("div",{className:mr.acciones,children:i.map(h=>a.jsx("div",{children:h.componente(l)},h.id))})]})})}function Mh({dir:e}){return e?e==="asc"?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:Le.icono_orden,"aria-hidden":"true",children:a.jsx("path",{fill:"currentColor",d:"m12 10.8l-4.6 4.6L6 14l6-6l6 6l-1.4 1.4z"})}):a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:Le.icono_orden,"aria-hidden":"true",children:a.jsx("path",{fill:"currentColor",d:"M12 13.2L7.4 8.6L6 10l6 6l6-6l-1.4-1.4z"})}):null}function Fh(){const e=or();if(!e)return null;const{state:t}=e,{table:r,loading:n,selectorFilas:o=[]}=t;if(!r)return null;const s=r.getHeaderGroups(),i=r.getRowModel().rows,c=r.getVisibleLeafColumns().length,l=r.getState().pagination.pageIndex,u=r.getSelectedRowModel().rows,f=u.length,p=()=>{r.resetRowSelection()};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Le.wrapper_scroll_tabla,children:a.jsxs("table",{className:Le.contenedor_tabla,children:[a.jsx("thead",{children:s.map(h=>a.jsx("tr",{children:h.headers.map(d=>{const v=d.column.columnDef.meta?.style;return a.jsx("th",{id:`tabla-col-${d.id}`,className:Le.encabezados,style:v,"data-columna":d.id,children:d.id==="select"?a.jsx("div",{children:Nr(d.column.columnDef.header,d.getContext())}):a.jsxs("div",{className:Le.contenido_encabezado,style:{justifyContent:v?.textAlign==="center"?"center":v?.textAlign==="right"?"flex-end":void 0},onClick:d.column.getToggleSortingHandler(),children:[Nr(d.column.columnDef.header,d.getContext()),a.jsx(Mh,{dir:d.column.getIsSorted()})]})},d.id)})},h.id))}),a.jsx("tbody",{className:Le.contenedor_datos,children:n?a.jsx(Nh,{columnas:c,filas:7}):i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:c,style:{backgroundColor:"var(--base)"},children:a.jsx(hc,{})})}):i.map(h=>a.jsx("tr",{id:`tabla-fila-${h.id}`,className:`${Le.datos} ${h.getIsSelected()?Le.seleccionada:""}`,"data-fila-index":h.index,children:h.getVisibleCells().map(d=>{const v=d.column.columnDef.meta?.style;return a.jsx("td",{className:Le.columna,style:v,"data-columna":d.column.id,children:Nr(d.column.columnDef.cell,d.getContext())},d.id)})},h.id))},l)]})}),o?.length>0?a.jsx(Ih,{totalSeleccionadas:f,acciones:o,filasSeleccionadas:u.map(h=>h.original),onLimpiarSeleccion:p}):null]})}const Oh=830;function $h({id:e}){const t=_.useRef(null),[r,n]=_.useState(!1);return _.useEffect(()=>{const o=t.current;if(!o)return;const s=new ResizeObserver(([i])=>{n(i.contentRect.width<=Oh)});return s.observe(o),()=>s.disconnect()},[]),a.jsxs("main",{className:Le.contenedor,id:e,ref:t,children:[a.jsx(wh,{}),a.jsxs("div",{className:Le.tabla_card,children:[r?a.jsx(Ah,{}):a.jsx(Fh,{}),a.jsx(yh,{})]})]})}function Dh({id:e,...t}){return a.jsx(hh,{...t,children:a.jsx($h,{id:e})})}const Pe={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},pc=_.createContext(void 0),Lh=()=>_.useContext(pc),Eo=_.memo(_.forwardRef(({value:e,label:t,description:r,size:n="md",color:o="primary",customColor:s,variant:i="default",isDisabled:c=!1,isReadOnly:l=!1,isInvalid:u=!1,isRequired:f=!1,children:p,className:h="",onChange:d,...v},g)=>{const b=Lh(),w=_.useId(),m=v.id||w,y=b?.name||v.name,k=b?.size||n,T=b?.color||o,C=b?.customColor||s,S=b?.variant||i,M=b?.isDisabled||c,D=b?.isReadOnly||l,O=b?.isInvalid||u,H=b?.isRequired||f,V=b?.value!==void 0?b.value===e:void 0,N=r?`${m}-desc`:void 0,x=p||t,A=E=>{M||D||(b?.onChange&&b.onChange(e),d&&d(E))},$=[Pe.contenedor_radio,Pe[`tam_${k}`],!C&&Pe[`color_${T}`],Pe[`variante_${S}`],M&&Pe.deshabilitado,D&&Pe.solo_lectura,O&&Pe.invalido,V&&Pe.seleccionado,h].filter(Boolean).join(" "),F=C?{"--radio-custom-color":C}:void 0;return a.jsx("div",{className:$,style:F,children:a.jsxs("label",{className:Pe.envoltorio_radio,htmlFor:m,children:[a.jsxs("div",{className:Pe.radio,children:[a.jsx("input",{"data-testid":y?`radio-${y}${e?`-${e}`:""}`:m,...v,ref:g,type:"radio",id:m,name:y,value:e,checked:V,disabled:M,readOnly:D,required:H,"aria-invalid":O,"aria-required":H||void 0,"aria-describedby":N,className:Pe.input,onChange:A}),a.jsx("div",{className:Pe.circulo_radio,children:a.jsx("div",{className:Pe.punto_radio})})]})," ",x&&a.jsxs("div",{className:Pe.contenedor_label,children:[a.jsxs("span",{className:Pe.texto_label,children:[x,f&&!b&&a.jsx("span",{className:Pe.marca_requerido,children:" *"})]}),r&&a.jsx("span",{id:N,className:Pe.texto_descripcion,children:r})]})]})})}));Eo.displayName="Radio";const gc=({name:e,value:t,defaultValue:r,onChange:n,orientation:o="horizontal",label:s,description:i,isDisabled:c=!1,isReadOnly:l=!1,isRequired:u=!1,isInvalid:f=!1,errorMessage:p,size:h,color:d,customColor:v,variant:g,justifyContent:b="flex-start",children:w,className:m="",options:y,optionValueKey:k,optionLabelKey:T,optionDisabledKey:C,optionDescriptionKey:S,id:M,"data-testid":D})=>{const[O,H]=_.useState(String(r??"")),V=_.useId(),N=M??`radio-group-${V}`,x=e??N,A=s?`${N}-label`:void 0,$=s&&i?`${N}-desc`:void 0,F=f&&p?`${N}-err`:void 0,E=[$,F].filter(Boolean).join(" ")||void 0,I=t!==void 0?String(t):O,R={name:x,value:I,onChange:U=>{c||l||(t===void 0&&H(U),n&&n(U))},size:h,color:d,customColor:v,variant:g,isDisabled:c,isReadOnly:l,isInvalid:f,isRequired:u},j=[Pe.grupo_radio,Pe[`orientacion_${o}`],f&&Pe.grupo_invalido,c&&Pe.grupo_deshabilitado,l&&Pe.grupo_solo_lectura,m].filter(Boolean).join(" "),P=b==="center"?"center":b==="flex-end"?"right":"left";return a.jsx(pc.Provider,{value:R,children:a.jsxs("div",{id:N,className:j,role:"radiogroup","aria-required":u,"aria-invalid":f,"aria-labelledby":A,"aria-describedby":E,"data-testid":D??(e?`radio-group-${e}`:N),style:{textAlign:P},children:[s&&a.jsxs("div",{className:Pe.encabezado_grupo,children:[a.jsxs("span",{id:A,className:Pe.label_grupo,children:[s,u&&a.jsx("span",{className:Pe.marca_requerido,children:" *"})]}),i&&a.jsx("span",{id:$,className:Pe.descripcion_grupo,children:i})]}),a.jsx("div",{className:Pe.contenedor_radios,style:{justifyContent:b},children:y&&y.length>0?y.map((U,B)=>{let q,X,Y=!1,Q;if(typeof U=="object"&&U!==null){const oe=k??"value",se=T??"label",ne=C??"isDisabled",ie=S??"description",ae=U[oe],fe=U[se];q=String(ae!==void 0?ae:B),X=fe;const de=U[ne];Y=typeof de=="boolean"?de:!1;const Z=U[ie];Q=typeof Z=="string"?Z:void 0}else q=String(U),X=U;return a.jsx(Eo,{value:q,isDisabled:Y,description:Q,children:X},q)}):w}),f&&p&&a.jsx("span",{id:F,className:Pe.mensaje_error,role:"alert",children:p})]})})};gc.displayName="RadioGroup";const dt={backdrop:"_backdrop_1w6ll_1",visible:"_visible_1w6ll_37",drawer:"_drawer_1w6ll_67",posicion_right:"_posicion_right_1w6ll_135",posicion_left:"_posicion_left_1w6ll_173",posicion_top:"_posicion_top_1w6ll_211",posicion_bottom:"_posicion_bottom_1w6ll_249",radio_none:"_radio_none_1w6ll_287",radio_sm:"_radio_sm_1w6ll_295",radio_md:"_radio_md_1w6ll_315",radio_lg:"_radio_lg_1w6ll_335",radio_xl:"_radio_xl_1w6ll_355",tamano_auto:"_tamano_auto_1w6ll_455",tamano_sm:"_tamano_sm_1w6ll_479",tamano_md:"_tamano_md_1w6ll_489",tamano_lg:"_tamano_lg_1w6ll_499",tamano_xl:"_tamano_xl_1w6ll_509",tamano_full:"_tamano_full_1w6ll_519",encabezado:"_encabezado_1w6ll_579",manija:"_manija_1w6ll_599",titulo:"_titulo_1w6ll_607",boton_cerrar:"_boton_cerrar_1w6ll_629",contenido:"_contenido_1w6ll_753",pie:"_pie_1w6ll_769",loading_overlay:"_loading_overlay_1w6ll_789",spinner:"_spinner_1w6ll_813",spin:"_spin_1w6ll_813",loading_text:"_loading_text_1w6ll_843",variante_floating:"_variante_floating_1w6ll_855",manija_barra:"_manija_barra_1w6ll_1003"},Ph={left:"x",right:"x",top:"y",bottom:"y"},zh={right:1,left:-1,bottom:1,top:-1},Bh={x:"width",y:"height"},vc="transform 0.5s cubic-bezier(0.32, 0.72, 0, 1)",Vh=`${vc}, opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.45s allow-discrete`,mc=.4,jh=2;function Hh(e,t,r){if(e==="content")return Math.min(r??t,t);if(typeof e=="number")return Math.min(Math.max(e,0),t);const n=parseFloat(e)/100;return Math.round(t*n)}function bc(e,{position:t,isOpen:r,enabled:n,snapPoints:o,activeSnapPoint:s,onSnapPointChange:i,closeThreshold:c=.25,onClose:l,contentRef:u,contentOffset:f=0}){const p=Ph[t],h=zh[t],d=Bh[p],v=(o?.length??0)>0,g=(o??[]).includes("content"),[b,w]=_.useState(0),[m,y]=_.useState(null),[k,T]=_.useState(!1),[C,S]=_.useState(null),[M,D]=_.useState(s??(o?o.length-1:0)),O=_.useRef(0),H=_.useRef(0),V=_.useRef(0),N=_.useRef(0),x=_.useRef(null),A=_.useRef(null);_.useLayoutEffect(()=>{if(!n&&!v)return;if(v){const oe=()=>w(p==="x"?window.innerWidth:window.innerHeight);return oe(),window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)}const X=e.current;if(!X)return;const Y=()=>{const oe=Math.round(p==="x"?X.getBoundingClientRect().width:X.getBoundingClientRect().height);w(se=>se===oe?se:oe)};Y();const Q=new ResizeObserver(Y);return Q.observe(X),()=>Q.disconnect()},[e,p,n,v]),_.useLayoutEffect(()=>{if(!g||!u?.current)return;const X=u.current,Y=()=>{const oe=Math.round((p==="x"?X.getBoundingClientRect().width:X.getBoundingClientRect().height)+f);y(se=>se===oe?se:oe)};Y();const Q=new ResizeObserver(Y);return Q.observe(X),()=>Q.disconnect()},[u,p,g,f]),_.useEffect(()=>{s!==void 0?D(s):r&&o&&D(o.length-1)},[r,s,o]);const $=_.useMemo(()=>v&&b>0?o.map(X=>Hh(X,b,m)):[],[v,b,m,o]),F=$.length>0?Math.max(...$):0;_.useEffect(()=>()=>{A.current!==null&&cancelAnimationFrame(A.current)},[]);const E=_.useRef({tienePuntosAnclaje:v,puntosResueltos:$,indiceAnclaje:M,signo:h,tamano:b,maxSnap:F});E.current={tienePuntosAnclaje:v,puntosResueltos:$,indiceAnclaje:M,signo:h,tamano:b,maxSnap:F};const I=_.useCallback(X=>p==="x"?X.clientX:X.clientY,[p]),L=_.useCallback(X=>{if(!n)return;const{tienePuntosAnclaje:Y,puntosResueltos:Q,indiceAnclaje:oe,maxSnap:se}=E.current;O.current=I(X),H.current=performance.now(),N.current=oe,V.current=Y?se-(Q[oe]??se):0,T(!0),S(V.current),X.target.setPointerCapture?.(X.pointerId)},[n,I]),R=_.useCallback(()=>{A.current=null;const X=x.current;if(X===null)return;const{signo:Y}=E.current,Q=(X-O.current)*Y,oe=V.current+Q;S(Math.max(0,oe))},[]),j=_.useCallback(X=>{!n||C===null||(x.current=I(X),A.current===null&&(A.current=requestAnimationFrame(R)))},[n,C,I,R]),P=_.useCallback(()=>{if(A.current!==null&&(cancelAnimationFrame(A.current),A.current=null),x.current=null,!n||C===null)return;T(!1);const X=Math.max(1,performance.now()-H.current),Y=Math.abs(C-V.current)/X;if(v){const Q=F-V.current,oe=F-C,se=oe-Q>0,ne=N.current===$.length-1,ie=N.current===0;if(Y>jh){if(!se){S(null),l();return}const Z=$.length-1;D(Z),i?.(Z),S(null);return}if(ie&&!se){const Z=$[N.current]||b;if((Q-oe)/Z>c){S(null),l();return}}let ae=0,fe=1/0;$.forEach((Z,ue)=>{const pe=Math.abs(oe-Z);pe<fe&&(fe=pe,ae=ue)});const de=Math.abs(oe-Q);if(Y>mc&&de<b*.4){const Z=se?1:-1;if(Z>0&&ne){S(null);return}if(ie&&Z<0){S(null),l();return}const ue=N.current+Z;D(ue),i?.(ue),S(null);return}D(ae),i?.(ae),S(null);return}(Y>mc||C>=b*c)&&l(),S(null)},[n,C,v,$,F,c,b,l,i]),U=_.useCallback(X=>{X.target.releasePointerCapture?.(X.pointerId),P()},[P]),B=U;let q;if(v&&b>0&&F>0){const X=k&&C!==null?C:r?F-($[M]??F):F;q={[d]:`${F}px`,transform:`translate${p==="x"?"X":"Y"}(${h*X}px)`,transition:k?"none":Vh,willChange:"transform"}}else C!==null&&(q={transform:`translate${p==="x"?"X":"Y"}(${h*C}px)`,transition:k?"none":vc});return{isDragging:k,style:q,handlers:{onPointerDown:L,onPointerMove:j,onPointerUp:U,onPointerCancel:B}}}const Uh=18,Wh=600,wc={transparente:0,sutil:.2,normal:.4,intermedio:.6,intenso:.8},yc=_.forwardRef(({isOpen:e,onClose:t,position:r="right",size:n="md",title:o,showCloseButton:s=!0,closeOnBackdropClick:i=!0,closeOnEscape:c=!0,preventScroll:l=!0,header:u,footer:f,children:p,className:h="",style:d,contentClassName:v="",isLoading:g=!1,loadingMessage:b="Cargando...",onOpen:w,backdropVariant:m="normal",radius:y,zIndex:k,getContainer:T,variant:C="default",swipeToClose:S=!1,snapPoints:M,activeSnapPoint:D,onSnapPointChange:O,closeThreshold:H=.25,id:V,"data-testid":N},x)=>{const A=_.useRef(null),$=_.useRef(null),F=_.useRef(null),[E,I]=_.useState(!1),L=_.useId(),R=V??`drawer-${L}`,j=`${R}-title`,P=S||!!M?.length,U=_.useCallback(Z=>{$.current=Z,typeof x=="function"?x(Z):x&&(x.current=Z)},[x]),B=_.useCallback(()=>{I(Z=>Z||!0)},[]);_.useEffect(()=>{if(!E)return;let Z=!1;const ue=()=>{Z||(Z=!0,t?.(),I(!1))},pe=$.current,he=W=>{W.target===pe&&W.propertyName==="transform"&&ue()};pe?.addEventListener("transitionend",he);const we=window.setTimeout(ue,Wh);return()=>{pe?.removeEventListener("transitionend",he),window.clearTimeout(we)}},[E,t]);const q=e&&!E,{style:X,handlers:Y}=bc($,{position:r,isOpen:q,enabled:P,snapPoints:M,activeSnapPoint:D,onSnapPointChange:O,closeThreshold:H,onClose:B,contentRef:F,contentOffset:P&&(r==="top"||r==="bottom")?Uh:0});_.useEffect(()=>{e&&I(!1)},[e]);const Q=_.useRef(w);Q.current=w,_.useEffect(()=>{e&&Q.current?.()},[e]),_.useEffect(()=>{if(!e||!l)return;const Z=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",Z>0&&(document.body.style.paddingRight=`${Z}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,l]),_.useEffect(()=>{if(!e||!c)return;const Z=ue=>{ue.key==="Escape"&&B()};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[e,c,B]);const oe=Z=>{i&&Z.target===A.current&&B()},se=[dt.drawer,dt[`posicion_${r}`],dt[`tamano_${n}`],C==="floating"&&dt.variante_floating,!!M?.length&&dt.con_anclajes,q&&dt.visible,y&&dt[`radio_${y}`],h].filter(Boolean).join(" "),ne=[dt.contenido,v].filter(Boolean).join(" "),ie=[dt.backdrop,q&&dt.visible].filter(Boolean).join(" "),fe={background:`rgb(0 0 0 / ${wc[m]??wc.normal})`,zIndex:k||500,...T&&{position:"absolute"}},de=a.jsx("div",{className:ie,ref:A,onClick:oe,style:fe,children:a.jsxs("div",{ref:U,id:R,className:se,role:"dialog","aria-modal":"true","aria-labelledby":o?j:void 0,"data-testid":N??R,style:{...d,...X},children:[P&&a.jsx("div",{className:dt.manija,...Y,children:a.jsx("span",{className:dt.manija_barra})}),(o||u)&&a.jsx("div",{ref:F,className:dt.encabezado,children:u||a.jsxs(a.Fragment,{children:[a.jsx("h2",{id:j,className:dt.titulo,children:o}),s&&a.jsx("button",{type:"button",className:dt.boton_cerrar,onClick:B,"aria-label":"Cerrar",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),a.jsx("div",{className:ne,children:p}),f&&a.jsx("div",{className:dt.pie,children:f}),g&&a.jsxs("div",{className:dt.loading_overlay,children:[a.jsx("div",{className:dt.spinner}),a.jsx("span",{className:dt.loading_text,children:b})]})]})});if(T){const Z=typeof T=="function"?T():T;if(Z&&Z instanceof HTMLElement)return $r.createPortal(de,Z)}return de});yc.displayName="Drawer";const Ke={backdrop:"_backdrop_li82t_1",visible:"_visible_li82t_41",centrado:"_centrado_li82t_65",modal:"_modal_li82t_73",tamano_sm:"_tamano_sm_li82t_145",tamano_md:"_tamano_md_li82t_153",tamano_lg:"_tamano_lg_li82t_161",tamano_xl:"_tamano_xl_li82t_169",tamano_formulario:"_tamano_formulario_li82t_177",tamano_full:"_tamano_full_li82t_185",tamano_auto:"_tamano_auto_li82t_193",encabezado:"_encabezado_li82t_203",encabezado_custom:"_encabezado_custom_li82t_221",contenedor_titulo_completo:"_contenedor_titulo_completo_li82t_233",contenedor_titulo_icono:"_contenedor_titulo_icono_li82t_243",icono_titulo:"_icono_titulo_li82t_255",titulo:"_titulo_li82t_269",contenido:"_contenido_li82t_289",pie:"_pie_li82t_303",loading_overlay:"_loading_overlay_li82t_323",spinner:"_spinner_li82t_349",spinner_dot:"_spinner_dot_li82t_365",loadingBounce:"_loadingBounce_li82t_1",loading_text:"_loading_text_li82t_433",radius_none:"_radius_none_li82t_447",radius_sm:"_radius_sm_li82t_455",radius_md:"_radius_md_li82t_463",radius_lg:"_radius_lg_li82t_471",radius_full:"_radius_full_li82t_479",close_button:"_close_button_li82t_487",texto_esc:"_texto_esc_li82t_579"},Co=_.forwardRef(({isOpen:e,onClose:t,size:r="md",title:n,titleIcon:o,closeOnBackdropClick:s=!1,closeOnEscape:i=!0,preventScroll:c=!0,isCentered:l=!0,header:u,footer:f,children:p,className:h="",contentClassName:d="",isLoading:v=!1,loadingMessage:g="Cargando...",backdropVariant:b="normal",showIconTitle:w=!1,onOpen:m,radius:y="lg",showCloseButton:k=!1,id:T,"data-testid":C,"aria-labelledby":S,"aria-describedby":M},D)=>{const O=_.useRef(null),H=_.useId(),V=T??`modal-${H}`,N=`${V}-title`,x=_.useCallback(()=>{v||t?.()},[t,v]);_.useEffect(()=>{if(e){if(m?.(),c){const j=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",j>0&&(document.body.style.paddingRight=`${j}px`)}if(i){const j=P=>{P.key==="Escape"&&x()};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,x,i,c,m]);const A=j=>{s&&j.target===O.current&&x()},$=[Ke.backdrop,l&&Ke.centrado,e&&Ke.visible].filter(Boolean).join(" "),F=[Ke.modal,Ke[`tamano_${r}`],Ke[`radius_${y}`],h].filter(Boolean).join(" "),E=[Ke.contenido,d].filter(Boolean).join(" "),I={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:L}=I[b]||I.normal,R={background:`rgb(0 0 0 / ${L})`};return a.jsx("div",{className:$,ref:O,onClick:A,style:R,children:a.jsxs("div",{ref:D,id:V,className:F,role:"dialog","aria-modal":"true","aria-labelledby":S??(n?N:void 0),"aria-describedby":M,"data-testid":C??V,children:[(n||u||k)&&a.jsx("div",{className:`${Ke.encabezado}${u?` ${Ke.encabezado_custom}`:""}`,children:u||a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ke.contenedor_titulo_completo,children:a.jsxs("div",{className:Ke.contenedor_titulo_icono,children:[w&&o!==void 0&&(typeof o=="string"?a.jsx("span",{className:Ke.icono_titulo,children:o}):o),w&&o===void 0&&a.jsx("span",{className:Ke.icono_titulo,children:"📄"}),n&&a.jsx("h2",{id:N,className:Ke.titulo,children:n})]})}),k&&a.jsxs("button",{type:"button",className:Ke.close_button,onClick:x,"aria-label":"Cerrar",children:[a.jsx("span",{className:Ke.texto_esc,children:"ESC"}),a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),a.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})]})]})}),a.jsx("div",{className:E,children:p}),f&&a.jsx("div",{className:Ke.pie,children:f}),v&&a.jsxs("div",{className:Ke.loading_overlay,children:[a.jsxs("div",{className:Ke.spinner,children:[a.jsx("span",{className:Ke.spinner_dot}),a.jsx("span",{className:Ke.spinner_dot}),a.jsx("span",{className:Ke.spinner_dot})]}),a.jsx("span",{className:Ke.loading_text,children:g})]})]})})});Co.displayName="Modal";function Gh(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",...e,children:[a.jsx("path",{fill:"currentColor",d:"M232 128c0 12.5-17.8 22-22.7 33.7s1.4 30.6-7.8 39.8s-28.5 3.1-39.8 7.8S140.5 232 128 232s-22-17.8-33.7-22.7s-30.6 1.4-39.8-7.8s-3.1-28.5-7.8-39.8S24 140.5 24 128s17.8-22 22.7-33.7s-1.4-30.6 7.8-39.8s28.5-3.1 39.8-7.8S115.5 24 128 24s22 17.8 33.7 22.7s30.6-1.4 39.8 7.8s3.1 28.5 7.8 39.8S232 115.5 232 128Z",opacity:".2"}),a.jsx("path",{fill:"currentColor",d:"M225.9 102.8c-3.8-3.9-7.7-8-9.2-11.5s-1.4-8.7-1.5-14c-.1-9.7-.3-20.8-8-28.5s-18.8-7.9-28.5-8c-5.3-.1-10.7-.2-14-1.5s-7.6-5.4-11.5-9.2C146.3 23.5 138.4 16 128 16s-18.3 7.5-25.2 14.1c-3.9 3.8-8 7.7-11.5 9.2s-8.7 1.4-14 1.5c-9.7.1-20.8.3-28.5 8s-7.9 18.8-8 28.5c-.1 5.3-.2 10.7-1.5 14s-5.4 7.6-9.2 11.5C23.5 109.7 16 117.6 16 128s7.5 18.3 14.1 25.2c3.8 3.9 7.7 8 9.2 11.5s1.4 8.7 1.5 14c.1 9.7.3 20.8 8 28.5s18.8 7.9 28.5 8c5.3.1 10.7.2 14 1.5s7.6 5.4 11.5 9.2c6.9 6.6 14.8 14.1 25.2 14.1s18.3-7.5 25.2-14.1c3.9-3.8 8-7.7 11.5-9.2s8.7-1.4 14-1.5c9.7-.1 20.8-.3 28.5-8s7.9-18.8 8-28.5c.1-5.3.2-10.7 1.5-14s5.4-7.6 9.2-11.5c6.6-6.9 14.1-14.8 14.1-25.2s-7.5-18.3-14.1-25.2ZM120 136V80a8 8 0 0 1 16 0v56a8 8 0 0 1-16 0Zm20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12Z"})]})}function qh(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[a.jsx("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),a.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"})]})}function Rh(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:a.jsxs("g",{fill:"currentColor",children:[a.jsxs("g",{opacity:".2",children:[a.jsx("path",{d:"M14.696 12.282a1 1 0 1 1-1.392 1.436a2 2 0 0 0-.102-.09a2.4 2.4 0 0 0-.623-.348c-.453-.18-1-.28-1.579-.28c-.914 0-1.733.251-2.202.629q-.056.044-.102.089a1 1 0 1 1-1.392-1.436q.114-.11.24-.212C8.395 11.387 9.656 11 11 11c.827 0 1.624.146 2.316.42c.43.17.815.389 1.14.65q.126.102.24.212"}),a.jsx("path",{d:"M17.213 9.689a1 1 0 1 1-1.426 1.402a4 4 0 0 0-.312-.285a5.5 5.5 0 0 0-.767-.521a6 6 0 0 0-.932-.425a7 7 0 0 0-1.057-.298a8 8 0 0 0-1.137-.153a9 9 0 0 0-1.74.058a8 8 0 0 0-1.102.227a7 7 0 0 0-1 .364a6 6 0 0 0-.854.477a5 5 0 0 0-.361.27a4 4 0 0 0-.312.286A1 1 0 1 1 4.787 9.69q.218-.22.462-.424q.243-.201.512-.384a7.5 7.5 0 0 1 1.15-.643a9 9 0 0 1 1.286-.469a10 10 0 0 1 1.379-.284A10.5 10.5 0 0 1 11 7.39a11 11 0 0 1 1.424.095a10 10 0 0 1 1.38.284a9 9 0 0 1 1.285.469a8 8 0 0 1 1.15.643q.27.183.512.384q.244.204.462.424"}),a.jsx("path",{d:"M19.245 7.222a1 1 0 0 1-1.49 1.333a6 6 0 0 0-.456-.459a7 7 0 0 0-.52-.43a8.4 8.4 0 0 0-1.215-.747a9 9 0 0 0-1.408-.563a10 10 0 0 0-1.542-.35A11 11 0 0 0 11 5.89a11 11 0 0 0-1.614.117a10.5 10.5 0 0 0-1.542.35a9.6 9.6 0 0 0-1.407.564a8 8 0 0 0-.635.353a8 8 0 0 0-.58.393a7 7 0 0 0-.52.43a6 6 0 0 0-.457.46a1 1 0 0 1-1.49-1.334q.28-.314.6-.604q.316-.29.668-.553q.351-.262.732-.496a10.4 10.4 0 0 1 1.62-.813a11.6 11.6 0 0 1 1.785-.554a12.5 12.5 0 0 1 1.883-.279a13.2 13.2 0 0 1 2.864.105a12.5 12.5 0 0 1 1.842.418a11.6 11.6 0 0 1 1.71.686a10.4 10.4 0 0 1 1.518.933q.351.264.669.553t.6.604M13 16.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0"})]}),a.jsx("path",{d:"M13.348 11.641a.5.5 0 0 1-.696.718a2 2 0 0 0-.136-.12a3 3 0 0 0-.753-.424A4.8 4.8 0 0 0 10 11.5c-1.022 0-1.951.285-2.516.739q-.073.06-.136.12a.5.5 0 0 1-.696-.718q.097-.094.206-.182c.754-.606 1.905-.959 3.142-.959c.765 0 1.5.134 2.132.385c.385.153.726.346 1.01.574q.109.089.206.182m2.508-2.601a.5.5 0 1 1-.712.7a5 5 0 0 0-.35-.32a5 5 0 0 0-.399-.298a6.6 6.6 0 0 0-1.449-.731a8 8 0 0 0-1.126-.319a9 9 0 0 0-1.205-.162a9.3 9.3 0 0 0-1.839.061a9 9 0 0 0-1.172.242a8 8 0 0 0-1.071.39a6.6 6.6 0 0 0-.928.519q-.21.143-.399.298q-.186.155-.35.32a.5.5 0 0 1-.712-.7q.198-.202.424-.39q.225-.186.474-.355a7 7 0 0 1 1.076-.602a8 8 0 0 1 1.215-.443a9 9 0 0 1 1.31-.27A10 10 0 0 1 10 6.89a10 10 0 0 1 1.357.09a10 10 0 0 1 1.31.27a9 9 0 0 1 1.215.443a7.6 7.6 0 0 1 1.076.602q.249.17.474.355q.226.188.424.39"}),a.jsx("path",{d:"M17.873 6.555a.5.5 0 1 1-.746.667a7 7 0 0 0-.492-.496a8 8 0 0 0-.557-.46a9 9 0 0 0-1.29-.794a9.5 9.5 0 0 0-1.484-.594a10.6 10.6 0 0 0-1.617-.366A11.4 11.4 0 0 0 10 4.389a12 12 0 0 0-1.687.123a11 11 0 0 0-1.617.366a10 10 0 0 0-1.483.595a9 9 0 0 0-.673.374a8 8 0 0 0-.618.42q-.294.22-.557.46q-.263.239-.492.495a.5.5 0 1 1-.746-.667q.264-.294.564-.568t.632-.521q.332-.249.694-.471a10 10 0 0 1 1.545-.775a11 11 0 0 1 1.709-.53a12 12 0 0 1 1.808-.268a12.7 12.7 0 0 1 2.754.1a12 12 0 0 1 1.767.401a11 11 0 0 1 1.635.656q.387.194.749.416q.36.222.693.47q.333.249.632.522q.3.274.564.568M11.75 15.25a1.75 1.75 0 1 1-3.5 0a1.75 1.75 0 0 1 3.5 0"}),a.jsx("path",{d:"M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"})]})})}function Kh(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M13.435 2.075a3.33 3.33 0 0 0-2.87 0c-.394.189-.755.497-1.26.928l-.079.066a2.56 2.56 0 0 1-1.58.655l-.102.008c-.662.053-1.135.09-1.547.236a3.33 3.33 0 0 0-2.03 2.029c-.145.412-.182.885-.235 1.547l-.008.102a2.56 2.56 0 0 1-.655 1.58l-.066.078c-.431.506-.74.867-.928 1.261a3.33 3.33 0 0 0 0 2.87c.189.394.497.755.928 1.26l.066.079c.41.48.604.939.655 1.58l.008.102c.053.662.09 1.135.236 1.547a3.33 3.33 0 0 0 2.029 2.03c.412.145.885.182 1.547.235l.102.008c.629.05 1.09.238 1.58.655l.078.066c.506.431.867.74 1.261.928a3.33 3.33 0 0 0 2.87 0c.394-.189.755-.497 1.26-.928l.079-.066c.48-.41.939-.604 1.58-.655l.102-.008c.662-.053 1.135-.09 1.547-.236a3.33 3.33 0 0 0 2.03-2.029c.145-.412.182-.885.235-1.547l.008-.102c.05-.629.238-1.09.655-1.58l.066-.079c.431-.505.74-.866.928-1.26a3.33 3.33 0 0 0 0-2.87c-.189-.394-.497-.755-.928-1.26l-.066-.079a2.56 2.56 0 0 1-.655-1.58l-.008-.102c-.053-.662-.09-1.135-.236-1.547a3.33 3.33 0 0 0-2.029-2.03c-.412-.145-.885-.182-1.547-.235l-.102-.008a2.56 2.56 0 0 1-1.58-.655l-.079-.066c-.505-.431-.866-.74-1.26-.928M12 7.25a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M10.75 16a.75.75 0 0 1 .5-.707v-3.586a.75.75 0 0 1 .25-1.457h.5a.75.75 0 0 1 .75.75v4.293a.75.75 0 0 1-.25 1.457h-1a.75.75 0 0 1-.75-.75"})})}function Xh(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:[a.jsx("defs",{children:a.jsx("mask",{id:"SVG4IxzvcIZ",children:a.jsxs("g",{fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",children:[a.jsx("path",{fill:"#555",d:"m24 4l5.253 3.832l6.503-.012l1.997 6.188l5.268 3.812L41 24l2.021 6.18l-5.268 3.812l-1.997 6.188l-6.503-.012L24 44l-5.253-3.832l-6.503.012l-1.997-6.188l-5.268-3.812L7 24l-2.021-6.18l5.268-3.812l1.997-6.188l6.503.012z"}),a.jsx("path",{d:"m17 24l5 5l10-10"})]})})}),a.jsx("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#SVG4IxzvcIZ)"})]})}const ut={contenido:"_contenido_rd5zt_1",modal_radio:"_modal_radio_rd5zt_11",cuerpo:"_cuerpo_rd5zt_19",icono_wrapper:"_icono_wrapper_rd5zt_37",icono:"_icono_rd5zt_37",icono_personalizado:"_icono_personalizado_rd5zt_55",titulo:"_titulo_rd5zt_87",mensaje:"_mensaje_rd5zt_107",descripcion:"_descripcion_rd5zt_127",grupo_botones:"_grupo_botones_rd5zt_143",solo_confirmar:"_solo_confirmar_rd5zt_159",boton_modal:"_boton_modal_rd5zt_167",advertencia:"_advertencia_rd5zt_181",eliminar:"_eliminar_rd5zt_189",exito:"_exito_rd5zt_197",info:"_info_rd5zt_205",sin_conexion:"_sin_conexion_rd5zt_213",personalizado:"_personalizado_rd5zt_221"},Yh={advertencia:Gh,eliminar:qh,exito:Xh,info:Kh,"sin-conexion":Rh},Zh={advertencia:ut.advertencia,eliminar:ut.eliminar,exito:ut.exito,info:ut.info,"sin-conexion":ut.sin_conexion,personalizado:ut.personalizado},Qr=_.forwardRef(({isOpen:e,tipo:t="advertencia",titulo:r,mensaje:n,descripcion:o,textoConfirmar:s="Confirmar",textoCancelar:i="Cancelar",onConfirmar:c,onCancelar:l,size:u="sm",closeOnBackdropClick:f=!1,icono:p,loadingConfirmar:h=!1,timeout:d,colorTipo:v,colorBotonConfirmar:g,classNames:b,backdropBlur:w="6px",id:m,"data-testid":y},k)=>{const T=Yh[t],C=t==="exito",S=_.useId(),M=m??`modal-aviso-${S}`,D=r?`${M}-title`:void 0,O=n?`${M}-message`:void 0;_.useEffect(()=>{if(!e||!d)return;const V=setTimeout(c,d);return()=>clearTimeout(V)},[e,d,c]);const H=v?{"--color-tipo":v}:void 0;return a.jsx(Co,{ref:k,isOpen:e,onClose:l,size:u,isCentered:!0,closeOnBackdropClick:f,closeOnEscape:!C,backdropBlur:w,className:ut.modal_radio,contentClassName:ut.contenido,id:M,"data-testid":y??M,"aria-labelledby":D,"aria-describedby":O,children:a.jsxs("div",{className:te(ut.cuerpo,Zh[t],b?.body),style:H,children:[a.jsx("div",{className:te(ut.icono_wrapper,b?.icon),children:p?a.jsx("span",{className:ut.icono_personalizado,"aria-hidden":"true",children:p}):T&&a.jsx(T,{className:ut.icono,"aria-hidden":"true"})}),r&&a.jsx("h2",{id:D,className:te(ut.titulo,b?.title),children:r}),n&&a.jsx("p",{id:O,className:te(ut.mensaje,b?.message),children:n}),o&&a.jsx("p",{className:te(ut.descripcion,b?.description),children:o}),a.jsxs("div",{className:te(ut.grupo_botones,C&&ut.solo_confirmar,b?.buttonGroup),children:[!C&&a.jsx(He,{variant:"outline",size:"sm",fullWidth:!0,className:te(ut.boton_modal,b?.cancelButton),onClick:l,children:i}),a.jsx(He,{size:"sm",fullWidth:!0,isLoading:h,className:te(ut.boton_modal,b?.confirmButton),style:{"--btn-color":g??"var(--color-tipo)"},onClick:c,children:s})]})]})})});Qr.displayName="ModalAviso";const Rt={group_button:"_group_button_stv5t_1",full_width:"_full_width_stv5t_9",main_button:"_main_button_stv5t_14",dropdown_trigger:"_dropdown_trigger_stv5t_18",first_item:"_first_item_stv5t_23",last_item:"_last_item_stv5t_28",variant_bordered:"_variant_bordered_stv5t_33",variant_ghost:"_variant_ghost_stv5t_34",variant_faded:"_variant_faded_stv5t_35",variant_outline:"_variant_outline_stv5t_36",variant_shadow:"_variant_shadow_stv5t_37",disabled:"_disabled_stv5t_59",loading:"_loading_stv5t_59",chevron:"_chevron_stv5t_68",chevron_open:"_chevron_open_stv5t_74"},Jh=_.forwardRef(function({label:t,onClick:r,items:n,variant:o="solid",color:s="primary",size:i="md",radius:c="lg",isLoading:l=!1,isDisabled:u=!1,dropdownIcon:f,className:p,fullWidth:h=!1,href:d,target:v,rel:g,isOpen:b,onOpenChange:w,isDropdownLoading:m=!1,id:y,"data-testid":k,...T},C){const[S,M]=_.useState(!1),D=_.useId(),O=y??`group-button-${D}`,H=$=>{M($),w?.($)},V=te(Rt.group_button,Rt[`variant_${o}`],h&&Rt.full_width,p),N=u||m,x=u||l||m,A=()=>a.jsx("div",{className:te(Rt.chevron,S&&Rt.chevron_open),children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:a.jsx("path",{d:"m6 9 6 6 6-6"})})});return a.jsxs("div",{ref:C,id:O,className:V,"data-testid":k??O,role:"group",children:[a.jsx(He,{variant:o,color:s,size:i,radius:c,isLoading:l,isDisabled:N,onClick:r,href:d,target:v,rel:g,className:te(Rt.main_button,Rt.first_item),...T,children:t}),n&&a.jsx(Zr,{items:n,triggerAction:"click",isOpen:b,onOpenChange:H,placement:"bottom-end",isDisabled:x,variant:"default",size:i==="xs"?"sm":i,matchTriggerWidth:!1,children:a.jsx(He,{variant:o,color:s,size:i,radius:c,isDisabled:x,isLoading:m,onlyLoading:m,isIconOnly:!0,className:te(Rt.dropdown_trigger,Rt.last_item),"aria-label":"Más acciones",children:f||A()})})]})}),xc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),kc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),Ec=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),Cc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"15 18 9 12 15 6"})}),Sc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),rt={overlay:"_overlay_svvew_1",backdrop:"_backdrop_svvew_25",visible:"_visible_svvew_47",layout:"_layout_svvew_77",columna_acciones:"_columna_acciones_svvew_147",boton_flotante:"_boton_flotante_svvew_167",boton_primario:"_boton_primario_svvew_241",boton_peligro:"_boton_peligro_svvew_251",panel:"_panel_svvew_269",tirador:"_tirador_svvew_299",encabezado:"_encabezado_svvew_307",titulo:"_titulo_svvew_325",contenido:"_contenido_svvew_341",paginacion:"_paginacion_svvew_355",texto_paginacion:"_texto_paginacion_svvew_381",tirador_barra:"_tirador_barra_svvew_531"},Qh={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},e0=({isOpen:e,onClose:t,onApply:r,onClear:n,title:o,backdropVariant:s="sutil",backdropBlur:i=!0,closeOnBackdropClick:c=!0,allowBackdropInteraction:l=!1,getContainer:u,children:f,id:p,"data-testid":h})=>{const[d,v]=_.useState(!1),[g,b]=_.useState(0),w=_.useRef(null),m=_.useId(),y=p??`panel-filtros-${m}`,k=o?`${y}-title`:void 0,T=l||s==="transparente",C=_.useCallback(()=>{d||v(!0)},[d]);_.useEffect(()=>{e&&(v(!1),b(0))},[e]),_.useEffect(()=>{if(!d)return;let I=!1;const L=()=>{I||(I=!0,t(),v(!1))},R=w.current,j=U=>{U.target===R&&U.propertyName==="transform"&&L()};R?.addEventListener("transitionend",j);const P=setTimeout(L,600);return()=>{R?.removeEventListener("transitionend",j),clearTimeout(P)}},[d,t]);const{style:S,handlers:M}=bc(w,{position:"bottom",isOpen:e,enabled:!0,closeThreshold:.3,onClose:C});_.useEffect(()=>{if(!e)return;const I=L=>L.key==="Escape"&&C();return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,C]);const D=_.useCallback(I=>{c&&I.target===I.currentTarget&&C()},[c,C]),O=_.useCallback(I=>{document.activeElement?.blur(),I?.()},[]),{pages:H,totalPages:V,hasPagination:N}=_.useMemo(()=>{const I=Array.isArray(f)?f:[f];return{pages:I,totalPages:I.length,hasPagination:I.length>1}},[f]),{background:x}=Qh[s],A={background:x,backdropFilter:i?"blur(1px)":"none",pointerEvents:T?"none":"auto"},$=u?{position:"absolute"}:{},F=u?{position:"relative"}:{},E=a.jsxs("div",{id:y,className:rt.overlay,role:"dialog","aria-modal":"true","aria-labelledby":k,"aria-label":o?void 0:"Panel de filtros","data-testid":h??y,style:$,children:[a.jsx("div",{className:`${rt.backdrop} ${e&&!d?rt.visible:""}`,style:A,onClick:D}),a.jsxs("div",{ref:w,className:`${rt.layout} ${e&&!d?rt.visible:""}`,style:{...F,...S},children:[a.jsxs("aside",{className:rt.columna_acciones,children:[a.jsx(tr,{content:"Cerrar",placement:"left",children:a.jsx("button",{type:"button",className:rt.boton_flotante,onClick:()=>O(C),"aria-label":"Cerrar panel",children:a.jsx(xc,{})})}),a.jsx(tr,{content:"Aplicar filtros",placement:"left",children:a.jsx("button",{type:"button",className:`${rt.boton_flotante} ${rt.boton_primario}`,onClick:()=>O(r),children:a.jsx(kc,{})})}),a.jsx(tr,{content:"Limpiar filtros",placement:"left",children:a.jsx("button",{type:"button",className:`${rt.boton_flotante} ${rt.boton_peligro}`,onClick:()=>O(n),children:a.jsx(Ec,{})})}),N&&a.jsxs("div",{className:rt.paginacion,children:[a.jsx("button",{type:"button",className:rt.boton_flotante,style:{width:36,height:36},onClick:()=>b(I=>Math.max(0,I-1)),disabled:g===0,"aria-label":"Página anterior",children:a.jsx(Cc,{})}),a.jsxs("span",{className:rt.texto_paginacion,children:[g+1," / ",V]}),a.jsx("button",{type:"button",className:rt.boton_flotante,style:{width:36,height:36},onClick:()=>b(I=>Math.min(V-1,I+1)),disabled:g===V-1,"aria-label":"Página siguiente",children:a.jsx(Sc,{})})]})]}),a.jsxs("main",{className:rt.panel,children:[a.jsx("div",{className:rt.tirador,...M,children:a.jsx("span",{className:rt.tirador_barra})}),o&&a.jsx("header",{className:rt.encabezado,children:a.jsx("h2",{id:k,className:rt.titulo,children:o})}),a.jsx("div",{className:rt.contenido,children:a.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:H[g]},g)})]})]})]});if(u){const I=typeof u=="function"?u():u;if(I&&I instanceof HTMLElement)return $r.createPortal(E,I)}return E},re={backdrop:"_backdrop_cyx4s_1",visible:"_visible_cyx4s_41",modal:"_modal_cyx4s_65",encabezado:"_encabezado_cyx4s_147",encabezado_textos:"_encabezado_textos_cyx4s_161",titulo:"_titulo_cyx4s_173",subtitulo:"_subtitulo_cyx4s_187",boton_cerrar:"_boton_cerrar_cyx4s_199",texto_esc:"_texto_esc_cyx4s_249",cuerpo:"_cuerpo_cyx4s_263",zona_carga:"_zona_carga_cyx4s_283",zona_carga_activa:"_zona_carga_activa_cyx4s_315",zona_carga_deshabilitada:"_zona_carga_deshabilitada_cyx4s_351",zona_contenido:"_zona_contenido_cyx4s_363",zona_icono_flotante:"_zona_icono_flotante_cyx4s_379",zona_textos:"_zona_textos_cyx4s_435",zona_titulo:"_zona_titulo_cyx4s_449",zona_separador:"_zona_separador_cyx4s_463",zona_meta:"_zona_meta_cyx4s_497",zona_meta_sep:"_zona_meta_sep_cyx4s_519",zona_meta_tam:"_zona_meta_tam_cyx4s_529",zona_meta_label:"_zona_meta_label_cyx4s_539",tipos_permitidos:"_tipos_permitidos_cyx4s_551",tipo_chip:"_tipo_chip_cyx4s_567",contador:"_contador_cyx4s_589",boton_elegir:"_boton_elegir_cyx4s_609",zona_arrastrando:"_zona_arrastrando_cyx4s_675",drag_icon_wrap:"_drag_icon_wrap_cyx4s_707",drag_ring:"_drag_ring_cyx4s_725",drag_ring_2:"_drag_ring_2_cyx4s_749",drag_ring_3:"_drag_ring_3_cyx4s_757",drag_icono:"_drag_icono_cyx4s_789",drag_textos:"_drag_textos_cyx4s_841",drag_titulo:"_drag_titulo_cyx4s_857",drag_subtitulo:"_drag_subtitulo_cyx4s_871",drag_chips:"_drag_chips_cyx4s_885",drag_chip:"_drag_chip_cyx4s_885",banner_limite:"_banner_limite_cyx4s_953",banner_limite_icono:"_banner_limite_icono_cyx4s_973",banner_limite_cuerpo:"_banner_limite_cuerpo_cyx4s_983",banner_limite_titulo:"_banner_limite_titulo_cyx4s_999",banner_limite_desc:"_banner_limite_desc_cyx4s_1011",banner_limite_pill:"_banner_limite_pill_cyx4s_1021",seccion_lista:"_seccion_lista_cyx4s_1041",cabecera_lista:"_cabecera_lista_cyx4s_1057",cabecera_titulo:"_cabecera_titulo_cyx4s_1071",lista_vacia:"_lista_vacia_cyx4s_1085",ilustracion_vacia:"_ilustracion_vacia_cyx4s_1103",lista_vacia_titulo:"_lista_vacia_titulo_cyx4s_1115",lista_vacia_desc:"_lista_vacia_desc_cyx4s_1127",lista:"_lista_cyx4s_1085",fila:"_fila_cyx4s_1251",fila_eliminada:"_fila_eliminada_cyx4s_1289",fila_subiendo:"_fila_subiendo_cyx4s_1289",fila_entrando:"_fila_entrando_cyx4s_1299",fila_saliendo:"_fila_saliendo_cyx4s_1307",fila_nombre:"_fila_nombre_cyx4s_1341",fila_restaurando:"_fila_restaurando_cyx4s_1401",fila_icono:"_fila_icono_cyx4s_1409",fila_error:"_fila_error_cyx4s_1421",fila_aviso:"_fila_aviso_cyx4s_1429",fila_cuerpo:"_fila_cuerpo_cyx4s_1437",fila_error_texto:"_fila_error_texto_cyx4s_1453",estado:"_estado_cyx4s_1479",estado_guardado:"_estado_guardado_cyx4s_1495",estado_nuevo:"_estado_nuevo_cyx4s_1505",estado_subiendo:"_estado_subiendo_cyx4s_1515",estado_eliminado:"_estado_eliminado_cyx4s_1537",fila_acciones:"_fila_acciones_cyx4s_1557",btn_eliminar:"_btn_eliminar_cyx4s_1569",btn_restaurar:"_btn_restaurar_cyx4s_1631",btn_reintentar:"_btn_reintentar_cyx4s_1699",spinner:"_spinner_cyx4s_1743",pie:"_pie_cyx4s_1765",pie_info:"_pie_info_cyx4s_1783",btn_pie:"_btn_pie_cyx4s_1795",input_archivo:"_input_archivo_cyx4s_1803"},t0={pdf:"application/pdf",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",avif:"image/avif",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",csv:"text/csv",rar:"application/x-rar-compressed",zip:"application/zip","7z":"application/x-7z-compressed"},r0={"image/jpeg":"JPG","image/png":"PNG","image/webp":"WEBP","image/gif":"GIF","image/avif":"AVIF","application/pdf":"PDF","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","text/csv":"CSV","application/zip":"ZIP","application/x-rar-compressed":"RAR","application/x-7z-compressed":"7Z"},n0={JPG:"#10b981",PNG:"#6366f1",WEBP:"#06b6d4",GIF:"#ec4899",AVIF:"#8b5cf6",PDF:"#ef4444",XLS:"#22c55e",XLSX:"#16a34a",CSV:"#4ade80",ZIP:"#f59e0b",RAR:"#f97316","7Z":"#fb923c"};function a0(e){if(!e.length)return;const t=new Set;return e.forEach(r=>{t.add(`.${r}`);const n=t0[r];n&&t.add(n)}),[...t].join(",")}let o0=0;function Tc(){return`fs_${Date.now()}_${++o0}`}const s0=300,Ac=["pending","saved","uploading"];function i0({savedFiles:e,maxFiles:t,maxSizeMB:r,allowedTypes:n,subiendo:o}){const[s,i]=_.useState(()=>e.map(g=>({id:g.id??Tc(),name:g.name,file:null,url:g.url,status:"saved"}))),c=s.filter(g=>Ac.includes(g.status)).length,l=t!==1/0&&c>=t,u=o||l,f=s.some(g=>g.status==="pending"||g.status==="deleted"&&g.url),p=_.useCallback(g=>{if(u)return;const b=[];let w=t===1/0?1/0:t-c;const m=new Set(s.filter(k=>Ac.includes(k.status)).map(k=>k.name.toLowerCase()));for(const k of g){const T=k.name.split(".").pop()?.toLowerCase()??"",C={id:Tc(),name:k.name,file:k,entering:!0};k.size>r*1024*1024?b.push({...C,status:"error",error:"too-large"}):n.length>0&&!n.includes(T)?b.push({...C,status:"error",error:"invalid-type"}):m.has(k.name.toLowerCase())?b.push({...C,status:"error",error:"duplicate"}):w>0&&(b.push({...C,status:"pending"}),w!==1/0&&w--)}if(!b.length)return;const y=b.map(k=>k.id);i(k=>[...k,...b]),setTimeout(()=>{i(k=>k.map(T=>y.includes(T.id)?{...T,entering:!1}:T))},400)},[u,t,c,r,n,s]),h=_.useCallback(g=>{i(b=>{const w=b.find(m=>m.id===g);return w?w.status==="error"||w.status==="pending"?(setTimeout(()=>i(m=>m.filter(y=>y.id!==g)),s0),b.map(m=>m.id===g?{...m,saliendo:!0}:m)):b.map(m=>m.id===g?{...m,status:"deleted",prevStatus:m.status}:m):b})},[]),d=_.useCallback(g=>{i(b=>b.map(w=>w.id===g?{...w,status:w.prevStatus??"saved",restaurando:!0}:w)),setTimeout(()=>{i(b=>b.map(w=>w.id===g?{...w,restaurando:!1}:w))},600)},[]),v=_.useCallback(g=>{i(b=>b.map(w=>w.id===g?{...w,status:"pending",error:void 0}:w))},[]);return{archivos:s,setArchivos:i,cantidadActivos:c,limiteAlcanzado:l,zonaDeshabilitada:u,hayCambios:f,agregarArchivos:p,eliminarArchivo:h,restaurarArchivo:d,reintentarArchivo:v}}function c0({archivos:e,setArchivos:t,storagePath:r,fileNameBuilder:n,firebaseStorage:o,onFilesChange:s,onUploadError:i,onUploadComplete:c,setSubiendo:l,alTerminar:u}){const f=_.useCallback(()=>{if(o&&typeof o=="object")return o;if(!ca.getApps().length)throw new Error("Firebase no está inicializado. Inicializa la app o pasa firebaseStorage como prop.");return lt.getStorage()},[o]);return{ejecutarSubida:_.useCallback(async()=>{l(!0);const h=e.filter(y=>y.status==="pending"&&y.file),d=e.filter(y=>y.status==="deleted"&&y.url);t(y=>y.map(k=>k.status==="pending"?{...k,status:"uploading"}:k));const v=f(),g=e.filter(y=>y.status==="saved").map(y=>({id:y.id,name:y.name,url:y.url})),b=[];for(const y of h){const k=n?n(y.file):y.file.name,T=lt.ref(v,`${r}/${k}`);try{await lt.uploadBytes(T,y.file);const C=await lt.getDownloadURL(T);t(S=>S.map(M=>M.id===y.id?{...M,status:"saved",url:C}:M)),b.push({id:y.id,name:y.file.name,url:C})}catch(C){i?.(C instanceof Error?C:new Error(String(C))),t(S=>S.map(M=>M.id===y.id?{...M,status:"error",error:"network"}:M))}}const w=new Set(d.map(y=>y.id));for(const y of d)try{await lt.deleteObject(lt.ref(v,y.url))}catch(k){k?.code!=="storage/object-not-found"&&i?.(k instanceof Error?k:new Error(String(k)))}l(!1),t(y=>y.filter(k=>k.status!=="deleted"));const m=[...g.filter(y=>!w.has(y.id)),...b];s(m),c?.(m),u()},[e,t,r,n,f,i,s,c,l,u])}}const l0={jpg:"#10b981",jpeg:"#10b981",png:"#6366f1",webp:"#06b6d4",gif:"#ec4899",avif:"#8b5cf6",pdf:"#ef4444",xls:"#22c55e",xlsx:"#16a34a",csv:"#4ade80",rar:"#f97316",zip:"#f59e0b","7z":"#fb923c",tar:"#ea580c",doc:"#3b82f6",docx:"#2563eb",txt:"#64748b",md:"#475569",mp4:"#a855f7",mov:"#9333ea",avi:"#7e22ce",mp3:"#ec4899",wav:"#db2777",psd:"#0ea5e9",ai:"#f97316",svg:"#8b5cf6"};function d0(e){const t=e.split(".").pop()?.toLowerCase()??"";return l0[t]??"#94a3b8"}function u0(e){const t=e.split(".").pop()?.toLowerCase()??"";return t.length>4?t.slice(0,3).toUpperCase():t.toUpperCase()||"FILE"}function en({nombre:e,size:t=36}){const r=d0(e),n=u0(e),o=Math.round(t*44/36);return a.jsxs("svg",{width:t,height:o,viewBox:"0 0 36 44",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"4",y:"5",width:"29",height:"37",rx:"5",fill:"black",fillOpacity:"0.06"}),a.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",fill:"white"}),a.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),a.jsx("path",{d:"M23 2L33 12H26C24.343 12 23 10.657 23 9V2Z",fill:"#EEF2FF"}),a.jsx("path",{d:"M23 2L33 12",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),a.jsx("rect",{x:"8",y:"17",width:"18",height:"1.5",rx:"0.75",fill:r,fillOpacity:"0.2"}),a.jsx("rect",{x:"8",y:"21",width:"14",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),a.jsx("rect",{x:"8",y:"25",width:"16",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),a.jsx("path",{d:"M3 32H33V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V32Z",fill:r}),a.jsx("text",{x:"18",y:"39.5",textAnchor:"middle",fill:"white",fontSize:"8",fontWeight:"700",fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif",letterSpacing:"0.4",children:n})]})}function Nc({size:e=24,className:t}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:t,children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",children:[a.jsx("path",{strokeLinejoin:"round",d:"M2.75 12H6a2 2 0 0 1 2 2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2a2 2 0 0 1 2-2h3.25"}),a.jsx("path",{d:"M21.25 10.375v4.875a6 6 0 0 1-6 6h-6.5a6 6 0 0 1-6-6v-6.5a6 6 0 0 1 6-6h4.875"}),a.jsx("path",{strokeMiterlimit:"10",d:"M18.957 2.75v5"}),a.jsx("path",{strokeLinejoin:"round",d:"m21.25 4.855l-1.967-1.967a.46.46 0 0 0-.652 0l-1.967 1.967"})]})})}function f0({size:e=18,className:t}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:t,children:a.jsx("path",{fill:"currentColor",d:"M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"})})}function Ic({size:e=18,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),a.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})}function h0({size:e=20,className:t}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:t,children:[a.jsx("path",{fill:"currentColor",d:"M3 6.524c0-.395.327-.714.73-.714h4.788c.006-.842.098-1.995.932-2.793A3.68 3.68 0 0 1 12 2a3.68 3.68 0 0 1 2.55 1.017c.834.798.926 1.951.932 2.793h4.788c.403 0 .73.32.73.714a.72.72 0 0 1-.73.714H3.73A.72.72 0 0 1 3 6.524"}),a.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"}),a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"})]})}function _0({size:e=16,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("path",{d:"M12 21a9 9 0 1 0-9-9",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),a.jsx("path",{d:"M3 12V7m0 5h5",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function p0({size:e=16,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.12"}),a.jsx("path",{d:"M7.5 12.5l3 3 6-6",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round"})]})}function g0({size:e=20,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.16",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"M12 8v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),a.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"currentColor"})]})}function Mc({size:e=20,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("path",{d:"M10.268 4a2 2 0 0 1 3.464 0l7.536 13A2 2 0 0 1 19.536 20H4.464a2 2 0 0 1-1.732-3L10.268 4z",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),a.jsx("path",{d:"M12 9v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),a.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"currentColor"})]})}function v0({size:e=18,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("path",{d:"M2 12C4 7 7.5 4.5 12 4.5S20 7 22 12c-2 5-5.5 7.5-10 7.5S4 17 2 12z",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.8",fill:"currentColor",fillOpacity:"0.65"}),a.jsx("circle",{cx:"12",cy:"12",r:"1.15",fill:"currentColor"})]})}function Fc({size:e=18,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[a.jsx("path",{d:"M4 17v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"M12 4v11m0 0-3-3m3 3 3-3",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Oc({className:e}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 500",className:e,"aria-hidden":"true",children:[a.jsxs("g",{children:[a.jsx("rect",{y:"382.4",width:"500",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"449.63",y:"391.22",width:"18.77",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"373.07",y:"398.08",width:"8.69",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"279.96",y:"394.63",width:"19.36",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"80.93",y:"394.5",width:"43.19",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"65.7",y:"394.5",width:"6.33",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"189.3",y:"388.58",width:"93.68",height:"0.25",style:{fill:"#e6e6e6"}}),a.jsx("rect",{x:"58.71",y:"73.68",width:"202.25",height:"144.13",style:{fill:"#fafafa"}}),a.jsx("rect",{x:"60.46",y:"73.68",width:"204.24",height:"144.13",style:{fill:"#f5f5f5"}}),a.jsx("rect",{x:"96.4",y:"48.86",width:"132.36",height:"193.76",transform:"translate(308.32 -16.84) rotate(90)",style:{fill:"#fafafa"}}),a.jsx("polygon",{points:"100.98 211.92 131.72 79.56 172.02 79.56 141.28 211.92 100.98 211.92",style:{fill:"#fff"}}),a.jsx("polygon",{points:"147.8 211.92 178.55 79.56 196.75 79.56 166 211.92 147.8 211.92",style:{fill:"#fff"}}),a.jsx("rect",{x:"192.95",y:"145.41",width:"132.36",height:"0.67",transform:"translate(404.87 -113.39) rotate(90)",style:{fill:"#fafafa"}}),a.jsx("path",{d:"M54.78,73.44v57.12H69.89S97,112.85,103.21,76.42a6.06,6.06,0,0,0-6-7.09H58.89A4.11,4.11,0,0,0,54.78,73.44Z",style:{fill:"#e0e0e0"}}),a.jsx("path",{d:"M54.78,235.44V135.17H69.89s30.67,59.05,34.22,100.27Z",style:{fill:"#e0e0e0"}}),a.jsx("rect",{x:"53.82",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",style:{fill:"#f5f5f5"}}),a.jsx("path",{d:"M269,73.44v57.12H253.86s-27.15-17.71-33.32-54.14a6.07,6.07,0,0,1,6-7.09h38.36A4.12,4.12,0,0,1,269,73.44Z",style:{fill:"#e0e0e0"}}),a.jsx("path",{d:"M269,235.44V135.17H253.86s-30.66,59.05-34.22,100.27Z",style:{fill:"#e0e0e0"}}),a.jsx("rect",{x:"252.8",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",transform:"translate(522.73 265.72) rotate(180)",style:{fill:"#f5f5f5"}}),a.jsx("rect",{x:"231.2",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#fafafa"}}),a.jsx("polygon",{points:"255.56 382.4 264.43 382.4 264.43 367.53 246.26 367.53 255.56 382.4",style:{fill:"#f4f8ff"}}),a.jsx("rect",{x:"72.22",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#e0e0e0"}}),a.jsx("rect",{x:"97.71",y:"253.66",width:"166.72",height:"123.62",style:{fill:"#fafafa"}}),a.jsx("path",{d:"M147.8,231.8c0,12,11.56,21.86,25.7,21.86h12.76c14.13,0,25.69-9.84,25.69-21.86Z",style:{fill:"#ebebeb"}}),a.jsx("path",{d:"M140.4,204.33h24s-4.17,11-4.17,17.48,18.26,31.85-7.83,31.85-7.83-25.38-7.83-31.85S140.4,204.33,140.4,204.33Z",style:{fill:"#e0e0e0"}}),a.jsx("rect",{x:"104.59",y:"261.19",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),a.jsx("polygon",{points:"106.58 382.4 97.71 382.4 97.71 367.53 115.89 367.53 106.58 382.4",style:{fill:"#fafafa"}}),a.jsx("path",{d:"M176.37,276.77a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,276.77Z",style:{fill:"#fafafa"}}),a.jsx("rect",{x:"104.59",y:"299.89",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),a.jsx("path",{d:"M176.37,315.47a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,315.47Z",style:{fill:"#fafafa"}}),a.jsx("rect",{x:"104.59",y:"338.58",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),a.jsx("circle",{cx:"181.07",cy:"354.17",r:"4.7",style:{fill:"#fafafa"}}),a.jsx("rect",{x:"295.65",y:"71.94",width:"74.23",height:"52.84",style:{fill:"#e0e0e0"}}),a.jsx("rect",{x:"299.87",y:"71.94",width:"76.07",height:"52.84",style:{fill:"#f5f5f5"}}),a.jsx("rect",{x:"316.34",y:"65.17",width:"43.14",height:"66.37",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#fff"}}),a.jsx("rect",{x:"328.9",y:"76.85",width:"18.01",height:"43.01",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#f5f5f5"}}),a.jsx("rect",{x:"384.92",y:"98.36",width:"45.18",height:"47.38",style:{fill:"#e0e0e0"}}),a.jsx("rect",{x:"389.15",y:"98.36",width:"47.03",height:"47.38",style:{fill:"#f5f5f5"}}),a.jsx("rect",{x:"393.82",y:"103.38",width:"37.68",height:"37.33",transform:"translate(534.71 -290.61) rotate(90)",style:{fill:"#fff"}}),a.jsx("path",{d:"M405.68,122.05h0a6.28,6.28,0,0,1,6.27-6.28h1.42a6.28,6.28,0,0,1,6.27,6.28h0a6.27,6.27,0,0,1-6.27,6.27H412A6.27,6.27,0,0,1,405.68,122.05Z",style:{fill:"#f5f5f5"}}),a.jsx("polygon",{points:"500 161.85 380.7 161.85 359.01 161.85 359.01 189.42 337.32 189.42 337.32 216.99 315.63 216.99 315.63 244.56 293.94 244.56 293.94 272.13 272.25 272.13 272.25 299.69 250.56 299.69 250.56 327.26 228.87 327.26 228.87 354.83 207.18 354.83 207.18 382.4 228.87 382.4 500 382.4 500 161.85",style:{fill:"#fafafa"}}),a.jsx("rect",{x:"204.95",y:"354.83",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"226.64",y:"327.26",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"248.33",y:"299.69",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"270.02",y:"272.12",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"291.71",y:"244.56",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"313.4",y:"216.99",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"335.09",y:"189.42",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("rect",{x:"356.78",y:"161.85",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),a.jsx("polygon",{points:"478.31 161.85 478.31 189.42 456.62 189.42 456.62 216.99 434.93 216.99 434.93 244.56 413.24 244.56 413.24 272.13 391.55 272.13 391.55 299.69 369.86 299.69 369.86 327.26 348.17 327.26 348.17 354.83 326.48 354.83 326.48 382.4 348.17 382.4 500 382.4 500 189.42 500 161.85 478.31 161.85",style:{fill:"#fff"}})]}),a.jsx("ellipse",{cx:"250",cy:"416.24",rx:"193.89",ry:"11.32",style:{fill:"#f5f5f5"}}),a.jsxs("g",{children:[a.jsx("path",{d:"M365.15,162c1.4,4.69,8.62,13.47,9.19,19.86s-11.74,16.61-11.74,16.61-9.2-30.76-3.44-34.35S365.15,162,365.15,162Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M339.87,195.23c-2.18,1.82-4.32,3.35-6.55,4.92s-4.53,3-6.87,4.34a77.83,77.83,0,0,1-7.25,3.79c-1.26.57-2.51,1.13-3.81,1.62-.64.26-1.29.51-1.95.73l-2,.7a13.24,13.24,0,0,1-5.26.38,30.07,30.07,0,0,1-4.36-.84,57.61,57.61,0,0,1-7.81-2.78,104.07,104.07,0,0,1-14.19-7.55l1.87-3.48c2.36,1,4.78,2,7.18,2.87s4.82,1.79,7.24,2.54a60.74,60.74,0,0,0,7.2,1.88,23.5,23.5,0,0,0,3.39.41,7.07,7.07,0,0,0,2.52-.26,64.62,64.62,0,0,0,6.68-3c1.11-.58,2.21-1.17,3.29-1.81s2.18-1.26,3.25-1.92c2.15-1.33,4.25-2.74,6.33-4.19s4.15-3,6-4.47Z",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M345.15,184.58c-2.48-1.94-12.74,4.41-15.85,7.06l2.27,13.73s14.75-6.18,15.63-10.4C348.13,190.56,347,186.06,345.15,184.58Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),a.jsx("polygon",{points:"385.58 406.47 377.79 407.05 374.94 389.12 382.73 388.54 385.58 406.47",style:{fill:"#e58a7b"}}),a.jsx("polygon",{points:"440.68 381.41 434.07 385.57 422.3 371.61 428.91 367.44 440.68 381.41",style:{fill:"#e58a7b"}}),a.jsx("polygon",{points:"374.94 389.12 376.52 399.08 384.2 397.79 382.74 388.55 374.94 389.12",style:{fill:"#cf6f64"}}),a.jsx("polygon",{points:"428.92 367.45 422.3 371.61 427.18 377.39 433.94 373.4 428.92 367.45",style:{fill:"#cf6f64"}}),a.jsx("path",{d:"M349,232.2s-.11,61.82,4.94,85.1c5.26,24.22,20.73,79.32,20.73,79.32l11.22-1.45s-8.77-55.66-12.51-79.73c-4.07-26.23-1.57-87.68-1.57-87.68Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),a.jsx("path",{d:"M371.11,255.16l-5.5-5.48c.21,23.75,1.54,35.48,6.11,48.26C371,284.43,370.94,268.45,371.11,255.16Z",style:{opacity:.5}}),a.jsx("path",{d:"M356.74,230.6s16.77,51.09,25.09,80.52c8.78,31.05,42.44,65.39,42.44,65.39l9.66-5.58s-23-32.6-31.46-61.57c-17.2-58.81-10.13-71.27-22.82-83.23Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),a.jsx("path",{d:"M343.56,147.09c4.46,1.49,8.51,12.56,8.68,16.92s-12.92,10.37-12.92,10.37-5.77-14-4.16-23C335.86,147.47,343.56,147.09,343.56,147.09Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M282.35,197.43l-5.29-5.76-1.73,7.22s3.76,3.32,6.8,2.18Z",style:{fill:"#e58a7b"}}),a.jsx("polygon",{points:"271.7 190.02 268 192.96 275.33 198.89 277.06 191.67 271.7 190.02",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M432,384.08l6.18-6.23a.63.63,0,0,1,.82-.06l5.63,4.18a1.25,1.25,0,0,1,.11,1.87c-2.2,2.13-3.36,3.05-6.08,5.79-1.67,1.69-3.94,4.32-6.25,6.65s-4.74.16-4-1c3.37-5.27,2.77-7.24,3-9.92A2,2,0,0,1,432,384.08Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M377.27,405.93h8.78a.66.66,0,0,1,.65.54l1.38,6.94a1.18,1.18,0,0,1-1.17,1.39c-3.07-.05-4.55-.23-8.41-.23-2.37,0-7.27.24-10.55.24s-3.63-3.24-2.28-3.53c6-1.32,8.35-3.13,10.32-4.87A2,2,0,0,1,377.27,405.93Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M349.81,161.79c3.41,2.85,8.36,7,14.19,2.15,5-4.18,8.5-15.15-.47-15.55C358.84,148.18,349.81,161.79,349.81,161.79Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M358.05,163.74c0,4.72.73,13.23,4.5,15.65,0,0-.34,4.86-8.8,6.5-9.29,1.81-5.34-3.75-5.34-3.75,4.84-2.2,4-5.94,2.4-9.3Z",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M355.1,167.45l-4.28,5.39a15.19,15.19,0,0,1,.92,2.42c1.88-.66,4.13-3.3,3.94-5.37A6.83,6.83,0,0,0,355.1,167.45Z",style:{fill:"#cf6f64"}}),a.jsx("path",{d:"M358.5,152.9c1,7.69,1.61,10.92-1.47,15.57-4.63,7-14.29,6.55-17.58-.68-3-6.51-4.12-18,2.72-22.45A10.57,10.57,0,0,1,358.5,152.9Z",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M345.14,139.43c-5.2,3.69,5.23,4.78,5.24,10.13,0,2.21,3.63,9.22,8.79,8.82l5-8.88C369.43,141,357,131,345.14,139.43Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M345.14,139.43c-9.15-.48-13.14,6.8-12.09,13.34a59.6,59.6,0,0,1,19.54-1.55C365.13,152.5,345.14,139.43,345.14,139.43Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M361,159.53a5.65,5.65,0,0,1-1.31,4.12c-1.29,1.51-3,.62-3.6-1.17-.51-1.62-.45-4.35,1.29-5.21A2.55,2.55,0,0,1,361,159.53Z",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M347.39,157.27c.12.62-.11,1.18-.51,1.26s-.83-.36-.95-1,.11-1.19.51-1.27S347.27,156.65,347.39,157.27Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M340.4,158.63c.12.62-.11,1.19-.51,1.27s-.83-.36-.95-1,.11-1.19.51-1.26S340.28,158,340.4,158.63Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M342.46,159.34a17.1,17.1,0,0,1-1.44,4.37,2.71,2.71,0,0,0,2.29,0Z",style:{fill:"#df5753"}}),a.jsx("path",{d:"M345.92,165.71a.18.18,0,0,1-.18-.15.18.18,0,0,1,.15-.21,5,5,0,0,0,3.62-2.7.18.18,0,1,1,.34.14,5.27,5.27,0,0,1-3.89,2.92Z",style:{fill:"#263238"}}),a.jsx("path",{d:"M353.5,192.54c-16.73,3.73-11.56-6.39-10.56-8.62l.42-.16c2-.73,2.4-.84,5.06-1.62a100.71,100.71,0,0,1,14.14-2.75l1-.14c1-.13,1.91-.23,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.12h0C370.56,180.23,371.39,188.57,353.5,192.54Z",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M379.76,224.21l1.95,2.52c.15.19-.06.46-.42.53l-32.66,6.36c-.28.06-.54,0-.59-.21l-.83-2.73c0-.19.16-.4.46-.46l31.54-6.14A.57.57,0,0,1,379.76,224.21Z",style:{fill:"#26395a"}}),a.jsx("path",{d:"M376.21,228.56l.85-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55C375.88,228.54,376.05,228.6,376.21,228.56Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M357.08,240.36l-6.51-2.42,1,6.19s4.72,1.7,7.13-.48Z",style:{fill:"#e58a7b"}}),a.jsx("polygon",{points:"344.37 239.58 342.82 243.64 351.57 244.13 350.57 237.94 344.37 239.58",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M351.06,233.46l.85-.16c.16,0,.28-.14.24-.25l-1.1-3.54c0-.11-.19-.16-.36-.13l-.85.16c-.17,0-.28.15-.24.25l1.1,3.55C350.73,233.44,350.89,233.5,351.06,233.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M363.64,231l.84-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55A.32.32,0,0,0,363.64,231Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M355.27,165.13c-2,3.31,5.25,4.84,9.54,1.45,3.43-2.72,2.62-9-.32-10.46S355.27,165.13,355.27,165.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.4}}),a.jsx("path",{d:"M379.66,226.13l-31.14,6.07c-16.09-43.57-12.59-45-12.59-45a62.53,62.53,0,0,1,7-3.3l.42-.16c2-.73,2.4-.84,5.06-1.62,4.58-1.09,8.85-2,14.14-2.75l1-.14c1-.12,1.91-.22,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.11c3.42-.17,5.87-.12,5.87-.12C375.13,205.75,376.67,213.56,379.66,226.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),a.jsx("path",{d:"M377.09,194.31l-4.8,2.86L377.83,218C376.62,211.69,377.16,204.76,377.09,194.31Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.27,mixBlendMode:"multiply"}}),a.jsx("polygon",{points:"387.9 395.13 372.62 397.11 371.62 392.85 387.53 389.48 387.9 395.13",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("polygon",{points:"434.74 370.59 423.47 377.1 419.67 373.85 432 365.51 434.74 370.59",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M381.85,189.13c.54,2.78.85,5.4,1.15,8.11s.41,5.39.49,8.1a80.09,80.09,0,0,1-.18,8.19c-.11,1.37-.23,2.74-.42,4.12-.08.68-.17,1.37-.3,2.06l-.37,2.12a13.32,13.32,0,0,1-2.21,4.79,29.67,29.67,0,0,1-2.84,3.41,56.66,56.66,0,0,1-6.2,5.5,103.64,103.64,0,0,1-13.46,8.79L355.37,241c2-1.59,4-3.23,6-4.9s3.9-3.36,5.73-5.12a62.64,62.64,0,0,0,5.11-5.39,23.76,23.76,0,0,0,2-2.78,7,7,0,0,0,1-2.33,66.19,66.19,0,0,0,.57-7.32c0-1.25,0-2.5,0-3.75s-.05-2.52-.11-3.78c-.12-2.52-.35-5-.62-7.56s-.62-5.09-1-7.46Z",style:{fill:"#e58a7b"}}),a.jsx("path",{d:"M380.64,180.63c4.27,3.46,3.25,13.74,3.25,13.74l-14.4,4.74s.66-11.85,1.38-16.11C371.71,177.93,376.43,177.22,380.64,180.63Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),a.jsx("path",{d:"M429.68,387.71a1.06,1.06,0,0,1-.86-.48.63.63,0,0,1-.11-.62c.35-.94,3.11-1.54,3.42-1.61a.19.19,0,0,1,.19.08.17.17,0,0,1,0,.2c-.54.89-1.6,2.38-2.59,2.43Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M431.32,385.46c-1,0-2.25-.25-2.62-.79a.65.65,0,0,1,.07-.81,1,1,0,0,1,.73-.38h.08c1.12,0,2.66,1.51,2.72,1.57a.18.18,0,0,1,.05.18.19.19,0,0,1-.13.13A3.61,3.61,0,0,1,431.32,385.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M374.4,407.3a3,3,0,0,1-1.91-.48,1,1,0,0,1-.38-.89.58.58,0,0,1,.28-.5c.92-.54,4.14,1.06,4.5,1.24a.19.19,0,0,1,.1.19.19.19,0,0,1-.14.16A13.33,13.33,0,0,1,374.4,407.3Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M376.81,407h-.07c-1-.43-2.93-2.13-2.79-3,0-.2.18-.46.68-.51h.15c1.74,0,2.19,3.18,2.21,3.32a.2.2,0,0,1-.07.18A.2.2,0,0,1,376.81,407Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M360.08,175.42c.71-.27,1.6,2.23,1.38,2.55-.51.73-9.85,3.28-10.27,1.85a6.24,6.24,0,0,1,.35-2.28C351.81,177.06,353.88,177.94,360.08,175.42Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M358.5,175.48c.36-.83,1.39-2.16,2.29-1.4s1.28,2.4.69,2.67S357.88,176.87,358.5,175.48Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M360.41,175.91c.62-.66,2-1.57,2.63-.55s.4,2.69-.24,2.74S359.36,177,360.41,175.91Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M360.75,175.76a2.77,2.77,0,0,1,1.39-2.67c1.14-.74,2.25-1.22,2.69-2a5.52,5.52,0,0,1,.11,2.24c-.23,1.07-3.78,1.89-3.54,2.82Z",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M360.6,175.71a2.77,2.77,0,0,1-.28-3c.54-1.24,1.22-2.24,1.18-3.12a5.57,5.57,0,0,1,1.31,1.82c.38,1-2.15,3.63-1.44,4.29Z",style:{fill:"var(--brand-primary, #407BFF)"}})]}),a.jsxs("g",{children:[a.jsx("path",{d:"M190.41,223.53h0A11,11,0,0,0,179.69,215h-80a11,11,0,0,0-11,11V403.82a11,11,0,0,0,11,11h254a11,11,0,0,0,11-11V254.45a11,11,0,0,0-11-11H215.44A25.68,25.68,0,0,1,190.41,223.53Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),a.jsx("path",{d:"M162.17,168.15l7.13,23.09a11.61,11.61,0,0,0,14.51,7.66l23.08-7.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),a.jsx("path",{d:"M162.17,168.15l-82.5,25.49A11.59,11.59,0,0,0,72,208.14l47.1,152.48a11.6,11.6,0,0,0,14.51,7.66L239.2,335.66a11.59,11.59,0,0,0,7.66-14.5l-40-129.39Z",style:{fill:"#fff",opacity:.8}}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M206.56,329l-68.64,21.2a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.33l68.64-21.21a5.08,5.08,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,206.56,329Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M132.69,204.58l-36.3,11.21a5.09,5.09,0,0,1-6.34-3.34h0a5.09,5.09,0,0,1,3.35-6.34l36.3-11.21a5.07,5.07,0,0,1,6.34,3.34h0A5.09,5.09,0,0,1,132.69,204.58Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M162.31,216.47l-60,18.53A5.08,5.08,0,0,1,96,231.65h0a5.07,5.07,0,0,1,3.34-6.33l60-18.53a5.08,5.08,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,162.31,216.47Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M195.81,227.16l-87.56,27a5.07,5.07,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l87.56-27a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,195.81,227.16Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M201.74,246.36l-50.9,15.73a5.08,5.08,0,0,1-6.33-3.35h0a5.08,5.08,0,0,1,3.34-6.33l50.9-15.73a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,201.74,246.36Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M127.5,269.3l-13.31,4.11a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.34l13.31-4.11a5.09,5.09,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,127.5,269.3Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M207.68,265.57l-87.56,27.05a5.08,5.08,0,0,1-6.33-3.35h0a5.07,5.07,0,0,1,3.34-6.33l87.56-27.05a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,207.68,265.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M179.82,295.21l-53.77,16.61a5.08,5.08,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l53.77-16.61a5.09,5.09,0,0,1,6.34,3.35h0A5.07,5.07,0,0,1,179.82,295.21Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M213.61,284.78l-14.35,4.43a5.09,5.09,0,0,1-6.34-3.35h0a5.08,5.08,0,0,1,3.35-6.33l14.35-4.43a5.07,5.07,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,213.61,284.78Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.28},children:a.jsx("path",{d:"M219.54,304l-87.55,27.05a5.08,5.08,0,0,1-6.34-3.35h0a5.07,5.07,0,0,1,3.35-6.33l87.55-27.05a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,219.54,304Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("path",{d:"M221.42,110.81l26.18,58.34a6.31,6.31,0,0,1-3.16,8.32L133.38,227.32a6.3,6.3,0,0,1-8.32-3.16L98.87,165.82a6.3,6.3,0,0,1,3.16-8.33l111.06-49.85a6.32,6.32,0,0,1,8.33,3.17Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.3}}),a.jsx("rect",{x:"200.4",y:"108.68",width:"3.89",height:"1",transform:"translate(-26.96 92.38) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("rect",{x:"184",y:"114.19",width:"12.13",height:"1",transform:"translate(-30.29 87.83) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("rect",{x:"99.33",y:"171.59",width:"1",height:"7.4",transform:"translate(-63.04 56.26) rotate(-24.18)",style:{fill:"var(--brand-primary, #407BFF)"}}),a.jsx("path",{d:"M217.7,107.43l-28.64,56.1a25.65,25.65,0,0,1-29.3,13.15L98.81,160.79a6.39,6.39,0,0,1,3.22-3.3l111.06-49.85A6.3,6.3,0,0,1,217.7,107.43Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),a.jsx("path",{d:"M257.07,179.23l-86.18,5.32A11.6,11.6,0,0,0,160,196.84l9.83,159.28A11.6,11.6,0,0,0,182.14,367l110.3-6.81a11.58,11.58,0,0,0,10.86-12.29L295,212.73Z",style:{fill:"#fff",opacity:.8}}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M262.28,346l-71.71,4.43a5.08,5.08,0,0,1-5.36-4.75h0a5.09,5.09,0,0,1,4.74-5.37l71.71-4.42a5.08,5.08,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,262.28,346Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M219.84,207.68l-37.93,2.34a5.09,5.09,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l37.93-2.34a5.07,5.07,0,0,1,5.36,4.74h0A5.08,5.08,0,0,1,219.84,207.68Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M245.82,226.22l-62.67,3.86a5.07,5.07,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.75-5.37l62.66-3.86a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,245.82,226.22Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M275.85,244.51l-91.46,5.64A5.09,5.09,0,0,1,179,245.4h0a5.07,5.07,0,0,1,4.74-5.36l91.47-5.65a5.08,5.08,0,0,1,5.36,4.75h0A5.08,5.08,0,0,1,275.85,244.51Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M277.09,264.57l-53.17,3.28a5.08,5.08,0,0,1-5.37-4.74h0a5.07,5.07,0,0,1,4.74-5.37l53.17-3.28a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,277.09,264.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M199.53,269.35l-13.91.86a5.07,5.07,0,0,1-5.36-4.74h0A5.08,5.08,0,0,1,185,260.1l13.91-.86a5.09,5.09,0,0,1,5.37,4.75h0A5.08,5.08,0,0,1,199.53,269.35Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M278.33,284.63l-91.47,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l91.46-5.64a5.08,5.08,0,0,1,5.37,4.75h0A5.07,5.07,0,0,1,278.33,284.63Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M244.27,306.87l-56.17,3.47a5.09,5.09,0,0,1-5.37-4.75h0a5.08,5.08,0,0,1,4.75-5.36l56.17-3.47a5.08,5.08,0,0,1,5.36,4.75h0A5.06,5.06,0,0,1,244.27,306.87Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M279.56,304.7l-15,.92a5.07,5.07,0,0,1-5.36-4.74h0a5.07,5.07,0,0,1,4.74-5.37l15-.92a5.07,5.07,0,0,1,5.37,4.74h0A5.09,5.09,0,0,1,279.56,304.7Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("g",{style:{opacity:.22},children:a.jsx("path",{d:"M280.8,324.76l-91.46,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.74-5.37l91.47-5.64a5.07,5.07,0,0,1,5.36,4.74h0A5.07,5.07,0,0,1,280.8,324.76Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),a.jsx("path",{d:"M257.07,179.23l1.49,24.12a11.6,11.6,0,0,0,12.29,10.87L295,212.73Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),a.jsx("path",{d:"M228.85,239.4h0a8.65,8.65,0,0,0-9-8.53H139.75c-6.07,0-12,4.93-13.14,11L95,403.82c-1.18,6.07,2.78,11,8.85,11h254c6.07,0,11.95-4.92,13.14-11l26.07-133.5c1.18-6.08-2.78-11-8.85-11H250C238,259.32,229.26,251.06,228.85,239.4Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.5}})]})]})}const m0={network:"Error de red al subir","too-large":"Supera el límite de tamaño permitido","invalid-type":"Tipo de archivo no permitido",duplicate:"Ya existe un archivo con este nombre"};function b0({status:e}){return e==="saved"?a.jsx("span",{className:`${re.estado} ${re.estado_guardado}`,children:"Guardado"}):e==="pending"?a.jsx("span",{className:`${re.estado} ${re.estado_nuevo}`,children:"Nuevo"}):e==="uploading"?a.jsx("span",{className:`${re.estado} ${re.estado_subiendo}`,children:"Subiendo…"}):e==="deleted"?a.jsx("span",{className:`${re.estado} ${re.estado_eliminado}`,children:"Eliminado"}):null}function w0({archivo:e,alEliminar:t,alRestaurar:r,alReintentar:n,subiendo:o,disableDeleteSaved:s}){const{id:i,name:c,status:l,error:u,entering:f,saliendo:p,restaurando:h}=e,d=l==="deleted",v=l==="uploading",g=l==="error",b=g&&u==="too-large",m=l==="saved"&&s,y=[re.fila,f&&re.fila_entrando,p&&re.fila_saliendo,d&&re.fila_eliminada,v&&re.fila_subiendo,g&&re.fila_error,b&&re.fila_aviso,h&&re.fila_restaurando].filter(Boolean).join(" ");return a.jsxs("li",{className:y,children:[a.jsx("span",{className:re.fila_icono,children:v?a.jsx("span",{className:re.spinner,"aria-hidden":"true"}):g?b?a.jsx(Mc,{size:20}):a.jsx(g0,{size:20}):a.jsx(en,{nombre:c,size:30})}),a.jsxs("div",{className:re.fila_cuerpo,children:[a.jsx("span",{className:re.fila_nombre,title:c,children:c}),g?a.jsxs("span",{className:re.fila_error_texto,children:[m0[u],u==="network"&&a.jsx("button",{type:"button",className:re.btn_reintentar,onClick:()=>n(i),children:"Reintentar"})]}):a.jsx(b0,{status:l})]}),a.jsx("div",{className:re.fila_acciones,children:d?a.jsxs("button",{type:"button",className:re.btn_restaurar,onClick:()=>r(i),disabled:o,"aria-label":`Restaurar ${c}`,children:[a.jsx(_0,{size:14}),"Restaurar"]}):!p&&!m&&a.jsx("button",{type:"button",className:re.btn_eliminar,onClick:()=>t(i),disabled:v||o,"aria-label":`Eliminar ${c}`,title:"Eliminar",children:a.jsx(h0,{size:18})})})]})}const y0=["pdf","jpg","jpeg","png"],x0=50;function k0({onClose:e,storagePath:t,onFilesChange:r,title:n="Importar archivos",subtitle:o,savedFiles:s=[],fileNameBuilder:i,maxFiles:c=1/0,allowedTypes:l=y0,maxSizeMB:u=x0,confirmation:f,firebaseStorage:p,onUploadError:h,onUploadComplete:d,disableDeleteSaved:v=!1,id:g,"data-testid":b}){const w=_.useRef(null),m=_.useRef(0),y=_.useId(),k=g??`file-stage-${y}`,T=`${k}-titulo`,C=o?`${k}-subtitulo`:void 0,[S,M]=_.useState(!1),[D,O]=_.useState(!1),[H,V]=_.useState(!1),[N,x]=_.useState([]),[A,$]=_.useState(!1),[F,E]=_.useState(!1),I=_.useCallback(()=>{D||F||(O(!0),M(!1),setTimeout(e,450))},[D,F,e]),{archivos:L,setArchivos:R,cantidadActivos:j,limiteAlcanzado:P,zonaDeshabilitada:U,hayCambios:B,agregarArchivos:q,eliminarArchivo:X,restaurarArchivo:Y,reintentarArchivo:Q}=i0({savedFiles:s,maxFiles:c,maxSizeMB:u,allowedTypes:l,subiendo:F}),{ejecutarSubida:oe}=c0({archivos:L,setArchivos:R,storagePath:t,fileNameBuilder:i,firebaseStorage:p,onFilesChange:r,onUploadError:h,onUploadComplete:d,setSubiendo:E,alTerminar:I});_.useEffect(()=>{const W=requestAnimationFrame(()=>M(!0));return()=>cancelAnimationFrame(W)},[]),_.useEffect(()=>{const W=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",W>0&&(document.body.style.paddingRight=`${W}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[]),_.useEffect(()=>{const W=ee=>{ee.key==="Escape"&&!D&&!F&&!A&&I()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)});const se=a0(l),ne=W=>{if(W.preventDefault(),U)return;m.current++,V(!0);const ee=[];if(W.dataTransfer.items)for(let J=0;J<Math.min(W.dataTransfer.items.length,4);J++){const ce=W.dataTransfer.items[J];if(ce.kind==="file"){const ve=r0[ce.type];ve&&!ee.includes(ve)&&ee.push(ve)}}x(ee)},ie=W=>{W.preventDefault()},ae=W=>{W.preventDefault(),m.current--,m.current<=0&&(m.current=0,V(!1),x([]))},fe=W=>{W.preventDefault(),m.current=0,V(!1),x([]),!U&&q(Array.from(W.dataTransfer.files))},de=W=>{q(Array.from(W.target.files??[])),W.target.value=""},Z=()=>{!B||F||(f?$(!0):oe())},ue=()=>{$(!1),oe()},pe=W=>{W.target===W.currentTarget&&!F&&I()},he=[re.zona_carga,H&&re.zona_carga_activa,(F||P)&&re.zona_carga_deshabilitada].filter(Boolean).join(" "),we=l.map(W=>W.toUpperCase());return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${re.backdrop} ${S&&!D?re.visible:""}`,onClick:pe,children:[a.jsxs("div",{id:k,className:`${re.modal} ${S&&!D?re.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":T,"aria-describedby":C,"data-testid":b??k,children:[a.jsxs("header",{className:re.encabezado,children:[a.jsxs("div",{className:re.encabezado_textos,children:[a.jsx("h2",{id:T,className:re.titulo,children:n}),o&&a.jsx("p",{id:C,className:re.subtitulo,children:o})]}),a.jsxs("button",{className:re.boton_cerrar,onClick:I,type:"button","aria-label":"Cerrar",disabled:F,children:[a.jsx("span",{className:re.texto_esc,children:"ESC"}),a.jsx(Ic,{size:16})]})]}),a.jsxs("div",{className:re.cuerpo,children:[a.jsxs("div",{className:he,"aria-label":"Zona para arrastrar archivos",onDragEnter:ne,onDragOver:ie,onDragLeave:ae,onDrop:fe,children:[a.jsxs("div",{className:re.zona_contenido,children:[a.jsx("div",{className:re.zona_icono_flotante,"aria-hidden":"true",children:a.jsx(Nc,{size:52})}),a.jsxs("div",{className:re.zona_textos,children:[a.jsx("p",{className:re.zona_titulo,children:"Arrastra archivos aquí"}),a.jsx("span",{className:re.zona_separador,children:"o"}),a.jsxs("button",{className:re.boton_elegir,type:"button",disabled:F,onClick:W=>{W.stopPropagation(),w.current?.click()},children:[a.jsx(f0,{size:16}),"Elegir archivos"]})]}),a.jsxs("div",{className:re.zona_meta,children:[a.jsxs("div",{className:re.tipos_permitidos,children:[a.jsx("span",{className:re.zona_meta_label,children:"Permitido:"}),we.map(W=>a.jsx("span",{className:re.tipo_chip,children:W},W))]}),a.jsx("span",{className:re.zona_meta_sep,children:"|"}),a.jsxs("span",{className:re.zona_meta_tam,children:["Máx. ",u," MB"]}),c!==1/0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:re.zona_meta_sep,children:"|"}),a.jsxs("span",{className:re.contador,children:[a.jsx("strong",{children:j}),"/",c]})]})]})]}),H&&a.jsxs("div",{className:re.zona_arrastrando,children:[a.jsxs("div",{className:re.drag_icon_wrap,"aria-hidden":"true",children:[a.jsx("span",{className:re.drag_ring}),a.jsx("span",{className:`${re.drag_ring} ${re.drag_ring_2}`}),a.jsx("span",{className:`${re.drag_ring} ${re.drag_ring_3}`}),a.jsx("span",{className:re.drag_icono,children:a.jsx(Nc,{size:28})})]}),a.jsxs("div",{className:re.drag_textos,children:[a.jsx("p",{className:re.drag_titulo,children:"Suelta para agregar"}),a.jsx("p",{className:re.drag_subtitulo,children:"Los archivos se agregarán a la lista"})]}),N.length>0&&a.jsx("div",{className:re.drag_chips,children:N.map((W,ee)=>a.jsx("span",{className:re.drag_chip,style:{"--chip-color":n0[W]??"#94a3b8","--chip-delay":`${ee*60}ms`},children:W},W))})]})]}),P&&a.jsxs("div",{className:re.banner_limite,role:"status",children:[a.jsx("span",{className:re.banner_limite_icono,children:a.jsx(Mc,{size:20})}),a.jsxs("div",{className:re.banner_limite_cuerpo,children:[a.jsx("span",{className:re.banner_limite_titulo,children:"Límite alcanzado"}),a.jsx("span",{className:re.banner_limite_desc,children:"Elimina un archivo para poder agregar otro"})]}),a.jsxs("span",{className:re.banner_limite_pill,children:[j,"/",c]})]}),a.jsxs("div",{className:re.seccion_lista,children:[L.length>0&&a.jsx("div",{className:re.cabecera_lista,children:a.jsx("span",{className:re.cabecera_titulo,children:"Archivos"})}),L.length===0?a.jsxs("div",{className:re.lista_vacia,children:[a.jsx(Oc,{className:re.ilustracion_vacia}),a.jsx("span",{className:re.lista_vacia_titulo,children:"Aún no hay archivos"}),a.jsx("span",{className:re.lista_vacia_desc,children:"Arrastra o elige archivos para comenzar"})]}):a.jsx("ul",{className:re.lista,children:L.map(W=>a.jsx(w0,{archivo:W,subiendo:F,alEliminar:X,alRestaurar:Y,alReintentar:Q,disableDeleteSaved:v},W.id))})]})]}),a.jsxs("footer",{className:re.pie,children:[a.jsx("span",{className:re.pie_info,children:c===1/0?`${j} archivo${j!==1?"s":""}`:`${j} de ${c} archivos`}),a.jsx(He,{variant:"light-active",color:"primary",size:"sm",radius:"lg",className:re.btn_pie,onClick:Z,isDisabled:!B,isLoading:F,children:F?"Actualizando…":"Actualizar archivos"})]})]}),a.jsx("input",{ref:w,type:"file",multiple:!0,accept:se,className:re.input_archivo,onChange:de,"aria-hidden":"true",tabIndex:-1})]}),f&&a.jsx(Qr,{isOpen:A,tipo:"advertencia",titulo:f.title,mensaje:f.message,textoConfirmar:f.confirmText??"Confirmar",loadingConfirmar:F,onConfirmar:ue,onCancelar:()=>$(!1)})]})}const ye={backdrop:"_backdrop_165ct_1",visible:"_visible_165ct_41",modal:"_modal_165ct_65",encabezado:"_encabezado_165ct_147",encabezado_textos:"_encabezado_textos_165ct_163",titulo:"_titulo_165ct_177",subtitulo:"_subtitulo_165ct_191",boton_cerrar:"_boton_cerrar_165ct_203",texto_esc:"_texto_esc_165ct_253",btn_volver:"_btn_volver_165ct_269",preview_nombre_header:"_preview_nombre_header_165ct_323",cuerpo_deslizante:"_cuerpo_deslizante_165ct_351",panel_lista:"_panel_lista_165ct_369",panel_oculto:"_panel_oculto_165ct_395",panel_preview:"_panel_preview_165ct_407",panel_visible:"_panel_visible_165ct_429",preview_contenido:"_preview_contenido_165ct_441",preview_imagen:"_preview_imagen_165ct_465",preview_imagen_cargando:"_preview_imagen_cargando_165ct_483",preview_loader:"_preview_loader_165ct_491",spinner_preview:"_spinner_preview_165ct_511",preview_iframe:"_preview_iframe_165ct_529",preview_placeholder:"_preview_placeholder_165ct_545",cabecera_lista:"_cabecera_lista_165ct_579",cabecera_titulo:"_cabecera_titulo_165ct_593",cabecera_etiqueta:"_cabecera_etiqueta_165ct_607",lista_vacia:"_lista_vacia_165ct_617",ilustracion_vacia:"_ilustracion_vacia_165ct_635",lista_vacia_titulo:"_lista_vacia_titulo_165ct_647",lista_vacia_desc:"_lista_vacia_desc_165ct_659",lista:"_lista_165ct_617",fila:"_fila_165ct_691",fila_icono:"_fila_icono_165ct_731",fila_cuerpo:"_fila_cuerpo_165ct_743",fila_nombre:"_fila_nombre_165ct_757",fila_acciones:"_fila_acciones_165ct_775",btn_accion:"_btn_accion_165ct_789",btn_descargado:"_btn_descargado_165ct_849",spinner:"_spinner_165ct_511",pie:"_pie_165ct_907",pie_info:"_pie_info_165ct_925"},E0={jpg:"image",jpeg:"image",png:"image",webp:"image",gif:"image",avif:"image",pdf:"pdf",xls:"excel",xlsx:"excel",csv:"excel",rar:"archive",zip:"archive","7z":"archive",tar:"archive"};function $c(e){const t=e.split(".").pop()?.toLowerCase()??"";return E0[t]??"generic"}function So(e){return e.id??e.url}const C0=["image","pdf"];async function Dc(e,t){try{const r=await fetch(e,{mode:"cors"});if(!r.ok)throw new Error("fetch failed");const n=await r.blob(),o=URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(o),100)}catch{window.open(e,"_blank","noopener,noreferrer")}}function S0({archivo:e,estadoDescarga:t,alDescargar:r,alPrevisualizar:n}){const o=$c(e.name),s=C0.includes(o),i=t==="done",c=t==="downloading";return a.jsxs("li",{className:ye.fila,children:[a.jsx("span",{className:ye.fila_icono,children:a.jsx(en,{nombre:e.name,size:30})}),a.jsx("div",{className:ye.fila_cuerpo,children:a.jsx("span",{className:ye.fila_nombre,title:e.name,children:e.name})}),a.jsxs("div",{className:ye.fila_acciones,children:[s&&a.jsx("button",{type:"button",className:ye.btn_accion,"aria-label":`Ver ${e.name}`,title:"Vista previa",onClick:()=>n(e),children:a.jsx(v0,{size:18})}),a.jsx("button",{type:"button",className:`${ye.btn_accion} ${i?ye.btn_descargado:""}`,"aria-label":`Descargar ${e.name}`,title:i?"Descargado":"Descargar",disabled:c,onClick:()=>r(e),children:c?a.jsx("span",{className:ye.spinner,"aria-hidden":"true"}):i?a.jsx(p0,{size:18}):a.jsx(Fc,{size:18})})]})]})}function T0({files:e,title:t="Archivos adjuntos",subtitle:r,onClose:n,className:o,id:s,"data-testid":i}){const c=_.useId(),l=s??`file-viewer-${c}`,u=`${l}-titulo`,[f,p]=_.useState(!1),[h,d]=_.useState(!1),[v,g]=_.useState({}),[b,w]=_.useState(!1),[m,y]=_.useState(null),[k,T]=_.useState(!1),[C,S]=_.useState(!1);_.useEffect(()=>{const E=requestAnimationFrame(()=>p(!0));return()=>cancelAnimationFrame(E)},[]),_.useEffect(()=>{if(!n)return;const E=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",E>0&&(document.body.style.paddingRight=`${E}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[n]);const M=_.useCallback(()=>{h||(d(!0),p(!1),setTimeout(()=>n?.(),450))},[h,n]);_.useEffect(()=>{if(!n)return;const E=I=>{I.key==="Escape"&&(m?(y(null),T(!1)):M())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[n,m,M]);const D=_.useCallback(async E=>{const I=So(E);g(L=>({...L,[I]:"downloading"})),await Dc(E.url,E.name),g(L=>({...L,[I]:"done"})),setTimeout(()=>{g(L=>{const R={...L};return delete R[I],R})},2e3)},[]),O=async()=>{if(!(b||!e.length)){w(!0);for(const E of e)await Dc(E.url,E.name);w(!1)}},H=E=>{T(!1),S(!0),y(E)},V=()=>{y(null),T(!1),S(!1)},N=r??`${e.length} archivo${e.length!==1?"s":""}`,x=m?$c(m.name):null,A=x==="image",$=x==="pdf",F=a.jsxs("div",{id:l,className:`${ye.modal} ${f&&!h?ye.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":u,"data-testid":i??l,children:[a.jsx("header",{className:ye.encabezado,children:m?a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:ye.btn_volver,onClick:V,type:"button","aria-label":"Volver a la lista",children:[a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M19 12H5M12 5l-7 7 7 7"})}),"Volver"]}),a.jsx("span",{className:ye.preview_nombre_header,title:m.name,children:m.name})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ye.encabezado_textos,children:[a.jsx("h2",{id:u,className:ye.titulo,children:t}),a.jsx("p",{className:ye.subtitulo,children:N})]}),n&&a.jsxs("button",{className:ye.boton_cerrar,onClick:M,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:ye.texto_esc,children:"ESC"}),a.jsx(Ic,{size:16})]})]})}),a.jsxs("div",{className:ye.cuerpo_deslizante,children:[a.jsxs("div",{className:`${ye.panel_lista} ${m?ye.panel_oculto:""}`,inert:m?"":void 0,children:[a.jsxs("div",{className:ye.cabecera_lista,children:[a.jsx("span",{className:ye.cabecera_titulo,children:"Documentos"}),a.jsx("span",{className:ye.cabecera_etiqueta,children:"Solo lectura"})]}),e.length===0?a.jsxs("div",{className:ye.lista_vacia,children:[a.jsx(Oc,{className:ye.ilustracion_vacia}),a.jsx("span",{className:ye.lista_vacia_titulo,children:"Sin archivos adjuntos"}),a.jsx("span",{className:ye.lista_vacia_desc,children:"Este registro no tiene documentos por el momento"})]}):a.jsx("ul",{className:ye.lista,children:e.map(E=>a.jsx(S0,{archivo:E,estadoDescarga:v[So(E)]??"idle",alDescargar:D,alPrevisualizar:H},So(E)))})]}),a.jsx("div",{className:`${ye.panel_preview} ${m?ye.panel_visible:""}`,inert:m?void 0:"",children:m&&a.jsx("div",{className:ye.preview_contenido,children:A&&!k?a.jsxs(a.Fragment,{children:[C&&a.jsx("div",{className:ye.preview_loader,"aria-hidden":"true",children:a.jsxs("svg",{className:ye.spinner_preview,viewBox:"0 0 44 44",fill:"none",role:"presentation",children:[a.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.1"}),a.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"var(--brand-primary, #407bff)",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"32 75",strokeDashoffset:"0"})]})}),a.jsx("img",{src:m.url,alt:m.name,className:`${ye.preview_imagen} ${C?ye.preview_imagen_cargando:""}`,onLoad:()=>S(!1),onError:()=>{S(!1),T(!0)}})]}):k?a.jsxs("div",{className:ye.preview_placeholder,children:[a.jsx(en,{nombre:m.name,size:64}),a.jsx("p",{children:"No se pudo cargar la imagen"}),a.jsx("code",{children:m.name})]}):$?a.jsx("object",{data:m.url,type:"application/pdf",className:ye.preview_iframe,"aria-label":m.name,children:a.jsxs("div",{className:ye.preview_placeholder,children:[a.jsx(en,{nombre:m.name,size:64}),a.jsx("p",{children:"No se puede mostrar el PDF en este navegador"}),a.jsx("code",{children:m.name})]})}):a.jsxs("div",{className:ye.preview_placeholder,children:[a.jsx(en,{nombre:m.name,size:64}),a.jsx("p",{children:"Vista previa no disponible"}),a.jsx("code",{children:m.name})]})})})]}),a.jsxs("footer",{className:ye.pie,children:[m?a.jsx("span",{className:ye.pie_info,children:"Vista previa"}):a.jsxs("span",{className:ye.pie_info,children:[e.length," archivo",e.length!==1?"s":""," disponible",e.length!==1?"s":""]}),a.jsx(He,{variant:"light-active",color:"primary",size:"sm",radius:"lg",startContent:a.jsx(Fc,{size:14}),onClick:m?()=>D(m):O,isDisabled:!m&&!e.length,isLoading:!m&&b,type:"button",children:m?"Descargar":b?"Descargando…":"Descargar todo"})]})]});return n?a.jsx("div",{className:`${ye.backdrop} ${f&&!h?ye.visible:""} ${o??""}`,onClick:E=>{E.target===E.currentTarget&&!m&&M()},children:F}):a.jsx("div",{className:o,children:F})}const A0=320,Lc=2e3,Pc=150,Fr=500,zc=2,N0=8,ta=" — opciones válidas: ",G={backdrop:"_backdrop_xnxol_1",visible:"_visible_xnxol_19",modal:"_modal_xnxol_31",encabezado:"_encabezado_xnxol_73",encabezado_textos:"_encabezado_textos_xnxol_81",titulo:"_titulo_xnxol_89",subtitulo:"_subtitulo_xnxol_97",boton_cerrar:"_boton_cerrar_xnxol_103",pasos:"_pasos_xnxol_130",paso:"_paso_xnxol_130",completado:"_completado_xnxol_156",paso_circulo:"_paso_circulo_xnxol_160",activo:"_activo_xnxol_181",paso_etiqueta:"_paso_etiqueta_xnxol_195",divisor:"_divisor_xnxol_213",cuerpo:"_cuerpo_xnxol_219",zona_idle:"_zona_idle_xnxol_230",plantilla_card:"_plantilla_card_xnxol_237",plantilla_icono_wrap:"_plantilla_icono_wrap_xnxol_268",plantilla_card_texto:"_plantilla_card_texto_xnxol_289",plantilla_titulo:"_plantilla_titulo_xnxol_297",plantilla_sub:"_plantilla_sub_xnxol_304",zona_drop:"_zona_drop_xnxol_309",sobre:"_sobre_xnxol_338",latirZona:"_latirZona_xnxol_1",con_archivo:"_con_archivo_xnxol_357",zona_drop_icono_wrap:"_zona_drop_icono_wrap_xnxol_378",zona_drop_icono_ok:"_zona_drop_icono_ok_xnxol_396",zona_drop_titulo:"_zona_drop_titulo_xnxol_424",zona_drop_sub:"_zona_drop_sub_xnxol_433",zona_drop_texto:"_zona_drop_texto_xnxol_440",zona_drop_pie:"_zona_drop_pie_xnxol_447",tipo_chip:"_tipo_chip_xnxol_455",filtro_nombre_hint:"_filtro_nombre_hint_xnxol_471",archivo_info:"_archivo_info_xnxol_477",entrarArchivo:"_entrarArchivo_xnxol_1",archivo_nombre:"_archivo_nombre_xnxol_498",archivo_tamano:"_archivo_tamano_xnxol_508",zona_procesando:"_zona_procesando_xnxol_513",spinner_wrap:"_spinner_wrap_xnxol_523",spinner_ring:"_spinner_ring_xnxol_527",girar:"_girar_xnxol_1",spinner_icono:"_spinner_icono_xnxol_536",procesando_texto:"_procesando_texto_xnxol_551",procesando_titulo:"_procesando_titulo_xnxol_559",procesando_sub:"_procesando_sub_xnxol_567",barra_progreso_contenedor:"_barra_progreso_contenedor_xnxol_577",barra_progreso:"_barra_progreso_xnxol_577",progreso:"_progreso_xnxol_1",barra_progreso_fill:"_barra_progreso_fill_xnxol_606",zona_resultado:"_zona_resultado_xnxol_618",banner:"_banner_xnxol_627",entrarBanner:"_entrarBanner_xnxol_1",exito:"_exito_xnxol_649",error:"_error_xnxol_655",banner_icono:"_banner_icono_xnxol_661",banner_texto:"_banner_texto_xnxol_665",banner_titulo:"_banner_titulo_xnxol_672",banner_sub:"_banner_sub_xnxol_678",tabs:"_tabs_xnxol_683",tab_indicador:"_tab_indicador_xnxol_690",tab:"_tab_xnxol_683",tab_badge:"_tab_badge_xnxol_729",entrarBadge:"_entrarBadge_xnxol_1",tab_badge_ok:"_tab_badge_ok_xnxol_760",tab_panel:"_tab_panel_xnxol_765",entrarPaso:"_entrarPaso_xnxol_1",preview_panel_wrap:"_preview_panel_wrap_xnxol_773",info_preview:"_info_preview_xnxol_781",tabla_contenedor:"_tabla_contenedor_xnxol_795",tabla:"_tabla_xnxol_795",fila_error:"_fila_error_xnxol_832",celda_fila:"_celda_fila_xnxol_848",celda_estado:"_celda_estado_xnxol_857",chip_valida:"_chip_valida_xnxol_866",chip_error_count:"_chip_error_count_xnxol_876",preview_truncada:"_preview_truncada_xnxol_886",errores_lista:"_errores_lista_xnxol_893",error_item:"_error_item_xnxol_904",entrarFila:"_entrarFila_xnxol_1",error_cabecera:"_error_cabecera_xnxol_944",error_ids:"_error_ids_xnxol_952",error_id_chip:"_error_id_chip_xnxol_961",error_id_etiqueta:"_error_id_etiqueta_xnxol_977",error_sin_id:"_error_sin_id_xnxol_985",error_fila_tag:"_error_fila_tag_xnxol_991",error_detalle:"_error_detalle_xnxol_1002",error_linea:"_error_linea_xnxol_1009",error_campo_nombre:"_error_campo_nombre_xnxol_1021",error_campo_msg:"_error_campo_msg_xnxol_1028",error_mensajes_lista:"_error_mensajes_lista_xnxol_1034",error_mensaje_item:"_error_mensaje_item_xnxol_1040",opciones_prefijo:"_opciones_prefijo_xnxol_1045",opciones_bloque:"_opciones_bloque_xnxol_1049",error_expandir_btn:"_error_expandir_btn_xnxol_1060",pie:"_pie_xnxol_1077",icono_reintentar:"_icono_reintentar_xnxol_1086",alerta_inline:"_alerta_inline_xnxol_1092",paso_contenido:"_paso_contenido_xnxol_1111",encabezados_panel:"_encabezados_panel_xnxol_1285",encabezados_titulo:"_encabezados_titulo_xnxol_1296",encabezados_grupo:"_encabezados_grupo_xnxol_1305",encabezados_label:"_encabezados_label_xnxol_1312",encabezados_chips:"_encabezados_chips_xnxol_1318",chip_faltante:"_chip_faltante_xnxol_1324",entrarChip:"_entrarChip_xnxol_1",chip_sugerencia:"_chip_sugerencia_xnxol_1359",chip_extra:"_chip_extra_xnxol_1365",encabezados_ok:"_encabezados_ok_xnxol_1375",encabezados_orden:"_encabezados_orden_xnxol_1380",encabezados_orden_fila:"_encabezados_orden_fila_xnxol_1386",encabezados_secuencia:"_encabezados_secuencia_xnxol_1393",chip_orden:"_chip_orden_xnxol_1402",chip_orden_num:"_chip_orden_num_xnxol_1414",chip_orden_movido:"_chip_orden_movido_xnxol_1425",error_hecho:"_error_hecho_xnxol_1435",origen_duplicado:"_origen_duplicado_xnxol_1452",origen_existente:"_origen_existente_xnxol_1457"},I0=e=>{const t=e.name.slice(e.name.lastIndexOf("."))||".xlsx";return`${e.name.replace(/\.[^.]+$/,"")}_${Date.now()}${t}`};async function M0(e,t){const{getStorage:r,ref:n,uploadBytesResumable:o}=await import("firebase/storage"),s=n(r(),`${t}/${I0(e)}`);await new Promise((i,c)=>{o(s,e).on("state_changed",null,c,i)})}function F0({size:e=48}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:[a.jsx("path",{fill:"currentColor",d:"M6.5 18v-.09c0-.865 0-1.659.087-2.304c.095-.711.32-1.463.938-2.08c.618-.619 1.37-.844 2.08-.94c.646-.086 1.44-.086 2.306-.086h.178c.866 0 1.66 0 2.305.087c.711.095 1.463.32 2.08.938c.619.618.844 1.37.94 2.08c.085.637.086 1.416.086 2.267c2.573-.55 4.5-2.812 4.5-5.52c0-2.47-1.607-4.572-3.845-5.337C17.837 4.194 15.415 2 12.476 2C9.32 2 6.762 4.528 6.762 7.647c0 .69.125 1.35.354 1.962a4.4 4.4 0 0 0-.83-.08C3.919 9.53 2 11.426 2 13.765S3.919 18 6.286 18z",opacity:".5"}),a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 14c-1.886 0-2.828 0-3.414.586S8 16.114 8 18s0 2.828.586 3.414S10.114 22 12 22s2.828 0 3.414-.586S16 19.886 16 18s0-2.828-.586-3.414S13.886 14 12 14m1.805 3.084l-1.334-1.333a.667.667 0 0 0-.942 0l-1.334 1.333a.667.667 0 1 0 .943.943l.195-.195v1.946a.667.667 0 0 0 1.334 0v-1.946l.195.195a.667.667 0 0 0 .943-.943",clipRule:"evenodd"})]})}function O0({size:e=52}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M4 4.735v14.53l10 1.429V3.306zM17 19h3V5h-3V3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8-7l2.8 4h-2.4L9 13.714L7.4 16H5l2.8-4L5 8h2.4L9 10.286L10.6 8H13z"})})}function $0({size:e=20}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 23 23",fill:"none","aria-hidden":!0,children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M17 9.002c2.175.012 3.353.109 4.121.877C22 10.758 22 12.172 22 15v1c0 2.829 0 4.243-.879 5.122C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.878C2 20.242 2 18.829 2 16v-1c0-2.828 0-4.242.879-5.121c.768-.768 1.946-.865 4.121-.877"}),a.jsx("path",{strokeLinejoin:"round",d:"M12 2v13m0 0l-3-3.5m3 3.5l3-3.5"})]})})}function D0({size:e=16}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M12 4 4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function Bc({size:e=16}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function To({size:e=22}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[a.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),a.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M11 7v4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("circle",{cx:"11",cy:"15",r:"1",fill:"currentColor"})]})}function Vc({size:e=14}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12m5.793-4.207a1 1 0 0 1 1.414 0L12 10.586l2.793-2.793a1 1 0 1 1 1.414 1.414L13.414 12l2.793 2.793a1 1 0 0 1-1.414 1.414L12 13.414l-2.793 2.793a1 1 0 0 1-1.414-1.414L10.586 12L7.793 9.207a1 1 0 0 1 0-1.414Z"})})}function L0({size:e=14}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[a.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"currentColor",opacity:".1"}),a.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"1.2"}),a.jsx("path",{d:"M1 5h12M5 5v8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function P0({size:e=18}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24","aria-hidden":!0,children:a.jsx("path",{fill:"currentColor",d:"M11.896 18a.75.75 0 0 1-.75.75c-3.792 0-6.896-3.005-6.896-6.75s3.104-6.75 6.896-6.75c3.105 0 5.749 2.015 6.605 4.801l.603-1.02a.75.75 0 0 1 1.292.763l-1.63 2.755a.75.75 0 0 1-1.014.272L14.18 11.23a.75.75 0 1 1 .737-1.307l1.472.83c-.574-2.288-2.691-4.003-5.242-4.003C8.149 6.75 5.75 9.117 5.75 12s2.399 5.25 5.396 5.25a.75.75 0 0 1 .75.75"})})}function z0({size:e=22}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[a.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),a.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M7 11l2.5 2.5L15 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function B0({size:e=24}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[a.jsx("path",{strokeDasharray:"2 4",strokeDashoffset:"6",d:"M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",children:a.jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",repeatCount:"indefinite",values:"6;0"})}),a.jsx("path",{strokeDasharray:"32",strokeDashoffset:"32",d:"M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",children:a.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.1s",dur:"0.4s",values:"32;0"})}),a.jsx("path",{strokeDasharray:"10",strokeDashoffset:"10",d:"M12 16v-7.5",children:a.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.5s",dur:"0.2s",values:"10;0"})}),a.jsx("path",{strokeDasharray:"6",strokeDashoffset:"6",d:"M12 8.5l3.5 3.5M12 8.5l-3.5 3.5",children:a.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.7s",dur:"0.2s",values:"6;0"})})]})})}function jc({size:e=22}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M11 3L4 6v5c0 4.418 3.134 8.55 7 9.5 3.866-.95 7-5.082 7-9.5V6l-7-3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M8 11l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function V0({size:e=22}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 32 32",children:[a.jsx("circle",{cx:"26",cy:"26",r:"4",fill:"currentColor"}),a.jsx("path",{fill:"currentColor",d:"M10 13h2v2h-2zm0 5h2v2h-2zm0 5h2v2h-2zm4-10h8v2h-8zm0 5h8v2h-8zm0 5h4v2h-4z"}),a.jsx("path",{fill:"currentColor",d:"M7 28V7h3v3h12V7h3v11h2V7a2 2 0 0 0-2-2h-3V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v1H7a2 2 0 0 0-2 2v21a2 2 0 0 0 2 2h11v-2Zm5-24h8v4h-8Z"})]})}function j0({size:e=15}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:[a.jsx("path",{d:"M9 2h9a2 2 0 0 1 2 2v12h-2V4H9V2Z"}),a.jsx("path",{d:"M6 6h9a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Zm0 2v12h9V8H6Z"})]})}function H0({size:e=15}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:[a.jsx("path",{d:"M12 2c4.42 0 8 1.34 8 3s-3.58 3-8 3-8-1.34-8-3 3.58-3 8-3Z"}),a.jsx("path",{d:"M20 8.5v3c0 1.66-3.58 3-8 3s-8-1.34-8-3v-3c1.6 1.2 4.6 1.8 8 1.8s6.4-.6 8-1.8Z"}),a.jsx("path",{d:"M20 14v3c0 1.66-3.58 3-8 3s-8-1.34-8-3v-3c1.6 1.2 4.6 1.8 8 1.8s6.4-.6 8-1.8Z"})]})}function Hc({size:e=13}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})}function U0({reporte:e}){const t=e.encontrados.length,r=!e.ordenValido&&e.faltantes.length===0&&e.extra.length===0;return a.jsxs("div",{className:G.encabezados_panel,role:"alert",children:[a.jsxs("div",{className:G.encabezados_titulo,children:[a.jsx(To,{size:16}),r?"Las columnas están completas, pero no en el orden esperado":"Los encabezados del archivo no coinciden con la plantilla"]}),!e.ordenValido&&a.jsxs("div",{className:G.encabezados_orden,children:[a.jsxs("div",{className:G.encabezados_orden_fila,children:[a.jsx("span",{className:G.encabezados_label,children:"Orden esperado:"}),a.jsx("ol",{className:G.encabezados_secuencia,children:e.ordenEsperado.map((n,o)=>a.jsxs("li",{className:G.chip_orden,children:[a.jsx("span",{className:G.chip_orden_num,children:o+1}),n]},n))})]}),a.jsxs("div",{className:G.encabezados_orden_fila,children:[a.jsx("span",{className:G.encabezados_label,children:"En el archivo:"}),a.jsx("ol",{className:G.encabezados_secuencia,children:e.ordenRecibido.map((n,o)=>a.jsxs("li",{className:`${G.chip_orden} ${n!==e.ordenEsperado[o]?G.chip_orden_movido:""}`,children:[a.jsx("span",{className:G.chip_orden_num,children:o+1}),n]},n))})]})]}),e.faltantes.length>0&&a.jsxs("div",{className:G.encabezados_grupo,children:[a.jsxs("span",{className:G.encabezados_label,children:["Faltan (",e.faltantes.length,"):"]}),a.jsx("div",{className:G.encabezados_chips,children:e.faltantes.map(n=>a.jsxs("span",{className:G.chip_faltante,children:[n.columna,n.sugerencia&&a.jsxs("span",{className:G.chip_sugerencia,children:[" · ¿es “",n.sugerencia,"”?"]})]},n.columna))})]}),e.extra.length>0&&a.jsxs("div",{className:G.encabezados_grupo,children:[a.jsxs("span",{className:G.encabezados_label,children:["No reconocidas (",e.extra.length,"):"]}),a.jsx("div",{className:G.encabezados_chips,children:e.extra.map(n=>a.jsx("span",{className:G.chip_extra,children:n},n))})]}),t>0&&a.jsxs("span",{className:G.encabezados_ok,children:[t," columna",t!==1?"s":""," reconocida",t!==1?"s":"","."," ",r?"Reordénalas como en la plantilla.":"Corrige las cabeceras o descarga la plantilla."]})]})}const Uc=[".xlsx",".xls",".csv"],W0=".xlsx,.xls,.csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv";function Wc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function G0(e){const t=e.name.toLowerCase();return Uc.some(r=>t.endsWith(r))?null:`Formato no soportado. Usa: ${Uc.join(", ")}`}function q0(e,t){return t&&e.size>t*1024*1024?`El archivo pesa ${Wc(e.size)} y el máximo permitido es ${t} MB`:null}function R0(e,t){return typeof t=="string"?e.name.toLowerCase().includes(t.toLowerCase())?null:`El archivo debe contener "${t}" en su nombre`:t.test(e.name)?null:"El nombre del archivo no es el esperado"}async function K0(e,t="plantilla.xlsx"){const r=await import("xlsx"),n=r.utils.aoa_to_sheet([e.map(s=>s.columna??s.etiqueta)]),o=r.utils.book_new();r.utils.book_append_sheet(o,n,"Plantilla"),r.writeFile(o,t)}async function X0(e,t){try{const n=await(await fetch(e)).blob(),o=document.createElement("a");o.href=URL.createObjectURL(n),o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(o.href)}catch{window.open(e,"_blank")}}const Y0=["XLSX","XLS","CSV"];function Z0({campos:e,plantillaUrl:t,plantillaFilename:r,generarPlantilla:n,onGenerarPlantilla:o,archivo:s,arrastrandoSobre:i,inputRef:c,filtroNombre:l,maxTamanoMB:u,reporteEncabezados:f,onDragOver:p,onDragLeave:h,onDrop:d,onArchivoElegido:v}){const g=t||n||o,b=()=>c.current?.click(),w=()=>{o?o():t?X0(t,r):n&&K0(e,r)};return a.jsxs("div",{className:G.zona_idle,children:[g&&a.jsxs("button",{className:G.plantilla_card,type:"button",onClick:w,children:[a.jsx("div",{className:G.plantilla_icono_wrap,children:a.jsx($0,{size:20})}),a.jsxs("div",{className:G.plantilla_card_texto,children:[a.jsx("span",{className:G.plantilla_titulo,children:"Descargar plantilla"}),a.jsx("span",{className:G.plantilla_sub,children:t?"Descarga la plantilla oficial para llenar":"Genera la plantilla con las columnas esperadas"})]})]}),a.jsxs("div",{className:`${G.zona_drop} ${i?G.sobre:""} ${s?G.con_archivo:""}`,role:"button",tabIndex:0,"aria-label":"Zona para arrastrar o seleccionar archivo Excel",onDragOver:p,onDragLeave:h,onDrop:d,onClick:b,onKeyDown:m=>(m.key==="Enter"||m.key===" ")&&b(),children:[s?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`${G.zona_drop_icono_wrap} ${G.zona_drop_icono_ok}`,children:a.jsx(O0,{size:38})}),a.jsxs("div",{className:G.archivo_info,children:[a.jsx("span",{className:G.archivo_nombre,children:s.name}),a.jsx("span",{className:G.archivo_tamano,children:Wc(s.size)})]}),a.jsx("p",{className:G.zona_drop_sub,children:"Haz clic para cambiar el archivo"})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:G.zona_drop_icono_wrap,children:a.jsx(F0,{size:48})}),a.jsxs("div",{className:G.zona_drop_texto,children:[a.jsx("p",{className:G.zona_drop_titulo,children:"Arrastra tu archivo aquí"}),a.jsx("p",{className:G.zona_drop_sub,children:"o haz clic para seleccionar desde tu equipo"})]}),a.jsxs("div",{className:G.zona_drop_pie,children:[Y0.map(m=>a.jsx("span",{className:G.tipo_chip,children:m},m)),typeof l=="string"&&a.jsxs("span",{className:G.filtro_nombre_hint,children:["Nombre: ",a.jsx("strong",{children:l})]}),u&&a.jsxs("span",{className:G.filtro_nombre_hint,children:["Máximo ",a.jsxs("strong",{children:[u," MB"]})]})]})]}),a.jsx("input",{ref:c,type:"file",accept:W0,tabIndex:-1,onChange:v,onClick:m=>m.stopPropagation()})]}),f&&!f.valido&&a.jsx(U0,{reporte:f})]})}const J0={existencia:(e,t)=>`Comprobando ${e} de ${t} registros en el sistema…`,validando:(e,t)=>`Validando ${e} de ${t} filas…`};function Q0({nombre:e,progreso:t}){const r=t?J0[t.fase](t.hechas.toLocaleString(),t.total.toLocaleString()):"Validando datos…",n=t&&t.total>0?Math.min(1,t.hechas/t.total):null;return a.jsxs("div",{className:G.zona_procesando,children:[a.jsxs("div",{className:G.spinner_wrap,children:[a.jsx("div",{className:G.spinner_ring,"aria-hidden":!0}),a.jsx("div",{className:G.spinner_icono,children:a.jsx(jc,{size:18})})]}),a.jsxs("div",{className:G.procesando_texto,children:[a.jsx("p",{className:G.procesando_titulo,children:r}),a.jsx("p",{className:G.procesando_sub,children:e})]}),a.jsx("div",{className:G.barra_progreso_contenedor,role:"progressbar","aria-label":"Procesando","aria-valuenow":n===null?void 0:Math.round(n*100),children:n===null?a.jsx("div",{className:G.barra_progreso}):a.jsx("div",{className:G.barra_progreso_fill,style:{transform:`scaleX(${n})`}})})]})}const nt=e=>e.trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"");function e_(e){return[e.columna??e.etiqueta,...e.aliasColumna??[]]}function Gc(e,t){if(e===t)return 0;const r=e.length,n=t.length;if(r===0)return n;if(n===0)return r;let o=Array.from({length:n+1},(s,i)=>i);for(let s=1;s<=r;s++){const i=[s];for(let c=1;c<=n;c++)i.push(Math.min(o[c]+1,i[c-1]+1,o[c-1]+(e[s-1]===t[c-1]?0:1)));o=i}return o[n]}function t_(e,t){const r=Gc(e,t);return r>0&&r<=Math.max(1,Math.floor(e.length/4)+1)}function r_(e){for(let t=1;t<e.length;t++)if(e[t]<e[t-1])return!1;return!0}function qc(e,t,r={}){const{exigirOrden:n=!1,permitirColumnasExtra:o=!0}=r,s=new Map,i=new Map;e.forEach((m,y)=>{const k=nt(m);!k||s.has(k)||(s.set(k,m.trim()),i.set(k,y))});const c=new Map,l=[],u=[],f=[],p=new Set;for(const m of t){const y=e_(m),k=y.map(nt).find(T=>s.has(T));k!==void 0?(p.add(k),c.set(String(m.campo),k),l.push({campo:String(m.campo),columna:s.get(k),esperado:y[0]})):m.opcional?f.push(y[0]):u.push({columna:y[0],etiqueta:m.etiqueta})}const h=[...s.entries()].filter(([m])=>!p.has(m)).map(([,m])=>m);for(const m of u){const y=nt(m.columna);let k,T=1/0;for(const C of h){const S=nt(C);if(!t_(y,S))continue;const M=Gc(y,S);M<T&&(T=M,k=C)}m.sugerencia=k}const d=l.map(m=>i.get(nt(m.columna))??0),v=!n||r_(d),g=l.map(m=>m.columna),b=[...l].sort((m,y)=>(i.get(nt(m.columna))??0)-(i.get(nt(y.columna))??0)).map(m=>m.columna);return{reporte:{valido:u.length===0&&(o||h.length===0)&&v,encontrados:l,faltantes:u,faltantesOpcionales:f,extra:h,ordenValido:v,ordenEsperado:g,ordenRecibido:b},resolucion:c}}function n_(e){const t={};for(const[r,n]of Object.entries(e))t[nt(r)]=n;return t}function tn(e,t){return String(e[t]??"")}function a_(e,t,r){const n=Object.fromEntries(r.map(o=>[nt(o.etiqueta),String(o.campo)]));return t.map(o=>({etiqueta:o,valor:tn(e,n[nt(o)]??nt(o)).trim()})).filter(o=>o.valor)}async function o_(e,t,r,n,o=zc){const s=e.length,i=t.map(p=>({campo:p,clave:String(p.campo),colKey:r?.get(String(p.campo))??nt(p.columna??p.etiqueta),validadores:p.validadores??[]})),c=s>0?Object.keys(e[0]).map(p=>[p,nt(p)]):[],l=[],u=[];let f=0;for(let p=0;p<s;p++){const h=o+p,d=e[p];let v;if(Object.keys(d).length===c.length){v={};for(const[y,k]of c)v[k]=d[y]??""}else v=n_(d);const g=[],b={};for(const{campo:y,clave:k,colKey:T,validadores:C}of i){const S=v[T]??"",M=[];for(const D of C){const O=D(S,v);O!==null&&M.push(O.replace(/\{campo\}/g,y.etiqueta))}M.length>0&&g.push({campo:k,etiqueta:y.etiqueta,fila:h,mensajes:M,origen:"validacion",valor:S});try{b[k]=y.transformar?y.transformar(S):S}catch{b[k]=S}}const w=g.length===0;f+=g.length;const m=b;l.push({indice:h,datos:m,errores:g,valida:w}),w&&u.push(m),s>Lc&&(p+1)%Lc===0&&(n?.(p+1,s),await new Promise(y=>setTimeout(y,0)))}return{filasValidas:u,filasProcesadas:l,totalFilas:s,totalErrores:f}}const Rc=100,Kc=6,Ao={duplicado:{Icono:j0,clase:"origen_duplicado"},existente:{Icono:H0,clase:"origen_existente"}};function No({texto:e}){const[t,r]=_.useState(!1),n=e.indexOf(ta);if(n>=0){const o=e.slice(n+ta.length).split(", ").map(c=>c.trim()).filter(Boolean),s=t?o:o.slice(0,Kc),i=o.length-Kc;return a.jsxs("span",{children:[a.jsxs("span",{className:G.opciones_prefijo,children:[e.slice(0,n)," — opciones válidas:"]})," ",a.jsxs("span",{className:G.opciones_bloque,children:[s.join(", "),!t&&i>0&&"…"]}),i>0&&a.jsx("button",{className:G.error_expandir_btn,type:"button",onClick:()=>r(c=>!c),children:t?"▴ menos":`▾ +${i}`})]})}return e.length<=Rc?a.jsx("span",{children:e}):a.jsxs("span",{children:[t?e:`${e.slice(0,Rc)}…`,a.jsx("button",{className:G.error_expandir_btn,type:"button",onClick:()=>r(o=>!o),children:t?" ▴ ver menos":" ▾ ver más"})]})}function s_({err:e}){const t=Ao[e.origen];return t?a.jsxs("div",{className:`${G.error_hecho} ${G[t.clase]}`,children:[a.jsx(t.Icono,{size:14}),a.jsx("span",{children:e.mensajes.map((r,n)=>a.jsx(No,{texto:r},n))})]}):a.jsxs("div",{className:G.error_linea,children:[a.jsx("span",{className:G.error_campo_nombre,children:e.etiqueta}),a.jsx("span",{className:G.error_campo_msg,children:e.mensajes.length===1?a.jsx(No,{texto:e.mensajes[0]}):a.jsx("span",{className:G.error_mensajes_lista,children:e.mensajes.map((r,n)=>a.jsx("span",{className:G.error_mensaje_item,children:a.jsx(No,{texto:r})},n))})})]})}function i_({fila:e,campos:t,identificadores:r,orden:n=0}){const o=r.length?a_(e.datos,r,t):[],s=[...e.errores].sort((i,c)=>+!Ao[i.origen]-+!Ao[c.origen]);return a.jsxs("div",{className:G.error_item,style:{"--indice-fila":n},children:[a.jsxs("div",{className:G.error_cabecera,children:[o.length>0?a.jsx("div",{className:G.error_ids,children:o.map((i,c)=>a.jsxs("span",{className:G.error_id_chip,children:[a.jsx("span",{className:G.error_id_etiqueta,children:i.etiqueta}),i.valor]},c))}):a.jsx("span",{className:G.error_sin_id,children:"Sin identificador"}),a.jsxs("span",{className:G.error_fila_tag,children:["Fila ",e.indice]})]}),a.jsx("div",{className:G.error_detalle,children:s.map((i,c)=>a.jsx(s_,{err:i},c))})]})}function c_({filas:e,campos:t}){const r=e.slice(0,Fr),n=e.length>Fr;return a.jsxs("table",{className:G.tabla,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:G.celda_fila,children:"Fila"}),t.map(o=>a.jsx("th",{children:o.etiqueta},String(o.campo))),a.jsx("th",{className:G.celda_estado,children:"Estado"})]})}),a.jsxs("tbody",{children:[r.map(o=>a.jsxs("tr",{className:o.valida?"":G.fila_error,children:[a.jsx("td",{className:G.celda_fila,children:o.indice}),t.map(s=>a.jsx("td",{children:tn(o.datos,String(s.campo))},String(s.campo))),a.jsx("td",{className:G.celda_estado,children:o.valida?a.jsx("span",{className:G.chip_valida,children:"✓ Válida"}):a.jsxs("span",{className:G.chip_error_count,children:[o.errores.length," error",o.errores.length!==1?"es":""]})})]},o.indice)),n&&a.jsx("tr",{children:a.jsxs("td",{colSpan:t.length+2,className:G.preview_truncada,children:["Se muestran ",Fr," de ",e.length.toLocaleString()," filas totales"]})})]})]})}function l_({resultado:e,campos:t,identificadores:r}){const n=e.totalErrores>0,[o,s]=_.useState(n?"errores":"preview"),i=_.useRef(null),c=_.useRef(null);_.useLayoutEffect(()=>{const h=i.current?.querySelector('[role="tab"][aria-selected="true"]'),d=c.current;if(!h||!d)return;const v=d.style.width==="";v&&(d.style.transition="none"),d.style.transform=`translateX(${h.offsetLeft}px)`,d.style.width=`${h.offsetWidth}px`,v&&(d.offsetWidth,d.style.transition="")},[o,n]);const l=_.useMemo(()=>e.filasProcesadas.filter(h=>!h.valida),[e.filasProcesadas]),u=l.slice(0,Pc),f=l.length-u.length,p=e.totalFilas;return a.jsxs("div",{className:G.zona_resultado,children:[a.jsxs("div",{className:`${G.banner} ${n?G.error:G.exito}`,children:[a.jsx("div",{className:G.banner_icono,children:n?a.jsx(To,{size:22}):a.jsx(z0,{size:22})}),a.jsxs("div",{className:G.banner_texto,children:[a.jsx("span",{className:G.banner_titulo,children:n?`${l.length.toLocaleString()} fila${l.length!==1?"s":""} con errores`:`${p.toLocaleString()} registro${p!==1?"s":""} ${p!==1?"listos":"listo"} para importar`}),a.jsx("span",{className:G.banner_sub,children:n?"Corrige los errores en el archivo y vuelve a intentarlo":"Todos los datos pasaron la validación correctamente"})]})]}),a.jsxs("div",{ref:i,className:G.tabs,role:"tablist",children:[n&&a.jsxs("button",{type:"button",role:"tab","aria-selected":o==="errores",className:`${G.tab} ${o==="errores"?G.activo:""}`,onClick:()=>s("errores"),children:[a.jsx(Vc,{size:15}),"Errores",a.jsx("span",{className:G.tab_badge,children:l.length})]}),a.jsxs("button",{type:"button",role:"tab","aria-selected":o==="preview",className:`${G.tab} ${o==="preview"?G.activo:""}`,onClick:()=>s("preview"),children:[a.jsx(L0,{size:13}),"Vista previa",a.jsx("span",{className:`${G.tab_badge} ${G.tab_badge_ok}`,children:p})]}),a.jsx("span",{ref:c,className:G.tab_indicador,"aria-hidden":!0})]}),o==="errores"?a.jsxs("div",{className:`${G.errores_lista} ${G.tab_panel}`,role:"tabpanel",children:[u.map((h,d)=>a.jsx(i_,{fila:h,campos:t,identificadores:r,orden:d},h.indice)),f>0&&a.jsxs("p",{className:G.info_preview,children:[a.jsx(Hc,{size:13}),"Se listan las primeras ",Pc," filas con errores. Hay ",f.toLocaleString()," más en el archivo."]})]},"errores"):a.jsxs("div",{className:`${G.preview_panel_wrap} ${G.tab_panel}`,role:"tabpanel",children:[a.jsxs("div",{className:G.info_preview,children:[a.jsx(Hc,{size:13}),e.filasProcesadas.length>Fr?`Se muestran hasta ${Fr} filas (${e.filasProcesadas.length.toLocaleString()} en total)`:`Se muestran hasta ${Fr} filas`]}),a.jsx("div",{className:G.tabla_contenedor,children:a.jsx(c_,{filas:e.filasProcesadas,campos:t})})]},"preview")]})}const Xc=[{Icono:B0,label:"Subir",paso:"idle"},{Icono:jc,label:"Validar",paso:"procesando"},{Icono:V0,label:"Resultados",paso:"resultado"}];function d_({paso:e}){const t=Xc.findIndex(r=>r.paso===e);return a.jsx("div",{className:G.pasos,"aria-label":"Pasos del proceso",children:Xc.map(({label:r,Icono:n},o)=>a.jsxs("div",{className:`${G.paso} ${o===t?G.activo:""} ${o<t?G.completado:""}`,children:[a.jsx("div",{className:G.paso_circulo,"aria-hidden":!0,children:o<t?a.jsx(Bc,{size:15}):a.jsx(n,{size:22})}),a.jsx("span",{className:G.paso_etiqueta,children:r})]},r))})}const u_="";function Yc(e,t){const r=e.find(n=>String(n.campo)===t)??e[0];return{campo:String(r.campo),etiqueta:r.etiqueta}}function Zc(e){return e.map(t=>({...t,errores:[...t.errores]}))}function Jc(e,t){const r=e.map(n=>({...n,valida:n.errores.length===0}));return{filasProcesadas:r,filasValidas:r.filter(n=>n.valida).map(n=>n.datos),totalErrores:r.reduce((n,o)=>n+o.errores.length,0),totalFilas:t}}function Qc(e,t,r,n,o){return{campo:t.campo,etiqueta:t.etiqueta,fila:e,mensajes:[n],origen:o,valor:r}}function f_(e,t){return e.etiqueta?e.etiqueta:e.campos.map(r=>t.find(n=>String(n.campo)===r)?.etiqueta??r).join(" + ")}function h_(e,t){const r=t.normalizar??!0,n=[];for(const o of t.campos){const s=tn(e.datos,o).trim();if(!s)return null;n.push(r?nt(s):s)}return n.join(u_)}function el(e,t,r){if(t.length===0)return e;const n=Zc(e.filasProcesadas);for(const o of t){const s=f_(o,r),i=Yc(r,o.campos[0]),c=new Map;for(const l of n){const u=h_(l,o);if(u===null)continue;const f=c.get(u);if(f===void 0){c.set(u,l.indice);continue}const p=o.mensaje??`${s} duplicado: ya aparece en la fila ${f}`;l.errores.push(Qc(l.indice,i,tn(l.datos,i.campo),p,"duplicado"))}}return Jc(n,e.totalFilas)}async function __(e,t,r){let n=0;const o=Array.from({length:Math.min(t,e.length)},async()=>{for(;n<e.length;)await r(e[n++])});await Promise.all(o)}async function tl(e,t,r){const{campos:n,anclaje:o,concurrencia:s=N0,mensaje:i,onProgreso:c}=r,l=Zc(e.filasProcesadas),u=l.filter(d=>d.valida);if(u.length===0)return e;const f=Yc(n,o),p=i??"Este registro ya existe en el sistema";let h=0;return await __(u,s,async d=>{try{await t(d.datos)&&d.errores.push(Qc(d.indice,f,tn(d.datos,f.campo),p,"existente"))}catch{}c?.(++h,u.length)}),Jc(l,e.totalFilas)}const rl=`(function(){"use strict";/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var w0=1252,xi=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Ct={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},yt=function(e){xi.indexOf(e)!=-1&&(w0=Ct[0]=e)};function di(){yt(1252)}var _r=function(e){yt(e)};function F0(){_r(1200),di()}function A0(e){for(var a=[],r=0,n=e.length;r<n;++r)a[r]=e.charCodeAt(r);return a}function vi(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return a.join("")}function S0(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return a.join("")}var ka=function(e){var a=e.charCodeAt(0),r=e.charCodeAt(1);return a==255&&r==254?vi(e.slice(2)):a==254&&r==255?S0(e.slice(2)):a==65279?e.slice(1):e},rt=function(a){return String.fromCharCode(a)},C0=function(a){return String.fromCharCode(a)},wa,Vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y0(e){for(var a="",r=0,n=0,t=0,s=0,i=0,c=0,f=0,l=0;l<e.length;)r=e.charCodeAt(l++),s=r>>2,n=e.charCodeAt(l++),i=(r&3)<<4|n>>4,t=e.charCodeAt(l++),c=(n&15)<<2|t>>6,f=t&63,isNaN(n)?c=f=64:isNaN(t)&&(f=64),a+=Vr.charAt(s)+Vr.charAt(i)+Vr.charAt(c)+Vr.charAt(f);return a}function fr(e){var a="",r=0,n=0,t=0,s=0,i=0,c=0,f=0;e=e.replace(/[^\\w\\+\\/\\=]/g,"");for(var l=0;l<e.length;)s=Vr.indexOf(e.charAt(l++)),i=Vr.indexOf(e.charAt(l++)),r=s<<2|i>>4,a+=String.fromCharCode(r),c=Vr.indexOf(e.charAt(l++)),n=(i&15)<<4|c>>2,c!==64&&(a+=String.fromCharCode(n)),f=Vr.indexOf(e.charAt(l++)),t=(c&3)<<6|f,f!==64&&(a+=String.fromCharCode(t));return a}var ge=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),qr=(function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(a,r){return r?new Buffer(a,r):new Buffer(a)}:Buffer.from.bind(Buffer)}return function(){}})();function Wr(e){return ge?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function D0(e){return ge?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Er=function(a){return ge?qr(a,"binary"):a.split("").map(function(r){return r.charCodeAt(0)&255})};function Qr(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var a=[],r=0;r<e.length;++r)a[r]=String.fromCharCode(e[r]);return a.join("")}function Dt(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return Dt(new Uint8Array(e));for(var a=new Array(e.length),r=0;r<e.length;++r)a[r]=e[r];return a}var Gr=ge?function(e){return Buffer.concat(e.map(function(a){return Buffer.isBuffer(a)?a:qr(a)}))}:function(e){if(typeof Uint8Array<"u"){var a=0,r=0;for(a=0;a<e.length;++a)r+=e[a].length;var n=new Uint8Array(r),t=0;for(a=0,r=0;a<e.length;r+=t,++a)if(t=e[a].length,e[a]instanceof Uint8Array)n.set(e[a],r);else{if(typeof e[a]=="string")throw"wtf";n.set(new Uint8Array(e[a]),r)}return n}return[].concat.apply([],e.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function pi(e){for(var a=[],r=0,n=e.length+250,t=Wr(e.length+255),s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i<128)t[r++]=i;else if(i<2048)t[r++]=192|i>>6&31,t[r++]=128|i&63;else if(i>=55296&&i<57344){i=(i&1023)+64;var c=e.charCodeAt(++s)&1023;t[r++]=240|i>>8&7,t[r++]=128|i>>2&63,t[r++]=128|c>>6&15|(i&3)<<4,t[r++]=128|c&63}else t[r++]=224|i>>12&15,t[r++]=128|i>>6&63,t[r++]=128|i&63;r>n&&(a.push(t.slice(0,r)),r=0,t=Wr(65535),n=65530)}return a.push(t.slice(0,r)),Gr(a)}var rr=/\\u0000/g,Fa=/[\\u0001-\\u0006]/g;function ua(e){for(var a="",r=e.length-1;r>=0;)a+=e.charAt(r--);return a}function Tr(e,a){var r=""+e;return r.length>=a?r:De("0",a-r.length)+r}function Ot(e,a){var r=""+e;return r.length>=a?r:De(" ",a-r.length)+r}function at(e,a){var r=""+e;return r.length>=a?r:r+De(" ",a-r.length)}function gi(e,a){var r=""+Math.round(e);return r.length>=a?r:De("0",a-r.length)+r}function mi(e,a){var r=""+e;return r.length>=a?r:De("0",a-r.length)+r}var O0=Math.pow(2,32);function xa(e,a){if(e>O0||e<-O0)return gi(e,a);var r=Math.round(e);return mi(r,a)}function tt(e,a){return a=a||0,e.length>=7+a&&(e.charCodeAt(a)|32)===103&&(e.charCodeAt(a+1)|32)===101&&(e.charCodeAt(a+2)|32)===110&&(e.charCodeAt(a+3)|32)===101&&(e.charCodeAt(a+4)|32)===114&&(e.charCodeAt(a+5)|32)===97&&(e.charCodeAt(a+6)|32)===108}var R0=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Rt=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function _i(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var ue={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},I0={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Ei={5:'"$"#,##0_);\\\\("$"#,##0\\\\)',63:'"$"#,##0_);\\\\("$"#,##0\\\\)',6:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',64:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',7:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',65:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',8:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',66:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',41:'_(* #,##0_);_(* \\\\(#,##0\\\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\\\(#,##0\\\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\\\(#,##0.00\\\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\\\(#,##0.00\\\\);_("$"* "-"??_);_(@_)'};function nt(e,a,r){for(var n=e<0?-1:1,t=e*n,s=0,i=1,c=0,f=1,l=0,o=0,h=Math.floor(t);l<a&&(h=Math.floor(t),c=h*i+s,o=h*l+f,!(t-h<5e-8));)t=1/(t-h),s=i,i=c,f=l,l=o;if(o>a&&(l>a?(o=f,c=s):(o=l,c=i)),!r)return[0,n*c,o];var x=Math.floor(n*c/o);return[x,n*c-x*o,o]}function Xr(e,a,r){if(e>2958465||e<0)return null;var n=e|0,t=Math.floor(86400*(e-n)),s=0,i=[],c={D:n,T:t,u:86400*(e-n)-t,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(c.u)<1e-6&&(c.u=0),a&&a.date1904&&(n+=1462),c.u>.9999&&(c.u=0,++t==86400&&(c.T=t=0,++n,++c.D)),n===60)i=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)i=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var f=new Date(1900,0,1);f.setDate(f.getDate()+n-1),i=[f.getFullYear(),f.getMonth()+1,f.getDate()],s=f.getDay(),n<60&&(s=(s+6)%7),r&&(s=Si(f,i))}return c.y=i[0],c.m=i[1],c.d=i[2],c.S=t%60,t=Math.floor(t/60),c.M=t%60,t=Math.floor(t/60),c.H=t,c.q=s,c}var N0=new Date(1899,11,31,0,0,0),Ti=N0.getTime(),ki=new Date(1900,2,1,0,0,0);function P0(e,a){var r=e.getTime();return a?r-=1461*24*60*60*1e3:e>=ki&&(r+=1440*60*1e3),(r-(Ti+(e.getTimezoneOffset()-N0.getTimezoneOffset())*6e4))/(1440*60*1e3)}function It(e){return e.indexOf(".")==-1?e:e.replace(/(?:\\.0*|(\\.\\d*[1-9])0+)$/,"$1")}function wi(e){return e.indexOf("E")==-1?e:e.replace(/(?:\\.0*|(\\.\\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\\d)$/,"$10$2")}function Fi(e){var a=e<0?12:11,r=It(e.toFixed(12));return r.length<=a||(r=e.toPrecision(10),r.length<=a)?r:e.toExponential(5)}function Ai(e){var a=It(e.toFixed(11));return a.length>(e<0?12:11)||a==="0"||a==="-0"?e.toPrecision(6):a}function Aa(e){var a=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return a>=-4&&a<=-1?r=e.toPrecision(10+a):Math.abs(a)<=9?r=Fi(e):a===10?r=e.toFixed(10).substr(0,12):r=Ai(e),It(wi(r.toUpperCase()))}function ea(e,a){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):Aa(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return or(14,P0(e,a&&a.date1904),a)}throw new Error("unsupported value in General format: "+e)}function Si(e,a){a[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Ci(e,a,r,n){var t="",s=0,i=0,c=r.y,f,l=0;switch(e){case 98:c=r.y+543;case 121:switch(a.length){case 1:case 2:f=c%100,l=2;break;default:f=c%1e4,l=4;break}break;case 109:switch(a.length){case 1:case 2:f=r.m,l=a.length;break;case 3:return Rt[r.m-1][1];case 5:return Rt[r.m-1][0];default:return Rt[r.m-1][2]}break;case 100:switch(a.length){case 1:case 2:f=r.d,l=a.length;break;case 3:return R0[r.q][0];default:return R0[r.q][1]}break;case 104:switch(a.length){case 1:case 2:f=1+(r.H+11)%12,l=a.length;break;default:throw"bad hour format: "+a}break;case 72:switch(a.length){case 1:case 2:f=r.H,l=a.length;break;default:throw"bad hour format: "+a}break;case 77:switch(a.length){case 1:case 2:f=r.M,l=a.length;break;default:throw"bad minute format: "+a}break;case 115:if(a!="s"&&a!="ss"&&a!=".0"&&a!=".00"&&a!=".000")throw"bad second format: "+a;return r.u===0&&(a=="s"||a=="ss")?Tr(r.S,a.length):(n>=2?i=n===3?1e3:100:i=n===1?10:1,s=Math.round(i*(r.S+r.u)),s>=60*i&&(s=0),a==="s"?s===0?"0":""+s/i:(t=Tr(s,2+n),a==="ss"?t.substr(0,2):"."+t.substr(2,a.length-1)));case 90:switch(a){case"[h]":case"[hh]":f=r.D*24+r.H;break;case"[m]":case"[mm]":f=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":f=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+a}l=a.length===3?1:2;break;case 101:f=c,l=1;break}var o=l>0?Tr(f,l):"";return o}function zr(e){var a=3;if(e.length<=a)return e;for(var r=e.length%a,n=e.substr(0,r);r!=e.length;r+=a)n+=(n.length>0?",":"")+e.substr(r,a);return n}var L0=/%/g;function yi(e,a,r){var n=a.replace(L0,""),t=a.length-n.length;return Ir(e,n,r*Math.pow(10,2*t))+De("%",t)}function Di(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Ir(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function M0(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+M0(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var s=Math.floor(Math.log(a)*Math.LOG10E)%t;if(s<0&&(s+=t),r=(a/Math.pow(10,s)).toPrecision(n+1+(t+s)%t),r.indexOf("e")===-1){var i=Math.floor(Math.log(a)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,t)+"."+r.substr(2+t),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\\./,"0.");r=r.replace(/\\+-/,"-")}r=r.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function(c,f,l,o){return f+l+o.substr(0,(t+s)%t)+"."+o.substr(s)+"E"})}else r=a.toExponential(n);return e.match(/E\\+00$/)&&r.match(/e[+-]\\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\\-/)&&r.match(/e\\+/)&&(r=r.replace(/e\\+/,"e")),r.replace("e","E")}var B0=/# (\\?+)( ?)\\/( ?)(\\d+)/;function Oi(e,a,r){var n=parseInt(e[4],10),t=Math.round(a*n),s=Math.floor(t/n),i=t-s*n,c=n;return r+(s===0?"":""+s)+" "+(i===0?De(" ",e[1].length+1+e[4].length):Ot(i,e[1].length)+e[2]+"/"+e[3]+Tr(c,e[4].length))}function Ri(e,a,r){return r+(a===0?"":""+a)+De(" ",e[1].length+2+e[4].length)}var b0=/^#*0*\\.([0#]+)/,U0=/\\).*[0#]/,H0=/\\(###\\) ###\\\\?-####/;function ar(e){for(var a="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:a+=" ";break;case 48:a+="0";break;default:a+=String.fromCharCode(r)}return a}function V0(e,a){var r=Math.pow(10,a);return""+Math.round(e*r)/r}function W0(e,a){var r=e-Math.floor(e),n=Math.pow(10,a);return a<(""+Math.round(r*n)).length?0:Math.round(r*n)}function Ii(e,a){return a<(""+Math.round((e-Math.floor(e))*Math.pow(10,a))).length?1:0}function Ni(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function xr(e,a,r){if(e.charCodeAt(0)===40&&!a.match(U0)){var n=a.replace(/\\( */,"").replace(/ \\)/,"").replace(/\\)/,"");return r>=0?xr("n",n,r):"("+xr("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Di(e,a,r);if(a.indexOf("%")!==-1)return yi(e,a,r);if(a.indexOf("E")!==-1)return M0(a,r);if(a.charCodeAt(0)===36)return"$"+xr(e,a.substr(a.charAt(1)==" "?2:1),r);var t,s,i,c,f=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+xa(f,a.length);if(a.match(/^[#?]+$/))return t=xa(r,0),t==="0"&&(t=""),t.length>a.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(B0))return Oi(s,f,l);if(a.match(/^#+0+$/))return l+xa(f,a.length-a.indexOf("0"));if(s=a.match(b0))return t=V0(r,s[1].length).replace(/^([^\\.]+)$/,"$1."+ar(s[1])).replace(/\\.$/,"."+ar(s[1])).replace(/\\.(\\d*)$/,function(v,u){return"."+u+De("0",ar(s[1]).length-u.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\\./,".");if(a=a.replace(/^#+([0.])/,"$1"),s=a.match(/^(0*)\\.(#*)$/))return l+V0(f,s[2].length).replace(/\\.(\\d*[1-9])0*$/,".$1").replace(/^(-?\\d*)$/,"$1.").replace(/^0\\./,s[1].length?"0.":".");if(s=a.match(/^#{1,3},##0(\\.?)$/))return l+zr(xa(f,0));if(s=a.match(/^#,##0\\.([#0]*0)$/))return r<0?"-"+xr(e,a,-r):zr(""+(Math.floor(r)+Ii(r,s[1].length)))+"."+Tr(W0(r,s[1].length),s[1].length);if(s=a.match(/^#,#*,#0/))return xr(e,a.replace(/^#,#*,/,""),r);if(s=a.match(/^([0#]+)(\\\\?-([0#]+))+$/))return t=ua(xr(e,a.replace(/[\\\\-]/g,""),r)),i=0,ua(ua(a.replace(/\\\\/g,"")).replace(/[0#]/g,function(v){return i<t.length?t.charAt(i++):v==="0"?"0":""}));if(a.match(H0))return t=xr(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(s=a.match(/^([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),c=nt(f,Math.pow(10,i)-1,!1),t=""+l,o=Ir("n",s[1],c[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+s[2]+"/"+s[3],o=at(c[2],i),o.length<s[4].length&&(o=ar(s[4].substr(s[4].length-o.length))+o),t+=o,t;if(s=a.match(/^# ([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),c=nt(f,Math.pow(10,i)-1,!0),l+(c[0]||(c[1]?"":"0"))+" "+(c[1]?Ot(c[1],i)+s[2]+"/"+s[3]+at(c[2],i):De(" ",2*i+1+s[2].length+s[3].length));if(s=a.match(/^[#0?]+$/))return t=xa(r,0),a.length<=t.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(/^([#0?]+)\\.([#0]+)$/)){t=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=t.indexOf(".");var h=a.indexOf(".")-i,x=a.length-t.length-h;return ar(a.substr(0,h)+t+a.substr(a.length-x))}if(s=a.match(/^00,000\\.([#0]*0)$/))return i=W0(r,s[1].length),r<0?"-"+xr(e,a,-r):zr(Ni(r)).replace(/^\\d,\\d{3}$/,"0$&").replace(/^\\d*$/,function(v){return"00,"+(v.length<3?Tr(0,3-v.length):"")+v})+"."+Tr(i,s[1].length);switch(a){case"###,##0.00":return xr(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var d=zr(xa(f,0));return d!=="0"?l+d:"";case"###,###.00":return xr(e,"###,##0.00",r).replace(/^0\\./,".");case"#,###.00":return xr(e,"#,##0.00",r).replace(/^0\\./,".")}throw new Error("unsupported format |"+a+"|")}function Pi(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Ir(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function Li(e,a,r){var n=a.replace(L0,""),t=a.length-n.length;return Ir(e,n,r*Math.pow(10,2*t))+De("%",t)}function G0(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+G0(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var s=Math.floor(Math.log(a)*Math.LOG10E)%t;if(s<0&&(s+=t),r=(a/Math.pow(10,s)).toPrecision(n+1+(t+s)%t),!r.match(/[Ee]/)){var i=Math.floor(Math.log(a)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s),r=r.replace(/\\+-/,"-")}r=r.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function(c,f,l,o){return f+l+o.substr(0,(t+s)%t)+"."+o.substr(s)+"E"})}else r=a.toExponential(n);return e.match(/E\\+00$/)&&r.match(/e[+-]\\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\\-/)&&r.match(/e\\+/)&&(r=r.replace(/e\\+/,"e")),r.replace("e","E")}function Ar(e,a,r){if(e.charCodeAt(0)===40&&!a.match(U0)){var n=a.replace(/\\( */,"").replace(/ \\)/,"").replace(/\\)/,"");return r>=0?Ar("n",n,r):"("+Ar("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Pi(e,a,r);if(a.indexOf("%")!==-1)return Li(e,a,r);if(a.indexOf("E")!==-1)return G0(a,r);if(a.charCodeAt(0)===36)return"$"+Ar(e,a.substr(a.charAt(1)==" "?2:1),r);var t,s,i,c,f=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+Tr(f,a.length);if(a.match(/^[#?]+$/))return t=""+r,r===0&&(t=""),t.length>a.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(B0))return Ri(s,f,l);if(a.match(/^#+0+$/))return l+Tr(f,a.length-a.indexOf("0"));if(s=a.match(b0))return t=(""+r).replace(/^([^\\.]+)$/,"$1."+ar(s[1])).replace(/\\.$/,"."+ar(s[1])),t=t.replace(/\\.(\\d*)$/,function(v,u){return"."+u+De("0",ar(s[1]).length-u.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\\./,".");if(a=a.replace(/^#+([0.])/,"$1"),s=a.match(/^(0*)\\.(#*)$/))return l+(""+f).replace(/\\.(\\d*[1-9])0*$/,".$1").replace(/^(-?\\d*)$/,"$1.").replace(/^0\\./,s[1].length?"0.":".");if(s=a.match(/^#{1,3},##0(\\.?)$/))return l+zr(""+f);if(s=a.match(/^#,##0\\.([#0]*0)$/))return r<0?"-"+Ar(e,a,-r):zr(""+r)+"."+De("0",s[1].length);if(s=a.match(/^#,#*,#0/))return Ar(e,a.replace(/^#,#*,/,""),r);if(s=a.match(/^([0#]+)(\\\\?-([0#]+))+$/))return t=ua(Ar(e,a.replace(/[\\\\-]/g,""),r)),i=0,ua(ua(a.replace(/\\\\/g,"")).replace(/[0#]/g,function(v){return i<t.length?t.charAt(i++):v==="0"?"0":""}));if(a.match(H0))return t=Ar(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(s=a.match(/^([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),c=nt(f,Math.pow(10,i)-1,!1),t=""+l,o=Ir("n",s[1],c[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+s[2]+"/"+s[3],o=at(c[2],i),o.length<s[4].length&&(o=ar(s[4].substr(s[4].length-o.length))+o),t+=o,t;if(s=a.match(/^# ([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),c=nt(f,Math.pow(10,i)-1,!0),l+(c[0]||(c[1]?"":"0"))+" "+(c[1]?Ot(c[1],i)+s[2]+"/"+s[3]+at(c[2],i):De(" ",2*i+1+s[2].length+s[3].length));if(s=a.match(/^[#0?]+$/))return t=""+r,a.length<=t.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(/^([#0]+)\\.([#0]+)$/)){t=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=t.indexOf(".");var h=a.indexOf(".")-i,x=a.length-t.length-h;return ar(a.substr(0,h)+t+a.substr(a.length-x))}if(s=a.match(/^00,000\\.([#0]*0)$/))return r<0?"-"+Ar(e,a,-r):zr(""+r).replace(/^\\d,\\d{3}$/,"0$&").replace(/^\\d*$/,function(v){return"00,"+(v.length<3?Tr(0,3-v.length):"")+v})+"."+Tr(0,s[1].length);switch(a){case"###,###":case"##,###":case"#,###":var d=zr(""+f);return d!=="0"?l+d:"";default:if(a.match(/\\.[0#?]*$/))return Ar(e,a.slice(0,a.lastIndexOf(".")),r)+ar(a.slice(a.lastIndexOf(".")))}throw new Error("unsupported format |"+a+"|")}function Ir(e,a,r){return(r|0)===r?Ar(e,a,r):xr(e,a,r)}function Mi(e){for(var a=[],r=!1,n=0,t=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:a[a.length]=e.substr(t,n-t),t=n+1}if(a[a.length]=e.substr(t),r===!0)throw new Error("Format |"+e+"| unterminated string ");return a}var X0=/\\[[HhMmSs\\u0E0A\\u0E19\\u0E17]*\\]/;function ra(e){for(var a=0,r="",n="";a<e.length;)switch(r=e.charAt(a)){case"G":tt(e,a)&&(a+=6),a++;break;case'"':for(;e.charCodeAt(++a)!==34&&a<e.length;);++a;break;case"\\\\":a+=2;break;case"_":a+=2;break;case"@":++a;break;case"B":case"b":if(e.charAt(a+1)==="1"||e.charAt(a+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(a,3).toUpperCase()==="A/P"||e.substr(a,5).toUpperCase()==="AM/PM"||e.substr(a,5).toUpperCase()==="上午/下午")return!0;++a;break;case"[":for(n=r;e.charAt(a++)!=="]"&&a<e.length;)n+=e.charAt(a);if(n.match(X0))return!0;break;case".":case"0":case"#":for(;a<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++a))>-1||r=="\\\\"&&e.charAt(a+1)=="-"&&"0#".indexOf(e.charAt(a+2))>-1););break;case"?":for(;e.charAt(++a)===r;);break;case"*":++a,(e.charAt(a)==" "||e.charAt(a)=="*")&&++a;break;case"(":case")":++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;a<e.length&&"0123456789".indexOf(e.charAt(++a))>-1;);break;case" ":++a;break;default:++a;break}return!1}function Bi(e,a,r,n){for(var t=[],s="",i=0,c="",f="t",l,o,h,x="H";i<e.length;)switch(c=e.charAt(i)){case"G":if(!tt(e,i))throw new Error("unrecognized character "+c+" in "+e);t[t.length]={t:"G",v:"General"},i+=7;break;case'"':for(s="";(h=e.charCodeAt(++i))!==34&&i<e.length;)s+=String.fromCharCode(h);t[t.length]={t:"t",v:s},++i;break;case"\\\\":var d=e.charAt(++i),v=d==="("||d===")"?d:"t";t[t.length]={t:v,v:d},++i;break;case"_":t[t.length]={t:"t",v:" "},i+=2;break;case"@":t[t.length]={t:"T",v:a},++i;break;case"B":case"b":if(e.charAt(i+1)==="1"||e.charAt(i+1)==="2"){if(l==null&&(l=Xr(a,r,e.charAt(i+1)==="2"),l==null))return"";t[t.length]={t:"X",v:e.substr(i,2)},f=c,i+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":c=c.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(a<0||l==null&&(l=Xr(a,r),l==null))return"";for(s=c;++i<e.length&&e.charAt(i).toLowerCase()===c;)s+=c;c==="m"&&f.toLowerCase()==="h"&&(c="M"),c==="h"&&(c=x),t[t.length]={t:c,v:s},f=c;break;case"A":case"a":case"上":var u={t:c,v:c};if(l==null&&(l=Xr(a,r)),e.substr(i,3).toUpperCase()==="A/P"?(l!=null&&(u.v=l.H>=12?"P":"A"),u.t="T",x="h",i+=3):e.substr(i,5).toUpperCase()==="AM/PM"?(l!=null&&(u.v=l.H>=12?"PM":"AM"),u.t="T",i+=5,x="h"):e.substr(i,5).toUpperCase()==="上午/下午"?(l!=null&&(u.v=l.H>=12?"下午":"上午"),u.t="T",i+=5,x="h"):(u.t="t",++i),l==null&&u.t==="T")return"";t[t.length]=u,f=c;break;case"[":for(s=c;e.charAt(i++)!=="]"&&i<e.length;)s+=e.charAt(i);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(X0)){if(l==null&&(l=Xr(a,r),l==null))return"";t[t.length]={t:"Z",v:s.toLowerCase()},f=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\\$([^-\\[\\]]*)/)||[])[1]||"$",ra(e)||(t[t.length]={t:"t",v:s}));break;case".":if(l!=null){for(s=c;++i<e.length&&(c=e.charAt(i))==="0";)s+=c;t[t.length]={t:"s",v:s};break}case"0":case"#":for(s=c;++i<e.length&&"0#?.,E+-%".indexOf(c=e.charAt(i))>-1;)s+=c;t[t.length]={t:"n",v:s};break;case"?":for(s=c;e.charAt(++i)===c;)s+=c;t[t.length]={t:c,v:s},f=c;break;case"*":++i,(e.charAt(i)==" "||e.charAt(i)=="*")&&++i;break;case"(":case")":t[t.length]={t:n===1?"t":c,v:c},++i;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=c;i<e.length&&"0123456789".indexOf(e.charAt(++i))>-1;)s+=e.charAt(i);t[t.length]={t:"D",v:s};break;case" ":t[t.length]={t:c,v:c},++i;break;case"$":t[t.length]={t:"t",v:"$"},++i;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c)===-1)throw new Error("unrecognized character "+c+" in "+e);t[t.length]={t:"t",v:c},++i;break}var g=0,S=0,y;for(i=t.length-1,f="t";i>=0;--i)switch(t[i].t){case"h":case"H":t[i].t=x,f="h",g<1&&(g=1);break;case"s":(y=t[i].v.match(/\\.0+$/))&&(S=Math.max(S,y[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":f=t[i].t;break;case"m":f==="s"&&(t[i].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&t[i].v.match(/[Hh]/)&&(g=1),g<2&&t[i].v.match(/[Mm]/)&&(g=2),g<3&&t[i].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M),l.M>=60&&(l.M=0,++l.H);break;case 2:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M);break}var _="",N;for(i=0;i<t.length;++i)switch(t[i].t){case"t":case"T":case" ":case"D":break;case"X":t[i].v="",t[i].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":t[i].v=Ci(t[i].t.charCodeAt(0),t[i].v,l,S),t[i].t="t";break;case"n":case"?":for(N=i+1;t[N]!=null&&((c=t[N].t)==="?"||c==="D"||(c===" "||c==="t")&&t[N+1]!=null&&(t[N+1].t==="?"||t[N+1].t==="t"&&t[N+1].v==="/")||t[i].t==="("&&(c===" "||c==="n"||c===")")||c==="t"&&(t[N].v==="/"||t[N].v===" "&&t[N+1]!=null&&t[N+1].t=="?"));)t[i].v+=t[N].v,t[N]={v:"",t:";"},++N;_+=t[i].v,i=N-1;break;case"G":t[i].t="t",t[i].v=ea(a,r);break}var b="",I,F;if(_.length>0){_.charCodeAt(0)==40?(I=a<0&&_.charCodeAt(0)===45?-a:a,F=Ir("n",_,I)):(I=a<0&&n>1?-a:a,F=Ir("n",_,I),I<0&&t[0]&&t[0].t=="t"&&(F=F.substr(1),t[0].v="-"+t[0].v)),N=F.length-1;var V=t.length;for(i=0;i<t.length;++i)if(t[i]!=null&&t[i].t!="t"&&t[i].v.indexOf(".")>-1){V=i;break}var D=t.length;if(V===t.length&&F.indexOf("E")===-1){for(i=t.length-1;i>=0;--i)t[i]==null||"n?".indexOf(t[i].t)===-1||(N>=t[i].v.length-1?(N-=t[i].v.length,t[i].v=F.substr(N+1,t[i].v.length)):N<0?t[i].v="":(t[i].v=F.substr(0,N+1),N=-1),t[i].t="t",D=i);N>=0&&D<t.length&&(t[D].v=F.substr(0,N+1)+t[D].v)}else if(V!==t.length&&F.indexOf("E")===-1){for(N=F.indexOf(".")-1,i=V;i>=0;--i)if(!(t[i]==null||"n?".indexOf(t[i].t)===-1)){for(o=t[i].v.indexOf(".")>-1&&i===V?t[i].v.indexOf(".")-1:t[i].v.length-1,b=t[i].v.substr(o+1);o>=0;--o)N>=0&&(t[i].v.charAt(o)==="0"||t[i].v.charAt(o)==="#")&&(b=F.charAt(N--)+b);t[i].v=b,t[i].t="t",D=i}for(N>=0&&D<t.length&&(t[D].v=F.substr(0,N+1)+t[D].v),N=F.indexOf(".")+1,i=V;i<t.length;++i)if(!(t[i]==null||"n?(".indexOf(t[i].t)===-1&&i!==V)){for(o=t[i].v.indexOf(".")>-1&&i===V?t[i].v.indexOf(".")+1:0,b=t[i].v.substr(0,o);o<t[i].v.length;++o)N<F.length&&(b+=F.charAt(N++));t[i].v=b,t[i].t="t",D=i}}}for(i=0;i<t.length;++i)t[i]!=null&&"n?".indexOf(t[i].t)>-1&&(I=n>1&&a<0&&i>0&&t[i-1].v==="-"?-a:a,t[i].v=Ir(t[i].t,t[i].v,I),t[i].t="t");var z="";for(i=0;i!==t.length;++i)t[i]!=null&&(z+=t[i].v);return z}var z0=/\\[(=|>[=]?|<[>=]?)(-?\\d+(?:\\.\\d*)?)\\]/;function $0(e,a){if(a==null)return!1;var r=parseFloat(a[2]);switch(a[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function bi(e,a){var r=Mi(e),n=r.length,t=r[n-1].indexOf("@");if(n<4&&t>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof a!="number")return[4,r.length===4||t>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=t>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=t>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=t>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=a>0?r[0]:a<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\\[[=<>]/)!=null||r[1].match(/\\[[=<>]/)!=null){var i=r[0].match(z0),c=r[1].match(z0);return $0(a,i)?[n,r[0]]:$0(a,c)?[n,r[1]]:[n,r[i!=null&&c!=null?2:1]]}return[n,s]}function or(e,a,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:ue)[e],n==null&&(n=r.table&&r.table[I0[e]]||ue[I0[e]]),n==null&&(n=Ei[e]||"General");break}if(tt(n,0))return ea(a,r);a instanceof Date&&(a=P0(a,r.date1904));var t=bi(n,a);if(tt(t[1]))return ea(a,r);if(a===!0)a="TRUE";else if(a===!1)a="FALSE";else if(a===""||a==null)return"";return Bi(t[1],a,r,t[0])}function Nr(e,a){if(typeof a!="number"){a=+a||-1;for(var r=0;r<392;++r){if(ue[r]==null){a<0&&(a=r);continue}if(ue[r]==e){a=r;break}}a<0&&(a=391)}return ue[a]=e,a}function Ui(e){for(var a=0;a!=392;++a)e[a]!==void 0&&Nr(e[a],a)}function K0(){ue=_i()}var Y0={format:or,load:Nr,_table:ue,load_table:Ui,parse_date_code:Xr,is_date:ra,get_table:function(){return Y0._table=ue}},Hi={5:'"$"#,##0_);\\\\("$"#,##0\\\\)',6:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',7:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',8:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\\\("$"#,##0\\\\)',64:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',65:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',66:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},j0=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function Vi(e){var a=typeof e=="number"?ue[e]:e;return a=a.replace(j0,"(\\\\d+)"),new RegExp("^"+a+"$")}function Wi(e,a,r){var n=-1,t=-1,s=-1,i=-1,c=-1,f=-1;(a.match(j0)||[]).forEach(function(h,x){var d=parseInt(r[x+1],10);switch(h.toLowerCase().charAt(0)){case"y":n=d;break;case"d":s=d;break;case"h":i=d;break;case"s":f=d;break;case"m":i>=0?c=d:t=d;break}}),f>=0&&c==-1&&t>=0&&(c=t,t=-1);var l=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(t>=1?t:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);l.length==7&&(l="0"+l),l.length==8&&(l="20"+l);var o=("00"+(i>=0?i:0)).slice(-2)+":"+("00"+(c>=0?c:0)).slice(-2)+":"+("00"+(f>=0?f:0)).slice(-2);return i==-1&&c==-1&&f==-1?l:n==-1&&t==-1&&s==-1?o:l+"T"+o}var Gi=(function(){var e={};e.version="1.2.0";function a(){for(var F=0,V=new Array(256),D=0;D!=256;++D)F=D,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,V[D]=F;return typeof Int32Array<"u"?new Int32Array(V):V}var r=a();function n(F){var V=0,D=0,z=0,G=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(z=0;z!=256;++z)G[z]=F[z];for(z=0;z!=256;++z)for(D=F[z],V=256+z;V<4096;V+=256)D=G[V]=D>>>8^F[D&255];var P=[];for(z=1;z!=16;++z)P[z-1]=typeof Int32Array<"u"?G.subarray(z*256,z*256+256):G.slice(z*256,z*256+256);return P}var t=n(r),s=t[0],i=t[1],c=t[2],f=t[3],l=t[4],o=t[5],h=t[6],x=t[7],d=t[8],v=t[9],u=t[10],g=t[11],S=t[12],y=t[13],_=t[14];function N(F,V){for(var D=V^-1,z=0,G=F.length;z<G;)D=D>>>8^r[(D^F.charCodeAt(z++))&255];return~D}function b(F,V){for(var D=V^-1,z=F.length-15,G=0;G<z;)D=_[F[G++]^D&255]^y[F[G++]^D>>8&255]^S[F[G++]^D>>16&255]^g[F[G++]^D>>>24]^u[F[G++]]^v[F[G++]]^d[F[G++]]^x[F[G++]]^h[F[G++]]^o[F[G++]]^l[F[G++]]^f[F[G++]]^c[F[G++]]^i[F[G++]]^s[F[G++]]^r[F[G++]];for(z+=15;G<z;)D=D>>>8^r[(D^F[G++])&255];return~D}function I(F,V){for(var D=V^-1,z=0,G=F.length,P=0,J=0;z<G;)P=F.charCodeAt(z++),P<128?D=D>>>8^r[(D^P)&255]:P<2048?(D=D>>>8^r[(D^(192|P>>6&31))&255],D=D>>>8^r[(D^(128|P&63))&255]):P>=55296&&P<57344?(P=(P&1023)+64,J=F.charCodeAt(z++)&1023,D=D>>>8^r[(D^(240|P>>8&7))&255],D=D>>>8^r[(D^(128|P>>2&63))&255],D=D>>>8^r[(D^(128|J>>6&15|(P&3)<<4))&255],D=D>>>8^r[(D^(128|J&63))&255]):(D=D>>>8^r[(D^(224|P>>12&15))&255],D=D>>>8^r[(D^(128|P>>6&63))&255],D=D>>>8^r[(D^(128|P&63))&255]);return~D}return e.table=r,e.bstr=N,e.buf=b,e.str=I,e})(),me=(function(){var a={};a.version="1.2.1";function r(p,T){for(var m=p.split("/"),E=T.split("/"),k=0,w=0,M=Math.min(m.length,E.length);k<M;++k){if(w=m[k].length-E[k].length)return w;if(m[k]!=E[k])return m[k]<E[k]?-1:1}return m.length-E.length}function n(p){if(p.charAt(p.length-1)=="/")return p.slice(0,-1).indexOf("/")===-1?p:n(p.slice(0,-1));var T=p.lastIndexOf("/");return T===-1?p:p.slice(0,T+1)}function t(p){if(p.charAt(p.length-1)=="/")return t(p.slice(0,-1));var T=p.lastIndexOf("/");return T===-1?p:p.slice(T+1)}function s(p,T){typeof T=="string"&&(T=new Date(T));var m=T.getHours();m=m<<6|T.getMinutes(),m=m<<5|T.getSeconds()>>>1,p.write_shift(2,m);var E=T.getFullYear()-1980;E=E<<4|T.getMonth()+1,E=E<<5|T.getDate(),p.write_shift(2,E)}function i(p){var T=p.read_shift(2)&65535,m=p.read_shift(2)&65535,E=new Date,k=m&31;m>>>=5;var w=m&15;m>>>=4,E.setMilliseconds(0),E.setFullYear(m+1980),E.setMonth(w-1),E.setDate(k);var M=T&31;T>>>=5;var X=T&63;return T>>>=6,E.setHours(T),E.setMinutes(X),E.setSeconds(M<<1),E}function c(p){ze(p,0);for(var T={},m=0;p.l<=p.length-4;){var E=p.read_shift(2),k=p.read_shift(2),w=p.l+k,M={};switch(E){case 21589:m=p.read_shift(1),m&1&&(M.mtime=p.read_shift(4)),k>5&&(m&2&&(M.atime=p.read_shift(4)),m&4&&(M.ctime=p.read_shift(4))),M.mtime&&(M.mt=new Date(M.mtime*1e3));break}p.l=w,T[E]=M}return T}var f;function l(){return f||(f={})}function o(p,T){if(p[0]==80&&p[1]==75)return ui(p,T);if((p[0]|32)==109&&(p[1]|32)==105)return Nd(p,T);if(p.length<512)throw new Error("CFB file size "+p.length+" < 512");var m=3,E=512,k=0,w=0,M=0,X=0,L=0,B=[],H=p.slice(0,512);ze(H,0);var Y=h(H);switch(m=Y[0],m){case 3:E=512;break;case 4:E=4096;break;case 0:if(Y[1]==0)return ui(p,T);default:throw new Error("Major Version: Expected 3 or 4 saw "+m)}E!==512&&(H=p.slice(0,E),ze(H,28));var Q=p.slice(0,E);x(H,m);var se=H.read_shift(4,"i");if(m===3&&se!==0)throw new Error("# Directory Sectors: Expected 0 saw "+se);H.l+=4,M=H.read_shift(4,"i"),H.l+=4,H.chk("00100000","Mini Stream Cutoff Size: "),X=H.read_shift(4,"i"),k=H.read_shift(4,"i"),L=H.read_shift(4,"i"),w=H.read_shift(4,"i");for(var Z=-1,te=0;te<109&&(Z=H.read_shift(4,"i"),!(Z<0));++te)B[te]=Z;var de=d(p,E);g(L,w,de,E,B);var Ce=y(de,M,B,E);Ce[M].name="!Directory",k>0&&X!==J&&(Ce[X].name="!MiniFAT"),Ce[B[0]].name="!FAT",Ce.fat_addrs=B,Ce.ssz=E;var ye={},er=[],qa=[],Qa=[];_(M,Ce,de,er,k,ye,qa,X),v(qa,Qa,er),er.shift();var et={FileIndex:qa,FullPaths:Qa};return T&&T.raw&&(et.raw={header:Q,sectors:de}),et}function h(p){if(p[p.l]==80&&p[p.l+1]==75)return[0,0];p.chk(fe,"Header Signature: "),p.l+=16;var T=p.read_shift(2,"u");return[p.read_shift(2,"u"),T]}function x(p,T){var m=9;switch(p.l+=2,m=p.read_shift(2)){case 9:if(T!=3)throw new Error("Sector Shift: Expected 9 saw "+m);break;case 12:if(T!=4)throw new Error("Sector Shift: Expected 12 saw "+m);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+m)}p.chk("0600","Mini Sector Shift: "),p.chk("000000000000","Reserved: ")}function d(p,T){for(var m=Math.ceil(p.length/T)-1,E=[],k=1;k<m;++k)E[k-1]=p.slice(k*T,(k+1)*T);return E[m-1]=p.slice(m*T),E}function v(p,T,m){for(var E=0,k=0,w=0,M=0,X=0,L=m.length,B=[],H=[];E<L;++E)B[E]=H[E]=E,T[E]=m[E];for(;X<H.length;++X)E=H[X],k=p[E].L,w=p[E].R,M=p[E].C,B[E]===E&&(k!==-1&&B[k]!==k&&(B[E]=B[k]),w!==-1&&B[w]!==w&&(B[E]=B[w])),M!==-1&&(B[M]=E),k!==-1&&E!=B[E]&&(B[k]=B[E],H.lastIndexOf(k)<X&&H.push(k)),w!==-1&&E!=B[E]&&(B[w]=B[E],H.lastIndexOf(w)<X&&H.push(w));for(E=1;E<L;++E)B[E]===E&&(w!==-1&&B[w]!==w?B[E]=B[w]:k!==-1&&B[k]!==k&&(B[E]=B[k]));for(E=1;E<L;++E)if(p[E].type!==0){if(X=E,X!=B[X])do X=B[X],T[E]=T[X]+"/"+T[E];while(X!==0&&B[X]!==-1&&X!=B[X]);B[E]=-1}for(T[0]+="/",E=1;E<L;++E)p[E].type!==2&&(T[E]+="/")}function u(p,T,m){for(var E=p.start,k=p.size,w=[],M=E;m&&k>0&&M>=0;)w.push(T.slice(M*P,M*P+P)),k-=P,M=ta(m,M*4);return w.length===0?be(0):Gr(w).slice(0,p.size)}function g(p,T,m,E,k){var w=J;if(p===J){if(T!==0)throw new Error("DIFAT chain shorter than expected")}else if(p!==-1){var M=m[p],X=(E>>>2)-1;if(!M)return;for(var L=0;L<X&&(w=ta(M,L*4))!==J;++L)k.push(w);g(ta(M,E-4),T-1,m,E,k)}}function S(p,T,m,E,k){var w=[],M=[];k||(k=[]);var X=E-1,L=0,B=0;for(L=T;L>=0;){k[L]=!0,w[w.length]=L,M.push(p[L]);var H=m[Math.floor(L*4/E)];if(B=L*4&X,E<4+B)throw new Error("FAT boundary crossed: "+L+" 4 "+E);if(!p[H])break;L=ta(p[H],B)}return{nodes:w,data:dn([M])}}function y(p,T,m,E){var k=p.length,w=[],M=[],X=[],L=[],B=E-1,H=0,Y=0,Q=0,se=0;for(H=0;H<k;++H)if(X=[],Q=H+T,Q>=k&&(Q-=k),!M[Q]){L=[];var Z=[];for(Y=Q;Y>=0;){Z[Y]=!0,M[Y]=!0,X[X.length]=Y,L.push(p[Y]);var te=m[Math.floor(Y*4/E)];if(se=Y*4&B,E<4+se)throw new Error("FAT boundary crossed: "+Y+" 4 "+E);if(!p[te]||(Y=ta(p[te],se),Z[Y]))break}w[Q]={nodes:X,data:dn([L])}}return w}function _(p,T,m,E,k,w,M,X){for(var L=0,B=E.length?2:0,H=T[p].data,Y=0,Q=0,se;Y<H.length;Y+=128){var Z=H.slice(Y,Y+128);ze(Z,64),Q=Z.read_shift(2),se=bt(Z,0,Q-B),E.push(se);var te={name:se,type:Z.read_shift(1),color:Z.read_shift(1),L:Z.read_shift(4,"i"),R:Z.read_shift(4,"i"),C:Z.read_shift(4,"i"),clsid:Z.read_shift(16),state:Z.read_shift(4,"i"),start:0,size:0},de=Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2);de!==0&&(te.ct=N(Z,Z.l-8));var Ce=Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2);Ce!==0&&(te.mt=N(Z,Z.l-8)),te.start=Z.read_shift(4,"i"),te.size=Z.read_shift(4,"i"),te.size<0&&te.start<0&&(te.size=te.type=0,te.start=J,te.name=""),te.type===5?(L=te.start,k>0&&L!==J&&(T[L].name="!StreamData")):te.size>=4096?(te.storage="fat",T[te.start]===void 0&&(T[te.start]=S(m,te.start,T.fat_addrs,T.ssz)),T[te.start].name=te.name,te.content=T[te.start].data.slice(0,te.size)):(te.storage="minifat",te.size<0?te.size=0:L!==J&&te.start!==J&&T[L]&&(te.content=u(te,T[L].data,(T[X]||{}).data))),te.content&&ze(te.content,0),w[se]=te,M.push(te)}}function N(p,T){return new Date((hr(p,T+4)/1e7*Math.pow(2,32)+hr(p,T)/1e7-11644473600)*1e3)}function b(p,T){return l(),o(f.readFileSync(p),T)}function I(p,T){var m=T&&T.type;switch(m||ge&&Buffer.isBuffer(p)&&(m="buffer"),m||"base64"){case"file":return b(p,T);case"base64":return o(Er(fr(p)),T);case"binary":return o(Er(p),T)}return o(p,T)}function F(p,T){var m=T||{},E=m.root||"Root Entry";if(p.FullPaths||(p.FullPaths=[]),p.FileIndex||(p.FileIndex=[]),p.FullPaths.length!==p.FileIndex.length)throw new Error("inconsistent CFB structure");p.FullPaths.length===0&&(p.FullPaths[0]=E+"/",p.FileIndex[0]={name:E,type:5}),m.CLSID&&(p.FileIndex[0].clsid=m.CLSID),V(p)}function V(p){var T="Sh33tJ5";if(!me.find(p,"/"+T)){var m=be(4);m[0]=55,m[1]=m[3]=50,m[2]=54,p.FileIndex.push({name:T,type:2,content:m,size:4,L:69,R:69,C:69}),p.FullPaths.push(p.FullPaths[0]+T),D(p)}}function D(p,T){F(p);for(var m=!1,E=!1,k=p.FullPaths.length-1;k>=0;--k){var w=p.FileIndex[k];switch(w.type){case 0:E?m=!0:(p.FileIndex.pop(),p.FullPaths.pop());break;case 1:case 2:case 5:E=!0,isNaN(w.R*w.L*w.C)&&(m=!0),w.R>-1&&w.L>-1&&w.R==w.L&&(m=!0);break;default:m=!0;break}}if(!(!m&&!T)){var M=new Date(1987,1,19),X=0,L=Object.create?Object.create(null):{},B=[];for(k=0;k<p.FullPaths.length;++k)L[p.FullPaths[k]]=!0,p.FileIndex[k].type!==0&&B.push([p.FullPaths[k],p.FileIndex[k]]);for(k=0;k<B.length;++k){var H=n(B[k][0]);E=L[H],E||(B.push([H,{name:t(H).replace("/",""),type:1,clsid:ce,ct:M,mt:M,content:null}]),L[H]=!0)}for(B.sort(function(se,Z){return r(se[0],Z[0])}),p.FullPaths=[],p.FileIndex=[],k=0;k<B.length;++k)p.FullPaths[k]=B[k][0],p.FileIndex[k]=B[k][1];for(k=0;k<B.length;++k){var Y=p.FileIndex[k],Q=p.FullPaths[k];if(Y.name=t(Q).replace("/",""),Y.L=Y.R=Y.C=-(Y.color=1),Y.size=Y.content?Y.content.length:0,Y.start=0,Y.clsid=Y.clsid||ce,k===0)Y.C=B.length>1?1:-1,Y.size=0,Y.type=5;else if(Q.slice(-1)=="/"){for(X=k+1;X<B.length&&n(p.FullPaths[X])!=Q;++X);for(Y.C=X>=B.length?-1:X,X=k+1;X<B.length&&n(p.FullPaths[X])!=n(Q);++X);Y.R=X>=B.length?-1:X,Y.type=1}else n(p.FullPaths[k+1]||"")==n(Q)&&(Y.R=k+1),Y.type=2}}}function z(p,T){var m=T||{};if(m.fileType=="mad")return Pd(p,m);switch(D(p),m.fileType){case"zip":return Cd(p,m)}var E=(function(se){for(var Z=0,te=0,de=0;de<se.FileIndex.length;++de){var Ce=se.FileIndex[de];if(Ce.content){var ye=Ce.content.length;ye>0&&(ye<4096?Z+=ye+63>>6:te+=ye+511>>9)}}for(var er=se.FullPaths.length+3>>2,qa=Z+7>>3,Qa=Z+127>>7,et=qa+te+er+Qa,ha=et+127>>7,k0=ha<=109?0:Math.ceil((ha-109)/127);et+ha+k0+127>>7>ha;)k0=++ha<=109?0:Math.ceil((ha-109)/127);var Hr=[1,k0,ha,Qa,er,te,Z,0];return se.FileIndex[0].size=Z<<6,Hr[7]=(se.FileIndex[0].start=Hr[0]+Hr[1]+Hr[2]+Hr[3]+Hr[4]+Hr[5])+(Hr[6]+7>>3),Hr})(p),k=be(E[7]<<9),w=0,M=0;{for(w=0;w<8;++w)k.write_shift(1,re[w]);for(w=0;w<8;++w)k.write_shift(2,0);for(k.write_shift(2,62),k.write_shift(2,3),k.write_shift(2,65534),k.write_shift(2,9),k.write_shift(2,6),w=0;w<3;++w)k.write_shift(2,0);for(k.write_shift(4,0),k.write_shift(4,E[2]),k.write_shift(4,E[0]+E[1]+E[2]+E[3]-1),k.write_shift(4,0),k.write_shift(4,4096),k.write_shift(4,E[3]?E[0]+E[1]+E[2]-1:J),k.write_shift(4,E[3]),k.write_shift(-4,E[1]?E[0]-1:J),k.write_shift(4,E[1]),w=0;w<109;++w)k.write_shift(-4,w<E[2]?E[1]+w:-1)}if(E[1])for(M=0;M<E[1];++M){for(;w<236+M*127;++w)k.write_shift(-4,w<E[2]?E[1]+w:-1);k.write_shift(-4,M===E[1]-1?J:M+1)}var X=function(se){for(M+=se;w<M-1;++w)k.write_shift(-4,w+1);se&&(++w,k.write_shift(-4,J))};for(M=w=0,M+=E[1];w<M;++w)k.write_shift(-4,ie.DIFSECT);for(M+=E[2];w<M;++w)k.write_shift(-4,ie.FATSECT);X(E[3]),X(E[4]);for(var L=0,B=0,H=p.FileIndex[0];L<p.FileIndex.length;++L)H=p.FileIndex[L],H.content&&(B=H.content.length,!(B<4096)&&(H.start=M,X(B+511>>9)));for(X(E[6]+7>>3);k.l&511;)k.write_shift(-4,ie.ENDOFCHAIN);for(M=w=0,L=0;L<p.FileIndex.length;++L)H=p.FileIndex[L],H.content&&(B=H.content.length,!(!B||B>=4096)&&(H.start=M,X(B+63>>6)));for(;k.l&511;)k.write_shift(-4,ie.ENDOFCHAIN);for(w=0;w<E[4]<<2;++w){var Y=p.FullPaths[w];if(!Y||Y.length===0){for(L=0;L<17;++L)k.write_shift(4,0);for(L=0;L<3;++L)k.write_shift(4,-1);for(L=0;L<12;++L)k.write_shift(4,0);continue}H=p.FileIndex[w],w===0&&(H.start=H.size?H.start-1:J);var Q=w===0&&m.root||H.name;if(B=2*(Q.length+1),k.write_shift(64,Q,"utf16le"),k.write_shift(2,B),k.write_shift(1,H.type),k.write_shift(1,H.color),k.write_shift(-4,H.L),k.write_shift(-4,H.R),k.write_shift(-4,H.C),H.clsid)k.write_shift(16,H.clsid,"hex");else for(L=0;L<4;++L)k.write_shift(4,0);k.write_shift(4,H.state||0),k.write_shift(4,0),k.write_shift(4,0),k.write_shift(4,0),k.write_shift(4,0),k.write_shift(4,H.start),k.write_shift(4,H.size),k.write_shift(4,0)}for(w=1;w<p.FileIndex.length;++w)if(H=p.FileIndex[w],H.size>=4096)if(k.l=H.start+1<<9,ge&&Buffer.isBuffer(H.content))H.content.copy(k,k.l,0,H.size),k.l+=H.size+511&-512;else{for(L=0;L<H.size;++L)k.write_shift(1,H.content[L]);for(;L&511;++L)k.write_shift(1,0)}for(w=1;w<p.FileIndex.length;++w)if(H=p.FileIndex[w],H.size>0&&H.size<4096)if(ge&&Buffer.isBuffer(H.content))H.content.copy(k,k.l,0,H.size),k.l+=H.size+63&-64;else{for(L=0;L<H.size;++L)k.write_shift(1,H.content[L]);for(;L&63;++L)k.write_shift(1,0)}if(ge)k.l=k.length;else for(;k.l<k.length;)k.write_shift(1,0);return k}function G(p,T){var m=p.FullPaths.map(function(L){return L.toUpperCase()}),E=m.map(function(L){var B=L.split("/");return B[B.length-(L.slice(-1)=="/"?2:1)]}),k=!1;T.charCodeAt(0)===47?(k=!0,T=m[0].slice(0,-1)+T):k=T.indexOf("/")!==-1;var w=T.toUpperCase(),M=k===!0?m.indexOf(w):E.indexOf(w);if(M!==-1)return p.FileIndex[M];var X=!w.match(Fa);for(w=w.replace(rr,""),X&&(w=w.replace(Fa,"!")),M=0;M<m.length;++M)if((X?m[M].replace(Fa,"!"):m[M]).replace(rr,"")==w||(X?E[M].replace(Fa,"!"):E[M]).replace(rr,"")==w)return p.FileIndex[M];return null}var P=64,J=-2,fe="d0cf11e0a1b11ae1",re=[208,207,17,224,161,177,26,225],ce="00000000000000000000000000000000",ie={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:J,FREESECT:-1,HEADER_SIGNATURE:fe,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:ce,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ae(p,T,m){l();var E=z(p,m);f.writeFileSync(T,E)}function W(p){for(var T=new Array(p.length),m=0;m<p.length;++m)T[m]=String.fromCharCode(p[m]);return T.join("")}function le(p,T){var m=z(p,T);switch(T&&T.type||"buffer"){case"file":return l(),f.writeFileSync(T.filename,m),m;case"binary":return typeof m=="string"?m:W(m);case"base64":return y0(typeof m=="string"?m:W(m));case"buffer":if(ge)return Buffer.isBuffer(m)?m:qr(m);case"array":return typeof m=="string"?Er(m):m}return m}var he;function A(p){try{var T=p.InflateRaw,m=new T;if(m._processChunk(new Uint8Array([3,0]),m._finishFlushFlag),m.bytesRead)he=p;else throw new Error("zlib does not expose bytesRead")}catch(E){console.error("cannot use native zlib: "+(E.message||E))}}function U(p,T){if(!he)return li(p,T);var m=he.InflateRaw,E=new m,k=E._processChunk(p.slice(p.l),E._finishFlushFlag);return p.l+=E.bytesRead,k}function R(p){return he?he.deflateRawSync(p):ve(p)}var O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],ee=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ne(p){var T=(p<<1|p<<11)&139536|(p<<5|p<<15)&558144;return(T>>16|T>>8|T)&255}for(var q=typeof Uint8Array<"u",j=q?new Uint8Array(256):[],Te=0;Te<256;++Te)j[Te]=ne(Te);function C(p,T){var m=j[p&255];return T<=8?m>>>8-T:(m=m<<8|j[p>>8&255],T<=16?m>>>16-T:(m=m<<8|j[p>>16&255],m>>>24-T))}function Ie(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=6?0:p[E+1]<<8))>>>m&3}function ke(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=5?0:p[E+1]<<8))>>>m&7}function we(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=4?0:p[E+1]<<8))>>>m&15}function pe(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=3?0:p[E+1]<<8))>>>m&31}function ae(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=1?0:p[E+1]<<8))>>>m&127}function Ne(p,T,m){var E=T&7,k=T>>>3,w=(1<<m)-1,M=p[k]>>>E;return m<8-E||(M|=p[k+1]<<8-E,m<16-E)||(M|=p[k+2]<<16-E,m<24-E)||(M|=p[k+3]<<24-E),M&w}function gr(p,T,m){var E=T&7,k=T>>>3;return E<=5?p[k]|=(m&7)<<E:(p[k]|=m<<E&255,p[k+1]=(m&7)>>8-E),T+3}function Or(p,T,m){var E=T&7,k=T>>>3;return m=(m&1)<<E,p[k]|=m,T+1}function br(p,T,m){var E=T&7,k=T>>>3;return m<<=E,p[k]|=m&255,m>>>=8,p[k+1]=m,T+8}function Ja(p,T,m){var E=T&7,k=T>>>3;return m<<=E,p[k]|=m&255,m>>>=8,p[k+1]=m&255,p[k+2]=m>>>8,T+16}function Jr(p,T){var m=p.length,E=2*m>T?2*m:T+5,k=0;if(m>=T)return p;if(ge){var w=D0(E);if(p.copy)p.copy(w);else for(;k<p.length;++k)w[k]=p[k];return w}else if(q){var M=new Uint8Array(E);if(M.set)M.set(p);else for(;k<m;++k)M[k]=p[k];return M}return p.length=E,p}function ur(p){for(var T=new Array(p),m=0;m<p;++m)T[m]=0;return T}function Ur(p,T,m){var E=1,k=0,w=0,M=0,X=0,L=p.length,B=q?new Uint16Array(32):ur(32);for(w=0;w<32;++w)B[w]=0;for(w=L;w<m;++w)p[w]=0;L=p.length;var H=q?new Uint16Array(L):ur(L);for(w=0;w<L;++w)B[k=p[w]]++,E<k&&(E=k),H[w]=0;for(B[0]=0,w=1;w<=E;++w)B[w+16]=X=X+B[w-1]<<1;for(w=0;w<L;++w)X=p[w],X!=0&&(H[w]=B[X+16]++);var Y=0;for(w=0;w<L;++w)if(Y=p[w],Y!=0)for(X=C(H[w],E)>>E-Y,M=(1<<E+4-Y)-1;M>=0;--M)T[X|M<<Y]=Y&15|w<<4;return E}var Zr=q?new Uint16Array(512):ur(512),Za=q?new Uint16Array(32):ur(32);if(!q){for(var ir=0;ir<512;++ir)Zr[ir]=0;for(ir=0;ir<32;++ir)Za[ir]=0}(function(){for(var p=[],T=0;T<32;T++)p.push(5);Ur(p,Za,32);var m=[];for(T=0;T<=143;T++)m.push(8);for(;T<=255;T++)m.push(9);for(;T<=279;T++)m.push(7);for(;T<=287;T++)m.push(8);Ur(m,Zr,288)})();var Rr=(function(){for(var T=q?new Uint8Array(32768):[],m=0,E=0;m<ee.length-1;++m)for(;E<ee[m+1];++E)T[E]=m;for(;E<32768;++E)T[E]=29;var k=q?new Uint8Array(259):[];for(m=0,E=0;m<K.length-1;++m)for(;E<K[m+1];++E)k[E]=m;function w(X,L){for(var B=0;B<X.length;){var H=Math.min(65535,X.length-B),Y=B+H==X.length;for(L.write_shift(1,+Y),L.write_shift(2,H),L.write_shift(2,~H&65535);H-- >0;)L[L.l++]=X[B++]}return L.l}function M(X,L){for(var B=0,H=0,Y=q?new Uint16Array(32768):[];H<X.length;){var Q=Math.min(65535,X.length-H);if(Q<10){for(B=gr(L,B,+(H+Q==X.length)),B&7&&(B+=8-(B&7)),L.l=B/8|0,L.write_shift(2,Q),L.write_shift(2,~Q&65535);Q-- >0;)L[L.l++]=X[H++];B=L.l*8;continue}B=gr(L,B,+(H+Q==X.length)+2);for(var se=0;Q-- >0;){var Z=X[H];se=(se<<5^Z)&32767;var te=-1,de=0;if((te=Y[se])&&(te|=H&-32768,te>H&&(te-=32768),te<H))for(;X[te+de]==X[H+de]&&de<250;)++de;if(de>2){Z=k[de],Z<=22?B=br(L,B,j[Z+1]>>1)-1:(br(L,B,3),B+=5,br(L,B,j[Z-23]>>5),B+=3);var Ce=Z<8?0:Z-4>>2;Ce>0&&(Ja(L,B,de-K[Z]),B+=Ce),Z=T[H-te],B=br(L,B,j[Z]>>3),B-=3;var ye=Z<4?0:Z-2>>1;ye>0&&(Ja(L,B,H-te-ee[Z]),B+=ye);for(var er=0;er<de;++er)Y[se]=H&32767,se=(se<<5^X[H])&32767,++H;Q-=de-1}else Z<=143?Z=Z+48:B=Or(L,B,1),B=br(L,B,j[Z]),Y[se]=H&32767,++H}B=br(L,B,0)-1}return L.l=(B+7)/8|0,L.l}return function(L,B){return L.length<8?w(L,B):M(L,B)}})();function ve(p){var T=be(50+Math.floor(p.length*1.1)),m=Rr(p,T);return T.slice(0,m)}var Pe=q?new Uint16Array(32768):ur(32768),mr=q?new Uint16Array(32768):ur(32768),Ve=q?new Uint16Array(128):ur(128),la=1,oi=1;function Fd(p,T){var m=pe(p,T)+257;T+=5;var E=pe(p,T)+1;T+=5;var k=we(p,T)+4;T+=4;for(var w=0,M=q?new Uint8Array(19):ur(19),X=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],L=1,B=q?new Uint8Array(8):ur(8),H=q?new Uint8Array(8):ur(8),Y=M.length,Q=0;Q<k;++Q)M[O[Q]]=w=ke(p,T),L<w&&(L=w),B[w]++,T+=3;var se=0;for(B[0]=0,Q=1;Q<=L;++Q)H[Q]=se=se+B[Q-1]<<1;for(Q=0;Q<Y;++Q)(se=M[Q])!=0&&(X[Q]=H[se]++);var Z=0;for(Q=0;Q<Y;++Q)if(Z=M[Q],Z!=0){se=j[X[Q]]>>8-Z;for(var te=(1<<7-Z)-1;te>=0;--te)Ve[se|te<<Z]=Z&7|Q<<3}var de=[];for(L=1;de.length<m+E;)switch(se=Ve[ae(p,T)],T+=se&7,se>>>=3){case 16:for(w=3+Ie(p,T),T+=2,se=de[de.length-1];w-- >0;)de.push(se);break;case 17:for(w=3+ke(p,T),T+=3;w-- >0;)de.push(0);break;case 18:for(w=11+ae(p,T),T+=7;w-- >0;)de.push(0);break;default:de.push(se),L<se&&(L=se);break}var Ce=de.slice(0,m),ye=de.slice(m);for(Q=m;Q<286;++Q)Ce[Q]=0;for(Q=E;Q<30;++Q)ye[Q]=0;return la=Ur(Ce,Pe,286),oi=Ur(ye,mr,30),T}function Ad(p,T){if(p[0]==3&&!(p[1]&3))return[Wr(T),2];for(var m=0,E=0,k=D0(T||1<<18),w=0,M=k.length>>>0,X=0,L=0;(E&1)==0;){if(E=ke(p,m),m+=3,E>>>1)E>>1==1?(X=9,L=5):(m=Fd(p,m),X=la,L=oi);else{m&7&&(m+=8-(m&7));var B=p[m>>>3]|p[(m>>>3)+1]<<8;if(m+=32,B>0)for(!T&&M<w+B&&(k=Jr(k,w+B),M=k.length);B-- >0;)k[w++]=p[m>>>3],m+=8;continue}for(;;){!T&&M<w+32767&&(k=Jr(k,w+32767),M=k.length);var H=Ne(p,m,X),Y=E>>>1==1?Zr[H]:Pe[H];if(m+=Y&15,Y>>>=4,(Y>>>8&255)===0)k[w++]=Y;else{if(Y==256)break;Y-=257;var Q=Y<8?0:Y-4>>2;Q>5&&(Q=0);var se=w+K[Y];Q>0&&(se+=Ne(p,m,Q),m+=Q),H=Ne(p,m,L),Y=E>>>1==1?Za[H]:mr[H],m+=Y&15,Y>>>=4;var Z=Y<4?0:Y-2>>1,te=ee[Y];for(Z>0&&(te+=Ne(p,m,Z),m+=Z),!T&&M<se&&(k=Jr(k,se+100),M=k.length);w<se;)k[w]=k[w-te],++w}}}return T?[k,m+7>>>3]:[k.slice(0,w),m+7>>>3]}function li(p,T){var m=p.slice(p.l||0),E=Ad(m,T);return p.l+=E[1],E[0]}function hi(p,T){if(p)typeof console<"u"&&console.error(T);else throw new Error(T)}function ui(p,T){var m=p;ze(m,0);var E=[],k=[],w={FileIndex:E,FullPaths:k};F(w,{root:T.root});for(var M=m.length-4;(m[M]!=80||m[M+1]!=75||m[M+2]!=5||m[M+3]!=6)&&M>=0;)--M;m.l=M+4,m.l+=4;var X=m.read_shift(2);m.l+=6;var L=m.read_shift(4);for(m.l=L,M=0;M<X;++M){m.l+=20;var B=m.read_shift(4),H=m.read_shift(4),Y=m.read_shift(2),Q=m.read_shift(2),se=m.read_shift(2);m.l+=8;var Z=m.read_shift(4),te=c(m.slice(m.l+Y,m.l+Y+Q));m.l+=Y+Q+se;var de=m.l;m.l=Z+4,Sd(m,B,H,w,te),m.l=de}return w}function Sd(p,T,m,E,k){p.l+=2;var w=p.read_shift(2),M=p.read_shift(2),X=i(p);if(w&8257)throw new Error("Unsupported ZIP encryption");for(var L=p.read_shift(4),B=p.read_shift(4),H=p.read_shift(4),Y=p.read_shift(2),Q=p.read_shift(2),se="",Z=0;Z<Y;++Z)se+=String.fromCharCode(p[p.l++]);if(Q){var te=c(p.slice(p.l,p.l+Q));(te[21589]||{}).mt&&(X=te[21589].mt),((k||{})[21589]||{}).mt&&(X=k[21589].mt)}p.l+=Q;var de=p.slice(p.l,p.l+B);switch(M){case 8:de=U(p,H);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+M)}var Ce=!1;w&8&&(L=p.read_shift(4),L==134695760&&(L=p.read_shift(4),Ce=!0),B=p.read_shift(4),H=p.read_shift(4)),B!=T&&hi(Ce,"Bad compressed size: "+T+" != "+B),H!=m&&hi(Ce,"Bad uncompressed size: "+m+" != "+H),T0(E,se,de,{unsafe:!0,mt:X})}function Cd(p,T){var m=T||{},E=[],k=[],w=be(1),M=m.compression?8:0,X=0,L=0,B=0,H=0,Y=0,Q=p.FullPaths[0],se=Q,Z=p.FileIndex[0],te=[],de=0;for(L=1;L<p.FullPaths.length;++L)if(se=p.FullPaths[L].slice(Q.length),Z=p.FileIndex[L],!(!Z.size||!Z.content||se=="Sh33tJ5")){var Ce=H,ye=be(se.length);for(B=0;B<se.length;++B)ye.write_shift(1,se.charCodeAt(B)&127);ye=ye.slice(0,ye.l),te[Y]=Gi.buf(Z.content,0);var er=Z.content;M==8&&(er=R(er)),w=be(30),w.write_shift(4,67324752),w.write_shift(2,20),w.write_shift(2,X),w.write_shift(2,M),Z.mt?s(w,Z.mt):w.write_shift(4,0),w.write_shift(-4,te[Y]),w.write_shift(4,er.length),w.write_shift(4,Z.content.length),w.write_shift(2,ye.length),w.write_shift(2,0),H+=w.length,E.push(w),H+=ye.length,E.push(ye),H+=er.length,E.push(er),w=be(46),w.write_shift(4,33639248),w.write_shift(2,0),w.write_shift(2,20),w.write_shift(2,X),w.write_shift(2,M),w.write_shift(4,0),w.write_shift(-4,te[Y]),w.write_shift(4,er.length),w.write_shift(4,Z.content.length),w.write_shift(2,ye.length),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(4,0),w.write_shift(4,Ce),de+=w.l,k.push(w),de+=ye.length,k.push(ye),++Y}return w=be(22),w.write_shift(4,101010256),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(2,Y),w.write_shift(2,Y),w.write_shift(4,de),w.write_shift(4,H),w.write_shift(2,0),Gr([Gr(E),Gr(k),w])}var St={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function yd(p,T){if(p.ctype)return p.ctype;var m=p.name||"",E=m.match(/\\.([^\\.]+)$/);return E&&St[E[1]]||T&&(E=(m=T).match(/[\\.\\\\]([^\\.\\\\])+$/),E&&St[E[1]])?St[E[1]]:"application/octet-stream"}function Dd(p){for(var T=y0(p),m=[],E=0;E<T.length;E+=76)m.push(T.slice(E,E+76));return m.join(\`\\r
28
+ */function Hr(e,t){return e?eh(e)?j.createElement(e,t):e:null}function eh(e){return th(e)||typeof e=="function"||rh(e)}function th(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function rh(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function nh(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=j.useState(()=>({current:q1(t)})),[a,o]=j.useState(()=>r.current.initialState);return r.current.setOptions(s=>({...s,...e,state:{...a,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),r.current}const Be={checkbox_container:"_checkbox_container_3c4gu_1",checkbox_wrapper:"_checkbox_wrapper_3c4gu_13",label_text:"_label_text_3c4gu_33",hint_text:"_hint_text_3c4gu_51",checkbox:"_checkbox_3c4gu_1",input:"_input_3c4gu_99",checkbox_svg:"_checkbox_svg_3c4gu_153",custom_icon:"_custom_icon_3c4gu_195",checked:"_checked_3c4gu_225",indeterminate:"_indeterminate_3c4gu_227",radius_none:"_radius_none_3c4gu_235",radius_sm:"_radius_sm_3c4gu_243",radius_md:"_radius_md_3c4gu_251",radius_lg:"_radius_lg_3c4gu_259",radius_full:"_radius_full_3c4gu_267",sm:"_sm_3c4gu_275",lg:"_lg_3c4gu_301",secondary:"_secondary_3c4gu_327",success:"_success_3c4gu_335",warning:"_warning_3c4gu_343",danger:"_danger_3c4gu_351",solid:"_solid_3c4gu_377",outline:"_outline_3c4gu_391",disabled:"_disabled_3c4gu_439",readonly:"_readonly_3c4gu_509",no_animation:"_no_animation_3c4gu_589",line_through:"_line_through_3c4gu_607",lineThrough:"_lineThrough_3c4gu_1",checkbox_group:"_checkbox_group_3c4gu_651",label:"_label_3c4gu_33",marca_requerido:"_marca_requerido_3c4gu_679",description:"_description_3c4gu_687",checkboxes:"_checkboxes_3c4gu_701",vertical:"_vertical_3c4gu_711",horizontal:"_horizontal_3c4gu_719",grid:"_grid_3c4gu_727",error_message:"_error_message_3c4gu_737",invalid:"_invalid_3c4gu_749"},dc=_.createContext(null),uc=()=>_.useContext(dc),Ur=_.forwardRef((e,t)=>{const{children:r,label:a,hint:o,isSelected:s,defaultChecked:i,isIndeterminate:c=!1,isDisabled:l=!1,isReadOnly:d=!1,isRequired:h=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:u=!1,customCheckIcon:v,size:p="md",color:m="primary",customColor:w,radius:b="md",variant:y="solid",className:E="",classNames:S={},onChange:C,value:T,name:F,id:D,...M}=e,U=uc(),V=_.useId(),N=D||V,k=_.useRef(null),A=s!==void 0,[O,$]=_.useState(i??!1),x=!!U,I=x&&T?U.value.includes(T):!1,L=x?I:A?s:O,X=!!U?.maxSelectionReached&&!L,H=l||U?.isDisabled||X,z=d||U?.isReadOnly,q=U?!1:h,B=F||U?.name,K=o?`${N}-hint`:void 0;_.useEffect(()=>{const ee=k.current||(t&&typeof t=="object"?t.current:null);ee&&(ee.indeterminate=c??!1)},[c,t]);const Y=ee=>{if(H||z)return;const se=ee.target.checked;x&&T?U.onChange(T):(A||$(se),C?.(se))},Q=a||r;return n.jsxs("div",{className:ne(Be.checkbox_container,{[Be.disabled]:H,[Be.readonly]:z},S.base,E),children:[n.jsxs("label",{className:ne(Be.checkbox_wrapper,Be[p],!w&&Be[m],Be[y],Be[`radius_${b}`],{[Be.checked]:L,[Be.indeterminate]:c,[Be.disabled]:H,[Be.readonly]:z,[Be.line_through]:g&&L,[Be.no_animation]:u}),style:w?{"--checkbox-custom-color":w}:void 0,children:[n.jsxs("span",{className:Be.checkbox,children:[n.jsx("input",{"data-testid":B?`checkbox-${B}${T?`-${T}`:""}`:N,...M,ref:ee=>{k.current=ee,typeof t=="function"?t(ee):t&&(t.current=ee)},id:N,type:"checkbox",className:Be.input,checked:L,onChange:Y,disabled:H,readOnly:z,required:q,"aria-required":q||void 0,"aria-describedby":K,value:T,name:B}),v?n.jsx("span",{className:Be.custom_icon,children:v}):n.jsx("svg",{className:Be.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:n.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:c?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&Q&&n.jsx("span",{className:ne(Be.label_text,S.label),children:Q})]}),o&&n.jsx("span",{id:K,className:ne(Be.hint_text,S.label),children:o})]})});Ur.displayName="Checkbox";const fc=({label:e,children:t,description:r,errorMessage:a,isInvalid:o=!1,orientation:s="vertical",className:i,value:c,defaultValue:l=[],onChange:d,isDisabled:h=!1,isReadOnly:g=!1,isRequired:f=!1,minSelection:u,maxSelection:v,requiredMessage:p,name:m,options:w,optionValueKey:b,optionLabelKey:y,optionDisabledKey:E,optionDescriptionKey:S,columns:C,id:T,"data-testid":F})=>{const D=c!==void 0,[M,U]=_.useState(l),V=D?c:M,N=_.useRef(null),k=_.useId(),A=T??`checkbox-group-${k}`,O=e?`${A}-label`:void 0,$=r?`${A}-desc`:void 0,x=o&&a?`${A}-err`:void 0,I=[$,x].filter(Boolean).join(" ")||void 0,L=f?u??1:u??0,X=v!==void 0&&V.length>=v;_.useEffect(()=>{if(!N.current||L===0)return;L-V.length<=0?N.current.setCustomValidity(""):N.current.setCustomValidity(p??(L===1?"Selecciona al menos una opción":`Selecciona al menos ${L} opciones`))},[V,L,p]);const H=q=>{if(h||g)return;const B=V.includes(q);if(!B&&X)return;const K=B?V.filter(Y=>Y!==q):[...V,q];D||U(K),d?.(K)},z=n.jsx("input",{ref:N,type:"checkbox",required:!0,checked:V.length>=L,onChange:()=>{},"aria-hidden":"true",tabIndex:-1,style:{height:"1px",left:0,opacity:0,pointerEvents:"none",position:"absolute",top:"100%",width:"1px"}});return n.jsxs("div",{className:ne(Be.checkbox_group,Be[s],{[Be.invalid]:o,[Be.disabled]:h,[Be.readonly]:g},i),id:A,role:"group","aria-required":f||L>0,"aria-invalid":o,"aria-labelledby":O,"aria-describedby":I,"data-testid":F??(m?`checkbox-group-${m}`:A),children:[L>0&&!e&&z,e&&n.jsxs("div",{id:O,className:Be.label,style:{position:"relative"},children:[e,(f||L>0)&&n.jsx("span",{className:Be.marca_requerido,children:" *"}),L>0&&z]}),r&&n.jsx("div",{id:$,className:Be.description,children:r}),n.jsx(dc.Provider,{value:{value:V,onChange:H,isDisabled:h,isReadOnly:g,isRequired:f,name:m,maxSelectionReached:X},children:n.jsx("div",{className:ne(Be.checkboxes,!C&&Be[s],C&&Be.grid),style:C?{gridTemplateColumns:typeof C=="number"?`repeat(${C}, 1fr)`:C}:void 0,children:w&&w.length>0?w.map((q,B)=>{let K,Y,Q=!1,ee;if(typeof q=="object"&&q!==null){const se=b??"value",ce=y??"label",ae=E??"isDisabled",de=S??"description",oe=q[se];K=String(oe!==void 0?oe:B),Y=q[ce];const fe=q[ae];Q=typeof fe=="boolean"?fe:!1;const pe=q[de];ee=typeof pe=="string"?pe:void 0}else K=String(q),Y=q;return n.jsx(Ur,{value:K,isDisabled:Q,hint:ee,children:Y},K)}):t})}),a&&o&&n.jsx("div",{id:x,className:Be.error_message,role:"alert",children:a})]})};fc.displayName="CheckboxGroup";const Fo=_.createContext(null),$o=()=>{const e=_.useContext(Fo);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},fn=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,hc=e=>e.type==="checkbox",_c=e=>e.type==="radio",pc=e=>e.type==="separator",gc=e=>e.type==="label",Me={menu:"_menu_1fn41_1",variant_default:"_variant_default_1fn41_55",variant_elevated:"_variant_elevated_1fn41_65",variant_bordered:"_variant_bordered_1fn41_75",variant_glass:"_variant_glass_1fn41_89",size_sm:"_size_sm_1fn41_103",size_md:"_size_md_1fn41_119",size_lg:"_size_lg_1fn41_133",item:"_item_1fn41_149",disabled:"_disabled_1fn41_207",active:"_active_1fn41_209",loading:"_loading_1fn41_255",spinner_item:"_spinner_item_1fn41_267",spinItem:"_spinItem_1fn41_1",danger:"_danger_1fn41_299",has_submenu:"_has_submenu_1fn41_313",submenu_open:"_submenu_open_1fn41_321",indicator:"_indicator_1fn41_329",start_icon:"_start_icon_1fn41_361",content:"_content_1fn41_409",label_text:"_label_text_1fn41_429",description:"_description_1fn41_443",shortcut:"_shortcut_1fn41_461",end_icon:"_end_icon_1fn41_485",submenu_arrow:"_submenu_arrow_1fn41_519",separator:"_separator_1fn41_555",label:"_label_1fn41_429",context_menu_trigger:"_context_menu_trigger_1fn41_663"},ah=()=>n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),oh=()=>n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),sh=({marcado:e})=>n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&n.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),Oo=_.forwardRef(({item:e,index:t,activeIndex:r,getItemProps:a},o)=>{const s=$o();if(pc(e))return n.jsx("div",{className:ne(Me.separator,s.classNames?.separator),role:"separator"});if(gc(e))return n.jsx("div",{className:ne(Me.label,s.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const i=t===r,c=hc(e),l=_c(e),d=T=>{"isDisabled"in e&&e.isDisabled||(c?e.onCheckedChange?.(!e.isChecked):l&&s.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(T),s.closeOnSelect&&!fn(e)&&s.cerrarMenu())},h=T=>{d(T)},g=T=>{"isDisabled"in e&&e.isDisabled||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),d(T))},f=c?e.isChecked:!1,u=l?s.radioValue===e.value:!1,v="label"in e?e.label:void 0,p="description"in e?e.description:void 0,m="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,b="endIcon"in e?e.endIcon:void 0,y="isDisabled"in e?e.isDisabled:!1,E="isLoading"in e?e.isLoading:!1,S="isDanger"in e?e.isDanger:!1,C="className"in e?e.className:void 0;return n.jsxs("div",{ref:o,role:c?"menuitemcheckbox":l?"menuitemradio":"menuitem","aria-checked":c?f:l?u:void 0,"aria-disabled":y||E,tabIndex:i?0:-1,className:ne(Me.item,Me[`size_${s.size}`],i&&Me.active,y&&Me.disabled,E&&Me.loading,S&&Me.danger,fn(e)&&Me.has_submenu,C,s.classNames?.item),...a({onClick:h,onKeyDown:g}),children:[E?n.jsx("span",{className:Me.indicator,children:n.jsx("span",{className:Me.spinner_item})}):(c||l)&&n.jsxs("span",{className:Me.indicator,children:[c&&f&&n.jsx(ah,{}),l&&n.jsx(sh,{marcado:u})]}),!E&&w&&n.jsx("span",{className:Me.start_icon,children:w}),n.jsxs("span",{className:Me.content,children:[n.jsx("span",{className:Me.label_text,children:v}),p&&n.jsx("span",{className:Me.description,children:p})]}),m&&n.jsx("kbd",{className:Me.shortcut,children:m}),b&&n.jsx("span",{className:Me.end_icon,children:b}),fn(e)&&n.jsx("span",{className:Me.submenu_arrow,children:n.jsx(oh,{})})]})});Oo.displayName="MenuItem";const ih=()=>n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),ua=({items:e,activeIndex:t,getItemProps:r,listRef:a})=>n.jsx(n.Fragment,{children:(e??[]).map((o,s)=>fn(o)?n.jsx(Do,{ref:i=>{a.current[s]=i},item:o,index:s,activeIndex:t,getItemProps:r},o.id):n.jsx(Oo,{ref:i=>{a.current[s]=i},item:o,index:s,activeIndex:t,getItemProps:r},o.id))});ua.displayName="MenuList";const Do=_.forwardRef(({item:e,index:t,activeIndex:r,getItemProps:a},o)=>{const s=$o(),[i,c]=_.useState(!1),l=Er(),d=pi(),h=_.useRef([]),[g,f]=_.useState(null),{refs:u,floatingStyles:v,context:p,isPositioned:m}=ea({nodeId:d,open:i,onOpenChange:c,placement:"right-start",middleware:[Un({mainAxis:4,alignmentAxis:-4}),qn(),Wn({padding:8})],whileElementsMounted:Vn}),{isMounted:w,styles:b}=oa(p,{duration:s.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:s.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),y=no(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:zi({blockPointerEvents:!0})}),E=aa(p,{role:"menu"}),S=Qn(p,{bubbles:!0}),C=fo(p,{listRef:h,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:T,getFloatingProps:F,getItemProps:D}=ta([y,E,S,C]);_.useEffect(()=>{if(!l)return;const V=()=>c(!1);return l.events.on("click",V),()=>{l.events.off("click",V)}},[l]);const M=t===r,U=eo([u.setReference,o]);return n.jsxs(gi,{id:d,children:[n.jsxs("div",{ref:U,role:"menuitem","aria-haspopup":"menu","aria-expanded":i,"aria-disabled":e.isDisabled,tabIndex:M?0:-1,className:ne(Me.item,Me[`size_${s.size}`],M&&Me.active,e.isDisabled&&Me.disabled,e.isDanger&&Me.danger,Me.has_submenu,i&&Me.submenu_open,e.className,s.classNames?.item),...T(a()),children:[e.startIcon&&n.jsx("span",{className:Me.start_icon,children:e.startIcon}),n.jsxs("span",{className:Me.content,children:[n.jsx("span",{className:Me.label_text,children:e.label}),e.description&&n.jsx("span",{className:Me.description,children:e.description})]}),e.shortcut&&n.jsx("kbd",{className:Me.shortcut,children:e.shortcut}),n.jsx("span",{className:Me.submenu_arrow,children:n.jsx(ih,{})})]}),w&&n.jsx(Jn,{root:s.portalContainer,children:n.jsx(io,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:n.jsx("div",{ref:u.setFloating,style:{...v,pointerEvents:"none",zIndex:s.zIndex??"var(--z-dropdown)"},children:n.jsx("div",{className:ne(Me.menu,Me[`variant_${s.variant}`],s.classNames?.menu),style:{...b,pointerEvents:"auto",visibility:m||!i?"visible":"hidden"},...F(),children:n.jsx(ua,{items:e.children,activeIndex:g,getItemProps:D,listRef:h})})})})})]})});Do.displayName="Submenu";const vc=_.forwardRef(({children:e,items:t,triggerAction:r="click",placement:a="bottom-start",variant:o="default",size:s="md",isDisabled:i=!1,offset:c=4,minWidth:l="180px",matchTriggerWidth:d=!1,disableAnimation:h=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:u=!0,className:v,classNames:p,style:m,onOpen:w,onClose:b,onOpenChange:y,onContextMenu:E,isOpen:S,zIndex:C,portalContainer:T,radioValue:F,onRadioChange:D},M)=>{const[U,V]=_.useState(!1),[N,k]=_.useState(null),[A,O]=_.useState(0),$=_.useRef([]),x=_.useRef([]),I=pi(),L=S!==void 0,X=L?S:U,H=_.useCallback(G=>{i&&G||(L||V(G),y?.(G),G?w?.():b?.())},[i,L,y,w,b]);_.useEffect(()=>{x.current=(t??[]).filter(G=>G.type!=="separator"&&G.type!=="label").map(G=>"label"in G&&typeof G.label=="string"?G.label:"")},[t]);const{refs:z,floatingStyles:q,context:B,isPositioned:K}=ea({nodeId:I,open:X,onOpenChange:H,placement:a,strategy:"fixed",middleware:[Un(c),qn({fallbackAxisSideDirection:"start",padding:8}),Wn({padding:8}),d?si({apply({rects:G,elements:W}){Object.assign(W.floating.style,{minWidth:`${G.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:(G,W,re)=>Vn(G,W,re,{animationFrame:!1})}),Y=Ii(B,{enabled:!i&&(r==="click"||r==="both"),toggle:!0}),Q=no(B,{enabled:!i&&r==="hover",delay:{open:150,close:150},handleClose:zi()}),ee=Qn(B,{enabled:f||g,escapeKey:f,outsidePress:g}),se=aa(B,{role:"menu"}),ce=fo(B,{listRef:$,activeIndex:N,onNavigate:k,loop:!0}),ae=Di(B,{listRef:x,activeIndex:N,onMatch:k,enabled:X}),{getReferenceProps:de,getFloatingProps:oe,getItemProps:fe}=ta([Y,Q,ee,se,ce,ae]),{isMounted:pe,styles:te}=oa(B,{duration:h?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:h?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});_.useImperativeHandle(M,()=>({open:()=>H(!0),close:()=>H(!1),toggle:()=>H(!X),isOpen:X}),[H,X]);const ue=_.useMemo(()=>({radioValue:F,onRadioChange:D,cerrarMenu:()=>H(!1),closeOnSelect:u,size:s,variant:o,disableAnimation:h,classNames:p,portalContainer:T,zIndex:C}),[F,D,H,u,s,o,h,p,T,C]),ge=_.isValidElement(e)?e:null,ve=eo([z.setReference,ge?Ji(ge):null]);if(!ge)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const J=r==="contextmenu"||r==="both"?{onContextMenu:G=>{G.preventDefault();const W={x:G.clientX,y:G.clientY};E?.(G,W),H(!1),O(re=>re+1),requestAnimationFrame(()=>{z.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:W.x,y:W.y,top:W.y,left:W.x,right:W.x,bottom:W.y}}}),H(!0)})},onClick:()=>{X&&r==="contextmenu"&&H(!1)}}:{},P=_.cloneElement(e,de({...e.props,...J,ref:ve,"aria-haspopup":"menu","aria-expanded":X}));return n.jsx(Fo.Provider,{value:ue,children:n.jsxs(gi,{id:I,children:[P,pe&&n.jsx(Jn,{root:T,children:n.jsx(io,{context:B,modal:!1,initialFocus:-1,returnFocus:!0,children:n.jsx("div",{ref:z.setFloating,style:{...q,zIndex:C??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:n.jsx("div",{role:"menu","aria-orientation":"vertical",className:ne(Me.menu,Me[`variant_${o}`],Me[`size_${s}`],v,p?.menu),style:{...te,minWidth:l,...m,transform:[te.transform,m?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:K||!X?"visible":"hidden"},...oe(),children:n.jsx(ua,{items:t,activeIndex:N,getItemProps:fe,listRef:$})},A)})})})]})})});vc.displayName="DropdownMenuInner";const hn=_.forwardRef((e,t)=>n.jsx(_f,{children:n.jsx(vc,{...e,ref:t})}));hn.displayName="DropdownMenu";const mc=_.forwardRef(({isEnabled:e=!0,children:t,...r},a)=>n.jsx(hn,{...r,ref:a,triggerAction:"contextmenu",isDisabled:!e||r.isDisabled,children:t}));mc.displayName="ContextMenu";const hr={contenedor:"_contenedor_1leqv_1",lista:"_lista_1leqv_13",item:"_item_1leqv_45",item_dragging:"_item_dragging_1leqv_75",item_deshabilitado:"_item_deshabilitado_1leqv_85",icono_drag:"_icono_drag_1leqv_95",nombre:"_nombre_1leqv_147",checkbox:"_checkbox_1leqv_177"};function bc(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function wc(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function ch(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function lh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function dh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M10.97 20.344L9 21v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4h16v2.172a2 2 0 0 1-.586 1.414L15 12v1.5m3.42 2.11a2.1 2.1 0 0 1 2.97 2.97L18 22h-3v-3z"})})}function uh(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[n.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),n.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function fh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function hh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:n.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function _h(e){return n.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[n.jsx("circle",{cx:"5.5",cy:"4",r:"1.2",fill:"currentColor"}),n.jsx("circle",{cx:"5.5",cy:"8",r:"1.2",fill:"currentColor"}),n.jsx("circle",{cx:"5.5",cy:"12",r:"1.2",fill:"currentColor"}),n.jsx("circle",{cx:"10.5",cy:"4",r:"1.2",fill:"currentColor",opacity:".35"}),n.jsx("circle",{cx:"10.5",cy:"8",r:"1.2",fill:"currentColor",opacity:".35"}),n.jsx("circle",{cx:"10.5",cy:"12",r:"1.2",fill:"currentColor",opacity:".35"})]})}function ph(e){return n.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[n.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),n.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function gh(e){return n.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[n.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),n.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function vh(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),n.jsx("path",{fill:"currentColor",d:"M13 7a1 1 0 1 0-2 0v4H7a1 1 0 1 0 0 2h4v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V7Z"})]})}function mh(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),n.jsx("path",{fill:"currentColor",d:"M7 12a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"})]})}function bh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:n.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function wh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:n.jsxs("g",{fill:"none",children:[n.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),n.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function yh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:n.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function kh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:n.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}function xh(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0 12c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2"})})}function Eh(){const e=_r(),[t,r]=_.useState(null);if(!e)return null;const{state:a,todasLasColumnas:o,etiquetaColumna:s,cambiarOrdenColumnas:i}=e,{ordenColumnas:c,maxColumnasVisibles:l=10}=a,h=o.filter(v=>v.getIsVisible()).length>=l,g=v=>p=>{r(v),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",v)},f=v=>p=>{p.preventDefault(),!(!t||t===v)&&i?.(m=>{const w=[...m],b=w.indexOf(t),y=w.indexOf(v);return b===-1||y===-1?m:(w.splice(b,1),w.splice(y,0,t),w)})},u=()=>r(null);return n.jsx("div",{className:hr.contenedor,children:n.jsx("ul",{className:hr.lista,children:c.map(v=>{const p=o.find(E=>E.id===v);if(!p)return null;const m=p.getCanHide?.()??!0,w=p.getIsVisible(),b=t===p.id,y=!m||!w&&h;return n.jsxs("li",{className:`${hr.item} ${b?hr.item_dragging:""} ${y?hr.item_deshabilitado:""}`,draggable:!y,onDragStart:g(p.id),onDragOver:f(p.id),onDrop:u,onDragEnd:u,title:!w&&h?`Límite de ${l} columnas visibles alcanzado`:void 0,children:[n.jsx("span",{className:hr.icono_drag,"aria-label":"Arrastrar columna",children:n.jsx(_h,{})}),n.jsx("span",{className:hr.nombre,children:s(p.id)}),n.jsx(Ur,{size:"md",color:"primary",isSelected:w,isDisabled:y,onChange:E=>p.toggleVisibility(E),className:hr.checkbox})]},p.id)})})})}const _n={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function Ch(){const e=_r(),[t,r]=_.useState(""),a=_.useRef(null),o=e?.state.table?.getState().pagination.pageSize??10;if(_.useEffect(()=>r(String(o)),[o]),!e)return null;const{cambiarPageSize:s}=e,i=g=>Math.max(Lo,Math.min(Po,g)),c=g=>{const f=o+g;f>=Lo&&f<=Po&&s?.(f)},l=()=>{const g=parseInt(t,10),f=!isNaN(g)&&g>0?i(g):o;s?.(f),r(String(f))},d=g=>{({Enter:()=>{l(),a.current?.blur()},Escape:()=>{r(String(o)),a.current?.blur()},ArrowUp:()=>{g.preventDefault(),c(1),setTimeout(()=>a.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),c(-1),setTimeout(()=>a.current?.select(),0)}})[g.key]?.()},h=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&r(f)};return n.jsxs("div",{className:_n.contenido,children:[n.jsx("p",{className:_n.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),n.jsxs("div",{className:_n.control,children:[n.jsx(Ye,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>c(-1),"aria-label":"Disminuir filas",disabled:o<=Lo,children:n.jsx(mh,{style:{fontSize:"var(--gaps-6)"}})}),n.jsx("div",{className:_n.valor,children:n.jsx("input",{ref:a,type:"text",inputMode:"numeric",value:t,onChange:h,onKeyDown:d,onFocus:()=>a.current?.select(),onBlur:l,className:_n.input,"aria-label":"Número de filas por página"})}),n.jsx(Ye,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>c(1),"aria-label":"Aumentar filas",disabled:o>=Po,children:n.jsx(vh,{})})]})]})}const Tt={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function Sh({navegar:e}){const t=_r();return n.jsxs("div",{className:Tt.contenedor,children:[n.jsx("nav",{className:Tt.menu,children:Nh.map(({id:r,icono:a,nombre:o,descripcion:s})=>n.jsxs("button",{type:"button",className:Tt.item,onClick:()=>e(r),children:[n.jsx("div",{className:Tt.icono_contenedor,children:n.jsx(a,{})}),n.jsxs("div",{className:Tt.texto,children:[n.jsx("span",{className:Tt.nombre,children:o}),n.jsx("span",{className:Tt.descripcion,children:s})]}),n.jsx(wc,{className:Tt.chevron})]},r))}),n.jsx("div",{className:Tt.divider}),n.jsx("div",{className:Tt.menu,children:n.jsxs("button",{type:"button",className:Tt.item,onClick:t?.restaurarConfiguracion,children:[n.jsx("div",{className:Tt.icono_contenedor,children:n.jsx(hh,{className:Tt.icono_restaurar})}),n.jsxs("div",{className:Tt.texto,children:[n.jsx("span",{className:Tt.nombre,children:"Restaurar configuración"}),n.jsx("span",{className:Tt.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Lo=1,Po=200,yc=250,Th=200,kc=3,Ah={panelPrincipal:{component:Sh},panelColumnas:{component:Eh,titulo:"Columnas visibles"},panelFilas:{component:Ch,titulo:"Filas por página"}},Nh=[{id:"panelColumnas",icono:ph,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:gh,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}],He={contenedor:"_contenedor_16k0y_1",contenedor_superior:"_contenedor_superior_16k0y_17",input_con_icono:"_input_con_icono_16k0y_35",icono_busqueda:"_icono_busqueda_16k0y_49",input_busqueda:"_input_busqueda_16k0y_75",contenedor_acciones_botones:"_contenedor_acciones_botones_16k0y_147",contenedor_acciones:"_contenedor_acciones_16k0y_147",columna:"_columna_16k0y_183",encabezados:"_encabezados_16k0y_203",contenido_encabezado:"_contenido_encabezado_16k0y_229",icono_orden:"_icono_orden_16k0y_243",boton_basico:"_boton_basico_16k0y_323",texto_filtros:"_texto_filtros_16k0y_347",menu_configuraciones:"_menu_configuraciones_16k0y_379",tabla_card:"_tabla_card_16k0y_427",wrapper_scroll_tabla:"_wrapper_scroll_tabla_16k0y_439",contenedor_tabla:"_contenedor_tabla_16k0y_453",contenedor_datos:"_contenedor_datos_16k0y_467",datos:"_datos_16k0y_501",seleccionada:"_seleccionada_16k0y_549",boton_acciones:"_boton_acciones_16k0y_609"};function xc(e){return"contenido"in e}function Ih({fila:e,controls:t}){const r=t.filter(l=>!l.visible||l.visible(e)),a=r.filter(l=>!xc(l)),o=r.filter(xc),s=a.slice(0,kc-1),c=a.slice(kc-1).map(l=>({id:l.id,label:l.nombre,startIcon:l.icono,onSelect:()=>l.evento(e)}));return n.jsxs("div",{className:He.contenedor_acciones,children:[o.map(l=>n.jsx(dr,{content:l.nombre,variant:"default",size:"sm",placement:"top",children:n.jsx("span",{children:l.contenido(e,He.boton_acciones)})},l.id)),s.map(l=>n.jsx(dr,{content:l.nombre,variant:"default",size:"sm",placement:"top",children:n.jsx(Ye,{id:l.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>l.evento(e),className:He.boton_acciones,"data-testid":`tabla-accion-${l.id}`,children:l.icono})},l.id)),c.length>0&&n.jsx(dr,{content:"Más opciones",variant:"default",size:"sm",placement:"top",children:n.jsx("div",{style:{display:"inline-flex"},children:n.jsx(hn,{items:c,placement:"bottom-end",size:"md",children:n.jsx(Ye,{size:"sm",radius:"md",variant:"light",isIconOnly:!0,className:He.boton_acciones,"aria-label":"Más opciones","data-testid":"tabla-accion-mas-opciones",children:n.jsx(xh,{})})})})})]})}function Mh(e,t,r=3){const a=Math.floor(r/2);let o=e-a;o<1&&(o=1),o+r-1>t&&(o=Math.max(1,t-r+1));const s=Math.min(r,t);return Array.from({length:s},(i,c)=>o+c)}function Fh(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function Wr(e,t){const r=new Map;t.getFlatHeaders().forEach(i=>r.set(i.column.id,i));const a=r.get(e);if(a)return Hr(a.column.columnDef.header,a.getContext());const o=t.getAllLeafColumns().find(i=>i.id===e),s=o?.columnDef.header;return typeof s=="string"||typeof s=="number"?s:o?.id??e}function Ec(e,t){const r=e.getVisibleCells().find(a=>a.column.id===t);return r?Hr(r.column.columnDef.cell,r.getContext()):null}function Cc(e,t){return t?e.getVisibleCells().map(a=>a.column.id).includes(t):!1}function $h(e,t,r){return e.getVisibleCells().filter(a=>a.column.id!=="actions"&&a.column.id!==t&&a.column.id!==r)}function Oh(e,t){if(t===0)return"";if(t===1)return zo(e[0].nombre.toLowerCase());if(t===2)return`${zo(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const r=e.slice(0,2).map(o=>o.nombre.toLowerCase()),a=t-2;return`${zo(r.join(", "))} y ${a>1?`otros ${a}`:"otro"} más`}function zo(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Sc(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const Tc=_.createContext(null),Bo=Tc;function fa(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}function Dh({children:e,data:t,columns:r,controls:a,loading:o,primerasColumnas:s,tamanioPaginaInicial:i=10,filtros:c,descargarExcel:l,actualizarTabla:d,selectorFilas:h=[],sinDatosProps:g,maxColumnasVisibles:f=10,...u}){const[v,p]=_.useState(""),m=Df(v,200),w=ho("only screen and (max-width: 830px)"),[b,y]=_.useState({pageIndex:0,pageSize:i}),[E,S]=_.useState({}),C=_.useMemo(()=>{const z={},q=new Set;r.forEach(K=>{const Y="accessorKey"in K?String(K.accessorKey):K.id;Y&&K.meta?.isHidden&&(z[Y]=!1,q.add(Y))});let B=0;return r.forEach(K=>{const Y="accessorKey"in K?String(K.accessorKey):K.id;!Y||q.has(Y)||(B<f?B++:z[Y]=!1)}),z},[r,f]),[T,F]=_.useState(()=>C);_.useEffect(()=>{F(C)},[C]);const D=_.useMemo(()=>{const z=[];return h.length>0&&!w&&z.push({id:"select",header:({table:q})=>n.jsx(Ur,{color:"secondary",isSelected:q.getIsAllPageRowsSelected(),isIndeterminate:q.getIsSomePageRowsSelected()&&!q.getIsAllPageRowsSelected(),onChange:B=>q.toggleAllPageRowsSelected(!!B)}),cell:({row:q})=>n.jsx(Ur,{color:"primary",isSelected:q.getIsSelected(),isDisabled:!q.getCanSelect(),onChange:B=>q.toggleSelected(B)}),enableSorting:!1,enableHiding:!1}),z.push(...r),a?.length&&z.push({id:"actions",header:"Acciones",cell:q=>n.jsx(Ih,{fila:q.row.original,controls:a}),enableSorting:!1,enableHiding:!1}),z},[r,a,h.length,w]),M=_.useMemo(()=>{const z=D.map(B=>"accessorKey"in B&&B.accessorKey!=null?String(B.accessorKey):"id"in B&&B.id!=null?String(B.id):"").filter(Boolean),q=z.indexOf("actions");return q>-1&&q<z.length-1&&(z.splice(q,1),z.push("actions")),z},[D]),[U,V]=_.useState(()=>M);_.useEffect(()=>{V(z=>fa(z,M)?z:M)},[M]);const N=_.useCallback((z,q,B)=>{if(!B)return!0;const K=Sc(String(B)),Y=z.getValue(q);return Y==null?!1:Sc(String(Y)).includes(K)},[]),k=nh({data:t,columns:D,state:{pagination:b,globalFilter:m,columnOrder:U,rowSelection:E,columnVisibility:T},onColumnVisibilityChange:F,globalFilterFn:N,enableRowSelection:h.length>0,onRowSelectionChange:S,onPaginationChange:y,onColumnOrderChange:z=>{V(q=>{const B=typeof z=="function"?z(q):z;return fa(q,B)?q:B})},getCoreRowModel:G1(),getSortedRowModel:Q1(),getFilteredRowModel:Z1(),getPaginationRowModel:J1(),autoResetPageIndex:!1}),A=k.getPageCount();_.useEffect(()=>{const z=Fh(b.pageIndex,A);z!==b.pageIndex&&y(q=>({...q,pageIndex:z}))},[b.pageIndex,A]);const O=_.useRef(m);_.useEffect(()=>{O.current!==m&&y(q=>q.pageIndex===0?q:{...q,pageIndex:0}),O.current=m},[m]);const $=_.useMemo(()=>k.getAllLeafColumns().filter(z=>z.id!=="actions"&&z.id!=="select"&&z.getCanHide?.()),[k]),x=_.useCallback(z=>{const B=r.find(K=>"accessorKey"in K?String(K.accessorKey)===z:String(K.id)===z)?.header;return typeof B=="string"||typeof B=="number"?String(B):z},[r]),I=_.useCallback(()=>{F(C),k.setPageSize(i),k.setPageIndex(0),k.resetRowSelection(),V(z=>fa(z,M)?z:M)},[k,i,M,C]),L=_.useCallback(z=>{const q=Math.max(1,Math.min(200,z));k.setPageSize(q),k.setPageIndex(0)},[k]),X=_.useCallback(z=>{V(q=>{const B=typeof z=="function"?z(q):z;return fa(q,B)?q:B})},[]),H=_.useMemo(()=>({state:{ordenColumnas:U,table:k,columns:D,controls:a,loading:o,primerasColumnas:[String(s[0]),String(s[1])],inputBusqueda:v,setInputBusqueda:p,filtros:c,descargarExcel:l,actualizarTabla:d,selectorFilas:h,sinDatosProps:g,maxColumnasVisibles:f,...u},todasLasColumnas:$,etiquetaColumna:x,restaurarConfiguracion:I,cambiarPageSize:L,cambiarOrdenColumnas:X}),[U,k,D,a,o,v,c,s,l,d,h,g,f,u,$,x,I,L,X]);return n.jsx(Tc.Provider,{value:H,children:e})}function Lh(){const e=_.useContext(Bo);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function _r(){const e=_.useContext(Bo);return e||null}const Zt={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"},Ph=({titulo:e,onBack:t})=>n.jsxs("header",{className:Zt.header,children:[n.jsx(Ye,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:n.jsx(bc,{})}),n.jsx("h3",{className:Zt.titulo,children:e})]});function zh(e,t,r){const a=_.useRef(r);a.current=r;const o=_.useRef(e);o.current=e;const s=_.useCallback(i=>{const c=i.target;a.current.some(d=>d.current?.contains(c))||o.current()},[]);_.useEffect(()=>{if(!t)return;const i=setTimeout(()=>{document.addEventListener("mousedown",s)},100);return()=>{clearTimeout(i),document.removeEventListener("mousedown",s)}},[t,s])}function Ac(e,t){_.useEffect(()=>{if(!t)return;const r=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,e])}function Bh(e,t,r,{width:a,offsetRight:o=0,offsetLeft:s=0,offsetTop:i=0,offsetBottom:c=0,shiftPadding:l=8}){const[d,h]=_.useState({top:0,left:0}),g=ho("only screen and (max-width: 480px)"),f=_.useCallback(()=>{if(!e.current)return{top:0,left:0};const u=e.current.getBoundingClientRect(),v=l;let p=u.bottom+i,m=0;g?m=u.right-a-s+o:m=u.right-a+o-s;const w=t.current?.offsetHeight||400;p+w>window.innerHeight-v&&(p=u.top-w-c,p<v&&(p=v));const b=v,y=window.innerWidth-a-v;return m=Math.max(b,Math.min(m,y)),{top:p,left:m}},[g,a,o,s,i,c,l,e,t]);return _.useEffect(()=>{if(!r||!e.current)return;const u=()=>{h(f())};return u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,!0),()=>{window.removeEventListener("resize",u),window.removeEventListener("scroll",u,!0)}},[r,f,e]),d}function Vh(e){_.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function jh(){const[e,t]=_.useState(!1),[r,a]=_.useState(!1),[o,s]=_.useState("panelPrincipal"),[i,c]=_.useState(null),l=_.useRef(null),d=_.useRef(null),h=_.useRef(null);Vh(r),zh(()=>f(),r,[l,d]),Ac(()=>f(),r);const g=Bh(l,d,r,{width:yc,offsetRight:6,offsetTop:-2,shiftPadding:8});_.useEffect(()=>{e&&(a(!0),c(null))},[e]),_.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);function f(){r&&(t(!1),h.current=window.setTimeout(()=>{a(!1),s("panelPrincipal"),c(null)},Th))}function u(m){c(m==="panelPrincipal"?"backward":"forward"),s(m)}const v=Ah[o],p=v.component;return n.jsxs("div",{ref:l,className:Zt.contenedor,children:[n.jsx(Ye,{isIconOnly:!0,variant:"light",onClick:()=>r?f():t(!0),"aria-haspopup":"dialog","aria-expanded":r,"aria-label":"Configurar tabla",children:n.jsx(fh,{})}),r&&l.current&&Kr.createPortal(n.jsx("div",{ref:d,className:`${Zt.popover} ${e?Zt.popover_entrada:Zt.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:yc},children:n.jsx("div",{className:Zt.ventana,children:n.jsxs("div",{className:ne([Zt.panel,Zt[`panel_${i}`]]),children:[v.titulo&&n.jsx(Ph,{titulo:v.titulo,onBack:()=>u("panelPrincipal")}),n.jsx(p,{navegar:u})]},o)})}),document.body)]})}function Hh(){const e=_r();if(!e)return null;const{state:t}=e,{inputBusqueda:r,setInputBusqueda:a,loading:o,filtros:s,actualizarTabla:i,descargarExcel:c,paginacion:l}=t,{abrirFiltros:d,filtrosAplicados:h=[]}=s||{},g=h?.length||0;return n.jsxs("section",{className:He.contenedor_superior,children:[n.jsxs("div",{className:He.input_con_icono,id:"buscador-tabla",children:[n.jsx(ch,{className:He.icono_busqueda}),n.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:r??"",onChange:f=>a&&a(f.target.value),className:He.input_busqueda})]}),n.jsxs("div",{className:He.contenedor_acciones_botones,children:[n.jsxs("div",{className:He.contenedor_acciones,children:[l?.hayMasDatos&&n.jsxs(Ye,{id:"cargar-mas-datos",variant:"light",className:He.boton_basico,disabled:o,onClick:l.onCargarMasDatos,children:[n.jsx(wh,{}),o?"Actualizando...":"Más datos"]}),d!==void 0&&n.jsxs(Ye,{id:"boton-filtros",onClick:d,variant:"light",className:He.boton_basico,children:[n.jsx(dh,{})," Filtros"]}),g>0?n.jsxs("div",{className:He.texto_filtros,id:"filtros-aplicados",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.4em",height:"1.4em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M6 12h12m-9 6h2m4 0l2 2l4-4"})}),n.jsx("p",{children:Oh(h,g)})]}):null]}),c!==void 0?n.jsxs(Ye,{onClick:c,color:"success",variant:"faded",children:[n.jsx(lh,{})," Excel"]}):null]}),n.jsxs("div",{className:He.contenedor_acciones,children:[i!==void 0&&n.jsx(dr,{content:"Actualiza los últimos datos guardados",children:n.jsx(Ye,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:He.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:n.jsx(uh,{})})}),n.jsx("div",{className:He.menu_configuraciones,id:"configuraciones-tabla",children:n.jsx(jh,{})})]})]})}const Ut={contenedor_paginacion:"_contenedor_paginacion_mu230_1",info_paginacion:"_info_paginacion_mu230_23",contenedor_botones:"_contenedor_botones_mu230_39",boton_paginacion:"_boton_paginacion_mu230_97",pagina_activa:"_pagina_activa_mu230_143",boton_num_paginacion:"_boton_num_paginacion_mu230_155"};function Uh(){const e=_r();if(!e)return null;const{state:t}=e,{table:r}=t,a=r.getPrePaginationRowModel().rows.length,o=r.getPageCount()||1,{pageIndex:s}=r.getState().pagination,i=s+1,c=Mh(i,o),l=r.getCanPreviousPage(),d=r.getCanNextPage(),h=o>1,g=s===0,f=s===o-1,u=()=>{l&&r.previousPage()},v=()=>{d&&r.nextPage()},p=b=>{r.setPageIndex(b-1)},m=()=>{g||r.firstPage()},w=()=>{f||r.lastPage()};return n.jsxs("section",{className:Ut.contenedor_paginacion,id:"paginacion-tabla",children:[n.jsxs("p",{className:Ut.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",a]}),h&&n.jsxs("div",{className:Ut.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&n.jsx(yh,{id:"paginacion-flecha-inicio",onClick:m,"aria-label":"Ir a la primera página","aria-disabled":g,className:Ut.boton_paginacion}),l&&n.jsx(bc,{id:"paginacion-flecha-izq",onClick:u,"aria-disabled":!l,className:Ut.boton_paginacion}),n.jsx("div",{id:"paginacion-numero-pag",children:c.map(b=>n.jsx("button",{type:"button",onClick:()=>p(b),"aria-current":b===i?"page":void 0,className:b===i?Ut.pagina_activa:Ut.boton_num_paginacion,children:b},b))}),d&&n.jsx(wc,{id:"paginacion-flecha-der",onClick:v,"aria-disabled":!d,className:Ut.boton_paginacion}),!f&&n.jsx(kh,{id:"paginacion-flecha-fin",onClick:w,"aria-label":"Ir a la última página","aria-disabled":f,className:Ut.boton_paginacion})]}),n.jsxs("p",{className:Ut.info_paginacion,id:"paginacion-total-pags",children:["Página ",i," de ",o]})]})}const ze={contenedor_tabla_cards:"_contenedor_tabla_cards_1ltc4_1",contenedor_card:"_contenedor_card_1ltc4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1ltc4_25",contenedor_columna_card:"_contenedor_columna_card_1ltc4_47",card_label:"_card_label_1ltc4_57",card_valor:"_card_valor_1ltc4_69",card_segundo_valor:"_card_segundo_valor_1ltc4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1ltc4_93",contenedor_fila_card:"_contenedor_fila_card_1ltc4_105",card_fila_label:"_card_fila_label_1ltc4_119",card_fila_valor:"_card_fila_valor_1ltc4_137",contenedor_acciones_card:"_contenedor_acciones_card_1ltc4_157",boton_acciones:"_boton_acciones_1ltc4_175",boton_card:"_boton_card_1ltc4_211",boton_personalizado:"_boton_personalizado_1ltc4_241"};function Nc(e,t){if(t)return e.find(r=>r.accessorKey===t||r.id!==void 0&&r.id===String(t))}function Ic(e){if(e)return e.id??e.accessorKey}const Jt={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function Wh({filas:e,cantidadControles:t=0,table:r,idPrimeraColumna:a,idSegundaColumna:o}){const i=r.getAllLeafColumns().filter(l=>l.id!=="actions"&&l.id!==a&&l.id!==o),c=["25vw","30vw","20vw","28vw","22vw","26vw"];return n.jsx("section",{className:ze.contenedor_tabla_cards,children:Array.from({length:e}).map((l,d)=>n.jsxs("article",{className:ze.contenedor_card,children:[n.jsxs("div",{className:ze.contenedor_encabezado_card,children:[n.jsx("div",{className:ze.contenedor_columna_card,children:a&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ze.card_label,children:Wr(a,r)}),n.jsx("div",{className:ze.card_valor,children:n.jsx("div",{className:`${Jt.skeleton_elemento} ${Jt.skeleton_elemento_encabezado}`})})]})}),n.jsx("div",{className:ze.contenedor_columna_card,children:o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ze.card_label,children:Wr(o,r)}),n.jsx("div",{className:ze.card_segundo_valor,children:n.jsx("div",{className:`${Jt.skeleton_elemento} ${Jt.skeleton_elemento_encabezado_segundo}`})})]})})]}),n.jsx("div",{className:ze.contenedor_contenido_cards,children:i.map((h,g)=>n.jsxs("div",{className:ze.contenedor_fila_card,children:[n.jsx("div",{className:ze.card_fila_label,children:Wr(h.id,r)}),n.jsx("div",{className:ze.card_fila_valor,children:n.jsx("div",{className:`${Jt.skeleton_elemento} ${Jt.skeleton_elemento_contenido}`,style:{width:c[g%c.length]}})})]},h.id))}),t>0&&n.jsx("div",{className:ze.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((h,g)=>n.jsx("div",{className:Jt.skeleton_accion,children:n.jsx("div",{className:`${Jt.skeleton_elemento} ${Jt.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${d}`))})}const Tr={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function Mc(){const e=_.useContext(Bo),{sinDatosProps:t}=e?.state||{},{botonAccion:r,titulo:a="No se encontraron coincidencias",descripcion:o='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return n.jsxs("div",{className:Tr.contenedor,children:[n.jsx(qh,{}),n.jsxs("div",{className:Tr.envolvedor_contenido,children:[n.jsx(Gh,{}),n.jsx("h3",{className:Tr.titulo,children:a}),n.jsx("p",{className:Tr.descripcion,children:o}),r]})]})}function qh(){return n.jsx("div",{className:Tr.envolvedor_cuadricula,children:n.jsxs("svg",{className:Tr.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:n.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),n.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Gh(){return n.jsxs("svg",{className:Tr.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),n.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),n.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),n.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),n.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),n.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),n.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Rh=({fila:e,controls:t})=>(t?.length??0)>0?n.jsx("div",{className:ze.contenedor_acciones_card,children:t?.filter(a=>!a.visible||a.visible(e.original)).map(a=>"contenido"in a?n.jsxs("span",{className:`${ze.boton_personalizado} ${ze.boton_acciones} ${ze.boton_card}`,onClick:o=>{const s=o.currentTarget.querySelector("button");s&&!s.contains(o.target)&&s.click()},children:[a.contenido(e.original)," ",a.nombre]},a.id):n.jsxs("button",{id:a.id,type:"button",title:a.nombre,onClick:()=>a.evento(e.original),className:`${ze.boton_acciones} ${ze.boton_card}`,children:[a.icono," ",a.nombre]},a.id))}):null,Xh=({columnasRestantes:e,table:t})=>e.length===0?null:n.jsx("div",{className:ze.contenedor_contenido_cards,children:e.map(r=>n.jsxs("div",{className:ze.contenedor_fila_card,children:[n.jsx("div",{className:ze.card_fila_label,children:Wr(r.column.id,t)}),n.jsx("div",{className:ze.card_fila_valor,children:Hr(r.column.columnDef.cell,r.getContext())})]},r.id))}),Kh=({fila:e,table:t,idPrimeraColumna:r,idSegundaColumna:a})=>{const o=Cc(e,r),s=Cc(e,a);return n.jsxs("div",{className:ze.contenedor_encabezado_card,children:[n.jsx("div",{className:ze.contenedor_columna_card,children:r&&o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ze.card_label,children:Wr(r,t)}),n.jsx("div",{className:ze.card_valor,children:Ec(e,r)})]})}),n.jsx("div",{className:ze.contenedor_columna_card,children:a&&s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ze.card_label,children:Wr(a,t)}),n.jsx("div",{className:ze.card_segundo_valor,children:Ec(e,a)})]})})]})};function Yh(){const e=_r();if(!e)return null;const{state:t}=e,{table:r,controls:a,primerasColumnas:o,loading:s,columns:i}=t;if(!r)return null;const c=i&&o?Nc(i,o[0]):void 0,l=i&&o?Nc(i,o[1]):void 0,d=Ic(c),h=Ic(l);if(s)return n.jsx(Wh,{filas:3,cantidadControles:a?.length??0,table:r,idPrimeraColumna:d,idSegundaColumna:h});const g=r.getRowModel().rows;return g.length===0?n.jsx("article",{className:ze.contenedor_card,children:n.jsx(Mc,{})}):n.jsx("section",{className:ze.contenedor_tabla_cards,children:g.map(f=>{const u=$h(f,d,h);return n.jsxs("article",{id:`tabla-card-${f.id}`,className:ze.contenedor_card,children:[n.jsx(Kh,{fila:f,table:r,idPrimeraColumna:d,idSegundaColumna:h}),n.jsx(Xh,{columnasRestantes:u,table:r}),n.jsx(Rh,{fila:f,controls:a})]},f.id)})})}const Fc={filas:"_filas_17736_1",columnas:"_columnas_17736_33"},Zh=({columnas:e,filas:t})=>n.jsx(n.Fragment,{children:Array.from({length:t}).map((r,a)=>n.jsx("tr",{className:Fc.filas,children:Array.from({length:e}).map((o,s)=>n.jsx("td",{className:Fc.columnas},`sk-cell-${a}-${s}`))},`sk-row-${a}`))}),Ar={contenedor:"_contenedor_5uhpi_1",barra:"_barra_5uhpi_21",info:"_info_5uhpi_49",btn_cerrar:"_btn_cerrar_5uhpi_63",contador:"_contador_5uhpi_79",separador:"_separador_5uhpi_97",acciones:"_acciones_5uhpi_111"};function Jh({totalSeleccionadas:e,acciones:t,filasSeleccionadas:r,onLimpiarSeleccion:a}){const[o,s]=_.useState(0),[i,c]=_.useState([]),[l,d]=_.useState([]),h=e>0,g=_.useRef(null);return Ac(a,h),_.useEffect(()=>{h&&(s(e),c(t),d(r))},[e,t,r,h]),n.jsx(xn,{mostrar:h,tipo:"escalar",className:Ar.contenedor,children:n.jsxs("div",{ref:g,className:Ar.barra,children:[n.jsxs("div",{className:Ar.info,children:[n.jsx(Ye,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:a,"aria-label":"Limpiar selección",className:Ar.btn_cerrar,children:n.jsx(bh,{})}),n.jsxs("p",{className:Ar.contador,children:[o," filas seleccionadas"]})]}),n.jsx("div",{className:Ar.separador}),n.jsx("div",{className:Ar.acciones,children:i.map(f=>n.jsx("div",{children:f.componente(l)},f.id))})]})})}function Qh({dir:e}){return e?e==="asc"?n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:He.icono_orden,"aria-hidden":"true",children:n.jsx("path",{fill:"currentColor",d:"m12 10.8l-4.6 4.6L6 14l6-6l6 6l-1.4 1.4z"})}):n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:He.icono_orden,"aria-hidden":"true",children:n.jsx("path",{fill:"currentColor",d:"M12 13.2L7.4 8.6L6 10l6 6l6-6l-1.4-1.4z"})}):null}function e0(){const e=_r();if(!e)return null;const{state:t}=e,{table:r,loading:a,selectorFilas:o=[]}=t;if(!r)return null;const s=r.getHeaderGroups(),i=r.getRowModel().rows,c=r.getVisibleLeafColumns().length,l=r.getState().pagination.pageIndex,d=r.getSelectedRowModel().rows,h=d.length,g=()=>{r.resetRowSelection()};return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:He.wrapper_scroll_tabla,children:n.jsxs("table",{className:He.contenedor_tabla,children:[n.jsx("thead",{children:s.map(f=>n.jsx("tr",{children:f.headers.map(u=>{const v=u.column.columnDef.meta?.style;return n.jsx("th",{id:`tabla-col-${u.id}`,className:He.encabezados,style:v,"data-columna":u.id,children:u.id==="select"?n.jsx("div",{children:Hr(u.column.columnDef.header,u.getContext())}):n.jsxs("div",{className:He.contenido_encabezado,style:{justifyContent:v?.textAlign==="center"?"center":v?.textAlign==="right"?"flex-end":void 0},onClick:u.column.getToggleSortingHandler(),children:[Hr(u.column.columnDef.header,u.getContext()),n.jsx(Qh,{dir:u.column.getIsSorted()})]})},u.id)})},f.id))}),n.jsx("tbody",{className:He.contenedor_datos,children:a?n.jsx(Zh,{columnas:c,filas:7}):i.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:c,style:{backgroundColor:"var(--base)"},children:n.jsx(Mc,{})})}):i.map(f=>n.jsx("tr",{id:`tabla-fila-${f.id}`,className:`${He.datos} ${f.getIsSelected()?He.seleccionada:""}`,"data-fila-index":f.index,children:f.getVisibleCells().map(u=>{const v=u.column.columnDef.meta?.style;return n.jsx("td",{className:He.columna,style:v,"data-columna":u.column.id,children:Hr(u.column.columnDef.cell,u.getContext())},u.id)})},f.id))},l)]})}),o?.length>0?n.jsx(Jh,{totalSeleccionadas:h,acciones:o,filasSeleccionadas:d.map(f=>f.original),onLimpiarSeleccion:g}):null]})}const t0=830;function r0({id:e}){const t=_.useRef(null),[r,a]=_.useState(!1);return _.useEffect(()=>{const o=t.current;if(!o)return;const s=new ResizeObserver(([i])=>{a(i.contentRect.width<=t0)});return s.observe(o),()=>s.disconnect()},[]),n.jsxs("main",{className:He.contenedor,id:e,ref:t,children:[n.jsx(Hh,{}),n.jsxs("div",{className:He.tabla_card,children:[r?n.jsx(Yh,{}):n.jsx(e0,{}),n.jsx(Uh,{})]})]})}function n0({id:e,...t}){return n.jsx(Dh,{...t,children:n.jsx(r0,{id:e})})}const Ue={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},$c=_.createContext(void 0),a0=()=>_.useContext($c),Vo=_.memo(_.forwardRef(({value:e,label:t,description:r,size:a="md",color:o="primary",customColor:s,variant:i="default",isDisabled:c=!1,isReadOnly:l=!1,isInvalid:d=!1,isRequired:h=!1,children:g,className:f="",onChange:u,...v},p)=>{const m=a0(),w=_.useId(),b=v.id||w,y=m?.name||v.name,E=m?.size||a,S=m?.color||o,C=m?.customColor||s,T=m?.variant||i,F=m?.isDisabled||c,D=m?.isReadOnly||l,M=m?.isInvalid||d,U=m?.isRequired||h,V=m?.value!==void 0?m.value===e:void 0,N=r?`${b}-desc`:void 0,k=g||t,A=x=>{F||D||(m?.onChange&&m.onChange(e),u&&u(x))},O=[Ue.contenedor_radio,Ue[`tam_${E}`],!C&&Ue[`color_${S}`],Ue[`variante_${T}`],F&&Ue.deshabilitado,D&&Ue.solo_lectura,M&&Ue.invalido,V&&Ue.seleccionado,f].filter(Boolean).join(" "),$=C?{"--radio-custom-color":C}:void 0;return n.jsx("div",{className:O,style:$,children:n.jsxs("label",{className:Ue.envoltorio_radio,htmlFor:b,children:[n.jsxs("div",{className:Ue.radio,children:[n.jsx("input",{"data-testid":y?`radio-${y}${e?`-${e}`:""}`:b,...v,ref:p,type:"radio",id:b,name:y,value:e,checked:V,disabled:F,readOnly:D,required:U,"aria-invalid":M,"aria-required":U||void 0,"aria-describedby":N,className:Ue.input,onChange:A}),n.jsx("div",{className:Ue.circulo_radio,children:n.jsx("div",{className:Ue.punto_radio})})]})," ",k&&n.jsxs("div",{className:Ue.contenedor_label,children:[n.jsxs("span",{className:Ue.texto_label,children:[k,h&&!m&&n.jsx("span",{className:Ue.marca_requerido,children:" *"})]}),r&&n.jsx("span",{id:N,className:Ue.texto_descripcion,children:r})]})]})})}));Vo.displayName="Radio";const Oc=({name:e,value:t,defaultValue:r,onChange:a,orientation:o="horizontal",label:s,description:i,isDisabled:c=!1,isReadOnly:l=!1,isRequired:d=!1,isInvalid:h=!1,errorMessage:g,size:f,color:u,customColor:v,variant:p,justifyContent:m="flex-start",children:w,className:b="",options:y,optionValueKey:E,optionLabelKey:S,optionDisabledKey:C,optionDescriptionKey:T,id:F,"data-testid":D})=>{const[M,U]=_.useState(String(r??"")),V=_.useId(),N=F??`radio-group-${V}`,k=e??N,A=s?`${N}-label`:void 0,O=s&&i?`${N}-desc`:void 0,$=h&&g?`${N}-err`:void 0,x=[O,$].filter(Boolean).join(" ")||void 0,I=t!==void 0?String(t):M,X={name:k,value:I,onChange:q=>{c||l||(t===void 0&&U(q),a&&a(q))},size:f,color:u,customColor:v,variant:p,isDisabled:c,isReadOnly:l,isInvalid:h,isRequired:d},H=[Ue.grupo_radio,Ue[`orientacion_${o}`],h&&Ue.grupo_invalido,c&&Ue.grupo_deshabilitado,l&&Ue.grupo_solo_lectura,b].filter(Boolean).join(" "),z=m==="center"?"center":m==="flex-end"?"right":"left";return n.jsx($c.Provider,{value:X,children:n.jsxs("div",{id:N,className:H,role:"radiogroup","aria-required":d,"aria-invalid":h,"aria-labelledby":A,"aria-describedby":x,"data-testid":D??(e?`radio-group-${e}`:N),style:{textAlign:z},children:[s&&n.jsxs("div",{className:Ue.encabezado_grupo,children:[n.jsxs("span",{id:A,className:Ue.label_grupo,children:[s,d&&n.jsx("span",{className:Ue.marca_requerido,children:" *"})]}),i&&n.jsx("span",{id:O,className:Ue.descripcion_grupo,children:i})]}),n.jsx("div",{className:Ue.contenedor_radios,style:{justifyContent:m},children:y&&y.length>0?y.map((q,B)=>{let K,Y,Q=!1,ee;if(typeof q=="object"&&q!==null){const se=E??"value",ce=S??"label",ae=C??"isDisabled",de=T??"description",oe=q[se],fe=q[ce];K=String(oe!==void 0?oe:B),Y=fe;const pe=q[ae];Q=typeof pe=="boolean"?pe:!1;const te=q[de];ee=typeof te=="string"?te:void 0}else K=String(q),Y=q;return n.jsx(Vo,{value:K,isDisabled:Q,description:ee,children:Y},K)}):w}),h&&g&&n.jsx("span",{id:$,className:Ue.mensaje_error,role:"alert",children:g})]})})};Oc.displayName="RadioGroup";const Qt=(e,t,r)=>Math.min(r,Math.max(t,e)),Dc=e=>String(e).split(".")[1]?.length??0,o0=(e,t,r,a)=>{if(a<=0)return Qt(e,t,r);const o=Math.round((e-t)/a)*a+t,s=Math.max(Dc(a),Dc(t));return Qt(Number(o.toFixed(s)),t,r)},s0=(e,t)=>t.length?t.reduce((r,a)=>Math.abs(a.value-e)<Math.abs(r.value-e)?a:r).value:e,Lc=(e,t,r,a,o,s,i=t,c=r)=>Qt(s&&o.length?s0(e,o):o0(e,t,r,a),i,c),qr=(e,t,r,a=!1)=>{if(r===t)return 0;const o=Qt((e-t)/(r-t)*100,0,100);return a?100-o:o},i0=(e,t,r)=>{if(r<=0)return[];const a=Math.floor((t-e)/r);return a>100?[]:Array.from({length:a+1},(o,s)=>e+s*r)},c0=(e,t,r)=>{try{return new Intl.NumberFormat(t,r).format(e)}catch{return String(e)}},Pc=e=>Array.isArray(e)?[...e]:[e],l0=({value:e,defaultValue:t,onChange:r,onChangeEnd:a,min:o,max:s,step:i,marks:c,restrictToMarks:l,minStepsBetweenThumbs:d,orientation:h,enableWheel:g,draggableTrack:f,reverse:u,clampMin:v,clampMax:p,hapticFeedback:m,isDisabled:w,isReadOnly:b})=>{const y=Array.isArray(e??t),E=e!==void 0,S=v!=null?Math.max(o,v):o,C=p!=null?Math.min(s,p):s,[T,F]=_.useState(()=>Pc(t).map(J=>Lc(J,o,s,i,c,l,S,C))),[D,M]=_.useState(null),[U,V]=_.useState(null),[N,k]=_.useState(null),[A,O]=_.useState(!1),[$,x]=_.useState(null),I=_.useRef(null),L=_.useRef(null),X=_.useRef(T),H=_.useRef(null),z=_.useRef(null),q=_.useCallback(()=>{!m||typeof navigator>"u"||!("vibrate"in navigator)||navigator.vibrate(1)},[m]),B=_.useCallback(J=>{const P=I.current;if(P)try{P.setPointerCapture(J),z.current=J}catch{}},[]),K=_.useCallback(()=>{const J=I.current,P=z.current;if(J&&P!=null)try{J.releasePointerCapture(P)}catch{}z.current=null},[]),Y=_.useRef(!1);_.useEffect(()=>{const J=G=>{G.key==="Tab"&&(Y.current=!0)},P=()=>{Y.current=!1};return window.addEventListener("keydown",J,!0),window.addEventListener("pointerdown",P,!0),()=>{window.removeEventListener("keydown",J,!0),window.removeEventListener("pointerdown",P,!0)}},[]);const Q=E?Pc(e):T;X.current=Q;const ee=w||b,se=_.useCallback(J=>Lc(J,o,s,i,c,l,S,C),[c,s,C,o,S,l,i]),ce=_.useCallback((J,P)=>{const G=J.length>1?[J[0],J[1]]:J[0];E||F(J),X.current=J,r?.(G),P&&a?.(G)},[E,r,a]),ae=_.useCallback((J,P,G=!1)=>{const W=X.current,re=d*i;let le=se(P);W.length>1&&(le=J===0?Math.min(le,W[1]-re):Math.max(le,W[0]+re),le=Qt(le,o,s));const he=W.map((Ne,Ie)=>Ie===J?le:Ne),Ce=he.every((Ne,Ie)=>Ne===W[Ie]);Ce&&!G||(Ce||q(),ce(he,G))},[ce,s,o,d,se,i,q]),de=_.useCallback((J,P)=>{const G=L.current;if(!G)return 0;const W=G.getBoundingClientRect(),re=h==="vertical"?(W.bottom-P)/(W.height||1):(J-W.left)/(W.width||1);return Qt(re,0,1)},[h]),oe=_.useCallback((J,P)=>{const G=de(J,P),W=u?1-G:G;return se(o+W*(s-o))},[s,o,se,de,u]),fe=_.useCallback(J=>{const P=X.current;if(P.length===1)return 0;const G=P.map(W=>Math.abs(W-J));return G[0]===G[1]?J<P[0]?0:1:G[0]<=G[1]?0:1},[]),pe=_.useCallback(J=>{if(ee||J.button!==0)return;J.preventDefault();const P=J.target.closest("[data-indice]"),G=oe(J.clientX,J.clientY);if(B(J.pointerId),f&&!P&&X.current.length>1){const[le,he]=X.current;if(G>Math.min(le,he)&&G<Math.max(le,he)){H.current={inicio:G,base:[le,he]},O(!0),M(null);return}}const W=P?Number(P.dataset.indice):fe(G);M(W),V(W),k(null),y||x(de(J.clientX,J.clientY)*100),P||ae(W,G),(P??L.current?.querySelector(`[data-indice="${W}"]`))?.focus({preventScroll:!0})},[ae,ee,B,f,y,de,fe,oe]);_.useEffect(()=>{if(!A)return;const J=W=>re=>{const le=H.current;if(!le)return;re.preventDefault();const[he,Ce]=le.base,Ne=Math.min(he,Ce),Ie=Math.max(he,Ce);let Ee=oe(re.clientX,re.clientY)-le.inicio;i>0&&(Ee=Math.round(Ee/i)*i),Ee=Qt(Ee,S-Ne,C-Ie),ce([he+Ee,Ce+Ee],W)},P=J(!1),G=W=>{J(!0)(W),H.current=null,O(!1),K()};return window.addEventListener("pointermove",P,{passive:!1}),window.addEventListener("pointerup",G),window.addEventListener("pointercancel",G),()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",G),window.removeEventListener("pointercancel",G)}},[A,ce,K,C,S,i,oe]),_.useEffect(()=>{if(D===null)return;const J=G=>{G.preventDefault(),y||x(de(G.clientX,G.clientY)*100),ae(D,oe(G.clientX,G.clientY))},P=()=>{ae(D,X.current[D],!0),M(null),x(null),K()};return window.addEventListener("pointermove",J,{passive:!1}),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P),()=>{window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)}},[ae,y,D,K,de,oe]),_.useEffect(()=>{const J=I.current;if(!J||!g||ee)return;let P=0,G;const W=re=>{const le=re.deltaY||re.deltaX;if(le===0)return;const he=U??fe(oe(re.clientX,re.clientY)),Ce=X.current[he],Ne=le>0?-1:1;if(se(Ce+Ne*i)===Ce)return;re.preventDefault(),P+=Ne*Math.min(Math.abs(le)/40,3);const Ie=Math.trunc(P);Ie!==0&&(P-=Ie,ae(he,X.current[he]+Ie*i)),clearTimeout(G),G=setTimeout(()=>{P=0,ae(he,X.current[he],!0)},140)};return J.addEventListener("wheel",W,{passive:!1}),()=>{clearTimeout(G),J.removeEventListener("wheel",W)}},[ae,ee,g,U,se,fe,i,oe]);const te=_.useCallback((J,P)=>{if(ee)return;const G=X.current[J],W=i*10,re=c.findIndex(Ie=>Ie.value===G),le=l&&c.length>0,he=Ie=>le?c[Qt(re+Ie,0,c.length-1)]?.value??G:G+Ie*i,Ce=u?-1:1;let Ne=null;switch(P.key){case"ArrowRight":case"ArrowUp":Ne=he(Ce);break;case"ArrowLeft":case"ArrowDown":Ne=he(-Ce);break;case"PageUp":Ne=le?he(1):G+W;break;case"PageDown":Ne=le?he(-1):G-W;break;case"Home":Ne=le?c[0].value:S;break;case"End":Ne=le?c[c.length-1].value:C;break;default:return}P.preventDefault(),ae(J,Ne,!0)},[ae,ee,c,C,S,l,u,i]),ue=_.useCallback(J=>{V(J),k(Y.current?J:null)},[]),ge=_.useCallback(()=>{V(null),k(null)},[]),ve=_.useCallback(J=>{ee||ae(fe(J),J,!0)},[ae,ee,fe]);return{valores:Q,esRango:y,arrastrandoPista:A,arrastreRaw:$,zonaRef:I,pistaRef:L,indiceActivo:D,indiceEnfocado:U,indiceConAnillo:N,manejarFoco:ue,manejarBlur:ge,manejarPointerDown:pe,manejarTeclado:te,seleccionarValor:ve}},Gr={numero:"_numero_1y6xv_1",simbolo:"_simbolo_1y6xv_21",digito:"_digito_1y6xv_33",columna:"_columna_1y6xv_49",cifra:"_cifra_1y6xv_65",estatico:"_estatico_1y6xv_77"},d0=["0","1","2","3","4","5","6","7","8","9"],jo=_.memo(({texto:e,estatico:t=!1,className:r})=>{const a=[...e];return n.jsx("span",{className:ne(Gr.numero,t&&Gr.estatico,r),"aria-label":e,children:a.map((o,s)=>{const i=o>="0"&&o<="9",c=`${a.length-s}-${i?"d":o}`;return i?n.jsx("span",{className:Gr.digito,"aria-hidden":"true",children:n.jsx("span",{className:Gr.columna,style:{"--cifra":Number(o)},children:d0.map(l=>n.jsx("span",{className:Gr.cifra,children:l},l))})},c):n.jsx("span",{className:Gr.simbolo,"aria-hidden":"true",children:o},c)})})});jo.displayName="NumeroAnimado";const we={contenedor:"_contenedor_vkqt5_1",encabezado:"_encabezado_vkqt5_49",etiqueta:"_etiqueta_vkqt5_65",valor:"_valor_vkqt5_101",descripcion:"_descripcion_vkqt5_121",mensaje_error:"_mensaje_error_vkqt5_131",fila:"_fila_vkqt5_141",contenido_lateral:"_contenido_lateral_vkqt5_157",valor_final:"_valor_final_vkqt5_185",zona_pista:"_zona_pista_vkqt5_221",arrastrando:"_arrastrando_vkqt5_243",pista:"_pista_vkqt5_251",capa:"_capa_vkqt5_267",relleno:"_relleno_vkqt5_277",pista_arrastrable:"_pista_arrastrable_vkqt5_305",arrastrando_pista:"_arrastrando_pista_vkqt5_313",pulgar:"_pulgar_vkqt5_321",pulgar_activo:"_pulgar_activo_vkqt5_407",con_borde:"_con_borde_vkqt5_443",punto_pulgar:"_punto_pulgar_vkqt5_451",solo_lectura:"_solo_lectura_vkqt5_499",pulgar_circle:"_pulgar_circle_vkqt5_515",pulgar_ring:"_pulgar_ring_vkqt5_517",pulgar_bar:"_pulgar_bar_vkqt5_519",tooltip:"_tooltip_vkqt5_577",aparecerTooltip:"_aparecerTooltip_vkqt5_1",capa_pasos:"_capa_pasos_vkqt5_649",capa_marcas:"_capa_marcas_vkqt5_651",capa_lineas:"_capa_lineas_vkqt5_653",marca_linea:"_marca_linea_vkqt5_665",marca_linea_activa:"_marca_linea_activa_vkqt5_687",capa_segmentos:"_capa_segmentos_vkqt5_695",segmento:"_segmento_vkqt5_707",orientacion_vertical:"_orientacion_vertical_vkqt5_725",capa_histograma:"_capa_histograma_vkqt5_739",barra_histograma:"_barra_histograma_vkqt5_763",capa_histograma_reverse:"_capa_histograma_reverse_vkqt5_785",barra_histograma_activa:"_barra_histograma_activa_vkqt5_793",con_histograma:"_con_histograma_vkqt5_801",paso:"_paso_vkqt5_817",paso_activo:"_paso_activo_vkqt5_841",marca:"_marca_vkqt5_665",marca_activa:"_marca_activa_vkqt5_897",con_marcas:"_con_marcas_vkqt5_907",tam_sm:"_tam_sm_vkqt5_915",tam_lg:"_tam_lg_vkqt5_943",color_primary:"_color_primary_vkqt5_973",color_secondary:"_color_secondary_vkqt5_981",color_success:"_color_success_vkqt5_989",color_warning:"_color_warning_vkqt5_997",color_danger:"_color_danger_vkqt5_1005",color_foreground:"_color_foreground_vkqt5_1013",variante_bordered:"_variante_bordered_vkqt5_1021",variante_flat:"_variante_flat_vkqt5_1031",variante_none:"_variante_none_vkqt5_1047",radio_none:"_radio_none_vkqt5_1055",radio_sm:"_radio_sm_vkqt5_1065",radio_md:"_radio_md_vkqt5_1075",radio_lg:"_radio_lg_vkqt5_1085",radio_full:"_radio_full_vkqt5_1095",label_bottom:"_label_bottom_vkqt5_1105",deshabilitado:"_deshabilitado_vkqt5_1345",invalido:"_invalido_vkqt5_1367",sin_pulgar:"_sin_pulgar_vkqt5_1375",sin_escala:"_sin_escala_vkqt5_1391",sin_animacion:"_sin_animacion_vkqt5_1423"},u0=({histogram:e,min:t,max:r,reverse:a,estaActiva:o,clases:s})=>{const i=Math.max(...e,1),c=(r-t)/e.length;return n.jsx("div",{className:ne(we.capa_histograma,a&&we.capa_histograma_reverse,s),"aria-hidden":"true",children:e.map((l,d)=>{const h=o(t+(d+.5)*c);return n.jsx("span",{className:ne(we.barra_histograma,h&&we.barra_histograma_activa),style:{"--h":`${Math.max(l/i*100,6)}%`}},`barra-${d}`)})})},f0=({marks:e,pasos:t,min:r,max:a,reverse:o,mostrarLineas:s,estaActiva:i,onSeleccionar:c,interactivo:l,clasesMarca:d,clasesPaso:h})=>{const g=f=>({"--posicion":`${qr(f,r,a,o)}%`});return n.jsxs(n.Fragment,{children:[s&&e.length>0&&n.jsx("div",{className:we.capa_lineas,"aria-hidden":"true",children:e.map(f=>n.jsx("span",{className:ne(we.marca_linea,i(f.value)&&we.marca_linea_activa),style:g(f.value)},`linea-${f.value}`))}),t.length>0&&n.jsx("div",{className:we.capa_pasos,"aria-hidden":"true",children:t.map(f=>n.jsx("span",{className:ne(we.paso,i(f)&&we.paso_activo,h),style:g(f)},`paso-${f}`))}),e.length>0&&n.jsx("div",{className:we.capa_marcas,children:e.map(f=>{const u=i(f.value),v={className:ne(we.marca,u&&we.marca_activa,d,f.className),style:{...g(f.value),...f.style},children:f.label};return l?n.jsx("button",{type:"button",onClick:()=>c(f.value),tabIndex:-1,"data-testid":`slider-marca-${f.value}`,"aria-label":`Ir al valor ${f.value}`,...v},`marca-${f.value}`):n.jsx("span",{...v},`marca-${f.value}`)})})]})},h0=({valor:e,porcentaje:t,indice:r,min:a,max:o,orientacion:s,etiqueta:i,textoTooltip:c,mostrarTooltip:l,animarTooltip:d,descrito:h,etiquetadoPor:g,conAnillo:f,activo:u,deshabilitado:v,soloLectura:p,contenido:m,clases:w,clasesTooltip:b,onTeclado:y,onFocoEntra:E,onFocoSale:S})=>n.jsxs("div",{className:ne(we.pulgar,u&&we.pulgar_activo,w),style:{"--posicion":`${t}%`},role:"slider",tabIndex:v?-1:0,"aria-valuemin":a,"aria-valuemax":o,"aria-valuenow":e,"aria-valuetext":c,"aria-label":g?void 0:i,"aria-labelledby":g,"aria-describedby":h,"aria-orientation":s,"aria-disabled":v||void 0,"aria-readonly":p||void 0,"data-indice":r,"data-focus-ring":f||void 0,"data-testid":`slider-pulgar-${r}`,onKeyDown:C=>y(r,C),onFocus:()=>E(r),onBlur:S,children:[n.jsx("span",{className:we.punto_pulgar,children:m}),l&&n.jsx("span",{className:ne(we.tooltip,b),role:"tooltip",children:n.jsx(jo,{texto:c,estatico:!d})})]}),zc=.05,_0=({segments:e,min:t,max:r,reverse:a,clases:o})=>n.jsx("div",{className:we.capa_segmentos,"aria-hidden":"true",children:e.map((s,i)=>{const c=qr(s.from,t,r,a),l=qr(s.to,t,r,a),d=Math.min(c,l),h=Math.abs(l-c),g=d<=zc,f=d+h>=100-zc;return n.jsx("span",{className:ne(we.segmento,o,s.className),style:{"--seg-inicio":`${d}%`,"--seg-largo":`${h}%`,"--seg-tope-inicio":g?"var(--slider-tope)":"0px","--seg-tope-fin":f?"var(--slider-tope)":"0px","--seg-radio-inicio":g?"var(--slider-radio)":"0","--seg-radio-fin":f?"var(--slider-radio)":"0",backgroundColor:s.color,...s.style}},`segmento-${i}`)})}),Bc=_.forwardRef(({value:e,defaultValue:t=0,onChange:r,onChangeEnd:a,min:o=0,max:s=100,minValue:i,maxValue:c,step:l=1,minStepsBetweenThumbs:d=0,draggableTrack:h=!1,clampMin:g,clampMax:f,reverse:u=!1,fillOffset:v,restrictToMarks:p=!1,size:m="sm",color:w="secondary",customColor:b,variant:y="solid",radius:E="md",orientation:S="horizontal",verticalLength:C="12rem",label:T,description:F,errorMessage:D,labelPlacement:M="top",showValue:U=!1,valuePlacement:V="top",hideValue:N=!1,animateValue:k=!0,formatOptions:A,locale:O="es-CO",getValue:$,showTooltip:x="auto",marks:I=[],segments:L=[],histogram:X,hapticFeedback:H=!1,showSteps:z=!1,showMarkTicks:q=!1,startContent:B,endContent:K,hideThumb:Y=!1,showOutline:Q=!1,inverted:ee=!1,thumbIcon:se,thumbVariant:ce="default",enableWheel:ae=!0,disableThumbScale:de=!1,disableAnimation:oe=!1,isDisabled:fe=!1,isReadOnly:pe=!1,isInvalid:te=!1,classNames:ue={},name:ge,className:ve="","data-testid":J,...P},G)=>{const W=i??o,re=c??s,le=l??1,he=p||l===null&&I.length>0,Ce=_.useId(),Ne=`${Ce}-label`,Ie=`${Ce}-ayuda`,Ee=J??(ge?`slider-${ge}`:"slider"),[Ze,tt]=_.useState(!1),{valores:Fe,esRango:De,arrastrandoPista:rt,arrastreRaw:Ae,zonaRef:Le,pistaRef:$e,indiceActivo:_t,indiceEnfocado:Pe,indiceConAnillo:lt,manejarFoco:Wt,manejarBlur:Bt,manejarPointerDown:Se,manejarTeclado:je,seleccionarValor:kt}=l0({value:e,defaultValue:t,onChange:r,onChangeEnd:a,min:W,max:re,step:le,marks:I,restrictToMarks:he,minStepsBetweenThumbs:d,orientation:S,enableWheel:ae,draggableTrack:h,reverse:u,clampMin:g,clampMax:f,hapticFeedback:H,isDisabled:fe,isReadOnly:pe}),Re=typeof w=="function"?w(De?Math.max(...Fe):Fe[0]):w,xt=b?void 0:we[`color_${Re}`],At=b??(xt?void 0:Re),Nr=te||!!D,Xr=S==="vertical",Ir=_.useMemo(()=>z?he?I.map(vt=>vt.value):i0(W,re,le):[],[I,re,W,le,z,he]),Xe=!De&&Ae!==null?W+(u?100-Ae:Ae)/100*(re-W):null,Oe=ee?re:Qt(v??W,W,re),Dt=De?Fe[0]:Oe,Nt=Xe??(De?Fe[1]:Fe[0]),Et=qr(Dt,W,re,u),tr=qr(Nt,W,re,u),rr=Math.min(Et,tr),mr=Math.max(Et,tr),Mt=vt=>c0(vt,O,A),br=De?`${Mt(Fe[0])} – ${Mt(Fe[1])}`:Mt(Fe[0]),wn=De?[Fe[0],Fe[1]]:Fe[0],ma=1+Math.max(Mt(W).length,Mt(re).length,De?`${Mt(re)} – ${Mt(re)}`.length:0),yn=vt=>vt>=Math.min(Dt,Nt)&&vt<=Math.max(Dt,Nt),Mr=U&&!N,ba=x==="always"||x==="drag"||x==="auto"&&!Mr,Ke=vt=>!ba||Y?!1:x==="always"?!0:x==="drag"?_t===vt:_t===vt||Pe===vt||Ze,pt=ne(we.contenedor,we[`tam_${m}`],xt,we[`variante_${y}`],we[`radio_${E}`],we[`orientacion_${S}`],we[`label_${M}`],fe&&we.deshabilitado,pe&&we.solo_lectura,Nr&&we.invalido,Y&&we.sin_pulgar,ce!=="default"&&we[`pulgar_${ce}`],Q&&we.con_borde,de&&we.sin_escala,oe&&we.sin_animacion,(_t!==null||rt)&&we.arrastrando,h&&De&&we.pista_arrastrable,rt&&we.arrastrando_pista,I.length>0&&we.con_marcas,X&&X.length>0&&we.con_histograma,ue.base,ve),nr=typeof T=="string"?T:De?"Rango":"Valor",Lt=vt=>De?`${nr} ${vt===0?"mínimo":"máximo"}`:nr,wa={...At?{"--slider-custom-color":At}:{},...Xr?{"--slider-largo":C}:{},...Mr?{"--slider-ancho-valor":`${ma}ch`}:{}},kn=rr<=0,ya=mr>=100,as={"--inicio":`${rr}%`,"--largo":`${mr-rr}%`,"--tope-inicio":kn?"var(--slider-tope)":"0px","--tope-fin":ya?"var(--slider-tope)":"0px","--radio-inicio":kn?"var(--slider-radio)":"0","--radio-fin":ya?"var(--slider-radio)":"0"},ka=k&&!oe,xa=$?$(wn,br):n.jsx(jo,{texto:br,estatico:!ka}),ql=()=>!T&&!(Mr&&V==="top")?null:n.jsxs("div",{className:we.encabezado,children:[T&&n.jsx("span",{id:Ne,className:ne(we.etiqueta,ue.label),children:T}),Mr&&V==="top"&&n.jsx("span",{className:ne(we.valor,ue.value),children:xa})]});return n.jsxs("div",{...P,ref:G,className:pt,style:{...wa,...P.style},"data-testid":Ee,"data-orientation":S,onMouseEnter:()=>tt(!0),onMouseLeave:()=>tt(!1),children:[M==="top"&&ql(),n.jsxs("div",{className:we.fila,children:[B&&n.jsx("span",{className:we.contenido_lateral,children:B}),n.jsx("div",{ref:Le,className:we.zona_pista,onPointerDown:Se,"data-testid":`${Ee}-zona`,children:n.jsx("div",{className:ne(we.pista,ue.track),children:n.jsxs("div",{ref:$e,className:we.capa,"data-testid":`${Ee}-pista`,children:[L.length>0&&n.jsx(_0,{segments:L,min:W,max:re,reverse:u,clases:ue.segment}),X&&X.length>0&&n.jsx(u0,{histogram:X,min:W,max:re,reverse:u,estaActiva:yn,clases:ue.histogram}),n.jsx("span",{className:ne(we.relleno,ue.filler),style:as,"aria-hidden":"true"}),n.jsx(f0,{marks:I,pasos:Ir,min:W,max:re,reverse:u,mostrarLineas:q,estaActiva:yn,onSeleccionar:kt,interactivo:!fe&&!pe,clasesMarca:ue.mark,clasesPaso:ue.step}),Fe.map((vt,ar)=>n.jsx(h0,{valor:vt,porcentaje:De?qr(vt,W,re,u):tr,indice:ar,min:W,max:re,orientacion:S,etiqueta:Lt(ar),etiquetadoPor:!De&&T?Ne:void 0,textoTooltip:Mt(vt),mostrarTooltip:Ke(ar),animarTooltip:ka,descrito:F||D?Ie:void 0,conAnillo:lt===ar,activo:_t===ar,deshabilitado:fe,soloLectura:pe,contenido:se,clases:ue.thumb,clasesTooltip:ue.tooltip,onTeclado:je,onFocoEntra:Wt,onFocoSale:Bt},`pulgar-${ar}`))]})})}),Mr&&V==="end"&&n.jsx("span",{className:ne(we.valor_final,ue.value),children:xa}),K&&n.jsx("span",{className:we.contenido_lateral,children:K})]}),M==="bottom"&&ql(),(F||D)&&n.jsx("span",{id:Ie,className:ne(Nr?we.mensaje_error:we.descripcion,ue.description),children:D||F}),ge&&Fe.map((vt,ar)=>n.jsx("input",{type:"hidden",name:De?`${ge}[${ar}]`:ge,value:vt,readOnly:!0},`campo-${ar}`))]})});Bc.displayName="Slider";const ft={backdrop:"_backdrop_1w6ll_1",visible:"_visible_1w6ll_37",drawer:"_drawer_1w6ll_67",posicion_right:"_posicion_right_1w6ll_135",posicion_left:"_posicion_left_1w6ll_173",posicion_top:"_posicion_top_1w6ll_211",posicion_bottom:"_posicion_bottom_1w6ll_249",radio_none:"_radio_none_1w6ll_287",radio_sm:"_radio_sm_1w6ll_295",radio_md:"_radio_md_1w6ll_315",radio_lg:"_radio_lg_1w6ll_335",radio_xl:"_radio_xl_1w6ll_355",tamano_auto:"_tamano_auto_1w6ll_455",tamano_sm:"_tamano_sm_1w6ll_479",tamano_md:"_tamano_md_1w6ll_489",tamano_lg:"_tamano_lg_1w6ll_499",tamano_xl:"_tamano_xl_1w6ll_509",tamano_full:"_tamano_full_1w6ll_519",encabezado:"_encabezado_1w6ll_579",manija:"_manija_1w6ll_599",titulo:"_titulo_1w6ll_607",boton_cerrar:"_boton_cerrar_1w6ll_629",contenido:"_contenido_1w6ll_753",pie:"_pie_1w6ll_769",loading_overlay:"_loading_overlay_1w6ll_789",spinner:"_spinner_1w6ll_813",spin:"_spin_1w6ll_813",loading_text:"_loading_text_1w6ll_843",variante_floating:"_variante_floating_1w6ll_855",manija_barra:"_manija_barra_1w6ll_1003"},p0={left:"x",right:"x",top:"y",bottom:"y"},g0={right:1,left:-1,bottom:1,top:-1},v0={x:"width",y:"height"},Vc="transform 0.5s cubic-bezier(0.32, 0.72, 0, 1)",m0=`${Vc}, opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.45s allow-discrete`,jc=.4,b0=2;function w0(e,t,r){if(e==="content")return Math.min(r??t,t);if(typeof e=="number")return Math.min(Math.max(e,0),t);const a=parseFloat(e)/100;return Math.round(t*a)}function Hc(e,{position:t,isOpen:r,enabled:a,snapPoints:o,activeSnapPoint:s,onSnapPointChange:i,closeThreshold:c=.25,onClose:l,contentRef:d,contentOffset:h=0}){const g=p0[t],f=g0[t],u=v0[g],v=(o?.length??0)>0,p=(o??[]).includes("content"),[m,w]=_.useState(0),[b,y]=_.useState(null),[E,S]=_.useState(!1),[C,T]=_.useState(null),[F,D]=_.useState(s??(o?o.length-1:0)),M=_.useRef(0),U=_.useRef(0),V=_.useRef(0),N=_.useRef(0),k=_.useRef(null),A=_.useRef(null);_.useLayoutEffect(()=>{if(!a&&!v)return;if(v){const se=()=>w(g==="x"?window.innerWidth:window.innerHeight);return se(),window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)}const Y=e.current;if(!Y)return;const Q=()=>{const se=Math.round(g==="x"?Y.getBoundingClientRect().width:Y.getBoundingClientRect().height);w(ce=>ce===se?ce:se)};Q();const ee=new ResizeObserver(Q);return ee.observe(Y),()=>ee.disconnect()},[e,g,a,v]),_.useLayoutEffect(()=>{if(!p||!d?.current)return;const Y=d.current,Q=()=>{const se=Math.round((g==="x"?Y.getBoundingClientRect().width:Y.getBoundingClientRect().height)+h);y(ce=>ce===se?ce:se)};Q();const ee=new ResizeObserver(Q);return ee.observe(Y),()=>ee.disconnect()},[d,g,p,h]),_.useEffect(()=>{s!==void 0?D(s):r&&o&&D(o.length-1)},[r,s,o]);const O=_.useMemo(()=>v&&m>0?o.map(Y=>w0(Y,m,b)):[],[v,m,b,o]),$=O.length>0?Math.max(...O):0;_.useEffect(()=>()=>{A.current!==null&&cancelAnimationFrame(A.current)},[]);const x=_.useRef({tienePuntosAnclaje:v,puntosResueltos:O,indiceAnclaje:F,signo:f,tamano:m,maxSnap:$});x.current={tienePuntosAnclaje:v,puntosResueltos:O,indiceAnclaje:F,signo:f,tamano:m,maxSnap:$};const I=_.useCallback(Y=>g==="x"?Y.clientX:Y.clientY,[g]),L=_.useCallback(Y=>{if(!a)return;const{tienePuntosAnclaje:Q,puntosResueltos:ee,indiceAnclaje:se,maxSnap:ce}=x.current;M.current=I(Y),U.current=performance.now(),N.current=se,V.current=Q?ce-(ee[se]??ce):0,S(!0),T(V.current),Y.target.setPointerCapture?.(Y.pointerId)},[a,I]),X=_.useCallback(()=>{A.current=null;const Y=k.current;if(Y===null)return;const{signo:Q}=x.current,ee=(Y-M.current)*Q,se=V.current+ee;T(Math.max(0,se))},[]),H=_.useCallback(Y=>{!a||C===null||(k.current=I(Y),A.current===null&&(A.current=requestAnimationFrame(X)))},[a,C,I,X]),z=_.useCallback(()=>{if(A.current!==null&&(cancelAnimationFrame(A.current),A.current=null),k.current=null,!a||C===null)return;S(!1);const Y=Math.max(1,performance.now()-U.current),Q=Math.abs(C-V.current)/Y;if(v){const ee=$-V.current,se=$-C,ce=se-ee>0,ae=N.current===O.length-1,de=N.current===0;if(Q>b0){if(!ce){T(null),l();return}const te=O.length-1;D(te),i?.(te),T(null);return}if(de&&!ce){const te=O[N.current]||m;if((ee-se)/te>c){T(null),l();return}}let oe=0,fe=1/0;O.forEach((te,ue)=>{const ge=Math.abs(se-te);ge<fe&&(fe=ge,oe=ue)});const pe=Math.abs(se-ee);if(Q>jc&&pe<m*.4){const te=ce?1:-1;if(te>0&&ae){T(null);return}if(de&&te<0){T(null),l();return}const ue=N.current+te;D(ue),i?.(ue),T(null);return}D(oe),i?.(oe),T(null);return}(Q>jc||C>=m*c)&&l(),T(null)},[a,C,v,O,$,c,m,l,i]),q=_.useCallback(Y=>{Y.target.releasePointerCapture?.(Y.pointerId),z()},[z]),B=q;let K;if(v&&m>0&&$>0){const Y=E&&C!==null?C:r?$-(O[F]??$):$;K={[u]:`${$}px`,transform:`translate${g==="x"?"X":"Y"}(${f*Y}px)`,transition:E?"none":m0,willChange:"transform"}}else C!==null&&(K={transform:`translate${g==="x"?"X":"Y"}(${f*C}px)`,transition:E?"none":Vc});return{isDragging:E,style:K,handlers:{onPointerDown:L,onPointerMove:H,onPointerUp:q,onPointerCancel:B}}}const y0=18,k0=600,Uc={transparente:0,sutil:.2,normal:.4,intermedio:.6,intenso:.8},Wc=_.forwardRef(({isOpen:e,onClose:t,position:r="right",size:a="md",title:o,showCloseButton:s=!0,closeOnBackdropClick:i=!0,closeOnEscape:c=!0,preventScroll:l=!0,header:d,footer:h,children:g,className:f="",style:u,contentClassName:v="",isLoading:p=!1,loadingMessage:m="Cargando...",onOpen:w,backdropVariant:b="normal",radius:y,zIndex:E,getContainer:S,variant:C="default",swipeToClose:T=!1,snapPoints:F,activeSnapPoint:D,onSnapPointChange:M,closeThreshold:U=.25,id:V,"data-testid":N},k)=>{const A=_.useRef(null),O=_.useRef(null),$=_.useRef(null),[x,I]=_.useState(!1),L=_.useId(),X=V??`drawer-${L}`,H=`${X}-title`,z=T||!!F?.length,q=_.useCallback(te=>{O.current=te,typeof k=="function"?k(te):k&&(k.current=te)},[k]),B=_.useCallback(()=>{I(te=>te||!0)},[]);_.useEffect(()=>{if(!x)return;let te=!1;const ue=()=>{te||(te=!0,t?.(),I(!1))},ge=O.current,ve=P=>{P.target===ge&&P.propertyName==="transform"&&ue()};ge?.addEventListener("transitionend",ve);const J=window.setTimeout(ue,k0);return()=>{ge?.removeEventListener("transitionend",ve),window.clearTimeout(J)}},[x,t]);const K=e&&!x,{style:Y,handlers:Q}=Hc(O,{position:r,isOpen:K,enabled:z,snapPoints:F,activeSnapPoint:D,onSnapPointChange:M,closeThreshold:U,onClose:B,contentRef:$,contentOffset:z&&(r==="top"||r==="bottom")?y0:0});_.useEffect(()=>{e&&I(!1)},[e]);const ee=_.useRef(w);ee.current=w,_.useEffect(()=>{e&&ee.current?.()},[e]),_.useEffect(()=>{if(!e||!l)return;const te=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",te>0&&(document.body.style.paddingRight=`${te}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,l]),_.useEffect(()=>{if(!e||!c)return;const te=ue=>{ue.key==="Escape"&&B()};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[e,c,B]);const se=te=>{i&&te.target===A.current&&B()},ce=[ft.drawer,ft[`posicion_${r}`],ft[`tamano_${a}`],C==="floating"&&ft.variante_floating,!!F?.length&&ft.con_anclajes,K&&ft.visible,y&&ft[`radio_${y}`],f].filter(Boolean).join(" "),ae=[ft.contenido,v].filter(Boolean).join(" "),de=[ft.backdrop,K&&ft.visible].filter(Boolean).join(" "),fe={background:`rgb(0 0 0 / ${Uc[b]??Uc.normal})`,zIndex:E||500,...S&&{position:"absolute"}},pe=n.jsx("div",{className:de,ref:A,onClick:se,style:fe,children:n.jsxs("div",{ref:q,id:X,className:ce,role:"dialog","aria-modal":"true","aria-labelledby":o?H:void 0,"data-testid":N??X,style:{...u,...Y},children:[z&&n.jsx("div",{className:ft.manija,...Q,children:n.jsx("span",{className:ft.manija_barra})}),(o||d)&&n.jsx("div",{ref:$,className:ft.encabezado,children:d||n.jsxs(n.Fragment,{children:[n.jsx("h2",{id:H,className:ft.titulo,children:o}),s&&n.jsx("button",{type:"button",className:ft.boton_cerrar,onClick:B,"aria-label":"Cerrar",children:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:n.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),n.jsx("div",{className:ae,children:g}),h&&n.jsx("div",{className:ft.pie,children:h}),p&&n.jsxs("div",{className:ft.loading_overlay,children:[n.jsx("div",{className:ft.spinner}),n.jsx("span",{className:ft.loading_text,children:m})]})]})});if(S){const te=typeof S=="function"?S():S;if(te&&te instanceof HTMLElement)return Kr.createPortal(pe,te)}return pe});Wc.displayName="Drawer";const nt={backdrop:"_backdrop_li82t_1",visible:"_visible_li82t_41",centrado:"_centrado_li82t_65",modal:"_modal_li82t_73",tamano_sm:"_tamano_sm_li82t_145",tamano_md:"_tamano_md_li82t_153",tamano_lg:"_tamano_lg_li82t_161",tamano_xl:"_tamano_xl_li82t_169",tamano_formulario:"_tamano_formulario_li82t_177",tamano_full:"_tamano_full_li82t_185",tamano_auto:"_tamano_auto_li82t_193",encabezado:"_encabezado_li82t_203",encabezado_custom:"_encabezado_custom_li82t_221",contenedor_titulo_completo:"_contenedor_titulo_completo_li82t_233",contenedor_titulo_icono:"_contenedor_titulo_icono_li82t_243",icono_titulo:"_icono_titulo_li82t_255",titulo:"_titulo_li82t_269",contenido:"_contenido_li82t_289",pie:"_pie_li82t_303",loading_overlay:"_loading_overlay_li82t_323",spinner:"_spinner_li82t_349",spinner_dot:"_spinner_dot_li82t_365",loadingBounce:"_loadingBounce_li82t_1",loading_text:"_loading_text_li82t_433",radius_none:"_radius_none_li82t_447",radius_sm:"_radius_sm_li82t_455",radius_md:"_radius_md_li82t_463",radius_lg:"_radius_lg_li82t_471",radius_full:"_radius_full_li82t_479",close_button:"_close_button_li82t_487",texto_esc:"_texto_esc_li82t_579"},Ho=_.forwardRef(({isOpen:e,onClose:t,size:r="md",title:a,titleIcon:o,closeOnBackdropClick:s=!1,closeOnEscape:i=!0,preventScroll:c=!0,isCentered:l=!0,header:d,footer:h,children:g,className:f="",contentClassName:u="",isLoading:v=!1,loadingMessage:p="Cargando...",backdropVariant:m="normal",showIconTitle:w=!1,onOpen:b,radius:y="lg",showCloseButton:E=!1,id:S,"data-testid":C,"aria-labelledby":T,"aria-describedby":F},D)=>{const M=_.useRef(null),U=_.useId(),V=S??`modal-${U}`,N=`${V}-title`,k=_.useCallback(()=>{v||t?.()},[t,v]);_.useEffect(()=>{if(e){if(b?.(),c){const H=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",H>0&&(document.body.style.paddingRight=`${H}px`)}if(i){const H=z=>{z.key==="Escape"&&k()};return document.addEventListener("keydown",H),()=>{document.removeEventListener("keydown",H),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,k,i,c,b]);const A=H=>{s&&H.target===M.current&&k()},O=[nt.backdrop,l&&nt.centrado,e&&nt.visible].filter(Boolean).join(" "),$=[nt.modal,nt[`tamano_${r}`],nt[`radius_${y}`],f].filter(Boolean).join(" "),x=[nt.contenido,u].filter(Boolean).join(" "),I={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:L}=I[m]||I.normal,X={background:`rgb(0 0 0 / ${L})`};return n.jsx("div",{className:O,ref:M,onClick:A,style:X,children:n.jsxs("div",{ref:D,id:V,className:$,role:"dialog","aria-modal":"true","aria-labelledby":T??(a?N:void 0),"aria-describedby":F,"data-testid":C??V,children:[(a||d||E)&&n.jsx("div",{className:`${nt.encabezado}${d?` ${nt.encabezado_custom}`:""}`,children:d||n.jsxs(n.Fragment,{children:[n.jsx("div",{className:nt.contenedor_titulo_completo,children:n.jsxs("div",{className:nt.contenedor_titulo_icono,children:[w&&o!==void 0&&(typeof o=="string"?n.jsx("span",{className:nt.icono_titulo,children:o}):o),w&&o===void 0&&n.jsx("span",{className:nt.icono_titulo,children:"📄"}),a&&n.jsx("h2",{id:N,className:nt.titulo,children:a})]})}),E&&n.jsxs("button",{type:"button",className:nt.close_button,onClick:k,"aria-label":"Cerrar",children:[n.jsx("span",{className:nt.texto_esc,children:"ESC"}),n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),n.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})]})]})}),n.jsx("div",{className:x,children:g}),h&&n.jsx("div",{className:nt.pie,children:h}),v&&n.jsxs("div",{className:nt.loading_overlay,children:[n.jsxs("div",{className:nt.spinner,children:[n.jsx("span",{className:nt.spinner_dot}),n.jsx("span",{className:nt.spinner_dot}),n.jsx("span",{className:nt.spinner_dot})]}),n.jsx("span",{className:nt.loading_text,children:p})]})]})})});Ho.displayName="Modal";function x0(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",...e,children:[n.jsx("path",{fill:"currentColor",d:"M232 128c0 12.5-17.8 22-22.7 33.7s1.4 30.6-7.8 39.8s-28.5 3.1-39.8 7.8S140.5 232 128 232s-22-17.8-33.7-22.7s-30.6 1.4-39.8-7.8s-3.1-28.5-7.8-39.8S24 140.5 24 128s17.8-22 22.7-33.7s-1.4-30.6 7.8-39.8s28.5-3.1 39.8-7.8S115.5 24 128 24s22 17.8 33.7 22.7s30.6-1.4 39.8 7.8s3.1 28.5 7.8 39.8S232 115.5 232 128Z",opacity:".2"}),n.jsx("path",{fill:"currentColor",d:"M225.9 102.8c-3.8-3.9-7.7-8-9.2-11.5s-1.4-8.7-1.5-14c-.1-9.7-.3-20.8-8-28.5s-18.8-7.9-28.5-8c-5.3-.1-10.7-.2-14-1.5s-7.6-5.4-11.5-9.2C146.3 23.5 138.4 16 128 16s-18.3 7.5-25.2 14.1c-3.9 3.8-8 7.7-11.5 9.2s-8.7 1.4-14 1.5c-9.7.1-20.8.3-28.5 8s-7.9 18.8-8 28.5c-.1 5.3-.2 10.7-1.5 14s-5.4 7.6-9.2 11.5C23.5 109.7 16 117.6 16 128s7.5 18.3 14.1 25.2c3.8 3.9 7.7 8 9.2 11.5s1.4 8.7 1.5 14c.1 9.7.3 20.8 8 28.5s18.8 7.9 28.5 8c5.3.1 10.7.2 14 1.5s7.6 5.4 11.5 9.2c6.9 6.6 14.8 14.1 25.2 14.1s18.3-7.5 25.2-14.1c3.9-3.8 8-7.7 11.5-9.2s8.7-1.4 14-1.5c9.7-.1 20.8-.3 28.5-8s7.9-18.8 8-28.5c.1-5.3.2-10.7 1.5-14s5.4-7.6 9.2-11.5c6.6-6.9 14.1-14.8 14.1-25.2s-7.5-18.3-14.1-25.2ZM120 136V80a8 8 0 0 1 16 0v56a8 8 0 0 1-16 0Zm20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12Z"})]})}function E0(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[n.jsx("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),n.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),n.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"})]})}function C0(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:n.jsxs("g",{fill:"currentColor",children:[n.jsxs("g",{opacity:".2",children:[n.jsx("path",{d:"M14.696 12.282a1 1 0 1 1-1.392 1.436a2 2 0 0 0-.102-.09a2.4 2.4 0 0 0-.623-.348c-.453-.18-1-.28-1.579-.28c-.914 0-1.733.251-2.202.629q-.056.044-.102.089a1 1 0 1 1-1.392-1.436q.114-.11.24-.212C8.395 11.387 9.656 11 11 11c.827 0 1.624.146 2.316.42c.43.17.815.389 1.14.65q.126.102.24.212"}),n.jsx("path",{d:"M17.213 9.689a1 1 0 1 1-1.426 1.402a4 4 0 0 0-.312-.285a5.5 5.5 0 0 0-.767-.521a6 6 0 0 0-.932-.425a7 7 0 0 0-1.057-.298a8 8 0 0 0-1.137-.153a9 9 0 0 0-1.74.058a8 8 0 0 0-1.102.227a7 7 0 0 0-1 .364a6 6 0 0 0-.854.477a5 5 0 0 0-.361.27a4 4 0 0 0-.312.286A1 1 0 1 1 4.787 9.69q.218-.22.462-.424q.243-.201.512-.384a7.5 7.5 0 0 1 1.15-.643a9 9 0 0 1 1.286-.469a10 10 0 0 1 1.379-.284A10.5 10.5 0 0 1 11 7.39a11 11 0 0 1 1.424.095a10 10 0 0 1 1.38.284a9 9 0 0 1 1.285.469a8 8 0 0 1 1.15.643q.27.183.512.384q.244.204.462.424"}),n.jsx("path",{d:"M19.245 7.222a1 1 0 0 1-1.49 1.333a6 6 0 0 0-.456-.459a7 7 0 0 0-.52-.43a8.4 8.4 0 0 0-1.215-.747a9 9 0 0 0-1.408-.563a10 10 0 0 0-1.542-.35A11 11 0 0 0 11 5.89a11 11 0 0 0-1.614.117a10.5 10.5 0 0 0-1.542.35a9.6 9.6 0 0 0-1.407.564a8 8 0 0 0-.635.353a8 8 0 0 0-.58.393a7 7 0 0 0-.52.43a6 6 0 0 0-.457.46a1 1 0 0 1-1.49-1.334q.28-.314.6-.604q.316-.29.668-.553q.351-.262.732-.496a10.4 10.4 0 0 1 1.62-.813a11.6 11.6 0 0 1 1.785-.554a12.5 12.5 0 0 1 1.883-.279a13.2 13.2 0 0 1 2.864.105a12.5 12.5 0 0 1 1.842.418a11.6 11.6 0 0 1 1.71.686a10.4 10.4 0 0 1 1.518.933q.351.264.669.553t.6.604M13 16.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0"})]}),n.jsx("path",{d:"M13.348 11.641a.5.5 0 0 1-.696.718a2 2 0 0 0-.136-.12a3 3 0 0 0-.753-.424A4.8 4.8 0 0 0 10 11.5c-1.022 0-1.951.285-2.516.739q-.073.06-.136.12a.5.5 0 0 1-.696-.718q.097-.094.206-.182c.754-.606 1.905-.959 3.142-.959c.765 0 1.5.134 2.132.385c.385.153.726.346 1.01.574q.109.089.206.182m2.508-2.601a.5.5 0 1 1-.712.7a5 5 0 0 0-.35-.32a5 5 0 0 0-.399-.298a6.6 6.6 0 0 0-1.449-.731a8 8 0 0 0-1.126-.319a9 9 0 0 0-1.205-.162a9.3 9.3 0 0 0-1.839.061a9 9 0 0 0-1.172.242a8 8 0 0 0-1.071.39a6.6 6.6 0 0 0-.928.519q-.21.143-.399.298q-.186.155-.35.32a.5.5 0 0 1-.712-.7q.198-.202.424-.39q.225-.186.474-.355a7 7 0 0 1 1.076-.602a8 8 0 0 1 1.215-.443a9 9 0 0 1 1.31-.27A10 10 0 0 1 10 6.89a10 10 0 0 1 1.357.09a10 10 0 0 1 1.31.27a9 9 0 0 1 1.215.443a7.6 7.6 0 0 1 1.076.602q.249.17.474.355q.226.188.424.39"}),n.jsx("path",{d:"M17.873 6.555a.5.5 0 1 1-.746.667a7 7 0 0 0-.492-.496a8 8 0 0 0-.557-.46a9 9 0 0 0-1.29-.794a9.5 9.5 0 0 0-1.484-.594a10.6 10.6 0 0 0-1.617-.366A11.4 11.4 0 0 0 10 4.389a12 12 0 0 0-1.687.123a11 11 0 0 0-1.617.366a10 10 0 0 0-1.483.595a9 9 0 0 0-.673.374a8 8 0 0 0-.618.42q-.294.22-.557.46q-.263.239-.492.495a.5.5 0 1 1-.746-.667q.264-.294.564-.568t.632-.521q.332-.249.694-.471a10 10 0 0 1 1.545-.775a11 11 0 0 1 1.709-.53a12 12 0 0 1 1.808-.268a12.7 12.7 0 0 1 2.754.1a12 12 0 0 1 1.767.401a11 11 0 0 1 1.635.656q.387.194.749.416q.36.222.693.47q.333.249.632.522q.3.274.564.568M11.75 15.25a1.75 1.75 0 1 1-3.5 0a1.75 1.75 0 0 1 3.5 0"}),n.jsx("path",{d:"M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"})]})})}function S0(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M13.435 2.075a3.33 3.33 0 0 0-2.87 0c-.394.189-.755.497-1.26.928l-.079.066a2.56 2.56 0 0 1-1.58.655l-.102.008c-.662.053-1.135.09-1.547.236a3.33 3.33 0 0 0-2.03 2.029c-.145.412-.182.885-.235 1.547l-.008.102a2.56 2.56 0 0 1-.655 1.58l-.066.078c-.431.506-.74.867-.928 1.261a3.33 3.33 0 0 0 0 2.87c.189.394.497.755.928 1.26l.066.079c.41.48.604.939.655 1.58l.008.102c.053.662.09 1.135.236 1.547a3.33 3.33 0 0 0 2.029 2.03c.412.145.885.182 1.547.235l.102.008c.629.05 1.09.238 1.58.655l.078.066c.506.431.867.74 1.261.928a3.33 3.33 0 0 0 2.87 0c.394-.189.755-.497 1.26-.928l.079-.066c.48-.41.939-.604 1.58-.655l.102-.008c.662-.053 1.135-.09 1.547-.236a3.33 3.33 0 0 0 2.03-2.029c.145-.412.182-.885.235-1.547l.008-.102c.05-.629.238-1.09.655-1.58l.066-.079c.431-.505.74-.866.928-1.26a3.33 3.33 0 0 0 0-2.87c-.189-.394-.497-.755-.928-1.26l-.066-.079a2.56 2.56 0 0 1-.655-1.58l-.008-.102c-.053-.662-.09-1.135-.236-1.547a3.33 3.33 0 0 0-2.029-2.03c-.412-.145-.885-.182-1.547-.235l-.102-.008a2.56 2.56 0 0 1-1.58-.655l-.079-.066c-.505-.431-.866-.74-1.26-.928M12 7.25a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M10.75 16a.75.75 0 0 1 .5-.707v-3.586a.75.75 0 0 1 .25-1.457h.5a.75.75 0 0 1 .75.75v4.293a.75.75 0 0 1-.25 1.457h-1a.75.75 0 0 1-.75-.75"})})}function T0(e){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:[n.jsx("defs",{children:n.jsx("mask",{id:"SVG4IxzvcIZ",children:n.jsxs("g",{fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",children:[n.jsx("path",{fill:"#555",d:"m24 4l5.253 3.832l6.503-.012l1.997 6.188l5.268 3.812L41 24l2.021 6.18l-5.268 3.812l-1.997 6.188l-6.503-.012L24 44l-5.253-3.832l-6.503.012l-1.997-6.188l-5.268-3.812L7 24l-2.021-6.18l5.268-3.812l1.997-6.188l6.503.012z"}),n.jsx("path",{d:"m17 24l5 5l10-10"})]})})}),n.jsx("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#SVG4IxzvcIZ)"})]})}const ht={contenido:"_contenido_rd5zt_1",modal_radio:"_modal_radio_rd5zt_11",cuerpo:"_cuerpo_rd5zt_19",icono_wrapper:"_icono_wrapper_rd5zt_37",icono:"_icono_rd5zt_37",icono_personalizado:"_icono_personalizado_rd5zt_55",titulo:"_titulo_rd5zt_87",mensaje:"_mensaje_rd5zt_107",descripcion:"_descripcion_rd5zt_127",grupo_botones:"_grupo_botones_rd5zt_143",solo_confirmar:"_solo_confirmar_rd5zt_159",boton_modal:"_boton_modal_rd5zt_167",advertencia:"_advertencia_rd5zt_181",eliminar:"_eliminar_rd5zt_189",exito:"_exito_rd5zt_197",info:"_info_rd5zt_205",sin_conexion:"_sin_conexion_rd5zt_213",personalizado:"_personalizado_rd5zt_221"},A0={advertencia:x0,eliminar:E0,exito:T0,info:S0,"sin-conexion":C0},N0={advertencia:ht.advertencia,eliminar:ht.eliminar,exito:ht.exito,info:ht.info,"sin-conexion":ht.sin_conexion,personalizado:ht.personalizado},pn=_.forwardRef(({isOpen:e,tipo:t="advertencia",titulo:r,mensaje:a,descripcion:o,textoConfirmar:s="Confirmar",textoCancelar:i="Cancelar",onConfirmar:c,onCancelar:l,size:d="sm",closeOnBackdropClick:h=!1,icono:g,loadingConfirmar:f=!1,timeout:u,colorTipo:v,colorBotonConfirmar:p,classNames:m,backdropBlur:w="6px",id:b,"data-testid":y},E)=>{const S=A0[t],C=t==="exito",T=_.useId(),F=b??`modal-aviso-${T}`,D=r?`${F}-title`:void 0,M=a?`${F}-message`:void 0;_.useEffect(()=>{if(!e||!u)return;const V=setTimeout(c,u);return()=>clearTimeout(V)},[e,u,c]);const U=v?{"--color-tipo":v}:void 0;return n.jsx(Ho,{ref:E,isOpen:e,onClose:l,size:d,isCentered:!0,closeOnBackdropClick:h,closeOnEscape:!C,backdropBlur:w,className:ht.modal_radio,contentClassName:ht.contenido,id:F,"data-testid":y??F,"aria-labelledby":D,"aria-describedby":M,children:n.jsxs("div",{className:ne(ht.cuerpo,N0[t],m?.body),style:U,children:[n.jsx("div",{className:ne(ht.icono_wrapper,m?.icon),children:g?n.jsx("span",{className:ht.icono_personalizado,"aria-hidden":"true",children:g}):S&&n.jsx(S,{className:ht.icono,"aria-hidden":"true"})}),r&&n.jsx("h2",{id:D,className:ne(ht.titulo,m?.title),children:r}),a&&n.jsx("p",{id:M,className:ne(ht.mensaje,m?.message),children:a}),o&&n.jsx("p",{className:ne(ht.descripcion,m?.description),children:o}),n.jsxs("div",{className:ne(ht.grupo_botones,C&&ht.solo_confirmar,m?.buttonGroup),children:[!C&&n.jsx(Ye,{variant:"outline",size:"sm",fullWidth:!0,className:ne(ht.boton_modal,m?.cancelButton),onClick:l,children:i}),n.jsx(Ye,{size:"sm",fullWidth:!0,isLoading:f,className:ne(ht.boton_modal,m?.confirmButton),style:{"--btn-color":p??"var(--color-tipo)"},onClick:c,children:s})]})]})})});pn.displayName="ModalAviso";const er={group_button:"_group_button_stv5t_1",full_width:"_full_width_stv5t_9",main_button:"_main_button_stv5t_14",dropdown_trigger:"_dropdown_trigger_stv5t_18",first_item:"_first_item_stv5t_23",last_item:"_last_item_stv5t_28",variant_bordered:"_variant_bordered_stv5t_33",variant_ghost:"_variant_ghost_stv5t_34",variant_faded:"_variant_faded_stv5t_35",variant_outline:"_variant_outline_stv5t_36",variant_shadow:"_variant_shadow_stv5t_37",disabled:"_disabled_stv5t_59",loading:"_loading_stv5t_59",chevron:"_chevron_stv5t_68",chevron_open:"_chevron_open_stv5t_74"},I0=_.forwardRef(function({label:t,onClick:r,items:a,variant:o="solid",color:s="primary",size:i="md",radius:c="lg",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:h,className:g,fullWidth:f=!1,href:u,target:v,rel:p,isOpen:m,onOpenChange:w,isDropdownLoading:b=!1,id:y,"data-testid":E,...S},C){const[T,F]=_.useState(!1),D=_.useId(),M=y??`group-button-${D}`,U=O=>{F(O),w?.(O)},V=ne(er.group_button,er[`variant_${o}`],f&&er.full_width,g),N=d||b,k=d||l||b,A=()=>n.jsx("div",{className:ne(er.chevron,T&&er.chevron_open),children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:n.jsx("path",{d:"m6 9 6 6 6-6"})})});return n.jsxs("div",{ref:C,id:M,className:V,"data-testid":E??M,role:"group",children:[n.jsx(Ye,{variant:o,color:s,size:i,radius:c,isLoading:l,isDisabled:N,onClick:r,href:u,target:v,rel:p,className:ne(er.main_button,er.first_item),...S,children:t}),a&&n.jsx(hn,{items:a,triggerAction:"click",isOpen:m,onOpenChange:U,placement:"bottom-end",isDisabled:k,variant:"default",size:i==="xs"?"sm":i,matchTriggerWidth:!1,children:n.jsx(Ye,{variant:o,color:s,size:i,radius:c,isDisabled:k,isLoading:b,onlyLoading:b,isIconOnly:!0,className:ne(er.dropdown_trigger,er.last_item),"aria-label":"Más acciones",children:h||A()})})]})}),qc=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Gc=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),Rc=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),Xc=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"15 18 9 12 15 6"})}),Kc=()=>n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),it={overlay:"_overlay_svvew_1",backdrop:"_backdrop_svvew_25",visible:"_visible_svvew_47",layout:"_layout_svvew_77",columna_acciones:"_columna_acciones_svvew_147",boton_flotante:"_boton_flotante_svvew_167",boton_primario:"_boton_primario_svvew_241",boton_peligro:"_boton_peligro_svvew_251",panel:"_panel_svvew_269",tirador:"_tirador_svvew_299",encabezado:"_encabezado_svvew_307",titulo:"_titulo_svvew_325",contenido:"_contenido_svvew_341",paginacion:"_paginacion_svvew_355",texto_paginacion:"_texto_paginacion_svvew_381",tirador_barra:"_tirador_barra_svvew_531"},M0={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},F0=({isOpen:e,onClose:t,onApply:r,onClear:a,title:o,backdropVariant:s="sutil",backdropBlur:i=!0,closeOnBackdropClick:c=!0,allowBackdropInteraction:l=!1,getContainer:d,children:h,id:g,"data-testid":f})=>{const[u,v]=_.useState(!1),[p,m]=_.useState(0),w=_.useRef(null),b=_.useId(),y=g??`panel-filtros-${b}`,E=o?`${y}-title`:void 0,S=l||s==="transparente",C=_.useCallback(()=>{u||v(!0)},[u]);_.useEffect(()=>{e&&(v(!1),m(0))},[e]),_.useEffect(()=>{if(!u)return;let I=!1;const L=()=>{I||(I=!0,t(),v(!1))},X=w.current,H=q=>{q.target===X&&q.propertyName==="transform"&&L()};X?.addEventListener("transitionend",H);const z=setTimeout(L,600);return()=>{X?.removeEventListener("transitionend",H),clearTimeout(z)}},[u,t]);const{style:T,handlers:F}=Hc(w,{position:"bottom",isOpen:e,enabled:!0,closeThreshold:.3,onClose:C});_.useEffect(()=>{if(!e)return;const I=L=>L.key==="Escape"&&C();return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,C]);const D=_.useCallback(I=>{c&&I.target===I.currentTarget&&C()},[c,C]),M=_.useCallback(I=>{document.activeElement?.blur(),I?.()},[]),{pages:U,totalPages:V,hasPagination:N}=_.useMemo(()=>{const I=Array.isArray(h)?h:[h];return{pages:I,totalPages:I.length,hasPagination:I.length>1}},[h]),{background:k}=M0[s],A={background:k,backdropFilter:i?"blur(1px)":"none",pointerEvents:S?"none":"auto"},O=d?{position:"absolute"}:{},$=d?{position:"relative"}:{},x=n.jsxs("div",{id:y,className:it.overlay,role:"dialog","aria-modal":"true","aria-labelledby":E,"aria-label":o?void 0:"Panel de filtros","data-testid":f??y,style:O,children:[n.jsx("div",{className:`${it.backdrop} ${e&&!u?it.visible:""}`,style:A,onClick:D}),n.jsxs("div",{ref:w,className:`${it.layout} ${e&&!u?it.visible:""}`,style:{...$,...T},children:[n.jsxs("aside",{className:it.columna_acciones,children:[n.jsx(dr,{content:"Cerrar",placement:"left",children:n.jsx("button",{type:"button",className:it.boton_flotante,onClick:()=>M(C),"aria-label":"Cerrar panel",children:n.jsx(qc,{})})}),n.jsx(dr,{content:"Aplicar filtros",placement:"left",children:n.jsx("button",{type:"button",className:`${it.boton_flotante} ${it.boton_primario}`,onClick:()=>M(r),children:n.jsx(Gc,{})})}),n.jsx(dr,{content:"Limpiar filtros",placement:"left",children:n.jsx("button",{type:"button",className:`${it.boton_flotante} ${it.boton_peligro}`,onClick:()=>M(a),children:n.jsx(Rc,{})})}),N&&n.jsxs("div",{className:it.paginacion,children:[n.jsx("button",{type:"button",className:it.boton_flotante,style:{width:36,height:36},onClick:()=>m(I=>Math.max(0,I-1)),disabled:p===0,"aria-label":"Página anterior",children:n.jsx(Xc,{})}),n.jsxs("span",{className:it.texto_paginacion,children:[p+1," / ",V]}),n.jsx("button",{type:"button",className:it.boton_flotante,style:{width:36,height:36},onClick:()=>m(I=>Math.min(V-1,I+1)),disabled:p===V-1,"aria-label":"Página siguiente",children:n.jsx(Kc,{})})]})]}),n.jsxs("main",{className:it.panel,children:[n.jsx("div",{className:it.tirador,...F,children:n.jsx("span",{className:it.tirador_barra})}),o&&n.jsx("header",{className:it.encabezado,children:n.jsx("h2",{id:E,className:it.titulo,children:o})}),n.jsx("div",{className:it.contenido,children:n.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:U[p]},p)})]})]})]});if(d){const I=typeof d=="function"?d():d;if(I&&I instanceof HTMLElement)return Kr.createPortal(x,I)}return x},ie={backdrop:"_backdrop_cyx4s_1",visible:"_visible_cyx4s_41",modal:"_modal_cyx4s_65",encabezado:"_encabezado_cyx4s_147",encabezado_textos:"_encabezado_textos_cyx4s_161",titulo:"_titulo_cyx4s_173",subtitulo:"_subtitulo_cyx4s_187",boton_cerrar:"_boton_cerrar_cyx4s_199",texto_esc:"_texto_esc_cyx4s_249",cuerpo:"_cuerpo_cyx4s_263",zona_carga:"_zona_carga_cyx4s_283",zona_carga_activa:"_zona_carga_activa_cyx4s_315",zona_carga_deshabilitada:"_zona_carga_deshabilitada_cyx4s_351",zona_contenido:"_zona_contenido_cyx4s_363",zona_icono_flotante:"_zona_icono_flotante_cyx4s_379",zona_textos:"_zona_textos_cyx4s_435",zona_titulo:"_zona_titulo_cyx4s_449",zona_separador:"_zona_separador_cyx4s_463",zona_meta:"_zona_meta_cyx4s_497",zona_meta_sep:"_zona_meta_sep_cyx4s_519",zona_meta_tam:"_zona_meta_tam_cyx4s_529",zona_meta_label:"_zona_meta_label_cyx4s_539",tipos_permitidos:"_tipos_permitidos_cyx4s_551",tipo_chip:"_tipo_chip_cyx4s_567",contador:"_contador_cyx4s_589",boton_elegir:"_boton_elegir_cyx4s_609",zona_arrastrando:"_zona_arrastrando_cyx4s_675",drag_icon_wrap:"_drag_icon_wrap_cyx4s_707",drag_ring:"_drag_ring_cyx4s_725",drag_ring_2:"_drag_ring_2_cyx4s_749",drag_ring_3:"_drag_ring_3_cyx4s_757",drag_icono:"_drag_icono_cyx4s_789",drag_textos:"_drag_textos_cyx4s_841",drag_titulo:"_drag_titulo_cyx4s_857",drag_subtitulo:"_drag_subtitulo_cyx4s_871",drag_chips:"_drag_chips_cyx4s_885",drag_chip:"_drag_chip_cyx4s_885",banner_limite:"_banner_limite_cyx4s_953",banner_limite_icono:"_banner_limite_icono_cyx4s_973",banner_limite_cuerpo:"_banner_limite_cuerpo_cyx4s_983",banner_limite_titulo:"_banner_limite_titulo_cyx4s_999",banner_limite_desc:"_banner_limite_desc_cyx4s_1011",banner_limite_pill:"_banner_limite_pill_cyx4s_1021",seccion_lista:"_seccion_lista_cyx4s_1041",cabecera_lista:"_cabecera_lista_cyx4s_1057",cabecera_titulo:"_cabecera_titulo_cyx4s_1071",lista_vacia:"_lista_vacia_cyx4s_1085",ilustracion_vacia:"_ilustracion_vacia_cyx4s_1103",lista_vacia_titulo:"_lista_vacia_titulo_cyx4s_1115",lista_vacia_desc:"_lista_vacia_desc_cyx4s_1127",lista:"_lista_cyx4s_1085",fila:"_fila_cyx4s_1251",fila_eliminada:"_fila_eliminada_cyx4s_1289",fila_subiendo:"_fila_subiendo_cyx4s_1289",fila_entrando:"_fila_entrando_cyx4s_1299",fila_saliendo:"_fila_saliendo_cyx4s_1307",fila_nombre:"_fila_nombre_cyx4s_1341",fila_restaurando:"_fila_restaurando_cyx4s_1401",fila_icono:"_fila_icono_cyx4s_1409",fila_error:"_fila_error_cyx4s_1421",fila_aviso:"_fila_aviso_cyx4s_1429",fila_cuerpo:"_fila_cuerpo_cyx4s_1437",fila_error_texto:"_fila_error_texto_cyx4s_1453",estado:"_estado_cyx4s_1479",estado_guardado:"_estado_guardado_cyx4s_1495",estado_nuevo:"_estado_nuevo_cyx4s_1505",estado_subiendo:"_estado_subiendo_cyx4s_1515",estado_eliminado:"_estado_eliminado_cyx4s_1537",fila_acciones:"_fila_acciones_cyx4s_1557",btn_eliminar:"_btn_eliminar_cyx4s_1569",btn_restaurar:"_btn_restaurar_cyx4s_1631",btn_reintentar:"_btn_reintentar_cyx4s_1699",spinner:"_spinner_cyx4s_1743",pie:"_pie_cyx4s_1765",pie_info:"_pie_info_cyx4s_1783",btn_pie:"_btn_pie_cyx4s_1795",input_archivo:"_input_archivo_cyx4s_1803"},$0={pdf:"application/pdf",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",avif:"image/avif",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",csv:"text/csv",rar:"application/x-rar-compressed",zip:"application/zip","7z":"application/x-7z-compressed"},O0={"image/jpeg":"JPG","image/png":"PNG","image/webp":"WEBP","image/gif":"GIF","image/avif":"AVIF","application/pdf":"PDF","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","text/csv":"CSV","application/zip":"ZIP","application/x-rar-compressed":"RAR","application/x-7z-compressed":"7Z"},D0={JPG:"#10b981",PNG:"#6366f1",WEBP:"#06b6d4",GIF:"#ec4899",AVIF:"#8b5cf6",PDF:"#ef4444",XLS:"#22c55e",XLSX:"#16a34a",CSV:"#4ade80",ZIP:"#f59e0b",RAR:"#f97316","7Z":"#fb923c"};function L0(e){if(!e.length)return;const t=new Set;return e.forEach(r=>{t.add(`.${r}`);const a=$0[r];a&&t.add(a)}),[...t].join(",")}let P0=0;function Yc(){return`fs_${Date.now()}_${++P0}`}const z0=300,Zc=["pending","saved","uploading"];function B0({savedFiles:e,maxFiles:t,maxSizeMB:r,allowedTypes:a,subiendo:o}){const[s,i]=_.useState(()=>e.map(p=>({id:p.id??Yc(),name:p.name,file:null,url:p.url,status:"saved"}))),c=s.filter(p=>Zc.includes(p.status)).length,l=t!==1/0&&c>=t,d=o||l,h=s.some(p=>p.status==="pending"||p.status==="deleted"&&p.url),g=_.useCallback(p=>{if(d)return;const m=[];let w=t===1/0?1/0:t-c;const b=new Set(s.filter(E=>Zc.includes(E.status)).map(E=>E.name.toLowerCase()));for(const E of p){const S=E.name.split(".").pop()?.toLowerCase()??"",C={id:Yc(),name:E.name,file:E,entering:!0};E.size>r*1024*1024?m.push({...C,status:"error",error:"too-large"}):a.length>0&&!a.includes(S)?m.push({...C,status:"error",error:"invalid-type"}):b.has(E.name.toLowerCase())?m.push({...C,status:"error",error:"duplicate"}):w>0&&(m.push({...C,status:"pending"}),w!==1/0&&w--)}if(!m.length)return;const y=m.map(E=>E.id);i(E=>[...E,...m]),setTimeout(()=>{i(E=>E.map(S=>y.includes(S.id)?{...S,entering:!1}:S))},400)},[d,t,c,r,a,s]),f=_.useCallback(p=>{i(m=>{const w=m.find(b=>b.id===p);return w?w.status==="error"||w.status==="pending"?(setTimeout(()=>i(b=>b.filter(y=>y.id!==p)),z0),m.map(b=>b.id===p?{...b,saliendo:!0}:b)):m.map(b=>b.id===p?{...b,status:"deleted",prevStatus:b.status}:b):m})},[]),u=_.useCallback(p=>{i(m=>m.map(w=>w.id===p?{...w,status:w.prevStatus??"saved",restaurando:!0}:w)),setTimeout(()=>{i(m=>m.map(w=>w.id===p?{...w,restaurando:!1}:w))},600)},[]),v=_.useCallback(p=>{i(m=>m.map(w=>w.id===p?{...w,status:"pending",error:void 0}:w))},[]);return{archivos:s,setArchivos:i,cantidadActivos:c,limiteAlcanzado:l,zonaDeshabilitada:d,hayCambios:h,agregarArchivos:g,eliminarArchivo:f,restaurarArchivo:u,reintentarArchivo:v}}function V0({archivos:e,setArchivos:t,storagePath:r,fileNameBuilder:a,firebaseStorage:o,onFilesChange:s,onUploadError:i,onUploadComplete:c,setSubiendo:l,alTerminar:d}){const h=_.useCallback(()=>{if(o&&typeof o=="object")return o;if(!Ea.getApps().length)throw new Error("Firebase no está inicializado. Inicializa la app o pasa firebaseStorage como prop.");return ut.getStorage()},[o]);return{ejecutarSubida:_.useCallback(async()=>{l(!0);const f=e.filter(y=>y.status==="pending"&&y.file),u=e.filter(y=>y.status==="deleted"&&y.url);t(y=>y.map(E=>E.status==="pending"?{...E,status:"uploading"}:E));const v=h(),p=e.filter(y=>y.status==="saved").map(y=>({id:y.id,name:y.name,url:y.url})),m=[];for(const y of f){const E=a?a(y.file):y.file.name,S=ut.ref(v,`${r}/${E}`);try{await ut.uploadBytes(S,y.file);const C=await ut.getDownloadURL(S);t(T=>T.map(F=>F.id===y.id?{...F,status:"saved",url:C}:F)),m.push({id:y.id,name:y.file.name,url:C})}catch(C){i?.(C instanceof Error?C:new Error(String(C))),t(T=>T.map(F=>F.id===y.id?{...F,status:"error",error:"network"}:F))}}const w=new Set(u.map(y=>y.id));for(const y of u)try{await ut.deleteObject(ut.ref(v,y.url))}catch(E){E?.code!=="storage/object-not-found"&&i?.(E instanceof Error?E:new Error(String(E)))}l(!1),t(y=>y.filter(E=>E.status!=="deleted"));const b=[...p.filter(y=>!w.has(y.id)),...m];s(b),c?.(b),d()},[e,t,r,a,h,i,s,c,l,d])}}const j0={jpg:"#10b981",jpeg:"#10b981",png:"#6366f1",webp:"#06b6d4",gif:"#ec4899",avif:"#8b5cf6",pdf:"#ef4444",xls:"#22c55e",xlsx:"#16a34a",csv:"#4ade80",rar:"#f97316",zip:"#f59e0b","7z":"#fb923c",tar:"#ea580c",doc:"#3b82f6",docx:"#2563eb",txt:"#64748b",md:"#475569",mp4:"#a855f7",mov:"#9333ea",avi:"#7e22ce",mp3:"#ec4899",wav:"#db2777",psd:"#0ea5e9",ai:"#f97316",svg:"#8b5cf6"};function H0(e){const t=e.split(".").pop()?.toLowerCase()??"";return j0[t]??"#94a3b8"}function U0(e){const t=e.split(".").pop()?.toLowerCase()??"";return t.length>4?t.slice(0,3).toUpperCase():t.toUpperCase()||"FILE"}function gn({nombre:e,size:t=36}){const r=H0(e),a=U0(e),o=Math.round(t*44/36);return n.jsxs("svg",{width:t,height:o,viewBox:"0 0 36 44",fill:"none","aria-hidden":"true",children:[n.jsx("rect",{x:"4",y:"5",width:"29",height:"37",rx:"5",fill:"black",fillOpacity:"0.06"}),n.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",fill:"white"}),n.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),n.jsx("path",{d:"M23 2L33 12H26C24.343 12 23 10.657 23 9V2Z",fill:"#EEF2FF"}),n.jsx("path",{d:"M23 2L33 12",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),n.jsx("rect",{x:"8",y:"17",width:"18",height:"1.5",rx:"0.75",fill:r,fillOpacity:"0.2"}),n.jsx("rect",{x:"8",y:"21",width:"14",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),n.jsx("rect",{x:"8",y:"25",width:"16",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),n.jsx("path",{d:"M3 32H33V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V32Z",fill:r}),n.jsx("text",{x:"18",y:"39.5",textAnchor:"middle",fill:"white",fontSize:"8",fontWeight:"700",fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif",letterSpacing:"0.4",children:a})]})}function Jc({size:e=24,className:t}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:t,children:n.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",children:[n.jsx("path",{strokeLinejoin:"round",d:"M2.75 12H6a2 2 0 0 1 2 2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2a2 2 0 0 1 2-2h3.25"}),n.jsx("path",{d:"M21.25 10.375v4.875a6 6 0 0 1-6 6h-6.5a6 6 0 0 1-6-6v-6.5a6 6 0 0 1 6-6h4.875"}),n.jsx("path",{strokeMiterlimit:"10",d:"M18.957 2.75v5"}),n.jsx("path",{strokeLinejoin:"round",d:"m21.25 4.855l-1.967-1.967a.46.46 0 0 0-.652 0l-1.967 1.967"})]})})}function W0({size:e=18,className:t}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:t,children:n.jsx("path",{fill:"currentColor",d:"M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"})})}function Qc({size:e=18,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),n.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})}function q0({size:e=20,className:t}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:t,children:[n.jsx("path",{fill:"currentColor",d:"M3 6.524c0-.395.327-.714.73-.714h4.788c.006-.842.098-1.995.932-2.793A3.68 3.68 0 0 1 12 2a3.68 3.68 0 0 1 2.55 1.017c.834.798.926 1.951.932 2.793h4.788c.403 0 .73.32.73.714a.72.72 0 0 1-.73.714H3.73A.72.72 0 0 1 3 6.524"}),n.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"}),n.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"})]})}function G0({size:e=16,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("path",{d:"M12 21a9 9 0 1 0-9-9",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),n.jsx("path",{d:"M3 12V7m0 5h5",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function R0({size:e=16,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.12"}),n.jsx("path",{d:"M7.5 12.5l3 3 6-6",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round"})]})}function X0({size:e=20,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.16",stroke:"currentColor",strokeWidth:"1.7"}),n.jsx("path",{d:"M12 8v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),n.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"currentColor"})]})}function el({size:e=20,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("path",{d:"M10.268 4a2 2 0 0 1 3.464 0l7.536 13A2 2 0 0 1 19.536 20H4.464a2 2 0 0 1-1.732-3L10.268 4z",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),n.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"currentColor"})]})}function K0({size:e=18,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("path",{d:"M2 12C4 7 7.5 4.5 12 4.5S20 7 22 12c-2 5-5.5 7.5-10 7.5S4 17 2 12z",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),n.jsx("circle",{cx:"12",cy:"12",r:"2.8",fill:"currentColor",fillOpacity:"0.65"}),n.jsx("circle",{cx:"12",cy:"12",r:"1.15",fill:"currentColor"})]})}function tl({size:e=18,className:t}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:[n.jsx("path",{d:"M4 17v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 4v11m0 0-3-3m3 3 3-3",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rl({className:e}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 500",className:e,"aria-hidden":"true",children:[n.jsxs("g",{children:[n.jsx("rect",{y:"382.4",width:"500",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"449.63",y:"391.22",width:"18.77",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"373.07",y:"398.08",width:"8.69",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"279.96",y:"394.63",width:"19.36",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"80.93",y:"394.5",width:"43.19",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"65.7",y:"394.5",width:"6.33",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"189.3",y:"388.58",width:"93.68",height:"0.25",style:{fill:"#e6e6e6"}}),n.jsx("rect",{x:"58.71",y:"73.68",width:"202.25",height:"144.13",style:{fill:"#fafafa"}}),n.jsx("rect",{x:"60.46",y:"73.68",width:"204.24",height:"144.13",style:{fill:"#f5f5f5"}}),n.jsx("rect",{x:"96.4",y:"48.86",width:"132.36",height:"193.76",transform:"translate(308.32 -16.84) rotate(90)",style:{fill:"#fafafa"}}),n.jsx("polygon",{points:"100.98 211.92 131.72 79.56 172.02 79.56 141.28 211.92 100.98 211.92",style:{fill:"#fff"}}),n.jsx("polygon",{points:"147.8 211.92 178.55 79.56 196.75 79.56 166 211.92 147.8 211.92",style:{fill:"#fff"}}),n.jsx("rect",{x:"192.95",y:"145.41",width:"132.36",height:"0.67",transform:"translate(404.87 -113.39) rotate(90)",style:{fill:"#fafafa"}}),n.jsx("path",{d:"M54.78,73.44v57.12H69.89S97,112.85,103.21,76.42a6.06,6.06,0,0,0-6-7.09H58.89A4.11,4.11,0,0,0,54.78,73.44Z",style:{fill:"#e0e0e0"}}),n.jsx("path",{d:"M54.78,235.44V135.17H69.89s30.67,59.05,34.22,100.27Z",style:{fill:"#e0e0e0"}}),n.jsx("rect",{x:"53.82",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",style:{fill:"#f5f5f5"}}),n.jsx("path",{d:"M269,73.44v57.12H253.86s-27.15-17.71-33.32-54.14a6.07,6.07,0,0,1,6-7.09h38.36A4.12,4.12,0,0,1,269,73.44Z",style:{fill:"#e0e0e0"}}),n.jsx("path",{d:"M269,235.44V135.17H253.86s-30.66,59.05-34.22,100.27Z",style:{fill:"#e0e0e0"}}),n.jsx("rect",{x:"252.8",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",transform:"translate(522.73 265.72) rotate(180)",style:{fill:"#f5f5f5"}}),n.jsx("rect",{x:"231.2",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#fafafa"}}),n.jsx("polygon",{points:"255.56 382.4 264.43 382.4 264.43 367.53 246.26 367.53 255.56 382.4",style:{fill:"#f4f8ff"}}),n.jsx("rect",{x:"72.22",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#e0e0e0"}}),n.jsx("rect",{x:"97.71",y:"253.66",width:"166.72",height:"123.62",style:{fill:"#fafafa"}}),n.jsx("path",{d:"M147.8,231.8c0,12,11.56,21.86,25.7,21.86h12.76c14.13,0,25.69-9.84,25.69-21.86Z",style:{fill:"#ebebeb"}}),n.jsx("path",{d:"M140.4,204.33h24s-4.17,11-4.17,17.48,18.26,31.85-7.83,31.85-7.83-25.38-7.83-31.85S140.4,204.33,140.4,204.33Z",style:{fill:"#e0e0e0"}}),n.jsx("rect",{x:"104.59",y:"261.19",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),n.jsx("polygon",{points:"106.58 382.4 97.71 382.4 97.71 367.53 115.89 367.53 106.58 382.4",style:{fill:"#fafafa"}}),n.jsx("path",{d:"M176.37,276.77a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,276.77Z",style:{fill:"#fafafa"}}),n.jsx("rect",{x:"104.59",y:"299.89",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),n.jsx("path",{d:"M176.37,315.47a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,315.47Z",style:{fill:"#fafafa"}}),n.jsx("rect",{x:"104.59",y:"338.58",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),n.jsx("circle",{cx:"181.07",cy:"354.17",r:"4.7",style:{fill:"#fafafa"}}),n.jsx("rect",{x:"295.65",y:"71.94",width:"74.23",height:"52.84",style:{fill:"#e0e0e0"}}),n.jsx("rect",{x:"299.87",y:"71.94",width:"76.07",height:"52.84",style:{fill:"#f5f5f5"}}),n.jsx("rect",{x:"316.34",y:"65.17",width:"43.14",height:"66.37",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#fff"}}),n.jsx("rect",{x:"328.9",y:"76.85",width:"18.01",height:"43.01",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#f5f5f5"}}),n.jsx("rect",{x:"384.92",y:"98.36",width:"45.18",height:"47.38",style:{fill:"#e0e0e0"}}),n.jsx("rect",{x:"389.15",y:"98.36",width:"47.03",height:"47.38",style:{fill:"#f5f5f5"}}),n.jsx("rect",{x:"393.82",y:"103.38",width:"37.68",height:"37.33",transform:"translate(534.71 -290.61) rotate(90)",style:{fill:"#fff"}}),n.jsx("path",{d:"M405.68,122.05h0a6.28,6.28,0,0,1,6.27-6.28h1.42a6.28,6.28,0,0,1,6.27,6.28h0a6.27,6.27,0,0,1-6.27,6.27H412A6.27,6.27,0,0,1,405.68,122.05Z",style:{fill:"#f5f5f5"}}),n.jsx("polygon",{points:"500 161.85 380.7 161.85 359.01 161.85 359.01 189.42 337.32 189.42 337.32 216.99 315.63 216.99 315.63 244.56 293.94 244.56 293.94 272.13 272.25 272.13 272.25 299.69 250.56 299.69 250.56 327.26 228.87 327.26 228.87 354.83 207.18 354.83 207.18 382.4 228.87 382.4 500 382.4 500 161.85",style:{fill:"#fafafa"}}),n.jsx("rect",{x:"204.95",y:"354.83",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"226.64",y:"327.26",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"248.33",y:"299.69",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"270.02",y:"272.12",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"291.71",y:"244.56",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"313.4",y:"216.99",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"335.09",y:"189.42",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("rect",{x:"356.78",y:"161.85",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),n.jsx("polygon",{points:"478.31 161.85 478.31 189.42 456.62 189.42 456.62 216.99 434.93 216.99 434.93 244.56 413.24 244.56 413.24 272.13 391.55 272.13 391.55 299.69 369.86 299.69 369.86 327.26 348.17 327.26 348.17 354.83 326.48 354.83 326.48 382.4 348.17 382.4 500 382.4 500 189.42 500 161.85 478.31 161.85",style:{fill:"#fff"}})]}),n.jsx("ellipse",{cx:"250",cy:"416.24",rx:"193.89",ry:"11.32",style:{fill:"#f5f5f5"}}),n.jsxs("g",{children:[n.jsx("path",{d:"M365.15,162c1.4,4.69,8.62,13.47,9.19,19.86s-11.74,16.61-11.74,16.61-9.2-30.76-3.44-34.35S365.15,162,365.15,162Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M339.87,195.23c-2.18,1.82-4.32,3.35-6.55,4.92s-4.53,3-6.87,4.34a77.83,77.83,0,0,1-7.25,3.79c-1.26.57-2.51,1.13-3.81,1.62-.64.26-1.29.51-1.95.73l-2,.7a13.24,13.24,0,0,1-5.26.38,30.07,30.07,0,0,1-4.36-.84,57.61,57.61,0,0,1-7.81-2.78,104.07,104.07,0,0,1-14.19-7.55l1.87-3.48c2.36,1,4.78,2,7.18,2.87s4.82,1.79,7.24,2.54a60.74,60.74,0,0,0,7.2,1.88,23.5,23.5,0,0,0,3.39.41,7.07,7.07,0,0,0,2.52-.26,64.62,64.62,0,0,0,6.68-3c1.11-.58,2.21-1.17,3.29-1.81s2.18-1.26,3.25-1.92c2.15-1.33,4.25-2.74,6.33-4.19s4.15-3,6-4.47Z",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M345.15,184.58c-2.48-1.94-12.74,4.41-15.85,7.06l2.27,13.73s14.75-6.18,15.63-10.4C348.13,190.56,347,186.06,345.15,184.58Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),n.jsx("polygon",{points:"385.58 406.47 377.79 407.05 374.94 389.12 382.73 388.54 385.58 406.47",style:{fill:"#e58a7b"}}),n.jsx("polygon",{points:"440.68 381.41 434.07 385.57 422.3 371.61 428.91 367.44 440.68 381.41",style:{fill:"#e58a7b"}}),n.jsx("polygon",{points:"374.94 389.12 376.52 399.08 384.2 397.79 382.74 388.55 374.94 389.12",style:{fill:"#cf6f64"}}),n.jsx("polygon",{points:"428.92 367.45 422.3 371.61 427.18 377.39 433.94 373.4 428.92 367.45",style:{fill:"#cf6f64"}}),n.jsx("path",{d:"M349,232.2s-.11,61.82,4.94,85.1c5.26,24.22,20.73,79.32,20.73,79.32l11.22-1.45s-8.77-55.66-12.51-79.73c-4.07-26.23-1.57-87.68-1.57-87.68Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),n.jsx("path",{d:"M371.11,255.16l-5.5-5.48c.21,23.75,1.54,35.48,6.11,48.26C371,284.43,370.94,268.45,371.11,255.16Z",style:{opacity:.5}}),n.jsx("path",{d:"M356.74,230.6s16.77,51.09,25.09,80.52c8.78,31.05,42.44,65.39,42.44,65.39l9.66-5.58s-23-32.6-31.46-61.57c-17.2-58.81-10.13-71.27-22.82-83.23Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),n.jsx("path",{d:"M343.56,147.09c4.46,1.49,8.51,12.56,8.68,16.92s-12.92,10.37-12.92,10.37-5.77-14-4.16-23C335.86,147.47,343.56,147.09,343.56,147.09Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M282.35,197.43l-5.29-5.76-1.73,7.22s3.76,3.32,6.8,2.18Z",style:{fill:"#e58a7b"}}),n.jsx("polygon",{points:"271.7 190.02 268 192.96 275.33 198.89 277.06 191.67 271.7 190.02",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M432,384.08l6.18-6.23a.63.63,0,0,1,.82-.06l5.63,4.18a1.25,1.25,0,0,1,.11,1.87c-2.2,2.13-3.36,3.05-6.08,5.79-1.67,1.69-3.94,4.32-6.25,6.65s-4.74.16-4-1c3.37-5.27,2.77-7.24,3-9.92A2,2,0,0,1,432,384.08Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M377.27,405.93h8.78a.66.66,0,0,1,.65.54l1.38,6.94a1.18,1.18,0,0,1-1.17,1.39c-3.07-.05-4.55-.23-8.41-.23-2.37,0-7.27.24-10.55.24s-3.63-3.24-2.28-3.53c6-1.32,8.35-3.13,10.32-4.87A2,2,0,0,1,377.27,405.93Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M349.81,161.79c3.41,2.85,8.36,7,14.19,2.15,5-4.18,8.5-15.15-.47-15.55C358.84,148.18,349.81,161.79,349.81,161.79Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M358.05,163.74c0,4.72.73,13.23,4.5,15.65,0,0-.34,4.86-8.8,6.5-9.29,1.81-5.34-3.75-5.34-3.75,4.84-2.2,4-5.94,2.4-9.3Z",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M355.1,167.45l-4.28,5.39a15.19,15.19,0,0,1,.92,2.42c1.88-.66,4.13-3.3,3.94-5.37A6.83,6.83,0,0,0,355.1,167.45Z",style:{fill:"#cf6f64"}}),n.jsx("path",{d:"M358.5,152.9c1,7.69,1.61,10.92-1.47,15.57-4.63,7-14.29,6.55-17.58-.68-3-6.51-4.12-18,2.72-22.45A10.57,10.57,0,0,1,358.5,152.9Z",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M345.14,139.43c-5.2,3.69,5.23,4.78,5.24,10.13,0,2.21,3.63,9.22,8.79,8.82l5-8.88C369.43,141,357,131,345.14,139.43Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M345.14,139.43c-9.15-.48-13.14,6.8-12.09,13.34a59.6,59.6,0,0,1,19.54-1.55C365.13,152.5,345.14,139.43,345.14,139.43Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M361,159.53a5.65,5.65,0,0,1-1.31,4.12c-1.29,1.51-3,.62-3.6-1.17-.51-1.62-.45-4.35,1.29-5.21A2.55,2.55,0,0,1,361,159.53Z",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M347.39,157.27c.12.62-.11,1.18-.51,1.26s-.83-.36-.95-1,.11-1.19.51-1.27S347.27,156.65,347.39,157.27Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M340.4,158.63c.12.62-.11,1.19-.51,1.27s-.83-.36-.95-1,.11-1.19.51-1.26S340.28,158,340.4,158.63Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M342.46,159.34a17.1,17.1,0,0,1-1.44,4.37,2.71,2.71,0,0,0,2.29,0Z",style:{fill:"#df5753"}}),n.jsx("path",{d:"M345.92,165.71a.18.18,0,0,1-.18-.15.18.18,0,0,1,.15-.21,5,5,0,0,0,3.62-2.7.18.18,0,1,1,.34.14,5.27,5.27,0,0,1-3.89,2.92Z",style:{fill:"#263238"}}),n.jsx("path",{d:"M353.5,192.54c-16.73,3.73-11.56-6.39-10.56-8.62l.42-.16c2-.73,2.4-.84,5.06-1.62a100.71,100.71,0,0,1,14.14-2.75l1-.14c1-.13,1.91-.23,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.12h0C370.56,180.23,371.39,188.57,353.5,192.54Z",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M379.76,224.21l1.95,2.52c.15.19-.06.46-.42.53l-32.66,6.36c-.28.06-.54,0-.59-.21l-.83-2.73c0-.19.16-.4.46-.46l31.54-6.14A.57.57,0,0,1,379.76,224.21Z",style:{fill:"#26395a"}}),n.jsx("path",{d:"M376.21,228.56l.85-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55C375.88,228.54,376.05,228.6,376.21,228.56Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M357.08,240.36l-6.51-2.42,1,6.19s4.72,1.7,7.13-.48Z",style:{fill:"#e58a7b"}}),n.jsx("polygon",{points:"344.37 239.58 342.82 243.64 351.57 244.13 350.57 237.94 344.37 239.58",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M351.06,233.46l.85-.16c.16,0,.28-.14.24-.25l-1.1-3.54c0-.11-.19-.16-.36-.13l-.85.16c-.17,0-.28.15-.24.25l1.1,3.55C350.73,233.44,350.89,233.5,351.06,233.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M363.64,231l.84-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55A.32.32,0,0,0,363.64,231Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M355.27,165.13c-2,3.31,5.25,4.84,9.54,1.45,3.43-2.72,2.62-9-.32-10.46S355.27,165.13,355.27,165.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.4}}),n.jsx("path",{d:"M379.66,226.13l-31.14,6.07c-16.09-43.57-12.59-45-12.59-45a62.53,62.53,0,0,1,7-3.3l.42-.16c2-.73,2.4-.84,5.06-1.62,4.58-1.09,8.85-2,14.14-2.75l1-.14c1-.12,1.91-.22,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.11c3.42-.17,5.87-.12,5.87-.12C375.13,205.75,376.67,213.56,379.66,226.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),n.jsx("path",{d:"M377.09,194.31l-4.8,2.86L377.83,218C376.62,211.69,377.16,204.76,377.09,194.31Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.27,mixBlendMode:"multiply"}}),n.jsx("polygon",{points:"387.9 395.13 372.62 397.11 371.62 392.85 387.53 389.48 387.9 395.13",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("polygon",{points:"434.74 370.59 423.47 377.1 419.67 373.85 432 365.51 434.74 370.59",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M381.85,189.13c.54,2.78.85,5.4,1.15,8.11s.41,5.39.49,8.1a80.09,80.09,0,0,1-.18,8.19c-.11,1.37-.23,2.74-.42,4.12-.08.68-.17,1.37-.3,2.06l-.37,2.12a13.32,13.32,0,0,1-2.21,4.79,29.67,29.67,0,0,1-2.84,3.41,56.66,56.66,0,0,1-6.2,5.5,103.64,103.64,0,0,1-13.46,8.79L355.37,241c2-1.59,4-3.23,6-4.9s3.9-3.36,5.73-5.12a62.64,62.64,0,0,0,5.11-5.39,23.76,23.76,0,0,0,2-2.78,7,7,0,0,0,1-2.33,66.19,66.19,0,0,0,.57-7.32c0-1.25,0-2.5,0-3.75s-.05-2.52-.11-3.78c-.12-2.52-.35-5-.62-7.56s-.62-5.09-1-7.46Z",style:{fill:"#e58a7b"}}),n.jsx("path",{d:"M380.64,180.63c4.27,3.46,3.25,13.74,3.25,13.74l-14.4,4.74s.66-11.85,1.38-16.11C371.71,177.93,376.43,177.22,380.64,180.63Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),n.jsx("path",{d:"M429.68,387.71a1.06,1.06,0,0,1-.86-.48.63.63,0,0,1-.11-.62c.35-.94,3.11-1.54,3.42-1.61a.19.19,0,0,1,.19.08.17.17,0,0,1,0,.2c-.54.89-1.6,2.38-2.59,2.43Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M431.32,385.46c-1,0-2.25-.25-2.62-.79a.65.65,0,0,1,.07-.81,1,1,0,0,1,.73-.38h.08c1.12,0,2.66,1.51,2.72,1.57a.18.18,0,0,1,.05.18.19.19,0,0,1-.13.13A3.61,3.61,0,0,1,431.32,385.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M374.4,407.3a3,3,0,0,1-1.91-.48,1,1,0,0,1-.38-.89.58.58,0,0,1,.28-.5c.92-.54,4.14,1.06,4.5,1.24a.19.19,0,0,1,.1.19.19.19,0,0,1-.14.16A13.33,13.33,0,0,1,374.4,407.3Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M376.81,407h-.07c-1-.43-2.93-2.13-2.79-3,0-.2.18-.46.68-.51h.15c1.74,0,2.19,3.18,2.21,3.32a.2.2,0,0,1-.07.18A.2.2,0,0,1,376.81,407Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M360.08,175.42c.71-.27,1.6,2.23,1.38,2.55-.51.73-9.85,3.28-10.27,1.85a6.24,6.24,0,0,1,.35-2.28C351.81,177.06,353.88,177.94,360.08,175.42Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M358.5,175.48c.36-.83,1.39-2.16,2.29-1.4s1.28,2.4.69,2.67S357.88,176.87,358.5,175.48Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M360.41,175.91c.62-.66,2-1.57,2.63-.55s.4,2.69-.24,2.74S359.36,177,360.41,175.91Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M360.75,175.76a2.77,2.77,0,0,1,1.39-2.67c1.14-.74,2.25-1.22,2.69-2a5.52,5.52,0,0,1,.11,2.24c-.23,1.07-3.78,1.89-3.54,2.82Z",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M360.6,175.71a2.77,2.77,0,0,1-.28-3c.54-1.24,1.22-2.24,1.18-3.12a5.57,5.57,0,0,1,1.31,1.82c.38,1-2.15,3.63-1.44,4.29Z",style:{fill:"var(--brand-primary, #407BFF)"}})]}),n.jsxs("g",{children:[n.jsx("path",{d:"M190.41,223.53h0A11,11,0,0,0,179.69,215h-80a11,11,0,0,0-11,11V403.82a11,11,0,0,0,11,11h254a11,11,0,0,0,11-11V254.45a11,11,0,0,0-11-11H215.44A25.68,25.68,0,0,1,190.41,223.53Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),n.jsx("path",{d:"M162.17,168.15l7.13,23.09a11.61,11.61,0,0,0,14.51,7.66l23.08-7.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),n.jsx("path",{d:"M162.17,168.15l-82.5,25.49A11.59,11.59,0,0,0,72,208.14l47.1,152.48a11.6,11.6,0,0,0,14.51,7.66L239.2,335.66a11.59,11.59,0,0,0,7.66-14.5l-40-129.39Z",style:{fill:"#fff",opacity:.8}}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M206.56,329l-68.64,21.2a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.33l68.64-21.21a5.08,5.08,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,206.56,329Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M132.69,204.58l-36.3,11.21a5.09,5.09,0,0,1-6.34-3.34h0a5.09,5.09,0,0,1,3.35-6.34l36.3-11.21a5.07,5.07,0,0,1,6.34,3.34h0A5.09,5.09,0,0,1,132.69,204.58Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M162.31,216.47l-60,18.53A5.08,5.08,0,0,1,96,231.65h0a5.07,5.07,0,0,1,3.34-6.33l60-18.53a5.08,5.08,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,162.31,216.47Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M195.81,227.16l-87.56,27a5.07,5.07,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l87.56-27a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,195.81,227.16Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M201.74,246.36l-50.9,15.73a5.08,5.08,0,0,1-6.33-3.35h0a5.08,5.08,0,0,1,3.34-6.33l50.9-15.73a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,201.74,246.36Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M127.5,269.3l-13.31,4.11a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.34l13.31-4.11a5.09,5.09,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,127.5,269.3Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M207.68,265.57l-87.56,27.05a5.08,5.08,0,0,1-6.33-3.35h0a5.07,5.07,0,0,1,3.34-6.33l87.56-27.05a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,207.68,265.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M179.82,295.21l-53.77,16.61a5.08,5.08,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l53.77-16.61a5.09,5.09,0,0,1,6.34,3.35h0A5.07,5.07,0,0,1,179.82,295.21Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M213.61,284.78l-14.35,4.43a5.09,5.09,0,0,1-6.34-3.35h0a5.08,5.08,0,0,1,3.35-6.33l14.35-4.43a5.07,5.07,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,213.61,284.78Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.28},children:n.jsx("path",{d:"M219.54,304l-87.55,27.05a5.08,5.08,0,0,1-6.34-3.35h0a5.07,5.07,0,0,1,3.35-6.33l87.55-27.05a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,219.54,304Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("path",{d:"M221.42,110.81l26.18,58.34a6.31,6.31,0,0,1-3.16,8.32L133.38,227.32a6.3,6.3,0,0,1-8.32-3.16L98.87,165.82a6.3,6.3,0,0,1,3.16-8.33l111.06-49.85a6.32,6.32,0,0,1,8.33,3.17Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.3}}),n.jsx("rect",{x:"200.4",y:"108.68",width:"3.89",height:"1",transform:"translate(-26.96 92.38) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("rect",{x:"184",y:"114.19",width:"12.13",height:"1",transform:"translate(-30.29 87.83) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("rect",{x:"99.33",y:"171.59",width:"1",height:"7.4",transform:"translate(-63.04 56.26) rotate(-24.18)",style:{fill:"var(--brand-primary, #407BFF)"}}),n.jsx("path",{d:"M217.7,107.43l-28.64,56.1a25.65,25.65,0,0,1-29.3,13.15L98.81,160.79a6.39,6.39,0,0,1,3.22-3.3l111.06-49.85A6.3,6.3,0,0,1,217.7,107.43Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),n.jsx("path",{d:"M257.07,179.23l-86.18,5.32A11.6,11.6,0,0,0,160,196.84l9.83,159.28A11.6,11.6,0,0,0,182.14,367l110.3-6.81a11.58,11.58,0,0,0,10.86-12.29L295,212.73Z",style:{fill:"#fff",opacity:.8}}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M262.28,346l-71.71,4.43a5.08,5.08,0,0,1-5.36-4.75h0a5.09,5.09,0,0,1,4.74-5.37l71.71-4.42a5.08,5.08,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,262.28,346Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M219.84,207.68l-37.93,2.34a5.09,5.09,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l37.93-2.34a5.07,5.07,0,0,1,5.36,4.74h0A5.08,5.08,0,0,1,219.84,207.68Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M245.82,226.22l-62.67,3.86a5.07,5.07,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.75-5.37l62.66-3.86a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,245.82,226.22Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M275.85,244.51l-91.46,5.64A5.09,5.09,0,0,1,179,245.4h0a5.07,5.07,0,0,1,4.74-5.36l91.47-5.65a5.08,5.08,0,0,1,5.36,4.75h0A5.08,5.08,0,0,1,275.85,244.51Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M277.09,264.57l-53.17,3.28a5.08,5.08,0,0,1-5.37-4.74h0a5.07,5.07,0,0,1,4.74-5.37l53.17-3.28a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,277.09,264.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M199.53,269.35l-13.91.86a5.07,5.07,0,0,1-5.36-4.74h0A5.08,5.08,0,0,1,185,260.1l13.91-.86a5.09,5.09,0,0,1,5.37,4.75h0A5.08,5.08,0,0,1,199.53,269.35Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M278.33,284.63l-91.47,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l91.46-5.64a5.08,5.08,0,0,1,5.37,4.75h0A5.07,5.07,0,0,1,278.33,284.63Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M244.27,306.87l-56.17,3.47a5.09,5.09,0,0,1-5.37-4.75h0a5.08,5.08,0,0,1,4.75-5.36l56.17-3.47a5.08,5.08,0,0,1,5.36,4.75h0A5.06,5.06,0,0,1,244.27,306.87Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M279.56,304.7l-15,.92a5.07,5.07,0,0,1-5.36-4.74h0a5.07,5.07,0,0,1,4.74-5.37l15-.92a5.07,5.07,0,0,1,5.37,4.74h0A5.09,5.09,0,0,1,279.56,304.7Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("g",{style:{opacity:.22},children:n.jsx("path",{d:"M280.8,324.76l-91.46,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.74-5.37l91.47-5.64a5.07,5.07,0,0,1,5.36,4.74h0A5.07,5.07,0,0,1,280.8,324.76Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),n.jsx("path",{d:"M257.07,179.23l1.49,24.12a11.6,11.6,0,0,0,12.29,10.87L295,212.73Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),n.jsx("path",{d:"M228.85,239.4h0a8.65,8.65,0,0,0-9-8.53H139.75c-6.07,0-12,4.93-13.14,11L95,403.82c-1.18,6.07,2.78,11,8.85,11h254c6.07,0,11.95-4.92,13.14-11l26.07-133.5c1.18-6.08-2.78-11-8.85-11H250C238,259.32,229.26,251.06,228.85,239.4Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.5}})]})]})}const Y0={network:"Error de red al subir","too-large":"Supera el límite de tamaño permitido","invalid-type":"Tipo de archivo no permitido",duplicate:"Ya existe un archivo con este nombre"};function Z0({status:e}){return e==="saved"?n.jsx("span",{className:`${ie.estado} ${ie.estado_guardado}`,children:"Guardado"}):e==="pending"?n.jsx("span",{className:`${ie.estado} ${ie.estado_nuevo}`,children:"Nuevo"}):e==="uploading"?n.jsx("span",{className:`${ie.estado} ${ie.estado_subiendo}`,children:"Subiendo…"}):e==="deleted"?n.jsx("span",{className:`${ie.estado} ${ie.estado_eliminado}`,children:"Eliminado"}):null}function J0({archivo:e,alEliminar:t,alRestaurar:r,alReintentar:a,subiendo:o,disableDeleteSaved:s}){const{id:i,name:c,status:l,error:d,entering:h,saliendo:g,restaurando:f}=e,u=l==="deleted",v=l==="uploading",p=l==="error",m=p&&d==="too-large",b=l==="saved"&&s,y=[ie.fila,h&&ie.fila_entrando,g&&ie.fila_saliendo,u&&ie.fila_eliminada,v&&ie.fila_subiendo,p&&ie.fila_error,m&&ie.fila_aviso,f&&ie.fila_restaurando].filter(Boolean).join(" ");return n.jsxs("li",{className:y,children:[n.jsx("span",{className:ie.fila_icono,children:v?n.jsx("span",{className:ie.spinner,"aria-hidden":"true"}):p?m?n.jsx(el,{size:20}):n.jsx(X0,{size:20}):n.jsx(gn,{nombre:c,size:30})}),n.jsxs("div",{className:ie.fila_cuerpo,children:[n.jsx("span",{className:ie.fila_nombre,title:c,children:c}),p?n.jsxs("span",{className:ie.fila_error_texto,children:[Y0[d],d==="network"&&n.jsx("button",{type:"button",className:ie.btn_reintentar,onClick:()=>a(i),children:"Reintentar"})]}):n.jsx(Z0,{status:l})]}),n.jsx("div",{className:ie.fila_acciones,children:u?n.jsxs("button",{type:"button",className:ie.btn_restaurar,onClick:()=>r(i),disabled:o,"aria-label":`Restaurar ${c}`,children:[n.jsx(G0,{size:14}),"Restaurar"]}):!g&&!b&&n.jsx("button",{type:"button",className:ie.btn_eliminar,onClick:()=>t(i),disabled:v||o,"aria-label":`Eliminar ${c}`,title:"Eliminar",children:n.jsx(q0,{size:18})})})]})}const Q0=["pdf","jpg","jpeg","png"],e_=50;function t_({onClose:e,storagePath:t,onFilesChange:r,title:a="Importar archivos",subtitle:o,savedFiles:s=[],fileNameBuilder:i,maxFiles:c=1/0,allowedTypes:l=Q0,maxSizeMB:d=e_,confirmation:h,firebaseStorage:g,onUploadError:f,onUploadComplete:u,disableDeleteSaved:v=!1,id:p,"data-testid":m}){const w=_.useRef(null),b=_.useRef(0),y=_.useId(),E=p??`file-stage-${y}`,S=`${E}-titulo`,C=o?`${E}-subtitulo`:void 0,[T,F]=_.useState(!1),[D,M]=_.useState(!1),[U,V]=_.useState(!1),[N,k]=_.useState([]),[A,O]=_.useState(!1),[$,x]=_.useState(!1),I=_.useCallback(()=>{D||$||(M(!0),F(!1),setTimeout(e,450))},[D,$,e]),{archivos:L,setArchivos:X,cantidadActivos:H,limiteAlcanzado:z,zonaDeshabilitada:q,hayCambios:B,agregarArchivos:K,eliminarArchivo:Y,restaurarArchivo:Q,reintentarArchivo:ee}=B0({savedFiles:s,maxFiles:c,maxSizeMB:d,allowedTypes:l,subiendo:$}),{ejecutarSubida:se}=V0({archivos:L,setArchivos:X,storagePath:t,fileNameBuilder:i,firebaseStorage:g,onFilesChange:r,onUploadError:f,onUploadComplete:u,setSubiendo:x,alTerminar:I});_.useEffect(()=>{const P=requestAnimationFrame(()=>F(!0));return()=>cancelAnimationFrame(P)},[]),_.useEffect(()=>{const P=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",P>0&&(document.body.style.paddingRight=`${P}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[]),_.useEffect(()=>{const P=G=>{G.key==="Escape"&&!D&&!$&&!A&&I()};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)});const ce=L0(l),ae=P=>{if(P.preventDefault(),q)return;b.current++,V(!0);const G=[];if(P.dataTransfer.items)for(let W=0;W<Math.min(P.dataTransfer.items.length,4);W++){const re=P.dataTransfer.items[W];if(re.kind==="file"){const le=O0[re.type];le&&!G.includes(le)&&G.push(le)}}k(G)},de=P=>{P.preventDefault()},oe=P=>{P.preventDefault(),b.current--,b.current<=0&&(b.current=0,V(!1),k([]))},fe=P=>{P.preventDefault(),b.current=0,V(!1),k([]),!q&&K(Array.from(P.dataTransfer.files))},pe=P=>{K(Array.from(P.target.files??[])),P.target.value=""},te=()=>{!B||$||(h?O(!0):se())},ue=()=>{O(!1),se()},ge=P=>{P.target===P.currentTarget&&!$&&I()},ve=[ie.zona_carga,U&&ie.zona_carga_activa,($||z)&&ie.zona_carga_deshabilitada].filter(Boolean).join(" "),J=l.map(P=>P.toUpperCase());return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`${ie.backdrop} ${T&&!D?ie.visible:""}`,onClick:ge,children:[n.jsxs("div",{id:E,className:`${ie.modal} ${T&&!D?ie.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":S,"aria-describedby":C,"data-testid":m??E,children:[n.jsxs("header",{className:ie.encabezado,children:[n.jsxs("div",{className:ie.encabezado_textos,children:[n.jsx("h2",{id:S,className:ie.titulo,children:a}),o&&n.jsx("p",{id:C,className:ie.subtitulo,children:o})]}),n.jsxs("button",{className:ie.boton_cerrar,onClick:I,type:"button","aria-label":"Cerrar",disabled:$,children:[n.jsx("span",{className:ie.texto_esc,children:"ESC"}),n.jsx(Qc,{size:16})]})]}),n.jsxs("div",{className:ie.cuerpo,children:[n.jsxs("div",{className:ve,"aria-label":"Zona para arrastrar archivos",onDragEnter:ae,onDragOver:de,onDragLeave:oe,onDrop:fe,children:[n.jsxs("div",{className:ie.zona_contenido,children:[n.jsx("div",{className:ie.zona_icono_flotante,"aria-hidden":"true",children:n.jsx(Jc,{size:52})}),n.jsxs("div",{className:ie.zona_textos,children:[n.jsx("p",{className:ie.zona_titulo,children:"Arrastra archivos aquí"}),n.jsx("span",{className:ie.zona_separador,children:"o"}),n.jsxs("button",{className:ie.boton_elegir,type:"button",disabled:$,onClick:P=>{P.stopPropagation(),w.current?.click()},children:[n.jsx(W0,{size:16}),"Elegir archivos"]})]}),n.jsxs("div",{className:ie.zona_meta,children:[n.jsxs("div",{className:ie.tipos_permitidos,children:[n.jsx("span",{className:ie.zona_meta_label,children:"Permitido:"}),J.map(P=>n.jsx("span",{className:ie.tipo_chip,children:P},P))]}),n.jsx("span",{className:ie.zona_meta_sep,children:"|"}),n.jsxs("span",{className:ie.zona_meta_tam,children:["Máx. ",d," MB"]}),c!==1/0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:ie.zona_meta_sep,children:"|"}),n.jsxs("span",{className:ie.contador,children:[n.jsx("strong",{children:H}),"/",c]})]})]})]}),U&&n.jsxs("div",{className:ie.zona_arrastrando,children:[n.jsxs("div",{className:ie.drag_icon_wrap,"aria-hidden":"true",children:[n.jsx("span",{className:ie.drag_ring}),n.jsx("span",{className:`${ie.drag_ring} ${ie.drag_ring_2}`}),n.jsx("span",{className:`${ie.drag_ring} ${ie.drag_ring_3}`}),n.jsx("span",{className:ie.drag_icono,children:n.jsx(Jc,{size:28})})]}),n.jsxs("div",{className:ie.drag_textos,children:[n.jsx("p",{className:ie.drag_titulo,children:"Suelta para agregar"}),n.jsx("p",{className:ie.drag_subtitulo,children:"Los archivos se agregarán a la lista"})]}),N.length>0&&n.jsx("div",{className:ie.drag_chips,children:N.map((P,G)=>n.jsx("span",{className:ie.drag_chip,style:{"--chip-color":D0[P]??"#94a3b8","--chip-delay":`${G*60}ms`},children:P},P))})]})]}),z&&n.jsxs("div",{className:ie.banner_limite,role:"status",children:[n.jsx("span",{className:ie.banner_limite_icono,children:n.jsx(el,{size:20})}),n.jsxs("div",{className:ie.banner_limite_cuerpo,children:[n.jsx("span",{className:ie.banner_limite_titulo,children:"Límite alcanzado"}),n.jsx("span",{className:ie.banner_limite_desc,children:"Elimina un archivo para poder agregar otro"})]}),n.jsxs("span",{className:ie.banner_limite_pill,children:[H,"/",c]})]}),n.jsxs("div",{className:ie.seccion_lista,children:[L.length>0&&n.jsx("div",{className:ie.cabecera_lista,children:n.jsx("span",{className:ie.cabecera_titulo,children:"Archivos"})}),L.length===0?n.jsxs("div",{className:ie.lista_vacia,children:[n.jsx(rl,{className:ie.ilustracion_vacia}),n.jsx("span",{className:ie.lista_vacia_titulo,children:"Aún no hay archivos"}),n.jsx("span",{className:ie.lista_vacia_desc,children:"Arrastra o elige archivos para comenzar"})]}):n.jsx("ul",{className:ie.lista,children:L.map(P=>n.jsx(J0,{archivo:P,subiendo:$,alEliminar:Y,alRestaurar:Q,alReintentar:ee,disableDeleteSaved:v},P.id))})]})]}),n.jsxs("footer",{className:ie.pie,children:[n.jsx("span",{className:ie.pie_info,children:c===1/0?`${H} archivo${H!==1?"s":""}`:`${H} de ${c} archivos`}),n.jsx(Ye,{variant:"light-active",color:"primary",size:"sm",radius:"lg",className:ie.btn_pie,onClick:te,isDisabled:!B,isLoading:$,children:$?"Actualizando…":"Actualizar archivos"})]})]}),n.jsx("input",{ref:w,type:"file",multiple:!0,accept:ce,className:ie.input_archivo,onChange:pe,"aria-hidden":"true",tabIndex:-1})]}),h&&n.jsx(pn,{isOpen:A,tipo:"advertencia",titulo:h.title,mensaje:h.message,textoConfirmar:h.confirmText??"Confirmar",loadingConfirmar:$,onConfirmar:ue,onCancelar:()=>O(!1)})]})}const xe={backdrop:"_backdrop_165ct_1",visible:"_visible_165ct_41",modal:"_modal_165ct_65",encabezado:"_encabezado_165ct_147",encabezado_textos:"_encabezado_textos_165ct_163",titulo:"_titulo_165ct_177",subtitulo:"_subtitulo_165ct_191",boton_cerrar:"_boton_cerrar_165ct_203",texto_esc:"_texto_esc_165ct_253",btn_volver:"_btn_volver_165ct_269",preview_nombre_header:"_preview_nombre_header_165ct_323",cuerpo_deslizante:"_cuerpo_deslizante_165ct_351",panel_lista:"_panel_lista_165ct_369",panel_oculto:"_panel_oculto_165ct_395",panel_preview:"_panel_preview_165ct_407",panel_visible:"_panel_visible_165ct_429",preview_contenido:"_preview_contenido_165ct_441",preview_imagen:"_preview_imagen_165ct_465",preview_imagen_cargando:"_preview_imagen_cargando_165ct_483",preview_loader:"_preview_loader_165ct_491",spinner_preview:"_spinner_preview_165ct_511",preview_iframe:"_preview_iframe_165ct_529",preview_placeholder:"_preview_placeholder_165ct_545",cabecera_lista:"_cabecera_lista_165ct_579",cabecera_titulo:"_cabecera_titulo_165ct_593",cabecera_etiqueta:"_cabecera_etiqueta_165ct_607",lista_vacia:"_lista_vacia_165ct_617",ilustracion_vacia:"_ilustracion_vacia_165ct_635",lista_vacia_titulo:"_lista_vacia_titulo_165ct_647",lista_vacia_desc:"_lista_vacia_desc_165ct_659",lista:"_lista_165ct_617",fila:"_fila_165ct_691",fila_icono:"_fila_icono_165ct_731",fila_cuerpo:"_fila_cuerpo_165ct_743",fila_nombre:"_fila_nombre_165ct_757",fila_acciones:"_fila_acciones_165ct_775",btn_accion:"_btn_accion_165ct_789",btn_descargado:"_btn_descargado_165ct_849",spinner:"_spinner_165ct_511",pie:"_pie_165ct_907",pie_info:"_pie_info_165ct_925"},r_={jpg:"image",jpeg:"image",png:"image",webp:"image",gif:"image",avif:"image",pdf:"pdf",xls:"excel",xlsx:"excel",csv:"excel",rar:"archive",zip:"archive","7z":"archive",tar:"archive"};function nl(e){const t=e.split(".").pop()?.toLowerCase()??"";return r_[t]??"generic"}function Uo(e){return e.id??e.url}const n_=["image","pdf"];async function al(e,t){try{const r=await fetch(e,{mode:"cors"});if(!r.ok)throw new Error("fetch failed");const a=await r.blob(),o=URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(o),100)}catch{window.open(e,"_blank","noopener,noreferrer")}}function a_({archivo:e,estadoDescarga:t,alDescargar:r,alPrevisualizar:a}){const o=nl(e.name),s=n_.includes(o),i=t==="done",c=t==="downloading";return n.jsxs("li",{className:xe.fila,children:[n.jsx("span",{className:xe.fila_icono,children:n.jsx(gn,{nombre:e.name,size:30})}),n.jsx("div",{className:xe.fila_cuerpo,children:n.jsx("span",{className:xe.fila_nombre,title:e.name,children:e.name})}),n.jsxs("div",{className:xe.fila_acciones,children:[s&&n.jsx("button",{type:"button",className:xe.btn_accion,"aria-label":`Ver ${e.name}`,title:"Vista previa",onClick:()=>a(e),children:n.jsx(K0,{size:18})}),n.jsx("button",{type:"button",className:`${xe.btn_accion} ${i?xe.btn_descargado:""}`,"aria-label":`Descargar ${e.name}`,title:i?"Descargado":"Descargar",disabled:c,onClick:()=>r(e),children:c?n.jsx("span",{className:xe.spinner,"aria-hidden":"true"}):i?n.jsx(R0,{size:18}):n.jsx(tl,{size:18})})]})]})}function o_({files:e,title:t="Archivos adjuntos",subtitle:r,onClose:a,className:o,id:s,"data-testid":i}){const c=_.useId(),l=s??`file-viewer-${c}`,d=`${l}-titulo`,[h,g]=_.useState(!1),[f,u]=_.useState(!1),[v,p]=_.useState({}),[m,w]=_.useState(!1),[b,y]=_.useState(null),[E,S]=_.useState(!1),[C,T]=_.useState(!1);_.useEffect(()=>{const x=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(x)},[]),_.useEffect(()=>{if(!a)return;const x=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",x>0&&(document.body.style.paddingRight=`${x}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[a]);const F=_.useCallback(()=>{f||(u(!0),g(!1),setTimeout(()=>a?.(),450))},[f,a]);_.useEffect(()=>{if(!a)return;const x=I=>{I.key==="Escape"&&(b?(y(null),S(!1)):F())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[a,b,F]);const D=_.useCallback(async x=>{const I=Uo(x);p(L=>({...L,[I]:"downloading"})),await al(x.url,x.name),p(L=>({...L,[I]:"done"})),setTimeout(()=>{p(L=>{const X={...L};return delete X[I],X})},2e3)},[]),M=async()=>{if(!(m||!e.length)){w(!0);for(const x of e)await al(x.url,x.name);w(!1)}},U=x=>{S(!1),T(!0),y(x)},V=()=>{y(null),S(!1),T(!1)},N=r??`${e.length} archivo${e.length!==1?"s":""}`,k=b?nl(b.name):null,A=k==="image",O=k==="pdf",$=n.jsxs("div",{id:l,className:`${xe.modal} ${h&&!f?xe.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":d,"data-testid":i??l,children:[n.jsx("header",{className:xe.encabezado,children:b?n.jsxs(n.Fragment,{children:[n.jsxs("button",{className:xe.btn_volver,onClick:V,type:"button","aria-label":"Volver a la lista",children:[n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("path",{d:"M19 12H5M12 5l-7 7 7 7"})}),"Volver"]}),n.jsx("span",{className:xe.preview_nombre_header,title:b.name,children:b.name})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:xe.encabezado_textos,children:[n.jsx("h2",{id:d,className:xe.titulo,children:t}),n.jsx("p",{className:xe.subtitulo,children:N})]}),a&&n.jsxs("button",{className:xe.boton_cerrar,onClick:F,type:"button","aria-label":"Cerrar",children:[n.jsx("span",{className:xe.texto_esc,children:"ESC"}),n.jsx(Qc,{size:16})]})]})}),n.jsxs("div",{className:xe.cuerpo_deslizante,children:[n.jsxs("div",{className:`${xe.panel_lista} ${b?xe.panel_oculto:""}`,inert:b?"":void 0,children:[n.jsxs("div",{className:xe.cabecera_lista,children:[n.jsx("span",{className:xe.cabecera_titulo,children:"Documentos"}),n.jsx("span",{className:xe.cabecera_etiqueta,children:"Solo lectura"})]}),e.length===0?n.jsxs("div",{className:xe.lista_vacia,children:[n.jsx(rl,{className:xe.ilustracion_vacia}),n.jsx("span",{className:xe.lista_vacia_titulo,children:"Sin archivos adjuntos"}),n.jsx("span",{className:xe.lista_vacia_desc,children:"Este registro no tiene documentos por el momento"})]}):n.jsx("ul",{className:xe.lista,children:e.map(x=>n.jsx(a_,{archivo:x,estadoDescarga:v[Uo(x)]??"idle",alDescargar:D,alPrevisualizar:U},Uo(x)))})]}),n.jsx("div",{className:`${xe.panel_preview} ${b?xe.panel_visible:""}`,inert:b?void 0:"",children:b&&n.jsx("div",{className:xe.preview_contenido,children:A&&!E?n.jsxs(n.Fragment,{children:[C&&n.jsx("div",{className:xe.preview_loader,"aria-hidden":"true",children:n.jsxs("svg",{className:xe.spinner_preview,viewBox:"0 0 44 44",fill:"none",role:"presentation",children:[n.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.1"}),n.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"var(--brand-primary, #407bff)",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"32 75",strokeDashoffset:"0"})]})}),n.jsx("img",{src:b.url,alt:b.name,className:`${xe.preview_imagen} ${C?xe.preview_imagen_cargando:""}`,onLoad:()=>T(!1),onError:()=>{T(!1),S(!0)}})]}):E?n.jsxs("div",{className:xe.preview_placeholder,children:[n.jsx(gn,{nombre:b.name,size:64}),n.jsx("p",{children:"No se pudo cargar la imagen"}),n.jsx("code",{children:b.name})]}):O?n.jsx("object",{data:b.url,type:"application/pdf",className:xe.preview_iframe,"aria-label":b.name,children:n.jsxs("div",{className:xe.preview_placeholder,children:[n.jsx(gn,{nombre:b.name,size:64}),n.jsx("p",{children:"No se puede mostrar el PDF en este navegador"}),n.jsx("code",{children:b.name})]})}):n.jsxs("div",{className:xe.preview_placeholder,children:[n.jsx(gn,{nombre:b.name,size:64}),n.jsx("p",{children:"Vista previa no disponible"}),n.jsx("code",{children:b.name})]})})})]}),n.jsxs("footer",{className:xe.pie,children:[b?n.jsx("span",{className:xe.pie_info,children:"Vista previa"}):n.jsxs("span",{className:xe.pie_info,children:[e.length," archivo",e.length!==1?"s":""," disponible",e.length!==1?"s":""]}),n.jsx(Ye,{variant:"light-active",color:"primary",size:"sm",radius:"lg",startContent:n.jsx(tl,{size:14}),onClick:b?()=>D(b):M,isDisabled:!b&&!e.length,isLoading:!b&&m,type:"button",children:b?"Descargar":m?"Descargando…":"Descargar todo"})]})]});return a?n.jsx("div",{className:`${xe.backdrop} ${h&&!f?xe.visible:""} ${o??""}`,onClick:x=>{x.target===x.currentTarget&&!b&&F()},children:$}):n.jsx("div",{className:o,children:$})}const s_=320,ol=2e3,sl=150,Rr=500,il=2,i_=8,ha=" — opciones válidas: ",R={backdrop:"_backdrop_1wown_1",visible:"_visible_1wown_37",modal:"_modal_1wown_61",encabezado:"_encabezado_1wown_145",encabezado_textos:"_encabezado_textos_1wown_161",titulo:"_titulo_1wown_177",subtitulo:"_subtitulo_1wown_193",boton_cerrar:"_boton_cerrar_1wown_205",pasos:"_pasos_1wown_259",paso:"_paso_1wown_259",completado:"_completado_1wown_311",paso_circulo:"_paso_circulo_1wown_319",activo:"_activo_1wown_361",paso_etiqueta:"_paso_etiqueta_1wown_389",divisor:"_divisor_1wown_425",cuerpo:"_cuerpo_1wown_437",zona_idle:"_zona_idle_1wown_459",plantilla_card:"_plantilla_card_1wown_473",plantilla_icono_wrap:"_plantilla_icono_wrap_1wown_535",plantilla_card_texto:"_plantilla_card_texto_1wown_577",plantilla_titulo:"_plantilla_titulo_1wown_593",plantilla_sub:"_plantilla_sub_1wown_607",zona_drop:"_zona_drop_1wown_617",sobre:"_sobre_1wown_675",latirZona:"_latirZona_1wown_1",con_archivo:"_con_archivo_1wown_713",zona_drop_icono_wrap:"_zona_drop_icono_wrap_1wown_755",zona_drop_icono_ok:"_zona_drop_icono_ok_1wown_791",zona_drop_titulo:"_zona_drop_titulo_1wown_847",zona_drop_sub:"_zona_drop_sub_1wown_865",zona_drop_texto:"_zona_drop_texto_1wown_879",zona_drop_pie:"_zona_drop_pie_1wown_893",tipo_chip:"_tipo_chip_1wown_909",filtro_nombre_hint:"_filtro_nombre_hint_1wown_941",archivo_info:"_archivo_info_1wown_953",entrarArchivo:"_entrarArchivo_1wown_1",archivo_nombre:"_archivo_nombre_1wown_995",archivo_tamano:"_archivo_tamano_1wown_1015",zona_procesando:"_zona_procesando_1wown_1025",spinner_wrap:"_spinner_wrap_1wown_1045",spinner_ring:"_spinner_ring_1wown_1053",girar:"_girar_1wown_1",spinner_icono:"_spinner_icono_1wown_1071",procesando_texto:"_procesando_texto_1wown_1101",procesando_titulo:"_procesando_titulo_1wown_1117",procesando_sub:"_procesando_sub_1wown_1133",barra_progreso_contenedor:"_barra_progreso_contenedor_1wown_1153",barra_progreso:"_barra_progreso_1wown_1153",progreso:"_progreso_1wown_1",barra_progreso_fill:"_barra_progreso_fill_1wown_1211",zona_resultado:"_zona_resultado_1wown_1235",banner:"_banner_1wown_1253",entrarBanner:"_entrarBanner_1wown_1",exito:"_exito_1wown_1297",error:"_error_1wown_1309",banner_icono:"_banner_icono_1wown_1321",banner_texto:"_banner_texto_1wown_1363",banner_titulo:"_banner_titulo_1wown_1379",banner_sub:"_banner_sub_1wown_1391",aviso_advertencias:"_aviso_advertencias_1wown_1401",tabs:"_tabs_1wown_1449",tab_indicador:"_tab_indicador_1wown_1463",tab:"_tab_1wown_1449",tab_badge:"_tab_badge_1wown_1541",entrarBadge:"_entrarBadge_1wown_1",tab_badge_ok:"_tab_badge_ok_1wown_1603",tab_badge_warn:"_tab_badge_warn_1wown_1613",tab_panel:"_tab_panel_1wown_1623",entrarPaso:"_entrarPaso_1wown_1",preview_panel_wrap:"_preview_panel_wrap_1wown_1639",info_preview:"_info_preview_1wown_1655",tabla_contenedor:"_tabla_contenedor_1wown_1683",tabla:"_tabla_1wown_1683",fila_error:"_fila_error_1wown_1757",fila_advertencia:"_fila_advertencia_1wown_1773",celda_fila:"_celda_fila_1wown_1805",celda_estado:"_celda_estado_1wown_1823",chip_valida:"_chip_valida_1wown_1841",chip_error_count:"_chip_error_count_1wown_1861",preview_truncada:"_preview_truncada_1wown_1881",errores_lista:"_errores_lista_1wown_1895",error_item:"_error_item_1wown_1917",entrarFila:"_entrarFila_1wown_1",error_cabecera:"_error_cabecera_1wown_1997",error_ids:"_error_ids_1wown_2013",error_id_chip:"_error_id_chip_1wown_2031",error_id_etiqueta:"_error_id_etiqueta_1wown_2063",error_sin_id:"_error_sin_id_1wown_2079",error_fila_tag:"_error_fila_tag_1wown_2091",error_detalle:"_error_detalle_1wown_2113",error_linea:"_error_linea_1wown_2127",error_campo_nombre:"_error_campo_nombre_1wown_2151",error_campo_msg:"_error_campo_msg_1wown_2165",error_mensajes_lista:"_error_mensajes_lista_1wown_2177",error_mensaje_item:"_error_mensaje_item_1wown_2189",opciones_prefijo:"_opciones_prefijo_1wown_2199",opciones_bloque:"_opciones_bloque_1wown_2207",error_expandir_btn:"_error_expandir_btn_1wown_2229",pie:"_pie_1wown_2263",icono_reintentar:"_icono_reintentar_1wown_2281",alerta_inline:"_alerta_inline_1wown_2293",paso_contenido:"_paso_contenido_1wown_2331",encabezados_panel:"_encabezados_panel_1wown_2679",encabezados_titulo:"_encabezados_titulo_1wown_2701",encabezados_grupo:"_encabezados_grupo_1wown_2719",encabezados_label:"_encabezados_label_1wown_2733",encabezados_chips:"_encabezados_chips_1wown_2745",chip_faltante:"_chip_faltante_1wown_2757",entrarChip:"_entrarChip_1wown_1",chip_sugerencia:"_chip_sugerencia_1wown_2827",chip_extra:"_chip_extra_1wown_2839",encabezados_ok:"_encabezados_ok_1wown_2859",encabezados_orden:"_encabezados_orden_1wown_2869",encabezados_orden_fila:"_encabezados_orden_fila_1wown_2881",encabezados_secuencia:"_encabezados_secuencia_1wown_2895",chip_orden:"_chip_orden_1wown_2913",chip_orden_num:"_chip_orden_num_1wown_2937",chip_orden_movido:"_chip_orden_movido_1wown_2959",error_hecho:"_error_hecho_1wown_2979",origen_duplicado:"_origen_duplicado_1wown_3013",origen_existente:"_origen_existente_1wown_3023",item_advertencia:"_item_advertencia_1wown_3033"},c_=e=>{const t=e.name.slice(e.name.lastIndexOf("."))||".xlsx";return`${e.name.replace(/\.[^.]+$/,"")}_${Date.now()}${t}`};async function l_(e,t){const{getStorage:r,ref:a,uploadBytesResumable:o}=await import("firebase/storage"),s=a(r(),`${t}/${c_(e)}`);await new Promise((i,c)=>{o(s,e).on("state_changed",null,c,i)})}function d_({size:e=48}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:[n.jsx("path",{fill:"currentColor",d:"M6.5 18v-.09c0-.865 0-1.659.087-2.304c.095-.711.32-1.463.938-2.08c.618-.619 1.37-.844 2.08-.94c.646-.086 1.44-.086 2.306-.086h.178c.866 0 1.66 0 2.305.087c.711.095 1.463.32 2.08.938c.619.618.844 1.37.94 2.08c.085.637.086 1.416.086 2.267c2.573-.55 4.5-2.812 4.5-5.52c0-2.47-1.607-4.572-3.845-5.337C17.837 4.194 15.415 2 12.476 2C9.32 2 6.762 4.528 6.762 7.647c0 .69.125 1.35.354 1.962a4.4 4.4 0 0 0-.83-.08C3.919 9.53 2 11.426 2 13.765S3.919 18 6.286 18z",opacity:".5"}),n.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 14c-1.886 0-2.828 0-3.414.586S8 16.114 8 18s0 2.828.586 3.414S10.114 22 12 22s2.828 0 3.414-.586S16 19.886 16 18s0-2.828-.586-3.414S13.886 14 12 14m1.805 3.084l-1.334-1.333a.667.667 0 0 0-.942 0l-1.334 1.333a.667.667 0 1 0 .943.943l.195-.195v1.946a.667.667 0 0 0 1.334 0v-1.946l.195.195a.667.667 0 0 0 .943-.943",clipRule:"evenodd"})]})}function u_({size:e=52}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M4 4.735v14.53l10 1.429V3.306zM17 19h3V5h-3V3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8-7l2.8 4h-2.4L9 13.714L7.4 16H5l2.8-4L5 8h2.4L9 10.286L10.6 8H13z"})})}function f_({size:e=20}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 23 23",fill:"none","aria-hidden":!0,children:n.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[n.jsx("path",{d:"M17 9.002c2.175.012 3.353.109 4.121.877C22 10.758 22 12.172 22 15v1c0 2.829 0 4.243-.879 5.122C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.878C2 20.242 2 18.829 2 16v-1c0-2.828 0-4.242.879-5.121c.768-.768 1.946-.865 4.121-.877"}),n.jsx("path",{strokeLinejoin:"round",d:"M12 2v13m0 0l-3-3.5m3 3.5l3-3.5"})]})})}function h_({size:e=16}){return n.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:n.jsx("path",{d:"M12 4 4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function cl({size:e=16}){return n.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:n.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wo({size:e=22}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[n.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),n.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),n.jsx("path",{d:"M11 7v4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"11",cy:"15",r:"1",fill:"currentColor"})]})}function ll({size:e=14}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 48 48",fill:"none","aria-hidden":!0,children:n.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.466C11.2 5.243 16.43 5 24 5s12.8.243 16 .466c1.516.106 2.625 1.196 2.756 2.632c.246 2.691.494 6.855.494 12.7s-.248 10.01-.494 12.7c-.13 1.437-1.24 2.527-2.755 2.633c-2.994.208-7.76.434-14.557.463a2 2 0 0 0-1.29.479l-6.847 5.845v-4.44a2 2 0 0 0-1.942-2A184 184 0 0 1 8 36.132c-1.515-.106-2.624-1.196-2.755-2.633c-.246-2.69-.494-6.854-.494-12.7s.248-10.009.494-12.7C5.375 6.663 6.485 5.573 8 5.467M24 1c-7.656 0-12.977.246-16.279.476c-3.406.237-6.145 2.802-6.46 6.259C1.002 10.555.75 14.84.75 20.799s.253 10.243.51 13.063c.316 3.457 3.055 6.022 6.461 6.259c1.459.102 3.312.206 5.586.292v2.66c0 3.366 3.948 5.149 6.487 2.981l6.4-5.464c6.49-.041 11.109-.262 14.085-.47c3.405-.236 6.145-2.801 6.46-6.258c.258-2.82.511-7.105.511-13.063s-.253-10.244-.51-13.064c-.316-3.457-3.056-6.022-6.461-6.259C36.977 1.246 31.656 1 24 1m0 7.75c-.687 0-1.292.055-1.815.138c-1.803.287-2.628 2.018-2.478 3.645c.189 2.06.492 5.022.823 6.952c.187 1.088.94 2.052 2.146 2.194c.366.043.804.071 1.324.071s.958-.028 1.323-.07c1.207-.143 1.96-1.107 2.147-2.195c.331-1.93.634-4.892.823-6.952c.15-1.627-.675-3.358-2.478-3.645A11.5 11.5 0 0 0 24 8.75m-4 19a4 4 0 1 1 8 0a4 4 0 0 1-8 0"})})}function dl({size:e=14}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:n.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12m5.793-4.207a1 1 0 0 1 1.414 0L12 10.586l2.793-2.793a1 1 0 1 1 1.414 1.414L13.414 12l2.793 2.793a1 1 0 0 1-1.414 1.414L12 13.414l-2.793 2.793a1 1 0 0 1-1.414-1.414L10.586 12L7.793 9.207a1 1 0 0 1 0-1.414Z"})})}function __({size:e=14}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[n.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"currentColor",opacity:".1"}),n.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"1.2"}),n.jsx("path",{d:"M1 5h12M5 5v8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function p_({size:e=18}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24","aria-hidden":!0,children:n.jsx("path",{fill:"currentColor",d:"M11.896 18a.75.75 0 0 1-.75.75c-3.792 0-6.896-3.005-6.896-6.75s3.104-6.75 6.896-6.75c3.105 0 5.749 2.015 6.605 4.801l.603-1.02a.75.75 0 0 1 1.292.763l-1.63 2.755a.75.75 0 0 1-1.014.272L14.18 11.23a.75.75 0 1 1 .737-1.307l1.472.83c-.574-2.288-2.691-4.003-5.242-4.003C8.149 6.75 5.75 9.117 5.75 12s2.399 5.25 5.396 5.25a.75.75 0 0 1 .75.75"})})}function g_({size:e=22}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[n.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),n.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),n.jsx("path",{d:"M7 11l2.5 2.5L15 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function v_({size:e=24}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:n.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[n.jsx("path",{strokeDasharray:"2 4",strokeDashoffset:"6",d:"M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",children:n.jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",repeatCount:"indefinite",values:"6;0"})}),n.jsx("path",{strokeDasharray:"32",strokeDashoffset:"32",d:"M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",children:n.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.1s",dur:"0.4s",values:"32;0"})}),n.jsx("path",{strokeDasharray:"10",strokeDashoffset:"10",d:"M12 16v-7.5",children:n.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.5s",dur:"0.2s",values:"10;0"})}),n.jsx("path",{strokeDasharray:"6",strokeDashoffset:"6",d:"M12 8.5l3.5 3.5M12 8.5l-3.5 3.5",children:n.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.7s",dur:"0.2s",values:"6;0"})})]})})}function ul({size:e=22}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[n.jsx("path",{d:"M11 3L4 6v5c0 4.418 3.134 8.55 7 9.5 3.866-.95 7-5.082 7-9.5V6l-7-3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M8 11l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function m_({size:e=22}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 32 32",children:[n.jsx("circle",{cx:"26",cy:"26",r:"4",fill:"currentColor"}),n.jsx("path",{fill:"currentColor",d:"M10 13h2v2h-2zm0 5h2v2h-2zm0 5h2v2h-2zm4-10h8v2h-8zm0 5h8v2h-8zm0 5h4v2h-4z"}),n.jsx("path",{fill:"currentColor",d:"M7 28V7h3v3h12V7h3v11h2V7a2 2 0 0 0-2-2h-3V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v1H7a2 2 0 0 0-2 2v21a2 2 0 0 0 2 2h11v-2Zm5-24h8v4h-8Z"})]})}function b_({size:e=15}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:[n.jsx("path",{d:"M9 2h9a2 2 0 0 1 2 2v12h-2V4H9V2Z"}),n.jsx("path",{d:"M6 6h9a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Zm0 2v12h9V8H6Z"})]})}function w_({size:e=15}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:[n.jsx("path",{d:"M12 2c4.42 0 8 1.34 8 3s-3.58 3-8 3-8-1.34-8-3 3.58-3 8-3Z"}),n.jsx("path",{d:"M20 8.5v3c0 1.66-3.58 3-8 3s-8-1.34-8-3v-3c1.6 1.2 4.6 1.8 8 1.8s6.4-.6 8-1.8Z"}),n.jsx("path",{d:"M20 14v3c0 1.66-3.58 3-8 3s-8-1.34-8-3v-3c1.6 1.2 4.6 1.8 8 1.8s6.4-.6 8-1.8Z"})]})}function fl({size:e=13}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})}function y_({reporte:e}){const t=e.encontrados.length,r=!e.ordenValido&&e.faltantes.length===0&&e.extra.length===0;return n.jsxs("div",{className:R.encabezados_panel,role:"alert",children:[n.jsxs("div",{className:R.encabezados_titulo,children:[n.jsx(Wo,{size:16}),r?"Las columnas están completas, pero no en el orden esperado":"Los encabezados del archivo no coinciden con la plantilla"]}),!e.ordenValido&&n.jsxs("div",{className:R.encabezados_orden,children:[n.jsxs("div",{className:R.encabezados_orden_fila,children:[n.jsx("span",{className:R.encabezados_label,children:"Orden esperado:"}),n.jsx("ol",{className:R.encabezados_secuencia,children:e.ordenEsperado.map((a,o)=>n.jsxs("li",{className:R.chip_orden,children:[n.jsx("span",{className:R.chip_orden_num,children:o+1}),a]},a))})]}),n.jsxs("div",{className:R.encabezados_orden_fila,children:[n.jsx("span",{className:R.encabezados_label,children:"En el archivo:"}),n.jsx("ol",{className:R.encabezados_secuencia,children:e.ordenRecibido.map((a,o)=>n.jsxs("li",{className:`${R.chip_orden} ${a!==e.ordenEsperado[o]?R.chip_orden_movido:""}`,children:[n.jsx("span",{className:R.chip_orden_num,children:o+1}),a]},a))})]})]}),e.faltantes.length>0&&n.jsxs("div",{className:R.encabezados_grupo,children:[n.jsxs("span",{className:R.encabezados_label,children:["Faltan (",e.faltantes.length,"):"]}),n.jsx("div",{className:R.encabezados_chips,children:e.faltantes.map(a=>n.jsxs("span",{className:R.chip_faltante,children:[a.columna,a.sugerencia&&n.jsxs("span",{className:R.chip_sugerencia,children:[" · ¿es “",a.sugerencia,"”?"]})]},a.columna))})]}),e.extra.length>0&&n.jsxs("div",{className:R.encabezados_grupo,children:[n.jsxs("span",{className:R.encabezados_label,children:["No reconocidas (",e.extra.length,"):"]}),n.jsx("div",{className:R.encabezados_chips,children:e.extra.map(a=>n.jsx("span",{className:R.chip_extra,children:a},a))})]}),t>0&&n.jsxs("span",{className:R.encabezados_ok,children:[t," columna",t!==1?"s":""," reconocida",t!==1?"s":"","."," ",r?"Reordénalas como en la plantilla.":"Corrige las cabeceras o descarga la plantilla."]})]})}const hl=[".xlsx",".xls",".csv"],k_=".xlsx,.xls,.csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv";function _l(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function x_(e){const t=e.name.toLowerCase();return hl.some(r=>t.endsWith(r))?null:`Formato no soportado. Usa: ${hl.join(", ")}`}function E_(e,t){return t&&e.size>t*1024*1024?`El archivo pesa ${_l(e.size)} y el máximo permitido es ${t} MB`:null}function C_(e,t){return typeof t=="string"?e.name.toLowerCase().includes(t.toLowerCase())?null:`El archivo debe contener "${t}" en su nombre`:t.test(e.name)?null:"El nombre del archivo no es el esperado"}async function S_(e,t="plantilla.xlsx"){const r=await import("xlsx"),a=r.utils.aoa_to_sheet([e.map(s=>s.columna??s.etiqueta)]),o=r.utils.book_new();r.utils.book_append_sheet(o,a,"Plantilla"),r.writeFile(o,t)}async function T_(e,t){try{const a=await(await fetch(e)).blob(),o=document.createElement("a");o.href=URL.createObjectURL(a),o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(o.href)}catch{window.open(e,"_blank")}}const A_=["XLSX","XLS","CSV"];function N_({campos:e,plantillaUrl:t,plantillaFilename:r,generarPlantilla:a,onGenerarPlantilla:o,archivo:s,arrastrandoSobre:i,inputRef:c,filtroNombre:l,maxTamanoMB:d,reporteEncabezados:h,onDragOver:g,onDragLeave:f,onDrop:u,onArchivoElegido:v}){const p=t||a||o,m=()=>c.current?.click(),w=()=>{o?o():t?T_(t,r):a&&S_(e,r)};return n.jsxs("div",{className:R.zona_idle,children:[p&&n.jsxs("button",{className:R.plantilla_card,type:"button",onClick:w,children:[n.jsx("div",{className:R.plantilla_icono_wrap,children:n.jsx(f_,{size:20})}),n.jsxs("div",{className:R.plantilla_card_texto,children:[n.jsx("span",{className:R.plantilla_titulo,children:"Descargar plantilla"}),n.jsx("span",{className:R.plantilla_sub,children:t?"Descarga la plantilla oficial para llenar":"Genera la plantilla con las columnas esperadas"})]})]}),n.jsxs("div",{className:`${R.zona_drop} ${i?R.sobre:""} ${s?R.con_archivo:""}`,role:"button",tabIndex:0,"aria-label":"Zona para arrastrar o seleccionar archivo Excel",onDragOver:g,onDragLeave:f,onDrop:u,onClick:m,onKeyDown:b=>(b.key==="Enter"||b.key===" ")&&m(),children:[s?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`${R.zona_drop_icono_wrap} ${R.zona_drop_icono_ok}`,children:n.jsx(u_,{size:38})}),n.jsxs("div",{className:R.archivo_info,children:[n.jsx("span",{className:R.archivo_nombre,children:s.name}),n.jsx("span",{className:R.archivo_tamano,children:_l(s.size)})]}),n.jsx("p",{className:R.zona_drop_sub,children:"Haz clic para cambiar el archivo"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:R.zona_drop_icono_wrap,children:n.jsx(d_,{size:48})}),n.jsxs("div",{className:R.zona_drop_texto,children:[n.jsx("p",{className:R.zona_drop_titulo,children:"Arrastra tu archivo aquí"}),n.jsx("p",{className:R.zona_drop_sub,children:"o haz clic para seleccionar desde tu equipo"})]}),n.jsxs("div",{className:R.zona_drop_pie,children:[A_.map(b=>n.jsx("span",{className:R.tipo_chip,children:b},b)),typeof l=="string"&&n.jsxs("span",{className:R.filtro_nombre_hint,children:["Nombre: ",n.jsx("strong",{children:l})]}),d&&n.jsxs("span",{className:R.filtro_nombre_hint,children:["Máximo ",n.jsxs("strong",{children:[d," MB"]})]})]})]}),n.jsx("input",{ref:c,type:"file",accept:k_,tabIndex:-1,onChange:v,onClick:b=>b.stopPropagation()})]}),h&&!h.valido&&n.jsx(y_,{reporte:h})]})}const I_={existencia:(e,t)=>`Comprobando ${e} de ${t} registros en el sistema…`,validando:(e,t)=>`Validando ${e} de ${t} filas…`};function M_({nombre:e,progreso:t}){const r=t?I_[t.fase](t.hechas.toLocaleString(),t.total.toLocaleString()):"Validando datos…",a=t&&t.total>0?Math.min(1,t.hechas/t.total):null;return n.jsxs("div",{className:R.zona_procesando,children:[n.jsxs("div",{className:R.spinner_wrap,children:[n.jsx("div",{className:R.spinner_ring,"aria-hidden":!0}),n.jsx("div",{className:R.spinner_icono,children:n.jsx(ul,{size:18})})]}),n.jsxs("div",{className:R.procesando_texto,children:[n.jsx("p",{className:R.procesando_titulo,children:r}),n.jsx("p",{className:R.procesando_sub,children:e})]}),n.jsx("div",{className:R.barra_progreso_contenedor,role:"progressbar","aria-label":"Procesando","aria-valuenow":a===null?void 0:Math.round(a*100),children:a===null?n.jsx("div",{className:R.barra_progreso}):n.jsx("div",{className:R.barra_progreso_fill,style:{transform:`scaleX(${a})`}})})]})}const ct=e=>e.trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"");function F_(e){return[e.columna??e.etiqueta,...e.aliasColumna??[]]}function pl(e,t){if(e===t)return 0;const r=e.length,a=t.length;if(r===0)return a;if(a===0)return r;let o=Array.from({length:a+1},(s,i)=>i);for(let s=1;s<=r;s++){const i=[s];for(let c=1;c<=a;c++)i.push(Math.min(o[c]+1,i[c-1]+1,o[c-1]+(e[s-1]===t[c-1]?0:1)));o=i}return o[a]}function $_(e,t){const r=pl(e,t);return r>0&&r<=Math.max(1,Math.floor(e.length/4)+1)}function O_(e){for(let t=1;t<e.length;t++)if(e[t]<e[t-1])return!1;return!0}function gl(e,t,r={}){const{exigirOrden:a=!1,permitirColumnasExtra:o=!0}=r,s=new Map,i=new Map;e.forEach((b,y)=>{const E=ct(b);!E||s.has(E)||(s.set(E,b.trim()),i.set(E,y))});const c=new Map,l=[],d=[],h=[],g=new Set;for(const b of t){const y=F_(b),E=y.map(ct).find(S=>s.has(S));E!==void 0?(g.add(E),c.set(String(b.campo),E),l.push({campo:String(b.campo),columna:s.get(E),esperado:y[0]})):b.opcional?h.push(y[0]):d.push({columna:y[0],etiqueta:b.etiqueta})}const f=[...s.entries()].filter(([b])=>!g.has(b)).map(([,b])=>b);for(const b of d){const y=ct(b.columna);let E,S=1/0;for(const C of f){const T=ct(C);if(!$_(y,T))continue;const F=pl(y,T);F<S&&(S=F,E=C)}b.sugerencia=E}const u=l.map(b=>i.get(ct(b.columna))??0),v=!a||O_(u),p=l.map(b=>b.columna),m=[...l].sort((b,y)=>(i.get(ct(b.columna))??0)-(i.get(ct(y.columna))??0)).map(b=>b.columna);return{reporte:{valido:d.length===0&&(o||f.length===0)&&v,encontrados:l,faltantes:d,faltantesOpcionales:h,extra:f,ordenValido:v,ordenEsperado:p,ordenRecibido:m},resolucion:c}}function D_(e){const t={};for(const[r,a]of Object.entries(e))t[ct(r)]=a;return t}const L_=/\{campo\}/g;function vl(e,t,r,a){const o=[];for(const s of e){const i=s(t,r);i!==null&&o.push(i.replace(L_,a))}return o}function vn(e,t){return String(e[t]??"")}function P_(e,t,r){const a=Object.fromEntries(r.map(o=>[ct(o.etiqueta),String(o.campo)]));return t.map(o=>({etiqueta:o,valor:vn(e,a[ct(o)]??ct(o)).trim()})).filter(o=>o.valor)}async function z_(e,t,r,a,o=il){const s=e.length,i=t.map(f=>({campo:f,clave:String(f.campo),colKey:r?.get(String(f.campo))??ct(f.columna??f.etiqueta),validadores:f.validadores??[],advertencias:f.advertencias??[]})),c=s>0?Object.keys(e[0]).map(f=>[f,ct(f)]):[],l=[],d=[];let h=0,g=0;for(let f=0;f<s;f++){const u=o+f,v=e[f];let p;if(Object.keys(v).length===c.length){p={};for(const[S,C]of c)p[C]=v[S]??""}else p=D_(v);const m=[],w=[],b={};for(const{campo:S,clave:C,colKey:T,validadores:F,advertencias:D}of i){const M=p[T]??"",U={campo:C,etiqueta:S.etiqueta,fila:u,origen:"validacion",valor:M},V=vl(F,M,p,S.etiqueta);V.length>0&&m.push({...U,mensajes:V});const N=vl(D,M,p,S.etiqueta);N.length>0&&w.push({...U,mensajes:N});try{b[C]=S.transformar?S.transformar(M):M}catch{b[C]=M}}const y=m.length===0;h+=m.length,g+=w.length;const E=b;l.push({indice:u,datos:E,errores:m,advertencias:w,valida:y}),y&&d.push(E),s>ol&&(f+1)%ol===0&&(a?.(f+1,s),await new Promise(S=>setTimeout(S,0)))}return{filasValidas:d,filasProcesadas:l,totalFilas:s,totalErrores:h,totalAdvertencias:g}}const ml=100,bl=6,qo={duplicado:{Icono:b_,clase:"origen_duplicado"},existente:{Icono:w_,clase:"origen_existente"}};function Go({texto:e}){const[t,r]=_.useState(!1),a=e.indexOf(ha);if(a>=0){const o=e.slice(a+ha.length).split(", ").map(c=>c.trim()).filter(Boolean),s=t?o:o.slice(0,bl),i=o.length-bl;return n.jsxs("span",{children:[n.jsxs("span",{className:R.opciones_prefijo,children:[e.slice(0,a)," — opciones válidas:"]})," ",n.jsxs("span",{className:R.opciones_bloque,children:[s.join(", "),!t&&i>0&&"…"]}),i>0&&n.jsx("button",{className:R.error_expandir_btn,type:"button",onClick:()=>r(c=>!c),children:t?"▴ menos":`▾ +${i}`})]})}return e.length<=ml?n.jsx("span",{children:e}):n.jsxs("span",{children:[t?e:`${e.slice(0,ml)}…`,n.jsx("button",{className:R.error_expandir_btn,type:"button",onClick:()=>r(o=>!o),children:t?" ▴ ver menos":" ▾ ver más"})]})}function B_({err:e}){const t=qo[e.origen];return t?n.jsxs("div",{className:`${R.error_hecho} ${R[t.clase]}`,children:[n.jsx(t.Icono,{size:14}),n.jsx("span",{children:e.mensajes.map((r,a)=>n.jsx(Go,{texto:r},a))})]}):n.jsxs("div",{className:R.error_linea,children:[n.jsx("span",{className:R.error_campo_nombre,children:e.etiqueta}),n.jsx("span",{className:R.error_campo_msg,children:e.mensajes.length===1?n.jsx(Go,{texto:e.mensajes[0]}):n.jsx("span",{className:R.error_mensajes_lista,children:e.mensajes.map((r,a)=>n.jsx("span",{className:R.error_mensaje_item,children:n.jsx(Go,{texto:r})},a))})})]})}function V_({fila:e,campos:t,identificadores:r,orden:a=0,variante:o="error",entradas:s}){const i=r.length?P_(e.datos,r,t):[],c=[...s??e.errores].sort((d,h)=>+!qo[d.origen]-+!qo[h.origen]),l=[R.error_item,o==="advertencia"&&R.item_advertencia].filter(Boolean).join(" ");return n.jsxs("div",{className:l,style:{"--indice-fila":a},children:[n.jsxs("div",{className:R.error_cabecera,children:[i.length>0?n.jsx("div",{className:R.error_ids,children:i.map((d,h)=>n.jsxs("span",{className:R.error_id_chip,children:[n.jsx("span",{className:R.error_id_etiqueta,children:d.etiqueta}),d.valor]},h))}):n.jsx("span",{className:R.error_sin_id,children:"Sin identificador"}),n.jsxs("span",{className:R.error_fila_tag,children:["Fila ",e.indice]})]}),n.jsx("div",{className:R.error_detalle,children:c.map((d,h)=>n.jsx(B_,{err:d},h))})]})}function j_({filas:e,campos:t}){const r=e.slice(0,Rr),a=e.length>Rr;return n.jsxs("table",{className:R.tabla,children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:R.celda_fila,children:"Fila"}),t.map(o=>n.jsx("th",{children:o.etiqueta},String(o.campo))),n.jsx("th",{className:R.celda_estado,children:"Estado"})]})}),n.jsxs("tbody",{children:[r.map(o=>{const s=o.valida?o.advertencias.length>0?R.fila_advertencia:"":R.fila_error;return n.jsxs("tr",{className:s,children:[n.jsx("td",{className:R.celda_fila,children:o.indice}),t.map(i=>n.jsx("td",{children:vn(o.datos,String(i.campo))},String(i.campo))),n.jsx("td",{className:R.celda_estado,children:o.valida?n.jsx("span",{className:R.chip_valida,children:"✓ Válida"}):n.jsxs("span",{className:R.chip_error_count,children:[o.errores.length," error",o.errores.length!==1?"es":""]})})]},o.indice)}),a&&n.jsx("tr",{children:n.jsxs("td",{colSpan:t.length+2,className:R.preview_truncada,children:["Se muestran ",Rr," de ",e.length.toLocaleString()," filas totales"]})})]})]})}const Ro=(e,t,r)=>`${e.toLocaleString()} ${e===1?t:r}`;function wl({filas:e,campos:t,identificadores:r,variante:a}){const o=e.slice(0,sl),s=e.length-o.length,i=a==="advertencia"?"advertencias":"errores";return n.jsxs("div",{className:`${R.errores_lista} ${R.tab_panel}`,role:"tabpanel",children:[o.map((c,l)=>n.jsx(V_,{fila:c,campos:t,identificadores:r,orden:l,variante:a,entradas:a==="advertencia"?c.advertencias:c.errores},c.indice)),s>0&&n.jsxs("p",{className:R.info_preview,children:[n.jsx(fl,{size:13}),"Se listan las primeras ",sl," filas con ",i,". Hay ",s.toLocaleString()," más en el archivo."]})]})}function H_({resultado:e,campos:t,identificadores:r}){const a=e.totalErrores>0,o=e.totalAdvertencias>0,s=!a,[i,c]=_.useState(a?"errores":o?"advertencias":"preview"),l=_.useRef(null),d=_.useRef(null);_.useLayoutEffect(()=>{const p=l.current?.querySelector('[role="tab"][aria-selected="true"]'),m=d.current;if(!p||!m)return;const w=m.style.width==="";w&&(m.style.transition="none"),m.style.transform=`translateX(${p.offsetLeft}px)`,m.style.width=`${p.offsetWidth}px`,w&&(m.offsetWidth,m.style.transition="")},[i,a,o]);const h=_.useMemo(()=>e.filasProcesadas.filter(p=>p.errores.length>0),[e.filasProcesadas]),g=_.useMemo(()=>e.filasProcesadas.filter(p=>p.advertencias.length>0),[e.filasProcesadas]),f=e.totalFilas,u=s?`${Ro(f,"registro listo","registros listos")} para importar`:Ro(h.length,"fila con errores","filas con errores"),v=s?o?"El archivo no tiene errores y se puede importar":"Todos los datos pasaron la validación":"Corrige los errores en el archivo y vuelve a intentarlo";return n.jsxs("div",{className:R.zona_resultado,children:[n.jsxs("div",{className:`${R.banner} ${s?R.exito:R.error}`,children:[n.jsx("div",{className:R.banner_icono,children:s?n.jsx(g_,{size:22}):n.jsx(Wo,{size:22})}),n.jsxs("div",{className:R.banner_texto,children:[n.jsx("span",{className:R.banner_titulo,children:u}),n.jsx("span",{className:R.banner_sub,children:v})]})]}),s&&o&&n.jsxs("p",{className:R.aviso_advertencias,children:[n.jsx(ll,{size:15}),n.jsxs("span",{children:[Ro(g.length,"fila tiene advertencias","filas tienen advertencias"),". No impiden la importación, pero conviene revisarlas en la pestaña ",n.jsx("strong",{children:"Advertencias"}),"."]})]}),n.jsxs("div",{ref:l,className:R.tabs,role:"tablist",children:[a&&n.jsxs("button",{type:"button",role:"tab","aria-selected":i==="errores",className:`${R.tab} ${i==="errores"?R.activo:""}`,onClick:()=>c("errores"),children:[n.jsx(dl,{size:15}),"Errores",n.jsx("span",{className:R.tab_badge,children:h.length})]}),o&&n.jsxs("button",{type:"button",role:"tab","aria-selected":i==="advertencias",className:`${R.tab} ${i==="advertencias"?R.activo:""}`,onClick:()=>c("advertencias"),children:[n.jsx(ll,{size:14}),"Advertencias",n.jsx("span",{className:`${R.tab_badge} ${R.tab_badge_warn}`,children:g.length})]}),n.jsxs("button",{type:"button",role:"tab","aria-selected":i==="preview",className:`${R.tab} ${i==="preview"?R.activo:""}`,onClick:()=>c("preview"),children:[n.jsx(__,{size:13}),"Vista previa",n.jsx("span",{className:`${R.tab_badge} ${R.tab_badge_ok}`,children:f})]}),n.jsx("span",{ref:d,className:R.tab_indicador,"aria-hidden":!0})]}),i==="errores"&&n.jsx(wl,{filas:h,campos:t,identificadores:r,variante:"error"},"errores"),i==="advertencias"&&n.jsx(wl,{filas:g,campos:t,identificadores:r,variante:"advertencia"},"advertencias"),i==="preview"&&n.jsxs("div",{className:`${R.preview_panel_wrap} ${R.tab_panel}`,role:"tabpanel",children:[n.jsxs("div",{className:R.info_preview,children:[n.jsx(fl,{size:13}),e.filasProcesadas.length>Rr?`Se muestran hasta ${Rr} filas (${e.filasProcesadas.length.toLocaleString()} en total)`:`Se muestran hasta ${Rr} filas`]}),n.jsx("div",{className:R.tabla_contenedor,children:n.jsx(j_,{filas:e.filasProcesadas,campos:t})})]},"preview")]})}const yl=[{Icono:v_,label:"Subir",paso:"idle"},{Icono:ul,label:"Validar",paso:"procesando"},{Icono:m_,label:"Resultados",paso:"resultado"}];function U_({paso:e}){const t=yl.findIndex(r=>r.paso===e);return n.jsx("div",{className:R.pasos,"aria-label":"Pasos del proceso",children:yl.map(({label:r,Icono:a},o)=>n.jsxs("div",{className:`${R.paso} ${o===t?R.activo:""} ${o<t?R.completado:""}`,children:[n.jsx("div",{className:R.paso_circulo,"aria-hidden":!0,children:o<t?n.jsx(cl,{size:15}):n.jsx(a,{size:22})}),n.jsx("span",{className:R.paso_etiqueta,children:r})]},r))})}const W_="";function kl(e,t){const r=e.find(a=>String(a.campo)===t)??e[0];return{campo:String(r.campo),etiqueta:r.etiqueta}}function xl(e){return e.map(t=>({...t,errores:[...t.errores],advertencias:[...t.advertencias]}))}function El(e,t){const r=e.map(a=>({...a,valida:a.errores.length===0}));return{filasProcesadas:r,filasValidas:r.filter(a=>a.valida).map(a=>a.datos),totalErrores:r.reduce((a,o)=>a+o.errores.length,0),totalAdvertencias:r.reduce((a,o)=>a+o.advertencias.length,0),totalFilas:t}}function Cl(e,t,r,a,o){return{campo:t.campo,etiqueta:t.etiqueta,fila:e,mensajes:[a],origen:o,valor:r}}function q_(e,t){return e.etiqueta?e.etiqueta:e.campos.map(r=>t.find(a=>String(a.campo)===r)?.etiqueta??r).join(" + ")}function G_(e,t){const r=t.normalizar??!0,a=[];for(const o of t.campos){const s=vn(e.datos,o).trim();if(!s)return null;a.push(r?ct(s):s)}return a.join(W_)}function Sl(e,t,r){if(t.length===0)return e;const a=xl(e.filasProcesadas);for(const o of t){const s=q_(o,r),i=kl(r,o.campos[0]),c=new Map;for(const l of a){const d=G_(l,o);if(d===null)continue;const h=c.get(d);if(h===void 0){c.set(d,l.indice);continue}const g=o.mensaje??`${s} duplicado: ya aparece en la fila ${h}`;l.errores.push(Cl(l.indice,i,vn(l.datos,i.campo),g,"duplicado"))}}return El(a,e.totalFilas)}async function R_(e,t,r){let a=0;const o=Array.from({length:Math.min(t,e.length)},async()=>{for(;a<e.length;)await r(e[a++])});await Promise.all(o)}async function Tl(e,t,r){const{campos:a,anclaje:o,concurrencia:s=i_,mensaje:i,onProgreso:c}=r,l=xl(e.filasProcesadas),d=l.filter(u=>u.valida);if(d.length===0)return e;const h=kl(a,o),g=i??"Este registro ya existe en el sistema";let f=0;return await R_(d,s,async u=>{try{await t(u.datos)&&u.errores.push(Cl(u.indice,h,vn(u.datos,h.campo),g,"existente"))}catch{}c?.(++f,d.length)}),El(l,e.totalFilas)}const Al=`(function(){"use strict";/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var w0=1252,xi=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Ct={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},yt=function(e){xi.indexOf(e)!=-1&&(w0=Ct[0]=e)};function di(){yt(1252)}var _r=function(e){yt(e)};function F0(){_r(1200),di()}function A0(e){for(var a=[],r=0,n=e.length;r<n;++r)a[r]=e.charCodeAt(r);return a}function vi(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return a.join("")}function S0(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return a.join("")}var ka=function(e){var a=e.charCodeAt(0),r=e.charCodeAt(1);return a==255&&r==254?vi(e.slice(2)):a==254&&r==255?S0(e.slice(2)):a==65279?e.slice(1):e},rt=function(a){return String.fromCharCode(a)},C0=function(a){return String.fromCharCode(a)},wa,Vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y0(e){for(var a="",r=0,n=0,t=0,s=0,i=0,c=0,f=0,l=0;l<e.length;)r=e.charCodeAt(l++),s=r>>2,n=e.charCodeAt(l++),i=(r&3)<<4|n>>4,t=e.charCodeAt(l++),c=(n&15)<<2|t>>6,f=t&63,isNaN(n)?c=f=64:isNaN(t)&&(f=64),a+=Vr.charAt(s)+Vr.charAt(i)+Vr.charAt(c)+Vr.charAt(f);return a}function fr(e){var a="",r=0,n=0,t=0,s=0,i=0,c=0,f=0;e=e.replace(/[^\\w\\+\\/\\=]/g,"");for(var l=0;l<e.length;)s=Vr.indexOf(e.charAt(l++)),i=Vr.indexOf(e.charAt(l++)),r=s<<2|i>>4,a+=String.fromCharCode(r),c=Vr.indexOf(e.charAt(l++)),n=(i&15)<<4|c>>2,c!==64&&(a+=String.fromCharCode(n)),f=Vr.indexOf(e.charAt(l++)),t=(c&3)<<6|f,f!==64&&(a+=String.fromCharCode(t));return a}var ge=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),qr=(function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(a,r){return r?new Buffer(a,r):new Buffer(a)}:Buffer.from.bind(Buffer)}return function(){}})();function Wr(e){return ge?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function D0(e){return ge?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Er=function(a){return ge?qr(a,"binary"):a.split("").map(function(r){return r.charCodeAt(0)&255})};function Qr(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var a=[],r=0;r<e.length;++r)a[r]=String.fromCharCode(e[r]);return a.join("")}function Dt(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return Dt(new Uint8Array(e));for(var a=new Array(e.length),r=0;r<e.length;++r)a[r]=e[r];return a}var Gr=ge?function(e){return Buffer.concat(e.map(function(a){return Buffer.isBuffer(a)?a:qr(a)}))}:function(e){if(typeof Uint8Array<"u"){var a=0,r=0;for(a=0;a<e.length;++a)r+=e[a].length;var n=new Uint8Array(r),t=0;for(a=0,r=0;a<e.length;r+=t,++a)if(t=e[a].length,e[a]instanceof Uint8Array)n.set(e[a],r);else{if(typeof e[a]=="string")throw"wtf";n.set(new Uint8Array(e[a]),r)}return n}return[].concat.apply([],e.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function pi(e){for(var a=[],r=0,n=e.length+250,t=Wr(e.length+255),s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i<128)t[r++]=i;else if(i<2048)t[r++]=192|i>>6&31,t[r++]=128|i&63;else if(i>=55296&&i<57344){i=(i&1023)+64;var c=e.charCodeAt(++s)&1023;t[r++]=240|i>>8&7,t[r++]=128|i>>2&63,t[r++]=128|c>>6&15|(i&3)<<4,t[r++]=128|c&63}else t[r++]=224|i>>12&15,t[r++]=128|i>>6&63,t[r++]=128|i&63;r>n&&(a.push(t.slice(0,r)),r=0,t=Wr(65535),n=65530)}return a.push(t.slice(0,r)),Gr(a)}var rr=/\\u0000/g,Fa=/[\\u0001-\\u0006]/g;function ua(e){for(var a="",r=e.length-1;r>=0;)a+=e.charAt(r--);return a}function Tr(e,a){var r=""+e;return r.length>=a?r:De("0",a-r.length)+r}function Ot(e,a){var r=""+e;return r.length>=a?r:De(" ",a-r.length)+r}function at(e,a){var r=""+e;return r.length>=a?r:r+De(" ",a-r.length)}function gi(e,a){var r=""+Math.round(e);return r.length>=a?r:De("0",a-r.length)+r}function mi(e,a){var r=""+e;return r.length>=a?r:De("0",a-r.length)+r}var O0=Math.pow(2,32);function xa(e,a){if(e>O0||e<-O0)return gi(e,a);var r=Math.round(e);return mi(r,a)}function tt(e,a){return a=a||0,e.length>=7+a&&(e.charCodeAt(a)|32)===103&&(e.charCodeAt(a+1)|32)===101&&(e.charCodeAt(a+2)|32)===110&&(e.charCodeAt(a+3)|32)===101&&(e.charCodeAt(a+4)|32)===114&&(e.charCodeAt(a+5)|32)===97&&(e.charCodeAt(a+6)|32)===108}var R0=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Rt=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function _i(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var ue={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},I0={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Ei={5:'"$"#,##0_);\\\\("$"#,##0\\\\)',63:'"$"#,##0_);\\\\("$"#,##0\\\\)',6:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',64:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',7:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',65:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',8:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',66:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',41:'_(* #,##0_);_(* \\\\(#,##0\\\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\\\(#,##0\\\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\\\(#,##0.00\\\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\\\(#,##0.00\\\\);_("$"* "-"??_);_(@_)'};function nt(e,a,r){for(var n=e<0?-1:1,t=e*n,s=0,i=1,c=0,f=1,l=0,o=0,h=Math.floor(t);l<a&&(h=Math.floor(t),c=h*i+s,o=h*l+f,!(t-h<5e-8));)t=1/(t-h),s=i,i=c,f=l,l=o;if(o>a&&(l>a?(o=f,c=s):(o=l,c=i)),!r)return[0,n*c,o];var x=Math.floor(n*c/o);return[x,n*c-x*o,o]}function Xr(e,a,r){if(e>2958465||e<0)return null;var n=e|0,t=Math.floor(86400*(e-n)),s=0,i=[],c={D:n,T:t,u:86400*(e-n)-t,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(c.u)<1e-6&&(c.u=0),a&&a.date1904&&(n+=1462),c.u>.9999&&(c.u=0,++t==86400&&(c.T=t=0,++n,++c.D)),n===60)i=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)i=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var f=new Date(1900,0,1);f.setDate(f.getDate()+n-1),i=[f.getFullYear(),f.getMonth()+1,f.getDate()],s=f.getDay(),n<60&&(s=(s+6)%7),r&&(s=Si(f,i))}return c.y=i[0],c.m=i[1],c.d=i[2],c.S=t%60,t=Math.floor(t/60),c.M=t%60,t=Math.floor(t/60),c.H=t,c.q=s,c}var N0=new Date(1899,11,31,0,0,0),Ti=N0.getTime(),ki=new Date(1900,2,1,0,0,0);function P0(e,a){var r=e.getTime();return a?r-=1461*24*60*60*1e3:e>=ki&&(r+=1440*60*1e3),(r-(Ti+(e.getTimezoneOffset()-N0.getTimezoneOffset())*6e4))/(1440*60*1e3)}function It(e){return e.indexOf(".")==-1?e:e.replace(/(?:\\.0*|(\\.\\d*[1-9])0+)$/,"$1")}function wi(e){return e.indexOf("E")==-1?e:e.replace(/(?:\\.0*|(\\.\\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\\d)$/,"$10$2")}function Fi(e){var a=e<0?12:11,r=It(e.toFixed(12));return r.length<=a||(r=e.toPrecision(10),r.length<=a)?r:e.toExponential(5)}function Ai(e){var a=It(e.toFixed(11));return a.length>(e<0?12:11)||a==="0"||a==="-0"?e.toPrecision(6):a}function Aa(e){var a=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return a>=-4&&a<=-1?r=e.toPrecision(10+a):Math.abs(a)<=9?r=Fi(e):a===10?r=e.toFixed(10).substr(0,12):r=Ai(e),It(wi(r.toUpperCase()))}function ea(e,a){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):Aa(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return or(14,P0(e,a&&a.date1904),a)}throw new Error("unsupported value in General format: "+e)}function Si(e,a){a[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Ci(e,a,r,n){var t="",s=0,i=0,c=r.y,f,l=0;switch(e){case 98:c=r.y+543;case 121:switch(a.length){case 1:case 2:f=c%100,l=2;break;default:f=c%1e4,l=4;break}break;case 109:switch(a.length){case 1:case 2:f=r.m,l=a.length;break;case 3:return Rt[r.m-1][1];case 5:return Rt[r.m-1][0];default:return Rt[r.m-1][2]}break;case 100:switch(a.length){case 1:case 2:f=r.d,l=a.length;break;case 3:return R0[r.q][0];default:return R0[r.q][1]}break;case 104:switch(a.length){case 1:case 2:f=1+(r.H+11)%12,l=a.length;break;default:throw"bad hour format: "+a}break;case 72:switch(a.length){case 1:case 2:f=r.H,l=a.length;break;default:throw"bad hour format: "+a}break;case 77:switch(a.length){case 1:case 2:f=r.M,l=a.length;break;default:throw"bad minute format: "+a}break;case 115:if(a!="s"&&a!="ss"&&a!=".0"&&a!=".00"&&a!=".000")throw"bad second format: "+a;return r.u===0&&(a=="s"||a=="ss")?Tr(r.S,a.length):(n>=2?i=n===3?1e3:100:i=n===1?10:1,s=Math.round(i*(r.S+r.u)),s>=60*i&&(s=0),a==="s"?s===0?"0":""+s/i:(t=Tr(s,2+n),a==="ss"?t.substr(0,2):"."+t.substr(2,a.length-1)));case 90:switch(a){case"[h]":case"[hh]":f=r.D*24+r.H;break;case"[m]":case"[mm]":f=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":f=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+a}l=a.length===3?1:2;break;case 101:f=c,l=1;break}var o=l>0?Tr(f,l):"";return o}function zr(e){var a=3;if(e.length<=a)return e;for(var r=e.length%a,n=e.substr(0,r);r!=e.length;r+=a)n+=(n.length>0?",":"")+e.substr(r,a);return n}var L0=/%/g;function yi(e,a,r){var n=a.replace(L0,""),t=a.length-n.length;return Ir(e,n,r*Math.pow(10,2*t))+De("%",t)}function Di(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Ir(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function M0(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+M0(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var s=Math.floor(Math.log(a)*Math.LOG10E)%t;if(s<0&&(s+=t),r=(a/Math.pow(10,s)).toPrecision(n+1+(t+s)%t),r.indexOf("e")===-1){var i=Math.floor(Math.log(a)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,t)+"."+r.substr(2+t),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\\./,"0.");r=r.replace(/\\+-/,"-")}r=r.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function(c,f,l,o){return f+l+o.substr(0,(t+s)%t)+"."+o.substr(s)+"E"})}else r=a.toExponential(n);return e.match(/E\\+00$/)&&r.match(/e[+-]\\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\\-/)&&r.match(/e\\+/)&&(r=r.replace(/e\\+/,"e")),r.replace("e","E")}var B0=/# (\\?+)( ?)\\/( ?)(\\d+)/;function Oi(e,a,r){var n=parseInt(e[4],10),t=Math.round(a*n),s=Math.floor(t/n),i=t-s*n,c=n;return r+(s===0?"":""+s)+" "+(i===0?De(" ",e[1].length+1+e[4].length):Ot(i,e[1].length)+e[2]+"/"+e[3]+Tr(c,e[4].length))}function Ri(e,a,r){return r+(a===0?"":""+a)+De(" ",e[1].length+2+e[4].length)}var b0=/^#*0*\\.([0#]+)/,U0=/\\).*[0#]/,H0=/\\(###\\) ###\\\\?-####/;function ar(e){for(var a="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:a+=" ";break;case 48:a+="0";break;default:a+=String.fromCharCode(r)}return a}function V0(e,a){var r=Math.pow(10,a);return""+Math.round(e*r)/r}function W0(e,a){var r=e-Math.floor(e),n=Math.pow(10,a);return a<(""+Math.round(r*n)).length?0:Math.round(r*n)}function Ii(e,a){return a<(""+Math.round((e-Math.floor(e))*Math.pow(10,a))).length?1:0}function Ni(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function xr(e,a,r){if(e.charCodeAt(0)===40&&!a.match(U0)){var n=a.replace(/\\( */,"").replace(/ \\)/,"").replace(/\\)/,"");return r>=0?xr("n",n,r):"("+xr("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Di(e,a,r);if(a.indexOf("%")!==-1)return yi(e,a,r);if(a.indexOf("E")!==-1)return M0(a,r);if(a.charCodeAt(0)===36)return"$"+xr(e,a.substr(a.charAt(1)==" "?2:1),r);var t,s,i,c,f=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+xa(f,a.length);if(a.match(/^[#?]+$/))return t=xa(r,0),t==="0"&&(t=""),t.length>a.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(B0))return Oi(s,f,l);if(a.match(/^#+0+$/))return l+xa(f,a.length-a.indexOf("0"));if(s=a.match(b0))return t=V0(r,s[1].length).replace(/^([^\\.]+)$/,"$1."+ar(s[1])).replace(/\\.$/,"."+ar(s[1])).replace(/\\.(\\d*)$/,function(v,u){return"."+u+De("0",ar(s[1]).length-u.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\\./,".");if(a=a.replace(/^#+([0.])/,"$1"),s=a.match(/^(0*)\\.(#*)$/))return l+V0(f,s[2].length).replace(/\\.(\\d*[1-9])0*$/,".$1").replace(/^(-?\\d*)$/,"$1.").replace(/^0\\./,s[1].length?"0.":".");if(s=a.match(/^#{1,3},##0(\\.?)$/))return l+zr(xa(f,0));if(s=a.match(/^#,##0\\.([#0]*0)$/))return r<0?"-"+xr(e,a,-r):zr(""+(Math.floor(r)+Ii(r,s[1].length)))+"."+Tr(W0(r,s[1].length),s[1].length);if(s=a.match(/^#,#*,#0/))return xr(e,a.replace(/^#,#*,/,""),r);if(s=a.match(/^([0#]+)(\\\\?-([0#]+))+$/))return t=ua(xr(e,a.replace(/[\\\\-]/g,""),r)),i=0,ua(ua(a.replace(/\\\\/g,"")).replace(/[0#]/g,function(v){return i<t.length?t.charAt(i++):v==="0"?"0":""}));if(a.match(H0))return t=xr(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(s=a.match(/^([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),c=nt(f,Math.pow(10,i)-1,!1),t=""+l,o=Ir("n",s[1],c[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+s[2]+"/"+s[3],o=at(c[2],i),o.length<s[4].length&&(o=ar(s[4].substr(s[4].length-o.length))+o),t+=o,t;if(s=a.match(/^# ([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),c=nt(f,Math.pow(10,i)-1,!0),l+(c[0]||(c[1]?"":"0"))+" "+(c[1]?Ot(c[1],i)+s[2]+"/"+s[3]+at(c[2],i):De(" ",2*i+1+s[2].length+s[3].length));if(s=a.match(/^[#0?]+$/))return t=xa(r,0),a.length<=t.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(/^([#0?]+)\\.([#0]+)$/)){t=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=t.indexOf(".");var h=a.indexOf(".")-i,x=a.length-t.length-h;return ar(a.substr(0,h)+t+a.substr(a.length-x))}if(s=a.match(/^00,000\\.([#0]*0)$/))return i=W0(r,s[1].length),r<0?"-"+xr(e,a,-r):zr(Ni(r)).replace(/^\\d,\\d{3}$/,"0$&").replace(/^\\d*$/,function(v){return"00,"+(v.length<3?Tr(0,3-v.length):"")+v})+"."+Tr(i,s[1].length);switch(a){case"###,##0.00":return xr(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var d=zr(xa(f,0));return d!=="0"?l+d:"";case"###,###.00":return xr(e,"###,##0.00",r).replace(/^0\\./,".");case"#,###.00":return xr(e,"#,##0.00",r).replace(/^0\\./,".")}throw new Error("unsupported format |"+a+"|")}function Pi(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Ir(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function Li(e,a,r){var n=a.replace(L0,""),t=a.length-n.length;return Ir(e,n,r*Math.pow(10,2*t))+De("%",t)}function G0(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+G0(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var s=Math.floor(Math.log(a)*Math.LOG10E)%t;if(s<0&&(s+=t),r=(a/Math.pow(10,s)).toPrecision(n+1+(t+s)%t),!r.match(/[Ee]/)){var i=Math.floor(Math.log(a)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s),r=r.replace(/\\+-/,"-")}r=r.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function(c,f,l,o){return f+l+o.substr(0,(t+s)%t)+"."+o.substr(s)+"E"})}else r=a.toExponential(n);return e.match(/E\\+00$/)&&r.match(/e[+-]\\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\\-/)&&r.match(/e\\+/)&&(r=r.replace(/e\\+/,"e")),r.replace("e","E")}function Ar(e,a,r){if(e.charCodeAt(0)===40&&!a.match(U0)){var n=a.replace(/\\( */,"").replace(/ \\)/,"").replace(/\\)/,"");return r>=0?Ar("n",n,r):"("+Ar("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Pi(e,a,r);if(a.indexOf("%")!==-1)return Li(e,a,r);if(a.indexOf("E")!==-1)return G0(a,r);if(a.charCodeAt(0)===36)return"$"+Ar(e,a.substr(a.charAt(1)==" "?2:1),r);var t,s,i,c,f=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+Tr(f,a.length);if(a.match(/^[#?]+$/))return t=""+r,r===0&&(t=""),t.length>a.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(B0))return Ri(s,f,l);if(a.match(/^#+0+$/))return l+Tr(f,a.length-a.indexOf("0"));if(s=a.match(b0))return t=(""+r).replace(/^([^\\.]+)$/,"$1."+ar(s[1])).replace(/\\.$/,"."+ar(s[1])),t=t.replace(/\\.(\\d*)$/,function(v,u){return"."+u+De("0",ar(s[1]).length-u.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\\./,".");if(a=a.replace(/^#+([0.])/,"$1"),s=a.match(/^(0*)\\.(#*)$/))return l+(""+f).replace(/\\.(\\d*[1-9])0*$/,".$1").replace(/^(-?\\d*)$/,"$1.").replace(/^0\\./,s[1].length?"0.":".");if(s=a.match(/^#{1,3},##0(\\.?)$/))return l+zr(""+f);if(s=a.match(/^#,##0\\.([#0]*0)$/))return r<0?"-"+Ar(e,a,-r):zr(""+r)+"."+De("0",s[1].length);if(s=a.match(/^#,#*,#0/))return Ar(e,a.replace(/^#,#*,/,""),r);if(s=a.match(/^([0#]+)(\\\\?-([0#]+))+$/))return t=ua(Ar(e,a.replace(/[\\\\-]/g,""),r)),i=0,ua(ua(a.replace(/\\\\/g,"")).replace(/[0#]/g,function(v){return i<t.length?t.charAt(i++):v==="0"?"0":""}));if(a.match(H0))return t=Ar(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(s=a.match(/^([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),c=nt(f,Math.pow(10,i)-1,!1),t=""+l,o=Ir("n",s[1],c[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+s[2]+"/"+s[3],o=at(c[2],i),o.length<s[4].length&&(o=ar(s[4].substr(s[4].length-o.length))+o),t+=o,t;if(s=a.match(/^# ([#0?]+)( ?)\\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),c=nt(f,Math.pow(10,i)-1,!0),l+(c[0]||(c[1]?"":"0"))+" "+(c[1]?Ot(c[1],i)+s[2]+"/"+s[3]+at(c[2],i):De(" ",2*i+1+s[2].length+s[3].length));if(s=a.match(/^[#0?]+$/))return t=""+r,a.length<=t.length?t:ar(a.substr(0,a.length-t.length))+t;if(s=a.match(/^([#0]+)\\.([#0]+)$/)){t=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=t.indexOf(".");var h=a.indexOf(".")-i,x=a.length-t.length-h;return ar(a.substr(0,h)+t+a.substr(a.length-x))}if(s=a.match(/^00,000\\.([#0]*0)$/))return r<0?"-"+Ar(e,a,-r):zr(""+r).replace(/^\\d,\\d{3}$/,"0$&").replace(/^\\d*$/,function(v){return"00,"+(v.length<3?Tr(0,3-v.length):"")+v})+"."+Tr(0,s[1].length);switch(a){case"###,###":case"##,###":case"#,###":var d=zr(""+f);return d!=="0"?l+d:"";default:if(a.match(/\\.[0#?]*$/))return Ar(e,a.slice(0,a.lastIndexOf(".")),r)+ar(a.slice(a.lastIndexOf(".")))}throw new Error("unsupported format |"+a+"|")}function Ir(e,a,r){return(r|0)===r?Ar(e,a,r):xr(e,a,r)}function Mi(e){for(var a=[],r=!1,n=0,t=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:a[a.length]=e.substr(t,n-t),t=n+1}if(a[a.length]=e.substr(t),r===!0)throw new Error("Format |"+e+"| unterminated string ");return a}var X0=/\\[[HhMmSs\\u0E0A\\u0E19\\u0E17]*\\]/;function ra(e){for(var a=0,r="",n="";a<e.length;)switch(r=e.charAt(a)){case"G":tt(e,a)&&(a+=6),a++;break;case'"':for(;e.charCodeAt(++a)!==34&&a<e.length;);++a;break;case"\\\\":a+=2;break;case"_":a+=2;break;case"@":++a;break;case"B":case"b":if(e.charAt(a+1)==="1"||e.charAt(a+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(a,3).toUpperCase()==="A/P"||e.substr(a,5).toUpperCase()==="AM/PM"||e.substr(a,5).toUpperCase()==="上午/下午")return!0;++a;break;case"[":for(n=r;e.charAt(a++)!=="]"&&a<e.length;)n+=e.charAt(a);if(n.match(X0))return!0;break;case".":case"0":case"#":for(;a<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++a))>-1||r=="\\\\"&&e.charAt(a+1)=="-"&&"0#".indexOf(e.charAt(a+2))>-1););break;case"?":for(;e.charAt(++a)===r;);break;case"*":++a,(e.charAt(a)==" "||e.charAt(a)=="*")&&++a;break;case"(":case")":++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;a<e.length&&"0123456789".indexOf(e.charAt(++a))>-1;);break;case" ":++a;break;default:++a;break}return!1}function Bi(e,a,r,n){for(var t=[],s="",i=0,c="",f="t",l,o,h,x="H";i<e.length;)switch(c=e.charAt(i)){case"G":if(!tt(e,i))throw new Error("unrecognized character "+c+" in "+e);t[t.length]={t:"G",v:"General"},i+=7;break;case'"':for(s="";(h=e.charCodeAt(++i))!==34&&i<e.length;)s+=String.fromCharCode(h);t[t.length]={t:"t",v:s},++i;break;case"\\\\":var d=e.charAt(++i),v=d==="("||d===")"?d:"t";t[t.length]={t:v,v:d},++i;break;case"_":t[t.length]={t:"t",v:" "},i+=2;break;case"@":t[t.length]={t:"T",v:a},++i;break;case"B":case"b":if(e.charAt(i+1)==="1"||e.charAt(i+1)==="2"){if(l==null&&(l=Xr(a,r,e.charAt(i+1)==="2"),l==null))return"";t[t.length]={t:"X",v:e.substr(i,2)},f=c,i+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":c=c.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(a<0||l==null&&(l=Xr(a,r),l==null))return"";for(s=c;++i<e.length&&e.charAt(i).toLowerCase()===c;)s+=c;c==="m"&&f.toLowerCase()==="h"&&(c="M"),c==="h"&&(c=x),t[t.length]={t:c,v:s},f=c;break;case"A":case"a":case"上":var u={t:c,v:c};if(l==null&&(l=Xr(a,r)),e.substr(i,3).toUpperCase()==="A/P"?(l!=null&&(u.v=l.H>=12?"P":"A"),u.t="T",x="h",i+=3):e.substr(i,5).toUpperCase()==="AM/PM"?(l!=null&&(u.v=l.H>=12?"PM":"AM"),u.t="T",i+=5,x="h"):e.substr(i,5).toUpperCase()==="上午/下午"?(l!=null&&(u.v=l.H>=12?"下午":"上午"),u.t="T",i+=5,x="h"):(u.t="t",++i),l==null&&u.t==="T")return"";t[t.length]=u,f=c;break;case"[":for(s=c;e.charAt(i++)!=="]"&&i<e.length;)s+=e.charAt(i);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(X0)){if(l==null&&(l=Xr(a,r),l==null))return"";t[t.length]={t:"Z",v:s.toLowerCase()},f=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\\$([^-\\[\\]]*)/)||[])[1]||"$",ra(e)||(t[t.length]={t:"t",v:s}));break;case".":if(l!=null){for(s=c;++i<e.length&&(c=e.charAt(i))==="0";)s+=c;t[t.length]={t:"s",v:s};break}case"0":case"#":for(s=c;++i<e.length&&"0#?.,E+-%".indexOf(c=e.charAt(i))>-1;)s+=c;t[t.length]={t:"n",v:s};break;case"?":for(s=c;e.charAt(++i)===c;)s+=c;t[t.length]={t:c,v:s},f=c;break;case"*":++i,(e.charAt(i)==" "||e.charAt(i)=="*")&&++i;break;case"(":case")":t[t.length]={t:n===1?"t":c,v:c},++i;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=c;i<e.length&&"0123456789".indexOf(e.charAt(++i))>-1;)s+=e.charAt(i);t[t.length]={t:"D",v:s};break;case" ":t[t.length]={t:c,v:c},++i;break;case"$":t[t.length]={t:"t",v:"$"},++i;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c)===-1)throw new Error("unrecognized character "+c+" in "+e);t[t.length]={t:"t",v:c},++i;break}var g=0,S=0,y;for(i=t.length-1,f="t";i>=0;--i)switch(t[i].t){case"h":case"H":t[i].t=x,f="h",g<1&&(g=1);break;case"s":(y=t[i].v.match(/\\.0+$/))&&(S=Math.max(S,y[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":f=t[i].t;break;case"m":f==="s"&&(t[i].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&t[i].v.match(/[Hh]/)&&(g=1),g<2&&t[i].v.match(/[Mm]/)&&(g=2),g<3&&t[i].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M),l.M>=60&&(l.M=0,++l.H);break;case 2:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M);break}var _="",N;for(i=0;i<t.length;++i)switch(t[i].t){case"t":case"T":case" ":case"D":break;case"X":t[i].v="",t[i].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":t[i].v=Ci(t[i].t.charCodeAt(0),t[i].v,l,S),t[i].t="t";break;case"n":case"?":for(N=i+1;t[N]!=null&&((c=t[N].t)==="?"||c==="D"||(c===" "||c==="t")&&t[N+1]!=null&&(t[N+1].t==="?"||t[N+1].t==="t"&&t[N+1].v==="/")||t[i].t==="("&&(c===" "||c==="n"||c===")")||c==="t"&&(t[N].v==="/"||t[N].v===" "&&t[N+1]!=null&&t[N+1].t=="?"));)t[i].v+=t[N].v,t[N]={v:"",t:";"},++N;_+=t[i].v,i=N-1;break;case"G":t[i].t="t",t[i].v=ea(a,r);break}var b="",I,F;if(_.length>0){_.charCodeAt(0)==40?(I=a<0&&_.charCodeAt(0)===45?-a:a,F=Ir("n",_,I)):(I=a<0&&n>1?-a:a,F=Ir("n",_,I),I<0&&t[0]&&t[0].t=="t"&&(F=F.substr(1),t[0].v="-"+t[0].v)),N=F.length-1;var V=t.length;for(i=0;i<t.length;++i)if(t[i]!=null&&t[i].t!="t"&&t[i].v.indexOf(".")>-1){V=i;break}var D=t.length;if(V===t.length&&F.indexOf("E")===-1){for(i=t.length-1;i>=0;--i)t[i]==null||"n?".indexOf(t[i].t)===-1||(N>=t[i].v.length-1?(N-=t[i].v.length,t[i].v=F.substr(N+1,t[i].v.length)):N<0?t[i].v="":(t[i].v=F.substr(0,N+1),N=-1),t[i].t="t",D=i);N>=0&&D<t.length&&(t[D].v=F.substr(0,N+1)+t[D].v)}else if(V!==t.length&&F.indexOf("E")===-1){for(N=F.indexOf(".")-1,i=V;i>=0;--i)if(!(t[i]==null||"n?".indexOf(t[i].t)===-1)){for(o=t[i].v.indexOf(".")>-1&&i===V?t[i].v.indexOf(".")-1:t[i].v.length-1,b=t[i].v.substr(o+1);o>=0;--o)N>=0&&(t[i].v.charAt(o)==="0"||t[i].v.charAt(o)==="#")&&(b=F.charAt(N--)+b);t[i].v=b,t[i].t="t",D=i}for(N>=0&&D<t.length&&(t[D].v=F.substr(0,N+1)+t[D].v),N=F.indexOf(".")+1,i=V;i<t.length;++i)if(!(t[i]==null||"n?(".indexOf(t[i].t)===-1&&i!==V)){for(o=t[i].v.indexOf(".")>-1&&i===V?t[i].v.indexOf(".")+1:0,b=t[i].v.substr(0,o);o<t[i].v.length;++o)N<F.length&&(b+=F.charAt(N++));t[i].v=b,t[i].t="t",D=i}}}for(i=0;i<t.length;++i)t[i]!=null&&"n?".indexOf(t[i].t)>-1&&(I=n>1&&a<0&&i>0&&t[i-1].v==="-"?-a:a,t[i].v=Ir(t[i].t,t[i].v,I),t[i].t="t");var z="";for(i=0;i!==t.length;++i)t[i]!=null&&(z+=t[i].v);return z}var z0=/\\[(=|>[=]?|<[>=]?)(-?\\d+(?:\\.\\d*)?)\\]/;function $0(e,a){if(a==null)return!1;var r=parseFloat(a[2]);switch(a[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function bi(e,a){var r=Mi(e),n=r.length,t=r[n-1].indexOf("@");if(n<4&&t>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof a!="number")return[4,r.length===4||t>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=t>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=t>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=t>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=a>0?r[0]:a<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\\[[=<>]/)!=null||r[1].match(/\\[[=<>]/)!=null){var i=r[0].match(z0),c=r[1].match(z0);return $0(a,i)?[n,r[0]]:$0(a,c)?[n,r[1]]:[n,r[i!=null&&c!=null?2:1]]}return[n,s]}function or(e,a,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:ue)[e],n==null&&(n=r.table&&r.table[I0[e]]||ue[I0[e]]),n==null&&(n=Ei[e]||"General");break}if(tt(n,0))return ea(a,r);a instanceof Date&&(a=P0(a,r.date1904));var t=bi(n,a);if(tt(t[1]))return ea(a,r);if(a===!0)a="TRUE";else if(a===!1)a="FALSE";else if(a===""||a==null)return"";return Bi(t[1],a,r,t[0])}function Nr(e,a){if(typeof a!="number"){a=+a||-1;for(var r=0;r<392;++r){if(ue[r]==null){a<0&&(a=r);continue}if(ue[r]==e){a=r;break}}a<0&&(a=391)}return ue[a]=e,a}function Ui(e){for(var a=0;a!=392;++a)e[a]!==void 0&&Nr(e[a],a)}function K0(){ue=_i()}var Y0={format:or,load:Nr,_table:ue,load_table:Ui,parse_date_code:Xr,is_date:ra,get_table:function(){return Y0._table=ue}},Hi={5:'"$"#,##0_);\\\\("$"#,##0\\\\)',6:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',7:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',8:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\\\("$"#,##0\\\\)',64:'"$"#,##0_);[Red]\\\\("$"#,##0\\\\)',65:'"$"#,##0.00_);\\\\("$"#,##0.00\\\\)',66:'"$"#,##0.00_);[Red]\\\\("$"#,##0.00\\\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},j0=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function Vi(e){var a=typeof e=="number"?ue[e]:e;return a=a.replace(j0,"(\\\\d+)"),new RegExp("^"+a+"$")}function Wi(e,a,r){var n=-1,t=-1,s=-1,i=-1,c=-1,f=-1;(a.match(j0)||[]).forEach(function(h,x){var d=parseInt(r[x+1],10);switch(h.toLowerCase().charAt(0)){case"y":n=d;break;case"d":s=d;break;case"h":i=d;break;case"s":f=d;break;case"m":i>=0?c=d:t=d;break}}),f>=0&&c==-1&&t>=0&&(c=t,t=-1);var l=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(t>=1?t:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);l.length==7&&(l="0"+l),l.length==8&&(l="20"+l);var o=("00"+(i>=0?i:0)).slice(-2)+":"+("00"+(c>=0?c:0)).slice(-2)+":"+("00"+(f>=0?f:0)).slice(-2);return i==-1&&c==-1&&f==-1?l:n==-1&&t==-1&&s==-1?o:l+"T"+o}var Gi=(function(){var e={};e.version="1.2.0";function a(){for(var F=0,V=new Array(256),D=0;D!=256;++D)F=D,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,V[D]=F;return typeof Int32Array<"u"?new Int32Array(V):V}var r=a();function n(F){var V=0,D=0,z=0,G=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(z=0;z!=256;++z)G[z]=F[z];for(z=0;z!=256;++z)for(D=F[z],V=256+z;V<4096;V+=256)D=G[V]=D>>>8^F[D&255];var P=[];for(z=1;z!=16;++z)P[z-1]=typeof Int32Array<"u"?G.subarray(z*256,z*256+256):G.slice(z*256,z*256+256);return P}var t=n(r),s=t[0],i=t[1],c=t[2],f=t[3],l=t[4],o=t[5],h=t[6],x=t[7],d=t[8],v=t[9],u=t[10],g=t[11],S=t[12],y=t[13],_=t[14];function N(F,V){for(var D=V^-1,z=0,G=F.length;z<G;)D=D>>>8^r[(D^F.charCodeAt(z++))&255];return~D}function b(F,V){for(var D=V^-1,z=F.length-15,G=0;G<z;)D=_[F[G++]^D&255]^y[F[G++]^D>>8&255]^S[F[G++]^D>>16&255]^g[F[G++]^D>>>24]^u[F[G++]]^v[F[G++]]^d[F[G++]]^x[F[G++]]^h[F[G++]]^o[F[G++]]^l[F[G++]]^f[F[G++]]^c[F[G++]]^i[F[G++]]^s[F[G++]]^r[F[G++]];for(z+=15;G<z;)D=D>>>8^r[(D^F[G++])&255];return~D}function I(F,V){for(var D=V^-1,z=0,G=F.length,P=0,J=0;z<G;)P=F.charCodeAt(z++),P<128?D=D>>>8^r[(D^P)&255]:P<2048?(D=D>>>8^r[(D^(192|P>>6&31))&255],D=D>>>8^r[(D^(128|P&63))&255]):P>=55296&&P<57344?(P=(P&1023)+64,J=F.charCodeAt(z++)&1023,D=D>>>8^r[(D^(240|P>>8&7))&255],D=D>>>8^r[(D^(128|P>>2&63))&255],D=D>>>8^r[(D^(128|J>>6&15|(P&3)<<4))&255],D=D>>>8^r[(D^(128|J&63))&255]):(D=D>>>8^r[(D^(224|P>>12&15))&255],D=D>>>8^r[(D^(128|P>>6&63))&255],D=D>>>8^r[(D^(128|P&63))&255]);return~D}return e.table=r,e.bstr=N,e.buf=b,e.str=I,e})(),me=(function(){var a={};a.version="1.2.1";function r(p,T){for(var m=p.split("/"),E=T.split("/"),k=0,w=0,M=Math.min(m.length,E.length);k<M;++k){if(w=m[k].length-E[k].length)return w;if(m[k]!=E[k])return m[k]<E[k]?-1:1}return m.length-E.length}function n(p){if(p.charAt(p.length-1)=="/")return p.slice(0,-1).indexOf("/")===-1?p:n(p.slice(0,-1));var T=p.lastIndexOf("/");return T===-1?p:p.slice(0,T+1)}function t(p){if(p.charAt(p.length-1)=="/")return t(p.slice(0,-1));var T=p.lastIndexOf("/");return T===-1?p:p.slice(T+1)}function s(p,T){typeof T=="string"&&(T=new Date(T));var m=T.getHours();m=m<<6|T.getMinutes(),m=m<<5|T.getSeconds()>>>1,p.write_shift(2,m);var E=T.getFullYear()-1980;E=E<<4|T.getMonth()+1,E=E<<5|T.getDate(),p.write_shift(2,E)}function i(p){var T=p.read_shift(2)&65535,m=p.read_shift(2)&65535,E=new Date,k=m&31;m>>>=5;var w=m&15;m>>>=4,E.setMilliseconds(0),E.setFullYear(m+1980),E.setMonth(w-1),E.setDate(k);var M=T&31;T>>>=5;var X=T&63;return T>>>=6,E.setHours(T),E.setMinutes(X),E.setSeconds(M<<1),E}function c(p){ze(p,0);for(var T={},m=0;p.l<=p.length-4;){var E=p.read_shift(2),k=p.read_shift(2),w=p.l+k,M={};switch(E){case 21589:m=p.read_shift(1),m&1&&(M.mtime=p.read_shift(4)),k>5&&(m&2&&(M.atime=p.read_shift(4)),m&4&&(M.ctime=p.read_shift(4))),M.mtime&&(M.mt=new Date(M.mtime*1e3));break}p.l=w,T[E]=M}return T}var f;function l(){return f||(f={})}function o(p,T){if(p[0]==80&&p[1]==75)return ui(p,T);if((p[0]|32)==109&&(p[1]|32)==105)return Nd(p,T);if(p.length<512)throw new Error("CFB file size "+p.length+" < 512");var m=3,E=512,k=0,w=0,M=0,X=0,L=0,B=[],H=p.slice(0,512);ze(H,0);var Y=h(H);switch(m=Y[0],m){case 3:E=512;break;case 4:E=4096;break;case 0:if(Y[1]==0)return ui(p,T);default:throw new Error("Major Version: Expected 3 or 4 saw "+m)}E!==512&&(H=p.slice(0,E),ze(H,28));var Q=p.slice(0,E);x(H,m);var se=H.read_shift(4,"i");if(m===3&&se!==0)throw new Error("# Directory Sectors: Expected 0 saw "+se);H.l+=4,M=H.read_shift(4,"i"),H.l+=4,H.chk("00100000","Mini Stream Cutoff Size: "),X=H.read_shift(4,"i"),k=H.read_shift(4,"i"),L=H.read_shift(4,"i"),w=H.read_shift(4,"i");for(var Z=-1,te=0;te<109&&(Z=H.read_shift(4,"i"),!(Z<0));++te)B[te]=Z;var de=d(p,E);g(L,w,de,E,B);var Ce=y(de,M,B,E);Ce[M].name="!Directory",k>0&&X!==J&&(Ce[X].name="!MiniFAT"),Ce[B[0]].name="!FAT",Ce.fat_addrs=B,Ce.ssz=E;var ye={},er=[],qa=[],Qa=[];_(M,Ce,de,er,k,ye,qa,X),v(qa,Qa,er),er.shift();var et={FileIndex:qa,FullPaths:Qa};return T&&T.raw&&(et.raw={header:Q,sectors:de}),et}function h(p){if(p[p.l]==80&&p[p.l+1]==75)return[0,0];p.chk(fe,"Header Signature: "),p.l+=16;var T=p.read_shift(2,"u");return[p.read_shift(2,"u"),T]}function x(p,T){var m=9;switch(p.l+=2,m=p.read_shift(2)){case 9:if(T!=3)throw new Error("Sector Shift: Expected 9 saw "+m);break;case 12:if(T!=4)throw new Error("Sector Shift: Expected 12 saw "+m);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+m)}p.chk("0600","Mini Sector Shift: "),p.chk("000000000000","Reserved: ")}function d(p,T){for(var m=Math.ceil(p.length/T)-1,E=[],k=1;k<m;++k)E[k-1]=p.slice(k*T,(k+1)*T);return E[m-1]=p.slice(m*T),E}function v(p,T,m){for(var E=0,k=0,w=0,M=0,X=0,L=m.length,B=[],H=[];E<L;++E)B[E]=H[E]=E,T[E]=m[E];for(;X<H.length;++X)E=H[X],k=p[E].L,w=p[E].R,M=p[E].C,B[E]===E&&(k!==-1&&B[k]!==k&&(B[E]=B[k]),w!==-1&&B[w]!==w&&(B[E]=B[w])),M!==-1&&(B[M]=E),k!==-1&&E!=B[E]&&(B[k]=B[E],H.lastIndexOf(k)<X&&H.push(k)),w!==-1&&E!=B[E]&&(B[w]=B[E],H.lastIndexOf(w)<X&&H.push(w));for(E=1;E<L;++E)B[E]===E&&(w!==-1&&B[w]!==w?B[E]=B[w]:k!==-1&&B[k]!==k&&(B[E]=B[k]));for(E=1;E<L;++E)if(p[E].type!==0){if(X=E,X!=B[X])do X=B[X],T[E]=T[X]+"/"+T[E];while(X!==0&&B[X]!==-1&&X!=B[X]);B[E]=-1}for(T[0]+="/",E=1;E<L;++E)p[E].type!==2&&(T[E]+="/")}function u(p,T,m){for(var E=p.start,k=p.size,w=[],M=E;m&&k>0&&M>=0;)w.push(T.slice(M*P,M*P+P)),k-=P,M=ta(m,M*4);return w.length===0?be(0):Gr(w).slice(0,p.size)}function g(p,T,m,E,k){var w=J;if(p===J){if(T!==0)throw new Error("DIFAT chain shorter than expected")}else if(p!==-1){var M=m[p],X=(E>>>2)-1;if(!M)return;for(var L=0;L<X&&(w=ta(M,L*4))!==J;++L)k.push(w);g(ta(M,E-4),T-1,m,E,k)}}function S(p,T,m,E,k){var w=[],M=[];k||(k=[]);var X=E-1,L=0,B=0;for(L=T;L>=0;){k[L]=!0,w[w.length]=L,M.push(p[L]);var H=m[Math.floor(L*4/E)];if(B=L*4&X,E<4+B)throw new Error("FAT boundary crossed: "+L+" 4 "+E);if(!p[H])break;L=ta(p[H],B)}return{nodes:w,data:dn([M])}}function y(p,T,m,E){var k=p.length,w=[],M=[],X=[],L=[],B=E-1,H=0,Y=0,Q=0,se=0;for(H=0;H<k;++H)if(X=[],Q=H+T,Q>=k&&(Q-=k),!M[Q]){L=[];var Z=[];for(Y=Q;Y>=0;){Z[Y]=!0,M[Y]=!0,X[X.length]=Y,L.push(p[Y]);var te=m[Math.floor(Y*4/E)];if(se=Y*4&B,E<4+se)throw new Error("FAT boundary crossed: "+Y+" 4 "+E);if(!p[te]||(Y=ta(p[te],se),Z[Y]))break}w[Q]={nodes:X,data:dn([L])}}return w}function _(p,T,m,E,k,w,M,X){for(var L=0,B=E.length?2:0,H=T[p].data,Y=0,Q=0,se;Y<H.length;Y+=128){var Z=H.slice(Y,Y+128);ze(Z,64),Q=Z.read_shift(2),se=bt(Z,0,Q-B),E.push(se);var te={name:se,type:Z.read_shift(1),color:Z.read_shift(1),L:Z.read_shift(4,"i"),R:Z.read_shift(4,"i"),C:Z.read_shift(4,"i"),clsid:Z.read_shift(16),state:Z.read_shift(4,"i"),start:0,size:0},de=Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2);de!==0&&(te.ct=N(Z,Z.l-8));var Ce=Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2)+Z.read_shift(2);Ce!==0&&(te.mt=N(Z,Z.l-8)),te.start=Z.read_shift(4,"i"),te.size=Z.read_shift(4,"i"),te.size<0&&te.start<0&&(te.size=te.type=0,te.start=J,te.name=""),te.type===5?(L=te.start,k>0&&L!==J&&(T[L].name="!StreamData")):te.size>=4096?(te.storage="fat",T[te.start]===void 0&&(T[te.start]=S(m,te.start,T.fat_addrs,T.ssz)),T[te.start].name=te.name,te.content=T[te.start].data.slice(0,te.size)):(te.storage="minifat",te.size<0?te.size=0:L!==J&&te.start!==J&&T[L]&&(te.content=u(te,T[L].data,(T[X]||{}).data))),te.content&&ze(te.content,0),w[se]=te,M.push(te)}}function N(p,T){return new Date((hr(p,T+4)/1e7*Math.pow(2,32)+hr(p,T)/1e7-11644473600)*1e3)}function b(p,T){return l(),o(f.readFileSync(p),T)}function I(p,T){var m=T&&T.type;switch(m||ge&&Buffer.isBuffer(p)&&(m="buffer"),m||"base64"){case"file":return b(p,T);case"base64":return o(Er(fr(p)),T);case"binary":return o(Er(p),T)}return o(p,T)}function F(p,T){var m=T||{},E=m.root||"Root Entry";if(p.FullPaths||(p.FullPaths=[]),p.FileIndex||(p.FileIndex=[]),p.FullPaths.length!==p.FileIndex.length)throw new Error("inconsistent CFB structure");p.FullPaths.length===0&&(p.FullPaths[0]=E+"/",p.FileIndex[0]={name:E,type:5}),m.CLSID&&(p.FileIndex[0].clsid=m.CLSID),V(p)}function V(p){var T="Sh33tJ5";if(!me.find(p,"/"+T)){var m=be(4);m[0]=55,m[1]=m[3]=50,m[2]=54,p.FileIndex.push({name:T,type:2,content:m,size:4,L:69,R:69,C:69}),p.FullPaths.push(p.FullPaths[0]+T),D(p)}}function D(p,T){F(p);for(var m=!1,E=!1,k=p.FullPaths.length-1;k>=0;--k){var w=p.FileIndex[k];switch(w.type){case 0:E?m=!0:(p.FileIndex.pop(),p.FullPaths.pop());break;case 1:case 2:case 5:E=!0,isNaN(w.R*w.L*w.C)&&(m=!0),w.R>-1&&w.L>-1&&w.R==w.L&&(m=!0);break;default:m=!0;break}}if(!(!m&&!T)){var M=new Date(1987,1,19),X=0,L=Object.create?Object.create(null):{},B=[];for(k=0;k<p.FullPaths.length;++k)L[p.FullPaths[k]]=!0,p.FileIndex[k].type!==0&&B.push([p.FullPaths[k],p.FileIndex[k]]);for(k=0;k<B.length;++k){var H=n(B[k][0]);E=L[H],E||(B.push([H,{name:t(H).replace("/",""),type:1,clsid:ce,ct:M,mt:M,content:null}]),L[H]=!0)}for(B.sort(function(se,Z){return r(se[0],Z[0])}),p.FullPaths=[],p.FileIndex=[],k=0;k<B.length;++k)p.FullPaths[k]=B[k][0],p.FileIndex[k]=B[k][1];for(k=0;k<B.length;++k){var Y=p.FileIndex[k],Q=p.FullPaths[k];if(Y.name=t(Q).replace("/",""),Y.L=Y.R=Y.C=-(Y.color=1),Y.size=Y.content?Y.content.length:0,Y.start=0,Y.clsid=Y.clsid||ce,k===0)Y.C=B.length>1?1:-1,Y.size=0,Y.type=5;else if(Q.slice(-1)=="/"){for(X=k+1;X<B.length&&n(p.FullPaths[X])!=Q;++X);for(Y.C=X>=B.length?-1:X,X=k+1;X<B.length&&n(p.FullPaths[X])!=n(Q);++X);Y.R=X>=B.length?-1:X,Y.type=1}else n(p.FullPaths[k+1]||"")==n(Q)&&(Y.R=k+1),Y.type=2}}}function z(p,T){var m=T||{};if(m.fileType=="mad")return Pd(p,m);switch(D(p),m.fileType){case"zip":return Cd(p,m)}var E=(function(se){for(var Z=0,te=0,de=0;de<se.FileIndex.length;++de){var Ce=se.FileIndex[de];if(Ce.content){var ye=Ce.content.length;ye>0&&(ye<4096?Z+=ye+63>>6:te+=ye+511>>9)}}for(var er=se.FullPaths.length+3>>2,qa=Z+7>>3,Qa=Z+127>>7,et=qa+te+er+Qa,ha=et+127>>7,k0=ha<=109?0:Math.ceil((ha-109)/127);et+ha+k0+127>>7>ha;)k0=++ha<=109?0:Math.ceil((ha-109)/127);var Hr=[1,k0,ha,Qa,er,te,Z,0];return se.FileIndex[0].size=Z<<6,Hr[7]=(se.FileIndex[0].start=Hr[0]+Hr[1]+Hr[2]+Hr[3]+Hr[4]+Hr[5])+(Hr[6]+7>>3),Hr})(p),k=be(E[7]<<9),w=0,M=0;{for(w=0;w<8;++w)k.write_shift(1,re[w]);for(w=0;w<8;++w)k.write_shift(2,0);for(k.write_shift(2,62),k.write_shift(2,3),k.write_shift(2,65534),k.write_shift(2,9),k.write_shift(2,6),w=0;w<3;++w)k.write_shift(2,0);for(k.write_shift(4,0),k.write_shift(4,E[2]),k.write_shift(4,E[0]+E[1]+E[2]+E[3]-1),k.write_shift(4,0),k.write_shift(4,4096),k.write_shift(4,E[3]?E[0]+E[1]+E[2]-1:J),k.write_shift(4,E[3]),k.write_shift(-4,E[1]?E[0]-1:J),k.write_shift(4,E[1]),w=0;w<109;++w)k.write_shift(-4,w<E[2]?E[1]+w:-1)}if(E[1])for(M=0;M<E[1];++M){for(;w<236+M*127;++w)k.write_shift(-4,w<E[2]?E[1]+w:-1);k.write_shift(-4,M===E[1]-1?J:M+1)}var X=function(se){for(M+=se;w<M-1;++w)k.write_shift(-4,w+1);se&&(++w,k.write_shift(-4,J))};for(M=w=0,M+=E[1];w<M;++w)k.write_shift(-4,ie.DIFSECT);for(M+=E[2];w<M;++w)k.write_shift(-4,ie.FATSECT);X(E[3]),X(E[4]);for(var L=0,B=0,H=p.FileIndex[0];L<p.FileIndex.length;++L)H=p.FileIndex[L],H.content&&(B=H.content.length,!(B<4096)&&(H.start=M,X(B+511>>9)));for(X(E[6]+7>>3);k.l&511;)k.write_shift(-4,ie.ENDOFCHAIN);for(M=w=0,L=0;L<p.FileIndex.length;++L)H=p.FileIndex[L],H.content&&(B=H.content.length,!(!B||B>=4096)&&(H.start=M,X(B+63>>6)));for(;k.l&511;)k.write_shift(-4,ie.ENDOFCHAIN);for(w=0;w<E[4]<<2;++w){var Y=p.FullPaths[w];if(!Y||Y.length===0){for(L=0;L<17;++L)k.write_shift(4,0);for(L=0;L<3;++L)k.write_shift(4,-1);for(L=0;L<12;++L)k.write_shift(4,0);continue}H=p.FileIndex[w],w===0&&(H.start=H.size?H.start-1:J);var Q=w===0&&m.root||H.name;if(B=2*(Q.length+1),k.write_shift(64,Q,"utf16le"),k.write_shift(2,B),k.write_shift(1,H.type),k.write_shift(1,H.color),k.write_shift(-4,H.L),k.write_shift(-4,H.R),k.write_shift(-4,H.C),H.clsid)k.write_shift(16,H.clsid,"hex");else for(L=0;L<4;++L)k.write_shift(4,0);k.write_shift(4,H.state||0),k.write_shift(4,0),k.write_shift(4,0),k.write_shift(4,0),k.write_shift(4,0),k.write_shift(4,H.start),k.write_shift(4,H.size),k.write_shift(4,0)}for(w=1;w<p.FileIndex.length;++w)if(H=p.FileIndex[w],H.size>=4096)if(k.l=H.start+1<<9,ge&&Buffer.isBuffer(H.content))H.content.copy(k,k.l,0,H.size),k.l+=H.size+511&-512;else{for(L=0;L<H.size;++L)k.write_shift(1,H.content[L]);for(;L&511;++L)k.write_shift(1,0)}for(w=1;w<p.FileIndex.length;++w)if(H=p.FileIndex[w],H.size>0&&H.size<4096)if(ge&&Buffer.isBuffer(H.content))H.content.copy(k,k.l,0,H.size),k.l+=H.size+63&-64;else{for(L=0;L<H.size;++L)k.write_shift(1,H.content[L]);for(;L&63;++L)k.write_shift(1,0)}if(ge)k.l=k.length;else for(;k.l<k.length;)k.write_shift(1,0);return k}function G(p,T){var m=p.FullPaths.map(function(L){return L.toUpperCase()}),E=m.map(function(L){var B=L.split("/");return B[B.length-(L.slice(-1)=="/"?2:1)]}),k=!1;T.charCodeAt(0)===47?(k=!0,T=m[0].slice(0,-1)+T):k=T.indexOf("/")!==-1;var w=T.toUpperCase(),M=k===!0?m.indexOf(w):E.indexOf(w);if(M!==-1)return p.FileIndex[M];var X=!w.match(Fa);for(w=w.replace(rr,""),X&&(w=w.replace(Fa,"!")),M=0;M<m.length;++M)if((X?m[M].replace(Fa,"!"):m[M]).replace(rr,"")==w||(X?E[M].replace(Fa,"!"):E[M]).replace(rr,"")==w)return p.FileIndex[M];return null}var P=64,J=-2,fe="d0cf11e0a1b11ae1",re=[208,207,17,224,161,177,26,225],ce="00000000000000000000000000000000",ie={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:J,FREESECT:-1,HEADER_SIGNATURE:fe,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:ce,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ae(p,T,m){l();var E=z(p,m);f.writeFileSync(T,E)}function W(p){for(var T=new Array(p.length),m=0;m<p.length;++m)T[m]=String.fromCharCode(p[m]);return T.join("")}function le(p,T){var m=z(p,T);switch(T&&T.type||"buffer"){case"file":return l(),f.writeFileSync(T.filename,m),m;case"binary":return typeof m=="string"?m:W(m);case"base64":return y0(typeof m=="string"?m:W(m));case"buffer":if(ge)return Buffer.isBuffer(m)?m:qr(m);case"array":return typeof m=="string"?Er(m):m}return m}var he;function A(p){try{var T=p.InflateRaw,m=new T;if(m._processChunk(new Uint8Array([3,0]),m._finishFlushFlag),m.bytesRead)he=p;else throw new Error("zlib does not expose bytesRead")}catch(E){console.error("cannot use native zlib: "+(E.message||E))}}function U(p,T){if(!he)return li(p,T);var m=he.InflateRaw,E=new m,k=E._processChunk(p.slice(p.l),E._finishFlushFlag);return p.l+=E.bytesRead,k}function R(p){return he?he.deflateRawSync(p):ve(p)}var O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],ee=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ne(p){var T=(p<<1|p<<11)&139536|(p<<5|p<<15)&558144;return(T>>16|T>>8|T)&255}for(var q=typeof Uint8Array<"u",j=q?new Uint8Array(256):[],Te=0;Te<256;++Te)j[Te]=ne(Te);function C(p,T){var m=j[p&255];return T<=8?m>>>8-T:(m=m<<8|j[p>>8&255],T<=16?m>>>16-T:(m=m<<8|j[p>>16&255],m>>>24-T))}function Ie(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=6?0:p[E+1]<<8))>>>m&3}function ke(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=5?0:p[E+1]<<8))>>>m&7}function we(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=4?0:p[E+1]<<8))>>>m&15}function pe(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=3?0:p[E+1]<<8))>>>m&31}function ae(p,T){var m=T&7,E=T>>>3;return(p[E]|(m<=1?0:p[E+1]<<8))>>>m&127}function Ne(p,T,m){var E=T&7,k=T>>>3,w=(1<<m)-1,M=p[k]>>>E;return m<8-E||(M|=p[k+1]<<8-E,m<16-E)||(M|=p[k+2]<<16-E,m<24-E)||(M|=p[k+3]<<24-E),M&w}function gr(p,T,m){var E=T&7,k=T>>>3;return E<=5?p[k]|=(m&7)<<E:(p[k]|=m<<E&255,p[k+1]=(m&7)>>8-E),T+3}function Or(p,T,m){var E=T&7,k=T>>>3;return m=(m&1)<<E,p[k]|=m,T+1}function br(p,T,m){var E=T&7,k=T>>>3;return m<<=E,p[k]|=m&255,m>>>=8,p[k+1]=m,T+8}function Ja(p,T,m){var E=T&7,k=T>>>3;return m<<=E,p[k]|=m&255,m>>>=8,p[k+1]=m&255,p[k+2]=m>>>8,T+16}function Jr(p,T){var m=p.length,E=2*m>T?2*m:T+5,k=0;if(m>=T)return p;if(ge){var w=D0(E);if(p.copy)p.copy(w);else for(;k<p.length;++k)w[k]=p[k];return w}else if(q){var M=new Uint8Array(E);if(M.set)M.set(p);else for(;k<m;++k)M[k]=p[k];return M}return p.length=E,p}function ur(p){for(var T=new Array(p),m=0;m<p;++m)T[m]=0;return T}function Ur(p,T,m){var E=1,k=0,w=0,M=0,X=0,L=p.length,B=q?new Uint16Array(32):ur(32);for(w=0;w<32;++w)B[w]=0;for(w=L;w<m;++w)p[w]=0;L=p.length;var H=q?new Uint16Array(L):ur(L);for(w=0;w<L;++w)B[k=p[w]]++,E<k&&(E=k),H[w]=0;for(B[0]=0,w=1;w<=E;++w)B[w+16]=X=X+B[w-1]<<1;for(w=0;w<L;++w)X=p[w],X!=0&&(H[w]=B[X+16]++);var Y=0;for(w=0;w<L;++w)if(Y=p[w],Y!=0)for(X=C(H[w],E)>>E-Y,M=(1<<E+4-Y)-1;M>=0;--M)T[X|M<<Y]=Y&15|w<<4;return E}var Zr=q?new Uint16Array(512):ur(512),Za=q?new Uint16Array(32):ur(32);if(!q){for(var ir=0;ir<512;++ir)Zr[ir]=0;for(ir=0;ir<32;++ir)Za[ir]=0}(function(){for(var p=[],T=0;T<32;T++)p.push(5);Ur(p,Za,32);var m=[];for(T=0;T<=143;T++)m.push(8);for(;T<=255;T++)m.push(9);for(;T<=279;T++)m.push(7);for(;T<=287;T++)m.push(8);Ur(m,Zr,288)})();var Rr=(function(){for(var T=q?new Uint8Array(32768):[],m=0,E=0;m<ee.length-1;++m)for(;E<ee[m+1];++E)T[E]=m;for(;E<32768;++E)T[E]=29;var k=q?new Uint8Array(259):[];for(m=0,E=0;m<K.length-1;++m)for(;E<K[m+1];++E)k[E]=m;function w(X,L){for(var B=0;B<X.length;){var H=Math.min(65535,X.length-B),Y=B+H==X.length;for(L.write_shift(1,+Y),L.write_shift(2,H),L.write_shift(2,~H&65535);H-- >0;)L[L.l++]=X[B++]}return L.l}function M(X,L){for(var B=0,H=0,Y=q?new Uint16Array(32768):[];H<X.length;){var Q=Math.min(65535,X.length-H);if(Q<10){for(B=gr(L,B,+(H+Q==X.length)),B&7&&(B+=8-(B&7)),L.l=B/8|0,L.write_shift(2,Q),L.write_shift(2,~Q&65535);Q-- >0;)L[L.l++]=X[H++];B=L.l*8;continue}B=gr(L,B,+(H+Q==X.length)+2);for(var se=0;Q-- >0;){var Z=X[H];se=(se<<5^Z)&32767;var te=-1,de=0;if((te=Y[se])&&(te|=H&-32768,te>H&&(te-=32768),te<H))for(;X[te+de]==X[H+de]&&de<250;)++de;if(de>2){Z=k[de],Z<=22?B=br(L,B,j[Z+1]>>1)-1:(br(L,B,3),B+=5,br(L,B,j[Z-23]>>5),B+=3);var Ce=Z<8?0:Z-4>>2;Ce>0&&(Ja(L,B,de-K[Z]),B+=Ce),Z=T[H-te],B=br(L,B,j[Z]>>3),B-=3;var ye=Z<4?0:Z-2>>1;ye>0&&(Ja(L,B,H-te-ee[Z]),B+=ye);for(var er=0;er<de;++er)Y[se]=H&32767,se=(se<<5^X[H])&32767,++H;Q-=de-1}else Z<=143?Z=Z+48:B=Or(L,B,1),B=br(L,B,j[Z]),Y[se]=H&32767,++H}B=br(L,B,0)-1}return L.l=(B+7)/8|0,L.l}return function(L,B){return L.length<8?w(L,B):M(L,B)}})();function ve(p){var T=be(50+Math.floor(p.length*1.1)),m=Rr(p,T);return T.slice(0,m)}var Pe=q?new Uint16Array(32768):ur(32768),mr=q?new Uint16Array(32768):ur(32768),Ve=q?new Uint16Array(128):ur(128),la=1,oi=1;function Fd(p,T){var m=pe(p,T)+257;T+=5;var E=pe(p,T)+1;T+=5;var k=we(p,T)+4;T+=4;for(var w=0,M=q?new Uint8Array(19):ur(19),X=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],L=1,B=q?new Uint8Array(8):ur(8),H=q?new Uint8Array(8):ur(8),Y=M.length,Q=0;Q<k;++Q)M[O[Q]]=w=ke(p,T),L<w&&(L=w),B[w]++,T+=3;var se=0;for(B[0]=0,Q=1;Q<=L;++Q)H[Q]=se=se+B[Q-1]<<1;for(Q=0;Q<Y;++Q)(se=M[Q])!=0&&(X[Q]=H[se]++);var Z=0;for(Q=0;Q<Y;++Q)if(Z=M[Q],Z!=0){se=j[X[Q]]>>8-Z;for(var te=(1<<7-Z)-1;te>=0;--te)Ve[se|te<<Z]=Z&7|Q<<3}var de=[];for(L=1;de.length<m+E;)switch(se=Ve[ae(p,T)],T+=se&7,se>>>=3){case 16:for(w=3+Ie(p,T),T+=2,se=de[de.length-1];w-- >0;)de.push(se);break;case 17:for(w=3+ke(p,T),T+=3;w-- >0;)de.push(0);break;case 18:for(w=11+ae(p,T),T+=7;w-- >0;)de.push(0);break;default:de.push(se),L<se&&(L=se);break}var Ce=de.slice(0,m),ye=de.slice(m);for(Q=m;Q<286;++Q)Ce[Q]=0;for(Q=E;Q<30;++Q)ye[Q]=0;return la=Ur(Ce,Pe,286),oi=Ur(ye,mr,30),T}function Ad(p,T){if(p[0]==3&&!(p[1]&3))return[Wr(T),2];for(var m=0,E=0,k=D0(T||1<<18),w=0,M=k.length>>>0,X=0,L=0;(E&1)==0;){if(E=ke(p,m),m+=3,E>>>1)E>>1==1?(X=9,L=5):(m=Fd(p,m),X=la,L=oi);else{m&7&&(m+=8-(m&7));var B=p[m>>>3]|p[(m>>>3)+1]<<8;if(m+=32,B>0)for(!T&&M<w+B&&(k=Jr(k,w+B),M=k.length);B-- >0;)k[w++]=p[m>>>3],m+=8;continue}for(;;){!T&&M<w+32767&&(k=Jr(k,w+32767),M=k.length);var H=Ne(p,m,X),Y=E>>>1==1?Zr[H]:Pe[H];if(m+=Y&15,Y>>>=4,(Y>>>8&255)===0)k[w++]=Y;else{if(Y==256)break;Y-=257;var Q=Y<8?0:Y-4>>2;Q>5&&(Q=0);var se=w+K[Y];Q>0&&(se+=Ne(p,m,Q),m+=Q),H=Ne(p,m,L),Y=E>>>1==1?Za[H]:mr[H],m+=Y&15,Y>>>=4;var Z=Y<4?0:Y-2>>1,te=ee[Y];for(Z>0&&(te+=Ne(p,m,Z),m+=Z),!T&&M<se&&(k=Jr(k,se+100),M=k.length);w<se;)k[w]=k[w-te],++w}}}return T?[k,m+7>>>3]:[k.slice(0,w),m+7>>>3]}function li(p,T){var m=p.slice(p.l||0),E=Ad(m,T);return p.l+=E[1],E[0]}function hi(p,T){if(p)typeof console<"u"&&console.error(T);else throw new Error(T)}function ui(p,T){var m=p;ze(m,0);var E=[],k=[],w={FileIndex:E,FullPaths:k};F(w,{root:T.root});for(var M=m.length-4;(m[M]!=80||m[M+1]!=75||m[M+2]!=5||m[M+3]!=6)&&M>=0;)--M;m.l=M+4,m.l+=4;var X=m.read_shift(2);m.l+=6;var L=m.read_shift(4);for(m.l=L,M=0;M<X;++M){m.l+=20;var B=m.read_shift(4),H=m.read_shift(4),Y=m.read_shift(2),Q=m.read_shift(2),se=m.read_shift(2);m.l+=8;var Z=m.read_shift(4),te=c(m.slice(m.l+Y,m.l+Y+Q));m.l+=Y+Q+se;var de=m.l;m.l=Z+4,Sd(m,B,H,w,te),m.l=de}return w}function Sd(p,T,m,E,k){p.l+=2;var w=p.read_shift(2),M=p.read_shift(2),X=i(p);if(w&8257)throw new Error("Unsupported ZIP encryption");for(var L=p.read_shift(4),B=p.read_shift(4),H=p.read_shift(4),Y=p.read_shift(2),Q=p.read_shift(2),se="",Z=0;Z<Y;++Z)se+=String.fromCharCode(p[p.l++]);if(Q){var te=c(p.slice(p.l,p.l+Q));(te[21589]||{}).mt&&(X=te[21589].mt),((k||{})[21589]||{}).mt&&(X=k[21589].mt)}p.l+=Q;var de=p.slice(p.l,p.l+B);switch(M){case 8:de=U(p,H);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+M)}var Ce=!1;w&8&&(L=p.read_shift(4),L==134695760&&(L=p.read_shift(4),Ce=!0),B=p.read_shift(4),H=p.read_shift(4)),B!=T&&hi(Ce,"Bad compressed size: "+T+" != "+B),H!=m&&hi(Ce,"Bad uncompressed size: "+m+" != "+H),T0(E,se,de,{unsafe:!0,mt:X})}function Cd(p,T){var m=T||{},E=[],k=[],w=be(1),M=m.compression?8:0,X=0,L=0,B=0,H=0,Y=0,Q=p.FullPaths[0],se=Q,Z=p.FileIndex[0],te=[],de=0;for(L=1;L<p.FullPaths.length;++L)if(se=p.FullPaths[L].slice(Q.length),Z=p.FileIndex[L],!(!Z.size||!Z.content||se=="Sh33tJ5")){var Ce=H,ye=be(se.length);for(B=0;B<se.length;++B)ye.write_shift(1,se.charCodeAt(B)&127);ye=ye.slice(0,ye.l),te[Y]=Gi.buf(Z.content,0);var er=Z.content;M==8&&(er=R(er)),w=be(30),w.write_shift(4,67324752),w.write_shift(2,20),w.write_shift(2,X),w.write_shift(2,M),Z.mt?s(w,Z.mt):w.write_shift(4,0),w.write_shift(-4,te[Y]),w.write_shift(4,er.length),w.write_shift(4,Z.content.length),w.write_shift(2,ye.length),w.write_shift(2,0),H+=w.length,E.push(w),H+=ye.length,E.push(ye),H+=er.length,E.push(er),w=be(46),w.write_shift(4,33639248),w.write_shift(2,0),w.write_shift(2,20),w.write_shift(2,X),w.write_shift(2,M),w.write_shift(4,0),w.write_shift(-4,te[Y]),w.write_shift(4,er.length),w.write_shift(4,Z.content.length),w.write_shift(2,ye.length),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(4,0),w.write_shift(4,Ce),de+=w.l,k.push(w),de+=ye.length,k.push(ye),++Y}return w=be(22),w.write_shift(4,101010256),w.write_shift(2,0),w.write_shift(2,0),w.write_shift(2,Y),w.write_shift(2,Y),w.write_shift(4,de),w.write_shift(4,H),w.write_shift(2,0),Gr([Gr(E),Gr(k),w])}var St={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function yd(p,T){if(p.ctype)return p.ctype;var m=p.name||"",E=m.match(/\\.([^\\.]+)$/);return E&&St[E[1]]||T&&(E=(m=T).match(/[\\.\\\\]([^\\.\\\\])+$/),E&&St[E[1]])?St[E[1]]:"application/octet-stream"}function Dd(p){for(var T=y0(p),m=[],E=0;E<T.length;E+=76)m.push(T.slice(E,E+76));return m.join(\`\\r
29
29
  \`)+\`\\r
30
30
  \`}function Od(p){var T=p.replace(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7E-\\xFF=]/g,function(B){var H=B.charCodeAt(0).toString(16).toUpperCase();return"="+(H.length==1?"0"+H:H)});T=T.replace(/ $/mg,"=20").replace(/\\t$/mg,"=09"),T.charAt(0)==\`
31
31
  \`&&(T="=0D"+T.slice(1)),T=T.replace(/\\r(?!\\n)/mg,"=0D").replace(/\\n\\n/mg,\`
@@ -64,5 +64,5 @@
64
64
  \`,f=c.charCodeAt(0),l=new RegExp((s=="|"?"\\\\|":s)+"+$"),o="",h=[];n.dense=Array.isArray(e);for(var x=n.skipHidden&&e["!cols"]||[],d=n.skipHidden&&e["!rows"]||[],v=t.s.c;v<=t.e.c;++v)(x[v]||{}).hidden||(h[v]=Ue(v));for(var u=0,g=t.s.r;g<=t.e.r;++g)(d[g]||{}).hidden||(o=cd(e,t,g,h,i,f,s,n),o!=null&&(n.strip&&(o=o.replace(l,"")),(o||n.blankrows!==!1)&&r.push((u++?c:"")+o)));return delete n.dense,r.join("")}function fd(e,a){a||(a={}),a.FS=" ",a.RS=\`
65
65
  \`;var r=si(e,a);return r}function od(e){var a="",r,n="";if(e==null||e["!ref"]==null)return[];var t=Oe(e["!ref"]),s="",i=[],c,f=[],l=Array.isArray(e);for(c=t.s.c;c<=t.e.c;++c)i[c]=Ue(c);for(var o=t.s.r;o<=t.e.r;++o)for(s=$e(o),c=t.s.c;c<=t.e.c;++c)if(a=i[c]+s,r=l?(e[o]||[])[c]:e[a],n="",r!==void 0){if(r.F!=null){if(a=r.F,!r.f)continue;n=r.f,a.indexOf(":")==-1&&(a=a+":"+a)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}f[f.length]=a+"="+n}return f}function ii(e,a,r){var n=r||{},t=+!n.skipHeader,s=e||{},i=0,c=0;if(s&&n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var f=typeof n.origin=="string"?nr(n.origin):n.origin;i=f.r,c=f.c}var l,o={s:{c:0,r:0},e:{c,r:i+a.length-1+t}};if(s["!ref"]){var h=Oe(s["!ref"]);o.e.c=Math.max(o.e.c,h.e.c),o.e.r=Math.max(o.e.r,h.e.r),i==-1&&(i=h.e.r+1,o.e.r=i+a.length-1+t)}else i==-1&&(i=0,o.e.r=a.length-1+t);var x=n.header||[],d=0;a.forEach(function(u,g){Sr(u).forEach(function(S){(d=x.indexOf(S))==-1&&(x[d=x.length]=S);var y=u[S],_="z",N="",b=xe({c:c+d,r:i+g+t});l=ja(s,b),y&&typeof y=="object"&&!(y instanceof Date)?s[b]=y:(typeof y=="number"?_="n":typeof y=="boolean"?_="b":typeof y=="string"?_="s":y instanceof Date?(_="d",n.cellDates||(_="n",y=tr(y)),N=n.dateNF||ue[14]):y===null&&n.nullError&&(_="e",y=0),l?(l.t=_,l.v=y,delete l.w,delete l.R,N&&(l.z=N)):s[b]=l={t:_,v:y},N&&(l.z=N))})}),o.e.c=Math.max(o.e.c,c+x.length-1);var v=$e(i);if(t)for(d=0;d<x.length;++d)s[Ue(d+c)+v]={t:"s",v:x[d]};return s["!ref"]=_e(o),s}function ld(e,a){return ii(null,e,a)}function ja(e,a,r){if(typeof a=="string"){if(Array.isArray(e)){var n=nr(a);return e[n.r]||(e[n.r]=[]),e[n.r][n.c]||(e[n.r][n.c]={t:"z"})}return e[a]||(e[a]={t:"z"})}return typeof a!="number"?ja(e,xe(a)):ja(e,xe({r:a,c:r||0}))}function hd(e,a){if(typeof a=="number"){if(a>=0&&e.SheetNames.length>a)return a;throw new Error("Cannot find sheet # "+a)}else if(typeof a=="string"){var r=e.SheetNames.indexOf(a);if(r>-1)return r;throw new Error("Cannot find sheet name |"+a+"|")}else throw new Error("Cannot find sheet |"+a+"|")}function m0(){return{SheetNames:[],Sheets:{}}}function _0(e,a,r,n){var t=1;if(!r)for(;t<=65535&&e.SheetNames.indexOf(r="Sheet"+t)!=-1;++t,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var s=r.match(/(^.*?)(\\d+)$/);t=s&&+s[2]||0;var i=s&&s[1]||r;for(++t;t<=65535&&e.SheetNames.indexOf(r=i+t)!=-1;++t);}if(ju(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=a,r}function ud(e,a,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=hd(e,a);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function xd(e,a){return e.z=a,e}function ci(e,a,r){return a?(e.l={Target:a},r&&(e.l.Tooltip=r)):delete e.l,e}function dd(e,a,r){return ci(e,"#"+a,r)}function vd(e,a,r){e.c||(e.c=[]),e.c.push({t:a,a:r||"SheetJS"})}function pd(e,a,r,n){for(var t=typeof a!="string"?a:Oe(a),s=typeof a=="string"?a:_e(a),i=t.s.r;i<=t.e.r;++i)for(var c=t.s.c;c<=t.e.c;++c){var f=ja(e,i,c);f.t="n",f.F=s,delete f.v,i==t.s.r&&c==t.s.c&&(f.f=r,n&&(f.D=!0))}return e}var E0={encode_col:Ue,encode_row:$e,encode_cell:xe,encode_range:_e,decode_col:Wt,decode_row:Vt,split_cell:Sc,decode_cell:nr,decode_range:pa,format_cell:Mr,sheet_add_aoa:Pn,sheet_add_json:ii,sheet_add_dom:Ys,aoa_to_sheet:ga,json_to_sheet:ld,table_to_sheet:js,table_to_book:Nx,sheet_to_csv:si,sheet_to_txt:fd,sheet_to_json:g0,sheet_to_html:Ix,sheet_to_formulae:od,sheet_to_row_object_array:g0,sheet_get_cell:ja,book_new:m0,book_append_sheet:_0,book_set_sheet_visibility:ud,cell_set_number_format:xd,cell_set_hyperlink:ci,cell_set_internal_link:dd,cell_add_comment:vd,sheet_set_array_formula:pd,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const gd=e=>/\\.(csv|tsv|txt)$/i.test(e),fi=e=>e==null?"":String(e).trim();function md(e){const a=e.replace(/"[^"]*"/g,"").replace(/\\./g,"").replace(/\\[[^\\]]*\\]/g,"");return/[dy]/i.test(a)&&/m/i.test(a)}function _d(e){const a=new Map;for(const r of Object.keys(e)){if(r.startsWith("!"))continue;const n=e[r];if(n.t!=="n"||typeof n.v!="number"||typeof n.z!="string")continue;let t=a.get(n.z);if(t===void 0&&a.set(n.z,t=md(n.z)),!t)continue;const s=Y0.parse_date_code(n.v);if(!s)continue;const i=String(s.d).padStart(2,"0"),c=String(s.m).padStart(2,"0");n.t="s",n.v=\`\${i}/\${c}/\${s.y}\`,delete n.w,delete n.z}}function Ed(e,a){const r=e["!ref"];if(!r)return[];const n=E0.decode_range(r);if(a>n.e.r)return[];const t={s:{r:a,c:n.s.c},e:{r:a,c:n.e.c}};return(E0.sheet_to_json(e,{header:1,raw:!0,range:t})[0]??[]).map(fi).filter(Boolean)}const Td=65279;function kd(e){const a=new TextDecoder("utf-8").decode(e);return a.charCodeAt(0)===Td?a.slice(1):a}function wd(e,a){const{filasOmitir:r=0,esTexto:n=!1,nombreHoja:t}=a,s=n?At(kd(e),{type:"string",raw:!0}):At(e,{type:"array",cellNF:!0});if(t&&!s.SheetNames.includes(t))throw new Error(\`El archivo no tiene una hoja llamada "\${t}". Hojas disponibles: \${s.SheetNames.join(", ")}\`);const i=s.Sheets[t??s.SheetNames[0]];if(!i)return{filas:[],encabezados:[],hojas:s.SheetNames};n||_d(i);const c=Ed(i,r),f=E0.sheet_to_json(i,{defval:"",raw:!0,range:r}),l=[];for(const o of f){const h={};let x=!1;for(const d of Object.keys(o)){const v=fi(o[d]);h[d]=v,v&&(x=!0)}x&&l.push(h)}return{filas:l,encabezados:c,hojas:s.SheetNames}}self.onmessage=async e=>{try{const{archivo:a,filasOmitir:r,nombreHoja:n}=e.data,t=await a.arrayBuffer(),s=wd(t,{filasOmitir:r,nombreHoja:n,esTexto:gd(a.name)});self.postMessage({exito:!0,...s})}catch(a){const r=a instanceof Error?a.message:"Error desconocido al parsear Excel";self.postMessage({exito:!1,error:r})}}})();
66
66
  //# sourceMappingURL=excel.worker-BAQmXl6m.js.map
67
- `,nl=typeof self<"u"&&self.Blob&&new Blob([rl],{type:"text/javascript;charset=utf-8"});function p_(e){let t;try{if(t=nl&&(self.URL||self.webkitURL).createObjectURL(nl),!t)throw"";const r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(rl),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}let Io=!0;const g_=e=>2e4+Math.ceil(e/(1024*1024))*1e4,v_=/^(timeout|worker-error|worker-no-disponible)$/,m_=(e,t)=>new Promise((r,n)=>{let o;try{o=new p_}catch{Io=!1,n(new Error("worker-no-disponible"));return}const s=setTimeout(()=>{i(),n(new Error("timeout"))},g_(e.size)),i=()=>{clearTimeout(s),o.terminate()};o.onmessage=c=>{i(),c.data.exito?r({filas:c.data.filas,encabezados:c.data.encabezados,hojas:c.data.hojas}):n(new Error(c.data.error))},o.onerror=()=>{i(),Io=!1,n(new Error("worker-error"))},o.postMessage({archivo:e,filasOmitir:t.filasOmitir??0,nombreHoja:t.nombreHoja})}),b_=async(e,t)=>{const{esArchivoTexto:r,parsearLibro:n}=await Promise.resolve().then(()=>xp);return n(await e.arrayBuffer(),{...t,esTexto:r(e.name)})},Mo=async(e,t={})=>{if(typeof window<"u"&&Io)try{return await m_(e,t)}catch(r){if(r instanceof Error&&!v_.test(r.message))throw r}try{return await b_(e,t)}catch(r){throw r instanceof Error?r:new Error("Error al procesar el archivo")}},w_=(e,t={})=>Mo(e,t).then(r=>r.filas),y_="El archivo no contiene datos. Verifica que tenga filas debajo del encabezado.";function x_(e){const[t,r]=_.useState("idle"),[n,o]=_.useState(null),[s,i]=_.useState(null),[c,l]=_.useState(null),[u,f]=_.useState(null),[p,h]=_.useState(null),[d,v]=_.useState(!1),g=_.useRef(e);g.current=e;const b=_.useCallback(()=>{o(null),i(null),l(null),f(null),h(null),r("idle")},[]),w=_.useCallback(C=>{const{filtroNombre:S,maxTamanoMB:M}=g.current,D=G0(C)??q0(C,M)??(S?R0(C,S):null);if(D)return l(D);l(null),f(null),o(C)},[]),m=_.useCallback(C=>{l(C),h(null),o(null),r("idle")},[]),y=_.useCallback(async C=>{const S=g.current;o(C),r("procesando"),l(null),f(null);try{const{filas:M,encabezados:D}=await Mo(C,{filasOmitir:S.filasOmitir,nombreHoja:S.nombreHoja}),{reporte:O,resolucion:H}=qc(D,S.campos,{exigirOrden:S.exigirOrdenEncabezados,permitirColumnasExtra:S.permitirColumnasExtra});if(!O.valido)return f(O),S.onEncabezadosInvalidos?.(O),m(null);const V=S.maxFilas?M.slice(0,S.maxFilas):M;let N=await o_(V,S.campos,H,(x,A)=>h({fase:"validando",hechas:x,total:A}),S.filasOmitir+zc);if(N.totalFilas===0)return m(y_);S.clavesUnicas?.length&&(N=el(N,S.clavesUnicas,S.campos)),S.registroExiste&&(N=await tl(N,S.registroExiste,{anclaje:S.clavesUnicas?.[0]?.campos[0],campos:S.campos,mensaje:S.mensajeRegistroExistente,onProgreso:(x,A)=>h({fase:"existencia",hechas:x,total:A})})),h(null),i(N),r("resultado")}catch(M){m(M instanceof Error?M.message:"Error al procesar el archivo")}},[m]),k=s!=null&&s.totalErrores===0&&s.totalFilas>0,T=_.useMemo(()=>({onArchivoElegido:C=>{const S=C.currentTarget.files?.[0];C.currentTarget.value="",S&&w(S)},onDragOver:C=>{C.preventDefault(),v(!0)},onDragLeave:C=>{C.preventDefault();const S=C.relatedTarget;S instanceof Node&&C.currentTarget.contains(S)||v(!1)},onDrop:C=>{C.preventDefault(),v(!1);const S=C.dataTransfer.files[0];S&&w(S)}}),[w]);return{archivo:n,arrastrandoSobre:d,errorParseo:c,handlers:T,paso:t,progreso:p,puedeImportar:k,reiniciar:b,reporteEncabezados:u,resultado:s,validarArchivo:y}}function k_({campos:e,onImportar:t,onClose:r,title:n="Importar archivo Excel",subtitle:o,plantillaUrl:s,plantillaFilename:i="plantilla.xlsx",generarPlantilla:c,onGenerarPlantilla:l,rutaStorage:u,filasOmitir:f=0,nombreHoja:p,identificadores:h=[],maxFilas:d,maxTamanoMB:v,filtroNombre:g,confirmacion:b,permitirColumnasExtra:w=!0,exigirOrdenEncabezados:m=!1,clavesUnicas:y,registroExiste:k,mensajeRegistroExistente:T,onEncabezadosInvalidos:C,id:S,"data-testid":M}){const D=_.useId(),O=S??`excel-import-${D}`,H=`${O}-title`,V=o?`${O}-subtitle`:void 0,N=_.useRef(null),[x,A]=_.useState(!1),[$,F]=_.useState(!1),[E,I]=_.useState(!1),[L,R]=_.useState(null),{archivo:j,arrastrandoSobre:P,errorParseo:U,handlers:B,paso:q,progreso:X,puedeImportar:Y,reiniciar:Q,reporteEncabezados:oe,resultado:se,validarArchivo:ne}=x_({campos:e,clavesUnicas:y,exigirOrdenEncabezados:m,filasOmitir:f,filtroNombre:g,maxFilas:d,maxTamanoMB:v,mensajeRegistroExistente:T,nombreHoja:p,onEncabezadosInvalidos:C,permitirColumnasExtra:w,registroExiste:k}),ie=_.useCallback(()=>{A(!1),setTimeout(r,A0)},[r]);_.useEffect(()=>{const de=requestAnimationFrame(()=>A(!0));return()=>cancelAnimationFrame(de)},[]),_.useEffect(()=>{const de=we=>we.key==="Escape"&&ie();document.addEventListener("keydown",de);const{body:Z}=document,ue=window.innerWidth-document.documentElement.clientWidth,pe=Z.style.overflow,he=Z.style.paddingRight;return Z.style.overflow="hidden",ue>0&&(Z.style.paddingRight=`${ue}px`),()=>{document.removeEventListener("keydown",de),Z.style.overflow=pe,Z.style.paddingRight=he}},[ie]);const ae=_.useCallback(async()=>{if(!(!se||!j)){if(u){I(!0);try{await M0(j,u)}catch(de){R(de instanceof Error?de.message:"Error desconocido"),I(!1);return}I(!1)}t(se.filasValidas,j),ie()}},[j,ie,t,se,u]),fe=_.useCallback(()=>{b?F(!0):ae()},[b,ae]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:O,className:`${G.backdrop} ${x?G.visible:""}`,role:"dialog","aria-modal":!0,"aria-labelledby":H,"aria-describedby":V,"data-testid":M??O,children:a.jsxs("div",{className:`${G.modal} ${x?G.visible:""}`,children:[a.jsxs("div",{className:G.encabezado,children:[a.jsxs("div",{className:G.encabezado_textos,children:[a.jsx("h2",{id:H,className:G.titulo,children:n}),o&&a.jsx("p",{id:V,className:G.subtitulo,children:o})]}),a.jsx("button",{className:G.boton_cerrar,"aria-label":"Cerrar",onClick:ie,type:"button",children:a.jsx(D0,{size:14})})]}),a.jsx(d_,{paso:q}),a.jsx("hr",{className:G.divisor}),a.jsx("div",{className:G.cuerpo,children:a.jsxs("div",{className:G.paso_contenido,children:[q==="idle"&&a.jsx(Z0,{campos:e,plantillaUrl:s,plantillaFilename:i,generarPlantilla:c,onGenerarPlantilla:l,archivo:j,arrastrandoSobre:P,inputRef:N,filtroNombre:g,maxTamanoMB:v,reporteEncabezados:oe,onDragOver:B.onDragOver,onDragLeave:B.onDragLeave,onDrop:B.onDrop,onArchivoElegido:B.onArchivoElegido}),q==="procesando"&&a.jsx(Q0,{nombre:j?.name??"",progreso:X}),q==="resultado"&&se&&a.jsx(l_,{resultado:se,campos:e,identificadores:h})]},q)}),a.jsxs("div",{className:G.pie,children:[U&&a.jsxs("div",{className:G.alerta_inline,role:"alert",children:[a.jsx(To,{size:16}),a.jsx("span",{children:U})]}),q==="idle"&&a.jsx(He,{variant:"solid",color:"primary",size:"sm",isDisabled:!j,onClick:()=>j&&void ne(j),children:"Validar archivo"}),q==="resultado"&&se&&a.jsxs(a.Fragment,{children:[se.totalErrores>0&&a.jsx(He,{variant:"outline",color:"default",size:"sm",startContent:a.jsx("span",{className:G.icono_reintentar,children:a.jsx(P0,{})}),isDisabled:E,onClick:Q,children:"Reintentar"}),Y&&a.jsx(He,{variant:"solid",color:"primary",size:"sm",startContent:E?void 0:a.jsx(Bc,{size:13}),isDisabled:E,onClick:fe,children:E?"Subiendo…":"Subir Excel"})]})]})]})}),b&&a.jsx(Qr,{isOpen:$,tipo:"advertencia",titulo:b.titulo??"Confirmar importación",mensaje:b.mensaje??"¿Deseas continuar con la importación?",descripcion:b.descripcion,textoConfirmar:"Sí, importar",textoCancelar:"Revisar",onConfirmar:()=>{F(!1),ae()},onCancelar:()=>F(!1)}),L!==null&&a.jsx(Qr,{isOpen:!0,tipo:"eliminar",icono:a.jsx(Vc,{size:22}),titulo:"No se pudo subir el archivo",mensaje:"Ocurrió un error al guardar el archivo en el servidor.",descripcion:L,textoConfirmar:"Reintentar",textoCancelar:"Cancelar",onConfirmar:()=>{R(null),ae()},onCancelar:()=>R(null)})]})}function E_(...e){return(t,r)=>{for(const n of e){const o=n(t,r);if(o!==null)return o}return null}}function C_(e,t){return(r,n)=>e(r,n)===null?t:null}function S_(e){return(t,r)=>t?.trim()?e(t,r):null}function ra(e,t){const r=nt(t),n=e[r];return n!==void 0?n:Object.entries(e).find(([s])=>nt(s)===r)?.[1]??""}function sr(e){const t=e?.trim();if(!t)return null;const r=t.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/);if(r)return al(+r[3],+r[2]-1,+r[1]);const n=t.match(/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/);if(n)return al(+n[1],+n[2]-1,+n[3]);if(/^\d{4}-\d{2}-\d{2}T/.test(t)){const o=new Date(t);return isNaN(o.getTime())?null:o}return null}function al(e,t,r){const n=new Date(e,t,r);return n.getFullYear()===e&&n.getMonth()===t&&n.getDate()===r?n:null}function rn(e,t){return e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()}function ol(e){const t=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0");return`${t}/${r}/${e.getFullYear()}`}function sl(e){return e instanceof Date?isNaN(e.getTime())?null:e:sr(e)}function il(e,t){if(typeof t=="function")return t(e);const r=nt(e);return(Array.isArray(t)?t:[t]).some(n=>nt(n)===r)}function cl(e){if(typeof e=="function")return"toma ese valor";const t=Array.isArray(e)?e:[e];if(t.length===1)return`es «${t[0]}»`;const r=t[t.length-1],n=/^h?[oó]/i.test(r.trim())?"u":"o";return`es «${t.slice(0,-1).join("», «")}» ${n} «${r}»`}function T_(e,t,r){return(n,o)=>n?.trim()||!il(ra(o,e),t)?null:r??`«{campo}» es obligatorio cuando «${e}» ${cl(t)}`}function A_(e,t){return(r,n)=>r?.trim()||!ra(n,e).trim()?null:t??`Si «${e}» tiene un valor, «{campo}» también es obligatorio`}function N_(e,t,r){return(n,o)=>!n?.trim()||!il(ra(o,e),t)?null:r??`«{campo}» debe quedar vacío cuando «${e}» ${cl(t)}`}function I_(e){return t=>{const r=t?.trim();return r?sr(r)?null:e??"No es una fecha válida (formato DD/MM/AAAA)":null}}function M_(e){return t=>{const r=sr(t?.trim()??"");return r&&rn(r,new Date)>0?e??"No puede ser una fecha posterior a hoy":null}}function F_(e,t,r){return n=>{const o=sr(n?.trim()??"");if(!o)return null;const s=sl(e),i=sl(t);return!s||!i||rn(o,s)>=0&&rn(o,i)<=0?null:r??`La fecha debe estar entre ${ol(s)} y ${ol(i)}`}}function O_(e,t,r){return n=>{const o=sr(n?.trim()??"");if(!o)return null;const s=o.getFullYear();return s<e||s>t?r??`El año debe estar entre ${e} y ${t}`:null}}function $_(e=18,t){return r=>{const n=sr(r?.trim()??"");if(!n)return null;const o=new Date;let s=o.getFullYear()-n.getFullYear();const i=new Date(o.getFullYear(),n.getMonth(),n.getDate());return rn(o,i)<0&&(s-=1),s<e?t??`Según esta fecha no llega a la edad mínima (${e} años)`:null}}function D_(e,t){return(r,n)=>{const o=sr(r?.trim()??""),s=sr(ra(n,e));return!o||!s?null:rn(o,s)<=0?t??`«{campo}» debe ser una fecha posterior a «${e}»`:null}}function L_(e){return t=>t?.trim()?null:e??"Este dato es obligatorio"}function na(e,t){return r=>{const n=r?.trim();return n&&!e.test(n)?t??"El formato no es el esperado":null}}function P_(e,t){return r=>(r?.trim().length??0)>e?t??`Supera el máximo de ${e} caracteres`:null}function z_(e,t){return r=>{const n=r?.trim().length??0;return n>0&&n<e?t??`No llega al mínimo de ${e} caracteres`:null}}function B_(e){return na(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e??"No parece un correo válido (ejemplo: nombre@dominio.com)")}function V_(e){return na(/^[a-zA-ZÀ-ÿñÑ\s]+$/,e??"Solo puede tener letras y espacios")}function j_(e,t){return r=>e.includes(r?.trim())?null:t??`Valor no permitido${ta}${e.join(", ")}`}function H_(e,t){const r=e.map(nt);return n=>r.includes(nt(n??""))?null:t??`Valor no permitido${ta}${e.join(", ")}`}function U_(e){return t=>{const r=t?.trim();return r&&isNaN(Number(r))?e??"Debe ser un número":null}}function W_(e){return t=>{const r=t?.trim();return r&&!Number.isInteger(Number(r))?e??"Debe ser un número entero, sin decimales":null}}function G_(e){return na(/^\d+$/,e??"Solo puede tener dígitos (0-9), sin espacios ni signos")}function q_(e,t,r){return n=>{const o=n?.trim();if(!o)return null;const s=Number(o);return isNaN(s)?"Debe ser un número":s<e||s>t?r??`Debe ser un número entre ${e} y ${t}`:null}}const _e={tarjeta:"_tarjeta_k65jc_1",barra_superior:"_barra_superior_k65jc_16",header_label:"_header_label_k65jc_23",barra_superior_acciones:"_barra_superior_acciones_k65jc_28",indicador_rec:"_indicador_rec_k65jc_34",punto_rec:"_punto_rec_k65jc_45",punto_pausa:"_punto_pausa_k65jc_53",boton_icono:"_boton_icono_k65jc_69",panel:"_panel_k65jc_96",encabezado:"_encabezado_k65jc_107",encabezado_textos:"_encabezado_textos_k65jc_112",kicker:"_kicker_k65jc_119",titulo:"_titulo_k65jc_126",meta:"_meta_k65jc_134",zona_animada:"_zona_animada_k65jc_139",icono_pop:"_icono_pop_k65jc_174",zona_idle:"_zona_idle_k65jc_181",consentimiento:"_consentimiento_k65jc_189",consentimiento_aceptado:"_consentimiento_aceptado_k65jc_211",aviso_silencio:"_aviso_silencio_k65jc_216",consentimiento_check:"_consentimiento_check_k65jc_242",caja:"_caja_k65jc_252",caja_marcada:"_caja_marcada_k65jc_276",caja_onda:"_caja_onda_k65jc_296",caja_check:"_caja_check_k65jc_318",consentimiento_texto:"_consentimiento_texto_k65jc_333",boton_grabar:"_boton_grabar_k65jc_343",boton_grabar_halo:"_boton_grabar_halo_k65jc_364",boton_grabar_habilitado:"_boton_grabar_habilitado_k65jc_394",ayuda:"_ayuda_k65jc_432",zona_player:"_zona_player_k65jc_439",boton_play:"_boton_play_k65jc_445",boton_play_rec:"_boton_play_rec_k65jc_474",boton_play_grabando:"_boton_play_grabando_k65jc_478",linea_tiempos:"_linea_tiempos_k65jc_497",tiempo:"_tiempo_k65jc_505",alerta:"_alerta_k65jc_511",barra_inferior:"_barra_inferior_k65jc_523",accion_entrando:"_accion_entrando_k65jc_534",boton_detener:"_boton_detener_k65jc_550",boton_secundario:"_boton_secundario_k65jc_551",boton_primario:"_boton_primario_k65jc_552",badge_listo:"_badge_listo_k65jc_553",badge_listo_icono:"_badge_listo_icono_k65jc_651",badge_listo_check:"_badge_listo_check_k65jc_659"},aa=[1,1.25,1.5,2,.75],Fo=96,ll=88,Oo=2.4,dl=5.4,R_=.02,K_=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function X_(){return typeof MediaRecorder>"u"?"":K_.find(e=>MediaRecorder.isTypeSupported(e))??""}function ul(e){const{maxDurationSec:t,segundosSinVozParaAvisar:r=4,onError:n,onComplete:o}=e,[s,i]=_.useState("idle"),[c,l]=_.useState(0),[u,f]=_.useState([]),[p,h]=_.useState(!1),[d,v]=_.useState(null),[g,b]=_.useState(null),w=_.useRef(null),m=_.useRef(null),y=_.useRef(null),k=_.useRef(0),T=_.useRef(0),C=_.useRef(0),S=_.useRef([]),M=_.useRef(null),D=_.useRef({onError:n,onComplete:o});D.current={onError:n,onComplete:o};const O=_.useCallback(()=>{cancelAnimationFrame(k.current),m.current?.getTracks().forEach($=>$.stop()),m.current=null,y.current?.close().catch(()=>{}),y.current=null,w.current=null},[]);_.useEffect(()=>()=>{O(),M.current&&URL.revokeObjectURL(M.current)},[O]);const H=_.useCallback(()=>{const $=w.current;!$||$.state==="inactive"||($.state==="recording"&&(C.current+=(performance.now()-T.current)/1e3),$.stop())},[]),V=_.useCallback(async()=>{if(!(s==="grabando"||s==="pausado")){b(null),v(null),f([]),l(0),h(!1),C.current=0,S.current=[],M.current&&(URL.revokeObjectURL(M.current),M.current=null);try{if(typeof MediaRecorder>"u")throw new Error("Este navegador no soporta grabación de audio (MediaRecorder).");const $=await navigator.mediaDevices.getUserMedia({audio:!0});m.current=$;const F=X_(),E=new MediaRecorder($,F?{mimeType:F}:void 0);w.current=E;const I=new AudioContext;y.current=I;const L=I.createAnalyser();L.fftSize=1024,I.createMediaStreamSource($).connect(L);const R=new Float32Array(L.fftSize);let j=0,P=0,U=performance.now();const B=q=>{if(k.current=requestAnimationFrame(B),E.state==="recording"&&(l(C.current+(performance.now()-T.current)/1e3),q-j>42)){j=q,L.getFloatTimeDomainData(R);let X=0;for(let Q=0;Q<R.length;Q++){const oe=Math.abs(R[Q]);oe>X&&(X=oe)}const Y=Math.min(1,X*1.4);P=Y>P?P*.35+Y*.65:P*.72+Y*.28,f(Q=>[...Q.slice(-(ll-1)),P]),X>R_&&(U=q),h(q-U>r*1e3)}};E.ondataavailable=q=>{q.data.size>0&&S.current.push(q.data)},E.onstop=()=>{const q=C.current,X=new Blob(S.current,{type:E.mimeType||"audio/webm"}),Y=URL.createObjectURL(X);M.current=Y;const Q={blob:X,url:Y,duracionSeg:q,mimeType:X.type};O(),h(!1),v(Q),i("revision"),D.current.onComplete?.(Q)},E.onpause=()=>{C.current+=(performance.now()-T.current)/1e3,h(!1),i("pausado")},E.onresume=()=>{T.current=performance.now(),i("grabando")},E.start(250),T.current=performance.now(),i("grabando"),k.current=requestAnimationFrame(B)}catch($){const F=$ instanceof Error?$:new Error("No se pudo acceder al micrófono");O(),b(F),i("error"),D.current.onError?.(F)}}},[s,O,r]);_.useEffect(()=>{s==="grabando"&&c>=t&&H()},[s,c,t,H]);const N=_.useCallback(()=>{const $=w.current;$?.state==="recording"&&$.pause()},[]),x=_.useCallback(()=>{const $=w.current;$?.state==="paused"&&$.resume()},[]),A=_.useCallback(()=>{O(),M.current&&(URL.revokeObjectURL(M.current),M.current=null),v(null),f([]),l(0),h(!1),b(null),i("idle")},[O]);return{estado:s,segundos:c,niveles:u,sinVoz:p,audio:d,error:g,iniciar:V,pausar:N,reanudar:x,detener:H,descartar:A}}function $o(e,t){const[r,n]=_.useState(0);return _.useEffect(()=>{if(!t)return;let o=0;const s=()=>{const i=e.current;i&&n(i.currentTime),o=requestAnimationFrame(s)};return o=requestAnimationFrame(s),()=>cancelAnimationFrame(o)},[t,e]),[r,n]}function Do(e,t){const r=new Float32Array(t);if(e.length===0||t<=0)return r;const n=e.length/t;let o=0;for(let s=0;s<t;s++){const i=Math.floor(s*n),c=Math.min(e.length,Math.max(i+1,Math.floor((s+1)*n)));let l=0;for(let u=i;u<c;u++){const f=Math.abs(e[u]);f>l&&(l=f)}r[s]=l,l>o&&(o=l)}if(o>0)for(let s=0;s<t;s++)r[s]=r[s]/o;return r}function fl(e,t){if(e.length===0)return new Float32Array(t);if(e.length<=t){const r=new Float32Array(t);return r.set(e,t-e.length),r}return Do(Float32Array.from(e),t)}async function hl(e,t){try{const r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);const n=await r.arrayBuffer();return await Lo(n,t)}catch{return nn(t,e)}}async function Lo(e,t){const r=window.AudioContext??window.webkitAudioContext;if(!r)throw new Error("Este navegador no soporta AudioContext");const n=new r;try{const o=await n.decodeAudioData(e);return Do(o.getChannelData(0),t)}finally{n.close()}}function nn(e,t="corekit"){let r=2166136261;for(let o=0;o<t.length;o++)r^=t.charCodeAt(o),r=Math.imul(r,16777619);const n=new Float32Array(e);for(let o=0;o<e;o++){r=Math.imul(r^r>>>15,2246822519)>>>0;const s=r%1e3/1e3,i=.45+.55*Math.abs(Math.sin(o/e*Math.PI*3+s));n[o]=.18+.82*s*i}return n}function ir(e){(!Number.isFinite(e)||e<0)&&(e=0);const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),o=String(r).padStart(2,"0"),s=String(t).padStart(2,"0");return n>0?`${n}:${o}:${s}`:`${o}:${s}`}function Y_(e){const t=_.useRef(null),[r,n]=_.useState(null),[o,s]=_.useState(!1),[i,c]=$o(t,o);_.useEffect(()=>{if(!e){n(null),c(0),s(!1);return}let f=!1;return e.blob.arrayBuffer().then(p=>Lo(p,Fo)).catch(()=>nn(Fo,e.url)).then(p=>{f||n(p)}),()=>{f=!0}},[e,c]);const l=_.useCallback(()=>{const f=t.current;f&&(f.paused?f.play():f.pause())},[]),u=_.useCallback(f=>{const p=t.current,h=e?.duracionSeg??0;!p||h<=0||(p.currentTime=f*h,c(p.currentTime))},[e,c]);return{ref:t,peaks:r,activo:o,tiempo:i,setActivo:s,setTiempo:c,alternar:l,buscar:u}}function _l(e){return e.includes("ogg")?"ogg":e.includes("mp4")?"m4a":"webm"}function Z_(e){return/\.[a-z0-9]{2,4}$/i.test(e)}function J_(e,t){return Z_(e)?e:`${e}.${_l(t)}`}function Q_({audio:e,storagePath:t,firebaseStorage:r,fileNameBuilder:n,onUploadComplete:o,onUploadError:s,onDeleted:i}){const[c,l]=_.useState(!1),[u,f]=_.useState(!1),[p,h]=_.useState(!1),[d,v]=_.useState(null),g=_.useRef(null);_.useEffect(()=>{e||(f(!1),v(null),g.current=null)},[e]);const b=_.useCallback(()=>{if(r&&typeof r=="object")return r;if(!ca.getApps().length)throw new Error("Firebase no está inicializado. Inicializa la app o pasa firebaseStorage como prop.");return lt.getStorage()},[r]),w=_.useCallback(async y=>{if(t){l(!0),v(null);try{const k=n?.(y)??`audio_${Date.now()}.${_l(y.mimeType)}`,T=lt.ref(b(),`${t}/${k}`);await lt.uploadBytes(T,y.blob,{contentType:y.mimeType});const C=await lt.getDownloadURL(T);g.current=T.fullPath,f(!0),o?.({name:k,url:C,path:T.fullPath,duracionSeg:y.duracionSeg})}catch(k){const T=k instanceof Error?k:new Error("Error desconocido al subir el audio");v(T.message),s?.(T)}finally{l(!1)}}},[t,n,b,o,s]),m=_.useCallback(async()=>{const y=g.current;if(!y){f(!1);return}h(!0);try{await lt.deleteObject(lt.ref(b(),y)),i?.()}catch(k){if(k?.code!=="storage/object-not-found"){const C=k instanceof Error?k:new Error("Error desconocido al eliminar el audio");s?.(C)}}finally{g.current=null,f(!1),h(!1)}},[b,i,s]);return{subiendo:c,subido:u,eliminando:p,error:d,subir:w,eliminar:m}}const Ot={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0};function pl({size:e=20,className:t}){return a.jsxs("svg",{...Ot,width:e,height:e,className:t,children:[a.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:"currentColor",opacity:"0.25"}),a.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M5.5 11.5a6.5 6.5 0 0 0 13 0M12 18v3M9 21h6",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function ep({size:e=18,className:t}){return a.jsx("svg",{...Ot,width:e,height:e,className:t,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2.5",fill:"currentColor"})})}function gl({size:e=18,className:t}){return a.jsx("svg",{...Ot,width:e,height:e,className:t,children:a.jsx("path",{d:"M8.5 5.8v12.4c0 .9 1 1.5 1.8 1L20 13a1.2 1.2 0 0 0 0-2L10.3 4.8c-.8-.5-1.8.1-1.8 1Z",fill:"currentColor"})})}function Po({size:e=18,className:t}){return a.jsxs("svg",{...Ot,width:e,height:e,className:t,children:[a.jsx("rect",{x:"7",y:"5",width:"3.4",height:"14",rx:"1.2",fill:"currentColor"}),a.jsx("rect",{x:"13.6",y:"5",width:"3.4",height:"14",rx:"1.2",fill:"currentColor"})]})}function vl({size:e=16,className:t}){return a.jsx("svg",{...Ot,width:e,height:e,className:t,children:a.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function tp({size:e=18,className:t}){return a.jsx("svg",{...Ot,width:e,height:e,className:t,children:a.jsx("path",{d:"M12 4v10m0 0 4-4m-4 4-4-4M5 19h14",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function rp({size:e=18,className:t}){return a.jsxs("svg",{...Ot,width:e,height:e,className:t,children:[a.jsx("path",{d:"M4 9.5v5a1 1 0 0 0 1 1h2.6l3.8 3.1a1 1 0 0 0 1.6-.8V6.2a1 1 0 0 0-1.6-.8L7.6 8.5H5a1 1 0 0 0-1 1Z",fill:"currentColor",opacity:"0.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M16 9a4.2 4.2 0 0 1 0 6M18.6 6.6a8 8 0 0 1 0 10.8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function np({size:e=18,className:t}){return a.jsxs("svg",{...Ot,width:e,height:e,className:t,children:[a.jsx("path",{d:"M4.5 6.5h15",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),a.jsx("path",{d:"M9.5 6V4.8c0-.7.6-1.3 1.3-1.3h2.4c.7 0 1.3.6 1.3 1.3V6",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M6.2 6.5h11.6l-.7 12a2 2 0 0 1-2 1.9H8.9a2 2 0 0 1-2-1.9l-.7-12Z",fill:"currentColor",opacity:"0.18",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M10 10.5v6M14 10.5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function ap({size:e=16,className:t}){return a.jsx("svg",{...Ot,width:e,height:e,className:t,children:a.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function op({size:e=18,className:t}){return a.jsxs("svg",{...Ot,width:e,height:e,className:t,children:[a.jsx("path",{d:"M7 18a4 4 0 0 1-.4-8A5.5 5.5 0 0 1 17.3 8.6 4.2 4.2 0 0 1 17 18H7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),a.jsx("path",{d:"M12 15.5V10m0 0-2.3 2.3M12 10l2.3 2.3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}function zo({size:e=18,className:t}){return a.jsxs("svg",{...Ot,width:e,height:e,className:t,children:[a.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",opacity:"0.15",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M12 7.5v5.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),a.jsx("circle",{cx:"12",cy:"16.4",r:"1.1",fill:"currentColor"})]})}function sp({grabando:e,pausado:t,enRevision:r,puedeSubir:n,subida:o,onDetener:s,onDescartar:i,onSubir:c}){return a.jsxs("div",{className:_e.barra_inferior,children:[(e||t)&&a.jsxs("button",{type:"button",className:`${_e.boton_detener} ${_e.accion_entrando}`,onClick:s,children:[a.jsx(ep,{size:15}),"Detener"]}),r&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`${_e.boton_secundario} ${_e.accion_entrando}`,disabled:o.subiendo||o.eliminando,onClick:i,children:[a.jsx(np,{size:15}),o.eliminando?"Eliminando…":"Descartar"]}),n?a.jsxs("button",{type:"button",className:`${_e.boton_primario} ${_e.accion_entrando}`,disabled:o.subiendo||o.subido,onClick:c,children:[a.jsx("span",{className:_e.icono_pop,children:o.subido?a.jsx(ap,{size:14}):a.jsx(op,{size:16})},o.subido?"ok":o.subiendo?"sub":"nube"),o.subido?"Audio guardado":o.subiendo?"Subiendo…":"Subir audio"]}):a.jsxs("span",{className:`${_e.badge_listo} ${_e.accion_entrando}`,children:[a.jsx("span",{className:_e.badge_listo_icono,children:a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",width:"13",height:"13","aria-hidden":!0,children:a.jsx("path",{className:_e.badge_listo_check,d:"M3 8.4 6.4 11.9 13.5 4.3",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),"Grabación lista"]})]})]})}const cr={contenedor:"_contenedor_qnmfv_1",interactivo:"_interactivo_qnmfv_17",svg:"_svg_qnmfv_37",barra:"_barra_qnmfv_49",barra_activa:"_barra_activa_qnmfv_59",barra_viva:"_barra_viva_qnmfv_69",cursor:"_cursor_qnmfv_81",cursor_latiendo:"_cursor_latiendo_qnmfv_91"};function oa({peaks:e,progreso:t=0,onSeek:r,enVivo:n=!1,reproduciendo:o=!1,height:s=72,"aria-label":i}){const c=_.useRef(null),l=_.useRef(!1),u=e.length,f=u>0?(u-1)*dl+Oo:0,p=s/2,h=_.useMemo(()=>{const w=[];for(let m=0;m<u;m++){const y=Math.max(.045,Math.min(1,e[m])),k=Math.max(3,y*(s-8));w.push({x:m*dl,y:p-k/2,alto:k})}return w},[e,u,s,p]),d=_.useCallback(w=>{const m=c.current;if(!m||!r)return;const y=m.getBoundingClientRect();r(Math.min(1,Math.max(0,(w-y.left)/y.width)))},[r]),v=Math.floor(t*u),g=Math.min(f,t*f),b=!!r&&!n;return a.jsx("div",{ref:c,className:`${cr.contenedor} ${b?cr.interactivo:""}`,style:{height:s},role:b?"slider":void 0,"aria-label":i??"Posición de reproducción","aria-valuemin":b?0:void 0,"aria-valuemax":b?100:void 0,"aria-valuenow":b?Math.round(t*100):void 0,tabIndex:b?0:void 0,onPointerDown:b?w=>{l.current=!0,w.currentTarget.setPointerCapture(w.pointerId),d(w.clientX)}:void 0,onPointerMove:b?w=>l.current&&d(w.clientX):void 0,onPointerUp:b?()=>l.current=!1:void 0,onKeyDown:b?w=>{w.key==="ArrowRight"&&r?.(Math.min(1,t+.05)),w.key==="ArrowLeft"&&r?.(Math.max(0,t-.05))}:void 0,children:a.jsxs("svg",{className:cr.svg,viewBox:`0 0 ${Math.max(f,1)} ${s}`,preserveAspectRatio:"none","aria-hidden":!0,children:[h.map((w,m)=>a.jsx("rect",{className:`${n||m<v?cr.barra_activa:cr.barra} ${n?cr.barra_viva:""}`,x:w.x,y:w.y,width:Oo,height:w.alto,rx:Oo/2},m)),!n&&u>0&&a.jsx("rect",{className:`${cr.cursor} ${o?cr.cursor_latiendo:""}`,x:g,y:4,width:2,height:s-8,rx:1})]})})}function ip({niveles:e,segundos:t,maxDurationSec:r,grabando:n,pausado:o,sinVoz:s,onPausar:i,onReanudar:c}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:_e.zona_player,children:[a.jsx("button",{type:"button",className:`${_e.boton_play} ${_e.boton_play_rec} ${n?_e.boton_play_grabando:""}`,"aria-label":o?"Reanudar grabación":"Pausar grabación",onClick:o?c:i,children:a.jsx("span",{className:_e.icono_pop,children:o?a.jsx(pl,{size:18}):a.jsx(Po,{size:18})},o?"mic":"pausa")}),a.jsx(oa,{peaks:fl(e,ll),enVivo:!0,height:52,"aria-label":"Nivel del micrófono"})]}),a.jsx("div",{className:_e.linea_tiempos,children:a.jsxs("span",{className:_e.tiempo,children:[ir(t)," / ",ir(r)]})}),s&&n&&a.jsxs("div",{className:_e.aviso_silencio,role:"status",children:[a.jsx(zo,{size:15}),a.jsx("span",{children:"No se detecta tu voz. Revisa que el micrófono no esté silenciado y que sea el dispositivo correcto."})]})]})}function cp({texto:e,aceptado:t,onCambio:r}){return a.jsxs("label",{className:`${_e.consentimiento} ${t?_e.consentimiento_aceptado:""}`,children:[a.jsx("input",{type:"checkbox",className:_e.consentimiento_check,checked:t,onChange:n=>r(n.target.checked)}),a.jsx("span",{className:`${_e.caja} ${t?_e.caja_marcada:""}`,"aria-hidden":!0,children:t&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:_e.caja_onda}),a.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",children:a.jsx("path",{className:_e.caja_check,d:"M3 8.4 6.4 11.9 13.5 4.3",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),a.jsx("span",{className:_e.consentimiento_texto,children:e})]})}function lp({requireConsent:e,consentText:t,consintio:r,onConsentir:n,maxDurationSec:o,error:s,onIniciar:i}){const c=!e||r;return a.jsxs("div",{className:_e.zona_idle,children:[e&&a.jsx(cp,{texto:t,aceptado:r,onCambio:n}),a.jsxs("button",{type:"button",className:`${_e.boton_grabar} ${c&&e?_e.boton_grabar_habilitado:""}`,disabled:!c,onClick:i,children:[a.jsx("span",{className:_e.boton_grabar_halo,"aria-hidden":!0}),a.jsx(pl,{size:18}),"Iniciar grabación"]}),a.jsx("p",{className:_e.ayuda,children:c?`Máximo ${ir(o)}. Se pedirá permiso para usar el micrófono.`:"Acepta el aviso para habilitar la grabación."}),s&&a.jsxs("div",{className:_e.alerta,role:"alert",children:[a.jsx(zo,{size:16}),a.jsx("span",{children:s.message})]})]})}function dp({audio:e,preview:t,subido:r}){const n=e.duracionSeg,o=n>0?Math.min(1,t.tiempo/n):0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:_e.zona_player,children:[a.jsx("audio",{ref:t.ref,src:e.url,preload:"auto",onPlay:()=>t.setActivo(!0),onPause:()=>t.setActivo(!1),onTimeUpdate:s=>t.setTiempo(s.currentTarget.currentTime),onEnded:()=>{t.setActivo(!1),t.setTiempo(0)}}),a.jsx("button",{type:"button",className:_e.boton_play,"aria-label":t.activo?"Pausar":"Reproducir grabación",onClick:t.alternar,children:a.jsx("span",{className:_e.icono_pop,children:t.activo?a.jsx(Po,{size:18}):a.jsx(gl,{size:18})},t.activo?"pausa":"play")}),a.jsx(oa,{peaks:t.peaks??nn(Fo,e.url),progreso:o,reproduciendo:t.activo,height:52,onSeek:t.buscar})]}),a.jsxs("div",{className:_e.linea_tiempos,children:[a.jsxs("span",{className:_e.tiempo,children:[ir(t.tiempo)," / ",ir(n)]}),a.jsx("span",{className:_e.tiempo,children:r?"Guardado":"Sin guardar"})]})]})}const up="Autorizo la grabación de mi voz y el tratamiento de este audio para los fines de este registro.";function fp({headerLabel:e="Grabadora",title:t="Nueva grabación",subtitle:r,meta:n,storagePath:o,firebaseStorage:s,fileNameBuilder:i,maxDurationSec:c=600,requireConsent:l=!0,consentText:u=up,onRecordingComplete:f,onUploadComplete:p,onUploadError:h,onDeleted:d,onPermissionError:v,onClose:g,className:b,id:w,"data-testid":m}){const{estado:y,segundos:k,niveles:T,sinVoz:C,audio:S,error:M,iniciar:D,pausar:O,reanudar:H,detener:V,descartar:N}=ul({maxDurationSec:c,onError:v,onComplete:f}),x=_.useId(),A=w??`audio-recorder-${x}`,$=`${A}-title`,[F,E]=_.useState(!1),I=Y_(S),L=Q_({audio:S,storagePath:o,firebaseStorage:s,fileNameBuilder:i,onUploadComplete:p,onUploadError:h,onDeleted:d}),R=y==="grabando",j=y==="pausado",P=y==="revision"&&S!==null,U=P?"revision":R||j?"grabando":"idle",B=()=>{E(!1),L.subido&&L.eliminar(),N()};return a.jsxs("section",{id:A,className:`${_e.tarjeta} ${b??""}`,"data-testid":m??A,"aria-labelledby":$,children:[a.jsxs("div",{className:_e.barra_superior,children:[a.jsx("span",{className:_e.header_label,children:e}),a.jsxs("div",{className:_e.barra_superior_acciones,children:[(R||j)&&a.jsxs("span",{className:_e.indicador_rec,children:[a.jsx("span",{className:`${_e.punto_rec} ${j?_e.punto_pausa:""}`,"aria-hidden":!0}),j?"En pausa":"Grabando"]}),g&&a.jsx("button",{type:"button",className:_e.boton_icono,"aria-label":"Cerrar",onClick:g,children:a.jsx(vl,{size:15})})]})]}),a.jsxs("div",{className:_e.panel,children:[a.jsx("div",{className:_e.encabezado,children:a.jsxs("div",{className:_e.encabezado_textos,children:[r&&a.jsx("span",{className:_e.kicker,children:r}),a.jsx("h3",{id:$,className:_e.titulo,children:t}),n&&a.jsx("span",{className:_e.meta,children:n})]})}),a.jsxs("div",{className:_e.zona_animada,children:[U==="idle"&&a.jsx(lp,{requireConsent:l,consentText:u,consintio:F,onConsentir:E,maxDurationSec:c,error:y==="error"?M:null,onIniciar:()=>void D()}),U==="grabando"&&a.jsx(ip,{niveles:T,segundos:k,maxDurationSec:c,grabando:R,pausado:j,sinVoz:C,onPausar:O,onReanudar:H}),U==="revision"&&S&&a.jsx(dp,{audio:S,preview:I,subido:L.subido})]},U),L.error&&a.jsxs("div",{className:_e.alerta,role:"alert",children:[a.jsx(zo,{size:16}),a.jsxs("span",{children:["No se pudo subir el audio: ",L.error]})]})]}),a.jsx(sp,{grabando:R,pausado:j,enRevision:P,puedeSubir:!!o,subida:L,onDetener:V,onDescartar:B,onSubir:()=>S&&void L.subir(S)})]})}const $e={tarjeta:"_tarjeta_2vmxj_1",barra_superior:"_barra_superior_2vmxj_31",header_label:"_header_label_2vmxj_45",barra_superior_acciones:"_barra_superior_acciones_2vmxj_55",boton_icono:"_boton_icono_2vmxj_67",panel:"_panel_2vmxj_121",encabezado:"_encabezado_2vmxj_143",encabezado_textos:"_encabezado_textos_2vmxj_157",kicker:"_kicker_2vmxj_171",titulo:"_titulo_2vmxj_185",meta:"_meta_2vmxj_203",encabezado_lado:"_encabezado_lado_2vmxj_213",fecha:"_fecha_2vmxj_229",zona_player:"_zona_player_2vmxj_241",boton_play:"_boton_play_2vmxj_253",boton_play_activo:"_boton_play_activo_2vmxj_311",icono_pop:"_icono_pop_2vmxj_325",linea_tiempos:"_linea_tiempos_2vmxj_371",tiempo:"_tiempo_2vmxj_389",barra_inferior:"_barra_inferior_2vmxj_401",barra_inferior_grupo:"_barra_inferior_grupo_2vmxj_417",boton_velocidad:"_boton_velocidad_2vmxj_429",grupo_volumen:"_grupo_volumen_2vmxj_481",volumen_icono:"_volumen_icono_2vmxj_501",vol_pista:"_vol_pista_2vmxj_513",vol_riel:"_vol_riel_2vmxj_549",vol_activa:"_vol_activa_2vmxj_569",vol_relleno:"_vol_relleno_2vmxj_577",vol_thumb:"_vol_thumb_2vmxj_589"};function ml({valor:e,onCambio:t}){const r=_.useRef(null),n=_.useRef(!1),[o,s]=_.useState(!1),i=_.useCallback(c=>{const l=r.current;if(!l)return;const u=l.getBoundingClientRect();t(Math.min(1,Math.max(0,(c-u.left)/u.width)))},[t]);return a.jsxs("div",{ref:r,className:`${$e.vol_pista} ${o?$e.vol_activa:""}`,role:"slider","aria-label":"Volumen","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e*100),tabIndex:0,onPointerDown:c=>{n.current=!0,s(!0),c.currentTarget.setPointerCapture(c.pointerId),i(c.clientX)},onPointerMove:c=>n.current&&i(c.clientX),onPointerUp:()=>{n.current=!1,s(!1)},onKeyDown:c=>{(c.key==="ArrowRight"||c.key==="ArrowUp")&&t(Math.min(1,e+.1)),(c.key==="ArrowLeft"||c.key==="ArrowDown")&&t(Math.max(0,e-.1))},children:[a.jsx("div",{className:$e.vol_riel,children:a.jsx("div",{className:$e.vol_relleno,style:{width:`${e*100}%`}})}),a.jsx("div",{className:$e.vol_thumb,style:{left:`${e*100}%`}})]})}async function hp(e,t){try{const r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);const n=await r.blob(),o=URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=J_(t,n.type),document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch{window.open(e,"_blank","noopener")}}function _p({src:e,headerLabel:t="Audio",title:r,subtitle:n,meta:o,date:s,actions:i,allowDownload:c=!0,downloadFileName:l="audio",bars:u=96,onClose:f,onEnded:p,className:h,id:d,"data-testid":v}){const g=_.useRef(null),[b,w]=_.useState(!1),[m,y]=_.useState(0),[k,T]=_.useState(0),[C,S]=_.useState(1),[M,D]=_.useState(()=>nn(u,e)),[O,H]=$o(g,b);_.useEffect(()=>{let I=!1;return hl(e,u).then(L=>{I||D(L)}),()=>{I=!0}},[e,u]),_.useEffect(()=>{const I=g.current;I&&(I.playbackRate=aa[k],I.volume=C)},[k,C]);const V=_.useCallback(()=>{const I=g.current;I&&(I.paused?I.play():I.pause())},[]),N=_.useCallback(I=>{const L=g.current;!L||!Number.isFinite(L.duration)||(L.currentTime=I*L.duration,H(L.currentTime))},[H]),x=m>0?Math.min(1,O/m):0,A=_.useMemo(()=>[$e.tarjeta,h??""].filter(Boolean).join(" "),[h]),$=_.useId(),F=d??`audio-player-${$}`,E=`${F}-title`;return a.jsxs("section",{id:F,className:A,"data-testid":v??F,"aria-labelledby":E,children:[a.jsx("audio",{ref:g,src:e,preload:"metadata",onPlay:()=>w(!0),onPause:()=>w(!1),onTimeUpdate:I=>H(I.currentTarget.currentTime),onDurationChange:I=>{const L=I.currentTarget.duration;Number.isFinite(L)&&y(L)},onEnded:()=>{w(!1),p?.()}}),a.jsxs("div",{className:$e.barra_superior,children:[a.jsx("span",{className:$e.header_label,children:t}),a.jsx("div",{className:$e.barra_superior_acciones,children:f&&a.jsx("button",{type:"button",className:$e.boton_icono,"aria-label":"Cerrar",onClick:f,children:a.jsx(vl,{size:15})})})]}),a.jsxs("div",{className:$e.panel,children:[a.jsxs("div",{className:$e.encabezado,children:[a.jsxs("div",{className:$e.encabezado_textos,children:[n&&a.jsx("span",{className:$e.kicker,children:n}),a.jsx("h3",{id:E,className:$e.titulo,children:r}),o&&a.jsx("span",{className:$e.meta,children:o})]}),a.jsxs("div",{className:$e.encabezado_lado,children:[s&&a.jsx("span",{className:$e.fecha,children:s}),i]})]}),a.jsxs("div",{className:$e.zona_player,children:[a.jsx("button",{type:"button",className:`${$e.boton_play} ${b?$e.boton_play_activo:""}`,"aria-label":b?"Pausar":"Reproducir",onClick:V,children:a.jsx("span",{className:$e.icono_pop,children:b?a.jsx(Po,{size:18}):a.jsx(gl,{size:18})},b?"pausa":"play")}),a.jsx(oa,{peaks:M,progreso:x,onSeek:N,reproduciendo:b,height:60})]}),a.jsx("div",{className:$e.linea_tiempos,children:a.jsxs("span",{className:$e.tiempo,children:[ir(O)," / ",ir(m)]})})]}),a.jsxs("div",{className:$e.barra_inferior,children:[a.jsxs("div",{className:$e.barra_inferior_grupo,children:[c&&a.jsx("button",{type:"button",className:$e.boton_icono,"aria-label":"Descargar audio",title:"Descargar",onClick:()=>void hp(e,l),children:a.jsx(tp,{size:16})}),a.jsx("button",{type:"button",className:$e.boton_velocidad,"aria-label":`Velocidad de reproducción ${aa[k]}x`,onClick:()=>T(I=>(I+1)%aa.length),children:a.jsxs("span",{className:$e.icono_pop,children:[aa[k],"x"]},k)})]}),a.jsxs("div",{className:$e.grupo_volumen,children:[a.jsx("span",{className:$e.volumen_icono,children:a.jsx(rp,{size:16})}),a.jsx(ml,{valor:C,onCambio:S})]})]})]})}const pp=e=>/\.(csv|tsv|txt)$/i.test(e),Bo=e=>e==null?"":String(e).trim();function gp(e){const t=e.replace(/"[^"]*"/g,"").replace(/\./g,"").replace(/\[[^\]]*\]/g,"");return/[dy]/i.test(t)&&/m/i.test(t)}function vp(e){const t=new Map;for(const r of Object.keys(e)){if(r.startsWith("!"))continue;const n=e[r];if(n.t!=="n"||typeof n.v!="number"||typeof n.z!="string")continue;let o=t.get(n.z);if(o===void 0&&t.set(n.z,o=gp(n.z)),!o)continue;const s=br.SSF.parse_date_code(n.v);if(!s)continue;const i=String(s.d).padStart(2,"0"),c=String(s.m).padStart(2,"0");n.t="s",n.v=`${i}/${c}/${s.y}`,delete n.w,delete n.z}}function mp(e,t){const r=e["!ref"];if(!r)return[];const n=br.utils.decode_range(r);if(t>n.e.r)return[];const o={s:{r:t,c:n.s.c},e:{r:t,c:n.e.c}};return(br.utils.sheet_to_json(e,{header:1,raw:!0,range:o})[0]??[]).map(Bo).filter(Boolean)}const bp=65279;function wp(e){const t=new TextDecoder("utf-8").decode(e);return t.charCodeAt(0)===bp?t.slice(1):t}function yp(e,t){const{filasOmitir:r=0,esTexto:n=!1,nombreHoja:o}=t,s=n?br.read(wp(e),{type:"string",raw:!0}):br.read(e,{type:"array",cellNF:!0});if(o&&!s.SheetNames.includes(o))throw new Error(`El archivo no tiene una hoja llamada "${o}". Hojas disponibles: ${s.SheetNames.join(", ")}`);const i=s.Sheets[o??s.SheetNames[0]];if(!i)return{filas:[],encabezados:[],hojas:s.SheetNames};n||vp(i);const c=mp(i,r),l=br.utils.sheet_to_json(i,{defval:"",raw:!0,range:r}),u=[];for(const f of l){const p={};let h=!1;for(const d of Object.keys(f)){const v=Bo(f[d]);p[d]=v,v&&(h=!0)}h&&u.push(p)}return{filas:u,encabezados:c,hojas:s.SheetNames}}const xp=Object.freeze(Object.defineProperty({__proto__:null,esArchivoTexto:pp,normalizarCelda:Bo,parsearLibro:yp},Symbol.toStringTag,{value:"Module"}));K.AudioPlayer=_p,K.AudioRecorder=fp,K.Badge=ua,K.BadgeVoz=va,K.Boton=He,K.Checkbox=Ir,K.CheckboxGroup=Ki,K.ContextMenu=ec,K.ControlVolumen=ml,K.Drawer=yc,K.DropdownContext=go,K.DropdownMenu=Zr,K.ExcelImport=k_,K.FileStage=k0,K.FileViewer=T0,K.GrabacionIcono=es,K.GroupButton=Jh,K.IconoCerrar=xc,K.IconoDerecha=Sc,K.IconoFiltroAplicar=kc,K.IconoFiltroLimpiar=Ec,K.IconoIzquierda=Cc,K.InputDate=Qo,K.InputNumeric=Jo,K.InputText=Ro,K.MenuItem=mo,K.MenuList=Qn,K.MicrofonoIcono=pa,K.Modal=Co,K.ModalAviso=Qr,K.PanelFiltros=e0,K.Radio=Eo,K.RadioGroup=gc,K.Select=Oi,K.Signature=qo,K.SonidoIcono=ga,K.Submenu=bo,K.TablaDatos=Dh,K.TextArea=rs,K.Toggle=fa,K.Tooltip=tr,K.Transicion=un,K.Waveform=oa,K.anioEnRango=O_,K.aplicarClavesUnicas=el,K.aplicarExistenciaExterna=tl,K.combinar=E_,K.correoElectronico=B_,K.edadMinima=$_,K.esCheckbox=Xi,K.esEntero=W_,K.esFechaValida=I_,K.esLabel=Ji,K.esNumero=U_,K.esRadio=Yi,K.esSeparador=Zi,K.expresionRegular=na,K.extraerPeaks=Do,K.fechaEnRango=td,K.fechaEntre=F_,K.fechaPosteriorA=D_,K.formatearFecha=_a,K.formatearNumero=Dr,K.formatearTiempo=ir,K.generarOpcionesAleatorias=wf,K.generarUsuariosPrueba=yf,K.leerArchivoExcel=w_,K.leerArchivoExcelDetallado=Mo,K.longitudMaxima=P_,K.longitudMinima=z_,K.no=C_,K.noFechaFutura=M_,K.normClave=nt,K.obtenerFechaHoy=ed,K.parsearNumero=Ko,K.peaksDesdeArrayBuffer=Lo,K.peaksDesdeUrl=hl,K.peaksEnVivo=fl,K.peaksPlaceholder=nn,K.procesarValidacion=Xo,K.prohibidoSi=N_,K.rangoNumerico=q_,K.redondearDecimales=Yo,K.requerido=L_,K.requeridoSi=T_,K.requeridoSiHayValor=A_,K.restringirRango=ha,K.siTieneValor=S_,K.soloLetras=V_,K.soloNumeros=G_,K.tieneHijos=Yr,K.unoDeLosSiguientes=j_,K.unoDeLosSiguientesNormalizado=H_,K.useAudioRecorder=ul,K.useCheckboxGroupContext=Ri,K.useDropdownContext=vo,K.useReconocimientoVoz=ts,K.useTablaContext=_h,K.useTablaContextSafe=or,K.useTiempoSuave=$o,K.validarEncabezados=qc,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})}));
67
+ `,Nl=typeof self<"u"&&self.Blob&&new Blob([Al],{type:"text/javascript;charset=utf-8"});function X_(e){let t;try{if(t=Nl&&(self.URL||self.webkitURL).createObjectURL(Nl),!t)throw"";const r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Al),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}let Xo=!0;const K_=e=>2e4+Math.ceil(e/(1024*1024))*1e4,Y_=/^(timeout|worker-error|worker-no-disponible)$/,Z_=(e,t)=>new Promise((r,a)=>{let o;try{o=new X_}catch{Xo=!1,a(new Error("worker-no-disponible"));return}const s=setTimeout(()=>{i(),a(new Error("timeout"))},K_(e.size)),i=()=>{clearTimeout(s),o.terminate()};o.onmessage=c=>{i(),c.data.exito?r({filas:c.data.filas,encabezados:c.data.encabezados,hojas:c.data.hojas}):a(new Error(c.data.error))},o.onerror=()=>{i(),Xo=!1,a(new Error("worker-error"))},o.postMessage({archivo:e,filasOmitir:t.filasOmitir??0,nombreHoja:t.nombreHoja})}),J_=async(e,t)=>{const{esArchivoTexto:r,parsearLibro:a}=await Promise.resolve().then(()=>tg);return a(await e.arrayBuffer(),{...t,esTexto:r(e.name)})},Ko=async(e,t={})=>{if(typeof window<"u"&&Xo)try{return await Z_(e,t)}catch(r){if(r instanceof Error&&!Y_.test(r.message))throw r}try{return await J_(e,t)}catch(r){throw r instanceof Error?r:new Error("Error al procesar el archivo")}},Q_=(e,t={})=>Ko(e,t).then(r=>r.filas),ep="El archivo no contiene datos. Verifica que tenga filas debajo del encabezado.";function tp(e){const[t,r]=_.useState("idle"),[a,o]=_.useState(null),[s,i]=_.useState(null),[c,l]=_.useState(null),[d,h]=_.useState(null),[g,f]=_.useState(null),[u,v]=_.useState(!1),p=_.useRef(e);p.current=e;const m=_.useCallback(()=>{o(null),i(null),l(null),h(null),f(null),r("idle")},[]),w=_.useCallback(C=>{const{filtroNombre:T,maxTamanoMB:F}=p.current,D=x_(C)??E_(C,F)??(T?C_(C,T):null);if(D)return l(D);l(null),h(null),o(C)},[]),b=_.useCallback(C=>{l(C),f(null),o(null),r("idle")},[]),y=_.useCallback(async C=>{const T=p.current;o(C),r("procesando"),l(null),h(null);try{const{filas:F,encabezados:D}=await Ko(C,{filasOmitir:T.filasOmitir,nombreHoja:T.nombreHoja}),{reporte:M,resolucion:U}=gl(D,T.campos,{exigirOrden:T.exigirOrdenEncabezados,permitirColumnasExtra:T.permitirColumnasExtra});if(!M.valido)return h(M),T.onEncabezadosInvalidos?.(M),b(null);const V=T.maxFilas?F.slice(0,T.maxFilas):F;let N=await z_(V,T.campos,U,(k,A)=>f({fase:"validando",hechas:k,total:A}),T.filasOmitir+il);if(N.totalFilas===0)return b(ep);T.clavesUnicas?.length&&(N=Sl(N,T.clavesUnicas,T.campos)),T.registroExiste&&(N=await Tl(N,T.registroExiste,{anclaje:T.clavesUnicas?.[0]?.campos[0],campos:T.campos,mensaje:T.mensajeRegistroExistente,onProgreso:(k,A)=>f({fase:"existencia",hechas:k,total:A})})),f(null),i(N),r("resultado")}catch(F){b(F instanceof Error?F.message:"Error al procesar el archivo")}},[b]),E=s!=null&&s.totalErrores===0&&s.totalFilas>0,S=_.useMemo(()=>({onArchivoElegido:C=>{const T=C.currentTarget.files?.[0];C.currentTarget.value="",T&&w(T)},onDragOver:C=>{C.preventDefault(),v(!0)},onDragLeave:C=>{C.preventDefault();const T=C.relatedTarget;T instanceof Node&&C.currentTarget.contains(T)||v(!1)},onDrop:C=>{C.preventDefault(),v(!1);const T=C.dataTransfer.files[0];T&&w(T)}}),[w]);return{archivo:a,arrastrandoSobre:u,errorParseo:c,handlers:S,paso:t,progreso:g,puedeImportar:E,reiniciar:m,reporteEncabezados:d,resultado:s,validarArchivo:y}}function rp({campos:e,onImportar:t,onClose:r,title:a="Importar archivo Excel",subtitle:o,plantillaUrl:s,plantillaFilename:i="plantilla.xlsx",generarPlantilla:c,onGenerarPlantilla:l,rutaStorage:d,filasOmitir:h=0,nombreHoja:g,identificadores:f=[],maxFilas:u,maxTamanoMB:v,filtroNombre:p,confirmacion:m,permitirColumnasExtra:w=!0,exigirOrdenEncabezados:b=!1,clavesUnicas:y,registroExiste:E,mensajeRegistroExistente:S,onEncabezadosInvalidos:C,id:T,"data-testid":F}){const D=_.useId(),M=T??`excel-import-${D}`,U=`${M}-title`,V=o?`${M}-subtitle`:void 0,N=_.useRef(null),[k,A]=_.useState(!1),[O,$]=_.useState(!1),[x,I]=_.useState(!1),[L,X]=_.useState(null),{archivo:H,arrastrandoSobre:z,errorParseo:q,handlers:B,paso:K,progreso:Y,puedeImportar:Q,reiniciar:ee,reporteEncabezados:se,resultado:ce,validarArchivo:ae}=tp({campos:e,clavesUnicas:y,exigirOrdenEncabezados:b,filasOmitir:h,filtroNombre:p,maxFilas:u,maxTamanoMB:v,mensajeRegistroExistente:S,nombreHoja:g,onEncabezadosInvalidos:C,permitirColumnasExtra:w,registroExiste:E}),de=_.useCallback(()=>{A(!1),setTimeout(r,s_)},[r]);_.useEffect(()=>{const pe=requestAnimationFrame(()=>A(!0));return()=>cancelAnimationFrame(pe)},[]),_.useEffect(()=>{const pe=J=>J.key==="Escape"&&de();document.addEventListener("keydown",pe);const{body:te}=document,ue=window.innerWidth-document.documentElement.clientWidth,ge=te.style.overflow,ve=te.style.paddingRight;return te.style.overflow="hidden",ue>0&&(te.style.paddingRight=`${ue}px`),()=>{document.removeEventListener("keydown",pe),te.style.overflow=ge,te.style.paddingRight=ve}},[de]);const oe=_.useCallback(async()=>{if(!(!ce||!H)){if(d){I(!0);try{await l_(H,d)}catch(pe){X(pe instanceof Error?pe.message:"Error desconocido"),I(!1);return}I(!1)}t(ce.filasValidas,H),de()}},[H,de,t,ce,d]),fe=_.useCallback(()=>{m?$(!0):oe()},[m,oe]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{id:M,className:`${R.backdrop} ${k?R.visible:""}`,role:"dialog","aria-modal":!0,"aria-labelledby":U,"aria-describedby":V,"data-testid":F??M,children:n.jsxs("div",{className:`${R.modal} ${k?R.visible:""}`,children:[n.jsxs("div",{className:R.encabezado,children:[n.jsxs("div",{className:R.encabezado_textos,children:[n.jsx("h2",{id:U,className:R.titulo,children:a}),o&&n.jsx("p",{id:V,className:R.subtitulo,children:o})]}),n.jsx("button",{className:R.boton_cerrar,"aria-label":"Cerrar",onClick:de,type:"button",children:n.jsx(h_,{size:14})})]}),n.jsx(U_,{paso:K}),n.jsx("hr",{className:R.divisor}),n.jsx("div",{className:R.cuerpo,children:n.jsxs("div",{className:R.paso_contenido,children:[K==="idle"&&n.jsx(N_,{campos:e,plantillaUrl:s,plantillaFilename:i,generarPlantilla:c,onGenerarPlantilla:l,archivo:H,arrastrandoSobre:z,inputRef:N,filtroNombre:p,maxTamanoMB:v,reporteEncabezados:se,onDragOver:B.onDragOver,onDragLeave:B.onDragLeave,onDrop:B.onDrop,onArchivoElegido:B.onArchivoElegido}),K==="procesando"&&n.jsx(M_,{nombre:H?.name??"",progreso:Y}),K==="resultado"&&ce&&n.jsx(H_,{resultado:ce,campos:e,identificadores:f})]},K)}),n.jsxs("div",{className:R.pie,children:[q&&n.jsxs("div",{className:R.alerta_inline,role:"alert",children:[n.jsx(Wo,{size:16}),n.jsx("span",{children:q})]}),K==="idle"&&n.jsx(Ye,{variant:"solid",color:"primary",size:"sm",isDisabled:!H,onClick:()=>H&&void ae(H),children:"Validar archivo"}),K==="resultado"&&ce&&n.jsxs(n.Fragment,{children:[ce.totalErrores>0&&n.jsx(Ye,{variant:"outline",color:"default",size:"sm",startContent:n.jsx("span",{className:R.icono_reintentar,children:n.jsx(p_,{})}),isDisabled:x,onClick:ee,children:"Reintentar"}),Q&&n.jsx(Ye,{variant:"solid",color:"primary",size:"sm",startContent:x?void 0:n.jsx(cl,{size:13}),isDisabled:x,onClick:fe,children:x?"Subiendo…":"Subir Excel"})]})]})]})}),m&&n.jsx(pn,{isOpen:O,tipo:"advertencia",titulo:m.titulo??"Confirmar importación",mensaje:m.mensaje??"¿Deseas continuar con la importación?",descripcion:m.descripcion,textoConfirmar:"Sí, importar",textoCancelar:"Revisar",onConfirmar:()=>{$(!1),oe()},onCancelar:()=>$(!1)}),L!==null&&n.jsx(pn,{isOpen:!0,tipo:"eliminar",icono:n.jsx(dl,{size:22}),titulo:"No se pudo subir el archivo",mensaje:"Ocurrió un error al guardar el archivo en el servidor.",descripcion:L,textoConfirmar:"Reintentar",textoCancelar:"Cancelar",onConfirmar:()=>{X(null),oe()},onCancelar:()=>X(null)})]})}function np(...e){return(t,r)=>{for(const a of e){const o=a(t,r);if(o!==null)return o}return null}}function ap(e,t){return(r,a)=>e(r,a)===null?t:null}function op(e){return(t,r)=>t?.trim()?e(t,r):null}function _a(e,t){const r=ct(t),a=e[r];return a!==void 0?a:Object.entries(e).find(([s])=>ct(s)===r)?.[1]??""}function pr(e){const t=e?.trim();if(!t)return null;const r=t.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/);if(r)return Il(+r[3],+r[2]-1,+r[1]);const a=t.match(/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/);if(a)return Il(+a[1],+a[2]-1,+a[3]);if(/^\d{4}-\d{2}-\d{2}T/.test(t)){const o=new Date(t);return isNaN(o.getTime())?null:o}return null}function Il(e,t,r){const a=new Date(e,t,r);return a.getFullYear()===e&&a.getMonth()===t&&a.getDate()===r?a:null}function mn(e,t){return e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()}function Ml(e){const t=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0");return`${t}/${r}/${e.getFullYear()}`}function Fl(e){return e instanceof Date?isNaN(e.getTime())?null:e:pr(e)}function $l(e,t){if(typeof t=="function")return t(e);const r=ct(e);return(Array.isArray(t)?t:[t]).some(a=>ct(a)===r)}function Ol(e){if(typeof e=="function")return"toma ese valor";const t=Array.isArray(e)?e:[e];if(t.length===1)return`es «${t[0]}»`;const r=t[t.length-1],a=/^h?[oó]/i.test(r.trim())?"u":"o";return`es «${t.slice(0,-1).join("», «")}» ${a} «${r}»`}function sp(e,t,r){return(a,o)=>a?.trim()||!$l(_a(o,e),t)?null:r??`«{campo}» es obligatorio cuando «${e}» ${Ol(t)}`}function ip(e,t){return(r,a)=>r?.trim()||!_a(a,e).trim()?null:t??`Si «${e}» tiene un valor, «{campo}» también es obligatorio`}function cp(e,t,r){return(a,o)=>!a?.trim()||!$l(_a(o,e),t)?null:r??`«{campo}» debe quedar vacío cuando «${e}» ${Ol(t)}`}function lp(e){return t=>{const r=t?.trim();return r?pr(r)?null:e??"No es una fecha válida (formato DD/MM/AAAA)":null}}function dp(e){return t=>{const r=pr(t?.trim()??"");return r&&mn(r,new Date)>0?e??"No puede ser una fecha posterior a hoy":null}}function up(e,t,r){return a=>{const o=pr(a?.trim()??"");if(!o)return null;const s=Fl(e),i=Fl(t);return!s||!i||mn(o,s)>=0&&mn(o,i)<=0?null:r??`La fecha debe estar entre ${Ml(s)} y ${Ml(i)}`}}function fp(e,t,r){return a=>{const o=pr(a?.trim()??"");if(!o)return null;const s=o.getFullYear();return s<e||s>t?r??`El año debe estar entre ${e} y ${t}`:null}}function hp(e=18,t){return r=>{const a=pr(r?.trim()??"");if(!a)return null;const o=new Date;let s=o.getFullYear()-a.getFullYear();const i=new Date(o.getFullYear(),a.getMonth(),a.getDate());return mn(o,i)<0&&(s-=1),s<e?t??`Según esta fecha no llega a la edad mínima (${e} años)`:null}}function _p(e,t){return(r,a)=>{const o=pr(r?.trim()??""),s=pr(_a(a,e));return!o||!s?null:mn(o,s)<=0?t??`«{campo}» debe ser una fecha posterior a «${e}»`:null}}function pp(e){return t=>t?.trim()?null:e??"Este dato es obligatorio"}function pa(e,t){return r=>{const a=r?.trim();return a&&!e.test(a)?t??"El formato no es el esperado":null}}function gp(e,t){return r=>(r?.trim().length??0)>e?t??`Supera el máximo de ${e} caracteres`:null}function vp(e,t){return r=>{const a=r?.trim().length??0;return a>0&&a<e?t??`No llega al mínimo de ${e} caracteres`:null}}function mp(e){return pa(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e??"No parece un correo válido (ejemplo: nombre@dominio.com)")}function bp(e){return pa(/^[a-zA-ZÀ-ÿñÑ\s]+$/,e??"Solo puede tener letras y espacios")}function wp(e,t){return r=>e.includes(r?.trim())?null:t??`Valor no permitido${ha}${e.join(", ")}`}function yp(e,t){const r=e.map(ct);return a=>r.includes(ct(a??""))?null:t??`Valor no permitido${ha}${e.join(", ")}`}function kp(e){return t=>{const r=t?.trim();return r&&isNaN(Number(r))?e??"Debe ser un número":null}}function xp(e){return t=>{const r=t?.trim();return r&&!Number.isInteger(Number(r))?e??"Debe ser un número entero, sin decimales":null}}function Ep(e){return pa(/^\d+$/,e??"Solo puede tener dígitos (0-9), sin espacios ni signos")}function Cp(e,t,r){return a=>{const o=a?.trim();if(!o)return null;const s=Number(o);return isNaN(s)?"Debe ser un número":s<e||s>t?r??`Debe ser un número entre ${e} y ${t}`:null}}const me={tarjeta:"_tarjeta_riu0g_1",barra_superior:"_barra_superior_riu0g_31",header_label:"_header_label_riu0g_45",barra_superior_acciones:"_barra_superior_acciones_riu0g_55",indicador_rec:"_indicador_rec_riu0g_67",punto_rec:"_punto_rec_riu0g_89",punto_pausa:"_punto_pausa_riu0g_105",boton_icono:"_boton_icono_riu0g_137",panel:"_panel_riu0g_191",encabezado:"_encabezado_riu0g_213",encabezado_textos:"_encabezado_textos_riu0g_223",kicker:"_kicker_riu0g_237",titulo:"_titulo_riu0g_251",meta:"_meta_riu0g_267",zona_animada:"_zona_animada_riu0g_277",icono_pop:"_icono_pop_riu0g_347",zona_idle:"_zona_idle_riu0g_361",consentimiento:"_consentimiento_riu0g_377",consentimiento_aceptado:"_consentimiento_aceptado_riu0g_421",aviso_silencio:"_aviso_silencio_riu0g_431",consentimiento_check:"_consentimiento_check_riu0g_483",caja:"_caja_riu0g_503",caja_marcada:"_caja_marcada_riu0g_551",caja_onda:"_caja_onda_riu0g_591",caja_check:"_caja_check_riu0g_635",consentimiento_texto:"_consentimiento_texto_riu0g_665",boton_grabar:"_boton_grabar_riu0g_685",boton_grabar_halo:"_boton_grabar_halo_riu0g_727",boton_grabar_habilitado:"_boton_grabar_habilitado_riu0g_787",ayuda:"_ayuda_riu0g_863",zona_player:"_zona_player_riu0g_877",boton_play:"_boton_play_riu0g_889",boton_play_rec:"_boton_play_rec_riu0g_947",boton_play_grabando:"_boton_play_grabando_riu0g_955",linea_tiempos:"_linea_tiempos_riu0g_993",tiempo:"_tiempo_riu0g_1009",alerta:"_alerta_riu0g_1021",barra_inferior:"_barra_inferior_riu0g_1045",accion_entrando:"_accion_entrando_riu0g_1067",boton_detener:"_boton_detener_riu0g_1099",boton_secundario:"_boton_secundario_riu0g_1101",boton_primario:"_boton_primario_riu0g_1103",badge_listo:"_badge_listo_riu0g_1105",badge_listo_icono:"_badge_listo_icono_riu0g_1301",badge_listo_check:"_badge_listo_check_riu0g_1317"},ga=[1,1.25,1.5,2,.75],Yo=96,Dl=88,Zo=2.4,Ll=5.4,Sp=.02,Tp=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Ap(){return typeof MediaRecorder>"u"?"":Tp.find(e=>MediaRecorder.isTypeSupported(e))??""}function Pl(e){const{maxDurationSec:t,segundosSinVozParaAvisar:r=4,onError:a,onComplete:o}=e,[s,i]=_.useState("idle"),[c,l]=_.useState(0),[d,h]=_.useState([]),[g,f]=_.useState(!1),[u,v]=_.useState(null),[p,m]=_.useState(null),w=_.useRef(null),b=_.useRef(null),y=_.useRef(null),E=_.useRef(0),S=_.useRef(0),C=_.useRef(0),T=_.useRef([]),F=_.useRef(null),D=_.useRef({onError:a,onComplete:o});D.current={onError:a,onComplete:o};const M=_.useCallback(()=>{cancelAnimationFrame(E.current),b.current?.getTracks().forEach(O=>O.stop()),b.current=null,y.current?.close().catch(()=>{}),y.current=null,w.current=null},[]);_.useEffect(()=>()=>{M(),F.current&&URL.revokeObjectURL(F.current)},[M]);const U=_.useCallback(()=>{const O=w.current;!O||O.state==="inactive"||(O.state==="recording"&&(C.current+=(performance.now()-S.current)/1e3),O.stop())},[]),V=_.useCallback(async()=>{if(!(s==="grabando"||s==="pausado")){m(null),v(null),h([]),l(0),f(!1),C.current=0,T.current=[],F.current&&(URL.revokeObjectURL(F.current),F.current=null);try{if(typeof MediaRecorder>"u")throw new Error("Este navegador no soporta grabación de audio (MediaRecorder).");const O=await navigator.mediaDevices.getUserMedia({audio:!0});b.current=O;const $=Ap(),x=new MediaRecorder(O,$?{mimeType:$}:void 0);w.current=x;const I=new AudioContext;y.current=I;const L=I.createAnalyser();L.fftSize=1024,I.createMediaStreamSource(O).connect(L);const X=new Float32Array(L.fftSize);let H=0,z=0,q=performance.now();const B=K=>{if(E.current=requestAnimationFrame(B),x.state==="recording"&&(l(C.current+(performance.now()-S.current)/1e3),K-H>42)){H=K,L.getFloatTimeDomainData(X);let Y=0;for(let ee=0;ee<X.length;ee++){const se=Math.abs(X[ee]);se>Y&&(Y=se)}const Q=Math.min(1,Y*1.4);z=Q>z?z*.35+Q*.65:z*.72+Q*.28,h(ee=>[...ee.slice(-(Dl-1)),z]),Y>Sp&&(q=K),f(K-q>r*1e3)}};x.ondataavailable=K=>{K.data.size>0&&T.current.push(K.data)},x.onstop=()=>{const K=C.current,Y=new Blob(T.current,{type:x.mimeType||"audio/webm"}),Q=URL.createObjectURL(Y);F.current=Q;const ee={blob:Y,url:Q,duracionSeg:K,mimeType:Y.type};M(),f(!1),v(ee),i("revision"),D.current.onComplete?.(ee)},x.onpause=()=>{C.current+=(performance.now()-S.current)/1e3,f(!1),i("pausado")},x.onresume=()=>{S.current=performance.now(),i("grabando")},x.start(250),S.current=performance.now(),i("grabando"),E.current=requestAnimationFrame(B)}catch(O){const $=O instanceof Error?O:new Error("No se pudo acceder al micrófono");M(),m($),i("error"),D.current.onError?.($)}}},[s,M,r]);_.useEffect(()=>{s==="grabando"&&c>=t&&U()},[s,c,t,U]);const N=_.useCallback(()=>{const O=w.current;O?.state==="recording"&&O.pause()},[]),k=_.useCallback(()=>{const O=w.current;O?.state==="paused"&&O.resume()},[]),A=_.useCallback(()=>{M(),F.current&&(URL.revokeObjectURL(F.current),F.current=null),v(null),h([]),l(0),f(!1),m(null),i("idle")},[M]);return{estado:s,segundos:c,niveles:d,sinVoz:g,audio:u,error:p,iniciar:V,pausar:N,reanudar:k,detener:U,descartar:A}}function Jo(e,t){const[r,a]=_.useState(0);return _.useEffect(()=>{if(!t)return;let o=0;const s=()=>{const i=e.current;i&&a(i.currentTime),o=requestAnimationFrame(s)};return o=requestAnimationFrame(s),()=>cancelAnimationFrame(o)},[t,e]),[r,a]}function Qo(e,t){const r=new Float32Array(t);if(e.length===0||t<=0)return r;const a=e.length/t;let o=0;for(let s=0;s<t;s++){const i=Math.floor(s*a),c=Math.min(e.length,Math.max(i+1,Math.floor((s+1)*a)));let l=0;for(let d=i;d<c;d++){const h=Math.abs(e[d]);h>l&&(l=h)}r[s]=l,l>o&&(o=l)}if(o>0)for(let s=0;s<t;s++)r[s]=r[s]/o;return r}function zl(e,t){if(e.length===0)return new Float32Array(t);if(e.length<=t){const r=new Float32Array(t);return r.set(e,t-e.length),r}return Qo(Float32Array.from(e),t)}async function Bl(e,t){try{const r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);const a=await r.arrayBuffer();return await es(a,t)}catch{return bn(t,e)}}async function es(e,t){const r=window.AudioContext??window.webkitAudioContext;if(!r)throw new Error("Este navegador no soporta AudioContext");const a=new r;try{const o=await a.decodeAudioData(e);return Qo(o.getChannelData(0),t)}finally{a.close()}}function bn(e,t="corekit"){let r=2166136261;for(let o=0;o<t.length;o++)r^=t.charCodeAt(o),r=Math.imul(r,16777619);const a=new Float32Array(e);for(let o=0;o<e;o++){r=Math.imul(r^r>>>15,2246822519)>>>0;const s=r%1e3/1e3,i=.45+.55*Math.abs(Math.sin(o/e*Math.PI*3+s));a[o]=.18+.82*s*i}return a}function gr(e){(!Number.isFinite(e)||e<0)&&(e=0);const t=Math.floor(e%60),r=Math.floor(e/60%60),a=Math.floor(e/3600),o=String(r).padStart(2,"0"),s=String(t).padStart(2,"0");return a>0?`${a}:${o}:${s}`:`${o}:${s}`}function Np(e){const t=_.useRef(null),[r,a]=_.useState(null),[o,s]=_.useState(!1),[i,c]=Jo(t,o);_.useEffect(()=>{if(!e){a(null),c(0),s(!1);return}let h=!1;return e.blob.arrayBuffer().then(g=>es(g,Yo)).catch(()=>bn(Yo,e.url)).then(g=>{h||a(g)}),()=>{h=!0}},[e,c]);const l=_.useCallback(()=>{const h=t.current;h&&(h.paused?h.play():h.pause())},[]),d=_.useCallback(h=>{const g=t.current,f=e?.duracionSeg??0;!g||f<=0||(g.currentTime=h*f,c(g.currentTime))},[e,c]);return{ref:t,peaks:r,activo:o,tiempo:i,setActivo:s,setTiempo:c,alternar:l,buscar:d}}function Vl(e){return e.includes("ogg")?"ogg":e.includes("mp4")?"m4a":"webm"}function Ip(e){return/\.[a-z0-9]{2,4}$/i.test(e)}function Mp(e,t){return Ip(e)?e:`${e}.${Vl(t)}`}function Fp({audio:e,storagePath:t,firebaseStorage:r,fileNameBuilder:a,onUploadComplete:o,onUploadError:s,onDeleted:i}){const[c,l]=_.useState(!1),[d,h]=_.useState(!1),[g,f]=_.useState(!1),[u,v]=_.useState(null),p=_.useRef(null);_.useEffect(()=>{e||(h(!1),v(null),p.current=null)},[e]);const m=_.useCallback(()=>{if(r&&typeof r=="object")return r;if(!Ea.getApps().length)throw new Error("Firebase no está inicializado. Inicializa la app o pasa firebaseStorage como prop.");return ut.getStorage()},[r]),w=_.useCallback(async y=>{if(t){l(!0),v(null);try{const E=a?.(y)??`audio_${Date.now()}.${Vl(y.mimeType)}`,S=ut.ref(m(),`${t}/${E}`);await ut.uploadBytes(S,y.blob,{contentType:y.mimeType});const C=await ut.getDownloadURL(S);p.current=S.fullPath,h(!0),o?.({name:E,url:C,path:S.fullPath,duracionSeg:y.duracionSeg})}catch(E){const S=E instanceof Error?E:new Error("Error desconocido al subir el audio");v(S.message),s?.(S)}finally{l(!1)}}},[t,a,m,o,s]),b=_.useCallback(async()=>{const y=p.current;if(!y){h(!1);return}f(!0);try{await ut.deleteObject(ut.ref(m(),y)),i?.()}catch(E){if(E?.code!=="storage/object-not-found"){const C=E instanceof Error?E:new Error("Error desconocido al eliminar el audio");s?.(C)}}finally{p.current=null,h(!1),f(!1)}},[m,i,s]);return{subiendo:c,subido:d,eliminando:g,error:u,subir:w,eliminar:b}}const zt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0};function jl({size:e=20,className:t}){return n.jsxs("svg",{...zt,width:e,height:e,className:t,children:[n.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:"currentColor",opacity:"0.25"}),n.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3",stroke:"currentColor",strokeWidth:"1.6"}),n.jsx("path",{d:"M5.5 11.5a6.5 6.5 0 0 0 13 0M12 18v3M9 21h6",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function $p({size:e=18,className:t}){return n.jsx("svg",{...zt,width:e,height:e,className:t,children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2.5",fill:"currentColor"})})}function Hl({size:e=18,className:t}){return n.jsx("svg",{...zt,width:e,height:e,className:t,children:n.jsx("path",{d:"M8.5 5.8v12.4c0 .9 1 1.5 1.8 1L20 13a1.2 1.2 0 0 0 0-2L10.3 4.8c-.8-.5-1.8.1-1.8 1Z",fill:"currentColor"})})}function ts({size:e=18,className:t}){return n.jsxs("svg",{...zt,width:e,height:e,className:t,children:[n.jsx("rect",{x:"7",y:"5",width:"3.4",height:"14",rx:"1.2",fill:"currentColor"}),n.jsx("rect",{x:"13.6",y:"5",width:"3.4",height:"14",rx:"1.2",fill:"currentColor"})]})}function Ul({size:e=16,className:t}){return n.jsx("svg",{...zt,width:e,height:e,className:t,children:n.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function Op({size:e=18,className:t}){return n.jsx("svg",{...zt,width:e,height:e,className:t,children:n.jsx("path",{d:"M12 4v10m0 0 4-4m-4 4-4-4M5 19h14",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dp({size:e=18,className:t}){return n.jsxs("svg",{...zt,width:e,height:e,className:t,children:[n.jsx("path",{d:"M4 9.5v5a1 1 0 0 0 1 1h2.6l3.8 3.1a1 1 0 0 0 1.6-.8V6.2a1 1 0 0 0-1.6-.8L7.6 8.5H5a1 1 0 0 0-1 1Z",fill:"currentColor",opacity:"0.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 9a4.2 4.2 0 0 1 0 6M18.6 6.6a8 8 0 0 1 0 10.8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Lp({size:e=18,className:t}){return n.jsxs("svg",{...zt,width:e,height:e,className:t,children:[n.jsx("path",{d:"M4.5 6.5h15",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),n.jsx("path",{d:"M9.5 6V4.8c0-.7.6-1.3 1.3-1.3h2.4c.7 0 1.3.6 1.3 1.3V6",stroke:"currentColor",strokeWidth:"1.6"}),n.jsx("path",{d:"M6.2 6.5h11.6l-.7 12a2 2 0 0 1-2 1.9H8.9a2 2 0 0 1-2-1.9l-.7-12Z",fill:"currentColor",opacity:"0.18",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),n.jsx("path",{d:"M10 10.5v6M14 10.5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Pp({size:e=16,className:t}){return n.jsx("svg",{...zt,width:e,height:e,className:t,children:n.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function zp({size:e=18,className:t}){return n.jsxs("svg",{...zt,width:e,height:e,className:t,children:[n.jsx("path",{d:"M7 18a4 4 0 0 1-.4-8A5.5 5.5 0 0 1 17.3 8.6 4.2 4.2 0 0 1 17 18H7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 15.5V10m0 0-2.3 2.3M12 10l2.3 2.3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rs({size:e=18,className:t}){return n.jsxs("svg",{...zt,width:e,height:e,className:t,children:[n.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",opacity:"0.15",stroke:"currentColor",strokeWidth:"1.6"}),n.jsx("path",{d:"M12 7.5v5.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),n.jsx("circle",{cx:"12",cy:"16.4",r:"1.1",fill:"currentColor"})]})}function Bp({grabando:e,pausado:t,enRevision:r,puedeSubir:a,subida:o,onDetener:s,onDescartar:i,onSubir:c}){return n.jsxs("div",{className:me.barra_inferior,children:[(e||t)&&n.jsxs("button",{type:"button",className:`${me.boton_detener} ${me.accion_entrando}`,onClick:s,children:[n.jsx($p,{size:15}),"Detener"]}),r&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",className:`${me.boton_secundario} ${me.accion_entrando}`,disabled:o.subiendo||o.eliminando,onClick:i,children:[n.jsx(Lp,{size:15}),o.eliminando?"Eliminando…":"Descartar"]}),a?n.jsxs("button",{type:"button",className:`${me.boton_primario} ${me.accion_entrando}`,disabled:o.subiendo||o.subido,onClick:c,children:[n.jsx("span",{className:me.icono_pop,children:o.subido?n.jsx(Pp,{size:14}):n.jsx(zp,{size:16})},o.subido?"ok":o.subiendo?"sub":"nube"),o.subido?"Audio guardado":o.subiendo?"Subiendo…":"Subir audio"]}):n.jsxs("span",{className:`${me.badge_listo} ${me.accion_entrando}`,children:[n.jsx("span",{className:me.badge_listo_icono,children:n.jsx("svg",{viewBox:"0 0 16 16",fill:"none",width:"13",height:"13","aria-hidden":!0,children:n.jsx("path",{className:me.badge_listo_check,d:"M3 8.4 6.4 11.9 13.5 4.3",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),"Grabación lista"]})]})]})}const vr={contenedor:"_contenedor_qnmfv_1",interactivo:"_interactivo_qnmfv_17",svg:"_svg_qnmfv_37",barra:"_barra_qnmfv_49",barra_activa:"_barra_activa_qnmfv_59",barra_viva:"_barra_viva_qnmfv_69",cursor:"_cursor_qnmfv_81",cursor_latiendo:"_cursor_latiendo_qnmfv_91"};function va({peaks:e,progreso:t=0,onSeek:r,enVivo:a=!1,reproduciendo:o=!1,height:s=72,"aria-label":i}){const c=_.useRef(null),l=_.useRef(!1),d=e.length,h=d>0?(d-1)*Ll+Zo:0,g=s/2,f=_.useMemo(()=>{const w=[];for(let b=0;b<d;b++){const y=Math.max(.045,Math.min(1,e[b])),E=Math.max(3,y*(s-8));w.push({x:b*Ll,y:g-E/2,alto:E})}return w},[e,d,s,g]),u=_.useCallback(w=>{const b=c.current;if(!b||!r)return;const y=b.getBoundingClientRect();r(Math.min(1,Math.max(0,(w-y.left)/y.width)))},[r]),v=Math.floor(t*d),p=Math.min(h,t*h),m=!!r&&!a;return n.jsx("div",{ref:c,className:`${vr.contenedor} ${m?vr.interactivo:""}`,style:{height:s},role:m?"slider":void 0,"aria-label":i??"Posición de reproducción","aria-valuemin":m?0:void 0,"aria-valuemax":m?100:void 0,"aria-valuenow":m?Math.round(t*100):void 0,tabIndex:m?0:void 0,onPointerDown:m?w=>{l.current=!0,w.currentTarget.setPointerCapture(w.pointerId),u(w.clientX)}:void 0,onPointerMove:m?w=>l.current&&u(w.clientX):void 0,onPointerUp:m?()=>l.current=!1:void 0,onKeyDown:m?w=>{w.key==="ArrowRight"&&r?.(Math.min(1,t+.05)),w.key==="ArrowLeft"&&r?.(Math.max(0,t-.05))}:void 0,children:n.jsxs("svg",{className:vr.svg,viewBox:`0 0 ${Math.max(h,1)} ${s}`,preserveAspectRatio:"none","aria-hidden":!0,children:[f.map((w,b)=>n.jsx("rect",{className:`${a||b<v?vr.barra_activa:vr.barra} ${a?vr.barra_viva:""}`,x:w.x,y:w.y,width:Zo,height:w.alto,rx:Zo/2},b)),!a&&d>0&&n.jsx("rect",{className:`${vr.cursor} ${o?vr.cursor_latiendo:""}`,x:p,y:4,width:2,height:s-8,rx:1})]})})}function Vp({niveles:e,segundos:t,maxDurationSec:r,grabando:a,pausado:o,sinVoz:s,onPausar:i,onReanudar:c}){return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:me.zona_player,children:[n.jsx("button",{type:"button",className:`${me.boton_play} ${me.boton_play_rec} ${a?me.boton_play_grabando:""}`,"aria-label":o?"Reanudar grabación":"Pausar grabación",onClick:o?c:i,children:n.jsx("span",{className:me.icono_pop,children:o?n.jsx(jl,{size:18}):n.jsx(ts,{size:18})},o?"mic":"pausa")}),n.jsx(va,{peaks:zl(e,Dl),enVivo:!0,height:52,"aria-label":"Nivel del micrófono"})]}),n.jsx("div",{className:me.linea_tiempos,children:n.jsxs("span",{className:me.tiempo,children:[gr(t)," / ",gr(r)]})}),s&&a&&n.jsxs("div",{className:me.aviso_silencio,role:"status",children:[n.jsx(rs,{size:15}),n.jsx("span",{children:"No se detecta tu voz. Revisa que el micrófono no esté silenciado y que sea el dispositivo correcto."})]})]})}function jp({texto:e,aceptado:t,onCambio:r}){return n.jsxs("label",{className:`${me.consentimiento} ${t?me.consentimiento_aceptado:""}`,children:[n.jsx("input",{type:"checkbox",className:me.consentimiento_check,checked:t,onChange:a=>r(a.target.checked)}),n.jsx("span",{className:`${me.caja} ${t?me.caja_marcada:""}`,"aria-hidden":!0,children:t&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:me.caja_onda}),n.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",children:n.jsx("path",{className:me.caja_check,d:"M3 8.4 6.4 11.9 13.5 4.3",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),n.jsx("span",{className:me.consentimiento_texto,children:e})]})}function Hp({requireConsent:e,consentText:t,consintio:r,onConsentir:a,maxDurationSec:o,error:s,onIniciar:i}){const c=!e||r;return n.jsxs("div",{className:me.zona_idle,children:[e&&n.jsx(jp,{texto:t,aceptado:r,onCambio:a}),n.jsxs("button",{type:"button",className:`${me.boton_grabar} ${c&&e?me.boton_grabar_habilitado:""}`,disabled:!c,onClick:i,children:[n.jsx("span",{className:me.boton_grabar_halo,"aria-hidden":!0}),n.jsx(jl,{size:18}),"Iniciar grabación"]}),n.jsx("p",{className:me.ayuda,children:c?`Máximo ${gr(o)}. Se pedirá permiso para usar el micrófono.`:"Acepta el aviso para habilitar la grabación."}),s&&n.jsxs("div",{className:me.alerta,role:"alert",children:[n.jsx(rs,{size:16}),n.jsx("span",{children:s.message})]})]})}function Up({audio:e,preview:t,subido:r}){const a=e.duracionSeg,o=a>0?Math.min(1,t.tiempo/a):0;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:me.zona_player,children:[n.jsx("audio",{ref:t.ref,src:e.url,preload:"auto",onPlay:()=>t.setActivo(!0),onPause:()=>t.setActivo(!1),onTimeUpdate:s=>t.setTiempo(s.currentTarget.currentTime),onEnded:()=>{t.setActivo(!1),t.setTiempo(0)}}),n.jsx("button",{type:"button",className:me.boton_play,"aria-label":t.activo?"Pausar":"Reproducir grabación",onClick:t.alternar,children:n.jsx("span",{className:me.icono_pop,children:t.activo?n.jsx(ts,{size:18}):n.jsx(Hl,{size:18})},t.activo?"pausa":"play")}),n.jsx(va,{peaks:t.peaks??bn(Yo,e.url),progreso:o,reproduciendo:t.activo,height:52,onSeek:t.buscar})]}),n.jsxs("div",{className:me.linea_tiempos,children:[n.jsxs("span",{className:me.tiempo,children:[gr(t.tiempo)," / ",gr(a)]}),n.jsx("span",{className:me.tiempo,children:r?"Guardado":"Sin guardar"})]})]})}const Wp="Autorizo la grabación de mi voz y el tratamiento de este audio para los fines de este registro.";function qp({headerLabel:e="Grabadora",title:t="Nueva grabación",subtitle:r,meta:a,storagePath:o,firebaseStorage:s,fileNameBuilder:i,maxDurationSec:c=600,requireConsent:l=!0,consentText:d=Wp,onRecordingComplete:h,onUploadComplete:g,onUploadError:f,onDeleted:u,onPermissionError:v,onClose:p,className:m,id:w,"data-testid":b}){const{estado:y,segundos:E,niveles:S,sinVoz:C,audio:T,error:F,iniciar:D,pausar:M,reanudar:U,detener:V,descartar:N}=Pl({maxDurationSec:c,onError:v,onComplete:h}),k=_.useId(),A=w??`audio-recorder-${k}`,O=`${A}-title`,[$,x]=_.useState(!1),I=Np(T),L=Fp({audio:T,storagePath:o,firebaseStorage:s,fileNameBuilder:i,onUploadComplete:g,onUploadError:f,onDeleted:u}),X=y==="grabando",H=y==="pausado",z=y==="revision"&&T!==null,q=z?"revision":X||H?"grabando":"idle",B=()=>{x(!1),L.subido&&L.eliminar(),N()};return n.jsxs("section",{id:A,className:`${me.tarjeta} ${m??""}`,"data-testid":b??A,"aria-labelledby":O,children:[n.jsxs("div",{className:me.barra_superior,children:[n.jsx("span",{className:me.header_label,children:e}),n.jsxs("div",{className:me.barra_superior_acciones,children:[(X||H)&&n.jsxs("span",{className:me.indicador_rec,children:[n.jsx("span",{className:`${me.punto_rec} ${H?me.punto_pausa:""}`,"aria-hidden":!0}),H?"En pausa":"Grabando"]}),p&&n.jsx("button",{type:"button",className:me.boton_icono,"aria-label":"Cerrar",onClick:p,children:n.jsx(Ul,{size:15})})]})]}),n.jsxs("div",{className:me.panel,children:[n.jsx("div",{className:me.encabezado,children:n.jsxs("div",{className:me.encabezado_textos,children:[r&&n.jsx("span",{className:me.kicker,children:r}),n.jsx("h3",{id:O,className:me.titulo,children:t}),a&&n.jsx("span",{className:me.meta,children:a})]})}),n.jsxs("div",{className:me.zona_animada,children:[q==="idle"&&n.jsx(Hp,{requireConsent:l,consentText:d,consintio:$,onConsentir:x,maxDurationSec:c,error:y==="error"?F:null,onIniciar:()=>void D()}),q==="grabando"&&n.jsx(Vp,{niveles:S,segundos:E,maxDurationSec:c,grabando:X,pausado:H,sinVoz:C,onPausar:M,onReanudar:U}),q==="revision"&&T&&n.jsx(Up,{audio:T,preview:I,subido:L.subido})]},q),L.error&&n.jsxs("div",{className:me.alerta,role:"alert",children:[n.jsx(rs,{size:16}),n.jsxs("span",{children:["No se pudo subir el audio: ",L.error]})]})]}),n.jsx(Bp,{grabando:X,pausado:H,enRevision:z,puedeSubir:!!o,subida:L,onDetener:V,onDescartar:B,onSubir:()=>T&&void L.subir(T)})]})}const Ve={tarjeta:"_tarjeta_2vmxj_1",barra_superior:"_barra_superior_2vmxj_31",header_label:"_header_label_2vmxj_45",barra_superior_acciones:"_barra_superior_acciones_2vmxj_55",boton_icono:"_boton_icono_2vmxj_67",panel:"_panel_2vmxj_121",encabezado:"_encabezado_2vmxj_143",encabezado_textos:"_encabezado_textos_2vmxj_157",kicker:"_kicker_2vmxj_171",titulo:"_titulo_2vmxj_185",meta:"_meta_2vmxj_203",encabezado_lado:"_encabezado_lado_2vmxj_213",fecha:"_fecha_2vmxj_229",zona_player:"_zona_player_2vmxj_241",boton_play:"_boton_play_2vmxj_253",boton_play_activo:"_boton_play_activo_2vmxj_311",icono_pop:"_icono_pop_2vmxj_325",linea_tiempos:"_linea_tiempos_2vmxj_371",tiempo:"_tiempo_2vmxj_389",barra_inferior:"_barra_inferior_2vmxj_401",barra_inferior_grupo:"_barra_inferior_grupo_2vmxj_417",boton_velocidad:"_boton_velocidad_2vmxj_429",grupo_volumen:"_grupo_volumen_2vmxj_481",volumen_icono:"_volumen_icono_2vmxj_501",vol_pista:"_vol_pista_2vmxj_513",vol_riel:"_vol_riel_2vmxj_549",vol_activa:"_vol_activa_2vmxj_569",vol_relleno:"_vol_relleno_2vmxj_577",vol_thumb:"_vol_thumb_2vmxj_589"};function Wl({valor:e,onCambio:t}){const r=_.useRef(null),a=_.useRef(!1),[o,s]=_.useState(!1),i=_.useCallback(c=>{const l=r.current;if(!l)return;const d=l.getBoundingClientRect();t(Math.min(1,Math.max(0,(c-d.left)/d.width)))},[t]);return n.jsxs("div",{ref:r,className:`${Ve.vol_pista} ${o?Ve.vol_activa:""}`,role:"slider","aria-label":"Volumen","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e*100),tabIndex:0,onPointerDown:c=>{a.current=!0,s(!0),c.currentTarget.setPointerCapture(c.pointerId),i(c.clientX)},onPointerMove:c=>a.current&&i(c.clientX),onPointerUp:()=>{a.current=!1,s(!1)},onKeyDown:c=>{(c.key==="ArrowRight"||c.key==="ArrowUp")&&t(Math.min(1,e+.1)),(c.key==="ArrowLeft"||c.key==="ArrowDown")&&t(Math.max(0,e-.1))},children:[n.jsx("div",{className:Ve.vol_riel,children:n.jsx("div",{className:Ve.vol_relleno,style:{width:`${e*100}%`}})}),n.jsx("div",{className:Ve.vol_thumb,style:{left:`${e*100}%`}})]})}async function Gp(e,t){try{const r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);const a=await r.blob(),o=URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=Mp(t,a.type),document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch{window.open(e,"_blank","noopener")}}function Rp({src:e,headerLabel:t="Audio",title:r,subtitle:a,meta:o,date:s,actions:i,allowDownload:c=!0,downloadFileName:l="audio",bars:d=96,onClose:h,onEnded:g,className:f,id:u,"data-testid":v}){const p=_.useRef(null),[m,w]=_.useState(!1),[b,y]=_.useState(0),[E,S]=_.useState(0),[C,T]=_.useState(1),[F,D]=_.useState(()=>bn(d,e)),[M,U]=Jo(p,m);_.useEffect(()=>{let I=!1;return Bl(e,d).then(L=>{I||D(L)}),()=>{I=!0}},[e,d]),_.useEffect(()=>{const I=p.current;I&&(I.playbackRate=ga[E],I.volume=C)},[E,C]);const V=_.useCallback(()=>{const I=p.current;I&&(I.paused?I.play():I.pause())},[]),N=_.useCallback(I=>{const L=p.current;!L||!Number.isFinite(L.duration)||(L.currentTime=I*L.duration,U(L.currentTime))},[U]),k=b>0?Math.min(1,M/b):0,A=_.useMemo(()=>[Ve.tarjeta,f??""].filter(Boolean).join(" "),[f]),O=_.useId(),$=u??`audio-player-${O}`,x=`${$}-title`;return n.jsxs("section",{id:$,className:A,"data-testid":v??$,"aria-labelledby":x,children:[n.jsx("audio",{ref:p,src:e,preload:"metadata",onPlay:()=>w(!0),onPause:()=>w(!1),onTimeUpdate:I=>U(I.currentTarget.currentTime),onDurationChange:I=>{const L=I.currentTarget.duration;Number.isFinite(L)&&y(L)},onEnded:()=>{w(!1),g?.()}}),n.jsxs("div",{className:Ve.barra_superior,children:[n.jsx("span",{className:Ve.header_label,children:t}),n.jsx("div",{className:Ve.barra_superior_acciones,children:h&&n.jsx("button",{type:"button",className:Ve.boton_icono,"aria-label":"Cerrar",onClick:h,children:n.jsx(Ul,{size:15})})})]}),n.jsxs("div",{className:Ve.panel,children:[n.jsxs("div",{className:Ve.encabezado,children:[n.jsxs("div",{className:Ve.encabezado_textos,children:[a&&n.jsx("span",{className:Ve.kicker,children:a}),n.jsx("h3",{id:x,className:Ve.titulo,children:r}),o&&n.jsx("span",{className:Ve.meta,children:o})]}),n.jsxs("div",{className:Ve.encabezado_lado,children:[s&&n.jsx("span",{className:Ve.fecha,children:s}),i]})]}),n.jsxs("div",{className:Ve.zona_player,children:[n.jsx("button",{type:"button",className:`${Ve.boton_play} ${m?Ve.boton_play_activo:""}`,"aria-label":m?"Pausar":"Reproducir",onClick:V,children:n.jsx("span",{className:Ve.icono_pop,children:m?n.jsx(ts,{size:18}):n.jsx(Hl,{size:18})},m?"pausa":"play")}),n.jsx(va,{peaks:F,progreso:k,onSeek:N,reproduciendo:m,height:60})]}),n.jsx("div",{className:Ve.linea_tiempos,children:n.jsxs("span",{className:Ve.tiempo,children:[gr(M)," / ",gr(b)]})})]}),n.jsxs("div",{className:Ve.barra_inferior,children:[n.jsxs("div",{className:Ve.barra_inferior_grupo,children:[c&&n.jsx("button",{type:"button",className:Ve.boton_icono,"aria-label":"Descargar audio",title:"Descargar",onClick:()=>void Gp(e,l),children:n.jsx(Op,{size:16})}),n.jsx("button",{type:"button",className:Ve.boton_velocidad,"aria-label":`Velocidad de reproducción ${ga[E]}x`,onClick:()=>S(I=>(I+1)%ga.length),children:n.jsxs("span",{className:Ve.icono_pop,children:[ga[E],"x"]},E)})]}),n.jsxs("div",{className:Ve.grupo_volumen,children:[n.jsx("span",{className:Ve.volumen_icono,children:n.jsx(Dp,{size:16})}),n.jsx(Wl,{valor:C,onCambio:T})]})]})]})}const Xp=e=>/\.(csv|tsv|txt)$/i.test(e),ns=e=>e==null?"":String(e).trim();function Kp(e){const t=e.replace(/"[^"]*"/g,"").replace(/\./g,"").replace(/\[[^\]]*\]/g,"");return/[dy]/i.test(t)&&/m/i.test(t)}function Yp(e){const t=new Map;for(const r of Object.keys(e)){if(r.startsWith("!"))continue;const a=e[r];if(a.t!=="n"||typeof a.v!="number"||typeof a.z!="string")continue;let o=t.get(a.z);if(o===void 0&&t.set(a.z,o=Kp(a.z)),!o)continue;const s=Fr.SSF.parse_date_code(a.v);if(!s)continue;const i=String(s.d).padStart(2,"0"),c=String(s.m).padStart(2,"0");a.t="s",a.v=`${i}/${c}/${s.y}`,delete a.w,delete a.z}}function Zp(e,t){const r=e["!ref"];if(!r)return[];const a=Fr.utils.decode_range(r);if(t>a.e.r)return[];const o={s:{r:t,c:a.s.c},e:{r:t,c:a.e.c}};return(Fr.utils.sheet_to_json(e,{header:1,raw:!0,range:o})[0]??[]).map(ns).filter(Boolean)}const Jp=65279;function Qp(e){const t=new TextDecoder("utf-8").decode(e);return t.charCodeAt(0)===Jp?t.slice(1):t}function eg(e,t){const{filasOmitir:r=0,esTexto:a=!1,nombreHoja:o}=t,s=a?Fr.read(Qp(e),{type:"string",raw:!0}):Fr.read(e,{type:"array",cellNF:!0});if(o&&!s.SheetNames.includes(o))throw new Error(`El archivo no tiene una hoja llamada "${o}". Hojas disponibles: ${s.SheetNames.join(", ")}`);const i=s.Sheets[o??s.SheetNames[0]];if(!i)return{filas:[],encabezados:[],hojas:s.SheetNames};a||Yp(i);const c=Zp(i,r),l=Fr.utils.sheet_to_json(i,{defval:"",raw:!0,range:r}),d=[];for(const h of l){const g={};let f=!1;for(const u of Object.keys(h)){const v=ns(h[u]);g[u]=v,v&&(f=!0)}f&&d.push(g)}return{filas:d,encabezados:c,hojas:s.SheetNames}}const tg=Object.freeze(Object.defineProperty({__proto__:null,esArchivoTexto:Xp,normalizarCelda:ns,parsearLibro:eg},Symbol.toStringTag,{value:"Module"}));Z.AudioPlayer=Rp,Z.AudioRecorder=qp,Z.Badge=Ta,Z.BadgeVoz=$a,Z.Boton=Ye,Z.Checkbox=Ur,Z.CheckboxGroup=fc,Z.ContextMenu=mc,Z.ControlVolumen=Wl,Z.Drawer=Wc,Z.DropdownContext=Fo,Z.DropdownMenu=hn,Z.ExcelImport=rp,Z.FileStage=t_,Z.FileViewer=o_,Z.GrabacionIcono=ms,Z.GroupButton=I0,Z.IconoCerrar=qc,Z.IconoDerecha=Kc,Z.IconoFiltroAplicar=Gc,Z.IconoFiltroLimpiar=Rc,Z.IconoIzquierda=Xc,Z.InputDate=vs,Z.InputNumeric=gs,Z.InputText=us,Z.MenuItem=Oo,Z.MenuList=ua,Z.MicrofonoIcono=Ma,Z.Modal=Ho,Z.ModalAviso=pn,Z.PanelFiltros=F0,Z.Radio=Vo,Z.RadioGroup=Oc,Z.Select=Zi,Z.Signature=ds,Z.Slider=Bc,Z.SonidoIcono=Fa,Z.Submenu=Do,Z.TablaDatos=n0,Z.TextArea=ws,Z.Toggle=Aa,Z.Tooltip=dr,Z.Transicion=xn,Z.Waveform=va,Z.anioEnRango=fp,Z.aplicarClavesUnicas=Sl,Z.aplicarExistenciaExterna=Tl,Z.combinar=np,Z.correoElectronico=mp,Z.edadMinima=hp,Z.esCheckbox=hc,Z.esEntero=xp,Z.esFechaValida=lp,Z.esLabel=gc,Z.esNumero=kp,Z.esRadio=_c,Z.esSeparador=pc,Z.expresionRegular=pa,Z.extraerPeaks=Qo,Z.fechaEnRango=xd,Z.fechaEntre=up,Z.fechaPosteriorA=_p,Z.formatearFecha=Ia,Z.formatearNumero=Yr,Z.formatearTiempo=gr,Z.generarOpcionesAleatorias=Hf,Z.generarUsuariosPrueba=Uf,Z.leerArchivoExcel=Q_,Z.leerArchivoExcelDetallado=Ko,Z.longitudMaxima=gp,Z.longitudMinima=vp,Z.no=ap,Z.noFechaFutura=dp,Z.normClave=ct,Z.obtenerFechaHoy=kd,Z.parsearNumero=fs,Z.peaksDesdeArrayBuffer=es,Z.peaksDesdeUrl=Bl,Z.peaksEnVivo=zl,Z.peaksPlaceholder=bn,Z.procesarValidacion=hs,Z.prohibidoSi=cp,Z.rangoNumerico=Cp,Z.redondearDecimales=_s,Z.requerido=pp,Z.requeridoSi=sp,Z.requeridoSiHayValor=ip,Z.restringirRango=Na,Z.siTieneValor=op,Z.soloLetras=bp,Z.soloNumeros=Ep,Z.tieneHijos=fn,Z.unoDeLosSiguientes=wp,Z.unoDeLosSiguientesNormalizado=yp,Z.useAudioRecorder=Pl,Z.useCheckboxGroupContext=uc,Z.useDropdownContext=$o,Z.useReconocimientoVoz=bs,Z.useTablaContext=Lh,Z.useTablaContextSafe=_r,Z.useTiempoSuave=Jo,Z.validarEncabezados=gl,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})}));
68
68
  //# sourceMappingURL=index.umd.cjs.map