corekit-ui 0.1.9 → 0.1.10
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.
- package/CHANGELOG.md +42 -0
- package/dist/animations/Transiciones.d.ts +9 -0
- package/dist/animations/index.d.ts +1 -0
- package/dist/boton/Boton.d.ts +2 -0
- package/dist/boton/index.d.ts +2 -0
- package/dist/boton/typesButton.d.ts +31 -0
- package/dist/checkbox/Checkbox.d.ts +18 -0
- package/dist/checkbox/CheckboxGroup.d.ts +3 -0
- package/dist/checkbox/Iconografia.d.ts +0 -0
- package/dist/checkbox/index.d.ts +3 -0
- package/dist/checkbox/types.d.ts +41 -0
- package/dist/corekit-ui.css +1 -1
- package/dist/firma_manual/FirmaManual.d.ts +3 -0
- package/dist/firma_manual/Iconografia.d.ts +16 -0
- package/dist/firma_manual/TypesFirma.d.ts +22 -0
- package/dist/firma_manual/index.d.ts +2 -0
- package/dist/firma_manual/useFirmaLogica.d.ts +10 -0
- package/dist/hablar_escuchar/BadgeVoz.d.ts +6 -0
- package/dist/hablar_escuchar/Iconografia.d.ts +10 -0
- package/dist/hablar_escuchar/index.d.ts +3 -0
- package/dist/hablar_escuchar/useReconocimientoVoz.d.ts +21 -0
- package/dist/index.d.ts +12 -2925
- package/dist/index.js +4041 -4065
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +7 -6
- package/dist/index.umd.cjs.map +1 -0
- package/dist/input_date/InputDate.d.ts +339 -0
- package/dist/input_date/funciones.d.ts +27 -0
- package/dist/input_date/index.d.ts +3 -0
- package/dist/input_date/types.d.ts +64 -0
- package/dist/input_numeric/Iconografia.d.ts +5 -0
- package/dist/input_numeric/InputNumeric.d.ts +351 -0
- package/dist/input_numeric/funciones.d.ts +64 -0
- package/dist/input_numeric/index.d.ts +3 -0
- package/dist/input_numeric/types.d.ts +92 -0
- package/dist/input_text/Iconografia.d.ts +9 -0
- package/dist/input_text/InputText.d.ts +345 -0
- package/dist/input_text/index.d.ts +2 -0
- package/dist/input_text/types.d.ts +73 -0
- package/dist/input_types_compartidos/index.d.ts +1 -0
- package/dist/input_types_compartidos/types.d.ts +11 -0
- package/dist/select/Iconografia.d.ts +10 -0
- package/dist/select/Select.d.ts +56 -0
- package/dist/select/SelectNativo.d.ts +57 -0
- package/dist/select/Types.d.ts +543 -0
- package/dist/select/funciones.d.ts +229 -0
- package/dist/select/index.d.ts +4 -0
- package/dist/tabla_datos/TablaDatos.d.ts +80 -0
- package/dist/tabla_datos/components/Iconografia.d.ts +17 -0
- package/dist/tabla_datos/components/TablaCards.d.ts +1 -0
- package/dist/tabla_datos/components/TablaEscritorio.d.ts +1 -0
- package/dist/tabla_datos/components/configuraciones/ConfigColumnas.d.ts +1 -0
- package/dist/tabla_datos/components/configuraciones/ConfigEncabezado.d.ts +6 -0
- package/dist/tabla_datos/components/configuraciones/ConfigFilas.d.ts +1 -0
- package/dist/tabla_datos/components/configuraciones/ConfigOpciones.d.ts +6 -0
- package/dist/tabla_datos/components/configuraciones/MenuConfiguraciones.d.ts +1 -0
- package/dist/tabla_datos/components/skeletons/SkeletonCargando.d.ts +4 -0
- package/dist/tabla_datos/components/skeletons/SkeletonCargandoCards.d.ts +2 -0
- package/dist/tabla_datos/components/tabla/BarraHerramientas.d.ts +1 -0
- package/dist/tabla_datos/components/tabla/BarraSeleccion.d.ts +9 -0
- package/dist/tabla_datos/components/tabla/Paginacion.d.ts +1 -0
- package/dist/tabla_datos/components/tabla/SinDatos.d.ts +1 -0
- package/dist/tabla_datos/components/tabla/tabla_cards/AccionesCards.d.ts +3 -0
- package/dist/tabla_datos/components/tabla/tabla_cards/ContenidoCards.d.ts +3 -0
- package/dist/tabla_datos/components/tabla/tabla_cards/EncabezadoCards.d.ts +3 -0
- package/dist/tabla_datos/constantes/ConstGenerales.d.ts +18 -0
- package/dist/tabla_datos/context/ContextTypes.d.ts +23 -0
- package/dist/tabla_datos/context/TablaDatosContext.d.ts +3 -0
- package/dist/tabla_datos/context/hooks.d.ts +10 -0
- package/dist/tabla_datos/hooks/useClickOutside.d.ts +8 -0
- package/dist/tabla_datos/hooks/useEscapeKey.d.ts +1 -0
- package/dist/tabla_datos/hooks/usePopoverPosition.d.ts +15 -0
- package/dist/tabla_datos/hooks/useScrollLock.d.ts +1 -0
- package/dist/tabla_datos/index.d.ts +5 -0
- package/dist/tabla_datos/types/TablaTypes.d.ts +85 -0
- package/dist/tabla_datos/utils/FuncionesColumnas.d.ts +9 -0
- package/dist/tabla_datos/utils/FuncionesPaginacion.d.ts +12 -0
- package/dist/tabla_datos/utils/FuncionesTabla.d.ts +30 -0
- package/dist/text_area/Iconografia.d.ts +6 -0
- package/dist/text_area/TextArea.d.ts +331 -0
- package/dist/text_area/index.d.ts +2 -0
- package/dist/text_area/types.d.ts +72 -0
- package/dist/texts/Texts.d.ts +19 -0
- package/package.json +141 -120
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(ce,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(ce=typeof globalThis<"u"?globalThis:ce||self,l(ce.CoreKitUI={},ce.jsxRuntime,ce.React,ce.ReactDOM))})(this,(function(ce,l,v,Zn){"use strict";function Xo(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const I=Xo(v),Jn=Xo(Zn);function Yo(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(t=Yo(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function W(){for(var e,n,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(n=Yo(e))&&(o&&(o+=" "),o+=n);return o}const Zo=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jo=W,is=(e,n)=>t=>{var o;if((n==null?void 0:n.variants)==null)return Jo(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:i}=n,s=Object.keys(r).map(u=>{const f=t==null?void 0:t[u],h=i==null?void 0:i[u];if(f===null)return null;const g=Zo(f)||Zo(h);return r[u][g]}),a=t&&Object.entries(t).reduce((u,f)=>{let[h,g]=f;return g===void 0||(u[h]=g),u},{}),d=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:h,className:g,...c}=f;return Object.entries(c).every(p=>{let[_,m]=p;return Array.isArray(m)?m.includes({...i,...a}[_]):{...i,...a}[_]===m})?[...u,h,g]:u},[]);return Jo(e,s,d,t==null?void 0:t.class,t==null?void 0:t.className)},ve={boton:"_boton_15fyn_1",animated:"_animated_15fyn_61",disabled:"_disabled_15fyn_61",loading:"_loading_15fyn_61",content:"_content_15fyn_69",spinner:"_spinner_15fyn_71",spinner_icon:"_spinner_icon_15fyn_111",ripple:"_ripple_15fyn_147",solid:"_solid_15fyn_199",bordered:"_bordered_15fyn_219",ghost:"_ghost_15fyn_239",light:"_light_15fyn_263",faded:"_faded_15fyn_283",shadow:"_shadow_15fyn_303",only_loading:"_only_loading_15fyn_355",sm:"_sm_15fyn_373",md:"_md_15fyn_387",lg:"_lg_15fyn_401",full_width:"_full_width_15fyn_415",icon_only:"_icon_only_15fyn_423",radius_none:"_radius_none_15fyn_465",radius_sm:"_radius_sm_15fyn_473",radius_md:"_radius_md_15fyn_481",radius_lg:"_radius_lg_15fyn_489",radius_full:"_radius_full_15fyn_497",primary:"_primary_15fyn_505",secondary:"_secondary_15fyn_515",success:"_success_15fyn_525",warning:"_warning_15fyn_535",danger:"_danger_15fyn_545",default:"_default_15fyn_555"},ss=is(ve.boton,{variants:{variant:{solid:ve.solid,bordered:ve.bordered,ghost:ve.ghost,light:ve.light,faded:ve.faded,shadow:ve.shadow},color:{default:ve.default,primary:ve.primary,secondary:ve.secondary,success:ve.success,warning:ve.warning,danger:ve.danger},size:{sm:ve.sm,md:ve.md,lg:ve.lg},radius:{none:ve.radius_none,sm:ve.radius_sm,md:ve.radius_md,lg:ve.radius_lg,full:ve.radius_full},fullWidth:{true:ve.full_width},isIconOnly:{true:ve.icon_only},isLoading:{true:ve.loading},onlyLoading:{true:ve.only_loading},isDisabled:{true:ve.disabled},disableAnimation:{false:ve.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),lt=({variant:e="solid",color:n="default",size:t="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:a=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:f=!0,customColor:h,spinner:g,spinnerPlacement:c="end",children:p,className:_,onClick:m,style:b,type:w="button","aria-label":C,...S})=>{const x=a||i,y=P=>{if(x){P.preventDefault();return}if(m==null||m(P),u||x||!(P.currentTarget instanceof HTMLElement))return;const U=P.currentTarget,z=document.createElement("span"),k=U.getBoundingClientRect(),A=Math.max(k.width,k.height);z.className=ve.ripple,z.style.width=`${A}px`,z.style.height=`${A}px`,z.style.left=`${P.clientX-k.left}px`,z.style.top=`${P.clientY-k.top}px`,z.addEventListener("animationend",()=>z.remove(),{once:!0}),U.appendChild(z)},M=h?{"--btn-color":h,"--btn-text-color":h,...b}:b,E=ss({variant:e,color:h?void 0:n,size:t,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:s,isDisabled:x,disableAnimation:f}),T=i&&l.jsx("span",{className:ve.spinner,"aria-hidden":s?void 0:"true",children:g||l.jsx("span",{className:ve.spinner_icon})}),F=s&&!C?"Cargando":C;return l.jsxs("button",{...S,type:w,"aria-label":F,"aria-busy":i,className:W(E,_),disabled:x,onClick:y,style:M,children:[c==="start"&&T,p&&!s&&l.jsx("span",{className:ve.content,children:p}),c==="end"&&T]})},xe={dialog:"_dialog_1vo1g_1",modal:"_modal_1vo1g_69",encabezado:"_encabezado_1vo1g_93",titulo:"_titulo_1vo1g_107",boton_cerrar:"_boton_cerrar_1vo1g_121",texto_esc:"_texto_esc_1vo1g_157",icono_x:"_icono_x_1vo1g_171",contenedor_lienzo:"_contenedor_lienzo_1vo1g_181",area_firma:"_area_firma_1vo1g_191",lienzo:"_lienzo_1vo1g_205",lienzo_deshabilitado:"_lienzo_deshabilitado_1vo1g_233",barra_acciones:"_barra_acciones_1vo1g_243",grupo_izquierda:"_grupo_izquierda_1vo1g_259",separador:"_separador_1vo1g_271",boton_accion:"_boton_accion_1vo1g_283",boton_guardar:"_boton_guardar_1vo1g_329",icono:"_icono_1vo1g_171",contenedor_consentimiento:"_contenedor_consentimiento_1vo1g_379",contenedor_checkbox:"_contenedor_checkbox_1vo1g_393",checkbox_nativo:"_checkbox_nativo_1vo1g_409",checkbox_custom:"_checkbox_custom_1vo1g_423",texto_consentimiento:"_texto_consentimiento_1vo1g_489",contenedor_subir:"_contenedor_subir_1vo1g_505",boton_subir:"_boton_subir_1vo1g_515",input_archivo:"_input_archivo_1vo1g_551"},as=({className:e,title:n="Deshacer"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M3 7v6h6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ls=({className:e,title:n="Limpiar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),cs=({className:e,title:n="Adjuntar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),us=({className:e,title:n="Cerrar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ds=()=>{const e=v.useRef(null),[n,t]=v.useState(!1),[o,r]=v.useState(!0),[i,s]=v.useState(null),[a,d]=v.useState([]),[u,f]=v.useState([]),h=v.useCallback(()=>{const S=e.current,x=S==null?void 0:S.getContext("2d");S&&x&&(x.clearRect(0,0,S.width,S.height),r(!0),d([]),f([]))},[]),g=v.useCallback(()=>{if(a.length===0)return;const S=a.slice(0,-1);d(S);const x=e.current,y=x==null?void 0:x.getContext("2d");!x||!y||(y.clearRect(0,0,x.width,x.height),S.forEach(M=>{if(!(M.puntos.length<2)){y.strokeStyle=M.color,y.beginPath(),y.moveTo(M.puntos[0].x,M.puntos[0].y);for(let E=1;E<M.puntos.length;E++)y.lineTo(M.puntos[E].x,M.puntos[E].y);y.stroke()}}),r(S.length===0))},[a]),c=v.useCallback(S=>{const x=e.current;if(!x)return{x:0,y:0};const y=x.getBoundingClientRect(),M=x.width/y.width,E=x.height/y.height;return"touches"in S?{x:(S.touches[0].clientX-y.left)*M,y:(S.touches[0].clientY-y.top)*E}:{x:(S.clientX-y.left)*M,y:(S.clientY-y.top)*E}},[]),p=v.useCallback((S,x)=>{const y=e.current,M=y==null?void 0:y.getContext("2d");M&&(M.beginPath(),M.moveTo(S.x,S.y),M.lineTo(x.x,x.y),M.stroke(),r(!1))},[]),_=v.useCallback(S=>{S.preventDefault();const x=c(S);t(!0),s(x),f([x])},[c]),m=v.useCallback(S=>{if(!n||!i)return;S.preventDefault();const x=c(S);p(i,x),s(x),f(y=>[...y,x])},[n,i,c,p]),b=v.useCallback(()=>{if(n&&u.length>0){const S=e.current,x=S==null?void 0:S.getContext("2d"),y={puntos:u,color:(x==null?void 0:x.strokeStyle)||"#000000"};d(M=>[...M,y]),f([])}t(!1),s(null)},[n,u]),w=v.useCallback(()=>{const S=e.current;return!S||o?null:S.toDataURL("image/png")},[o]),C=v.useCallback((S,x=!0)=>{const y=e.current,M=y==null?void 0:y.getContext("2d");if(!(!y||!M))return M.strokeStyle=S,M.lineWidth=4,M.lineCap="round",M.lineJoin="round",x?(y.addEventListener("mousedown",_),y.addEventListener("mousemove",m),y.addEventListener("mouseup",b),y.addEventListener("mouseout",b),y.addEventListener("touchstart",_),y.addEventListener("touchmove",m),y.addEventListener("touchend",b),()=>{y.removeEventListener("mousedown",_),y.removeEventListener("mousemove",m),y.removeEventListener("mouseup",b),y.removeEventListener("mouseout",b),y.removeEventListener("touchstart",_),y.removeEventListener("touchmove",m),y.removeEventListener("touchend",b)}):()=>{}},[_,m,b]);return{canvasRef:e,estaVacio:o,limpiarCanvas:h,deshacerUltimoTrazo:g,puedeDeshacer:a.length>0,obtenerDatosFirma:w,configurarCanvas:C}},Qo=v.forwardRef(({isOpen:e=!1,onClose:n,onConfirm:t,titulo:o="Firmar el contrato",textoGuardar:r="Guardar firma",textoModificar:i="Modificar firma",textoDeshacer:s="Deshacer",textoLimpiar:a="Limpiar",textoAdjuntar:d="Adjuntar firma",ancho:u=500,alto:f=200,className:h,textoConsentimiento:g="Al firmar, confirmo que he leído y acepto todos los términos contractuales",mostrarBotonSubir:c=!1,cerrarAlGuardar:p=!1},_)=>{const{canvasRef:m,estaVacio:b,limpiarCanvas:w,deshacerUltimoTrazo:C,obtenerDatosFirma:S,configurarCanvas:x,puedeDeshacer:y}=ds(),M=v.useRef(null),E=v.useRef(null),[T,F]=v.useState(!1),[P,U]=v.useState(!1),[z,k]=v.useState(!1);v.useImperativeHandle(_,()=>({limpiar:w,obtenerDatosFirma:S,estaVacio:()=>b})),v.useEffect(()=>{if(e&&m.current){const L=m.current,ue=(()=>{const B=document.documentElement.getAttribute("data-theme"),pe=window.matchMedia("(prefers-color-scheme: dark)").matches;return B==="dark"||B===null&&pe})()?"#ffffff":"#000000",we=x(ue,!z),ye=new MutationObserver(()=>{const B=document.documentElement.getAttribute("data-theme"),pe=window.matchMedia("(prefers-color-scheme: dark)").matches,K=B==="dark"||B===null&&pe?"#ffffff":"#000000",J=L.getContext("2d");J&&(J.strokeStyle=K)});return ye.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{we==null||we(),ye.disconnect()}}},[e,x,m,z]),v.useEffect(()=>{const L=M.current;if(L)return e?(L.showModal(),document.body.style.overflow="hidden"):(L.close(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[e]);const A=v.useCallback(()=>{n&&(U(!1),F(!1),k(!1),n())},[n]);v.useEffect(()=>{if(!e)return;const L=re=>{re.key==="Escape"&&A()};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,A]);const O=v.useCallback(L=>{const re=M.current;if(!re)return;const Z=re.getBoundingClientRect();(L.clientX<Z.left||L.clientX>Z.right||L.clientY<Z.top||L.clientY>Z.bottom)&&A()},[A]),D=()=>{const L=S();L&&t&&T&&(U(!0),t(L),p&&n&&A())},$=()=>{U(!1),k(!1),w()},N=L=>{var ue;const re=(ue=L.target.files)==null?void 0:ue[0];if(!re||!m.current)return;const Z=new FileReader;Z.onload=we=>{var B;const ye=new Image;ye.onload=()=>{const pe=m.current,Ee=pe==null?void 0:pe.getContext("2d");if(!pe||!Ee)return;Ee.clearRect(0,0,pe.width,pe.height);const K=pe.width,J=pe.height,X=K/J,Y=ye.width/ye.height;let oe,te,se,de;Y>X?(oe=K,te=K/Y,se=0,de=(J-te)/2):(te=J,oe=J*Y,se=(K-oe)/2,de=0),Ee.drawImage(ye,se,de,oe,te),k(!0)},ye.src=(B=we.target)==null?void 0:B.result},Z.readAsDataURL(re)},j=()=>{var L;(L=E.current)==null||L.click()},_e=P||z,fe=!P&&(b&&!z||!T);return e?l.jsx("dialog",{ref:M,className:`${xe.dialog} ${h||""}`,onClick:O,"aria-labelledby":"firma-titulo","aria-describedby":"firma-consentimiento",children:l.jsxs("div",{className:xe.modal,children:[l.jsxs("header",{className:xe.encabezado,children:[l.jsx("h2",{id:"firma-titulo",className:xe.titulo,children:o}),l.jsxs("button",{className:xe.boton_cerrar,onClick:A,type:"button","aria-label":"Cerrar",children:[l.jsx("span",{className:xe.texto_esc,children:"ESC"}),l.jsx(us,{className:xe.icono_x})]})]}),l.jsx("div",{className:xe.contenedor_lienzo,children:l.jsxs("div",{className:xe.area_firma,children:[l.jsx("canvas",{ref:m,className:`${xe.lienzo} ${_e?xe.lienzo_deshabilitado:""}`,width:u*2,height:f*2,style:{pointerEvents:_e?"none":"auto"},"aria-label":"Área de firma"}),l.jsxs("div",{className:xe.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[l.jsxs("div",{className:xe.grupo_izquierda,children:[l.jsxs("button",{className:xe.boton_accion,onClick:C,type:"button",disabled:!y||_e,"aria-label":s,children:[l.jsx(as,{className:xe.icono,"aria-hidden":"true"}),l.jsx("span",{children:s})]}),l.jsx("span",{className:xe.separador,"aria-hidden":"true",children:"|"}),l.jsxs("button",{className:xe.boton_accion,onClick:w,type:"button",disabled:b||_e,"aria-label":a,children:[l.jsx(ls,{className:xe.icono,"aria-hidden":"true"}),l.jsx("span",{children:a})]})]}),l.jsx("button",{className:xe.boton_guardar,onClick:P?$:D,type:"button",disabled:fe,children:P?i:r})]})]})}),l.jsx("div",{className:xe.contenedor_consentimiento,children:l.jsxs("label",{className:xe.contenedor_checkbox,children:[l.jsx("input",{type:"checkbox",className:xe.checkbox_nativo,checked:T,onChange:L=>F(L.target.checked),"aria-describedby":"firma-consentimiento"}),l.jsx("span",{className:xe.checkbox_custom,"aria-hidden":"true"}),l.jsx("span",{id:"firma-consentimiento",className:xe.texto_consentimiento,children:g})]})}),c&&l.jsxs("div",{className:xe.contenedor_subir,children:[l.jsx("input",{ref:E,type:"file",accept:"image/*",className:xe.input_archivo,onChange:N,"aria-label":"Subir imagen de firma"}),l.jsxs("button",{className:xe.boton_subir,onClick:j,type:"button",children:[l.jsx(cs,{className:xe.icono,"aria-hidden":"true"}),d]})]})]})}):null});Qo.displayName="FirmaManual";const fs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let gn=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=fs[t[e]&63];return n};const gs=({size:e="1em",...n})=>l.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",...n,children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]}),_s=({size:e="1em",...n})=>l.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",...n,children:[l.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"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),ps=({size:e="1em",...n})=>l.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",...n,children:[l.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"}),l.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),l.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"}),l.jsx("path",{d:"m2 2 20 20"})]}),Me={contenedor_base:"_contenedor_base_h27e6_1",tam_sm:"_tam_sm_h27e6_39",tam_lg:"_tam_lg_h27e6_53",radio_none:"_radio_none_h27e6_67",radio_sm:"_radio_sm_h27e6_75",radio_md:"_radio_md_h27e6_83",radio_lg:"_radio_lg_h27e6_91",radio_full:"_radio_full_h27e6_99",color_default:"_color_default_h27e6_107",color_primary:"_color_primary_h27e6_109",color_secondary:"_color_secondary_h27e6_117",color_success:"_color_success_h27e6_125",color_warning:"_color_warning_h27e6_133",color_danger:"_color_danger_h27e6_141",etiqueta:"_etiqueta_h27e6_149",marca_requerido:"_marca_requerido_h27e6_167",envoltorio_input:"_envoltorio_input_h27e6_193",envoltorio_interno:"_envoltorio_interno_h27e6_219",entrada:"_entrada_h27e6_235",contenido_inicio:"_contenido_inicio_h27e6_293",contenido_final:"_contenido_final_h27e6_295",boton_limpiar:"_boton_limpiar_h27e6_313",tiene_contenido:"_tiene_contenido_h27e6_365",boton_password:"_boton_password_h27e6_375",descripcion:"_descripcion_h27e6_419",mensaje_error:"_mensaje_error_h27e6_431",ancho_total:"_ancho_total_h27e6_443",variante_bordered:"_variante_bordered_h27e6_451",variante_faded:"_variante_faded_h27e6_461",variante_underlined:"_variante_underlined_h27e6_471",variante_ghost:"_variante_ghost_h27e6_487",deshabilitado:"_deshabilitado_h27e6_499",solo_lectura:"_solo_lectura_h27e6_519",enfocado:"_enfocado_h27e6_535",valido:"_valido_h27e6_543",invalido:"_invalido_h27e6_551",sin_animacion:"_sin_animacion_h27e6_583"},er=v.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:a="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:h=!1,label:g,description:c,errorMessage:p,startContent:_,endContent:m,isRequired:b=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:S=!1,isInvalid:x,validationState:y,validate:M,classNames:E,onChange:T,onClear:F,onValueChange:P,onFocus:U,onBlur:z,onKeyDown:k,id:A,name:O,autoComplete:D,autoFocus:$,maxLength:N,minLength:j,pattern:_e,...fe}=e,L=v.useRef(null),Z=v.useRef(A??`input-text-${gn(8)}`).current;v.useImperativeHandle(n,()=>L.current);const ue=o!==void 0,[we,ye]=v.useState(r??""),B=ue?o:we,[pe,Ee]=v.useState(!1),[K,J]=v.useState(!1),X=v.useMemo(()=>{if(!M)return null;const le=M(B);return le===!0||le==null?null:typeof le=="string"?le:typeof le=="object"&&"message"in le?le.message??"Entrada inválida":"Entrada inválida"},[B,M]),Y=v.useMemo(()=>x!==void 0?x:y==="invalid"?!0:y==="valid"?!1:!!X,[x,y,X]),oe=y==="valid"&&!Y,te={invalido:Y,mensaje:X},se=B.length>0,de=t==="password",me=de&&K?"text":t,$e=S&&se&&!w&&!C,R=v.useCallback(le=>{if(C||w)return;const ke=le.target.value;ue||ye(ke),T==null||T(ke),P==null||P(ke)},[ue,C,w,T,P]),ne=v.useCallback(le=>{Ee(!0),U==null||U(le)},[U]),V=v.useCallback(le=>{Ee(!1),z==null||z(le)},[z]),ae=v.useCallback(()=>{var le;C||w||(ue||ye(""),T==null||T(""),P==null||P(""),F==null||F(),(le=L.current)==null||le.focus())},[ue,C,w,T,P,F]),he=v.useCallback(le=>{le.key==="Escape"&&S&&se&&ae(),k==null||k(le)},[S,se,ae,k]),Ce=v.useCallback(()=>{J(le=>!le),requestAnimationFrame(()=>{var le;return(le=L.current)==null?void 0:le.focus()})},[]),Be=c?`${Z}-desc`:void 0,Je=Y?`${Z}-err`:void 0,Ge=[Be,Je].filter(Boolean).join(" ")||void 0,ie=typeof p=="function"?p(te):p??X,Oe=W(Me.contenedor_base,Me[`variante_${s}`],Me[`tam_${d}`],Me[`radio_${u}`],Me[`color_${a}`],{[Me.ancho_total]:f,[Me.sin_animacion]:h,[Me.deshabilitado]:C,[Me.solo_lectura]:w,[Me.invalido]:Y,[Me.valido]:oe,[Me.enfocado]:pe,[Me.tiene_contenido]:se},E==null?void 0:E.base);return l.jsxs("div",{className:Oe,children:[g&&l.jsxs("label",{className:W(Me.etiqueta,E==null?void 0:E.label),htmlFor:Z,children:[g,b&&l.jsx("span",{className:Me.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:W(Me.envoltorio_input,E==null?void 0:E.inputWrapper),children:[_&&l.jsx("span",{className:Me.contenido_inicio,children:_}),l.jsx("div",{className:W(Me.envoltorio_interno,E==null?void 0:E.innerWrapper),children:l.jsx("input",{...fe,ref:L,id:Z,name:O,type:me,value:ue?B:void 0,defaultValue:ue?void 0:r,placeholder:i,disabled:C,readOnly:w,required:b,autoComplete:D,autoFocus:$,maxLength:N,minLength:j,pattern:_e,"aria-invalid":Y||void 0,"aria-describedby":Ge,"aria-required":b,className:W(Me.entrada,E==null?void 0:E.input),onChange:R,onFocus:ne,onBlur:V,onKeyDown:he})}),$e&&l.jsx("button",{type:"button",className:W(Me.boton_limpiar,E==null?void 0:E.clearButton),onClick:ae,tabIndex:-1,"aria-label":"Limpiar campo",children:l.jsx(gs,{size:"0.75em"})}),de&&l.jsx("button",{type:"button",className:Me.boton_password,onClick:Ce,tabIndex:-1,"aria-label":K?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":K,children:K?l.jsx(ps,{}):l.jsx(_s,{})}),m&&l.jsx("span",{className:Me.contenido_final,children:m})]}),c&&!Y&&l.jsx("div",{id:Be,className:W(Me.descripcion,E==null?void 0:E.description),children:c}),Y&&ie&&l.jsx("div",{id:Je,className:W(Me.mensaje_error,E==null?void 0:E.errorMessage),role:"alert",children:ie})]})});er.displayName="InputText";const hs=e=>l.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:[l.jsx("path",{d:"M5 12h14"}),l.jsx("path",{d:"M12 5v14"})]}),ms=e=>l.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:l.jsx("path",{d:"M5 12h14"})});function _n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:s="",sufijo:a=""}=n;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,f]=d.split(".");let h=u;if(t){const c=typeof t=="string"?t:",";h=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let g=h;return f!==void 0?g+=o+f:i&&r&&r>0&&(g+=o+"0".repeat(r)),`${s}${g}${a}`}function tr(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:s=!0}=n;let a=e;if(r&&(a=a.replace(new RegExp(`^${_n(r)}`),"")),i&&(a=a.replace(new RegExp(`${_n(i)}$`),"")),t){const u=typeof t=="string"?t:",";a=a.replace(new RegExp(_n(u),"g"),"")}o!=="."&&(a=a.replace(new RegExp(_n(o)),".")),s||(a=a.replace(/-/g,""));const d=parseFloat(a);return Number.isNaN(d)?void 0:d}function pn(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function nr(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 or(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}const Fe={contenedor_base:"_contenedor_base_1pqk6_1",tam_sm:"_tam_sm_1pqk6_39",tam_lg:"_tam_lg_1pqk6_53",radio_none:"_radio_none_1pqk6_67",radio_sm:"_radio_sm_1pqk6_75",radio_md:"_radio_md_1pqk6_83",radio_lg:"_radio_lg_1pqk6_91",radio_full:"_radio_full_1pqk6_99",color_default:"_color_default_1pqk6_107",color_primary:"_color_primary_1pqk6_109",color_secondary:"_color_secondary_1pqk6_117",color_success:"_color_success_1pqk6_125",color_warning:"_color_warning_1pqk6_133",color_danger:"_color_danger_1pqk6_141",etiqueta:"_etiqueta_1pqk6_149",marca_requerido:"_marca_requerido_1pqk6_167",envoltorio_input:"_envoltorio_input_1pqk6_193",envoltorio_interno:"_envoltorio_interno_1pqk6_217",entrada:"_entrada_1pqk6_235",contenido_inicio:"_contenido_inicio_1pqk6_305",contenido_final:"_contenido_final_1pqk6_307",controles:"_controles_1pqk6_325",boton_control:"_boton_control_1pqk6_341",variante_bordered:"_variante_bordered_1pqk6_395",variante_faded:"_variante_faded_1pqk6_403",variante_underlined:"_variante_underlined_1pqk6_411",variante_ghost:"_variante_ghost_1pqk6_423",descripcion:"_descripcion_1pqk6_471",mensaje_error:"_mensaje_error_1pqk6_483",ancho_total:"_ancho_total_1pqk6_495",deshabilitado:"_deshabilitado_1pqk6_549",solo_lectura:"_solo_lectura_1pqk6_569",enfocado:"_enfocado_1pqk6_585",valido:"_valido_1pqk6_593",invalido:"_invalido_1pqk6_601",sin_animacion:"_sin_animacion_1pqk6_633"},rr=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:a="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:h,description:g,errorMessage:c,startContent:p,endContent:_,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:C,validationState:S,validate:x,classNames:y,min:M,max:E,step:T=1,decimalScale:F,fixedDecimalScale:P=!1,thousandSeparator:U=!1,decimalSeparator:z=".",prefix:k="",suffix:A="",allowNegative:O=!0,allowDecimal:D=!0,hideControls:$=!1,clampBehavior:N="blur",onChange:j,onValueChange:_e,onFocus:fe,onBlur:L,onKeyDown:re,id:Z,name:ue,...we}=e,ye=v.useRef(null),pe=v.useRef(Z??`input-numeric-${gn(8)}`).current;v.useImperativeHandle(n,()=>ye.current);const Ee=t!==void 0,[K,J]=v.useState(o!==void 0?o:void 0),[X,Y]=v.useState(""),[oe,te]=v.useState(!1),se=Ee?t===""?void 0:t:K,de=v.useMemo(()=>({separadorMiles:U,separadorDecimal:z,escalaDecimal:D?F:0,decimalesFijos:P,prefijo:k,sufijo:A,permitirNegativo:O}),[U,z,F,P,k,A,O,D]),me=v.useMemo(()=>{if(!x)return null;const q=nr(x(se));return q.invalido?q.mensaje:null},[se,x]),$e=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!me,[C,S,me]),R=S==="valid"&&!$e,ne={invalido:$e,mensaje:me},V=v.useCallback(q=>{Ee||J(q),j==null||j(q),_e==null||_e(Xt(q,de),q)},[Ee,j,_e,de]),ae=v.useCallback(q=>{let Pe=(se??0)+T*q;N!=="none"&&(Pe=pn(Pe,M,E)),F!==void 0&&(Pe=or(Pe,F)),V(Pe),Y(Xt(Pe,de))},[se,T,M,E,N,F,V,de]),he=v.useCallback(q=>{if(w||b)return;const ge=q.target.value,Pe=z===","?",":".";let Te="0-9";D&&(Te+=Pe),O&&(Te+="-");const at=new RegExp(`[^${Te}]`,"g");let Qe=ge.replace(at,"");if(D){const rt=Qe.split(Pe);rt.length>2&&(Qe=rt[0]+Pe+rt.slice(1).join(""))}if(O&&Qe.includes("-")){const rt=Qe.replace(/-/g,"");Qe=Qe.startsWith("-")?"-"+rt:rt}Y(Qe);const et=tr(Qe,de);if(N==="strict"&&et!==void 0){const rt=pn(et,M,E);V(rt)}else V(et)},[w,b,de,N,M,E,V,z,O,D]),Ce=v.useCallback(q=>{if(te(!0),se!==void 0){let ge=String(se);z!=="."&&(ge=ge.replace(".",z)),Y(ge)}fe==null||fe(q)},[se,z,fe]),Be=v.useCallback(q=>{if(te(!1),N==="blur"&&se!==void 0){const ge=pn(se,M,E);ge!==se&&V(ge)}Y(Xt(se,de)),L==null||L(q)},[se,N,M,E,V,de,L]),Je=v.useCallback(q=>{q.key==="ArrowUp"?(q.preventDefault(),ae(1)):q.key==="ArrowDown"&&(q.preventDefault(),ae(-1));const ge=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Pe=q.ctrlKey||q.metaKey,Te=D&&(q.key===z||q.key==="."||q.key===","),at=q.key==="-"&&O,At=/^[0-9]$/.test(q.key);!ge.includes(q.key)&&!Pe&&!Te&&!at&&!At&&q.preventDefault(),re==null||re(q)},[ae,re,z,O,D]);v.useEffect(()=>{oe||Y(Xt(se,de))},[se,oe,de]);const Ge=g?`${pe}-desc`:void 0,ie=$e?`${pe}-err`:void 0,Oe=[Ge,ie].filter(Boolean).join(" ")||void 0,le=typeof c=="function"?c(ne):c??me,ke=E===void 0||(se??0)<E,wt=M===void 0||(se??0)>M,Ke=W(Fe.contenedor_base,Fe[`variante_${i}`],Fe[`tam_${a}`],Fe[`radio_${d}`],Fe[`color_${s}`],{[Fe.ancho_total]:u,[Fe.sin_animacion]:f,[Fe.deshabilitado]:w,[Fe.solo_lectura]:b,[Fe.invalido]:$e,[Fe.valido]:R,[Fe.enfocado]:oe},y==null?void 0:y.base);return l.jsxs("div",{className:Ke,children:[h&&l.jsxs("label",{className:W(Fe.etiqueta,y==null?void 0:y.label),htmlFor:pe,children:[h,m&&l.jsx("span",{className:Fe.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:W(Fe.envoltorio_input,y==null?void 0:y.inputWrapper),children:[l.jsxs("div",{className:W(Fe.envoltorio_interno,y==null?void 0:y.innerWrapper),children:[p&&l.jsx("span",{className:Fe.contenido_inicio,children:p}),l.jsx("input",{...we,ref:ye,id:pe,name:ue,type:"text",inputMode:"decimal",value:X,placeholder:r,disabled:w,readOnly:b,required:m,"aria-invalid":$e||void 0,"aria-describedby":Oe,"aria-required":m,className:W(Fe.entrada,y==null?void 0:y.input),onChange:he,onFocus:Ce,onBlur:Be,onKeyDown:Je}),_&&l.jsx("span",{className:Fe.contenido_final,children:_})]}),!$&&!b&&!w&&l.jsxs("div",{className:W(Fe.controles,y==null?void 0:y.controls),children:[l.jsx("button",{type:"button",tabIndex:-1,className:W(Fe.boton_control,y==null?void 0:y.controlButton),disabled:!wt,onClick:()=>ae(-1),"aria-label":"Decrementar valor",children:l.jsx(ms,{})}),l.jsx("button",{type:"button",tabIndex:-1,className:W(Fe.boton_control,y==null?void 0:y.controlButton),disabled:!ke,onClick:()=>ae(1),"aria-label":"Incrementar valor",children:l.jsx(hs,{})})]})]}),g&&!$e&&l.jsx("div",{id:Ge,className:W(Fe.descripcion,y==null?void 0:y.description),children:g}),$e&&le&&l.jsx("div",{id:ie,className:W(Fe.mensaje_error,y==null?void 0:y.errorMessage),role:"alert",children:le})]})});rr.displayName="InputNumeric";function vs(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 bs(e,n="es-CO"){if(!e)return"";const t=new Date(e+"T00:00:00");return Number.isNaN(t.getTime())?"":t.toLocaleDateString(n,{year:"numeric",month:"long",day:"numeric"})}function ws(){return new Date().toISOString().split("T")[0]}function ys(e,n,t){if(!e)return!0;const o=new Date(e).getTime();return!(n&&o<new Date(n).getTime()||t&&o>new Date(t).getTime())}const Le={contenedor_base:"_contenedor_base_k44n9_1",tam_sm:"_tam_sm_k44n9_39",tam_lg:"_tam_lg_k44n9_53",radio_none:"_radio_none_k44n9_67",radio_sm:"_radio_sm_k44n9_75",radio_md:"_radio_md_k44n9_83",radio_lg:"_radio_lg_k44n9_91",radio_full:"_radio_full_k44n9_99",color_default:"_color_default_k44n9_107",color_primary:"_color_primary_k44n9_109",color_secondary:"_color_secondary_k44n9_117",color_success:"_color_success_k44n9_125",color_warning:"_color_warning_k44n9_133",color_danger:"_color_danger_k44n9_141",etiqueta:"_etiqueta_k44n9_149",marca_requerido:"_marca_requerido_k44n9_167",envoltorio_input:"_envoltorio_input_k44n9_193",envoltorio_interno:"_envoltorio_interno_k44n9_219",entrada:"_entrada_k44n9_235",contenido_inicio:"_contenido_inicio_k44n9_305",descripcion:"_descripcion_k44n9_323",mensaje_error:"_mensaje_error_k44n9_335",ancho_total:"_ancho_total_k44n9_347",variante_bordered:"_variante_bordered_k44n9_355",variante_faded:"_variante_faded_k44n9_365",variante_underlined:"_variante_underlined_k44n9_375",variante_ghost:"_variante_ghost_k44n9_391",deshabilitado:"_deshabilitado_k44n9_403",solo_lectura:"_solo_lectura_k44n9_423",enfocado:"_enfocado_k44n9_439",valido:"_valido_k44n9_447",invalido:"_invalido_k44n9_455",sin_animacion:"_sin_animacion_k44n9_487"},ir=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:a="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:h,description:g,errorMessage:c,startContent:p,isRequired:_=!1,isReadOnly:m=!1,isDisabled:b=!1,isInvalid:w,validationState:C,validate:S,classNames:x,min:y,max:M,onChange:E,onFocus:T,onBlur:F,id:P,name:U,...z}=e,k=v.useRef(null),O=v.useRef(P??`input-date-${gn(8)}`).current;v.useImperativeHandle(n,()=>k.current);const D=t!==void 0,[$,N]=v.useState(o??""),j=D?t:$,[_e,fe]=v.useState(!1),L=v.useMemo(()=>{if(!S)return null;const Y=vs(S(j));return Y.invalido?Y.mensaje:null},[j,S]),re=v.useMemo(()=>w!==void 0?w:C==="invalid"?!0:C==="valid"?!1:!!L,[w,C,L]),Z=C==="valid"&&!re,ue={invalido:re,mensaje:L},we=v.useCallback(Y=>{if(b||m)return;const oe=Y.target.value;D||N(oe),E==null||E(oe)},[D,b,m,E]),ye=v.useCallback(Y=>{fe(!0),T==null||T(Y)},[T]),B=v.useCallback(Y=>{fe(!1),F==null||F(Y)},[F]),pe=g?`${O}-desc`:void 0,Ee=re?`${O}-err`:void 0,K=[pe,Ee].filter(Boolean).join(" ")||void 0,J=typeof c=="function"?c(ue):c??L,X=W(Le.contenedor_base,Le[`variante_${i}`],Le[`tam_${a}`],Le[`radio_${d}`],Le[`color_${s}`],{[Le.ancho_total]:u,[Le.sin_animacion]:f,[Le.deshabilitado]:b,[Le.solo_lectura]:m,[Le.invalido]:re,[Le.valido]:Z,[Le.enfocado]:_e},x==null?void 0:x.base);return l.jsxs("div",{className:X,children:[h&&l.jsxs("label",{className:W(Le.etiqueta,x==null?void 0:x.label),htmlFor:O,children:[h,_&&l.jsx("span",{className:Le.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsx("div",{className:W(Le.envoltorio_input,x==null?void 0:x.inputWrapper),children:l.jsxs("div",{className:W(Le.envoltorio_interno,x==null?void 0:x.innerWrapper),children:[p&&l.jsx("span",{className:Le.contenido_inicio,children:p}),l.jsx("input",{...z,ref:k,id:O,name:U,type:"date",value:D?j:void 0,defaultValue:D?void 0:o,placeholder:r,disabled:b,readOnly:m,required:_,min:y,max:M,"aria-invalid":re||void 0,"aria-describedby":K,"aria-required":_,className:W(Le.entrada,x==null?void 0:x.input),onChange:we,onFocus:ye,onBlur:B})]})}),g&&!re&&l.jsx("div",{id:pe,className:W(Le.descripcion,x==null?void 0:x.description),children:g}),re&&J&&l.jsx("div",{id:Ee,className:W(Le.mensaje_error,x==null?void 0:x.errorMessage),role:"alert",children:J})]})});ir.displayName="InputDate";const Cs={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function hn({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...r}){const[i,s]=v.useState(e),[a,d]=v.useState(e?"entrada":null);e&&!i?(s(!0),d("entrada")):!e&&i&&a!=="salida"&&d("salida");const u=()=>{a==="entrada"?d(null):a==="salida"&&(s(!1),d(null))};if(!i)return null;const f=Cs[t||"desvanecer"],h=a?`transicion_${f}_${a}`:"";return l.jsx("div",{...r,onAnimationEnd:u,className:`${h} ${o||""}`.trim(),children:n})}const ft={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function Qn(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:l.jsxs("g",{fill:"currentColor",children:[l.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),l.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 eo(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:l.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 sr(e){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),l.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 to({tipo:e,texto:n,size:t="md",estirar:o}){const r=e==="mic";return l.jsxs("span",{className:W(ft.badge_voz,r?ft.badge_mic:ft.badge_tts,ft[`badge_${t}`],o&&ft.badge_estirada),"data-tipo":e,children:[l.jsx("span",{className:ft.badge_icono,children:r?l.jsx(Qn,{}):l.jsx(eo,{})}),l.jsx("span",{className:ft.badge_texto,children:n}),r?l.jsxs("span",{className:ft.badge_ondas,"aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]}):l.jsxs("span",{className:ft.badge_eq,"aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]})]})}function ar({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[s,a]=v.useState(!1),[d,u]=v.useState(!1),[f,h]=v.useState(null),g=v.useRef(null),c=v.useRef(null),p=v.useRef(null),_=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=v.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),m&&window.speechSynthesis.cancel(),c.current=null,a(!1)},[m]),C=v.useCallback(()=>{if(!m||!e)return;if(w(),g.current){try{g.current.stop()}catch(M){console.error("Error stopping recognition:",M)}g.current=null,u(!1)}const y=new SpeechSynthesisUtterance(e);y.lang=i,y.onstart=()=>a(!0),y.onend=()=>{a(!1),c.current=null},y.onerror=()=>{a(!1),c.current=null},c.current=y,window.speechSynthesis.speak(y)},[m,e,i,w]),S=v.useCallback(()=>{if(g.current)try{g.current.stop()}catch(y){console.error("Error stopping recognition:",y)}u(!1),h(null)},[]),x=v.useCallback(()=>{if(!b||t||o)return;w();const y=window,M=y.SpeechRecognition||y.webkitSpeechRecognition;if(!M){h("Navegador no compatible");return}try{const E=new M;E.continuous=!0,E.interimResults=!0,E.lang=i,E.onstart=()=>{u(!0),h(null),_.current=e||""},E.onend=()=>{u(!1),g.current=null,r==null||r()},E.onerror=T=>{T.error!=="no-speech"&&(u(!1),g.current=null,T.error!=="aborted"&&h("Error al reconocer voz"))},E.onresult=T=>{try{let F="";for(let z=0;z<T.results.length;z++)F+=T.results[z][0].transcript;const P=_.current&&F?" ":"",U=_.current+P+F;n(U)}catch{h("Error procesando dictado")}},g.current=E,E.start()}catch{h("No se pudo iniciar dictado"),u(!1)}},[b,t,o,e,n,i,w,r]);return v.useEffect(()=>()=>{p.current&&clearTimeout(p.current),m&&window.speechSynthesis.cancel(),g.current&&g.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:b,hablando:s,escuchando:d,errorDictado:f,escuchar:C,detenerHablar:w,dictar:x,detenerDictado:S}}function Ss({size:e="1em",className:n}){return l.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:n,"aria-hidden":"true",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Ie={contenedor_base:"_contenedor_base_1sp58_1",tam_sm:"_tam_sm_1sp58_29",tam_lg:"_tam_lg_1sp58_41",radio_none:"_radio_none_1sp58_53",radio_sm:"_radio_sm_1sp58_61",radio_md:"_radio_md_1sp58_69",radio_lg:"_radio_lg_1sp58_77",radio_full:"_radio_full_1sp58_85",color_default:"_color_default_1sp58_93",color_primary:"_color_primary_1sp58_95",color_secondary:"_color_secondary_1sp58_103",color_success:"_color_success_1sp58_111",color_warning:"_color_warning_1sp58_119",color_danger:"_color_danger_1sp58_127",etiqueta:"_etiqueta_1sp58_135",marca_requerido:"_marca_requerido_1sp58_153",envoltorio_input:"_envoltorio_input_1sp58_179",entrada:"_entrada_1sp58_203",sin_autosize:"_sin_autosize_1sp58_253",barra_acciones:"_barra_acciones_1sp58_261",badges_contenedor:"_badges_contenedor_1sp58_281",botones_grupo:"_botones_grupo_1sp58_295",boton_accion:"_boton_accion_1sp58_307",boton_activo_tts:"_boton_activo_tts_1sp58_369",haloTts:"_haloTts_1sp58_1",boton_activo_mic:"_boton_activo_mic_1sp58_399",haloMic:"_haloMic_1sp58_1",boton_limpiar:"_boton_limpiar_1sp58_487",descripcion:"_descripcion_1sp58_535",mensaje_error:"_mensaje_error_1sp58_547",ancho_total:"_ancho_total_1sp58_559",variante_bordered:"_variante_bordered_1sp58_567",variante_faded:"_variante_faded_1sp58_577",variante_underlined:"_variante_underlined_1sp58_597",variante_ghost:"_variante_ghost_1sp58_623",deshabilitado:"_deshabilitado_1sp58_643",solo_lectura:"_solo_lectura_1sp58_663",enfocado:"_enfocado_1sp58_679",valido:"_valido_1sp58_687",invalido:"_invalido_1sp58_695",sin_animacion:"_sin_animacion_1sp58_727"},lr=v.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:r="default",size:i="md",radius:s="md",fullWidth:a=!0,disableAnimation:d=!1,label:u,description:f,errorMessage:h,value:g,defaultValue:c,placeholder:p,isRequired:_=!1,isReadOnly:m=!1,isDisabled:b=!1,isClearable:w=!1,isInvalid:C,validationState:S,validate:x,minRows:y=4,maxRows:M=10,disableAutosize:E=!1,hideVoiceActions:T=!1,classNames:F,onChange:P,onClear:U,onFocus:z,onBlur:k,id:A,name:O,rows:D,...$}=e,N=v.useRef(null),_e=v.useRef(A??`textarea-${gn(8)}`).current;v.useImperativeHandle(n,()=>N.current);const fe=g!==void 0,[L,re]=v.useState(c??""),Z=fe?g:L,[ue,we]=v.useState(!1),ye=v.useMemo(()=>{if(!x)return null;const q=x(Z);return q===!0||q==null?null:typeof q=="string"?q:typeof q=="object"&&"message"in q?q.message??"Entrada inválida":"Entrada inválida"},[Z,x]),B=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!ye,[C,S,ye]),pe=S==="valid"&&!B,Ee={invalido:B,mensaje:ye},K=Z.length>0,J=v.useCallback(()=>{if(!N.current||E)return;const q=N.current,ge=window.getComputedStyle(q),Pe=parseFloat(ge.lineHeight)||parseFloat(ge.fontSize)*1.5,Te=parseFloat(ge.paddingTop)||0,at=parseFloat(ge.paddingBottom)||0,At=parseFloat(ge.borderTopWidth)||0,Qe=parseFloat(ge.borderBottomWidth)||0,et=y*Pe+Te+at+At+Qe,rt=M*Pe+Te+at+At+Qe;q.style.height="auto";const Ko=q.scrollHeight;q.style.height=`${Math.min(Math.max(Ko,et),rt)}px`},[E,y,M]);v.useEffect(()=>{E||J()},[Z,J,E]);const X=v.useCallback(q=>{fe||re(q),P==null||P(q)},[fe,P]),{puedeHablar:Y,hablando:oe,escuchar:te,detenerHablar:se,puedeEscuchar:de,escuchando:me,errorDictado:$e,dictar:R,detenerDictado:ne}=ar({isDisabled:b||T,isReadOnly:m,value:Z,onChange:X}),V=v.useCallback(q=>{if(b||m)return;const ge=q.target.value;fe||re(ge),P==null||P(ge)},[fe,b,m,P]),ae=v.useCallback(q=>{we(!0),z==null||z(q)},[z]),he=v.useCallback(q=>{we(!1),k==null||k(q)},[k]),Ce=v.useCallback(()=>{var q;b||m||(fe||re(""),P==null||P(""),U==null||U(),(q=N.current)==null||q.focus())},[fe,b,m,P,U]),Be=v.useCallback(()=>{oe?se():te()},[oe,te,se]),Je=v.useCallback(()=>{me?ne():R()},[me,R,ne]),Ge=f?`${_e}-desc`:void 0,ie=B||$e?`${_e}-err`:void 0,Oe=[Ge,ie].filter(Boolean).join(" ")||void 0,le=typeof h=="function"?h(Ee):h??ye,ke=w&&K&&!m&&!b,wt=!T||ke,Ke=W(Ie.contenedor_base,Ie[`variante_${o}`],Ie[`tam_${i}`],Ie[`radio_${s}`],Ie[`color_${r}`],{[Ie.ancho_total]:a,[Ie.sin_animacion]:d,[Ie.deshabilitado]:b,[Ie.solo_lectura]:m,[Ie.invalido]:B,[Ie.valido]:pe,[Ie.enfocado]:ue},F==null?void 0:F.base);return l.jsxs("div",{className:Ke,children:[u&&l.jsxs("label",{className:W(Ie.etiqueta,F==null?void 0:F.label),htmlFor:_e,children:[u,_&&l.jsx("span",{className:Ie.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:W(Ie.envoltorio_input,F==null?void 0:F.inputWrapper),children:[l.jsx("textarea",{...$,ref:N,id:_e,name:O,placeholder:p,value:fe?Z:void 0,defaultValue:fe?void 0:c,onChange:V,onFocus:ae,onBlur:he,className:W(Ie.entrada,E&&Ie.sin_autosize,F==null?void 0:F.input),readOnly:m,disabled:b,rows:D??y,"aria-invalid":B||void 0,"aria-describedby":Oe,"aria-required":_}),wt&&l.jsxs("div",{className:W(Ie.barra_acciones,F==null?void 0:F.actions),children:[l.jsxs("div",{className:Ie.badges_contenedor,"aria-live":"polite",role:"status",children:[l.jsx(hn,{mostrar:me,children:l.jsx(to,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),l.jsx(hn,{mostrar:oe,children:l.jsx(to,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),l.jsxs("div",{className:Ie.botones_grupo,children:[!T&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:W(Ie.boton_accion,oe&&Ie.boton_activo_tts),onClick:Be,disabled:!Y||!oe&&(!Z||me),title:oe?"Detener lectura":"Leer texto","aria-pressed":oe,"aria-label":oe?"Detener lectura":"Leer texto",children:l.jsx(eo,{})}),de&&l.jsx("button",{type:"button",className:W(Ie.boton_accion,me&&Ie.boton_activo_mic),onClick:Je,disabled:b||m||oe,title:me?"Detener dictado":"Dictar texto","aria-pressed":me,"aria-label":me?"Detener dictado":"Dictar texto",children:me?l.jsx(sr,{}):l.jsx(Qn,{})})]}),ke&&l.jsx("button",{type:"button",className:Ie.boton_limpiar,onClick:Ce,title:"Limpiar campo","aria-label":"Limpiar campo",children:l.jsx(Ss,{size:"0.75em"})})]})]})]}),f&&!B&&l.jsx("div",{id:Ge,className:W(Ie.descripcion,F==null?void 0:F.description),children:f}),B&&le||$e?l.jsxs("div",{id:ie,className:W(Ie.mensaje_error,F==null?void 0:F.errorMessage),role:"alert",children:[le,le&&$e&&l.jsx("br",{}),$e&&l.jsxs("span",{children:["Error de voz: ",$e]})]}):null,t]})});lr.displayName="TextArea";function mn(){return typeof window<"u"}function yt(e){return no(e)?(e.nodeName||"").toLowerCase():"#document"}function Xe(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ct(e){var n;return(n=(no(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function no(e){return mn()?e instanceof Node||e instanceof Xe(e).Node:!1}function De(e){return mn()?e instanceof Element||e instanceof Xe(e).Element:!1}function Ve(e){return mn()?e instanceof HTMLElement||e instanceof Xe(e).HTMLElement:!1}function oo(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xe(e).ShadowRoot}const xs=new Set(["inline","contents"]);function Yt(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!xs.has(r)}const $s=new Set(["table","td","th"]);function Is(e){return $s.has(yt(e))}const Es=[":popover-open",":modal"];function vn(e){return Es.some(n=>{try{return e.matches(n)}catch{return!1}})}const ks=["transform","translate","scale","rotate","perspective"],Ms=["transform","translate","scale","rotate","perspective","filter"],Fs=["paint","layout","strict","content"];function ro(e){const n=bn(),t=De(e)?tt(e):e;return ks.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||Ms.some(o=>(t.willChange||"").includes(o))||Fs.some(o=>(t.contain||"").includes(o))}function As(e){let n=_t(e);for(;Ve(n)&&!gt(n);){if(ro(n))return n;if(vn(n))return null;n=_t(n)}return null}function bn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ds=new Set(["html","body","#document"]);function gt(e){return Ds.has(yt(e))}function tt(e){return Xe(e).getComputedStyle(e)}function wn(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(yt(e)==="html")return e;const n=e.assignedSlot||e.parentNode||oo(e)&&e.host||ct(e);return oo(n)?n.host:n}function cr(e){const n=_t(e);return gt(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ve(n)&&Yt(n)?n:cr(n)}function Ct(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=cr(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Xe(r);if(i){const a=io(s);return n.concat(s,s.visualViewport||[],Yt(r)?r:[],a&&t?Ct(a):[])}return n.concat(r,Ct(r,[],t))}function io(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zt=Math.min,Ye=Math.max,yn=Math.round,Rt=Math.floor,ut=e=>({x:e,y:e}),Os={left:"right",right:"left",bottom:"top",top:"bottom"},Ps={start:"end",end:"start"};function ur(e,n,t){return Ye(e,zt(n,t))}function Zt(e,n){return typeof e=="function"?e(n):e}function St(e){return e.split("-")[0]}function Jt(e){return e.split("-")[1]}function dr(e){return e==="x"?"y":"x"}function fr(e){return e==="y"?"height":"width"}const Ns=new Set(["top","bottom"]);function pt(e){return Ns.has(St(e))?"y":"x"}function gr(e){return dr(pt(e))}function Ls(e,n,t){t===void 0&&(t=!1);const o=Jt(e),r=gr(e),i=fr(r);let s=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=Cn(s)),[s,Cn(s)]}function Vs(e){const n=Cn(e);return[so(e),n,so(n)]}function so(e){return e.replace(/start|end/g,n=>Ps[n])}const _r=["left","right"],pr=["right","left"],Ts=["top","bottom"],zs=["bottom","top"];function Rs(e,n,t){switch(e){case"top":case"bottom":return t?n?pr:_r:n?_r:pr;case"left":case"right":return n?Ts:zs;default:return[]}}function qs(e,n,t,o){const r=Jt(e);let i=Rs(St(e),t==="start",o);return r&&(i=i.map(s=>s+"-"+r),n&&(i=i.concat(i.map(so)))),i}function Cn(e){return e.replace(/left|right|bottom|top/g,n=>Os[n])}function js(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bs(e){return typeof e!="number"?js(e):{top:e,right:e,bottom:e,left:e}}function Sn(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}/*!
|
|
1
|
+
(function(ie,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(ie=typeof globalThis<"u"?globalThis:ie||self,l(ie.CoreKitUI={},ie.jsxRuntime,ie.React,ie.ReactDOM))})(this,(function(ie,l,v,Zn){"use strict";function Yo(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const S=Yo(v),Jn=Yo(Zn);function Zo(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(t=Zo(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function H(){for(var e,n,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(n=Zo(e))&&(o&&(o+=" "),o+=n);return o}const Jo=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qo=H,as=(e,n)=>t=>{var o;if(n?.variants==null)return Qo(e,t?.class,t?.className);const{variants:r,defaultVariants:i}=n,s=Object.keys(r).map(c=>{const f=t?.[c],_=i?.[c];if(f===null)return null;const g=Jo(f)||Jo(_);return r[c][g]}),a=t&&Object.entries(t).reduce((c,f)=>{let[_,g]=f;return g===void 0||(c[_]=g),c},{}),d=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((c,f)=>{let{class:_,className:g,...u}=f;return Object.entries(u).every(p=>{let[h,m]=p;return Array.isArray(m)?m.includes({...i,...a}[h]):{...i,...a}[h]===m})?[...c,_,g]:c},[]);return Qo(e,s,d,t?.class,t?.className)},be={boton:"_boton_1jwdx_1",animated:"_animated_1jwdx_61",disabled:"_disabled_1jwdx_61",loading:"_loading_1jwdx_61",content:"_content_1jwdx_69",spinner:"_spinner_1jwdx_71",spinner_icon:"_spinner_icon_1jwdx_111",ripple:"_ripple_1jwdx_147",solid:"_solid_1jwdx_199",bordered:"_bordered_1jwdx_219",ghost:"_ghost_1jwdx_239",light:"_light_1jwdx_263",faded:"_faded_1jwdx_283",shadow:"_shadow_1jwdx_303",only_loading:"_only_loading_1jwdx_355",sm:"_sm_1jwdx_373",md:"_md_1jwdx_387",lg:"_lg_1jwdx_401",full_width:"_full_width_1jwdx_415",icon_only:"_icon_only_1jwdx_423",radius_none:"_radius_none_1jwdx_465",radius_sm:"_radius_sm_1jwdx_473",radius_md:"_radius_md_1jwdx_481",radius_lg:"_radius_lg_1jwdx_489",radius_full:"_radius_full_1jwdx_497",primary:"_primary_1jwdx_505",secondary:"_secondary_1jwdx_515",success:"_success_1jwdx_525",warning:"_warning_1jwdx_535",danger:"_danger_1jwdx_545",default:"_default_1jwdx_555"},ls=as(be.boton,{variants:{variant:{solid:be.solid,bordered:be.bordered,ghost:be.ghost,light:be.light,faded:be.faded,shadow:be.shadow},color:{default:be.default,primary:be.primary,secondary:be.secondary,success:be.success,warning:be.warning,danger:be.danger},size:{sm:be.sm,md:be.md,lg:be.lg},radius:{none:be.radius_none,sm:be.radius_sm,md:be.radius_md,lg:be.radius_lg,full:be.radius_full},fullWidth:{true:be.full_width},isIconOnly:{true:be.icon_only},isLoading:{true:be.loading},onlyLoading:{true:be.only_loading},isDisabled:{true:be.disabled},disableAnimation:{false:be.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),lt=({variant:e="solid",color:n="default",size:t="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:a=!1,isIconOnly:d=!1,disableRipple:c=!1,disableAnimation:f=!0,customColor:_,spinner:g,spinnerPlacement:u="end",children:p,className:h,onClick:m,style:b,type:w="button","aria-label":y,...C})=>{const I=a||i,x=V=>{if(I){V.preventDefault();return}if(m?.(V),c||I||!(V.currentTarget instanceof HTMLElement))return;const U=V.currentTarget,z=document.createElement("span"),E=U.getBoundingClientRect(),F=Math.max(E.width,E.height);z.className=be.ripple,z.style.width=`${F}px`,z.style.height=`${F}px`,z.style.left=`${V.clientX-E.left}px`,z.style.top=`${V.clientY-E.top}px`,z.addEventListener("animationend",()=>z.remove(),{once:!0}),U.appendChild(z)},M=_?{"--btn-color":_,"--btn-text-color":_,...b}:b,k=ls({variant:e,color:_?void 0:n,size:t,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:s,isDisabled:I,disableAnimation:f}),T=i&&l.jsx("span",{className:be.spinner,"aria-hidden":s?void 0:"true",children:g||l.jsx("span",{className:be.spinner_icon})}),A=s&&!y?"Cargando":y;return l.jsxs("button",{...C,type:w,"aria-label":A,"aria-busy":i,className:H(k,h),disabled:I,onClick:x,style:M,children:[u==="start"&&T,p&&!s&&l.jsx("span",{className:be.content,children:p}),u==="end"&&T]})},Se={dialog:"_dialog_1vo1g_1",modal:"_modal_1vo1g_69",encabezado:"_encabezado_1vo1g_93",titulo:"_titulo_1vo1g_107",boton_cerrar:"_boton_cerrar_1vo1g_121",texto_esc:"_texto_esc_1vo1g_157",icono_x:"_icono_x_1vo1g_171",contenedor_lienzo:"_contenedor_lienzo_1vo1g_181",area_firma:"_area_firma_1vo1g_191",lienzo:"_lienzo_1vo1g_205",lienzo_deshabilitado:"_lienzo_deshabilitado_1vo1g_233",barra_acciones:"_barra_acciones_1vo1g_243",grupo_izquierda:"_grupo_izquierda_1vo1g_259",separador:"_separador_1vo1g_271",boton_accion:"_boton_accion_1vo1g_283",boton_guardar:"_boton_guardar_1vo1g_329",icono:"_icono_1vo1g_171",contenedor_consentimiento:"_contenedor_consentimiento_1vo1g_379",contenedor_checkbox:"_contenedor_checkbox_1vo1g_393",checkbox_nativo:"_checkbox_nativo_1vo1g_409",checkbox_custom:"_checkbox_custom_1vo1g_423",texto_consentimiento:"_texto_consentimiento_1vo1g_489",contenedor_subir:"_contenedor_subir_1vo1g_505",boton_subir:"_boton_subir_1vo1g_515",input_archivo:"_input_archivo_1vo1g_551"},cs=({className:e,title:n="Deshacer"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M3 7v6h6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),us=({className:e,title:n="Limpiar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ds=({className:e,title:n="Adjuntar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),fs=({className:e,title:n="Cerrar"})=>l.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[l.jsx("title",{children:n}),l.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),gs=()=>{const e=v.useRef(null),[n,t]=v.useState(!1),[o,r]=v.useState(!0),[i,s]=v.useState(null),[a,d]=v.useState([]),[c,f]=v.useState([]),_=v.useCallback(()=>{const C=e.current,I=C?.getContext("2d");C&&I&&(I.clearRect(0,0,C.width,C.height),r(!0),d([]),f([]))},[]),g=v.useCallback(()=>{if(a.length===0)return;const C=a.slice(0,-1);d(C);const I=e.current,x=I?.getContext("2d");!I||!x||(x.clearRect(0,0,I.width,I.height),C.forEach(M=>{if(!(M.puntos.length<2)){x.strokeStyle=M.color,x.beginPath(),x.moveTo(M.puntos[0].x,M.puntos[0].y);for(let k=1;k<M.puntos.length;k++)x.lineTo(M.puntos[k].x,M.puntos[k].y);x.stroke()}}),r(C.length===0))},[a]),u=v.useCallback(C=>{const I=e.current;if(!I)return{x:0,y:0};const x=I.getBoundingClientRect(),M=I.width/x.width,k=I.height/x.height;return"touches"in C?{x:(C.touches[0].clientX-x.left)*M,y:(C.touches[0].clientY-x.top)*k}:{x:(C.clientX-x.left)*M,y:(C.clientY-x.top)*k}},[]),p=v.useCallback((C,I)=>{const M=e.current?.getContext("2d");M&&(M.beginPath(),M.moveTo(C.x,C.y),M.lineTo(I.x,I.y),M.stroke(),r(!1))},[]),h=v.useCallback(C=>{C.preventDefault();const I=u(C);t(!0),s(I),f([I])},[u]),m=v.useCallback(C=>{if(!n||!i)return;C.preventDefault();const I=u(C);p(i,I),s(I),f(x=>[...x,I])},[n,i,u,p]),b=v.useCallback(()=>{if(n&&c.length>0){const I=e.current?.getContext("2d"),x={puntos:c,color:I?.strokeStyle||"#000000"};d(M=>[...M,x]),f([])}t(!1),s(null)},[n,c]),w=v.useCallback(()=>{const C=e.current;return!C||o?null:C.toDataURL("image/png")},[o]),y=v.useCallback((C,I=!0)=>{const x=e.current,M=x?.getContext("2d");if(!(!x||!M))return M.strokeStyle=C,M.lineWidth=4,M.lineCap="round",M.lineJoin="round",I?(x.addEventListener("mousedown",h),x.addEventListener("mousemove",m),x.addEventListener("mouseup",b),x.addEventListener("mouseout",b),x.addEventListener("touchstart",h),x.addEventListener("touchmove",m),x.addEventListener("touchend",b),()=>{x.removeEventListener("mousedown",h),x.removeEventListener("mousemove",m),x.removeEventListener("mouseup",b),x.removeEventListener("mouseout",b),x.removeEventListener("touchstart",h),x.removeEventListener("touchmove",m),x.removeEventListener("touchend",b)}):()=>{}},[h,m,b]);return{canvasRef:e,estaVacio:o,limpiarCanvas:_,deshacerUltimoTrazo:g,puedeDeshacer:a.length>0,obtenerDatosFirma:w,configurarCanvas:y}},er=v.forwardRef(({isOpen:e=!1,onClose:n,onConfirm:t,titulo:o="Firmar el contrato",textoGuardar:r="Guardar firma",textoModificar:i="Modificar firma",textoDeshacer:s="Deshacer",textoLimpiar:a="Limpiar",textoAdjuntar:d="Adjuntar firma",ancho:c=500,alto:f=200,className:_,textoConsentimiento:g="Al firmar, confirmo que he leído y acepto todos los términos contractuales",mostrarBotonSubir:u=!1,cerrarAlGuardar:p=!1},h)=>{const{canvasRef:m,estaVacio:b,limpiarCanvas:w,deshacerUltimoTrazo:y,obtenerDatosFirma:C,configurarCanvas:I,puedeDeshacer:x}=gs(),M=v.useRef(null),k=v.useRef(null),[T,A]=v.useState(!1),[V,U]=v.useState(!1),[z,E]=v.useState(!1);v.useImperativeHandle(h,()=>({limpiar:w,obtenerDatosFirma:C,estaVacio:()=>b})),v.useEffect(()=>{if(e&&m.current){const L=m.current,ce=(()=>{const se=document.documentElement.getAttribute("data-theme"),me=window.matchMedia("(prefers-color-scheme: dark)").matches;return se==="dark"||se===null&&me})()?"#ffffff":"#000000",ve=I(ce,!z),ye=new MutationObserver(()=>{const se=document.documentElement.getAttribute("data-theme"),me=window.matchMedia("(prefers-color-scheme: dark)").matches,K=se==="dark"||se===null&&me?"#ffffff":"#000000",Z=L.getContext("2d");Z&&(Z.strokeStyle=K)});return ye.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{ve?.(),ye.disconnect()}}},[e,I,m,z]),v.useEffect(()=>{const L=M.current;if(L)return e?(L.showModal(),document.body.style.overflow="hidden"):(L.close(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[e]);const F=v.useCallback(()=>{n&&(U(!1),A(!1),E(!1),n())},[n]);v.useEffect(()=>{if(!e)return;const L=re=>{re.key==="Escape"&&F()};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,F]);const D=v.useCallback(L=>{const re=M.current;if(!re)return;const Y=re.getBoundingClientRect();(L.clientX<Y.left||L.clientX>Y.right||L.clientY<Y.top||L.clientY>Y.bottom)&&F()},[F]),N=()=>{const L=C();L&&t&&T&&(U(!0),t(L),p&&n&&F())},$=()=>{U(!1),E(!1),w()},P=L=>{const re=L.target.files?.[0];if(!re||!m.current)return;const Y=new FileReader;Y.onload=ce=>{const ve=new Image;ve.onload=()=>{const ye=m.current,se=ye?.getContext("2d");if(!ye||!se)return;se.clearRect(0,0,ye.width,ye.height);const me=ye.width,Ie=ye.height,K=me/Ie,Z=ve.width/ve.height;let G,W,ne,te;Z>K?(G=me,W=me/Z,ne=0,te=(Ie-W)/2):(W=Ie,G=Ie*Z,ne=(me-G)/2,te=0),se.drawImage(ve,ne,te,G,W),E(!0)},ve.src=ce.target?.result},Y.readAsDataURL(re)},B=()=>{k.current?.click()},he=V||z,_e=!V&&(b&&!z||!T);return e?l.jsx("dialog",{ref:M,className:`${Se.dialog} ${_||""}`,onClick:D,"aria-labelledby":"firma-titulo","aria-describedby":"firma-consentimiento",children:l.jsxs("div",{className:Se.modal,children:[l.jsxs("header",{className:Se.encabezado,children:[l.jsx("h2",{id:"firma-titulo",className:Se.titulo,children:o}),l.jsxs("button",{className:Se.boton_cerrar,onClick:F,type:"button","aria-label":"Cerrar",children:[l.jsx("span",{className:Se.texto_esc,children:"ESC"}),l.jsx(fs,{className:Se.icono_x})]})]}),l.jsx("div",{className:Se.contenedor_lienzo,children:l.jsxs("div",{className:Se.area_firma,children:[l.jsx("canvas",{ref:m,className:`${Se.lienzo} ${he?Se.lienzo_deshabilitado:""}`,width:c*2,height:f*2,style:{pointerEvents:he?"none":"auto"},"aria-label":"Área de firma"}),l.jsxs("div",{className:Se.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[l.jsxs("div",{className:Se.grupo_izquierda,children:[l.jsxs("button",{className:Se.boton_accion,onClick:y,type:"button",disabled:!x||he,"aria-label":s,children:[l.jsx(cs,{className:Se.icono,"aria-hidden":"true"}),l.jsx("span",{children:s})]}),l.jsx("span",{className:Se.separador,"aria-hidden":"true",children:"|"}),l.jsxs("button",{className:Se.boton_accion,onClick:w,type:"button",disabled:b||he,"aria-label":a,children:[l.jsx(us,{className:Se.icono,"aria-hidden":"true"}),l.jsx("span",{children:a})]})]}),l.jsx("button",{className:Se.boton_guardar,onClick:V?$:N,type:"button",disabled:_e,children:V?i:r})]})]})}),l.jsx("div",{className:Se.contenedor_consentimiento,children:l.jsxs("label",{className:Se.contenedor_checkbox,children:[l.jsx("input",{type:"checkbox",className:Se.checkbox_nativo,checked:T,onChange:L=>A(L.target.checked),"aria-describedby":"firma-consentimiento"}),l.jsx("span",{className:Se.checkbox_custom,"aria-hidden":"true"}),l.jsx("span",{id:"firma-consentimiento",className:Se.texto_consentimiento,children:g})]})}),u&&l.jsxs("div",{className:Se.contenedor_subir,children:[l.jsx("input",{ref:k,type:"file",accept:"image/*",className:Se.input_archivo,onChange:P,"aria-label":"Subir imagen de firma"}),l.jsxs("button",{className:Se.boton_subir,onClick:B,type:"button",children:[l.jsx(ds,{className:Se.icono,"aria-hidden":"true"}),d]})]})]})}):null});er.displayName="FirmaManual";const _s="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let gn=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=_s[t[e]&63];return n};const ps=({size:e="1em",...n})=>l.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",...n,children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]}),hs=({size:e="1em",...n})=>l.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",...n,children:[l.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"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),ms=({size:e="1em",...n})=>l.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",...n,children:[l.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"}),l.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),l.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"}),l.jsx("path",{d:"m2 2 20 20"})]}),ke={contenedor_base:"_contenedor_base_h27e6_1",tam_sm:"_tam_sm_h27e6_39",tam_lg:"_tam_lg_h27e6_53",radio_none:"_radio_none_h27e6_67",radio_sm:"_radio_sm_h27e6_75",radio_md:"_radio_md_h27e6_83",radio_lg:"_radio_lg_h27e6_91",radio_full:"_radio_full_h27e6_99",color_default:"_color_default_h27e6_107",color_primary:"_color_primary_h27e6_109",color_secondary:"_color_secondary_h27e6_117",color_success:"_color_success_h27e6_125",color_warning:"_color_warning_h27e6_133",color_danger:"_color_danger_h27e6_141",etiqueta:"_etiqueta_h27e6_149",marca_requerido:"_marca_requerido_h27e6_167",envoltorio_input:"_envoltorio_input_h27e6_193",envoltorio_interno:"_envoltorio_interno_h27e6_219",entrada:"_entrada_h27e6_235",contenido_inicio:"_contenido_inicio_h27e6_293",contenido_final:"_contenido_final_h27e6_295",boton_limpiar:"_boton_limpiar_h27e6_313",tiene_contenido:"_tiene_contenido_h27e6_365",boton_password:"_boton_password_h27e6_375",descripcion:"_descripcion_h27e6_419",mensaje_error:"_mensaje_error_h27e6_431",ancho_total:"_ancho_total_h27e6_443",variante_bordered:"_variante_bordered_h27e6_451",variante_faded:"_variante_faded_h27e6_461",variante_underlined:"_variante_underlined_h27e6_471",variante_ghost:"_variante_ghost_h27e6_487",deshabilitado:"_deshabilitado_h27e6_499",solo_lectura:"_solo_lectura_h27e6_519",enfocado:"_enfocado_h27e6_535",valido:"_valido_h27e6_543",invalido:"_invalido_h27e6_551",sin_animacion:"_sin_animacion_h27e6_583"},tr=v.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:a="default",size:d="md",radius:c="md",fullWidth:f=!0,disableAnimation:_=!1,label:g,description:u,errorMessage:p,startContent:h,endContent:m,isRequired:b=!1,isReadOnly:w=!1,isDisabled:y=!1,isClearable:C=!1,isInvalid:I,validationState:x,validate:M,classNames:k,onChange:T,onClear:A,onValueChange:V,onFocus:U,onBlur:z,onKeyDown:E,id:F,name:D,autoComplete:N,autoFocus:$,maxLength:P,minLength:B,pattern:he,..._e}=e,L=v.useRef(null),Y=v.useRef(F??`input-text-${gn(8)}`).current;v.useImperativeHandle(n,()=>L.current);const ce=o!==void 0,[ve,ye]=v.useState(r??""),se=ce?o:ve,[me,Ie]=v.useState(!1),[K,Z]=v.useState(!1),G=v.useMemo(()=>{if(!M)return null;const ue=M(se);return ue===!0||ue==null?null:typeof ue=="string"?ue:typeof ue=="object"&&"message"in ue?ue.message??"Entrada inválida":"Entrada inválida"},[se,M]),W=v.useMemo(()=>I!==void 0?I:x==="invalid"?!0:x==="valid"?!1:!!G,[I,x,G]),ne=x==="valid"&&!W,te={invalido:W,mensaje:G},le=se.length>0,ge=t==="password",pe=ge&&K?"text":t,xe=C&&le&&!w&&!y,R=v.useCallback(ue=>{if(y||w)return;const Ee=ue.target.value;ce||ye(Ee),T?.(Ee),V?.(Ee)},[ce,y,w,T,V]),ee=v.useCallback(ue=>{Ie(!0),U?.(ue)},[U]),O=v.useCallback(ue=>{Ie(!1),z?.(ue)},[z]),ae=v.useCallback(()=>{y||w||(ce||ye(""),T?.(""),V?.(""),A?.(),L.current?.focus())},[ce,y,w,T,V,A]),fe=v.useCallback(ue=>{ue.key==="Escape"&&C&&le&&ae(),E?.(ue)},[C,le,ae,E]),Ce=v.useCallback(()=>{Z(ue=>!ue),requestAnimationFrame(()=>L.current?.focus())},[]),Be=u?`${Y}-desc`:void 0,Je=W?`${Y}-err`:void 0,Ge=[Be,Je].filter(Boolean).join(" ")||void 0,oe=typeof p=="function"?p(te):p??G,Ae=H(ke.contenedor_base,ke[`variante_${s}`],ke[`tam_${d}`],ke[`radio_${c}`],ke[`color_${a}`],{[ke.ancho_total]:f,[ke.sin_animacion]:_,[ke.deshabilitado]:y,[ke.solo_lectura]:w,[ke.invalido]:W,[ke.valido]:ne,[ke.enfocado]:me,[ke.tiene_contenido]:le},k?.base);return l.jsxs("div",{className:Ae,children:[g&&l.jsxs("label",{className:H(ke.etiqueta,k?.label),htmlFor:Y,children:[g,b&&l.jsx("span",{className:ke.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:H(ke.envoltorio_input,k?.inputWrapper),children:[h&&l.jsx("span",{className:ke.contenido_inicio,children:h}),l.jsx("div",{className:H(ke.envoltorio_interno,k?.innerWrapper),children:l.jsx("input",{..._e,ref:L,id:Y,name:D,type:pe,value:ce?se:void 0,defaultValue:ce?void 0:r,placeholder:i,disabled:y,readOnly:w,required:b,autoComplete:N,autoFocus:$,maxLength:P,minLength:B,pattern:he,"aria-invalid":W||void 0,"aria-describedby":Ge,"aria-required":b,className:H(ke.entrada,k?.input),onChange:R,onFocus:ee,onBlur:O,onKeyDown:fe})}),xe&&l.jsx("button",{type:"button",className:H(ke.boton_limpiar,k?.clearButton),onClick:ae,tabIndex:-1,"aria-label":"Limpiar campo",children:l.jsx(ps,{size:"0.75em"})}),ge&&l.jsx("button",{type:"button",className:ke.boton_password,onClick:Ce,tabIndex:-1,"aria-label":K?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":K,children:K?l.jsx(ms,{}):l.jsx(hs,{})}),m&&l.jsx("span",{className:ke.contenido_final,children:m})]}),u&&!W&&l.jsx("div",{id:Be,className:H(ke.descripcion,k?.description),children:u}),W&&oe&&l.jsx("div",{id:Je,className:H(ke.mensaje_error,k?.errorMessage),role:"alert",children:oe})]})});tr.displayName="InputText";function _n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:s="",sufijo:a=""}=n;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[c,f]=d.split(".");let _=c;if(t){const u=typeof t=="string"?t:",";_=c.replace(/\B(?=(\d{3})+(?!\d))/g,u)}let g=_;return f!==void 0?g+=o+f:i&&r&&r>0&&(g+=o+"0".repeat(r)),`${s}${g}${a}`}function nr(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:s=!0}=n;let a=e;if(r&&(a=a.replace(new RegExp(`^${_n(r)}`),"")),i&&(a=a.replace(new RegExp(`${_n(i)}$`),"")),t){const c=typeof t=="string"?t:",";a=a.replace(new RegExp(_n(c),"g"),"")}o!=="."&&(a=a.replace(new RegExp(_n(o)),".")),s||(a=a.replace(/-/g,""));const d=parseFloat(a);return Number.isNaN(d)?void 0:d}function pn(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function or(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 rr(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}const vs=e=>l.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:[l.jsx("path",{d:"M5 12h14"}),l.jsx("path",{d:"M12 5v14"})]}),bs=e=>l.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:l.jsx("path",{d:"M5 12h14"})}),Me={contenedor_base:"_contenedor_base_1pqk6_1",tam_sm:"_tam_sm_1pqk6_39",tam_lg:"_tam_lg_1pqk6_53",radio_none:"_radio_none_1pqk6_67",radio_sm:"_radio_sm_1pqk6_75",radio_md:"_radio_md_1pqk6_83",radio_lg:"_radio_lg_1pqk6_91",radio_full:"_radio_full_1pqk6_99",color_default:"_color_default_1pqk6_107",color_primary:"_color_primary_1pqk6_109",color_secondary:"_color_secondary_1pqk6_117",color_success:"_color_success_1pqk6_125",color_warning:"_color_warning_1pqk6_133",color_danger:"_color_danger_1pqk6_141",etiqueta:"_etiqueta_1pqk6_149",marca_requerido:"_marca_requerido_1pqk6_167",envoltorio_input:"_envoltorio_input_1pqk6_193",envoltorio_interno:"_envoltorio_interno_1pqk6_217",entrada:"_entrada_1pqk6_235",contenido_inicio:"_contenido_inicio_1pqk6_305",contenido_final:"_contenido_final_1pqk6_307",controles:"_controles_1pqk6_325",boton_control:"_boton_control_1pqk6_341",variante_bordered:"_variante_bordered_1pqk6_395",variante_faded:"_variante_faded_1pqk6_403",variante_underlined:"_variante_underlined_1pqk6_411",variante_ghost:"_variante_ghost_1pqk6_423",descripcion:"_descripcion_1pqk6_471",mensaje_error:"_mensaje_error_1pqk6_483",ancho_total:"_ancho_total_1pqk6_495",deshabilitado:"_deshabilitado_1pqk6_549",solo_lectura:"_solo_lectura_1pqk6_569",enfocado:"_enfocado_1pqk6_585",valido:"_valido_1pqk6_593",invalido:"_invalido_1pqk6_601",sin_animacion:"_sin_animacion_1pqk6_633"},ir=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:a="md",radius:d="md",fullWidth:c=!0,disableAnimation:f=!1,label:_,description:g,errorMessage:u,startContent:p,endContent:h,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:y,validationState:C,validate:I,classNames:x,min:M,max:k,step:T=1,decimalScale:A,fixedDecimalScale:V=!1,thousandSeparator:U=!1,decimalSeparator:z=".",prefix:E="",suffix:F="",allowNegative:D=!0,allowDecimal:N=!0,hideControls:$=!1,clampBehavior:P="blur",onChange:B,onValueChange:he,onFocus:_e,onBlur:L,onKeyDown:re,id:Y,name:ce,...ve}=e,ye=v.useRef(null),me=v.useRef(Y??`input-numeric-${gn(8)}`).current;v.useImperativeHandle(n,()=>ye.current);const Ie=t!==void 0,[K,Z]=v.useState(o!==void 0?o:void 0),[G,W]=v.useState(""),[ne,te]=v.useState(!1),le=Ie?t===""?void 0:t:K,ge=v.useMemo(()=>({separadorMiles:U,separadorDecimal:z,escalaDecimal:N?A:0,decimalesFijos:V,prefijo:E,sufijo:F,permitirNegativo:D}),[U,z,A,V,E,F,D,N]),pe=v.useMemo(()=>{if(!I)return null;const q=or(I(le));return q.invalido?q.mensaje:null},[le,I]),xe=v.useMemo(()=>y!==void 0?y:C==="invalid"?!0:C==="valid"?!1:!!pe,[y,C,pe]),R=C==="valid"&&!xe,ee={invalido:xe,mensaje:pe},O=v.useCallback(q=>{Ie||Z(q),B?.(q),he?.(Xt(q,ge),q)},[Ie,B,he,ge]),ae=v.useCallback(q=>{let De=(le??0)+T*q;P!=="none"&&(De=pn(De,M,k)),A!==void 0&&(De=rr(De,A)),O(De),W(Xt(De,ge))},[le,T,M,k,P,A,O,ge]),fe=v.useCallback(q=>{if(w||b)return;const de=q.target.value,De=z===","?",":".";let Te="0-9";N&&(Te+=De),D&&(Te+="-");const at=new RegExp(`[^${Te}]`,"g");let Qe=de.replace(at,"");if(N){const rt=Qe.split(De);rt.length>2&&(Qe=rt[0]+De+rt.slice(1).join(""))}if(D&&Qe.includes("-")){const rt=Qe.replace(/-/g,"");Qe=Qe.startsWith("-")?"-"+rt:rt}W(Qe);const et=nr(Qe,ge);if(P==="strict"&&et!==void 0){const rt=pn(et,M,k);O(rt)}else O(et)},[w,b,ge,P,M,k,O,z,D,N]),Ce=v.useCallback(q=>{if(te(!0),le!==void 0){let de=String(le);z!=="."&&(de=de.replace(".",z)),W(de)}_e?.(q)},[le,z,_e]),Be=v.useCallback(q=>{if(te(!1),P==="blur"&&le!==void 0){const de=pn(le,M,k);de!==le&&O(de)}W(Xt(le,ge)),L?.(q)},[le,P,M,k,O,ge,L]),Je=v.useCallback(q=>{q.key==="ArrowUp"?(q.preventDefault(),ae(1)):q.key==="ArrowDown"&&(q.preventDefault(),ae(-1));const de=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],De=q.ctrlKey||q.metaKey,Te=N&&(q.key===z||q.key==="."||q.key===","),at=q.key==="-"&&D,Nt=/^[0-9]$/.test(q.key);!de.includes(q.key)&&!De&&!Te&&!at&&!Nt&&q.preventDefault(),re?.(q)},[ae,re,z,D,N]);v.useEffect(()=>{ne||W(Xt(le,ge))},[le,ne,ge]);const Ge=g?`${me}-desc`:void 0,oe=xe?`${me}-err`:void 0,Ae=[Ge,oe].filter(Boolean).join(" ")||void 0,ue=typeof u=="function"?u(ee):u??pe,Ee=k===void 0||(le??0)<k,bt=M===void 0||(le??0)>M,Ue=H(Me.contenedor_base,Me[`variante_${i}`],Me[`tam_${a}`],Me[`radio_${d}`],Me[`color_${s}`],{[Me.ancho_total]:c,[Me.sin_animacion]:f,[Me.deshabilitado]:w,[Me.solo_lectura]:b,[Me.invalido]:xe,[Me.valido]:R,[Me.enfocado]:ne},x?.base);return l.jsxs("div",{className:Ue,children:[_&&l.jsxs("label",{className:H(Me.etiqueta,x?.label),htmlFor:me,children:[_,m&&l.jsx("span",{className:Me.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:H(Me.envoltorio_input,x?.inputWrapper),children:[l.jsxs("div",{className:H(Me.envoltorio_interno,x?.innerWrapper),children:[p&&l.jsx("span",{className:Me.contenido_inicio,children:p}),l.jsx("input",{...ve,ref:ye,id:me,name:ce,type:"text",inputMode:"decimal",value:G,placeholder:r,disabled:w,readOnly:b,required:m,"aria-invalid":xe||void 0,"aria-describedby":Ae,"aria-required":m,className:H(Me.entrada,x?.input),onChange:fe,onFocus:Ce,onBlur:Be,onKeyDown:Je}),h&&l.jsx("span",{className:Me.contenido_final,children:h})]}),!$&&!b&&!w&&l.jsxs("div",{className:H(Me.controles,x?.controls),children:[l.jsx("button",{type:"button",tabIndex:-1,className:H(Me.boton_control,x?.controlButton),disabled:!bt,onClick:()=>ae(-1),"aria-label":"Decrementar valor",children:l.jsx(bs,{})}),l.jsx("button",{type:"button",tabIndex:-1,className:H(Me.boton_control,x?.controlButton),disabled:!Ee,onClick:()=>ae(1),"aria-label":"Incrementar valor",children:l.jsx(vs,{})})]})]}),g&&!xe&&l.jsx("div",{id:Ge,className:H(Me.descripcion,x?.description),children:g}),xe&&ue&&l.jsx("div",{id:oe,className:H(Me.mensaje_error,x?.errorMessage),role:"alert",children:ue})]})});ir.displayName="InputNumeric";function ws(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 ys(e,n="es-CO"){if(!e)return"";const t=new Date(e+"T00:00:00");return Number.isNaN(t.getTime())?"":t.toLocaleDateString(n,{year:"numeric",month:"long",day:"numeric"})}function Cs(){return new Date().toISOString().split("T")[0]}function Ss(e,n,t){if(!e)return!0;const o=new Date(e).getTime();return!(n&&o<new Date(n).getTime()||t&&o>new Date(t).getTime())}const Ve={contenedor_base:"_contenedor_base_k44n9_1",tam_sm:"_tam_sm_k44n9_39",tam_lg:"_tam_lg_k44n9_53",radio_none:"_radio_none_k44n9_67",radio_sm:"_radio_sm_k44n9_75",radio_md:"_radio_md_k44n9_83",radio_lg:"_radio_lg_k44n9_91",radio_full:"_radio_full_k44n9_99",color_default:"_color_default_k44n9_107",color_primary:"_color_primary_k44n9_109",color_secondary:"_color_secondary_k44n9_117",color_success:"_color_success_k44n9_125",color_warning:"_color_warning_k44n9_133",color_danger:"_color_danger_k44n9_141",etiqueta:"_etiqueta_k44n9_149",marca_requerido:"_marca_requerido_k44n9_167",envoltorio_input:"_envoltorio_input_k44n9_193",envoltorio_interno:"_envoltorio_interno_k44n9_219",entrada:"_entrada_k44n9_235",contenido_inicio:"_contenido_inicio_k44n9_305",descripcion:"_descripcion_k44n9_323",mensaje_error:"_mensaje_error_k44n9_335",ancho_total:"_ancho_total_k44n9_347",variante_bordered:"_variante_bordered_k44n9_355",variante_faded:"_variante_faded_k44n9_365",variante_underlined:"_variante_underlined_k44n9_375",variante_ghost:"_variante_ghost_k44n9_391",deshabilitado:"_deshabilitado_k44n9_403",solo_lectura:"_solo_lectura_k44n9_423",enfocado:"_enfocado_k44n9_439",valido:"_valido_k44n9_447",invalido:"_invalido_k44n9_455",sin_animacion:"_sin_animacion_k44n9_487"},sr=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:a="md",radius:d="md",fullWidth:c=!0,disableAnimation:f=!1,label:_,description:g,errorMessage:u,startContent:p,isRequired:h=!1,isReadOnly:m=!1,isDisabled:b=!1,isInvalid:w,validationState:y,validate:C,classNames:I,min:x,max:M,onChange:k,onFocus:T,onBlur:A,id:V,name:U,...z}=e,E=v.useRef(null),D=v.useRef(V??`input-date-${gn(8)}`).current;v.useImperativeHandle(n,()=>E.current);const N=t!==void 0,[$,P]=v.useState(o??""),B=N?t:$,[he,_e]=v.useState(!1),L=v.useMemo(()=>{if(!C)return null;const W=ws(C(B));return W.invalido?W.mensaje:null},[B,C]),re=v.useMemo(()=>w!==void 0?w:y==="invalid"?!0:y==="valid"?!1:!!L,[w,y,L]),Y=y==="valid"&&!re,ce={invalido:re,mensaje:L},ve=v.useCallback(W=>{if(b||m)return;const ne=W.target.value;N||P(ne),k?.(ne)},[N,b,m,k]),ye=v.useCallback(W=>{_e(!0),T?.(W)},[T]),se=v.useCallback(W=>{_e(!1),A?.(W)},[A]),me=g?`${D}-desc`:void 0,Ie=re?`${D}-err`:void 0,K=[me,Ie].filter(Boolean).join(" ")||void 0,Z=typeof u=="function"?u(ce):u??L,G=H(Ve.contenedor_base,Ve[`variante_${i}`],Ve[`tam_${a}`],Ve[`radio_${d}`],Ve[`color_${s}`],{[Ve.ancho_total]:c,[Ve.sin_animacion]:f,[Ve.deshabilitado]:b,[Ve.solo_lectura]:m,[Ve.invalido]:re,[Ve.valido]:Y,[Ve.enfocado]:he},I?.base);return l.jsxs("div",{className:G,children:[_&&l.jsxs("label",{className:H(Ve.etiqueta,I?.label),htmlFor:D,children:[_,h&&l.jsx("span",{className:Ve.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsx("div",{className:H(Ve.envoltorio_input,I?.inputWrapper),children:l.jsxs("div",{className:H(Ve.envoltorio_interno,I?.innerWrapper),children:[p&&l.jsx("span",{className:Ve.contenido_inicio,children:p}),l.jsx("input",{...z,ref:E,id:D,name:U,type:"date",value:N?B:void 0,defaultValue:N?void 0:o,placeholder:r,disabled:b,readOnly:m,required:h,min:x,max:M,"aria-invalid":re||void 0,"aria-describedby":K,"aria-required":h,className:H(Ve.entrada,I?.input),onChange:ve,onFocus:ye,onBlur:se})]})}),g&&!re&&l.jsx("div",{id:me,className:H(Ve.descripcion,I?.description),children:g}),re&&Z&&l.jsx("div",{id:Ie,className:H(Ve.mensaje_error,I?.errorMessage),role:"alert",children:Z})]})});sr.displayName="InputDate";const xs={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function hn({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...r}){const[i,s]=v.useState(e),[a,d]=v.useState(e?"entrada":null);e&&!i?(s(!0),d("entrada")):!e&&i&&a!=="salida"&&d("salida");const c=()=>{a==="entrada"?d(null):a==="salida"&&(s(!1),d(null))};if(!i)return null;const f=xs[t||"desvanecer"],_=a?`transicion_${f}_${a}`:"";return l.jsx("div",{...r,onAnimationEnd:c,className:`${_} ${o||""}`.trim(),children:n})}const ft={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function Qn(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:l.jsxs("g",{fill:"currentColor",children:[l.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),l.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 eo(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:l.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 ar(e){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),l.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 to({tipo:e,texto:n,size:t="md",estirar:o}){const r=e==="mic";return l.jsxs("span",{className:H(ft.badge_voz,r?ft.badge_mic:ft.badge_tts,ft[`badge_${t}`],o&&ft.badge_estirada),"data-tipo":e,children:[l.jsx("span",{className:ft.badge_icono,children:r?l.jsx(Qn,{}):l.jsx(eo,{})}),l.jsx("span",{className:ft.badge_texto,children:n}),r?l.jsxs("span",{className:ft.badge_ondas,"aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]}):l.jsxs("span",{className:ft.badge_eq,"aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]})]})}function lr({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[s,a]=v.useState(!1),[d,c]=v.useState(!1),[f,_]=v.useState(null),g=v.useRef(null),u=v.useRef(null),p=v.useRef(null),h=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=v.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),m&&window.speechSynthesis.cancel(),u.current=null,a(!1)},[m]),y=v.useCallback(()=>{if(!m||!e)return;if(w(),g.current){try{g.current.stop()}catch(M){console.error("Error stopping recognition:",M)}g.current=null,c(!1)}const x=new SpeechSynthesisUtterance(e);x.lang=i,x.onstart=()=>a(!0),x.onend=()=>{a(!1),u.current=null},x.onerror=()=>{a(!1),u.current=null},u.current=x,window.speechSynthesis.speak(x)},[m,e,i,w]),C=v.useCallback(()=>{if(g.current)try{g.current.stop()}catch(x){console.error("Error stopping recognition:",x)}c(!1),_(null)},[]),I=v.useCallback(()=>{if(!b||t||o)return;w();const x=window,M=x.SpeechRecognition||x.webkitSpeechRecognition;if(!M){_("Navegador no compatible");return}try{const k=new M;k.continuous=!0,k.interimResults=!0,k.lang=i,k.onstart=()=>{c(!0),_(null),h.current=e||""},k.onend=()=>{c(!1),g.current=null,r?.()},k.onerror=T=>{T.error!=="no-speech"&&(c(!1),g.current=null,T.error!=="aborted"&&_("Error al reconocer voz"))},k.onresult=T=>{try{let A="";for(let z=0;z<T.results.length;z++)A+=T.results[z][0].transcript;const V=h.current&&A?" ":"",U=h.current+V+A;n(U)}catch{_("Error procesando dictado")}},g.current=k,k.start()}catch{_("No se pudo iniciar dictado"),c(!1)}},[b,t,o,e,n,i,w,r]);return v.useEffect(()=>()=>{p.current&&clearTimeout(p.current),m&&window.speechSynthesis.cancel(),g.current&&g.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:b,hablando:s,escuchando:d,errorDictado:f,escuchar:y,detenerHablar:w,dictar:I,detenerDictado:C}}function $s({size:e="1em",className:n}){return l.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:n,"aria-hidden":"true",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const $e={contenedor_base:"_contenedor_base_1sp58_1",tam_sm:"_tam_sm_1sp58_29",tam_lg:"_tam_lg_1sp58_41",radio_none:"_radio_none_1sp58_53",radio_sm:"_radio_sm_1sp58_61",radio_md:"_radio_md_1sp58_69",radio_lg:"_radio_lg_1sp58_77",radio_full:"_radio_full_1sp58_85",color_default:"_color_default_1sp58_93",color_primary:"_color_primary_1sp58_95",color_secondary:"_color_secondary_1sp58_103",color_success:"_color_success_1sp58_111",color_warning:"_color_warning_1sp58_119",color_danger:"_color_danger_1sp58_127",etiqueta:"_etiqueta_1sp58_135",marca_requerido:"_marca_requerido_1sp58_153",envoltorio_input:"_envoltorio_input_1sp58_179",entrada:"_entrada_1sp58_203",sin_autosize:"_sin_autosize_1sp58_253",barra_acciones:"_barra_acciones_1sp58_261",badges_contenedor:"_badges_contenedor_1sp58_281",botones_grupo:"_botones_grupo_1sp58_295",boton_accion:"_boton_accion_1sp58_307",boton_activo_tts:"_boton_activo_tts_1sp58_369",haloTts:"_haloTts_1sp58_1",boton_activo_mic:"_boton_activo_mic_1sp58_399",haloMic:"_haloMic_1sp58_1",boton_limpiar:"_boton_limpiar_1sp58_487",descripcion:"_descripcion_1sp58_535",mensaje_error:"_mensaje_error_1sp58_547",ancho_total:"_ancho_total_1sp58_559",variante_bordered:"_variante_bordered_1sp58_567",variante_faded:"_variante_faded_1sp58_577",variante_underlined:"_variante_underlined_1sp58_597",variante_ghost:"_variante_ghost_1sp58_623",deshabilitado:"_deshabilitado_1sp58_643",solo_lectura:"_solo_lectura_1sp58_663",enfocado:"_enfocado_1sp58_679",valido:"_valido_1sp58_687",invalido:"_invalido_1sp58_695",sin_animacion:"_sin_animacion_1sp58_727"},cr=v.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:r="default",size:i="md",radius:s="md",fullWidth:a=!0,disableAnimation:d=!1,label:c,description:f,errorMessage:_,value:g,defaultValue:u,placeholder:p,isRequired:h=!1,isReadOnly:m=!1,isDisabled:b=!1,isClearable:w=!1,isInvalid:y,validationState:C,validate:I,minRows:x=4,maxRows:M=10,disableAutosize:k=!1,hideVoiceActions:T=!1,classNames:A,onChange:V,onClear:U,onFocus:z,onBlur:E,id:F,name:D,rows:N,...$}=e,P=v.useRef(null),he=v.useRef(F??`textarea-${gn(8)}`).current;v.useImperativeHandle(n,()=>P.current);const _e=g!==void 0,[L,re]=v.useState(u??""),Y=_e?g:L,[ce,ve]=v.useState(!1),ye=v.useMemo(()=>{if(!I)return null;const q=I(Y);return q===!0||q==null?null:typeof q=="string"?q:typeof q=="object"&&"message"in q?q.message??"Entrada inválida":"Entrada inválida"},[Y,I]),se=v.useMemo(()=>y!==void 0?y:C==="invalid"?!0:C==="valid"?!1:!!ye,[y,C,ye]),me=C==="valid"&&!se,Ie={invalido:se,mensaje:ye},K=Y.length>0,Z=v.useCallback(()=>{if(!P.current||k)return;const q=P.current,de=window.getComputedStyle(q),De=parseFloat(de.lineHeight)||parseFloat(de.fontSize)*1.5,Te=parseFloat(de.paddingTop)||0,at=parseFloat(de.paddingBottom)||0,Nt=parseFloat(de.borderTopWidth)||0,Qe=parseFloat(de.borderBottomWidth)||0,et=x*De+Te+at+Nt+Qe,rt=M*De+Te+at+Nt+Qe;q.style.height="auto";const Xo=q.scrollHeight;q.style.height=`${Math.min(Math.max(Xo,et),rt)}px`},[k,x,M]);v.useEffect(()=>{k||Z()},[Y,Z,k]);const G=v.useCallback(q=>{_e||re(q),V?.(q)},[_e,V]),{puedeHablar:W,hablando:ne,escuchar:te,detenerHablar:le,puedeEscuchar:ge,escuchando:pe,errorDictado:xe,dictar:R,detenerDictado:ee}=lr({isDisabled:b||T,isReadOnly:m,value:Y,onChange:G}),O=v.useCallback(q=>{if(b||m)return;const de=q.target.value;_e||re(de),V?.(de)},[_e,b,m,V]),ae=v.useCallback(q=>{ve(!0),z?.(q)},[z]),fe=v.useCallback(q=>{ve(!1),E?.(q)},[E]),Ce=v.useCallback(()=>{b||m||(_e||re(""),V?.(""),U?.(),P.current?.focus())},[_e,b,m,V,U]),Be=v.useCallback(()=>{ne?le():te()},[ne,te,le]),Je=v.useCallback(()=>{pe?ee():R()},[pe,R,ee]),Ge=f?`${he}-desc`:void 0,oe=se||xe?`${he}-err`:void 0,Ae=[Ge,oe].filter(Boolean).join(" ")||void 0,ue=typeof _=="function"?_(Ie):_??ye,Ee=w&&K&&!m&&!b,bt=!T||Ee,Ue=H($e.contenedor_base,$e[`variante_${o}`],$e[`tam_${i}`],$e[`radio_${s}`],$e[`color_${r}`],{[$e.ancho_total]:a,[$e.sin_animacion]:d,[$e.deshabilitado]:b,[$e.solo_lectura]:m,[$e.invalido]:se,[$e.valido]:me,[$e.enfocado]:ce},A?.base);return l.jsxs("div",{className:Ue,children:[c&&l.jsxs("label",{className:H($e.etiqueta,A?.label),htmlFor:he,children:[c,h&&l.jsx("span",{className:$e.marca_requerido,"aria-hidden":"true",children:"*"})]}),l.jsxs("div",{className:H($e.envoltorio_input,A?.inputWrapper),children:[l.jsx("textarea",{...$,ref:P,id:he,name:D,placeholder:p,value:_e?Y:void 0,defaultValue:_e?void 0:u,onChange:O,onFocus:ae,onBlur:fe,className:H($e.entrada,k&&$e.sin_autosize,A?.input),readOnly:m,disabled:b,rows:N??x,"aria-invalid":se||void 0,"aria-describedby":Ae,"aria-required":h}),bt&&l.jsxs("div",{className:H($e.barra_acciones,A?.actions),children:[l.jsxs("div",{className:$e.badges_contenedor,"aria-live":"polite",role:"status",children:[l.jsx(hn,{mostrar:pe,children:l.jsx(to,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),l.jsx(hn,{mostrar:ne,children:l.jsx(to,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),l.jsxs("div",{className:$e.botones_grupo,children:[!T&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:H($e.boton_accion,ne&&$e.boton_activo_tts),onClick:Be,disabled:!W||!ne&&(!Y||pe),title:ne?"Detener lectura":"Leer texto","aria-pressed":ne,"aria-label":ne?"Detener lectura":"Leer texto",children:l.jsx(eo,{})}),ge&&l.jsx("button",{type:"button",className:H($e.boton_accion,pe&&$e.boton_activo_mic),onClick:Je,disabled:b||m||ne,title:pe?"Detener dictado":"Dictar texto","aria-pressed":pe,"aria-label":pe?"Detener dictado":"Dictar texto",children:pe?l.jsx(ar,{}):l.jsx(Qn,{})})]}),Ee&&l.jsx("button",{type:"button",className:$e.boton_limpiar,onClick:Ce,title:"Limpiar campo","aria-label":"Limpiar campo",children:l.jsx($s,{size:"0.75em"})})]})]})]}),f&&!se&&l.jsx("div",{id:Ge,className:H($e.descripcion,A?.description),children:f}),se&&ue||xe?l.jsxs("div",{id:oe,className:H($e.mensaje_error,A?.errorMessage),role:"alert",children:[ue,ue&&xe&&l.jsx("br",{}),xe&&l.jsxs("span",{children:["Error de voz: ",xe]})]}):null,t]})});cr.displayName="TextArea";function mn(){return typeof window<"u"}function wt(e){return no(e)?(e.nodeName||"").toLowerCase():"#document"}function Xe(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ct(e){var n;return(n=(no(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function no(e){return mn()?e instanceof Node||e instanceof Xe(e).Node:!1}function Ne(e){return mn()?e instanceof Element||e instanceof Xe(e).Element:!1}function Le(e){return mn()?e instanceof HTMLElement||e instanceof Xe(e).HTMLElement:!1}function oo(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xe(e).ShadowRoot}const Is=new Set(["inline","contents"]);function Yt(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!Is.has(r)}const Es=new Set(["table","td","th"]);function ks(e){return Es.has(wt(e))}const Ms=[":popover-open",":modal"];function vn(e){return Ms.some(n=>{try{return e.matches(n)}catch{return!1}})}const Fs=["transform","translate","scale","rotate","perspective"],Ns=["transform","translate","scale","rotate","perspective","filter"],As=["paint","layout","strict","content"];function ro(e){const n=bn(),t=Ne(e)?tt(e):e;return Fs.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||Ns.some(o=>(t.willChange||"").includes(o))||As.some(o=>(t.contain||"").includes(o))}function Ds(e){let n=_t(e);for(;Le(n)&&!gt(n);){if(ro(n))return n;if(vn(n))return null;n=_t(n)}return null}function bn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ps=new Set(["html","body","#document"]);function gt(e){return Ps.has(wt(e))}function tt(e){return Xe(e).getComputedStyle(e)}function wn(e){return Ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(wt(e)==="html")return e;const n=e.assignedSlot||e.parentNode||oo(e)&&e.host||ct(e);return oo(n)?n.host:n}function ur(e){const n=_t(e);return gt(n)?e.ownerDocument?e.ownerDocument.body:e.body:Le(n)&&Yt(n)?n:ur(n)}function yt(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=ur(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Xe(r);if(i){const a=io(s);return n.concat(s,s.visualViewport||[],Yt(r)?r:[],a&&t?yt(a):[])}return n.concat(r,yt(r,[],t))}function io(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zt=Math.min,Ye=Math.max,yn=Math.round,Rt=Math.floor,ut=e=>({x:e,y:e}),Os={left:"right",right:"left",bottom:"top",top:"bottom"},Vs={start:"end",end:"start"};function dr(e,n,t){return Ye(e,zt(n,t))}function Zt(e,n){return typeof e=="function"?e(n):e}function Ct(e){return e.split("-")[0]}function Jt(e){return e.split("-")[1]}function fr(e){return e==="x"?"y":"x"}function gr(e){return e==="y"?"height":"width"}const Ls=new Set(["top","bottom"]);function pt(e){return Ls.has(Ct(e))?"y":"x"}function _r(e){return fr(pt(e))}function Ts(e,n,t){t===void 0&&(t=!1);const o=Jt(e),r=_r(e),i=gr(r);let s=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=Cn(s)),[s,Cn(s)]}function zs(e){const n=Cn(e);return[so(e),n,so(n)]}function so(e){return e.replace(/start|end/g,n=>Vs[n])}const pr=["left","right"],hr=["right","left"],Rs=["top","bottom"],qs=["bottom","top"];function js(e,n,t){switch(e){case"top":case"bottom":return t?n?hr:pr:n?pr:hr;case"left":case"right":return n?Rs:qs;default:return[]}}function Bs(e,n,t,o){const r=Jt(e);let i=js(Ct(e),t==="start",o);return r&&(i=i.map(s=>s+"-"+r),n&&(i=i.concat(i.map(so)))),i}function Cn(e){return e.replace(/left|right|bottom|top/g,n=>Os[n])}function Hs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gs(e){return typeof e!="number"?Hs(e):{top:e,right:e,bottom:e,left:e}}function Sn(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}/*!
|
|
2
2
|
* tabbable 6.3.0
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var Hs=["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])"],xn=Hs.join(","),hr=typeof Element>"u",qt=hr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$n=!hr&&Element.prototype.getRootNode?function(e){var n;return e==null||(n=e.getRootNode)===null||n===void 0?void 0:n.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Qt=function(n,t){var o;t===void 0&&(t=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=r===""||r==="true",s=i||t&&n&&Qt(n.parentNode);return s},Gs=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},mr=function(n,t,o){if(Qt(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(xn));return t&&qt.call(n,xn)&&r.unshift(n),r=r.filter(o),r},In=function(n,t,o){for(var r=[],i=Array.from(n);i.length;){var s=i.shift();if(!Qt(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),d=a.length?a:s.children,u=In(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else{var f=qt.call(s,xn);f&&o.filter(s)&&(t||!n.includes(s))&&r.push(s);var h=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),g=!Qt(h,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(h&&g){var c=In(h===!0?s.children:h.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else i.unshift.apply(i,s.children)}}return r},vr=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},br=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||Gs(n))&&!vr(n)?0:n.tabIndex},Ws=function(n,t){var o=br(n);return o<0&&t&&!vr(n)?0:o},Us=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},wr=function(n){return n.tagName==="INPUT"},Ks=function(n){return wr(n)&&n.type==="hidden"},Xs=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},Ys=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},Zs=function(n){if(!n.name)return!0;var t=n.form||$n(n),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(n.name));else try{r=o(n.name)}catch(s){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",s.message),!1}var i=Ys(r,n.form);return!i||i===n},Js=function(n){return wr(n)&&n.type==="radio"},Qs=function(n){return Js(n)&&!Zs(n)},ea=function(n){var t,o=n&&$n(n),r=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,a,d;for(i=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||n!=null&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(n));!i&&r;){var u,f,h;o=$n(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((f=r)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(r))}}return i},yr=function(n){var t=n.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},ta=function(n,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in n){var i=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(n).visibility==="hidden")return!0;var s=qt.call(n,"details>summary:first-of-type"),a=s?n.parentElement:n;if(qt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=n;n;){var u=n.parentElement,f=$n(n);if(u&&!u.shadowRoot&&r(u)===!0)return yr(n);n.assignedSlot?n=n.assignedSlot:!u&&f!==n.ownerDocument?n=f.host:n=u}n=d}if(ea(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return yr(n);return!1},na=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return qt.call(t,"fieldset[disabled] *")?!0:!r.contains(n)}return!0}t=t.parentElement}return!1},ao=function(n,t){return!(t.disabled||Qt(t)||Ks(t)||ta(t,n)||Xs(t)||na(t))},lo=function(n,t){return!(Qs(t)||br(t)<0||!ao(n,t))},oa=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Cr=function(n){var t=[],o=[];return n.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,d=Ws(a,s),u=s?Cr(r.candidates):a;d===0?s?t.push.apply(t,u):t.push(a):o.push({documentOrder:i,tabIndex:d,item:r,isScope:s,content:u})}),o.sort(Us).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(t)},En=function(n,t){t=t||{};var o;return t.getShadowRoot?o=In([n],t.includeContainer,{filter:lo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oa}):o=mr(n,t.includeContainer,lo.bind(null,t)),Cr(o)},ra=function(n,t){t=t||{};var o;return t.getShadowRoot?o=In([n],t.includeContainer,{filter:ao.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=mr(n,t.includeContainer,ao.bind(null,t)),o},Sr=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return qt.call(n,xn)===!1?!1:lo(t,n)};function ia(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function xr(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(n=>{let{brand:t,version:o}=n;return t+"/"+o}).join(" "):navigator.userAgent}function sa(){return/apple/i.test(navigator.vendor)}function co(){const e=/android/i;return e.test(ia())||e.test(xr())}function aa(){return xr().includes("jsdom/")}const $r="data-floating-ui-focusable",la="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",uo="ArrowLeft",fo="ArrowRight",ca="ArrowUp",ua="ArrowDown";function xt(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function We(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&oo(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function $t(e){return"composedPath"in e?e.composedPath()[0]:e.target}function go(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const t=e;return t.target!=null&&n.contains(t.target)}function da(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function Ir(e){return Ve(e)&&e.matches(la)}function _o(e){return e?e.getAttribute("role")==="combobox"&&Ir(e):!1}function kn(e){return e?e.hasAttribute($r)?e:e.querySelector("["+$r+"]")||e:null}function Ot(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ot(e,r.id,t)])}function fa(e,n){let t,o=-1;function r(i,s){s>o&&(t=i,o=s),Ot(e,i).forEach(d=>{r(d.id,s+1)})}return r(n,0),e.find(i=>i.id===t)}function Er(e,n){var t;let o=[],r=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i==null?void 0:i.parentId,i&&(o=o.concat(i))}return o}function ze(e){e.preventDefault(),e.stopPropagation()}function ga(e){return"nativeEvent"in e}function kr(e){return e.mozInputSource===0&&e.isTrusted?!0:co()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mr(e){return aa()?!1:!co()&&e.width===0&&e.height===0||co()&&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 Fr(e,n){return["mouse","pen"].includes(e)}var _a=typeof document<"u",pa=function(){},Ae=_a?v.useLayoutEffect:pa;const ha={...I};function Ue(e){const n=I.useRef(e);return Ae(()=>{n.current=e}),n}const ma=ha.useInsertionEffect||(e=>e());function Re(e){const n=I.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ma(()=>{n.current=e}),I.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}function Mn(e,n,t){return Math.floor(e/n)!==t}function en(e,n){return n<0||n>=e.current.length}function po(e,n){return qe(e,{disabledIndices:n})}function Ar(e,n){return qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function qe(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&Fn(e,s,r));return s}function va(e,n){let{event:t,orientation:o,loop:r,rtl:i,cols:s,disabledIndices:a,minIndex:d,maxIndex:u,prevIndex:f,stopEvent:h=!1}=n,g=f;if(t.key===ca){if(h&&ze(t),f===-1)g=u;else if(g=qe(e,{startingIndex:g,amount:s,decrement:!0,disabledIndices:a}),r&&(f-s<d||g<0)){const c=f%s,p=u%s,_=u-(p-c);p===c?g=u:g=p>c?_:_-s}en(e,g)&&(g=f)}if(t.key===ua&&(h&&ze(t),f===-1?g=d:(g=qe(e,{startingIndex:f,amount:s,disabledIndices:a}),r&&f+s>u&&(g=qe(e,{startingIndex:f%s-s,amount:s,disabledIndices:a}))),en(e,g)&&(g=f)),o==="both"){const c=Rt(f/s);t.key===(i?uo:fo)&&(h&&ze(t),f%s!==s-1?(g=qe(e,{startingIndex:f,disabledIndices:a}),r&&Mn(g,s,c)&&(g=qe(e,{startingIndex:f-f%s-1,disabledIndices:a}))):r&&(g=qe(e,{startingIndex:f-f%s-1,disabledIndices:a})),Mn(g,s,c)&&(g=f)),t.key===(i?fo:uo)&&(h&&ze(t),f%s!==0?(g=qe(e,{startingIndex:f,decrement:!0,disabledIndices:a}),r&&Mn(g,s,c)&&(g=qe(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a}))):r&&(g=qe(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a})),Mn(g,s,c)&&(g=f));const p=Rt(u/s)===c;en(e,g)&&(r&&p?g=t.key===(i?fo:uo)?u:qe(e,{startingIndex:f-f%s-1,disabledIndices:a}):g=f)}return g}function ba(e,n,t){const o=[];let r=0;return e.forEach((i,s)=>{let{width:a,height:d}=i;if(a>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let u=!1;for(t&&(r=0);!u;){const f=[];for(let h=0;h<a;h++)for(let g=0;g<d;g++)f.push(r+h+g*n);r%n+a<=n&&f.every(h=>o[h]==null)?(f.forEach(h=>{o[h]=s}),u=!0):r++}}),[...o]}function wa(e,n,t,o,r){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(r){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function ya(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function Fn(e,n,t){if(typeof t=="function")return t(n);if(t)return t.includes(n);const o=e.current[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Dr(e,n){const t=En(e,tn()),o=t.length;if(o===0)return;const r=xt(nt(e)),i=t.indexOf(r),s=i===-1?n===1?0:o-1:i+n;return t[s]}function Or(e){return Dr(nt(e).body,1)||e}function Pr(e){return Dr(nt(e).body,-1)||e}function nn(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!We(t,o)}function Ca(e){En(e,tn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Nr(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}function Lr(e,n,t){let{reference:o,floating:r}=e;const i=pt(n),s=gr(n),a=fr(s),d=St(n),u=i==="y",f=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,g=o[a]/2-r[a]/2;let c;switch(d){case"top":c={x:f,y:o.y-r.height};break;case"bottom":c={x:f,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:h};break;case"left":c={x:o.x-r.width,y:h};break;default:c={x:o.x,y:o.y}}switch(Jt(n)){case"start":c[s]-=g*(t&&u?-1:1);break;case"end":c[s]+=g*(t&&u?-1:1);break}return c}const Sa=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,a=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:r}),{x:f,y:h}=Lr(u,o,d),g=o,c={},p=0;for(let _=0;_<a.length;_++){const{name:m,fn:b}=a[_],{x:w,y:C,data:S,reset:x}=await b({x:f,y:h,initialPlacement:o,placement:g,strategy:r,middlewareData:c,rects:u,platform:s,elements:{reference:e,floating:n}});f=w??f,h=C??h,c={...c,[m]:{...c[m],...S}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(g=x.placement),x.rects&&(u=x.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:r}):x.rects),{x:f,y:h}=Lr(u,g,d)),_=-1)}return{x:f,y:h,placement:g,strategy:r,middlewareData:c}};async function ho(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:c=0}=Zt(n,e),p=Bs(c),m=a[g?h==="floating"?"reference":"floating":h],b=Sn(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(m)))==null||t?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:d})),w=h==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},x=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:C,strategy:d}):w);return{top:(b.top-x.top+p.top)/S.y,bottom:(x.bottom-b.bottom+p.bottom)/S.y,left:(b.left-x.left+p.left)/S.x,right:(x.right-b.right+p.right)/S.x}}const xa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:d,elements:u}=n,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:_=!0,...m}=Zt(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const b=St(r),w=pt(a),C=St(a)===a,S=await(d.isRTL==null?void 0:d.isRTL(u.floating)),x=g||(C||!_?[Cn(a)]:Vs(a)),y=p!=="none";!g&&y&&x.push(...qs(a,_,p,S));const M=[a,...x],E=await ho(n,m),T=[];let F=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&T.push(E[b]),h){const k=Ls(r,s,S);T.push(E[k[0]],E[k[1]])}if(F=[...F,{placement:r,overflows:T}],!T.every(k=>k<=0)){var P,U;const k=(((P=i.flip)==null?void 0:P.index)||0)+1,A=M[k];if(A&&(!(h==="alignment"?w!==pt(A):!1)||F.every($=>pt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:k,overflows:F},reset:{placement:A}};let O=(U=F.filter(D=>D.overflows[0]<=0).sort((D,$)=>D.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!O)switch(c){case"bestFit":{var z;const D=(z=F.filter($=>{if(y){const N=pt($.placement);return N===w||N==="y"}return!0}).map($=>[$.placement,$.overflows.filter(N=>N>0).reduce((N,j)=>N+j,0)]).sort(($,N)=>$[1]-N[1])[0])==null?void 0:z[0];D&&(O=D);break}case"initialPlacement":O=a;break}if(r!==O)return{reset:{placement:O}}}return{}}}},$a=new Set(["left","top"]);async function Ia(e,n){const{placement:t,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=St(t),a=Jt(t),d=pt(t)==="y",u=$a.has(s)?-1:1,f=i&&d?-1:1,h=Zt(n,e);let{mainAxis:g,crossAxis:c,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(c=a==="end"?p*-1:p),d?{x:c*f,y:g*u}:{x:g*u,y:c*f}}const Ea=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:r,y:i,placement:s,middlewareData:a}=n,d=await Ia(n,e);return s===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:s}}}}},ka=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...d}=Zt(e,n),u={x:t,y:o},f=await ho(n,d),h=pt(St(r)),g=dr(h);let c=u[g],p=u[h];if(i){const m=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=c+f[m],C=c-f[b];c=ur(w,c,C)}if(s){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=p+f[m],C=p-f[b];p=ur(w,p,C)}const _=a.fn({...n,[g]:c,[h]:p});return{..._,data:{x:_.x-t,y:_.y-o,enabled:{[g]:i,[h]:s}}}}}},Ma=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:r,rects:i,platform:s,elements:a}=n,{apply:d=()=>{},...u}=Zt(e,n),f=await ho(n,u),h=St(r),g=Jt(r),c=pt(r)==="y",{width:p,height:_}=i.floating;let m,b;h==="top"||h==="bottom"?(m=h,b=g===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=h,m=g==="end"?"top":"bottom");const w=_-f.top-f.bottom,C=p-f.left-f.right,S=zt(_-f[m],w),x=zt(p-f[b],C),y=!n.middlewareData.shift;let M=S,E=x;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(E=C),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(M=w),y&&!g){const F=Ye(f.left,0),P=Ye(f.right,0),U=Ye(f.top,0),z=Ye(f.bottom,0);c?E=p-2*(F!==0||P!==0?F+P:Ye(f.left,f.right)):M=_-2*(U!==0||z!==0?U+z:Ye(f.top,f.bottom))}await d({...n,availableWidth:E,availableHeight:M});const T=await s.getDimensions(a.floating);return p!==T.width||_!==T.height?{reset:{rects:!0}}:{}}}};function Vr(e){const n=tt(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=Ve(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:o,a=yn(t)!==i||yn(o)!==s;return a&&(t=i,o=s),{width:t,height:o,$:a}}function mo(e){return De(e)?e:e.contextElement}function jt(e){const n=mo(e);if(!Ve(n))return ut(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=Vr(n);let s=(i?yn(t.width):t.width)/o,a=(i?yn(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Fa=ut(0);function Tr(e){const n=Xe(e);return!bn()||!n.visualViewport?Fa:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Aa(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==Xe(e)?!1:n}function Pt(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=mo(e);let s=ut(1);n&&(o?De(o)&&(s=jt(o)):s=jt(e));const a=Aa(i,t,o)?Tr(i):ut(0);let d=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,f=r.width/s.x,h=r.height/s.y;if(i){const g=Xe(i),c=o&&De(o)?Xe(o):o;let p=g,_=io(p);for(;_&&o&&c!==p;){const m=jt(_),b=_.getBoundingClientRect(),w=tt(_),C=b.left+(_.clientLeft+parseFloat(w.paddingLeft))*m.x,S=b.top+(_.clientTop+parseFloat(w.paddingTop))*m.y;d*=m.x,u*=m.y,f*=m.x,h*=m.y,d+=C,u+=S,p=Xe(_),_=io(p)}}return Sn({width:f,height:h,x:d,y:u})}function An(e,n){const t=wn(e).scrollLeft;return n?n.left+t:Pt(ct(e)).left+t}function zr(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-An(e,t),r=t.top+n.scrollTop;return{x:o,y:r}}function Da(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=ct(o),a=n?vn(n.floating):!1;if(o===s||a&&i)return t;let d={scrollLeft:0,scrollTop:0},u=ut(1);const f=ut(0),h=Ve(o);if((h||!h&&!i)&&((yt(o)!=="body"||Yt(s))&&(d=wn(o)),Ve(o))){const c=Pt(o);u=jt(o),f.x=c.x+o.clientLeft,f.y=c.y+o.clientTop}const g=s&&!h&&!i?zr(s,d):ut(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-d.scrollLeft*u.x+f.x+g.x,y:t.y*u.y-d.scrollTop*u.y+f.y+g.y}}function Oa(e){return Array.from(e.getClientRects())}function Pa(e){const n=ct(e),t=wn(e),o=e.ownerDocument.body,r=Ye(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=Ye(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+An(e);const a=-t.scrollTop;return tt(o).direction==="rtl"&&(s+=Ye(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const Rr=25;function Na(e,n){const t=Xe(e),o=ct(e),r=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,d=0;if(r){i=r.width,s=r.height;const f=bn();(!f||f&&n==="fixed")&&(a=r.offsetLeft,d=r.offsetTop)}const u=An(o);if(u<=0){const f=o.ownerDocument,h=f.body,g=getComputedStyle(h),c=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(o.clientWidth-h.clientWidth-c);p<=Rr&&(i-=p)}else u<=Rr&&(i+=u);return{width:i,height:s,x:a,y:d}}const La=new Set(["absolute","fixed"]);function Va(e,n){const t=Pt(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=Ve(e)?jt(e):ut(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:s,height:a,x:d,y:u}}function qr(e,n,t){let o;if(n==="viewport")o=Na(e,t);else if(n==="document")o=Pa(ct(e));else if(De(n))o=Va(n,t);else{const r=Tr(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Sn(o)}function jr(e,n){const t=_t(e);return t===n||!De(t)||gt(t)?!1:tt(t).position==="fixed"||jr(t,n)}function Ta(e,n){const t=n.get(e);if(t)return t;let o=Ct(e,[],!1).filter(a=>De(a)&&yt(a)!=="body"),r=null;const i=tt(e).position==="fixed";let s=i?_t(e):e;for(;De(s)&&!gt(s);){const a=tt(s),d=ro(s);!d&&a.position==="fixed"&&(r=null),(i?!d&&!r:!d&&a.position==="static"&&!!r&&La.has(r.position)||Yt(s)&&!d&&jr(e,s))?o=o.filter(f=>f!==s):r=a,s=_t(s)}return n.set(e,o),o}function za(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const s=[...t==="clippingAncestors"?vn(n)?[]:Ta(n,this._c):[].concat(t),o],a=s[0],d=s.reduce((u,f)=>{const h=qr(n,f,r);return u.top=Ye(h.top,u.top),u.right=zt(h.right,u.right),u.bottom=zt(h.bottom,u.bottom),u.left=Ye(h.left,u.left),u},qr(n,a,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ra(e){const{width:n,height:t}=Vr(e);return{width:n,height:t}}function qa(e,n,t){const o=Ve(n),r=ct(n),i=t==="fixed",s=Pt(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const d=ut(0);function u(){d.x=An(r)}if(o||!o&&!i)if((yt(n)!=="body"||Yt(r))&&(a=wn(n)),o){const c=Pt(n,!0,i,n);d.x=c.x+n.clientLeft,d.y=c.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?zr(r,a):ut(0),h=s.left+a.scrollLeft-d.x-f.x,g=s.top+a.scrollTop-d.y-f.y;return{x:h,y:g,width:s.width,height:s.height}}function vo(e){return tt(e).position==="static"}function Br(e,n){if(!Ve(e)||tt(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return ct(e)===t&&(t=t.ownerDocument.body),t}function Hr(e,n){const t=Xe(e);if(vn(e))return t;if(!Ve(e)){let r=_t(e);for(;r&&!gt(r);){if(De(r)&&!vo(r))return r;r=_t(r)}return t}let o=Br(e,n);for(;o&&Is(o)&&vo(o);)o=Br(o,n);return o&>(o)&&vo(o)&&!ro(o)?t:o||As(e)||t}const ja=async function(e){const n=this.getOffsetParent||Hr,t=this.getDimensions,o=await t(e.floating);return{reference:qa(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ba(e){return tt(e).direction==="rtl"}const Ha={convertOffsetParentRelativeRectToViewportRelativeRect:Da,getDocumentElement:ct,getClippingRect:za,getOffsetParent:Hr,getElementRects:ja,getClientRects:Oa,getDimensions:Ra,getScale:jt,isElement:De,isRTL:Ba};function Gr(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Ga(e,n){let t=null,o;const r=ct(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function s(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:h,width:g,height:c}=u;if(a||n(),!g||!c)return;const p=Rt(h),_=Rt(r.clientWidth-(f+g)),m=Rt(r.clientHeight-(h+c)),b=Rt(f),C={rootMargin:-p+"px "+-_+"px "+-m+"px "+-b+"px",threshold:Ye(0,zt(1,d))||1};let S=!0;function x(y){const M=y[0].intersectionRatio;if(M!==d){if(!S)return s();M?s(!1,M):o=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!Gr(u,e.getBoundingClientRect())&&s(),S=!1}try{t=new IntersectionObserver(x,{...C,root:r.ownerDocument})}catch{t=new IntersectionObserver(x,C)}t.observe(e)}return s(!0),i}function Wa(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=mo(e),f=r||i?[...u?Ct(u):[],...Ct(n)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",t,{passive:!0}),i&&b.addEventListener("resize",t)});const h=u&&a?Ga(u,t):null;let g=-1,c=null;s&&(c=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&c&&(c.unobserve(n),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=c)==null||C.observe(n)})),t()}),u&&!d&&c.observe(u),c.observe(n));let p,_=d?Pt(e):null;d&&m();function m(){const b=Pt(e);_&&!Gr(_,b)&&t(),_=b,p=requestAnimationFrame(m)}return t(),()=>{var b;f.forEach(w=>{r&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),h==null||h(),(b=c)==null||b.disconnect(),c=null,d&&cancelAnimationFrame(p)}}const Ua=Ea,Ka=ka,Xa=xa,Ya=Ma,Za=(e,n,t)=>{const o=new Map,r={platform:Ha,...t},i={...r.platform,_c:o};return Sa(e,n,{...r,platform:i})};var Ja=typeof document<"u",Qa=function(){},Dn=Ja?v.useLayoutEffect:Qa;function On(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(o=t;o--!==0;)if(!On(e[o],n[o]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=t;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!On(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Wr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ur(e,n){const t=Wr(e);return Math.round(n*t)/t}function bo(e){const n=I.useRef(e);return Dn(()=>{n.current=e}),n}function el(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:d,open:u}=e,[f,h]=I.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[g,c]=I.useState(o);On(g,o)||c(o);const[p,_]=I.useState(null),[m,b]=I.useState(null),w=I.useCallback($=>{$!==y.current&&(y.current=$,_($))},[]),C=I.useCallback($=>{$!==M.current&&(M.current=$,b($))},[]),S=i||p,x=s||m,y=I.useRef(null),M=I.useRef(null),E=I.useRef(f),T=d!=null,F=bo(d),P=bo(r),U=bo(u),z=I.useCallback(()=>{if(!y.current||!M.current)return;const $={placement:n,strategy:t,middleware:g};P.current&&($.platform=P.current),Za(y.current,M.current,$).then(N=>{const j={...N,isPositioned:U.current!==!1};k.current&&!On(E.current,j)&&(E.current=j,Jn.flushSync(()=>{h(j)}))})},[g,n,t,P,U]);Dn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const k=I.useRef(!1);Dn(()=>(k.current=!0,()=>{k.current=!1}),[]),Dn(()=>{if(S&&(y.current=S),x&&(M.current=x),S&&x){if(F.current)return F.current(S,x,z);z()}},[S,x,z,F,T]);const A=I.useMemo(()=>({reference:y,floating:M,setReference:w,setFloating:C}),[w,C]),O=I.useMemo(()=>({reference:S,floating:x}),[S,x]),D=I.useMemo(()=>{const $={position:t,left:0,top:0};if(!O.floating)return $;const N=Ur(O.floating,f.x),j=Ur(O.floating,f.y);return a?{...$,transform:"translate("+N+"px, "+j+"px)",...Wr(O.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:N,top:j}},[t,a,O.floating,f.x,f.y]);return I.useMemo(()=>({...f,update:z,refs:A,elements:O,floatingStyles:D}),[f,z,A,O,D])}const tl=(e,n)=>({...Ua(e),options:[e,n]}),nl=(e,n)=>({...Ka(e),options:[e,n]}),ol=(e,n)=>({...Xa(e),options:[e,n]}),rl=(e,n)=>({...Ya(e),options:[e,n]}),il="data-floating-ui-focusable",Kr="active",Xr="selected",on="ArrowLeft",rn="ArrowRight",Yr="ArrowUp",Pn="ArrowDown",sl={...I};let Zr=!1,al=0;const Jr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+al++;function ll(){const[e,n]=I.useState(()=>Zr?Jr():void 0);return Ae(()=>{e==null&&n(Jr())},[]),I.useEffect(()=>{Zr=!0},[]),e}const wo=sl.useId||ll;let sn;process.env.NODE_ENV!=="production"&&(sn=new Set);function yo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=sn)!=null&&e.has(r))){var i;(i=sn)==null||i.add(r),console.warn(r)}}function cl(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=sn)!=null&&e.has(r))){var i;(i=sn)==null||i.add(r),console.error(r)}}function ul(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(r=>r(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var o;(o=e.get(n))==null||o.delete(t)}}}const dl=I.createContext(null),fl=I.createContext(null),Co=()=>{var e;return((e=I.useContext(dl))==null?void 0:e.id)||null},Nn=()=>I.useContext(fl);function an(e){return"data-floating-ui-"+e}function So(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let Qr=0;function Nt(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(Qr);const i=()=>e==null?void 0:e.focus({preventScroll:t});r?i():Qr=requestAnimationFrame(i)}function gl(e){return(e==null?void 0:e.ownerDocument)||document}const Bt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ei(e){return e==="inert"?Bt.inert:e==="aria-hidden"?Bt["aria-hidden"]:Bt.none}let Ln=new WeakSet,Vn={},xo=0;const _l=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ti=e=>e&&(e.host||ti(e.parentNode)),pl=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=ti(t);return e.contains(o)?o:null}).filter(t=>t!=null);function hl(e,n,t,o){const r="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=pl(n,e),a=new Set,d=new Set(s),u=[];Vn[r]||(Vn[r]=new WeakMap);const f=Vn[r];s.forEach(h),g(n),a.clear();function h(c){!c||a.has(c)||(a.add(c),c.parentNode&&h(c.parentNode))}function g(c){!c||d.has(c)||[].forEach.call(c.children,p=>{if(yt(p)!=="script")if(a.has(p))g(p);else{const _=i?p.getAttribute(i):null,m=_!==null&&_!=="false",b=ei(i),w=(b.get(p)||0)+1,C=(f.get(p)||0)+1;b.set(p,w),f.set(p,C),u.push(p),w===1&&m&&Ln.add(p),C===1&&p.setAttribute(r,""),!m&&i&&p.setAttribute(i,i==="inert"?"":"true")}})}return xo++,()=>{u.forEach(c=>{const p=ei(i),m=(p.get(c)||0)-1,b=(f.get(c)||0)-1;p.set(c,m),f.set(c,b),m||(!Ln.has(c)&&i&&c.removeAttribute(i),Ln.delete(c)),b||c.removeAttribute(r)}),xo--,xo||(Bt.inert=new WeakMap,Bt["aria-hidden"]=new WeakMap,Bt.none=new WeakMap,Ln=new WeakSet,Vn={})}}function ni(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=gl(e[0]).body;return hl(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const Tn={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=I.forwardRef(function(n,t){const[o,r]=I.useState();Ae(()=>{sa()&&r("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[an("focus-guard")]:"",style:Tn};return l.jsx("span",{...n,...i})}),oi=I.createContext(null),ri=an("portal");function ml(e){e===void 0&&(e={});const{id:n,root:t}=e,o=wo(),r=ii(),[i,s]=I.useState(null),a=I.useRef(null);return Ae(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),Ae(()=>{if(!o||a.current)return;const d=n?document.getElementById(n):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(ri,""),d.appendChild(u),a.current=u,s(u)},[n,o]),Ae(()=>{if(t===null||!o||a.current)return;let d=t||(r==null?void 0:r.portalNode);d&&!no(d)&&(d=d.current),d=d||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,d.appendChild(u));const f=document.createElement("div");f.id=o,f.setAttribute(ri,""),d=u||d,d.appendChild(f),a.current=f,s(f)},[n,t,o,r]),i}function vl(e){const{children:n,id:t,root:o,preserveTabOrder:r=!0}=e,i=ml({id:t,root:o}),[s,a]=I.useState(null),d=I.useRef(null),u=I.useRef(null),f=I.useRef(null),h=I.useRef(null),g=s==null?void 0:s.modal,c=s==null?void 0:s.open,p=!!s&&!s.modal&&s.open&&r&&!!(o||i);return I.useEffect(()=>{if(!i||!r||g)return;function _(m){i&&nn(m)&&(m.type==="focusin"?Nr:Ca)(i)}return i.addEventListener("focusin",_,!0),i.addEventListener("focusout",_,!0),()=>{i.removeEventListener("focusin",_,!0),i.removeEventListener("focusout",_,!0)}},[i,r,g]),I.useEffect(()=>{i&&(c||Nr(i))},[c,i]),l.jsxs(oi.Provider,{value:I.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:h,portalNode:i,setFocusManagerState:a}),[r,i]),children:[p&&i&&l.jsx(zn,{"data-type":"outside",ref:d,onFocus:_=>{if(nn(_,i)){var m;(m=f.current)==null||m.focus()}else{const b=s?s.domReference:null,w=Pr(b);w==null||w.focus()}}}),p&&i&&l.jsx("span",{"aria-owns":i.id,style:Tn}),i&&Jn.createPortal(n,i),p&&i&&l.jsx(zn,{"data-type":"outside",ref:u,onFocus:_=>{if(nn(_,i)){var m;(m=h.current)==null||m.focus()}else{const b=s?s.domReference:null,w=Or(b);w==null||w.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,_.nativeEvent,"focus-out"))}}})]})}const ii=()=>I.useContext(oi);function si(e){return I.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const bl=20;let It=[];function $o(){It=It.filter(e=>e.isConnected)}function wl(e){$o(),e&&yt(e)!=="body"&&(It.push(e),It.length>bl&&(It=It.slice(-20)))}function ai(){return $o(),It[It.length-1]}function yl(e){const n=tn();return Sr(e,n)?e:En(e,n)[0]||e}function li(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=tn(),i=ra(e,o).filter(a=>{const d=a.getAttribute("data-tabindex")||"";return Sr(a,o)||a.hasAttribute("data-tabindex")&&!d.startsWith("-")}),s=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Cl=I.forwardRef(function(n,t){return l.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:Tn})});function Sl(e){const{context:n,children:t,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:h=!0,outsideElementsInert:g=!1,getInsideElements:c=()=>[]}=e,{open:p,onOpenChange:_,events:m,dataRef:b,elements:{domReference:w,floating:C}}=n,S=Re(()=>{var K;return(K=b.current.floatingContext)==null?void 0:K.nodeId}),x=Re(c),y=typeof s=="number"&&s<0,M=_o(w)&&y,E=_l(),T=E?i:!0,F=!T||E&&g,P=Ue(r),U=Ue(s),z=Ue(a),k=Nn(),A=ii(),O=I.useRef(null),D=I.useRef(null),$=I.useRef(!1),N=I.useRef(!1),j=I.useRef(-1),_e=I.useRef(-1),fe=A!=null,L=kn(C),re=Re(function(K){return K===void 0&&(K=L),K?En(K,tn()):[]}),Z=Re(K=>{const J=re(K);return P.current.map(X=>w&&X==="reference"?w:L&&X==="floating"?L:J).filter(Boolean).flat()});I.useEffect(()=>{if(o||!u)return;function K(X){if(X.key==="Tab"){We(L,xt(nt(L)))&&re().length===0&&!M&&ze(X);const Y=Z(),oe=$t(X);P.current[0]==="reference"&&oe===w&&(ze(X),X.shiftKey?Nt(Y[Y.length-1]):Nt(Y[1])),P.current[1]==="floating"&&oe===L&&X.shiftKey&&(ze(X),Nt(Y[0]))}}const J=nt(L);return J.addEventListener("keydown",K),()=>{J.removeEventListener("keydown",K)}},[o,w,L,u,P,M,re,Z]),I.useEffect(()=>{if(o||!C)return;function K(J){const X=$t(J),oe=re().indexOf(X);oe!==-1&&(j.current=oe)}return C.addEventListener("focusin",K),()=>{C.removeEventListener("focusin",K)}},[o,C,re]),I.useEffect(()=>{if(o||!h)return;function K(){N.current=!0,setTimeout(()=>{N.current=!1})}function J(oe){const te=oe.relatedTarget,se=oe.currentTarget,de=$t(oe);queueMicrotask(()=>{const me=S(),$e=!(We(w,te)||We(C,te)||We(te,C)||We(A==null?void 0:A.portalNode,te)||te!=null&&te.hasAttribute(an("focus-guard"))||k&&(Ot(k.nodesRef.current,me).find(R=>{var ne,V;return We((ne=R.context)==null?void 0:ne.elements.floating,te)||We((V=R.context)==null?void 0:V.elements.domReference,te)})||Er(k.nodesRef.current,me).find(R=>{var ne,V,ae;return[(ne=R.context)==null?void 0:ne.elements.floating,kn((V=R.context)==null?void 0:V.elements.floating)].includes(te)||((ae=R.context)==null?void 0:ae.elements.domReference)===te})));if(se===w&&L&&li(L,P),d&&se!==w&&!(de!=null&&de.isConnected)&&xt(nt(L))===nt(L).body){Ve(L)&&L.focus();const R=j.current,ne=re(),V=ne[R]||ne[ne.length-1]||L;Ve(V)&&V.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(M||!u)&&te&&$e&&!N.current&&te!==ai()&&($.current=!0,_(!1,oe,"focus-out"))})}const X=!!(!k&&A);function Y(){So(_e),b.current.insideReactTree=!0,_e.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(C&&Ve(w))return w.addEventListener("focusout",J),w.addEventListener("pointerdown",K),C.addEventListener("focusout",J),X&&C.addEventListener("focusout",Y,!0),()=>{w.removeEventListener("focusout",J),w.removeEventListener("pointerdown",K),C.removeEventListener("focusout",J),X&&C.removeEventListener("focusout",Y,!0)}},[o,w,C,L,u,k,A,_,h,d,re,M,S,P,b]);const ue=I.useRef(null),we=I.useRef(null),ye=si([ue,A==null?void 0:A.beforeInsideRef]),B=si([we,A==null?void 0:A.afterInsideRef]);I.useEffect(()=>{var K,J;if(o||!C)return;const X=Array.from((A==null||(K=A.portalNode)==null?void 0:K.querySelectorAll("["+an("portal")+"]"))||[]),oe=(J=(k?Er(k.nodesRef.current,S()):[]).find(de=>{var me;return _o(((me=de.context)==null?void 0:me.elements.domReference)||null)}))==null||(J=J.context)==null?void 0:J.elements.domReference,te=[C,oe,...X,...x(),O.current,D.current,ue.current,we.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,P.current.includes("reference")||M?w:null].filter(de=>de!=null),se=u||M?ni(te,!F,F):ni(te);return()=>{se()}},[o,w,C,u,P,A,M,T,F,k,S,x]),Ae(()=>{if(o||!Ve(L))return;const K=nt(L),J=xt(K);queueMicrotask(()=>{const X=Z(L),Y=U.current,oe=(typeof Y=="number"?X[Y]:Y.current)||L,te=We(L,J);!y&&!te&&p&&Nt(oe,{preventScroll:oe===L})})},[o,p,L,y,Z,U]),Ae(()=>{if(o||!L)return;const K=nt(L),J=xt(K);wl(J);function X(te){let{reason:se,event:de,nested:me}=te;if(["hover","safe-polygon"].includes(se)&&de.type==="mouseleave"&&($.current=!0),se==="outside-press")if(me)$.current=!1;else if(kr(de)||Mr(de))$.current=!1;else{let $e=!1;document.createElement("div").focus({get preventScroll(){return $e=!0,!1}}),$e?$.current=!1:$.current=!0}}m.on("openchange",X);const Y=K.createElement("span");Y.setAttribute("tabindex","-1"),Y.setAttribute("aria-hidden","true"),Object.assign(Y.style,Tn),fe&&w&&w.insertAdjacentElement("afterend",Y);function oe(){if(typeof z.current=="boolean"){const te=w||ai();return te&&te.isConnected?te:Y}return z.current.current||Y}return()=>{m.off("openchange",X);const te=xt(K),se=We(C,te)||k&&Ot(k.nodesRef.current,S(),!1).some(me=>{var $e;return We(($e=me.context)==null?void 0:$e.elements.floating,te)}),de=oe();queueMicrotask(()=>{const me=yl(de);z.current&&!$.current&&Ve(me)&&(!(me!==te&&te!==K.body)||se)&&me.focus({preventScroll:!0}),Y.remove()})}},[o,C,L,z,b,m,k,fe,w,S]),I.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask($o)}),[o]),Ae(()=>{if(!o&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:h,open:p,onOpenChange:_,domReference:w}),()=>{A.setFocusManagerState(null)}},[o,A,u,p,_,h,w]),Ae(()=>{o||L&&li(L,P)},[o,L,P]);function pe(K){return o||!f||!u?null:l.jsx(Cl,{ref:K==="start"?O:D,onClick:J=>_(!1,J.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const Ee=!o&&T&&(u?!M:!0)&&(fe||u);return l.jsxs(l.Fragment,{children:[Ee&&l.jsx(zn,{"data-type":"inside",ref:ye,onFocus:K=>{if(u){const X=Z();Nt(r[0]==="reference"?X[0]:X[X.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if($.current=!1,nn(K,A.portalNode)){const X=Or(w);X==null||X.focus()}else{var J;(J=A.beforeOutsideRef.current)==null||J.focus()}}}),!M&&pe("start"),t,pe("end"),Ee&&l.jsx(zn,{"data-type":"inside",ref:B,onFocus:K=>{if(u)Nt(Z()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(h&&($.current=!0),nn(K,A.portalNode)){const X=Pr(w);X==null||X.focus()}else{var J;(J=A.afterOutsideRef.current)==null||J.focus()}}})]})}function ci(e){return Ve(e.target)&&e.target.tagName==="BUTTON"}function xl(e){return Ve(e.target)&&e.target.tagName==="A"}function ui(e){return Ir(e)}function $l(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:h=!0}=n,g=I.useRef(),c=I.useRef(!1),p=I.useMemo(()=>({onPointerDown(_){g.current=_.pointerType},onMouseDown(_){const m=g.current;_.button===0&&a!=="click"&&(Fr(m)&&u||(t&&d&&(!(r.current.openEvent&&h)||r.current.openEvent.type==="mousedown")?o(!1,_.nativeEvent,"click"):(_.preventDefault(),o(!0,_.nativeEvent,"click"))))},onClick(_){const m=g.current;if(a==="mousedown"&&g.current){g.current=void 0;return}Fr(m)&&u||(t&&d&&(!(r.current.openEvent&&h)||r.current.openEvent.type==="click")?o(!1,_.nativeEvent,"click"):o(!0,_.nativeEvent,"click"))},onKeyDown(_){g.current=void 0,!(_.defaultPrevented||!f||ci(_))&&(_.key===" "&&!ui(i)&&(_.preventDefault(),c.current=!0),!xl(_)&&_.key==="Enter"&&o(!(t&&d),_.nativeEvent,"click"))},onKeyUp(_){_.defaultPrevented||!f||ci(_)||ui(i)||_.key===" "&&c.current&&(c.current=!1,o(!(t&&d),_.nativeEvent,"click"))}}),[r,i,a,u,f,o,t,h,d]);return I.useMemo(()=>s?{reference:p}:{},[s,p])}const Il={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},El={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},di=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e==null?void 0:e.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e==null?void 0:e.outsidePress)!=null?t:!0}};function kl(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:h="pointerdown",ancestorScroll:g=!1,bubbles:c,capture:p}=n,_=Nn(),m=Re(typeof d=="function"?d:()=>!1),b=typeof d=="function"?m:d,w=I.useRef(!1),{escapeKey:C,outsidePress:S}=di(c),{escapeKey:x,outsidePress:y}=di(p),M=I.useRef(!1),E=Re(k=>{var A;if(!t||!s||!a||k.key!=="Escape"||M.current)return;const O=(A=i.current.floatingContext)==null?void 0:A.nodeId,D=_?Ot(_.nodesRef.current,O):[];if(!C&&(k.stopPropagation(),D.length>0)){let $=!0;if(D.forEach(N=>{var j;if((j=N.context)!=null&&j.open&&!N.context.dataRef.current.__escapeKeyBubbles){$=!1;return}}),!$)return}o(!1,ga(k)?k.nativeEvent:k,"escape-key")}),T=Re(k=>{var A;const O=()=>{var D;E(k),(D=$t(k))==null||D.removeEventListener("keydown",O)};(A=$t(k))==null||A.addEventListener("keydown",O)}),F=Re(k=>{var A;const O=i.current.insideReactTree;i.current.insideReactTree=!1;const D=w.current;if(w.current=!1,u==="click"&&D||O||typeof b=="function"&&!b(k))return;const $=$t(k),N="["+an("inert")+"]",j=nt(r.floating).querySelectorAll(N);let _e=De($)?$:null;for(;_e&&!gt(_e);){const Z=_t(_e);if(gt(Z)||!De(Z))break;_e=Z}if(j.length&&De($)&&!da($)&&!We($,r.floating)&&Array.from(j).every(Z=>!We(_e,Z)))return;if(Ve($)&&z){const Z=gt($),ue=tt($),we=/auto|scroll/,ye=Z||we.test(ue.overflowX),B=Z||we.test(ue.overflowY),pe=ye&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Ee=B&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,K=ue.direction==="rtl",J=Ee&&(K?k.offsetX<=$.offsetWidth-$.clientWidth:k.offsetX>$.clientWidth),X=pe&&k.offsetY>$.clientHeight;if(J||X)return}const fe=(A=i.current.floatingContext)==null?void 0:A.nodeId,L=_&&Ot(_.nodesRef.current,fe).some(Z=>{var ue;return go(k,(ue=Z.context)==null?void 0:ue.elements.floating)});if(go(k,r.floating)||go(k,r.domReference)||L)return;const re=_?Ot(_.nodesRef.current,fe):[];if(re.length>0){let Z=!0;if(re.forEach(ue=>{var we;if((we=ue.context)!=null&&we.open&&!ue.context.dataRef.current.__outsidePressBubbles){Z=!1;return}}),!Z)return}o(!1,k,"outside-press")}),P=Re(k=>{var A;const O=()=>{var D;F(k),(D=$t(k))==null||D.removeEventListener(u,O)};(A=$t(k))==null||A.addEventListener(u,O)});I.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=S;let k=-1;function A(j){o(!1,j,"ancestor-scroll")}function O(){window.clearTimeout(k),M.current=!0}function D(){k=window.setTimeout(()=>{M.current=!1},bn()?5:0)}const $=nt(r.floating);a&&($.addEventListener("keydown",x?T:E,x),$.addEventListener("compositionstart",O),$.addEventListener("compositionend",D)),b&&$.addEventListener(u,y?P:F,y);let N=[];return g&&(De(r.domReference)&&(N=Ct(r.domReference)),De(r.floating)&&(N=N.concat(Ct(r.floating))),!De(r.reference)&&r.reference&&r.reference.contextElement&&(N=N.concat(Ct(r.reference.contextElement)))),N=N.filter(j=>{var _e;return j!==((_e=$.defaultView)==null?void 0:_e.visualViewport)}),N.forEach(j=>{j.addEventListener("scroll",A,{passive:!0})}),()=>{a&&($.removeEventListener("keydown",x?T:E,x),$.removeEventListener("compositionstart",O),$.removeEventListener("compositionend",D)),b&&$.removeEventListener(u,y?P:F,y),N.forEach(j=>{j.removeEventListener("scroll",A)}),window.clearTimeout(k)}},[i,r,a,b,u,t,o,g,s,C,S,E,x,T,F,y,P]),I.useEffect(()=>{i.current.insideReactTree=!1},[i,b,u]);const U=I.useMemo(()=>({onKeyDown:E,...f&&{[Il[h]]:k=>{o(!1,k.nativeEvent,"reference-press")},...h!=="click"&&{onClick(k){o(!1,k.nativeEvent,"reference-press")}}}}),[E,o,f,h]),z=I.useMemo(()=>({onKeyDown:E,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[El[u]]:()=>{i.current.insideReactTree=!0}}),[E,u,i]);return I.useMemo(()=>s?{reference:U,floating:z}:{},[s,U,z])}function Ml(e){const{open:n=!1,onOpenChange:t,elements:o}=e,r=wo(),i=I.useRef({}),[s]=I.useState(()=>ul()),a=Co()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!De(c)&&cl("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=I.useState(o.reference),f=Re((c,p,_)=>{i.current.openEvent=c?p:void 0,s.emit("openchange",{open:c,event:p,reason:_,nested:a}),t==null||t(c,p,_)}),h=I.useMemo(()=>({setPositionReference:u}),[]),g=I.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return I.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:g,events:s,floatingId:r,refs:h}),[n,f,g,s,r,h])}function Fl(e){e===void 0&&(e={});const{nodeId:n}=e,t=Ml({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,r=o.elements,[i,s]=I.useState(null),[a,d]=I.useState(null),f=(r==null?void 0:r.domReference)||i,h=I.useRef(null),g=Nn();Ae(()=>{f&&(h.current=f)},[f]);const c=el({...e,elements:{...r,...a&&{reference:a}}}),p=I.useCallback(C=>{const S=De(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;d(S),c.refs.setReference(S)},[c.refs]),_=I.useCallback(C=>{(De(C)||C===null)&&(h.current=C,s(C)),(De(c.refs.reference.current)||c.refs.reference.current===null||C!==null&&!De(C))&&c.refs.setReference(C)},[c.refs]),m=I.useMemo(()=>({...c.refs,setReference:_,setPositionReference:p,domReference:h}),[c.refs,_,p]),b=I.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),w=I.useMemo(()=>({...c,...o,refs:m,elements:b,nodeId:n}),[c,m,b,n,o]);return Ae(()=>{o.dataRef.current.floatingContext=w;const C=g==null?void 0:g.nodesRef.current.find(S=>S.id===n);C&&(C.context=w)}),I.useMemo(()=>({...c,context:w,refs:m,elements:b}),[c,m,b,w])}function Io(e,n,t){const o=new Map,r=t==="item";let i=e;if(r&&e){const{[Kr]:s,[Xr]:a,...d}=e;i=d}return{...t==="floating"&&{tabIndex:-1,[il]:""},...i,...n.map(s=>{const a=s?s[t]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(d=>{let[u,f]=d;if(!(r&&[Kr,Xr].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof f=="function"){var h;(h=o.get(u))==null||h.push(f),s[u]=function(){for(var g,c=arguments.length,p=new Array(c),_=0;_<c;_++)p[_]=arguments[_];return(g=o.get(u))==null?void 0:g.map(m=>m(...p)).find(m=>m!==void 0)}}}else s[u]=f}),s),{})}}function Al(e){e===void 0&&(e=[]);const n=e.map(a=>a==null?void 0:a.reference),t=e.map(a=>a==null?void 0:a.floating),o=e.map(a=>a==null?void 0:a.item),r=I.useCallback(a=>Io(a,e,"reference"),n),i=I.useCallback(a=>Io(a,e,"floating"),t),s=I.useCallback(a=>Io(a,e,"item"),o);return I.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}const Dl="Escape";function Rn(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function qn(e,n){return Rn(n,e===Yr||e===Pn,e===on||e===rn)}function Eo(e,n,t){return Rn(n,e===Pn,t?e===on:e===rn)||e==="Enter"||e===" "||e===""}function fi(e,n,t){return Rn(n,t?e===on:e===rn,e===Pn)}function gi(e,n,t,o){const r=t?e===rn:e===on,i=e===Yr;return n==="both"||n==="horizontal"&&o&&o>1?e===Dl:Rn(n,r,i)}function Ol(e,n){const{open:t,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:s,activeIndex:a,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:h=!1,loop:g=!1,nested:c=!1,rtl:p=!1,virtual:_=!1,focusItemOnOpen:m="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:S="vertical",parentOrientation:x,cols:y=1,scrollItemIntoView:M=!0,virtualItemRef:E,itemSizes:T,dense:F=!1}=n;process.env.NODE_ENV!=="production"&&(h&&(g||yo("`useListNavigation` looping must be enabled to allow escaping."),_||yo("`useListNavigation` must be virtual to allow escaping.")),S==="vertical"&&y>1&&yo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const P=kn(r.floating),U=Ue(P),z=Co(),k=Nn();Ae(()=>{e.dataRef.current.orientation=S},[e,S]);const A=Re(()=>{d($.current===-1?null:$.current)}),O=_o(r.domReference),D=I.useRef(m),$=I.useRef(f??-1),N=I.useRef(null),j=I.useRef(!0),_e=I.useRef(A),fe=I.useRef(!!r.floating),L=I.useRef(t),re=I.useRef(!1),Z=I.useRef(!1),ue=Ue(C),we=Ue(t),ye=Ue(M),B=Ue(f),[pe,Ee]=I.useState(),[K,J]=I.useState(),X=Re(()=>{function R(he){if(_){var Ce;(Ce=he.id)!=null&&Ce.endsWith("-fui-option")&&(he.id=i+"-"+Math.random().toString(16).slice(2,10)),Ee(he.id),k==null||k.events.emit("virtualfocus",he),E&&(E.current=he)}else Nt(he,{sync:re.current,preventScroll:!0})}const ne=s.current[$.current],V=Z.current;ne&&R(ne),(re.current?he=>he():requestAnimationFrame)(()=>{const he=s.current[$.current]||ne;if(!he)return;ne||R(he);const Ce=ye.current;Ce&&oe&&(V||!j.current)&&(he.scrollIntoView==null||he.scrollIntoView(typeof Ce=="boolean"?{block:"nearest",inline:"nearest"}:Ce))})});Ae(()=>{u&&(t&&r.floating?D.current&&f!=null&&(Z.current=!0,$.current=f,A()):fe.current&&($.current=-1,_e.current()))},[u,t,r.floating,f,A]),Ae(()=>{if(u&&t&&r.floating)if(a==null){if(re.current=!1,B.current!=null)return;if(fe.current&&($.current=-1,X()),(!L.current||!fe.current)&&D.current&&(N.current!=null||D.current===!0&&N.current==null)){let R=0;const ne=()=>{s.current[0]==null?(R<2&&(R?requestAnimationFrame:queueMicrotask)(ne),R++):($.current=N.current==null||Eo(N.current,S,p)||c?po(s,ue.current):Ar(s,ue.current),N.current=null,A())};ne()}}else en(s,a)||($.current=a,X(),Z.current=!1)},[u,t,r.floating,a,B,c,s,S,p,A,X,ue]),Ae(()=>{var R;if(!u||r.floating||!k||_||!fe.current)return;const ne=k.nodesRef.current,V=(R=ne.find(Ce=>Ce.id===z))==null||(R=R.context)==null?void 0:R.elements.floating,ae=xt(nt(r.floating)),he=ne.some(Ce=>Ce.context&&We(Ce.context.elements.floating,ae));V&&!he&&j.current&&V.focus({preventScroll:!0})},[u,r.floating,k,z,_]),Ae(()=>{if(!u||!k||!_||z)return;function R(ne){J(ne.id),E&&(E.current=ne)}return k.events.on("virtualfocus",R),()=>{k.events.off("virtualfocus",R)}},[u,k,_,z,E]),Ae(()=>{_e.current=A,L.current=t,fe.current=!!r.floating}),Ae(()=>{t||(N.current=null,D.current=m)},[t,m]);const Y=a!=null,oe=I.useMemo(()=>{function R(V){if(!we.current)return;const ae=s.current.indexOf(V);ae!==-1&&$.current!==ae&&($.current=ae,A())}return{onFocus(V){let{currentTarget:ae}=V;re.current=!0,R(ae)},onClick:V=>{let{currentTarget:ae}=V;return ae.focus({preventScroll:!0})},onMouseMove(V){let{currentTarget:ae}=V;re.current=!0,Z.current=!1,b&&R(ae)},onPointerLeave(V){let{pointerType:ae}=V;if(!(!j.current||ae==="touch")&&(re.current=!0,!!b&&($.current=-1,A(),!_))){var he;(he=U.current)==null||he.focus({preventScroll:!0})}}}},[we,U,b,s,A,_]),te=I.useCallback(()=>{var R;return x??(k==null||(R=k.nodesRef.current.find(ne=>ne.id===z))==null||(R=R.context)==null||(R=R.dataRef)==null?void 0:R.current.orientation)},[z,k,x]),se=Re(R=>{if(j.current=!1,re.current=!0,R.which===229||!we.current&&R.currentTarget===U.current)return;if(c&&gi(R.key,S,p,y)){qn(R.key,te())||ze(R),o(!1,R.nativeEvent,"list-navigation"),Ve(r.domReference)&&(_?k==null||k.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const ne=$.current,V=po(s,C),ae=Ar(s,C);if(O||(R.key==="Home"&&(ze(R),$.current=V,A()),R.key==="End"&&(ze(R),$.current=ae,A())),y>1){const he=T||Array.from({length:s.current.length},()=>({width:1,height:1})),Ce=ba(he,y,F),Be=Ce.findIndex(ie=>ie!=null&&!Fn(s,ie,C)),Je=Ce.reduce((ie,Oe,le)=>Oe!=null&&!Fn(s,Oe,C)?le:ie,-1),Ge=Ce[va({current:Ce.map(ie=>ie!=null?s.current[ie]:null)},{event:R,orientation:S,loop:g,rtl:p,cols:y,disabledIndices:ya([...(typeof C!="function"?C:null)||s.current.map((ie,Oe)=>Fn(s,Oe,C)?Oe:void 0),void 0],Ce),minIndex:Be,maxIndex:Je,prevIndex:wa($.current>ae?V:$.current,he,Ce,y,R.key===Pn?"bl":R.key===(p?on:rn)?"tr":"tl"),stopEvent:!0})];if(Ge!=null&&($.current=Ge,A()),S==="both")return}if(qn(R.key,S)){if(ze(R),t&&!_&&xt(R.currentTarget.ownerDocument)===R.currentTarget){$.current=Eo(R.key,S,p)?V:ae,A();return}Eo(R.key,S,p)?g?$.current=ne>=ae?h&&ne!==s.current.length?-1:V:qe(s,{startingIndex:ne,disabledIndices:C}):$.current=Math.min(ae,qe(s,{startingIndex:ne,disabledIndices:C})):g?$.current=ne<=V?h&&ne!==-1?s.current.length:ae:qe(s,{startingIndex:ne,decrement:!0,disabledIndices:C}):$.current=Math.max(V,qe(s,{startingIndex:ne,decrement:!0,disabledIndices:C})),en(s,$.current)&&($.current=-1),A()}}),de=I.useMemo(()=>_&&t&&Y&&{"aria-activedescendant":K||pe},[_,t,Y,K,pe]),me=I.useMemo(()=>({"aria-orientation":S==="both"?void 0:S,...O?{}:de,onKeyDown:se,onPointerMove(){j.current=!0}}),[de,se,S,O]),$e=I.useMemo(()=>{function R(V){m==="auto"&&kr(V.nativeEvent)&&(D.current=!0)}function ne(V){D.current=m,m==="auto"&&Mr(V.nativeEvent)&&(D.current=!0)}return{...de,onKeyDown(V){j.current=!1;const ae=V.key.startsWith("Arrow"),he=["Home","End"].includes(V.key),Ce=ae||he,Be=fi(V.key,S,p),Je=gi(V.key,S,p,y),Ge=fi(V.key,te(),p),ie=qn(V.key,S),Oe=(c?Ge:ie)||V.key==="Enter"||V.key.trim()==="";if(_&&t){const Ke=k==null?void 0:k.nodesRef.current.find(ge=>ge.parentId==null),q=k&&Ke?fa(k.nodesRef.current,Ke.id):null;if(Ce&&q&&E){const ge=new KeyboardEvent("keydown",{key:V.key,bubbles:!0});if(Be||Je){var le,ke;const Pe=((le=q.context)==null?void 0:le.elements.domReference)===V.currentTarget,Te=Je&&!Pe?(ke=q.context)==null?void 0:ke.elements.domReference:Be?s.current.find(at=>(at==null?void 0:at.id)===pe):null;Te&&(ze(V),Te.dispatchEvent(ge),J(void 0))}if((ie||he)&&q.context&&q.context.open&&q.parentId&&V.currentTarget!==q.context.elements.domReference){var wt;ze(V),(wt=q.context.elements.domReference)==null||wt.dispatchEvent(ge);return}}return se(V)}if(!(!t&&!w&&ae)){if(Oe){const Ke=qn(V.key,te());N.current=c&&Ke?null:V.key}if(c){Ge&&(ze(V),t?($.current=po(s,ue.current),A()):o(!0,V.nativeEvent,"list-navigation"));return}ie&&(f!=null&&($.current=f),ze(V),!t&&w?o(!0,V.nativeEvent,"list-navigation"):se(V),t&&A())}},onFocus(){t&&!_&&($.current=-1,A())},onPointerDown:ne,onPointerEnter:ne,onMouseDown:R,onClick:R}},[pe,de,y,se,ue,m,s,c,A,o,t,w,S,te,p,f,k,_,E]);return I.useMemo(()=>u?{reference:$e,floating:me,item:oe}:{},[u,$e,me,oe])}const Pl=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Nl(e,n){var t,o;n===void 0&&(n={});const{open:r,elements:i,floatingId:s}=e,{enabled:a=!0,role:d="dialog"}=n,u=wo(),f=((t=i.domReference)==null?void 0:t.id)||u,h=I.useMemo(()=>{var w;return((w=kn(i.floating))==null?void 0:w.id)||s},[i.floating,s]),g=(o=Pl.get(d))!=null?o:d,p=Co()!=null,_=I.useMemo(()=>g==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?h:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?h:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:f},...g==="menu"&&p&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[g,h,p,r,f,d]),m=I.useMemo(()=>{const w={id:h,...g&&{role:g}};return g==="tooltip"||d==="label"?w:{...w,...g==="menu"&&{"aria-labelledby":f}}},[g,h,f,d]),b=I.useCallback(w=>{let{active:C,selected:S}=w;const x={role:"option",...C&&{id:h+"-fui-option"}};switch(d){case"select":case"combobox":return{...x,"aria-selected":S}}return{}},[h,d]);return I.useMemo(()=>a?{reference:_,floating:m,item:b}:{},[a,_,m,b])}const _i=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function Ht(e,n){return typeof e=="function"?e(n):e}function Ll(e,n){const[t,o]=I.useState(e);return e&&!t&&o(!0),I.useEffect(()=>{if(!e&&t){const r=setTimeout(()=>o(!1),n);return()=>clearTimeout(r)}},[e,t,n]),t}function Vl(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:r=250}=n,s=(typeof r=="number"?r:r.close)||0,[a,d]=I.useState("unmounted"),u=Ll(t,s);return!u&&a==="close"&&d("unmounted"),Ae(()=>{if(o){if(t){d("initial");const f=requestAnimationFrame(()=>{Jn.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[t,o]),{isMounted:u,status:a}}function Tl(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:r,common:i,duration:s=250}=n,a=e.placement,d=a.split("-")[0],u=I.useMemo(()=>({side:d,placement:a}),[d,a]),f=typeof s=="number",h=(f?s:s.open)||0,g=(f?s:s.close)||0,[c,p]=I.useState(()=>({...Ht(i,u),...Ht(t,u)})),{isMounted:_,status:m}=Vl(e,{duration:s}),b=Ue(t),w=Ue(o),C=Ue(r),S=Ue(i);return Ae(()=>{const x=Ht(b.current,u),y=Ht(C.current,u),M=Ht(S.current,u),E=Ht(w.current,u)||Object.keys(x).reduce((T,F)=>(T[F]="",T),{});if(m==="initial"&&p(T=>({transitionProperty:T.transitionProperty,...M,...x})),m==="open"&&p({transitionProperty:Object.keys(E).map(_i).join(","),transitionDuration:h+"ms",...M,...E}),m==="close"){const T=y||x;p({transitionProperty:Object.keys(T).map(_i).join(","),transitionDuration:g+"ms",...M,...T})}},[g,C,b,w,S,h,m,u]),{isMounted:_,styles:c}}function zl(e,n){var t;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:d,enabled:u=!0,findMatch:f=null,resetMs:h=750,ignoreKeys:g=[],selectedIndex:c=null}=n,p=I.useRef(-1),_=I.useRef(""),m=I.useRef((t=c??s)!=null?t:-1),b=I.useRef(null),w=Re(a),C=Re(d),S=Ue(f),x=Ue(g);Ae(()=>{o&&(So(p),b.current=null,_.current="")},[o]),Ae(()=>{if(o&&_.current===""){var F;m.current=(F=c??s)!=null?F:-1}},[o,c,s]);const y=Re(F=>{F?r.current.typing||(r.current.typing=F,C(F)):r.current.typing&&(r.current.typing=F,C(F))}),M=Re(F=>{function P(O,D,$){const N=S.current?S.current(D,$):D.find(j=>(j==null?void 0:j.toLocaleLowerCase().indexOf($.toLocaleLowerCase()))===0);return N?O.indexOf(N):-1}const U=i.current;if(_.current.length>0&&_.current[0]!==" "&&(P(U,U,_.current)===-1?y(!1):F.key===" "&&ze(F)),U==null||x.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;o&&F.key!==" "&&(ze(F),y(!0)),U.every(O=>{var D,$;return O?((D=O[0])==null?void 0:D.toLocaleLowerCase())!==(($=O[1])==null?void 0:$.toLocaleLowerCase()):!0})&&_.current===F.key&&(_.current="",m.current=b.current),_.current+=F.key,So(p),p.current=window.setTimeout(()=>{_.current="",m.current=b.current,y(!1)},h);const k=m.current,A=P(U,[...U.slice((k||0)+1),...U.slice(0,(k||0)+1)],_.current);A!==-1?(w(A),b.current=A):F.key!==" "&&(_.current="",y(!1))}),E=I.useMemo(()=>({onKeyDown:M}),[M]),T=I.useMemo(()=>({onKeyDown:M,onKeyUp(F){F.key===" "&&y(!1)}}),[M,y]);return I.useMemo(()=>u?{reference:E,floating:T}:{},[u,E,T])}function Gt(e,n,t){let o=t.initialDeps??[],r;function i(){var s,a,d,u;let f;t.key&&((s=t.debug)!=null&&s.call(t))&&(f=Date.now());const h=e();if(!(h.length!==o.length||h.some((p,_)=>o[_]!==p)))return r;o=h;let c;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(c=Date.now()),r=n(...h),t.key&&((d=t.debug)!=null&&d.call(t))){const p=Math.round((Date.now()-f)*100)/100,_=Math.round((Date.now()-c)*100)/100,m=_/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(_,5)} /${b(p,5)} ms`,`
|
|
4
|
+
*/var Ws=["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])"],xn=Ws.join(","),mr=typeof Element>"u",qt=mr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$n=!mr&&Element.prototype.getRootNode?function(e){var n;return e==null||(n=e.getRootNode)===null||n===void 0?void 0:n.call(e)}:function(e){return e?.ownerDocument},Qt=function(n,t){var o;t===void 0&&(t=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=r===""||r==="true",s=i||t&&n&&Qt(n.parentNode);return s},Ks=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},vr=function(n,t,o){if(Qt(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(xn));return t&&qt.call(n,xn)&&r.unshift(n),r=r.filter(o),r},In=function(n,t,o){for(var r=[],i=Array.from(n);i.length;){var s=i.shift();if(!Qt(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),d=a.length?a:s.children,c=In(d,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else{var f=qt.call(s,xn);f&&o.filter(s)&&(t||!n.includes(s))&&r.push(s);var _=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),g=!Qt(_,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(_&&g){var u=In(_===!0?s.children:_.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else i.unshift.apply(i,s.children)}}return r},br=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},wr=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||Ks(n))&&!br(n)?0:n.tabIndex},Us=function(n,t){var o=wr(n);return o<0&&t&&!br(n)?0:o},Xs=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},yr=function(n){return n.tagName==="INPUT"},Ys=function(n){return yr(n)&&n.type==="hidden"},Zs=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},Js=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},Qs=function(n){if(!n.name)return!0;var t=n.form||$n(n),o=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(n.name));else try{r=o(n.name)}catch(s){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",s.message),!1}var i=Js(r,n.form);return!i||i===n},ea=function(n){return yr(n)&&n.type==="radio"},ta=function(n){return ea(n)&&!Qs(n)},na=function(n){var t,o=n&&$n(n),r=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,a,d;for(i=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||n!=null&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(n));!i&&r;){var c,f,_;o=$n(r),r=(c=o)===null||c===void 0?void 0:c.host,i=!!((f=r)!==null&&f!==void 0&&(_=f.ownerDocument)!==null&&_!==void 0&&_.contains(r))}}return i},Cr=function(n){var t=n.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},oa=function(n,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in n){var i=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(n).visibility==="hidden")return!0;var s=qt.call(n,"details>summary:first-of-type"),a=s?n.parentElement:n;if(qt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=n;n;){var c=n.parentElement,f=$n(n);if(c&&!c.shadowRoot&&r(c)===!0)return Cr(n);n.assignedSlot?n=n.assignedSlot:!c&&f!==n.ownerDocument?n=f.host:n=c}n=d}if(na(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Cr(n);return!1},ra=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return qt.call(t,"fieldset[disabled] *")?!0:!r.contains(n)}return!0}t=t.parentElement}return!1},ao=function(n,t){return!(t.disabled||Qt(t)||Ys(t)||oa(t,n)||Zs(t)||ra(t))},lo=function(n,t){return!(ta(t)||wr(t)<0||!ao(n,t))},ia=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Sr=function(n){var t=[],o=[];return n.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,d=Us(a,s),c=s?Sr(r.candidates):a;d===0?s?t.push.apply(t,c):t.push(a):o.push({documentOrder:i,tabIndex:d,item:r,isScope:s,content:c})}),o.sort(Xs).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(t)},En=function(n,t){t=t||{};var o;return t.getShadowRoot?o=In([n],t.includeContainer,{filter:lo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ia}):o=vr(n,t.includeContainer,lo.bind(null,t)),Sr(o)},sa=function(n,t){t=t||{};var o;return t.getShadowRoot?o=In([n],t.includeContainer,{filter:ao.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=vr(n,t.includeContainer,ao.bind(null,t)),o},xr=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return qt.call(n,xn)===!1?!1:lo(t,n)};function aa(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function $r(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(n=>{let{brand:t,version:o}=n;return t+"/"+o}).join(" "):navigator.userAgent}function la(){return/apple/i.test(navigator.vendor)}function co(){const e=/android/i;return e.test(aa())||e.test($r())}function ca(){return $r().includes("jsdom/")}const Ir="data-floating-ui-focusable",ua="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",uo="ArrowLeft",fo="ArrowRight",da="ArrowUp",fa="ArrowDown";function St(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function We(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&oo(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function xt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function go(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const t=e;return t.target!=null&&n.contains(t.target)}function ga(e){return e.matches("html,body")}function nt(e){return e?.ownerDocument||document}function Er(e){return Le(e)&&e.matches(ua)}function _o(e){return e?e.getAttribute("role")==="combobox"&&Er(e):!1}function kn(e){return e?e.hasAttribute(Ir)?e:e.querySelector("["+Ir+"]")||e:null}function Dt(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Dt(e,r.id,t)])}function _a(e,n){let t,o=-1;function r(i,s){s>o&&(t=i,o=s),Dt(e,i).forEach(d=>{r(d.id,s+1)})}return r(n,0),e.find(i=>i.id===t)}function kr(e,n){var t;let o=[],r=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function ze(e){e.preventDefault(),e.stopPropagation()}function pa(e){return"nativeEvent"in e}function Mr(e){return e.mozInputSource===0&&e.isTrusted?!0:co()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Fr(e){return ca()?!1:!co()&&e.width===0&&e.height===0||co()&&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 Nr(e,n){return["mouse","pen"].includes(e)}var ha=typeof document<"u",ma=function(){},Fe=ha?v.useLayoutEffect:ma;const va={...S};function Ke(e){const n=S.useRef(e);return Fe(()=>{n.current=e}),n}const ba=va.useInsertionEffect||(e=>e());function Re(e){const n=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ba(()=>{n.current=e}),S.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}function Mn(e,n,t){return Math.floor(e/n)!==t}function en(e,n){return n<0||n>=e.current.length}function po(e,n){return qe(e,{disabledIndices:n})}function Ar(e,n){return qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function qe(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&Fn(e,s,r));return s}function wa(e,n){let{event:t,orientation:o,loop:r,rtl:i,cols:s,disabledIndices:a,minIndex:d,maxIndex:c,prevIndex:f,stopEvent:_=!1}=n,g=f;if(t.key===da){if(_&&ze(t),f===-1)g=c;else if(g=qe(e,{startingIndex:g,amount:s,decrement:!0,disabledIndices:a}),r&&(f-s<d||g<0)){const u=f%s,p=c%s,h=c-(p-u);p===u?g=c:g=p>u?h:h-s}en(e,g)&&(g=f)}if(t.key===fa&&(_&&ze(t),f===-1?g=d:(g=qe(e,{startingIndex:f,amount:s,disabledIndices:a}),r&&f+s>c&&(g=qe(e,{startingIndex:f%s-s,amount:s,disabledIndices:a}))),en(e,g)&&(g=f)),o==="both"){const u=Rt(f/s);t.key===(i?uo:fo)&&(_&&ze(t),f%s!==s-1?(g=qe(e,{startingIndex:f,disabledIndices:a}),r&&Mn(g,s,u)&&(g=qe(e,{startingIndex:f-f%s-1,disabledIndices:a}))):r&&(g=qe(e,{startingIndex:f-f%s-1,disabledIndices:a})),Mn(g,s,u)&&(g=f)),t.key===(i?fo:uo)&&(_&&ze(t),f%s!==0?(g=qe(e,{startingIndex:f,decrement:!0,disabledIndices:a}),r&&Mn(g,s,u)&&(g=qe(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a}))):r&&(g=qe(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a})),Mn(g,s,u)&&(g=f));const p=Rt(c/s)===u;en(e,g)&&(r&&p?g=t.key===(i?fo:uo)?c:qe(e,{startingIndex:f-f%s-1,disabledIndices:a}):g=f)}return g}function ya(e,n,t){const o=[];let r=0;return e.forEach((i,s)=>{let{width:a,height:d}=i;if(a>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let c=!1;for(t&&(r=0);!c;){const f=[];for(let _=0;_<a;_++)for(let g=0;g<d;g++)f.push(r+_+g*n);r%n+a<=n&&f.every(_=>o[_]==null)?(f.forEach(_=>{o[_]=s}),c=!0):r++}}),[...o]}function Ca(e,n,t,o,r){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(r){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function Sa(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function Fn(e,n,t){if(typeof t=="function")return t(n);if(t)return t.includes(n);const o=e.current[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Dr(e,n){const t=En(e,tn()),o=t.length;if(o===0)return;const r=St(nt(e)),i=t.indexOf(r),s=i===-1?n===1?0:o-1:i+n;return t[s]}function Pr(e){return Dr(nt(e).body,1)||e}function Or(e){return Dr(nt(e).body,-1)||e}function nn(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!We(t,o)}function xa(e){En(e,tn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Vr(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}function Lr(e,n,t){let{reference:o,floating:r}=e;const i=pt(n),s=_r(n),a=gr(s),d=Ct(n),c=i==="y",f=o.x+o.width/2-r.width/2,_=o.y+o.height/2-r.height/2,g=o[a]/2-r[a]/2;let u;switch(d){case"top":u={x:f,y:o.y-r.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:_};break;case"left":u={x:o.x-r.width,y:_};break;default:u={x:o.x,y:o.y}}switch(Jt(n)){case"start":u[s]-=g*(t&&c?-1:1);break;case"end":u[s]+=g*(t&&c?-1:1);break}return u}const $a=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,a=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let c=await s.getElementRects({reference:e,floating:n,strategy:r}),{x:f,y:_}=Lr(c,o,d),g=o,u={},p=0;for(let h=0;h<a.length;h++){const{name:m,fn:b}=a[h],{x:w,y,data:C,reset:I}=await b({x:f,y:_,initialPlacement:o,placement:g,strategy:r,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:n}});f=w??f,_=y??_,u={...u,[m]:{...u[m],...C}},I&&p<=50&&(p++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(c=I.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:r}):I.rects),{x:f,y:_}=Lr(c,g,d)),h=-1)}return{x:f,y:_,placement:g,strategy:r,middlewareData:u}};async function ho(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:_="floating",altBoundary:g=!1,padding:u=0}=Zt(n,e),p=Gs(u),m=a[g?_==="floating"?"reference":"floating":_],b=Sn(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(m)))==null||t?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:d})),w=_==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),C=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},I=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:d}):w);return{top:(b.top-I.top+p.top)/C.y,bottom:(I.bottom-b.bottom+p.bottom)/C.y,left:(b.left-I.left+p.left)/C.x,right:(I.right-b.right+p.right)/C.x}}const Ia=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:d,elements:c}=n,{mainAxis:f=!0,crossAxis:_=!0,fallbackPlacements:g,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...m}=Zt(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const b=Ct(r),w=pt(a),y=Ct(a)===a,C=await(d.isRTL==null?void 0:d.isRTL(c.floating)),I=g||(y||!h?[Cn(a)]:zs(a)),x=p!=="none";!g&&x&&I.push(...Bs(a,h,p,C));const M=[a,...I],k=await ho(n,m),T=[];let A=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&T.push(k[b]),_){const E=Ts(r,s,C);T.push(k[E[0]],k[E[1]])}if(A=[...A,{placement:r,overflows:T}],!T.every(E=>E<=0)){var V,U;const E=(((V=i.flip)==null?void 0:V.index)||0)+1,F=M[E];if(F&&(!(_==="alignment"?w!==pt(F):!1)||A.every($=>pt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:E,overflows:A},reset:{placement:F}};let D=(U=A.filter(N=>N.overflows[0]<=0).sort((N,$)=>N.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!D)switch(u){case"bestFit":{var z;const N=(z=A.filter($=>{if(x){const P=pt($.placement);return P===w||P==="y"}return!0}).map($=>[$.placement,$.overflows.filter(P=>P>0).reduce((P,B)=>P+B,0)]).sort(($,P)=>$[1]-P[1])[0])==null?void 0:z[0];N&&(D=N);break}case"initialPlacement":D=a;break}if(r!==D)return{reset:{placement:D}}}return{}}}},Ea=new Set(["left","top"]);async function ka(e,n){const{placement:t,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Ct(t),a=Jt(t),d=pt(t)==="y",c=Ea.has(s)?-1:1,f=i&&d?-1:1,_=Zt(n,e);let{mainAxis:g,crossAxis:u,alignmentAxis:p}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:_.mainAxis||0,crossAxis:_.crossAxis||0,alignmentAxis:_.alignmentAxis};return a&&typeof p=="number"&&(u=a==="end"?p*-1:p),d?{x:u*f,y:g*c}:{x:g*c,y:u*f}}const Ma=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:r,y:i,placement:s,middlewareData:a}=n,d=await ka(n,e);return s===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:s}}}}},Fa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...d}=Zt(e,n),c={x:t,y:o},f=await ho(n,d),_=pt(Ct(r)),g=fr(_);let u=c[g],p=c[_];if(i){const m=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=u+f[m],y=u-f[b];u=dr(w,u,y)}if(s){const m=_==="y"?"top":"left",b=_==="y"?"bottom":"right",w=p+f[m],y=p-f[b];p=dr(w,p,y)}const h=a.fn({...n,[g]:u,[_]:p});return{...h,data:{x:h.x-t,y:h.y-o,enabled:{[g]:i,[_]:s}}}}}},Na=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:r,rects:i,platform:s,elements:a}=n,{apply:d=()=>{},...c}=Zt(e,n),f=await ho(n,c),_=Ct(r),g=Jt(r),u=pt(r)==="y",{width:p,height:h}=i.floating;let m,b;_==="top"||_==="bottom"?(m=_,b=g===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=_,m=g==="end"?"top":"bottom");const w=h-f.top-f.bottom,y=p-f.left-f.right,C=zt(h-f[m],w),I=zt(p-f[b],y),x=!n.middlewareData.shift;let M=C,k=I;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(k=y),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(M=w),x&&!g){const A=Ye(f.left,0),V=Ye(f.right,0),U=Ye(f.top,0),z=Ye(f.bottom,0);u?k=p-2*(A!==0||V!==0?A+V:Ye(f.left,f.right)):M=h-2*(U!==0||z!==0?U+z:Ye(f.top,f.bottom))}await d({...n,availableWidth:k,availableHeight:M});const T=await s.getDimensions(a.floating);return p!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Tr(e){const n=tt(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=Le(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:o,a=yn(t)!==i||yn(o)!==s;return a&&(t=i,o=s),{width:t,height:o,$:a}}function mo(e){return Ne(e)?e:e.contextElement}function jt(e){const n=mo(e);if(!Le(n))return ut(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=Tr(n);let s=(i?yn(t.width):t.width)/o,a=(i?yn(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Aa=ut(0);function zr(e){const n=Xe(e);return!bn()||!n.visualViewport?Aa:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Da(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==Xe(e)?!1:n}function Pt(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=mo(e);let s=ut(1);n&&(o?Ne(o)&&(s=jt(o)):s=jt(e));const a=Da(i,t,o)?zr(i):ut(0);let d=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,f=r.width/s.x,_=r.height/s.y;if(i){const g=Xe(i),u=o&&Ne(o)?Xe(o):o;let p=g,h=io(p);for(;h&&o&&u!==p;){const m=jt(h),b=h.getBoundingClientRect(),w=tt(h),y=b.left+(h.clientLeft+parseFloat(w.paddingLeft))*m.x,C=b.top+(h.clientTop+parseFloat(w.paddingTop))*m.y;d*=m.x,c*=m.y,f*=m.x,_*=m.y,d+=y,c+=C,p=Xe(h),h=io(p)}}return Sn({width:f,height:_,x:d,y:c})}function Nn(e,n){const t=wn(e).scrollLeft;return n?n.left+t:Pt(ct(e)).left+t}function Rr(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-Nn(e,t),r=t.top+n.scrollTop;return{x:o,y:r}}function Pa(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=ct(o),a=n?vn(n.floating):!1;if(o===s||a&&i)return t;let d={scrollLeft:0,scrollTop:0},c=ut(1);const f=ut(0),_=Le(o);if((_||!_&&!i)&&((wt(o)!=="body"||Yt(s))&&(d=wn(o)),Le(o))){const u=Pt(o);c=jt(o),f.x=u.x+o.clientLeft,f.y=u.y+o.clientTop}const g=s&&!_&&!i?Rr(s,d):ut(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-d.scrollLeft*c.x+f.x+g.x,y:t.y*c.y-d.scrollTop*c.y+f.y+g.y}}function Oa(e){return Array.from(e.getClientRects())}function Va(e){const n=ct(e),t=wn(e),o=e.ownerDocument.body,r=Ye(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=Ye(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+Nn(e);const a=-t.scrollTop;return tt(o).direction==="rtl"&&(s+=Ye(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const qr=25;function La(e,n){const t=Xe(e),o=ct(e),r=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,d=0;if(r){i=r.width,s=r.height;const f=bn();(!f||f&&n==="fixed")&&(a=r.offsetLeft,d=r.offsetTop)}const c=Nn(o);if(c<=0){const f=o.ownerDocument,_=f.body,g=getComputedStyle(_),u=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(o.clientWidth-_.clientWidth-u);p<=qr&&(i-=p)}else c<=qr&&(i+=c);return{width:i,height:s,x:a,y:d}}const Ta=new Set(["absolute","fixed"]);function za(e,n){const t=Pt(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=Le(e)?jt(e):ut(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,d=r*i.x,c=o*i.y;return{width:s,height:a,x:d,y:c}}function jr(e,n,t){let o;if(n==="viewport")o=La(e,t);else if(n==="document")o=Va(ct(e));else if(Ne(n))o=za(n,t);else{const r=zr(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Sn(o)}function Br(e,n){const t=_t(e);return t===n||!Ne(t)||gt(t)?!1:tt(t).position==="fixed"||Br(t,n)}function Ra(e,n){const t=n.get(e);if(t)return t;let o=yt(e,[],!1).filter(a=>Ne(a)&&wt(a)!=="body"),r=null;const i=tt(e).position==="fixed";let s=i?_t(e):e;for(;Ne(s)&&!gt(s);){const a=tt(s),d=ro(s);!d&&a.position==="fixed"&&(r=null),(i?!d&&!r:!d&&a.position==="static"&&!!r&&Ta.has(r.position)||Yt(s)&&!d&&Br(e,s))?o=o.filter(f=>f!==s):r=a,s=_t(s)}return n.set(e,o),o}function qa(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const s=[...t==="clippingAncestors"?vn(n)?[]:Ra(n,this._c):[].concat(t),o],a=s[0],d=s.reduce((c,f)=>{const _=jr(n,f,r);return c.top=Ye(_.top,c.top),c.right=zt(_.right,c.right),c.bottom=zt(_.bottom,c.bottom),c.left=Ye(_.left,c.left),c},jr(n,a,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function ja(e){const{width:n,height:t}=Tr(e);return{width:n,height:t}}function Ba(e,n,t){const o=Le(n),r=ct(n),i=t==="fixed",s=Pt(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const d=ut(0);function c(){d.x=Nn(r)}if(o||!o&&!i)if((wt(n)!=="body"||Yt(r))&&(a=wn(n)),o){const u=Pt(n,!0,i,n);d.x=u.x+n.clientLeft,d.y=u.y+n.clientTop}else r&&c();i&&!o&&r&&c();const f=r&&!o&&!i?Rr(r,a):ut(0),_=s.left+a.scrollLeft-d.x-f.x,g=s.top+a.scrollTop-d.y-f.y;return{x:_,y:g,width:s.width,height:s.height}}function vo(e){return tt(e).position==="static"}function Hr(e,n){if(!Le(e)||tt(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return ct(e)===t&&(t=t.ownerDocument.body),t}function Gr(e,n){const t=Xe(e);if(vn(e))return t;if(!Le(e)){let r=_t(e);for(;r&&!gt(r);){if(Ne(r)&&!vo(r))return r;r=_t(r)}return t}let o=Hr(e,n);for(;o&&ks(o)&&vo(o);)o=Hr(o,n);return o&>(o)&&vo(o)&&!ro(o)?t:o||Ds(e)||t}const Ha=async function(e){const n=this.getOffsetParent||Gr,t=this.getDimensions,o=await t(e.floating);return{reference:Ba(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ga(e){return tt(e).direction==="rtl"}const Wa={convertOffsetParentRelativeRectToViewportRelativeRect:Pa,getDocumentElement:ct,getClippingRect:qa,getOffsetParent:Gr,getElementRects:Ha,getClientRects:Oa,getDimensions:ja,getScale:jt,isElement:Ne,isRTL:Ga};function Wr(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Ka(e,n){let t=null,o;const r=ct(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function s(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),i();const c=e.getBoundingClientRect(),{left:f,top:_,width:g,height:u}=c;if(a||n(),!g||!u)return;const p=Rt(_),h=Rt(r.clientWidth-(f+g)),m=Rt(r.clientHeight-(_+u)),b=Rt(f),y={rootMargin:-p+"px "+-h+"px "+-m+"px "+-b+"px",threshold:Ye(0,zt(1,d))||1};let C=!0;function I(x){const M=x[0].intersectionRatio;if(M!==d){if(!C)return s();M?s(!1,M):o=setTimeout(()=>{s(!1,1e-7)},1e3)}M===1&&!Wr(c,e.getBoundingClientRect())&&s(),C=!1}try{t=new IntersectionObserver(I,{...y,root:r.ownerDocument})}catch{t=new IntersectionObserver(I,y)}t.observe(e)}return s(!0),i}function Ua(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=mo(e),f=r||i?[...c?yt(c):[],...yt(n)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",t,{passive:!0}),i&&b.addEventListener("resize",t)});const _=c&&a?Ka(c,t):null;let g=-1,u=null;s&&(u=new ResizeObserver(b=>{let[w]=b;w&&w.target===c&&u&&(u.unobserve(n),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var y;(y=u)==null||y.observe(n)})),t()}),c&&!d&&u.observe(c),u.observe(n));let p,h=d?Pt(e):null;d&&m();function m(){const b=Pt(e);h&&!Wr(h,b)&&t(),h=b,p=requestAnimationFrame(m)}return t(),()=>{var b;f.forEach(w=>{r&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),_?.(),(b=u)==null||b.disconnect(),u=null,d&&cancelAnimationFrame(p)}}const Xa=Ma,Ya=Fa,Za=Ia,Ja=Na,Qa=(e,n,t)=>{const o=new Map,r={platform:Wa,...t},i={...r.platform,_c:o};return $a(e,n,{...r,platform:i})};var el=typeof document<"u",tl=function(){},An=el?v.useLayoutEffect:tl;function Dn(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(o=t;o--!==0;)if(!Dn(e[o],n[o]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=t;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!Dn(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Kr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ur(e,n){const t=Kr(e);return Math.round(n*t)/t}function bo(e){const n=S.useRef(e);return An(()=>{n.current=e}),n}function nl(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:d,open:c}=e,[f,_]=S.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[g,u]=S.useState(o);Dn(g,o)||u(o);const[p,h]=S.useState(null),[m,b]=S.useState(null),w=S.useCallback($=>{$!==x.current&&(x.current=$,h($))},[]),y=S.useCallback($=>{$!==M.current&&(M.current=$,b($))},[]),C=i||p,I=s||m,x=S.useRef(null),M=S.useRef(null),k=S.useRef(f),T=d!=null,A=bo(d),V=bo(r),U=bo(c),z=S.useCallback(()=>{if(!x.current||!M.current)return;const $={placement:n,strategy:t,middleware:g};V.current&&($.platform=V.current),Qa(x.current,M.current,$).then(P=>{const B={...P,isPositioned:U.current!==!1};E.current&&!Dn(k.current,B)&&(k.current=B,Jn.flushSync(()=>{_(B)}))})},[g,n,t,V,U]);An(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,_($=>({...$,isPositioned:!1})))},[c]);const E=S.useRef(!1);An(()=>(E.current=!0,()=>{E.current=!1}),[]),An(()=>{if(C&&(x.current=C),I&&(M.current=I),C&&I){if(A.current)return A.current(C,I,z);z()}},[C,I,z,A,T]);const F=S.useMemo(()=>({reference:x,floating:M,setReference:w,setFloating:y}),[w,y]),D=S.useMemo(()=>({reference:C,floating:I}),[C,I]),N=S.useMemo(()=>{const $={position:t,left:0,top:0};if(!D.floating)return $;const P=Ur(D.floating,f.x),B=Ur(D.floating,f.y);return a?{...$,transform:"translate("+P+"px, "+B+"px)",...Kr(D.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:P,top:B}},[t,a,D.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:z,refs:F,elements:D,floatingStyles:N}),[f,z,F,D,N])}const ol=(e,n)=>({...Xa(e),options:[e,n]}),rl=(e,n)=>({...Ya(e),options:[e,n]}),il=(e,n)=>({...Za(e),options:[e,n]}),sl=(e,n)=>({...Ja(e),options:[e,n]}),al="data-floating-ui-focusable",Xr="active",Yr="selected",on="ArrowLeft",rn="ArrowRight",Zr="ArrowUp",Pn="ArrowDown",ll={...S};let Jr=!1,cl=0;const Qr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cl++;function ul(){const[e,n]=S.useState(()=>Jr?Qr():void 0);return Fe(()=>{e==null&&n(Qr())},[]),S.useEffect(()=>{Jr=!0},[]),e}const wo=ll.useId||ul;let sn;process.env.NODE_ENV!=="production"&&(sn=new Set);function yo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=sn)!=null&&e.has(r))){var i;(i=sn)==null||i.add(r),console.warn(r)}}function dl(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=sn)!=null&&e.has(r))){var i;(i=sn)==null||i.add(r),console.error(r)}}function fl(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(r=>r(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var o;(o=e.get(n))==null||o.delete(t)}}}const gl=S.createContext(null),_l=S.createContext(null),Co=()=>{var e;return((e=S.useContext(gl))==null?void 0:e.id)||null},On=()=>S.useContext(_l);function an(e){return"data-floating-ui-"+e}function So(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let ei=0;function Ot(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(ei);const i=()=>e?.focus({preventScroll:t});r?i():ei=requestAnimationFrame(i)}function pl(e){return e?.ownerDocument||document}const Bt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ti(e){return e==="inert"?Bt.inert:e==="aria-hidden"?Bt["aria-hidden"]:Bt.none}let Vn=new WeakSet,Ln={},xo=0;const hl=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ni=e=>e&&(e.host||ni(e.parentNode)),ml=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=ni(t);return e.contains(o)?o:null}).filter(t=>t!=null);function vl(e,n,t,o){const r="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=ml(n,e),a=new Set,d=new Set(s),c=[];Ln[r]||(Ln[r]=new WeakMap);const f=Ln[r];s.forEach(_),g(n),a.clear();function _(u){!u||a.has(u)||(a.add(u),u.parentNode&&_(u.parentNode))}function g(u){!u||d.has(u)||[].forEach.call(u.children,p=>{if(wt(p)!=="script")if(a.has(p))g(p);else{const h=i?p.getAttribute(i):null,m=h!==null&&h!=="false",b=ti(i),w=(b.get(p)||0)+1,y=(f.get(p)||0)+1;b.set(p,w),f.set(p,y),c.push(p),w===1&&m&&Vn.add(p),y===1&&p.setAttribute(r,""),!m&&i&&p.setAttribute(i,i==="inert"?"":"true")}})}return xo++,()=>{c.forEach(u=>{const p=ti(i),m=(p.get(u)||0)-1,b=(f.get(u)||0)-1;p.set(u,m),f.set(u,b),m||(!Vn.has(u)&&i&&u.removeAttribute(i),Vn.delete(u)),b||u.removeAttribute(r)}),xo--,xo||(Bt.inert=new WeakMap,Bt["aria-hidden"]=new WeakMap,Bt.none=new WeakMap,Vn=new WeakSet,Ln={})}}function oi(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=pl(e[0]).body;return vl(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const Tn={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=S.forwardRef(function(n,t){const[o,r]=S.useState();Fe(()=>{la()&&r("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[an("focus-guard")]:"",style:Tn};return l.jsx("span",{...n,...i})}),ri=S.createContext(null),ii=an("portal");function bl(e){e===void 0&&(e={});const{id:n,root:t}=e,o=wo(),r=si(),[i,s]=S.useState(null),a=S.useRef(null);return Fe(()=>()=>{i?.remove(),queueMicrotask(()=>{a.current=null})},[i]),Fe(()=>{if(!o||a.current)return;const d=n?document.getElementById(n):null;if(!d)return;const c=document.createElement("div");c.id=o,c.setAttribute(ii,""),d.appendChild(c),a.current=c,s(c)},[n,o]),Fe(()=>{if(t===null||!o||a.current)return;let d=t||r?.portalNode;d&&!no(d)&&(d=d.current),d=d||document.body;let c=null;n&&(c=document.createElement("div"),c.id=n,d.appendChild(c));const f=document.createElement("div");f.id=o,f.setAttribute(ii,""),d=c||d,d.appendChild(f),a.current=f,s(f)},[n,t,o,r]),i}function wl(e){const{children:n,id:t,root:o,preserveTabOrder:r=!0}=e,i=bl({id:t,root:o}),[s,a]=S.useState(null),d=S.useRef(null),c=S.useRef(null),f=S.useRef(null),_=S.useRef(null),g=s?.modal,u=s?.open,p=!!s&&!s.modal&&s.open&&r&&!!(o||i);return S.useEffect(()=>{if(!i||!r||g)return;function h(m){i&&nn(m)&&(m.type==="focusin"?Vr:xa)(i)}return i.addEventListener("focusin",h,!0),i.addEventListener("focusout",h,!0),()=>{i.removeEventListener("focusin",h,!0),i.removeEventListener("focusout",h,!0)}},[i,r,g]),S.useEffect(()=>{i&&(u||Vr(i))},[u,i]),l.jsxs(ri.Provider,{value:S.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:c,beforeInsideRef:f,afterInsideRef:_,portalNode:i,setFocusManagerState:a}),[r,i]),children:[p&&i&&l.jsx(zn,{"data-type":"outside",ref:d,onFocus:h=>{if(nn(h,i)){var m;(m=f.current)==null||m.focus()}else{const b=s?s.domReference:null,w=Or(b);w?.focus()}}}),p&&i&&l.jsx("span",{"aria-owns":i.id,style:Tn}),i&&Jn.createPortal(n,i),p&&i&&l.jsx(zn,{"data-type":"outside",ref:c,onFocus:h=>{if(nn(h,i)){var m;(m=_.current)==null||m.focus()}else{const b=s?s.domReference:null,w=Pr(b);w?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,h.nativeEvent,"focus-out")}}})]})}const si=()=>S.useContext(ri);function ai(e){return S.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const yl=20;let $t=[];function $o(){$t=$t.filter(e=>e.isConnected)}function Cl(e){$o(),e&&wt(e)!=="body"&&($t.push(e),$t.length>yl&&($t=$t.slice(-20)))}function li(){return $o(),$t[$t.length-1]}function Sl(e){const n=tn();return xr(e,n)?e:En(e,n)[0]||e}function ci(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=tn(),i=sa(e,o).filter(a=>{const d=a.getAttribute("data-tabindex")||"";return xr(a,o)||a.hasAttribute("data-tabindex")&&!d.startsWith("-")}),s=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const xl=S.forwardRef(function(n,t){return l.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:Tn})});function $l(e){const{context:n,children:t,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:d=!1,modal:c=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:_=!0,outsideElementsInert:g=!1,getInsideElements:u=()=>[]}=e,{open:p,onOpenChange:h,events:m,dataRef:b,elements:{domReference:w,floating:y}}=n,C=Re(()=>{var K;return(K=b.current.floatingContext)==null?void 0:K.nodeId}),I=Re(u),x=typeof s=="number"&&s<0,M=_o(w)&&x,k=hl(),T=k?i:!0,A=!T||k&&g,V=Ke(r),U=Ke(s),z=Ke(a),E=On(),F=si(),D=S.useRef(null),N=S.useRef(null),$=S.useRef(!1),P=S.useRef(!1),B=S.useRef(-1),he=S.useRef(-1),_e=F!=null,L=kn(y),re=Re(function(K){return K===void 0&&(K=L),K?En(K,tn()):[]}),Y=Re(K=>{const Z=re(K);return V.current.map(G=>w&&G==="reference"?w:L&&G==="floating"?L:Z).filter(Boolean).flat()});S.useEffect(()=>{if(o||!c)return;function K(G){if(G.key==="Tab"){We(L,St(nt(L)))&&re().length===0&&!M&&ze(G);const W=Y(),ne=xt(G);V.current[0]==="reference"&&ne===w&&(ze(G),G.shiftKey?Ot(W[W.length-1]):Ot(W[1])),V.current[1]==="floating"&&ne===L&&G.shiftKey&&(ze(G),Ot(W[0]))}}const Z=nt(L);return Z.addEventListener("keydown",K),()=>{Z.removeEventListener("keydown",K)}},[o,w,L,c,V,M,re,Y]),S.useEffect(()=>{if(o||!y)return;function K(Z){const G=xt(Z),ne=re().indexOf(G);ne!==-1&&(B.current=ne)}return y.addEventListener("focusin",K),()=>{y.removeEventListener("focusin",K)}},[o,y,re]),S.useEffect(()=>{if(o||!_)return;function K(){P.current=!0,setTimeout(()=>{P.current=!1})}function Z(ne){const te=ne.relatedTarget,le=ne.currentTarget,ge=xt(ne);queueMicrotask(()=>{const pe=C(),xe=!(We(w,te)||We(y,te)||We(te,y)||We(F?.portalNode,te)||te!=null&&te.hasAttribute(an("focus-guard"))||E&&(Dt(E.nodesRef.current,pe).find(R=>{var ee,O;return We((ee=R.context)==null?void 0:ee.elements.floating,te)||We((O=R.context)==null?void 0:O.elements.domReference,te)})||kr(E.nodesRef.current,pe).find(R=>{var ee,O,ae;return[(ee=R.context)==null?void 0:ee.elements.floating,kn((O=R.context)==null?void 0:O.elements.floating)].includes(te)||((ae=R.context)==null?void 0:ae.elements.domReference)===te})));if(le===w&&L&&ci(L,V),d&&le!==w&&!(ge!=null&&ge.isConnected)&&St(nt(L))===nt(L).body){Le(L)&&L.focus();const R=B.current,ee=re(),O=ee[R]||ee[ee.length-1]||L;Le(O)&&O.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(M||!c)&&te&&xe&&!P.current&&te!==li()&&($.current=!0,h(!1,ne,"focus-out"))})}const G=!!(!E&&F);function W(){So(he),b.current.insideReactTree=!0,he.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(y&&Le(w))return w.addEventListener("focusout",Z),w.addEventListener("pointerdown",K),y.addEventListener("focusout",Z),G&&y.addEventListener("focusout",W,!0),()=>{w.removeEventListener("focusout",Z),w.removeEventListener("pointerdown",K),y.removeEventListener("focusout",Z),G&&y.removeEventListener("focusout",W,!0)}},[o,w,y,L,c,E,F,h,_,d,re,M,C,V,b]);const ce=S.useRef(null),ve=S.useRef(null),ye=ai([ce,F?.beforeInsideRef]),se=ai([ve,F?.afterInsideRef]);S.useEffect(()=>{var K,Z;if(o||!y)return;const G=Array.from((F==null||(K=F.portalNode)==null?void 0:K.querySelectorAll("["+an("portal")+"]"))||[]),ne=(Z=(E?kr(E.nodesRef.current,C()):[]).find(ge=>{var pe;return _o(((pe=ge.context)==null?void 0:pe.elements.domReference)||null)}))==null||(Z=Z.context)==null?void 0:Z.elements.domReference,te=[y,ne,...G,...I(),D.current,N.current,ce.current,ve.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,V.current.includes("reference")||M?w:null].filter(ge=>ge!=null),le=c||M?oi(te,!A,A):oi(te);return()=>{le()}},[o,w,y,c,V,F,M,T,A,E,C,I]),Fe(()=>{if(o||!Le(L))return;const K=nt(L),Z=St(K);queueMicrotask(()=>{const G=Y(L),W=U.current,ne=(typeof W=="number"?G[W]:W.current)||L,te=We(L,Z);!x&&!te&&p&&Ot(ne,{preventScroll:ne===L})})},[o,p,L,x,Y,U]),Fe(()=>{if(o||!L)return;const K=nt(L),Z=St(K);Cl(Z);function G(te){let{reason:le,event:ge,nested:pe}=te;if(["hover","safe-polygon"].includes(le)&&ge.type==="mouseleave"&&($.current=!0),le==="outside-press")if(pe)$.current=!1;else if(Mr(ge)||Fr(ge))$.current=!1;else{let xe=!1;document.createElement("div").focus({get preventScroll(){return xe=!0,!1}}),xe?$.current=!1:$.current=!0}}m.on("openchange",G);const W=K.createElement("span");W.setAttribute("tabindex","-1"),W.setAttribute("aria-hidden","true"),Object.assign(W.style,Tn),_e&&w&&w.insertAdjacentElement("afterend",W);function ne(){if(typeof z.current=="boolean"){const te=w||li();return te&&te.isConnected?te:W}return z.current.current||W}return()=>{m.off("openchange",G);const te=St(K),le=We(y,te)||E&&Dt(E.nodesRef.current,C(),!1).some(pe=>{var xe;return We((xe=pe.context)==null?void 0:xe.elements.floating,te)}),ge=ne();queueMicrotask(()=>{const pe=Sl(ge);z.current&&!$.current&&Le(pe)&&(!(pe!==te&&te!==K.body)||le)&&pe.focus({preventScroll:!0}),W.remove()})}},[o,y,L,z,b,m,E,_e,w,C]),S.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask($o)}),[o]),Fe(()=>{if(!o&&F)return F.setFocusManagerState({modal:c,closeOnFocusOut:_,open:p,onOpenChange:h,domReference:w}),()=>{F.setFocusManagerState(null)}},[o,F,c,p,h,_,w]),Fe(()=>{o||L&&ci(L,V)},[o,L,V]);function me(K){return o||!f||!c?null:l.jsx(xl,{ref:K==="start"?D:N,onClick:Z=>h(!1,Z.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const Ie=!o&&T&&(c?!M:!0)&&(_e||c);return l.jsxs(l.Fragment,{children:[Ie&&l.jsx(zn,{"data-type":"inside",ref:ye,onFocus:K=>{if(c){const G=Y();Ot(r[0]==="reference"?G[0]:G[G.length-1])}else if(F!=null&&F.preserveTabOrder&&F.portalNode)if($.current=!1,nn(K,F.portalNode)){const G=Pr(w);G?.focus()}else{var Z;(Z=F.beforeOutsideRef.current)==null||Z.focus()}}}),!M&&me("start"),t,me("end"),Ie&&l.jsx(zn,{"data-type":"inside",ref:se,onFocus:K=>{if(c)Ot(Y()[0]);else if(F!=null&&F.preserveTabOrder&&F.portalNode)if(_&&($.current=!0),nn(K,F.portalNode)){const G=Or(w);G?.focus()}else{var Z;(Z=F.afterOutsideRef.current)==null||Z.focus()}}})]})}function ui(e){return Le(e.target)&&e.target.tagName==="BUTTON"}function Il(e){return Le(e.target)&&e.target.tagName==="A"}function di(e){return Er(e)}function El(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:d=!0,ignoreMouse:c=!1,keyboardHandlers:f=!0,stickIfOpen:_=!0}=n,g=S.useRef(),u=S.useRef(!1),p=S.useMemo(()=>({onPointerDown(h){g.current=h.pointerType},onMouseDown(h){const m=g.current;h.button===0&&a!=="click"&&(Nr(m)&&c||(t&&d&&(!(r.current.openEvent&&_)||r.current.openEvent.type==="mousedown")?o(!1,h.nativeEvent,"click"):(h.preventDefault(),o(!0,h.nativeEvent,"click"))))},onClick(h){const m=g.current;if(a==="mousedown"&&g.current){g.current=void 0;return}Nr(m)&&c||(t&&d&&(!(r.current.openEvent&&_)||r.current.openEvent.type==="click")?o(!1,h.nativeEvent,"click"):o(!0,h.nativeEvent,"click"))},onKeyDown(h){g.current=void 0,!(h.defaultPrevented||!f||ui(h))&&(h.key===" "&&!di(i)&&(h.preventDefault(),u.current=!0),!Il(h)&&h.key==="Enter"&&o(!(t&&d),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!f||ui(h)||di(i)||h.key===" "&&u.current&&(u.current=!1,o(!(t&&d),h.nativeEvent,"click"))}}),[r,i,a,c,f,o,t,_,d]);return S.useMemo(()=>s?{reference:p}:{},[s,p])}const kl={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ml={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},fi=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e?.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e?.outsidePress)!=null?t:!0}};function Fl(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:d=!0,outsidePressEvent:c="pointerdown",referencePress:f=!1,referencePressEvent:_="pointerdown",ancestorScroll:g=!1,bubbles:u,capture:p}=n,h=On(),m=Re(typeof d=="function"?d:()=>!1),b=typeof d=="function"?m:d,w=S.useRef(!1),{escapeKey:y,outsidePress:C}=fi(u),{escapeKey:I,outsidePress:x}=fi(p),M=S.useRef(!1),k=Re(E=>{var F;if(!t||!s||!a||E.key!=="Escape"||M.current)return;const D=(F=i.current.floatingContext)==null?void 0:F.nodeId,N=h?Dt(h.nodesRef.current,D):[];if(!y&&(E.stopPropagation(),N.length>0)){let $=!0;if(N.forEach(P=>{var B;if((B=P.context)!=null&&B.open&&!P.context.dataRef.current.__escapeKeyBubbles){$=!1;return}}),!$)return}o(!1,pa(E)?E.nativeEvent:E,"escape-key")}),T=Re(E=>{var F;const D=()=>{var N;k(E),(N=xt(E))==null||N.removeEventListener("keydown",D)};(F=xt(E))==null||F.addEventListener("keydown",D)}),A=Re(E=>{var F;const D=i.current.insideReactTree;i.current.insideReactTree=!1;const N=w.current;if(w.current=!1,c==="click"&&N||D||typeof b=="function"&&!b(E))return;const $=xt(E),P="["+an("inert")+"]",B=nt(r.floating).querySelectorAll(P);let he=Ne($)?$:null;for(;he&&!gt(he);){const Y=_t(he);if(gt(Y)||!Ne(Y))break;he=Y}if(B.length&&Ne($)&&!ga($)&&!We($,r.floating)&&Array.from(B).every(Y=>!We(he,Y)))return;if(Le($)&&z){const Y=gt($),ce=tt($),ve=/auto|scroll/,ye=Y||ve.test(ce.overflowX),se=Y||ve.test(ce.overflowY),me=ye&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Ie=se&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,K=ce.direction==="rtl",Z=Ie&&(K?E.offsetX<=$.offsetWidth-$.clientWidth:E.offsetX>$.clientWidth),G=me&&E.offsetY>$.clientHeight;if(Z||G)return}const _e=(F=i.current.floatingContext)==null?void 0:F.nodeId,L=h&&Dt(h.nodesRef.current,_e).some(Y=>{var ce;return go(E,(ce=Y.context)==null?void 0:ce.elements.floating)});if(go(E,r.floating)||go(E,r.domReference)||L)return;const re=h?Dt(h.nodesRef.current,_e):[];if(re.length>0){let Y=!0;if(re.forEach(ce=>{var ve;if((ve=ce.context)!=null&&ve.open&&!ce.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}o(!1,E,"outside-press")}),V=Re(E=>{var F;const D=()=>{var N;A(E),(N=xt(E))==null||N.removeEventListener(c,D)};(F=xt(E))==null||F.addEventListener(c,D)});S.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=C;let E=-1;function F(B){o(!1,B,"ancestor-scroll")}function D(){window.clearTimeout(E),M.current=!0}function N(){E=window.setTimeout(()=>{M.current=!1},bn()?5:0)}const $=nt(r.floating);a&&($.addEventListener("keydown",I?T:k,I),$.addEventListener("compositionstart",D),$.addEventListener("compositionend",N)),b&&$.addEventListener(c,x?V:A,x);let P=[];return g&&(Ne(r.domReference)&&(P=yt(r.domReference)),Ne(r.floating)&&(P=P.concat(yt(r.floating))),!Ne(r.reference)&&r.reference&&r.reference.contextElement&&(P=P.concat(yt(r.reference.contextElement)))),P=P.filter(B=>{var he;return B!==((he=$.defaultView)==null?void 0:he.visualViewport)}),P.forEach(B=>{B.addEventListener("scroll",F,{passive:!0})}),()=>{a&&($.removeEventListener("keydown",I?T:k,I),$.removeEventListener("compositionstart",D),$.removeEventListener("compositionend",N)),b&&$.removeEventListener(c,x?V:A,x),P.forEach(B=>{B.removeEventListener("scroll",F)}),window.clearTimeout(E)}},[i,r,a,b,c,t,o,g,s,y,C,k,I,T,A,x,V]),S.useEffect(()=>{i.current.insideReactTree=!1},[i,b,c]);const U=S.useMemo(()=>({onKeyDown:k,...f&&{[kl[_]]:E=>{o(!1,E.nativeEvent,"reference-press")},..._!=="click"&&{onClick(E){o(!1,E.nativeEvent,"reference-press")}}}}),[k,o,f,_]),z=S.useMemo(()=>({onKeyDown:k,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Ml[c]]:()=>{i.current.insideReactTree=!0}}),[k,c,i]);return S.useMemo(()=>s?{reference:U,floating:z}:{},[s,U,z])}function Nl(e){const{open:n=!1,onOpenChange:t,elements:o}=e,r=wo(),i=S.useRef({}),[s]=S.useState(()=>fl()),a=Co()!=null;if(process.env.NODE_ENV!=="production"){const u=o.reference;u&&!Ne(u)&&dl("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,c]=S.useState(o.reference),f=Re((u,p,h)=>{i.current.openEvent=u?p:void 0,s.emit("openchange",{open:u,event:p,reason:h,nested:a}),t?.(u,p,h)}),_=S.useMemo(()=>({setPositionReference:c}),[]),g=S.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return S.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:g,events:s,floatingId:r,refs:_}),[n,f,g,s,r,_])}function Al(e){e===void 0&&(e={});const{nodeId:n}=e,t=Nl({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,r=o.elements,[i,s]=S.useState(null),[a,d]=S.useState(null),f=r?.domReference||i,_=S.useRef(null),g=On();Fe(()=>{f&&(_.current=f)},[f]);const u=nl({...e,elements:{...r,...a&&{reference:a}}}),p=S.useCallback(y=>{const C=Ne(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;d(C),u.refs.setReference(C)},[u.refs]),h=S.useCallback(y=>{(Ne(y)||y===null)&&(_.current=y,s(y)),(Ne(u.refs.reference.current)||u.refs.reference.current===null||y!==null&&!Ne(y))&&u.refs.setReference(y)},[u.refs]),m=S.useMemo(()=>({...u.refs,setReference:h,setPositionReference:p,domReference:_}),[u.refs,h,p]),b=S.useMemo(()=>({...u.elements,domReference:f}),[u.elements,f]),w=S.useMemo(()=>({...u,...o,refs:m,elements:b,nodeId:n}),[u,m,b,n,o]);return Fe(()=>{o.dataRef.current.floatingContext=w;const y=g?.nodesRef.current.find(C=>C.id===n);y&&(y.context=w)}),S.useMemo(()=>({...u,context:w,refs:m,elements:b}),[u,m,b,w])}function Io(e,n,t){const o=new Map,r=t==="item";let i=e;if(r&&e){const{[Xr]:s,[Yr]:a,...d}=e;i=d}return{...t==="floating"&&{tabIndex:-1,[al]:""},...i,...n.map(s=>{const a=s?s[t]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(d=>{let[c,f]=d;if(!(r&&[Xr,Yr].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof f=="function"){var _;(_=o.get(c))==null||_.push(f),s[c]=function(){for(var g,u=arguments.length,p=new Array(u),h=0;h<u;h++)p[h]=arguments[h];return(g=o.get(c))==null?void 0:g.map(m=>m(...p)).find(m=>m!==void 0)}}}else s[c]=f}),s),{})}}function Dl(e){e===void 0&&(e=[]);const n=e.map(a=>a?.reference),t=e.map(a=>a?.floating),o=e.map(a=>a?.item),r=S.useCallback(a=>Io(a,e,"reference"),n),i=S.useCallback(a=>Io(a,e,"floating"),t),s=S.useCallback(a=>Io(a,e,"item"),o);return S.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}const Pl="Escape";function Rn(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function qn(e,n){return Rn(n,e===Zr||e===Pn,e===on||e===rn)}function Eo(e,n,t){return Rn(n,e===Pn,t?e===on:e===rn)||e==="Enter"||e===" "||e===""}function gi(e,n,t){return Rn(n,t?e===on:e===rn,e===Pn)}function _i(e,n,t,o){const r=t?e===rn:e===on,i=e===Zr;return n==="both"||n==="horizontal"&&o&&o>1?e===Pl:Rn(n,r,i)}function Ol(e,n){const{open:t,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:s,activeIndex:a,onNavigate:d=()=>{},enabled:c=!0,selectedIndex:f=null,allowEscape:_=!1,loop:g=!1,nested:u=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:m="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:y=void 0,orientation:C="vertical",parentOrientation:I,cols:x=1,scrollItemIntoView:M=!0,virtualItemRef:k,itemSizes:T,dense:A=!1}=n;process.env.NODE_ENV!=="production"&&(_&&(g||yo("`useListNavigation` looping must be enabled to allow escaping."),h||yo("`useListNavigation` must be virtual to allow escaping.")),C==="vertical"&&x>1&&yo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const V=kn(r.floating),U=Ke(V),z=Co(),E=On();Fe(()=>{e.dataRef.current.orientation=C},[e,C]);const F=Re(()=>{d($.current===-1?null:$.current)}),D=_o(r.domReference),N=S.useRef(m),$=S.useRef(f??-1),P=S.useRef(null),B=S.useRef(!0),he=S.useRef(F),_e=S.useRef(!!r.floating),L=S.useRef(t),re=S.useRef(!1),Y=S.useRef(!1),ce=Ke(y),ve=Ke(t),ye=Ke(M),se=Ke(f),[me,Ie]=S.useState(),[K,Z]=S.useState(),G=Re(()=>{function R(fe){if(h){var Ce;(Ce=fe.id)!=null&&Ce.endsWith("-fui-option")&&(fe.id=i+"-"+Math.random().toString(16).slice(2,10)),Ie(fe.id),E?.events.emit("virtualfocus",fe),k&&(k.current=fe)}else Ot(fe,{sync:re.current,preventScroll:!0})}const ee=s.current[$.current],O=Y.current;ee&&R(ee),(re.current?fe=>fe():requestAnimationFrame)(()=>{const fe=s.current[$.current]||ee;if(!fe)return;ee||R(fe);const Ce=ye.current;Ce&&ne&&(O||!B.current)&&(fe.scrollIntoView==null||fe.scrollIntoView(typeof Ce=="boolean"?{block:"nearest",inline:"nearest"}:Ce))})});Fe(()=>{c&&(t&&r.floating?N.current&&f!=null&&(Y.current=!0,$.current=f,F()):_e.current&&($.current=-1,he.current()))},[c,t,r.floating,f,F]),Fe(()=>{if(c&&t&&r.floating)if(a==null){if(re.current=!1,se.current!=null)return;if(_e.current&&($.current=-1,G()),(!L.current||!_e.current)&&N.current&&(P.current!=null||N.current===!0&&P.current==null)){let R=0;const ee=()=>{s.current[0]==null?(R<2&&(R?requestAnimationFrame:queueMicrotask)(ee),R++):($.current=P.current==null||Eo(P.current,C,p)||u?po(s,ce.current):Ar(s,ce.current),P.current=null,F())};ee()}}else en(s,a)||($.current=a,G(),Y.current=!1)},[c,t,r.floating,a,se,u,s,C,p,F,G,ce]),Fe(()=>{var R;if(!c||r.floating||!E||h||!_e.current)return;const ee=E.nodesRef.current,O=(R=ee.find(Ce=>Ce.id===z))==null||(R=R.context)==null?void 0:R.elements.floating,ae=St(nt(r.floating)),fe=ee.some(Ce=>Ce.context&&We(Ce.context.elements.floating,ae));O&&!fe&&B.current&&O.focus({preventScroll:!0})},[c,r.floating,E,z,h]),Fe(()=>{if(!c||!E||!h||z)return;function R(ee){Z(ee.id),k&&(k.current=ee)}return E.events.on("virtualfocus",R),()=>{E.events.off("virtualfocus",R)}},[c,E,h,z,k]),Fe(()=>{he.current=F,L.current=t,_e.current=!!r.floating}),Fe(()=>{t||(P.current=null,N.current=m)},[t,m]);const W=a!=null,ne=S.useMemo(()=>{function R(O){if(!ve.current)return;const ae=s.current.indexOf(O);ae!==-1&&$.current!==ae&&($.current=ae,F())}return{onFocus(O){let{currentTarget:ae}=O;re.current=!0,R(ae)},onClick:O=>{let{currentTarget:ae}=O;return ae.focus({preventScroll:!0})},onMouseMove(O){let{currentTarget:ae}=O;re.current=!0,Y.current=!1,b&&R(ae)},onPointerLeave(O){let{pointerType:ae}=O;if(!(!B.current||ae==="touch")&&(re.current=!0,!!b&&($.current=-1,F(),!h))){var fe;(fe=U.current)==null||fe.focus({preventScroll:!0})}}}},[ve,U,b,s,F,h]),te=S.useCallback(()=>{var R;return I??(E==null||(R=E.nodesRef.current.find(ee=>ee.id===z))==null||(R=R.context)==null||(R=R.dataRef)==null?void 0:R.current.orientation)},[z,E,I]),le=Re(R=>{if(B.current=!1,re.current=!0,R.which===229||!ve.current&&R.currentTarget===U.current)return;if(u&&_i(R.key,C,p,x)){qn(R.key,te())||ze(R),o(!1,R.nativeEvent,"list-navigation"),Le(r.domReference)&&(h?E?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const ee=$.current,O=po(s,y),ae=Ar(s,y);if(D||(R.key==="Home"&&(ze(R),$.current=O,F()),R.key==="End"&&(ze(R),$.current=ae,F())),x>1){const fe=T||Array.from({length:s.current.length},()=>({width:1,height:1})),Ce=ya(fe,x,A),Be=Ce.findIndex(oe=>oe!=null&&!Fn(s,oe,y)),Je=Ce.reduce((oe,Ae,ue)=>Ae!=null&&!Fn(s,Ae,y)?ue:oe,-1),Ge=Ce[wa({current:Ce.map(oe=>oe!=null?s.current[oe]:null)},{event:R,orientation:C,loop:g,rtl:p,cols:x,disabledIndices:Sa([...(typeof y!="function"?y:null)||s.current.map((oe,Ae)=>Fn(s,Ae,y)?Ae:void 0),void 0],Ce),minIndex:Be,maxIndex:Je,prevIndex:Ca($.current>ae?O:$.current,fe,Ce,x,R.key===Pn?"bl":R.key===(p?on:rn)?"tr":"tl"),stopEvent:!0})];if(Ge!=null&&($.current=Ge,F()),C==="both")return}if(qn(R.key,C)){if(ze(R),t&&!h&&St(R.currentTarget.ownerDocument)===R.currentTarget){$.current=Eo(R.key,C,p)?O:ae,F();return}Eo(R.key,C,p)?g?$.current=ee>=ae?_&&ee!==s.current.length?-1:O:qe(s,{startingIndex:ee,disabledIndices:y}):$.current=Math.min(ae,qe(s,{startingIndex:ee,disabledIndices:y})):g?$.current=ee<=O?_&&ee!==-1?s.current.length:ae:qe(s,{startingIndex:ee,decrement:!0,disabledIndices:y}):$.current=Math.max(O,qe(s,{startingIndex:ee,decrement:!0,disabledIndices:y})),en(s,$.current)&&($.current=-1),F()}}),ge=S.useMemo(()=>h&&t&&W&&{"aria-activedescendant":K||me},[h,t,W,K,me]),pe=S.useMemo(()=>({"aria-orientation":C==="both"?void 0:C,...D?{}:ge,onKeyDown:le,onPointerMove(){B.current=!0}}),[ge,le,C,D]),xe=S.useMemo(()=>{function R(O){m==="auto"&&Mr(O.nativeEvent)&&(N.current=!0)}function ee(O){N.current=m,m==="auto"&&Fr(O.nativeEvent)&&(N.current=!0)}return{...ge,onKeyDown(O){B.current=!1;const ae=O.key.startsWith("Arrow"),fe=["Home","End"].includes(O.key),Ce=ae||fe,Be=gi(O.key,C,p),Je=_i(O.key,C,p,x),Ge=gi(O.key,te(),p),oe=qn(O.key,C),Ae=(u?Ge:oe)||O.key==="Enter"||O.key.trim()==="";if(h&&t){const Ue=E?.nodesRef.current.find(de=>de.parentId==null),q=E&&Ue?_a(E.nodesRef.current,Ue.id):null;if(Ce&&q&&k){const de=new KeyboardEvent("keydown",{key:O.key,bubbles:!0});if(Be||Je){var ue,Ee;const De=((ue=q.context)==null?void 0:ue.elements.domReference)===O.currentTarget,Te=Je&&!De?(Ee=q.context)==null?void 0:Ee.elements.domReference:Be?s.current.find(at=>at?.id===me):null;Te&&(ze(O),Te.dispatchEvent(de),Z(void 0))}if((oe||fe)&&q.context&&q.context.open&&q.parentId&&O.currentTarget!==q.context.elements.domReference){var bt;ze(O),(bt=q.context.elements.domReference)==null||bt.dispatchEvent(de);return}}return le(O)}if(!(!t&&!w&&ae)){if(Ae){const Ue=qn(O.key,te());P.current=u&&Ue?null:O.key}if(u){Ge&&(ze(O),t?($.current=po(s,ce.current),F()):o(!0,O.nativeEvent,"list-navigation"));return}oe&&(f!=null&&($.current=f),ze(O),!t&&w?o(!0,O.nativeEvent,"list-navigation"):le(O),t&&F())}},onFocus(){t&&!h&&($.current=-1,F())},onPointerDown:ee,onPointerEnter:ee,onMouseDown:R,onClick:R}},[me,ge,x,le,ce,m,s,u,F,o,t,w,C,te,p,f,E,h,k]);return S.useMemo(()=>c?{reference:xe,floating:pe,item:ne}:{},[c,xe,pe,ne])}const Vl=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ll(e,n){var t,o;n===void 0&&(n={});const{open:r,elements:i,floatingId:s}=e,{enabled:a=!0,role:d="dialog"}=n,c=wo(),f=((t=i.domReference)==null?void 0:t.id)||c,_=S.useMemo(()=>{var w;return((w=kn(i.floating))==null?void 0:w.id)||s},[i.floating,s]),g=(o=Vl.get(d))!=null?o:d,p=Co()!=null,h=S.useMemo(()=>g==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?_:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":r?_:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:f},...g==="menu"&&p&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[g,_,p,r,f,d]),m=S.useMemo(()=>{const w={id:_,...g&&{role:g}};return g==="tooltip"||d==="label"?w:{...w,...g==="menu"&&{"aria-labelledby":f}}},[g,_,f,d]),b=S.useCallback(w=>{let{active:y,selected:C}=w;const I={role:"option",...y&&{id:_+"-fui-option"}};switch(d){case"select":case"combobox":return{...I,"aria-selected":C}}return{}},[_,d]);return S.useMemo(()=>a?{reference:h,floating:m,item:b}:{},[a,h,m,b])}const pi=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function Ht(e,n){return typeof e=="function"?e(n):e}function Tl(e,n){const[t,o]=S.useState(e);return e&&!t&&o(!0),S.useEffect(()=>{if(!e&&t){const r=setTimeout(()=>o(!1),n);return()=>clearTimeout(r)}},[e,t,n]),t}function zl(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:r=250}=n,s=(typeof r=="number"?r:r.close)||0,[a,d]=S.useState("unmounted"),c=Tl(t,s);return!c&&a==="close"&&d("unmounted"),Fe(()=>{if(o){if(t){d("initial");const f=requestAnimationFrame(()=>{Jn.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[t,o]),{isMounted:c,status:a}}function Rl(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:r,common:i,duration:s=250}=n,a=e.placement,d=a.split("-")[0],c=S.useMemo(()=>({side:d,placement:a}),[d,a]),f=typeof s=="number",_=(f?s:s.open)||0,g=(f?s:s.close)||0,[u,p]=S.useState(()=>({...Ht(i,c),...Ht(t,c)})),{isMounted:h,status:m}=zl(e,{duration:s}),b=Ke(t),w=Ke(o),y=Ke(r),C=Ke(i);return Fe(()=>{const I=Ht(b.current,c),x=Ht(y.current,c),M=Ht(C.current,c),k=Ht(w.current,c)||Object.keys(I).reduce((T,A)=>(T[A]="",T),{});if(m==="initial"&&p(T=>({transitionProperty:T.transitionProperty,...M,...I})),m==="open"&&p({transitionProperty:Object.keys(k).map(pi).join(","),transitionDuration:_+"ms",...M,...k}),m==="close"){const T=x||I;p({transitionProperty:Object.keys(T).map(pi).join(","),transitionDuration:g+"ms",...M,...T})}},[g,y,b,w,C,_,m,c]),{isMounted:h,styles:u}}function ql(e,n){var t;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:d,enabled:c=!0,findMatch:f=null,resetMs:_=750,ignoreKeys:g=[],selectedIndex:u=null}=n,p=S.useRef(-1),h=S.useRef(""),m=S.useRef((t=u??s)!=null?t:-1),b=S.useRef(null),w=Re(a),y=Re(d),C=Ke(f),I=Ke(g);Fe(()=>{o&&(So(p),b.current=null,h.current="")},[o]),Fe(()=>{if(o&&h.current===""){var A;m.current=(A=u??s)!=null?A:-1}},[o,u,s]);const x=Re(A=>{A?r.current.typing||(r.current.typing=A,y(A)):r.current.typing&&(r.current.typing=A,y(A))}),M=Re(A=>{function V(D,N,$){const P=C.current?C.current(N,$):N.find(B=>B?.toLocaleLowerCase().indexOf($.toLocaleLowerCase())===0);return P?D.indexOf(P):-1}const U=i.current;if(h.current.length>0&&h.current[0]!==" "&&(V(U,U,h.current)===-1?x(!1):A.key===" "&&ze(A)),U==null||I.current.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;o&&A.key!==" "&&(ze(A),x(!0)),U.every(D=>{var N,$;return D?((N=D[0])==null?void 0:N.toLocaleLowerCase())!==(($=D[1])==null?void 0:$.toLocaleLowerCase()):!0})&&h.current===A.key&&(h.current="",m.current=b.current),h.current+=A.key,So(p),p.current=window.setTimeout(()=>{h.current="",m.current=b.current,x(!1)},_);const E=m.current,F=V(U,[...U.slice((E||0)+1),...U.slice(0,(E||0)+1)],h.current);F!==-1?(w(F),b.current=F):A.key!==" "&&(h.current="",x(!1))}),k=S.useMemo(()=>({onKeyDown:M}),[M]),T=S.useMemo(()=>({onKeyDown:M,onKeyUp(A){A.key===" "&&x(!1)}}),[M,x]);return S.useMemo(()=>c?{reference:k,floating:T}:{},[c,k,T])}function Gt(e,n,t){let o=t.initialDeps??[],r;function i(){var s,a,d,c;let f;t.key&&((s=t.debug)!=null&&s.call(t))&&(f=Date.now());const _=e();if(!(_.length!==o.length||_.some((p,h)=>o[h]!==p)))return r;o=_;let u;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now()),r=n(..._),t.key&&((d=t.debug)!=null&&d.call(t))){const p=Math.round((Date.now()-f)*100)/100,h=Math.round((Date.now()-u)*100)/100,m=h/16,b=(w,y)=>{for(w=String(w);w.length<y;)w=" "+w;return w};console.info(`%c⏱ ${b(h,5)} /${b(p,5)} ms`,`
|
|
5
5
|
font-size: .6rem;
|
|
6
6
|
font-weight: bold;
|
|
7
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(u=t==null?void 0:t.onChange)==null||u.call(t,r),r}return i.updateDeps=s=>{o=s},i}function pi(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Rl=(e,n)=>Math.abs(e-n)<1.01,ql=(e,n,t)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,r),t)}},hi=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},jl=e=>e,Bl=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=n;r<=t;r++)o.push(r);return o},Hl=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const r=s=>{const{width:a,height:d}=s;n({width:Math.round(a),height:Math.round(d)})};if(r(hi(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const a=()=>{const d=s[0];if(d!=null&&d.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(hi(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},mi={passive:!0},vi=typeof window>"u"?!0:"onscrollend"in window,Gl=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&vi?()=>{}:ql(o,()=>{n(r,!1)},e.options.isScrollingResetDelay),s=f=>()=>{const{horizontal:h,isRtl:g}=e.options;r=h?t.scrollLeft*(g&&-1||1):t.scrollTop,i(),n(r,f)},a=s(!0),d=s(!1);d(),t.addEventListener("scroll",a,mi);const u=e.options.useScrollendEvent&&vi;return u&&t.addEventListener("scrollend",d,mi),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",d)}},Wl=(e,n,t)=>{if(n!=null&&n.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Ul=(e,{adjustments:n=0,behavior:t},o)=>{var r,i;const s=e+n;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class Kl{constructor(n){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 t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),t=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,r])=>{typeof r>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jl,rangeExtractor:Bl,onChange:()=>{},measureElement:Wl,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,...t}},this.notify=t=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,t)},this.maybeNotify=Gt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{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(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,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=(t,o)=>{const r=new Map,i=new Map;for(let s=o-1;s>=0;s--){const a=t[s];if(r.has(a.lane))continue;const d=i.get(a.lane);if(d==null||a.end>d.end?i.set(a.lane,a):a.end<d.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Gt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,r,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=Gt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s},a)=>{if(!s)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 d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<t;f++){const h=i(f),g=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),c=g?g.end+this.options.gap:o+r,p=a.get(h),_=typeof p=="number"?p:this.options.estimateSize(f),m=c+_,b=g?g.lane:f%this.options.lanes;u[f]={index:f,start:c,size:_,end:m,key:h,lane:b}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Gt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,r,i)=>this.range=t.length>0&&o>0?Xl({measurements:t,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Gt(()=>{let t=null,o=null;const r=this.calculateRange();return r&&(t=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,r,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,r=t.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const r=this.indexFromElement(t),i=this.measurementsCache[r];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const r=this.measurementsCache[t];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=Gt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const r=[];for(let i=0,s=t.length;i<s;i++){const a=t[i],d=o[a];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return pi(o[bi(0,o.length-1,r=>pi(o[r]).start,t)])},this.getOffsetForAlignment=(t,o,r=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(r-i)/2:o==="end"&&(t-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(r.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=s+this.options.scrollPaddingStart)o="start";else return[s,o];const a=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const s=10,a=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(t,u);if(!f){console.warn("Failed to get offset for index:",t);return}const[h,g]=f;this._scrollToOffset(h,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),p=this.getOffsetForIndex(t,g);if(!p){console.warn("Failed to get offset for index:",t);return}Rl(p[0],c)||d(g)})},d=u=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${t} after ${s} attempts.`))};a(o)},this.scrollBy=(t,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=o[o.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=o.length-1;for(;s>=0&&i.some(a=>a===null);){const a=o[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}r=Math.max(...i.filter(a=>a!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const bi=(e,n,t,o)=>{for(;e<=n;){const r=(e+n)/2|0,i=t(r);if(i<o)e=r+1;else if(i>o)n=r-1;else return r}return e>0?e-1:0};function Xl({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let s=bi(0,r,i,t),a=s;if(o===1)for(;a<r&&e[a].end<t+n;)a++;else if(o>1){const d=Array(o).fill(0);for(;a<r&&d.some(f=>f<t+n);){const f=e[a];d[f.lane]=f.end,a++}const u=Array(o).fill(t+n);for(;s>=0&&u.some(f=>f>=t);){const f=e[s];u[f.lane]=f.start,s--}s=Math.max(0,s-s%o),a=Math.min(r,a+(o-1-a%o))}return{startIndex:s,endIndex:a}}const wi=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Yl(e){const n=I.useReducer(()=>({}),{})[1],t={...e,onChange:(r,i)=>{var s;i?Zn.flushSync(n):n(),(s=e.onChange)==null||s.call(e,r,i)}},[o]=I.useState(()=>new Kl(t));return o.setOptions(t),wi(()=>o._didMount(),[]),wi(()=>o._willUpdate()),o}function Zl(e){return Yl({observeElementRect:Hl,observeElementOffset:Gl,scrollToFn:Ul,...e})}function Jl(e,n){const[t,o]=I.useState(e);return I.useEffect(()=>{const r=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(r)}},[e,n]),t}function jn(e){const n=I.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return I.useSyncExternalStore(n,t,o)}const yi=({size:e="1em",...n})=>l.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",...n,children:l.jsx("path",{d:"m6 9 6 6 6-6"})}),Ci=({size:e="1em",...n})=>l.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",...n,children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]}),Ql=({size:e="1em",...n})=>l.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",...n,children:l.jsx("path",{d:"M20 6 9 17l-5-5"})}),ec=({size:e="1em",...n})=>l.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",...n,children:[l.jsx("circle",{cx:"11",cy:"11",r:"8"}),l.jsx("path",{d:"m21 21-4.3-4.3"})]}),tc=({size:e="1em",...n})=>l.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",...n,children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})});function Bn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Wt(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function ln(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Si(e,n,t,o){if(!n)return!1;const r=Wt(e,o);return t&&Array.isArray(n)?n.some(i=>Wt(i,o)===r):Wt(n,o)===r}function ko(e,n,t,o){if(!n.trim())return e;const r=n.toLowerCase().trim();return o?e.filter(i=>o(i,n)):e.filter(i=>Bn(i,t).toLowerCase().includes(r))}function xi(e){if(e.length===0)return!1;const n=e[0];return typeof n=="object"&&n!==null&&"grupo"in n&&"opciones"in n&&Array.isArray(n.opciones)}function $i(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const r of o.opciones)n.push({tipo:"opcion",datos:r,indice:t++})}return n}function Ii(e,n,t,o){return n.trim()?e.map(r=>({...r,opciones:ko(r.opciones,n,t,o)})).filter(r=>r.opciones.length>0):e}function nc(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&ln(n.datos)?t:null).filter(n=>n!==null)}function oc(e,n){if(!n)return null;const t=n(e);return t===!0||t==null?null:typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message??"Selección inválida":"Selección inválida"}function rc(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function ic(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function sc(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const G={contenedor_base:"_contenedor_base_wsyf6_1",tam_sm:"_tam_sm_wsyf6_39",tam_lg:"_tam_lg_wsyf6_53",radio_none:"_radio_none_wsyf6_67",radio_sm:"_radio_sm_wsyf6_75",radio_md:"_radio_md_wsyf6_83",radio_lg:"_radio_lg_wsyf6_91",radio_full:"_radio_full_wsyf6_99",color_default:"_color_default_wsyf6_107",color_primary:"_color_primary_wsyf6_109",color_secondary:"_color_secondary_wsyf6_117",color_success:"_color_success_wsyf6_125",color_warning:"_color_warning_wsyf6_133",color_danger:"_color_danger_wsyf6_141",etiqueta:"_etiqueta_wsyf6_149",marca_requerido:"_marca_requerido_wsyf6_167",trigger:"_trigger_wsyf6_193",variante_bordered:"_variante_bordered_wsyf6_223",variante_faded:"_variante_faded_wsyf6_233",variante_underlined:"_variante_underlined_wsyf6_243",variante_ghost:"_variante_ghost_wsyf6_259",deshabilitado:"_deshabilitado_wsyf6_271",solo_lectura:"_solo_lectura_wsyf6_291",abierto:"_abierto_wsyf6_301",valido:"_valido_wsyf6_309",invalido:"_invalido_wsyf6_317",contenido_inicio:"_contenido_inicio_wsyf6_369",contenido_final:"_contenido_final_wsyf6_371",valor_wrapper:"_valor_wrapper_wsyf6_389",valor_texto:"_valor_texto_wsyf6_409",placeholder:"_placeholder_wsyf6_429",chip_multi:"_chip_multi_wsyf6_439",chip_texto:"_chip_texto_wsyf6_473",chip_cerrar:"_chip_cerrar_wsyf6_485",contador_multi:"_contador_multi_wsyf6_525",acciones:"_acciones_wsyf6_539",boton_limpiar:"_boton_limpiar_wsyf6_553",tiene_valor:"_tiene_valor_wsyf6_605",icono_chevron:"_icono_chevron_wsyf6_615",icono_spinner:"_icono_spinner_wsyf6_637",girarSpinner:"_girarSpinner_wsyf6_1",menu:"_menu_wsyf6_671",buscador_wrapper:"_buscador_wrapper_wsyf6_697",buscador_interno:"_buscador_interno_wsyf6_709",icono_buscar:"_icono_buscar_wsyf6_739",input_busqueda:"_input_busqueda_wsyf6_751",lista_opciones:"_lista_opciones_wsyf6_783",lista_virtual:"_lista_virtual_wsyf6_807",contenedor_virtual:"_contenedor_virtual_wsyf6_815",encabezado_grupo:"_encabezado_grupo_wsyf6_823",opcion:"_opcion_wsyf6_855",opcion_virtual:"_opcion_virtual_wsyf6_881",activo:"_activo_wsyf6_889",seleccionado:"_seleccionado_wsyf6_897",opcion_check:"_opcion_check_wsyf6_929",opcion_contenido:"_opcion_contenido_wsyf6_957",sin_resultados:"_sin_resultados_wsyf6_973",descripcion:"_descripcion_wsyf6_987",mensaje_error:"_mensaje_error_wsyf6_999",ancho_total:"_ancho_total_wsyf6_1011",sin_animacion:"_sin_animacion_wsyf6_1019",contenedor_nativo:"_contenedor_nativo_wsyf6_1029",select_nativo:"_select_nativo_wsyf6_1037"};function ac(e){const{options:n=[],value:t,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:s="id",label:a,placeholder:d="Seleccione una opción",description:u,errorMessage:f,isRequired:h=!1,isInvalid:g,id:c,name:p,classNames:_,startContent:m,endContent:b,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:S,renderizarValorMostrado:x}=e,y=v.useId(),M=c??`select-nativo-${y}`,E=u?`${M}-desc`:void 0,T=w?`${M}-err`:void 0,F=v.useCallback(O=>Bn(O,i),[i]),P=v.useCallback(O=>Wt(O,s),[s]),U=v.useCallback(O=>{o==null||o(O),r==null||r(O)},[o,r]),z=v.useCallback(O=>{const D=O.target.value;if(!D){U(null);return}const $=n.find(N=>P(N)===D);$&&U($)},[n,P,U]),k=typeof g=="string"?g:null,A=typeof f=="function"?f({invalido:w,mensaje:k}):f??k;return l.jsxs("div",{className:S,children:[a&&l.jsxs("label",{className:W(G.etiqueta,_==null?void 0:_.label),htmlFor:M,children:[a,h&&l.jsx("span",{className:G.marca_requerido,children:"*"})]}),l.jsxs("div",{className:G.contenedor_nativo,children:[l.jsxs("div",{className:W(G.trigger,_==null?void 0:_.trigger),children:[m&&l.jsx("span",{className:G.contenido_inicio,children:m}),l.jsx("div",{className:W(G.valor_wrapper,_==null?void 0:_.value),children:x()}),l.jsxs("div",{className:G.acciones,children:[b&&l.jsx("span",{className:G.contenido_final,children:b}),l.jsx("span",{className:G.icono_chevron,children:l.jsx(yi,{size:"1em"})})]})]}),l.jsxs("select",{id:M,name:p,className:G.select_nativo,value:t?P(t):"",onChange:z,disabled:C,required:h,children:[l.jsx("option",{value:"",children:d}),n.map(O=>l.jsx("option",{value:P(O),disabled:ln(O),children:F(O)},P(O)))]})]}),u&&!w&&l.jsx("div",{id:E,className:W(G.descripcion,_==null?void 0:_.description),children:u}),w&&A&&l.jsx("div",{id:T,className:W(G.mensaje_error,_==null?void 0:_.errorMessage),children:A})]})}const lc="(max-width: 768px)";function cc(e,n){const{options:t=[],value:o,defaultValue:r,onChange:i,onValueChange:s,optionLabelKey:a="label",optionValueKey:d="id",renderOption:u,renderValue:f,variant:h="bordered",color:g="default",size:c="md",radius:p="md",fullWidth:_=!0,disableAnimation:m=!1,label:b,placeholder:w="Seleccione una opción",description:C,errorMessage:S,emptyMessage:x="No hay opciones",noResultsMessage:y="Sin resultados",isRequired:M=!1,isDisabled:E=!1,isReadOnly:T=!1,isLoading:F=!1,isClearable:P=!0,isInvalid:U,validationState:z,isMultiple:k=!1,isSearchable:A=!1,isVirtualized:O=!1,estimatedOptionHeight:D=36,filterFn:$,validate:N,onOpen:j,onClose:_e,onSearchChange:fe,onClear:L,onFocus:re,onBlur:Z,id:ue,name:we,className:ye,classNames:B,startContent:pe,endContent:Ee,menuZIndex:K,portalContainer:J}=e,X=v.useRef(null),Y=v.useRef([]),oe=v.useRef(null),te=v.useRef(null),se=v.useId(),de=ue??`select-${se}`,$e=jn(lc)&&!A&&!k,[R,ne]=v.useState(!1),[V,ae]=v.useState(null),[he,Ce]=v.useState(""),Be=o!==void 0,[Je,Ge]=v.useState(r??null),ie=Be?o:Je,Oe=E||F,le=v.useCallback(H=>Bn(H,a),[a]),ke=v.useCallback(H=>Wt(H,d),[d]),wt=v.useCallback(H=>Si(H,ie,k,d),[ie,k,d]),Ke=v.useMemo(()=>xi(t),[t]),q=v.useMemo(()=>!A||!he.trim()?t:Ke?Ii(t,he,a,$):ko(t,he,a,$),[t,he,A,$,a,Ke]),ge=v.useMemo(()=>Ke?$i(q):q.map((H,Se)=>({tipo:"opcion",datos:H,indice:Se})),[q,Ke]),Pe=v.useMemo(()=>oc(ie,N),[ie,N]),Te=v.useMemo(()=>rc(U,z,Pe),[U,z,Pe]),at=z==="valid"&&!Te,{refs:At,floatingStyles:Qe,context:et}=Fl({open:R,onOpenChange:H=>{Oe||T||(ne(H),H?(j==null||j(),Ce(""),ae(null)):_e==null||_e())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[tl(4),ol({padding:8}),nl({padding:8}),rl({apply({rects:H,elements:Se}){Object.assign(Se.floating.style,{width:`${H.reference.width}px`})},padding:8})],whileElementsMounted:Wa}),{isMounted:rt,styles:Ko}=Tl(et,{duration:m?0:150,initial:{opacity:0,transform:"translateY(-4px)"},open:{opacity:1,transform:"translateY(0)"},close:{opacity:0,transform:"translateY(-4px)"},common:{transformOrigin:"top"}}),Kn=Zl({count:ge.length,getScrollElement:()=>oe.current,estimateSize:H=>{var Se;return((Se=ge[H])==null?void 0:Se.tipo)==="grupo"?32:D},overscan:5,enabled:O&&R}),Ru=$l(et,{enabled:!Oe&&!T}),qu=kl(et),ju=Nl(et,{role:"listbox"}),Bu=v.useMemo(()=>nc(ge),[ge]),Hu=Ol(et,{listRef:Y,activeIndex:V,onNavigate:ae,loop:!0,virtual:O,disabledIndices:Bu}),Yi=v.useRef([]);v.useEffect(()=>{Yi.current=ge.map(H=>H.tipo==="opcion"&&H.datos?le(H.datos):null)},[ge,le]);const Gu=zl(et,{listRef:Yi,activeIndex:V,onMatch:R?ae:void 0,enabled:!A}),{getReferenceProps:Wu,getFloatingProps:Uu,getItemProps:Zi}=Al([Ru,qu,ju,Hu,Gu]),Dt=v.useCallback(H=>{Be||Ge(H),i==null||i(H),s==null||s(H)},[Be,i,s]),Xn=v.useCallback(H=>{if(!ln(H))if(k){const Se=Array.isArray(ie)?ie:[],dt=Se.some(it=>ke(it)===ke(H));Dt(dt?Se.filter(it=>ke(it)!==ke(H)):[...Se,H])}else Dt(H),ne(!1)},[k,ie,ke,Dt]),Ku=v.useCallback(H=>{var Se;H.stopPropagation(),Dt(k?[]:null),L==null||L(),(Se=X.current)==null||Se.focus()},[k,Dt,L]),Ji=v.useCallback((H,Se)=>{Se.stopPropagation(),!(!k||!Array.isArray(ie))&&Dt(ie.filter(dt=>ke(dt)!==ke(H)))},[k,ie,ke,Dt]),Xu=v.useCallback(H=>{Ce(H.target.value),fe==null||fe(H.target.value),ae(0)},[fe]),Yu=v.useCallback(H=>{if(H.key==="Enter"&&V!==null){H.preventDefault();const Se=ge[V];(Se==null?void 0:Se.tipo)==="opcion"&&Se.datos&&Xn(Se.datos)}},[V,ge,Xn]);v.useEffect(()=>{R&&A&&requestAnimationFrame(()=>{var H;return(H=te.current)==null?void 0:H.focus()})},[R,A]),v.useEffect(()=>{O&&V!==null&&Kn.scrollToIndex(V,{align:"auto",behavior:"smooth"})},[V,O,Kn]),v.useImperativeHandle(n,()=>({focus:()=>{var H;return(H=X.current)==null?void 0:H.focus()},blur:()=>{var H;return(H=X.current)==null?void 0:H.blur()},open:()=>ne(!0),close:()=>ne(!1),clear:()=>Dt(k?[]:null)}));const Yn=k?Array.isArray(ie)&&ie.length>0:ie!=null,Qi=v.useCallback(()=>{if(f)return f(ie??null);if(!Yn)return l.jsx("span",{className:G.placeholder,children:w});if(k&&Array.isArray(ie)){if(ie.length===0)return l.jsx("span",{className:G.placeholder,children:w});const H=ie.slice(0,2),Se=ie.length-2;return l.jsxs(l.Fragment,{children:[H.map(dt=>l.jsxs("span",{className:G.chip_multi,children:[l.jsx("span",{className:G.chip_texto,children:le(dt)}),!T&&!Oe&&l.jsx("button",{type:"button",className:G.chip_cerrar,onClick:it=>Ji(dt,it),children:l.jsx(Ci,{size:"1em"})})]},ke(dt))),Se>0&&l.jsxs("span",{className:G.contador_multi,children:["+",Se]})]})}return l.jsx("span",{className:G.valor_texto,children:le(ie)})},[f,ie,Yn,w,k,T,Oe,ke,le,Ji]),es=v.useCallback((H,Se,dt)=>{if(H.tipo==="grupo")return l.jsx("li",{className:W(G.encabezado_grupo,O&&G.opcion_virtual),style:dt,children:H.nombreGrupo},`grupo-${H.nombreGrupo}`);const it=H.datos,os=wt(it),rs=V===Se,Zu=ln(it),Ju=u?u(it,{isSelected:os,isActive:rs}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:G.opcion_check,children:l.jsx(Ql,{size:"1em"})}),l.jsx("span",{className:G.opcion_contenido,children:le(it)})]});return l.jsx("li",{ref:Qu=>{Y.current[Se]=Qu},className:W(G.opcion,O&&G.opcion_virtual,{[G.activo]:rs,[G.seleccionado]:os,[G.deshabilitado]:Zu},B==null?void 0:B.option),style:dt,...Zi({onClick:()=>Xn(it)}),children:Ju},ke(it))},[O,V,wt,u,le,ke,B==null?void 0:B.option,Zi,Xn]),ts=typeof S=="function"?S({invalido:Te,mensaje:Pe}):S??Pe,ns=W(G.contenedor_base,G[`variante_${h}`],G[`tam_${c}`],G[`radio_${p}`],G[`color_${g}`],{[G.ancho_total]:_,[G.sin_animacion]:m,[G.deshabilitado]:Oe,[G.solo_lectura]:T,[G.invalido]:Te,[G.valido]:at,[G.abierto]:R,[G.tiene_valor]:Yn},B==null?void 0:B.base,ye);return $e&&!Ke?l.jsx(ac,{...e,esInvalido:Te,estaDeshabilitadoReal:Oe,clasesBase:ns,renderizarValorMostrado:Qi}):l.jsxs("div",{className:ns,children:[b&&l.jsxs("label",{className:W(G.etiqueta,B==null?void 0:B.label),htmlFor:de,children:[b,M&&l.jsx("span",{className:G.marca_requerido,children:"*"})]}),l.jsxs("div",{ref:H=>{At.setReference(H),X.current=H},id:de,tabIndex:Oe?-1:0,className:W(G.trigger,B==null?void 0:B.trigger),onFocus:re,onBlur:Z,...Wu(),children:[pe&&l.jsx("span",{className:G.contenido_inicio,children:pe}),l.jsx("div",{className:W(G.valor_wrapper,B==null?void 0:B.value),children:Qi()}),l.jsxs("div",{className:G.acciones,children:[P&&Yn&&!T&&!Oe&&l.jsx("button",{type:"button",className:W(G.boton_limpiar,B==null?void 0:B.clearButton),onClick:Ku,tabIndex:-1,children:l.jsx(Ci,{size:"1em"})}),Ee&&l.jsx("span",{className:G.contenido_final,children:Ee}),F?l.jsx("span",{className:G.icono_spinner,children:l.jsx(tc,{size:"1em"})}):l.jsx("span",{className:G.icono_chevron,children:l.jsx(yi,{size:"1em"})})]})]}),we&&l.jsx("input",{type:"hidden",name:we,value:k&&Array.isArray(ie)?ie.map(ke).join(","):ie?ke(ie):""}),rt&&l.jsx(vl,{root:J,children:l.jsx(Sl,{context:et,modal:!1,initialFocus:A?te:-1,children:l.jsxs("div",{ref:At.setFloating,style:{...Qe,...Ko,zIndex:K??void 0},className:W(G.menu,B==null?void 0:B.menu),...Uu(),children:[A&&l.jsx("div",{className:G.buscador_wrapper,children:l.jsxs("div",{className:G.buscador_interno,children:[l.jsx("span",{className:G.icono_buscar,children:l.jsx(ec,{size:"1em"})}),l.jsx("input",{ref:te,type:"text",className:W(G.input_busqueda,B==null?void 0:B.searchInput),placeholder:"Buscar...",value:he,onChange:Xu,onKeyDown:Yu})]})}),l.jsx("ul",{ref:oe,className:W(G.lista_opciones,O&&G.lista_virtual),children:ge.length===0?l.jsx("li",{className:G.sin_resultados,children:he?y:x}):O?l.jsx("div",{className:G.contenedor_virtual,style:{height:`${Kn.getTotalSize()}px`,width:"100%",position:"relative"},children:Kn.getVirtualItems().map(H=>es(ge[H.index],H.index,{position:"absolute",top:0,left:0,width:"100%",height:`${H.size}px`,transform:`translateY(${H.start}px)`}))}):ge.map((H,Se)=>es(H,Se))})]})})}),C&&!Te&&l.jsx("div",{className:W(G.descripcion,B==null?void 0:B.description),children:C}),Te&&ts&&l.jsx("div",{className:W(G.mensaje_error,B==null?void 0:B.errorMessage),children:ts})]})}const Ei=v.forwardRef(cc);Ei.displayName="Select";/**
|
|
7
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t?.key)}return(c=t?.onChange)==null||c.call(t,r),r}return i.updateDeps=s=>{o=s},i}function hi(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const jl=(e,n)=>Math.abs(e-n)<1.01,Bl=(e,n,t)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,r),t)}},mi=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},Hl=e=>e,Gl=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=n;r<=t;r++)o.push(r);return o},Wl=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const r=s=>{const{width:a,height:d}=s;n({width:Math.round(a),height:Math.round(d)})};if(r(mi(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const a=()=>{const d=s[0];if(d?.borderBoxSize){const c=d.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(mi(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},vi={passive:!0},bi=typeof window>"u"?!0:"onscrollend"in window,Kl=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&bi?()=>{}:Bl(o,()=>{n(r,!1)},e.options.isScrollingResetDelay),s=f=>()=>{const{horizontal:_,isRtl:g}=e.options;r=_?t.scrollLeft*(g&&-1||1):t.scrollTop,i(),n(r,f)},a=s(!0),d=s(!1);d(),t.addEventListener("scroll",a,vi);const c=e.options.useScrollendEvent&&bi;return c&&t.addEventListener("scrollend",d,vi),()=>{t.removeEventListener("scroll",a),c&&t.removeEventListener("scrollend",d)}},Ul=(e,n,t)=>{if(n?.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Xl=(e,{adjustments:n=0,behavior:t},o)=>{var r,i;const s=e+n;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class Yl{constructor(n){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 t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),t=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,r])=>{typeof r>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hl,rangeExtractor:Gl,onChange:()=>{},measureElement:Ul,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,...t}},this.notify=t=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,t)},this.maybeNotify=Gt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{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(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,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=(t,o)=>{const r=new Map,i=new Map;for(let s=o-1;s>=0;s--){const a=t[s];if(r.has(a.lane))continue;const d=i.get(a.lane);if(d==null||a.end>d.end?i.set(a.lane,a):a.end<d.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Gt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,r,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=Gt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s},a)=>{if(!s)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 d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,d);for(let f=d;f<t;f++){const _=i(f),g=this.options.lanes===1?c[f-1]:this.getFurthestMeasurement(c,f),u=g?g.end+this.options.gap:o+r,p=a.get(_),h=typeof p=="number"?p:this.options.estimateSize(f),m=u+h,b=g?g.lane:f%this.options.lanes;c[f]={index:f,start:u,size:h,end:m,key:_,lane:b}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Gt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,r,i)=>this.range=t.length>0&&o>0?Zl({measurements:t,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Gt(()=>{let t=null,o=null;const r=this.calculateRange();return r&&(t=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,r,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,r=t.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const r=this.indexFromElement(t),i=this.measurementsCache[r];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const r=this.measurementsCache[t];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=Gt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const r=[];for(let i=0,s=t.length;i<s;i++){const a=t[i],d=o[a];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return hi(o[wi(0,o.length-1,r=>hi(o[r]).start,t)])},this.getOffsetForAlignment=(t,o,r=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(r-i)/2:o==="end"&&(t-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(r.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=s+this.options.scrollPaddingStart)o="start";else return[s,o];const a=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(t,c);if(!f){console.warn("Failed to get offset for index:",t);return}const[_,g]=f;this._scrollToOffset(_,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const u=this.getScrollOffset(),p=this.getOffsetForIndex(t,g);if(!p){console.warn("Failed to get offset for index:",t);return}jl(p[0],u)||d(g)})},d=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${t} after ${s} attempts.`))};a(o)},this.scrollBy=(t,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=o[o.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=o.length-1;for(;s>=0&&i.some(a=>a===null);){const a=o[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}r=Math.max(...i.filter(a=>a!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const wi=(e,n,t,o)=>{for(;e<=n;){const r=(e+n)/2|0,i=t(r);if(i<o)e=r+1;else if(i>o)n=r-1;else return r}return e>0?e-1:0};function Zl({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let s=wi(0,r,i,t),a=s;if(o===1)for(;a<r&&e[a].end<t+n;)a++;else if(o>1){const d=Array(o).fill(0);for(;a<r&&d.some(f=>f<t+n);){const f=e[a];d[f.lane]=f.end,a++}const c=Array(o).fill(t+n);for(;s>=0&&c.some(f=>f>=t);){const f=e[s];c[f.lane]=f.start,s--}s=Math.max(0,s-s%o),a=Math.min(r,a+(o-1-a%o))}return{startIndex:s,endIndex:a}}const yi=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Jl(e){const n=S.useReducer(()=>({}),{})[1],t={...e,onChange:(r,i)=>{var s;i?Zn.flushSync(n):n(),(s=e.onChange)==null||s.call(e,r,i)}},[o]=S.useState(()=>new Yl(t));return o.setOptions(t),yi(()=>o._didMount(),[]),yi(()=>o._willUpdate()),o}function Ql(e){return Jl({observeElementRect:Wl,observeElementOffset:Kl,scrollToFn:Xl,...e})}function ec(e,n){const[t,o]=S.useState(e);return S.useEffect(()=>{const r=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(r)}},[e,n]),t}function jn(e){const n=S.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return S.useSyncExternalStore(n,t,o)}function Bn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Wt(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function ln(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Ci(e,n,t,o){if(!n)return!1;const r=Wt(e,o);return t&&Array.isArray(n)?n.some(i=>Wt(i,o)===r):Wt(n,o)===r}function ko(e,n,t,o){if(!n.trim())return e;const r=n.toLowerCase().trim();return o?e.filter(i=>o(i,n)):e.filter(i=>Bn(i,t).toLowerCase().includes(r))}function Si(e){if(e.length===0)return!1;const n=e[0];return typeof n=="object"&&n!==null&&"grupo"in n&&"opciones"in n&&Array.isArray(n.opciones)}function xi(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const r of o.opciones)n.push({tipo:"opcion",datos:r,indice:t++})}return n}function $i(e,n,t,o){return n.trim()?e.map(r=>({...r,opciones:ko(r.opciones,n,t,o)})).filter(r=>r.opciones.length>0):e}function tc(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&ln(n.datos)?t:null).filter(n=>n!==null)}function nc(e,n){if(!n)return null;const t=n(e);return t===!0||t==null?null:typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message??"Selección inválida":"Selección inválida"}function oc(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function rc(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function ic(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const Ii=({size:e="1em",...n})=>l.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",...n,children:l.jsx("path",{d:"m6 9 6 6 6-6"})}),Ei=({size:e="1em",...n})=>l.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",...n,children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]}),sc=({size:e="1em",...n})=>l.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",...n,children:l.jsx("path",{d:"M20 6 9 17l-5-5"})}),ac=({size:e="1em",...n})=>l.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",...n,children:[l.jsx("circle",{cx:"11",cy:"11",r:"8"}),l.jsx("path",{d:"m21 21-4.3-4.3"})]}),lc=({size:e="1em",...n})=>l.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",...n,children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),j={contenedor_base:"_contenedor_base_wsyf6_1",tam_sm:"_tam_sm_wsyf6_39",tam_lg:"_tam_lg_wsyf6_53",radio_none:"_radio_none_wsyf6_67",radio_sm:"_radio_sm_wsyf6_75",radio_md:"_radio_md_wsyf6_83",radio_lg:"_radio_lg_wsyf6_91",radio_full:"_radio_full_wsyf6_99",color_default:"_color_default_wsyf6_107",color_primary:"_color_primary_wsyf6_109",color_secondary:"_color_secondary_wsyf6_117",color_success:"_color_success_wsyf6_125",color_warning:"_color_warning_wsyf6_133",color_danger:"_color_danger_wsyf6_141",etiqueta:"_etiqueta_wsyf6_149",marca_requerido:"_marca_requerido_wsyf6_167",trigger:"_trigger_wsyf6_193",variante_bordered:"_variante_bordered_wsyf6_223",variante_faded:"_variante_faded_wsyf6_233",variante_underlined:"_variante_underlined_wsyf6_243",variante_ghost:"_variante_ghost_wsyf6_259",deshabilitado:"_deshabilitado_wsyf6_271",solo_lectura:"_solo_lectura_wsyf6_291",abierto:"_abierto_wsyf6_301",valido:"_valido_wsyf6_309",invalido:"_invalido_wsyf6_317",contenido_inicio:"_contenido_inicio_wsyf6_369",contenido_final:"_contenido_final_wsyf6_371",valor_wrapper:"_valor_wrapper_wsyf6_389",valor_texto:"_valor_texto_wsyf6_409",placeholder:"_placeholder_wsyf6_429",chip_multi:"_chip_multi_wsyf6_439",chip_texto:"_chip_texto_wsyf6_473",chip_cerrar:"_chip_cerrar_wsyf6_485",contador_multi:"_contador_multi_wsyf6_525",acciones:"_acciones_wsyf6_539",boton_limpiar:"_boton_limpiar_wsyf6_553",tiene_valor:"_tiene_valor_wsyf6_605",icono_chevron:"_icono_chevron_wsyf6_615",icono_spinner:"_icono_spinner_wsyf6_637",girarSpinner:"_girarSpinner_wsyf6_1",menu:"_menu_wsyf6_671",buscador_wrapper:"_buscador_wrapper_wsyf6_697",buscador_interno:"_buscador_interno_wsyf6_709",icono_buscar:"_icono_buscar_wsyf6_739",input_busqueda:"_input_busqueda_wsyf6_751",lista_opciones:"_lista_opciones_wsyf6_783",lista_virtual:"_lista_virtual_wsyf6_807",contenedor_virtual:"_contenedor_virtual_wsyf6_815",encabezado_grupo:"_encabezado_grupo_wsyf6_823",opcion:"_opcion_wsyf6_855",opcion_virtual:"_opcion_virtual_wsyf6_881",activo:"_activo_wsyf6_889",seleccionado:"_seleccionado_wsyf6_897",opcion_check:"_opcion_check_wsyf6_929",opcion_contenido:"_opcion_contenido_wsyf6_957",sin_resultados:"_sin_resultados_wsyf6_973",descripcion:"_descripcion_wsyf6_987",mensaje_error:"_mensaje_error_wsyf6_999",ancho_total:"_ancho_total_wsyf6_1011",sin_animacion:"_sin_animacion_wsyf6_1019",contenedor_nativo:"_contenedor_nativo_wsyf6_1029",select_nativo:"_select_nativo_wsyf6_1037"};function cc(e){const{options:n=[],value:t,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:s="id",label:a,placeholder:d="Seleccione una opción",description:c,errorMessage:f,isRequired:_=!1,isInvalid:g,id:u,name:p,classNames:h,startContent:m,endContent:b,esInvalido:w,estaDeshabilitadoReal:y,clasesBase:C,renderizarValorMostrado:I}=e,x=v.useId(),M=u??`select-nativo-${x}`,k=c?`${M}-desc`:void 0,T=w?`${M}-err`:void 0,A=v.useCallback(D=>Bn(D,i),[i]),V=v.useCallback(D=>Wt(D,s),[s]),U=v.useCallback(D=>{o?.(D),r?.(D)},[o,r]),z=v.useCallback(D=>{const N=D.target.value;if(!N){U(null);return}const $=n.find(P=>V(P)===N);$&&U($)},[n,V,U]),E=typeof g=="string"?g:null,F=typeof f=="function"?f({invalido:w,mensaje:E}):f??E;return l.jsxs("div",{className:C,children:[a&&l.jsxs("label",{className:H(j.etiqueta,h?.label),htmlFor:M,children:[a,_&&l.jsx("span",{className:j.marca_requerido,children:"*"})]}),l.jsxs("div",{className:j.contenedor_nativo,children:[l.jsxs("div",{className:H(j.trigger,h?.trigger),children:[m&&l.jsx("span",{className:j.contenido_inicio,children:m}),l.jsx("div",{className:H(j.valor_wrapper,h?.value),children:I()}),l.jsxs("div",{className:j.acciones,children:[b&&l.jsx("span",{className:j.contenido_final,children:b}),l.jsx("span",{className:j.icono_chevron,children:l.jsx(Ii,{size:"1em"})})]})]}),l.jsxs("select",{id:M,name:p,className:j.select_nativo,value:t?V(t):"",onChange:z,disabled:y,required:_,children:[l.jsx("option",{value:"",children:d}),n.map(D=>l.jsx("option",{value:V(D),disabled:ln(D),children:A(D)},V(D)))]})]}),c&&!w&&l.jsx("div",{id:k,className:H(j.descripcion,h?.description),children:c}),w&&F&&l.jsx("div",{id:T,className:H(j.mensaje_error,h?.errorMessage),children:F})]})}const uc="(max-width: 768px)";function dc(e,n){const{options:t=[],value:o,defaultValue:r,onChange:i,onValueChange:s,optionLabelKey:a="label",optionValueKey:d="id",renderOption:c,renderValue:f,variant:_="bordered",color:g="default",size:u="md",radius:p="md",fullWidth:h=!0,disableAnimation:m=!1,label:b,placeholder:w="Seleccione una opción",description:y,errorMessage:C,emptyMessage:I="No hay opciones",noResultsMessage:x="Sin resultados",isRequired:M=!1,isDisabled:k=!1,isReadOnly:T=!1,isLoading:A=!1,isClearable:V=!0,isInvalid:U,validationState:z,isMultiple:E=!1,isSearchable:F=!1,isVirtualized:D=!1,estimatedOptionHeight:N=36,filterFn:$,validate:P,onOpen:B,onClose:he,onSearchChange:_e,onClear:L,onFocus:re,onBlur:Y,id:ce,name:ve,className:ye,classNames:se,startContent:me,endContent:Ie,menuZIndex:K,portalContainer:Z}=e,G=v.useRef(null),W=v.useRef([]),ne=v.useRef(null),te=v.useRef(null),le=v.useId(),ge=ce??`select-${le}`,xe=jn(uc)&&!F&&!E,[R,ee]=v.useState(!1),[O,ae]=v.useState(null),[fe,Ce]=v.useState(""),Be=o!==void 0,[Je,Ge]=v.useState(r??null),oe=Be?o:Je,Ae=k||A,ue=v.useCallback(X=>Bn(X,a),[a]),Ee=v.useCallback(X=>Wt(X,d),[d]),bt=v.useCallback(X=>Ci(X,oe,E,d),[oe,E,d]),Ue=v.useMemo(()=>Si(t),[t]),q=v.useMemo(()=>!F||!fe.trim()?t:Ue?$i(t,fe,a,$):ko(t,fe,a,$),[t,fe,F,$,a,Ue]),de=v.useMemo(()=>Ue?xi(q):q.map((X,Oe)=>({tipo:"opcion",datos:X,indice:Oe})),[q,Ue]),De=v.useMemo(()=>nc(oe,P),[oe,P]),Te=v.useMemo(()=>oc(U,z,De),[U,z,De]),at=z==="valid"&&!Te,{refs:Nt,floatingStyles:Qe,context:et}=Al({open:R,onOpenChange:X=>{Ae||T||(ee(X),X?(B?.(),Ce(""),ae(null)):he?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[ol(4),il({padding:8}),rl({padding:8}),sl({apply({rects:X,elements:Oe}){Object.assign(Oe.floating.style,{width:`${X.reference.width}px`})},padding:8})],whileElementsMounted:Ua}),{isMounted:rt,styles:Xo}=Rl(et,{duration:m?0:150,initial:{opacity:0,transform:"translateY(-4px)"},open:{opacity:1,transform:"translateY(0)"},close:{opacity:0,transform:"translateY(-4px)"},common:{transformOrigin:"top"}}),Un=Ql({count:de.length,getScrollElement:()=>ne.current,estimateSize:X=>de[X]?.tipo==="grupo"?32:N,overscan:5,enabled:D&&R}),Bu=El(et,{enabled:!Ae&&!T}),Hu=Fl(et),Gu=Ll(et,{role:"listbox"}),Wu=v.useMemo(()=>tc(de),[de]),Ku=Ol(et,{listRef:W,activeIndex:O,onNavigate:ae,loop:!0,virtual:D,disabledIndices:Wu}),Ji=v.useRef([]);v.useEffect(()=>{Ji.current=de.map(X=>X.tipo==="opcion"&&X.datos?ue(X.datos):null)},[de,ue]);const Uu=ql(et,{listRef:Ji,activeIndex:O,onMatch:R?ae:void 0,enabled:!F}),{getReferenceProps:Xu,getFloatingProps:Yu,getItemProps:Qi}=Dl([Bu,Hu,Gu,Ku,Uu]),At=v.useCallback(X=>{Be||Ge(X),i?.(X),s?.(X)},[Be,i,s]),Xn=v.useCallback(X=>{if(!ln(X))if(E){const Oe=Array.isArray(oe)?oe:[],dt=Oe.some(it=>Ee(it)===Ee(X));At(dt?Oe.filter(it=>Ee(it)!==Ee(X)):[...Oe,X])}else At(X),ee(!1)},[E,oe,Ee,At]),Zu=v.useCallback(X=>{X.stopPropagation(),At(E?[]:null),L?.(),G.current?.focus()},[E,At,L]),es=v.useCallback((X,Oe)=>{Oe.stopPropagation(),!(!E||!Array.isArray(oe))&&At(oe.filter(dt=>Ee(dt)!==Ee(X)))},[E,oe,Ee,At]),Ju=v.useCallback(X=>{Ce(X.target.value),_e?.(X.target.value),ae(0)},[_e]),Qu=v.useCallback(X=>{if(X.key==="Enter"&&O!==null){X.preventDefault();const Oe=de[O];Oe?.tipo==="opcion"&&Oe.datos&&Xn(Oe.datos)}},[O,de,Xn]);v.useEffect(()=>{R&&F&&requestAnimationFrame(()=>te.current?.focus())},[R,F]),v.useEffect(()=>{D&&O!==null&&Un.scrollToIndex(O,{align:"auto",behavior:"smooth"})},[O,D,Un]),v.useImperativeHandle(n,()=>({focus:()=>G.current?.focus(),blur:()=>G.current?.blur(),open:()=>ee(!0),close:()=>ee(!1),clear:()=>At(E?[]:null)}));const Yn=E?Array.isArray(oe)&&oe.length>0:oe!=null,ts=v.useCallback(()=>{if(f)return f(oe??null);if(!Yn)return l.jsx("span",{className:j.placeholder,children:w});if(E&&Array.isArray(oe)){if(oe.length===0)return l.jsx("span",{className:j.placeholder,children:w});const X=oe.slice(0,2),Oe=oe.length-2;return l.jsxs(l.Fragment,{children:[X.map(dt=>l.jsxs("span",{className:j.chip_multi,children:[l.jsx("span",{className:j.chip_texto,children:ue(dt)}),!T&&!Ae&&l.jsx("button",{type:"button",className:j.chip_cerrar,onClick:it=>es(dt,it),children:l.jsx(Ei,{size:"1em"})})]},Ee(dt))),Oe>0&&l.jsxs("span",{className:j.contador_multi,children:["+",Oe]})]})}return l.jsx("span",{className:j.valor_texto,children:ue(oe)})},[f,oe,Yn,w,E,T,Ae,Ee,ue,es]),ns=v.useCallback((X,Oe,dt)=>{if(X.tipo==="grupo")return l.jsx("li",{className:H(j.encabezado_grupo,D&&j.opcion_virtual),style:dt,children:X.nombreGrupo},`grupo-${X.nombreGrupo}`);const it=X.datos,is=bt(it),ss=O===Oe,ed=ln(it),td=c?c(it,{isSelected:is,isActive:ss}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:j.opcion_check,children:l.jsx(sc,{size:"1em"})}),l.jsx("span",{className:j.opcion_contenido,children:ue(it)})]});return l.jsx("li",{ref:nd=>{W.current[Oe]=nd},className:H(j.opcion,D&&j.opcion_virtual,{[j.activo]:ss,[j.seleccionado]:is,[j.deshabilitado]:ed},se?.option),style:dt,...Qi({onClick:()=>Xn(it)}),children:td},Ee(it))},[D,O,bt,c,ue,Ee,se?.option,Qi,Xn]),os=typeof C=="function"?C({invalido:Te,mensaje:De}):C??De,rs=H(j.contenedor_base,j[`variante_${_}`],j[`tam_${u}`],j[`radio_${p}`],j[`color_${g}`],{[j.ancho_total]:h,[j.sin_animacion]:m,[j.deshabilitado]:Ae,[j.solo_lectura]:T,[j.invalido]:Te,[j.valido]:at,[j.abierto]:R,[j.tiene_valor]:Yn},se?.base,ye);return xe&&!Ue?l.jsx(cc,{...e,esInvalido:Te,estaDeshabilitadoReal:Ae,clasesBase:rs,renderizarValorMostrado:ts}):l.jsxs("div",{className:rs,children:[b&&l.jsxs("label",{className:H(j.etiqueta,se?.label),htmlFor:ge,children:[b,M&&l.jsx("span",{className:j.marca_requerido,children:"*"})]}),l.jsxs("div",{ref:X=>{Nt.setReference(X),G.current=X},id:ge,tabIndex:Ae?-1:0,className:H(j.trigger,se?.trigger),onFocus:re,onBlur:Y,...Xu(),children:[me&&l.jsx("span",{className:j.contenido_inicio,children:me}),l.jsx("div",{className:H(j.valor_wrapper,se?.value),children:ts()}),l.jsxs("div",{className:j.acciones,children:[V&&Yn&&!T&&!Ae&&l.jsx("button",{type:"button",className:H(j.boton_limpiar,se?.clearButton),onClick:Zu,tabIndex:-1,children:l.jsx(Ei,{size:"1em"})}),Ie&&l.jsx("span",{className:j.contenido_final,children:Ie}),A?l.jsx("span",{className:j.icono_spinner,children:l.jsx(lc,{size:"1em"})}):l.jsx("span",{className:j.icono_chevron,children:l.jsx(Ii,{size:"1em"})})]})]}),ve&&l.jsx("input",{type:"hidden",name:ve,value:E&&Array.isArray(oe)?oe.map(Ee).join(","):oe?Ee(oe):""}),rt&&l.jsx(wl,{root:Z,children:l.jsx($l,{context:et,modal:!1,initialFocus:F?te:-1,children:l.jsxs("div",{ref:Nt.setFloating,style:{...Qe,...Xo,zIndex:K??void 0},className:H(j.menu,se?.menu),...Yu(),children:[F&&l.jsx("div",{className:j.buscador_wrapper,children:l.jsxs("div",{className:j.buscador_interno,children:[l.jsx("span",{className:j.icono_buscar,children:l.jsx(ac,{size:"1em"})}),l.jsx("input",{ref:te,type:"text",className:H(j.input_busqueda,se?.searchInput),placeholder:"Buscar...",value:fe,onChange:Ju,onKeyDown:Qu})]})}),l.jsx("ul",{ref:ne,className:H(j.lista_opciones,D&&j.lista_virtual),children:de.length===0?l.jsx("li",{className:j.sin_resultados,children:fe?x:I}):D?l.jsx("div",{className:j.contenedor_virtual,style:{height:`${Un.getTotalSize()}px`,width:"100%",position:"relative"},children:Un.getVirtualItems().map(X=>ns(de[X.index],X.index,{position:"absolute",top:0,left:0,width:"100%",height:`${X.size}px`,transform:`translateY(${X.start}px)`}))}):de.map((X,Oe)=>ns(X,Oe))})]})})}),y&&!Te&&l.jsx("div",{className:H(j.descripcion,se?.description),children:y}),Te&&os&&l.jsx("div",{className:H(j.mensaje_error,se?.errorMessage),children:os})]})}const ki=v.forwardRef(dc);ki.displayName="Select";/**
|
|
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
|
|
16
|
+
*/function It(e,n){return typeof e=="function"?e(n):e}function Ze(e,n){return t=>{n.setState(o=>({...o,[e]:It(t,o[e])}))}}function Hn(e){return e instanceof Function}function fc(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function gc(e,n){const t=[],o=r=>{r.forEach(i=>{t.push(i);const s=n(i);s!=null&&s.length&&o(s)})};return o(e),t}function J(e,n,t){let o=[],r;return i=>{let s;t.key&&t.debug&&(s=Date.now());const a=e(i);if(!(a.length!==o.length||a.some((f,_)=>o[_]!==f)))return r;o=a;let c;if(t.key&&t.debug&&(c=Date.now()),r=n(...a),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const f=Math.round((Date.now()-s)*100)/100,_=Math.round((Date.now()-c)*100)/100,g=_/16,u=(p,h)=>{for(p=String(p);p.length<h;)p=" "+p;return p};console.info(`%c⏱ ${u(_,5)} /${u(f,5)} ms`,`
|
|
17
17
|
font-size: .6rem;
|
|
18
18
|
font-weight: bold;
|
|
19
|
-
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function ee(e,n,t,o){return{debug:()=>{var r;return(r=e==null?void 0:e.debugAll)!=null?r:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function fc(e,n,t,o){const r=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:Q(()=>[e,t,n,i],(s,a,d,u)=>({table:s,column:a,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ee(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function gc(e,n,t,o){var r,i;const a={...e._getDefaultColumnDef(),...n},d=a.accessorKey;let u=(r=(i=a.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:d&&(d.includes(".")?f=g=>{let c=g;for(const _ of d.split(".")){var p;c=(p=c)==null?void 0:p[_],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${_}" in deeply nested key "${d}" returned undefined.`)}return c}:f=g=>g[a.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let h={id:`${String(u)}`,accessorFn:f,parent:o,depth:t,columnDef:a,columns:[],getFlatColumns:Q(()=>[!0],()=>{var g;return[h,...(g=h.columns)==null?void 0:g.flatMap(c=>c.getFlatColumns())]},ee(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],g=>{var c;if((c=h.columns)!=null&&c.length){let p=h.columns.flatMap(_=>_.getLeafColumns());return g(p)}return[h]},ee(e.options,"debugColumns","column.getLeafColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(h,e);return h}const je="debugHeaders";function ki(e,n,t){var o;let i={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(a),s.push(d)};return a(i),s},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const _c={createTable:e=>{e.getHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,s;const a=(i=o==null?void 0:o.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?i:[],d=(s=r==null?void 0:r.map(h=>t.find(g=>g.id===h)).filter(Boolean))!=null?s:[],u=t.filter(h=>!(o!=null&&o.includes(h.id))&&!(r!=null&&r.includes(h.id)));return Gn(n,[...a,...u,...d],e)},ee(e.options,je,"getHeaderGroups")),e.getCenterHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Gn(n,t,e,"center")),ee(e.options,je,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o==null?void 0:o.map(s=>t.find(a=>a.id===s)).filter(Boolean))!=null?r:[];return Gn(n,i,e,"left")},ee(e.options,je,"getLeftHeaderGroups")),e.getRightHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o==null?void 0:o.map(s=>t.find(a=>a.id===s)).filter(Boolean))!=null?r:[];return Gn(n,i,e,"right")},ee(e.options,je,"getRightHeaderGroups")),e.getFooterGroups=Q(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getFooterGroups")),e.getLeftFooterGroups=Q(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getLeftFooterGroups")),e.getCenterFooterGroups=Q(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getCenterFooterGroups")),e.getRightFooterGroups=Q(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ee(e.options,je,"getRightFooterGroups")),e.getFlatHeaders=Q(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getFlatHeaders")),e.getLeftFlatHeaders=Q(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Q(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getCenterFlatHeaders")),e.getRightFlatHeaders=Q(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),ee(e.options,je,"getRightFlatHeaders")),e.getCenterLeafHeaders=Q(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ee(e.options,je,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Q(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ee(e.options,je,"getLeftLeafHeaders")),e.getRightLeafHeaders=Q(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ee(e.options,je,"getRightLeafHeaders")),e.getLeafHeaders=Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,s,a,d,u;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},ee(e.options,je,"getLeafHeaders"))}};function Gn(e,n,t,o){var r,i;let s=0;const a=function(g,c){c===void 0&&(c=1),s=Math.max(s,c),g.filter(p=>p.getIsVisible()).forEach(p=>{var _;(_=p.columns)!=null&&_.length&&a(p.columns,c+1)},0)};a(e);let d=[];const u=(g,c)=>{const p={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},_=[];g.forEach(m=>{const b=[..._].reverse()[0],w=m.column.depth===p.depth;let C,S=!1;if(w&&m.column.parent?C=m.column.parent:(C=m.column,S=!0),b&&(b==null?void 0:b.column)===C)b.subHeaders.push(m);else{const x=ki(t,C,{id:[o,c,C.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${_.filter(y=>y.column===C).length}`:void 0,depth:c,index:_.length});x.subHeaders.push(m),_.push(x)}p.headers.push(m),m.headerGroup=p}),d.push(p),c>0&&u(_,c-1)},f=n.map((g,c)=>ki(t,g,{depth:s,index:c}));u(f,s-1),d.reverse();const h=g=>g.filter(p=>p.column.getIsVisible()).map(p=>{let _=0,m=0,b=[0];p.subHeaders&&p.subHeaders.length?(b=[],h(p.subHeaders).forEach(C=>{let{colSpan:S,rowSpan:x}=C;_+=S,b.push(x)})):_=1;const w=Math.min(...b);return m=m+w,p.colSpan=_,p.rowSpan=m,{colSpan:_,rowSpan:m}});return h((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const Mo=(e,n,t,o,r,i,s)=>{let a={id:n,index:o,original:t,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(a._valuesCache.hasOwnProperty(d))return a._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return a._valuesCache[d]=u.accessorFn(a.original,o),a._valuesCache[d]},getUniqueValues:d=>{if(a._uniqueValuesCache.hasOwnProperty(d))return a._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[d]=u.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[d]):(a._uniqueValuesCache[d]=[a.getValue(d)],a._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=a.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>dc(a.subRows,d=>d.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let d=[],u=a;for(;;){const f=u.getParentRow();if(!f)break;d.push(f),u=f}return d.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],d=>d.map(u=>fc(e,a,u,u.id)),ee(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Q(()=>[a.getAllCells()],d=>d.reduce((u,f)=>(u[f.column.id]=f,u),{}),ee(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const u=e._features[d];u==null||u.createRow==null||u.createRow(a,e)}return a},pc={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Mi=(e,n,t)=>{var o,r;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(n))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Mi.autoRemove=e=>st(e);const Fi=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};Fi.autoRemove=e=>st(e);const Ai=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(t==null?void 0:t.toLowerCase())};Ai.autoRemove=e=>st(e);const Di=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};Di.autoRemove=e=>st(e);const Oi=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});Oi.autoRemove=e=>st(e)||!(e!=null&&e.length);const Pi=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Pi.autoRemove=e=>st(e)||!(e!=null&&e.length);const Ni=(e,n,t)=>e.getValue(n)===t;Ni.autoRemove=e=>st(e);const Li=(e,n,t)=>e.getValue(n)==t;Li.autoRemove=e=>st(e);const Fo=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};Fo.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(r)?1/0:r;if(i>s){const a=i;i=s,s=a}return[i,s]},Fo.autoRemove=e=>st(e)||st(e[0])&&st(e[1]);const ht={includesString:Mi,includesStringSensitive:Fi,equalsString:Ai,arrIncludes:Di,arrIncludesAll:Oi,arrIncludesSome:Pi,equals:Ni,weakEquals:Li,inNumberRange:Fo};function st(e){return e==null||e===""}const hc={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ze("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t==null?void 0:t.getValue(e.id);return typeof o=="string"?ht.includesString:typeof o=="number"?ht.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?ht.equals:Array.isArray(o)?ht.arrIncludes:ht.weakEquals},e.getFilterFn=()=>{var t,o;return Hn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:ht[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),i=o==null?void 0:o.find(f=>f.id===e.id),s=Et(t,i?i.value:void 0);if(Vi(r,s,e)){var a;return(a=o==null?void 0:o.filter(f=>f.id!==e.id))!=null?a:[]}const d={id:e.id,value:s};if(i){var u;return(u=o==null?void 0:o.map(f=>f.id===e.id?d:f))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var i;return(i=Et(n,r))==null?void 0:i.filter(s=>{const a=t.find(d=>d.id===s.id);if(a){const d=a.getFilterFn();if(Vi(d,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},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 Vi(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const Ao={sum:(e,n,t)=>t.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,r;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=r=s):(o>s&&(o=s),r<s&&(r=s)))}),[o,r]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},median:(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!uc(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,s)=>i-s);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),uniqueCount:(e,n)=>new Set(n.map(t=>t.getValue(e))).size,count:(e,n)=>n.length},mc={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ze("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t==null?void 0:t.getValue(e.id);if(typeof o=="number")return Ao.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Ao.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return Hn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:Ao[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},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,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function vc(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(i=>!n.includes(i.id));return t==="remove"?o:[...n.map(i=>e.find(s=>s.id===i)).filter(Boolean),...o]}const bc={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ze("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=Q(t=>[cn(n,t)],t=>t.findIndex(o=>o.id===e.id),ee(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=cn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=cn(n,t);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const s=[...n],a=[...r];for(;a.length&&s.length;){const d=s.shift(),u=a.findIndex(f=>f.id===d);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return vc(i,t,o)},ee(e.options,"debugTable","_getOrderColumnsFn"))}},Do=()=>({left:[],right:[]}),wc={getInitialState:e=>({columnPinning:Do(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ze("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,s;if(t==="right"){var a,d;return{left:((a=r==null?void 0:r.left)!=null?a:[]).filter(h=>!(o!=null&&o.includes(h))),right:[...((d=r==null?void 0:r.right)!=null?d:[]).filter(h=>!(o!=null&&o.includes(h))),...o]}}if(t==="left"){var u,f;return{left:[...((u=r==null?void 0:r.left)!=null?u:[]).filter(h=>!(o!=null&&o.includes(h))),...o],right:((f=r==null?void 0:r.right)!=null?f:[]).filter(h=>!(o!=null&&o.includes(h)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(h=>!(o!=null&&o.includes(h))),right:((s=r==null?void 0:r.right)!=null?s:[]).filter(h=>!(o!=null&&o.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,s;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(s=n.options.enableColumnPinning)!=null?s:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(a=>a.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(a=>o==null?void 0:o.includes(a)),s=t.some(a=>r==null?void 0:r.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=Q(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(s=>!i.includes(s.column.id))},ee(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Q(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ee(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Q(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ee(n.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?Do():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:Do())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ee(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ee(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(i=>!r.includes(i.id))},ee(e.options,"debugColumns","getCenterLeafColumns"))}};function yc(e){return e||(typeof document<"u"?document:null)}const Wn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Oo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Cc={getDefaultColumnDef:()=>Wn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Oo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ze("columnSizing",e),onColumnSizingInfoChange:Ze("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Wn.minSize,(o=i??e.columnDef.size)!=null?o:Wn.size),(r=e.columnDef.maxSize)!=null?r:Wn.maxSize)},e.getStart=Q(t=>[t,cn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),ee(n.options,"debugColumns","getStart")),e.getAfter=Q(t=>[t,cn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),ee(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o==null?void 0:o.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Po(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[o.id,o.getSize()]],d=Po(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(b,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(C=>{var S,x;const y=n.options.columnResizeDirection==="rtl"?-1:1,M=(w-((S=C==null?void 0:C.startOffset)!=null?S:0))*y,E=Math.max(M/((x=C==null?void 0:C.startSize)!=null?x:0),-.999999);return C.columnSizingStart.forEach(T=>{let[F,P]=T;u[F]=Math.round(Math.max(P+P*E,0)*100)/100}),{...C,deltaOffset:M,deltaPercentage:E}}),(n.options.columnResizeMode==="onChange"||b==="end")&&n.setColumnSizing(C=>({...C,...u})))},h=b=>f("move",b),g=b=>{f("end",b),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=yc(t),p={moveHandler:b=>h(b.clientX),upHandler:b=>{c==null||c.removeEventListener("mousemove",p.moveHandler),c==null||c.removeEventListener("mouseup",p.upHandler),g(b.clientX)}},_={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),h(b.touches[0].clientX),!1),upHandler:b=>{var w;c==null||c.removeEventListener("touchmove",_.moveHandler),c==null||c.removeEventListener("touchend",_.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),g((w=b.touches[0])==null?void 0:w.clientX)}},m=Sc()?{passive:!1}:!1;Po(i)?(c==null||c.addEventListener("touchmove",_.moveHandler,m),c==null||c.addEventListener("touchend",_.upHandler,m)):(c==null||c.addEventListener("mousemove",p.moveHandler,m),c==null||c.addEventListener("mouseup",p.upHandler,m)),n.setColumnSizingInfo(b=>({...b,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?Oo():(t=e.initialState.columnSizingInfo)!=null?t:Oo())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let Un=null;function Sc(){if(typeof Un=="boolean")return Un;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return Un=e,Un}function Po(e){return e.type==="touchstart"}const xc={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ze("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=Q(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),ee(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],ee(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>Q(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ee(e.options,"debugColumns",t));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function cn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const $c={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()}}},Ic={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ze("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ht.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return Hn(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:ht[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},Ec={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ze("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");o=Math.max(o,s.length)}),o},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,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let s={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=o,t=(r=t)!=null?r:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:a,...d}=s;return d}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o!=null&&o[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},No=0,Lo=10,Vo=()=>({pageIndex:No,pageSize:Lo}),kc={getInitialState:e=>({...e,pagination:{...Vo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ze("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=i=>Et(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Vo():(r=e.initialState.pagination)!=null?r:Vo())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Et(o,r.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?No:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:No)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?Lo:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Lo)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Et(o,r.pageSize)),s=r.pageSize*r.pageIndex,a=Math.floor(s/i);return{...r,pageIndex:a,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let s=Et(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),e.getPageOptions=Q(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,s)=>s)),r},ee(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+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 o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},To=()=>({top:[],bottom:[]}),Mc={getInitialState:e=>({rowPinning:To(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ze("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],s=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],a=new Set([...s,e.id,...i]);n.setRowPinning(d=>{var u,f;if(t==="bottom"){var h,g;return{top:((h=d==null?void 0:d.top)!=null?h:[]).filter(_=>!(a!=null&&a.has(_))),bottom:[...((g=d==null?void 0:d.bottom)!=null?g:[]).filter(_=>!(a!=null&&a.has(_))),...Array.from(a)]}}if(t==="top"){var c,p;return{top:[...((c=d==null?void 0:d.top)!=null?c:[]).filter(_=>!(a!=null&&a.has(_))),...Array.from(a)],bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(_=>!(a!=null&&a.has(_)))}}return{top:((u=d==null?void 0:d.top)!=null?u:[]).filter(_=>!(a!=null&&a.has(_))),bottom:((f=d==null?void 0:d.bottom)!=null?f:[]).filter(_=>!(a!=null&&a.has(_)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,i=t.some(a=>o==null?void 0:o.includes(a)),s=t.some(a=>r==null?void 0:r.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const i=(t=r==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(s=>{let{id:a}=s;return a});return(o=i==null?void 0:i.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?To():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:To())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(t??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:o}))},e.getTopRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),ee(e.options,"debugRows","getTopRows")),e.getBottomRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),ee(e.options,"debugRows","getBottomRows")),e.getCenterRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(i=>!r.has(i.id))},ee(e.options,"debugRows","getCenterRows"))}},Fc={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ze("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{zo(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const a={...i};return zo(a,e.id,t,(s=o==null?void 0:o.selectChildren)!=null?s:!0,n),a})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return qo(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return jo(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return jo(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},zo=(e,n,t,o,r)=>{var i;const s=r.getRow(n,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>zo(e,a.id,t,o,r))};function Ro(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(s,a){return s.map(d=>{var u;const f=qo(d,t);if(f&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),f)return d}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function qo(e,n){var t;return(t=n[e.id])!=null?t:!1}function jo(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!r)&&(s.getCanSelect()&&(qo(s,n)?i=!0:r=!1),s.subRows&&s.subRows.length)){const a=jo(s,n);a==="all"?i=!0:(a==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Bo=/([0-9]+)/gm,Ac=(e,n,t)=>Ti(kt(e.getValue(t)).toLowerCase(),kt(n.getValue(t)).toLowerCase()),Dc=(e,n,t)=>Ti(kt(e.getValue(t)),kt(n.getValue(t))),Oc=(e,n,t)=>Ho(kt(e.getValue(t)).toLowerCase(),kt(n.getValue(t)).toLowerCase()),Pc=(e,n,t)=>Ho(kt(e.getValue(t)),kt(n.getValue(t))),Nc=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},Lc=(e,n,t)=>Ho(e.getValue(t),n.getValue(t));function Ho(e,n){return e===n?0:e>n?1:-1}function kt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ti(e,n){const t=e.split(Bo).filter(Boolean),o=n.split(Bo).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),s=parseInt(r,10),a=parseInt(i,10),d=[s,a].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return t.length-o.length}const un={alphanumeric:Ac,alphanumericCaseSensitive:Dc,text:Oc,textCaseSensitive:Pc,datetime:Nc,basic:Lc},Vc=[_c,xc,bc,wc,pc,hc,$c,Ic,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ze("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return un.datetime;if(typeof i=="string"&&(o=!0,i.split(Bo).length>1))return un.alphanumeric}return o?un.text:un.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return Hn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:un[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const a=s==null?void 0:s.find(c=>c.id===e.id),d=s==null?void 0:s.findIndex(c=>c.id===e.id);let u=[],f,h=i?t:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?a?f="toggle":f="add":s!=null&&s.length&&d!==s.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var g;u=[...s,{id:e.id,desc:h}],u.splice(0,u.length-((g=n.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=s.map(c=>c.id===e.id?{...c,desc:h}:c):f==="remove"?u=s.filter(c=>c.id!==e.id):u=[{id:e.id,desc:h}];return u})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},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())}},mc,Ec,kc,Mc,Fc,Cc];function Tc(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...Vc,...(n=e._features)!=null?n:[]];let r={_features:o};const i=r._features.reduce((g,c)=>Object.assign(g,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),s=g=>r.options.mergeOptions?r.options.mergeOptions(i,g):{...i,...g};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(g=>{var c;d=(c=g.getInitialState==null?void 0:g.getInitialState(d))!=null?c:d});const u=[];let f=!1;const h={_features:o,options:{...i,...e},initialState:d,_queue:g=>{u.push(g),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:g=>{const c=Et(g,r.options);r.options=s(c)},getState:()=>r.options.state,setState:g=>{r.options.onStateChange==null||r.options.onStateChange(g)},_getRowId:(g,c,p)=>{var _;return(_=r.options.getRowId==null?void 0:r.options.getRowId(g,c,p))!=null?_:`${p?[p.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(g,c)=>{let p=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[g];if(!p&&(p=r.getCoreRowModel().rowsById[g],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${g}`):new Error;return p},_getDefaultColumnDef:Q(()=>[r.options.defaultColumn],g=>{var c;return g=(c=g)!=null?c:{},{header:p=>{const _=p.header.column.columnDef;return _.accessorKey?_.accessorKey:_.accessorFn?_.id:null},cell:p=>{var _,m;return(_=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?_:null},...r._features.reduce((p,_)=>Object.assign(p,_.getDefaultColumnDef==null?void 0:_.getDefaultColumnDef()),{}),...g}},ee(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:Q(()=>[r._getColumnDefs()],g=>{const c=function(p,_,m){return m===void 0&&(m=0),p.map(b=>{const w=gc(r,b,m,_),C=b;return w.columns=C.columns?c(C.columns,w,m+1):[],w})};return c(g)},ee(e,"debugColumns","getAllColumns")),getAllFlatColumns:Q(()=>[r.getAllColumns()],g=>g.flatMap(c=>c.getFlatColumns()),ee(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Q(()=>[r.getAllFlatColumns()],g=>g.reduce((c,p)=>(c[p.id]=p,c),{}),ee(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Q(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(g,c)=>{let p=g.flatMap(_=>_.getLeafColumns());return c(p)},ee(e,"debugColumns","getAllLeafColumns")),getColumn:g=>{const c=r._getAllFlatColumnsById()[g];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${g}' does not exist.`),c}};Object.assign(r,h);for(let g=0;g<r._features.length;g++){const c=r._features[g];c==null||c.createTable==null||c.createTable(r)}return r}function zc(){return e=>Q(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,s){i===void 0&&(i=0);const a=[];for(let u=0;u<r.length;u++){const f=Mo(e,e._getRowId(r[u],u,s),r[u],u,i,void 0,s==null?void 0:s.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var d;f.originalSubRows=e.options.getSubRows(r[u],u),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=o(f.originalSubRows,i+1,f))}}return a};return t.rows=o(n),t},ee(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Rc(e){const n=[],t=o=>{var r;n.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function qc(e,n,t){return t.options.filterFromLeafRows?jc(e,n,t):Bc(e,n,t)}function jc(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,u){u===void 0&&(u=0);const f=[];for(let g=0;g<d.length;g++){var h;let c=d[g];const p=Mo(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(p.columnFilters=c.columnFilters,(h=c.subRows)!=null&&h.length&&u<s){if(p.subRows=a(c.subRows,u+1),c=p,n(c)&&!p.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}if(n(c)||p.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}}else c=p,n(c)&&(f.push(c),i[c.id]=c,r.push(c))}return f};return{rows:a(e),flatRows:r,rowsById:i}}function Bc(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,u){u===void 0&&(u=0);const f=[];for(let g=0;g<d.length;g++){let c=d[g];if(n(c)){var h;if((h=c.subRows)!=null&&h.length&&u<s){const _=Mo(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);_.subRows=a(c.subRows,u+1),c=_}f.push(c),r.push(c),i[c.id]=c}}return f};return{rows:a(e),flatRows:r,rowsById:i}}function Hc(){return e=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let g=0;g<n.flatRows.length;g++)n.flatRows[g].columnFilters={},n.flatRows[g].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(g=>{var c;const p=e.getColumn(g.id);if(!p)return;const _=p.getFilterFn();if(!_){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}r.push({id:g.id,filterFn:_,resolvedValue:(c=_.resolveFilterValue==null?void 0:_.resolveFilterValue(g.value))!=null?c:g.value})});const s=(t??[]).map(g=>g.id),a=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());o&&a&&d.length&&(s.push("__global__"),d.forEach(g=>{var c;i.push({id:g.id,filterFn:a,resolvedValue:(c=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?c:o})}));let u,f;for(let g=0;g<n.flatRows.length;g++){const c=n.flatRows[g];if(c.columnFilters={},r.length)for(let p=0;p<r.length;p++){u=r[p];const _=u.id;c.columnFilters[_]=u.filterFn(c,_,u.resolvedValue,m=>{c.columnFiltersMeta[_]=m})}if(i.length){for(let p=0;p<i.length;p++){f=i[p];const _=f.id;if(f.filterFn(c,_,f.resolvedValue,m=>{c.columnFiltersMeta[_]=m})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const h=g=>{for(let c=0;c<s.length;c++)if(g.columnFilters[s[c]]===!1)return!1;return!0};return qc(n.rows,h,e)},ee(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Gc(e){return n=>Q(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=t;let{rows:s,flatRows:a,rowsById:d}=o;const u=r*i,f=u+r;s=s.slice(u,f);let h;n.options.paginateExpandedRows?h={rows:s,flatRows:a,rowsById:d}:h=Rc({rows:s,flatRows:a,rowsById:d}),h.flatRows=[];const g=c=>{h.flatRows.push(c),c.subRows.length&&c.subRows.forEach(g)};return h.rows.forEach(g),h},ee(n.options,"debugTable","getPaginationRowModel"))}function Wc(){return e=>Q(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),s={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(s[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=d=>{const u=d.map(f=>({...f}));return u.sort((f,h)=>{for(let c=0;c<i.length;c+=1){var g;const p=i[c],_=s[p.id],m=_.sortUndefined,b=(g=p==null?void 0:p.desc)!=null?g:!1;let w=0;if(m){const C=f.getValue(p.id),S=h.getValue(p.id),x=C===void 0,y=S===void 0;if(x||y){if(m==="first")return x?-1:1;if(m==="last")return x?1:-1;w=x&&y?0:x?m:-m}}if(w===0&&(w=_.sortingFn(f,h,p.id)),w!==0)return b&&(w*=-1),_.invertSorting&&(w*=-1),w}return f.index-h.index}),u.forEach(f=>{var h;r.push(f),(h=f.subRows)!=null&&h.length&&(f.subRows=a(f.subRows))}),u};return{rows:a(t.rows),flatRows:r,rowsById:t.rowsById}},ee(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
19
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t?.key)}return r}}function Q(e,n,t,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function _c(e,n,t,o){const r=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:J(()=>[e,t,n,i],(s,a,d,c)=>({table:s,column:a,row:d,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Q(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function pc(e,n,t,o){var r,i;const a={...e._getDefaultColumnDef(),...n},d=a.accessorKey;let c=(r=(i=a.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:d&&(d.includes(".")?f=g=>{let u=g;for(const h of d.split(".")){var p;u=(p=u)==null?void 0:p[h],process.env.NODE_ENV!=="production"&&u===void 0&&console.warn(`"${h}" in deeply nested key "${d}" returned undefined.`)}return u}:f=g=>g[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let _={id:`${String(c)}`,accessorFn:f,parent:o,depth:t,columnDef:a,columns:[],getFlatColumns:J(()=>[!0],()=>{var g;return[_,...(g=_.columns)==null?void 0:g.flatMap(u=>u.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],g=>{var u;if((u=_.columns)!=null&&u.length){let p=_.columns.flatMap(h=>h.getLeafColumns());return g(p)}return[_]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(_,e);return _}const je="debugHeaders";function Mi(e,n,t){var o;let i={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(a),s.push(d)};return a(i),s},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const hc={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,s;const a=(i=o?.map(_=>t.find(g=>g.id===_)).filter(Boolean))!=null?i:[],d=(s=r?.map(_=>t.find(g=>g.id===_)).filter(Boolean))!=null?s:[],c=t.filter(_=>!(o!=null&&o.includes(_.id))&&!(r!=null&&r.includes(_.id)));return Gn(n,[...a,...c,...d],e)},Q(e.options,je,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Gn(n,t,e,"center")),Q(e.options,je,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o?.map(s=>t.find(a=>a.id===s)).filter(Boolean))!=null?r:[];return Gn(n,i,e,"left")},Q(e.options,je,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o?.map(s=>t.find(a=>a.id===s)).filter(Boolean))!=null?r:[];return Gn(n,i,e,"right")},Q(e.options,je,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],n=>[...n].reverse(),Q(e.options,je,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),Q(e.options,je,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),Q(e.options,je,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),Q(e.options,je,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),Q(e.options,je,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),Q(e.options,je,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),Q(e.options,je,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),Q(e.options,je,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),Q(e.options,je,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),Q(e.options,je,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),Q(e.options,je,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,s,a,d,c;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(d=(c=o[0])==null?void 0:c.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},Q(e.options,je,"getLeafHeaders"))}};function Gn(e,n,t,o){var r,i;let s=0;const a=function(g,u){u===void 0&&(u=1),s=Math.max(s,u),g.filter(p=>p.getIsVisible()).forEach(p=>{var h;(h=p.columns)!=null&&h.length&&a(p.columns,u+1)},0)};a(e);let d=[];const c=(g,u)=>{const p={depth:u,id:[o,`${u}`].filter(Boolean).join("_"),headers:[]},h=[];g.forEach(m=>{const b=[...h].reverse()[0],w=m.column.depth===p.depth;let y,C=!1;if(w&&m.column.parent?y=m.column.parent:(y=m.column,C=!0),b&&b?.column===y)b.subHeaders.push(m);else{const I=Mi(t,y,{id:[o,u,y.id,m?.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${h.filter(x=>x.column===y).length}`:void 0,depth:u,index:h.length});I.subHeaders.push(m),h.push(I)}p.headers.push(m),m.headerGroup=p}),d.push(p),u>0&&c(h,u-1)},f=n.map((g,u)=>Mi(t,g,{depth:s,index:u}));c(f,s-1),d.reverse();const _=g=>g.filter(p=>p.column.getIsVisible()).map(p=>{let h=0,m=0,b=[0];p.subHeaders&&p.subHeaders.length?(b=[],_(p.subHeaders).forEach(y=>{let{colSpan:C,rowSpan:I}=y;h+=C,b.push(I)})):h=1;const w=Math.min(...b);return m=m+w,p.colSpan=h,p.rowSpan=m,{colSpan:h,rowSpan:m}});return _((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const Mo=(e,n,t,o,r,i,s)=>{let a={id:n,index:o,original:t,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(a._valuesCache.hasOwnProperty(d))return a._valuesCache[d];const c=e.getColumn(d);if(c!=null&&c.accessorFn)return a._valuesCache[d]=c.accessorFn(a.original,o),a._valuesCache[d]},getUniqueValues:d=>{if(a._uniqueValuesCache.hasOwnProperty(d))return a._uniqueValuesCache[d];const c=e.getColumn(d);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[d]=c.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[d]):(a._uniqueValuesCache[d]=[a.getValue(d)],a._uniqueValuesCache[d])},renderValue:d=>{var c;return(c=a.getValue(d))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>gc(a.subRows,d=>d.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let d=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;d.push(f),c=f}return d.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],d=>d.map(c=>_c(e,a,c,c.id)),Q(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[a.getAllCells()],d=>d.reduce((c,f)=>(c[f.column.id]=f,c),{}),Q(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const c=e._features[d];c==null||c.createRow==null||c.createRow(a,e)}return a},mc={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Fi=(e,n,t)=>{var o,r;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(n))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Fi.autoRemove=e=>st(e);const Ni=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};Ni.autoRemove=e=>st(e);const Ai=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};Ai.autoRemove=e=>st(e);const Di=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};Di.autoRemove=e=>st(e);const Pi=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});Pi.autoRemove=e=>st(e)||!(e!=null&&e.length);const Oi=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Oi.autoRemove=e=>st(e)||!(e!=null&&e.length);const Vi=(e,n,t)=>e.getValue(n)===t;Vi.autoRemove=e=>st(e);const Li=(e,n,t)=>e.getValue(n)==t;Li.autoRemove=e=>st(e);const Fo=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};Fo.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(r)?1/0:r;if(i>s){const a=i;i=s,s=a}return[i,s]},Fo.autoRemove=e=>st(e)||st(e[0])&&st(e[1]);const ht={includesString:Fi,includesStringSensitive:Ni,equalsString:Ai,arrIncludes:Di,arrIncludesAll:Pi,arrIncludesSome:Oi,equals:Vi,weakEquals:Li,inNumberRange:Fo};function st(e){return e==null||e===""}const vc={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ze("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);return typeof o=="string"?ht.includesString:typeof o=="number"?ht.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?ht.equals:Array.isArray(o)?ht.arrIncludes:ht.weakEquals},e.getFilterFn=()=>{var t,o;return Hn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:ht[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(f=>f.id===e.id),s=It(t,i?i.value:void 0);if(Ti(r,s,e)){var a;return(a=o?.filter(f=>f.id!==e.id))!=null?a:[]}const d={id:e.id,value:s};if(i){var c;return(c=o?.map(f=>f.id===e.id?d:f))!=null?c:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var i;return(i=It(n,r))==null?void 0:i.filter(s=>{const a=t.find(d=>d.id===s.id);if(a){const d=a.getFilterFn();if(Ti(d,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},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 Ti(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const No={sum:(e,n,t)=>t.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,r;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=r=s):(o>s&&(o=s),r<s&&(r=s)))}),[o,r]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},median:(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!fc(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,s)=>i-s);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),uniqueCount:(e,n)=>new Set(n.map(t=>t.getValue(e))).size,count:(e,n)=>n.length},bc={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ze("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);if(typeof o=="number")return No.sum;if(Object.prototype.toString.call(o)==="[object Date]")return No.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return Hn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:No[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},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,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function wc(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(i=>!n.includes(i.id));return t==="remove"?o:[...n.map(i=>e.find(s=>s.id===i)).filter(Boolean),...o]}const yc={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ze("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=J(t=>[cn(n,t)],t=>t.findIndex(o=>o.id===e.id),Q(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=cn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=cn(n,t);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const s=[...n],a=[...r];for(;a.length&&s.length;){const d=s.shift(),c=a.findIndex(f=>f.id===d);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return wc(i,t,o)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},Ao=()=>({left:[],right:[]}),Cc={getInitialState:e=>({columnPinning:Ao(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ze("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,s;if(t==="right"){var a,d;return{left:((a=r?.left)!=null?a:[]).filter(_=>!(o!=null&&o.includes(_))),right:[...((d=r?.right)!=null?d:[]).filter(_=>!(o!=null&&o.includes(_))),...o]}}if(t==="left"){var c,f;return{left:[...((c=r?.left)!=null?c:[]).filter(_=>!(o!=null&&o.includes(_))),...o],right:((f=r?.right)!=null?f:[]).filter(_=>!(o!=null&&o.includes(_)))}}return{left:((i=r?.left)!=null?i:[]).filter(_=>!(o!=null&&o.includes(_))),right:((s=r?.right)!=null?s:[]).filter(_=>!(o!=null&&o.includes(_)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,s;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(s=n.options.enableColumnPinning)!=null?s:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(a=>a.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(a=>o?.includes(a)),s=t.some(a=>r?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(s=>!i.includes(s.column.id))},Q(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Q(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Q(n.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?Ao():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:Ao())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),Q(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),Q(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(i=>!r.includes(i.id))},Q(e.options,"debugColumns","getCenterLeafColumns"))}};function Sc(e){return e||(typeof document<"u"?document:null)}const Wn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Do=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),xc={getDefaultColumnDef:()=>Wn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Do(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ze("columnSizing",e),onColumnSizingInfoChange:Ze("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Wn.minSize,(o=i??e.columnDef.size)!=null?o:Wn.size),(r=e.columnDef.maxSize)!=null?r:Wn.maxSize)},e.getStart=J(t=>[t,cn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),Q(n.options,"debugColumns","getStart")),e.getAfter=J(t=>[t,cn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),Q(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Po(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[o.id,o.getSize()]],d=Po(i)?Math.round(i.touches[0].clientX):i.clientX,c={},f=(b,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(y=>{var C,I;const x=n.options.columnResizeDirection==="rtl"?-1:1,M=(w-((C=y?.startOffset)!=null?C:0))*x,k=Math.max(M/((I=y?.startSize)!=null?I:0),-.999999);return y.columnSizingStart.forEach(T=>{let[A,V]=T;c[A]=Math.round(Math.max(V+V*k,0)*100)/100}),{...y,deltaOffset:M,deltaPercentage:k}}),(n.options.columnResizeMode==="onChange"||b==="end")&&n.setColumnSizing(y=>({...y,...c})))},_=b=>f("move",b),g=b=>{f("end",b),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},u=Sc(t),p={moveHandler:b=>_(b.clientX),upHandler:b=>{u?.removeEventListener("mousemove",p.moveHandler),u?.removeEventListener("mouseup",p.upHandler),g(b.clientX)}},h={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),_(b.touches[0].clientX),!1),upHandler:b=>{var w;u?.removeEventListener("touchmove",h.moveHandler),u?.removeEventListener("touchend",h.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),g((w=b.touches[0])==null?void 0:w.clientX)}},m=$c()?{passive:!1}:!1;Po(i)?(u?.addEventListener("touchmove",h.moveHandler,m),u?.addEventListener("touchend",h.upHandler,m)):(u?.addEventListener("mousemove",p.moveHandler,m),u?.addEventListener("mouseup",p.upHandler,m)),n.setColumnSizingInfo(b=>({...b,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?Do():(t=e.initialState.columnSizingInfo)!=null?t:Do())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let Kn=null;function $c(){if(typeof Kn=="boolean")return Kn;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return Kn=e,Kn}function Po(e){return e.type==="touchstart"}const Ic={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ze("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),Q(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],Q(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>J(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Q(e.options,"debugColumns",t));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function cn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Ec={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()}}},kc={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ze("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ht.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return Hn(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:ht[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},Mc={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ze("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");o=Math.max(o,s.length)}),o},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,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let s={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=o,t=(r=t)!=null?r:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:a,...d}=s;return d}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o?.[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},Oo=0,Vo=10,Lo=()=>({pageIndex:Oo,pageSize:Vo}),Fc={getInitialState:e=>({...e,pagination:{...Lo(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ze("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=i=>It(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Lo():(r=e.initialState.pagination)!=null?r:Lo())},e.setPageIndex=o=>{e.setPagination(r=>{let i=It(o,r.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Oo:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Oo)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?Vo:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Vo)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,It(o,r.pageSize)),s=r.pageSize*r.pageIndex,a=Math.floor(s/i);return{...r,pageIndex:a,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let s=It(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),e.getPageOptions=J(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,s)=>s)),r},Q(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+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 o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},To=()=>({top:[],bottom:[]}),Nc={getInitialState:e=>({rowPinning:To(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ze("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:c}=d;return c}):[],s=r?e.getParentRows().map(d=>{let{id:c}=d;return c}):[],a=new Set([...s,e.id,...i]);n.setRowPinning(d=>{var c,f;if(t==="bottom"){var _,g;return{top:((_=d?.top)!=null?_:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((g=d?.bottom)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(t==="top"){var u,p;return{top:[...((u=d?.top)!=null?u:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((p=d?.bottom)!=null?p:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=d?.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((f=d?.bottom)!=null?f:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,i=t.some(a=>o?.includes(a)),s=t.some(a=>r?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const i=(t=r==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(s=>{let{id:a}=s;return a});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?To():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:To())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(t??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:o}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),Q(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),Q(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(i=>!r.has(i.id))},Q(e.options,"debugRows","getCenterRows"))}},Ac={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ze("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{zo(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?Ro(e,t):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const a={...i};return zo(a,e.id,t,(s=o?.selectChildren)!=null?s:!0,n),a})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return qo(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return jo(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return jo(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},zo=(e,n,t,o,r)=>{var i;const s=r.getRow(n,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>zo(e,a.id,t,o,r))};function Ro(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(s,a){return s.map(d=>{var c;const f=qo(d,t);if(f&&(o.push(d),r[d.id]=d),(c=d.subRows)!=null&&c.length&&(d={...d,subRows:i(d.subRows)}),f)return d}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function qo(e,n){var t;return(t=n[e.id])!=null?t:!1}function jo(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!r)&&(s.getCanSelect()&&(qo(s,n)?i=!0:r=!1),s.subRows&&s.subRows.length)){const a=jo(s,n);a==="all"?i=!0:(a==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Bo=/([0-9]+)/gm,Dc=(e,n,t)=>zi(Et(e.getValue(t)).toLowerCase(),Et(n.getValue(t)).toLowerCase()),Pc=(e,n,t)=>zi(Et(e.getValue(t)),Et(n.getValue(t))),Oc=(e,n,t)=>Ho(Et(e.getValue(t)).toLowerCase(),Et(n.getValue(t)).toLowerCase()),Vc=(e,n,t)=>Ho(Et(e.getValue(t)),Et(n.getValue(t))),Lc=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},Tc=(e,n,t)=>Ho(e.getValue(t),n.getValue(t));function Ho(e,n){return e===n?0:e>n?1:-1}function Et(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function zi(e,n){const t=e.split(Bo).filter(Boolean),o=n.split(Bo).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),s=parseInt(r,10),a=parseInt(i,10),d=[s,a].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return t.length-o.length}const un={alphanumeric:Dc,alphanumericCaseSensitive:Pc,text:Oc,textCaseSensitive:Vc,datetime:Lc,basic:Tc},zc=[hc,Ic,yc,Cc,mc,vc,Ec,kc,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ze("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return un.datetime;if(typeof i=="string"&&(o=!0,i.split(Bo).length>1))return un.alphanumeric}return o?un.text:un.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return Hn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:un[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const a=s?.find(u=>u.id===e.id),d=s?.findIndex(u=>u.id===e.id);let c=[],f,_=i?t:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?a?f="toggle":f="add":s!=null&&s.length&&d!==s.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var g;c=[...s,{id:e.id,desc:_}],c.splice(0,c.length-((g=n.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=s.map(u=>u.id===e.id?{...u,desc:_}:u):f==="remove"?c=s.filter(u=>u.id!==e.id):c=[{id:e.id,desc:_}];return c})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},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())}},bc,Mc,Fc,Nc,Ac,xc];function Rc(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...zc,...(n=e._features)!=null?n:[]];let r={_features:o};const i=r._features.reduce((g,u)=>Object.assign(g,u.getDefaultOptions==null?void 0:u.getDefaultOptions(r)),{}),s=g=>r.options.mergeOptions?r.options.mergeOptions(i,g):{...i,...g};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(g=>{var u;d=(u=g.getInitialState==null?void 0:g.getInitialState(d))!=null?u:d});const c=[];let f=!1;const _={_features:o,options:{...i,...e},initialState:d,_queue:g=>{c.push(g),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(u=>setTimeout(()=>{throw u})))},reset:()=>{r.setState(r.initialState)},setOptions:g=>{const u=It(g,r.options);r.options=s(u)},getState:()=>r.options.state,setState:g=>{r.options.onStateChange==null||r.options.onStateChange(g)},_getRowId:(g,u,p)=>{var h;return(h=r.options.getRowId==null?void 0:r.options.getRowId(g,u,p))!=null?h:`${p?[p.id,u].join("."):u}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(g,u)=>{let p=(u?r.getPrePaginationRowModel():r.getRowModel()).rowsById[g];if(!p&&(p=r.getCoreRowModel().rowsById[g],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${g}`):new Error;return p},_getDefaultColumnDef:J(()=>[r.options.defaultColumn],g=>{var u;return g=(u=g)!=null?u:{},{header:p=>{const h=p.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:p=>{var h,m;return(h=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?h:null},...r._features.reduce((p,h)=>Object.assign(p,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...g}},Q(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:J(()=>[r._getColumnDefs()],g=>{const u=function(p,h,m){return m===void 0&&(m=0),p.map(b=>{const w=pc(r,b,m,h),y=b;return w.columns=y.columns?u(y.columns,w,m+1):[],w})};return u(g)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[r.getAllColumns()],g=>g.flatMap(u=>u.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[r.getAllFlatColumns()],g=>g.reduce((u,p)=>(u[p.id]=p,u),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(g,u)=>{let p=g.flatMap(h=>h.getLeafColumns());return u(p)},Q(e,"debugColumns","getAllLeafColumns")),getColumn:g=>{const u=r._getAllFlatColumnsById()[g];return process.env.NODE_ENV!=="production"&&!u&&console.error(`[Table] Column with id '${g}' does not exist.`),u}};Object.assign(r,_);for(let g=0;g<r._features.length;g++){const u=r._features[g];u==null||u.createTable==null||u.createTable(r)}return r}function qc(){return e=>J(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<r.length;c++){const f=Mo(e,e._getRowId(r[c],c,s),r[c],c,i,void 0,s?.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var d;f.originalSubRows=e.options.getSubRows(r[c],c),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=o(f.originalSubRows,i+1,f))}}return a};return t.rows=o(n),t},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function jc(e){const n=[],t=o=>{var r;n.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function Bc(e,n,t){return t.options.filterFromLeafRows?Hc(e,n,t):Gc(e,n,t)}function Hc(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,c){c===void 0&&(c=0);const f=[];for(let g=0;g<d.length;g++){var _;let u=d[g];const p=Mo(t,u.id,u.original,u.index,u.depth,void 0,u.parentId);if(p.columnFilters=u.columnFilters,(_=u.subRows)!=null&&_.length&&c<s){if(p.subRows=a(u.subRows,c+1),u=p,n(u)&&!p.subRows.length){f.push(u),i[u.id]=u,r.push(u);continue}if(n(u)||p.subRows.length){f.push(u),i[u.id]=u,r.push(u);continue}}else u=p,n(u)&&(f.push(u),i[u.id]=u,r.push(u))}return f};return{rows:a(e),flatRows:r,rowsById:i}}function Gc(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,a=function(d,c){c===void 0&&(c=0);const f=[];for(let g=0;g<d.length;g++){let u=d[g];if(n(u)){var _;if((_=u.subRows)!=null&&_.length&&c<s){const h=Mo(t,u.id,u.original,u.index,u.depth,void 0,u.parentId);h.subRows=a(u.subRows,c+1),u=h}f.push(u),r.push(u),i[u.id]=u}}return f};return{rows:a(e),flatRows:r,rowsById:i}}function Wc(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let g=0;g<n.flatRows.length;g++)n.flatRows[g].columnFilters={},n.flatRows[g].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(g=>{var u;const p=e.getColumn(g.id);if(!p)return;const h=p.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}r.push({id:g.id,filterFn:h,resolvedValue:(u=h.resolveFilterValue==null?void 0:h.resolveFilterValue(g.value))!=null?u:g.value})});const s=(t??[]).map(g=>g.id),a=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());o&&a&&d.length&&(s.push("__global__"),d.forEach(g=>{var u;i.push({id:g.id,filterFn:a,resolvedValue:(u=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?u:o})}));let c,f;for(let g=0;g<n.flatRows.length;g++){const u=n.flatRows[g];if(u.columnFilters={},r.length)for(let p=0;p<r.length;p++){c=r[p];const h=c.id;u.columnFilters[h]=c.filterFn(u,h,c.resolvedValue,m=>{u.columnFiltersMeta[h]=m})}if(i.length){for(let p=0;p<i.length;p++){f=i[p];const h=f.id;if(f.filterFn(u,h,f.resolvedValue,m=>{u.columnFiltersMeta[h]=m})){u.columnFilters.__global__=!0;break}}u.columnFilters.__global__!==!0&&(u.columnFilters.__global__=!1)}}const _=g=>{for(let u=0;u<s.length;u++)if(g.columnFilters[s[u]]===!1)return!1;return!0};return Bc(n.rows,_,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Kc(e){return n=>J(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=t;let{rows:s,flatRows:a,rowsById:d}=o;const c=r*i,f=c+r;s=s.slice(c,f);let _;n.options.paginateExpandedRows?_={rows:s,flatRows:a,rowsById:d}:_=jc({rows:s,flatRows:a,rowsById:d}),_.flatRows=[];const g=u=>{_.flatRows.push(u),u.subRows.length&&u.subRows.forEach(g)};return _.rows.forEach(g),_},Q(n.options,"debugTable","getPaginationRowModel"))}function Uc(){return e=>J(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],i=o.filter(d=>{var c;return(c=e.getColumn(d.id))==null?void 0:c.getCanSort()}),s={};i.forEach(d=>{const c=e.getColumn(d.id);c&&(s[d.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=d=>{const c=d.map(f=>({...f}));return c.sort((f,_)=>{for(let u=0;u<i.length;u+=1){var g;const p=i[u],h=s[p.id],m=h.sortUndefined,b=(g=p?.desc)!=null?g:!1;let w=0;if(m){const y=f.getValue(p.id),C=_.getValue(p.id),I=y===void 0,x=C===void 0;if(I||x){if(m==="first")return I?-1:1;if(m==="last")return I?1:-1;w=I&&x?0:I?m:-m}}if(w===0&&(w=h.sortingFn(f,_,p.id)),w!==0)return b&&(w*=-1),h.invertSorting&&(w*=-1),w}return f.index-_.index}),c.forEach(f=>{var _;r.push(f),(_=f.subRows)!=null&&_.length&&(f.subRows=a(f.subRows))}),c};return{rows:a(t.rows),flatRows:r,rowsById:t.rowsById}},Q(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
20
20
|
* react-table
|
|
21
21
|
*
|
|
22
22
|
* Copyright (c) TanStack
|
|
@@ -25,4 +25,5 @@
|
|
|
25
25
|
* LICENSE.md file in the root directory of this source tree.
|
|
26
26
|
*
|
|
27
27
|
* @license MIT
|
|
28
|
-
*/function Ut(e,n){return e?Uc(e)?I.createElement(e,n):e:null}function Uc(e){return Kc(e)||typeof e=="function"||Xc(e)}function Kc(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function Xc(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Yc(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=I.useState(()=>({current:Tc(n)})),[o,r]=I.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{r(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}function Zc(e,n,t=3){const o=Math.floor(t/2);let r=e-o;r<1&&(r=1),r+t-1>n&&(r=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,a)=>r+a)}function Jc(e,n){return n===0?0:e>=n?n-1:e<0?0:e}const ot={checkbox_wrapper:"_checkbox_wrapper_43ivv_1",label_text:"_label_text_43ivv_21",input:"_input_43ivv_37",radius_none:"_radius_none_43ivv_163",radius_sm:"_radius_sm_43ivv_171",radius_md:"_radius_md_43ivv_179",radius_lg:"_radius_lg_43ivv_187",radius_full:"_radius_full_43ivv_195",sm:"_sm_43ivv_203",lg:"_lg_43ivv_233",secondary:"_secondary_43ivv_263",success:"_success_43ivv_271",warning:"_warning_43ivv_279",danger:"_danger_43ivv_287",disabled:"_disabled_43ivv_361",readonly:"_readonly_43ivv_361",no_animation:"_no_animation_43ivv_509",only_icon:"_only_icon_43ivv_521",line_through:"_line_through_43ivv_573"},dn=v.forwardRef((e,n)=>{const{children:t,isSelected:o,defaultChecked:r,isIndeterminate:i=!1,isDisabled:s=!1,isReadOnly:a=!1,lineThrough:d=!1,onlyIcon:u=!1,disableAnimation:f=!1,size:h="md",color:g="primary",radius:c="md",className:p="",classNames:_={},onChange:m,...b}=e,w=v.useId(),[C,S]=v.useState(r??!1),x=o!==void 0?o:C;v.useEffect(()=>{n&&typeof n=="object"&&n.current&&(n.current.indeterminate=i??!1)},[i,n]);const y=M=>{if(s||a)return;const E=M.target.checked;o===void 0&&S(E),m==null||m(E)};return l.jsxs("label",{className:W(ot.checkbox_wrapper,ot[h],ot[g],ot[`radius_${c}`],{[ot.checked]:x,[ot.disabled]:s,[ot.readonly]:a,[ot.line_through]:d&&x},_.base,p),children:[l.jsx("input",{ref:n,id:w,type:"checkbox",className:W(ot.input,{[ot.only_icon]:u,[ot.no_animation]:f},_.wrapper),checked:x,onChange:y,disabled:s,readOnly:a,...b}),t&&l.jsx("span",{className:W(ot.label_text,_.label),children:t})]})});dn.displayName="Checkbox";const Lt={checkbox_group:"_checkbox_group_1sn8p_1",group_label:"_group_label_1sn8p_13",checkbox_list:"_checkbox_list_1sn8p_27",vertical:"_vertical_1sn8p_35",horizontal:"_horizontal_1sn8p_45",description:"_description_1sn8p_55",error_message:"_error_message_1sn8p_69"},Qc=({label:e,children:n,description:t,errorMessage:o,isInvalid:r,orientation:i="vertical",className:s="",value:a=[],onChange:d,isDisabled:u,isReadOnly:f})=>{const h=(g,c)=>{if(!d)return;const p=c?[...a,g]:a.filter(_=>_!==g);d(p)};return l.jsxs("div",{className:W(Lt.checkbox_group,s),children:[e&&l.jsx("span",{className:Lt.group_label,children:e}),l.jsx("div",{role:"group",className:W(Lt.checkbox_list,{[Lt.horizontal]:i==="horizontal",[Lt.vertical]:i==="vertical"}),children:v.Children.map(n,g=>{if(!v.isValidElement(g))return g;const c=g.props;return v.cloneElement(g,{isDisabled:u||c.isDisabled,isReadOnly:f||c.isReadOnly,isSelected:c.value?a.includes(c.value):c.isSelected,onChange:p=>{var _;c.value&&h(c.value,p),(_=c.onChange)==null||_.call(c,p)}})})}),r&&o?l.jsx("span",{className:Lt.error_message,children:o}):t?l.jsx("span",{className:Lt.description,children:t}):null]})},Ne={contenedor:"_contenedor_fe47o_1",contenedor_superior:"_contenedor_superior_fe47o_17",input_con_icono:"_input_con_icono_fe47o_35",icono_busqueda:"_icono_busqueda_fe47o_45",input_busqueda:"_input_busqueda_fe47o_65",contenedor_acciones_botones:"_contenedor_acciones_botones_fe47o_93",contenedor_acciones:"_contenedor_acciones_fe47o_93",boton_basico:"_boton_basico_fe47o_127",texto_filtros:"_texto_filtros_fe47o_141",menu_configuraciones:"_menu_configuraciones_fe47o_173",boton_excel:"_boton_excel_fe47o_183",contenedor_tabla:"_contenedor_tabla_fe47o_203",encabezados:"_encabezados_fe47o_221",contenedor_datos:"_contenedor_datos_fe47o_239",datos:"_datos_fe47o_247",seleccionada:"_seleccionada_fe47o_283",columna:"_columna_fe47o_299",boton_acciones:"_boton_acciones_fe47o_345"},mt=v.createContext(null);function eu({children:e,data:n,columns:t,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:a,descargarExcel:d,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:h}){const[g,c]=v.useState(""),p=Jl(g,200),_=jn("only screen and (max-width: 830px)"),[m,b]=v.useState({pageIndex:0,pageSize:s}),[w,C]=v.useState({}),S=v.useMemo(()=>{const D=[];if(f.length>0&&!_){const $={id:"select",header:({table:N})=>l.jsx(dn,{color:"secondary",isSelected:N.getIsAllPageRowsSelected(),isIndeterminate:N.getIsSomePageRowsSelected()&&!N.getIsAllPageRowsSelected(),onChange:j=>N.toggleAllPageRowsSelected(!!j)}),cell:({row:N})=>l.jsx(dn,{color:"secondary",isSelected:N.getIsSelected(),isDisabled:!N.getCanSelect(),onChange:j=>N.toggleSelected(j)}),enableSorting:!1,enableHiding:!1};D.push($)}if(D.push(...t),o!=null&&o.length){const $={id:"actions",header:"Acciones",cell:N=>l.jsx("div",{className:Ne.contenedor_acciones,children:o.map(j=>l.jsx("button",{type:"button",title:j.nombre,onClick:()=>j.evento(N.row.original),className:Ne.boton_acciones,children:j.icono},j.id))}),enableSorting:!1,enableHiding:!1};D.push($)}return D},[t,o,f,_]),x=v.useMemo(()=>S.map(D=>"accessorKey"in D?String(D.accessorKey):"id"in D?String(D.id):"").filter(Boolean),[S]),[y,M]=v.useState(x),E=Yc({data:n,columns:S,state:{pagination:m,globalFilter:p,columnOrder:y,rowSelection:w},enableRowSelection:f.length>0,onRowSelectionChange:C,onPaginationChange:b,onColumnOrderChange:M,getCoreRowModel:zc(),getSortedRowModel:Wc(),getFilteredRowModel:Hc(),getPaginationRowModel:Gc(),autoResetPageIndex:!1}),T=E.getPageCount();v.useEffect(()=>{const D=Jc(m.pageIndex,T);D!==m.pageIndex&&b($=>({...$,pageIndex:D}))},[T]),v.useEffect(()=>{p!==void 0&&E.setPageIndex(0)},[p]);const F=v.useMemo(()=>E.getAllLeafColumns().filter(D=>D.id!=="actions"&&D.id!=="select"),[E]),P=v.useCallback(D=>{const $=t.find(j=>"accessorKey"in j?j.accessorKey===D:j.id===D),N=$==null?void 0:$.header;return typeof N=="string"||typeof N=="number"?String(N):D},[t]),U=v.useCallback(()=>{E.setColumnVisibility({}),E.setPageSize(s),E.setPageIndex(0),E.resetRowSelection(),M(x)},[E,s,x]),z=v.useCallback(D=>{const $=Math.max(1,Math.min(200,D));E.setPageSize($),E.setPageIndex(0)},[E]),k=v.useCallback(D=>{M($=>typeof D=="function"?D($):D)},[]),O={state:{ordenColumnas:y,table:E,columns:S,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:g,setInputBusqueda:c,filtros:a,descargarExcel:d,actualizarTabla:u,selectorFilas:f,sinDatosProps:h},todasLasColumnas:F,etiquetaColumna:P,restaurarConfiguracion:U,cambiarPageSize:z,cambiarOrdenColumnas:k};return l.jsx(mt.Provider,{value:O,children:e})}function zi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Ri(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 tu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 nu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 ou(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function ru(e){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[l.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"}),l.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 iu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[l.jsx("circle",{cx:"12",cy:"12",r:"3"}),l.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 su(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:l.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 au(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[l.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),l.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),l.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function lu(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[l.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),l.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function cu(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[l.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),l.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function qi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function uu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M7.5 12.5q-.213 0-.356-.144T7 11.999t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143z"})})}function du(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:l.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 fu(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function gu(e,n,t){v.useEffect(()=>{if(!n)return;const o=i=>{const s=i.target;t.some(d=>{var u;return(u=d.current)==null?void 0:u.contains(s)})||e()},r=setTimeout(()=>{document.addEventListener("mousedown",o)},100);return()=>{clearTimeout(r),document.removeEventListener("mousedown",o)}},[n,e,...t])}function ji(e,n){v.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function _u(e,n,t,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:s=0,offsetTop:a=0,offsetBottom:d=0}){const[u,f]=v.useState({top:0,left:0}),h=jn("only screen and (max-width: 480px)");return v.useEffect(()=>{if(!t||!e.current)return;const g=()=>{var b;const c=e.current.getBoundingClientRect();let p=c.bottom+a,_=0;if(h)_=window.innerWidth-o-r;else{const w=c.right-o+i-s;_=Math.max(r,Math.min(w,window.innerWidth-o-r))}const m=((b=n.current)==null?void 0:b.offsetHeight)||400;p+m>window.innerHeight-r&&(p=c.top-m-d,p<r&&(p=c.bottom+a)),f({top:p,left:_})};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[t,h,o,r,i,s,a,d,e,n]),u}const vt={contenedor:"_contenedor_xw36f_1",popover:"_popover_xw36f_9",popover_entrada:"_popover_entrada_xw36f_43",desvanecerDeslizarEntrada:"_desvanecerDeslizarEntrada_xw36f_1",popover_salida:"_popover_salida_xw36f_51",desvanecerDeslizarSalida:"_desvanecerDeslizarSalida_xw36f_1",ventana:"_ventana_xw36f_123",panel:"_panel_xw36f_141",panel_forward:"_panel_forward_xw36f_159",panelForwardIn:"_panelForwardIn_xw36f_1",panel_backward:"_panel_backward_xw36f_167",panelBackwardIn:"_panelBackwardIn_xw36f_1",header:"_header_xw36f_223",titulo:"_titulo_xw36f_247"},pu=({titulo:e,onBack:n})=>l.jsxs("header",{className:vt.header,children:[l.jsx(lt,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:l.jsx(zi,{})}),l.jsx("h3",{className:vt.titulo,children:e})]}),Vt={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function hu(){const e=v.useContext(mt),{state:n,todasLasColumnas:t,etiquetaColumna:o,cambiarOrdenColumnas:r}=e||{},{table:i,ordenColumnas:s}=n||{},[a,d]=v.useState(null);if(!t||!o||!i||!s)return null;const u=g=>c=>{d(g),c.dataTransfer.effectAllowed="move",c.dataTransfer.setData("text/plain",g)},f=g=>c=>{c.preventDefault(),!(!a||a===g)&&(r==null||r(p=>{const _=[...p],m=_.indexOf(a),b=_.indexOf(g);return m===-1||b===-1?p:(_.splice(m,1),_.splice(b,0,a),_)}))},h=()=>d(null);return l.jsx("div",{className:Vt.contenedor,children:l.jsx("ul",{className:Vt.lista,children:s.map(g=>{var b;const c=t.find(w=>w.id===g);if(!c)return null;const p=((b=c.getCanHide)==null?void 0:b.call(c))??!0,_=c.getIsVisible(),m=a===c.id;return l.jsxs("li",{className:`${Vt.item} ${m?Vt.item_dragging:""}`,draggable:!0,onDragStart:u(c.id),onDragOver:f(c.id),onDrop:h,onDragEnd:h,children:[l.jsx("span",{className:Vt.icono_drag,"aria-label":"Arrastrar columna",children:l.jsx(au,{})}),l.jsx("span",{className:Vt.nombre,children:o(c.id)}),l.jsx(dn,{size:"md",color:"primary",isSelected:_,isDisabled:!p,onChange:w=>c.toggleVisibility(w),className:Vt.checkbox})]},c.id)})})})}const fn={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function mu(){const e=v.useContext(mt),{state:n,cambiarPageSize:t}=e||{},{table:o}=n||{},[r,i]=v.useState(""),s=v.useRef(null);if(!o)return null;const a=o.getState().pagination.pageSize;v.useEffect(()=>i(String(a)),[a]);const d=c=>Math.max(Go,Math.min(Wo,c)),u=c=>{const p=a+c;p>=Go&&p<=Wo&&(t==null||t(p))},f=()=>{const c=parseInt(r,10),p=!isNaN(c)&&c>0?d(c):a;t==null||t(p),i(String(p))},h=c=>{var _;const p={Enter:()=>{var m;f(),(m=s.current)==null||m.blur()},Escape:()=>{var m;i(String(a)),(m=s.current)==null||m.blur()},ArrowUp:()=>{c.preventDefault(),u(1),setTimeout(()=>{var m;return(m=s.current)==null?void 0:m.select()},0)},ArrowDown:()=>{c.preventDefault(),u(-1),setTimeout(()=>{var m;return(m=s.current)==null?void 0:m.select()},0)}};(_=p[c.key])==null||_.call(p)},g=c=>{const p=c.target.value;(p===""||/^\d+$/.test(p))&&i(p)};return l.jsxs("div",{className:fn.contenido,children:[l.jsx("p",{className:fn.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),l.jsxs("div",{className:fn.control,children:[l.jsx(lt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>u(-1),"aria-label":"Disminuir filas",disabled:a<=Go,children:l.jsx(uu,{style:{fontSize:"var(--gaps-6)"}})}),l.jsx("div",{className:fn.valor,children:l.jsx("input",{ref:s,type:"text",inputMode:"numeric",value:r,onChange:g,onKeyDown:h,onFocus:()=>{var c;return(c=s.current)==null?void 0:c.select()},onBlur:f,className:fn.input,"aria-label":"Número de filas por página"})}),l.jsx(lt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>u(1),"aria-label":"Aumentar filas",disabled:a>=Wo,children:l.jsx(qi,{})})]})]})}const He={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function vu({navegar:e}){const n=v.useContext(mt);return l.jsxs("div",{className:He.contenedor,children:[l.jsx("nav",{className:He.menu,children:yu.map(({id:t,icono:o,nombre:r,descripcion:i})=>l.jsxs("button",{className:He.item,onClick:()=>e(t),children:[l.jsx("div",{className:He.icono_contenedor,children:l.jsx(o,{})}),l.jsxs("div",{className:He.texto,children:[l.jsx("span",{className:He.nombre,children:r}),l.jsx("span",{className:He.descripcion,children:i})]}),l.jsx(Ri,{className:He.chevron})]},t))}),l.jsx("div",{className:He.divider}),l.jsx("div",{className:He.menu,children:l.jsxs("button",{className:He.item,onClick:n==null?void 0:n.restaurarConfiguracion,children:[l.jsx("div",{className:He.icono_contenedor,children:l.jsx(su,{})}),l.jsxs("div",{className:He.texto,children:[l.jsx("span",{className:He.nombre,children:"Restaurar configuración"}),l.jsx("span",{className:He.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Go=1,Wo=200,Bi=250,bu=200,wu={panelPrincipal:{component:vu},panelColumnas:{component:hu,titulo:"Columnas visibles"},panelFilas:{component:mu,titulo:"Filas por página"}},yu=[{id:"panelColumnas",icono:lu,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:cu,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function Cu(){const[e,n]=v.useState(!1),[t,o]=v.useState(!1),[r,i]=v.useState("panelPrincipal"),[s,a]=v.useState(null),d=v.useRef(null),u=v.useRef(null),f=v.useRef(null);fu(t),gu(()=>g(),t,[d,u]),ji(()=>g(),t);const h=_u(d,u,t,{width:Bi,offsetRight:6,offsetTop:-2});v.useEffect(()=>{e&&(o(!0),a(null))},[e]),v.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function g(){t&&(n(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),a(null)},bu))}function c(m){a(m==="panelPrincipal"?"backward":"forward"),i(m)}const p=wu[r],_=p.component;return l.jsxs("div",{className:vt.contenedor,children:[l.jsx(lt,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>n(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:l.jsx(iu,{})}),t&&d.current&&Zn.createPortal(l.jsx("div",{ref:u,className:`${vt.popover} ${e?vt.popover_entrada:vt.popover_salida}`,role:"dialog",style:{top:`${h.top}px`,left:`${h.left}px`,width:Bi},children:l.jsx("div",{className:vt.ventana,children:l.jsxs("div",{className:W([vt.panel,vt[`panel_${s}`]]),children:[p.titulo&&l.jsx(pu,{titulo:p.titulo,onBack:()=>c("panelPrincipal")}),l.jsx(_,{navegar:c})]},r)})}),document.body)]})}function Su(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function Kt(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return Ut(o.column.columnDef.header,o.getContext());const r=n.getAllLeafColumns().find(s=>s.id===e),i=r==null?void 0:r.columnDef.header;return typeof i=="string"||typeof i=="number"?i:(r==null?void 0:r.id)??e}function Hi(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?Ut(t.column.columnDef.cell,t.getContext()):null}function Gi(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function xu(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function $u(e,n){if(n===0)return"";if(n===1)return Uo(e[0].nombre.toLowerCase());if(n===2)return`${Uo(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=n-2;return`${Uo(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Uo(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Iu(){var u;const e=(u=v.useContext(mt))==null?void 0:u.state,{inputBusqueda:n,setInputBusqueda:t,filtros:o,actualizarTabla:r,descargarExcel:i}=e||{},{abrirFiltros:s,filtrosAplicados:a=[]}=o||{},d=(a==null?void 0:a.length)||0;return l.jsxs("section",{className:Ne.contenedor_superior,children:[l.jsxs("div",{className:Ne.input_con_icono,children:[l.jsx(tu,{className:Ne.icono_busqueda}),l.jsx("input",{type:"text",placeholder:"Buscar...",value:n??"",onChange:f=>t&&t(f.target.value),className:Ne.input_busqueda})]}),l.jsxs("div",{className:Ne.contenedor_acciones_botones,children:[l.jsxs("div",{className:Ne.contenedor_acciones,children:[r!==void 0&&l.jsxs(lt,{variant:"light",className:Ne.boton_basico,disabled:r==null?void 0:r.cargando,onClick:r==null?void 0:r.onClick,children:[l.jsx(ru,{}),r!=null&&r.cargando?"Actualizando...":"Actualizar tabla"]}),s!==void 0&&l.jsxs(lt,{onClick:s,variant:"light",className:Ne.boton_basico,children:[l.jsx(ou,{})," Filtros"]}),d>0?l.jsxs("div",{className:Ne.texto_filtros,children:[l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:l.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),l.jsx("p",{children:$u(a,d)})]}):null]}),i!==void 0?l.jsxs(lt,{onClick:i,className:`${Ne.boton_basico} ${Ne.boton_excel}`,children:[l.jsx(nu,{})," Excel"]}):null]}),l.jsx("div",{className:Ne.menu_configuraciones,children:l.jsx(Cu,{})})]})}const Mt={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function Eu(){var c;const e=(c=v.useContext(mt))==null?void 0:c.state,{table:n}=e||{};if(!n)return null;const t=n.getPrePaginationRowModel().rows.length,o=n.getPageCount()||1,{pageIndex:r}=n.getState().pagination,i=r+1,s=Zc(i,o),a=n.getCanPreviousPage(),d=n.getCanNextPage(),u=o>1,f=()=>{a&&n.previousPage()},h=()=>{d&&n.nextPage()},g=p=>{n.setPageIndex(p-1)};return l.jsxs("section",{className:Mt.contenedor_paginacion,children:[l.jsxs("p",{className:Mt.info_paginacion,children:["Documentos: ",t]}),u&&l.jsxs("div",{className:Mt.contenedor_botones,children:[a&&l.jsx(zi,{onClick:f,"aria-disabled":!a,className:Mt.boton_paginacion}),s.map(p=>l.jsx("button",{type:"button",onClick:()=>g(p),className:p===i?Mt.pagina_activa:Mt.boton_num_paginacion,children:p},p)),d&&l.jsx(Ri,{onClick:h,"aria-disabled":!d,className:Mt.boton_paginacion})]}),l.jsxs("p",{className:Mt.info_paginacion,children:["Página ",i," de ",o]})]})}const be={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"},Ft={contenedor:"_contenedor_1dqtq_1",envolvedor_cuadricula:"_envolvedor_cuadricula_1dqtq_33",svg_cuadricula:"_svg_cuadricula_1dqtq_61",envolvedor_contenido:"_envolvedor_contenido_1dqtq_77",icono_carpeta:"_icono_carpeta_1dqtq_97",titulo:"_titulo_1dqtq_111",descripcion:"_descripcion_1dqtq_129",boton_agregar:"_boton_agregar_1dqtq_145"};function Wi(){const e=v.useContext(mt),{sinDatosProps:n}=(e==null?void 0:e.state)||{},{alAgregarRegistro:t,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:i="Agregar nuevo registro"}=n||{};return l.jsxs("div",{className:Ft.contenedor,children:[l.jsx(ku,{}),l.jsxs("div",{className:Ft.envolvedor_contenido,children:[l.jsx(Mu,{}),l.jsx("h3",{className:Ft.titulo,children:o}),l.jsx("p",{className:Ft.descripcion,children:r}),t?l.jsxs(lt,{onClick:t,variant:"bordered",className:Ft.boton_agregar,children:[l.jsx(qi,{})," ",i]}):null]})]})}function ku(){return l.jsx("div",{className:Ft.envolvedor_cuadricula,children:l.jsxs("svg",{className:Ft.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("defs",{children:l.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:l.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),l.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Mu(){return l.jsxs("svg",{className:Ft.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.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)"}),l.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"}),l.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),l.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),l.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),l.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),l.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const bt={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 Fu({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:r}){const s=t.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),a=["25vw","30vw","20vw","28vw","22vw","26vw"];return l.jsx("section",{className:be.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>l.jsxs("article",{className:be.contenedor_card,children:[l.jsxs("div",{className:be.contenedor_encabezado_card,children:[l.jsx("div",{className:be.contenedor_columna_card,children:o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(o,t)}),l.jsx("div",{className:be.card_valor,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_encabezado}`})})]})}),l.jsx("div",{className:be.contenedor_columna_card,children:r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(r,t)}),l.jsx("div",{className:be.card_segundo_valor,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_encabezado_segundo}`})})]})})]}),l.jsx("div",{className:be.contenedor_contenido_cards,children:s.map((f,h)=>l.jsxs("div",{className:be.contenedor_fila_card,children:[l.jsx("div",{className:be.card_fila_label,children:Kt(f.id,t)}),l.jsx("div",{className:be.card_fila_valor,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_contenido}`,style:{width:a[h%a.length]}})})]},f.id))}),n>0&&l.jsx("div",{className:be.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((f,h)=>l.jsx("div",{className:bt.skeleton_accion,children:l.jsx("div",{className:`${bt.skeleton_elemento} ${bt.skeleton_elemento_encabezado}`})},`accion-${h}`))})]},`skeleton-card-${u}`))})}function Ui(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Ki(e){if(e)return e.id??e.accessorKey}const Au=({fila:e,controls:n})=>((n==null?void 0:n.length)??0)>0?l.jsx("div",{className:be.contenedor_acciones_card,children:n==null?void 0:n.map(o=>l.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${be.boton_acciones} ${be.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Du=({columnasRestantes:e,table:n})=>e.length===0?null:l.jsx("div",{className:be.contenedor_contenido_cards,children:e.map(t=>l.jsxs("div",{className:be.contenedor_fila_card,children:[l.jsx("div",{className:be.card_fila_label,children:Kt(t.column.id,n)}),l.jsx("div",{className:be.card_fila_valor,children:Ut(t.column.columnDef.cell,t.getContext())})]},t.id))}),Ou=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const r=Gi(e,t),i=Gi(e,o);return l.jsxs("div",{className:be.contenedor_encabezado_card,children:[l.jsx("div",{className:be.contenedor_columna_card,children:t&&r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(t,n)}),l.jsx("div",{className:be.card_valor,children:Hi(e,t)})]})}),l.jsx("div",{className:be.contenedor_columna_card,children:o&&i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:be.card_label,children:Kt(o,n)}),l.jsx("div",{className:be.card_segundo_valor,children:Hi(e,o)})]})})]})};function Pu(){var h;const e=(h=v.useContext(mt))==null?void 0:h.state,{table:n,controls:t,primerasColumnas:o,loading:r,columns:i}=e||{};if(!n)return null;const s=i&&o?Ui(i,o[0]):void 0,a=i&&o?Ui(i,o[1]):void 0,d=Ki(s),u=Ki(a);if(r)return l.jsx(Fu,{filas:3,cantidadControles:(t==null?void 0:t.length)??0,table:n,idPrimeraColumna:d,idSegundaColumna:u});const f=n.getRowModel().rows;return f.length===0?l.jsx("article",{className:be.contenedor_card,children:l.jsx(Wi,{})}):l.jsx("section",{className:be.contenedor_tabla_cards,children:f.map(g=>{const c=xu(g,d,u);return l.jsxs("article",{className:be.contenedor_card,children:[l.jsx(Ou,{fila:g,table:n,idPrimeraColumna:d,idSegundaColumna:u}),l.jsx(Du,{columnasRestantes:c,table:n}),l.jsx(Au,{fila:g,controls:t})]},g.id)})})}const Xi={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},Nu=({columnas:e,filas:n})=>l.jsx(l.Fragment,{children:Array.from({length:n}).map((t,o)=>l.jsx("tr",{className:Xi.filas,children:Array.from({length:e}).map((r,i)=>l.jsx("td",{className:Xi.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),Tt={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function Lu({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[r,i]=v.useState(0),[s,a]=v.useState([]),[d,u]=v.useState([]),f=e>0,h=v.useRef(null);return ji(o,f),v.useEffect(()=>{f&&(i(e),a(n),u(t))},[e,n,t,f]),l.jsx(hn,{mostrar:f,tipo:"escalar",className:Tt.contenedor,children:l.jsxs("div",{ref:h,className:Tt.barra,children:[l.jsxs("div",{className:Tt.info,children:[l.jsx(lt,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:Tt.btn_cerrar,children:l.jsx(du,{})}),l.jsxs("p",{className:Tt.contador,children:[r," filas seleccionadas"]})]}),l.jsx("div",{className:Tt.separador}),l.jsx("div",{className:Tt.acciones,children:s.map(g=>l.jsx("div",{children:g.componente(d)},g.id))})]})})}function Vu(){var h;const e=(h=v.useContext(mt))==null?void 0:h.state,{table:n,loading:t,columns:o,selectorFilas:r=[]}=e||{};if(!n)return null;const i=n.getHeaderGroups(),s=n.getRowModel().rows,a=(o==null?void 0:o.length)??0,d=n.getSelectedRowModel().rows,u=d.length,f=()=>{n.resetRowSelection()};return l.jsxs(l.Fragment,{children:[l.jsxs("table",{className:Ne.contenedor_tabla,children:[l.jsx("thead",{children:i.map(g=>l.jsx("tr",{children:g.headers.map(c=>{var _;const p=(_=c.column.columnDef.meta)==null?void 0:_.style;return l.jsx("th",{className:Ne.encabezados,style:p,children:c.id==="select"?l.jsx("div",{children:Ut(c.column.columnDef.header,c.getContext())}):l.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[Ut(c.column.columnDef.header,c.getContext()),Su(c.column.getIsSorted())]})},c.id)})},g.id))}),t&&l.jsx(Nu,{columnas:a,filas:10}),!t&&l.jsx("tbody",{className:Ne.contenedor_datos,children:s.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:a,style:{backgroundColor:"var(--base)"},children:l.jsx(Wi,{})})}):s.map(g=>l.jsx("tr",{className:`${Ne.datos} ${g.getIsSelected()?Ne.seleccionada:""}`,children:g.getVisibleCells().map(c=>{var _;const p=(_=c.column.columnDef.meta)==null?void 0:_.style;return l.jsx("td",{className:Ne.columna,style:p,children:Ut(c.column.columnDef.cell,c.getContext())},c.id)})},g.id))})]}),(r==null?void 0:r.length)>0?l.jsx(Lu,{totalSeleccionadas:u,acciones:r,filasSeleccionadas:d.map(g=>g.original),onLimpiarSeleccion:f}):null]})}function Tu({id:e}){const n=jn("only screen and (max-width: 830px)");return l.jsxs("main",{className:Ne.contenedor,id:e,children:[l.jsx(Iu,{}),n?l.jsx(Pu,{}):l.jsx(Vu,{}),l.jsx(Eu,{})]})}function zu({id:e,...n}){return l.jsx(eu,{...n,children:l.jsx(Tu,{id:e})})}ce.BadgeVoz=to,ce.Boton=lt,ce.Checkbox=dn,ce.CheckboxGroup=Qc,ce.FirmaManual=Qo,ce.GrabacionIcono=sr,ce.InputDate=ir,ce.InputNumeric=rr,ce.InputText=er,ce.MicrofonoIcono=Qn,ce.Select=Ei,ce.SonidoIcono=eo,ce.TablaDatos=zu,ce.TextArea=lr,ce.Transicion=hn,ce.aplanarOpcionesAgrupadas=$i,ce.esOpcionesAgrupadas=xi,ce.estaDeshabilitada=ln,ce.estaSeleccionada=Si,ce.fechaEnRango=ys,ce.filtrarOpciones=ko,ce.filtrarOpcionesAgrupadas=Ii,ce.formatearFecha=bs,ce.formatearNumero=Xt,ce.generarOpcionesAleatorias=ic,ce.generarUsuariosPrueba=sc,ce.obtenerFechaHoy=ws,ce.obtenerLabelOpcion=Bn,ce.obtenerValorOpcion=Wt,ce.parsearNumero=tr,ce.procesarValidacion=nr,ce.redondearDecimales=or,ce.restringirRango=pn,ce.useReconocimientoVoz=ar,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})}));
|
|
28
|
+
*/function Kt(e,n){return e?Xc(e)?S.createElement(e,n):e:null}function Xc(e){return Yc(e)||typeof e=="function"||Zc(e)}function Yc(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function Zc(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Jc(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=S.useState(()=>({current:Rc(n)})),[o,r]=S.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{r(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}const ot={checkbox_wrapper:"_checkbox_wrapper_43ivv_1",label_text:"_label_text_43ivv_21",input:"_input_43ivv_37",radius_none:"_radius_none_43ivv_163",radius_sm:"_radius_sm_43ivv_171",radius_md:"_radius_md_43ivv_179",radius_lg:"_radius_lg_43ivv_187",radius_full:"_radius_full_43ivv_195",sm:"_sm_43ivv_203",lg:"_lg_43ivv_233",secondary:"_secondary_43ivv_263",success:"_success_43ivv_271",warning:"_warning_43ivv_279",danger:"_danger_43ivv_287",disabled:"_disabled_43ivv_361",readonly:"_readonly_43ivv_361",no_animation:"_no_animation_43ivv_509",only_icon:"_only_icon_43ivv_521",line_through:"_line_through_43ivv_573"},dn=v.forwardRef((e,n)=>{const{children:t,isSelected:o,defaultChecked:r,isIndeterminate:i=!1,isDisabled:s=!1,isReadOnly:a=!1,lineThrough:d=!1,onlyIcon:c=!1,disableAnimation:f=!1,size:_="md",color:g="primary",radius:u="md",className:p="",classNames:h={},onChange:m,...b}=e,w=v.useId(),[y,C]=v.useState(r??!1),I=o!==void 0?o:y;v.useEffect(()=>{n&&typeof n=="object"&&n.current&&(n.current.indeterminate=i??!1)},[i,n]);const x=M=>{if(s||a)return;const k=M.target.checked;o===void 0&&C(k),m?.(k)};return l.jsxs("label",{className:H(ot.checkbox_wrapper,ot[_],ot[g],ot[`radius_${u}`],{[ot.checked]:I,[ot.disabled]:s,[ot.readonly]:a,[ot.line_through]:d&&I},h.base,p),children:[l.jsx("input",{ref:n,id:w,type:"checkbox",className:H(ot.input,{[ot.only_icon]:c,[ot.no_animation]:f},h.wrapper),checked:I,onChange:x,disabled:s,readOnly:a,...b}),t&&l.jsx("span",{className:H(ot.label_text,h.label),children:t})]})});dn.displayName="Checkbox";const Vt={checkbox_group:"_checkbox_group_1sn8p_1",group_label:"_group_label_1sn8p_13",checkbox_list:"_checkbox_list_1sn8p_27",vertical:"_vertical_1sn8p_35",horizontal:"_horizontal_1sn8p_45",description:"_description_1sn8p_55",error_message:"_error_message_1sn8p_69"},Qc=({label:e,children:n,description:t,errorMessage:o,isInvalid:r,orientation:i="vertical",className:s="",value:a=[],onChange:d,isDisabled:c,isReadOnly:f})=>{const _=(g,u)=>{if(!d)return;const p=u?[...a,g]:a.filter(h=>h!==g);d(p)};return l.jsxs("div",{className:H(Vt.checkbox_group,s),children:[e&&l.jsx("span",{className:Vt.group_label,children:e}),l.jsx("div",{role:"group",className:H(Vt.checkbox_list,{[Vt.horizontal]:i==="horizontal",[Vt.vertical]:i==="vertical"}),children:S.default.Children.map(n,g=>{if(!S.default.isValidElement(g))return g;const u=g.props;return S.default.cloneElement(g,{isDisabled:c||u.isDisabled,isReadOnly:f||u.isReadOnly,isSelected:u.value?a.includes(u.value):u.isSelected,onChange:p=>{u.value&&_(u.value,p),u.onChange?.(p)}})})}),r&&o?l.jsx("span",{className:Vt.error_message,children:o}):t?l.jsx("span",{className:Vt.description,children:t}):null]})},Pe={contenedor:"_contenedor_fe47o_1",contenedor_superior:"_contenedor_superior_fe47o_17",input_con_icono:"_input_con_icono_fe47o_35",icono_busqueda:"_icono_busqueda_fe47o_45",input_busqueda:"_input_busqueda_fe47o_65",contenedor_acciones_botones:"_contenedor_acciones_botones_fe47o_93",contenedor_acciones:"_contenedor_acciones_fe47o_93",boton_basico:"_boton_basico_fe47o_127",texto_filtros:"_texto_filtros_fe47o_141",menu_configuraciones:"_menu_configuraciones_fe47o_173",boton_excel:"_boton_excel_fe47o_183",contenedor_tabla:"_contenedor_tabla_fe47o_203",encabezados:"_encabezados_fe47o_221",contenedor_datos:"_contenedor_datos_fe47o_239",datos:"_datos_fe47o_247",seleccionada:"_seleccionada_fe47o_283",columna:"_columna_fe47o_299",boton_acciones:"_boton_acciones_fe47o_345"};function eu(e,n,t=3){const o=Math.floor(t/2);let r=e-o;r<1&&(r=1),r+t-1>n&&(r=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,a)=>r+a)}function tu(e,n){return n===0?0:e>=n?n-1:e<0?0:e}const Ri=v.createContext(null),Go=Ri;function nu({children:e,data:n,columns:t,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:a,descargarExcel:d,actualizarTabla:c,selectorFilas:f=[],sinDatosProps:_}){const[g,u]=v.useState(""),p=ec(g,200),h=jn("only screen and (max-width: 830px)"),[m,b]=v.useState({pageIndex:0,pageSize:s}),[w,y]=v.useState({}),C=v.useMemo(()=>{const N=[];if(f.length>0&&!h){const $={id:"select",header:({table:P})=>l.jsx(dn,{color:"secondary",isSelected:P.getIsAllPageRowsSelected(),isIndeterminate:P.getIsSomePageRowsSelected()&&!P.getIsAllPageRowsSelected(),onChange:B=>P.toggleAllPageRowsSelected(!!B)}),cell:({row:P})=>l.jsx(dn,{color:"secondary",isSelected:P.getIsSelected(),isDisabled:!P.getCanSelect(),onChange:B=>P.toggleSelected(B)}),enableSorting:!1,enableHiding:!1};N.push($)}if(N.push(...t),o?.length){const $={id:"actions",header:"Acciones",cell:P=>l.jsx("div",{className:Pe.contenedor_acciones,children:o.map(B=>l.jsx("button",{type:"button",title:B.nombre,onClick:()=>B.evento(P.row.original),className:Pe.boton_acciones,children:B.icono},B.id))}),enableSorting:!1,enableHiding:!1};N.push($)}return N},[t,o,f,h]),I=v.useMemo(()=>C.map(N=>"accessorKey"in N?String(N.accessorKey):"id"in N?String(N.id):"").filter(Boolean),[C]),[x,M]=v.useState(I),k=Jc({data:n,columns:C,state:{pagination:m,globalFilter:p,columnOrder:x,rowSelection:w},enableRowSelection:f.length>0,onRowSelectionChange:y,onPaginationChange:b,onColumnOrderChange:M,getCoreRowModel:qc(),getSortedRowModel:Uc(),getFilteredRowModel:Wc(),getPaginationRowModel:Kc(),autoResetPageIndex:!1}),T=k.getPageCount();v.useEffect(()=>{const N=tu(m.pageIndex,T);N!==m.pageIndex&&b($=>({...$,pageIndex:N}))},[T]),v.useEffect(()=>{p!==void 0&&k.setPageIndex(0)},[p]);const A=v.useMemo(()=>k.getAllLeafColumns().filter(N=>N.id!=="actions"&&N.id!=="select"),[k]),V=v.useCallback(N=>{const P=t.find(B=>"accessorKey"in B?B.accessorKey===N:B.id===N)?.header;return typeof P=="string"||typeof P=="number"?String(P):N},[t]),U=v.useCallback(()=>{k.setColumnVisibility({}),k.setPageSize(s),k.setPageIndex(0),k.resetRowSelection(),M(I)},[k,s,I]),z=v.useCallback(N=>{const $=Math.max(1,Math.min(200,N));k.setPageSize($),k.setPageIndex(0)},[k]),E=v.useCallback(N=>{M($=>typeof N=="function"?N($):N)},[]),D={state:{ordenColumnas:x,table:k,columns:C,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:g,setInputBusqueda:u,filtros:a,descargarExcel:d,actualizarTabla:c,selectorFilas:f,sinDatosProps:_},todasLasColumnas:A,etiquetaColumna:V,restaurarConfiguracion:U,cambiarPageSize:z,cambiarOrdenColumnas:E};return l.jsx(Ri.Provider,{value:D,children:e})}function ou(){const e=v.useContext(Go);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function kt(){const e=v.useContext(Go);return e||null}function ru(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function Ut(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return Kt(o.column.columnDef.header,o.getContext());const r=n.getAllLeafColumns().find(s=>s.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function qi(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?Kt(t.column.columnDef.cell,t.getContext()):null}function ji(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function iu(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function su(e,n){if(n===0)return"";if(n===1)return Wo(e[0].nombre.toLowerCase());if(n===2)return`${Wo(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=n-2;return`${Wo(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Wo(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}const mt={contenedor:"_contenedor_xw36f_1",popover:"_popover_xw36f_9",popover_entrada:"_popover_entrada_xw36f_43",desvanecerDeslizarEntrada:"_desvanecerDeslizarEntrada_xw36f_1",popover_salida:"_popover_salida_xw36f_51",desvanecerDeslizarSalida:"_desvanecerDeslizarSalida_xw36f_1",ventana:"_ventana_xw36f_123",panel:"_panel_xw36f_141",panel_forward:"_panel_forward_xw36f_159",panelForwardIn:"_panelForwardIn_xw36f_1",panel_backward:"_panel_backward_xw36f_167",panelBackwardIn:"_panelBackwardIn_xw36f_1",header:"_header_xw36f_223",titulo:"_titulo_xw36f_247"};function Bi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Hi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 au(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 lu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.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 cu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function uu(e){return l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[l.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"}),l.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 du(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[l.jsx("circle",{cx:"12",cy:"12",r:"3"}),l.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 fu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:l.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 gu(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[l.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),l.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),l.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function _u(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[l.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),l.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function pu(e){return l.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[l.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),l.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function Gi(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function hu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M7.5 12.5q-.213 0-.356-.144T7 11.999t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143z"})})}function mu(e){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:l.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"})})}const vu=({titulo:e,onBack:n})=>l.jsxs("header",{className:mt.header,children:[l.jsx(lt,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:l.jsx(Bi,{})}),l.jsx("h3",{className:mt.titulo,children:e})]}),Lt={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function bu(){const e=kt(),[n,t]=v.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:s}=e,{ordenColumnas:a}=o,d=_=>g=>{t(_),g.dataTransfer.effectAllowed="move",g.dataTransfer.setData("text/plain",_)},c=_=>g=>{g.preventDefault(),!(!n||n===_)&&s?.(u=>{const p=[...u],h=p.indexOf(n),m=p.indexOf(_);return h===-1||m===-1?u:(p.splice(h,1),p.splice(m,0,n),p)})},f=()=>t(null);return l.jsx("div",{className:Lt.contenedor,children:l.jsx("ul",{className:Lt.lista,children:a.map(_=>{const g=r.find(m=>m.id===_);if(!g)return null;const u=g.getCanHide?.()??!0,p=g.getIsVisible(),h=n===g.id;return l.jsxs("li",{className:`${Lt.item} ${h?Lt.item_dragging:""}`,draggable:!0,onDragStart:d(g.id),onDragOver:c(g.id),onDrop:f,onDragEnd:f,children:[l.jsx("span",{className:Lt.icono_drag,"aria-label":"Arrastrar columna",children:l.jsx(gu,{})}),l.jsx("span",{className:Lt.nombre,children:i(g.id)}),l.jsx(dn,{size:"md",color:"primary",isSelected:p,isDisabled:!u,onChange:m=>g.toggleVisibility(m),className:Lt.checkbox})]},g.id)})})})}const fn={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function wu(){const e=kt(),[n,t]=v.useState(""),o=v.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(v.useEffect(()=>t(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,s=_=>Math.max(Ko,Math.min(Uo,_)),a=_=>{const g=r+_;g>=Ko&&g<=Uo&&i?.(g)},d=()=>{const _=parseInt(n,10),g=!isNaN(_)&&_>0?s(_):r;i?.(g),t(String(g))},c=_=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{t(String(r)),o.current?.blur()},ArrowUp:()=>{_.preventDefault(),a(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{_.preventDefault(),a(-1),setTimeout(()=>o.current?.select(),0)}})[_.key]?.()},f=_=>{const g=_.target.value;(g===""||/^\d+$/.test(g))&&t(g)};return l.jsxs("div",{className:fn.contenido,children:[l.jsx("p",{className:fn.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),l.jsxs("div",{className:fn.control,children:[l.jsx(lt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>a(-1),"aria-label":"Disminuir filas",disabled:r<=Ko,children:l.jsx(hu,{style:{fontSize:"var(--gaps-6)"}})}),l.jsx("div",{className:fn.valor,children:l.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:n,onChange:f,onKeyDown:c,onFocus:()=>o.current?.select(),onBlur:d,className:fn.input,"aria-label":"Número de filas por página"})}),l.jsx(lt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>a(1),"aria-label":"Aumentar filas",disabled:r>=Uo,children:l.jsx(Gi,{})})]})]})}const He={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function yu({navegar:e}){const n=kt();return l.jsxs("div",{className:He.contenedor,children:[l.jsx("nav",{className:He.menu,children:xu.map(({id:t,icono:o,nombre:r,descripcion:i})=>l.jsxs("button",{className:He.item,onClick:()=>e(t),children:[l.jsx("div",{className:He.icono_contenedor,children:l.jsx(o,{})}),l.jsxs("div",{className:He.texto,children:[l.jsx("span",{className:He.nombre,children:r}),l.jsx("span",{className:He.descripcion,children:i})]}),l.jsx(Hi,{className:He.chevron})]},t))}),l.jsx("div",{className:He.divider}),l.jsx("div",{className:He.menu,children:l.jsxs("button",{className:He.item,onClick:n?.restaurarConfiguracion,children:[l.jsx("div",{className:He.icono_contenedor,children:l.jsx(fu,{})}),l.jsxs("div",{className:He.texto,children:[l.jsx("span",{className:He.nombre,children:"Restaurar configuración"}),l.jsx("span",{className:He.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Ko=1,Uo=200,Wi=250,Cu=200,Su={panelPrincipal:{component:yu},panelColumnas:{component:bu,titulo:"Columnas visibles"},panelFilas:{component:wu,titulo:"Filas por página"}},xu=[{id:"panelColumnas",icono:_u,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:pu,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function $u(e,n,t){const o=v.useRef(t);o.current=t;const r=v.useRef(e);r.current=e;const i=v.useCallback(s=>{const a=s.target;o.current.some(c=>c.current?.contains(a))||r.current()},[]);v.useEffect(()=>{if(!n)return;const s=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(s),document.removeEventListener("mousedown",i)}},[n,i])}function Ki(e,n){v.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function Iu(e,n,t,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:s=0,offsetTop:a=0,offsetBottom:d=0}){const[c,f]=v.useState({top:0,left:0}),_=jn("only screen and (max-width: 480px)");return v.useEffect(()=>{if(!t||!e.current)return;const g=()=>{const u=e.current.getBoundingClientRect();let p=u.bottom+a,h=0;if(_)h=window.innerWidth-o-r;else{const b=u.right-o+i-s;h=Math.max(r,Math.min(b,window.innerWidth-o-r))}const m=n.current?.offsetHeight||400;p+m>window.innerHeight-r&&(p=u.top-m-d,p<r&&(p=u.bottom+a)),f({top:p,left:h})};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[t,_,o,r,i,s,a,d,e,n]),c}function Eu(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function ku(){const[e,n]=v.useState(!1),[t,o]=v.useState(!1),[r,i]=v.useState("panelPrincipal"),[s,a]=v.useState(null),d=v.useRef(null),c=v.useRef(null),f=v.useRef(null);Eu(t),$u(()=>g(),t,[d,c]),Ki(()=>g(),t);const _=Iu(d,c,t,{width:Wi,offsetRight:6,offsetTop:-2});v.useEffect(()=>{e&&(o(!0),a(null))},[e]),v.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function g(){t&&(n(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),a(null)},Cu))}function u(m){a(m==="panelPrincipal"?"backward":"forward"),i(m)}const p=Su[r],h=p.component;return l.jsxs("div",{className:mt.contenedor,children:[l.jsx(lt,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>n(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:l.jsx(du,{})}),t&&d.current&&Zn.createPortal(l.jsx("div",{ref:c,className:`${mt.popover} ${e?mt.popover_entrada:mt.popover_salida}`,role:"dialog",style:{top:`${_.top}px`,left:`${_.left}px`,width:Wi},children:l.jsx("div",{className:mt.ventana,children:l.jsxs("div",{className:H([mt.panel,mt[`panel_${s}`]]),children:[p.titulo&&l.jsx(vu,{titulo:p.titulo,onBack:()=>u("panelPrincipal")}),l.jsx(h,{navegar:u})]},r)})}),document.body)]})}function Mu(){const e=kt();if(!e)return null;const{state:n}=e,{inputBusqueda:t,setInputBusqueda:o,filtros:r,actualizarTabla:i,descargarExcel:s}=n,{abrirFiltros:a,filtrosAplicados:d=[]}=r||{},c=d?.length||0;return l.jsxs("section",{className:Pe.contenedor_superior,children:[l.jsxs("div",{className:Pe.input_con_icono,children:[l.jsx(au,{className:Pe.icono_busqueda}),l.jsx("input",{type:"text",placeholder:"Buscar...",value:t??"",onChange:f=>o&&o(f.target.value),className:Pe.input_busqueda})]}),l.jsxs("div",{className:Pe.contenedor_acciones_botones,children:[l.jsxs("div",{className:Pe.contenedor_acciones,children:[i!==void 0&&l.jsxs(lt,{variant:"light",className:Pe.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:[l.jsx(uu,{}),i?.cargando?"Actualizando...":"Actualizar tabla"]}),a!==void 0&&l.jsxs(lt,{onClick:a,variant:"light",className:Pe.boton_basico,children:[l.jsx(cu,{})," Filtros"]}),c>0?l.jsxs("div",{className:Pe.texto_filtros,children:[l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:l.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),l.jsx("p",{children:su(d,c)})]}):null]}),s!==void 0?l.jsxs(lt,{onClick:s,className:`${Pe.boton_basico} ${Pe.boton_excel}`,children:[l.jsx(lu,{})," Excel"]}):null]}),l.jsx("div",{className:Pe.menu_configuraciones,children:l.jsx(ku,{})})]})}const Mt={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function Fu(){const e=kt();if(!e)return null;const{state:n}=e,{table:t}=n,o=t.getPrePaginationRowModel().rows.length,r=t.getPageCount()||1,{pageIndex:i}=t.getState().pagination,s=i+1,a=eu(s,r),d=t.getCanPreviousPage(),c=t.getCanNextPage(),f=r>1,_=()=>{d&&t.previousPage()},g=()=>{c&&t.nextPage()},u=p=>{t.setPageIndex(p-1)};return l.jsxs("section",{className:Mt.contenedor_paginacion,children:[l.jsxs("p",{className:Mt.info_paginacion,children:["Documentos: ",o]}),f&&l.jsxs("div",{className:Mt.contenedor_botones,children:[d&&l.jsx(Bi,{onClick:_,"aria-disabled":!d,className:Mt.boton_paginacion}),a.map(p=>l.jsx("button",{type:"button",onClick:()=>u(p),className:p===s?Mt.pagina_activa:Mt.boton_num_paginacion,children:p},p)),c&&l.jsx(Hi,{onClick:g,"aria-disabled":!c,className:Mt.boton_paginacion})]}),l.jsxs("p",{className:Mt.info_paginacion,children:["Página ",s," de ",r]})]})}const we={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"};function Ui(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Xi(e){if(e)return e.id??e.accessorKey}const vt={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 Nu({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:r}){const s=t.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),a=["25vw","30vw","20vw","28vw","22vw","26vw"];return l.jsx("section",{className:we.contenedor_tabla_cards,children:Array.from({length:e}).map((d,c)=>l.jsxs("article",{className:we.contenedor_card,children:[l.jsxs("div",{className:we.contenedor_encabezado_card,children:[l.jsx("div",{className:we.contenedor_columna_card,children:o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:we.card_label,children:Ut(o,t)}),l.jsx("div",{className:we.card_valor,children:l.jsx("div",{className:`${vt.skeleton_elemento} ${vt.skeleton_elemento_encabezado}`})})]})}),l.jsx("div",{className:we.contenedor_columna_card,children:r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:we.card_label,children:Ut(r,t)}),l.jsx("div",{className:we.card_segundo_valor,children:l.jsx("div",{className:`${vt.skeleton_elemento} ${vt.skeleton_elemento_encabezado_segundo}`})})]})})]}),l.jsx("div",{className:we.contenedor_contenido_cards,children:s.map((f,_)=>l.jsxs("div",{className:we.contenedor_fila_card,children:[l.jsx("div",{className:we.card_fila_label,children:Ut(f.id,t)}),l.jsx("div",{className:we.card_fila_valor,children:l.jsx("div",{className:`${vt.skeleton_elemento} ${vt.skeleton_elemento_contenido}`,style:{width:a[_%a.length]}})})]},f.id))}),n>0&&l.jsx("div",{className:we.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((f,_)=>l.jsx("div",{className:vt.skeleton_accion,children:l.jsx("div",{className:`${vt.skeleton_elemento} ${vt.skeleton_elemento_encabezado}`})},`accion-${_}`))})]},`skeleton-card-${c}`))})}const Ft={contenedor:"_contenedor_1dqtq_1",envolvedor_cuadricula:"_envolvedor_cuadricula_1dqtq_33",svg_cuadricula:"_svg_cuadricula_1dqtq_61",envolvedor_contenido:"_envolvedor_contenido_1dqtq_77",icono_carpeta:"_icono_carpeta_1dqtq_97",titulo:"_titulo_1dqtq_111",descripcion:"_descripcion_1dqtq_129",boton_agregar:"_boton_agregar_1dqtq_145"};function Yi(){const e=v.useContext(Go),{sinDatosProps:n}=e?.state||{},{alAgregarRegistro:t,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:i="Agregar nuevo registro"}=n||{};return l.jsxs("div",{className:Ft.contenedor,children:[l.jsx(Au,{}),l.jsxs("div",{className:Ft.envolvedor_contenido,children:[l.jsx(Du,{}),l.jsx("h3",{className:Ft.titulo,children:o}),l.jsx("p",{className:Ft.descripcion,children:r}),t?l.jsxs(lt,{onClick:t,variant:"bordered",className:Ft.boton_agregar,children:[l.jsx(Gi,{})," ",i]}):null]})]})}function Au(){return l.jsx("div",{className:Ft.envolvedor_cuadricula,children:l.jsxs("svg",{className:Ft.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("defs",{children:l.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:l.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),l.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Du(){return l.jsxs("svg",{className:Ft.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.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)"}),l.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"}),l.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),l.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),l.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),l.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),l.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Pu=({fila:e,controls:n})=>(n?.length??0)>0?l.jsx("div",{className:we.contenedor_acciones_card,children:n?.map(o=>l.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${we.boton_acciones} ${we.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Ou=({columnasRestantes:e,table:n})=>e.length===0?null:l.jsx("div",{className:we.contenedor_contenido_cards,children:e.map(t=>l.jsxs("div",{className:we.contenedor_fila_card,children:[l.jsx("div",{className:we.card_fila_label,children:Ut(t.column.id,n)}),l.jsx("div",{className:we.card_fila_valor,children:Kt(t.column.columnDef.cell,t.getContext())})]},t.id))}),Vu=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const r=ji(e,t),i=ji(e,o);return l.jsxs("div",{className:we.contenedor_encabezado_card,children:[l.jsx("div",{className:we.contenedor_columna_card,children:t&&r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:we.card_label,children:Ut(t,n)}),l.jsx("div",{className:we.card_valor,children:qi(e,t)})]})}),l.jsx("div",{className:we.contenedor_columna_card,children:o&&i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:we.card_label,children:Ut(o,n)}),l.jsx("div",{className:we.card_segundo_valor,children:qi(e,o)})]})})]})};function Lu(){const e=kt();if(!e)return null;const{state:n}=e,{table:t,controls:o,primerasColumnas:r,loading:i,columns:s}=n;if(!t)return null;const a=s&&r?Ui(s,r[0]):void 0,d=s&&r?Ui(s,r[1]):void 0,c=Xi(a),f=Xi(d);if(i)return l.jsx(Nu,{filas:3,cantidadControles:o?.length??0,table:t,idPrimeraColumna:c,idSegundaColumna:f});const _=t.getRowModel().rows;return _.length===0?l.jsx("article",{className:we.contenedor_card,children:l.jsx(Yi,{})}):l.jsx("section",{className:we.contenedor_tabla_cards,children:_.map(g=>{const u=iu(g,c,f);return l.jsxs("article",{className:we.contenedor_card,children:[l.jsx(Vu,{fila:g,table:t,idPrimeraColumna:c,idSegundaColumna:f}),l.jsx(Ou,{columnasRestantes:u,table:t}),l.jsx(Pu,{fila:g,controls:o})]},g.id)})})}const Zi={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},Tu=({columnas:e,filas:n})=>l.jsx(l.Fragment,{children:Array.from({length:n}).map((t,o)=>l.jsx("tr",{className:Zi.filas,children:Array.from({length:e}).map((r,i)=>l.jsx("td",{className:Zi.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),Tt={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function zu({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[r,i]=v.useState(0),[s,a]=v.useState([]),[d,c]=v.useState([]),f=e>0,_=v.useRef(null);return Ki(o,f),v.useEffect(()=>{f&&(i(e),a(n),c(t))},[e,n,t,f]),l.jsx(hn,{mostrar:f,tipo:"escalar",className:Tt.contenedor,children:l.jsxs("div",{ref:_,className:Tt.barra,children:[l.jsxs("div",{className:Tt.info,children:[l.jsx(lt,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:Tt.btn_cerrar,children:l.jsx(mu,{})}),l.jsxs("p",{className:Tt.contador,children:[r," filas seleccionadas"]})]}),l.jsx("div",{className:Tt.separador}),l.jsx("div",{className:Tt.acciones,children:s.map(g=>l.jsx("div",{children:g.componente(d)},g.id))})]})})}function Ru(){const e=kt();if(!e)return null;const{state:n}=e,{table:t,loading:o,columns:r,selectorFilas:i=[]}=n;if(!t)return null;const s=t.getHeaderGroups(),a=t.getRowModel().rows,d=r?.length??0,c=t.getSelectedRowModel().rows,f=c.length,_=()=>{t.resetRowSelection()};return l.jsxs(l.Fragment,{children:[l.jsxs("table",{className:Pe.contenedor_tabla,children:[l.jsx("thead",{children:s.map(g=>l.jsx("tr",{children:g.headers.map(u=>{const p=u.column.columnDef.meta?.style;return l.jsx("th",{className:Pe.encabezados,style:p,children:u.id==="select"?l.jsx("div",{children:Kt(u.column.columnDef.header,u.getContext())}):l.jsxs("div",{onClick:u.column.getToggleSortingHandler(),children:[Kt(u.column.columnDef.header,u.getContext()),ru(u.column.getIsSorted())]})},u.id)})},g.id))}),l.jsx("tbody",{className:Pe.contenedor_datos,children:o?l.jsx(Tu,{columnas:d,filas:10}):a.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:l.jsx(Yi,{})})}):a.map(g=>l.jsx("tr",{className:`${Pe.datos} ${g.getIsSelected()?Pe.seleccionada:""}`,children:g.getVisibleCells().map(u=>{const p=u.column.columnDef.meta?.style;return l.jsx("td",{className:Pe.columna,style:p,children:Kt(u.column.columnDef.cell,u.getContext())},u.id)})},g.id))})]}),i?.length>0?l.jsx(zu,{totalSeleccionadas:f,acciones:i,filasSeleccionadas:c.map(g=>g.original),onLimpiarSeleccion:_}):null]})}function qu({id:e}){const n=jn("only screen and (max-width: 830px)");return l.jsxs("main",{className:Pe.contenedor,id:e,children:[l.jsx(Mu,{}),n?l.jsx(Lu,{}):l.jsx(Ru,{}),l.jsx(Fu,{})]})}function ju({id:e,...n}){return l.jsx(nu,{...n,children:l.jsx(qu,{id:e})})}ie.BadgeVoz=to,ie.Boton=lt,ie.Checkbox=dn,ie.CheckboxGroup=Qc,ie.FirmaManual=er,ie.GrabacionIcono=ar,ie.InputDate=sr,ie.InputNumeric=ir,ie.InputText=tr,ie.MicrofonoIcono=Qn,ie.Select=ki,ie.SonidoIcono=eo,ie.TablaDatos=ju,ie.TextArea=cr,ie.Transicion=hn,ie.aplanarOpcionesAgrupadas=xi,ie.esOpcionesAgrupadas=Si,ie.estaDeshabilitada=ln,ie.estaSeleccionada=Ci,ie.fechaEnRango=Ss,ie.filtrarOpciones=ko,ie.filtrarOpcionesAgrupadas=$i,ie.formatearFecha=ys,ie.formatearNumero=Xt,ie.generarOpcionesAleatorias=rc,ie.generarUsuariosPrueba=ic,ie.obtenerFechaHoy=Cs,ie.obtenerLabelOpcion=Bn,ie.obtenerValorOpcion=Wt,ie.parsearNumero=nr,ie.procesarValidacion=or,ie.redondearDecimales=rr,ie.restringirRango=pn,ie.useReconocimientoVoz=lr,ie.useTablaContext=ou,ie.useTablaContextSafe=kt,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})}));
|
|
29
|
+
//# sourceMappingURL=index.umd.cjs.map
|